Section 1
//game_background_18 (Commander_fla.game_background_18)
package Commander_fla {
import flash.display.*;
public dynamic class game_background_18 extends MovieClip {
public var chopper:MovieClip;
public var plane_shadow:script_plane;
public var unit_move:MovieClip;
public var ArtillerySpotter:MovieClip;
public var unit_selected:MovieClip;
}
}//package Commander_fla
Section 2
//interface_32 (Commander_fla.interface_32)
package Commander_fla {
import flash.display.*;
import flash.text.*;
public dynamic class interface_32 extends MovieClip {
public var text_score:TextField;
public var main_menu:MovieClip;
public var mute:MovieClip;
public var infantry_menu:MovieClip;
public var text_swpoints:TextField;
public var air_menu:MovieClip;
public var text_tapoints:TextField;
public var text_lives:TextField;
public var pausebutton:MovieClip;
public var text_stats2:TextField;
public var text_stats6:TextField;
public var text_stats3:TextField;
public var text_stats4:TextField;
public var text_stats5:TextField;
public var artillery_menu:MovieClip;
public var text_stats1:TextField;
public var text_enemywave:TextField;
public var text_level:TextField;
}
}//package Commander_fla
Section 3
//MainTimeline (Commander_fla.MainTimeline)
package Commander_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.media.*;
import flash.utils.*;
import flash.geom.*;
import flash.system.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var Ally_MapStart1;
public var Ally_MapStart2;
public var Enemies:Array;
public var OffsetY:int;
public var play_demo:MovieClip;
public var MapEnd1;
public var MapEnd2;
public var buy_air:MovieClip;
public var CurrentSong:int;
public var SendingHeavyArtillery:Boolean;
public var ShowAirSupport:Boolean;
public var TheMouseEvent:MouseEvent;
public var end_score:TextField;
public var GunSmoke:Array;
public var Bomber_sound:bomber;
public var Path:Array;
public var FPSDelay:int;
public var Intro:intro2;
public var LastFPS:int;
public var CarpetBombLast:int;
public var SWPoints:int;
public var AllySoldiers:Array;
public var MapStart1;
public var HeavyArtilleryPoint:Point;
public var MapStart2;
public var SelectedAlly:int;
public var PausedTimer2:int;
public var HeavyArtilleryDelay:int;
public var LightArtilleryPoint:Point;
public var leveldelay:int;
public var ChopperShotsLast:int;
public var LastOffsetY:int;
public var Path2:Array;
public var gamemode:String;
public var trans2:SoundTransform;
public var trans3:SoundTransform;
public var Background2:background2;
public var IsSpaceDown:Boolean;
public var PausedTimer1:int;
public var trans:SoundTransform;
public var ShowArtillery:Boolean;
public var LightArtilleryDelay:int;
public var BaseHealth:int;
public var lastlevel:int;
public var SendingLightArtillery:Boolean;
public var Ally_Path1;
public var Ally_Path2;
public var buy_infantry:MovieClip;
public var LastEnemyType:int;
public var buy_artillery:MovieClip;
public var LastWave:int;
public var LastTAPointUpdate:int;
public var Lives:int;
public var CarpetBombCount:int;
public var Clouds:Array;
public var SendingCarpetBomb:Boolean;
public var fps:Number;
public var PurchaseDelay:int;
public var SendingChopperShots:Boolean;
public var Chopper_sound:chopper;
public var channel:SoundChannel;
public var EnemyBullets:Array;
public var LightArtillery_sound:lightartillery;
public var HeavyArtillery_sound:heavyartillery;
public var Map:Array;
public var SendingPlane:Boolean;
public var Explosion_sound:explosion;
public var Background:background1;
public var Muted:Boolean;
public var CarpetBombDelay:int;
public var ButtonClick:buttonclick;
public var CarpetBombPoint:Point;
public var ChopperShotsCount:int;
public var level:int;
public var channel1:SoundChannel;
public var channel2:SoundChannel;
public var Bullets:Array;
public var game_background:MovieClip;
public var gamepaused:MovieClip;
public var GameScore:int;
public var TAPoints:int;
public var SendingChopper:Boolean;
public var stamp:Number;
public var sponsorlogo:MovieClip;
public var IncomingArtillery_sound:incomingartillery;
public var LastPurchase:int;
public var playmoregames:MovieClip;
public var Blood:Array;
public var TAPointUpdateSpeed:int;
public var ChopperShotsDelay:int;
public var play_demo1:MovieClip;
public var theinterface:MovieClip;
public var HeavyLastArtillery:int;
public var ChopperShotsPoint:Point;
public var HeavyArtilleryCount:int;
public var WaveDelay:int;
public var Ally_MapEnd1;
public var Ally_MapEnd2;
public var LightLastArtillery:int;
public var LightArtilleryCount:int;
public function MainTimeline(){
addFrameScript(0, frame1, 2, frame3, 19, frame20, 49, frame50, 59, frame60);
}
public function CheckEnemyHealth():void{
var i:int;
var pb:PointBurst;
var a:int;
if (gamemode != "paused"){
try {
i = (Enemies.length - 1);
while (i >= 0) {
if (Enemies[i].pHealth <= 0){
pb = new PointBurst(game_background, "+2 TA Points!", Enemies[i].x, (Enemies[i].y - 20));
Enemies[i].x = -500;
Enemies[i].y = -500;
GameScore = ((GameScore + 2) + level);
TAPoints = (TAPoints + 2);
game_background.removeChild(Enemies[i]);
Enemies.splice(i, 1);
theinterface.text_tapoints.text = String(TAPoints);
theinterface.text_score.text = String(GameScore);
a = (AllySoldiers.length - 1);
while (a >= 0) {
if (AllySoldiers[a].pTarget == i){
AllySoldiers[a].pTarget = -1;
};
if (AllySoldiers[a].pTarget > i){
AllySoldiers[a].pTarget = (AllySoldiers[a].pTarget - 1);
};
a = (a - 1);
};
};
i = (i - 1);
};
} catch(e:TypeError) {
};
};
}
public function SendHeavyArtillery():void{
var _local1:script_artillery_explosion;
var _local2:int;
var _local3:int;
if (gamemode != "paused"){
if ((((HeavyArtilleryCount < 20)) && ((SendingHeavyArtillery == true)))){
if (getTimer() > (HeavyLastArtillery + HeavyArtilleryDelay)){
if (HeavyArtilleryCount == 0){
if (Muted == false){
IncomingArtillery_sound.play();
};
if (Muted == false){
HeavyArtillery_sound.play();
};
};
_local1 = new script_artillery_explosion();
_local1.x = (HeavyArtilleryPoint.x + ((Math.random() * 150) - (Math.random() * 150)));
_local1.y = (HeavyArtilleryPoint.y + ((Math.random() * 150) - (Math.random() * 150)));
game_background.addChild(_local1);
HeavyArtilleryCount = (HeavyArtilleryCount + 1);
HeavyLastArtillery = getTimer();
_local2 = (Enemies.length - 1);
while (_local2 >= 0) {
if (Enemies[_local2].hitTestObject(_local1)){
Enemies[_local2].GotHit(_local1.pDamage, _local1.pBulletType);
};
_local2--;
};
_local3 = (AllySoldiers.length - 1);
while (_local3 >= 0) {
if (AllySoldiers[_local3].hitTestObject(_local1)){
AllySoldiers[_local3].GotHit(_local1.pDamage, _local1.pBulletType);
};
_local3--;
};
if (HeavyArtilleryCount == 20){
SendingHeavyArtillery = false;
HeavyArtilleryCount = 0;
game_background.x = 0;
};
};
};
};
}
public function buy_air_close_menu_mouse_up(_arg1:MouseEvent):void{
buy_air.x = -1000;
ShowAirSupport = false;
ShowArtillery = false;
if (Muted == false){
ButtonClick.play();
};
}
public function pausebutton_mouse_up(_arg1:MouseEvent):void{
var _local2:Number;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
if (gamemode != "paused"){
gamemode = "paused";
gamepaused.x = 0;
if ((Muted = false)){
ButtonClick.play();
};
PausedTimer1 = getTimer();
_local3 = (Enemies.length - 1);
while (_local3 >= 0) {
Enemies[_local3].pPaused = true;
_local3--;
};
_local4 = (AllySoldiers.length - 1);
while (_local4 >= 0) {
AllySoldiers[_local4].pPaused = true;
_local4--;
};
} else {
gamemode = "none";
gamepaused.x = 1000;
PausedTimer2 = getTimer();
_local2 = (PausedTimer2 - PausedTimer1);
LastWave = (LastWave + _local2);
lastlevel = (lastlevel + _local2);
LastTAPointUpdate = (LastTAPointUpdate + _local2);
LightLastArtillery = (LightLastArtillery + _local2);
HeavyLastArtillery = (HeavyLastArtillery + _local2);
CarpetBombLast = (CarpetBombLast + _local2);
ChopperShotsLast = (ChopperShotsLast + _local2);
LastPurchase = (LastPurchase + _local2);
_local5 = (Enemies.length - 1);
while (_local5 >= 0) {
Enemies[_local5].pPaused = false;
_local5--;
};
_local6 = (AllySoldiers.length - 1);
while (_local6 >= 0) {
AllySoldiers[_local6].pPaused = false;
_local6--;
};
};
}
public function CheckAlliesForHit():void{
var i:int;
var k:int;
var c:*;
var sheep_explosion:script_sheepexplosion;
var grenacorn_explosion:script_grenacorn_explosion;
var blood1:script_blood;
if (gamemode != "paused"){
if (EnemyBullets.length == 0){
return;
};
try {
i = (AllySoldiers.length - 1);
while (i >= 0) {
k = (EnemyBullets.length - 1);
while (k >= 0) {
if (AllySoldiers[i].hitTestObject(EnemyBullets[k])){
if (EnemyBullets[k].pBulletType == 3){
sheep_explosion = new script_sheepexplosion();
sheep_explosion.x = AllySoldiers[i].x;
sheep_explosion.y = AllySoldiers[i].y;
game_background.addChild(sheep_explosion);
};
if (EnemyBullets[k].pBulletType == 1){
grenacorn_explosion = new script_grenacorn_explosion();
grenacorn_explosion.x = AllySoldiers[i].x;
grenacorn_explosion.y = AllySoldiers[i].y;
game_background.addChild(grenacorn_explosion);
};
AllySoldiers[i].GotHit(EnemyBullets[k].pDamage, EnemyBullets[k].pBulletType);
EnemyBullets[k].x = -100;
EnemyBullets[k].y = -100;
if (EnemyBullets[k].pVisible == true){
game_background.removeChild(EnemyBullets[k].pBullet);
};
EnemyBullets.splice(k, 1);
c = 0;
while (c < 1) {
blood1 = new script_blood();
blood1.x = ((AllySoldiers[i].x - 8) + (Math.random() * 16));
blood1.y = ((AllySoldiers[i].y - 8) + (Math.random() * 16));
game_background.addChild(blood1);
Blood.push(blood1);
c = (c + 1);
};
};
k = (k - 1);
};
i = (i - 1);
};
} catch(e:TypeError) {
};
};
}
function frame3(){
stop();
addEventListener(Event.ENTER_FRAME, everytimesponsor);
sponsorlogo.addEventListener(MouseEvent.MOUSE_UP, sponsor);
}
public function SendChopperShots():void{
var _local1:script_chopper_shot;
var _local2:int;
var _local3:int;
if (gamemode != "paused"){
if ((((ChopperShotsCount < 60)) && ((SendingChopperShots == true)))){
if (getTimer() > (ChopperShotsLast + ChopperShotsDelay)){
if (ChopperShotsCount == 0){
if (Muted == false){
Chopper_sound.play();
};
};
_local1 = new script_chopper_shot();
_local1.x = (ChopperShotsPoint.x + ((Math.random() * 50) - (Math.random() * 50)));
_local1.y = (ChopperShotsPoint.y + ((Math.random() * 50) - (Math.random() * 50)));
game_background.addChild(_local1);
ChopperShotsCount = (ChopperShotsCount + 1);
ChopperShotsLast = getTimer();
_local2 = (Enemies.length - 1);
while (_local2 >= 0) {
if (Enemies[_local2].hitTestObject(_local1)){
Enemies[_local2].GotHit(_local1.pDamage, _local1.pBulletType);
};
_local2--;
};
_local3 = (AllySoldiers.length - 1);
while (_local3 >= 0) {
if (AllySoldiers[_local3].hitTestObject(_local1)){
AllySoldiers[_local3].GotHit(_local1.pDamage, _local1.pBulletType);
};
_local3--;
};
ChopperShotsPoint.x = (game_background.chopper.x - 300);
if (ChopperShotsCount == 60){
SendingChopperShots = false;
ChopperShotsCount = 0;
game_background.x = 0;
};
};
};
};
}
public function buy_infantry_sniper_mouse_up(_arg1:MouseEvent):void{
var _local2:script_infantry_sniper;
var _local3:PointBurst;
if (gamemode != "paused"){
if (getTimer() > (LastPurchase + PurchaseDelay)){
if (TAPoints >= 25){
TAPoints = (TAPoints - 25);
theinterface.text_tapoints.text = String(TAPoints);
_local2 = new script_infantry_sniper(1, 2430, "normal");
game_background.addChild(_local2);
AllySoldiers.push(_local2);
_local2.pPath = Ally_Path2;
LastPurchase = getTimer();
if (Muted == false){
ButtonClick.play();
};
_local3 = new PointBurst(this, "Rocket Rabbit Purchased", 320, 240);
};
};
};
}
public function buy_infantry_close_menu_mouse_up(_arg1:MouseEvent):void{
buy_infantry.x = -1000;
if (Muted == false){
ButtonClick.play();
};
}
public function CheckAllyHealth():void{
var i:int;
var pb:PointBurst;
var a:int;
if (gamemode != "paused"){
try {
i = (AllySoldiers.length - 1);
while (i >= 0) {
if (AllySoldiers[i].pHealth <= 0){
pb = new PointBurst(game_background, "Ally has died :(", AllySoldiers[i].x, (AllySoldiers[i].y - 20));
AllySoldiers[i].x = -500;
AllySoldiers[i].y = -500;
if (SelectedAlly == i){
SelectedAlly = -1;
};
game_background.unit_selected.x = -1000;
game_background.removeChild(AllySoldiers[i]);
AllySoldiers.splice(i, 1);
a = (Enemies.length - 1);
while (a >= 0) {
if (Enemies[a].pTarget == i){
Enemies[a].pTarget = -1;
};
if (Enemies[a].pTarget > i){
Enemies[a].pTarget = (Enemies[a].pTarget - 1);
};
a = (a - 1);
};
};
i = (i - 1);
};
} catch(e:TypeError) {
};
};
}
public function key_up(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 32){
IsSpaceDown = false;
};
game_background.unit_move.x = -1000;
game_background.unit_move.y = -1000;
}
public function SendLightArtillery():void{
var _local1:script_artillery_explosion;
var _local2:int;
var _local3:int;
if (gamemode != "paused"){
if ((((LightArtilleryCount < 5)) && ((SendingLightArtillery == true)))){
if (getTimer() > (LightLastArtillery + LightArtilleryDelay)){
if (LightArtilleryCount == 0){
if (Muted == false){
IncomingArtillery_sound.play();
};
if (Muted == false){
LightArtillery_sound.play();
};
};
_local1 = new script_artillery_explosion();
_local1.x = (LightArtilleryPoint.x + ((Math.random() * 125) - (Math.random() * 125)));
_local1.y = (LightArtilleryPoint.y + ((Math.random() * 125) - (Math.random() * 125)));
game_background.addChild(_local1);
LightArtilleryCount = (LightArtilleryCount + 1);
LightLastArtillery = getTimer();
_local2 = (Enemies.length - 1);
while (_local2 >= 0) {
if (Enemies[_local2].hitTestObject(_local1)){
Enemies[_local2].GotHit(_local1.pDamage, _local1.pBulletType);
};
_local2--;
};
_local3 = (AllySoldiers.length - 1);
while (_local3 >= 0) {
if (AllySoldiers[_local3].hitTestObject(_local1)){
AllySoldiers[_local3].GotHit(_local1.pDamage, _local1.pBulletType);
};
_local3--;
};
if (LightArtilleryCount == 5){
SendingLightArtillery = false;
LightArtilleryCount = 0;
game_background.x = 0;
};
};
};
};
}
public function buy_infantry_riflesoldier_mouse_up(_arg1:MouseEvent):void{
var _local2:script_infantry_grenadelauncher;
var _local3:PointBurst;
if (gamemode != "paused"){
if (getTimer() > (LastPurchase + PurchaseDelay)){
if (TAPoints >= 5){
TAPoints = (TAPoints - 5);
theinterface.text_tapoints.text = String(TAPoints);
_local2 = new script_infantry_grenadelauncher(1, 2430, "normal");
game_background.addChild(_local2);
AllySoldiers.push(_local2);
_local2.pPath = Ally_Path1;
LastPurchase = getTimer();
if (Muted == false){
ButtonClick.play();
};
_local3 = new PointBurst(this, "Grenacorn Launcher Purchased", 320, 240);
};
};
};
}
public function key_down(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 32){
IsSpaceDown = true;
};
if ((((_arg1.keyCode == 49)) && ((ShowArtillery == true)))){
if ((((SendingLightArtillery == false)) && ((SWPoints >= 2)))){
SWPoints = (SWPoints - 2);
theinterface.text_swpoints.text = String(SWPoints);
SendingLightArtillery = true;
LightArtilleryPoint.x = game_background.ArtillerySpotter.x;
LightArtilleryPoint.y = game_background.ArtillerySpotter.y;
};
};
if ((((_arg1.keyCode == 50)) && ((ShowArtillery == true)))){
if ((((SendingHeavyArtillery == false)) && ((SWPoints >= 5)))){
SWPoints = (SWPoints - 5);
theinterface.text_swpoints.text = String(SWPoints);
SendingHeavyArtillery = true;
HeavyArtilleryPoint.x = game_background.ArtillerySpotter.x;
HeavyArtilleryPoint.y = game_background.ArtillerySpotter.y;
};
};
if ((((_arg1.keyCode == 49)) && ((ShowAirSupport == true)))){
if ((((SendingCarpetBomb == false)) && ((SWPoints >= 8)))){
SWPoints = (SWPoints - 8);
theinterface.text_swpoints.text = String(SWPoints);
SendingPlane = true;
game_background.plane_shadow.y = game_background.ArtillerySpotter.y;
CarpetBombPoint.x = game_background.ArtillerySpotter.x;
CarpetBombPoint.y = game_background.ArtillerySpotter.y;
if (Muted == false){
Bomber_sound.play();
};
};
};
if ((((_arg1.keyCode == 50)) && ((ShowAirSupport == true)))){
if ((((SendingChopper == false)) && ((SWPoints >= 1)))){
SWPoints = (SWPoints - 1);
theinterface.text_swpoints.text = String(SWPoints);
ChopperShotsPoint.x = (game_background.chopper.x - 300);
ChopperShotsPoint.y = game_background.ArtillerySpotter.y;
game_background.chopper.y = game_background.ArtillerySpotter.y;
SendingChopper = true;
SendingChopperShots = true;
};
};
}
function frame1(){
MochiBot.track(this, "ff48a57f");
MochiAd.showPreGameAd({clip:root, id:"fc1a7a62b472c6fb", res:"640x480", background:6725049, color:0xFFFFFF, outline:0, no_bg:true});
}
function frame20(){
stop();
play_demo.addEventListener(MouseEvent.MOUSE_UP, playdemo);
playmoregames.addEventListener(MouseEvent.MOUSE_UP, playmoregames1);
Intro = new intro2();
trans3 = new SoundTransform(0.4, 0);
channel1 = Intro.play(0, 99999, trans3);
}
public function CheckEnemyFireBullet():void{
var xdist:int;
var ydist:int;
var distancefromthis:int;
var closest:int;
var closestmob:int;
var i:int;
var a:int;
var k:int;
var Bullet1:script_bullet_grenadethrower;
var Bullet2:script_bullet_shotgun;
var Bullet3:script_bullet_sniper;
var Bullet4:script_bullet_specialforces;
closest = 5000;
closestmob = -1;
if (gamemode != "paused"){
try {
i = (Enemies.length - 1);
while (i >= 0) {
closest = 5000;
Enemies[i].pTarget = -1;
k = (AllySoldiers.length - 1);
while (k >= 0) {
xdist = Math.round((Enemies[i].x - AllySoldiers[k].x));
ydist = Math.round((Enemies[i].y - AllySoldiers[k].y));
distancefromthis = Math.round(Math.sqrt(((xdist * xdist) + (ydist * ydist))));
if (distancefromthis <= closest){
Enemies[i].pTarget = k;
closest = distancefromthis;
};
k = (k - 1);
};
i = (i - 1);
};
a = (Enemies.length - 1);
while (a >= 0) {
if (AllySoldiers.length > 0){
if (Enemies[a].pTarget != -1){
if (AllySoldiers[Enemies[a].pTarget].pHealth > 0){
xdist = Math.round((Enemies[a].x - AllySoldiers[Enemies[a].pTarget].x));
ydist = Math.round((Enemies[a].y - AllySoldiers[Enemies[a].pTarget].y));
distancefromthis = Math.round(Math.sqrt(((xdist * xdist) + (ydist * ydist))));
if (distancefromthis < Enemies[a].pRange){
if (AllySoldiers[Enemies[a].pTarget].y > 0){
if (getTimer() > (Enemies[a].pLastFire + Enemies[a].pFireDelay)){
Enemies[a].pLastFire = getTimer();
Enemies[a].pMoving = false;
if (Enemies[a].pType == 1){
Bullet1 = new script_bullet_grenadethrower();
Bullet1.x = Enemies[a].x;
Bullet1.y = Enemies[a].y;
Bullet1.pTargetX = AllySoldiers[Enemies[a].pTarget].x;
Bullet1.pTargetY = AllySoldiers[Enemies[a].pTarget].y;
Bullet1.pDamage = Enemies[a].pDamage;
Bullet1.pBullet = Bullet1;
if (EnemyBullets.length < 100){
Bullet1.pVisible = true;
game_background.addChild(Bullet1);
};
EnemyBullets.push(Bullet1);
Bullet1.pSoldier = a;
};
if (Enemies[a].pType == 2){
Bullet2 = new script_bullet_shotgun();
Bullet2.x = Enemies[a].x;
Bullet2.y = Enemies[a].y;
Bullet2.pTargetX = AllySoldiers[Enemies[a].pTarget].x;
Bullet2.pTargetY = AllySoldiers[Enemies[a].pTarget].y;
Bullet2.pTarget = AllySoldiers[a].pTarget;
Bullet2.pDamage = Enemies[a].pDamage;
Bullet2.pBullet = Bullet2;
if (EnemyBullets.length < 500){
Bullet2.pVisible = true;
game_background.addChild(Bullet2);
};
EnemyBullets.push(Bullet2);
Bullet2.pSoldier = a;
};
if (Enemies[a].pType == 3){
Bullet3 = new script_bullet_sniper();
Bullet3.x = Enemies[a].x;
Bullet3.y = Enemies[a].y;
Bullet3.pTargetX = AllySoldiers[Enemies[a].pTarget].x;
Bullet3.pTargetY = AllySoldiers[Enemies[a].pTarget].y;
Bullet3.pDamage = Enemies[a].pDamage;
Bullet3.pBullet = Bullet3;
if (EnemyBullets.length < 500){
Bullet3.pVisible = true;
game_background.addChild(Bullet3);
};
EnemyBullets.push(Bullet3);
Bullet3.pSoldier = a;
};
if (Enemies[a].pType == 4){
Bullet4 = new script_bullet_specialforces();
Bullet4.x = Enemies[a].x;
Bullet4.y = Enemies[a].y;
Bullet4.pTargetX = AllySoldiers[Enemies[a].pTarget].x;
Bullet4.pTargetY = AllySoldiers[Enemies[a].pTarget].y;
Bullet4.pTarget = AllySoldiers[a].pTarget;
Bullet4.pDamage = Enemies[a].pDamage;
Bullet4.pBullet = Bullet4;
if (EnemyBullets.length < 500){
Bullet4.pVisible = true;
game_background.addChild(Bullet4);
};
EnemyBullets.push(Bullet4);
Bullet4.pSoldier = a;
};
};
};
};
};
};
};
a = (a - 1);
};
} catch(e:TypeError) {
};
};
}
function frame50(){
stop();
Clouds = [];
LastWave = getTimer();
WaveDelay = 60000;
GameScore = 0;
TAPoints = 150;
BaseHealth = 100;
LastTAPointUpdate = 0;
TAPointUpdateSpeed = 5000;
LastFPS = 0;
FPSDelay = 300;
LastEnemyType = 1;
Map = [];
MapStart1 = new Point(8, 0);
MapEnd1 = new Point(8, 74);
MapStart2 = new Point(10, 0);
MapEnd2 = new Point(10, 74);
CurrentSong = 1;
Muted = false;
OffsetY = 0;
LastOffsetY = 0;
SelectedAlly = -1;
IsSpaceDown = false;
Lives = 20;
ShowArtillery = false;
ShowAirSupport = false;
LightArtilleryCount = 0;
LightArtilleryDelay = 200;
LightArtilleryPoint = new Point();
HeavyArtilleryPoint = new Point();
SendingLightArtillery = false;
HeavyArtilleryCount = 0;
HeavyArtilleryDelay = 300;
SendingHeavyArtillery = false;
CarpetBombCount = 0;
CarpetBombDelay = 150;
CarpetBombPoint = new Point();
SendingCarpetBomb = false;
ChopperShotsCount = 0;
ChopperShotsDelay = 50;
ChopperShotsPoint = new Point();
SendingChopperShots = false;
leveldelay = 59999;
lastlevel = getTimer();
level = 0;
SendingPlane = false;
SendingChopper = false;
SWPoints = 10;
Ally_MapStart1 = new Point(8, 74);
Ally_MapEnd1 = new Point(8, 16);
Ally_MapStart2 = new Point(10, 74);
Ally_MapEnd2 = new Point(10, 16);
LastPurchase = 0;
PurchaseDelay = 750;
Map = [[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0]];
Path = Pathfinding.findPath(Map, MapStart1.y, MapStart1.x, MapEnd1.y, MapEnd1.x);
Path2 = Pathfinding.findPath(Map, MapStart2.y, MapStart2.x, MapEnd2.y, MapEnd2.x);
Ally_Path1 = Pathfinding.findPath(Map, Ally_MapStart1.y, Ally_MapStart1.x, Ally_MapEnd1.y, Ally_MapEnd1.x);
Ally_Path2 = Pathfinding.findPath(Map, Ally_MapStart2.y, Ally_MapStart2.x, Ally_MapEnd2.y, Ally_MapEnd2.x);
ButtonClick = new buttonclick();
LightArtillery_sound = new lightartillery();
HeavyArtillery_sound = new heavyartillery();
IncomingArtillery_sound = new incomingartillery();
Bomber_sound = new bomber();
Chopper_sound = new chopper();
Explosion_sound = new explosion();
Background = new background1();
Background2 = new background2();
trans = new SoundTransform(0.4, 0);
trans2 = new SoundTransform(0.3, 0);
channel = Background.play(0, 99999, trans);
channel2 = Background2.play(0, 99999, trans2);
Enemies = new Array();
Blood = new Array();
GunSmoke = new Array();
AllySoldiers = new Array();
Bullets = new Array();
EnemyBullets = new Array();
gamemode = "none";
stamp = new Date().time;
addEventListener(Event.ENTER_FRAME, gameloop);
theinterface.main_menu.addEventListener(MouseEvent.MOUSE_UP, main_menu_mouse_up);
stage.addEventListener(KeyboardEvent.KEY_DOWN, key_down);
stage.addEventListener(KeyboardEvent.KEY_UP, key_up);
game_background.addEventListener(MouseEvent.MOUSE_UP, game_background_mouse_up);
theinterface.infantry_menu.addEventListener(MouseEvent.MOUSE_UP, buy_infantry_mouse_up);
theinterface.artillery_menu.addEventListener(MouseEvent.MOUSE_UP, buy_artillery_mouse_up);
theinterface.air_menu.addEventListener(MouseEvent.MOUSE_UP, buy_air_mouse_up);
theinterface.mute.addEventListener(MouseEvent.MOUSE_UP, mute_mouse_up);
theinterface.pausebutton.addEventListener(MouseEvent.MOUSE_UP, pausebutton_mouse_up);
buy_infantry.buy_infantry_riflesoldier.addEventListener(MouseEvent.MOUSE_UP, buy_infantry_riflesoldier_mouse_up);
buy_infantry.buy_infantry_machinegunner.addEventListener(MouseEvent.MOUSE_UP, buy_infantry_machinegunner_mouse_up);
buy_infantry.buy_infantry_sniper.addEventListener(MouseEvent.MOUSE_UP, buy_infantry_sniper_mouse_up);
buy_infantry.buy_infantry_specialforces.addEventListener(MouseEvent.MOUSE_UP, buy_infantry_specialforces_mouse_up);
buy_infantry.menu_close_infantry.addEventListener(MouseEvent.MOUSE_UP, buy_infantry_close_menu_mouse_up);
buy_artillery.menu_close_artillery.addEventListener(MouseEvent.MOUSE_UP, buy_artillery_close_menu_mouse_up);
buy_air.menu_close_air.addEventListener(MouseEvent.MOUSE_UP, buy_air_close_menu_mouse_up);
createclouds();
}
public function createclouds(){
var _local1:int;
var _local2:cloud;
_local1 = 20;
while (_local1 >= 0) {
_local2 = new cloud();
_local2.x = (Math.random() * 640);
_local2.y = (Math.random() * 480);
_local2.movespeed = ((Math.random() * 20) + 10);
_local2.rotation = (Math.random() * 90);
this.addChild(_local2);
Clouds.push(_local2);
_local1--;
};
addChild(game_background);
addChild(gamepaused);
addChild(theinterface);
addChild(buy_infantry);
addChild(buy_artillery);
addChild(buy_air);
}
public function MoveAllyBullets():void{
var xdist:*;
var ydist:int;
var distancefromthis:int;
var i:int;
var carrot_explosion:script_carrotexplosion;
var grenacorn_explosion:script_grenacorn_explosion;
var a:int;
if (gamemode != "paused"){
try {
i = (Bullets.length - 1);
while (i >= 0) {
xdist = Math.round((Bullets[i].x - Bullets[i].pTargetX));
ydist = Math.round((Bullets[i].y - Bullets[i].pTargetY));
distancefromthis = Math.round(Math.sqrt(((xdist * xdist) + (ydist * ydist))));
if (distancefromthis < 10){
if (Bullets[i].pBulletType == 3){
carrot_explosion = new script_carrotexplosion();
carrot_explosion.x = Bullets[i].x;
carrot_explosion.y = Bullets[i].y;
game_background.addChild(carrot_explosion);
};
if (Bullets[i].pBulletType == 1){
grenacorn_explosion = new script_grenacorn_explosion();
grenacorn_explosion.x = Bullets[i].x;
grenacorn_explosion.y = Bullets[i].y;
game_background.addChild(grenacorn_explosion);
};
game_background.removeChild(Bullets[i].pBullet);
Bullets.splice(i, 1);
};
Bullets[i].movebullet();
i = (i - 1);
};
} catch(e:TypeError) {
a = (Bullets.length - 1);
while (a >= 0) {
Bullets[a].x = -900;
Bullets[a].y = -900;
Bullets[a].pTarget = -1;
if (Bullets[a].pVisible == true){
game_background.removeChild(Bullets[a].pBullet);
};
Bullets.splice(a, 1);
a = (a - 1);
};
};
};
}
public function buy_air_mouse_up(_arg1:MouseEvent):void{
buy_artillery.x = -500;
buy_air.x = 320;
buy_infantry.x = -500;
ShowArtillery = false;
ShowAirSupport = true;
if (Muted == false){
ButtonClick.play();
};
}
public function buy_artillery_close_menu_mouse_up(_arg1:MouseEvent):void{
buy_artillery.x = -1000;
ShowArtillery = false;
ShowAirSupport = false;
if (Muted == false){
ButtonClick.play();
};
}
public function game_background_mouse_up(_arg1:MouseEvent):void{
var _local2:Point;
var _local3:Point;
var _local4:*;
var _local5:PointBurst;
var _local6:PointBurst;
var _local7:PointBurst;
if ((((IsSpaceDown == true)) && (!((SelectedAlly == -1))))){
if (AllySoldiers[SelectedAlly].pPathIndex <= (AllySoldiers[SelectedAlly].pPath.length - 1)){
_local2 = new Point(Math.round(AllySoldiers[SelectedAlly].pPath[AllySoldiers[SelectedAlly].pPathIndex][1]), Math.round(AllySoldiers[SelectedAlly].pPath[AllySoldiers[SelectedAlly].pPathIndex][0]));
if (_local2.y < 0){
_local2.y = 0;
};
_local3 = new Point(Math.round((game_background.unit_move.x / 32)), Math.round((game_background.unit_move.y / 32)));
if (_local3.x > 19){
_local3.x = 19;
};
if (_local3.x < 0){
_local3.x = 0;
};
if (_local3.y > 74){
_local3.y = 74;
};
if (_local3.y < 0){
_local3.y = 0;
};
_local4 = Pathfinding.findPath(Map, _local2.y, _local2.x, _local3.y, _local3.x);
if (_local4 != null){
AllySoldiers[SelectedAlly].mapchange();
AllySoldiers[SelectedAlly].pPath = _local4;
AllySoldiers[SelectedAlly].mapchange();
} else {
_local5 = new PointBurst(game_background, "Can't Move Here!", game_background.unit_move.x, game_background.unit_move.y);
};
} else {
_local2 = new Point(Math.round((AllySoldiers[SelectedAlly].x / 32)), Math.round((AllySoldiers[SelectedAlly].y / 32)));
if (_local2.y < 0){
_local2.y = 0;
};
_local3 = new Point(Math.round((game_background.unit_move.x / 32)), Math.round((game_background.unit_move.y / 32)));
if (_local3.x > 19){
_local3.x = 19;
};
if (_local3.x < 0){
_local3.x = 0;
};
if (_local3.y > 74){
_local3.y = 74;
};
if (_local3.y < 0){
_local3.y = 0;
};
_local4 = Pathfinding.findPath(Map, _local2.y, _local2.x, _local3.y, _local3.x);
if (_local4 != null){
AllySoldiers[SelectedAlly].mapchange();
AllySoldiers[SelectedAlly].pPath = _local4;
AllySoldiers[SelectedAlly].mapchange();
} else {
_local6 = new PointBurst(game_background, "Can't Move Here!", game_background.unit_move.x, game_background.unit_move.y);
};
};
if (_local4 != null){
_local7 = new PointBurst(game_background, "Moving here sir!", game_background.unit_move.x, game_background.unit_move.y);
};
} else {
SelectedAlly = -1;
game_background.unit_selected.x = -1000;
game_background.unit_selected.y = -1000;
};
}
public function CheckLives(){
var _local1:int;
var _local2:int;
var _local3:int;
if (gamemode != "paused"){
if (Lives < 1){
game_background.x = -1000;
buy_artillery.x = -1000;
buy_infantry.x = -1000;
buy_air.x = -1000;
channel.stop();
channel2.stop();
theinterface.x = -1000;
_local2 = (Clouds.length - 1);
while (_local2 >= 0) {
Clouds[_local2].x = -1000;
Clouds[_local2].y = -1000;
_local2--;
};
removeEventListener(Event.ENTER_FRAME, gameloop);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_down);
stage.removeEventListener(KeyboardEvent.KEY_UP, key_up);
gotoAndStop(60);
};
_local1 = (Enemies.length - 1);
while (_local1 >= 0) {
if (Enemies[_local1].y > 2450){
Lives = (Lives - 1);
theinterface.text_lives.text = String(Lives);
game_background.removeChild(Enemies[_local1]);
Enemies.splice(_local1, 1);
_local3 = (AllySoldiers.length - 1);
while (_local3 >= 0) {
if (AllySoldiers[_local3].pTarget == _local1){
AllySoldiers[_local3].pTarget = -1;
};
if (AllySoldiers[_local3].pTarget > _local1){
AllySoldiers[_local3].pTarget = (AllySoldiers[_local3].pTarget - 1);
};
_local3--;
};
};
_local1--;
};
};
}
function frame60(){
stop();
play_demo1.addEventListener(MouseEvent.MOUSE_UP, playdemo);
playmoregames.addEventListener(MouseEvent.MOUSE_UP, playmoregames1);
end_score.text = String(GameScore);
}
public function CheckAllyFireBullet():void{
var xdist:int;
var ydist:int;
var distancefromthis:int;
var closest:int;
var closestmob:int;
var i:int;
var a:int;
var k:int;
var Bullet1:script_bullet_grenacorn;
var Bullet2:script_bullet_machinegunner;
var Bullet3:script_bullet_carrot;
var Bullet4:script_bullet_specialforces;
closest = 5000;
closestmob = -1;
if (gamemode != "paused"){
try {
i = (AllySoldiers.length - 1);
while (i >= 0) {
closest = 5000;
AllySoldiers[i].pTarget = -1;
k = (Enemies.length - 1);
while (k >= 0) {
xdist = Math.round((AllySoldiers[i].x - Enemies[k].x));
ydist = Math.round((AllySoldiers[i].y - Enemies[k].y));
distancefromthis = Math.round(Math.sqrt(((xdist * xdist) + (ydist * ydist))));
if (distancefromthis <= closest){
AllySoldiers[i].pTarget = k;
closest = distancefromthis;
};
k = (k - 1);
};
i = (i - 1);
};
a = (AllySoldiers.length - 1);
while (a >= 0) {
if (Enemies.length > 0){
if (AllySoldiers[a].pTarget != -1){
if (Enemies[AllySoldiers[a].pTarget].pHealth > 0){
xdist = Math.round((AllySoldiers[a].x - Enemies[AllySoldiers[a].pTarget].x));
ydist = Math.round((AllySoldiers[a].y - Enemies[AllySoldiers[a].pTarget].y));
distancefromthis = Math.round(Math.sqrt(((xdist * xdist) + (ydist * ydist))));
if (distancefromthis < AllySoldiers[a].pRange){
if (Enemies[AllySoldiers[a].pTarget].y > 0){
if (getTimer() > (AllySoldiers[a].pLastFire + AllySoldiers[a].pFireDelay)){
AllySoldiers[a].pLastFire = getTimer();
AllySoldiers[a].pMoving = false;
if (AllySoldiers[a].pType == 1){
Bullet1 = new script_bullet_grenacorn();
Bullet1.x = AllySoldiers[a].x;
Bullet1.y = AllySoldiers[a].y;
Bullet1.pTargetX = Enemies[AllySoldiers[a].pTarget].x;
Bullet1.pTargetY = Enemies[AllySoldiers[a].pTarget].y;
Bullet1.pDamage = AllySoldiers[a].pDamage;
Bullet1.pBullet = Bullet1;
if (Bullets.length < 100){
Bullet1.pVisible = true;
game_background.addChild(Bullet1);
};
Bullets.push(Bullet1);
Bullet1.pSoldier = a;
};
if (AllySoldiers[a].pType == 2){
Bullet2 = new script_bullet_machinegunner();
Bullet2.x = AllySoldiers[a].x;
Bullet2.y = AllySoldiers[a].y;
Bullet2.pTargetX = Enemies[AllySoldiers[a].pTarget].x;
Bullet2.pTargetY = Enemies[AllySoldiers[a].pTarget].y;
Bullet2.pTarget = AllySoldiers[a].pTarget;
Bullet2.pDamage = AllySoldiers[a].pDamage;
Bullet2.pBullet = Bullet2;
if (Bullets.length < 500){
Bullet2.pVisible = true;
game_background.addChild(Bullet2);
};
Bullets.push(Bullet2);
Bullet2.pSoldier = a;
};
if (AllySoldiers[a].pType == 3){
Bullet3 = new script_bullet_carrot();
Bullet3.x = AllySoldiers[a].x;
Bullet3.y = AllySoldiers[a].y;
Bullet3.pTargetX = Enemies[AllySoldiers[a].pTarget].x;
Bullet3.pTargetY = Enemies[AllySoldiers[a].pTarget].y;
Bullet3.pDamage = AllySoldiers[a].pDamage;
Bullet3.pBullet = Bullet3;
if (Bullets.length < 500){
Bullet3.pVisible = true;
game_background.addChild(Bullet3);
};
Bullets.push(Bullet3);
Bullet3.pSoldier = a;
};
if (AllySoldiers[a].pType == 4){
Bullet4 = new script_bullet_specialforces();
Bullet4.x = AllySoldiers[a].x;
Bullet4.y = AllySoldiers[a].y;
Bullet4.pTargetX = Enemies[AllySoldiers[a].pTarget].x;
Bullet4.pTargetY = Enemies[AllySoldiers[a].pTarget].y;
Bullet4.pTarget = AllySoldiers[a].pTarget;
Bullet4.pDamage = AllySoldiers[a].pDamage;
Bullet4.pBullet = Bullet4;
if (Bullets.length < 500){
Bullet4.pVisible = true;
game_background.addChild(Bullet4);
};
Bullets.push(Bullet4);
Bullet4.pSoldier = a;
};
};
};
};
};
};
};
a = (a - 1);
};
} catch(e:TypeError) {
};
};
}
public function playdemo(_arg1:MouseEvent):void{
channel1.stop();
gotoAndStop(50);
}
public function sponsor(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.peoplegrade.com/games";
_local3 = new URLRequest(_local2);
navigateToURL(_local3);
}
public function CheckGunSmoke(){
var _local1:*;
var _local2:int;
if (gamemode != "paused"){
_local1 = [];
_local2 = 0;
while (_local2 < GunSmoke.length) {
if (GunSmoke[_local2].pLife < 0){
game_background.removeChild(GunSmoke[_local2]);
} else {
_local1.push(GunSmoke[_local2]);
};
_local2++;
};
GunSmoke = _local1;
};
}
public function buy_infantry_machinegunner_mouse_up(_arg1:MouseEvent):void{
var _local2:script_infantry_machinegunner;
var _local3:PointBurst;
if (gamemode != "paused"){
if (getTimer() > (LastPurchase + PurchaseDelay)){
if (TAPoints >= 15){
TAPoints = (TAPoints - 15);
theinterface.text_tapoints.text = String(TAPoints);
_local2 = new script_infantry_machinegunner(1, 2430, "normal");
game_background.addChild(_local2);
AllySoldiers.push(_local2);
_local2.pPath = Ally_Path1;
LastPurchase = getTimer();
if (Muted == false){
ButtonClick.play();
};
_local3 = new PointBurst(this, "Squirrelator Purchased", 320, 240);
};
};
};
}
public function stopgame(){
var _local1:int;
game_background.x = -1000;
channel.stop();
channel2.stop();
theinterface.x = -1000;
buy_artillery.x = -1000;
buy_infantry.x = -1000;
buy_air.x = -1000;
_local1 = (Clouds.length - 1);
while (_local1 >= 0) {
Clouds[_local1].x = -1000;
Clouds[_local1].y = -1000;
_local1--;
};
removeEventListener(Event.ENTER_FRAME, gameloop);
gotoAndStop(20);
}
public function CheckSelectedAlly(){
var a:int;
var b:int;
try {
a = (AllySoldiers.length - 1);
while (a >= 0) {
if (AllySoldiers[a].pSelected == true){
SelectedAlly = a;
};
a = (a - 1);
};
b = (AllySoldiers.length - 1);
while (b >= 0) {
AllySoldiers[b].pSelected = false;
b = (b - 1);
};
if (SelectedAlly != -1){
game_background.unit_selected.x = AllySoldiers[SelectedAlly].x;
game_background.unit_selected.y = AllySoldiers[SelectedAlly].y;
game_background.unit_selected.rotation = (game_background.unit_selected.rotation + 5);
};
} catch(e:TypeError) {
};
}
public function placeenemies():void{
var _local1:*;
var _local2:script_enemy_grenadethrower;
var _local3:script_enemy_shotgun;
var _local4:script_enemy_sniper;
var _local5:script_enemy_specialforces;
if (gamemode != "paused"){
_local1 = 0;
while (_local1 < 20) {
if (LastEnemyType == 1){
_local2 = new script_enemy_grenadethrower(_local1, -32, "normal", level);
game_background.addChild(_local2);
Enemies.push(_local2);
LastWave = getTimer();
_local2.pPath = Path;
} else {
if (LastEnemyType == 2){
_local3 = new script_enemy_shotgun(_local1, -32, "normal", level);
game_background.addChild(_local3);
Enemies.push(_local3);
LastWave = getTimer();
_local3.pPath = Path2;
} else {
if (LastEnemyType == 3){
_local4 = new script_enemy_sniper(_local1, -32, "normal", level);
game_background.addChild(_local4);
Enemies.push(_local4);
LastWave = getTimer();
_local4.pPath = Path2;
} else {
if (LastEnemyType == 4){
_local5 = new script_enemy_specialforces(_local1, -32, "normal", level);
game_background.addChild(_local5);
Enemies.push(_local5);
LastWave = getTimer();
_local5.pPath = Path;
};
};
};
};
LastEnemyType = (LastEnemyType + 1);
if (LastEnemyType == 5){
LastEnemyType = 1;
};
_local1++;
};
};
}
public function MoveCheckClouds(){
var _local1:int;
if (gamemode != "paused"){
_local1 = (Clouds.length - 1);
while (_local1 >= 0) {
Clouds[_local1].y = (Clouds[_local1].y + (Tick.ftime * Clouds[_local1].movespeed));
if (Clouds[_local1].y > 550){
Clouds[_local1].y = -50;
Clouds[_local1].x = (Math.random() * 640);
};
_local1--;
};
};
}
public function playmoregames1(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.peoplegrade.com/games";
_local3 = new URLRequest(_local2);
navigateToURL(_local3);
}
public function CheckSoldiersAndEnemies(){
var _local1:int;
var _local2:int;
var _local3:script_infantry_grenadelauncher;
var _local4:script_infantry_machinegunner;
var _local5:script_infantry_sniper;
var _local6:script_infantry_specialforces;
_local2 = (AllySoldiers.length - 1);
while (_local2 >= 0) {
_local1 = AllySoldiers[_local2].pType;
if (AllySoldiers[_local2].y < 100){
game_background.removeChild(AllySoldiers[_local2]);
AllySoldiers.splice(_local2, 1);
if (_local1 == 1){
_local3 = new script_infantry_grenadelauncher(1, 2430, "normal");
game_background.addChild(_local3);
AllySoldiers.push(_local3);
_local3.pPath = Ally_Path1;
};
if (_local1 == 2){
_local4 = new script_infantry_machinegunner(1, 2430, "normal");
game_background.addChild(_local4);
AllySoldiers.push(_local4);
_local4.pPath = Ally_Path1;
};
if (_local1 == 3){
_local5 = new script_infantry_sniper(1, 2430, "normal");
game_background.addChild(_local5);
AllySoldiers.push(_local5);
_local5.pPath = Ally_Path1;
};
if (_local1 == 4){
_local6 = new script_infantry_specialforces(1, 2430, "normal");
game_background.addChild(_local6);
AllySoldiers.push(_local6);
_local6.pPath = Ally_Path1;
};
};
_local2--;
};
}
public function main_menu_mouse_up(_arg1:MouseEvent):void{
stopgame();
}
public function gameloop(_arg1:Event):void{
var _local2:int;
var _local3:Number;
var _local4:Number;
var _local5:int;
var _local6:int;
var _local7:PointBurst;
var _local8:PointBurst;
_local2 = getTimer();
_local3 = new Date().time;
Tick.getFtime();
_local4 = ((_local3 - stamp) / 1000);
fps = (1 / _local4);
stamp = _local3;
if (gamemode != "paused"){
if (mouseY < 15){
game_background.y = (game_background.y + 20);
};
if (mouseY > 465){
game_background.y = (game_background.y - 20);
};
if (game_background.y < -1920){
game_background.y = -1920;
};
if (game_background.y > 0){
game_background.y = 0;
};
if (getTimer() > (leveldelay + lastlevel)){
level = (level + 1);
lastlevel = getTimer();
theinterface.text_level.text = String(level);
_local7 = new PointBurst(this, ("Level " + String(level)), 320, 240);
_local8 = new PointBurst(this, "+2 SW Points!", 320, 300);
SWPoints = (SWPoints + 2);
theinterface.text_swpoints.text = String(SWPoints);
};
CheckAllyFireBullet();
CheckEnemyFireBullet();
MoveAllyBullets();
MoveEnemyBullets();
CheckEnemiesForHit();
CheckAlliesForHit();
CheckEnemyHealth();
CheckAllyHealth();
CheckGunSmoke();
CheckBlood();
MoveCheckClouds();
CheckSelectedAlly();
CheckLives();
SendLightArtillery();
SendHeavyArtillery();
SendCarpetBomb();
SendChopperShots();
_local5 = (AllySoldiers.length - 1);
while (_local5 >= 0) {
if (_local2 > (AllySoldiers[_local5].pLastFire + AllySoldiers[_local5].pMoveDelay)){
AllySoldiers[_local5].pMoving = true;
};
_local5--;
};
_local6 = (Enemies.length - 1);
while (_local6 >= 0) {
if (_local2 > (Enemies[_local6].pLastFire + Enemies[_local6].pMoveDelay)){
Enemies[_local6].pMoving = true;
};
_local6--;
};
if ((((ShowArtillery == true)) || ((ShowAirSupport == true)))){
game_background.ArtillerySpotter.x = root.mouseX;
game_background.ArtillerySpotter.y = (root.mouseY + Math.abs(game_background.y));
game_background.ArtillerySpotter.rotation = (game_background.ArtillerySpotter.rotation + 5);
} else {
game_background.ArtillerySpotter.x = -1000;
};
if (IsSpaceDown == true){
if (SelectedAlly != -1){
game_background.unit_move.x = root.mouseX;
game_background.unit_move.y = (root.mouseY + Math.abs(game_background.y));
game_background.unit_move.rotation = (game_background.unit_move.rotation + 5);
};
};
if (_local2 > (LastWave + WaveDelay)){
placeenemies();
};
if (SendingPlane == true){
game_background.plane_shadow.x = (game_background.plane_shadow.x + 10);
if (game_background.plane_shadow.x > 700){
game_background.plane_shadow.x = -1000;
SendingCarpetBomb = true;
SendingPlane = false;
};
};
if (SendingChopper == true){
game_background.chopper.x = (game_background.chopper.x - 5);
if (game_background.chopper.x < -100){
game_background.chopper.x = 800;
SendingChopper = false;
};
};
if ((((LightArtilleryCount < 10)) && ((SendingLightArtillery == true)))){
game_background.x = (game_background.x + ((Math.random() * 1) - (Math.random() * 1)));
};
if ((((HeavyArtilleryCount < 30)) && ((SendingHeavyArtillery == true)))){
game_background.x = (game_background.x + ((Math.random() * 1) - (Math.random() * 1)));
};
if ((((CarpetBombCount < 40)) && ((SendingCarpetBomb == true)))){
game_background.x = (game_background.x + ((Math.random() * 1) - (Math.random() * 1)));
};
theinterface.text_enemywave.text = String(Math.round((((WaveDelay + LastWave) - _local2) / 1000)));
if (_local2 > (LastTAPointUpdate + TAPointUpdateSpeed)){
TAPoints = (TAPoints + 1);
theinterface.text_tapoints.text = String(TAPoints);
LastTAPointUpdate = _local2;
};
};
}
public function MoveEnemyBullets():void{
var xdist:*;
var ydist:int;
var distancefromthis:int;
var i:int;
var sheep_explosion:script_sheepexplosion;
var grenacorn_explosion:script_grenacorn_explosion;
var a:int;
if (gamemode != "paused"){
try {
i = (EnemyBullets.length - 1);
while (i >= 0) {
xdist = Math.round((EnemyBullets[i].x - EnemyBullets[i].pTargetX));
ydist = Math.round((EnemyBullets[i].y - EnemyBullets[i].pTargetY));
distancefromthis = Math.round(Math.sqrt(((xdist * xdist) + (ydist * ydist))));
if (distancefromthis < 10){
if (EnemyBullets[i].pBulletType == 3){
sheep_explosion = new script_sheepexplosion();
sheep_explosion.x = EnemyBullets[i].x;
sheep_explosion.y = EnemyBullets[i].y;
game_background.addChild(sheep_explosion);
};
if (EnemyBullets[i].pBulletType == 1){
grenacorn_explosion = new script_grenacorn_explosion();
grenacorn_explosion.x = EnemyBullets[i].x;
grenacorn_explosion.y = EnemyBullets[i].y;
game_background.addChild(grenacorn_explosion);
};
game_background.removeChild(EnemyBullets[i].pBullet);
EnemyBullets.splice(i, 1);
};
EnemyBullets[i].movebullet();
i = (i - 1);
};
} catch(e:TypeError) {
a = (EnemyBullets.length - 1);
while (a >= 0) {
EnemyBullets[a].x = -900;
EnemyBullets[a].y = -900;
EnemyBullets[a].pTarget = -1;
if (EnemyBullets[a].pVisible == true){
game_background.removeChild(EnemyBullets[a].pBullet);
};
EnemyBullets.splice(a, 1);
a = (a - 1);
};
};
};
}
public function everytimesponsor(_arg1:Event):void{
if (sponsorlogo.currentFrame == sponsorlogo.totalFrames){
gotoAndStop(20);
removeEventListener(Event.ENTER_FRAME, everytimesponsor);
};
}
public function buy_infantry_specialforces_mouse_up(_arg1:MouseEvent):void{
var _local2:int;
var _local3:PointBurst;
var _local4:script_infantry_specialforces;
if (gamemode != "paused"){
if (getTimer() > (LastPurchase + PurchaseDelay)){
if (TAPoints >= 40){
TAPoints = (TAPoints - 40);
theinterface.text_tapoints.text = String(TAPoints);
_local2 = 1;
while (_local2 >= 0) {
_local4 = new script_infantry_specialforces(_local2, 2430, "normal");
game_background.addChild(_local4);
AllySoldiers.push(_local4);
_local4.pPath = Ally_Path2;
_local2--;
};
LastPurchase = getTimer();
if (Muted == false){
ButtonClick.play();
};
_local3 = new PointBurst(this, "Rambo Rabit Purchased", 320, 240);
};
};
};
}
public function buy_artillery_mouse_up(_arg1:MouseEvent):void{
buy_artillery.x = 320;
buy_air.x = -500;
buy_infantry.x = -500;
ShowArtillery = true;
ShowAirSupport = false;
if (Muted == false){
ButtonClick.play();
};
}
public function CheckEnemiesForHit():void{
var i:int;
var k:int;
var c:*;
var carrot_explosion:script_carrotexplosion;
var grenacorn_explosion:script_grenacorn_explosion;
var blood1:script_blood;
if (gamemode != "paused"){
if (Bullets.length == 0){
return;
};
try {
i = (Enemies.length - 1);
while (i >= 0) {
k = (Bullets.length - 1);
while (k >= 0) {
if (Enemies[i].hitTestObject(Bullets[k])){
if (Bullets[k].pBulletType == 3){
carrot_explosion = new script_carrotexplosion();
carrot_explosion.x = Enemies[i].x;
carrot_explosion.y = Enemies[i].y;
game_background.addChild(carrot_explosion);
};
if (Bullets[k].pBulletType == 1){
grenacorn_explosion = new script_grenacorn_explosion();
grenacorn_explosion.x = Bullets[k].x;
grenacorn_explosion.y = Bullets[k].y;
game_background.addChild(grenacorn_explosion);
};
Enemies[i].GotHit(Bullets[k].pDamage, Bullets[k].pBulletType);
Bullets[k].x = -100;
Bullets[k].y = -100;
if (Bullets[k].pVisible == true){
game_background.removeChild(Bullets[k].pBullet);
};
Bullets.splice(k, 1);
c = 0;
while (c < 1) {
blood1 = new script_blood();
blood1.x = ((Enemies[i].x - 8) + (Math.random() * 16));
blood1.y = ((Enemies[i].y - 8) + (Math.random() * 16));
game_background.addChild(blood1);
Blood.push(blood1);
c = (c + 1);
};
};
k = (k - 1);
};
i = (i - 1);
};
} catch(e:TypeError) {
};
};
}
public function buy_infantry_mouse_up(_arg1:MouseEvent):void{
buy_infantry.x = 320;
buy_artillery.x = -500;
buy_air.x = -500;
ShowArtillery = false;
ShowAirSupport = false;
if (Muted == false){
ButtonClick.play();
};
}
public function mute_mouse_up(_arg1:MouseEvent):void{
if (Muted == false){
Muted = true;
channel.stop();
channel2.stop();
} else {
Muted = false;
channel = Background.play(0, 99999, trans);
channel2 = Background2.play(0, 99999, trans2);
};
}
public function SendCarpetBomb():void{
var _local1:script_plane_bomb;
var _local2:int;
var _local3:int;
if (gamemode != "paused"){
if ((((CarpetBombCount < 40)) && ((SendingCarpetBomb == true)))){
if (getTimer() > (CarpetBombLast + CarpetBombDelay)){
if (CarpetBombCount == 0){
};
_local1 = new script_plane_bomb();
_local1.x = (CarpetBombPoint.x + ((Math.random() * 250) - (Math.random() * 250)));
_local1.y = (CarpetBombPoint.y + ((Math.random() * 250) - (Math.random() * 250)));
game_background.addChild(_local1);
CarpetBombCount = (CarpetBombCount + 1);
CarpetBombLast = getTimer();
if (Muted == false){
Explosion_sound.play();
};
_local2 = (Enemies.length - 1);
while (_local2 >= 0) {
if (Enemies[_local2].hitTestObject(_local1)){
Enemies[_local2].GotHit(_local1.pDamage, _local1.pBulletType);
};
_local2--;
};
_local3 = (AllySoldiers.length - 1);
while (_local3 >= 0) {
if (AllySoldiers[_local3].hitTestObject(_local1)){
AllySoldiers[_local3].GotHit(_local1.pDamage, _local1.pBulletType);
};
_local3--;
};
if (CarpetBombCount == 40){
SendingCarpetBomb = false;
CarpetBombCount = 0;
game_background.x = 0;
};
};
};
};
}
public function CheckBlood(){
var _local1:*;
var _local2:int;
if (gamemode != "paused"){
_local1 = [];
_local2 = 0;
while (_local2 < Blood.length) {
if (Blood[_local2].pLife < 0){
game_background.removeChild(Blood[_local2]);
} else {
_local1.push(Blood[_local2]);
};
_local2++;
};
Blood = _local1;
};
}
}
}//package Commander_fla
Section 4
//menu_air_24 (Commander_fla.menu_air_24)
package Commander_fla {
import flash.display.*;
public dynamic class menu_air_24 extends MovieClip {
public var menu_close_air:MovieClip;
}
}//package Commander_fla
Section 5
//menu_artillery_31 (Commander_fla.menu_artillery_31)
package Commander_fla {
import flash.display.*;
public dynamic class menu_artillery_31 extends MovieClip {
public var menu_close_artillery:MovieClip;
}
}//package Commander_fla
Section 6
//menu_infantry_26 (Commander_fla.menu_infantry_26)
package Commander_fla {
import flash.display.*;
public dynamic class menu_infantry_26 extends MovieClip {
public var menu_close_infantry:MovieClip;
public var buy_infantry_specialforces:MovieClip;
public var buy_infantry_sniper:MovieClip;
public var buy_infantry_riflesoldier:MovieClip;
public var buy_infantry_machinegunner:MovieClip;
}
}//package Commander_fla
Section 7
//ArmyChalk (ArmyChalk)
package {
import flash.text.*;
public dynamic class ArmyChalk extends Font {
}
}//package
Section 8
//background1 (background1)
package {
import flash.media.*;
public dynamic class background1 extends Sound {
}
}//package
Section 9
//background2 (background2)
package {
import flash.media.*;
public dynamic class background2 extends Sound {
}
}//package
Section 10
//bomber (bomber)
package {
import flash.media.*;
public dynamic class bomber extends Sound {
}
}//package
Section 11
//buttonclick (buttonclick)
package {
import flash.media.*;
public dynamic class buttonclick extends Sound {
}
}//package
Section 12
//chopper (chopper)
package {
import flash.media.*;
public dynamic class chopper extends Sound {
}
}//package
Section 13
//cloud (cloud)
package {
import flash.display.*;
public dynamic class cloud extends MovieClip {
}
}//package
Section 14
//explosion (explosion)
package {
import flash.media.*;
public dynamic class explosion extends Sound {
}
}//package
Section 15
//heavyartillery (heavyartillery)
package {
import flash.media.*;
public dynamic class heavyartillery extends Sound {
}
}//package
Section 16
//incomingartillery (incomingartillery)
package {
import flash.media.*;
public dynamic class incomingartillery extends Sound {
}
}//package
Section 17
//intro2 (intro2)
package {
import flash.media.*;
public dynamic class intro2 extends Sound {
}
}//package
Section 18
//lightartillery (lightartillery)
package {
import flash.media.*;
public dynamic class lightartillery extends Sound {
}
}//package
Section 19
//MochiAd (MochiAd)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
public class MochiAd {
public static function getVersion():String{
return ("2.1");
}
public static function showTimedAd(_arg1:Object):void{
MochiAd.showInterLevelAd(_arg1);
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var f:Function;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip._mochiad_loaded){
return (null);
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
f = function (_arg1:Object):void{
mc._mochiad_ctr_failed = true;
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
g = function (_arg1:Object):void{
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["sendHighScore", _arg1], _arg2, _arg3);
return (true);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
return (_local3);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
_arg1.removeChild(_arg1._mochiad);
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
this.clip.stop();
}, ad_finished:function ():void{
this.clip.play();
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = _local1.loaderInfo.bytesTotal;
if ((((_local4 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
_local3 = true;
};
};
};
if ((((_local2 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _loadCommunicator(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var clipname:String;
var server:String;
var depth:Number;
var mc:MovieClip;
var lv:URLVariables;
var k:String;
var lc:LocalConnection;
var name:String;
var req:URLRequest;
var loader:Loader;
var options = _arg1;
DEFAULTS = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
clipname = ("_mochiad_com_" + options.id);
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip[clipname]){
return (clip[clipname]);
};
server = (options.com_server + options.id);
MochiAd._allowDomains(server);
delete options.id;
delete options.com_server;
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, clipname, depth);
lv = new URLVariables();
for (k in options) {
lv[k] = options[k];
};
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.name = name;
mc.lc = lc;
lv.lc = name;
mc._id = 0;
mc._queue = [];
mc.rpcResult = function (_arg1:Object):void{
var _local3:Array;
var _local4:Array;
var _local5:Number;
var _local6:Object;
var _local7:Object;
_arg1 = parseInt(_arg1.toString());
_local3 = mc._callbacks[_arg1];
if (typeof(_local3) == "undefined"){
return;
};
delete mc._callbacks[_arg1];
_local4 = [];
_local5 = 2;
while (_local5 < _local3.length) {
_local4.push(_local3[_local5]);
_local5++;
};
_local5 = 1;
while (_local5 < arguments.length) {
_local4.push(arguments[_local5]);
_local5++;
};
_local6 = _local3[1];
_local7 = _local3[0];
if (((_local7) && ((typeof(_local6) == "string")))){
_local6 = _local7[_local6];
};
if (typeof(_local6) == "function"){
_local6.apply(_local7, _local4);
};
};
mc._didConnect = function (_arg1:String):void{
var _local2:Array;
var _local3:Function;
var _local4:Number;
var _local5:Array;
mc._endpoint = _arg1;
_local2 = mc._queue;
delete mc._queue;
_local3 = mc.doSend;
_local4 = 0;
while (_local4 < _local2.length) {
_local5 = _local2[_local4];
_local3.apply(this, _local5);
_local4++;
};
};
mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{
var _local5:Number;
var _local6:LocalConnection;
var _local7:Array;
var _local8:Number;
if (mc._endpoint == null){
_local7 = [];
_local8 = 0;
while (_local8 < arguments.length) {
_local7.push(arguments[_local8]);
_local8++;
};
mc._queue.push(_local7);
return;
};
mc._id = (mc._id + 1);
_local5 = mc._id;
mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))];
_local6 = new LocalConnection();
_local6.send(mc._endpoint, "rpc", _local5, _arg1);
};
mc._callbacks = {};
mc._callbacks[0] = [mc, "_didConnect"];
lv.st = getTimer();
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
loader.load(req);
mc.addChild(loader);
mc._mochiad_com = loader;
return (mc);
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, ad_started:function ():void{
this.clip.stop();
}, ad_finished:function ():void{
this.clip.play();
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
bar.x = 10;
bar.y = (h - 20);
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (!this.parent.parent){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
if (!chk.showing){
_local11 = _local2.loaderInfo.bytesTotal;
if ((((_local11 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local3 > chk.ad_timeout){
_local4 = true;
};
};
};
if ((((_local3 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
MochiAd.showPreGameAd(_arg1);
}
public static function fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3);
return (true);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
mc.removeEventListener(Event.ENTER_FRAME, f);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 20
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.system.*;
import flash.net.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 21
//Pathfinding (Pathfinding)
package {
public class Pathfinding {
var D_COST;// = 14
var ALLOW_DIAGONAL;// = true
var mapStatus:Array;
var openList:Array;
var ALLOW_DIAGONAL_CORNERING;// = false
var HV_COST;// = 10
public function Pathfinding(){
HV_COST = 10;
D_COST = 14;
ALLOW_DIAGONAL = true;
ALLOW_DIAGONAL_CORNERING = false;
super();
}
function openSquare(_arg1:Number, _arg2:Number, _arg3, _arg4, _arg5, _arg6){
if (!_arg6){
openList.push([_arg1, _arg2]);
mapStatus[_arg1][_arg2] = {heuristic:_arg5, open:true, closed:false};
};
mapStatus[_arg1][_arg2].parent = _arg3;
mapStatus[_arg1][_arg2].movementCost = _arg4;
}
function nearerSquare(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local1 = 999999;
_local2 = 0;
_local3 = undefined;
_local4 = undefined;
_local5 = openList.length;
while (_local5-- > 0) {
_local4 = mapStatus[openList[_local5][0]][openList[_local5][1]];
_local3 = (_local4.heuristic + _local4.movementCost);
if (_local3 <= _local1){
_local1 = _local3;
_local2 = _local5;
};
};
return (_local2);
}
function isOpen(_arg1:Number, _arg2:Number){
return (mapStatus[_arg1][_arg2].open);
}
function closeSquare(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:*;
_local3 = openList.length;
_local4 = 0;
while (_local4 < _local3) {
if (openList[_local4][0] == _arg1){
if (openList[_local4][1] == _arg2){
openList.splice(_local4, 1);
break;
};
};
_local4++;
};
mapStatus[_arg1][_arg2].open = false;
mapStatus[_arg1][_arg2].closed = true;
}
function findPathInternal(_arg1:Array, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Array{
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:*;
var _local15:Array;
var _local16:*;
var _local17:*;
var _local18:*;
var _local19:*;
_local6 = _arg1.length;
_local7 = _arg1[0].length;
mapStatus = new Array();
_local8 = 0;
while (_local8 < _local6) {
mapStatus[_local8] = new Array();
_local10 = 0;
while (_local10 < _local7) {
mapStatus[_local8][_local10] = new Array();
_local10++;
};
_local8++;
};
openList = new Array();
openSquare(_arg2, _arg3, undefined, 0, undefined, undefined);
while ((((openList.length > 0)) && (!(isClosed(_arg4, _arg5))))) {
_local8 = nearerSquare();
_local16 = openList[_local8][0];
_local17 = openList[_local8][1];
closeSquare(_local16, _local17);
_local11 = (_local16 - 1);
while (_local11 < (_local16 + 2)) {
_local12 = (_local17 - 1);
while (_local12 < (_local17 + 2)) {
if ((((((((((((((_local11 >= 0)) && ((_local11 < _local6)))) && ((_local12 >= 0)))) && ((_local12 < _local7)))) && (!((((_local11 == _local16)) && ((_local12 == _local17))))))) && (((((ALLOW_DIAGONAL) || ((_local11 == _local16)))) || ((_local12 == _local17)))))) && (((((((ALLOW_DIAGONAL_CORNERING) || ((_local11 == _local16)))) || ((_local12 == _local17)))) || (((!((_arg1[_local11][_local17] == 0))) && (_arg1[_local16][_local12]))))))){
if (_arg1[_local11][_local12] != 0){
if (!isClosed(_local11, _local12)){
_local13 = (mapStatus[_local16][_local17].movementCost + (((((_local11 == _local16)) || ((_local12 == _local17)))) ? HV_COST : D_COST * _arg1[_local11][_local12]));
if (isOpen(_local11, _local12)){
if (_local13 < mapStatus[_local11][_local12].movementCost){
openSquare(_local11, _local12, [_local16, _local17], _local13, undefined, true);
};
} else {
_local14 = ((Math.abs((_local11 - _arg4)) + Math.abs((_local12 - _arg5))) * 10);
openSquare(_local11, _local12, [_local16, _local17], _local13, _local14, false);
};
};
};
};
_local12++;
};
_local11++;
};
};
_local9 = isClosed(_arg4, _arg5);
if (_local9){
_local15 = new Array();
_local16 = _arg4;
_local17 = _arg5;
while (((!((_local16 == _arg2))) || (!((_local17 == _arg3))))) {
_local15.push([_local16, _local17]);
_local18 = mapStatus[_local16][_local17].parent[0];
_local19 = mapStatus[_local16][_local17].parent[1];
_local16 = _local18;
_local17 = _local19;
};
_local15.push([_arg2, _arg3]);
_local15.reverse();
return (_local15);
//unresolved jump
};
return (null);
}
function isClosed(_arg1:Number, _arg2:Number){
return (mapStatus[_arg1][_arg2].closed);
}
public static function findPath(_arg1:Array, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Array{
var _local6:Pathfinding;
var _local7:Array;
_local6 = new (Pathfinding);
_local7 = _local6.findPathInternal(_arg1, _arg2, _arg3, _arg4, _arg5);
return (_local7);
}
}
}//package
Section 22
//PointBurst (PointBurst)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
public class PointBurst extends Sprite {
private var burstSprite:Sprite;
private var animTimer:Timer;
private var parentMC:MovieClip;
private var tField:TextField;
static const animStepTime:int = 50;
static const fontSize:int = 20;
static const fontFace:String = "Arial";
static const fontBold:Boolean = true;
static const animSteps:int = 20;
static const startScale:Number = 1;
static const fontColor:Number = 0xFFFFFF;
static const endScale:Number = 2;
public function PointBurst(_arg1:MovieClip, _arg2:Object, _arg3, _arg4:Number){
var _local5:TextFormat;
super();
_local5 = new TextFormat();
_local5.font = fontFace;
_local5.size = fontSize;
_local5.bold = fontBold;
_local5.color = fontColor;
_local5.align = "center";
tField = new TextField();
tField.embedFonts = true;
tField.selectable = false;
tField.defaultTextFormat = _local5;
tField.autoSize = TextFieldAutoSize.CENTER;
tField.text = String(_arg2);
tField.x = -((tField.width / 2));
tField.y = -((tField.height / 2));
burstSprite = new Sprite();
burstSprite.x = _arg3;
burstSprite.y = _arg4;
burstSprite.scaleX = startScale;
burstSprite.scaleY = startScale;
burstSprite.alpha = 0;
burstSprite.addChild(tField);
parentMC = _arg1;
parentMC.addChild(burstSprite);
animTimer = new Timer(animStepTime, animSteps);
animTimer.addEventListener(TimerEvent.TIMER, rescaleBurst);
animTimer.addEventListener(TimerEvent.TIMER_COMPLETE, removeBurst);
animTimer.start();
}
public function removeBurst(_arg1:TimerEvent){
burstSprite.removeChild(tField);
parentMC.removeChild(burstSprite);
tField = null;
burstSprite = null;
delete ??getglobalscope
[this];
}
public function rescaleBurst(_arg1:TimerEvent){
var _local2:Number;
_local2 = (_arg1.target.currentCount / animSteps);
burstSprite.scaleX = (((1 - _local2) * startScale) + (_local2 * endScale));
burstSprite.scaleY = (((1 - _local2) * startScale) + (_local2 * endScale));
burstSprite.alpha = (1 - _local2);
}
}
}//package
Section 23
//script_artillery_explosion (script_artillery_explosion)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class script_artillery_explosion extends MovieClip {
public var pBulletType:int;// = 10
public var pLastAnim:int;// = 0
public var pAnimDelay:int;// = 50
public var pCurrentAnim:int;// = 0
public var pPaused:Boolean;// = false
public var pAnimCount:int;// = 14
public var pDamage:int;// = 50
public function script_artillery_explosion():void{
pDamage = 50;
pBulletType = 10;
pPaused = false;
pLastAnim = 0;
pAnimDelay = 50;
pAnimCount = 14;
pCurrentAnim = 0;
super();
addEventListener(Event.ENTER_FRAME, everytime);
}
public function everytime(_arg1:Event):void{
if (pPaused == false){
if (getTimer() > (pLastAnim + pAnimDelay)){
if (pCurrentAnim == pAnimCount){
alpha = 0;
this.parent.removeChild(this);
};
gotoAndStop((pCurrentAnim + 1));
pCurrentAnim++;
pLastAnim = getTimer();
};
};
}
}
}//package
Section 24
//script_blood (script_blood)
package {
import flash.display.*;
import flash.events.*;
public class script_blood extends MovieClip {
public var pLife:int;// = 50
public var pPaused:Boolean;// = false
public function script_blood():void{
pPaused = false;
pLife = 50;
super();
addEventListener(Event.ENTER_FRAME, everytime);
}
public function moveenemy(){
rotation = (rotation + 1);
pLife = (pLife - 1);
alpha = (alpha - 0.1);
}
public function everytime(_arg1:Event):void{
if (pPaused == false){
moveenemy();
};
}
}
}//package
Section 25
//script_bullet_carrot (script_bullet_carrot)
package {
import flash.display.*;
import flash.events.*;
public class script_bullet_carrot extends MovieClip {
public var pBulletType:Number;// = 3
public var pTarget:Number;// = -1
public var pTargetX:Number;// = -1
public var pTargetY:Number;// = -1
public var pLastAnim:int;// = 0
public var pAnimDelay:int;// = 50
public var pBullet:script_bullet_carrot;
public var pCurrentAnim:int;// = 0
public var pSpeed:Number;// = 220
public var pPaused:Boolean;// = false
public var pVisible:Boolean;// = false
public var pAnimCount:int;// = 6
public var pSoldier:int;// = -1
public var pDamage:Number;// = 1
public function script_bullet_carrot():void{
pBulletType = 3;
pDamage = 1;
pSpeed = 220;
pTargetX = -1;
pTargetY = -1;
pTarget = -1;
pVisible = false;
pSoldier = -1;
pLastAnim = 0;
pAnimDelay = 50;
pAnimCount = 6;
pCurrentAnim = 0;
pPaused = false;
super();
gotoAndStop(0);
addEventListener(Event.ENTER_FRAME, everytime);
}
public function movebullet(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
rotation = GetAngle(pTargetX, pTargetY);
_local4 = ((2 * Math.PI) * (rotation / 360));
_local5 = (pSpeed * Math.cos(_local4));
_local6 = (pSpeed * Math.sin(_local4));
x = (x + (_local5 * Tick.ftime));
y = (y + (_local6 * Tick.ftime));
}
function GetAngle(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = (_arg1 - x);
_local4 = (_arg2 - y);
_local5 = Math.atan2(_local4, _local3);
_local6 = (360 * (_local5 / (2 * Math.PI)));
return (_local6);
}
public function everytime(_arg1:Event):void{
if (pPaused == false){
};
}
}
}//package
Section 26
//script_bullet_grenacorn (script_bullet_grenacorn)
package {
import flash.display.*;
import flash.events.*;
public class script_bullet_grenacorn extends Sprite {
public var pBulletType:Number;// = 1
public var pTarget:Number;// = -1
public var pTargetX:Number;// = -1
public var pTargetY:Number;// = -1
public var pOrigHeight:int;// = 24
public var pOrigWidth:int;// = 24
public var pBullet:script_bullet_grenacorn;
public var pSpeed:Number;// = 180
public var pTravelDistance:Number;// = 0
public var pVisible:Boolean;// = false
public var pSoldier:int;// = -1
public var pDamage:Number;// = 1
public function script_bullet_grenacorn():void{
pBulletType = 1;
pDamage = 1;
pSpeed = 180;
pTargetX = -1;
pTargetY = -1;
pTarget = -1;
pVisible = false;
pSoldier = -1;
pOrigWidth = 24;
pOrigHeight = 24;
pTravelDistance = 0;
super();
addEventListener(Event.ENTER_FRAME, everytime);
}
public function movebullet(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
rotation = GetAngle(pTargetX, pTargetY);
_local1 = ((2 * Math.PI) * (rotation / 360));
_local2 = (pSpeed * Math.cos(_local1));
_local3 = (pSpeed * Math.sin(_local1));
x = (x + (_local2 * Tick.ftime));
y = (y + (_local3 * Tick.ftime));
}
function GetAngle(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = (_arg1 - x);
_local4 = (_arg2 - y);
_local5 = Math.atan2(_local4, _local3);
_local6 = (360 * (_local5 / (2 * Math.PI)));
return (_local6);
}
public function everytime(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = Math.round((x - pTargetX));
_local3 = Math.round((y - pTargetY));
_local4 = Math.round(Math.sqrt(((_local2 * _local2) + (_local3 * _local3))));
}
}
}//package
Section 27
//script_bullet_grenadethrower (script_bullet_grenadethrower)
package {
import flash.display.*;
public class script_bullet_grenadethrower extends Sprite {
public var pBulletType:Number;// = 1
public var pTarget:Number;// = -1
public var pTargetX:Number;// = -1
public var pTargetY:Number;// = -1
public var pBullet:script_bullet_grenadethrower;
public var pSpeed:Number;// = 180
public var pVisible:Boolean;// = false
public var pSoldier:int;// = -1
public var pDamage:Number;// = 3
public function script_bullet_grenadethrower():void{
pBulletType = 1;
pDamage = 3;
pSpeed = 180;
pTargetX = -1;
pTargetY = -1;
pTarget = -1;
pVisible = false;
pSoldier = -1;
super();
}
public function movebullet(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
rotation = GetAngle(pTargetX, pTargetY);
_local1 = ((2 * Math.PI) * (rotation / 360));
_local2 = (pSpeed * Math.cos(_local1));
_local3 = (pSpeed * Math.sin(_local1));
x = (x + (_local2 * Tick.ftime));
y = (y + (_local3 * Tick.ftime));
}
function GetAngle(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = (_arg1 - x);
_local4 = (_arg2 - y);
_local5 = Math.atan2(_local4, _local3);
_local6 = (360 * (_local5 / (2 * Math.PI)));
return (_local6);
}
}
}//package
Section 28
//script_bullet_machinegunner (script_bullet_machinegunner)
package {
import flash.display.*;
public class script_bullet_machinegunner extends Sprite {
public var pBulletType:Number;// = 2
public var pTarget:Number;// = -1
public var pTargetX:Number;// = -1
public var pTargetY:Number;// = -1
public var pBullet:script_bullet_machinegunner;
public var pSpeed:Number;// = 180
public var pVisible:Boolean;// = false
public var pSoldier:int;// = -1
public var pDamage:Number;// = 1
public function script_bullet_machinegunner():void{
pBulletType = 2;
pDamage = 1;
pSpeed = 180;
pTargetX = -1;
pTargetY = -1;
pTarget = -1;
pVisible = false;
pSoldier = -1;
super();
}
public function movebullet(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
rotation = GetAngle(pTargetX, pTargetY);
_local1 = ((2 * Math.PI) * (rotation / 360));
_local2 = (pSpeed * Math.cos(_local1));
_local3 = (pSpeed * Math.sin(_local1));
x = (x + (_local2 * Tick.ftime));
y = (y + (_local3 * Tick.ftime));
}
function GetAngle(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = (_arg1 - x);
_local4 = (_arg2 - y);
_local5 = Math.atan2(_local4, _local3);
_local6 = (360 * (_local5 / (2 * Math.PI)));
return (_local6);
}
}
}//package
Section 29
//script_bullet_rifleman (script_bullet_rifleman)
package {
import flash.display.*;
public class script_bullet_rifleman extends Sprite {
public var pBulletType:Number;// = 1
public var pTarget:Number;// = -1
public var pTargetX:Number;// = -1
public var pTargetY:Number;// = -1
public var pBullet:script_bullet_rifleman;
public var pSpeed:Number;// = 180
public var pVisible:Boolean;// = false
public var pSoldier:int;// = -1
public var pDamage:Number;// = 3
public function script_bullet_rifleman():void{
pBulletType = 1;
pDamage = 3;
pSpeed = 180;
pTargetX = -1;
pTargetY = -1;
pTarget = -1;
pVisible = false;
pSoldier = -1;
super();
}
public function movebullet(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
rotation = GetAngle(pTargetX, pTargetY);
_local1 = ((2 * Math.PI) * (rotation / 360));
_local2 = (pSpeed * Math.cos(_local1));
_local3 = (pSpeed * Math.sin(_local1));
x = (x + (_local2 * Tick.ftime));
y = (y + (_local3 * Tick.ftime));
}
function GetAngle(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = (_arg1 - x);
_local4 = (_arg2 - y);
_local5 = Math.atan2(_local4, _local3);
_local6 = (360 * (_local5 / (2 * Math.PI)));
return (_local6);
}
}
}//package
Section 30
//script_bullet_shotgun (script_bullet_shotgun)
package {
import flash.display.*;
public class script_bullet_shotgun extends Sprite {
public var pBulletType:Number;// = 5
public var pTarget:Number;// = -1
public var pTargetX:Number;// = -1
public var pTargetY:Number;// = -1
public var pBullet:script_bullet_shotgun;
public var pSpeed:Number;// = 180
public var pVisible:Boolean;// = false
public var pSoldier:int;// = -1
public var pDamage:Number;// = 5
public function script_bullet_shotgun():void{
pBulletType = 5;
pDamage = 5;
pSpeed = 180;
pTargetX = -1;
pTargetY = -1;
pTarget = -1;
pVisible = false;
pSoldier = -1;
super();
}
public function movebullet(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
rotation = GetAngle(pTargetX, pTargetY);
_local1 = ((2 * Math.PI) * (rotation / 360));
_local2 = (pSpeed * Math.cos(_local1));
_local3 = (pSpeed * Math.sin(_local1));
x = (x + (_local2 * Tick.ftime));
y = (y + (_local3 * Tick.ftime));
}
function GetAngle(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = (_arg1 - x);
_local4 = (_arg2 - y);
_local5 = Math.atan2(_local4, _local3);
_local6 = (360 * (_local5 / (2 * Math.PI)));
return (_local6);
}
}
}//package
Section 31
//script_bullet_sniper (script_bullet_sniper)
package {
import flash.display.*;
public class script_bullet_sniper extends Sprite {
public var pBulletType:Number;// = 3
public var pTarget:Number;// = -1
public var pTargetX:Number;// = -1
public var pTargetY:Number;// = -1
public var pBullet:script_bullet_sniper;
public var pSpeed:Number;// = 200
public var pVisible:Boolean;// = false
public var pSoldier:int;// = -1
public var pDamage:Number;// = 1
public function script_bullet_sniper():void{
pBulletType = 3;
pDamage = 1;
pSpeed = 200;
pTargetX = -1;
pTargetY = -1;
pTarget = -1;
pVisible = false;
pSoldier = -1;
super();
}
public function movebullet(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
rotation = GetAngle(pTargetX, pTargetY);
_local1 = ((2 * Math.PI) * (rotation / 360));
_local2 = (pSpeed * Math.cos(_local1));
_local3 = (pSpeed * Math.sin(_local1));
x = (x + (_local2 * Tick.ftime));
y = (y + (_local3 * Tick.ftime));
}
function GetAngle(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = (_arg1 - x);
_local4 = (_arg2 - y);
_local5 = Math.atan2(_local4, _local3);
_local6 = (360 * (_local5 / (2 * Math.PI)));
return (_local6);
}
}
}//package
Section 32
//script_bullet_specialforces (script_bullet_specialforces)
package {
import flash.display.*;
public class script_bullet_specialforces extends Sprite {
public var pBulletType:int;// = 4
public var pTarget:int;// = -1
public var pTargetX:int;// = -1
public var pTargetY:int;// = -1
public var pBullet:script_bullet_specialforces;
public var pSpeed:int;// = 200
public var pVisible:Boolean;// = false
public var pSoldier:int;// = -1
public var pDamage:int;// = 1
public function script_bullet_specialforces():void{
pBulletType = 4;
pDamage = 1;
pSpeed = 200;
pTargetX = -1;
pTargetY = -1;
pTarget = -1;
pVisible = false;
pSoldier = -1;
super();
}
public function movebullet(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
rotation = GetAngle(pTargetX, pTargetY);
_local1 = ((2 * Math.PI) * (rotation / 360));
_local2 = (pSpeed * Math.cos(_local1));
_local3 = (pSpeed * Math.sin(_local1));
x = (x + (_local2 * Tick.ftime));
y = (y + (_local3 * Tick.ftime));
}
function GetAngle(_arg1:int, _arg2:int):Number{
var _local3:int;
var _local4:int;
var _local5:Number;
var _local6:Number;
_local3 = (_arg1 - x);
_local4 = (_arg2 - y);
_local5 = Math.atan2(_local4, _local3);
_local6 = (360 * (_local5 / (2 * Math.PI)));
return (_local6);
}
}
}//package
Section 33
//script_carrotexplosion (script_carrotexplosion)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class script_carrotexplosion extends MovieClip {
public var pLastAnim:int;// = 0
public var pAnimDelay:int;// = 50
public var pCurrentAnim:int;// = 0
public var pPaused:Boolean;// = false
public var pAnimCount:int;// = 9
public function script_carrotexplosion():void{
pPaused = false;
pLastAnim = 0;
pAnimDelay = 50;
pAnimCount = 9;
pCurrentAnim = 0;
super();
addEventListener(Event.ENTER_FRAME, everytime);
}
public function everytime(_arg1:Event):void{
if (pPaused == false){
if (getTimer() > (pLastAnim + pAnimDelay)){
if (pCurrentAnim == pAnimCount){
alpha = 0;
this.parent.removeChild(this);
};
gotoAndStop((pCurrentAnim + 1));
pCurrentAnim++;
pLastAnim = getTimer();
};
};
}
}
}//package
Section 34
//script_chopper_shot (script_chopper_shot)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class script_chopper_shot extends MovieClip {
public var pBulletType:int;// = 10
public var pLastAnim:int;// = 0
public var pAnimDelay:int;// = 100
public var pCurrentAnim:int;// = 0
public var pPaused:Boolean;// = false
public var pAnimCount:int;// = 7
public var pDamage:int;// = 75
public function script_chopper_shot():void{
pDamage = 75;
pBulletType = 10;
pPaused = false;
pLastAnim = 0;
pAnimDelay = 100;
pAnimCount = 7;
pCurrentAnim = 0;
super();
addEventListener(Event.ENTER_FRAME, everytime);
}
public function everytime(_arg1:Event):void{
if (pPaused == false){
if (getTimer() > (pLastAnim + pAnimDelay)){
if (pCurrentAnim == pAnimCount){
alpha = 0;
this.parent.removeChild(this);
};
gotoAndStop((pCurrentAnim + 1));
pCurrentAnim++;
pLastAnim = getTimer();
};
};
}
}
}//package
Section 35
//script_enemy_grenadethrower (script_enemy_grenadethrower)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.geom.*;
public class script_enemy_grenadethrower extends MovieClip {
public var pHealth:Number;// = 75
public var pDamage:int;// = 8
public var pPathIndex:int;// = 0
public var pTarget:int;// = -1
public var pLastAnim:int;// = 0
public var pFireDelay:int;// = 1200
public var pAnimDelay:int;// = 100
public var pLastFire:int;// = 0
public var pCurrentAnim:int;// = 0
public var pMoveDelay:int;// = 1000
public var pTheDirection:Number;// = 1
public var pPath:Array;
public var pSpeed:Number;// = 25
public var pOffsetY:int;// = 0
public var pPaused:Boolean;// = false
public var pType:Number;// = 1
public var pStartHealth:Number;// = 75
public var pRange:int;// = 250
public var pMoving:Boolean;// = true
public var pAnimCount:int;// = 3
public var pOrigSpeed:Number;// = 1.1
public var pEnemy:script_enemy_grenadethrower;
public function script_enemy_grenadethrower(_arg1:Number, _arg2:Number, _arg3:String, _arg4:int):void{
var _local5:String;
pTheDirection = 1;
pType = 1;
pStartHealth = 75;
pHealth = 75;
pSpeed = 25;
pOrigSpeed = 1.1;
pPaused = false;
pPathIndex = 0;
pOffsetY = 0;
pMoving = true;
pFireDelay = 1200;
pLastFire = 0;
pDamage = 8;
pRange = 250;
pTarget = -1;
pMoveDelay = 1000;
pLastAnim = 0;
pAnimDelay = 100;
pAnimCount = 3;
pCurrentAnim = 0;
super();
_local5 = _arg3;
if (_local5 == "normal"){
pStartHealth = (50 + (_arg4 * 7));
pHealth = pStartHealth;
};
if (_local5 == "hard"){
pStartHealth = 75;
pHealth = pStartHealth;
};
if (_local5 == "insane"){
pStartHealth = 100;
pHealth = pStartHealth;
};
x = 275;
y = (_arg2 - ((_arg1 * 32) + 16));
addEventListener(Event.ENTER_FRAME, everytime);
}
public function mapchange():void{
pPathIndex = 0;
}
public function CheckPath(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
if (pPathIndex <= (pPath.length - 1)){
_local1 = Math.round((x - ((pPath[pPathIndex][1] * 32) + 16)));
_local2 = Math.round((y - ((pPath[pPathIndex][0] * 32) + 16)));
_local3 = Math.round(Math.sqrt(((_local1 * _local1) + (_local2 * _local2))));
if (_local3 < 5){
pPathIndex++;
};
};
}
function GetAngle(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = (_arg1 - x);
_local4 = (_arg2 - y);
_local5 = Math.atan2(_local4, _local3);
_local6 = (360 * (_local5 / (2 * Math.PI)));
return (_local6);
}
public function moveenemy(){
var _local1:*;
var _local2:int;
if (pPath == null){
if (pTheDirection == 1){
y = (y + pSpeed);
};
if (pTheDirection == 2){
x = (x + pSpeed);
};
if (pTheDirection == 3){
x = (x - pSpeed);
};
if (pTheDirection == 4){
y = (y - pSpeed);
};
} else {
if (pPathIndex <= (pPath.length - 1)){
_local1 = pPath[pPathIndex][1];
_local2 = pPath[pPathIndex][0];
moveenemy1(((_local2 * 32) + 10), ((_local1 * 32) + 10));
} else {
moveenemy1(3000, ((14 * 32) + 16));
};
};
}
public function everytime(_arg1:Event):void{
var _local2:Point;
if (pPaused == false){
if (pMoving == true){
moveenemy();
if (pSpeed < pOrigSpeed){
pSpeed = (pSpeed + 0.01);
};
};
if (pPathIndex != pPath.length){
if (pMoving == true){
if (getTimer() > (pLastAnim + pAnimDelay)){
if (pCurrentAnim == pAnimCount){
pCurrentAnim = -1;
};
gotoAndStop((pCurrentAnim + 1));
pCurrentAnim++;
pLastAnim = getTimer();
};
};
};
if (pMoving == false){
gotoAndStop(4);
};
};
}
public function GotHit(_arg1:Number, _arg2:int):void{
pHealth = (pHealth - _arg1);
}
public function moveenemy1(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
_local6 = _arg2;
_local7 = _arg1;
rotation = GetAngle(_local6, _local7);
_local11 = ((2 * Math.PI) * (rotation / 360));
_local12 = (pSpeed * Math.cos(_local11));
_local13 = (pSpeed * Math.sin(_local11));
x = (x + (_local12 * Tick.ftime));
y = (y + (_local13 * Tick.ftime));
rotation = 90;
if (pPathIndex <= (pPath.length - 1)){
_local8 = Math.round((x - ((pPath[pPathIndex][1] * 32) + 10)));
_local9 = Math.round((y - ((pPath[pPathIndex][0] * 32) + 10)));
_local10 = Math.round(Math.sqrt(((_local8 * _local8) + (_local9 * _local9))));
if (_local10 < 3){
pPathIndex++;
};
};
}
}
}//package
Section 36
//script_enemy_shotgun (script_enemy_shotgun)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.geom.*;
public class script_enemy_shotgun extends MovieClip {
public var pHealth:Number;// = 100
public var pDamage:int;// = 5
public var pPathIndex:int;// = 0
public var pTarget:int;// = -1
public var pLastAnim:int;// = 0
public var pFireDelay:int;// = 450
public var pAnimDelay:int;// = 100
public var pLastFire:int;// = 0
public var pCurrentAnim:int;// = 0
public var pMoveDelay:int;// = 1500
public var pTheDirection:Number;// = 1
public var pPath:Array;
public var pSpeed:Number;// = 22
public var pOffsetY:int;// = 0
public var pPaused:Boolean;// = false
public var pType:Number;// = 2
public var pStartHealth:Number;// = 100
public var pRange:int;// = 250
public var pMoving:Boolean;// = true
public var pAnimCount:int;// = 3
public var pOrigSpeed:Number;// = 1
public var pEnemy:script_enemy_shotgun;
public function script_enemy_shotgun(_arg1:Number, _arg2:Number, _arg3:String, _arg4:int):void{
var _local5:String;
pTheDirection = 1;
pType = 2;
pStartHealth = 100;
pHealth = 100;
pSpeed = 22;
pOrigSpeed = 1;
pPaused = false;
pPathIndex = 0;
pOffsetY = 0;
pMoving = true;
pFireDelay = 450;
pLastFire = 0;
pDamage = 5;
pRange = 250;
pTarget = -1;
pMoveDelay = 1500;
pLastAnim = 0;
pAnimDelay = 100;
pAnimCount = 3;
pCurrentAnim = 0;
super();
_local5 = _arg3;
if (_local5 == "normal"){
pStartHealth = (50 + (_arg4 * 7));
pHealth = pStartHealth;
};
if (_local5 == "hard"){
pStartHealth = 75;
pHealth = pStartHealth;
};
if (_local5 == "insane"){
pStartHealth = 100;
pHealth = pStartHealth;
};
x = 275;
y = (_arg2 - ((_arg1 * 32) + 16));
addEventListener(Event.ENTER_FRAME, everytime);
}
public function mapchange():void{
pPathIndex = 0;
}
public function CheckPath(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
if (pPathIndex <= (pPath.length - 1)){
_local1 = Math.round((x - ((pPath[pPathIndex][1] * 32) + 16)));
_local2 = Math.round((y - ((pPath[pPathIndex][0] * 32) + 16)));
_local3 = Math.round(Math.sqrt(((_local1 * _local1) + (_local2 * _local2))));
if (_local3 < 5){
pPathIndex++;
};
};
}
function GetAngle(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = (_arg1 - x);
_local4 = (_arg2 - y);
_local5 = Math.atan2(_local4, _local3);
_local6 = (360 * (_local5 / (2 * Math.PI)));
return (_local6);
}
public function moveenemy(){
var _local1:*;
var _local2:int;
if (pPath == null){
if (pTheDirection == 1){
y = (y + pSpeed);
};
if (pTheDirection == 2){
x = (x + pSpeed);
};
if (pTheDirection == 3){
x = (x - pSpeed);
};
if (pTheDirection == 4){
y = (y - pSpeed);
};
} else {
if (pPathIndex <= (pPath.length - 1)){
_local1 = pPath[pPathIndex][1];
_local2 = pPath[pPathIndex][0];
moveenemy1(((_local2 * 32) + 10), ((_local1 * 32) + 10));
} else {
moveenemy1(3000, ((14 * 32) + 16));
};
};
}
public function everytime(_arg1:Event):void{
var _local2:Point;
if (pPaused == false){
if (pMoving == true){
moveenemy();
if (pSpeed < pOrigSpeed){
pSpeed = (pSpeed + 0.01);
};
};
if (pPathIndex != pPath.length){
if (pMoving == true){
if (getTimer() > (pLastAnim + pAnimDelay)){
if (pCurrentAnim == pAnimCount){
pCurrentAnim = -1;
};
gotoAndStop((pCurrentAnim + 1));
pCurrentAnim++;
pLastAnim = getTimer();
};
};
};
if (pMoving == false){
gotoAndStop(4);
};
};
}
public function GotHit(_arg1:Number, _arg2:int):void{
pHealth = (pHealth - _arg1);
}
public function moveenemy1(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
_local6 = _arg2;
_local7 = _arg1;
rotation = GetAngle(_local6, _local7);
_local11 = ((2 * Math.PI) * (rotation / 360));
_local12 = (pSpeed * Math.cos(_local11));
_local13 = (pSpeed * Math.sin(_local11));
x = (x + (_local12 * Tick.ftime));
y = (y + (_local13 * Tick.ftime));
rotation = 90;
if (pPathIndex <= (pPath.length - 1)){
_local8 = Math.round((x - ((pPath[pPathIndex][1] * 32) + 10)));
_local9 = Math.round((y - ((pPath[pPathIndex][0] * 32) + 10)));
_local10 = Math.round(Math.sqrt(((_local8 * _local8) + (_local9 * _local9))));
if (_local10 < 3){
pPathIndex++;
};
};
}
}
}//package
Section 37
//script_enemy_sniper (script_enemy_sniper)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.geom.*;
public class script_enemy_sniper extends MovieClip {
public var pHealth:Number;// = 50
public var pDamage:int;// = 15
public var pPathIndex:int;// = 0
public var pTarget:int;// = -1
public var pLastAnim:int;// = 0
public var pFireDelay:int;// = 3500
public var pAnimDelay:int;// = 100
public var pLastFire:int;// = 0
public var pCurrentAnim:int;// = 0
public var pMoveDelay:int;// = 2000
public var pTheDirection:Number;// = 1
public var pPath:Array;
public var pSpeed:Number;// = 30
public var pOffsetY:int;// = 0
public var pPaused:Boolean;// = false
public var pType:Number;// = 3
public var pStartHealth:Number;// = 50
public var pRange:int;// = 300
public var pMoving:Boolean;// = true
public var pAnimCount:int;// = 3
public var pOrigSpeed:Number;// = 1.2
public var pEnemy:script_enemy_sniper;
public function script_enemy_sniper(_arg1:Number, _arg2:Number, _arg3:String, _arg4:int):void{
var _local5:String;
pTheDirection = 1;
pType = 3;
pStartHealth = 50;
pHealth = 50;
pSpeed = 30;
pOrigSpeed = 1.2;
pPaused = false;
pPathIndex = 0;
pOffsetY = 0;
pMoving = true;
pFireDelay = 3500;
pLastFire = 0;
pDamage = 15;
pRange = 300;
pTarget = -1;
pMoveDelay = 2000;
pLastAnim = 0;
pAnimDelay = 100;
pAnimCount = 3;
pCurrentAnim = 0;
super();
_local5 = _arg3;
if (_local5 == "normal"){
pStartHealth = (50 + (_arg4 * 7));
pHealth = pStartHealth;
};
if (_local5 == "hard"){
pStartHealth = 75;
pHealth = pStartHealth;
};
if (_local5 == "insane"){
pStartHealth = 100;
pHealth = pStartHealth;
};
x = 275;
y = (_arg2 - ((_arg1 * 32) + 16));
addEventListener(Event.ENTER_FRAME, everytime);
}
public function mapchange():void{
pPathIndex = 0;
}
public function CheckPath(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
if (pPathIndex <= (pPath.length - 1)){
_local1 = Math.round((x - ((pPath[pPathIndex][1] * 32) + 16)));
_local2 = Math.round((y - ((pPath[pPathIndex][0] * 32) + 16)));
_local3 = Math.round(Math.sqrt(((_local1 * _local1) + (_local2 * _local2))));
if (_local3 < 5){
pPathIndex++;
};
};
}
function GetAngle(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = (_arg1 - x);
_local4 = (_arg2 - y);
_local5 = Math.atan2(_local4, _local3);
_local6 = (360 * (_local5 / (2 * Math.PI)));
return (_local6);
}
public function moveenemy(){
var _local1:*;
var _local2:int;
if (pPath == null){
if (pTheDirection == 1){
y = (y + pSpeed);
};
if (pTheDirection == 2){
x = (x + pSpeed);
};
if (pTheDirection == 3){
x = (x - pSpeed);
};
if (pTheDirection == 4){
y = (y - pSpeed);
};
} else {
if (pPathIndex <= (pPath.length - 1)){
_local1 = pPath[pPathIndex][1];
_local2 = pPath[pPathIndex][0];
moveenemy1(((_local2 * 32) + 10), ((_local1 * 32) + 10));
} else {
moveenemy1(3000, ((14 * 32) + 16));
};
};
}
public function everytime(_arg1:Event):void{
var _local2:Point;
if (pPaused == false){
if (pMoving == true){
moveenemy();
if (pSpeed < pOrigSpeed){
pSpeed = (pSpeed + 0.01);
};
};
if (pPathIndex != pPath.length){
if (pMoving == true){
if (getTimer() > (pLastAnim + pAnimDelay)){
if (pCurrentAnim == pAnimCount){
pCurrentAnim = -1;
};
gotoAndStop((pCurrentAnim + 1));
pCurrentAnim++;
pLastAnim = getTimer();
};
};
};
if (pMoving == false){
gotoAndStop(4);
};
};
}
public function GotHit(_arg1:Number, _arg2:int):void{
pHealth = (pHealth - _arg1);
}
public function moveenemy1(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
_local6 = _arg2;
_local7 = _arg1;
rotation = GetAngle(_local6, _local7);
_local11 = ((2 * Math.PI) * (rotation / 360));
_local12 = (pSpeed * Math.cos(_local11));
_local13 = (pSpeed * Math.sin(_local11));
x = (x + (_local12 * Tick.ftime));
y = (y + (_local13 * Tick.ftime));
rotation = 90;
if (pPathIndex <= (pPath.length - 1)){
_local8 = Math.round((x - ((pPath[pPathIndex][1] * 32) + 10)));
_local9 = Math.round((y - ((pPath[pPathIndex][0] * 32) + 10)));
_local10 = Math.round(Math.sqrt(((_local8 * _local8) + (_local9 * _local9))));
if (_local10 < 3){
pPathIndex++;
};
};
}
}
}//package
Section 38
//script_enemy_specialforces (script_enemy_specialforces)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.geom.*;
public class script_enemy_specialforces extends MovieClip {
public var pHealth:Number;// = 150
public var pDamage:int;// = 8
public var pPathIndex:int;// = 0
public var pTarget:int;// = -1
public var pLastAnim:int;// = 0
public var pFireDelay:int;// = 600
public var pAnimDelay:int;// = 100
public var pLastFire:int;// = 0
public var pCurrentAnim:int;// = 0
public var pMoveDelay:int;// = 1500
public var pTheDirection:Number;// = 1
public var pPath:Array;
public var pSpeed:Number;// = 28
public var pOffsetY:int;// = 0
public var pPaused:Boolean;// = false
public var pType:Number;// = 4
public var pStartHealth:Number;// = 150
public var pRange:int;// = 250
public var pMoving:Boolean;// = true
public var pAnimCount:int;// = 3
public var pOrigSpeed:Number;// = 1.3
public var pEnemy:script_enemy_specialforces;
public function script_enemy_specialforces(_arg1:Number, _arg2:Number, _arg3:String, _arg4:int):void{
var _local5:String;
pTheDirection = 1;
pType = 4;
pStartHealth = 150;
pHealth = 150;
pSpeed = 28;
pOrigSpeed = 1.3;
pPaused = false;
pPathIndex = 0;
pOffsetY = 0;
pMoving = true;
pFireDelay = 600;
pLastFire = 0;
pDamage = 8;
pRange = 250;
pTarget = -1;
pMoveDelay = 1500;
pLastAnim = 0;
pAnimDelay = 100;
pAnimCount = 3;
pCurrentAnim = 0;
super();
_local5 = _arg3;
if (_local5 == "normal"){
pStartHealth = (50 + (_arg4 * 7));
pHealth = pStartHealth;
};
if (_local5 == "hard"){
pStartHealth = 75;
pHealth = pStartHealth;
};
if (_local5 == "insane"){
pStartHealth = 100;
pHealth = pStartHealth;
};
x = 275;
y = (_arg2 - ((_arg1 * 32) + 16));
addEventListener(Event.ENTER_FRAME, everytime);
}
public function mapchange():void{
pPathIndex = 0;
}
public function CheckPath(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
if (pPathIndex <= (pPath.length - 1)){
_local1 = Math.round((x - ((pPath[pPathIndex][1] * 32) + 16)));
_local2 = Math.round((y - ((pPath[pPathIndex][0] * 32) + 16)));
_local3 = Math.round(Math.sqrt(((_local1 * _local1) + (_local2 * _local2))));
if (_local3 < 5){
pPathIndex++;
};
};
}
function GetAngle(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = (_arg1 - x);
_local4 = (_arg2 - y);
_local5 = Math.atan2(_local4, _local3);
_local6 = (360 * (_local5 / (2 * Math.PI)));
return (_local6);
}
public function moveenemy(){
var _local1:*;
var _local2:int;
if (pPath == null){
if (pTheDirection == 1){
y = (y + pSpeed);
};
if (pTheDirection == 2){
x = (x + pSpeed);
};
if (pTheDirection == 3){
x = (x - pSpeed);
};
if (pTheDirection == 4){
y = (y - pSpeed);
};
} else {
if (pPathIndex <= (pPath.length - 1)){
_local1 = pPath[pPathIndex][1];
_local2 = pPath[pPathIndex][0];
moveenemy1(((_local2 * 32) + 10), ((_local1 * 32) + 10));
} else {
moveenemy1(3000, ((14 * 32) + 16));
};
};
}
public function everytime(_arg1:Event):void{
var _local2:Point;
if (pPaused == false){
if (pMoving == true){
moveenemy();
if (pSpeed < pOrigSpeed){
pSpeed = (pSpeed + 0.01);
};
};
if (pPathIndex != pPath.length){
if (pMoving == true){
if (getTimer() > (pLastAnim + pAnimDelay)){
if (pCurrentAnim == pAnimCount){
pCurrentAnim = -1;
};
gotoAndStop((pCurrentAnim + 1));
pCurrentAnim++;
pLastAnim = getTimer();
};
};
};
if (pMoving == false){
gotoAndStop(4);
};
};
}
public function GotHit(_arg1:Number, _arg2:int):void{
pHealth = (pHealth - _arg1);
}
public function moveenemy1(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
_local6 = _arg2;
_local7 = _arg1;
rotation = GetAngle(_local6, _local7);
_local11 = ((2 * Math.PI) * (rotation / 360));
_local12 = (pSpeed * Math.cos(_local11));
_local13 = (pSpeed * Math.sin(_local11));
x = (x + (_local12 * Tick.ftime));
y = (y + (_local13 * Tick.ftime));
rotation = 90;
if (pPathIndex <= (pPath.length - 1)){
_local8 = Math.round((x - ((pPath[pPathIndex][1] * 32) + 10)));
_local9 = Math.round((y - ((pPath[pPathIndex][0] * 32) + 10)));
_local10 = Math.round(Math.sqrt(((_local8 * _local8) + (_local9 * _local9))));
if (_local10 < 3){
pPathIndex++;
};
};
}
}
}//package
Section 39
//script_grenacorn_explosion (script_grenacorn_explosion)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class script_grenacorn_explosion extends MovieClip {
public var pLastAnim:int;// = 0
public var pAnimDelay:int;// = 50
public var pCurrentAnim:int;// = 0
public var pPaused:Boolean;// = false
public var pAnimCount:int;// = 14
public function script_grenacorn_explosion():void{
pPaused = false;
pLastAnim = 0;
pAnimDelay = 50;
pAnimCount = 14;
pCurrentAnim = 0;
super();
addEventListener(Event.ENTER_FRAME, everytime);
}
public function everytime(_arg1:Event):void{
if (pPaused == false){
if (getTimer() > (pLastAnim + pAnimDelay)){
if (pCurrentAnim == pAnimCount){
alpha = 0;
this.parent.removeChild(this);
};
gotoAndStop((pCurrentAnim + 1));
pCurrentAnim++;
pLastAnim = getTimer();
};
};
}
}
}//package
Section 40
//script_gunsmoke (script_gunsmoke)
package {
import flash.display.*;
import flash.events.*;
public class script_gunsmoke extends MovieClip {
public var pLife:int;// = 10
public var pPaused:Boolean;// = false
public function script_gunsmoke():void{
pPaused = false;
pLife = 10;
super();
addEventListener(Event.ENTER_FRAME, everytime);
}
public function moveenemy(){
y = (y - ((Math.random() * 10) * Tick.ftime));
x = (x + ((Math.random() * 10) * Tick.ftime));
rotation = (rotation + 1);
pLife = (pLife - 1);
alpha = (alpha - (5 * Tick.ftime));
}
public function everytime(_arg1:Event):void{
if (pPaused == false){
moveenemy();
};
}
}
}//package
Section 41
//script_infantry_grenadelauncher (script_infantry_grenadelauncher)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.geom.*;
public class script_infantry_grenadelauncher extends MovieClip {
public var pHealth:Number;// = 75
public var pDamage:int;// = 15
public var pSelected:Boolean;// = false
public var pPathIndex:int;// = 0
public var pTarget:int;// = -1
public var pLastAnim:int;// = 0
public var pFireDelay:int;// = 2000
public var pAnimDelay:int;// = 75
public var pLastFire:int;// = 0
public var pCurrentAnim:int;// = 0
public var pMoveDelay:int;// = 2001
public var pTheDirection:Number;// = 1
public var pPath:Array;
public var pSpeed:Number;// = 25
public var pOffsetY:int;// = 0
public var pPaused:Boolean;// = false
public var pType:Number;// = 1
public var pStartHealth:Number;// = 75
public var pRange:int;// = 275
public var pMoving:Boolean;// = true
public var pAnimCount:int;// = 3
public var pOrigSpeed:Number;// = 1.1
public var pEnemy:script_infantry_grenadelauncher;
public function script_infantry_grenadelauncher(_arg1:Number, _arg2:Number, _arg3:String):void{
var _local4:String;
pTheDirection = 1;
pType = 1;
pStartHealth = 75;
pHealth = 75;
pSpeed = 25;
pOrigSpeed = 1.1;
pPaused = false;
pPathIndex = 0;
pOffsetY = 0;
pMoving = true;
pFireDelay = 2000;
pLastFire = 0;
pDamage = 15;
pRange = 275;
pTarget = -1;
pMoveDelay = 2001;
pSelected = false;
pLastAnim = 0;
pAnimDelay = 75;
pAnimCount = 3;
pCurrentAnim = 0;
super();
_local4 = _arg3;
if (_local4 == "normal"){
pStartHealth = 150;
pHealth = pStartHealth;
};
if (_local4 == "hard"){
pStartHealth = 75;
pHealth = pStartHealth;
};
if (_local4 == "insane"){
pStartHealth = 100;
pHealth = pStartHealth;
};
x = 275;
y = (_arg2 - ((_arg1 * 32) + 16));
addEventListener(Event.ENTER_FRAME, everytime);
addEventListener(MouseEvent.MOUSE_UP, mouseup);
}
public function mouseup(_arg1:MouseEvent):void{
pSelected = true;
}
public function mapchange():void{
pPathIndex = 0;
}
public function CheckPath(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
if (pPathIndex <= (pPath.length - 1)){
_local1 = Math.round((x - ((pPath[pPathIndex][1] * 32) + 16)));
_local2 = Math.round((y - ((pPath[pPathIndex][0] * 32) + 16)));
_local3 = Math.round(Math.sqrt(((_local1 * _local1) + (_local2 * _local2))));
if (_local3 < 5){
pPathIndex++;
};
};
}
function GetAngle(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = (_arg1 - x);
_local4 = (_arg2 - y);
_local5 = Math.atan2(_local4, _local3);
_local6 = (360 * (_local5 / (2 * Math.PI)));
return (_local6);
}
public function moveenemy(){
var _local1:*;
var _local2:int;
if (pPath == null){
if (pTheDirection == 1){
y = (y + pSpeed);
};
if (pTheDirection == 2){
x = (x + pSpeed);
};
if (pTheDirection == 3){
x = (x - pSpeed);
};
if (pTheDirection == 4){
y = (y - pSpeed);
};
} else {
if (pPathIndex <= (pPath.length - 1)){
_local1 = pPath[pPathIndex][1];
_local2 = pPath[pPathIndex][0];
moveenemy1(((_local2 * 32) + 10), ((_local1 * 32) + 10));
} else {
rotation = -90;
};
};
}
public function everytime(_arg1:Event):void{
var _local2:Point;
if (pPaused == false){
if (pMoving == true){
moveenemy();
if (pSpeed < pOrigSpeed){
pSpeed = (pSpeed + 0.01);
};
};
if (pPathIndex != pPath.length){
if (pMoving == true){
if (getTimer() > (pLastAnim + pAnimDelay)){
if (pCurrentAnim == pAnimCount){
pCurrentAnim = -1;
};
gotoAndStop((pCurrentAnim + 1));
pCurrentAnim++;
pLastAnim = getTimer();
};
};
};
if (pMoving == false){
gotoAndStop(4);
};
};
}
public function GotHit(_arg1:Number, _arg2:int):void{
pHealth = (pHealth - _arg1);
}
public function moveenemy1(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
_local6 = _arg2;
_local7 = _arg1;
rotation = GetAngle(_local6, _local7);
_local11 = ((2 * Math.PI) * (rotation / 360));
_local12 = (pSpeed * Math.cos(_local11));
_local13 = (pSpeed * Math.sin(_local11));
x = (x + (_local12 * Tick.ftime));
y = (y + (_local13 * Tick.ftime));
rotation = -90;
if (pPathIndex <= (pPath.length - 1)){
_local8 = Math.round((x - ((pPath[pPathIndex][1] * 32) + 10)));
_local9 = Math.round((y - ((pPath[pPathIndex][0] * 32) + 10)));
_local10 = Math.round(Math.sqrt(((_local8 * _local8) + (_local9 * _local9))));
if (_local10 < 3){
pPathIndex++;
};
};
}
}
}//package
Section 42
//script_infantry_machinegunner (script_infantry_machinegunner)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.geom.*;
public class script_infantry_machinegunner extends MovieClip {
public var pHealth:Number;// = 100
public var pDamage:int;// = 5
public var pSelected:Boolean;// = false
public var pPathIndex:int;// = 0
public var pTarget:int;// = -1
public var pLastAnim:int;// = 0
public var pFireDelay:int;// = 250
public var pAnimDelay:int;// = 75
public var pLastFire:int;// = 0
public var pCurrentAnim:int;// = 0
public var pMoveDelay:int;// = 251
public var pTheDirection:Number;// = 1
public var pPath:Array;
public var pSpeed:Number;// = 25
public var pOffsetY:int;// = 0
public var pPaused:Boolean;// = false
public var pType:Number;// = 2
public var pStartHealth:Number;// = 100
public var pRange:int;// = 250
public var pMoving:Boolean;// = true
public var pAnimCount:int;// = 3
public var pOrigSpeed:Number;// = 1
public var pEnemy:script_infantry_machinegunner;
public function script_infantry_machinegunner(_arg1:Number, _arg2:Number, _arg3:String):void{
var _local4:String;
pTheDirection = 1;
pType = 2;
pStartHealth = 100;
pHealth = 100;
pSpeed = 25;
pOrigSpeed = 1;
pPaused = false;
pPathIndex = 0;
pOffsetY = 0;
pMoving = true;
pFireDelay = 250;
pLastFire = 0;
pDamage = 5;
pRange = 250;
pTarget = -1;
pMoveDelay = 251;
pSelected = false;
pLastAnim = 0;
pAnimDelay = 75;
pAnimCount = 3;
pCurrentAnim = 0;
super();
_local4 = _arg3;
if (_local4 == "normal"){
pStartHealth = 150;
pHealth = pStartHealth;
};
if (_local4 == "hard"){
pStartHealth = 75;
pHealth = pStartHealth;
};
if (_local4 == "insane"){
pStartHealth = 100;
pHealth = pStartHealth;
};
x = 275;
y = (_arg2 - ((_arg1 * 32) + 16));
addEventListener(Event.ENTER_FRAME, everytime);
addEventListener(MouseEvent.MOUSE_UP, mouseup);
}
public function mouseup(_arg1:MouseEvent):void{
pSelected = true;
}
public function mapchange():void{
pPathIndex = 0;
}
public function CheckPath(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
if (pPathIndex <= (pPath.length - 1)){
_local1 = Math.round((x - ((pPath[pPathIndex][1] * 32) + 16)));
_local2 = Math.round((y - ((pPath[pPathIndex][0] * 32) + 16)));
_local3 = Math.round(Math.sqrt(((_local1 * _local1) + (_local2 * _local2))));
if (_local3 < 5){
pPathIndex++;
};
};
}
function GetAngle(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = (_arg1 - x);
_local4 = (_arg2 - y);
_local5 = Math.atan2(_local4, _local3);
_local6 = (360 * (_local5 / (2 * Math.PI)));
return (_local6);
}
public function moveenemy(){
var _local1:*;
var _local2:int;
if (pPath == null){
if (pTheDirection == 1){
y = (y + pSpeed);
};
if (pTheDirection == 2){
x = (x + pSpeed);
};
if (pTheDirection == 3){
x = (x - pSpeed);
};
if (pTheDirection == 4){
y = (y - pSpeed);
};
} else {
if (pPathIndex <= (pPath.length - 1)){
_local1 = pPath[pPathIndex][1];
_local2 = pPath[pPathIndex][0];
moveenemy1(((_local2 * 32) + 10), ((_local1 * 32) + 10));
} else {
rotation = -90;
};
};
}
public function everytime(_arg1:Event):void{
var _local2:Point;
if (pPaused == false){
if (pMoving == true){
moveenemy();
if (pSpeed < pOrigSpeed){
pSpeed = (pSpeed + 0.01);
};
};
if (pPathIndex != pPath.length){
if (pMoving == true){
if (getTimer() > (pLastAnim + pAnimDelay)){
if (pCurrentAnim == pAnimCount){
pCurrentAnim = -1;
};
gotoAndStop((pCurrentAnim + 1));
pCurrentAnim++;
pLastAnim = getTimer();
};
};
};
if (pMoving == false){
gotoAndStop(4);
};
};
}
public function GotHit(_arg1:Number, _arg2:int):void{
pHealth = (pHealth - _arg1);
}
public function moveenemy1(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
_local6 = _arg2;
_local7 = _arg1;
rotation = GetAngle(_local6, _local7);
_local11 = ((2 * Math.PI) * (rotation / 360));
_local12 = (pSpeed * Math.cos(_local11));
_local13 = (pSpeed * Math.sin(_local11));
x = (x + (_local12 * Tick.ftime));
y = (y + (_local13 * Tick.ftime));
rotation = -90;
if (pPathIndex <= (pPath.length - 1)){
_local8 = Math.round((x - ((pPath[pPathIndex][1] * 32) + 10)));
_local9 = Math.round((y - ((pPath[pPathIndex][0] * 32) + 10)));
_local10 = Math.round(Math.sqrt(((_local8 * _local8) + (_local9 * _local9))));
if (_local10 < 3){
pPathIndex++;
};
};
}
}
}//package
Section 43
//script_infantry_sniper (script_infantry_sniper)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.geom.*;
public class script_infantry_sniper extends MovieClip {
public var pHealth:Number;// = 50
public var pDamage:int;// = 50
public var pMoved:Boolean;// = false
public var pSelected:Boolean;// = false
public var pPathIndex:int;// = 0
public var pTarget:int;// = -1
public var pLastAnim:int;// = 0
public var pFireDelay:int;// = 3000
public var pAnimDelay:int;// = 75
public var pLastFire:int;// = 0
public var pCurrentAnim:int;// = 0
public var pMoveDelay:int;// = 3001
public var pTheDirection:Number;// = 1
public var pPath:Array;
public var pSpeed:Number;// = 25
public var pOffsetY:int;// = 0
public var pPaused:Boolean;// = false
public var pType:Number;// = 3
public var pStartHealth:Number;// = 50
public var pRange:int;// = 350
public var pMoving:Boolean;// = true
public var pAnimCount:int;// = 3
public var pOrigSpeed:Number;// = 1.2
public var pEnemy:script_infantry_sniper;
public function script_infantry_sniper(_arg1:Number, _arg2:Number, _arg3:String):void{
var _local4:String;
pTheDirection = 1;
pType = 3;
pStartHealth = 50;
pHealth = 50;
pSpeed = 25;
pOrigSpeed = 1.2;
pPaused = false;
pPathIndex = 0;
pOffsetY = 0;
pMoving = true;
pFireDelay = 3000;
pLastFire = 0;
pDamage = 50;
pRange = 350;
pTarget = -1;
pMoveDelay = 3001;
pMoved = false;
pSelected = false;
pLastAnim = 0;
pAnimDelay = 75;
pAnimCount = 3;
pCurrentAnim = 0;
super();
_local4 = _arg3;
gotoAndStop(0);
if (_local4 == "normal"){
pStartHealth = 150;
pHealth = pStartHealth;
};
if (_local4 == "hard"){
pStartHealth = 75;
pHealth = pStartHealth;
};
if (_local4 == "insane"){
pStartHealth = 100;
pHealth = pStartHealth;
};
x = 275;
y = (_arg2 - ((_arg1 * 32) + 16));
addEventListener(Event.ENTER_FRAME, everytime);
addEventListener(MouseEvent.MOUSE_UP, mouseup);
}
public function mouseup(_arg1:MouseEvent):void{
pSelected = true;
}
public function mapchange():void{
pPathIndex = 0;
}
public function CheckPath(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
if (pPathIndex <= (pPath.length - 1)){
_local1 = Math.round((x - ((pPath[pPathIndex][1] * 32) + 16)));
_local2 = Math.round((y - ((pPath[pPathIndex][0] * 32) + 16)));
_local3 = Math.round(Math.sqrt(((_local1 * _local1) + (_local2 * _local2))));
if (_local3 < 5){
pPathIndex++;
};
};
}
function GetAngle(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = (_arg1 - x);
_local4 = (_arg2 - y);
_local5 = Math.atan2(_local4, _local3);
_local6 = (360 * (_local5 / (2 * Math.PI)));
return (_local6);
}
public function moveenemy(){
var _local1:*;
var _local2:int;
if (pPath == null){
if (pTheDirection == 1){
y = (y + pSpeed);
};
if (pTheDirection == 2){
x = (x + pSpeed);
};
if (pTheDirection == 3){
x = (x - pSpeed);
};
if (pTheDirection == 4){
y = (y - pSpeed);
};
} else {
if (pPathIndex <= (pPath.length - 1)){
_local1 = pPath[pPathIndex][1];
_local2 = pPath[pPathIndex][0];
moveenemy1(((_local2 * 32) + 10), ((_local1 * 32) + 10));
} else {
rotation = -90;
};
};
}
public function everytime(_arg1:Event):void{
var _local2:Point;
if (pPaused == false){
if (pMoving == true){
moveenemy();
if (pSpeed < pOrigSpeed){
pSpeed = (pSpeed + 0.01);
};
};
if (pPathIndex != pPath.length){
if (pMoving == true){
if (getTimer() > (pLastAnim + pAnimDelay)){
if (pCurrentAnim == pAnimCount){
pCurrentAnim = -1;
};
gotoAndStop((pCurrentAnim + 1));
pCurrentAnim++;
pLastAnim = getTimer();
};
};
};
if (pMoving == false){
gotoAndStop(4);
};
};
}
public function GotHit(_arg1:Number, _arg2:int):void{
pHealth = (pHealth - _arg1);
}
public function moveenemy1(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
_local6 = _arg2;
_local7 = _arg1;
rotation = GetAngle(_local6, _local7);
_local11 = ((2 * Math.PI) * (rotation / 360));
_local12 = (pSpeed * Math.cos(_local11));
_local13 = (pSpeed * Math.sin(_local11));
x = (x + (_local12 * Tick.ftime));
y = (y + (_local13 * Tick.ftime));
rotation = -90;
if (pPathIndex <= (pPath.length - 1)){
_local8 = Math.round((x - ((pPath[pPathIndex][1] * 32) + 10)));
_local9 = Math.round((y - ((pPath[pPathIndex][0] * 32) + 10)));
_local10 = Math.round(Math.sqrt(((_local8 * _local8) + (_local9 * _local9))));
if (_local10 < 3){
pPathIndex++;
};
};
}
}
}//package
Section 44
//script_infantry_specialforces (script_infantry_specialforces)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.geom.*;
public class script_infantry_specialforces extends MovieClip {
public var pHealth:Number;// = 150
public var pDamage:int;// = 15
public var pSelected:Boolean;// = false
public var pPathIndex:int;// = 0
public var pTarget:int;// = -1
public var pLastAnim:int;// = 0
public var pFireDelay:int;// = 1000
public var pAnimDelay:int;// = 75
public var pLastFire:int;// = 0
public var pCurrentAnim:int;// = 0
public var pMoveDelay:int;// = 1001
public var pTheDirection:Number;// = 1
public var pPath:Array;
public var pSpeed:Number;// = 27
public var pOffsetY:int;// = 0
public var pPaused:Boolean;// = false
public var pType:Number;// = 4
public var pStartHealth:Number;// = 150
public var pRange:int;// = 275
public var pMoving:Boolean;// = true
public var pAnimCount:int;// = 3
public var pOrigSpeed:Number;// = 1.3
public var pEnemy:script_infantry_specialforces;
public function script_infantry_specialforces(_arg1:Number, _arg2:Number, _arg3:String):void{
var _local4:String;
pTheDirection = 1;
pType = 4;
pStartHealth = 150;
pHealth = 150;
pSpeed = 27;
pOrigSpeed = 1.3;
pPaused = false;
pPathIndex = 0;
pOffsetY = 0;
pMoving = true;
pFireDelay = 1000;
pLastFire = 0;
pDamage = 15;
pRange = 275;
pTarget = -1;
pMoveDelay = 1001;
pSelected = false;
pLastAnim = 0;
pAnimDelay = 75;
pAnimCount = 3;
pCurrentAnim = 0;
super();
_local4 = _arg3;
gotoAndStop(0);
if (_local4 == "normal"){
pStartHealth = 250;
pHealth = pStartHealth;
};
if (_local4 == "hard"){
pStartHealth = 75;
pHealth = pStartHealth;
};
if (_local4 == "insane"){
pStartHealth = 100;
pHealth = pStartHealth;
};
x = 275;
y = (_arg2 + ((_arg1 * 32) + 16));
addEventListener(Event.ENTER_FRAME, everytime);
addEventListener(MouseEvent.MOUSE_UP, mouseup);
}
public function mouseup(_arg1:MouseEvent):void{
pSelected = true;
}
public function mapchange():void{
pPathIndex = 0;
}
public function CheckPath(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
if (pPathIndex <= (pPath.length - 1)){
_local1 = Math.round((x - ((pPath[pPathIndex][1] * 32) + 16)));
_local2 = Math.round((y - ((pPath[pPathIndex][0] * 32) + 16)));
_local3 = Math.round(Math.sqrt(((_local1 * _local1) + (_local2 * _local2))));
if (_local3 < 5){
pPathIndex++;
};
};
}
function GetAngle(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = (_arg1 - x);
_local4 = (_arg2 - y);
_local5 = Math.atan2(_local4, _local3);
_local6 = (360 * (_local5 / (2 * Math.PI)));
return (_local6);
}
public function moveenemy(){
var _local1:*;
var _local2:int;
if (pPath == null){
if (pTheDirection == 1){
y = (y + pSpeed);
};
if (pTheDirection == 2){
x = (x + pSpeed);
};
if (pTheDirection == 3){
x = (x - pSpeed);
};
if (pTheDirection == 4){
y = (y - pSpeed);
};
} else {
if (pPathIndex <= (pPath.length - 1)){
_local1 = pPath[pPathIndex][1];
_local2 = pPath[pPathIndex][0];
moveenemy1(((_local2 * 32) + 10), ((_local1 * 32) + 10));
} else {
rotation = -90;
};
};
}
public function everytime(_arg1:Event):void{
var _local2:Point;
if (pPaused == false){
if (pMoving == true){
moveenemy();
if (pSpeed < pOrigSpeed){
pSpeed = (pSpeed + 0.01);
};
};
if (pPathIndex != pPath.length){
if (pMoving == true){
if (getTimer() > (pLastAnim + pAnimDelay)){
if (pCurrentAnim == pAnimCount){
pCurrentAnim = -1;
};
gotoAndStop((pCurrentAnim + 1));
pCurrentAnim++;
pLastAnim = getTimer();
};
};
};
if (pMoving == false){
gotoAndStop(4);
};
};
}
public function GotHit(_arg1:Number, _arg2:int):void{
pHealth = (pHealth - _arg1);
}
public function moveenemy1(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
_local6 = _arg2;
_local7 = _arg1;
rotation = GetAngle(_local6, _local7);
_local11 = ((2 * Math.PI) * (rotation / 360));
_local12 = (pSpeed * Math.cos(_local11));
_local13 = (pSpeed * Math.sin(_local11));
x = (x + (_local12 * Tick.ftime));
y = (y + (_local13 * Tick.ftime));
rotation = -90;
if (pPathIndex <= (pPath.length - 1)){
_local8 = Math.round((x - ((pPath[pPathIndex][1] * 32) + 10)));
_local9 = Math.round((y - ((pPath[pPathIndex][0] * 32) + 10)));
_local10 = Math.round(Math.sqrt(((_local8 * _local8) + (_local9 * _local9))));
if (_local10 < 3){
pPathIndex++;
};
};
}
}
}//package
Section 45
//script_plane (script_plane)
package {
import flash.display.*;
import flash.events.*;
public class script_plane extends MovieClip {
public var pActive:Boolean;// = false
public var pPaused:Boolean;// = false
public function script_plane():void{
pPaused = false;
pActive = false;
super();
addEventListener(Event.ENTER_FRAME, everytime);
}
public function everytime(_arg1:Event):void{
if (pPaused == false){
if (pActive == true){
x = (x + 5);
};
};
}
}
}//package
Section 46
//script_plane_bomb (script_plane_bomb)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class script_plane_bomb extends MovieClip {
public var pBulletType:int;// = 10
public var pLastAnim:int;// = 0
public var pAnimDelay:int;// = 50
public var pBlowUp:Boolean;// = false
public var pCurrentAnim:int;// = 0
public var pPaused:Boolean;// = false
public var pAnimCount:int;// = 6
public var pDamage:int;// = 100
public function script_plane_bomb():void{
pDamage = 100;
pBulletType = 10;
pPaused = false;
pLastAnim = 0;
pAnimDelay = 50;
pAnimCount = 6;
pCurrentAnim = 0;
pBlowUp = false;
super();
addEventListener(Event.ENTER_FRAME, everytime);
}
public function everytime(_arg1:Event):void{
var _local2:script_artillery_explosion;
width = (width * 0.95);
height = (height * 0.95);
if (pPaused == false){
if (getTimer() > (pLastAnim + pAnimDelay)){
if (pCurrentAnim == pAnimCount){
alpha = 0;
pBlowUp = true;
_local2 = new script_artillery_explosion();
_local2.x = x;
_local2.y = y;
this.parent.addChild(_local2);
this.parent.removeChild(this);
};
gotoAndStop((pCurrentAnim + 1));
pCurrentAnim++;
pLastAnim = getTimer();
};
};
}
}
}//package
Section 47
//script_sheepexplosion (script_sheepexplosion)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class script_sheepexplosion extends MovieClip {
public var pLastAnim:int;// = 0
public var pAnimDelay:int;// = 50
public var pCurrentAnim:int;// = 0
public var pPaused:Boolean;// = false
public var pAnimCount:int;// = 9
public function script_sheepexplosion():void{
pPaused = false;
pLastAnim = 0;
pAnimDelay = 50;
pAnimCount = 9;
pCurrentAnim = 0;
super();
addEventListener(Event.ENTER_FRAME, everytime);
}
public function everytime(_arg1:Event):void{
if (pPaused == false){
if (getTimer() > (pLastAnim + pAnimDelay)){
if (pCurrentAnim == pAnimCount){
alpha = 0;
this.parent.removeChild(this);
};
gotoAndStop((pCurrentAnim + 1));
pCurrentAnim++;
pLastAnim = getTimer();
};
};
}
}
}//package
Section 48
//Tick (Tick)
package {
import flash.utils.*;
public class Tick {
public static var ftime:Number = 0;
private static var oldtime:int = 0;
public static var fps:uint = 0;
public static var secs = getTimer();
public static var fps_txt:uint = 0;
public static function getFtime():void{
ftime = ((getTimer() - oldtime) / 1000);
fps++;
if ((getTimer() - secs) > 1000){
secs = getTimer();
fps_txt = fps;
fps = 0;
};
oldtime = getTimer();
}
}
}//package