Section 1
//anim3stars_82 (abracadabra_fla.anim3stars_82)
package abracadabra_fla {
import src.sound.*;
import src.timing.*;
import flash.media.*;
import flash.events.*;
import src.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.xml.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
public dynamic class anim3stars_82 extends MovieClip {
public function anim3stars_82(){
addFrameScript(0, frame1, 80, frame81);
}
function frame1(){
stop();
}
function frame81(){
gotoAndPlay(2);
}
}
}//package abracadabra_fla
Section 2
//double_114 (abracadabra_fla.double_114)
package abracadabra_fla {
import src.sound.*;
import src.timing.*;
import flash.media.*;
import flash.events.*;
import src.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.xml.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
public dynamic class double_114 extends MovieClip {
public function double_114(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package abracadabra_fla
Section 3
//EndGameSign_43 (abracadabra_fla.EndGameSign_43)
package abracadabra_fla {
import src.sound.*;
import src.timing.*;
import flash.media.*;
import flash.events.*;
import src.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.xml.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
public dynamic class EndGameSign_43 extends MovieClip {
public var mcScore:handkerchiefgameover_46;
public var mcGameOverText:MovieClip;
public function EndGameSign_43(){
addFrameScript(0, frame1, 103, frame104, 207, frame208);
}
function frame1(){
stop();
}
function frame104(){
stop();
}
function frame208(){
stop();
}
}
}//package abracadabra_fla
Section 4
//handkerchiefgameover_46 (abracadabra_fla.handkerchiefgameover_46)
package abracadabra_fla {
import src.sound.*;
import src.timing.*;
import flash.media.*;
import flash.events.*;
import src.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.xml.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
public dynamic class handkerchiefgameover_46 extends MovieClip {
public var txtScore:TextField;
public var txtScoreLabel:TextField;
public var txtRecordScore:TextField;
public var txtRecordScoreLabel:TextField;
public function handkerchiefgameover_46(){
addFrameScript(0, frame1, 9, frame10);
}
function frame1(){
stop();
}
function frame10(){
stop();
}
}
}//package abracadabra_fla
Section 5
//intro_game_64 (abracadabra_fla.intro_game_64)
package abracadabra_fla {
import src.sound.*;
import src.timing.*;
import flash.media.*;
import flash.events.*;
import src.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.xml.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
public dynamic class intro_game_64 extends MovieClip {
public var mcOver:MovieClip;
public var mcStar:mc_start_78;
public function intro_game_64(){
addFrameScript(43, frame44, 60, frame61, 99, frame100, 116, frame117, 147, frame148, 161, frame162, 179, frame180, 196, frame197, 214, frame215, 253, frame254, 270, frame271, 313, frame314, 334, frame335, 362, frame363, 377, frame378, 393, frame394, 425, frame426, 476, frame477, 492, frame493, 520, frame521, 552, frame553, 604, frame605, 627, frame628, 666, frame667, 686, frame687, 718, frame719, 742, frame743, 773, frame774, 846, frame847);
}
function frame44(){
mcStar.gotoAndPlay(2);
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame61(){
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame100(){
mcStar.gotoAndPlay(2);
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame117(){
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame148(){
mcStar.gotoAndPlay(2);
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame162(){
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame180(){
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame197(){
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame215(){
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame254(){
mcStar.gotoAndPlay(2);
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame271(){
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame314(){
mcStar.gotoAndPlay(2);
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame335(){
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame363(){
mcStar.gotoAndPlay(2);
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame378(){
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame394(){
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame426(){
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame477(){
mcStar.gotoAndPlay(2);
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame493(){
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame521(){
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame553(){
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame605(){
mcStar.gotoAndPlay(2);
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame628(){
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame667(){
mcStar.gotoAndPlay(2);
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame687(){
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame719(){
mcStar.gotoAndPlay(2);
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame743(){
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame774(){
mcOver.mc1.gotoAndPlay(2);
mcOver.mc2.gotoAndPlay(2);
mcOver.mc3.gotoAndPlay(2);
mcOver.mc4.gotoAndPlay(2);
}
function frame847(){
stop();
}
}
}//package abracadabra_fla
Section 6
//mc_flash_53 (abracadabra_fla.mc_flash_53)
package abracadabra_fla {
import src.sound.*;
import src.timing.*;
import flash.media.*;
import flash.events.*;
import src.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.xml.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
public dynamic class mc_flash_53 extends MovieClip {
public function mc_flash_53(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package abracadabra_fla
Section 7
//mc_intro_56 (abracadabra_fla.mc_intro_56)
package abracadabra_fla {
import src.sound.*;
import src.timing.*;
import flash.media.*;
import flash.events.*;
import src.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.xml.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
public dynamic class mc_intro_56 extends MovieClip {
public var txtRainbowPieces:TextField;
public var mcAnim:intro_game_64;
public var txtIntro:TextField;
public var txtClickToStart:TextField;
public var txtInstruction:TextField;
public var txtSpecialPieces:TextField;
public var txtKeyPieces:TextField;
public var txtDoublePieces:TextField;
public var sign:mc_introsign_58;
public function mc_intro_56(){
addFrameScript(0, frame1, 50, frame51, 78, frame79, 88, frame89, 108, frame109, 115, frame116, 248, frame249, 392, frame393, 980, frame981);
}
function frame1(){
stop();
}
function frame51(){
sign.gotoAndPlay(2);
}
function frame79(){
this.txtIntro.text = MovieClip(root).txtIntro.toUpperCase();
this.txtInstruction.text = MovieClip(root).txtInstruction1;
}
function frame89(){
this.txtIntro.text = MovieClip(root).txtIntro.toUpperCase();
this.txtInstruction.text = MovieClip(root).txtInstruction1;
}
function frame109(){
mcAnim.gotoAndPlay(2);
}
function frame116(){
this.txtClickToStart.text = MovieClip(root).txtClickToStart.toUpperCase();
}
function frame249(){
this.txtInstruction.text = MovieClip(root).txtInstruction2;
}
function frame393(){
this.txtSpecialPieces.text = MovieClip(root).txtSpecialPieces;
this.txtDoublePieces.text = MovieClip(root).txtDoublePieces;
this.txtRainbowPieces.text = MovieClip(root).txtRainbowPieces;
this.txtKeyPieces.text = MovieClip(root).txtKeyPieces;
}
function frame981(){
MovieClip(root).introDone = true;
}
}
}//package abracadabra_fla
Section 8
//mc_introsign_58 (abracadabra_fla.mc_introsign_58)
package abracadabra_fla {
import src.sound.*;
import src.timing.*;
import flash.media.*;
import flash.events.*;
import src.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.xml.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
public dynamic class mc_introsign_58 extends MovieClip {
public function mc_introsign_58(){
addFrameScript(0, frame1, 9, frame10);
}
function frame1(){
stop();
}
function frame10(){
stop();
}
}
}//package abracadabra_fla
Section 9
//mc_music_92 (abracadabra_fla.mc_music_92)
package abracadabra_fla {
import src.sound.*;
import src.timing.*;
import flash.media.*;
import flash.events.*;
import src.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.xml.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
public dynamic class mc_music_92 extends MovieClip {
public function mc_music_92(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package abracadabra_fla
Section 10
//mc_sound_95 (abracadabra_fla.mc_sound_95)
package abracadabra_fla {
import src.sound.*;
import src.timing.*;
import flash.media.*;
import flash.events.*;
import src.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.xml.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
public dynamic class mc_sound_95 extends MovieClip {
public function mc_sound_95(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package abracadabra_fla
Section 11
//mc_start_78 (abracadabra_fla.mc_start_78)
package abracadabra_fla {
import src.sound.*;
import src.timing.*;
import flash.media.*;
import flash.events.*;
import src.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.xml.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
public dynamic class mc_start_78 extends MovieClip {
public function mc_start_78(){
addFrameScript(0, frame1, 9, frame10);
}
function frame1(){
stop();
}
function frame10(){
gotoAndPlay(2);
}
}
}//package abracadabra_fla
Section 12
//mc_time_34 (abracadabra_fla.mc_time_34)
package abracadabra_fla {
import src.sound.*;
import src.timing.*;
import flash.media.*;
import flash.events.*;
import src.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.xml.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
public dynamic class mc_time_34 extends MovieClip {
public function mc_time_34(){
addFrameScript(0, frame1, 599, frame600);
}
function frame1(){
stop();
}
function frame600(){
stop();
}
}
}//package abracadabra_fla
Section 13
//nextlevelhands_28 (abracadabra_fla.nextlevelhands_28)
package abracadabra_fla {
import src.sound.*;
import src.timing.*;
import flash.media.*;
import flash.events.*;
import src.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.xml.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
public dynamic class nextlevelhands_28 extends MovieClip {
public function nextlevelhands_28(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package abracadabra_fla
Section 14
//padlock_115 (abracadabra_fla.padlock_115)
package abracadabra_fla {
import src.sound.*;
import src.timing.*;
import flash.media.*;
import flash.events.*;
import src.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.xml.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
public dynamic class padlock_115 extends MovieClip {
public var mc1:MovieClip;
public var mc2:MovieClip;
public var mc3:MovieClip;
public var mc4:MovieClip;
public function padlock_115(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package abracadabra_fla
Section 15
//buzz (sound.buzz)
package sound {
import flash.media.*;
public dynamic class buzz extends Sound {
}
}//package sound
Section 16
//click (sound.click)
package sound {
import flash.media.*;
public dynamic class click extends Sound {
}
}//package sound
Section 17
//disappears (sound.disappears)
package sound {
import flash.media.*;
public dynamic class disappears extends Sound {
}
}//package sound
Section 18
//error (sound.error)
package sound {
import flash.media.*;
public dynamic class error extends Sound {
}
}//package sound
Section 19
//flash (sound.flash)
package sound {
import flash.media.*;
public dynamic class flash extends Sound {
}
}//package sound
Section 20
//gameOver (sound.gameOver)
package sound {
import flash.media.*;
public dynamic class gameOver extends Sound {
}
}//package sound
Section 21
//gameOverBad (sound.gameOverBad)
package sound {
import flash.media.*;
public dynamic class gameOverBad extends Sound {
}
}//package sound
Section 22
//intro (sound.intro)
package sound {
import flash.media.*;
public dynamic class intro extends Sound {
}
}//package sound
Section 23
//levelCleared (sound.levelCleared)
package sound {
import flash.media.*;
public dynamic class levelCleared extends Sound {
}
}//package sound
Section 24
//levelStart (sound.levelStart)
package sound {
import flash.media.*;
public dynamic class levelStart extends Sound {
}
}//package sound
Section 25
//loop (sound.loop)
package sound {
import flash.media.*;
public dynamic class loop extends Sound {
}
}//package sound
Section 26
//swish (sound.swish)
package sound {
import flash.media.*;
public dynamic class swish extends Sound {
}
}//package sound
Section 27
//tileAppears (sound.tileAppears)
package sound {
import flash.media.*;
public dynamic class tileAppears extends Sound {
}
}//package sound
Section 28
//tileRemoved7 (sound.tileRemoved7)
package sound {
import flash.media.*;
public dynamic class tileRemoved7 extends Sound {
}
}//package sound
Section 29
//tileRemoved8 (sound.tileRemoved8)
package sound {
import flash.media.*;
public dynamic class tileRemoved8 extends Sound {
}
}//package sound
Section 30
//tileRemoved9 (sound.tileRemoved9)
package sound {
import flash.media.*;
public dynamic class tileRemoved9 extends Sound {
}
}//package sound
Section 31
//timeOut (sound.timeOut)
package sound {
import flash.media.*;
public dynamic class timeOut extends Sound {
}
}//package sound
Section 32
//timeWarning (sound.timeWarning)
package sound {
import flash.media.*;
public dynamic class timeWarning extends Sound {
}
}//package sound
Section 33
//BuildArena (src.BuildArena.BuildArena)
package src.BuildArena {
import src.timing.*;
import flash.events.*;
import src.*;
import flash.display.*;
import src.math.*;
import flash.text.*;
public class BuildArena extends MovieClip {
public var mcBG:MovieClip;
private var gameRoot;
private var level;// = 1
private var gridSize_;// = 12
public var mcReset:MovieClip;
public var txtInPut:TextField;
public var mcLoad:MovieClip;
public var inputLevel:TextField;
public var mcStart:MovieClip;
public var inputGrid:TextField;
public var txtOutPut:TextField;
private var activeGridSize_:Number;
private var levelString;
public var txtNum:TextField;
public var mcGridSettings:MovieClip;
public var gridArr_;
public function BuildArena(p__1){
gridArr_ = new Array();
super();
mcGridSettings.addEventListener(MouseEvent.CLICK, changeGridSize);
mcReset.addEventListener(MouseEvent.CLICK, resetBoard);
mcStart.addEventListener(MouseEvent.CLICK, start);
mcLoad.addEventListener(MouseEvent.CLICK, load);
gameRoot = p__1;
x = 0;
y = 0;
activeGridSize_ = 8;
createGrid();
updateGrid();
}
public function createGrid(){
var l__2:* = undefined;
var l__3:* = undefined;
var l__4:* = undefined;
var l__1:* = 0;
while (l__1 < gridSize_) {
l__2 = new Array();
l__3 = 0;
while (l__3 < gridSize_) {
l__4 = new BuildArenaPiece(l__1, l__3, this);
addChild(l__4);
l__2.push(l__4);
l__3 = (l__3 + 1);
};
gridArr_.push(l__2);
l__1 = (l__1 + 1);
};
}
public function incNum(){
var l__1:* = (Number(txtNum.text) + 1);
txtNum.text = l__1;
}
public function decNum(){
var l__1:* = (Number(txtNum.text) - 1);
txtNum.text = l__1;
}
public function changeGridSize(p__1:Event){
activeGridSize_ = Number(inputGrid.text);
updateGrid();
buildLevelString();
}
public function updateGrid(){
var l__2:* = undefined;
var l__1:* = 0;
while (l__1 < gridSize_) {
l__2 = 0;
while (l__2 < gridSize_) {
if ((((l__1 < activeGridSize_)) && ((l__2 < activeGridSize_)))){
gridArr_[l__1][l__2].activate();
} else {
gridArr_[l__1][l__2].deActivate();
};
l__2 = (l__2 + 1);
};
l__1 = (l__1 + 1);
};
}
public function resetBoard(p__1:Event){
var l__3:* = undefined;
txtNum.text = "0";
var l__2:* = 0;
while (l__2 < gridSize_) {
l__3 = 0;
while (l__3 < gridSize_) {
gridArr_[l__2][l__3].setType(0);
l__3 = (l__3 + 1);
};
l__2 = (l__2 + 1);
};
}
public function load(p__1:Event){
trace("load");
levelString = txtInPut.text;
buildBoard();
}
public function buildBoard(){
var l__3:* = undefined;
var l__4:* = undefined;
txtNum.text = "0";
var l__1:* = levelString.split("-");
var l__2:* = 0;
while (l__2 < l__1.length) {
l__3 = l__1[l__2].split(",");
l__4 = 0;
while (l__4 < l__3.length) {
if ((((((((l__2 > 0)) && ((l__2 < (l__1.length - 1))))) && ((l__4 > 0)))) && ((l__4 < (l__3.length - 1))))){
gridArr_[(l__2 - 1)][(l__4 - 1)].setType(translator(Number(l__3[l__4])));
if (l__3[l__4] == 1){
incNum();
};
};
l__4 = (l__4 + 1);
};
l__2 = (l__2 + 1);
};
}
public function translator(p__1){
switch (p__1){
case 0:
return (0);
case 1:
return (1);
case 10:
return (3);
case 50:
return (2);
default:
return (999);
};
}
public function start(p__1:Event){
level = inputLevel.text;
gameRoot.startRound();
}
public function getLevel(){
return (Number(level));
}
public function getLevelString(){
return (levelString);
}
public function buildLevelString(){
var l__1:* = undefined;
var l__2:* = undefined;
levelString = "0";
l__1 = 0;
while (l__1 < (activeGridSize_ + 1)) {
levelString = (levelString + ",0");
l__1 = (l__1 + 1);
};
levelString = (levelString + "-");
l__1 = 0;
while (l__1 < activeGridSize_) {
levelString = (levelString + "0");
l__2 = 0;
while (l__2 < activeGridSize_) {
levelString = (levelString + ("," + gridArr_[l__1][l__2].getType()));
l__2 = (l__2 + 1);
};
levelString = (levelString + ",0-");
l__1 = (l__1 + 1);
};
levelString = (levelString + "0");
l__1 = 0;
while (l__1 < (activeGridSize_ + 1)) {
levelString = (levelString + ",0");
l__1 = (l__1 + 1);
};
txtOutPut.text = levelString;
}
}
}//package src.BuildArena
Section 34
//BuildArenaPiece (src.BuildArena.BuildArenaPiece)
package src.BuildArena {
import src.timing.*;
import flash.events.*;
import src.*;
import flash.display.*;
public class BuildArenaPiece extends MovieClip {
private var buildArena;
private var type_;// = 0
private var active_;
private static var WIDTH:Number = 34;
private static var HEIGHT:Number = 34;
public function BuildArenaPiece(p__1, p__2, p__3){
super();
addEventListener(MouseEvent.CLICK, onPress);
x = ((p__2 * WIDTH) + 90);
y = ((p__1 * HEIGHT) + 50);
buildArena = p__3;
}
public function activate(){
active_ = true;
render();
}
public function deActivate(){
active_ = false;
render();
}
public function render(){
gotoAndStop((type_ + 1));
visible = active_;
}
public function onPress(p__1:Event){
type_ = ((type_ + 1) % 4);
buildArena.buildLevelString();
if (type_ == 1){
buildArena.incNum();
};
if (type_ == 2){
buildArena.decNum();
};
render();
}
public function setType(p__1:Number){
type_ = p__1;
render();
}
public function getType(){
switch (type_){
case 0:
return (0);
case 1:
return (1);
case 2:
return (50);
case 3:
return (10);
};
}
}
}//package src.BuildArena
Section 35
//Communicator (src.comm.Communicator)
package src.comm {
import flash.system.*;
public class Communicator {
private var hasSentLastTick;// = false
private var hasSentGameEnd;// = false
private var hasSentGameOver;// = false
private var hasSentGameStart;// = false
private static var CMD_START_ROUND = 611;
private static var CMD_BRICK_CLICKED = 123;
private static var CMD_LAST_TICK = 779;
private static var CMD_SEND_RANDOM = 926;
private static var CMD_SEND_SCORE = 216;
private static var CMD_SET_SOUND_STATES = 436;
public function Communicator(){
super();
}
public function gameStarted(){
trace("GAME START");
if (!hasSentGameStart){
hasSentGameStart = true;
};
}
public function gameQuit(){
trace("GAME QUIT");
if (!hasSentGameOver){
hasSentGameOver = true;
};
}
public function gameEnd(p__1){
trace("GAME ENDS");
if (!hasSentGameEnd){
hasSentGameEnd = true;
};
}
public function startRound(p__1, p__2){
}
public function pieceClicked(p__1, p__2, p__3){
}
public function lastTick(p__1, p__2, p__3){
}
public function sendScore(p__1, p__2, p__3){
trace("SendScore");
}
public function sendRandom(p__1, p__2, p__3){
}
public function sendSoundStates(p__1, p__2){
}
}
}//package src.comm
Section 36
//GameDataParser (src.comm.GameDataParser)
package src.comm {
import flash.xml.*;
public class GameDataParser {
public static var records:Object;
public static var textMappings:Object;
public static var sounds:Object;
public static var levelData:Object;
public function GameDataParser(){
super();
}
public static function parseGameData(p__1:String):Object{
var l__2:Object = new Object();
var l__3:XMLDocument = new XMLDocument(p__1);
textMappings = new Object();
levelData = new Object();
l__2.textMappings = textMappings;
l__2.levelData = levelData;
var l__4:* = l__3.firstChild.childNodes;
records = new Object();
l__2.records = records;
sounds = new Object();
l__2.sounds = sounds;
var l__5:int = parseInt(l__3.firstChild.attributes.randomseed);
l__2.randomSeed = l__5;
var l__6:* = "false";
if (l__3.firstChild.attributes.relaxMode){
l__6 = String(l__3.firstChild.attributes.relaxMode);
};
if (l__6 == "true"){
l__2.relaxGame = true;
} else {
l__2.relaxGame = false;
};
var l__7:* = 0;
while (l__7 < l__4.length) {
if (l__4[l__7].nodeName == "id"){
};
if (l__4[l__7].nodeName == "game"){
l__2.gameType = new String(l__4[l__7].attributes.type);
};
if (l__4[l__7].nodeName == "userType"){
l__2.userType = new String(l__4[l__7].firstChild.nodeValue);
};
if (l__4[l__7].nodeName == "text"){
if ((((l__4[l__7].firstChild == null)) || ((l__4[l__7].firstChild == undefined)))){
textMappings[l__4[l__7].attributes.id] = (("[" + l__4[l__7].attributes.id) + "]");
} else {
textMappings[l__4[l__7].attributes.id] = new String(l__4[l__7].firstChild.nodeValue);
};
};
if (l__4[l__7].nodeName == "level"){
if ((((l__4[l__7].firstChild == null)) || ((l__4[l__7].firstChild == undefined)))){
levelData[l__4[l__7].attributes.id] = (("[" + l__4[l__7].attributes.id) + "]");
} else {
levelData[l__4[l__7].attributes.id] = new String(l__4[l__7].firstChild.nodeValue);
};
};
if (l__4[l__7].nodeName == "records"){
if ((((l__4[l__7].firstChild == null)) || ((l__4[l__7].firstChild == undefined)))){
records[l__4[l__7].attributes.id] = (("[" + l__4[l__7].attributes.id) + "]");
} else {
records[l__4[l__7].attributes.id] = new String(l__4[l__7].firstChild.nodeValue);
};
};
if (l__4[l__7].nodeName == "sounds"){
if ((((l__4[l__7].firstChild == null)) || ((l__4[l__7].firstChild == undefined)))){
sounds[l__4[l__7].attributes.id] = (("[" + l__4[l__7].attributes.id) + "]");
} else {
sounds[l__4[l__7].attributes.id] = new String(l__4[l__7].firstChild.nodeValue);
};
};
l__7 = (l__7 + 1);
};
return (l__2);
}
}
}//package src.comm
Section 37
//MtRandom (src.math.MtRandom)
package src.math {
import src.sound.*;
import flash.utils.*;
public class MtRandom {
private var mt:Array;
private var mti:uint;
public static var N:int = 624;
public static var M:int = 397;
public static var MATRIX_A:uint = 2567483615;
public static var UPPER_MASK:uint = 2147483648;
public static var LOWER_MASK:uint = 2147483647;
private static var mag01:Array = [uint(0), uint(MATRIX_A)];
public function MtRandom(p__1:uint=0){
mti = (N + 1);
super();
if (p__1 == 0){
p__1 = getTimer();
};
mt = new Array(N);
init_genrand(p__1);
}
public function setSeed(p__1:uint):void{
init_genrand(p__1);
}
public function nextInt(p__1:uint):uint{
return (((genrand_int32() & 2147483647) % p__1));
}
public function nextFloat():Number{
return ((next(24) / 16777216));
}
public function nextDouble():Number{
return ((next(24) / 16777216));
}
private function next(p__1:uint):uint{
return ((genrand_int32() & ((uint(1) << p__1) - uint(1))));
}
private function init_genrand(p__1:uint){
var l__2:uint;
var l__3:uint;
mt[0] = uint(p__1);
mti = 1;
while (mti < N) {
l__2 = (mt[(mti - 1)] ^ (mt[(mti - 1)] >>> 30));
l__3 = uint((l__2 * 1289));
l__3 = uint((l__3 * 1406077));
l__3 = uint((l__3 + mti));
mt[mti] = l__3;
mti++;
};
}
private function genrand_int32():uint{
var l__1:Number;
var l__2:uint;
if (mti >= N){
if (mti == (N + 1)){
init_genrand(5489);
};
l__2 = 0;
while (l__2 < (N - M)) {
l__1 = ((mt[l__2] & UPPER_MASK) | (mt[(l__2 + 1)] & LOWER_MASK));
mt[l__2] = ((mt[(l__2 + M)] ^ (l__1 >>> 1)) ^ mag01[uint((l__1 & 1))]);
l__2 = (l__2 + 1);
};
while (l__2 < (N - 1)) {
l__1 = ((mt[l__2] & UPPER_MASK) | (mt[(l__2 + 1)] & LOWER_MASK));
mt[l__2] = ((mt[(l__2 + (M - N))] ^ (l__1 >>> 1)) ^ mag01[uint((l__1 & 1))]);
l__2 = (l__2 + 1);
};
l__1 = ((mt[(N - 1)] & UPPER_MASK) | (mt[0] & LOWER_MASK));
mt[(N - 1)] = ((mt[(M - 1)] ^ (l__1 >>> 1)) ^ mag01[uint((l__1 & 1))]);
mti = 0;
};
l__1 = mt[mti++];
l__1 = (l__1 ^ (l__1 >>> 11));
l__1 = (l__1 ^ ((l__1 << 7) & 2636928640));
l__1 = (l__1 ^ ((l__1 << 15) & 4022730752));
l__1 = (l__1 ^ (l__1 >>> 18));
return (uint(l__1));
}
}
}//package src.math
Section 38
//ManagedSound (src.sound.ManagedSound)
package src.sound {
import flash.media.*;
public class ManagedSound {
private var manager:SoundManager;
private var ClassReference:Class;
public var activeSounds:Array;
public function ManagedSound(p__1:SoundManager, p__2:Class){
activeSounds = new Array();
super();
manager = p__1;
ClassReference = p__2;
}
public function play(p__1:Number=1, p__2:Number=0):ManagedSoundChannel{
var l__3:SoundChannel = new ClassReference().play(0, 0, new SoundTransform(p__1, p__2));
return (new ManagedSoundChannel(manager, this, l__3));
}
public function loop(p__1:Number=1, p__2:Number=0):ManagedSoundChannel{
var l__3:SoundChannel = new ClassReference().play(0, 999999999, new SoundTransform(p__1, p__2));
return (new ManagedSoundChannel(manager, this, l__3));
}
public function stop():void{
var l__1:int;
while (l__1 < activeSounds.length) {
activeSounds[l__1].stop();
l__1++;
};
}
public function setPan(p__1:Number):void{
var l__2:int;
while (l__2 < activeSounds.length) {
activeSounds[l__2].setPan(p__1);
l__2++;
};
}
public function setVolume(p__1:Number):void{
var l__2:int;
while (l__2 < activeSounds.length) {
activeSounds[l__2].setVolume(p__1);
l__2++;
};
}
public function fadeTo(p__1:Number, p__2:Number):void{
var l__3:int;
while (l__3 < activeSounds.length) {
activeSounds[l__3].fadeTo(p__1, p__2);
l__3++;
};
}
public function fadeToAndStop(p__1:Number, p__2:Number):void{
var l__3:int;
while (l__3 < activeSounds.length) {
activeSounds[l__3].fadeToAndStop(p__1, p__2);
l__3++;
};
}
public function panTo(p__1:Number, p__2:Number):void{
var l__3:int;
while (l__3 < activeSounds.length) {
activeSounds[l__3].panTo(p__1, p__2);
l__3++;
};
}
public function isPlaying():Boolean{
return ((activeSounds.length > 0));
}
public function update():void{
var l__1:int;
while (l__1 < activeSounds.length) {
activeSounds[l__1].update();
l__1++;
};
}
}
}//package src.sound
Section 39
//ManagedSoundChannel (src.sound.ManagedSoundChannel)
package src.sound {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
public class ManagedSoundChannel {
private var fadeStartVolume:Number;// = -1
private var channel:SoundChannel;
private var fadeEndVolume:Number;// = -1
private var targetVolume:Number;
private var targetPan:Number;
private var sound:ManagedSound;
private var stopAfterFade:Boolean;// = false
private var panEndTime:Number;// = -1
private var fadeEndTime:Number;// = -1
private var manager:SoundManager;
private var playing:Boolean;// = true
private var panStartTime:Number;// = -1
private var fadeStartTime:Number;// = -1
private var panEndVolume:Number;// = -1
private var panStartVolume:Number;// = -1
public function ManagedSoundChannel(p__1:SoundManager, p__2:ManagedSound, p__3:SoundChannel){
super();
manager = p__1;
sound = p__2;
channel = p__3;
p__2.activeSounds.push(this);
if (p__3 == null){
soundComplete(null);
return;
};
p__3.addEventListener(Event.SOUND_COMPLETE, soundComplete);
targetVolume = p__3.soundTransform.volume;
targetPan = p__3.soundTransform.pan;
update();
}
public function soundComplete(p__1:Event):void{
if (!playing){
return;
};
sound.activeSounds.splice(sound.activeSounds.indexOf(this), 1);
playing = false;
}
public function setPan(p__1:Number):void{
if (!playing){
return;
};
if (channel == null){
return;
};
channel.soundTransform.pan = p__1;
panStartTime = -1;
update();
}
public function setVolume(p__1:Number):void{
if (!playing){
return;
};
stopAfterFade = false;
this.targetVolume = p__1;
fadeStartTime = -1;
update();
}
public function stop():void{
if (!playing){
return;
};
if (channel == null){
return;
};
channel.stop();
soundComplete(null);
}
public function fadeTo(p__1:Number, p__2:Number):void{
if (!playing){
return;
};
fadeStartVolume = Math.sqrt(targetVolume);
fadeEndVolume = Math.sqrt(p__1);
fadeStartTime = getTimer();
fadeEndTime = (getTimer() + p__2);
stopAfterFade = false;
}
public function fadeToAndStop(p__1:Number, p__2:Number):void{
if (!playing){
return;
};
fadeTo(p__1, p__2);
stopAfterFade = true;
}
public function panTo(p__1:Number, p__2:Number):void{
if (!playing){
return;
};
panStartVolume = targetPan;
panEndVolume = p__1;
panStartTime = getTimer();
panEndTime = (getTimer() + p__2);
}
public function update():void{
var l__1:Number;
if (!playing){
return;
};
if (fadeStartTime >= 0){
l__1 = ((getTimer() - fadeStartTime) / (fadeEndTime - fadeStartTime));
if (l__1 < 0){
l__1 = 0;
};
if (l__1 > 1){
l__1 = 1;
};
targetVolume = (fadeStartVolume + ((fadeEndVolume - fadeStartVolume) * l__1));
targetVolume = (targetVolume * targetVolume);
if (l__1 == 1){
fadeStartTime = -1;
};
if ((((l__1 == 1)) && (stopAfterFade))){
stop();
};
};
if (panStartTime >= 0){
l__1 = ((getTimer() - panStartTime) / (panEndTime - panStartTime));
if (l__1 < 0){
l__1 = 0;
};
if (l__1 > 1){
l__1 = 1;
};
targetPan = (panStartVolume + ((panEndVolume - panStartVolume) * l__1));
if (l__1 == 1){
panStartTime = -1;
};
};
var l__2:Number = (targetVolume * manager.volume);
var l__3:Number = targetPan;
if (channel == null){
return;
};
if (((!((l__2 == channel.soundTransform.volume))) || (!((l__3 == channel.soundTransform.pan))))){
channel.soundTransform = new SoundTransform(l__2, l__3);
};
}
public function isPlaying():Boolean{
return (playing);
}
}
}//package src.sound
Section 40
//SoundManager (src.sound.SoundManager)
package src.sound {
import flash.utils.*;
public class SoundManager {
private var fadeStartVolume:Number;// = -1
private var lastTime:Number;// = -1
private var fadeEndTime:Number;// = -1
private var fadeStartTime:Number;// = -1
private var fadeEndVolume:Number;// = -1
public var volume:Number;// = 1
private var managedSoundMap:Object;
private var managedSounds:Array;
public function SoundManager(){
managedSoundMap = new Object();
managedSounds = new Array();
super();
}
public function get(p__1:String):ManagedSound{
var l__2:Class;
if (managedSoundMap[p__1] == null){
l__2 = (getDefinitionByName(("sound." + p__1)) as Class);
if (l__2 == null){
throw (new Error(("Failed to find sound " + p__1)));
};
managedSoundMap[p__1] = new ManagedSound(this, l__2);
managedSounds.push(managedSoundMap[p__1]);
};
return (managedSoundMap[p__1]);
}
public function fadeTo(p__1:Number, p__2:Number):void{
fadeStartVolume = Math.sqrt(volume);
fadeEndVolume = Math.sqrt(p__1);
fadeStartTime = getTimer();
fadeEndTime = (getTimer() + p__2);
}
public function setVolume(p__1:Number):void{
this.volume = p__1;
fadeStartTime = -1;
}
public function stopAll():void{
var l__1:int;
while (l__1 < managedSounds.length) {
managedSounds[l__1].stop();
l__1++;
};
}
public function update():void{
var l__3:Number;
var l__2:int;
var l__1:Number = getTimer();
if (lastTime < 0){
lastTime = l__1;
};
if (fadeStartTime >= 0){
l__3 = ((getTimer() - fadeStartTime) / (fadeEndTime - fadeStartTime));
if (l__3 < 0){
l__3 = 0;
};
if (l__3 > 1){
l__3 = 1;
};
volume = (fadeStartVolume + ((fadeEndVolume - fadeStartVolume) * l__3));
volume = (volume * volume);
if (l__3 == 1){
fadeStartTime = -1;
};
};
while (l__2 < managedSounds.length) {
managedSounds[l__2].update();
l__2++;
};
}
}
}//package src.sound
Section 41
//IFloat (src.timing.IFloat)
package src.timing {
public class IFloat {
public var ivalue:Number;
private var lastValue:Number;
private static var alpha:Number;
public function IFloat(p__1:Number){
super();
ivalue = p__1;
lastValue = p__1;
alpha = 0;
}
public function setTo(p__1:Number){
ivalue = p__1;
lastValue = p__1;
}
public function set(p__1:Number){
lastValue = ivalue;
ivalue = p__1;
}
public function get(p__1:Number){
return ((lastValue + ((ivalue - lastValue) * p__1)));
}
public function get value():Number{
return ((lastValue + ((ivalue - lastValue) * alpha)));
}
public function set value(p__1:Number):void{
ivalue = p__1;
lastValue = p__1;
}
public static function setAlpha(p__1:Number):void{
alpha = p__1;
}
}
}//package src.timing
Section 42
//Timeable (src.timing.Timeable)
package src.timing {
public interface Timeable {
function tick(:Number):void;
function render(_arg1:Number, _arg2:Number):void;
}
}//package src.timing
Section 43
//Timer (src.timing.Timer)
package src.timing {
import flash.utils.*;
public class Timer {
private var unprocessedTime:Number;// = 0
private var lastTime:Number;// = 0
private var millisPerGameTick:Number;// = 0
private var timeable:Timeable;
private var maxTickTime:Number;// = -1
private var startTime:Number;// = -1
private var time:Number;// = 0
private var tick:Number;// = 0
public function Timer(p__1:Timeable, p__2:Number){
super();
millisPerGameTick = (1000 / p__2);
timeable = p__1;
maxTickTime = 500;
}
public function getMillisPerTick():Number{
return (millisPerGameTick);
}
public function setMaxTickTime(p__1:Number):void{
maxTickTime = p__1;
}
public function advanceTime2():void{
var l__4:* = undefined;
var l__1:* = getTimer();
if (startTime < 0){
startTime = l__1;
unprocessedTime = millisPerGameTick;
};
time = (l__1 - startTime);
var l__2:* = (time - lastTime);
lastTime = time;
unprocessedTime = (unprocessedTime + l__2);
if (unprocessedTime >= millisPerGameTick){
l__4 = (maxTickTime + l__1);
do {
timeable.tick(tick);
tick++;
unprocessedTime = (unprocessedTime - millisPerGameTick);
} while ((((unprocessedTime >= millisPerGameTick)) && ((getTimer() < l__4))));
};
var l__3:Number = ((unprocessedTime % millisPerGameTick) / millisPerGameTick);
IFloat.setAlpha(l__3);
timeable.render(tick, l__3);
}
public function advanceTime(){
time = getTimer();
var l__1:* = (time - lastTime);
lastTime = time;
unprocessedTime = (unprocessedTime + l__1);
var l__2:Number = 0;
while (unprocessedTime > millisPerGameTick) {
unprocessedTime = (unprocessedTime - millisPerGameTick);
timeable.tick(tick);
tick++;
l__2 = (l__2 + 1);
if (l__2 >= 10){
unprocessedTime = 0;
};
};
var l__3:Number = (unprocessedTime / millisPerGameTick);
timeable.render(tick, l__3);
}
}
}//package src.timing
Section 44
//BinaryHeap (src.util.BinaryHeap)
package src.util {
public class BinaryHeap {
var array_:Array;
public function BinaryHeap(){
super();
array_ = new Array();
}
private function heapify(p__1:Number){
var l__7:Object;
var l__2:Boolean;
var l__4:* = undefined;
var l__5:* = undefined;
var l__6:* = undefined;
var l__3:* = array_.length;
while (!(l__2)) {
l__4 = ((p__1 << 1) + 1);
l__5 = ((p__1 << 1) + 2);
l__6 = p__1;
if (((!((array_[l__4] == null))) && (!((array_[l__5] == null))))){
if ((((l__4 < l__3)) && ((array_[l__4].heapValue < array_[l__5].heapValue)))){
l__6 = l__4;
};
};
if (((!((array_[l__5] == null))) && (!((array_[l__6] == null))))){
if ((((l__5 < l__3)) && ((array_[l__5].heapValue < array_[l__6].heapValue)))){
l__6 = l__5;
};
};
if (l__6 != p__1){
l__7 = array_[p__1];
array_[p__1] = array_[l__6];
array_[l__6] = l__7;
p__1 = l__6;
} else {
l__2 = true;
};
};
}
public function size():Number{
return (array_.length);
}
public function removeMin():Object{
var l__1:* = array_.shift();
heapify(0);
return (l__1);
}
public function insert(p__1:Object){
var l__2:Number = array_.length;
array_.length++;
while ((((l__2 > 0)) && ((array_[((l__2 - 1) >> 1)].heapValue > p__1.heapValue)))) {
array_[l__2] = array_[((l__2 - 1) >> 1)];
l__2 = ((l__2 - 1) >> 1);
};
array_[l__2] = p__1;
}
}
}//package src.util
Section 45
//AbraCadabra (src.AbraCadabra)
package src {
import src.sound.*;
import src.timing.*;
import flash.events.*;
import flash.display.*;
import src.math.*;
import src.comm.*;
import flash.text.*;
import src.BuildArena.*;
import flash.utils.*;
import flash.filters.*;
import flash.net.*;
public class AbraCadabra extends MovieClip implements Timeable {
public var mcScore:MovieClip;
public var txtDoublePieces;
public var txtRainbowPieces;
public var txtSpecialPieces;
public var txtClickToStart;
public var txtIntro;
public var txtKeyPieces;
public var txtEndState:TextField;
public var mcEndGameButton:MovieClip;
public var introDone;// = false
public var mcSFX:MovieClip;
public var mcClock:MovieClip;
private var relaxLevelScore:int;
private var textTimer;
private var flashAnim;
private var startIntroMusic:Boolean;// = true
public var mcMusic:MovieClip;
public var mcBetweenRoundsSign:MovieClip;
private var buildArena:BuildArena;// = null
private var sfxOn;// = true
public var relaxLevelLimit:int;// = 99999
private var startTime;
public var mcEndGameSign:MovieClip;
private var communicator:Communicator;
public var txtFPS:TextField;
public var mcBG:MovieClip;
private var lastFps;
public var mcIntro:MovieClip;
private var level;// = 0
private var relaxLimitMissed:Boolean;// = false
private var clientVersion;// = "1.0"
public var mcLevel:MovieClip;
private var score;// = 0
public var txtRelaxLevelGoal:TextField;
private var endAnimLength;
private var ticksLeft;
var firstFrame:Boolean;// = true
private var userType;
private var frames;
public var mcGame:Game;
private var introAnimAt;// = 1
private var m_mainTimer;
private var currentTick;
private var gameState;
private var noOfRend;// = 0
private var random:MtRandom;
private var fpsTimer;
private var endAnimAt;
private var musicOn;// = true
private var fps;
public var txtEndState2:TextField;
public var txtEndState3:TextField;
public var txtInstruction1;
public var txtInstruction2;
public var mcFlash:MovieClip;
public var parsedGameData:Object;// = null
private var letterArr;
public var musicManager:SoundManager;
public var sfxManager:SoundManager;
private static var STATE_WAIT_FOR_GAMEDATA = 0;
private static var STATE_SHOW_INFO_SCREEN = 1;
private static var STATE_PLAY_GAME = 2;
private static var STATE_BETWEEN_ROUNDS = 3;
private static var STATE_END_GAME = 4;
private static var STATE_NOT_RUNNING = 5;
private static var STATE_PRE_QUIT = 6;
private static var TICKS_PER_SEC = 25;
public static var RELAX_START_LEVEL_1_TARGET:int = 4500;
public static var RELAX_START_LEVEL_2_TARGET:int = 10000;
public static var RELAX_START_LEVEL_3_TARGET:int = 10000;
public static var RELAX_TARGET_MODIFIER:int = 1000;
private static var BUILD_MODE = false;
private static var DEBUG_MODE = true;
private static var DEBUG_GAME_DATA = (((((((((((((((((((((((((((((((((((((((((((((((((((("<gamedata randomseed=\"586334221\" timelimit=\"660\" lang=\"de\" relaxMode=\"false\">" + "<text id=\"game_starts_in\">The game starts in [0] seconds!</text>") + "<text id=\"game_next_screen\">Next level in [0] seconds!</text>") + "<text id=\"game_ends_in\">Game ends in [0] seconds!</text>") + "<text id=\"round_starts_in\">Next level strats in [0] seconds!</text>") + "<text id=\"game_starts_in\">Game starkts in [0] seconds!</text>") + "<text id=\"txtIntro\">Instructions</text>") + "<text id=\"txtInstruction1\">You can connect a symbol with another one of the same type if the path netween them consists of two or less turns.</text>") + "<text id=\"txtInstruction2\">txtInstruction2</text>") + "<text id=\"txtSpecialPieces\">txtSpecialPieces</text>") + "<text id=\"txtDoublePieces\">txtDoublePieces</text>") + "<text id=\"txtRainbowPieces\">txtRainbowPieces</text>") + "<text id=\"txtKeyPieces\">txtKeyPieces</text>") + "<text id=\"txtClickToStart\">Click to start game</text>") + "<text id=\"txtNextLevel\">Next Level</text>") + "<text id=\"txtNoMoreMoves\">No more moves!</text>") + "<text id=\"txtTimeUp\">Time is up!</text>") + "<text id=\"txtGameCleared\">Game Cleared!</text>") + "<text id=\"txtOpenUserEnd\">Register to play!</text>") + "<text id=\"txtTimeBonusLabel\">Time Bonus:</text>") + "<text id=\"txtScoreLabel\">Score:</text>") + "<text id=\"txtRecordScoreLabel\">Record:</text>") + "<text id=\"game_ends_in\">Game ends in [0] seconds!</text>") + "<text id=\"level_score\">Level score</text>") + "<text id=\"level_goal\">Level goal</text>") + "<text id=\"level_score_not_reached\">Not reached</text>") + "<text id=\"longest_combo\">Longest combo</text>") + "<text id=\"highest_combo\">Highest combo score</text>") + "<text id=\"now\">Now</text>") + "<text id=\"record\">Record</text>") + "<level id=\"1\">0,0,0,0,0,0,0,0,0,0,0,0-0,0,1,0,1,0,1,0,1,0,1,0-0,1,0,1,0,1,0,1,0,1,0,0-0,0,1,0,1,0,1,0,1,0,1,0-0,1,0,1,0,1,0,1,0,1,0,0-0,0,1,0,1,0,1,0,1,0,1,0-0,1,0,1,0,1,0,1,0,1,0,0-0,0,1,0,1,0,1,0,1,0,1,0-0,1,0,1,0,1,0,1,0,1,0,0-0,0,1,0,1,0,1,0,1,0,1,0-0,1,0,1,0,1,0,1,0,1,0,0-0,0,0,0,0,0,0,0,0,0,0,0</level>") + "<level id=\"2\">0,0,0,0,0,0,0,0,0,0,0,0-0,1,0,1,0,1,0,1,0,1,0,0-0,0,1,0,1,0,1,0,1,0,1,0-0,1,0,1,0,1,0,1,0,1,0,0-0,0,1,0,1,0,1,0,1,0,1,0-0,1,0,1,0,1,0,1,0,1,0,0-0,0,1,0,1,0,1,0,1,0,1,0-0,1,0,1,0,1,0,1,0,1,0,0-0,0,1,0,1,0,1,0,1,0,1,0-0,1,0,1,0,1,0,1,0,1,0,0-0,0,1,0,1,0,1,0,1,0,1,0-0,0,0,0,0,0,0,0,0,0,0,0</level>") + "<level id=\"3\">0,0,0,0,0,0,0,0,0,0,0,0-0,1,0,1,1,0,0,1,1,0,1,0-0,0,1,0,0,1,1,0,0,1,0,0-0,1,0,1,0,1,1,0,1,0,1,0-0,0,1,0,1,0,0,1,0,1,0,0-0,1,0,1,0,1,0,0,1,0,1,0-0,1,0,1,0,0,1,0,1,0,1,0-0,0,1,0,1,0,0,1,0,1,0,0-0,1,0,1,0,1,1,0,1,0,1,0-0,0,1,0,0,1,1,0,0,1,0,0-0,1,0,1,1,0,0,1,1,0,1,0-0,0,0,0,0,0,0,0,0,0,0,0</level>") + "<level id=\"4\">0,0,0,0,0,0,0,0,0,0,0,0-0,1,0,1,0,1,1,0,1,0,1,0-0,0,1,0,1,0,0,1,0,1,0,0-0,1,0,1,0,1,1,0,1,0,1,0-0,0,1,0,1,0,0,1,0,1,0,0-0,1,0,1,0,1,1,0,1,0,0,0-0,0,0,1,0,1,1,0,1,0,1,0-0,0,1,0,1,0,0,1,0,1,0,0-0,1,0,1,0,1,1,0,1,0,1,0-0,0,1,0,1,0,0,1,0,1,0,0-0,1,0,1,0,1,1,0,1,0,1,0-0,0,0,0,0,0,0,0,0,0,0,0</level>") + "<level id=\"5\">0,0,0,0,0,0,0,0,0,0,0,0,0,0-0,1,1,1,1,1,1,1,1,1,1,1,1,0-0,1,0,0,0,0,0,0,0,0,0,0,1,0-0,1,0,1,1,1,1,1,1,1,1,0,1,0-0,1,0,1,0,0,0,0,0,0,1,0,1,0-0,1,0,1,0,1,1,1,1,0,1,0,1,0-0,1,0,1,0,1,0,0,1,0,1,0,1,0-0,1,0,1,0,1,0,0,1,0,1,0,1,0-0,1,0,1,0,1,1,1,1,0,1,0,1,0-0,1,0,1,0,0,0,0,0,0,1,0,1,0-0,1,0,1,1,1,1,1,1,1,1,0,1,0-0,1,0,0,0,0,0,0,0,0,0,0,1,0-0,1,1,1,1,1,1,1,1,1,1,1,1,0-0,0,0,0,0,0,0,0,0,0,0,0,0,0</level>") + "<level id=\"6\">0,0,0,0,0,0,0,0,0,0,0,0,0,0-0,1,1,1,1,0,1,1,0,1,1,1,1,0-0,1,0,0,1,0,1,1,0,1,0,0,1,0-0,1,1,1,1,0,1,1,0,1,1,1,1,0-0,0,0,0,0,0,0,0,0,0,0,0,0,0-0,1,1,1,1,0,1,1,0,1,1,1,1,0-0,1,0,0,1,0,1,1,0,1,0,0,1,0-0,1,0,0,1,0,1,1,0,1,0,0,1,0-0,1,1,1,1,0,1,1,0,1,1,1,1,0-0,0,0,0,0,0,0,0,0,0,0,0,0,0-0,1,1,1,1,0,1,1,0,1,1,1,1,0-0,1,0,0,1,0,1,1,0,1,0,0,1,0-0,1,1,1,1,0,1,1,0,1,1,1,1,0-0,0,0,0,0,0,0,0,0,0,0,0,0,0</level>") + "<level id=\"7\">0,0,0,0,0,0,0,0,0,0,0,0,0,0-0,1,1,1,0,1,1,1,1,0,1,1,1,0-0,1,0,1,0,1,0,0,1,0,1,0,1,0-0,1,0,1,0,1,0,0,1,0,1,0,1,0-0,1,1,1,0,1,1,1,1,0,1,1,1,0-0,0,0,0,0,0,0,0,0,0,0,0,0,0-0,1,1,1,0,1,1,1,1,0,1,1,1,0-0,1,1,1,0,1,1,1,1,0,1,1,1,0-0,0,0,0,0,0,0,0,0,0,0,0,0,0-0,1,1,1,0,1,1,1,1,0,1,1,1,0-0,1,0,1,0,1,0,0,1,0,1,0,1,0-0,1,0,1,0,1,0,0,1,0,1,0,1,0-0,1,1,1,0,1,1,1,1,0,1,1,1,0-0,0,0,0,0,0,0,0,0,0,0,0,0,0</level>") + "<level id=\"8\">0,0,0,0,0,0,0,0,0,0,0,0,0,0-0,1,1,1,1,0,1,1,50,1,1,1,1,0-0,1,0,0,1,0,1,1,50,1,0,0,1,0-0,1,1,1,1,0,1,1,50,1,1,1,1,0-0,0,0,0,50,50,0,0,50,10,0,0,0,0-0,1,1,1,1,50,1,1,0,1,1,1,1,0-0,1,0,0,1,10,1,1,0,1,0,0,1,0-0,1,0,0,1,50,1,1,0,1,0,0,1,0-0,1,1,1,1,50,1,1,0,1,1,1,1,0-0,0,0,0,0,50,0,0,50,10,0,0,0,0-0,1,1,1,1,50,1,1,50,1,1,1,1,0-0,1,0,0,1,50,1,1,50,1,0,0,1,0-0,1,1,1,1,50,1,1,50,1,1,1,1,0-0,0,0,0,0,0,0,0,0,0,0,0,0,0</level>") + "<level id=\"9\">0,0,0,0,0,0,0,0,0,0,0,0,0,0-0,1,1,1,0,1,1,1,1,0,1,1,1,0-0,1,0,1,0,1,0,0,1,0,1,0,1,0-0,1,0,1,50,1,0,0,1,50,1,0,1,0-0,1,1,1,50,1,1,1,1,50,1,1,1,0-0,0,0,0,50,0,0,0,0,10,0,0,0,0-0,1,1,1,50,1,1,1,1,50,1,1,1,0-0,1,1,1,50,1,1,1,1,50,1,1,1,0-0,0,0,0,10,0,0,0,0,50,0,0,0,0-0,1,1,1,50,1,1,1,1,50,1,1,1,0-0,1,0,1,50,1,0,0,1,50,1,0,1,0-0,1,0,1,0,1,0,0,1,0,1,0,1,0-0,1,1,1,0,1,1,1,1,0,1,1,1,0-0,0,0,0,0,0,0,0,0,0,0,0,0,0</level>") + "<level id=\"10\">0,0,0,0,0,0,0,0,0,0,0,0,0,0-0,1,1,1,1,1,1,1,1,1,1,1,1,0-0,1,10,50,50,0,0,0,0,50,50,50,1,0-0,1,50,1,1,1,1,1,1,1,1,10,1,0-0,1,50,1,0,0,0,0,0,0,1,50,1,0-0,1,0,1,0,1,1,1,1,0,1,50,1,0-0,1,0,1,0,1,0,0,1,0,1,0,1,0-0,1,0,1,50,1,0,0,1,0,1,0,1,0-0,1,0,1,50,1,1,1,1,0,1,0,1,0-0,1,0,1,10,50,50,0,0,0,1,50,1,0-0,1,0,1,1,1,1,1,1,1,1,50,1,0-0,1,0,0,0,0,0,0,0,50,50,10,1,0-0,1,1,1,1,1,1,1,1,1,1,1,1,0-0,0,0,0,0,0,0,0,0,0,0,0,0,0</level>") + "<level id=\"11\">0,0,0,0,0,0,0,0,0,0,0,0,0,0-0,1,1,1,10,1,1,1,1,0,1,1,1,0-0,1,0,1,50,1,0,0,1,0,1,0,1,0-0,1,0,1,50,1,0,0,1,0,1,0,1,0-0,1,0,1,50,1,0,0,1,0,1,50,1,0-0,1,0,1,50,1,0,0,1,0,1,50,1,0-0,1,10,1,0,1,1,1,1,0,1,50,1,0-0,1,50,1,0,1,1,1,1,0,1,10,1,0-0,1,50,1,0,1,0,0,1,10,1,0,1,0-0,1,0,1,0,1,0,0,1,50,1,0,1,0-0,1,0,1,0,1,0,0,1,50,1,0,1,0-0,1,0,1,0,1,0,0,1,50,1,0,1,0-0,1,1,1,0,1,1,1,1,50,1,1,1,0-0,0,0,0,0,0,0,0,0,0,0,0,0,0</level>") + "<level id=\"12\">0,0,0,0,0,0,0,0,0,0,0,0,0,0-0,1,1,1,1,1,1,1,1,1,1,1,1,0-0,1,0,0,0,0,0,0,0,0,0,0,1,0-0,1,1,1,1,1,1,1,1,1,1,1,1,0-0,50,50,50,50,50,10,0,0,0,0,0,0,0-0,1,1,1,1,1,1,1,1,1,1,1,1,0-0,1,0,50,0,0,1,0,0,0,1,0,1,0-0,1,0,10,0,0,1,0,0,0,1,0,1,0-0,1,1,50,1,1,1,1,1,1,1,1,1,0-0,0,0,0,0,0,0,10,50,50,50,50,50,0-0,1,1,1,1,1,1,1,1,1,1,1,1,0-0,1,0,0,0,0,0,0,0,0,0,0,1,0-0,1,1,1,1,1,1,1,1,1,1,1,1,0-0,0,0,0,0,0,0,0,0,0,0,0,0,0</level>") + "<level id=\"13\">0,0,0,0,0,0,0,0,0,0,0,0,0,0-0,1,1,1,1,1,1,1,1,1,1,1,1,0-0,1,0,0,0,0,0,0,0,0,0,0,1,0-0,1,1,1,1,1,1,1,1,1,1,1,1,0-0,0,1,50,50,50,50,50,50,50,10,1,0,0-0,0,0,1,1,1,1,1,1,1,1,0,0,0-0,1,0,1,0,1,1,1,1,0,1,0,1,0-0,0,1,0,1,0,1,1,0,1,0,1,0,0-0,1,0,1,1,0,1,1,0,1,1,0,1,0-0,0,1,0,0,1,1,1,1,0,0,1,0,0-0,1,0,1,0,1,1,1,1,0,1,0,1,0-0,0,1,0,1,0,1,1,0,1,0,1,0,0-0,0,0,1,0,1,1,1,1,0,1,0,0,0-0,0,0,0,0,0,0,0,0,0,0,0,0,0</level>") + "<level id=\"14\">0,0,0,0,0,0,0,0,0,0,0,0,0,0-0,1,1,1,1,1,1,1,1,1,1,1,1,0-0,1,0,1,0,0,1,1,50,50,1,0,1,0-0,0,1,0,1,0,0,0,10,1,0,1,0,0-0,0,0,1,0,1,1,1,1,0,1,0,0,0-0,1,1,1,0,1,0,0,1,0,1,1,1,0-0,1,0,1,0,1,1,1,1,0,1,0,1,0-0,1,0,1,0,1,0,0,1,0,1,0,1,0-0,1,1,1,50,1,1,1,1,0,1,1,1,0-0,1,0,0,50,1,0,0,1,0,0,0,1,0-0,0,1,0,10,1,1,1,1,0,0,1,0,0-0,0,0,1,50,50,0,0,0,0,1,0,0,0-0,1,1,1,1,1,1,1,1,1,1,1,1,0-0,0,0,0,0,0,0,0,0,0,0,0,0,0</level>") + "<level id=\"15\">0,0,0,0,0,0,0,0,0,0,0,0,0,0-0,1,1,1,1,1,1,1,1,1,1,1,1,0-0,1,0,50,0,0,1,0,0,0,0,0,1,0-0,50,1,50,1,1,1,1,1,1,1,1,50,0-0,50,1,10,1,0,0,0,0,1,0,1,50,0-0,10,1,0,1,1,1,1,1,1,0,1,10,0-0,0,1,0,1,0,1,1,0,1,0,1,0,0-0,0,1,0,1,0,1,1,0,1,0,1,0,0-0,10,1,0,1,1,1,1,1,1,0,1,10,0-0,50,1,0,1,0,0,0,0,1,50,1,50,0-0,50,1,1,1,1,1,1,1,1,50,1,50,0-0,1,0,0,0,0,0,1,0,0,10,0,1,0-0,1,1,1,1,1,1,1,1,1,1,1,1,0-0,0,0,0,0,0,0,0,0,0,0,0,0,0</level>") + "<level id=\"16\">0,0,0,0,0,0,0,0,0,0,0,0,0,0-0,1,0,1,50,1,1,1,1,50,1,0,1,0-0,1,0,1,10,1,0,0,1,50,1,0,1,0-0,1,0,1,50,1,1,0,1,50,1,0,1,0-0,1,0,1,50,1,0,1,1,50,1,0,1,0-0,1,0,1,50,1,0,0,1,50,1,0,1,0-0,1,0,1,50,1,1,1,1,50,1,0,1,0-0,1,0,1,50,1,1,1,1,50,1,0,1,0-0,1,0,1,50,1,0,0,1,50,1,0,1,0-0,1,0,1,50,1,1,0,1,50,1,0,1,0-0,1,0,1,50,1,0,1,1,50,1,0,1,0-0,1,0,1,50,1,0,0,1,50,1,0,1,0-0,1,0,1,50,1,1,1,1,10,1,0,1,0-0,0,0,0,0,0,0,0,0,0,0,0,0,0</level>") + "<records id=\"recordScore\">1234</records>") + "<records id=\"recordSizeCombo\">2</records>") + "<records id=\"recordScoreCombo\">100</records>\n") + "<sounds id=\"sfxOn\">0</sounds>") + "<sounds id=\"musicOn\">0</sounds>") + "<userType id=\"0\">1</userType>") + "</gamedata>");
public static var relaxGame:Boolean;
public function AbraCadabra(){
var l__1:Object;
var l__2:String;
letterArr = new Array();
musicManager = new SoundManager();
sfxManager = new SoundManager();
super();
m_mainTimer = new Timer(this, TICKS_PER_SEC);
addEventListener("enterFrame", drive);
mcEndGameButton.addEventListener(MouseEvent.CLICK, endGamePressed);
mcBetweenRoundsSign.visible = false;
mcEndGameSign.visible = false;
txtEndState.mouseEnabled = false;
txtEndState2.mouseEnabled = false;
txtEndState3.mouseEnabled = false;
txtRelaxLevelGoal.mouseEnabled = false;
mcIntro.addEventListener(MouseEvent.CLICK, introPressed);
mcBetweenRoundsSign.addEventListener(MouseEvent.CLICK, betweenRoundsPressed);
mcEndGameSign.addEventListener(MouseEvent.CLICK, outroPressed);
mcSFX.addEventListener(MouseEvent.CLICK, sfxButtonClicked);
mcMusic.addEventListener(MouseEvent.CLICK, musicButtonClicked);
mcBG.cacheAsBitmap = true;
communicator = new Communicator();
l__1 = new Object();
l__1.message = DEBUG_GAME_DATA;
l__1.success = true;
if ((((l__1 == null)) || (!(l__1.success)))){
trace(("oa kuka ur " + l__1));
} else {
l__2 = l__1.message;
parsedGameData = GameDataParser.parseGameData(l__2);
random = new MtRandom((int((Math.random() * 10000000000)) + 1));
userType = parsedGameData.userType;
relaxGame = parsedGameData.relaxGame;
txtIntro = parsedGameData.textMappings["txtIntro"];
txtInstruction1 = parsedGameData.textMappings["txtInstruction1"];
txtInstruction2 = parsedGameData.textMappings["txtInstruction2"];
txtSpecialPieces = parsedGameData.textMappings["txtSpecialPieces"];
txtDoublePieces = parsedGameData.textMappings["txtDoublePieces"];
txtRainbowPieces = parsedGameData.textMappings["txtRainbowPieces"];
txtKeyPieces = parsedGameData.textMappings["txtKeyPieces"];
txtClickToStart = parsedGameData.textMappings["txtClickToStart"];
if (Number(parsedGameData.sounds["sfxOn"]) == 1){
mcSFX.gotoAndStop(2);
sfxOn = false;
mcGame.sfxOn = false;
sfxManager.setVolume(0);
};
if (Number(parsedGameData.sounds["musicOn"]) == 1){
mcMusic.gotoAndStop(2);
musicOn = false;
mcGame.musicOn = false;
musicManager.setVolume(0);
};
if (BUILD_MODE){
showBuildArena();
} else {
showInfoScreen();
};
};
}
private function drive(p__1:Event){
if (firstFrame){
firstFrame = false;
};
m_mainTimer.advanceTime2();
}
public function tick(p__1:Number):void{
var l__2:* = undefined;
currentTick = p__1;
switch (gameState){
case STATE_SHOW_INFO_SCREEN:
if (startIntroMusic){
startIntroMusic = false;
musicManager.get("intro").play();
};
ticksLeft--;
introAnimAt++;
if (introDone){
stage.frameRate = 60;
startRound();
};
break;
case STATE_PLAY_GAME:
mcGame.tick(p__1);
break;
case STATE_BETWEEN_ROUNDS:
flashAnim++;
l__2 = 0;
while (l__2 < letterArr.length) {
letterArr[l__2].tick(p__1);
l__2 = (l__2 + 1);
};
ticksLeft--;
if (ticksLeft == 0){
startRound();
};
break;
case STATE_END_GAME:
textTimer--;
ticksLeft--;
if (textTimer == 0){
txtEndState.text = "";
txtEndState2.text = "";
txtEndState3.text = "";
};
if (textTimer <= 0){
endAnimAt = Math.min((endAnimAt + 1), endAnimLength);
};
mcEndGameSign.mcGameOverText.txtGameEndsIn.text = parsedGameData.textMappings["game_ends_in"].split("[0]").join(("" + Math.round((ticksLeft / TICKS_PER_SEC)))).toUpperCase();
if (ticksLeft == 0){
gamePreQuit();
};
break;
case STATE_NOT_RUNNING:
break;
case STATE_PRE_QUIT:
ticksLeft--;
if (ticksLeft == 0){
gameQuit();
};
break;
};
}
public function render(tick:Number, alpha:Number):void{
var tick = tick;
var alpha = alpha;
var i:* = undefined;
musicManager.update();
sfxManager.update();
switch (gameState){
case STATE_SHOW_INFO_SCREEN:
break;
case STATE_PLAY_GAME:
mcGame.render(tick, alpha);
break;
case STATE_BETWEEN_ROUNDS:
mcFlash.gotoAndStop(flashAnim);
i = 0;
while (i < letterArr.length) {
letterArr[i].render(tick, alpha);
i = (i + 1);
};
break;
case STATE_END_GAME:
mcEndGameSign.gotoAndStop(endAnimAt);
break;
};
//unresolved jump
var _slot1 = e;
trace("Error in render()");
trace(_slot1);
}
public function removeText(){
var l__1:* = 0;
while (l__1 < letterArr.length) {
removeChild(letterArr[l__1]);
l__1 = (l__1 + 1);
};
letterArr = [];
}
public function showBuildArena(){
buildArena = new BuildArena(this);
addChild(buildArena);
}
public function introPressed(p__1:Event){
if (gameState == STATE_SHOW_INFO_SCREEN){
mcIntro.stop();
introDone = true;
};
}
public function outroPressed(p__1:Event){
if ((((gameState == STATE_END_GAME)) && ((ticksLeft < (26 * 25))))){
ticksLeft = 1;
};
}
public function betweenRoundsPressed(p__1:Event){
if (gameState == STATE_BETWEEN_ROUNDS){
ticksLeft = 1;
};
}
public function showInfoScreen():void{
trace("INFO SCREEN");
stage.frameRate = 25;
mcIntro.gotoAndPlay(2);
gameState = STATE_SHOW_INFO_SCREEN;
}
public function startRound():void{
trace("startRound()");
if (BUILD_MODE){
buildArena.visible = false;
};
if (level == 0){
if (!DEBUG_MODE){
communicator.gameStarted();
};
mcIntro.stop();
removeChild(mcIntro);
musicManager.get("intro").stop();
musicManager.get("loop").loop(0).fadeTo(0.6, 500);
};
musicManager.get("levelStart").play();
mcBetweenRoundsSign.visible = false;
level++;
var l__1:* = getLevelData();
mcLevel.txtLevel.text = level;
gameState = STATE_PLAY_GAME;
mcGame.startRound(this, random, l__1, userType, communicator, currentTick, clientVersion, level);
txtEndState.text = "";
txtEndState2.text = "";
txtEndState3.text = "";
}
public function getLevelData(){
var l__5:int;
var l__1:* = new Array();
var l__2:* = new Array();
var l__3:* = 0;
if (relaxGame){
l__5 = (level % 3);
if (l__5 == 0){
l__5 = 3;
};
trace(("level " + level));
trace(("tempLevel " + l__5));
switch (l__5){
case 1:
l__3 = (random.nextInt(4) + 1);
relaxLevelLimit = (RELAX_START_LEVEL_1_TARGET + (int((level / 3)) * RELAX_TARGET_MODIFIER));
break;
case 2:
l__3 = ((random.nextInt(3) + 1) + 4);
relaxLevelLimit = (RELAX_START_LEVEL_2_TARGET + (int((level / 3)) * RELAX_TARGET_MODIFIER));
break;
case 3:
l__3 = (((random.nextInt(9) + 1) + 4) + 3);
relaxLevelLimit = (RELAX_START_LEVEL_3_TARGET + ((int((level / 3)) - 1) * RELAX_TARGET_MODIFIER));
break;
};
trace(("relaxLevelLimit: " + relaxLevelLimit));
} else {
switch (level){
case 1:
l__3 = (random.nextInt(4) + 1);
break;
case 2:
l__3 = ((random.nextInt(3) + 1) + 4);
break;
case 3:
l__3 = (((random.nextInt(9) + 1) + 4) + 3);
break;
};
};
l__1 = parsedGameData.levelData[l__3].split("-");
if (BUILD_MODE){
l__1 = buildArena.getLevelString().split("-");
level = buildArena.getLevel();
};
var l__4:* = 0;
while (l__4 < l__1.length) {
l__2.push(l__1[l__4].split(","));
l__4 = (l__4 + 1);
};
return (l__2);
}
public function endGamePressed(p__1:Event):void{
var l__2:* = undefined;
if (BUILD_MODE){
mcGame.clearBoard();
buildArena.visible = true;
} else {
l__2 = 0;
while (l__2 < letterArr.length) {
letterArr[l__2].visible = false;
l__2 = (l__2 + 1);
};
if (gameState != STATE_END_GAME){
if (gameState == STATE_PLAY_GAME){
mcGame.clearBoard();
endRound(mcGame.getScore(), false, mcGame.highestComboScore, mcGame.longestCombo, 0);
} else {
if (gameState == STATE_SHOW_INFO_SCREEN){
musicManager.get("intro").stop();
mcIntro.stop();
removeChild(mcIntro);
};
};
sfxManager.get("timeWarning").stop();
txtEndState.y = -200;
endRound(0, false, mcGame.highestComboScore, mcGame.longestCombo, 0);
};
};
}
public function endRound(p__1, p__2, p__3, p__4, p__5){
relaxLevelScore = p__1;
if (!BUILD_MODE){
this.score = (this.score + p__1);
};
if (userType == 0){
endGame(p__2, p__3, p__4, 0);
} else {
if (p__2){
if (relaxGame){
if (p__1 < relaxLevelLimit){
relaxLimitMissed = true;
endGame(false, p__3, p__4, p__5);
} else {
nextRound();
};
} else {
if (level < 3){
nextRound();
} else {
endGame(p__2, p__3, p__4, p__5);
};
};
} else {
endGame(p__2, p__3, p__4, p__5);
};
};
}
public function nextRound(){
var l__1:String;
var l__2:String;
trace("Next round!!!");
if (relaxGame){
trace("RelaxeGame");
if (parsedGameData.textMappings["level_score"]){
l__1 = parsedGameData.textMappings["level_score"];
} else {
l__1 = "Level score";
};
l__1 = ((l__1 + " ") + String(relaxLevelScore));
txtEndState.text = l__1;
if (parsedGameData.textMappings["level_goal"]){
l__2 = parsedGameData.textMappings["level_goal"];
} else {
l__2 = "Level goal";
};
l__2 = ((l__2 + " ") + String(relaxLevelLimit));
txtEndState2.text = l__2;
};
animLetters(parsedGameData.textMappings["txtNextLevel"].toUpperCase());
sfxManager.get("flash").play();
flashAnim = 0;
ticksLeft = (TICKS_PER_SEC * 3);
gameState = STATE_BETWEEN_ROUNDS;
}
public function animLetters(p__1){
var l__3:* = undefined;
p__1 = p__1.split("");
var l__2:* = 0;
while (l__2 < p__1.length) {
l__3 = new Letter(p__1[l__2], l__2);
letterArr.push(l__3);
addChild(l__3);
l__2 = (l__2 + 1);
};
}
public function endGame(p__1, p__2, p__3, p__4):void{
var l__8:String;
var l__9:String;
var l__10:String;
var l__5:* = undefined;
var l__6:* = undefined;
if (!p__1){
communicator.lastTick((currentTick + 1), 0, mcGame.noOfRandoms);
} else {
communicator.lastTick((currentTick + 1), p__4, mcGame.noOfRandoms);
};
musicManager.get("loop").stop();
l__6 = 0;
l__5 = l__6;
if (!sfxOn){
l__5 = 1;
};
if (!musicOn){
l__6 = 1;
};
communicator.sendSoundStates(l__5, l__6);
var l__7:* = 0;
if (p__1){
musicManager.get("gameOver").play();
l__7 = Math.round(((p__4 / (25 * 360)) * 10000));
updateScoreSign(l__7, false);
txtEndState.text = parsedGameData.textMappings["txtGameCleared"];
} else {
mcEndGameSign.mcScore.gotoAndStop(11);
musicManager.get("gameOverBad").play();
if (relaxGame){
if (relaxLimitMissed == false){
txtEndState.text = parsedGameData.textMappings["txtNoMoreMoves"];
} else {
if (parsedGameData.textMappings["level_score"]){
l__8 = parsedGameData.textMappings["level_score"];
} else {
l__8 = "Level score";
};
l__8 = ((l__8 + " ") + String(relaxLevelScore));
txtEndState.text = l__8;
if (parsedGameData.textMappings["level_goal"]){
l__9 = parsedGameData.textMappings["level_goal"];
} else {
l__9 = "Level goal";
};
l__9 = ((l__9 + " ") + String(relaxLevelLimit));
txtEndState2.text = l__9;
if (parsedGameData.textMappings["level_score_not_reached"]){
l__10 = parsedGameData.textMappings["level_score_not_reached"];
} else {
l__10 = "Not reached";
};
txtEndState3.text = l__10;
};
} else {
if (p__4 > 0){
txtEndState.text = parsedGameData.textMappings["txtNoMoreMoves"];
} else {
txtEndState.text = parsedGameData.textMappings["txtTimeUp"];
};
};
};
if (relaxGame == false){
trace("relaxeGame=false");
score = (score + l__7);
};
communicator.gameEnd(score);
mcEndGameSign.visible = true;
mcEndGameSign.mcScore.txtScore.text = score;
mcEndGameSign.mcScore.txtScoreLabel.text = parsedGameData.textMappings["txtScoreLabel"].toUpperCase();
mcEndGameSign.mcScore.txtRecordScore.text = parsedGameData.records["recordScore"];
if (score > Number(parsedGameData.records["recordScore"])){
mcEndGameSign.mcScore.txtRecordScore.text = score;
};
mcEndGameSign.mcScore.txtRecordScoreLabel.text = parsedGameData.textMappings["txtRecordScoreLabel"].toUpperCase();
mcEndGameSign.mcGameOverText.txtLCLabel.text = parsedGameData.textMappings["longest_combo"].toUpperCase();
mcEndGameSign.mcGameOverText.txtHCLabel.text = parsedGameData.textMappings["highest_combo"].toUpperCase();
mcEndGameSign.mcGameOverText.txtNow.text = parsedGameData.textMappings["now"].toUpperCase();
mcEndGameSign.mcGameOverText.txtRecord.text = parsedGameData.textMappings["record"].toUpperCase();
mcEndGameSign.mcGameOverText.txtTimeBonus.text = l__7;
mcEndGameSign.mcGameOverText.txtTimeBonusLabel.text = parsedGameData.textMappings["txtTimeBonusLabel"].toUpperCase();
mcEndGameSign.mcGameOverText.txtHC.text = p__2;
if (p__2 > Number(parsedGameData.records["recordScoreCombo"])){
mcEndGameSign.mcGameOverText.txtHCR.text = p__2;
addGlow(mcEndGameSign.mcGameOverText.txtHCR);
addGlow(mcEndGameSign.mcGameOverText.txtHC);
} else {
mcEndGameSign.mcGameOverText.txtHCR.text = parsedGameData.records["recordScoreCombo"];
};
mcEndGameSign.mcGameOverText.txtLC.text = p__3;
if (p__3 > Number(parsedGameData.records["recordSizeCombo"])){
mcEndGameSign.mcGameOverText.txtLCR.text = p__3;
addGlow(mcEndGameSign.mcGameOverText.txtLCR);
addGlow(mcEndGameSign.mcGameOverText.txtLC);
} else {
mcEndGameSign.mcGameOverText.txtLCR.text = parsedGameData.records["recordSizeCombo"];
};
if (userType == 0){
mcEndGameSign.mcGameOverText.txtOpenUserEnd.text = parsedGameData.textMappings["txtOpenUserEnd"].toUpperCase();
txtEndState.text = "";
};
if (relaxGame){
mcEndGameSign.mcGameOverText.txtTimeBonus.text = "";
mcEndGameSign.mcGameOverText.txtTimeBonusLabel.text = "";
mcEndGameSign.mcGameOverText.txtNow.text = "";
mcEndGameSign.mcGameOverText.txtRecord.text = "";
mcEndGameSign.mcGameOverText.txtLCLabel.text = "";
mcEndGameSign.mcGameOverText.txtLC.text = "";
mcEndGameSign.mcGameOverText.txtLCR.text = "";
mcEndGameSign.mcGameOverText.txtHCLabel.text = "";
mcEndGameSign.mcGameOverText.txtHC.text = "";
mcEndGameSign.mcGameOverText.txtHCR.text = "";
};
endAnimAt = 105;
endAnimLength = 304;
textTimer = 50;
ticksLeft = (TICKS_PER_SEC * 30);
gameState = STATE_END_GAME;
}
public function sfxButtonClicked(p__1:Event){
if (sfxOn){
sfxManager.fadeTo(0, 500);
mcSFX.gotoAndStop(2);
sfxOn = false;
mcGame.sfxOn = false;
} else {
sfxManager.fadeTo(1, 500);
mcSFX.gotoAndStop(1);
sfxOn = true;
mcGame.sfxOn = true;
};
}
public function musicButtonClicked(p__1:Event){
if (musicOn){
musicManager.fadeTo(0, 500);
mcMusic.gotoAndStop(2);
musicOn = false;
mcGame.musicOn = false;
} else {
musicManager.fadeTo(1, 500);
mcMusic.gotoAndStop(1);
musicOn = true;
mcGame.musicOn = true;
};
}
public function openGameEnd(p__1, p__2, p__3):void{
ticksLeft = (10 * TICKS_PER_SEC);
gameState = STATE_END_GAME;
}
public function gamePreQuit():void{
gameState = STATE_PRE_QUIT;
ticksLeft = 25;
}
public function gameQuit():void{
trace(("DR-Score:" + score));
url = "index.php?act=Arcade&do=newscore";
request = new URLRequest(url);
variables = new URLVariables();
variables.gname = "AbracadabraAS3v2DR";
variables.gscore = score;
request.data = variables;
request.method = URLRequestMethod.POST;
navigateToURL(request, "_self");
//unresolved jump
var _slot1 = e;
trace(_slot1);
}
public function addGlow(p__1){
var l__2:GlowFilter = new GlowFilter();
l__2.color = 0xFFFFFF;
l__2.blurY = 4;
l__2.blurX = 4;
l__2.strength = 3;
l__2.quality = 2;
p__1.filters = [l__2];
}
public function updateScoreSign(p__1:Number, p__2){
var l__3:* = undefined;
var l__4:* = undefined;
if (p__2){
if (Number(mcScore.txtScore.text) != Number((score + p__1))){
l__4 = ((p__1 + score) - Number(mcScore.txtScore.text));
if (l__4 > 2000){
l__3 = 200;
} else {
if (l__4 > 800){
l__3 = 30;
} else {
if (l__4 > 25){
l__3 = 10;
} else {
l__3 = 1;
};
};
};
mcScore.txtScore.text = Math.min((Number(mcScore.txtScore.text) + l__3), (score + p__1));
};
} else {
mcScore.txtScore.text = (score + p__1);
};
}
}
}//package src
Section 46
//BackGround (src.BackGround)
package src {
import src.timing.*;
import flash.events.*;
import flash.display.*;
public class BackGround extends MovieClip {
private var scaleFloat;
private var delay;
private var animAt;// = 0
private static var WIDTH = 34;
private static var HEIGHT = 34;
public function BackGround(p__1, p__2){
super();
x = ((p__2 * WIDTH) + 90);
y = ((p__1 * HEIGHT) + 50);
delay = ((p__1 + p__2) + 15);
scaleFloat = new IFloat(1);
alpha = 0;
mouseEnabled = false;
mouseChildren = false;
}
public function tick(p__1:Number, p__2:Number):void{
}
public function render(p__1:Number, p__2:Number):void{
scaleX = scaleFloat.get(p__2);
scaleY = scaleFloat.get(p__2);
}
public function init(p__1, p__2):void{
}
public function introAnim():Boolean{
if (animAt < 5){
if (delay == 0){
animAt++;
alpha = Math.min(1, (alpha + 0.5));
switch (animAt){
case 1:
scaleFloat.set(1.2);
break;
case 2:
scaleFloat.set(1.4);
break;
case 3:
scaleFloat.set(1.6);
break;
case 4:
scaleFloat.set(1.3);
break;
case 5:
scaleFloat.set(1);
scaleFloat.set(1);
break;
};
if (animAt == 5){
return (true);
};
} else {
delay--;
};
};
return (false);
}
}
}//package src
Section 47
//Explosion (src.Explosion)
package src {
import src.sound.*;
import src.timing.*;
import flash.media.*;
import flash.events.*;
import flash.display.*;
public class Explosion extends MovieClip {
public var target;
public var delay;// = 0
public var animAt;// = 1
public var animLength;// = 29
public function Explosion(p__1, p__2, p__3, p__4){
super();
addFrameScript(0, frame1);
y = p__1;
x = p__2;
target = p__4;
delay = (p__3 * 2);
}
function frame1(){
stop();
}
}
}//package src
Section 48
//Game (src.Game)
package src {
import src.sound.*;
import src.timing.*;
import flash.events.*;
import flash.display.*;
import src.math.*;
import src.comm.*;
import src.util.*;
import flash.utils.*;
public class Game extends MovieClip {
private var typeUsedBoolArr:Array;
private var tilesByType_:Array;
private var handleClick_:Boolean;
public var mcHand:MovieClip;
private var handAnim;
public var longestCombo;// = 0
public var sfxOn;
private var startTime;
private var communicator;
private var bgDone;
private var sfxManager:SoundManager;
public var highestComboScore;// = 0
private var noOfSpecials:Number;
public var noOfRandoms:Number;// = 0
private var gameGridObj:Array;
private var relaxPreIntroCounter:int;
private var noOfBonusRandoms:Number;// = 0
private var clickedTile_:Piece;// = null
private var clientVersion;
private var pieceDone;
private var score;// = 0
private var userType:Number;
private var rows_:Number;
private var foundTile1_:Piece;
private var currentTick:Number;
private var foundTile2_:Piece;
private var gameState:Number;
private var random;
private var playEndAnim;// = false
private var typeUsedArr:Array;
private var cols_:Number;
private var musicManager:SoundManager;
private var numTilesLeft_:Number;
private var bgArr:Array;
private var noOfTypes:Number;
public var musicOn;
private var renderPush:int;// = 0
private var gameRoot;
private var boardSizeArr;
private var markedArr:Array;
private var lcArr:Array;
private var explosionArr;
private var scoreArr;
private var timeLeft;
private static var STATE_RUNNING = 0;
private static var STATE_NOT_RUNNING = 1;
private static var STATE_INTRO = 2;
private static var RELAX_PRE_INTRO = 3;
private static var BOARD_WIDTH = 15;
private static var BOARD_HEIGHT = 9;
private static var TOTAL_TIME = 9000;
public function Game(){
boardSizeArr = new Array();
markedArr = new Array();
lcArr = new Array();
explosionArr = new Array();
scoreArr = new Array();
timeLeft = TOTAL_TIME;
super();
}
public function tick(p__1:Number){
var l__2:String;
var l__3:* = undefined;
var l__4:* = undefined;
switch (gameState){
case STATE_INTRO:
handAnim++;
if (handAnim == 7){
gameRoot.removeText();
sfxManager.get("tileAppears").loop();
};
if (bgDone < bgArr.length){
l__3 = 0;
while (l__3 < bgArr.length) {
if (bgArr[l__3].introAnim()){
bgDone++;
};
l__3 = (l__3 + 1);
};
} else {
l__3 = 0;
while (l__3 < gameGridObj.length) {
l__4 = 0;
while (l__4 < gameGridObj[l__3].length) {
if (gameGridObj[l__3][l__4].delay == 0){
if (gameGridObj[l__3][l__4].theX != gameGridObj[l__3][l__4].gotoX){
gameGridObj[l__3][l__4].animAt--;
if (gameGridObj[l__3][l__4].animAt == 0){
gameGridObj[l__3][l__4].theX = gameGridObj[l__3][l__4].gotoX;
gameGridObj[l__3][l__4].theY = gameGridObj[l__3][l__4].gotoY;
gameGridObj[l__3][l__4].xFloat.set(gameGridObj[l__3][l__4].theX);
gameGridObj[l__3][l__4].yFloat.set(gameGridObj[l__3][l__4].theY);
gameGridObj[l__3][l__4].xFloat.set(gameGridObj[l__3][l__4].theX);
gameGridObj[l__3][l__4].yFloat.set(gameGridObj[l__3][l__4].theY);
} else {
gameGridObj[l__3][l__4].theAlpha = 1;
gameGridObj[l__3][l__4].theX = (gameGridObj[l__3][l__4].theX + ((gameGridObj[l__3][l__4].gotoX - gameGridObj[l__3][l__4].startX) / 5));
gameGridObj[l__3][l__4].theY = (gameGridObj[l__3][l__4].theY + ((gameGridObj[l__3][l__4].gotoY - gameGridObj[l__3][l__4].startY) / 5));
gameGridObj[l__3][l__4].xFloat.set(gameGridObj[l__3][l__4].theX);
gameGridObj[l__3][l__4].yFloat.set(gameGridObj[l__3][l__4].theY);
};
};
} else {
gameGridObj[l__3][l__4].delay--;
};
l__4 = (l__4 + 1);
};
l__3 = (l__3 + 1);
};
};
break;
case STATE_RUNNING:
if (!playEndAnim){
if (AbraCadabra.relaxGame == false){
timeLeft--;
};
};
if (timeLeft == 250){
sfxManager.get("timeWarning").loop();
};
l__3 = 0;
while (l__3 < scoreArr.length) {
if (scoreArr[l__3].delay == 0){
scoreArr[l__3].animAt++;
if (scoreArr[l__3].animAt == 37){
removeChild(scoreArr[l__3]);
scoreArr.splice(l__3, 1);
l__3--;
};
} else {
scoreArr[l__3].delay--;
};
l__3 = (l__3 + 1);
};
l__3 = 0;
while (l__3 < explosionArr.length) {
if (explosionArr[l__3].delay > 0){
explosionArr[l__3].delay--;
if (explosionArr[l__3].delay == 0){
sfxManager.get("disappears").play();
};
} else {
if (explosionArr[l__3].animAt == 1){
explosionArr[l__3].target.nonVis();
};
explosionArr[l__3].animAt++;
if (explosionArr[l__3].animAt == 32){
removeChild(explosionArr[l__3]);
explosionArr.splice(l__3, 1);
l__3--;
};
};
l__3 = (l__3 + 1);
};
if (((((playEndAnim) && ((explosionArr.length == 0)))) && ((scoreArr.length == 0)))){
endRound();
};
if (timeLeft == 0){
if ((((explosionArr.length > 0)) || ((scoreArr.length > 0)))){
timeLeft++;
if (markedArr.length > 0){
tileClicked(markedArr[0]);
handleClick_ = true;
};
} else {
sfxManager.get("timeOut").play();
endRound();
};
};
l__3 = 0;
while (l__3 < lcArr.length) {
lcArr[l__3].tick(p__1);
l__3 = (l__3 + 1);
};
break;
case STATE_NOT_RUNNING:
break;
case RELAX_PRE_INTRO:
if (gameRoot.parsedGameData.textMappings["level_goal"]){
l__2 = gameRoot.parsedGameData.textMappings["level_goal"];
} else {
l__2 = "Level goal";
};
l__2 = ((l__2 + " ") + String(gameRoot.relaxLevelLimit));
gameRoot.txtRelaxLevelGoal.text = l__2;
relaxPreIntroCounter--;
if (relaxPreIntroCounter < 0){
gameState = STATE_INTRO;
gameRoot.txtRelaxLevelGoal.text = "";
};
break;
};
}
public function render(p__1:Number, p__2:Number){
var l__3:* = undefined;
var l__4:* = undefined;
var l__5:* = undefined;
switch (gameState){
case STATE_INTRO:
mcHand.gotoAndStop(handAnim);
l__3 = 0;
while (l__3 < bgArr.length) {
bgArr[l__3].render(p__1, p__2);
l__3 = (l__3 + 1);
};
l__4 = true;
l__3 = 0;
while (l__3 < gameGridObj.length) {
l__5 = 0;
while (l__5 < gameGridObj[l__3].length) {
if (gameGridObj[l__3][l__5].x != gameGridObj[l__3][l__5].gotoX){
gameGridObj[l__3][l__5].alpha = gameGridObj[l__3][l__5].theAlpha;
gameGridObj[l__3][l__5].x = gameGridObj[l__3][l__5].xFloat.get(p__2);
gameGridObj[l__3][l__5].y = gameGridObj[l__3][l__5].yFloat.get(p__2);
l__4 = false;
};
l__5 = (l__5 + 1);
};
l__3 = (l__3 + 1);
};
if (l__4){
startGamePlay();
};
case STATE_RUNNING:
if (++renderPush == 10){
l__3 = 0;
while (l__3 < gameGridObj.length) {
l__5 = 0;
while (l__5 < gameGridObj[l__3].length) {
l__5 = (l__5 + 1);
};
l__3 = (l__3 + 1);
};
renderPush = 0;
};
l__3 = 0;
while (l__3 < scoreArr.length) {
scoreArr[l__3].gotoAndStop(scoreArr[l__3].animAt);
l__3 = (l__3 + 1);
};
l__3 = 0;
while (l__3 < explosionArr.length) {
if (explosionArr[l__3].delay <= 0){
explosionArr[l__3].gotoAndStop(explosionArr[l__3].animAt);
};
l__3 = (l__3 + 1);
};
if ((p__1 % 2)){
gameRoot.mcClock.gotoAndStop(Math.ceil((600 - ((timeLeft / TOTAL_TIME) * 600))));
};
l__3 = 0;
while (l__3 < lcArr.length) {
lcArr[l__3].render(p__1, p__2);
l__3 = (l__3 + 1);
};
gameRoot.updateScoreSign(score, true);
break;
};
}
public function startGamePlay(){
sfxManager.get("tileAppears").fadeToAndStop(0, 1500);
communicator.startRound((currentTick + 1), clientVersion);
gameState = STATE_RUNNING;
}
public function startRound(p__1, p__2, p__3, p__4, p__5, p__6, p__7, p__8){
this.communicator = p__5;
if ((((p__8 > 1)) && ((timeLeft < 250)))){
sfxManager.get("timeWarning").loop();
};
this.gameRoot = p__1;
this.random = p__2;
this.userType = p__4;
this.currentTick = p__6;
this.clientVersion = p__7;
startTime = p__6;
bgDone = 0;
score = 0;
noOfTypes = 8;
noOfSpecials = 4;
handAnim = 0;
playEndAnim = false;
switch (p__8){
case 1:
noOfSpecials = 0;
noOfTypes = 6;
break;
case 2:
noOfSpecials = 4;
noOfTypes = 7;
break;
case 3:
noOfSpecials = 4;
noOfTypes = 7;
break;
};
gameGridObj = new Array();
bgArr = new Array();
typeUsedArr = new Array();
typeUsedBoolArr = new Array();
var l__9:* = 0;
while (l__9 < noOfTypes) {
typeUsedArr[l__9] = 0;
typeUsedBoolArr[l__9] = false;
l__9 = (l__9 + 1);
};
cols_ = p__3[0].length;
rows_ = p__3.length;
musicManager = p__1.musicManager;
sfxManager = p__1.sfxManager;
sfxManager.get("swish").play();
createBoard(p__3);
if (AbraCadabra.relaxGame){
relaxPreIntroCounter = 50;
gameState = RELAX_PRE_INTRO;
} else {
gameState = STATE_INTRO;
};
}
public function createBoard(p__1:Array){
var l__3:* = undefined;
var l__7:* = undefined;
var l__8:* = undefined;
var l__9:* = undefined;
var l__10:* = undefined;
var l__11:* = undefined;
var l__12:* = undefined;
var l__13:* = undefined;
var l__14:* = undefined;
var l__15:* = undefined;
var l__16:* = undefined;
var l__17:* = undefined;
var l__18:* = undefined;
var l__19:* = undefined;
var l__2:* = 0;
l__3 = 0;
while (l__3 < p__1.length) {
l__7 = 0;
while (l__7 < p__1[l__3].length) {
if (p__1[l__3][l__7] == 1){
l__2 = (l__2 + 1);
};
l__7 = (l__7 + 1);
};
l__3 = (l__3 + 1);
};
numTilesLeft_ = 0;
tilesByType_ = new Array();
var l__4:* = new Array();
var l__5:* = new Array();
while (l__4.length < noOfSpecials) {
l__8 = getRandom(p__1.length);
l__9 = getRandom(p__1[0].length);
l__10 = false;
l__11 = 0;
while (l__11 < l__4.length) {
if ((((l__4[l__11] == l__8)) && ((l__5[l__11] == l__9)))){
l__10 = true;
};
l__11 = (l__11 + 1);
};
if ((((p__1[l__8][l__9] == 1)) && (!(l__10)))){
l__4.push(l__8);
l__5.push(l__9);
};
};
l__3 = 0;
while (l__3 < p__1.length) {
l__12 = new Array();
l__7 = 0;
while (l__7 < p__1[l__3].length) {
if (((((((!((l__3 == (p__1.length - 1)))) && (!((l__3 == 0))))) && (!((l__7 == 0))))) && (!((l__7 == (p__1[0].length - 1)))))){
l__17 = new BackGround(l__3, l__7);
addChild(l__17);
bgArr.push(l__17);
};
l__13 = false;
l__14 = 0;
while (l__14 < l__4.length) {
if ((((l__3 == l__4[l__14])) && ((l__7 == l__5[l__14])))){
l__13 = true;
};
l__14 = (l__14 + 1);
};
l__15 = undefined;
if ((noOfTypes * 2) >= l__2){
l__18 = 0;
while (l__18 < typeUsedArr.length) {
if (typeUsedArr[l__18] < 2){
l__15 = l__18;
l__18 = typeUsedArr.length;
};
l__18 = (l__18 + 1);
};
};
if (l__13){
l__16 = createSpecialPiece(l__3, l__7, p__1[l__3][l__7]);
} else {
l__16 = createPiece(l__3, l__7, p__1[l__3][l__7], l__15);
l__2--;
};
l__12.push(l__16);
if (l__16.getType() > 0){
if (tilesByType_[l__16.getType()] == undefined){
tilesByType_[l__16.getType()] = new Array();
};
tilesByType_[l__16.getType()][tilesByType_[l__16.getType()].length] = l__16;
};
l__7 = (l__7 + 1);
};
gameGridObj.push(l__12);
l__3 = (l__3 + 1);
};
var l__6:* = 1;
while (l__6 < (rows_ - 1)) {
l__19 = 1;
while (l__19 < (cols_ - 1)) {
gameGridObj[l__6][l__19].setClickable(true);
l__19 = (l__19 + 1);
};
l__6 = (l__6 + 1);
};
l__3 = 0;
while (l__3 < gameGridObj.length) {
l__7 = 0;
while (l__7 < gameGridObj[l__3].length) {
if (gameGridObj[l__3][l__7].getType() == 0){
removeTileStart(gameGridObj[l__3][l__7]);
};
l__7 = (l__7 + 1);
};
l__3 = (l__3 + 1);
};
l__3 = 0;
while (l__3 < gameGridObj.length) {
l__7 = 0;
while (l__7 < gameGridObj[l__3].length) {
if ((((gameGridObj[l__3][l__7].getType() == 50)) && (!(gameGridObj[l__3][l__7].chainSet)))){
setChains(gameGridObj[l__3][l__7]);
};
l__7 = (l__7 + 1);
};
l__3 = (l__3 + 1);
};
}
public function setChains(p__1:Piece){
var l__4:* = undefined;
var l__5:* = undefined;
p__1.chainSet = true;
var l__2:* = new Array();
var l__3:* = new Array();
var l__6:* = 0;
l__4 = gameGridObj[(p__1.getRow() - 1)][p__1.getCol()];
if (l__4.getType() == 50){
l__5 = 0;
p__1.mcLock.mc1.visible = true;
l__3.push(l__4);
l__6 = (l__6 + 1);
};
l__4 = gameGridObj[p__1.getRow()][(p__1.getCol() + 1)];
if (l__4.getType() == 50){
l__5 = 1;
p__1.mcLock.mc2.visible = true;
l__3.push(l__4);
l__6 = (l__6 + 1);
};
l__4 = gameGridObj[(p__1.getRow() + 1)][p__1.getCol()];
if (l__4.getType() == 50){
l__5 = 2;
p__1.mcLock.mc3.visible = true;
l__3.push(l__4);
l__6 = (l__6 + 1);
};
l__4 = gameGridObj[p__1.getRow()][(p__1.getCol() - 1)];
if (l__4.getType() == 50){
l__5 = 3;
p__1.mcLock.mc4.visible = true;
l__3.push(l__4);
l__6 = (l__6 + 1);
};
if (l__6 == 0){
p__1.mcLock.gotoAndStop(2);
} else {
if ((((l__6 == 1)) && ((getClientRandom(100) < 50)))){
p__1.mcLock.gotoAndStop(2);
switch (l__5){
case 0:
break;
case 1:
p__1.mcLock.rotation = 90;
break;
case 2:
p__1.mcLock.rotation = 180;
break;
case 3:
p__1.mcLock.rotation = 270;
break;
};
};
};
var l__7:* = 0;
while (l__7 < l__3.length) {
if (!l__3[l__7].chainSet){
setChains(l__3[l__7]);
};
l__7 = (l__7 + 1);
};
}
public function removeTile(p__1:Piece):void{
var l__7:Piece;
var l__4:* = undefined;
var l__5:* = undefined;
var l__6:* = undefined;
var l__2:* = p__1.getCol();
var l__3:* = p__1.getRow();
l__6 = (p__1.getNumFreeUp() + 1);
l__5 = l__2;
l__4 = (l__3 + 1);
while (l__4 < rows_) {
l__7 = gameGridObj[l__4][l__5];
l__7.addFreeUp(l__6);
if (l__7.getType() > 0){
break;
};
l__4 = (l__4 + 1);
};
l__6 = (p__1.getNumFreeRight() + 1);
l__4 = l__3;
l__5 = (l__2 - 1);
while (l__5 >= 0) {
l__7 = gameGridObj[l__4][l__5];
l__7.addFreeRight(l__6);
if (l__7.getType() > 0){
break;
};
l__5--;
};
l__6 = (p__1.getNumFreeDown() + 1);
l__5 = l__2;
l__4 = (l__3 - 1);
while (l__4 >= 0) {
l__7 = gameGridObj[l__4][l__5];
l__7.addFreeDown(l__6);
if (l__7.getType() > 0){
break;
};
l__4--;
};
l__6 = (p__1.getNumFreeLeft() + 1);
l__4 = l__3;
l__5 = (l__2 + 1);
while (l__5 < cols_) {
l__7 = gameGridObj[l__4][l__5];
l__7.addFreeLeft(l__6);
if (l__7.getType() > 0){
break;
};
l__5 = (l__5 + 1);
};
p__1.remove();
}
public function removeTileStart(p__1:Piece):void{
var l__7:Piece;
var l__4:* = undefined;
var l__5:* = undefined;
var l__6:* = undefined;
var l__2:* = p__1.getCol();
var l__3:* = p__1.getRow();
l__6 = (p__1.getNumFreeUp() + 1);
l__5 = l__2;
l__4 = (l__3 + 1);
while (l__4 < rows_) {
l__7 = gameGridObj[l__4][l__5];
l__7.addFreeUp(1);
if (l__7.getType() > 0){
break;
};
l__4 = (l__4 + 1);
};
l__6 = (p__1.getNumFreeRight() + 1);
l__4 = l__3;
l__5 = (l__2 - 1);
while (l__5 >= 0) {
l__7 = gameGridObj[l__4][l__5];
l__7.addFreeRight(1);
if (l__7.getType() > 0){
break;
};
l__5--;
};
l__6 = (p__1.getNumFreeDown() + 1);
l__5 = l__2;
l__4 = (l__3 - 1);
while (l__4 >= 0) {
l__7 = gameGridObj[l__4][l__5];
l__7.addFreeDown(1);
if (l__7.getType() > 0){
break;
};
l__4--;
};
l__6 = (p__1.getNumFreeLeft() + 1);
l__4 = l__3;
l__5 = (l__2 + 1);
while (l__5 < cols_) {
l__7 = gameGridObj[l__4][l__5];
l__7.addFreeLeft(1);
if (l__7.getType() > 0){
break;
};
l__5 = (l__5 + 1);
};
p__1.remove();
}
public function createPiece(p__1:Number, p__2:Number, p__3, p__4){
var l__7:Boolean;
var l__8:Boolean;
var l__5:* = getTimer();
var l__6:* = p__3;
if (l__6 == 1){
numTilesLeft_++;
if (p__4 != undefined){
l__6 = p__4;
l__6++;
} else {
l__6 = (getRandom(noOfTypes) + 1);
};
var _local11 = typeUsedArr;
var _local12 = (l__6 - 1);
var _local13 = (_local11[_local12] + 1);
_local11[_local12] = _local13;
} else {
if (l__6 == 10){
numTilesLeft_++;
l__6 = (getRandom(noOfTypes) + 1);
l__7 = true;
};
};
var l__9:* = new Piece(this, this, l__6, p__1, p__2, l__7, l__8);
pieceDone++;
addChild(l__9);
var l__10:* = (getTimer() - l__5);
return (l__9);
}
public function createSpecialPiece(p__1:Number, p__2:Number, p__3){
var l__4:* = true;
var l__5:* = 25;
numTilesLeft_++;
var l__6:* = new Piece(this, this, l__5, p__1, p__2, false, l__4);
pieceDone++;
addChild(l__6);
return (l__6);
}
public function tileClicked(p__1:Piece):void{
var l__2:* = undefined;
var l__3:* = undefined;
var l__4:* = undefined;
var l__5:* = undefined;
if (gameState != STATE_RUNNING){
return;
};
if (handleClick_){
return;
};
communicator.pieceClicked((currentTick + 1), p__1.getRow(), p__1.getCol());
handleClick_ = true;
if (clickedTile_ == null){
sfxManager.get("click").play(0.8);
sfxManager.get("buzz").loop(0.2);
clickedTile_ = p__1;
p__1.markClicked();
p__1.mcStart.gotoAndPlay(2);
handleClick_ = false;
markedArr.push(p__1);
} else {
if (clickedTile_ == p__1){
if (markedArr.length == 1){
sfxManager.get("click").play(0.8);
sfxManager.get("buzz").stop();
clickedTile_ = null;
p__1.unmarkClicked();
handleClick_ = false;
markedArr = [];
} else {
sfxManager.get("click").play(0.8);
sfxManager.get("buzz").stop();
calcScore();
createExplosions();
l__2 = 0;
while (l__2 < lcArr.length) {
removeChild(lcArr[l__2]);
l__2 = (l__2 + 1);
};
lcArr = [];
l__2 = 0;
while (l__2 < markedArr.length) {
numTilesLeft_--;
if (markedArr[l__2].isKey){
removeChain(markedArr[l__2]);
};
removeTile(markedArr[l__2]);
l__2 = (l__2 + 1);
};
markedArr = [];
clickedTile_ = null;
handleClick_ = false;
if (!anyMoreMoves()){
endAnim();
trace("BOARD IS DEAD!!");
trace("BOARD IS DEAD!!");
trace("BOARD IS DEAD!!");
};
};
} else {
l__3 = false;
if (p__1 == markedArr[0]){
sfxManager.get("click").play(0.8);
sfxManager.get("buzz").stop();
l__3 = true;
l__2 = 0;
while (l__2 < markedArr.length) {
markedArr[l__2].unmarkClicked();
l__2 = (l__2 + 1);
};
l__2 = 0;
while (l__2 < lcArr.length) {
removeChild(lcArr[l__2]);
l__2 = (l__2 + 1);
};
markedArr = [];
lcArr = [];
clickedTile_ = null;
handleClick_ = false;
} else {
l__2 = 0;
while (l__2 < (markedArr.length - 1)) {
if (p__1 == markedArr[l__2]){
l__3 = true;
l__4 = (markedArr.length - 1);
while (l__4 > l__2) {
markedArr[l__4].unmarkClicked();
markedArr.splice(l__4, 1);
removeChild(lcArr[(l__4 - 1)]);
lcArr.splice((l__4 - 1), 1);
l__4--;
};
clickedTile_ = markedArr[(markedArr.length - 1)];
handleClick_ = false;
l__2 = markedArr.length;
};
l__2 = (l__2 + 1);
};
};
if (!l__3){
l__5 = findPath(clickedTile_, p__1, false);
if (l__5){
sfxManager.get("click").play(0.8);
p__1.markClicked();
l__2 = 1;
while (l__2 < markedArr.length) {
markedArr[l__2].unmarkClicked();
l__2 = (l__2 + 1);
};
clickedTile_ = p__1;
markedArr.push(p__1);
createLightning();
} else {
sfxManager.get("error").play();
};
};
};
};
}
public function createLightning(){
}
public function existsPath(p__1:Piece, p__2:Piece):Boolean{
var l__11:* = undefined;
var l__12:* = undefined;
var l__3:Number = p__1.getCol();
var l__4:Number = p__1.getRow();
var l__5:Number = p__2.getCol();
var l__6:Number = p__2.getRow();
var l__7:Number = (l__5 - l__3);
var l__8:Number = (l__6 - l__4);
if ((((((l__3 == l__5)) && (p__1.isFreeExclusive(0, l__8)))) || ((((l__4 == l__6)) && (p__1.isFreeExclusive(l__7, 0)))))){
return (true);
};
if (((p__1.isFree(0, l__8)) && (p__2.isFree(-(l__7), 0)))){
return (true);
};
if (((p__1.isFree(l__7, 0)) && (p__2.isFree(0, -(l__8))))){
return (true);
};
var l__9:* = Math.max(rows_, cols_);
var l__10:* = 1;
while (l__10 < l__9) {
l__11 = 0;
if (((((p__1.isFree(l__10, 0)) && (p__2.isFree((-(l__7) + l__10), 0)))) && (gameGridObj[l__4][(l__3 + l__10)].isFree(0, l__8)))){
l__11 = l__10;
} else {
if (((((p__1.isFree(-(l__10), 0)) && (p__2.isFree((-(l__7) - l__10), 0)))) && (gameGridObj[l__4][(l__3 - l__10)].isFree(0, l__8)))){
l__11 = -(l__10);
};
};
if (l__11 != 0){
return (true);
};
l__12 = 0;
if (((((p__1.isFree(0, l__10)) && (p__2.isFree(0, (-(l__8) + l__10))))) && (gameGridObj[(l__4 + l__10)][l__3].isFree(l__7, 0)))){
l__12 = l__10;
} else {
if (((((p__1.isFree(0, -(l__10))) && (p__2.isFree(0, (-(l__8) - l__10))))) && (gameGridObj[(l__4 - l__10)][l__3].isFree(l__7, 0)))){
l__12 = -(l__10);
};
};
if (l__12 != 0){
return (true);
};
l__10 = (l__10 + 1);
};
return (false);
}
public function findPath(p__1:Piece, p__2:Piece, p__3:Boolean):Boolean{
var l__12:* = undefined;
var l__13:* = undefined;
var l__14:* = undefined;
var l__15:* = undefined;
var l__16:* = undefined;
var l__17:* = undefined;
if (((p__1.isBridge) && (p__2.isBridge))){
l__12 = false;
l__13 = 0;
while (l__13 < p__1.bridgeArr.length) {
l__14 = 0;
while (l__14 < p__2.bridgeArr.length) {
if (p__1.bridgeArr[l__13] == p__2.bridgeArr[l__14]){
l__12 = true;
};
l__14 = (l__14 + 1);
};
l__13 = (l__13 + 1);
};
if (!l__12){
findNonValidPath(p__1, p__2);
return (false);
};
} else {
if (p__1.isBridge){
l__12 = false;
l__13 = 0;
while (l__13 < p__1.bridgeArr.length) {
if (p__1.bridgeArr[l__13] == p__2.getType()){
l__12 = true;
};
l__13 = (l__13 + 1);
};
if (!l__12){
findNonValidPath(p__1, p__2);
return (false);
};
} else {
if (p__2.isBridge){
l__12 = false;
l__13 = 0;
while (l__13 < p__2.bridgeArr.length) {
if (p__2.bridgeArr[l__13] == p__1.getType()){
l__12 = true;
};
l__13 = (l__13 + 1);
};
if (!l__12){
findNonValidPath(p__1, p__2);
return (false);
};
} else {
if (p__1.getType() != p__2.getType()){
findNonValidPath(p__1, p__2);
return (false);
};
};
};
};
var l__4:Number = p__1.getCol();
var l__5:Number = p__1.getRow();
var l__6:Number = p__2.getCol();
var l__7:Number = p__2.getRow();
var l__8:Number = (l__6 - l__4);
var l__9:Number = (l__7 - l__5);
if ((((((l__4 == l__6)) && (p__1.isFreeExclusive(0, l__9)))) || ((((l__5 == l__7)) && (p__1.isFreeExclusive(l__8, 0)))))){
l__15 = new LightningConnector(this);
l__15.addPiece(p__1);
l__15.addPiece(p__2);
l__15.draw();
addChild(l__15);
lcArr.push(l__15);
return (true);
};
if (((p__1.isFree(0, l__9)) && (p__2.isFree(-(l__8), 0)))){
l__15 = new LightningConnector(this);
l__15.addPiece(p__1);
l__15.addPiece(gameGridObj[(l__5 + l__9)][l__4]);
l__15.addPiece(p__2);
l__15.draw();
addChild(l__15);
lcArr.push(l__15);
return (true);
};
if (((p__1.isFree(l__8, 0)) && (p__2.isFree(0, -(l__9))))){
l__15 = new LightningConnector(this);
l__15.addPiece(p__1);
l__15.addPiece(gameGridObj[l__5][(l__4 + l__8)]);
l__15.addPiece(p__2);
l__15.draw();
addChild(l__15);
lcArr.push(l__15);
return (true);
};
var l__10:* = Math.max(rows_, cols_);
var l__11:* = 1;
while (l__11 < l__10) {
l__16 = 0;
if (((((p__1.isFree(l__11, 0)) && (p__2.isFree((-(l__8) + l__11), 0)))) && (gameGridObj[l__5][(l__4 + l__11)].isFree(0, l__9)))){
l__16 = l__11;
} else {
if (((((p__1.isFree(-(l__11), 0)) && (p__2.isFree((-(l__8) - l__11), 0)))) && (gameGridObj[l__5][(l__4 - l__11)].isFree(0, l__9)))){
l__16 = -(l__11);
};
};
if (l__16 != 0){
l__15 = new LightningConnector(this);
l__15.addPiece(p__1);
l__15.addPiece(gameGridObj[l__5][(l__4 + l__16)]);
l__15.addPiece(gameGridObj[l__7][(l__4 + l__16)]);
l__15.addPiece(p__2);
l__15.draw();
addChild(l__15);
lcArr.push(l__15);
return (true);
};
l__17 = 0;
if (((((p__1.isFree(0, l__11)) && (p__2.isFree(0, (-(l__9) + l__11))))) && (gameGridObj[(l__5 + l__11)][l__4].isFree(l__8, 0)))){
l__17 = l__11;
} else {
if (((((p__1.isFree(0, -(l__11))) && (p__2.isFree(0, (-(l__9) - l__11))))) && (gameGridObj[(l__5 - l__11)][l__4].isFree(l__8, 0)))){
l__17 = -(l__11);
};
};
if (l__17 != 0){
l__15 = new LightningConnector(this);
l__15.addPiece(p__1);
l__15.addPiece(gameGridObj[(l__5 + l__17)][l__4]);
l__15.addPiece(gameGridObj[(l__5 + l__17)][l__6]);
l__15.addPiece(p__2);
l__15.draw();
addChild(l__15);
lcArr.push(l__15);
return (true);
};
l__11 = (l__11 + 1);
};
if (p__3){
return (true);
};
findNonValidPath(p__1, p__2);
return (false);
}
public function findNonValidPath(tile1:Piece, tile2:Piece){
var t:Piece;
var t2:Piece;
var done:Boolean;
var numLoops:Number;
var tile1 = tile1;
var tile2 = tile2;
var row:* = undefined;
var nv:* = undefined;
var i:* = undefined;
var col:* = undefined;
var n:* = undefined;
var hv:* = undefined;
var x2:* = tile2.getCol();
var y2:* = tile2.getRow();
row = 0;
while (row < rows_) {
col = 0;
while (col < cols_) {
gameGridObj[row][col].nv = 0;
gameGridObj[row][col].d = 0;
gameGridObj[row][col].md = (2 * (Math.abs((x2 - col)) + Math.abs((y2 - row))));
gameGridObj[row][col].heapValue = 0;
gameGridObj[row][col].closed = false;
col = (col + 1);
};
row = (row + 1);
};
var bestTile:Piece = tile1;
var heap:BinaryHeap = new BinaryHeap();
tile1.heapValue = tile1.md;
tile1.theParent = undefined;
heap.insert(tile1);
while (!(done)) {
numLoops = (numLoops + 1);
t = Piece(heap.removeMin());
t.closed = true;
col = t.getCol();
row = t.getRow();
if (t.md == 2){
bestTile = tile2;
tile2.theParent = t;
if (t.theParent == null){
handleClick_ = false;
return;
};
if ((((t.theParent.getCol() == tile2.getCol())) || ((t.theParent.getRow() == tile2.getRow())))){
tile2.nv = t.nv;
} else {
tile2.nv = (t.nv + 1);
};
done = true;
break;
};
if ((((bestTile.nv > 2)) || ((t.nv == bestTile.nv)))){
if (t.md < bestTile.md){
bestTile = t;
};
} else {
if (t.nv > bestTile.nv){
bestTile = t;
};
};
n = t.getNumFreeUp();
n = ((t.getNumFreeUp())>=1) ? 1 : 0;
i = 1;
for (;i <= n;(i = (i + 1))) {
t2 = gameGridObj[(row - i)][col];
nv = ((gameGridObj[(row + 1)][col])==t.theParent) ? t.nv : (t.nv + 1);
hv = ((((nv * 10) + t.d) + i) + (t2.md * 2));
if (((!(t2.closed)) && ((((t2.heapValue == 0)) || ((t2.heapValue > hv)))))){
t2.heapValue = hv;
t2.nv = nv;
t2.d = (t.d + i);
t2.theParent = t;
heap.insert(t2);
};
continue;
var _slot1 = e;
};
n = t.getNumFreeDown();
n = ((t.getNumFreeDown())>=1) ? 1 : 0;
i = 1;
for (;i <= n;(i = (i + 1))) {
t2 = gameGridObj[(row + i)][col];
nv = ((gameGridObj[(row - 1)][col])==t.theParent) ? t.nv : (t.nv + 1);
hv = ((((nv * 10) + t.d) + i) + (t2.md * 2));
if (((!(t2.closed)) && ((((t2.heapValue == 0)) || ((t2.heapValue > hv)))))){
t2.heapValue = hv;
t2.nv = nv;
t2.d = (t.d + i);
t2.theParent = t;
heap.insert(t2);
};
continue;
var _slot1 = e;
};
n = t.getNumFreeRight();
n = ((t.getNumFreeRight())>=1) ? 1 : 0;
i = 1;
for (;i <= n;(i = (i + 1))) {
t2 = gameGridObj[row][(col + i)];
nv = ((gameGridObj[row][(col - i)])==t.theParent) ? t.nv : (t.nv + 1);
hv = ((((nv * 10) + t.d) + i) + (t2.md * 2));
if (((!(t2.closed)) && ((((t2.heapValue == 0)) || ((t2.heapValue > hv)))))){
t2.heapValue = hv;
t2.nv = nv;
t2.d = (t.d + i);
t2.theParent = t;
heap.insert(t2);
};
continue;
var _slot1 = e;
};
n = t.getNumFreeLeft();
n = ((t.getNumFreeLeft())>=1) ? 1 : 0;
i = 1;
for (;i <= n;(i = (i + 1))) {
t2 = gameGridObj[row][(col - i)];
nv = ((gameGridObj[row][(col + i)])==t.theParent) ? t.nv : (t.nv + 1);
hv = ((((nv * 10) + t.d) + i) + (t2.md * 2));
if (((!(t2.closed)) && ((((t2.heapValue == 0)) || ((t2.heapValue > hv)))))){
t2.heapValue = hv;
t2.nv = nv;
t2.d = (t.d + i);
t2.theParent = t;
heap.insert(t2);
};
continue;
var _slot1 = e;
};
if (heap.size() == 0){
done = true;
};
};
var lc:LightningConnector = new LightningConnector(this);
lc.setValid(false);
nv = bestTile.nv;
var tiles:Array = new Array();
t = bestTile;
tiles.push(t);
while (t.theParent != null) {
if (t.nv != t.theParent.nv){
tiles.push(t.theParent);
};
t = t.theParent;
};
i = nv;
while (i >= 0) {
lc.addPiece(tiles[i]);
i = (i - 1);
};
lc.draw();
addChild(lc);
lcArr.push(lc);
if (nv == 0){
lightningAnimDone(lc);
};
}
public function anyMoreMoves():Boolean{
var l__1:Boolean;
var l__2:* = undefined;
var l__3:* = undefined;
var l__4:* = undefined;
var l__5:* = undefined;
var l__6:* = undefined;
l__2 = 1;
while (l__2 < 25) {
if (existsPathWithType(l__2)){
l__1 = true;
break;
};
l__2 = (l__2 + 1);
};
if (!l__1){
l__3 = new Array();
l__2 = 0;
while (l__2 < gameGridObj.length) {
l__4 = 0;
while (l__4 < gameGridObj[l__2].length) {
if (((!((gameGridObj[l__2][l__4] == null))) && (!((gameGridObj[l__2][l__4].getType() == 0))))){
l__3.push(gameGridObj[l__2][l__4]);
};
l__4 = (l__4 + 1);
};
l__2 = (l__2 + 1);
};
l__2 = 0;
while (l__2 < l__3.length) {
if (l__3[l__2].isBridge){
l__4 = 0;
while (l__4 < l__3.length) {
if (l__2 != l__4){
if (l__3[l__4].isBridge){
l__5 = 0;
while (l__5 < l__3[l__2].bridgeArr.length) {
l__6 = 0;
while (l__6 < l__3[l__4].bridgeArr.length) {
if (l__3[l__2].bridgeArr[l__5] == l__3[l__4].bridgeArr[l__6]){
if (existsPath(l__3[l__2], l__3[l__4])){
l__1 = true;
};
};
l__6 = (l__6 + 1);
};
l__5 = (l__5 + 1);
};
} else {
l__5 = 0;
while (l__5 < l__3[l__2].bridgeArr.length) {
if (l__3[l__2].bridgeArr[l__5] == l__3[l__4].getType()){
if (existsPath(l__3[l__2], l__3[l__4])){
l__1 = true;
};
};
l__5 = (l__5 + 1);
};
};
};
l__4 = (l__4 + 1);
};
};
l__2 = (l__2 + 1);
};
};
return (l__1);
}
public function existsPathWithType(p__1:Number):Boolean{
var l__4:Piece;
var l__5:Piece;
var l__6:Boolean;
var l__8:* = undefined;
var l__2:Array = tilesByType_[p__1];
if (l__2 == undefined){
return (false);
};
var l__3:Number = l__2.length;
var l__7:* = 0;
while (l__7 < (l__3 - 1)) {
l__8 = (l__7 + 1);
while (l__8 < l__3) {
l__4 = tilesByType_[p__1][l__7];
l__5 = tilesByType_[p__1][l__8];
if (((!(l__4.isRemoved())) && (!(l__5.isRemoved())))){
if (existsPath(l__4, l__5)){
foundTile1_ = l__4;
foundTile2_ = l__5;
l__6 = true;
break;
};
};
l__8 = (l__8 + 1);
};
l__7 = (l__7 + 1);
};
return (l__6);
}
public function removeChain(p__1:Piece){
if (gameGridObj[(p__1.getRow() + 1)][p__1.getCol()].getType() == Piece.WALL_TYPE){
removeTile(gameGridObj[(p__1.getRow() + 1)][p__1.getCol()]);
removeChain(gameGridObj[(p__1.getRow() + 1)][p__1.getCol()]);
};
if (gameGridObj[(p__1.getRow() - 1)][p__1.getCol()].getType() == Piece.WALL_TYPE){
removeTile(gameGridObj[(p__1.getRow() - 1)][p__1.getCol()]);
removeChain(gameGridObj[(p__1.getRow() - 1)][p__1.getCol()]);
};
if (gameGridObj[p__1.getRow()][(p__1.getCol() + 1)].getType() == Piece.WALL_TYPE){
removeTile(gameGridObj[p__1.getRow()][(p__1.getCol() + 1)]);
removeChain(gameGridObj[p__1.getRow()][(p__1.getCol() + 1)]);
};
if (gameGridObj[p__1.getRow()][(p__1.getCol() - 1)].getType() == Piece.WALL_TYPE){
removeTile(gameGridObj[p__1.getRow()][(p__1.getCol() - 1)]);
removeChain(gameGridObj[p__1.getRow()][(p__1.getCol() - 1)]);
};
}
public function createExplosions(){
var l__2:* = undefined;
sfxManager.get("disappears").play();
var l__1:* = 0;
while (l__1 < markedArr.length) {
l__2 = new Explosion(markedArr[l__1].y, markedArr[l__1].x, l__1, markedArr[l__1]);
l__2.mouseEnabled = false;
l__2.mouseChildren = false;
explosionArr.push(l__2);
addChild(l__2);
l__1 = (l__1 + 1);
};
}
public function calcScore(){
var l__2:* = undefined;
var l__5:* = undefined;
var l__6:* = undefined;
var l__1:* = 0;
l__2 = 0;
while (l__2 < markedArr.length) {
l__1 = (l__1 + (40 + (l__2 * 10)));
l__2 = (l__2 + 1);
};
var l__3:* = 1;
var l__4:* = new Array();
if (markedArr.length > 5){
l__1 = (l__1 * 1.25);
};
l__2 = 0;
while (l__2 < markedArr.length) {
l__5 = false;
l__6 = 0;
while (l__6 < l__4.length) {
if (markedArr[l__2].getType() == l__4[l__6]){
l__5 = true;
};
l__6 = (l__6 + 1);
};
if (!l__5){
l__4.push(markedArr[l__2].getType());
};
l__2 = (l__2 + 1);
};
l__2 = 0;
while (l__2 < markedArr.length) {
var _local7 = typeUsedArr;
var _local8 = (markedArr[l__2].getType() - 1);
var _local9 = (_local7[_local8] - 1);
_local7[_local8] = _local9;
l__2 = (l__2 + 1);
};
l__2 = 0;
while (l__2 < l__4.length) {
if (typeUsedArr[(l__4[l__2] - 1)] == 0){
l__3 = (l__3 + 0.1);
if (typeUsedBoolArr[(l__4[l__2] - 1)] == false){
l__3 = (l__3 + 0.2);
};
};
l__2 = (l__2 + 1);
};
if (markedArr[(markedArr.length - 1)].isBridge){
l__3 = (l__3 + 0.15);
};
l__2 = 0;
while (l__2 < markedArr.length) {
typeUsedBoolArr[(markedArr[l__2].getType() - 1)] = true;
l__2 = (l__2 + 1);
};
l__1 = Math.round((l__1 * l__3));
score = (score + l__1);
createScorePop(l__1, markedArr[(markedArr.length - 1)].y, markedArr[(markedArr.length - 1)].x, markedArr.length);
communicator.sendScore((currentTick + 1), l__1, score);
if (highestComboScore < l__1){
highestComboScore = l__1;
};
if (longestCombo < markedArr.length){
longestCombo = markedArr.length;
};
trace(("SCORE: " + l__1));
trace(("score: " + score));
}
public function createScorePop(p__1, p__2, p__3, p__4){
var l__5:* = new ScorePop(p__1, p__2, p__3, p__4);
addChild(l__5);
scoreArr.push(l__5);
l__5.mouseEnabled = false;
l__5.mouseChildren = false;
}
public function lightningAnimDone(p__1){
if (!p__1.valid){
removeChild(lcArr[(lcArr.length - 1)]);
lcArr.splice((lcArr.length - 1), 1);
};
handleClick_ = false;
}
public function getBridgeVals():Array{
var l__3:* = undefined;
var l__4:* = undefined;
var l__5:* = undefined;
var l__1:* = new Array();
var l__2:* = getRandom(100);
if (l__2 < 75){
l__3 = (getRandom(noOfTypes) + 1);
l__1.push(l__3);
l__4 = (getRandom(noOfTypes) + 1);
while (l__4 == l__3) {
l__4 = (getRandom(noOfTypes) + 1);
};
l__1.push(l__4);
} else {
l__5 = 0;
while (l__5 < noOfTypes) {
l__1.push((l__5 + 1));
l__5 = (l__5 + 1);
};
};
return (l__1);
}
public function getRandom(p__1:Number){
var l__2:* = random.nextInt(p__1);
noOfRandoms++;
return (l__2);
}
public function getClientRandom(p__1:Number){
return (Math.floor((Math.random() * p__1)));
}
public function endAnim(){
playEndAnim = true;
}
public function endRound(){
var l__1:Boolean;
sfxManager.get("buzz").stop();
sfxManager.get("timeWarning").stop();
gameRoot.updateScoreSign(score, false);
gameRoot.mcClock.gotoAndStop(Math.round((600 - ((timeLeft / TOTAL_TIME) * 600))));
if (numTilesLeft_ <= 0){
l__1 = true;
trace("levelCleared");
musicManager.get("levelCleared").play();
};
clearBoard();
gameState = STATE_NOT_RUNNING;
gameRoot.endRound(score, l__1, highestComboScore, longestCombo, timeLeft);
}
public function clearBoard(){
var l__1:* = undefined;
var l__2:* = undefined;
l__1 = 0;
while (l__1 < gameGridObj.length) {
l__2 = 0;
while (l__2 < gameGridObj[l__1].length) {
if (gameGridObj[l__1][l__2] != null){
removeChild(gameGridObj[l__1][l__2]);
};
l__2 = (l__2 + 1);
};
l__1 = (l__1 + 1);
};
l__1 = 0;
while (l__1 < lcArr.length) {
if (lcArr[l__1] != null){
removeChild(lcArr[l__1]);
};
l__1 = (l__1 + 1);
};
l__1 = 0;
while (l__1 < bgArr.length) {
removeChild(bgArr[l__1]);
l__1 = (l__1 + 1);
};
l__1 = 0;
while (l__1 < scoreArr.length) {
removeChild(scoreArr[l__1]);
l__1 = (l__1 + 1);
};
scoreArr = [];
l__1 = 0;
while (l__1 < explosionArr.length) {
removeChild(explosionArr[l__1]);
l__1 = (l__1 + 1);
};
explosionArr = [];
}
public function getScore(){
return (score);
}
}
}//package src
Section 49
//Letter (src.Letter)
package src {
import src.timing.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class Letter extends MovieClip {
private var delay;
private var currentTick;
private var mod;// = 20
private var xEnd;
private var yd;
private var xRand;
private var xF;
private var rF;
private var num;
private var animLength;// = 0
private var animMaxLength;// = 20
private var yPos;
private var a;// = false
private var yEnd;
private var yF;
private var rot;// = 0
private var rHome;
private var xHome;
private var xd;
private var xPos;
public var txtLetter:TextField;
private var yRand;
private var yHome;
public function Letter(p__1, p__2){
super();
txtLetter.text = p__1;
num = p__2;
xPos = 565;
yPos = 203;
if (AbraCadabra.relaxGame == false){
xEnd = (350 + (p__2 * 20));
} else {
xEnd = (145 + (p__2 * 20));
};
yEnd = 350;
xF = new IFloat(xPos);
yF = new IFloat(yPos);
rF = new IFloat(0);
if (p__2 == 1){
a = true;
};
delay = (p__2 * 3);
delay = p__2;
xd = (yd = 0);
yRand = (xRand = 0);
}
public function tick(p__1:Number):void{
if (delay == 0){
animLength++;
if (animLength <= (animMaxLength - 5)){
xPos = (xPos + xd);
yPos = (yPos + yd);
xd = (xd + Math.round(((Math.random() * 4) - 2)));
yd = ((mod + ((Math.random() * 20) - 5)) * -1);
mod = Math.max((mod - 4), 4);
rot = (rot + Math.round(((Math.random() * 50) - 15)));
if (animLength == (animMaxLength - 5)){
yHome = ((yEnd - yPos) / 5);
xHome = ((xEnd - xPos) / 5);
rHome = (rot / 5);
};
} else {
yPos = (yPos + yHome);
xPos = (xPos + xHome);
rot = (rot - rHome);
if (animLength == animMaxLength){
xF.set(xPos);
yF.set(yPos);
rF.set(rot);
delay = -1;
};
};
xF.set(xPos);
yF.set(yPos);
rF.set(rot);
} else {
delay--;
};
}
public function render(p__1:Number, p__2:Number):void{
x = xF.get(p__2);
y = yF.get(p__2);
rotation = rF.get(p__2);
}
}
}//package src
Section 50
//Lightning (src.Lightning)
package src {
import src.timing.*;
import flash.events.*;
import flash.display.*;
public class Lightning extends MovieClip {
public var mcLightningLayer:MovieClip;
public var mcFiller:Filler;
public var fillerAnimAt;// = 0
public var fillerAnimTo;
public var lightningPieceArr;
private static var ANIM_LENGTH_PER_PIECE = 1;
private static var LIGHTNING_LENGTH = 34;
public function Lightning(p__1:Number, p__2:Number, p__3:Boolean){
lightningPieceArr = new Array();
var l__5:* = undefined;
super();
var l__4:* = 0;
while (l__4 < p__1) {
if (p__3){
l__5 = new LightningPiece();
} else {
l__5 = new LightningPieceRed();
};
lightningPieceArr.push(l__5);
l__5.y = 0;
l__5.x = (34 * l__4);
mcLightningLayer.addChild(l__5);
l__4 = (l__4 + 1);
};
fillerAnimTo = (p__1 * ANIM_LENGTH_PER_PIECE);
switch (p__2){
case 0:
rotation = 0;
break;
case 1:
rotation = 90;
break;
case 2:
rotation = 180;
break;
case 3:
rotation = 270;
break;
};
}
public function getAnimLength(){
return (ANIM_LENGTH_PER_PIECE);
}
public function getLightningLength(){
return (LIGHTNING_LENGTH);
}
}
}//package src
Section 51
//LightningConnector (src.LightningConnector)
package src {
import src.timing.*;
import flash.events.*;
import flash.display.*;
public class LightningConnector extends MovieClip {
private var animAt;// = 0
private var animTo;
private var gameRoot;
public var valid;// = true
public var lightningArr;
public var tileArr;
private var floatArr;
public function LightningConnector(p__1:Game){
lightningArr = new Array();
tileArr = new Array();
floatArr = new Array();
super();
gameRoot = p__1;
x = p__1.x;
y = p__1.y;
mouseChildren = false;
}
public function tick(p__1:Number):void{
var l__3:* = undefined;
var l__2:* = 0;
while (l__2 < lightningArr.length) {
if (lightningArr[l__2].fillerAnimAt != lightningArr[l__2].fillerAnimTo){
lightningArr[l__2].fillerAnimAt++;
l__3 = ((lightningArr[l__2].getLightningLength() / lightningArr[l__2].getAnimLength()) * lightningArr[l__2].fillerAnimAt);
floatArr[l__2].set(l__3);
if (lightningArr[l__2].fillerAnimAt == lightningArr[l__2].fillerAnimTo){
floatArr[l__2].set(l__3);
floatArr[l__2].set(l__3);
if (l__2 == (lightningArr.length - 1)){
gameRoot.lightningAnimDone(this);
};
};
l__2 = lightningArr.length;
};
l__2 = (l__2 + 1);
};
}
public function render(p__1:Number, p__2:Number){
var l__3:* = 0;
while (l__3 < lightningArr.length) {
if (((!((lightningArr[l__3].mcFiller.x == floatArr[l__3].get(p__2)))) && (!((lightningArr[l__3].fillerAnimAt == 0))))){
lightningArr[l__3].mcFiller.x = floatArr[l__3].get(p__2);
};
l__3 = (l__3 + 1);
};
}
public function addPiece(p__1:Piece):void{
tileArr.push(p__1);
}
public function draw(){
var l__1:* = undefined;
var l__2:* = undefined;
var l__3:* = undefined;
var l__4:* = undefined;
l__1 = 0;
while (l__1 < (tileArr.length - 1)) {
if (tileArr[l__1].getRow() == tileArr[(l__1 + 1)].getRow()){
if (tileArr[l__1].getCol() < tileArr[(l__1 + 1)].getCol()){
l__2 = (tileArr[(l__1 + 1)].getCol() - tileArr[l__1].getCol());
l__3 = new Lightning(l__2, 0, valid);
lightningArr.push(l__3);
} else {
l__2 = (tileArr[l__1].getCol() - tileArr[(l__1 + 1)].getCol());
l__3 = new Lightning(l__2, 2, valid);
lightningArr.push(l__3);
};
} else {
if (tileArr[l__1].getRow() < tileArr[(l__1 + 1)].getRow()){
l__2 = (tileArr[(l__1 + 1)].getRow() - tileArr[l__1].getRow());
l__3 = new Lightning(l__2, 1, valid);
lightningArr.push(l__3);
} else {
l__2 = (tileArr[l__1].getRow() - tileArr[(l__1 + 1)].getRow());
l__3 = new Lightning(l__2, 3, valid);
lightningArr.push(l__3);
};
};
l__1 = (l__1 + 1);
};
l__1 = 0;
while (l__1 < lightningArr.length) {
lightningArr[l__1].x = tileArr[l__1].x;
lightningArr[l__1].y = tileArr[l__1].y;
addChild(lightningArr[l__1]);
l__4 = new IFloat(0);
floatArr.push(l__4);
l__1 = (l__1 + 1);
};
}
public function setValid(p__1:Boolean){
this.valid = p__1;
}
}
}//package src
Section 52
//Piece (src.Piece)
package src {
import src.timing.*;
import flash.events.*;
import flash.display.*;
public class Piece extends MovieClip {
public var mcStart:MovieClip;
public var delay;
public var animAt;// = 5
public var theX;
public var theY;
private var numFreeDown_:Number;// = 0
private var clip_:MovieClip;// = null
public var startX;
public var startY;
private var board_:Game;// = null
private var numFreeLeft_:Number;// = 0
public var isBridge:Boolean;
public var gotoX;
public var gotoY;
public var yFloat;
private var type_:Number;// = 0
public var d:Number;// = 0
public var theAlpha;// = 0
private var numFreeRight_:Number;// = 0
private var lastType_;
public var closed:Boolean;// = false
public var theParent:Piece;
public var mcMark:MovieClip;
public var mcClick:Filler;
public var md:Number;// = 0
private var numFreeUp_:Number;// = 0
public var xFloat;
private var row_:Number;
public var nv:Number;// = 0
public var mcItem:MovieClip;
public var isKey:Boolean;
private var col_:Number;
public var mcLock:MovieClip;
public var heapValue:Number;// = 0
public var chainSet;// = false
public var mcKey:MovieClip;
private var game;
public var bridgeArr;
public var bridgeTargetArr;
private var bridgeTypeArr;
public static var NUM_TILES = 39;
public static var WALL_TYPE = 50;
public static var WIDTH:Number = 34;
public static var HEIGHT:Number = 34;
public function Piece(p__1:Game, p__2:MovieClip, p__3:Number, p__4:Number, p__5:Number, p__6:Boolean, p__7){
bridgeArr = new Array();
bridgeTargetArr = new Array();
bridgeTypeArr = new Array();
super();
buttonMode = true;
bridgeTypeArr[12] = 1;
bridgeTypeArr[13] = 2;
bridgeTypeArr[14] = 3;
bridgeTypeArr[15] = 4;
bridgeTypeArr[16] = 5;
bridgeTypeArr[17] = 6;
bridgeTypeArr[18] = 7;
bridgeTypeArr[32] = 8;
bridgeTypeArr[34] = 9;
bridgeTypeArr[35] = 10;
bridgeTypeArr[36] = 11;
bridgeTypeArr[37] = 12;
bridgeTypeArr[38] = 13;
bridgeTypeArr[62] = 14;
bridgeTypeArr[64] = 15;
bridgeTypeArr[65] = 16;
bridgeTypeArr[67] = 17;
bridgeTypeArr[68] = 18;
bridgeTypeArr[24] = 19;
bridgeTypeArr[25] = 20;
bridgeTypeArr[27] = 21;
bridgeTypeArr[28] = 22;
bridgeTypeArr[84] = 23;
bridgeTypeArr[85] = 24;
bridgeTypeArr[87] = 25;
bridgeTypeArr[45] = 26;
bridgeTypeArr[47] = 27;
bridgeTypeArr[75] = 28;
mcKey.mouseEnabled = false;
mcKey.mouseChildren = false;
mcMark.mouseEnabled = false;
mcMark.mc1.mouseEnabled = false;
mcMark.mc2.mouseEnabled = false;
mcMark.mc3.mouseEnabled = false;
mcMark.mc4.mouseEnabled = false;
mcMark.mouseChildren = false;
mouseEnabled = false;
mcLock.mc1.visible = false;
mcLock.mc2.visible = false;
mcLock.mc3.visible = false;
mcLock.mc4.visible = false;
var l__8:* = 0;
board_ = p__1;
row_ = p__4;
col_ = p__5;
isKey = p__6;
isBridge = p__7;
if (!p__6){
removeChild(mcKey);
};
if (p__7){
bridgeArr = board_.getBridgeVals();
if (bridgeArr.length == 2){
if (bridgeTypeArr[((bridgeArr[0] * 10) + bridgeArr[1])] != undefined){
mcItem.gotoAndStop(bridgeTypeArr[((bridgeArr[0] * 10) + bridgeArr[1])]);
} else {
mcItem.gotoAndStop(bridgeTypeArr[((bridgeArr[1] * 10) + bridgeArr[0])]);
};
} else {
mcItem.gotoAndStop(29);
};
} else {
mcItem.visible = false;
};
if (p__3 != WALL_TYPE){
mcLock.visible = false;
};
type_ = p__3;
addFreeUp(0);
addFreeRight(0);
addFreeDown(0);
addFreeLeft(0);
unmarkClicked();
onRollOut();
render();
gotoX = ((p__5 * WIDTH) + 90);
gotoY = ((p__4 * HEIGHT) + 50);
gotoAndStop(Number(((p__3 + 1) + l__8)));
startX = (theX = 485);
startY = (theY = 500);
xFloat = new IFloat(theX);
yFloat = new IFloat(theY);
delay = (Math.round((Math.random() * 20)) + 0);
if (type_ == WALL_TYPE){
delay = 1;
};
if (type_ < 10){
cacheAsBitmap = true;
};
alpha = 0;
}
public function pieceClicked(p__1:Event){
game.pieceClicked(this);
}
public function displayHv(){
}
public function setClickable(p__1:Boolean):void{
if ((((type_ == WALL_TYPE)) || ((type_ == 0)))){
p__1 = false;
};
if (p__1){
mcClick.addEventListener(MouseEvent.MOUSE_DOWN, onPress);
} else {
mcClick.removeEventListener(MouseEvent.MOUSE_DOWN, onPress);
};
}
public function onPress(p__1:Event):void{
board_.tileClicked(this);
}
public function onRollOver():void{
}
public function onRollOut():void{
}
public function setX(p__1:Number):void{
clip_._x = p__1;
}
public function setY(p__1:Number):void{
clip_._y = p__1;
}
public function getXMiddle():Number{
return ((clip_._x + (WIDTH / 2)));
}
public function getYMiddle():Number{
return ((clip_._y + (HEIGHT / 2)));
}
public function addFreeUp(p__1:Number):void{
numFreeUp_ = (numFreeUp_ + p__1);
}
public function addFreeRight(p__1:Number):void{
numFreeRight_ = (numFreeRight_ + p__1);
}
public function addFreeDown(p__1:Number):void{
numFreeDown_ = (numFreeDown_ + p__1);
}
public function addFreeLeft(p__1:Number):void{
numFreeLeft_ = (numFreeLeft_ + p__1);
}
public function getNumFreeUp():Number{
return (numFreeUp_);
}
public function getNumFreeRight():Number{
return (numFreeRight_);
}
public function getNumFreeDown():Number{
return (numFreeDown_);
}
public function getNumFreeLeft():Number{
return (numFreeLeft_);
}
public function isFreeExclusive(p__1:Number, p__2:Number){
if (p__1 < 0){
return ((getNumFreeLeft() >= (-(p__1) - 1)));
};
if (p__1 > 0){
return ((getNumFreeRight() >= (p__1 - 1)));
};
if (p__2 < 0){
return ((getNumFreeUp() >= (-(p__2) - 1)));
};
return ((getNumFreeDown() >= (p__2 - 1)));
}
public function isFree(p__1:Number, p__2:Number){
if (p__1 < 0){
return ((getNumFreeLeft() >= -(p__1)));
};
if (p__1 > 0){
return ((getNumFreeRight() >= p__1));
};
if (p__2 < 0){
return ((getNumFreeUp() >= -(p__2)));
};
return ((getNumFreeDown() >= p__2));
}
public function getType():Number{
return (type_);
}
public function getRow():Number{
return (row_);
}
public function getCol():Number{
return (col_);
}
public function markClicked():void{
mcMark.mc1.gotoAndPlay(2);
mcMark.mc2.gotoAndPlay(2);
mcMark.mc3.gotoAndPlay(2);
mcMark.mc4.gotoAndPlay(2);
}
public function unmarkClicked():void{
mcStart.gotoAndStop(1);
mcMark.mc1.gotoAndStop(1);
mcMark.mc2.gotoAndStop(1);
mcMark.mc3.gotoAndStop(1);
mcMark.mc4.gotoAndStop(1);
}
public function isRemoved():Boolean{
return ((type_ == 0));
}
public function remove():void{
if (type_ == WALL_TYPE){
removeChild(mcLock);
};
lastType_ = type_;
type_ = 0;
unmarkClicked();
onRollOut();
setClickable(false);
}
public function nonVis(){
if ((((lastType_ > 0)) && ((lastType_ < 50)))){
removeChild(mcItem);
if (isKey){
removeChild(mcKey);
};
};
}
public function render():void{
gotoAndStop((type_ + 1));
}
}
}//package src
Section 53
//ScorePop (src.ScorePop)
package src {
import src.timing.*;
import flash.events.*;
import flash.display.*;
public class ScorePop extends MovieClip {
public var mcScore:MovieClip;
public var delay;
public var animAt;// = 1
public var animLength;// = 35
private var currentTick;
public function ScorePop(p__1, p__2, p__3, p__4){
super();
y = p__2;
x = p__3;
delay = (p__4 * 2);
mcScore.txtScore.text = p__1;
}
public function tick(p__1:Number, p__2:Number):void{
currentTick = p__1;
}
public function render(p__1:Number, p__2:Number):void{
}
}
}//package src
Section 54
//Filler (Filler)
package {
import flash.display.*;
public dynamic class Filler extends MovieClip {
}
}//package
Section 55
//LightningPiece (LightningPiece)
package {
import flash.display.*;
public dynamic class LightningPiece extends MovieClip {
public var mcLightningPiece:MovieClip;
}
}//package
Section 56
//LightningPieceRed (LightningPieceRed)
package {
import flash.display.*;
public dynamic class LightningPieceRed extends MovieClip {
public var mcLightningPiece:MovieClip;
}
}//package
Section 57
//MultiFileBlock5_1913080151 (MultiFileBlock5_1913080151)
package {
import src.sound.*;
import src.timing.*;
import src.*;
import flash.display.*;
import src.math.*;
import src.comm.*;
import src.util.*;
import src.BuildArena.*;
public class MultiFileBlock5_1913080151 extends MovieClip {
public function MultiFileBlock5_1913080151(){
var Dummy1:Communicator;
var Dummy2:SoundManager;
var Dummy3:MtRandom;
var Dummy4:BinaryHeap;
var Dummy5:GameDataParser;
var Dummy6:Timer;
var Dummy7:IFloat;
var Dummy8:ManagedSound;
var Dummy9:ManagedSoundChannel;
var Dummy10:AbraCadabra;
var Dummy11:BackGround;
var Dummy12:BuildArena;
var Dummy13:BuildArenaPiece;
var Dummy14:Explosion;
var Dummy15:Game;
var Dummy16:Letter;
var Dummy17:Lightning;
var Dummy18:Piece;
var Dummy19:ScorePop;
var Dummy20:LightningConnector;
super();
}
}
}//package