Section 1
//AR_LOGO_52 (TechWarsMochiAds_fla.AR_LOGO_52)
package TechWarsMochiAds_fla {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class AR_LOGO_52 extends MovieClip {
public function AR_LOGO_52(){
addFrameScript(0, frame1, 199, frame200);
}
function frame200(){
MovieClip(parent).gotoAndStop("intro");
}
function frame1(){
}
}
}//package TechWarsMochiAds_fla
Section 2
//DialogGameplayStats_8 (TechWarsMochiAds_fla.DialogGameplayStats_8)
package TechWarsMochiAds_fla {
import flash.display.*;
import flash.text.*;
public dynamic class DialogGameplayStats_8 extends MovieClip {
public var rocketCounter:TextField;
public var hitPointsCounter:TextField;
public var missileCounter:TextField;
}
}//package TechWarsMochiAds_fla
Section 3
//Holder_2 (TechWarsMochiAds_fla.Holder_2)
package TechWarsMochiAds_fla {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Holder_2 extends MovieClip {
public function Holder_2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TechWarsMochiAds_fla
Section 4
//LockMovieClip_1 (TechWarsMochiAds_fla.LockMovieClip_1)
package TechWarsMochiAds_fla {
import flash.display.*;
import flash.text.*;
public dynamic class LockMovieClip_1 extends MovieClip {
public var pLoaded:TextField;
public var lText:TextField;
}
}//package TechWarsMochiAds_fla
Section 5
//PlayerShipBody_27 (TechWarsMochiAds_fla.PlayerShipBody_27)
package TechWarsMochiAds_fla {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class PlayerShipBody_27 extends MovieClip {
public function PlayerShipBody_27(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package TechWarsMochiAds_fla
Section 6
//SceneCredits_64 (TechWarsMochiAds_fla.SceneCredits_64)
package TechWarsMochiAds_fla {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class SceneCredits_64 extends MovieClip {
public var okButton:SimpleButton;
public function SceneCredits_64(){
addFrameScript(0, frame1);
}
function frame1(){
okButton.addEventListener(MouseEvent.CLICK, backToMainMenu);
}
public function backToMainMenu(_arg1:MouseEvent){
MovieClip(root).gotoAndStop("mainMenu");
}
}
}//package TechWarsMochiAds_fla
Section 7
//SceneHangar_58 (TechWarsMochiAds_fla.SceneHangar_58)
package TechWarsMochiAds_fla {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class SceneHangar_58 extends MovieClip {
public var cashText:TextField;
public var playerCashText:TextField;
public var rocketsText:TextField;
public var shotLabel:TextField;
public var timeLabel:TextField;
public var damageText:TextField;
public var repairButton:SimpleButton;
public var shotText:TextField;
public var hangarNextLevel:SimpleButton;
public var shipText:TextField;
public var cashLabel:TextField;
public var timeText:TextField;
public var killsText:TextField;
public var killsLabel:TextField;
public var damageLabel:TextField;
public var upgradeEquipment:SimpleButton;
public var missilesText:TextField;
public function SceneHangar_58(){
addFrameScript(0, frame1);
}
public function hangar2Repairs(_arg1:MouseEvent){
MovieClip(root).gotoAndStop("repairs");
}
public function hangar2Upgrades(_arg1:MouseEvent){
MovieClip(root).gotoAndStop("upgrades");
}
function frame1(){
if (MovieClip(root).totalDamage == 0){
damageText.text = "0%";
} else {
damageText.text = (String(Math.round((((MovieClip(root).totalDamage - MovieClip(root).totalDamageTaken) / MovieClip(root).totalDamage) * 100))) + "%");
};
if (MovieClip(root).totalShotsHit == 0){
shotText.text = "0%";
} else {
shotText.text = (String(Math.round(((MovieClip(root).totalShotsHit / MovieClip(root).totalShotsFired) * 100))) + "%");
};
killsText.text = MovieClip(root).totalUnits;
timeText.text = String(Math.round((MovieClip(root).totalTime / 1000)));
cashText.text = ("$" + MovieClip(root).totalCash);
shipText.text = MovieClip(root).playerHtp;
rocketsText.text = MovieClip(root).playerRktStkUni;
missilesText.text = MovieClip(root).playerMslStkUni;
playerCashText.text = ("$" + String(MovieClip(root).playerCash));
hangarNextLevel.addEventListener(MouseEvent.CLICK, hangar2NextLevel);
upgradeEquipment.addEventListener(MouseEvent.CLICK, hangar2Upgrades);
repairButton.addEventListener(MouseEvent.CLICK, hangar2Repairs);
}
public function hangar2NextLevel(_arg1:MouseEvent){
if (root.currentLevel == 8){
MovieClip(root).gotoAndStop("gameFinishedStats");
} else {
MovieClip(root).currentLevel++;
MovieClip(root).gotoAndStop("game");
};
}
}
}//package TechWarsMochiAds_fla
Section 8
//SceneIntro_56 (TechWarsMochiAds_fla.SceneIntro_56)
package TechWarsMochiAds_fla {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class SceneIntro_56 extends MovieClip {
public var okB:SimpleButton;
public function SceneIntro_56(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8);
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
okB.addEventListener(MouseEvent.CLICK, proceed);
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame8(){
MovieClip(parent).gotoAndStop("hangar");
}
function frame2(){
stop();
}
public function proceed(_arg1:MouseEvent){
nextFrame();
}
}
}//package TechWarsMochiAds_fla
Section 9
//SceneRepair_61 (TechWarsMochiAds_fla.SceneRepair_61)
package TechWarsMochiAds_fla {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class SceneRepair_61 extends MovieClip {
public var playerCashText:TextField;
public var refillRockets:SimpleButton;
public var ok:SimpleButton;
public var rocketText:TextField;
public var refillMissiles:SimpleButton;
public var repairShip:SimpleButton;
public var shipText:TextField;
public var missileText:TextField;
public function SceneRepair_61(){
addFrameScript(0, frame1);
}
public function back2hangar(_arg1:MouseEvent){
MovieClip(root).gotoAndStop("hangar");
}
function frame1(){
writeText();
repairShip.addEventListener(MouseEvent.CLICK, rShip);
refillRockets.addEventListener(MouseEvent.CLICK, rRockets);
refillMissiles.addEventListener(MouseEvent.CLICK, rMissiles);
ok.addEventListener(MouseEvent.CLICK, back2hangar);
}
public function rMissiles(_arg1:MouseEvent){
MovieClip(root).playerCash = (MovieClip(root).playerCash - ((MovieClip(root).mslStk[MovieClip(root).playerMslStkLvl] - MovieClip(root).playerMslStkUni) * MovieClip(root).mslUniCost));
MovieClip(root).playerMslStkUni = MovieClip(root).mslStk[MovieClip(root).playerMslStkLvl];
writeText();
}
public function rRockets(_arg1:MouseEvent){
MovieClip(root).playerCash = (MovieClip(root).playerCash - ((MovieClip(root).rktStk[MovieClip(root).playerRktStkLvl] - MovieClip(root).playerRktStkUni) * MovieClip(root).rktUniCost));
MovieClip(root).playerRktStkUni = MovieClip(root).rktStk[MovieClip(root).playerRktStkLvl];
writeText();
}
public function writeText(){
if (((MovieClip(root).playerMaxHtp - MovieClip(root).playerHtp) * MovieClip(root).playerHtpCost) > MovieClip(root).playerCash){
repairShip.x = 405;
shipText.text = "Not enough cash to repair!";
} else {
if (MovieClip(root).playerMaxHtp == MovieClip(root).playerHtp){
repairShip.x = 405;
shipText.text = "Ship in perfect condition!";
} else {
repairShip.x = -81;
shipText.text = ("Repair Cost $" + String(((MovieClip(root).playerMaxHtp - MovieClip(root).playerHtp) * MovieClip(root).playerHtpCost)));
};
};
if (((MovieClip(root).rktStk[MovieClip(root).playerRktStkLvl] - MovieClip(root).playerRktStkUni) * MovieClip(root).rktUniCost) > MovieClip(root).playerCash){
refillRockets.x = 405;
rocketText.text = "Not enough cash to refill!";
} else {
if (MovieClip(root).playerRktStkUni == MovieClip(root).rktStk[MovieClip(root).playerRktStkLvl]){
refillRockets.x = 405;
rocketText.text = "Rocket stock full!";
} else {
refillRockets.x = -81;
rocketText.text = ("Refill Cost $" + String(((MovieClip(root).rktStk[MovieClip(root).playerRktStkLvl] - MovieClip(root).playerRktStkUni) * MovieClip(root).rktUniCost)));
};
};
if (((MovieClip(root).mslStk[MovieClip(root).playerMslStkLvl] - MovieClip(root).playerMslStkUni) * MovieClip(root).mslUniCost) > MovieClip(root).playerCash){
refillMissiles.x = 405;
missileText.text = "Not enough cash to refill!";
} else {
if (MovieClip(root).playerMslStkUni == MovieClip(root).mslStk[MovieClip(root).playerMslStkLvl]){
refillMissiles.x = 405;
missileText.text = "Rocket stock full!";
} else {
refillMissiles.x = -81;
missileText.text = ("Refill Cost $" + String(((MovieClip(root).mslStk[MovieClip(root).playerMslStkLvl] - MovieClip(root).playerMslStkUni) * MovieClip(root).mslUniCost)));
};
};
playerCashText.text = ("$" + String(MovieClip(root).playerCash));
}
public function rShip(_arg1:MouseEvent){
MovieClip(root).playerCash = (MovieClip(root).playerCash - ((MovieClip(root).playerMaxHtp - MovieClip(root).playerHtp) * MovieClip(root).playerHtpCost));
MovieClip(root).playerHtp = MovieClip(root).playerMaxHtp;
writeText();
}
}
}//package TechWarsMochiAds_fla
Section 10
//SceneUpgrades_57 (TechWarsMochiAds_fla.SceneUpgrades_57)
package TechWarsMochiAds_fla {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class SceneUpgrades_57 extends MovieClip {
public var rktSpdUp:TextField;
public var rktDltUp:TextField;
public var mslStkT:TextField;
public var mslSpdB:SimpleButton;
public var gld:TextFormat;
public var mslFueB:SimpleButton;
public var mslSpdT:TextField;
public var mslFueT:TextField;
public var upCostText:TextField;
public var mslDamUp:TextField;
public var mslStkUp:TextField;
public var rktDamB:SimpleButton;
public var rktDamT:TextField;
public var mslDltUp:TextField;
public var mslSpdUp:TextField;
public var mslFueUp:TextField;
public var upCostLabel:TextField;
public var rktDltB:SimpleButton;
public var rktDltT:TextField;
public var lsrDamB:SimpleButton;
public var lsrDamT:TextField;
public var lsrDamUp:TextField;
public var rktStkB:SimpleButton;
public var mslDamB:SimpleButton;
public var rktStkT:TextField;
public var mslDamT:TextField;
public var rktSpdB:SimpleButton;
public var mslDltB:SimpleButton;
public var mslDltT:TextField;
public var rktSpdT:TextField;
public var rktDamUp:TextField;
public var wht:TextFormat;
public var rktStkUp:TextField;
public var upgradesOK:SimpleButton;
public var mslStkB:SimpleButton;
public function SceneUpgrades_57(){
addFrameScript(0, frame1);
}
public function whtMslStkLvl(_arg1:MouseEvent){
if (mslStkUp.text != "Upgraded"){
mslStkUp.setTextFormat(wht);
};
writeCash();
}
public function gldMslDamLvl(_arg1:MouseEvent){
mslDamUp.setTextFormat(gld);
upCostLabel.text = "Cost:";
upCostText.text = String(("$" + MovieClip(root).mslDamCost));
}
public function whtRktStkLvl(_arg1:MouseEvent){
if (rktStkUp.text != "Upgraded"){
rktStkUp.setTextFormat(wht);
};
writeCash();
}
public function whtMslDltLvl(_arg1:MouseEvent){
if (mslDltUp.text != "Upgraded"){
mslDltUp.setTextFormat(wht);
};
writeCash();
}
public function gldRktDamLvl(_arg1:MouseEvent){
rktDamUp.setTextFormat(gld);
upCostLabel.text = "Cost:";
upCostText.text = String(("$" + MovieClip(root).rktDamCost));
}
public function upMslDltLvl(_arg1:MouseEvent){
MovieClip(root).playerMslDltLvl = 1;
MovieClip(root).playerCash = (MovieClip(root).playerCash - MovieClip(root).mslDltCost);
rewriteText();
}
public function upMslStkLvl(_arg1:MouseEvent){
MovieClip(root).playerMslStkLvl = 1;
MovieClip(root).playerCash = (MovieClip(root).playerCash - MovieClip(root).mslStkCost);
rewriteText();
}
public function whtRktDltLvl(_arg1:MouseEvent){
if (rktDltUp.text != "Upgraded"){
rktDltUp.setTextFormat(wht);
};
writeCash();
}
function frame1(){
gld = new TextFormat(null, null, 14197587);
wht = new TextFormat(null, null, 9606291);
writeCash();
upgradesOK.addEventListener(MouseEvent.CLICK, backToHangar);
lsrDamB.addEventListener(MouseEvent.CLICK, upLsrDamLvl);
rktDamB.addEventListener(MouseEvent.CLICK, upRktDamLvl);
rktSpdB.addEventListener(MouseEvent.CLICK, upRktSpdLvl);
rktDltB.addEventListener(MouseEvent.CLICK, upRktDltLvl);
rktStkB.addEventListener(MouseEvent.CLICK, upRktStkLvl);
mslDamB.addEventListener(MouseEvent.CLICK, upMslDamLvl);
mslSpdB.addEventListener(MouseEvent.CLICK, upMslSpdLvl);
mslDltB.addEventListener(MouseEvent.CLICK, upMslDltLvl);
mslStkB.addEventListener(MouseEvent.CLICK, upMslStkLvl);
mslFueB.addEventListener(MouseEvent.CLICK, upMslFueLvl);
lsrDamB.addEventListener(MouseEvent.MOUSE_OVER, gldLsrDamLvl);
rktDamB.addEventListener(MouseEvent.MOUSE_OVER, gldRktDamLvl);
rktSpdB.addEventListener(MouseEvent.MOUSE_OVER, gldRktSpdLvl);
rktDltB.addEventListener(MouseEvent.MOUSE_OVER, gldRktDltLvl);
rktStkB.addEventListener(MouseEvent.MOUSE_OVER, gldRktStkLvl);
mslDamB.addEventListener(MouseEvent.MOUSE_OVER, gldMslDamLvl);
mslSpdB.addEventListener(MouseEvent.MOUSE_OVER, gldMslSpdLvl);
mslDltB.addEventListener(MouseEvent.MOUSE_OVER, gldMslDltLvl);
mslStkB.addEventListener(MouseEvent.MOUSE_OVER, gldMslStkLvl);
mslFueB.addEventListener(MouseEvent.MOUSE_OVER, gldMslFueLvl);
lsrDamB.addEventListener(MouseEvent.MOUSE_OUT, whtLsrDamLvl);
rktDamB.addEventListener(MouseEvent.MOUSE_OUT, whtRktDamLvl);
rktSpdB.addEventListener(MouseEvent.MOUSE_OUT, whtRktSpdLvl);
rktDltB.addEventListener(MouseEvent.MOUSE_OUT, whtRktDltLvl);
rktStkB.addEventListener(MouseEvent.MOUSE_OUT, whtRktStkLvl);
mslDamB.addEventListener(MouseEvent.MOUSE_OUT, whtMslDamLvl);
mslSpdB.addEventListener(MouseEvent.MOUSE_OUT, whtMslSpdLvl);
mslDltB.addEventListener(MouseEvent.MOUSE_OUT, whtMslDltLvl);
mslStkB.addEventListener(MouseEvent.MOUSE_OUT, whtMslStkLvl);
mslFueB.addEventListener(MouseEvent.MOUSE_OUT, whtMslFueLvl);
rewriteText();
stop();
}
public function upRktDltLvl(_arg1:MouseEvent){
MovieClip(root).playerRktDltLvl = 1;
MovieClip(root).playerCash = (MovieClip(root).playerCash - MovieClip(root).rktDltCost);
rewriteText();
}
public function upRktStkLvl(_arg1:MouseEvent){
MovieClip(root).playerRktStkLvl = 1;
MovieClip(root).playerCash = (MovieClip(root).playerCash - MovieClip(root).rktStkCost);
rewriteText();
}
public function backToHangar(_arg1:MouseEvent){
MovieClip(root).gotoAndStop("hangar");
}
public function gldMslFueLvl(_arg1:MouseEvent){
mslFueUp.setTextFormat(gld);
upCostLabel.text = "Cost:";
upCostText.text = String(("$" + MovieClip(root).mslFueCost));
}
public function gldLsrDamLvl(_arg1:MouseEvent){
lsrDamUp.setTextFormat(gld);
upCostLabel.text = "Cost:";
upCostText.text = String(("$" + MovieClip(root).lsrDamCost));
}
public function gldMslSpdLvl(_arg1:MouseEvent){
mslSpdUp.setTextFormat(gld);
upCostLabel.text = "Cost:";
upCostText.text = String(("$" + MovieClip(root).mslSpdCost));
}
public function gldRktSpdLvl(_arg1:MouseEvent){
rktSpdUp.setTextFormat(gld);
upCostLabel.text = "Cost:";
upCostText.text = String(("$" + MovieClip(root).rktSpdCost));
}
public function rewriteText(){
lsrDamT.text = MovieClip(root).lsrDam[MovieClip(root).playerLsrDamLvl];
rktDamT.text = MovieClip(root).rktDam[MovieClip(root).playerRktDamLvl];
rktSpdT.text = roundTheBig(MovieClip(root).rktSpd[MovieClip(root).playerRktSpdLvl]);
rktDltT.text = roundTheBig(MovieClip(root).rktDlt[MovieClip(root).playerRktDltLvl]);
rktStkT.text = MovieClip(root).rktStk[MovieClip(root).playerRktStkLvl];
mslDamT.text = MovieClip(root).mslDam[MovieClip(root).playerMslDamLvl];
mslSpdT.text = roundTheBig(MovieClip(root).mslSpd[MovieClip(root).playerMslSpdLvl]);
mslDltT.text = roundTheBig(MovieClip(root).mslDlt[MovieClip(root).playerMslDltLvl]);
mslStkT.text = MovieClip(root).mslStk[MovieClip(root).playerMslStkLvl];
mslFueT.text = roundTheBig(MovieClip(root).mslFue[MovieClip(root).playerMslFueLvl]);
if (MovieClip(root).playerLsrDamLvl == 2){
lsrDamUp.text = "Upgraded";
lsrDamUp.setTextFormat(gld);
lsrDamB.x = 750;
} else {
if (MovieClip(root).playerCash > MovieClip(root).lsrDamCost){
lsrDamUp.text = ("Upgrade to " + String(MovieClip(root).lsrDam[2]));
lsrDamB.x = 373;
} else {
lsrDamUp.text = "Not enough cash!";
lsrDamB.x = 750;
};
};
if (MovieClip(root).playerRktDamLvl == 2){
rktDamUp.text = "Upgraded";
rktDamUp.setTextFormat(gld);
rktDamB.x = 750;
} else {
if (MovieClip(root).playerCash > MovieClip(root).rktDamCost){
rktDamUp.text = ("Upgrade to " + String(MovieClip(root).rktDam[2]));
rktDamB.x = 373;
} else {
rktDamUp.text = "Not enough cash!";
rktDamB.x = 750;
};
};
if (MovieClip(root).playerRktSpdLvl == 1){
rktSpdUp.text = "Upgraded";
rktSpdUp.setTextFormat(gld);
rktSpdB.x = 750;
} else {
if (MovieClip(root).playerCash > MovieClip(root).rktSpdCost){
rktSpdUp.text = ("Upgrade to " + roundTheBig(MovieClip(root).rktSpd[1]));
rktSpdB.x = 373;
} else {
rktSpdUp.text = "Not enough cash!";
rktSpdB.x = 750;
};
};
if (MovieClip(root).playerRktDltLvl == 1){
rktDltUp.text = "Upgraded";
rktDltUp.setTextFormat(gld);
rktDltB.x = 750;
} else {
if (MovieClip(root).playerCash > MovieClip(root).rktDltCost){
rktDltUp.text = ("Upgrade to " + roundTheBig(MovieClip(root).rktDlt[1]));
rktDltB.x = 373;
} else {
rktDltUp.text = "Not enough cash!";
rktDltB.x = 750;
};
};
if (MovieClip(root).playerRktStkLvl == 1){
rktStkUp.text = "Upgraded";
rktStkUp.setTextFormat(gld);
rktStkB.x = 750;
} else {
if (MovieClip(root).playerCash > MovieClip(root).rktStkCost){
rktStkUp.text = ("Upgrade to " + String(MovieClip(root).rktStk[1]));
rktStkB.x = 373;
} else {
rktStkUp.text = "Not enough cash!";
rktStkB.x = 750;
};
};
if (MovieClip(root).playerMslDamLvl == 2){
mslDamUp.text = "Upgraded";
mslDamUp.setTextFormat(gld);
mslDamB.x = 750;
} else {
if (MovieClip(root).playerCash > MovieClip(root).mslDamCost){
mslDamUp.text = ("Upgrade to " + String(MovieClip(root).mslDam[2]));
mslDamB.x = 373;
} else {
mslDamUp.text = "Not enough cash!";
mslDamB.x = 750;
};
};
if (MovieClip(root).playerMslSpdLvl == 1){
mslSpdUp.text = "Upgraded";
mslSpdUp.setTextFormat(gld);
mslSpdB.x = 750;
} else {
if (MovieClip(root).playerCash > MovieClip(root).mslSpdCost){
mslSpdUp.text = ("Upgrade to " + roundTheBig(MovieClip(root).mslSpd[1]));
mslSpdB.x = 373;
} else {
mslSpdUp.text = "Not enough cash!";
mslSpdB.x = 750;
};
};
if (MovieClip(root).playerMslDltLvl == 1){
mslDltUp.text = "Upgraded";
mslDltUp.setTextFormat(gld);
mslDltB.x = 750;
} else {
if (MovieClip(root).playerCash > MovieClip(root).mslDltCost){
mslDltUp.text = ("Upgrade to " + roundTheBig(MovieClip(root).mslDlt[1]));
mslDltB.x = 373;
} else {
mslDltUp.text = "Not enough cash!";
mslDltB.x = 750;
};
};
if (MovieClip(root).playerMslStkLvl == 1){
mslStkUp.text = "Upgraded";
mslStkUp.setTextFormat(gld);
mslStkB.x = 750;
} else {
if (MovieClip(root).playerCash > MovieClip(root).mslStkCost){
mslStkUp.text = ("Upgrade to " + String(MovieClip(root).mslStk[1]));
mslStkB.x = 373;
} else {
mslStkUp.text = "Not enough cash!";
mslStkB.x = 750;
};
};
if (MovieClip(root).playerMslFueLvl == 1){
mslFueUp.text = "Upgraded";
mslFueUp.setTextFormat(gld);
mslFueB.x = 750;
} else {
if (MovieClip(root).playerCash > MovieClip(root).mslFueCost){
mslFueUp.text = ("Upgrade to " + roundTheBig(MovieClip(root).mslFue[1]));
mslFueB.x = 373;
} else {
mslFueUp.text = "Not enough cash!";
mslFueB.x = 750;
};
};
}
public function whtMslDamLvl(_arg1:MouseEvent){
if (mslDamUp.text != "Upgraded"){
mslDamUp.setTextFormat(wht);
};
writeCash();
}
public function whtRktDamLvl(_arg1:MouseEvent){
if (rktDamUp.text != "Upgraded"){
rktDamUp.setTextFormat(wht);
};
writeCash();
}
public function upMslDamLvl(_arg1:MouseEvent){
MovieClip(root).playerMslDamLvl = 2;
MovieClip(root).playerCash = (MovieClip(root).playerCash - MovieClip(root).mslDamCost);
rewriteText();
}
public function upRktDamLvl(_arg1:MouseEvent){
MovieClip(root).playerRktDamLvl = 2;
MovieClip(root).playerCash = (MovieClip(root).playerCash - MovieClip(root).rktDamCost);
rewriteText();
}
public function gldMslDltLvl(_arg1:MouseEvent){
mslDltUp.setTextFormat(gld);
upCostLabel.text = "Cost:";
upCostText.text = String(("$" + MovieClip(root).mslDltCost));
}
public function gldMslStkLvl(_arg1:MouseEvent){
mslStkUp.setTextFormat(gld);
upCostLabel.text = "Cost:";
upCostText.text = String(("$" + MovieClip(root).mslStkCost));
}
public function gldRktDltLvl(_arg1:MouseEvent){
rktDltUp.setTextFormat(gld);
upCostLabel.text = "Cost:";
upCostText.text = String(("$" + MovieClip(root).rktDltCost));
}
public function gldRktStkLvl(_arg1:MouseEvent){
rktStkUp.setTextFormat(gld);
upCostLabel.text = "Cost:";
upCostText.text = String(("$" + MovieClip(root).rktStkCost));
}
public function whtMslFueLvl(_arg1:MouseEvent){
if (mslFueUp.text != "Upgraded"){
mslFueUp.setTextFormat(wht);
};
writeCash();
}
public function upMslFueLvl(_arg1:MouseEvent){
MovieClip(root).playerMslFueLvl = 1;
MovieClip(root).playerCash = (MovieClip(root).playerCash - MovieClip(root).mslFueCost);
rewriteText();
}
public function whtLsrDamLvl(_arg1:MouseEvent){
if (lsrDamUp.text != "Upgraded"){
lsrDamUp.setTextFormat(wht);
};
writeCash();
}
public function whtMslSpdLvl(_arg1:MouseEvent){
if (mslSpdUp.text != "Upgraded"){
mslSpdUp.setTextFormat(wht);
};
writeCash();
}
public function writeCash(){
upCostLabel.text = "Cash:";
upCostText.text = String(("$" + MovieClip(root).playerCash));
}
public function whtRktSpdLvl(_arg1:MouseEvent){
if (rktSpdUp.text != "Upgraded"){
rktSpdUp.setTextFormat(wht);
};
writeCash();
}
public function upLsrDamLvl(_arg1:MouseEvent){
MovieClip(root).playerLsrDamLvl = 2;
MovieClip(root).playerCash = (MovieClip(root).playerCash - MovieClip(root).lsrDamCost);
rewriteText();
}
public function upMslSpdLvl(_arg1:MouseEvent){
MovieClip(root).playerMslSpdLvl = 1;
MovieClip(root).playerCash = (MovieClip(root).playerCash - MovieClip(root).mslSpdCost);
rewriteText();
}
public function upRktSpdLvl(_arg1:MouseEvent){
MovieClip(root).playerRktSpdLvl = 1;
MovieClip(root).playerCash = (MovieClip(root).playerCash - MovieClip(root).rktSpdCost);
rewriteText();
}
public function roundTheBig(_arg1:int):String{
return (String((_arg1 / 10)));
}
}
}//package TechWarsMochiAds_fla
Section 11
//VGS_logo_anim_55 (TechWarsMochiAds_fla.VGS_logo_anim_55)
package TechWarsMochiAds_fla {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class VGS_logo_anim_55 extends MovieClip {
public function VGS_logo_anim_55(){
addFrameScript(500, frame501, 563, frame564);
}
function frame564(){
MovieClip(parent).gotoAndStop("mainMenu");
}
function frame501(){
MovieClip(parent).soundSystem.startPlaying();
}
}
}//package TechWarsMochiAds_fla
Section 12
//Enemy (Enemy)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;
public class Enemy extends MovieClip {
public const msOfAnim:int = 1000;
public var desSound:Sound;
public var sTransform:SoundTransform;
public var firSound:Sound;
public var verSpeed:Number;
public var shotTimer:int;
public var radiusToken:MovieClip;
public var laserAim:LaserAim;
public var newX:Number;
public var newY:Number;
public var horSpeed:Number;
public var vol:Number;
public var cRadius:int;
public var shotDelta:int;
public var htp:int;
public var iWidth:Number;
public var iHeight:Number;
public var soundChannel:SoundChannel;
public var fWidth:Number;
public var animStartTimer:int;
public var myType:String;
public var fHeight:Number;
public var hitSound:Sound;
public var maxSpeed:Number;
public var eRadius;
public var fue:int;
public var shotStart:int;
public var dam:int;
public var spd:int;
public var eSizeRatio;
public var shotDist:Number;
public var eParticles;
public var eAlpha;
public var eColor;
public function updateRadiusToken(_arg1:int){
if (radiusToken == null){
radiusToken = new TurretRange();
if (myType == "Laser"){
radiusToken.gotoAndStop(1);
};
if (myType == "Rocket"){
radiusToken.gotoAndStop(2);
};
if (myType == "Missile"){
radiusToken.gotoAndStop(3);
};
radiusToken.x = x;
radiusToken.y = y;
radiusToken.height = (radiusToken.width = 0);
MovieClip(parent).addChild(radiusToken);
};
shotDist = (shotDist + ((_arg1 * Math.sqrt((MovieClip(root).currentDifficulty + 1))) / 150));
radiusToken.height = (radiusToken.width = (shotDist * 2));
}
public function checkWallCollision(){
if ((x - 14) <= (cRadius * 2)){
x = (14 + (cRadius * 2));
horSpeed = (horSpeed * -1);
};
if ((x + 14) >= (480 - (cRadius * 2))){
x = (466 - (cRadius * 2));
horSpeed = (horSpeed * -1);
};
if ((y - 14) <= (cRadius * 2)){
y = (14 + (cRadius * 2));
verSpeed = (verSpeed * -1);
};
if ((y + 14) >= (480 - (cRadius * 2))){
y = (466 - (cRadius * 2));
verSpeed = (verSpeed * -1);
};
}
public function raiseBase(){
shotDist = 50;
animStartTimer = getTimer();
fWidth = width;
fHeight = height;
width = (width * 0.7);
height = (height * 0.7);
iWidth = width;
iHeight = height;
alpha = 0;
addEventListener(Event.ENTER_FRAME, raise);
}
public function takeDamage(_arg1:int){
var _local2:MovieClip;
htp = (htp - _arg1);
if (htp <= 0){
htp = 0;
soundChannel = desSound.play();
soundChannel.soundTransform = sTransform;
MovieClip(parent).unitsDestroyed++;
MovieClip(parent).eManager.createExplosion(x, y, eRadius, eColor, eParticles);
MovieClip(parent).eManager.createExplosion(x, y, 0, 6, Math.round((eParticles / 3)));
MovieClip(parent).eManager.createExplosion(x, y, 0, 7, Math.round((eParticles / 3)));
_local2 = new ExplosionDecal();
_local2.x = x;
_local2.y = y;
_local2.gotoAndStop(int(((Math.random() * 3) + 1)));
_local2.width = (_local2.width * eSizeRatio);
_local2.height = (_local2.height * eSizeRatio);
_local2.alpha = eAlpha;
_local2.rotation = (Math.random() * 360);
MovieClip(parent).addChildAt(_local2, 1);
if (radiusToken != null){
MovieClip(parent).removeChild(radiusToken);
};
if (laserAim != null){
MovieClip(parent).removeChild(laserAim);
};
MovieClip(parent).destroyEnemy(this);
} else {
soundChannel = hitSound.play();
soundChannel.soundTransform = sTransform;
};
}
public function checkPlayerCollision(){
var _local1:Point;
var _local2:Point;
var _local3:Number;
var _local4:Number;
var _local5:*;
_local1 = new Point(MovieClip(parent).playerShip.x, MovieClip(parent).playerShip.y);
_local2 = new Point(x, y);
_local3 = MovieClip(parent).playerShip.cRadius;
_local4 = cRadius;
if (MovieClip(parent).cService.getCircularCollision(_local1, _local3, _local2, _local4)){
_local5 = Math.atan2((_local1.x - _local2.x), (_local1.y - _local2.y));
if (htp > 0){
MovieClip(parent).playerShip.takeDamage(_local5, htp);
};
takeDamage(htp);
};
}
public function raise(_arg1:Event){
var _local2:*;
_local2 = (getTimer() - animStartTimer);
width = (iWidth + Math.floor(((_local2 / msOfAnim) * (fWidth - iWidth))));
height = (iHeight + Math.floor(((_local2 / msOfAnim) * (fHeight - iHeight))));
alpha = (_local2 / msOfAnim);
if (_local2 >= msOfAnim){
width = fWidth;
height = fHeight;
alpha = 1;
removeEventListener(Event.ENTER_FRAME, raise);
};
}
}
}//package
Section 13
//EnemyBaseDestroyed (EnemyBaseDestroyed)
package {
import flash.media.*;
public dynamic class EnemyBaseDestroyed extends Sound {
}
}//package
Section 14
//EnemyHit (EnemyHit)
package {
import flash.media.*;
public dynamic class EnemyHit extends Sound {
}
}//package
Section 15
//EnemyLaserTurret (EnemyLaserTurret)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.media.*;
public class EnemyLaserTurret extends Enemy {
public var head:MovieClip;
public function EnemyLaserTurret(){
myType = "Laser";
cRadius = 10;
eColor = 1;
eRadius = 0;
eParticles = 100;
eSizeRatio = 2;
eAlpha = 1;
hitSound = new EnemyHit();
desSound = new EnemyBaseDestroyed();
firSound = new LaserFire();
soundChannel = new SoundChannel();
sTransform = new SoundTransform(0, 0);
}
public function update(_arg1:int, _arg2:int){
var _local3:MovieClip;
var _local4:Point;
var _local5:Point;
var _local6:Number;
var _local7:Number;
updateRadiusToken(_arg2);
if (laserAim == null){
laserAim = new LaserAim(head);
MovieClip(parent).addChild(laserAim);
laserAim.x = x;
laserAim.y = y;
};
_local3 = MovieClip(parent).playerShip;
_local4 = new Point(x, y);
_local5 = new Point(_local3.x, _local3.y);
_local6 = Math.atan2((_local3.y - y), (_local3.x - x));
_local7 = Math.atan2((_local3.x - x), (_local3.y - y));
head.rotation = ((360 * _local6) / (2 * Math.PI));
laserAim.update();
if (Point.distance(_local4, _local5) < shotDist){
if (shotTimer == 0){
shotTimer = (_arg1 + shotStart);
};
if (_arg1 >= shotTimer){
_local3.takeDamage(_local7, dam);
soundChannel = hitSound.play();
soundChannel = firSound.play();
soundChannel.soundTransform = sTransform;
shotTimer = (_arg1 + shotDelta);
laserAim.fire(1);
};
};
checkPlayerCollision();
}
}
}//package
Section 16
//EnemyMine (EnemyMine)
package {
import flash.display.*;
import flash.media.*;
public class EnemyMine extends Enemy {
public function EnemyMine(_arg1:Number, _arg2:int, _arg3:int){
var _local4:*;
super();
htp = _arg2;
cRadius = 10;
_local4 = ((_arg1 * Math.PI) / 180);
horSpeed = (Math.cos(_local4) * _arg3);
verSpeed = (Math.sin(_local4) * _arg3);
eColor = 4;
eRadius = 30;
eParticles = 25;
eSizeRatio = 0.5;
eAlpha = 0.75;
hitSound = new EnemyHit();
desSound = new EnemyMineDestroyed();
soundChannel = new SoundChannel();
sTransform = new SoundTransform(0, 0);
}
public function update(_arg1:int, _arg2:int){
x = (x + ((horSpeed * _arg2) / 1000));
y = (y + ((verSpeed * _arg2) / 1000));
checkWallCollision();
checkPlayerCollision();
}
}
}//package
Section 17
//EnemyMineBase (EnemyMineBase)
package {
import flash.display.*;
import flash.media.*;
public class EnemyMineBase extends Enemy {
public var radsPerSecond:Number;// = 90
public var head:MovieClip;
public function EnemyMineBase(){
radsPerSecond = 90;
super();
cRadius = 10;
eColor = 4;
eRadius = 0;
eParticles = 100;
eSizeRatio = 2;
eAlpha = 1;
hitSound = new EnemyHit();
desSound = new EnemyBaseDestroyed();
soundChannel = new SoundChannel();
sTransform = new SoundTransform(0, 0);
}
public function update(_arg1:int, _arg2:int){
if (shotTimer == 0){
shotTimer = (_arg1 + shotStart);
};
if (_arg1 >= shotTimer){
MovieClip(parent).createEnemy("Mine", this, head.rotation, dam, spd);
shotTimer = (_arg1 + shotDelta);
};
head.rotation = (head.rotation + ((radsPerSecond * _arg2) / 1000));
checkPlayerCollision();
}
}
}//package
Section 18
//EnemyMineDestroyed (EnemyMineDestroyed)
package {
import flash.media.*;
public dynamic class EnemyMineDestroyed extends Sound {
}
}//package
Section 19
//EnemyMinion (EnemyMinion)
package {
import flash.display.*;
import flash.media.*;
public class EnemyMinion extends Enemy {
public function EnemyMinion(_arg1:int, _arg2:int){
htp = _arg1;
spd = _arg2;
cRadius = 10;
eColor = 5;
eRadius = 30;
eParticles = 25;
eSizeRatio = 0.5;
eAlpha = 0.75;
hitSound = new EnemyHit();
desSound = new EnemyMineDestroyed();
soundChannel = new SoundChannel();
sTransform = new SoundTransform(0, 0);
}
public function update(_arg1:int, _arg2:int){
var _local3:*;
var _local4:*;
_local3 = MovieClip(parent).playerShip;
_local4 = Math.atan2((_local3.y - y), (_local3.x - x));
rotation = ((360 * _local4) / (2 * Math.PI));
horSpeed = (Math.cos(_local4) * spd);
verSpeed = (Math.sin(_local4) * spd);
x = (x + ((horSpeed * _arg2) / 1000));
y = (y + ((verSpeed * _arg2) / 1000));
MovieClip(parent).eManager.createExplosion(x, y, 5, 5, 3);
checkPlayerCollision();
}
}
}//package
Section 20
//EnemyMinionBase (EnemyMinionBase)
package {
import flash.display.*;
import flash.media.*;
public class EnemyMinionBase extends Enemy {
public function EnemyMinionBase(){
cRadius = 10;
eColor = 5;
eRadius = 0;
eParticles = 100;
eSizeRatio = 2;
eAlpha = 1;
hitSound = new EnemyHit();
desSound = new EnemyBaseDestroyed();
soundChannel = new SoundChannel();
sTransform = new SoundTransform(0, 0);
}
public function update(_arg1:int, _arg2:int){
if (shotTimer == 0){
shotTimer = (_arg1 + shotStart);
};
if (_arg1 >= shotTimer){
MovieClip(parent).createEnemy("Minion", this, rotation, dam, spd);
shotTimer = (_arg1 + shotDelta);
};
checkPlayerCollision();
}
}
}//package
Section 21
//EnemyMissileTurret (EnemyMissileTurret)
package {
import flash.display.*;
import flash.geom.*;
import flash.media.*;
public class EnemyMissileTurret extends Enemy {
public var head:MovieClip;
public function EnemyMissileTurret(){
myType = "Missile";
cRadius = 10;
eColor = 2;
eRadius = 0;
eParticles = 100;
eSizeRatio = 2;
eAlpha = 1;
hitSound = new EnemyHit();
desSound = new EnemyBaseDestroyed();
firSound = new MissileLaunch();
soundChannel = new SoundChannel();
sTransform = new SoundTransform(0, 0);
}
public function update(_arg1:int, _arg2:int){
var _local3:MovieClip;
var _local4:Point;
var _local5:Point;
var _local6:MovieClip;
var _local7:Point;
updateRadiusToken(_arg2);
_local3 = MovieClip(parent).playerShip;
_local4 = new Point(x, y);
_local5 = new Point(_local3.x, _local3.y);
head.angle = Math.atan2((_local3.y - y), (_local3.x - x));
head.rotation = ((360 * head.angle) / (2 * Math.PI));
if (Point.distance(_local4, _local5) < shotDist){
if (shotTimer == 0){
shotTimer = (_arg1 + shotStart);
};
if (_arg1 >= shotTimer){
_local6 = new ProjectileMissile(2, MovieClip(parent).playerShip, dam, spd, fue);
_local7 = new Point(head.x, head.y);
_local7 = head.localToGlobal(_local7);
_local6.x = _local7.x;
_local6.y = _local7.y;
soundChannel = firSound.play();
MovieClip(parent).projectile.push(_local6);
MovieClip(parent).addChild(_local6);
shotTimer = (_arg1 + shotDelta);
};
};
checkPlayerCollision();
}
}
}//package
Section 22
//EnemyRocketTurret (EnemyRocketTurret)
package {
import flash.display.*;
import flash.geom.*;
import flash.media.*;
public class EnemyRocketTurret extends Enemy {
public var head:MovieClip;
public function EnemyRocketTurret(){
myType = "Rocket";
cRadius = 10;
eColor = 0;
eRadius = 0;
eParticles = 100;
eSizeRatio = 2;
eAlpha = 1;
hitSound = new EnemyHit();
desSound = new EnemyBaseDestroyed();
firSound = new RocketLaunch();
soundChannel = new SoundChannel();
sTransform = new SoundTransform(0, 0);
}
public function update(_arg1:int, _arg2:int){
var _local3:MovieClip;
var _local4:Point;
var _local5:Point;
var _local6:MovieClip;
var _local7:Point;
updateRadiusToken(_arg2);
_local3 = MovieClip(parent).playerShip;
_local4 = new Point(x, y);
_local5 = new Point(_local3.x, _local3.y);
head.angle = Math.atan2((_local3.y - y), (_local3.x - x));
head.rotation = ((360 * head.angle) / (2 * Math.PI));
if (Point.distance(_local4, _local5) < shotDist){
if (shotTimer == 0){
shotTimer = (_arg1 + shotStart);
};
if (_arg1 >= shotTimer){
_local6 = new ProjectileRocket(2, dam, spd, head.rotation, head.angle);
_local7 = new Point(head.x, head.y);
_local7 = head.localToGlobal(_local7);
_local6.x = _local7.x;
_local6.y = _local7.y;
soundChannel = firSound.play();
MovieClip(parent).projectile.push(_local6);
MovieClip(parent).addChild(_local6);
shotTimer = (_arg1 + shotDelta);
};
};
checkPlayerCollision();
}
}
}//package
Section 23
//ExplosionDecal (ExplosionDecal)
package {
import flash.display.*;
import flash.events.*;
public class ExplosionDecal extends MovieClip {
public const maxIteration = 5;
public var currIteration;// = 0
public function ExplosionDecal(){
currIteration = 0;
super();
addEventListener(Event.ENTER_FRAME, update);
}
public function update(_arg1:Event){
if (currIteration == maxIteration){
alpha = (alpha - 0.01);
currIteration = 0;
};
if (alpha <= 0){
removeEventListener(Event.ENTER_FRAME, update);
MovieClip(parent).removeChild(this);
};
currIteration++;
}
}
}//package
Section 24
//Game (Game)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
public dynamic class Game extends MovieClip {
public const rktSpdCost:int = 4000;
public const mslDltCost:int = 6000;
public const mslUniCost:int = 75;
public const playerHtpCost:int = 25;
public const mslStkCost:int = 8000;
public const rktDltCost:int = 4000;
public const rktUniCost:int = 50;
public const mslDamCost:int = 4000;
public const lsrDamCost:int = 2000;
public const rktStkCost:int = 6000;
public const rktDamCost:int = 2000;
public const mslSpdCost:int = 6000;
public const mslFueCost:int = 8000;
public var mslFue:Array;
public var loader:MovieClip;
public var playerMslFueLvl:int;
public var soundSystem:vgsSoundSystem;
public var totalShotsFired:int;
public var mneSpd:Array;
public var mneDam:Array;
public var currentDifficulty:uint;
public var totalTime:int;
public var rktDam:Array;
public var playerLsrDamLvl:int;
public var playerHtp:int;
public var mslSpd:Array;
public var rktSpd:Array;
public var mslDam:Array;
public var playerMslSpdLvl:int;
public var playerRktSpdLvl:int;
public var playerFrc:Number;
public var waveBaseShotDelta:Array;
public var totalCash:int;
public var totalUnits:int;
public var owner:String;
public var mnnHtp:Array;
public var totalDamageTaken:int;
public var levelHatchY:Array;
public var levelHatchW:Array;
public var levelHatchX:Array;
public var mslStk:Array;
public var endClip:SceneGameFinishedStats;
public var levelHatchP:Array;
public var rktStk:Array;
public var buttonsMC:MainMenu;
public var playerMslDltLvl:int;
public var playerMslStkLvl:int;
public var playerRktDltLvl:int;
public var waveBaseHatch:Array;
public var playerRktStkLvl:int;
public var soundFXVol:Number;
public var playerSpd:Number;
public var locked:Boolean;
public var locker:MovieClip;
public var lsrHtp:Array;
public var playerMaxHtp:int;
public var lsrDlt:Array;
public var waveBaseShotStart:Array;
public var featureLock:Boolean;
public var ownerDomain:String;
public var cursor:MouseGraphics;
public var mnnDam:Array;
public var dialog:MovieClip;
public var playerLsrDltLvl:int;
public var arLogo:MovieClip;
public var mnnSpd:Array;
public var mneHtp:Array;
public var level:Level;
public var totalShotsHit:int;
public var rktHtp:Array;
public var currentLevel:uint;
public var currWaves:int;
public var mslDlt:Array;
public var rktDlt:Array;
public var playerMslStkUni:int;
public var playerCash:int;
public var playerMslDamLvl:int;
public var totalWaves:int;
public var playerRktStkUni:int;
public var lsrDam:Array;
public var playerRktDamLvl:int;
public var arLogoButton:SimpleButton;
public var mslHtp:Array;
public var totalDamage:int;
public var playerAcc:Number;
public var waveBaseType:Array;
public function Game(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 6, frame7, 32, frame33, 33, frame34, 34, frame35, 35, frame36, 36, frame37, 37, frame38, 38, frame39, 39, frame40, 40, frame41, 41, frame42, 42, frame43, 43, frame44, 44, frame45, 45, frame46);
soundSystem = new vgsSoundSystem();
cursor = new MouseGraphics();
addChild(cursor);
loadLevelDetail();
resetGameState();
soundFXVol = 0.5;
locked = false;
MochiServices.connect("b840724246f22f76", MovieClip(this));
addEventListener(Event.ENTER_FRAME, update);
}
public function activateEvents(_arg1:Boolean){
if (_arg1){
stage.focus = stage;
stage.addEventListener(KeyboardEvent.KEY_UP, keyU);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyD);
};
if (!_arg1){
stage.removeEventListener(KeyboardEvent.KEY_UP, keyU);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyD);
};
}
public function loadLevelDetail(){
var _local1:int;
var _local2:Array;
var _local3:Array;
var _local4:int;
var _local5:*;
var _local6:*;
var _local7:int;
var _local8:Number;
var _local9:Number;
levelHatchX = new Array();
levelHatchY = new Array();
levelHatchW = new Array();
levelHatchP = new Array();
_local1 = 1;
levelHatchX[_local1] = [100, 100, 380, 380];
levelHatchY[_local1] = [100, 380, 380, 100];
levelHatchW[_local1] = [0, 0, 1, 4, 2];
levelHatchP[_local1] = [0, 2, 1, 3, 0, 3, 1, 2, 0, 2, 3, 1, 0, 3, 2, 1];
_local1 = 2;
levelHatchX[_local1] = [65, 65, 135, 135, 345, 345, 415, 415];
levelHatchY[_local1] = [65, 135, 65, 135, 345, 415, 345, 415];
levelHatchW[_local1] = [1, 2, 4, 3, 5];
levelHatchP[_local1] = [0, 1, 2, 3, 4, 5, 6, 7, 3, 4, 0, 7, 1, 2, 3, 4, 5, 6, 0, 7, 1, 2, 5, 6, 0, 7, 3, 4];
_local1 = 3;
levelHatchX[_local1] = [181, 299, 299, 181, 240, 82, 398, 240];
levelHatchY[_local1] = [181, 181, 299, 299, 82, 240, 240, 398];
levelHatchW[_local1] = [3, 0, 0, 1, 6, 2];
levelHatchP[_local1] = [1, 3, 4, 5, 6, 7, 0, 2, 0, 2, 1, 3, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 6, 7, 6, 7, 4, 5];
_local1 = 4;
levelHatchX[_local1] = [60, 131, 202, 273, 344, 415, 60, 131, 202, 273, 344, 415];
levelHatchY[_local1] = [415, 415, 415, 415, 415, 415, 65, 65, 65, 65, 65, 65];
levelHatchW[_local1] = [3, 7, 10, 7, 10];
levelHatchP[_local1] = [1, 2, 3, 8, 9, 10, 4, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 11, 10, 9, 8, 7, 6];
_local1 = 5;
levelHatchX[_local1] = [60, 131, 202, 273, 344, 415, 415, 415, 415, 415, 415, 344, 273, 202, 131, 60, 60, 60, 60, 60];
levelHatchY[_local1] = [60, 60, 60, 60, 60, 60, 131, 202, 273, 344, 415, 415, 415, 415, 415, 415, 344, 273, 202, 131];
levelHatchW[_local1] = [7, 1, 2, 9, 10];
levelHatchP[_local1] = [19, 0, 1, 9, 10, 11, 4, 5, 6, 14, 15, 16, 0, 5, 10, 15, 0, 5, 10, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 4, 5, 6, 14, 15, 16];
_local1 = 6;
_local2 = new Array();
_local3 = new Array();
_local4 = 0;
_local5 = 0;
while (_local5 < 6) {
_local8 = (((_local5 * 60) * Math.PI) / 180);
_local2[_local4] = (240 + (Math.sin(_local8) * 190));
_local3[_local4] = (240 + (Math.cos(_local8) * 190));
_local4++;
_local5++;
};
_local6 = 0;
while (_local6 < 6) {
_local9 = ((((_local6 * 60) + 30) * Math.PI) / 180);
_local2[_local4] = (240 + (Math.sin(_local9) * 190));
_local3[_local4] = (240 + (Math.cos(_local9) * 190));
_local4++;
_local6++;
};
levelHatchX[_local1] = _local2;
levelHatchY[_local1] = _local3;
levelHatchW[_local1] = [11, 7, 10, 7];
levelHatchP[_local1] = [6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
_local1 = 7;
levelHatchX[_local1] = [60, 131, 202, 273, 344, 415, 415, 415, 415, 415, 415, 344, 273, 202, 131, 60, 60, 60, 60, 60, 131, 344, 344, 131];
levelHatchY[_local1] = [60, 60, 60, 60, 60, 60, 131, 202, 273, 344, 415, 415, 415, 415, 415, 415, 344, 273, 202, 131, 131, 131, 344, 344];
levelHatchW[_local1] = [2, 6, 12, 12, 9];
levelHatchP[_local1] = [20, 21, 22, 23, 0, 5, 10, 15, 20, 21, 22, 23, 0, 1, 19, 2, 18, 20, 10, 9, 11, 8, 22, 12, 20, 1, 2, 3, 4, 21, 6, 7, 8, 9, 22, 11, 12, 13, 14, 23, 16, 17, 18, 19];
_local1 = 8;
levelHatchX[_local1] = [60, 415, 115, 360, 170, 312, 170, 312, 115, 360, 60, 415];
levelHatchY[_local1] = [60, 60, 115, 115, 170, 170, 312, 312, 360, 360, 415, 415];
levelHatchW[_local1] = [1, 2, 3, 4, 6, 7];
levelHatchP[_local1] = [4, 5, 6, 7, 2, 3, 8, 9, 2, 3, 4, 7, 8, 9, 5, 6, 4, 7, 5, 6, 2, 3, 8, 9, 4, 5, 6, 7, 0, 3, 4, 7, 8, 11, 1, 2, 5, 6, 9, 10];
_local7 = 1;
while (_local7 <= _local1) {
totalWaves = (totalWaves + levelHatchW[_local7].length);
_local7++;
};
waveBaseType = new Array();
waveBaseHatch = new Array();
waveBaseShotStart = new Array();
waveBaseShotDelta = new Array();
_local1 = 0;
waveBaseType[_local1] = ["Mine", "Mine"];
waveBaseShotStart[_local1] = [0, 1000];
waveBaseShotDelta[_local1] = [2000, 2000];
_local1 = 1;
waveBaseType[_local1] = ["Mine", "Mine", "Mine", "Mine"];
waveBaseShotStart[_local1] = [0, 500, 1000, 1500];
waveBaseShotDelta[_local1] = [2000, 2000, 2000, 2000];
_local1 = 2;
waveBaseType[_local1] = ["Minion", "Minion", "Minion", "Minion"];
waveBaseShotStart[_local1] = [0, 500, 1000, 1500];
waveBaseShotDelta[_local1] = [2000, 2000, 2000, 2000];
_local1 = 3;
waveBaseType[_local1] = ["Laser", "Laser", "Laser", "Laser", "Laser", "Laser", "Mine", "Mine"];
waveBaseShotStart[_local1] = [0, 0, 0, 0, 0, 0, 0, 0];
waveBaseShotDelta[_local1] = [0, 0, 0, 0, 0, 0, 1000, 1000];
_local1 = 4;
waveBaseType[_local1] = ["Mine", "Mine", "Minion", "Minion"];
waveBaseShotStart[_local1] = [0, 500, 1000, 1500];
waveBaseShotDelta[_local1] = [2000, 2000, 2000, 2000];
_local1 = 5;
waveBaseType[_local1] = ["Rocket", "Rocket", "Rocket", "Rocket", "Missile", "Missile", "Minion", "Minion"];
waveBaseShotStart[_local1] = [0, 0, 0, 0, 0, 0, 0, 0];
waveBaseShotDelta[_local1] = [0, 0, 0, 0, 0, 0, 1500, 1500];
_local1 = 6;
waveBaseType[_local1] = ["Mine", "Mine", "Mine", "Mine", "Rocket", "Rocket", "Rocket", "Rocket"];
waveBaseShotStart[_local1] = [0, 0, 0, 0, 0, 0, 0, 0];
waveBaseShotDelta[_local1] = [1500, 1500, 1500, 1500, 0, 0, 0, 0];
_local1 = 7;
waveBaseType[_local1] = ["Minion", "Minion", "Minion", "Minion", "Minion", "Minion", "Rocket", "Rocket", "Rocket", "Rocket", "Rocket", "Rocket"];
waveBaseShotStart[_local1] = [0, 250, 500, 750, 1000, 1250, 0, 0, 0, 0, 0, 0];
waveBaseShotDelta[_local1] = [5000, 5000, 5000, 5000, 5000, 5000, 0, 0, 0, 0, 0, 0];
_local1 = 9;
waveBaseType[_local1] = ["Mine", "Minion", "Mine", "Minion", "Mine", "Minion", "Mine", "Minion", "Mine", "Minion", "Mine", "Minion", "Mine", "Minion", "Mine", "Minion", "Mine", "Minion", "Mine", "Minion"];
waveBaseShotStart[_local1] = [0, 750, 1500, 2250, 3000, 3750, 4500, 5250, 6000, 6750, 7500, 8250, 9000, 9750, 10500, 11250, 12000, 12750, 13500, 14250];
waveBaseShotDelta[_local1] = [15000, 15000, 15000, 15000, 15000, 15000, 15000, 15000, 15000, 15000, 15000, 15000, 15000, 15000, 15000, 15000, 15000, 15000, 15000, 15000];
_local1 = 10;
waveBaseType[_local1] = ["Minion", "Minion", "Minion", "Minion", "Minion", "Minion"];
waveBaseHatch[_local1] = [0, 1, 2, 3, 4, 5];
waveBaseShotStart[_local1] = [0, 500, 1000, 1500, 2000, 2500];
waveBaseShotDelta[_local1] = [4000, 4000, 4000, 4000, 4000, 4000];
_local1 = 11;
waveBaseType[_local1] = ["Mine", "Mine", "Mine", "Mine", "Mine", "Mine"];
waveBaseShotStart[_local1] = [0, 500, 1000, 1500, 2000, 2500];
waveBaseShotDelta[_local1] = [3000, 3000, 3000, 3000, 3000, 3000];
_local1 = 12;
waveBaseType[_local1] = ["Minion", "Mine", "Mine", "Missile", "Missile", "Missile"];
waveBaseShotStart[_local1] = [1000, 2000, 2000, 0, 0, 0];
waveBaseShotDelta[_local1] = [2000, 2000, 2000, 0, 0, 0];
mneHtp = new Array();
mneHtp = [30, 80, 120];
mneDam = new Array();
mneDam = [15, 20, 30];
mneSpd = new Array();
mneSpd = [150, 175, 200];
mnnHtp = new Array();
mnnHtp = [30, 80, 120];
mnnDam = new Array();
mnnDam = [15, 20, 30];
mnnSpd = new Array();
mnnSpd = [100, 125, 150];
lsrHtp = new Array();
lsrHtp = [30, 80, 120];
lsrDlt = new Array();
lsrDlt = [300, 150, 150];
lsrDam = new Array();
lsrDam = [10, 10, 15];
rktHtp = new Array();
rktHtp = [30, 80, 120];
rktDlt = new Array();
rktDlt = [300, 200, 200];
rktDam = new Array();
rktDam = [20, 20, 30];
rktSpd = new Array();
rktSpd = [400, 600, 600];
rktStk = new Array();
rktStk = [50, 100, 100];
mslHtp = new Array();
mslHtp = [30, 80, 120];
mslDlt = new Array();
mslDlt = [450, 250, 250];
mslDam = new Array();
mslDam = [30, 40, 60];
mslSpd = new Array();
mslSpd = [400, 600, 600];
mslFue = new Array();
mslFue = [500, 750, 750];
mslStk = new Array();
mslStk = [50, 100, 100];
}
public function arLogoButtonClick(_arg1:MouseEvent){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.arcadereign.com");
navigateToURL(_local2, "_blank");
}
function frame4(){
locker.pLoaded.text = "This game is locked!";
locker.lText.text = ownerDomain;
stop();
}
function frame5(){
gotoAndStop("locked");
}
function frame3(){
stop();
ownerDomain = "";
checkDomainLock();
checkFeatureLock();
}
function frame7(){
gotoAndStop("intro");
}
function frame2(){
stop();
adsNetwork = "MochiAds";
adsNetworkID = "b840724246f22f76";
loader = new LoaderMovieClip();
loader.x = (loader.y = 0);
addChild(loader);
if (adsNetwork == ""){
addEventListener(Event.ENTER_FRAME, updateLoad);
};
if (adsNetwork == "MochiAds"){
MochiAd.showPreGameAd({clip:MovieClip(this), id:adsNetworkID, res:"640x480", no_bg:true});
};
}
function frame35(){
soundSystem.swap(0);
MovieClip(root).resetGameState();
stop();
}
function frame34(){
stage.quality = "HIGH";
stage.frameRate = 60;
soundSystem.registerMusic(techWarsIntro);
soundSystem.registerMusic(techWarsMenu);
soundSystem.registerMusic(techWarsGame);
stop();
}
function frame38(){
gotoAndStop("game");
}
function frame1(){
bot = "ddb7a62e";
if (bot != ""){
MochiBot.track(this, bot);
};
}
function frame36(){
stop();
}
function frame33(){
stage.quality = "HIGH";
stage.frameRate = 24;
arLogoButton.addEventListener(MouseEvent.CLICK, arLogoButtonClick);
stop();
}
function frame37(){
soundSystem.swap(2);
stop();
}
function frame39(){
soundSystem.swap(1);
stop();
}
function frame44(){
stop();
}
public function proceed(){
gotoAndPlay("sponsorIntro");
if (loader != null){
removeChild(loader);
};
}
function frame46(){
addEventListener(Event.ENTER_FRAME, update);
gotoAndStop("mainMenu");
}
function frame41(){
stop();
}
function frame42(){
soundSystem.swap(1);
endClip.gotoAndPlay(1);
stop();
}
function frame40(){
soundSystem.swap(1);
stop();
}
public function update(_arg1:Event){
Mouse.hide();
}
function frame43(){
stop();
}
function frame45(){
removeEventListener(Event.ENTER_FRAME, update);
Mouse.show();
}
public function checkFeatureLock(){
var _local1:Array;
var _local2:*;
var _local3:String;
var _local4:String;
root.featureLock = true;
_local1 = new Array();
fullDomain = ["www.arcadereign.com", "www8.agame.com"];
for (_local2 in fullDomain) {
_local3 = this.root.loaderInfo.url.split("/")[2];
_local4 = fullDomain[_local2];
if (_local3.indexOf(_local4) == (_local3.length - _local4.length)){
root.featureLock = false;
};
};
}
public function checkDomainLock(){
var _local1:String;
if (ownerDomain == ""){
proceed();
return;
};
_local1 = this.root.loaderInfo.url.split("/")[2];
if (_local1.indexOf(ownerDomain) == (_local1.length - ownerDomain.length)){
proceed();
} else {
locked = true;
gotoAndStop("locked");
};
}
public function resetGameState(){
playerMaxHtp = (playerHtp = 200);
totalDamage = 0;
totalDamageTaken = 0;
totalUnits = 0;
totalShotsFired = 0;
totalShotsHit = 0;
totalTime = 0;
totalCash = 0;
playerCash = 0;
playerAcc = 20;
playerSpd = 25;
playerFrc = 15;
playerLsrDltLvl = 1;
playerLsrDamLvl = 1;
playerRktDltLvl = 0;
playerRktDamLvl = 1;
playerRktSpdLvl = 0;
playerRktStkLvl = 0;
playerRktStkUni = 50;
playerMslDltLvl = 0;
playerMslDamLvl = 1;
playerMslSpdLvl = 0;
playerMslFueLvl = 0;
playerMslStkLvl = 0;
playerMslStkUni = 50;
totalWaves = 0;
currWaves = 0;
currentDifficulty = 0;
currentLevel = 0;
}
public function updateLoad(_arg1:Event){
var _local2:*;
var _local3:*;
_local2 = MovieClip(root).loaderInfo.bytesTotal;
_local3 = MovieClip(root).loaderInfo.bytesLoaded;
loader.pLoaded.text = (String(Math.round(((_local3 * 100) / _local2))) + "%");
if (_local3 >= _local2){
removeEventListener(Event.ENTER_FRAME, updateLoad);
play();
};
}
public function getCompleted():int{
var _local1:int;
var _local2:int;
if (currentLevel == 0){
return (0);
};
_local1 = 0;
_local2 = 1;
while (_local2 <= currentLevel) {
_local1 = (_local1 + levelHatchW[_local2].length);
_local2++;
};
return (_local1);
}
public function keyD(_arg1:KeyboardEvent){
if ((((_arg1.keyCode == 65)) || ((_arg1.keyCode == 37)))){
level.playerShip.setLThrust(true);
};
if ((((_arg1.keyCode == 68)) || ((_arg1.keyCode == 39)))){
level.playerShip.setRThrust(true);
};
if ((((_arg1.keyCode == 87)) || ((_arg1.keyCode == 38)))){
level.playerShip.setUThrust(true);
};
if ((((_arg1.keyCode == 83)) || ((_arg1.keyCode == 40)))){
level.playerShip.setDThrust(true);
};
if (_arg1.keyCode == 69){
level.wManager.nextWeapon();
};
if (_arg1.keyCode == 81){
level.wManager.previousWeapon();
};
if (_arg1.keyCode == 49){
level.wManager.activateWeapon("laser");
};
if (_arg1.keyCode == 50){
level.wManager.activateWeapon("rocket");
};
if (_arg1.keyCode == 51){
level.wManager.activateWeapon("missile");
};
}
public function keyU(_arg1:KeyboardEvent){
if ((((_arg1.keyCode == 65)) || ((_arg1.keyCode == 37)))){
level.playerShip.setLThrust(false);
};
if ((((_arg1.keyCode == 68)) || ((_arg1.keyCode == 39)))){
level.playerShip.setRThrust(false);
};
if ((((_arg1.keyCode == 87)) || ((_arg1.keyCode == 38)))){
level.playerShip.setUThrust(false);
};
if ((((_arg1.keyCode == 83)) || ((_arg1.keyCode == 40)))){
level.playerShip.setDThrust(false);
};
}
}
}//package
Section 25
//GameComplete (GameComplete)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class GameComplete extends MovieClip {
public var ok:SimpleButton;
public function GameComplete(){
addFrameScript(0, frame1);
}
public function gotoGameComplete(_arg1:MouseEvent){
MovieClip(root).gotoAndStop("gameFinishedStats");
}
function frame1(){
ok.addEventListener(MouseEvent.CLICK, gotoGameComplete);
}
}
}//package
Section 26
//Hatch (Hatch)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Hatch extends MovieClip {
public const msOfAnim = 1000;
public var animStartTimer:int;
public function updateHatch(_arg1:Event){
var _local2:*;
_local2 = (getTimer() - animStartTimer);
gotoAndStop(Math.floor(((_local2 / msOfAnim) * 7)));
if (_local2 >= msOfAnim){
removeEventListener(Event.ENTER_FRAME, updateHatch);
};
}
public function openHatch(){
animStartTimer = getTimer();
gotoAndStop(0);
addEventListener(Event.ENTER_FRAME, updateHatch);
}
}
}//package
Section 27
//HatchOpen (HatchOpen)
package {
import flash.media.*;
public dynamic class HatchOpen extends Sound {
}
}//package
Section 28
//HiTechFont96 (HiTechFont96)
package {
import flash.text.*;
public dynamic class HiTechFont96 extends Font {
}
}//package
Section 29
//LaserAim (LaserAim)
package {
import flash.display.*;
public class LaserAim extends MovieClip {
public var owner:MovieClip;
public var isActive:Boolean;// = true
public function LaserAim(_arg1:MovieClip){
isActive = true;
super();
owner = _arg1;
}
public function setActive(_arg1:Boolean){
isActive = _arg1;
}
public function fire(_arg1:Number){
alpha = _arg1;
}
public function update(){
rotation = owner.rotation;
if (isActive){
alpha = (alpha - 0.1);
if (alpha < 0.1){
alpha = 0.1;
};
} else {
alpha = 0;
};
}
}
}//package
Section 30
//LaserFire (LaserFire)
package {
import flash.media.*;
public dynamic class LaserFire extends Sound {
}
}//package
Section 31
//LaserShot (LaserShot)
package {
import flash.display.*;
public dynamic class LaserShot extends MovieClip {
}
}//package
Section 32
//Level (Level)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
public class Level extends MovieClip {
public var currentWave:int;
public var shotLabel:TextField;
public var shotsHit:int;
public var gameLabel:TextField;
public var timeLabel:TextField;
public var gameText:TextField;
public var countDown:Timer;
public var levelTime:int;
public var lastTime:Number;
public var gStats:MovieClip;
public var currentHatchPosition:int;
public var levelStatus:String;
public var damageTaken:int;
public var upSide:MovieClip;
public var deltaTime:Number;
public var laserAim:MovieClip;
public var playerShip:PlayerShip;
public var damageLabel:TextField;
public var cService:vgsCollisionDetection;
public var cashText:TextField;
public var downSide:MovieClip;
public var levelHatch:Array;
public var killsLabel:TextField;
public var wManager:WeaponsManager;
public var damageText:TextField;
public var levelStart:int;
public var shotText:TextField;
public var gManager:MovieClip;
public var damageGiven:int;
public var levelScore:int;
public var unitsDestroyed:int;
public var cashLabel:TextField;
public var enemy:Array;
public var eManager:vgsParticleExplosion;
public var timeText:TextField;
public var killsText:TextField;
public var rightSide:MovieClip;
public var shotsFired:int;
public var currentTime:Number;
public var projectile:Array;
public var leftSide:MovieClip;
public function Level(){
addFrameScript(0, frame1);
gManager = MovieClip(root);
playerShip = new PlayerShip(gManager.playerHtp);
playerShip.lManager = this;
playerShip.gManager = gManager;
laserAim = new LaserAim(playerShip.ship);
playerShip.x = 240;
playerShip.y = 240;
playerShip.maxSpeed = gManager.playerSpd;
playerShip.maxAccel = gManager.playerAcc;
playerShip.friction = gManager.playerFrc;
levelHatch = new Array();
currentWave = 0;
currentHatchPosition = 0;
damageGiven = 0;
damageTaken = 0;
shotsFired = 0;
shotsHit = 0;
levelTime = 0;
unitsDestroyed = 0;
enemy = new Array();
projectile = new Array();
buildHatchs();
eManager = new vgsParticleExplosion(Particle, MovieClip(this), 6);
wManager = new WeaponsManager(this, gManager);
cService = new vgsCollisionDetection();
launchWave();
addEventListener(Event.ENTER_FRAME, update);
}
public function cycleWeapons(_arg1:MouseEvent){
if (_arg1.delta < 0){
wManager.nextWeapon();
} else {
wManager.previousWeapon();
};
}
public function buildHatchs(){
var _local1:Array;
var _local2:Array;
var _local3:int;
var _local4:MovieClip;
_local1 = new Array();
_local2 = new Array();
_local1 = gManager.levelHatchX[gManager.currentLevel];
_local2 = gManager.levelHatchY[gManager.currentLevel];
_local3 = 0;
while (_local3 < _local1.length) {
levelHatch[_local3] = new Hatch();
levelHatch[_local3].x = _local1[_local3];
levelHatch[_local3].y = _local2[_local3];
levelHatch[_local3].gotoAndStop(0);
addChild(levelHatch[_local3]);
_local3++;
};
_local4 = new Hatch();
new Hatch().x = (_local4.y = 240);
_local4.gotoAndStop(0);
addChild(_local4);
levelHatch[levelHatch.length] = _local4;
}
function frame1(){
stop();
}
public function update(_arg1:Event){
currentTime = getTimer();
deltaTime = (currentTime - lastTime);
lastTime = (lastTime + deltaTime);
levelScore = Math.round(((((damageGiven - damageTaken) / damageGiven) + (shotsHit / shotsFired)) + ((unitsDestroyed / (levelTime / 1000)) * 10000)));
if ((((((((levelStatus == "moving")) || ((levelStatus == "buildingBases")))) || ((levelStatus == "openingHatchs")))) || ((levelStatus == "buildingComplete")))){
playerShip.updateShip();
};
if (levelStatus == "playing"){
playerShip.updateShip();
updateEnemies();
wManager.update(currentTime, deltaTime);
updateHUD();
if (playerShip.hitPoints == 0){
levelStatus = "gameOver";
endGame();
return;
};
if (enemy.length == 0){
currentWave++;
if (currentWave == gManager.levelHatchW[gManager.currentLevel].length){
levelStatus = "finished";
endGame();
return;
};
launchWave();
return;
};
};
updateProjectiles();
}
public function updateEnemies(){
var _local1:*;
for (_local1 in enemy) {
enemy[_local1].update(currentTime, deltaTime);
};
}
public function updateProjectiles(){
var _local1:*;
for (_local1 in projectile) {
projectile[_local1].update(currentTime, deltaTime);
};
}
public function launchWave(){
if (currentWave == 0){
levelStatus = "waiting";
} else {
levelStatus = "moving";
};
countDown = new Timer(1000, 4);
countDown.addEventListener(TimerEvent.TIMER, countDownTick);
countDown.addEventListener(TimerEvent.TIMER_COMPLETE, startGame);
countDown.start();
gameLabel.text = "Next Wave In";
}
public function stopFire(_arg1:MouseEvent){
wManager.stopFire();
}
public function endGame(){
var _local1:MovieClip;
removeEventListener(MouseEvent.MOUSE_DOWN, startFire);
removeEventListener(MouseEvent.MOUSE_UP, stopFire);
gManager.activateEvents(false);
wManager.activateWeapon("laser");
wManager.stopFire();
gManager.cursor.gotoAndStop("normal");
if (levelStatus == "finished"){
gameLabel.text = "Victory!";
if ((gManager.currentLevel + 1) == gManager.levelHatchW.length){
_local1 = new GameComplete();
} else {
_local1 = new LevelWon();
};
damageLabel.y = (damageLabel.y - 450);
setChildIndex(damageLabel, (numChildren - 2));
damageText.y = (damageText.y - 450);
setChildIndex(damageText, (numChildren - 2));
shotLabel.y = (shotLabel.y - 450);
setChildIndex(shotLabel, (numChildren - 2));
shotText.y = (shotText.y - 450);
setChildIndex(shotText, (numChildren - 2));
killsLabel.y = (killsLabel.y - 450);
setChildIndex(killsLabel, (numChildren - 2));
killsText.y = (killsText.y - 450);
setChildIndex(killsText, (numChildren - 2));
timeLabel.y = (timeLabel.y - 450);
setChildIndex(timeLabel, (numChildren - 2));
timeText.y = (timeText.y - 450);
setChildIndex(timeText, (numChildren - 2));
cashLabel.y = (cashLabel.y - 450);
setChildIndex(cashLabel, (numChildren - 2));
cashText.y = (cashText.y - 450);
setChildIndex(cashText, (numChildren - 2));
gManager.totalDamage = (gManager.totalDamage + damageGiven);
gManager.totalDamageTaken = (gManager.totalDamageTaken + playerShip.damageTaken);
gManager.totalUnits = (gManager.totalUnits + unitsDestroyed);
gManager.totalShotsFired = (gManager.totalShotsFired + shotsFired);
gManager.totalShotsHit = (gManager.totalShotsHit + shotsHit);
gManager.totalTime = (gManager.totalTime + levelTime);
gManager.totalCash = (gManager.totalCash + levelScore);
gManager.playerCash = (gManager.playerCash + levelScore);
gManager.playerHtp = playerShip.hitPoints;
gManager.playerRktStkUni = wManager.rocketStock;
gManager.playerMslStkUni = wManager.missileStock;
};
if (levelStatus == "gameOver"){
playerShip.width = (playerShip.height = 0);
laserAim.width = (laserAim.height = 0);
gameLabel.text = "Defeat!";
_local1 = new LevelLost();
};
_local1.x = 564;
_local1.y = 435;
addChildAt(_local1, (numChildren - 1));
levelStatus = "done";
}
public function updateHUD(){
damageText.text = (String(Math.round((((damageGiven - damageTaken) / damageGiven) * 100))) + "%");
shotText.text = (String(Math.round(((shotsHit / shotsFired) * 100))) + "%");
killsText.text = String(unitsDestroyed);
timeText.text = String(Math.round((levelTime / 1000)));
cashText.text = (String(levelScore) + "$");
setChildIndex(rightSide, (numChildren - 1));
setChildIndex(upSide, (numChildren - 1));
setChildIndex(downSide, (numChildren - 1));
setChildIndex(leftSide, (numChildren - 1));
setChildIndex(gStats, (numChildren - 1));
setChildIndex(gameLabel, (numChildren - 1));
setChildIndex(gameText, (numChildren - 1));
levelTime = (currentTime - levelStart);
}
public function startGame(_arg1:TimerEvent){
if (currentWave == 0){
levelScore = 0;
addEventListener(MouseEvent.MOUSE_DOWN, startFire);
addEventListener(MouseEvent.MOUSE_UP, stopFire);
addEventListener(MouseEvent.MOUSE_WHEEL, cycleWeapons);
};
levelStatus = "playing";
gameLabel.text = "Wave";
gameText.text = ((String((currentWave + 1)) + "/") + String(gManager.levelHatchW[gManager.currentLevel].length));
}
public function destroyProjectile(_arg1:MovieClip){
var _local2:int;
_local2 = projectile.indexOf(_arg1);
removeChild(projectile[_local2]);
projectile.splice(_local2, 1);
}
public function countDownTick(_arg1:TimerEvent){
var _local2:Array;
var _local3:Array;
var _local4:Array;
var _local5:int;
var _local6:int;
var _local7:Sound;
var _local8:SoundChannel;
var _local9:SoundTransform;
var _local10:int;
gameText.text = String((4 - countDown.currentCount));
gStats.hitPointsCounter.text = String(playerShip.hitPoints);
gStats.rocketCounter.text = String(wManager.rocketStock);
gStats.missileCounter.text = String(wManager.missileStock);
if (countDown.currentCount == 1){
levelStatus = "openingHatchs";
_local2 = new Array();
_local3 = new Array();
_local4 = new Array();
_local2 = gManager.levelHatchW[gManager.currentLevel];
_local5 = _local2[currentWave];
_local3 = gManager.waveBaseType[_local5];
_local4 = gManager.levelHatchP[gManager.currentLevel];
_local6 = currentHatchPosition;
while (_local6 < (currentHatchPosition + _local3.length)) {
levelHatch[_local4[_local6]].openHatch();
_local6++;
};
if (currentWave == 0){
levelStatus = "openingHatchsWithPlayer";
levelHatch[(levelHatch.length - 1)].openHatch();
};
_local7 = new HatchOpen();
_local8 = new SoundChannel();
_local9 = new SoundTransform(MovieClip(root).soundFXVol, 0);
_local8 = _local7.play();
_local8.soundTransform = _local9;
};
if (countDown.currentCount == 2){
levelStatus = "buildingBases";
buildBases();
if (currentWave == 0){
levelStatus = "buildingBasesAndPlayerShip";
addChild(playerShip);
};
};
if (countDown.currentCount == 3){
if (currentWave == 0){
gManager.activateEvents(true);
wManager.activateWeapon("laser");
lastTime = (levelStart = getTimer());
levelStatus = "buildingComplete";
};
_local10 = 0;
while (_local10 < levelHatch.length) {
levelHatch[_local10].gotoAndStop(0);
_local10++;
};
};
}
public function destroyEnemy(_arg1:MovieClip){
var _local2:int;
_local2 = enemy.indexOf(_arg1);
removeChild(enemy[_local2]);
enemy.splice(_local2, 1);
}
public function startFire(_arg1:MouseEvent){
wManager.startFire();
}
public function createEnemy(_arg1:String, _arg2:MovieClip, _arg3:Number, _arg4:int, _arg5:int){
var _local6:MovieClip;
if (_arg1 == "Mine"){
_local6 = new EnemyMine(_arg3, _arg4, _arg5);
};
if (_arg1 == "Minion"){
_local6 = new EnemyMinion(_arg4, _arg5);
};
_local6.sTransform.volume = MovieClip(root).soundFXVol;
_local6.x = _arg2.x;
_local6.y = _arg2.y;
addChild(_local6);
enemy.push(_local6);
}
public function buildBases(){
var _local1:MovieClip;
var _local2:Array;
var _local3:Array;
var _local4:Array;
var _local5:Array;
var _local6:*;
var _local7:int;
var _local8:*;
var _local9:int;
_local2 = new Array();
_local3 = new Array();
_local4 = new Array();
_local5 = new Array();
_local6 = new Array();
_local6 = gManager.levelHatchW[gManager.currentLevel];
_local7 = _local6[currentWave];
_local2 = gManager.waveBaseType[_local7];
_local3 = gManager.levelHatchP[gManager.currentLevel];
_local4 = gManager.waveBaseShotStart[_local7];
_local5 = gManager.waveBaseShotDelta[_local7];
_local8 = ((gManager.currentLevel - 1) * 5);
_local9 = 0;
while (_local9 < _local2.length) {
if (_local2[_local9] == "Mine"){
_local1 = new EnemyMineBase();
_local1.htp = (gManager.mneHtp[gManager.currentDifficulty] + _local8);
_local1.dam = gManager.mneDam[gManager.currentDifficulty];
_local1.spd = gManager.mneSpd[gManager.currentDifficulty];
_local1.shotStart = _local4[_local9];
_local1.shotDelta = _local5[_local9];
};
if (_local2[_local9] == "Minion"){
_local1 = new EnemyMinionBase();
_local1.htp = (gManager.mnnHtp[gManager.currentDifficulty] + _local8);
_local1.dam = gManager.mnnDam[gManager.currentDifficulty];
_local1.spd = gManager.mnnSpd[gManager.currentDifficulty];
_local1.shotStart = _local4[_local9];
_local1.shotDelta = _local5[_local9];
};
if (_local2[_local9] == "Laser"){
_local1 = new EnemyLaserTurret();
_local1.htp = (gManager.lsrHtp[gManager.currentDifficulty] + _local8);
_local1.dam = gManager.lsrDam[gManager.currentDifficulty];
_local1.shotStart = 0;
_local1.shotDelta = gManager.lsrDlt[gManager.currentDifficulty];
};
if (_local2[_local9] == "Rocket"){
_local1 = new EnemyRocketTurret();
_local1.htp = (gManager.rktHtp[gManager.currentDifficulty] + _local8);
_local1.dam = gManager.rktDam[gManager.currentDifficulty];
_local1.spd = gManager.rktSpd[gManager.currentDifficulty];
_local1.shotStart = 0;
_local1.shotDelta = (gManager.rktDlt[gManager.currentDifficulty] * 2);
};
if (_local2[_local9] == "Missile"){
_local1 = new EnemyMissileTurret();
_local1.htp = (gManager.mslHtp[gManager.currentDifficulty] + _local8);
_local1.dam = gManager.mslDam[gManager.currentDifficulty];
_local1.spd = gManager.mslSpd[gManager.currentDifficulty];
_local1.fue = gManager.mslFue[gManager.currentDifficulty];
_local1.shotStart = 0;
_local1.shotDelta = (gManager.mslDlt[gManager.currentDifficulty] * 2);
};
_local1.x = levelHatch[_local3[currentHatchPosition]].x;
_local1.y = levelHatch[_local3[currentHatchPosition]].y;
_local1.sTransform.volume = MovieClip(root).soundFXVol;
currentHatchPosition++;
_local1.raiseBase();
addChild(_local1);
enemy.push(_local1);
_local9++;
};
}
}
}//package
Section 33
//LevelLost (LevelLost)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class LevelLost extends MovieClip {
public var retry:SimpleButton;
public var mainMenu:SimpleButton;
public function LevelLost(){
addFrameScript(0, frame1);
}
function frame1(){
retry.addEventListener(MouseEvent.CLICK, reLaunch);
mainMenu.addEventListener(MouseEvent.CLICK, launchMainMenu);
}
public function launchMainMenu(_arg1:MouseEvent){
MovieClip(root).gotoAndStop("highScores");
}
public function reLaunch(_arg1:MouseEvent){
MovieClip(root).gotoAndStop("retry");
}
}
}//package
Section 34
//LevelWon (LevelWon)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class LevelWon extends MovieClip {
public var hangar:SimpleButton;
public var nextLevel:SimpleButton;
public function LevelWon(){
addFrameScript(0, frame1);
}
function frame1(){
nextLevel.addEventListener(MouseEvent.CLICK, launchNextLevel);
hangar.addEventListener(MouseEvent.CLICK, launchHangar);
}
public function launchHangar(_arg1:MouseEvent){
MovieClip(root).gotoAndStop("hangar");
}
public function launchNextLevel(_arg1:MouseEvent){
MovieClip(root).currentLevel++;
MovieClip(root).gotoAndStop("retry");
}
}
}//package
Section 35
//LoaderMovieClip (LoaderMovieClip)
package {
import flash.display.*;
import flash.text.*;
public dynamic class LoaderMovieClip extends MovieClip {
public var pLoaded:TextField;
public var lText:TextField;
}
}//package
Section 36
//MainMenu (MainMenu)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class MainMenu extends MovieClip {
public var hard:SimpleButton;
public var arlogomain:MovieClip;
public var moreGamesB:SimpleButton;
public var creditsButton:SimpleButton;
public var impossible:SimpleButton;
public var options:SimpleButton;
public function MainMenu(){
addFrameScript(0, frame1);
}
public function launchHard(_arg1:MouseEvent){
MovieClip(parent).currentDifficulty = 1;
MovieClip(parent).gotoAndStop("tutorial");
}
public function launchOptions(_arg1:MouseEvent){
var _local2:MovieClip;
_local2 = new SceneOptions();
_local2.x = 320;
_local2.y = 240;
addChild(_local2);
}
public function launchCredits(_arg1:MouseEvent){
MovieClip(parent).gotoAndStop("credits");
}
function frame1(){
hard.addEventListener(MouseEvent.CLICK, launchHard);
impossible.addEventListener(MouseEvent.CLICK, launchImpossible);
options.addEventListener(MouseEvent.CLICK, launchOptions);
creditsButton.addEventListener(MouseEvent.CLICK, launchCredits);
arlogomain.addEventListener(MouseEvent.CLICK, launchSponsorWebsite);
moreGamesB.addEventListener(MouseEvent.CLICK, launchSponsorWebsite);
}
public function launchImpossible(_arg1:MouseEvent){
var _local2:URLRequest;
if (!root.featureLock){
MovieClip(parent).currentDifficulty = 2;
MovieClip(parent).gotoAndStop("tutorial");
} else {
_local2 = new URLRequest("http://www.arcadereign.com/games/840/tech-wars.html");
navigateToURL(_local2, "_blank");
};
}
public function launchSponsorWebsite(_arg1:MouseEvent){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.arcadereign.com");
navigateToURL(_local2, "_blank");
}
}
}//package
Section 37
//MetalBang (MetalBang)
package {
import flash.media.*;
public dynamic class MetalBang extends Sound {
}
}//package
Section 38
//MissileAim (MissileAim)
package {
import flash.display.*;
import flash.events.*;
public class MissileAim extends MovieClip {
public var aDirection:String;
public var sDirection:String;
public var cTarget:MovieClip;
public function MissileAim(){
addFrameScript(116, frame117);
aDirection = "down";
sDirection = "shrink";
cTarget = null;
}
function frame117(){
gotoAndPlay(10);
}
public function setTarget(_arg1:MovieClip){
if (_arg1 != cTarget){
gotoAndPlay(0);
cTarget = _arg1;
};
}
public function update(_arg1:Event){
if (aDirection == "down"){
alpha = (alpha - 0.01);
if (alpha <= 0.25){
aDirection = "up";
};
} else {
alpha = (alpha + 0.01);
if (alpha >= 0.5){
aDirection = "down";
};
};
if (sDirection == "shrink"){
scaleX = (scaleX - 0.01);
scaleY = scaleX;
if (scaleX <= 0.7){
sDirection = "grow";
};
} else {
scaleX = (scaleX + 0.01);
scaleY = scaleX;
if (scaleX >= 1){
sDirection = "shrink";
};
};
rotation = (rotation + 0.3);
}
}
}//package
Section 39
//MissileLaunch (MissileLaunch)
package {
import flash.media.*;
public dynamic class MissileLaunch extends Sound {
}
}//package
Section 40
//MochiAd (MochiAd)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return ("2.5");
}
public static function showClickAwayAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_timeout:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var sendHostProgress:Boolean;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
}, ad_skipped:function ():void{
}};
options = _slot1._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
if (!_slot1.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
_slot1._cleanup(mc);
options.ad_finished();
};
wh = _slot1._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
_slot1.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (_arg1:Number, _arg2:Object):void{
_slot1.rpc(clip, _arg1, _arg2);
};
sendHostProgress = false;
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
_local3 = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.root == null){
_local3 = true;
};
if (_local3){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (_arg1.origFrameRate != undefined){
_arg1.stage.frameRate = _arg1.origFrameRate;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad._containerLCName != undefined){
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"});
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
}, ad_skipped:function ():void{
}};
options = _slot1._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 (!_slot1.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
_slot1._cleanup(mc);
options.ad_finished();
};
wh = _slot1._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
_slot1.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
_slot1.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
_slot1.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
chk.started = getTimer();
_slot1.adShowing(clip);
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
};
return (_local3);
}
public static function _cleanup(_arg1:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
idx = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _slot1._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = _slot1.getVersion();
clip = options.clip;
if (!_slot1._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = _slot1._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
_slot1.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
if (typeof(_arg1[_local4[_local5]]) == "function"){
return (_arg1[_local4[_local5]].apply(_arg1, _arg3));
};
return (undefined);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function adShowing(_arg1:Object):void{
_arg1.origFrameRate = _arg1.stage.frameRate;
_arg1.stage.frameRate = 30;
}
public static function getValue(_arg1:Object, _arg2:String):Object{
var _local3:Array;
var _local4:Number;
_local3 = _arg2.split(".");
_local4 = 0;
while (_local4 < (_local3.length - 1)) {
if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local3[_local4]];
_local4++;
};
return (_arg1[_local3[_local4]]);
}
public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{
var _local4:Object;
var _local5:Object;
switch (_arg3.id){
case "setValue":
_slot1.setValue(_arg1, _arg3.objectName, _arg3.value);
break;
case "getValue":
_local4 = _slot1.getValue(_arg1, _arg3.objectName);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4);
break;
case "runMethod":
_local5 = _slot1.runMethod(_arg1, _arg3.method, _arg3.args);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5);
break;
};
}
public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return;
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
_arg1[_local4[_local5]] = _arg3;
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var sendHostProgress:Boolean;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
}, ad_skipped:function ():void{
}, ad_progress:function (_arg1:Number):void{
}};
options = _slot1._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
setTimeout(options.ad_finished, 100);
return;
};
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!_slot1.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
_slot1._cleanup(mc);
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = _slot1._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = 10;
bar.y = (h - 20);
};
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
_slot1.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
_slot1.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){
_slot1.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
_slot1.rpc(clip, _arg1, _arg2);
};
mc.rpcTestFn = function (_arg1:String):Object{
return (_arg1);
};
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (_arg1:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
options.ad_progress(_local10);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local7});
if (_local7 == 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local11 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local11 > 0){
chk.showing = true;
chk.started = getTimer();
_slot1.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local7 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
_slot1.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
_slot1.showInterLevelAd(_arg1);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 41
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 42
//MochiScores (MochiScores)
package {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(_arg1:Object=null):void{
var options = _arg1;
if (options != null){
if (options.clip != null){
if ((options.clip is Sprite)){
MochiServices.setContainer(options.clip);
};
delete options.clip;
} else {
MochiServices.setContainer();
};
MochiServices.stayOnTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
//unresolved jump
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
//unresolved jump
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
//unresolved jump
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (_slot1.boardID != null){
options.boardID = _slot1.boardID;
};
};
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local2:Object;
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
_local2 = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (_arg1 != null){
if (_arg1.error != null){
if (_arg1.error == true){
if (onErrorHandler != null){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
};
};
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
_slot1.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package
Section 43
//MochiScoresMC (MochiScoresMC)
package {
import flash.display.*;
public class MochiScoresMC extends MovieClip {
public function MochiScoresMC(){
MochiScores.showLeaderboard({boardID:"b349074fe754477a", score:root.totalCash});
}
}
}//package
Section 44
//MochiServices (MochiServices)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
private static var _sendChannel:LocalConnection;
private static var _rcvChannelName:String;
private static var _gatewayURL:String = "http://www.mochiads.com/static/lib/services/services.swf";
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _listenChannel:LocalConnection;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _startTime:Number;
private static var _connecting:Boolean = false;
public static var onError:Object;
private static var _listenChannelName:String = "__mochiservices";
private static var _rcvChannel:LocalConnection;
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_sendChannel.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
onError("NotConnected");
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_clip._nextcallbackID++;
};
};
}
public static function get connected():Boolean{
return (_connected);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (_clip != null){
if (_clip._queue != null){
while (_clip._queue.length > 0) {
_local2 = _clip._queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _clip._callbacks[_local2.callbackID];
};
delete _clip._callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
public static function get childClip():Object{
return (_clip);
}
public static function get id():String{
return (_id);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, _slot1.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function getVersion():String{
return ("1.32");
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_listenChannel.close();
_rcvChannel.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
Security.allowDomain("*");
Security.allowInsecureDomain("*");
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
return (_local2);
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, _slot1.bringToTop);
if (_clip.parent != null){
Sprite(_clip.parent).removeChild(_clip);
};
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_arg1 != null){
if ((_arg1 is Sprite)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function onStatus(_arg1:StatusEvent):void{
switch (_arg1.level){
case "error":
_connected = false;
_listenChannel.connect(_listenChannelName);
break;
};
}
private static function initComChannels():void{
if (!_connected){
_sendChannel.addEventListener(StatusEvent.STATUS, _slot1.onStatus);
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_container, version:getVersion()});
_rcvChannel.addEventListener(StatusEvent.STATUS, _slot1.onStatus);
_clip.onReceive = function (_arg1:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var methodName:String;
var obj:Object;
var pkg = _arg1;
cb = pkg.callbackID;
cblst = this.client._callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
methodName = "";
obj = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
//unresolved jump
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
};
};
};
delete this.client._callbacks[cb];
};
_clip.onError = function ():void{
_slot1.onError("IOError");
};
_rcvChannel.connect(_rcvChannelName);
_connecting = false;
_connected = true;
_listenChannel.close();
while (_clip._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function listen():void{
_listenChannel = new LocalConnection();
_listenChannel.client = _clip;
_clip.handshake = function (_arg1:Object):void{
_slot1.comChannelName = _arg1.newChannel;
};
_listenChannel.allowDomain("*", "localhost");
_listenChannel.allowInsecureDomain("*", "localhost");
_listenChannel.connect(_listenChannelName);
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
_rcvChannelName = _arg1;
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var clipname:String;
var f:Function;
var req:URLRequest;
var id = _arg1;
var clip = _arg2;
clipname = ("_mochiservices_com_" + id);
if (_clip != null){
return (_clip);
};
if (!_slot1.isNetworkAvailable()){
return (null);
};
_slot1.allowDomains(_gatewayURL);
_clip = createEmptyMovieClip(clip, clipname, 10336, false);
_loader = new Loader();
_timer = new Timer(1000, 0);
_startTime = getTimer();
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
f = function (_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
_slot1.disconnect();
_slot1.onError("IOError");
};
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
req = new URLRequest(_gatewayURL);
_loader.load(req);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain("*", "localhost");
_rcvChannel.allowInsecureDomain("*", "localhost");
_rcvChannel.client = _clip;
_clip._nextcallbackID = 0;
_clip._callbacks = {};
listen();
return (_clip);
}
public static function bringToTop(_arg1:Event):void{
var e = _arg1;
if (_slot1.clip != null){
if (_slot1.childClip != null){
try {
if (_slot1.clip.numChildren > 1){
_slot1.clip.setChildIndex(_slot1.childClip, (_slot1.clip.numChildren - 1));
};
} catch(errorObject:Error) {
_container.removeEventListener(Event.ENTER_FRAME, _slot1.bringToTop);
};
};
};
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
if ((clip is DisplayObject)){
if (((!(_connected)) && ((_clip == null)))){
_connecting = true;
init(id, clip);
};
//unresolved jump
};
if (onError != null){
_slot1.onError = onError;
} else {
if (_slot1.onError == null){
_slot1.onError = function (_arg1:String):void{
};
};
};
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var mc:MovieClip;
var parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
mc = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
try {
parent[name] = mc;
} catch(e:Error) {
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
mc["_name"] = name;
return (mc);
}
public static function connectWait(_arg1:TimerEvent):void{
if ((getTimer() - _startTime) > 10000){
if (!_connected){
_clip._mochiad_ctr_failed = true;
_slot1.disconnect();
_slot1.onError("IOError");
};
_timer.stop();
};
}
}
}//package
Section 45
//MouseGraphics (MouseGraphics)
package {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
public class MouseGraphics extends MovieClip {
public function MouseGraphics(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
Mouse.hide();
mouseEnabled = false;
addEventListener(Event.ENTER_FRAME, update);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame2(){
stop();
}
public function update(_arg1:Event){
MovieClip(parent).setChildIndex(this, (MovieClip(parent).numChildren - 1));
x = parent.mouseX;
y = parent.mouseY;
}
}
}//package
Section 46
//NoAmmo (NoAmmo)
package {
import flash.media.*;
public dynamic class NoAmmo extends Sound {
}
}//package
Section 47
//Particle (Particle)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Particle extends MovieClip {
public function Particle(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7);
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 48
//PlayerShip (PlayerShip)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;
public class PlayerShip extends MovieClip {
public const msOfAnim:int = 1000;
public var fWidth:Number;
public var friction:Number;
public var lThrust:Boolean;
public var dThrust:Boolean;
public var sChannel:SoundChannel;
public var healthBar:MovieClip;
public var sTransf:SoundTransform;
public var uThrust:Boolean;
public var shadow:MovieClip;
public var ship:MovieClip;
public var maxSpeed:Number;
public var fHeight:Number;
public var animStartTimer:int;
public var maxAccel:Number;
public var sMetal:MetalBang;
public var hitPoints:int;
public var rThrust:Boolean;
public var verSpeed:Number;// = 0
public var lastTime:uint;// = 0
public var damageTaken:int;
public var gManager:MovieClip;
public var lManager:MovieClip;
public var horSpeed:Number;// = 0
public var angle:Number;
public var cRadius:int;// = 15
public var iWidth:Number;
public var iHeight:Number;
public function PlayerShip(_arg1:int){
horSpeed = 0;
verSpeed = 0;
cRadius = 15;
lastTime = 0;
super();
hitPoints = _arg1;
damageTaken = 0;
addEventListener(Event.ADDED_TO_STAGE, raiseShip);
sChannel = new SoundChannel();
sMetal = new MetalBang();
sTransf = new SoundTransform(0, 0);
}
public function raise(_arg1:Event){
var _local2:*;
_local2 = (getTimer() - animStartTimer);
width = (iWidth + Math.floor(((_local2 / msOfAnim) * (fWidth - iWidth))));
height = (iHeight + Math.floor(((_local2 / msOfAnim) * (fHeight - iHeight))));
alpha = (_local2 / msOfAnim);
if (_local2 >= msOfAnim){
width = fWidth;
height = fHeight;
alpha = 1;
removeEventListener(Event.ENTER_FRAME, raise);
MovieClip(parent).addChild(MovieClip(parent).laserAim);
};
}
public function setDThrust(_arg1:Boolean){
dThrust = _arg1;
}
public function setLThrust(_arg1:Boolean){
lThrust = _arg1;
}
public function raiseShip(_arg1:Event){
animStartTimer = getTimer();
fWidth = width;
fHeight = height;
width = (width * 0.7);
height = (height * 0.7);
iWidth = width;
iHeight = height;
alpha = 0;
addEventListener(Event.ENTER_FRAME, raise);
}
public function setRThrust(_arg1:Boolean){
rThrust = _arg1;
}
public function updateShip(){
var _local1:uint;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = (getTimer() - lastTime);
_local2 = ((maxAccel * _local1) / 1000);
_local3 = ((friction * _local1) / 1000);
lastTime = (lastTime + _local1);
if (lThrust){
horSpeed = (horSpeed - _local2);
if (horSpeed < -(maxSpeed)){
horSpeed = -(maxSpeed);
};
};
if (rThrust){
horSpeed = (horSpeed + _local2);
if (horSpeed > maxSpeed){
horSpeed = maxSpeed;
};
};
if (uThrust){
verSpeed = (verSpeed - _local2);
if (verSpeed < -(maxSpeed)){
verSpeed = -(maxSpeed);
};
};
if (dThrust){
verSpeed = (verSpeed + _local2);
if (verSpeed > maxSpeed){
verSpeed = maxSpeed;
};
};
if ((((horSpeed < 0)) && (!(lThrust)))){
horSpeed = (horSpeed + _local3);
};
if ((((horSpeed > 0)) && (!(rThrust)))){
horSpeed = (horSpeed - _local3);
};
if ((((verSpeed < 0)) && (!(uThrust)))){
verSpeed = (verSpeed + _local3);
};
if ((((verSpeed > 0)) && (!(dThrust)))){
verSpeed = (verSpeed - _local3);
};
if ((((horSpeed > -0.25)) && ((horSpeed < 0.25)))){
horSpeed = 0;
};
if ((((verSpeed > -0.25)) && ((verSpeed < 0.25)))){
verSpeed = 0;
};
_local4 = (x = (x + horSpeed));
_local5 = (y = (y + verSpeed));
if ((_local4 - 14) <= (cRadius * 2)){
_local4 = (14 + (cRadius * 2));
horSpeed = (horSpeed * -0.35);
};
if ((_local4 + 14) >= (480 - (cRadius * 2))){
_local4 = (466 - (cRadius * 2));
horSpeed = (horSpeed * -0.35);
};
if ((_local5 - 14) <= (cRadius * 2)){
_local5 = (14 + (cRadius * 2));
verSpeed = (verSpeed * -0.35);
};
if ((_local5 + 14) >= (480 - (cRadius * 2))){
_local5 = (466 - (cRadius * 2));
verSpeed = (verSpeed * -0.35);
};
x = _local4;
y = _local5;
ship.angle = (angle = Math.atan2((parent.mouseY - y), (parent.mouseX - x)));
shadow.rotation = (ship.rotation = ((360 * angle) / (2 * Math.PI)));
MovieClip(parent).laserAim.x = x;
MovieClip(parent).laserAim.y = y;
MovieClip(parent).laserAim.update();
}
public function takeDamage(_arg1:Number, _arg2:int){
if (hitPoints <= _arg2){
hitPoints = 0;
} else {
hitPoints = (hitPoints - _arg2);
};
healthBar.width = (hitPoints / 4);
damageTaken = (damageTaken + _arg2);
lManager.damageTaken = (lManager.damageTaken + _arg2);
horSpeed = (horSpeed + ((Math.sin(_arg1) * _arg2) * 0.1));
verSpeed = (verSpeed + ((Math.cos(_arg1) * _arg2) * 0.1));
if (hitPoints <= 0){
MovieClip(parent).eManager.createExplosion(x, y, 0, 1, 30);
MovieClip(parent).eManager.createExplosion(x, y, 0, 3, 20);
MovieClip(parent).eManager.createExplosion(x, y, 75, 0, 100);
hitPoints = 0;
};
MovieClip(parent).eManager.createExplosion(x, y, 20, 1, 10);
MovieClip(parent).gStats.hitPointsCounter.text = hitPoints;
sChannel = sMetal.play();
sTransf.volume = MovieClip(root).soundFXVol;
sChannel.soundTransform = sTransf;
}
public function setUThrust(_arg1:Boolean){
uThrust = _arg1;
}
}
}//package
Section 49
//Projectile (Projectile)
package {
import flash.display.*;
import flash.geom.*;
import flash.media.*;
public class Projectile extends MovieClip {
public var eColor;
public var dSound:Sound;
public var sound:SoundChannel;
public var maxSpeed:Number;
public var sTransform:SoundTransform;
public var eRadius;
public var verSpeed:Number;
public var damage:int;
public var type:int;
public var fuel:Number;
public var horSpeed:Number;
public var cRadius:int;// = 5
public var eParticles;
public function Projectile(){
cRadius = 5;
super();
}
public function checkPlayerCollision(){
var _local1:Point;
var _local2:Point;
var _local3:Number;
var _local4:Number;
_local1 = new Point(MovieClip(parent).playerShip.x, MovieClip(parent).playerShip.y);
_local2 = new Point(x, y);
_local3 = MovieClip(parent).playerShip.cRadius;
_local4 = cRadius;
if (MovieClip(parent).cService.getCircularCollision(_local1, _local3, _local2, _local4)){
MovieClip(parent).playerShip.takeDamage(Math.atan2((_local1.x - _local2.x), (_local1.y - _local2.y)), damage);
return (true);
};
return (false);
}
public function detonate(){
sound = dSound.play();
sTransform = new SoundTransform(MovieClip(root).soundFXVol, 0);
sound.soundTransform = sTransform;
MovieClip(parent).eManager.createExplosion(x, y, eRadius, eColor, eParticles);
MovieClip(parent).destroyProjectile(this);
}
public function loadDefaults(){
sound = new SoundChannel();
}
public function checkWallCollision(){
if (x <= (cRadius / 2)){
return (true);
};
if (x >= (480 - (cRadius / 2))){
return (true);
};
if (y <= (cRadius / 2)){
return (true);
};
if (y >= (480 - (cRadius / 2))){
return (true);
};
return (false);
}
public function checkEnemyCollision(){
var _local1:Array;
var _local2:*;
var _local3:Point;
var _local4:Point;
var _local5:Number;
var _local6:Number;
_local1 = MovieClip(parent).enemy;
_local2 = (_local1.length - 1);
while (_local2 >= 0) {
_local3 = new Point(x, y);
_local4 = new Point(_local1[_local2].x, _local1[_local2].y);
_local5 = cRadius;
_local6 = _local1[_local2].cRadius;
if (MovieClip(parent).cService.getCircularCollision(_local3, _local5, _local4, _local6)){
_local1[_local2].takeDamage(damage);
MovieClip(parent).damageGiven = (MovieClip(parent).damageGiven + damage);
return (true);
};
_local2--;
};
return (false);
}
}
}//package
Section 50
//ProjectileMissile (ProjectileMissile)
package {
import flash.display.*;
public class ProjectileMissile extends Projectile {
public var turningSpeed:Number;
public var myTarget:MovieClip;
public function ProjectileMissile(_arg1:int, _arg2:MovieClip, _arg3:int, _arg4:int, _arg5:int){
type = _arg1;
damage = _arg3;
maxSpeed = (_arg4 / type);
fuel = _arg5;
myTarget = _arg2;
eColor = 2;
eRadius = 25;
eParticles = 25;
dSound = new EnemyMineDestroyed();
}
public function update(_arg1:int, _arg2:int){
var _local3:*;
if (((!((myTarget == null))) && ((myTarget.htp > 0)))){
_local3 = Math.atan2((myTarget.y - y), (myTarget.x - x));
rotation = ((360 * _local3) / (2 * Math.PI));
horSpeed = (Math.cos(_local3) * maxSpeed);
verSpeed = (Math.sin(_local3) * maxSpeed);
};
x = (x + ((horSpeed * _arg2) / 1000));
y = (y + ((verSpeed * _arg2) / 1000));
MovieClip(parent).eManager.createExplosion(x, y, 5, eColor, 2);
fuel = (fuel - _arg2);
if ((((((type == 1)) && (!((myTarget == null))))) && (checkEnemyCollision()))){
MovieClip(parent).shotsHit++;
detonate();
};
if ((((((type == 2)) && (!((myTarget == null))))) && (checkPlayerCollision()))){
detonate();
};
if ((((fuel <= 0)) || (checkWallCollision()))){
detonate();
};
}
}
}//package
Section 51
//ProjectileRocket (ProjectileRocket)
package {
import flash.display.*;
public class ProjectileRocket extends Projectile {
public function ProjectileRocket(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Number){
type = _arg1;
damage = _arg2;
maxSpeed = (_arg3 / type);
rotation = _arg4;
horSpeed = (Math.cos(_arg5) * maxSpeed);
verSpeed = (Math.sin(_arg5) * maxSpeed);
eColor = 1;
eRadius = 25;
eParticles = 25;
dSound = new EnemyMineDestroyed();
}
public function update(_arg1:int, _arg2:int){
x = (x + ((horSpeed * _arg2) / 1000));
y = (y + ((verSpeed * _arg2) / 1000));
if (type == 1){
if (checkEnemyCollision()){
MovieClip(parent).shotsHit++;
detonate();
};
if (checkWallCollision()){
detonate();
};
} else {
if (((checkPlayerCollision()) || (checkWallCollision()))){
detonate();
};
};
}
}
}//package
Section 52
//RocketLaunch (RocketLaunch)
package {
import flash.media.*;
public dynamic class RocketLaunch extends Sound {
}
}//package
Section 53
//SceneGameFinishedStats (SceneGameFinishedStats)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
public class SceneGameFinishedStats extends MovieClip {
public var cashText:TextField;
public var shotLabel:TextField;
public var okButton:SimpleButton;
public var timeLabel:TextField;
public var damageText:TextField;
public var killsLabel:TextField;
public var shotText:TextField;
public var cashLabel:TextField;
public var timeText:TextField;
var endGameCD:Timer;
public var endText:TextField;
public var killsText:TextField;
public var damageLabel:TextField;
public function SceneGameFinishedStats(){
addFrameScript(0, frame1, 1, frame2);
addEventListener(Event.ADDED_TO_STAGE, init);
}
public function init(_arg1:Event){
endGameCD = new Timer(5000, 4);
endGameCD.addEventListener(TimerEvent.TIMER, changeText);
endGameCD.addEventListener(TimerEvent.TIMER_COMPLETE, moveOn);
endGameCD.start();
}
function frame1(){
stop();
}
function frame2(){
if (MovieClip(root).totalDamage == 0){
damageText.text = "0%";
} else {
damageText.text = (String(Math.round((((MovieClip(root).totalDamage - MovieClip(root).totalDamageTaken) / MovieClip(root).totalDamage) * 100))) + "%");
};
if (MovieClip(root).totalShotsHit == 0){
shotText.text = "0%";
} else {
shotText.text = (String(Math.round(((MovieClip(root).totalShotsHit / MovieClip(root).totalShotsFired) * 100))) + "%");
};
killsText.text = MovieClip(root).totalUnits;
timeText.text = String(Math.round((MovieClip(root).totalTime / 1000)));
cashText.text = ("$" + MovieClip(root).totalCash);
okButton.addEventListener(MouseEvent.CLICK, finish);
}
public function moveOn(_arg1:TimerEvent){
gotoAndStop(2);
}
public function finish(_arg1:MouseEvent){
MovieClip(root).gotoAndStop("highScores");
}
public function changeText(_arg1:TimerEvent){
if (endGameCD.currentCount == 1){
endText.text = "Earth arenas are now conquered and you look beyond.";
};
if (endGameCD.currentCount == 2){
endText.text = "What does the future hold for those who accomplished all?";
};
if ((((endGameCD.currentCount == 3)) && ((MovieClip(root).currentDifficulty == 1)))){
endText.text = "Have you faced... the impossible?";
};
if ((((endGameCD.currentCount == 3)) && ((MovieClip(root).currentDifficulty == 2)))){
endText.text = "Impossible is nothing...";
};
}
}
}//package
Section 54
//SceneOptions (SceneOptions)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class SceneOptions extends MovieClip {
public var graphicsHighB:SimpleButton;
public var musicOff:TextField;
public var gld:TextFormat;
public var soundFull:TextField;
public var musicFull:TextField;
public var graphicsMediumB:SimpleButton;
public var soundOffB:SimpleButton;
public var musicFullB:SimpleButton;
public var musicHalfB:SimpleButton;
public var musicOffB:SimpleButton;
public var optionsOKB:SimpleButton;
public var soundHalfB:SimpleButton;
public var graphicsLowB:SimpleButton;
public var wht:TextFormat;
public var graphicsLow:TextField;
public var graphicsHigh:TextField;
public var soundOff:TextField;
public var soundHalf:TextField;
public var graphicsMedium:TextField;
public var soundFullB:SimpleButton;
public var musicHalf:TextField;
public function SceneOptions(){
addFrameScript(0, frame1);
}
public function renderText(){
if (MovieClip(root).soundSystem.maxVolume == 0){
musicOff.setTextFormat(gld);
} else {
musicOff.setTextFormat(wht);
};
if (MovieClip(root).soundSystem.maxVolume == 0.5){
musicHalf.setTextFormat(gld);
} else {
musicHalf.setTextFormat(wht);
};
if (MovieClip(root).soundSystem.maxVolume == 1){
musicFull.setTextFormat(gld);
} else {
musicFull.setTextFormat(wht);
};
if (MovieClip(root).soundFXVol == 0){
soundOff.setTextFormat(gld);
} else {
soundOff.setTextFormat(wht);
};
if (MovieClip(root).soundFXVol == 0.5){
soundHalf.setTextFormat(gld);
} else {
soundHalf.setTextFormat(wht);
};
if (MovieClip(root).soundFXVol == 1){
soundFull.setTextFormat(gld);
} else {
soundFull.setTextFormat(wht);
};
if (stage.quality == "LOW"){
graphicsLow.setTextFormat(gld);
} else {
graphicsLow.setTextFormat(wht);
};
if (stage.quality == "MEDIUM"){
graphicsMedium.setTextFormat(gld);
} else {
graphicsMedium.setTextFormat(wht);
};
if (stage.quality == "HIGH"){
graphicsHigh.setTextFormat(gld);
} else {
graphicsHigh.setTextFormat(wht);
};
}
public function sOff(_arg1:MouseEvent){
MovieClip(root).soundFXVol = 0;
renderText();
}
public function close(_arg1:MouseEvent){
MovieClip(parent).removeChild(this);
}
function frame1(){
gld = new TextFormat(null, null, 14197587);
wht = new TextFormat(null, null, 9606291);
renderText();
optionsOKB.addEventListener(MouseEvent.CLICK, close);
musicOffB.addEventListener(MouseEvent.CLICK, mOff);
musicHalfB.addEventListener(MouseEvent.CLICK, mHalf);
musicFullB.addEventListener(MouseEvent.CLICK, mFull);
soundOffB.addEventListener(MouseEvent.CLICK, sOff);
soundHalfB.addEventListener(MouseEvent.CLICK, sHalf);
soundFullB.addEventListener(MouseEvent.CLICK, sFull);
graphicsLowB.addEventListener(MouseEvent.CLICK, gLow);
graphicsMediumB.addEventListener(MouseEvent.CLICK, gMedium);
graphicsHighB.addEventListener(MouseEvent.CLICK, gHigh);
}
public function gLow(_arg1:MouseEvent){
stage.quality = "LOW";
stage.frameRate = 30;
renderText();
}
public function sHalf(_arg1:MouseEvent){
MovieClip(root).soundFXVol = 0.5;
renderText();
}
public function gHigh(_arg1:MouseEvent){
stage.quality = "HIGH";
stage.frameRate = 60;
renderText();
}
public function mHalf(_arg1:MouseEvent){
MovieClip(root).soundSystem.setVolume(0.5);
renderText();
}
public function sFull(_arg1:MouseEvent){
MovieClip(root).soundFXVol = 1;
renderText();
}
public function mFull(_arg1:MouseEvent){
MovieClip(root).soundSystem.setVolume(1);
renderText();
}
public function mOff(_arg1:MouseEvent){
MovieClip(root).soundSystem.setVolume(0);
renderText();
}
public function gMedium(_arg1:MouseEvent){
stage.quality = "MEDIUM";
stage.frameRate = 30;
renderText();
}
}
}//package
Section 55
//techWarsGame (techWarsGame)
package {
import flash.media.*;
public dynamic class techWarsGame extends Sound {
}
}//package
Section 56
//techWarsIntro (techWarsIntro)
package {
import flash.media.*;
public dynamic class techWarsIntro extends Sound {
}
}//package
Section 57
//techWarsMenu (techWarsMenu)
package {
import flash.media.*;
public dynamic class techWarsMenu extends Sound {
}
}//package
Section 58
//TurretRange (TurretRange)
package {
import flash.display.*;
public dynamic class TurretRange extends MovieClip {
}
}//package
Section 59
//WeaponsManager (WeaponsManager)
package {
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
public class WeaponsManager {
public var missileStock:int;
var sound:SoundChannel;
public var laserDamage:int;
public var lManager:MovieClip;
public var rocketStock:int;
var rocketLaunch:RocketLaunch;
var laserFire:LaserFire;
public var laserDelta:int;
var noAmmo:NoAmmo;
public var laserActive:Boolean;
public var missileDelta:int;
public var missileDamage:int;
public var laserTimer:int;
public var missileAim:MovieClip;
public var missileSpeed:int;
public var rocketDelta:int;
public var gManager:MovieClip;
public var missileActive:Boolean;
public var missileTimer:int;
public var rocketTimer:int;
public var rocketSpeed:int;
public var cursor:MovieClip;
public var rocketDamage:int;
public var laserShot:MovieClip;
var transform:SoundTransform;
public var currentWeapon:String;// = "laser"
var missileLaunch:MissileLaunch;
public var rocketActive:Boolean;
public var missileFuel:int;
public function WeaponsManager(_arg1:MovieClip, _arg2:MovieClip){
currentWeapon = "laser";
super();
lManager = _arg1;
gManager = _arg2;
cursor = _arg2.cursor;
laserActive = false;
laserDelta = gManager.lsrDlt[gManager.playerLsrDltLvl];
laserDamage = gManager.lsrDam[gManager.playerLsrDamLvl];
laserTimer = getTimer();
laserShot = new LaserShot();
rocketActive = false;
rocketDelta = gManager.rktDlt[gManager.playerRktDltLvl];
rocketDamage = gManager.rktDam[gManager.playerRktDamLvl];
rocketSpeed = gManager.rktSpd[gManager.playerRktSpdLvl];
rocketTimer = getTimer();
rocketStock = gManager.playerRktStkUni;
missileActive = false;
missileDelta = gManager.mslDlt[gManager.playerMslDltLvl];
missileDamage = gManager.mslDam[gManager.playerMslDamLvl];
missileSpeed = gManager.mslSpd[gManager.playerMslSpdLvl];
missileTimer = getTimer();
missileStock = gManager.playerMslStkUni;
missileAim = new MissileAim();
missileFuel = gManager.mslFue[gManager.playerMslFueLvl];
missileAim.x = (missileAim.y = 1000);
lManager.addChild(missileAim);
missileAim.play();
missileAim.scaleX = (missileAim.scaleY = 1.5);
laserFire = new LaserFire();
rocketLaunch = new RocketLaunch();
missileLaunch = new MissileLaunch();
noAmmo = new NoAmmo();
sound = new SoundChannel();
transform = new SoundTransform(gManager.soundFXVol, 0);
}
public function fireMissile(_arg1){
var _local2:MovieClip;
if (currentWeapon == "missile"){
_local2 = new ProjectileMissile(1, _arg1, missileDamage, missileSpeed, missileFuel);
_local2.x = lManager.playerShip.x;
_local2.y = lManager.playerShip.y;
sound = missileLaunch.play();
sound.soundTransform = transform;
lManager.projectile.push(_local2);
lManager.addChild(_local2);
lManager.gStats.missileCounter.text = String(--missileStock);
lManager.shotsFired++;
};
}
public function fireRocket(){
var _local1:MovieClip;
var _local2:MovieClip;
var _local3:Point;
_local1 = lManager.playerShip.ship;
_local2 = new ProjectileRocket(1, rocketDamage, rocketSpeed, _local1.rotation, _local1.angle);
_local3 = new Point(_local1.x, _local1.y);
_local3 = _local1.localToGlobal(_local3);
_local2.x = _local3.x;
_local2.y = _local3.y;
sound = rocketLaunch.play();
sound.soundTransform = transform;
lManager.projectile.push(_local2);
lManager.addChild(_local2);
lManager.gStats.rocketCounter.text = String(--rocketStock);
lManager.shotsFired++;
}
public function startFire(){
if (currentWeapon == "laser"){
laserActive = true;
};
if (currentWeapon == "rocket"){
rocketActive = true;
};
if (currentWeapon == "missile"){
missileActive = true;
};
}
public function fireLaser(){
var _local1:MovieClip;
var _local2:Number;
var _local3:MovieClip;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:String;
var _local9:int;
var _local10:*;
var _local11:Point;
var _local12:Point;
var _local13:Number;
_local1 = null;
_local2 = 1000000;
_local4 = Math.atan2((0 - lManager.playerShip.y), (0 - lManager.playerShip.x));
_local5 = Math.atan2((0 - lManager.playerShip.y), (480 - lManager.playerShip.x));
_local6 = Math.atan2((480 - lManager.playerShip.y), (0 - lManager.playerShip.x));
_local7 = Math.atan2((480 - lManager.playerShip.y), (480 - lManager.playerShip.x));
if ((((lManager.playerShip.angle < _local5)) && ((lManager.playerShip.angle > _local4)))){
_local8 = "u";
};
if ((((lManager.playerShip.angle > _local7)) && ((lManager.playerShip.angle < _local6)))){
_local8 = "d";
};
if ((((lManager.playerShip.angle < _local4)) && ((lManager.playerShip.angle <= 0)))){
_local8 = "l";
};
if ((((lManager.playerShip.angle > _local6)) && ((lManager.playerShip.angle > 0)))){
_local8 = "l";
};
if ((((lManager.playerShip.angle > _local5)) && ((lManager.playerShip.angle <= 0)))){
_local8 = "r";
};
if ((((lManager.playerShip.angle < _local7)) && ((lManager.playerShip.angle > 0)))){
_local8 = "r";
};
if (_local8 == "u"){
laserShot.x = (lManager.playerShip.x + ((Math.cos(lManager.playerShip.angle) / Math.sin(lManager.playerShip.angle)) * -(lManager.playerShip.y)));
laserShot.y = 0;
};
if (_local8 == "d"){
laserShot.x = (lManager.playerShip.x + ((Math.cos(lManager.playerShip.angle) / Math.sin(lManager.playerShip.angle)) * (480 - lManager.playerShip.y)));
laserShot.y = 480;
};
if (_local8 == "l"){
laserShot.x = 0;
laserShot.y = (lManager.playerShip.y + (Math.tan(lManager.playerShip.angle) * -(lManager.playerShip.x)));
};
if (_local8 == "r"){
laserShot.x = 480;
laserShot.y = (lManager.playerShip.y + (Math.tan(lManager.playerShip.angle) * (480 - lManager.playerShip.x)));
};
_local9 = 0;
_local10 = 0;
while (_local10 < lManager.enemy.length) {
_local3 = lManager.enemy[_local10];
_local11 = new Point(lManager.playerShip.x, lManager.playerShip.y);
_local12 = new Point(_local3.x, _local3.y);
_local13 = Point.distance(_local11, _local12);
if (_local13 < _local2){
if (testLaserCollision(_local3, 1)){
_local1 = _local3;
_local2 = _local13;
_local9 = _local10;
} else {
if (testLaserCollision(_local3, 2)){
_local1 = _local3;
_local2 = _local13;
_local9 = _local10;
};
};
};
_local10++;
};
if (_local1 != null){
laserShot.x = _local1.x;
laserShot.y = _local1.y;
_local1.takeDamage(laserDamage);
lManager.damageGiven = (lManager.damageGiven + laserDamage);
lManager.shotsHit++;
};
laserShot.rotation = (lManager.playerShip.rotation + 180);
lManager.eManager.createExplosion(laserShot.x, laserShot.y, 0, 1, 2);
lManager.shotsFired++;
}
public function update(_arg1:int, _arg2:int){
var _local3:MovieClip;
var _local4:Number;
var _local5:*;
var _local6:MovieClip;
var _local7:Point;
var _local8:Point;
var _local9:Number;
if (lManager.levelStatus == "playing"){
if (((laserActive) && ((currentWeapon == "laser")))){
if ((_arg1 - laserTimer) >= laserDelta){
fireLaser();
lManager.laserAim.fire(1);
sound = laserFire.play();
sound.soundTransform = transform;
laserTimer = _arg1;
};
};
if (((rocketActive) && ((currentWeapon == "rocket")))){
if ((_arg1 - rocketTimer) >= rocketDelta){
if (rocketStock > 0){
fireRocket();
sound = rocketLaunch.play();
sound.soundTransform = transform;
} else {
sound = noAmmo.play();
sound.soundTransform = transform;
};
rocketTimer = _arg1;
};
};
if (currentWeapon == "missile"){
_local3 = null;
_local4 = 100000000;
_local5 = 0;
while (_local5 < lManager.enemy.length) {
_local6 = lManager.enemy[_local5];
_local7 = new Point(lManager.mouseX, lManager.mouseY);
_local8 = new Point(_local6.x, _local6.y);
_local9 = Point.distance(_local7, _local8);
if (_local9 < _local4){
_local3 = _local6;
_local4 = _local9;
};
_local5++;
};
if (_local3 != null){
missileAim.x = _local3.x;
missileAim.y = _local3.y;
missileAim.setTarget(_local3);
if (((missileActive) && (((_arg1 - missileTimer) >= missileDelta)))){
if (missileStock > 0){
fireMissile(_local3);
sound = missileLaunch.play();
sound.soundTransform = transform;
} else {
sound = noAmmo.play();
sound.soundTransform = transform;
};
missileTimer = _arg1;
};
} else {
missileAim.x = (missileAim.y = 1000);
};
};
};
}
public function testLaserCollision(_arg1:MovieClip, _arg2:int):Boolean{
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Point;
_local3 = new Point(lManager.playerShip.x, lManager.playerShip.y);
_local4 = new Point(laserShot.x, laserShot.y);
_local5 = new Point();
_local6 = new Point();
if (_arg2 == 1){
_local5.x = (_arg1.x - (_arg1.height / 2));
_local5.y = (_arg1.y - (_arg1.width / 2));
_local6.x = (_arg1.x + (_arg1.height / 2));
_local6.y = (_arg1.y + (_arg1.width / 2));
} else {
if (_arg2 == 2){
_local5.x = (_arg1.x - (_arg1.width / 2));
_local5.y = (_arg1.y + (_arg1.width / 2));
_local6.x = (_arg1.x + (_arg1.height / 2));
_local6.y = (_arg1.y - (_arg1.height / 2));
};
};
return (lManager.cService.getSegmentCollision(_local3, _local4, _local5, _local6));
}
public function stopFire(){
laserActive = false;
rocketActive = false;
missileActive = false;
}
public function nextWeapon(){
if (currentWeapon == "laser"){
activateWeapon("rocket");
return;
};
if (currentWeapon == "rocket"){
activateWeapon("missile");
return;
};
if (currentWeapon == "missile"){
activateWeapon("laser");
return;
};
}
public function previousWeapon(){
if (currentWeapon == "laser"){
activateWeapon("missile");
return;
};
if (currentWeapon == "rocket"){
activateWeapon("laser");
return;
};
if (currentWeapon == "missile"){
activateWeapon("rocket");
return;
};
}
public function activateWeapon(_arg1:String){
stopFire();
currentWeapon = _arg1;
gManager.cursor.gotoAndStop(_arg1);
lManager.playerShip.ship.gotoAndStop(_arg1);
if (currentWeapon != "missile"){
missileAim.x = (missileAim.y = 1000);
};
}
}
}//package
Section 60
//vgsCollisionDetection (vgsCollisionDetection)
package {
import flash.geom.*;
public class vgsCollisionDetection {
public function getSegmentCollision(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Point):Boolean{
var _local5:Boolean;
var _local6:Number;
var _local7:Number;
_local5 = true;
_local6 = (((_arg1.x - _arg2.x) * (_arg3.y - _arg4.y)) - ((_arg1.y - _arg2.y) * (_arg3.x - _arg4.x)));
if (_local6 == 0){
_local5 = false;
};
_local7 = ((((_arg3.x - _arg4.x) * ((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x))) - ((_arg1.x - _arg2.x) * ((_arg3.x * _arg4.y) - (_arg3.y * _arg4.x)))) / _local6);
if ((((_local7 < Math.min(_arg1.x, _arg2.x))) || ((_local7 > Math.max(_arg1.x, _arg2.x))))){
_local5 = false;
};
if ((((_local7 < Math.min(_arg3.x, _arg4.x))) || ((_local7 > Math.max(_arg3.x, _arg4.x))))){
_local5 = false;
};
return (_local5);
}
public function getCircularCollision(_arg1:Point, _arg2:Number, _arg3:Point, _arg4:Number){
var _local5:Number;
_local5 = Point.distance(_arg1, _arg3);
if (_local5 <= (_arg2 + _arg4)){
return (true);
};
return (false);
}
}
}//package
Section 61
//vgsParticleExplosion (vgsParticleExplosion)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class vgsParticleExplosion extends MovieClip {
public var parentMovieClip:MovieClip;
public var lastTime:int;
public var particle:Array;
public var framesMovieClip:int;
public var sourceMovieClip:Class;
public function vgsParticleExplosion(_arg1:Class, _arg2:MovieClip, _arg3:int){
sourceMovieClip = _arg1;
parentMovieClip = _arg2;
framesMovieClip = _arg3;
particle = new Array();
lastTime = getTimer();
addEventListener(Event.ENTER_FRAME, update);
}
public function createExplosion(_arg1:Number, _arg2:Number, _arg3:int, _arg4:int, _arg5:int){
var _local6:int;
var _local7:Object;
_local6 = 1;
while (_local6 <= _arg5) {
_local7 = new Object();
_local7.mc = new sourceMovieClip();
_local7.angle = ((Math.random() * 2) * Math.PI);
_local7.mc.x = _arg1;
_local7.mc.y = _arg2;
if (_arg3 != 0){
_local7.life = _arg3;
} else {
_local7.life = int(((Math.random() * 20) + 20));
};
if (_arg4 != 0){
_local7.mc.gotoAndStop(_arg4);
} else {
_local7.mc.gotoAndPlay(((Math.random() * framesMovieClip) + 1));
};
parentMovieClip.addChild(_local7.mc);
particle.push(_local7);
_local6++;
};
}
public function update(_arg1:Event){
var _local2:int;
var _local3:int;
var _local4:*;
_local2 = (getTimer() - lastTime);
lastTime = (lastTime + _local2);
_local3 = (particle.length - 1);
while (_local3 >= 0) {
_local4 = particle[_local3];
_local4.life--;
if (_local4.life == 0){
parentMovieClip.removeChild(_local4.mc);
particle.splice(_local3, 1);
} else {
_local4.mc.x = (_local4.mc.x + (((Math.cos(_local4.angle) * _local4.life) * _local2) / 200));
_local4.mc.y = (_local4.mc.y + (((Math.sin(_local4.angle) * _local4.life) * _local2) / 200));
_local4.mc.scaleX = (_local4.mc.scaleY = Math.random());
_local4.mc.alpha = Math.random();
};
_local3--;
};
}
}
}//package
Section 62
//vgsSoundSystem (vgsSoundSystem)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;
public class vgsSoundSystem extends Sprite {
public const fadeFrames:int = 5;
public var sChannel:Array;
public var sStatus:Array;
public var fadeTick:int;
public var sTransform:Array;
public var lastTime:int;
public var swapping:Boolean;
public var maxVolume:Number;
public var sClass:Array;
public function vgsSoundSystem(){
lastTime = getTimer();
sChannel = new Array();
sClass = new Array();
sTransform = new Array();
sStatus = new Array();
swapping = false;
maxVolume = 0.5;
}
public function setVolume(_arg1:Number){
var _local2:*;
maxVolume = _arg1;
for (_local2 in sChannel) {
if (sStatus[_local2] == "playing"){
sTransform[_local2].volume = maxVolume;
};
sChannel[_local2].soundTransform = sTransform[_local2];
};
}
public function registerMusic(_arg1:Class){
var _local2:int;
_local2 = sChannel.length;
sChannel[_local2] = new SoundChannel();
sClass[_local2] = new (_arg1);
sTransform[_local2] = new SoundTransform(0, 0);
sStatus[_local2] = "mute";
}
public function startPlaying(){
var _local1:int;
_local1 = 0;
while (_local1 < sChannel.length) {
if (_local1 == 0){
sTransform[_local1].volume = maxVolume;
sStatus[_local1] = "playing";
};
sChannel[_local1] = sClass[_local1].play(0, 1000000);
sChannel[_local1].soundTransform = sTransform[_local1];
_local1++;
};
addEventListener(Event.ENTER_FRAME, loop);
}
public function swap(_arg1:int){
var _local2:int;
_local2 = 0;
while (_local2 < sChannel.length) {
if ((((sStatus[_local2] == "playing")) || ((sStatus[_local2] == "fadeIn")))){
if (_local2 == _arg1){
return;
};
sStatus[_local2] = "fadeOut";
};
_local2++;
};
sStatus[_arg1] = "fadeIn";
swapping = true;
}
public function loop(_arg1:Event){
var _local2:*;
var _local3:*;
var _local4:int;
_local2 = (sChannel[0].position - (Math.floor((sChannel[0].position / sClass[0].length)) * sClass[0].length));
_local3 = (getTimer() - lastTime);
lastTime = (lastTime + _local3);
if (((((((_local2 + (_local3 * fadeFrames)) > sClass[0].length)) && (swapping))) && ((fadeTick == 0)))){
fadeTick = fadeFrames;
};
if (fadeTick > 0){
_local4 = 0;
while (_local4 < sChannel.length) {
if (sStatus[_local4] == "fadeOut"){
sTransform[_local4].volume = (sTransform[_local4].volume - (maxVolume / fadeFrames));
if (sTransform[_local4].volume <= 0){
sTransform[_local4].volume = 0;
sStatus[_local4] = "mute";
swapping = false;
};
sChannel[_local4].soundTransform = sTransform[_local4];
};
if (sStatus[_local4] == "fadeIn"){
sTransform[_local4].volume = (sTransform[_local4].volume + (maxVolume / fadeFrames));
if (sTransform[_local4].volume >= maxVolume){
sTransform[_local4].volume = maxVolume;
sStatus[_local4] = "playing";
swapping = false;
};
sChannel[_local4].soundTransform = sTransform[_local4];
};
_local4++;
};
fadeTick--;
};
}
}
}//package