Frame 3
stop();
Symbol 2 MovieClip [id_mcGame] Frame 1
#initclip 17
Object.registerClass("id_mcGame", CGame);
#endinitclip
Symbol 9 Button
on (release) {
getURL ("http://www.miniclip.com/", "_blank");
}
Symbol 10 MovieClip Frame 2
_parent.mcAnimation.play();
stop();
Symbol 10 MovieClip Frame 13
_parent.gotoAndPlay("preload");
stop();
Symbol 26 MovieClip Frame 1
stop();
Symbol 26 MovieClip Frame 60
Symbol 26 MovieClip Frame 121
_parent.mcBackground.play();
stop();
Symbol 31 MovieClip Frame 1
this._visible = false;
Symbol 37 Button
on (release) {
getURL ("http://www.miniclip.com", "_blank");
}
Symbol 42 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;
trace("Loading ad: " + showAd);
mcAd.loadMovie(showAd);
} else {
gotoAndPlay(_currentframe - 1);
}
}
Symbol 42 MovieClip Frame 4
if ((mcAd.getBytesTotal() != 0) && (mcAd.getBytesLoaded() == mcAd.getBytesTotal())) {
gotoAndStop ("showAd");
} else {
gotoAndPlay(_currentframe - 1);
}
Symbol 42 MovieClip Frame 12
stop();
Symbol 51 MovieClip Frame 1
stop();
Symbol 51 MovieClip Frame 100
stop();
Symbol 53 MovieClip Frame 1
stop();
Symbol 53 MovieClip Frame 12
_root.play();
_root.isFinished = true;
_parent.stop();
stop();
Symbol 54 MovieClip Frame 1
loadAdNow = false;
_root.stop();
play();
Instance of Symbol 31 MovieClip "mcIntro" in Symbol 54 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 54 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 53 MovieClip "mcLoadingAnimated" in Symbol 54 MovieClip Frame 2
onClipEvent (load) {
_visible = false;
}
Symbol 54 MovieClip Frame 3
var loadedPercent = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (loadedPercent == 100) {
_root.play();
stop();
} else {
loadAdNow = true;
mcLoadingAnimated._visible = true;
}
Symbol 54 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 727 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 728 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, 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 = CSoundService.getSoundAt(Const.SND_MAINLOOP);
_local3.setVolume(100);
CSoundService.playLoopSound(Const.SND_MAINLOOP);
break;
case STATE_OPTIONSSCREEN :
attachMovie("id_mcOptionsScreen", "_mcOptionsScreen", 1);
_local3 = CSoundService.getSoundAt(Const.SND_MAINLOOP);
_local3.setVolume(100);
CSoundService.playLoopSound(Const.SND_MAINLOOP);
break;
case STATE_RULESSCREEN :
attachMovie("id_mcRulesScreen", "_mcRulesScreen", 1);
_local3 = CSoundService.getSoundAt(Const.SND_MAINLOOP);
_local3.setVolume(100);
CSoundService.playLoopSound(Const.SND_MAINLOOP);
break;
case STATE_VIEWSCORE :
attachMovie("id_mcViewScore", "_mcViewScoreScreen", 1);
_local3 = CSoundService.getSoundAt(Const.SND_MAINLOOP);
_local3.setVolume(100);
CSoundService.playLoopSound(Const.SND_MAINLOOP);
break;
case STATE_SAVESCORE :
attachMovie("id_mcSaveScore", "_mcSaveScoreScreen", 1);
_local3 = CSoundService.getSoundAt(Const.SND_MAINLOOP);
_local3.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;
_local3 = CSoundService.getSoundAt(Const.SND_MAINLOOP);
_local3.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 processMessage(__numMessage, __objParam, __mcInvoker) {
switch (__numMessage) {
case CEventMovieClip.MSG_TOGGLEPRESS :
var _local5 = CToggleButton(__mcInvoker);
if (_mcMissionUI.hitTest(_root._xmouse, _root._ymouse, true)) {
if (__objParam.isHit) {
_local5.__set__boolPressed(!_local5.__get__boolPressed());
} else {
_local5.__set__boolPressed(false);
}
_cursorCurrent.clear();
}
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;
var _local12 = {x:224, y:500, direction:new CVector(0, -1), altitude:CMap.ALTITUDE_BOTH, type:CBlast.TYPE_MISSILE, targetsEnemy:false, targetX:_root._xmouse, targetY:_root._ymouse, speed:6};
_mapCurrent.addBlast(_local12);
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 _local15 = _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);
__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 _local11 = Math.round(__mcInvoker._numReward * (1 + (0.5 * _arrAbilities[4].numSources)));
numFunds = numFunds + _local11;
_numMoneyEarned = _numMoneyEarned + _local11;
_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() {
numState = (STATE_SAVESCORE);
CSoundService.playSound(Const.SND_SWITCH);
}
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 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 729 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();
trace(((("Added wall at [" + __numCellI) + ",") + __numCellJ) + "]");
var _local2;
for (var _local3 in _layerEnemies1) {
if (_layerEnemies1[_local3] instanceof CEnemy) {
_local2 = CEnemy(_layerEnemies1[_local3]);
trace(((("Enemy at [" + _local2._numCellI) + ",") + _local2._numCellJ) + "]");
_local2.updateWaypoint();
}
}
}
function cellHitTest(__numX, __numY) {
var _local2 = {out:false, i:0, j:0, x:0, y:0};
var _local3 = {x:0, y:0};
localToGlobal(_local3);
_local2.j = Math.floor((__numX - _local3.x) / Const.MATRIX_CELL_WIDTH);
_local2.i = Math.floor((__numY - _local3.y) / Const.MATRIX_CELL_HEIGHT);
if (_local2.i < 0) {
_local2.out = true;
_local2.j = undefined;
}
if (_local2.j < 0) {
_local2.out = true;
_local2.j = undefined;
}
if (_local2.j >= _matrixPattern.width) {
_local2.out = true;
_local2.j = undefined;
}
if (_local2.i >= _matrixPattern.height) {
_local2.out = true;
_local2.j = undefined;
}
_local2.x = _local3.x + (_local2.j * Const.MATRIX_CELL_WIDTH);
_local2.y = _local3.y + (_local2.i * Const.MATRIX_CELL_HEIGHT);
return(_local2);
}
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 _local6 = getEntryCells();
var _local7 = random(_local6.length);
_local3 = _local6[_local7].i;
_local4 = _local6[_local7].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._x = _local2._x + (random(16) - 8);
_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) {
_layerBlasts1.globalToLocal(__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, y:__objParam.targetY});
}
}
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 730 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 731 MovieClip [__Packages.Const] Frame 0
class Const
{
function Const () {
}
static function TRACE(__strMessage) {
if (TRACE_DEBUG_INFO) {
trace(__strMessage);
}
}
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 732 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, _parent;
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};
_parent.globalToLocal(_local2);
return(Math.sqrt(((_x - _local2.x) * (_x - _local2.x)) + ((_y - _local2.y) * (_y - _local2.y))));
}
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 733 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 734 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 735 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 736 MovieClip [__Packages.CBuilding] Frame 0
class CBuilding extends CEventMovieClip
{
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);
trace("Building type " + 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 _local8 = Math.ceil(_mcMatrix._width / Const.MATRIX_CELL_WIDTH);
var _local7 = Math.ceil(_mcMatrix._height / Const.MATRIX_CELL_HEIGHT);
MATRICES[__numType] = new Array(_local8 * _local7);
MATRICES[__numType].width = _local8;
MATRICES[__numType].height = _local7;
var _local5 = {x:_mcMatrix._x, y:_mcMatrix._y};
localToGlobal(_local5);
var _local4 = 0;
while (_local4 < MATRICES[__numType].height) {
var _local3 = 0;
while (_local3 < MATRICES[__numType].width) {
if (_mcMatrix.hitTest((_local5.x + (Const.MATRIX_CELL_WIDTH / 2)) + (_local3 * Const.MATRIX_CELL_WIDTH), (_local5.y + (Const.MATRIX_CELL_HEIGHT / 2)) + (_local4 * Const.MATRIX_CELL_HEIGHT), true)) {
MATRICES[__numType][(_local4 * MATRICES[__numType].width) + _local3] = CELL_OCCUPIED;
} else {
MATRICES[__numType][(_local4 * MATRICES[__numType].width) + _local3] = CELL_VOID;
}
_local3++;
}
_local4++;
}
_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 _local6 = "Buidling matrix: \n";
var _local4 = 0;
while (_local4 < _matrixPattern.height) {
var _local3 = 0;
while (_local3 < _matrixPattern.width) {
_local6 = _local6 + (_matrixPattern[(_local4 * _matrixPattern.width) + _local3] + " ");
_local3++;
}
_local6 = _local6 + newline;
_local4++;
}
Const.TRACE(_local6);
}
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};
_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 737 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, _parent, _x, _y, dispatchMessage, _numAltitude, _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};
_parent.globalToLocal(_local2);
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 738 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) {
_objCell = _mapReference.cellHitTest(_root._xmouse, _root._ymouse);
_parent.globalToLocal(_objCell);
var _local4 = (mcCursor._numCellI != _objCell.i) || (mcCursor._numCellJ != _objCell.j);
mcCursor._numCellI = _objCell.i;
mcCursor._numCellJ = _objCell.j;
_visible = !_objCell.out;
if (numState == STATE_BUILDING) {
_x = _objCell.x;
_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 _local3 = new Array();
_local3.push(PERMISSION_GLOW);
filters = _local3;
} else {
_objCell.free = false;
var _local3 = new Array();
_local3.push(FORBIDDEN_GLOW);
filters = _local3;
}
} else if ((numState == STATE_ABILITY) && (numAbility == CAbility.TYPE_WALL)) {
_x = _objCell.x;
_y = _objCell.y;
if (_mapReference.checkWallSpace(_objCell.i, _objCell.j)) {
_objCell.free = true;
var _local3 = new Array();
_local3.push(PERMISSION_GLOW);
filters = _local3;
} else {
_objCell.free = false;
var _local3 = new Array();
_local3.push(FORBIDDEN_GLOW);
filters = _local3;
}
_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 _local3 = new Array();
_local3.push(FORBIDDEN_GLOW);
filters = _local3;
}
_mapReference.toggleGrid(!_objCell.out);
break;
case CAbility.TYPE_MISSILE :
case CAbility.TYPE_TIMEBOMB :
_objCell.free = true;
_alpha = 100;
}
}
}
}
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 739 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 740 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 onMouseDown() {
if (_boolEnabled) {
if (mcHitArea.hitTest(_root._xmouse, _root._ymouse, true)) {
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 741 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 742 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 55 MovieClip [id_blast] Frame 1
#initclip 50
Object.registerClass("id_blast", CBlast);
#endinitclip
Symbol 85 MovieClip [id_building] Frame 1
#initclip 18
Object.registerClass("id_building", CBuilding);
#endinitclip
Symbol 201 MovieClip [id_effect_slow] Frame 11
Symbol 202 MovieClip [id_enemy] Frame 1
#initclip 19
Object.registerClass("id_enemy", CEnemy);
#endinitclip
Symbol 208 MovieClip [id_enemy2] Frame 1
#initclip 20
Object.registerClass("id_enemy2", CEnemy);
#endinitclip
Symbol 211 MovieClip [id_enemy3] Frame 1
#initclip 21
Object.registerClass("id_enemy3", CEnemy);
#endinitclip
Symbol 231 MovieClip [id_gfx_aablast] Frame 4
this.removeMovieClip();
Symbol 260 MovieClip [id_gfx_explosion_big] Frame 1
CSoundService.playSound(Const.SND_BIGEXPLOSION);
Symbol 260 MovieClip [id_gfx_explosion_big] Frame 15
this.removeMovieClip();
Symbol 264 MovieClip [id_gfx_electricfield] Frame 4
this.removeMovieClip();
Symbol 281 MovieClip [id_gfx_explosion_medium] Frame 1
CSoundService.playSound(Const.SND_MEDIUMEXPLOSION);
Symbol 281 MovieClip [id_gfx_explosion_medium] Frame 9
this.removeMovieClip();
Symbol 292 MovieClip [id_gfx_missileblast] Frame 1
CSoundService.playSound(Const.SND_NUCLEAREXPLOSION);
Symbol 292 MovieClip [id_gfx_missileblast] Frame 6
this.removeMovieClip();
Symbol 296 MovieClip [id_gfx_slowsplash] Frame 4
this.removeMovieClip();
Symbol 313 MovieClip [id_gfx_explosion_small] Frame 1
CSoundService.playSound(Const.SND_SMALLEXPLOSION);
Symbol 313 MovieClip [id_gfx_explosion_small] Frame 9
this.removeMovieClip();
Symbol 318 MovieClip [id_gfx_splash] Frame 4
this.removeMovieClip();
Symbol 327 MovieClip [mc_button_ability_1] Frame 1
#initclip 22
Object.registerClass("mc_button_ability_1", CToggleButton);
#endinitclip
stop();
Symbol 327 MovieClip [mc_button_ability_1] Frame 2
stop();
Symbol 330 MovieClip [mc_button_ability_2] Frame 1
#initclip 23
Object.registerClass("mc_button_ability_2", CToggleButton);
#endinitclip
stop();
Symbol 330 MovieClip [mc_button_ability_2] Frame 2
stop();
Symbol 333 MovieClip [mc_button_ability_3] Frame 1
#initclip 24
Object.registerClass("mc_button_ability_3", CToggleButton);
#endinitclip
stop();
Symbol 333 MovieClip [mc_button_ability_3] Frame 2
stop();
Symbol 336 MovieClip [mc_button_ability_4] Frame 1
#initclip 25
Object.registerClass("mc_button_ability_4", CToggleButton);
#endinitclip
stop();
Symbol 336 MovieClip [mc_button_ability_4] Frame 2
stop();
Symbol 340 MovieClip [mc_button_structure_1] Frame 1
#initclip 26
Object.registerClass("mc_button_structure_1", CToggleButton);
#endinitclip
stop();
Symbol 340 MovieClip [mc_button_structure_1] Frame 2
stop();
Symbol 343 MovieClip [mc_button_structure_2] Frame 1
#initclip 27
Object.registerClass("mc_button_structure_2", CToggleButton);
#endinitclip
stop();
Symbol 343 MovieClip [mc_button_structure_2] Frame 2
stop();
Symbol 346 MovieClip [mc_button_structure_3] Frame 1
#initclip 28
Object.registerClass("mc_button_structure_3", CToggleButton);
#endinitclip
stop();
Symbol 346 MovieClip [mc_button_structure_3] Frame 2
stop();
Symbol 349 MovieClip [mc_button_structure_4] Frame 1
#initclip 29
Object.registerClass("mc_button_structure_4", CToggleButton);
#endinitclip
stop();
Symbol 349 MovieClip [mc_button_structure_4] Frame 2
stop();
Symbol 352 MovieClip [mc_button_structure_5] Frame 1
#initclip 30
Object.registerClass("mc_button_structure_5", CToggleButton);
#endinitclip
stop();
Symbol 352 MovieClip [mc_button_structure_5] Frame 2
stop();
Symbol 358 MovieClip [mc_button_structures_tab] Frame 1
#initclip 31
Object.registerClass("mc_button_structures_tab", CToggleButton);
#endinitclip
stop();
Symbol 358 MovieClip [mc_button_structures_tab] Frame 2
stop();
Symbol 361 MovieClip [mc_button_tower_1_1] Frame 1
#initclip 32
Object.registerClass("mc_button_tower_1_1", CToggleButton);
#endinitclip
stop();
Symbol 361 MovieClip [mc_button_tower_1_1] Frame 2
stop();
Symbol 364 MovieClip [mc_button_tower_1_2] Frame 1
#initclip 33
Object.registerClass("mc_button_tower_1_2", CToggleButton);
#endinitclip
stop();
Symbol 364 MovieClip [mc_button_tower_1_2] Frame 2
stop();
Symbol 367 MovieClip [mc_button_tower_1_3] Frame 1
#initclip 34
Object.registerClass("mc_button_tower_1_3", CToggleButton);
#endinitclip
stop();
Symbol 367 MovieClip [mc_button_tower_1_3] Frame 2
stop();
Symbol 370 MovieClip [mc_button_tower_1_4] Frame 1
#initclip 35
Object.registerClass("mc_button_tower_1_4", CToggleButton);
#endinitclip
stop();
Symbol 370 MovieClip [mc_button_tower_1_4] Frame 2
stop();
Symbol 373 MovieClip [mc_button_tower_1_5] Frame 1
#initclip 36
Object.registerClass("mc_button_tower_1_5", CToggleButton);
#endinitclip
stop();
Symbol 373 MovieClip [mc_button_tower_1_5] Frame 2
stop();
Symbol 376 MovieClip [mc_button_tower_2_2] Frame 1
#initclip 37
Object.registerClass("mc_button_tower_2_2", CToggleButton);
#endinitclip
stop();
Symbol 376 MovieClip [mc_button_tower_2_2] Frame 2
stop();
Symbol 379 MovieClip [mc_button_tower_2_1] Frame 1
#initclip 38
Object.registerClass("mc_button_tower_2_1", CToggleButton);
#endinitclip
stop();
Symbol 379 MovieClip [mc_button_tower_2_1] Frame 2
stop();
Symbol 382 MovieClip [mc_button_tower_2_3] Frame 1
#initclip 39
Object.registerClass("mc_button_tower_2_3", CToggleButton);
#endinitclip
stop();
Symbol 382 MovieClip [mc_button_tower_2_3] Frame 2
stop();
Symbol 385 MovieClip [mc_button_tower_2_4] Frame 1
#initclip 40
Object.registerClass("mc_button_tower_2_4", CToggleButton);
#endinitclip
stop();
Symbol 385 MovieClip [mc_button_tower_2_4] Frame 2
stop();
Symbol 388 MovieClip [mc_button_tower_2_5] Frame 1
#initclip 41
Object.registerClass("mc_button_tower_2_5", CToggleButton);
#endinitclip
stop();
Symbol 388 MovieClip [mc_button_tower_2_5] Frame 2
stop();
Symbol 391 MovieClip [mc_button_towers1_tab] Frame 1
#initclip 42
Object.registerClass("mc_button_towers1_tab", CToggleButton);
#endinitclip
stop();
Symbol 391 MovieClip [mc_button_towers1_tab] Frame 2
stop();
Symbol 394 MovieClip [mc_button_towers2_tab] Frame 1
#initclip 43
Object.registerClass("mc_button_towers2_tab", CToggleButton);
#endinitclip
stop();
Symbol 394 MovieClip [mc_button_towers2_tab] Frame 2
stop();
Symbol 400 Button
on (release) {
_parent.onGameOverDialogClose();
}
Symbol 427 MovieClip Frame 1
stop();
Symbol 427 MovieClip Frame 2
stop();
Symbol 435 Button
on (release) {
getURL ("http://www.miniclip.com/", "_blank");
}
Symbol 529 MovieClip Frame 1
stop();
Symbol 533 Button
on (release) {
this.onHurryRelease();
}
Symbol 535 Button
on (release) {
this.onQuitRelease();
}
Symbol 538 Button
on (release) {
this.play();
_parent.onPauseRelease(true);
}
Symbol 540 Button
on (release) {
this.play();
_parent.onPauseRelease(false);
}
Symbol 541 MovieClip Frame 1
stop();
Symbol 541 MovieClip Frame 2
stop();
Symbol 543 Button
on (release) {
this.play();
CSoundService.soundOff();
}
Symbol 545 Button
on (release) {
this.play();
CSoundService.soundOn();
}
Symbol 546 MovieClip Frame 1
if (!CSoundService.soundIsOn()) {
this.gotoAndStop(2);
}
stop();
Symbol 546 MovieClip Frame 2
stop();
Symbol 547 MovieClip [id_missionUI] Frame 1
#initclip 44
Object.registerClass("id_missionUI", CMissionUIPanel);
#endinitclip
Symbol 550 Button
on (release) {
_parent.onQuitDialogClose(true);
}
Symbol 552 Button
on (release) {
_parent.onQuitDialogClose(false);
}
Symbol 555 Button
on (release) {
getURL ("http://www.miniclip.com", "_blank");
}
Symbol 564 Button
on (release) {
CSoundService.playSound(Const.SND_SWITCH);
_parent.numState = CGame.STATE_OPTIONSSCREEN;
}
Symbol 571 Button
on (release) {
CSoundService.playSound(Const.SND_SWITCH);
_parent.numState = CGame.STATE_VIEWSCORE;
}
Symbol 575 Button
on (release) {
CSoundService.playSound(Const.SND_SWITCH);
_parent.numState = CGame.STATE_RULESSCREEN;
}
Symbol 580 Button
on (release) {
getURL ("http://www.iriysoft.ru", "_blank");
}
Symbol 586 Button
on (release) {
CSoundService.playSound(Const.SND_SWITCH);
_parent.numState = CGame.STATE_MAINSCREEN;
}
Symbol 615 Button
on (release) {
_parent._parent.numMap = 1;
_parent.mcSelectedMap.gotoAndStop(1);
CSoundService.playSound(Const.SND_SWITCH);
_parent.gotoAndStop(2);
}
Symbol 616 Button
on (release) {
_parent._parent.numMap = 2;
_parent.mcSelectedMap.gotoAndStop(2);
CSoundService.playSound(Const.SND_SWITCH);
_parent.gotoAndStop(2);
}
Symbol 617 Button
on (release) {
_parent._parent.numMap = 3;
_parent.mcSelectedMap.gotoAndStop(3);
CSoundService.playSound(Const.SND_SWITCH);
_parent.gotoAndStop(2);
}
Symbol 618 MovieClip Frame 1
this.mcNoise2.gotoAndPlay(9);
this.mcNoise3.gotoAndPlay(43);
stop();
Symbol 620 Button
on (release) {
CSoundService.playSound(Const.SND_SWITCH);
this.gotoAndStop(1);
}
Symbol 642 MovieClip Frame 1
stop();
Symbol 643 Button
on (release) {
CSoundService.playSound(Const.SND_SWITCH);
_parent.numProgram = 0;
_parent.numState = CGame.STATE_MISSION;
}
Symbol 644 Button
on (release) {
CSoundService.playSound(Const.SND_SWITCH);
_parent.numProgram = 1;
_parent.numState = CGame.STATE_MISSION;
}
Symbol 645 Button
on (release) {
CSoundService.playSound(Const.SND_SWITCH);
_parent.numProgram = 2;
_parent.numState = CGame.STATE_MISSION;
}
Symbol 647 MovieClip [id_mcOptionsScreen] Frame 1
stop();
Symbol 647 MovieClip [id_mcOptionsScreen] Frame 2
stop();
Symbol 663 MovieClip [id_map] Frame 1
#initclip 45
Object.registerClass("id_map", CMap);
#endinitclip
Symbol 670 MovieClip [id_cursor] Frame 1
#initclip 46
Object.registerClass("id_cursor", CCursor);
#endinitclip
Symbol 671 MovieClip [id_mapLayer] Frame 1
#initclip 47
Object.registerClass("id_mapLayer", CMap);
#endinitclip
Symbol 672 MovieClip [id_layer] Frame 1
#initclip 48
Object.registerClass("id_layer", CLayer);
#endinitclip
Symbol 696 MovieClip Frame 1
stop();
Symbol 697 MovieClip [dmSoundService] Frame 1
#initclip 49
Object.registerClass("dmSoundService", CSoundService);
#endinitclip
Symbol 701 MovieClip Frame 1
this._visible = false;
Symbol 710 Button
on (release) {
gameURL = ("http://www.miniclip.com/" + gamename) + ".htm";
getURL (gameURL, "_blank");
}
Symbol 712 MovieClip Frame 1
System.security.allowDomain("www.miniclip.com");
Instance of Symbol 701 MovieClip "mcHighscores" in Symbol 712 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 712 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 712 MovieClip Frame 3
stop();
Symbol 715 Button
on (release) {
CSoundService.playSound(Const.SND_SWITCH);
_parent.numState = CGame.STATE_MAINSCREEN;
}
Instance of Symbol 712 MovieClip "comHighscores" in Symbol 716 MovieClip [id_mcSaveScore] Frame 1
//component parameters
onClipEvent (construct) {
scoreLocation = "_root.mcGame.numScore";
gamename = "canyon";
saveScore = true;
scoreIsTime = false;
scoreReversed = false;
negativeScoreAllowed = false;
}
Instance of Symbol 712 MovieClip "comHighscores" in Symbol 717 MovieClip [id_mcViewScore] Frame 1
//component parameters
onClipEvent (construct) {
scoreLocation = "_root.mcGame.numScore";
gamename = "canyon";
saveScore = false;
scoreIsTime = false;
scoreReversed = false;
negativeScoreAllowed = false;
}