Section 1
//AGO (com.king.daisy_defender.AGO)
package com.king.daisy_defender {
class AGO {
public var types:Array;
public var tick:int;
public static var C:int = 5;
public static var F:int = 3;
public static var M:int = 4;
public static var B1:int = 0;
public static var B2:int = 1;
public static var B3:int = 2;
function AGO(_arg1:int, _arg2:Array){
this.tick = _arg1;
this.types = _arg2;
}
public function toString():String{
var _local1:String;
var _local2:*;
_local1 = (("tick: " + tick) + " types:");
_local2 = 0;
while (_local2 < types.length) {
_local1 = (_local1 + (" " + types[_local2]));
_local2++;
};
return (_local1);
}
}
}//package com.king.daisy_defender
Section 2
//Ant (com.king.daisy_defender.Ant)
package com.king.daisy_defender {
import flash.display.*;
import com.king.daisy_defender.*;
class Ant extends BaseObject {
public var antInstanceNr:int;
protected var animCounter:int;
protected var oldSpeed:Number;
public static var MIN_X:int = 0;
protected static var antInstCounter:int = 0;
public static var speedUpFactor:Number = 1;
public static var START_EXPLOSION_DIAMETER:int = 14;
public static var END_EXPLOSION_DIAMETER:int = 60;
public static var MAX_X:int = 550;
public static var MAX_Y:int = 500;
function Ant(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Array, _arg7:Function){
super(_arg1, _arg2, _arg3, _arg6, _arg7);
antInstanceNr = antInstCounter;
antInstCounter++;
this.angle = _arg4;
this.speed = _arg5;
minX = MIN_X;
maxX = MAX_X;
maxY = MAX_Y;
oldSpeed = _arg5;
animCounter = 1;
calculateMovement();
}
protected function createExplosion(_arg1:Boolean, _arg2:ExplosionLevel){
var _local3:Explosion;
_local3 = new Explosion(References.game2Clip2, posX, posY, START_EXPLOSION_DIAMETER, END_EXPLOSION_DIAMETER, 0, 0, _arg1, _arg2, newObjects, messageCallback);
newObjects.push(_local3);
}
private function calculateMovement(){
speed = (speed * speedUpFactor);
movX = (speed * XPMath.cos(((angle * Math.PI) / 180)));
movY = (speed * XPMath.sin(((angle * Math.PI) / 180)));
}
public function speedUp(_arg1:Number){
if (speed == oldSpeed){
speedUpFactor = _arg1;
calculateMovement();
};
}
public function normalSpeed(){
speed = oldSpeed;
speedUpFactor = 1;
calculateMovement();
}
protected function explode2(){
visible = false;
collidable = false;
toBeRemoved = true;
createExplosion(true, null);
}
public function antExplode(_arg1:ExplosionLevel){
visible = false;
collidable = false;
toBeRemoved = true;
_arg1.level++;
createExplosion(false, _arg1);
}
override public function collisionReaction(_arg1:BaseObject){
var _local2:Explosion;
var _local3:ExplosionLevel;
var _local4:int;
if ((_arg1 is Explosion)){
_local2 = Explosion(_arg1);
_local3 = _local2.explosionLevel;
antExplode(_local3);
_local4 = 99;
if ((this is Bug1)){
_local4 = AGO.B1;
} else {
if ((this is Bug2)){
_local4 = AGO.B2;
} else {
if ((this is Bug3)){
_local4 = AGO.B3;
} else {
if ((this is Fly)){
_local4 = AGO.F;
} else {
if ((this is Moth)){
_local4 = AGO.M;
} else {
if ((this is Caterpillar)){
_local4 = AGO.C;
};
};
};
};
};
};
} else {
if ((_arg1 is Daisy)){
explode2();
} else {
if ((_arg1 is Shield)){
explode2();
};
};
};
}
}
}//package com.king.daisy_defender
Section 3
//AntGenerator (com.king.daisy_defender.AntGenerator)
package com.king.daisy_defender {
import flash.events.*;
import com.king.daisy_defender.*;
import flash.net.*;
import flash.system.*;
import flash.xml.*;
class AntGenerator {
private var baseObjects:Array;
private var agos:Array;
public var b1MaxSpawnInterval:int;// = 250
private var bug1Speed:Number;
public var spawnerWaitFrames:int;// = 200
public var loader:URLLoader;
private var tickCounter:int;
private var specialPowerPositivePercent:int;// = 0
private var flySpeed:Number;
private var bug2Speed:Number;
public var b1MaxSpawn:int;// = 3
private var agosLeft:Boolean;
public var spawnerMinSpawnInterval:int;// = 25
private var specialPowerCreatePercent:int;// = 0
private var antSpawnSlots:Array;
private var generatorXML:XML;
private var bug3Speed:Number;
private var mothSpeed:Number;
public var loadedXML:XML;
private var newObjects:Array;
public var b1MinSpawnInterval:int;// = 25
private var caterpillarSpeed:Number;
public var spawnerMaxSpawnInterval:int;// = 200
private var agosIndex:int;
private var messageCallback:Function;
private var caterpillar:Caterpillar;
private var spawnLastTick:int;
private var spawner:Boolean;
private var xmlLoaded:Boolean;// = false
public var spawnerMaxSpawn:int;// = 5
public static var SPECIAL_POWERS_MIN_X:int = 0;
public static var SPECIAL_POWERS_MIN_Y:int = 0;
public static var ANT_SPAWN_RAND_X_DIFF:int = 70;
public static var SPECIAL_POWERS_MAX_X:int = 550;
public static var SPECIAL_POWERS_MAX_Y:int = 400;
public static var ANT_SPAWN_Y_OFFSET:int = 100;
public static var PLAY_FIELD_MIN_X:int = 0;
public static var LOAD_XML:Boolean = false;
public static var PLAY_FIELD_MIN_Y:int = 0;
public static var ANT_SPAWN_RAND_Y_DIFF:int = 100;
public static var PLAY_FIELD_MAX_X:int = 550;
public static var PLAY_FIELD_MAX_Y:int = 520;
public static var speedDiffPercent:int = 0;
public static var ANT_SPAWN_X_OFFSET:int = int((550 / NR_ANT_SPAWN_SLOTS));
public static var NR_ANT_SPAWN_SLOTS:int = 6;
function AntGenerator(_arg1:Array, _arg2:Array, _arg3:Function){
xmlLoaded = false;
generatorXML = GeneratorXML.generatorXML;
b1MaxSpawn = 3;
b1MinSpawnInterval = 25;
b1MaxSpawnInterval = 250;
spawnerWaitFrames = 200;
spawnerMaxSpawn = 5;
spawnerMinSpawnInterval = 25;
spawnerMaxSpawnInterval = 200;
specialPowerCreatePercent = 0;
specialPowerPositivePercent = 0;
super();
this.baseObjects = _arg1;
this.newObjects = _arg2;
this.messageCallback = _arg3;
if (LOAD_XML){
loader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onComplete);
loader.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
loader.load(new URLRequest("daisydefender.xml"));
};
antSpawnSlots = new Array(NR_ANT_SPAWN_SLOTS);
}
private function spawnAnts(_arg1:int, _arg2:Array){
var _local3:int;
var _local4:*;
if (spawnLastTick != _arg1){
clearAntSpawnSlots();
};
_local3 = References.random.nextInt(NR_ANT_SPAWN_SLOTS);
if (antSpawnSlots[_local3] == false){
spawnRandomAnt(_local3, _arg2);
antSpawnSlots[_local3] = true;
} else {
_local4 = 0;
while (_local4 < NR_ANT_SPAWN_SLOTS) {
if (antSpawnSlots[_local4] == false){
spawnRandomAnt(_local4, _arg2);
antSpawnSlots[_local4] = true;
break;
};
_local4++;
};
};
spawnLastTick = _arg1;
}
private function createRefilItem(){
var _local1:Number;
var _local2:Number;
var _local3:RefilItem;
_local1 = getRandPosX(SPECIAL_POWERS_MIN_X, SPECIAL_POWERS_MAX_X, 40);
_local2 = getRandPosY(SPECIAL_POWERS_MIN_Y, SPECIAL_POWERS_MAX_Y, 40);
_local3 = new RefilItem(References.gameClip1, _local1, _local2, newObjects, messageCallback);
newObjects.push(_local3);
}
public function tick(){
while ((((agos[agosIndex].tick == tickCounter)) && (agosLeft))) {
spawnAnts(agos[agosIndex].tick, agos[agosIndex].types);
if ((agosIndex + 1) >= agos.length){
agosLeft = false;
if (caterpillar){
caterpillar.goHide();
caterpillar = null;
};
messageCallback("No more to spawn", null);
} else {
agosIndex++;
};
if (spawner){
createCaterpillar();
spawner = false;
};
};
tickCounter++;
}
public function setupWave(_arg1:int){
var _local2:XML;
var _local3:int;
var _local4:int;
var _local5:InfoData;
var _local6:int;
var _local7:int;
var _local8:String;
var _local9:Array;
var _local10:XML;
if (LOAD_XML){
if (!xmlLoaded){
trace("Xml was not loaded.");
return;
};
generatorXML = loadedXML;
};
agos = new Array();
agosIndex = 0;
spawner = false;
specialPowerCreatePercent = 0;
specialPowerPositivePercent = 0;
if (LOAD_XML){
_local3 = int(generatorXML.debug_seed[0].@nr);
References.seed = _local3;
References.createRandom(References.seed);
};
for each (_local2 in generatorXML.wave) {
if (_local2.@nr == String(_arg1)){
_local4 = int(_local2.shots[0].@nr);
_local5 = new InfoData();
_local5.data1 = _local4;
messageCallback("Add shots", _local5);
specialPowerCreatePercent = int(_local2.special_powers[0].@percent);
specialPowerPositivePercent = int(_local2.special_powers[0].@positive_percent);
speedDiffPercent = int(_local2.speed_diff[0].@percent);
if (_local2.spawner[0].@on == "yes"){
spawner = true;
caterpillarSpeed = Number(_local2.spawner[0].@speed);
mothSpeed = Number(_local2.spawner[0].@spawned_speed);
spawnerWaitFrames = Number(_local2.spawner[0].@wait_frames);
spawnerMaxSpawn = Number(_local2.spawner[0].@max_nr);
spawnerMinSpawnInterval = Number(_local2.spawner[0].@min_interval);
spawnerMaxSpawnInterval = Number(_local2.spawner[0].@max_interval);
};
b1MaxSpawn = Number(_local2.b1_spawn[0].@max_nr);
b1MinSpawnInterval = Number(_local2.b1_spawn[0].@min_interval);
b1MaxSpawnInterval = Number(_local2.b1_spawn[0].@max_interval);
bug1Speed = Number(_local2.b1[0].@speed);
bug2Speed = Number(_local2.b2[0].@speed);
bug3Speed = Number(_local2.b3[0].@speed);
flySpeed = Number(_local2.f[0].@speed);
for each (_local10 in _local2.ant) {
_local9 = new Array();
_local6 = int(_local10.@tick);
_local8 = _local10.@type;
if (_local8.search("b1") != -1){
_local9.push(AGO.B1);
};
if (_local8.search("b2") != -1){
_local9.push(AGO.B2);
};
if (_local8.search("b3") != -1){
_local9.push(AGO.B3);
};
if (_local8.search("f") != -1){
_local9.push(AGO.F);
};
agos.push(new AGO(_local6, _local9));
};
};
};
if (agos.length == 0){
agosLeft = false;
} else {
agosLeft = true;
};
clearAntSpawnSlots();
caterpillar = null;
tickCounter = 0;
}
private function onLoadError(_arg1:IOErrorEvent):void{
xmlLoaded = false;
}
private function createShieldItem(){
var _local1:Number;
var _local2:Number;
var _local3:ShieldItem;
_local1 = getRandPosX(SPECIAL_POWERS_MIN_X, SPECIAL_POWERS_MAX_X, 40);
_local2 = getRandPosY(SPECIAL_POWERS_MIN_Y, SPECIAL_POWERS_MAX_Y, 40);
_local3 = new ShieldItem(References.gameClip1, _local1, _local2, newObjects, messageCallback);
newObjects.push(_local3);
}
private function getRandPosX(_arg1:int, _arg2:int, _arg3:int):int{
var _local4:int;
_local4 = Math.ceil((_arg3 / 2));
return (((_arg1 + _local4) + References.random.nextInt(((_arg2 - _local4) - (_arg1 + _local4)))));
}
private function getRandPosY(_arg1:int, _arg2:int, _arg3:int):int{
var _local4:int;
_local4 = Math.ceil((_arg3 / 2));
return (((_arg1 + _local4) + References.random.nextInt(((_arg2 - _local4) - (_arg1 + _local4)))));
}
private function createBoostItem(){
var _local1:Number;
var _local2:Number;
var _local3:BoostItem;
_local1 = getRandPosX(SPECIAL_POWERS_MIN_X, SPECIAL_POWERS_MAX_X, 40);
_local2 = getRandPosY(SPECIAL_POWERS_MIN_Y, SPECIAL_POWERS_MAX_Y, 40);
_local3 = new BoostItem(References.gameClip1, _local1, _local2, newObjects, messageCallback);
newObjects.push(_local3);
}
public function createNewSpawner(){
spawner = true;
}
private function createGumItem(){
var _local1:Number;
var _local2:Number;
var _local3:GumItem;
_local1 = getRandPosX(SPECIAL_POWERS_MIN_X, SPECIAL_POWERS_MAX_X, 40);
_local2 = getRandPosY(SPECIAL_POWERS_MIN_Y, (SPECIAL_POWERS_MAX_Y - 150), 60);
_local3 = new GumItem(References.gameClip1, _local1, _local2, 90, 1, newObjects, messageCallback);
newObjects.push(_local3);
}
public function handleSpecialPowers(){
var _local1:int;
var _local2:int;
_local1 = (References.random.nextInt(100) + 1);
if ((((_local1 > 0)) && ((_local1 <= specialPowerCreatePercent)))){
_local1 = (References.random.nextInt(100) + 1);
if ((((_local1 > 0)) && ((_local1 <= specialPowerPositivePercent)))){
_local1 = References.random.nextInt(100);
_local2 = 25;
if (_local1 < _local2){
createSuperSprayItem();
} else {
if (_local1 < (2 * _local2)){
createShieldItem();
} else {
if (_local1 < (3 * _local2)){
createRefilItem();
} else {
if (_local1 < (4 * _local2)){
createBoostItem();
};
};
};
};
} else {
_local1 = References.random.nextInt(100);
_local2 = 50;
if (_local1 < _local2){
createGumItem();
} else {
if (_local1 < (2 * _local2)){
createFeromoneItem();
};
};
};
};
}
private function createCaterpillar(){
var _local1:Number;
_local1 = (References.random.nextInt((speedDiffPercent + 1)) - ((speedDiffPercent + 1) / 2));
caterpillar = new Caterpillar(References.gameClip3, speedHelper(caterpillarSpeed, speedDiffPercent), speedHelper(mothSpeed, speedDiffPercent), spawnerWaitFrames, spawnerMaxSpawn, spawnerMinSpawnInterval, spawnerMaxSpawnInterval, newObjects, messageCallback);
newObjects.push(caterpillar);
}
private function createSuperSprayItem(){
var _local1:Number;
var _local2:Number;
var _local3:SuperSprayItem;
_local1 = getRandPosX(SPECIAL_POWERS_MIN_X, SPECIAL_POWERS_MAX_X, 40);
_local2 = getRandPosY(SPECIAL_POWERS_MIN_Y, SPECIAL_POWERS_MAX_Y, 40);
_local3 = new SuperSprayItem(References.gameClip1, _local1, _local2, newObjects, messageCallback);
newObjects.push(_local3);
}
private function onComplete(_arg1:Event):void{
var event = _arg1;
try {
loadedXML = new XML(loader.data);
} catch(e:Error) {
return;
};
xmlLoaded = true;
}
private function spawnRandomAnt(_arg1:int, _arg2:Array){
var _local3:int;
_local3 = References.random.nextInt(_arg2.length);
spawnAnt(_arg1, _arg2[_local3]);
}
private function createFeromoneItem(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Number;
var _local6:Number;
var _local7:FeromoneItem;
_local1 = References.random.nextInt(1);
_local2 = 45;
if (_local1 == 0){
_local3 = 0;
_local4 = -100;
} else {
_local3 = 100;
_local4 = 0;
_local2 = (_local2 * -1);
};
_local5 = getRandPosX((SPECIAL_POWERS_MIN_X + _local3), (SPECIAL_POWERS_MAX_X + _local4), 40);
_local6 = getRandPosY(SPECIAL_POWERS_MIN_Y, (SPECIAL_POWERS_MAX_Y - 100), 40);
_local7 = new FeromoneItem(References.gameClip1, _local5, _local6, 45, 1, newObjects, messageCallback);
newObjects.push(_local7);
}
private function clearAntSpawnSlots(){
var _local1:*;
_local1 = 0;
while (_local1 < antSpawnSlots.length) {
antSpawnSlots[_local1] = false;
_local1++;
};
}
private function spawnAnt(_arg1:int, _arg2:int){
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Number;
var _local8:Ant;
_local3 = ((((ANT_SPAWN_X_OFFSET / 2) + (_arg1 * ANT_SPAWN_X_OFFSET)) + References.random.nextInt(ANT_SPAWN_RAND_X_DIFF)) - (ANT_SPAWN_RAND_X_DIFF / 2));
_local4 = -(References.random.nextInt(ANT_SPAWN_RAND_Y_DIFF));
_local5 = int(((XPMath.atan2((PLAY_FIELD_MAX_Y - _local4), (PLAY_FIELD_MIN_X - _local3)) * 180) / Math.PI));
_local6 = int(((XPMath.atan2((PLAY_FIELD_MAX_Y - _local4), (PLAY_FIELD_MAX_X - _local3)) * 180) / Math.PI));
_local7 = (_local6 + References.random.nextInt((_local5 - _local6)));
switch (_arg2){
case AGO.B1:
_local8 = new Bug1(References.gameClip3, _local3, _local4, _local7, speedHelper(bug1Speed, speedDiffPercent), b1MaxSpawn, b1MinSpawnInterval, b1MaxSpawnInterval, newObjects, messageCallback);
break;
case AGO.B2:
_local8 = new Bug2(References.gameClip3, _local3, _local4, _local7, speedHelper(bug2Speed, speedDiffPercent), newObjects, messageCallback);
break;
case AGO.B3:
_local8 = new Bug3(References.gameClip3, _local3, _local4, _local7, speedHelper(bug3Speed, speedDiffPercent), newObjects, messageCallback);
break;
case AGO.F:
_local8 = new Fly(References.gameClip3, _local3, _local4, _local7, speedHelper(flySpeed, speedDiffPercent), newObjects, messageCallback);
break;
};
newObjects.push(_local8);
}
public static function speedHelper(_arg1:Number, _arg2:int):Number{
var _local3:Number;
var _local4:Number;
var _local5:int;
_local4 = ((References.random.nextInt((_arg2 + 1)) / 2) / 100);
_local5 = References.random.nextInt(2);
if (_local5 == 0){
_local3 = (_arg1 + (_local4 * _arg1));
} else {
_local3 = (_arg1 - (_local4 * _arg1));
};
return (_local3);
}
}
}//package com.king.daisy_defender
Section 4
//BaseObject (com.king.daisy_defender.BaseObject)
package com.king.daisy_defender {
import flash.display.*;
import com.king.daisy_defender.*;
class BaseObject {
public var posX:Number;
public var posY:Number;
protected var startPosX:Number;
protected var startPosY:Number;
public var collisionObject:CollisionObject;
protected var parentClip:MovieClip;
protected var trajectorClip:Shape;
protected var oldRenderAngle:Number;
public var instanceNr:int;
protected var oldRenderPosX:Number;
protected var movX:Number;
protected var movY:Number;
protected var angleOffset:Number;
public var speed:Number;
protected var oldRenderPosY:Number;
protected var minX:Number;
protected var minY:Number;
protected var clip:MovieClip;
public var angle:Number;
protected var newObjects:Array;
protected var animFrame:Number;
public var collidable:Boolean;
public var toBeRemoved:Boolean;
protected var animIFloat:IFloat;
protected var messageCallback:Function;
public var visible:Boolean;
protected var maxX:Number;
protected var maxY:Number;
public static var nrInstances:int = 0;
function BaseObject(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Array, _arg5:Function){
this.parentClip = _arg1;
this.newObjects = _arg4;
this.messageCallback = _arg5;
initialize(_arg2, _arg3);
createClip();
createCollisionObject();
animIFloat = new IFloat(animFrame);
instanceNr = nrInstances;
nrInstances++;
}
protected function createCollisionObject():void{
collisionObject = null;
}
protected function initialize(_arg1:Number, _arg2:Number){
this.posX = _arg1;
this.posY = _arg2;
movX = 0;
movY = 0;
angle = 0;
angleOffset = 0;
speed = 0;
minX = -1000;
maxX = 1000;
minY = -1000;
maxY = 1000;
animFrame = 1;
visible = true;
collidable = true;
toBeRemoved = false;
startPosX = posX;
startPosY = posY;
}
protected function createTrajectorClip():void{
var _local1:MovieClip;
_local1 = References.gameClip5;
trajectorClip = new Shape();
_local1.addChild(trajectorClip);
trajectorClip.graphics.lineStyle(2, 0x7700, 0.2);
trajectorClip.graphics.moveTo(startPosX, startPosY);
trajectorClip.graphics.lineTo(posX, posY);
}
public function tick(){
posX = (posX + movX);
posY = (posY + movY);
if (collisionObject){
collisionObject.setPos(posX, posY);
};
if ((((((((posX < minX)) || ((posX > maxX)))) || ((posY < minY)))) || ((posY > maxY)))){
visible = false;
collidable = false;
toBeRemoved = true;
};
animIFloat.setTo(animFrame);
}
public function render(_arg1:Number){
var _local2:int;
if (((((!((posX == oldRenderPosX))) || (!((posY == oldRenderPosY))))) || (!((angle == oldRenderAngle))))){
clip.x = posX;
clip.y = posY;
clip.rotation = (angle + angleOffset);
};
_local2 = Math.round(animIFloat.method_2(_arg1));
clip.gotoAndStop(_local2);
if (visible){
clip.visible = true;
} else {
clip.visible = false;
};
oldRenderPosX = posX;
oldRenderPosY = posY;
oldRenderAngle = angle;
if (((collisionObject) && (collidable))){
collisionObject.render();
};
}
public function setToBeRemoved(){
visible = false;
collidable = false;
toBeRemoved = true;
}
public function deleting(){
parentClip.removeChild(clip);
clip = null;
if (collisionObject){
collisionObject.deleteClip();
};
collisionObject = null;
deleteTrajectorClip();
}
protected function deleteTrajectorClip(){
var _local1:MovieClip;
_local1 = References.gameClip5;
if (trajectorClip){
_local1.removeChild(trajectorClip);
};
trajectorClip = null;
}
public function collisionReaction(_arg1:BaseObject){
}
public function explode(){
}
protected function createClip():void{
clip = null;
}
public function collisionTest(_arg1:BaseObject){
if (((((((collisionObject) && (_arg1.collisionObject))) && (collidable))) && (_arg1.collidable))){
if (collisionObject.collisionTest(_arg1.collisionObject)){
return (true);
};
};
return (false);
}
}
}//package com.king.daisy_defender
Section 5
//BoostItem (com.king.daisy_defender.BoostItem)
package com.king.daisy_defender {
import flash.display.*;
class BoostItem extends SpecialItem {
function BoostItem(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Array, _arg5:Function){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
tickCounter = 0;
}
override public function collisionReaction(_arg1:BaseObject){
if ((_arg1 is Explosion)){
messageCallback("BoostItem taken", null);
};
super.collisionReaction(_arg1);
}
override protected function createClip():void{
clip = new mc_boost();
clip.visible = false;
parentClip.addChild(clip);
clip.cacheAsBitmap = true;
}
override protected function createCollisionObject():void{
collisionObject = new CollisionObject(0, 0, 40);
}
}
}//package com.king.daisy_defender
Section 6
//Bug1 (com.king.daisy_defender.Bug1)
package com.king.daisy_defender {
import flash.display.*;
import com.king.daisy_defender.*;
class Bug1 extends Ant {
public var minSpawnIntervalFrames:int;// = 25
private var tickCounter:int;
public var maxSpawnIntervalFrames:int;// = 250
public var maxSpawnAtOnce:int;// = 3
private var state:int;
private var blinkCounter:int;
private var spawnInterval:int;
public var SPAWN_END_Y:int;// = 270
public static var STATE_NORMAL:int = 0;
public static var STATE_BLINK:int = 1;
function Bug1(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:int, _arg7:int, _arg8:int, _arg9:Array, _arg10:Function){
maxSpawnAtOnce = 3;
minSpawnIntervalFrames = 25;
maxSpawnIntervalFrames = 250;
SPAWN_END_Y = 270;
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg9, _arg10);
this.maxSpawnAtOnce = _arg6;
this.minSpawnIntervalFrames = _arg7;
this.maxSpawnIntervalFrames = _arg8;
animFrame = Math.floor(((Math.random() * 4) + 1));
animIFloat.setTo(animFrame);
newSpawnInterval();
tickCounter = 0;
state = STATE_NORMAL;
blinkCounter = 0;
}
private function newSpawnInterval(){
spawnInterval = (minSpawnIntervalFrames + References.random.nextInt((maxSpawnIntervalFrames - minSpawnIntervalFrames)));
}
override public function tick(){
var _local1:int;
switch (state){
case STATE_NORMAL:
if ((((tickCounter == spawnInterval)) && ((posY < SPAWN_END_Y)))){
tickCounter = 0;
state = STATE_BLINK;
};
break;
case STATE_BLINK:
if (blinkCounter < 5){
visible = false;
} else {
visible = true;
};
blinkCounter++;
if (blinkCounter == 9){
blinkCounter = 0;
};
if (tickCounter == 25){
_local1 = (References.random.nextInt(maxSpawnAtOnce) + 1);
if (maxSpawnAtOnce == 0){
_local1 = 0;
};
spawn(_local1);
newSpawnInterval();
tickCounter = 0;
visible = true;
state = STATE_NORMAL;
};
break;
};
tickCounter++;
if (animCounter == 1){
if (animFrame < 4){
animFrame = (animFrame + 1);
} else {
animFrame = 1;
};
animCounter = 0;
};
animCounter++;
super.tick();
}
public function createAnt(_arg1:Number):void{
var _local2:Ant;
_local2 = new Bug1(References.gameClip3, posX, posY, _arg1, AntGenerator.speedHelper(oldSpeed, AntGenerator.speedDiffPercent), maxSpawnAtOnce, minSpawnIntervalFrames, maxSpawnIntervalFrames, newObjects, messageCallback);
newObjects.push(_local2);
}
private function spawn(_arg1:int){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:*;
var _local8:int;
if (_arg1 == 0){
return;
};
_arg1++;
_local2 = ((XPMath.atan2((AntGenerator.PLAY_FIELD_MAX_Y - posY), (AntGenerator.PLAY_FIELD_MIN_X - posX)) * 180) / Math.PI);
_local3 = ((XPMath.atan2((AntGenerator.PLAY_FIELD_MAX_Y - posY), (AntGenerator.PLAY_FIELD_MAX_X - posX)) * 180) / Math.PI);
_local4 = (_local2 - _local3);
_local5 = int((_local4 / _arg1));
_local6 = _local3;
_local7 = 0;
while (_local7 < _arg1) {
if ((((angle >= (_local3 + (_local5 * _local7)))) && ((angle < (_local3 + (_local5 * (_local7 + 1))))))){
} else {
_local6 = (_local3 + (_local5 * _local7));
_local8 = 5;
if (_local7 == (_arg1 - 1)){
_local8 = 0;
};
_local6 = (_local6 + References.random.nextInt(int((_local5 - _local8))));
createAnt(_local6);
};
_local7++;
};
}
override protected function createClip():void{
clip = new BitmapBug1();
clip.visible = false;
angleOffset = -90;
parentClip.addChild(clip);
}
override protected function explode2(){
super.explode2();
messageCallback("Bug1 killed on ground", null);
}
override protected function createCollisionObject():void{
collisionObject = new CollisionObject(0, 0, 26);
}
override protected function createExplosion(_arg1:Boolean, _arg2:ExplosionLevel){
var _local3:Explosion;
_local3 = new Explosion(References.game2Clip3, posX, posY, START_EXPLOSION_DIAMETER, END_EXPLOSION_DIAMETER, 0, Explosion.COLOR_BUG1, _arg1, _arg2, newObjects, messageCallback);
newObjects.push(_local3);
}
override public function antExplode(_arg1:ExplosionLevel){
var _local2:InfoData;
super.antExplode(_arg1);
_local2 = new InfoData();
_local2.data1 = posX;
_local2.data2 = posY;
_local2.data3 = _arg1.level;
messageCallback("Bug1 killed", _local2);
}
}
}//package com.king.daisy_defender
Section 7
//Bug2 (com.king.daisy_defender.Bug2)
package com.king.daisy_defender {
import flash.display.*;
import com.king.daisy_defender.*;
class Bug2 extends Ant {
function Bug2(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Array, _arg7:Function){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
animFrame = Math.floor(((Math.random() * 4) + 1));
animIFloat.setTo(animFrame);
}
override public function tick(){
if (animCounter == 1){
if (animFrame < 4){
animFrame = (animFrame + 1);
} else {
animFrame = 1;
};
animCounter = 0;
};
animCounter++;
super.tick();
}
override protected function createClip():void{
clip = new BitmapBug2();
clip.visible = false;
angleOffset = -90;
parentClip.addChild(clip);
}
override protected function explode2(){
super.explode2();
messageCallback("Bug2 killed on ground", null);
}
override protected function createCollisionObject():void{
collisionObject = new CollisionObject(0, 0, 38);
}
override protected function createExplosion(_arg1:Boolean, _arg2:ExplosionLevel){
var _local3:Explosion;
_local3 = new Explosion(References.game2Clip3, posX, posY, START_EXPLOSION_DIAMETER, END_EXPLOSION_DIAMETER, 0, Explosion.COLOR_BUG2, _arg1, _arg2, newObjects, messageCallback);
newObjects.push(_local3);
}
override public function antExplode(_arg1:ExplosionLevel){
var _local2:InfoData;
super.antExplode(_arg1);
_local2 = new InfoData();
_local2.data1 = posX;
_local2.data2 = posY;
_local2.data3 = _arg1.level;
messageCallback("Bug2 killed", _local2);
}
}
}//package com.king.daisy_defender
Section 8
//Bug3 (com.king.daisy_defender.Bug3)
package com.king.daisy_defender {
import flash.display.*;
import com.king.daisy_defender.*;
class Bug3 extends Ant {
private var tickCounter:int;
private var angry:Boolean;
private var state:int;
private var blinkCounter:int;
private var hits:int;
public static var IMMUNE_FRAMES:int = 95;
public static var STATE_NORMAL:int = 0;
public static var STATE_BLINK:int = 1;
public static var HITS_BEFORE_KILLED:int = 2;
function Bug3(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Array, _arg7:Function){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
animFrame = Math.floor(((Math.random() * 4) + 1));
animIFloat.setTo(animFrame);
hits = 0;
tickCounter = IMMUNE_FRAMES;
state = STATE_NORMAL;
angry = false;
}
override public function tick(){
switch (state){
case STATE_NORMAL:
break;
case STATE_BLINK:
if (blinkCounter < 5){
visible = false;
} else {
visible = true;
};
blinkCounter++;
if (blinkCounter == 9){
blinkCounter = 0;
};
if (tickCounter == IMMUNE_FRAMES){
collidable = true;
state = STATE_NORMAL;
};
break;
};
tickCounter++;
if (!angry){
if (animCounter == 1){
if (animFrame < 4){
animFrame = (animFrame + 1);
} else {
animFrame = 1;
};
animCounter = 0;
};
animCounter++;
} else {
if (animCounter == 1){
if (animFrame < 8){
animFrame = (animFrame + 1);
} else {
animFrame = 5;
};
animCounter = 0;
};
animCounter++;
};
super.tick();
}
override protected function createClip():void{
clip = new BitmapBug3();
clip.visible = false;
angleOffset = -90;
parentClip.addChild(clip);
}
override protected function explode2(){
super.explode2();
messageCallback("Bug3 killed on ground", null);
}
override protected function createCollisionObject():void{
collisionObject = new CollisionObject(0, 0, 42);
}
override protected function createExplosion(_arg1:Boolean, _arg2:ExplosionLevel){
var _local3:Explosion;
_local3 = new Explosion(References.game2Clip3, posX, posY, START_EXPLOSION_DIAMETER, END_EXPLOSION_DIAMETER, 0, Explosion.COLOR_BUG3, _arg1, _arg2, newObjects, messageCallback);
newObjects.push(_local3);
}
override public function antExplode(_arg1:ExplosionLevel){
var _local2:InfoData;
if (tickCounter >= IMMUNE_FRAMES){
if (hits == 0){
blinkCounter = 0;
collidable = false;
state = STATE_BLINK;
angry = true;
animFrame = (animFrame + 4);
};
hits++;
tickCounter = 0;
if (hits >= HITS_BEFORE_KILLED){
super.antExplode(_arg1);
_local2 = new InfoData();
_local2.data1 = posX;
_local2.data2 = posY;
_local2.data3 = _arg1.level;
messageCallback("Bug3 killed", _local2);
};
};
}
}
}//package com.king.daisy_defender
Section 9
//Cannon (com.king.daisy_defender.Cannon)
package com.king.daisy_defender {
import flash.display.*;
import flash.filters.*;
import com.king.daisy_defender.*;
class Cannon extends BaseObject {
private var tickCounter:int;
private var fireTime:Number;
private var state:int;
private var reloadTickTime:int;
private var fireAngle:Number;
private var firePosY:Number;
private var floatAnimFrame:Number;
private var shotsLeft:int;
private var firePosX:Number;
public static var STATE_WAIT:int = 0;
public static var STATE_FIRE:int = 1;
public static var STATE_RELOAD:int = 2;
function Cannon(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Array, _arg5:Function){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
this.angle = 0;
shotsLeft = 0;
state = STATE_WAIT;
tickCounter = 0;
reloadTickTime = Sight.FIRE_RELOAD_DELAY_FRAMES;
}
override protected function createClip():void{
clip = new mc_insecticide();
clip.visible = false;
parentClip.addChild(clip);
clip.width = 56;
clip.height = 126;
applayShadow();
clip.cacheAsBitmap = true;
}
private function applayShadow(){
var _local1:BitmapFilter;
var _local2:Array;
_local1 = getBitmapFilter();
_local2 = new Array();
_local2.push(_local1);
clip.filters = _local2;
}
override public function tick(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
switch (state){
case STATE_WAIT:
break;
case STATE_FIRE:
if (animFrame == 1){
animFrame = (animFrame + 4);
} else {
animFrame = (animFrame + 5);
};
if (animFrame >= 24){
floatAnimFrame = 24;
animFrame = 24;
state = STATE_RELOAD;
};
break;
case STATE_RELOAD:
_local3 = (24 / reloadTickTime);
floatAnimFrame = (floatAnimFrame - _local3);
animFrame = Math.round(floatAnimFrame);
if (animFrame <= 1){
animFrame = 1;
state = STATE_WAIT;
};
break;
};
_local1 = Input.xMouse;
_local2 = Input.yMouse;
angle = (((XPMath.atan2((posX - _local1), (_local2 - posY)) * 180) / Math.PI) - 180);
if ((((angle < -60)) && ((angle >= -180)))){
angle = -60;
} else {
if ((((angle < -180)) && ((angle > -300)))){
angle = -300;
};
};
super.tick();
tickCounter++;
animIFloat.setTo(animFrame);
}
override public function render(_arg1:Number){
super.render(_arg1);
if (clip.Cannon_txt){
clip.Cannon_txt.text = String(shotsLeft);
};
}
public function setShotsLeft(_arg1:int){
this.shotsLeft = _arg1;
}
private function fireSpray(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:SprayShot;
_local1 = (angle - 90);
_local2 = (45 * XPMath.cos(((_local1 * Math.PI) / 180)));
_local3 = (45 * XPMath.sin(((_local1 * Math.PI) / 180)));
_local4 = (posX + _local2);
_local5 = (posY + _local3);
_local6 = ((XPMath.atan2((firePosY - _local5), (firePosX - _local4)) * 180) / Math.PI);
_local7 = Math.sqrt((((firePosX - _local4) * (firePosX - _local4)) + ((firePosY - _local5) * (firePosY - _local5))));
speed = (_local7 / fireTime);
_local8 = new SprayShot(References.gameClip3, _local4, _local5, _local6, speed, fireTime, newObjects, messageCallback);
newObjects.push(_local8);
}
public function fire(_arg1:Number, _arg2:Number, _arg3:Number){
this.firePosX = _arg1;
this.firePosY = _arg2;
this.fireTime = _arg3;
fireAngle = angle;
fireSpray();
animFrame = 1;
state = STATE_FIRE;
}
override public function collisionReaction(_arg1:BaseObject){
}
private function getBitmapFilter():BitmapFilter{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Boolean;
var _local9:Boolean;
var _local10:Number;
_local1 = 0;
_local2 = 90;
_local3 = 1;
_local4 = 5;
_local5 = 5;
_local6 = 5;
_local7 = 0.2;
_local8 = false;
_local9 = false;
_local10 = BitmapFilterQuality.LOW;
return (new DropShadowFilter(_local6, _local2, _local1, _local3, _local4, _local5, _local7, _local10, _local8, _local9));
}
}
}//package com.king.daisy_defender
Section 10
//Caterpillar (com.king.daisy_defender.Caterpillar)
package com.king.daisy_defender {
import flash.display.*;
import com.king.daisy_defender.*;
class Caterpillar extends Ant {
private var spawnedSpeed:Number;
private var blinkCounter:int;
private var hideAndRemove:Boolean;
private var maxSpawnIntervalFrames:int;
private var collisionObject1:CollisionObject;
private var collisionObject2:CollisionObject;
private var collisionObject3:CollisionObject;
private var spawnInterval:int;
private var minSpawnIntervalFrames:int;
private var state:int;
private var tickCounter:int;
private var maxSpawnAtOnce:int;
private var waitFrames:int;
private var maxWaitFrames:int;
public static var START_MAX_Y:int = 300;
public static var STATE_WAIT:int = 1;
public static var START_RIGHT_POS_X:int = 600;
public static var START_MIN_Y:int = 50;
public static var START_LEFT_POS_X:int = -20;
public static var STATE_MOVE:int = 0;
function Caterpillar(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:Array, _arg9:Function){
super(_arg1, 0, 0, 0, _arg2, _arg8, _arg9);
this.maxWaitFrames = _arg4;
this.maxSpawnAtOnce = _arg5;
this.minSpawnIntervalFrames = _arg6;
this.maxSpawnIntervalFrames = _arg7;
posX = -100;
posY = -100;
this.spawnedSpeed = _arg3;
minX = (START_LEFT_POS_X - 10);
maxX = (START_RIGHT_POS_X + 10);
waitFrames = References.random.nextInt(_arg4);
hideAndRemove = false;
state = STATE_WAIT;
tickCounter = 0;
}
public function goHide(){
hideAndRemove = true;
}
override protected function createClip():void{
clip = new BitmapCaterpillar();
clip.visible = false;
angleOffset = 0;
parentClip.addChild(clip);
}
private function randomSetup(){
var _local1:int;
_local1 = References.random.nextInt(2);
if (_local1 == 0){
posX = START_LEFT_POS_X;
angle = 0;
movX = speed;
} else {
posX = START_RIGHT_POS_X;
angle = 180;
movX = -(speed);
};
posY = (START_MIN_Y + References.random.nextInt((START_MAX_Y - START_MIN_Y)));
newSpawnInterval();
}
override public function collisionReaction(_arg1:BaseObject){
var _local2:Explosion;
var _local3:ExplosionLevel;
var _local4:int;
if ((_arg1 is Explosion)){
if (((((collisionObject1.collisionTest(_arg1.collisionObject)) || (collisionObject2.collisionTest(_arg1.collisionObject)))) || (collisionObject3.collisionTest(_arg1.collisionObject)))){
_local2 = Explosion(_arg1);
_local3 = _local2.explosionLevel;
antExplode(_local3);
_local4 = AGO.C;
};
};
}
override protected function createCollisionObject():void{
collisionObject = new CollisionObject(0, 0, 60);
collisionObject1 = new CollisionObject(0, 0, 22);
collisionObject2 = new CollisionObject(0, 0, 22);
collisionObject3 = new CollisionObject(0, 0, 22);
}
override public function render(_arg1:Number){
super.render(_arg1);
if (((collisionObject) && (collidable))){
collisionObject1.render();
collisionObject2.render();
collisionObject3.render();
};
}
override protected function createExplosion(_arg1:Boolean, _arg2:ExplosionLevel){
var _local3:Explosion;
_local3 = new Explosion(References.game2Clip3, posX, posY, START_EXPLOSION_DIAMETER, END_EXPLOSION_DIAMETER, 0, Explosion.COLOR_CATERPILLAR, _arg1, _arg2, newObjects, messageCallback);
newObjects.push(_local3);
}
override public function tick(){
var _local1:int;
var _local2:int;
switch (state){
case STATE_MOVE:
posX = (posX + movX);
posY = (posY + movY);
visible = true;
if ((((((((posX < minX)) || ((posX > maxX)))) || ((posY < minY)))) || ((posY > maxY)))){
waitFrames = References.random.nextInt(maxWaitFrames);
tickCounter = 0;
state = STATE_WAIT;
};
if ((((tickCounter >= (spawnInterval - 24))) && (!(hideAndRemove)))){
if (blinkCounter < 5){
visible = false;
} else {
visible = true;
};
blinkCounter++;
if (blinkCounter == 9){
blinkCounter = 0;
};
};
if ((((tickCounter == spawnInterval)) && (!(hideAndRemove)))){
visible = true;
_local1 = (References.random.nextInt((maxSpawnAtOnce - 1)) + 2);
_local2 = 1;
spawn(_local1);
newSpawnInterval();
tickCounter = 0;
};
break;
case STATE_WAIT:
if (hideAndRemove){
setToBeRemoved();
};
visible = false;
if (tickCounter == waitFrames){
randomSetup();
tickCounter = 0;
state = STATE_MOVE;
};
break;
};
tickCounter++;
if (animCounter == 1){
animFrame = 1;
} else {
if (animCounter == 11){
animFrame = 2;
} else {
if (animCounter == 20){
animCounter = 0;
};
};
};
animCounter++;
if (collisionObject){
collisionObject.setPos(posX, posY);
collisionObject1.setPos((posX - 18), posY);
collisionObject2.setPos(posX, posY);
collisionObject3.setPos((posX + 18), posY);
};
animIFloat.setTo(animFrame);
}
override public function deleting(){
if (collisionObject){
collisionObject1.deleteClip();
collisionObject1 = null;
collisionObject2.deleteClip();
collisionObject2 = null;
collisionObject3.deleteClip();
collisionObject3 = null;
};
super.deleting();
}
private function createMoth(_arg1:Number, _arg2:Number){
var _local3:Moth;
_local3 = new Moth(References.gameClip3, posX, posY, _arg1, _arg2, newObjects, messageCallback);
newObjects.push(_local3);
}
private function spawn(_arg1:int){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:int;
var _local6:Number;
var _local7:*;
_local2 = ((XPMath.atan2((AntGenerator.PLAY_FIELD_MAX_Y - posY), (AntGenerator.PLAY_FIELD_MIN_X - posX)) * 180) / Math.PI);
_local3 = ((XPMath.atan2((AntGenerator.PLAY_FIELD_MAX_Y - posY), (AntGenerator.PLAY_FIELD_MAX_X - posX)) * 180) / Math.PI);
_local4 = (_local2 - _local3);
_local5 = int((_local4 / _arg1));
_local6 = _local3;
_local7 = 0;
while (_local7 < _arg1) {
_local6 = (_local3 + (_local5 * _local7));
_local6 = (_local6 + References.random.nextInt((_local5 - 5)));
createMoth(_local6, spawnedSpeed);
_local7++;
};
}
private function newSpawnInterval(){
spawnInterval = (minSpawnIntervalFrames + References.random.nextInt((maxSpawnIntervalFrames - minSpawnIntervalFrames)));
}
override public function antExplode(_arg1:ExplosionLevel){
var _local2:InfoData;
_arg1.level--;
super.antExplode(_arg1);
_local2 = new InfoData();
_local2.data1 = posX;
_local2.data2 = posY;
_local2.data3 = _arg1.level;
messageCallback("Caterpillar killed", _local2);
}
}
}//package com.king.daisy_defender
Section 11
//CollisionObject (com.king.daisy_defender.CollisionObject)
package com.king.daisy_defender {
import flash.display.*;
import com.king.daisy_defender.*;
class CollisionObject {
private var circle:Circle;
private var clip:Shape;
private var parentClip:MovieClip;
public static var COLLISION_RENDER:Boolean = false;
function CollisionObject(_arg1:Number, _arg2:Number, _arg3:Number):void{
circle = new Circle();
circle.diameter = _arg3;
setPos(_arg1, _arg2);
parentClip = References.gameCollisionClip;
}
public function method_1(_arg1:Number, _arg2:Number, _arg3:Number):void{
circle.diameter = _arg3;
circle.posX = (_arg1 - (circle.diameter / 2));
circle.posY = (_arg2 - (circle.diameter / 2));
}
private function createClipAndDrawCircles():void{
clip = new Shape();
parentClip.addChild(clip);
clip.graphics.lineStyle(1, 0xFF0000);
clip.graphics.drawCircle((circle.diameter / 2), (circle.diameter / 2), (circle.diameter / 2));
}
public function collisionTest(_arg1:CollisionObject):Boolean{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = ((circle.posX + (circle.diameter / 2)) - (_arg1.circle.posX + (_arg1.circle.diameter / 2)));
_local3 = ((circle.posY + (circle.diameter / 2)) - (_arg1.circle.posY + (_arg1.circle.diameter / 2)));
_local4 = ((_local2 * _local2) + (_local3 * _local3));
if (_local4 <= (((circle.diameter / 2) + (_arg1.circle.diameter / 2)) * ((circle.diameter / 2) + (_arg1.circle.diameter / 2)))){
return (true);
};
return (false);
}
public function setPos(_arg1:Number, _arg2:Number):void{
circle.posX = (_arg1 - (circle.diameter / 2));
circle.posY = (_arg2 - (circle.diameter / 2));
}
public function render():void{
if (COLLISION_RENDER){
deleteClip();
createClipAndDrawCircles();
clip.x = circle.posX;
clip.y = circle.posY;
};
}
public function deleteClip(){
if (clip){
parentClip.removeChild(clip);
};
clip = null;
}
}
}//package com.king.daisy_defender
Section 12
//Communicator (com.king.daisy_defender.Communicator)
package com.king.daisy_defender {
import com.king.daisy_defender.*;
import flash.system.*;
import flash.xml.*;
class Communicator {
private static var moneyGame:Boolean = true;
public static var randomSeed:Number;
private static var NORMAL:Boolean = true;
public static var lang;
private static var freeGame:Boolean = false;
public static function isFreeGame():Boolean{
return (freeGame);
}
public static function gameEnd(_arg1){
if (NORMAL){
fscommand("gameEnd", _arg1);
};
}
public static function sendPlayDataScore(_arg1, _arg2:int, _arg3:int, _arg4:int, _arg5:Number, _arg6:Number){
if (moneyGame){
fscommand("playData", (((((((((((_arg1 + ",") + _arg2) + ",") + _arg3) + ",") + _arg4) + ",") + _arg5) + ",") + _arg6) + ",0=0"));
};
}
public static function sendPlayDataExplosion(_arg1:int, _arg2:int, _arg3:Number, _arg4:Number, _arg5:int, _arg6:int, _arg7:int){
if (moneyGame){
fscommand("playData", (((((((((((((_arg1 + ",") + _arg2) + ",") + 0) + ",") + 0) + ",") + _arg5) + ",") + _arg6) + ",") + _arg7) + ",0=0"));
};
}
public static function setMoneyGame(_arg1:Boolean){
moneyGame = _arg1;
}
public static function parseGameData(_arg1:String){
var _local2:XMLDocument;
var _local3:*;
var _local4:*;
var _local5:String;
var _local6:String;
_local2 = new XMLDocument(_arg1);
_local3 = _local2.childNodes[0].childNodes;
randomSeed = new Number(_local2.childNodes[0].attributes.randomseed).valueOf();
lang = _local2.childNodes[0].attributes.lang.valueOf();
_local4 = 0;
while (_local4 < _local3.length) {
if (_local3[_local4].nodeName == "text"){
if (_local3[_local4].attributes.id == "instructions_heading"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.INSTRUCTIONS_HEADING = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "instructions"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.INSTRUCTIONS = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "positive_items_heading"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.POSITIVE_ITEMS_HEADING = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "super_spray"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.SUPER_SPRAY = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "refill"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.REFILL = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "shields"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.SHIELDS = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "boost"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.BOOST = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "negative_items_heading"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.NEGATIVE_ITEMS_HEADING = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "feromone"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.FEROMONE = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "spider_web"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.SPIDER_WEB = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "game_starts_in"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.GAME_STARTS_IN = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "score_heading"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.SCORE_HEADING = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "level_heading"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.LEVEL_HEADING = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "wave_heading"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.WAVE_HEADING = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "end_game"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.END_GAME = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "sound_on"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.SOUND_ON = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "sound_off"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.SOUND_OFF = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "levelsign_level"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.LEVEL = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "levelsign_level_text"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.LEVEL_TEXT = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "levelsign_score"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.LEVEL_SCORE_HEADING = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "levelsign_spray_bonus"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.SPARY_BONUS_HEADING = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "levelsign_daisy_bonus"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.DAISY_BONUS_HEADING = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "levelsing_total_score"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.TOTAL_SCORE_HEADING = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "level_starts_in"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.LEVEL_STARTS_IN = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "game_ends_in"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.GAME_ENDS_IN = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "wave_sign"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.WAVE_SIGN = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "free_game"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.FREE_GAME = fixStr(_local5);
} else {
if (_local3[_local4].attributes.id == "game_over"){
_local5 = new String(_local3[_local4].firstChild.nodeValue);
TextProperties.GAME_OVER = fixStr(_local5);
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
if (_local3[_local4].nodeName == "userType"){
_local6 = new String(_local3[_local4].firstChild.nodeValue);
if (_local6 == "0"){
freeGame = true;
} else {
freeGame = false;
};
};
_local4++;
};
}
public static function sendPlayDataExp(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:Number){
if (moneyGame){
fscommand("playData", (((((((((((_arg1 + ",") + _arg2) + ",") + _arg3) + ",") + _arg4) + ",") + _arg5) + ",") + _arg6) + ",0=0"));
};
}
public static function sendPlayDataRandom(_arg1:int, _arg2:int, _arg3:int){
if (moneyGame){
fscommand("playData", (((((_arg1 + ",") + _arg2) + ",") + _arg3) + ",0=0"));
};
}
public static function sendPlayDataMouse(_arg1:int, _arg2:int, _arg3:int, _arg4:int){
if (moneyGame){
fscommand("playData", (((((((_arg1 + ",") + _arg2) + ",") + _arg3) + ",") + _arg4) + ",0=0"));
};
}
public static function gameQuit(){
if (NORMAL){
fscommand("gameQuit");
};
}
private static function fixStr(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("\r\n").join("\n");
return (_local2);
}
public static function sendPlayData(_arg1:int, _arg2:int, _arg3:int){
if (moneyGame){
fscommand("playData", (((((_arg1 + ",") + _arg2) + ",") + _arg3) + ",0=0"));
};
}
public static function sendPlayWaveEnd(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int){
if (moneyGame){
fscommand("playData", (((((((((_arg1 + ",") + _arg2) + ",") + _arg3) + ",") + _arg4) + ",") + _arg5) + ",0=0"));
};
}
public static function gameStarted(){
if (NORMAL){
fscommand("gameStart");
};
}
public static function sendPlayDataSpawn(_arg1:int, _arg2:int, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:int, _arg9:int, _arg10:int){
if (moneyGame){
fscommand("playData", (((((((((((((((((((_arg1 + ",") + _arg2) + ",") + _arg3) + ",") + _arg4) + ",") + _arg5) + ",") + "0") + ",") + "0") + ",") + _arg8) + ",") + _arg9) + ",") + _arg10) + ",0=0"));
};
}
public static function sendCalc(_arg1:int, _arg2:int, _arg3:Number){
if (moneyGame){
fscommand("playData", (((((_arg1 + ",") + _arg2) + ",") + _arg3) + ",0=0"));
};
}
}
}//package com.king.daisy_defender
Section 13
//CoreGame (com.king.daisy_defender.CoreGame)
package com.king.daisy_defender {
import flash.display.*;
import com.king.daisy_defender.*;
import flash.system.*;
import flash.ui.*;
class CoreGame {
private var baseObjects:Array;
private var shieldsCountdown:int;
private var daisyCheck:Array;
private var gum:Boolean;
private var daisyHit:Boolean;
private var newBaseObjects:Array;
private var fastSpeed:Boolean;
private var newBaseObjects2:Array;
private var doubleScores:Boolean;
private var superSprayCountdown:int;
private var shotsLeft:int;
private var daisyCollisionOn:Boolean;
private var messageCallback:Function;
private var baseObjects2:Array;
private var state:int;
private var score:int;
private var sight:Sight;
private var tickCounter:int;
private var feromoneCountdown:int;
private var oldScore:int;
private var antGenerator:AntGenerator;
private var gumCountdown:int;
private var wave1AllBasesIntact:int;
private var checkIfWaveIsCompledted:Boolean;
private var levelThreeReaction:int;
private var caterpillarKilled:int;
private var threeCaterpillarKilled:int;
private var boostCountdown:int;
private var superSpray:Boolean;
private var cannon:Cannon;
public static var SPECIAL_GUM:int = 3;
public static var STATE_PLAY:int = 2;
public static var STATE_PAUSE:int = 0;
public static var BOOST_TIME:int = 250;
public static var STATE_NO_DAISY_LEFT:int = 4;
public static var inputSentThisTick:Boolean;
public static var SPECIAL_BOOST:int = 2;
public static var SUPER_SPRAY_TIME:int = 250;
public static var SPECIAL_SHIELDS:int = 5;
public static var CANNON_POSX:int = 275;
public static var CANNON_POSY:int = ((480 - 63) + 60);
public static var SHIELDS_TIME:int = 250;
public static var STATE_TO_PLAY:int = 1;
public static var GUM_TIME:int = 250;
public static var SPECIAL_REFIL:int = 4;
public static var FEROMONE_SPEED_UP_FACTOR:Number = 1.25;
public static var SPECIAL_SUPER:int = 1;
public static var FEROMONE_TIME:int = 250;
public static var STATE_WAVE_FINISHED:int = 3;
public static var SPECIAL_FEROMONE:int = 4;
public static var currentTick:int;
function CoreGame(_arg1:Function){
this.messageCallback = _arg1;
GameGUI.hideBoostSign();
GameGUI.hideSuperSpraySign();
baseObjects = new Array();
newBaseObjects = new Array();
baseObjects2 = new Array();
newBaseObjects2 = new Array();
daisyCheck = new Array(true, true, true, true, true, true);
antGenerator = new AntGenerator(baseObjects, newBaseObjects, messageReciver);
createCannon();
createDaisy();
createSight();
state = STATE_PAUSE;
tickCounter = 0;
score = 0;
GameGUI.setScore(0);
wave1AllBasesIntact = 0;
daisyHit = false;
levelThreeReaction = 0;
caterpillarKilled = 0;
threeCaterpillarKilled = 0;
}
private function createSight(){
sight = new Sight(References.game3Clip, 100, 100, newBaseObjects, messageReciver);
baseObjects.push(sight);
}
private function onDaisyDestroyed(_arg1:InfoData){
var _local2:int;
var _local3:*;
var _local4:DaisyFeromone;
SoundManager.playFlowerDestroyed();
_local2 = int(_arg1.data1);
daisyCheck[(_local2 - 1)] = false;
_local3 = 0;
while (_local3 < baseObjects.length) {
if ((baseObjects[_local3] is DaisyFeromone)){
_local4 = DaisyFeromone(baseObjects[_local3]);
if (_local2 == _local4.type){
_local4.setToBeRemoved();
};
};
_local3++;
};
}
private function daisyLeft():int{
var _local1:int;
var _local2:*;
_local1 = 0;
_local2 = 0;
while (_local2 < daisyCheck.length) {
if (daisyCheck[_local2]){
_local1++;
};
_local2++;
};
return (_local1);
}
private function createCannon(){
cannon = new Cannon(References.game2Clip4, CANNON_POSX, CANNON_POSY, newBaseObjects2, messageReciver);
baseObjects2.push(cannon);
cannon.setShotsLeft(shotsLeft);
}
public function getOldScore():int{
return (oldScore);
}
public function messageReciver(_arg1:String, _arg2:InfoData){
if (_arg1 == "Fire"){
onFire(_arg2);
} else {
if (_arg1 == "Click fire"){
onClickFire();
} else {
if (_arg1 == "Explosion"){
onExplosion(_arg2);
} else {
if (_arg1 == "Bug1 killed"){
onAntKilled(_arg2, 0);
} else {
if (_arg1 == "Bug2 killed"){
onAntKilled(_arg2, 0);
} else {
if (_arg1 == "Bug3 killed"){
onAntKilled(_arg2, 1);
} else {
if (_arg1 == "Fly killed"){
onAntKilled(_arg2, 0);
} else {
if (_arg1 == "Moth killed"){
onAntKilled(_arg2, 0);
} else {
if (_arg1 == "Caterpillar killed"){
onCaterpillarKilled(_arg2);
} else {
if (_arg1 == "Daisy hit"){
onDaisyHit();
} else {
if (_arg1 == "Daisy destroyed"){
onDaisyDestroyed(_arg2);
} else {
if (_arg1 == "No more to spawn"){
onNoMoreToSpawn();
} else {
if (_arg1 == "SuperSprayItem taken"){
onSuperSprayItemTaken();
} else {
if (_arg1 == "ShieldItem taken"){
onShieldItemTaken();
} else {
if (_arg1 == "RefilItem taken"){
onRefilItemTaken();
} else {
if (_arg1 == "BoostItem taken"){
onBoostItemTaken();
} else {
if (_arg1 == "GumItem taken"){
onGumItemTaken();
} else {
if (_arg1 == "FeromoneItem taken"){
onFeromoneItemTaken();
} else {
if (_arg1 == "Add shots"){
onAddShots(_arg2);
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
}
private function onAntKilled(_arg1:InfoData, _arg2:int){
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Number;
var _local10:int;
var _local11:int;
var _local12:ScorePop;
_local3 = Math.floor((Math.random() * 2));
if (_local3 == 0){
SoundManager.playInsectDies1();
} else {
SoundManager.playInsectDies2();
};
antGenerator.handleSpecialPowers();
_local4 = _arg1.data1;
_local5 = _arg1.data2;
_local6 = int(_arg1.data3);
_local7 = Ant.MAX_Y;
_local8 = int(_local5);
if (_local8 < 0){
_local8 = 0;
} else {
if (_local8 > _local7){
_local8 = _local7;
};
};
_local9 = ((1 * (_local7 - _local8)) / _local7);
_local10 = (int(((_local9 * 10) + 0.49)) * 10);
_local11 = 0;
switch (_arg2){
case 0:
_local11 = ((_local6 * 100) + _local10);
break;
case 1:
_local11 = ((_local6 * 200) + _local10);
break;
case 2:
_local11 = 500;
break;
};
if (doubleScores){
_local11 = (_local11 * 2);
};
score = (score + _local11);
GameGUI.setScore(score);
if (doubleScores){
_local12 = new ScorePopBonus(References.game2Clip2, _local4, _local5, newBaseObjects, messageReciver, _local11);
} else {
_local12 = new ScorePop(References.game2Clip2, _local4, _local5, newBaseObjects, messageReciver, _local11);
};
baseObjects.push(_local12);
if (_local6 == 3){
levelThreeReaction++;
};
}
public function initWave(_arg1:int){
Ant.speedUpFactor = 1;
removeAllExceptCannonDaisySight();
superSprayCountdown = 0;
superSpray = false;
boostCountdown = 0;
doubleScores = false;
gumCountdown = 0;
gum = false;
feromoneCountdown = 0;
fastSpeed = false;
shieldsCountdown = 0;
daisyCollisionOn = true;
antGenerator.setupWave(_arg1);
checkIfWaveIsCompledted = false;
state = STATE_TO_PLAY;
}
private function onShieldItemTaken(){
var _local1:Number;
var _local2:Shield;
SoundManager.playPositiveSpecialPower();
if (daisyCollisionOn){
daisyCollisionOn = false;
createShields();
} else {
_local1 = 0;
while (_local1 < baseObjects.length) {
if ((baseObjects[_local1] is Shield)){
_local2 = Shield(baseObjects[_local1]);
_local2.extendTime();
};
_local1++;
};
};
shieldsCountdown = SHIELDS_TIME;
}
private function checkDiplomaAllBasesIntact(){
if (daisyHit == false){
wave1AllBasesIntact++;
};
}
private function sendInput(){
if (((Input.mouseIsPressed) && (Input.mouseIsReleased))){
Communicator.sendPlayDataMouse(22, currentTick, Input.xMouse, Input.yMouse);
inputSentThisTick = true;
} else {
if (Input.mouseIsPressed){
Communicator.sendPlayDataMouse(20, currentTick, Input.xMouse, Input.yMouse);
inputSentThisTick = true;
} else {
if (Input.mouseIsReleased){
Communicator.sendPlayDataMouse(21, currentTick, Input.xMouse, Input.yMouse);
inputSentThisTick = true;
};
};
};
}
private function removeAllObjects2(){
var _local1:Number;
var _local2:BaseObject;
var _local3:*;
_local1 = 0;
while (_local1 < baseObjects2.length) {
if (_local1 == (baseObjects2.length - 1)){
_local2 = baseObjects2.pop();
_local2.deleting();
_local2 = null;
} else {
_local3 = baseObjects2.pop();
_local2 = baseObjects2[_local1];
_local2.deleting();
_local2 = null;
baseObjects2[_local1] = _local3;
_local1--;
};
_local1++;
};
removeAllNewObjects2();
}
private function onDaisyHit(){
daisyHit = true;
}
private function updating(){
var _local1:*;
_local1 = 0;
while (_local1 < baseObjects.length) {
baseObjects[_local1].tick();
_local1++;
};
_local1 = 0;
while (_local1 < newBaseObjects.length) {
newBaseObjects[_local1].tick();
baseObjects.push(newBaseObjects[_local1]);
_local1++;
};
while (newBaseObjects.length > 0) {
newBaseObjects.pop();
};
_local1 = 0;
while (_local1 < baseObjects2.length) {
baseObjects2[_local1].tick();
_local1++;
};
_local1 = 0;
while (_local1 < newBaseObjects2.length) {
newBaseObjects2[_local1].tick();
baseObjects2.push(newBaseObjects2[_local1]);
_local1++;
};
while (newBaseObjects2.length > 0) {
newBaseObjects2.pop();
};
}
private function isWaveCompleted():Boolean{
var _local1:*;
if (checkIfWaveIsCompledted){
_local1 = 0;
while (_local1 < baseObjects.length) {
if ((baseObjects[_local1] is Ant)){
if (!(baseObjects[_local1] is Caterpillar)){
return (false);
};
};
_local1++;
};
} else {
return (false);
};
return (true);
}
private function onSuperSprayItemTaken(){
SoundManager.playPositiveSpecialPower();
if (!superSpray){
sight.turnOnAlwaysMax();
GameGUI.showSuperSpraySign();
superSpray = true;
};
superSprayCountdown = SUPER_SPRAY_TIME;
}
public function diplomaAllBasesIntact():int{
return (wave1AllBasesIntact);
}
public function initLevel(){
shotsLeft = 0;
cannon.setShotsLeft(shotsLeft);
}
private function createDaisyFeromones(){
var _local1:DaisyFeromone;
if (daisyCheck[0]){
_local1 = new DaisyFeromone(References.game2Clip4, (56 - 35), (492 - 32), newBaseObjects, messageReciver, DaisyFeromone.TYPE1);
newBaseObjects.push(_local1);
};
if (daisyCheck[1]){
_local1 = new DaisyFeromone(References.game2Clip4, (140 - 35), (513 - 32), newBaseObjects, messageReciver, DaisyFeromone.TYPE2);
newBaseObjects.push(_local1);
};
if (daisyCheck[2]){
_local1 = new DaisyFeromone(References.game2Clip4, (226 - 35), (503 - 32), newBaseObjects, messageReciver, DaisyFeromone.TYPE3);
newBaseObjects.push(_local1);
};
if (daisyCheck[3]){
_local1 = new DaisyFeromone(References.game2Clip4, (392 - 35), (493 - 32), newBaseObjects, messageReciver, DaisyFeromone.TYPE4);
newBaseObjects.push(_local1);
};
if (daisyCheck[4]){
_local1 = new DaisyFeromone(References.game2Clip4, (477 - 35), (490 - 32), newBaseObjects, messageReciver, DaisyFeromone.TYPE5);
newBaseObjects.push(_local1);
};
if (daisyCheck[5]){
_local1 = new DaisyFeromone(References.game2Clip4, (564 - 35), (496 - 32), newBaseObjects, messageReciver, DaisyFeromone.TYPE6);
newBaseObjects.push(_local1);
};
}
private function createDaisy(){
var _local1:Daisy;
_local1 = new Daisy(References.game2Clip4, (56 - 35), (492 - 32), newBaseObjects, messageReciver, 1);
baseObjects.push(_local1);
_local1 = new Daisy(References.game2Clip4, (140 - 35), (513 - 32), newBaseObjects, messageReciver, 2);
baseObjects.push(_local1);
_local1 = new Daisy(References.game2Clip4, (226 - 35), (503 - 32), newBaseObjects, messageReciver, 3);
baseObjects.push(_local1);
_local1 = new Daisy(References.game2Clip4, (392 - 35), (493 - 32), newBaseObjects, messageReciver, 4);
baseObjects.push(_local1);
_local1 = new Daisy(References.game2Clip4, (477 - 35), (490 - 32), newBaseObjects, messageReciver, 5);
baseObjects.push(_local1);
_local1 = new Daisy(References.game2Clip4, (564 - 35), (496 - 32), newBaseObjects, messageReciver, 6);
baseObjects.push(_local1);
}
public function getDaisyLeft():int{
return (daisyLeft());
}
private function noDaisyLeft():Boolean{
var _local1:*;
_local1 = 0;
while (_local1 < daisyCheck.length) {
if (daisyCheck[_local1]){
return (false);
};
_local1++;
};
return (true);
}
public function endGame(){
state = STATE_NO_DAISY_LEFT;
}
private function onGumItemTaken(){
var _local1:Number;
var _local2:Gum;
SoundManager.playNegativeSpecialPower();
if (!gum){
gum = true;
createGum();
sight.setLowSpeed();
} else {
_local1 = 0;
while (_local1 < baseObjects.length) {
if ((baseObjects[_local1] is Gum)){
_local2 = Gum(baseObjects[_local1]);
_local2.extendTime();
};
_local1++;
};
};
gumCountdown = GUM_TIME;
}
private function sortBaseObjects(){
baseObjects.sortOn("instanceNr", Array.NUMERIC);
}
private function collisions(){
var _local1:Array;
var _local2:Array;
var _local3:Array;
var _local4:Array;
var _local5:Array;
var _local6:*;
var _local7:*;
var _local8:*;
_local1 = new Array();
_local2 = new Array();
_local3 = new Array();
_local4 = new Array();
_local5 = new Array();
_local6 = 0;
while (_local6 < baseObjects.length) {
if ((baseObjects[_local6] is Explosion)){
_local1.push(baseObjects[_local6]);
} else {
if ((baseObjects[_local6] is Ant)){
_local2.push(baseObjects[_local6]);
} else {
if ((baseObjects[_local6] is Daisy)){
_local3.push(baseObjects[_local6]);
} else {
if ((baseObjects[_local6] is Shield)){
_local4.push(baseObjects[_local6]);
} else {
if ((baseObjects[_local6] is SpecialItem)){
_local5.push(baseObjects[_local6]);
};
};
};
};
};
_local6++;
};
_local7 = 0;
while (_local7 < _local1.length) {
_local8 = 0;
while (_local8 < _local2.length) {
if (_local1[_local7].collisionTest(_local2[_local8])){
_local1[_local7].collisionReaction(_local2[_local8]);
_local2[_local8].collisionReaction(_local1[_local7]);
};
_local8++;
};
_local7++;
};
_local7 = 0;
while (_local7 < _local1.length) {
_local8 = 0;
while (_local8 < _local5.length) {
if (_local1[_local7].collisionTest(_local5[_local8])){
_local1[_local7].collisionReaction(_local5[_local8]);
_local5[_local8].collisionReaction(_local1[_local7]);
};
_local8++;
};
_local7++;
};
if (daisyCollisionOn){
_local7 = 0;
while (_local7 < _local2.length) {
_local8 = 0;
while (_local8 < _local3.length) {
if (_local2[_local7].collisionTest(_local3[_local8])){
_local2[_local7].collisionReaction(_local3[_local8]);
_local3[_local8].collisionReaction(_local2[_local7]);
};
_local8++;
};
_local7++;
};
};
_local7 = 0;
while (_local7 < _local2.length) {
_local8 = 0;
while (_local8 < _local4.length) {
if (_local2[_local7].collisionTest(_local4[_local8])){
_local2[_local7].collisionReaction(_local4[_local8]);
_local4[_local8].collisionReaction(_local2[_local7]);
};
_local8++;
};
_local7++;
};
}
private function removeAllNewObjectsExceptExplosionScorePop(){
var _local1:Number;
var _local2:BaseObject;
var _local3:*;
_local1 = 0;
while (_local1 < newBaseObjects.length) {
if (((!((baseObjects[_local1] is Explosion))) && (!((baseObjects[_local1] is ScorePop))))){
if (_local1 == (newBaseObjects.length - 1)){
_local2 = newBaseObjects.pop();
_local2.deleting();
_local2 = null;
} else {
_local3 = newBaseObjects.pop();
_local2 = newBaseObjects[_local1];
_local2.deleting();
_local2 = null;
newBaseObjects[_local1] = _local3;
_local1--;
};
};
_local1++;
};
removeAllNewObjects2();
}
private function waveFinished(){
removeObjectsAfterWave();
GameGUI.hideSuperSpraySign();
GameGUI.hideBoostSign();
Communicator.sendPlayWaveEnd(30, currentTick, getScore(), daisyLeft(), getShotsLeft());
Communicator.sendPlayDataRandom(90, currentTick, Random.nr);
}
private function createShields(){
var _local1:Shield;
if (daisyCheck[0]){
_local1 = new Shield(References.game2Clip4, (56 - 35), (492 - 32), newBaseObjects, messageReciver);
newBaseObjects.push(_local1);
};
if (daisyCheck[1]){
_local1 = new Shield(References.game2Clip4, (140 - 35), (513 - 32), newBaseObjects, messageReciver);
newBaseObjects.push(_local1);
};
if (daisyCheck[2]){
_local1 = new Shield(References.game2Clip4, (226 - 35), (503 - 32), newBaseObjects, messageReciver);
newBaseObjects.push(_local1);
};
if (daisyCheck[3]){
_local1 = new Shield(References.game2Clip4, (392 - 35), (493 - 32), newBaseObjects, messageReciver);
newBaseObjects.push(_local1);
};
if (daisyCheck[4]){
_local1 = new Shield(References.game2Clip4, (477 - 35), (490 - 32), newBaseObjects, messageReciver);
newBaseObjects.push(_local1);
};
if (daisyCheck[5]){
_local1 = new Shield(References.game2Clip4, (564 - 35), (496 - 32), newBaseObjects, messageReciver);
newBaseObjects.push(_local1);
};
}
private function onAddShots(_arg1:InfoData){
shotsLeft = (shotsLeft + int(_arg1.data1));
cannon.setShotsLeft(shotsLeft);
}
private function onNoMoreToSpawn(){
checkIfWaveIsCompledted = true;
}
private function removeAllNewObjects2(){
var _local1:Number;
var _local2:BaseObject;
var _local3:*;
_local1 = 0;
while (_local1 < newBaseObjects2.length) {
if (_local1 == (newBaseObjects2.length - 1)){
_local2 = newBaseObjects2.pop();
_local2.deleting();
_local2 = null;
} else {
_local3 = newBaseObjects2.pop();
_local2 = newBaseObjects2[_local1];
_local2.deleting();
_local2 = null;
newBaseObjects2[_local1] = _local3;
_local1--;
};
_local1++;
};
}
public function render(_arg1:Number):void{
var _local2:*;
_local2 = 0;
while (_local2 < baseObjects.length) {
baseObjects[_local2].render(_arg1);
_local2++;
};
_local2 = 0;
while (_local2 < baseObjects2.length) {
baseObjects2[_local2].render(_arg1);
_local2++;
};
References.debugText1.text = String(System.totalMemory);
}
public function diplomaThreeSpecialKilled():int{
return (threeCaterpillarKilled);
}
public function getShotsLeft():int{
return (shotsLeft);
}
private function removeAllNewObjects(){
var _local1:Number;
var _local2:BaseObject;
var _local3:*;
_local1 = 0;
while (_local1 < newBaseObjects.length) {
if (_local1 == (newBaseObjects.length - 1)){
_local2 = newBaseObjects.pop();
_local2.deleting();
_local2 = null;
} else {
_local3 = newBaseObjects.pop();
_local2 = newBaseObjects[_local1];
_local2.deleting();
_local2 = null;
newBaseObjects[_local1] = _local3;
_local1--;
};
_local1++;
};
removeAllNewObjects2();
}
public function diplomaThreeReaction():int{
return (levelThreeReaction);
}
public function tick(_arg1:Number):void{
currentTick = _arg1;
switch (state){
case STATE_PAUSE:
GameGUI.hideBoostSign();
GameGUI.hideSuperSpraySign();
Input.reset();
updating();
break;
case STATE_TO_PLAY:
state = STATE_PLAY;
break;
case STATE_PLAY:
inputSentThisTick = false;
sendInput();
antGenerator.tick();
updating();
collisions();
removeObjects();
handleSpecialStates();
if (isWaveCompleted()){
state = STATE_WAVE_FINISHED;
checkDiplomaAllBasesIntact();
};
if (noDaisyLeft()){
state = STATE_NO_DAISY_LEFT;
};
break;
case STATE_WAVE_FINISHED:
Input.reset();
updating();
state = STATE_PAUSE;
sight.init();
waveFinished();
messageCallback("wave finished");
break;
case STATE_NO_DAISY_LEFT:
Input.reset();
updating();
state = STATE_PAUSE;
sight.init();
waveFinished();
messageCallback("no daisy left");
break;
};
tickCounter++;
}
private function onCaterpillarKilled(_arg1:InfoData){
onAntKilled(_arg1, 2);
antGenerator.createNewSpawner();
caterpillarKilled++;
if (caterpillarKilled == 3){
threeCaterpillarKilled++;
caterpillarKilled = 0;
};
}
private function createGum(){
var _local1:Gum;
_local1 = new Gum(References.game2Clip4, (311 - 35), (498 - 32), newBaseObjects, messageReciver);
newBaseObjects.push(_local1);
}
private function onFire(_arg1:InfoData){
var _local2:Number;
var _local3:Number;
var _local4:Number;
SoundManager.playSprayLaunch1();
_local2 = _arg1.data1;
_local3 = _arg1.data2;
_local4 = _arg1.data3;
cannon.fire(_local2, _local3, _local4);
shotsLeft--;
cannon.setShotsLeft(shotsLeft);
if (shotsLeft == 0){
sight.disable();
};
}
private function onClickFire(){
SoundManager.playSprayClick();
}
private function onFeromoneItemTaken(){
var _local1:*;
var _local2:Ant;
var _local3:Number;
var _local4:DaisyFeromone;
SoundManager.playNegativeSpecialPower();
if (!fastSpeed){
createDaisyFeromones();
_local1 = 0;
while (_local1 < baseObjects.length) {
if ((baseObjects[_local1] is Ant)){
_local2 = Ant(baseObjects[_local1]);
_local2.speedUp(FEROMONE_SPEED_UP_FACTOR);
};
_local1++;
};
fastSpeed = true;
} else {
_local3 = 0;
while (_local3 < baseObjects.length) {
if ((baseObjects[_local3] is DaisyFeromone)){
_local4 = DaisyFeromone(baseObjects[_local3]);
_local4.extendTime();
};
_local3++;
};
};
feromoneCountdown = FEROMONE_TIME;
}
private function removeAllExceptCannonDaisySight(){
var _local1:Number;
var _local2:BaseObject;
var _local3:*;
_local1 = 0;
while (_local1 < baseObjects.length) {
if (((((!((baseObjects[_local1] is Cannon))) && (!((baseObjects[_local1] is Daisy))))) && (!((baseObjects[_local1] is Sight))))){
if (_local1 == (baseObjects.length - 1)){
_local2 = baseObjects.pop();
_local2.deleting();
_local2 = null;
} else {
_local3 = baseObjects.pop();
_local2 = baseObjects[_local1];
_local2.deleting();
_local2 = null;
baseObjects[_local1] = _local3;
_local1--;
};
};
_local1++;
};
removeAllNewObjects();
removeAllExceptCannon2();
}
private function onBoostItemTaken(){
SoundManager.playPositiveSpecialPower();
if (!doubleScores){
doubleScores = true;
GameGUI.showBoostSign();
};
boostCountdown = BOOST_TIME;
}
private function handleSpecialStates(){
var _local1:*;
if (superSprayCountdown == 0){
sight.turnOffAlwaysMax();
GameGUI.hideSuperSpraySign();
superSpray = false;
};
superSprayCountdown--;
if (boostCountdown == 0){
doubleScores = false;
GameGUI.hideBoostSign();
};
boostCountdown--;
if (gumCountdown == 0){
gum = false;
sight.setNormalSpeed();
};
gumCountdown--;
if (feromoneCountdown == 0){
_local1 = 0;
while (_local1 < baseObjects.length) {
if ((baseObjects[_local1] is Ant)){
baseObjects[_local1].normalSpeed();
};
_local1++;
};
fastSpeed = false;
};
feromoneCountdown--;
if (shieldsCountdown == 0){
daisyCollisionOn = true;
};
shieldsCountdown--;
}
private function removeAllObjects(){
var _local1:Number;
var _local2:BaseObject;
var _local3:*;
_local1 = 0;
while (_local1 < baseObjects.length) {
if (_local1 == (baseObjects.length - 1)){
_local2 = baseObjects.pop();
_local2.deleting();
_local2 = null;
} else {
_local3 = baseObjects.pop();
_local2 = baseObjects[_local1];
_local2.deleting();
_local2 = null;
baseObjects[_local1] = _local3;
_local1--;
};
_local1++;
};
removeAllNewObjects();
removeAllObjects2();
}
public function getScore():int{
return (score);
}
public function setBonus(){
var _local1:int;
var _local2:int;
var _local3:int;
_local1 = (shotsLeft * 50);
_local2 = (daisyLeft() * 500);
_local3 = (_local1 + _local2);
oldScore = score;
score = (score + _local3);
GameGUI.setScore(score);
}
private function removeObjectsAfterWave(){
var _local1:Number;
var _local2:BaseObject;
var _local3:Explosion;
var _local4:*;
_local1 = 0;
while (_local1 < baseObjects.length) {
if (((((((!((baseObjects[_local1] is Cannon))) && (!((baseObjects[_local1] is Daisy))))) && (!((baseObjects[_local1] is Sight))))) && (!((baseObjects[_local1] is ScorePop))))){
if ((baseObjects[_local1] is Explosion)){
_local3 = Explosion(baseObjects[_local1]);
//unresolved if
} else {
if (_local1 == (baseObjects.length - 1)){
_local2 = baseObjects.pop();
_local2.deleting();
_local2 = null;
} else {
_local4 = baseObjects.pop();
_local2 = baseObjects[_local1];
_local2.deleting();
_local2 = null;
baseObjects[_local1] = _local4;
_local1--;
};
};
};
_local1++;
};
removeAllNewObjectsExceptExplosionScorePop();
removeAllExceptCannon2();
sortBaseObjects();
}
private function onRefilItemTaken(){
SoundManager.playPositiveSpecialPower();
if (shotsLeft == 0){
sight.init();
};
shotsLeft = (shotsLeft + 5);
cannon.setShotsLeft(shotsLeft);
}
private function removeObjects(){
var _local1:Number;
var _local2:BaseObject;
var _local3:*;
_local1 = 0;
while (_local1 < baseObjects.length) {
if (baseObjects[_local1].toBeRemoved){
if (_local1 == (baseObjects.length - 1)){
_local2 = baseObjects.pop();
_local2.deleting();
_local2 = null;
} else {
_local3 = baseObjects.pop();
_local2 = baseObjects[_local1];
_local2.deleting();
_local2 = null;
baseObjects[_local1] = _local3;
_local1--;
};
};
_local1++;
};
sortBaseObjects();
_local1 = 0;
while (_local1 < baseObjects2.length) {
if (baseObjects2[_local1].toBeRemoved){
if (_local1 == (baseObjects2.length - 1)){
_local2 = baseObjects2.pop();
_local2.deleting();
_local2 = null;
} else {
_local3 = baseObjects2.pop();
_local2 = baseObjects2[_local1];
_local2.deleting();
_local2 = null;
baseObjects2[_local1] = _local3;
_local1--;
};
};
_local1++;
};
}
private function onExplosion(_arg1:InfoData){
SoundManager.playRandomGasPoof();
}
private function removeAllExceptCannon2(){
var _local1:Number;
var _local2:BaseObject;
var _local3:*;
_local1 = 0;
while (_local1 < baseObjects2.length) {
if (!(baseObjects2[_local1] is Cannon)){
if (_local1 == (baseObjects2.length - 1)){
_local2 = baseObjects2.pop();
_local2.deleting();
_local2 = null;
} else {
_local3 = baseObjects2.pop();
_local2 = baseObjects2[_local1];
_local2.deleting();
_local2 = null;
baseObjects2[_local1] = _local3;
_local1--;
};
};
_local1++;
};
removeAllNewObjects2();
}
}
}//package com.king.daisy_defender
Section 14
//Daisy (com.king.daisy_defender.Daisy)
package com.king.daisy_defender {
import flash.display.*;
import flash.filters.*;
import com.king.daisy_defender.*;
class Daisy extends BaseObject {
private var animCounter:int;
private var id:int;
private var wantedAnimFrame:int;
private var destructionState:int;
private static var DESTRUCTION_ONE:int = 1;
private static var DESTRUCTION_NONE:int = 0;
private static var DESTRUCTION_FIVE:int = 5;
private static var DESTRUCTION_THREE:int = 3;
private static var DESTRUCTION_FOUR:int = 4;
private static var DESTRUCTION_DESTROY:int = 7;
private static var DESTRUCTION_SIX:int = 6;
private static var ANIM_SPEED:int = 3;
private static var clipNr:int = 0;
private static var DESTRUCTION_TWO:int = 2;
function Daisy(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Array, _arg5:Function, _arg6:int){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
this.id = _arg6;
destructionState = DESTRUCTION_NONE;
}
override protected function createClip():void{
clipNr++;
if (clipNr > 6){
clipNr = 1;
};
switch (clipNr){
case 1:
clip = new daisy1();
applayShadow();
clip.scaleX = 0.3;
clip.scaleY = 0.3;
break;
case 2:
clip = new daisy2();
applayShadow();
clip.scaleX = 0.3;
clip.scaleY = 0.3;
break;
case 3:
clip = new daisy3();
applayShadow();
clip.scaleX = 0.3;
clip.scaleY = 0.3;
break;
case 4:
clip = new daisy1();
applayShadow();
clip.scaleX = -0.3;
clip.scaleY = 0.3;
break;
case 5:
clip = new daisy2();
applayShadow();
clip.scaleX = -0.3;
clip.scaleY = 0.3;
break;
case 6:
clip = new daisy3();
applayShadow();
clip.scaleX = -0.3;
clip.scaleY = 0.3;
break;
};
clip.visible = false;
parentClip.addChild(clip);
clip.cacheAsBitmap = true;
}
override public function tick(){
var _local1:int;
super.tick();
if (animCounter == ANIM_SPEED){
_local1 = 2;
switch (destructionState){
case DESTRUCTION_NONE:
animFrame = 1;
break;
case DESTRUCTION_ONE:
if (animFrame < 15){
animFrame = (animFrame + _local1);
};
break;
case DESTRUCTION_TWO:
if (animFrame < 13){
animFrame = (animFrame + _local1);
};
break;
case DESTRUCTION_THREE:
if (animFrame < 15){
animFrame = (animFrame + _local1);
};
break;
case DESTRUCTION_FOUR:
if (animFrame < 17){
animFrame = (animFrame + _local1);
};
break;
case DESTRUCTION_FIVE:
if (animFrame < 19){
animFrame = (animFrame + _local1);
};
break;
case DESTRUCTION_SIX:
if (animFrame < 21){
animFrame = (animFrame + _local1);
};
break;
case DESTRUCTION_DESTROY:
if (animFrame < 30){
animFrame = (animFrame + _local1);
} else {
visible = false;
toBeRemoved = true;
};
break;
};
animCounter = 0;
};
animCounter++;
animIFloat.method_1(animFrame);
if (animFrame == 1){
animIFloat.setTo(animFrame);
};
}
private function applayShadow(){
var _local1:BitmapFilter;
var _local2:Array;
_local1 = getBitmapFilter();
_local2 = new Array();
_local2.push(_local1);
clip.filters = _local2;
}
override protected function createCollisionObject():void{
collisionObject = new CollisionObject(0, 0, 70);
}
override public function collisionReaction(_arg1:BaseObject){
var _local2:*;
if ((_arg1 is Ant)){
if (destructionState == DESTRUCTION_NONE){
animCounter = 0;
animFrame = 10;
destructionState++;
messageCallback("Daisy hit", null);
} else {
if (destructionState == DESTRUCTION_ONE){
animCounter = 0;
animFrame = (animFrame + 1);
destructionState = DESTRUCTION_DESTROY;
collidable = false;
_local2 = new InfoData();
_local2.data1 = id;
messageCallback("Daisy destroyed", _local2);
};
};
};
}
private function getBitmapFilter():BitmapFilter{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Boolean;
var _local9:Boolean;
var _local10:Number;
_local1 = 0;
_local2 = 90;
_local3 = 1;
_local4 = 5;
_local5 = 5;
_local6 = 5;
_local7 = 0.2;
_local8 = false;
_local9 = false;
_local10 = BitmapFilterQuality.LOW;
return (new DropShadowFilter(_local6, _local2, _local1, _local3, _local4, _local5, _local7, _local10, _local8, _local9));
}
}
}//package com.king.daisy_defender
Section 15
//DaisyDefender (com.king.daisy_defender.DaisyDefender)
package com.king.daisy_defender {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.text.*;
import flash.ui.*;
import flash.external.*;
public class DaisyDefender extends MovieClip {
public var NextLevelAnim3_mc:MovieClip;
private var tickFPS:Number;
public var wave_txt:TextField;
public var Game3_mc:MovieClip;
public var FpsHeading_txt:TextField;
public var Level2Sign_mc:MovieClip;
public var Decoration4_mc:MovieClip;
public var data_txt:TextField;
public var BoostSign_mc:MovieClip;
private var state:int;
public var LogicHeading_txt:TextField;
public var Objects_txt:TextField;
public var LevelHeading_txt:TextField;
public var FreeGameSign_mc:MovieClip;
public var ScoreHeading_txt:TextField;
public var Game_mc:MovieClip;
public var SuperSpraySign_mc:MovieClip;
private var gameHandler:GameHandler;
public var Level3Sign_mc:MovieClip;
public var NextLevelAnim_mc:MovieClip;
public var Debug1_txt:TextField;
public var Ground_mc:MovieClip;
private var tickStartTime:Number;
public var level_txt:TextField;
public var SoundOnOff_mc:MovieClip;
public var score_txt:TextField;
public var timer:Timer;
public var GameDebug_mc:MovieClip;
public var NextLevelAnim1_mc:MovieClip;
private var soundOn:Boolean;
public var Level1Sign_mc:MovieClip;
public var LevelSign_mc:MovieClip;
public var Decoration1_mc:MovieClip;
public var ObjectsHeading_txt:TextField;
private var renderStartTime:Number;
public var introsign_mc:MovieClip;
private var renderFPS:Number;
public var Decoration2_mc:MovieClip;
public var GameOverAnim_mc:MovieClip;
private var tickCounter:int;// = 0
public var FPS2_txt:TextField;
public var EndGame_mc:MovieClip;
public var Game2_mc:MovieClip;
private var exitSent:Boolean;// = false
public var WaveHeading_txt:TextField;
public var Decoration3_mc:MovieClip;
public var FPS_txt:TextField;
public var WaveSign_mc:MovieClip;
public static var STATE_GAME:int = 2;
private static var DEBUG_GAME_DATA:String = (((((((((((((((((((((((((((((("<gamedata randomseed=\"3\" timelimit=\"660\" lang=\"de\">" + "<text id=\"instructions_heading\">Instructions</text>") + "<text id=\"instructions\">Protect your Daisies from the incoming insects by spray insecticide that blocks their way. If they reach your Daisies they destroy them. You have a limited number of spray so plan well. If you hold down the mouse button your sprays will become bigger. Collect special items to help you to save your flowers.</text>") + "<text id=\"positive_items_heading\">POSITIVE ITEMS</text>") + "<text id=\"super_spray\">Super Spray: Automatic\nmax impact zones</text>") + "<text id=\"refill\">Refill: 5 extra shots\nawarded</text>") + "<text id=\"shields\">Shields: All Daisies is\nprotected from incoming\nenemies</text>") + "<text id=\"boost\">Boost: Double scores</text>") + "<text id=\"negative_items_heading\">NEGATIVE ITEMS</text>") + "<text id=\"feromone\">Sweet Soda: Causes all incoming enemies to speed up one notch</text>") + "<text id=\"spider_web\">Spider Web: Your shots take 50% longer to reach intended impact zone</text>") + "<text id=\"game_starts_in\">Game starts in [0] seconds</text>") + "<text id=\"score_heading\">SCORE</text>") + "<text id=\"level_heading\">LEVEL</text>") + "<text id=\"wave_heading\">WAVE</text>") + "<text id=\"end_game\">END GAME</text>") + "<text id=\"sound_on\">SOUND ON</text>") + "<text id=\"sound_off\">SOUND_OFF</text>") + "<text id=\"levelsign_level\">Level</text>") + "<text id=\"levelsign_level_text\">Grattis! Du går vidare till nästa nivå!</text>") + "<text id=\"levelsign_score\">SCORE</text>") + "<text id=\"levelsign_spray_bonus\">SPRAY BONUS</text>") + "<text id=\"levelsign_daisy_bonus\">DAISY BONUS</text>") + "<text id=\"levelsing_total_score\">TOTAL SCORE</text>") + "<text id=\"level_starts_in\">Level starts in [0] seconds</text>") + "<text id=\"game_ends_in\">Game ends in [0] seconds</text>") + "<text id=\"wave_sign\">NEXT\nWAVE</text>") + "<text id=\"free_game\">Signup to play the full game</text>") + "<text id=\"game_over\">GAME\nOVER</text>") + "<userType id=\"0\">1</userType>") + "</gamedata>");
public static var STATE_WAIT_FOR_GAMEDATA = 0;
public static var DEBUG_MODE:Boolean = false;
public static var MONEY_GAME:Boolean = true;
public static var STATE_INSTRUCTIONS:int = 1;
public static var TICKS_PER_SECOND:Number = 25;
public function DaisyDefender(){
tickCounter = 0;
exitSent = false;
super();
addFrameScript(0, frame1);
References.setReferences(this);
ScreenPlayer.setupIntroSign();
ScreenPlayer.hideGameScreen();
ScreenPlayer.hideExitButton();
gameHandler = new GameHandler();
soundOn = true;
Input.init();
addEventListener("enterFrame", advanceTime);
timer = new Timer(TICKS_PER_SECOND);
this.addEventListener(MouseEvent.MOUSE_DOWN, mousePressed);
this.addEventListener(MouseEvent.MOUSE_UP, mouseReleased);
References.endGameButtonClip.addEventListener(MouseEvent.MOUSE_UP, exitButtonMouseReleased);
References.soundOnOffButtonClip.addEventListener(MouseEvent.MOUSE_UP, soundOnOffButtonMouseReleased);
References.soundOnOffButtonClip.gotoAndStop(1);
tickFPS = 0;
renderFPS = 0;
ScreenPlayer.hideLevelSign();
state = STATE_WAIT_FOR_GAMEDATA;
Communicator.setMoneyGame(MONEY_GAME);
if (DEBUG_MODE){
Communicator.parseGameData(DEBUG_GAME_DATA);
References.seed = Communicator.randomSeed;
References.createRandom(References.seed);
} else {
getGameData();
Communicator.parseGameData(DEBUG_GAME_DATA);
References.seed = Communicator.randomSeed;
References.createRandom(References.seed);
};
TextProperties.setTexts();
toStateInstructions();
}
private function getGameData(){
var _local1:Object;
_local1 = ExternalInterface.call("getGameData");
if ((((_local1 == null)) || (!(_local1.success)))){
} else {
DEBUG_GAME_DATA = _local1.message;
};
}
public function diplomaAllBasesIntact():int{
return (gameHandler.diplomaAllBasesIntact());
}
function frame1(){
stop();
}
private function advanceTime(_arg1:Event):void{
var _local2:*;
var _local3:*;
_local2 = timer.advanceTime();
_local3 = 0;
while (_local3 < _local2) {
tick();
tickCounter++;
_local3++;
};
render(timer.alpha);
}
public function diplomaThreeSpecialKilled():int{
return (gameHandler.diplomaThreeSpecialKilled());
}
private function exitButtonMouseReleased(_arg1:MouseEvent){
if ((((state == STATE_GAME)) && (!(exitSent)))){
gameHandler.endGame();
exitSent = true;
};
}
public function mouseReleased(_arg1:MouseEvent){
if (state == STATE_GAME){
if (((!(References.soundOnOffButtonClip.hitTestPoint(this.mouseX, this.mouseY))) && (!(References.endGameButtonClip.hitTestPoint(this.mouseX, this.mouseY))))){
Input.mouseReleased();
};
} else {
if (state == STATE_INSTRUCTIONS){
if (((!(References.soundOnOffButtonClip.hitTestPoint(this.mouseX, this.mouseY))) && (!(References.endGameButtonClip.hitTestPoint(this.mouseX, this.mouseY))))){
toStateGame();
};
};
};
}
private function toStateInstructions(){
SoundManager.playIntroLoop();
ScreenPlayer.showInstructionScreen();
state = STATE_INSTRUCTIONS;
}
private function tick():void{
var _local1:Number;
switch (state){
case STATE_WAIT_FOR_GAMEDATA:
break;
case STATE_INSTRUCTIONS:
ScreenPlayer.updateIntroSign();
if (ScreenPlayer.updateStartsInText(tickCounter)){
toStateGame();
};
break;
case STATE_GAME:
hideAndShowMouse();
Input.setMousePos(this.mouseX, this.mouseY);
gameHandler.tick();
Input.reset();
break;
};
if (tickFPS == 0){
tickStartTime = getTimer();
} else {
_local1 = ((getTimer() - tickStartTime) / 1000);
if (_local1 >= 1){
References.debugFPS2.text = String(tickFPS);
tickFPS = -1;
};
};
tickFPS++;
}
public function mousePressed(_arg1:MouseEvent){
if (References.soundOnOffButtonClip.hitTestPoint(this.mouseX, this.mouseY)){
return;
};
if (state == STATE_GAME){
Input.mousePressed();
};
}
private function render(_arg1:Number):void{
var _local2:Number;
if (state == STATE_INSTRUCTIONS){
ScreenPlayer.renderIntroSign(_arg1);
};
gameHandler.render(_arg1);
if (renderFPS == 0){
renderStartTime = getTimer();
} else {
_local2 = ((getTimer() - renderStartTime) / 1000);
if (_local2 >= 1){
References.debugFPS.text = String(renderFPS);
renderFPS = -1;
};
};
renderFPS++;
}
public function diplomaThreeReaction():int{
return (gameHandler.diplomaThreeReaction());
}
private function toStateGame(){
SoundManager.stopIntroLoop();
ScreenPlayer.hideInstructionScreen();
ScreenPlayer.showGameScreen();
ScreenPlayer.showExitButton();
state = STATE_GAME;
}
private function soundOnOffButtonMouseReleased(_arg1:MouseEvent){
if (soundOn){
soundOn = false;
SoundManager.soundOff();
ScreenPlayer.soundOnOffShowOff();
} else {
soundOn = true;
SoundManager.soundOn();
ScreenPlayer.soundOnOffShowOn();
switch (state){
case STATE_INSTRUCTIONS:
SoundManager.playIntroLoop();
break;
case STATE_GAME:
if (gameHandler.isPlaying()){
SoundManager.playGameLoop();
};
break;
};
};
}
private function hideAndShowMouse(){
if ((((((((Input.xMouse >= 0)) && ((Input.xMouse <= Sight.MAX_SHOW_X)))) && ((Input.yMouse >= 0)))) && ((Input.yMouse <= Sight.MAX_SHOW_Y)))){
Mouse.hide();
} else {
Mouse.show();
};
}
}
}//package com.king.daisy_defender
Section 16
//DaisyFeromone (com.king.daisy_defender.DaisyFeromone)
package com.king.daisy_defender {
import flash.display.*;
class DaisyFeromone extends BaseObject {
protected var tickCounter:int;
public var type:int;
public static var SHOW_TIME:int = 250;
public static var TYPE1:int = 1;
public static var TYPE2:int = 2;
public static var TYPE3:int = 3;
public static var TYPE4:int = 4;
public static var TYPE5:int = 5;
public static var TYPE6:int = 6;
function DaisyFeromone(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Array, _arg5:Function, _arg6:Number){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
this.type = _arg6;
createClip2(_arg6);
tickCounter = 0;
}
override public function tick(){
super.tick();
if (tickCounter == SHOW_TIME){
visible = false;
collidable = false;
toBeRemoved = true;
};
tickCounter++;
}
public function extendTime(){
tickCounter = 0;
}
private function createClip2(_arg1:int):void{
switch (_arg1){
case TYPE1:
clip = new Feromone1();
break;
case TYPE2:
clip = new Feromone2();
break;
case TYPE3:
clip = new Feromone3();
break;
case TYPE4:
clip = new Feromone4();
break;
case TYPE5:
clip = new Feromone5();
break;
case TYPE6:
clip = new Feromone6();
break;
};
clip.visible = false;
clip.cacheAsBitmap = true;
parentClip.addChild(clip);
}
}
}//package com.king.daisy_defender
Section 17
//Explosion (com.king.daisy_defender.Explosion)
package com.king.daisy_defender {
import flash.display.*;
import flash.geom.*;
class Explosion extends BaseObject {
protected var delay:int;
protected var tickCounter:int;
protected var animCounter:int;
protected var maxDiameter:int;
public var expInstanceNr:int;
protected var alwaysNonCollidable:Boolean;
public var state:int;
public var diameter2:Number;
public var explosionLevel:ExplosionLevel;
protected var minDiameter:int;
public static var SHRINK_STATE:int = 2;
public static var DELTA_SIZE_CHANGE:Number = 2;
public static var COLOR_CATERPILLAR:int = 6;
public static var COLOR_MOTH:int = 5;
public static var COLOR_FLY:int = 4;
public static var COLOR_BUG1:int = 1;
public static var COLOR_BUG2:int = 2;
public static var COLOR_BUG3:int = 3;
public static var HIDE_DELAY:int = 0;
public static var COLOR_ORANGE:int = 7;
public static var STATE_EXPAND:int = 1;
protected static var expInstCounter:int = 0;
public static var COLOR_NONE:int = 0;
function Explosion(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:Boolean, _arg9:ExplosionLevel, _arg10:Array, _arg11:Function){
super(_arg1, _arg2, _arg3, _arg10, _arg11);
expInstanceNr = expInstCounter;
expInstCounter++;
this.minDiameter = _arg4;
this.maxDiameter = _arg5;
diameter2 = _arg4;
this.delay = _arg6;
tint(_arg7);
this.alwaysNonCollidable = _arg8;
this.explosionLevel = _arg9;
tickCounter = 0;
if (this.delay == 0){
state = STATE_EXPAND;
_arg11("Explosion", null);
} else {
visible = false;
collidable = false;
state = HIDE_DELAY;
};
}
override protected function createClip():void{
clip = new BitmapExplosion();
clip.visible = false;
parentClip.addChild(clip);
}
override public function tick(){
var _local1:int;
switch (state){
case HIDE_DELAY:
if (tickCounter == delay){
visible = true;
collidable = true;
state = STATE_EXPAND;
messageCallback("Explosion", null);
};
break;
case STATE_EXPAND:
diameter2 = (diameter2 + DELTA_SIZE_CHANGE);
_local1 = int(diameter2);
if (_local1 > maxDiameter){
diameter2 = maxDiameter;
state = SHRINK_STATE;
};
break;
case SHRINK_STATE:
diameter2 = (diameter2 - DELTA_SIZE_CHANGE);
_local1 = int(diameter2);
if (_local1 < minDiameter){
diameter2 = minDiameter;
visible = false;
collidable = false;
toBeRemoved = true;
};
break;
};
animFrame = Math.round(((((diameter2 - minDiameter) + 1) * 20) / (90 - minDiameter)));
if (alwaysNonCollidable){
collidable = false;
};
tickCounter++;
animIFloat.method_1(animFrame);
if (animFrame == 1){
animIFloat.setTo(animFrame);
};
if (collisionObject){
collisionObject.method_1(posX, posY, diameter2);
};
}
private function tint(_arg1:int){
switch (_arg1){
case COLOR_NONE:
break;
case COLOR_BUG1:
clip.transform.colorTransform = new ColorTransform(0, 0, 0, 1, 0, 51, 0, 0);
break;
case COLOR_BUG2:
clip.transform.colorTransform = new ColorTransform(0, 0, 0, 1, 153, 0, 0, 0);
break;
case COLOR_BUG3:
clip.transform.colorTransform = new ColorTransform(0, 0, 0, 1, 0, 0, 51, 0);
break;
case COLOR_FLY:
clip.transform.colorTransform = new ColorTransform(0, 0, 0, 1, 51, 0, 0, 0);
break;
case COLOR_MOTH:
clip.transform.colorTransform = new ColorTransform(0, 0, 0, 1, 153, 51, 102, 0);
break;
case COLOR_CATERPILLAR:
clip.transform.colorTransform = new ColorTransform(0, 0, 0, 1, 0xFF, 204, 0, 0);
break;
case COLOR_ORANGE:
clip.transform.colorTransform = new ColorTransform(0, 0, 0, 1, 213, 86, 8, 0);
break;
};
}
public function hasExplosionStarted():Boolean{
if (state == HIDE_DELAY){
return (false);
};
return (true);
}
override protected function createCollisionObject():void{
collisionObject = new CollisionObject(0, 0, diameter2);
}
}
}//package com.king.daisy_defender
Section 18
//ExplosionLevel (com.king.daisy_defender.ExplosionLevel)
package com.king.daisy_defender {
class ExplosionLevel {
public var level:int;
function ExplosionLevel(_arg1:int){
this.level = _arg1;
}
}
}//package com.king.daisy_defender
Section 19
//ExplosionS (com.king.daisy_defender.ExplosionS)
package com.king.daisy_defender {
import flash.display.*;
class ExplosionS extends Explosion {
function ExplosionS(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:Boolean, _arg9:ExplosionLevel, _arg10:Array, _arg11:Function){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11);
}
override public function tick(){
var _local1:int;
switch (state){
case HIDE_DELAY:
if (tickCounter == delay){
visible = true;
collidable = true;
state = STATE_EXPAND;
messageCallback("Explosion", null);
};
break;
case STATE_EXPAND:
diameter2 = (diameter2 + DELTA_SIZE_CHANGE);
_local1 = int(diameter2);
if (_local1 > maxDiameter){
diameter2 = maxDiameter;
state = SHRINK_STATE;
};
break;
case SHRINK_STATE:
diameter2 = (diameter2 - DELTA_SIZE_CHANGE);
_local1 = int(diameter2);
if (_local1 < minDiameter){
diameter2 = minDiameter;
visible = false;
collidable = false;
toBeRemoved = true;
};
break;
};
animFrame = Math.round(((((diameter2 - minDiameter) + 1) * 27) / (120 - minDiameter)));
if (alwaysNonCollidable){
collidable = false;
};
tickCounter++;
animIFloat.method_1(animFrame);
if (animFrame == 1){
animIFloat.setTo(animFrame);
};
if (collisionObject){
collisionObject.method_1(posX, posY, diameter2);
};
}
override protected function createClip():void{
clip = new BitmapExplosionSpecial();
clip.visible = false;
parentClip.addChild(clip);
}
}
}//package com.king.daisy_defender
Section 20
//FeromoneItem (com.king.daisy_defender.FeromoneItem)
package com.king.daisy_defender {
import flash.display.*;
class FeromoneItem extends SpecialItem {
function FeromoneItem(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Array, _arg7:Function){
super(_arg1, _arg2, _arg3, _arg6, _arg7);
this.angle = _arg4;
this.speed = _arg5;
angleOffset = -(_arg4);
calculateMovement();
tickCounter = 0;
}
override public function collisionReaction(_arg1:BaseObject){
if ((_arg1 is Explosion)){
messageCallback("FeromoneItem taken", null);
};
super.collisionReaction(_arg1);
}
override protected function createClip():void{
clip = new mc_feromone();
clip.visible = false;
parentClip.addChild(clip);
clip.cacheAsBitmap = true;
}
override protected function createCollisionObject():void{
collisionObject = new CollisionObject(0, 0, 40);
}
}
}//package com.king.daisy_defender
Section 21
//Fly (com.king.daisy_defender.Fly)
package com.king.daisy_defender {
import flash.display.*;
import com.king.daisy_defender.*;
class Fly extends Ant {
function Fly(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Array, _arg7:Function){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
animFrame = Math.floor(((Math.random() * 4) + 1));
animIFloat.setTo(animFrame);
}
override public function tick(){
if (animCounter == 1){
if (animFrame < 4){
animFrame = (animFrame + 1);
} else {
animFrame = 1;
};
animCounter = 0;
};
animCounter++;
super.tick();
}
override protected function createClip():void{
clip = new BitmapFly();
clip.visible = false;
angleOffset = 270;
parentClip.addChild(clip);
}
override protected function explode2(){
super.explode2();
messageCallback("Fly killed on ground", null);
}
override protected function createCollisionObject():void{
collisionObject = new CollisionObject(0, 0, 42);
}
override protected function createExplosion(_arg1:Boolean, _arg2:ExplosionLevel){
var _local3:Explosion;
_local3 = new Explosion(References.game2Clip3, posX, posY, START_EXPLOSION_DIAMETER, END_EXPLOSION_DIAMETER, 0, Explosion.COLOR_FLY, _arg1, _arg2, newObjects, messageCallback);
newObjects.push(_local3);
}
override public function antExplode(_arg1:ExplosionLevel){
var _local2:InfoData;
super.antExplode(_arg1);
_local2 = new InfoData();
_local2.data1 = posX;
_local2.data2 = posY;
_local2.data3 = _arg1.level;
messageCallback("Fly killed", _local2);
}
}
}//package com.king.daisy_defender
Section 22
//GameGUI (com.king.daisy_defender.GameGUI)
package com.king.daisy_defender {
import com.king.daisy_defender.*;
class GameGUI {
public static function setScore(_arg1:int){
References.guiScore.text = String(_arg1);
}
public static function hideSuperSpraySign(){
References.guiSuperSprayClip.x = -100;
References.guiSuperSprayClip.y = -100;
References.guiSuperSprayClip.visible = false;
}
public static function setLevel(_arg1:int){
References.guiLevel.text = String(_arg1);
}
public static function showBoostSign(){
References.guiBoostClip.x = 664;
References.guiBoostClip.y = 440;
References.guiBoostClip.visible = true;
}
public static function setWave(_arg1:int){
var _local2:String;
if ((_arg1 % 3) == 0){
_arg1 = 3;
} else {
_arg1 = (_arg1 % 3);
};
_local2 = ((String(_arg1) + "/") + "3");
References.guiWave.text = String(_local2);
}
public static function showSuperSpraySign(){
References.guiSuperSprayClip.x = 664;
References.guiSuperSprayClip.y = 489;
References.guiSuperSprayClip.visible = true;
}
public static function hideBoostSign(){
References.guiBoostClip.x = -100;
References.guiBoostClip.y = -100;
References.guiBoostClip.visible = false;
}
}
}//package com.king.daisy_defender
Section 23
//GameHandler (com.king.daisy_defender.GameHandler)
package com.king.daisy_defender {
import com.king.daisy_defender.*;
class GameHandler {
private var wave:int;
private var level:int;
private var moveUp:Boolean;
private var levelEnded:Boolean;
private var firstWaveOnLevel:Boolean;
private var tickCounter:int;
private var ghState:int;
private var coreGame:CoreGame;
private var firstLevel:Boolean;
private var currentTick:int;// = 0
private var gameFinishedSad:Boolean;
private var tickCounter2:int;
private var gameFinishedHappy:Boolean;
public static var END_LEVEL:int = 6;
private static var INIT_GAME:int = 0;
public static var START_LEVEL:int = 1;
public static var PRE_LEVEL:int = 2;
public static var GAME_OVER_NEG:int = 8;
public static var PLAY:int = 4;
public static var PRE_WAVE:int = 3;
public static var GAME_OVER_POS:int = 7;
public static var END_FREE_GAME:int = 9;
public static var END:int = 10;
public static var END_WAVE:int = 5;
function GameHandler(){
currentTick = 0;
super();
GameGUI.hideSuperSpraySign();
GameGUI.hideBoostSign();
coreGame = new CoreGame(messageReciver);
wave = 1;
level = 1;
GameGUI.setLevel(level);
GameGUI.setWave(wave);
firstWaveOnLevel = true;
firstLevel = true;
currentTick = 0;
tickCounter = 0;
ScreenPlayer.hideLevelSign();
ScreenPlayer.hideNextLevelAnim();
ScreenPlayer.hideGameOverNegAnim();
ScreenPlayer.setGround(level);
gameFinishedHappy = false;
gameFinishedSad = false;
moveUp = false;
ghState = INIT_GAME;
}
private function toPreLevel(){
SoundManager.playLevelStart();
coreGame.initLevel();
tickCounter = 0;
ghState = PRE_LEVEL;
if (!firstLevel){
level++;
wave++;
} else {
firstLevel = false;
};
GameGUI.setLevel(level);
GameGUI.setWave(wave);
firstWaveOnLevel = true;
ScreenPlayer.setupGround(level);
ScreenPlayer.setupIntroLevelSign();
Communicator.sendPlayData(10, currentTick, level);
}
private function updateScoreTable(){
ScreenPlayer.setLevelOnLevelSign(level);
ScreenPlayer.setScoreOnLevelSign(coreGame.getOldScore());
ScreenPlayer.setShotsBonusOnLevelSign(coreGame.getShotsLeft());
ScreenPlayer.setDaisyBonusOnLevelSign(coreGame.getDaisyLeft());
ScreenPlayer.setTotalScoreOnLevelSign(coreGame.getScore());
}
public function diplomaAllBasesIntact():int{
return (coreGame.diplomaAllBasesIntact());
}
private function onWaveFinished(){
SoundManager.stopGameLoop();
if ((wave % 9) == 0){
levelEnded = true;
gameFinishedHappy = true;
toEndWave();
bonus();
Communicator.sendPlayData(32, currentTick, coreGame.getScore());
} else {
if ((wave % 3) == 0){
bonus();
levelEnded = true;
toEndWave();
} else {
toEndWave();
};
};
}
private function updateScoreTableGameOver(){
ScreenPlayer.setLevelOnLevelSignToGameOver();
ScreenPlayer.setScoreOnLevelSign(coreGame.getScore());
ScreenPlayer.setShotsBonusOnLevelSign(0);
ScreenPlayer.setDaisyBonusOnLevelSign(0);
ScreenPlayer.setTotalScoreOnLevelSign(coreGame.getScore());
}
private function toPreWave(){
SoundManager.playNewWaveFly();
tickCounter = 10;
ScreenPlayer.setupWaveSign();
ghState = PRE_WAVE;
if (!firstWaveOnLevel){
wave++;
} else {
firstWaveOnLevel = false;
};
}
private function toEndWave(){
SoundManager.playWaveCompleted();
tickCounter = 0;
ghState = END_WAVE;
}
public function diplomaThreeSpecialKilled():int{
return (coreGame.diplomaThreeSpecialKilled());
}
private function onNoDaisyLeft(){
SoundManager.stopGameLoop();
SoundManager.playGameEndNegLoop();
GameGUI.hideSuperSpraySign();
GameGUI.hideBoostSign();
tickCounter = 0;
ScreenPlayer.showLevelSignGameOver();
ScreenPlayer.setupGameOverNegAnim();
ScreenPlayer.setupLevelSignBugs();
ScreenPlayer.hideExitButton();
ScreenPlayer.hideLevelIntroSign();
ghState = GAME_OVER_NEG;
Communicator.sendPlayData(33, currentTick, coreGame.getScore());
Communicator.gameEnd(coreGame.getScore());
}
public function tick():void{
switch (ghState){
case INIT_GAME:
Communicator.gameStarted();
toPreLevel();
break;
case PRE_LEVEL:
ScreenPlayer.updateGround(level);
ScreenPlayer.updateIntroLevelSign();
if (tickCounter == 50){
levelEnded = false;
toPreWave();
};
if ((((tickCounter == 45)) && ((wave == 4)))){
if (Communicator.isFreeGame()){
tickCounter = 0;
Communicator.gameEnd(coreGame.getScore());
ScreenPlayer.showFreeGameSignSign();
ghState = END_FREE_GAME;
};
};
break;
case PRE_WAVE:
ScreenPlayer.updateWaveSign();
ScreenPlayer.updateIntroLevelSign();
if (tickCounter == 27){
SoundManager.playNewWave();
} else {
if (tickCounter == 102){
SoundManager.playNewWaveFly();
GameGUI.setWave(wave);
};
};
if (tickCounter == 128){
Communicator.sendPlayData(11, currentTick, wave);
coreGame.initWave(wave);
SoundManager.playGameLoop();
ghState = PLAY;
};
ScreenPlayer.setWaveSignScore(coreGame.getScore());
ScreenPlayer.setWaveSignWave(wave);
break;
case START_LEVEL:
break;
case PLAY:
break;
case END_WAVE:
if (tickCounter == 50){
if (gameFinishedHappy){
SoundManager.playGameEndPosLoop();
tickCounter = 0;
ScreenPlayer.showLevelSign();
ScreenPlayer.setupNextLevelAnim();
ScreenPlayer.setupLevelSignDaisy();
ScreenPlayer.hideExitButton();
ghState = GAME_OVER_POS;
Communicator.gameEnd(coreGame.getScore());
} else {
if (levelEnded){
SoundManager.playLevelCompleteLoop();
tickCounter = 0;
ScreenPlayer.showLevelSign();
ScreenPlayer.setupNextLevelAnim();
ScreenPlayer.setupLevelSignDaisy();
ghState = END_LEVEL;
} else {
toPreWave();
};
};
};
break;
case END_LEVEL:
ScreenPlayer.updateNextLevelAnim();
ScreenPlayer.updateLevelSignDaisy();
if (!moveUp){
if ((((tickCounter == (7 * 25))) || ((((Input.mouseIsReleased == true)) && ((tickCounter >= (3 * 25))))))){
ScreenPlayer.moveLevelSignOffscreen();
tickCounter2 = 0;
moveUp = true;
};
};
ScreenPlayer.updateLevelStartsInText(tickCounter);
if ((((tickCounter2 == (3 * 25))) && (moveUp))){
SoundManager.stopLevelCompleteLoop();
ScreenPlayer.hideLevelSign();
ScreenPlayer.hideNextLevelAnim();
toPreLevel();
moveUp = false;
};
updateScoreTable();
tickCounter2++;
break;
case GAME_OVER_POS:
ScreenPlayer.updateNextLevelAnim();
ScreenPlayer.updateLevelSignDaisy();
if (((((ScreenPlayer.updateEndsInText(tickCounter)) || ((Input.mouseIsReleased == true)))) && ((tickCounter >= 75)))){
toEnd();
Communicator.gameQuit();
};
updateScoreTable();
break;
case GAME_OVER_NEG:
ScreenPlayer.updateGameOverNegAnim();
ScreenPlayer.updateLevelSignBugs();
if (((((ScreenPlayer.updateEndsInText(tickCounter)) || ((Input.mouseIsReleased == true)))) && ((tickCounter >= 75)))){
toEnd();
Communicator.gameQuit();
};
updateScoreTableGameOver();
break;
case END_FREE_GAME:
if ((((((Input.mouseIsReleased == true)) && ((tickCounter >= 75)))) || ((tickCounter >= (25 * 10))))){
toEnd();
Communicator.gameQuit();
};
break;
case END:
break;
};
coreGame.tick(currentTick);
tickCounter++;
currentTick++;
}
public function messageReciver(_arg1:String){
if (_arg1 == "wave finished"){
onWaveFinished();
} else {
if (_arg1 == "no daisy left"){
onNoDaisyLeft();
};
};
}
public function render(_arg1:Number):void{
coreGame.render(_arg1);
switch (ghState){
case INIT_GAME:
break;
case PRE_LEVEL:
ScreenPlayer.renderGround();
ScreenPlayer.renderIntroLevelSign();
break;
case PRE_WAVE:
ScreenPlayer.renderWaveSign(_arg1);
ScreenPlayer.renderIntroLevelSign();
break;
case START_LEVEL:
break;
case PLAY:
break;
case END_WAVE:
break;
case END_LEVEL:
ScreenPlayer.renderNextLevelAnim(_arg1);
ScreenPlayer.renderLevelSignDaisy();
break;
case GAME_OVER_POS:
ScreenPlayer.renderNextLevelAnim(_arg1);
ScreenPlayer.renderLevelSignDaisy();
break;
case GAME_OVER_NEG:
ScreenPlayer.renderGameOverNegAnim(_arg1);
ScreenPlayer.renderLevelSignBugs();
break;
case END_FREE_GAME:
break;
case END:
break;
};
}
private function toEnd(){
SoundManager.stopLevelCompleteLoop();
SoundManager.stopGameEndPosLoop();
SoundManager.stopGameEndNegLoop();
ghState = END;
}
public function isPlaying():Boolean{
if (ghState == PLAY){
return (true);
};
return (false);
}
public function endGame(){
SoundManager.stopLevelCompleteLoop();
SoundManager.stopGameEndPosLoop();
SoundManager.stopGameEndNegLoop();
ScreenPlayer.hideNextLevelAnim();
ScreenPlayer.hideLevelSign();
ScreenPlayer.setupWaveSign();
ScreenPlayer.renderWaveSign(1);
coreGame.endGame();
Communicator.sendPlayData(34, currentTick, coreGame.getScore());
}
private function bonus(){
coreGame.setBonus();
}
public function diplomaThreeReaction():int{
return (coreGame.diplomaThreeReaction());
}
}
}//package com.king.daisy_defender
Section 24
//GeneratorXML (com.king.daisy_defender.GeneratorXML)
package com.king.daisy_defender {
class GeneratorXML {
public static var generatorXML:XML = <generatorxml>
<debug_seed nr="8888"></debug_seed>
<wave nr="1">
<shots nr="20"></shots>
<special_powers percent="20" positive_percent="80"></special_powers>
<speed_diff percent="30"></speed_diff>
<spawner on="no" speed="2.0" spawned_speed="2.0" wait_frames="200" max_nr="5" min_interval="25" max_interval="200"></spawner>
<b1_spawn max_nr="2" min_interval="25" max_interval="250"></b1_spawn>
<b1 speed="2.0"></b1>
<b2 speed="1.5"></b2>
<b3 speed="1.2"></b3>
<f speed="2.5"></f>
<ant tick="10" type="b2"></ant>
<ant tick="10" type="b2"></ant>
<ant tick="100" type="b2"></ant>
<ant tick="100" type="b2b1"></ant>
<ant tick="200" type="b2"></ant>
<ant tick="200" type="b2"></ant>
<ant tick="200" type="b2b1"></ant>
<ant tick="200" type="b2"></ant>
<ant tick="300" type="b2f"></ant>
<ant tick="300" type="b2"></ant>
<ant tick="350" type="b2"></ant>
<ant tick="350" type="b2"></ant>
</wave>
<wave nr="2">
<shots nr="20"></shots>
<special_powers percent="20" positive_percent="80"></special_powers>
<speed_diff percent="30"></speed_diff>
<spawner on="no" speed="2.0" spawned_speed="2.0" wait_frames="200" max_nr="5" min_interval="25" max_interval="200"></spawner>
<b1_spawn max_nr="2" min_interval="25" max_interval="250"></b1_spawn>
<b1 speed="2.0"></b1>
<b2 speed="1.5"></b2>
<b3 speed="1.2"></b3>
<f speed="2.5"></f>
<ant tick="10" type="b2"></ant>
<ant tick="10" type="b2"></ant>
<ant tick="10" type="b2"></ant>
<ant tick="10" type="b2b1"></ant>
<ant tick="100" type="b2"></ant>
<ant tick="100" type="b2"></ant>
<ant tick="200" type="b2f"></ant>
<ant tick="200" type="f"></ant>
<ant tick="200" type="b2"></ant>
<ant tick="200" type="b2"></ant>
<ant tick="300" type="b2b1"></ant>
<ant tick="300" type="b2"></ant>
<ant tick="350" type="f"></ant>
<ant tick="350" type="b3f"></ant>
</wave>
<wave nr="3">
<shots nr="15"></shots>
<special_powers percent="20" positive_percent="80"></special_powers>
<speed_diff percent="30"></speed_diff>
<spawner on="no" speed="2.0" spawned_speed="2.0" wait_frames="200" max_nr="5" min_interval="25" max_interval="200"></spawner>
<b1_spawn max_nr="2" min_interval="50" max_interval="250"></b1_spawn>
<b1 speed="2.0"></b1>
<b2 speed="1.5"></b2>
<b3 speed="1.2"></b3>
<f speed="2.5"></f>
<ant tick="10" type="b2"></ant>
<ant tick="10" type="b2"></ant>
<ant tick="10" type="b2"></ant>
<ant tick="20" type="b2"></ant>
<ant tick="100" type="b2"></ant>
<ant tick="100" type="b2"></ant>
<ant tick="200" type="b1b3"></ant>
<ant tick="200" type="b1b3"></ant>
<ant tick="250" type="b2"></ant>
<ant tick="250" type="b2"></ant>
<ant tick="300" type="b1"></ant>
<ant tick="300" type="b1"></ant>
<ant tick="350" type="b2"></ant>
<ant tick="350" type="b2"></ant>
<ant tick="400" type="f"></ant>
<ant tick="400" type="f"></ant>
</wave>
<wave nr="4">
<shots nr="25"></shots>
<special_powers percent="20" positive_percent="80"></special_powers>
<speed_diff percent="30"></speed_diff>
<spawner on="yes" speed="2.0" spawned_speed="2.0" wait_frames="100" max_nr="5" min_interval="50" max_interval="250"></spawner>
<b1_spawn max_nr="2" min_interval="50" max_interval="250"></b1_spawn>
<b1 speed="2.0"></b1>
<b2 speed="1.5"></b2>
<b3 speed="1.2"></b3>
<f speed="2.5"></f>
<ant tick="10" type="b2"></ant>
<ant tick="10" type="b2"></ant>
<ant tick="10" type="b2"></ant>
<ant tick="10" type="b2"></ant>
<ant tick="100" type="b2"></ant>
<ant tick="100" type="b2f"></ant>
<ant tick="100" type="b1f"></ant>
<ant tick="100" type="b2"></ant>
<ant tick="200" type="b2f"></ant>
<ant tick="200" type="b2"></ant>
<ant tick="250" type="f"></ant>
<ant tick="250" type="f"></ant>
<ant tick="300" type="b2f"></ant>
<ant tick="300" type="b2b1"></ant>
<ant tick="400" type="f"></ant>
<ant tick="400" type="fb3"></ant>
<ant tick="450" type="b2"></ant>
<ant tick="450" type="b2"></ant>
</wave>
<wave nr="5">
<shots nr="20"></shots>
<special_powers percent="20" positive_percent="80"></special_powers>
<speed_diff percent="30"></speed_diff>
<spawner on="yes" speed="2.0" spawned_speed="2.0" wait_frames="100" max_nr="5" min_interval="50" max_interval="250"></spawner>
<b1_spawn max_nr="2" min_interval="50" max_interval="250"></b1_spawn>
<b1 speed="2.0"></b1>
<b2 speed="1.5"></b2>
<b3 speed="1.2"></b3>
<f speed="2.5"></f>
<ant tick="10" type="b2"></ant>
<ant tick="10" type="b2"></ant>
<ant tick="10" type="b2"></ant>
<ant tick="10" type="b2"></ant>
<ant tick="50" type="b1f"></ant>
<ant tick="50" type="b2f"></ant>
<ant tick="100" type="b2"></ant>
<ant tick="100" type="b2f"></ant>
<ant tick="200" type="b2"></ant>
<ant tick="200" type="b2b3"></ant>
<ant tick="300" type="b1"></ant>
<ant tick="300" type="b2"></ant>
<ant tick="350" type="b2f"></ant>
<ant tick="350" type="b2"></ant>
<ant tick="350" type="fb3"></ant>
<ant tick="400" type="b2f"></ant>
<ant tick="400" type="b2"></ant>
<ant tick="400" type="b2"></ant>
<ant tick="450" type="b1f"></ant>
<ant tick="450" type="f"></ant>
</wave>
<wave nr="6">
<shots nr="30"></shots>
<special_powers percent="20" positive_percent="80"></special_powers>
<speed_diff percent="30"></speed_diff>
<spawner on="yes" speed="2.0" spawned_speed="2.0" wait_frames="100" max_nr="5" min_interval="50" max_interval="250"></spawner>
<b1_spawn max_nr="3" min_interval="50" max_interval="250"></b1_spawn>
<b1 speed="2.0"></b1>
<b2 speed="1.5"></b2>
<b3 speed="1.2"></b3>
<f speed="2.5"></f>
<ant tick="10" type="b2f"></ant>
<ant tick="10" type="b2f"></ant>
<ant tick="10" type="b2"></ant>
<ant tick="10" type="b2"></ant>
<ant tick="100" type="b2b1f"></ant>
<ant tick="100" type="b2b1f"></ant>
<ant tick="150" type="b2"></ant>
<ant tick="150" type="b2"></ant>
<ant tick="150" type="b2b1"></ant>
<ant tick="200" type="b2"></ant>
<ant tick="200" type="b2"></ant>
<ant tick="300" type="f"></ant>
<ant tick="300" type="fb3"></ant>
<ant tick="300" type="f"></ant>
<ant tick="300" type="f"></ant>
<ant tick="320" type="b2"></ant>
<ant tick="320" type="b2"></ant>
<ant tick="350" type="f"></ant>
<ant tick="400" type="f"></ant>
<ant tick="400" type="b2f"></ant>
<ant tick="400" type="b2f"></ant>
<ant tick="500" type="b2"></ant>
<ant tick="500" type="b2b3"></ant>
<ant tick="550" type="fb1"></ant>
<ant tick="550" type="fb2"></ant>
</wave>
<wave nr="7">
<shots nr="30"></shots>
<special_powers percent="20" positive_percent="80"></special_powers>
<speed_diff percent="30"></speed_diff>
<spawner on="yes" speed="2.0" spawned_speed="2.0" wait_frames="100" max_nr="5" min_interval="50" max_interval="250"></spawner>
<b1_spawn max_nr="3" min_interval="50" max_interval="250"></b1_spawn>
<b1 speed="2.0"></b1>
<b2 speed="1.5"></b2>
<b3 speed="1.2"></b3>
<f speed="2.5"></f>
<ant tick="10" type="b2f"></ant>
<ant tick="10" type="b2f"></ant>
<ant tick="40" type="b2"></ant>
<ant tick="40" type="b2"></ant>
<ant tick="100" type="b1"></ant>
<ant tick="100" type="b1"></ant>
<ant tick="200" type="b2f"></ant>
<ant tick="200" type="b2f"></ant>
<ant tick="200" type="b2"></ant>
<ant tick="200" type="b2"></ant>
<ant tick="300" type="b3"></ant>
<ant tick="300" type="b2"></ant>
<ant tick="400" type="b3"></ant>
<ant tick="400" type="b2f"></ant>
<ant tick="500" type="b2"></ant>
<ant tick="500" type="b2b1"></ant>
<ant tick="520" type="b2"></ant>
<ant tick="520" type="b2b3"></ant>
<ant tick="530" type="b2f"></ant>
<ant tick="540" type="b2"></ant>
<ant tick="550" type="b2f"></ant>
<ant tick="550" type="b2"></ant>
</wave>
<wave nr="8">
<shots nr="30"></shots>
<special_powers percent="20" positive_percent="80"></special_powers>
<speed_diff percent="30"></speed_diff>
<spawner on="yes" speed="2.0" spawned_speed="2.0" wait_frames="100" max_nr="5" min_interval="50" max_interval="250"></spawner>
<b1_spawn max_nr="3" min_interval="50" max_interval="250"></b1_spawn>
<b1 speed="2.0"></b1>
<b2 speed="1.5"></b2>
<b3 speed="1.2"></b3>
<f speed="2.5"></f>
<ant tick="10" type="b2f"></ant>
<ant tick="10" type="b2f"></ant>
<ant tick="40" type="b2"></ant>
<ant tick="40" type="b2"></ant>
<ant tick="100" type="b1"></ant>
<ant tick="100" type="b1"></ant>
<ant tick="200" type="b2f"></ant>
<ant tick="200" type="b2f"></ant>
<ant tick="200" type="b2f"></ant>
<ant tick="250" type="b2f"></ant>
<ant tick="300" type="b2b3"></ant>
<ant tick="300" type="b2b3"></ant>
<ant tick="400" type="b2b3"></ant>
<ant tick="400" type="b2b3"></ant>
<ant tick="450" type="b2f"></ant>
<ant tick="450" type="b2f"></ant>
<ant tick="450" type="b2f"></ant>
<ant tick="500" type="b3b2f"></ant>
<ant tick="500" type="b1b2f"></ant>
<ant tick="500" type="b2f"></ant>
<ant tick="550" type="b2b1"></ant>
<ant tick="550" type="b2"></ant>
<ant tick="600" type="b2"></ant>
<ant tick="600" type="f"></ant>
</wave>
<wave nr="9">
<shots nr="30"></shots>
<special_powers percent="20" positive_percent="80"></special_powers>
<speed_diff percent="30"></speed_diff>
<spawner on="yes" speed="2.0" spawned_speed="2.0" wait_frames="100" max_nr="5" min_interval="50" max_interval="250"></spawner>
<b1_spawn max_nr="3" min_interval="50" max_interval="250"></b1_spawn>
<b1 speed="2.0"></b1>
<b2 speed="1.5"></b2>
<b3 speed="1.2"></b3>
<f speed="2.5"></f>
<ant tick="10" type="b2fb1"></ant>
<ant tick="10" type="b2fb1"></ant>
<ant tick="10" type="b2f"></ant>
<ant tick="10" type="b2f"></ant>
<ant tick="100" type="b2"></ant>
<ant tick="100" type="b2"></ant>
<ant tick="200" type="b2fb1"></ant>
<ant tick="200" type="b2fb1"></ant>
<ant tick="200" type="b2"></ant>
<ant tick="200" type="b2"></ant>
<ant tick="250" type="b2"></ant>
<ant tick="250" type="b2"></ant>
<ant tick="300" type="b3"></ant>
<ant tick="300" type="b1b3"></ant>
<ant tick="350" type="b2b3"></ant>
<ant tick="350" type="fb3"></ant>
<ant tick="400" type="b2"></ant>
<ant tick="400" type="b2"></ant>
<ant tick="450" type="b2f"></ant>
<ant tick="450" type="b2f"></ant>
<ant tick="450" type="b2b1"></ant>
<ant tick="500" type="b2f"></ant>
<ant tick="500" type="b2f"></ant>
<ant tick="500" type="b2f"></ant>
<ant tick="500" type="b2b1"></ant>
<ant tick="600" type="b2b1"></ant>
<ant tick="600" type="b2f"></ant>
<ant tick="650" type="b2b1"></ant>
<ant tick="700" type="b2f"></ant>
<ant tick="700" type="b3"></ant>
</wave>
</generatorxml>
;
}
}//package com.king.daisy_defender
Section 25
//Gum (com.king.daisy_defender.Gum)
package com.king.daisy_defender {
import flash.display.*;
class Gum extends BaseObject {
protected var tickCounter:int;
public static var SHOW_TIME:int = 250;
function Gum(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Array, _arg5:Function){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
tickCounter = 0;
}
override protected function createClip():void{
clip = new mc_gumCollected();
clip.visible = false;
parentClip.addChild(clip);
}
override public function tick(){
super.tick();
if (tickCounter == SHOW_TIME){
visible = false;
collidable = false;
toBeRemoved = true;
};
tickCounter++;
}
public function extendTime(){
tickCounter = 0;
}
}
}//package com.king.daisy_defender
Section 26
//GumItem (com.king.daisy_defender.GumItem)
package com.king.daisy_defender {
import flash.display.*;
import com.king.daisy_defender.*;
class GumItem extends SpecialItem {
function GumItem(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Array, _arg7:Function){
super(_arg1, _arg2, _arg3, _arg6, _arg7);
this.angle = _arg4;
this.speed = _arg5;
angleOffset = -(_arg4);
calculateMovement();
tickCounter = 0;
}
override protected function createTrajectorClip():void{
var _local1:MovieClip;
_local1 = References.gameClip5;
trajectorClip = new Shape();
if (!visible){
trajectorClip.visible = false;
};
_local1.addChild(trajectorClip);
trajectorClip.graphics.lineStyle(1, 0xFFFFFF);
trajectorClip.graphics.moveTo(startPosX, (startPosY - 30));
trajectorClip.graphics.lineTo(posX, (posY - 30));
}
override public function render(_arg1:Number){
super.render(_arg1);
deleteTrajectorClip();
createTrajectorClip();
}
override public function deleting(){
super.deleting();
deleteTrajectorClip();
}
override protected function deleteTrajectorClip(){
var _local1:MovieClip;
_local1 = References.gameClip5;
if (trajectorClip){
_local1.removeChild(trajectorClip);
};
trajectorClip = null;
}
override public function collisionReaction(_arg1:BaseObject){
if ((_arg1 is Explosion)){
messageCallback("GumItem taken", null);
};
super.collisionReaction(_arg1);
}
override protected function createClip():void{
clip = new mc_gum();
clip.visible = false;
parentClip.addChild(clip);
clip.cacheAsBitmap = true;
}
override protected function createCollisionObject():void{
collisionObject = new CollisionObject(0, 0, 50);
}
}
}//package com.king.daisy_defender
Section 27
//IFloat (com.king.daisy_defender.IFloat)
package com.king.daisy_defender {
class IFloat {
public var ivalue:Number;
private var lastValue:Number;
function IFloat(_arg1:Number){
ivalue = _arg1;
lastValue = _arg1;
}
public function method_1(_arg1:Number){
lastValue = ivalue;
ivalue = _arg1;
}
public function method_2(_arg1:Number){
return ((lastValue + ((ivalue - lastValue) * _arg1)));
}
public function setTo(_arg1:Number){
ivalue = _arg1;
lastValue = _arg1;
}
}
}//package com.king.daisy_defender
Section 28
//InfoData (com.king.daisy_defender.InfoData)
package com.king.daisy_defender {
class InfoData {
public var data2:Number;
public var data3:Number;
public var data4:Number;
public var data1:Number;
}
}//package com.king.daisy_defender
Section 29
//Input (com.king.daisy_defender.Input)
package com.king.daisy_defender {
class Input {
public static var mouseIsReleased:Boolean;
public static var xMouse:int;
public static var mouseIsPressed:Boolean;
public static var yMouse:int;
public static function traceInput(){
}
public static function mouseReleased(){
mouseIsReleased = true;
}
public static function reset(){
mouseIsPressed = false;
mouseIsReleased = false;
}
public static function init(){
reset();
}
public static function setMousePos(_arg1:Number, _arg2:Number){
xMouse = (_arg1 - 35);
yMouse = (_arg2 - 32);
}
public static function mousePressed(){
mouseIsPressed = true;
}
}
}//package com.king.daisy_defender
Section 30
//Integer64 (com.king.daisy_defender.Integer64)
package com.king.daisy_defender {
class Integer64 {
private var p:Array;
private var r:Array;
private var s:Array;
function Integer64(_arg1){
r = [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]];
p = [0, 0, 0, 0, 0];
s = [0, 0, 0];
if (_arg1){
merge(_arg1);
};
}
public function binaryShiftRight(_arg1:Number):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
_local2 = ((_arg1 / 15) >> 0);
_local3 = (_arg1 - (_local2 * 15));
_local4 = (p.length - 1);
while (_local4 > 0) {
_local5 = 0;
while (_local5 < _local2) {
p[_local5] = p[(_local5 + 1)];
_local5++;
};
var _temp1 = _local4;
_local4 = (_local4 - 1);
var _local7 = _temp1;
p[_local7] = 0;
};
if (_local3 > 0){
_local6 = 0;
while (_local6 < _local3) {
shr();
_local6++;
};
};
}
public function mul32(_arg1:Number):void{
mul64(new Integer64(_arg1));
}
private function merge(_arg1:Number):Number{
var _local2:*;
_local2 = 0;
while (_local2 < 3) {
p[_local2] = (p[_local2] + (_arg1 & 32767));
_arg1 = (_arg1 >>> 15);
_local2++;
};
return (_arg1);
}
public function binaryShiftLeft(_arg1:Number):void{
var _local2:*;
_local2 = 0;
while (_local2 < _arg1) {
shl();
_local2++;
};
}
public function mul64(_arg1:Integer64):void{
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = 0;
_local3 = 0;
while (_local3 < 5) {
_local4 = _arg1.p[_local3];
_local2 = (_local4 * p[0]);
r[_local3][0] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (_local4 * p[1]));
r[_local3][1] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (_local4 * p[2]));
r[_local3][2] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (_local4 * p[3]));
r[_local3][3] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (_local4 * p[4]));
r[_local3][4] = (_local2 & 32767);
_local3++;
};
_local2 = r[0][0];
p[0] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (r[0][1] + r[1][0]));
p[1] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + ((r[0][2] + r[1][1]) + r[2][0]));
p[2] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (((r[0][3] + r[1][2]) + r[2][1]) + r[3][0]));
p[3] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + ((((r[0][4] + r[1][3]) + r[2][2]) + r[3][1]) + r[4][0]));
p[4] = (_local2 & 7);
}
private function shr():void{
var _local1:*;
var _local2:*;
var _local3:*;
_local1 = 0;
_local2 = 0;
_local3 = (p.length - 1);
while (_local3 >= 0) {
_local1 = ((p[_local3] & 1) << 14);
p[_local3] = (p[_local3] >> 1);
p[_local3] = ((p[_local3] | _local2) & 32767);
_local3--;
_local2 = _local1;
};
}
public function init32(_arg1:Number):void{
p[0] = (_arg1 & 32767);
_arg1 = (_arg1 >>> 15);
p[1] = (_arg1 & 32767);
_arg1 = (_arg1 >>> 15);
p[2] = (_arg1 & 3);
p[3] = 0;
p[4] = 0;
}
public function init(_arg1:Integer64):void{
var _local2:*;
_local2 = 0;
while (_local2 < p.length) {
p[_local2] = _arg1.p[_local2];
_local2++;
};
}
public function add32(_arg1:Number):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local2 = 0;
_local3 = (_arg1 & 32767);
_arg1 = (_arg1 >> 15);
_local4 = (_arg1 & 32767);
_arg1 = (_arg1 >> 15);
_local5 = (_arg1 & 3);
_local2 = (_local2 + (p[0] + _local3));
p[0] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (p[1] + _local4));
p[1] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (p[2] + _local5));
p[2] = (_local2 & 32767);
}
public function binaryNot(_arg1:Integer64):void{
p[0] = (p[0] ^ _arg1.p[0]);
p[1] = (p[1] ^ _arg1.p[1]);
p[2] = (p[2] ^ _arg1.p[2]);
p[3] = (p[3] ^ _arg1.p[3]);
p[4] = (p[4] ^ _arg1.p[4]);
}
public function get lsb():Number{
return (((p[0] | (p[1] << 15)) | ((p[2] & 3) << 30)));
}
public function get msb():Number{
return (((((p[2] >> 2) | ((p[3] << 15) >> 2)) | ((p[4] << (15 * 2)) >> 2)) & 2147483647));
}
public function mulu32(_arg1:Number):void{
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = 0;
s[0] = (_arg1 & 32767);
_arg1 = (_arg1 >>> 15);
s[1] = (_arg1 & 32767);
_arg1 = (_arg1 >>> 15);
s[2] = (_arg1 & 3);
_local3 = 0;
while (_local3 < 3) {
_local4 = s[_local3];
_local2 = (_local4 * p[0]);
r[_local3][0] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (_local4 * p[1]));
r[_local3][1] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (_local4 * p[2]));
r[_local3][2] = (_local2 & 3);
_local3++;
};
_local2 = r[0][0];
p[0] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (r[0][1] + r[1][0]));
p[1] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + ((r[0][2] + r[1][1]) + r[2][0]));
p[2] = (_local2 & 3);
p[3] = 0;
p[4] = 0;
}
private function shl():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
_local1 = 0;
_local2 = 0;
_local3 = 0;
_local4 = p.length;
while (_local3 < _local4) {
_local1 = ((p[_local3] & 0x4000) >> 14);
p[_local3] = (p[_local3] << 1);
p[_local3] = ((p[_local3] | _local2) & 32767);
_local3++;
_local2 = _local1;
};
}
public function add64(_arg1:Integer64):void{
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = 0;
_local3 = 1;
_local4 = 0;
while ((((_local3 < p.length)) && (!((_arg1.p[_local4] == 0))))) {
_local3++;
};
_local4 = 0;
while (_local4 < _local3) {
_local2 = (_local2 + (p[_local4] + _arg1.p[_local4]));
p[_local4] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local4++;
};
}
}
}//package com.king.daisy_defender
Section 31
//Moth (com.king.daisy_defender.Moth)
package com.king.daisy_defender {
import flash.display.*;
import com.king.daisy_defender.*;
class Moth extends Ant {
function Moth(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Array, _arg7:Function){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
animFrame = Math.floor(((Math.random() * 4) + 1));
animIFloat.setTo(animFrame);
}
override public function tick(){
if (animCounter == 1){
if (animFrame < 4){
animFrame = (animFrame + 1);
} else {
animFrame = 1;
};
animCounter = 0;
};
animCounter++;
super.tick();
}
override protected function createClip():void{
clip = new BitmapMoth();
clip.visible = false;
angleOffset = -90;
parentClip.addChild(clip);
}
override protected function explode2(){
super.explode2();
messageCallback("Moth killed on ground", null);
}
override protected function createCollisionObject():void{
collisionObject = new CollisionObject(0, 0, 26);
}
override protected function createExplosion(_arg1:Boolean, _arg2:ExplosionLevel){
var _local3:Explosion;
_local3 = new Explosion(References.game2Clip3, posX, posY, START_EXPLOSION_DIAMETER, END_EXPLOSION_DIAMETER, 0, Explosion.COLOR_MOTH, _arg1, _arg2, newObjects, messageCallback);
newObjects.push(_local3);
}
override public function antExplode(_arg1:ExplosionLevel){
var _local2:InfoData;
super.antExplode(_arg1);
_local2 = new InfoData();
_local2.data1 = posX;
_local2.data2 = posY;
_local2.data3 = _arg1.level;
messageCallback("Moth killed", _local2);
}
}
}//package com.king.daisy_defender
Section 32
//Random (com.king.daisy_defender.Random)
package com.king.daisy_defender {
import flash.utils.*;
public class Random {
private var mti:Number;
private var lastSeed:Number;
private var mta:Array;
private static var MATRIX_A:Number = 2567483615;
public static var nr:int = 0;
private static var UPPER_MASK:Number = 2147483648;
private static var LOWER_MASK:Number = 2147483647;
private static var M:Number = 397;
private static var N:Number = 624;
private static var mag01:Array = [0, 2567483615];
public function Random(_arg1:Number){
mta = new Array(N);
mti = (N + 1);
if (_arg1){
init_genrand(_arg1);
};
}
private function init_genrand(_arg1:Number):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:Number;
var _local6:*;
_arg1 = int(_arg1);
_local2 = getTimer();
lastSeed = _arg1;
mta[0] = _arg1;
_local3 = _arg1;
_local4 = new Integer64(null);
_local5 = N;
mti = 1;
while (mti < _local5) {
_local4.init32(((_local3 >>> 30) ^ _local3));
_local4.mulu32(1812433253);
_local3 = (mta[mti] = int((_local4.lsb + mti)));
mti++;
};
_local6 = getTimer();
}
public function set seed(_arg1:Number){
init_genrand(_arg1);
}
public function nextDouble(){
return ((next(24) / (1 << 24)));
}
public function nextFloat(){
return ((next(24) / (1 << 24)));
}
public function get seed():Number{
return (lastSeed);
}
public function next(_arg1:Number){
if (_arg1 < 32){
return ((genrand_int32() & ((1 << _arg1) - 1)));
};
return (genrand_int32());
}
public function nextInt(_arg1:Number){
nr++;
return (((genrand_int32() & 2147483647) % _arg1));
}
private function genrand_int32(){
var _local1:Number;
var _local2:Number;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
_local1 = N;
_local2 = 0;
if (mti >= _local1){
if (mti == (_local1 + 1)){
init_genrand(5489);
};
_local3 = M;
_local4 = UPPER_MASK;
_local5 = LOWER_MASK;
_local6 = mag01;
_local7 = getTimer();
_local8 = 0;
_local9 = (_local1 - _local3);
_local10 = (_local3 - _local1);
_local8 = 0;
while (_local8 < _local9) {
_local2 = ((mta[_local8] & _local4) | (mta[(_local8 + 1)] & _local5));
mta[_local8] = ((mta[(_local8 + _local3)] ^ (_local2 >>> 1)) ^ _local6[(_local2 & 1)]);
_local8++;
};
_local9 = (_local1 - 1);
while (_local8 < _local9) {
_local2 = ((mta[_local8] & _local4) | (mta[(_local8 + 1)] & _local5));
mta[_local8] = ((mta[(_local8 + _local10)] ^ (_local2 >>> 1)) ^ _local6[(_local2 & 1)]);
_local8++;
};
_local2 = ((mta[(_local1 - 1)] & _local4) | (mta[0] & _local5));
mta[(_local1 - 1)] = ((mta[(_local3 - 1)] ^ (_local2 >>> 1)) ^ _local6[(_local2 & 1)]);
mti = 0;
_local11 = getTimer();
};
_local2 = mta[mti++];
_local2 = (_local2 ^ (_local2 >>> 11));
_local2 = (_local2 ^ ((_local2 << 7) & 2636928640));
_local2 = (_local2 ^ ((_local2 << 15) & 4022730752));
_local2 = (_local2 ^ (_local2 >>> 18));
return (_local2);
}
}
}//package com.king.daisy_defender
Section 33
//References (com.king.daisy_defender.References)
package com.king.daisy_defender {
import flash.display.*;
import flash.text.*;
public class References {
public static var guiLevel:TextField;
public static var gameClip1:MovieClip;
public static var gameClip2:MovieClip;
public static var gameClip3:MovieClip;
public static var gameClip4:MovieClip;
public static var gameClip5:MovieClip;
public static var debugFPS:TextField;
public static var guiScore:TextField;
public static var guiBoostClip:MovieClip;
public static var gameClip:MovieClip;
public static var debugNrObjects:TextField;
public static var hideClip:MovieClip;
public static var debugText1:TextField;
public static var game2Clip1:MovieClip;
public static var game2Clip2:MovieClip;
public static var random:Random;
public static var soundOnOffButtonClip:MovieClip;
public static var game2Clip4:MovieClip;
public static var gameCollisionClip:MovieClip;
public static var game2Clip3:MovieClip;
public static var guiWave:TextField;
public static var debugFPS2:TextField;
public static var daisyDefenderClip:MovieClip;
public static var endGameButtonClip:MovieClip;
public static var game2Clip:MovieClip;
public static var game3Clip:MovieClip;
public static var seed:Number;
public static var guiSuperSprayClip:MovieClip;
public static function setReferences(_arg1:MovieClip){
daisyDefenderClip = _arg1;
hideClip = MovieClip(daisyDefenderClip.getChildByName("Hide_mc"));
gameClip = MovieClip(daisyDefenderClip.getChildByName("Game_mc"));
game2Clip = MovieClip(daisyDefenderClip.getChildByName("Game2_mc"));
game3Clip = MovieClip(daisyDefenderClip.getChildByName("Game3_mc"));
gameCollisionClip = MovieClip(daisyDefenderClip.getChildByName("GameDebug_mc"));
guiScore = TextField(daisyDefenderClip.getChildByName("score_txt"));
guiLevel = TextField(daisyDefenderClip.getChildByName("level_txt"));
guiWave = TextField(daisyDefenderClip.getChildByName("wave_txt"));
guiSuperSprayClip = MovieClip(daisyDefenderClip.getChildByName("SuperSpraySign_mc"));
guiBoostClip = MovieClip(daisyDefenderClip.getChildByName("BoostSign_mc"));
endGameButtonClip = MovieClip(daisyDefenderClip.getChildByName("EndGame_mc"));
soundOnOffButtonClip = MovieClip(daisyDefenderClip.getChildByName("SoundOnOff_mc"));
debugFPS = TextField(daisyDefenderClip.getChildByName("FPS_txt"));
debugFPS2 = TextField(daisyDefenderClip.getChildByName("FPS2_txt"));
debugNrObjects = TextField(daisyDefenderClip.getChildByName("Objects_txt"));
debugText1 = TextField(daisyDefenderClip.getChildByName("Debug1_txt"));
createGameClips();
gameClip.InnerGame_mc.visible = false;
game2Clip.InnerGame_mc.visible = false;
game3Clip.InnerGame_mc.visible = false;
gameCollisionClip.InnerGameDebug_mc.visible = false;
}
private static function createGameClips():void{
References.game2Clip4 = new MovieClip();
References.game2Clip.addChild(References.game2Clip4);
References.game2Clip3 = new MovieClip();
References.game2Clip.addChild(References.game2Clip3);
References.game2Clip2 = new MovieClip();
References.game2Clip.addChild(References.game2Clip2);
References.game2Clip1 = new MovieClip();
References.game2Clip.addChild(References.game2Clip1);
References.gameClip5 = new MovieClip();
References.gameClip.addChild(References.gameClip5);
References.gameClip4 = new MovieClip();
References.gameClip.addChild(References.gameClip4);
References.gameClip3 = new MovieClip();
References.gameClip.addChild(References.gameClip3);
References.gameClip2 = new MovieClip();
References.gameClip.addChild(References.gameClip2);
References.gameClip1 = new MovieClip();
References.gameClip.addChild(References.gameClip1);
}
public static function createRandom(_arg1:Number){
random = new Random(_arg1);
}
private static function deleteGameClips():void{
References.game2Clip.removeChild(References.game2Clip1);
References.game2Clip1 = null;
References.game2Clip.removeChild(game2Clip2);
game2Clip2 = null;
References.game2Clip.removeChild(References.game2Clip3);
References.game2Clip3 = null;
References.game2Clip.removeChild(References.game2Clip4);
References.game2Clip4 = null;
References.gameClip.removeChild(References.gameClip1);
References.gameClip1 = null;
References.gameClip.removeChild(gameClip2);
gameClip2 = null;
References.gameClip.removeChild(References.gameClip3);
References.gameClip3 = null;
References.gameClip.removeChild(gameClip4);
gameClip4 = null;
References.gameClip.removeChild(gameClip5);
gameClip5 = null;
}
}
}//package com.king.daisy_defender
Section 34
//RefilItem (com.king.daisy_defender.RefilItem)
package com.king.daisy_defender {
import flash.display.*;
class RefilItem extends SpecialItem {
function RefilItem(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Array, _arg5:Function){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
tickCounter = 0;
}
override public function collisionReaction(_arg1:BaseObject){
if ((_arg1 is Explosion)){
messageCallback("RefilItem taken", null);
};
super.collisionReaction(_arg1);
}
override protected function createClip():void{
clip = new mc_refill();
clip.visible = false;
parentClip.addChild(clip);
clip.cacheAsBitmap = true;
}
override protected function createCollisionObject():void{
collisionObject = new CollisionObject(0, 0, 40);
}
}
}//package com.king.daisy_defender
Section 35
//ScorePop (com.king.daisy_defender.ScorePop)
package com.king.daisy_defender {
import flash.display.*;
import com.king.daisy_defender.*;
class ScorePop extends BaseObject {
protected var tickCounter:int;
public static var SHOW_TIME:int = 25;
function ScorePop(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Array, _arg5:Function, _arg6:int){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
tickCounter = 0;
clip.Score_txt.text = String(_arg6);
}
override protected function createClip():void{
clip = new scorepop();
clip.visible = false;
parentClip.addChild(clip);
clip.cacheAsBitmap = true;
}
override public function tick(){
super.tick();
if (tickCounter == SHOW_TIME){
visible = false;
collidable = false;
toBeRemoved = true;
};
tickCounter++;
}
}
}//package com.king.daisy_defender
Section 36
//ScorePopBonus (com.king.daisy_defender.ScorePopBonus)
package com.king.daisy_defender {
import flash.display.*;
import com.king.daisy_defender.*;
class ScorePopBonus extends ScorePop {
function ScorePopBonus(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Array, _arg5:Function, _arg6:int){
var _local7:int;
var _local8:String;
super(_arg1, _arg2, _arg3, _arg4, _arg5, 0);
_local7 = (_arg6 / 2);
_local8 = ("2 x " + _local7);
clip.Score_txt.text = _local8;
}
override public function tick(){
super.tick();
if (tickCounter == SHOW_TIME){
visible = false;
collidable = false;
toBeRemoved = true;
};
tickCounter++;
}
override protected function createClip():void{
clip = new scorepopboost();
clip.visible = false;
parentClip.addChild(clip);
clip.cacheAsBitmap = true;
}
}
}//package com.king.daisy_defender
Section 37
//ScreenPlayer (com.king.daisy_defender.ScreenPlayer)
package com.king.daisy_defender {
import flash.display.*;
import fl.transitions.easing.*;
import fl.transitions.*;
public class ScreenPlayer {
public var tickStr:String;
private static var IntroLevelSignLevel:int = 0;
private static var groundAnimFrame:int;
private static var myTween:Tween;
private static var waveSignAnimFrame:int = 10;
private static var gameOverNegAnimFrame:Number = 1;
private static var mothAnimCounter:int;
private static var waveFlyAnimFrame:int;
private static var animIFloatBug3:IFloat = new IFloat(1);
private static var animIFloatBug2:IFloat = new IFloat(1);
private static var nextLevel:int = 0;
private static var insecticideAnimFrame:int = 1;
private static var shotsLeft:int = 12;
private static var levelSignAnimFrame:int;
private static var nextLevelAnimFrame:Number = 1;
private static var bug2AnimCounter:int;
private static var introSignAnimFrame:int = 1;
private static var eyes1AnimFrame:int;
private static var animIFloatMoth:IFloat = new IFloat(1);
private static var eyes2AnimFrame:int;
private static var eyes3AnimFrame:int;
private static var animIFloat:IFloat = new IFloat(1);
private static var eyes4AnimFrame:int;
public static function setupLevelSignBugs(){
eyes1AnimFrame = 1;
eyes2AnimFrame = 60;
eyes3AnimFrame = 90;
}
public static function hideLevelIntroSign(){
References.daisyDefenderClip.Level1Sign_mc.visible = false;
References.daisyDefenderClip.Level2Sign_mc.visible = false;
References.daisyDefenderClip.Level3Sign_mc.visible = false;
}
public static function updateStartsInText(_arg1:int):Boolean{
var _local2:int;
var _local3:String;
var _local4:String;
_local2 = int((10 - (_arg1 / 25)));
_local3 = String(_local2);
_local4 = new String(TextProperties.GAME_STARTS_IN);
_local4 = _local4.split("[0]").join(_local3);
References.daisyDefenderClip.introsign_mc.GameStartsIn_txt.text = _local4;
if (_local2 == 0){
return (true);
};
return (false);
}
public static function renderWaveSign(_arg1:Number){
References.daisyDefenderClip.WaveSign_mc.gotoAndStop(waveSignAnimFrame);
if ((((((waveSignAnimFrame > 12)) && ((waveSignAnimFrame < 51)))) || ((((waveSignAnimFrame > 103)) && ((waveSignAnimFrame < 120)))))){
if (References.daisyDefenderClip.WaveSign_mc.fly){
References.daisyDefenderClip.WaveSign_mc.fly.gotoAndStop(11);
if (References.daisyDefenderClip.WaveSign_mc.fly.wings_mc){
References.daisyDefenderClip.WaveSign_mc.fly.wings_mc.gotoAndStop(waveFlyAnimFrame);
};
};
};
if ((((((waveSignAnimFrame > 28)) && ((waveSignAnimFrame < 116)))) && (References.daisyDefenderClip.WaveSign_mc.InnerWaveSign_mc.NextWave_txt))){
References.daisyDefenderClip.WaveSign_mc.InnerWaveSign_mc.NextWave_txt.text = TextProperties.WAVE_SIGN;
};
}
public static function renderNextLevelAnim(_arg1:Number){
switch (nextLevel){
case 1:
renderNextLevelAnim1(_arg1);
break;
case 2:
renderNextLevelAnim2(_arg1);
break;
case 3:
renderNextLevelAnim3(_arg1);
break;
};
}
public static function showInstructionScreen(){
References.daisyDefenderClip.introsign_mc.visible = true;
References.daisyDefenderClip.Decoration4_mc.visible = true;
}
public static function hideFreeGameSignSign(){
References.daisyDefenderClip.FreeGameSign_mc.visible = false;
myTween = null;
}
public static function updateLevelSignBugs(){
eyes1AnimFrame = (eyes1AnimFrame + 1);
if (eyes1AnimFrame > 119){
eyes1AnimFrame = 1;
};
eyes2AnimFrame = (eyes2AnimFrame + 1);
if (eyes2AnimFrame > 119){
eyes2AnimFrame = 1;
};
eyes3AnimFrame = (eyes3AnimFrame + 1);
if (eyes3AnimFrame > 119){
eyes3AnimFrame = 1;
};
}
public static function setupIntroLevelSign(){
IntroLevelSignLevel++;
levelSignAnimFrame = 1;
switch (IntroLevelSignLevel){
case 1:
References.daisyDefenderClip.Level1Sign_mc.visible = true;
break;
case 2:
References.daisyDefenderClip.Level2Sign_mc.visible = true;
break;
case 3:
References.daisyDefenderClip.Level3Sign_mc.visible = true;
break;
};
}
public static function updateLevelSignDaisy(){
eyes1AnimFrame = (eyes1AnimFrame + 1);
if (eyes1AnimFrame > 119){
eyes1AnimFrame = 1;
};
eyes2AnimFrame = (eyes2AnimFrame + 1);
if (eyes2AnimFrame > 119){
eyes2AnimFrame = 1;
};
eyes3AnimFrame = (eyes3AnimFrame + 1);
if (eyes3AnimFrame > 119){
eyes3AnimFrame = 1;
};
}
public static function updateWaveSign(){
waveSignAnimFrame = (waveSignAnimFrame + 1);
if (waveSignAnimFrame >= 127){
waveSignAnimFrame = 127;
};
waveFlyAnimFrame++;
if (waveFlyAnimFrame > 4){
waveFlyAnimFrame = 1;
};
}
public static function setLevelOnLevelSignToGameOver(){
References.daisyDefenderClip.LevelSign_mc.Level_txt.text = TextProperties.GAME_OVER;
}
public static function hideLevelSign(){
References.daisyDefenderClip.LevelSign_mc.visible = false;
myTween = null;
}
public static function renderLevelSignDaisy(){
References.daisyDefenderClip.LevelSign_mc.LevelSignDaisy1_mc.Eyes_mc.gotoAndStop(eyes1AnimFrame);
References.daisyDefenderClip.LevelSign_mc.LevelSignDaisy2_mc.Eyes_mc.gotoAndStop(eyes2AnimFrame);
References.daisyDefenderClip.LevelSign_mc.LevelSignDaisy3_mc.Eyes_mc.gotoAndStop(eyes3AnimFrame);
}
public static function setupNextLevelAnim2(){
nextLevelAnimFrame = 1;
animIFloat.setTo(nextLevelAnimFrame);
References.daisyDefenderClip.NextLevelAnim_mc.visible = true;
mothAnimCounter = 1;
eyes4AnimFrame = 55;
}
public static function setupNextLevelAnim3(){
nextLevelAnimFrame = 1;
References.daisyDefenderClip.NextLevelAnim3_mc.visible = true;
mothAnimCounter = 11;
eyes4AnimFrame = 70;
}
public static function hideNextLevelAnim2(){
References.daisyDefenderClip.NextLevelAnim_mc.visible = false;
}
public static function setupIntroSign(){
introSignAnimFrame = 1;
eyes1AnimFrame = 1;
eyes2AnimFrame = 25;
}
public static function hideGameOverNegAnim(){
References.daisyDefenderClip.GameOverAnim_mc.visible = false;
}
public static function renderIntroSign(_arg1:Number){
References.daisyDefenderClip.introsign_mc.gotoAndStop(introSignAnimFrame);
References.daisyDefenderClip.introsign_mc.insecticide.gotoAndStop(insecticideAnimFrame);
References.daisyDefenderClip.introsign_mc.insecticide.Cannon_txt.text = String(shotsLeft);
References.daisyDefenderClip.introsign_mc.introDaisy1_mc.Eyes_mc.gotoAndStop(eyes1AnimFrame);
References.daisyDefenderClip.introsign_mc.introDaisy2_mc.Eyes_mc.gotoAndStop(eyes2AnimFrame);
}
public static function hideGame(){
References.gameClip.visible = false;
References.game2Clip.visible = false;
}
public static function setShotsBonusOnLevelSign(_arg1:int){
var _local2:String;
_local2 = "";
if (_arg1 >= 0){
_local2 = (("" + _arg1) + " x 50");
};
References.daisyDefenderClip.LevelSign_mc.ShotsBonus_txt.text = _local2;
}
public static function soundOnOffShowOn(){
References.daisyDefenderClip.SoundOnOff_mc.SoundOnOff_txt.text = TextProperties.SOUND_OFF;
}
public static function hideNextLevelAnim3(){
References.daisyDefenderClip.NextLevelAnim3_mc.visible = false;
}
public static function hideNextLevelAnim1(){
References.daisyDefenderClip.NextLevelAnim1_mc.visible = false;
}
public static function setupGround(_arg1:int){
switch (_arg1){
case 1:
groundAnimFrame = 1;
break;
case 2:
groundAnimFrame = 2;
break;
case 3:
groundAnimFrame = 28;
break;
};
}
public static function setupNextLevelAnim1(){
nextLevelAnimFrame = 1;
References.daisyDefenderClip.NextLevelAnim1_mc.visible = true;
mothAnimCounter = 1;
eyes4AnimFrame = 60;
}
public static function setTotalScoreOnLevelSign(_arg1:int){
References.daisyDefenderClip.LevelSign_mc.TotalScore_txt.text = _arg1;
}
public static function setDaisyBonusOnLevelSign(_arg1:int){
var _local2:String;
_local2 = "";
if (_arg1 >= 0){
_local2 = (("" + _arg1) + " x 500");
};
References.daisyDefenderClip.LevelSign_mc.DaisyBonus_txt.text = _local2;
}
public static function hideInstructionScreen(){
References.daisyDefenderClip.introsign_mc.visible = false;
References.daisyDefenderClip.Decoration4_mc.visible = false;
}
public static function updateIntroLevelSign(){
levelSignAnimFrame++;
if (levelSignAnimFrame == 90){
levelSignAnimFrame = 90;
hideLevelIntroSign();
};
}
public static function updateIntroSign(){
if (introSignAnimFrame < 163){
introSignAnimFrame = (introSignAnimFrame + 1);
} else {
introSignAnimFrame = 1;
};
if (introSignAnimFrame == 34){
insecticideAnimFrame = 4;
shotsLeft--;
} else {
if ((((introSignAnimFrame > 34)) && ((introSignAnimFrame < 40)))){
insecticideAnimFrame = (insecticideAnimFrame + 4);
} else {
if ((((introSignAnimFrame >= 40)) && ((introSignAnimFrame < 46)))){
insecticideAnimFrame = (insecticideAnimFrame - 4);
};
};
};
if (introSignAnimFrame == 113){
insecticideAnimFrame = 4;
shotsLeft--;
} else {
if ((((introSignAnimFrame > 113)) && ((introSignAnimFrame < 119)))){
insecticideAnimFrame = (insecticideAnimFrame + 4);
} else {
if ((((introSignAnimFrame >= 119)) && ((introSignAnimFrame < 125)))){
insecticideAnimFrame = (insecticideAnimFrame - 4);
};
};
};
if (insecticideAnimFrame <= 0){
insecticideAnimFrame = 1;
};
eyes1AnimFrame = (eyes1AnimFrame + 1);
if (eyes1AnimFrame > 119){
eyes1AnimFrame = 1;
};
eyes2AnimFrame = (eyes2AnimFrame + 1);
if (eyes2AnimFrame > 119){
eyes2AnimFrame = 1;
};
}
public static function renderGameOverNegAnim(_arg1:Number){
var _local2:int;
var _local3:int;
_local2 = Math.round(animIFloat.method_2(_arg1));
References.daisyDefenderClip.GameOverAnim_mc.gotoAndStop(_local2);
if (References.daisyDefenderClip.GameOverAnim_mc.bug2){
_local3 = Math.round(animIFloatBug2.method_2(_arg1));
References.daisyDefenderClip.GameOverAnim_mc.bug2.gotoAndStop(11);
References.daisyDefenderClip.GameOverAnim_mc.bug2.FlyAnim1_mc.gotoAndStop(_local3);
References.daisyDefenderClip.GameOverAnim_mc.bug2.FlyAnim2_mc.gotoAndStop(_local3);
References.daisyDefenderClip.GameOverAnim_mc.bug2.Bug2Eyes_mc.gotoAndStop(eyes4AnimFrame);
};
}
public static function setGround(_arg1:int){
References.daisyDefenderClip.Ground_mc.gotoAndStop(_arg1);
}
public static function renderLevelSignBugs(){
if (eyes1AnimFrame > 10){
References.daisyDefenderClip.LevelSign_mc.GameOverBug1_mc.b1Eyes_mc.gotoAndStop(eyes1AnimFrame);
References.daisyDefenderClip.LevelSign_mc.GameOverBug2_mc.b1Eyes_mc.gotoAndStop(eyes2AnimFrame);
References.daisyDefenderClip.LevelSign_mc.GameOverBug3_mc.b1Eyes_mc.gotoAndStop(eyes3AnimFrame);
};
}
public static function setupNextLevelAnim(){
nextLevel++;
if (nextLevel > 3){
nextLevel = 3;
};
switch (nextLevel){
case 1:
setupNextLevelAnim1();
break;
case 2:
setupNextLevelAnim2();
break;
case 3:
setupNextLevelAnim3();
break;
};
}
public static function showGame(){
References.gameClip.visible = true;
References.game2Clip.visible = true;
}
public static function renderIntroLevelSign(){
switch (IntroLevelSignLevel){
case 1:
References.daisyDefenderClip.Level1Sign_mc.gotoAndStop(levelSignAnimFrame);
break;
case 2:
References.daisyDefenderClip.Level2Sign_mc.gotoAndStop(levelSignAnimFrame);
break;
case 3:
References.daisyDefenderClip.Level3Sign_mc.gotoAndStop(levelSignAnimFrame);
break;
};
}
public static function updateNextLevelAnim1(){
nextLevelAnimFrame = (nextLevelAnimFrame + 1);
if (nextLevelAnimFrame == 100){
nextLevelAnimFrame = 100;
};
mothAnimCounter = (mothAnimCounter + 1);
if (mothAnimCounter > 4){
mothAnimCounter = 1;
};
eyes4AnimFrame = (eyes4AnimFrame + 1);
if (eyes4AnimFrame > 119){
eyes4AnimFrame = 1;
};
}
public static function updateNextLevelAnim2(){
if (Math.round(nextLevelAnimFrame) == 200){
nextLevelAnimFrame = 200;
};
animIFloat.method_1(nextLevelAnimFrame);
nextLevelAnimFrame = (nextLevelAnimFrame + 1);
if (nextLevelAnimFrame < 142){
mothAnimCounter = (mothAnimCounter + 2);
if (mothAnimCounter > 7){
mothAnimCounter = 1;
animIFloatMoth.setTo(mothAnimCounter);
};
animIFloatMoth.method_1(mothAnimCounter);
};
eyes4AnimFrame = (eyes4AnimFrame + 1);
if (eyes4AnimFrame > 119){
eyes4AnimFrame = 1;
};
}
public static function setWaveSignScore(_arg1:int){
if (References.daisyDefenderClip.WaveSign_mc.InnerWaveSign_mc != null){
};
}
public static function setLevelOnLevelSign(_arg1:int){
var _local2:String;
_local2 = ((new String(TextProperties.LEVEL) + " ") + _arg1);
References.daisyDefenderClip.LevelSign_mc.Level_txt.text = _local2;
}
public static function renderNextLevelAnim1(_arg1:Number){
References.daisyDefenderClip.NextLevelAnim1_mc.gotoAndStop(nextLevelAnimFrame);
References.daisyDefenderClip.NextLevelAnim1_mc.bug3.gotoAndStop(11);
References.daisyDefenderClip.NextLevelAnim1_mc.bug3.FlyAnim1_mc.gotoAndStop(mothAnimCounter);
References.daisyDefenderClip.NextLevelAnim1_mc.bug3.FlyAnim2_mc.gotoAndStop(mothAnimCounter);
References.daisyDefenderClip.NextLevelAnim1_mc.bug3.Bug3Eyes_mc.gotoAndStop(eyes4AnimFrame);
}
public static function renderNextLevelAnim2(_arg1:Number){
var _local2:int;
var _local3:int;
_local2 = Math.round(animIFloat.method_2(_arg1));
References.daisyDefenderClip.NextLevelAnim_mc.gotoAndStop(_local2);
_local3 = Math.round(animIFloatMoth.method_2(_arg1));
References.daisyDefenderClip.NextLevelAnim_mc.moth.gotoAndStop(11);
References.daisyDefenderClip.NextLevelAnim_mc.moth.FlyAnim_mc.gotoAndStop(_local3);
References.daisyDefenderClip.NextLevelAnim_mc.moth.LevelSignMothEyes_mc.gotoAndStop(eyes4AnimFrame);
}
public static function renderNextLevelAnim3(_arg1:Number){
References.daisyDefenderClip.NextLevelAnim3_mc.gotoAndStop(nextLevelAnimFrame);
if ((((nextLevelAnimFrame >= 2)) && ((nextLevelAnimFrame < 120)))){
References.daisyDefenderClip.NextLevelAnim3_mc.caterpillar.gotoAndStop(mothAnimCounter);
References.daisyDefenderClip.NextLevelAnim3_mc.caterpillar.NextLevelCatEyes_mc.gotoAndStop(eyes4AnimFrame);
};
}
public static function updateNextLevelAnim3(){
nextLevelAnimFrame = (nextLevelAnimFrame + 1);
if (nextLevelAnimFrame == 154){
nextLevelAnimFrame = 154;
};
mothAnimCounter = (mothAnimCounter + 1);
if (mothAnimCounter > 29){
mothAnimCounter = 11;
};
eyes4AnimFrame = (eyes4AnimFrame + 1);
if (eyes4AnimFrame > 119){
eyes4AnimFrame = 1;
};
}
public static function updateLevelStartsInText(_arg1:int):Boolean{
var _local2:int;
var _local3:String;
var _local4:String;
_local2 = int((10 - (_arg1 / 25)));
_local3 = String(_local2);
_local4 = new String(TextProperties.LEVEL_STARTS_IN);
_local4 = _local4.split("[0]").join(_local3);
References.daisyDefenderClip.LevelSign_mc.EndsIn_txt.text = _local4;
if (_local2 == 0){
return (true);
};
return (false);
}
public static function updateGround(_arg1:int){
groundAnimFrame++;
switch (_arg1){
case 1:
if (groundAnimFrame > 1){
groundAnimFrame = 1;
};
break;
case 2:
if (groundAnimFrame > 27){
groundAnimFrame = 27;
};
break;
case 3:
if (groundAnimFrame > 53){
groundAnimFrame = 53;
};
break;
};
}
public static function soundOnOffShowOff(){
References.daisyDefenderClip.SoundOnOff_mc.SoundOnOff_txt.text = TextProperties.SOUND_ON;
}
public static function updateEndsInText(_arg1:int):Boolean{
var _local2:int;
var _local3:String;
var _local4:String;
_local2 = int((10 - (_arg1 / 25)));
_local3 = String(_local2);
_local4 = new String(TextProperties.GAME_ENDS_IN);
_local4 = _local4.split("[0]").join(_local3);
References.daisyDefenderClip.LevelSign_mc.EndsIn_txt.text = _local4;
References.daisyDefenderClip.LevelSign_mc.LevelText_txt.text = "";
if (_local2 == 0){
return (true);
};
return (false);
}
public static function updateNextLevelAnim(){
switch (nextLevel){
case 1:
updateNextLevelAnim1();
break;
case 2:
updateNextLevelAnim2();
break;
case 3:
updateNextLevelAnim3();
break;
};
}
public static function renderGround(){
References.daisyDefenderClip.Ground_mc.gotoAndStop(groundAnimFrame);
}
public static function setupGameOverNegAnim(){
gameOverNegAnimFrame = 1;
animIFloat.setTo(gameOverNegAnimFrame);
References.daisyDefenderClip.GameOverAnim_mc.visible = true;
bug2AnimCounter = 1;
eyes4AnimFrame = 70;
}
public static function showExitButton(){
References.endGameButtonClip.visible = true;
}
public static function setScoreOnLevelSign(_arg1:int){
References.daisyDefenderClip.LevelSign_mc.Score_txt.text = _arg1;
}
public static function showFreeGameSignSign(){
References.daisyDefenderClip.FreeGameSign_mc.Sign_mc.FreeGame_txt.text = TextProperties.FREE_GAME;
References.daisyDefenderClip.FreeGameSign_mc.visible = true;
myTween = new Tween(References.daisyDefenderClip.FreeGameSign_mc, "y", Bounce.easeOut, -200, 246, 3, true);
}
public static function hideExitButton(){
References.endGameButtonClip.visible = false;
}
public static function showGameScreen(){
References.gameClip.visible = true;
References.game2Clip.visible = true;
References.gameCollisionClip.visible = true;
References.guiScore.visible = true;
References.guiLevel.visible = true;
References.guiWave.visible = true;
References.daisyDefenderClip.ScoreHeading_txt.visible = true;
References.daisyDefenderClip.LevelHeading_txt.visible = true;
References.daisyDefenderClip.WaveHeading_txt.visible = true;
References.guiSuperSprayClip.visible = true;
References.guiBoostClip.visible = true;
References.debugFPS.visible = true;
References.debugFPS2.visible = true;
References.debugNrObjects.visible = true;
References.debugText1.visible = true;
References.daisyDefenderClip.FpsHeading_txt.visible = true;
References.daisyDefenderClip.LogicHeading_txt.visible = true;
References.daisyDefenderClip.ObjectsHeading_txt.visible = true;
References.daisyDefenderClip.Decoration1_mc.visible = true;
References.daisyDefenderClip.Decoration2_mc.visible = true;
References.daisyDefenderClip.Decoration3_mc.visible = true;
References.daisyDefenderClip.Decoration4_mc.visible = true;
}
public static function hideGameScreen(){
References.gameClip.visible = false;
References.game2Clip.visible = false;
References.gameCollisionClip.visible = false;
References.guiScore.visible = false;
References.guiLevel.visible = false;
References.guiWave.visible = false;
References.daisyDefenderClip.ScoreHeading_txt.visible = false;
References.daisyDefenderClip.LevelHeading_txt.visible = false;
References.daisyDefenderClip.WaveHeading_txt.visible = false;
References.guiSuperSprayClip.visible = false;
References.guiBoostClip.visible = false;
References.debugFPS.visible = false;
References.debugFPS2.visible = false;
References.debugNrObjects.visible = false;
References.debugText1.visible = false;
References.daisyDefenderClip.FpsHeading_txt.visible = false;
References.daisyDefenderClip.LogicHeading_txt.visible = false;
References.daisyDefenderClip.ObjectsHeading_txt.visible = false;
References.daisyDefenderClip.Decoration1_mc.visible = false;
References.daisyDefenderClip.Decoration2_mc.visible = false;
References.daisyDefenderClip.Decoration3_mc.visible = false;
References.daisyDefenderClip.Decoration4_mc.visible = false;
hideLevelIntroSign();
hideFreeGameSignSign();
}
public static function hideNextLevelAnim(){
hideNextLevelAnim1();
hideNextLevelAnim2();
hideNextLevelAnim3();
}
public static function moveLevelSignOffscreen(){
myTween = new Tween(References.daisyDefenderClip.LevelSign_mc, "y", Strong.easeIn, 246, -260, 2, true);
}
public static function setupLevelSignDaisy(){
eyes1AnimFrame = 1;
eyes2AnimFrame = 60;
eyes3AnimFrame = 90;
}
public static function setWaveSignWave(_arg1:int){
var _local2:String;
if ((_arg1 % 3) == 0){
_arg1 = 3;
} else {
_arg1 = (_arg1 % 3);
};
_local2 = ((String(_arg1) + "/") + "3");
if (References.daisyDefenderClip.WaveSign_mc.InnerWaveSign_mc != null){
References.daisyDefenderClip.WaveSign_mc.InnerWaveSign_mc.Wave_txt.text = _local2;
};
}
public static function updateGameOverNegAnim(){
if (Math.round(gameOverNegAnimFrame) == 209){
gameOverNegAnimFrame = 209;
};
animIFloat.method_1(gameOverNegAnimFrame);
gameOverNegAnimFrame = (gameOverNegAnimFrame + 1);
if ((((gameOverNegAnimFrame > 1)) && ((gameOverNegAnimFrame < 123)))){
bug2AnimCounter = (bug2AnimCounter + 2);
if (bug2AnimCounter > 7){
bug2AnimCounter = 1;
animIFloatBug2.setTo(bug2AnimCounter);
};
};
animIFloatBug2.method_1(bug2AnimCounter);
eyes4AnimFrame = (eyes4AnimFrame + 1);
if (eyes4AnimFrame > 119){
eyes4AnimFrame = 1;
};
}
public static function setupWaveSign(){
waveSignAnimFrame = 10;
waveFlyAnimFrame = 1;
}
public static function showLevelSignGameOver(){
References.daisyDefenderClip.LevelSign_mc.gotoAndStop("gameover");
References.daisyDefenderClip.LevelSign_mc.visible = true;
myTween = new Tween(References.daisyDefenderClip.LevelSign_mc, "y", Bounce.easeOut, -200, 246, 3, true);
}
public static function showLevelSign(){
References.daisyDefenderClip.LevelSign_mc.gotoAndStop("nextlevel");
References.daisyDefenderClip.LevelSign_mc.visible = true;
myTween = new Tween(References.daisyDefenderClip.LevelSign_mc, "y", Bounce.easeOut, -200, 246, 3, true);
}
}
}//package com.king.daisy_defender
Section 38
//Shield (com.king.daisy_defender.Shield)
package com.king.daisy_defender {
import flash.display.*;
class Shield extends BaseObject {
protected var tickCounter:int;
public static var SHOW_TIME:int = 250;
function Shield(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Array, _arg5:Function){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
tickCounter = 0;
}
override protected function createClip():void{
clip = new bubble();
clip.width = 87.5;
clip.height = 87.5;
clip.visible = false;
clip.cacheAsBitmap = true;
parentClip.addChild(clip);
}
override public function tick(){
super.tick();
if (tickCounter == SHOW_TIME){
visible = false;
collidable = false;
toBeRemoved = true;
};
tickCounter++;
}
public function extendTime(){
tickCounter = 0;
}
override protected function createCollisionObject():void{
collisionObject = new CollisionObject(0, 0, 80);
}
}
}//package com.king.daisy_defender
Section 39
//ShieldItem (com.king.daisy_defender.ShieldItem)
package com.king.daisy_defender {
import flash.display.*;
class ShieldItem extends SpecialItem {
function ShieldItem(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Array, _arg5:Function){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
tickCounter = 0;
}
override public function collisionReaction(_arg1:BaseObject){
if ((_arg1 is Explosion)){
messageCallback("ShieldItem taken", null);
};
super.collisionReaction(_arg1);
}
override protected function createClip():void{
clip = new mc_shield();
clip.visible = false;
parentClip.addChild(clip);
clip.cacheAsBitmap = true;
}
override protected function createCollisionObject():void{
collisionObject = new CollisionObject(0, 0, 40);
}
}
}//package com.king.daisy_defender
Section 40
//Sight (com.king.daisy_defender.Sight)
package com.king.daisy_defender {
import flash.display.*;
import com.king.daisy_defender.*;
class Sight extends BaseObject {
private var blinkCounter:int;
private var disabled:Boolean;
private var tickCounter:int;
private var state:int;
private var oldPosY:Number;
private var oldPosX:Number;
private var alwaysMax:Boolean;// = false
private var floatAnimFrame:Number;
private var speedFactor:Number;
public static var MAX_EXPLOSION_DIAMETER:int = 90;
private static var STATE_WAIT:int = 0;
public static var MIN_EXPLOSION_DIAMETER:int = 60;
public static var NORMAL_SPEED:Number = 8;
public static var FIRE_RELOAD_DELAY_FRAMES:int = 0;
public static var LOW_SPEED:Number = 4;
public static var EXPAND_FRAMES:int = 48;
public static var SIGHT_MAX_MOVE_WHEN_EXPAND:int = 40;
private static var STATE_EXPAND:int = 1;
public static var MAX_SHOW_X:int = 555;
public static var EXPAND_START_FRAME:int = 2;
public static var EXPAND_TIME_FRAMES:int = 25;
public static var START_EXPLOSION_DIAMETER:int = 30;
public static var MAX_SHOW_Y:int = 485;
public static var NORMAL_SIGHT_FRAME:int = 1;
public static var EXPAND_END_FRAME:int = 50;
function Sight(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Array, _arg5:Function){
alwaysMax = false;
super(_arg1, _arg2, _arg3, _arg4, _arg5);
init();
}
private function showAndHide(){
if ((((((((Input.xMouse >= 0)) && ((Input.xMouse <= MAX_SHOW_X)))) && ((Input.yMouse >= 0)))) && ((Input.yMouse <= MAX_SHOW_Y)))){
visible = true;
} else {
visible = false;
};
}
override protected function createClip():void{
clip = new Targetmarker();
clip.visible = false;
parentClip.addChild(clip);
}
override public function tick(){
var _local1:int;
posX = Input.xMouse;
posY = Input.yMouse;
_local1 = int((((oldPosX - posX) * (oldPosX - posX)) + ((oldPosY - posY) * (oldPosY - posY))));
if ((((((_local1 > (SIGHT_MAX_MOVE_WHEN_EXPAND * SIGHT_MAX_MOVE_WHEN_EXPAND))) && (!(disabled)))) && ((state == STATE_EXPAND)))){
animFrame = NORMAL_SIGHT_FRAME;
floatAnimFrame = NORMAL_SIGHT_FRAME;
oldPosX = posX;
oldPosY = posY;
if (CoreGame.inputSentThisTick == false){
CoreGame.inputSentThisTick = true;
Communicator.sendPlayDataMouse(23, CoreGame.currentTick, Input.xMouse, Input.yMouse);
};
};
if (!(((((((Input.xMouse >= 0)) && ((Input.xMouse <= MAX_SHOW_X)))) && ((Input.yMouse >= 0)))) && ((Input.yMouse <= MAX_SHOW_Y)))){
if (state != STATE_WAIT){
animFrame = NORMAL_SIGHT_FRAME;
floatAnimFrame = NORMAL_SIGHT_FRAME;
state = STATE_WAIT;
if (CoreGame.inputSentThisTick == false){
CoreGame.inputSentThisTick = true;
Communicator.sendPlayDataMouse(24, CoreGame.currentTick, Input.xMouse, Input.yMouse);
};
};
} else {
if ((((state == STATE_WAIT)) && (Input.mouseIsPressed))){
if ((((((((Input.xMouse >= 0)) && ((Input.xMouse <= MAX_SHOW_X)))) && ((Input.yMouse >= 0)))) && ((Input.yMouse <= MAX_SHOW_Y)))){
animFrame = EXPAND_START_FRAME;
state = STATE_EXPAND;
oldPosX = posX;
oldPosY = posY;
};
};
if ((((state == STATE_EXPAND)) && (Input.mouseIsReleased))){
if (disabled){
animFrame = NORMAL_SIGHT_FRAME;
floatAnimFrame = NORMAL_SIGHT_FRAME;
tickCounter = 0;
state = STATE_WAIT;
messageCallback("Click fire", null);
} else {
startExplosion();
};
};
};
switch (state){
case STATE_WAIT:
break;
case STATE_EXPAND:
floatAnimFrame = (floatAnimFrame + ((1 * EXPAND_FRAMES) / (1 * EXPAND_TIME_FRAMES)));
if (floatAnimFrame > (1 * EXPAND_END_FRAME)){
floatAnimFrame = EXPAND_END_FRAME;
};
if (alwaysMax){
floatAnimFrame = 52;
};
animFrame = int(floatAnimFrame);
break;
};
if (animFrame >= EXPAND_END_FRAME){
if (blinkCounter > 8){
blinkCounter = 0;
};
if (blinkCounter > 6){
animFrame++;
};
blinkCounter++;
};
if (collisionObject){
collisionObject.setPos(posX, posY);
};
tickCounter++;
animIFloat.method_1(animFrame);
if (animFrame == 1){
animIFloat.setTo(animFrame);
};
showAndHide();
}
public function init(){
animFrame = NORMAL_SIGHT_FRAME;
tickCounter = 0;
state = STATE_WAIT;
floatAnimFrame = NORMAL_SIGHT_FRAME;
speedFactor = NORMAL_SPEED;
blinkCounter = 0;
disabled = false;
}
public function turnOnAlwaysMax(){
alwaysMax = true;
}
public function turnOffAlwaysMax(){
alwaysMax = false;
}
private function createMarker(_arg1:int){
var _local2:*;
var _local3:*;
_local2 = Math.round((animFrame / 6.25));
if (_local2 == 0){
_local2 = 1;
};
if (alwaysMax){
_local2 = 9;
};
_local3 = new TargetPlaced(References.game2Clip4, posX, posY, newObjects, messageCallback, _arg1, _local2);
newObjects.push(_local3);
}
public function setNormalSpeed(){
speedFactor = NORMAL_SPEED;
}
protected function startExplosion(){
var _local1:int;
var _local2:InfoData;
_local1 = createExplosion();
createMarker(_local1);
_local2 = new InfoData();
_local2.data1 = posX;
_local2.data2 = posY;
_local2.data3 = _local1;
messageCallback("Fire", _local2);
animFrame = NORMAL_SIGHT_FRAME;
floatAnimFrame = NORMAL_SIGHT_FRAME;
tickCounter = 0;
state = STATE_WAIT;
}
public function setLowSpeed(){
speedFactor = LOW_SPEED;
}
public function disable(){
disabled = true;
}
override protected function createCollisionObject():void{
collisionObject = null;
}
private function createExplosion():int{
var _local1:int;
var _local2:Number;
var _local3:int;
var _local4:Number;
var _local5:int;
var _local6:int;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:int;
var _local12:ExplosionLevel;
var _local13:Explosion;
_local1 = (animFrame - NORMAL_SIGHT_FRAME);
_local2 = ((_local1 * 1) / EXPAND_FRAMES);
_local3 = (MAX_EXPLOSION_DIAMETER - MIN_EXPLOSION_DIAMETER);
_local4 = (_local2 * _local3);
_local5 = int((MIN_EXPLOSION_DIAMETER + _local4));
_local6 = Explosion.COLOR_NONE;
if (alwaysMax){
_local5 = 120;
_local6 = Explosion.COLOR_ORANGE;
};
_local7 = (posX - 275);
_local8 = (posY - (480 - 63));
_local9 = XPMath.atan2(_local8, _local7);
_local10 = (_local8 / XPMath.sin(_local9));
_local11 = int((_local10 / speedFactor));
_local12 = new ExplosionLevel(0);
_local13 = new ExplosionS(References.game2Clip2, posX, posY, START_EXPLOSION_DIAMETER, _local5, _local11, _local6, false, _local12, newObjects, messageCallback);
newObjects.push(_local13);
return (_local11);
}
}
}//package com.king.daisy_defender
Section 41
//SoundManager (com.king.daisy_defender.SoundManager)
package com.king.daisy_defender {
import com.king.daisy_defender.*;
import flash.media.*;
class SoundManager {
private static var gasPoof1:Sound = new gas_poof1();
private static var gasPoof2:Sound = new gas_poof2();
private static var gasPoof4:Sound = new gas_poof4();
private static var gameEndNegLoop = new daisy_game_end_neg();
private static var gasPoof5:Sound = new gas_poof5();
private static var gasPoof3:Sound = new gas_poof3();
private static var insectDies1:Sound = new insect_dies1();
private static var insectDies2:Sound = new insect_dies2();
private static var levelCompleteLoop = new daisy_level_complete();
private static var negativeSpecialPower:Sound = new negative_special_power1();
private static var levelCompleteLoopChannel:SoundChannel = null;
private static var introLoop:Sound = new intro_loop();
private static var introLoopChannel:SoundChannel = null;
private static var gameEndPosLoopChannel:SoundChannel = null;
private static var gameLoop:Sound = new game_loop();
private static var newWave:Sound = new new_wave_starts();
private static var levelStart:Sound = new daisy_level_start();
public static var isSoundOn:Boolean = true;
private static var gameEndPosLoop = new daisy_game_end_pos();
private static var waveCompleted:Sound = new wave_completed();
private static var sprayClick:Sound = new empty_spray_click();
private static var positiveSpecialPower:Sound = new positive_special_power1();
private static var gameLoopChannel:SoundChannel = null;
private static var sprayLaunch1:Sound = new spray_launch_confirm();
private static var gameEndNegLoopChannel:SoundChannel = null;
private static var newWaveFly:Sound = new new_wave_starts_fly();
private static var flowerDestroyed:Sound = new flower_destroyed();
public static function stopGameEndPosLoop(){
if (gameEndPosLoopChannel != null){
gameEndPosLoopChannel.stop();
gameEndPosLoopChannel = null;
};
}
public static function playGameLoop(){
if (isSoundOn){
gameLoopChannel = gameLoop.play(0, 9999, new SoundTransform(0.3));
};
}
public static function playLevelStart(){
if (isSoundOn){
levelStart.play();
};
}
public static function playWaveCompleted(){
if (isSoundOn){
waveCompleted.play();
};
}
public static function playGameEndPosLoop(){
if (isSoundOn){
gameEndPosLoopChannel = gameEndPosLoop.play(0, 9999, new SoundTransform(0.3));
};
}
public static function playFlowerDestroyed(){
if (isSoundOn){
flowerDestroyed.play(0, 0, new SoundTransform(0.2));
};
}
public static function stopGameEndNegLoop(){
if (gameEndNegLoopChannel != null){
gameEndNegLoopChannel.stop();
gameEndNegLoopChannel = null;
};
}
public static function playSprayClick(){
if (isSoundOn){
sprayClick.play();
};
}
public static function playGasPoof3(){
if (isSoundOn){
gasPoof3.play();
};
}
public static function stopLevelCompleteLoop(){
if (levelCompleteLoopChannel != null){
levelCompleteLoopChannel.stop();
levelCompleteLoopChannel = null;
};
}
public static function playPositiveSpecialPower(){
if (isSoundOn){
positiveSpecialPower.play();
};
}
public static function playInsectDies2(){
if (isSoundOn){
insectDies2.play();
};
}
public static function playSprayLaunch1(){
if (isSoundOn){
sprayLaunch1.play();
};
}
public static function playLevelCompleteLoop(){
if (isSoundOn){
levelCompleteLoopChannel = levelCompleteLoop.play(0, 9999, new SoundTransform(0.3));
};
}
public static function soundOn(){
isSoundOn = true;
}
public static function playInsectDies1(){
if (isSoundOn){
insectDies1.play();
};
}
public static function stopIntroLoop(){
if (introLoopChannel != null){
introLoopChannel.stop();
introLoopChannel = null;
};
}
public static function playGasPoof1(){
if (isSoundOn){
gasPoof1.play();
};
}
public static function playGasPoof2(){
if (isSoundOn){
gasPoof2.play();
};
}
public static function stopGameLoop(){
if (gameLoopChannel != null){
gameLoopChannel.stop();
gameLoopChannel = null;
};
}
public static function playGasPoof4(){
if (isSoundOn){
gasPoof4.play();
};
}
public static function playIntroLoop(){
if (isSoundOn){
introLoopChannel = introLoop.play(0, 9999, new SoundTransform(0.3));
};
}
public static function playNewWaveFly(){
if (isSoundOn){
newWaveFly.play();
};
}
public static function playGameEndNegLoop(){
if (isSoundOn){
gameEndNegLoopChannel = gameEndNegLoop.play(0, 9999, new SoundTransform(0.3));
};
}
public static function playGasPoof5(){
if (isSoundOn){
gasPoof1.play();
};
}
public static function soundOff(){
stopGameLoop();
stopIntroLoop();
stopGameEndNegLoop();
stopGameEndPosLoop();
stopLevelCompleteLoop();
isSoundOn = false;
}
public static function playNegativeSpecialPower(){
if (isSoundOn){
negativeSpecialPower.play();
};
}
public static function playNewWave(){
if (isSoundOn){
newWave.play();
};
}
public static function playRandomGasPoof(){
var _local1:*;
_local1 = Math.floor(((Math.random() * 5) + 1));
switch (_local1){
case 0:
playGasPoof1();
break;
case 1:
playGasPoof2();
break;
case 2:
playGasPoof3();
break;
case 3:
playGasPoof4();
break;
case 4:
playGasPoof5();
break;
};
}
}
}//package com.king.daisy_defender
Section 42
//SpecialItem (com.king.daisy_defender.SpecialItem)
package com.king.daisy_defender {
import flash.display.*;
class SpecialItem extends BaseObject {
protected var blinkCounter:int;
protected var tickCounter:int;
protected var state:int;
public static var BLINK_TIME:int = 25;
public static var STATE_NORMAL:int = 0;
public static var STATE_BLINK:int = 1;
public static var SHOW_TIME:int = 125;
function SpecialItem(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Array, _arg5:Function){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
clip.cacheAsBitmap = true;
state = STATE_NORMAL;
tickCounter = 0;
}
override public function tick(){
switch (state){
case STATE_NORMAL:
if (tickCounter == SHOW_TIME){
visible = false;
collidable = false;
toBeRemoved = true;
};
break;
case STATE_BLINK:
if (blinkCounter < 5){
visible = false;
} else {
visible = true;
};
if (blinkCounter == 9){
blinkCounter = 0;
};
blinkCounter++;
if (tickCounter == BLINK_TIME){
visible = false;
collidable = false;
toBeRemoved = true;
};
break;
};
tickCounter++;
super.tick();
}
protected function calculateMovement(){
movX = (speed * XPMath.cos(((angle * Math.PI) / 180)));
movY = (speed * XPMath.sin(((angle * Math.PI) / 180)));
}
override public function collisionReaction(_arg1:BaseObject){
if ((_arg1 is Explosion)){
collidable = false;
movX = 0;
movY = 0;
state = STATE_BLINK;
blinkCounter = 0;
tickCounter = 0;
};
}
}
}//package com.king.daisy_defender
Section 43
//SprayShot (com.king.daisy_defender.SprayShot)
package com.king.daisy_defender {
import flash.display.*;
class SprayShot extends BaseObject {
private var showFrames:int;
private var tickCounter:int;
function SprayShot(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:int, _arg7:Array, _arg8:Function){
super(_arg1, _arg2, _arg3, _arg7, _arg8);
this.angle = _arg4;
this.speed = _arg5;
this.showFrames = _arg6;
calculateMovement();
tickCounter = 0;
angleOffset = 90;
}
override protected function createClip():void{
clip = new spray();
clip.visible = false;
clip.cacheAsBitmap = true;
parentClip.addChild(clip);
clip.cacheAsBitmap = true;
}
override public function tick(){
super.tick();
if (tickCounter == showFrames){
visible = false;
collidable = false;
toBeRemoved = true;
};
tickCounter++;
}
private function calculateMovement(){
movX = (speed * XPMath.cos(((angle * Math.PI) / 180)));
movY = (speed * XPMath.sin(((angle * Math.PI) / 180)));
}
}
}//package com.king.daisy_defender
Section 44
//SuperSprayItem (com.king.daisy_defender.SuperSprayItem)
package com.king.daisy_defender {
import flash.display.*;
class SuperSprayItem extends SpecialItem {
function SuperSprayItem(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Array, _arg5:Function){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
tickCounter = 0;
}
override public function collisionReaction(_arg1:BaseObject){
if ((_arg1 is Explosion)){
messageCallback("SuperSprayItem taken", null);
};
super.collisionReaction(_arg1);
}
override protected function createClip():void{
clip = new mc_superspray();
clip.visible = false;
parentClip.addChild(clip);
clip.cacheAsBitmap = true;
}
override protected function createCollisionObject():void{
collisionObject = new CollisionObject(0, 0, 40);
}
}
}//package com.king.daisy_defender
Section 45
//TargetPlaced (com.king.daisy_defender.TargetPlaced)
package com.king.daisy_defender {
import flash.display.*;
class TargetPlaced extends BaseObject {
private var tickCounter:int;
private var showTime:int;
function TargetPlaced(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Array, _arg5:Function, _arg6:int, _arg7:int){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
this.showTime = _arg6;
this.animFrame = _arg7;
tickCounter = 0;
}
override protected function createClip():void{
clip = new targetplaced();
clip.visible = false;
clip.cacheAsBitmap = true;
parentClip.addChild(clip);
clip.cacheAsBitmap = true;
}
override public function tick(){
super.tick();
if (tickCounter == showTime){
visible = false;
collidable = false;
toBeRemoved = true;
};
tickCounter++;
}
}
}//package com.king.daisy_defender
Section 46
//TextProperties (com.king.daisy_defender.TextProperties)
package com.king.daisy_defender {
import flash.display.*;
import com.king.daisy_defender.*;
class TextProperties {
public static var GAME_OVER:String = "GAME
OVER";
public static var BOOST:String = "BOOST";
public static var LEVEL_HEADING:String = "LEVEL_HEADING";
public static var SHIELDS:String = "SHIELDS";
public static var SCORE_HEADING:String = "SCORE_HEADING";
public static var GAME_ENDS_IN:String = "GAME_ENDS_IN";
public static var FEROMONE:String = "FEROMONE";
public static var WAVE_HEADING:String = "WAVE_HEADING";
public static var INSTRUCTIONS:String = "INSTRUCTIONS";
public static var LEVEL_TEXT:String = "LEVEL_TEXT";
public static var SUPER_SPRAY:String = "SUPER_SPRAY";
public static var SPARY_BONUS_HEADING = "SPARY_BONUS_HEADING";
public static var SOUND_ON:String = "SOUND_ON";
public static var REFILL:String = "REFILL";
public static var LEVEL_STARTS_IN:String = "LEVEL_STARTS_IN";
public static var NEGATIVE_ITEMS_HEADING:String = "NEGATIVE_ITEMS_HEADING";
public static var TOTAL_SCORE_HEADING = "TOTAL_SCORE_HEADING";
public static var WAVE_SIGN:String = "WAVE_SIGN";
public static var GAME_STARTS_IN:String = "GAME_STARTS_IN";
public static var INSTRUCTIONS_HEADING:String = "INSTRUCTIONS_HEADING";
public static var SPIDER_WEB:String = "SPIDER_WEB";
public static var LEVEL:String = "LEVEL";
public static var FREE_GAME:String = "FREE
GAME";
public static var DAISY_BONUS_HEADING = "DAISY_BONUS_HEADING";
public static var END_GAME:String = "END_GAME";
public static var LEVEL_SCORE_HEADING:String = "LEVEL_SCORE_HEADING";
public static var POSITIVE_ITEMS_HEADING:String = "POSITIVE_ITEMS_HEADING";
public static var SOUND_OFF:String = "SOUND_OFF";
public static function setTexts(){
var _local1:MovieClip;
_local1 = References.daisyDefenderClip;
_local1.introsign_mc.InstructionsHeading_txt.text = INSTRUCTIONS_HEADING;
_local1.introsign_mc.Instructions_txt.text = INSTRUCTIONS;
_local1.introsign_mc.PositiveHeading_txt.text = POSITIVE_ITEMS_HEADING;
_local1.introsign_mc.SuperSpray_txt.text = SUPER_SPRAY;
_local1.introsign_mc.Refill_txt.text = REFILL;
_local1.introsign_mc.Shields_txt.text = SHIELDS;
_local1.introsign_mc.Boost_txt.text = BOOST;
_local1.introsign_mc.NegativeHeading_txt.text = NEGATIVE_ITEMS_HEADING;
_local1.introsign_mc.Feromone_txt.text = FEROMONE;
_local1.introsign_mc.Web_txt.text = SPIDER_WEB;
_local1.ScoreHeading_txt.text = SCORE_HEADING;
_local1.LevelHeading_txt.text = LEVEL_HEADING;
_local1.WaveHeading_txt.text = WAVE_HEADING;
_local1.EndGame_mc.EndGame_txt.text = END_GAME;
_local1.SoundOnOff_mc.SoundOnOff_txt.text = SOUND_OFF;
_local1.LevelSign_mc.Level_txt.text = LEVEL;
_local1.LevelSign_mc.LevelText_txt.text = LEVEL_TEXT;
_local1.LevelSign_mc.ScoreHeading_txt.text = LEVEL_SCORE_HEADING;
_local1.LevelSign_mc.SprayBonusHeading_txt.text = SPARY_BONUS_HEADING;
_local1.LevelSign_mc.DaisyBonusHeading_txt.text = DAISY_BONUS_HEADING;
_local1.LevelSign_mc.TotalScoreHeading_txt.text = TOTAL_SCORE_HEADING;
}
}
}//package com.king.daisy_defender
Section 47
//Timer (com.king.daisy_defender.Timer)
package com.king.daisy_defender {
import flash.utils.*;
public class Timer {
private var unprocessedTime:Number;// = 0
private var lastTime:Number;// = -1
public var passedTime:Number;// = 0
private var msPerTick:Number;
private var ticksPerSecond:Number;
public var timeScale:Number;// = 1
public var alpha:Number;// = 0
public static var currentTime:Number = 0;
public function Timer(_arg1){
lastTime = -1;
unprocessedTime = 0;
alpha = 0;
timeScale = 1;
passedTime = 0;
super();
this.ticksPerSecond = _arg1;
msPerTick = (1000 / _arg1);
}
public function advanceTime(){
var _local1:*;
var _local2:int;
if (lastTime == -1){
lastTime = getTimer();
};
_local1 = getTimer();
passedTime = (_local1 - lastTime);
passedTime = (passedTime * timeScale);
currentTime = (currentTime + passedTime);
lastTime = _local1;
unprocessedTime = (unprocessedTime + passedTime);
_local2 = int((unprocessedTime / msPerTick));
unprocessedTime = (unprocessedTime - (_local2 * msPerTick));
alpha = (unprocessedTime / msPerTick);
return (_local2);
}
}
}//package com.king.daisy_defender
Section 48
//XPMath (com.king.daisy_defender.XPMath)
package com.king.daisy_defender {
class XPMath {
public static function atan(_arg1:Number):Number{
var _local2:Number;
var _local3:*;
_local2 = 0;
if (_arg1 < -2.41421356237309){
_local3 = (1 / _arg1);
_local2 = (-1.5707963267949 - (_local3 * (1 - ((_local3 * _local3) * ((1 / 3) - ((_local3 * _local3) / 5))))));
} else {
if (_arg1 < -1){
_local3 = ((1 + (_arg1 * 0.414213562373095)) / (0.414213562373095 - _arg1));
_local2 = ((-1.5707963267949 + (_local3 * (1 - ((_local3 * _local3) * ((1 / 3) - ((_local3 * _local3) / 5)))))) + 0.392699081698724);
} else {
if (_arg1 < -0.414213562373095){
_local3 = ((_arg1 + 0.414213562373095) / ((0.414213562373095 * _arg1) - 1));
_local2 = (-((_local3 * (1 - ((_local3 * _local3) * ((1 / 3) - ((_local3 * _local3) / 5)))))) - 0.392699081698724);
} else {
if (_arg1 < 0.414213562373095){
_local2 = (_arg1 * (1 - ((_arg1 * _arg1) * ((1 / 3) - ((_arg1 * _arg1) / 5)))));
} else {
if (_arg1 < 1){
_local3 = ((_arg1 - 0.414213562373095) / (1 + (0.414213562373095 * _arg1)));
_local2 = ((_local3 * (1 - ((_local3 * _local3) * ((1 / 3) - ((_local3 * _local3) / 5))))) + 0.392699081698724);
} else {
if (_arg1 < 2.41421356237309){
_local3 = ((1 - (_arg1 * 0.414213562373095)) / (_arg1 + 0.414213562373095));
_local2 = ((1.5707963267949 - (_local3 * (1 - ((_local3 * _local3) * ((1 / 3) - ((_local3 * _local3) / 5)))))) - 0.392699081698724);
} else {
_local3 = (1 / _arg1);
_local2 = (1.5707963267949 - (_local3 * (1 - ((_local3 * _local3) * ((1 / 3) - ((_local3 * _local3) / 5))))));
};
};
};
};
};
};
return (_local2);
}
public static function atan2(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = 3.14159265358979;
_local4 = 1.5707963267949;
if (_arg2 == 0){
if (_arg1 > 0){
return (_local4);
};
if (_arg1 == 0){
return (0);
};
return (-(_local4));
};
_local6 = (_arg1 / _arg2);
if (Math.abs(_local6) < 1){
_local5 = (_local6 / (1 + ((0.28 * _local6) * _local6)));
if (_arg2 < 0){
if (_arg1 < 0){
return ((_local5 - _local3));
};
return ((_local5 + _local3));
};
} else {
_local5 = (_local4 - (_local6 / ((_local6 * _local6) + 0.28)));
if (_arg1 < 0){
return ((_local5 - _local3));
};
};
return (_local5);
}
static function sin(_arg1:Number){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_arg1 = (_arg1 - 1.5707963267949);
_local2 = 0;
_local3 = ((_arg1 > 0)) ? _arg1 : -(_arg1);
if (_local3 >= (12.5663706143592 + 1.5707963267949)){
_local2 = int((_local3 * 0.636619772367581));
if ((_local2 & 1) != 0){
_local2++;
};
_local3 = (_local3 - (_local2 * 1.5707963267949));
} else {
if (_local3 < 1.5707963267949){
} else {
if (_local3 < (1.5707963267949 + 3.14159265358979)){
_local3 = (_local3 - 3.14159265358979);
_local2 = 2;
} else {
if (_local3 < (6.28318530717959 + 1.5707963267949)){
_local3 = (_local3 - 6.28318530717959);
} else {
if (_local3 < (9.42477796076938 + 1.5707963267949)){
_local3 = (_local3 - 9.42477796076938);
_local2 = 2;
} else {
_local3 = (_local3 - 12.5663706143592);
};
};
};
};
};
_local4 = (_local3 * _local3);
_local5 = (0.999999953027512 + (_local4 * (-0.499999047777921 + (_local4 * (0.041663573160188 + (_local4 * (-0.0013853629536173 + (_local4 * 2.31524166599385E-5))))))));
return ((((_local2 & 2))!=0) ? -(_local5) : _local5);
}
static function cos(_arg1:Number){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local2 = 0;
_local3 = ((_arg1 > 0)) ? _arg1 : -(_arg1);
if (_local3 >= (12.5663706143592 + 1.5707963267949)){
_local2 = int((_local3 * 0.636619772367581));
if ((_local2 & 1) != 0){
_local2++;
};
_local3 = (_local3 - (_local2 * 1.5707963267949));
} else {
if (_local3 < 1.5707963267949){
} else {
if (_local3 < (1.5707963267949 + 3.14159265358979)){
_local3 = (_local3 - 3.14159265358979);
_local2 = 2;
} else {
if (_local3 < (6.28318530717959 + 1.5707963267949)){
_local3 = (_local3 - 6.28318530717959);
} else {
if (_local3 < (9.42477796076938 + 1.5707963267949)){
_local3 = (_local3 - 9.42477796076938);
_local2 = 2;
} else {
_local3 = (_local3 - 12.5663706143592);
};
};
};
};
};
_local4 = (_local3 * _local3);
_local5 = (0.999999953027512 + (_local4 * (-0.499999047777921 + (_local4 * (0.041663573160188 + (_local4 * (-0.0013853629536173 + (_local4 * 2.31524166599385E-5))))))));
return ((((_local2 & 2))!=0) ? -(_local5) : _local5);
}
}
}//package com.king.daisy_defender
Section 49
//bug1_77 (daisydefender_fla.bug1_77)
package daisydefender_fla {
import flash.display.*;
public dynamic class bug1_77 extends MovieClip {
public var b1Eyes_mc:MovieClip;
public function bug1_77(){
addFrameScript(0, frame1, 10, frame11);
}
function frame1(){
stop();
}
function frame11(){
stop();
}
}
}//package daisydefender_fla
Section 50
//bug2_104 (daisydefender_fla.bug2_104)
package daisydefender_fla {
import flash.display.*;
public dynamic class bug2_104 extends MovieClip {
public var Bug2Eyes_mc:MovieClip;
public var FlyAnim1_mc:MovieClip;
public var FlyAnim2_mc:MovieClip;
public function bug2_104(){
addFrameScript(0, frame1, 10, frame11);
}
function frame1(){
stop();
}
function frame11(){
stop();
}
}
}//package daisydefender_fla
Section 51
//bug3_95 (daisydefender_fla.bug3_95)
package daisydefender_fla {
import flash.display.*;
public dynamic class bug3_95 extends MovieClip {
public var Bug3Eyes_mc:MovieClip;
public var FlyAnim1_mc:MovieClip;
public var FlyAnim_mc:MovieClip;
public var FlyAnim2_mc:MovieClip;
public function bug3_95(){
addFrameScript(0, frame1, 10, frame11);
}
function frame1(){
stop();
}
function frame11(){
stop();
}
}
}//package daisydefender_fla
Section 52
//caterpillar_100 (daisydefender_fla.caterpillar_100)
package daisydefender_fla {
import flash.display.*;
public dynamic class caterpillar_100 extends MovieClip {
public var NextLevelCatEyes_mc:MovieClip;
public function caterpillar_100(){
addFrameScript(0, frame1, 28, frame29);
}
function frame1(){
stop();
}
function frame29(){
gotoAndPlay("crawling");
}
}
}//package daisydefender_fla
Section 53
//daisy1eyes_64 (daisydefender_fla.daisy1eyes_64)
package daisydefender_fla {
import flash.display.*;
public dynamic class daisy1eyes_64 extends MovieClip {
public function daisy1eyes_64(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package daisydefender_fla
Section 54
//daisy2eyes_76 (daisydefender_fla.daisy2eyes_76)
package daisydefender_fla {
import flash.display.*;
public dynamic class daisy2eyes_76 extends MovieClip {
public function daisy2eyes_76(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package daisydefender_fla
Section 55
//daisy3eyes_73 (daisydefender_fla.daisy3eyes_73)
package daisydefender_fla {
import flash.display.*;
public dynamic class daisy3eyes_73 extends MovieClip {
public function daisy3eyes_73(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package daisydefender_fla
Section 56
//EndGame_112 (daisydefender_fla.EndGame_112)
package daisydefender_fla {
import flash.display.*;
import flash.text.*;
public dynamic class EndGame_112 extends MovieClip {
public var EndGame_txt:TextField;
}
}//package daisydefender_fla
Section 57
//fly_51 (daisydefender_fla.fly_51)
package daisydefender_fla {
import flash.display.*;
public dynamic class fly_51 extends MovieClip {
public var wings_mc:MovieClip;
public function fly_51(){
addFrameScript(0, frame1, 10, frame11);
}
function frame1(){
stop();
}
function frame11(){
stop();
}
}
}//package daisydefender_fla
Section 58
//freesignbgr_110 (daisydefender_fla.freesignbgr_110)
package daisydefender_fla {
import flash.display.*;
import flash.text.*;
public dynamic class freesignbgr_110 extends MovieClip {
public var FreeGame_txt:TextField;
}
}//package daisydefender_fla
Section 59
//Game_12 (daisydefender_fla.Game_12)
package daisydefender_fla {
import flash.display.*;
public dynamic class Game_12 extends MovieClip {
public var InnerGame_mc:MovieClip;
}
}//package daisydefender_fla
Section 60
//GameDebug_14 (daisydefender_fla.GameDebug_14)
package daisydefender_fla {
import flash.display.*;
public dynamic class GameDebug_14 extends MovieClip {
public var InnerGameDebug_mc:InnerGameDebug;
}
}//package daisydefender_fla
Section 61
//logotext_46 (daisydefender_fla.logotext_46)
package daisydefender_fla {
import flash.display.*;
public dynamic class logotext_46 extends MovieClip {
public var logopetal:MovieClip;
}
}//package daisydefender_fla
Section 62
//mc_freesign_108 (daisydefender_fla.mc_freesign_108)
package daisydefender_fla {
import flash.display.*;
public dynamic class mc_freesign_108 extends MovieClip {
public var Sign_mc:MovieClip;
}
}//package daisydefender_fla
Section 63
//mc_gameover_103 (daisydefender_fla.mc_gameover_103)
package daisydefender_fla {
import flash.display.*;
public dynamic class mc_gameover_103 extends MovieClip {
public var bug2:MovieClip;
public function mc_gameover_103(){
addFrameScript(0, frame1, 138, frame139);
}
function frame1(){
bug2.gotoAndPlay("flying");
}
function frame139(){
bug2.gotoAndStop("stop");
stop();
}
}
}//package daisydefender_fla
Section 64
//mc_ground_6 (daisydefender_fla.mc_ground_6)
package daisydefender_fla {
import flash.display.*;
public dynamic class mc_ground_6 extends MovieClip {
public function mc_ground_6(){
addFrameScript(0, frame1, 1, frame2, 26, frame27, 27, frame28, 52, frame53);
}
function frame1(){
stop();
}
function frame2(){
play();
}
function frame27(){
stop();
}
function frame28(){
play();
}
function frame53(){
stop();
}
}
}//package daisydefender_fla
Section 65
//mc_introsign_114 (daisydefender_fla.mc_introsign_114)
package daisydefender_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_introsign_114 extends MovieClip {
public var Refill_txt:TextField;
public var NegativeHeading_txt:TextField;
public var GameStartsIn_txt:TextField;
public var Feromone_txt:TextField;
public var introDaisy1_mc:daisy2;
public var bug12:BitmapBug1;
public var moth:BitmapMoth;
public var insecticide:mc_insecticide;
public var introDaisy2_mc:daisy3;
public var InstructionsHeading_txt:TextField;
public var fly:BitmapFly;
public var Shields_txt:TextField;
public var bug11:BitmapBug1;
public var SuperSpray_txt:TextField;
public var Boost_txt:TextField;
public var PositiveHeading_txt:TextField;
public var Web_txt:TextField;
public var Instructions_txt:TextField;
public function mc_introsign_114(){
addFrameScript(0, frame1, 33, frame34, 40, frame41, 95, frame96, 112, frame113);
}
function frame1(){
}
function frame96(){
}
function frame34(){
}
function frame41(){
}
function frame113(){
}
}
}//package daisydefender_fla
Section 66
//mc_levelsign_56 (daisydefender_fla.mc_levelsign_56)
package daisydefender_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_levelsign_56 extends MovieClip {
public var TotalScoreHeading_txt:TextField;
public var DaisyBonusHeading_txt:TextField;
public var Score_txt:TextField;
public var Level_txt:TextField;
public var LevelSignDaisy1_mc:daisy1;
public var GameOverBug2_mc:MovieClip;
public var LevelSignDaisy2_mc:daisy3;
public var EndsIn_txt:TextField;
public var TotalScore_txt:TextField;
public var DaisyBonus_txt:TextField;
public var GameOverBug3_mc:MovieClip;
public var ShotsBonus_txt:TextField;
public var SprayBonusHeading_txt:TextField;
public var LevelSignDaisy3_mc:daisy2;
public var ScoreHeading_txt:TextField;
public var LevelText_txt:TextField;
public var GameOverBug1_mc:MovieClip;
public function mc_levelsign_56(){
addFrameScript(0, frame1, 10, frame11);
}
function frame1(){
stop();
}
function frame11(){
stop();
}
}
}//package daisydefender_fla
Section 67
//mc_nextlevel1_94 (daisydefender_fla.mc_nextlevel1_94)
package daisydefender_fla {
import flash.display.*;
public dynamic class mc_nextlevel1_94 extends MovieClip {
public var bug3:MovieClip;
public function mc_nextlevel1_94(){
addFrameScript(0, frame1, 1, frame2, 119, frame120);
}
function frame1(){
}
function frame2(){
bug3.gotoAndPlay("flying");
}
function frame120(){
stop();
}
}
}//package daisydefender_fla
Section 68
//mc_nextlevel3_99 (daisydefender_fla.mc_nextlevel3_99)
package daisydefender_fla {
import flash.display.*;
public dynamic class mc_nextlevel3_99 extends MovieClip {
public var caterpillar:MovieClip;
public function mc_nextlevel3_99(){
addFrameScript(0, frame1, 1, frame2, 169, frame170);
}
function frame170(){
stop();
}
function frame1(){
}
function frame2(){
caterpillar.gotoAndPlay("crawling");
}
}
}//package daisydefender_fla
Section 69
//mc_nextlevelM_83 (daisydefender_fla.mc_nextlevelM_83)
package daisydefender_fla {
import flash.display.*;
public dynamic class mc_nextlevelM_83 extends MovieClip {
public var moth:MovieClip;
public function mc_nextlevelM_83(){
addFrameScript(0, frame1, 1, frame2, 142, frame143, 199, frame200);
}
function frame143(){
}
function frame200(){
stop();
}
function frame1(){
}
function frame2(){
moth.gotoAndPlay("flying");
}
}
}//package daisydefender_fla
Section 70
//mc_wavesign_42 (daisydefender_fla.mc_wavesign_42)
package daisydefender_fla {
import flash.display.*;
public dynamic class mc_wavesign_42 extends MovieClip {
public var InnerWaveSign_mc:MovieClip;
public var fly:MovieClip;
public function mc_wavesign_42(){
addFrameScript(0, frame1, 9, frame10, 102, frame103, 127, frame128);
}
function frame10(){
fly.gotoAndPlay("flying");
}
function frame1(){
stop();
}
function frame103(){
fly.gotoAndPlay("flying");
}
function frame128(){
stop();
}
}
}//package daisydefender_fla
Section 71
//moth_84 (daisydefender_fla.moth_84)
package daisydefender_fla {
import flash.display.*;
public dynamic class moth_84 extends MovieClip {
public var LevelSignMothEyes_mc:MovieClip;
public var FlyAnim_mc:MovieClip;
public function moth_84(){
addFrameScript(0, frame1, 10, frame11);
}
function frame1(){
stop();
}
function frame11(){
stop();
}
}
}//package daisydefender_fla
Section 72
//SoundOn_113 (daisydefender_fla.SoundOn_113)
package daisydefender_fla {
import flash.display.*;
import flash.text.*;
public dynamic class SoundOn_113 extends MovieClip {
public var SoundOnOff_txt:TextField;
}
}//package daisydefender_fla
Section 73
//wavesign_55 (daisydefender_fla.wavesign_55)
package daisydefender_fla {
import flash.display.*;
import flash.text.*;
public dynamic class wavesign_55 extends MovieClip {
public var NextWave_txt:TextField;
public var Wave_txt:TextField;
}
}//package daisydefender_fla
Section 74
//Bounce (fl.transitions.easing.Bounce)
package fl.transitions.easing {
public class Bounce {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 - easeOut((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeIn((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOut(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
}
}//package fl.transitions.easing
Section 75
//Strong (fl.transitions.easing.Strong)
package fl.transitions.easing {
public class Strong {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package fl.transitions.easing
Section 76
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
public var begin:Number;// = NAN
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var change:Number;// = NAN
private var _finish:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
isPlaying = false;
obj = null;
prop = "";
func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
begin = NaN;
change = NaN;
useSeconds = false;
prevTime = NaN;
prevPos = NaN;
looping = false;
_duration = NaN;
_time = NaN;
_fps = NaN;
_position = NaN;
_startTime = NaN;
_intervalID = 0;
_finish = NaN;
_timer = null;
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean;
_local2 = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 77
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var time:Number;// = NAN
public var position:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
time = NaN;
position = NaN;
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 78
//BitmapBug1 (BitmapBug1)
package {
import flash.display.*;
public dynamic class BitmapBug1 extends MovieClip {
}
}//package
Section 79
//BitmapBug2 (BitmapBug2)
package {
import flash.display.*;
public dynamic class BitmapBug2 extends MovieClip {
}
}//package
Section 80
//BitmapBug3 (BitmapBug3)
package {
import flash.display.*;
public dynamic class BitmapBug3 extends MovieClip {
}
}//package
Section 81
//BitmapCaterpillar (BitmapCaterpillar)
package {
import flash.display.*;
public dynamic class BitmapCaterpillar extends MovieClip {
}
}//package
Section 82
//BitmapExplosion (BitmapExplosion)
package {
import flash.display.*;
public dynamic class BitmapExplosion extends MovieClip {
}
}//package
Section 83
//BitmapExplosionSpecial (BitmapExplosionSpecial)
package {
import flash.display.*;
public dynamic class BitmapExplosionSpecial extends MovieClip {
}
}//package
Section 84
//BitmapFly (BitmapFly)
package {
import flash.display.*;
public dynamic class BitmapFly extends MovieClip {
}
}//package
Section 85
//BitmapMoth (BitmapMoth)
package {
import flash.display.*;
public dynamic class BitmapMoth extends MovieClip {
}
}//package
Section 86
//bubble (bubble)
package {
import flash.display.*;
public dynamic class bubble extends MovieClip {
}
}//package
Section 87
//Circle (Circle)
package {
import flash.display.*;
public dynamic class Circle extends MovieClip {
}
}//package
Section 88
//daisy_game_end_neg (daisy_game_end_neg)
package {
import flash.media.*;
public dynamic class daisy_game_end_neg extends Sound {
}
}//package
Section 89
//daisy_game_end_pos (daisy_game_end_pos)
package {
import flash.media.*;
public dynamic class daisy_game_end_pos extends Sound {
}
}//package
Section 90
//daisy_level_complete (daisy_level_complete)
package {
import flash.media.*;
public dynamic class daisy_level_complete extends Sound {
}
}//package
Section 91
//daisy_level_start (daisy_level_start)
package {
import flash.media.*;
public dynamic class daisy_level_start extends Sound {
}
}//package
Section 92
//daisy1 (daisy1)
package {
import flash.display.*;
public dynamic class daisy1 extends MovieClip {
public var Eyes_mc:MovieClip;
public function daisy1(){
addFrameScript(0, frame1, 9, frame10, 29, frame30);
}
function frame10(){
play();
}
function frame1(){
stop();
}
function frame30(){
stop();
}
}
}//package
Section 93
//daisy2 (daisy2)
package {
import flash.display.*;
public dynamic class daisy2 extends MovieClip {
public var Eyes_mc:MovieClip;
public function daisy2(){
addFrameScript(0, frame1, 9, frame10, 29, frame30);
}
function frame10(){
play();
}
function frame1(){
stop();
}
function frame30(){
stop();
}
}
}//package
Section 94
//daisy3 (daisy3)
package {
import flash.display.*;
public dynamic class daisy3 extends MovieClip {
public var Eyes_mc:MovieClip;
public function daisy3(){
addFrameScript(0, frame1, 9, frame10, 29, frame30);
}
function frame10(){
play();
}
function frame1(){
stop();
}
function frame30(){
stop();
}
}
}//package
Section 95
//empty_spray_click (empty_spray_click)
package {
import flash.media.*;
public dynamic class empty_spray_click extends Sound {
}
}//package
Section 96
//Feromone1 (Feromone1)
package {
import flash.display.*;
public dynamic class Feromone1 extends MovieClip {
}
}//package
Section 97
//Feromone2 (Feromone2)
package {
import flash.display.*;
public dynamic class Feromone2 extends MovieClip {
}
}//package
Section 98
//Feromone3 (Feromone3)
package {
import flash.display.*;
public dynamic class Feromone3 extends MovieClip {
}
}//package
Section 99
//Feromone4 (Feromone4)
package {
import flash.display.*;
public dynamic class Feromone4 extends MovieClip {
}
}//package
Section 100
//Feromone5 (Feromone5)
package {
import flash.display.*;
public dynamic class Feromone5 extends MovieClip {
}
}//package
Section 101
//Feromone6 (Feromone6)
package {
import flash.display.*;
public dynamic class Feromone6 extends MovieClip {
}
}//package
Section 102
//flower_destroyed (flower_destroyed)
package {
import flash.media.*;
public dynamic class flower_destroyed extends Sound {
}
}//package
Section 103
//game_loop (game_loop)
package {
import flash.media.*;
public dynamic class game_loop extends Sound {
}
}//package
Section 104
//gas_poof1 (gas_poof1)
package {
import flash.media.*;
public dynamic class gas_poof1 extends Sound {
}
}//package
Section 105
//gas_poof2 (gas_poof2)
package {
import flash.media.*;
public dynamic class gas_poof2 extends Sound {
}
}//package
Section 106
//gas_poof3 (gas_poof3)
package {
import flash.media.*;
public dynamic class gas_poof3 extends Sound {
}
}//package
Section 107
//gas_poof4 (gas_poof4)
package {
import flash.media.*;
public dynamic class gas_poof4 extends Sound {
}
}//package
Section 108
//gas_poof5 (gas_poof5)
package {
import flash.media.*;
public dynamic class gas_poof5 extends Sound {
}
}//package
Section 109
//InnerGameDebug (InnerGameDebug)
package {
import flash.display.*;
public dynamic class InnerGameDebug extends MovieClip {
}
}//package
Section 110
//insect_dies1 (insect_dies1)
package {
import flash.media.*;
public dynamic class insect_dies1 extends Sound {
}
}//package
Section 111
//insect_dies2 (insect_dies2)
package {
import flash.media.*;
public dynamic class insect_dies2 extends Sound {
}
}//package
Section 112
//intro_loop (intro_loop)
package {
import flash.media.*;
public dynamic class intro_loop extends Sound {
}
}//package
Section 113
//mc_boost (mc_boost)
package {
import flash.display.*;
public dynamic class mc_boost extends MovieClip {
}
}//package
Section 114
//mc_feromone (mc_feromone)
package {
import flash.display.*;
public dynamic class mc_feromone extends MovieClip {
}
}//package
Section 115
//mc_gum (mc_gum)
package {
import flash.display.*;
public dynamic class mc_gum extends MovieClip {
}
}//package
Section 116
//mc_gumCollected (mc_gumCollected)
package {
import flash.display.*;
public dynamic class mc_gumCollected extends MovieClip {
}
}//package
Section 117
//mc_insecticide (mc_insecticide)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mc_insecticide extends MovieClip {
public var Cannon_txt:TextField;
public function mc_insecticide(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 118
//mc_refill (mc_refill)
package {
import flash.display.*;
public dynamic class mc_refill extends MovieClip {
}
}//package
Section 119
//mc_shield (mc_shield)
package {
import flash.display.*;
public dynamic class mc_shield extends MovieClip {
}
}//package
Section 120
//mc_shieldCollected2 (mc_shieldCollected2)
package {
import flash.display.*;
public dynamic class mc_shieldCollected2 extends MovieClip {
}
}//package
Section 121
//mc_superspray (mc_superspray)
package {
import flash.display.*;
public dynamic class mc_superspray extends MovieClip {
}
}//package
Section 122
//negative_special_power1 (negative_special_power1)
package {
import flash.media.*;
public dynamic class negative_special_power1 extends Sound {
}
}//package
Section 123
//new_wave_starts (new_wave_starts)
package {
import flash.media.*;
public dynamic class new_wave_starts extends Sound {
}
}//package
Section 124
//new_wave_starts_fly (new_wave_starts_fly)
package {
import flash.media.*;
public dynamic class new_wave_starts_fly extends Sound {
}
}//package
Section 125
//positive_special_power1 (positive_special_power1)
package {
import flash.media.*;
public dynamic class positive_special_power1 extends Sound {
}
}//package
Section 126
//scorepop (scorepop)
package {
import flash.display.*;
import flash.text.*;
public dynamic class scorepop extends MovieClip {
public var Score_txt:TextField;
}
}//package
Section 127
//scorepopboost (scorepopboost)
package {
import flash.display.*;
import flash.text.*;
public dynamic class scorepopboost extends MovieClip {
public var Score_txt:TextField;
}
}//package
Section 128
//spray (spray)
package {
import flash.display.*;
public dynamic class spray extends MovieClip {
}
}//package
Section 129
//spray_launch_confirm (spray_launch_confirm)
package {
import flash.media.*;
public dynamic class spray_launch_confirm extends Sound {
}
}//package
Section 130
//spraykit (spraykit)
package {
import flash.display.*;
public dynamic class spraykit extends MovieClip {
}
}//package
Section 131
//Targetmarker (Targetmarker)
package {
import flash.display.*;
public dynamic class Targetmarker extends MovieClip {
public function Targetmarker(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 132
//targetplaced (targetplaced)
package {
import flash.display.*;
public dynamic class targetplaced extends MovieClip {
}
}//package
Section 133
//wave_completed (wave_completed)
package {
import flash.media.*;
public dynamic class wave_completed extends Sound {
}
}//package