Combined Code
movieClip 99 {
}
movieClip 164 {
}
movieClip 229 {
}
movieClip 294 {
}
movieClip 359 {
}
movieClip 424 {
}
movieClip 489 {
}
movieClip 538 {
}
movieClip 587 {
}
movieClip 636 {
}
movieClip 639 {
}
movieClip 641 {
}
movieClip 643 {
}
movieClip 644 BallHolder {
}
movieClip 658 {
}
movieClip 661 {
}
movieClip 664 {
}
movieClip 667 {
}
movieClip 670 {
}
movieClip 672 {
}
movieClip 673 {
frame 1 {
stop();
}
}
movieClip 676 {
}
movieClip 677 Shooter {
#initclip
Object.registerClass('Shooter', src.Shooter);
#endinitclip
}
movieClip 694 {
}
movieClip 727 {
}
movieClip 744 {
}
// unknown tag 88 length 63
movieClip 767 {
}
movieClip 768 ParticleHolder {
#initclip
Object.registerClass('ParticleHolder', src.Particle);
#endinitclip
}
movieClip 771 {
}
movieClip 774 {
}
movieClip 777 {
}
movieClip 780 {
}
movieClip 783 {
}
movieClip 786 {
}
movieClip 789 {
}
movieClip 792 {
}
movieClip 795 {
}
movieClip 798 {
}
movieClip 801 {
}
movieClip 804 {
}
movieClip 807 {
}
movieClip 810 {
}
movieClip 827 GemHolder {
}
movieClip 852 {
}
movieClip 853 LightningHolder {
frame 1 {
stop();
var startTime = getTimer();
onEnterFrame = function () {
var v2 = (getTimer() - startTime) / 500;
v2 = 1 - v2 * v2 * v2 * v2;
if (v2 < 0) {
this.removeMovieClip();
v2 = 0;
}
p0._alpha = Math.random() * 100 * v2;
p1._alpha = Math.random() * 100 * v2;
p2._alpha = Math.random() * 100 * v2;
p0.gotoAndStop(int(Math.random() * 16) + 1);
p1.gotoAndStop(int(Math.random() * 16) + 1);
p2.gotoAndStop(int(Math.random() * 16) + 1);
};
}
}
movieClip 855 ScorePopup {
#initclip
Object.registerClass('ScorePopup', src.ScorePopup);
#endinitclip
}
movieClip 857 {
}
movieClip 858 {
}
movieClip 859 {
}
movieClip 860 {
}
movieClip 861 WarningLight {
#initclip
Object.registerClass('WarningLight', src.WarningLight);
#endinitclip
}
movieClip 862 {
}
// unknown tag 88 length 68
// unknown tag 88 length 63
movieClip 884 {
}
movieClip 889 {
}
movieClip 892 {
}
movieClip 896 Luxor {
#initclip
Object.registerClass('Luxor', src.Luxor);
#endinitclip
}
// unknown tag 88 length 67
button 901 {
on (press) {
luxor.toggleSound();
}
}
button 906 {
on (press) {
luxor.quitPressed();
}
}
movieClip 910 {
}
movieClip 911 {
}
movieClip 918 {
frame 1 {
stop();
}
}
instance startupPanel of movieClip 918 {
onClipEvent (press) {
if (_root.luxor.scoreSignDelay > 1) {
_root.luxor.scoreSignDelay = 1;
}
}
}
movieClip 919 __Packages.src.Particle {
#initclip
if (!_global.src) {
_global.src = new Object();
}
if (!_global.src.Particle) {
var v1 = function () {
super();
this.timeFactor = Math.random() * 0.5 + 0.75;
};
src.Particle = v1;
src.Particle extends MovieClip;
var v2 = v1.prototype;
v2.init = function (x, y, xa, ya, type) {
this.x = x;
this.y = y;
this.xa = xa;
this.ya = ya;
if (_global.party == true) {
this.xa *= 2;
this.ya *= 2;
x += Math.random() * 8 - 4;
y += Math.random() * 8 - 4;
}
this.startTime = getTimer();
this.gotoAndStop(type + 1);
this.onEnterFrame();
};
v2.onEnterFrame = function () {
var v2 = ((getTimer() - this.startTime) * 24 / 1000) * this.timeFactor;
this.particle.gotoAndStop(int(v2) + 1);
this._x = this.x + this.xa * v2;
this._y = this.y + this.ya * v2 + v2 * v2 * 0.05;
if (v2 > 16) {
this.removeMovieClip();
}
};
ASSetPropFlags(src.Particle.prototype, null, 1);
}
#endinitclip
}
movieClip 920 __Packages.src.ScorePopup {
#initclip
if (!_global.src) {
_global.src = new Object();
}
if (!_global.src.ScorePopup) {
var v1 = function () {
super();
};
src.ScorePopup = v1;
src.ScorePopup extends MovieClip;
var v2 = v1.prototype;
v2.init = function (x, y, color, text) {
this.textArea.textColor = color;
this.textArea.text = text;
this.x = x;
this.y = y;
this.startTime = getTimer();
this.onEnterFrame();
};
v2.onEnterFrame = function () {
var v2 = (getTimer() - this.startTime) / 1000;
this._x = this.x;
this._y = this.y - v2 * 40;
this._alpha = 100 - v2 * v2 * v2 * 100;
if (v2 >= 1) {
this.removeMovieClip();
}
};
ASSetPropFlags(src.ScorePopup.prototype, null, 1);
}
#endinitclip
}
movieClip 921 __Packages.src.WarningLight {
#initclip
if (!_global.src) {
_global.src = new Object();
}
if (!_global.src.WarningLight) {
var v1 = function () {
super();
this.render(0);
this.animSpeed = 10;
};
src.WarningLight = v1;
src.WarningLight extends MovieClip;
var v2 = v1.prototype;
v2.tick = function (timeWarningFactor, distanceWarningFactor) {
var v2 = timeWarningFactor;
if (v2 > distanceWarningFactor) {
v2 = distanceWarningFactor;
}
++this.animTime;
if (this.animTime == 0) {
if (v2 > 1) {
this.animTime = -1;
}
}
if (this.animTime == 10) {
this.animTime = -(int(30 * v2) + 1);
if (this.animTime >= 0) {
this.animTime = -1;
}
}
};
v2.render = function (alpha) {
var v4 = this.animTime + alpha;
if (v4 < 1) {
if (!this.wasVisible) {
return undefined;
}
this.wasVisible = false;
this.cl._visible = false;
var v2 = 0;
while (v2 < 4) {
var v3 = this['l' + v2];
v3._visible = false;
++v2;
}
return undefined;
}
if (!this.wasVisible) {
this.wasVisible = true;
this.cl._visible = true;
v2 = 0;
while (v2 < 4) {
v3 = this['l' + v2];
v3._visible = true;
++v2;
}
}
v4 -= 1;
v4 /= this.animSpeed;
this.cl._alpha = Math.sin(v4 * Math.PI * 2) * 50 + 50;
v2 = 0;
for (;;) {
if (v2 >= 4) {
return undefined;
}
v3 = this['l' + v2];
v3.gotoAndStop(8 - int(v4 * 8));
var v6 = (v2 & 1) * 2 - 1;
var v5 = (v2 & 2) - 1;
v3._x = (38 - v4 * 35) * v6;
v3._y = (38 - v4 * 35) * v5;
++v2;
}
};
v2.animTime = -1;
v2.wasVisible = true;
ASSetPropFlags(src.WarningLight.prototype, null, 1);
}
#endinitclip
}
movieClip 922 __Packages.src.timing.Timeable {
#initclip
if (!_global.src) {
_global.src = new Object();
}
if (!_global.src.timing) {
_global.src.timing = new Object();
}
if (!_global.src.timing.Timeable) {
_global.src.timing.Timeable = function () {};
}
#endinitclip
}
movieClip 923 __Packages.src.Luxor {
#initclip
if (!_global.src) {
_global.src = new Object();
}
if (!_global.src.Luxor) {
var v1 = function () {
super();
_root.gotya = new com.vascogames.as2.Gotya();
trace('loading ?');
this.usedMaps = new Array(src.Luxor.MAP_NAMES.length);
var v4 = 0;
while (v4 < this.usedMaps.length) {
this.usedMaps[v4] = false;
++v4;
}
this.score = 0;
};
src.Luxor = v1;
src.Luxor extends MovieClip;
var v2 = v1.prototype;
_global.src.Luxor implements _global.src.timing.Timeable;
v2.nextInt = function () {
return this.gen();
};
v2.nextDouble = function () {
return this.gen() / 2147483647;
};
v2.nextIntRange = function (min, max) {
min -= 0.4999;
max += 0.4999;
return Math.round(min + (max - min) * this.nextDouble());
};
v2.nextDoubleRange = function (min, max) {
return min + (max - min) * this.nextDouble();
};
v2.gen = function () {
seed = seed * 16807 % 2147483647;
return seed;
};
v2.nextLevel = function () {
trace('NEXT LEVEL CALLED!');
_root.startupPanel._visible = true;
_root.startupPanel.gotoAndStop(1);
if (this.DEBUG_MODE) {
this.usedMaps[31] = true;
this.usedMaps[39] = true;
this.usedMaps[48] = true;
}
this.random = new src.util.Random(this.superRandom.nextInt(2147483647));
this.orgGemRandomSeed = this.superRandom.nextInt(2147483647);
this.gemRandom = new src.util.Random(this.orgGemRandomSeed);
if (_global.relaxMode) {
var v5 = true;
var v4 = 0;
while (v4 < src.Luxor.MAP_NAMES.length) {
if (!this.usedMaps[v4]) {
v5 = false;
}
++v4;
}
if (v5) {
v4 = 0;
while (v4 < src.Luxor.MAP_NAMES.length) {
this.usedMaps[v4] = false;
++v4;
}
}
this.usedMaps[31] = true;
this.usedMaps[39] = true;
this.usedMaps[48] = true;
do {
this.mapNum = this.random.nextInt(src.Luxor.MAP_NAMES.length);
} while (this.usedMaps[this.mapNum]);
this.usedMaps[this.mapNum] = true;
} else {
this.mapNum = parseInt(_global.levels[this.mapPointer++ % 10]);
}
this.levelName = _global.textMappings['level_name_' + this.mapNum];
this.loadLevel();
Key.removeListener(this);
this.skipTicks = 2;
};
v2.loadLevel = function () {
this.loadLevelAt = -1;
trace('Loading level ' + src.Luxor.MAP_NAMES[this.mapNum] + '..');
this.overlay.removeMovieClip();
this.background.removeMovieClip();
this.ballLayer.removeMovieClip();
this.ballLayer = this.mc.createEmptyMovieClip('ballLayer', 0);
this.overlay = this.ballLayer.createEmptyMovieClip('overlay', 515000);
this.background = this.ballLayer.createEmptyMovieClip('background', 0);
if (this.DEBUG_MODE) {
this.domain = 'http://www.gotya.com';
}
this.started = false;
this.xmlLoaded = false;
delete this.mapXml;
delete this.loaderObj;
this.mapXml = new XML();
this.mapXml.ignoreWhite = true;
this.mapXml.onLoad = mx.utils.Delegate.create(this, this.mapXmlLoaded);
this.loaderObj = new MovieClipLoader();
this.loaderObj.addListener(this);
this.loadSteps = 0;
this.imagesLoaded = false;
this.imageProcess = 0;
this.loaderObj.loadClip(this.domain + '/games/junglefever/' + src.Luxor.MAP_NAMES[this.mapNum] + '_front.png', this.overlay);
this.startLoadTime = getTimer();
};
v2.onLoadError = function (target_mc, loadedBytes, totalBytes) {
trace('Failed to load image!!');
this.mapXml.onLoad = undefined;
if (this.loaderObj != null) {
this.loaderObj.removeListener(this);
}
delete this.mapXml;
delete this.loaderObj;
this.loadLevelAt = getTimer() + 200;
};
v2.onLoadProgress = function (target_mc, loadedBytes, totalBytes) {
this.imageProcess = loadedBytes / totalBytes / 2 + this.loadSteps * 0.5;
};
v2.onLoadInit = function () {
trace('Loaded image.');
if (this.loaderObj != null) {
this.loaderObj.removeListener(this);
}
delete this.loaderObj;
if (this.loadSteps == 0) {
this.loadSteps = 1;
this.loaderObj = new MovieClipLoader();
this.loaderObj.addListener(this);
this.loaderObj.loadClip(this.domain + '/games/junglefever/' + src.Luxor.MAP_NAMES[this.mapNum] + '_back.jpg', this.background);
return undefined;
}
if (this.loadSteps == 1) {
this.imagesLoaded = true;
this.mapXml.load(this.domain + '/games/junglefever/' + src.Luxor.MAP_NAMES[this.mapNum] + '.xml');
return undefined;
}
};
v2.mapXmlLoaded = function (success) {
if (success) {
trace('Loaded xml.');
this.xmlLoaded = true;
return undefined;
}
trace('Failed to load xml!!');
if (this.loaderObj != null) {
this.loaderObj.removeListener(this);
}
this.mapXml.onLoad = undefined;
delete this.mapXml;
delete this.loaderObj;
this.loadLevelAt = getTimer() + 200;
};
v2.startGlow = function () {
if (this.glowing) {
return undefined;
}
this.glowing = true;
this.myBitmap = new flash.display.BitmapData(777, 600, true, 16777215);
var v3 = this.createEmptyMovieClip('holder_mc', 1);
v3.attachBitmap(this.myBitmap, 1);
v3._alpha = 100;
var v2 = new Array();
v2 = v2.concat([4, 2, 2, 0, -1280]);
v2 = v2.concat([2, 4, 2, 0, -1280]);
v2 = v2.concat([2, 2, 4, 0, -1280]);
v2 = v2.concat([0, 0, 0, 1, 0]);
this.colorFilter = new flash.filters.ColorMatrixFilter(v2);
this.blurFilter = new flash.filters.BlurFilter(24, 24, 2);
v3.blendMode = 'screen';
v3._alpha = 100;
};
v2.showInstructions = function () {
this.showingInstructions = true;
this.instructionsReplayer = new src.InstructionsReplayer(this);
this.scoreSignDelay = 600;
_root.startupPanel.gotoAndStop(2);
_root.startupPanel.timerText = (_global.textMappings.next_level_in.split('[0]')).join('' + int((this.scoreSignDelay + 22) / 24));
_root.startupPanel.titleText = _global.textMappings.instructions_title;
_root.startupPanel.instructionsText = _global.textMappings.instructions_text;
this.currentLevel = 0;
};
v2.mapLoaded = function () {
if (this.currentLevel < 0) {
(src.Sounds.get('sndIntroMusic')).playOffsVolPan(0, 100, 0);
this.showInstructions();
return undefined;
}
src.Ball.ballCounts = undefined;
_root.startupPanel._visible = false;
var v7 = new Array();
var v5 = this.mapXml.childNodes[0].childNodes;
var v4 = 0;
while (v4 < v5.length) {
v5[v4].nodeName != 'name';
if (v5[v4].nodeName == 'path') {
v7.push(new String(v5[v4].firstChild.nodeValue));
}
++v4;
}
this.scoreSignDelay = 0;
this.BALL_COUNT = 30 / v7.length;
this.started = true;
this.skipTicks = 1;
this.level = new src.Level(this, v7, this.currentLevel, this.random);
this.level.startScore = this.score;
++this.currentLevel;
if (_global.shortGameMode && this.currentLevel > 1) {
this.wantsBall = false;
}
this.levelTicks = 0;
this._quality = 'HIGH';
this._x = -22;
this.gems = new Array();
this.shootBall = undefined;
this.shooter.ball = null;
this.levelPopup._visible = true;
this.levelPopup.levelNum = (_global.textMappings.level_num.split('[0]')).join(this.currentLevel);
this.levelPopup.levelName = this.levelName;
this.levelPopup.gotoAndStop(1);
this.signDelay = 72;
this.communicator.sendLevelStart(this.currentTick);
(src.Sounds.get('sndLevelIntro')).playOffsVolPan(0, 100, 0);
this.shooter = this.ballLayer.attachMovie('Shooter', 'shooter', 44999);
this.shooter._y = 550;
this.ballInserted();
v4 = 0;
while (v4 < this.level.tracks.length) {
var v6 = this.ballLayer.attachMovie('WarningLight', 'warningLight' + v4, 40000 + v4);
this.level.tracks[v4].setWarningLight(v6);
++v4;
}
if (this.DEBUG_MODE && this.DEBUG_REPLAY) {
this.timer = new src.timing.Timer(this, 192);
} else {
this.timer = new src.timing.Timer(this, 24);
}
Key.addListener(this);
};
v2.startWarningSound = function () {
if (this.hasWarningSound) {
return undefined;
}
(src.Sounds.get('sndWarning')).playLooping();
this.hasWarningSound = true;
};
v2.stopWarningSound = function () {
if (this.hasWarningSound) {
(src.Sounds.get('sndWarning')).stop();
this.hasWarningSound = false;
}
};
v2.onKeyDown = function () {
this.keyPressed = true;
var v3 = chr(Key.getAscii());
if (v3 == 'q') {
this.inputBuffer = '';
return undefined;
}
this.inputBuffer += v3;
if (this.inputBuffer == 'roll') {
(src.Sounds.get('sndLightning')).playOffsVolPan(0, 100, 0);
_global.roll = true;
}
if (this.inputBuffer == 'notch') {
(src.Sounds.get('sndLightning')).playOffsVolPan(0, 100, 0);
_global.spark2 = true;
}
if (this.inputBuffer == 'party') {
(src.Sounds.get('sndLightning')).playOffsVolPan(0, 100, 0);
_global.party = true;
}
};
v2.getLastSegment = function (track) {
var v1 = track.firstSegment;
while (v1.nextSegment != undefined) {
v1 = v1.nextSegment;
}
return v1;
};
v2.newTrain = function (track) {
var v4 = this.level.getColorChain(this.BALL_COUNT, track.random);
var v3 = new Array(this.BALL_COUNT + 1);
var v2 = 0;
while (v2 < this.BALL_COUNT) {
v3[v2] = this.newBall(v4[v2]);
++v2;
}
v3[this.BALL_COUNT] = this.newBall(src.Ball.COLOR_VISE);
var v6 = new src.TrainSegment(track, v3);
(src.Sounds.get('sndTrainSpawn')).playOffsVolPan(0, 100, 0);
++this.level.segments;
if (track.firstSegment != undefined) {
var v7 = this.getLastSegment(track);
v6.lastSegment = v7;
v7.nextSegment = v6;
return undefined;
}
track.firstSegment = v6;
};
v2.newScorePopup = function (x, y, color, text) {
x -= 22;
if (x < 50) {
x = 50;
}
if (x > 705) {
x = 705;
}
if (y < 50) {
y = 50;
}
if (y > 550) {
y = 550;
}
x += 22;
var v4 = this.ballLayer.attachMovie('ScorePopup', 'score' + this.scorePopupCount, 20001 + this.scorePopupCount);
v4.init(x, y, color, text);
++this.scorePopupCount;
if (this.scorePopupCount == 4000) {
this.scorePopupCount = 0;
}
};
v2.newBall = function (color) {
if (color == undefined) {
color = this.level.randomColor();
}
var v2 = this.ballLayer.attachMovie('BallHolder', 'ball' + this.ballCount, 5001 + this.ballCount);
v2._x = -100;
var v4 = new src.Ball(color, this.ballCount, v2);
++this.ballCount;
if (this.ballCount == 4000) {
this.ballCount = 0;
}
return v4;
};
v2.newGem = function (x, y, color) {
if (this.isInstructions) {
return undefined;
}
if (color == undefined) {
color = this.gemRandom.nextInt(5) + Math.min(this.level.levelNum, 10);
}
var v4 = this.ballLayer.attachMovie('GemHolder', 'gem' + this.gemCount, 10001 + this.gemCount);
var v2 = new src.Gem(this, color, x, y, v4, this.random);
++this.gemCount;
if (this.gemCount == 4000) {
this.gemCount = 0;
}
this.gems.push(v2);
return v2;
};
v2.newCoin = function (x, y) {
return this.newGem(x, y, 18);
};
v2.removeGem = function (gem) {
if (this.gemsToRemove == undefined) {
this.gemsToRemove = new Array();
}
this.gemsToRemove.push(gem);
};
v2.newParticle = function (x, y, type) {
var v8 = (_global.party == true) ? 4 : 1;
var v7 = 0;
for (;;) {
if (v7 >= v8) {
return undefined;
}
if (type == 0 && _global.spark2 == true) {
type = 3;
}
var v5 = this.ballLayer.attachMovie('ParticleHolder', 'particle' + this.particleCount, 15001 + this.particleCount);
var v3 = Math.random() * Math.PI * 2;
var v4 = Math.random() * 3;
v5.init(x, y, Math.sin(v3) * v4, Math.cos(v3) * v4, type);
++this.particleCount;
if (this.particleCount == 4000) {
this.particleCount = 0;
}
++v7;
}
};
v2.init = function () {
gotya.startGame();
this.communicator = new src.Communicator();
this.communicator.parseGameData(_root.gameData);
this.communicator.gameStarted();
!this.DEBUG_MODE;
this.communicator.randomSeed = _root.gotya.getMatchId();
trace('test' + this.communicator.randomSeed);
seed = this.communicator.randomSeed;
_global.levels = [];
var v4 = 0;
while (levels.length < 10) {
a = this.nextIntRange(0, 49);
var v6 = levels.length;
var v5 = false;
v4 = 0;
while (v4 < v6) {
if (levels[v4] == a) {
v5 = true;
}
++v4;
}
if (!v5) {
levels.push(a);
}
++v4;
}
trace('levels ' + levels);
if (this.DEBUG_REPLAY) {
this.superRandom = new src.util.Random(src.DebugData.superSeed);
} else {
this.superRandom = new src.util.Random(this.communicator.randomSeed);
}
this.nextLevel();
if (_global.relaxMode) {
this.timeLeft = '--';
}
};
v2.onEnterFrame = function () {
if (this.loadLevelAt >= 0 && getTimer() > this.loadLevelAt) {
this.loadLevel();
}
if (this.showingInstructions) {
this.instructionsReplayer.onEnterFrame();
this.score = 0;
--this.scoreSignDelay;
_root.startupPanel.timerText = (_global.textMappings.next_level_in.split('[0]')).join('' + int((this.scoreSignDelay + 22) / 24));
if (this.scoreSignDelay <= 1) {
this.instructionsReplayer.dispose();
this.scoreSignDelay = 0;
this.showingInstructions = false;
this.mapLoaded();
}
return undefined;
}
if (!this.hasGameData) {
if (this.DEBUG_MODE || !this.DEBUG_MODE) {
_root.gameData = this.DEBUG_GAME_DATA;
}
if (_root.gameData != undefined) {
this.hasGameData = true;
this.init();
}
return undefined;
}
if (this.started) {
if (this.skipTicks < 2) {
this.timer.advanceTime();
this.skipTicks = 0;
}
} else {
_root.startupPanel.loadingText.text = (_global.textMappings.loading.split('[0]')).join(int(this.imageProcess * 100));
if (this.imagesLoaded && this.xmlLoaded && getTimer() > this.startLoadTime + 500) {
this.mapLoaded();
}
}
if (this.glowing) {
this.myBitmap.draw(this.ballLayer);
this.myBitmap.applyFilter(this.myBitmap, this.myBitmap.rectangle, new flash.geom.Point(0, 0), this.colorFilter);
this.myBitmap.applyFilter(this.myBitmap, this.myBitmap.rectangle, new flash.geom.Point(0, 0), this.blurFilter);
}
};
v2.onPress = function () {
this.clicked = true;
};
v2.processPress = function (xShooter) {
if (this.scoreSignDelay > 2) {
if (this.level.lost && this.scoreSignDelay > 288) {
return undefined;
}
this.scoreSignDelay = 2;
return undefined;
}
if (this.signDelay > 1) {
this.signDelay = 1;
return undefined;
}
if (this.shooter.ball != undefined) {
++this.level.shotsFired;
if (this.shooter.ball.color == src.Ball.COLOR_LIGHTNING) {
var v5 = this.ballLayer.attachMovie('LightningHolder', 'particle' + this.particleCount, 15001 + this.particleCount);
v5._x = xShooter;
v5._y = 520;
++this.particleCount;
var v2 = 0;
while (v2 < this.level.tracks.length) {
var v3 = this.level.tracks[v2];
v3.firstSegment.lightning(xShooter, 32);
(src.Sounds.get('sndLightning')).playOffsVolPan(0, 100, (xShooter - 377) / src.Luxor.PAN_DAMP);
++v2;
}
this.shooter.ball.remove();
this.shooter.ball = undefined;
this.wantsBall = false;
this.level.nextBall();
this.reload();
return undefined;
}
(src.Sounds.get('sndShootBall')).playOffsVolPan(0, 100, (xShooter.get(1) - 377) / src.Luxor.PAN_DAMP);
var v6 = this.level.speedShotTime > 0;
this.shootBall = new src.ShootBall(this.shooter.ball, xShooter, 536, v6);
this.shooter.ball = undefined;
this.wantsBall = false;
this.shooter.shootergr.play();
this.level.nextBall();
}
};
v2.ballInserted = function () {
this.reload();
};
v2.reload = function () {
if (!_global.shortGameMode || this.currentLevel <= 1) {
this.wantsBall = true;
}
};
v2.tickGems = function (xShooter) {
if (this.gemsToRemove != undefined) {
while (this.gemsToRemove.length > 0) {
var v4 = this.gemsToRemove.pop();
var v3 = -1;
var v2 = 0;
while (v2 < this.gems.length) {
if (this.gems[v2] == v4) {
v3 = v2;
break;
}
++v2;
}
if (v3 >= 0) {
this.gems.splice(v2, 1);
}
}
this.gemsToRemove = undefined;
}
v2 = 0;
for (;;) {
if (v2 >= this.gems.length) {
return undefined;
}
this.gems[v2].tick(xShooter);
++v2;
}
};
v2.tickShootBall = function () {
if (this.shootBall != undefined) {
var v7 = false;
var v2 = 0;
while (v2 < this.level.tracks.length) {
var v3 = this.level.tracks[v2];
if (v3.firstSegment != undefined && v3.firstSegment.collideCheck(this.shootBall)) {
v7 = true;
}
++v2;
}
if (v7) {
this.shootBall.collide();
if (this.shootBall.ball.color == src.Ball.COLOR_FIREBALL) {
v2 = 0;
while (v2 < 16) {
var v4 = v2 * Math.PI * 2 / 16;
var v6 = Math.sin(v4) * 100;
var v5 = Math.cos(v4) * 100;
this.newParticle(this.shootBall.x + v6, this.shootBall.y + v5, 2);
++v2;
}
v2 = 0;
while (v2 < this.level.tracks.length) {
v3 = this.level.tracks[v2];
v3.firstSegment.fireBall(this.shootBall.x, this.shootBall.y, 100);
++v2;
}
(src.Sounds.get('sndFireball')).playOffsVolPan(0, 100, (this.shootBall.x - 377) / src.Luxor.PAN_DAMP);
this.shootBall.ball.remove();
this.reload();
} else {
v3 = this.shootBall.collidedBall.track;
if (this.shootBall.hitFront || this.shootBall.collidedBall.color == src.Ball.COLOR_VISE) {
v3.firstSegment.insertBallBeside(this.shootBall.ball, this.shootBall.collidedBall, 0);
} else {
v3.firstSegment.insertBallBeside(this.shootBall.ball, this.shootBall.collidedBall, 1);
}
}
this.shootBall = undefined;
}
}
if (this.shootBall != undefined) {
this.shootBall.tick();
if (this.shootBall.y < -32) {
this.level.multiMatchCount = 0;
this.shootBall.ball.remove();
this.shootBall = undefined;
this.reload();
}
}
};
v2.gemGotten = function () {
this.gotGem = true;
};
v2.tick = function (tick) {
if (this.skipTicks != 1) {
if (this.level.won && this.scoreSignDelay == 1) {
return undefined;
}
if (_global.shortGameMode && this.currentLevel > 1) {
if (this.signDelay == 0) {
++this.levelTicks;
}
if (this.levelTicks == 72) {
this.level.lost = true;
this.communicator.sendGameLost(this.currentTick, this.score - this.level.startScore);
_root.gotya.gameOverScore(Number(this.score));
this.communicator.gameEnd(this.score);
this.finalScore = true;
(src.Sounds.get('sndGameOver')).playOffsVolPan(0, 100, 0);
this.levelPopup._visible = true;
this.fillLevelPopupData(_global.textMappings.nag_title, false);
this.levelPopup.gameOverText = _global.textMappings.nag_text;
this.levelPopup.gotoAndStop(3);
this.scoreSignDelay = 360;
this.levelPopup.timerText = (_global.textMappings.game_ends_in.split('[0]')).join('' + int((this.scoreSignDelay + 22) / 24));
}
}
if (this.currentTick % 120 == 0) {
this.communicator.sendSyncScore(this.currentTick, this.score);
}
var v6 = int(this.shooter.x.get(1));
if (this.DEBUG_REPLAY) {
v6 = -1000;
this.clicked = false;
this.keyPressed = false;
var v5 = 0;
while (v5 < src.DebugData.data.length) {
var v4 = src.DebugData.data[v5];
var v7 = v4[1];
if (this.currentTick == v7) {
if (v4[0] == 'click') {
v6 = v4[2];
this.clicked = true;
}
if (v4[0] == 'getgem') {
v6 = v4[2];
}
if (v4[0] == 'keypress') {
this.keyPressed = true;
}
}
++v5;
}
}
if (this.clicked) {
this.communicator.sendClick(this.currentTick, v6);
this.processPress(v6);
this.clicked = false;
}
if (this.keyPressed) {
this.communicator.sendKeyPress(this.currentTick);
(src.Sounds.get('sndSwapBall')).playOffsVolPan(0, 100, (v6 - 377) / src.Luxor.PAN_DAMP);
this.level.swapBalls();
this.keyPressed = false;
}
if (this.ticksLeft < src.Luxor.TIME_WARNING_TIME || this.level.hasWarning()) {
this.startWarningSound();
} else {
this.stopWarningSound();
}
if (this.signDelay > 0) {
--this.signDelay;
if (this.signDelay == 0) {
v5 = 0;
while (v5 < this.level.tracks.length) {
var v8 = this.level.tracks[v5];
this.newTrain(v8);
++v5;
}
this.levelPopup._visible = false;
}
} else {
if (_global.relaxMode) {
this.timeLeft = '--';
} else {
if (this.ticksLeft > 0 && !this.level.lost && !this.level.won) {
--this.ticksLeft;
var v9 = int((this.ticksLeft + 23) / 24);
var v10 = int(v9 / 60);
v9 %= 60;
this.timeLeft = v10 + ':' + (v9 >= 10 ? '' : '0') + v9;
if (this.ticksLeft == 0) {
this.level.lose();
}
}
}
this.level.tick();
this.level.tickWarning(this.ticksLeft / src.Luxor.TIME_WARNING_TIME);
if (this.wantsBall) {
if (this.level.currentBallColor >= 0 && this.shooter.ball == undefined) {
(src.Sounds.get('sndReloadBall')).playOffsVolPan(0, 100, (v6 - 377) / src.Luxor.PAN_DAMP);
this.shooter.ball = this.newBall(this.level.currentBallColor);
this.shooter.ball.mc.swapDepths(this.shooter.getDepth() + 1);
} else {
if (this.shooter.ball != undefined) {
if (this.level.currentBallColor < 0) {
this.shooter.ball.remove();
this.shooter.ball = undefined;
} else {
this.shooter.ball.setColor(this.level.currentBallColor);
}
}
}
}
}
this.shooter.preview.gotoAndStop(this.level.nextBallColor + 2);
this.tickGems(v6);
if (this.gotGem) {
this.communicator.sendGetGem(this.currentTick, v6);
this.gotGem = false;
}
this.shooter.tick();
this.tickShootBall();
if (this.level.lost || this.level.won || this.ticksLeft <= 0) {
this.stopWarningSound();
}
if (this.level.lost) {
if (this.scoreSignDelay == 0) {
this.communicator.sendGameLost(this.currentTick, this.score - this.level.startScore);
_root.gotya.gameOverScore(Number(this.score));
this.communicator.gameEnd(this.score);
this.finalScore = true;
(src.Sounds.get('sndGameOver')).playOffsVolPan(0, 100, 0);
this.levelPopup._visible = true;
this.fillLevelPopupData(_global.textMappings.game_over, false);
this.levelPopup.gotoAndStop(2);
this.scoreSignDelay = 360;
this.levelPopup.timerText = (_global.textMappings.game_ends_in.split('[0]')).join('' + int((this.scoreSignDelay + 22) / 24));
} else {
if (this.scoreSignDelay > 1) {
--this.scoreSignDelay;
if (this.scoreSignDelay == 1) {
this.communicator.gameQuit();
}
this.levelPopup.timerText = (_global.textMappings.game_ends_in.split('[0]')).join('' + int((this.scoreSignDelay + 22) / 24));
}
}
}
if (this.level.won && !this.level.lost && this.gems.length == 0 && this.level.winAnimationsDone()) {
if (this.scoreSignDelay == 0) {
this.communicator.sendLevelComplete(this.currentTick, this.score - this.level.startScore);
(src.Sounds.get('sndLevelComplete')).playOffsVolPan(0, 100, 0);
this.levelPopup._visible = true;
this.fillLevelPopupData(_global.textMappings.level_over, true);
this.levelPopup.gotoAndStop(2);
this.scoreSignDelay = 120;
this.levelPopup.timerText = (_global.textMappings.next_level_in.split('[0]')).join('' + int((this.scoreSignDelay + 22) / 24));
} else {
if (this.scoreSignDelay > 1) {
--this.scoreSignDelay;
if (this.scoreSignDelay == 1) {
this.nextLevel();
}
this.levelPopup.timerText = (_global.textMappings.next_level_in.split('[0]')).join('' + int((this.scoreSignDelay + 22) / 24));
}
}
}
++this.currentTick;
}
};
v2.gainScore = function (scoreToGain) {
if (this.finalScore) {
return undefined;
}
this.score = _root.gotya.checkandaddscore(this.score, scoreToGain);
};
v2.fillLevelPopupData = function (title, levelScore) {
this.levelPopup.titleText = title;
if (levelScore) {
this.levelPopup.levelScoreText = _global.textMappings.level_score + ' ' + (this.score - this.level.startScore);
} else {
this.levelPopup.levelScoreText = _global.textMappings.final_score + ' ' + this.score;
}
this.levelPopup.statNames1 = _global.textMappings.stat_shots_fired + '\r' + _global.textMappings.stat_coins_gotten + '\r' + _global.textMappings.stat_gems_gotten;
this.levelPopup.statVals1 = this.level.shotsFired + '\r' + this.level.coinsGotten + '\r' + this.level.gemsGotten;
this.levelPopup.statNames2 = _global.textMappings.stat_max_combo + '\r' + _global.textMappings.stat_max_chain + '\r' + _global.textMappings.stat_segments;
this.levelPopup.statVals2 = this.level.maxCombo + '\r' + this.level.maxChain + '\r' + this.level.segments;
};
v2.render = function (tick, alpha) {
this.progressMeter.mask._xScale = this.level.progress * 100;
while (getTimer() - this.lastFpsTime > 1000) {
this.lastFpsTime += 1000;
_root.fps = this.frames;
this.frames = 0;
}
this.level.render(alpha);
this.shooter.render(alpha);
var v3 = 0;
while (v3 < this.gems.length) {
this.gems[v3].render(alpha);
++v3;
}
if (this.shootBall != undefined) {
this.shootBall.render(alpha);
}
++this.frames;
};
v2.quitPressed = function () {
if (this.scoreSignDelay == 0 && this.signDelay == 0) {
this.level.lost = true;
this.communicator.sendGameEndPressed();
this.communicator.sendGameLost(this.currentTick, this.score - this.level.startScore);
_root.gotya.gameOverScore(Number(this.score));
this.communicator.gameEnd(this.score);
this.finalScore = true;
this.levelPopup._visible = true;
this.fillLevelPopupData(_global.textMappings.game_over, false);
this.levelPopup.gotoAndStop(2);
this.scoreSignDelay = 360;
}
};
v2.toggleSound = function () {
src.Sounds.toggleSound();
};
v2.DEBUG_MODE = false;
v2.DEBUG_REPLAY = false;
v2.isInstructions = false;
v2.loadLevelAt = -1;
v2.DEBUG_GAME_DATA = '<gamedata randomseed="' + random(10000) + '" timelimit="300" mode="long" relaxMode="false"> <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">Stars:</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">End of game</text> <text id="instructions_title">INSTRUCTIONS</text> <text id="instructions_text"></text> <text id="level_name_0">1</text> <text id="level_name_1">2</text> <text id="level_name_2">3</text> <text id="level_name_3">4</text> <text id="level_name_4">5</text> <text id="level_name_5">6</text> <text id="level_name_6">7</text> <text id="level_name_7">8</text> <text id="level_name_8">9</text> <text id="level_name_9">10</text> <text id="level_name_10">11</text> <text id="level_name_11">12</text> <text id="level_name_12">13</text> <text id="level_name_13">14</text> <text id="level_name_14">15</text> <text id="level_name_15">16</text> <text id="level_name_16">17</text> <text id="level_name_17">18</text> <text id="level_name_18">19</text> <text id="level_name_19">20</text> <text id="level_name_20">21</text> <text id="level_name_21">22</text> <text id="level_name_22">23</text> <text id="level_name_23">24</text> <text id="level_name_24">25</text> <text id="level_name_25">26</text> <text id="level_name_26">27</text> <text id="level_name_27">28</text> <text id="level_name_28">29</text> <text id="level_name_29">30</text> <text id="level_name_30">31</text> <text id="level_name_31">32</text> <text id="level_name_32">33</text> <text id="level_name_33">34</text> <text id="level_name_34">35</text> <text id="level_name_35">36</text> <text id="level_name_36">37</text> <text id="level_name_37">38</text> <text id="level_name_38">39</text> <text id="level_name_39">40</text> <text id="level_name_40">41</text> <text id="level_name_41">42</text> <text id="level_name_42">43</text> <text id="level_name_43">44</text> <text id="level_name_44">45</text> <text id="level_name_45">46</text> <text id="level_name_46">47</text> <text id="level_name_47">48</text> <text id="level_name_48">49</text> <text id="level_name_49">50</text></gamedata>';
v2.BALL_COUNT = 30;
v1.PAN_DAMP = 16;
v1.TIME_WARNING_TIME = 480;
v2.levelTicks = 0;
v2.lastFpsTime = getTimer();
v2.fps = 0;
v2.frames = 0;
v2.currentTick = 0;
v2.clicked = false;
v2.keyPressed = false;
v2.finalScore = false;
v2.levelName = '';
v2.score = 0;
v2.hasGameData = false;
v2.wantsBall = false;
v2.started = false;
v2.xmlLoaded = false;
v2.ticksLeft = 7200;
v2.timeLeft = '5:00';
v2.coinsGotten = 0;
v2.signDelay = 0;
v2.scoreSignDelay = 0;
v2.showingInstructions = false;
v1.MAP_NAMES = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50'];
v2.currentLevel = -1;
v2.skipTicks = 0;
v2.glowing = false;
v2.mapPointer = 0;
v2.loadSteps = 0;
v2.imagesLoaded = false;
v2.imageProcess = 0;
v2.domain = '';
v2.mapNum = 0;
v2.hasWarningSound = false;
v2.inputBuffer = '';
v2.scorePopupCount = 0;
v2.ballCount = 0;
v2.gemCount = 0;
v2.particleCount = 0;
v2.gotGem = false;
ASSetPropFlags(src.Luxor.prototype, null, 1);
}
#endinitclip
}
movieClip 924 __Packages.com.vascogames.as2.Gotya {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.vascogames) {
_global.com.vascogames = new Object();
}
if (!_global.com.vascogames.as2) {
_global.com.vascogames.as2 = new Object();
}
if (!_global.com.vascogames.as2.Gotya) {
var v1 = function () {
if (_root._url.indexOf('file://') == 0) {
this.debugMode = true;
}
this.debug('Api initialized V1.2');
};
com.vascogames.as2.Gotya = v1;
var v2 = v1.prototype;
v2.getMatchId = function () {
this.debug('Get match id');
if (_root.wedid > 0) {
return '' + _root.wedid * 1024;
} else {
return '' + int(Math.random() * 10000);
}
};
v2.debug = function (msg) {
if (this.debugMode) {
trace('Gotya API :: ' + msg);
}
};
v2.sendAwardcode = function (rcode) {
this.debug('Award code received: ' + rcode);
flash.external.ExternalInterface.call('vascogamesgas', rcode);
};
v2.sendScore = function (score) {
this.debug('Score received: ' + score + ' - ' + this.encryptScore(score) + ' ecrypt ' + this.md5(this.encryptScore(score)));
flash.external.ExternalInterface.call('vascogamessendcom', this.md5(this.encryptScore(score)), score);
};
v2.startGame = function () {
this.debug('Started Game');
flash.external.ExternalInterface.call('vascogamesstartcom', '1');
};
v2.gameOverScore = function (score) {
this.debug('Game over score received: ' + score + ' ');
flash.external.ExternalInterface.call('vascogamessendgocom', this.md5(this.encryptScore(score)), score);
};
v2.scoreError = function () {
this.debug('Error Score');
flash.external.ExternalInterface.call('vascogamesscerrorcom', '1');
};
v2.checkandaddscore = function (totalescore, score) {
totalescore = Number(totalescore);
score = Number(score);
var v3 = this.vgscoreold.split('-vg-');
v3 = v3[1];
this.debug('check ' + this.vgscoreold + ' - ' + totalescore + ' - ' + score + ' spiltest ' + v3);
if (String(v3) == String(totalescore)) {
totalescore += score;
this.vgscoreold = '-vg-' + String(totalescore) + '-vg-';
this.sendScore(Number(totalescore));
return totalescore;
}
this.scoreError();
return Number(v3);
return totalescore;
};
v2.encryptScore = function (score) {
var v5 = score.toString();
this.encryptedScore = '';
var v2 = 0;
while (v2 < v5.length) {
var v3 = v5.charAt(v2);
var v4 = this.digitsArray[0][v3];
this.encryptedScore += v4;
++v2;
}
return this.encryptedScore;
};
v2.md5 = function (s) {
return this.binl2hex(this.core_md5(this.str2binl(s), s.length * this.chrsz));
};
v2.core_md5 = function (x, len) {
x[len >> 5] |= 128 << len % 32;
x[(len + 64 >>> 9 << 4) + 14] = len;
var v5 = 1732584193;
var v4 = -271733879;
var v3 = -1732584194;
var v2 = 271733878;
var v6 = 0;
while (v6 < x.length) {
var v11 = v5;
var v10 = v4;
var v9 = v3;
var v8 = v2;
v5 = this.md5_ff(v5, v4, v3, v2, x[v6 + 0], 7, -680876936);
v2 = this.md5_ff(v2, v5, v4, v3, x[v6 + 1], 12, -389564586);
v3 = this.md5_ff(v3, v2, v5, v4, x[v6 + 2], 17, 606105819);
v4 = this.md5_ff(v4, v3, v2, v5, x[v6 + 3], 22, -1044525330);
v5 = this.md5_ff(v5, v4, v3, v2, x[v6 + 4], 7, -176418897);
v2 = this.md5_ff(v2, v5, v4, v3, x[v6 + 5], 12, 1200080426);
v3 = this.md5_ff(v3, v2, v5, v4, x[v6 + 6], 17, -1473231341);
v4 = this.md5_ff(v4, v3, v2, v5, x[v6 + 7], 22, -45705983);
v5 = this.md5_ff(v5, v4, v3, v2, x[v6 + 8], 7, 1770035416);
v2 = this.md5_ff(v2, v5, v4, v3, x[v6 + 9], 12, -1958414417);
v3 = this.md5_ff(v3, v2, v5, v4, x[v6 + 10], 17, -42063);
v4 = this.md5_ff(v4, v3, v2, v5, x[v6 + 11], 22, -1990404162);
v5 = this.md5_ff(v5, v4, v3, v2, x[v6 + 12], 7, 1804603682);
v2 = this.md5_ff(v2, v5, v4, v3, x[v6 + 13], 12, -40341101);
v3 = this.md5_ff(v3, v2, v5, v4, x[v6 + 14], 17, -1502002290);
v4 = this.md5_ff(v4, v3, v2, v5, x[v6 + 15], 22, 1236535329);
v5 = this.md5_gg(v5, v4, v3, v2, x[v6 + 1], 5, -165796510);
v2 = this.md5_gg(v2, v5, v4, v3, x[v6 + 6], 9, -1069501632);
v3 = this.md5_gg(v3, v2, v5, v4, x[v6 + 11], 14, 643717713);
v4 = this.md5_gg(v4, v3, v2, v5, x[v6 + 0], 20, -373897302);
v5 = this.md5_gg(v5, v4, v3, v2, x[v6 + 5], 5, -701558691);
v2 = this.md5_gg(v2, v5, v4, v3, x[v6 + 10], 9, 38016083);
v3 = this.md5_gg(v3, v2, v5, v4, x[v6 + 15], 14, -660478335);
v4 = this.md5_gg(v4, v3, v2, v5, x[v6 + 4], 20, -405537848);
v5 = this.md5_gg(v5, v4, v3, v2, x[v6 + 9], 5, 568446438);
v2 = this.md5_gg(v2, v5, v4, v3, x[v6 + 14], 9, -1019803690);
v3 = this.md5_gg(v3, v2, v5, v4, x[v6 + 3], 14, -187363961);
v4 = this.md5_gg(v4, v3, v2, v5, x[v6 + 8], 20, 1163531501);
v5 = this.md5_gg(v5, v4, v3, v2, x[v6 + 13], 5, -1444681467);
v2 = this.md5_gg(v2, v5, v4, v3, x[v6 + 2], 9, -51403784);
v3 = this.md5_gg(v3, v2, v5, v4, x[v6 + 7], 14, 1735328473);
v4 = this.md5_gg(v4, v3, v2, v5, x[v6 + 12], 20, -1926607734);
v5 = this.md5_hh(v5, v4, v3, v2, x[v6 + 5], 4, -378558);
v2 = this.md5_hh(v2, v5, v4, v3, x[v6 + 8], 11, -2022574463);
v3 = this.md5_hh(v3, v2, v5, v4, x[v6 + 11], 16, 1839030562);
v4 = this.md5_hh(v4, v3, v2, v5, x[v6 + 14], 23, -35309556);
v5 = this.md5_hh(v5, v4, v3, v2, x[v6 + 1], 4, -1530992060);
v2 = this.md5_hh(v2, v5, v4, v3, x[v6 + 4], 11, 1272893353);
v3 = this.md5_hh(v3, v2, v5, v4, x[v6 + 7], 16, -155497632);
v4 = this.md5_hh(v4, v3, v2, v5, x[v6 + 10], 23, -1094730640);
v5 = this.md5_hh(v5, v4, v3, v2, x[v6 + 13], 4, 681279174);
v2 = this.md5_hh(v2, v5, v4, v3, x[v6 + 0], 11, -358537222);
v3 = this.md5_hh(v3, v2, v5, v4, x[v6 + 3], 16, -722521979);
v4 = this.md5_hh(v4, v3, v2, v5, x[v6 + 6], 23, 76029189);
v5 = this.md5_hh(v5, v4, v3, v2, x[v6 + 9], 4, -640364487);
v2 = this.md5_hh(v2, v5, v4, v3, x[v6 + 12], 11, -421815835);
v3 = this.md5_hh(v3, v2, v5, v4, x[v6 + 15], 16, 530742520);
v4 = this.md5_hh(v4, v3, v2, v5, x[v6 + 2], 23, -995338651);
v5 = this.md5_ii(v5, v4, v3, v2, x[v6 + 0], 6, -198630844);
v2 = this.md5_ii(v2, v5, v4, v3, x[v6 + 7], 10, 1126891415);
v3 = this.md5_ii(v3, v2, v5, v4, x[v6 + 14], 15, -1416354905);
v4 = this.md5_ii(v4, v3, v2, v5, x[v6 + 5], 21, -57434055);
v5 = this.md5_ii(v5, v4, v3, v2, x[v6 + 12], 6, 1700485571);
v2 = this.md5_ii(v2, v5, v4, v3, x[v6 + 3], 10, -1894986606);
v3 = this.md5_ii(v3, v2, v5, v4, x[v6 + 10], 15, -1051523);
v4 = this.md5_ii(v4, v3, v2, v5, x[v6 + 1], 21, -2054922799);
v5 = this.md5_ii(v5, v4, v3, v2, x[v6 + 8], 6, 1873313359);
v2 = this.md5_ii(v2, v5, v4, v3, x[v6 + 15], 10, -30611744);
v3 = this.md5_ii(v3, v2, v5, v4, x[v6 + 6], 15, -1560198380);
v4 = this.md5_ii(v4, v3, v2, v5, x[v6 + 13], 21, 1309151649);
v5 = this.md5_ii(v5, v4, v3, v2, x[v6 + 4], 6, -145523070);
v2 = this.md5_ii(v2, v5, v4, v3, x[v6 + 11], 10, -1120210379);
v3 = this.md5_ii(v3, v2, v5, v4, x[v6 + 2], 15, 718787259);
v4 = this.md5_ii(v4, v3, v2, v5, x[v6 + 9], 21, -343485551);
v5 = this.safe_add(v5, v11);
v4 = this.safe_add(v4, v10);
v3 = this.safe_add(v3, v9);
v2 = this.safe_add(v2, v8);
v6 += 16;
}
return Array(v5, v4, v3, v2);
};
v2.md5_cmn = function (q, a, b, x, s, t) {
return this.safe_add(this.bit_rol(this.safe_add(this.safe_add(a, q), this.safe_add(x, t)), s), b);
};
v2.md5_ff = function (a, b, c, d, x, s, t) {
return this.md5_cmn(b & c | ~b & d, a, b, x, s, t);
};
v2.md5_gg = function (a, b, c, d, x, s, t) {
return this.md5_cmn(b & d | c & ~d, a, b, x, s, t);
};
v2.md5_hh = function (a, b, c, d, x, s, t) {
return this.md5_cmn(b ^ c ^ d, a, b, x, s, t);
};
v2.md5_ii = function (a, b, c, d, x, s, t) {
return this.md5_cmn(c ^ (b | ~d), a, b, x, s, t);
};
v2.safe_add = function (x, y) {
var v1 = new Number((x & 65535) + (y & 65535));
var v2 = new Number((x >> 16) + (y >> 16) + (v1 >> 16));
return v2 << 16 | v1 & 65535;
};
v2.bit_rol = function (num, cnt) {
return num << cnt | num >>> 32 - cnt;
};
v2.str2binl = function (str) {
var v4 = new Array();
var v5 = (1 << this.chrsz) - 1;
var v2 = 0;
while (v2 < str.length * this.chrsz) {
v4[v2 >> 5] |= (str.charCodeAt(v2 / this.chrsz) & v5) << v2 % 32;
v2 += this.chrsz;
}
return v4;
};
v2.binl2str = function (bin) {
var v4 = new String('');
var v5 = (1 << this.chrsz) - 1;
var v2 = 0;
while (v2 < bin.length * 32) {
v4 += String.fromCharCode(bin[v2 >> 5] >>> v2 % 32 & v5);
v2 += this.chrsz;
}
return v4;
};
v2.binl2hex = function (binarray) {
var v3 = '0123456789abcdef';
var v4 = new String('');
var v1 = 0;
while (v1 < binarray.length * 4) {
v4 += v3.charAt(binarray[v1 >> 2] >> (v1 % 4) * 8 + 4 & 15) + v3.charAt(binarray[v1 >> 2] >> (v1 % 4) * 8 & 15);
++v1;
}
return v4;
};
v2.debugMode = false;
v2.vgscoreold = '-vg-0-vg-';
v2.firstDigitArray = ['10f85au', '11kt50e', '12cmt5s2', '13v507', '14fc5i3', '1556f7l', '167gj81', '17yn90y', '185o3ko', '19ntakn'];
v2.digitsArray = [com.vascogames.as2.Gotya.prototype.firstDigitArray];
v2.b64pad = new String('');
v2.chrsz = new Number(8);
ASSetPropFlags(com.vascogames.as2.Gotya.prototype, null, 1);
}
#endinitclip
}
movieClip 925 __Packages.src.util.Random {
#initclip
if (!_global.src) {
_global.src = new Object();
}
if (!_global.src.util) {
_global.src.util = new Object();
}
if (!_global.src.util.Random) {
var v1 = function (aSeed) {
this.mta = new Array(src.util.Random.N);
this.mti = src.util.Random.N + 1;
if (aSeed != undefined) {
this.init_genrand(aSeed);
}
};
src.util.Random = v1;
var v2 = v1.prototype;
v2.__set__seed = function (s) {
this.init_genrand(s);
return this.__get__seed();
};
v2.__get__seed = function () {
return this.lastSeed;
};
v2.nextInt = function (n) {
return (this.genrand_int32() & 2147483647) % n;
};
v2.nextFloat = function () {
return this.next(24) / 16777216;
};
v2.nextDouble = function () {
return this.next(24) / 16777216;
};
v2.next = function (bits) {
if (bits < 32) {
return this.genrand_int32() & (1 << bits) - 1;
}
return this.genrand_int32();
};
v2.init_genrand = function (s) {
s = int(s);
trace('Random::init_genrand(): seed=' + s);
var v7 = getTimer();
this.lastSeed = s;
this.mta[0] = s;
var v3 = s;
var v2 = new src.util.Integer64();
var v4 = src.util.Random.N;
this.mti = 1;
while (this.mti < v4) {
v2.init32(v3 >>> 30 ^ v3);
v2.mulu32(1812433253);
this.mta[this.mti] = int(v2.lsb + this.mti);
v3 = this.mta[this.mti];
++this.mti;
}
var v6 = getTimer();
trace('Random::init_genrand(): initialization ~' + (v6 - v7) + 'ms');
};
v2.genrand_int32 = function () {
var v9 = src.util.Random.N;
var v3 = 0;
if (this.mti >= v9) {
if (this.mti == v9 + 1) {
this.init_genrand(5489);
}
var v8 = src.util.Random.M;
var v5 = src.util.Random.UPPER_MASK;
var v7 = src.util.Random.LOWER_MASK;
var v6 = src.util.Random.mag01;
var v12 = getTimer();
var v2 = 0;
var v4 = v9 - v8;
var v10 = v8 - v9;
v2 = 0;
while (v2 < v4) {
v3 = this.mta[v2] & v5 | this.mta[v2 + 1] & v7;
this.mta[v2] = this.mta[v2 + v8] ^ v3 >>> 1 ^ v6[v3 & 1];
++v2;
}
v4 = v9 - 1;
v2 = v2;
while (v2 < v4) {
v3 = this.mta[v2] & v5 | this.mta[v2 + 1] & v7;
this.mta[v2] = this.mta[v2 + v10] ^ v3 >>> 1 ^ v6[v3 & 1];
++v2;
}
v3 = this.mta[v9 - 1] & v5 | this.mta[0] & v7;
this.mta[v9 - 1] = this.mta[v8 - 1] ^ v3 >>> 1 ^ v6[v3 & 1];
this.mti = 0;
var v11 = getTimer();
trace('Random::genrand_int32(): precalc ' + v9 + ' new numbers ~' + (v11 - v12) + 'ms');
}
v3 = this.mta[this.mti++];
v3 ^= v3 >>> 11;
v3 ^= v3 << 7 & 2636928640.0;
v3 ^= v3 << 15 & 4022730752.0;
v3 ^= v3 >>> 18;
return v3;
};
v1.N = 624;
v1.M = 397;
v1.MATRIX_A = 2567483615.0;
v1.UPPER_MASK = 2147483648.0;
v1.LOWER_MASK = 2147483647;
v1.mag01 = [0, 2567483615.0];
v2.addProperty('seed', v2.__get__seed, v2.__set__seed);
ASSetPropFlags(src.util.Random.prototype, null, 1);
}
#endinitclip
}
movieClip 926 __Packages.src.util.Integer64 {
#initclip
if (!_global.src) {
_global.src = new Object();
}
if (!_global.src.util) {
_global.src.util = new Object();
}
if (!_global.src.util.Integer64) {
var v1 = function (lowInt) {
this.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]];
this.p = [0, 0, 0, 0, 0];
this.s = [0, 0, 0];
if (lowInt != undefined) {
this.merge(lowInt);
}
};
src.util.Integer64 = v1;
var v2 = v1.prototype;
v2.init = function (v) {
var v2 = 0;
for (;;) {
if (v2 >= this.p.length) {
return undefined;
}
this.p[v2] = v.p[v2];
++v2;
}
};
v2.init32 = function (n) {
this.p[0] = n & 32767;
n >>>= 15;
this.p[1] = n & 32767;
n >>>= 15;
this.p[2] = n & 3;
this.p[3] = 0;
this.p[4] = 0;
};
v2.__get__lsb = function () {
return this.p[0] | this.p[1] << src.util.Integer64.SH | (this.p[2] & 3) << 30;
};
v2.__get__msb = function () {
return this.p[2] >> 2 | this.p[3] << src.util.Integer64.SH >> 2 | this.p[4] << src.util.Integer64.SH * 2 >> 2 & 2147483647;
};
v2.binaryShiftLeft = function (step) {
var v2 = 0;
for (;;) {
if (v2 >= step) {
return undefined;
}
this.shl();
++v2;
}
};
v2.binaryShiftRight = function (step) {
var v3 = step / src.util.Integer64.SH >> 0;
var v5 = step - v3 * src.util.Integer64.SH;
var v4 = this.p.length - 1;
while (v4 > 0) {
var v2 = 0;
while (v2 < v3) {
this.p[v2] = this.p[v2 + 1];
++v2;
}
this.p[v4--] = 0;
}
if (v5 > 0) {
v2 = 0;
for (;;) {
if (v2 >= v5) {
return undefined;
}
this.shr();
++v2;
}
}
};
v2.binaryNot = function (o) {
this.p[0] ^= o.p[0];
this.p[1] ^= o.p[1];
this.p[2] ^= o.p[2];
this.p[3] ^= o.p[3];
this.p[4] ^= o.p[4];
};
v2.add64 = function (o) {
var v3 = 0;
var v4 = 1;
var v2 = 0;
v4 = v4;
for (;;) {
if (!(v4 < this.p.length && o.p[v2] != 0)) break;
++v4;
}
v2 = 0;
for (;;) {
if (v2 >= v4) {
return undefined;
}
v3 += this.p[v2] + o.p[v2];
this.p[v2] = v3 & src.util.Integer64.MASK;
v3 >>= src.util.Integer64.SH;
++v2;
}
};
v2.add32 = function (num) {
var v2 = 0;
var v5 = num & src.util.Integer64.MASK;
num >>= src.util.Integer64.SH;
var v4 = num & src.util.Integer64.MASK;
num >>= src.util.Integer64.SH;
var v6 = num & 3;
v2 += this.p[0] + v5;
this.p[0] = v2 & src.util.Integer64.MASK;
v2 >>= src.util.Integer64.SH;
v2 += this.p[1] + v4;
this.p[1] = v2 & src.util.Integer64.MASK;
v2 >>= src.util.Integer64.SH;
v2 += this.p[2] + v6;
this.p[2] = v2 & src.util.Integer64.MASK;
};
v2.mulu32 = function (num) {
var v2 = 0;
this.s[0] = num & src.util.Integer64.MASK;
num >>>= 15;
this.s[1] = num & src.util.Integer64.MASK;
num >>>= 15;
this.s[2] = num & 3;
var v3 = 0;
while (v3 < 3) {
var v4 = this.s[v3];
v2 = v4 * this.p[0];
this.r[v3][0] = v2 & src.util.Integer64.MASK;
v2 >>= src.util.Integer64.SH;
v2 += v4 * this.p[1];
this.r[v3][1] = v2 & src.util.Integer64.MASK;
v2 >>= src.util.Integer64.SH;
v2 += v4 * this.p[2];
this.r[v3][2] = v2 & 3;
++v3;
}
v2 = this.r[0][0];
this.p[0] = v2 & src.util.Integer64.MASK;
v2 >>= src.util.Integer64.SH;
v2 += this.r[0][1] + this.r[1][0];
this.p[1] = v2 & src.util.Integer64.MASK;
v2 >>= src.util.Integer64.SH;
v2 += this.r[0][2] + this.r[1][1] + this.r[2][0];
this.p[2] = v2 & 3;
this.p[3] = 0;
this.p[4] = 0;
};
v2.mul64 = function (o) {
var v2 = 0;
var v3 = 0;
while (v3 < 5) {
var v4 = o.p[v3];
v2 = v4 * this.p[0];
this.r[v3][0] = v2 & src.util.Integer64.MASK;
v2 >>= src.util.Integer64.SH;
v2 += v4 * this.p[1];
this.r[v3][1] = v2 & src.util.Integer64.MASK;
v2 >>= src.util.Integer64.SH;
v2 += v4 * this.p[2];
this.r[v3][2] = v2 & src.util.Integer64.MASK;
v2 >>= src.util.Integer64.SH;
v2 += v4 * this.p[3];
this.r[v3][3] = v2 & src.util.Integer64.MASK;
v2 >>= src.util.Integer64.SH;
v2 += v4 * this.p[4];
this.r[v3][4] = v2 & src.util.Integer64.MASK;
++v3;
}
v2 = this.r[0][0];
this.p[0] = v2 & src.util.Integer64.MASK;
v2 >>= src.util.Integer64.SH;
v2 += this.r[0][1] + this.r[1][0];
this.p[1] = v2 & src.util.Integer64.MASK;
v2 >>= src.util.Integer64.SH;
v2 += this.r[0][2] + this.r[1][1] + this.r[2][0];
this.p[2] = v2 & src.util.Integer64.MASK;
v2 >>= src.util.Integer64.SH;
v2 += this.r[0][3] + this.r[1][2] + this.r[2][1] + this.r[3][0];
this.p[3] = v2 & src.util.Integer64.MASK;
v2 >>= src.util.Integer64.SH;
v2 += this.r[0][4] + this.r[1][3] + this.r[2][2] + this.r[3][1] + this.r[4][0];
this.p[4] = v2 & 7;
};
v2.mul32 = function (value) {
this.mul64(new src.util.Integer64(value));
};
v2.merge = function (a) {
var v2 = 0;
while (v2 < 3) {
this.p[v2] += a & 32767;
a >>>= 15;
++v2;
}
return a;
};
v2.shl = function () {
var v3 = 0;
var v4 = 0;
var v2 = 0;
var v5 = this.p.length;
for (;;) {
if (v2 >= v5) {
return undefined;
}
v3 = (this.p[v2] & 16384) >> 14;
this.p[v2] <<= 1;
this.p[v2] |= v4 & 32767;
++v2;
v4 = v3;
}
};
v2.shr = function () {
var v3 = 0;
var v4 = 0;
var v2 = this.p.length - 1;
for (;;) {
if (v2 < 0) {
return undefined;
}
v3 = (this.p[v2] & 1) << 14;
this.p[v2] >>= 1;
this.p[v2] |= v4 & 32767;
--v2;
v4 = v3;
}
};
v1.MASK = 32767;
v1.SH = 15;
v2.addProperty('lsb', v2.__get__lsb, function () {});
v2.addProperty('msb', v2.__get__msb, function () {});
ASSetPropFlags(src.util.Integer64.prototype, null, 1);
}
#endinitclip
}
movieClip 927 __Packages.mx.utils.Delegate {
#initclip
if (!_global.mx) {
_global.mx = new Object();
}
if (!_global.mx.utils) {
_global.mx.utils = new Object();
}
if (!_global.mx.utils.Delegate) {
var v1 = function (f) {
super();
this.func = f;
};
mx.utils.Delegate = v1;
mx.utils.Delegate extends Object;
var v2 = v1.prototype;
v1.create = function (obj, func) {
var v2 = function () {
var v2 = arguments.callee.target;
var v3 = arguments.callee.func;
return v3.apply(v2, arguments);
};
v2.target = obj;
v2.func = func;
return v2;
};
v2.createDelegate = function (obj) {
return mx.utils.Delegate.create(obj, this.func);
};
ASSetPropFlags(mx.utils.Delegate.prototype, null, 1);
}
#endinitclip
}
movieClip 928 __Packages.src.InstructionsReplayer {
#initclip
if (!_global.src) {
_global.src = new Object();
}
if (!_global.src.InstructionsReplayer) {
var v1 = function (luxor) {
src.Sounds.noSounds = true;
this.luxor = luxor;
this.ballLayer = _root.startupPanel.mc.createEmptyMovieClip('ballLayer', 0);
this.orgBallLayer = luxor.ballLayer;
luxor.ballLayer = this.ballLayer;
this.ballShootDelay = 12;
luxor.shooter = this.ballLayer.attachMovie('Shooter', 'shooter', 4999);
luxor.shooter._x = 500;
luxor.shooter._y = 550;
this.random = new src.util.Random(512);
var v4 = new Array();
v4.push('WePh0We9U0mX9U0mX9b0');
luxor.level = new src.Level(luxor, v4, 0, this.random);
luxor.level.startScore = 0;
luxor.communicator.disable();
luxor.newTrain(luxor.level.tracks[0]);
this.timer = new src.timing.Timer(this, 24);
luxor.level.nextBall();
this.xt = this.random.nextFloat() * 355 + 200;
luxor.gems = new Array();
luxor.isInstructions = true;
};
src.InstructionsReplayer = v1;
var v2 = v1.prototype;
_global.src.InstructionsReplayer implements _global.src.timing.Timeable;
v2.reload = function () {
this.luxor.shooter.ball = this.luxor.newBall(this.luxor.level.currentBallColor);
this.luxor.shooter.ball.mc.swapDepths(this.luxor.shooter.getDepth() + 1);
this.luxor.shooter.ball.gotoAndStop(this.luxor.level.currentBallColor + 2);
this.luxor.shooter.preview.gotoAndStop(this.luxor.level.nextBallColor + 2);
};
v2.dispose = function () {
src.Sounds.noSounds = false;
this.luxor.isInstructions = false;
this.luxor.gemRandom = new src.util.Random(this.luxor.orgGemRandomSeed);
this.luxor.communicator.enable();
this.ballLayer.removeMovieClip();
this.luxor.ballLayer = this.orgBallLayer;
};
v2.onEnterFrame = function () {
this.timer.advanceTime();
};
v2.tick = function (tick) {
var v2 = this.luxor.shooter.x.get(1);
this.luxor.level.tick();
this.luxor.tickGems(v2);
this.xd *= 0.92;
this.xd += (this.xt - v2) * 0.01;
if (this.xd < -10) {
this.xd = -10;
}
if (this.xd > 10) {
this.xd = 10;
}
v2 += this.xd;
this.luxor.shooter.x.set(v2);
this.luxor.tickShootBall();
if (this.luxor.shooter.ball == undefined && this.luxor.shootBall == undefined) {
this.reload();
return undefined;
}
if (this.luxor.shooter.ball != undefined) {
--this.ballShootDelay;
if (this.ballShootDelay <= 0) {
++this.shotBalls;
if (this.shotBalls == 11) {
this.luxor.shootBall = new src.ShootBall(this.luxor.shooter.ball, this.luxor.shooter.x.get(1), 536, false);
this.luxor.shooter.ball = undefined;
this.luxor.level.nextBall();
}
this.xt = this.random.nextFloat() * 355 + 200;
this.ballShootDelay = this.random.nextInt(12) + 12;
}
}
};
v2.render = function (tick, alpha) {
this.luxor.level.render(alpha);
this.luxor.shooter.render(alpha);
var v2 = 0;
while (v2 < this.luxor.gems.length) {
this.luxor.gems[v2].render(alpha);
++v2;
}
if (this.luxor.shootBall != undefined) {
this.luxor.shootBall.render(alpha);
}
};
v2.shotBalls = 0;
v2.xd = 0;
ASSetPropFlags(src.InstructionsReplayer.prototype, null, 1);
}
#endinitclip
}
movieClip 929 __Packages.src.Sounds {
#initclip
if (!_global.src) {
_global.src = new Object();
}
if (!_global.src.Sounds) {
var v1 = function (ownerMc, soundName) {
var v2 = ownerMc.getNextHighestDepth();
this.soundMc = ownerMc.createEmptyMovieClip('soundMcc' + v2, v2);
this.sound = new Sound(this.soundMc);
this.sound.attachSound(soundName);
};
src.Sounds = v1;
var v2 = v1.prototype;
v1.get = function (resourceName) {
var v2 = src.Sounds.soundMap[resourceName];
if (v2 == undefined || v2 == null) {
v2 = new src.Sounds(_root, resourceName);
src.Sounds.soundMap[resourceName] = v2;
}
return v2;
};
v1.toggleSound = function () {
if (src.Sounds.globalSound == undefined) {
src.Sounds.globalSound = new Sound(_root);
}
src.Sounds.soundOn = !src.Sounds.soundOn;
src.Sounds.globalSound.setVolume(src.Sounds.soundOn ? 100 : 0);
};
v2.setVolume = function (volume) {
this.sound.setVolume(volume);
};
v2.playLooping = function () {
if (src.Sounds.noSounds) {
return undefined;
}
this.sound.start(0, 9999999);
};
v2.stopAndPlayOffs = function (offs) {
if (src.Sounds.noSounds) {
return undefined;
}
this.sound.stop();
this.sound.start(offs, 0);
};
v2.stopAndPlay = function () {
if (src.Sounds.noSounds) {
return undefined;
}
this.sound.stop();
this.sound.start(0);
};
v2.playOffs = function (offs) {
if (src.Sounds.noSounds) {
return undefined;
}
this.sound.start(offs, 0);
};
v2.playOffsVolPan = function (offs, vol, pan) {
if (src.Sounds.noSounds) {
return undefined;
}
this.sound.start(offs, 0);
this.sound.setVolume(vol);
this.sound.setPan(pan);
};
v2.play = function () {
if (src.Sounds.noSounds) {
return undefined;
}
this.sound.start(0);
};
v2.stop = function () {
this.sound.stop();
};
v1.soundMap = new Object();
v1.soundOn = true;
v1.noSounds = false;
ASSetPropFlags(src.Sounds.prototype, null, 1);
}
#endinitclip
}
movieClip 930 __Packages.src.Level {
#initclip
if (!_global.src) {
_global.src = new Object();
}
if (!_global.src.Level) {
var v1 = function (luxor, trackDatas, levelNum, random) {
this.possibleWeights = new Array(10);
var v2 = 0;
while (v2 < 10) {
this.possibleWeights[v2] = false;
++v2;
}
this.random = random;
this.levelNum = levelNum;
this.luxor = luxor;
this.tracks = new Array();
v2 = 0;
while (v2 < trackDatas.length) {
var v4 = new src.Track(luxor, this, trackDatas[v2]);
v4.random = new src.util.Random(random.nextInt(2147483647));
this.tracks.push(v4);
++v2;
}
this.powerupRandom = new src.util.Random(random.nextInt(2147483647));
this.runOdds = 300 - levelNum * 50;
if (this.runOdds < 50) {
this.runOdds = 50;
}
this.ballsToClear = 100 + levelNum * 20;
var v8 = 3 + int((levelNum + 1) / 2);
if (v8 > 7) {
v8 = 7;
}
v2 = 0;
while (v2 < 10) {
this.allowedColors[v2] = v2 < v8;
++v2;
}
v2 = 0;
while (v2 < 7) {
var v3 = random.nextInt(7 - v2) + v2;
var v5 = this.allowedColors[v3];
this.allowedColors[v3] = this.allowedColors[v2];
this.allowedColors[v2] = v5;
++v2;
}
this.colorCount = 0;
this.colors = new Array(10);
v2 = 0;
for (;;) {
if (v2 >= 10) {
return undefined;
}
if (this.allowedColors[v2]) {
this.colors[this.colorCount++] = v2;
}
++v2;
}
};
src.Level = v1;
var v2 = v1.prototype;
v2.getColorChain = function (length, random) {
if (random == undefined) {
random = this.random;
}
var v5 = new Array(length);
var v2 = -1;
var v3 = 0;
while (v3 < length) {
if (v2 == -1 || random.nextDouble() * 1000 > this.runOdds) {
v2 = this.randomColor(random);
}
v5[v3] = v2;
++v3;
}
return v5;
};
v2.randomColor = function (random) {
if (random == undefined) {
random = this.random;
}
return this.colors[random.nextInt(this.colorCount)];
};
v2.ballsCleared = function (count) {
this.clearedBalls += count;
var v2 = this.progress;
this.progress = this.clearedBalls / this.ballsToClear;
if (this.progress > 1) {
this.progress = 1;
}
if (v2 < 1 && this.progress >= 1) {
(src.Sounds.get('sndProgressComplete')).playOffsVolPan(0, 100, 0);
}
};
v2.collapsed = function (count, segment, offs, isShot) {
if (isShot) {
if (segment.track.chainReaction == 0) {
segment.track.chainReaction = 1;
}
++this.multiMatchCount;
if (this.multiMatchCount > this.maxCombo) {
this.maxCombo = this.multiMatchCount;
}
} else {
++segment.track.chainReaction;
if (segment.track.chainReaction > this.maxChain) {
this.maxChain = segment.track.chainReaction;
}
}
var v8 = count - 3;
if (v8 > 4) {
v8 = 4;
}
var v12 = segment.balls[offs + int(count / 2)];
var v13 = segment.balls[offs + int((count - 1) / 2)];
var v5 = (v12.x + v13.x) / 2;
var v7 = (v12.y + v13.y) / 2;
if (!isShot && segment.track.chainReaction > 0) {
if (segment.track.chainReaction % 3 == 0) {
this.spawnPowerup(v5, v7);
}
}
if (isShot && this.multiMatchCount > 0 && this.multiMatchCount % 3 == 0) {
this.spawnPowerup(v5, v7);
}
if (this.DEBUG_POWERUPS) {
this.spawnPowerup(v5, v7);
}
(src.Sounds.get('sndCollapse' + v8)).playOffsVolPan(0, 100, (v5 - 377) / src.Luxor.PAN_DAMP);
var v15 = v8 / 4;
if (count > 4 && this.random.nextDouble() < v15) {
(src.Sounds.get('sndCoinSpawn')).playOffsVolPan(0, 100, (v5 - 377) / src.Luxor.PAN_DAMP);
this.luxor.newCoin(v5, v7);
}
var v14 = 0;
if (isShot && this.multiMatchCount > 2) {
v14 = 100 * (this.multiMatchCount - 2);
}
var v6 = segment.track.chainReaction;
if (v6 == 0) {
v6 = 1;
}
var v11 = (count * 100 + v14) * v6;
var v4;
if (this.multiMatchCount <= 2 || !isShot || v6 == 1) {
v4 = '\r' + v11;
} else {
v4 = '' + v11;
}
if (this.multiMatchCount > 2 && isShot) {
v4 += '\r' + _global.textMappings.score_combo + ' X' + this.multiMatchCount;
}
if (v6 > 1) {
v4 += '\r' + _global.textMappings.score_chain + ' X' + v6;
}
this.luxor.newScorePopup(v5, v7, 16777215, v4);
this.luxor.gainScore(v11);
};
v2.spawnPowerup = function (x, y) {
(src.Sounds.get('sndPowerupSpawn')).playOffsVolPan(0, 100, x / 8);
var v2 = this.powerupRandom.nextInt(8);
if (this.DEBUG_POWERUPS) {
v2 = src.Gem.BONUS_LIGHTNING - 26;
}
if (v2 == 0) {
this.updateColorWeights();
this.luxor.newGem(x, y, 20 + this.nextColor());
return undefined;
}
this.luxor.newGem(x, y, 26 + v2);
};
v2.pickupColorBomb = function (color) {
var v2 = 0;
for (;;) {
if (v2 >= this.tracks.length) {
return undefined;
}
if (this.tracks[v2].firstSegment != undefined) {
this.tracks[v2].firstSegment.colorBomb(color);
}
++v2;
}
};
v2.pickupReverse = function () {
this.reverseTime = src.Level.MAX_REVERSE_TIME;
};
v2.pickupSlow = function () {
this.slowTime = src.Level.MAX_SLOW_TIME;
};
v2.pickupStop = function () {
this.stopTime = src.Level.MAX_STOP_TIME;
};
v2.pickupSpeedShot = function () {
this.speedShotTime = src.Level.MAX_SPEED_SHOT_TIME;
this.luxor.shooter.aimBeam._visible = true;
};
v2.pickupFireball = function () {
this.currentBallColor = src.Ball.COLOR_FIREBALL;
};
v2.pickupLightning = function () {
this.currentBallColor = src.Ball.COLOR_LIGHTNING;
};
v2.pickupWild = function () {
this.currentBallColor = src.Ball.COLOR_WILD;
};
v2.nextBall = function () {
this.currentBallColor = this.nextBallColor;
this.nextBallColor = this.nextColor();
};
v2.swapBalls = function () {
var v2 = this.nextBallColor;
this.nextBallColor = this.currentBallColor;
this.currentBallColor = v2;
};
v2.refreshBalls = function () {
if (this.currentBallColor < 10) {
this.currentBallColor = -1;
}
if (this.nextBallColor < 10) {
this.nextBallColor = -1;
}
this.checkColors();
};
v2.updateColorWeights = function () {
var v4 = false;
var v2 = 0;
while (v2 < this.tracks.length) {
if (this.tracks[v2].firstSegment != undefined) {
v4 = true;
}
++v2;
}
if (v4) {
this.colorWeights = new Array(10);
v2 = 0;
while (v2 < 10) {
this.colorWeights[v2] = 0;
++v2;
}
var v6 = false;
var v3 = 100000;
var v5 = 0;
v2 = 0;
while (v2 < this.tracks.length) {
if (this.tracks[v2].firstSegment != undefined && this.tracks[v2].firstSegment.isWarning()) {
if (this.tracks[v2].firstSegment.pos < v3) {
v3 = this.tracks[v2].firstSegment.pos;
v5 = v2;
v6 = true;
}
}
++v2;
}
v2 = 0;
while (v2 < this.tracks.length) {
if (this.tracks[v2].firstSegment != undefined) {
this.tracks[v2].firstSegment.getWeights(this.colorWeights);
}
++v2;
}
v2 = 0;
while (v2 < 10) {
this.possibleWeights[v2] = this.colorWeights[v2] > 0;
++v2;
}
if (v6) {
v2 = 0;
while (v2 < 10) {
this.colorWeights[v2] = 0;
++v2;
}
this.tracks[v5].firstSegment.getWarningWeights(this.colorWeights);
}
this.totalWeight = 0;
this.colorWeightsOffs = new Array(10);
v2 = 0;
for (;;) {
if (v2 >= 10) {
return undefined;
}
this.colorWeightsOffs[v2] = this.totalWeight;
this.totalWeight += this.colorWeights[v2];
++v2;
}
}
};
v2.checkColors = function () {
this.updateColorWeights();
this.currentBallColor = this.checkColor(this.currentBallColor);
this.nextBallColor = this.checkColor(this.nextBallColor);
};
v2.checkColor = function (col) {
if (col >= 10) {
return col;
}
if (col >= 0 && this.possibleWeights[col]) {
return col;
}
return this.nextColor();
};
v2.nextColor = function () {
var v4 = this.totalWeight <= 0 ? 0 : this.random.nextInt(this.totalWeight);
var v3 = 0;
var v2 = 0;
while (v2 < 10) {
if (this.colorWeightsOffs[v2] <= v4) {
v3 = v2;
}
++v2;
}
return v3;
};
v2.lose = function () {
this.lost = true;
this.currentBallColor = -1;
this.nextBallColor = -1;
};
v2.hasWarning = function () {
var v2 = 0;
while (v2 < this.tracks.length) {
if (this.tracks[v2].firstSegment != undefined && this.tracks[v2].firstSegment.isWarning()) {
return true;
}
++v2;
}
return false;
};
v2.tick = function () {
this.updateColorWeights();
var v5 = true;
var v3 = 0;
while (v3 < this.tracks.length) {
var v2 = this.tracks[v3];
if (!(v2.firstSegment == undefined && this.progress == 1)) {
v5 = false;
}
++v3;
}
if (this.won) {
v3 = 0;
while (v3 < this.tracks.length) {
this.tracks[v3].winTick();
++v3;
}
}
if (v5 && !this.won) {
this.won = true;
this.currentBallColor = -1;
this.nextBallColor = -1;
(src.Sounds.get('sndBonusScarabMove')).playLooping();
v3 = 0;
while (v3 < this.tracks.length) {
this.tracks[v3].startProgress(this.luxor.newBall(src.Ball.COLOR_WIN_VISE));
++v3;
}
}
if (this.won) {
if (this.winAnimationsDone()) {
(src.Sounds.get('sndBonusScarabMove')).stop();
}
}
v3 = 0;
while (v3 < this.tracks.length) {
v2 = this.tracks[v3];
if (!this.lost && this.progress < 1) {
if (v2.firstSegment == undefined) {
this.luxor.newTrain(v2);
this.refreshBalls();
} else {
var v4 = this.luxor.getLastSegment(v2);
if (v4.pos + v4.length * 32 < v2.length / 2) {
this.luxor.newTrain(v2);
}
}
}
v2.hasPossibleChain = false;
v2.firstSegment.preTick();
v2.firstSegment.tick();
if (!v2.hasPossibleChain) {
v2.chainReaction = 0;
}
if (v2.firstSegment.pos < 0) {
this.lose();
}
++v3;
}
if (!this.lost && !this.won) {
this.checkColors();
}
if (this.reverseTime > 0) {
--this.reverseTime;
}
if (this.slowTime > 0) {
--this.slowTime;
}
if (this.stopTime > 0) {
--this.stopTime;
}
if (this.speedShotTime > 0) {
--this.speedShotTime;
if (this.speedShotTime == 0) {
this.luxor.shooter.aimBeam._visible = false;
}
}
};
v2.tickWarning = function (timeWarningFactor) {
var v2 = 0;
for (;;) {
if (v2 >= this.tracks.length) {
return undefined;
}
var v3 = 1000;
if (this.tracks[v2].firstSegment != undefined) {
v3 = this.tracks[v2].firstSegment.getWarningFactor();
}
this.tracks[v2].warningLight.tick(timeWarningFactor, v3);
++v2;
}
};
v2.winAnimationsDone = function () {
var v2 = 0;
while (v2 < this.tracks.length) {
if (!this.tracks[v2].winAnimationsDone()) {
return false;
}
++v2;
}
return true;
};
v2.render = function (alpha) {
var v2 = 0;
while (v2 < this.tracks.length) {
var v3 = this.tracks[v2];
v3.firstSegment.render(alpha);
v3.warningLight.render(alpha);
++v2;
}
if (this.won) {
v2 = 0;
for (;;) {
if (v2 >= this.tracks.length) {
return undefined;
}
this.tracks[v2].winRender(alpha);
++v2;
}
}
};
v2.DEBUG_POWERUPS = false;
v1.MAX_REVERSE_TIME = 96;
v1.MAX_SLOW_TIME = 96;
v1.MAX_STOP_TIME = 96;
v1.MAX_SPEED_SHOT_TIME = 360;
v2.allowedColors = [true, true, true, true, false, false, false, false, false, false];
v2.multiMatchCount = 0;
v2.reverseTime = 0;
v2.slowTime = 0;
v2.stopTime = 0;
v2.speedShotTime = 0;
v2.currentBallColor = -1;
v2.nextBallColor = -1;
v2.lost = false;
v2.won = false;
v2.progress = 0;
v2.clearedBalls = 0;
v2.ballsToClear = 100;
v2.runOdds = 225;
v2.shotsFired = 0;
v2.coinsGotten = 0;
v2.gemsGotten = 0;
v2.maxCombo = 0;
v2.maxChain = 0;
v2.segments = 0;
v2.startScore = 0;
v2.insertStackDepth = 0;
ASSetPropFlags(src.Level.prototype, null, 1);
}
#endinitclip
}
movieClip 931 __Packages.src.AbstractTrack {
#initclip
if (!_global.src) {
_global.src = new Object();
}
if (!_global.src.AbstractTrack) {
var v1 = function () {};
src.AbstractTrack = v1;
var v2 = v1.prototype;
v2.setPoints = function (points) {
this.points = points;
var v6 = 0;
var v2 = 0;
while (v2 < points.length) {
var v5 = 0;
var v4 = 0;
if (v2 < points.length - 1) {
v5 = points[v2 + 1].x - points[v2].x;
v4 = points[v2 + 1].y - points[v2].y;
}
var v7 = Math.atan2(v4, v5);
points[v2].xd = v5;
points[v2].yd = v4;
points[v2].dir = v7 * 180 / Math.PI - 90;
points[v2].start = v6;
points[v2].len = Math.sqrt(v5 * v5 + v4 * v4);
points[v2].end = v6 + points[v2].len;
v6 = points[v2].end;
++v2;
}
this.length = points[points.length - 1].start;
};
v2.position = function (ball, t, set) {
if (set == undefined) {
set = false;
}
if (set) {
ball.track = this;
}
if (t < 0 || t > this.length) {
if (t < 0) {
if (set) {
ball.reallySetPos(this.points[0].x, this.points[0].y);
} else {
ball.setPos(this.points[0].x, this.points[0].y);
}
} else {
if (set) {
ball.reallySetPos(this.points[this.points.length - 1].x, this.points[this.points.length - 1].y);
} else {
ball.setPos(this.points[this.points.length - 1].x, this.points[this.points.length - 1].y);
}
}
ball.mc._visible = false;
return undefined;
}
ball.mc._visible = true;
var v3 = ball.currentNode;
while (this.points[v3].end < t) {
if (set) {
++ball.currentNode;
}
++v3;
}
while (this.points[v3].start > t) {
if (set) {
--ball.currentNode;
}
--v3;
}
var v6 = this.points[v3];
if (this.points[this.points.length - v3 - 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 v7 = (t - v6.start) / v6.len;
if (set) {
ball.reallySetPos(v6.x + v6.xd * v7, v6.y + v6.yd * v7);
return undefined;
}
ball.setPos(v6.x + v6.xd * v7, v6.y + v6.yd * v7);
ball.mc.ball.gotoAndStop(int(t * 2 / Math.PI + ball.rollOffset) % 32 + 1);
ball.mc._rotation = v6.dir;
};
ASSetPropFlags(src.AbstractTrack.prototype, null, 1);
}
#endinitclip
}
movieClip 932 __Packages.src.Track {
#initclip
if (!_global.src) {
_global.src = new Object();
}
if (!_global.src.Track) {
var v1 = function (luxor, level, trackData) {
super();
this.luxor = luxor;
this.level = level;
this.points = new Array();
var v3 = 0;
while (v3 < trackData.length) {
var v6 = trackData.charAt(v3++);
var v8 = trackData.charAt(v3++);
var v7 = trackData.charAt(v3++);
var v9 = trackData.charAt(v3++);
var v10 = trackData.charAt(v3++);
var v5 = new Object();
v5.x = src.Track.BASE_64_CHARS.indexOf(v8) * 64 + src.Track.BASE_64_CHARS.indexOf(v6) - 2000;
v5.y = -(src.Track.BASE_64_CHARS.indexOf(v9) * 64 + src.Track.BASE_64_CHARS.indexOf(v7) - 2000);
v5.hidden = src.Track.BASE_64_CHARS.indexOf(v10) == 1;
this.points.push(v5);
}
this.points.push(this.points[this.points.length - 1]);
this.setPoints(this.points);
};
src.Track = v1;
src.Track extends src.AbstractTrack;
var v2 = v1.prototype;
v2.setWarningLight = function (wl) {
this.warningLight = wl;
wl._x = this.points[0].x;
wl._y = this.points[0].y;
};
v2.position = function (ball, t, set) {
if (set == undefined) {
set = false;
}
if (set) {
ball.track = this;
}
if (t < 0 || t > this.length) {
if (t < 0) {
if (set) {
ball.reallySetPos(this.points[0].x, this.points[0].y);
} else {
ball.setPos(this.points[0].x, this.points[0].y);
}
} else {
if (set) {
ball.reallySetPos(this.points[this.points.length - 1].x, this.points[this.points.length - 1].y);
} else {
ball.setPos(this.points[this.points.length - 1].x, this.points[this.points.length - 1].y);
}
}
ball.mc._visible = false;
return undefined;
}
ball.mc._visible = true;
var v3 = ball.currentNode;
while (this.points[v3].end < t) {
if (set) {
++ball.currentNode;
}
++v3;
}
while (this.points[v3].start > t) {
if (set) {
--ball.currentNode;
}
--v3;
}
var v6 = this.points[v3];
if (this.points[this.points.length - v3 - 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 v7 = (t - v6.start) / v6.len;
if (set) {
ball.reallySetPos(v6.x + v6.xd * v7, v6.y + v6.yd * v7);
return undefined;
}
ball.setPos(v6.x + v6.xd * v7, v6.y + v6.yd * v7);
ball.mc.ball.gotoAndStop(int(t * 2 / Math.PI + ball.rollOffset) % 32 + 1);
ball.mc._rotation = v6.dir;
};
v2.startProgress = function (ball) {
this.winBall = ball;
this.winTime = 0;
};
v2.winTick = function () {
if (this.winTime < this.lastTrackPos / this.winAnimationSpeed) {
this.position(this.winBall, this.winTime * this.winAnimationSpeed);
this.position(this.winBall, this.winTime * this.winAnimationSpeed, true);
this.luxor.newParticle(this.winBall.x, this.winBall.y, 1);
this.luxor.newParticle(this.winBall.x, this.winBall.y, 1);
this.luxor.newParticle(this.winBall.x, this.winBall.y, 1);
++this.winTime;
if (this.winTime > this.lastTrackPos / this.winAnimationSpeed) {
var v2 = this.lastTrackPos / this.length;
if (v2 > 1) {
v2 = 1;
}
if (v2 < 0) {
v2 = 0;
}
var v3 = int(10000 * v2 / 10) * 10;
this.winTime = this.lastTrackPos / this.winAnimationSpeed;
this.position(this.winBall, this.winTime * this.winAnimationSpeed);
this.position(this.winBall, this.winTime * this.winAnimationSpeed, true);
this.luxor.newParticle(this.winBall.x, this.winBall.y, 0);
this.winBall.remove();
(src.Sounds.get('sndBonusScarabCollapse')).playOffsVolPan(0, 100, (this.winBall.x - 377) / src.Luxor.PAN_DAMP);
this.luxor.newScorePopup(this.winBall.x, this.winBall.y, 16777215, '' + v3);
this.luxor.gainScore(v3);
}
return undefined;
}
++this.winTime;
};
v2.winAnimationsDone = function () {
return this.winTime > this.lastTrackPos / this.winAnimationSpeed + 24;
};
v2.winRender = function (alpha) {
this.position(this.winBall, (this.winTime + alpha) * this.winAnimationSpeed);
};
v1.BASE_64_CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#!';
v2.chainReaction = 0;
v2.hasPossibleChain = false;
v2.winAnimationSpeed = 32;
ASSetPropFlags(src.Track.prototype, null, 1);
}
#endinitclip
}
movieClip 933 __Packages.src.Gem {
#initclip
if (!_global.src) {
_global.src = new Object();
}
if (!_global.src.Gem) {
var v1 = function (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;
this.xa = random.nextDouble() * 8 - 4;
this.ya = -random.nextDouble() * 8 - 4;
this.ix = new src.timing.IFloat(x);
this.iy = new src.timing.IFloat(y);
this.rot = 0;
mc._x = x;
mc._y = y;
if (type == src.Gem.BONUS_WILD) {
this.wildBallTransform = new flash.geom.Transform(mc.wildBall);
this.wildBallColor = new flash.geom.ColorTransform();
this.wildBallColor.rgb = 16711680;
this.wildBallTransform.colorTransform = this.wildBallColor;
}
};
src.Gem = v1;
var v2 = v1.prototype;
v2.tick = function (xShooter) {
this.x += this.xa;
this.y += this.ya;
if (this.y < 8) {
this.y = 8;
if (this.ya < 0) {
this.ya = -this.ya * 0.2;
}
}
if (this.y > 530 && !this.luxor.level.lost) {
if (this.x > xShooter - 70 && this.x < xShooter + 70) {
this.y = 530;
this.luxor.gainScore(src.Gem.SCORES[this.type]);
var v3 = '' + src.Gem.SCORES[this.type];
if (this.type < 15) {
++this.luxor.level.gemsGotten;
(src.Sounds.get('sndCatchGem')).playOffsVolPan(0, 100, (this.x - 377) / src.Luxor.PAN_DAMP);
} else {
if (this.type == src.Gem.COIN) {
++this.luxor.level.coinsGotten;
++this.luxor.coinsGotten;
(src.Sounds.get('sndCatchCoin')).playOffsVolPan(0, 100, (this.x - 377) / src.Luxor.PAN_DAMP);
} else {
if (this.type <= src.Gem.BONUS_COLOR_BOMB_7) {
v3 = _global.textMappings.powerup_color_bomb;
this.luxor.level.pickupColorBomb(this.type - src.Gem.BONUS_COLOR_BOMB_1);
(src.Sounds.get('sndCatchColorBomb')).playOffsVolPan(0, 100, (this.x - 377) / src.Luxor.PAN_DAMP);
} else {
if (this.type == src.Gem.BONUS_LIGHTNING) {
v3 = _global.textMappings.powerup_lightning;
this.luxor.level.pickupLightning();
(src.Sounds.get('sndCatchLightning')).playOffsVolPan(0, 100, (this.x - 377) / src.Luxor.PAN_DAMP);
} else {
if (this.type == src.Gem.BONUS_REVERSE) {
v3 = _global.textMappings.powerup_reverse;
this.luxor.level.pickupReverse();
(src.Sounds.get('sndCatchReverse')).playOffsVolPan(0, 100, (this.x - 377) / src.Luxor.PAN_DAMP);
} else {
if (this.type == src.Gem.BONUS_BOMB) {
v3 = _global.textMappings.powerup_fire_ball;
this.luxor.level.pickupFireball();
(src.Sounds.get('sndCatchBomb')).playOffsVolPan(0, 100, (this.x - 377) / src.Luxor.PAN_DAMP);
} else {
if (this.type == src.Gem.BONUS_SLOW) {
v3 = _global.textMappings.powerup_slow;
this.luxor.level.pickupSlow();
(src.Sounds.get('sndCatchSlow')).playOffsVolPan(0, 100, (this.x - 377) / src.Luxor.PAN_DAMP);
} else {
if (this.type == src.Gem.BONUS_SPEED_SHOT) {
v3 = _global.textMappings.powerup_speed_shot;
this.luxor.level.pickupSpeedShot();
(src.Sounds.get('sndCatchSpeed')).playOffsVolPan(0, 100, (this.x - 377) / src.Luxor.PAN_DAMP);
} else {
if (this.type == src.Gem.BONUS_STOP) {
v3 = _global.textMappings.powerup_stop;
this.luxor.level.pickupStop();
(src.Sounds.get('sndCatchStop')).playOffsVolPan(0, 100, (this.x - 377) / src.Luxor.PAN_DAMP);
} else {
if (this.type == src.Gem.BONUS_WILD) {
v3 = _global.textMappings.powerup_wild;
this.luxor.level.pickupWild();
(src.Sounds.get('sndCatchWild')).playOffsVolPan(0, 100, (this.x - 377) / src.Luxor.PAN_DAMP);
}
}
}
}
}
}
}
}
}
}
if (v3 != undefined) {
this.luxor.newScorePopup(this.x, this.y, 16764159, v3);
}
this.luxor.newParticle(this.x, this.y, 0);
this.luxor.gemGotten();
this.luxor.removeGem(this);
this.mc.removeMovieClip();
return undefined;
}
}
if (this.y > 600) {
this.luxor.removeGem(this);
this.mc.removeMovieClip();
return undefined;
}
if (this.x < 30) {
this.x = 30;
this.xa = -this.xa;
}
if (this.x >= 769) {
this.x = 769;
this.xa = -this.xa;
}
this.ix.set(this.x);
this.iy.set(this.y);
this.ya += 0.5;
++this.rot;
};
v2.render = function (alpha) {
this.mc.flare._alpha = Math.random() * 50 + 20;
this.mc._x = this.ix.get(alpha);
this.mc._y = this.iy.get(alpha);
this.mc.flare._rotation = -Math.atan2(this.mc._x + 100, this.mc._y - 300) * 180 / Math.PI + 90;
this.mc.gem.gotoAndStop(int((this.rot + alpha) * 2) % this.mc.gem._totalFrames + 1);
if (this.type == src.Gem.BONUS_WILD) {
var v2 = (this.rot + alpha) * 0.25;
var v5 = int(Math.sin(v2 + 0) * 127 + 127);
var v4 = int(Math.sin(v2 + 2.09439510239) * 127 + 127);
var v6 = int(Math.sin(v2 + 4.18879020479) * 127 + 127);
this.wildBallColor.rgb = v5 << 16 | v4 << 8 | v6;
this.wildBallTransform.colorTransform = this.wildBallColor;
}
};
v1.GEM_1 = 0;
v1.GEM_2 = 1;
v1.GEM_3 = 2;
v1.GEM_4 = 3;
v1.GEM_5 = 4;
v1.GEM_6 = 5;
v1.GEM_7 = 6;
v1.GEM_8 = 7;
v1.GEM_9 = 8;
v1.GEM_10 = 9;
v1.GEM_11 = 10;
v1.GEM_12 = 11;
v1.GEM_13 = 12;
v1.GEM_14 = 13;
v1.GEM_15 = 14;
v1.COIN = 18;
v1.BONUS_COLOR_BOMB_1 = 20;
v1.BONUS_COLOR_BOMB_2 = 21;
v1.BONUS_COLOR_BOMB_3 = 22;
v1.BONUS_COLOR_BOMB_4 = 23;
v1.BONUS_COLOR_BOMB_5 = 24;
v1.BONUS_COLOR_BOMB_6 = 25;
v1.BONUS_COLOR_BOMB_7 = 26;
v1.BONUS_LIGHTNING = 27;
v1.BONUS_REVERSE = 28;
v1.BONUS_BOMB = 29;
v1.BONUS_SLOW = 30;
v1.BONUS_SPEED_SHOT = 31;
v1.BONUS_STOP = 32;
v1.BONUS_WILD = 33;
v1.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];
ASSetPropFlags(src.Gem.prototype, null, 1);
}
#endinitclip
}
movieClip 934 __Packages.src.timing.IFloat {
#initclip
if (!_global.src) {
_global.src = new Object();
}
if (!_global.src.timing) {
_global.src.timing = new Object();
}
if (!_global.src.timing.IFloat) {
var v1 = function (initial) {
if (initial == undefined) {
initial = 0;
}
this.value = initial;
this.lastValue = initial;
};
src.timing.IFloat = v1;
var v2 = v1.prototype;
v2.resetTo = function (initial) {
this.value = initial;
this.lastValue = initial;
};
v2.set = function (newValue) {
this.lastValue = this.value;
this.value = newValue;
};
v2.tweak = function (offs) {
this.lastValue += offs;
this.value += offs;
};
v2.get = function (alpha) {
return this.lastValue + (this.value - this.lastValue) * alpha;
};
ASSetPropFlags(src.timing.IFloat.prototype, null, 1);
}
#endinitclip
}
movieClip 935 __Packages.src.Ball {
#initclip
if (!_global.src) {
_global.src = new Object();
}
if (!_global.src.Ball) {
var v1 = function (color, depth, mc) {
this.x = 370;
this.y = 0;
if (src.Ball.ballCounts == undefined) {
src.Ball.ballCounts = new Array(50);
var v2 = 0;
while (v2 < 50) {
src.Ball.ballCounts[v2] = 0;
++v2;
}
}
++src.Ball.ballCounts[color];
mc.gotoAndStop(color + 1);
this.color = color;
this.rollOffset = Math.random() * 32;
this.currentNode = 0;
this.mc = mc;
this.depth = depth;
this.hidden = false;
if (color == src.Ball.COLOR_FIREBALL || color == src.Ball.COLOR_LIGHTNING || color == src.Ball.COLOR_WILD) {
mc.onEnterFrame = this.powerupAnimate;
return undefined;
}
mc.onEnterFrame = undefined;
};
src.Ball = v1;
var v2 = v1.prototype;
v2.isNear = function (x, y, radius) {
var v3 = (this.x - x) / radius;
var v2 = (this.y - y) / radius;
return v3 * v3 + v2 * v2 < 1;
};
v2.isXNear = function (x, radius) {
var v2 = (this.x - x) / radius;
return v2 * v2 < 1;
};
v2.setColor = function (newColor) {
--src.Ball.ballCounts[this.color];
this.color = newColor;
++src.Ball.ballCounts[this.color];
this.mc.gotoAndStop(this.color + 1);
if (this.color == src.Ball.COLOR_FIREBALL || this.color == src.Ball.COLOR_LIGHTNING || this.color == src.Ball.COLOR_WILD) {
this.mc.onEnterFrame = this.powerupAnimate;
return undefined;
}
this.mc.onEnterFrame = undefined;
};
v2.powerupAnimate = function () {
this.powerup.gotoAndStop(int(getTimer() * 24 / 1000) % 32 + 1);
};
v2.remove = function () {
if (this.removed) {
return undefined;
}
this.mc.removeMovieClip();
--src.Ball.ballCounts[this.color];
this.removed = true;
};
v2.setPos = function (x, y) {
this.mc._x = x;
this.mc._y = y;
};
v2.reallySetPos = function (xp, yp) {
this.xa = xp - this.x;
this.ya = yp - this.y;
this.x = xp;
this.y = yp;
};
v1.COLOR_FIREBALL = 10;
v1.COLOR_LIGHTNING = 11;
v1.COLOR_WILD = 12;
v1.COLOR_VISE = 20;
v1.COLOR_WIN_VISE = 21;
v2.removed = false;
ASSetPropFlags(src.Ball.prototype, null, 1);
}
#endinitclip
}
movieClip 936 __Packages.src.timing.Timer {
#initclip
if (!_global.src) {
_global.src = new Object();
}
if (!_global.src.timing) {
_global.src.timing = new Object();
}
if (!_global.src.timing.Timer) {
var v1 = function (timeable, gameTicksPerSecond) {
this.millisPerGameTick = 1000 / gameTicksPerSecond;
this.timeable = timeable;
this.maxTickTime = 500;
};
src.timing.Timer = v1;
var v2 = v1.prototype;
v2.getMillisPerTick = function () {
return this.millisPerGameTick;
};
v2.setMaxTickTime = function (millis) {
this.maxTickTime = millis;
};
v2.advanceTime = function () {
var v3 = getTimer();
if (this.startTime < 0) {
this.startTime = v3;
this.unprocessedTime = this.millisPerGameTick;
}
this.time = v3 - this.startTime;
var v5 = this.time - this.lastTime;
this.lastTime = this.time;
this.unprocessedTime += v5;
if (this.unprocessedTime >= this.millisPerGameTick) {
var v2 = this.maxTickTime + v3;
do {
this.timeable.tick(this.tick);
++this.tick;
this.unprocessedTime -= this.millisPerGameTick;
} while (this.unprocessedTime >= this.millisPerGameTick && getTimer() < v2);
}
var v4 = (this.unprocessedTime % this.millisPerGameTick) / this.millisPerGameTick;
this.timeable.render(this.tick, v4);
};
v2.time = 0;
v2.startTime = -1;
v2.lastTime = 0;
v2.unprocessedTime = 0;
v2.tick = 0;
v2.millisPerGameTick = 0;
v2.maxTickTime = -1;
ASSetPropFlags(src.timing.Timer.prototype, null, 1);
}
#endinitclip
}
movieClip 937 __Packages.src.ShootBall {
#initclip
if (!_global.src) {
_global.src = new Object();
}
if (!_global.src.ShootBall) {
var v1 = function (ball, x, y, speedMode) {
this.ball = ball;
this.x = x;
this.y = y;
this.speedMode = speedMode;
this.ix = new src.timing.IFloat(x);
this.iy = new src.timing.IFloat(y);
this.xa = 0;
this.ya = -40;
if (speedMode) {
this.ya = this.ya * 6 / 4;
}
this.moveVec = new src.Vector();
this.n = new src.Vector();
this.c = new src.Vector();
};
src.ShootBall = v1;
var v2 = v1.prototype;
v2.checkCollide = function (ball) {
var v10 = ball.x - ball.xa;
var v11 = ball.y - ball.ya;
var v6 = ball.xa - this.xa;
var v7 = ball.ya - this.ya;
this.c.set(v10 - this.x, v11 - this.y);
this.moveVec.set(v6, v7);
var v12 = this.moveVec.dot(this.c);
if (v12 >= 0) {
return false;
}
var v8 = 32;
var v9 = this.c.x * this.c.x + this.c.y * this.c.y - v8 * v8;
this.moveVec.normalize();
var v3 = this.moveVec.dot(this.c);
var v4 = v3 * v3 - v9;
if (v4 > 0) {
var v5 = (-v3 - Math.sqrt(v4)) / src.Vector.distance(0, 0, v6, v7);
if (v5 < this.shortestHitDistance) {
this.collided = true;
this.shortestHitDistance = v5;
this.collidedBall = ball;
return true;
}
}
return false;
};
v2.collide = function () {
this.moveVec.set(this.xa, this.ya);
this.moveVec.scale(this.shortestHitDistance);
this.x += this.moveVec.x;
this.y += this.moveVec.y;
this.ya = 0;
this.xa = 0;
var v3 = this.collidedBall.x;
var v4 = this.collidedBall.y;
this.c.set(this.x - v3, this.y - v4);
var v2 = this.collidedBall.track.points[this.collidedBall.currentNode];
this.n.set(v2.xd, v2.yd);
this.hitFront = this.c.dot(this.n) < 0;
this.ball.xStart = this.x;
this.ball.yStart = this.y;
this.ball.setPos(this.x, this.y);
this.ball.reallySetPos(this.x, this.y);
this.collided = true;
};
v2.tick = function () {
if (this.collided) {
this.collided = false;
this.collide();
}
this.y += this.ya;
this.iy.set(this.y);
++this.step;
};
v2.render = function (alpha) {
this.ball.mc._rotation = 0;
this.ball.mc.ball.gotoAndStop((int(this.iy.get(alpha) / 4) & 31) + 1);
this.ball.mc._x = this.ix.get(alpha);
this.ball.mc._y = this.iy.get(alpha);
};
v2.step = 0;
v2.collided = false;
v2.shortestHitDistance = 1;
v2.speedMode = false;
ASSetPropFlags(src.ShootBall.prototype, null, 1);
}
#endinitclip
}
movieClip 938 __Packages.src.Vector {
#initclip
if (!_global.src) {
_global.src = new Object();
}
if (!_global.src.Vector) {
var v1 = function () {};
src.Vector = v1;
var v2 = v1.prototype;
v2.set = function (x, y) {
this.x = x;
this.y = y;
};
v2.scale = function (s) {
this.x *= s;
this.y *= s;
};
v2.getLength = function () {
return Math.sqrt(this.x * this.x + this.y * this.y);
};
v2.normalize = function () {
var v2 = this.getLength();
this.x /= v2;
this.y /= v2;
};
v2.dot = function (v) {
return this.x * v.x + this.y * v.y;
};
v1.distance = function (x0, y0, x1, y1) {
var v1 = x1 - x0;
var v2 = y1 - y0;
return Math.sqrt(v1 * v1 + v2 * v2);
};
ASSetPropFlags(src.Vector.prototype, null, 1);
}
#endinitclip
}
movieClip 939 __Packages.src.TrainSegment {
#initclip
if (!_global.src) {
_global.src = new Object();
}
if (!_global.src.TrainSegment) {
var v1 = function (track, balls) {
this.pos = track.length;
this.iPos = new src.timing.IFloat(this.pos);
this.track = track;
this.balls = balls;
this.recalc();
this.speed = 0;
};
src.TrainSegment = v1;
var v2 = v1.prototype;
v2.recalc = function () {
this.length = this.balls.length;
this.firstBall = this.balls[this.balls.length - 1];
this.lastBall = this.balls[0];
};
v2.removeSegment = function () {
if (this.insertingBall != undefined) {
this.ballInserted();
}
this.track.level.ballsCleared(this.balls.length);
var v2 = 0;
while (v2 < this.balls.length) {
this.balls[v2].remove();
if (!this.balls[v2].hidden) {
this.track.luxor.newParticle(this.balls[v2].x, this.balls[v2].y, 0);
}
++v2;
}
if (this.nextSegment != undefined) {
this.nextSegment.lastSegment = this.lastSegment;
}
if (this.lastSegment != undefined) {
this.lastSegment.nextSegment = this.nextSegment;
return undefined;
}
this.track.firstSegment = this.nextSegment;
};
v2.insertBallBeside = function (ball, targetBall, offs) {
var v2 = 0;
while (v2 < this.balls.length) {
if (this.balls[v2] == targetBall) {
(src.Sounds.get('sndBallCollide')).playOffsVolPan(0, 100, (targetBall.x - 377) / src.Luxor.PAN_DAMP);
this.insertBall(ball, v2 + offs);
return undefined;
}
++v2;
}
if (this.nextSegment != undefined) {
this.nextSegment.insertBallBeside(ball, targetBall, offs);
}
};
v2.insertBall = function (ball, insertPos) {
this.insertTime = 4;
this.insertingBall = ball;
this.balls.splice(insertPos, 0, ball);
this.pos -= 32;
this.iPos.tweak(-32);
this.recalc();
};
v2.indexOf = function (ball) {
var v2 = 0;
while (v2 < this.balls.length) {
if (this.balls[v2] == ball) {
return v2;
}
++v2;
}
return -1;
};
v2.join = function () {
if (this.firstBall.color == src.Ball.COLOR_VISE) {
if (this.length == 1) {
this.removeSegment();
} else {
this.split(this.length - 1);
this.nextSegment.removeSegment();
}
(src.Sounds.get('sndCollapseScarab')).playOffsVolPan(0, 100, (this.firstBall.x - 377) / src.Luxor.PAN_DAMP);
return undefined;
}
var v3 = this.firstBall.color == this.nextSegment.lastBall.color;
if (this.firstBall.color == src.Ball.COLOR_WILD) {
v3 = true;
}
if (this.nextSegment.lastBall.color == src.Ball.COLOR_WILD) {
v3 = true;
}
var v5 = (this.speed + this.nextSegment.speed) / 2;
var v6 = this.length;
var v2 = 0;
while (v2 < this.nextSegment.balls.length) {
this.balls.push(this.nextSegment.balls[v2]);
++v2;
}
if (this.nextSegment.insertingBall != undefined) {
this.insertingBall = this.nextSegment.insertingBall;
this.insertTime = this.nextSegment.insertTime;
var v4 = this.insertTime * 8;
this.pos -= v4;
this.iPos.tweak(-v4);
}
this.nextSegment = this.nextSegment.nextSegment;
if (this.nextSegment != undefined) {
this.nextSegment.lastSegment = this;
}
this.speed = v5;
this.recalc();
if (v3) {
this.findAndPopColor(v6, false);
}
};
v2.split = function (splitPos) {
this.hasSplit = true;
if (splitPos != 0) {
if (splitPos < this.length) {
var v2 = this.nextSegment;
var v4 = this.balls.slice(0, splitPos);
var v5 = this.balls.slice(splitPos, this.length);
this.balls = v4;
this.nextSegment = new src.TrainSegment(this.track, v5);
this.nextSegment.lastSegment = this;
this.nextSegment.nextSegment = v2;
if (this.insertingBall != undefined) {
var v6 = this.indexOf(this.insertingBall);
if (v6 == -1) {
this.nextSegment.insertTime = this.insertTime;
this.nextSegment.insertingBall = this.insertingBall;
this.insertTime = 0;
this.insertingBall = undefined;
}
}
if (v2 != undefined) {
v2.lastSegment = this.nextSegment;
}
this.nextSegment.recalc();
this.recalc();
this.nextSegment.pos = this.pos + this.length * 32;
this.nextSegment.iPos.resetTo(this.nextSegment.pos);
this.nextSegment.speed = this.speed;
}
}
};
v2.findAndPopColor = function (pos, fromShot) {
++this.track.level.insertStackDepth;
var v9 = 0;
var v5 = this.balls[pos].color;
var v3 = pos;
var v6 = 0;
var v2 = true;
while (v2) {
if (v3 <= 0) {
v2 = false;
} else {
if (this.balls[v3 - 1].color == src.Ball.COLOR_VISE) {
v2 = false;
} else {
if (v5 == src.Ball.COLOR_WILD) {
v2 = true;
} else {
if (this.balls[v3 - 1].color == src.Ball.COLOR_WILD) {
v2 = true;
} else {
if (this.balls[v3 - 1].color == v5) {
v2 = true;
} else {
v2 = false;
}
}
}
}
}
if (v2) {
v5 = this.balls[v3 - 1].color;
--v3;
}
}
v2 = true;
var v4 = v3;
while (v2) {
if (v4 >= this.balls.length - 1) {
v2 = false;
} else {
if (this.balls[v4 + 1].color == src.Ball.COLOR_VISE) {
v2 = false;
} else {
if (v5 == src.Ball.COLOR_WILD) {
v2 = true;
} else {
if (this.balls[v4 + 1].color == src.Ball.COLOR_WILD) {
v2 = true;
} else {
if (this.balls[v4 + 1].color == v5) {
v2 = true;
} else {
v2 = false;
}
}
}
}
}
if (v2) {
v5 = this.balls[v4 + 1].color;
++v4;
}
}
v6 = v4 - v3 + 1;
if (v6 >= 3) {
if (this.track.level.insertStackDepth == 1) {
this.track.level.collapsed(v6, this, v3, fromShot);
}
var v7 = (this.firstBall.color == src.Ball.COLOR_VISE) ? 8 : 0;
if (v3 + v6 < this.balls.length) {
this.split(v3 + v6);
this.nextSegment.speed += v7;
}
if (v3 > 0) {
this.split(v3);
this.nextSegment.removeSegment();
this.speed -= v7;
} else {
this.removeSegment();
}
} else {
if (fromShot) {
this.track.level.multiMatchCount = 0;
}
}
--this.track.level.insertStackDepth;
};
v2.ballInserted = function () {
var v2 = this.indexOf(this.insertingBall);
v2 != -1;
this.insertingBall = undefined;
this.insertTime = 0;
this.findAndPopColor(v2, true);
this.track.luxor.ballInserted();
};
v2.popVise = function () {
this.track.luxor.newGem(this.firstBall.x, this.firstBall.y);
(src.Sounds.get('sndGemSpawn')).playOffsVolPan(0, 100, (this.firstBall.x - 377) / src.Luxor.PAN_DAMP);
this.removeSegment();
};
v2.isWarning = function () {
return this.pos < 800;
};
v2.getWarningFactor = function () {
return this.pos / 800;
};
v2.getWeights = function (weights) {
var v2 = 0;
while (v2 < this.balls.length) {
weights[this.balls[v2].color] = 10;
++v2;
}
if (this.nextSegment != undefined) {
this.nextSegment.getWeights(weights);
}
};
v2.getWarningWeights = function (weights) {
var v4 = 0;
var v2 = this;
var v3 = 0;
var v5 = 10;
for (;;) {
if (v5 <= 0) {
return undefined;
}
if (v3 == v2.balls.length) {
if (v2.nextSegment == undefined) {
if (v4 == 0) {
this.getWeights(weights);
}
return undefined;
} else {
v2 = v2.nextSegment;
v3 = 0;
}
} else {
if (v2.balls[v3].color == src.Ball.COLOR_VISE) {
if (v4 == 0) {
this.getWeights(weights);
}
return undefined;
} else {
weights[v2.balls[v3].color] += v5;
v4 += v5;
--v5;
++v3;
}
}
}
};
v2.collideCheck = function (shootBall) {
var v3 = false;
var v2 = 0;
while (v2 < this.balls.length) {
if (!this.balls[v2].hidden) {
v3 |= shootBall.checkCollide(this.balls[v2]);
}
++v2;
}
if (this.nextSegment != undefined) {
v3 |= this.nextSegment.collideCheck(shootBall);
}
return v3;
};
v2.lightning = function (x, radius) {
var v4 = this.balls[0].isXNear(x, radius) && this.balls[0].color != src.Ball.COLOR_VISE;
var v5 = v4;
var v2 = 0;
while (v2 < this.balls.length) {
var v3 = this.balls[v2].isXNear(x, radius) && this.balls[v2].color != src.Ball.COLOR_VISE;
if (v3 ^ v4) {
this.split(v2);
break;
}
if (!v3) {
v5 = false;
}
++v2;
}
if (v5) {
this.removeSegment();
}
if (this.nextSegment != undefined) {
this.nextSegment.lightning(x, radius);
}
};
v2.fireBall = function (x, y, radius) {
var v4 = this.balls[0].isNear(x, y, radius) && this.balls[0].color != src.Ball.COLOR_VISE;
var v5 = v4;
var v2 = 0;
while (v2 < this.balls.length) {
var v3 = this.balls[v2].isNear(x, y, radius) && this.balls[v2].color != src.Ball.COLOR_VISE;
if (v3 ^ v4) {
this.split(v2);
break;
}
if (!v3) {
v5 = false;
}
++v2;
}
if (v5) {
this.removeSegment();
}
if (this.nextSegment != undefined) {
this.nextSegment.fireBall(x, y, radius);
}
};
v2.colorBomb = function (color) {
var v5 = this.balls[0].color;
var v4 = v5 == color;
var v2 = 0;
while (v2 < this.balls.length) {
if (this.balls[v2].color == color ^ v5 == color) {
this.split(v2);
break;
}
if (this.balls[v2].color != color) {
v4 = false;
}
++v2;
}
if (v4) {
this.removeSegment();
}
if (this.nextSegment != undefined) {
this.nextSegment.colorBomb(color);
}
};
v2.positionBalls = function (set) {
if (set == undefined) {
set = false;
}
var v8 = this.pos;
var v5 = 0;
if (this.insertTime > 0) {
v5 = this.insertTime * 8;
}
var v2 = 0;
for (;;) {
if (v2 >= this.balls.length) {
return undefined;
}
var v3 = v8 + v2 * 32;
var v4 = v5;
if (this.balls[v2] == this.insertingBall) {
v5 = 0;
}
v3 += v5;
this.track.position(this.balls[v2], v3, set);
if (this.balls[v2] == this.insertingBall) {
var v6 = this.balls[v2].xStart + (this.balls[v2].x - this.balls[v2].xStart) * (1 - v4 / 32);
var v7 = this.balls[v2].yStart + (this.balls[v2].y - this.balls[v2].yStart) * (1 - v4 / 32);
this.balls[v2].setPos(v6, v7);
}
++v2;
}
};
v2.preTick = function () {
if (this.nextSegment != undefined) {
if (this.firstBall.color == src.Ball.COLOR_VISE && this.nextSegment.lastBall.color == src.Ball.COLOR_VISE) {
this.nextSegment.popVise();
}
var v2 = 0;
if (this.nextSegment.insertTime > 0) {
v2 = this.nextSegment.insertTime * 8;
}
if (this.pos + this.length * 32 > this.nextSegment.pos + v2) {
(src.Sounds.get('sndTrainCollide')).playOffsVolPan(0, 100, (this.lastBall.x - 377) / src.Luxor.PAN_DAMP);
this.join();
}
this.nextSegment.preTick();
}
};
v2.tick = function () {
this.hasSplit = false;
if (this.track.level.lost) {
this.speed -= 2;
this.speed *= 0.94;
this.pos += this.speed;
} else {
var v3 = this.track.level.slowTime != 0;
if (this.track.level.reverseTime == 0) {
if (this.firstBall.color == src.Ball.COLOR_VISE && this.track.level.stopTime == 0) {
var v2 = (this.pos + 500) / this.track.length;
v2 = (v2 + v2 * v2) / 2;
var v4 = v2 * (this.track.level.levelNum + 10) / 10;
this.speed -= v4;
if (this.pos > this.track.length - 300) {
this.speed -= 5;
}
}
} else {
if (this.lastSegment == undefined || this.lastSegment.firstBall.color == src.Ball.COLOR_VISE || this.lastSegment.firstBall.color == src.Ball.COLOR_WILD || this.lastBall.color == src.Ball.COLOR_WILD) {
this.speed += 1;
}
}
this.speed *= 0.8;
if (this.nextSegment.lastBall.color == this.firstBall.color || this.nextSegment.lastBall.color == src.Ball.COLOR_VISE || this.firstBall.color == src.Ball.COLOR_WILD || this.nextSegment.lastBall.color == src.Ball.COLOR_WILD) {
v3 = false;
}
if (v3) {
this.pos += this.speed * 0.25;
} else {
this.pos += this.speed;
}
}
if (this.insertTime > 0) {
--this.insertTime;
if (this.insertTime == 0) {
this.ballInserted();
}
}
if (this.lastSegment == undefined && this.lastBall.color == src.Ball.COLOR_VISE) {
this.popVise();
}
if (this.nextSegment != undefined) {
if (this.nextSegment.lastBall.color == this.firstBall.color || this.nextSegment.lastBall.color == src.Ball.COLOR_VISE || this.firstBall.color == src.Ball.COLOR_WILD || this.nextSegment.lastBall.color == src.Ball.COLOR_WILD) {
this.speed += 4;
this.track.hasPossibleChain = true;
}
this.nextSegment.tick();
}
if (this.firstBall.color == src.Ball.COLOR_VISE) {
this.track.lastTrackPos = this.pos + this.length * 32 - 32;
}
this.iPos.set(this.pos);
this.positionBalls(true);
};
v2.render = function (alpha) {
var v8 = int(this.iPos.get(alpha));
var v5 = 0;
if (this.insertTime > 0) {
v5 = (this.insertTime - 1 + (1 - alpha)) * 8;
}
if (this.lastTime != v8 || this.lastTimeOffs != v5) {
this.lastTime = v8;
this.lastTimeOffs = v5;
var v2 = 0;
while (v2 < this.balls.length) {
var v3 = v8 + v2 * 32;
var v4 = v5;
if (this.balls[v2] == this.insertingBall) {
v5 = 0;
}
v3 += v5;
this.track.position(this.balls[v2], v3, false);
if (this.balls[v2] == this.insertingBall) {
var v6 = this.balls[v2].xStart + (this.balls[v2].x - this.balls[v2].xStart) * (1 - v4 / 32);
var v7 = this.balls[v2].yStart + (this.balls[v2].y - this.balls[v2].yStart) * (1 - v4 / 32);
this.balls[v2].setPos(v6, v7);
}
++v2;
}
}
if (this.nextSegment != undefined) {
this.nextSegment.render(alpha);
}
};
v2.speed = 0;
v2.insertTime = 0;
ASSetPropFlags(src.TrainSegment.prototype, null, 1);
}
#endinitclip
}
movieClip 940 __Packages.src.Communicator {
#initclip
if (!_global.src) {
_global.src = new Object();
}
if (!_global.src.Communicator) {
var v1 = function () {
this.enabled = true;
};
src.Communicator = v1;
var v2 = v1.prototype;
v2.enable = function () {
this.enabled = true;
};
v2.disable = function () {
this.enabled = false;
};
v2.gameStarted = function () {
if (this.enabled) {
fscommand('gameStart');
fscommand('playData', src.Communicator.CMD_VERSION + ',1=0');
}
};
v2.gameEnd = function (score) {
if (this.enabled) {
if (this.hasSentGameEnd) {
return undefined;
}
this.hasSentGameEnd = true;
fscommand('gameEnd', score);
}
};
v2.gameQuit = function () {
if (this.enabled) {
if (this.hasSentGameOver) {
return undefined;
}
this.hasSentGameOver = true;
fscommand('gameQuit');
}
};
v2.sendGameEndPressed = function () {
fscommand('playData', src.Communicator.CMD_END_GAME_PRESSED + '=0');
};
v2.sendLevelStart = function (tick) {
if (this.enabled) {
fscommand('playData', src.Communicator.CMD_LEVEL_START + ',' + tick + '=0');
}
};
v2.sendClick = function (tick, xShooter) {
if (this.enabled) {
fscommand('playData', src.Communicator.CMD_CLICK + ',' + tick + ' ' + xShooter + '=0');
}
};
v2.sendKeyPress = function (tick) {
if (this.enabled) {
fscommand('playData', src.Communicator.CMD_KEY_PRESS + ',' + tick + '=0');
}
};
v2.sendLevelComplete = function (tick, scoreGained) {
if (this.enabled) {
fscommand('playData', src.Communicator.CMD_LEVEL_COMPLETE + ',' + tick + '=' + scoreGained);
}
};
v2.sendGameLost = function (tick, scoreGained) {
if (this.enabled) {
fscommand('playData', src.Communicator.CMD_GAME_LOST + ',' + tick + '=' + scoreGained);
}
};
v2.sendSyncScore = function (tick, totalScore) {
if (this.enabled) {
fscommand('playData', src.Communicator.CMD_SYNC_SCORE + ',' + tick + ' ' + totalScore + '=0');
}
};
v2.sendGetGem = function (tick, xShooter) {
if (this.enabled) {
fscommand('playData', src.Communicator.CMD_GET_GEM + ',' + tick + ' ' + xShooter + '=0');
}
};
v2.sendLog = function (tick, text) {
if (this.enabled) {
fscommand('playData', src.Communicator.CMD_LOG + ',' + tick + ' ' + text + '=0');
}
};
v2.parseGameData = function (gameData) {
var v6 = new XML(_root.gameData);
_global.shortGameMode = new String(v6.childNodes[0].attributes.mode) == 'short';
_global.relaxMode = new String(v6.childNodes[0].attributes.relaxMode) == 'true';
_global.textMappings = new Object();
var v5 = v6.childNodes[0].childNodes;
this.randomSeed = (new Number(v6.childNodes[0].attributes.randomseed)).valueOf();
var v4 = 0;
for (;;) {
if (v4 >= v5.length) {
return undefined;
}
if (v5[v4].nodeName == 'levels') {
_global.levels = (new String(v5[v4].firstChild.nodeValue)).split(',');
}
if (v5[v4].nodeName == 'text') {
_global.textMappings[v5[v4].attributes.id] = new String(v5[v4].firstChild.nodeValue);
}
++v4;
}
};
v2.hasSentGameEnd = false;
v2.hasSentGameOver = false;
v2.enabled = true;
v1.VERSION_NUM = 0;
v1.CMD_VERSION = 114;
v1.CMD_LEVEL_START = 481;
v1.CMD_CLICK = 418;
v1.CMD_KEY_PRESS = 148;
v1.CMD_LEVEL_COMPLETE = 184;
v1.CMD_GAME_LOST = 841;
v1.CMD_SYNC_SCORE = 814;
v1.CMD_GET_GEM = 888;
v1.CMD_LOG = 999;
v1.CMD_END_GAME_PRESSED = 666;
ASSetPropFlags(src.Communicator.prototype, null, 1);
}
#endinitclip
}
movieClip 941 __Packages.src.DebugData {
#initclip
if (!_global.src) {
_global.src = new Object();
}
if (!_global.src.DebugData) {
var v1 = function () {};
src.DebugData = v1;
var v2 = v1.prototype;
v1.superSeed = 183758344;
v1.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]];
ASSetPropFlags(src.DebugData.prototype, null, 1);
}
#endinitclip
}
movieClip 942 __Packages.src.Shooter {
#initclip
if (!_global.src) {
_global.src = new Object();
}
if (!_global.src.Shooter) {
var v1 = function () {
super();
this.x = new src.timing.IFloat(377);
this.ballRot = new src.timing.IFloat(0);
this.aimBeam._visible = false;
};
src.Shooter = v1;
src.Shooter extends MovieClip;
var v2 = v1.prototype;
v2.tick = function () {
var v4 = this._parent._xmouse;
var v3 = this.x.get(1);
if (_global.roll == true) {
this.ballRotSpeed += v4 - v3;
this.ballRotSpeed *= 0.8;
this.ballRot.set(this.ballRot.get(1) + this.ballRotSpeed * 0.1);
}
v3 += (v4 - v3) * 0.7;
this.x.set(v3);
};
v2.render = function (alpha) {
this._x = this.x.get(alpha);
this.ball.mc._x = this._x;
this._y = 536;
this.ball.mc._y = 536;
this.ball.mc._rotation = -90;
this.ball.mc.ball.gotoAndStop((int(this.ballRot.get(alpha)) & 31) + 1);
};
v2.ballRotSpeed = 0;
ASSetPropFlags(src.Shooter.prototype, null, 1);
}
#endinitclip
}