Frame 3
stop();
function awardResponse(response) {
if (response) {
gotoAndStop ("gameOverAward");
_root.mcGame.numState = CGame.STATE_GIVEAWARD;
} else {
_root.mcGame.numState = CGame.STATE_SAVESCORE;
}
}
Symbol 2 MovieClip [id_mcGame] Frame 1
#initclip 27
Object.registerClass("id_mcGame", CGame);
#endinitclip
Symbol 5 Button
on (release) {
getURL ("http://www.miniclip.com", "_blank");
}
Symbol 15 Button
on (release) {
CSoundService.playSound(Const.SND_SWITCH);
_parent.numState = CGame.STATE_OPTIONSSCREEN;
}
Symbol 25 Button
on (release) {
CSoundService.playSound(Const.SND_SWITCH);
_parent.numState = CGame.STATE_VIEWSCORE;
}
Symbol 29 Button
on (release) {
CSoundService.playSound(Const.SND_SWITCH);
_parent.numState = CGame.STATE_RULESSCREEN;
}
Symbol 32 Button
on (release) {
getURL ("http://www.miniclip.com/", "_blank");
}
Symbol 37 Button
on (release) {
getURL ("http://www.iriysoft.ru", "_blank");
}
Symbol 42 MovieClip [cont] Frame 1
#initclip 26
Object.registerClass("cont", advertising.AdvertContainer);
#endinitclip
Symbol 52 Button
on (release) {
getURL ("http://www.miniclip.com/", "_blank");
}
Symbol 53 MovieClip Frame 2
_parent.mcAnimation.play();
stop();
Symbol 53 MovieClip Frame 13
_parent.gotoAndPlay("preload");
stop();
Symbol 69 MovieClip Frame 1
stop();
Symbol 69 MovieClip Frame 60
Symbol 69 MovieClip Frame 121
_parent.mcBackground.play();
stop();
Symbol 74 MovieClip Frame 1
this._visible = false;
Symbol 80 Button
on (release) {
getURL ("http://www.miniclip.com", "_blank");
}
Symbol 85 MovieClip Frame 2
if (_url.indexOf("http") > -1) {
if (_parent._parent._parent.loadAdNow) {
cacheBuster = getTimer() + random(999999);
showAd = "http://www.miniclip.com/swfcontent/push/didyouknow.swf?cacheBuster" + cacheBuster;
mcAd.loadMovie(showAd);
} else {
gotoAndPlay(_currentframe - 1);
}
}
Symbol 85 MovieClip Frame 4
if ((mcAd.getBytesTotal() != 0) && (mcAd.getBytesLoaded() == mcAd.getBytesTotal())) {
gotoAndStop ("showAd");
} else {
gotoAndPlay(_currentframe - 1);
}
Symbol 85 MovieClip Frame 12
stop();
Symbol 95 MovieClip Frame 1
stop();
Symbol 95 MovieClip Frame 100
stop();
Symbol 97 MovieClip Frame 1
stop();
Symbol 97 MovieClip Frame 12
_root.play();
_root.isFinished = true;
_parent.stop();
stop();
Symbol 98 MovieClip Frame 1
loadAdNow = false;
_root.stop();
play();
Instance of Symbol 74 MovieClip "mcIntro" in Symbol 98 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 98 MovieClip Frame 2
xPos = _x;
yPos = _y;
mcBackground._x = mcBackground._x - xPos;
mcBackground._y = mcBackground._y - yPos;
mcAnimation._x = mcAnimation._x - xPos;
mcAnimation._y = mcAnimation._y - yPos;
var stageWidth = Stage.width;
var stageHeight = Stage.height;
var centerStageX = (stageWidth / 2);
var centerStageY = (stageHeight / 2);
mcBackground._width = stageWidth;
mcBackground._height = stageHeight;
mcAnimation._x = mcAnimation._x + centerStageX;
mcAnimation._y = mcAnimation._y + (centerStageY - (stageHeight / 10));
stop();
Instance of Symbol 97 MovieClip "mcLoadingAnimated" in Symbol 98 MovieClip Frame 2
onClipEvent (load) {
_visible = false;
}
Symbol 98 MovieClip Frame 3
var loadedPercent = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (loadedPercent == 100) {
_root.play();
stop();
} else {
loadAdNow = true;
mcLoadingAnimated._visible = true;
}
Symbol 98 MovieClip Frame 5
var loadedPercent = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (loadedPercent < 100) {
mcLoadingAnimated.mcLoading.gotoAndStop(loadedPercent);
mcLoadingAnimated.mcLoading.txtPercentLoaded1 = ("The game is loading (" + loadedPercent) + "%)";
mcLoadingAnimated.mcLoading.txtPercentLoaded2 = ("The game is loading (" + loadedPercent) + "%)";
gotoAndPlay(_currentframe - 1);
} else {
mcLoadingAnimated.play();
stop();
}
Symbol 742 MovieClip [__Packages.Const] Frame 0
class Const
{
function Const () {
}
static function TRACE(__strMessage) {
if (TRACE_DEBUG_INFO) {
}
}
static var TRACE_DEBUG_INFO = false;
static var DISABLE_QUESTS = false;
static var MATRIX_CELL_WIDTH = 32;
static var MATRIX_CELL_HEIGHT = 32;
static var MATRIX_WIDTH = 14;
static var MATRIX_HEIGHT = 14;
static var SOUND_NAMES = new Array("snd_mainLoop", "snd_quest", "snd_error", "snd_nuclearExplosion", "snd_switch", "snd_popDead", "snd_nuclearLaunch", "snd_timeStop", "snd_construction", "snd_sell", "snd_bigExplosion", "snd_mediumExplosion", "snd_smallExplosion", "snd_NulificatorShot", "snd_teslaTowerShot", "snd_gaussCannonShot", "snd_gutlingLaserShot", "snd_oilSprayShot", "snd_chainGunShot", "snd_gooCannonShot", "snd_mortarShot", "snd_aaGunShot", "snd_missileTurretShot", "snd_hit");
static var SND_MAINLOOP = 0;
static var SND_QUEST = 1;
static var SND_ERROR = 2;
static var SND_NUCLEAREXPLOSION = 3;
static var SND_SWITCH = 4;
static var SND_POPDEAD = 5;
static var SND_NUCLEARLAUNCH = 6;
static var SND_TIMESTOP = 7;
static var SND_CONSTRUCTION = 8;
static var SND_SELL = 9;
static var SND_BIGEXPLOSION = 10;
static var SND_MEDIUMEXPLOSION = 11;
static var SND_SMALLEXPLOSION = 12;
static var SND_NULIFICATORSHOT = 13;
static var SND_TESLATOWERSHOT = 14;
static var SND_GAUSSCANNONSHOT = 15;
static var SND_GUTLINGLASERSHOT = 16;
static var SND_OILSPRAYSHOT = 17;
static var SND_CHAINGUNSHOT = 18;
static var SND_GOOCANNONSHOT = 19;
static var SND_MORTARSHOT = 20;
static var SND_AAGUNSHOT = 21;
static var SND_MISSILETURRETSHOT = 22;
static var SND_HIT = 23;
}
Symbol 743 MovieClip [__Packages.CEventMovieClip] Frame 0
class CEventMovieClip extends MovieClip
{
var _parent;
function CEventMovieClip () {
super();
}
function dispatchMessage(__numMessage, __objParam, __mcInvoker) {
if (__numMessage == undefined) {
__numMessage = MSG_UNDEFINED;
}
if (__mcInvoker == undefined) {
__mcInvoker = this;
}
var _local3 = _parent;
do {
if (_local3 instanceof CEventMovieClip) {
_local3.processMessage(__numMessage, __objParam, __mcInvoker);
return(true);
}
_local3 = _local3._parent;
} while (_local3 != _root);
return(false);
}
function processMessage(__numMessage, __objParam, __mcInvoker) {
dispatchMessage(__numMessage, __objParam, __mcInvoker);
}
static var MSG_UNDEFINED = 0;
static var MSG_TOGGLEPRESS = 1;
static var MSG_MOUSECLICK = 2;
static var MSG_MOUSEOVER = 3;
static var MSG_MOUSEOUT = 4;
static var MSG_TARGETLOST = 5;
static var MSG_READYTOSHOOT = 6;
static var MSG_SPLASHEFFECT = 7;
static var MSG_CREATEGFX = 8;
static var MSG_ENEMYDEAD = 9;
static var MSG_ENEMYPASSED = 10;
static var MSG_HURRYATTACK = 11;
static var MSG_QUITGAME = 12;
static var MSG_PAUSEGAME = 13;
}
Symbol 744 MovieClip [__Packages.CGame] Frame 0
class CGame extends CEventMovieClip
{
var _parent, _numState, _mcMainScreen, _mcOptionsScreen, _mcRulesScreen, _mcViewScoreScreen, _mcSaveScoreScreen, _mcMissionUI, _mcGamePaused, _mcQuitDialog, _mcGameOverDialog, _mapCurrent, _cursorCurrent, _layerCanvas, attachMovie, _url, numMap, numProgram, _arrAbilities, _numMoneyEarned, numScore, _arrQuests1, _arrQuests2, _arrQuests3, _boolPaused, _boolInit, onEnterFrame, _numFunds, _numPopulation, _numProgram, _numProgramPtr, _numEnemiesTimer, _numEnemiesPeriod, _boolPausedBeforeQuit;
function CGame () {
super();
CSoundService.createSoundService(Const.SOUND_NAMES, _parent, 9999);
numState = (STATE_MAINSCREEN);
}
function get numState() {
return(_numState);
}
function set numState(__numValue) {
if (_numState != __numValue) {
_numState = __numValue;
_mcMainScreen.removeMovieClip();
_mcOptionsScreen.removeMovieClip();
_mcRulesScreen.removeMovieClip();
_mcViewScoreScreen.removeMovieClip();
_mcSaveScoreScreen.removeMovieClip();
_mcMissionUI.removeMovieClip();
_mcGamePaused.removeMovieClip();
_mcQuitDialog.removeMovieClip();
_mcGameOverDialog.removeMovieClip();
_mapCurrent.removeMovieClip();
_cursorCurrent.removeMovieClip();
_layerCanvas.removeMovieClip();
switch (_numState) {
case STATE_MAINSCREEN :
attachMovie("id_mcMainScreen", "_mcMainScreen", 1);
var _local3 = UrlTools.getGeo(_url);
var _local4 = UrlTools.getDomain(_url);
_mcMainScreen.AdContainer._id = "g0";
_mcMainScreen.AdContainer.advert_data = {game_id:1876, geo:_local3, domain:_local4};
var _local5 = CSoundService.getSoundAt(Const.SND_MAINLOOP);
_local5.setVolume(100);
CSoundService.playLoopSound(Const.SND_MAINLOOP);
break;
case STATE_OPTIONSSCREEN :
attachMovie("id_mcOptionsScreen", "_mcOptionsScreen", 1);
_local5 = CSoundService.getSoundAt(Const.SND_MAINLOOP);
_local5.setVolume(100);
CSoundService.playLoopSound(Const.SND_MAINLOOP);
break;
case STATE_RULESSCREEN :
attachMovie("id_mcRulesScreen", "_mcRulesScreen", 1);
_local5 = CSoundService.getSoundAt(Const.SND_MAINLOOP);
_local5.setVolume(100);
CSoundService.playLoopSound(Const.SND_MAINLOOP);
break;
case STATE_VIEWSCORE :
attachMovie("id_mcViewScore", "_mcViewScoreScreen", 1);
_local5 = CSoundService.getSoundAt(Const.SND_MAINLOOP);
_local5.setVolume(100);
CSoundService.playLoopSound(Const.SND_MAINLOOP);
break;
case STATE_SAVESCORE :
attachMovie("id_mcSaveScore", "_mcSaveScoreScreen", 1);
_local5 = CSoundService.getSoundAt(Const.SND_MAINLOOP);
_local5.setVolume(100);
CSoundService.playLoopSound(Const.SND_MAINLOOP);
break;
case STATE_GIVEAWARD :
attachMovie("id_mcGiveAward", "_mcGiveAward", 1);
_local5 = CSoundService.getSoundAt(Const.SND_MAINLOOP);
_local5.setVolume(100);
CSoundService.playLoopSound(Const.SND_MAINLOOP);
break;
case STATE_MISSION :
attachMovie("id_map", "_mapCurrent", 1);
attachMovie("id_layer", "_layerCanvas", 3);
attachMovie("id_cursor", "_cursorCurrent", 4);
attachMovie("id_missionUI", "_mcMissionUI", 5, {_x:448});
if (numMap == undefined) {
numMap = 1;
}
if (numProgram == undefined) {
numProgram = 0;
}
loadMission(numMap, numProgram);
_cursorCurrent.initCursor(_mapCurrent);
CBuilding.RANGE_BONUS = 0;
_arrAbilities = new Array();
_arrAbilities.push(new CAbility(CAbility.TYPE_SELL, _mcMissionUI._mcBtnAbility1, 1));
_arrAbilities.push(new CAbility(CAbility.TYPE_MISSILE, _mcMissionUI._mcBtnAbility2, 0));
_arrAbilities.push(new CAbility(CAbility.TYPE_WALL, _mcMissionUI._mcBtnAbility3, 0));
_arrAbilities.push(new CAbility(CAbility.TYPE_TIMEBOMB, _mcMissionUI._mcBtnAbility4, 0));
_arrAbilities.push(new CAbility(CAbility.TYPE_MONEYBONUS, undefined, 0));
_arrAbilities.push(new CAbility(CAbility.TYPE_TOWERBONUS, undefined, 0));
numFunds = (INITIAL_FUNDS);
_numMoneyEarned = 0;
numPopulation = (INITIAL_POPULATION);
numScore = 0;
_arrQuests1 = new Array(new CQuest(CQuest.TYPE_TOWERS1_1), new CQuest(CQuest.TYPE_TOWERS1_2), new CQuest(CQuest.TYPE_TOWERS1_3), new CQuest(CQuest.TYPE_TOWERS1_4), new CQuest(CQuest.TYPE_TOWERS1_5));
_arrQuests2 = new Array(new CQuest(CQuest.TYPE_TOWERS2_1), new CQuest(CQuest.TYPE_TOWERS2_2), new CQuest(CQuest.TYPE_TOWERS2_3), new CQuest(CQuest.TYPE_TOWERS2_4), new CQuest(CQuest.TYPE_TOWERS2_5));
_arrQuests3 = new Array(new CQuest(CQuest.TYPE_STRUCTURES_1), new CQuest(CQuest.TYPE_STRUCTURES_2), new CQuest(CQuest.TYPE_STRUCTURES_3), new CQuest(CQuest.TYPE_STRUCTURES_4), new CQuest(CQuest.TYPE_STRUCTURES_5));
var _local2 = 1;
while (_local2 <= 3) {
this["_arrQuests" + _local2].current = -1;
_local2++;
}
_boolPaused = false;
_boolInit = true;
onEnterFrame = oefProcessMission;
_local5 = CSoundService.getSoundAt(Const.SND_MAINLOOP);
_local5.setVolume(30);
CSoundService.playLoopSound(Const.SND_MAINLOOP);
}
}
//return(numState);
}
function get numFunds() {
return(_numFunds);
}
function set numFunds(__numValue) {
_numFunds = __numValue;
if (_numFunds < 0) {
_numFunds = 0;
}
_mcMissionUI.updatePriceColor(_numFunds);
_arrQuests2[2].numPoints = _numFunds;
if (_arrQuests2[2].boolActive) {
_mcMissionUI.updateQuest(2, 3, _arrQuests2[2]);
}
_mcMissionUI.textFunds.text = String(_numFunds);
//return(numFunds);
}
function get numPopulation() {
return(_numPopulation);
}
function set numPopulation(__numValue) {
_numPopulation = __numValue;
if (_numPopulation <= 0) {
_numPopulation = 0;
}
_mcMissionUI.textPopulation.text = String(_numPopulation);
//return(numPopulation);
}
function get boolPaused() {
return(_boolPaused);
}
function set boolPaused(__boolValue) {
if (numState == STATE_MISSION) {
_boolPaused = __boolValue;
_mapCurrent.__set__boolPaused(__boolValue);
if (_boolPaused) {
attachMovie("mc_gamepaused", "_mcGamePaused", 100, {_x:80, _y:140});
onEnterFrame = null;
_layerCanvas.clear();
_cursorCurrent.clear();
} else {
_mcGamePaused.removeMovieClip();
onEnterFrame = oefProcessMission;
}
_mcMissionUI.boolEnabled = !_boolPaused;
if (!_mapCurrent.__get__noEnemies()) {
_mcMissionUI._btnStartAttack._visible = false;
}
}
//return(boolPaused);
}
function getGlobalMousePos() {
var _local2 = {x:_root._xmouse, y:_root._ymouse};
_root.localToGlobal(_local2);
return(_local2);
}
function processMessage(__numMessage, __objParam, __mcInvoker) {
switch (__numMessage) {
case CEventMovieClip.MSG_TOGGLEPRESS :
var _local5 = CToggleButton(__mcInvoker);
var _local11 = getGlobalMousePos();
if (_mcMissionUI.hitTest(_local11.x, _local11.y, true)) {
if (__objParam.isHit) {
_local5.__set__boolPressed(!_local5.__get__boolPressed());
} else {
_local5.__set__boolPressed(false);
}
_cursorCurrent.clear();
}
_cursorCurrent._x = Math.max(0, _cursorCurrent._x);
_cursorCurrent._x = Math.min(1000, _cursorCurrent._x);
_cursorCurrent._y = Math.max(0, _cursorCurrent._y);
_cursorCurrent._y = Math.min(1000, _cursorCurrent._y);
if (__objParam.isHit && (_local5.__get__boolPressed())) {
switch (_local5) {
case _mcMissionUI._mcTabPage1._mcBtnBuilding1 :
_cursorCurrent.attachBuilding(CBuilding.TYPE_TOWER_1_1);
break;
case _mcMissionUI._mcTabPage1._mcBtnBuilding2 :
_cursorCurrent.attachBuilding(CBuilding.TYPE_TOWER_1_2);
break;
case _mcMissionUI._mcTabPage1._mcBtnBuilding3 :
_cursorCurrent.attachBuilding(CBuilding.TYPE_TOWER_1_3);
break;
case _mcMissionUI._mcTabPage1._mcBtnBuilding4 :
_cursorCurrent.attachBuilding(CBuilding.TYPE_TOWER_1_4);
break;
case _mcMissionUI._mcTabPage1._mcBtnBuilding5 :
_cursorCurrent.attachBuilding(CBuilding.TYPE_TOWER_1_5);
break;
case _mcMissionUI._mcTabPage2._mcBtnBuilding1 :
_cursorCurrent.attachBuilding(CBuilding.TYPE_TOWER_2_1);
break;
case _mcMissionUI._mcTabPage2._mcBtnBuilding2 :
_cursorCurrent.attachBuilding(CBuilding.TYPE_TOWER_2_2);
break;
case _mcMissionUI._mcTabPage2._mcBtnBuilding3 :
_cursorCurrent.attachBuilding(CBuilding.TYPE_TOWER_2_3);
break;
case _mcMissionUI._mcTabPage2._mcBtnBuilding4 :
_cursorCurrent.attachBuilding(CBuilding.TYPE_TOWER_2_4);
break;
case _mcMissionUI._mcTabPage2._mcBtnBuilding5 :
_cursorCurrent.attachBuilding(CBuilding.TYPE_TOWER_2_5);
break;
case _mcMissionUI._mcTabPage3._mcBtnBuilding1 :
_cursorCurrent.attachBuilding(CBuilding.TYPE_BULIDING_1);
break;
case _mcMissionUI._mcTabPage3._mcBtnBuilding2 :
_cursorCurrent.attachBuilding(CBuilding.TYPE_BULIDING_2);
break;
case _mcMissionUI._mcTabPage3._mcBtnBuilding3 :
_cursorCurrent.attachBuilding(CBuilding.TYPE_BULIDING_3);
break;
case _mcMissionUI._mcTabPage3._mcBtnBuilding4 :
_cursorCurrent.attachBuilding(CBuilding.TYPE_BULIDING_4);
break;
case _mcMissionUI._mcTabPage3._mcBtnBuilding5 :
_cursorCurrent.attachBuilding(CBuilding.TYPE_BULIDING_5);
break;
case _mcMissionUI._mcBtnAbility1 :
_cursorCurrent.attachAbility(CAbility.TYPE_SELL);
break;
case _mcMissionUI._mcBtnAbility2 :
_cursorCurrent.attachAbility(CAbility.TYPE_MISSILE);
break;
case _mcMissionUI._mcBtnAbility3 :
_cursorCurrent.attachAbility(CAbility.TYPE_WALL);
break;
case _mcMissionUI._mcBtnAbility4 :
_cursorCurrent.attachAbility(CAbility.TYPE_TIMEBOMB);
}
}
break;
case CEventMovieClip.MSG_MOUSECLICK :
if (((_cursorCurrent.__get__numState() != CCursor.STATE_CLEAR) && (!__objParam.free)) && (!__objParam.out)) {
CSoundService.playSound(Const.SND_ERROR);
}
if ((((_cursorCurrent.__get__numState() == CCursor.STATE_BUILDING) && (__objParam.free)) && (!__objParam.out)) && (numFunds < _cursorCurrent.__get__buildingCursor()._numPrice)) {
_mcMissionUI.showMessage("NOT ENOUGH\nMONEY!", true);
}
if ((((_cursorCurrent.__get__numState() == CCursor.STATE_BUILDING) && (__objParam.free)) && (!__objParam.out)) && (numFunds >= _cursorCurrent.__get__buildingCursor()._numPrice)) {
_mapCurrent.addBuilding(_cursorCurrent.__get__buildingCursor());
numFunds = numFunds - _cursorCurrent.__get__buildingCursor()._numPrice;
_cursorCurrent.refresh();
CSoundService.playSound(Const.SND_CONSTRUCTION);
switch (_cursorCurrent.__get__buildingCursor().__get__numType()) {
case CBuilding.TYPE_TOWER_1_1 :
_arrQuests3[0].numPoints++;
if (_arrQuests3[0].boolActive) {
_mcMissionUI.updateQuest(3, 1, _arrQuests3[0]);
}
break;
case CBuilding.TYPE_TOWER_1_3 :
_arrQuests3[2].numPoints++;
if (_arrQuests3[2].boolActive) {
_mcMissionUI.updateQuest(3, 3, _arrQuests3[2]);
}
break;
case CBuilding.TYPE_TOWER_2_2 :
_arrQuests1[2].numPoints++;
if (_arrQuests1[2].boolActive) {
_mcMissionUI.updateQuest(1, 3, _arrQuests1[2]);
}
break;
case CBuilding.TYPE_TOWER_2_1 :
_arrQuests3[3].numPoints++;
if (_arrQuests3[3].boolActive) {
_mcMissionUI.updateQuest(3, 4, _arrQuests3[3]);
}
break;
case CBuilding.TYPE_TOWER_2_3 :
_arrQuests3[2].numPoints++;
if (_arrQuests3[2].boolActive) {
_mcMissionUI.updateQuest(3, 3, _arrQuests3[2]);
}
break;
case CBuilding.TYPE_BULIDING_1 :
_arrAbilities[1].numSources++;
break;
case CBuilding.TYPE_BULIDING_2 :
_arrAbilities[2].numSources++;
_arrQuests3[4].numPoints++;
if (_arrQuests3[4].boolActive) {
_mcMissionUI.updateQuest(3, 5, _arrQuests3[4]);
}
break;
case CBuilding.TYPE_BULIDING_3 :
_arrAbilities[4].numSources++;
break;
case CBuilding.TYPE_BULIDING_4 :
_arrAbilities[5].numSources++;
CBuilding.RANGE_BONUS = CBuilding.RANGE_BONUS + 0.1;
CBlast.DAMAGE_BONUS = CBlast.DAMAGE_BONUS + 0.1;
_arrQuests2[3].numPoints++;
if (_arrQuests2[3].boolActive) {
_mcMissionUI.updateQuest(2, 4, _arrQuests2[3]);
}
break;
case CBuilding.TYPE_BULIDING_5 :
_arrAbilities[3].numSources++;
_arrQuests1[4].numPoints++;
if (!_arrQuests1[4].boolActive) {
break;
}
_mcMissionUI.updateQuest(1, 5, _arrQuests1[4]);
}
_arrQuests3[1].numPoints++;
if (_arrQuests3[1].boolActive) {
_mcMissionUI.updateQuest(3, 2, _arrQuests3[1]);
}
}
if (((_cursorCurrent.__get__numState() == CCursor.STATE_ABILITY) && (__objParam.free)) && (!__objParam.out)) {
var _local6;
var _local9 = true;
switch (_cursorCurrent.__get__numAbility()) {
case CAbility.TYPE_SELL :
_local6 = 0;
var _local8 = _mapCurrent.getBuildingAt(__objParam.i, __objParam.j);
numFunds = numFunds + Math.round(0.5 * _local8._numPrice);
switch (_local8.__get__numType()) {
case CBuilding.TYPE_TOWER_1_1 :
_arrQuests3[0].numPoints--;
if (_arrQuests3[0].boolActive) {
_mcMissionUI.updateQuest(3, 1, _arrQuests3[0]);
}
break;
case CBuilding.TYPE_TOWER_1_3 :
_arrQuests3[2].numPoints--;
if (_arrQuests3[2].boolActive) {
_mcMissionUI.updateQuest(3, 3, _arrQuests3[2]);
}
break;
case CBuilding.TYPE_TOWER_2_1 :
_arrQuests3[3].numPoints--;
if (_arrQuests3[3].boolActive) {
_mcMissionUI.updateQuest(3, 4, _arrQuests3[3]);
}
break;
case CBuilding.TYPE_TOWER_2_2 :
_arrQuests1[2].numPoints--;
if (_arrQuests1[2].boolActive) {
_mcMissionUI.updateQuest(1, 3, _arrQuests1[2]);
}
break;
case CBuilding.TYPE_TOWER_2_3 :
_arrQuests3[2].numPoints--;
if (_arrQuests3[2].boolActive) {
_mcMissionUI.updateQuest(3, 3, _arrQuests3[2]);
}
break;
case CBuilding.TYPE_BULIDING_1 :
_arrAbilities[1].numSources--;
break;
case CBuilding.TYPE_BULIDING_2 :
_arrAbilities[2].numSources--;
_arrQuests3[4].numPoints--;
if (_arrQuests3[4].boolActive) {
_mcMissionUI.updateQuest(3, 5, _arrQuests3[4]);
}
break;
case CBuilding.TYPE_BULIDING_3 :
_arrAbilities[4].numSources--;
break;
case CBuilding.TYPE_BULIDING_4 :
_arrAbilities[5].numSources--;
CBuilding.RANGE_BONUS = CBuilding.RANGE_BONUS - 0.1;
CBlast.DAMAGE_BONUS = CBlast.DAMAGE_BONUS - 0.1;
_arrQuests2[3].numPoints--;
if (_arrQuests2[3].boolActive) {
_mcMissionUI.updateQuest(2, 4, _arrQuests2[3]);
}
break;
case CBuilding.TYPE_BULIDING_5 :
_arrAbilities[3].numSources--;
_arrQuests1[4].numPoints--;
if (!_arrQuests1[4].boolActive) {
break;
}
_mcMissionUI.updateQuest(1, 5, _arrQuests1[4]);
}
CSoundService.playSound(Const.SND_SELL);
_arrQuests3[1].numPoints--;
if (_arrQuests3[1].boolActive) {
_mcMissionUI.updateQuest(3, 2, _arrQuests3[1]);
}
_mapCurrent.deleteBuilding(_local8);
_layerCanvas.clear();
break;
case CAbility.TYPE_MISSILE :
_local6 = 1;
_local11 = getGlobalMousePos();
var _local13 = {x:224, y:500, direction:new CVector(0, -1), altitude:CMap.ALTITUDE_BOTH, type:CBlast.TYPE_MISSILE, targetsEnemy:false, targetX:_local11.x, targetY:_local11.y, speed:6};
_mapCurrent.addBlast(_local13);
CSoundService.playSound(Const.SND_NUCLEARLAUNCH);
if (_arrQuests1[1].boolActive) {
_arrQuests1[1].numPoints++;
_mcMissionUI.updateQuest(1, 2, _arrQuests1[1]);
}
break;
case CAbility.TYPE_WALL :
_local6 = 2;
if (__objParam.free && (!__objParam.out)) {
if (_mapCurrent.isHitWithGroundEnemy(__mcInvoker.mcCursor)) {
_mcMissionUI.showMessage("YOU CAN'T INSTALL WALL\nOVER THE ENEMY!", true);
_local9 = false;
break;
}
if (!_mapCurrent.markCacheMatrix(__objParam.i, __objParam.j)) {
_mcMissionUI.showMessage("YOU CAN'T\nBLOCK PATH!", true);
_local9 = false;
} else {
_mapCurrent.addWall(__objParam.i, __objParam.j);
_mapCurrent.toggleGrid(false);
CSoundService.playSound(Const.SND_CONSTRUCTION);
_arrQuests2[4].numPoints++;
if (_arrQuests2[4].boolActive) {
_mcMissionUI.updateQuest(2, 5, _arrQuests2[4]);
}
break;
_local6 = 3;
_mapCurrent.applySplashEffect(new CEffect(CEffect.TYPE_TIMESTOP, undefined, 120), _root._xmouse, _root._ymouse, 100, CMap.ALTITUDE_BOTH);
CSoundService.playSound(Const.SND_TIMESTOP);
}
}
break;
case CAbility.TYPE_TIMEBOMB :
_local6 = 3;
_mapCurrent.applySplashEffect(new CEffect(CEffect.TYPE_TIMESTOP, undefined, 120), _root._xmouse, _root._ymouse, 100, CMap.ALTITUDE_BOTH);
CSoundService.playSound(Const.SND_TIMESTOP);
}
if (_local9) {
if (_arrAbilities[_local6].reset()) {
_cursorCurrent.clear();
}
}
}
break;
case CEventMovieClip.MSG_MOUSEOVER :
if ((((__mcInvoker instanceof CBuilding) && (__mcInvoker._boolTower)) && ((_cursorCurrent.__get__numState() == CCursor.STATE_CLEAR) || (__objParam.forceShow))) && (!boolPaused)) {
var _local10 = {x:__mcInvoker._mcObject.mcGun._x, y:__mcInvoker._mcObject.mcGun._y};
__mcInvoker._mcObject.localToGlobal(_local10);
_layerCanvas.globalToLocal(_local10);
var _local16 = _layerCanvas.addElement("id_tower_range", {_x:_local10.x, _y:_local10.y, _width:2 * Math.floor(__mcInvoker.numRange), _height:2 * Math.floor(__mcInvoker.numRange)});
}
break;
case CEventMovieClip.MSG_MOUSEOUT :
if (((__mcInvoker instanceof CBuilding) && (__mcInvoker._boolTower)) && ((_cursorCurrent.__get__numState() == CCursor.STATE_CLEAR) || (__objParam.forceHide))) {
_layerCanvas.clear();
}
break;
case CEventMovieClip.MSG_TARGETLOST :
if (__mcInvoker instanceof CBuilding) {
var _local10 = {x:__mcInvoker._mcObject.mcGun._x, y:__mcInvoker._mcObject.mcGun._y};
__mcInvoker._mcObject.localToGlobal(_local10);
_local10.x = _local10.x - CBuilding.objBasePoint.x;
_local10.y = _local10.y - CBuilding.objBasePoint.y;
__mcInvoker._enemyTarget = _mapCurrent.getNearestEnemy(_local10.x, _local10.y, Math.floor(__mcInvoker._numRange * (1 + CBuilding.RANGE_BONUS)), __mcInvoker._numAimingAltitude);
}
if (__mcInvoker instanceof CBlast) {
var _local10 = {x:__mcInvoker._mcObject._x, y:__mcInvoker._mcObject._y};
__mcInvoker.localToGlobal(_local10);
__mcInvoker._mcTarget = _mapCurrent.getNearestEnemy(_local10.x, _local10.y, __objParam.range, __objParam.alt, __objParam.forbidden);
}
break;
case CEventMovieClip.MSG_READYTOSHOOT :
_mapCurrent.addBlast(__objParam);
break;
case CEventMovieClip.MSG_SPLASHEFFECT :
_mapCurrent.applySplashEffect(__objParam.effect, __objParam.centerX, __objParam.centerY, __objParam.radius, __objParam.altitude);
break;
case CEventMovieClip.MSG_CREATEGFX :
_mapCurrent.addGFX(__objParam);
break;
case CEventMovieClip.MSG_ENEMYDEAD :
var _local12 = Math.round(__mcInvoker._numReward * (1 + (0.5 * _arrAbilities[4].numSources)));
numFunds = numFunds + _local12;
_numMoneyEarned = _numMoneyEarned + _local12;
_mapCurrent.addGFX(__objParam);
if (__mcInvoker.numAltitude == CMap.ALTITUDE_AIR) {
_arrQuests2[1].numPoints++;
if (_arrQuests2[1].boolActive) {
_mcMissionUI.updateQuest(2, 2, _arrQuests2[1]);
}
}
if (__mcInvoker.numAltitude == CMap.ALTITUDE_AIR) {
_arrQuests1[3].numPoints++;
if (_arrQuests1[3].boolActive) {
_mcMissionUI.updateQuest(1, 4, _arrQuests1[3]);
}
}
__mcInvoker.remove();
if (_mapCurrent.__get__noEnemies()) {
if (_numProgramPtr >= PROGRAMS[_numProgram].length) {
showGameOverDialog(true);
} else {
_mcMissionUI._btnStartAttack._visible = true;
}
}
break;
case CEventMovieClip.MSG_ENEMYPASSED :
numPopulation = ((numPopulation-1));
__mcInvoker.remove();
CSoundService.playSound(Const.SND_POPDEAD, true);
if (numPopulation == 0) {
showGameOverDialog(false);
} else if (_mapCurrent.__get__noEnemies()) {
if (_numProgramPtr >= PROGRAMS[_numProgram].length) {
showGameOverDialog(true);
} else {
_mcMissionUI._btnStartAttack._visible = true;
}
}
break;
case CEventMovieClip.MSG_HURRYATTACK :
_numEnemiesTimer = _numEnemiesPeriod;
for (var _local7 in _arrAbilities) {
_arrAbilities[_local7].numTimer = _arrAbilities[_local7].numTimer - _numEnemiesTimer;
}
break;
case CEventMovieClip.MSG_QUITGAME :
_boolPausedBeforeQuit = boolPaused;
boolPaused = (true);
_mcMissionUI.switchServiceButtonsVisibility(false);
attachMovie("mc_quitdialog", "_mcQuitDialog", 100, {_x:80, _y:140});
break;
case CEventMovieClip.MSG_PAUSEGAME :
boolPaused = (__objParam.pause);
}
}
function loadMission(__numMapID, __numProgramID) {
_numProgram = __numProgramID;
_numProgramPtr = 0;
_numEnemiesPeriod = WAVE_TIME[numProgram];
_numEnemiesTimer = 0;
_mapCurrent.loadMap(__numMapID);
updateWaveScreen(PROGRAMS[_numProgram][_numProgramPtr]);
}
function createAttackWave(__objWave) {
var _local4;
if (__objWave.alt == WAVE_ALT_GROUND) {
switch (__objWave.size) {
case WAVE_SIZE_TINY :
_local4 = CEnemy.TYPE_BAGGI;
break;
case WAVE_SIZE_SMALL :
_local4 = CEnemy.TYPE_TRICYCLE;
break;
case WAVE_SIZE_MEDIUM :
_local4 = CEnemy.TYPE_CAR;
break;
case WAVE_SIZE_BIG :
_local4 = CEnemy.TYPE_HOWERTANK;
}
} else {
switch (__objWave.size) {
case WAVE_SIZE_TINY :
_local4 = CEnemy.TYPE_PLANE;
break;
case WAVE_SIZE_SMALL :
_local4 = CEnemy.TYPE_INSECT;
break;
case WAVE_SIZE_MEDIUM :
_local4 = CEnemy.TYPE_SCORPIO;
}
}
var _local5;
switch (__objWave.effect) {
case WAVE_EFFECT_FAST :
_local5 = new CEffect(CEffect.TYPE_FAST, {percent:0.5}, -1);
break;
case WAVE_EFFECT_REPAIR :
_local5 = new CEffect(CEffect.TYPE_REPAIR, {percent:0.005}, -1);
break;
case WAVE_EFFECT_SHIELD :
_local5 = new CEffect(CEffect.TYPE_SHIELD, {pass:0.1}, -1);
}
var _local2 = 0;
while (_local2 < __objWave.qty) {
_mapCurrent.addEnemy(_local4, __objWave.level, _local5.makeCopy(), _local2);
_local2++;
}
}
function updateWaveScreen(__objWave) {
if (__objWave != undefined) {
var _local2 = ("Next attack: #" + (_numProgramPtr + 1).toString()) + newline;
_local2 = _local2 + (String(__objWave.qty) + " ");
switch (__objWave.size) {
case WAVE_SIZE_TINY :
_local2 = _local2 + "TINY ";
break;
case WAVE_SIZE_SMALL :
_local2 = _local2 + "SMALL ";
break;
case WAVE_SIZE_MEDIUM :
_local2 = _local2 + "MEDIUM ";
break;
case WAVE_SIZE_BIG :
_local2 = _local2 + "BIG ";
}
_local2 = _local2 + "unit";
if (__objWave.qty > 1) {
_local2 = _local2 + "s";
}
_local2 = _local2 + ((" Lv[" + __objWave.level.toString()) + "]");
switch (__objWave.alt) {
case WAVE_ALT_GROUND :
_local2 = _local2 + "\nGROUND";
break;
case WAVE_ALT_AIR :
_local2 = _local2 + "\nAIR";
}
switch (__objWave.effect) {
case WAVE_EFFECT_FAST :
_local2 = _local2 + " / FAST";
break;
case WAVE_EFFECT_REPAIR :
_local2 = _local2 + " / AUTOREPAIR";
break;
case WAVE_EFFECT_SHIELD :
_local2 = _local2 + " / SHIELDED";
}
_mcMissionUI.textScreen.text = _local2;
}
if (_numProgramPtr >= PROGRAMS[_numProgram].length) {
_mcMissionUI.textScreen._visible = false;
_mcMissionUI.textTimer._visible = false;
}
var _local3 = Math.floor((_numEnemiesPeriod - _numEnemiesTimer) / 24);
if (_local3 < 0) {
_local3 = 0;
}
var _local5 = Math.floor(_local3 / 60);
_local3 = _local3 - (_local5 * 60);
_mcMissionUI.textTimer.text = (((((_local5 < 10) ? "0" : "") + _local5.toString()) + ":") + ((_local3 < 10) ? "0" : "")) + _local3.toString();
}
function onQuitDialogClose(__boolQuit) {
if (__boolQuit) {
numState = (STATE_MAINSCREEN);
} else {
_mcQuitDialog.removeMovieClip();
boolPaused = (_boolPausedBeforeQuit);
_mcMissionUI.switchServiceButtonsVisibility(true);
}
CSoundService.playSound(Const.SND_SWITCH);
}
function showGameOverDialog(__boolWin) {
boolPaused = (true);
attachMovie("mc_gameoverdialog", "_mcGameOverDialog", 100, {_x:40, _y:85});
if (!__boolWin) {
_mcGameOverDialog.mcMessage.gotoAndStop(2);
}
_mcMissionUI.switchServiceButtonsVisibility(false);
_mcGameOverDialog.textMoneyQty.text = _numMoneyEarned.toString();
_mcGameOverDialog.textMoneyMult.text = "x" + MONEY_SCORE_MULT.toString();
var _local2 = _numMoneyEarned * MONEY_SCORE_MULT;
_mcGameOverDialog.textMoneyScore.text = _local2.toString();
_mcGameOverDialog.textPopQty.text = numPopulation.toString();
_mcGameOverDialog.textPopMult.text = "x" + POP_SCORE_MULT.toString();
var _local3 = numPopulation * POP_SCORE_MULT;
_mcGameOverDialog.textPopScore.text = _local3.toString();
_mcGameOverDialog.textBonus.text = ("+" + (SCORE_BONUS[numProgram] * 100)) + " %";
numScore = Math.round((_local2 + _local3) * (1 + SCORE_BONUS[numProgram]));
_mcGameOverDialog.textTotalScore.text = numScore.toString();
}
function onGameOverDialogClose() {
if (((numMap == "3") && (numProgram == "2")) && (_numProgramPtr >= PROGRAMS[_numProgram].length)) {
var _local2 = new MiniclipAwards(this);
_local2.give(65, awardResponse);
} else {
numState = (STATE_SAVESCORE);
}
CSoundService.playSound(Const.SND_SWITCH);
}
function awardResponse(response) {
if (response) {
numState = (STATE_GIVEAWARD);
} else {
numState = (STATE_SAVESCORE);
}
}
function oefProcessMission() {
if (_boolInit) {
_arrAbilities[1].boolAvaliable = false;
_arrAbilities[2].boolAvaliable = false;
_arrAbilities[3].boolAvaliable = false;
_boolInit = false;
}
if (_numEnemiesTimer > _numEnemiesPeriod) {
_numEnemiesTimer = 0;
createAttackWave(PROGRAMS[_numProgram][_numProgramPtr]);
_numProgramPtr++;
updateWaveScreen(PROGRAMS[_numProgram][_numProgramPtr]);
_mcMissionUI._btnStartAttack._visible = false;
} else {
_numEnemiesTimer++;
updateWaveScreen();
}
for (var _local3 in _arrAbilities) {
_arrAbilities[_local3].tick();
}
if (!Const.DISABLE_QUESTS) {
var _local3 = 1;
while (_local3 <= 3) {
var _local2 = this["_arrQuests" + _local3];
if (_local2.current == -1) {
_local2.current = 0;
_mcMissionUI.changeBBState(_local3, _local2.current + 1, CMissionUIPanel.BB_STATE_QUEST);
_local2[_local2.current].boolActive = true;
_mcMissionUI.updateQuest(_local3, _local2.current + 1, _local2[_local2.current]);
}
if (_local2[_local2.current].boolComplete) {
_mcMissionUI.changeBBState(_local3, _local2.current + 1, CMissionUIPanel.BB_STATE_SHOW);
_mcMissionUI.changeBBState(_local3, _local2.current + 2, CMissionUIPanel.BB_STATE_QUEST);
_local2[_local2.current].boolActive = false;
_local2[_local2.current + 1].boolActive = true;
_mcMissionUI.updateQuest(_local3, _local2.current + 2, _local2[_local2.current + 1]);
_mcMissionUI.updatePriceColor(numFunds);
if (_local2[_local2.current].numPointCap > 0) {
_mcMissionUI.showMessage("Quest complete!\n" + _local2[_local2.current].strCompleteMsg);
}
_local2.current++;
}
_local3++;
}
}
_mapCurrent.process();
}
static var STATE_MAINSCREEN = 1;
static var STATE_OPTIONSSCREEN = 2;
static var STATE_RULESSCREEN = 3;
static var STATE_VIEWSCORE = 4;
static var STATE_SAVESCORE = 5;
static var STATE_MISSION = 6;
static var STATE_GIVEAWARD = 7;
static var INITIAL_FUNDS = 350;
static var INITIAL_POPULATION = 10;
static var MONEY_SCORE_MULT = 1;
static var POP_SCORE_MULT = 10000;
static var WAVE_ALT_GROUND = 1;
static var WAVE_ALT_AIR = 2;
static var WAVE_SIZE_TINY = 1;
static var WAVE_SIZE_SMALL = 2;
static var WAVE_SIZE_MEDIUM = 3;
static var WAVE_SIZE_BIG = 4;
static var WAVE_EFFECT_FAST = 1;
static var WAVE_EFFECT_SHIELD = 2;
static var WAVE_EFFECT_REPAIR = 3;
static var WAVE_TIME = new Array(2880, 2160, 1440);
static var SCORE_BONUS = new Array(0, 0.25, 0.5);
static var PROGRAMS = new Array(new Array({alt:WAVE_ALT_GROUND, qty:1, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:2, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:1, size:WAVE_SIZE_SMALL, level:1}, {alt:WAVE_ALT_GROUND, qty:2, size:WAVE_SIZE_SMALL, level:1}, {alt:WAVE_ALT_AIR, qty:1, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:8, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_AIR, qty:1, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_SMALL, level:1}, {alt:WAVE_ALT_GROUND, qty:1, size:WAVE_SIZE_MEDIUM, level:1}, {alt:WAVE_ALT_AIR, qty:2, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_SMALL, level:1}, {alt:WAVE_ALT_GROUND, qty:2, size:WAVE_SIZE_MEDIUM, level:1}, {alt:WAVE_ALT_GROUND, qty:8, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_AIR, qty:2, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_AIR, qty:4, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:2, size:WAVE_SIZE_TINY, level:1, effect:WAVE_EFFECT_FAST}, {alt:WAVE_ALT_GROUND, qty:12, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:8, size:WAVE_SIZE_SMALL, level:1}, {alt:WAVE_ALT_GROUND, qty:1, size:WAVE_SIZE_MEDIUM, level:1, effect:WAVE_EFFECT_REPAIR}, {alt:WAVE_ALT_AIR, qty:1, size:WAVE_SIZE_SMALL, level:1}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_MEDIUM, level:1}, {alt:WAVE_ALT_AIR, qty:2, size:WAVE_SIZE_SMALL, level:1}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_SMALL, level:1, effect:WAVE_EFFECT_FAST}, {alt:WAVE_ALT_GROUND, qty:12, size:WAVE_SIZE_SMALL, level:1}, {alt:WAVE_ALT_AIR, qty:4, size:WAVE_SIZE_SMALL, level:1}, {alt:WAVE_ALT_AIR, qty:2, size:WAVE_SIZE_MEDIUM, level:1}, {alt:WAVE_ALT_GROUND, qty:2, size:WAVE_SIZE_BIG, level:1}, {alt:WAVE_ALT_GROUND, qty:2, size:WAVE_SIZE_BIG, level:1, effect:WAVE_EFFECT_REPAIR}), new Array({alt:WAVE_ALT_GROUND, qty:1, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:3, size:WAVE_SIZE_SMALL, level:1}, {alt:WAVE_ALT_GROUND, qty:8, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_SMALL, level:1}, {alt:WAVE_ALT_AIR, qty:1, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:1, size:WAVE_SIZE_SMALL, level:1, effect:WAVE_EFFECT_REPAIR}, {alt:WAVE_ALT_GROUND, qty:8, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_AIR, qty:4, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_SMALL, level:1}, {alt:WAVE_ALT_AIR, qty:4, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_TINY, level:1, effect:WAVE_EFFECT_FAST}, {alt:WAVE_ALT_GROUND, qty:8, size:WAVE_SIZE_SMALL, level:1}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_MEDIUM, level:1}, {alt:WAVE_ALT_AIR, qty:8, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:12, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:10, size:WAVE_SIZE_MEDIUM, level:1}, {alt:WAVE_ALT_AIR, qty:4, size:WAVE_SIZE_SMALL, level:1}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_SMALL, level:1, effect:WAVE_EFFECT_FAST}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_TINY, level:2}, {alt:WAVE_ALT_GROUND, qty:1, size:WAVE_SIZE_BIG, level:1}, {alt:WAVE_ALT_GROUND, qty:12, size:WAVE_SIZE_SMALL, level:1}, {alt:WAVE_ALT_AIR, qty:2, size:WAVE_SIZE_MEDIUM, level:1}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_SMALL, level:1, effect:WAVE_EFFECT_REPAIR}, {alt:WAVE_ALT_GROUND, qty:12, size:WAVE_SIZE_TINY, level:2}, {alt:WAVE_ALT_GROUND, qty:8, size:WAVE_SIZE_SMALL, level:1, effect:WAVE_EFFECT_FAST}, {alt:WAVE_ALT_AIR, qty:12, size:WAVE_SIZE_TINY, level:2}, {alt:WAVE_ALT_AIR, qty:8, size:WAVE_SIZE_TINY, level:1, effect:WAVE_EFFECT_FAST}, {alt:WAVE_ALT_GROUND, qty:10, size:WAVE_SIZE_SMALL, level:2}, {alt:WAVE_ALT_GROUND, qty:8, size:WAVE_SIZE_MEDIUM, level:2}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_SMALL, level:3}, {alt:WAVE_ALT_GROUND, qty:2, size:WAVE_SIZE_BIG, level:1, effect:WAVE_EFFECT_REPAIR}, {alt:WAVE_ALT_AIR, qty:4, size:WAVE_SIZE_MEDIUM, level:2}, {alt:WAVE_ALT_GROUND, qty:2, size:WAVE_SIZE_TINY, level:1, effect:WAVE_EFFECT_SHIELD}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_MEDIUM, level:3}, {alt:WAVE_ALT_GROUND, qty:8, size:WAVE_SIZE_SMALL, level:3}, {alt:WAVE_ALT_GROUND, qty:12, size:WAVE_SIZE_MEDIUM, level:3}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_SMALL, level:2, effect:WAVE_EFFECT_SHIELD}, {alt:WAVE_ALT_AIR, qty:1, size:WAVE_SIZE_MEDIUM, level:1, effect:WAVE_EFFECT_SHIELD}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_BIG, level:3, effect:WAVE_EFFECT_FAST}), new Array({alt:WAVE_ALT_GROUND, qty:1, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_SMALL, level:1}, {alt:WAVE_ALT_GROUND, qty:8, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_SMALL, level:1}, {alt:WAVE_ALT_AIR, qty:1, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:1, size:WAVE_SIZE_SMALL, level:1, effect:WAVE_EFFECT_REPAIR}, {alt:WAVE_ALT_GROUND, qty:8, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_AIR, qty:4, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_SMALL, level:1}, {alt:WAVE_ALT_AIR, qty:4, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_TINY, level:1, effect:WAVE_EFFECT_FAST}, {alt:WAVE_ALT_GROUND, qty:8, size:WAVE_SIZE_SMALL, level:1}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_MEDIUM, level:1}, {alt:WAVE_ALT_AIR, qty:8, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:12, size:WAVE_SIZE_TINY, level:1}, {alt:WAVE_ALT_GROUND, qty:8, size:WAVE_SIZE_MEDIUM, level:1}, {alt:WAVE_ALT_AIR, qty:4, size:WAVE_SIZE_SMALL, level:1}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_SMALL, level:1, effect:WAVE_EFFECT_FAST}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_TINY, level:2}, {alt:WAVE_ALT_GROUND, qty:1, size:WAVE_SIZE_BIG, level:1}, {alt:WAVE_ALT_GROUND, qty:12, size:WAVE_SIZE_SMALL, level:1}, {alt:WAVE_ALT_AIR, qty:2, size:WAVE_SIZE_MEDIUM, level:1}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_SMALL, level:1, effect:WAVE_EFFECT_REPAIR}, {alt:WAVE_ALT_GROUND, qty:12, size:WAVE_SIZE_TINY, level:2}, {alt:WAVE_ALT_GROUND, qty:8, size:WAVE_SIZE_SMALL, level:1, effect:WAVE_EFFECT_FAST}, {alt:WAVE_ALT_AIR, qty:12, size:WAVE_SIZE_TINY, level:2}, {alt:WAVE_ALT_AIR, qty:8, size:WAVE_SIZE_TINY, level:1, effect:WAVE_EFFECT_FAST}, {alt:WAVE_ALT_GROUND, qty:12, size:WAVE_SIZE_SMALL, level:2}, {alt:WAVE_ALT_GROUND, qty:8, size:WAVE_SIZE_MEDIUM, level:2}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_SMALL, level:3}, {alt:WAVE_ALT_GROUND, qty:2, size:WAVE_SIZE_BIG, level:1, effect:WAVE_EFFECT_REPAIR}, {alt:WAVE_ALT_AIR, qty:4, size:WAVE_SIZE_MEDIUM, level:2}, {alt:WAVE_ALT_GROUND, qty:2, size:WAVE_SIZE_TINY, level:1, effect:WAVE_EFFECT_SHIELD}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_MEDIUM, level:3}, {alt:WAVE_ALT_GROUND, qty:8, size:WAVE_SIZE_SMALL, level:3}, {alt:WAVE_ALT_GROUND, qty:12, size:WAVE_SIZE_MEDIUM, level:3}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_SMALL, level:2, effect:WAVE_EFFECT_SHIELD}, {alt:WAVE_ALT_AIR, qty:1, size:WAVE_SIZE_MEDIUM, level:1, effect:WAVE_EFFECT_SHIELD}, {alt:WAVE_ALT_GROUND, qty:8, size:WAVE_SIZE_SMALL, level:4}, {alt:WAVE_ALT_GROUND, qty:8, size:WAVE_SIZE_MEDIUM, level:4}, {alt:WAVE_ALT_GROUND, qty:1, size:WAVE_SIZE_BIG, level:2, effect:WAVE_EFFECT_REPAIR}, {alt:WAVE_ALT_GROUND, qty:2, size:WAVE_SIZE_BIG, level:2, effect:WAVE_EFFECT_SHIELD}, {alt:WAVE_ALT_AIR, qty:4, size:WAVE_SIZE_MEDIUM, level:2, effect:WAVE_EFFECT_FAST}, {alt:WAVE_ALT_AIR, qty:8, size:WAVE_SIZE_SMALL, level:3}, {alt:WAVE_ALT_GROUND, qty:12, size:WAVE_SIZE_MEDIUM, level:3}, {alt:WAVE_ALT_GROUND, qty:8, size:WAVE_SIZE_BIG, level:3, effect:WAVE_EFFECT_FAST}, {alt:WAVE_ALT_GROUND, qty:8, size:WAVE_SIZE_TINY, level:5, effect:WAVE_EFFECT_FAST}, {alt:WAVE_ALT_GROUND, qty:4, size:WAVE_SIZE_BIG, level:4, effect:WAVE_EFFECT_REPAIR}, {alt:WAVE_ALT_AIR, qty:4, size:WAVE_SIZE_MEDIUM, level:4, effect:WAVE_EFFECT_REPAIR}));
}
Symbol 745 MovieClip [__Packages.CMap] Frame 0
class CMap extends MovieClip
{
var attachMovie, _matrixCache, _boolPaused, _layerBuildings, _layerEnemies1, _layerEnemies2, _layerEffects1, _layerEffects2, _layerBlasts1, _matrixPattern, localToGlobal, _mcGrid, _layerWalls, _layerWallShadows, _layerInfo;
function CMap () {
super();
attachMovie("id_layer", "_layerEnemies1", 2);
attachMovie("id_layer", "_layerWallShadows", 3);
attachMovie("id_layer", "_layerWalls", 4);
attachMovie("id_layer", "_layerEffects1", 5);
attachMovie("id_layer", "_layerBuildings", 8);
attachMovie("id_layer", "_layerBlasts1", 9);
attachMovie("id_layer", "_layerEffects2", 10);
attachMovie("id_layer", "_layerEnemies2", 11);
attachMovie("id_layer", "_layerInfo", 12);
_matrixCache = new Array(Const.MATRIX_WIDTH * Const.MATRIX_HEIGHT);
_matrixCache.width = Const.MATRIX_WIDTH;
_matrixCache.height = Const.MATRIX_HEIGHT;
_boolPaused = false;
}
function get buildingsLayer() {
return(_layerBuildings);
}
function get enemiesLayer1() {
return(_layerEnemies1);
}
function get enemiesLayer2() {
return(_layerEnemies2);
}
function get noEnemies() {
for (var _local2 in _layerEnemies1) {
if (_layerEnemies1[_local2] instanceof CEnemy) {
return(false);
}
}
for (var _local2 in _layerEnemies2) {
if (_layerEnemies2[_local2] instanceof CEnemy) {
return(false);
}
}
return(true);
}
function get boolPaused() {
return(_boolPaused);
}
function set boolPaused(__boolValue) {
_boolPaused = __boolValue;
_layerEffects1.__set__boolPaused(__boolValue);
_layerEffects2.__set__boolPaused(__boolValue);
_layerBlasts1.__set__boolPaused(__boolValue);
_layerEnemies1.__set__boolPaused(__boolValue);
_layerEnemies2.__set__boolPaused(__boolValue);
//return(boolPaused);
}
function loadMap(__numIndex) {
_matrixPattern = new Array(Const.MATRIX_WIDTH * Const.MATRIX_HEIGHT);
_matrixPattern.width = Const.MATRIX_WIDTH;
_matrixPattern.height = Const.MATRIX_HEIGHT;
var _local5 = attachMovie((SYMBOL_BASE + __numIndex.toString()) + "_matrix", "_mcMatrix", 1);
if (_local5 == undefined) {
Const.TRACE((("ERROR! Couldn't load map " + SYMBOL_BASE) + __numIndex.toString()) + "_matrix");
return(false);
}
var _local4 = {x:0, y:0};
localToGlobal(_local4);
var _local3 = 0;
while (_local3 < Const.MATRIX_HEIGHT) {
var _local2 = 0;
while (_local2 < Const.MATRIX_WIDTH) {
if (_local5.hitTest((_local4.x + (Const.MATRIX_CELL_WIDTH / 2)) + (_local2 * Const.MATRIX_CELL_WIDTH), (_local4.y + (Const.MATRIX_CELL_HEIGHT / 2)) + (_local3 * Const.MATRIX_CELL_HEIGHT), true)) {
_matrixPattern[(_local3 * Const.MATRIX_WIDTH) + _local2] = CELL_ROCK;
} else {
_matrixPattern[(_local3 * Const.MATRIX_WIDTH) + _local2] = CELL_VOID;
}
_local2++;
}
_local3++;
}
_local5.removeMovieClip();
attachMovie((SYMBOL_BASE + __numIndex.toString()) + "_sand", "_mcSand", 1);
attachMovie((SYMBOL_BASE + __numIndex.toString()) + "_landscape", "_mcLandscape", 6);
attachMovie("id_grid", "_mcGrid", 7);
_mcGrid._visible = false;
markCacheMatrix();
writeMatrixFromCache();
return(true);
}
function markCacheMatrix(__numNewWallI, __numNewWallJ) {
var _local7 = 0;
while (_local7 < _matrixPattern.length) {
_matrixCache[_local7] = _matrixPattern[_local7];
_local7++;
}
var _local2 = new Array();
var _local3;
if ((__numNewWallI == undefined) || (__numNewWallJ == undefined)) {
_local3 = CELL_VOID;
} else if (_matrixCache[(__numNewWallI * _matrixCache.width) + __numNewWallJ] <= CELL_VOID) {
_local3 = CELL_VOID - _matrixCache[(__numNewWallI * _matrixCache.width) + __numNewWallJ];
_matrixCache[(__numNewWallI * _matrixCache.width) + __numNewWallJ] = CELL_WALL;
}
_local7 = 0;
while (_local7 < _matrixCache.height) {
var _local4 = 0;
while (_local4 < _matrixCache.width) {
if (_matrixCache[(_local7 * _matrixCache.width) + _local4] < CELL_VOID) {
if (_matrixCache[(_local7 * _matrixCache.width) + _local4] == (CELL_VOID - _local3)) {
_local2.push({i:_local7, j:_local4});
} else if (_matrixCache[(_local7 * _matrixCache.width) + _local4] < (CELL_VOID - _local3)) {
_matrixCache[(_local7 * _matrixCache.width) + _local4] = CELL_VOID;
}
}
_local4++;
}
_local7++;
}
if (_local3 == CELL_VOID) {
_local3 = 1;
_local2 = getExitCells();
for (_local7 in _local2) {
_matrixCache[(_local2[_local7].i * _matrixCache.width) + _local2[_local7].j] = CELL_VOID - _local3;
}
}
var _local5 = false;
var _local6;
_local3++;
while (!_local5) {
_local6 = new Array();
_local5 = true;
for (var _local8 in _local2) {
_local7 = Math.max(_local2[_local8].i - 1, 0);
while (_local7 <= Math.min(_local2[_local8].i + 1, _matrixCache.height - 1)) {
var _local4 = Math.max(_local2[_local8].j - 1, 0);
while (_local4 <= Math.min(_local2[_local8].j + 1, _matrixCache.width - 1)) {
if (((_local7 != _local2[_local8].i) && (_local4 != _local2[_local8].j)) || ((_local7 == _local2[_local8].i) && (_local4 == _local2[_local8].j))) {
} else if (_matrixCache[(_local7 * _matrixCache.width) + _local4] == CELL_VOID) {
_matrixCache[(_local7 * _matrixCache.width) + _local4] = CELL_VOID - _local3;
_local6.push({i:_local7, j:_local4});
_local5 = false;
}
_local4++;
}
_local7++;
}
}
_local3++;
_local2 = _local6;
}
_local7 = 0;
while (_local7 < _matrixCache.length) {
if (_matrixCache[_local7] == CELL_VOID) {
return(false);
}
_local7++;
}
return(true);
}
function writeMatrixFromCache() {
var _local2 = 0;
while (_local2 < _matrixPattern.length) {
_matrixPattern[_local2] = _matrixCache[_local2];
_local2++;
}
}
function addWall(__numCellI, __numCellJ) {
_layerWalls.addElement("id_cursor_wall", {_x:__numCellJ * Const.MATRIX_CELL_WIDTH, _y:__numCellI * Const.MATRIX_CELL_HEIGHT});
_layerWallShadows.addElement("id_wall_shadow", {_x:__numCellJ * Const.MATRIX_CELL_WIDTH, _y:__numCellI * Const.MATRIX_CELL_HEIGHT});
writeMatrixFromCache();
var _local2;
for (var _local3 in _layerEnemies1) {
if (_layerEnemies1[_local3] instanceof CEnemy) {
_local2 = CEnemy(_layerEnemies1[_local3]);
_local2.updateWaypoint();
}
}
}
function cellHitTest(__numX, __numY) {
var _local3 = {out:false, i:0, j:0, x:0, y:0};
var _local4 = {x:0, y:0};
_root.localToGlobal(_local4);
_local3.j = Math.floor((__numX - _local4.x) / Const.MATRIX_CELL_WIDTH);
_local3.i = Math.floor((__numY - _local4.y) / Const.MATRIX_CELL_HEIGHT);
if (_local3.i < 0) {
_local3.out = true;
_local3.j = undefined;
}
if (_local3.j < 0) {
_local3.out = true;
_local3.j = undefined;
}
if (_local3.j >= _matrixPattern.width) {
_local3.out = true;
_local3.j = undefined;
}
if (_local3.i >= _matrixPattern.height) {
_local3.out = true;
_local3.j = undefined;
}
_local3.x = _local4.x + (_local3.j * Const.MATRIX_CELL_WIDTH);
_local3.y = _local4.y + (_local3.i * Const.MATRIX_CELL_HEIGHT);
return(_local3);
}
function checkPlacingSpace(__numI, __numJ, __matrixPattern) {
if ((((__numI < 0) || (__numJ < 0)) || ((__numI + __matrixPattern.height) > _matrixPattern.height)) || ((__numJ + __matrixPattern.width) > _matrixPattern.width)) {
return(false);
}
var _local3 = 0;
while (_local3 < __matrixPattern.height) {
var _local2 = 0;
while (_local2 < __matrixPattern.width) {
if (((__matrixPattern[(_local3 * __matrixPattern.width) + _local2] != CBuilding.CELL_VOID) && (_matrixPattern[((_local3 + __numI) * _matrixPattern.width) + (_local2 + __numJ)] != CELL_ROCK)) && (_matrixPattern[((_local3 + __numI) * _matrixPattern.width) + (_local2 + __numJ)] != CELL_WALL)) {
return(false);
}
_local2++;
}
_local3++;
}
return(true);
}
function checkBuildingSpace(__numI, __numJ) {
return(_matrixPattern[(__numI * _matrixPattern.width) + __numJ] >= CELL_BUILDING);
}
function checkWallSpace(__numI, __numJ) {
if (((((_matrixPattern[(__numI * _matrixPattern.width) + __numJ] > CELL_VOID) || (__numI == 0)) || (__numJ == 0)) || (__numI == (_matrixPattern.height - 1))) || (__numJ == (_matrixPattern.width - 1))) {
return(false);
}
return(true);
}
function isHitWithGroundEnemy(__mcTarget) {
var _local2 = false;
for (var _local4 in _layerEnemies1) {
if ((_layerEnemies1[_local4] instanceof CEnemy) && (_layerEnemies1[_local4].hitTest(__mcTarget))) {
_local2 = true;
break;
}
}
return(_local2);
}
function addBuilding(__buildingSource) {
var _local2 = _layerBuildings.addElement("id_building");
if (!_local2.copyFrom(__buildingSource)) {
return(false);
}
_local2.numState = CBuilding.STATE_INSTALLED;
var _local4 = 0;
while (_local4 < _local2._matrixPattern.height) {
var _local3 = 0;
while (_local3 < _local2._matrixPattern.width) {
if (_local2._matrixPattern[(_local4 * _local2._matrixPattern.width) + _local3] == CBuilding.CELL_OCCUPIED) {
_matrixPattern[((_local4 + _local2._numCellI) * _matrixPattern.width) + (_local3 + _local2._numCellJ)] = CELL_BUILDING + _local2.getDepth();
}
_local3++;
}
_local4++;
}
return(true);
}
function getBuildingAt(__numI, __numJ) {
var _local2 = _matrixPattern[(__numI * _matrixPattern.width) + __numJ] - CELL_BUILDING;
return(CBuilding(_layerBuildings.getInstanceAtDepth(_local2)));
}
function deleteBuilding(__bldTarget) {
if (__bldTarget._parent == _layerBuildings) {
var _local4 = 0;
while (_local4 < __bldTarget._matrixPattern.height) {
var _local2 = 0;
while (_local2 < __bldTarget._matrixPattern.width) {
if (__bldTarget._matrixPattern[(_local4 * __bldTarget._matrixPattern.width) + _local2] == CBuilding.CELL_OCCUPIED) {
_matrixPattern[((_local4 + __bldTarget._numCellI) * _matrixPattern.width) + (_local2 + __bldTarget._numCellJ)] = CELL_ROCK;
}
_local2++;
}
_local4++;
}
__bldTarget.removeMovieClip();
}
}
function addEnemy(__numType, __numLevel, __effectInitial, __numWaveIndex) {
var _local5 = false;
if (((__numType == CEnemy.TYPE_PLANE) || (__numType == CEnemy.TYPE_INSECT)) || (__numType == CEnemy.TYPE_SCORPIO)) {
_local5 = true;
}
var _local3;
var _local4;
if (_local5) {
_local3 = 0;
_local4 = 4 + random(6);
} else {
var arrEntryCells = getEntryCells();
var _local6 = random(arrEntryCells.length);
_local3 = arrEntryCells[_local6].i;
_local4 = arrEntryCells[_local6].j;
}
var _local2;
if (_local5) {
_local2 = _layerEnemies2.addElement("id_enemy", {_mapReference:this, _numCellI:_local3, _numCellJ:_local4});
_local2.numAltitude = ALTITUDE_AIR;
} else {
_local2 = _layerEnemies1.addElement("id_enemy", {_mapReference:this, _numCellI:_local3, _numCellJ:_local4});
_local2.numAltitude = ALTITUDE_GROUND;
}
_local2._x = (_local4 * Const.MATRIX_CELL_WIDTH) + (Const.MATRIX_CELL_WIDTH / 2);
_local2._y = (_local3 * Const.MATRIX_CELL_HEIGHT) + (Const.MATRIX_CELL_HEIGHT / 2);
if (_local3 == 0) {
_local2._y = _local2._y - Const.MATRIX_CELL_HEIGHT;
_local2._y = _local2._y - (35 * __numWaveIndex);
_local2._vectSpeed.numX = 0;
_local2._vectSpeed.numY = 100;
} else if (_local4 == 0) {
_local2._x = _local2._x - Const.MATRIX_CELL_WIDTH;
_local2._y = _local2._y + (random(16) - 8);
_local2._x = _local2._x - (35 * __numWaveIndex);
_local2._vectSpeed.numX = 100;
_local2._vectSpeed.numY = 0;
}
if (_local5) {
_local2._numWaypointX = _local2._x;
_local2._numWaypointY = (_matrixPattern.height * Const.MATRIX_CELL_HEIGHT) + (Const.MATRIX_CELL_HEIGHT / 2);
} else {
_local2.updateWaypoint();
}
_local2.initEnemy(__numType, __numLevel, _layerInfo);
if (__effectInitial != undefined) {
_local2.applyEffect(__effectInitial);
}
}
function addBlast(__objParam) {
var _local4 = {_x:__objParam.x, _y:__objParam.y, vectSpeed:__objParam.direction, numSpeed:__objParam.speed, _numAltitude:__objParam.altitude};
var _local3 = _layerBlasts1.addElement("id_blast", _local4);
_local3.initBlast(__objParam.type);
if (__objParam.targetsEnemy) {
_local3.setTarget(__objParam.targetsEnemy, __objParam.target);
} else {
_local3.setTarget(__objParam.targetsEnemy, {x:__objParam.targetX - CBuilding.objBasePoint.x, y:__objParam.targetY - CBuilding.objBasePoint.y});
}
}
function addGFX(__objParam) {
var _local4;
if ((__objParam.altitude == ALTITUDE_AIR) || (__objParam.altitude == ALTITUDE_BOTH)) {
_local4 = _layerEffects2;
} else {
_local4 = _layerEffects1;
}
_local4.globalToLocal(__objParam);
var _local3 = {_x:__objParam.x, _y:__objParam.y};
if (__objParam.radius) {
_local3._width = 2 * __objParam.radius;
_local3._height = 2 * __objParam.radius;
}
_local4.addElement(__objParam.symbol, _local3);
}
function getEntryCells() {
var _local2 = new Array();
var _local3 = 0;
while (_local3 < _matrixPattern.width) {
if (_matrixPattern[_local3] <= CELL_VOID) {
_local2.push({i:0, j:_local3});
}
_local3++;
}
var _local4 = 0;
while (_local4 < _matrixPattern.height) {
if (_matrixPattern[_local4 * _matrixPattern.width] <= CELL_VOID) {
_local2.push({i:_local4, j:0});
}
_local4++;
}
return(_local2);
}
function getNextCell(__numCellI, __numCellJ) {
var _local7;
var _local6 = false;
var _local5 = Math.max(__numCellI - 1, 0);
while (_local5 <= Math.min(__numCellI + 1, _matrixPattern.height - 1)) {
var _local4 = Math.max(__numCellJ - 1, 0);
while (_local4 <= Math.min(__numCellJ + 1, _matrixPattern.width - 1)) {
if (((_local5 != __numCellI) && (_local4 != __numCellJ)) || ((_local5 == __numCellI) && (_local4 == __numCellJ))) {
} else if ((_matrixPattern[(_local5 * _matrixPattern.width) + _local4] == (_matrixPattern[(__numCellI * _matrixPattern.width) + __numCellJ] + 1)) && (_matrixPattern[(_local5 * _matrixPattern.width) + _local4] <= CELL_VOID)) {
_local7 = {i:_local5, j:_local4};
_local6 = true;
break;
}
_local4++;
}
if (_local6) {
break;
}
_local5++;
}
return(_local7);
}
function getExitCells() {
var _local2 = new Array();
var _local3 = 0;
while (_local3 < _matrixPattern.width) {
if (_matrixPattern[((_matrixPattern.height - 1) * _matrixPattern.width) + _local3] <= CELL_VOID) {
_local2.push({i:_matrixPattern.height - 1, j:_local3});
}
_local3++;
}
var _local4 = 0;
while (_local4 < _matrixPattern.height) {
if (_matrixPattern[((_local4 + 1) * _matrixPattern.width) - 1] <= CELL_VOID) {
_local2.push({i:_local4, j:_matrixPattern.width - 1});
}
_local4++;
}
return(_local2);
}
function getNearestEnemy(__numX, __numY, __numRange, __numAltitude, __enemyForbidden) {
var _local3 = 999999 /* 0x0F423F */;
var _local4;
var _local2;
if ((__numAltitude == ALTITUDE_GROUND) || (__numAltitude == ALTITUDE_BOTH)) {
for (var _local9 in _layerEnemies1) {
if ((((_layerEnemies1[_local9] instanceof CEnemy) && (_layerEnemies1[_local9] != __enemyForbidden)) && (_layerEnemies1[_local9]._x > 0)) && (_layerEnemies1[_local9]._y > 0)) {
_local2 = _layerEnemies1[_local9].getDistanceFrom(__numX, __numY);
if ((_local2 <= __numRange) && (_local2 < _local3)) {
_local3 = _local2;
_local4 = _layerEnemies1[_local9];
}
}
}
}
if ((__numAltitude == ALTITUDE_AIR) || (__numAltitude == ALTITUDE_BOTH)) {
for (var _local9 in _layerEnemies2) {
if ((((_layerEnemies2[_local9] instanceof CEnemy) && (_layerEnemies2[_local9] != __enemyForbidden)) && (_layerEnemies2[_local9]._x > 0)) && (_layerEnemies2[_local9]._y > 0)) {
_local2 = _layerEnemies2[_local9].getDistanceFrom(__numX, __numY);
if ((_local2 <= __numRange) && (_local2 < _local3)) {
_local3 = _local2;
_local4 = _layerEnemies2[_local9];
}
}
}
}
return(_local4);
}
function applySplashEffect(__effectSplash, __numCenterX, __numCenterY, __numRadius, __numAltitude) {
var _local2;
if ((__numAltitude == ALTITUDE_GROUND) || (__numAltitude == ALTITUDE_BOTH)) {
for (var _local7 in _layerEnemies1) {
if (_layerEnemies1[_local7] instanceof CEnemy) {
_local2 = _layerEnemies1[_local7].getDistanceFrom(__numCenterX, __numCenterY);
if (_local2 <= __numRadius) {
_layerEnemies1[_local7].applyEffect(__effectSplash);
}
}
}
}
if ((__numAltitude == ALTITUDE_AIR) || (__numAltitude == ALTITUDE_BOTH)) {
for (var _local7 in _layerEnemies2) {
if (_layerEnemies2[_local7] instanceof CEnemy) {
_local2 = _layerEnemies2[_local7].getDistanceFrom(__numCenterX, __numCenterY);
if (_local2 <= __numRadius) {
_layerEnemies2[_local7].applyEffect(__effectSplash);
}
}
}
}
}
function toggleGrid(__boolVisible) {
_mcGrid._visible = __boolVisible;
}
function process() {
_layerEnemies1.process();
_layerEnemies2.process();
_layerBuildings.process();
_layerBlasts1.process();
}
static var CELL_VOID = 0;
static var CELL_ROCK = 1;
static var CELL_WALL = 2;
static var CELL_BUILDING = 10;
static var ALTITUDE_GROUND = 1;
static var ALTITUDE_AIR = 2;
static var ALTITUDE_BOTH = 3;
static var SYMBOL_BASE = "id_map";
}
Symbol 746 MovieClip [__Packages.CLayer] Frame 0
class CLayer extends MovieClip
{
var _numCounter, _boolPaused, attachMovie, getNextHighestDepth;
function CLayer () {
super();
_numCounter = 0;
_boolPaused = false;
}
function get boolPaused() {
return(_boolPaused);
}
function set boolPaused(__boolValue) {
_boolPaused = __boolValue;
if (_boolPaused) {
for (var _local3 in this) {
if (this[_local3] instanceof MovieClip) {
this[_local3].stop();
for (var _local2 in this[_local3]) {
this[_local3][_local2].stop();
}
if (this[_local3]._mcObject != undefined) {
for (var _local2 in this[_local3]._mcObject) {
this[_local3]._mcObject[_local2].stop();
}
}
}
}
} else {
for (var _local3 in this) {
if (this[_local3] instanceof MovieClip) {
this[_local3].play();
for (var _local2 in this[_local3]) {
this[_local3][_local2].play();
}
if (this[_local3]._mcObject != undefined) {
for (var _local2 in this[_local3]._mcObject) {
this[_local3]._mcObject[_local2].play();
}
}
}
}
}
//return(boolPaused);
}
function clear() {
for (var _local2 in this) {
if (this[_local2] instanceof MovieClip) {
this[_local2].removeMovieClip();
}
}
_numCounter = 0;
}
function addElement(__strSymbolName, __objInit) {
_numCounter++;
return(attachMovie(__strSymbolName, "_mcElement" + _numCounter, getNextHighestDepth(), __objInit));
}
function removeElement(__mcTarget) {
if (__mcTarget._parent != this) {
Const.TRACE(("ERROR! " + __mcTarget) + " isn't element of layer.");
return(false);
}
__mcTarget.removeMovieClip();
return(true);
}
function process() {
for (var _local2 in this) {
if (this[_local2] instanceof MovieClip) {
this[_local2].process();
}
}
}
}
Symbol 747 MovieClip [__Packages.CEnemy] Frame 0
class CEnemy extends CEventMovieClip
{
var boolExists, _boolNearExit, _boolAutoMove, _numType, _numMaxSpeed, _numThrottle, _numTurnSpeed, _vectSpeed, _numMaxHealth, _strDeathEffect, _numLevel, _numHealth, _mcHealthBar, _numReward, numAltitude, _y, _x, dispatchMessage, attachMovie, _mcObject, localToGlobal, _arrEffects, _mapReference, _numCellI, _numCellJ, _numWaypointX, _numWaypointY, _mcFastEffect, getNextHighestDepth, _mcSlowEffect, _mcRepairEffect, _mcShieldEffect, _width, _height, _rotation, _numOldCellI, _numOldCellJ, removeMovieClip;
function CEnemy () {
super();
boolExists = true;
_boolNearExit = false;
_boolAutoMove = false;
}
function get numType() {
return(_numType);
}
function set numType(__numValue) {
if (_numType != __numValue) {
_numType = __numValue;
switch (_numType) {
case TYPE_BAGGI :
_numMaxSpeed = 2;
_numThrottle = 0.3;
_numTurnSpeed = 0.11;
_vectSpeed = new CVector(1, 1);
_vectSpeed.__set__numLength(_numMaxSpeed);
_numMaxHealth = 15;
_strDeathEffect = "id_gfx_explosion_small";
break;
case TYPE_TRICYCLE :
_numMaxSpeed = 1.7;
_numThrottle = 0.3;
_numTurnSpeed = 0.1;
_vectSpeed = new CVector(1, 1);
_vectSpeed.__set__numLength(_numMaxSpeed);
_numMaxHealth = 35;
_strDeathEffect = "id_gfx_explosion_medium";
break;
case TYPE_CAR :
_numMaxSpeed = 1.5;
_numThrottle = 0.25;
_numTurnSpeed = 0.08;
_vectSpeed = new CVector(1, 1);
_vectSpeed.__set__numLength(_numMaxSpeed);
_numMaxHealth = 70;
_strDeathEffect = "id_gfx_explosion_medium";
break;
case TYPE_HOWERTANK :
_numMaxSpeed = 1.1;
_numThrottle = 0.2;
_numTurnSpeed = 0.06;
_vectSpeed = new CVector(1, 1);
_vectSpeed.__set__numLength(_numMaxSpeed);
_numMaxHealth = 120;
_strDeathEffect = "id_gfx_explosion_big";
break;
case TYPE_PLANE :
_numMaxSpeed = 1.8;
_numThrottle = 0.3;
_numTurnSpeed = 0.11;
_vectSpeed = new CVector(0, 1);
_vectSpeed.__set__numLength(_numMaxSpeed);
_numMaxHealth = 8;
_strDeathEffect = "id_gfx_explosion_small";
break;
case TYPE_INSECT :
_numMaxSpeed = 1.5;
_numThrottle = 0.3;
_numTurnSpeed = 0.16;
_vectSpeed = new CVector(0, 1);
_vectSpeed.__set__numLength(_numMaxSpeed);
_numMaxHealth = 20;
_strDeathEffect = "id_gfx_explosion_medium";
break;
case TYPE_SCORPIO :
_numMaxSpeed = 1.2;
_numThrottle = 0.3;
_numTurnSpeed = 0.06;
_vectSpeed = new CVector(0, 1);
_vectSpeed.__set__numLength(_numMaxSpeed);
_numMaxHealth = 40;
_strDeathEffect = "id_gfx_explosion_big";
}
_numMaxHealth = _numMaxHealth + Math.round((1.2 * (_numLevel - 1)) * _numMaxHealth);
var _local2 = ((_numMaxHealth < 100) ? (_numMaxHealth) : 100);
_numHealth = _numMaxHealth;
_mcHealthBar._width = _local2 / 2;
_numReward = REWARDS[_numType - 1] * (1 + (0.5 * (_numLevel - 1)));
}
//return(numType);
}
function get numHealth() {
return(_numHealth);
}
function set numHealth(__numValue) {
_numHealth = __numValue;
if (_numHealth < 0) {
_numHealth = 0;
}
if (_numHealth > _numMaxHealth) {
_numHealth = _numMaxHealth;
}
_mcHealthBar.mcBar._width = (100 * _numHealth) / _numMaxHealth;
if (_numHealth == 0) {
var _local2 = {symbol:_strDeathEffect, x:_x, y:_y, altitude:numAltitude};
dispatchMessage(CEventMovieClip.MSG_ENEMYDEAD, _local2);
}
//return(numHealth);
}
function initEnemy(__numType, __numLevel, __mcLayerInfo) {
attachMovie(SYMBOL_BASE + __numType.toString(), "_mcObject", 1);
_mcHealthBar = __mcLayerInfo.addElement("id_healthbar");
var _local2 = {x:_mcObject._x, y:(_mcObject._y - (_mcObject._height / 2)) - 5};
localToGlobal(_local2);
__mcLayerInfo.globalToLocal(_local2);
_mcHealthBar._x = _local2.x;
_mcHealthBar._y = _local2.y;
_numLevel = __numLevel;
numType = (__numType);
_arrEffects = new Array();
}
function updateWaypoint() {
_boolAutoMove = false;
var _local2 = _mapReference.getNextCell(_numCellI, _numCellJ);
if (_local2 == undefined) {
return(false);
}
if (_numCellJ == _local2.j) {
if (_numCellI < _local2.i) {
_numWaypointX = (_numCellJ + 0.5) * Const.MATRIX_CELL_WIDTH;
_numWaypointY = (_numCellI + 1) * Const.MATRIX_CELL_HEIGHT;
} else {
_numWaypointX = (_numCellJ + 0.5) * Const.MATRIX_CELL_WIDTH;
_numWaypointY = _numCellI * Const.MATRIX_CELL_HEIGHT;
}
}
if (_numCellI == _local2.i) {
if (_numCellJ < _local2.j) {
_numWaypointX = (_numCellJ + 1) * Const.MATRIX_CELL_WIDTH;
_numWaypointY = (_numCellI + 0.5) * Const.MATRIX_CELL_HEIGHT;
} else {
_numWaypointX = _numCellJ * Const.MATRIX_CELL_WIDTH;
_numWaypointY = (_numCellI + 0.5) * Const.MATRIX_CELL_HEIGHT;
}
}
return(true);
}
function process() {
if (_vectSpeed.__get__numLength() < _numMaxSpeed) {
_vectSpeed.numLength = _vectSpeed.numLength + _numMaxSpeed;
}
if (_vectSpeed.__get__numLength() > _numMaxSpeed) {
_vectSpeed.__set__numLength(_numMaxSpeed);
}
var _local15 = false;
var _local8 = false;
var _local4 = false;
var _local11 = false;
var _local6 = false;
var _local7 = false;
var _local17 = false;
var _local9 = 0;
var _local12 = 0;
var _local10 = 0;
var _local19 = 0;
var _local18 = 0;
var _local5 = 1;
var _local3 = 0;
var _local2 = 0;
while (_local2 < _arrEffects.length) {
switch (_arrEffects[_local2].numType) {
case CEffect.TYPE_DAMAGE :
_local15 = true;
_local10 = _local10 + _arrEffects[_local2].objParams.damage;
break;
case CEffect.TYPE_FAST :
_local8 = true;
_local9 = _local9 + (_vectSpeed.__get__numLength() * _arrEffects[_local2].objParams.percent);
break;
case CEffect.TYPE_SLOW :
_local4 = true;
_local12 = _local12 + (_vectSpeed.__get__numLength() * _arrEffects[_local2].objParams.percent);
break;
case CEffect.TYPE_CLEAR :
_local11 = true;
break;
case CEffect.TYPE_REPAIR :
_local6 = true;
_local19 = _local19 + (_numMaxHealth * _arrEffects[_local2].objParams.percent);
break;
case CEffect.TYPE_SHIELD :
_local7 = true;
_local5 = Math.min(_local5, _arrEffects[_local2].objParams.pass);
break;
case CEffect.TYPE_PIERCEDAMAGE :
_local18 = _local18 + _arrEffects[_local2].objParams.damage;
break;
case CEffect.TYPE_CONFUSE :
_local3 = _local3 + (_numTurnSpeed * _arrEffects[_local2].objParams.percent);
if (_local3 >= _numTurnSpeed) {
_local3 = _numTurnSpeed;
}
break;
case CEffect.TYPE_TIMESTOP :
_local4 = true;
_local17 = true;
}
if (_arrEffects[_local2].tick()) {
_arrEffects.splice(_local2, 1);
_local2--;
}
_local2++;
}
_vectSpeed.numLength = _vectSpeed.numLength + (_local9 - _local12);
if (_vectSpeed.__get__numLength() < MIN_SPEED) {
_vectSpeed.__set__numLength(MIN_SPEED);
}
var _local20 = _numTurnSpeed - _local3;
if (_local17) {
_vectSpeed.__set__numLength(0);
_local20 = 0;
}
numHealth = numHealth + ((_local19 - _local18) - (_local5 * _local10));
if (_local11) {
_arrEffects = new Array();
}
if (_local8 && (_mcFastEffect == undefined)) {
attachMovie("id_effect_fast", "_mcFastEffect", getNextHighestDepth(), {_width:1.3 * _mcObject._width, _height:1.3 * _mcObject._height});
}
if ((!_local8) && (_mcFastEffect != undefined)) {
_mcFastEffect.removeMovieClip();
}
if (_local4 && (_mcSlowEffect == undefined)) {
attachMovie("id_effect_slow", "_mcSlowEffect", getNextHighestDepth(), {_width:1.3 * _mcObject._width, _height:1.3 * _mcObject._height});
}
if ((!_local4) && (_mcSlowEffect != undefined)) {
_mcSlowEffect.removeMovieClip();
}
if (_local6 && (_mcRepairEffect == undefined)) {
attachMovie("id_effect_repair", "_mcRepairEffect", getNextHighestDepth(), {_width:1.3 * _mcObject._width, _height:1.3 * _mcObject._height});
}
if ((!_local6) && (_mcRepairEffect != undefined)) {
_mcRepairEffect.removeMovieClip();
}
if (_local7 && (_mcShieldEffect == undefined)) {
attachMovie("id_effect_shield", "_mcShieldEffect", getNextHighestDepth(), {_width:1.3 * _mcObject._width, _height:1.3 * _mcObject._height});
}
if ((!_local7) && (_mcShieldEffect != undefined)) {
_mcShieldEffect.removeMovieClip();
}
if (_local15) {
CSoundService.playSound(Const.SND_HIT);
}
var _local16 = new CVector(0, 0);
if (_boolNearExit) {
if (((_x - (_width / 2)) > (Const.MATRIX_WIDTH * Const.MATRIX_CELL_WIDTH)) || ((_y - (_height / 2)) > (Const.MATRIX_HEIGHT * Const.MATRIX_CELL_HEIGHT))) {
dispatchMessage(CEventMovieClip.MSG_ENEMYPASSED);
}
if (_numCellI == (_mapReference._matrixPattern.height - 1)) {
_local16.__set__numY(1);
}
if (_numCellJ == (_mapReference._matrixPattern.width - 1)) {
_local16.__set__numX(1);
}
} else {
_local16.__set__numX(_numWaypointX - _x);
_local16.__set__numY(_numWaypointY - _y);
}
if (numAltitude != CMap.ALTITUDE_AIR) {
var _local21 = _vectSpeed.getAngleWith(_local16);
if (_local21 > WAYPOINT_TURN_TOLERANCE) {
var _local23 = (_local16.__get__numX() * _vectSpeed.__get__numY()) - (_vectSpeed.__get__numX() * _local16.__get__numY());
var _local22 = ((_local20 > _local21) ? (_local21) : (_local20));
if (_local23 > 0) {
_vectSpeed.rotate(_local22);
} else {
_vectSpeed.rotate(-_local22);
}
}
}
var _local25 = _x;
var _local24 = _y;
_x = _x + _vectSpeed.numX;
_y = _y + _vectSpeed.numY;
_rotation = _vectSpeed.numRotation;
var _local13 = Math.floor(_x / Const.MATRIX_CELL_WIDTH);
var _local14 = Math.floor(_y / Const.MATRIX_CELL_HEIGHT);
if ((((((numAltitude != CMap.ALTITUDE_AIR) && (_local14 >= 0)) && (_local14 < Const.MATRIX_HEIGHT)) && (_local13 >= 0)) && (_local13 < Const.MATRIX_WIDTH)) && (_mapReference._matrixPattern[(_local14 * Const.MATRIX_WIDTH) + _local13] > CMap.CELL_VOID)) {
_vectSpeed.__set__numLength(0.1);
_x = _local25;
_y = _local24;
_local14 = -1;
_local13 = -1;
} else {
_mcHealthBar._x = _mcHealthBar._x + _vectSpeed.numX;
_mcHealthBar._y = _mcHealthBar._y + _vectSpeed.numY;
}
if (((_local14 >= 0) && (_local13 >= 0)) && ((_numCellI != _local14) || (_numCellJ != _local13))) {
_numOldCellI = _numCellI;
_numOldCellJ = _numCellJ;
_numCellJ = _local13;
_numCellI = _local14;
if ((numAltitude == CMap.ALTITUDE_AIR) || (!updateWaypoint())) {
_boolNearExit = true;
}
}
}
function restoreOldCell() {
_numCellI = _numOldCellI;
_numCellJ = _numOldCellJ;
}
function remove() {
_mcHealthBar.removeMovieClip();
removeMovieClip();
}
function getDistanceFrom(__numX, __numY) {
var _local2 = {x:__numX, y:__numY};
var _local3 = Math.sqrt(((_x - _local2.x) * (_x - _local2.x)) + ((_y - _local2.y) * (_y - _local2.y)));
return(_local3);
}
function applyEffect(__effectNew) {
_arrEffects.push(__effectNew);
}
static var TYPE_BAGGI = 1;
static var TYPE_TRICYCLE = 2;
static var TYPE_CAR = 3;
static var TYPE_HOWERTANK = 4;
static var TYPE_PLANE = 5;
static var TYPE_INSECT = 6;
static var TYPE_SCORPIO = 7;
static var REWARDS = new Array(20, 50, 85, 120, 30, 75, 100);
static var SYMBOL_BASE = "id_enemy";
static var WAYPOINT_HIT_TOLERANCE = 20;
static var WAYPOINT_TURN_TOLERANCE = 0.1;
static var WAYPOINT_RANDOM = 16;
static var MIN_SPEED = 0.35;
}
Symbol 748 MovieClip [__Packages.CVector] Frame 0
class CVector
{
var _numX, _numY;
function CVector (__numX, __numY) {
_numX = __numX;
_numY = __numY;
}
function get numX() {
return(_numX);
}
function set numX(__numNew) {
_numX = __numNew;
//return(numX);
}
function get numY() {
return(_numY);
}
function set numY(__numNew) {
_numY = __numNew;
//return(numY);
}
function get numLength() {
return(Math.sqrt((_numX * _numX) + (_numY * _numY)));
}
function set numLength(__numNew) {
if (__numNew < MIN_LENGTH) {
__numNew = MIN_LENGTH;
}
if (numLength) {
var _local2 = __numNew / numLength;
_numX = _numX * _local2;
_numY = _numY * _local2;
}
//return(numLength);
}
function get numRotation() {
var _local2 = (180 * getAngleWith(new CVector(0, -1))) / Math.PI;
if (_numX < 0) {
_local2 = _local2 * -1;
}
return(_local2);
}
function set numRotation(__numValue) {
var _local2 = numLength;
_numX = 0;
_numY = 1;
rotate((-3.14159265358979 * __numValue) / 180);
numLength = (_local2);
//return(numRotation);
}
function makeCopy() {
return(new CVector(_numX, _numY));
}
function addVector(__vectAdd) {
_numX = _numX + __vectAdd.numX;
_numY = _numY + __vectAdd.numY;
}
function rotate(__numAngle) {
if (__numAngle) {
var _local3 = Math.atan2(_numX, _numY) + __numAngle;
var _local2 = numLength;
_numX = _local2 * Math.sin(_local3);
_numY = _local2 * Math.cos(_local3);
}
}
function oneWayTo(__vector, __precision) {
return(Math.abs((_numX * __vector.__get__numY()) - (_numY * __vector.__get__numX())) <= __precision);
}
function getAngleWith(__vector) {
return(Math.acos(((_numX * __vector.__get__numX()) + (_numY * __vector.__get__numY())) / (numLength * __vector.__get__numLength())));
}
function getProjection(__vector) {
return(((_numX * __vector.__get__numX()) + (_numY * __vector.__get__numY())) / __vector.__get__numLength());
}
function toString() {
return(new String(((("|" + _numX) + ",") + _numY) + "|"));
}
var MIN_LENGTH = 0.001;
}
Symbol 749 MovieClip [__Packages.CEffect] Frame 0
class CEffect
{
var numType, objParams, _numDuration, _numTimer;
function CEffect (__numType, __objParams, __numDuration) {
numType = __numType;
objParams = __objParams;
_numDuration = __numDuration;
if (_numDuration == undefined) {
_numTimer = 0;
} else {
_numTimer = _numDuration;
}
}
function tick() {
if (_numTimer == 0) {
return(true);
}
_numTimer--;
return(false);
}
function makeCopy() {
return(new CEffect(numType, objParams, _numDuration));
}
static var TYPE_DAMAGE = 1;
static var TYPE_FAST = 2;
static var TYPE_SLOW = 3;
static var TYPE_CLEAR = 4;
static var TYPE_REPAIR = 5;
static var TYPE_SHIELD = 6;
static var TYPE_PIERCEDAMAGE = 7;
static var TYPE_CONFUSE = 8;
static var TYPE_TIMESTOP = 9;
}
Symbol 750 MovieClip [__Packages.CSoundService] Frame 0
class CSoundService extends MovieClip
{
var m_sounds, m_soundsState, m_soundsNames, createEmptyMovieClip, onEnterFrame;
function CSoundService () {
super();
}
function realPlaySound(id, repeatCount) {
if (m_soundOff) {
return(undefined);
}
Sound(m_sounds[id]).start(0, repeatCount);
}
function processSounds() {
var _local2 = 0;
while (_local2 < m_sounds.length) {
if (m_soundsState[_local2] > 0) {
realPlaySound(_local2, m_soundsState[_local2]);
m_soundsState[_local2] = ST_PLAY;
}
_local2++;
}
}
function init(soundNames) {
m_soundsNames = soundNames;
m_sounds = new Array(soundNames.length);
m_soundsState = new Array(soundNames.length);
var _local2 = 0;
while (_local2 < soundNames.length) {
var _local4 = createEmptyMovieClip("_contMovie" + _local2, 1000 + _local2);
var _local3 = new Sound(_local4);
_local3.attachSound(soundNames[_local2]);
m_soundsState[_local2] = ST_STOP;
_local3.sounID = _local2;
_local3.parent = m_instance;
_local3.onSoundComplete = function () {
this.parent.m_soundsState[this.sounID] = CSoundService.ST_STOP;
};
m_sounds[_local2] = _local3;
_local2++;
}
onEnterFrame = processSounds;
}
static function createSoundService(soundNames, soundsPlace, depthInSoundsPlace) {
m_instance = CSoundService(soundsPlace.attachMovie("dmSoundService", "__SoundServiceObject", depthInSoundsPlace));
m_instance.init(soundNames);
return(m_instance);
}
static function playLoopSound(soundID) {
if ((m_instance.m_loopSoundID >= 0) && (m_instance.m_loopSoundID != soundID)) {
stopSound(m_instance.m_loopSoundID);
}
m_instance.m_loopSoundID = soundID;
if (!soundIsPlay(m_instance.m_loopSoundID)) {
playCurLoopSound();
}
}
static function playCurLoopSound() {
playSound(m_instance.m_loopSoundID, true, 9999);
}
static function stopCurLoopSound() {
stopSound(m_instance.m_loopSoundID);
m_instance.m_loopSoundID = -1;
}
static function soundOff() {
var _local1 = 0;
while (_local1 < m_instance.m_sounds.length) {
stopSound(_local1);
_local1++;
}
m_instance.m_soundOff = true;
}
static function soundOn() {
m_instance.m_soundOff = false;
if (m_instance.m_loopSoundID >= 0) {
playCurLoopSound();
}
}
static function soundIsPlay(id) {
return(m_instance.m_soundsState[id] != ST_STOP);
}
static function playSound(id, ifSoundStop, repeatCount) {
if (repeatCount == undefined) {
repeatCount = 1;
}
if (ifSoundStop == undefined) {
ifSoundStop = false;
}
if (m_instance.m_soundOff) {
return(undefined);
}
if (ifSoundStop && (soundIsPlay(id))) {
return(undefined);
}
m_instance.m_soundsState[id] = repeatCount;
}
static function stopSound(id) {
Sound(m_instance.m_sounds[id]).stop(m_instance.m_soundsNames[id]);
m_instance.m_soundsState[id] = ST_STOP;
}
static function getSoundAt(soundNum) {
return(m_instance.m_sounds[soundNum]);
}
static function soundIsOn() {
return(!m_instance.m_soundOff);
}
static function stopAllSound() {
var _local1 = 0;
while (_local1 < m_instance.m_sounds.length) {
stopSound(_local1);
_local1++;
}
}
var m_loopSoundID = -1;
static var m_instance = null;
var m_soundOff = false;
static var ST_PLAY = -1;
static var ST_STOP = 0;
static var PLAY_OPT_ALWAYS = 0;
static var PLAY_OPT_IFSTOP = 1;
static var PLAY_OPT_STOPANDPLAY = 2;
}
Symbol 751 MovieClip [__Packages.CBuilding] Frame 0
class CBuilding extends CEventMovieClip
{
static var objBasePoint;
var _boolMouseOver, _boolTower, useHandCursor, _numState, _numType, _numRange, _numTurnSpeed, _numAimingAltitude, _numReloadTime, _numReloadTimer, _numPrice, onRollOver, onRollOut, _vectDirection, attachMovie, _mcMatrix, localToGlobal, _matrixPattern, _parent, _x, _y, _numCellI, _numCellJ, dispatchMessage, _enemyTarget, _mcObject;
function CBuilding () {
super();
_boolMouseOver = false;
_boolTower = false;
useHandCursor = false;
_numState = STATE_UNDEFINED;
}
function get numType() {
return(_numType);
}
function set numType(__numValue) {
if (_numType != __numValue) {
_numType = __numValue;
switch (_numType) {
case TYPE_TOWER_1_1 :
_boolTower = true;
_numRange = 100;
_numTurnSpeed = 0.1;
_numAimingAltitude = CMap.ALTITUDE_GROUND;
_numReloadTime = 36;
_numReloadTimer = _numReloadTime;
break;
case TYPE_TOWER_1_2 :
_boolTower = true;
_numRange = 200;
_numTurnSpeed = 0.05;
_numAimingAltitude = CMap.ALTITUDE_GROUND;
_numReloadTime = 108;
_numReloadTimer = _numReloadTime;
break;
case TYPE_TOWER_1_3 :
_boolTower = true;
_numRange = 60;
_numTurnSpeed = 0;
_numAimingAltitude = CMap.ALTITUDE_GROUND;
_numReloadTime = 48;
_numReloadTimer = _numReloadTime;
break;
case TYPE_TOWER_1_4 :
_boolTower = true;
_numRange = 70;
_numTurnSpeed = 0.1;
_numAimingAltitude = CMap.ALTITUDE_GROUND;
_numReloadTime = 6;
_numReloadTimer = _numReloadTime;
break;
case TYPE_TOWER_1_5 :
_boolTower = true;
_numRange = 100;
_numTurnSpeed = 0.1;
_numAimingAltitude = CMap.ALTITUDE_BOTH;
_numReloadTime = 250;
_numReloadTimer = _numReloadTime;
break;
case TYPE_TOWER_2_1 :
_boolTower = true;
_numRange = 110;
_numTurnSpeed = 0.1;
_numAimingAltitude = CMap.ALTITUDE_AIR;
_numReloadTime = 6;
_numReloadTimer = _numReloadTime;
break;
case TYPE_TOWER_2_2 :
_boolTower = true;
_numRange = 90;
_numTurnSpeed = 0.1;
_numAimingAltitude = CMap.ALTITUDE_BOTH;
_numReloadTime = 24;
_numReloadTimer = _numReloadTime;
break;
case TYPE_TOWER_2_3 :
_boolTower = true;
_numRange = 100;
_numTurnSpeed = 0.1;
_numAimingAltitude = CMap.ALTITUDE_GROUND;
_numReloadTime = 24;
_numReloadTimer = _numReloadTime;
break;
case TYPE_TOWER_2_4 :
_boolTower = true;
_numRange = 90;
_numTurnSpeed = 0.1;
_numAimingAltitude = CMap.ALTITUDE_AIR;
_numReloadTime = 24;
_numReloadTimer = _numReloadTime;
break;
case TYPE_TOWER_2_5 :
_boolTower = true;
_numRange = 120;
_numTurnSpeed = 0.1;
_numAimingAltitude = CMap.ALTITUDE_GROUND;
_numReloadTime = 24;
_numReloadTimer = _numReloadTime;
break;
case TYPE_BULIDING_1 :
case TYPE_BULIDING_2 :
case TYPE_BULIDING_3 :
case TYPE_BULIDING_4 :
case TYPE_BULIDING_5 :
_boolTower = false;
}
_numPrice = PRICES[_numType - 1];
}
//return(numType);
}
function get numRange() {
return(_numRange * (1 + RANGE_BONUS));
}
function get numState() {
return(_numState);
}
function set numState(__newValue) {
if (_numState != __newValue) {
_numState = __newValue;
switch (_numState) {
case STATE_PLACING :
onRollOver = undefined;
onRollOut = undefined;
break;
case STATE_INSTALLED :
onRollOver = onInstalledRollOver;
onRollOut = onInstalledRollOut;
}
}
//return(numState);
}
function initBuilding(__numType) {
numType = (__numType);
_vectDirection = new CVector(0, -1);
if (MATRICES[__numType] == undefined) {
if (attachMovie((SYMBOL_BASE + __numType.toString()) + "_matrix", "_mcMatrix", 0) == undefined) {
Const.TRACE((("ERROR! Couldn't load building matrix " + SYMBOL_BASE) + __numType.toString()) + "_matrix");
return(false);
}
var _local9 = Math.ceil(_mcMatrix._width / Const.MATRIX_CELL_WIDTH);
var _local8 = Math.ceil(_mcMatrix._height / Const.MATRIX_CELL_HEIGHT);
MATRICES[__numType] = new Array(_local9 * _local8);
MATRICES[__numType].width = _local9;
MATRICES[__numType].height = _local8;
objBasePoint = {x:_mcMatrix._x, y:_mcMatrix._y};
_root.localToGlobal(objBasePoint);
var _local6 = {x:_mcMatrix._x, y:_mcMatrix._y};
localToGlobal(_local6);
var _local5 = 0;
while (_local5 < MATRICES[__numType].height) {
var _local4 = 0;
while (_local4 < MATRICES[__numType].width) {
if (_mcMatrix.hitTest((_local6.x + (Const.MATRIX_CELL_WIDTH / 2)) + (_local4 * Const.MATRIX_CELL_WIDTH), (_local6.y + (Const.MATRIX_CELL_HEIGHT / 2)) + (_local5 * Const.MATRIX_CELL_HEIGHT), true)) {
MATRICES[__numType][(_local5 * MATRICES[__numType].width) + _local4] = CELL_OCCUPIED;
} else {
MATRICES[__numType][(_local5 * MATRICES[__numType].width) + _local4] = CELL_VOID;
}
_local4++;
}
_local5++;
}
_mcMatrix.removeMovieClip();
}
_matrixPattern = MATRICES[__numType];
if (attachMovie(SYMBOL_BASE + __numType.toString(), "_mcObject", 1) == undefined) {
Const.TRACE(("ERROR! Couldn't load construction image " + SYMBOL_BASE) + __numType.toString());
return(false);
}
if (Const.TRACE_DEBUG_INFO) {
var _local7 = "Buidling matrix: \n";
var _local5 = 0;
while (_local5 < _matrixPattern.height) {
var _local4 = 0;
while (_local4 < _matrixPattern.width) {
_local7 = _local7 + (_matrixPattern[(_local5 * _matrixPattern.width) + _local4] + " ");
_local4++;
}
_local7 = _local7 + newline;
_local5++;
}
Const.TRACE(_local7);
}
return(true);
}
function copyFrom(__buildingSource) {
var _local2 = {x:0, y:0};
__buildingSource.localToGlobal(_local2);
_parent.globalToLocal(_local2);
_x = _local2.x;
_y = _local2.y;
if (!initBuilding(__buildingSource.__get__numType())) {
return(false);
}
_numCellI = __buildingSource._numCellI;
_numCellJ = __buildingSource._numCellJ;
_numState = __buildingSource.numState;
return(true);
}
function onInstalledRollOver() {
if (!_boolMouseOver) {
_boolMouseOver = true;
dispatchMessage(CEventMovieClip.MSG_MOUSEOVER);
}
updateAfterEvent();
}
function onInstalledRollOut() {
if (_boolMouseOver) {
_boolMouseOver = false;
dispatchMessage(CEventMovieClip.MSG_MOUSEOUT);
}
updateAfterEvent();
}
function process() {
if (_boolTower) {
if (_numReloadTimer > 0) {
_numReloadTimer--;
}
if (_enemyTarget == undefined) {
dispatchMessage(CEventMovieClip.MSG_TARGETLOST);
}
if (_enemyTarget != undefined) {
var _local3 = {x:_mcObject.mcGun._x, y:_mcObject.mcGun._y};
_mcObject.localToGlobal(_local3);
_enemyTarget._parent.globalToLocal(_local3);
var _local6 = _enemyTarget.getDistanceFrom(_local3.x, _local3.y);
if ((_local6 > numRange) || (_local6 == undefined)) {
_enemyTarget = undefined;
} else {
var _local4 = new CVector(_enemyTarget._x - _local3.x, _enemyTarget._y - _local3.y);
if (_vectDirection.getAngleWith(_local4) <= ENEMY_TURN_TOLERANCE) {
if (_numReloadTimer == 0) {
var _local2 = {x:_local3.x, y:_local3.y, direction:_vectDirection, altitude:_enemyTarget.numAltitude};
var _local5 = {x:_enemyTarget._x, y:_enemyTarget._y};
_local5.x = _local5.x - objBasePoint.x;
_local5.y = _local5.y - objBasePoint.y;
_enemyTarget._parent.localToGlobal(_local5);
switch (_numType) {
case TYPE_TOWER_1_1 :
_local2.type = CBlast.TYPE_ROCKET;
_local2.targetsEnemy = true;
_local2.target = _enemyTarget;
_local2.speed = 3;
CSoundService.playSound(Const.SND_MISSILETURRETSHOT);
break;
case TYPE_TOWER_1_2 :
_local2.type = CBlast.TYPE_BALL;
_local2.targetsEnemy = false;
_local2.targetX = _local5.x;
_local2.targetY = _local5.y;
_local2.speed = 3;
CSoundService.playSound(Const.SND_MORTARSHOT);
break;
case TYPE_TOWER_1_3 :
_local2.type = CBlast.TYPE_ELECTRICFIELD;
_local2.targetsEnemy = false;
_local2.targetX = _local3.x;
_local2.targetY = _local3.y;
_local2.speed = 0;
CSoundService.playSound(Const.SND_TESLATOWERSHOT);
break;
case TYPE_TOWER_1_4 :
_local2.type = CBlast.TYPE_LASERBEAM;
_local2.targetsEnemy = true;
_local2.target = _enemyTarget;
_local2.speed = _local4.numLength;
CSoundService.playSound(Const.SND_GUTLINGLASERSHOT);
break;
case TYPE_TOWER_1_5 :
_local2.type = CBlast.TYPE_NULIFYBALL;
_local2.targetsEnemy = true;
_local2.target = _enemyTarget;
_local2.speed = 4;
CSoundService.playSound(Const.SND_NULIFICATORSHOT);
break;
case TYPE_TOWER_2_1 :
_local2.type = CBlast.TYPE_AASHELL;
_local2.targetsEnemy = true;
_local2.target = _enemyTarget;
_local2.speed = _local4.numLength;
CSoundService.playSound(Const.SND_AAGUNSHOT);
break;
case TYPE_TOWER_2_2 :
_local2.type = CBlast.TYPE_SLOWSHOT;
_local2.targetsEnemy = true;
_local2.target = _enemyTarget;
_local2.speed = 4;
CSoundService.playSound(Const.SND_GOOCANNONSHOT);
break;
case TYPE_TOWER_2_3 :
_local2.type = CBlast.TYPE_CHAINBLAST;
_local2.targetsEnemy = true;
_local2.target = _enemyTarget;
_local2.speed = 7;
CSoundService.playSound(Const.SND_CHAINGUNSHOT);
break;
case TYPE_TOWER_2_4 :
_local2.type = CBlast.TYPE_GAUSSRAIL;
_local2.targetsEnemy = true;
_local2.target = _enemyTarget;
_local2.speed = _local4.numLength;
CSoundService.playSound(Const.SND_GAUSSCANNONSHOT);
break;
case TYPE_TOWER_2_5 :
_local2.type = CBlast.TYPE_CONFUSEBALL;
_local2.targetsEnemy = true;
_local2.target = _enemyTarget;
_local2.speed = 5;
CSoundService.playSound(Const.SND_OILSPRAYSHOT);
}
dispatchMessage(CEventMovieClip.MSG_READYTOSHOOT, _local2);
_numReloadTimer = _numReloadTime;
}
} else if (_numTurnSpeed == 0) {
_vectDirection.__set__numX(_local4.numX);
_vectDirection.__set__numY(_local4.numY);
_vectDirection.__set__numLength(1);
} else {
var _local7 = (_local4.__get__numX() * _vectDirection.__get__numY()) - (_vectDirection.__get__numX() * _local4.__get__numY());
if (_local7 > 0) {
_vectDirection.rotate(_numTurnSpeed);
} else {
_vectDirection.rotate(-_numTurnSpeed);
}
}
_mcObject.mcGun._rotation = _vectDirection.numRotation;
}
}
}
}
static var TYPE_TOWER_1_1 = 1;
static var TYPE_TOWER_1_2 = 2;
static var TYPE_TOWER_1_3 = 3;
static var TYPE_TOWER_1_4 = 4;
static var TYPE_TOWER_1_5 = 5;
static var TYPE_TOWER_2_1 = 6;
static var TYPE_TOWER_2_2 = 7;
static var TYPE_TOWER_2_3 = 8;
static var TYPE_TOWER_2_4 = 9;
static var TYPE_TOWER_2_5 = 10;
static var TYPE_BULIDING_1 = 11;
static var TYPE_BULIDING_2 = 12;
static var TYPE_BULIDING_3 = 13;
static var TYPE_BULIDING_4 = 14;
static var TYPE_BULIDING_5 = 15;
static var PRICES = new Array(100, 200, 500, 800, 1000, 150, 200, 500, 800, 1000, 500, 800, 900, 1200, 1250);
static var MATRICES = new Array(15);
static var SYMBOL_BASE = "id_construction";
static var CELL_VOID = 0;
static var CELL_OCCUPIED = 1;
static var STATE_UNDEFINED = 0;
static var STATE_PLACING = 1;
static var STATE_INSTALLED = 2;
static var ENEMY_TURN_TOLERANCE = 0.1;
static var RANGE_BONUS = 0;
static var _BONUS = 0;
}
Symbol 752 MovieClip [__Packages.CBlast] Frame 0
class CBlast extends CEventMovieClip
{
var _numLiveTimer, _numType, _numTurnSpeed, _numDamage, _numSplashRadius, _strEffectSymbol, lineStyle, moveTo, lineTo, _vectSpeed, _numTTL, _numSpeed, attachMovie, _boolTargetsEnemy, _mcTarget, _numTargetX, _numTargetY, removeMovieClip, _x, _y, dispatchMessage, _numAltitude, _parent, _rotation;
function CBlast () {
super();
_numLiveTimer = TTL;
}
function get numType() {
return(_numType);
}
function set numType(__numValue) {
if (_numType != __numValue) {
_numType = __numValue;
switch (_numType) {
case TYPE_ROCKET :
_numTurnSpeed = 0.2;
_numDamage = 5 * (1 + DAMAGE_BONUS);
_numSplashRadius = 0;
break;
case TYPE_BALL :
_numTurnSpeed = 0.05;
_numDamage = 20 * (1 + DAMAGE_BONUS);
_numSplashRadius = 25;
_strEffectSymbol = "id_gfx_splash";
break;
case TYPE_SLOWSHOT :
_numTurnSpeed = 0.1;
_numDamage = 1 * (1 + DAMAGE_BONUS);
_numSplashRadius = 15;
_strEffectSymbol = "id_gfx_slowsplash";
break;
case TYPE_ELECTRICFIELD :
_numTurnSpeed = 0;
_numDamage = 10 * (1 + DAMAGE_BONUS);
_numSplashRadius = 60 * (1 + CBuilding.RANGE_BONUS);
_strEffectSymbol = "id_gfx_electricfield";
break;
case TYPE_NULIFYBALL :
_numTurnSpeed = 0.1;
_numSplashRadius = 0;
break;
case TYPE_LASERBEAM :
_numTurnSpeed = 0;
_numDamage = 2 * (1 + DAMAGE_BONUS);
_numSplashRadius = 0;
lineStyle(0, 16732240);
moveTo(0, 0);
lineTo(0, _vectSpeed.__get__numLength());
lineStyle(0, 16711680, 50);
moveTo(1, 0);
lineTo(1, _vectSpeed.__get__numLength());
moveTo(-1, 0);
lineTo(-1, _vectSpeed.__get__numLength());
break;
case TYPE_AASHELL :
_numTurnSpeed = 0;
_numDamage = 1 * (1 + DAMAGE_BONUS);
_numSplashRadius = 0;
_strEffectSymbol = "id_gfx_aablast";
break;
case TYPE_MISSILE :
_numTurnSpeed = 0.1;
_numDamage = 25 * (1 + DAMAGE_BONUS);
_numSplashRadius = 100;
_strEffectSymbol = "id_gfx_missileblast";
break;
case TYPE_CHAINBLAST :
_numTurnSpeed = Math.PI;
_numDamage = 8 * (1 + DAMAGE_BONUS);
_numSplashRadius = 0;
_numTTL = 1;
break;
case TYPE_GAUSSRAIL :
_numTurnSpeed = 0;
_numDamage = 8 * (1 + DAMAGE_BONUS);
_numSplashRadius = 0;
lineStyle(0, 0, 70);
moveTo(0, 0);
lineTo(0, _vectSpeed.__get__numLength());
lineStyle(0, 0, 40);
moveTo(1, 0);
lineTo(1, _vectSpeed.__get__numLength());
moveTo(-1, 0);
lineTo(-1, _vectSpeed.__get__numLength());
break;
case TYPE_CONFUSEBALL :
_numTurnSpeed = 0.5;
_numDamage = 3 * (1 + DAMAGE_BONUS);
_numSplashRadius = 0;
}
}
//return(numType);
}
function get vectSpeed() {
return(_vectSpeed);
}
function set vectSpeed(__vectPattern) {
_vectSpeed = __vectPattern.makeCopy();
_vectSpeed.__set__numLength(_numSpeed);
//return(vectSpeed);
}
function get numSpeed() {
return(_numSpeed);
}
function set numSpeed(__numValue) {
_numSpeed = __numValue;
_vectSpeed.__set__numLength(_numSpeed);
//return(numSpeed);
}
function initBlast(__numType) {
attachMovie(SYMBOL_BASE + __numType.toString(), "_mcObject", 1);
numType = (__numType);
}
function setTarget(__boolTargetsEnemy, __objTarget) {
_boolTargetsEnemy = __boolTargetsEnemy;
if (_boolTargetsEnemy) {
_mcTarget = MovieClip(__objTarget);
} else {
_numTargetX = __objTarget.x;
_numTargetY = __objTarget.y;
}
}
function process() {
if (_boolTargetsEnemy && (!_mcTarget.boolExists)) {
_numLiveTimer--;
if (_numLiveTimer == 0) {
removeMovieClip();
}
} else {
var _local2 = new Object();
if (_boolTargetsEnemy) {
_local2.x = _mcTarget._x;
_local2.y = _mcTarget._y;
_mcTarget._parent.localToGlobal(objTargetGlobal);
} else {
_local2.x = _numTargetX;
_local2.y = _numTargetY;
}
var objTargetGlobal = {x:_local2.x, y:_local2.y};
var _local3 = new CVector(_local2.x - _x, _local2.y - _y);
if (_local3.__get__numLength() <= TARGET_HIT_TOLERANCE) {
switch (_numType) {
case TYPE_ROCKET :
case TYPE_AASHELL :
_mcTarget.applyEffect(new CEffect(CEffect.TYPE_DAMAGE, {damage:_numDamage}));
break;
case TYPE_CHAINBLAST :
_mcTarget.applyEffect(new CEffect(CEffect.TYPE_DAMAGE, {damage:_numDamage / _numTTL}));
break;
case TYPE_MISSILE :
dispatchMessage(CEventMovieClip.MSG_SPLASHEFFECT, {effect:new CEffect(CEffect.TYPE_PIERCEDAMAGE, {damage:_numDamage}), centerX:objTargetGlobal.x, centerY:objTargetGlobal.y, radius:_numSplashRadius, altitude:_numAltitude});
case TYPE_BALL :
case TYPE_ELECTRICFIELD :
dispatchMessage(CEventMovieClip.MSG_SPLASHEFFECT, {effect:new CEffect(CEffect.TYPE_DAMAGE, {damage:_numDamage}), centerX:objTargetGlobal.x, centerY:objTargetGlobal.y, radius:_numSplashRadius, altitude:_numAltitude});
break;
case TYPE_SLOWSHOT :
_mcTarget.applyEffect(new CEffect(CEffect.TYPE_DAMAGE, {damage:_numDamage}));
dispatchMessage(CEventMovieClip.MSG_SPLASHEFFECT, {effect:new CEffect(CEffect.TYPE_SLOW, {percent:0.25}, 36), centerX:objTargetGlobal.x, centerY:objTargetGlobal.y, radius:_numSplashRadius, altitude:_numAltitude});
break;
case TYPE_NULIFYBALL :
_mcTarget.applyEffect(new CEffect(CEffect.TYPE_CLEAR));
break;
case TYPE_LASERBEAM :
case TYPE_GAUSSRAIL :
_mcTarget.applyEffect(new CEffect(CEffect.TYPE_PIERCEDAMAGE, {damage:_numDamage}));
break;
case TYPE_CONFUSEBALL :
_mcTarget.applyEffect(new CEffect(CEffect.TYPE_DAMAGE, {damage:_numDamage}));
_mcTarget.applyEffect(new CEffect(CEffect.TYPE_CONFUSE, {percent:0.7}, 60));
}
if (_strEffectSymbol) {
var _local4 = {symbol:_strEffectSymbol, x:_x, y:_y, altitude:_numAltitude};
if (_numType == TYPE_ELECTRICFIELD) {
_local4.altitude = CMap.ALTITUDE_AIR;
_local4.radius = _numSplashRadius;
}
_parent.localToGlobal(_local4);
dispatchMessage(CEventMovieClip.MSG_CREATEGFX, _local4);
}
if ((_numType == TYPE_CHAINBLAST) && (_numTTL < 3)) {
_numTTL++;
var _local7 = _mcTarget;
_mcTarget = undefined;
dispatchMessage(CEventMovieClip.MSG_TARGETLOST, {range:50, alt:CMap.ALTITUDE_GROUND, forbidden:_local7});
if (!_mcTarget.boolExists) {
removeMovieClip();
}
} else {
removeMovieClip();
}
}
var _local5 = _vectSpeed.getAngleWith(_local3);
if (_local5 > TARGET_TURN_TOLERANCE) {
var _local8 = (_local3.__get__numX() * _vectSpeed.__get__numY()) - (_vectSpeed.__get__numX() * _local3.__get__numY());
var _local6 = ((_numTurnSpeed > _local5) ? (_local5) : (_numTurnSpeed));
if (_local8 > 0) {
_vectSpeed.rotate(_local6);
} else {
_vectSpeed.rotate(-_local6);
}
}
}
_x = _x + _vectSpeed.numX;
_y = _y + _vectSpeed.numY;
_rotation = _vectSpeed.numRotation;
}
static var TYPE_ROCKET = 1;
static var TYPE_BALL = 2;
static var TYPE_SLOWSHOT = 3;
static var TYPE_ELECTRICFIELD = 4;
static var TYPE_NULIFYBALL = 5;
static var TYPE_LASERBEAM = 6;
static var TYPE_AASHELL = 7;
static var TYPE_MISSILE = 8;
static var TYPE_CHAINBLAST = 9;
static var TYPE_GAUSSRAIL = 10;
static var TYPE_CONFUSEBALL = 11;
static var SYMBOL_BASE = "id_blast";
static var TARGET_HIT_TOLERANCE = 10;
static var TARGET_TURN_TOLERANCE = 0.1;
static var TTL = 100;
static var DAMAGE_BONUS = 0;
}
Symbol 753 MovieClip [__Packages.CCursor] Frame 0
class CCursor extends CEventMovieClip
{
var _numState, mcCursor, _numAbilityAttached, _mapReference, attachMovie, _boolJustAttached, filters, _objCell, _parent, _visible, _x, _y, dispatchMessage, _alpha;
function CCursor () {
super();
}
function get numState() {
return(_numState);
}
function set numState(__newValue) {
if (_numState != __newValue) {
_numState = __newValue;
}
//return(numState);
}
function get buildingCursor() {
return(CBuilding(mcCursor));
}
function get numAbility() {
return(_numAbilityAttached);
}
function initCursor(__mapReference) {
_mapReference = __mapReference;
}
function attachBuilding(__numType) {
clear();
attachMovie("id_building", "mcCursor", CURSOR_DEPTH);
if (mcCursor.initBuilding(__numType) == false) {
return(false);
}
mcCursor.numState = CBuilding.STATE_PLACING;
numState = (STATE_BUILDING);
_boolJustAttached = true;
return(true);
}
function attachAbility(__numType) {
_numAbilityAttached = __numType;
attachMovie(CAbility.getCursorSymbol(__numType), "mcCursor", CURSOR_DEPTH);
numState = (STATE_ABILITY);
_boolJustAttached = true;
}
function clear() {
if (!_boolJustAttached) {
mcCursor.removeMovieClip();
numState = (STATE_CLEAR);
filters = new Array();
}
}
function refresh() {
if (numState != STATE_CLEAR) {
var _local3 = getGlobalMousePos();
_objCell = _mapReference.cellHitTest(_local3.x, _local3.y);
_parent.globalToLocal(_objCell);
var _local4 = (mcCursor._numCellI != _objCell.i) || (mcCursor._numCellJ != _objCell.j);
mcCursor._numCellI = _objCell.i;
mcCursor._numCellJ = _objCell.j;
_visible = true;
if (numState == STATE_BUILDING) {
_x = 0;
_y = 0;
mcCursor._x = _objCell.x;
mcCursor._y = _objCell.y;
if (_local4) {
dispatchMessage(CEventMovieClip.MSG_MOUSEOUT, {forceHide:true}, buildingCursor);
if (!_objCell.out) {
dispatchMessage(CEventMovieClip.MSG_MOUSEOVER, {forceShow:true}, buildingCursor);
}
_mapReference.toggleGrid(!_objCell.out);
}
if (_mapReference.checkPlacingSpace(_objCell.i, _objCell.j, mcCursor._matrixPattern)) {
_objCell.free = true;
var _local2 = new Array();
_local2.push(PERMISSION_GLOW);
filters = _local2;
} else {
_objCell.free = false;
var _local2 = new Array();
_local2.push(FORBIDDEN_GLOW);
filters = _local2;
}
} else if ((numState == STATE_ABILITY) && (numAbility == CAbility.TYPE_WALL)) {
_x = 0;
_y = 0;
mcCursor._x = _objCell.x;
mcCursor._y = _objCell.y;
if (_mapReference.checkWallSpace(_objCell.i, _objCell.j)) {
_objCell.free = true;
var _local2 = new Array();
_local2.push(PERMISSION_GLOW);
filters = _local2;
} else {
_objCell.free = false;
var _local2 = new Array();
_local2.push(FORBIDDEN_GLOW);
filters = _local2;
}
_mapReference.toggleGrid(!_objCell.out);
} else {
_x = _parent._xmouse;
_y = _parent._ymouse;
switch (numAbility) {
case CAbility.TYPE_SELL :
if (_mapReference.checkBuildingSpace(_objCell.i, _objCell.j)) {
_objCell.free = true;
filters = new Array();
} else {
_objCell.free = false;
var _local2 = new Array();
_local2.push(FORBIDDEN_GLOW);
filters = _local2;
}
_mapReference.toggleGrid(!_objCell.out);
break;
case CAbility.TYPE_MISSILE :
case CAbility.TYPE_TIMEBOMB :
_objCell.free = true;
_alpha = 100;
}
}
}
}
function getGlobalMousePos() {
var _local3 = {x:_root._xmouse, y:_root._ymouse};
_parent.localToGlobal(_local3);
return(_local3);
}
function onMouseMove() {
refresh();
updateAfterEvent();
}
function onMouseDown() {
if ((numState == STATE_BUILDING) || (numState == STATE_ABILITY)) {
refresh();
dispatchMessage(CEventMovieClip.MSG_MOUSECLICK, _objCell);
}
updateAfterEvent();
}
function onEnterFrame() {
_boolJustAttached = false;
}
static var CURSOR_DEPTH = 1;
static var STATE_CLEAR = 0;
static var STATE_BUILDING = 1;
static var STATE_ABILITY = 2;
static var FORBIDDEN_GLOW = new flash.filters.GlowFilter(16711680, 30, 7, 7);
static var PERMISSION_GLOW = new flash.filters.GlowFilter(65280, 30, 7, 7);
}
Symbol 754 MovieClip [__Packages.CAbility] Frame 0
class CAbility
{
var numType, _numCooldown, tgbtnLink, _numSources, _boolAvaliable, _numTimer;
function CAbility (__numType, __tgbtnLink, __numSources) {
numType = __numType;
switch (numType) {
case TYPE_SELL :
case TYPE_MONEYBONUS :
case TYPE_TOWERBONUS :
_numCooldown = 0;
break;
case TYPE_MISSILE :
_numCooldown = 5400;
break;
case TYPE_WALL :
_numCooldown = 5400;
break;
case TYPE_TIMEBOMB :
_numCooldown = 5400;
}
tgbtnLink = __tgbtnLink;
tgbtnLink.mcClock.gotoAndStop(7201);
numSources = (__numSources);
}
static function getCursorSymbol(__numType) {
switch (__numType) {
case TYPE_SELL :
return("id_cursor_sell");
case TYPE_MISSILE :
return("id_cursor_missile");
case TYPE_WALL :
return("id_cursor_wall");
case TYPE_TIMEBOMB :
return("id_cursor_timebomb");
}
return(undefined);
}
function get numSources() {
return(_numSources);
}
function set numSources(__numValue) {
_numSources = __numValue;
if (_numSources < 0) {
_numSources = 0;
}
boolAvaliable = (_numSources > 0);
//return(numSources);
}
function get boolAvaliable() {
return(_boolAvaliable);
}
function set boolAvaliable(__boolValue) {
if ((!_boolAvaliable) && (__boolValue)) {
numTimer = (0);
}
_boolAvaliable = __boolValue;
tgbtnLink.__set__boolEnabled(_boolAvaliable);
tgbtnLink._visible = _boolAvaliable;
//return(boolAvaliable);
}
function get numTimer() {
return(_numTimer);
}
function set numTimer(__numValue) {
_numTimer = __numValue;
if (_numTimer < 0) {
_numTimer = 0;
}
updateClock();
//return(numTimer);
}
function tick() {
if (_boolAvaliable) {
if (numTimer == 0) {
if (!tgbtnLink.__get__boolEnabled()) {
tgbtnLink.__set__boolEnabled(true);
}
} else {
numTimer = numTimer - numSources;
}
}
}
function updateClock() {
tgbtnLink.mcClock.gotoAndStop(7201 - Math.floor((7200 * _numTimer) / _numCooldown));
}
function reset() {
numTimer = (_numCooldown);
if (numTimer > 0) {
tgbtnLink.__set__boolEnabled(false);
return(true);
}
return(false);
}
static var TYPE_SELL = 1;
static var TYPE_MISSILE = 2;
static var TYPE_WALL = 3;
static var TYPE_TIMEBOMB = 4;
static var TYPE_MONEYBONUS = 5;
static var TYPE_TOWERBONUS = 6;
}
Symbol 755 MovieClip [__Packages.CToggleButton] Frame 0
class CToggleButton extends CEventMovieClip
{
var mcHitArea, _boolPressed, _boolEnabled, gotoAndStop, _numToolTipTimer, _strToolTip, onRollOver, onRollOut, attachMovie, _mcToolTip, onEnterFrame, onMouseMove, dispatchMessage, _visible, _xmouse, _ymouse;
function CToggleButton () {
super();
if (mcHitArea == undefined) {
mcHitArea = this;
}
_boolPressed = false;
_boolEnabled = true;
}
function get boolPressed() {
return(_boolPressed);
}
function set boolPressed(__boolValue) {
if (_boolPressed != __boolValue) {
_boolPressed = __boolValue;
if (_boolPressed) {
gotoAndStop("frmPressed");
} else {
gotoAndStop("frmReleased");
}
}
//return(boolPressed);
}
function get boolEnabled() {
return(_boolEnabled);
}
function set boolEnabled(__boolValue) {
if (_boolEnabled != __boolValue) {
_boolEnabled = __boolValue;
if (_boolEnabled == false) {
boolPressed = (false);
} else {
_numToolTipTimer = TOOLTIP_DELAY;
}
}
//return(boolEnabled);
}
function get strToolTip() {
return(_strToolTip);
}
function set strToolTip(__strValue) {
_strToolTip = (" " + __strValue) + " ";
if ((_strToolTip != undefined) && (_strToolTip != "")) {
onRollOver = ttOnRollOver;
onRollOut = ttOnRollOut;
attachMovie("id_mcToolTip", "_mcToolTip", 1);
_mcToolTip.textToolTip.autoSize = true;
_mcToolTip.textToolTip.text = _strToolTip;
_mcToolTip._visible = false;
} else {
onRollOver = undefined;
onRollOut = undefined;
onEnterFrame = undefined;
onMouseMove = undefined;
_mcToolTip.removeMovieClip();
}
//return(strToolTip);
}
function getGlobalMousePos() {
var _local2 = {x:_root._xmouse, y:_root._ymouse};
_root.localToGlobal(_local2);
return(_local2);
}
function onMouseDown() {
if (_boolEnabled) {
var _local2 = getGlobalMousePos();
if (mcHitArea.hitTest(_local2.x, _local2.y)) {
dispatchMessage(CEventMovieClip.MSG_TOGGLEPRESS, {isHit:true});
CSoundService.playSound(Const.SND_SWITCH);
} else {
dispatchMessage(CEventMovieClip.MSG_TOGGLEPRESS, {isHit:false});
}
}
if ((_strToolTip != undefined) && (_strToolTip != "")) {
toggleToolTip(false);
_numToolTipTimer = TOOLTIP_DELAY;
}
updateAfterEvent();
}
function toggleToolTip(__boolShow) {
if (_visible || (!__boolShow)) {
_mcToolTip._visible = __boolShow;
if (__boolShow) {
_mcToolTip._x = _xmouse - _mcToolTip._width;
_mcToolTip._y = _ymouse + 22;
}
}
}
function ttOnRollOver() {
onEnterFrame = ttOnEnterFrame;
onMouseMove = ttOnMouseMove;
_numToolTipTimer = TOOLTIP_DELAY;
updateAfterEvent();
}
function ttOnRollOut() {
toggleToolTip(false);
onEnterFrame = undefined;
onMouseMove = undefined;
updateAfterEvent();
}
function ttOnMouseMove() {
toggleToolTip(false);
_numToolTipTimer = TOOLTIP_DELAY;
updateAfterEvent();
}
function ttOnEnterFrame() {
_numToolTipTimer--;
if (_numToolTipTimer == 0) {
toggleToolTip(true);
}
}
static var TOOLTIP_DELAY = 12;
}
Symbol 756 MovieClip [__Packages.UrlTools] Frame 0
class UrlTools
{
function UrlTools () {
}
static function getGeo(ref) {
var _local5 = ref.indexOf(".swf?");
if (_local5 < 0) {
return("");
}
_local5 = _local5 + 5;
var _local4 = ref.substr(_local5).split("&");
var _local1 = 0;
while (_local1 < _local4.length) {
var _local3 = _local4[_local1];
var _local2 = _local3.split("=");
if (_local2[0] == "mc_geoCode") {
return(_local2[1]);
}
_local1++;
}
return("");
}
static function getDomain(ref) {
var _local1 = ref.indexOf("http://");
if (_local1 < 0) {
return("");
}
_local1 = _local1 + 7;
var _local2 = ref.indexOf("/", _local1);
if (_local2 < 0) {
return("");
}
return(ref.substr(_local1, _local2 - _local1));
}
}
Symbol 757 MovieClip [__Packages.CQuest] Frame 0
class CQuest
{
var _numPoints, boolActive, _numType, _numPointCap, strCompleteMsg;
function CQuest (__numType) {
numType = (__numType);
_numPoints = 0;
boolActive = false;
}
function get numType() {
return(_numType);
}
function set numType(__numValue) {
if (_numType != __numValue) {
_numType = __numValue;
switch (_numType) {
case TYPE_TOWERS1_1 :
_numPointCap = 0;
strCompleteMsg = "MISSILE TURRET";
break;
case TYPE_TOWERS1_2 :
_numPointCap = 1;
strCompleteMsg = "HOWITZER";
break;
case TYPE_TOWERS1_3 :
_numPointCap = 5;
strCompleteMsg = "TESLA TOWER";
break;
case TYPE_TOWERS1_4 :
_numPointCap = 40;
strCompleteMsg = "GUTLING LASER";
break;
case TYPE_TOWERS1_5 :
_numPointCap = 1;
strCompleteMsg = "NULIFICATOR";
break;
case TYPE_TOWERS2_1 :
_numPointCap = 0;
strCompleteMsg = "AA GUN";
break;
case TYPE_TOWERS2_2 :
_numPointCap = 5;
strCompleteMsg = "GOO CANNON";
break;
case TYPE_TOWERS2_3 :
_numPointCap = 1000;
strCompleteMsg = "CHAIN GUN";
break;
case TYPE_TOWERS2_4 :
_numPointCap = 1;
strCompleteMsg = "GAUSS CANNON";
break;
case TYPE_TOWERS2_5 :
_numPointCap = 10;
strCompleteMsg = "OIL SPRAY";
break;
case TYPE_STRUCTURES_1 :
_numPointCap = 5;
strCompleteMsg = "NUCLEAR SILO";
break;
case TYPE_STRUCTURES_2 :
_numPointCap = 15;
strCompleteMsg = "WALL FACTORY";
break;
case TYPE_STRUCTURES_3 :
_numPointCap = 3;
strCompleteMsg = "RECYCLER";
break;
case TYPE_STRUCTURES_4 :
_numPointCap = 7;
strCompleteMsg = "RADAR DOME";
break;
case TYPE_STRUCTURES_5 :
strCompleteMsg = "LABORATORY";
_numPointCap = 2;
}
}
//return(numType);
}
function get numPoints() {
return(_numPoints);
}
function set numPoints(__numValue) {
_numPoints = __numValue;
if (_numPoints < 0) {
_numPoints = 0;
}
//return(numPoints);
}
function get numPointCap() {
return(_numPointCap);
}
function get boolComplete() {
return(_numPoints >= _numPointCap);
}
static var TYPE_TOWERS1_1 = 1;
static var TYPE_TOWERS1_2 = 2;
static var TYPE_TOWERS1_3 = 3;
static var TYPE_TOWERS1_4 = 4;
static var TYPE_TOWERS1_5 = 5;
static var TYPE_TOWERS2_1 = 6;
static var TYPE_TOWERS2_2 = 7;
static var TYPE_TOWERS2_3 = 8;
static var TYPE_TOWERS2_4 = 9;
static var TYPE_TOWERS2_5 = 10;
static var TYPE_STRUCTURES_1 = 11;
static var TYPE_STRUCTURES_2 = 12;
static var TYPE_STRUCTURES_3 = 13;
static var TYPE_STRUCTURES_4 = 14;
static var TYPE_STRUCTURES_5 = 15;
}
Symbol 758 MovieClip [__Packages.MiniclipAwards] Frame 0
class MiniclipAwards
{
var target, aid, onAwardResponse, mcGiveAward, mlAwardLoader;
function MiniclipAwards (t) {
target = t;
}
function give(awardId, onResponse) {
aid = awardId;
onAwardResponse = mx.utils.Delegate.create(target, onResponse);
System.security.allowDomain("www.miniclip.com");
System.security.allowDomain("cms.miniclip.com");
if (mcGiveAward == undefined) {
mcGiveAward = target.createEmptyMovieClip("mcMiniclipGiveAward", target.getNextHighestDepth());
mlAwardLoader = new MovieClipLoader();
var _local4 = new Object();
_local4.onLoadInit = mx.utils.Delegate.create(this, onAwardSwfLoaded);
mlAwardLoader.addListener(_local4);
var _local3 = new Date();
var _local5 = (((_local3.getFullYear() + "-") + _local3.getMonth()) + "-") + _local3.getDay();
if (_root._url.indexOf("file:///") > -1) {
var _local6 = ("http://cms.miniclip.com/players/swf/components/giveuseraward_as2.swf?deCache=" + _local5) + random(1000000);
} else {
var _local6 = "/players/swf/components/giveuseraward_as2.swf?deCache=" + _local5;
}
mlAwardLoader.loadClip(_local6, mcGiveAward);
} else {
onAwardSwfLoaded(mcGiveAward);
}
}
function loadAwardGfx(awardId, mcTarget) {
if (mcTarget == undefined) {
mcTarget = target;
}
var _local4 = mcTarget.createEmptyMovieClip("mcAward_" + awardId, mcTarget.getNextHighestDepth());
var _local6 = new MovieClipLoader();
var _local7 = new Object();
_local7.onLoadInit = mx.utils.Delegate.create(this, onAwardGfxLoaded);
_local6.addListener(_local7);
var _local3 = new Date();
var _local8 = (((_local3.getFullYear() + "-") + _local3.getMonth()) + "-") + _local3.getDay();
if (_root._url.indexOf("file:///") > -1) {
var _local9 = ("http://cms.miniclip.com/players/swf/components/awards.swf?deCache=" + _local8) + random(1000000);
} else {
var _local9 = "/players/swf/components/awards.swf?deCache=" + _local8;
}
_local6.loadClip(_local9, _local4);
_local4._alpha = 0;
return(_local4);
}
function onAwardSwfLoaded(mc) {
mc.aid = aid;
mc.onAwardGiven = mx.utils.Delegate.create(this, onAwardGivenPrivate);
mc.onAwardNotGiven = mx.utils.Delegate.create(this, onAwardNotGivenPrivate);
}
function onAwardGfxLoaded(mcAward) {
var _local2 = int(mcAward._name.split("_")[1]);
mcAward.gotoAndStop(_local2);
mcAward._alpha = 100;
}
function onAwardGivenPrivate() {
onAwardResponse(true);
mlAwardLoader.unloadClip(mcGiveAward);
}
function onAwardNotGivenPrivate() {
onAwardResponse(false);
mlAwardLoader.unloadClip(mcGiveAward);
}
}
Symbol 43 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 759 MovieClip [__Packages.CMissionUIPanel] Frame 0
class CMissionUIPanel extends CEventMovieClip
{
var onEnterFrame, _boolEnabled, _btnStartAttack, _mcBtnAbility1, _mcBtnAbility2, _mcBtnAbility3, _mcBtnAbility4, _visible, textMessage, _numCurrentTab, dispatchMessage, _mcPauseSwitch, _btnQuit, textTimer, textScreen, _mcErrorBlink, numMessageTimer, _mcSoundSwitch, _mcTabButton1, _mcTabButton2, _mcTabButton3;
function CMissionUIPanel () {
super();
Key.addListener(this);
onEnterFrame = oefInit;
}
function get boolEnabled() {
return(_boolEnabled);
}
function set boolEnabled(__boolValue) {
_boolEnabled = __boolValue;
_btnStartAttack._visible = _boolEnabled;
//return(boolEnabled);
}
function oefInit() {
var _local3 = 1;
while (_local3 <= 3) {
var _local2 = 1;
while (_local2 <= 5) {
if (Const.DISABLE_QUESTS) {
changeBBState(_local3, _local2, BB_STATE_SHOW);
} else {
changeBBState(_local3, _local2, BB_STATE_HIDE);
}
_local2++;
}
_local3++;
}
_mcBtnAbility1.__set__strToolTip("SELL");
_mcBtnAbility2.__set__strToolTip("LAUNCH MISSILE");
_mcBtnAbility3.__set__strToolTip("CONSTRUCT WALL");
_mcBtnAbility4.__set__strToolTip("STOP TIME");
onTabChange(1);
_visible = true;
textMessage._visible = false;
boolEnabled = (true);
onEnterFrame = undefined;
}
function changeBBState(__numTabPage, __numButton, __numState) {
var _local2 = CToggleButton(this[TABPAGE_NAME_BASE + __numTabPage]["_mcBtnBuilding" + __numButton]);
switch (__numState) {
case BB_STATE_HIDE :
_local2._visible = false;
_local2.__set__boolEnabled(false);
this[TABPAGE_NAME_BASE + __numTabPage]["_mcDescription" + __numButton].gotoAndStop(3);
break;
case BB_STATE_QUEST :
_local2._visible = false;
_local2.__set__boolEnabled(false);
this[TABPAGE_NAME_BASE + __numTabPage]["_mcDescription" + __numButton].gotoAndStop(2);
break;
case BB_STATE_SHOW :
if (_numCurrentTab == __numTabPage) {
_local2._visible = true;
_local2.__set__boolEnabled(true);
}
this[TABPAGE_NAME_BASE + __numTabPage]["_mcDescription" + __numButton].gotoAndStop(1);
this[TABPAGE_NAME_BASE + __numTabPage]["_mcDescription" + __numButton].textInfo.text = "PRICE: " + String(CBuilding.PRICES[((__numTabPage - 1) * 5) + (__numButton - 1)]);
}
}
function updateQuest(__numTabPage, __numButton, __quest) {
this[TABPAGE_NAME_BASE + __numTabPage]["_mcDescription" + __numButton].textInfo.text = (__quest.__get__numPoints().toString() + " / ") + __quest.__get__numPointCap().toString();
}
function onTabChange(__numTabIndex) {
_numCurrentTab = __numTabIndex;
var _local5;
var _local3 = 1;
while (_local3 <= TABS_NUMBER) {
_local5 = CToggleButton(this[TABBUTTON_NAME_BASE + _local3]);
var _local4 = false;
if (_local3 == _numCurrentTab) {
_local4 = true;
}
_local5.__set__boolPressed(_local4);
this[TABPAGE_NAME_BASE + _local3]._visible = _local4;
var _local2 = 1;
while (_local2 <= 5) {
if (this[TABPAGE_NAME_BASE + _local3]["_mcDescription" + _local2]._currentframe == 1) {
this[TABPAGE_NAME_BASE + _local3]["_mcBtnBuilding" + _local2].boolEnabled = _local4;
this[TABPAGE_NAME_BASE + _local3]["_mcBtnBuilding" + _local2]._visible = _local4;
}
_local2++;
}
_local3++;
}
}
function updatePriceColor(__numFunds) {
var _local3 = 1;
while (_local3 <= 3) {
var _local2 = 1;
while (_local2 <= 5) {
if (this[TABPAGE_NAME_BASE + _local3]["_mcDescription" + _local2]._currentframe == 1) {
if (__numFunds >= CBuilding.PRICES[((_local3 - 1) * 5) + (_local2 - 1)]) {
this[TABPAGE_NAME_BASE + _local3]["_mcDescription" + _local2].textInfo.textColor = 0;
} else {
this[TABPAGE_NAME_BASE + _local3]["_mcDescription" + _local2].textInfo.textColor = 16711680 /* 0xFF0000 */;
}
}
_local2++;
}
_local3++;
}
}
function onHurryRelease() {
dispatchMessage(CEventMovieClip.MSG_HURRYATTACK);
CSoundService.playSound(Const.SND_SWITCH);
}
function onQuitRelease() {
dispatchMessage(CEventMovieClip.MSG_QUITGAME);
CSoundService.playSound(Const.SND_SWITCH);
}
function onPauseRelease(__boolPause) {
dispatchMessage(CEventMovieClip.MSG_PAUSEGAME, {pause:__boolPause});
CSoundService.playSound(Const.SND_SWITCH);
}
function switchServiceButtonsVisibility(__boolVisible) {
_mcPauseSwitch._visible = __boolVisible;
_btnQuit._visible = __boolVisible;
}
function showMessage(__strMessage, __boolError) {
if (__boolError == undefined) {
__boolError = false;
}
textTimer._visible = false;
textScreen._visible = false;
textMessage.text = __strMessage;
textMessage._visible = true;
_mcErrorBlink.play();
if (__boolError) {
CSoundService.playSound(Const.SND_ERROR);
} else {
CSoundService.playSound(Const.SND_QUEST);
}
numMessageTimer = MESSAGE_DELAY;
onEnterFrame = oefWaitMessage;
}
function onKeyDown() {
if (Key.isDown(32) && (_btnStartAttack._visible)) {
onHurryRelease();
}
if (Key.isDown(80) && (_mcPauseSwitch._visible)) {
if (_mcPauseSwitch._currentframe == 1) {
onPauseRelease(true);
} else {
onPauseRelease(false);
}
_mcPauseSwitch.play();
}
if (Key.isDown(77) && (_mcSoundSwitch._visible)) {
if (_mcSoundSwitch._currentframe == 1) {
CSoundService.soundOff();
} else {
CSoundService.soundOn();
}
_mcSoundSwitch.play();
}
if (Key.isDown(81) && (_btnQuit._visible)) {
onQuitRelease();
}
}
function oefWaitMessage() {
numMessageTimer--;
if (numMessageTimer == 0) {
textTimer._visible = true;
textScreen._visible = true;
textMessage._visible = false;
onEnterFrame = undefined;
}
}
function processMessage(__numMessage, __objParam, __mcInvoker) {
var _local2 = false;
if (!(__numMessage === CEventMovieClip.MSG_TOGGLEPRESS)) {
} else if (!boolEnabled) {
_local2 = true;
} else {
var _local3 = CToggleButton(__mcInvoker);
if (((_local3 == _mcTabButton1) || (_local3 == _mcTabButton2)) || (_local3 == _mcTabButton3)) {
_local2 = true;
}
if (__objParam.isHit && (!_local3.__get__boolPressed())) {
switch (_local3) {
case _mcTabButton1 :
onTabChange(1);
_mcTabButton2.__set__boolPressed(false);
_mcTabButton3.__set__boolPressed(false);
_local2 = true;
break;
case _mcTabButton2 :
onTabChange(2);
_mcTabButton1.__set__boolPressed(false);
_mcTabButton3.__set__boolPressed(false);
_local2 = true;
break;
case _mcTabButton3 :
onTabChange(3);
_mcTabButton1.__set__boolPressed(false);
_mcTabButton2.__set__boolPressed(false);
_local2 = true;
}
}
}
if (!_local2) {
dispatchMessage(__numMessage, __objParam, __mcInvoker);
}
}
static var TABBUTTON_NAME_BASE = "_mcTabButton";
static var TABPAGE_NAME_BASE = "_mcTabPage";
static var FRAME_NAME_BASE = "_mcFrame";
static var TABS_NUMBER = 3;
static var BB_STATE_HIDE = 1;
static var BB_STATE_QUEST = 2;
static var BB_STATE_SHOW = 3;
static var MESSAGE_DELAY = 48;
}
Symbol 38 MovieClip [__Packages.proto.ComponentBase] Frame 0
class proto.ComponentBase extends MovieClip
{
var _visible, _ready, onEnterFrame, _totalframes, _framesloaded, _rotation, width, _width, height, _height, _xscale, _yscale, _bg, createEmptyMovieClip, _alpha;
function ComponentBase () {
super();
_visible = false;
_ready = false;
onEnterFrame = mx.utils.Delegate.create(this, _onEnterFrame);
}
function _onEnterFrame() {
if (_ready == true) {
delete onEnterFrame;
INITIALISE();
return(undefined);
}
if (_framesloaded >= _totalframes) {
preInit();
_ready = true;
}
}
function preInit(expectedWidth, expectedHeight) {
_rotation = 0;
width = ((expectedWidth > 0) ? (expectedWidth) : (_width));
height = ((expectedHeight > 0) ? (expectedHeight) : (_height));
_xscale = (_yscale = 100);
_bg = createEmptyMovieClip("_bg", _bg.getDepth());
_ready = true;
}
function drawBg() {
}
function show(instant) {
if (instant != true) {
_alpha = 0;
_visible = true;
onEnterFrame = function () {
if (this._alpha < 100) {
this._alpha = this._alpha + 7;
} else {
this._alpha = 100;
this.onShowComplete();
delete this.onEnterFrame;
}
};
} else {
_visible = true;
_alpha = 100;
onShowComplete();
}
}
function onShowComplete() {
}
function INITIALISE() {
}
}
Symbol 39 MovieClip [__Packages.advertising.AdvertContainer] Frame 0
class advertising.AdvertContainer extends proto.ComponentBase
{
var initComplete, domain_excluded, loadingQueue, preInit, _expectedWidth, width, _expectedHeight, height, _gameID, _geo_tag, _domain, advert_data, _ready, defaultURL, imageContainer, createEmptyMovieClip, getNextHighestDepth, imageUrl, clickData, drawBg, show, getURL, defaultTargetUrl, dataMap, allClickData, slotData, _url;
function AdvertContainer () {
super();
initComplete = false;
domain_excluded = false;
loadingQueue = new util.LoadingQueue();
}
function init(gameId, advert_id, geo_tag, domain, expectedWidth, expectedHeight) {
if ((advert_id >= 0) && (advert_id < 5)) {
_id = "g" + String(advert_id);
} else {
_id = "g0";
}
setUP(gameId, geo_tag, domain, expectedWidth, expectedHeight);
preInit(expectedWidth, expectedHeight);
}
function setUP(gameId, geo_tag, domain, expectedWidth, expectedHeight) {
_expectedWidth = ((expectedWidth > 0) ? (expectedWidth) : (width));
_expectedHeight = ((expectedHeight > 0) ? (expectedHeight) : (height));
_gameID = gameId;
_geo_tag = geo_tag;
_domain = domain;
if (!advert_data) {
advert_data = {game_id:gameId, geo:geo_tag, domain:domain};
}
if (((_gameID != "") && (_ready == true)) && (initComplete == false)) {
loadData();
}
}
function loadData() {
setPath();
if (!initComplete) {
initComplete = true;
util.XMLParser.load((((defaultURL + "am_cfg") + _gameID) + ".xml") + cacheKill(), util.cCallBack.delegate(this, onDataLoaded), null, false, true);
}
}
function onDataLoaded(success, parsedObject, xml) {
if (success) {
addMapping(parsedObject.mapping[0].item);
setClickData(parsedObject.advert_data[0].item);
setAdvertData(parsedObject.slots[0].item);
getClickData();
} else {
notifyDirector(false);
}
}
function loadImage() {
imageContainer = createEmptyMovieClip("_cont", getNextHighestDepth());
imageUrl = clickData.file[0].nodeValue;
if (imageUrl) {
if (imageUrl.indexOf("http://") != 0) {
imageUrl = defaultURL + imageUrl;
}
loadingQueue.addToLoadingList(this, imageContainer, imageUrl, onImageLoaded, onImageLoadingError);
drawBg();
} else {
notifyDirector(false);
}
}
function onImageLoaded() {
_expectedWidth = ((_expectedWidth > 0) ? (_expectedWidth) : (width));
_expectedHeight = ((_expectedHeight > 0) ? (_expectedHeight) : (height));
var _local3 = _expectedWidth / imageContainer._width;
var _local2 = _expectedHeight / imageContainer._height;
imageContainer._xscale = (imageContainer._yscale = 100 * ((_local3 < _local2) ? (_local3) : (_local2)));
imageContainer._x = (_expectedWidth - imageContainer._width) / 2;
imageContainer._y = (_expectedHeight - imageContainer._height) / 2;
setActions();
if (System.capabilities.playerType == "DirectorXtra") {
if (((clickData.action == "release") || (clickData.action == "click")) || (clickData.action == "click")) {
imageContainer.onRollOver = util.cCallBack.delegate(this, _onRollOver, []);
imageContainer.onRollOut = util.cCallBack.delegate(this, _onRollOut, []);
}
show(true);
} else {
show(false);
}
triggerTracking(clickData.view_track);
}
function setActions() {
if ((clickData.action == "release") || (clickData.action == "click")) {
imageContainer.onRelease = util.cCallBack.delegate(this, _onAction, []);
} else if (clickData.action == "press") {
imageContainer.onPress = util.cCallBack.delegate(this, _onAction, []);
}
}
function onImageLoadingError() {
notifyDirector(false);
}
function _onRollOver() {
getURL("lingo: cursor 280");
}
function _onRollOut() {
getURL("lingo: cursor -1");
}
function _onAction() {
if (defaultTargetUrl) {
var _local3 = ("javascript:open_link(\"" + defaultTargetUrl) + "\");";
var _local2 = clickData.window;
var _local4 = (("lingo:goToNetPage(\"" + _local3) + "\",") + "\"_blank\")";
if (System.capabilities.playerType == "DirectorXtra") {
getURL(_local4);
} else {
getURL(defaultTargetUrl, _local2);
}
triggerTracking(clickData.click_track);
}
}
function triggerTracking(toLoad) {
var _local2 = 0;
while (_local2 < toLoad.length) {
var _local3 = createEmptyMovieClip("dummny" + _local2, -1000 + _local2);
_local3._alpha = 0;
loadingQueue.addToLoadingList(this, _local3, toLoad[_local2].nodeValue, onTrackingAssetLoaded);
_local2++;
}
}
function onTrackingAssetLoaded(target, path) {
}
function getClickData() {
var _local2 = dataMap.getClickDataId(_id, _geo_tag, _domain);
clickData = allClickData[_local2];
defaultTargetUrl = clickData.target[0].nodeValue;
if (slotData) {
_expectedWidth = ((slotData.width > 0) ? (slotData.width) : (_expectedWidth));
_expectedHeight = ((slotData.height > 0) ? (slotData.height) : (_expectedHeight));
}
if (clickData) {
loadImage();
} else {
notifyDirector(false);
}
}
function setAdvertData(list) {
var _local4 = "";
var _local2 = 0;
while (_local2 < list.length) {
_local4 = list[_local2].id;
if (_local4 == _id) {
slotData = list[_local2];
break;
}
_local2++;
}
}
function domainIsExcluded(excluded) {
for (var _local8 in excluded) {
}
var _local4 = false;
var _local6 = false;
var _local7 = false;
if (!excluded) {
return(_local7);
}
var _local3;
for (var _local8 in excluded) {
_local3 = String(excluded[_local8].geo).split(",");
if (_local3[0] == "*") {
_local4 = true;
} else {
var _local2 = 0;
while (_local2 < _local3.length) {
if (String(_local3[_local2]).toLowerCase() == _geo_tag.toLowerCase()) {
_local4 = true;
}
_local2++;
}
}
if (_domain == excluded[_local8].nodeValue) {
_local6 = true;
}
if ((_local4 == true) && (_local6 == true)) {
_local7 = true;
}
_local4 = false;
_local6 = false;
}
return(_local7);
}
function setClickData(list) {
allClickData = new Object();
var _local4 = "";
var _local2 = 0;
while (_local2 < list.length) {
_local4 = list[_local2].id;
if (domainIsExcluded(list[_local2].exclude) == false) {
allClickData[_local4] = {target:list[_local2].target, file:list[_local2].file, click_track:list[_local2].click_track, view_track:list[_local2].view_track, call:list[_local2].call, window:list[_local2].config[0].window, action:list[_local2].config[0].action};
}
_local2++;
}
}
function addMapping(mapping) {
dataMap = new advertising.DataMap();
var _local2 = 0;
while (_local2 < mapping.length) {
dataMap.addPattern(mapping[_local2].slot, mapping[_local2].data, mapping[_local2].geo, mapping[_local2].domain);
_local2++;
}
}
function notifyDirector(state) {
if (System.capabilities.playerType == "DirectorXtra") {
var _local2 = "";
if (state) {
_local2 = "lingo:flashAd(\"true\")";
} else {
_local2 = "lingo:flashAd(\"false\")";
}
getURL(_local2);
}
}
function onShowComplete() {
notifyDirector(true);
}
function INITIALISE() {
if (advert_data) {
_gameID = advert_data.game_id;
_geo_tag = advert_data.geo;
_domain = advert_data.domain;
loadData();
}
}
function setPath() {
if (_mode != "debug") {
defaultURL = releaseURL;
} else {
defaultURL = debugURL;
}
}
function cacheKill() {
if (_url.indexOf("file:///") == 0) {
return("");
}
var _local4 = "?ord=";
var _local2 = 0;
while (_local2 < 10) {
var _local3 = Math.floor(Math.random() * 10);
_local4 = _local4 + String(_local3);
_local2++;
}
return(_local4);
}
var debugURL = "http://devcms.miniclip.com/i/creatives/games-syndication/";
var releaseURL = "http://www.miniclip.com/i/creatives/games-syndication/";
var _mode = "release";
var _id = "";
}
Symbol 44 MovieClip [__Packages.util.XMLParser] Frame 0
class util.XMLParser
{
static var _all;
var parse, loaded, _results, _xmlUrl, _onComplete, keepRootNode, parseLineBreaks, _xml;
function XMLParser () {
parse = initLoad;
loaded = false;
if (_all == undefined) {
_all = [];
}
_all.push(this);
}
static function load($url, $onComplete, $results, $keepRootNode, $parseLineBreaks) {
var _local1 = new util.XMLParser();
_local1.initLoad($url, $onComplete, $results, $keepRootNode, $parseLineBreaks);
return(_local1);
}
static function sendAndLoad($toSend, $url, $onComplete, $results, $keepRootNode, $parseLineBreaks) {
var _local1 = new util.XMLParser();
_local1.initSendAndLoad($toSend, $url, $onComplete, $results, $keepRootNode, $parseLineBreaks);
return(_local1);
}
function initLoad($url, $onComplete, $results, $keepRootNode, $parseLineBreaks) {
_results = $results || ({});
_xmlUrl = $url;
_onComplete = $onComplete;
keepRootNode = $keepRootNode;
parseLineBreaks = $parseLineBreaks;
_xml = new XML();
_xml.ignoreWhite = true;
_xml.onData = mx.utils.Delegate.create(this, onData);
loaded = false;
_xml.load(_xmlUrl);
}
function initSendAndLoad($toSend, $url, $onComplete, $results, $keepRootNode, $parseLineBreaks) {
_results = $results || ({});
_xmlUrl = $url;
_onComplete = $onComplete;
keepRootNode = $keepRootNode;
parseLineBreaks = $parseLineBreaks;
var _local2;
if ($toSend instanceof XML) {
_local2 = XML($toSend);
} else {
_local2 = objectToXML($toSend);
}
_xml = new XML();
_xml.ignoreWhite = true;
_xml.onData = mx.utils.Delegate.create(this, onData);
loaded = false;
_local2.sendAndLoad(_xmlUrl, _xml);
}
function onData($xml) {
if ($xml == undefined) {
parseLoadedXML(false);
} else {
_xml.parseXML($xml);
loaded = true;
parseLoadedXML(true);
}
}
function parseLoadedXML($success) {
if ($success == false) {
_onComplete(false);
return(undefined);
}
XMLToObject(_xml, _results, keepRootNode, parseLineBreaks);
_onComplete(true, _results, _xml);
}
static function XMLToObject($xml, $results, $keepRootNode, $parseLineBreaks) {
var _local8 = $xml;
$results = $results || ({});
var _local1 = _local8.firstChild;
var _local7 = _local8.firstChild;
_local8.obj = $results;
if ($keepRootNode != true) {
_local1 = _local1.firstChild;
_local7 = _local8.firstChild.lastChild;
_local8.firstChild.obj = $results;
}
while (_local1 != undefined) {
if ((_local1.nodeName == null) && (_local1.nodeType == 3)) {
_local1.parentNode.obj.nodeValue = clean(_local1.nodeValue, $parseLineBreaks);
} else {
_local1.nodeName = _local1.nodeName.split("-").join("_");
var _local3 = {};
for (var _local6 in _local1.attributes) {
_local3[_local6] = clean(_local1.attributes[_local6], $parseLineBreaks);
}
var _local4 = _local1.parentNode.obj;
if (_local4[_local1.nodeName] == undefined) {
_local4[_local1.nodeName] = [];
}
_local1.obj = _local3;
_local4[_local1.nodeName].push(_local3);
}
if (_local1.childNodes.length > 0) {
_local1 = _local1.childNodes[0];
} else {
var _local2 = _local1;
while ((_local2.nextSibling == undefined) && (_local2.parentNode != undefined)) {
_local2 = _local2.parentNode;
}
_local1 = _local2.nextSibling;
if (_local2 == _local7) {
_local1 = undefined;
}
}
}
return($results);
}
static function clean($s, $parseLineBreaks) {
if ((((!isNaN(Number($s))) && ($s != "")) && ($s.charAt(0) != "0")) && (containsNoLetters($s))) {
return(Number($s));
}
if ($s == "true") {
return(true);
}
if ($s == "false") {
return(false);
}
if ($parseLineBreaks) {
return($s.split("\\n").join(newline));
}
return($s);
}
static function containsNoLetters($s) {
var _local3 = $s.length;
var _local2;
var _local1 = 0;
while (_local1 < _local3) {
_local2 = $s.charCodeAt(_local1);
if ((_local2 < 48) || (_local2 > 57)) {
return(false);
}
_local1++;
}
return(true);
}
static function objectToXML($o, $rootNodeName) {
if ($rootNodeName == undefined) {
$rootNodeName = "XML";
}
var _local6 = new XML();
var _local4 = _local6.createElement($rootNodeName);
var _local5 = [];
var _local1;
var _local2;
var _local7;
for (_local2 in $o) {
_local5.push(_local2);
}
_local2 = _local5.length - 1;
while (_local2 >= 0) {
_local1 = _local5[_local2];
if ((typeof($o[_local1]) == "object") && ($o[_local1].length > 0)) {
arrayToNodes($o[_local1], _local4, _local6, _local1);
} else if (_local1 == "nodeValue") {
_local7 = _local6.createTextNode($o.nodeValue);
_local4.appendChild(_local7);
} else {
_local4.attributes[_local1] = $o[_local1];
}
_local2--;
}
_local6.appendChild(_local4);
return(_local6);
}
static function arrayToNodes($ar, $parentNode, $xml, $nodeName) {
var _local9 = [];
var _local6;
var _local1;
var _local4;
var _local2;
var _local5;
var _local3;
_local5 = $ar.length - 1;
while (_local5 >= 0) {
_local4 = $xml.createElement($nodeName);
_local2 = $ar[_local5];
_local6 = [];
for (_local3 in _local2) {
_local6.push(_local3);
}
_local3 = _local6.length - 1;
while (_local3 >= 0) {
_local1 = _local6[_local3];
if ((typeof(_local2[_local1]) == "object") && (_local2[_local1].length > 0)) {
arrayToNodes(_local2[_local1], _local4, $xml, _local1);
} else if (_local1 != "nodeValue") {
_local4.attributes[_local1] = _local2[_local1];
} else {
var _local7 = $xml.createTextNode(_local2.nodeValue);
_local4.appendChild(_local7);
}
_local3--;
}
_local9.push(_local4);
_local5--;
}
_local5 = _local9.length - 1;
while (_local5 >= 0) {
$parentNode.appendChild(_local9[_local5]);
_local5--;
}
}
function cancel() {
_xml.onData = null;
}
function destroy() {
cancel();
delete _xml;
var _local2 = _all.length - 1;
while (_local2 >= 0) {
if (this == _all[_local2]) {
_all.splice(_local2, 1);
}
_local2--;
}
}
static function get active() {
if (_all.length > 0) {
return(true);
}
return(false);
}
function get percentLoaded() {
return((bytesLoaded / bytesTotal) * 100);
}
function get xml() {
return(_xml);
}
function get bytesLoaded() {
return(_xml.getBytesLoaded() || 0);
}
function get bytesTotal() {
if (loaded) {
return(_xml.getBytesTotal() || 0);
}
return(_xml.getBytesTotal() || 1024);
}
}
Symbol 45 MovieClip [__Packages.advertising.DataMap] Frame 0
class advertising.DataMap extends Object
{
var geoTagsPattern, alltages;
function DataMap () {
super();
geoTagsPattern = new Object();
alltages = new Array();
}
function addPattern(advert_id, click_data_id, geo_list, domains_list) {
if (!geoTagsPattern[advert_id]) {
geoTagsPattern[advert_id] = [];
}
var _local2 = {geo_list:geo_list, domains_list:domains_list, click_data_id:click_data_id};
geoTagsPattern[advert_id].push(_local2);
}
function getClickDataId(advert_id, geo_tag, domain) {
var _local12 = null;
var _local7;
var _local6;
var _local3;
var _local11;
var _local8;
var _local10;
var _local5;
var _local2;
var _local9 = 0;
var _local4 = 0;
if (geoTagsPattern[advert_id]) {
_local10 = geoTagsPattern[advert_id];
_local7 = 0;
while (_local7 < _local10.length) {
_local11 = _local10[_local7].geo_list;
_local8 = _local10[_local7].domains_list;
_local6 = 0;
while (_local6 < _local11.length) {
_local5 = String(_local11[_local6].nodeValue).toLowerCase();
if ((_local5 == "*") || (_local5 == geo_tag.toLowerCase())) {
if (_local5 != "*") {
_local4++;
}
_local3 = 0;
while (_local3 < _local8.length) {
_local2 = String(_local8[_local3].nodeValue);
if ((_local2 == "*") || (_local2 == domain)) {
if (_local2 != "*") {
_local4++;
}
if (_local4 >= _local9) {
_local9 = _local4;
_local12 = String(_local10[_local7].click_data_id);
}
}
_local3++;
}
}
_local6++;
}
_local7++;
}
}
return(_local12);
}
}
Symbol 46 MovieClip [__Packages.util.cCallBack] Frame 0
class util.cCallBack
{
function cCallBack () {
}
static function delegate(scope, notify, predefinedArguments) {
var _local2 = function () {
return(notify.apply(scope, ((predefinedArguments.length > 0) ? (predefinedArguments.concat(arguments)) : arguments)));
};
return(_local2);
}
}
Symbol 47 MovieClip [__Packages.util.LoadingQueue] Frame 0
class util.LoadingQueue extends MovieClip
{
var loadingList, in_progress, mcl, currentElement;
function LoadingQueue () {
super();
loadingList = new Array();
in_progress = false;
mcl = new MovieClipLoader();
mcl.addListener(this);
}
function addToLoadingList(scope, target, path, onLoadInit, onLoadError) {
loadingList.push({target:target, path:path, onLoadInit:util.cCallBack.delegate(scope, onLoadInit, [target, path]), onLoadError:util.cCallBack.delegate(scope, onLoadError)});
if (in_progress == false) {
loadNext();
}
}
function onLoadInit(_mc) {
Function(currentElement.onLoadInit).apply();
loadNext();
}
function onLoadProgress(_mc, loaded, total) {
}
function onLoadError(_mc, sError) {
Function(currentElement.onLoadError).apply();
loadNext();
}
function loadNext() {
if (loadingList.length > 0) {
currentElement = loadingList.shift();
mcl.loadClip(currentElement.path, currentElement.target);
} else {
onAllLoaded();
}
}
function onAllLoaded() {
in_progress = false;
}
}
Symbol 99 MovieClip [id_blast] Frame 1
#initclip 60
Object.registerClass("id_blast", CBlast);
#endinitclip
Symbol 129 MovieClip [id_building] Frame 1
#initclip 28
Object.registerClass("id_building", CBuilding);
#endinitclip
Symbol 245 MovieClip [id_effect_slow] Frame 11
Symbol 246 MovieClip [id_enemy] Frame 1
#initclip 29
Object.registerClass("id_enemy", CEnemy);
#endinitclip
Symbol 252 MovieClip [id_enemy2] Frame 1
#initclip 30
Object.registerClass("id_enemy2", CEnemy);
#endinitclip
Symbol 255 MovieClip [id_enemy3] Frame 1
#initclip 31
Object.registerClass("id_enemy3", CEnemy);
#endinitclip
Symbol 275 MovieClip [id_gfx_aablast] Frame 4
this.removeMovieClip();
Symbol 304 MovieClip [id_gfx_explosion_big] Frame 1
CSoundService.playSound(Const.SND_BIGEXPLOSION);
Symbol 304 MovieClip [id_gfx_explosion_big] Frame 15
this.removeMovieClip();
Symbol 308 MovieClip [id_gfx_electricfield] Frame 4
this.removeMovieClip();
Symbol 325 MovieClip [id_gfx_explosion_medium] Frame 1
CSoundService.playSound(Const.SND_MEDIUMEXPLOSION);
Symbol 325 MovieClip [id_gfx_explosion_medium] Frame 9
this.removeMovieClip();
Symbol 336 MovieClip [id_gfx_missileblast] Frame 1
CSoundService.playSound(Const.SND_NUCLEAREXPLOSION);
Symbol 336 MovieClip [id_gfx_missileblast] Frame 6
this.removeMovieClip();
Symbol 340 MovieClip [id_gfx_slowsplash] Frame 4
this.removeMovieClip();
Symbol 357 MovieClip [id_gfx_explosion_small] Frame 1
CSoundService.playSound(Const.SND_SMALLEXPLOSION);
Symbol 357 MovieClip [id_gfx_explosion_small] Frame 9
this.removeMovieClip();
Symbol 362 MovieClip [id_gfx_splash] Frame 4
this.removeMovieClip();
Symbol 371 MovieClip [mc_button_ability_1] Frame 1
#initclip 32
Object.registerClass("mc_button_ability_1", CToggleButton);
#endinitclip
stop();
Symbol 371 MovieClip [mc_button_ability_1] Frame 2
stop();
Symbol 374 MovieClip [mc_button_ability_2] Frame 1
#initclip 33
Object.registerClass("mc_button_ability_2", CToggleButton);
#endinitclip
stop();
Symbol 374 MovieClip [mc_button_ability_2] Frame 2
stop();
Symbol 377 MovieClip [mc_button_ability_3] Frame 1
#initclip 34
Object.registerClass("mc_button_ability_3", CToggleButton);
#endinitclip
stop();
Symbol 377 MovieClip [mc_button_ability_3] Frame 2
stop();
Symbol 380 MovieClip [mc_button_ability_4] Frame 1
#initclip 35
Object.registerClass("mc_button_ability_4", CToggleButton);
#endinitclip
stop();
Symbol 380 MovieClip [mc_button_ability_4] Frame 2
stop();
Symbol 384 MovieClip [mc_button_structure_1] Frame 1
#initclip 36
Object.registerClass("mc_button_structure_1", CToggleButton);
#endinitclip
stop();
Symbol 384 MovieClip [mc_button_structure_1] Frame 2
stop();
Symbol 387 MovieClip [mc_button_structure_2] Frame 1
#initclip 37
Object.registerClass("mc_button_structure_2", CToggleButton);
#endinitclip
stop();
Symbol 387 MovieClip [mc_button_structure_2] Frame 2
stop();
Symbol 390 MovieClip [mc_button_structure_3] Frame 1
#initclip 38
Object.registerClass("mc_button_structure_3", CToggleButton);
#endinitclip
stop();
Symbol 390 MovieClip [mc_button_structure_3] Frame 2
stop();
Symbol 393 MovieClip [mc_button_structure_4] Frame 1
#initclip 39
Object.registerClass("mc_button_structure_4", CToggleButton);
#endinitclip
stop();
Symbol 393 MovieClip [mc_button_structure_4] Frame 2
stop();
Symbol 396 MovieClip [mc_button_structure_5] Frame 1
#initclip 40
Object.registerClass("mc_button_structure_5", CToggleButton);
#endinitclip
stop();
Symbol 396 MovieClip [mc_button_structure_5] Frame 2
stop();
Symbol 401 MovieClip [mc_button_structures_tab] Frame 1
#initclip 41
Object.registerClass("mc_button_structures_tab", CToggleButton);
#endinitclip
stop();
Symbol 401 MovieClip [mc_button_structures_tab] Frame 2
stop();
Symbol 404 MovieClip [mc_button_tower_1_1] Frame 1
#initclip 42
Object.registerClass("mc_button_tower_1_1", CToggleButton);
#endinitclip
stop();
Symbol 404 MovieClip [mc_button_tower_1_1] Frame 2
stop();
Symbol 407 MovieClip [mc_button_tower_1_2] Frame 1
#initclip 43
Object.registerClass("mc_button_tower_1_2", CToggleButton);
#endinitclip
stop();
Symbol 407 MovieClip [mc_button_tower_1_2] Frame 2
stop();
Symbol 410 MovieClip [mc_button_tower_1_3] Frame 1
#initclip 44
Object.registerClass("mc_button_tower_1_3", CToggleButton);
#endinitclip
stop();
Symbol 410 MovieClip [mc_button_tower_1_3] Frame 2
stop();
Symbol 413 MovieClip [mc_button_tower_1_4] Frame 1
#initclip 45
Object.registerClass("mc_button_tower_1_4", CToggleButton);
#endinitclip
stop();
Symbol 413 MovieClip [mc_button_tower_1_4] Frame 2
stop();
Symbol 416 MovieClip [mc_button_tower_1_5] Frame 1
#initclip 46
Object.registerClass("mc_button_tower_1_5", CToggleButton);
#endinitclip
stop();
Symbol 416 MovieClip [mc_button_tower_1_5] Frame 2
stop();
Symbol 419 MovieClip [mc_button_tower_2_2] Frame 1
#initclip 47
Object.registerClass("mc_button_tower_2_2", CToggleButton);
#endinitclip
stop();
Symbol 419 MovieClip [mc_button_tower_2_2] Frame 2
stop();
Symbol 422 MovieClip [mc_button_tower_2_1] Frame 1
#initclip 48
Object.registerClass("mc_button_tower_2_1", CToggleButton);
#endinitclip
stop();
Symbol 422 MovieClip [mc_button_tower_2_1] Frame 2
stop();
Symbol 425 MovieClip [mc_button_tower_2_3] Frame 1
#initclip 49
Object.registerClass("mc_button_tower_2_3", CToggleButton);
#endinitclip
stop();
Symbol 425 MovieClip [mc_button_tower_2_3] Frame 2
stop();
Symbol 428 MovieClip [mc_button_tower_2_4] Frame 1
#initclip 50
Object.registerClass("mc_button_tower_2_4", CToggleButton);
#endinitclip
stop();
Symbol 428 MovieClip [mc_button_tower_2_4] Frame 2
stop();
Symbol 431 MovieClip [mc_button_tower_2_5] Frame 1
#initclip 51
Object.registerClass("mc_button_tower_2_5", CToggleButton);
#endinitclip
stop();
Symbol 431 MovieClip [mc_button_tower_2_5] Frame 2
stop();
Symbol 434 MovieClip [mc_button_towers1_tab] Frame 1
#initclip 52
Object.registerClass("mc_button_towers1_tab", CToggleButton);
#endinitclip
stop();
Symbol 434 MovieClip [mc_button_towers1_tab] Frame 2
stop();
Symbol 437 MovieClip [mc_button_towers2_tab] Frame 1
#initclip 53
Object.registerClass("mc_button_towers2_tab", CToggleButton);
#endinitclip
stop();
Symbol 437 MovieClip [mc_button_towers2_tab] Frame 2
stop();
Symbol 442 Button
on (release) {
_parent.onGameOverDialogClose();
}
Symbol 468 MovieClip Frame 1
stop();
Symbol 468 MovieClip Frame 2
stop();
Symbol 568 MovieClip Frame 1
stop();
Symbol 572 Button
on (release) {
this.onHurryRelease();
}
Symbol 574 Button
on (release) {
this.onQuitRelease();
}
Symbol 576 Button
on (release) {
this.play();
_parent.onPauseRelease(true);
}
Symbol 578 Button
on (release) {
this.play();
_parent.onPauseRelease(false);
}
Symbol 579 MovieClip Frame 1
stop();
Symbol 579 MovieClip Frame 2
stop();
Symbol 581 Button
on (release) {
this.play();
CSoundService.soundOff();
}
Symbol 583 Button
on (release) {
this.play();
CSoundService.soundOn();
}
Symbol 584 MovieClip Frame 1
if (!CSoundService.soundIsOn()) {
this.gotoAndStop(2);
}
stop();
Symbol 584 MovieClip Frame 2
stop();
Symbol 585 MovieClip [id_missionUI] Frame 1
#initclip 54
Object.registerClass("id_missionUI", CMissionUIPanel);
#endinitclip
Symbol 588 Button
on (release) {
_parent.onQuitDialogClose(true);
}
Symbol 590 Button
on (release) {
_parent.onQuitDialogClose(false);
}
Symbol 597 Button
on (release) {
CSoundService.playSound(Const.SND_SWITCH);
_parent.numState = CGame.STATE_MAINSCREEN;
}
Symbol 626 Button
on (release) {
_parent._parent.numMap = 1;
_parent.mcSelectedMap.gotoAndStop(1);
CSoundService.playSound(Const.SND_SWITCH);
_parent.gotoAndStop(2);
}
Symbol 627 Button
on (release) {
_parent._parent.numMap = 2;
_parent.mcSelectedMap.gotoAndStop(2);
CSoundService.playSound(Const.SND_SWITCH);
_parent.gotoAndStop(2);
}
Symbol 628 Button
on (release) {
_parent._parent.numMap = 3;
_parent.mcSelectedMap.gotoAndStop(3);
CSoundService.playSound(Const.SND_SWITCH);
_parent.gotoAndStop(2);
}
Symbol 629 MovieClip Frame 1
this.mcNoise2.gotoAndPlay(9);
this.mcNoise3.gotoAndPlay(43);
stop();
Symbol 631 Button
on (release) {
CSoundService.playSound(Const.SND_SWITCH);
this.gotoAndStop(1);
}
Symbol 653 MovieClip Frame 1
stop();
Symbol 654 Button
on (release) {
CSoundService.playSound(Const.SND_SWITCH);
_parent.numProgram = 0;
_parent.numState = CGame.STATE_MISSION;
}
Symbol 655 Button
on (release) {
CSoundService.playSound(Const.SND_SWITCH);
_parent.numProgram = 1;
_parent.numState = CGame.STATE_MISSION;
}
Symbol 656 Button
on (release) {
CSoundService.playSound(Const.SND_SWITCH);
_parent.numProgram = 2;
_parent.numState = CGame.STATE_MISSION;
}
Symbol 658 MovieClip [id_mcOptionsScreen] Frame 1
stop();
Symbol 658 MovieClip [id_mcOptionsScreen] Frame 2
stop();
Symbol 674 MovieClip [id_map] Frame 1
#initclip 55
Object.registerClass("id_map", CMap);
#endinitclip
Symbol 681 MovieClip [id_cursor] Frame 1
#initclip 56
Object.registerClass("id_cursor", CCursor);
#endinitclip
Symbol 682 MovieClip [id_mapLayer] Frame 1
#initclip 57
Object.registerClass("id_mapLayer", CMap);
#endinitclip
Symbol 683 MovieClip [id_layer] Frame 1
#initclip 58
Object.registerClass("id_layer", CLayer);
#endinitclip
Symbol 707 MovieClip Frame 1
stop();
Symbol 708 MovieClip [dmSoundService] Frame 1
#initclip 59
Object.registerClass("dmSoundService", CSoundService);
#endinitclip
Symbol 712 MovieClip Frame 1
this._visible = false;
Symbol 721 Button
on (release) {
gameURL = ("http://www.miniclip.com/" + gamename) + ".htm";
getURL (gameURL, "_blank");
}
Symbol 723 MovieClip Frame 1
System.security.allowDomain("www.miniclip.com");
Instance of Symbol 712 MovieClip "mcHighscores" in Symbol 723 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 723 MovieClip Frame 2
if ((((_url.indexOf("miniclip.com") == -1) && (_url.indexOf("miniclip.net") == -1)) && (_url.indexOf("miniclip.co.uk") == -1)) && (_url.indexOf("miniclips.com"))) {
gotoAndStop(_currentframe + 1);
} else {
var noCache = (getTimer() + random(100000));
mcTarget.loadMovie("http://www.miniclip.com/swfcontent/highscore.swf?noCache=" + noCache);
stop();
}
Symbol 723 MovieClip Frame 3
stop();
Symbol 726 Button
on (release) {
CSoundService.playSound(Const.SND_SWITCH);
_parent.numState = CGame.STATE_MAINSCREEN;
}
Instance of Symbol 723 MovieClip "comHighscores" in Symbol 727 MovieClip [id_mcSaveScore] Frame 1
//component parameters
onClipEvent (construct) {
gamename = "canyon";
negativeScoreAllowed = false;
saveScore = true;
scoreIsTime = false;
scoreLocation = "_root.mcGame.numScore";
scoreReversed = false;
}
Instance of Symbol 723 MovieClip "comHighscores" in Symbol 728 MovieClip [id_mcViewScore] Frame 1
//component parameters
onClipEvent (construct) {
gamename = "canyon";
negativeScoreAllowed = false;
saveScore = false;
scoreIsTime = false;
scoreLocation = "_root.mcGame.numScore";
scoreReversed = false;
}
Symbol 736 Button
on (release) {
_root.mcAward.removeMovieClip();
CSoundService.playSound(Const.SND_SWITCH);
_parent.numState = CGame.STATE_SAVESCORE;
}
Symbol 738 MovieClip [id_mcGiveAward] Frame 1
stop();
var myMiniclipAwards = new MiniclipAwards(this);
var mcAward = myMiniclipAwards.loadAwardGfx(65);
mcAward._x = 210;
mcAward._y = 120;
mcAward._yscale = (mcAward._xscale = 750);
btn_next.onRelease = function () {
_root.mcAward.removeMovieClip();
goto_page("select mission");
};