Section 1
//AntAfrican (com.xitexsoftware.gamepack.monsters.AntAfrican)
package com.xitexsoftware.gamepack.monsters {
import com.xitexsoftware.gamepack.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class AntAfrican extends BaseMonster {
public var boses;// = false
public var canCarry;// = true
private var _speed:int;
public var underground;// = false
public var levelNum:int;
public var score:int;// = 20
public var ground;// = true
public var flying;// = false
public var baseHealth:int;// = 20
public var health:int;// = 20
public var money:int;// = 3
public var monsterVis:Boolean;// = false
public function AntAfrican(_arg1:MovieClip, _arg2:int, _arg3:int, _arg4:Map, _arg5, _arg6:int=0, _arg7:int=20, _arg8:int=3, _arg9:int=20, _arg10:int=0):void{
var _local11:Number;
var _local12:Number;
_speed = new int(45);
health = 20;
baseHealth = 20;
score = 20;
money = 3;
flying = false;
underground = false;
ground = true;
canCarry = true;
boses = false;
monsterVis = false;
levelNum = new int();
this.levelNum = _arg10;
this.health = _arg7;
this.score = _arg9;
this.money = _arg8;
this.baseHealth = _arg7;
super(_speed);
this.healthBar = new McHealthBar();
this.healthBar.stop();
this.healthBar.y = (this.healthBar.y - 10);
this.addChild(this.healthBar);
monName = _arg5;
_graph = _arg1;
map = _arg4;
this.x = (((_arg2 * _arg4.tileSize) + _arg4.x) + (_arg4.tileSize / 2));
this.y = (((_arg3 * _arg4.tileSize) + map.y) + (_arg4.tileSize / 2));
this.thisCord = new Point(this.x, this.y);
this.addChild(_graph);
this.curPoint = new Point(_arg2, _arg3);
if (_arg6 == 0){
this.targPoint = new Point((16 + Math.floor((Math.random() * 4))), 36);
} else {
this.targPoint = new Point((Map.map_width - 1), (16 + Math.floor((Math.random() * 4))));
};
_local11 = (Math.round((Math.random() * 5)) - 2);
_local12 = (Math.round((Math.random() * 5)) - 2);
this._graph.y = (this._graph.y + _local11);
this._graph.x = (this._graph.x + _local12);
this.healthBar.y = (this.healthBar.y + _local11);
this.healthBar.x = (this.healthBar.x + _local12);
nextPoint = Utilites.pathFind(map.tileArray, curPoint.x, curPoint.y, targPoint.x, targPoint.y)[0];
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (_arg4.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (_arg4.tileSize / 2)));
this.rotate();
myTimer = new Timer((1000 / _speed), 0);
myTimer.addEventListener("timer", timerHandler);
myTimer.start();
}
}
}//package com.xitexsoftware.gamepack.monsters
Section 2
//AntBig (com.xitexsoftware.gamepack.monsters.AntBig)
package com.xitexsoftware.gamepack.monsters {
import com.xitexsoftware.gamepack.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class AntBig extends BaseMonster {
public var boses;// = false
public var canCarry;// = true
private var _speed:int;
public var underground;// = false
public var levelNum:int;
public var score:int;// = 30
public var ground;// = true
public var flying;// = false
public var baseHealth:int;// = 25
public var health:int;// = 25
public var money:int;// = 5
public var monsterVis:Boolean;// = false
public function AntBig(_arg1:MovieClip, _arg2:int, _arg3:int, _arg4:Map, _arg5, _arg6:int=0, _arg7:int=30, _arg8:int=5, _arg9:int=30, _arg10:int=0):void{
var _local11:Number;
var _local12:Number;
_speed = new int(30);
health = 25;
baseHealth = 25;
score = 30;
money = 5;
flying = false;
underground = false;
ground = true;
canCarry = true;
boses = false;
monsterVis = false;
levelNum = new int();
this.levelNum = _arg10;
this.health = _arg7;
this.score = _arg9;
this.money = _arg8;
this.baseHealth = _arg7;
super(_speed);
this.healthBar = new McHealthBar();
this.healthBar.stop();
this.healthBar.y = (this.healthBar.y - 10);
this.addChild(this.healthBar);
monName = _arg5;
_graph = _arg1;
map = _arg4;
this.x = (((_arg2 * _arg4.tileSize) + _arg4.x) + (_arg4.tileSize / 2));
this.y = (((_arg3 * _arg4.tileSize) + map.y) + (_arg4.tileSize / 2));
this.thisCord = new Point(this.x, this.y);
this.addChild(_graph);
this.curPoint = new Point(_arg2, _arg3);
if (_arg6 == 0){
this.targPoint = new Point((16 + Math.floor((Math.random() * 4))), 36);
} else {
this.targPoint = new Point((Map.map_width - 1), (16 + Math.floor((Math.random() * 4))));
};
_local11 = (Math.round((Math.random() * 5)) - 2);
_local12 = (Math.round((Math.random() * 5)) - 2);
this._graph.y = (this._graph.y + _local11);
this._graph.x = (this._graph.x + _local12);
this.healthBar.y = (this.healthBar.y + _local11);
this.healthBar.x = (this.healthBar.x + _local12);
nextPoint = Utilites.pathFind(map.tileArray, curPoint.x, curPoint.y, targPoint.x, targPoint.y)[0];
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (_arg4.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (_arg4.tileSize / 2)));
this.rotate();
myTimer = new Timer((1000 / _speed), 0);
myTimer.addEventListener("timer", timerHandler);
myTimer.start();
}
}
}//package com.xitexsoftware.gamepack.monsters
Section 3
//Ants (com.xitexsoftware.gamepack.monsters.Ants)
package com.xitexsoftware.gamepack.monsters {
import com.xitexsoftware.gamepack.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class Ants extends BaseMonster {
public var boses;// = false
public var canCarry;// = true
private var _speed:int;
public var underground;// = false
public var levelNum:int;
public var score:int;// = 15
public var ground;// = true
public var flying;// = false
public var baseHealth:int;// = 15
public var health:int;// = 15
public var money:int;// = 2
public var monsterVis:Boolean;// = false
public function Ants(_arg1:MovieClip, _arg2:int, _arg3:int, _arg4:Map, _arg5, _arg6:int=0, _arg7:int=10, _arg8:int=1, _arg9:int=10, _arg10:int=2):void{
var _local11:Number;
var _local12:Number;
_speed = new int(30);
health = 15;
baseHealth = 15;
score = 15;
money = 2;
flying = false;
underground = false;
ground = true;
canCarry = true;
boses = false;
monsterVis = false;
levelNum = new int();
this.levelNum = _arg10;
this.health = _arg7;
this.score = _arg9;
this.money = _arg8;
this.baseHealth = _arg7;
super(_speed);
this.healthBar = new McHealthBar();
this.healthBar.stop();
this.healthBar.y = (this.healthBar.y - 10);
this.addChild(this.healthBar);
monName = _arg5;
_graph = _arg1;
map = _arg4;
this.x = (((_arg2 * _arg4.tileSize) + _arg4.x) + (_arg4.tileSize / 2));
this.y = (((_arg3 * _arg4.tileSize) + map.y) + (_arg4.tileSize / 2));
this.thisCord = new Point(this.x, this.y);
this.addChild(_graph);
this.curPoint = new Point(_arg2, _arg3);
if (_arg6 == 0){
this.targPoint = new Point((16 + Math.floor((Math.random() * 4))), 36);
} else {
this.targPoint = new Point((Map.map_width - 1), (16 + Math.floor((Math.random() * 4))));
};
_local11 = (Math.round((Math.random() * 5)) - 2);
_local12 = (Math.round((Math.random() * 5)) - 2);
this._graph.y = (this._graph.y + _local11);
this._graph.x = (this._graph.x + _local12);
this.healthBar.y = (this.healthBar.y + _local11);
this.healthBar.x = (this.healthBar.x + _local12);
nextPoint = Utilites.pathFind(map.tileArray, curPoint.x, curPoint.y, targPoint.x, targPoint.y)[0];
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (_arg4.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (_arg4.tileSize / 2)));
this.rotate();
myTimer = new Timer((1000 / _speed), 0);
myTimer.addEventListener("timer", timerHandler);
myTimer.start();
}
}
}//package com.xitexsoftware.gamepack.monsters
Section 4
//AntSmall (com.xitexsoftware.gamepack.monsters.AntSmall)
package com.xitexsoftware.gamepack.monsters {
import com.xitexsoftware.gamepack.*;
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class AntSmall extends MovieClip {
private const linearSpeed = 1;
private var _direction:int;
public var healthBar:MovieClip;
public var fireRate:int;// = 5
public var attack:int;// = 10
private var nextPoint:Point;
public var underground;// = false
public var health:int;// = 30
public var _graph:MovieClip;
private var myAttackTimer:Timer;
public var baseHealth:int;// = 500
private var _destroyStationSound:DestroyStationSound;
public var score:int;// = 30
public var flying;// = false
public var changes:Boolean;// = true
public var money:int;// = 5
private var myTimer:Timer;
public var boses;// = false
private var timersChange:Boolean;// = false
public var curPoint:Point;
public var canCarry;// = true
private var pathArray:Array;
private var afterAttack:Boolean;
private var _speed:int;
private var targPoint:Point;
public var levelNum:int;
public var map:Map;
private var thisCord:Point;
private var tmpArray:Array;
public var ground;// = true
private var nextPointCord:Point;
public var hasBonus:Boolean;// = false
public var monName:String;
private var slowTimer:Timer;
public var monsterVis:Boolean;// = false
public function AntSmall(_arg1:MovieClip, _arg2:int, _arg3:int, _arg4:Map, _arg5, _arg6:int=0, _arg7:int=30, _arg8:int=5, _arg9:int=30, _arg10:int=0):void{
_speed = new int(30);
baseHealth = 500;
health = 30;
score = 30;
money = 5;
attack = 10;
fireRate = 5;
flying = false;
underground = false;
ground = true;
canCarry = true;
boses = false;
hasBonus = false;
monsterVis = false;
timersChange = false;
changes = true;
levelNum = new int();
super();
this.levelNum = _arg10;
this._destroyStationSound = new DestroyStationSound();
this.health = _arg7;
this.score = _arg9;
this.money = _arg8;
this.baseHealth = _arg7;
this.slowTimer = new Timer(10000, 0);
this.slowTimer.addEventListener("timer", onSlowTimer);
this.healthBar = new McHealthBar();
this.healthBar.stop();
this.healthBar.y = (this.healthBar.y - 10);
this.addChild(this.healthBar);
monName = _arg5;
_graph = _arg1;
_direction = _arg6;
map = _arg4;
this.x = (((_arg2 * _arg4.tileSize) + _arg4.x) + (_arg4.tileSize / 2));
this.y = (((_arg3 * _arg4.tileSize) + map.y) + (_arg4.tileSize / 2));
this.thisCord = new Point(this.x, this.y);
this.addChild(_graph);
this.curPoint = new Point(_arg2, _arg3);
if (_arg6 == 0){
nextPoint = new Point(this.curPoint.x, (this.curPoint.y + 1));
this._graph.rotation = 180;
} else {
nextPoint = new Point((this.curPoint.x + 1), this.curPoint.y);
this._graph.rotation = 90;
};
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (_arg4.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (_arg4.tileSize / 2)));
myTimer = new Timer((1000 / _speed), 0);
myAttackTimer = new Timer((3000 / fireRate), 0);
myAttackTimer.addEventListener("timer", attackTimerHandler);
myTimer.addEventListener("timer", timerHandler);
myTimer.start();
}
public function slow(_arg1:Number){
this.slowTimer.start();
this.myTimer.delay = Math.round(((1000 / _speed) * (1 + _arg1)));
}
public function moveDown():void{
this.y = (this.y + this._speed);
}
public function moveTo(_arg1:Point):void{
this.x = _arg1.x;
this.y = _arg1.y;
}
private function timerHandler(_arg1:TimerEvent):void{
if (_direction == 0){
this.y = (this.y + linearSpeed);
} else {
this.x = (this.x + linearSpeed);
};
if (afterAttack == true){
afterAttack = false;
} else {
this.thisCord.x = this.x;
this.thisCord.y = this.y;
};
if (Point.distance(this.thisCord, this.nextPointCord) <= linearSpeed){
this.curPoint.x = this.nextPoint.x;
this.curPoint.y = this.nextPoint.y;
map.tileArray[curPoint.y][curPoint.x].attackMe(this);
if (_direction == 0){
nextPoint = new Point(this.curPoint.x, (this.curPoint.y + 1));
} else {
nextPoint = new Point((this.curPoint.x + 1), this.curPoint.y);
};
if (map.tileArray[this.nextPoint.y] != undefined){
if (map.tileArray[this.nextPoint.y][this.nextPoint.x] != undefined){
if (map.tileArray[this.nextPoint.y][this.nextPoint.x]._turret != undefined){
this.myTimer.stop();
this._graph.gotoAndPlay("attack");
afterAttack = true;
myAttackTimer.start();
return;
};
};
};
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (map.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (map.tileSize / 2)));
if ((((nextPoint.x < (Map.map_width - 1))) && ((nextPoint.y < 34)))){
} else {
myTimer.stop();
this.myTimer.removeEventListener("timer", timerHandler);
this.dispatchEvent(new Event("onWayOut"));
};
};
}
public function moveUp():void{
this.y = (this.y - this._speed);
}
public function start(){
if (timersChange){
myAttackTimer.start();
} else {
myTimer.start();
};
slowTimer.start();
this._graph.play();
}
public function clear(){
myTimer.stop();
myAttackTimer.stop();
this.myTimer.removeEventListener("timer", timerHandler);
}
public function onSlowTimer(_arg1:TimerEvent){
this.slowTimer.stop();
this.myTimer.delay = (1000 / _speed);
}
private function attackTimerHandler(_arg1:TimerEvent){
if (map.tileArray[nextPoint.y][nextPoint.x]._turret != undefined){
map.tileArray[curPoint.y][curPoint.x].attackMe(this);
this._graph.gotoAndPlay("attack");
map.tileArray[nextPoint.y][nextPoint.x]._turret.defense = (map.tileArray[nextPoint.y][nextPoint.x]._turret.defense - this.attack);
if (map.tileArray[nextPoint.y][nextPoint.x]._turret.totGraph.tur_graph.mc_attack != null){
map.tileArray[nextPoint.y][nextPoint.x]._turret.totGraph.tur_graph.mc_attack.play();
};
if (map.tileArray[nextPoint.y][nextPoint.x]._turret.defense <= 0){
this._destroyStationSound.play();
map.tileArray[nextPoint.y][nextPoint.x]._turret.kill();
this._graph.gotoAndPlay(1);
this.nextPoint.x = this.curPoint.x;
this.nextPoint.y = this.curPoint.y;
this.myAttackTimer.stop();
this.myTimer.start();
};
} else {
this._graph.gotoAndPlay(1);
this.nextPoint.x = this.curPoint.x;
this.nextPoint.y = this.curPoint.y;
this.myAttackTimer.stop();
this.myTimer.start();
};
}
public function moveRight():void{
this.x = (this.x + this._speed);
}
function rotate(){
var _local1:Point;
_local1 = curPoint.subtract(nextPoint);
if (_local1.x == 1){
if (_local1.y == 1){
this._graph.rotation = 315;
} else {
if (_local1.y == 0){
this._graph.rotation = 270;
} else {
this._graph.rotation = 225;
};
};
} else {
if (_local1.x == 0){
if (_local1.y == 1){
this._graph.rotation = 0;
} else {
this._graph.rotation = 180;
};
} else {
if (_local1.y == 1){
this._graph.rotation = 45;
} else {
if (_local1.y == 0){
this._graph.rotation = 90;
} else {
this.rotation = 135;
};
};
};
};
}
public function kill(){
if (this.hasBonus){
this.hasBonus = false;
Main.dropBonus(this.curPoint);
};
this.dispatchEvent(new Event("onDeath"));
}
public function moveLeft():void{
this.x = (this.x - this._speed);
}
public function pause(){
if (myTimer.running){
myTimer.stop();
timersChange = false;
} else {
myAttackTimer.stop();
timersChange = true;
};
slowTimer.stop();
this._graph.stop();
}
public function addBonus(_arg1:Bonus){
this.hasBonus = true;
}
}
}//package com.xitexsoftware.gamepack.monsters
Section 5
//AntWinged (com.xitexsoftware.gamepack.monsters.AntWinged)
package com.xitexsoftware.gamepack.monsters {
import com.xitexsoftware.gamepack.*;
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class AntWinged extends MovieClip {
private const linearSpeed = 1;
private var _direction:int;
public var healthBar:MovieClip;
public var curPoint:Point;
public var canCarry;// = false
private var pathArray:Array;
private var _speed:int;
public var boses;// = false
private var targPoint:Point;
public var underground;// = false
public var map:Map;
public var levelNum:int;
private var thisCord:Point;
public var _graph:MovieClip;
private var nextPoint:Point;
private var tmpArray:Array;
public var health:int;// = 35
public var ground;// = false
public var score:int;// = 50
public var flying;// = true
public var hasBonus:Boolean;// = false
public var baseHealth:int;// = 35
private var nextPointCord:Point;
public var monName:String;
public var changes:Boolean;// = true
public var money:int;// = 5
private var slowTimer:Timer;
public var monsterVis:Boolean;// = false
private var myTimer:Timer;
public function AntWinged(_arg1:MovieClip, _arg2:int, _arg3:int, _arg4:Map, _arg5, _arg6:int=0, _arg7:int=35, _arg8:int=5, _arg9:int=50, _arg10:int=0):void{
_speed = new int(30);
baseHealth = 35;
health = 35;
score = 50;
money = 5;
flying = true;
underground = false;
ground = false;
canCarry = false;
hasBonus = false;
boses = false;
monsterVis = false;
changes = true;
levelNum = new int();
super();
this.levelNum = _arg10;
this.health = _arg7;
this.score = _arg9;
this.money = _arg8;
this.baseHealth = _arg7;
this.slowTimer = new Timer(10000, 0);
this.slowTimer.addEventListener("timer", onSlowTimer);
this.healthBar = new McHealthBar();
this.healthBar.stop();
this.healthBar.y = (this.healthBar.y - 10);
this.addChild(this.healthBar);
monName = _arg5;
_graph = _arg1;
map = _arg4;
_direction = _arg6;
this.x = (((_arg2 * _arg4.tileSize) + _arg4.x) + (_arg4.tileSize / 2));
this.y = (((_arg3 * _arg4.tileSize) + map.y) + (_arg4.tileSize / 2));
this.thisCord = new Point(this.x, this.y);
this.addChild(_graph);
this.curPoint = new Point(_arg2, _arg3);
if (_arg6 == 0){
this.targPoint = new Point((16 + Math.floor((Math.random() * 4))), 36);
} else {
this.targPoint = new Point((Map.map_width - 1), (16 + Math.floor((Math.random() * 4))));
};
nextPoint = Utilites.pathFind(map.tileArray, curPoint.x, curPoint.y, targPoint.x, targPoint.y)[0];
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (_arg4.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (_arg4.tileSize / 2)));
this.rotate();
myTimer = new Timer((1000 / _speed), 0);
myTimer.addEventListener("timer", timerHandler);
myTimer.start();
}
public function slow(_arg1:Number){
this.slowTimer.start();
this.myTimer.delay = Math.round(((1000 / _speed) * (1 + _arg1)));
}
public function moveTo(_arg1:Point):void{
this.x = _arg1.x;
this.y = _arg1.y;
}
public function moveDown():void{
this.y = (this.y + this._speed);
}
public function timerHandler(_arg1:TimerEvent):void{
switch (this._graph.rotation){
case 0:
this.y = (this.y - linearSpeed);
break;
case 45:
this.y = (this.y - linearSpeed);
this.x = (this.x + linearSpeed);
break;
case 90:
this.x = (this.x + linearSpeed);
break;
case 135:
this.y = (this.y + linearSpeed);
this.x = (this.x + linearSpeed);
break;
case 180:
this.y = (this.y + linearSpeed);
break;
case -135:
this.y = (this.y + linearSpeed);
this.x = (this.x - linearSpeed);
break;
case -90:
this.x = (this.x - linearSpeed);
break;
case -45:
this.y = (this.y - linearSpeed);
this.x = (this.x - linearSpeed);
break;
};
this.thisCord.x = this.x;
this.thisCord.y = this.y;
if (Point.distance(this.thisCord, this.nextPointCord) <= linearSpeed){
this.curPoint.x = this.nextPoint.x;
this.curPoint.y = this.nextPoint.y;
map.tileArray[curPoint.y][curPoint.x].attackMe(this);
if (_direction == 0){
nextPoint = new Point(this.curPoint.x, (this.curPoint.y + 1));
} else {
nextPoint = new Point((this.curPoint.x + 1), this.curPoint.y);
};
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (map.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (map.tileSize / 2)));
if ((((nextPoint.x < (Map.map_width - 1))) && ((nextPoint.y < 34)))){
this.rotate();
} else {
myTimer.stop();
this.myTimer.removeEventListener("timer", timerHandler);
this.dispatchEvent(new Event("onWayOut"));
};
};
}
public function moveUp():void{
this.y = (this.y - this._speed);
}
function rotate(){
var _local1:Point;
_local1 = curPoint.subtract(nextPoint);
if (_local1.x == 1){
if (_local1.y == 1){
this._graph.rotation = 315;
} else {
if (_local1.y == 0){
this._graph.rotation = 270;
} else {
this._graph.rotation = 225;
};
};
} else {
if (_local1.x == 0){
if (_local1.y == 1){
this._graph.rotation = 0;
} else {
this._graph.rotation = 180;
};
} else {
if (_local1.y == 1){
this._graph.rotation = 45;
} else {
if (_local1.y == 0){
this._graph.rotation = 90;
} else {
this._graph.rotation = 135;
};
};
};
};
}
public function kill(){
this.dispatchEvent(new Event("onDeath"));
}
public function moveLeft():void{
this.x = (this.x - this._speed);
}
public function start(){
myTimer.start();
slowTimer.start();
this._graph.play();
}
public function clear(){
myTimer.stop();
this.myTimer.removeEventListener("timer", timerHandler);
}
public function onSlowTimer(_arg1:TimerEvent){
this.slowTimer.stop();
this.myTimer.delay = (1000 / _speed);
}
public function moveRight():void{
this.x = (this.x + this._speed);
}
public function pause(){
myTimer.stop();
slowTimer.stop();
this._graph.stop();
}
}
}//package com.xitexsoftware.gamepack.monsters
Section 6
//BaseAttackMonster (com.xitexsoftware.gamepack.monsters.BaseAttackMonster)
package com.xitexsoftware.gamepack.monsters {
import com.xitexsoftware.gamepack.*;
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class BaseAttackMonster extends MovieClip {
protected const linearSpeed = 1;
public var healthBar:MovieClip;
private var timersChange:Boolean;// = false
public var curPoint:Point;
private var pathArray:Array;
protected var targPoint:Point;
public var map:Map;
private var afterAttack:Boolean;
protected var thisCord:Point;
public var _graph:MovieClip;
protected var nextPoint:Point;
protected var _tspeed:int;
protected var tmpArray:Array;
private var myAttackTimer:Timer;
private var _destroyStationSound:DestroyStationSound;
public var hasBonus:Boolean;// = false
protected var nextPointCord:Point;
public var monName:String;
private var tattack:int;
public var changes:Boolean;// = true
private var slowTimer:Timer;
protected var myTimer:Timer;
public function BaseAttackMonster(_arg1:int, _arg2:int, _arg3:int){
hasBonus = false;
timersChange = false;
changes = true;
super();
this._destroyStationSound = new DestroyStationSound();
_tspeed = _arg1;
tattack = _arg2;
this.slowTimer = new Timer(10000, 0);
this.slowTimer.addEventListener("timer", onSlowTimer);
myAttackTimer = new Timer((3000 / _arg3), 0);
myAttackTimer.addEventListener("timer", attackTimerHandler);
myTimer = new Timer((1000 / _tspeed), 0);
myTimer.addEventListener("timer", timerHandler);
myTimer.start();
}
public function addBonus(_arg1:Bonus){
this.hasBonus = true;
}
public function slow(_arg1:Number){
this.slowTimer.start();
this.myTimer.delay = Math.round(((1000 / _tspeed) * (1 + _arg1)));
}
private function timerHandler(_arg1:TimerEvent):void{
var _local2:Boolean;
if (afterAttack == false){
switch (this._graph.rotation){
case 0:
this.y = (this.y - linearSpeed);
break;
case 45:
this.y = (this.y - linearSpeed);
this.x = (this.x + linearSpeed);
break;
case 90:
this.x = (this.x + linearSpeed);
break;
case 135:
this.y = (this.y + linearSpeed);
this.x = (this.x + linearSpeed);
break;
case 180:
this.y = (this.y + linearSpeed);
break;
case -135:
this.y = (this.y + linearSpeed);
this.x = (this.x - linearSpeed);
break;
case -90:
this.x = (this.x - linearSpeed);
break;
case -45:
this.y = (this.y - linearSpeed);
this.x = (this.x - linearSpeed);
break;
};
} else {
afterAttack = false;
};
this.thisCord.x = this.x;
this.thisCord.y = this.y;
if (Point.distance(this.thisCord, this.nextPointCord) > 20){
this.thisCord.x = this.nextPointCord.x;
this.thisCord.y = this.nextPointCord.y;
this.x = this.thisCord.x;
this.y = this.thisCord.y;
};
if (Point.distance(this.thisCord, this.nextPointCord) <= linearSpeed){
this.curPoint.x = this.nextPoint.x;
this.curPoint.y = this.nextPoint.y;
this.nextPoint.x = ((this.curPoint.x + Math.round((Math.random() * 2))) - 1);
this.nextPoint.y = ((this.curPoint.y + Math.round((Math.random() * 2))) - 1);
if (map.tileArray[this.nextPoint.y] != undefined){
if (map.tileArray[this.nextPoint.y][this.nextPoint.x] != undefined){
if (map.tileArray[this.nextPoint.y][this.nextPoint.x]._turret != undefined){
if (Math.round((Math.random() * 100)) < 50){
this.myTimer.stop();
this.rotate();
this._graph.gotoAndPlay("attack");
myAttackTimer.start();
return;
};
};
};
};
_local2 = true;
if (((((((!((Main._bonus == null))) && ((this.curPoint.x < 34)))) && ((this.curPoint.y < 29)))) && ((Main._bonus.follow == false)))){
tmpArray = returnPath(Main._bonus.tile.cord);
_local2 = false;
} else {
tmpArray = returnPath(targPoint);
};
map.tileArray[curPoint.y][curPoint.x].attackMe(this);
if (tmpArray.length > 1){
nextPoint = tmpArray[1];
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (map.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (map.tileSize / 2)));
this.rotate();
} else {
trace(_local2);
if (_local2 == true){
myTimer.stop();
this.myTimer.removeEventListener("timer", timerHandler);
this.dispatchEvent(new Event("onWayOut"));
} else {
this.changes = true;
trace(this.changes);
tmpArray = returnPath(targPoint);
if (tmpArray.length > 1){
nextPoint = tmpArray[1];
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (map.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (map.tileSize / 2)));
this.rotate();
} else {
myTimer.stop();
this.myTimer.removeEventListener("timer", timerHandler);
this.dispatchEvent(new Event("onWayOut"));
};
};
};
};
}
protected function rotate(){
var _local1:Point;
_local1 = curPoint.subtract(nextPoint);
if (_local1.x == 1){
if (_local1.y == 1){
this._graph.rotation = 315;
} else {
if (_local1.y == 0){
this._graph.rotation = 270;
} else {
this._graph.rotation = 225;
};
};
} else {
if (_local1.x == 0){
if (_local1.y == 1){
this._graph.rotation = 0;
} else {
this._graph.rotation = 180;
};
} else {
if (_local1.y == 1){
this._graph.rotation = 45;
} else {
if (_local1.y == 0){
this._graph.rotation = 90;
} else {
this._graph.rotation = 135;
};
};
};
};
}
public function start(){
if (timersChange){
myAttackTimer.start();
} else {
myTimer.start();
};
slowTimer.start();
this._graph.play();
}
public function kill(){
if (this.hasBonus){
this.hasBonus = false;
Main.dropBonus(this.curPoint);
};
this.dispatchEvent(new Event("onDeath"));
}
private function returnPath(_arg1:Point):Array{
if (this.changes){
this.pathArray = Utilites.pathFind(map.tileArray, curPoint.x, curPoint.y, _arg1.x, _arg1.y);
this.changes = false;
} else {
this.pathArray.shift();
};
return (this.pathArray);
}
public function clear(){
this.myTimer.stop();
this.slowTimer.stop();
this.myAttackTimer.stop();
this.slowTimer.removeEventListener("timer", onSlowTimer);
this.myTimer.removeEventListener("timer", timerHandler);
this.myAttackTimer.removeEventListener("timer", timerHandler);
}
public function onSlowTimer(_arg1:TimerEvent){
this.slowTimer.stop();
this.myTimer.delay = (1000 / _tspeed);
}
private function attackTimerHandler(_arg1:TimerEvent){
if (map.tileArray[nextPoint.y][nextPoint.x]._turret != undefined){
map.tileArray[curPoint.y][curPoint.x].attackMe(this);
this._graph.gotoAndPlay("attack");
map.tileArray[nextPoint.y][nextPoint.x]._turret.defense = (map.tileArray[nextPoint.y][nextPoint.x]._turret.defense - this.tattack);
if (map.tileArray[nextPoint.y][nextPoint.x]._turret.totGraph.tur_graph.mc_attack != null){
map.tileArray[nextPoint.y][nextPoint.x]._turret.totGraph.tur_graph.mc_attack.play();
};
if (map.tileArray[nextPoint.y][nextPoint.x]._turret.defense <= 0){
this._destroyStationSound.play();
map.tileArray[nextPoint.y][nextPoint.x]._turret.kill();
this._graph.gotoAndPlay(1);
this.nextPoint.x = this.curPoint.x;
this.nextPoint.y = this.curPoint.y;
this.myAttackTimer.stop();
tmpArray = Utilites.pathFind(map.tileArray, curPoint.x, curPoint.y, targPoint.x, targPoint.y);
if (tmpArray.length > 1){
nextPoint = tmpArray[1];
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (map.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (map.tileSize / 2)));
this.rotate();
};
afterAttack = true;
this.myTimer.start();
};
} else {
this._graph.gotoAndPlay(1);
this.nextPoint.x = this.curPoint.x;
this.nextPoint.y = this.curPoint.y;
this.myAttackTimer.stop();
tmpArray = Utilites.pathFind(map.tileArray, curPoint.x, curPoint.y, targPoint.x, targPoint.y);
if (tmpArray.length > 1){
nextPoint = tmpArray[1];
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (map.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (map.tileSize / 2)));
this.rotate();
};
afterAttack = true;
this.myTimer.start();
};
}
public function pause(){
if (myTimer.running){
myTimer.stop();
timersChange = false;
} else {
myAttackTimer.stop();
timersChange = true;
};
slowTimer.stop();
this._graph.stop();
}
}
}//package com.xitexsoftware.gamepack.monsters
Section 7
//BaseMonster (com.xitexsoftware.gamepack.monsters.BaseMonster)
package com.xitexsoftware.gamepack.monsters {
import com.xitexsoftware.gamepack.*;
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class BaseMonster extends MovieClip {
protected const linearSpeed = 1;
public var healthBar:MovieClip;
public var curPoint:Point;
private var pathArray:Array;
protected var targPoint:Point;
public var map:Map;
protected var thisCord:Point;
public var _graph:MovieClip;
protected var nextPoint:Point;
protected var _tspeed:int;
protected var tmpArray:Array;
public var hasBonus:Boolean;// = false
protected var nextPointCord:Point;
public var monName:String;
public var changes:Boolean;// = true
private var slowTimer:Timer;
protected var myTimer:Timer;
public function BaseMonster(_arg1:int){
hasBonus = false;
changes = true;
super();
_tspeed = _arg1;
this.slowTimer = new Timer(10000, 0);
this.slowTimer.addEventListener("timer", onSlowTimer);
}
public function addBonus(_arg1:Bonus){
this.hasBonus = true;
}
public function slow(_arg1:Number){
this.slowTimer.start();
this.myTimer.delay = Math.round(((1000 / _tspeed) * (1 + _arg1)));
}
public function timerHandler(_arg1:TimerEvent):void{
var _local2:Boolean;
switch (this._graph.rotation){
case 0:
this.y = (this.y - linearSpeed);
break;
case 45:
this.y = (this.y - linearSpeed);
this.x = (this.x + linearSpeed);
break;
case 90:
this.x = (this.x + linearSpeed);
break;
case 135:
this.y = (this.y + linearSpeed);
this.x = (this.x + linearSpeed);
break;
case 180:
this.y = (this.y + linearSpeed);
break;
case -135:
this.y = (this.y + linearSpeed);
this.x = (this.x - linearSpeed);
break;
case -90:
this.x = (this.x - linearSpeed);
break;
case -45:
this.y = (this.y - linearSpeed);
this.x = (this.x - linearSpeed);
break;
};
this.thisCord.x = this.x;
this.thisCord.y = this.y;
if (Point.distance(this.thisCord, this.nextPointCord) > 20){
this.thisCord.x = this.nextPointCord.x;
this.thisCord.y = this.nextPointCord.y;
this.x = this.thisCord.x;
this.y = this.thisCord.y;
};
if (Point.distance(this.thisCord, this.nextPointCord) <= linearSpeed){
this.curPoint.x = this.nextPoint.x;
this.curPoint.y = this.nextPoint.y;
_local2 = true;
if (((((((!((Main._bonus == null))) && ((this.curPoint.x < 34)))) && ((this.curPoint.y < 29)))) && ((Main._bonus.follow == false)))){
tmpArray = returnPath(Main._bonus.tile.cord);
_local2 = false;
} else {
tmpArray = returnPath(targPoint);
};
map.tileArray[curPoint.y][curPoint.x].attackMe(this);
if (tmpArray.length > 1){
nextPoint = tmpArray[1];
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (map.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (map.tileSize / 2)));
this.rotate();
} else {
if (_local2 == true){
myTimer.stop();
this.myTimer.removeEventListener("timer", timerHandler);
this.dispatchEvent(new Event("onWayOut"));
} else {
this.changes = true;
tmpArray = returnPath(targPoint);
if (tmpArray.length > 1){
nextPoint = tmpArray[1];
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (map.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (map.tileSize / 2)));
this.rotate();
} else {
myTimer.stop();
this.myTimer.removeEventListener("timer", timerHandler);
this.dispatchEvent(new Event("onWayOut"));
};
};
};
};
}
protected function rotate(){
var _local1:Point;
_local1 = curPoint.subtract(nextPoint);
if (_local1.x == 1){
if (_local1.y == 1){
this._graph.rotation = 315;
} else {
if (_local1.y == 0){
this._graph.rotation = 270;
} else {
this._graph.rotation = 225;
};
};
} else {
if (_local1.x == 0){
if (_local1.y == 1){
this._graph.rotation = 0;
} else {
this._graph.rotation = 180;
};
} else {
if (_local1.y == 1){
this._graph.rotation = 45;
} else {
if (_local1.y == 0){
this._graph.rotation = 90;
} else {
this._graph.rotation = 135;
};
};
};
};
}
public function start(){
myTimer.start();
slowTimer.start();
this._graph.play();
}
public function kill(){
if (this.hasBonus){
this.hasBonus = false;
Main.dropBonus(this.curPoint);
};
this.dispatchEvent(new Event("onDeath"));
}
private function returnPath(_arg1:Point):Array{
if (this.changes){
this.pathArray = Utilites.pathFind(map.tileArray, curPoint.x, curPoint.y, _arg1.x, _arg1.y);
this.changes = false;
} else {
this.pathArray.shift();
};
return (this.pathArray);
}
public function clear(){
myTimer.stop();
this.slowTimer.stop();
this.slowTimer.removeEventListener("timer", onSlowTimer);
this.myTimer.removeEventListener("timer", timerHandler);
}
public function onSlowTimer(_arg1:TimerEvent){
this.slowTimer.stop();
this.myTimer.delay = (1000 / _tspeed);
}
public function pause(){
myTimer.stop();
slowTimer.stop();
this._graph.stop();
}
}
}//package com.xitexsoftware.gamepack.monsters
Section 8
//Burrower (com.xitexsoftware.gamepack.monsters.Burrower)
package com.xitexsoftware.gamepack.monsters {
import com.xitexsoftware.gamepack.*;
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class Burrower extends MovieClip {
private const linearSpeed = 1;
public var healthBar:MovieClip;
private var myUndergroundTimer:Timer;
public var boses;// = false
public var curPoint:Point;
public var canCarry;// = false
private var pathArray:Array;
private var _speed:int;
private var targPoint:Point;
public var underground;// = false
public var map:Map;
public var levelNum:int;
private var thisCord:Point;
public var _graph:MovieClip;
private var nextPoint:Point;
private var tmpArray:Array;
public var health:int;// = 20
public var ground;// = true
public var score:int;// = 40
public var flying;// = false
public var hasBonus:Boolean;// = false
public var baseHealth:int;// = 20
private var nextPointCord:Point;
public var monName:String;
public var changes:Boolean;// = true
public var money:int;// = 4
private var slowTimer:Timer;
public var monsterVis:Boolean;// = false
private var myTimer:Timer;
public function Burrower(_arg1:MovieClip, _arg2:int, _arg3:int, _arg4:Map, _arg5, _arg6:int=0, _arg7:int=20, _arg8:int=4, _arg9:int=40, _arg10:int=0):void{
_speed = new int(30);
baseHealth = 20;
health = 20;
score = 40;
money = 4;
flying = false;
underground = false;
ground = true;
canCarry = false;
hasBonus = false;
boses = false;
monsterVis = false;
changes = true;
levelNum = new int();
super();
this.levelNum = _arg10;
this.health = _arg7;
this.score = _arg9;
this.money = _arg8;
this.baseHealth = _arg7;
this.slowTimer = new Timer(10000, 0);
this.slowTimer.addEventListener("timer", onSlowTimer);
this.healthBar = new McHealthBar();
this.healthBar.stop();
this.healthBar.y = (this.healthBar.y - 10);
this.addChild(this.healthBar);
monName = _arg5;
_graph = _arg1;
map = _arg4;
this.x = (((_arg2 * _arg4.tileSize) + _arg4.x) + (_arg4.tileSize / 2));
this.y = (((_arg3 * _arg4.tileSize) + map.y) + (_arg4.tileSize / 2));
this.thisCord = new Point(this.x, this.y);
this.addChild(_graph);
this.curPoint = new Point(_arg2, _arg3);
if (_arg6 == 0){
this.targPoint = new Point((16 + Math.floor((Math.random() * 4))), 36);
} else {
this.targPoint = new Point((Map.map_width - 1), (16 + Math.floor((Math.random() * 4))));
};
this._graph.y = (this._graph.y + (Math.round((Math.random() * 3)) - 1));
this._graph.x = (this._graph.x + (Math.round((Math.random() * 3)) - 1));
nextPoint = Utilites.pathFind(map.tileArray, curPoint.x, curPoint.y, targPoint.x, targPoint.y)[0];
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (_arg4.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (_arg4.tileSize / 2)));
this.rotate();
myTimer = new Timer((1000 / _speed), 0);
myUndergroundTimer = new Timer((60000 / _speed), 0);
myTimer.addEventListener("timer", timerHandler);
myUndergroundTimer.addEventListener("timer", onUnderground);
myTimer.start();
myUndergroundTimer.start();
}
private function onUnderground(_arg1:TimerEvent){
myTimer.stop();
myUndergroundTimer.stop();
_graph.addEventListener(Event.ENTER_FRAME, onGraphEnterFrame);
if (this.underground == false){
_graph.gotoAndPlay("down");
} else {
this.visible = !(this.visible);
_graph.gotoAndPlay("up");
};
}
public function slow(_arg1:Number){
this.slowTimer.start();
this.myTimer.delay = Math.round(((1000 / _speed) * (1 + _arg1)));
}
public function moveTo(_arg1:Point):void{
this.x = _arg1.x;
this.y = _arg1.y;
}
public function moveDown():void{
this.y = (this.y + this._speed);
}
public function timerHandler(_arg1:TimerEvent):void{
switch (this._graph.rotation){
case 0:
this.y = (this.y - linearSpeed);
break;
case 45:
this.y = (this.y - linearSpeed);
this.x = (this.x + linearSpeed);
break;
case 90:
this.x = (this.x + linearSpeed);
break;
case 135:
this.y = (this.y + linearSpeed);
this.x = (this.x + linearSpeed);
break;
case 180:
this.y = (this.y + linearSpeed);
break;
case -135:
this.y = (this.y + linearSpeed);
this.x = (this.x - linearSpeed);
break;
case -90:
this.x = (this.x - linearSpeed);
break;
case -45:
this.y = (this.y - linearSpeed);
this.x = (this.x - linearSpeed);
break;
};
this.thisCord.x = this.x;
this.thisCord.y = this.y;
if (Point.distance(this.thisCord, this.nextPointCord) <= linearSpeed){
this.curPoint.x = this.nextPoint.x;
this.curPoint.y = this.nextPoint.y;
tmpArray = returnPath(targPoint);
map.tileArray[curPoint.y][curPoint.x].attackMe(this);
if (tmpArray.length > 1){
nextPoint = tmpArray[1];
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (map.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (map.tileSize / 2)));
this.rotate();
} else {
myTimer.stop();
this.myTimer.removeEventListener("timer", timerHandler);
this.dispatchEvent(new Event("onWayOut"));
};
};
}
public function moveUp():void{
this.y = (this.y - this._speed);
}
function rotate(){
var _local1:Point;
_local1 = curPoint.subtract(nextPoint);
if (_local1.x == 1){
if (_local1.y == 1){
this._graph.rotation = 315;
} else {
if (_local1.y == 0){
this._graph.rotation = 270;
} else {
this._graph.rotation = 225;
};
};
} else {
if (_local1.x == 0){
if (_local1.y == 1){
this._graph.rotation = 0;
} else {
this._graph.rotation = 180;
};
} else {
if (_local1.y == 1){
this._graph.rotation = 45;
} else {
if (_local1.y == 0){
this._graph.rotation = 90;
} else {
this._graph.rotation = 135;
};
};
};
};
}
public function kill(){
this.dispatchEvent(new Event("onDeath"));
}
private function returnPath(_arg1:Point):Array{
if (this.changes){
this.pathArray = Utilites.pathFind(map.tileArray, curPoint.x, curPoint.y, _arg1.x, _arg1.y);
this.changes = false;
} else {
this.pathArray.shift();
};
return (this.pathArray);
}
public function moveLeft():void{
this.x = (this.x - this._speed);
}
public function start(){
myTimer.start();
slowTimer.start();
this._graph.play();
}
public function clear(){
myTimer.stop();
this.myTimer.removeEventListener("timer", timerHandler);
}
private function onGraphEnterFrame(_arg1:Event){
if (_arg1.target.currentLabel == "downcomp"){
this.visible = !(this.visible);
this._graph.removeEventListener(Event.ENTER_FRAME, onGraphEnterFrame);
this.myTimer.start();
myUndergroundTimer.start();
this.underground = !(this.underground);
};
if (_arg1.target.currentLabel == "upcomp"){
this._graph.removeEventListener(Event.ENTER_FRAME, onGraphEnterFrame);
this.myTimer.start();
myUndergroundTimer.start();
this.underground = !(this.underground);
this._graph.gotoAndPlay(1);
};
}
public function onSlowTimer(_arg1:TimerEvent){
this.slowTimer.stop();
this.myTimer.delay = (1000 / _speed);
}
public function moveRight():void{
this.x = (this.x + this._speed);
}
public function pause(){
myTimer.stop();
slowTimer.stop();
this._graph.stop();
}
}
}//package com.xitexsoftware.gamepack.monsters
Section 9
//FireAnt (com.xitexsoftware.gamepack.monsters.FireAnt)
package com.xitexsoftware.gamepack.monsters {
import com.xitexsoftware.gamepack.*;
import flash.geom.*;
import flash.display.*;
public class FireAnt extends BaseAttackMonster {
public var boses;// = false
public var canCarry;// = true
public var fireRate:int;// = 5
private var _speed:int;
public var attack:int;// = 10
public var underground;// = false
public var levelNum:int;
public var score:int;// = 50
public var flying;// = false
public var ground;// = true
public var baseHealth:int;// = 50
public var health:int;// = 50
public var money:int;// = 15
public var monsterVis:Boolean;// = false
public function FireAnt(_arg1:MovieClip, _arg2:int, _arg3:int, _arg4:Map, _arg5, _arg6:int=0, _arg7:int=50, _arg8:int=15, _arg9:int=50, _arg10:int=0):void{
_speed = new int(30);
health = 50;
baseHealth = 50;
score = 50;
money = 15;
attack = 10;
fireRate = 5;
flying = false;
underground = false;
ground = true;
canCarry = true;
boses = false;
monsterVis = false;
levelNum = new int();
this.levelNum = _arg10;
this.health = _arg7;
this.score = _arg9;
this.money = _arg8;
this.baseHealth = _arg7;
super(_speed, attack, fireRate);
this.healthBar = new McHealthBar();
this.healthBar.stop();
this.healthBar.y = (this.healthBar.y - 10);
this.addChild(this.healthBar);
monName = _arg5;
_graph = _arg1;
map = _arg4;
this.x = (((_arg2 * _arg4.tileSize) + _arg4.x) + (_arg4.tileSize / 2));
this.y = (((_arg3 * _arg4.tileSize) + map.y) + (_arg4.tileSize / 2));
this.thisCord = new Point(this.x, this.y);
this.addChild(_graph);
this.curPoint = new Point(_arg2, _arg3);
if (_arg6 == 0){
this.targPoint = new Point((16 + Math.floor((Math.random() * 4))), 36);
} else {
this.targPoint = new Point((Map.map_width - 1), (16 + Math.floor((Math.random() * 4))));
};
this._graph.y = (this._graph.y + (Math.round((Math.random() * 3)) - 1));
this._graph.x = (this._graph.x + (Math.round((Math.random() * 3)) - 1));
nextPoint = Utilites.pathFind(map.tileArray, curPoint.x, curPoint.y, targPoint.x, targPoint.y)[0];
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (_arg4.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (_arg4.tileSize / 2)));
this.rotate();
}
}
}//package com.xitexsoftware.gamepack.monsters
Section 10
//PissAnt (com.xitexsoftware.gamepack.monsters.PissAnt)
package com.xitexsoftware.gamepack.monsters {
import com.xitexsoftware.gamepack.*;
import flash.geom.*;
import flash.display.*;
public class PissAnt extends BaseAttackMonster {
public var boses;// = false
public var canCarry;// = true
public var fireRate:int;// = 5
private var _speed:int;
public var attack:int;// = 5
public var underground;// = false
public var levelNum:int;
public var score:int;// = 30
public var flying;// = false
public var ground;// = true
public var baseHealth:int;// = 40
public var health:int;// = 40
public var money:int;// = 10
public var monsterVis:Boolean;// = false
public function PissAnt(_arg1:MovieClip, _arg2:int, _arg3:int, _arg4:Map, _arg5, _arg6:int=0, _arg7:int=30, _arg8:int=5, _arg9:int=30, _arg10:int=0):void{
_speed = new int(30);
health = 40;
baseHealth = 40;
score = 30;
money = 10;
attack = 5;
fireRate = 5;
flying = false;
underground = false;
ground = true;
canCarry = true;
boses = false;
monsterVis = false;
levelNum = new int();
this.levelNum = _arg10;
this.health = _arg7;
this.score = _arg9;
this.money = _arg8;
this.baseHealth = _arg7;
super(_speed, attack, fireRate);
this.healthBar = new McHealthBar();
this.healthBar.stop();
this.healthBar.y = (this.healthBar.y - 10);
this.addChild(this.healthBar);
monName = _arg5;
_graph = _arg1;
map = _arg4;
this.x = (((_arg2 * _arg4.tileSize) + _arg4.x) + (_arg4.tileSize / 2));
this.y = (((_arg3 * _arg4.tileSize) + map.y) + (_arg4.tileSize / 2));
this.thisCord = new Point(this.x, this.y);
this.addChild(_graph);
this.curPoint = new Point(_arg2, _arg3);
if (_arg6 == 0){
this.targPoint = new Point((16 + Math.floor((Math.random() * 4))), 36);
} else {
this.targPoint = new Point((Map.map_width - 1), (16 + Math.floor((Math.random() * 4))));
};
this._graph.y = (this._graph.y + (Math.round((Math.random() * 3)) - 1));
this._graph.x = (this._graph.x + (Math.round((Math.random() * 3)) - 1));
nextPoint = Utilites.pathFind(map.tileArray, curPoint.x, curPoint.y, targPoint.x, targPoint.y)[0];
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (_arg4.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (_arg4.tileSize / 2)));
this.rotate();
}
}
}//package com.xitexsoftware.gamepack.monsters
Section 11
//QueenAnt (com.xitexsoftware.gamepack.monsters.QueenAnt)
package com.xitexsoftware.gamepack.monsters {
import com.xitexsoftware.gamepack.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class QueenAnt extends BaseMonster {
public var boses;// = false
public var canCarry;// = true
private var _speed:int;
public var underground;// = false
public var levelNum:int;
public var score:int;// = 250
public var ground;// = true
public var flying;// = false
public var baseHealth:int;// = 150
public var health:int;// = 150
public var money:int;// = 100
public var monsterVis:Boolean;// = false
public function QueenAnt(_arg1:MovieClip, _arg2:int, _arg3:int, _arg4:Map, _arg5, _arg6:int=0, _arg7:int=150, _arg8:int=100, _arg9:int=250, _arg10:int=0):void{
_speed = new int(30);
health = 150;
baseHealth = 150;
score = 250;
money = 100;
flying = false;
underground = false;
ground = true;
canCarry = true;
boses = false;
monsterVis = false;
levelNum = new int();
this.levelNum = _arg10;
this.health = _arg7;
this.score = _arg9;
this.money = _arg8;
this.baseHealth = _arg7;
super(_speed);
this.healthBar = new McHealthBar();
this.healthBar.stop();
this.healthBar.y = (this.healthBar.y - 10);
this.addChild(this.healthBar);
monName = _arg5;
_graph = _arg1;
map = _arg4;
this.x = (((_arg2 * _arg4.tileSize) + _arg4.x) + (_arg4.tileSize / 2));
this.y = (((_arg3 * _arg4.tileSize) + map.y) + (_arg4.tileSize / 2));
this.thisCord = new Point(this.x, this.y);
this.addChild(_graph);
this.curPoint = new Point(_arg2, _arg3);
if (_arg6 == 0){
this.targPoint = new Point((16 + Math.floor((Math.random() * 4))), 36);
} else {
this.targPoint = new Point((Map.map_width - 1), (16 + Math.floor((Math.random() * 4))));
};
this._graph.y = (this._graph.y + (Math.round((Math.random() * 3)) - 1));
this._graph.x = (this._graph.x + (Math.round((Math.random() * 3)) - 1));
nextPoint = Utilites.pathFind(map.tileArray, curPoint.x, curPoint.y, targPoint.x, targPoint.y)[0];
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (_arg4.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (_arg4.tileSize / 2)));
this.rotate();
myTimer = new Timer((1000 / _speed), 0);
myTimer.addEventListener("timer", timerHandler);
myTimer.start();
}
}
}//package com.xitexsoftware.gamepack.monsters
Section 12
//QueenTermite (com.xitexsoftware.gamepack.monsters.QueenTermite)
package com.xitexsoftware.gamepack.monsters {
import com.xitexsoftware.gamepack.*;
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class QueenTermite extends MovieClip {
private const linearSpeed = 1;
private var _direction:int;
public var healthBar:MovieClip;
public var fireRate:int;// = 5
public var attack:int;// = 50
private var nextPoint:Point;
public var underground;// = false
public var health:int;// = 250
public var _graph:MovieClip;
private var myAttackTimer:Timer;
public var baseHealth:int;// = 250
private var _destroyStationSound:DestroyStationSound;
public var score:int;// = 500
public var flying;// = false
public var changes:Boolean;// = true
public var money:int;// = 200
private var myTimer:Timer;
public var boses;// = false
private var timersChange:Boolean;// = false
public var curPoint:Point;
public var canCarry;// = true
private var pathArray:Array;
private var afterAttack:Boolean;
private var _speed:int;
private var targPoint:Point;
public var levelNum:int;
public var map:Map;
private var thisCord:Point;
private var tmpArray:Array;
public var ground;// = true
private var nextPointCord:Point;
public var hasBonus:Boolean;// = false
public var monName:String;
private var slowTimer:Timer;
public var monsterVis:Boolean;// = false
public function QueenTermite(_arg1:MovieClip, _arg2:int, _arg3:int, _arg4:Map, _arg5, _arg6:int=0, _arg7:int=250, _arg8:int=200, _arg9:int=500, _arg10:int=0):void{
_speed = new int(30);
health = 250;
baseHealth = 250;
score = 500;
money = 200;
attack = 50;
fireRate = 5;
flying = false;
underground = false;
ground = true;
canCarry = true;
hasBonus = false;
boses = false;
monsterVis = false;
timersChange = false;
changes = true;
levelNum = new int();
super();
this.levelNum = _arg10;
this._destroyStationSound = new DestroyStationSound();
this.health = _arg7;
this.score = _arg9;
this.money = _arg8;
this.baseHealth = _arg7;
this.slowTimer = new Timer(10000, 0);
this.slowTimer.addEventListener("timer", onSlowTimer);
this.healthBar = new McHealthBar();
this.healthBar.stop();
this.healthBar.y = (this.healthBar.y - 10);
this.addChild(this.healthBar);
monName = _arg5;
_graph = _arg1;
_direction = _arg6;
map = _arg4;
this.x = (((_arg2 * _arg4.tileSize) + _arg4.x) + (_arg4.tileSize / 2));
this.y = (((_arg3 * _arg4.tileSize) + map.y) + (_arg4.tileSize / 2));
this.thisCord = new Point(this.x, this.y);
this.addChild(_graph);
this.curPoint = new Point(_arg2, _arg3);
if (_arg6 == 0){
nextPoint = new Point(this.curPoint.x, (this.curPoint.y + 1));
this._graph.rotation = 180;
} else {
nextPoint = new Point((this.curPoint.x + 1), this.curPoint.y);
this._graph.rotation = 90;
};
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (_arg4.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (_arg4.tileSize / 2)));
myTimer = new Timer((1000 / _speed), 0);
myAttackTimer = new Timer((3000 / fireRate), 0);
myAttackTimer.addEventListener("timer", attackTimerHandler);
myTimer.addEventListener("timer", timerHandler);
myTimer.start();
}
public function slow(_arg1:Number){
this.slowTimer.start();
this.myTimer.delay = Math.round(((1000 / _speed) * (1 + _arg1)));
}
public function moveDown():void{
this.y = (this.y + this._speed);
}
public function moveTo(_arg1:Point):void{
this.x = _arg1.x;
this.y = _arg1.y;
}
private function timerHandler(_arg1:TimerEvent):void{
if (_direction == 0){
this.y = (this.y + linearSpeed);
} else {
this.x = (this.x + linearSpeed);
};
if (afterAttack == true){
afterAttack = false;
} else {
this.thisCord.x = this.x;
this.thisCord.y = this.y;
};
if (Point.distance(this.thisCord, this.nextPointCord) <= linearSpeed){
this.curPoint.x = this.nextPoint.x;
this.curPoint.y = this.nextPoint.y;
map.tileArray[curPoint.y][curPoint.x].attackMe(this);
if (_direction == 0){
nextPoint = new Point(this.curPoint.x, (this.curPoint.y + 1));
} else {
nextPoint = new Point((this.curPoint.x + 1), this.curPoint.y);
};
if (map.tileArray[this.nextPoint.y] != undefined){
if (map.tileArray[this.nextPoint.y][this.nextPoint.x] != undefined){
if (map.tileArray[this.nextPoint.y][this.nextPoint.x]._turret != undefined){
this.myTimer.stop();
this._graph.gotoAndPlay("attack");
afterAttack = true;
myAttackTimer.start();
return;
};
};
};
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (map.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (map.tileSize / 2)));
if ((((nextPoint.x < (Map.map_width - 1))) && ((nextPoint.y < 37)))){
} else {
myTimer.stop();
this.myTimer.removeEventListener("timer", timerHandler);
this.dispatchEvent(new Event("onWayOut"));
};
};
}
public function moveUp():void{
this.y = (this.y - this._speed);
}
public function start(){
if (timersChange){
myAttackTimer.start();
} else {
myTimer.start();
};
slowTimer.start();
this._graph.play();
}
public function clear(){
myTimer.stop();
myAttackTimer.stop();
this.myTimer.removeEventListener("timer", timerHandler);
}
public function onSlowTimer(_arg1:TimerEvent){
this.slowTimer.stop();
this.myTimer.delay = (1000 / _speed);
}
private function attackTimerHandler(_arg1:TimerEvent){
if (map.tileArray[nextPoint.y][nextPoint.x]._turret != undefined){
map.tileArray[curPoint.y][curPoint.x].attackMe(this);
this._graph.gotoAndPlay("attack");
map.tileArray[nextPoint.y][nextPoint.x]._turret.defense = (map.tileArray[nextPoint.y][nextPoint.x]._turret.defense - this.attack);
if (map.tileArray[nextPoint.y][nextPoint.x]._turret.totGraph.tur_graph.mc_attack != null){
map.tileArray[nextPoint.y][nextPoint.x]._turret.totGraph.tur_graph.mc_attack.play();
};
if (map.tileArray[nextPoint.y][nextPoint.x]._turret.defense <= 0){
this._destroyStationSound.play();
map.tileArray[nextPoint.y][nextPoint.x]._turret.kill();
this._graph.gotoAndPlay(1);
this.nextPoint.x = this.curPoint.x;
this.nextPoint.y = this.curPoint.y;
this.myAttackTimer.stop();
this.myTimer.start();
};
} else {
this._graph.gotoAndPlay(1);
this.nextPoint.x = this.curPoint.x;
this.nextPoint.y = this.curPoint.y;
this.myAttackTimer.stop();
this.myTimer.start();
};
}
public function moveRight():void{
this.x = (this.x + this._speed);
}
function rotate(){
var _local1:Point;
_local1 = curPoint.subtract(nextPoint);
if (_local1.x == 1){
if (_local1.y == 1){
this._graph.rotation = 315;
} else {
if (_local1.y == 0){
this._graph.rotation = 270;
} else {
this._graph.rotation = 225;
};
};
} else {
if (_local1.x == 0){
if (_local1.y == 1){
this._graph.rotation = 0;
} else {
this._graph.rotation = 180;
};
} else {
if (_local1.y == 1){
this._graph.rotation = 45;
} else {
if (_local1.y == 0){
this._graph.rotation = 90;
} else {
this._graph.rotation = 135;
};
};
};
};
}
public function kill(){
if (this.hasBonus){
this.hasBonus = false;
Main.dropBonus(this.curPoint);
};
this.dispatchEvent(new Event("onDeath"));
}
public function moveLeft():void{
this.x = (this.x - this._speed);
}
public function pause(){
if (myTimer.running){
myTimer.stop();
timersChange = false;
} else {
myAttackTimer.stop();
timersChange = true;
};
slowTimer.stop();
this._graph.stop();
}
public function addBonus(_arg1:Bonus){
this.hasBonus = true;
}
}
}//package com.xitexsoftware.gamepack.monsters
Section 13
//SoldierAnt (com.xitexsoftware.gamepack.monsters.SoldierAnt)
package com.xitexsoftware.gamepack.monsters {
import com.xitexsoftware.gamepack.*;
import flash.geom.*;
import flash.display.*;
public class SoldierAnt extends BaseAttackMonster {
public var boses;// = false
public var canCarry;// = true
public var fireRate:int;// = 2
private var _speed:int;
public var attack:int;// = 15
public var underground;// = false
public var levelNum:int;
public var score:int;// = 100
public var flying;// = false
public var ground;// = true
public var baseHealth:int;// = 50
public var health:int;// = 100
public var money:int;// = 20
public var monsterVis:Boolean;// = false
public function SoldierAnt(_arg1:MovieClip, _arg2:int, _arg3:int, _arg4:Map, _arg5, _arg6:int=0, _arg7:int=30, _arg8:int=5, _arg9:int=30, _arg10:int=0):void{
_speed = new int(30);
health = 100;
baseHealth = 50;
score = 100;
money = 20;
attack = 15;
fireRate = 2;
flying = false;
underground = false;
ground = true;
canCarry = true;
boses = false;
monsterVis = false;
levelNum = new int();
this.levelNum = _arg10;
this.health = _arg7;
this.score = _arg9;
this.money = _arg8;
this.baseHealth = _arg7;
super(_speed, attack, fireRate);
this.healthBar = new McHealthBar();
this.healthBar.stop();
this.healthBar.y = (this.healthBar.y - 10);
this.addChild(this.healthBar);
monName = _arg5;
_graph = _arg1;
map = _arg4;
this.x = (((_arg2 * _arg4.tileSize) + _arg4.x) + (_arg4.tileSize / 2));
this.y = (((_arg3 * _arg4.tileSize) + map.y) + (_arg4.tileSize / 2));
this.thisCord = new Point(this.x, this.y);
this.addChild(_graph);
this.curPoint = new Point(_arg2, _arg3);
if (_arg6 == 0){
this.targPoint = new Point((16 + Math.floor((Math.random() * 4))), 36);
} else {
this.targPoint = new Point((Map.map_width - 1), (16 + Math.floor((Math.random() * 4))));
};
this._graph.y = (this._graph.y + (Math.round((Math.random() * 3)) - 1));
this._graph.x = (this._graph.x + (Math.round((Math.random() * 3)) - 1));
nextPoint = Utilites.pathFind(map.tileArray, curPoint.x, curPoint.y, targPoint.x, targPoint.y)[0];
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (_arg4.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (_arg4.tileSize / 2)));
this.rotate();
}
}
}//package com.xitexsoftware.gamepack.monsters
Section 14
//Termite (com.xitexsoftware.gamepack.monsters.Termite)
package com.xitexsoftware.gamepack.monsters {
import com.xitexsoftware.gamepack.*;
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class Termite extends MovieClip {
private const linearSpeed = 1;
private var _direction:int;
public var healthBar:MovieClip;
public var fireRate:int;// = 5
public var attack:int;// = 20
private var nextPoint:Point;
public var underground;// = false
public var health:int;// = 60
public var _graph:MovieClip;
private var myAttackTimer:Timer;
public var baseHealth:int;// = 60
private var _destroyStationSound:DestroyStationSound;
public var score:int;// = 50
public var flying;// = false
public var changes:Boolean;// = true
public var money:int;// = 25
private var myTimer:Timer;
public var boses;// = false
private var timersChange:Boolean;// = false
public var curPoint:Point;
public var canCarry;// = true
private var pathArray:Array;
private var afterAttack:Boolean;
private var _speed:int;
private var targPoint:Point;
public var levelNum:int;
public var map:Map;
private var thisCord:Point;
private var tmpArray:Array;
public var ground;// = true
private var nextPointCord:Point;
public var hasBonus:Boolean;// = false
public var monName:String;
private var slowTimer:Timer;
public var monsterVis:Boolean;// = false
public function Termite(_arg1:MovieClip, _arg2:int, _arg3:int, _arg4:Map, _arg5, _arg6:int=0, _arg7:int=60, _arg8:int=25, _arg9:int=50, _arg10:int=0):void{
_speed = new int(30);
baseHealth = 60;
health = 60;
score = 50;
money = 25;
attack = 20;
fireRate = 5;
flying = false;
underground = false;
ground = true;
canCarry = true;
boses = false;
hasBonus = false;
monsterVis = false;
timersChange = false;
changes = true;
levelNum = new int();
super();
this.levelNum = _arg10;
this._destroyStationSound = new DestroyStationSound();
this.health = _arg7;
this.score = _arg9;
this.money = _arg8;
this.baseHealth = _arg7;
this.slowTimer = new Timer(10000, 0);
this.slowTimer.addEventListener("timer", onSlowTimer);
this.healthBar = new McHealthBar();
this.healthBar.stop();
this.healthBar.y = (this.healthBar.y - 10);
this.addChild(this.healthBar);
monName = _arg5;
_graph = _arg1;
_direction = _arg6;
map = _arg4;
this.x = (((_arg2 * _arg4.tileSize) + _arg4.x) + (_arg4.tileSize / 2));
this.y = (((_arg3 * _arg4.tileSize) + map.y) + (_arg4.tileSize / 2));
this.thisCord = new Point(this.x, this.y);
this.addChild(_graph);
this.curPoint = new Point(_arg2, _arg3);
if (_arg6 == 0){
nextPoint = new Point(this.curPoint.x, (this.curPoint.y + 1));
this._graph.rotation = 180;
} else {
nextPoint = new Point((this.curPoint.x + 1), this.curPoint.y);
this._graph.rotation = 90;
};
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (_arg4.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (_arg4.tileSize / 2)));
myTimer = new Timer((1000 / _speed), 0);
myAttackTimer = new Timer((3000 / fireRate), 0);
myAttackTimer.addEventListener("timer", attackTimerHandler);
myTimer.addEventListener("timer", timerHandler);
myTimer.start();
}
public function slow(_arg1:Number){
this.slowTimer.start();
this.myTimer.delay = Math.round(((1000 / _speed) * (1 + _arg1)));
}
public function moveDown():void{
this.y = (this.y + this._speed);
}
public function moveTo(_arg1:Point):void{
this.x = _arg1.x;
this.y = _arg1.y;
}
private function timerHandler(_arg1:TimerEvent):void{
if (_direction == 0){
this.y = (this.y + linearSpeed);
} else {
this.x = (this.x + linearSpeed);
};
if (afterAttack == true){
afterAttack = false;
} else {
this.thisCord.x = this.x;
this.thisCord.y = this.y;
};
if (Point.distance(this.thisCord, this.nextPointCord) <= linearSpeed){
this.curPoint.x = this.nextPoint.x;
this.curPoint.y = this.nextPoint.y;
map.tileArray[curPoint.y][curPoint.x].attackMe(this);
if (_direction == 0){
nextPoint = new Point(this.curPoint.x, (this.curPoint.y + 1));
} else {
nextPoint = new Point((this.curPoint.x + 1), this.curPoint.y);
};
if (map.tileArray[this.nextPoint.y] != undefined){
if (map.tileArray[this.nextPoint.y][this.nextPoint.x] != undefined){
if (map.tileArray[this.nextPoint.y][this.nextPoint.x]._turret != undefined){
this.myTimer.stop();
this._graph.gotoAndPlay("attack");
afterAttack = true;
myAttackTimer.start();
return;
};
};
};
nextPointCord = new Point((((nextPoint.x * map.tileSize) + map.x) + (map.tileSize / 2)), (((nextPoint.y * map.tileSize) + map.y) + (map.tileSize / 2)));
if ((((nextPoint.x < (Map.map_width - 1))) && ((nextPoint.y < 37)))){
} else {
myTimer.stop();
this.myTimer.removeEventListener("timer", timerHandler);
this.dispatchEvent(new Event("onWayOut"));
};
};
}
public function moveUp():void{
this.y = (this.y - this._speed);
}
public function start(){
if (timersChange){
myAttackTimer.start();
} else {
myTimer.start();
};
slowTimer.start();
this._graph.play();
}
public function clear(){
myTimer.stop();
myAttackTimer.stop();
this.myTimer.removeEventListener("timer", timerHandler);
}
public function onSlowTimer(_arg1:TimerEvent){
this.slowTimer.stop();
this.myTimer.delay = (1000 / _speed);
}
private function attackTimerHandler(_arg1:TimerEvent){
if (map.tileArray[nextPoint.y][nextPoint.x]._turret != undefined){
map.tileArray[curPoint.y][curPoint.x].attackMe(this);
this._graph.gotoAndPlay("attack");
map.tileArray[nextPoint.y][nextPoint.x]._turret.defense = (map.tileArray[nextPoint.y][nextPoint.x]._turret.defense - this.attack);
if (map.tileArray[nextPoint.y][nextPoint.x]._turret.totGraph.tur_graph.mc_attack != null){
map.tileArray[nextPoint.y][nextPoint.x]._turret.totGraph.tur_graph.mc_attack.play();
};
if (map.tileArray[nextPoint.y][nextPoint.x]._turret.defense <= 0){
this._destroyStationSound.play();
map.tileArray[nextPoint.y][nextPoint.x]._turret.kill();
this._graph.gotoAndPlay(1);
this.nextPoint.x = this.curPoint.x;
this.nextPoint.y = this.curPoint.y;
this.myAttackTimer.stop();
this.myTimer.start();
};
} else {
this._graph.gotoAndPlay(1);
this.nextPoint.x = this.curPoint.x;
this.nextPoint.y = this.curPoint.y;
this.myAttackTimer.stop();
this.myTimer.start();
};
}
public function moveRight():void{
this.x = (this.x + this._speed);
}
function rotate(){
var _local1:Point;
_local1 = curPoint.subtract(nextPoint);
if (_local1.x == 1){
if (_local1.y == 1){
this._graph.rotation = 315;
} else {
if (_local1.y == 0){
this._graph.rotation = 270;
} else {
this._graph.rotation = 225;
};
};
} else {
if (_local1.x == 0){
if (_local1.y == 1){
this._graph.rotation = 0;
} else {
this._graph.rotation = 180;
};
} else {
if (_local1.y == 1){
this._graph.rotation = 45;
} else {
if (_local1.y == 0){
this._graph.rotation = 90;
} else {
this.rotation = 135;
};
};
};
};
}
public function kill(){
if (this.hasBonus){
this.hasBonus = false;
Main.dropBonus(this.curPoint);
};
this.dispatchEvent(new Event("onDeath"));
}
public function moveLeft():void{
this.x = (this.x - this._speed);
}
public function pause(){
if (myTimer.running){
myTimer.stop();
timersChange = false;
} else {
myAttackTimer.stop();
timersChange = true;
};
slowTimer.stop();
this._graph.stop();
}
public function addBonus(_arg1:Bonus){
this.hasBonus = true;
}
}
}//package com.xitexsoftware.gamepack.monsters
Section 15
//Honey (com.xitexsoftware.gamepack.turets.Honey)
package com.xitexsoftware.gamepack.turets {
import com.xitexsoftware.gamepack.*;
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class Honey extends MovieClip {
public const type = "honey";
private const baseAttackTime = 2500;
public var coord:Point;
public var sellingTick:int;// = 0
public var destroyed:Boolean;// = false
public var fireRate:Number;// = 1
public var turName:String;
public var baseDefense:int;// = 100
public var price:int;// = 10
public var selling:Boolean;// = false
private var map:Map;
private var underAttack;
private var _graph:MovieClip;
public var totGraph:MovieClip;
public var damage:Number;// = 0.2
public var free:Boolean;// = true
public var level:int;// = 1
public var levels:Array;
public var radius:int;// = 3
private var _honeyFireSounds:Array;
public var defense:int;// = 100
public var antiAir:Boolean;// = true
public var turretName:String;// = "Standard Honey"
public var antiGround;// = true
private var radiusMc:MovieClip;
private var myTimer:Timer;
public function Honey(_arg1:MovieClip, _arg2, _arg3:Map, _arg4, _arg5):void{
var _local6:Object;
free = true;
price = 10;
damage = 0.2;
radius = 3;
level = 1;
fireRate = 1;
defense = 100;
baseDefense = 100;
turretName = "Standard Honey";
antiAir = true;
antiGround = true;
destroyed = false;
selling = false;
sellingTick = 0;
super();
this._honeyFireSounds = new Array();
this._honeyFireSounds[0] = new HoneyFire1Sound();
this._honeyFireSounds[1] = new HoneyFire2Sound();
this._honeyFireSounds[2] = new HoneyFire3Sound();
_local6 = XMLData.self.getTurretLevel(this.type, 1);
price = _local6.cost;
damage = _local6.damage;
radius = _local6.range;
fireRate = _local6.rate;
defense = _local6.defense;
baseDefense = _local6.defense;
myTimer = new Timer((baseAttackTime / fireRate), 0);
myTimer.stop();
levels = new Array();
this.initLevels(levels);
coord = new Point(_arg4, _arg5);
totGraph = _arg1;
_graph = totGraph.tur_graph;
this.totGraph.x = (this.totGraph.x + (this._graph.width / 2));
this.totGraph.y = (this.totGraph.y + (this._graph.height / 2));
_graph.stop();
totGraph.stop();
totGraph.mc_update.stop();
totGraph.tur_graph.mc_attack.stop();
totGraph.tur_graph.mc_destr.stop();
totGraph.mc_sugar_effect.visible = false;
totGraph.loader.visible = false;
this.addChild(totGraph);
this.turName = _arg2;
this.map = _arg3;
this.radiusMc = new McRadiusCircle();
this.radiusMc.x = (this.radiusMc.x + (this._graph.width / 2));
this.radiusMc.y = (this.radiusMc.y + (this._graph.height / 2));
this.addChild(this.radiusMc);
this.radiusMc.visible = false;
map.setTurret(new Point(map.turetSetCoord.x, map.turetSetCoord.y), this);
this.updateRadius();
}
public function upgrade(){
this.removeRadius();
this.selling = true;
this._graph.gotoAndStop((type + " N"));
this.totGraph.loader.visible = true;
totGraph.mc_update.visible = false;
totGraph.tur_graph.visible = false;
this.totGraph.loader.gotoAndStop(1);
this.myTimer.stop();
this.myTimer.removeEventListener("timer", damageMon);
this.myTimer = new Timer(100, 20);
this.myTimer.addEventListener("timer", onUpgTimer);
this.myTimer.start();
}
private function damageMon(_arg1:TimerEvent){
var _local2:Number;
if (underAttack.monsterVis == true){
if (((!((underAttack == undefined))) && ((underAttack.health > 0)))){
if (underAttack.underground == false){
if (Point.distance(new Point(this.x, this.y), new Point(underAttack.x, underAttack.y)) <= (14 * radius)){
this._graph.rotation = Utilites.returnAngelBetwenPoints(this.localToGlobal(new Point(this._graph.x, this._graph.y)), new Point(underAttack.x, underAttack.y));
_local2 = (damage + Math.round(getDamage()));
Main.AddBullet(underAttack, new Point(this.x, this.y), _local2, radius, 3);
return;
};
};
};
};
this._graph.gotoAndStop((type + " N"));
this.myTimer.stop();
this.free = true;
}
private function onSellTimer(_arg1:TimerEvent){
if (this.myTimer.currentCount == this.myTimer.repeatCount){
this.onSell();
} else {
sellingTick = this.myTimer.currentCount;
this.totGraph.loader.gotoAndStop(int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100)));
sellingTick = int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100));
this.dispatchEvent(new Event("onProgressTick"));
};
}
public function start(){
if ((((free == false)) || ((selling == true)))){
myTimer.start();
};
this._graph.play();
}
public function sell(_arg1:int){
this.removeRadius();
this.selling = true;
this._graph.gotoAndStop((type + " N"));
this.totGraph.loader.visible = true;
totGraph.mc_update.visible = false;
totGraph.tur_graph.visible = false;
this.totGraph.loader.gotoAndStop(1);
this.myTimer.stop();
this.myTimer.removeEventListener("timer", damageMon);
this.myTimer = new Timer(100, _arg1);
this.myTimer.addEventListener("timer", onSellTimer);
this.myTimer.start();
}
public function removeRadius(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Point;
_local1 = this.coord.x;
_local2 = this.coord.y;
_local3 = -(radius);
while (_local3 <= (radius + 1)) {
_local4 = -(radius);
while (_local4 <= (radius + 1)) {
if (map.tileArray[(_local2 + _local3)] != undefined){
if (map.tileArray[(_local2 + _local3)][(_local1 + _local4)] != undefined){
_local5 = new Point((_local2 + _local3), (_local1 + _local4));
if (Point.distance(_local5, new Point(_local2, _local1)) <= radius){
map.removeTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
if (Point.distance(_local5, new Point((_local2 + 1), (_local1 + 1))) <= radius){
map.removeTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
};
};
_local4++;
};
_local3++;
};
}
private function onUpgTimer(_arg1:TimerEvent){
if (this.myTimer.currentCount == this.myTimer.repeatCount){
this.selling = false;
Main.self.onUpgrade(this);
this.totGraph.loader.visible = false;
totGraph.mc_update.visible = true;
totGraph.tur_graph.visible = true;
this.myTimer.stop();
this.myTimer.removeEventListener("timer", onUpgTimer);
} else {
sellingTick = this.myTimer.currentCount;
this.totGraph.loader.gotoAndStop(int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100)));
sellingTick = int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100));
this.dispatchEvent(new Event("onProgressTick"));
};
}
private function initLevels(_arg1:Array){
var _local2:Object;
_local2 = XMLData.self.getTurretLevel(this.type, 1);
_arg1[0] = new Object();
_arg1[0].price = _local2.cost;
_arg1[0].damage = _local2.damage;
_arg1[0].radius = _local2.range;
_arg1[0].level = 1;
_arg1[0].fireRate = _local2.rate;
_arg1[0].defense = _local2.defense;
_arg1[0].turretName = _local2.name;
_local2 = XMLData.self.getTurretLevel(this.type, 2);
_arg1[1] = new Object();
_arg1[1].price = _local2.cost;
_arg1[1].damage = _local2.damage;
_arg1[1].radius = _local2.range;
_arg1[1].level = 2;
_arg1[1].fireRate = _local2.rate;
_arg1[1].defense = _local2.defense;
_arg1[1].turretName = _local2.name;
_local2 = XMLData.self.getTurretLevel(this.type, 3);
_arg1[2] = new Object();
_arg1[2].price = _local2.cost;
_arg1[2].damage = _local2.damage;
_arg1[2].radius = _local2.range;
_arg1[2].level = 3;
_arg1[2].fireRate = _local2.rate;
_arg1[2].defense = _local2.defense;
_arg1[2].turretName = _local2.name;
}
public function clear(){
this.myTimer.stop();
this.removeRadius();
this.removeEventListener("timer", onSell);
this.removeEventListener("timer", damageMon);
this.totGraph.tur_graph.mc_destr.removeEventListener(Event.ENTER_FRAME, onDestroyAnim);
}
public function getDamage():Number{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
_local1 = Math.max(map.tileArray[this.coord.y][this.coord.x].bonusDamage, map.tileArray[this.coord.y][(this.coord.x + 1)].bonusDamage);
_local2 = Math.max(map.tileArray[(this.coord.y + 1)][this.coord.x].bonusDamage, map.tileArray[(this.coord.y + 1)][(this.coord.x + 1)].bonusDamage);
return (((Math.max(_local1, _local2) * damage) * 0.01));
}
public function hideRadius(){
this.radiusMc.visible = false;
}
public function updateRadius(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Point;
_local1 = this.coord.x;
_local2 = this.coord.y;
_local3 = -(radius);
while (_local3 <= (radius + 1)) {
_local4 = -(radius);
while (_local4 <= (radius + 1)) {
if (map.tileArray[(_local2 + _local3)] != undefined){
if (map.tileArray[(_local2 + _local3)][(_local1 + _local4)] != undefined){
_local5 = new Point((_local2 + _local3), (_local1 + _local4));
if (Point.distance(_local5, new Point(_local2, _local1)) <= radius){
map.addTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
if (Point.distance(_local5, new Point((_local2 + 1), (_local1 + 1))) <= radius){
map.addTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
};
};
_local4++;
};
_local3++;
};
}
public function kill(){
this.destroyed = true;
this.myTimer.stop();
this.removeRadius();
this.removeEventListener("timer", onSell);
this.removeEventListener("timer", damageMon);
if (this.totGraph.tur_graph.mc_destr != undefined){
this.totGraph.tur_graph.mc_destr.addEventListener(Event.ENTER_FRAME, onDestroyAnim);
this.totGraph.tur_graph.mc_destr.play();
};
}
private function onSell(){
this.clear();
this.dispatchEvent(new Event("onTurretSeled"));
}
private function onDestroyAnim(_arg1:Event){
if (_arg1.target.currentLabel == "destr"){
this.dispatchEvent(new Event("onTurretDestroyed"));
this.totGraph.tur_graph.mc_destr.removeEventListener(Event.ENTER_FRAME, onDestroyAnim);
} else {
this.totGraph.tur_graph.x = (Math.round((Math.random() * 3)) - 1);
this.totGraph.tur_graph.y = (Math.round((Math.random() * 3)) - 1);
};
}
public function attackMon(_arg1){
var _local2:uint;
var _local3:Number;
var _local4:Matrix;
var _local5:Point;
_local3 = new Number();
_local4 = new Matrix();
_local5 = new Point();
if (_arg1.underground == false){
if (_arg1.flying == false){
if ((((((_arg1.ground == true)) && ((this.antiGround == true)))) && ((_arg1.monsterVis == true)))){
this._graph.rotation = Utilites.returnAngelBetwenPoints(this.localToGlobal(new Point(this._graph.x, this._graph.y)), new Point(_arg1.x, _arg1.y));
this.free = false;
underAttack = _arg1;
this._graph.gotoAndPlay((type + " Shoot"));
_local2 = ((Math.random() * (this._honeyFireSounds.length - 1)) + 1);
this._honeyFireSounds[_local2].play();
_local4.rotate(((this._graph.rotation * Math.PI) / 180));
_local5 = _local4.transformPoint(new Point(this.totGraph.tur_graph.mc_shootfrom.x, this.totGraph.tur_graph.mc_shootfrom.y));
_local4.transformPoint(new Point(this.totGraph.tur_graph.mc_shootfrom.x, this.totGraph.tur_graph.mc_shootfrom.y)).x = (_local5.x + this.x);
_local5.y = (_local5.y + this.y);
_local3 = (damage + Math.round(getDamage()));
Main.AddBullet(_arg1, _local5, _local3, radius, 3);
myTimer = new Timer((baseAttackTime / fireRate), 0);
myTimer.addEventListener("timer", damageMon);
myTimer.start();
};
} else {
if (this.antiAir == true){
if (_arg1.monsterVis == true){
this._graph.rotation = Utilites.returnAngelBetwenPoints(this.localToGlobal(new Point(this._graph.x, this._graph.y)), new Point(_arg1.x, _arg1.y));
this.free = false;
underAttack = _arg1;
this._graph.gotoAndPlay((type + " Shoot"));
_local2 = ((Math.random() * (this._honeyFireSounds.length - 1)) + 1);
this._honeyFireSounds[_local2].play();
_local4.rotate(((this._graph.rotation * Math.PI) / 180));
_local5 = _local4.transformPoint(new Point(this.totGraph.tur_graph.mc_shootfrom.x, this.totGraph.tur_graph.mc_shootfrom.y));
_local4.transformPoint(new Point(this.totGraph.tur_graph.mc_shootfrom.x, this.totGraph.tur_graph.mc_shootfrom.y)).x = (_local5.x + this.x);
_local5.y = (_local5.y + this.y);
_local3 = (damage + Math.round(getDamage()));
Main.AddBullet(_arg1, _local5, _local3, radius, 3);
myTimer = new Timer((baseAttackTime / fireRate), 0);
myTimer.addEventListener("timer", damageMon);
myTimer.start();
};
};
};
};
}
public function showRadius(){
this.radiusMc.scaleX = this.radius;
this.radiusMc.scaleY = this.radius;
this.radiusMc.visible = true;
}
public function pause(){
if ((((free == false)) || ((selling == true)))){
myTimer.stop();
};
this._graph.stop();
}
}
}//package com.xitexsoftware.gamepack.turets
Section 16
//Ketchup (com.xitexsoftware.gamepack.turets.Ketchup)
package com.xitexsoftware.gamepack.turets {
import com.xitexsoftware.gamepack.*;
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class Ketchup extends MovieClip {
public const type = "ketchup";
private const baseAttackTime = 2500;
public var coord:Point;
public var sellingTick:int;// = 0
public var destroyed:Boolean;// = false
public var fireRate:Number;// = 2
public var turName:String;
public var baseDefense:int;// = 150
public var price:int;// = 30
public var selling:Boolean;// = false
private var map:Map;
private var underAttack;
private var _graph:MovieClip;
public var totGraph:MovieClip;
public var damage:int;// = 10
private var _ketchupFireSounds:Array;
public var free:Boolean;// = true
public var level:int;// = 1
public var levels:Array;
public var radius:int;// = 4
public var defense:int;// = 150
public var antiAir:Boolean;// = true
public var turretName:String;// = "Standard Ketchup"
public var antiGround;// = true
private var radiusMc:MovieClip;
private var myTimer:Timer;
public function Ketchup(_arg1:MovieClip, _arg2, _arg3:Map, _arg4, _arg5):void{
var _local6:Object;
free = true;
price = 30;
damage = 10;
radius = 4;
level = 1;
fireRate = 2;
defense = 150;
baseDefense = 150;
turretName = "Standard Ketchup";
antiAir = true;
antiGround = true;
destroyed = false;
selling = false;
sellingTick = 0;
super();
this._ketchupFireSounds = new Array();
this._ketchupFireSounds[0] = new KetchupFire1Sound();
this._ketchupFireSounds[1] = new KetchupFire2Sound();
this._ketchupFireSounds[2] = new KetchupFire3Sound();
_local6 = XMLData.self.getTurretLevel(this.type, 1);
price = _local6.cost;
damage = _local6.damage;
radius = _local6.range;
fireRate = _local6.rate;
defense = _local6.defense;
baseDefense = _local6.defense;
myTimer = new Timer((baseAttackTime / fireRate), 0);
myTimer.stop();
levels = new Array();
this.initLevels(levels);
coord = new Point(_arg4, _arg5);
totGraph = _arg1;
_graph = totGraph.tur_graph;
this.totGraph.x = (this.totGraph.x + (this._graph.width / 2));
this.totGraph.y = (this.totGraph.y + (this._graph.height / 2));
_graph.stop();
totGraph.stop();
totGraph.mc_update.stop();
totGraph.tur_graph.mc_attack.stop();
totGraph.tur_graph.mc_destr.stop();
totGraph.mc_sugar_effect.visible = false;
this.addChild(totGraph);
this.turName = _arg2;
this.map = _arg3;
this.radiusMc = new McRadiusCircle();
this.radiusMc.x = (this.radiusMc.x + (this._graph.width / 2));
this.radiusMc.y = (this.radiusMc.y + (this._graph.height / 2));
this.addChild(this.radiusMc);
this.radiusMc.visible = false;
totGraph.loader.visible = false;
map.setTurret(new Point(map.turetSetCoord.x, map.turetSetCoord.y), this);
this.updateRadius();
}
public function upgrade(){
this.removeRadius();
this.selling = true;
this._graph.gotoAndStop((type + " N"));
this.totGraph.loader.visible = true;
totGraph.mc_update.visible = false;
totGraph.tur_graph.visible = false;
this.totGraph.loader.gotoAndStop(1);
this.myTimer.stop();
this.myTimer.removeEventListener("timer", damageMon);
this.myTimer = new Timer(100, 20);
this.myTimer.addEventListener("timer", onUpgTimer);
this.myTimer.start();
}
private function damageMon(_arg1:TimerEvent){
var _local2:Matrix;
var _local3:Point;
var _local4:Number;
if (underAttack.monsterVis == true){
if (((!((underAttack == undefined))) && ((underAttack.health > 0)))){
if (underAttack.underground == false){
if (Point.distance(new Point(this.x, this.y), new Point(underAttack.x, underAttack.y)) <= (14 * radius)){
this._graph.rotation = Utilites.returnAngelBetwenPoints(this.localToGlobal(new Point(this._graph.x, this._graph.y)), new Point(underAttack.x, underAttack.y));
_local2 = new Matrix();
_local2.rotate(((this._graph.rotation * Math.PI) / 180));
_local3 = _local2.transformPoint(new Point(this.totGraph.tur_graph.mc_shootfrom.x, this.totGraph.tur_graph.mc_shootfrom.y));
_local3.x = (_local3.x + this.x);
_local3.y = (_local3.y + this.y);
_local4 = (damage + Math.round(getDamage()));
Main.AddBullet(underAttack, _local3, _local4, radius, 2);
return;
};
};
};
};
this._graph.gotoAndStop((type + " N"));
this.myTimer.stop();
this.free = true;
}
private function onSellTimer(_arg1:TimerEvent){
if (this.myTimer.currentCount == this.myTimer.repeatCount){
this.onSell();
} else {
sellingTick = this.myTimer.currentCount;
this.totGraph.loader.gotoAndStop(int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100)));
sellingTick = int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100));
this.dispatchEvent(new Event("onProgressTick"));
};
}
public function start(){
if ((((free == false)) || ((selling == true)))){
myTimer.start();
};
this._graph.play();
}
public function sell(_arg1:int){
this.removeRadius();
this.selling = true;
this._graph.gotoAndStop((type + " N"));
this.totGraph.loader.visible = true;
totGraph.mc_update.visible = false;
totGraph.tur_graph.visible = false;
this.totGraph.loader.gotoAndStop(1);
this.myTimer.stop();
this.myTimer.removeEventListener("timer", damageMon);
this.myTimer = new Timer(100, _arg1);
this.myTimer.addEventListener("timer", onSellTimer);
this.myTimer.start();
}
public function removeRadius(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Point;
_local1 = this.coord.x;
_local2 = this.coord.y;
_local3 = -(radius);
while (_local3 <= (radius + 1)) {
_local4 = -(radius);
while (_local4 <= (radius + 1)) {
if (map.tileArray[(_local2 + _local3)] != undefined){
if (map.tileArray[(_local2 + _local3)][(_local1 + _local4)] != undefined){
_local5 = new Point((_local2 + _local3), (_local1 + _local4));
if (Point.distance(_local5, new Point(_local2, _local1)) <= radius){
map.removeTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
if (Point.distance(_local5, new Point((_local2 + 1), (_local1 + 1))) <= radius){
map.removeTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
};
};
_local4++;
};
_local3++;
};
}
private function onUpgTimer(_arg1:TimerEvent){
if (this.myTimer.currentCount == this.myTimer.repeatCount){
this.selling = false;
Main.self.onUpgrade(this);
this.totGraph.loader.visible = false;
totGraph.mc_update.visible = true;
totGraph.tur_graph.visible = true;
this.myTimer.stop();
this.myTimer.removeEventListener("timer", onUpgTimer);
} else {
sellingTick = this.myTimer.currentCount;
this.totGraph.loader.gotoAndStop(int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100)));
sellingTick = int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100));
this.dispatchEvent(new Event("onProgressTick"));
};
}
private function initLevels(_arg1:Array){
var _local2:Object;
_local2 = XMLData.self.getTurretLevel(this.type, 1);
_arg1[0] = new Object();
_arg1[0].price = _local2.cost;
_arg1[0].damage = _local2.damage;
_arg1[0].radius = _local2.range;
_arg1[0].level = 1;
_arg1[0].fireRate = _local2.rate;
_arg1[0].defense = _local2.defense;
_arg1[0].turretName = _local2.name;
_local2 = XMLData.self.getTurretLevel(this.type, 2);
_arg1[1] = new Object();
_arg1[1].price = _local2.cost;
_arg1[1].damage = _local2.damage;
_arg1[1].radius = _local2.range;
_arg1[1].level = 2;
_arg1[1].fireRate = _local2.rate;
_arg1[1].defense = _local2.defense;
_arg1[1].turretName = _local2.name;
_local2 = XMLData.self.getTurretLevel(this.type, 3);
_arg1[2] = new Object();
_arg1[2].price = _local2.cost;
_arg1[2].damage = _local2.damage;
_arg1[2].radius = _local2.range;
_arg1[2].level = 3;
_arg1[2].fireRate = _local2.rate;
_arg1[2].defense = _local2.defense;
_arg1[2].turretName = _local2.name;
_local2 = XMLData.self.getTurretLevel(this.type, 4);
_arg1[3] = new Object();
_arg1[3].price = _local2.cost;
_arg1[3].damage = _local2.damage;
_arg1[3].radius = _local2.range;
_arg1[3].level = 4;
_arg1[3].fireRate = _local2.rate;
_arg1[3].defense = _local2.defense;
_arg1[3].turretName = _local2.name;
_local2 = XMLData.self.getTurretLevel(this.type, 5);
_arg1[4] = new Object();
_arg1[4].price = _local2.cost;
_arg1[4].damage = _local2.damage;
_arg1[4].radius = _local2.range;
_arg1[4].level = 5;
_arg1[4].fireRate = _local2.rate;
_arg1[4].defense = _local2.defense;
_arg1[4].turretName = _local2.name;
}
public function clear(){
this.myTimer.stop();
this.removeRadius();
this.removeEventListener("timer", onSell);
this.removeEventListener("timer", damageMon);
this.totGraph.tur_graph.mc_destr.removeEventListener(Event.ENTER_FRAME, onDestroyAnim);
}
public function getDamage():Number{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
_local1 = Math.max(map.tileArray[this.coord.y][this.coord.x].bonusDamage, map.tileArray[this.coord.y][(this.coord.x + 1)].bonusDamage);
_local2 = Math.max(map.tileArray[(this.coord.y + 1)][this.coord.x].bonusDamage, map.tileArray[(this.coord.y + 1)][(this.coord.x + 1)].bonusDamage);
return (((Math.max(_local1, _local2) * damage) * 0.01));
}
public function hideRadius(){
this.radiusMc.visible = false;
}
public function updateRadius(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Point;
_local1 = this.coord.x;
_local2 = this.coord.y;
_local3 = -(radius);
while (_local3 <= (radius + 1)) {
_local4 = -(radius);
while (_local4 <= (radius + 1)) {
if (map.tileArray[(_local2 + _local3)] != undefined){
if (map.tileArray[(_local2 + _local3)][(_local1 + _local4)] != undefined){
_local5 = new Point((_local2 + _local3), (_local1 + _local4));
if (Point.distance(_local5, new Point(_local2, _local1)) <= radius){
map.addTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
if (Point.distance(_local5, new Point((_local2 + 1), (_local1 + 1))) <= radius){
map.addTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
};
};
_local4++;
};
_local3++;
};
}
public function kill(){
this.destroyed = true;
this.myTimer.stop();
this.removeRadius();
this.removeEventListener("timer", onSell);
this.removeEventListener("timer", damageMon);
if (this.totGraph.tur_graph.mc_destr != undefined){
this.totGraph.tur_graph.mc_destr.addEventListener(Event.ENTER_FRAME, onDestroyAnim);
this.totGraph.tur_graph.mc_destr.play();
};
}
private function onSell(){
this.clear();
this.dispatchEvent(new Event("onTurretSeled"));
}
private function onDestroyAnim(_arg1:Event){
if (_arg1.target.currentLabel == "destr"){
this.dispatchEvent(new Event("onTurretDestroyed"));
this.totGraph.tur_graph.mc_destr.removeEventListener(Event.ENTER_FRAME, onDestroyAnim);
} else {
this.totGraph.tur_graph.x = (Math.round((Math.random() * 3)) - 1);
this.totGraph.tur_graph.y = (Math.round((Math.random() * 3)) - 1);
};
}
public function attackMon(_arg1){
var _local2:uint;
var _local3:Matrix;
var _local4:Point;
var _local5:Number;
_local3 = new Matrix();
_local4 = new Point();
_local5 = new Number();
if (_arg1.underground == false){
if (_arg1.flying == false){
if ((((((_arg1.ground == true)) && ((this.antiGround == true)))) && ((_arg1.monsterVis == true)))){
this._graph.rotation = Utilites.returnAngelBetwenPoints(this.localToGlobal(new Point(this._graph.x, this._graph.y)), new Point(_arg1.x, _arg1.y));
this.free = false;
underAttack = _arg1;
this._graph.gotoAndPlay((type + " Shoot"));
_local2 = ((Math.random() * (this._ketchupFireSounds.length - 1)) + 1);
this._ketchupFireSounds[_local2].play();
_local3.rotate(((this._graph.rotation * Math.PI) / 180));
_local4 = _local3.transformPoint(new Point(this.totGraph.tur_graph.mc_shootfrom.x, this.totGraph.tur_graph.mc_shootfrom.y));
_local3.transformPoint(new Point(this.totGraph.tur_graph.mc_shootfrom.x, this.totGraph.tur_graph.mc_shootfrom.y)).x = (_local4.x + this.x);
_local4.y = (_local4.y + this.y);
_local5 = (damage + Math.round(getDamage()));
Main.AddBullet(_arg1, _local4, _local5, radius, 2);
myTimer = new Timer((baseAttackTime / fireRate), 0);
myTimer.addEventListener("timer", damageMon);
myTimer.start();
};
} else {
if (this.antiAir == true){
if (_arg1.monsterVis == true){
this._graph.rotation = Utilites.returnAngelBetwenPoints(this.localToGlobal(new Point(this._graph.x, this._graph.y)), new Point(_arg1.x, _arg1.y));
this.free = false;
underAttack = _arg1;
this._graph.gotoAndPlay((type + " Shoot"));
_local2 = ((Math.random() * (this._ketchupFireSounds.length - 1)) + 1);
this._ketchupFireSounds[_local2].play();
_local3.rotate(((this._graph.rotation * Math.PI) / 180));
_local4 = _local3.transformPoint(new Point(this.totGraph.tur_graph.mc_shootfrom.x, this.totGraph.tur_graph.mc_shootfrom.y));
_local3.transformPoint(new Point(this.totGraph.tur_graph.mc_shootfrom.x, this.totGraph.tur_graph.mc_shootfrom.y)).x = (_local4.x + this.x);
_local4.y = (_local4.y + this.y);
_local5 = (damage + Math.round(getDamage()));
Main.AddBullet(_arg1, _local4, _local5, radius, 2);
myTimer = new Timer((baseAttackTime / fireRate), 0);
myTimer.addEventListener("timer", damageMon);
myTimer.start();
};
};
};
};
}
public function showRadius(){
this.radiusMc.scaleX = this.radius;
this.radiusMc.scaleY = this.radius;
this.radiusMc.visible = true;
}
public function pause(){
if ((((free == false)) || ((selling == true)))){
myTimer.stop();
};
this._graph.stop();
}
}
}//package com.xitexsoftware.gamepack.turets
Section 17
//Mustard (com.xitexsoftware.gamepack.turets.Mustard)
package com.xitexsoftware.gamepack.turets {
import com.xitexsoftware.gamepack.*;
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class Mustard extends MovieClip {
public const type = "mustard";
private const baseAttackTime = 2500;
public var coord:Point;
public var sellingTick:int;// = 0
public var destroyed:Boolean;// = false
public var fireRate:Number;// = 1
public var turName:String;
public var baseDefense:int;// = 100
public var price:int;// = 10
public var selling:Boolean;// = false
private var map:Map;
private var underAttack;
private var _graph:MovieClip;
public var totGraph:MovieClip;
public var damage:int;// = 5
public var free:Boolean;// = true
public var levels:Array;
public var radius:int;// = 3
public var level:int;// = 1
public var defense:int;// = 100
public var antiAir:Boolean;// = false
public var turretName:String;// = "Standard Mustard"
public var antiGround:Boolean;// = true
private var radiusMc:MovieClip;
private var myTimer:Timer;
private var _mustardFireSounds:Array;
public function Mustard(_arg1:MovieClip, _arg2, _arg3:Map, _arg4, _arg5):void{
var _local6:Object;
free = true;
price = 10;
damage = 5;
radius = 3;
fireRate = 1;
defense = 100;
baseDefense = 100;
level = 1;
turretName = "Standard Mustard";
antiAir = false;
antiGround = true;
destroyed = false;
selling = false;
sellingTick = 0;
super();
this._mustardFireSounds = new Array();
this._mustardFireSounds[0] = new MustardFire1Sound();
this._mustardFireSounds[1] = new MustardFire2Sound();
this._mustardFireSounds[2] = new MustardFire3Sound();
_local6 = XMLData.self.getTurretLevel(this.type, 1);
price = _local6.cost;
damage = _local6.damage;
radius = _local6.range;
fireRate = _local6.rate;
defense = _local6.defense;
baseDefense = _local6.defense;
myTimer = new Timer((baseAttackTime / fireRate), 0);
myTimer.stop();
levels = new Array();
this.initLevels(levels);
coord = new Point(_arg4, _arg5);
totGraph = _arg1;
_graph = totGraph.tur_graph;
this.totGraph.x = (this.totGraph.x + (this._graph.width / 2));
this.totGraph.y = (this.totGraph.y + (this._graph.height / 2));
_graph.stop();
totGraph.stop();
totGraph.mc_update.stop();
totGraph.tur_graph.mc_attack.stop();
totGraph.tur_graph.mc_destr.stop();
totGraph.mc_sugar_effect.visible = false;
this.addChild(totGraph);
this.turName = _arg2;
this.map = _arg3;
this.radiusMc = new McRadiusCircle();
this.radiusMc.x = (this.radiusMc.x + (this._graph.width / 2));
this.radiusMc.y = (this.radiusMc.y + (this._graph.height / 2));
this.radiusMc.scaleX = this.radius;
this.radiusMc.scaleY = this.radius;
this.addChild(this.radiusMc);
this.radiusMc.visible = false;
totGraph.loader.visible = false;
map.setTurret(new Point(map.turetSetCoord.x, map.turetSetCoord.y), this);
this.updateRadius();
}
public function pause(){
if ((((free == false)) || ((selling == true)))){
myTimer.stop();
};
this._graph.stop();
}
public function upgrade(){
this.removeRadius();
this.selling = true;
this._graph.gotoAndStop((type + " N"));
this.totGraph.loader.visible = true;
totGraph.mc_update.visible = false;
totGraph.tur_graph.visible = false;
this.totGraph.loader.gotoAndStop(1);
this.myTimer.stop();
this.myTimer.removeEventListener("timer", damageMon);
this.myTimer = new Timer(100, 20);
this.myTimer.addEventListener("timer", onUpgTimer);
this.myTimer.start();
}
private function damageMon(_arg1:TimerEvent){
var _local2:Number;
if (underAttack.monsterVis == true){
if (((!((underAttack == null))) && ((underAttack.health > 0)))){
if (underAttack.underground == false){
if (Point.distance(new Point(this.x, this.y), new Point(underAttack.x, underAttack.y)) <= (14 * radius)){
this._graph.rotation = Utilites.returnAngelBetwenPoints(this.localToGlobal(new Point(this._graph.x, this._graph.y)), new Point(underAttack.x, underAttack.y));
_local2 = (damage + Math.round(getDamage()));
Main.AddBullet(underAttack, new Point(this.x, this.y), _local2, radius, 1);
return;
};
};
};
};
this._graph.gotoAndStop((type + " N"));
this.myTimer.stop();
this.free = true;
}
private function onSellTimer(_arg1:TimerEvent){
if (this.myTimer.currentCount == this.myTimer.repeatCount){
this.onSell();
} else {
sellingTick = this.myTimer.currentCount;
this.totGraph.loader.gotoAndStop(int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100)));
sellingTick = int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100));
this.dispatchEvent(new Event("onProgressTick"));
};
}
public function start(){
if ((((free == false)) || ((selling == true)))){
myTimer.start();
};
this._graph.play();
}
public function sell(_arg1:int){
this.removeRadius();
this.selling = true;
this._graph.gotoAndStop((type + " N"));
this.totGraph.loader.visible = true;
totGraph.mc_update.visible = false;
totGraph.tur_graph.visible = false;
this.totGraph.loader.gotoAndStop(1);
this.myTimer.stop();
this.myTimer.removeEventListener("timer", damageMon);
this.myTimer = new Timer(100, _arg1);
this.myTimer.addEventListener("timer", onSellTimer);
this.myTimer.start();
}
public function removeRadius(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Point;
_local1 = this.coord.x;
_local2 = this.coord.y;
_local3 = -(radius);
while (_local3 <= (radius + 1)) {
_local4 = -(radius);
while (_local4 <= (radius + 1)) {
if (map.tileArray[(_local2 + _local3)] != undefined){
if (map.tileArray[(_local2 + _local3)][(_local1 + _local4)] != undefined){
_local5 = new Point((_local2 + _local3), (_local1 + _local4));
if (Point.distance(_local5, new Point(_local2, _local1)) <= radius){
map.removeTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
if (Point.distance(_local5, new Point((_local2 + 1), (_local1 + 1))) <= radius){
map.removeTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
};
};
_local4++;
};
_local3++;
};
}
private function onUpgTimer(_arg1:TimerEvent){
if (this.myTimer.currentCount == this.myTimer.repeatCount){
this.selling = false;
Main.self.onUpgrade(this);
this.totGraph.loader.visible = false;
totGraph.mc_update.visible = true;
totGraph.tur_graph.visible = true;
this.myTimer.stop();
this.myTimer.removeEventListener("timer", onUpgTimer);
} else {
sellingTick = this.myTimer.currentCount;
this.totGraph.loader.gotoAndStop(int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100)));
sellingTick = int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100));
this.dispatchEvent(new Event("onProgressTick"));
};
}
private function initLevels(_arg1:Array){
var _local2:Object;
_local2 = XMLData.self.getTurretLevel(this.type, 1);
_arg1[0] = new Object();
_arg1[0].price = _local2.cost;
_arg1[0].damage = _local2.damage;
_arg1[0].radius = _local2.range;
_arg1[0].level = 1;
_arg1[0].fireRate = _local2.rate;
_arg1[0].defense = _local2.defense;
_arg1[0].turretName = _local2.name;
_local2 = XMLData.self.getTurretLevel(this.type, 2);
_arg1[1] = new Object();
_arg1[1].price = _local2.cost;
_arg1[1].damage = _local2.damage;
_arg1[1].radius = _local2.range;
_arg1[1].level = 2;
_arg1[1].fireRate = _local2.rate;
_arg1[1].defense = _local2.defense;
_arg1[1].turretName = _local2.name;
_local2 = XMLData.self.getTurretLevel(this.type, 3);
_arg1[2] = new Object();
_arg1[2].price = _local2.cost;
_arg1[2].damage = _local2.damage;
_arg1[2].radius = _local2.range;
_arg1[2].level = 3;
_arg1[2].fireRate = _local2.rate;
_arg1[2].defense = _local2.defense;
_arg1[2].turretName = _local2.name;
_local2 = XMLData.self.getTurretLevel(this.type, 4);
_arg1[3] = new Object();
_arg1[3].price = _local2.cost;
_arg1[3].damage = _local2.damage;
_arg1[3].radius = _local2.range;
_arg1[3].level = 4;
_arg1[3].fireRate = _local2.rate;
_arg1[3].defense = _local2.defense;
_arg1[3].turretName = _local2.name;
_local2 = XMLData.self.getTurretLevel(this.type, 5);
_arg1[4] = new Object();
_arg1[4].price = _local2.cost;
_arg1[4].damage = _local2.damage;
_arg1[4].radius = _local2.range;
_arg1[4].level = 5;
_arg1[4].fireRate = _local2.rate;
_arg1[4].defense = _local2.defense;
_arg1[4].turretName = _local2.name;
}
public function repair(){
this.defense = this.baseDefense;
}
public function clear(){
this.myTimer.stop();
this.removeRadius();
this.removeEventListener("timer", onSell);
this.removeEventListener("timer", damageMon);
this.totGraph.tur_graph.mc_destr.removeEventListener(Event.ENTER_FRAME, onDestroyAnim);
}
public function getDamage():Number{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
_local1 = Math.max(map.tileArray[this.coord.y][this.coord.x].bonusDamage, map.tileArray[this.coord.y][(this.coord.x + 1)].bonusDamage);
_local2 = Math.max(map.tileArray[(this.coord.y + 1)][this.coord.x].bonusDamage, map.tileArray[(this.coord.y + 1)][(this.coord.x + 1)].bonusDamage);
return (((Math.max(_local1, _local2) * damage) * 0.01));
}
public function hideRadius(){
this.radiusMc.visible = false;
}
public function updateRadius(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Point;
_local1 = this.coord.x;
_local2 = this.coord.y;
_local3 = -(radius);
while (_local3 <= (radius + 1)) {
_local4 = -(radius);
while (_local4 <= (radius + 1)) {
if (map.tileArray[(_local2 + _local3)] != undefined){
if (map.tileArray[(_local2 + _local3)][(_local1 + _local4)] != undefined){
_local5 = new Point((_local2 + _local3), (_local1 + _local4));
if (Point.distance(_local5, new Point(_local2, _local1)) <= radius){
map.addTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
if (Point.distance(_local5, new Point((_local2 + 1), (_local1 + 1))) <= radius){
map.addTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
};
};
_local4++;
};
_local3++;
};
}
public function kill(){
this.destroyed = true;
this.myTimer.stop();
this.removeRadius();
this.removeEventListener("timer", onSell);
this.removeEventListener("timer", damageMon);
if (this.totGraph.tur_graph.mc_destr != undefined){
this.totGraph.tur_graph.mc_destr.addEventListener(Event.ENTER_FRAME, onDestroyAnim);
this.totGraph.tur_graph.mc_destr.play();
};
}
private function onSell(){
this.clear();
this.dispatchEvent(new Event("onTurretSeled"));
}
private function onDestroyAnim(_arg1:Event){
if (_arg1.target.currentLabel == "destr"){
this.dispatchEvent(new Event("onTurretDestroyed"));
this.totGraph.tur_graph.mc_destr.removeEventListener(Event.ENTER_FRAME, onDestroyAnim);
} else {
this.totGraph.tur_graph.x = (Math.round((Math.random() * 3)) - 1);
this.totGraph.tur_graph.y = (Math.round((Math.random() * 3)) - 1);
};
}
public function attackMon(_arg1){
var _local2:Matrix;
var _local3:Point;
var _local4:Number;
var _local5:uint;
_local2 = new Matrix();
_local3 = new Point();
if (_arg1.underground == false){
if (_arg1.flying == false){
if ((((((_arg1.ground == true)) && ((this.antiGround == true)))) && ((_arg1.monsterVis == true)))){
this._graph.rotation = Utilites.returnAngelBetwenPoints(this.localToGlobal(new Point(this._graph.x, this._graph.y)), new Point(_arg1.x, _arg1.y));
this.free = false;
underAttack = _arg1;
this._graph.gotoAndPlay((type + " Shoot"));
_local5 = ((Math.random() * (this._mustardFireSounds.length - 1)) + 1);
this._mustardFireSounds[_local5].play();
_local2.rotate(((this._graph.rotation * Math.PI) / 180));
_local3 = _local2.transformPoint(new Point(this.totGraph.tur_graph.mc_shootfrom.x, this.totGraph.tur_graph.mc_shootfrom.y));
_local3.x = (_local3.x + this.x);
_local3.y = (_local3.y + this.y);
_local4 = (damage + Math.round(getDamage()));
Main.AddBullet(_arg1, _local3, _local4, radius, 1);
myTimer = new Timer((baseAttackTime / fireRate), 0);
myTimer.addEventListener("timer", damageMon);
myTimer.start();
};
} else {
if (this.antiAir == true){
if (_arg1.monsterVis == true){
this._graph.rotation = Utilites.returnAngelBetwenPoints(this.localToGlobal(new Point(this._graph.x, this._graph.y)), new Point(_arg1.x, _arg1.y));
this.free = false;
underAttack = _arg1;
this._graph.gotoAndPlay((type + " Shoot"));
_local2.rotate(((this._graph.rotation * Math.PI) / 180));
_local3 = _local2.transformPoint(new Point(this.totGraph.tur_graph.mc_shootfrom.x, this.totGraph.tur_graph.mc_shootfrom.y));
_local3.x = (_local3.x + this.x);
_local3.y = (_local3.y + this.y);
_local4 = (damage + Math.round(getDamage()));
Main.AddBullet(_arg1, _local3, _local4, radius, 1);
myTimer = new Timer((baseAttackTime / fireRate), 0);
myTimer.addEventListener("timer", damageMon);
myTimer.start();
};
};
};
};
}
public function showRadius(){
this.radiusMc.scaleX = this.radius;
this.radiusMc.scaleY = this.radius;
this.radiusMc.visible = true;
}
}
}//package com.xitexsoftware.gamepack.turets
Section 18
//Pepper (com.xitexsoftware.gamepack.turets.Pepper)
package com.xitexsoftware.gamepack.turets {
import com.xitexsoftware.gamepack.*;
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class Pepper extends MovieClip {
public const type = "pepper";
private const baseAttackTime = 2500;
public var coord:Point;
public var sellingTick:int;// = 0
public var destroyed:Boolean;// = false
public var fireRate:Number;// = 1
private var _pepperFireSounds:Array;
public var turName:String;
public var baseDefense:int;// = 100
public var price:int;// = 15
public var selling:Boolean;// = false
private var map:Map;
private var underAttack;
private var _graph:MovieClip;
public var totGraph:MovieClip;
public var damage:int;// = 5
public var free:Boolean;// = true
public var level:int;// = 1
public var levels:Array;
public var radius:int;// = 2
public var defense:int;// = 100
public var antiAir:Boolean;// = false
public var turretName:String;// = "Standard Pepper"
public var antiGround;// = true
private var radiusMc:MovieClip;
private var myTimer:Timer;
public function Pepper(_arg1:MovieClip, _arg2, _arg3:Map, _arg4, _arg5):void{
var _local6:Object;
free = true;
price = 15;
damage = 5;
radius = 2;
level = 1;
fireRate = 1;
defense = 100;
baseDefense = 100;
turretName = "Standard Pepper";
antiAir = false;
antiGround = true;
destroyed = false;
selling = false;
sellingTick = 0;
super();
this._pepperFireSounds = new Array();
this._pepperFireSounds[0] = new PepperFire1Sound();
this._pepperFireSounds[1] = new PepperFire2Sound();
this._pepperFireSounds[2] = new PepperFire3Sound();
_local6 = XMLData.self.getTurretLevel(this.type, 1);
price = _local6.cost;
damage = _local6.damage;
radius = _local6.range;
fireRate = _local6.rate;
defense = _local6.defense;
baseDefense = _local6.defense;
myTimer = new Timer((baseAttackTime / fireRate), 0);
myTimer.stop();
levels = new Array();
this.initLevels(levels);
coord = new Point(_arg4, _arg5);
totGraph = _arg1;
_graph = totGraph.tur_graph;
this.totGraph.x = (this.totGraph.x + (this._graph.width / 2));
this.totGraph.y = (this.totGraph.y + (this._graph.height / 2));
_graph.stop();
totGraph.stop();
totGraph.mc_update.stop();
totGraph.tur_graph.mc_attack.stop();
totGraph.tur_graph.mc_destr.stop();
totGraph.mc_sugar_effect.visible = false;
this.addChild(totGraph);
this.turName = _arg2;
this.map = _arg3;
this.radiusMc = new McRadiusCircle();
this.radiusMc.x = (this.radiusMc.x + (this._graph.width / 2));
this.radiusMc.y = (this.radiusMc.y + (this._graph.height / 2));
this.addChild(this.radiusMc);
this.radiusMc.visible = false;
totGraph.loader.visible = false;
map.setTurret(new Point(map.turetSetCoord.x, map.turetSetCoord.y), this);
this.updateRadius();
}
public function upgrade(){
this.removeRadius();
this.selling = true;
this._graph.gotoAndStop((type + " N"));
this.totGraph.loader.visible = true;
totGraph.mc_update.visible = false;
totGraph.tur_graph.visible = false;
this.totGraph.loader.gotoAndStop(1);
this.myTimer.stop();
this.myTimer.removeEventListener("timer", damageMon);
this.myTimer = new Timer(100, 20);
this.myTimer.addEventListener("timer", onUpgTimer);
this.myTimer.start();
}
private function damageMon(_arg1:TimerEvent){
this.myTimer.stop();
this.free = true;
}
private function onSellTimer(_arg1:TimerEvent){
if (this.myTimer.currentCount == this.myTimer.repeatCount){
this.onSell();
} else {
sellingTick = this.myTimer.currentCount;
this.totGraph.loader.gotoAndStop(int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100)));
sellingTick = int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100));
this.dispatchEvent(new Event("onProgressTick"));
};
}
public function start(){
if ((((free == false)) || ((selling == true)))){
myTimer.start();
};
this._graph.play();
}
public function sell(_arg1:int){
this.removeRadius();
this.selling = true;
this._graph.gotoAndStop((type + " N"));
this.totGraph.loader.visible = true;
totGraph.mc_update.visible = false;
totGraph.tur_graph.visible = false;
this.totGraph.loader.gotoAndStop(1);
this.myTimer.stop();
this.myTimer.removeEventListener("timer", damageMon);
this.myTimer = new Timer(100, _arg1);
this.myTimer.addEventListener("timer", onSellTimer);
this.myTimer.start();
}
public function removeRadius(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Point;
_local1 = this.coord.x;
_local2 = this.coord.y;
_local3 = -(radius);
while (_local3 <= (radius + 1)) {
_local4 = -(radius);
while (_local4 <= (radius + 1)) {
if (map.tileArray[(_local2 + _local3)] != undefined){
if (map.tileArray[(_local2 + _local3)][(_local1 + _local4)] != undefined){
_local5 = new Point((_local2 + _local3), (_local1 + _local4));
if (Point.distance(_local5, new Point(_local2, _local1)) <= radius){
map.removeTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
if (Point.distance(_local5, new Point((_local2 + 1), (_local1 + 1))) <= radius){
map.removeTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
};
};
_local4++;
};
_local3++;
};
}
private function onUpgTimer(_arg1:TimerEvent){
if (this.myTimer.currentCount == this.myTimer.repeatCount){
this.selling = false;
Main.self.onUpgrade(this);
this.totGraph.loader.visible = false;
totGraph.mc_update.visible = true;
totGraph.tur_graph.visible = true;
this.myTimer.stop();
this.myTimer.removeEventListener("timer", onUpgTimer);
} else {
sellingTick = this.myTimer.currentCount;
this.totGraph.loader.gotoAndStop(int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100)));
sellingTick = int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100));
this.dispatchEvent(new Event("onProgressTick"));
};
}
private function initLevels(_arg1:Array){
var _local2:Object;
_local2 = XMLData.self.getTurretLevel(this.type, 1);
_arg1[0] = new Object();
_arg1[0].price = _local2.cost;
_arg1[0].damage = _local2.damage;
_arg1[0].radius = _local2.range;
_arg1[0].level = 1;
_arg1[0].fireRate = _local2.rate;
_arg1[0].defense = _local2.defense;
_arg1[0].turretName = _local2.name;
_local2 = XMLData.self.getTurretLevel(this.type, 2);
_arg1[1] = new Object();
_arg1[1].price = _local2.cost;
_arg1[1].damage = _local2.damage;
_arg1[1].radius = _local2.range;
_arg1[1].level = 2;
_arg1[1].fireRate = _local2.rate;
_arg1[1].defense = _local2.defense;
_arg1[1].turretName = _local2.name;
_local2 = XMLData.self.getTurretLevel(this.type, 3);
_arg1[2] = new Object();
_arg1[2].price = _local2.cost;
_arg1[2].damage = _local2.damage;
_arg1[2].radius = _local2.range;
_arg1[2].level = 3;
_arg1[2].fireRate = _local2.rate;
_arg1[2].defense = _local2.defense;
_arg1[2].turretName = _local2.name;
}
public function clear(){
this.myTimer.stop();
this.removeRadius();
this.removeEventListener("timer", onSell);
this.removeEventListener("timer", damageMon);
this.totGraph.tur_graph.mc_destr.removeEventListener(Event.ENTER_FRAME, onDestroyAnim);
}
public function getDamage():Number{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
_local1 = Math.max(map.tileArray[this.coord.y][this.coord.x].bonusDamage, map.tileArray[this.coord.y][(this.coord.x + 1)].bonusDamage);
_local2 = Math.max(map.tileArray[(this.coord.y + 1)][this.coord.x].bonusDamage, map.tileArray[(this.coord.y + 1)][(this.coord.x + 1)].bonusDamage);
return (((Math.max(_local1, _local2) * damage) * 0.01));
}
public function hideRadius(){
this.radiusMc.visible = false;
}
public function updateRadius(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Point;
_local1 = this.coord.x;
_local2 = this.coord.y;
_local3 = -(radius);
while (_local3 <= (radius + 1)) {
_local4 = -(radius);
while (_local4 <= (radius + 1)) {
if (map.tileArray[(_local2 + _local3)] != undefined){
if (map.tileArray[(_local2 + _local3)][(_local1 + _local4)] != undefined){
_local5 = new Point((_local2 + _local3), (_local1 + _local4));
if (Point.distance(_local5, new Point(_local2, _local1)) <= radius){
map.addTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
if (Point.distance(_local5, new Point((_local2 + 1), (_local1 + 1))) <= radius){
map.addTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
};
};
_local4++;
};
_local3++;
};
}
public function kill(){
this.destroyed = true;
this.myTimer.stop();
this.removeRadius();
this.removeEventListener("timer", onSell);
this.removeEventListener("timer", damageMon);
if (this.totGraph.tur_graph.mc_destr != undefined){
this.totGraph.tur_graph.mc_destr.addEventListener(Event.ENTER_FRAME, onDestroyAnim);
this.totGraph.tur_graph.mc_destr.play();
};
}
private function onSell(){
this.clear();
this.dispatchEvent(new Event("onTurretSeled"));
}
private function onDestroyAnim(_arg1:Event){
if (_arg1.target.currentLabel == "destr"){
this.dispatchEvent(new Event("onTurretDestroyed"));
this.totGraph.tur_graph.mc_destr.removeEventListener(Event.ENTER_FRAME, onDestroyAnim);
} else {
this.totGraph.tur_graph.x = (Math.round((Math.random() * 3)) - 1);
this.totGraph.tur_graph.y = (Math.round((Math.random() * 3)) - 1);
};
}
public function attackMon(_arg1){
var _local2:uint;
var _local3:Matrix;
var _local4:Point;
var _local5:Number;
if (_arg1.monsterVis == true){
this._graph.rotation = Utilites.returnAngelBetwenPoints(this.localToGlobal(new Point(this._graph.x, this._graph.y)), new Point(_arg1.x, _arg1.y));
this.free = false;
this._graph.gotoAndPlay((type + " Shoot"));
_local2 = ((Math.random() * (this._pepperFireSounds.length - 1)) + 1);
this._pepperFireSounds[_local2].play();
underAttack = _arg1;
myTimer = new Timer((baseAttackTime / fireRate), 0);
myTimer.addEventListener("timer", damageMon);
myTimer.start();
_local3 = new Matrix();
_local3.rotate(((this._graph.rotation * Math.PI) / 180));
_local4 = _local3.transformPoint(new Point(this.totGraph.tur_graph.mc_shootfrom.x, this.totGraph.tur_graph.mc_shootfrom.y));
_local3.transformPoint(new Point(this.totGraph.tur_graph.mc_shootfrom.x, this.totGraph.tur_graph.mc_shootfrom.y)).x = (_local4.x + this.x);
_local4.y = (_local4.y + this.y);
_local5 = (damage + Math.round(getDamage()));
Main.AddBullet(underAttack, _local4, _local5, radius, 4);
};
}
public function showRadius(){
this.radiusMc.scaleX = (this.radius + 1);
this.radiusMc.scaleY = (this.radius + 1);
this.radiusMc.visible = true;
}
public function pause(){
if ((((free == false)) || ((selling == true)))){
myTimer.stop();
};
this._graph.stop();
}
}
}//package com.xitexsoftware.gamepack.turets
Section 19
//Sugar (com.xitexsoftware.gamepack.turets.Sugar)
package com.xitexsoftware.gamepack.turets {
import com.xitexsoftware.gamepack.*;
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class Sugar extends MovieClip {
public const type = "sugar";
private const baseAttackTime = 2500;
public var coord:Point;
public var sellingTick:int;// = 0
public var destroyed:Boolean;// = false
public var fireRate:Number;// = 1
public var turName:String;
public var baseDefense:int;// = 100
public var price:int;// = 50
public var selling:Boolean;// = false
private var map:Map;
private var underAttack;
private var _graph:MovieClip;
public var totGraph:MovieClip;
public var damage:Number;// = 0.1
public var free:Boolean;// = false
public var level:int;// = 1
public var levels:Array;
public var radius:int;// = 2
public var defense:int;// = 100
public var antiAir:Boolean;// = true
public var turretName:String;// = "Raw sugar"
public var antiGround;// = true
private var radiusMc:MovieClip;
private var myTimer:Timer;
public function Sugar(_arg1:MovieClip, _arg2, _arg3:Map, _arg4, _arg5):void{
var _local6:Object;
free = false;
price = 50;
damage = 0.1;
radius = 2;
level = 1;
fireRate = 1;
defense = 100;
baseDefense = 100;
turretName = "Raw sugar";
antiAir = true;
antiGround = true;
destroyed = false;
selling = false;
sellingTick = 0;
super();
_local6 = XMLData.self.getTurretLevel(this.type, 1);
price = _local6.cost;
damage = _local6.damage;
radius = _local6.range;
fireRate = _local6.rate;
defense = _local6.defense;
baseDefense = _local6.defense;
myTimer = new Timer(0, 0);
myTimer.stop();
levels = new Array();
this.initLevels(levels);
coord = new Point(_arg4, _arg5);
_graph = _arg1;
_graph.stop();
totGraph = _graph;
totGraph.mc_update.stop();
totGraph.tur_graph.mc_attack.stop();
totGraph.tur_graph.mc_destr.stop();
totGraph.mc_sugar_effect.visible = false;
this.turName = _arg2;
this._graph.x = (this._graph.x + (this._graph.tur_graph.width / 2));
this._graph.y = (this._graph.y + (this._graph.tur_graph.height / 2));
this.addChild(_graph);
this.map = _arg3;
this.radiusMc = new McRadiusCircle();
this.radiusMc.x = (this.radiusMc.x + (this._graph.tur_graph.width / 2));
this.radiusMc.y = (this.radiusMc.y + (this._graph.tur_graph.height / 2));
this.addChild(this.radiusMc);
this.radiusMc.visible = false;
totGraph.loader.visible = false;
map.setTurret(new Point(map.turetSetCoord.x, map.turetSetCoord.y), this);
this.updateRadius();
}
public function upgrade(){
this.removeBonus();
this.removeRadius();
this.selling = true;
this._graph.gotoAndStop((type + " N"));
this.totGraph.loader.visible = true;
totGraph.mc_update.visible = false;
totGraph.tur_graph.visible = false;
this.totGraph.loader.gotoAndStop(1);
this.myTimer.stop();
this.myTimer.removeEventListener("timer", damageMon);
this.myTimer = new Timer(100, 20);
this.myTimer.addEventListener("timer", onUpgTimer);
this.myTimer.start();
}
private function damageMon(_arg1:TimerEvent){
}
private function onSellTimer(_arg1:TimerEvent){
if (this.myTimer.currentCount == this.myTimer.repeatCount){
this.onSell();
} else {
sellingTick = this.myTimer.currentCount;
this.totGraph.loader.gotoAndStop(int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100)));
sellingTick = int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100));
this.dispatchEvent(new Event("onProgressTick"));
};
}
public function start(){
if ((((free == false)) || ((selling == true)))){
myTimer.start();
};
}
public function sell(_arg1:int){
this.removeRadius();
this.selling = true;
this._graph.gotoAndStop((type + " N"));
this.totGraph.loader.visible = true;
totGraph.mc_update.visible = false;
totGraph.tur_graph.visible = false;
this.totGraph.loader.gotoAndStop(1);
this.myTimer.stop();
this.myTimer.removeEventListener("timer", damageMon);
this.myTimer = new Timer(100, _arg1);
this.myTimer.addEventListener("timer", onSellTimer);
this.myTimer.start();
}
public function removeRadius(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Point;
_local1 = this.coord.x;
_local2 = this.coord.y;
_local3 = -(radius);
while (_local3 <= (radius + 1)) {
_local4 = -(radius);
while (_local4 <= (radius + 1)) {
if (map.tileArray[(_local2 + _local3)] != undefined){
if (map.tileArray[(_local2 + _local3)][(_local1 + _local4)] != undefined){
_local5 = new Point((_local2 + _local3), (_local1 + _local4));
if (Point.distance(_local5, new Point(_local2, _local1)) <= radius){
map.removeTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
if (Point.distance(_local5, new Point((_local2 + 1), (_local1 + 1))) <= radius){
map.removeTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
};
};
_local4++;
};
_local3++;
};
}
private function onUpgTimer(_arg1:TimerEvent){
if (this.myTimer.currentCount == this.myTimer.repeatCount){
this.selling = false;
Main.self.onUpgrade(this);
this.totGraph.loader.visible = false;
totGraph.mc_update.visible = true;
totGraph.tur_graph.visible = true;
this.myTimer.stop();
this.myTimer.removeEventListener("timer", onUpgTimer);
} else {
sellingTick = this.myTimer.currentCount;
this.totGraph.loader.gotoAndStop(int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100)));
sellingTick = int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100));
this.dispatchEvent(new Event("onProgressTick"));
};
}
private function initLevels(_arg1:Array){
var _local2:Object;
_local2 = XMLData.self.getTurretLevel(this.type, 1);
_arg1[0] = new Object();
_arg1[0].price = _local2.cost;
_arg1[0].damage = _local2.damage;
_arg1[0].radius = _local2.range;
_arg1[0].level = 1;
_arg1[0].fireRate = _local2.rate;
_arg1[0].defense = _local2.defense;
_arg1[0].turretName = _local2.name;
_local2 = XMLData.self.getTurretLevel(this.type, 2);
_arg1[1] = new Object();
_arg1[1].price = _local2.cost;
_arg1[1].damage = _local2.damage;
_arg1[1].radius = _local2.range;
_arg1[1].level = 2;
_arg1[1].fireRate = _local2.rate;
_arg1[1].defense = _local2.defense;
_arg1[1].turretName = _local2.name;
_local2 = XMLData.self.getTurretLevel(this.type, 3);
_arg1[2] = new Object();
_arg1[2].price = _local2.cost;
_arg1[2].damage = _local2.damage;
_arg1[2].radius = _local2.range;
_arg1[2].level = 3;
_arg1[2].fireRate = _local2.rate;
_arg1[2].defense = _local2.defense;
_arg1[2].turretName = _local2.name;
}
public function clear(){
this.myTimer.stop();
this.removeRadius();
this.removeBonus();
this.removeEventListener("timer", onSell);
this.removeEventListener("timer", damageMon);
this.totGraph.tur_graph.mc_destr.removeEventListener(Event.ENTER_FRAME, onDestroyAnim);
}
public function getDamage():Number{
return (0);
}
public function hideRadius(){
this.radiusMc.visible = false;
}
public function updateRadius(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Point;
_local1 = this.coord.x;
_local2 = this.coord.y;
_local3 = -(radius);
while (_local3 <= (radius + 1)) {
_local4 = -(radius);
while (_local4 <= (radius + 1)) {
if (map.tileArray[(_local2 + _local3)] != undefined){
if (map.tileArray[(_local2 + _local3)][(_local1 + _local4)] != undefined){
_local5 = new Point((_local2 + _local3), (_local1 + _local4));
if (Point.distance(_local5, new Point(_local2, _local1)) <= radius){
map.addTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
if (Point.distance(_local5, new Point((_local2 + 1), (_local1 + 1))) <= radius){
map.addTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
};
};
_local4++;
};
_local3++;
};
}
public function kill(){
this.destroyed = true;
this.myTimer.stop();
this.removeRadius();
this.removeEventListener("timer", onSell);
this.removeEventListener("timer", damageMon);
if (this.totGraph.tur_graph.mc_destr != undefined){
this.totGraph.tur_graph.mc_destr.addEventListener(Event.ENTER_FRAME, onDestroyAnim);
this.totGraph.tur_graph.mc_destr.play();
};
}
public function removeBonus(){
this.map.tileArray[(coord.y - 1)][(coord.x - 1)].bonusDamage = (this.map.tileArray[(coord.y - 1)][(coord.x - 1)].bonusDamage - (this.damage * 100));
this.map.tileArray[coord.y][(coord.x - 1)].bonusDamage = (this.map.tileArray[coord.y][(coord.x - 1)].bonusDamage - (this.damage * 100));
this.map.tileArray[(coord.y + 1)][(coord.x - 1)].bonusDamage = (this.map.tileArray[(coord.y + 1)][(coord.x - 1)].bonusDamage - (this.damage * 100));
this.map.tileArray[(coord.y + 2)][(coord.x - 1)].bonusDamage = (this.map.tileArray[(coord.y + 2)][(coord.x - 1)].bonusDamage - (this.damage * 100));
this.map.tileArray[(coord.y + 2)][coord.x].bonusDamage = (this.map.tileArray[(coord.y + 2)][coord.x].bonusDamage - (this.damage * 100));
this.map.tileArray[(coord.y + 2)][(coord.x + 1)].bonusDamage = (this.map.tileArray[(coord.y + 2)][(coord.x + 1)].bonusDamage - (this.damage * 100));
this.map.tileArray[(coord.y + 2)][(coord.x + 2)].bonusDamage = (this.map.tileArray[(coord.y + 2)][(coord.x + 2)].bonusDamage - (this.damage * 100));
this.map.tileArray[(coord.y + 1)][(coord.x + 2)].bonusDamage = (this.map.tileArray[(coord.y + 1)][(coord.x + 2)].bonusDamage - (this.damage * 100));
this.map.tileArray[coord.y][(coord.x + 2)].bonusDamage = (this.map.tileArray[coord.y][(coord.x + 2)].bonusDamage - (this.damage * 100));
this.map.tileArray[(coord.y - 1)][(coord.x + 2)].bonusDamage = (this.map.tileArray[(coord.y - 1)][(coord.x + 2)].bonusDamage - (this.damage * 100));
this.map.tileArray[(coord.y - 1)][(coord.x + 1)].bonusDamage = (this.map.tileArray[(coord.y - 1)][(coord.x + 1)].bonusDamage - (this.damage * 100));
this.map.tileArray[(coord.y - 1)][coord.x].bonusDamage = (this.map.tileArray[(coord.y - 1)][coord.x].bonusDamage - (this.damage * 100));
}
private function onSell(){
this.dispatchEvent(new Event("onTurretSeled"));
}
private function onDestroyAnim(_arg1:Event){
if (_arg1.target.currentLabel == "destr"){
this.dispatchEvent(new Event("onTurretDestroyed"));
this.totGraph.tur_graph.mc_destr.removeEventListener(Event.ENTER_FRAME, onDestroyAnim);
} else {
this.totGraph.tur_graph.x = (Math.round((Math.random() * 3)) - 1);
this.totGraph.tur_graph.y = (Math.round((Math.random() * 3)) - 1);
};
}
public function attackMon(_arg1){
}
public function setBonus(){
this.map.tileArray[(coord.y - 1)][(coord.x - 1)].bonusDamage = (this.map.tileArray[(coord.y - 1)][(coord.x - 1)].bonusDamage + (this.damage * 100));
this.map.tileArray[coord.y][(coord.x - 1)].bonusDamage = (this.map.tileArray[coord.y][(coord.x - 1)].bonusDamage + (this.damage * 100));
this.map.tileArray[(coord.y + 1)][(coord.x - 1)].bonusDamage = (this.map.tileArray[(coord.y + 1)][(coord.x - 1)].bonusDamage + (this.damage * 100));
this.map.tileArray[(coord.y + 2)][(coord.x - 1)].bonusDamage = (this.map.tileArray[(coord.y + 2)][(coord.x - 1)].bonusDamage + (this.damage * 100));
this.map.tileArray[(coord.y + 2)][coord.x].bonusDamage = (this.map.tileArray[(coord.y + 2)][coord.x].bonusDamage + (this.damage * 100));
this.map.tileArray[(coord.y + 2)][(coord.x + 1)].bonusDamage = (this.map.tileArray[(coord.y + 2)][(coord.x + 1)].bonusDamage + (this.damage * 100));
this.map.tileArray[(coord.y + 2)][(coord.x + 2)].bonusDamage = (this.map.tileArray[(coord.y + 2)][(coord.x + 2)].bonusDamage + (this.damage * 100));
this.map.tileArray[(coord.y + 1)][(coord.x + 2)].bonusDamage = (this.map.tileArray[(coord.y + 1)][(coord.x + 2)].bonusDamage + (this.damage * 100));
this.map.tileArray[coord.y][(coord.x + 2)].bonusDamage = (this.map.tileArray[coord.y][(coord.x + 2)].bonusDamage + (this.damage * 100));
this.map.tileArray[(coord.y - 1)][(coord.x + 2)].bonusDamage = (this.map.tileArray[(coord.y - 1)][(coord.x + 2)].bonusDamage + (this.damage * 100));
this.map.tileArray[(coord.y - 1)][(coord.x + 1)].bonusDamage = (this.map.tileArray[(coord.y - 1)][(coord.x + 1)].bonusDamage + (this.damage * 100));
this.map.tileArray[(coord.y - 1)][coord.x].bonusDamage = (this.map.tileArray[(coord.y - 1)][coord.x].bonusDamage + (this.damage * 100));
}
public function showRadius(){
this.radiusMc.scaleX = this.radius;
this.radiusMc.scaleY = this.radius;
this.radiusMc.visible = true;
}
public function pause(){
if ((((free == false)) || ((selling == true)))){
myTimer.stop();
};
}
}
}//package com.xitexsoftware.gamepack.turets
Section 20
//Toothpick (com.xitexsoftware.gamepack.turets.Toothpick)
package com.xitexsoftware.gamepack.turets {
import com.xitexsoftware.gamepack.*;
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class Toothpick extends MovieClip {
public const type = "toothpick";
private const baseAttackTime = 2500;
public var coord:Point;
public var sellingTick:int;// = 0
public var destroyed:Boolean;// = false
private var _toothpickFireSounds:Array;
public var fireRate:Number;// = 1
public var turName:String;
public var baseDefense:int;// = 100
public var price:int;// = 12
public var selling:Boolean;// = false
private var map:Map;
private var underAttack;
private var _graph:MovieClip;
public var totGraph:MovieClip;
public var damage:int;// = 3
public var free:Boolean;// = true
public var level:int;// = 1
public var levels:Array;
public var radius:int;// = 6
public var defense:int;// = 100
public var antiAir:Boolean;// = false
public var turretName:String;// = "Standard Toothpick"
public var antiGround;// = true
private var radiusMc:MovieClip;
private var myTimer:Timer;
public function Toothpick(_arg1:MovieClip, _arg2, _arg3:Map, _arg4, _arg5):void{
var _local6:Object;
free = true;
price = 12;
damage = 3;
radius = 6;
level = 1;
fireRate = 1;
defense = 100;
baseDefense = 100;
turretName = "Standard Toothpick";
antiAir = false;
antiGround = true;
destroyed = false;
selling = false;
sellingTick = 0;
super();
this._toothpickFireSounds = new Array();
this._toothpickFireSounds[0] = new ToothpickFire1Sound();
this._toothpickFireSounds[1] = new ToothpickFire2Sound();
this._toothpickFireSounds[2] = new ToothpickFire3Sound();
_local6 = XMLData.self.getTurretLevel(this.type, 1);
price = _local6.cost;
damage = _local6.damage;
radius = _local6.range;
fireRate = _local6.rate;
defense = _local6.defense;
baseDefense = _local6.defense;
myTimer = new Timer((baseAttackTime / fireRate), 0);
myTimer.stop();
levels = new Array();
this.initLevels(levels);
coord = new Point(_arg4, _arg5);
totGraph = _arg1;
_graph = totGraph.tur_graph;
this.totGraph.x = (this.totGraph.x + (this._graph.width / 2));
this.totGraph.y = (this.totGraph.y + (this._graph.height / 2));
_graph.stop();
totGraph.stop();
totGraph.mc_update.stop();
totGraph.tur_graph.mc_attack.stop();
totGraph.tur_graph.mc_destr.stop();
totGraph.mc_sugar_effect.visible = false;
this.addChild(totGraph);
this.turName = _arg2;
this.map = _arg3;
this.radiusMc = new McRadiusCircle();
this.radiusMc.x = (this.radiusMc.x + (this._graph.width / 2));
this.radiusMc.y = (this.radiusMc.y + (this._graph.height / 2));
this.addChild(this.radiusMc);
this.radiusMc.visible = false;
totGraph.loader.visible = false;
map.setTurret(new Point(map.turetSetCoord.x, map.turetSetCoord.y), this);
this.updateRadius();
}
public function upgrade(){
this.removeRadius();
this.selling = true;
this._graph.gotoAndStop((type + " N"));
this.totGraph.loader.visible = true;
totGraph.mc_update.visible = false;
totGraph.tur_graph.visible = false;
this.totGraph.loader.gotoAndStop(1);
this.myTimer.stop();
this.myTimer.removeEventListener("timer", damageMon);
this.myTimer = new Timer(100, 20);
this.myTimer.addEventListener("timer", onUpgTimer);
this.myTimer.start();
}
private function damageMon(_arg1:TimerEvent){
this.myTimer.stop();
this.free = true;
}
private function onSellTimer(_arg1:TimerEvent){
if (this.myTimer.currentCount == this.myTimer.repeatCount){
this.onSell();
} else {
sellingTick = this.myTimer.currentCount;
this.totGraph.loader.gotoAndStop(int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100)));
sellingTick = int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100));
this.dispatchEvent(new Event("onProgressTick"));
};
}
public function start(){
if ((((free == false)) || ((selling == true)))){
myTimer.start();
};
this._graph.play();
}
public function sell(_arg1:int){
this.removeRadius();
this.selling = true;
this._graph.gotoAndStop((type + " N"));
this.totGraph.loader.visible = true;
totGraph.mc_update.visible = false;
totGraph.tur_graph.visible = false;
this.totGraph.loader.gotoAndStop(1);
this.myTimer.stop();
this.myTimer.removeEventListener("timer", damageMon);
this.myTimer = new Timer(100, _arg1);
this.myTimer.addEventListener("timer", onSellTimer);
this.myTimer.start();
}
public function removeRadius(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Point;
_local1 = this.coord.x;
_local2 = this.coord.y;
_local3 = -(radius);
while (_local3 <= (radius + 1)) {
_local4 = -(radius);
while (_local4 <= (radius + 1)) {
if (map.tileArray[(_local2 + _local3)] != undefined){
if (map.tileArray[(_local2 + _local3)][(_local1 + _local4)] != undefined){
_local5 = new Point((_local2 + _local3), (_local1 + _local4));
if (Point.distance(_local5, new Point(_local2, _local1)) <= radius){
map.removeTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
if (Point.distance(_local5, new Point((_local2 + 1), (_local1 + 1))) <= radius){
map.removeTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
};
};
_local4++;
};
_local3++;
};
}
private function onUpgTimer(_arg1:TimerEvent){
if (this.myTimer.currentCount == this.myTimer.repeatCount){
this.selling = false;
Main.self.onUpgrade(this);
this.totGraph.loader.visible = false;
totGraph.mc_update.visible = true;
totGraph.tur_graph.visible = true;
this.myTimer.stop();
this.myTimer.removeEventListener("timer", onUpgTimer);
} else {
sellingTick = this.myTimer.currentCount;
this.totGraph.loader.gotoAndStop(int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100)));
sellingTick = int(((this.myTimer.currentCount / this.myTimer.repeatCount) * 100));
this.dispatchEvent(new Event("onProgressTick"));
};
}
private function initLevels(_arg1:Array){
var _local2:Object;
_local2 = XMLData.self.getTurretLevel(this.type, 1);
_arg1[0] = new Object();
_arg1[0].price = _local2.cost;
_arg1[0].damage = _local2.damage;
_arg1[0].radius = _local2.range;
_arg1[0].level = 1;
_arg1[0].fireRate = _local2.rate;
_arg1[0].defense = _local2.defense;
_arg1[0].turretName = _local2.name;
_local2 = XMLData.self.getTurretLevel(this.type, 2);
_arg1[1] = new Object();
_arg1[1].price = _local2.cost;
_arg1[1].damage = _local2.damage;
_arg1[1].radius = _local2.range;
_arg1[1].level = 2;
_arg1[1].fireRate = _local2.rate;
_arg1[1].defense = _local2.defense;
_arg1[1].turretName = _local2.name;
_local2 = XMLData.self.getTurretLevel(this.type, 3);
_arg1[2] = new Object();
_arg1[2].price = _local2.cost;
_arg1[2].damage = _local2.damage;
_arg1[2].radius = _local2.range;
_arg1[2].level = 3;
_arg1[2].fireRate = _local2.rate;
_arg1[2].defense = _local2.defense;
_arg1[2].turretName = _local2.name;
_local2 = XMLData.self.getTurretLevel(this.type, 4);
_arg1[3] = new Object();
_arg1[3].price = _local2.cost;
_arg1[3].damage = _local2.damage;
_arg1[3].radius = _local2.range;
_arg1[3].level = 4;
_arg1[3].fireRate = _local2.rate;
_arg1[3].defense = _local2.defense;
_arg1[3].turretName = _local2.name;
}
public function repair(){
this.defense = this.baseDefense;
}
public function clear(){
this.myTimer.stop();
this.removeRadius();
this.removeEventListener("timer", onSell);
this.removeEventListener("timer", damageMon);
this.totGraph.tur_graph.mc_destr.removeEventListener(Event.ENTER_FRAME, onDestroyAnim);
}
public function getDamage():Number{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
_local1 = Math.max(map.tileArray[this.coord.y][this.coord.x].bonusDamage, map.tileArray[this.coord.y][(this.coord.x + 1)].bonusDamage);
_local2 = Math.max(map.tileArray[(this.coord.y + 1)][this.coord.x].bonusDamage, map.tileArray[(this.coord.y + 1)][(this.coord.x + 1)].bonusDamage);
return (((Math.max(_local1, _local2) * damage) * 0.01));
}
public function hideRadius(){
this.radiusMc.visible = false;
}
public function updateRadius(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Point;
_local1 = this.coord.x;
_local2 = this.coord.y;
_local3 = -(radius);
while (_local3 <= (radius + 1)) {
_local4 = -(radius);
while (_local4 <= (radius + 1)) {
if (map.tileArray[(_local2 + _local3)] != undefined){
if (map.tileArray[(_local2 + _local3)][(_local1 + _local4)] != undefined){
_local5 = new Point((_local2 + _local3), (_local1 + _local4));
if (Point.distance(_local5, new Point(_local2, _local1)) <= radius){
map.addTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
if (Point.distance(_local5, new Point((_local2 + 1), (_local1 + 1))) <= radius){
map.addTurretPoint(this, (_local2 + _local3), (_local1 + _local4));
};
};
};
_local4++;
};
_local3++;
};
}
public function kill(){
this.destroyed = true;
this.myTimer.stop();
this.removeRadius();
this.removeEventListener("timer", onSell);
this.removeEventListener("timer", damageMon);
if (this.totGraph.tur_graph.mc_destr != undefined){
this.totGraph.tur_graph.mc_destr.addEventListener(Event.ENTER_FRAME, onDestroyAnim);
this.totGraph.tur_graph.mc_destr.play();
};
}
private function onSell(){
this.clear();
this.dispatchEvent(new Event("onTurretSeled"));
}
private function onDestroyAnim(_arg1:Event){
if (_arg1.target.currentLabel == "destr"){
this.dispatchEvent(new Event("onTurretDestroyed"));
this.totGraph.tur_graph.mc_destr.removeEventListener(Event.ENTER_FRAME, onDestroyAnim);
} else {
this.totGraph.tur_graph.x = (Math.round((Math.random() * 3)) - 1);
this.totGraph.tur_graph.y = (Math.round((Math.random() * 3)) - 1);
};
}
public function attackMon(_arg1){
var _local2:uint;
var _local3:Number;
if ((((_arg1.underground == false)) && ((_arg1.monsterVis == true)))){
this.free = false;
this._graph.gotoAndPlay((type + " Shoot"));
_local2 = ((Math.random() * (this._toothpickFireSounds.length - 1)) + 1);
this._toothpickFireSounds[_local2].play();
this._graph.rotation = Utilites.returnAngelBetwenPoints(this.localToGlobal(new Point(this._graph.x, this._graph.y)), new Point(_arg1.x, _arg1.y));
_local3 = (damage + Math.round(getDamage()));
Main.toothpickAttack(new Point(_arg1.x, _arg1.y), new Point(this.x, this.y), _local3, this.radius);
myTimer = new Timer((baseAttackTime / fireRate), 0);
myTimer.addEventListener("timer", damageMon);
myTimer.start();
};
}
public function showRadius(){
this.radiusMc.scaleX = this.radius;
this.radiusMc.scaleY = this.radius;
this.radiusMc.visible = true;
}
public function pause(){
if ((((free == false)) || ((selling == true)))){
myTimer.stop();
};
this._graph.stop();
}
}
}//package com.xitexsoftware.gamepack.turets
Section 21
//Bonus (com.xitexsoftware.gamepack.Bonus)
package com.xitexsoftware.gamepack {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Bonus extends MovieClip {
private var mon;
private var _graph:MovieClip;
public var follow;// = false
public var tile:Tile;
private var timerCount:int;// = 0
private var _bonusRescuedSound:BonusRescuedSound;
private var myTimer:Timer;
public function Bonus(){
follow = false;
timerCount = 0;
super();
this._bonusRescuedSound = new BonusRescuedSound();
if (Math.random() < 0.5){
_graph = new McCheese();
} else {
_graph = new McChickenleg();
};
this.addChild(_graph);
this.addEventListener(Event.ENTER_FRAME, onBonusEnterFrame);
myTimer = new Timer(1000, 30);
myTimer.addEventListener(TimerEvent.TIMER, onTimer);
myTimer.start();
}
public function init(_arg1:int, _arg2:int, _arg3:Tile){
this.x = _arg1;
this.y = _arg2;
this.tile = _arg3;
}
private function onBonusEnterFrame(_arg1:Event){
if (this.follow == true){
this.x = (mon.x + 14);
this.y = (mon.y - 28);
};
}
public function start(){
this.myTimer.start();
}
public function clear(){
this._bonusRescuedSound.play();
this.myTimer.stop();
this.removeEventListener(TimerEvent.TIMER, onTimer);
this.removeEventListener(Event.ENTER_FRAME, onBonusEnterFrame);
}
public function onTimer(_arg1:TimerEvent){
if (timerCount > 19){
myTimer.stop();
this.tile.removeBonus();
Main.addBonusScore();
};
timerCount++;
}
public function pickUp(_arg1){
Main.self.makeChanges();
this.mon = _arg1;
this.follow = true;
this.myTimer.stop();
}
public function drop(){
this.follow = false;
this.myTimer.start();
}
public function pause(){
this.myTimer.stop();
}
}
}//package com.xitexsoftware.gamepack
Section 22
//Bullet (com.xitexsoftware.gamepack.Bullet)
package com.xitexsoftware.gamepack {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class Bullet extends MovieClip {
private var hitedArray:Dictionary;
private var _monArray:Array;
private var startPoint:Point;
private var tx:int;
private var _killMonsterSounds:Array;
private var target:Point;
private var _damage:int;
private var ty:int;
private var _radius:int;
public var bulName:String;
private var myTimer:Timer;
public function Bullet(_arg1:Point, _arg2, _arg3:Array, _arg4:int, _arg5:int){
this._killMonsterSounds = new Array();
this._killMonsterSounds[0] = new Kill1MonsterSound();
this._killMonsterSounds[1] = new Kill2MonsterSound();
this._killMonsterSounds[2] = new Kill3MonsterSound();
this._killMonsterSounds[3] = new Kill4MonsterSound();
this._killMonsterSounds[4] = new Kill5MonsterSound();
this._killMonsterSounds[5] = new Kill6MonsterSound();
this._killMonsterSounds[6] = new Kill7MonsterSound();
this._killMonsterSounds[7] = new Kill8MonsterSound();
this._killMonsterSounds[8] = new Kill9MonsterSound();
this._killMonsterSounds[9] = new Kill10MonsterSound();
this._killMonsterSounds[10] = new Kill11MonsterSound();
this._killMonsterSounds[11] = new Kill12MonsterSound();
this._killMonsterSounds[12] = new Kill13MonsterSound();
this._killMonsterSounds[13] = new Kill14MonsterSound();
this._killMonsterSounds[14] = new Kill15MonsterSound();
this._killMonsterSounds[15] = new Kill16MonsterSound();
this._killMonsterSounds[16] = new Kill17MonsterSound();
this._killMonsterSounds[17] = new Kill18MonsterSound();
this._killMonsterSounds[18] = new Kill19MonsterSound();
this._killMonsterSounds[19] = new Kill20MonsterSound();
this._killMonsterSounds[20] = new Kill21MonsterSound();
this._killMonsterSounds[21] = new Kill22MonsterSound();
hitedArray = new Dictionary(true);
_radius = _arg5;
target = new Point();
target.x = _arg1.x;
target.y = _arg1.y;
bulName = _arg2;
_monArray = _arg3;
_damage = _arg4;
}
public function init(){
var _local1:Point;
var _local2:*;
this.rotation = Utilites.returnAngelBetwenPoints(new Point(this.x, this.y), target);
_local1 = new Point(this.x, this.y);
_local2 = target;
this.ty = -(Point.polar(10, ((this.rotation * Math.PI) / 180)).x);
this.tx = Point.polar(10, ((this.rotation * Math.PI) / 180)).y;
startPoint = new Point(this.x, this.y);
this.myTimer = new Timer(40, 500);
this.myTimer.addEventListener("timer", move);
myTimer.start();
}
private function playRandomSound(_arg1:Boolean):void{
var _local2:uint;
if (!_arg1){
_local2 = Math.round((Math.random() * 15));
} else {
_local2 = (Math.round((Math.random() * (22 - 16))) + 15);
};
this._killMonsterSounds[_local2].play();
}
public function start(){
this.myTimer.start();
}
public function clear(){
this.myTimer.stop();
this.myTimer.removeEventListener("timer", move);
}
private function move(_arg1:Event){
var _local2:*;
this.x = (this.x + tx);
this.y = (this.y + ty);
for (_local2 in _monArray) {
if ((((_monArray[_local2].underground == false)) && (_monArray[_local2].monsterVis))){
if (this.hitTestObject(_monArray[_local2]._graph) == true){
if (hitedArray[_monArray[_local2]] == undefined){
_monArray[_local2].health = (_monArray[_local2].health - this._damage);
if (_monArray[_local2].health < 1){
this.playRandomSound(_monArray[_local2].boses);
_monArray[_local2].kill();
} else {
_monArray[_local2].healthBar.gotoAndStop(Math.round((25 - ((25 * _monArray[_local2].health) / _monArray[_local2].baseHealth))));
};
hitedArray[_monArray[_local2]] = new Boolean(true);
};
};
};
};
if (Point.distance(new Point(this.x, this.y), startPoint) > (_radius * 14)){
Main.destroyBulet(this);
};
}
public function pause(){
this.myTimer.stop();
}
}
}//package com.xitexsoftware.gamepack
Section 23
//Map (com.xitexsoftware.gamepack.Map)
package com.xitexsoftware.gamepack {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
public class Map extends MovieClip {
public const halfTileSize:int = 7;
public const tileSize:int = 14;
public var turetSetType:String;
private var _mapWidth:int;
private var _mapHeight:int;
private var cursor;
public var turetSetCoord:Point;
public var selectedTurret;
private var radius:MovieClip;
public var turetSet:String;
private var _mapArray:Array;
private var _tileArray:Array;
private var currentTile:Point;
private var _tileTestArray:Array;
public static var map_heigth = 38;
public static var map_width = 40;
public function Map(){
turetSet = new String("none");
turetSetType = new String("none");
turetSetCoord = new Point(0, 0);
currentTile = new Point(0, 0);
super();
this.addChild(new mc_map());
_mapArray = new Array();
_tileArray = new Array();
_tileTestArray = new Array();
handleComplete();
this.addEventListener(MouseEvent.ROLL_OUT, onMouseOut);
this.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
this.addEventListener(MouseEvent.CLICK, onMouseClick);
}
public function addBonus(_arg1:Bonus){
var _local2:Boolean;
var _local3:Array;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Number;
_local2 = true;
_local3 = new Array();
_local6 = 0;
_local7 = Math.random();
if (_local7 < 0.5){
_local3 = Utilites.pathFind(_tileTestArray, 9, 9, 32, 28);
} else {
_local3 = Utilites.pathFind(_tileTestArray, 32, 9, 9, 28);
};
if (_local3.length < 2){
_local7 = Math.random();
if (_local7 < 0.5){
_local3 = Utilites.pathFind(_tileTestArray, 19, 1, 19, 34);
} else {
_local3 = Utilites.pathFind(_tileTestArray, 1, 18, (Map.map_width - 1), 18);
};
};
if (_local3.length >= 3){
_local3.shift();
_local3.pop();
};
_local7 = (Math.random() * ((_local3.length / 2) - 2));
_local4 = _local3[Math.round(((_local3.length / 2) + _local7))].x;
_local5 = _local3[Math.round(((_local3.length / 2) + _local7))].y;
tileArray[_local5][_local4].addBonus(_arg1);
}
private function onMouseMove(_arg1:MouseEvent){
var _local2:Point;
_local2 = new Point(Math.floor((mouseX / 14)), Math.floor((mouseY / 14)));
if (((!((_local2.x == currentTile.x))) || (!((_local2.y == currentTile.y))))){
currentTile = _local2;
if ((((((((currentTile.y > 3)) && ((currentTile.y < 32)))) && ((currentTile.x > 3)))) && ((currentTile.x < 37)))){
if (mapArray[currentTile.y] != undefined){
if (mapArray[currentTile.y][currentTile.x] != undefined){
onTileMouseOver(currentTile);
};
};
};
};
}
public function addPepper(_arg1:Point){
var _local2:MovieClip;
_local2 = new mcPepperHit();
_local2.addEventListener(Event.ENTER_FRAME, onPepperEnterFrame);
this.addChild(_local2);
_local2.x = ((_arg1.x * 14) + 7);
_local2.y = ((_arg1.y * 14) + 7);
_local2.gotoAndPlay(1);
}
public function addTurretPoint(_arg1, _arg2, _arg3){
this._tileArray[_arg2][_arg3].addTurret(_arg1);
}
private function onMouseClick(_arg1:MouseEvent){
var _local2:Point;
_local2 = new Point(Math.floor((mouseX / 14)), Math.floor((mouseY / 14)));
currentTile = _local2;
if (mapArray[currentTile.y] != undefined){
if (mapArray[currentTile.y][currentTile.x] != undefined){
onTileMouseClick(currentTile);
};
};
}
private function onPepperEnterFrame(_arg1:Event){
var _local2:MovieClip;
_local2 = (_arg1.target as MovieClip);
if (_local2.currentFrame == _local2.totalFrames){
_local2.removeEventListener(Event.ENTER_FRAME, onPepperEnterFrame);
this.removeChild(_local2);
};
}
public function showMap():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < this.mapArray.length) {
_tileArray[_local1] = new Array();
_tileTestArray[_local1] = new Array();
_local2 = 0;
while (_local2 < this.mapArray[_local1].length) {
if (this.mapArray[_local1][_local2] == "0"){
_tileArray[_local1][_local2] = new Tile(false, false, tileSize, tileSize);
_tileTestArray[_local1][_local2] = new Tile(false, false, tileSize, tileSize);
} else {
if (this.mapArray[_local1][_local2] == "1"){
_tileArray[_local1][_local2] = new Tile(true, true, tileSize, tileSize);
_tileTestArray[_local1][_local2] = new Tile(true, true, tileSize, tileSize);
} else {
_tileArray[_local1][_local2] = new Tile(true, false, tileSize, tileSize);
_tileTestArray[_local1][_local2] = new Tile(true, false, tileSize, tileSize);
this._mapArray[_local1][_local2] = 1;
};
};
_tileArray[_local1][_local2].x = (tileSize * _local2);
_tileArray[_local1][_local2].y = (tileSize * _local1);
_tileArray[_local1][_local2].cord = new Point(_local2, _local1);
_local2++;
};
_local1++;
};
}
private function testTurret():Boolean{
return (true);
}
public function get tileArray():Array{
return (_tileArray);
}
public function removeTuretSet(){
if (((!((turetSet == "none"))) && (!((cursor == undefined))))){
Main.self.mc_gui[(("mc_" + turetSetType) + "_button")].gotoAndStop(String((turetSetType + " N")));
this.removeChild(radius);
this.removeChild(cursor);
this.cursor = null;
this.turetSet = "none";
};
}
public function addSetTurret(){
radius = new McRadiusCircle();
switch (this.turetSet){
case "honey":
cursor = new McHoney();
radius.scaleX = (radius.scaleY = XMLData.self.getTurretLevel("honey", 1).range);
break;
case "mustard":
cursor = new McMustard();
radius.scaleX = (radius.scaleY = XMLData.self.getTurretLevel("mustard", 1).range);
break;
case "ketchup":
cursor = new McKetchup();
radius.scaleX = (radius.scaleY = XMLData.self.getTurretLevel("ketchup", 1).range);
break;
case "pepper":
cursor = new McPepper();
radius.scaleX = (radius.scaleY = XMLData.self.getTurretLevel("pepper", 1).range);
break;
case "sugar":
cursor = new McSugar();
radius.scaleX = (radius.scaleY = XMLData.self.getTurretLevel("sugar", 1).range);
break;
case "toothpick":
cursor = new McToothpick();
radius.scaleX = (radius.scaleY = XMLData.self.getTurretLevel("toothpick", 1).range);
break;
};
cursor.loader.visible = false;
cursor.mc_update.gotoAndStop(1);
cursor.tur_graph.mc_attack.gotoAndStop(1);
cursor.tur_graph.mc_destr.gotoAndStop(1);
cursor.tur_graph.gotoAndStop(1);
cursor.mc_sugar_effect.visible = false;
this.addChildAt(cursor, 0);
this.addChildAt(radius, 0);
cursor.visible = false;
radius.visible = false;
this.turetSet = "active";
}
public function get mapArray():Array{
return (_mapArray);
}
private function onMouseOut(_arg1:Event){
if (cursor != null){
cursor.visible = false;
radius.visible = false;
};
}
private function onTileMouseOver(_arg1:Point){
var _local2:String;
var _local3:int;
var _local4:int;
var _local5:Array;
var _local6:Array;
var _local7:Array;
var _local8:Array;
var _local9:Boolean;
var _local10:String;
_local3 = _arg1.x;
_local4 = _arg1.y;
_local5 = new Array();
_local6 = new Array();
_local7 = new Array();
_local8 = new Array();
_local9 = true;
if (this.turetSet == "none"){
return;
};
_local10 = new String();
if (cursor == null){
radius = new McRadiusCircle();
switch (this.turetSet){
case "honey":
cursor = new McHoney();
radius.scaleX = 3;
radius.scaleY = 3;
break;
case "mustard":
cursor = new McMustard();
radius.scaleX = 3;
radius.scaleY = 3;
break;
case "ketchup":
cursor = new McKetchup();
radius.scaleX = 4;
radius.scaleY = 4;
break;
case "pepper":
cursor = new McPepper();
radius.scaleX = 3;
radius.scaleY = 3;
break;
case "sugar":
cursor = new McSugar();
radius.scaleX = 2;
radius.scaleY = 2;
break;
case "toothpick":
cursor = new McToothpick();
radius.scaleX = 6;
radius.scaleY = 6;
break;
};
this.addChildAt(cursor, 0);
this.addChildAt(radius, 0);
this.turetSet = "active";
cursor.x = ((tileSize * _local3) + (cursor.tur_graph.width / 2));
cursor.y = ((tileSize * _local4) + (cursor.tur_graph.height / 2));
radius.x = ((tileSize * _local3) + (cursor.tur_graph.width / 2));
radius.y = ((tileSize * _local4) + (cursor.tur_graph.height / 2));
for (_local2 in Main.self.monArray) {
if (cursor.hitTestObject(Main.self.monArray[_local2])){
cursor.gotoAndStop((turetSetType + "_No"));
return;
};
};
if ((((((((_tileArray[_local4][_local3].buildable == false)) || ((_tileArray[(_local4 + 1)][_local3].buildable == false)))) || ((_tileArray[_local4][(_local3 + 1)].buildable == false)))) || ((_tileArray[(_local4 + 1)][(_local3 + 1)].buildable == false)))){
cursor.gotoAndStop((turetSetType + "_No"));
return;
};
if ((((((((_tileArray[_local4][_local3].bonusAdded == false)) && ((_tileArray[(_local4 + 1)][_local3].bonusAdded == false)))) && ((_tileArray[_local4][(_local3 + 1)].bonusAdded == false)))) && ((_tileArray[(_local4 + 1)][(_local3 + 1)].bonusAdded == false)))){
cursor.gotoAndStop((turetSetType + "_Yes"));
return;
};
cursor.gotoAndStop((turetSetType + "_No"));
return;
} else {
cursor.visible = true;
radius.visible = true;
cursor.x = ((tileSize * _local3) + (cursor.tur_graph.width / 2));
cursor.y = ((tileSize * _local4) + (cursor.tur_graph.height / 2));
radius.x = ((tileSize * _local3) + (cursor.tur_graph.width / 2));
radius.y = ((tileSize * _local4) + (cursor.tur_graph.height / 2));
};
for (_local2 in Main.self.monArray) {
if (cursor.hitTestObject(Main.self.monArray[_local2])){
cursor.gotoAndStop((turetSetType + "_No"));
return;
};
};
if ((((((((_tileArray[_local4][_local3].buildable == false)) || ((_tileArray[(_local4 + 1)][_local3].buildable == false)))) || ((_tileArray[_local4][(_local3 + 1)].buildable == false)))) || ((_tileArray[(_local4 + 1)][(_local3 + 1)].buildable == false)))){
cursor.gotoAndStop((turetSetType + "_No"));
return;
};
if ((((((((_tileArray[_local4][_local3].bonusAdded == false)) && ((_tileArray[(_local4 + 1)][_local3].bonusAdded == false)))) && ((_tileArray[_local4][(_local3 + 1)].bonusAdded == false)))) && ((_tileArray[(_local4 + 1)][(_local3 + 1)].bonusAdded == false)))){
cursor.gotoAndStop((turetSetType + "_Yes"));
return;
};
cursor.gotoAndStop((turetSetType + "_No"));
}
public function handleComplete():void{
var xmlMap:XML;
try {
xmlMap = <data>
<map width="30" height="26">
<row>0000000000000000222222220000000000000000</row>
<row>0000000000000000222222220000000000000000</row>
<row>0000000000000000222222220000000000000000</row>
<row>0000000000000000222222220000000000000000</row>
<row>0000000000000000222222220000000000000000</row>
<row>0000000000000000222222220000000000000000</row>//1
<row>0000000000000000222222220000000000000000</row>
<row>0000000111111111111111111111111110000000</row>
<row>0000000111111111111111111111111110000000</row>
<row>0000000111111111111111111111111110000000</row>
<row>0000000111111111111111111111111110000000</row>
<row>0000000111111111111111111111111110000000</row>
<row>0000000111111111111111111111111110000000</row>
<row>0000000111111111111111111111111110000000</row>
<row>0000000111111111111111111111111110000000</row>
<row>2222222111111111111111111111111112222222</row>//16
<row>2222222111111111111111111111111112222222</row>
<row>2222222111111111111111111111111112222222</row>
<row>2222222111111111111111111111111112222222</row>
<row>2222222111111111111111111111111112222222</row>
<row>2222222111111111111111111111111112222222</row>
<row>0000000111111111111111111111111110000000</row>
<row>0000000111111111111111111111111110000000</row>
<row>0000000111111111111111111111111110000000</row>
<row>0000000111111111111111111111111110000000</row>
<row>0000000111111111111111111111111110000000</row>
<row>0000000111111111111111111111111110000000</row>
<row>0000000111111111111111111111111110000000</row>
<row>0000000111111111111111111111111110000000</row>
<row>0000000000000000222222220000000000000000</row>
<row>0000000000000000222222220000000000000000</row>
<row>0000000000000000222222220000000000000000</row>
<row>0000000000000000222222220000000000000000</row>
<row>0000000000000000222222220000000000000000</row>
<row>0000000000000000222222220000000000000000</row>
<row>0000000000000000222222220000000000000000</row>
<row>0000000000000000222222220000000000000000</row>
<row>0000000000000000222222220000000000000000</row>
</map>
</data>
;
generateMap(xmlMap);
} catch(e:TypeError) {
};
}
private function generateMap(_arg1:XML):void{
var _local2:XML;
var _local3:Event;
var _local4:int;
_mapWidth = _arg1.elements().@width;
_mapHeight = _arg1.elements().@height;
for each (_local2 in _arg1.elements().elements()) {
_mapArray.push(new Array());
_local4 = 0;
while (_local4 < _local2.toString().length) {
_mapArray[(_mapArray.length - 1)][_local4] = _local2.toString().split("")[_local4];
_local4++;
};
};
_local3 = new Event("mapLoaded");
dispatchEvent(_local3);
}
public function removeTurretPoint(_arg1, _arg2, _arg3){
this._tileArray[_arg2][_arg3].removeTurret(_arg1);
}
public function removeTurret(_arg1:Point){
var _local2:int;
var _local3:int;
_local2 = _arg1.x;
_local3 = _arg1.y;
_tileTestArray[_local3][_local2].walkable = true;
_tileTestArray[(_local3 + 1)][_local2].walkable = true;
_tileTestArray[_local3][(_local2 + 1)].walkable = true;
_tileTestArray[(_local3 + 1)][(_local2 + 1)].walkable = true;
_tileArray[_local3][_local2].walkable = true;
_tileArray[(_local3 + 1)][_local2].walkable = true;
_tileArray[_local3][(_local2 + 1)].walkable = true;
_tileArray[(_local3 + 1)][(_local2 + 1)].walkable = true;
_tileTestArray[_local3][_local2].buildable = true;
_tileTestArray[(_local3 + 1)][_local2].buildable = true;
_tileTestArray[_local3][(_local2 + 1)].buildable = true;
_tileTestArray[(_local3 + 1)][(_local2 + 1)].buildable = true;
_tileArray[_local3][_local2].buildable = true;
_tileArray[(_local3 + 1)][_local2].buildable = true;
_tileArray[_local3][(_local2 + 1)].buildable = true;
_tileArray[(_local3 + 1)][(_local2 + 1)].buildable = true;
_tileArray[_local3][_local2]._turret = null;
_tileArray[(_local3 + 1)][_local2]._turret = null;
_tileArray[_local3][(_local2 + 1)]._turret = null;
_tileArray[(_local3 + 1)][(_local2 + 1)]._turret = null;
}
public function get mapHeight():int{
return (_mapHeight);
}
public function get mapWidth():int{
return (_mapWidth);
}
public function clearMap():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < _tileArray.length) {
_local2 = 0;
while (_local2 < tileArray[_local1].length) {
delete tileArray[_local1][_local2];
_local2++;
};
_local1++;
};
_mapArray = new Array();
}
public function setTurret(_arg1:Point, _arg2):void{
var _local3:int;
var _local4:int;
_local3 = _arg1.x;
_local4 = _arg1.y;
_tileTestArray[_local4][_local3].walkable = false;
_tileTestArray[(_local4 + 1)][_local3].walkable = false;
_tileTestArray[_local4][(_local3 + 1)].walkable = false;
_tileTestArray[(_local4 + 1)][(_local3 + 1)].walkable = false;
_tileArray[_local4][_local3].walkable = false;
_tileArray[(_local4 + 1)][_local3].walkable = false;
_tileArray[_local4][(_local3 + 1)].walkable = false;
_tileArray[(_local4 + 1)][(_local3 + 1)].walkable = false;
_tileTestArray[_local4][_local3].buildable = false;
_tileTestArray[(_local4 + 1)][_local3].buildable = false;
_tileTestArray[_local4][(_local3 + 1)].buildable = false;
_tileTestArray[(_local4 + 1)][(_local3 + 1)].buildable = false;
_tileArray[_local4][_local3].buildable = false;
_tileArray[(_local4 + 1)][_local3].buildable = false;
_tileArray[_local4][(_local3 + 1)].buildable = false;
_tileArray[(_local4 + 1)][(_local3 + 1)].buildable = false;
_tileArray[_local4][_local3]._turret = _arg2;
_tileArray[(_local4 + 1)][_local3]._turret = _arg2;
_tileArray[_local4][(_local3 + 1)]._turret = _arg2;
_tileArray[(_local4 + 1)][(_local3 + 1)]._turret = _arg2;
}
private function onTileMouseClick(_arg1:Point){
var _local2:String;
var _local3:int;
var _local4:int;
var _local5:Array;
var _local6:Array;
var _local7:Array;
var _local8:Array;
var _local9:Boolean;
if (tileArray[_arg1.y][_arg1.x]._turret != null){
this.removeTuretSet();
Main.self.onTurretDeselect(new Event(""));
this.selectedTurret = tileArray[_arg1.y][_arg1.x]._turret;
this.dispatchEvent(new Event("onTurretSelect"));
};
if (((!((turetSet == "none"))) && (!((cursor == undefined))))){
for (_local2 in Main.self.monArray) {
if (cursor.hitTestObject(Main.self.monArray[_local2])){
cursor.gotoAndStop((turetSetType + "_No"));
return;
};
};
_local3 = _arg1.x;
_local4 = _arg1.y;
_local5 = new Array();
_local6 = new Array();
_local7 = new Array();
_local8 = new Array();
_local9 = true;
if ((((((((_tileArray[_local4][_local3].buildable == false)) || ((_tileArray[(_local4 + 1)][_local3].buildable == false)))) || ((_tileArray[_local4][(_local3 + 1)].buildable == false)))) || ((_tileArray[(_local4 + 1)][(_local3 + 1)].buildable == false)))){
trace("No");
} else {
if ((((((((_tileArray[_local4][_local3].bonusAdded == false)) && ((_tileArray[(_local4 + 1)][_local3].bonusAdded == false)))) && ((_tileArray[_local4][(_local3 + 1)].bonusAdded == false)))) && ((_tileArray[(_local4 + 1)][(_local3 + 1)].bonusAdded == false)))){
_tileTestArray[_local4][_local3].walkable = false;
_tileTestArray[(_local4 + 1)][_local3].walkable = false;
_tileTestArray[_local4][(_local3 + 1)].walkable = false;
_tileTestArray[(_local4 + 1)][(_local3 + 1)].walkable = false;
_local5 = Utilites.pathFind(_tileTestArray, 17, 2, 17, 33);
_local6 = Utilites.pathFind(_tileTestArray, 1, 16, (Map.map_width - 1), 16);
if (Main._bonus != null){
_local7 = Utilites.pathFind(_tileTestArray, 18, 1, Main._bonus.tile.cord.x, Main._bonus.tile.cord.y);
_local8 = Utilites.pathFind(_tileTestArray, 1, 16, Main._bonus.tile.cord.x, Main._bonus.tile.cord.y);
if ((((_local7.length == 0)) || ((_local8.length == 0)))){
_local9 = false;
} else {
_local9 = true;
};
} else {
_local9 = true;
};
_tileTestArray[_local4][_local3].walkable = true;
_tileTestArray[(_local4 + 1)][_local3].walkable = true;
_tileTestArray[_local4][(_local3 + 1)].walkable = true;
_tileTestArray[(_local4 + 1)][(_local3 + 1)].walkable = true;
if ((((((_local5.length == 0)) || ((_local6.length == 0)))) || ((_local9 == false)))){
trace("No");
} else {
this.turetSetCoord = new Point(_local3, _local4);
this.dispatchEvent(new Event("onTuretSet"));
};
};
};
};
if (tileArray[_arg1.y][_arg1.x]._turret == null){
if (this.selectedTurret != undefined){
Main.self.onTurretDeselect(new Event(""));
};
};
}
}
}//package com.xitexsoftware.gamepack
Section 24
//McGui (com.xitexsoftware.gamepack.McGui)
package com.xitexsoftware.gamepack {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
public class McGui extends MovieClip {
public var time_txt:TextField;
public var mc_pause:MovieClip;
public var mc_toothpick_button_but:SimpleButton;
public var mc_sugar_button_but:SimpleButton;
private var _buttonClicSound:ButtonClicSound;
public var mc_guiTowers:MovieClip;
public var mc_offline:MovieClip;
private var tmpMovie:MovieClip;
public var mc_sugar_button:McSugar;
public var mc_start:MovieClip;
private var types:Array;
public var pause_btn:SimpleButton;
public var mc_mygame_but:MovieClip;
public var coins_txt:TextField;
public var mc_end:MovieClip;
public var mc_honey_button:McHoney;
public var mc_toothpick_button:McToothpick;
private var _soundChannel:SoundChannel;
public var mc_mustard_button_but:SimpleButton;
public var mc_honey_button_but:SimpleButton;
public var mc_pepper_button:McPepper;
public var start_btn:SimpleButton;
public var mc_mustard_button:McMustard;
public var lives_txt:TextField;
public var score_txt:TextField;
public var progresTrurret;
public var menu_btn:SimpleButton;
public var mc_ketchup_button_but:SimpleButton;
private var _upgradeUnitSound:UpgradeUnitSound;
private var _introSound:PicnicIntroSound;
public var mc_ketchup_button:McKetchup;
public var mc_pepper_button_but:SimpleButton;
private var _bgLevelSound:PicnicLoopSound;
public var mcHelp:MovieClip;
public function McGui(){
var _local1:*;
types = ["mustard", "honey", "pepper", "sugar", "ketchup", "toothpick"];
super();
addFrameScript(0, frame1);
this._introSound = new PicnicIntroSound();
this._bgLevelSound = new PicnicLoopSound();
this._upgradeUnitSound = new UpgradeUnitSound();
_buttonClicSound = new ButtonClicSound();
_soundChannel = new SoundChannel();
trace(this);
this.mc_offline.visible = false;
this.mc_pause.visible = false;
mc_mustard_button.gotoAndStop(1);
mc_ketchup_button.gotoAndStop(1);
mc_honey_button.gotoAndStop(1);
mc_pepper_button.gotoAndStop(1);
mc_toothpick_button.gotoAndStop(1);
mc_sugar_button.gotoAndStop(1);
mc_guiTowers.visible = false;
mc_end.visible = false;
mc_end.mc_end.visible = false;
mc_end.mcEndOver.visible = false;
mc_start.visible = true;
mc_honey_button.useHandCursor = true;
mc_mustard_button.useHandCursor = true;
mc_ketchup_button.useHandCursor = true;
mc_pepper_button.useHandCursor = true;
mc_toothpick_button.useHandCursor = true;
mc_sugar_button.useHandCursor = true;
mc_ketchup_button.mc_sugar_effect.visible = false;
mc_mustard_button.mc_sugar_effect.visible = false;
mc_honey_button.mc_sugar_effect.visible = false;
mc_pepper_button.mc_sugar_effect.visible = false;
mc_toothpick_button.mc_sugar_effect.visible = false;
mc_sugar_button.mc_sugar_effect.visible = false;
mcHelp.visible = false;
mc_sugar_button.loader.visible = false;
mc_ketchup_button.loader.visible = false;
mc_mustard_button.loader.visible = false;
mc_honey_button.loader.visible = false;
mc_pepper_button.loader.visible = false;
mc_toothpick_button.loader.visible = false;
menuHide(true);
this.mc_mygame_but.addEventListener(MouseEvent.CLICK, onMyGameButtonClick);
this.mc_offline.mygame_but.addEventListener(MouseEvent.CLICK, onMyGameOfflineButtonClick);
mc_start.add_website_but.addEventListener(MouseEvent.CLICK, onAddWebsiteButtonClick);
mc_start.more_games_but.addEventListener(MouseEvent.CLICK, onMoreGamesButtonClick);
mc_start.top_scores_but.addEventListener(MouseEvent.CLICK, onTopScoresButtonClick);
mc_honey_button_but.addEventListener(MouseEvent.CLICK, onHoneyButtonClick);
mc_mustard_button_but.addEventListener(MouseEvent.CLICK, onMustardButtonClick);
mc_ketchup_button_but.addEventListener(MouseEvent.CLICK, onKetchupButtonClick);
mc_pepper_button_but.addEventListener(MouseEvent.CLICK, onPepperButtonClick);
mc_toothpick_button_but.addEventListener(MouseEvent.CLICK, onToothpickButtonClick);
mc_sugar_button_but.addEventListener(MouseEvent.CLICK, onSugarButtonClick);
mc_start.norm_but.addEventListener(MouseEvent.CLICK, Main.startGame);
mc_start.hard_but.addEventListener(MouseEvent.CLICK, Main.startHardGame);
mcHelp.bBack.addEventListener(MouseEvent.CLICK, this.closeHelp);
mc_start.bInstruction.addEventListener(MouseEvent.CLICK, this.openHelp);
this.mc_guiTowers.close_btn.addEventListener(MouseEvent.CLICK, onCloseTurreGui);
this.mc_end.mc_end.new_game_btn.addEventListener(MouseEvent.CLICK, onReplayGame);
this.mc_end.mcEndOver.new_game_btn.addEventListener(MouseEvent.CLICK, onReplayGame);
this.mc_end.mcEndOver.submit_score_but.addEventListener(MouseEvent.CLICK, onSubmitScore);
this.mc_end.mc_end.submit_score_but.addEventListener(MouseEvent.CLICK, onSubmitEndScore);
_local1 = 0;
while (_local1 < types.length) {
this.mc_guiTowers[(types[_local1] + "UpgMenu")].remove_btn.addEventListener(MouseEvent.CLICK, onRemoveTurretBtn);
this.mc_guiTowers[(types[_local1] + "UpgMenu")].upg_btn.addEventListener(MouseEvent.CLICK, onUpgBtn);
_local1++;
};
}
private function updateProgress(_arg1:Event){
mc_guiTowers.mc_sell.loader.gotoAndStop(_arg1.target.sellingTick);
}
private function onTopScoresButtonClick(_arg1:MouseEvent){
var _local2:URLVariables;
var _local3:URLRequest;
_local2 = new URLVariables();
_local2.game = "PicnicBasketDefense";
_local2.from = root.loaderInfo.url;
_local2.typ = "highscores";
_local2.redirect = "/game/picnicbasketdefense/highscores";
_local3 = new URLRequest("http://www.mygame.com/bounce.jsp");
_local3.data = _local2;
navigateToURL(_local3, "_blank");
}
private function onKetchupButtonClick(_arg1:Event){
this._buttonClicSound.play();
showTurretBuy("ketchup");
this.dispatchEvent(new Event("onKetchupButtonClick"));
}
private function onSugarButtonClick(_arg1:Event){
this._buttonClicSound.play();
showTurretBuy("sugar");
this.dispatchEvent(new Event("onSugarButtonClick"));
}
private function onUpgBtn(_arg1:Event){
if (Main.self._map.selectedTurret.level < Main.self._map.selectedTurret.levels.length){
if (Main.self.getMoney()){
this._upgradeUnitSound.play();
mc_guiTowers.mc_sell.visible = true;
Main.self._map.selectedTurret.upgrade();
showTurretProgress(Main.self._map.selectedTurret, "Upgrading");
};
};
}
private function onSubmitEndScore(_arg1:MouseEvent){
var _local2:URLRequest;
var _local3:URLLoader;
_local2 = new URLRequest((((("http://www.mygame.com/servlet/WebGameServlet?action=gameover&&url=picnicbasketdefense&points=" + this.mc_end.mc_end.tot_score.text) + "&username=") + this.mc_end.mc_end.name_txt.text) + "&"));
_local3 = new URLLoader();
_local3.load(_local2);
Main.self.onMenuBtnClick(new Event(""));
}
function frame1(){
stop();
}
private function openHelp(_arg1:Event){
this.mcHelp.visible = true;
}
public function onMyGameButtonClick(_arg1:MouseEvent){
var _local2:URLVariables;
var _local3:URLRequest;
_local2 = new URLVariables();
_local2.game = "PicnicBasketDefense";
_local2.from = root.loaderInfo.url;
_local2.typ = "sign";
_local3 = new URLRequest("http://www.mygame.com/bounce.jsp");
_local3.data = _local2;
navigateToURL(_local3, "_blank");
}
public function removeTurretProgress(_arg1, _arg2:Boolean=true){
if (_arg1 != null){
_arg1.removeEventListener("onProgressTick", updateProgress);
if (_arg1 == Main.self._map.selectedTurret){
if (_arg2){
mc_guiTowers.visible = false;
mc_guiTowers.mc_sell.visible = false;
} else {
mc_guiTowers.mc_sell.visible = false;
};
};
progresTrurret = null;
};
}
public function onMyGameOfflineButtonClick(_arg1:MouseEvent){
var _local2:URLVariables;
var _local3:URLRequest;
_local2 = new URLVariables();
_local2.game = "PicnicBasketDefense";
_local2.from = root.loaderInfo.url;
_local2.typ = "protect";
_local2.redirect = "/game/picnicbasketdefense";
_local3 = new URLRequest("http://www.mygame.com/bounce.jsp");
_local3.data = _local2;
navigateToURL(_local3, "_blank");
}
public function showTurretBuy(_arg1:String){
var _local2:*;
var _local3:Object;
mc_guiTowers.visible = true;
mc_guiTowers.mc_sell.visible = false;
_local2 = 0;
while (_local2 < types.length) {
mc_guiTowers[(types[_local2] + "UpgMenu")].visible = false;
mc_guiTowers[(types[_local2] + "BuyMenu")].visible = false;
_local2++;
};
mc_guiTowers[(_arg1 + "BuyMenu")].visible = true;
_local3 = XMLData.self.getTurretLevel(_arg1, 1);
mc_guiTowers[(_arg1 + "BuyMenu")].turret_cost.text = _local3.cost;
mc_guiTowers[(_arg1 + "BuyMenu")].turret_dmg.text = _local3.damage;
mc_guiTowers[(_arg1 + "BuyMenu")].turret_rate.text = _local3.rate;
mc_guiTowers[(_arg1 + "BuyMenu")].turret_range.text = _local3.range;
mc_guiTowers[(_arg1 + "BuyMenu")].turret_defense.text = _local3.defense;
}
public function menuShow(){
this._soundChannel.stop();
this._soundChannel = this._bgLevelSound.play(0, 10000);
mc_guiTowers.mc_repair.visible = false;
mc_guiTowers.mc_sell.visible = false;
menu_btn.visible = true;
pause_btn.visible = true;
start_btn.visible = true;
}
private function onCloseTurreGui(_arg1:Event){
mc_guiTowers.visible = false;
this.dispatchEvent(new Event("onTurretDeselect"));
}
private function onHoneyButtonClick(_arg1:Event){
this._buttonClicSound.play();
showTurretBuy("honey");
this.dispatchEvent(new Event("onHoneyButtonClick"));
}
public function menuHide(_arg1:Boolean){
if (_arg1){
this._soundChannel = this._introSound.play(0, 10000);
} else {
this._soundChannel.stop();
};
mc_guiTowers.mc_repair.visible = false;
mc_guiTowers.mc_sell.visible = false;
menu_btn.visible = false;
pause_btn.visible = false;
start_btn.visible = false;
}
private function onRemoveTurretBtn(_arg1:Event){
if ((((Main.self._map.selectedTurret.destroyed == false)) && ((Main.self._map.selectedTurret.selling == false)))){
mc_guiTowers.mc_sell.visible = true;
Main.self._map.selectedTurret.sell(Main.self.sellTime);
Main.self.sellTime = (Main.self.sellTime + 2);
showTurretProgress(Main.self._map.selectedTurret);
};
}
private function onToothpickButtonClick(_arg1:Event){
this._buttonClicSound.play();
showTurretBuy("toothpick");
this.dispatchEvent(new Event("onToothpickButtonClick"));
}
private function onPeperButtonClick(_arg1:Event){
this._buttonClicSound.play();
showTurretBuy("peper");
this.dispatchEvent(new Event("onPeperButtonClick"));
}
private function closeHelp(_arg1:Event){
this.mcHelp.visible = false;
}
public function showTurretProgress(_arg1, _arg2:String="Sell item"){
mc_guiTowers.visible = true;
mc_guiTowers.mc_sell.visible = true;
mc_guiTowers.mc_sell.loader.gotoAndStop(1);
mc_guiTowers.mc_sell.sell_txt.text = _arg2;
progresTrurret = _arg1;
progresTrurret.addEventListener("onProgressTick", updateProgress);
}
public function showTurretUpg(_arg1:String){
var _local2:*;
this._buttonClicSound.play();
mc_guiTowers.visible = true;
mc_guiTowers.mc_sell.visible = false;
_local2 = 0;
while (_local2 < types.length) {
mc_guiTowers[(types[_local2] + "UpgMenu")].visible = false;
mc_guiTowers[(types[_local2] + "BuyMenu")].visible = false;
_local2++;
};
mc_guiTowers[(_arg1 + "UpgMenu")].visible = true;
}
private function onMustardButtonClick(_arg1:Event){
this._buttonClicSound.play();
showTurretBuy("mustard");
this.dispatchEvent(new Event("onMustardButtonClick"));
}
private function onAddWebsiteButtonClick(_arg1:MouseEvent){
var _local2:URLVariables;
var _local3:URLRequest;
_local2 = new URLVariables();
_local2.game = "PicnicBasketDefense";
_local2.from = root.loaderInfo.url;
_local2.typ = "add_game";
_local2.redirect = "/freecontent.jsp";
_local3 = new URLRequest("http://www.mygame.com/bounce.jsp");
_local3.data = _local2;
navigateToURL(_local3, "_blank");
}
private function onReplayGame(_arg1:Event){
mc_end.visible = false;
mc_end.mc_end.visible = false;
mc_end.mcEndOver.visible = false;
this.dispatchEvent(new Event("onReplayGame"));
}
private function onPepperButtonClick(_arg1:Event){
this._buttonClicSound.play();
showTurretBuy("pepper");
this.dispatchEvent(new Event("onPepperButtonClick"));
}
private function onMoreGamesButtonClick(_arg1:MouseEvent){
var _local2:URLVariables;
var _local3:URLRequest;
_local2 = new URLVariables();
_local2.game = "PicnicBasketDefense";
_local2.from = root.loaderInfo.url;
_local2.typ = "other_games";
_local3 = new URLRequest("http://www.mygame.com/bounce.jsp");
_local3.data = _local2;
navigateToURL(_local3, "_blank");
}
private function onSubmitScore(_arg1:MouseEvent){
var _local2:URLRequest;
var _local3:URLLoader;
_local2 = new URLRequest((((("http://www.mygame.com/servlet/WebGameServlet?action=gameover&&url=picnicbasketdefense&points=" + this.mc_end.mcEndOver.total_score.text) + "&username=") + this.mc_end.mcEndOver.name_txt.text) + "&"));
_local3 = new URLLoader();
_local3.load(_local2);
Main.self.onMenuBtnClick(new Event(""));
}
}
}//package com.xitexsoftware.gamepack
Section 25
//Shoot (com.xitexsoftware.gamepack.Shoot)
package com.xitexsoftware.gamepack {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class Shoot extends MovieClip {
private var _monArray:Array;
private var _type:int;
private var startPoint:Point;
private var graph:MovieClip;
private var tx:int;
private var _killMonsterSounds:Array;
private var target;
private var _damage:Number;
private var ty:int;
private var _radius:int;
public var bulName:String;
private var myTimer:Timer;
public static const TYPE_KETCHUP:int = 2;
public static const TYPE_HONEY:int = 3;
public static const TYPE_PEPER:int = 4;
public static const TYPE_MUSTARD:int = 1;
public function Shoot(_arg1, _arg2, _arg3:Array, _arg4:Number, _arg5:int, _arg6:int){
bulName = _arg2;
this._killMonsterSounds = new Array();
this._killMonsterSounds[0] = new Kill1MonsterSound();
this._killMonsterSounds[1] = new Kill2MonsterSound();
this._killMonsterSounds[2] = new Kill3MonsterSound();
this._killMonsterSounds[3] = new Kill4MonsterSound();
this._killMonsterSounds[4] = new Kill5MonsterSound();
this._killMonsterSounds[5] = new Kill6MonsterSound();
this._killMonsterSounds[6] = new Kill7MonsterSound();
this._killMonsterSounds[7] = new Kill8MonsterSound();
this._killMonsterSounds[8] = new Kill9MonsterSound();
this._killMonsterSounds[9] = new Kill10MonsterSound();
this._killMonsterSounds[10] = new Kill11MonsterSound();
this._killMonsterSounds[11] = new Kill12MonsterSound();
this._killMonsterSounds[12] = new Kill13MonsterSound();
this._killMonsterSounds[13] = new Kill14MonsterSound();
this._killMonsterSounds[14] = new Kill15MonsterSound();
this._killMonsterSounds[15] = new Kill16MonsterSound();
this._killMonsterSounds[16] = new Kill17MonsterSound();
this._killMonsterSounds[17] = new Kill18MonsterSound();
this._killMonsterSounds[18] = new Kill19MonsterSound();
this._killMonsterSounds[19] = new Kill20MonsterSound();
this._killMonsterSounds[20] = new Kill21MonsterSound();
this._killMonsterSounds[21] = new Kill22MonsterSound();
switch (_arg6){
case 1:
this.graph = new McMustardShoot();
break;
case 2:
this.graph = new McKetchupShoot();
break;
case 3:
this.graph = new McHoneyShoot();
break;
case 4:
this.graph = new McPepperShoot();
break;
};
this.addChild(graph);
this._type = _arg6;
_radius = _arg5;
target = _arg1;
_monArray = _arg3;
_damage = _arg4;
}
private function onEnterGraphFrame(_arg1:Event){
if (_arg1.target.currentLabel == "stop"){
Main.destroyBulet(this);
};
}
public function init(){
var _local1:Point;
var _local2:*;
this.rotation = Utilites.returnAngelBetwenPoints(new Point(this.x, this.y), new Point(target.x, target.y));
_local1 = new Point(this.x, this.y);
_local2 = new Point(target.x, target.y);
this.ty = -(Point.polar(10, ((this.rotation * Math.PI) / 180)).x);
this.tx = Point.polar(10, ((this.rotation * Math.PI) / 180)).y;
this.graph.gotoAndPlay("shoot");
startPoint = new Point(this.x, this.y);
this.myTimer = new Timer(40, 500);
this.myTimer.addEventListener("timer", move);
myTimer.start();
}
private function playRandomSound(_arg1:Boolean):void{
var _local2:uint;
if (!_arg1){
_local2 = Math.round((Math.random() * 15));
} else {
_local2 = (Math.round((Math.random() * (22 - 16))) + 15);
};
this._killMonsterSounds[_local2].play();
}
public function start(){
this.myTimer.start();
}
private function damage(){
if (target.monsterVis == true){
switch (_type){
case 1:
target.health = (target.health - this._damage);
if (target.health <= 0){
this.playRandomSound(target.boses);
target.kill();
this.myTimer.stop();
} else {
target.healthBar.gotoAndStop(Math.round((25 - ((25 * target.health) / target.baseHealth))));
};
break;
case 2:
target.health = (target.health - this._damage);
if (target.health <= 0){
this.playRandomSound(target.boses);
target.kill();
this.myTimer.stop();
} else {
target.healthBar.gotoAndStop(Math.round((25 - ((25 * target.health) / target.baseHealth))));
};
break;
case 3:
this.target.slow(_damage);
break;
case 4:
if (target != undefined){
target.map.tileArray[target.curPoint.y][target.curPoint.x].addPepper(_damage);
};
break;
};
};
}
public function clear(){
this.myTimer.stop();
this.myTimer.removeEventListener("timer", move);
this.graph.removeEventListener(Event.ENTER_FRAME, onEnterGraphFrame);
}
private function move(_arg1:Event){
var _local2:Point;
var _local3:*;
this.rotation = Utilites.returnAngelBetwenPoints(new Point(this.x, this.y), new Point(target.x, target.y));
_local2 = new Point(this.x, this.y);
_local3 = new Point(target.x, target.y);
this.ty = -(Point.polar(10, ((this.rotation * Math.PI) / 180)).x);
this.tx = Point.polar(10, ((this.rotation * Math.PI) / 180)).y;
this.x = (this.x + this.tx);
this.y = (this.y + this.ty);
if (this.hitTestObject(target)){
this.myTimer.stop();
this.x = target.x;
this.y = target.y;
this.graph.addEventListener(Event.ENTER_FRAME, onEnterGraphFrame);
this.graph.gotoAndPlay("blast");
this.damage();
};
}
public function pause(){
this.myTimer.stop();
}
}
}//package com.xitexsoftware.gamepack
Section 26
//Tile (com.xitexsoftware.gamepack.Tile)
package com.xitexsoftware.gamepack {
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
public class Tile {
private var _walkable:Boolean;
private var pepperTimer:Timer;
private var _height:int;
private var _underAttack:Array;
private var _buildable:Boolean;
private var _width:int;
public var _turret;
private var _monsterPresent:Array;
public var bonusAdded:Boolean;// = false
private var pepper:int;
public var cord:Point;
private var _bonus:Bonus;
public var bonusDamage:int;// = 0
public var x:int;
public var y:int;
public function Tile(_arg1:Boolean=true, _arg2:Boolean=true, _arg3:int=40, _arg4:int=40):void{
_walkable = new Boolean(true);
_buildable = new Boolean(true);
_height = new int();
_width = new int();
pepper = new int(0);
bonusAdded = false;
bonusDamage = 0;
super();
_underAttack = new Array();
pepperTimer = new Timer(1600, 0);
pepperTimer.addEventListener("timer", onPepperTimer);
this._walkable = _arg1;
this._buildable = _arg2;
this._height = _arg3;
this._width = _arg4;
}
public function set buildable(_arg1:Boolean){
_buildable = _arg1;
}
public function removeTurret(_arg1):void{
delete this._underAttack[_arg1.turName];
}
public function get buildable(){
return (_buildable);
}
public function get walkable(){
return (_walkable);
}
private function onPepperTimer(_arg1:TimerEvent){
this.pepper = 0;
this.pepperTimer.stop();
}
public function set walkable(_arg1:Boolean){
_walkable = _arg1;
}
public function addPepper(_arg1:int){
this.pepper = _arg1;
Main.self._map.addPepper(this.cord);
this.pepperTimer.start();
}
public function attackMe(_arg1){
var _local2:String;
for (_local2 in _underAttack) {
if (_underAttack[_local2].free){
if (_underAttack[_local2].type == "pepper"){
_underAttack[_local2].attackMon(_arg1);
} else {
_underAttack[_local2].attackMon(_arg1);
};
};
};
if (this.pepper > 0){
_arg1.health = (_arg1.health - this.pepper);
if (_arg1.health < 0){
_arg1.kill();
return;
};
_arg1.healthBar.gotoAndStop(Math.round((25 - ((25 * _arg1.health) / _arg1.baseHealth))));
};
if ((((this.bonusAdded == true)) && ((_arg1.canCarry == true)))){
this._bonus.pickUp(_arg1);
_arg1.addBonus(_bonus);
this.bonusAdded = false;
this._bonus = null;
};
}
public function addTurret(_arg1):void{
this._underAttack[_arg1.turName] = _arg1;
}
public function removeBonus(){
this.bonusAdded = false;
this._bonus = null;
}
public function addBonus(_arg1:Bonus){
this._bonus = _arg1;
this.bonusAdded = true;
this._bonus.init((this.x + 7), (this.y + 7), this);
}
}
}//package com.xitexsoftware.gamepack
Section 27
//Utilites (com.xitexsoftware.gamepack.Utilites)
package com.xitexsoftware.gamepack {
import flash.geom.*;
import flash.utils.*;
public class Utilites {
public static function returnAngelBetwenPoints(_arg1:Point, _arg2:Point):int{
var _local3:int;
_local3 = new int(0);
if ((((_arg1.x <= _arg2.x)) && ((_arg1.y > _arg2.y)))){
_local3 = Math.round((0 + ((180 * Math.asin(((Math.max(_arg1.x, _arg2.x) - Math.min(_arg1.x, _arg2.x)) / Point.distance(_arg1, _arg2)))) / Math.PI)));
} else {
if ((((_arg1.x > _arg2.x)) && ((_arg1.y > _arg2.y)))){
_local3 = Math.round((0 - ((180 * Math.asin(((Math.max(_arg1.x, _arg2.x) - Math.min(_arg1.x, _arg2.x)) / Point.distance(_arg1, _arg2)))) / Math.PI)));
} else {
if ((((_arg1.x > _arg2.x)) && ((_arg1.y <= _arg2.y)))){
_local3 = Math.round((180 + ((180 * Math.asin(((Math.max(_arg1.x, _arg2.x) - Math.min(_arg1.x, _arg2.x)) / Point.distance(_arg1, _arg2)))) / Math.PI)));
} else {
_local3 = Math.round((180 - ((180 * Math.asin(((Math.max(_arg1.x, _arg2.x) - Math.min(_arg1.x, _arg2.x)) / Point.distance(_arg1, _arg2)))) / Math.PI)));
};
};
};
return (_local3);
}
public static function clone(_arg1:Object){
var _local2:ByteArray;
_local2 = new ByteArray();
_local2.writeObject(_arg1);
_local2.position = 0;
return (_local2.readObject());
}
public static function pathFind(_arg1:Array, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:Boolean=false):Array{
var _local7:Array;
var _local8:Array;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:int;
var _local18:int;
var _local19:Boolean;
var _local20:int;
_local7 = new Array();
_local8 = new Array();
_local9 = 0;
while (_local9 < _arg1.length) {
_local7[_local9] = new Array();
_local20 = 0;
while (_local20 < _arg1[_local9].length) {
if (_arg1[_local9][_local20].walkable == true){
_local7[_local9][_local20] = 0;
} else {
_local7[_local9][_local20] = -1;
};
_local20++;
};
_local9++;
};
_local7[_arg3][_arg2] = 1;
_local10 = 1;
if (_arg2 > 1){
_local14 = (_arg2 - 1);
_local17 = _local14;
} else {
_local14 = 1;
_local17 = _local14;
};
if (_arg3 > 1){
_local13 = (_arg3 - 1);
_local15 = _local13;
} else {
_local13 = 1;
_local15 = _local13;
};
if ((_arg3 + 1) < _local7.length){
_local11 = (_arg3 + 1);
_local16 = _local11;
} else {
_local11 = _local7.length;
_local16 = _local11;
};
if ((_arg2 + 1) < _local7[0].length){
_local12 = (_arg2 + 1);
_local18 = _local12;
} else {
_local12 = _local7[0].length;
_local18 = _local12;
};
_local19 = new Boolean(true);
while ((((_local7[_arg5][_arg4] == 0)) && ((_local19 == true)))) {
_local19 = false;
if (_arg6 == true){
trace(_local19);
};
_local9 = _local15;
while (_local9 < _local16) {
_local20 = _local17;
while (_local20 < _local18) {
if (_local7[_local9][_local20] == _local10){
if (_local9 < _local13){
_local13 = _local9;
};
if (_local9 > _local11){
_local11 = _local9;
};
if (_local20 < _local14){
_local14 = _local20;
};
if (_local20 > _local12){
_local12 = _local20;
};
if (_local7[_local9][(_local20 - 1)] == 0){
_local7[_local9][(_local20 - 1)] = (_local10 + 1);
_local19 = true;
};
if (_local7[_local9][(_local20 + 1)] == 0){
_local7[_local9][(_local20 + 1)] = (_local10 + 1);
_local19 = true;
};
if (_local7[(_local9 - 1)][_local20] == 0){
_local7[(_local9 - 1)][_local20] = (_local10 + 1);
_local19 = true;
};
if (_local7[(_local9 + 1)][_local20] == 0){
_local7[(_local9 + 1)][_local20] = (_local10 + 1);
_local19 = true;
};
if ((((((_local7[(_local9 - 1)][(_local20 - 1)] == 0)) && ((_local7[_local9][(_local20 - 1)] >= 0)))) && ((_local7[(_local9 - 1)][_local20] >= 0)))){
_local7[(_local9 - 1)][(_local20 - 1)] = (_local10 + 1);
_local19 = true;
};
if ((((((_local7[(_local9 - 1)][(_local20 + 1)] == 0)) && ((_local7[_local9][(_local20 + 1)] >= 0)))) && ((_local7[(_local9 - 1)][_local20] >= 0)))){
_local7[(_local9 - 1)][(_local20 + 1)] = (_local10 + 1);
_local19 = true;
};
if ((((((_local7[(_local9 + 1)][(_local20 - 1)] == 0)) && ((_local7[(_local9 + 1)][_local20] >= 0)))) && ((_local7[_local9][(_local20 - 1)] >= 0)))){
_local7[(_local9 + 1)][(_local20 - 1)] = (_local10 + 1);
_local19 = true;
};
if ((((((_local7[(_local9 + 1)][(_local20 + 1)] == 0)) && ((_local7[(_local9 + 1)][_local20] >= 0)))) && ((_local7[_local9][(_local20 + 1)] >= 0)))){
_local7[(_local9 + 1)][(_local20 + 1)] = (_local10 + 1);
_local19 = true;
};
};
_local20++;
};
_local9++;
};
_local10++;
if ((_local13 - 1) > 0){
_local15 = (_local13 - 1);
_local13 = _local15;
} else {
_local15 = 1;
_local13 = _local15;
};
if ((_local14 - 1) > 0){
_local17 = (_local14 - 1);
_local14 = _local17;
} else {
_local17 = 1;
_local14 = _local17;
};
if ((_local11 + 1) < _local7.length){
_local16 = (_local11 + 1);
_local11 = _local16;
} else {
_local16 = (_local7.length - 1);
_local11 = _local16;
};
if ((_local12 + 1) < _local7[0].length){
_local18 = (_local12 + 1);
_local12 = _local18;
} else {
_local18 = (_local7[0].length - 1);
_local12 = _local18;
};
};
if (_local7[_arg5][_arg4] != 0){
_local8.push(new Point(_arg4, _arg5));
_local10 = _local7[_arg5][_arg4];
while (_local10 > 1) {
if (_local7[_arg5][(_arg4 - 1)] == (_local10 - 1)){
_local8.push(new Point((_arg4 - 1), _arg5));
_arg4--;
} else {
if (_local7[(_arg5 - 1)][_arg4] == (_local10 - 1)){
_local8.push(new Point(_arg4, (_arg5 - 1)));
_arg5--;
} else {
if (_local7[_arg5][(_arg4 + 1)] == (_local10 - 1)){
_local8.push(new Point((_arg4 + 1), _arg5));
_arg4++;
} else {
if (_local7[(_arg5 + 1)][_arg4] == (_local10 - 1)){
_local8.push(new Point(_arg4, (_arg5 + 1)));
_arg5++;
} else {
if (_local7[(_arg5 - 1)][(_arg4 - 1)] == (_local10 - 1)){
_local8.push(new Point((_arg4 - 1), (_arg5 - 1)));
_arg5--;
_arg4--;
} else {
if (_local7[(_arg5 + 1)][(_arg4 - 1)] == (_local10 - 1)){
_local8.push(new Point((_arg4 - 1), (_arg5 + 1)));
_arg5++;
_arg4--;
} else {
if (_local7[(_arg5 - 1)][(_arg4 + 1)] == (_local10 - 1)){
_local8.push(new Point((_arg4 + 1), (_arg5 - 1)));
_arg5--;
_arg4++;
} else {
if (_local7[(_arg5 + 1)][(_arg4 + 1)] == (_local10 - 1)){
_local8.push(new Point((_arg4 + 1), (_arg5 + 1)));
_arg5++;
_arg4++;
};
};
};
};
};
};
};
};
_local10--;
};
_local8.reverse();
return (_local8);
//unresolved jump
};
return (new Array());
}
}
}//package com.xitexsoftware.gamepack
Section 28
//XMLData (com.xitexsoftware.gamepack.XMLData)
package com.xitexsoftware.gamepack {
import flash.events.*;
public class XMLData {
private var gameData:XML;
public static var self:XMLData;
public function XMLData(){
self = this;
gameData = <data>
<levels>
<normal money="200" lives="20">
<ant name="ants" amm="1" rep="10" hp="10" money="1" score="15" boses="false"/>
<ant name="ant_african" amm="1" rep="10" hp="15" money="2" score="20" boses="false"/>
<ant name="burrowers" amm="1" rep="10" hp="15" money="2" score="40" boses="false"/>
<ant name="ant_big" amm="1" rep="10" hp="25" money="3" score="30" boses="false"/>
<ant name="ants_small" amm="1" rep="10" hp="20" money="6" score="30" boses="false"/>
<ant name="soldier_ant" amm="1" rep="3" hp="100" money="8" score="100" boses="true"/>
<ant name="ant_winged" amm="1" rep="10" hp="25" money="4" score="50" boses="false"/>
<ant name="piss_ant" amm="1" rep="10" hp="40" money="4" score="50" boses="false"/>
<ant name="fire_ant" amm="1" rep="10" hp="50" money="6" score="50" boses="false"/>
<ant name="termite" amm="1" rep="10" hp="60" money="8" score="50" boses="false"/>
<ant name="queen_ant" amm="2" rep="2" hp="150" money="15" score="250" boses="true"/>
<ant name="queen_termite" amm="1" rep="1" hp="250" money="25" score="500" boses="true"/>
<ant name="ants" amm="1" rep="10" hp="30" money="2" score="15" boses="false"/>
<ant name="ant_african" amm="1" rep="10" hp="40" money="3" score="23" boses="false"/>
<ant name="burrowers" amm="1" rep="10" hp="40" money="3" score="30" boses="false"/>
<ant name="ant_big" amm="1" rep="10" hp="50" money="5" score="60" boses="false"/>
<ant name="ants_small" amm="1" rep="10" hp="30" money="4" score="45" boses="false"/>
<ant name="soldier_ant" amm="1" rep="3" hp="200" money="12" score="150" boses="true"/>
<ant name="ant_winged" amm="1" rep="10" hp="70" money="6" score="75" boses="false"/>
<ant name="piss_ant" amm="1" rep="10" hp="80" money="6" score="45" boses="false"/>
<ant name="fire_ant" amm="1" rep="10" hp="100" money="9" score="75" boses="false"/>
<ant name="termite" amm="1" rep="10" hp="120" money="12" score="75" boses="false"/>
<ant name="queen_ant" amm="2" rep="2" hp="300" money="23" score="375" boses="true"/>
<ant name="queen_termite" amm="1" rep="1" hp="500" money="38" score="750" boses="true"/>
<ant name="ants" amm="1" rep="10" hp="120" money="3" score="25" boses="false"/>
<ant name="ant_african" amm="1" rep="10" hp="140" money="5" score="38" boses="false"/>
<ant name="burrowers" amm="1" rep="10" hp="160" money="5" score="50" boses="false"/>
<ant name="ant_big" amm="1" rep="10" hp="200" money="7" score="100" boses="false"/>
<ant name="ants_small" amm="1" rep="10" hp="180" money="8" score="75" boses="false"/>
<ant name="soldier_ant" amm="2" rep="3" hp="600" money="18" score="250" boses="true"/>
<ant name="ant_winged" amm="1" rep="10" hp="250" money="10" score="125" boses="false"/>
<ant name="piss_ant" amm="1" rep="10" hp="300" money="10" score="75" boses="false"/>
<ant name="fire_ant" amm="1" rep="10" hp="400" money="14" score="125" boses="false"/>
<ant name="termite" amm="1" rep="10" hp="600" money="20" score="125" boses="false"/>
<ant name="queen_ant" amm="2" rep="3" hp="1200" money="40" score="625" boses="true"/>
<ant name="queen_termite" amm="1" rep="1" hp="2000" money="60" score="1250" boses="true"/>
<ant name="ants" amm="1" rep="10" hp="350" money="3" score="40" boses="false"/>
<ant name="ant_african" amm="1" rep="10" hp="420" money="6" score="50" boses="false"/>
<ant name="burrowers" amm="1" rep="10" hp="600" money="6" score="75" boses="false"/>
<ant name="ant_big" amm="1" rep="10" hp="750" money="9" score="120" boses="false"/>
<ant name="ants_small" amm="1" rep="10" hp="650" money="10" score="125" boses="false"/>
<ant name="soldier_ant" amm="2" rep="4" hp="1200" money="25" score="400" boses="true"/>
<ant name="ant_winged" amm="1" rep="10" hp="550" money="12" score="250" boses="false"/>
<ant name="piss_ant" amm="1" rep="10" hp="800" money="12" score="200" boses="false"/>
<ant name="fire_ant" amm="1" rep="10" hp="1000" money="18" score="250" boses="false"/>
<ant name="termite" amm="1" rep="10" hp="1200" money="24" score="300" boses="false"/>
<ant name="queen_ant" amm="2" rep="3" hp="2500" money="45" score="850" boses="true"/>
<ant name="queen_termite" amm="1" rep="2" hp="4000" money="75" score="1750" boses="true"/>
<ant name="termite" amm="1" rep="10" hp="2000" money="30" score="450" boses="false"/>
<ant name="queen_termite" amm="2" rep="2" hp="6000" money="100" score="2500" boses="true"/>
</normal>
<hard money="200" lives="20">
<ant name="ants" amm="1" rep="5" hp="10" money="1" score="16" boses="false"/>
<ant name="ant_african" amm="1" rep="5" hp="20" money="2" score="20" boses="false"/>
<ant name="burrowers" amm="1" rep="10" hp="20" money="2" score="42" boses="false"/>
<ant name="ant_big" amm="1" rep="10" hp="30" money="3" score="30" boses="false"/>
<ant name="ants_small" amm="1" rep="10" hp="25" money="7" score="30" boses="false"/>
<ant name="soldier_ant" amm="1" rep="3" hp="125" money="8" score="100" boses="true"/>
<ant name="ant_winged" amm="1" rep="10" hp="30" money="4" score="50" boses="false"/>
<ant name="piss_ant" amm="1" rep="10" hp="45" money="5" score="50" boses="false"/>
<ant name="fire_ant" amm="1" rep="10" hp="60" money="7" score="50" boses="false"/>
<ant name="termite" amm="1" rep="10" hp="70" money="8" score="50" boses="false"/>
<ant name="queen_ant" amm="2" rep="2" hp="200" money="20" score="250" boses="true"/>
<ant name="queen_termite" amm="1" rep="1" hp="300" money="50" score="500" boses="true"/>
<ant name="ants" amm="1" rep="10" hp="40" money="2" score="15" boses="false"/>
<ant name="ant_african" amm="1" rep="10" hp="50" money="3" score="23" boses="false"/>
<ant name="burrowers" amm="1" rep="10" hp="50" money="3" score="30" boses="false"/>
<ant name="ant_big" amm="1" rep="10" hp="60" money="5" score="60" boses="false"/>
<ant name="ants_small" amm="1" rep="10" hp="40" money="7" score="45" boses="false"/>
<ant name="soldier_ant" amm="1" rep="3" hp="300" money="12" score="150" boses="true"/>
<ant name="ant_winged" amm="1" rep="10" hp="70" money="6" score="75" boses="false"/>
<ant name="piss_ant" amm="1" rep="10" hp="90" money="6" score="45" boses="false"/>
<ant name="fire_ant" amm="1" rep="10" hp="120" money="9" score="75" boses="false"/>
<ant name="termite" amm="1" rep="10" hp="140" money="12" score="75" boses="false"/>
<ant name="queen_ant" amm="2" rep="2" hp="400" money="23" score="375" boses="true"/>
<ant name="queen_termite" amm="1" rep="1" hp="650" money="38" score="750" boses="true"/>
<ant name="ants" amm="1" rep="10" hp="125" money="3" score="25" boses="false"/>
<ant name="ant_african" amm="1" rep="10" hp="150" money="5" score="38" boses="false"/>
<ant name="burrowers" amm="1" rep="10" hp="175" money="5" score="50" boses="false"/>
<ant name="ant_big" amm="1" rep="10" hp="200" money="7" score="100" boses="false"/>
<ant name="ants_small" amm="1" rep="10" hp="175" money="8" score="75" boses="false"/>
<ant name="soldier_ant" amm="3" rep="3" hp="625" money="18" score="250" boses="true"/>
<ant name="ant_winged" amm="1" rep="10" hp="250" money="10" score="125" boses="false"/>
<ant name="piss_ant" amm="1" rep="10" hp="325" money="10" score="75" boses="false"/>
<ant name="fire_ant" amm="1" rep="10" hp="425" money="14" score="125" boses="false"/>
<ant name="termite" amm="1" rep="10" hp="625" money="20" score="125" boses="false"/>
<ant name="queen_ant" amm="2" rep="3" hp="1250" money="45" score="625" boses="true"/>
<ant name="queen_termite" amm="1" rep="1" hp="2000" money="75" score="1250" boses="true"/>
<ant name="ants" amm="1" rep="10" hp="250" money="3" score="40" boses="false"/>
<ant name="ant_african" amm="1" rep="10" hp="300" money="6" score="50" boses="false"/>
<ant name="burrowers" amm="1" rep="10" hp="500" money="6" score="75" boses="false"/>
<ant name="ant_big" amm="1" rep="10" hp="600" money="9" score="120" boses="false"/>
<ant name="ants_small" amm="1" rep="10" hp="650" money="9" score="125" boses="false"/>
<ant name="soldier_ant" amm="3" rep="3" hp="1250" money="24" score="400" boses="true"/>
<ant name="ant_winged" amm="1" rep="10" hp="550" money="12" score="250" boses="false"/>
<ant name="piss_ant" amm="1" rep="10" hp="750" money="12" score="200" boses="false"/>
<ant name="fire_ant" amm="1" rep="10" hp="900" money="18" score="250" boses="false"/>
<ant name="termite" amm="1" rep="10" hp="1200" money="24" score="300" boses="false"/>
<ant name="queen_ant" amm="2" rep="3" hp="2500" money="45" score="850" boses="true"/>
<ant name="queen_termite" amm="1" rep="2" hp="5000" money="75" score="1750" boses="true"/>
<ant name="termite" amm="1" rep="10" hp="1500" money="30" score="450" boses="false"/>
<ant name="queen_termite" amm="2" rep="2" hp="5000" money="100" score="2500" boses="true"/> <ant name="ants" amm="1" rep="10" hp="500" money="8" score="45" boses="false"/>
<ant name="ant_african" amm="1" rep="10" hp="600" money="8" score="60" boses="false"/>
<ant name="burrowers" amm="1" rep="10" hp="1000" money="12" score="90" boses="false"/>
<ant name="ant_big" amm="1" rep="10" hp="1200" money="12" score="150" boses="false"/>
<ant name="ants_small" amm="1" rep="10" hp="1100" money="5" score="160" boses="false"/>
<ant name="soldier_ant" amm="3" rep="3" hp="2500" money="24" score="500" boses="true"/> <ant name="ant_winged" amm="1" rep="10" hp="1000" money="32" score="325" boses="false"/>
<ant name="piss_ant" amm="1" rep="10" hp="1500" money="16" score="300" boses="false"/>
<ant name="fire_ant" amm="1" rep="10" hp="1800" money="24" score="375" boses="false"/>
<ant name="termite" amm="1" rep="10" hp="2000" money="32" score="425" boses="false"/>
<ant name="queen_ant" amm="1" rep="2" hp="5000" money="60" score="1000" boses="true"/>
<ant name="queen_termite" amm="1" rep="1" hp="10000" money="100" score="2500" boses="true"/>
<ant name="ants" amm="1" rep="10" hp="750" money="8" score="60" boses="false"/>
<ant name="ant_african" amm="1" rep="10" hp="900" money="8" score="80" boses="false"/>
<ant name="burrowers" amm="1" rep="10" hp="1500" money="12" score="110" boses="false"/>
<ant name="ant_big" amm="1" rep="10" hp="1800" money="12" score="180" boses="false"/>
<ant name="ants_small" amm="1" rep="10" hp="1650" money="5" score="200" boses="false"/>
<ant name="soldier_ant" amm="3" rep="3" hp="3750" money="24" score="600" boses="true"/> <ant name="ant_winged" amm="1" rep="10" hp="1500" money="32" score="400" boses="false"/>
<ant name="piss_ant" amm="1" rep="10" hp="2250" money="16" score="425" boses="false"/>
<ant name="fire_ant" amm="1" rep="10" hp="2700" money="24" score="450" boses="false"/>
<ant name="termite" amm="1" rep="10" hp="3000" money="32" score="525" boses="false"/>
<ant name="queen_ant" amm="1" rep="2" hp="7500" money="60" score="1200" boses="true"/>
<ant name="queen_termite" amm="1" rep="1" hp="15000" money="100" score="3000" boses="true"/>
<ant name="ants" amm="1" rep="10" hp="1000" money="14" score="80" boses="false"/>
<ant name="ant_african" amm="1" rep="10" hp="1200" money="14" score="100" boses="false"/>
<ant name="burrowers" amm="1" rep="10" hp="2000" money="21" score="135" boses="false"/>
<ant name="ant_big" amm="1" rep="10" hp="2400" money="21" score="200" boses="false"/>
<ant name="ants_small" amm="1" rep="10" hp="2200" money="10" score="250" boses="false"/>
<ant name="soldier_ant" amm="3" rep="3" hp="5000" money="56" score="725" boses="true"/>
<ant name="ant_winged" amm="1" rep="10" hp="2000" money="28" score="500" boses="false"/>
<ant name="piss_ant" amm="1" rep="10" hp="3000" money="18" score="525" boses="false"/>
<ant name="fire_ant" amm="1" rep="10" hp="3600" money="42" score="575" boses="false"/>
<ant name="termite" amm="1" rep="10" hp="4000" money="56" score="600" boses="false"/>
<ant name="queen_ant" amm="2" rep="2" hp="10000" money="105" score="1400" boses="true"/>
<ant name="queen_termite" amm="1" rep="1" hp="20000" money="175" score="3500" boses="true"/>
<ant name="ant_african" amm="1" rep="10" hp="1800" money="14" score="135" boses="false"/>
<ant name="burrowers" amm="1" rep="10" hp="2500" money="21" score="160" boses="false"/>
<ant name="ant_big" amm="1" rep="10" hp="2800" money="21" score="260" boses="false"/>
<ant name="ants_small" amm="1" rep="10" hp="2800" money="10" score="325" boses="false"/>
<ant name="soldier_ant" amm="3" rep="3" hp="6000" money="56" score="875" boses="true"/>
<ant name="ant_winged" amm="1" rep="10" hp="3000" money="28" score="650" boses="false"/>
<ant name="piss_ant" amm="1" rep="10" hp="4000" money="18" score="650" boses="false"/>
<ant name="fire_ant" amm="1" rep="10" hp="4500" money="42" score="725" boses="false"/>
<ant name="termite" amm="1" rep="10" hp="4800" money="56" score="800" boses="false"/>
<ant name="queen_ant" amm="2" rep="2" hp="12000" money="105" score="1800" boses="true"/>
<ant name="queen_termite" amm="1" rep="1" hp="25000" money="175" score="5000" boses="true"/>
<ant name="termite" amm="1" rep="10" hp="6000" money="200" score="1050" boses="false"/>
<ant name="queen_termite" amm="2" rep="2" hp="30000" money="300" score="6500" boses="true"/>
<ant name="queen_termite" amm="2" rep="4" hp="40000" money="500" score="10000" boses="true"/>
</hard>
<spec money="500" lives="20">
<ant name="ants_small" amm="1" rep="10" hp="30" money="3" score="30" boses="false"/>
<ant name="termite" amm="1" rep="10" hp="60" money="8" score="50" boses="false"/>
<ant name="ants_small" amm="2" rep="5" hp="40" money="3" score="30" boses="false"/>
<ant name="termite" amm="2" rep="5" hp="70" money="8" score="50" boses="false"/>
<ant name="ant_winged" amm="1" rep="10" hp="35" money="4" score="50" boses="false"/>
<ant name="ants_small" amm="1" rep="10" hp="50" money="3" score="30" boses="false"/>
<ant name="soldier_ant" amm="2" rep="5" hp="150" money="12" score="150" boses="true"/>
<ant name="termite" amm="1" rep="10" hp="80" money="10" score="50" boses="false"/>
<ant name="ants_small" amm="1" rep="10" hp="60" money="4" score="30" boses="false"/>
<ant name="termite" amm="1" rep="10" hp="90" money="12" score="50" boses="false"/>
<ant name="fire_ant" amm="1" rep="10" hp="100" money="8" score="50" boses="false"/>
<ant name="queen_termite" amm="1" rep="2" hp="250" money="25" score="500" boses="true"/>
<ant name="ants_small" amm="1" rep="10" hp="70" money="3" score="30" boses="false"/>
<ant name="termite" amm="1" rep="10" hp="60" money="8" score="50" boses="false"/>
<ant name="ants_small" amm="2" rep="5" hp="80" money="3" score="30" boses="false"/>
<ant name="termite" amm="2" rep="5" hp="70" money="8" score="50" boses="false"/>
<ant name="ant_winged" amm="1" rep="10" hp="35" money="4" score="50" boses="false"/>
<ant name="ants_small" amm="1" rep="10" hp="100" money="3" score="30" boses="false"/>
<ant name="soldier_ant" amm="2" rep="5" hp="150" money="12" score="150" boses="true"/>
<ant name="termite" amm="1" rep="10" hp="80" money="8" score="50" boses="false"/>
<ant name="ants_small" amm="1" rep="10" hp="120" money="3" score="30" boses="false"/>
<ant name="termite" amm="1" rep="10" hp="90" money="8" score="50" boses="false"/>
<ant name="fire_ant" amm="1" rep="10" hp="100" money="6" score="50" boses="false"/>
<ant name="queen_termite" amm="1" rep="2" hp="250" money="25" score="500" boses="true"/>
<ant name="ants_small" amm="1" rep="10" hp="150" money="3" score="30" boses="false"/>
<ant name="termite" amm="1" rep="10" hp="60" money="8" score="50" boses="false"/>
<ant name="ants_small" amm="2" rep="5" hp="180" money="3" score="30" boses="false"/>
<ant name="termite" amm="2" rep="5" hp="70" money="8" score="50" boses="false"/>
<ant name="ant_winged" amm="1" rep="10" hp="35" money="4" score="50" boses="false"/>
<ant name="ants_small" amm="1" rep="10" hp="220" money="3" score="30" boses="false"/>
<ant name="soldier_ant" amm="2" rep="5" hp="150" money="12" score="150" boses="true"/>
<ant name="termite" amm="1" rep="10" hp="80" money="8" score="50" boses="false"/>
<ant name="ants_small" amm="1" rep="10" hp="250" money="3" score="30" boses="false"/>
<ant name="termite" amm="1" rep="10" hp="90" money="8" score="50" boses="false"/>
<ant name="fire_ant" amm="1" rep="10" hp="100" money="6" score="50" boses="false"/>
<ant name="queen_termite" amm="1" rep="2" hp="250" money="25" score="500" boses="true"/>
<ant name="ants_small" amm="1" rep="10" hp="300" money="3" score="30" boses="false"/>
<ant name="termite" amm="1" rep="10" hp="60" money="8" score="50" boses="false"/>
<ant name="ants_small" amm="2" rep="5" hp="350" money="3" score="30" boses="false"/>
<ant name="termite" amm="2" rep="5" hp="70" money="8" score="50" boses="false"/>
<ant name="ant_winged" amm="1" rep="10" hp="35" money="4" score="50" boses="false"/>
<ant name="ants_small" amm="1" rep="10" hp="400" money="3" score="30" boses="false"/>
<ant name="soldier_ant" amm="2" rep="5" hp="150" money="12" score="150" boses="true"/>
<ant name="termite" amm="1" rep="10" hp="80" money="8" score="50" boses="false"/>
<ant name="ants_small" amm="1" rep="10" hp="500" money="3" score="30" boses="false"/>
<ant name="termite" amm="1" rep="10" hp="90" money="8" score="50" boses="false"/>
<ant name="fire_ant" amm="1" rep="10" hp="100" money="6" score="50" boses="false"/>
<ant name="queen_termite" amm="1" rep="2" hp="250" money="25" score="500" boses="true"/>
<ant name="termite" amm="1" rep="10" hp="400" money="30" score="150" boses="false"/>
<ant name="queen_termite" amm="2" rep="2" hp="2000" money="100" score="2000" boses="true"/>
</spec>
</levels>
<turrets>
<mustard>
<level id="1">
<name>Standard Mustard</name>
<damage>5</damage>
<rate>1</rate>
<range>3</range>
<defense>150</defense>
<cost>10</cost>
</level>
<level id="2">
<name>Hot Mustard</name>
<damage>10</damage>
<rate>1</rate>
<range>3</range>
<defense>250</defense>
<cost>18</cost>
</level>
<level id="3">
<name>French Mustard</name>
<damage>18</damage>
<rate>1</rate>
<range>5</range>
<defense>350</defense>
<cost>30</cost>
</level>
<level id="4">
<name>English Mustard</name>
<damage>30</damage>
<rate>2</rate>
<range>5</range>
<defense>450</defense>
<cost>60</cost>
</level>
<level id="5">
<name>Thai Crazy Mustard</name>
<damage>100</damage>
<rate>2</rate>
<range>10</range>
<defense>600</defense>
<cost>120</cost>
</level>
</mustard>
<ketchup>
<level id="1">
<name>Standard Ketchup</name>
<damage>10</damage>
<rate>2</rate>
<range>4</range>
<defense>250</defense>
<cost>30</cost>
</level>
<level id="2">
<name>Garlic Ketchup</name>
<damage>18</damage>
<rate>2</rate>
<range>4</range>
<defense>350</defense>
<cost>50</cost>
</level>
<level id="3">
<name>Chili Ketchup</name>
<damage>30</damage>
<rate>2</rate>
<range>6</range>
<defense>450</defense>
<cost>90</cost>
</level>
<level id="4">
<name>Hot pepper Ketchup</name>
<damage>60</damage>
<rate>3</rate>
<range>6</range>
<defense>500</defense>
<cost>160</cost>
</level>
<level id="5">
<name>Habanero Ketchup</name>
<damage>200</damage>
<rate>3</rate>
<range>8</range>
<defense>700</defense>
<cost>300</cost>
</level>
</ketchup>
<honey>
<level id="1">
<name>Standard Honey</name>
<damage>0.2</damage>
<rate>1</rate>
<range>3</range>
<defense>100</defense>
<cost>10</cost>
</level>
<level id="2">
<name>Cinnamon Honey</name>
<damage>0.3</damage>
<rate>1</rate>
<range>3</range>
<defense>150</defense>
<cost>18</cost>
</level>
<level id="3">
<name>Maple Syrup Honey</name>
<damage>0.45</damage>
<rate>1</rate>
<range>3</range>
<defense>200</defense>
<cost>30</cost>
</level>
</honey>
<pepper>
<level id="1">
<name>Standard Pepper</name>
<damage>5</damage>
<rate>1</rate>
<range>3</range>
<defense>150</defense>
<cost>15</cost>
</level>
<level id="2">
<name>Lemon Pepper</name>
<damage>10</damage>
<rate>1</rate>
<range>3</range>
<defense>250</defense>
<cost>25</cost>
</level>
<level id="3">
<name>Chili Pepper</name>
<damage>25</damage>
<rate>2</rate>
<range>3</range>
<defense>400</defense>
<cost>50</cost>
</level>
</pepper>
<toothpick>
<level id="1">
<name>Standard Toothpick</name>
<damage>3</damage>
<rate>1</rate>
<range>4</range>
<defense>150</defense>
<cost>12</cost>
</level>
<level id="2">
<name>Cinnamon Toothpick</name>
<damage>5</damage>
<rate>1</rate>
<range>4</range>
<defense>250</defense>
<cost>20</cost>
</level>
<level id="3">
<name>Mint flavored Toothpick</name>
<damage>10</damage>
<rate>1</rate>
<range>5</range>
<defense>350</defense>
<cost>35</cost>
</level>
<level id="4">
<name>Double edged Toothpick</name>
<damage>20</damage>
<rate>2</rate>
<range>6</range>
<defense>500</defense>
<cost>60</cost>
</level>
</toothpick>
<sugar>
<level id="1">
<name>Raw sugar</name>
<damage>0.1</damage>
<rate>0</rate>
<range>2</range>
<defense>100</defense>
<cost>50</cost>
</level>
<level id="2">
<name>White sugar</name>
<damage>0.2</damage>
<rate>0</rate>
<range>2</range>
<defense>150</defense>
<cost>90</cost>
</level>
<level id="3">
<name>Dextroce sugar</name>
<damage>0.5</damage>
<rate>0</rate>
<range>2</range>
<defense>200</defense>
<cost>180</cost>
</level>
</sugar>
</turrets>
</data>
;
}
private function handleComplete(_arg1:Event):void{
var event = _arg1;
try {
gameData = new XML(event.target.data);
} catch(e:TypeError) {
trace("Could not parse text into XML");
trace(e.message);
};
getTurretLevel("mustard", 1);
}
public function getLevelArray(_arg1:String):Array{
var _local2:Array;
var _local3:int;
var _local4:XML;
_local2 = new Array();
_local3 = 0;
_local2.push({name:"ants_small", amm:1, rep:0, hp:100, money:2, score:10, boses:false, levelNum:_local3});
for each (_local4 in gameData.levels.child(_arg1).elements()) {
_local3++;
_local2.push({name:_local4.@name, amm:int(_local4.@amm), rep:int(_local4.@rep), hp:int(_local4.@hp), money:int(_local4.@money), score:int(_local4.@score), boses:((_local4.@boses)=="true") ? true : false, levelNum:_local3});
};
return (_local2);
}
public function getLevelLives(_arg1:String):int{
return (int(gameData.levels.child(_arg1).@lives));
}
public function getLevelMoney(_arg1:String):int{
return (int(gameData.levels.child(_arg1).@money));
}
public function getInstance():XMLData{
return (this);
}
public function getTurretLevel(_arg1:String, _arg2:int):Object{
var retObj:Object;
var turret = _arg1;
var level = _arg2;
retObj = new Object();
retObj.name = gameData.turrets.child(turret).level.(@id == String(level)).name;
retObj.damage = Number(gameData.turrets.child(turret).level.(@id == String(level)).damage);
retObj.rate = Number(gameData.turrets.child(turret).level.(@id == String(level)).rate);
retObj.range = Number(gameData.turrets.child(turret).level.(@id == String(level)).range);
retObj.defense = Number(gameData.turrets.child(turret).level.(@id == String(level)).defense);
retObj.cost = Number(gameData.turrets.child(turret).level.(@id == String(level)).cost);
return (retObj);
}
}
}//package com.xitexsoftware.gamepack
Section 29
//mc_attack_59 (PicnicBasketDefenseWithStones_fla.mc_attack_59)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
public dynamic class mc_attack_59 extends MovieClip {
public function mc_attack_59(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PicnicBasketDefenseWithStones_fla
Section 30
//mc_destroyed_60 (PicnicBasketDefenseWithStones_fla.mc_destroyed_60)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
public dynamic class mc_destroyed_60 extends MovieClip {
public function mc_destroyed_60(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PicnicBasketDefenseWithStones_fla
Section 31
//mc_end_84 (PicnicBasketDefenseWithStones_fla.mc_end_84)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
public dynamic class mc_end_84 extends MovieClip {
public var mc_end:MovieClip;
public var mcEndOver:MovieClip;
}
}//package PicnicBasketDefenseWithStones_fla
Section 32
//mc_end_noover_85 (PicnicBasketDefenseWithStones_fla.mc_end_noover_85)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_end_noover_85 extends MovieClip {
public var tot_score:TextField;
public var tot_lvl:TextField;
public var new_game_btn:SimpleButton;
public var tot_kill:TextField;
public var end_menu_btn:SimpleButton;
public var name_txt:TextField;
public var submit_score_but:SimpleButton;
}
}//package PicnicBasketDefenseWithStones_fla
Section 33
//mc_end_over_89 (PicnicBasketDefenseWithStones_fla.mc_end_over_89)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_end_over_89 extends MovieClip {
public var Btime:TextField;
public var tot_score:TextField;
public var tot_lvl:TextField;
public var new_game_btn:SimpleButton;
public var tot_kill:TextField;
public var end_menu_btn:SimpleButton;
public var Bmoney:TextField;
public var name_txt:TextField;
public var total_score:TextField;
public var submit_score_but:SimpleButton;
}
}//package PicnicBasketDefenseWithStones_fla
Section 34
//mc_guiTowers_36 (PicnicBasketDefenseWithStones_fla.mc_guiTowers_36)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
public dynamic class mc_guiTowers_36 extends MovieClip {
public var toothpickBuyMenu:MovieClip;
public var pepperUpgMenu:MovieClip;
public var ketchupUpgMenu:MovieClip;
public var mc_sell:MovieClip;
public var mc_repair:MovieClip;
public var honeyBuyMenu:MovieClip;
public var mustardBuyMenu:MovieClip;
public var pepperBuyMenu:MovieClip;
public var toothpickUpgMenu:MovieClip;
public var sugarUpgMenu:MovieClip;
public var ketchupBuyMenu:MovieClip;
public var mustardUpgMenu:MovieClip;
public var close_btn:SimpleButton;
public var sugarBuyMenu:MovieClip;
public var honeyUpgMenu:MovieClip;
public function mc_guiTowers_36(){
addFrameScript(0, frame1, 11, frame12, 22, frame23, 32, frame33, 43, frame44, 54, frame55, 73, frame74, 83, frame84);
}
function frame74(){
stop();
}
function frame84(){
stop();
}
function frame12(){
stop();
}
function frame1(){
stop();
}
function frame23(){
stop();
}
function frame33(){
stop();
}
function frame44(){
stop();
}
function frame55(){
stop();
}
}
}//package PicnicBasketDefenseWithStones_fla
Section 35
//mc_help_96 (PicnicBasketDefenseWithStones_fla.mc_help_96)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
public dynamic class mc_help_96 extends MovieClip {
public var bBack:SimpleButton;
}
}//package PicnicBasketDefenseWithStones_fla
Section 36
//mc_honey_turret_69 (PicnicBasketDefenseWithStones_fla.mc_honey_turret_69)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
public dynamic class mc_honey_turret_69 extends MovieClip {
public var mc_attack:MovieClip;
public var mc_destr:MovieClip;
public var mc_shootfrom:MovieClip;
public function mc_honey_turret_69(){
addFrameScript(18, frame19, 29, frame30);
}
function frame19(){
stop();
}
function frame30(){
gotoAndStop(1);
}
}
}//package PicnicBasketDefenseWithStones_fla
Section 37
//mc_HoneyBuy_48 (PicnicBasketDefenseWithStones_fla.mc_HoneyBuy_48)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_HoneyBuy_48 extends MovieClip {
public var turret_range:TextField;
public var turret_dmg:TextField;
public var turret_cost:TextField;
public var turret_rate:TextField;
public var turret_defense:TextField;
}
}//package PicnicBasketDefenseWithStones_fla
Section 38
//mc_HoneyUpg_42 (PicnicBasketDefenseWithStones_fla.mc_HoneyUpg_42)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_HoneyUpg_42 extends MovieClip {
public var turret_rate_upg:TextField;
public var mc_upg_graph:MovieClip;
public var turret_dmg_upg:TextField;
public var turret_cost_upg:TextField;
public var turret_range:TextField;
public var remove_btn:SimpleButton;
public var turret_dmg:TextField;
public var turret_range_upg:TextField;
public var turret_cost:TextField;
public var upg_btn:SimpleButton;
public var turretName_txt:TextField;
public var turret_rate:TextField;
public var turret_defense_upg:TextField;
public var turret_defense:TextField;
}
}//package PicnicBasketDefenseWithStones_fla
Section 39
//mc_hourglasscopy_63 (PicnicBasketDefenseWithStones_fla.mc_hourglasscopy_63)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
public dynamic class mc_hourglasscopy_63 extends MovieClip {
public var mc_sand:MovieClip;
public function mc_hourglasscopy_63(){
addFrameScript(99, frame100);
}
function frame100(){
stop();
}
}
}//package PicnicBasketDefenseWithStones_fla
Section 40
//mc_instructions_77 (PicnicBasketDefenseWithStones_fla.mc_instructions_77)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
public dynamic class mc_instructions_77 extends MovieClip {
public var hard_but:SimpleButton;
public var add_website_but:SimpleButton;
public var more_games_but:SimpleButton;
public var top_scores_but:SimpleButton;
public var norm_but:SimpleButton;
public var bInstruction:SimpleButton;
}
}//package PicnicBasketDefenseWithStones_fla
Section 41
//mc_ketchup_turret_67 (PicnicBasketDefenseWithStones_fla.mc_ketchup_turret_67)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
public dynamic class mc_ketchup_turret_67 extends MovieClip {
public var mc_attack:MovieClip;
public var mc_destr:MovieClip;
public var mc_shootfrom:MovieClip;
public function mc_ketchup_turret_67(){
addFrameScript(0, frame1, 18, frame19, 29, frame30);
}
function frame1(){
stop();
}
function frame19(){
stop();
}
function frame30(){
gotoAndStop(1);
}
}
}//package PicnicBasketDefenseWithStones_fla
Section 42
//mc_KetchupBuy_49 (PicnicBasketDefenseWithStones_fla.mc_KetchupBuy_49)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_KetchupBuy_49 extends MovieClip {
public var turret_range:TextField;
public var turret_dmg:TextField;
public var turret_cost:TextField;
public var turret_rate:TextField;
public var turret_defense:TextField;
}
}//package PicnicBasketDefenseWithStones_fla
Section 43
//mc_KetchupUpg_43 (PicnicBasketDefenseWithStones_fla.mc_KetchupUpg_43)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_KetchupUpg_43 extends MovieClip {
public var turret_rate_upg:TextField;
public var mc_upg_graph:MovieClip;
public var turret_dmg_upg:TextField;
public var turret_cost_upg:TextField;
public var turret_range:TextField;
public var remove_btn:SimpleButton;
public var turret_dmg:TextField;
public var turret_range_upg:TextField;
public var turret_cost:TextField;
public var upg_btn:SimpleButton;
public var turretName_txt:TextField;
public var turret_rate:TextField;
public var turret_defense_upg:TextField;
public var turret_defense:TextField;
}
}//package PicnicBasketDefenseWithStones_fla
Section 44
//mc_line_18 (PicnicBasketDefenseWithStones_fla.mc_line_18)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
public dynamic class mc_line_18 extends MovieClip {
public function mc_line_18(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PicnicBasketDefenseWithStones_fla
Section 45
//mc_mustard_turret_58 (PicnicBasketDefenseWithStones_fla.mc_mustard_turret_58)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
public dynamic class mc_mustard_turret_58 extends MovieClip {
public var mc_attack:MovieClip;
public var mc_destr:MovieClip;
public var mc_shootfrom:MovieClip;
public function mc_mustard_turret_58(){
addFrameScript(18, frame19, 29, frame30);
}
function frame19(){
stop();
}
function frame30(){
gotoAndStop(1);
}
}
}//package PicnicBasketDefenseWithStones_fla
Section 46
//mc_offline_90 (PicnicBasketDefenseWithStones_fla.mc_offline_90)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
public dynamic class mc_offline_90 extends MovieClip {
public var mygame_but:SimpleButton;
}
}//package PicnicBasketDefenseWithStones_fla
Section 47
//mc_pause_94 (PicnicBasketDefenseWithStones_fla.mc_pause_94)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
public dynamic class mc_pause_94 extends MovieClip {
public var menu_btn:SimpleButton;
public var play_btn:SimpleButton;
}
}//package PicnicBasketDefenseWithStones_fla
Section 48
//mc_PeperBuy_50 (PicnicBasketDefenseWithStones_fla.mc_PeperBuy_50)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_PeperBuy_50 extends MovieClip {
public var turret_range:TextField;
public var turret_dmg:TextField;
public var turret_cost:TextField;
public var turret_rate:TextField;
public var turret_defense:TextField;
}
}//package PicnicBasketDefenseWithStones_fla
Section 49
//mc_PeperUpg_44 (PicnicBasketDefenseWithStones_fla.mc_PeperUpg_44)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_PeperUpg_44 extends MovieClip {
public var turret_rate_upg:TextField;
public var mc_upg_graph:MovieClip;
public var turret_dmg_upg:TextField;
public var turret_cost_upg:TextField;
public var turret_range:TextField;
public var remove_btn:SimpleButton;
public var turret_dmg:TextField;
public var turret_range_upg:TextField;
public var turret_cost:TextField;
public var upg_btn:SimpleButton;
public var turretName_txt:TextField;
public var turret_rate:TextField;
public var turret_defense_upg:TextField;
public var turret_defense:TextField;
}
}//package PicnicBasketDefenseWithStones_fla
Section 50
//mc_peppe_turret_71 (PicnicBasketDefenseWithStones_fla.mc_peppe_turret_71)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
public dynamic class mc_peppe_turret_71 extends MovieClip {
public var mc_attack:MovieClip;
public var mc_destr:MovieClip;
public var mc_shootfrom:MovieClip;
public function mc_peppe_turret_71(){
addFrameScript(18, frame19, 26, frame27);
}
function frame19(){
stop();
}
function frame27(){
gotoAndStop(1);
}
}
}//package PicnicBasketDefenseWithStones_fla
Section 51
//mc_processing_55 (PicnicBasketDefenseWithStones_fla.mc_processing_55)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
public dynamic class mc_processing_55 extends MovieClip {
public function mc_processing_55(){
addFrameScript(99, frame100);
}
function frame100(){
stop();
}
}
}//package PicnicBasketDefenseWithStones_fla
Section 52
//mc_score_120 (PicnicBasketDefenseWithStones_fla.mc_score_120)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_score_120 extends MovieClip {
public var score_txt:TextField;
}
}//package PicnicBasketDefenseWithStones_fla
Section 53
//mc_Sell_54 (PicnicBasketDefenseWithStones_fla.mc_Sell_54)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_Sell_54 extends MovieClip {
public var sell_txt:TextField;
public var loader:MovieClip;
}
}//package PicnicBasketDefenseWithStones_fla
Section 54
//mc_shugar_turret_75 (PicnicBasketDefenseWithStones_fla.mc_shugar_turret_75)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
public dynamic class mc_shugar_turret_75 extends MovieClip {
public var mc_attack:MovieClip;
public var mc_destr:MovieClip;
}
}//package PicnicBasketDefenseWithStones_fla
Section 55
//mc_stones_2 (PicnicBasketDefenseWithStones_fla.mc_stones_2)
package PicnicBasketDefenseWithStones_fla {
import flash.events.*;
import flash.display.*;
public dynamic class mc_stones_2 extends MovieClip {
public var stonesHitarea_mc:MovieClip;
public var play_btn:SimpleButton;
public function mc_stones_2(){
addFrameScript(78, frame79);
}
function frame79(){
stop();
play_btn.addEventListener(MouseEvent.CLICK, onPlayButton);
}
public function onPlayButton(_arg1:Event){
play_btn.dispatchEvent(new Event("onPlayBtn"));
}
}
}//package PicnicBasketDefenseWithStones_fla
Section 56
//mc_SugarBuy_51 (PicnicBasketDefenseWithStones_fla.mc_SugarBuy_51)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_SugarBuy_51 extends MovieClip {
public var turret_range:TextField;
public var turret_dmg:TextField;
public var turret_cost:TextField;
public var turret_rate:TextField;
public var turret_defense:TextField;
}
}//package PicnicBasketDefenseWithStones_fla
Section 57
//mc_SugarUpg_45 (PicnicBasketDefenseWithStones_fla.mc_SugarUpg_45)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_SugarUpg_45 extends MovieClip {
public var turret_rate_upg:TextField;
public var mc_upg_graph:MovieClip;
public var turret_dmg_upg:TextField;
public var turret_cost_upg:TextField;
public var turret_range:TextField;
public var remove_btn:SimpleButton;
public var turret_dmg:TextField;
public var turret_range_upg:TextField;
public var turret_cost:TextField;
public var upg_btn:SimpleButton;
public var turretName_txt:TextField;
public var turret_rate:TextField;
public var turret_defense_upg:TextField;
public var turret_defense:TextField;
}
}//package PicnicBasketDefenseWithStones_fla
Section 58
//mc_toothpick_turret_73 (PicnicBasketDefenseWithStones_fla.mc_toothpick_turret_73)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
public dynamic class mc_toothpick_turret_73 extends MovieClip {
public var mc_attack:MovieClip;
public var mc_destr:MovieClip;
public function mc_toothpick_turret_73(){
addFrameScript(18, frame19, 30, frame31);
}
function frame19(){
stop();
}
function frame31(){
gotoAndStop(1);
}
}
}//package PicnicBasketDefenseWithStones_fla
Section 59
//mc_ToothpickBuy_52 (PicnicBasketDefenseWithStones_fla.mc_ToothpickBuy_52)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_ToothpickBuy_52 extends MovieClip {
public var turret_range:TextField;
public var turret_dmg:TextField;
public var turret_cost:TextField;
public var turret_rate:TextField;
public var turret_defense:TextField;
}
}//package PicnicBasketDefenseWithStones_fla
Section 60
//mc_ToothpickUpg_46 (PicnicBasketDefenseWithStones_fla.mc_ToothpickUpg_46)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_ToothpickUpg_46 extends MovieClip {
public var turret_rate_upg:TextField;
public var mc_upg_graph:MovieClip;
public var turret_dmg_upg:TextField;
public var turret_cost_upg:TextField;
public var turret_range:TextField;
public var remove_btn:SimpleButton;
public var turret_dmg:TextField;
public var turret_range_upg:TextField;
public var turret_cost:TextField;
public var upg_btn:SimpleButton;
public var turretName_txt:TextField;
public var turret_rate:TextField;
public var turret_defense_upg:TextField;
public var turret_defense:TextField;
}
}//package PicnicBasketDefenseWithStones_fla
Section 61
//mc_update_65 (PicnicBasketDefenseWithStones_fla.mc_update_65)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
public dynamic class mc_update_65 extends MovieClip {
public function mc_update_65(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PicnicBasketDefenseWithStones_fla
Section 62
//mcRepair_56 (PicnicBasketDefenseWithStones_fla.mcRepair_56)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
public dynamic class mcRepair_56 extends MovieClip {
public var loader:MovieClip;
}
}//package PicnicBasketDefenseWithStones_fla
Section 63
//mustardBuyMenu_47 (PicnicBasketDefenseWithStones_fla.mustardBuyMenu_47)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mustardBuyMenu_47 extends MovieClip {
public var turret_range:TextField;
public var turret_dmg:TextField;
public var turret_cost:TextField;
public var turret_rate:TextField;
public var turret_defense:TextField;
}
}//package PicnicBasketDefenseWithStones_fla
Section 64
//mustardUpgradeMenu_37 (PicnicBasketDefenseWithStones_fla.mustardUpgradeMenu_37)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mustardUpgradeMenu_37 extends MovieClip {
public var turret_rate_upg:TextField;
public var mc_upg_graph:MovieClip;
public var turret_dmg_upg:TextField;
public var turret_cost_upg:TextField;
public var turret_range:TextField;
public var remove_btn:SimpleButton;
public var turret_dmg:TextField;
public var turret_range_upg:TextField;
public var turret_cost:TextField;
public var upg_btn:SimpleButton;
public var turretName_txt:TextField;
public var turret_rate:TextField;
public var turret_defense_upg:TextField;
public var turret_defense:TextField;
}
}//package PicnicBasketDefenseWithStones_fla
Section 65
//stones_1 (PicnicBasketDefenseWithStones_fla.stones_1)
package PicnicBasketDefenseWithStones_fla {
import flash.display.*;
public dynamic class stones_1 extends MovieClip {
public var stones_mc:MovieClip;
}
}//package PicnicBasketDefenseWithStones_fla
Section 66
//AntStandart (AntStandart)
package {
import flash.display.*;
public dynamic class AntStandart extends MovieClip {
}
}//package
Section 67
//BonusRescuedSound (BonusRescuedSound)
package {
import flash.media.*;
public dynamic class BonusRescuedSound extends Sound {
}
}//package
Section 68
//BuildingSound (BuildingSound)
package {
import flash.media.*;
public dynamic class BuildingSound extends Sound {
}
}//package
Section 69
//ButtonClicSound (ButtonClicSound)
package {
import flash.media.*;
public dynamic class ButtonClicSound extends Sound {
}
}//package
Section 70
//DestroyStationSound (DestroyStationSound)
package {
import flash.media.*;
public dynamic class DestroyStationSound extends Sound {
}
}//package
Section 71
//EmptyTile (EmptyTile)
package {
import flash.display.*;
public dynamic class EmptyTile extends MovieClip {
}
}//package
Section 72
//EnemyEnters10Sound (EnemyEnters10Sound)
package {
import flash.media.*;
public dynamic class EnemyEnters10Sound extends Sound {
}
}//package
Section 73
//EnemyEnters11Sound (EnemyEnters11Sound)
package {
import flash.media.*;
public dynamic class EnemyEnters11Sound extends Sound {
}
}//package
Section 74
//EnemyEnters12Sound (EnemyEnters12Sound)
package {
import flash.media.*;
public dynamic class EnemyEnters12Sound extends Sound {
}
}//package
Section 75
//EnemyEnters13Sound (EnemyEnters13Sound)
package {
import flash.media.*;
public dynamic class EnemyEnters13Sound extends Sound {
}
}//package
Section 76
//EnemyEnters1Sound (EnemyEnters1Sound)
package {
import flash.media.*;
public dynamic class EnemyEnters1Sound extends Sound {
}
}//package
Section 77
//EnemyEnters2Sound (EnemyEnters2Sound)
package {
import flash.media.*;
public dynamic class EnemyEnters2Sound extends Sound {
}
}//package
Section 78
//EnemyEnters3Sound (EnemyEnters3Sound)
package {
import flash.media.*;
public dynamic class EnemyEnters3Sound extends Sound {
}
}//package
Section 79
//EnemyEnters4Sound (EnemyEnters4Sound)
package {
import flash.media.*;
public dynamic class EnemyEnters4Sound extends Sound {
}
}//package
Section 80
//EnemyEnters5Sound (EnemyEnters5Sound)
package {
import flash.media.*;
public dynamic class EnemyEnters5Sound extends Sound {
}
}//package
Section 81
//EnemyEnters6Sound (EnemyEnters6Sound)
package {
import flash.media.*;
public dynamic class EnemyEnters6Sound extends Sound {
}
}//package
Section 82
//EnemyEnters7Sound (EnemyEnters7Sound)
package {
import flash.media.*;
public dynamic class EnemyEnters7Sound extends Sound {
}
}//package
Section 83
//EnemyEnters8Sound (EnemyEnters8Sound)
package {
import flash.media.*;
public dynamic class EnemyEnters8Sound extends Sound {
}
}//package
Section 84
//EnemyEnters9Sound (EnemyEnters9Sound)
package {
import flash.media.*;
public dynamic class EnemyEnters9Sound extends Sound {
}
}//package
Section 85
//HoneyFire1Sound (HoneyFire1Sound)
package {
import flash.media.*;
public dynamic class HoneyFire1Sound extends Sound {
}
}//package
Section 86
//HoneyFire2Sound (HoneyFire2Sound)
package {
import flash.media.*;
public dynamic class HoneyFire2Sound extends Sound {
}
}//package
Section 87
//HoneyFire3Sound (HoneyFire3Sound)
package {
import flash.media.*;
public dynamic class HoneyFire3Sound extends Sound {
}
}//package
Section 88
//KetchupFire1Sound (KetchupFire1Sound)
package {
import flash.media.*;
public dynamic class KetchupFire1Sound extends Sound {
}
}//package
Section 89
//KetchupFire2Sound (KetchupFire2Sound)
package {
import flash.media.*;
public dynamic class KetchupFire2Sound extends Sound {
}
}//package
Section 90
//KetchupFire3Sound (KetchupFire3Sound)
package {
import flash.media.*;
public dynamic class KetchupFire3Sound extends Sound {
}
}//package
Section 91
//Kill10MonsterSound (Kill10MonsterSound)
package {
import flash.media.*;
public dynamic class Kill10MonsterSound extends Sound {
}
}//package
Section 92
//Kill11MonsterSound (Kill11MonsterSound)
package {
import flash.media.*;
public dynamic class Kill11MonsterSound extends Sound {
}
}//package
Section 93
//Kill12MonsterSound (Kill12MonsterSound)
package {
import flash.media.*;
public dynamic class Kill12MonsterSound extends Sound {
}
}//package
Section 94
//Kill13MonsterSound (Kill13MonsterSound)
package {
import flash.media.*;
public dynamic class Kill13MonsterSound extends Sound {
}
}//package
Section 95
//Kill14MonsterSound (Kill14MonsterSound)
package {
import flash.media.*;
public dynamic class Kill14MonsterSound extends Sound {
}
}//package
Section 96
//Kill15MonsterSound (Kill15MonsterSound)
package {
import flash.media.*;
public dynamic class Kill15MonsterSound extends Sound {
}
}//package
Section 97
//Kill16MonsterSound (Kill16MonsterSound)
package {
import flash.media.*;
public dynamic class Kill16MonsterSound extends Sound {
}
}//package
Section 98
//Kill17MonsterSound (Kill17MonsterSound)
package {
import flash.media.*;
public dynamic class Kill17MonsterSound extends Sound {
}
}//package
Section 99
//Kill18MonsterSound (Kill18MonsterSound)
package {
import flash.media.*;
public dynamic class Kill18MonsterSound extends Sound {
}
}//package
Section 100
//Kill19MonsterSound (Kill19MonsterSound)
package {
import flash.media.*;
public dynamic class Kill19MonsterSound extends Sound {
}
}//package
Section 101
//Kill1MonsterSound (Kill1MonsterSound)
package {
import flash.media.*;
public dynamic class Kill1MonsterSound extends Sound {
}
}//package
Section 102
//Kill20MonsterSound (Kill20MonsterSound)
package {
import flash.media.*;
public dynamic class Kill20MonsterSound extends Sound {
}
}//package
Section 103
//Kill21MonsterSound (Kill21MonsterSound)
package {
import flash.media.*;
public dynamic class Kill21MonsterSound extends Sound {
}
}//package
Section 104
//Kill22MonsterSound (Kill22MonsterSound)
package {
import flash.media.*;
public dynamic class Kill22MonsterSound extends Sound {
}
}//package
Section 105
//Kill2MonsterSound (Kill2MonsterSound)
package {
import flash.media.*;
public dynamic class Kill2MonsterSound extends Sound {
}
}//package
Section 106
//Kill3MonsterSound (Kill3MonsterSound)
package {
import flash.media.*;
public dynamic class Kill3MonsterSound extends Sound {
}
}//package
Section 107
//Kill4MonsterSound (Kill4MonsterSound)
package {
import flash.media.*;
public dynamic class Kill4MonsterSound extends Sound {
}
}//package
Section 108
//Kill5MonsterSound (Kill5MonsterSound)
package {
import flash.media.*;
public dynamic class Kill5MonsterSound extends Sound {
}
}//package
Section 109
//Kill6MonsterSound (Kill6MonsterSound)
package {
import flash.media.*;
public dynamic class Kill6MonsterSound extends Sound {
}
}//package
Section 110
//Kill7MonsterSound (Kill7MonsterSound)
package {
import flash.media.*;
public dynamic class Kill7MonsterSound extends Sound {
}
}//package
Section 111
//Kill8MonsterSound (Kill8MonsterSound)
package {
import flash.media.*;
public dynamic class Kill8MonsterSound extends Sound {
}
}//package
Section 112
//Kill9MonsterSound (Kill9MonsterSound)
package {
import flash.media.*;
public dynamic class Kill9MonsterSound extends Sound {
}
}//package
Section 113
//LastLevelCompleteSound (LastLevelCompleteSound)
package {
import flash.media.*;
public dynamic class LastLevelCompleteSound extends Sound {
}
}//package
Section 114
//LevelCompleteSound (LevelCompleteSound)
package {
import flash.media.*;
public dynamic class LevelCompleteSound extends Sound {
}
}//package
Section 115
//LostAntSound (LostAntSound)
package {
import flash.media.*;
public dynamic class LostAntSound extends Sound {
}
}//package
Section 116
//Main (Main)
package {
import com.xitexsoftware.gamepack.*;
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import com.xitexsoftware.gamepack.turets.*;
import com.xitexsoftware.gamepack.monsters.*;
import flash.net.*;
public class Main extends MovieClip {
private const levelTime = 300;
private var levelTimer:Timer;
private var bonus:Bonus;
private var totalTime:Number;
private var timeOther:int;
public var visibleLevelsArray:Array;
public var mygame_but:MovieClip;
private var turretLevel:MovieClip;
private var turretNum:int;// = 0
private var bulletArray:Array;
public var mc_intro:MovieClip;
private var _lastLevelCompleteSound:LastLevelCompleteSound;
private var _lostAntSound:LostAntSound;
public var _map:Map;
private var colWave:int;
private var curLevelMonType:String;
public var monArray:Array;
private var money:int;// = 200
private var totalKill:int;
private var _buildingSound:BuildingSound;
private var _levelCompleteSound:LevelCompleteSound;
private var _soundChannel:SoundChannel;
private var monNum:int;// = 0
private var waveArray:Array;
public var showedLevels:int;
private var turObjArray:Array;
private var myTimer:Timer;
public var lastGameType:String;
private var lives:int;// = 20
public var mc_gui:McGui;
private var _picnicGameEndSound:PicnicGameEndSound;
private var bulletNum:int;// = 0
private var levelArray:Array;
public var sellTime:int;// = 10
public var curentActiveArray:Array;
private var turretArray:Array;
private var timeBonus:Number;
private var _tadeComlete:Boolean;
private var smeshX:int;// = -14
private var smeshY:int;// = 28
private var timeInner:int;
private var currentLevel:int;// = 0
private var bulletLevel:MovieClip;
public var monsterToPass:int;
private var turObjPR;
private var bonusScore:int;
private var _startLevelSound:StartLevelSound;
private var monLevel:MovieClip;
private var pause:Boolean;// = false
public static var _bonus:Bonus;
public static var self:Main;
private static var score:int = 0;
public function Main():void{
var loader:URLLoader;
var variables:URLVariables;
var request:URLRequest;
levelArray = [{name:"ants_small", amm:1, rep:0, boses:false}, {name:"ants_small", amm:1, rep:10, boses:false}, {name:"ants", amm:1, rep:10, boses:false}, {name:"ant_african", amm:1, rep:10, boses:false}, {name:"burrowers", amm:1, rep:10, boses:false}, {name:"ant_big", amm:1, rep:10, boses:false}, {name:"soldier_ant", amm:3, rep:1, boses:false}, {name:"ant_winged", amm:1, rep:10, boses:false}, {name:"piss_ant", amm:1, rep:10, boses:false}, {name:"fire_ant", amm:1, rep:10, boses:false}, {name:"termite", amm:1, rep:10, boses:false}, {name:"queen_ant", amm:1, rep:1, boses:false}, {name:"queen_termite", amm:1, rep:1, boses:false}];
monNum = 0;
turretNum = 0;
bulletNum = 0;
smeshX = -14;
smeshY = 28;
sellTime = 10;
pause = false;
money = 200;
lives = 20;
currentLevel = 0;
visibleLevelsArray = new Array();
curentActiveArray = new Array();
showedLevels = new int();
super();
loader = new URLLoader();
loader.addEventListener(Event.COMPLETE, completeHandler);
variables = new URLVariables();
variables.game = "PicnicBasketDefense";
variables.from = root.loaderInfo.url;
trace(root.loaderInfo.loaderURL);
request = new URLRequest("http://mygame.com/loadcount.jsp");
request.data = variables;
try {
loader.load(request);
} catch(error:Error) {
trace("Unable to load requested document.");
};
mc_intro.stones_mc.play_btn.addEventListener("onPlayBtn", launchGame);
mc_intro.stones_mc.stonesHitarea_mc.buttonMode = true;
mc_intro.stones_mc.stonesHitarea_mc.addEventListener(MouseEvent.CLICK, onStones);
}
public function onPauseMenuBtnClick(_arg1:Event){
this.onPlayBtnClick(new MouseEvent("evt"));
this.stopGame(true);
this.mc_gui.start_btn.removeEventListener(MouseEvent.CLICK, Main.self.onStartBtnClick);
this.mc_gui.pause_btn.removeEventListener(MouseEvent.CLICK, this.onPauseBtnClick);
this.mc_gui.mc_pause.play_btn.removeEventListener(MouseEvent.CLICK, this.onPlayBtnClick);
this.mc_gui.mc_pause.menu_btn.removeEventListener(MouseEvent.CLICK, this.onPauseMenuBtnClick);
this.mc_gui.menu_btn.removeEventListener(MouseEvent.CLICK, this.onMenuBtnClick);
this.mc_gui.mc_end.mc_end.end_menu_btn.removeEventListener(MouseEvent.CLICK, this.onMenuBtnClick);
this.mc_gui.mc_end.mcEndOver.end_menu_btn.removeEventListener(MouseEvent.CLICK, this.onMenuBtnClick);
this.mc_gui.mc_start.visible = true;
Main.self.mc_gui.mc_mygame_but.y = 495;
this.mc_gui.mc_end.visible = false;
this.mc_gui.mc_end.mc_end.visible = false;
this.mc_gui.mc_end.mcEndOver.visible = false;
}
private function updateVisibleLevels(){
var _local1:MovieClip;
var _local2:Boolean;
if (showedLevels == 0){
_local1 = new mc_ant_first_block();
_local1.bg.visible = false;
_local1.mc_line.visible = false;
this.mc_gui.addChild(_local1);
_local1.x = ((visibleLevelsArray.length * 104) + (5 * visibleLevelsArray.length));
_local1.y = 533;
visibleLevelsArray.push(_local1);
showedLevels++;
};
_local2 = true;
while ((((visibleLevelsArray.length < 10)) && (_local2))) {
if (levelArray.length > showedLevels){
_local1 = new mc_ant_block();
_local1.gotoAndStop(levelArray[showedLevels].name);
switch (String(levelArray[showedLevels].name)){
case "ants_small":
_local1.wave_name.text = ((String(showedLevels) + ". ") + "SMALL TERMITE");
break;
case "burrowers":
_local1.wave_name.text = ((String(showedLevels) + ". ") + "BURROWERS");
break;
case "ants":
_local1.wave_name.text = ((String(showedLevels) + ". ") + "ANT");
break;
case "ant_african":
_local1.wave_name.text = ((String(showedLevels) + ". ") + "ANT AFRICAN");
break;
case "ant_big":
_local1.wave_name.text = ((String(showedLevels) + ". ") + "ANT BIG");
break;
case "ant_winged":
_local1.wave_name.text = ((String(showedLevels) + ". ") + "ANT WINGED");
break;
case "queen_ant":
_local1.wave_name.text = ((String(showedLevels) + ". ") + "QUEEN ANT");
break;
case "soldier_ant":
_local1.wave_name.text = ((String(showedLevels) + ". ") + "SOLDIER ANT");
break;
case "piss_ant":
_local1.wave_name.text = ((String(showedLevels) + ". ") + "PISS ANT");
break;
case "fire_ant":
_local1.wave_name.text = ((String(showedLevels) + ". ") + "FIRE ANT");
break;
case "termite":
_local1.wave_name.text = ((String(showedLevels) + ". ") + "TERMITE");
break;
case "queen_termite":
_local1.wave_name.text = ((String(showedLevels) + ". ") + "QUEEN TERMITE");
break;
};
this.mc_gui.addChild(_local1);
_local1.x = ((visibleLevelsArray.length * 104) + (5 * visibleLevelsArray.length));
_local1.y = 533;
_local1.bg.visible = false;
_local1.mc_line.visible = false;
visibleLevelsArray.push(_local1);
showedLevels++;
} else {
_local2 = false;
};
};
}
public function beginGame(){
trace("begin game");
mc_intro.visible = false;
new XMLData();
Main.self = this;
init();
mc_gui = new McGui();
trace(root.loaderInfo.loaderURL.slice(0, 4));
if (root.loaderInfo.loaderURL.slice(0, 4) != "http"){
mc_gui.mc_offline.visible = true;
};
waveArray = new Array();
mc_gui.time_txt.text = String(levelTime);
_map = new Map();
_map.x = (_map.x + smeshX);
_map.y = (_map.y + smeshY);
mygame_but.addEventListener(MouseEvent.CLICK, onMyGameButtonClick);
_map.addEventListener("onTuretSet", onTuretSet);
_map.addEventListener("onTurretSelect", onTurretSelected);
mc_gui.addEventListener("onReplayGame", onReplayGame);
mc_gui.addEventListener("onMustardButtonClick", onMustardButtonClick);
mc_gui.addEventListener("onHoneyButtonClick", onHoneyButtonClick);
mc_gui.addEventListener("onKetchupButtonClick", onKetchupButtonClick);
mc_gui.addEventListener("onPepperButtonClick", onPepperButtonClick);
mc_gui.addEventListener("onSugarButtonClick", onSugarButtonClick);
mc_gui.addEventListener("onToothpickButtonClick", onToothpickButtonClick);
mc_gui.addEventListener("onTurretDeselect", onTurretDeselect);
this.addEventListener(Event.ENTER_FRAME, loopEvent);
_map.turetSet = "none";
_map.turetSetType = "none";
this.timeInner = 0;
this._startLevelSound = new StartLevelSound();
_tadeComlete = false;
this._levelCompleteSound = new LevelCompleteSound();
this._buildingSound = new BuildingSound();
this._lostAntSound = new LostAntSound();
this._picnicGameEndSound = new PicnicGameEndSound();
this._lastLevelCompleteSound = new LastLevelCompleteSound();
_soundChannel = new SoundChannel();
turObjArray = new Array();
colWave = 1;
onMapLoaded();
}
function launchGame(_arg1:Event){
beginGame();
}
private function playSound(_arg1:String){
switch (_arg1){
case "ants":
new EnemyEnters2Sound().play();
break;
case "ant_african":
new EnemyEnters3Sound().play();
break;
case "burrowers":
new EnemyEnters4Sound().play();
break;
case "ant_big":
new EnemyEnters5Sound().play();
break;
case "ants_small":
new EnemyEnters10Sound().play();
break;
case "soldier_ant":
new EnemyEnters6Sound().play();
break;
case "ant_winged":
new EnemyEnters7Sound().play();
break;
case "piss_ant":
new EnemyEnters8Sound().play();
break;
case "fire_ant":
new EnemyEnters9Sound().play();
break;
case "termite":
new EnemyEnters10Sound().play();
break;
case "queen_ant":
new EnemyEnters11Sound().play();
break;
case "queen_termite":
new EnemyEnters12Sound().play();
break;
};
}
private function loopEvent(_arg1:Event){
mc_gui.coins_txt.text = String(money);
mc_gui.lives_txt.text = String(lives);
mc_gui.score_txt.text = String(score);
}
private function onSugarButtonClick(_arg1:Event){
var _local2:*;
_map.removeTuretSet();
_map.turetSet = "sugar";
_map.turetSetType = "sugar";
_map.addSetTurret();
mc_gui[(("mc_" + _map.turetSetType) + "_button")].gotoAndStop(String((_map.turetSetType + "_Yes")));
if (_map.selectedTurret != null){
_map.selectedTurret.hideRadius();
_map.selectedTurret.totGraph.gotoAndStop((_map.selectedTurret.type + " N"));
for (_local2 in turretArray) {
turretArray[_local2].totGraph.mc_sugar_effect.visible = false;
};
_map.selectedTurret = null;
};
}
private function onKetchupButtonClick(_arg1:Event){
var _local2:*;
_map.removeTuretSet();
_map.turetSet = "ketchup";
_map.turetSetType = "ketchup";
_map.addSetTurret();
mc_gui[(("mc_" + _map.turetSetType) + "_button")].gotoAndStop(String((_map.turetSetType + "_Yes")));
if (_map.selectedTurret != null){
_map.selectedTurret.hideRadius();
_map.selectedTurret.totGraph.gotoAndStop((_map.selectedTurret.type + " N"));
for (_local2 in turretArray) {
turretArray[_local2].totGraph.mc_sugar_effect.visible = false;
};
_map.selectedTurret = null;
};
}
public function onMenuBtnClick(_arg1:Event){
if (this._tadeComlete){
this._soundChannel.stop();
};
this.stopGame(true);
this.mc_gui.start_btn.removeEventListener(MouseEvent.CLICK, Main.self.onStartBtnClick);
this.mc_gui.pause_btn.removeEventListener(MouseEvent.CLICK, this.onPauseBtnClick);
this.mc_gui.mc_pause.play_btn.removeEventListener(MouseEvent.CLICK, this.onPlayBtnClick);
this.mc_gui.mc_pause.menu_btn.removeEventListener(MouseEvent.CLICK, this.onPauseMenuBtnClick);
this.mc_gui.menu_btn.removeEventListener(MouseEvent.CLICK, this.onMenuBtnClick);
this.mc_gui.mc_end.mc_end.end_menu_btn.removeEventListener(MouseEvent.CLICK, this.onMenuBtnClick);
this.mc_gui.mc_end.mcEndOver.end_menu_btn.removeEventListener(MouseEvent.CLICK, this.onMenuBtnClick);
this.mc_gui.mc_start.visible = true;
Main.self.mc_gui.mc_mygame_but.y = 495;
this.mc_gui.mc_end.visible = false;
this.mc_gui.mc_end.mc_end.visible = false;
this.mc_gui.mc_end.mcEndOver.visible = false;
}
private function nextWave():void{
checkAndUpdateActiveLevels();
updateVisibleLevels();
addCurrentLevels();
if (currentLevel < levelArray.length){
if (currentLevel != 0){
addBonus();
this._startLevelSound.play();
};
playSound(levelArray[currentLevel].name);
} else {
if (this.monsterToPass == 0){
if (visibleLevelsArray.length == 0){
this.mc_gui.time_txt.text = "30";
this.stopGame(false);
this._soundChannel = this._picnicGameEndSound.play(0, 10000);
_tadeComlete = true;
this.mc_gui.mc_end.visible = true;
Main.self.mc_gui.mc_mygame_but.y = 495;
this.mc_gui.mc_end.mc_end.visible = false;
this.mc_gui.mc_end.mcEndOver.visible = true;
this.mc_gui.mc_end.mcEndOver.tot_score.text = String(Main.score);
this.mc_gui.mc_end.mcEndOver.tot_lvl.text = String((this.currentLevel - 1));
this.mc_gui.mc_end.mcEndOver.tot_kill.text = String(this.totalKill);
this.mc_gui.mc_end.mcEndOver.Bmoney.text = String(this.money);
this.mc_gui.mc_end.mcEndOver.Btime.text = String(Math.round(((timeBonus / totalTime) * 10000)));
this.mc_gui.mc_end.mcEndOver.total_score.text = String(((Math.round(((timeBonus / totalTime) * 10000)) + this.money) + Main.score));
};
};
};
}
private function addSoldierAnt(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:Boolean, _arg6:int){
var _local7:*;
_local7 = 0;
while (_local7 < _arg1) {
monArray[("mon_" + monNum)] = new SoldierAnt(new McAntSoldier(), (17 + Math.floor((Math.random() * 6))), 1, _map, ("mon_" + monNum), 0, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
monArray[("mon_" + monNum)] = new SoldierAnt(new McAntSoldier(), 1, (16 + Math.floor((Math.random() * 5))), _map, ("mon_" + monNum), 1, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
_local7++;
};
}
public function onMyGameButtonClick(_arg1:MouseEvent){
var _local2:URLVariables;
var _local3:URLRequest;
_local2 = new URLVariables();
_local2.game = "PicnicBasketDefense";
_local2.from = root.loaderInfo.url;
_local2.typ = "sign";
_local3 = new URLRequest("http://www.mygame.com/bounce.jsp");
_local3.data = _local2;
navigateToURL(_local3, "_blank");
}
private function onTuretSet(_arg1:Event):void{
var _local2:Number;
this._buildingSound.play();
makeChanges();
_local2 = XMLData.self.getTurretLevel(_map.turetSetType, 1).cost;
switch (_map.turetSetType){
case "honey":
if (money >= _local2){
this.turretArray[("turret_" + turretNum)] = new Honey(new McHoney(), ("turret_" + turretNum), _map, this._map.turetSetCoord.x, this._map.turetSetCoord.y);
this.turretArray[("turret_" + turretNum)].x = ((this._map.turetSetCoord.x * this._map.tileSize) + smeshX);
this.turretArray[("turret_" + turretNum)].y = ((this._map.turetSetCoord.y * this._map.tileSize) + smeshY);
this.turretLevel.addChild(this.turretArray[("turret_" + turretNum)]);
money = (money - _local2);
};
break;
case "mustard":
if (money >= _local2){
this.turretArray[("turret_" + turretNum)] = new Mustard(new McMustard(), ("turret_" + turretNum), _map, this._map.turetSetCoord.x, this._map.turetSetCoord.y);
this.turretArray[("turret_" + turretNum)].x = ((this._map.turetSetCoord.x * this._map.tileSize) + smeshX);
this.turretArray[("turret_" + turretNum)].y = ((this._map.turetSetCoord.y * this._map.tileSize) + smeshY);
this.turretLevel.addChild(this.turretArray[("turret_" + turretNum)]);
money = (money - _local2);
};
break;
case "ketchup":
if (money >= _local2){
this.turretArray[("turret_" + turretNum)] = new Ketchup(new McKetchup(), ("turret_" + turretNum), _map, this._map.turetSetCoord.x, this._map.turetSetCoord.y);
this.turretArray[("turret_" + turretNum)].x = ((this._map.turetSetCoord.x * this._map.tileSize) + smeshX);
this.turretArray[("turret_" + turretNum)].y = ((this._map.turetSetCoord.y * this._map.tileSize) + smeshY);
this.turretLevel.addChild(this.turretArray[("turret_" + turretNum)]);
money = (money - _local2);
};
break;
case "pepper":
if (money >= _local2){
this.turretArray[("turret_" + turretNum)] = new Pepper(new McPepper(), ("turret_" + turretNum), _map, this._map.turetSetCoord.x, this._map.turetSetCoord.y);
this.turretArray[("turret_" + turretNum)].x = ((this._map.turetSetCoord.x * this._map.tileSize) + smeshX);
this.turretArray[("turret_" + turretNum)].y = ((this._map.turetSetCoord.y * this._map.tileSize) + smeshY);
this.turretLevel.addChild(this.turretArray[("turret_" + turretNum)]);
money = (money - _local2);
};
break;
case "sugar":
if (money >= _local2){
this.turretArray[("turret_" + turretNum)] = new Sugar(new McSugar(), ("turret_" + turretNum), _map, this._map.turetSetCoord.x, this._map.turetSetCoord.y);
this.turretArray[("turret_" + turretNum)].x = ((this._map.turetSetCoord.x * this._map.tileSize) + smeshX);
this.turretArray[("turret_" + turretNum)].y = ((this._map.turetSetCoord.y * this._map.tileSize) + smeshY);
this.turretLevel.addChild(this.turretArray[("turret_" + turretNum)]);
this.turretArray[("turret_" + turretNum)].setBonus();
money = (money - _local2);
};
break;
case "toothpick":
if (money >= _local2){
this.turretArray[("turret_" + turretNum)] = new Toothpick(new McToothpick(), ("turret_" + turretNum), _map, this._map.turetSetCoord.x, this._map.turetSetCoord.y);
this.turretArray[("turret_" + turretNum)].x = ((this._map.turetSetCoord.x * this._map.tileSize) + smeshX);
this.turretArray[("turret_" + turretNum)].y = ((this._map.turetSetCoord.y * this._map.tileSize) + smeshY);
this.turretLevel.addChild(this.turretArray[("turret_" + turretNum)]);
money = (money - _local2);
};
break;
};
if (this.turretArray[("turret_" + turretNum)] != undefined){
this.turretArray[("turret_" + turretNum)].addEventListener("onTurretDestroyed", onTurretDestroyed);
this.turretArray[("turret_" + turretNum)].addEventListener("onTurretSeled", onTuretSelled);
turretNum++;
};
}
private function onTuretSelled(_arg1:Event){
var _local2:*;
if (_arg1.currentTarget.type == "sugar"){
for (_local2 in turretArray) {
turretArray[_local2].totGraph.mc_sugar_effect.visible = false;
};
};
mc_gui.removeTurretProgress(_arg1.currentTarget);
this.money = (this.money + Math.round((_arg1.currentTarget.price * 0.5)));
this.turretLevel.removeChild(turretArray[_arg1.currentTarget.turName]);
this._map.removeTurret(_arg1.currentTarget.coord);
turretArray[_arg1.currentTarget.turName].clear();
turretArray[_arg1.currentTarget.turName].removeEventListener("onTurretSeled", onTuretSelled);
turretArray[_arg1.currentTarget.turName].removeEventListener("onTurretDestroyed", onTurretDestroyed);
Main.self.makeChanges();
delete turretArray[_arg1.currentTarget.turName];
}
private function clearAllVisibleLevels(){
var _local1:int;
var _local2:int;
monsterToPass = 0;
_local1 = 0;
while (_local1 < visibleLevelsArray.length) {
mc_gui.removeChild(visibleLevelsArray[_local1]);
delete visibleLevelsArray[_local1];
_local1++;
};
_local2 = 0;
while (_local2 < curentActiveArray.length) {
delete curentActiveArray[_local2];
_local2++;
};
visibleLevelsArray = new Array();
curentActiveArray = new Array();
}
private function addAntAfrican(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:Boolean, _arg6:int){
var _local7:*;
_local7 = 0;
while (_local7 < _arg1) {
monArray[("mon_" + monNum)] = new AntAfrican(new McAntAfrican(), (17 + Math.floor((Math.random() * 6))), 1, _map, ("mon_" + monNum), 0, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
monArray[("mon_" + monNum)] = new AntAfrican(new McAntAfrican(), 1, (16 + Math.floor((Math.random() * 5))), _map, ("mon_" + monNum), 1, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
_local7++;
};
}
private function addTermite(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:Boolean, _arg6:int){
var _local7:*;
_local7 = 0;
while (_local7 < _arg1) {
monArray[("mon_" + monNum)] = new Termite(new McTermite(), (17 + Math.floor((Math.random() * 6))), 1, _map, ("mon_" + monNum), 0, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
monArray[("mon_" + monNum)] = new Termite(new McTermite(), 1, (16 + Math.floor((Math.random() * 5))), _map, ("mon_" + monNum), 1, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
_local7++;
};
}
private function addBigAnt(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:Boolean, _arg6:int){
var _local7:*;
_local7 = 0;
while (_local7 < _arg1) {
monArray[("mon_" + monNum)] = new AntBig(new McAntBig(), (17 + Math.floor((Math.random() * 6))), 1, _map, ("mon_" + monNum), 0, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
monArray[("mon_" + monNum)] = new AntBig(new McAntBig(), 1, (16 + Math.floor((Math.random() * 5))), _map, ("mon_" + monNum), 1, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
_local7++;
};
}
private function addBurrowers(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:Boolean, _arg6:int){
var _local7:*;
_local7 = 0;
while (_local7 < _arg1) {
monArray[("mon_" + monNum)] = new Burrower(new McBurrowers(), (17 + Math.floor((Math.random() * 6))), 1, _map, ("mon_" + monNum), 0, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
monArray[("mon_" + monNum)] = new Burrower(new McBurrowers(), 1, (16 + Math.floor((Math.random() * 5))), _map, ("mon_" + monNum), 1, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
_local7++;
};
}
public function makeChanges(){
var _local1:*;
for (_local1 in monArray) {
monArray[_local1].changes = true;
};
}
private function init(){
monArray = new Array();
turretArray = new Array();
bulletArray = new Array();
turretLevel = new MovieClip();
monLevel = new MovieClip();
bulletLevel = new MovieClip();
}
private function stopGame(_arg1:Boolean){
var _local2:String;
_map.removeTuretSet();
clearAllVisibleLevels();
Main.self.mc_gui.menuHide(_arg1);
pause = false;
this.myTimer.stop();
this.levelTimer.stop();
this.waveArray = new Array();
for (_local2 in monArray) {
this.monLevel.removeChild(monArray[_local2]);
monArray[_local2].removeEventListener("onWayOut", onMonWayOut);
monArray[_local2].removeEventListener("onDeath", onDeath);
monArray[_local2].clear();
delete monArray[_local2];
};
for (_local2 in turretArray) {
this.turretLevel.removeChild(turretArray[_local2]);
turretArray[_local2].clear();
delete turretArray[_local2];
};
for (_local2 in bulletArray) {
bulletArray[_local2].clear();
bulletLevel.removeChild(bulletArray[_local2]);
delete bulletArray[_local2];
};
this.levelTimer.reset();
this.mc_gui.time_txt.text = "30";
Main.removeBonus();
_map.clearMap();
_map.handleComplete();
_map.showMap();
}
private function addAntWinged(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:Boolean, _arg6:int){
var _local7:*;
_local7 = 0;
while (_local7 < _arg1) {
monArray[("mon_" + monNum)] = new AntWinged(new McAntWinged(), (17 + Math.floor((Math.random() * 6))), 1, _map, ("mon_" + monNum), 0, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
monArray[("mon_" + monNum)] = new AntWinged(new McAntWinged(), 1, (16 + Math.floor((Math.random() * 5))), _map, ("mon_" + monNum), 1, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
_local7++;
};
}
public function getMoney():Boolean{
var _local1:*;
_local1 = _map.selectedTurret;
if (this.money >= (_local1.levels[_local1.level].price - _local1.price)){
this.money = (this.money - (_local1.levels[_local1.level].price - _local1.price));
return (true);
};
return (false);
}
private function onTurretDestroyed(_arg1:Event):void{
if (_map.selectedTurret != undefined){
if (turretArray[_arg1.currentTarget.turName].turName == _map.selectedTurret.turName){
this.mc_gui.mc_guiTowers.visible = false;
this.onTurretDeselect(new Event("event"));
};
};
mc_gui.removeTurretProgress(_arg1.currentTarget);
Main.self.makeChanges();
this.turretLevel.removeChild(turretArray[_arg1.currentTarget.turName]);
this._map.removeTurret(_arg1.currentTarget.coord);
turretArray[_arg1.currentTarget.turName].removeEventListener("onTurretSeled", onTuretSelled);
turretArray[_arg1.currentTarget.turName].removeEventListener("onTurretDestroyed", onTurretDestroyed);
turretArray[_arg1.currentTarget.turName].clear();
delete turretArray[_arg1.currentTarget.turName];
}
private function addPissAnt(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:Boolean, _arg6:int){
var _local7:*;
_local7 = 0;
while (_local7 < _arg1) {
monArray[("mon_" + monNum)] = new PissAnt(new McPissAnt(), (17 + Math.floor((Math.random() * 6))), 1, _map, ("mon_" + monNum), 0, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
monArray[("mon_" + monNum)] = new PissAnt(new McPissAnt(), 1, (16 + Math.floor((Math.random() * 5))), _map, ("mon_" + monNum), 1, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
_local7++;
};
}
public function onPauseBtnClick(_arg1:MouseEvent){
var _local2:String;
SoundMixer.soundTransform = new SoundTransform(0);
_local2 = new String();
this.pause = true;
mc_gui.mc_pause.visible = true;
this.levelTimer.stop();
this.myTimer.stop();
if (Main._bonus != null){
Main._bonus.pause();
};
for (_local2 in bulletArray) {
bulletArray[_local2].pause();
};
for (_local2 in monArray) {
monArray[_local2].pause();
};
for (_local2 in turretArray) {
turretArray[_local2].pause();
};
}
private function addCurrentLevels(){
var _local1:Object;
if ((((currentLevel < levelArray.length)) && ((curentActiveArray.length < 1)))){
_local1 = new Object();
_local1.levelNum = Number(currentLevel);
this.monsterToPass = (this.monsterToPass + ((Number(levelArray[currentLevel].amm) * Number(levelArray[currentLevel].rep)) * 2));
curentActiveArray.push(_local1);
waveArray.push(levelArray[currentLevel]);
visibleLevelsArray[(curentActiveArray.length - 1)].mc_line.gotoAndStop(1);
visibleLevelsArray[(curentActiveArray.length - 1)].mc_line.visible = true;
visibleLevelsArray[(curentActiveArray.length - 1)].bg.visible = true;
currentLevel++;
levelTimer.reset();
levelTimer.start();
} else {
levelTimer.reset();
levelTimer.start();
};
}
private function addSmallAnt(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:Boolean, _arg6:int){
var _local7:*;
_local7 = 0;
while (_local7 < _arg1) {
monArray[("mon_" + monNum)] = new AntSmall(new McAntSmall(), (17 + Math.floor((Math.random() * 6))), 1, _map, ("mon_" + monNum), 0, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
monArray[("mon_" + monNum)] = new AntSmall(new McAntSmall(), 1, (16 + Math.floor((Math.random() * 5))), _map, ("mon_" + monNum), 1, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
_local7++;
};
}
public function onUpgrade(_arg1){
_arg1.free = true;
mc_gui.removeTurretProgress(_arg1, false);
_arg1.price = _arg1.levels[_arg1.level].price;
_arg1.damage = _arg1.levels[_arg1.level].damage;
_arg1.fireRate = _arg1.levels[_arg1.level].fireRate;
_arg1.radius = _arg1.levels[_arg1.level].radius;
_arg1.defense = (_arg1.levels[_arg1.level].defense + (_arg1.defense - _arg1.baseDefense));
_arg1.baseDefense = _arg1.levels[_arg1.level].defense;
_arg1.turretName = _arg1.levels[_arg1.level].turretName;
_arg1.updateRadius();
_arg1.level++;
_arg1.totGraph.mc_update.gotoAndStop(_arg1.level);
if (_arg1.type == "sugar"){
_arg1.setBonus();
};
if (_arg1 == this._map.selectedTurret){
_arg1.showRadius();
setTuretGuiText(_arg1);
};
}
public function returnSellMoney(){
this.money = (this.money + Math.floor(this._map.selectedTurret.price));
}
private function onMonWayOut(_arg1:Event){
this._lostAntSound.play();
if (monArray[_arg1.currentTarget.monName].hasBonus == true){
Main.removeBonus();
};
this.monsterToPass--;
this.monLevel.removeChild(monArray[_arg1.currentTarget.monName]);
monArray[_arg1.currentTarget.monName].removeEventListener("onWayOut", onMonWayOut);
monArray[_arg1.currentTarget.monName].removeEventListener("onDeath", onDeath);
monArray[_arg1.currentTarget.monName].monsterVis = false;
monArray[_arg1.currentTarget.monName].clear();
monArray[_arg1.currentTarget.monName] = null;
delete monArray[_arg1.currentTarget.monName];
this.lives--;
if (lives == 0){
this._soundChannel = this._picnicGameEndSound.play(0, 10000);
_tadeComlete = true;
this.stopGame(false);
this.mc_gui.mc_end.visible = true;
Main.self.mc_gui.mc_mygame_but.y = 495;
this.mc_gui.mc_end.mc_end.visible = true;
this.addChild(mc_gui);
this.mc_gui.mc_end.mc_end.tot_score.text = String(Main.score);
this.mc_gui.mc_end.mc_end.tot_lvl.text = String((this.currentLevel - 1));
this.mc_gui.mc_end.mc_end.tot_kill.text = String(this.totalKill);
};
}
private function onToothpickButtonClick(_arg1:Event){
var _local2:*;
_map.removeTuretSet();
_map.turetSet = "toothpick";
_map.turetSetType = "toothpick";
mc_gui[(("mc_" + _map.turetSetType) + "_button")].gotoAndStop(String((_map.turetSetType + "_Yes")));
_map.addSetTurret();
if (_map.selectedTurret != null){
_map.selectedTurret.hideRadius();
_map.selectedTurret.totGraph.gotoAndStop((_map.selectedTurret.type + " N"));
for (_local2 in turretArray) {
turretArray[_local2].totGraph.mc_sugar_effect.visible = false;
};
_map.selectedTurret = null;
};
}
public function onPlayBtnClick(_arg1:MouseEvent){
var _local2:String;
SoundMixer.soundTransform = new SoundTransform(1);
_local2 = new String();
this.pause = false;
mc_gui.mc_pause.visible = false;
this.levelTimer.start();
if (Main._bonus != null){
Main._bonus.start();
};
this.myTimer.start();
for (_local2 in bulletArray) {
bulletArray[_local2].start();
};
for (_local2 in monArray) {
monArray[_local2].start();
};
for (_local2 in turretArray) {
turretArray[_local2].start();
};
}
private function onMapLoaded():void{
_map.showMap();
this.addChildAt(bulletLevel, 1);
this.addChildAt(new McTree(), 1);
this.getChildAt(1).x = (this.getChildAt(1).x - 1);
this.getChildAt(1).y = (this.getChildAt(1).y + 4);
this.addChildAt(monLevel, 1);
this.addChildAt(turretLevel, 1);
this.addChild(_map);
this.addChild(mc_gui);
}
private function onTurretSelected(_arg1:Event){
var _local2:Point;
if (_arg1.target.selectedTurret.destroyed != true){
if (_arg1.target.selectedTurret.selling != true){
mc_gui.showTurretUpg(_arg1.target.selectedTurret.type);
_arg1.target.selectedTurret.totGraph.gotoAndStop((_arg1.target.selectedTurret.type + "_Yes"));
setTuretGuiText(_arg1.target.selectedTurret);
this.turObjPR = _map.selectedTurret;
_arg1.target.selectedTurret.showRadius();
if (_arg1.target.selectedTurret.type == "sugar"){
_local2 = _arg1.target.selectedTurret.coord;
if (this._map.tileArray[(_local2.y - 1)][(_local2.x - 1)]._turret != null){
this._map.tileArray[(_local2.y - 1)][(_local2.x - 1)]._turret.totGraph.mc_sugar_effect.visible = true;
};
if (this._map.tileArray[_local2.y][(_local2.x - 1)]._turret != null){
this._map.tileArray[_local2.y][(_local2.x - 1)]._turret.totGraph.mc_sugar_effect.visible = true;
};
if (this._map.tileArray[(_local2.y + 1)][(_local2.x - 1)]._turret != null){
this._map.tileArray[(_local2.y + 1)][(_local2.x - 1)]._turret.totGraph.mc_sugar_effect.visible = true;
};
if (this._map.tileArray[(_local2.y + 2)][(_local2.x - 1)]._turret != null){
this._map.tileArray[(_local2.y + 2)][(_local2.x - 1)]._turret.totGraph.mc_sugar_effect.visible = true;
};
if (this._map.tileArray[(_local2.y + 2)][_local2.x]._turret != null){
this._map.tileArray[(_local2.y + 2)][_local2.x]._turret.totGraph.mc_sugar_effect.visible = true;
};
if (this._map.tileArray[(_local2.y + 2)][(_local2.x + 1)]._turret != null){
this._map.tileArray[(_local2.y + 2)][(_local2.x + 1)]._turret.totGraph.mc_sugar_effect.visible = true;
};
if (this._map.tileArray[(_local2.y + 2)][(_local2.x + 2)]._turret != null){
this._map.tileArray[(_local2.y + 2)][(_local2.x + 2)]._turret.totGraph.mc_sugar_effect.visible = true;
};
if (this._map.tileArray[(_local2.y + 1)][(_local2.x + 2)]._turret != null){
this._map.tileArray[(_local2.y + 1)][(_local2.x + 2)]._turret.totGraph.mc_sugar_effect.visible = true;
};
if (this._map.tileArray[_local2.y][(_local2.x + 2)]._turret != null){
this._map.tileArray[_local2.y][(_local2.x + 2)]._turret.totGraph.mc_sugar_effect.visible = true;
};
if (this._map.tileArray[(_local2.y - 1)][(_local2.x + 2)]._turret != null){
this._map.tileArray[(_local2.y - 1)][(_local2.x + 2)]._turret.totGraph.mc_sugar_effect.visible = true;
};
if (this._map.tileArray[(_local2.y - 1)][(_local2.x + 1)]._turret != null){
this._map.tileArray[(_local2.y - 1)][(_local2.x + 1)]._turret.totGraph.mc_sugar_effect.visible = true;
};
if (this._map.tileArray[(_local2.y - 1)][_local2.x]._turret != null){
this._map.tileArray[(_local2.y - 1)][_local2.x]._turret.totGraph.mc_sugar_effect.visible = true;
};
};
} else {
mc_gui.showTurretProgress(_arg1.target.selectedTurret);
};
};
}
function onStones(_arg1:Event){
var _local2:URLVariables;
var _local3:URLRequest;
_local2 = new URLVariables();
_local2.game = "PicnicBasketDefense";
_local2.from = root.loaderInfo.url;
_local2.typ = "loader_movie";
_local3 = new URLRequest("http://www.mygame.com/bounce.jsp");
_local3.data = _local2;
navigateToURL(_local3, "_blank");
}
private function onLevelTimer(_arg1:TimerEvent){
if (visibleLevelsArray.length > 0){
visibleLevelsArray[0].mc_line.gotoAndStop(int(((levelTimer.currentCount / levelTime) * 100)));
if (curentActiveArray.length > 1){
checkAndUpdateActiveLevels();
} else {
if ((((currentLevel >= levelArray.length)) && ((this.monsterToPass == 0)))){
nextWave();
};
};
} else {
if ((((currentLevel >= levelArray.length)) && ((this.monsterToPass == 0)))){
nextWave();
};
};
if (this.levelTimer.currentCount != levelTimer.repeatCount){
mc_gui.time_txt.text = String(Math.round(((levelTimer.repeatCount - levelTimer.currentCount) / 10)));
} else {
nextWave();
};
}
private function addAntQueen(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:Boolean, _arg6:int){
var _local7:*;
_local7 = 0;
while (_local7 < _arg1) {
monArray[("mon_" + monNum)] = new QueenAnt(new McQueenAnt(), (17 + Math.floor((Math.random() * 6))), 1, _map, ("mon_" + monNum), 0, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
monArray[("mon_" + monNum)] = new QueenAnt(new McQueenAnt(), 1, (16 + Math.floor((Math.random() * 5))), _map, ("mon_" + monNum), 1, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
_local7++;
};
}
private function onScorePopEnterFrame(_arg1:Event){
var _local2:MovieClip;
if (_arg1.target.currentLabel == "comp"){
_local2 = (_arg1.target as MovieClip);
_arg1.target.removeEventListener(Event.ENTER_FRAME, onScorePopEnterFrame);
this.removeChild(_local2);
};
}
public function onStartBtnClick(_arg1:MouseEvent){
if (currentLevel != 0){
timeBonus = (timeBonus + ((300 - levelTimer.currentCount) / 10));
};
nextWave();
}
private function addQueenTermite(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:Boolean, _arg6:int){
var _local7:*;
_local7 = 0;
while (_local7 < _arg1) {
monArray[("mon_" + monNum)] = new QueenTermite(new McQueenTermite(), (17 + Math.floor((Math.random() * 6))), 1, _map, ("mon_" + monNum), 0, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
monArray[("mon_" + monNum)] = new QueenTermite(new McQueenTermite(), 1, (16 + Math.floor((Math.random() * 5))), _map, ("mon_" + monNum), 1, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
_local7++;
};
}
private function onHoneyButtonClick(_arg1:Event){
var _local2:*;
_map.removeTuretSet();
_map.turetSet = "honey";
_map.turetSetType = "honey";
_map.addSetTurret();
mc_gui[(("mc_" + _map.turetSetType) + "_button")].gotoAndStop(String((_map.turetSetType + "_Yes")));
if (_map.selectedTurret != null){
_map.selectedTurret.hideRadius();
_map.selectedTurret.totGraph.gotoAndStop((_map.selectedTurret.type + " N"));
for (_local2 in turretArray) {
turretArray[_local2].totGraph.mc_sugar_effect.visible = false;
};
_map.selectedTurret = null;
};
}
private function addAnt(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:Boolean, _arg6:int){
var _local7:*;
_local7 = 0;
while (_local7 < _arg1) {
monArray[("mon_" + monNum)] = new Ants(new AntStandart(), (17 + Math.floor((Math.random() * 6))), 1, _map, ("mon_" + monNum), 0, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
monArray[("mon_" + monNum)] = new Ants(new AntStandart(), 1, (16 + Math.floor((Math.random() * 5))), _map, ("mon_" + monNum), 1, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
_local7++;
};
}
public function onTurretDeselect(_arg1:Event){
var _local2:*;
if (_map.selectedTurret != undefined){
mc_gui.removeTurretProgress(_map.selectedTurret);
_map.selectedTurret.totGraph.gotoAndStop((_map.selectedTurret.type + " N"));
_map.selectedTurret.hideRadius();
this.mc_gui.mc_guiTowers.visible = false;
};
if (_map.turetSet != "none"){
_map.removeTuretSet();
};
for (_local2 in turretArray) {
turretArray[_local2].totGraph.mc_sugar_effect.visible = false;
};
}
private function checkAndUpdateActiveLevels(){
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < curentActiveArray.length) {
curentActiveArray.splice(_local1, 1);
mc_gui.removeChild(visibleLevelsArray[_local1]);
visibleLevelsArray.splice(_local1, 1);
_local2 = _local1;
while (_local2 < visibleLevelsArray.length) {
visibleLevelsArray[_local2].x = (visibleLevelsArray[_local2].x - 109);
_local2++;
};
_local1--;
_local1++;
};
}
private function onMustardButtonClick(_arg1:Event){
var _local2:*;
_map.removeTuretSet();
_map.turetSet = "mustard";
_map.turetSetType = "mustard";
_map.addSetTurret();
mc_gui[(("mc_" + _map.turetSetType) + "_button")].gotoAndStop(String((_map.turetSetType + "_Yes")));
if (_map.selectedTurret != null){
_map.selectedTurret.hideRadius();
_map.selectedTurret.totGraph.gotoAndStop((_map.selectedTurret.type + " N"));
for (_local2 in turretArray) {
turretArray[_local2].totGraph.mc_sugar_effect.visible = false;
};
_map.selectedTurret = null;
};
}
private function onReplayGame(_arg1:Event){
var _local2:*;
this._soundChannel.stop();
this.mc_gui.gotoAndStop(1);
this.lives = 20;
this.money = 200;
_map.turetSet = "none";
_map.turetSetType = "none";
if (_map.selectedTurret != undefined){
_map.selectedTurret.hideRadius();
_map.selectedTurret.totGraph.gotoAndStop((_map.selectedTurret.type + " N"));
for (_local2 in turretArray) {
turretArray[_local2].totGraph.mc_sugar_effect.visible = false;
};
};
switch (this.lastGameType){
case "normal":
Main.startGame(new Event(""));
break;
case "hard":
Main.startHardGame(new Event(""));
break;
case "special":
Main.startSpecGame(new Event(""));
break;
default:
Main.startGame(new Event(""));
};
}
function completeHandler(_arg1:Event):void{
var _local2:URLLoader;
var _local3:URLVariables;
_local2 = URLLoader(_arg1.target);
_local3 = new URLVariables(_local2.data);
}
private function onDeath(_arg1:Event){
var _local2:MovieClip;
totalKill++;
this.monsterToPass--;
_local2 = new McScorePop();
_local2.x = monArray[_arg1.currentTarget.monName].x;
_local2.y = monArray[_arg1.currentTarget.monName].y;
_local2.score.score_txt.text = monArray[_arg1.currentTarget.monName].score;
_local2.addEventListener(Event.ENTER_FRAME, onScorePopEnterFrame);
this.addChild(_local2);
_local2.play();
this.monLevel.removeChild(monArray[_arg1.currentTarget.monName]);
money = (money + monArray[_arg1.currentTarget.monName].money);
score = (score + monArray[_arg1.currentTarget.monName].score);
monArray[_arg1.currentTarget.monName].removeEventListener("onWayOut", onMonWayOut);
monArray[_arg1.currentTarget.monName].removeEventListener("onDeath", onDeath);
monArray[_arg1.currentTarget.monName].clear();
delete monArray[_arg1.currentTarget.monName];
}
private function onPepperButtonClick(_arg1:Event){
var _local2:*;
_map.removeTuretSet();
_map.turetSet = "pepper";
_map.turetSetType = "pepper";
_map.addSetTurret();
mc_gui[(("mc_" + _map.turetSetType) + "_button")].gotoAndStop(String((_map.turetSetType + "_Yes")));
if (_map.selectedTurret != null){
_map.selectedTurret.hideRadius();
_map.selectedTurret.totGraph.gotoAndStop((_map.selectedTurret.type + " N"));
for (_local2 in turretArray) {
turretArray[_local2].totGraph.mc_sugar_effect.visible = false;
};
_map.selectedTurret = null;
};
}
private function addFireAnt(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:Boolean, _arg6:int){
var _local7:*;
_local7 = 0;
while (_local7 < _arg1) {
monArray[("mon_" + monNum)] = new FireAnt(new McFireAnt(), (17 + Math.floor((Math.random() * 6))), 1, _map, ("mon_" + monNum), 0, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
monArray[("mon_" + monNum)] = new FireAnt(new McFireAnt(), 1, (16 + Math.floor((Math.random() * 5))), _map, ("mon_" + monNum), 1, _arg2, _arg3, _arg4, _arg6);
monArray[("mon_" + monNum)].addEventListener("onWayOut", onMonWayOut);
monArray[("mon_" + monNum)].addEventListener("onDeath", onDeath);
monArray[("mon_" + monNum)].boses = _arg5;
monArray[("mon_" + monNum)].monsterVis = true;
this.monLevel.addChild(monArray[("mon_" + monNum)]);
monNum++;
_local7++;
};
}
private function setTuretGuiText(_arg1){
mc_gui.mc_guiTowers[(_arg1.type + "UpgMenu")].turret_cost.text = _arg1.price;
if (_arg1.getDamage() > 0){
mc_gui.mc_guiTowers[(_arg1.type + "UpgMenu")].turret_dmg.text = (_arg1.damage + _arg1.getDamage());
} else {
mc_gui.mc_guiTowers[(_arg1.type + "UpgMenu")].turret_dmg.text = _arg1.damage;
};
mc_gui.mc_guiTowers[(_arg1.type + "UpgMenu")].turret_rate.text = _arg1.fireRate;
mc_gui.mc_guiTowers[(_arg1.type + "UpgMenu")].turret_range.text = _arg1.radius;
mc_gui.mc_guiTowers[(_arg1.type + "UpgMenu")].turret_defense.text = _arg1.defense;
mc_gui.mc_guiTowers[(_arg1.type + "UpgMenu")].turretName_txt.text = _arg1.turretName;
if (_arg1.level < _arg1.levels.length){
mc_gui.mc_guiTowers[(_arg1.type + "UpgMenu")].turret_cost_upg.text = ("+" + String((_arg1.levels[_arg1.level].price - _arg1.price)));
mc_gui.mc_guiTowers[(_arg1.type + "UpgMenu")].turret_dmg_upg.text = ("+" + String((_arg1.levels[_arg1.level].damage - _arg1.damage)));
mc_gui.mc_guiTowers[(_arg1.type + "UpgMenu")].turret_rate_upg.text = ("+" + String((_arg1.levels[_arg1.level].fireRate - _arg1.fireRate)));
mc_gui.mc_guiTowers[(_arg1.type + "UpgMenu")].turret_range_upg.text = ("+" + String((_arg1.levels[_arg1.level].radius - _arg1.radius)));
mc_gui.mc_guiTowers[(_arg1.type + "UpgMenu")].turret_defense_upg.text = ("+" + String((_arg1.levels[_arg1.level].defense - _arg1.baseDefense)));
mc_gui.mc_guiTowers[(_arg1.type + "UpgMenu")].mc_upg_graph.visible = true;
mc_gui.mc_guiTowers[(_arg1.type + "UpgMenu")].upg_btn.visible = true;
} else {
mc_gui.mc_guiTowers[(_arg1.type + "UpgMenu")].turret_cost_upg.text = "";
mc_gui.mc_guiTowers[(_arg1.type + "UpgMenu")].turret_dmg_upg.text = "";
mc_gui.mc_guiTowers[(_arg1.type + "UpgMenu")].turret_rate_upg.text = "";
mc_gui.mc_guiTowers[(_arg1.type + "UpgMenu")].turret_range_upg.text = "";
mc_gui.mc_guiTowers[(_arg1.type + "UpgMenu")].turret_defense_upg.text = "";
mc_gui.mc_guiTowers[(_arg1.type + "UpgMenu")].mc_upg_graph.visible = false;
mc_gui.mc_guiTowers[(_arg1.type + "UpgMenu")].upg_btn.visible = false;
};
}
private function addMonster(_arg1:TimerEvent):void{
var _local2:int;
_local2 = 0;
while (_local2 < waveArray.length) {
if (waveArray[_local2].rep > 0){
switch (String(this.waveArray[_local2].name)){
case "ants_small":
addSmallAnt(this.waveArray[_local2].amm, this.waveArray[_local2].hp, this.waveArray[_local2].money, this.waveArray[_local2].score, this.waveArray[_local2].boses, waveArray[_local2].levelNum);
break;
case "burrowers":
addBurrowers(this.waveArray[_local2].amm, this.waveArray[_local2].hp, this.waveArray[_local2].money, this.waveArray[_local2].score, this.waveArray[_local2].boses, waveArray[_local2].levelNum);
break;
case "ants":
addAnt(this.waveArray[_local2].amm, this.waveArray[_local2].hp, this.waveArray[_local2].money, this.waveArray[_local2].score, this.waveArray[_local2].boses, waveArray[_local2].levelNum);
break;
case "ant_african":
addAntAfrican(this.waveArray[_local2].amm, this.waveArray[_local2].hp, this.waveArray[_local2].money, this.waveArray[_local2].score, this.waveArray[_local2].boses, waveArray[_local2].levelNum);
break;
case "ant_big":
addBigAnt(this.waveArray[_local2].amm, this.waveArray[_local2].hp, this.waveArray[_local2].money, this.waveArray[_local2].score, this.waveArray[_local2].boses, waveArray[_local2].levelNum);
break;
case "ant_winged":
addAntWinged(this.waveArray[_local2].amm, this.waveArray[_local2].hp, this.waveArray[_local2].money, this.waveArray[_local2].score, this.waveArray[_local2].boses, waveArray[_local2].levelNum);
break;
case "queen_ant":
addAntQueen(this.waveArray[_local2].amm, this.waveArray[_local2].hp, this.waveArray[_local2].money, this.waveArray[_local2].score, this.waveArray[_local2].boses, waveArray[_local2].levelNum);
break;
case "soldier_ant":
addSoldierAnt(this.waveArray[_local2].amm, this.waveArray[_local2].hp, this.waveArray[_local2].money, this.waveArray[_local2].score, this.waveArray[_local2].boses, waveArray[_local2].levelNum);
break;
case "piss_ant":
addPissAnt(this.waveArray[_local2].amm, this.waveArray[_local2].hp, this.waveArray[_local2].money, this.waveArray[_local2].score, this.waveArray[_local2].boses, waveArray[_local2].levelNum);
break;
case "fire_ant":
addFireAnt(this.waveArray[_local2].amm, this.waveArray[_local2].hp, this.waveArray[_local2].money, this.waveArray[_local2].score, this.waveArray[_local2].boses, waveArray[_local2].levelNum);
break;
case "termite":
addTermite(this.waveArray[_local2].amm, this.waveArray[_local2].hp, this.waveArray[_local2].money, this.waveArray[_local2].score, this.waveArray[_local2].boses, waveArray[_local2].levelNum);
break;
case "queen_termite":
addQueenTermite(this.waveArray[_local2].amm, this.waveArray[_local2].hp, this.waveArray[_local2].money, this.waveArray[_local2].score, this.waveArray[_local2].boses, waveArray[_local2].levelNum);
break;
};
waveArray[_local2].rep--;
} else {
waveArray.slice(_local2, 1);
};
_local2++;
};
}
private function addBonus(){
if ((bonus == null)){
this.bonus = new Bonus();
Main._bonus = this.bonus;
this._map.addBonus(bonus);
this._map.addChildAt(bonus, 0);
makeChanges();
};
}
public static function AddBullet(_arg1, _arg2:Point, _arg3:Number, _arg4:int, _arg5:int){
Main.self.bulletArray[("bullet_" + Main.self.bulletNum)] = new Shoot(_arg1, ("bullet_" + Main.self.bulletNum), Main.self.monArray, _arg3, _arg4, _arg5);
Main.self.bulletArray[("bullet_" + Main.self.bulletNum)].x = (_arg2.x + 15);
Main.self.bulletArray[("bullet_" + Main.self.bulletNum)].y = (_arg2.y + 15);
Main.self.bulletArray[("bullet_" + Main.self.bulletNum)].init();
Main.self.bulletLevel.addChild(Main.self.bulletArray[("bullet_" + Main.self.bulletNum)]);
Main.self.bulletNum++;
}
public static function removeBonus(){
if (Main.self.bonus != null){
Main.self.bonus.clear();
Main.self._map.removeChild(Main.self.bonus);
Main.self.bonus = null;
Main._bonus = null;
Main.self.makeChanges();
};
}
public static function destroyBulet(_arg1){
Main.self.bulletArray[_arg1.bulName].clear();
Main.self.bulletLevel.removeChild(Main.self.bulletArray[_arg1.bulName]);
delete Main.self.bulletArray[_arg1.bulName];
}
public static function startSpecGame(_arg1:Event){
Main.self.lastGameType = "spec";
Main.self.timeBonus = 0;
Main.self.showedLevels = 0;
Main.self.mc_gui.menuShow();
Main.self.pause = false;
Main.self.lives = 9999;
Main.self.money = 99999;
Main.self._map.turetSet = "none";
Main.self._map.turetSetType = "none";
Main.self.mc_gui.start_btn.addEventListener(MouseEvent.CLICK, Main.self.onStartBtnClick);
Main.self.mc_gui.pause_btn.addEventListener(MouseEvent.CLICK, Main.self.onPauseBtnClick);
Main.self.mc_gui.mc_pause.play_btn.addEventListener(MouseEvent.CLICK, Main.self.onPlayBtnClick);
Main.self.mc_gui.mc_pause.menu_btn.addEventListener(MouseEvent.CLICK, Main.self.onPauseMenuBtnClick);
Main.self.mc_gui.mc_end.mc_end.end_menu_btn.addEventListener(MouseEvent.CLICK, Main.self.onMenuBtnClick);
Main.self.mc_gui.menu_btn.addEventListener(MouseEvent.CLICK, Main.self.onMenuBtnClick);
Main.self.mc_gui.mc_end.mcEndOver.end_menu_btn.addEventListener(MouseEvent.CLICK, Main.self.onMenuBtnClick);
Main.self.levelArray = XMLData.self.getLevelArray("spec");
Main.self.totalTime = (30 * (Main.self.levelArray.length - 1));
Main.score = 0;
Main.self.timeOther = 210;
Main.self.timeInner = 0;
Main.self.mc_gui.mc_start.visible = false;
Main.self.mc_gui.mc_mygame_but.y = 455;
Main.self.currentLevel = 0;
Main.self.totalKill = 0;
Main.self.levelTimer = new Timer(100, Main.self.levelTime);
Main.self.levelTimer.start();
Main.self.levelTimer.addEventListener("timer", Main.self.onLevelTimer);
Main.self.myTimer = new Timer(1000, 0);
Main.self.myTimer.addEventListener("timer", Main.self.addMonster);
Main.self.myTimer.start();
Main.self.nextWave();
}
public static function dropBonus(_arg1:Point){
Main.self._map.tileArray[_arg1.y][_arg1.x].addBonus(Main.self.bonus);
Main.self.bonus.drop();
Main.self.makeChanges();
}
public static function toothpickAttack(_arg1:Point, _arg2:Point, _arg3:int, _arg4:int){
Main.self.bulletArray[("bullet_" + Main.self.bulletNum)] = new Bullet(_arg1, ("bullet_" + Main.self.bulletNum), Main.self.monArray, _arg3, _arg4);
Main.self.bulletArray[("bullet_" + Main.self.bulletNum)].x = (_arg2.x + 15);
Main.self.bulletArray[("bullet_" + Main.self.bulletNum)].y = (_arg2.y + 15);
Main.self.bulletArray[("bullet_" + Main.self.bulletNum)].init();
Main.self.bulletLevel.addChild(Main.self.bulletArray[("bullet_" + Main.self.bulletNum)]);
Main.self.bulletNum++;
}
public static function startGame(_arg1:Event){
Main.self.lastGameType = "normal";
Main.self.timeBonus = 0;
Main.self.showedLevels = 0;
Main.self.mc_gui.menuShow();
Main.self.pause = false;
Main.self.lives = XMLData.self.getLevelLives("normal");
Main.self.money = XMLData.self.getLevelMoney("normal");
Main.self._map.turetSet = "none";
Main.self._map.turetSetType = "none";
Main.self.mc_gui.start_btn.addEventListener(MouseEvent.CLICK, Main.self.onStartBtnClick);
Main.self.mc_gui.pause_btn.addEventListener(MouseEvent.CLICK, Main.self.onPauseBtnClick);
Main.self.mc_gui.mc_pause.play_btn.addEventListener(MouseEvent.CLICK, Main.self.onPlayBtnClick);
Main.self.mc_gui.mc_pause.menu_btn.addEventListener(MouseEvent.CLICK, Main.self.onPauseMenuBtnClick);
Main.self.mc_gui.menu_btn.addEventListener(MouseEvent.CLICK, Main.self.onMenuBtnClick);
Main.self.mc_gui.mc_end.mc_end.end_menu_btn.addEventListener(MouseEvent.CLICK, Main.self.onMenuBtnClick);
Main.self.mc_gui.mc_end.mcEndOver.end_menu_btn.addEventListener(MouseEvent.CLICK, Main.self.onMenuBtnClick);
Main.self.levelArray = XMLData.self.getLevelArray("normal");
Main.self.totalTime = (30 * (Main.self.levelArray.length - 1));
Main.score = 0;
Main.self.timeOther = 1500;
Main.self.timeInner = 0;
Main.self.mc_gui.mc_start.visible = false;
Main.self.mc_gui.mc_mygame_but.y = 455;
Main.self.currentLevel = 0;
Main.self.totalKill = 0;
Main.self.levelTimer = new Timer(100, Main.self.levelTime);
Main.self.levelTimer.start();
Main.self.levelTimer.addEventListener("timer", Main.self.onLevelTimer);
Main.self.myTimer = new Timer(1000, 0);
Main.self.myTimer.addEventListener("timer", Main.self.addMonster);
Main.self.myTimer.start();
Main.self.nextWave();
}
public static function addBonusScore(){
var _local1:MovieClip;
_local1 = new McScorePop();
_local1.x = (Main.self.bonus.x + Main.self.smeshX);
_local1.y = (Main.self.bonus.y + Main.self.smeshY);
_local1.score.score_txt.text = 400;
_local1.addEventListener(Event.ENTER_FRAME, Main.self.onScorePopEnterFrame);
Main.self.addChild(_local1);
_local1.play();
Main.score = (Main.score + 400);
Main.removeBonus();
}
public static function startHardGame(_arg1:Event){
Main.self.lastGameType = "hard";
Main.self.timeBonus = 0;
Main.self.showedLevels = 0;
Main.self.mc_gui.menuShow();
Main.self.pause = false;
Main.self.lives = XMLData.self.getLevelLives("hard");
Main.self.money = XMLData.self.getLevelMoney("hard");
Main.self._map.turetSet = "none";
Main.self._map.turetSetType = "none";
Main.self.mc_gui.start_btn.addEventListener(MouseEvent.CLICK, Main.self.onStartBtnClick);
Main.self.mc_gui.pause_btn.addEventListener(MouseEvent.CLICK, Main.self.onPauseBtnClick);
Main.self.mc_gui.mc_pause.play_btn.addEventListener(MouseEvent.CLICK, Main.self.onPlayBtnClick);
Main.self.mc_gui.mc_pause.menu_btn.addEventListener(MouseEvent.CLICK, Main.self.onPauseMenuBtnClick);
Main.self.mc_gui.menu_btn.addEventListener(MouseEvent.CLICK, Main.self.onMenuBtnClick);
Main.self.mc_gui.mc_end.mc_end.end_menu_btn.addEventListener(MouseEvent.CLICK, Main.self.onMenuBtnClick);
Main.self.mc_gui.mc_end.mcEndOver.end_menu_btn.addEventListener(MouseEvent.CLICK, Main.self.onMenuBtnClick);
Main.self.levelArray = XMLData.self.getLevelArray("hard");
Main.self.totalTime = (30 * (Main.self.levelArray.length - 1));
Main.score = 0;
Main.self.timeOther = 5000;
Main.self.timeInner = 0;
Main.self.mc_gui.mc_start.visible = false;
Main.self.mc_gui.mc_mygame_but.y = 455;
Main.self.currentLevel = 0;
Main.self.totalKill = 0;
Main.self.levelTimer = new Timer(100, Main.self.levelTime);
Main.self.levelTimer.start();
Main.self.levelTimer.addEventListener("timer", Main.self.onLevelTimer);
Main.self.myTimer = new Timer(1000, 0);
Main.self.myTimer.addEventListener("timer", Main.self.addMonster);
Main.self.myTimer.start();
Main.self.nextWave();
}
}
}//package
Section 117
//mc_ant_block (mc_ant_block)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mc_ant_block extends MovieClip {
public var wave_name:TextField;
public var bg:MovieClip;
public var mc_line:MovieClip;
}
}//package
Section 118
//mc_ant_first_block (mc_ant_first_block)
package {
import flash.display.*;
public dynamic class mc_ant_first_block extends MovieClip {
public var bg:MovieClip;
public var mc_line:MovieClip;
}
}//package
Section 119
//mc_ant_line_over (mc_ant_line_over)
package {
import flash.display.*;
public dynamic class mc_ant_line_over extends MovieClip {
public var mc_line:MovieClip;
}
}//package
Section 120
//mc_map (mc_map)
package {
import flash.display.*;
public dynamic class mc_map extends MovieClip {
}
}//package
Section 121
//McAntAfrican (McAntAfrican)
package {
import flash.display.*;
public dynamic class McAntAfrican extends MovieClip {
}
}//package
Section 122
//McAntBig (McAntBig)
package {
import flash.display.*;
public dynamic class McAntBig extends MovieClip {
}
}//package
Section 123
//McAntSmall (McAntSmall)
package {
import flash.display.*;
public dynamic class McAntSmall extends MovieClip {
}
}//package
Section 124
//McAntSoldier (McAntSoldier)
package {
import flash.display.*;
public dynamic class McAntSoldier extends MovieClip {
public function McAntSoldier(){
addFrameScript(6, frame7, 17, frame18);
}
function frame18(){
stop();
}
function frame7(){
gotoAndPlay(1);
}
}
}//package
Section 125
//McAntWinged (McAntWinged)
package {
import flash.display.*;
public dynamic class McAntWinged extends MovieClip {
}
}//package
Section 126
//McBurrowers (McBurrowers)
package {
import flash.display.*;
public dynamic class McBurrowers extends MovieClip {
public function McBurrowers(){
addFrameScript(3, frame4, 25, frame26);
}
function frame26(){
stop();
}
function frame4(){
gotoAndPlay(1);
}
}
}//package
Section 127
//McCheese (McCheese)
package {
import flash.display.*;
public dynamic class McCheese extends MovieClip {
}
}//package
Section 128
//McChickenleg (McChickenleg)
package {
import flash.display.*;
public dynamic class McChickenleg extends MovieClip {
}
}//package
Section 129
//McFireAnt (McFireAnt)
package {
import flash.display.*;
public dynamic class McFireAnt extends MovieClip {
public function McFireAnt(){
addFrameScript(6, frame7, 17, frame18);
}
function frame18(){
stop();
}
function frame7(){
gotoAndPlay(1);
}
}
}//package
Section 130
//McHealthBar (McHealthBar)
package {
import flash.display.*;
public dynamic class McHealthBar extends MovieClip {
}
}//package
Section 131
//McHoney (McHoney)
package {
import flash.display.*;
public dynamic class McHoney extends MovieClip {
public var loader:MovieClip;
public var mc_update:MovieClip;
public var tur_graph:MovieClip;
public var mc_sugar_effect:MovieClip;
}
}//package
Section 132
//McHoneyShoot (McHoneyShoot)
package {
import flash.display.*;
public dynamic class McHoneyShoot extends MovieClip {
public function McHoneyShoot(){
addFrameScript(5, frame6, 10, frame11);
}
function frame6(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 133
//McKetchup (McKetchup)
package {
import flash.display.*;
public dynamic class McKetchup extends MovieClip {
public var loader:MovieClip;
public var mc_update:MovieClip;
public var tur_graph:MovieClip;
public var mc_sugar_effect:MovieClip;
public function McKetchup(){
addFrameScript(0, frame1, 18, frame19, 29, frame30);
}
function frame1(){
stop();
}
function frame19(){
stop();
}
function frame30(){
gotoAndStop(1);
}
}
}//package
Section 134
//McKetchupShoot (McKetchupShoot)
package {
import flash.display.*;
public dynamic class McKetchupShoot extends MovieClip {
public function McKetchupShoot(){
addFrameScript(5, frame6, 10, frame11);
}
function frame6(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 135
//McMask (McMask)
package {
import flash.display.*;
public dynamic class McMask extends BitmapData {
public function McMask(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 136
//McMustard (McMustard)
package {
import flash.display.*;
public dynamic class McMustard extends MovieClip {
public var loader:MovieClip;
public var mc_update:MovieClip;
public var tur_graph:MovieClip;
public var mc_sugar_effect:MovieClip;
}
}//package
Section 137
//McMustardShoot (McMustardShoot)
package {
import flash.display.*;
public dynamic class McMustardShoot extends MovieClip {
public function McMustardShoot(){
addFrameScript(5, frame6, 10, frame11);
}
function frame6(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 138
//McPepper (McPepper)
package {
import flash.display.*;
public dynamic class McPepper extends MovieClip {
public var loader:MovieClip;
public var mc_update:MovieClip;
public var tur_graph:MovieClip;
public var mc_sugar_effect:MovieClip;
public function McPepper(){
addFrameScript(18, frame19, 26, frame27);
}
function frame19(){
stop();
}
function frame27(){
gotoAndStop(1);
}
}
}//package
Section 139
//mcPepperHit (mcPepperHit)
package {
import flash.display.*;
public dynamic class mcPepperHit extends MovieClip {
public function mcPepperHit(){
addFrameScript(41, frame42);
}
function frame42(){
stop();
}
}
}//package
Section 140
//McPepperShoot (McPepperShoot)
package {
import flash.display.*;
public dynamic class McPepperShoot extends MovieClip {
public function McPepperShoot(){
addFrameScript(5, frame6, 10, frame11);
}
function frame6(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 141
//McPissAnt (McPissAnt)
package {
import flash.display.*;
public dynamic class McPissAnt extends MovieClip {
public function McPissAnt(){
addFrameScript(6, frame7, 17, frame18);
}
function frame18(){
stop();
}
function frame7(){
gotoAndPlay(1);
}
}
}//package
Section 142
//McQueenAnt (McQueenAnt)
package {
import flash.display.*;
public dynamic class McQueenAnt extends MovieClip {
}
}//package
Section 143
//McQueenTermite (McQueenTermite)
package {
import flash.display.*;
public dynamic class McQueenTermite extends MovieClip {
public function McQueenTermite(){
addFrameScript(6, frame7, 17, frame18);
}
function frame18(){
stop();
}
function frame7(){
gotoAndPlay(1);
}
}
}//package
Section 144
//McRadiusCircle (McRadiusCircle)
package {
import flash.display.*;
public dynamic class McRadiusCircle extends MovieClip {
}
}//package
Section 145
//McScorePop (McScorePop)
package {
import flash.display.*;
public dynamic class McScorePop extends MovieClip {
public var score:MovieClip;
public function McScorePop(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
}
}
}//package
Section 146
//McSugar (McSugar)
package {
import flash.display.*;
public dynamic class McSugar extends MovieClip {
public var loader:MovieClip;
public var mc_update:MovieClip;
public var tur_graph:MovieClip;
public var mc_sugar_effect:MovieClip;
public function McSugar(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package
Section 147
//McTermite (McTermite)
package {
import flash.display.*;
public dynamic class McTermite extends MovieClip {
public function McTermite(){
addFrameScript(6, frame7, 17, frame18);
}
function frame18(){
stop();
}
function frame7(){
gotoAndPlay(1);
}
}
}//package
Section 148
//McToothpick (McToothpick)
package {
import flash.display.*;
public dynamic class McToothpick extends MovieClip {
public var loader:MovieClip;
public var mc_update:MovieClip;
public var tur_graph:MovieClip;
public var mc_sugar_effect:MovieClip;
public function McToothpick(){
addFrameScript(18, frame19, 30, frame31);
}
function frame19(){
stop();
}
function frame31(){
gotoAndStop(1);
}
}
}//package
Section 149
//McTree (McTree)
package {
import flash.display.*;
public dynamic class McTree extends MovieClip {
}
}//package
Section 150
//MustardFire1Sound (MustardFire1Sound)
package {
import flash.media.*;
public dynamic class MustardFire1Sound extends Sound {
}
}//package
Section 151
//MustardFire2Sound (MustardFire2Sound)
package {
import flash.media.*;
public dynamic class MustardFire2Sound extends Sound {
}
}//package
Section 152
//MustardFire3Sound (MustardFire3Sound)
package {
import flash.media.*;
public dynamic class MustardFire3Sound extends Sound {
}
}//package
Section 153
//PepperFire1Sound (PepperFire1Sound)
package {
import flash.media.*;
public dynamic class PepperFire1Sound extends Sound {
}
}//package
Section 154
//PepperFire2Sound (PepperFire2Sound)
package {
import flash.media.*;
public dynamic class PepperFire2Sound extends Sound {
}
}//package
Section 155
//PepperFire3Sound (PepperFire3Sound)
package {
import flash.media.*;
public dynamic class PepperFire3Sound extends Sound {
}
}//package
Section 156
//PicnicGameEndSound (PicnicGameEndSound)
package {
import flash.media.*;
public dynamic class PicnicGameEndSound extends Sound {
}
}//package
Section 157
//PicnicIntroSound (PicnicIntroSound)
package {
import flash.media.*;
public dynamic class PicnicIntroSound extends Sound {
}
}//package
Section 158
//PicnicLoopSound (PicnicLoopSound)
package {
import flash.media.*;
public dynamic class PicnicLoopSound extends Sound {
}
}//package
Section 159
//StartLevelSound (StartLevelSound)
package {
import flash.media.*;
public dynamic class StartLevelSound extends Sound {
}
}//package
Section 160
//ToothpickFire1Sound (ToothpickFire1Sound)
package {
import flash.media.*;
public dynamic class ToothpickFire1Sound extends Sound {
}
}//package
Section 161
//ToothpickFire2Sound (ToothpickFire2Sound)
package {
import flash.media.*;
public dynamic class ToothpickFire2Sound extends Sound {
}
}//package
Section 162
//ToothpickFire3Sound (ToothpickFire3Sound)
package {
import flash.media.*;
public dynamic class ToothpickFire3Sound extends Sound {
}
}//package
Section 163
//UpgradeUnitSound (UpgradeUnitSound)
package {
import flash.media.*;
public dynamic class UpgradeUnitSound extends Sound {
}
}//package