Instance of Symbol 1712 MovieClip "startupPanel" in Frame 1
on (press) {
if (_root.luxor.scoreSignDelay > 1) {
_root.luxor.scoreSignDelay = 1;
}
}
Symbol 624 MovieClip [Shooter] Frame 1
#initclip 28
Object.registerClass("Shooter", src.Shooter);
#endinitclip
Symbol 695 MovieClip [ParticleHolder] Frame 1
#initclip 24
Object.registerClass("ParticleHolder", src.Particle);
#endinitclip
Symbol 1628 MovieClip [LightningHolder] Frame 1
stop();
var startTime = getTimer();
onEnterFrame = function () {
var _local2 = (getTimer() - startTime) / 500;
_local2 = 1 - (((_local2 * _local2) * _local2) * _local2);
if (_local2 < 0) {
this.removeMovieClip();
_local2 = 0;
}
p0._alpha = (Math.random() * 100) * _local2;
p1._alpha = (Math.random() * 100) * _local2;
p2._alpha = (Math.random() * 100) * _local2;
p0.gotoAndStop(int(Math.random() * 16) + 1);
p1.gotoAndStop(int(Math.random() * 16) + 1);
p2.gotoAndStop(int(Math.random() * 16) + 1);
};
Symbol 1630 MovieClip [ScorePopup] Frame 1
#initclip 25
Object.registerClass("ScorePopup", src.ScorePopup);
#endinitclip
Symbol 1651 MovieClip [WarningLight] Frame 1
#initclip 26
Object.registerClass("WarningLight", src.WarningLight);
#endinitclip
Symbol 1684 MovieClip [Luxor] Frame 1
#initclip 27
Object.registerClass("Luxor", src.Luxor);
#endinitclip
Symbol 1689 Button
on (press) {
luxor.toggleSound();
}
Symbol 1693 Button
on (press) {
luxor.quitPressed();
}
Symbol 1712 MovieClip Frame 1
stop();
Symbol 1713 MovieClip [__Packages.src.Particle] Frame 0
class src.Particle extends MovieClip
{
var timeFactor, x, y, xa, ya, startTime, gotoAndStop, particle, _x, _y, removeMovieClip;
function Particle () {
super();
timeFactor = (Math.random() * 0.5) + 0.75;
}
function init(x, y, xa, ya, type) {
this.x = x;
this.y = y;
this.xa = xa;
this.ya = ya;
if (_global.party == true) {
this.xa = this.xa * 2;
this.ya = this.ya * 2;
x = x + ((Math.random() * 8) - 4);
y = y + ((Math.random() * 8) - 4);
}
startTime = getTimer();
gotoAndStop(type + 1);
onEnterFrame();
}
function onEnterFrame() {
var _local2 = (((getTimer() - startTime) * 24) / 1000) * timeFactor;
particle.gotoAndStop(int(_local2) + 1);
_x = x + (xa * _local2);
_y = (y + (ya * _local2)) + ((_local2 * _local2) * 0.05);
if (_local2 > 16) {
removeMovieClip();
}
}
}
Symbol 1714 MovieClip [__Packages.src.ScorePopup] Frame 0
class src.ScorePopup extends MovieClip
{
var textArea, x, y, startTime, _x, _y, _alpha, removeMovieClip;
function ScorePopup () {
super();
}
function init(x, y, color, text) {
textArea.textColor = color;
textArea.text = text;
this.x = x;
this.y = y;
startTime = getTimer();
onEnterFrame();
}
function onEnterFrame() {
var _local2 = (getTimer() - startTime) / 1000;
_x = x;
_y = y - (_local2 * 40);
_alpha = 100 - (((_local2 * _local2) * _local2) * 100);
if (_local2 >= 1) {
removeMovieClip();
}
}
}
Symbol 1715 MovieClip [__Packages.src.WarningLight] Frame 0
class src.WarningLight extends MovieClip
{
var animSpeed, cl;
function WarningLight () {
super();
render(0);
animSpeed = 10;
}
function tick(timeWarningFactor, distanceWarningFactor) {
var _local2 = timeWarningFactor;
if (_local2 > distanceWarningFactor) {
_local2 = distanceWarningFactor;
}
animTime++;
if (animTime == 0) {
if (_local2 > 1) {
animTime = -1;
}
}
if (animTime == 10) {
animTime = -(int(30 * _local2) + 1);
if (animTime >= 0) {
animTime = -1;
}
}
}
function render(alpha) {
var _local4 = animTime + alpha;
if (_local4 < 1) {
if (!wasVisible) {
return(undefined);
}
wasVisible = false;
cl._visible = false;
var _local2 = 0;
while (_local2 < 4) {
var _local3 = this["l" + _local2];
_local3._visible = false;
_local2++;
}
return(undefined);
}
if (!wasVisible) {
wasVisible = true;
cl._visible = true;
var _local2 = 0;
while (_local2 < 4) {
var _local3 = this["l" + _local2];
_local3._visible = true;
_local2++;
}
}
_local4 = _local4 - 1;
_local4 = _local4 / animSpeed;
cl._alpha = (Math.sin((_local4 * Math.PI) * 2) * 50) + 50;
var _local2 = 0;
while (_local2 < 4) {
var _local3 = this["l" + _local2];
_local3.gotoAndStop(8 - int(_local4 * 8));
var _local5 = ((_local2 & 1) * 2) - 1;
var _local6 = (_local2 & 2) - 1;
_local3._x = (38 - (_local4 * 35)) * _local5;
_local3._y = (38 - (_local4 * 35)) * _local6;
_local2++;
}
}
var animTime = -1;
var wasVisible = true;
}
Symbol 1716 MovieClip [__Packages.src.timing.Timeable] Frame 0
interface src.timing.Timeable
{
}
Symbol 1717 MovieClip [__Packages.src.Luxor] Frame 0
class src.Luxor extends MovieClip implements src.timing.Timeable
{
var usedMaps, random, superRandom, orgGemRandomSeed, gemRandom, overlay, background, ballLayer, mc, mapXml, loaderObj, startLoadTime, myBitmap, createEmptyMovieClip, colorFilter, blurFilter, instructionsReplayer, level, _quality, _x, gems, shootBall, shooter, levelPopup, communicator, timer, gemsToRemove, progressMeter;
function Luxor () {
super();
usedMaps = new Array(MAP_NAMES.length);
var _local3 = 0;
while (_local3 < usedMaps.length) {
usedMaps[_local3] = false;
_local3++;
}
score = 0;
}
function nextLevel() {
trace("NEXT LEVEL CALLED!");
_root.startupPanel._visible = true;
_root.startupPanel.gotoAndStop(1);
if (DEBUG_MODE) {
usedMaps[31] = true;
usedMaps[39] = true;
usedMaps[48] = true;
}
random = new src.util.Random(superRandom.nextInt(2147483647));
orgGemRandomSeed = superRandom.nextInt(2147483647);
gemRandom = new src.util.Random(orgGemRandomSeed);
if (_global.relaxMode) {
var _local5 = true;
var _local4 = 0;
while (_local4 < MAP_NAMES.length) {
if (!usedMaps[_local4]) {
_local5 = false;
}
_local4++;
}
if (_local5) {
_local4 = 0;
while (_local4 < MAP_NAMES.length) {
usedMaps[_local4] = false;
_local4++;
}
}
usedMaps[31] = true;
usedMaps[39] = true;
usedMaps[48] = true;
do {
mapNum = random.nextInt(MAP_NAMES.length);
} while (usedMaps[mapNum]);
usedMaps[mapNum] = true;
} else {
mapNum = parseInt(_global.levels[(mapPointer++) % 10]);
}
levelName = _global.textMappings["level_name_" + mapNum];
loadLevel();
Key.removeListener(this);
skipTicks = 2;
}
function loadLevel() {
loadLevelAt = -1;
trace(("Loading level " + MAP_NAMES[mapNum]) + "..");
overlay.removeMovieClip();
background.removeMovieClip();
ballLayer.removeMovieClip();
ballLayer = mc.createEmptyMovieClip("ballLayer", 0);
overlay = ballLayer.createEmptyMovieClip("overlay", 5000);
background = ballLayer.createEmptyMovieClip("background", 0);
if (DEBUG_MODE) {
domain = "http://www.king.com";
}
started = false;
xmlLoaded = false;
delete mapXml;
delete loaderObj;
mapXml = new XML();
mapXml.ignoreWhite = true;
mapXml.onLoad = mx.utils.Delegate.create(this, mapXmlLoaded);
loaderObj = new MovieClipLoader();
loaderObj.addListener(this);
loadSteps = 0;
imagesLoaded = false;
imageProcess = 0;
if (DEBUG_MODE && (Math.random() < 0.5)) {
loaderObj.loadClip(((domain + "/games/luxor/") + MAP_NAMES[mapNum]) + "_front__.png", overlay);
} else {
loaderObj.loadClip(((domain + "/games/luxor/") + MAP_NAMES[mapNum]) + "_front.png", overlay);
}
startLoadTime = getTimer();
}
function onLoadError(target_mc, loadedBytes, totalBytes) {
trace("Failed to load image!!");
mapXml.onLoad = undefined;
if (loaderObj != null) {
loaderObj.removeListener(this);
}
delete mapXml;
delete loaderObj;
loadLevelAt = getTimer() + 200;
}
function onLoadProgress(target_mc, loadedBytes, totalBytes) {
imageProcess = ((loadedBytes / totalBytes) / 2) + (loadSteps * 0.5);
}
function onLoadInit() {
trace("Loaded image.");
if (loaderObj != null) {
loaderObj.removeListener(this);
}
delete loaderObj;
if (loadSteps == 0) {
loadSteps = 1;
loaderObj = new MovieClipLoader();
loaderObj.addListener(this);
if (DEBUG_MODE && (Math.random() < 0.5)) {
loaderObj.loadClip(((domain + "/games/luxor/") + MAP_NAMES[mapNum]) + "_back__.jpg", background);
} else {
loaderObj.loadClip(((domain + "/games/luxor/") + MAP_NAMES[mapNum]) + "_back.jpg", background);
}
} else if (loadSteps == 1) {
imagesLoaded = true;
if (DEBUG_MODE && (Math.random() < 0.5)) {
mapXml.load(((domain + "/games/luxor/") + MAP_NAMES[mapNum]) + "__.xml");
} else {
mapXml.load(((domain + "/games/luxor/") + MAP_NAMES[mapNum]) + ".xml");
}
}
}
function mapXmlLoaded(success) {
if (success) {
trace("Loaded xml.");
xmlLoaded = true;
} else {
trace("Failed to load xml!!");
if (loaderObj != null) {
loaderObj.removeListener(this);
}
mapXml.onLoad = undefined;
delete mapXml;
delete loaderObj;
loadLevelAt = getTimer() + 200;
}
}
function startGlow() {
if (glowing) {
return(undefined);
}
glowing = true;
myBitmap = new flash.display.BitmapData(777, 600, true, 16777215);
var _local3 = createEmptyMovieClip("holder_mc", 1);
_local3.attachBitmap(myBitmap, 1);
_local3._alpha = 100;
var _local2 = new Array();
_local2 = _local2.concat([4, 2, 2, 0, -1280]);
_local2 = _local2.concat([2, 4, 2, 0, -1280]);
_local2 = _local2.concat([2, 2, 4, 0, -1280]);
_local2 = _local2.concat([0, 0, 0, 1, 0]);
colorFilter = new flash.filters.ColorMatrixFilter(_local2);
blurFilter = new flash.filters.BlurFilter(24, 24, 2);
_local3.blendMode = "screen";
_local3._alpha = 100;
}
function showInstructions() {
showingInstructions = true;
instructionsReplayer = new src.InstructionsReplayer(this);
scoreSignDelay = 600;
_root.startupPanel.gotoAndStop(2);
_root.startupPanel.timerText = _global.textMappings.next_level_in.split("[0]").join("" + int((scoreSignDelay + 22) / 24));
_root.startupPanel.titleText = _global.textMappings.instructions_title;
_root.startupPanel.instructionsText = _global.textMappings.instructions_text;
currentLevel = 0;
}
function mapLoaded() {
if (currentLevel < 0) {
src.Sounds.get("sndIntroMusic").playOffsVolPan(0, 100, 0);
showInstructions();
return(undefined);
}
src.Ball.ballCounts = undefined;
_root.startupPanel._visible = false;
var _local7 = new Array();
var _local5 = mapXml.childNodes[0].childNodes;
var _local4 = 0;
while (_local4 < _local5.length) {
if (_local5[_local4].nodeName == "name") {
}
if (_local5[_local4].nodeName == "path") {
_local7.push(new String(_local5[_local4].firstChild.nodeValue));
}
_local4++;
}
scoreSignDelay = 0;
BALL_COUNT = 30 / _local7.length;
started = true;
skipTicks = 1;
level = new src.Level(this, _local7, currentLevel, random);
level.startScore = score;
currentLevel++;
if (_global.shortGameMode && (currentLevel > 1)) {
wantsBall = false;
}
levelTicks = 0;
_quality = "LOW";
_x = -22;
gems = new Array();
shootBall = undefined;
shooter.ball = null;
levelPopup._visible = true;
levelPopup.levelNum = _global.textMappings.level_num.split("[0]").join(currentLevel);
levelPopup.levelName = levelName;
levelPopup.gotoAndStop(1);
signDelay = 72;
communicator.sendLevelStart(currentTick);
src.Sounds.get("sndLevelIntro").playOffsVolPan(0, 100, 0);
shooter = ballLayer.attachMovie("Shooter", "shooter", 44999);
shooter._y = 550;
ballInserted();
_local4 = 0;
while (_local4 < level.tracks.length) {
var _local6 = ballLayer.attachMovie("WarningLight", "warningLight" + _local4, 40000 + _local4);
level.tracks[_local4].setWarningLight(_local6);
_local4++;
}
if (DEBUG_MODE && (DEBUG_REPLAY)) {
timer = new src.timing.Timer(this, 192);
} else {
timer = new src.timing.Timer(this, 24);
}
Key.addListener(this);
}
function startWarningSound() {
if (!hasWarningSound) {
src.Sounds.get("sndWarning").playLooping();
hasWarningSound = true;
}
}
function stopWarningSound() {
if (hasWarningSound) {
src.Sounds.get("sndWarning").stop();
hasWarningSound = false;
}
}
function onKeyDown() {
keyPressed = true;
var _local3 = chr(Key.getAscii());
if (_local3 == "q") {
inputBuffer = "";
} else {
inputBuffer = inputBuffer + _local3;
if (inputBuffer == "roll") {
src.Sounds.get("sndLightning").playOffsVolPan(0, 100, 0);
_global.roll = true;
}
if (inputBuffer == "notch") {
src.Sounds.get("sndLightning").playOffsVolPan(0, 100, 0);
_global.spark2 = true;
}
if (inputBuffer == "party") {
src.Sounds.get("sndLightning").playOffsVolPan(0, 100, 0);
_global.party = true;
}
}
}
function getLastSegment(track) {
var _local1 = track.firstSegment;
while (_local1.nextSegment != undefined) {
_local1 = _local1.nextSegment;
}
return(_local1);
}
function newTrain(track) {
var _local4 = level.getColorChain(BALL_COUNT, track.random);
var _local3 = new Array(BALL_COUNT + 1);
var _local2 = 0;
while (_local2 < BALL_COUNT) {
_local3[_local2] = newBall(_local4[_local2]);
_local2++;
}
_local3[BALL_COUNT] = newBall(src.Ball.COLOR_VISE);
var _local5 = new src.TrainSegment(track, _local3);
src.Sounds.get("sndTrainSpawn").playOffsVolPan(0, 100, 0);
level.segments++;
if (track.firstSegment != undefined) {
var _local7 = getLastSegment(track);
_local5.lastSegment = _local7;
_local7.nextSegment = _local5;
} else {
track.firstSegment = _local5;
}
}
function newScorePopup(x, y, color, text) {
x = x - 22;
if (x < 50) {
x = 50;
}
if (x > 705) {
x = 705;
}
if (y < 50) {
y = 50;
}
if (y > 550) {
y = 550;
}
x = x + 22;
var _local4 = ballLayer.attachMovie("ScorePopup", "score" + scorePopupCount, 20001 + scorePopupCount);
_local4.init(x, y, color, text);
scorePopupCount++;
if (scorePopupCount == 4000) {
scorePopupCount = 0;
}
}
function newBall(color) {
if (color == undefined) {
color = level.randomColor();
}
var _local2 = ballLayer.attachMovie("BallHolder", "ball" + ballCount, 5001 + ballCount);
_local2._x = -100;
var _local4 = new src.Ball(color, ballCount, _local2);
ballCount++;
if (ballCount == 4000) {
ballCount = 0;
}
return(_local4);
}
function newGem(x, y, color) {
if (isInstructions) {
return(undefined);
}
if (color == undefined) {
color = gemRandom.nextInt(5) + Math.min(level.levelNum, 10);
}
var _local4 = ballLayer.attachMovie("GemHolder", "gem" + gemCount, 10001 + gemCount);
var _local2 = new src.Gem(this, color, x, y, _local4, random);
gemCount++;
if (gemCount == 4000) {
gemCount = 0;
}
gems.push(_local2);
return(_local2);
}
function newCoin(x, y) {
return(newGem(x, y, 18));
}
function removeGem(gem) {
if (gemsToRemove == undefined) {
gemsToRemove = new Array();
}
gemsToRemove.push(gem);
}
function newParticle(x, y, type) {
var _local8 = ((_global.party == true) ? 4 : 1);
var _local4 = 0;
while (_local4 < _local8) {
if ((type == 0) && (_global.spark2 == true)) {
type = 3;
}
var _local6 = ballLayer.attachMovie("ParticleHolder", "particle" + particleCount, 15001 + particleCount);
var _local5 = (Math.random() * Math.PI) * 2;
var _local3 = Math.random() * 3;
_local6.init(x, y, Math.sin(_local5) * _local3, Math.cos(_local5) * _local3, type);
particleCount++;
if (particleCount == 4000) {
particleCount = 0;
}
_local4++;
}
}
function init() {
communicator = new src.Communicator();
communicator.parseGameData(_root.gameData);
communicator.gameStarted();
if (DEBUG_MODE) {
}
if (DEBUG_REPLAY) {
superRandom = new src.util.Random(src.DebugData.superSeed);
} else {
superRandom = new src.util.Random(communicator.randomSeed);
}
nextLevel();
if (_global.relaxMode) {
timeLeft = "--";
}
}
function onEnterFrame() {
if ((loadLevelAt >= 0) && (getTimer() > loadLevelAt)) {
loadLevel();
}
if (showingInstructions) {
instructionsReplayer.onEnterFrame();
score = 0;
scoreSignDelay--;
_root.startupPanel.timerText = _global.textMappings.next_level_in.split("[0]").join("" + int((scoreSignDelay + 22) / 24));
if (scoreSignDelay <= 1) {
instructionsReplayer.dispose();
scoreSignDelay = 0;
showingInstructions = false;
mapLoaded();
}
return(undefined);
}
if (!hasGameData) {
if (DEBUG_MODE) {
_root.gameData = DEBUG_GAME_DATA;
}
if (_root.gameData != undefined) {
hasGameData = true;
init();
}
return(undefined);
}
if (started) {
if (skipTicks < 2) {
timer.advanceTime();
skipTicks = 0;
}
} else {
_root.startupPanel.loadingText.text = _global.textMappings.loading.split("[0]").join(int(imageProcess * 100));
if ((imagesLoaded && (xmlLoaded)) && (getTimer() > (startLoadTime + 500))) {
mapLoaded();
}
}
if (glowing) {
myBitmap.draw(ballLayer);
myBitmap.applyFilter(myBitmap, myBitmap.rectangle, new flash.geom.Point(0, 0), colorFilter);
myBitmap.applyFilter(myBitmap, myBitmap.rectangle, new flash.geom.Point(0, 0), blurFilter);
}
}
function onPress() {
clicked = true;
}
function processPress(xShooter) {
if (scoreSignDelay > 2) {
if (level.lost && (scoreSignDelay > 288)) {
return(undefined);
}
scoreSignDelay = 2;
return(undefined);
}
if (signDelay > 1) {
signDelay = 1;
return(undefined);
}
if (shooter.ball != undefined) {
level.shotsFired++;
if (shooter.ball.color == src.Ball.COLOR_LIGHTNING) {
var _local5 = ballLayer.attachMovie("LightningHolder", "particle" + particleCount, 15001 + particleCount);
_local5._x = xShooter;
_local5._y = 520;
particleCount++;
var _local2 = 0;
while (_local2 < level.tracks.length) {
var _local3 = level.tracks[_local2];
_local3.firstSegment.lightning(xShooter, 32);
src.Sounds.get("sndLightning").playOffsVolPan(0, 100, (xShooter - 377) / PAN_DAMP);
_local2++;
}
shooter.ball.remove();
shooter.ball = undefined;
wantsBall = false;
level.nextBall();
reload();
} else {
src.Sounds.get("sndShootBall").playOffsVolPan(0, 100, (xShooter.get(1) - 377) / PAN_DAMP);
var _local6 = level.speedShotTime > 0;
shootBall = new src.ShootBall(shooter.ball, xShooter, 536, _local6);
shooter.ball = undefined;
wantsBall = false;
level.nextBall();
}
}
}
function ballInserted() {
reload();
}
function reload() {
if ((!_global.shortGameMode) || (currentLevel <= 1)) {
wantsBall = true;
}
}
function tickGems(xShooter) {
if (gemsToRemove != undefined) {
while (gemsToRemove.length > 0) {
var _local4 = gemsToRemove.pop();
var _local2 = -1;
var _local3 = 0;
while (_local3 < gems.length) {
if (gems[_local3] == _local4) {
_local2 = _local3;
break;
}
_local3++;
}
if (_local2 >= 0) {
gems.splice(_local3, 1);
}
}
gemsToRemove = undefined;
}
var _local3 = 0;
while (_local3 < gems.length) {
gems[_local3].tick(xShooter);
_local3++;
}
}
function tickShootBall() {
if (shootBall != undefined) {
var _local6 = false;
var _local2 = 0;
while (_local2 < level.tracks.length) {
var _local7 = level.tracks[_local2];
if ((_local7.firstSegment != undefined) && (_local7.firstSegment.collideCheck(shootBall))) {
_local6 = true;
}
_local2++;
}
if (_local6) {
shootBall.collide();
if (shootBall.ball.color == src.Ball.COLOR_FIREBALL) {
_local2 = 0;
while (_local2 < 16) {
var _local3 = ((_local2 * Math.PI) * 2) / 16;
var _local4 = Math.sin(_local3) * 100;
var _local5 = Math.cos(_local3) * 100;
newParticle(shootBall.x + _local4, shootBall.y + _local5, 2);
_local2++;
}
_local2 = 0;
while (_local2 < level.tracks.length) {
var _local7 = level.tracks[_local2];
_local7.firstSegment.fireBall(shootBall.x, shootBall.y, 100);
_local2++;
}
src.Sounds.get("sndFireball").playOffsVolPan(0, 100, (shootBall.x - 377) / PAN_DAMP);
shootBall.ball.remove();
reload();
} else {
var _local7 = shootBall.collidedBall.track;
if (shootBall.hitFront || (shootBall.collidedBall.color == src.Ball.COLOR_VISE)) {
_local7.firstSegment.insertBallBeside(shootBall.ball, shootBall.collidedBall, 0);
} else {
_local7.firstSegment.insertBallBeside(shootBall.ball, shootBall.collidedBall, 1);
}
}
shootBall = undefined;
}
}
if (shootBall != undefined) {
shootBall.tick();
if (shootBall.y < -32) {
level.multiMatchCount = 0;
shootBall.ball.remove();
shootBall = undefined;
reload();
}
}
}
function gemGotten() {
gotGem = true;
}
function tick(tick) {
if (skipTicks == 1) {
return(undefined);
}
if (level.won && (scoreSignDelay == 1)) {
return(undefined);
}
if (_global.shortGameMode && (currentLevel > 1)) {
if (signDelay == 0) {
levelTicks++;
}
if (levelTicks == 72) {
level.lost = true;
communicator.sendGameLost(currentTick, score - level.startScore);
communicator.gameEnd(score);
finalScore = true;
src.Sounds.get("sndGameOver").playOffsVolPan(0, 100, 0);
levelPopup._visible = true;
fillLevelPopupData(_global.textMappings.nag_title, false);
levelPopup.gameOverText = _global.textMappings.nag_text;
levelPopup.gotoAndStop(3);
scoreSignDelay = 360;
levelPopup.timerText = _global.textMappings.game_ends_in.split("[0]").join("" + int((scoreSignDelay + 22) / 24));
}
}
if ((currentTick % 120) == 0) {
communicator.sendSyncScore(currentTick, score);
}
var _local5 = int(shooter.x.get(1));
if (DEBUG_REPLAY) {
_local5 = -1000;
clicked = false;
keyPressed = false;
var _local4 = 0;
while (_local4 < src.DebugData.data.length) {
var _local3 = src.DebugData.data[_local4];
var _local7 = _local3[1];
if (currentTick == _local7) {
if (_local3[0] == "click") {
_local5 = _local3[2];
clicked = true;
}
if (_local3[0] == "getgem") {
_local5 = _local3[2];
}
if (_local3[0] == "keypress") {
keyPressed = true;
}
}
_local4++;
}
}
if (clicked) {
communicator.sendClick(currentTick, _local5);
processPress(_local5);
clicked = false;
}
if (keyPressed) {
communicator.sendKeyPress(currentTick);
src.Sounds.get("sndSwapBall").playOffsVolPan(0, 100, (_local5 - 377) / PAN_DAMP);
level.swapBalls();
keyPressed = false;
}
if ((ticksLeft < TIME_WARNING_TIME) || (level.hasWarning())) {
startWarningSound();
} else {
stopWarningSound();
}
if (signDelay > 0) {
signDelay--;
if (signDelay == 0) {
var _local4 = 0;
while (_local4 < level.tracks.length) {
var _local6 = level.tracks[_local4];
newTrain(_local6);
_local4++;
}
levelPopup._visible = false;
}
} else {
if (!_global.relaxMode) {
if (((ticksLeft > 0) && (!level.lost)) && (!level.won)) {
ticksLeft--;
var _local8 = int((ticksLeft + 23) / 24);
var _local9 = int(_local8 / 60);
_local8 = _local8 % 60;
timeLeft = ((_local9 + ":") + ((_local8 < 10) ? "0" : "")) + _local8;
if (ticksLeft == 0) {
level.lose();
}
}
} else {
timeLeft = "--";
}
level.tick();
level.tickWarning(ticksLeft / TIME_WARNING_TIME);
if (wantsBall) {
if ((level.currentBallColor >= 0) && (shooter.ball == undefined)) {
src.Sounds.get("sndReloadBall").playOffsVolPan(0, 100, (_local5 - 377) / PAN_DAMP);
shooter.ball = newBall(level.currentBallColor);
shooter.ball.mc.swapDepths(shooter.getDepth() + 1);
} else if (shooter.ball != undefined) {
if (level.currentBallColor < 0) {
shooter.ball.remove();
shooter.ball = undefined;
} else {
shooter.ball.setColor(level.currentBallColor);
}
}
}
}
shooter.preview.gotoAndStop(level.nextBallColor + 2);
tickGems(_local5);
if (gotGem) {
communicator.sendGetGem(currentTick, _local5);
gotGem = false;
}
shooter.tick();
tickShootBall();
if ((level.lost || (level.won)) || (ticksLeft <= 0)) {
stopWarningSound();
}
if (level.lost) {
if (scoreSignDelay == 0) {
communicator.sendGameLost(currentTick, score - level.startScore);
communicator.gameEnd(score);
finalScore = true;
src.Sounds.get("sndGameOver").playOffsVolPan(0, 100, 0);
levelPopup._visible = true;
fillLevelPopupData(_global.textMappings.game_over, false);
levelPopup.gotoAndStop(2);
scoreSignDelay = 360;
levelPopup.timerText = _global.textMappings.game_ends_in.split("[0]").join("" + int((scoreSignDelay + 22) / 24));
} else if (scoreSignDelay > 1) {
scoreSignDelay--;
if (scoreSignDelay == 1) {
communicator.gameQuit();
}
levelPopup.timerText = _global.textMappings.game_ends_in.split("[0]").join("" + int((scoreSignDelay + 22) / 24));
}
}
if (((level.won && (!level.lost)) && (gems.length == 0)) && (level.winAnimationsDone())) {
if (scoreSignDelay == 0) {
communicator.sendLevelComplete(currentTick, score - level.startScore);
src.Sounds.get("sndLevelComplete").playOffsVolPan(0, 100, 0);
levelPopup._visible = true;
fillLevelPopupData(_global.textMappings.level_over, true);
levelPopup.gotoAndStop(2);
scoreSignDelay = 120;
levelPopup.timerText = _global.textMappings.next_level_in.split("[0]").join("" + int((scoreSignDelay + 22) / 24));
} else if (scoreSignDelay > 1) {
scoreSignDelay--;
if (scoreSignDelay == 1) {
nextLevel();
}
levelPopup.timerText = _global.textMappings.next_level_in.split("[0]").join("" + int((scoreSignDelay + 22) / 24));
}
}
currentTick++;
}
function gainScore(scoreToGain) {
if (!finalScore) {
score = score + scoreToGain;
}
}
function fillLevelPopupData(title, levelScore) {
levelPopup.titleText = title;
if (levelScore) {
levelPopup.levelScoreText = (_global.textMappings.level_score + " ") + (score - level.startScore);
} else {
levelPopup.levelScoreText = (_global.textMappings.final_score + " ") + score;
}
levelPopup.statNames1 = (((_global.textMappings.stat_shots_fired + "\r") + _global.textMappings.stat_coins_gotten) + "\r") + _global.textMappings.stat_gems_gotten;
levelPopup.statVals1 = (((level.shotsFired + "\r") + level.coinsGotten) + "\r") + level.gemsGotten;
levelPopup.statNames2 = (((_global.textMappings.stat_max_combo + "\r") + _global.textMappings.stat_max_chain) + "\r") + _global.textMappings.stat_segments;
levelPopup.statVals2 = (((level.maxCombo + "\r") + level.maxChain) + "\r") + level.segments;
}
function render(tick, alpha) {
progressMeter.mask._xScale = level.progress * 100;
while ((getTimer() - lastFpsTime) > 1000) {
lastFpsTime = lastFpsTime + 1000;
_root.fps = frames;
frames = 0;
}
level.render(alpha);
shooter.render(alpha);
var _local3 = 0;
while (_local3 < gems.length) {
gems[_local3].render(alpha);
_local3++;
}
if (shootBall != undefined) {
shootBall.render(alpha);
}
frames++;
}
function quitPressed() {
if ((scoreSignDelay == 0) && (signDelay == 0)) {
level.lost = true;
communicator.sendGameEndPressed();
communicator.sendGameLost(currentTick, score - level.startScore);
communicator.gameEnd(score);
finalScore = true;
levelPopup._visible = true;
fillLevelPopupData(_global.textMappings.game_over, false);
levelPopup.gotoAndStop(2);
scoreSignDelay = 360;
}
}
function toggleSound() {
src.Sounds.toggleSound();
}
var DEBUG_MODE = false;
var DEBUG_REPLAY = false;
var isInstructions = false;
var loadLevelAt = -1;
var DEBUG_GAME_DATA = "<gamedata randomseed=\"183758344\" timelimit=\"300\" mode=\"long\" relaxMode=\"true\"> <ruleset>1</ruleset> <levels>24,3,14,28,33,48,36,20,2,30</levels> <text id=\"powerup_color_bomb\">COLOR BOMB!</text> <text id=\"powerup_lightning\">LIGHTNING BALL!</text> <text id=\"powerup_reverse\">REVERSE!</text> <text id=\"powerup_fire_ball\">FIRE BALL!</text> <text id=\"powerup_slow\">SLOW!</text> <text id=\"powerup_speed_shot\">SPEED SHOT!</text> <text id=\"powerup_stop\">STOP!</text> <text id=\"powerup_wild\">WILD BALL!</text> <text id=\"score_combo\">COMBO</text> <text id=\"score_chain\">CHAIN</text> <text id=\"loading\">LOADING [0]%</text> <text id=\"level_num\">Level [0]</text> <text id=\"game_over\">GAME OVER</text> <text id=\"final_score\">FINAL SCORE:</text> <text id=\"game_ends_in\">The game will end in [0] seconds.</text> <text id=\"level_over\">LEVEL COMPLETE</text> <text id=\"level_score\">LEVEL SCORE:</text> <text id=\"next_level_in\">Next level starts in [0] seconds.</text> <text id=\"stat_shots_fired\">Shots Fired:</text> <text id=\"stat_coins_gotten\">Coins:</text> <text id=\"stat_gems_gotten\">Gems:</text> <text id=\"stat_max_combo\">Max Combo:</text> <text id=\"stat_max_chain\">Max Chain:</text> <text id=\"stat_segments\">Segments:</text> <text id=\"nag_title\">GAME OVER</text> <text id=\"nag_text\">REPLACE THIS TEXT / Please register to blah blah blah / REPLACE THIS TEXT</text> <text id=\"instructions_title\">INSTRUCTIONS</text> <text id=\"instructions_text\">(Instructions for the game goes here)</text> <text id=\"level_name_0\">ANUBIS AEGYPTUS</text> <text id=\"level_name_1\">ARMA MEGIDDO</text> <text id=\"level_name_2\">BARQUE OF THE GODDESS</text> <text id=\"level_name_3\">BASTION OF THE CAT GODDESS</text> <text id=\"level_name_4\">COBRAIC TWILIGHT</text> <text id=\"level_name_5\">CROSSING THE REED SEA</text> <text id=\"level_name_6\">DANCE OF THE CROCODILES</text> <text id=\"level_name_7\">DEN OF THE HYENAS</text> <text id=\"level_name_8\">DIE KHUFU DIE</text> <text id=\"level_name_9\">EYE OF HORUS</text> <text id=\"level_name_10\">FESTIVAL OF JUBILEE</text> <text id=\"level_name_11\">FLIGHT OF THE SACRED IBIS</text> <text id=\"level_name_12\">GRAND GALLERY</text> <text id=\"level_name_13\">HALL OF THE APIS BULL</text> <text id=\"level_name_14\">HATHOR'S LOVING EMBRACE</text> <text id=\"level_name_15\">HORUS HAWK ASCENDING</text> <text id=\"level_name_16\">IMHOTEP'S FOLLY</text> <text id=\"level_name_17\">INNER SANCTUM OF THE TEMPLE</text> <text id=\"level_name_18\">IN THE SHADOW OF THE PYRAMIDS</text> <text id=\"level_name_19\">INUNDATION OF THE NILE</text> <text id=\"level_name_20\">INVASION OF THE HYKSOS</text> <text id=\"level_name_21\">ISIS KNOT</text> <text id=\"level_name_22\">KHUFU'S REVENGE</text> <text id=\"level_name_23\">LAIR OF THE JACKAL GOD</text> <text id=\"level_name_24\">MARSHES OF THE DELTA</text> <text id=\"level_name_25\">MUMMY DEAREST</text> <text id=\"level_name_26\">NARMER PALETTE</text> <text id=\"level_name_27\">NAVIGATING THE CATARACTS</text> <text id=\"level_name_28\">NEPTHY'S GARDEN</text> <text id=\"level_name_29\">OASIS OF THE EAST</text> <text id=\"level_name_30\">OASIS OF THE WEST</text> <text id=\"level_name_31\">OPENING OF THE MOUTH CEREMONY</text> <text id=\"level_name_32\">PATH OF THE GOLDEN GODDESS</text> <text id=\"level_name_33\">PHARAOH'S WAR CROWN</text> <text id=\"level_name_34\">POOL OF THE LOTUS BLOSSOM</text> <text id=\"level_name_35\">QUEEN OF DENIAL</text> <text id=\"level_name_36\">RA'S JOURNEY TO THE WEST</text> <text id=\"level_name_37\">REIGN OF THE HERETIC KING</text> <text id=\"level_name_38\">RIDDLE OF THE SPHINX</text> <text id=\"level_name_39\">ROBOT FACTORY</text> <text id=\"level_name_40\">SCROLL OF THOTH</text> <text id=\"level_name_41\">THE PILLAR OF OSIRIS</text> <text id=\"level_name_42\">THE STELLAE OF THUTMOSIS</text> <text id=\"level_name_43\">THE TREASURE CITY OF RAMESES</text> <text id=\"level_name_44\">THE WRATH OF SET</text> <text id=\"level_name_45\">THREADING CLEOPATRA'S NEEDLE</text> <text id=\"level_name_46\">URAEUS NEFERTARI</text> <text id=\"level_name_47\">VALLEY OF THE KINGS</text> <text id=\"level_name_48\">WALKING LIKE AN EGYPTIAN</text> <text id=\"level_name_49\">WEIGHING OF THE HEART</text></gamedata>";
var BALL_COUNT = 30;
static var PAN_DAMP = 16;
static var TIME_WARNING_TIME = 480;
var levelTicks = 0;
var lastFpsTime = getTimer();
var fps = 0;
var frames = 0;
var currentTick = 0;
var clicked = false;
var keyPressed = false;
var finalScore = false;
var levelName = "";
var score = 0;
var hasGameData = false;
var wantsBall = false;
var started = false;
var xmlLoaded = false;
var ticksLeft = 7200;
var timeLeft = "5:00";
var coinsGotten = 0;
var signDelay = 0;
var scoreSignDelay = 0;
var showingInstructions = false;
static var MAP_NAMES = ["AnubisAegyptus", "ArmaMegiddo", "BarqueOfTheGoddess", "BastionoftheCatGoddess", "CobraicTwilight", "CrossingtheReedSea", "DanceOfTheCrocodiles", "DenOfTheHyenas", "DieKhufuDie", "EyeofHorus", "FestivalofJubilee", "FlightOfTheSacredIbis", "GrandGallery", "HalloftheApisBull", "HathorsLovingEmbrace", "HorusHawkAscending", "ImhotepsFolly", "InnerSanctumOfTheTemple", "InTheShadowOfThePyramids", "InundationOfTheNile", "InvasionoftheHyksos", "IsisKnot", "KhufusRevenge", "LairOfTheJackalGod", "MarshesOfTheDelta", "MummyDearest", "NarmerPalette", "NavigatingTheCataracts", "NepthysGarden", "OasisOfTheEast", "OasisOfTheWest", "OpeningoftheMouthCeremony", "PathOfTheGoldenGoddess", "PharaohsWarCrown", "PooloftheLotusBlossom", "QueenofDenial", "RasJourneyToTheWest", "ReignoftheHereticKing", "RiddleOfTheSphinx", "RobotFactory", "ScrollofThoth", "ThePillarOfOsiris", "TheStellaeofThutmosis", "TheTreasureCityofRameses", "TheWrathOfSet", "ThreadingCleopatrasNeedle", "UraeusNefertari", "ValleyoftheKings", "WalkingLikeAnEgyptian", "WeighingoftheHeart"];
var currentLevel = -1;
var skipTicks = 0;
var glowing = false;
var mapPointer = 0;
var loadSteps = 0;
var imagesLoaded = false;
var imageProcess = 0;
var domain = "";
var mapNum = 0;
var hasWarningSound = false;
var inputBuffer = "";
var scorePopupCount = 0;
var ballCount = 0;
var gemCount = 0;
var particleCount = 0;
var gotGem = false;
}
Symbol 1718 MovieClip [__Packages.src.Shooter] Frame 0
class src.Shooter extends MovieClip
{
var x, ballRot, aimBeam, _parent, _x, ball, _y;
function Shooter () {
super();
x = new src.timing.IFloat(377);
ballRot = new src.timing.IFloat(0);
aimBeam._visible = false;
}
function tick() {
var _local4 = _parent._xmouse;
var _local3 = x.get(1);
if (_global.roll == true) {
ballRotSpeed = ballRotSpeed + (_local4 - _local3);
ballRotSpeed = ballRotSpeed * 0.8;
ballRot.set(ballRot.get(1) + (ballRotSpeed * 0.1));
}
_local3 = _local3 + ((_local4 - _local3) * 0.7);
x.set(_local3);
}
function render(alpha) {
ball.mc._x = (_x = x.get(alpha));
ball.mc._y = (_y = 536);
ball.mc._rotation = -90;
ball.mc.ball.gotoAndStop((int(ballRot.get(alpha)) & 31) + 1);
}
var ballRotSpeed = 0;
}
Symbol 1719 MovieClip [__Packages.src.timing.IFloat] Frame 0
class src.timing.IFloat
{
var value, lastValue;
function IFloat (initial) {
if (initial == undefined) {
initial = 0;
}
value = initial;
lastValue = initial;
}
function resetTo(initial) {
value = initial;
lastValue = initial;
}
function set(newValue) {
lastValue = value;
value = newValue;
}
function tweak(offs) {
lastValue = lastValue + offs;
value = value + offs;
}
function get(alpha) {
return(lastValue + ((value - lastValue) * alpha));
}
}
Symbol 1720 MovieClip [__Packages.src.Ball] Frame 0
class src.Ball
{
static var ballCounts;
var x, y, color, rollOffset, currentNode, mc, depth, hidden, powerup, xa, ya;
function Ball (color, depth, mc) {
x = 370;
y = 0;
if (ballCounts == undefined) {
ballCounts = new Array(50);
var _local2 = 0;
while (_local2 < 50) {
ballCounts[_local2] = 0;
_local2++;
}
}
ballCounts[color]++;
mc.gotoAndStop(color + 1);
this.color = color;
rollOffset = Math.random() * 32;
currentNode = 0;
this.mc = mc;
this.depth = depth;
hidden = false;
if (((color == COLOR_FIREBALL) || (color == COLOR_LIGHTNING)) || (color == COLOR_WILD)) {
mc.onEnterFrame = powerupAnimate;
} else {
mc.onEnterFrame = undefined;
}
}
function isNear(x, y, radius) {
var _local2 = (this.x - x) / radius;
var _local3 = (this.y - y) / radius;
return(((_local2 * _local2) + (_local3 * _local3)) < 1);
}
function isXNear(x, radius) {
var _local2 = (this.x - x) / radius;
return((_local2 * _local2) < 1);
}
function setColor(newColor) {
ballCounts[color]--;
color = newColor;
ballCounts[color]++;
mc.gotoAndStop(color + 1);
if (((color == COLOR_FIREBALL) || (color == COLOR_LIGHTNING)) || (color == COLOR_WILD)) {
mc.onEnterFrame = powerupAnimate;
} else {
mc.onEnterFrame = undefined;
}
}
function powerupAnimate() {
powerup.gotoAndStop((int((getTimer() * 24) / 1000) % 32) + 1);
}
function remove() {
if (!removed) {
mc.removeMovieClip();
ballCounts[color]--;
removed = true;
}
}
function setPos(x, y) {
mc._x = x;
mc._y = y;
}
function reallySetPos(xp, yp) {
xa = xp - x;
ya = yp - y;
x = xp;
y = yp;
}
static var COLOR_FIREBALL = 10;
static var COLOR_LIGHTNING = 11;
static var COLOR_WILD = 12;
static var COLOR_VISE = 20;
static var COLOR_WIN_VISE = 21;
var removed = false;
}
Symbol 1721 MovieClip [__Packages.src.timing.Timer] Frame 0
class src.timing.Timer
{
var timeable;
function Timer (timeable, gameTicksPerSecond) {
millisPerGameTick = 1000 / gameTicksPerSecond;
this.timeable = timeable;
maxTickTime = 500;
}
function getMillisPerTick() {
return(millisPerGameTick);
}
function setMaxTickTime(millis) {
maxTickTime = millis;
}
function advanceTime() {
var _local3 = getTimer();
if (startTime < 0) {
startTime = _local3;
unprocessedTime = millisPerGameTick;
}
time = _local3 - startTime;
var _local4 = time - lastTime;
lastTime = time;
unprocessedTime = unprocessedTime + _local4;
if (unprocessedTime >= millisPerGameTick) {
var _local2 = maxTickTime + _local3;
do {
timeable.tick(tick);
tick++;
unprocessedTime = unprocessedTime - millisPerGameTick;
} while ((unprocessedTime >= millisPerGameTick) && (getTimer() < _local2));
}
var _local5 = (unprocessedTime % millisPerGameTick) / millisPerGameTick;
timeable.render(tick, _local5);
}
var time = 0;
var startTime = -1;
var lastTime = 0;
var unprocessedTime = 0;
var tick = 0;
var millisPerGameTick = 0;
var maxTickTime = -1;
}
Symbol 1722 MovieClip [__Packages.src.ShootBall] Frame 0
class src.ShootBall
{
var ball, x, y, ix, iy, xa, ya, moveVec, n, c, collidedBall, hitFront;
function ShootBall (ball, x, y, speedMode) {
this.ball = ball;
this.x = x;
this.y = y;
this.speedMode = speedMode;
ix = new src.timing.IFloat(x);
iy = new src.timing.IFloat(y);
xa = 0;
ya = -40;
if (speedMode) {
ya = (ya * 6) / 4;
}
moveVec = new src.Vector();
n = new src.Vector();
c = new src.Vector();
}
function checkCollide(ball) {
var _local12 = ball.x - ball.xa;
var _local11 = ball.y - ball.ya;
var _local6 = ball.xa - xa;
var _local5 = ball.ya - ya;
c.set(_local12 - x, _local11 - y);
moveVec.set(_local6, _local5);
var _local10 = moveVec.dot(c);
if (_local10 >= 0) {
return(false);
}
var _local4 = 32;
var _local9 = ((c.x * c.x) + (c.y * c.y)) - (_local4 * _local4);
moveVec.normalize();
var _local3 = moveVec.dot(c);
var _local8 = (_local3 * _local3) - _local9;
if (_local8 > 0) {
var _local7 = ((-_local3) - Math.sqrt(_local8)) / src.Vector.distance(0, 0, _local6, _local5);
if (_local7 < shortestHitDistance) {
collided = true;
shortestHitDistance = _local7;
collidedBall = ball;
return(true);
}
}
return(false);
}
function collide() {
moveVec.set(xa, ya);
moveVec.scale(shortestHitDistance);
x = x + moveVec.x;
y = y + moveVec.y;
ya = 0;
xa = 0;
var _local4 = collidedBall.x;
var _local3 = collidedBall.y;
c.set(x - _local4, y - _local3);
var _local2 = collidedBall.track.points[collidedBall.currentNode];
n.set(_local2.xd, _local2.yd);
hitFront = c.dot(n) < 0;
ball.xStart = x;
ball.yStart = y;
ball.setPos(x, y);
ball.reallySetPos(x, y);
collided = true;
}
function tick() {
if (collided) {
collided = false;
collide();
}
y = y + ya;
iy.set(y);
step++;
}
function render(alpha) {
ball.mc._rotation = 0;
ball.mc.ball.gotoAndStop((int(iy.get(alpha) / 4) & 31) + 1);
ball.mc._x = ix.get(alpha);
ball.mc._y = iy.get(alpha);
}
var step = 0;
var collided = false;
var shortestHitDistance = 1;
var speedMode = false;
}
Symbol 1723 MovieClip [__Packages.src.Vector] Frame 0
class src.Vector
{
var x, y;
function Vector () {
}
function set(x, y) {
this.x = x;
this.y = y;
}
function scale(s) {
x = x * s;
y = y * s;
}
function getLength() {
return(Math.sqrt((x * x) + (y * y)));
}
function normalize() {
var _local2 = getLength();
x = x / _local2;
y = y / _local2;
}
function dot(v) {
return((x * v.x) + (y * v.y));
}
static function distance(x0, y0, x1, y1) {
var _local1 = x1 - x0;
var _local2 = y1 - y0;
return(Math.sqrt((_local1 * _local1) + (_local2 * _local2)));
}
}
Symbol 1724 MovieClip [__Packages.src.Communicator] Frame 0
class src.Communicator
{
var randomSeed;
function Communicator () {
enabled = true;
}
function enable() {
enabled = true;
}
function disable() {
enabled = false;
}
function gameStarted() {
if (!enabled) {
return(undefined);
}
fscommand ("gameStart");
fscommand ("playData", CMD_VERSION + ",1=0");
}
function gameEnd(score) {
if (!enabled) {
return(undefined);
}
if (!hasSentGameEnd) {
hasSentGameEnd = true;
fscommand ("gameEnd", score);
}
}
function gameQuit() {
if (!enabled) {
return(undefined);
}
if (!hasSentGameOver) {
hasSentGameOver = true;
fscommand ("gameQuit");
}
}
function sendGameEndPressed() {
fscommand ("playData", CMD_END_GAME_PRESSED + "=0");
}
function sendLevelStart(tick) {
if (!enabled) {
return(undefined);
}
fscommand ("playData", ((CMD_LEVEL_START + ",") + tick) + "=0");
}
function sendClick(tick, xShooter) {
if (!enabled) {
return(undefined);
}
fscommand ("playData", ((((CMD_CLICK + ",") + tick) + " ") + xShooter) + "=0");
}
function sendKeyPress(tick) {
if (!enabled) {
return(undefined);
}
fscommand ("playData", ((CMD_KEY_PRESS + ",") + tick) + "=0");
}
function sendLevelComplete(tick, scoreGained) {
if (!enabled) {
return(undefined);
}
fscommand ("playData", (((CMD_LEVEL_COMPLETE + ",") + tick) + "=") + scoreGained);
}
function sendGameLost(tick, scoreGained) {
if (!enabled) {
return(undefined);
}
fscommand ("playData", (((CMD_GAME_LOST + ",") + tick) + "=") + scoreGained);
}
function sendSyncScore(tick, totalScore) {
if (!enabled) {
return(undefined);
}
fscommand ("playData", ((((CMD_SYNC_SCORE + ",") + tick) + " ") + totalScore) + "=0");
}
function sendGetGem(tick, xShooter) {
if (!enabled) {
return(undefined);
}
fscommand ("playData", ((((CMD_GET_GEM + ",") + tick) + " ") + xShooter) + "=0");
}
function sendLog(tick, text) {
if (!enabled) {
return(undefined);
}
fscommand ("playData", ((((CMD_LOG + ",") + tick) + " ") + text) + "=0");
}
function parseGameData(gameData) {
var _local6 = new XML(_root.gameData);
_global.shortGameMode = new String(_local6.childNodes[0].attributes.mode) == "short";
_global.relaxMode = new String(_local6.childNodes[0].attributes.relaxMode) == "true";
_global.textMappings = new Object();
var _local5 = _local6.childNodes[0].childNodes;
randomSeed = new Number(_local6.childNodes[0].attributes.randomseed).valueOf();
var _local4 = 0;
while (_local4 < _local5.length) {
if (_local5[_local4].nodeName == "levels") {
_global.levels = new String(_local5[_local4].firstChild.nodeValue).split(",");
}
if (_local5[_local4].nodeName == "text") {
_global.textMappings[_local5[_local4].attributes.id] = new String(_local5[_local4].firstChild.nodeValue);
}
_local4++;
}
}
var hasSentGameEnd = false;
var hasSentGameOver = false;
var enabled = true;
static var VERSION_NUM = 0;
static var CMD_VERSION = 114;
static var CMD_LEVEL_START = 481;
static var CMD_CLICK = 418;
static var CMD_KEY_PRESS = 148;
static var CMD_LEVEL_COMPLETE = 184;
static var CMD_GAME_LOST = 841;
static var CMD_SYNC_SCORE = 814;
static var CMD_GET_GEM = 888;
static var CMD_LOG = 999;
static var CMD_END_GAME_PRESSED = 666;
}
Symbol 1725 MovieClip [__Packages.src.Level] Frame 0
class src.Level
{
var possibleWeights, random, levelNum, luxor, tracks, powerupRandom, colorCount, colors, colorWeights, totalWeight, colorWeightsOffs;
function Level (luxor, trackDatas, levelNum, random) {
possibleWeights = new Array(10);
var _local2 = 0;
while (_local2 < 10) {
possibleWeights[_local2] = false;
_local2++;
}
this.random = random;
this.levelNum = levelNum;
this.luxor = luxor;
tracks = new Array();
_local2 = 0;
while (_local2 < trackDatas.length) {
var _local3 = new src.Track(luxor, this, trackDatas[_local2]);
_local3.random = new src.util.Random(random.nextInt(2147483647));
tracks.push(_local3);
_local2++;
}
powerupRandom = new src.util.Random(random.nextInt(2147483647));
runOdds = 300 - (levelNum * 50);
if (runOdds < 50) {
runOdds = 50;
}
ballsToClear = 100 + (levelNum * 20);
var _local8 = 3 + int((levelNum + 1) / 2);
if (_local8 > 7) {
_local8 = 7;
}
_local2 = 0;
while (_local2 < 10) {
allowedColors[_local2] = _local2 < _local8;
_local2++;
}
_local2 = 0;
while (_local2 < 7) {
var _local4 = random.nextInt(7 - _local2) + _local2;
var _local5 = allowedColors[_local4];
allowedColors[_local4] = allowedColors[_local2];
allowedColors[_local2] = _local5;
_local2++;
}
colorCount = 0;
colors = new Array(10);
_local2 = 0;
while (_local2 < 10) {
if (allowedColors[_local2]) {
colors[colorCount++] = _local2;
}
_local2++;
}
}
function getColorChain(length, random) {
if (random == undefined) {
random = this.random;
}
var _local5 = new Array(length);
var _local3 = -1;
var _local2 = 0;
while (_local2 < length) {
if ((_local3 == -1) || ((random.nextDouble() * 1000) > runOdds)) {
_local3 = randomColor(random);
}
_local5[_local2] = _local3;
_local2++;
}
return(_local5);
}
function randomColor(random) {
if (random == undefined) {
random = this.random;
}
return(colors[random.nextInt(colorCount)]);
}
function ballsCleared(count) {
clearedBalls = clearedBalls + count;
var _local2 = progress;
progress = clearedBalls / ballsToClear;
if (progress > 1) {
progress = 1;
}
if ((_local2 < 1) && (progress >= 1)) {
src.Sounds.get("sndProgressComplete").playOffsVolPan(0, 100, 0);
}
}
function collapsed(count, segment, offs, isShot) {
if (isShot) {
if (segment.track.chainReaction == 0) {
segment.track.chainReaction = 1;
}
multiMatchCount++;
if (multiMatchCount > maxCombo) {
maxCombo = multiMatchCount;
}
} else {
segment.track.chainReaction++;
if (segment.track.chainReaction > maxChain) {
maxChain = segment.track.chainReaction;
}
}
var _local7 = count - 3;
if (_local7 > 4) {
_local7 = 4;
}
var _local14 = segment.balls[offs + int(count / 2)];
var _local13 = segment.balls[offs + int((count - 1) / 2)];
var _local4 = (_local14.x + _local13.x) / 2;
var _local6 = (_local14.y + _local13.y) / 2;
if ((!isShot) && (segment.track.chainReaction > 0)) {
if ((segment.track.chainReaction % 3) == 0) {
spawnPowerup(_local4, _local6);
}
}
if ((isShot && (multiMatchCount > 0)) && ((multiMatchCount % 3) == 0)) {
spawnPowerup(_local4, _local6);
}
if (DEBUG_POWERUPS) {
spawnPowerup(_local4, _local6);
}
src.Sounds.get("sndCollapse" + _local7).playOffsVolPan(0, 100, (_local4 - 377) / src.Luxor.PAN_DAMP);
var _local15 = _local7 / 4;
if ((count > 4) && (random.nextDouble() < _local15)) {
src.Sounds.get("sndCoinSpawn").playOffsVolPan(0, 100, (_local4 - 377) / src.Luxor.PAN_DAMP);
luxor.newCoin(_local4, _local6);
}
var _local12 = 0;
if (isShot && (multiMatchCount > 2)) {
_local12 = 100 * (multiMatchCount - 2);
}
var _local5 = segment.track.chainReaction;
if (_local5 == 0) {
_local5 = 1;
}
var _local10 = ((count * 100) + _local12) * _local5;
var _local8;
if (((multiMatchCount <= 2) || (!isShot)) || (_local5 == 1)) {
_local8 = "\r" + _local10;
} else {
_local8 = "" + _local10;
}
if ((multiMatchCount > 2) && (isShot)) {
_local8 = _local8 + ((("\r" + _global.textMappings.score_combo) + " X") + multiMatchCount);
}
if (_local5 > 1) {
_local8 = _local8 + ((("\r" + _global.textMappings.score_chain) + " X") + _local5);
}
luxor.newScorePopup(_local4, _local6, 16777215, _local8);
luxor.gainScore(_local10);
}
function spawnPowerup(x, y) {
src.Sounds.get("sndPowerupSpawn").playOffsVolPan(0, 100, x / 8);
var _local2 = powerupRandom.nextInt(8);
if (DEBUG_POWERUPS) {
_local2 = src.Gem.BONUS_LIGHTNING - 26;
}
if (_local2 == 0) {
updateColorWeights();
luxor.newGem(x, y, 20 + nextColor());
} else {
luxor.newGem(x, y, 26 + _local2);
}
}
function pickupColorBomb(color) {
var _local2 = 0;
while (_local2 < tracks.length) {
if (tracks[_local2].firstSegment != undefined) {
tracks[_local2].firstSegment.colorBomb(color);
}
_local2++;
}
}
function pickupReverse() {
reverseTime = MAX_REVERSE_TIME;
}
function pickupSlow() {
slowTime = MAX_SLOW_TIME;
}
function pickupStop() {
stopTime = MAX_STOP_TIME;
}
function pickupSpeedShot() {
speedShotTime = MAX_SPEED_SHOT_TIME;
luxor.shooter.aimBeam._visible = true;
}
function pickupFireball() {
currentBallColor = src.Ball.COLOR_FIREBALL;
}
function pickupLightning() {
currentBallColor = src.Ball.COLOR_LIGHTNING;
}
function pickupWild() {
currentBallColor = src.Ball.COLOR_WILD;
}
function nextBall() {
currentBallColor = nextBallColor;
nextBallColor = nextColor();
}
function swapBalls() {
var _local2 = nextBallColor;
nextBallColor = currentBallColor;
currentBallColor = _local2;
}
function refreshBalls() {
if (currentBallColor < 10) {
currentBallColor = -1;
}
if (nextBallColor < 10) {
nextBallColor = -1;
}
checkColors();
}
function updateColorWeights() {
var _local6 = false;
var _local2 = 0;
while (_local2 < tracks.length) {
if (tracks[_local2].firstSegment != undefined) {
_local6 = true;
}
_local2++;
}
if (!_local6) {
return(undefined);
}
colorWeights = new Array(10);
_local2 = 0;
while (_local2 < 10) {
colorWeights[_local2] = 0;
_local2++;
}
var _local4 = false;
var _local3 = 100000 /* 0x0186A0 */;
var _local5 = 0;
_local2 = 0;
while (_local2 < tracks.length) {
if ((tracks[_local2].firstSegment != undefined) && (tracks[_local2].firstSegment.isWarning())) {
if (tracks[_local2].firstSegment.pos < _local3) {
_local3 = tracks[_local2].firstSegment.pos;
_local5 = _local2;
_local4 = true;
}
}
_local2++;
}
_local2 = 0;
while (_local2 < tracks.length) {
if (tracks[_local2].firstSegment != undefined) {
tracks[_local2].firstSegment.getWeights(colorWeights);
}
_local2++;
}
_local2 = 0;
while (_local2 < 10) {
possibleWeights[_local2] = colorWeights[_local2] > 0;
_local2++;
}
if (_local4) {
_local2 = 0;
while (_local2 < 10) {
colorWeights[_local2] = 0;
_local2++;
}
tracks[_local5].firstSegment.getWarningWeights(colorWeights);
}
totalWeight = 0;
colorWeightsOffs = new Array(10);
_local2 = 0;
while (_local2 < 10) {
colorWeightsOffs[_local2] = totalWeight;
totalWeight = totalWeight + colorWeights[_local2];
_local2++;
}
}
function checkColors() {
updateColorWeights();
currentBallColor = checkColor(currentBallColor);
nextBallColor = checkColor(nextBallColor);
}
function checkColor(col) {
if (col >= 10) {
return(col);
}
if ((col >= 0) && (possibleWeights[col])) {
return(col);
}
return(nextColor());
}
function nextColor() {
var _local4 = ((totalWeight > 0) ? (random.nextInt(totalWeight)) : 0);
var _local3 = 0;
var _local2 = 0;
while (_local2 < 10) {
if (colorWeightsOffs[_local2] <= _local4) {
_local3 = _local2;
}
_local2++;
}
return(_local3);
}
function lose() {
lost = true;
currentBallColor = -1;
nextBallColor = -1;
}
function hasWarning() {
var _local2 = 0;
while (_local2 < tracks.length) {
if ((tracks[_local2].firstSegment != undefined) && (tracks[_local2].firstSegment.isWarning())) {
return(true);
}
_local2++;
}
return(false);
}
function tick() {
updateColorWeights();
var _local5 = true;
var _local3 = 0;
while (_local3 < tracks.length) {
var _local2 = tracks[_local3];
if (!((_local2.firstSegment == undefined) && (progress == 1))) {
_local5 = false;
}
_local3++;
}
if (won) {
_local3 = 0;
while (_local3 < tracks.length) {
tracks[_local3].winTick();
_local3++;
}
}
if (_local5 && (!won)) {
won = true;
currentBallColor = -1;
nextBallColor = -1;
src.Sounds.get("sndBonusScarabMove").playLooping();
_local3 = 0;
while (_local3 < tracks.length) {
tracks[_local3].startProgress(luxor.newBall(src.Ball.COLOR_WIN_VISE));
_local3++;
}
}
if (won) {
if (winAnimationsDone()) {
src.Sounds.get("sndBonusScarabMove").stop();
}
}
_local3 = 0;
while (_local3 < tracks.length) {
var _local2 = tracks[_local3];
if ((!lost) && (progress < 1)) {
if (_local2.firstSegment == undefined) {
luxor.newTrain(_local2);
refreshBalls();
} else {
var _local4 = luxor.getLastSegment(_local2);
if ((_local4.pos + (_local4.length * 32)) < (_local2.length / 2)) {
luxor.newTrain(_local2);
}
}
}
_local2.hasPossibleChain = false;
_local2.firstSegment.preTick();
_local2.firstSegment.tick();
if (!_local2.hasPossibleChain) {
_local2.chainReaction = 0;
}
if (_local2.firstSegment.pos < 0) {
lose();
}
_local3++;
}
if ((!lost) && (!won)) {
checkColors();
}
if (reverseTime > 0) {
reverseTime--;
}
if (slowTime > 0) {
slowTime--;
}
if (stopTime > 0) {
stopTime--;
}
if (speedShotTime > 0) {
speedShotTime--;
if (speedShotTime == 0) {
luxor.shooter.aimBeam._visible = false;
}
}
}
function tickWarning(timeWarningFactor) {
var _local2 = 0;
while (_local2 < tracks.length) {
var _local3 = 1000;
if (tracks[_local2].firstSegment != undefined) {
_local3 = tracks[_local2].firstSegment.getWarningFactor();
}
tracks[_local2].warningLight.tick(timeWarningFactor, _local3);
_local2++;
}
}
function winAnimationsDone() {
var _local2 = 0;
while (_local2 < tracks.length) {
if (!tracks[_local2].winAnimationsDone()) {
return(false);
}
_local2++;
}
return(true);
}
function render(alpha) {
var _local2 = 0;
while (_local2 < tracks.length) {
var _local3 = tracks[_local2];
_local3.firstSegment.render(alpha);
_local3.warningLight.render(alpha);
_local2++;
}
if (won) {
_local2 = 0;
while (_local2 < tracks.length) {
tracks[_local2].winRender(alpha);
_local2++;
}
}
}
var DEBUG_POWERUPS = false;
static var MAX_REVERSE_TIME = 96;
static var MAX_SLOW_TIME = 96;
static var MAX_STOP_TIME = 96;
static var MAX_SPEED_SHOT_TIME = 360;
var allowedColors = [true, true, true, true, false, false, false, false, false, false];
var multiMatchCount = 0;
var reverseTime = 0;
var slowTime = 0;
var stopTime = 0;
var speedShotTime = 0;
var currentBallColor = -1;
var nextBallColor = -1;
var lost = false;
var won = false;
var progress = 0;
var clearedBalls = 0;
var ballsToClear = 100;
var runOdds = 225;
var shotsFired = 0;
var coinsGotten = 0;
var gemsGotten = 0;
var maxCombo = 0;
var maxChain = 0;
var segments = 0;
var startScore = 0;
var insertStackDepth = 0;
}
Symbol 1726 MovieClip [__Packages.src.util.Random] Frame 0
class src.util.Random
{
var mta, mti, lastSeed;
function Random (aSeed) {
mta = new Array(N);
mti = N + 1;
if (aSeed != undefined) {
init_genrand(aSeed);
}
}
function set seed(s) {
init_genrand(s);
//return(seed);
}
function get seed() {
return(lastSeed);
}
function nextInt(n) {
return((genrand_int32() & 2147483647) % n);
}
function nextFloat() {
return(next(24) / 16777216);
}
function nextDouble() {
return(next(24) / 16777216);
}
function next(bits) {
if (bits < 32) {
return(genrand_int32() & ((1 << bits) - 1));
}
return(genrand_int32());
}
function init_genrand(s) {
s = int(s);
trace("Random::init_genrand(): seed=" + s);
var _local6 = getTimer();
lastSeed = s;
mta[0] = s;
var _local2 = s;
var _local3 = new src.util.Integer64();
var _local4 = N;
mti = 1;
while (mti < _local4) {
_local3.init32((_local2 >>> 30) ^ _local2);
_local3.mulu32(1812433253);
_local2 = (mta[mti] = int(_local3.lsb + mti));
mti++;
}
var _local7 = getTimer();
trace(("Random::init_genrand(): initialization ~" + (_local7 - _local6)) + "ms");
}
function genrand_int32() {
var _local9 = N;
var _local3 = 0;
if (mti >= _local9) {
if (mti == (_local9 + 1)) {
init_genrand(5489);
}
var _local8 = M;
var _local6 = UPPER_MASK;
var _local4 = LOWER_MASK;
var _local5 = mag01;
var _local11 = getTimer();
var _local2 = 0;
var _local7 = _local9 - _local8;
var _local10 = _local8 - _local9;
_local2 = 0;
while (_local2 < _local7) {
_local3 = (mta[_local2] & _local6) | (mta[_local2 + 1] & _local4);
mta[_local2] = (mta[_local2 + _local8] ^ (_local3 >>> 1)) ^ _local5[_local3 & 1];
_local2++;
}
_local7 = _local9 - 1;
while (_local2 < _local7) {
_local3 = (mta[_local2] & _local6) | (mta[_local2 + 1] & _local4);
mta[_local2] = (mta[_local2 + _local10] ^ (_local3 >>> 1)) ^ _local5[_local3 & 1];
_local2++;
}
_local3 = (mta[_local9 - 1] & _local6) | (mta[0] & _local4);
mta[_local9 - 1] = (mta[_local8 - 1] ^ (_local3 >>> 1)) ^ _local5[_local3 & 1];
mti = 0;
var _local12 = getTimer();
trace(((("Random::genrand_int32(): precalc " + _local9) + " new numbers ~") + (_local12 - _local11)) + "ms");
}
_local3 = mta[mti++];
_local3 = _local3 ^ (_local3 >>> 11);
_local3 = _local3 ^ ((_local3 << 7) & 2636928640);
_local3 = _local3 ^ ((_local3 << 15) & 4022730752);
_local3 = _local3 ^ (_local3 >>> 18);
return(_local3);
}
static var N = 624;
static var M = 397;
static var MATRIX_A = 2567483615;
static var UPPER_MASK = 2147483648;
static var LOWER_MASK = 2147483647;
static var mag01 = [0, 2567483615];
}
Symbol 1727 MovieClip [__Packages.src.util.Integer64] Frame 0
class src.util.Integer64
{
var r, p, s;
function Integer64 (lowInt) {
r = [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]];
p = [0, 0, 0, 0, 0];
s = [0, 0, 0];
if (lowInt != undefined) {
merge(lowInt);
}
}
function init(v) {
var _local2 = 0;
while (_local2 < p.length) {
p[_local2] = v.p[_local2];
_local2++;
}
}
function init32(n) {
p[0] = n & 32767;
n = n >>> 15;
p[1] = n & 32767;
n = n >>> 15;
p[2] = n & 3;
p[3] = 0;
p[4] = 0;
}
function get lsb() {
return((p[0] | (p[1] << SH)) | ((p[2] & 3) << 30));
}
function get msb() {
return((((p[2] >> 2) | ((p[3] << SH) >> 2)) | ((p[4] << (SH * 2)) >> 2)) & 2147483647);
}
function binaryShiftLeft(step) {
var _local2 = 0;
while (_local2 < step) {
shl();
_local2++;
}
}
function binaryShiftRight(step) {
var _local4 = (step / SH) >> 0;
var _local5 = step - (_local4 * SH);
var _local2 = p.length - 1;
while (_local2 > 0) {
var _local3 = 0;
while (_local3 < _local4) {
p[_local3] = p[_local3 + 1];
_local3++;
}
p[_local2--] = 0;
}
if (_local5 > 0) {
var _local3 = 0;
while (_local3 < _local5) {
shr();
_local3++;
}
}
}
function binaryNot(o) {
p[0] = p[0] ^ o.p[0];
p[1] = p[1] ^ o.p[1];
p[2] = p[2] ^ o.p[2];
p[3] = p[3] ^ o.p[3];
p[4] = p[4] ^ o.p[4];
}
function add64(o) {
var _local4 = 0;
var _local3 = 1;
var _local2 = 0;
while ((_local3 < p.length) && (o.p[_local2] != 0)) {
_local3++;
}
_local2 = 0;
while (_local2 < _local3) {
_local4 = _local4 + (p[_local2] + o.p[_local2]);
p[_local2] = _local4 & MASK;
_local4 = _local4 >> SH;
_local2++;
}
}
function add32(num) {
var _local2 = 0;
var _local5 = num & MASK;
num = num >> SH;
var _local6 = num & MASK;
num = num >> SH;
var _local4 = num & 3;
_local2 = _local2 + (p[0] + _local5);
p[0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (p[1] + _local6);
p[1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (p[2] + _local4);
p[2] = _local2 & MASK;
}
function mulu32(num) {
var _local3 = 0;
s[0] = num & MASK;
num = num >>> 15;
s[1] = num & MASK;
num = num >>> 15;
s[2] = num & 3;
var _local2 = 0;
while (_local2 < 3) {
var _local4 = s[_local2];
_local3 = _local4 * p[0];
r[_local2][0] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (_local4 * p[1]);
r[_local2][1] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (_local4 * p[2]);
r[_local2][2] = _local3 & 3;
_local2++;
}
_local3 = r[0][0];
p[0] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (r[0][1] + r[1][0]);
p[1] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + ((r[0][2] + r[1][1]) + r[2][0]);
p[2] = _local3 & 3;
p[3] = 0;
p[4] = 0;
}
function mul64(o) {
var _local2 = 0;
var _local3 = 0;
while (_local3 < 5) {
var _local4 = o.p[_local3];
_local2 = _local4 * p[0];
r[_local3][0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[1]);
r[_local3][1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[2]);
r[_local3][2] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[3]);
r[_local3][3] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[4]);
r[_local3][4] = _local2 & MASK;
_local3++;
}
_local2 = r[0][0];
p[0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (r[0][1] + r[1][0]);
p[1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + ((r[0][2] + r[1][1]) + r[2][0]);
p[2] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (((r[0][3] + r[1][2]) + r[2][1]) + r[3][0]);
p[3] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + ((((r[0][4] + r[1][3]) + r[2][2]) + r[3][1]) + r[4][0]);
p[4] = _local2 & 7;
}
function mul32(value) {
mul64(new src.util.Integer64(value));
}
function merge(a) {
var _local2 = 0;
while (_local2 < 3) {
p[_local2] = p[_local2] + (a & 32767);
a = a >>> 15;
_local2++;
}
return(a);
}
function shl() {
var _local5 = 0;
var _local4 = 0;
var _local2 = 0;
var _local3 = p.length;
while (_local2 < _local3) {
_local5 = (p[_local2] & 16384) >> 14;
p[_local2] = p[_local2] << 1;
p[_local2] = (p[_local2] | _local4) & 32767;
_local2++;
_local4 = _local5;
}
}
function shr() {
var _local4 = 0;
var _local3 = 0;
var _local2 = p.length - 1;
while (_local2 >= 0) {
_local4 = (p[_local2] & 1) << 14;
p[_local2] = p[_local2] >> 1;
p[_local2] = (p[_local2] | _local3) & 32767;
_local2--;
_local3 = _local4;
}
}
static var MASK = 32767;
static var SH = 15;
}
Symbol 1728 MovieClip [__Packages.src.AbstractTrack] Frame 0
class src.AbstractTrack
{
var points, length;
function AbstractTrack () {
}
function setPoints(points) {
this.points = points;
var _local6 = 0;
var _local2 = 0;
while (_local2 < points.length) {
var _local4 = 0;
var _local5 = 0;
if (_local2 < (points.length - 1)) {
_local4 = points[_local2 + 1].x - points[_local2].x;
_local5 = points[_local2 + 1].y - points[_local2].y;
}
var _local7 = Math.atan2(_local5, _local4);
points[_local2].xd = _local4;
points[_local2].yd = _local5;
points[_local2].dir = ((_local7 * 180) / Math.PI) - 90;
points[_local2].start = _local6;
points[_local2].len = Math.sqrt((_local4 * _local4) + (_local5 * _local5));
points[_local2].end = _local6 + points[_local2].len;
_local6 = points[_local2].end;
_local2++;
}
length = points[points.length - 1].start;
}
function position(ball, t, set) {
if (set == undefined) {
set = false;
}
if (set) {
ball.track = this;
}
if ((t < 0) || (t > length)) {
if (t < 0) {
if (set) {
ball.reallySetPos(points[0].x, points[0].y);
} else {
ball.setPos(points[0].x, points[0].y);
}
} else if (set) {
ball.reallySetPos(points[points.length - 1].x, points[points.length - 1].y);
} else {
ball.setPos(points[points.length - 1].x, points[points.length - 1].y);
}
ball.mc._visible = false;
return(undefined);
}
ball.mc._visible = true;
var _local3 = ball.currentNode;
while (points[_local3].end < t) {
if (set) {
ball.currentNode++;
}
_local3++;
}
while (points[_local3].start > t) {
if (set) {
ball.currentNode--;
}
_local3--;
}
var _local6 = points[_local3];
if (points[(points.length - _local3) - 3].hidden) {
if (!ball.hidden) {
ball.mc.swapDepths(ball.depth + 1);
ball.hidden = true;
}
} else if (ball.hidden) {
ball.mc.swapDepths(ball.depth + 5001);
ball.hidden = false;
}
var _local7 = (t - _local6.start) / _local6.len;
if (set) {
ball.reallySetPos(_local6.x + (_local6.xd * _local7), _local6.y + (_local6.yd * _local7));
} else {
ball.setPos(_local6.x + (_local6.xd * _local7), _local6.y + (_local6.yd * _local7));
ball.mc.ball.gotoAndStop((int(((t * 2) / Math.PI) + ball.rollOffset) % 32) + 1);
ball.mc._rotation = _local6.dir;
}
}
}
Symbol 1729 MovieClip [__Packages.src.Track] Frame 0
class src.Track extends src.AbstractTrack
{
var luxor, level, points, setPoints, warningLight, length, winBall, winTime, lastTrackPos;
function Track (luxor, level, trackData) {
super();
this.luxor = luxor;
this.level = level;
points = new Array();
var _local3 = 0;
while (_local3 < trackData.length) {
var _local9 = trackData.charAt(_local3++);
var _local7 = trackData.charAt(_local3++);
var _local8 = trackData.charAt(_local3++);
var _local6 = trackData.charAt(_local3++);
var _local10 = trackData.charAt(_local3++);
var _local5 = new Object();
_local5.x = ((BASE_64_CHARS.indexOf(_local7) * 64) + BASE_64_CHARS.indexOf(_local9)) - 2000;
_local5.y = -(((BASE_64_CHARS.indexOf(_local6) * 64) + BASE_64_CHARS.indexOf(_local8)) - 2000);
_local5.hidden = BASE_64_CHARS.indexOf(_local10) == 1;
points.push(_local5);
}
points.push(points[points.length - 1]);
setPoints(points);
}
function setWarningLight(wl) {
warningLight = wl;
wl._x = points[0].x;
wl._y = points[0].y;
}
function position(ball, t, set) {
if (set == undefined) {
set = false;
}
if (set) {
ball.track = this;
}
if ((t < 0) || (t > length)) {
if (t < 0) {
if (set) {
ball.reallySetPos(points[0].x, points[0].y);
} else {
ball.setPos(points[0].x, points[0].y);
}
} else if (set) {
ball.reallySetPos(points[points.length - 1].x, points[points.length - 1].y);
} else {
ball.setPos(points[points.length - 1].x, points[points.length - 1].y);
}
ball.mc._visible = false;
return(undefined);
}
ball.mc._visible = true;
var _local3 = ball.currentNode;
while (points[_local3].end < t) {
if (set) {
ball.currentNode++;
}
_local3++;
}
while (points[_local3].start > t) {
if (set) {
ball.currentNode--;
}
_local3--;
}
var _local6 = points[_local3];
if (points[(points.length - _local3) - 3].hidden) {
if (!ball.hidden) {
ball.mc.swapDepths(ball.depth + 1);
ball.hidden = true;
}
} else if (ball.hidden) {
ball.mc.swapDepths(ball.depth + 5001);
ball.hidden = false;
}
var _local7 = (t - _local6.start) / _local6.len;
if (set) {
ball.reallySetPos(_local6.x + (_local6.xd * _local7), _local6.y + (_local6.yd * _local7));
} else {
ball.setPos(_local6.x + (_local6.xd * _local7), _local6.y + (_local6.yd * _local7));
ball.mc.ball.gotoAndStop((int(((t * 2) / Math.PI) + ball.rollOffset) % 32) + 1);
ball.mc._rotation = _local6.dir;
}
}
function startProgress(ball) {
winBall = ball;
winTime = 0;
}
function winTick() {
if (winTime < (lastTrackPos / winAnimationSpeed)) {
position(winBall, winTime * winAnimationSpeed);
position(winBall, winTime * winAnimationSpeed, true);
luxor.newParticle(winBall.x, winBall.y, 1);
luxor.newParticle(winBall.x, winBall.y, 1);
luxor.newParticle(winBall.x, winBall.y, 1);
winTime++;
if (winTime > (lastTrackPos / winAnimationSpeed)) {
var _local2 = lastTrackPos / length;
if (_local2 > 1) {
_local2 = 1;
}
if (_local2 < 0) {
_local2 = 0;
}
var _local3 = int((10000 * _local2) / 10) * 10;
winTime = lastTrackPos / winAnimationSpeed;
position(winBall, winTime * winAnimationSpeed);
position(winBall, winTime * winAnimationSpeed, true);
luxor.newParticle(winBall.x, winBall.y, 0);
winBall.remove();
src.Sounds.get("sndBonusScarabCollapse").playOffsVolPan(0, 100, (winBall.x - 377) / src.Luxor.PAN_DAMP);
luxor.newScorePopup(winBall.x, winBall.y, 16777215, "" + _local3);
luxor.gainScore(_local3);
}
} else {
winTime++;
}
}
function winAnimationsDone() {
return(winTime > ((lastTrackPos / winAnimationSpeed) + 24));
}
function winRender(alpha) {
position(winBall, (winTime + alpha) * winAnimationSpeed);
}
static var BASE_64_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#!";
var chainReaction = 0;
var hasPossibleChain = false;
var winAnimationSpeed = 32;
}
Symbol 1730 MovieClip [__Packages.src.TrainSegment] Frame 0
class src.TrainSegment
{
var pos, iPos, track, balls, length, firstBall, lastBall, insertingBall, nextSegment, lastSegment, hasSplit, lastTime, lastTimeOffs;
function TrainSegment (track, balls) {
pos = track.length;
iPos = new src.timing.IFloat(pos);
this.track = track;
this.balls = balls;
recalc();
speed = 0;
}
function recalc() {
length = balls.length;
firstBall = balls[balls.length - 1];
lastBall = balls[0];
}
function removeSegment() {
if (insertingBall != undefined) {
ballInserted();
}
track.level.ballsCleared(balls.length);
var _local2 = 0;
while (_local2 < balls.length) {
balls[_local2].remove();
if (!balls[_local2].hidden) {
track.luxor.newParticle(balls[_local2].x, balls[_local2].y, 0);
}
_local2++;
}
if (nextSegment != undefined) {
nextSegment.lastSegment = lastSegment;
}
if (lastSegment != undefined) {
lastSegment.nextSegment = nextSegment;
} else {
track.firstSegment = nextSegment;
}
}
function insertBallBeside(ball, targetBall, offs) {
var _local2 = 0;
while (_local2 < balls.length) {
if (balls[_local2] == targetBall) {
src.Sounds.get("sndBallCollide").playOffsVolPan(0, 100, (targetBall.x - 377) / src.Luxor.PAN_DAMP);
insertBall(ball, _local2 + offs);
return(undefined);
}
_local2++;
}
if (nextSegment != undefined) {
nextSegment.insertBallBeside(ball, targetBall, offs);
}
}
function insertBall(ball, insertPos) {
insertTime = 4;
insertingBall = ball;
balls.splice(insertPos, 0, ball);
pos = pos - 32;
iPos.tweak(-32);
recalc();
}
function indexOf(ball) {
var _local2 = 0;
while (_local2 < balls.length) {
if (balls[_local2] == ball) {
return(_local2);
}
_local2++;
}
return(-1);
}
function join() {
if (firstBall.color == src.Ball.COLOR_VISE) {
if (length == 1) {
removeSegment();
} else {
split(length - 1);
nextSegment.removeSegment();
}
src.Sounds.get("sndCollapseScarab").playOffsVolPan(0, 100, (firstBall.x - 377) / src.Luxor.PAN_DAMP);
return(undefined);
}
var _local3 = firstBall.color == nextSegment.lastBall.color;
if (firstBall.color == src.Ball.COLOR_WILD) {
_local3 = true;
}
if (nextSegment.lastBall.color == src.Ball.COLOR_WILD) {
_local3 = true;
}
var _local6 = (speed + nextSegment.speed) / 2;
var _local5 = length;
var _local2 = 0;
while (_local2 < nextSegment.balls.length) {
balls.push(nextSegment.balls[_local2]);
_local2++;
}
if (nextSegment.insertingBall != undefined) {
insertingBall = nextSegment.insertingBall;
insertTime = nextSegment.insertTime;
var _local4 = insertTime * 8;
pos = pos - _local4;
iPos.tweak(-_local4);
}
nextSegment = nextSegment.nextSegment;
if (nextSegment != undefined) {
nextSegment.lastSegment = this;
}
speed = _local6;
recalc();
if (_local3) {
findAndPopColor(_local5, false);
}
}
function split(splitPos) {
hasSplit = true;
if (splitPos == 0) {
return(undefined);
}
if (splitPos >= length) {
return(undefined);
}
var _local2 = nextSegment;
var _local6 = balls.slice(0, splitPos);
var _local5 = balls.slice(splitPos, length);
balls = _local6;
nextSegment = new src.TrainSegment(track, _local5);
nextSegment.lastSegment = this;
nextSegment.nextSegment = _local2;
if (insertingBall != undefined) {
var _local4 = indexOf(insertingBall);
if (_local4 == -1) {
nextSegment.insertTime = insertTime;
nextSegment.insertingBall = insertingBall;
insertTime = 0;
insertingBall = undefined;
}
}
if (_local2 != undefined) {
_local2.lastSegment = nextSegment;
}
nextSegment.recalc();
recalc();
nextSegment.pos = pos + (length * 32);
nextSegment.iPos.resetTo(nextSegment.pos);
nextSegment.speed = speed;
}
function findAndPopColor(pos, fromShot) {
track.level.insertStackDepth++;
var _local8 = 0;
var _local5 = balls[pos].color;
var _local3 = pos;
var _local6 = 0;
var _local2 = true;
while (_local2) {
if (_local3 <= 0) {
_local2 = false;
} else if (balls[_local3 - 1].color == src.Ball.COLOR_VISE) {
_local2 = false;
} else if (_local5 == src.Ball.COLOR_WILD) {
_local2 = true;
} else if (balls[_local3 - 1].color == src.Ball.COLOR_WILD) {
_local2 = true;
} else if (balls[_local3 - 1].color == _local5) {
_local2 = true;
} else {
_local2 = false;
}
if (_local2) {
_local5 = balls[_local3 - 1].color;
_local3--;
}
}
_local2 = true;
var _local4 = _local3;
while (_local2) {
if (_local4 >= (balls.length - 1)) {
_local2 = false;
} else if (balls[_local4 + 1].color == src.Ball.COLOR_VISE) {
_local2 = false;
} else if (_local5 == src.Ball.COLOR_WILD) {
_local2 = true;
} else if (balls[_local4 + 1].color == src.Ball.COLOR_WILD) {
_local2 = true;
} else if (balls[_local4 + 1].color == _local5) {
_local2 = true;
} else {
_local2 = false;
}
if (_local2) {
_local5 = balls[_local4 + 1].color;
_local4++;
}
}
_local6 = (_local4 - _local3) + 1;
if (_local6 >= 3) {
if (track.level.insertStackDepth == 1) {
track.level.collapsed(_local6, this, _local3, fromShot);
}
var _local7 = ((firstBall.color == src.Ball.COLOR_VISE) ? 8 : 0);
if ((_local3 + _local6) < balls.length) {
split(_local3 + _local6);
nextSegment.speed = nextSegment.speed + _local7;
}
if (_local3 > 0) {
split(_local3);
nextSegment.removeSegment();
speed = speed - _local7;
} else {
removeSegment();
}
} else if (fromShot) {
track.level.multiMatchCount = 0;
}
track.level.insertStackDepth--;
}
function ballInserted() {
var _local2 = indexOf(insertingBall);
if (_local2 == -1) {
}
insertingBall = undefined;
insertTime = 0;
findAndPopColor(_local2, true);
track.luxor.ballInserted();
}
function popVise() {
track.luxor.newGem(firstBall.x, firstBall.y);
src.Sounds.get("sndGemSpawn").playOffsVolPan(0, 100, (firstBall.x - 377) / src.Luxor.PAN_DAMP);
removeSegment();
}
function isWarning() {
return(pos < 800);
}
function getWarningFactor() {
return(pos / 800);
}
function getWeights(weights) {
var _local2 = 0;
while (_local2 < balls.length) {
weights[balls[_local2].color] = 10;
_local2++;
}
if (nextSegment != undefined) {
nextSegment.getWeights(weights);
}
}
function getWarningWeights(weights) {
var _local5 = 0;
var _local2 = this;
var _local3 = 0;
var _local4 = 10;
for ( ; _local4 > 0 ; ) {
if (_local3 == _local2.balls.length) {
if (_local2.nextSegment != undefined) {
_local2 = _local2.nextSegment;
_local3 = 0;
continue;
}
if (_local5 == 0) {
getWeights(weights);
}
return(undefined);
}
if (_local2.balls[_local3].color == src.Ball.COLOR_VISE) {
if (_local5 == 0) {
getWeights(weights);
}
return(undefined);
}
weights[_local2.balls[_local3].color] = weights[_local2.balls[_local3].color] + _local4;
_local5 = _local5 + _local4;
_local4--;
_local3++;
}
}
function collideCheck(shootBall) {
var _local3 = false;
var _local2 = 0;
while (_local2 < balls.length) {
if (!balls[_local2].hidden) {
_local3 = _local3 | shootBall.checkCollide(balls[_local2]);
}
_local2++;
}
if (nextSegment != undefined) {
_local3 = _local3 | nextSegment.collideCheck(shootBall);
}
return(_local3);
}
function lightning(x, radius) {
var _local5 = balls[0].isXNear(x, radius) && (balls[0].color != src.Ball.COLOR_VISE);
var _local4 = _local5;
var _local2 = 0;
while (_local2 < balls.length) {
var _local3 = balls[_local2].isXNear(x, radius) && (balls[_local2].color != src.Ball.COLOR_VISE);
if (_local3 ^ _local5) {
split(_local2);
break;
}
if (!_local3) {
_local4 = false;
}
_local2++;
}
if (_local4) {
removeSegment();
}
if (nextSegment != undefined) {
nextSegment.lightning(x, radius);
}
}
function fireBall(x, y, radius) {
var _local5 = balls[0].isNear(x, y, radius) && (balls[0].color != src.Ball.COLOR_VISE);
var _local4 = _local5;
var _local2 = 0;
while (_local2 < balls.length) {
var _local3 = balls[_local2].isNear(x, y, radius) && (balls[_local2].color != src.Ball.COLOR_VISE);
if (_local3 ^ _local5) {
split(_local2);
break;
}
if (!_local3) {
_local4 = false;
}
_local2++;
}
if (_local4) {
removeSegment();
}
if (nextSegment != undefined) {
nextSegment.fireBall(x, y, radius);
}
}
function colorBomb(color) {
var _local4 = balls[0].color;
var _local5 = _local4 == color;
var _local2 = 0;
while (_local2 < balls.length) {
if ((balls[_local2].color == color) ^ (_local4 == color)) {
split(_local2);
break;
}
if (balls[_local2].color != color) {
_local5 = false;
}
_local2++;
}
if (_local5) {
removeSegment();
}
if (nextSegment != undefined) {
nextSegment.colorBomb(color);
}
}
function positionBalls(set) {
if (set == undefined) {
set = false;
}
var _local8 = pos;
var _local5 = 0;
if (insertTime > 0) {
_local5 = insertTime * 8;
}
var _local2 = 0;
while (_local2 < balls.length) {
var _local3 = _local8 + (_local2 * 32);
var _local4 = _local5;
if (balls[_local2] == insertingBall) {
_local5 = 0;
}
_local3 = _local3 + _local5;
track.position(balls[_local2], _local3, set);
if (balls[_local2] == insertingBall) {
var _local7 = balls[_local2].xStart + ((balls[_local2].x - balls[_local2].xStart) * (1 - (_local4 / 32)));
var _local6 = balls[_local2].yStart + ((balls[_local2].y - balls[_local2].yStart) * (1 - (_local4 / 32)));
balls[_local2].setPos(_local7, _local6);
}
_local2++;
}
}
function preTick() {
if (nextSegment != undefined) {
if ((firstBall.color == src.Ball.COLOR_VISE) && (nextSegment.lastBall.color == src.Ball.COLOR_VISE)) {
nextSegment.popVise();
}
var _local2 = 0;
if (nextSegment.insertTime > 0) {
_local2 = nextSegment.insertTime * 8;
}
if ((pos + (length * 32)) > (nextSegment.pos + _local2)) {
src.Sounds.get("sndTrainCollide").playOffsVolPan(0, 100, (lastBall.x - 377) / src.Luxor.PAN_DAMP);
join();
}
nextSegment.preTick();
}
}
function tick() {
hasSplit = false;
if (track.level.lost) {
speed = speed - 2;
speed = speed * 0.94;
pos = pos + speed;
} else {
var _local3 = track.level.slowTime != 0;
if (track.level.reverseTime == 0) {
if ((firstBall.color == src.Ball.COLOR_VISE) && (track.level.stopTime == 0)) {
var _local2 = (pos + 500) / track.length;
_local2 = (_local2 + (_local2 * _local2)) / 2;
var _local4 = (_local2 * (track.level.levelNum + 10)) / 10;
speed = speed - _local4;
if (pos > (track.length - 300)) {
speed = speed - 5;
}
}
} else if ((((lastSegment == undefined) || (lastSegment.firstBall.color == src.Ball.COLOR_VISE)) || (lastSegment.firstBall.color == src.Ball.COLOR_WILD)) || (lastBall.color == src.Ball.COLOR_WILD)) {
speed = speed + 1;
}
speed = speed * 0.8;
if ((((nextSegment.lastBall.color == firstBall.color) || (nextSegment.lastBall.color == src.Ball.COLOR_VISE)) || (firstBall.color == src.Ball.COLOR_WILD)) || (nextSegment.lastBall.color == src.Ball.COLOR_WILD)) {
_local3 = false;
}
if (!_local3) {
pos = pos + speed;
} else {
pos = pos + (speed * 0.25);
}
}
if (insertTime > 0) {
insertTime--;
if (insertTime == 0) {
ballInserted();
}
}
if ((lastSegment == undefined) && (lastBall.color == src.Ball.COLOR_VISE)) {
popVise();
}
if (nextSegment != undefined) {
if ((((nextSegment.lastBall.color == firstBall.color) || (nextSegment.lastBall.color == src.Ball.COLOR_VISE)) || (firstBall.color == src.Ball.COLOR_WILD)) || (nextSegment.lastBall.color == src.Ball.COLOR_WILD)) {
speed = speed + 4;
track.hasPossibleChain = true;
}
nextSegment.tick();
}
if (firstBall.color == src.Ball.COLOR_VISE) {
track.lastTrackPos = (pos + (length * 32)) - 32;
}
iPos.set(pos);
positionBalls(true);
}
function render(alpha) {
var _local8 = int(iPos.get(alpha));
var _local5 = 0;
if (insertTime > 0) {
_local5 = ((insertTime - 1) + (1 - alpha)) * 8;
}
if ((lastTime != _local8) || (lastTimeOffs != _local5)) {
lastTime = _local8;
lastTimeOffs = _local5;
var _local2 = 0;
while (_local2 < balls.length) {
var _local3 = _local8 + (_local2 * 32);
var _local4 = _local5;
if (balls[_local2] == insertingBall) {
_local5 = 0;
}
_local3 = _local3 + _local5;
track.position(balls[_local2], _local3, false);
if (balls[_local2] == insertingBall) {
var _local7 = balls[_local2].xStart + ((balls[_local2].x - balls[_local2].xStart) * (1 - (_local4 / 32)));
var _local6 = balls[_local2].yStart + ((balls[_local2].y - balls[_local2].yStart) * (1 - (_local4 / 32)));
balls[_local2].setPos(_local7, _local6);
}
_local2++;
}
}
if (nextSegment != undefined) {
nextSegment.render(alpha);
}
}
var speed = 0;
var insertTime = 0;
}
Symbol 1731 MovieClip [__Packages.src.Sounds] Frame 0
class src.Sounds
{
static var globalSound;
var soundMc, sound;
function Sounds (ownerMc, soundName) {
var _local2 = ownerMc.getNextHighestDepth();
soundMc = ownerMc.createEmptyMovieClip("soundMcc" + _local2, _local2);
sound = new Sound(soundMc);
sound.attachSound(soundName);
}
static function get(resourceName) {
var _local2 = soundMap[resourceName];
if ((_local2 == undefined) || (_local2 == null)) {
_local2 = new src.Sounds(_root, resourceName);
soundMap[resourceName] = _local2;
}
return(_local2);
}
static function toggleSound() {
if (globalSound == undefined) {
globalSound = new Sound(_root);
}
soundOn = !soundOn;
globalSound.setVolume((soundOn ? 100 : 0));
}
function setVolume(volume) {
sound.setVolume(volume);
}
function playLooping() {
if (noSounds) {
return(undefined);
}
sound.start(0, 9999999);
}
function stopAndPlayOffs(offs) {
if (noSounds) {
return(undefined);
}
sound.stop();
sound.start(offs, 0);
}
function stopAndPlay() {
if (noSounds) {
return(undefined);
}
sound.stop();
sound.start(0);
}
function playOffs(offs) {
if (noSounds) {
return(undefined);
}
sound.start(offs, 0);
}
function playOffsVolPan(offs, vol, pan) {
if (noSounds) {
return(undefined);
}
sound.start(offs, 0);
sound.setVolume(vol);
sound.setPan(pan);
}
function play() {
if (noSounds) {
return(undefined);
}
sound.start(0);
}
function stop() {
sound.stop();
}
static var soundMap = new Object();
static var soundOn = true;
static var noSounds = false;
}
Symbol 1732 MovieClip [__Packages.src.Gem] Frame 0
class src.Gem
{
var luxor, mc, type, x, y, xa, ya, ix, iy, rot, wildBallTransform, wildBallColor;
function Gem (luxor, type, x, y, mc, random) {
this.luxor = luxor;
this.mc = mc;
this.type = type;
mc.gotoAndStop(type + 1);
this.x = x;
this.y = y;
xa = (random.nextDouble() * 8) - 4;
ya = ((-random.nextDouble()) * 8) - 4;
ix = new src.timing.IFloat(x);
iy = new src.timing.IFloat(y);
rot = 0;
mc._x = x;
mc._y = y;
if (type == BONUS_WILD) {
wildBallTransform = new flash.geom.Transform(mc.wildBall);
wildBallColor = new flash.geom.ColorTransform();
wildBallColor.rgb = 16711680 /* 0xFF0000 */;
wildBallTransform.colorTransform = wildBallColor;
}
}
function tick(xShooter) {
x = x + xa;
y = y + ya;
if (y < 8) {
y = 8;
if (ya < 0) {
ya = (-ya) * 0.2;
}
}
if ((y > 530) && (!luxor.level.lost)) {
if ((x > (xShooter - 70)) && (x < (xShooter + 70))) {
y = 530;
luxor.gainScore(SCORES[type]);
var _local3 = "" + SCORES[type];
if (type < 15) {
luxor.level.gemsGotten++;
src.Sounds.get("sndCatchGem").playOffsVolPan(0, 100, (x - 377) / src.Luxor.PAN_DAMP);
} else if (type == COIN) {
luxor.level.coinsGotten++;
luxor.coinsGotten++;
src.Sounds.get("sndCatchCoin").playOffsVolPan(0, 100, (x - 377) / src.Luxor.PAN_DAMP);
} else if (type <= BONUS_COLOR_BOMB_7) {
_local3 = _global.textMappings.powerup_color_bomb;
luxor.level.pickupColorBomb(type - BONUS_COLOR_BOMB_1);
src.Sounds.get("sndCatchColorBomb").playOffsVolPan(0, 100, (x - 377) / src.Luxor.PAN_DAMP);
} else if (type == BONUS_LIGHTNING) {
_local3 = _global.textMappings.powerup_lightning;
luxor.level.pickupLightning();
src.Sounds.get("sndCatchLightning").playOffsVolPan(0, 100, (x - 377) / src.Luxor.PAN_DAMP);
} else if (type == BONUS_REVERSE) {
_local3 = _global.textMappings.powerup_reverse;
luxor.level.pickupReverse();
src.Sounds.get("sndCatchReverse").playOffsVolPan(0, 100, (x - 377) / src.Luxor.PAN_DAMP);
} else if (type == BONUS_BOMB) {
_local3 = _global.textMappings.powerup_fire_ball;
luxor.level.pickupFireball();
src.Sounds.get("sndCatchBomb").playOffsVolPan(0, 100, (x - 377) / src.Luxor.PAN_DAMP);
} else if (type == BONUS_SLOW) {
_local3 = _global.textMappings.powerup_slow;
luxor.level.pickupSlow();
src.Sounds.get("sndCatchSlow").playOffsVolPan(0, 100, (x - 377) / src.Luxor.PAN_DAMP);
} else if (type == BONUS_SPEED_SHOT) {
_local3 = _global.textMappings.powerup_speed_shot;
luxor.level.pickupSpeedShot();
src.Sounds.get("sndCatchSpeed").playOffsVolPan(0, 100, (x - 377) / src.Luxor.PAN_DAMP);
} else if (type == BONUS_STOP) {
_local3 = _global.textMappings.powerup_stop;
luxor.level.pickupStop();
src.Sounds.get("sndCatchStop").playOffsVolPan(0, 100, (x - 377) / src.Luxor.PAN_DAMP);
} else if (type == BONUS_WILD) {
_local3 = _global.textMappings.powerup_wild;
luxor.level.pickupWild();
src.Sounds.get("sndCatchWild").playOffsVolPan(0, 100, (x - 377) / src.Luxor.PAN_DAMP);
}
if (_local3 != undefined) {
luxor.newScorePopup(x, y, 16764159, _local3);
}
luxor.newParticle(x, y, 0);
luxor.gemGotten();
luxor.removeGem(this);
mc.removeMovieClip();
return(undefined);
}
}
if (y > 600) {
luxor.removeGem(this);
mc.removeMovieClip();
return(undefined);
}
if (x < 30) {
x = 30;
xa = -xa;
}
if (x >= 769) {
x = 769;
xa = -xa;
}
ix.set(x);
iy.set(y);
ya = ya + 0.5;
rot++;
}
function render(alpha) {
mc.flare._alpha = (Math.random() * 50) + 20;
mc._x = ix.get(alpha);
mc._y = iy.get(alpha);
mc.flare._rotation = (((-Math.atan2(mc._x + 100, mc._y - 300)) * 180) / Math.PI) + 90;
mc.gem.gotoAndStop((int((rot + alpha) * 2) % mc.gem._totalFrames) + 1);
if (type == BONUS_WILD) {
var _local2 = (rot + alpha) * 0.25;
var _local5 = int((Math.sin(_local2 + 0) * 127) + 127);
var _local6 = int((Math.sin(_local2 + 2.0943951023932) * 127) + 127);
var _local4 = int((Math.sin(_local2 + 4.18879020478639) * 127) + 127);
wildBallColor.rgb = ((_local5 << 16) | (_local6 << 8)) | _local4;
wildBallTransform.colorTransform = wildBallColor;
}
}
static var GEM_1 = 0;
static var GEM_2 = 1;
static var GEM_3 = 2;
static var GEM_4 = 3;
static var GEM_5 = 4;
static var GEM_6 = 5;
static var GEM_7 = 6;
static var GEM_8 = 7;
static var GEM_9 = 8;
static var GEM_10 = 9;
static var GEM_11 = 10;
static var GEM_12 = 11;
static var GEM_13 = 12;
static var GEM_14 = 13;
static var GEM_15 = 14;
static var COIN = 18;
static var BONUS_COLOR_BOMB_1 = 20;
static var BONUS_COLOR_BOMB_2 = 21;
static var BONUS_COLOR_BOMB_3 = 22;
static var BONUS_COLOR_BOMB_4 = 23;
static var BONUS_COLOR_BOMB_5 = 24;
static var BONUS_COLOR_BOMB_6 = 25;
static var BONUS_COLOR_BOMB_7 = 26;
static var BONUS_LIGHTNING = 27;
static var BONUS_REVERSE = 28;
static var BONUS_BOMB = 29;
static var BONUS_SLOW = 30;
static var BONUS_SPEED_SHOT = 31;
static var BONUS_STOP = 32;
static var BONUS_WILD = 33;
static var SCORES = [1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 11000, 12000, 13000, 14000, 15000, 0, 0, 0, 250, 0, 500, 500, 500, 500, 500, 500, 500, 500, 1000, 500, 1000, 1000, 1000, 1000];
}
Symbol 1733 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 1734 MovieClip [__Packages.src.InstructionsReplayer] Frame 0
class src.InstructionsReplayer implements src.timing.Timeable
{
var luxor, ballLayer, orgBallLayer, ballShootDelay, random, timer, xt;
function InstructionsReplayer (luxor) {
src.Sounds.noSounds = true;
this.luxor = luxor;
ballLayer = _root.startupPanel.mc.createEmptyMovieClip("ballLayer", 0);
orgBallLayer = luxor.ballLayer;
luxor.ballLayer = ballLayer;
ballShootDelay = 12;
luxor.shooter = ballLayer.attachMovie("Shooter", "shooter", 4999);
luxor.shooter._x = 500;
luxor.shooter._y = 550;
random = new src.util.Random(512);
var _local4 = new Array();
_local4.push("WePh0We9U0mX9U0mX9b0");
luxor.level = new src.Level(luxor, _local4, 0, random);
luxor.level.startScore = 0;
luxor.communicator.disable();
luxor.newTrain(luxor.level.tracks[0]);
timer = new src.timing.Timer(this, 24);
luxor.level.nextBall();
xt = (random.nextFloat() * 355) + 200;
luxor.gems = new Array();
luxor.isInstructions = true;
}
function reload() {
luxor.shooter.ball = luxor.newBall(luxor.level.currentBallColor);
luxor.shooter.ball.mc.swapDepths(luxor.shooter.getDepth() + 1);
luxor.shooter.ball.gotoAndStop(luxor.level.currentBallColor + 2);
luxor.shooter.preview.gotoAndStop(luxor.level.nextBallColor + 2);
}
function dispose() {
src.Sounds.noSounds = false;
luxor.isInstructions = false;
luxor.gemRandom = new src.util.Random(luxor.orgGemRandomSeed);
luxor.communicator.enable();
ballLayer.removeMovieClip();
luxor.ballLayer = orgBallLayer;
}
function onEnterFrame() {
timer.advanceTime();
}
function tick(tick) {
var _local2 = luxor.shooter.x.get(1);
luxor.level.tick();
luxor.tickGems(_local2);
xd = xd * 0.92;
xd = xd + ((xt - _local2) * 0.01);
if (xd < -10) {
xd = -10;
}
if (xd > 10) {
xd = 10;
}
_local2 = _local2 + xd;
luxor.shooter.x.set(_local2);
luxor.tickShootBall();
if ((luxor.shooter.ball == undefined) && (luxor.shootBall == undefined)) {
reload();
} else if (luxor.shooter.ball != undefined) {
ballShootDelay--;
if (ballShootDelay <= 0) {
shotBalls++;
if (shotBalls == 11) {
luxor.shootBall = new src.ShootBall(luxor.shooter.ball, luxor.shooter.x.get(1), 536, false);
luxor.shooter.ball = undefined;
luxor.level.nextBall();
}
xt = (random.nextFloat() * 355) + 200;
ballShootDelay = random.nextInt(12) + 12;
}
}
}
function render(tick, alpha) {
luxor.level.render(alpha);
luxor.shooter.render(alpha);
var _local2 = 0;
while (_local2 < luxor.gems.length) {
luxor.gems[_local2].render(alpha);
_local2++;
}
if (luxor.shootBall != undefined) {
luxor.shootBall.render(alpha);
}
}
var shotBalls = 0;
var xd = 0;
}
Symbol 1735 MovieClip [__Packages.src.DebugData] Frame 0
class src.DebugData
{
function DebugData () {
}
static var superSeed = 183758344;
static var data = [["levelstart", 0], ["click", 14, 499], ["click", 36, 455], ["click", 73, 455], ["click", 105, 480], ["click", 140, 177], ["click", 177, 177], ["click", 221, 398], ["getgem", 251, 149], ["click", 290, 252], ["click", 347, 411], ["getgem", 370, 320], ["click", 396, 238], ["click", 435, 136], ["click", 491, 206], ["click", 511, 151], ["getgem", 577, 194], ["click", 590, 465], ["click", 618, 469], ["getgem", 690, 279], ["click", 699, 213], ["click", 735, 213], ["click", 763, 213], ["click", 806, 264], ["getgem", 839, 312], ["click", 856, 168], ["click", 897, 81], ["click", 921, 139], ["click", 946, 145], ["click", 986, 51], ["click", 1015, 257], ["click", 1044, 299], ["click", 1074, 267], ["click", 1115, 576], ["click", 1144, 489], ["click", 1206, 309], ["click", 1233, 485], ["click", 1269, 557], ["click", 1298, 428], ["click", 1325, 636], ["click", 1373, 586], ["click", 1400, 586], ["getgem", 1452, 651], ["click", 1486, 564], ["click", 1522, 530], ["getgem", 1546, 592], ["getgem", 1592, 462], ["click", 1626, 129], ["getgem", 1676, 98], ["click", 1742, 450], ["click", 1776, 149], ["getgem", 1797, 349], ["click", 1834, 94], ["getgem", 1844, 211], ["click", 1859, 161], ["click", 1880, 184], ["click", 1983, 425], ["click", 2011, 399], ["click", 2028, 424], ["getgem", 2071, 373], ["levelcomplete", 2107, 34230], ["click", 2133, 377], ["levelstart", 2134], ["click", 2190, 530], ["click", 2229, 611], ["click", 2286, 349], ["getgem", 2304, 670], ["click", 2447, 159], ["click", 2468, 293], ["click", 2490, 255], ["click", 2517, 212], ["click", 2542, 257], ["click", 2564, 245], ["click", 2582, 314], ["click", 2609, 448], ["click", 2642, 230], ["click", 2689, 366], ["click", 2716, 316], ["click", 2741, 465], ["click", 2766, 269], ["click", 2801, 560], ["click", 2836, 317], ["getgem", 2853, 655], ["click", 2868, 471], ["click", 2902, 516], ["click", 2936, 486], ["click", 2958, 486], ["click", 2978, 486], ["getgem", 2996, 629], ["click", 3006, 504], ["click", 3014, 504], ["getgem", 3066, 439], ["click", 3166, 550], ["click", 3215, 513], ["getgem", 3241, 274], ["getgem", 3279, 350], ["getgem", 3289, 232], ["click", 3323, 306], ["click", 3361, 165], ["click", 3408, 139], ["click", 3535, 94], ["click", 3568, 376], ["click", 3592, 272], ["click", 3619, 458], ["click", 3655, 354], ["click", 3678, 344], ["click", 3707, 368], ["click", 3727, 368], ["click", 3749, 439], ["click", 3768, 402], ["click", 3777, 402], ["getgem", 3842, 174], ["click", 3855, 282], ["click", 3914, 582], ["click", 3955, 559], ["getgem", 3975, 493], ["click", 4013, 298], ["click", 4045, 115], ["click", 4075, 259], ["click", 4099, 187], ["click", 4132, 111], ["click", 4194, 65], ["click", 4222, 346], ["click", 4247, 206], ["click", 4282, 272], ["click", 4319, 528], ["click", 4350, 360], ["click", 4387, 609], ["click", 4420, 389], ["click", 4450, 568], ["click", 4469, 568], ["click", 4494, 352], ["click", 4525, 440], ["click", 4563, 468], ["getgem", 4589, 294], ["click", 4610, 517], ["click", 4631, 517], ["click", 4651, 549], ["getgem", 4705, 642], ["levelcomplete", 4750, 40000], ["click", 4758, 643], ["levelstart", 4759], ["click", 4776, 489], ["click", 4839, 727], ["click", 4873, 719], ["click", 4897, 719], ["getgem", 4931, 747], ["getgem", 4938, 743], ["click", 4952, 570], ["click", 4987, 690], ["click", 5013, 694], ["click", 5042, 430], ["click", 5066, 339], ["click", 5099, 236], ["getgem", 5112, 399], ["click", 5129, 311], ["click", 5151, 308], ["click", 5171, 265], ["click", 5196, 243], ["click", 5217, 215], ["click", 5246, 167], ["click", 5256, 171], ["click", 5265, 171], ["getgem", 5331, 251], ["click", 5346, 529], ["click", 5364, 440], ["click", 5389, 534], ["click", 5410, 430], ["click", 5426, 393], ["click", 5470, 260], ["click", 5505, 675], ["click", 5531, 359], ["getgem", 5558, 577], ["click", 5568, 659], ["click", 5598, 459], ["click", 5633, 223], ["click", 5661, 392], ["click", 5686, 283], ["click", 5706, 255], ["click", 5752, 303], ["click", 5779, 204], ["click", 5809, 177], ["getgem", 5837, 118], ["click", 5854, 264], ["click", 5872, 215], ["click", 5886, 271], ["getgem", 5952, 250], ["click", 5969, 600], ["click", 5996, 451], ["click", 6023, 595], ["click", 6044, 408], ["click", 6066, 407], ["click", 6105, 490], ["click", 6128, 562], ["click", 6156, 279], ["click", 6180, 413], ["getgem", 6240, 517], ["click", 6244, 517], ["getgem", 6253, 444], ["click", 6267, 212], ["click", 6299, 133], ["click", 6361, 247], ["click", 6397, 400], ["click", 6428, 401], ["click", 6455, 401], ["click", 6488, 529], ["click", 6507, 574], ["click", 6540, 478], ["click", 6549, 480], ["click", 6556, 480], ["getgem", 6617, 338], ["levelcomplete", 6657, 39170], ["click", 6680, 419], ["levelstart", 6681], ["click", 6691, 418], ["click", 6783, 88], ["click", 6825, 50], ["click", 6866, 79], ["click", 6901, 370], ["click", 6934, 492], ["getgem", 6998, 472], ["getgem", 7035, 571], ["click", 7050, 248], ["click", 7082, 410], ["click", 7105, 359], ["click", 7123, 414], ["getgem", 7146, 378], ["click", 7168, 139], ["getgem", 7193, 437], ["click", 7208, 192], ["click", 7240, 85], ["click", 7277, 390], ["click", 7317, 399], ["getgem", 7345, 322], ["click", 7366, 446], ["getgem", 7392, 306], ["click", 7414, 212], ["click", 7444, 225], ["click", 7480, 358], ["click", 7505, 432], ["click", 7535, 401], ["click", 7567, 554], ["click", 7607, 668]];
}