Frame 1
var debug = false;
var gameID = 212;
var gameName = "gemstone_castle";
stop();
_root.DRScore = 0;
_global.ipb_get_gname = function () {
var _local4 = _root._url;
var _local5 = "";
var _local3 = "";
var _local6 = (_local4.lastIndexOf("\\") + 1);
if ((_local6 == -1) || (_local6 == 0)) {
_local6 = _local4.lastIndexOf("/") + 1;
}
var _local2 = _local6;
var _local7 = String(_local4).length;
while (_local2 < String(_local4).length) {
_local3 = _local4.charAt(_local2);
if (_local3 == ".") {
break;
}
_local5 = _local5 + _local3;
_local2++;
}
return(_local5);
};
ipb_gname = _global.ipb_get_gname();
xx = new LoadVars();
xx.onLoad = function (success) {
if (success) {
_global.ipb_scoreVar = this.scoreVar;
}
};
fname = ((("arcade/gamedata/" + ipb_gname) + "/") + ipb_gname) + ".txt";
xx.load(fname);
getURL ("fscommand:" + "showmenu", "false");
prel.onEnterFrame = function () {
prel.procent.text = Math.ceil((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
prel.gotoAndStop(prel.procent.text);
if (Number(prel.procent.text) >= 100) {
play();
delete this.onEnterFrame;
}
};
Frame 2
stop();
Frame 3
if (!okToPlay) {
gotoAndStop (2);
}
Frame 4
function startSound() {
if ((!isMusicPlaying) || (isMusicPlaying == undefined)) {
if (my_sound != null) {
stopSound();
}
my_sound = new Sound(_root);
my_sound.attachSound("gameloop");
my_sound.start(0, 99999999);
my_sound.setVolume(20);
isMusicPlaying = true;
}
}
function stopSound() {
if (isMusicPlaying) {
my_sound.stop();
delete my_sound;
isMusicPlaying = false;
}
}
var isMusicPlaying;
stop();
start_btn._visible = false;
load_btn._visible = false;
highscore_btn._visible = false;
start_btn.onRelease = function () {
gotoAndStop (5);
};
fgfyw_btn.onRelease = function () {
getURL ("http://www.freegamesforyourwebsite.com/?" + _root.gameName, "_blank");
};
highscore_btn.onRelease = function () {
attachMovie("highscorePage", "highscore_mc", getNextHighestDepth());
highscore_mc._x = (550 - highscore_mc._width) >> 1;
highscore_mc._y = (400 - highscore_mc._height) >> 1;
highscore_mc.back_btn.onRelease = function () {
highscore_mc.removeMovieClip();
};
};
this.onEnterFrame = function () {
if (this.getBytesLoaded() == this.getBytesTotal()) {
start_btn._visible = true;
highscore_btn._visible = true;
preloader_mc._visible = false;
delete this.onEnterFrame;
}
};
Stage.showMenu = false;
startSound();
Instance of ? in Frame 4
on (release) {
getURL ("http://www.freeonlinegames.com/?" + _root.gameName, "_blank");
}
Frame 5
function openGuide(frame, affectNone) {
if (guideMc != null) {
this.removeMovieClip(guideMc);
guideMc = null;
}
guideMc = this.attachMovie("guideMc", "guide_mc", this.getNextHighestDepth());
guideMc._x = (MAP_WIDTH - guideMc._width) >> 1;
guideMc._y = (MAP_HEIGHT - guideMc._height) >> 1;
guideMc.gotoAndStop(frame);
guideMc.okay_btn.onRelease = function () {
if (this._parent._currentframe == 1) {
this._parent.nextFrame();
} else if (this._parent._currentframe == 9) {
this._parent.nextFrame();
} else {
if ((affectNone == false) || (affectNone == undefined)) {
displayedMc.gameInit();
}
closeGuide();
}
};
}
function closeGuide() {
delete guideMc.okay_btn.onRelease;
guideMc.removeMovieClip();
}
function openDialogue(str, obj) {
if (displayedMc != null) {
this.removeMovieClip(displayedMc);
displayedMc = null;
}
if (obj == undefined) {
obj = new Object();
}
displayedMc = this.attachMovie(str, str, 0, obj);
displayedMc._x = (MAP_WIDTH - displayedMc._width) >> 1;
displayedMc._y = (MAP_HEIGHT - displayedMc._height) >> 1;
}
function closeDialogue(str) {
if (str != undefined) {
this[str].removeMovieClip();
} else {
displayedMc.removeMovieClip();
}
}
function backToMain() {
closeDialogue();
gotoAndStop (4);
}
function openLevelComplete(obj) {
openDialogue("levelCompletePage");
}
function equipItem(arr) {
item_array = new Array();
item_array[0] = arr[0];
item_array[1] = arr[1];
item_array[2] = arr[2];
}
function getParentVars() {
return({currentLevel:runningLevel, item_array:item_array});
}
function setLevel(num) {
runningLevel = num;
}
function getItems() {
return(item_array);
}
function getScore() {
return(runningGameScore);
}
function setScore(num) {
runningGameScore = num;
}
function changeBg(scape, bg) {
bg_mc.gotoAndStop(bg);
}
var displayedMc;
var guideMc;
var MAP_WIDTH = 550;
var MAP_HEIGHT = 400;
var runningGameScore = 0;
var runningLevel = 1;
var item_array = [0, 0, 0];
openDialogue("mapPage");
Symbol 44 MovieClip Frame 1
stop();
Symbol 181 MovieClip Frame 1
stop();
var tagctr = (random(55) + 1);
gotoAndStop(tagctr);
Symbol 182 MovieClip Frame 105
stop();
Symbol 192 Button
on (release) {
}
Instance of Symbol 200 MovieClip "mcNotice" in Symbol 237 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 237 MovieClip Frame 120
stop();
if (!((_url.indexOf("freeonlinegames.com") >= 0) && (_url.indexOf("file:") == -1))) {
if (!_root.debug) {
_root.okToPlay = true;
_root.play();
} else {
_root.okToPlay = true;
_root.play();
}
} else {
_root.okToPlay = true;
_root.play();
}
Symbol 238 MovieClip Frame 71
stop();
var fogsound = new Sound();
fogsound.attachSound("fogaudio");
fogsound.start(0, 1);
Symbol 241 MovieClip Frame 1
_root.earl223 = function (val) {
var _local3 = new Array("_", "Z", "y", "x", "W", "v", "u", "T", "s", "r", "Q", "P", "O", "n", "m", "L", "K", "j", "i", "H", "g", "F", "e", "d", "C", "B", "a");
var _local2 = "";
val1 = 0;
while (val1 < val.length) {
if (val.substr(val1, 1) == ":") {
_local2 = _local2 + ":";
} else if (Number(val.substr(val1, 2)) > 26) {
_local2 = _local2 + _local3[Number(val.substr(val1, 1))];
} else if (Number(val.substr(val1, 1)) == 0) {
_local2 = _local2 + "_";
} else {
_local2 = _local2 + _local3[Number(val.substr(val1, 2))];
val1++;
}
val1++;
}
return(_local2);
};
Symbol 248 MovieClip Frame 1
stop();
Symbol 767 MovieClip Frame 1
if (yy.savescore == 1) {
if (ipb_score == undefined) {
ipb_score = eval (_global.ipb_scoreVar);
}
xx = new LoadVars();
xx.arcadegid = _root.ibpro_gameid;
xx.gscore = ipb_score;
xx.gname = _global.ipb_get_gname();
xx.enscore = (ipb_score * yy.randchar) ^ yy.randchar2;
xx.send("index.php?autocom=arcade&do=savescore", "_self", "POST");
stop();
}
_global.ipbSend = function (ipb_score) {
_root._visible = false;
_root.enabled = false;
xx = new LoadVars();
yy = new LoadVars();
xx.sendAndLoad("index.php?autocom=arcade&do=verifyscore", yy, "POST");
};
Symbol 762 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 763 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 764 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 765 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 766 MovieClip [__Packages.mx.transitions.easing.None] Frame 0
class mx.transitions.easing.None
{
function None () {
}
static function easeNone(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeIn(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeInOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static var version = "1.1.0.52";
}
Symbol 256 MovieClip Frame 1
stop();
Symbol 270 MovieClip Frame 25
Symbol 298 MovieClip [normalTile] Frame 1
stop();
Symbol 307 MovieClip [playableTile] Frame 1
function attachNormal(tileKind) {
if (currTile != undefined) {
this.removeMovieClip(currTile);
}
currTile = this.attachMovie("normalTile", "tile", this.getNextHighestDepth());
if (isNaN(tileKind) && (tileKind != "r")) {
tileType = 2;
currTile.gotoAndStop(tileKind);
} else {
tileType = 1;
currTile.gotoAndStop("normalSprite");
currTile.normalSprite.gotoAndStop("s" + tileKind);
}
return(tileType);
}
function init() {
(isFrozen ? (freeze()) : (unfreeze()));
(isInfected ? (infect()) : (disinfect()));
hideMarker();
attachNormal(tileKind);
tile.swapDepths(infectionMarker);
tile.swapDepths(freezeMarker);
stop();
}
function drop(num) {
_alpha = 100;
if (num == undefined) {
num = 1;
}
tempNum = origY - (num * 35);
myTween = new mx.transitions.Tween(this, "_y", mx.transitions.easing.None.easeNone, tempNum, origY, 0.1, true);
return(1);
}
function changeTile(newType, newKind, isFrozen, isInfected) {
if ((newType == undefined) || (newKind == undefined)) {
tileKind = undefined;
tileType = undefined;
currTile.gotoAndStop(1);
}
tileKind = newKind;
tileType = newType;
if (isNaN(tileKind) && (tileKind != "r")) {
tileType = 2;
currTile.gotoAndStop(tileKind);
unfreeze();
disinfect();
} else {
tileType = 1;
currTile.gotoAndStop("normalSprite");
currTile.normalSprite.gotoAndStop("s" + tileKind);
((isFrozen && (tileKind != "r")) ? (freeze()) : (unfreeze()));
((isInfected && (tileKind != "r")) ? (infect()) : (disinfect()));
}
hideMarker();
}
function poof() {
if (isFrozen && (tileType == 1)) {
unfreeze();
hideMarker();
return(undefined);
}
switch (ref.tileKind) {
case "c" :
changeTile(tileType, "cd");
break;
default :
tileType = undefined;
tileKind = undefined;
myTween = new mx.transitions.Tween(this, "_alpha", mx.transitions.easing.Regular.easeOut, 100, 1, 0.1, true);
myTween.onMotionFinished = function () {
if (tileType != 2) {
ref.changeTile(null, null, null, null);
}
};
}
}
function shuffle(newKind) {
changeTile(1, newKind, isFrozen, isInfected);
tile.normalSprite.play();
}
function stopShuffle() {
tile.normalSprite.gotoAndStop("s" + tileKind);
}
function showMarker() {
markerTile._visible = true;
isMarked = true;
}
function hideMarker() {
markerTile._visible = false;
isMarked = false;
}
function unfreeze() {
freezeMarker._visible = false;
isFrozen = false;
}
function freeze() {
freezeMarker._visible = true;
isFrozen = true;
}
function infect() {
infectionMarker._visible = true;
isInfected = true;
}
function disinfect() {
infectionMarker._visible = false;
isInfected = false;
}
var currTile;
var currDir;
var myTween;
var origY = this._y;
var ref = this;
init();
Symbol 314 MovieClip [TileBurst] Frame 1
stop();
Symbol 357 MovieClip [pausePage] Frame 1
modalBg.useHandCursor = false;
modalBg.onPress = function () {
};
playmore_btn.onRelease = function () {
getURL ("http://www.freeonlinegames.com/?" + _root.gameName, "_blank");
};
Symbol 408 MovieClip Frame 1
stop();
Symbol 564 MovieClip [guideMc] Frame 1
stop();
modal.useHandCursor = false;
modal.onPress = function () {
};
Symbol 578 MovieClip [timeUpPage] Frame 1
submitscore_btn.onRelease = function () {
gname = "gemstonecastleDR_v2";
_root.DRScore = totalScore;
gscore = _root.DRScore;
_global.ipbSend();
};
score2_txt.embedFonts = true;
score2_txt.text = totalScore.toString();
Symbol 590 MovieClip [levelCompletePage] Frame 1
okay_btn.onRelease = function () {
_parent.openDialogue("mapPage");
};
toolBonus_txt.text = toolBonus;
timeBonus_txt.text = timeBonus;
levelScore_txt.text = levelScore;
totalScore_txt.text = (toolBonus + timeBonus) + levelScore;
toolBonus_txt.selectable = false;
timeBonus_txt.selectable = false;
levelScore_txt.selectable = false;
totalScore_txt.selectable = false;
_parent.setScore(Number(totalScore_txt.text));
toolBonus_txt.embedFonts = true;
timeBonus_txt.embedFonts = true;
levelScore_txt.embedFonts = true;
totalScore_txt.embedFonts = true;
if (_parent.runningLevel == 5) {
openGuide("inventory", true);
}
Symbol 601 Button
on (press) {
sboard.dir = "up";
}
on (release) {
sboard.dir = "stop";
}
Symbol 602 Button
on (press) {
sboard.dir = "down";
}
on (release) {
sboard.dir = "stop";
}
Symbol 609 MovieClip Frame 1
stop();
Symbol 609 MovieClip Frame 2
stop();
Symbol 619 MovieClip [TMP6ojzjuzm8i] Frame 1
var arrScore = new Array();
mcScoreboard.sboard.dir = "stop";
mcScoreboard.sboard.mcScoreHolder.mcScore._visible = false;
mcLabel._visible = false;
var main = this;
xmlPlayer = new XML();
xmlPlayer.ignoreWhite = true;
xmlPlayer.onLoad = function (success) {
if (success) {
myPlayer = xmlPlayer.firstChild.childNodes;
ctr2 = 0;
while (ctr2 < myPlayer.length) {
thisPlayer = main.mcScoreboard.sboard.mcScoreHolder.mcScore.duplicateMovieClip("mcScore" + ctr2, ctr2);
thisPlayer._y = ctr2 * thisPlayer._height;
thisPlayer._visible = true;
if ((ctr2 % 2) > 0) {
thisPlayer.gotoAndStop(2);
}
thisPlayer.txtNumber.text = (ctr2 + 1) + ")";
thisPlayer.txtNickname.text = myPlayer[ctr2].attributes.player;
thisPlayer.txtScore.text = myPlayer[ctr2].attributes.score;
ctr2++;
}
main.mcScoreboard.mcLoading._visible = false;
main.mcScoreboard.sboard.mcScoreHolder.item = myPlayer.length;
main.mcScoreboard.sboard.mcScoreHolder.speedy = 0;
main.mcScoreboard.sboard.mcScoreHolder.desty = 0;
main.mcScoreboard.sboard.mcScoreHolder.onEnterFrame = function () {
if ((this.desty < 0) && (this._parent.dir == "up")) {
this.desty = this.desty + 10;
if (this.desty > 0) {
this.desty = 0;
}
}
if ((this.desty > (this._parent.mcBlock._height - (this.mcScore._height * this.item))) && (this._parent.dir == "down")) {
this.desty = this.desty - 10;
if (this.desty < (this._parent.mcBlock._height - (this.mcScore._height * this.item))) {
this.desty = this._parent.mcBlock._height - (this.mcScore._height * this.item);
}
}
this.speedy = (this.desty - this._y) + (this.speedy * 0.4);
this._y = this._y + this.speedy;
};
}
};
xmlPlayer.load((("http://www.freeonlinegames.com/scoreboard/getTopPlayer.php?id=" + _root.gameID) + "&rand=") + random(999999));
Instance of Symbol 619 MovieClip [TMP6ojzjuzm8i] in Symbol 626 MovieClip [highscorePage] Frame 1
//component parameters
onClipEvent (construct) {
gameID = 212;
}
Symbol 635 MovieClip [gameCompletePage] Frame 1
submitscore2_btn.onRelease = function () {
gname = "gemstonecastleDR_v2";
_root.DRScore = totalScore;
gscore = _root.DRScore;
_global.ipbSend();
};
toolBonus_txt.text = toolBonus;
timeBonus_txt.text = timeBonus;
levelScore_txt.text = levelScore;
totalScore_txt.text = (toolBonus + timeBonus) + levelScore;
toolBonus_txt.selectable = false;
timeBonus_txt.selectable = false;
levelScore_txt.selectable = false;
totalScore_txt.selectable = false;
_parent.setScore(Number(totalScore_txt.text));
toolBonus_txt.embedFonts = true;
timeBonus_txt.embedFonts = true;
levelScore_txt.embedFonts = true;
totalScore_txt.embedFonts = true;
Symbol 663 MovieClip [mapPage] Frame 1
stop();
continue_btn.onRelease = function () {
_parent.openDialogue("gamePage", _parent.getParentVars());
};
openInv_btn.onRelease = function () {
_parent.openDialogue("inventoryPage");
};
this.gotoAndStop(_parent.runningLevel);
if (_parent.runningLevel < 3) {
openInv_btn._visible = false;
} else {
openInv_btn._visible = true;
}
switch (_parent.runningLevel) {
case 3 :
_parent.openGuide("eWildcard", true);
break;
case 4 :
_parent.openGuide("eStorm", true);
break;
case 6 :
_parent.openGuide("eBreak", true);
break;
case 8 :
_parent.openGuide("eBomb", true);
break;
case 12 :
_parent.openGuide("eTime", true);
break;
case 17 :
_parent.openGuide("eVaccine", true);
}
Symbol 686 MovieClip [gamePage] Frame 1
function addSpriteCursor(str) {
if (mouseSprite != null) {
mouseSprite.removeMovieClip();
mouseSprite = null;
}
Mouse.hide();
mouseSprite = this.attachMovie(str, str + "_mc", this.getNextHighestDepth(), {_x:_xmouse, _y:_ymouse});
mouseSprite.startDrag(true);
}
function restoreMouse() {
if (mouseSprite != null) {
mouseSprite.removeMovieClip();
mouseSprite = null;
}
isBombMode = false;
isBreakMode = false;
if (shuffleQuantity <= 0) {
shuffle_btn._visible = false;
}
Mouse.show();
}
function applyItemEffect() {
function apply(itemNo) {
switch (itemNo) {
case 1 :
shuffleQuantity++;
break;
case 2 :
breakQuantity++;
break;
case 3 :
bombQuantity++;
break;
case 4 :
totalSec = totalSec + (totalSec * 0.15);
break;
case 5 :
minInfected = minInfected - 2;
((minInfected < 0) ? ((minInfected = 0)) : 0);
break;
case 6 :
specialKind_array.push("r");
}
}
var _local1 = 0;
while (_local1 < item_array.length) {
apply(item_array[_local1]);
_local1++;
}
}
function gameInit() {
applyItemEffect();
shuffle_txt.text = shuffleQuantity;
break_txt.text = breakQuantity;
bomb_txt.text = bombQuantity;
if (shuffleQuantity <= 0) {
shuffle_btn._visible = false;
shuffle_txt._visible = false;
}
if (breakQuantity <= 0) {
break_btn._visible = false;
break_txt._visible = false;
}
if (bombQuantity <= 0) {
bomb_btn._visible = false;
bomb_txt._visible = false;
}
shuffle_btn.onRelease = function () {
if (isBreakMode) {
return(undefined);
}
if (isBombMode) {
return(undefined);
}
if (!isDropping) {
shuffleQuantity--;
if (shuffleQuantity <= 0) {
shuffle_btn._visible = false;
shuffle_txt._visible = false;
}
shuffle_txt.text = shuffleQuantity;
shuffleBoard();
}
};
break_btn.onRelease = function () {
if (isDropping) {
return(undefined);
}
if (isBombMode) {
return(undefined);
}
isBreakMode = true;
isBombMode = false;
addSpriteCursor("breakCursor");
breakQuantity--;
if (breakQuantity <= 0) {
break_btn._visible = false;
break_txt._visible = false;
}
break_txt.text = breakQuantity;
};
bomb_btn.onRelease = function () {
if (isDropping) {
return(undefined);
}
if (isBreakMode) {
return(undefined);
}
isBreakMode = false;
isBombMode = true;
addSpriteCursor("bombCursor");
bombQuantity--;
if (bombQuantity <= 0) {
bomb_btn._visible = false;
bomb_txt._visible = false;
}
bomb_txt.text = bombQuantity;
};
pause_btn.onRelease = function () {
pauseGame();
};
musicOn_btn.onRelease = function () {
_parent.stopSound();
musicOff_btn._visible = true;
musicOn_btn._visible = false;
};
musicOff_btn.onRelease = function () {
_parent.startSound();
musicOn_btn._visible = true;
musicOff_btn._visible = false;
};
if (parent.isMusicPlaying) {
musicOn_btn._visible = false;
musicOff_btn._visible = true;
} else {
musicOff_btn._visible = false;
musicOn_btn._visible = true;
}
var _local15;
totalArea = map_array[0].length * map_array.length;
currentProgress = requiredTiles;
gameBoardMc = this.createEmptyMovieClip("gameBoardMc", this.getNextHighestDepth());
var _local4 = 0;
while (_local4 < map_array.length) {
var _local3 = 0;
while (_local3 < map_array[0].length) {
if ((map_array[_local4][_local3] == 0) || (isNaN(map_array[_local4][_local3]))) {
gameBoardMc.attachMovie("floorTile", (("x_" + _local3) + "_") + _local4, gameBoardMc.getNextHighestDepth(), {_x:_local3 * TILE_W, _y:_local4 * TILE_H});
if (isNaN(map_array[_local4][_local3])) {
gameBoardMc.attachMovie("playableTile", (("p_" + _local3) + "_") + _local4, (totalArea * 2) + gameBoardMc.getNextHighestDepth(), {_x:_local3 * TILE_W, _y:_local4 * TILE_H, tileType:2, tileKind:map_array[_local4][_local3], row:_local4, col:_local3, isInfected:false, isFrozen:false, isMarked:false, isPlayable:true});
if (map_array[_local4][_local3] == "l") {
lock_array.push(gameBoardMc[(("p_" + _local3) + "_") + _local4]);
} else if (map_array[_local4][_local3] == "k") {
key_array.push(gameBoardMc[(("p_" + _local3) + "_") + _local4]);
}
} else {
gameBoardMc.attachMovie("playableTile", (("p_" + _local3) + "_") + _local4, totalArea + gameBoardMc.getNextHighestDepth(), {_x:_local3 * TILE_W, _y:_local4 * TILE_H, tileType:1, tileKind:randShuffle(), row:_local4, col:_local3, isInfected:randInfect(), isFrozen:freeze(), isMarked:false, isPlayable:true});
(gameBoardMc[(("p_" + _local3) + "_") + _local4].isInfected ? (infected_array.push(gameBoardMc[(("p_" + _local3) + "_") + _local4])) : null);
}
arr.push(gameBoardMc[(("p_" + _local3) + "_") + _local4]._name);
} else {
gameBoardMc.attachMovie("unplayableTile", (("p_" + _local3) + "_") + _local4, (totalArea * 10) + gameBoardMc.getNextHighestDepth(), {_x:_local3 * TILE_W, _y:_local4 * TILE_H, isPlayable:false});
}
_local3++;
}
_local4++;
}
gameBoardMc._x = (STAGE_W - (TILE_W * map_array[0].length)) >> 1;
gameBoardMc._y = ((STAGE_H - (TILE_H * map_array.length)) >> 1) + 10;
assignListeners();
lookForMatches();
gameBoardMc.createTextField("pointBurst_txt", gameBoardMc.getNextHighestDepth(), 0, 0, 300, 100);
gameBoardMc.pointBurst_txt.selectable = false;
if (bombQuantity <= 0) {
bomb_btn._visible = false;
}
if (breakQuantity <= 0) {
break_btn._visible = false;
}
if (shuffleQuantity <= 0) {
shuffle_btn._visible = false;
}
countdown();
infectId = setInterval(infectTiles, infectInterval);
timerId = setInterval(countdown, 1000);
this.attachMovie("gameFrame", "gframe_mc", this.getNextHighestDepth(), {_x:gameBoardMc._x + 10, _y:gameBoardMc._y + 15});
gframe_mc.swapDepths(gameBoardMc);
gframe_mc._width = ((map_array[0].length - 1) * TILE_W) + 12.5;
gframe_mc._height = (map_array.length - 1) * TILE_H;
explode_sound = new Sound(this);
break_sound = new Sound(this);
match_sound = new Sound(this);
explode_sound.attachSound("explode");
break_sound.attachSound("break");
match_sound.attachSound("match");
}
function countdown() {
if (totalSec > 0) {
totalSec = totalSec - 1;
var _local2 = Math.floor(totalSec / 60);
var _local1 = Math.floor(totalSec) % 60;
if (_local1 < 10) {
_local1 = "0" + _local1;
}
timer_txt.text = (_local2 + ":") + _local1;
} else {
endLevel(true);
}
}
function pauseGame() {
clearInterval(infectId);
clearInterval(timerId);
this.attachMovie("pausePage", "pause_mc", this.getNextHighestDepth());
gameBoardMc._visible = false;
pause_mc.resume_btn.onRelease = function () {
pause_mc.removeMovieClip();
infectId = setInterval(infectTiles, infectInterval);
timerId = setInterval(countdown, 1000);
gameBoardMc._visible = true;
};
}
function infectTiles() {
if (infected_array.length >= minInfected) {
return(undefined);
}
var _local1;
while (true) {
_local1 = gameBoardMc[(("p_" + Math.round(Math.random() * map_array.length)) + "_") + Math.round(Math.random() * map_array[0].length)];
if (((!isNaN(_local1.tileKind)) && (_local1.isInfected == false)) && (_local1.isMarked == false)) {
_local1.infect();
infected_array.push(_local1);
if (!isDropping) {
lookForMatches();
}
break;
}
}
}
function randTile() {
var _local1;
if (Math.random() < specialRate) {
_local1 = specialKind_array[Math.round(Math.random() * (specialKind_array.length - 1))];
} else {
_local1 = Math.ceil(Math.random() * kindRange);
}
return(_local1);
}
function randShuffle() {
return(Math.ceil(Math.random() * kindRange));
}
function assignListeners() {
for (var _local2 in arr) {
gameBoardMc[arr[_local2]].onPress = function () {
if ((!isDropping) && (this.tileType == 1)) {
if (isBombMode) {
this.changeTile("2", "b", false, false);
bombQuantity--;
restoreMouse();
return(undefined);
}
if (isBreakMode) {
match_array = [this];
destroyMatch(null, 1, true);
breakQuantity--;
restoreMouse();
return(undefined);
}
activateDetector(this);
}
};
}
}
function getTextFormat(num) {
var _local1 = new TextFormat();
_local1.size = num;
_local1.kerning = true;
_local1.bold = true;
_local1.color = 16777215 /* 0xFFFFFF */;
_local1.font = "EmbeddedFont";
return(_local1);
}
function activateDetector(firstMc) {
function checkMouseOver() {
var _local1 = 0;
while (_local1 < arr.length) {
if (gameBoardMc[arr[_local1]].hitTest(_xmouse, _ymouse)) {
return(arr[_local1]);
}
_local1++;
}
}
if ((firstMc.tileType == 2) || (firstMc.isInfected)) {
return(undefined);
}
var prev;
var prevprev;
var mouseListener = new Object();
var kindSniff;
var _local6;
var _local5 = [];
match_array.push(firstMc);
firstMc.isMarked = true;
firstMc.showMarker();
kindSniff = firstMc.tileKind;
prev = match_array[match_array.length - 1];
mouseListener.onMouseMove = function () {
function checkPosish(mc1, mc, array) {
var _local3 = 0;
if (_local3 < array.length) {
if (mc1.col == mc.col) {
if ((mc1.row - mc.row) == 1) {
return("up");
}
if ((mc1.row - mc.row) == -1) {
return("down");
}
} else if (mc1.row == mc.row) {
if ((mc1.col - mc.col) == 1) {
return("left");
}
if ((mc1.col - mc.col) == -1) {
return("right");
}
}
return(undefined);
}
}
if (firstMc.tileType == 2) {
return(undefined);
}
if (firstMc.isInfected) {
return(undefined);
}
if (isDropping) {
return(undefined);
}
var _local2 = gameBoardMc[checkMouseOver()];
var _local3 = [[0, 1], [0, -1], [1, 0], [-1, 0]];
var _local4;
if (_local2 == prev) {
return(undefined);
}
_local4 = checkPosish(prev, _local2, _local3);
if (_local4 != undefined) {
if (_local2 == prevprev) {
match_array.pop();
prev.hideMarker();
removeArrow(prev);
removeArrow(_local2);
match_array[match_array.length - 1].pop();
prev = match_array[match_array.length - 1];
prevprev = match_array[match_array.length - 2];
if ((_local2 == firstMc) && (firstMc.tileKind == "r")) {
kindSniff = "r";
}
return(undefined);
}
if (_local2.isMarked) {
return(undefined);
}
if (_local2.isInfected) {
return(undefined);
}
if (_local2.tileType == 2) {
return(undefined);
}
if (((kindSniff == _local2.tileKind) || (_local2.tileKind == "r")) || (kindSniff == "r")) {
if ((kindSniff == "r") && (_local2.tileKind != "r")) {
kindSniff = _local2.tileKind;
}
addArrow(prev, _local4);
prevprev = match_array[match_array.length - 1];
match_array.push(_local2);
match_array[match_array.length - 1].isMarked = true;
match_array[match_array.length - 1].showMarker();
prev = match_array[match_array.length - 1];
}
}
};
mouseListener.onMouseUp = function () {
destroyMatch(match_array, 3, false);
Mouse.removeListener(mouseListener);
};
Mouse.addListener(mouseListener);
}
function addArrow(_mc, _str) {
removeArrow(_mc);
_mc.currDir = gameBoardMc.attachMovie("dirMc", _mc._name + _str, gameBoardMc.getNextHighestDepth());
switch (_str) {
case "left" :
_mc.currDir._x = _mc._x;
_mc.currDir._y = _mc._y + (_mc._height >> 1);
break;
case "right" :
_mc.currDir._x = _mc._width + _mc._x;
_mc.currDir._y = _mc._y + (_mc._height >> 1);
break;
case "down" :
_mc.currDir._x = _mc._x + (_mc._width >> 1);
_mc.currDir._y = _mc._y + _mc._height;
break;
default :
_mc.currDir._x = _mc._x + (_mc._width >> 1);
_mc.currDir._y = _mc._y;
}
_mc.currDir.gotoAndStop(_str);
}
function removeArrow(_mc) {
if (_mc.currDir != undefined) {
_mc.currDir.removeMovieClip();
}
}
function destroyMatch(_array, _num, isSpecial) {
function deleteTile() {
var _local2 = 0;
var _local1 = 0;
while (_local1 < match_array.length) {
findSpecial(match_array[_local1]);
if (match_array[_local1].tileKind == "r") {
_local2 = _local2 + 3;
}
match_array[_local1].poof();
removeArrow(match_array[_local1]);
_local1++;
}
if (!isSpecial) {
var _local3 = match_array.length * (9 + (3 * (match_array.length - 3)));
addScore(_local3 * (1 + _local2));
isFinished = affectFluid(match_array.length);
pointBurst(match_array[match_array.length - 1], _local3, _local2);
}
match_array = [];
collateral_array = [];
intId = setInterval(afterDelete, 150);
}
function findSpecial(_mc) {
var _local3 = new Array([0, 1], [1, 0], [-1, 0], [0, -1]);
var _local1 = 0;
while (_local1 < _local3.length) {
var _local2 = gameBoardMc[(("p_" + (_mc.col + _local3[_local1][0])) + "_") + (_mc.row + _local3[_local1][1])];
if (_local2 == undefined) {
} else if (_local2.tileType != 2) {
} else {
switch (_local2.tileKind) {
case "l" :
case "k" :
break;
default :
activateSpecial(_local2);
}
}
_local1++;
}
}
function activateSpecial(_mc) {
function tileBurst(_mc) {
function afterBurst() {
clearInterval(bId);
burst.removeMovieClip();
}
var burst = _mc._parent.attachMovie("TileBurst", "burst_" + _mc._name, _mc._parent.getNextHighestDepth());
var bId = setInterval(afterBurst, 500);
burst._x = _mc._x;
burst._y = _mc._y;
burst.gotoAndStop(_mc.tileKind);
}
function isContains(_mc, in_array) {
var _local1 = 0;
while (_local1 < in_array.length) {
if (in_array[_local1] == _mc) {
return(true);
}
_local1++;
}
return(false);
}
switch (_mc.tileKind) {
case "c" :
collateral_array.push(_mc);
_mc.poof();
break;
case "b" :
tileBurst(_mc);
_mc.poof();
explode_sound.start();
var _local5 = [[0, 1], [1, 0], [-1, 0], [0, -1]];
var _local3 = 0;
while (_local3 < _local5.length) {
var _local1 = gameBoardMc[(("p_" + (_mc.col + _local5[_local3][0])) + "_") + (_mc.row + _local5[_local3][1])];
if (_local1 == undefined) {
} else if (_local1.tileType == 2) {
activateSpecial(_local1);
} else if (!isContains(_local1, collateral_array.concat(match_array))) {
_local1.poof();
collateral_array.push(_local1);
}
_local3++;
}
break;
case "x" :
var _local4 = 0;
while (_local4 < infected_array.length) {
infected_array[_local4].disinfect();
_local4++;
}
isRecentlyCured = true;
_mc.poof();
break;
case "t" :
((totalSec > 0) ? ((totalSec = totalSec + 10)) : 0);
tileBurst(_mc);
countdown();
_mc.poof();
break;
case "g" :
addScore(500);
tileBurst(_mc);
_mc.poof();
break;
case "cd" :
if (isContains(_mc, collateral_array)) {
break;
}
tileBurst(_mc);
_mc.poof();
}
}
function dropTiles() {
var _local4 = 0;
while (_local4 <= map_array[0].length) {
var _local5 = 0;
var _local1;
var _local3 = map_array.length;
while (_local3 > 0) {
_local1 = gameBoardMc[(("p_" + _local4) + "_") + _local3];
if (!_local1.isPlayable) {
} else if (_local1.tileKind == undefined) {
var _local2 = _local1.row;
while (_local2 >= 0) {
above_mc = gameBoardMc[(("p_" + _local4) + "_") + _local2];
if (!above_mc.isPlayable) {
_local1.changeTile(null, null, null, null);
break;
}
if (above_mc.tileKind == undefined) {
} else {
_local1.changeTile(above_mc.tileType, above_mc.tileKind, above_mc.isFrozen, above_mc.isInfected);
_local1.drop();
above_mc.changeTile(null, null, null, null);
break;
}
_local2--;
}
}
_local3--;
}
_local4++;
}
intId = setInterval(afterDrop, 100);
countInfected();
}
function regenerateTile() {
lock_array = [];
key_array = [];
var _local2 = 0;
while (_local2 < map_array[0].length) {
var _local1 = 0;
while (_local1 < map_array.length) {
if (gameBoardMc[(("p_" + _local2) + "_") + _local1].isPlayable && (gameBoardMc[(("p_" + _local2) + "_") + _local1].tileKind == undefined)) {
gameBoardMc[(("p_" + _local2) + "_") + _local1].changeTile(null, randTile(), freeze(), false);
gameBoardMc[(("p_" + _local2) + "_") + _local1].drop();
} else if (gameBoardMc[(("p_" + _local2) + "_") + _local1].tileKind == "l") {
lock_array.push(gameBoardMc[(("p_" + _local2) + "_") + _local1]);
} else if (gameBoardMc[(("p_" + _local2) + "_") + _local1].tileKind == "k") {
key_array.push(gameBoardMc[(("p_" + _local2) + "_") + _local1]);
}
_local1++;
}
_local2++;
}
intId = setInterval(afterRegen, 150);
}
function afterDelete() {
clearInterval(intId);
dropTiles();
}
function afterDrop() {
clearInterval(intId);
regenerateTile();
}
function afterRegen() {
clearInterval(intId);
isRecentlyCured = false;
if (isFinished) {
match_array = lock_array.concat(key_array);
lock_array = [];
key_arrey = [];
destroyMatch(match_array, 2, true);
}
isDropping = false;
lookForMatches();
checkLock();
}
var _local18 = new Array();
var isFinished = false;
isDropping = true;
if (match_array.length >= _num) {
if (_num == 1) {
break_sound.start();
} else if (_num >= 3) {
match_sound.start();
}
stopShuffleBoard();
deleteTile();
} else {
var _local1 = 0;
while (_local1 < match_array.length) {
match_array[_local1].hideMarker();
removeArrow(match_array[_local1]);
_local1++;
}
match_array = [];
isDropping = false;
}
}
function checkLock() {
var _local2;
var _local1 = 0;
while (_local1 < lock_array.length) {
_local2 = gameBoardMc[(("p_" + lock_array[_local1].col) + "_") + (lock_array[_local1].row - 1)];
if (_local2.tileKind == "k") {
match_array.push(_local2);
match_array.push(lock_array[_local1]);
lock_array.splice(_local1, 1);
}
_local1++;
}
if (lock_array.length == 0) {
endLevel();
}
match_array.reverse();
destroyMatch(match_array, 2, true);
}
function detectLock(_mc) {
if ((_mc.tileKind = "l")) {
lock_array.push(_mc);
}
}
function countInfected() {
infected_array = [];
var _local2;
var _local3 = 0;
while (_local3 < map_array.length) {
var _local1 = 0;
while (_local1 < map_array[0].length) {
_local2 = gameBoardMc[(("p_" + _local1) + "_") + _local3];
if (_local2.isInfected) {
infected_array.push(_local2);
}
_local1++;
}
_local3++;
}
return(infected_array.length);
}
function lookForMatches(isSpatial) {
function checkInitialPattern(mc1, arr1) {
var _local1 = 0;
while (_local1 < arr1.length) {
if ((mc1.tileKind == gameBoardMc[(("p_" + (j + arr1[_local1][0])) + "_") + (i + arr1[_local1][1])].tileKind) && (gameBoardMc[(("p_" + (j + arr1[_local1][0])) + "_") + (i + arr1[_local1][1])].isInfected == false)) {
if (checkSecondaryPattern(mc1, arr1[_local1][2]) == true) {
return(true);
}
}
_local1++;
}
return(false);
}
function checkSecondaryPattern(mc2, arr2) {
var _local1 = 0;
while (_local1 < arr2.length) {
if ((mc2.tileKind == gameBoardMc[(("p_" + (j + arr2[_local1][0])) + "_") + (i + arr2[_local1][1])].tileKind) && (gameBoardMc[(("p_" + (j + arr2[_local1][0])) + "_") + (i + arr2[_local1][1])].isInfected == false)) {
return(true);
}
_local1++;
}
return(false);
}
var _local2;
var _local4 = [[0, -1, [[0, -2], [-1, -1], [1, -1]]], [-1, 0, [[-1, -1], [-2, 0], [-1, 1]]], [1, 0, [[1, -1], [2, 0], [1, -1]]], [0, 1, [[-1, 1], [0, 2], [1, 1]]]];
var i = 0;
while (i < map_array.length) {
var j = 0;
while (j < map_array[0].length) {
_local2 = gameBoardMc[(("p_" + j) + "_") + i];
if ((isNaN(_local2.tileKind) == false) && (_local2.isInfected == false)) {
if (checkInitialPattern(_local2, _local4) == true) {
return(true);
}
}
j++;
}
i++;
}
(isSpatial ? (shuffleBoard(1)) : (shuffleBoard()));
return(false);
}
function shuffleBoard(interval) {
function afterShuffle() {
clearInterval(intId);
isDropping = false;
stopShuffleBoard();
lookForMatches();
}
if (interval == undefined) {
interval = shuffleInterval;
}
isDropping = true;
var _local2 = 0;
while (_local2 < map_array.length) {
var _local1 = 0;
while (_local1 < map_array[0].length) {
if ((gameBoardMc[(("p_" + _local1) + "_") + _local2].tileType == 1) && (gameBoardMc[(("p_" + _local1) + "_") + _local2].tileKind != "r")) {
gameBoardMc[(("p_" + _local1) + "_") + _local2].shuffle(randShuffle());
}
_local1++;
}
_local2++;
}
restoreMouse();
intId = setInterval(afterShuffle, interval);
}
function stopShuffleBoard() {
var _local2 = 0;
while (_local2 < map_array.length) {
var _local1 = 0;
while (_local1 < map_array[0].length) {
if (gameBoardMc[(("p_" + _local1) + "_") + _local2].tileType == 1) {
gameBoardMc[(("p_" + _local1) + "_") + _local2].stopShuffle();
}
_local1++;
}
_local2++;
}
}
function endLevel(isDead) {
clearInterval(intId);
clearInterval(infectId);
clearInterval(timerId);
match_sound.stop();
explode_sound.stop();
break_sound.stop();
delete match_sound;
delete explode_sound;
delete break_sound;
restoreMouse();
if (isDead) {
_parent.openDialogue("timeUpPage", {totalScore:gameScore});
} else {
if (currentLevel == MAX_LEVEL) {
_parent.openDialogue("gameCompletePage", {timeBonus:Math.round(totalSec * 10), toolBonus:Math.max(100, ((shuffleQuantity + breakQuantity) + bombQuantity) * 100), levelScore:gameScore});
return(undefined);
}
_parent.setLevel(currentLevel + 1);
_parent.openDialogue("levelCompletePage", {timeBonus:Math.round(totalSec * 10), toolBonus:Math.max(100, ((shuffleQuantity + breakQuantity) + bombQuantity) * 100), levelScore:gameScore});
}
}
function addScore(scr) {
gameScore = gameScore + scr;
score_txt.text = gameScore;
}
function pointBurst(_mc, scr, multiplier) {
function afterBurst() {
clearInterval(burstId);
pbTween = new mx.transitions.Tween(gameBoardMc.pointBurst_txt, "_alpha", mx.transitions.easing.None.easeNone, 100, 30, 0.3, true);
pbTween.onMotionFinished = function () {
gameBoardMc.pointBurst_txt._visible = false;
delete pbTween;
};
}
var pbTween;
var burstId;
isFinished = affectFluid(match_array.length);
gameBoardMc.pointBurst_txt._x = _mc._x + (TILE_W >> 1);
gameBoardMc.pointBurst_txt._y = _mc._y - (TILE_H >> 1);
gameBoardMc.pointBurst_txt.text = "";
((multiplier >= 2) ? ((gameBoardMc.pointBurst_txt.text = gameBoardMc.pointBurst_txt.text + (multiplier + "X"))) : true);
gameBoardMc.pointBurst_txt.text = gameBoardMc.pointBurst_txt.text + scr;
gameBoardMc.pointBurst_txt._alpha = 100;
gameBoardMc.pointBurst_txt.setTextFormat(getTextFormat(BASETXTSIZE + Math.min(BASETXTSIZE << 1, Math.floor(scr / (BASETXTSIZE >> 1)))));
gameBoardMc.pointBurst_txt._visible = true;
gameBoardMc.pointBurst_txt.filters = [new flash.filters.GlowFilter(3342336, 100, 5, 5, 10, 1, false, false)];
gameBoardMc.pointBurst_txt.embedFonts = true;
gameBoardMc.pointBurst_txt.antiAliasType = "advanced";
burstId = setInterval(afterBurst, 550);
}
function affectFluid(num) {
currentProgress = currentProgress - num;
var _local1 = Math.floor(100 - ((currentProgress / requiredTiles) * 100));
if (_local1 >= 100) {
progressTracker_mc.gotoAndStop(100);
return(true);
}
progressTracker_mc.gotoAndStop(Math.floor(100 - ((currentProgress / requiredTiles) * 100)));
return(false);
}
function randInfect() {
if (infected_array.length >= minInfected) {
return(false);
}
return(((Math.random() < infectRate) ? true : false));
}
function freeze() {
return(((Math.random() < freezeRate) ? true : false));
}
var ref = this;
var gameBoardMc;
var TILE_H = 30;
var TILE_W = 30;
var STAGE_H = 400;
var STAGE_W = 550;
var BASETXTSIZE = 20;
var MAX_LEVEL = 20;
var moveCount;
var map_array;
var match_array = new Array();
var arr = new Array();
var totalArea;
var mouseSprite;
var isLooking = false;
var isDropping = false;
var isRecentlyCured = false;
var isBreakMode = false;
var isBombMode = false;
var item_array = item_array;
var lock_array = new Array();
var key_array = new Array();
var bomb_array = new Array();
var special_array = new Array();
var collateral_array = new Array();
var infected_array = new Array();
var explode_sound;
var break_sound;
var match_sound;
var currentLevel = currentLevel;
var kindRange = 3;
var gameScore = _parent.getScore();
var requiredTiles = Number.MAX_VALUE;
var totalSec;
var shuffleQuantity;
var bombQuantity;
var breakQuantity;
var currentProgress;
var guidePage;
var specialKind_array = ["b", "t", "r", "x"];
var freezeRate = 0;
var infectRate = 0.05;
var specialRate = 0.1;
var minInfected = 0;
var infectInterval = 5000;
var shuffleInterval = 1000;
var intId;
var infectId;
var timerId;
score_txt.embedFonts = true;
timer_txt.embedFonts = true;
level_txt.embedFonts = true;
score_txt.selectable = false;
timer_txt.selectable = false;
level_txt.selectable = false;
shuffle_txt.embedFonts = true;
break_txt.embedFonts = true;
bomb_txt.embedFonts = true;
shuffle_txt.selectable = false;
break_txt.selectable = false;
bomb_txt.selectable = false;
map_array = [[7, 6, 6, 6, 5, 1, 7, 6, 6, 6, 5], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, "k", 0, 0, 0, 0, "k", "x", 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, 8, 0, 0, 0, 0, 0, 0, "c", 9, 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, "l", 0, 0, 0, 0, "l", 0, 9], [4, 0, 0, 0, 0, 0, 0, 0, 0, "g", 2], [8, "x", 0, 0, 0, 0, 0, 0, 0, 0, 9], [1, 1, 4, 3, 3, 3, 3, 3, 2, 1, 1]];
lvl1_array = [[7, 6, 6, 6, 6, 6, 5], [8, 0, 0, 0, 0, 0, 9], [8, 0, 0, "k", 0, 0, 9], [8, 0, 0, 0, 0, 0, 9], [8, 8, 0, 0, 0, 9, 9], [8, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 9], [4, 0, 0, 0, 0, 0, 2], [8, 0, 0, "l", 0, 0, 9], [1, 1, 4, 3, 2, 1, 1]];
lvl2_array = [[7, 6, 6, 6, 6, 6, 6, 5], [8, "r", 0, 0, 0, 0, "r", 9], [8, 0, 0, 0, "k", 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [4, 0, 0, 0, "l", 0, 0, 9], [8, "r", 0, 0, 0, 0, "r", 9], [1, 1, 1, 4, 3, 2, 1, 1]];
lvl3_array = [[7, 6, 6, 6, 6, 6, 6, 6, 1, 5], [8, 0, 0, "k", 0, 0, 0, "k", 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 9], [4, 0, 0, "l", 0, 0, 0, 0, 0, 9], [8, "r", 0, 0, 0, "r", 0, "l", 0, 9], [1, 1, 4, 3, 2, 1, 1, 1, 1, 1]];
lvl4_array = [[7, 6, 6, 6, 6, 6, 6, 6, 5], [8, "r", 0, 0, 0, 0, 0, "r", 9], [8, 0, 0, "k", 0, 0, 0, "k", 9], [8, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, "c", 9], [4, 0, 0, "c", 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, "l", 0, "r", 0, "l", 9], [1, 1, 4, 3, 2, 1, 1, 1, 1]];
lvl5_array = [[7, 6, 6, 6, 6, 6, 6, 5], [8, 1, 0, 0, 0, 0, 1, 9], [8, "k", 0, 0, 0, 0, "k", 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, "r", 0, 0, "c", 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, "c", 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [4, "l", 0, 0, 0, 0, "l", 9], [8, 1, 0, 0, "r", 0, 1, 9], [1, 1, 4, 3, 2, 1, 1, 1]];
lvl6_array = [[7, 6, 6, 6, 6, 6, 6, 1, 5], [8, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, "k", 0, 0, 0, "k", 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, "c", "b", 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, "b", 0, 0, "r", 0, 0, 9], [8, 0, "c", 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 9], [4, 0, "l", 0, 0, 0, "l", 0, 9], [8, "r", 0, 0, "b", 0, 0, 0, 9], [1, 1, 4, 3, 2, 1, 1, 1, 1]];
lvl7_array = [[7, 6, 6, 6, 6, 6, 6, 5], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, "k", 0, 0, 0, "k", 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, "t", 0, 0, "t", 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, "t", 0, 0, 0, 0, 0, 9], [4, 0, "l", 0, 0, 0, "l", 9], [8, 0, 0, 0, "b", 0, 0, 9], [1, 1, 4, 3, 2, 1, 1, 1]];
lvl8_array = [[7, 6, 6, 6, 6, 6, 6, 1, 5], [8, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, "k", 0, 0, 0, "k", 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, "g", 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, "r", 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 9], [4, 0, "l", 0, 0, 0, "l", 0, 9], [8, 0, 0, 0, "g", 0, 0, 0, 9], [1, 1, 4, 3, 2, 1, 1, 1, 1]];
lvl9_array = [[7, 6, 6, 6, 6, 6, 6, 5], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, "k", 0, 0, 0, "k", 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, "b", 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [4, 0, "l", 0, 0, 0, "l", 9], [8, 0, 0, 0, "b", 0, 0, 9], [1, 1, 4, 3, 2, 1, 1, 1]];
lvl10_array = [[7, 6, 6, 6, 6, 6, 6, 5], [8, 0, 0, 0, "g", 0, 0, 9], [8, 0, "k", 0, 0, 0, "k", 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, "g", 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [4, 0, "l", 0, 0, 0, "l", 9], [8, 0, 0, 0, 0, 0, 0, 9], [1, 1, 4, 3, 2, 1, 1, 1]];
lvl11_array = [[7, 6, 6, 6, 6, 6, 6, 1, 5], [8, 0, 0, 0, "g", 0, 0, "k", 9], [8, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, "k", 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, "c", "g", 0, 0, 0, "t", 9], [8, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, "l", 0, 0, 0, 0, 0, 9], [4, 0, 0, 0, "r", 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, "l", 9], [1, 1, 4, 3, 2, 1, 1, 1, 1]];
lvl12_array = [[7, 6, 6, 6, 6, 6, 6, 5], [8, 0, 0, 0, "g", 0, 0, 9], [8, 0, "k", 0, 0, 0, "k", 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, "c", 0, 0, 9], [8, 0, 0, "g", 0, 0, 0, 9], [8, 0, "c", 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, "c", 9], [4, 0, "l", 0, 0, 0, "l", 9], [8, 0, 0, 0, 0, 0, 0, 9], [1, 1, 4, 3, 2, 1, 1, 1]];
lvl13_array = [[7, 6, 6, 6, 6, 6, 6, 5], [8, 0, 0, 0, "g", 0, 0, 9], [8, 0, "k", 0, 0, 0, "k", 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, "g", 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, "c", 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [4, 0, "l", 0, 0, 0, "l", 9], [8, 0, 0, 0, 0, 0, 0, 9], [1, 1, 4, 3, 2, 1, 1, 1]];
lvl14_array = [[7, 6, 6, 6, 6, 6, 6, 5], [8, 0, 0, 0, "g", 0, 0, 9], [8, 0, "k", 0, 0, "k", 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, "c", "c", "c", "c", "c", "c", 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [4, 0, "l", 0, 0, "l", 0, 9], [8, "r", 0, "t", 0, 0, "r", 9], [1, 1, 4, 3, 2, 1, 1, 1]];
lvl15_array = [[7, 6, 6, 6, 6, 6, 6, 1, 1, 1, 5], [8, "t", 0, 0, 0, 0, 0, 0, 0, "t", 9], [8, 0, "k", 0, "k", 0, "k", 0, "k", 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, "c", 0, "r", 0, "c", 0, "r", 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [4, 0, "l", 0, "l", 0, "l", 0, "l", 0, 9], [8, "g", 0, 0, 0, 0, 0, "t", 0, "g", 9], [1, 1, 4, 3, 2, 1, 1, 1, 1, 1, 1]];
lvl16_array = [[7, 6, 6, 6, 6, 6, 6, 1, 1, 1, 5], [8, "x", 0, 0, "k", 0, 0, 0, 0, "k", 9], [8, 0, "k", 0, 0, 0, "k", 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, "c", 0, 0, 0, "c", 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [4, 0, "l", 0, "l", 0, "l", 0, 0, "l", 9], [8, "x", 0, 0, 0, 0, 0, 0, 0, 0, 9], [1, 1, 4, 3, 2, 1, 1, 1, 1, 1, 1]];
lvl17_array = [[7, 6, 6, 6, 6, 6, 6, 5], [8, 0, "k", 0, 0, 0, "x", 9], [8, 0, 0, 0, "k", 0, 0, 9], [8, 0, "c", 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 9], [4, 0, "l", 0, 0, 0, 0, 9], [8, 1, 1, 0, "c", 1, 1, 9], [8, "k", 0, "g", 0, 0, "k", 9], [8, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, "c", 9], [8, "l", 0, 0, 0, 0, 0, 9], [8, "x", 0, 0, "l", 0, "l", 9], [1, 1, 4, 3, 2, 1, 1, 1]];
lvl18_array = [[7, 6, 6, 6, 6, 6, 6, 1, 1, 5], [8, 0, 0, 0, 0, 0, 0, "x", 0, 9], [8, 0, "k", 0, 0, "k", 0, 0, "k", 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, "t", 0, "b", 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, "c", 0, 0, "c", 0, 0, "c", 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, "r", 0, 9], [4, 0, "l", 0, 0, "l", 0, 0, "l", 9], [8, 0, 0, "x", 0, 0, 0, 0, 0, 9], [1, 1, 4, 3, 2, 1, 1, 1, 1, 1]];
lvl19_array = [[7, 6, 6, 6, 5, 1, 6, 6, 5], [8, 0, 0, 0, "x", 0, 0, "k", 9], [8, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, "k", 9], [8, 0, 0, 0, 0, 0, 0, "c", 9], [8, "k", 0, "c", 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, "l", 9], [8, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 9], [4, 0, 0, 0, 0, 0, 0, "c", 2], [8, "l", 0, 0, 0, "x", 0, "l", 9], [1, 1, 4, 3, 3, 3, 2, 1, 1]];
lvl20_array = [[7, 6, 6, 6, 5, 1, 7, 6, 6, 6, 5], [8, "k", 0, 0, 0, "k", 0, 0, 0, 0, 9], [8, 0, 0, "k", 0, 0, 0, "k", "x", 0, 9], [8, 0, 0, 0, 0, "c", 0, 0, 0, 0, 9], [8, "c", 0, "c", 0, "c", 0, 0, 0, "k", 9], [8, 0, 0, "k", 0, "x", 0, "c", 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, "c", 9], [8, 0, 0, "l", 0, 0, 0, 0, 0, 0, 9], [4, 0, 0, "c", 0, 0, 0, "c", 0, "g", 2], [8, "l", 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, "x", 0, "l", 0, "l", 0, "l", 0, "l", 9], [1, 1, 4, 3, 3, 3, 3, 3, 2, 1, 1]];
if (currentLevel != undefined) {
level_txt.text = "LEVEL " + currentLevel;
score_txt.text = gameScore;
map_array = this[("lvl" + currentLevel) + "_array"];
switch (currentLevel) {
case 1 :
guidePage = "basic";
specialKind_array = [];
freezeRate = 0;
infectRate = 0;
specialRate = 0;
minInfected = 0;
kindRange = 3;
totalSec = 100;
breakQuantity = 0;
shuffleQuantity = 0;
bombQuantity = 0;
requiredTiles = 300;
_parent.changeBg(1, 2);
break;
case 2 :
guidePage = "aurora";
specialKind_array = ["r"];
freezeRate = 0;
infectRate = 0;
specialRate = 0.05;
minInfected = 0;
kindRange = 3;
totalSec = 100;
breakQuantity = 0;
shuffleQuantity = 0;
bombQuantity = 0;
requiredTiles = 400;
_parent.changeBg(2, 2);
break;
case 3 :
guidePage = "iCyclone";
specialKind_array = ["r"];
freezeRate = 0;
infectRate = 0;
specialRate = 0.048;
minInfected = 0;
kindRange = 3;
totalSec = 110;
breakQuantity = 0;
shuffleQuantity = 1;
bombQuantity = 0;
requiredTiles = 420;
_parent.changeBg(1, 2);
break;
case 4 :
guidePage = "chain";
specialKind_array = ["r"];
freezeRate = 0;
infectRate = 0;
specialRate = 0.049;
minInfected = 0;
kindRange = 3;
totalSec = 120;
breakQuantity = 0;
shuffleQuantity = 1;
bombQuantity = 0;
requiredTiles = 450;
_parent.changeBg(2, 2);
break;
case 5 :
guidePage = "iBreak";
specialKind_array = ["r"];
freezeRate = 0;
infectRate = 0;
specialRate = 0.059;
minInfected = 0;
kindRange = 4;
totalSec = 130;
breakQuantity = 1;
shuffleQuantity = 1;
bombQuantity = 0;
requiredTiles = 480;
_parent.changeBg(1, 2);
break;
case 6 :
guidePage = "bomb";
specialKind_array = ["b", "r"];
freezeRate = 0;
infectRate = 0;
specialRate = 0.069;
minInfected = 0;
kindRange = 3;
totalSec = 150;
breakQuantity = 1;
shuffleQuantity = 1;
bombQuantity = 0;
requiredTiles = 500;
_parent.changeBg(2, 1);
break;
case 7 :
guidePage = "time";
specialKind_array = ["b", "t", "t", "t", "t", "r", "r"];
freezeRate = 0;
infectRate = 0;
specialRate = 0.12;
minInfected = 0;
kindRange = 4;
totalSec = 120;
breakQuantity = 1;
shuffleQuantity = 1;
bombQuantity = 1;
requiredTiles = 520;
_parent.changeBg(1, 1);
break;
case 8 :
guidePage = "treasure";
specialKind_array = ["b", "t", "r"];
freezeRate = 0;
infectRate = 0;
specialRate = 0.07;
minInfected = 0;
kindRange = 4;
totalSec = 120;
breakQuantity = 1;
shuffleQuantity = 1;
bombQuantity = 1;
requiredTiles = 600;
_parent.changeBg(2, 1);
break;
case 9 :
specialKind_array = ["b", "t", "r"];
freezeRate = 0;
infectRate = 0;
specialRate = 0.06;
minInfected = 0;
kindRange = 4;
totalSec = 120;
breakQuantity = 1;
shuffleQuantity = 1;
bombQuantity = 1;
requiredTiles = 620;
_parent.changeBg(1, 1);
break;
case 10 :
specialKind_array = ["b", "t", "r"];
freezeRate = 0;
infectRate = 0;
specialRate = 0.065;
minInfected = 0;
kindRange = 4;
totalSec = 120;
breakQuantity = 1;
shuffleQuantity = 1;
bombQuantity = 1;
requiredTiles = 650;
_parent.changeBg(1, 1);
break;
case 11 :
specialKind_array = ["b", "t", "r"];
freezeRate = 0;
infectRate = 0;
specialRate = 0.058;
minInfected = 0;
kindRange = 4;
totalSec = 120;
breakQuantity = 1;
shuffleQuantity = 1;
bombQuantity = 1;
requiredTiles = 700;
_parent.changeBg(2, 3);
break;
case 12 :
guidePage = "freeze";
specialKind_array = ["b", "t", "r", "g"];
freezeRate = 0.1;
infectRate = 0;
specialRate = 0.05;
minInfected = 0;
kindRange = 4;
totalSec = 120;
breakQuantity = 1;
shuffleQuantity = 1;
bombQuantity = 1;
requiredTiles = 720;
_parent.changeBg(1, 3);
break;
case 13 :
specialKind_array = ["b", "t", "r"];
freezeRate = 0.1;
infectRate = 0;
specialRate = 0.07;
minInfected = 0;
kindRange = 4;
totalSec = 120;
breakQuantity = 1;
shuffleQuantity = 1;
bombQuantity = 1;
requiredTiles = 740;
_parent.changeBg(1, 3);
break;
case 14 :
specialKind_array = ["b", "t", "r"];
freezeRate = 0.1;
infectRate = 0;
specialRate = 0.062;
minInfected = 0;
kindRange = 4;
totalSec = 150;
breakQuantity = 1;
shuffleQuantity = 1;
bombQuantity = 1;
requiredTiles = 1000;
_parent.changeBg(2, 3);
break;
case 15 :
specialKind_array = ["b", "t", "r", "g"];
freezeRate = 0.11;
infectRate = 0;
specialRate = 0.069;
minInfected = 0;
kindRange = 5;
totalSec = 160;
breakQuantity = 1;
shuffleQuantity = 1;
bombQuantity = 1;
requiredTiles = 1300;
_parent.changeBg(1, 3);
break;
case 16 :
guidePage = "infected";
specialKind_array = ["b", "t", "r", "x", "x", "x"];
freezeRate = 0.05;
infectRate = 0.08;
specialRate = 0.069;
minInfected = 3;
kindRange = 5;
totalSec = 170;
breakQuantity = 1;
shuffleQuantity = 1;
bombQuantity = 1;
requiredTiles = 1500;
_parent.changeBg(2, 4);
break;
case 17 :
specialKind_array = ["b", "t", "r", "x", "x", "x"];
freezeRate = 0;
infectRate = 0.12;
specialRate = 0.069;
minInfected = 5;
kindRange = 5;
totalSec = 180;
breakQuantity = 1;
shuffleQuantity = 1;
bombQuantity = 1;
requiredTiles = 1500;
_parent.changeBg(2, 4);
break;
case 18 :
specialKind_array = ["b", "t", "r", "x", "x", "x"];
freezeRate = 0.12;
infectRate = 0.1;
specialRate = 0.066;
minInfected = 5;
kindRange = 5;
totalSec = 200;
breakQuantity = 1;
shuffleQuantity = 1;
bombQuantity = 1;
requiredTiles = 1500;
_parent.changeBg(2, 4);
break;
case 19 :
specialKind_array = ["b", "t", "r", "x", "x"];
freezeRate = 0.15;
infectRate = 0.1;
specialRate = 0.062;
minInfected = 6;
kindRange = 5;
totalSec = 220;
breakQuantity = 1;
shuffleQuantity = 1;
bombQuantity = 1;
requiredTiles = 1700;
_parent.changeBg(2, 4);
break;
case 20 :
specialKind_array = ["b", "t", "r", "x", "x", "x"];
freezeRate = 0.2;
infectRate = 0.13;
specialRate = 0.05;
minInfected = 8;
kindRange = 5;
totalSec = 250;
breakQuantity = 1;
shuffleQuantity = 1;
bombQuantity = 1;
requiredTiles = 2100;
_parent.changeBg(2, 4);
}
}
if (guidePage != undefined) {
_parent.openGuide(guidePage);
} else {
gameInit();
}
Symbol 703 MovieClip [inventoryPage] Frame 1
var item_array = _parent.getItems();
var MAX_ITEMS = 6;
slot1_mc._content = item_array[0];
slot2_mc._content = item_array[1];
slot3_mc._content = item_array[2];
var i = 1;
while (i <= MAX_ITEMS) {
this[("item" + i) + "_mc"]._itemNo = i;
this[("item" + i) + "_mc"]._origX = this[("item" + i) + "_mc"]._x;
this[("item" + i) + "_mc"]._origY = this[("item" + i) + "_mc"]._y;
this[("item" + i) + "_mc"].onPress = function () {
if (this._isEquipped) {
this._isEquipped = false;
this._pocket.isUsed = false;
this._pocket._content = 0;
this._pocket = null;
this._x = this._origX;
this._y = this._origY;
return(undefined);
}
startDrag (this, false, 0, 0, 500, 550);
this.swapDepths(top_mc);
};
this[("item" + i) + "_mc"].onRelease = function () {
this.stopDrag();
var _local2;
if (this.hitTest(slot1_mc) && (!slot1_mc.isUsed)) {
slot1_mc.isUsed = true;
slot1_mc._content = this._itemNo;
_local2 = slot1_mc;
} else if (this.hitTest(slot2_mc) && (!slot2_mc.isUsed)) {
slot2_mc.isUsed = true;
slot2_mc._content = this._itemNo;
_local2 = slot2_mc;
} else if (this.hitTest(slot3_mc) && (!slot3_mc.isUsed)) {
slot3_mc.isUsed = true;
slot3_mc._content = this._itemNo;
_local2 = slot3_mc;
} else {
this._y = this._origY;
this._x = this._origX;
this._isEquipped = false;
this._pocket.isUsed = false;
this._pocket._content = 0;
this._pocket = null;
this.swapDepths(top_mc);
return(undefined);
}
this._y = _local2._y;
this._x = _local2._x;
this._pocket = _local2;
this._isEquipped = true;
this.swapDepths(top_mc);
};
var j = 0;
while (j < item_array.length) {
if (this[("item" + i) + "_mc"]._itemNo == item_array[j]) {
this[("item" + i) + "_mc"]._pocket = this[("slot" + (j + 1)) + "_mc"];
this[("item" + i) + "_mc"]._isEquipped = true;
this[("item" + i) + "_mc"]._pocket.isUsed = true;
this._pocket._content = this[("item" + i) + "_mc"]._itemNo;
this[("item" + i) + "_mc"]._x = this[("slot" + (j + 1)) + "_mc"]._x;
this[("item" + i) + "_mc"]._y = this[("slot" + (j + 1)) + "_mc"]._y;
}
j++;
}
this[("item" + i) + "_mc"]._visible = false;
i++;
}
okay_btn.onRelease = function () {
_parent.equipItem([slot1_mc._content, slot2_mc._content, slot3_mc._content]);
_parent.openDialogue("mapPage");
};
switch (_parent.runningLevel) {
case 20 :
case 19 :
case 18 :
case 17 :
item5_mc._visible = true;
case 16 :
case 15 :
case 14 :
case 13 :
case 12 :
item4_mc._visible = true;
case 11 :
case 10 :
case 9 :
case 8 :
item3_mc._visible = true;
case 7 :
case 6 :
item2_mc._visible = true;
case 5 :
case 4 :
item1_mc._visible = true;
case 3 :
item6_mc._visible = true;
case 2 :
case 1 :
}
Symbol 704 MovieClip [dirMc] Frame 1
stop();