Frame 1
_global.masterDomain = "games.killerviral.com";
_global.assetsURL = "http://games.killerviral.com/sonicboomtown2/";
_global.isMaster = _root._url.indexOf(_global.masterDomain) >= 0;
_global.domain = ((_root._url.split("/")[0].indexOf("http") == -1) ? "Local" : (_root._url.split("/")[2].split("?")[0]));
_global.playerVersion = Number(getVersion().substr(getVersion().indexOf(" ") + 1).split(",")[0]);
_global.movieVersion = (_root.getSWFVersion ? (_root.getSWFVersion()) : 8);
_global.ori_dom = (_root.ori_dom ? (_root.ori_dom) : (domain));
_global.kvBannerClickId = 925;
System.security.allowDomain(_global.masterDomain);
var game_version = 3;
if (!testMode) {
stop();
if (playerVersion < 8) {
loadMovie (_global.assetsURL + "error.swf", _root);
} else if (isMaster) {
play();
} else {
var vc_lv = new LoadVars();
vc_lv.onLoad = function (success) {
clearInterval(tOIntId);
delete tOIntId;
if (success) {
if (Number(vc_lv.v) > game_version) {
loadMovie ((_global.assetsURL + "game.swf?ori_dom=") + ori_dom, _root);
} else {
play();
}
} else {
play();
}
delete vc_lv;
};
tOIntId = setInterval(timeout, 2000);
vc_lv.load("http://www.memecounter.com/comms/v.php?v=1&cId=209");
}
}
killerviral_btn.onMouseDown = function () {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
_root.kvClick(927);
}
};
Frame 2
function onEnterFrame() {
var _local2 = _root.getBytesLoaded() / _root.getBytesTotal();
if (_local2 == 1) {
delete onEnterFrame;
loader_mc._visible = false;
play();
} else {
loader_mc.setProgress(_local2);
}
}
if (!testMode) {
i = -16734;
createEmptyMovieClip("kv_mc", i);
kv_mc.kv_v = {c:209, td:"209.memecounter.com"};
System.security.allowDomain(kv_mc.kv_v.td);
kv_mc.kv_v.c_so = SharedObject.getLocal(kv_mc.kv_v.c, "/");
kv_mc.kv_v.d = (_root.ori_dom ? (_root.ori_dom) : (((_root._url.split("/")[0].indexOf("http") == -1) ? "Local" : (_root._url.split("/")[2].split("?")[0]))));
kv_mc.kv_v.fpv = getVersion().split(" ")[1].split(",")[0];
kv_mc.kv_v.lurl = ((((((((((("http://" + kv_mc.kv_v.td) + "/tracker.php") + "?c=") + kv_mc.kv_v.c) + "&r=") + Math.floor(Math.random() * 10000000000)) + "&d=") + kv_mc.kv_v.d) + "&u=") + (kv_mc.kv_v.c_so.data.u ? "1" : "")) + "&p=") + kv_mc.kv_v.fpv;
kv_mc.kv_v.c_so.data.u = true;
kv_mc.kv_v.c_so.flush();
kv_mc.kv_v.t_mc = kv_mc.createEmptyMovieClip("kv_tracker", i - 1);
kv_mc.kv_v.l_mcl = new MovieClipLoader();
if (kv_mc.kv_v.l_mcl.loadClip) {
kv_mc.kv_v.l_mcl.loadClip(kv_mc.kv_v.lurl, kv_mc.kv_v.t_mc);
} else {
loadMovie (kv_mc.kv_v.lurl, kv_mc.kv_v.t_mc);
}
}
stop();
Frame 3
_global.language = new Language();
_global.language.init(System.capabilities.language, (_global.testMode ? "" : (_global.assetsURL)) + "xml/language/");
Keys.init();
_global.selectedMission = (selectedMission = 1);
missionState = new Array();
missionState[1] = "unlocked";
missionState[2] = "locked";
missionState[3] = "locked";
missionState[4] = "locked";
missionState[5] = "locked";
missionState[6] = "locked";
missionState[7] = "locked";
missionState[8] = "locked";
_global.missionState = missionState;
if (!_global.upgradesLevels) {
upgradesLevels = {};
upgradesLevels.speed = 0;
upgradesLevels.acceleration = 0;
upgradesLevels.handling = 0;
upgradesLevels.ICEPower = 0;
upgradesLevels.ICEEfficiency = 0;
_global.upgradesLevels = upgradesLevels;
} else {
upgradesLevels = _global.upgradesLevels;
}
_global.ICEPower = 10;
_global.ICEEfficiency = 1;
_global.ICECharge = 2;
upgradeCost = {};
upgradeCost.speed = [100, 200, 300];
upgradeCost.acceleration = [100, 200, 300];
upgradeCost.handling = [100, 200, 300];
upgradeCost.ICEPower = [100, 200, 300];
upgradeCost.ICEEfficiency = [100, 200, 300];
_global.upgradeCost = upgradeCost;
carUpgrades = {};
carUpgrades.speed = [1, 1.1, 1.2, 1.3];
carUpgrades.acceleration = [1, 0.9, 0.8, 0.7];
carUpgrades.handling = [1, 1.15, 1.3, 1.45];
carUpgrades.ICEPower = [5, 8, 10, 15];
carUpgrades.ICEEfficiency = [3, 3, 3, 3];
carUpgrades.ICECharge = [1, 1.15, 1.3, 1.45, 1.6];
_global.carUpgrades = carUpgrades;
_global.sndman = new SoundManager(createEmptyMovieClip("sounds", getNextHighestDepth()));
_global.musicman = new SoundManager(createEmptyMovieClip("music", getNextHighestDepth()));
music_snd = _global.musicman.newSound(Game.ALTTHEME);
music_snd.setVolume(0);
music_snd.start();
music_snd.fadeTo(40, music_snd.duration / 1000);
onMusicComplete = function () {
startPage.gotoAndPlay("on");
_root.music_snd.attachSound(Game.THEME);
_root.music_snd.start(0, 9999999);
_root.changeMusic = true;
};
setTimeout(onMusicComplete, music_snd.duration - 150);
ICE.HEADUNITS.equipped = 1;
ICE.SPEAKERS.equipped = 1;
_root.car = "car1";
_root.groatsPerBuilding = 25;
_root.groatsPerBonusBuilding = 15;
_root.groatsPerSecond = 0.5;
_root.groats = 0;
_root.showHint = 0;
lvlsObj = {};
mapsObj = {};
tsObj = {};
stop();
if (testMode) {
}
Instance of Symbol 108 MovieClip in Frame 3
onClipEvent (load) {
Misc.playAtFrameRate(this, 25);
}
Frame 4
function changeMenu() {
if (changeMusic) {
changeMusic = false;
_root.music_snd.stop();
_root.music_snd.attachSound(Game.ALTTHEME);
_root.music_snd.start(0, 9999999);
}
gotoAndStop(nextMenu);
}
function wipeTo(f) {
nextMenu = f;
wipe.gotoAndPlay("wipe");
}
stop();
Frame 5
stop();
Instance of Symbol 424 MovieClip in Frame 5
/* no clip actions */
Instance of Symbol 121 MovieClip "mute" in Frame 5
onClipEvent (load) {
if (new Sound().getVolume() == 0) {
gotoAndStop ("off");
}
this.onRelease = function () {
if (new Sound().getVolume() == 0) {
gotoAndStop ("on");
_global.isMuted = false;
new Sound().setVolume(100);
} else {
gotoAndStop ("off");
_global.isMuted = true;
new Sound().setVolume(0);
}
};
}
Frame 6
stop();
Frame 7
wipe.handler = cust.Misc.Delegate.create(game, game.init, _root.mission, lvlsObj, mapsObj, tsObj);
stop();
Instance of Symbol 121 MovieClip "mute" in Frame 7
onClipEvent (load) {
if (new Sound().getVolume() == 0) {
gotoAndStop ("off");
}
this.onRelease = function () {
if (new Sound().getVolume() == 0) {
gotoAndStop ("on");
_global.isMuted = false;
new Sound().setVolume(100);
} else {
gotoAndStop ("off");
_global.isMuted = true;
new Sound().setVolume(0);
}
};
}
Instance of Symbol 528 MovieClip "begin_mc" in Frame 7
onClipEvent (load) {
displayMissionName = (language.mmenu_missionName + " ") + language[_root.mission + "_name"];
}
Frame 8
_global.missionState[_global.selectedMission] = "success";
if ((_global.selectedMission < (_global.missionState.length - 1)) || (completed)) {
_global.selectedMission++;
if (_global.missionState[_global.selectedMission] == "locked") {
_global.missionState[_global.selectedMission] = "unlocked";
}
delete completed;
} else {
cutscene.gotoAndStop("completed");
}
_root.mission = "mission" + _global.selectedMission;
Game.save();
stop();
killerviral_btn.onMouseDown = function () {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
_root.kvClick(927);
}
};
Frame 9
stop();
cutscene.rootTarget = "menu";
Symbol 23 MovieClip Frame 1
function setProgress(p) {
bar._width = p * width;
preBuilding._y = preBuilding.startY + (p * preBuilding._height);
preCar._x = preCar.startX + (p * 178);
}
width = 200;
if (this._name == "loader_mc") {
myName = _global.language.loadingAssets;
} else {
myName = _global.language.initLevel;
}
setProgress(0);
Instance of Symbol 9 MovieClip "preBuilding" in Symbol 23 MovieClip Frame 1
onClipEvent (load) {
startY = _y;
}
Instance of Symbol 22 MovieClip "preCar" in Symbol 23 MovieClip Frame 1
onClipEvent (load) {
startX = _x;
}
Symbol 32 MovieClip [buildingLife] Frame 1
#initclip 73
Object.registerClass("buildingLife", BuildingLifeBar);
#endinitclip
Symbol 42 MovieClip [Dust 4x3 1] Frame 1
#initclip 56
Object.registerClass("Dust 4x3 1", SmokePuff);
#endinitclip
Symbol 43 MovieClip [Dust 4x3 2] Frame 1
#initclip 57
Object.registerClass("Dust 4x3 2", SmokePuff);
#endinitclip
Symbol 44 MovieClip [Dust 4x3 3] Frame 1
#initclip 58
Object.registerClass("Dust 4x3 3", SmokePuff);
#endinitclip
Symbol 45 MovieClip [Dust 4x4 1] Frame 1
#initclip 59
Object.registerClass("Dust 4x4 1", SmokePuff);
#endinitclip
Symbol 46 MovieClip [Dust 6x3 1] Frame 1
#initclip 60
Object.registerClass("Dust 6x3 1", SmokePuff);
#endinitclip
Symbol 47 MovieClip [Dust 6x3 2] Frame 1
#initclip 61
Object.registerClass("Dust 6x3 2", SmokePuff);
#endinitclip
Symbol 48 MovieClip [Dust 6x3 3] Frame 1
#initclip 62
Object.registerClass("Dust 6x3 3", SmokePuff);
#endinitclip
Symbol 49 MovieClip [Dust 6x3 4] Frame 1
#initclip 63
Object.registerClass("Dust 6x3 4", SmokePuff);
#endinitclip
Symbol 50 MovieClip [Dust 6x3 5] Frame 1
#initclip 64
Object.registerClass("Dust 6x3 5", SmokePuff);
#endinitclip
Symbol 51 MovieClip [Dust 6x6 1] Frame 1
#initclip 65
Object.registerClass("Dust 6x6 1", SmokePuff);
#endinitclip
Symbol 57 MovieClip Frame 1
stop();
Symbol 60 MovieClip [point] Frame 2
this.removeMovieClip();
Symbol 64 MovieClip [car5] Frame 1
#initclip 66
Object.registerClass("car5", CarCalibra);
#endinitclip
Symbol 64 MovieClip [car5] Frame 2
stop();
Symbol 64 MovieClip [car5] Frame 3
stop();
Symbol 64 MovieClip [car5] Frame 4
stop();
Symbol 68 MovieClip [car4] Frame 1
#initclip 67
Object.registerClass("car4", CarCRX);
#endinitclip
Instance of Symbol 57 MovieClip "boom" in Symbol 68 MovieClip [car4] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 68 MovieClip [car4] Frame 2
stop();
Symbol 68 MovieClip [car4] Frame 3
stop();
Symbol 68 MovieClip [car4] Frame 4
stop();
Symbol 76 MovieClip [car2] Frame 1
#initclip 68
Object.registerClass("car2", CarMini);
#endinitclip
Symbol 76 MovieClip [car2] Frame 2
stop();
Symbol 76 MovieClip [car2] Frame 3
stop();
Symbol 76 MovieClip [car2] Frame 4
stop();
Symbol 81 MovieClip [car3] Frame 1
#initclip 69
Object.registerClass("car3", CarSaxo);
#endinitclip
Symbol 81 MovieClip [car3] Frame 2
stop();
Symbol 81 MovieClip [car3] Frame 3
stop();
Symbol 81 MovieClip [car3] Frame 4
stop();
Symbol 85 MovieClip [car1] Frame 1
#initclip 70
Object.registerClass("car1", CarSilvia);
#endinitclip
n = new Array();
Symbol 85 MovieClip [car1] Frame 2
stop();
stop();
Symbol 85 MovieClip [car1] Frame 3
this.startSkid = true;
stop();
Symbol 85 MovieClip [car1] Frame 4
this.startSkid = true;
stop();
Symbol 94 MovieClip [textArea] Frame 1
#initclip 71
Object.registerClass("textArea", TextArea);
#endinitclip
Symbol 95 MovieClip [textAreaScroller] Frame 1
#initclip 72
Object.registerClass("textAreaScroller", TextAreaScroller);
#endinitclip
Symbol 98 MovieClip [text_scroller_bar] Frame 1
stop();
Symbol 103 MovieClip Frame 1
stop();
Instance of Symbol 32 MovieClip [buildingLife] "life" in Symbol 103 MovieClip Frame 2
onClipEvent (load) {
_parent._parent.setBvars(this);
}
onClipEvent (enterFrame) {
_parent._parent.moveBar(this);
}
Symbol 108 MovieClip Frame 58
_parent.play();
Symbol 613 MovieClip [__Packages.Game] Frame 0
class Game extends MovieClip
{
var test, lang, sndMan, musicMan, musicSnd, _parent, keys, assetsURL, createEmptyMovieClip, getNextHighestDepth, bitmapManager, viewRect, levels, maps, tileSets, lvlLoadStatus, mapLoadStatus, tileSetLoadStatus, attachMovie, car_holder, elapsedTime, onEnterFrame, level, area, car, gui, lvlPerf, prevTime;
function Game () {
super();
test = _global.testMode;
lang = _global.language;
sndMan = _global.sndman;
musicMan = _global.musicman;
musicSnd = _parent.music_snd;
keys = [];
if ((_root._url.indexOf("http") == -1) && (test)) {
assetsURL = "";
} else {
assetsURL = _global.assetsURL;
}
var _local5 = createEmptyMovieClip("bitmapManager", getNextHighestDepth());
_local5._visible = false;
bitmapManager = new BitmapManager(_local5, assetsURL);
viewRect = new flash.geom.Rectangle(0, 0, viewWindowWidth, viewWindowHeight);
}
function init(lvlName, lvlObj, mapObj, tsObj) {
levels = lvlObj;
maps = mapObj;
tileSets = tsObj;
lvlLoadStatus = (mapLoadStatus = (tileSetLoadStatus = 0));
getLevel(lvlName);
_root.loader_mc._visible = (_root.parser._visible = true);
_root.parser_mc.setProgress(0);
attachMovie(_root.car, "car", car_holder.getDepth(), {_x:1000, _y:-1000});
elapsedTime = 0;
onEnterFrame = assetsLoading;
}
function setError(errorMsg) {
_root.errors_txt.text = _root.errors_txt.text + (errorMsg + newline);
}
function assetsLoading() {
if (((lvlLoadStatus == 1) && (mapLoadStatus == 1)) && (tileSetLoadStatus == 1)) {
delete onEnterFrame;
_root.loader_mc.setProgress(1);
level.map.beginParseMapString();
} else {
var _local3 = ((lvlLoadStatus / 8) + (mapLoadStatus / 8)) + (tileSetLoadStatus * 0.75);
_root.loader_mc.setProgress(_local3);
}
}
function assetsLoaded() {
area.init(this, level);
}
function assetsParsed() {
_root.loader_mc._visible = false;
_root.parser_mc._visible = false;
_root.instructions.gotoAndPlay("loaded");
Keys.addEventListener("onKeyUp", cust.Misc.Delegate.create(this, beginGame), 32);
Keys.addEventListener("onKeyDown", cust.Misc.Delegate.create(this, beginGame), Car.CONTROLS.UP);
car.init(this, level);
gui.init(this);
viewRect.x = car.x - (viewRect.width / 2);
viewRect.y = car.y - (viewRect.height / 2);
car._x = car.x - viewRect.x;
car._y = car.y - viewRect.y;
car._rotation = (car.ang * 57.2957795130823) + 90;
area.scrollTo(viewRect);
}
function beginGame() {
lvlPerf = new cust.tiles.MissionPerformance(this, level);
prevTime = getTimer();
Keys.removeEventListeners("onKeyUp");
Keys.removeEventListeners("onKeyDown");
musicSnd.stop();
musicSnd.attachSound(THEME);
musicSnd.start(0, 99999999);
_root.begin_mc.play();
_root.instructions.gotoAndStop(HIDE);
gui.msg_mc.addMsg("GO!");
onEnterFrame = gameLoop;
}
function gameLoop() {
var _local3 = getTimer();
if (!_isPaused) {
elapsedTime = elapsedTime + (_local3 - prevTime);
var _local2 = (_local3 - prevTime) / 1000;
car.update(_local2);
var _local6 = (viewRect.width / 2) - leadPadding;
var _local7 = (viewRect.height / 2) - leadPadding;
var _local12 = viewDamping * (1 / (_local2 * 100));
var _local11 = ((car.speed * Math.cos(car.dir)) / car.maxSpeed) * _local6;
var _local10 = ((car.speed * Math.sin(car.dir)) / car.maxSpeed) * _local7;
var _local5 = oOffX + ((_local11 - oOffX) / viewDamping);
var _local4 = oOffY + ((_local10 - oOffY) / viewDamping);
var _local9 = viewRect.width / 2;
var _local8 = viewRect.height / 2;
viewRect.x = (car.x + _local5) - _local9;
viewRect.y = (car.y + _local4) - _local8;
oOffX = _local5;
oOffY = _local4;
area.scrollTo(viewRect);
car._x = car.x - viewRect.x;
car._y = car.y - viewRect.y;
lvlPerf.update(_local2);
gui.update(_local2, lvlPerf.getTarget(car.x, car.y));
}
prevTime = _local3;
if (Key.isDown(PAUSE_KEY) && (!keys[PAUSE_KEY])) {
keys[PAUSE_KEY] = true;
pause();
} else if ((!Key.isDown(PAUSE_KEY)) && (keys[PAUSE_KEY])) {
keys[PAUSE_KEY] = false;
}
}
function pause() {
_isPaused = !_isPaused;
}
function showMessage(id) {
gui.msg_mc.addMsg(lang[id]);
}
function gameOver(reason) {
showMessage("game_over_" + reason);
gui.gameover();
takeInput = false;
var _local4;
switch (reason) {
case TIME_OUT :
case DESTROYED_AVOID :
case OUT_OF_ORDER :
_local4 = FAILURE;
break;
case COMPLETE :
_local4 = SUCCESS;
_root.kvEvent(KV_EVENT_COMPLETE_LEVEL + Number(_global.selectedMission));
}
lvlPerf.missionOver(elapsedTime);
musicSnd.setVolume(40);
_global.setTimeout(this, "gotoToResults", 2000, _local4);
}
function gotoToResults(p) {
musicSnd.stop();
musicSnd.attachSound(ALTTHEME);
musicSnd.start(0, 99999999);
_parent.gotoAndStop(p);
}
function getLevel(name) {
if (levels[name].loadStatus == XMLSource.COMPLETE) {
gotLevel(levels[name]);
} else {
levels[name] = new cust.tiles.Level(this, ((assetsURL + LEVELS) + name) + ".xml");
lvlLoadStatus = 0;
return(false);
}
}
function gotLevel(lvl) {
lvlLoadStatus = 1;
levels[lvl.name] = lvl;
level = lvl;
getMap(lvl.mapName);
}
function getMap(name) {
if (maps[name].loadStatus == XMLSource.COMPLETE) {
gotMap(maps[name]);
} else {
maps[name] = new cust.tiles.Map(this, ((assetsURL + MAPS) + name) + ".xml");
mapLoadStatus = 0;
return(false);
}
}
function gotMap(m) {
mapLoadStatus = 1;
maps[m.name] = m;
level.map = m;
getTileSet(m.tilesetName);
}
function getTileSet(name) {
if (tileSets[name].loadStatus == XMLSource.COMPLETE) {
gotTileSet(tileSets[name]);
} else {
tileSets[name] = new cust.tiles.TileSet(this, ((assetsURL + TILESETS) + name) + ".xml");
tileSetLoadStatus = 0;
return(false);
}
}
function gotTileSet(ts) {
tileSetLoadStatus = 1;
tileSets[ts.name] = ts;
level.map.tileset = ts;
}
static function save() {
var _local3 = SharedObject.getLocal("savegame", "/");
_local3.data.ice = ICE.toString();
_local3.data.groats = _root.groats;
_local3.data.missionState = _global.missionState;
_local3.data.mission = _global.selectedMission;
_local3.data.upgradesLevels = _global.upgradesLevels;
_local3.flush();
}
static function load() {
var _local3 = SharedObject.getLocal("savegame", "/");
if (_local3.data.missionState) {
ICE.fromString(_local3.data.ice);
_root.groats = _local3.data.groats;
_global.missionState = _local3.data.missionState;
_global.selectedMission = _local3.data.mission;
_root.mission = "mission" + _local3.data.mission;
_global.upgradesLevels = _local3.data.upgradesLevels;
}
}
static function hasSaveGame() {
var _local1 = SharedObject.getLocal("savegame", "/");
return(Boolean(_local1.data.missionState));
}
var viewDamping = 10;
var leadPadding = 100;
var oOffX = 0;
var oOffY = 0;
var _isPaused = false;
var takeInput = true;
static var LEVELS = "xml/levels/";
static var MAPS = "xml/maps/";
static var TILESETS = "xml/tilesets/";
static var viewWindowWidth = 500;
static var viewWindowHeight = 420;
static var COMPLETE = "complete";
static var TIME_OUT = "time_out";
static var DESTROYED_AVOID = "destroyed_avoid";
static var OUT_OF_ORDER = "out_of_order";
static var PAUSE_KEY = 80;
static var SUCCESS = "success";
static var FAILURE = "failure";
static var SHOW = "show";
static var HIDE = "hide";
static var THEME = "theme";
static var ALTTHEME = "alttheme";
static var KV_EVENT_COMPLETE_LEVEL = 1903;
}
Symbol 614 MovieClip [__Packages.cust.tiles.Area] Frame 0
class cust.tiles.Area extends MovieClip
{
var game, level, cols, rows, width, height, tiles, createEmptyMovieClip, overlay, scrollRect, visibleTiles;
function Area () {
super();
}
function init(g, lvl) {
reset();
game = g;
level = lvl;
cols = lvl.map.cols;
rows = lvl.map.rows;
width = cols * tWidth;
height = rows * tHeight;
var _local2 = {x:0, y:0, i:0};
_local2.intId = setInterval(cust.Misc.Delegate.create(this, initing), 1, _local2);
}
function initing(args) {
var _local11 = level.map.a;
var _local4 = args.x;
var _local3 = args.y;
var _local6;
var _local5;
var _local9;
var _local7;
var _local10;
var _local12 = 0;
while (_local4 < _local11.length) {
while (_local3 < _local11[_local4].length) {
if (_local11[_local4][_local3] != undefined) {
_local7 = level.map.tileset[_local11[_local4][_local3]];
if (_local7.isMultiTile) {
_local10 = new cust.tiles.MasterTile(this, _local7, _local4, _local3);
_local10.__set__health((_local10.maxHealth = level.defaultBuildingHealth));
_local6 = 0;
while (_local6 < _local7.width) {
_local5 = 0;
while (_local5 < _local7.height) {
_local9 = getTileDepth(_local4 + _local6, _local3 + _local5);
tiles[_local9] = new cust.tiles.SubTile(this, _local4 + _local6, _local3 + _local5, _local10, _local6, _local5);
_local5++;
}
_local6++;
}
_local10.setType(_local7);
} else {
_local9 = getTileDepth(_local4, _local3);
tiles[_local9] = new cust.tiles.SingleTile(this, _local7, _local4, _local3);
}
}
if ((_local12++) > TILES_PER_ITERATION) {
args.x = _local4;
args.y = _local3 % rows;
if (args.y == 0) {
args.x++;
}
args.i = args.i + _local12;
_root.parser_mc.setProgress(0.5 + ((args.i / (cols * rows)) * 0.5));
return(undefined);
}
_local3++;
}
_local3 = 0;
_local4++;
}
clearInterval(args.intId);
inited();
}
function inited() {
createEmptyMovieClip("overlay", getTileDepth(cols, rows) + 1);
var _local2;
var _local3;
_local2 = 0;
while (_local2 < level.targets.length) {
_local3 = getTileAt(level.targets[_local2].x, level.targets[_local2].y);
_local3.status = cust.tiles.Tile.TARGET;
_local3.health = (_local3.maxHealth = level.targets[_local2].health);
_local2++;
}
_local2 = 0;
while (_local2 < level.avoid.length) {
_local3 = getTileAt(level.avoid[_local2].x, level.avoid[_local2].y);
_local3.status = cust.tiles.Tile.AVOID;
_local3.health = (_local3.maxHealth = level.avoid[_local2].health);
_local2++;
}
_local2 = 0;
while (_local2 < level.bonuses.length) {
_local3 = getTileAt(level.bonuses[_local2].x, level.bonuses[_local2].y);
_local3.status = cust.tiles.Tile.BONUS;
_local3.health = (_local3.maxHealth = level.bonuses[_local2].health);
_local2++;
}
_local2 = tiles.length - 1;
while (_local2 > -1) {
tiles[_local2].init();
_local2--;
}
game.assetsParsed();
}
function reset() {
var _local2 = tiles.length - 1;
while (_local2 > -1) {
tiles[_local2].die();
_local2--;
}
overlay.removeMovieClip();
delete overlay;
tiles = [];
}
function scrollTo(rect) {
rect.x = ((rect.x <= 0) ? 0 : ((((rect.x + rect.width) > width) ? (width - rect.width) : (rect.x))));
rect.y = ((rect.y <= 0) ? 0 : ((((rect.y + rect.height) > height) ? (height - rect.height) : (rect.y))));
scrollRect = rect;
var _local3 = getTilesInRect(rect);
var _local2;
for (_local2 in _local3) {
if (visibleTiles[_local2]) {
delete visibleTiles[_local2];
} else {
_local3[_local2].showTile();
}
if (_local3[_local2].masterTile) {
if (_local3[_local2].masterTile.lifeBar) {
_local3[_local2].masterTile.lifeBar.update(game.car);
}
}
}
for (_local2 in visibleTiles) {
visibleTiles[_local2].hideTile();
}
visibleTiles = _local3;
}
function getTilesInRect(rect, block) {
var _local7 = {};
var _local9 = Math.floor(rect.x / tWidth);
var _local8 = Math.ceil((rect.x + rect.width) / tWidth);
var _local6 = Math.floor(rect.y / tHeight);
var _local5 = Math.ceil((rect.y + rect.height) / tHeight);
_local9 = ((_local9 <= 0) ? 0 : (((_local9 > cols) ? (cols) : (_local9))));
_local6 = ((_local6 <= 0) ? 0 : (((_local6 > rows) ? (rows) : (_local6))));
_local8 = ((_local8 <= 0) ? 0 : (((_local8 > cols) ? (cols) : (_local8))));
_local5 = ((_local5 <= 0) ? 0 : (((_local5 > rows) ? (rows) : (_local5))));
var _local3;
var _local2;
var _local4;
_local3 = _local9;
while (_local3 < _local8) {
_local2 = _local6;
for ( ; _local2 < _local5 ; _local2++) {
_local4 = getTileAt(_local3, _local2);
if (block) {
if (!_local4.block) {
continue;
}
} else {
_local7[(("t" + _local3) + "-") + _local2] = _local4;
}
}
_local3++;
}
return(_local7);
}
function getTilesInCircle(c) {
var _local6 = [];
var _local9;
var _local7;
var _local2;
var _local8;
var _local10 = tWidth / 2;
var _local4 = tHeight / 2;
var _local12 = (Math.ceil(((c.x - c.r) - _local10) / tWidth) * tWidth) + _local10;
var _local11 = (Math.floor(((c.x + c.r) - _local10) / tWidth) * tWidth) + _local10;
var _local3 = _local12;
while (_local3 <= _local11) {
_local8 = c.r * Math.sin(Math.acos((_local3 - c.x) / c.r));
_local9 = (Math.ceil(((c.y - _local8) - _local4) / tHeight) * tHeight) + _local4;
_local7 = (Math.floor(((c.y + _local8) - _local4) / tHeight) * tHeight) + _local4;
_local2 = _local9;
while (_local2 <= _local7) {
_local6[_local6.length] = getTileAt((_local3 - _local10) / tWidth, (_local2 - _local4) / tHeight);
_local2 = _local2 + tHeight;
}
_local3 = _local3 + tWidth;
}
return(_local6);
}
function getTileAt(x, y) {
if (x < 0) {
return(undefined);
}
if (x >= cols) {
return(undefined);
}
if (y < 0) {
return(undefined);
}
if (y >= rows) {
return(undefined);
}
return(tiles[(x * rows) + y]);
}
function getTileAtCoords(x, y) {
x = Math.floor(x / tWidth);
y = Math.floor(y / tHeight);
if (x < 0) {
return(undefined);
}
if (x >= cols) {
return(undefined);
}
if (y < 0) {
return(undefined);
}
if (y >= rows) {
return(undefined);
}
return(tiles[(x * rows) + y]);
}
function getTileDepth(x, y) {
return((x * rows) + y);
}
var tWidth = 45;
var tHeight = 45;
static var TILES_PER_ITERATION = 500;
}
Symbol 615 MovieClip [__Packages.XMLSource] Frame 0
class XMLSource
{
var loadStatus, prog, xml, file, onLoad, onLoadError, intId, parse;
function XMLSource (file, onload, onloaderror) {
loadStatus = "loading";
prog = 0;
xml = new XML();
xml.ignoreWhite = true;
xml.onLoad = cust.Misc.Delegate.create(this, onXMLLoad);
this.file = file;
xml.load(file);
onLoad = onload;
onLoadError = onloaderror;
_global.ASSetPropFlags(this, "onLoad", 1);
intId = setInterval(this, "monitorProgress", 50);
}
function onXMLLoad(success) {
if (intId) {
clearInterval(intId);
delete intId;
prog = 1;
}
if (success) {
loadStatus = COMPLETE;
xml.loaded = true;
parse();
onLoad();
} else if ((attempts++) < RETRIES) {
xml.load(file);
} else {
loadStatus = ERROR;
}
}
function monitorProgress() {
prog = xml.getBytesLoaded() / xml.getBytesTotal();
if (prog == 1) {
clearInterval(intId);
delete intId;
}
}
var attempts = 0;
static var RETRIES = 3;
static var COMPLETE = "complete";
static var ERROR = "error";
}
Symbol 616 MovieClip [__Packages.cust.Misc.Delegate] Frame 0
class cust.Misc.Delegate
{
function Delegate () {
}
static function create(target, handler) {
var _local3 = arguments.slice(2);
var _local2 = function () {
return(arguments.callee.handler.apply(arguments.callee.target, arguments.concat(arguments.callee.extraArgs)));
};
_local2.extraArgs = _local3;
_local2.handler = handler;
_local2.target = target;
return(_local2);
}
}
Symbol 617 MovieClip [__Packages.cust.tiles.Level] Frame 0
class cust.tiles.Level extends XMLSource
{
var game, targets, avoid, bonuses, xml, name, startX, startY, startA, difficulty, missionType, pointerType, parTime, mapName;
function Level (g, file) {
super(file, onLoad, onLoadError);
game = g;
targets = [];
avoid = [];
bonuses = [];
_global.ASSetPropFlags(this, null, 1);
}
function parse() {
var _local5 = xml.firstChild;
name = _local5.attributes.name;
startX = Number(_local5.attributes.startX);
startY = Number(_local5.attributes.startY);
startA = Number(_local5.attributes.startA) - 90;
if (_local5.attributes.defaultBuildingHealth) {
defaultBuildingHealth = Number(_local5.attributes.defaultBuildingHealth);
}
difficulty = Number(_local5.attributes.difficulty);
missionType = _local5.attributes.missionType;
pointerType = _local5.attributes.pointerType;
parTime = Number(_local5.attributes.parTime);
mapName = _local5.attributes.mapName;
var _local2;
var _local3;
var _local4 = 0;
while (_local4 < _local5.childNodes.length) {
_local3 = _local5.childNodes[_local4];
switch (_local3.nodeName) {
case TARGETS :
_local2 = 0;
while (_local2 < _local3.childNodes.length) {
targets[targets.length] = new cust.tiles.Target(_local3.childNodes[_local2]);
_local2++;
}
break;
case AVOID :
_local2 = 0;
while (_local2 < _local3.childNodes.length) {
avoid[avoid.length] = new cust.tiles.Avoid(_local3.childNodes[_local2]);
_local2++;
}
break;
case BONUS :
_local2 = 0;
for(;;){
if (_local2 >= _local3.childNodes.length) {
break;
}
bonuses[bonuses.length] = new cust.tiles.Bonus(_local3.childNodes[_local2]);
_local2++;
};
}
_local4++;
}
}
function onLoad() {
game.gotLevel(this);
}
function onLoadError() {
}
var defaultBuildingHealth = 2500;
static var TARGETS = "targets";
static var AVOID = "avoid";
static var BONUS = "bonus";
static var ORDERED = "ordered";
static var STANDARD = "standard";
}
Symbol 618 MovieClip [__Packages.cust.tiles.Map] Frame 0
class cust.tiles.Map extends XMLSource
{
var game, xml, name, tilesetName, a, cols, rows;
function Map (g, path) {
super(path, onLoad, onLoadError);
game = g;
}
function parse() {
var _local2 = xml.firstChild;
name = _local2.attributes.name;
tilesetName = _local2.attributes.tileset;
}
function beginParseMapString() {
if (a) {
game.assetsLoaded();
} else {
var _local3 = xml.firstChild;
if (_local3.attributes.compressed == "true") {
var _local2 = new cust.Misc.LZW();
_local2.addEventListener(cust.Misc.LZW.PROGRESS, cust.Misc.Delegate.create(this, setProgress, 0.25, 0));
_local2.addEventListener(cust.Misc.LZW.COMPLETE, cust.Misc.Delegate.create(this, decompressionComplete));
_local2.beginDecompress(_local3.firstChild.nodeValue);
} else {
parseMapString(_local3.firstChild.nodeValue, false);
}
}
}
function setProgress(obj, w, b) {
_root.parser_mc.setProgress(b + (obj.value * w));
}
function decompressionComplete(obj) {
parseMapString(obj.result, true);
}
function parseMapString(str, compressed) {
a = [];
var _local2 = {str:str, compressed:compressed};
_local2.row = 0;
_local2.r = 0;
_local2.intId = setInterval(this, "parsingMapString", 1, _local2);
}
function parsingMapString(args) {
var _local7;
var _local5;
var _local8;
var _local4;
var _local3;
var _local6 = 0;
var _local9 = 0;
while ((args.r < args.str.length) && ((_local9++) < ROWS_PER_ITERATION)) {
_local8 = args.str.indexOf(ROW_SEPARATOR, args.r);
_local8 = ((_local8 == -1) ? (args.str.length) : (_local8));
_local7 = args.str.substring(args.r, _local8);
args.r = _local8 + 1;
_local4 = 0;
while (_local6 < _local7.length) {
_local3 = _local7.indexOf(COL_SEPARATOR, _local6);
_local3 = ((_local3 == -1) ? (_local7.length) : (_local3));
_local5 = _local7.substring(_local6, _local3);
a[_local4] = (a[_local4] ? (a[_local4]) : ([]));
if (((_local5 != "") && (_local5 != " ")) && (_local5 != " ")) {
a[_local4][args.row] = _local5;
}
_local6 = _local3 + 1;
_local4++;
}
_local6 = 0;
args.row++;
}
if (args.r >= args.str.length) {
clearInterval(args.intId);
cols = _local4;
rows = args.row;
game.assetsLoaded();
} else if (args.compressed) {
setProgress({value:args.r / args.str.length}, 0.25, 0.25);
} else {
setProgress({value:args.r / args.str.length}, 0.5, 0);
}
}
function onLoad() {
game.gotMap(this);
}
function onLoadError() {
}
static var ROWS_PER_ITERATION = 1;
static var ROW_SEPARATOR = ";";
static var COL_SEPARATOR = ",";
}
Symbol 619 MovieClip [__Packages.cust.tiles.TileSet] Frame 0
class cust.tiles.TileSet extends XMLSource
{
var game, xml, name, path, imagesToLoad, intId;
function TileSet (g, file) {
super(file, onLoad, onLoadError);
game = g;
_global.ASSetPropFlags(this, null, 1);
}
function parse() {
var _local4 = xml.firstChild;
var _local3;
name = _local4.attributes.name;
path = _local4.attributes.path;
var _local2 = 0;
while (_local2 < _local4.childNodes.length) {
_local3 = _local4.childNodes[_local2];
this[_local3.attributes.id] = cust.tiles.TileType.fromXML(game, _local3, path);
_local2++;
}
imagesToLoad = game.bitmapManager.tilesInProgress;
}
function checkStatus() {
var _local2 = (imagesToLoad - game.bitmapManager.__get__tilesInProgress()) / imagesToLoad;
game.tileSetLoadStatus = _local2;
if (_local2 == 1) {
clearInterval(intId);
delete intId;
game.gotTileSet(this);
}
}
function onLoad() {
intId = setInterval(this, "checkStatus", INT_WAIT);
}
function onLoadError() {
}
static var INT_WAIT = 100;
}
Symbol 620 MovieClip [__Packages.cust.tiles.TileType] Frame 0
class cust.tiles.TileType
{
var id, imgPath, game, deathAnims, bmp, bmpPieces;
function TileType (g, id, ip, b, w, h) {
this.id = id;
imgPath = ip;
block = b;
game = g;
width = (w ? (w) : (width));
height = (h ? (h) : (height));
if ((width > 1) || (height > 1)) {
isMultiTile = true;
}
var _local2;
_local2 = game.bitmapManager.getBitmap(imgPath);
if (!_local2) {
game.bitmapManager.addCallback(this, imgPath, BitmapManager.LOAD);
game.bitmapManager.addCallback(game, imgPath, BitmapManager.ERROR);
} else {
bitmapLoaded(_local2);
}
deathAnims = [];
}
function bitmapLoaded(rawbmp) {
if (((sx == 1) && (sy == 1)) && (imgAng == 0)) {
bmp = rawbmp;
} else {
if ((imgAng % 180) == 90) {
bmp = new flash.display.BitmapData(rawbmp.height, rawbmp.width, false, 0);
} else {
bmp = new flash.display.BitmapData(rawbmp.width, rawbmp.height, false, 0);
}
var _local7 = new flash.geom.Matrix();
_local7.translate((-rawbmp.width) / 2, (-rawbmp.height) / 2);
if (imgAng != 0) {
_local7.rotate(imgAng * (Math.PI/180));
}
if ((sx != 1) || (sy != 1)) {
_local7.scale(sx, sy);
}
_local7.translate(bmp.width / 2, bmp.height / 2);
bmp.draw(rawbmp, _local7);
}
if (isMultiTile) {
bmpPieces = [];
var _local2 = new flash.geom.Rectangle(0, 0, game.area.tWidth, game.area.tHeight);
var _local4;
var _local3;
var _local5;
_local4 = 0;
while (_local4 < width) {
_local3 = 0;
while (_local3 < height) {
_local5 = new flash.display.BitmapData(_local2.width, _local2.height, false, Math.random() * 16777215);
_local2.x = _local4 * _local2.width;
_local2.y = _local3 * _local2.height;
_local5.copyPixels(bmp, _local2, ORIGIN);
bmpPieces[(_local4 * height) + _local3] = _local5;
_local3++;
}
_local4++;
}
}
}
function getBmpSlice(x, y) {
return(bmpPieces[(x * height) + y]);
}
function getDeathAnim() {
return(Rand.value.apply(null, deathAnims));
}
function toString() {
return(Debug.list(this));
}
static function fromXML(g, xmlnode, path) {
var _local3 = new cust.tiles.TileType(g, xmlnode.attributes.id, path + xmlnode.attributes.imgPath, xmlnode.attributes.block === "true", Number(xmlnode.attributes.tx), Number(xmlnode.attributes.ty));
if (xmlnode.attributes.imgAng != undefined) {
_local3.imgAng = Number(xmlnode.attributes.imgAng);
}
if (xmlnode.attributes.destroyed != undefined) {
_local3.destroyed = xmlnode.attributes.destroyed;
}
if (xmlnode.attributes.grip) {
_local3.grip = Number(xmlnode.attributes.grip);
}
if (xmlnode.attributes.sx) {
_local3.sx = Number(xmlnode.attributes.sx);
}
if (xmlnode.attributes.sy) {
_local3.sy = Number(xmlnode.attributes.sy);
}
var _local1 = 0;
while (_local1 < xmlnode.childNodes.length) {
_local3.deathAnims.push(String(xmlnode.childNodes[_local1].attributes.linkage));
_local1++;
}
return(_local3);
}
var grip = 1;
var block = true;
var imgAng = 0;
var width = 1;
var height = 1;
var isMultiTile = false;
var sx = 1;
var sy = 1;
static var ORIGIN = new flash.geom.Point(0, 0);
}
Symbol 621 MovieClip [__Packages.BitmapManager] Frame 0
class BitmapManager
{
var mcl, holder, assetsURL, callback, paths, attempts;
function BitmapManager (mc, asseturl) {
mcl = new MovieClipLoader();
holder = mc;
assetsURL = asseturl;
callback = {};
paths = {};
attempts = {};
mcl.addListener(this);
}
function addCallback(obj, path, type) {
if (!callback[path]) {
callback[path] = {};
callback[path][LOAD] = [];
callback[path][ERROR] = [];
}
callback[path][type].push(obj);
}
function getBitmap(path) {
if (this[path]) {
return(this[path]);
}
loadBitmap(path);
return(false);
}
function loadBitmap(path) {
if (!holder[path]) {
var _local2 = "img" + (++d);
var _local3 = holder.createEmptyMovieClip(_local2, d);
paths[_local2] = path;
mcl.loadClip(assetsURL + path, _local3);
_tilesInProgress++;
}
}
function onLoadInit(target) {
var _local3 = paths[target._name];
var _local4 = (this[_local3] = new flash.display.BitmapData(target._width, target._height, false, 0));
_local4.draw(target);
var _local2 = 0;
while (_local2 < callback[_local3][LOAD].length) {
callback[_local3][LOAD][_local2].bitmapLoaded(_local4);
_local2++;
}
target.removeMovieClip();
_tilesInProgress--;
}
function onLoadError(target, errorCode) {
if (!attempts[target._name]) {
attempts[target._name] = 0;
}
if ((++attempts[target._name]) < RETRIES) {
mcl.loadClip(assetsURL + paths[target._name], target);
} else {
var _local2 = 0;
while (_local2 < callback[paths[target._name]][ERROR].length) {
callback[paths[target._name]][ERROR][_local2].setError("Error: load error - please check your internet connection");
_local2++;
}
}
}
function get tilesInProgress() {
return(_tilesInProgress);
}
var d = 0;
var _tilesInProgress = 0;
static var RETRIES = 3;
static var LOAD = "load";
static var ERROR = "error";
}
Symbol 622 MovieClip [__Packages.Rand] Frame 0
class Rand
{
function Rand () {
}
static function midBias(min, max, i, p) {
min = (isNaN(min) ? 0 : (min));
max = (isNaN(max) ? 1 : (max));
i = (isNaN(i) ? 2 : (i + 1));
var _local3 = 0;
var _local1 = 0;
while (_local1 < i) {
_local3 = _local3 + ((v() * (max - min)) + min);
_local1++;
}
_local3 = _local3 / i;
if (p != undefined) {
p = 1 / Math.pow(10, p);
var _local7 = _local3 % p;
if (_local7 <= (p / 2)) {
_local3 = _local3 - _local7;
} else {
_local3 = _local3 + (p - _local7);
}
}
return(_local3);
}
static function minBias(min, max, i, p) {
min = (isNaN(min) ? 0 : (min));
max = (isNaN(max) ? 1 : (max));
i = (isNaN(i) ? 1 : (i));
var _local1 = ((1 - Math.pow(v(), 1 / (i + 1))) * (max - min)) + min;
if (p != undefined) {
p = 1 / Math.pow(10, p);
var _local3 = _local1 % p;
if (_local3 <= (p / 2)) {
_local1 = _local1 - _local3;
} else {
_local1 = _local1 + (p - _local3);
}
}
return(_local1);
}
static function maxBias(min, max, i, p) {
min = (isNaN(min) ? 0 : (min));
max = (isNaN(max) ? 1 : (max));
i = (isNaN(i) ? 1 : (i));
var _local1 = (Math.pow(v(), 1 / (i + 1)) * (max - min)) + min;
if (p != undefined) {
p = 1 / Math.pow(10, p);
var _local3 = _local1 % p;
if (_local3 <= (p / 2)) {
_local1 = _local1 - _local3;
} else {
_local1 = _local1 + (p - _local3);
}
}
return(_local1);
}
static function value() {
if (arguments.length > 0) {
var _local2 = v() * arguments.length;
_local2 = _local2 - (_local2 % 1);
return(arguments[_local2]);
}
}
static function get number() {
return(v());
}
static function random(min, max, p) {
min = (isNaN(min) ? 0 : (min));
max = (isNaN(max) ? 1 : (max));
if (!isNaN(p)) {
p = 1 / Math.pow(10, p);
max = max + p;
} else {
}
var _local3 = (v() * (max - min)) + min;
if (p) {
_local3 = _local3 - (_local3 % p);
}
return(_local3);
}
static var v = Math.random;
}
Symbol 623 MovieClip [__Packages.Debug] Frame 0
class Debug
{
function Debug () {
}
static function each(obj) {
var _local2 = "";
for (var _local3 in obj) {
_local2 = _local2 + (((_local3 + ": ") + obj[_local3]) + newline);
}
return(_local2);
}
static function list(obj, recursive, lvl) {
var _local4 = "";
lvl = (isNaN(lvl) ? 0 : (lvl));
var _local3 = "";
var _local5 = 0;
while (_local5 < lvl) {
_local3 = _local3 + "\t";
_local5++;
}
if (obj instanceof Array) {
_local4 = _local4 + (("Array\n" + _local3) + "( ");
var _local8 = 0;
while (_local8 < obj.length) {
if (recursive && ((typeof(obj[_local8]) == "object") || (typeof(obj[_local8]) == "movieclip"))) {
_local4 = _local4 + ((("\n\t" + _local3) + arguments.callee(obj[_local8], true, lvl + 1)) + ",");
} else if (typeof(obj[_local8]) == "number") {
_local4 = _local4 + ((((("\n\t" + _local3) + _local8) + ": ") + obj[_local8]) + ",");
} else {
_local4 = _local4 + ((("\n\t" + _local3) + obj[_local8]) + ",");
}
_local8++;
}
_local4 = ((_local4.substr(0, _local4.length - 1) + newline) + _local3) + ")";
} else {
_local4 = _local4 + (((((typeof(obj) != "movieclip") ? "Object" : "MovieClip") + newline) + _local3) + "{ ");
for (var _local8 in obj) {
if (recursive && ((typeof(obj[_local8]) == "object") || (typeof(obj[_local8]) == "movieclip"))) {
_local4 = _local4 + ((((("\n\t" + _local3) + _local8) + ": ") + arguments.callee(obj[_local8], true, lvl + 1)) + ",");
} else if (typeof(obj[_local8]) == "number") {
_local4 = _local4 + ((((("\n\t" + _local3) + _local8) + ": ") + obj[_local8]) + ",");
} else {
_local4 = _local4 + ((((("\n\t" + _local3) + _local8) + ": ") + obj[_local8]) + ",");
}
}
_local4 = ((_local4.substr(0, _local4.length - 1) + newline) + _local3) + "}";
}
return(_local4);
}
}
Symbol 624 MovieClip [__Packages.cust.Misc.LZW] Frame 0
class cust.Misc.LZW
{
var intId, dispatchEvent;
function LZW () {
EventBroadcaster.initialize(this);
}
function beginCompress(str, xmlsafe) {
if (intId) {
clearInterval(intId);
}
var _local7 = {};
var _local3 = (xmlsafe ? 5 : 0);
var _local12 = 0;
while (_local12 < 256) {
_local7[String.fromCharCode(_local12)] = _local12;
_local12++;
}
if (xmlsafe) {
_local7["<"] = 256;
_local7[">"] = 257;
_local7["&"] = 258;
_local7["\""] = 259;
_local7["'"] = 260;
}
var _local4 = {dico:_local7, skipnum:_local3, str:str, splitStr:str.split(""), strlen:str.length, res:"", i:0, buffer:"", nbChar:256 + _local3};
intId = setInterval(this, "doCompress", 1, _local4);
}
function doCompress(args) {
var _local5 = args.dico;
var _local9 = args.skipnum;
var _local4 = args.i;
var _local6 = 0;
var _local3;
while ((_local4 <= args.strlen) && ((_local6++) < LOOPS_PER_ITERATION)) {
_local3 = args.splitStr[_local4];
if (!(_local5[args.buffer + _local3] === undefined)) {
args.buffer = args.buffer + _local3;
} else {
args.res = args.res + String.fromCharCode(_local5[args.buffer]);
_local5[args.buffer + _local3] = args.nbChar;
args.nbChar++;
args.buffer = _local3;
}
_local4++;
}
if (_local4 > args.strlen) {
clearInterval(intId);
dispatchEvent({type:COMPLETE, result:args.res});
} else {
args.i = _local4;
dispatchEvent({type:PROGRESS, value:_local4 / args.strlen});
}
}
function beginDecompress(str) {
if (intId) {
clearInterval(intId);
}
var _local5 = {};
var _local6 = (xmlsafe ? 5 : 0);
var _local11 = 0;
while (_local11 < 256) {
_local5[_local11] = String.fromCharCode(_local11);
_local11++;
}
if (xmlsafe) {
_local5[256] = "<";
_local5[257] = ">";
_local5[258] = "&";
_local5[259] = "\"";
_local5[260] = "'";
}
var _local3 = {dico:_local5, str:str, strlen:str.length, splitStr:str.split(""), nbChar:256 + _local6, skipnum:_local6, buffer:"", chaine:"", result:"", i:0};
intId = setInterval(this, "doDecompress", 1, _local3);
}
function doDecompress(args, xmlsafe) {
var _local4 = args.dico;
var _local7 = 0;
var _local6 = args.i;
var _local5;
var _local3;
while ((_local6 < args.strlen) && ((_local7++) < LOOPS_PER_ITERATION)) {
_local5 = args.str.charCodeAt(_local6);
_local3 = _local4[_local5];
if (args.buffer == "") {
args.buffer = _local3;
args.result = args.result + _local3;
} else if (_local5 <= (255 + args.skipnum)) {
args.result = args.result + _local3;
args.chaine = args.buffer + _local3;
_local4[args.nbChar] = args.chaine;
args.nbChar++;
args.buffer = _local3;
} else {
args.chaine = _local4[_local5];
if (args.chaine == undefined) {
args.chaine = args.buffer + args.buffer.slice(0, 1);
}
args.result = args.result + args.chaine;
_local4[args.nbChar] = args.buffer + args.chaine.slice(0, 1);
args.nbChar++;
args.buffer = args.chaine;
}
_local6++;
}
if (_local6 == args.strlen) {
clearInterval(intId);
dispatchEvent({type:COMPLETE, result:args.result});
} else {
args.i = _local6;
dispatchEvent({type:PROGRESS, value:_local6 / args.strlen});
}
}
static function compress(str) {
var _local2 = {};
var _local9 = (xmlsafe ? 5 : 0);
var _local4 = 0;
while (_local4 < 256) {
_local2[String.fromCharCode(_local4)] = _local4;
_local4++;
}
if (xmlsafe) {
_local2["<"] = 256;
_local2[">"] = 257;
_local2["&"] = 258;
_local2["\""] = 259;
_local2["'"] = 260;
}
var _local6 = "";
var _local10 = str;
var _local7 = _local10.split("");
var _local8 = _local7.length;
var _local5 = 256 + _local9;
var _local1 = "";
var _local3;
_local4 = 0;
while (_local4 <= _local8) {
_local3 = _local7[_local4];
if (!(_local2[_local1 + _local3] === undefined)) {
_local1 = _local1 + _local3;
} else {
_local6 = _local6 + String.fromCharCode(_local2[_local1]);
_local2[_local1 + _local3] = _local5;
_local5++;
_local1 = _local3;
}
_local4++;
}
return(_local6);
}
static function decompress(str) {
var _local4 = new Array();
var _local10 = (xmlsafe ? 5 : 0);
var _local6 = 0;
while (_local6 < 256) {
var _local9 = String.fromCharCode(_local6);
_local4[_local6] = _local9;
_local6++;
}
if (xmlsafe) {
_local4[256] = "<";
_local4[257] = ">";
_local4[258] = "&";
_local4[259] = "\"";
_local4[260] = "'";
}
var _local11 = str;
var _local13 = _local11.split("");
var _local12 = _local13.length;
var _local7 = 256 + _local10;
var _local1 = "";
var _local2 = "";
var _local8 = "";
_local6 = 0;
while (_local6 < _local12) {
var _local5 = _local11.charCodeAt(_local6);
var _local3 = _local4[_local5];
if (_local1 == "") {
_local1 = _local3;
_local8 = _local8 + _local3;
} else if (_local5 <= (255 + _local10)) {
_local8 = _local8 + _local3;
_local2 = _local1 + _local3;
_local4[_local7] = _local2;
_local7++;
_local1 = _local3;
} else {
_local2 = _local4[_local5];
if (_local2 == undefined) {
_local2 = _local1 + _local1.slice(0, 1);
}
_local8 = _local8 + _local2;
_local4[_local7] = _local1 + _local2.slice(0, 1);
_local7++;
_local1 = _local2;
}
_local6++;
}
return(_local8);
}
static var xmlsafe = false;
static var LOOPS_PER_ITERATION = 10;
static var COMPLETE = "complete";
static var PROGRESS = "progress";
}
Symbol 625 MovieClip [__Packages.EventBroadcaster] Frame 0
class EventBroadcaster
{
var __events;
function EventBroadcaster () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventBroadcaster == undefined) {
_fEventBroadcaster = new EventBroadcaster();
}
object.addEventListener = _fEventBroadcaster.addEventListener;
object.removeEventListener = _fEventBroadcaster.removeEventListener;
object.dispatchEvent = _fEventBroadcaster.dispatchEvent;
object.dispatchQueue = _fEventBroadcaster.dispatchQueue;
object.__events = new Array();
_global.ASSetPropFlags(object, "__events", 1);
}
function dispatchQueue(queueObj, eventObj) {
var _local6 = 0;
var _local8 = "__q_" + eventObj.type;
var _local4 = queueObj[_local8];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
_local6++;
}
}
return(_local6);
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
return(dispatchQueue(this, eventObj));
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
__events.push(event);
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
function getEventListeners(type) {
return(this["__q_" + type]);
}
function getEvents() {
return(__events);
}
function removeEventListeners(type) {
var _local4 = "__q_" + type;
var _local2 = this[_local4];
while (_local2.length) {
_removeEventListener(_local2, type, _local2[0]);
}
}
static var _fEventBroadcaster = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 626 MovieClip [__Packages.cust.tiles.Target] Frame 0
class cust.tiles.Target
{
var x, y, health, time;
function Target (xmlnode) {
x = Number(xmlnode.attributes.x);
y = Number(xmlnode.attributes.y);
health = Number(xmlnode.attributes.health);
time = Number(xmlnode.attributes.time);
}
var desc = "";
}
Symbol 627 MovieClip [__Packages.cust.tiles.Avoid] Frame 0
class cust.tiles.Avoid
{
var x, y, health;
function Avoid (xmlnode) {
x = Number(xmlnode.attributes.x);
y = Number(xmlnode.attributes.y);
health = Number(xmlnode.attributes.health);
}
}
Symbol 628 MovieClip [__Packages.cust.tiles.Bonus] Frame 0
class cust.tiles.Bonus
{
var x, y, health;
function Bonus (xmlnode) {
x = Number(xmlnode.attributes.x);
y = Number(xmlnode.attributes.y);
health = Number(xmlnode.attributes.health);
}
}
Symbol 629 MovieClip [__Packages.cust.tiles.MasterTile] Frame 0
class cust.tiles.MasterTile
{
var type, children, area, x, y, _health, lifeBar;
function MasterTile (a, t, x, y) {
type = t;
children = [];
area = a;
this.x = x;
this.y = y;
}
function addSubTile(tile, sx, sy) {
children[getSubTileDepth(sx, sy)] = tile;
}
function getSubTile(sx, sy) {
return(children[getSubTileDepth(sx, sy)]);
}
function getSubTileDepth(sx, sy) {
return((sx * type.height) + sy);
}
function setType(t) {
var _local2;
type = t;
var _local3 = 0;
while (_local3 < children.length) {
_local2 = children[_local3];
_local2.type = t;
_local2.bmp = type.getBmpSlice(_local2.sx, _local2.sy);
_local2.block = type.block;
if (_local2.mc) {
_local2.hideTile();
_local2.showTile();
}
_local3++;
}
isHurtable = (Boolean(type.destroyed));
}
function pain(over) {
var _local2;
if (over) {
var _local3 = 0;
while (_local3 < children.length) {
_local2 = children[_local3];
if (_local2.mc) {
if (_local2.pain_mc) {
_local2.pain_mc.removeMovieClip();
delete _local2.pain_mc;
}
}
_local3++;
}
} else {
var _local4 = Math.round((pd * cust.tiles.Tile.MAX_PAIN_DIST) * Math.random());
var _local5 = -Math.round(cust.tiles.Tile.MAX_PAIN_DIST * Math.random());
var _local3 = 0;
while (_local3 < children.length) {
_local2 = children[_local3];
if (_local2.mc) {
if (!_local2.pain_mc) {
_local2.pain_mc = _local2.mc.createEmptyMovieClip("pain", 1);
_local2.pain_mc.attachBitmap(_local2.bmp, 0);
}
_local2.pain_mc._x = _local4;
_local2.pain_mc._y = _local5;
}
_local3++;
}
pd = pd * -1;
}
}
function get health() {
return(_health);
}
function set health(h) {
_health = h;
if (h < 0) {
die();
} else if ((h > 0) && (!lifeBar)) {
lifeBar = area.overlay.attachMovie(LIFEBAR, (("lifeBar" + x) + "-") + y, area.getTileDepth(x, y));
lifeBar.init(area.game, this);
}
//return(health);
}
function get status() {
return(_status);
}
function set status(s) {
_status = s;
//return(status);
}
function get isHurtable() {
return(_isHurtable);
}
function set isHurtable(b) {
_isHurtable = b;
//return(isHurtable);
}
function die() {
isHurtable = (false);
status = ("");
lifeBar.removeMovieClip();
delete lifeBar;
var _local5 = area.overlay.attachMovie(type.getDeathAnim(), (("dust" + x) + "-") + y, area.getTileDepth(x, y), {_x:x * area.tWidth, _y:y * area.tHeight});
if (type.destroyed) {
setType(area.level.map.tileset[type.destroyed]);
}
var _local2 = getSubTile(0, 0);
area.game.gui.map.drawRect(area.game.gui.map.bmp, cust.gui.Map.BASE_COL, _local2.x * cust.gui.Map.SCALE, _local2.y * cust.gui.Map.SCALE, type.width * cust.gui.Map.SCALE, type.height * cust.gui.Map.SCALE);
area.game.lvlPerf.buildingDestroyed(getSubTile(0, 0));
area.game.sndMan.playAndRemove(DESTROY);
}
var _status = "";
var _isHurtable = false;
var pd = 1;
static var LIFEBAR = "buildingLife";
static var DESTROY = "destroy";
}
Symbol 630 MovieClip [__Packages.BuildingLifeBar] Frame 0
class BuildingLifeBar extends MovieClip
{
var height, _height, width, _width, padding, game, area, masterTile, _visible, _x, _y, bar;
function BuildingLifeBar () {
super();
height = _height;
width = _width;
padding._visible = false;
}
function init(g, mt) {
game = g;
area = game.area;
masterTile = mt;
_visible = false;
}
function update(c) {
_visible = true;
var _local3 = c.x - ((masterTile.x + (masterTile.type.width / 2)) * area.tWidth);
var _local2 = c.y - ((masterTile.y + (masterTile.type.height / 2)) * area.tHeight);
if (_local3 > 0) {
_x = ((masterTile.x + masterTile.type.width) * area.tWidth) - width;
} else {
_x = masterTile.x * area.tWidth;
}
if (_local2 > 0) {
_y = ((masterTile.y + masterTile.type.height) * area.tHeight) - height;
} else {
_y = masterTile.y * area.tHeight;
}
bar._xscale = (masterTile.__get__health() / masterTile.maxHealth) * 100;
}
}
Symbol 631 MovieClip [__Packages.Misc] Frame 0
class Misc
{
function Misc () {
}
static function playAtFrameRate(mc, frameRate) {
mc.gotoAndStop(0);
mc.playNextFrame = function () {
this.gotoAndStop((this._currentframe % this._totalframes) + 1);
};
mc.playAtFrameRateIntId = setInterval(mc, "playNextFrame", 1000 / frameRate);
mc.onUnload = function () {
clearInterval(this.playAtFrameRateIntId);
};
}
static function toNearest(num, nearest) {
return(Math.round(num / nearest) * nearest);
}
static function fixAng(ang) {
return(((ang + 9.42477796076938) % (Math.PI*2)) - Math.PI);
}
static function arrayMap(callBack, vals) {
var _local3 = arguments.slice(2);
var _local5;
var _local2;
var _local4 = 0;
while (_local4 < vals.length) {
if (callBack instanceof Function) {
_local5 = [vals[_local4]];
_local2 = 0;
while (_local2 < _local3.length) {
_local5.push(((_local3[_local2] instanceof Array) ? (_local3[_local2][_local4]) : (_local3[_local2])));
_local2++;
}
callBack.apply(null, _local5);
} else {
_local5 = [];
_local2 = 0;
while (_local2 < _local3.length) {
_local5.push(((_local3[_local2] instanceof Array) ? (_local3[_local2][_local4]) : (_local3[_local2])));
_local2++;
}
vals[_local4][callBack].apply(vals[_local4], _local5);
}
_local4++;
}
}
static function getBoundingBox(a) {
var _local9 = new flash.geom.Rectangle();
var _local3;
var _local2;
var _local5;
var _local7;
var _local4;
var _local6;
var _local1 = 0;
while (_local1 < a.length) {
_local3 = a[_local1].x;
_local2 = a[_local1].y;
_local5 = ((_local5 < _local3) ? (_local5) : (_local3));
_local7 = ((_local7 > _local3) ? (_local7) : (_local3));
_local4 = ((_local4 < _local2) ? (_local4) : (_local2));
_local6 = ((_local6 > _local2) ? (_local6) : (_local2));
_local1++;
}
_local9.x = _local5;
_local9.y = _local4;
_local9.width = _local7 - _local5;
_local9.height = _local6 - _local4;
return(_local9);
}
static function max() {
var _local3;
var _local2 = arguments.length - 1;
while (_local2 > -1) {
_local3 = ((_local3 <= arguments[_local2]) ? (arguments[_local2]) : (_local3));
_local2--;
}
return(_local3);
}
static var pi2 = (Math.PI*2);
static var hpi = (Math.PI/2);
static var qpi = (Math.PI/4);
static var rd = 57.2957795130823;
static var dr = (Math.PI/180);
}
Symbol 632 MovieClip [__Packages.Car] Frame 0
class Car extends MovieClip
{
var _height, _width, bb, abb, points, edgeLines, vectorLines, maxSpeed, game, area, skidSnd, x, y, isSkiddingClockwise, gotoAndStop, _rotation;
function Car () {
super();
var _local6 = Math.sqrt(Math.pow(_width, 2) + Math.pow(_height, 2)) + 1;
bb = new flash.geom.Rectangle(0, 0, _local6, _local6);
abb = bb.clone();
points = [];
edgeLines = [];
vectorLines = [];
var _local5;
var _local4 = -1;
_local4++;
while (_local5 = this["p" + _local4] , _local5) {
points[_local4] = new cust.geom2D.Polar(Math.atan2(_local5._y, _local5._x) + Misc.hpi, Math.sqrt(Math.pow(_local5._x, 2) + Math.pow(_local5._y, 2)));
}
_local4 = 0;
while (_local4 < points.length) {
edgeLines[_local4] = new cust.geom2D.LineSegment(0, 0, 0, 0);
vectorLines[_local4] = new cust.geom2D.LineSegment(0, 0, 0, 0);
_local4++;
}
power = accel * _global.carUpgrades.speed[_global.upgradesLevels.speed];
mass = _global.carUpgrades.acceleration[_global.upgradesLevels.acceleration];
drag = drag * mass;
turnSpeed = turnSpeed * _global.carUpgrades.handling[_global.upgradesLevels.handling];
maxSpeed = (accel / (1 - drag)) - (accel * drag);
}
function init(g, lvl) {
game = g;
area = game.area;
skidSnd = game.sndMan.playAndRemove(SKID, 0, 999999);
skidSnd.setVolume(0);
x = lvl.startX;
y = lvl.startY;
desiredAng = (newAng = (ang = lvl.startA * Misc.dr));
ICE.init(game, this);
}
function update(deltaTime) {
skidSnd.setVolume(0);
var _local5 = area.getTileAtCoords(x, y).type.grip;
if (!isSkidding) {
dir = ang;
if (speed >= 0) {
if (isDown(CONTROLS.UP)) {
speed = speed + ((accel * deltaTime) * _local5);
}
if (isDown(CONTROLS.DOWN)) {
speed = speed - ((brakes * deltaTime) * _local5);
skidSnd.setVolume(100);
}
var _local6 = ((speed > 50) ? 1 : (speed / 50));
if (isDown(CONTROLS.LEFT)) {
desiredAng = desiredAng - ((turnSpeed * deltaTime) * _local6);
}
if (isDown(CONTROLS.RIGHT)) {
desiredAng = desiredAng + ((turnSpeed * deltaTime) * _local6);
}
if (isDown(CONTROLS.HANDBREAK) || (isDown(CONTROLS.HANDBREAK2))) {
if (isDown(CONTROLS.RIGHT) && (speed > (handbreakThreshold * _local5))) {
isSkidding = true;
isSkiddingClockwise = true;
desiredAng = ang + Misc.hpi;
gotoAndStop(SKID_C);
skidSnd.setVolume(100);
} else if (isDown(CONTROLS.LEFT) && (speed > (handbreakThreshold * _local5))) {
isSkidding = true;
isSkiddingClockwise = false;
desiredAng = ang - Misc.hpi;
gotoAndStop(SKID_CC);
skidSnd.setVolume(100);
} else {
speed = speed - (handbreak * deltaTime);
speed = ((speed < 0) ? 0 : (speed));
if (speed > 1) {
skidSnd.setVolume(100);
}
}
}
} else {
if (isDown(CONTROLS.UP)) {
speed = speed + ((brakes * deltaTime) * _local5);
skidSnd.setVolume(100);
}
if (isDown(CONTROLS.DOWN)) {
speed = speed - ((reverse * deltaTime) * _local5);
}
var _local6 = (((-speed) > 50) ? 1 : ((-speed) / 50));
if (isDown(CONTROLS.LEFT)) {
desiredAng = desiredAng - (((turnSpeed * _global.carUpgrades.handling[_global.upgradesLevels.handling]) * deltaTime) * _local6);
}
if (isDown(CONTROLS.RIGHT)) {
desiredAng = desiredAng + (((turnSpeed * _global.carUpgrades.handling[_global.upgradesLevels.handling]) * deltaTime) * _local6);
}
}
} else {
speed = speed - ((handbreak * deltaTime) * _local5);
speed = ((speed < 0) ? 0 : (speed));
skidSnd.setVolume(100);
if (speed <= (endHandbreakThreshold * _local5)) {
isSkidding = false;
dir = ang;
gotoAndStop(STOP_SKID);
}
}
speed = speed * Math.pow(drag, deltaTime);
var _local7;
var _local8;
var _local9;
var _local3 = 1;
while (_local3 > 0) {
_local3 = move(_local3, deltaTime);
emergencyRecovery();
}
_rotation = (ang * 57.2957795130823) + 90;
ICE.update(deltaTime, isDown(CONTROLS.ATTACK) || (isDown(CONTROLS.ATTACK2)));
}
function move(m, deltaTime) {
abb.x = x - (bb.width / 2);
abb.y = y - (bb.height / 2);
abb.width = bb.width;
abb.height = bb.height;
newAng = toNearest(fixAng(desiredAng), DIR_STEPS);
ang = fixAng(checkRotationCollsion(ang, newAng, getLinesInTilesObj(area.getTilesInRect(abb, true), x, y)));
xVel = speed * Math.cos(dir);
yVel = speed * Math.sin(dir);
var _local3 = (xVel * m) * deltaTime;
var _local2 = (yVel * m) * deltaTime;
if (xVel > 0) {
abb.width = abb.width + _local3;
} else {
abb.left = abb.left + _local3;
}
if (yVel > 0) {
abb.height = abb.height + _local2;
} else {
abb.top = abb.top + _local2;
}
var _local6;
_local6 = checkForCollisions(getLinesInTilesObj(area.getTilesInRect(abb, true), x, y), x, y, dir, _local3, _local2);
if (_local6) {
return(respondToCollision(_local6, m, deltaTime));
}
x = x + ((xVel * m) * deltaTime);
y = y + ((yVel * m) * deltaTime);
return(0);
}
function checkForCollisions(tileLines, x, y, a, vx, vy) {
if (tileLines.length > 0) {
var _local2;
var _local3;
var _local5;
var _local7;
var _local4 = getVectorLines(x, y, a, vx, vy);
_local2 = 0;
while (_local2 < _local4.length) {
_local3 = 0;
while (_local3 < tileLines.length) {
_local5 = cust.geom2D.Intersection.lineSegmentLineSegment(_local4[_local2], tileLines[_local3]);
if (_local5.length > 0) {
_local7 = new Collision(Collision.EDGE, tileLines[_local3], Math.sqrt(Math.pow(_local4[_local2].x1 - _local5[0].x, 2) + Math.pow(_local4[_local2].y1 - _local5[0].y, 2)) / _local4[_local2].length).closest(_local7);
}
_local3++;
}
_local2++;
}
return(_local7);
}
return(undefined);
}
function respondToCollision(col, m, deltaTime) {
x = x + ((((xVel * col.f) * deltaTime) * m) - ((xVel > 0) ? 0.5 : (((xVel < 0) ? -0.5 : 0))));
y = y + ((((yVel * col.f) * deltaTime) * m) - ((yVel > 0) ? 0.5 : (((yVel < 0) ? -0.5 : 0))));
var _local4 = 0.25;
var _local7 = 0.9;
if (Math.abs(speed) > STOP_THRESHOLD) {
var _local5 = col.hit.__get__radians();
var _local2 = fixAng((ang - _local5) - Misc.hpi);
if (Math.abs(_local2) >= STRAIGHT_THRESHOLD) {
desiredAng = fixAng(ang + ((_local2 > 0) ? (Misc.hpi - _local2) : ((-_local2) - Misc.hpi)));
speed = speed * Math.abs(_local7 * (1 - Math.abs(Math.cos(_local2))));
} else {
speed = speed * (-_local4);
}
return(m * col.f);
}
speed = 0;
return(0);
}
function emergencyRecovery() {
var _local3;
var _local9;
var _local4;
var _local8;
var _local2;
var _local7;
var _local5;
var _local6;
var _local10 = 0;
do {
_local10++;
_local7 = true;
_local4 = getPoints(x, y, ang);
_local8 = area.getTilesInRect(Misc.getBoundingBox(_local4), true);
do {
if ((in _local8) == null) {
break;
}
_local9 = in _local8;
_local2 = _local8[_local9];
_local3 = 0;
while (_local3 < _local4.length) {
if (_local2.bb.containsPoint(_local4[_local3])) {
_local5 = x - ((_local2.x + 0.5) * area.tWidth);
_local6 = y - ((_local2.y + 0.5) * area.tHeight);
if ((Math.abs(_local5 / _local6) >= 1) && (_local5 > 0)) {
if (_local5 > 0) {
if (area.getTileAt(_local2.x + 1, _local2.y).block === false) {
x = x + ((_local2.r - _local4[_local3].x) + 0.5);
} else if (_local6 > 0) {
y = y + ((_local2.b - _local4[_local3].y) + 0.5);
} else {
y = y + ((_local2.t - _local4[_local3].y) - 0.5);
}
} else if (area.getTileAt(_local2.x - 1, _local2.y).block === false) {
x = x + ((_local2.l - _local4[_local3].x) - 0.5);
} else if (_local6 > 0) {
y = y + ((_local2.b - _local4[_local3].y) + 0.5);
} else {
y = y + ((_local2.t - _local4[_local3].y) - 0.5);
}
} else if (_local6 > 0) {
if (area.getTileAt(_local2.x, _local2.y + 1).block === false) {
y = y + ((_local2.b - _local4[_local3].y) + 0.5);
} else if (_local5 > 0) {
x = x + ((_local2.r - _local4[_local3].x) + 0.5);
} else {
x = x + ((_local2.l - _local4[_local3].x) - 0.5);
}
} else if (area.getTileAt(_local2.x, _local2.y - 1).block === false) {
y = y + ((_local2.t - _local4[_local3].y) - 0.5);
} else if (_local5 > 0) {
x = x + ((_local2.r - _local4[_local3].x) + 0.5);
} else {
x = x + ((_local2.l - _local4[_local3].x) - 0.5);
}
_local7 = false;
break;
}
_local3++;
}
} while (_local7);
do {
} while ("emergencyRecovery" != null);
} while ((!_local7) && (_local10 < 100));
}
function checkRotationCollsion(ca, na, ta) {
var _local2;
var _local12;
var _local10 = [];
var _local11;
if (ta.length > 0) {
var _local4 = ((fixAng(na - ca) > 0) ? 1 : -1);
var _local3 = DIR_STEPS * _local4;
var _local6;
var _local5 = ca;
_local2 = ca + _local3;
while ((_local4 * _local2) <= (_local4 * na)) {
_local6 = getRotationLines(x, y, _local2, _local5);
_local5 = _local2;
if (isIntersection(_local6, ta)) {
desiredAng = _local2 - _local3;
return(_local2 - _local3);
}
_local2 = _local2 + _local3;
}
return(na);
}
return(na);
}
function isIntersection(carLines, tileLines) {
var _local2;
var _local1;
_local2 = 0;
while (_local2 < carLines.length) {
_local1 = 0;
while (_local1 < tileLines.length) {
if (cust.geom2D.Intersection.lineSegmentLineSegment(carLines[_local2], tileLines[_local1]).length > 0) {
return(true);
}
_local1++;
}
_local2++;
}
return(false);
}
function getLinesInTilesObj(obj, px, py) {
var _local1 = [];
for (var _local3 in obj) {
_local1 = _local1.concat(obj[_local3].getLines(px, py));
}
return(_local1);
}
function getRotationLines(nx, ny, oa, na) {
var _local3;
var _local9;
var _local4 = [];
var _local2 = 0;
while (_local2 < edgeLines.length) {
_local3 = edgeLines[_local2];
_local3.x1 = nx + (points[_local2].magnitude * Math.cos(points[_local2].angle + oa));
_local3.y1 = ny + (points[_local2].magnitude * Math.sin(points[_local2].angle + oa));
_local3.x2 = nx + (points[_local2].magnitude * Math.cos(points[_local2].angle + na));
_local3.y2 = ny + (points[_local2].magnitude * Math.sin(points[_local2].angle + na));
_local4[_local4.length] = _local3;
_local2++;
}
return(_local4);
}
function getVectorLines(nx, ny, na, xv, yv) {
var _local3;
var _local5 = [];
var _local2 = 0;
while (_local2 < vectorLines.length) {
_local3 = vectorLines[_local2];
_local3.x1 = nx + (points[_local2].magnitude * Math.cos(points[_local2].angle + na));
_local3.y1 = ny + (points[_local2].magnitude * Math.sin(points[_local2].angle + na));
_local3.x2 = (nx + (points[_local2].magnitude * Math.cos(points[_local2].angle + na))) + xv;
_local3.y2 = (ny + (points[_local2].magnitude * Math.sin(points[_local2].angle + na))) + yv;
_local5[_local5.length] = _local3;
_local2++;
}
return(_local5);
}
function getAreaCornerLines(tileLines, vx, vy) {
var _local3 = [];
var _local1;
var _local2 = tileLines.length - 1;
while (_local2 > -1) {
_local1 = tileLines[_local2];
_local3[_local3.length] = new cust.geom2D.LineSegment(_local1.x1, _local1.y1, _local1.x1 - vx, _local1.y1 - vy);
_local3[_local3.length] = new cust.geom2D.LineSegment(_local1.x2, _local1.y2, _local1.x2 - vx, _local1.y2 - vy);
_local2--;
}
return(_local3);
}
function getPoints(px, py, a) {
var _local4 = [];
var _local3;
var _local2 = 0;
while (_local2 < points.length) {
_local3 = new flash.geom.Point();
_local4[_local4.length] = _local3;
_local3.x = px + (points[_local2].magnitude * Math.cos(points[_local2].angle + a));
_local3.y = py + (points[_local2].magnitude * Math.sin(points[_local2].angle + a));
_local2++;
}
return(_local4);
}
function isDown(c) {
return(game.takeInput && (keyIsDown(c)));
}
function get accel() {
return(power / mass);
}
var power = 350;
var mass = 1;
var reverse = 150;
var brakes = 500;
var drag = 0.5;
var turnSpeed = 2.61799387799149;
var handbreakThreshold = 300;
var endHandbreakThreshold = 200;
var handbreak = 300;
var xVel = 0;
var yVel = 0;
var dir = 0;
var desiredAng = 0;
var ang = 0;
var newAng = Car.prototype.ang;
var speed = 0;
var isSkidding = false;
var toNearest = Misc.toNearest;
var fixAng = Misc.fixAng;
var keyIsDown = Key.isDown;
static var DIR_STEPS = 0.098174770424681;
static var CONTROLS = {UP:38, RIGHT:39, DOWN:40, LEFT:37, ATTACK:88, ATTACK2:32, HANDBREAK:90, HANDBREAK2:16};
static var ROT_COL_STEP = 0.0314159265358979;
static var STOP_THRESHOLD = 150;
static var STRAIGHT_THRESHOLD = 0.628318530717959;
static var STOP_SKID = "start";
static var SKID_C = "skidC";
static var SKID_CC = "skidAC";
static var SKID = "skid";
}
Symbol 633 MovieClip [__Packages.Snd] Frame 0
class Snd extends Sound
{
var target, manager, _volume, position, start, duration, onFadeComplete, fId, setPan;
function Snd (targ, sndman) {
super(targ);
target = (targ ? (targ) : _root);
manager = sndman;
_volume = super.getVolume();
}
function switchSound(id, loops) {
var _local3 = position;
super.stop();
super.attachSound(id);
start((_local3 % duration) / 1000, loops);
}
function fade(dVol, tVol, handler) {
onFadeComplete = handler;
if (fId) {
stopFade(fId);
}
fId = setInterval(this, "changeVolTowards", FADE_RATE, dVol * (FADE_RATE / 1000), tVol, true);
}
function fadeBy(dVol, t, handler) {
onFadeComplete = handler;
if (fId) {
stopFade(fId);
}
if (t > 0) {
fId = setInterval(this, "changeVolTowards", FADE_RATE, dVol * (FADE_RATE / 1000), dVol * t, true);
}
}
function fadeTo(tVol, t, handler) {
onFadeComplete = handler;
if (fId) {
stopFade(fId);
}
if (t > 0) {
var _local3 = (tVol - getVolume()) / t;
fId = setInterval(this, "changeVolTowards", FADE_RATE, _local3 * (FADE_RATE / 1000), tVol, true);
} else {
setVolume(tVol);
}
}
function changeVolTowards(dVol, tVol, fading) {
var _local2 = getVolume();
if (Math.abs(dVol) < Math.abs(tVol - _local2)) {
changeVolume(dVol);
} else {
setVolume(tVol);
if (fading) {
stopFade();
}
}
}
function stopFade() {
if (fId) {
clearInterval(fId);
delete fId;
onFadeComplete();
delete onFadeComplete;
}
}
function positionSound(a, d, f, t) {
if (d < f) {
t = (isNaN(t) ? 100 : (((t < 0) ? 0 : (t))));
d = ((d < 1) ? 1 : (d));
var _local4 = 1 / ((d / f) * 100);
setVolume(Math.ceil(_local4 * t));
setPan((-Math.sin(a)) * 100);
} else {
setVolume(0);
}
}
function positionSoundLinear(a, d, f, t) {
if (d < f) {
t = (isNaN(t) ? 100 : (((t < 0) ? 0 : (t))));
setVolume(((f - d) / f) * t);
setPan((-Math.sin(a)) * 100);
} else {
setVolume(0);
}
}
function setVolume(n) {
_volume = n;
super.setVolume(n);
}
function getVolume() {
return(_volume);
}
function changeVolume(n) {
setVolume(getVolume() + n);
}
function remove() {
super.stop();
delete manager.sounds[target.getDepth()];
target.removeMovieClip();
}
function toString() {
return(("(target=" + target) + ")");
}
function get volume() {
return(_volume);
}
function set volume(n) {
_volume = n;
super.setVolume(n);
//return(volume);
}
static var FADE_RATE = 100;
}
Symbol 634 MovieClip [__Packages.SoundManager] Frame 0
class SoundManager extends Snd
{
var sounds, mc_holder, getVolume;
function SoundManager (hld_mc) {
super();
sounds = new Object();
mc_holder = (hld_mc ? (hld_mc) : _root);
}
function playAndRemove(snd_id, offset, loops) {
offset = (isNaN(offset) ? 0 : (offset));
loops = (isNaN(loops) ? 0 : (loops));
var _local2 = newSound(snd_id);
_local2.start(offset, loops);
_local2.onSoundComplete = _local2.remove;
return(_local2);
}
function clearAllSounds() {
for (var _local2 in sounds) {
sounds[_local2].remove();
}
}
function newSound() {
var _local5 = mc_holder.getNextHighestDepth();
var _local6 = mc_holder.createEmptyMovieClip("sh_mc" + _local5, _local5);
var _local4 = new Snd(_local6, this);
var _local3 = 0;
while (_local3 < arguments.length) {
if (arguments[_local3] != undefined) {
_local4.attachSound(arguments[_local3]);
}
_local3++;
}
sounds[_local5] = _local4;
return(_local4);
}
function deleteSound(snd) {
snd.remove();
}
function setVolume(vol) {
if (muted) {
curVol = vol;
} else {
super.setVolume(vol);
}
}
function get mute() {
return(muted);
}
function set mute(b) {
muted = b;
if (b) {
curVol = getVolume();
super.setVolume(0);
} else {
super.setVolume(curVol);
}
//return(mute);
}
var muted = false;
var curVol = 100;
}
Symbol 635 MovieClip [__Packages.cust.geom2D.Polar] Frame 0
class cust.geom2D.Polar
{
var angle, magnitude;
function Polar (a, m) {
angle = a;
magnitude = m;
}
}
Symbol 636 MovieClip [__Packages.cust.geom2D.LineSegment] Frame 0
class cust.geom2D.LineSegment
{
var x1, y1, x2, y2;
function LineSegment (ix1, iy1, ix2, iy2) {
x1 = ix1;
y1 = iy1;
x2 = ix2;
y2 = iy2;
}
function vector() {
return(new cust.geom2D.Vector(x2 - x1, y2 - y1));
}
function isLeftOf(x, y) {
var _local5 = x - x1;
var _local3 = y - y1;
var _local4 = x2 - x;
var _local2 = y2 - y;
return((_local5 * _local2) < (_local3 * _local4));
}
function isPointOnLine(p) {
if (p.y == ((m * p.x) + c)) {
if (x1 >= x2) {
var _local6 = x1;
var _local4 = x2;
} else {
var _local6 = x2;
var _local4 = x1;
}
if (y1 >= y2) {
var _local5 = y1;
var _local3 = y2;
} else {
var _local5 = y2;
var _local3 = y1;
}
if (((p.x >= _local4) && (p.x <= _local6)) && ((p.y >= _local3) && (p.y <= _local5))) {
return(true);
}
}
return(false);
}
function isIntersectingRectangle(r) {
return(false);
}
function interpolate(f) {
f = (isNaN(f) ? 0.5 : (((f > 1) ? 1 : (((f < 0) ? 0 : (f))))));
return(new cust.geom2D.Vector(x1 + ((x2 - x1) * f), y1 + ((y2 - y1) * f)));
}
function offset(x, y) {
x1 = x1 + x;
x2 = x2 + x;
y1 = y1 + y;
y2 = y2 + y;
}
function offsetPoint(p) {
x1 = x1 + p.x;
x2 = x2 + p.x;
y1 = y1 + p.y;
y2 = y2 + p.y;
}
function isIntersecting(l) {
var _local4 = l.x1;
var _local6 = l.y1;
var _local11 = l.x2;
var _local10 = l.y2;
var _local2 = 0;
var _local3 = 0;
var _local7 = x2 - x1;
var _local5 = _local11 - _local4;
if (!_local7) {
if (!_local5) {
return(false);
}
_local2 = x1;
_local3 = _local6 + (((_local10 - _local6) * (x1 - _local4)) / _local5);
} else if (!_local5) {
_local2 = _local4;
_local3 = y1 + (((y2 - y1) * (_local4 - x1)) / _local7);
} else {
var _local9 = (y2 - y1) / _local7;
var _local8 = (_local10 - _local6) / _local5;
if (_local9 == _local8) {
return(false);
}
var _local14 = y1 - (_local9 * x1);
var _local13 = _local6 - (_local8 * _local4);
var _local12 = _local8 - _local9;
_local2 = (_local14 - _local13) / _local12;
_local3 = ((_local8 * _local14) - (_local9 * _local13)) / _local12;
}
if (_local7 > 0) {
if ((_local2 < x1) || (_local2 > x2)) {
return(false);
}
} else if (_local7 < 0) {
if ((_local2 > x1) || (_local2 < x2)) {
return(false);
}
} else if (((_local3 < y1) && (_local3 < y2)) || ((_local3 > y1) && (_local3 > y2))) {
return(false);
}
if (_local5 > 0) {
if ((_local2 < _local4) || (_local2 > _local11)) {
return(false);
}
} else if (_local5 < 0) {
if ((_local2 > _local4) || (_local2 < _local11)) {
return(false);
}
} else if (((_local3 < _local6) && (_local3 < _local10)) || ((_local3 > _local6) && (_local3 > _local10))) {
return(false);
}
return(true);
}
function clone() {
return(new cust.geom2D.LineSegment(x1, y1, x2, y2));
}
function closestPoint(p) {
var _local3 = ((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2));
var _local2 = (((p.x - x1) * (x2 - x1)) + ((p.y - y1) * (y2 - y1))) / _local3;
return(new flash.geom.Point(x1 + (_local2 * (x2 - x1)), y1 + (_local2 * (y2 - y1))));
}
function pointOfIntersection(l, full) {
var _local4 = l.x1;
var _local6 = l.y1;
var _local11 = l.x2;
var _local10 = l.y2;
var _local2 = 0;
var _local3 = 0;
var _local7 = x2 - x1;
var _local5 = _local11 - _local4;
if (!_local7) {
if (!_local5) {
return(false);
}
_local2 = x1;
_local3 = _local6 + (((_local10 - _local6) * (x1 - _local4)) / _local5);
} else if (!_local5) {
_local2 = _local4;
_local3 = y1 + (((y2 - y1) * (_local4 - x1)) / _local7);
} else {
var _local9 = (y2 - y1) / _local7;
var _local8 = (_local10 - _local6) / _local5;
if (_local9 == _local8) {
return(false);
}
var _local14 = y1 - (_local9 * x1);
var _local13 = _local6 - (_local8 * _local4);
var _local12 = _local8 - _local9;
_local2 = (_local14 - _local13) / _local12;
_local3 = ((_local8 * _local14) - (_local9 * _local13)) / _local12;
}
if (!full) {
if (_local7 > 0) {
if ((_local2 < x1) || (_local2 > x2)) {
return(false);
}
} else if (_local7 < 0) {
if ((_local2 > x1) || (_local2 < x2)) {
return(false);
}
} else if (((_local3 < y1) && (_local3 < y2)) || ((_local3 > y1) && (_local3 > y2))) {
return(false);
}
if (_local5 > 0) {
if ((_local2 < _local4) || (_local2 > _local11)) {
return(false);
}
} else if (_local5 < 0) {
if ((_local2 > _local4) || (_local2 < _local11)) {
return(false);
}
} else if (((_local3 < _local6) && (_local3 < _local10)) || ((_local3 > _local6) && (_local3 > _local10))) {
return(false);
}
}
return(new cust.geom2D.Vector(_local2, _local3));
}
function mark(mc, linestyle) {
if (linestyle) {
mc.lineStyle((linestyle.thickness ? (linestyle.thickness) : 0), (linestyle.rgb ? (linestyle.rgb) : 0), ((linestyle.alpha != undefined) ? (linestyle.alpha) : 100));
}
mc.moveTo(x1, y1);
mc.lineTo(x2, y2);
}
function toString() {
return((start.toString() + ", ") + end.toString());
}
function get c() {
return(y1 - (m * x1));
}
function get m() {
return((y2 - y1) / (x2 - x1));
}
function get length() {
return(Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1))));
}
function set length(l) {
var _local2 = radians;
x2 = x1 + (l * Math.cos(_local2));
y2 = y1 + (l * Math.sin(_local2));
//return(length);
}
function get radians() {
return(Math.atan2(y2 - y1, x2 - x1));
}
function set radians(r) {
var _local2 = length;
x2 = x1 + (_local2 * Math.cos(r));
y2 = y1 + (_local2 * Math.sin(r));
//return(radians);
}
function get degrees() {
return(Math.atan2(y2 - y1, x2 - x1) * rd);
}
function set degrees(d) {
var _local2 = length;
x2 = x1 + (_local2 * Math.cos(d * dr));
y2 = y1 + (_local2 * Math.sin(d * dr));
//return(degrees);
}
function get isVertical() {
var _local2 = m;
return((m == Number.POSITIVE_INFINITY) || (m == Number.NEGATIVE_INFINITY));
}
function get isHorizontal() {
return(m == 0);
}
function get start() {
return(new cust.geom2D.Vector(x1, y1));
}
function set start(p) {
x1 = p.x;
y1 = p.y;
//return(start);
}
function get end() {
return(new cust.geom2D.Vector(x2, y2));
}
function set end(p) {
x2 = p.x;
y2 = p.y;
//return(end);
}
static function fromPolar(m, a, p) {
if (p) {
var _local1 = p.x;
var _local2 = p.y;
} else {
var _local1 = 0;
var _local2 = 0;
}
return(new cust.geom2D.LineSegment(_local1, _local2, _local1 + (m * Math.cos(a)), _local2 + (m * Math.sin(a))));
}
static function fromPoints(p1, p2) {
if (p2) {
return(new cust.geom2D.LineSegment(p1.x, p1.y, p2.x, p2.y));
}
return(new cust.geom2D.LineSegment(0, 0, p1.x, p1.y));
}
static var rd = 57.2957795130823;
static var dr = (Math.PI/180);
}
Symbol 637 MovieClip [__Packages.cust.geom2D.Vector] Frame 0
class cust.geom2D.Vector extends flash.geom.Point
{
var x, y;
function Vector (a, b) {
super();
x = a;
y = b;
}
function mark(mc, linestyle) {
if (linestyle) {
mc.lineStyle((linestyle.thickness ? (linestyle.thickness) : 0), (linestyle.rgb ? (linestyle.rgb) : 0), ((linestyle.alpha != undefined) ? (linestyle.alpha) : 100));
}
mc.moveTo(x - 2, y - 2);
mc.lineTo(x + 2, y + 2);
mc.moveTo(x + 2, y - 2);
mc.lineTo(x - 2, y + 2);
}
function reflect(n) {
n.__set__length(1);
return(subtract(n.multiply(2 * dot(n))));
}
function angleBetweenVector(p) {
return(Math.acos(dot(p) / (length * p.__get__length())));
}
function angleBetweenVector2(p) {
var _local2 = Math.acos(dot(p) / (length * p.__get__length()));
var _local4 = (((p.__get__angle() - angle) + 9.42477796076938) % (Math.PI*2)) - Math.PI;
if (_local4 < 0) {
_local2 = _local2 * -1;
}
return(_local2);
}
function dot(v) {
return((x * v.x) + (y * v.y));
}
function multiply(m) {
return(new cust.geom2D.Vector(x * m, y * m));
}
function subtract(p) {
return(new cust.geom2D.Vector(x - p.x, y - p.y));
}
function toString() {
return(((("{ x:" + x) + ", y:") + y) + " }");
}
function get normal() {
var _local2 = angle;
return(new cust.geom2D.Vector(Math.cos(_local2), Math.sin(_local2)));
}
function get length() {
return(Math.sqrt((x * x) + (y * y)));
}
function set length(l) {
var _local2 = Math.atan2(y, x);
x = l * Math.cos(_local2);
y = l * Math.sin(_local2);
//return(length);
}
function get angle() {
return(Math.atan2(y, x));
}
function set angle(a) {
var _local2 = length;
x = _local2 * Math.cos(a);
y = _local2 * Math.sin(a);
//return(angle);
}
static function angleBetween(v1, v2) {
return(Math.atan2(v2.y - v1.y, v2.x - v1.x));
}
static function interpolate(p1, p2, f) {
return(new cust.geom2D.Vector(p1.x + (Math.abs(p1.x - p2.x) * f), p1.y + (Math.abs(p1.y - p2.y) * f)));
}
static function polar(l, a) {
return(new cust.geom2D.Vector(l * Math.cos(a), l * Math.sin(a)));
}
}
Symbol 638 MovieClip [__Packages.ICEComponentCollection] Frame 0
class ICEComponentCollection extends Array
{
var splice;
function ICEComponentCollection () {
super();
splice.apply(this, [0, 0].concat(arguments));
_global.ASSetPropFlags(this, "onLoad", 1);
}
function getMax(prop) {
var _local2 = [].concat(this);
switch (prop) {
case BASS :
_local2.sortOn(BASS, Array.DESCENDING | Array.NUMERIC);
return(_local2[0].bass);
case QUAL :
_local2.sortOn(QUAL, Array.DESCENDING | Array.NUMERIC);
return(_local2[0].qual);
case VOL :
_local2.sortOn(VOL, Array.DESCENDING | Array.NUMERIC);
return(_local2[0].vol);
case BAT :
_local2.sortOn(BAT, Array.DESCENDING | Array.NUMERIC);
return(_local2[0].bat);
case PRICE :
_local2.sortOn(PRICE, Array.DESCENDING | Array.NUMERIC);
return(_local2[0].price);
}
return(-1);
}
var equipped = 0;
static var BASS = "bass";
static var QUAL = "qual";
static var VOL = "vol";
static var BAT = "bat";
static var PRICE = "price";
}
Symbol 639 MovieClip [__Packages.ICEComponent] Frame 0
class ICEComponent
{
var bass, qual, vol, bat, price;
function ICEComponent (b, q, v, d, p) {
bass = b;
qual = q;
vol = v;
bat = d;
price = p;
}
}
Symbol 640 MovieClip [__Packages.ICE] Frame 0
class ICE
{
static var game, area, car, boom, radius, overall, ripple, filter, m, maxVol, sndQual, bass, batDrain, batRe, hurt, _power;
function ICE () {
}
static function init(g, c) {
game = g;
area = game.area;
car = c;
boom = car.boom;
setVals();
radius = new cust.geom2D.Circle();
radius.r = (Math.atan2(overall * Math.PI, 50) / 1.41296513650674) * MAX_RANGE;
power = (MAX_BAT);
ripple = new flash.display.BitmapData(RIPPLE_BASE_RAD * 2, RIPPLE_BASE_RAD * 2, false, FILTER_BASE_COL);
filter = new flash.filters.DisplacementMapFilter(ripple, new flash.geom.Point(), 1, 1, 10, 10);
m = new flash.geom.Matrix();
}
static function setVals() {
maxVol = (sndQual = (bass = _global.carUpgrades.ICEPower[_global.upgradesLevels.ICEPower]));
batDrain = _global.carUpgrades.ICEEfficiency[_global.upgradesLevels.ICEPower];
batRe = _global.carUpgrades.ICECharge[_global.upgradesLevels.ICEEfficiency];
bass = (bass / MAX_BASS) * 100;
sndQual = (sndQual / MAX_SND_QUAL) * 100;
maxVol = (maxVol / MAX_MAX_VOL) * 100;
overall = ((bass + sndQual) + maxVol) / 3;
}
static function get MAX_BASS() {
return((((HEADUNITS.getMax(ICEComponentCollection.BASS) + AMPS.getMax(ICEComponentCollection.BASS)) + SPEAKERS.getMax(ICEComponentCollection.BASS)) + SUBS.getMax(ICEComponentCollection.BASS)) * ELECT_UPGR_BONUS);
}
static function get MAX_SND_QUAL() {
return((((HEADUNITS.getMax(ICEComponentCollection.QUAL) + AMPS.getMax(ICEComponentCollection.QUAL)) + SPEAKERS.getMax(ICEComponentCollection.QUAL)) + SUBS.getMax(ICEComponentCollection.QUAL)) * ELECT_UPGR_BONUS);
}
static function get MAX_MAX_VOL() {
return((((HEADUNITS.getMax(ICEComponentCollection.VOL) + AMPS.getMax(ICEComponentCollection.VOL)) + SPEAKERS.getMax(ICEComponentCollection.VOL)) + SUBS.getMax(ICEComponentCollection.VOL)) * ELECT_UPGR_BONUS);
}
static function update(deltaTime, isAttacking) {
if (isAttacking) {
var _local6 = power;
var _local5 = batDrain * deltaTime;
if ((_local6 - _local5) >= 0) {
m.identity();
m.translate(-RIPPLE_BASE_RAD, -RIPPLE_BASE_RAD);
m.scale((radius.r + WAVE_RAD_ADD) / RIPPLE_BASE_RAD, (radius.r + WAVE_RAD_ADD) / RIPPLE_BASE_RAD);
m.translate(RIPPLE_BASE_RAD, RIPPLE_BASE_RAD);
ripple.fillRect(ripple.rectangle, FILTER_BASE_COL);
ripple.draw(game.rippling, m);
filter.mapPoint = new flash.geom.Point((car.x - game.viewRect.x) - 128, (car.y - game.viewRect.y) - 128);
area.filters = [filter];
game.musicSnd.setVolume(100);
radius.x = car.x;
radius.y = car.y;
var _local2 = area.getTilesInCircle(radius);
var _local3 = {};
var _local1 = _local2.length - 1;
while (_local1 > -1) {
if (_local2[_local1].isHurtable) {
_local2[_local1].health = _local2[_local1].health - getPowerAt(getDistToTile(car.x, car.y, _local2[_local1]));
_local3[_local2[_local1].name] = _local2[_local1];
}
_local1--;
}
} else {
area.filters = [];
game.musicSnd.setVolume(40);
}
power = (_local6 - _local5);
} else {
area.filters = [];
game.musicSnd.setVolume(40);
}
for (var _local4 in _local3) {
_local3[_local4].pain(false);
delete hurt[_local4];
}
for (var _local4 in hurt) {
hurt[_local4].pain(true);
}
hurt = _local3;
power = power + (batRe * deltaTime);
}
static function getDistToTile(x, y, t) {
return(Math.sqrt(Math.pow(x - ((t.x + 0.5) * area.tWidth), 2), Math.pow(y - ((t.y + 0.5) * area.tHeight), 2)));
}
static function getPowerAt(d) {
var _local1 = (d / radius.r) * overall;
return(((_local1 > 0) ? (_local1) : 0));
}
static function get power() {
return(_power);
}
static function set power(p) {
_power = p;
_power = ((_power > MAX_BAT) ? (MAX_BAT) : (((_power < MIN_BAT) ? (MIN_BAT) : (_power))));
//return(power);
}
static function toString() {
return((((((((HEADUNITS.equipped + SEPARATOR) + AMPS.equipped) + SEPARATOR) + SUBS.equipped) + SEPARATOR) + SPEAKERS.equipped) + SEPARATOR) + ELECTRICAL.equipped);
}
static function fromString(s) {
var _local1 = s.split(SEPARATOR);
HEADUNITS.equipped = _local1[0];
AMPS.equipped = _local1[1];
SUBS.equipped = _local1[2];
SPEAKERS.equipped = _local1[3];
ELECTRICAL.equipped = _local1[4];
}
static var MAX_RANGE = 120;
static var MIN_BAT = -0.2;
static var MAX_BAT = 18;
static var BOOM_BASE_RAD = 16;
static var RIPPLE_BASE_RAD = 127.5;
static var FILTER_BASE_COL = 8421504;
static var WAVE_RAD_ADD = 20;
static var BASE_BAT_RECHARGE = 1;
static var UPGRADE_BAT_RECHARGE = BASE_BAT_RECHARGE * 2;
static var SHOW = "show";
static var HIDE = "hide";
static var SEPARATOR = ",";
static var HEADUNITS = new ICEComponentCollection(new ICEComponent(0, 0, 0, 0, 0), new ICEComponent(2, 2, 2, 2.5, 100), new ICEComponent(3, 5, 4, 3.5, 200), new ICEComponent(4, 8, 4, 4.5, 300));
static var AMPS = new ICEComponentCollection(new ICEComponent(0, 0, 0, 0, 0), new ICEComponent(5, 7, 10, 4, 250), new ICEComponent(6, 7, 11, 6, 500));
static var SPEAKERS = new ICEComponentCollection(new ICEComponent(0, 0, 0, 0, 0), new ICEComponent(3, 5, 4, 0, 150), new ICEComponent(4, 6, 4, 0, 250), new ICEComponent(5, 7, 4, 0, 350));
static var SUBS = new ICEComponentCollection(new ICEComponent(0, 0, 0, 0, 0), new ICEComponent(9, 6, 7, 0, 250), new ICEComponent(11, 7, 7, 0, 500));
static var ELECTRICAL = new ICEComponentCollection(new ICEComponent(0, 0, 0, 0, 0), new ICEComponent(0, 0, 0, 0, 200));
static var ELECT_UPGR_BONUS = 1.2;
}
Symbol 641 MovieClip [__Packages.cust.geom2D.Circle] Frame 0
class cust.geom2D.Circle extends cust.geom2D.Vector
{
var x, y;
function Circle (ix, iy, ir) {
super();
x = ix;
y = iy;
r = ir;
}
function xAtY(yp) {
yp = yp - y;
if ((yp <= r) && (yp >= (-r))) {
return(x + (r * Math.sin(Math.acos(y / r))));
}
return(false);
}
function mark(mc, linestyle, fillstyle) {
if (linestyle) {
mc.lineStyle((linestyle.thickness ? (linestyle.thickness) : 0), (linestyle.rgb ? (linestyle.rgb) : 0), ((linestyle.alpha != undefined) ? (linestyle.alpha) : 100));
}
if (fillstyle) {
mc.beginFill((fillstyle.rgb ? (fillstyle.rgb) : 0), ((fillstyle.alpha != undefined) ? (fillstyle.alpha) : 100));
}
mc.moveTo(x + r, y);
mc.curveTo(r + x, (0.414213562373095 * r) + y, (0.707106781186547 * r) + x, (0.707106781186547 * r) + y);
mc.curveTo((0.414213562373095 * r) + x, r + y, x, r + y);
mc.curveTo((-0.414213562373095 * r) + x, r + y, (-0.707106781186547 * r) + x, (0.707106781186547 * r) + y);
mc.curveTo((-r) + x, (0.414213562373095 * r) + y, (-r) + x, y);
mc.curveTo((-r) + x, (-0.414213562373095 * r) + y, (-0.707106781186547 * r) + x, (-0.707106781186547 * r) + y);
mc.curveTo((-0.414213562373095 * r) + x, (-r) + y, x, (-r) + y);
mc.curveTo((0.414213562373095 * r) + x, (-r) + y, (0.707106781186547 * r) + x, (-0.707106781186547 * r) + y);
mc.curveTo(r + x, (-0.414213562373095 * r) + y, r + x, y);
if (fillstyle) {
mc.endFill();
}
}
function toString() {
return(((((("(x=" + x) + ", y=") + y) + ", r=") + r) + ")");
}
var r = 0;
}
Symbol 642 MovieClip [__Packages.cust.tiles.Tile] Frame 0
class cust.tiles.Tile
{
var area, x, y, d, status, t, r, b, l, bb, top, right, bottom, left, mc, bmp, pain_mc, type, block, isHurtable;
function Tile (a, tx, ty) {
area = a;
x = tx;
y = ty;
d = area.getTileDepth(x, y);
status = "";
t = y * area.tHeight;
r = (x + 1) * area.tWidth;
b = (y + 1) * area.tHeight;
l = x * area.tWidth;
bb = new flash.geom.Rectangle(l, t, r - l, b - t);
}
function init() {
if (!area.getTileAt(x, y - 1).block) {
top = new cust.geom2D.LineSegment(l, t, r, t);
}
if (!area.getTileAt(x + 1, y).block) {
right = new cust.geom2D.LineSegment(r, t, r, b);
}
if (!area.getTileAt(x, y + 1).block) {
bottom = new cust.geom2D.LineSegment(r, b, l, b);
}
if (!area.getTileAt(x - 1, y).block) {
left = new cust.geom2D.LineSegment(l, b, l, t);
}
}
function die() {
if (mc) {
mc.removeMovieClip();
}
}
function showTile() {
mc = area.createEmptyMovieClip((("t" + x) + "-") + y, d);
mc._x = x * area.tWidth;
mc._y = y * area.tHeight;
if (area.game.test) {
mc.onRelease = cust.Misc.Delegate.create(this, function () {
});
}
mc.attachBitmap(bmp, 0, "never", false);
}
function hideTile() {
mc.removeMovieClip();
delete pain_mc;
delete mc;
}
function getLines(x, y) {
var _local2 = [];
if ((y < t) && (top)) {
_local2[_local2.length] = top;
}
if ((x > r) && (right)) {
_local2[_local2.length] = right;
}
if ((y > b) && (bottom)) {
_local2[_local2.length] = bottom;
}
if ((x < l) && (left)) {
_local2[_local2.length] = left;
}
return(_local2);
}
function getCoords() {
return(new flash.geom.Point((x + (type.width * 0.5)) * area.tWidth, (y + (type.height * 0.5)) * area.tHeight));
}
function toString() {
return(((((((((((("[type:" + type.id) + " x:") + x) + ", y:") + y) + ", isHurtable:") + isHurtable) + ", block:") + block) + ", status:") + status) + "]");
}
static var BONUS = "bonus";
static var TARGET = "target";
static var AVOID = "avoid";
static var MAX_PAIN_DIST = 3;
}
Symbol 643 MovieClip [__Packages.Collision] Frame 0
class Collision
{
var type, hit, f;
function Collision (t, h, frac) {
type = t;
hit = h;
f = frac;
}
function closest(c) {
return(((c.f < f) ? (c) : this));
}
function toString() {
return(((((("{type=" + type) + ", f=") + f) + ", hit=") + hit) + "}");
}
static var EDGE = "edge";
static var POINT = "point";
}
Symbol 644 MovieClip [__Packages.cust.geom2D.Intersection] Frame 0
class cust.geom2D.Intersection extends Array
{
var a, b, length, type;
function Intersection (oa, ob) {
super();
a = oa;
b = ob;
}
function toString() {
return(((("[object Intersection type:" + type) + ", length:") + length) + "]");
}
static function lineSegmentLineSegment(l1, l2) {
var _local1 = new cust.geom2D.Intersection(l1, l2);
var _local5 = l1.x1;
var _local7 = l1.y1;
var _local13 = l1.x2;
var _local11 = l1.y2;
var _local3 = 0;
var _local4 = 0;
var _local8 = l2.x2 - l2.x1;
var _local6 = _local13 - _local5;
if (!_local8) {
if (!_local6) {
_local1.type = NONE;
return(_local1);
}
_local3 = l2.x1;
_local4 = _local7 + (((_local11 - _local7) * (l2.x1 - _local5)) / _local6);
} else if (!_local6) {
_local3 = _local5;
_local4 = l2.y1 + (((l2.y2 - l2.y1) * (_local5 - l2.x1)) / _local8);
} else {
var _local10 = (l2.y2 - l2.y1) / _local8;
var _local9 = (_local11 - _local7) / _local6;
if (_local10 == _local9) {
_local1.type = PARALLEL;
return(_local1);
}
var _local16 = l2.y1 - (_local10 * l2.x1);
var _local15 = _local7 - (_local9 * _local5);
var _local14 = _local9 - _local10;
_local3 = (_local16 - _local15) / _local14;
_local4 = ((_local9 * _local16) - (_local10 * _local15)) / _local14;
}
if (_local8 > 0) {
if ((_local3 < l2.x1) || (_local3 > l2.x2)) {
_local1.type = NONE;
return(_local1);
}
} else if (_local8 < 0) {
if ((_local3 > l2.x1) || (_local3 < l2.x2)) {
_local1.type = NONE;
return(_local1);
}
} else if (((_local4 < l2.y1) && (_local4 < l2.y2)) || ((_local4 > l2.y1) && (_local4 > l2.y2))) {
_local1.type = NONE;
return(_local1);
}
if (_local6 > 0) {
if ((_local3 < _local5) || (_local3 > _local13)) {
_local1.type = NONE;
return(_local1);
}
} else if (_local6 < 0) {
if ((_local3 > _local5) || (_local3 < _local13)) {
_local1.type = NONE;
return(_local1);
}
} else if (((_local4 < _local7) && (_local4 < _local11)) || ((_local4 > _local7) && (_local4 > _local11))) {
_local1.type = NONE;
return(_local1);
}
_local1.type = INTERSECTION;
_local1[0] = new cust.geom2D.Vector(_local3, _local4);
return(_local1);
}
static function circleLineSegment(c, l) {
var _local2 = new cust.geom2D.Intersection();
var _local1 = l.__get__start();
var _local4 = l.__get__end();
var _local9 = ((_local4.x - _local1.x) * (_local4.x - _local1.x)) + ((_local4.y - _local1.y) * (_local4.y - _local1.y));
var _local7 = 2 * (((_local4.x - _local1.x) * (_local1.x - c.x)) + ((_local4.y - _local1.y) * (_local1.y - c.y)));
var _local11 = (((((c.x * c.x) + (c.y * c.y)) + (_local1.x * _local1.x)) + (_local1.y * _local1.y)) - (2 * ((c.x * _local1.x) + (c.y * _local1.y)))) - (c.r * c.r);
var _local8 = (_local7 * _local7) - ((4 * _local9) * _local11);
if (_local8 < 0) {
_local2.type = OUTSIDE;
} else if (_local8 == 0) {
_local2.type = TANGENT;
} else {
var _local10 = Math.sqrt(_local8);
var _local6 = ((-_local7) + _local10) / (2 * _local9);
var _local5 = ((-_local7) - _local10) / (2 * _local9);
if (((_local6 < 0) || (_local6 > 1)) && ((_local5 < 0) || (_local5 > 1))) {
if (((_local6 < 0) && (_local5 < 0)) || ((_local6 > 1) && (_local5 > 1))) {
_local2.type = OUTSIDE;
} else {
_local2.type = INSIDE;
}
} else {
_local2.type = INTERSECTION;
if ((0 <= _local6) && (_local6 <= 1)) {
_local2[_local2.length] = cust.geom2D.Vector.interpolate(_local1, _local4, _local6);
}
if ((0 <= _local5) && (_local5 <= 1)) {
_local2[_local2.length] = cust.geom2D.Vector.interpolate(_local1, _local4, _local5);
}
}
}
return(_local2);
}
static var NONE = "none";
static var INTERSECTION = "intersection";
static var INSIDE = "inside";
static var OUTSIDE = "outside";
static var PARALLEL = "parallel";
static var TANGENT = "tangent";
}
Symbol 645 MovieClip [__Packages.cust.tiles.SubTile] Frame 0
class cust.tiles.SubTile extends cust.tiles.Tile
{
var masterTile, name, sx, sy;
function SubTile (a, tx, ty, mt, sx, sy) {
super(a, tx, ty);
masterTile = mt;
masterTile.addSubTile(this, sx, sy);
name = (("t" + masterTile.x) + "-") + masterTile.y;
this.sx = sx;
this.sy = sy;
}
function setType(t) {
masterTile.setType(t);
}
function pain(over) {
masterTile.pain(over);
}
function get health() {
return(masterTile.__get__health());
}
function set health(h) {
masterTile.__set__health(h);
//return(health);
}
function get maxHealth() {
return(masterTile.maxHealth);
}
function set maxHealth(h) {
masterTile.maxHealth = h;
//return(maxHealth);
}
function get status() {
return(masterTile.__get__status());
}
function set status(s) {
masterTile.__set__status(s);
//return(status);
}
function get isHurtable() {
return(masterTile.__get__isHurtable());
}
function set isHurtable(b) {
masterTile.__set__isHurtable(b);
//return(isHurtable);
}
}
Symbol 646 MovieClip [__Packages.cust.gui.Map] Frame 0
class cust.gui.Map extends MovieClip
{
var r, ix, _x, iy, _y, attachMovie, player, scrollRect, bmp, game, area, attachBitmap;
function Map () {
super();
r = new flash.geom.Rectangle(0, 0, width, height);
ix = _x;
iy = _y;
attachMovie(PLAYER_LINKAGE, "player", 1);
player._visible = false;
scrollRect = r;
}
function init(g, a) {
bmp.dispose();
game = g;
area = a;
bmp = new flash.display.BitmapData(a.cols * SCALE, a.rows * SCALE, false, BASE_COL);
var _local4;
var _local3;
var _local6;
var _local2;
_local4 = 0;
while (_local4 < a.cols) {
_local3 = 0;
while (_local3 < a.rows) {
_local2 = a.getTileAt(_local4, _local3);
if (!_local2) {
drawRect(bmp, BASE_COL, _local4 * SCALE, _local3 * SCALE, SCALE, SCALE);
} else if (!_local2.block) {
drawRect(bmp, ROAD_COL, _local4 * SCALE, _local3 * SCALE, SCALE, SCALE);
} else if (_local2.isHurtable && (_local2.status != "")) {
_local6 = ((_local2.status == cust.tiles.Tile.TARGET) ? (TARG_COL) : (((_local2.status == cust.tiles.Tile.AVOID) ? (AVOID_COL) : (BONUS_COL))));
drawRect(bmp, _local6, _local4 * SCALE, _local3 * SCALE, SCALE, SCALE);
}
_local3++;
}
_local4++;
}
attachBitmap(bmp, 0);
player._visible = true;
update(game.car.x, game.car.y, game.car.ang);
}
function update(x, y, a) {
x = (x / area.tWidth) * SCALE;
y = (y / area.tHeight) * SCALE;
if (bmp.width <= width) {
r.x = 0;
_x = ix + ((width - bmp.width) / 2);
} else {
_x = ix;
var _local3 = x - (r.width / 2);
r.x = ((_local3 <= 0) ? 0 : ((((_local3 + r.width) > bmp.width) ? (bmp.width - r.width) : (_local3))));
}
if (bmp.height <= height) {
r.y = 0;
_y = iy + ((height - bmp.height) / 2);
} else {
_y = iy;
var _local2 = y - (r.width / 2);
r.y = ((_local2 <= 0) ? 0 : ((((_local2 + r.height) > bmp.height) ? (bmp.height - r.height) : (_local2))));
}
scrollRect = r;
player._x = x;
player._y = y;
player._rotation = a * Misc.rd;
}
function drawRect(b, col, x, y, width, height) {
var _local4 = y;
var _local7 = x + width;
var _local3 = y + height;
while (x < _local7) {
y = _local4;
while (y < _local3) {
b.setPixel(x, y, col);
y++;
}
x++;
}
}
var width = 156;
var height = 156;
static var SCALE = 2;
static var BASE_COL = 26367;
static var BONUS_COL = 16776960;
static var ROAD_COL = 13158;
static var TARG_COL = 65280;
static var AVOID_COL = 16711680;
var PLAYER_LINKAGE = "map_player_ind";
}
Symbol 647 MovieClip [__Packages.cust.tiles.SingleTile] Frame 0
class cust.tiles.SingleTile extends cust.tiles.Tile
{
var name, y, x, bmp, type, block, mc, pain_mc;
function SingleTile (a, t, tx, ty) {
super(a, tx, ty);
name = (("t" + x) + "-") + y;
bmp = type.bmp;
setType(t);
}
function setType(t) {
type = t;
bmp = type.bmp;
block = type.block;
}
function pain(over) {
if (over) {
if (mc) {
if (pain_mc) {
pain_mc.removeMovieClip();
delete pain_mc;
}
}
} else {
var _local2 = Math.round((pd * cust.tiles.Tile.MAX_PAIN_DIST) * Math.random());
if (mc) {
if (!pain_mc) {
pain_mc = mc.createEmptyMovieClip("pain", 1);
pain_mc.attachBitmap(bmp, 0);
}
pain_mc._x = _local2;
}
pd = pd * -1;
}
}
function get health() {
return(_health);
}
function set health(h) {
if (h <= 0) {
die();
} else {
_health = h;
}
//return(health);
}
function die() {
isHurtable = false;
}
var _health = 0;
var isHurtable = false;
var pd = 1;
}
Symbol 648 MovieClip [__Packages.cust.gui.Gui] Frame 0
class cust.gui.Gui extends MovieClip
{
var dialFullWidth, speedo, game, area, map, crosshair, targInd, battery, targetTime_txt;
function Gui () {
super();
dialFullWidth = speedo.mask._width;
}
function init(g) {
game = g;
area = game.area;
map.init(game, game.area);
}
function update(deltaTime, targ) {
var _local2 = area.getTileAt(targ.t.x, targ.t.y).getCoords();
crosshair._x = _local2.x - game.viewRect.x;
crosshair._y = _local2.y - game.viewRect.y;
if (game.takeInput && (!game.viewRect.containsPoint(_local2))) {
targInd._visible = true;
var _local6 = Math.sqrt(Math.pow(_local2.x - game.car.x, 2) + Math.pow(_local2.y - game.car.y, 2)) / PIXELS_PER_M;
var _local8 = Math.atan2(_local2.y - game.car.y, _local2.x - game.car.x);
_local2.x = _local2.x - (game.viewRect.x + (game.viewRect.width / 2));
_local2.y = _local2.y - (game.viewRect.y + (game.viewRect.height / 2));
var _local3 = Math.atan2(_local2.y, _local2.x);
var _local5 = (game.viewRect.width - TARG_IND_PAD) / 2;
var _local4 = (game.viewRect.height - TARG_IND_PAD) / 2;
targInd._x = (TARG_IND_PAD + _local5) + ((_local2.y > 0) ? (_local4 / Math.tan(_local3)) : (-(_local4 / Math.tan(_local3))));
targInd._x = ((targInd._x < TARG_IND_PAD) ? (TARG_IND_PAD) : (((targInd._x > (game.viewRect.width - TARG_IND_PAD)) ? (game.viewRect.width - TARG_IND_PAD) : (targInd._x))));
targInd._y = (TARG_IND_PAD + _local4) + ((_local2.x > 0) ? (_local5 * Math.tan(_local3)) : (-(_local5 * Math.tan(_local3))));
targInd._y = ((targInd._y < TARG_IND_PAD) ? (TARG_IND_PAD) : (((targInd._y > (game.viewRect.height - TARG_IND_PAD)) ? (game.viewRect.height - TARG_IND_PAD) : (targInd._y))));
targInd.direction_mc._rotation = _local8 * Misc.rd;
targInd.dist_txt.text = Math.floor(_local6) + "m";
} else {
targInd._visible = false;
}
map.update(game.car.x, game.car.y, game.car.ang);
speedo.speed_txt.text = String(Math.round((game.car.speed / PIXELS_PER_M) * 3.6));
speedo.mask._width = Math.abs((game.car.speed / game.car.maxSpeed) * dialFullWidth);
battery.mask._width = (ICE.__get__power() / ICE.MAX_BAT) * dialFullWidth;
targetTime_txt.text = formatTime(targ.time * 1000);
}
function gameover() {
crosshair._visible = (targInd._visible = false);
}
function formatTime(n) {
n = (isNaN(n) ? 0 : (n));
var _local4 = Math.floor(n / 60000);
var _local2 = Math.floor((n % 60000) / 1000);
var _local3 = Math.floor((n % 1000) / 10);
return(((((_local4 + ":") + ((_local2 < 10) ? "0" : "")) + _local2) + ":") + (((_local3 < 10) ? "0" : "") + _local3));
}
static var PIXELS_PER_M = 9.18;
static var TARG_IND_PAD = 30;
}
Symbol 649 MovieClip [__Packages.cust.gui.Messages] Frame 0
class cust.gui.Messages extends MovieClip
{
var _queue, stop, gotoAndStop, msg_mc;
function Messages () {
super();
_queue = [];
stop();
}
function addMsg(s) {
if (_playing) {
_queue[_queue.length] = s;
} else {
playMsg(s);
}
}
function playMsg(s) {
gotoAndStop(SHOW);
msg_mc.stop();
msg_mc.msg = s;
_playing = true;
_global.setTimeout(this, "msgOver", 1000);
}
function msgOver() {
gotoAndStop(HIDE);
_playing = false;
if (_queue.length) {
playMsg(_queue.shift());
}
}
var _playing = false;
static var SHOW = "show";
static var HIDE = "hide";
}
Symbol 650 MovieClip [__Packages.cust.tiles.TargetStatus] Frame 0
class cust.tiles.TargetStatus
{
var t, time;
function TargetStatus (targ) {
t = targ;
time = t.time;
}
var available = true;
}
Symbol 651 MovieClip [__Packages.Language] Frame 0
class Language
{
var loadStatus, prog, xml, path, lang, onLoad, onLoadError, onLoadRetry, intId;
function Language () {
loadStatus = "loading";
prog = 0;
xml = new XML();
xml.ignoreWhite = true;
xml.onLoad = cust.Misc.Delegate.create(this, onXMLLoad);
xml.onData = cust.Misc.Delegate.create(this, onXMLData);
}
function init(lang, path, onload, onloaderror, onloadretry) {
this.path = (path ? (path) : "");
this.lang = lang;
onLoad = onload;
onLoadError = onloaderror;
onLoadRetry = onloadretry;
_global.ASSetPropFlags(this, "onLoad", 1);
intId = setInterval(this, "monitorProgress", 50);
xml.load((path + lang) + ".xml");
}
function onXMLData(xmlstr) {
if (xmlstr == undefined) {
xml.onLoad(false);
} else {
if (xmlstr.substr(0, COMPRESSED.length) == COMPRESSED) {
xml.parseXML(cust.Misc.LZW.decompress(xmlstr.substr(COMPRESSED.length)));
} else {
xml.parseXML(xmlstr);
}
xml.loaded = true;
xml.onLoad(true);
}
}
function parse() {
var _local4 = xml.firstChild;
var _local3;
var _local2 = 0;
while (_local2 < _local4.childNodes.length) {
_local3 = _local4.childNodes[_local2];
this[_local3.attributes.id] = _local3.firstChild.nodeValue;
_local2++;
}
}
function translate(id, vals) {
var _local2 = this[id];
var _local4 = "";
var _local3;
while (_local3 = _local2.indexOf("{") , _local3 > -1) {
_local4 = _local4 + _local2.substr(0, _local3);
_local2 = _local2.substr(_local3 + 1);
_local3 = _local2.indexOf("}");
_local4 = _local4 + vals[_local2.substr(0, _local3)];
_local2 = _local2.substr(_local3 + 1);
}
return(_local4 + _local2);
}
function onXMLLoad(success) {
if (intId) {
clearInterval(intId);
delete intId;
}
if (success) {
loadStatus = "complete";
xml.loaded = true;
prog = 1;
parse();
onLoad();
} else if (lang == defaultLang) {
if ((retries++) < maxLoadRetries) {
onLoadRetry(retries, maxLoadRetries);
init(lang, path, onLoad, onLoadError, onLoadRetry);
} else {
prog = 1;
loadStatus = "error";
onLoadError();
}
} else {
init(defaultLang, path, onLoad, onLoadError, onLoadRetry);
}
}
function monitorProgress() {
prog = xml.getBytesLoaded() / xml.getBytesTotal();
if (prog == 1) {
clearInterval(intId);
delete intId;
}
}
var retries = 0;
static var maxLoadRetries = 3;
static var defaultLang = "en";
static var COMPRESSED = "data:";
}
Symbol 652 MovieClip [__Packages.cust.tiles.MissionPerformance] Frame 0
class cust.tiles.MissionPerformance
{
var game, lvl, targets, numTargs, remTargs, numBonus, missionTime;
function MissionPerformance (g, level) {
game = g;
lvl = level;
targets = [];
var _local2 = 0;
while (_local2 < lvl.targets.length) {
targets[_local2] = new cust.tiles.TargetStatus(lvl.targets[_local2]);
_local2++;
}
numTargs = (remTargs = lvl.targets.length);
numBonus = 0;
}
function update(deltaTime) {
if (lvl.missionType == cust.tiles.Level.ORDERED) {
if (targets[curTarg].available) {
if (((targets[curTarg].time = targets[curTarg].time - deltaTime)) <= 0) {
game.showMessage(TARGET_OUT_OF_TIME);
targets[curTarg].available = false;
remTargs--;
curTarg = getNextTarget();
}
} else {
curTarg = getNextTarget();
}
} else {
var _local2 = 0;
while (_local2 < targets.length) {
if (targets[_local2].available) {
if (((targets[_local2].time = targets[_local2].time - deltaTime)) <= 0) {
game.showMessage(TARGET_OUT_OF_TIME);
targets[_local2].available = false;
remTargs--;
curTarg = getNextTarget();
}
}
_local2++;
}
}
if ((remTargs == 0) && (game.takeInput)) {
if (destTargs > 0) {
game.gameOver(Game.COMPLETE);
} else {
game.gameOver(Game.TIME_OUT);
}
}
}
function buildingDestroyed(t) {
var _local2;
_local2 = 0;
while (_local2 < lvl.avoid.length) {
if ((lvl.avoid[_local2].x == t.x) && (lvl.avoid[_local2].y == t.y)) {
game.gameOver(Game.DESTROYED_AVOID);
return(undefined);
}
_local2++;
}
_local2 = 0;
while (_local2 < lvl.targets.length) {
if ((lvl.targets[_local2].x == t.x) && (lvl.targets[_local2].y == t.y)) {
if (targets[_local2].available) {
if ((lvl.missionType == cust.tiles.Level.ORDERED) && (t != curTarg)) {
game.gameOver(Game.OUT_OF_ORDER);
} else {
game.showMessage(TARGET_DESTROYED);
targets[_local2].available = false;
remTargs--;
destTargs++;
curTarg = getNextTarget();
}
} else {
game.showMessage(TARGET_DESTROYED_LATE);
}
if (remTargs == 0) {
if (destTargs > 0) {
game.gameOver(Game.COMPLETE);
} else {
game.gameOver(Game.TIME_OUT);
}
}
return(undefined);
}
_local2++;
}
_local2 = 0;
while (_local2 < lvl.bonuses.length) {
if ((lvl.bonuses[_local2].x == t.x) && (lvl.bonuses[_local2].y == t.y)) {
destBonus++;
game.showMessage(BONUS_DESTROYED);
}
_local2++;
}
}
function getNextTarget() {
var _local2 = 0;
while (_local2 < targets.length) {
if (targets[_local2].available) {
return(_local2);
}
_local2++;
}
}
function getTarget(x, y) {
if (lvl.pointerType == cust.tiles.Level.ORDERED) {
return(targets[curTarg]);
}
var _local5;
var _local7;
var _local6;
var _local4;
var _local3;
var _local2 = 0;
while (_local2 < targets.length) {
if (targets[_local2].available) {
_local5 = game.area.getTileAt(lvl.targets[_local2].x, lvl.targets[_local2].y);
_local3 = _local5.getCoords();
_local3.x = _local3.x - x;
_local3.y = _local3.y - y;
_local4 = (_local3.x * _local3.x) + (_local3.y * _local3.y);
if (_local4 <= _local6) {
_local7 = targets[_local2];
_local6 = _local4;
}
}
_local2++;
}
return(_local7);
}
function missionOver(missionTime) {
_root.destroyed = destTargs;
_root.totalTargs = numTargs;
_root.optionalBuildings = destBonus;
_root.actualTime = (this.missionTime = missionTime / 1000);
_root.targetTime = lvl.parTime;
_root.difficultyBonus = lvl.difficulty;
}
var curTarg = 0;
var destTargs = 0;
var destBonus = 0;
static var TARGET_OUT_OF_TIME = "target_out_of_time";
static var TARGET_DESTROYED = "target_destroyed";
static var TARGET_DESTROYED_LATE = "target_destroyed_late";
static var BONUS_DESTROYED = "bonus_destroyed";
}
Symbol 653 MovieClip [__Packages.Keys] Frame 0
class Keys
{
static var _keys, _listeners;
function Keys () {
}
static function init() {
_keys = [];
_listeners = {};
Key.addListener(Keys);
AsBroadcaster.initialize(Keys);
}
static function onKeyDown() {
var _local7 = Key.getCode();
var _local6 = 0;
if (!_keys[_local7]) {
_keys[_local7] = true;
var _local2 = _listeners[ON_KEY_DOWN];
var _local4 = {target:Keys, type:ON_KEY_DOWN, key:_local7};
var _local3;
var _local5;
var _local1 = _local2.length - 1;
while (_local1 > -1) {
if (_local2[_local1].length == 1) {
if (typeof(_local2[_local1][0]) == FUNCTION) {
_local2[_local1][0](_local4);
} else {
_local2[_local1][0][ON_KEY_DOWN](_local4);
}
_local6++;
} else {
_local5 = true;
_local3 = _local2[_local1].length - 1;
while (_local3 > 0) {
if (!_keys[_local2[_local1][_local3]]) {
_local5 = false;
break;
}
_local3--;
}
if (_local5) {
if (typeof(_local2[_local1][0]) == FUNCTION) {
_local2[_local1][0](_local4);
} else {
_local2[_local1][0][ON_KEY_DOWN](_local4);
}
_local6++;
}
}
_local1--;
}
}
return(_local6);
}
static function onKeyUp() {
var _local7 = Key.getCode();
var _local8 = 0;
if (_keys[_local7]) {
_keys[_local7] = false;
var _local2 = _listeners[ON_KEY_UP];
var _local4 = {target:Keys, type:ON_KEY_UP, key:_local7};
var _local3;
var _local5;
var _local6;
var _local1 = _local2.length - 1;
while (_local1 > -1) {
if (_local2[_local1].length == 1) {
if (typeof(_local2[_local1][0]) == FUNCTION) {
_local2[_local1][0](_local4);
} else {
_local2[_local1][0][ON_KEY_UP](_local4);
}
_local8++;
} else {
_local5 = 0;
_local6 = false;
_local3 = _local2[_local1].length - 1;
while (_local3 > 0) {
if (_local2[_local1][_local3] == _local7) {
_local6 = true;
} else if (_keys[_local2[_local1][_local3]]) {
_local5++;
}
_local3--;
}
if ((_local5 == (_local2[_local1].length - 2)) && (_local6)) {
if (typeof(_local2[_local1][0]) == FUNCTION) {
_local2[_local1][0](_local4);
} else {
_local2[_local1][0][ON_KEY_UP](_local4);
}
_local8++;
}
}
_local1--;
}
}
return(_local8);
}
static function addEventListener(type, callback) {
if (!_listeners[type]) {
_listeners[type] = [];
}
removeEventListener(type, callback);
_listeners[type][_listeners.length] = arguments.slice(1);
}
static function removeEventListener(type, listener) {
var _local1 = _listeners.length - 1;
while (_local1 > -1) {
if (_listeners[type][_local1][0] == listener) {
_listeners[type].splice(_local1, 1);
}
_local1--;
}
}
static function getListeners(type) {
var _local2 = [];
var _local1 = _listeners[type].length - 1;
while (_local1 > -1) {
_local2[_local2.length] = _listeners[type][0];
_local1--;
}
return(_local2);
}
static function removeEventListeners(type) {
_listeners[type] = [];
}
static var ON_KEY_DOWN = "onKeyDown";
static var ON_KEY_UP = "onKeyUp";
static var FUNCTION = "function";
}
Symbol 654 MovieClip [__Packages.SmokePuff] Frame 0
class SmokePuff extends MovieClip
{
var t, stop, removeMovieClip, gotoAndStop, _totalframes;
function SmokePuff () {
super();
t = getTimer();
stop();
}
function onEnterFrame() {
if ((getTimer() - t) >= TIME) {
removeMovieClip();
} else {
gotoAndStop(Math.ceil(((getTimer() - t) / TIME) * _totalframes));
}
}
static var TIME = 450;
}
Symbol 655 MovieClip [__Packages.CarCalibra] Frame 0
class CarCalibra extends Car
{
function CarCalibra () {
super();
}
var power = 450;
var reverse = 360;
var brakes = 550;
var drag = 0.5;
var turnSpeed = 2.61799387799149;
var maxSpeed = (Car.prototype.accel / (1 - CarCalibra.prototype.drag)) - (Car.prototype.accel * CarCalibra.prototype.drag);
var handbreakThreshold = 350;
var endHandbreakThreshold = 200;
var handbreak = 350;
}
Symbol 656 MovieClip [__Packages.CarCRX] Frame 0
class CarCRX extends Car
{
function CarCRX () {
super();
}
var power = 400;
var reverse = 330;
var brakes = 600;
var drag = 0.5;
var turnSpeed = 2.87979326579064;
var maxSpeed = (Car.prototype.accel / (1 - CarCRX.prototype.drag)) - (Car.prototype.accel * CarCRX.prototype.drag);
var handbreakThreshold = 300;
var endHandbreakThreshold = 200;
var handbreak = 400;
}
Symbol 657 MovieClip [__Packages.CarMini] Frame 0
class CarMini extends Car
{
function CarMini () {
super();
}
var power = 350;
var reverse = 300;
var brakes = 550;
var drag = 0.48;
var turnSpeed = 2.87979326579064;
var maxSpeed = (Car.prototype.accel / (1 - CarMini.prototype.drag)) - (Car.prototype.accel * CarMini.prototype.drag);
var handbreakThreshold = 350;
var endHandbreakThreshold = 200;
var handbreak = 350;
}
Symbol 658 MovieClip [__Packages.CarSaxo] Frame 0
class CarSaxo extends Car
{
function CarSaxo () {
super();
}
var power = 400;
var reverse = 300;
var brakes = 500;
var drag = 0.49;
var turnSpeed = 3.66519142918809;
var maxSpeed = (Car.prototype.accel / (1 - CarSaxo.prototype.drag)) - (Car.prototype.accel * CarSaxo.prototype.drag);
var handbreakThreshold = 350;
var endHandbreakThreshold = 200;
var handbreak = 400;
}
Symbol 659 MovieClip [__Packages.CarSilvia] Frame 0
class CarSilvia extends Car
{
function CarSilvia () {
super();
}
var power = 400;
var reverse = 330;
var brakes = 500;
var drag = 0.5;
var turnSpeed = 2.35619449019234;
var maxSpeed = (Car.prototype.accel / (1 - CarSilvia.prototype.drag)) - (Car.prototype.accel * CarSilvia.prototype.drag);
var handbreakThreshold = 350;
var endHandbreakThreshold = 200;
var handbreak = 300;
}
Symbol 660 MovieClip [__Packages.TextArea] Frame 0
class TextArea extends MovieClip
{
var txt, content, useHandCursor, cacheAsBitmap, width, _width, height, _height, _xscale, _yscale, rect, attachMovie, scroller, fmt;
function TextArea () {
super();
txt = content.txt;
txt.html = true;
useHandCursor = false;
cacheAsBitmap = true;
width = _width;
height = _height;
_xscale = (_yscale = 100);
content.onRollOver = cust.Misc.Delegate.create(this, rollOver);
content.onRollOut = cust.Misc.Delegate.create(this, rollOut);
content.useHandCursor = false;
rect = new flash.geom.Rectangle(0, 0, width, height);
content.scrollRect = rect;
txt.autoSize = true;
txt.onChanged = onChanged;
attachMovie("textAreaScroller", "scroller", 2, {_x:width - scrollerWidth, _y:0, buttonSize:scrollerWidth});
scroller._visible = false;
}
function init(it, f) {
fmt = f;
fmt.apply(txt);
txt.text = it;
}
function onChanged(isUser) {
scroller._visible = false;
rect.width = (txt._width = width);
if (totalHeight > contentHeight) {
rect.width = (txt._width = width - scrollerWidth);
scroller._visible = true;
scroller.render();
}
content.scrollRect = rect;
yPos = (yPos);
}
function rollOver() {
Mouse.addListener(this);
}
function rollOut() {
Mouse.removeListener(this);
}
function onMouseWheel(d) {
yPos = yPos - (d * mWheelSpeed);
}
function get yPos() {
return(rect.y);
}
function set yPos(n) {
if (totalHeight > contentHeight) {
var _local2 = totalHeight - contentHeight;
rect.y = ((n > 0) ? (((n < _local2) ? (n) : (_local2))) : 0);
} else {
rect.y = 0;
}
content.scrollRect = rect;
scroller.render();
//return(yPos);
}
function get contentHeight() {
return(height);
}
function get totalHeight() {
return(content.transform.pixelBounds.height);
}
function get text() {
return(txt.htmlText);
}
function set text(s) {
txt.htmlText = s;
onChanged(false);
//return(text);
}
function toString() {
return(txt.text);
}
var mWheelSpeed = 5;
var scrollerWidth = 15;
}
Symbol 661 MovieClip [__Packages.TextAreaScroller] Frame 0
class TextAreaScroller extends MovieClip
{
var textArea, _parent, createEmptyMovieClip, attachMovie, slider, up_btn, dn_btn, base, _ymouse, intId, sliderMY;
function TextAreaScroller () {
super();
textArea = _parent;
createEmptyMovieClip("base", 0);
attachMovie(SCROLLER_BAR_LINKAGE, "slider", 1);
slider.height = slider._height;
createEmptyMovieClip("up_btn", 2);
createEmptyMovieClip("dn_btn", 3);
up_btn.dir = -1;
dn_btn.dir = 1;
var _local6 = new Draw({}, {c:baseCol, a:baseAlpha});
var _local7 = new Draw({}, {c:btnBaseCol, a:baseAlpha});
var _local5 = new Draw({}, {c:btnBaseOverCol, a:baseAlpha});
var _local10 = new Draw({}, {c:btnBaseDownCol, a:baseAlpha});
var _local4 = new Draw({}, {c:btnArrowCol, a:100});
var _local3 = up_btn.createEmptyMovieClip("out", 0);
_local7.rect(_local3, 0, 0, buttonSize, buttonHeight);
_local4.shape(_local3, [0, buttonHeight, buttonSize / 2, 0, buttonSize, buttonHeight]);
_local3 = up_btn.createEmptyMovieClip("over", 1);
_local5.rect(_local3, 0, 0, buttonSize, buttonHeight);
_local4.shape(_local3, [0, buttonHeight, buttonSize / 2, 0, buttonSize, buttonHeight]);
_local3._visible = false;
_local3 = up_btn.createEmptyMovieClip("down", 2);
_local5.rect(_local3, 0, 0, buttonSize, buttonHeight);
_local4.shape(_local3, [0, buttonHeight, buttonSize / 2, 0, buttonSize, buttonHeight]);
_local3._visible = false;
dn_btn._y = textArea.__get__contentHeight() - buttonHeight;
_local3 = dn_btn.createEmptyMovieClip("out", 0);
_local5.rect(_local3, 0, 0, buttonSize, buttonHeight);
_local4.shape(_local3, [0, 0, buttonSize / 2, buttonHeight, buttonSize, 0]);
_local3 = dn_btn.createEmptyMovieClip("over", 1);
_local5.rect(_local3, 0, 0, buttonSize, buttonHeight);
_local4.shape(_local3, [0, 0, buttonSize / 2, buttonHeight, buttonSize, 0]);
_local3._visible = false;
_local3 = dn_btn.createEmptyMovieClip("down", 2);
_local5.rect(_local3, 0, 0, buttonSize, buttonHeight);
_local4.shape(_local3, [0, 0, buttonSize / 2, buttonHeight, buttonSize, 0]);
_local3._visible = false;
up_btn.onPress = (dn_btn.onPress = function () {
this.down._visible = true;
this._parent.onBtnDown(this.dir);
});
up_btn.onDragOver = (dn_btn.onDragOver = function () {
this.over._visible = (this.down._visible = true);
this._parent.onBtnDown(this.dir);
});
up_btn.onRelease = (dn_btn.onRelease = function () {
this.down._visible = false;
this._parent.onBtnUp();
});
up_btn.onDragOut = (dn_btn.onDragOut = function () {
this.over._visible = (this.down._visible = false);
this._parent.onBtnUp();
});
up_btn.onRollOver = (dn_btn.onRollOver = function () {
this.over._visible = true;
});
up_btn.onRollOut = (dn_btn.onRollOut = function () {
this.over._visible = false;
});
slider.onPress = function () {
this._parent.onSliderDown();
};
slider.onRelease = (slider.onReleaseOutside = function () {
this._parent.onSliderUp();
});
slider.onRollOut = function () {
this._parent.onSliderOut();
};
slider.onRollOver = function () {
this._parent.onSliderOver();
};
slider.drag = function () {
this._parent.onSliderDrag();
};
base.onPress = function () {
this._parent.onBaseDown();
};
base.onRelease = (base.onReleaseOutside = function () {
this._parent.onBaseUp();
});
_local6.rect(base, 0, buttonSize, buttonSize, textArea.__get__contentHeight() - (buttonSize * 2));
_local4.rect(base, Math.floor(buttonSize / 2), buttonHeight, 1, textArea.__get__contentHeight() - (buttonHeight * 2));
}
function render() {
var _local2 = (textArea.__get__contentHeight() / textArea.__get__totalHeight()) * (textArea.__get__contentHeight() - (buttonHeight * 2));
slider.clear();
var _local5 = new Draw({}, {c:(sliderDown ? (btnBaseDownCol) : ((sliderOver ? (btnBaseOverCol) : (btnBaseCol)))), a:100});
if (sliderDown) {
slider.gotoAndStop("down");
} else if (sliderOver) {
slider.gotoAndStop("over");
} else {
slider.gotoAndStop("up");
}
slider._yscale = (_local2 / slider.height) * 100;
slider._y = buttonHeight + ((textArea.__get__yPos() / textArea.__get__totalHeight()) * (textArea.__get__contentHeight() - (buttonHeight * 2)));
}
function onBaseDown() {
var _local2 = ((_ymouse > slider._y) ? (((_ymouse > (slider._y + slider._height)) ? 1 : 0)) : -1);
textArea.yPos = textArea.yPos + (_local2 * textArea.__get__contentHeight());
intId = setInterval(this, "onBaseWait", pressWait);
}
function onBaseWait() {
var _local2 = ((_ymouse > slider._y) ? (((_ymouse > (slider._y + slider._height)) ? 1 : 0)) : -1);
textArea.yPos = textArea.yPos + (_local2 * textArea.__get__contentHeight());
clearInterval(intId);
intId = setInterval(this, "onBaseRepeat", pressRepeat);
}
function onBaseRepeat() {
var _local2 = ((_ymouse > slider._y) ? (((_ymouse > (slider._y + slider._height)) ? 1 : 0)) : -1);
textArea.yPos = textArea.yPos + (_local2 * textArea.__get__contentHeight());
}
function onBaseUp() {
clearInterval(intId);
delete intId;
}
function onSliderDrag() {
var _local2 = _ymouse - sliderMY;
textArea.__set__yPos((_local2 - buttonSize) * (textArea.__get__totalHeight() / (textArea.__get__contentHeight() - (buttonSize * 2))));
}
function onSliderDown() {
sliderDown = true;
slider.onMouseMove = slider.drag;
sliderMY = slider._ymouse;
render();
}
function onSliderUp() {
sliderDown = false;
delete slider.onMouseMove;
render();
}
function onSliderOver() {
sliderOver = true;
render();
}
function onSliderOut() {
sliderOver = false;
render();
}
function onBtnDown(dir) {
textArea.yPos = textArea.yPos + (dir * scrollSpeed);
intId = setInterval(this, "onPressWait", pressWait, dir);
}
function onBtnUp() {
clearInterval(intId);
delete intId;
}
function onPressWait(dir) {
textArea.yPos = textArea.yPos + (dir * scrollSpeed);
clearInterval(intId);
intId = setInterval(this, "onPressRepeat", pressRepeat, dir);
}
function onPressRepeat(dir) {
textArea.yPos = textArea.yPos + (dir * scrollSpeed);
}
var buttonSize = 20;
var buttonHeight = 9;
var baseCol = 15658734;
var baseAlpha = 0;
var btnArrowCol = 4483975;
var btnBaseCol = 4483975;
var btnBaseDownCol = 11184810;
var btnBaseOverCol = 14540253;
var sliderDown = false;
var sliderOver = false;
var scrollSpeed = 5;
var pressWait = 500;
var pressRepeat = 50;
static var SCROLLER_BAR_LINKAGE = "text_scroller_bar";
}
Symbol 662 MovieClip [__Packages.Draw] Frame 0
class Draw
{
var thickness, fillCol;
function Draw (lineStyle, fillStyle) {
thickness = ((!(lineStyle.t === undefined)) ? (lineStyle.t) : (thickness));
lineCol = ((!(lineStyle.c === undefined)) ? (lineStyle.c) : (lineCol));
lineAlpha = ((!(lineStyle.a === undefined)) ? (lineStyle.a) : (lineAlpha));
fillCol = ((!(fillStyle.c === undefined)) ? (fillStyle.c) : (fillCol));
fillAlpha = ((!(fillStyle.a === undefined)) ? (fillStyle.a) : (fillAlpha));
}
function mark(mc, x, y) {
mc.lineStyle(thickness, lineCol, lineAlpha);
mc.moveTo(x - 2.5, y - 2.5);
mc.lineTo(x + 2.5, y + 2.5);
mc.moveTo(x + 2.5, y - 2.5);
mc.lineTo(x + 2.5, y - 2.5);
}
function line(mc, x1, y1, x2, y2) {
mc.lineStyle(thickness, lineCol, lineAlpha);
mc.moveTo(x1, y1);
mc.lineTo(x2, y2);
}
function rect(mc, x, y, w, h) {
mc.lineStyle(thickness, lineCol, lineAlpha);
if (!isNaN(fillCol)) {
mc.beginFill(fillCol, fillAlpha);
}
mc.moveTo(x, y);
mc.lineTo(x + w, y);
mc.lineTo(x + w, y + h);
mc.lineTo(x, y + h);
mc.lineTo(x, y);
if (!isNaN(fillCol)) {
mc.endFill();
}
}
function circle(mc, x, y, r) {
mc.lineStyle(thickness, lineCol, lineAlpha);
if (!isNaN(fillCol)) {
mc.beginFill(fillCol, fillAlpha);
}
var _local7 = (Math.PI/4);
var _local6 = 0.392699081698724;
mc.moveTo(x + r, y);
mc.curveTo(r + x, (Math.tan(_local6) * r) + y, (Math.sin(_local7) * r) + x, (Math.sin(_local7) * r) + y);
mc.curveTo((Math.tan(_local6) * r) + x, r + y, x, r + y);
mc.curveTo(((-Math.tan(_local6)) * r) + x, r + y, ((-Math.sin(_local7)) * r) + x, (Math.sin(_local7) * r) + y);
mc.curveTo((-r) + x, (Math.tan(_local6) * r) + y, (-r) + x, y);
mc.curveTo((-r) + x, ((-Math.tan(_local6)) * r) + y, ((-Math.sin(_local7)) * r) + x, ((-Math.sin(_local7)) * r) + y);
mc.curveTo(((-Math.tan(_local6)) * r) + x, (-r) + y, x, (-r) + y);
mc.curveTo((Math.tan(_local6) * r) + x, (-r) + y, (Math.sin(_local7) * r) + x, ((-Math.sin(_local7)) * r) + y);
mc.curveTo(r + x, ((-Math.tan(_local6)) * r) + y, r + x, y);
if (!isNaN(fillCol)) {
mc.endFill();
}
}
function shape(mc, coords) {
mc.lineStyle(thickness, lineCol, lineAlpha);
if (!isNaN(fillCol)) {
mc.beginFill(fillCol, fillAlpha);
}
mc.moveTo(coords[0], coords[1]);
var _local2 = 2;
while (_local2 < coords.length) {
mc.lineTo(coords[_local2], coords[_local2 + 1]);
_local2 = _local2 + 2;
}
mc.lineTo(coords[0], coords[1]);
if (!isNaN(fillCol)) {
mc.endFill();
}
}
var lineCol = 0;
var lineAlpha = 100;
var fillAlpha = 100;
}
Symbol 663 MovieClip [__Packages.TextStyle] Frame 0
class TextStyle
{
var fmt, font, size, align, blockIndent, bold, bullet, colour, indent, italic, kerning, leading, leftMargin, letterSpacing, rightMargin, tabStops, underline, background, backgroundCol, border, borderCol, maxChars, multiline, password, restrict, selectable, wordWrap;
function TextStyle () {
fmt = new TextFormat();
}
function apply(txt) {
fmt.font = font;
fmt.size = size;
fmt.align = align;
fmt.blockIndent = blockIndent;
fmt.bold = bold;
fmt.bullet = bullet;
fmt.color = colour;
fmt.font = font;
fmt.indent = indent;
fmt.italic = italic;
fmt.kerning = kerning;
fmt.leading = leading;
fmt.leftMargin = leftMargin;
fmt.letterSpacing = letterSpacing;
fmt.rightMargin = rightMargin;
fmt.size = size;
fmt.tabStops = tabStops;
fmt.underline = underline;
txt.setTextFormat(fmt);
txt.setNewTextFormat(fmt);
txt.background = background;
txt.backgroundColour = backgroundCol;
txt.border = border;
txt.borderColor = borderCol;
txt.maxChars = maxChars;
txt.multiline = multiline;
txt.password = password;
txt.restrict = restrict;
txt.selectable = selectable;
txt.textColour = colour;
txt.type = type;
txt.wordWrap = wordWrap;
}
var type = "dynamic";
}
Symbol 664 MovieClip [__Packages.Label] Frame 0
class Label extends MovieClip
{
var txt, _name;
function Label () {
super();
txt.html = true;
txt.multiline = true;
txt.wordWrap = false;
}
function onLoad() {
if ((!txt.autoSize) || (txt.autoSize == "none")) {
txt.autoSize = "left";
}
txt.htmlText = _global.language[_name];
}
function get autoSize() {
return(txt.autoSize);
}
function set autoSize(as) {
txt.autoSize = as;
//return(autoSize);
}
var valign = "top";
var halign = "left";
}
Symbol 665 MovieClip [__Packages.Cubic] Frame 0
class Cubic
{
function Cubic () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return((((c * t) * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return((c * (((t * t) * t) + 1)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((c / 2) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((t * t) * t) + 2)) + b);
}
}
Symbol 666 MovieClip [__Packages.SpeechBubble] Frame 0
class SpeechBubble
{
var _baseHeight, txt, base;
function SpeechBubble () {
_baseHeight = txt._height;
}
function set text(s) {
txt.autoSize = "left";
_text = (txt.htmlText = s);
if (txt._height < _baseHeight) {
txt.autoSize = "none";
txt._height = _baseHeight;
}
base._height = txt._height + (PADDING * 2);
//return(text);
}
function get text() {
return(_text);
}
var _text = "";
static var PADDING = 10;
}
Symbol 667 MovieClip [__Packages.ImageLoader] Frame 0
class ImageLoader extends MovieClip
{
var width, _width, height, _height, lang, loadingImage, base, mcl, ori_url, createEmptyMovieClip, holder, loaderBar, _xscale, _yscale, attachBitmap;
function ImageLoader () {
super();
width = _width;
height = _height;
lang = _global.language;
loadingImage._xscale = (loadingImage._yscale = 100);
base._visible = false;
mcl = new MovieClipLoader();
mcl.addListener(this);
}
function loadImage(url) {
ori_url = url;
createEmptyMovieClip("holder", 0);
mcl.loadClip(ori_url, holder);
}
function onLoadProgress(mc, loadedBytes, totalBytes) {
var _local2 = loadedBytes * totalBytes;
loaderBar._xscale = _local2 * 100;
}
function onLoadInit(mc) {
_xscale = (_yscale = 100);
var _local5 = new flash.display.BitmapData(width, height, false, 0);
var _local2 = Math.min(width / mc._width, height / mc._height);
var _local4 = new flash.geom.Matrix();
_local4.scale(_local2, _local2);
_local4.translate((width - (mc._width * _local2)) / 2, (height - (mc._height * _local2)) / 2);
_local5.draw(mc, _local4);
attachBitmap(_local5, 0);
}
function onLoadError(mc) {
if ((_attempts++) < MAX_ATTEMPTS) {
loadImage(ori_url);
}
}
var _attempts = 0;
static var MAX_ATTEMPTS = 3;
}
Symbol 111 MovieClip Frame 1
function onEnterFrame() {
var _local1 = startTime + frameTime;
while (getTimer() < _local1) {
}
startTime = _local1;
}
frameRate = 25;
startTime = getTimer();
frameTime = 1000 / frameRate;
Symbol 116 Button
on (release) {
if (!_global.soundMute) {
_global.soundMute = true;
new Sound().setVolume(0);
} else {
_global.soundMute = true;
new Sound().setVolume(100);
}
}
Symbol 118 Button
on (release) {
_global.soundMute = true;
stopAllSounds();
new Sound().setVolume(0);
gotoAndStop ("soundOff");
}
Symbol 121 MovieClip Frame 1
stop();
Symbol 121 MovieClip Frame 5
stop();
Symbol 133 Button
on (release) {
getURL ("http://www.killerviral.com", "_blank");
_root.kvClick(924);
}
Symbol 137 MovieClip [label white] Frame 1
#initclip 75
Object.registerClass("label white", Label);
#endinitclip
Symbol 142 Button
on (release) {
_parent._parent.wipeTo("menu", true);
}
Symbol 143 MovieClip Frame 1
displayNextMission = (_global.language.mmenu_nextMission + " ") + _global.language[_root.mission + "_name"];
stop();
Symbol 147 MovieClip [8pt nanador] Frame 1
#initclip 74
Object.registerClass("8pt nanador", Label);
#endinitclip
Symbol 151 Button
on (release) {
Game.load();
_parent._parent.wipeTo("menu");
}
Symbol 152 MovieClip Frame 1
stop();
Symbol 152 MovieClip Frame 4
stop();
Symbol 163 MovieClip Frame 7
stop();
Symbol 165 Button
on (release) {
if (_global.kvBannerClickId) {
_root.kvClick(_global.kvBannerClickId);
}
getURL ("http://www.memecounter.com/redir.php?urlId=922", "_blank");
}
Symbol 166 MovieClip Frame 1
function onLoadError(t, err) {
gotoAndPlay ("in");
}
function onLoadComplete(t) {
}
b_mcl = new MovieClipLoader();
if (_root.kvBannerURL) {
url = _root.kvBannerURL;
} else {
url = "http://projects.kempt.co.uk/adnet/?";
urlArgs = "";
urlArgs = urlArgs + (("w=" + _width) + "&");
urlArgs = urlArgs + (("h=" + _height) + "&");
urlArgs = urlArgs + (("sw=" + Stage.width) + "&");
urlArgs = urlArgs + (("sh=" + Stage.height) + "&");
urlArgs = urlArgs + (("x=" + _x) + "&");
urlArgs = urlArgs + (("y=" + _y) + "&");
urlArgs = urlArgs + "as=2&";
urlArgs = urlArgs + (("f=" + escape(getVersion())) + "&");
urlArgs = urlArgs + (("d=" + escape(new LocalConnection().domain())) + "&");
urlArgs = urlArgs + (("t=" + Math.floor(getTimer() / 1000)) + "&");
if (_root.kv.c) {
urlArgs = urlArgs + (("mc=" + _root.kv.c) + "&");
}
url = url + ((urlArgs + "r=") + Math.floor(Math.random() * 1000));
}
b_mcl.loadClip(url, createEmptyMovieClip("bannerHolder", 0));
b_mcl.addListener(this);
gotoAndStop ("hide");
Symbol 166 MovieClip Frame 10
stop();
Instance of Symbol 121 MovieClip "mute" in Symbol 168 MovieClip Frame 1
onClipEvent (load) {
if (new Sound().getVolume() == 0) {
gotoAndStop ("off");
}
this.onRelease = function () {
if (new Sound().getVolume() == 0) {
gotoAndStop ("on");
_global.isMuted = false;
new Sound().setVolume(100);
} else {
gotoAndStop ("off");
_global.isMuted = true;
new Sound().setVolume(0);
}
};
}
Symbol 168 MovieClip Frame 103
stop();
Instance of Symbol 143 MovieClip in Symbol 168 MovieClip Frame 104
onClipEvent (load) {
displayMissionName = (language.mmenu_missionName + " ") + language[_root.mission + "_name"];
}
Instance of Symbol 152 MovieClip "continueMc" in Symbol 168 MovieClip Frame 104
onClipEvent (load) {
displayMissionName = (language.mmenu_missionName + " ") + language[_root.mission + "_name"];
}
Symbol 168 MovieClip Frame 114
stop();
Symbol 175 MovieClip Frame 1
stop();
Symbol 175 MovieClip Frame 12
_parent.changeMenu();
Symbol 175 MovieClip Frame 19
handler();
delete handler;
Symbol 204 MovieClip Frame 8
_parent.play();
Symbol 204 MovieClip Frame 12
_parent.play();
Symbol 205 MovieClip Frame 1
stop();
Symbol 205 MovieClip Frame 2
stop();
Instance of Symbol 204 MovieClip "iceGirl" in Symbol 205 MovieClip Frame 2
onClipEvent (load) {
Misc.playAtFrameRate(this, 25);
}
Symbol 205 MovieClip Frame 3
stop();
Symbol 205 MovieClip Frame 4
stop();
Instance of Symbol 204 MovieClip "iceGirl" in Symbol 205 MovieClip Frame 4
onClipEvent (load) {
gotoAndPlay (9);
Misc.playAtFrameRate(this, 20);
}
Symbol 205 MovieClip Frame 5
stop();
Symbol 209 Button
on (release) {
_parent._parent.wipeTo("game");
}
Symbol 215 Button
on (release) {
_parent._parent.menuSelect("mission");
}
Symbol 217 MovieClip Frame 1
displayNextMission = (_global.language.mmenu_nextMission + " ") + _global.language[("mission" + _global.selectedMission) + "_name"];
stop();
Symbol 222 Button
on (release) {
_parent.menuSelect("ice");
}
Symbol 224 MovieClip [menuButtonText] Frame 1
#initclip 80
Object.registerClass("menuButtonText", Label);
#endinitclip
Symbol 226 MovieClip Frame 1
txt.text = (("$" + _root.groats) + " ") + _global.language.toSpend;
Symbol 227 MovieClip Frame 1
if (_root.groats >= 101) {
play();
} else {
stop();
}
Symbol 232 Button
on (release) {
_parent.menuSelect("mission");
}
Symbol 236 Button
on (release) {
_parent.menuSelect("carSelect");
}
Symbol 244 Button
on (release) {
Game.load();
_parent._parent.displayMissionName();
_parent.gotoAndPlay("out");
}
Symbol 249 Button
on (release) {
_parent.gotoAndPlay("out");
}
Symbol 251 MovieClip Frame 1
stop();
Instance of Symbol 243 MovieClip in Symbol 251 MovieClip Frame 5
onClipEvent (load) {
onPress = function () {
};
useHandCursor = false;
}
Symbol 251 MovieClip Frame 6
stop();
Symbol 251 MovieClip Frame 15
stop();
Symbol 254 Button
on (release) {
choose("ICEEfficiency");
}
on (rollOver) {
rolled("ICEEfficiency");
}
Symbol 255 Button
on (release) {
choose("ICEPower");
}
on (rollOver) {
rolled("ICEPower");
}
Symbol 256 Button
on (release) {
choose("handling");
}
on (rollOver) {
rolled("handling");
}
Symbol 257 Button
on (release) {
choose("acceleration");
}
on (rollOver) {
rolled("acceleration");
}
Symbol 258 Button
on (release) {
choose("speed");
}
on (rollOver) {
rolled("speed");
}
Symbol 262 MovieClip Frame 1
stop();
Symbol 267 MovieClip Frame 1
function choose(f) {
_parent.choose(f);
}
function rolled(f) {
}
stop();
Symbol 282 MovieClip Frame 1
stop();
Symbol 288 Button
on (release) {
_parent.backButtonPressed();
Game.save();
}
Symbol 303 Button
on (release) {
_parent._parent.buy();
}
Symbol 306 MovieClip Frame 1
stop();
Symbol 322 MovieClip Frame 1
setText = function () {
};
setText();
stop();
Symbol 322 MovieClip Frame 8
setText();
stop();
Symbol 322 MovieClip Frame 24
setText();
stop();
Symbol 322 MovieClip Frame 32
setText();
stop();
Symbol 322 MovieClip Frame 41
setText();
stop();
Symbol 322 MovieClip Frame 53
setText();
stop();
Symbol 322 MovieClip Frame 73
setText();
stop();
Symbol 322 MovieClip Frame 84
setText();
stop();
Symbol 322 MovieClip Frame 91
setText();
stop();
Symbol 322 MovieClip Frame 100
setText();
stop();
Symbol 322 MovieClip Frame 109
setText();
stop();
Symbol 322 MovieClip Frame 116
setText();
stop();
Symbol 322 MovieClip Frame 124
setText();
stop();
Symbol 322 MovieClip Frame 133
setText();
stop();
Symbol 322 MovieClip Frame 142
setText();
stop();
Symbol 322 MovieClip Frame 152
setText();
stop();
Symbol 322 MovieClip Frame 160
setText();
stop();
Symbol 322 MovieClip Frame 169
setText();
stop();
Symbol 322 MovieClip Frame 180
setText();
stop();
Symbol 322 MovieClip Frame 191
setText();
stop();
Symbol 323 MovieClip Frame 1
function setDetail() {
detail.gotoAndStop(nextDetail + (upgradesLevels[nextDetail] + 1));
detail.currentGroats.text = _root.groats;
detail.header.htmlText = (_global.language[("newICE_" + nextDetail) + "Upgrade"] + " ") + (_global.upgradesLevels[nextDetail] + 1);
detail.category.htmlText = _global.language["newICE_" + nextDetail];
detail.verb.htmlText = _global.language[("newICE_" + nextDetail) + "Verb"];
detail.description.htmlText = _global.language[(("newICE_" + nextDetail) + "UpgradeDesc") + (_global.upgradesLevels[nextDetail] + 1)];
detail.currentGroatsTitle.htmlText = _global.language.newICE_currentGroats;
detail.thisUpgrade.htmlText = _global.language.newICE_thisUpgrade;
detail.upgradePrice.htmlText = _global.upgradeCost[nextDetail][_global.upgradesLevels[nextDetail]];
if (_root.groats < _global.upgradeCost[nextDetail][_global.upgradesLevels[nextDetail]]) {
detail.buyIt.gotoAndStop("off");
} else {
detail.buyIt.gotoAndStop("on");
}
}
function buy() {
_root.groats = _root.groats - _global.upgradeCost[nextDetail][_global.upgradesLevels[nextDetail]];
upgradesLevels[nextDetail]++;
setDetail();
setBars();
setEstimates();
}
function choose(f) {
mainCat.gotoAndStop(f);
carPlan.gotoAndStop(f);
play();
nextDetail = f;
}
function setBars() {
mainCat.speedBar.gotoAndStop(Math.ceil(mainCat.speedBar._totalframes * (upgradesLevels.speed / 3)));
mainCat.accelerationBar.gotoAndStop(Math.ceil(mainCat.accelerationBar._totalframes * (upgradesLevels.acceleration / 3)));
mainCat.handlingBar.gotoAndStop(Math.ceil(mainCat.handlingBar._totalframes * (upgradesLevels.handling / 3)));
mainCat.ICEPowerBar.gotoAndStop(Math.ceil(mainCat.ICEPowerBar._totalframes * (upgradesLevels.ICEPower / 3)));
mainCat.ICEEfficiencyBar.gotoAndStop(Math.ceil(mainCat.ICEEfficiencyBar._totalframes * (upgradesLevels.ICEEfficiency / 3)));
}
function setEstimates() {
mainCat.speedEstimate.text = upgradesLevels.speed;
mainCat.accelerationEstimate.text = upgradesLevels.acceleration;
mainCat.handlingEstimate.text = upgradesLevels.handling;
mainCat.ICEPowerEstimate.text = upgradesLevels.ICEPower;
mainCat.v.text = upgradesLevels.ICEEfficiency;
}
function init() {
updateCurrentSystem();
setBars();
setEstimates();
}
init();
stop();
function showMiniDetail() {
if (selectedComponents != lastRolledOver) {
miniDetail.gotoAndStop("show");
updateMiniDisplay();
}
lastRolledOver = selectedComponents;
}
function updateMiniDisplay() {
updateCurrentSystem();
rating = Math.ceil((ICE[selectedComponents].equipped / (ICE[selectedComponents].length - 1)) * 5);
miniDetail.imgHolder.loadImage(imgUrl);
if (rating == 0) {
miniDetail.noRating.gotoAndStop("on");
miniDetail.ratingBar._visible = false;
miniDetail.ratingText._visible = false;
} else {
miniDetail.noRating.gotoAndStop("off");
miniDetail.ratingBar._visible = true;
miniDetail.ratingText.displayRating = ((_global.language.mmenu_unitRating + " ") + rating) + "/5";
miniDetail.ratingText._visible = true;
}
miniDetail.ratingBar.gotoAndStop(Math.ceil(rating * 10) + 1);
miniDetail.productName = _global.language[(selectedComponents + ICE[selectedComponents].equipped) + "_name"];
}
function setupPriceButtons(t) {
n = t._name.substr(-1, 1);
if (!ICE[selectedComponents][n].price) {
t._visible = false;
} else {
t.value = "$" + ICE[selectedComponents][n].price;
}
}
function buySelection() {
var _local2 = ICE[selectedComponents];
var _local5 = _local2[_local2.equipped];
var _local4 = _local2[selectedUnit];
var _local3 = getTradeInPrice(_local2, _local5, _local4);
if (_root.groats >= _local3) {
_root.groats = _root.groats - _local3;
purchased[(selectedComponents + "-") + _local2.equipped] = false;
purchased[(selectedComponents + "-") + selectedUnit] = true;
_local2.equipped = selectedUnit;
updateDisplay();
}
}
function selectUnit(n) {
selectedUnit = n;
updateDisplay();
}
function updateCurrentSystem() {
ICE.setVals();
currentSystem.maxVolumeBar.gotoAndStop(Math.ceil(ICE.maxVol / 2));
currentSystem.soundQualityBar.gotoAndStop(Math.ceil(ICE.sndQual / 2));
currentSystem.bassBar.gotoAndStop(Math.ceil(ICE.bass / 2));
currentSystem.overallBar.gotoAndStop(Math.ceil(ICE.overall / 2));
}
function updateDisplay() {
updateCurrentSystem();
rating = Math.ceil((selectedUnit / (ICE[selectedComponents].length - 1)) * 5);
imgUrl = (("assets/productImages/" + selectedComponents) + selectedUnit) + ".jpg";
iceDetail.imgHolder.loadImage(imgUrl);
iceDetail.displayRating = rating + "/5";
iceDetail.ratingBar.gotoAndStop(Math.ceil(rating * 10));
iceDetail.displayGroats = (_global.language.mmenu_groats + " $") + _root.groats;
iceDetail.productName = _global.language[(selectedComponents + selectedUnit) + "_name"];
iceDetail.icebox.text = _global.language[(selectedComponents + selectedUnit) + "_description"];
if (isTradeIn(ICE[selectedComponents])) {
iceDetail.tradeInOrBuy_mc.gotoAndStop("tradeIn");
} else {
iceDetail.tradeInOrBuy_mc.gotoAndStop("buy");
}
var _local3 = getTradeInPrice(ICE[selectedComponents], ICE[selectedComponents][ICE[selectedComponents].equipped], ICE[selectedComponents][selectedUnit]);
iceDetail.tradeInPrice = "$" + _local3;
if (ICE[selectedComponents].equipped == selectedUnit) {
iceDetail.buyButton.gotoAndStop("off");
} else if (_local3 <= _root.groats) {
iceDetail.buyButton.gotoAndStop("on");
} else {
iceDetail.buyButton.gotoAndStop("too_expensive");
}
}
function getTradeInPrice(currentCollection, currentComponent, selectedComponent) {
if (currentComponent != selectedComponent) {
if (purchased[(selectedComponents + "-") + currentCollection.equipped]) {
return(selectedComponent.price - currentComponent.price);
}
return(selectedComponent.price - (currentComponent.price * tradeInRate));
}
return(0);
}
function isTradeIn(currentCollection) {
return(currentCollection.equipped != 0);
}
function viewProduct() {
_root.kvClick(Number(_global.language[(selectedComponents + selectedUnit) + "_clickId"]));
getURL (_global.language[(selectedComponents + selectedUnit) + "_url"], "_blank");
}
if (!purchased) {
purchased = {};
tradeInRate = 0.5;
}
Symbol 323 MovieClip Frame 2
gotoAndPlay ("detail");
Symbol 323 MovieClip Frame 6
delete lastRolledOver;
setDetail();
Symbol 323 MovieClip Frame 12
stop();
Symbol 323 MovieClip Frame 17
gotoAndPlay ("detail");
Symbol 329 MovieClip [8pt atlantis white bold] Frame 1
#initclip 76
Object.registerClass("8pt atlantis white bold", Label);
#endinitclip
Symbol 336 MovieClip [8pt atlantis white2] Frame 1
#initclip 77
Object.registerClass("8pt atlantis white2", Label);
#endinitclip
Symbol 340 MovieClip [speechbubble] Frame 1
#initclip 78
Object.registerClass("speechbubble", SpeechBubble);
#endinitclip
Symbol 341 Button
on (release) {
_parent.selectCar("car1");
}
Symbol 342 Button
on (release) {
_parent.selectCar("car2");
}
Symbol 345 Button
on (release) {
_parent._parent.selectCar("car4");
}
Symbol 346 MovieClip Frame 1
stop();
Symbol 346 MovieClip Frame 4
stop();
Symbol 347 Button
on (release) {
_parent._parent.selectCar("car5");
}
Symbol 348 MovieClip Frame 1
stop();
Symbol 348 MovieClip Frame 6
stop();
Symbol 353 Button
on (release) {
_parent._parent.backButtonPressed();
}
Instance of Symbol 360 MovieClip in Symbol 361 MovieClip Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation + _parent.speed);
}
Instance of Symbol 360 MovieClip in Symbol 361 MovieClip Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation + _parent.speed);
}
Instance of Symbol 361 MovieClip in Symbol 363 MovieClip Frame 1
onClipEvent (load) {
speed = 0;
}
Symbol 372 MovieClip Frame 1
stop();
Instance of Symbol 346 MovieClip "car4" in Symbol 372 MovieClip Frame 1
onClipEvent (load) {
if (_global.missionState[5] != "locked") {
gotoAndStop ("unlocked");
}
}
Instance of Symbol 348 MovieClip "car5" in Symbol 372 MovieClip Frame 1
onClipEvent (load) {
if (_global.missionState[7] != "locked") {
gotoAndStop ("unlocked");
}
}
Symbol 372 MovieClip Frame 2
car1Speak.girlSpeak.text = _global.language.car1GirlSpeak;
car2Speak.girlSpeak.text = _global.language.car2GirlSpeak;
car3Speak.girlSpeak.text = _global.language.car3GirlSpeak;
car4Speak.girlSpeak.txt.text = _global.language.car4GirlSpeak;
stop();
Symbol 372 MovieClip Frame 18
car1Speak.girlSpeak.text = _global.language.car1GirlSpeak;
car2Speak.girlSpeak.text = _global.language.car2GirlSpeak;
car3Speak.girlSpeak.text = _global.language.car3GirlSpeak;
car4Speak.girlSpeak.txt.text = _global.language.car4GirlSpeak;
stop();
Symbol 372 MovieClip Frame 19
car1Speak.girlSpeak.text = _global.language.car1GirlSpeak;
car2Speak.girlSpeak.text = _global.language.car2GirlSpeak;
car3Speak.girlSpeak.text = _global.language.car3GirlSpeak;
car4Speak.girlSpeak.txt.text = _global.language.car4GirlSpeak;
stop();
Symbol 372 MovieClip Frame 36
car1Speak.girlSpeak.text = _global.language.car1GirlSpeak;
car2Speak.girlSpeak.text = _global.language.car2GirlSpeak;
car3Speak.girlSpeak.text = _global.language.car3GirlSpeak;
car4Speak.girlSpeak.txt.text = _global.language.car4GirlSpeak;
stop();
Symbol 372 MovieClip Frame 37
car1Speak.girlSpeak.text = _global.language.car1GirlSpeak;
car2Speak.girlSpeak.text = _global.language.car2GirlSpeak;
car3Speak.girlSpeak.text = _global.language.car3GirlSpeak;
car4Speak.girlSpeak.txt.text = _global.language.car4GirlSpeak;
stop();
Symbol 372 MovieClip Frame 55
car1Speak.girlSpeak.text = _global.language.car1GirlSpeak;
car2Speak.girlSpeak.text = _global.language.car2GirlSpeak;
car3Speak.girlSpeak.text = _global.language.car3GirlSpeak;
car4Speak.girlSpeak.txt.text = _global.language.car4GirlSpeak;
stop();
Symbol 372 MovieClip Frame 56
car1Speak.girlSpeak.text = _global.language.car1GirlSpeak;
car2Speak.girlSpeak.text = _global.language.car2GirlSpeak;
car3Speak.girlSpeak.text = _global.language.car3GirlSpeak;
car4Speak.girlSpeak.txt.text = _global.language.car4GirlSpeak;
stop();
Symbol 372 MovieClip Frame 73
car1Speak.girlSpeak.text = _global.language.car1GirlSpeak;
car2Speak.girlSpeak.text = _global.language.car2GirlSpeak;
car3Speak.girlSpeak.text = _global.language.car3GirlSpeak;
car4Speak.girlSpeak.txt.text = _global.language.car4GirlSpeak;
stop();
Symbol 373 Button
on (release) {
backButtonPressed();
}
Symbol 390 Button
on (release) {
_parent._parent.selectMission(this, Number(_parent._name.substr(-1, 1)));
}
Symbol 392 MovieClip Frame 1
stop();
Symbol 392 MovieClip Frame 5
stop();
Symbol 392 MovieClip Frame 8
stop();
Instance of Symbol 387 MovieClip in Symbol 399 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._name.substr(1, 1));
}
Symbol 399 MovieClip Frame 2
stop();
Symbol 399 MovieClip Frame 4
stop();
Symbol 399 MovieClip Frame 6
stop();
Symbol 399 MovieClip Frame 8
stop();
Symbol 402 MovieClip [speechbubble wide] Frame 1
#initclip 79
Object.registerClass("speechbubble wide", SpeechBubble);
#endinitclip
Symbol 409 Button
on (release) {
_parent._parent.backButtonPressed();
}
Symbol 411 MovieClip Frame 1
function setupMissionButton(t) {
n = Number(t._name.substr(-1, 1));
t.gotoAndStop(missionState[n]);
if (selectedMission == n) {
t.button.gotoAndStop("selected");
}
}
function selectMission(t, n) {
this["m" + _global.selectedMission].button.gotoAndStop("on");
_global.selectedMission = n;
_root.mission = "mission" + n;
speechBubble.text = "<br/><br/><br/><br/>" + _global.language[("mission" + _global.selectedMission) + "_description"];
chooseMissionBtn_mc._y = (speechBubble._y + speechBubble._height) + 15;
missionTitle.text = _global.language[("mission" + _global.selectedMission) + "_name"];
missionNumber.text = ("Mission " + _global.selectedMission) + " :";
t.gotoAndStop("selected");
}
selectMission(this["m" + _global.selectedMission].button, _global.selectedMission);
stop();
Instance of Symbol 399 MovieClip "m1" in Symbol 411 MovieClip Frame 1
onClipEvent (load) {
_parent.setupMissionButton(this);
}
Instance of Symbol 399 MovieClip "m2" in Symbol 411 MovieClip Frame 1
onClipEvent (load) {
_parent.setupMissionButton(this);
}
Instance of Symbol 399 MovieClip "m3" in Symbol 411 MovieClip Frame 1
onClipEvent (load) {
_parent.setupMissionButton(this);
}
Instance of Symbol 399 MovieClip "m4" in Symbol 411 MovieClip Frame 1
onClipEvent (load) {
_parent.setupMissionButton(this);
}
Instance of Symbol 399 MovieClip "m5" in Symbol 411 MovieClip Frame 1
onClipEvent (load) {
_parent.setupMissionButton(this);
}
Instance of Symbol 399 MovieClip "m6" in Symbol 411 MovieClip Frame 1
onClipEvent (load) {
_parent.setupMissionButton(this);
}
Instance of Symbol 399 MovieClip "m7" in Symbol 411 MovieClip Frame 1
onClipEvent (load) {
_parent.setupMissionButton(this);
}
Instance of Symbol 399 MovieClip "m8" in Symbol 411 MovieClip Frame 1
onClipEvent (load) {
_parent.setupMissionButton(this);
}
Symbol 415 Button
on (release) {
_root.kvClick(_global.language.mmenu_options_option1_trackingID);
getURL (_global.language.mmenu_options_option1_url, "_blank");
}
Symbol 417 Button
on (release) {
_root.kvClick(_global.language.mmenu_options_option2_trackingID);
getURL (_global.language.mmenu_options_option2_url, "_blank");
}
Symbol 419 Button
on (release) {
_root.kvClick(_global.language.mmenu_options_option3_trackingID);
getURL (_global.language.mmenu_options_option3_url, "_blank");
}
Symbol 421 Button
on (release) {
_root.kvClick(_global.language.mmenu_options_option4_trackingID);
getURL (_global.language.mmenu_options_option4_url, "_blank");
}
Instance of Symbol 416 MovieClip in Symbol 423 MovieClip Frame 1
onClipEvent (load) {
if (_global.language.mmenu_options_option1 == "none") {
this._visible = false;
}
}
Instance of Symbol 418 MovieClip in Symbol 423 MovieClip Frame 1
onClipEvent (load) {
if (_global.language.mmenu_options_option2 == "none") {
this._visible = false;
}
}
Instance of Symbol 420 MovieClip in Symbol 423 MovieClip Frame 1
onClipEvent (load) {
if (_global.language.mmenu_options_option3 == "none") {
this._visible = false;
}
}
Instance of Symbol 422 MovieClip in Symbol 423 MovieClip Frame 1
onClipEvent (load) {
if (_global.language.mmenu_options_option4 == "none") {
this._visible = false;
}
}
Symbol 424 MovieClip Frame 1
function displayMissionName() {
startButton.displayNextMission = (_global.language.mmenu_nextMission + " ") + language[("mission" + _global.selectedMission) + "_name"];
}
function backButtonPressed() {
delete ice_mc.lastRolledOver;
oldMenu = "";
play();
}
function menuSelect(f) {
if (f != oldMenu) {
oldMenu = f;
gotoAndPlay(f);
} else {
backButtonPressed();
}
}
function scrollTo(f) {
scrollTarget = f;
onEnterFrame = function () {
closeToX = Math.round(Math.abs(bg._x - (-bg[scrollTarget]._x)));
if (closeToX == 1) {
if (scrollTarget == "start") {
menuSelect("start");
}
bg._x = -bg[scrollTarget]._x;
delete onEnterFrame;
} else {
bg._x = Math.round((bg._x + (-bg[scrollTarget]._x)) / 2);
}
if (bg._x == (-bg[scrollTarget]._x)) {
delete onEnterFrame;
}
};
}
function selectCar(f, carRef) {
_root.car = (selectedCar = f);
scrollTarget = f;
totalTime = 1000;
startTime = getTimer();
startPos = bg._x;
carMenu.car_name_txt.text = _global.language[f + "_name"];
carMenu.car_info_txt.htmlText = _global.language[f + "_info"];
carMenu.girlSpeak.text = _global.language[f + "GirlSpeak"];
carMenu.accelerationBar.gotoAndStop(Math.ceil(50 * (carMenu[f].accel / Misc.max(carMenu.car1.accel, carMenu.car2.accel, carMenu.car4.accel, carMenu.car5.accel))));
carMenu.handlingBar.gotoAndStop(Math.ceil(50 * (carMenu[f].turnSpeed / Misc.max(carMenu.car1.turnSpeed, carMenu.car2.turnSpeed, carMenu.car4.turnSpeed, carMenu.car5.turnSpeed))));
carMenu.topSpeedBar.gotoAndStop(Math.ceil(50 * (carMenu[f].maxSpeed / Misc.max(carMenu.car1.maxSpeed, carMenu.car2.maxSpeed, carMenu.car4.maxSpeed, carMenu.car5.maxSpeed))));
carMenu.gotoAndStop(f);
deltaPos = (bg[scrollTarget]._x - (bg._x * -1)) * -1;
onEnterFrame = function () {
if ((getTimer() - startTime) > totalTime) {
bg._x = -bg[scrollTarget]._x;
carMenu.play();
delete onEnterFrame;
} else {
bg._x = Cubic.easeInOut(getTimer() - startTime, startPos, deltaPos, totalTime);
}
if (bg._x == (-bg[scrollTarget]._x)) {
bg._x = -bg[scrollTarget]._x;
carMenu.play();
delete onEnterFrame;
}
};
}
if (!selectedCar) {
selectedCar = _root.car;
}
if (!_root.mission) {
_root.mission = "mission1";
}
Instance of Symbol 217 MovieClip "startButton" in Symbol 424 MovieClip Frame 1
onClipEvent (load) {
_parent.displayMissionName();
}
Instance of Symbol 251 MovieClip in Symbol 424 MovieClip Frame 1
onClipEvent (load) {
if (!_root.checkedForSavedGame) {
_root.checkedForSavedGame = true;
if (Game.hasSaveGame()) {
gotoAndStop ("on");
}
}
}
Symbol 424 MovieClip Frame 2
stop();
Instance of Symbol 217 MovieClip in Symbol 424 MovieClip Frame 27
onClipEvent (load) {
displayMissionName = (language.mmenu_missionName + " ") + language[_root.mission + "_name"];
}
Symbol 424 MovieClip Frame 48
bgStatic.iceGirl.play();
stop();
_root.kvEvent(1913);
Symbol 424 MovieClip Frame 49
bgStatic.iceGirl.play();
Instance of Symbol 217 MovieClip in Symbol 424 MovieClip Frame 63
onClipEvent (load) {
displayMissionName = (language.mmenu_missionName + " ") + language[_root.mission + "_name"];
}
Symbol 424 MovieClip Frame 69
gotoAndStop ("start");
Symbol 424 MovieClip Frame 71
selectCar(selectedCar);
Instance of Symbol 217 MovieClip in Symbol 424 MovieClip Frame 71
onClipEvent (load) {
displayMissionName = (language.mmenu_missionName + " ") + language[_root.mission + "_name"];
}
Symbol 424 MovieClip Frame 82
stop();
_root.kvEvent(1912);
Symbol 424 MovieClip Frame 83
carMenu.car1Speak._visible = false;
carMenu.car2Speak._visible = false;
carMenu.car3Speak._visible = false;
carMenu.car4Speak._visible = false;
scrollTo("start");
Instance of Symbol 217 MovieClip in Symbol 424 MovieClip Frame 89
onClipEvent (load) {
displayMissionName = (language.mmenu_missionName + " ") + language[_root.mission + "_name"];
}
Symbol 424 MovieClip Frame 93
stop();
Instance of Symbol 217 MovieClip in Symbol 424 MovieClip Frame 97
onClipEvent (load) {
displayMissionName = (language.mmenu_missionName + " ") + language[_root.mission + "_name"];
}
Symbol 424 MovieClip Frame 115
stop();
Instance of Symbol 217 MovieClip in Symbol 424 MovieClip Frame 129
onClipEvent (load) {
displayMissionName = (language.mmenu_missionName + " ") + language[_root.mission + "_name"];
}
Symbol 424 MovieClip Frame 133
gotoAndStop ("start");
Symbol 424 MovieClip Frame 156
stop();
Instance of Symbol 217 MovieClip in Symbol 424 MovieClip Frame 171
onClipEvent (load) {
displayMissionName = (language.mmenu_missionName + " ") + language[_root.mission + "_name"];
}
Symbol 424 MovieClip Frame 177
gotoAndStop ("start");
Symbol 436 MovieClip Frame 1
stop();
Symbol 441 Button
on (release) {
gotoNextTip();
}
Symbol 468 MovieClip Frame 1
stop();
Symbol 470 MovieClip Frame 1
function changeToCar(t) {
t.gotoAndStop(_root.car);
}
function incTip() {
if (nextTip >= maxTips) {
nextTip = 1;
} else {
nextTip++;
}
}
function gotoNextTip() {
gotoAndPlay("tip" + nextTip);
}
maxTips = 6;
nextTip = 2;
_parent.changeHint();
instructionsBox.text = _global.language.instructions0;
Instance of Symbol 436 MovieClip in Symbol 470 MovieClip Frame 1
onClipEvent (load) {
_parent.changeToCar(this);
}
Symbol 470 MovieClip Frame 197
instructionsBox.text = _global.language.instructions1;
incTip();
Symbol 470 MovieClip Frame 324
instructionsBox.text = _global.language.instructions2;
incTip();
Instance of Symbol 436 MovieClip in Symbol 470 MovieClip Frame 394
onClipEvent (load) {
_parent.changeToCar(this);
}
Symbol 470 MovieClip Frame 541
instructionsBox.text = _global.language.instructions3;
incTip();
Symbol 470 MovieClip Frame 651
_parent.changeHint();
Symbol 470 MovieClip Frame 748
instructionsBox.text = _global.language.instructions4;
incTip();
Instance of Symbol 436 MovieClip in Symbol 470 MovieClip Frame 748
onClipEvent (load) {
_parent.changeToCar(this);
}
Symbol 470 MovieClip Frame 1042
instructionsBox.text = _global.language.instructions5;
incTip();
Instance of Symbol 468 MovieClip in Symbol 470 MovieClip Frame 1102
onClipEvent (load) {
_parent.changeToCar(this);
}
Symbol 470 MovieClip Frame 1298
gotoAndPlay (1);
Symbol 472 MovieClip Frame 1
stop();
function changeHint() {
if (!_root.showHint) {
_root.showHint = 0;
}
if (_root.showHint == hintArray.length) {
_root.showHint = 0;
}
displayHint.text = hintArray[_root.showHint];
_root.showHint++;
}
hintArray = new Array();
hintArray[0] = _global.language.hint0;
hintArray[1] = _global.language.hint1;
hintArray[2] = _global.language.hint2;
hintArray[3] = _global.language.hint3;
hintArray[4] = _global.language.hint4;
hintArray[5] = _global.language.hint5;
hintArray[6] = _global.language.hint6;
hintArray[7] = _global.language.hint7;
Symbol 472 MovieClip Frame 18
_parent.begin_mc.gotoAndPlay("show");
stop();
Symbol 472 MovieClip Frame 19
stop();
Symbol 477 MovieClip Frame 1
stop();
Symbol 478 Button
on (release) {
_root.cutscene.rootTarget = "mmenu";
_parent._parent.gotoAndPlay("exit");
}
Symbol 481 Button
on (release) {
_root.cutscene.rootTarget = "game";
_parent._parent.gotoAndPlay("exit");
}
Instance of Symbol 486 MovieClip in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
mission1text = new Object();
mission1text.car4 = "I'll warn you now, it takes a lot to impress me...";
mission1text.car5 = "Ok, show me what you've got!";
mission1text.car1 = "Let's see how fast you are!";
mission1text.car3 = "Ok honey, nice and easy to begin with...";
mission1text.car2 = "Come on mate, get a bloomin' move on.";
mission1text.renee = "Zis should be easy-peasy, n'est pas?";
mission2text = new Object();
mission2text.car4 = "You should be able to deal with these jokers easily.";
mission2text.car5 = "Go get'em Tiger!";
mission2text.car1 = "It's all about speed between buildings \u2013 keep your foot down!";
mission2text.car3 = "You can do this for me can't you?";
mission2text.car2 = "Let's show these wallies how it's done, eh?";
mission2text.renee = "Zese numb-skulls, always trying it on.";
mission3text = new Object();
mission3text.car4 = "Somebody needs to pay for this!";
mission3text.car5 = "We may need to pull over at some stage...";
mission3text.car1 = "I don't feel so good...";
mission3text.car3 = "Can you open a window?";
mission3text.car2 = "I'm telling you, that lav was a no-go area last night.";
mission3text.renee = "What do zey expect? Eating ze dirty burgers...";
mission4text = new Object();
mission4text.car4 = "I can't see what all the fuss is about...";
mission4text.car5 = "What a scumbag, stealing my tape...";
mission4text.car1 = "We'd better be quick, they're about to start the first screening!";
mission4text.car3 = "Silly girl... I lock up my tapes!";
mission4text.car2 = "I wouldn't mind stopping off to see it. Ah well, a job's a job.";
mission4text.renee = "I 'ave seen zis movie, such artistry!";
mission5text = new Object();
mission5text.car4 = "This should be quite a show...";
mission5text.car5 = "All this destruction makes me excited!";
mission5text.car1 = "Let's do this in style...";
mission5text.car3 = "More shopping? I like the sound of that!";
mission5text.car2 = "A Supermarket? Whoopy-doo.";
mission5text.renee = "All zese buildings at once? Such a big bang!";
mission6text = new Object();
mission6text.car4 = "Let's kick some butt!";
mission6text.car5 = "Keep it up!";
mission6text.car1 = "Pace yourself, don't peak too soon!";
mission6text.car3 = "Everybody needs good neighbours...?";
mission6text.car2 = "I had a dodgy neighbour once. Mind you, his wife...";
mission6text.renee = "I 'ope you 'ave ze stamina to keep it up...";
mission7text = new Object();
mission7text.car4 = "I hope they've got a sense of humour...";
mission7text.car5 = "No Police? Shame, i like a man in uniform.";
mission7text.car1 = "I can't wait to see their faces!";
mission7text.car3 = "Hey, where are the doughnuts again?";
mission7text.car2 = "Well this is a jolly jape. Most entertaining.";
mission7text.renee = "Ah yes, ze practical jokes!";
mission8text = new Object();
mission8text.car4 = "I think I know these guys...";
mission8text.car5 = "How big is the statue?";
mission8text.car1 = "We'll make short work of these guys \u2013 floor it!";
mission8text.car3 = "I think we're going to make a mess!";
mission8text.car2 = "This takes me back. Have they got a track on the roof?";
mission8text.renee = "Zeir boots are too big for zeir heads!";
this.msg = this[_root.mission + "text"].renee;
}
Symbol 488 MovieClip Frame 19
stop();
Symbol 488 MovieClip Frame 36
_root.gotoAndPlay(rootTarget);
Symbol 493 MovieClip [area] Frame 1
#initclip 85
Object.registerClass("area", cust.tiles.Area);
#endinitclip
Symbol 502 MovieClip Frame 28
_parent.msgOver();
Symbol 503 MovieClip [messages] Frame 1
#initclip 81
Object.registerClass("messages", cust.gui.Messages);
#endinitclip
Symbol 513 MovieClip [map] Frame 1
#initclip 82
Object.registerClass("map", cust.gui.Map);
#endinitclip
Symbol 516 MovieClip [Gui] Frame 1
#initclip 83
Object.registerClass("Gui", cust.gui.Gui);
#endinitclip
Symbol 517 MovieClip [game] Frame 1
#initclip 84
Object.registerClass("game", Game);
#endinitclip
Instance of Symbol 492 MovieClip "rippling" in Symbol 517 MovieClip [game] Frame 1
onClipEvent (load) {
Misc.playAtFrameRate(this, 25);
_visible = false;
}
Symbol 519 MovieClip Frame 1
function setProgress(p) {
bar._width = p * width;
}
width = 200;
if (this._name == "loader_mc") {
myName = _global.language.loadingAssets;
} else {
myName = _global.language.initLevel;
}
setProgress(0);
Symbol 523 MovieClip Frame 1
function onEnterFrame() {
var _local1 = getTimer();
times.push(_local1 - lastTime);
lastTime = _local1;
if (times.length > numTimes) {
times.shift();
}
if (((f++) % updateFrequency) == 0) {
var _local2 = avg(times);
output_txt.text = Math.round(1000 / _local2) + " fps";
}
}
function avg(a) {
var _local3 = 0;
var _local1 = 0;
while (_local1 < a.length) {
_local3 = _local3 + a[_local1];
_local1++;
}
return(_local3 / a.length);
}
var numTimes = 10;
var updateFrequency = 25;
var times = [];
var lastTime = getTimer();
var f = 0;
Symbol 526 Button
on (release) {
_parent.game.beginGame();
}
Symbol 527 Button
on (release) {
play();
_parent.game.beginGame();
}
Symbol 528 MovieClip Frame 1
stop();
Symbol 528 MovieClip Frame 7
stop();
Symbol 528 MovieClip Frame 10
gotoAndStop ("hide");
Symbol 535 MovieClip Frame 390
gotoAndPlay (1);
Instance of Symbol 548 MovieClip in Symbol 549 MovieClip Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation + _parent.speed);
}
Instance of Symbol 548 MovieClip in Symbol 549 MovieClip Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation + _parent.speed);
}
Instance of Symbol 549 MovieClip in Symbol 550 MovieClip Frame 1
onClipEvent (load) {
speed = 10;
}
Symbol 551 MovieClip Frame 1
stop();
Symbol 551 MovieClip Frame 16
if (_parent._parent.driveOut) {
gotoAndPlay ("driveAway");
} else {
gotoAndPlay ("loop");
}
Symbol 551 MovieClip Frame 48
stop();
_parent._parent.driveOut = false;
_root.wipeTo(_parent._parent.rootTarget);
Symbol 553 MovieClip Frame 1
stop();
Symbol 553 MovieClip Frame 16
if (_parent._parent.driveOut) {
gotoAndPlay ("driveAway");
} else {
gotoAndPlay ("loop");
}
Symbol 553 MovieClip Frame 48
stop();
_parent._parent.driveOut = false;
_root.wipeTo(_parent._parent.rootTarget);
Symbol 555 MovieClip Frame 1
stop();
Symbol 555 MovieClip Frame 16
if (_parent._parent.driveOut) {
gotoAndPlay ("driveAway");
} else {
gotoAndPlay ("loop");
}
Symbol 555 MovieClip Frame 48
stop();
_parent._parent.driveOut = false;
_root.wipeTo(_parent._parent.rootTarget);
Symbol 557 MovieClip Frame 1
stop();
Symbol 557 MovieClip Frame 21
if (_parent._parent.driveOut) {
gotoAndPlay ("driveAway");
} else {
gotoAndPlay ("loop");
}
Symbol 557 MovieClip Frame 53
stop();
_parent._parent.driveOut = false;
_root.wipeTo(_parent._parent.rootTarget);
Symbol 559 MovieClip Frame 1
stop();
Symbol 559 MovieClip Frame 16
if (_parent._parent.driveOut) {
gotoAndPlay ("driveAway");
} else {
gotoAndPlay ("loop");
}
Symbol 559 MovieClip Frame 48
stop();
_parent._parent.driveOut = false;
_root.wipeTo(_parent._parent.rootTarget);
Symbol 560 MovieClip Frame 2
this[_root.car].gotoAndPlay("in");
Symbol 560 MovieClip Frame 3
stop();
Symbol 568 Button
on (release) {
enterComp(_root.missionName, _root.actualTime, _root.groats, _root.equippedICE);
_parent.rootTarget = "mmenu";
_parent.driveOut = true;
}
Symbol 569 MovieClip Frame 1
displayNextMission = (_global.language.mmenu_nextMission + " ") + _global.language[_root.mission + "_name"];
stop();
Symbol 587 MovieClip Frame 1
stop();
Symbol 587 MovieClip Frame 4
stop();
Symbol 590 MovieClip Frame 1
stop();
Symbol 590 MovieClip Frame 2
stop();
Symbol 590 MovieClip Frame 3
stop();
Symbol 590 MovieClip Frame 4
stop();
Symbol 590 MovieClip Frame 5
stop();
Symbol 594 MovieClip [mc.imageloader] Frame 1
#initclip 86
Object.registerClass("mc.imageloader", ImageLoader);
#endinitclip
Symbol 598 Button
on (release) {
_parent.openWallpapers();
}
Symbol 601 Button
on (release) {
_parent._parent.play();
}
Symbol 602 MovieClip Frame 1
displayNextMission = (_global.language.mmenu_nextMission + " ") + _global.language[_root.mission + "_name"];
stop();
Symbol 603 MovieClip Frame 1
function openWallpapers() {
_root.kvClick(_global.language.wallpapersClickID);
getURL (_global.language.wallpapersUrl, "_blank");
}
completedMain.text = _global.language.completedMain;
wallpaperHolder.imgHolder1.loadImage(_global.language.wallpaper1ThumbUrl);
wallpaperHolder.imgHolder2.loadImage(_global.language.wallpaper2ThumbUrl);
wallpaperHolder.imgHolder3.loadImage(_global.language.wallpaper3ThumbUrl);
wallpaperHolder.imgHolder4.loadImage(_global.language.wallpaper4ThumbUrl);
Symbol 606 MovieClip Frame 1
stop();
Instance of Symbol 562 MovieClip "car1Speak" in Symbol 606 MovieClip Frame 1
onClipEvent (load) {
girlSpeak.text = _global.language[_root.car + "GirlSpeakWin"];
}
Instance of Symbol 587 MovieClip in Symbol 606 MovieClip Frame 1
onClipEvent (load) {
if (((_global.selectedMission - 1) == 4) || ((_global.selectedMission - 1) == 6)) {
if (_global.missionState[_global.selectedMission - 1] == "success") {
gotoAndStop ("on");
if ((_global.selectedMission - 1) == 4) {
txt.text = (_global.language.car4_name + " ") + _global.language.newCarUnlocked;
} else {
txt.text = (_global.language.car5_name + " ") + _global.language.newCarUnlocked;
}
}
}
}
Instance of Symbol 590 MovieClip in Symbol 606 MovieClip Frame 1
onClipEvent (load) {
if (_root.car == "car1") {
gotoAndStop (1);
_parent.codriver = "Penelope";
}
if (_root.car == "car2") {
gotoAndStop (2);
_parent.codriver = "Michael";
}
if (_root.car == "car3") {
gotoAndStop (3);
_parent.codriver = "Cleo";
}
if (_root.car == "car4") {
gotoAndStop (4);
_parent.codriver = "Silke";
}
if (_root.car == "car5") {
gotoAndStop (5);
_parent.codriver = "Emma";
}
_parent.buildings = (_root.destroyed + "/") + _root.totalTargs;
_parent.buildingBonus = Math.round((_root.destroyed * _root.groatsPerBuilding) + (_root.optionalBuildings * _root.groatsPerBonusBuilding));
_parent.extraBuildings = _root.optionalBuildings;
var timeForBonus = (_root.targetTime - _root.actualTime);
if (timeForBonus < 0) {
timeForBonus = 0;
}
_root.bonus = ((_root.difficultyBonus - 1) * 100) + "%";
_parent.timeBonus = Math.round(timeForBonus * _root.groatsPerSecond);
_parent.totalBonus = Math.round((_parent.buildingBonus + _parent.timeBonus) * _root.difficultyBonus);
_root.groats = Number(_root.groats) + Number(_parent.totalBonus);
_parent.displayTotalBonus = "$" + _parent.totalBonus;
_parent.displayGroats = "$" + _root.groats;
}
Symbol 606 MovieClip Frame 31
gotoAndStop (1);
Instance of Symbol 590 MovieClip in Symbol 612 MovieClip Frame 1
onClipEvent (load) {
if (_root.car == "car1") {
gotoAndStop (1);
}
if (_root.car == "car2") {
gotoAndStop (2);
}
if (_root.car == "car3") {
gotoAndStop (3);
}
if (_root.car == "car4") {
gotoAndStop (4);
}
if (_root.car == "car5") {
gotoAndStop (5);
}
}
Instance of Symbol 562 MovieClip "car1Speak" in Symbol 612 MovieClip Frame 1
onClipEvent (load) {
girlSpeak.text = _global.language[_root.car + "GirlSpeakLose"];
}
Symbol 612 MovieClip Frame 92
driveOut = true;
stop();