Frame 2
function checkAdSelectionFromServer() {
serverCheckStarted = true;
frameToGo = "mochiad1";
var _local3 = "http://www-ad.digitalchocolate.com/?aid=6&iid=0";
var httpWrapper = new LoadVars();
httpWrapper.onLoad = function (_arg3) {
serverCheckCompleted = true;
if (_arg3) {
var _local1 = new LoadVars();
_local1.decode(httpWrapper.toString());
var _local2 = 0;
if (_local1.ad0 == _local2) {
trace("AFG __________");
frameToGo = "googleAd";
} else {
trace("MOCHI __________");
frameToGo = "mochiad1";
}
} else {
trace("check the URL for typos !!");
}
};
httpWrapper.load(_local3);
}
stop();
var USE_SERVER_AD_CHECK = true;
var frameToGo;
var serverCheckCompleted;
var serverCheckStarted;
if (USE_SERVER_AD_CHECK && (!serverCheckStarted)) {
checkAdSelectionFromServer();
}
this.onEnterFrame = function () {
loaded_bytes = _root.getBytesLoaded();
total_bytes = _root.getBytesTotal();
loadpercent = (loaded_bytes / total_bytes) * 100;
if ((loadpercent < 100) || (USE_SERVER_AD_CHECK && (!serverCheckCompleted))) {
mc_loading.gotoAndStop(int(loadpercent));
mc_loading.load_txt.text = int(loadpercent) + " %";
gotoAndPlay (1);
} else {
delete this.onEnterFrame;
mc_loading._visible = false;
gotoAndPlay(frameToGo);
}
};
Frame 4
function go(_arg4) {
System.security.allowDomain("http://pagead2.googlesyndication.com/pagead");
trace("Loading Google ads swf...");
var _local2 = new Object();
_local2.onLoadStart = function () {
trace("onLoadStart");
};
_local2.onLoadComplete = function () {
trace("onLoadComplete");
};
_local2.onLoadInit = onLoadInit;
_local2.onLoadError = function () {
_root.gotoAndPlay("mochiad1");
trace("onLoadError");
};
var _local3 = new MovieClipLoader();
_local3.addListener(_local2);
_local3.loadClip("http://pagead2.googlesyndication.com/pagead/googlevideoadslibrary.swf", _arg4);
}
function onLoadInit(_arg2) {
var _local1 = new Object();
_local1.publisherId = PUBLISHER_ID;
_local1.productType = PRODUCT_TYPE;
_local1.contentId = CONTENT_ID;
_local1.channels = ["VideoAd", "ChocolateShop", "Action_Preroll", "Fun_Preroll"];
_local1.adType = "video";
trace("Making video ad request call.");
_arg2.requestAds(_local1, onVideoAdRequestResult);
}
function onVideoAdRequestResult(_arg2) {
trace("Video ad request successful? " + _arg2.success);
if (_arg2.success) {
var player = _arg2.ads[0].getAdPlayerMovieClip();
player.setSize(800, 600);
player.load();
player.playAds();
player.onError = function () {
trace("Error occurred!");
};
player.onStateChange = function (_arg2, _arg1) {
trace(((("State change from " + _arg2) + " to ") + _arg1) + ".");
if (_arg1 == "completed") {
trace("Video ad played to completion.");
gotoAndPlay ("End");
player.destroy();
}
};
} else {
trace("Video ad request failure: " + _arg2.errorMsg);
var _local1 = new Object();
_local1.publisherId = PUBLISHER_ID;
_local1.productType = PRODUCT_TYPE;
_local1.contentId = CONTENT_ID;
_local1.channels = ["FullscreenAd", "ChocolateShop", "Action_Preroll", "Fun_Preroll"];
_local1.adType = "fullscreen";
_local1.adTimePosition = "0";
_local1.pubWidth = "800";
_local1.pubHeight = "600";
_local1.videoDescriptionUrl = "http://www.digitalchocolate.com/games/pc/chocolate-shop-frenzy.html";
_local1.numAds = "3";
trace("Making fullscreen ad request call.");
adsLibrary.requestAds(_local1, onFullscreenAdRequestResult);
}
}
function onFullscreenAdRequestResult(_arg2) {
trace("Fullscreen ad request successful? " + _arg2.success);
if (_arg2.success) {
var player = _arg2.ads[0].getAdPlayerMovieClip();
player.setSize(800, 600);
player.load();
player.playAds(10);
player.onError = function () {
trace("Error occurred!");
};
player.onStateChange = function (_arg3, _arg2) {
trace(((("State change from " + _arg3) + " to ") + _arg2) + ".");
if (_arg2 == "completed") {
trace("Fullscreen ad played to completion.");
_root.gotoAndPlay("end");
player.destroy();
}
};
} else {
trace("Fullscreen ad request failure: " + _arg2.errorMsg);
_root.gotoAndPlay("mochiad1");
}
}
var adsLibrary = this.createEmptyMovieClip("adsLibrary", this.getNextHighestDepth());
var PUBLISHER_ID = "ca-games-pub-4900311177793300";
var PRODUCT_TYPE = 4;
var CONTENT_ID = "dchocchocoshop";
go(adsLibrary);
Frame 5
stop();
Frame 7
_root.sAdID = "eeaa76021c64ed8f";
MochiAd.showPreGameAd({id:"eeaa76021c64ed8f", res:"800x600"});
stop();
Frame 9
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("1f038b64", this, 10301, true);
Frame 10
function itemHandler(obj, item) {
getURL ("http://www.digitalchocolate.com", "_blank");
trace("get dchoc.com");
}
stop();
var URLAndVersionObj = new URLAndVersion();
var urlname = URLAndVersionObj.URL_Name;
var versionno = URLAndVersionObj.Version_No;
var premiumurl = URLAndVersionObj.Premium_URL;
_global.soundstat = "onn";
_focusrect = false;
root_cm = new ContextMenu();
root_cm.hideBuiltInItems();
root_cm.customItems.push(new ContextMenuItem("Visit Digital Chocolate", itemHandler));
_root.menu = root_cm;
fscommand ("allowscale", false);
this.main_mc.tabChildren = false;
var menuSound = new Sound();
menuSound.attachSound("mainmenu.mp3", true);
menuSound.onSoundComplete = function () {
if (_global.soundstat == "onn") {
menuSound.start();
}
};
var gameSound = new Sound();
gameSound.attachSound("gamebgsnd.mp3", true);
gameSound.onSoundComplete = function () {
if (_global.soundstat == "onn") {
gameSound.start();
}
};
var calenderSound = new Sound();
calenderSound.attachSound("calendersnd.mp3", true);
calenderSound.onSoundComplete = function () {
if (_global.soundstat == "onn") {
calenderSound.start();
}
};
var choco_done_Sound = new Sound();
choco_done_Sound.attachSound("choco_done.mp3", true);
var expert_score_Sound = new Sound();
expert_score_Sound.attachSound("expert_score.mp3", true);
var target_score_Sound = new Sound();
target_score_Sound.attachSound("target_score.mp3", true);
var hotchoco_done_Sound = new Sound();
hotchoco_done_Sound.attachSound("hotchoco_done.mp3", true);
var combo1_Sound = new Sound();
combo1_Sound.attachSound("combo1.mp3", true);
var combo2_Sound = new Sound();
combo2_Sound.attachSound("combo2.mp3", true);
var combo3_Sound = new Sound();
combo3_Sound.attachSound("combo3.mp3", true);
var phonering_Sound = new Sound(main);
phonering_Sound.attachSound("phonering.mp3", true);
phonering_Sound.onSoundComplete = function () {
if (_global.soundstat == "onn") {
phonering_Sound.start();
}
};
var customer_happy_Sound = new Sound();
customer_happy_Sound.attachSound("customer_happy.mp3", true);
var level_complete_Sound = new Sound();
level_complete_Sound.attachSound("level_complete.mp3", true);
var level_failed_Sound = new Sound();
level_failed_Sound.attachSound("level_failed.mp3", true);
var money1_Sound = new Sound();
money1_Sound.attachSound("money1.mp3", true);
var money2_Sound = new Sound();
money2_Sound.attachSound("money2.mp3", true);
var money3_Sound = new Sound();
money3_Sound.attachSound("money3.mp3", true);
var choco_producing_Sound = new Sound();
choco_producing_Sound.attachSound("choco_producing.mp3", true);
Symbol 5 MovieClip Frame 10
_parent.gotoAndStop(2);
Symbol 55 MovieClip Frame 32
_parent.gotoAndStop(2);
Symbol 71 MovieClip Frame 15
stop();
this._visible = false;
this.removeMovieClip();
Symbol 76 MovieClip Frame 20
stop();
this._visible = false;
this.removeMovieClip();
Symbol 77 MovieClip [oldlady] Frame 1
stop();
Symbol 77 MovieClip [oldlady] Frame 2
stop();
Symbol 77 MovieClip [oldlady] Frame 3
stop();
Symbol 77 MovieClip [oldlady] Frame 4
stop();
Symbol 77 MovieClip [oldlady] Frame 5
stop();
Symbol 77 MovieClip [oldlady] Frame 6
stop();
Symbol 83 MovieClip Frame 7
_parent.gotoAndStop(2);
Symbol 135 MovieClip Frame 48
_parent.gotoAndStop(2);
Symbol 147 MovieClip Frame 12
stop();
this._visible = false;
this.removeMovieClip();
Symbol 151 MovieClip Frame 20
stop();
this._visible = false;
this.removeMovieClip();
Symbol 152 MovieClip [younglady] Frame 1
stop();
Symbol 152 MovieClip [younglady] Frame 2
stop();
Symbol 152 MovieClip [younglady] Frame 3
stop();
Symbol 152 MovieClip [younglady] Frame 4
stop();
Symbol 152 MovieClip [younglady] Frame 5
stop();
Symbol 152 MovieClip [younglady] Frame 6
stop();
Symbol 157 MovieClip Frame 1
stop();
Symbol 157 MovieClip Frame 2
stop();
Symbol 169 MovieClip Frame 1
stop();
Symbol 169 MovieClip Frame 120
stop();
Symbol 178 MovieClip Frame 1
stop();
Symbol 201 MovieClip Frame 25
stop();
Symbol 204 MovieClip Frame 25
stop();
Symbol 207 MovieClip Frame 25
stop();
Symbol 213 MovieClip Frame 1
stop();
Symbol 213 MovieClip Frame 2
stop();
Symbol 219 MovieClip Frame 1
stop();
Symbol 219 MovieClip Frame 2
stop();
Symbol 220 MovieClip Frame 1
stop();
Symbol 220 MovieClip Frame 2
stop();
Symbol 220 MovieClip Frame 3
stop();
Symbol 220 MovieClip Frame 4
stop();
Symbol 220 MovieClip Frame 5
stop();
Symbol 221 MovieClip Frame 74
stop();
chocobox.gotoAndStop(_parent.neededchocolate);
if (_global.levelSelected != 1) {
if ((_parent.neededchocolate == _parent._parent.preferred_chocolate1) || (_parent.neededchocolate == _parent._parent.preferred_chocolate2)) {
_parent.green_highlight._visible = true;
}
}
Symbol 227 MovieClip Frame 1
stop();
Symbol 227 MovieClip Frame 2
stop();
Symbol 233 MovieClip Frame 1
stop();
Symbol 233 MovieClip Frame 2
stop();
Symbol 238 MovieClip Frame 1
stop();
Symbol 238 MovieClip Frame 2
stop();
Symbol 246 MovieClip Frame 1
stop();
Symbol 246 MovieClip Frame 2
stop();
Symbol 249 MovieClip Frame 1
stop();
Symbol 249 MovieClip Frame 2
stop();
Symbol 253 MovieClip Frame 1
stop();
Symbol 253 MovieClip Frame 2
stop();
Symbol 254 MovieClip Frame 1
stop();
Symbol 254 MovieClip Frame 2
stop();
Symbol 254 MovieClip Frame 3
stop();
Symbol 257 MovieClip Frame 35
stop();
Symbol 258 MovieClip Frame 53
stop();
Symbol 259 MovieClip [orderbook] Frame 1
stop();
Instance of Symbol 175 MovieClip "pointer" in Symbol 259 MovieClip [orderbook] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 259 MovieClip [orderbook] Frame 2
stop();
Symbol 259 MovieClip [orderbook] Frame 3
stop();
Symbol 1693 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.7");
}
static function showPreGameAd(options) {
var _local26 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}, ad_progress:function (percent) {
}};
options = _parseOptions(options, _local26);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local22 = 11000;
var _local25 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local6 = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
_local6._visible = false;
delete options.no_progress_bar;
} else {
_local6._x = 10;
_local6._y = _local13 - 20;
}
var _local21 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local23 = options.outline;
delete options.outline;
var _local5 = _local6.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local6.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local21);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local7 = _local6.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local23, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local4 - 20, 0);
_local7.lineTo(_local4 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local22;
chk.ad_timeout = _local25;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.regContLC = function (_arg1) {
mc._containerLCName = _arg1;
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (_arg3) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = _arg3;
};
mc.lc.rpc = function (_arg2, _arg1) {
MochiAd.rpc(clip, _arg2, _arg1);
};
mc.rpcTestFn = function (_arg1) {
trace("[MOCHIAD rpcTestFn] " + _arg1);
return(_arg1);
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local11 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local2 = (100 * _local8) / _local4;
var _local10 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local13 = Math.min(100, Math.min(_local2 || 0, _local10));
_local13 = Math.max(this.last_pcnt, _local13);
this.last_pcnt = _local13;
_local9._xscale = _local13;
options.ad_progress(_local13);
if (sendHostProgress) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local2});
if (_local2 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var _local7 = _local11.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((_local5 > chk.ad_timeout) && (_local2 == 100)) {
options.ad_failed();
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showClickAwayAd(options) {
var _local9 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function () {
}, ad_finished:function () {
}, ad_loaded:function (width, height) {
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local9);
var clip = options.clip;
var _local8 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local4 = _getRes(options);
var _local10 = _local4[0];
var _local7 = _local4[1];
mc._x = _local10 * 0.5;
mc._y = _local7 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local8;
chk.started = getTimer();
chk.showing = false;
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.rpc = function (_arg2, _arg1) {
MochiAd.rpc(clip, _arg2, _arg1);
};
mc.rpcTestFn = function (_arg1) {
trace("[MOCHIAD rpcTestFn] " + _arg1);
return(_arg1);
};
var _local20 = false;
mc.lc.regContLC = function (_arg1) {
mc._containerLCName = _arg1;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
_local2 = true;
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local2) {
delete this.onEnterFrame;
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (_arg3) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = _arg3 - 250;
};
mc.lc.rpc = function (_arg2, _arg1) {
MochiAd.rpc(clip, _arg2, _arg1);
};
mc.rpcTestFn = function (_arg1) {
trace("[MOCHIAD rpcTestFn] " + _arg1);
return(_arg1);
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showPreloaderAd(_arg1) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(_arg1);
}
static function showTimedAd(_arg1) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
showInterLevelAd(_arg1);
}
static function _allowDomains(_arg2) {
var _local1 = _arg2.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function load(_arg3) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
_arg3 = _parseOptions(_arg3, _local13);
_arg3.swfv = _arg3.clip.getSWFVersion() || 6;
_arg3.mav = getVersion();
var _local9 = _arg3.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = _arg3.depth;
delete _arg3.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(_arg3);
_arg3.res = (_local11[0] + "x") + _local11[1];
_arg3.server = _arg3.server + _arg3.id;
delete _arg3.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in _arg3) {
_local4[_local7] = _arg3[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(_arg2) {
if (typeof(_arg2) == "undefined") {
_arg2 = _root;
}
if (_arg2.clip && (_arg2.clip._mochiad)) {
_arg2 = _arg2.clip;
}
if (!_arg2._mochiad) {
return(false);
}
if (_arg2._mochiad._containerLCName != undefined) {
_arg2._mochiad.lc.send(_arg2._mochiad._containerLCName, "notify", {id:"unload"});
}
_arg2._mochiad.removeMovieClip();
delete _arg2._mochiad_loaded;
delete _arg2._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(_arg5) {
var _local3 = _arg5.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(_arg5.res) != "undefined") {
var _local4 = _arg5.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(_arg6, _arg7) {
var _local4 = {};
for (var _local8 in _arg7) {
_local4[_local8] = _arg7[_local8];
}
if (_arg6) {
for (var _local8 in _arg6) {
_local4[_local8] = _arg6[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
static function rpc(_arg1, _arg5, _arg2) {
switch (_arg2.id) {
case "setValue" :
setValue(_arg1, _arg2.objectName, _arg2.value);
break;
case "getValue" :
var _local4 = getValue(_arg1, _arg2.objectName);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg5, _local4);
break;
case "runMethod" :
var _local3 = runMethod(_arg1, _arg2.method, _arg2.args);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg5, _local3);
break;
default :
trace("[mochiads rpc] unknown rpc id: " + _arg2.id);
}
}
static function setValue(_arg3, _arg5, _arg4) {
var _local2 = _arg5.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((_arg3[_local2[_local1]] == undefined) || (_arg3[_local2[_local1]] == null)) {
return(undefined);
}
_arg3 = _arg3[_local2[_local1]];
_local1++;
}
_arg3[_local2[_local1]] = _arg4;
}
static function getValue(_arg3, _arg4) {
var _local2 = _arg4.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((_arg3[_local2[_local1]] == undefined) || (_arg3[_local2[_local1]] == null)) {
return(undefined);
}
_arg3 = _arg3[_local2[_local1]];
_local1++;
}
return(_arg3[_local2[_local1]]);
}
static function runMethod(_arg3, _arg5, _arg4) {
var _local2 = _arg5.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((_arg3[_local2[_local1]] == undefined) || (_arg3[_local2[_local1]] == null)) {
return(undefined);
}
_arg3 = _arg3[_local2[_local1]];
_local1++;
}
if (typeof(_arg3[_local2[_local1]]) == "function") {
return(_arg3[_local2[_local1]].apply(_arg3, _arg4));
}
return(undefined);
}
}
Symbol 1694 MovieClip [__Packages.URLAndVersion] Frame 0
class URLAndVersion
{
var URL_Name, Premium_URL, Version_No;
function URLAndVersion () {
URL_Name = "http://www.digitalchocolate.com";
Premium_URL = "http://www-redir.digitalchocolate.com/?aid=58&iid=0&type=upsale";
Version_No = "\u00A9 2008-2009 Digital Chocolate Inc. Version 1.0.2";
}
}
Symbol 1695 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 1696 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(_arg1, _arg2) {
if (_arg1.broadcastMessage != undefined) {
delete _arg1.broadcastMessage;
}
_arg1.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
_arg1.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!_arg2) {
_arg1._listeners = new Array();
}
}
function addListener(_arg2) {
removeListener(_arg2);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(_arg2));
}
function removeListener(_arg4) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == _arg4) {
_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 1697 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 (_arg8, _arg5, _arg4, _arg3, _arg6, _arg7, _arg9) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
obj = _arg8;
prop = _arg5;
begin = _arg3;
position = (_arg3);
duration = (_arg7);
useSeconds = _arg9;
if (_arg4) {
func = _arg4;
}
finish = (_arg6);
_listeners = [];
addListener(this);
start();
}
function set time(_arg2) {
prevTime = _time;
if (_arg2 > duration) {
if (looping) {
rewind(_arg2 - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (_arg2 < 0) {
rewind();
update();
} else {
_time = _arg2;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(_arg3) {
_duration = (((_arg3 == null) || (_arg3 <= 0)) ? (_global.Infinity) : (_arg3));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(_arg3) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = _arg3;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(_arg2) {
setPosition(_arg2);
//return(position);
}
function setPosition(_arg2) {
prevPos = _pos;
obj[prop] = (_pos = _arg2);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(_arg2) {
if (_arg2 == undefined) {
_arg2 = _time;
}
return(func(_arg2, begin, change, _duration));
}
function set finish(_arg2) {
change = _arg2 - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(_arg3, _arg2) {
begin = position;
finish = (_arg3);
if (_arg2 != undefined) {
duration = (_arg2);
}
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(_arg2) {
_time = ((_arg2 == undefined) ? 0 : (_arg2));
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(_arg2, _arg4, _arg3, _arg1) {
return(((_arg3 * _arg2) / _arg1) + _arg4);
}
}
Symbol 1698 MovieClip [__Packages.mx.transitions.easing.Strong] Frame 0
class mx.transitions.easing.Strong
{
function Strong () {
}
static function easeIn(_arg1, _arg4, _arg3, _arg2) {
_arg1 = _arg1 / _arg2;
return((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg4);
}
static function easeOut(_arg1, _arg4, _arg3, _arg2) {
_arg1 = (_arg1 / _arg2) - 1;
return((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg4);
}
static function easeInOut(_arg1, _arg3, _arg2, _arg4) {
_arg1 = _arg1 / (_arg4 / 2);
if (_arg1 < 1) {
return(((((((_arg2 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg3);
}
_arg1 = _arg1 - 2;
return(((_arg2 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg3);
}
static var version = "1.1.0.52";
}
Symbol 1699 MovieClip [__Packages.Level2] Frame 0
class Level2 extends MovieClip
{
var salesGirl, btn_pause, _parent, choco_machines, scoreIndicateClip, shopclosedClip, timerClip, chocolate_container, specialcho_container, coffeeClip, chocolateClip, phone_mc, popup_mc, selectClip, special_choco_machines, dusbin, coffee_machine, heartinClip, shopopenClip, reportMc, cancel_mc, infoClip, comboClip, dusbinContainer, curScoreClip, expertScoreClip, table3, table2, table1, coin_Anim3, coin_Anim2, coin_Anim1, leve2Keyobj, keyTarget, pauseTarget, scoreClip, radian, targetDirection, preferred_chocolate1, preferred_chocolate2, customer1, attachMovie, orderbook1, getNextHighestDepth, customer2, orderbook2, customer3, orderbook3, selectedTable, moveTarget;
function Level2 () {
super();
}
function onLoad() {
var owner = this;
clearInterval(popup_interval);
clearInterval(process_interval);
Reset();
salesGirl.coffeeicon._visible = false;
btn_pause._visible = true;
_parent.pauseClip._visible = false;
salesGirl.gotoAndStop(currentDirection);
salesGirl.chocolateCount = 0;
choco_machines.status = "empty";
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
scoreIndicateClip._visible = false;
shopclosedClip._visible = false;
timerClip._visible = false;
chocolate_container._visible = false;
specialcho_container._visible = false;
coffeeClip._visible = false;
chocolateClip._visible = false;
phone_mc._visible = false;
popup_mc._visible = false;
selectClip._visible = false;
choco_machines._visible = false;
special_choco_machines._visible = false;
dusbin._visible = false;
coffee_machine._visible = false;
heartinClip._visible = false;
shopopenClip._visible = false;
reportMc._visible = false;
cancel_mc._visible = false;
infoClip._visible = false;
comboClip._visible = false;
dusbinContainer._visible = false;
curScoreClip._visible = false;
expertScoreClip._visible = false;
table2._visible = (table3._visible = false);
table1._visible = false;
coin_Anim2._visible = (coin_Anim3._visible = false);
coin_Anim1._visible = false;
table1.point = 1;
table2.point = 2;
table3.point = 3;
owner.combo_bookcnt = 0;
owner.combo_ordercnt = 0;
owner.combo_moneycnt = 0;
owner.customerCount = 0;
owner.moneyCount = 0;
owner.table2._visible = (owner.table3._visible = false);
owner.table1._visible = false;
owner.lobbyArr.length = 0;
owner.lobbyArr = new Array(1, 2, 3);
owner.popupDisable();
var randomno = owner.getRandom(0, 2);
owner.customerEnterInterval = setInterval(owner.CallCustomer, 2000, owner, owner.lobbyArr[randomno], "younglady");
owner.lobbyArr.splice(randomno, 1);
var randomno = owner.getRandom(0, owner.lobbyArr.length - 1);
owner.customerEnterInterval2 = setInterval(owner.CallCustomer2, 4000, owner, owner.lobbyArr[randomno], "younglady");
owner.lobbyArr.splice(randomno, 1);
owner.isPopup = false;
owner.popup_info = "level2_start";
owner.bg.gotoAndStop(2);
owner.shopopenClip._visible = true;
owner.shopopenClip.gotoAndPlay(1);
owner.ismoveready = true;
owner.machineStatus = "ready";
owner.dusbinStatus = "ready";
owner.choco_machines._visible = true;
owner.choco_machines.single_machine.gotoAndStop(2);
owner.dusbin._visible = true;
owner.dusbin.gotoAndStop(2);
owner.timerClip._visible = true;
clearInterval(owner.gameInterval);
owner.gametimer = 0;
owner.gameInterval = setInterval(owner.GameTimeLimit, 730, owner);
owner.Re_customerEnterInterval = setInterval(owner.CallNewCustomer, 6000, owner);
btn_pause.onRelease = function () {
if (this._visible && (owner._parent.pauseClip._visible == false)) {
owner.pauseTarget = "btn_continue";
owner.isPaused = true;
owner.isPopup = true;
this._visible = false;
owner._parent.pauseClip._visible = true;
owner._parent.pauseClip.gotoAndPlay(2);
owner.CallPause();
}
};
leve2Keyobj = new Object();
Key.addListener(leve2Keyobj);
leve2Keyobj.onKeyUp = function () {
if (Key.getCode() == 13) {
if ((!owner.isPaused) && (!owner.isGameOver)) {
owner.StoreInSequence();
}
}
};
leve2Keyobj.onKeyDown = function () {
if (Key.getCode() == 37) {
if (!owner.isPaused) {
owner.LeftNavigation();
}
} else if (Key.getCode() == 39) {
if (!owner.isPaused) {
owner.RightNavigation();
}
} else if (Key.getCode() == 38) {
if (!owner.isPaused) {
owner.UpNavigation();
} else {
owner.pauseUpNavigation();
}
} else if (Key.getCode() == 40) {
if (!owner.isPaused) {
owner.DownNavigation();
} else {
owner.pauseDownNavigation();
}
} else if (Key.getCode() == 13) {
if (owner.popup_mc._visible) {
owner.popup_mc.btn_ok.onRelease();
} else if (owner.reportMc._visible) {
if (owner.reportMc._currentframe == 1) {
owner.reportMc.mc.btn_continue.onRelease();
} else {
owner.reportMc.mc.btn_retry.onRelease();
}
} else if (!owner.isPaused) {
trace("enter press");
owner.EnterFunction();
} else {
owner.PauseEnterFunction();
}
} else if (Key.getAscii() == 27) {
if (!owner.isPaused) {
owner.btn_pause.onRelease();
} else if (owner.isPaused) {
owner._parent.pauseClip.btn_continue.onRelease();
}
}
};
table1.onRollOver = (table2.onRollOver = (table3.onRollOver = function () {
if ((!owner.isPaused) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = this._name;
owner.moveTarget = this._name;
if (eval ("this.orderbook" + this.point).money_mc._currentframe == 2) {
eval ("this.orderbook" + this.point).highlight_small.gotoAndStop(2);
} else if (eval ("this.orderbook" + this.point).money_mc._currentframe == 3) {
eval ("this.orderbook" + this.point).highlight_small_coin.gotoAndStop(2);
}
eval ("this.orderbook" + this.point).highlight.gotoAndStop(2);
}
}));
table1.onRollOut = (table2.onRollOut = (table3.onRollOut = function () {
eval ("this.orderbook" + this.point).highlight.gotoAndStop(1);
if (eval ("this.orderbook" + this.point).money_mc._currentframe == 2) {
eval ("this.orderbook" + this.point).highlight_small.gotoAndStop(1);
} else if (eval ("this.orderbook" + this.point).money_mc._currentframe == 3) {
eval ("this.orderbook" + this.point).highlight_small_coin.gotoAndStop(1);
}
}));
choco_machines.onRollOver = function () {
if (((owner.machineStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "choco_machines";
owner.moveTarget = "choco_machines";
this.single_machine.gotoAndStop(3);
}
};
choco_machines.onRollOut = (choco_machines.onReleaseOutside = function () {
this.single_machine.gotoAndStop(2);
});
dusbin.onRollOver = function () {
if ((owner.dusbinStatus == "ready") && (!owner.isPaused)) {
owner.ObjectsRollOut();
owner.keyTarget = "dusbin";
owner.moveTarget = "dusbin";
this.gotoAndStop(3);
}
};
dusbin.onRollOut = (dusbin.onReleaseOutside = function () {
this.gotoAndStop(2);
});
choco_machines.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.choco_machines);
}
};
choco_machines.onPress = function () {
if (((owner.isTargetReached && (owner.machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines";
owner.calculateAngle(owner.chomac_indicate);
this.pointer._visible = true;
}
};
dusbin.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.dusbin);
}
};
dusbin.onPress = function () {
if ((owner.isTargetReached && (owner.dusbinStatus == "ready")) && (!owner.isPaused)) {
owner.isTargetReached = false;
owner.selectedTarget = "dusbin";
owner.calculateAngle(owner.dusbin_indicate);
this.pointer._visible = true;
}
};
table1.onRelease = (table2.onRelease = (table3.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(this);
}
}));
table1.onPress = (table2.onPress = (table3.onPress = function () {
trace((("from table len=" + owner.sequenceArr.length) + ", ") + owner.sequenceArr);
if ((owner.isTargetReached && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = this._name;
owner.calculateAngle(this);
if (owner.selectedTarget == "table1") {
owner.selectedTable = 1;
} else if (owner.selectedTarget == "table2") {
owner.selectedTable = 2;
} else if (owner.selectedTarget == "table3") {
owner.selectedTable = 3;
}
eval ("owner.orderbook" + owner.selectedTable).pointer._visible = true;
}
}));
}
function LeftNavigation() {
if (chocolate_container._visible) {
if (keyTarget == "type_box") {
chocolate_container.mc.type_round.onRollOver();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_triangle.onRollOver();
}
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate2) {
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRollOut();
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRollOver();
}
} else if (keyTarget == "choco_machines") {
choco_machines.onRollOut();
if (table3._visible) {
table3.onRollOver();
} else if (table2._visible) {
table2.onRollOver();
} else if (table1._visible) {
table1.onRollOver();
}
} else if (keyTarget == "dusbin") {
dusbin.onRollOut();
choco_machines.onRollOver();
}
}
function RightNavigation() {
if (chocolate_container._visible) {
if (keyTarget == "type_triangle") {
chocolate_container.mc.type_round.onRollOver();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_box.onRollOver();
}
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate1) {
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRollOut();
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRollOver();
}
} else if (keyTarget == undefined) {
choco_machines.onRollOver();
} else if (keyTarget == "choco_machines") {
choco_machines.onRollOut();
dusbin.onRollOver();
} else if (((keyTarget == "table1") || (keyTarget == "table2")) || (keyTarget == "table3")) {
eval ("this." + keyTarget).onRollOut();
choco_machines.onRollOver();
}
}
function UpNavigation() {
if (keyTarget == "table1") {
if (table2._visible) {
table1.onRollOut();
table2.onRollOver();
} else if (table3._visible) {
table1.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "table2") {
if (table3._visible) {
table2.onRollOut();
table3.onRollOver();
}
}
}
function DownNavigation() {
if (keyTarget == "table3") {
if (table2._visible) {
table3.onRollOut();
table2.onRollOver();
} else if (table1._visible) {
table3.onRollOut();
table1.onRollOver();
}
} else if (keyTarget == "table2") {
if (table1._visible) {
table2.onRollOut();
table1.onRollOver();
}
}
}
function EnterFunction() {
if (chocolate_container._visible) {
if (keyTarget == "type_triangle") {
chocolate_container.mc.type_triangle.onRelease();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_round.onRelease();
} else if (keyTarget == "type_box") {
chocolate_container.mc.type_box.onRelease();
}
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate1) {
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRelease();
} else if (keyTarget == _global.preferred_chocolate2) {
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRelease();
}
} else {
eval ("this." + keyTarget).onPress();
}
}
function PauseEnterFunction() {
eval ("this._parent.pauseClip." + pauseTarget).onRelease();
}
function pauseUpNavigation() {
if (pauseTarget == "btn_premium") {
_parent.pauseClip.btn_premium.onRollOut();
_parent.pauseClip.btn_mainmenu.onRollOver();
} else if (pauseTarget == "btn_mainmenu") {
_parent.pauseClip.btn_mainmenu.onRollOut();
_parent.pauseClip.btn_restart.onRollOver();
} else if (pauseTarget == "btn_restart") {
_parent.pauseClip.btn_restart.onRollOut();
_parent.pauseClip.btn_continue.onRollOver();
}
}
function pauseDownNavigation() {
if (pauseTarget == "pause") {
_parent.pauseClip.btn_continue.onRollOver();
} else if (pauseTarget == "btn_continue") {
_parent.pauseClip.btn_continue.onRollOut();
_parent.pauseClip.btn_restart.onRollOver();
} else if (pauseTarget == "btn_restart") {
_parent.pauseClip.btn_restart.onRollOut();
_parent.pauseClip.btn_mainmenu.onRollOver();
} else if (pauseTarget == "btn_mainmenu") {
_parent.pauseClip.btn_mainmenu.onRollOut();
_parent.pauseClip.btn_premium.onRollOver();
}
}
function updateScore() {
scoreClip.score_txt.text = score;
scoreClip.loading.gotoAndStop(score);
if ((score >= 100) && (scoreClip.target._currentframe == 1)) {
scoreClip.target.gotoAndPlay(1);
scoreIndicateClip._visible = true;
scoreIndicateClip.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.target_score_Sound.start();
}
}
if ((score >= 220) && (scoreClip.expert._currentframe == 1)) {
scoreClip.expert.gotoAndPlay(1);
expertScoreClip._visible = true;
expertScoreClip.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.expert_score_Sound.start();
}
}
}
function onEnterFrame() {
var owner = this;
if ((!isPopup) && (!owner.isPaused)) {
shopperMovement();
}
if (machineshake == "onn") {
machinespeed = -machinespeed;
choco_machines._x = choco_machines._x + ((1 * machinespeed) / 1.5);
choco_machines._y = choco_machines._y + ((1 * machinespeed) / 1.5);
}
_parent.pauseClip.btn_continue.onRollOver = (_parent.pauseClip.btn_restart.onRollOver = (_parent.pauseClip.btn_mainmenu.onRollOver = (_parent.pauseClip.btn_premium.onRollOver = function () {
owner._parent.pauseClip.btn_continue.onRollOut();
owner._parent.pauseClip.btn_restart.onRollOut();
owner._parent.pauseClip.btn_mainmenu.onRollOut();
owner._parent.pauseClip.btn_premium.onRollOut();
owner.pauseTarget = this._name;
this.gotoAndStop(2);
})));
_parent.pauseClip.btn_continue.onRollOut = (_parent.pauseClip.btn_restart.onRollOut = (_parent.pauseClip.btn_mainmenu.onRollOut = (_parent.pauseClip.btn_premium.onRollOut = function () {
this.gotoAndStop(1);
})));
_parent.pauseClip.btn_continue.onRelease = function () {
owner.isPaused = false;
owner.isPopup = false;
owner.btn_pause._visible = true;
owner._parent.pauseClip._visible = false;
owner.CallResume();
};
_parent.pauseClip.btn_restart.onRelease = function () {
owner.Reset();
owner._parent.play();
};
_parent.pauseClip.btn_mainmenu.onRelease = function () {
owner.Reset();
owner._parent.gotoAndStop("mainmenu");
};
_parent.pauseClip.btn_premium.onRelease = function () {
this.getURL(_root.urlname, "_blank");
};
popup_mc.btn_ok.onRollOver = function () {
this.gotoAndStop(2);
};
popup_mc.btn_ok.onRollOut = (popup_mc.btn_ok.onReleaseOutside = function () {
this.gotoAndStop(1);
});
chocolate_container.mc.type_triangle.onRollOver = (chocolate_container.mc.type_round.onRollOver = (chocolate_container.mc.type_box.onRollOver = function () {
if (!owner.isPaused) {
owner.keyTarget = this._name;
owner.chocolate_container.mc.type_triangle.gotoAndStop(1);
owner.chocolate_container.mc.type_round.gotoAndStop(1);
owner.chocolate_container.mc.type_box.gotoAndStop(1);
this.gotoAndStop(2);
}
}));
chocolate_container.mc.type_triangle.onRelease = (chocolate_container.mc.type_round.onRelease = (chocolate_container.mc.type_box.onRelease = function () {
if (!owner.isPaused) {
owner.infoClip._visible = false;
owner.chocolateClip._visible = true;
owner.chocolateClip.gotoAndStop(this._name);
owner.chocolateClip.mc.gotoAndPlay(1);
owner.isTargetReached = true;
owner.preferred_chocolate = this._name;
if (owner.choco_machines.status == "empty") {
owner.choco_machines.status = "prepared";
}
owner.preparecnt = 0;
owner.process_interval = setInterval(owner.IdleProcess, 100, owner);
owner.chocolate_container.gotoAndStop(2);
owner.dusbinStatus = "ready";
owner.machineStatus = "ready";
owner.isPopup = false;
owner.machineshake = "onn";
owner.keyTarget = "choco_machines";
if (_global.soundstat == "onn") {
_root.choco_producing_Sound.start();
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
trace("call");
owner.CallSequence();
}
}
}));
chocolate_container.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.machineStatus = "ready";
owner.dusbinStatus = "ready";
owner.chocolate_container._visible = false;
owner.isPopup = false;
owner.keyTarget = "choco_machines";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
trace("call close");
owner.CallSequence();
}
}
};
dusbinContainer.mc.chocobox1.type_triangle.onRollOver = (dusbinContainer.mc.chocobox1.type_round.onRollOver = (dusbinContainer.mc.chocobox1.type_box.onRollOver = (dusbinContainer.mc.chocobox2.type_triangle.onRollOver = (dusbinContainer.mc.chocobox2.type_round.onRollOver = (dusbinContainer.mc.chocobox2.type_box.onRollOver = function () {
owner.keyTarget = this._name;
this.gotoAndStop(2);
})))));
dusbinContainer.mc.chocobox1.type_triangle.onRollOut = (dusbinContainer.mc.chocobox1.type_round.onRollOut = (dusbinContainer.mc.chocobox1.type_box.onRollOut = (dusbinContainer.mc.chocobox2.type_triangle.onRollOut = (dusbinContainer.mc.chocobox2.type_round.onRollOut = (dusbinContainer.mc.chocobox2.type_box.onRollOut = function () {
this.gotoAndStop(1);
})))));
dusbinContainer.mc.chocobox1.type_triangle.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_round.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_box.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_triangle.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_round.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_box.onReleaseOutside = function () {
this.gotoAndStop(1);
})))));
dusbinContainer.mc.chocobox1.type_triangle.onRelease = (dusbinContainer.mc.chocobox1.type_round.onRelease = (dusbinContainer.mc.chocobox1.type_box.onRelease = (dusbinContainer.mc.chocobox2.type_triangle.onRelease = (dusbinContainer.mc.chocobox2.type_round.onRelease = (dusbinContainer.mc.chocobox2.type_box.onRelease = function () {
if (!owner.isPaused) {
if (this._name == owner.preferred_chocolate1) {
owner.preferred_chocolate1 = owner.preferred_chocolate2;
owner.preferred_chocolate2 = null;
owner.salesGirl.chocolateCount--;
owner.girlwalkframe = owner.girlwalkframe / 2;
owner.salesGirl.girlwalk.gotoAndStop(owner.girlwalkframe);
owner.salesGirl.girlwalk.chocobox1.gotoAndStop(owner.preferred_chocolate1);
owner.salesGirl.girlwalk.chocobox2.gotoAndStop(owner.preferred_chocolate2);
} else {
owner.preferred_chocolate2 = null;
owner.salesGirl.chocolateCount--;
owner.girlwalkframe = owner.girlwalkframe / 2;
owner.salesGirl.girlwalk.gotoAndStop(owner.girlwalkframe);
owner.salesGirl.girlwalk.chocobox1.gotoAndStop(owner.preferred_chocolate1);
owner.salesGirl.girlwalk.chocobox2.gotoAndStop(owner.preferred_chocolate2);
}
owner.dusbinStatus = "ready";
owner.dusbinContainer._visible = false;
owner.isPopup = false;
owner.keyTarget = "dusbin";
owner.setGreenHighLight();
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
})))));
dusbinContainer.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.dusbinStatus = "ready";
owner.dusbinContainer._visible = false;
owner.isPopup = false;
owner.keyTarget = "dusbin";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
reportMc.mc.btn_continue.onRelease = function () {
owner.Reset();
_global.calenderfrom = "game";
owner._parent.gotoAndStop("calender");
};
reportMc.mc.btn_menu.onRelease = function () {
owner.Reset();
owner._parent.gotoAndStop("mainmenu");
};
reportMc.mc.btn_retry.onRelease = function () {
owner.Reset();
owner._parent.play();
};
popup_mc.btn_ok.onRelease = function () {
if (owner.popup_info == "welcome") {
owner.combo_bookcnt = 0;
owner.combo_ordercnt = 0;
owner.combo_moneycnt = 0;
owner.customerCount = 0;
owner.moneyCount = 0;
owner.table2._visible = (owner.table3._visible = false);
owner.table1._visible = false;
owner.lobbyArr.length = 0;
owner.lobbyArr = new Array(1, 2, 3);
owner.btn_pause._visible = true;
owner.popupDisable();
var _local1 = owner.getRandom(0, 2);
owner.customerEnterInterval = setInterval(owner.CallCustomer, 2000, owner, owner.lobbyArr[_local1], "younglady");
_local1 = owner.getRandom(0, owner.lobbyArr.length - 1);
owner.customerEnterInterval2 = setInterval(owner.CallCustomer2, 5000, owner, owner.lobbyArr[_local1], "younglady");
owner.lobbyArr.splice(_local1, 1);
owner.isPopup = false;
owner.popup_info = "level2_start";
owner.bg.gotoAndStop(2);
owner.shopopenClip._visible = true;
owner.shopopenClip.gotoAndPlay(1);
owner.ismoveready = true;
owner.machineStatus = "ready";
owner.dusbinStatus = "ready";
owner.choco_machines._visible = true;
owner.choco_machines.single_machine.gotoAndStop(2);
owner.dusbin._visible = true;
owner.dusbin.gotoAndStop(2);
owner.timerClip._visible = true;
clearInterval(owner.gameInterval);
owner.gametimer = 0;
owner.gameInterval = setInterval(owner.GameTimeLimit, 1000, owner);
} else if (owner.popup_info == "order") {
owner.popupDisable();
owner.isPopup = false;
owner.popup_info = "";
owner.selectClip._visible = true;
owner.selectClip._x = owner.choco_machines._x;
owner.selectClip._y = owner.choco_machines._y - 80;
} else if (owner.popup_info == "mismatch") {
owner.popupDisable();
owner.isPopup = false;
}
};
}
function CallPause() {
var _local2 = this;
stopAllSounds();
_local2.bg.blink.gotoAndStop(_local2.bg.blink._currentframe);
_local2.customer1.customer.gotoAndStop(_local2.customer1.customer._currentframe);
_local2.customer2.customer.gotoAndStop(_local2.customer2.customer._currentframe);
_local2.customer3.customer.gotoAndStop(_local2.customer3.customer._currentframe);
_local2.special_choco_machines.machine1.blink.gotoAndStop(_local2.special_choco_machines.machine1.blink._currentframe);
_local2.choco_machines.single_machine.blink.gotoAndStop(_local2.choco_machines.single_machine.blink._currentframe);
_local2.salesGirl.coffeeicon.smoke.gotoAndStop(_local2.salesGirl.coffeeicon.smoke._currentframe);
_local2.customer4.customer.gotoAndStop(_local2.customer4.customer._currentframe);
_local2.coin_Anim1.coin.gotoAndStop(_local2.coin_Anim1.coin._currentframe);
_local2.coin_Anim2.coin.gotoAndStop(_local2.coin_Anim2.coin._currentframe);
_local2.coin_Anim3.coin.gotoAndStop(_local2.coin_Anim3.coin._currentframe);
_local2.coin_Anim4.coin.gotoAndStop(_local2.coin_Anim4.coin._currentframe);
_local2.comboClip.combo.gotoAndStop(_local2.comboClip.combo._currentframe);
_local2.orderbook1.heartinClip.gotoAndStop(_local2.orderbook1.heartinClip._currentframe);
_local2.orderbook2.heartinClip.gotoAndStop(_local2.orderbook2.heartinClip._currentframe);
_local2.orderbook3.heartinClip.gotoAndStop(_local2.orderbook3.heartinClip._currentframe);
_local2.orderbook4.heartinClip.gotoAndStop(_local2.orderbook4.heartinClip._currentframe);
_local2.curScoreClip.gotoAndStop(_local2.curScoreClip._currentframe);
_local2.coin_Anim1.coin.coin_rotate.gotoAndStop(_local2.coin_Anim1.coin.coin_rotate._currentframe);
_local2.coin_Anim1.coin.coin_rotate2.gotoAndStop(_local2.coin_Anim1.coin.coin_rotate2._currentframe);
_local2.coin_Anim1.coin.coin_rotate3.gotoAndStop(_local2.coin_Anim1.coin.coin_rotate3._currentframe);
_local2.coin_Anim1.coin.coin_rotate4.gotoAndStop(_local2.coin_Anim1.coin.coin_rotate4._currentframe);
_local2.coin_Anim2.coin.coin_rotate.gotoAndStop(_local2.coin_Anim2.coin.coin_rotate._currentframe);
_local2.coin_Anim2.coin.coin_rotate2.gotoAndStop(_local2.coin_Anim2.coin.coin_rotate2._currentframe);
_local2.coin_Anim2.coin.coin_rotate3.gotoAndStop(_local2.coin_Anim2.coin.coin_rotate3._currentframe);
_local2.coin_Anim2.coin.coin_rotate4.gotoAndStop(_local2.coin_Anim2.coin.coin_rotate4._currentframe);
_local2.coin_Anim3.coin.coin_rotate.gotoAndStop(_local2.coin_Anim3.coin.coin_rotate._currentframe);
_local2.coin_Anim3.coin.coin_rotate2.gotoAndStop(_local2.coin_Anim3.coin.coin_rotate2._currentframe);
_local2.coin_Anim3.coin.coin_rotate3.gotoAndStop(_local2.coin_Anim3.coin.coin_rotate3._currentframe);
_local2.coin_Anim3.coin.coin_rotate4.gotoAndStop(_local2.coin_Anim3.coin.coin_rotate4._currentframe);
_local2.coin_Anim4.coin.coin_rotate.gotoAndStop(_local2.coin_Anim4.coin.coin_rotate._currentframe);
_local2.coin_Anim4.coin.coin_rotate2.gotoAndStop(_local2.coin_Anim4.coin.coin_rotate2._currentframe);
_local2.coin_Anim4.coin.coin_rotate3.gotoAndStop(_local2.coin_Anim4.coin.coin_rotate3._currentframe);
_local2.coin_Anim4.coin.coin_rotate4.gotoAndStop(_local2.coin_Anim4.coin.coin_rotate4._currentframe);
_local2.comboClip.combo.coin_rotate.gotoAndStop(_local2.comboClip.combo.coin_rotate._currentframe);
if (_local2.scoreIndicateClip._visible) {
_local2.scoreIndicateClip.gotoAndStop(_local2.scoreIndicateClip._currentframe);
}
if (_local2.expertScoreClip._visible) {
_local2.expertScoreClip.gotoAndStop(_local2.expertScoreClip._currentframe);
}
_local2.chocolateClip.mc.gotoAndStop(_local2.chocolateClip.mc._currentframe);
}
function CallResume() {
var _local4 = this;
if (_global.soundstat == "onn") {
_root.gameSound.start();
}
_local4.bg.blink.gotoAndPlay(_local4.bg.blink._currentframe);
_local4.customer1.customer.gotoAndPlay(_local4.customer1.customer._currentframe);
_local4.customer2.customer.gotoAndPlay(_local4.customer2.customer._currentframe);
_local4.customer3.customer.gotoAndPlay(_local4.customer3.customer._currentframe);
_local4.special_choco_machines.machine1.blink.gotoAndPlay(_local4.special_choco_machines.machine1.blink._currentframe);
_local4.choco_machines.single_machine.blink.gotoAndPlay(_local4.choco_machines.single_machine.blink._currentframe);
_local4.salesGirl.coffeeicon.smoke.gotoAndPlay(_local4.salesGirl.coffeeicon.smoke._currentframe);
_local4.customer4.customer.gotoAndPlay(_local4.customer4.customer._currentframe);
_local4.coin_Anim1.coin.gotoAndPlay(_local4.coin_Anim1.coin._currentframe - 1);
_local4.coin_Anim2.coin.gotoAndPlay(_local4.coin_Anim2.coin._currentframe - 1);
_local4.coin_Anim3.coin.gotoAndPlay(_local4.coin_Anim3.coin._currentframe - 1);
_local4.coin_Anim4.coin.gotoAndPlay(_local4.coin_Anim4.coin._currentframe - 1);
_local4.comboClip.combo.gotoAndPlay(_local4.comboClip.combo._currentframe - 1);
_local4.orderbook1.heartinClip.gotoAndPlay(_local4.orderbook1.heartinClip._currentframe - 1);
_local4.orderbook2.heartinClip.gotoAndPlay(_local4.orderbook2.heartinClip._currentframe - 1);
_local4.orderbook3.heartinClip.gotoAndPlay(_local4.orderbook3.heartinClip._currentframe - 1);
_local4.orderbook4.heartinClip.gotoAndPlay(_local4.orderbook4.heartinClip._currentframe - 1);
_local4.curScoreClip.gotoAndPlay(_local4.curScoreClip._currentframe);
_local4.coin_Anim1.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate._currentframe);
_local4.coin_Anim1.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate2._currentframe);
_local4.coin_Anim1.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate3._currentframe);
_local4.coin_Anim1.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate4._currentframe);
_local4.coin_Anim2.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate._currentframe);
_local4.coin_Anim2.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate2._currentframe);
_local4.coin_Anim2.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate3._currentframe);
_local4.coin_Anim2.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate4._currentframe);
_local4.coin_Anim3.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate._currentframe);
_local4.coin_Anim3.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate2._currentframe);
_local4.coin_Anim3.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate3._currentframe);
_local4.coin_Anim3.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate4._currentframe);
_local4.coin_Anim4.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate._currentframe);
_local4.coin_Anim4.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate2._currentframe);
_local4.coin_Anim4.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate3._currentframe);
_local4.coin_Anim4.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate4._currentframe);
_local4.comboClip.combo.coin_rotate.gotoAndPlay(_local4.comboClip.combo.coin_rotate._currentframe);
if (_local4.scoreIndicateClip._visible) {
_local4.scoreIndicateClip.gotoAndPlay(_local4.scoreIndicateClip._currentframe - 1);
}
if (_local4.expertScoreClip._visible) {
_local4.expertScoreClip.gotoAndPlay(_local4.expertScoreClip._currentframe - 1);
}
_local4.chocolateClip.mc.gotoAndPlay(_local4.chocolateClip.mc._currentframe - 1);
}
function shopperMovement() {
var _local3 = (salesGirl._x + salesGirl.pointer._x) - targetclip._x;
var _local2 = (salesGirl._y + salesGirl.pointer._y) - targetclip._y;
var _local5 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
var _local6 = (salesGirl._width / 4) + (targetclip._width / 4);
var _local4 = 10;
if (_local5 > _local4) {
salesGirl._x = salesGirl._x + (Math.cos(radian) * 12);
salesGirl._y = salesGirl._y + (Math.sin(radian) * 12);
} else if (!isTargetReached) {
isTargetReached = true;
salesGirl.gotoAndStop(targetDirection);
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
Manipulate();
updateScore();
}
}
function calculateAngle(mc) {
if (!isPopup) {
targetclip = mc;
var x_diff = (eval (mc)._x - (salesGirl._x + salesGirl.pointer._x));
var y_diff = (eval (mc)._y - (salesGirl._y + salesGirl.pointer._y));
radian = Math.atan2(y_diff, x_diff);
if (Math.abs(x_diff) > Math.abs(y_diff)) {
if (x_diff > 0) {
targetDirection = "right";
} else {
targetDirection = "left";
}
} else if (y_diff > 0) {
targetDirection = "down";
} else {
targetDirection = "up";
}
if (curtarget != selectedTarget) {
curtarget = selectedTarget;
salesGirl.gotoAndStop(targetDirection);
salesGirl.girlwalk.gotoAndStop(girlwalkframe - 1);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
}
}
}
function ShowPopup(_arg1) {
clearInterval(_arg1.popup_interval);
_arg1.isPopup = true;
_arg1.popup_mc._visible = true;
_arg1.popup_mc.swapDepths(_arg1.getNextHighestDepth());
_arg1.popup_mc.gotoAndPlay(1);
}
function popupDisable() {
popup_mc.gotoAndStop(1);
popup_mc._visible = false;
}
function CallNewCustomer(_arg1) {
if (!_arg1.isGameOver) {
if ((_arg1.customerCount != 0) && (_arg1.moneyCount != 0)) {
_arg1.CallNextCustomerSet();
}
} else {
clearInterval(_arg1.Re_customerEnterInterval);
}
}
function CallCustomer(_arg2, _arg3, _arg4) {
if (!_arg2.isPaused) {
clearInterval(_arg2.customerEnterInterval);
if (!_arg2.isGameOver) {
_arg2.customerEnter(_arg3, _arg4);
var _local1 = 0;
while (_local1 < _arg2.lobbyArr.length) {
if (_arg2.lobbyArr[_local1] == _arg3) {
_arg2.lobbyArr.splice(_local1, 1);
}
_local1++;
}
} else if ((_arg2.customerCount == 0) && (_arg2.moneyCount == 0)) {
_arg2.callResult();
}
}
}
function CallCustomer2(_arg2, _arg3, _arg4) {
if (!_arg2.isPaused) {
clearInterval(_arg2.customerEnterInterval2);
if (!_arg2.isGameOver) {
_arg2.customerEnter(_arg3, _arg4);
var _local1 = 0;
while (_local1 < _arg2.lobbyArr.length) {
if (_arg2.lobbyArr[_local1] == _arg3) {
_arg2.lobbyArr.splice(_local1, 1);
}
_local1++;
}
} else if ((_arg2.customerCount == 0) && (_arg2.moneyCount == 0)) {
_arg2.callResult();
}
}
}
function CallCustomer3(_arg2, _arg3, _arg4) {
if (!_arg2.isPaused) {
clearInterval(_arg2.customerEnterInterval3);
if (!_arg2.isGameOver) {
_arg2.customerEnter(_arg3, _arg4);
var _local1 = 0;
while (_local1 < _arg2.lobbyArr.length) {
if (_arg2.lobbyArr[_local1] == _arg3) {
_arg2.lobbyArr.splice(_local1, 1);
}
_local1++;
}
} else if ((_arg2.customerCount == 0) && (_arg2.moneyCount == 0)) {
_arg2.callResult();
}
}
}
function Re_CallCustomer(_arg2, _arg3, _arg4) {
if (!_arg2.isPaused) {
clearInterval(_arg2.Re_customerEnterInterval);
if (!_arg2.isGameOver) {
_arg2.customerEnter(_arg3, _arg4);
var _local1 = 0;
while (_local1 < _arg2.lobbyArr.length) {
if (_arg2.lobbyArr[_local1] == _arg3) {
_arg2.lobbyArr.splice(_local1, 1);
}
_local1++;
}
} else if ((_arg2.customerCount == 0) && (_arg2.moneyCount == 0)) {
_arg2.callResult();
}
}
}
function customerEnter(_arg3, _arg2) {
if (_arg3 == 1) {
table1._visible = true;
customer1 = attachMovie(_arg2, "customer1", depthArr[_arg3 - 1], {_x:115, _y:356});
orderbook1 = attachMovie("orderbook", "orderbook1", getNextHighestDepth(), {_x:170, _y:374});
orderbook1.type = "book";
customer1.type = _arg2;
orderbook1.heatcnt = 0;
if (_arg2 == "oldlady") {
orderbook1.heatInterval = setInterval(HeatFunction, 600, orderbook1, this, 1);
} else if (_arg2 == "younglady") {
orderbook1.heatInterval = setInterval(HeatFunction, 300, orderbook1, this, 1);
}
} else if (_arg3 == 2) {
table2._visible = true;
customer2 = attachMovie(_arg2, "customer2", depthArr[_arg3 - 1], {_x:119, _y:235});
orderbook2 = attachMovie("orderbook", "orderbook2", getNextHighestDepth(), {_x:177, _y:278});
orderbook2.type = "book";
customer2.type = _arg2;
orderbook2.heatcnt = 0;
if (_arg2 == "oldlady") {
orderbook2.heatInterval = setInterval(HeatFunction, 600, orderbook2, this, 2);
} else if (_arg2 == "younglady") {
orderbook2.heatInterval = setInterval(HeatFunction, 300, orderbook2, this, 2);
}
} else if (_arg3 == 3) {
table3._visible = true;
customer3 = attachMovie(_arg2, "customer3", depthArr[_arg3 - 1], {_x:127, _y:140});
orderbook3 = attachMovie("orderbook", "orderbook3", getNextHighestDepth(), {_x:184, _y:185});
orderbook3.type = "book";
customer3.type = _arg2;
orderbook3.heatcnt = 0;
if (_arg2 == "oldlady") {
orderbook3.heatInterval = setInterval(HeatFunction, 600, orderbook3, this, 3);
} else if (_arg2 == "younglady") {
orderbook3.heatInterval = setInterval(HeatFunction, 300, orderbook3, this, 3);
}
}
customerCount++;
moneyCount++;
salesGirl.swapDepths(getNextHighestDepth());
scoreIndicateClip.swapDepths(getNextHighestDepth());
expertScoreClip.swapDepths(getNextHighestDepth());
chocolate_container.swapDepths(getNextHighestDepth());
dusbinContainer.swapDepths(getNextHighestDepth());
comboClip.swapDepths(getNextHighestDepth());
reportMc.swapDepths(getNextHighestDepth());
}
function Manipulate() {
var owner = this;
if (selectedTarget == "choco_machines") {
choco_machines.pointer._visible = false;
if (choco_machines.status == "empty") {
if (owner.salesGirl.chocolateCount < 3) {
chocolate_container._visible = true;
chocolate_container.gotoAndStop(1);
chocolate_container.mc.gotoAndPlay(1);
machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
keyTarget = "type_round";
}
} else if (choco_machines.status == "chocolateReady") {
if (owner.salesGirl.chocolateCount < 2) {
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = owner.preferred_chocolate;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = owner.preferred_chocolate;
}
owner.salesGirl.chocolateCount++;
chocolateClip._visible = false;
salesGirl.gotoAndStop(2);
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
choco_machines.status = "empty";
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
if (orderbook1.book_mc._currentframe == 74) {
orderbook1.green_highlight._visible = true;
}
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
if (orderbook2.book_mc._currentframe == 74) {
orderbook2.green_highlight._visible = true;
}
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
if (orderbook3.book_mc._currentframe == 74) {
orderbook3.green_highlight._visible = true;
}
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (selectedTarget == "dusbin") {
dusbin.pointer._visible = false;
if (salesGirl.chocolateCount == 1) {
salesGirl.chocolateCount--;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
preferred_chocolate1 = null;
preferred_chocolate2 = null;
setGreenHighLight();
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
} else if (salesGirl.chocolateCount >= 2) {
dusbinStatus = "notready";
isPopup = true;
_global.preferred_chocolate1 = preferred_chocolate1;
_global.preferred_chocolate2 = preferred_chocolate2;
keyTarget = _global.preferred_chocolate1;
dusbinContainer._visible = true;
dusbinContainer.gotoAndStop(1);
dusbinContainer.mc.gotoAndPlay(1);
} else {
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (((selectedTarget == "table1") || (selectedTarget == "table2")) || (selectedTarget == "table3")) {
eval ("this.orderbook" + selectedTable).pointer._visible = false;
if (eval ("this.orderbook" + selectedTable).type == "book") {
combo_bookcnt++;
combo_ordercnt = 0;
combo_moneycnt = 0;
eval ("this.orderbook" + selectedTable).type = "chocolateOrder";
var randomno = owner.getRandom(0, 2);
eval ("this.orderbook" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.customer" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.orderbook" + selectedTable).gotoAndStop(2);
eval ("this.orderbook" + selectedTable).green_highlight._visible = false;
eval ("this.customer" + selectedTable).gotoAndStop(3);
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
var heatcntchange = int(eval ("this.orderbook" + selectedTable).heatcnt / 4);
if (heatcntchange > 1) {
eval ("this.orderbook" + selectedTable).heatcnt = heatcntchange;
} else {
eval ("this.orderbook" + selectedTable).heatcnt = 1;
}
CheckForBookCombo();
} else if (eval ("this.orderbook" + selectedTable).type == "chocolateOrder") {
if ((salesGirl.chocolateCount >= 1) && (eval ("this.orderbook" + selectedTable).book_mc._currentframe >= 74)) {
combo_bookcnt = 0;
combo_moneycnt = 0;
if (eval ("owner.customer" + owner.selectedTable).neededchocolate == owner.preferred_chocolate1) {
combo_ordercnt++;
preferred_chocolate1 = preferred_chocolate2;
preferred_chocolate2 = null;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
eval ("this.orderbook" + selectedTable).type = "money";
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable).gotoAndStop(3);
eval ("this.customer" + selectedTable).gotoAndStop(5);
if ((eval ("this.orderbook" + selectedTable).heatcnt > 60) && (eval ("this.orderbook" + selectedTable).heatcnt <= 100)) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(2);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
} else if (eval ("this.orderbook" + selectedTable).heatcnt > 100) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(3);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
eval ("this.orderbook" + selectedTable).highlight_small._visible = false;
}
clearInterval(eval ("this.orderbook" + selectedTable).heatInterval);
CheckForOrderCombo();
customerCount--;
if (salesGirl.chocolateCount == 1) {
preferred_chocolate1 = null;
}
salesGirl.chocolateCount--;
owner.setGreenHighLight();
if (_global.soundstat == "onn") {
_root.customer_happy_Sound.start();
}
if (!isGameOver) {
CallNextCustomerSet();
}
} else if (eval ("owner.customer" + owner.selectedTable).neededchocolate == owner.preferred_chocolate2) {
combo_ordercnt++;
salesGirl.chocolateCount--;
preferred_chocolate2 = null;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
eval ("this.orderbook" + selectedTable).type = "money";
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable).gotoAndStop(3);
eval ("this.customer" + selectedTable).gotoAndStop(5);
if ((eval ("this.orderbook" + selectedTable).heatcnt > 60) && (eval ("this.orderbook" + selectedTable).heatcnt <= 100)) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(2);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
} else if (eval ("this.orderbook" + selectedTable).heatcnt > 100) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(3);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
eval ("this.orderbook" + selectedTable).highlight_small._visible = false;
}
clearInterval(eval ("this.orderbook" + selectedTable).heatInterval);
CheckForOrderCombo();
customerCount--;
owner.setGreenHighLight();
if (_global.soundstat == "onn") {
_root.customer_happy_Sound.start();
}
if (!isGameOver) {
CallNextCustomerSet();
}
}
}
} else if (eval ("this.orderbook" + selectedTable).type == "money") {
combo_bookcnt = 0;
combo_ordercnt = 0;
combo_moneycnt++;
moneyCount--;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(2);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable)._visible = false;
eval ("this.customer" + selectedTable)._visible = false;
eval ("this.table" + selectedTable)._visible = false;
eval ("this.orderbook" + selectedTable).type = "empty";
CheckForMoneyCombo();
lobbyArr.push(selectedTable);
if ((customerCount == 0) && (moneyCount == 0)) {
if (!isGameOver) {
if (lobbyArr.length == 3) {
customerCount = 0;
moneyCount = 0;
owner.table2._visible = (owner.table3._visible = false);
owner.table1._visible = false;
CallNextCustomerSet();
}
} else {
callResult();
}
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
}
function CallNextCustomerSet() {
var _local2 = this;
clearInterval(_local2.customerEnterInterval);
clearInterval(_local2.customerEnterInterval2);
clearInterval(_local2.customerEnterInterval3);
if (lobbyArr.length == 1) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
clearInterval(_local2.customerEnterInterval);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 2000, _local2, _local2.lobbyArr[_local3], "younglady");
var _local5 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local2.lobbyArr.push(_local5);
} else if (lobbyArr.length == 2) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
clearInterval(_local2.customerEnterInterval);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 100, _local2, _local2.lobbyArr[_local3], "younglady");
var _local5 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
clearInterval(_local2.customerEnterInterval2);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 2000, _local2, _local2.lobbyArr[_local3], "younglady");
var _local6 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local2.lobbyArr.push(_local5);
_local2.lobbyArr.push(_local6);
} else if (lobbyArr.length == 3) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
clearInterval(_local2.customerEnterInterval);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 1000, _local2, _local2.lobbyArr[_local3], "younglady");
var _local5 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
clearInterval(_local2.customerEnterInterval2);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 3000, _local2, _local2.lobbyArr[_local3], "younglady");
var _local6 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
clearInterval(_local2.customerEnterInterval3);
_local2.customerEnterInterval3 = setInterval(_local2.CallCustomer3, 4500, _local2, _local2.lobbyArr[_local3], "younglady");
var _local4 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local2.lobbyArr.push(_local5);
_local2.lobbyArr.push(_local6);
_local2.lobbyArr.push(_local4);
}
}
function setGreenHighLight() {
if (orderbook1.book_mc._currentframe >= 74) {
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
} else {
orderbook1.green_highlight._visible = false;
}
}
if (orderbook2.book_mc._currentframe >= 74) {
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
} else {
orderbook2.green_highlight._visible = false;
}
}
if (orderbook3.book_mc._currentframe >= 74) {
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
} else {
orderbook3.green_highlight._visible = false;
}
}
}
function callResult() {
clearInterval(customerEnterInterval);
clearInterval(customerEnterInterval2);
clearInterval(customerEnterInterval3);
clearInterval(Re_customerEnterInterval);
clearInterval(reportInterval);
clearInterval(orderbook1.heatInterval);
clearInterval(orderbook2.heatInterval);
clearInterval(orderbook3.heatInterval);
machineStatus = "notready";
isPopup = true;
_global.report_moneyEarned = score;
_global.report_tips = tips;
_global.targetScore = 100;
_global.expertScore = 220;
btn_pause._visible = false;
dusbinStatus = "notready";
score = score + tips;
if (score < 100) {
reportMc._visible = true;
reportMc.gotoAndStop(2);
reportMc.mc.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.level_failed_Sound.start();
}
} else {
if (_global.soundstat == "onn") {
_root.level_complete_Sound.start();
}
if (_global.levelSelected < 3) {
_global.levelSelected = 3;
}
if (_global.levelFinished <= 2) {
_global.levelFinished = 2;
}
if (score >= 220) {
_global.level2Status = "expert";
} else {
_global.level2Status = "target";
}
_global.level2Score = score;
if (((score >= 100) && (scoreClip.target._currentframe == 1)) || ((score >= 220) && (scoreClip.expert._currentframe == 1))) {
reportInterval = setInterval(CallReport, 2300, this);
} else {
reportMc._visible = true;
reportMc.gotoAndStop(1);
reportMc.mc.gotoAndPlay(2);
}
}
}
function CallReport(_arg1) {
clearInterval(_arg1.reportInterval);
_arg1.reportMc._visible = true;
_arg1.reportMc.gotoAndStop(1);
_arg1.reportMc.mc.gotoAndPlay(2);
}
function HeatFunction(owner, myparent, curpoint) {
if (!myparent.isPaused) {
owner.heatcnt++;
owner.timelimit.gotoAndStop(owner.heatcnt);
if (owner.heatcnt == 100) {
eval ("myparent.customer" + curpoint).gotoAndStop(4);
}
if (owner.heatcnt >= 120) {
clearInterval(owner.heatInterval);
eval ("myparent.customer" + curpoint).gotoAndStop(6);
myparent.moneyCount--;
myparent.customerCount--;
eval ("myparent.orderbook" + curpoint)._visible = false;
eval ("myparent.table" + curpoint)._visible = false;
if (eval ("myparent.customer" + curpoint).type == "oldlady") {
if (myparent.score > 0) {
myparent.curScoreClip._visible = true;
myparent.curScoreClip.gotoAndPlay(1);
if ((myparent.score >= 2) && (myparent.score < 10)) {
myparent.score = myparent.score - 2;
myparent.curScoreClip.disp.score.text = -2;
} else if (myparent.score >= 10) {
myparent.score = myparent.score - 10;
myparent.curScoreClip.disp.score.text = -10;
}
myparent.scoreClip.score_txt.text = myparent.score;
myparent.scoreClip.loading.gotoAndStop(myparent.score);
}
} else if (eval ("myparent.customer" + curpoint).type == "younglady") {
if (myparent.score > 0) {
myparent.curScoreClip._visible = true;
myparent.curScoreClip.gotoAndPlay(1);
if ((myparent.score >= 2) && (myparent.score < 15)) {
myparent.score = myparent.score - 2;
myparent.curScoreClip.disp.score.text = -2;
} else if (myparent.score >= 15) {
myparent.score = myparent.score - 15;
myparent.curScoreClip.disp.score.text = -15;
}
myparent.scoreClip.score_txt.text = myparent.score;
myparent.scoreClip.loading.gotoAndStop(myparent.score);
}
}
eval ("myparent.orderbook" + curpoint).type = "empty";
myparent.lobbyArr.push(curpoint);
if ((myparent.customerCount == 0) && (myparent.moneyCount == 0)) {
if (!myparent.isGameOver) {
myparent.CallNextCustomerSet();
} else {
myparent.callResult();
}
}
}
}
}
function GameTimeLimit(_arg1) {
if (!_arg1.isPaused) {
_arg1.gametimer++;
_arg1.timerClip.gotoAndStop(_arg1.gametimer);
if (_arg1.gametimer >= 90) {
_arg1.isGameOver = true;
_arg1.bg.gotoAndStop(1);
_arg1.shopclosedClip._visible = true;
_arg1.shopclosedClip.gotoAndPlay(1);
_arg1.gametimer = 0;
clearInterval(_arg1.gameInterval);
}
}
}
function CheckForBookCombo() {
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_bookcnt >= 2) {
comboClip._x = eval ("this.customer" + selectedTable)._x - 20;
comboClip._y = eval ("this.customer" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_bookcnt);
comboClip.combo.gotoAndPlay(1);
score = score + 4;
curScoreClip.disp.score.text = 4;
tips = tips + 4;
} else {
score = score + 2;
curScoreClip.disp.score.text = 2;
tips = tips + 2;
}
if (_global.soundstat == "onn") {
eval (("_root.combo" + combo_bookcnt) + "_Sound").start();
}
}
function CheckForOrderCombo() {
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_ordercnt >= 2) {
comboClip._x = eval ("this.customer" + selectedTable)._x - 20;
comboClip._y = eval ("this.customer" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_ordercnt);
comboClip.combo.gotoAndPlay(1);
score = score + 20;
curScoreClip.disp.score.text = 20;
} else {
score = score + 10;
curScoreClip.disp.score.text = 10;
}
if (_global.soundstat == "onn") {
eval (("_root.combo" + combo_ordercnt) + "_Sound").start();
}
}
function CheckForMoneyCombo() {
if (_global.soundstat == "onn") {
eval (("_root.money" + combo_moneycnt) + "_Sound").start();
}
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_moneycnt >= 2) {
comboClip._x = eval ("this.orderbook" + selectedTable)._x;
comboClip._y = eval ("this.orderbook" + selectedTable)._y;
comboClip._visible = true;
comboClip.gotoAndStop(combo_moneycnt);
comboClip.combo.gotoAndPlay(1);
if (eval ("this.orderbook" + selectedTable).neededchocolate == "type_rabbit") {
score = score + (combo_moneycnt * 30);
curScoreClip.disp.score.text = combo_moneycnt * 30;
} else if (eval ("this.customer" + selectedTable).type == "oldlady") {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + (combo_moneycnt * 17);
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + (combo_moneycnt * 14);
curScoreClip.disp.score.text = combo_moneycnt * 14;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + (combo_moneycnt * 11);
curScoreClip.disp.score.text = combo_moneycnt * 11;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + (combo_moneycnt * 10);
curScoreClip.disp.score.text = combo_moneycnt * 10;
}
} else {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + (combo_moneycnt * 24);
curScoreClip.disp.score.text = combo_moneycnt * 24;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + (combo_moneycnt * 21);
curScoreClip.disp.score.text = combo_moneycnt * 21;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + (combo_moneycnt * 17);
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + (combo_moneycnt * 15);
curScoreClip.disp.score.text = combo_moneycnt * 15;
}
}
if (!isGameOver) {
CallNextCustomerSet();
}
} else if (eval ("this.customer" + selectedTable).type == "oldlady") {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + 17;
curScoreClip.disp.score.text = 17;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + 14;
curScoreClip.disp.score.text = 14;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + 11;
curScoreClip.disp.score.text = 11;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + 10;
curScoreClip.disp.score.text = 10;
}
} else {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + 24;
curScoreClip.disp.score.text = combo_moneycnt * 24;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + 21;
curScoreClip.disp.score.text = combo_moneycnt * 21;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + 17;
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + 15;
curScoreClip.disp.score.text = combo_moneycnt * 15;
}
}
}
function IdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.preparecnt++;
if (_arg3.preparecnt >= 20) {
clearInterval(_arg3.process_interval);
_arg3.machineStatus = "ready";
_arg3.machineshake = "off";
if (_arg3.choco_machines.status == "prepared") {
_arg3.choco_machines.status = "chocolateReady";
}
if (_global.soundstat == "onn") {
_root.choco_done_Sound.start();
}
}
}
}
function StoreInSequence() {
var owner = this;
eval ("this." + moveTarget).onRelease();
}
function CallSequence() {
var owner = this;
if (sequenceArr[0] == choco_machines) {
if (((owner.isTargetReached && (owner.machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines";
owner.calculateAngle(owner.chomac_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == dusbin) {
if ((owner.isTargetReached && (owner.dusbinStatus == "ready")) && (!owner.isPaused)) {
owner.isTargetReached = false;
owner.selectedTarget = "dusbin";
owner.calculateAngle(owner.dusbin_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (((sequenceArr[0] == table1) || (sequenceArr[0] == table2)) || (sequenceArr[0] == table3)) {
if ((owner.isTargetReached && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = sequenceArr[0]._name;
owner.calculateAngle(sequenceArr[0]);
if (owner.selectedTarget == "table1") {
owner.selectedTable = 1;
} else if (owner.selectedTarget == "table2") {
owner.selectedTable = 2;
} else if (owner.selectedTarget == "table3") {
owner.selectedTable = 3;
}
eval ("owner.orderbook" + owner.selectedTable).pointer._visible = true;
}
}
}
function getRandom(_arg4, _arg5) {
var _local3 = _arg5 - _arg4;
var _local2 = Math.random() * _local3;
var _local1 = Math.round(_local2);
_local1 = _local1 + _arg4;
return(_local1);
}
function ObjectsRollOut() {
table1.onRollOut();
table2.onRollOut();
table3.onRollOut();
choco_machines.onRollOut();
dusbin.onRollOut();
}
function Reset() {
targetclip = "table1";
lobbyArr.length = 0;
lobbyArr = new Array(1, 2, 3);
currentDirection = "down";
targetDirection = "";
isPopup = false;
popup_info = "welcome";
clearInterval(popup_interval);
clearInterval(process_interval);
popup_interval = -1;
isTargetReached = true;
selectedTarget = "";
orderno = 0;
score = 0;
ismoveready = false;
orderTaken = 0;
customerCount = 0;
machineStatus = "notready";
dusbinStatus = "notready";
girlwalkframe = 2;
isFirstServeFinished = false;
depthArr.length = 0;
depthArr = new Array(-10313, -10315, -10317);
chocolateTypeArr.length = 0;
chocolateTypeArr = new Array("type_triangle", "type_round", "type_box");
customerEnterset = "firstset";
moneyCount = 0;
clearInterval(gameInterval);
gametimer = 0;
isGameOver = false;
combo_bookcnt = 0;
combo_ordercnt = 0;
combo_moneycnt = 0;
curtarget = "";
clearInterval(customerEnterInterval);
clearInterval(customerEnterInterval2);
clearInterval(customerEnterInterval3);
clearInterval(Re_customerEnterInterval);
clearInterval(reportInterval);
clearInterval(orderbook1.heatInterval);
clearInterval(orderbook2.heatInterval);
clearInterval(orderbook3.heatInterval);
isPaused = false;
sequenceArr.length = 0;
sequenceArr = new Array();
Key.removeListener(leve2Keyobj);
keyTarget = undefined;
pauseTarget = "";
}
var targetclip = "table1";
var lobbyArr = new Array(1, 2, 3);
var currentDirection = "down";
var isPopup = false;
var popup_info = "welcome";
var popup_interval = -1;
var process_interval = -1;
var isTargetReached = true;
var selectedTarget = "";
var orderno = 0;
var ismoveready = false;
var orderTaken = 0;
var customerCount = 0;
var machineStatus = "notready";
var dusbinStatus = "notready";
var girlwalkframe = 2;
var isFirstServeFinished = false;
var score = 0;
var depthArr = new Array(-10313, -10315, -10317);
var chocolateTypeArr = new Array("type_triangle", "type_round", "type_box");
var customerEnterset = "firstset";
var moneyCount = 0;
var gameInterval = -1;
var gametimer = 0;
var isGameOver = false;
var combo_bookcnt = 0;
var combo_ordercnt = 0;
var combo_moneycnt = 0;
var curtarget = "";
var customerEnterInterval = -1;
var customerEnterInterval2 = -1;
var customerEnterInterval3 = -1;
var reportInterval = -1;
var isPaused = false;
var machinespeed = 1;
var machineshake = "off";
var specialmachineshake = "off";
var sequenceArr = new Array();
var tips = 0;
var Re_customerEnterInterval = -1;
var preparecnt = 0;
}
Symbol 1700 MovieClip [__Packages.Level3] Frame 0
class Level3 extends MovieClip
{
var salesGirl, btn_pause, _parent, choco_machines, special_choco_machines, scoreIndicateClip, shopclosedClip, timerClip, chocolate_container, special_chocolate_container, coffeeClip, chocolateClip, phone_mc, popup_mc, selectClip, coffee_machine, heartinClip, shopopenClip, reportMc, cancel_mc, infoClip, comboClip, dusbinContainer, curScoreClip, specialChocolateClip, expertScoreClip, table3, table2, table1, coin_Anim3, coin_Anim2, coin_Anim1, dusbin, leve3Keyobj, keyTarget, pauseTarget, scoreClip, radian, targetDirection, preferred_chocolate1, preferred_chocolate2, customer1, attachMovie, orderbook1, getNextHighestDepth, customer2, orderbook2, customer3, orderbook3, selectedTable, moveTarget, keylistener;
function Level3 () {
super();
}
function onLoad() {
var owner = this;
clearInterval(popup_interval);
clearInterval(process_interval);
Reset();
salesGirl.coffeeicon._visible = false;
btn_pause._visible = false;
_parent.pauseClip._visible = false;
salesGirl.gotoAndStop(currentDirection);
salesGirl.chocolateCount = 0;
choco_machines.status = "empty";
special_choco_machines.status = "empty";
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
scoreIndicateClip._visible = false;
shopclosedClip._visible = false;
timerClip._visible = false;
chocolate_container._visible = false;
special_chocolate_container._visible = false;
special_chocolate_container.mc.gotoAndStop(1);
coffeeClip._visible = false;
chocolateClip._visible = false;
phone_mc._visible = false;
popup_mc._visible = false;
selectClip._visible = false;
coffee_machine._visible = false;
heartinClip._visible = false;
shopopenClip._visible = false;
reportMc._visible = false;
cancel_mc._visible = false;
infoClip._visible = false;
comboClip._visible = false;
dusbinContainer._visible = false;
curScoreClip._visible = false;
specialChocolateClip._visible = false;
expertScoreClip._visible = false;
table2._visible = (table3._visible = false);
table1._visible = false;
coin_Anim2._visible = (coin_Anim3._visible = false);
coin_Anim1._visible = false;
table1.point = 1;
table2.point = 2;
table3.point = 3;
choco_machines._visible = true;
choco_machines.single_machine.gotoAndStop(2);
dusbin._visible = true;
dusbin.gotoAndStop(2);
special_choco_machines._visible = true;
special_choco_machines.gotoAndStop(1);
special_choco_machines.machine1.intro.gotoAndPlay(1);
gamestartInterval = setInterval(GameStart, 3000, this);
btn_pause.onRelease = function () {
if (this._visible && (owner._parent.pauseClip._visible == false)) {
owner.pauseTarget = "btn_continue";
owner.isPaused = true;
owner.isPopup = true;
this._visible = false;
owner._parent.pauseClip._visible = true;
owner._parent.pauseClip.gotoAndPlay(2);
owner.CallPause();
}
};
leve3Keyobj = new Object();
Key.addListener(leve3Keyobj);
leve3Keyobj.onKeyUp = function () {
if (Key.getCode() == 13) {
if ((!owner.isPaused) && (!owner.isGameOver)) {
owner.StoreInSequence();
}
}
};
leve3Keyobj.onKeyDown = function () {
if (Key.getCode() == 37) {
if (!owner.isPaused) {
owner.LeftNavigation();
}
} else if (Key.getCode() == 39) {
if (!owner.isPaused) {
owner.RightNavigation();
}
} else if (Key.getCode() == 38) {
if (!owner.isPaused) {
owner.UpNavigation();
} else {
owner.pauseUpNavigation();
}
} else if (Key.getCode() == 40) {
if (!owner.isPaused) {
owner.DownNavigation();
} else {
owner.pauseDownNavigation();
}
} else if (Key.getCode() == 13) {
if (owner.popup_mc._visible) {
owner.popup_mc.btn_ok.onRelease();
} else if (owner.reportMc._visible) {
if (owner.reportMc._currentframe == 1) {
owner.reportMc.mc.btn_continue.onRelease();
} else {
owner.reportMc.mc.btn_retry.onRelease();
}
} else if (!owner.isPaused) {
owner.EnterFunction();
} else {
owner.PauseEnterFunction();
}
} else if (Key.getAscii() == 27) {
if (!owner.isPaused) {
owner.btn_pause.onRelease();
} else if (owner.isPaused) {
owner._parent.pauseClip.btn_continue.onRelease();
}
}
};
table1.onRollOver = (table2.onRollOver = (table3.onRollOver = function () {
if ((!owner.isPaused) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = this._name;
owner.moveTarget = this._name;
eval ("this.orderbook" + this.point).highlight.gotoAndStop(2);
if (eval ("this.orderbook" + this.point).money_mc._currentframe == 2) {
eval ("this.orderbook" + this.point).highlight_small.gotoAndStop(2);
} else if (eval ("this.orderbook" + this.point).money_mc._currentframe == 3) {
eval ("this.orderbook" + this.point).highlight_small_coin.gotoAndStop(2);
}
}
}));
table1.onRollOut = (table2.onRollOut = (table3.onRollOut = function () {
eval ("this.orderbook" + this.point).highlight.gotoAndStop(1);
if (eval ("this.orderbook" + this.point).money_mc._currentframe == 2) {
eval ("this.orderbook" + this.point).highlight_small.gotoAndStop(1);
} else if (eval ("this.orderbook" + this.point).money_mc._currentframe == 3) {
eval ("this.orderbook" + this.point).highlight_small_coin.gotoAndStop(1);
}
}));
choco_machines.onRollOver = function () {
if (((owner.machineStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "choco_machines";
owner.moveTarget = "choco_machines";
this.single_machine.gotoAndStop(3);
}
};
choco_machines.onRollOut = (choco_machines.onReleaseOutside = function () {
this.single_machine.gotoAndStop(2);
});
dusbin.onRollOver = function () {
if ((owner.dusbinStatus == "ready") && (!owner.isPaused)) {
owner.ObjectsRollOut();
owner.keyTarget = "dusbin";
owner.moveTarget = "dusbin";
this.gotoAndStop(3);
}
};
dusbin.onRollOut = (dusbin.onReleaseOutside = function () {
this.gotoAndStop(2);
});
special_choco_machines.onRollOver = function () {
if (((owner.special_machineStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "special_choco_machines";
owner.moveTarget = "special_choco_machines";
this.machine1.gotoAndStop(3);
}
};
special_choco_machines.onRollOut = (special_choco_machines.onReleaseOutside = function () {
this.machine1.gotoAndStop(2);
});
choco_machines.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.choco_machines);
}
};
choco_machines.onPress = function () {
if (((owner.isTargetReached && (owner.machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines";
owner.calculateAngle(owner.chomac_indicate);
this.pointer._visible = true;
}
};
special_choco_machines.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.special_choco_machines);
}
};
special_choco_machines.onPress = function () {
if (((owner.isTargetReached && (owner.special_machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "special_choco_machines";
owner.calculateAngle(owner.splmn_indicate);
this.pointer._visible = true;
}
};
dusbin.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.dusbin);
}
};
dusbin.onPress = function () {
if ((owner.isTargetReached && (owner.dusbinStatus == "ready")) && (!owner.isPaused)) {
owner.isTargetReached = false;
owner.selectedTarget = "dusbin";
owner.calculateAngle(owner.dusbin_indicate);
this.pointer._visible = true;
}
};
table1.onRelease = (table2.onRelease = (table3.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(this);
}
}));
table1.onPress = (table2.onPress = (table3.onPress = function () {
if ((owner.isTargetReached && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = this._name;
owner.calculateAngle(this);
if (owner.selectedTarget == "table1") {
owner.selectedTable = 1;
} else if (owner.selectedTarget == "table2") {
owner.selectedTable = 2;
} else if (owner.selectedTarget == "table3") {
owner.selectedTable = 3;
}
eval ("owner.orderbook" + owner.selectedTable).pointer._visible = true;
}
}));
}
function LeftNavigation() {
if (chocolate_container._visible) {
if (keyTarget == "type_box") {
chocolate_container.mc.type_round.onRollOver();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_triangle.onRollOver();
}
} else if (special_chocolate_container._visible) {
if (special_chocolate_container.mc.type_rabbit._currentframe == 2) {
special_chocolate_container.mc.type_rabbit.onRollOut();
special_chocolate_container.mc.type_fish.onRollOver();
} else if (special_chocolate_container.mc.type_fish._currentframe == 2) {
special_chocolate_container.mc.type_fish.onRollOut();
special_chocolate_container.mc.type_rabbit.onRollOver();
}
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate2) {
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRollOut();
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRollOver();
}
} else if (keyTarget == "choco_machines") {
choco_machines.onRollOut();
if (table3._visible) {
table3.onRollOver();
} else if (table2._visible) {
table2.onRollOver();
} else if (table1._visible) {
table1.onRollOver();
}
} else if (keyTarget == "special_choco_machines") {
special_choco_machines.onRollOut();
choco_machines.onRollOver();
}
}
function RightNavigation() {
if (chocolate_container._visible) {
if (keyTarget == "type_triangle") {
chocolate_container.mc.type_round.onRollOver();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_box.onRollOver();
}
} else if (special_chocolate_container._visible) {
if (special_chocolate_container.mc.type_rabbit._currentframe == 2) {
special_chocolate_container.mc.type_rabbit.onRollOut();
special_chocolate_container.mc.type_fish.onRollOver();
} else if (special_chocolate_container.mc.type_fish._currentframe == 2) {
special_chocolate_container.mc.type_fish.onRollOut();
special_chocolate_container.mc.type_rabbit.onRollOver();
}
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate1) {
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRollOut();
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRollOver();
}
} else if (keyTarget == undefined) {
choco_machines.onRollOver();
} else if (keyTarget == "choco_machines") {
choco_machines.onRollOut();
special_choco_machines.onRollOver();
} else if (((keyTarget == "table1") || (keyTarget == "table2")) || (keyTarget == "table3")) {
eval ("this." + keyTarget).onRollOut();
choco_machines.onRollOver();
}
}
function UpNavigation() {
if (keyTarget == "table1") {
if (table2._visible) {
table1.onRollOut();
table2.onRollOver();
} else if (table3._visible) {
table1.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "table2") {
if (table3._visible) {
table2.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "dusbin") {
dusbin.onRollOut();
special_choco_machines.onRollOver();
}
}
function DownNavigation() {
if (keyTarget == "table3") {
if (table2._visible) {
table3.onRollOut();
table2.onRollOver();
} else if (table1._visible) {
table3.onRollOut();
table1.onRollOver();
}
} else if (keyTarget == "table2") {
if (table1._visible) {
table2.onRollOut();
table1.onRollOver();
}
} else if (keyTarget == "special_choco_machines") {
special_choco_machines.onRollOut();
dusbin.onRollOver();
}
}
function EnterFunction() {
if (chocolate_container._visible) {
if (keyTarget == "type_triangle") {
chocolate_container.mc.type_triangle.onRelease();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_round.onRelease();
} else if (keyTarget == "type_box") {
chocolate_container.mc.type_box.onRelease();
}
} else if (special_chocolate_container._visible) {
eval ("this.special_chocolate_container.mc." + keyTarget).onRelease();
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate1) {
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRelease();
} else if (keyTarget == _global.preferred_chocolate2) {
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRelease();
}
} else {
eval ("this." + keyTarget).onPress();
}
}
function PauseEnterFunction() {
eval ("this._parent.pauseClip." + pauseTarget).onRelease();
}
function pauseUpNavigation() {
if (pauseTarget == "btn_premium") {
_parent.pauseClip.btn_premium.onRollOut();
_parent.pauseClip.btn_mainmenu.onRollOver();
} else if (pauseTarget == "btn_mainmenu") {
_parent.pauseClip.btn_mainmenu.onRollOut();
_parent.pauseClip.btn_restart.onRollOver();
} else if (pauseTarget == "btn_restart") {
_parent.pauseClip.btn_restart.onRollOut();
_parent.pauseClip.btn_continue.onRollOver();
}
}
function pauseDownNavigation() {
if (pauseTarget == "pause") {
_parent.pauseClip.btn_continue.onRollOver();
} else if (pauseTarget == "btn_continue") {
_parent.pauseClip.btn_continue.onRollOut();
_parent.pauseClip.btn_restart.onRollOver();
} else if (pauseTarget == "btn_restart") {
_parent.pauseClip.btn_restart.onRollOut();
_parent.pauseClip.btn_mainmenu.onRollOver();
} else if (pauseTarget == "btn_mainmenu") {
_parent.pauseClip.btn_mainmenu.onRollOut();
_parent.pauseClip.btn_premium.onRollOver();
}
}
function updateScore() {
scoreClip.score_txt.text = score;
scoreClip.loading.gotoAndStop(score);
if ((score >= 150) && (scoreClip.target._currentframe == 1)) {
scoreClip.target.gotoAndPlay(1);
scoreIndicateClip._visible = true;
scoreIndicateClip.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.target_score_Sound.start();
}
}
if ((score >= 250) && (scoreClip.expert._currentframe == 1)) {
scoreClip.expert.gotoAndPlay(1);
expertScoreClip._visible = true;
expertScoreClip.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.expert_score_Sound.start();
}
}
}
function onEnterFrame() {
var owner = this;
if (((!isPopup) && (!isTargetReached)) && (!owner.isPaused)) {
shopperMovement();
}
if (machineshake == "onn") {
machinespeed = -machinespeed;
choco_machines._x = choco_machines._x + ((1 * machinespeed) / 1.5);
choco_machines._y = choco_machines._y + ((1 * machinespeed) / 1.5);
}
if (specialmachineshake == "onn") {
specialmachinespeed = -specialmachinespeed;
special_choco_machines._x = special_choco_machines._x + ((1 * specialmachinespeed) / 1.5);
special_choco_machines._y = special_choco_machines._y + ((1 * specialmachinespeed) / 1.5);
} else {
special_choco_machines._x = 631;
special_choco_machines._y = 101;
}
_parent.pauseClip.btn_continue.onRollOver = (_parent.pauseClip.btn_restart.onRollOver = (_parent.pauseClip.btn_mainmenu.onRollOver = (_parent.pauseClip.btn_premium.onRollOver = function () {
owner._parent.pauseClip.btn_continue.onRollOut();
owner._parent.pauseClip.btn_restart.onRollOut();
owner._parent.pauseClip.btn_mainmenu.onRollOut();
owner._parent.pauseClip.btn_premium.onRollOut();
owner.pauseTarget = this._name;
this.gotoAndStop(2);
})));
_parent.pauseClip.btn_continue.onRollOut = (_parent.pauseClip.btn_restart.onRollOut = (_parent.pauseClip.btn_mainmenu.onRollOut = (_parent.pauseClip.btn_premium.onRollOut = function () {
this.gotoAndStop(1);
})));
_parent.pauseClip.btn_continue.onRelease = function () {
owner.isPaused = false;
owner.isPopup = false;
owner.btn_pause._visible = true;
owner._parent.pauseClip._visible = false;
owner.CallResume();
};
_parent.pauseClip.btn_restart.onRelease = function () {
owner.Reset();
owner._parent.play();
};
_parent.pauseClip.btn_mainmenu.onRelease = function () {
owner.Reset();
owner._parent.gotoAndStop("mainmenu");
};
_parent.pauseClip.btn_premium.onRelease = function () {
this.getURL(_root.urlname, "_blank");
};
popup_mc.btn_ok.onRollOver = function () {
this.gotoAndStop(2);
};
popup_mc.btn_ok.onRollOut = (popup_mc.btn_ok.onReleaseOutside = function () {
this.gotoAndStop(1);
});
chocolate_container.mc.type_triangle.onRollOver = (chocolate_container.mc.type_round.onRollOver = (chocolate_container.mc.type_box.onRollOver = function () {
if (!owner.isPaused) {
owner.keyTarget = this._name;
owner.chocolate_container.mc.type_triangle.gotoAndStop(1);
owner.chocolate_container.mc.type_round.gotoAndStop(1);
owner.chocolate_container.mc.type_box.gotoAndStop(1);
this.gotoAndStop(2);
}
}));
chocolate_container.mc.type_triangle.onRelease = (chocolate_container.mc.type_round.onRelease = (chocolate_container.mc.type_box.onRelease = function () {
if (!owner.isPaused) {
owner.infoClip._visible = false;
owner.chocolateClip._visible = true;
owner.chocolateClip.gotoAndStop(this._name);
owner.chocolateClip.mc.gotoAndPlay(1);
owner.isTargetReached = true;
owner.preferred_box_chocolate = this._name;
if (owner.choco_machines.status == "empty") {
owner.choco_machines.status = "prepared";
}
owner.preparecnt = 0;
owner.process_interval = setInterval(owner.IdleProcess, 100, owner);
owner.chocolate_container.gotoAndStop(2);
owner.dusbinStatus = "ready";
owner.machineStatus = "ready";
owner.isPopup = false;
owner.machineshake = "onn";
owner.keyTarget = "choco_machines";
if (_global.soundstat == "onn") {
_root.choco_producing_Sound.start();
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
}));
chocolate_container.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.machineStatus = "ready";
owner.chocolate_container._visible = false;
owner.isPopup = false;
owner.dusbinStatus = "ready";
owner.keyTarget = "choco_machines";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
special_chocolate_container.mc.type_rabbit.onRollOver = (special_chocolate_container.mc.type_fish.onRollOver = function () {
if (!owner.isPaused) {
owner.keyTarget = this._name;
owner.special_chocolate_container.mc.type_rabbit.gotoAndStop(1);
owner.special_chocolate_container.mc.type_fish.gotoAndStop(1);
this.gotoAndStop(2);
}
});
special_chocolate_container.mc.type_rabbit.onRelease = (special_chocolate_container.mc.type_fish.onRelease = function () {
if (!owner.isPaused) {
owner.infoClip._visible = false;
owner.specialChocolateClip._visible = true;
owner.specialChocolateClip.gotoAndStop(this._name);
owner.specialChocolateClip.mc.gotoAndPlay(1);
owner.isTargetReached = true;
owner.preferred_special_chocolate = this._name;
if (owner.special_choco_machines.status == "empty") {
owner.special_choco_machines.status = "prepared";
}
owner.spl_preparecnt = 0;
owner.special_process_interval = setInterval(owner.SpecialIdleProcess, 100, owner);
owner.special_chocolate_container.gotoAndStop(2);
owner.dusbinStatus = "ready";
owner.special_machineStatus = "ready";
owner.isPopup = false;
owner.specialmachineshake = "onn";
owner.keyTarget = "special_choco_machines";
if (_global.soundstat == "onn") {
_root.choco_producing_Sound.start();
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
});
special_chocolate_container.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.special_machineStatus = "ready";
owner.special_chocolate_container._visible = false;
owner.isPopup = false;
owner.dusbinStatus = "ready";
owner.keyTarget = "special_choco_machines";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
dusbinContainer.mc.chocobox1.type_triangle.onRollOver = (dusbinContainer.mc.chocobox1.type_round.onRollOver = (dusbinContainer.mc.chocobox1.type_box.onRollOver = (dusbinContainer.mc.chocobox2.type_triangle.onRollOver = (dusbinContainer.mc.chocobox2.type_round.onRollOver = (dusbinContainer.mc.chocobox2.type_box.onRollOver = (dusbinContainer.mc.chocobox1.type_rabbit.onRollOver = (dusbinContainer.mc.chocobox1.type_fish.onRollOver = (dusbinContainer.mc.chocobox2.type_rabbit.onRollOver = (dusbinContainer.mc.chocobox2.type_fish.onRollOver = function () {
owner.keyTarget = this._name;
this.gotoAndStop(2);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onRollOut = (dusbinContainer.mc.chocobox1.type_round.onRollOut = (dusbinContainer.mc.chocobox1.type_box.onRollOut = (dusbinContainer.mc.chocobox2.type_triangle.onRollOut = (dusbinContainer.mc.chocobox2.type_round.onRollOut = (dusbinContainer.mc.chocobox2.type_box.onRollOut = (dusbinContainer.mc.chocobox1.type_rabbit.onRollOut = (dusbinContainer.mc.chocobox1.type_fish.onRollOut = (dusbinContainer.mc.chocobox2.type_rabbit.onRollOut = (dusbinContainer.mc.chocobox2.type_fish.onRollOut = function () {
this.gotoAndStop(1);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_round.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_box.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_triangle.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_round.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_box.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_rabbit.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_fish.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_rabbit.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_fish.onReleaseOutside = function () {
this.gotoAndStop(1);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onRelease = (dusbinContainer.mc.chocobox1.type_round.onRelease = (dusbinContainer.mc.chocobox1.type_box.onRelease = (dusbinContainer.mc.chocobox2.type_triangle.onRelease = (dusbinContainer.mc.chocobox2.type_round.onRelease = (dusbinContainer.mc.chocobox2.type_box.onRelease = (dusbinContainer.mc.chocobox1.type_rabbit.onRelease = (dusbinContainer.mc.chocobox1.type_fish.onRelease = (dusbinContainer.mc.chocobox2.type_rabbit.onRelease = (dusbinContainer.mc.chocobox2.type_fish.onRelease = function () {
if (!owner.isPaused) {
if (this._name == owner.preferred_chocolate1) {
owner.preferred_chocolate1 = owner.preferred_chocolate2;
owner.preferred_chocolate2 = null;
owner.salesGirl.chocolateCount--;
owner.girlwalkframe = owner.girlwalkframe / 2;
owner.salesGirl.girlwalk.gotoAndStop(owner.girlwalkframe);
owner.salesGirl.girlwalk.chocobox1.gotoAndStop(owner.preferred_chocolate1);
owner.salesGirl.girlwalk.chocobox2.gotoAndStop(owner.preferred_chocolate2);
} else {
owner.preferred_chocolate2 = null;
owner.salesGirl.chocolateCount--;
owner.girlwalkframe = owner.girlwalkframe / 2;
owner.salesGirl.girlwalk.gotoAndStop(owner.girlwalkframe);
owner.salesGirl.girlwalk.chocobox1.gotoAndStop(owner.preferred_chocolate1);
owner.salesGirl.girlwalk.chocobox2.gotoAndStop(owner.preferred_chocolate2);
}
owner.dusbinStatus = "ready";
owner.dusbinContainer._visible = false;
owner.isPopup = false;
owner.keyTarget = "dusbin";
owner.setGreenHighLight();
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
})))))))));
dusbinContainer.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.dusbinStatus = "ready";
owner.dusbinContainer._visible = false;
owner.isPopup = false;
owner.keyTarget = "dusbin";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
reportMc.mc.btn_continue.onRelease = function () {
owner.Reset();
_global.calenderfrom = "game";
owner._parent.gotoAndStop("calender");
};
reportMc.mc.btn_menu.onRelease = function () {
owner.Reset();
owner._parent.gotoAndStop("mainmenu");
};
reportMc.mc.btn_retry.onRelease = function () {
owner.Reset();
owner._parent.play();
};
popup_mc.btn_ok.onRelease = function () {
if (owner.popup_info == "welcome") {
owner.combo_bookcnt = 0;
owner.combo_ordercnt = 0;
owner.combo_moneycnt = 0;
owner.customerCount = 0;
owner.moneyCount = 0;
owner.table2._visible = (owner.table3._visible = false);
owner.table1._visible = false;
owner.lobbyArr.length = 0;
owner.lobbyArr = new Array(1, 2, 3);
owner.btn_pause._visible = true;
owner.popupDisable();
var _local1 = owner.getRandom(0, 2);
owner.customerEnterInterval = setInterval(owner.CallCustomer, 2000, owner, owner.lobbyArr[_local1], "younglady");
owner.lobbyArr.splice(_local1, 1);
_local1 = owner.getRandom(0, owner.lobbyArr.length - 1);
owner.customerEnterInterval2 = setInterval(owner.CallCustomer2, 4000, owner, owner.lobbyArr[_local1], "younglady");
owner.lobbyArr.splice(_local1, 1);
owner.isPopup = false;
owner.popup_info = "level2_start";
owner.bg.gotoAndStop(2);
owner.shopopenClip._visible = true;
owner.shopopenClip.gotoAndPlay(1);
owner.ismoveready = true;
owner.machineStatus = "ready";
owner.special_machineStatus = "ready";
owner.dusbinStatus = "ready";
owner.timerClip._visible = true;
clearInterval(owner.gameInterval);
owner.gametimer = 0;
owner.gameInterval = setInterval(owner.GameTimeLimit, 730, owner);
owner.Re_customerEnterInterval = setInterval(owner.CallNewCustomer, 6000, owner);
} else if (owner.popup_info == "order") {
owner.popupDisable();
owner.isPopup = false;
owner.popup_info = "";
owner.selectClip._visible = true;
owner.selectClip._x = owner.choco_machines._x;
owner.selectClip._y = owner.choco_machines._y - 80;
} else if (owner.popup_info == "mismatch") {
owner.popupDisable();
owner.isPopup = false;
}
};
}
function shopperMovement() {
var _local3 = (salesGirl._x + salesGirl.pointer._x) - targetclip._x;
var _local2 = (salesGirl._y + salesGirl.pointer._y) - targetclip._y;
var _local5 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
var _local4 = 10;
if (_local5 >= _local4) {
salesGirl._x = salesGirl._x + (Math.cos(radian) * 12);
salesGirl._y = salesGirl._y + (Math.sin(radian) * 12);
} else if (!isTargetReached) {
isTargetReached = true;
salesGirl.gotoAndStop(targetDirection);
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
Manipulate();
updateScore();
}
}
function GameStart(_arg2) {
clearInterval(_arg2.gamestartInterval);
_arg2.isPopup = true;
_global.popupText = "Select the SPECIALTY CHOCOLATE machine to produce chocolate figures.";
_arg2.ShowPopup(_arg2);
}
function calculateAngle(mc) {
if (!isPopup) {
targetclip = mc;
var x_diff = (eval (mc)._x - (salesGirl._x + salesGirl.pointer._x));
var y_diff = (eval (mc)._y - (salesGirl._y + salesGirl.pointer._y));
radian = Math.atan2(y_diff, x_diff);
if (Math.abs(x_diff) > Math.abs(y_diff)) {
if (x_diff > 0) {
targetDirection = "right";
} else {
targetDirection = "left";
}
} else if (y_diff > 0) {
targetDirection = "down";
} else {
targetDirection = "up";
}
if (curtarget != selectedTarget) {
curtarget = selectedTarget;
salesGirl.gotoAndStop(targetDirection);
salesGirl.girlwalk.gotoAndStop(girlwalkframe - 1);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
}
}
}
function ShowPopup(_arg1) {
clearInterval(_arg1.popup_interval);
_arg1.isPopup = true;
_arg1.popup_mc._visible = true;
_arg1.popup_mc.swapDepths(_arg1.getNextHighestDepth());
_arg1.popup_mc.gotoAndPlay(1);
}
function popupDisable() {
popup_mc.gotoAndStop(1);
popup_mc._visible = false;
}
function CallNewCustomer(_arg1) {
if (!_arg1.isGameOver) {
if ((_arg1.customerCount != 0) && (_arg1.moneyCount != 0)) {
_arg1.CallNextCustomerSet();
}
} else {
clearInterval(_arg1.Re_customerEnterInterval);
}
}
function CallCustomer(_arg2, _arg3, _arg4) {
if (!_arg2.isPaused) {
clearInterval(_arg2.customerEnterInterval);
if (!_arg2.isGameOver) {
_arg2.customerEnter(_arg3, _arg4);
var _local1 = 0;
while (_local1 < _arg2.lobbyArr.length) {
if (_arg2.lobbyArr[_local1] == _arg3) {
_arg2.lobbyArr.splice(_local1, 1);
}
_local1++;
}
} else if ((_arg2.customerCount == 0) && (_arg2.moneyCount == 0)) {
_arg2.callResult();
}
}
}
function CallCustomer2(_arg2, _arg3, _arg4) {
if (!_arg2.isPaused) {
clearInterval(_arg2.customerEnterInterval2);
if (!_arg2.isGameOver) {
_arg2.customerEnter(_arg3, _arg4);
var _local1 = 0;
while (_local1 < _arg2.lobbyArr.length) {
if (_arg2.lobbyArr[_local1] == _arg3) {
_arg2.lobbyArr.splice(_local1, 1);
}
_local1++;
}
} else if ((_arg2.customerCount == 0) && (_arg2.moneyCount == 0)) {
_arg2.callResult();
}
}
}
function CallCustomer3(_arg2, _arg3, _arg4) {
if (!_arg2.isPaused) {
clearInterval(_arg2.customerEnterInterval3);
if (!_arg2.isGameOver) {
_arg2.customerEnter(_arg3, _arg4);
var _local1 = 0;
while (_local1 < _arg2.lobbyArr.length) {
if (_arg2.lobbyArr[_local1] == _arg3) {
_arg2.lobbyArr.splice(_local1, 1);
}
_local1++;
}
} else if ((_arg2.customerCount == 0) && (_arg2.moneyCount == 0)) {
_arg2.callResult();
}
}
}
function Re_CallCustomer(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.Re_customerEnterInterval);
if (!_arg1.isGameOver) {
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function customerEnter(_arg3, _arg2) {
if (_arg3 == 1) {
table1._visible = true;
customer1 = attachMovie(_arg2, "customer1", depthArr[_arg3 - 1], {_x:115, _y:356});
orderbook1 = attachMovie("orderbook", "orderbook1", getNextHighestDepth(), {_x:170, _y:374});
orderbook1.type = "book";
customer1.type = _arg2;
orderbook1.heatcnt = 0;
if (_arg2 == "oldlady") {
orderbook1.heatInterval = setInterval(HeatFunction, 600, orderbook1, this, 1);
} else if (_arg2 == "younglady") {
orderbook1.heatInterval = setInterval(HeatFunction, 300, orderbook1, this, 1);
}
} else if (_arg3 == 2) {
table2._visible = true;
customer2 = attachMovie(_arg2, "customer2", depthArr[_arg3 - 1], {_x:119, _y:235});
orderbook2 = attachMovie("orderbook", "orderbook2", getNextHighestDepth(), {_x:177, _y:278});
orderbook2.type = "book";
customer2.type = _arg2;
orderbook2.heatcnt = 0;
if (_arg2 == "oldlady") {
orderbook2.heatInterval = setInterval(HeatFunction, 600, orderbook2, this, 2);
} else if (_arg2 == "younglady") {
orderbook2.heatInterval = setInterval(HeatFunction, 300, orderbook2, this, 2);
}
} else if (_arg3 == 3) {
table3._visible = true;
customer3 = attachMovie(_arg2, "customer3", depthArr[_arg3 - 1], {_x:127, _y:140});
orderbook3 = attachMovie("orderbook", "orderbook3", getNextHighestDepth(), {_x:184, _y:185});
orderbook3.type = "book";
customer3.type = _arg2;
orderbook3.heatcnt = 0;
if (_arg2 == "oldlady") {
orderbook3.heatInterval = setInterval(HeatFunction, 600, orderbook3, this, 3);
} else if (_arg2 == "younglady") {
orderbook3.heatInterval = setInterval(HeatFunction, 300, orderbook3, this, 3);
}
}
customerCount++;
moneyCount++;
salesGirl.swapDepths(getNextHighestDepth());
scoreIndicateClip.swapDepths(getNextHighestDepth());
expertScoreClip.swapDepths(getNextHighestDepth());
chocolate_container.swapDepths(getNextHighestDepth());
special_chocolate_container.swapDepths(getNextHighestDepth());
dusbinContainer.swapDepths(getNextHighestDepth());
comboClip.swapDepths(getNextHighestDepth());
reportMc.swapDepths(getNextHighestDepth());
}
function Manipulate() {
var owner = this;
if (selectedTarget == "choco_machines") {
choco_machines.pointer._visible = false;
if (choco_machines.status == "empty") {
if (owner.salesGirl.chocolateCount < 3) {
chocolate_container._visible = true;
chocolate_container.gotoAndStop(1);
chocolate_container.mc.gotoAndPlay(1);
machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
keyTarget = "type_round";
}
} else if (choco_machines.status == "chocolateReady") {
if (owner.salesGirl.chocolateCount < 2) {
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = owner.preferred_box_chocolate;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = owner.preferred_box_chocolate;
}
owner.salesGirl.chocolateCount++;
chocolateClip._visible = false;
salesGirl.gotoAndStop(2);
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
choco_machines.status = "empty";
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
if (orderbook1.book_mc._currentframe == 74) {
orderbook1.green_highlight._visible = true;
}
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
if (orderbook2.book_mc._currentframe == 74) {
orderbook2.green_highlight._visible = true;
}
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
if (orderbook3.book_mc._currentframe == 74) {
orderbook3.green_highlight._visible = true;
}
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (selectedTarget == "special_choco_machines") {
special_choco_machines.pointer._visible = false;
if (special_choco_machines.status == "empty") {
if (owner.salesGirl.chocolateCount < 3) {
special_chocolate_container._visible = true;
special_chocolate_container.gotoAndStop(1);
special_chocolate_container.mc.gotoAndPlay(1);
special_machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
keyTarget = "type_rabbit";
}
} else if (special_choco_machines.status == "chocolateReady") {
if (owner.salesGirl.chocolateCount < 2) {
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = owner.preferred_special_chocolate;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = owner.preferred_special_chocolate;
}
owner.salesGirl.chocolateCount++;
specialChocolateClip._visible = false;
salesGirl.gotoAndStop(2);
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
special_choco_machines.status = "empty";
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (selectedTarget == "dusbin") {
dusbin.pointer._visible = false;
if (salesGirl.chocolateCount == 1) {
salesGirl.chocolateCount--;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
preferred_chocolate1 = null;
preferred_chocolate2 = null;
owner.setGreenHighLight();
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
} else if (salesGirl.chocolateCount >= 2) {
dusbinStatus = "notready";
isPopup = true;
_global.preferred_chocolate1 = preferred_chocolate1;
_global.preferred_chocolate2 = preferred_chocolate2;
keyTarget = _global.preferred_chocolate1;
dusbinContainer._visible = true;
dusbinContainer.gotoAndStop(1);
dusbinContainer.mc.gotoAndPlay(1);
}
} else if (((selectedTarget == "table1") || (selectedTarget == "table2")) || (selectedTarget == "table3")) {
eval ("this.orderbook" + selectedTable).pointer._visible = false;
if (eval ("this.orderbook" + selectedTable).type == "book") {
combo_bookcnt++;
combo_ordercnt = 0;
combo_moneycnt = 0;
eval ("this.orderbook" + selectedTable).type = "chocolateOrder";
var randomno = owner.getRandom(0, 4);
if (!isspchoco) {
trace("firsttime");
isspchoco = true;
if (combo_bookcnt == 1) {
eval ("this.orderbook" + selectedTable).neededchocolate = chocolateTypeArr[3];
eval ("this.customer" + selectedTable).neededchocolate = chocolateTypeArr[3];
} else {
eval ("this.orderbook" + selectedTable).neededchocolate = chocolateTypeArr[0];
eval ("this.customer" + selectedTable).neededchocolate = chocolateTypeArr[0];
}
} else {
eval ("this.orderbook" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.customer" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
}
eval ("this.orderbook" + selectedTable).gotoAndStop(2);
eval ("this.customer" + selectedTable).gotoAndStop(3);
eval ("this.orderbook" + selectedTable).green_highlight._visible = false;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
var heatcntchange = int(eval ("this.orderbook" + selectedTable).heatcnt / 4);
if (heatcntchange > 1) {
eval ("this.orderbook" + selectedTable).heatcnt = heatcntchange;
} else {
eval ("this.orderbook" + selectedTable).heatcnt = 1;
}
CheckForBookCombo();
} else if (eval ("this.orderbook" + selectedTable).type == "chocolateOrder") {
if ((salesGirl.chocolateCount >= 1) && (eval ("this.orderbook" + selectedTable).book_mc._currentframe >= 74)) {
combo_bookcnt = 0;
combo_moneycnt = 0;
if (eval ("owner.customer" + owner.selectedTable).neededchocolate == owner.preferred_chocolate1) {
combo_ordercnt++;
preferred_chocolate1 = preferred_chocolate2;
preferred_chocolate2 = null;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
eval ("this.orderbook" + selectedTable).type = "money";
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable).gotoAndStop(3);
eval ("this.customer" + selectedTable).gotoAndStop(5);
if ((eval ("this.orderbook" + selectedTable).heatcnt > 60) && (eval ("this.orderbook" + selectedTable).heatcnt <= 100)) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(2);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
} else if (eval ("this.orderbook" + selectedTable).heatcnt > 100) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(3);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
eval ("this.orderbook" + selectedTable).highlight_small._visible = false;
}
clearInterval(eval ("this.orderbook" + selectedTable).heatInterval);
CheckForOrderCombo();
customerCount--;
if (salesGirl.chocolateCount == 1) {
preferred_chocolate1 = null;
}
salesGirl.chocolateCount--;
owner.setGreenHighLight();
if (_global.soundstat == "onn") {
_root.customer_happy_Sound.start();
}
if (!isGameOver) {
CallNextCustomerSet();
}
} else if (eval ("owner.customer" + owner.selectedTable).neededchocolate == owner.preferred_chocolate2) {
combo_ordercnt++;
salesGirl.chocolateCount--;
preferred_chocolate2 = null;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
eval ("this.orderbook" + selectedTable).type = "money";
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable).gotoAndStop(3);
eval ("this.customer" + selectedTable).gotoAndStop(5);
if ((eval ("this.orderbook" + selectedTable).heatcnt > 60) && (eval ("this.orderbook" + selectedTable).heatcnt <= 100)) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(2);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
} else if (eval ("this.orderbook" + selectedTable).heatcnt > 100) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(3);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
eval ("this.orderbook" + selectedTable).highlight_small._visible = false;
}
clearInterval(eval ("this.orderbook" + selectedTable).heatInterval);
CheckForOrderCombo();
customerCount--;
owner.setGreenHighLight();
if (_global.soundstat == "onn") {
_root.customer_happy_Sound.start();
}
if (!isGameOver) {
CallNextCustomerSet();
}
}
}
} else if (eval ("this.orderbook" + selectedTable).type == "money") {
combo_bookcnt = 0;
combo_ordercnt = 0;
combo_moneycnt++;
moneyCount--;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(2);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable)._visible = false;
eval ("this.customer" + selectedTable)._visible = false;
eval ("this.table" + selectedTable)._visible = false;
eval ("this.orderbook" + selectedTable).type = "empty";
CheckForMoneyCombo();
lobbyArr.push(selectedTable);
if ((customerCount == 0) && (moneyCount == 0)) {
if (!isGameOver) {
if (lobbyArr.length == 3) {
customerCount = 0;
moneyCount = 0;
owner.table2._visible = (owner.table3._visible = false);
owner.table1._visible = false;
CallNextCustomerSet();
}
} else {
callResult();
}
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
}
function CallNextCustomerSet() {
var _local2 = this;
clearInterval(_local2.customerEnterInterval);
clearInterval(_local2.customerEnterInterval2);
clearInterval(_local2.customerEnterInterval3);
if (lobbyArr.length == 1) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 2000, _local2, _local2.lobbyArr[_local3], "younglady");
var _local5 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local2.lobbyArr.push(_local5);
} else if (lobbyArr.length == 2) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 100, _local2, _local2.lobbyArr[_local3], "younglady");
var _local5 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 2000, _local2, _local2.lobbyArr[_local3], "younglady");
var _local6 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local2.lobbyArr.push(_local5);
_local2.lobbyArr.push(_local6);
} else if (lobbyArr.length == 3) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 1000, _local2, _local2.lobbyArr[_local3], "younglady");
var _local5 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 3000, _local2, _local2.lobbyArr[_local3], "younglady");
var _local6 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local2.customerEnterInterval3 = setInterval(_local2.CallCustomer3, 4500, _local2, _local2.lobbyArr[_local3], "younglady");
var _local4 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local2.lobbyArr.push(_local5);
_local2.lobbyArr.push(_local6);
_local2.lobbyArr.push(_local4);
}
}
function setGreenHighLight() {
if (orderbook1.book_mc._currentframe >= 74) {
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
} else {
orderbook1.green_highlight._visible = false;
}
}
if (orderbook2.book_mc._currentframe >= 74) {
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
} else {
orderbook2.green_highlight._visible = false;
}
}
if (orderbook3.book_mc._currentframe >= 74) {
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
} else {
orderbook3.green_highlight._visible = false;
}
}
}
function callResult() {
clearInterval(customerEnterInterval);
clearInterval(customerEnterInterval2);
clearInterval(customerEnterInterval3);
clearInterval(Re_customerEnterInterval);
clearInterval(reportInterval);
clearInterval(orderbook1.heatInterval);
clearInterval(orderbook2.heatInterval);
clearInterval(orderbook3.heatInterval);
machineStatus = "notready";
special_machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
_global.report_moneyEarned = score;
_global.report_tips = tips;
_global.targetScore = 150;
_global.expertScore = 250;
btn_pause._visible = false;
dusbinStatus = "notready";
score = score + tips;
if (score < 150) {
reportMc._visible = true;
reportMc.gotoAndStop(2);
reportMc.mc.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.level_failed_Sound.start();
}
} else {
if (_global.soundstat == "onn") {
_root.level_complete_Sound.start();
}
if (_global.levelSelected < 4) {
_global.levelSelected = 4;
}
if (_global.levelFinished <= 3) {
_global.levelFinished = 3;
}
if (score >= 250) {
_global.level3Status = "expert";
} else {
_global.level3Status = "target";
}
_global.level3Score = score;
if (((score >= 150) && (scoreClip.target._currentframe == 1)) || ((score >= 250) && (scoreClip.expert._currentframe == 1))) {
reportInterval = setInterval(CallReport, 2300, this);
} else {
reportMc._visible = true;
reportMc.gotoAndStop(1);
reportMc.mc.gotoAndPlay(2);
}
}
}
function CallReport(_arg1) {
clearInterval(_arg1.reportInterval);
_arg1.reportMc._visible = true;
_arg1.reportMc.gotoAndStop(1);
_arg1.reportMc.mc.gotoAndPlay(2);
}
function HeatFunction(owner, myparent, curpoint) {
if (!myparent.isPaused) {
owner.heatcnt++;
owner.timelimit.gotoAndStop(owner.heatcnt);
if (owner.heatcnt == 100) {
eval ("myparent.customer" + curpoint).gotoAndStop(4);
}
if (owner.heatcnt >= 120) {
clearInterval(owner.heatInterval);
eval ("myparent.customer" + curpoint).gotoAndStop(6);
myparent.moneyCount--;
myparent.customerCount--;
eval ("myparent.orderbook" + curpoint)._visible = false;
eval ("myparent.table" + curpoint)._visible = false;
if (eval ("myparent.customer" + curpoint).type == "oldlady") {
if (myparent.score > 0) {
myparent.curScoreClip._visible = true;
myparent.curScoreClip.gotoAndPlay(1);
if ((myparent.score >= 2) && (myparent.score < 10)) {
myparent.score = myparent.score - 2;
myparent.curScoreClip.disp.score.text = -2;
} else if (myparent.score >= 10) {
myparent.score = myparent.score - 10;
myparent.curScoreClip.disp.score.text = -10;
}
myparent.scoreClip.score_txt.text = myparent.score;
myparent.scoreClip.loading.gotoAndStop(myparent.score);
}
} else if (eval ("myparent.customer" + curpoint).type == "younglady") {
if (myparent.score > 0) {
myparent.curScoreClip._visible = true;
myparent.curScoreClip.gotoAndPlay(1);
if ((myparent.score >= 2) && (myparent.score < 15)) {
myparent.score = myparent.score - 2;
myparent.curScoreClip.disp.score.text = -2;
} else if (myparent.score >= 15) {
myparent.score = myparent.score - 15;
myparent.curScoreClip.disp.score.text = -15;
}
myparent.scoreClip.score_txt.text = myparent.score;
myparent.scoreClip.loading.gotoAndStop(myparent.score);
}
}
eval ("myparent.orderbook" + curpoint).type = "empty";
myparent.lobbyArr.push(curpoint);
if ((myparent.customerCount == 0) && (myparent.moneyCount == 0)) {
if (!myparent.isGameOver) {
myparent.CallNextCustomerSet();
} else {
myparent.callResult();
}
}
}
}
}
function GameTimeLimit(_arg1) {
if (!_arg1.isPaused) {
_arg1.gametimer++;
_arg1.timerClip.gotoAndStop(_arg1.gametimer);
if (_arg1.gametimer >= 90) {
_arg1.isGameOver = true;
_arg1.bg.gotoAndStop(1);
_arg1.shopclosedClip._visible = true;
_arg1.shopclosedClip.gotoAndPlay(1);
_arg1.gametimer = 0;
clearInterval(_arg1.gameInterval);
}
}
}
function CheckForBookCombo() {
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_bookcnt >= 2) {
comboClip._x = eval ("this.customer" + selectedTable)._x - 20;
comboClip._y = eval ("this.customer" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_bookcnt);
comboClip.combo.gotoAndPlay(1);
score = score + 4;
curScoreClip.disp.score.text = 4;
tips = tips + 4;
} else {
score = score + 2;
curScoreClip.disp.score.text = 2;
tips = tips + 2;
}
if (_global.soundstat == "onn") {
eval (("_root.combo" + combo_bookcnt) + "_Sound").start();
}
}
function CheckForOrderCombo() {
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_ordercnt >= 2) {
comboClip._x = eval ("this.customer" + selectedTable)._x - 20;
comboClip._y = eval ("this.customer" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_ordercnt);
comboClip.combo.gotoAndPlay(1);
score = score + 20;
curScoreClip.disp.score.text = 20;
} else {
score = score + 10;
curScoreClip.disp.score.text = 10;
}
if (_global.soundstat == "onn") {
eval (("_root.combo" + combo_ordercnt) + "_Sound").start();
}
}
function CheckForMoneyCombo() {
if (_global.soundstat == "onn") {
eval (("_root.money" + combo_moneycnt) + "_Sound").start();
}
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_moneycnt >= 2) {
comboClip._x = eval ("this.orderbook" + selectedTable)._x - 20;
comboClip._y = eval ("this.orderbook" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_moneycnt);
comboClip.combo.gotoAndPlay(1);
if (eval ("this.orderbook" + selectedTable).neededchocolate == "type_rabbit") {
score = score + (combo_moneycnt * 30);
curScoreClip.disp.score.text = combo_moneycnt * 30;
} else if (eval ("this.customer" + selectedTable).type == "oldlady") {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + (combo_moneycnt * 17);
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + (combo_moneycnt * 14);
curScoreClip.disp.score.text = combo_moneycnt * 14;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + (combo_moneycnt * 11);
curScoreClip.disp.score.text = combo_moneycnt * 11;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + (combo_moneycnt * 10);
curScoreClip.disp.score.text = combo_moneycnt * 10;
}
} else {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + (combo_moneycnt * 24);
curScoreClip.disp.score.text = combo_moneycnt * 24;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + (combo_moneycnt * 21);
curScoreClip.disp.score.text = combo_moneycnt * 21;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + (combo_moneycnt * 17);
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + (combo_moneycnt * 15);
curScoreClip.disp.score.text = combo_moneycnt * 15;
}
}
if (!isGameOver) {
CallNextCustomerSet();
}
} else if (eval ("this.customer" + selectedTable).type == "oldlady") {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + 17;
curScoreClip.disp.score.text = 17;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + 14;
curScoreClip.disp.score.text = 14;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + 11;
curScoreClip.disp.score.text = 11;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + 10;
curScoreClip.disp.score.text = 10;
}
} else {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + 24;
curScoreClip.disp.score.text = combo_moneycnt * 24;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + 21;
curScoreClip.disp.score.text = combo_moneycnt * 21;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + 17;
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + 15;
curScoreClip.disp.score.text = combo_moneycnt * 15;
}
}
}
function IdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.preparecnt++;
if (_arg3.preparecnt >= 20) {
clearInterval(_arg3.process_interval);
_arg3.machineStatus = "ready";
_arg3.machineshake = "off";
if (_arg3.choco_machines.status == "prepared") {
_arg3.choco_machines.status = "chocolateReady";
}
if (_global.soundstat == "onn") {
_root.choco_done_Sound.start();
}
}
}
}
function SpecialIdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.spl_preparecnt++;
if (_arg3.spl_preparecnt >= 40) {
clearInterval(_arg3.special_process_interval);
_arg3.special_machineStatus = "ready";
_arg3.specialmachineshake = "off";
if (_arg3.special_choco_machines.status == "prepared") {
_arg3.special_choco_machines.status = "chocolateReady";
}
if (_global.soundstat == "onn") {
_root.choco_done_Sound.start();
}
}
}
}
function getRandom(_arg4, _arg5) {
var _local3 = _arg5 - _arg4;
var _local2 = Math.random() * _local3;
var _local1 = Math.round(_local2);
_local1 = _local1 + _arg4;
return(_local1);
}
function StoreInSequence() {
var owner = this;
eval ("this." + moveTarget).onRelease();
}
function CallSequence() {
var owner = this;
if (sequenceArr[0] == choco_machines) {
if (((owner.isTargetReached && (owner.machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines";
owner.calculateAngle(owner.chomac_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == special_choco_machines) {
if (((owner.isTargetReached && (owner.special_machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "special_choco_machines";
owner.calculateAngle(owner.splmn_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == dusbin) {
if ((owner.isTargetReached && (owner.dusbinStatus == "ready")) && (!owner.isPaused)) {
owner.isTargetReached = false;
owner.selectedTarget = "dusbin";
owner.calculateAngle(owner.dusbin_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (((sequenceArr[0] == table1) || (sequenceArr[0] == table2)) || (sequenceArr[0] == table3)) {
if ((owner.isTargetReached && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = sequenceArr[0]._name;
owner.calculateAngle(sequenceArr[0]);
if (owner.selectedTarget == "table1") {
owner.selectedTable = 1;
} else if (owner.selectedTarget == "table2") {
owner.selectedTable = 2;
} else if (owner.selectedTarget == "table3") {
owner.selectedTable = 3;
}
eval ("owner.orderbook" + owner.selectedTable).pointer._visible = true;
}
}
}
function CallPause() {
var _local2 = this;
stopAllSounds();
_local2.bg.blink.gotoAndStop(_local2.bg.blink._currentframe);
_local2.customer1.customer.gotoAndStop(_local2.customer1.customer._currentframe);
_local2.customer2.customer.gotoAndStop(_local2.customer2.customer._currentframe);
_local2.customer3.customer.gotoAndStop(_local2.customer3.customer._currentframe);
_local2.special_choco_machines.machine1.blink.gotoAndStop(_local2.special_choco_machines.machine1.blink._currentframe);
_local2.choco_machines.single_machine.blink.gotoAndStop(_local2.choco_machines.single_machine.blink._currentframe);
_local2.salesGirl.coffeeicon.smoke.gotoAndStop(_local2.salesGirl.coffeeicon.smoke._currentframe);
_local2.customer4.customer.gotoAndStop(_local2.customer4.customer._currentframe);
_local2.coin_Anim1.coin.gotoAndStop(_local2.coin_Anim1.coin._currentframe);
_local2.coin_Anim2.coin.gotoAndStop(_local2.coin_Anim2.coin._currentframe);
_local2.coin_Anim3.coin.gotoAndStop(_local2.coin_Anim3.coin._currentframe);
_local2.coin_Anim4.coin.gotoAndStop(_local2.coin_Anim4.coin._currentframe);
_local2.comboClip.combo.gotoAndStop(_local2.comboClip.combo._currentframe);
_local2.orderbook1.heartinClip.gotoAndStop(_local2.orderbook1.heartinClip._currentframe);
_local2.orderbook2.heartinClip.gotoAndStop(_local2.orderbook2.heartinClip._currentframe);
_local2.orderbook3.heartinClip.gotoAndStop(_local2.orderbook3.heartinClip._currentframe);
_local2.orderbook4.heartinClip.gotoAndStop(_local2.orderbook4.heartinClip._currentframe);
_local2.curScoreClip.gotoAndStop(_local2.curScoreClip._currentframe);
_local2.coin_Anim1.coin.coin_rotate.gotoAndStop(_local2.coin_Anim1.coin.coin_rotate._currentframe);
_local2.coin_Anim1.coin.coin_rotate2.gotoAndStop(_local2.coin_Anim1.coin.coin_rotate2._currentframe);
_local2.coin_Anim1.coin.coin_rotate3.gotoAndStop(_local2.coin_Anim1.coin.coin_rotate3._currentframe);
_local2.coin_Anim1.coin.coin_rotate4.gotoAndStop(_local2.coin_Anim1.coin.coin_rotate4._currentframe);
_local2.coin_Anim2.coin.coin_rotate.gotoAndStop(_local2.coin_Anim2.coin.coin_rotate._currentframe);
_local2.coin_Anim2.coin.coin_rotate2.gotoAndStop(_local2.coin_Anim2.coin.coin_rotate2._currentframe);
_local2.coin_Anim2.coin.coin_rotate3.gotoAndStop(_local2.coin_Anim2.coin.coin_rotate3._currentframe);
_local2.coin_Anim2.coin.coin_rotate4.gotoAndStop(_local2.coin_Anim2.coin.coin_rotate4._currentframe);
_local2.coin_Anim3.coin.coin_rotate.gotoAndStop(_local2.coin_Anim3.coin.coin_rotate._currentframe);
_local2.coin_Anim3.coin.coin_rotate2.gotoAndStop(_local2.coin_Anim3.coin.coin_rotate2._currentframe);
_local2.coin_Anim3.coin.coin_rotate3.gotoAndStop(_local2.coin_Anim3.coin.coin_rotate3._currentframe);
_local2.coin_Anim3.coin.coin_rotate4.gotoAndStop(_local2.coin_Anim3.coin.coin_rotate4._currentframe);
_local2.coin_Anim4.coin.coin_rotate.gotoAndStop(_local2.coin_Anim4.coin.coin_rotate._currentframe);
_local2.coin_Anim4.coin.coin_rotate2.gotoAndStop(_local2.coin_Anim4.coin.coin_rotate2._currentframe);
_local2.coin_Anim4.coin.coin_rotate3.gotoAndStop(_local2.coin_Anim4.coin.coin_rotate3._currentframe);
_local2.coin_Anim4.coin.coin_rotate4.gotoAndStop(_local2.coin_Anim4.coin.coin_rotate4._currentframe);
_local2.comboClip.combo.coin_rotate.gotoAndStop(_local2.comboClip.combo.coin_rotate._currentframe);
if (_local2.scoreIndicateClip._visible) {
_local2.scoreIndicateClip.gotoAndStop(_local2.scoreIndicateClip._currentframe);
}
if (_local2.expertScoreClip._visible) {
_local2.expertScoreClip.gotoAndStop(_local2.expertScoreClip._currentframe);
}
_local2.chocolateClip.mc.gotoAndStop(_local2.chocolateClip.mc._currentframe);
_local2.specialChocolateClip.mc.gotoAndStop(_local2.specialChocolateClip.mc._currentframe);
}
function CallResume() {
var _local4 = this;
if (_global.soundstat == "onn") {
_root.gameSound.start();
}
_local4.bg.blink.gotoAndPlay(_local4.bg.blink._currentframe);
_local4.customer1.customer.gotoAndPlay(_local4.customer1.customer._currentframe);
_local4.customer2.customer.gotoAndPlay(_local4.customer2.customer._currentframe);
_local4.customer3.customer.gotoAndPlay(_local4.customer3.customer._currentframe);
_local4.special_choco_machines.machine1.blink.gotoAndPlay(_local4.special_choco_machines.machine1.blink._currentframe);
_local4.choco_machines.single_machine.blink.gotoAndPlay(_local4.choco_machines.single_machine.blink._currentframe);
_local4.salesGirl.coffeeicon.smoke.gotoAndPlay(_local4.salesGirl.coffeeicon.smoke._currentframe);
_local4.customer4.customer.gotoAndPlay(_local4.customer4.customer._currentframe);
_local4.coin_Anim1.coin.gotoAndPlay(_local4.coin_Anim1.coin._currentframe - 1);
_local4.coin_Anim2.coin.gotoAndPlay(_local4.coin_Anim2.coin._currentframe - 1);
_local4.coin_Anim3.coin.gotoAndPlay(_local4.coin_Anim3.coin._currentframe - 1);
_local4.coin_Anim4.coin.gotoAndPlay(_local4.coin_Anim4.coin._currentframe - 1);
_local4.comboClip.combo.gotoAndPlay(_local4.comboClip.combo._currentframe - 1);
_local4.orderbook1.heartinClip.gotoAndPlay(_local4.orderbook1.heartinClip._currentframe - 1);
_local4.orderbook2.heartinClip.gotoAndPlay(_local4.orderbook2.heartinClip._currentframe - 1);
_local4.orderbook3.heartinClip.gotoAndPlay(_local4.orderbook3.heartinClip._currentframe - 1);
_local4.orderbook4.heartinClip.gotoAndPlay(_local4.orderbook4.heartinClip._currentframe - 1);
_local4.curScoreClip.gotoAndPlay(_local4.curScoreClip._currentframe);
_local4.coin_Anim1.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate._currentframe);
_local4.coin_Anim1.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate2._currentframe);
_local4.coin_Anim1.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate3._currentframe);
_local4.coin_Anim1.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate4._currentframe);
_local4.coin_Anim2.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate._currentframe);
_local4.coin_Anim2.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate2._currentframe);
_local4.coin_Anim2.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate3._currentframe);
_local4.coin_Anim2.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate4._currentframe);
_local4.coin_Anim3.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate._currentframe);
_local4.coin_Anim3.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate2._currentframe);
_local4.coin_Anim3.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate3._currentframe);
_local4.coin_Anim3.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate4._currentframe);
_local4.coin_Anim4.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate._currentframe);
_local4.coin_Anim4.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate2._currentframe);
_local4.coin_Anim4.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate3._currentframe);
_local4.coin_Anim4.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate4._currentframe);
_local4.comboClip.combo.coin_rotate.gotoAndPlay(_local4.comboClip.combo.coin_rotate._currentframe);
if (_local4.scoreIndicateClip._visible) {
_local4.scoreIndicateClip.gotoAndPlay(_local4.scoreIndicateClip._currentframe - 1);
}
if (_local4.expertScoreClip._visible) {
_local4.expertScoreClip.gotoAndPlay(_local4.expertScoreClip._currentframe - 1);
}
_local4.chocolateClip.mc.gotoAndPlay(_local4.chocolateClip.mc._currentframe - 1);
_local4.specialChocolateClip.mc.gotoAndPlay(_local4.specialChocolateClip.mc._currentframe - 1);
}
function ObjectsRollOut() {
table1.onRollOut();
table2.onRollOut();
table3.onRollOut();
choco_machines.onRollOut();
dusbin.onRollOut();
special_choco_machines.onRollOut();
}
function Reset() {
targetclip = "table1";
lobbyArr.length = 0;
lobbyArr = new Array(1, 2, 3);
currentDirection = "down";
targetDirection = "";
isPopup = false;
popup_info = "welcome";
clearInterval(popup_interval);
clearInterval(special_process_interval);
clearInterval(process_interval);
popup_interval = -1;
isTargetReached = true;
selectedTarget = "";
orderno = 0;
score = 0;
ismoveready = false;
orderTaken = 0;
customerCount = 0;
machineStatus = "notready";
dusbinStatus = "notready";
girlwalkframe = 2;
isFirstServeFinished = false;
depthArr.length = 0;
depthArr = new Array(-10313, -10315, -10317);
chocolateTypeArr.length = 0;
chocolateTypeArr = new Array("type_triangle", "type_fish", "type_round", "type_rabbit", "type_box");
customerEnterset = "firstset";
moneyCount = 0;
clearInterval(gameInterval);
gametimer = 0;
isGameOver = false;
combo_bookcnt = 0;
combo_ordercnt = 0;
combo_moneycnt = 0;
curtarget = "";
clearInterval(customerEnterInterval);
clearInterval(customerEnterInterval2);
clearInterval(customerEnterInterval3);
clearInterval(Re_customerEnterInterval);
clearInterval(reportInterval);
clearInterval(orderbook1.heatInterval);
clearInterval(orderbook2.heatInterval);
clearInterval(orderbook3.heatInterval);
isPaused = false;
sequenceArr.length = 0;
sequenceArr = new Array();
Key.removeListener(keylistener);
Key.removeListener(leve3Keyobj);
keyTarget = undefined;
isspchoco = false;
}
var targetclip = "table1";
var lobbyArr = new Array(1, 2, 3);
var currentDirection = "down";
var isPopup = false;
var popup_info = "welcome";
var popup_interval = -1;
var process_interval = -1;
var special_process_interval = -1;
var isTargetReached = true;
var selectedTarget = "";
var orderno = 0;
var ismoveready = false;
var orderTaken = 0;
var customerCount = 0;
var machineStatus = "notready";
var special_machineStatus = "notready";
var dusbinStatus = "notready";
var girlwalkframe = 2;
var isFirstServeFinished = false;
var score = 0;
var depthArr = new Array(-10313, -10315, -10317);
var chocolateTypeArr = new Array("type_triangle", "type_fish", "type_round", "type_rabbit", "type_box");
var customerEnterset = "firstset";
var moneyCount = 0;
var gameInterval = -1;
var gametimer = 0;
var isGameOver = false;
var combo_bookcnt = 0;
var combo_ordercnt = 0;
var combo_moneycnt = 0;
var gamestartInterval = -1;
var curtarget = "";
var customerEnterInterval = -1;
var customerEnterInterval2 = -1;
var customerEnterInterval3 = -1;
var reportInterval = -1;
var isPaused = false;
var machinespeed = 1;
var specialmachinespeed = 1;
var machineshake = "off";
var specialmachineshake = "off";
var sequenceArr = new Array();
var tips = 0;
var Re_customerEnterInterval = -1;
var isspchoco = false;
var preparecnt = 0;
var spl_preparecnt = 0;
}
Symbol 1701 MovieClip [__Packages.Level4] Frame 0
class Level4 extends MovieClip
{
var salesGirl, btn_pause, _parent, choco_machines, special_choco_machines, scoreIndicateClip, shopclosedClip, timerClip, chocolate_container, special_chocolate_container, coffeeClip, chocolateClip, phone_mc, popup_mc, selectClip, coffee_machine, heartinClip, shopopenClip, reportMc, cancel_mc, infoClip, comboClip, dusbinContainer, curScoreClip, specialChocolateClip, expertScoreClip, table3, table2, table1, coin_Anim3, coin_Anim2, coin_Anim1, dusbin, leve4Keyobj, keyTarget, pauseTarget, scoreClip, radian, targetDirection, preferred_chocolate1, preferred_chocolate2, customer1, attachMovie, orderbook1, getNextHighestDepth, customer2, orderbook2, customer3, orderbook3, selectedTable, moveTarget, keylistener;
function Level4 () {
super();
}
function onLoad() {
var owner = this;
clearInterval(popup_interval);
clearInterval(process_interval);
Reset();
salesGirl.coffeeicon._visible = false;
btn_pause._visible = false;
_parent.pauseClip._visible = false;
salesGirl.gotoAndStop(currentDirection);
salesGirl.chocolateCount = 0;
choco_machines.status = "empty";
special_choco_machines.status = "empty";
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
scoreIndicateClip._visible = false;
shopclosedClip._visible = false;
timerClip._visible = false;
chocolate_container._visible = false;
special_chocolate_container._visible = false;
special_chocolate_container.mc.gotoAndStop(1);
coffeeClip._visible = false;
chocolateClip._visible = false;
phone_mc._visible = false;
popup_mc._visible = false;
selectClip._visible = false;
coffee_machine._visible = false;
heartinClip._visible = false;
shopopenClip._visible = false;
reportMc._visible = false;
cancel_mc._visible = false;
infoClip._visible = false;
comboClip._visible = false;
dusbinContainer._visible = false;
curScoreClip._visible = false;
specialChocolateClip._visible = false;
expertScoreClip._visible = false;
table2._visible = (table3._visible = false);
table1._visible = false;
coin_Anim2._visible = (coin_Anim3._visible = false);
coin_Anim1._visible = false;
table1.point = 1;
table2.point = 2;
table3.point = 3;
choco_machines._visible = true;
choco_machines.single_machine.gotoAndStop(2);
dusbin._visible = true;
dusbin.gotoAndStop(2);
special_choco_machines._visible = true;
special_choco_machines.gotoAndStop(1);
special_choco_machines.machine1.gotoAndStop(2);
isPopup = true;
_global.popupText = "Welcome to my chocolate shop. Let's have a look around!";
ShowPopup(this);
btn_pause.onRelease = function () {
if (this._visible && (owner._parent.pauseClip._visible == false)) {
owner.pauseTarget = "btn_continue";
owner.isPaused = true;
owner.isPopup = true;
this._visible = false;
owner._parent.pauseClip._visible = true;
owner._parent.pauseClip.gotoAndPlay(2);
owner.CallPause();
}
};
leve4Keyobj = new Object();
Key.addListener(leve4Keyobj);
leve4Keyobj.onKeyUp = function () {
if (Key.getCode() == 13) {
if ((!owner.isPaused) && (!owner.isGameOver)) {
owner.StoreInSequence();
}
}
};
leve4Keyobj.onKeyDown = function () {
if (Key.getCode() == 37) {
if (!owner.isPaused) {
owner.LeftNavigation();
}
} else if (Key.getCode() == 39) {
if (!owner.isPaused) {
owner.RightNavigation();
}
} else if (Key.getCode() == 38) {
if (!owner.isPaused) {
owner.UpNavigation();
} else {
owner.pauseUpNavigation();
}
} else if (Key.getCode() == 40) {
if (!owner.isPaused) {
owner.DownNavigation();
} else {
owner.pauseDownNavigation();
}
} else if (Key.getCode() == 13) {
if (owner.popup_mc._visible) {
owner.popup_mc.btn_ok.onRelease();
} else if (owner.reportMc._visible) {
if (owner.reportMc._currentframe == 1) {
owner.reportMc.mc.btn_continue.onRelease();
} else {
owner.reportMc.mc.btn_retry.onRelease();
}
} else if (!owner.isPaused) {
owner.EnterFunction();
} else {
owner.PauseEnterFunction();
}
} else if (Key.getAscii() == 27) {
if (!owner.isPaused) {
owner.btn_pause.onRelease();
} else if (owner.isPaused) {
owner._parent.pauseClip.btn_continue.onRelease();
}
}
};
table1.onRollOver = (table2.onRollOver = (table3.onRollOver = function () {
if ((!owner.isPaused) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = this._name;
owner.moveTarget = this._name;
eval ("this.orderbook" + this.point).highlight.gotoAndStop(2);
if (eval ("this.orderbook" + this.point).money_mc._currentframe == 2) {
eval ("this.orderbook" + this.point).highlight_small.gotoAndStop(2);
} else if (eval ("this.orderbook" + this.point).money_mc._currentframe == 3) {
eval ("this.orderbook" + this.point).highlight_small_coin.gotoAndStop(2);
}
}
}));
table1.onRollOut = (table2.onRollOut = (table3.onRollOut = function () {
eval ("this.orderbook" + this.point).highlight.gotoAndStop(1);
if (eval ("this.orderbook" + this.point).money_mc._currentframe == 2) {
eval ("this.orderbook" + this.point).highlight_small.gotoAndStop(1);
} else if (eval ("this.orderbook" + this.point).money_mc._currentframe == 3) {
eval ("this.orderbook" + this.point).highlight_small_coin.gotoAndStop(1);
}
}));
choco_machines.onRollOver = function () {
if (((owner.machineStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "choco_machines";
owner.moveTarget = "choco_machines";
this.single_machine.gotoAndStop(3);
}
};
choco_machines.onRollOut = (choco_machines.onReleaseOutside = function () {
this.single_machine.gotoAndStop(2);
});
dusbin.onRollOver = function () {
if ((owner.dusbinStatus == "ready") && (!owner.isPaused)) {
owner.ObjectsRollOut();
owner.keyTarget = "dusbin";
owner.moveTarget = "dusbin";
this.gotoAndStop(3);
}
};
dusbin.onRollOut = (dusbin.onReleaseOutside = function () {
this.gotoAndStop(2);
});
special_choco_machines.onRollOver = function () {
if (((owner.special_machineStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "special_choco_machines";
owner.moveTarget = "special_choco_machines";
this.machine1.gotoAndStop(3);
}
};
special_choco_machines.onRollOut = (special_choco_machines.onReleaseOutside = function () {
this.machine1.gotoAndStop(2);
});
choco_machines.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.choco_machines);
}
};
choco_machines.onPress = function () {
if (((owner.isTargetReached && (owner.machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines";
owner.calculateAngle(owner.chomac_indicate);
this.pointer._visible = true;
}
};
special_choco_machines.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.special_choco_machines);
}
};
special_choco_machines.onPress = function () {
if (((owner.isTargetReached && (owner.special_machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "special_choco_machines";
owner.calculateAngle(owner.splmn_indicate);
this.pointer._visible = true;
}
};
dusbin.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.dusbin);
}
};
dusbin.onPress = function () {
if ((owner.isTargetReached && (owner.dusbinStatus == "ready")) && (!owner.isPaused)) {
owner.isTargetReached = false;
owner.selectedTarget = "dusbin";
owner.calculateAngle(owner.dusbin_indicate);
this.pointer._visible = true;
}
};
table1.onRelease = (table2.onRelease = (table3.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(this);
}
}));
table1.onPress = (table2.onPress = (table3.onPress = function () {
if ((owner.isTargetReached && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = this._name;
owner.calculateAngle(this);
if (owner.selectedTarget == "table1") {
owner.selectedTable = 1;
} else if (owner.selectedTarget == "table2") {
owner.selectedTable = 2;
} else if (owner.selectedTarget == "table3") {
owner.selectedTable = 3;
}
eval ("owner.orderbook" + owner.selectedTable).pointer._visible = true;
}
}));
}
function LeftNavigation() {
if (chocolate_container._visible) {
if (keyTarget == "type_box") {
chocolate_container.mc.type_round.onRollOver();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_triangle.onRollOver();
}
} else if (special_chocolate_container._visible) {
if (special_chocolate_container.mc.type_rabbit._currentframe == 2) {
special_chocolate_container.mc.type_rabbit.onRollOut();
special_chocolate_container.mc.type_fish.onRollOver();
} else if (special_chocolate_container.mc.type_fish._currentframe == 2) {
special_chocolate_container.mc.type_fish.onRollOut();
special_chocolate_container.mc.type_rabbit.onRollOver();
}
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate2) {
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRollOut();
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRollOver();
}
} else if (keyTarget == "choco_machines") {
choco_machines.onRollOut();
if (table3._visible) {
table3.onRollOver();
} else if (table2._visible) {
table2.onRollOver();
} else if (table1._visible) {
table1.onRollOver();
}
} else if (keyTarget == "special_choco_machines") {
special_choco_machines.onRollOut();
choco_machines.onRollOver();
}
}
function RightNavigation() {
if (chocolate_container._visible) {
if (keyTarget == "type_triangle") {
chocolate_container.mc.type_round.onRollOver();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_box.onRollOver();
}
} else if (special_chocolate_container._visible) {
if (special_chocolate_container.mc.type_rabbit._currentframe == 2) {
special_chocolate_container.mc.type_rabbit.onRollOut();
special_chocolate_container.mc.type_fish.onRollOver();
} else if (special_chocolate_container.mc.type_fish._currentframe == 2) {
special_chocolate_container.mc.type_fish.onRollOut();
special_chocolate_container.mc.type_rabbit.onRollOver();
}
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate1) {
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRollOut();
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRollOver();
}
} else if (keyTarget == undefined) {
choco_machines.onRollOver();
} else if (keyTarget == "choco_machines") {
choco_machines.onRollOut();
special_choco_machines.onRollOver();
} else if (((keyTarget == "table1") || (keyTarget == "table2")) || (keyTarget == "table3")) {
eval ("this." + keyTarget).onRollOut();
choco_machines.onRollOver();
}
}
function UpNavigation() {
if (keyTarget == "table1") {
if (table2._visible) {
table1.onRollOut();
table2.onRollOver();
} else if (table3._visible) {
table1.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "table2") {
if (table3._visible) {
table2.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "dusbin") {
dusbin.onRollOut();
special_choco_machines.onRollOver();
}
}
function DownNavigation() {
if (keyTarget == "table3") {
if (table2._visible) {
table3.onRollOut();
table2.onRollOver();
} else if (table1._visible) {
table3.onRollOut();
table1.onRollOver();
}
} else if (keyTarget == "table2") {
if (table1._visible) {
table2.onRollOut();
table1.onRollOver();
}
} else if (keyTarget == "special_choco_machines") {
special_choco_machines.onRollOut();
dusbin.onRollOver();
}
}
function EnterFunction() {
if (chocolate_container._visible) {
if (keyTarget == "type_triangle") {
chocolate_container.mc.type_triangle.onRelease();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_round.onRelease();
} else if (keyTarget == "type_box") {
chocolate_container.mc.type_box.onRelease();
}
} else if (special_chocolate_container._visible) {
eval ("this.special_chocolate_container.mc." + keyTarget).onRelease();
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate1) {
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRelease();
} else if (keyTarget == _global.preferred_chocolate2) {
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRelease();
}
} else {
eval ("this." + keyTarget).onPress();
}
}
function PauseEnterFunction() {
eval ("this._parent.pauseClip." + pauseTarget).onRelease();
}
function pauseUpNavigation() {
if (pauseTarget == "btn_premium") {
_parent.pauseClip.btn_premium.onRollOut();
_parent.pauseClip.btn_mainmenu.onRollOver();
} else if (pauseTarget == "btn_mainmenu") {
_parent.pauseClip.btn_mainmenu.onRollOut();
_parent.pauseClip.btn_restart.onRollOver();
} else if (pauseTarget == "btn_restart") {
_parent.pauseClip.btn_restart.onRollOut();
_parent.pauseClip.btn_continue.onRollOver();
}
}
function pauseDownNavigation() {
if (pauseTarget == "pause") {
_parent.pauseClip.btn_continue.onRollOver();
} else if (pauseTarget == "btn_continue") {
_parent.pauseClip.btn_continue.onRollOut();
_parent.pauseClip.btn_restart.onRollOver();
} else if (pauseTarget == "btn_restart") {
_parent.pauseClip.btn_restart.onRollOut();
_parent.pauseClip.btn_mainmenu.onRollOver();
} else if (pauseTarget == "btn_mainmenu") {
_parent.pauseClip.btn_mainmenu.onRollOut();
_parent.pauseClip.btn_premium.onRollOver();
}
}
function updateScore() {
scoreClip.score_txt.text = score;
scoreClip.loading.gotoAndStop(score);
if ((score >= 150) && (scoreClip.target._currentframe == 1)) {
scoreClip.target.gotoAndPlay(1);
scoreIndicateClip._visible = true;
scoreIndicateClip.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.target_score_Sound.start();
}
}
if ((score >= 250) && (scoreClip.expert._currentframe == 1)) {
scoreClip.expert.gotoAndPlay(1);
expertScoreClip._visible = true;
expertScoreClip.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.expert_score_Sound.start();
}
}
}
function onEnterFrame() {
var owner = this;
if (((!isPopup) && (!isTargetReached)) && (!owner.isPaused)) {
shopperMovement();
}
if (machineshake == "onn") {
machinespeed = -machinespeed;
choco_machines._x = choco_machines._x + ((1 * machinespeed) / 2);
choco_machines._y = choco_machines._y + ((1 * machinespeed) / 2);
}
if (specialmachineshake == "onn") {
specialmachinespeed = -specialmachinespeed;
special_choco_machines._x = special_choco_machines._x + ((1 * specialmachinespeed) / 2);
special_choco_machines._y = special_choco_machines._y + ((1 * specialmachinespeed) / 2);
} else {
special_choco_machines._x = 631;
special_choco_machines._y = 101;
}
_parent.pauseClip.btn_continue.onRollOver = (_parent.pauseClip.btn_restart.onRollOver = (_parent.pauseClip.btn_mainmenu.onRollOver = (_parent.pauseClip.btn_premium.onRollOver = function () {
owner._parent.pauseClip.btn_continue.onRollOut();
owner._parent.pauseClip.btn_restart.onRollOut();
owner._parent.pauseClip.btn_mainmenu.onRollOut();
owner._parent.pauseClip.btn_premium.onRollOut();
owner.pauseTarget = this._name;
this.gotoAndStop(2);
})));
_parent.pauseClip.btn_continue.onRollOut = (_parent.pauseClip.btn_restart.onRollOut = (_parent.pauseClip.btn_mainmenu.onRollOut = (_parent.pauseClip.btn_premium.onRollOut = function () {
this.gotoAndStop(1);
})));
_parent.pauseClip.btn_continue.onRelease = function () {
owner.isPaused = false;
owner.isPopup = false;
owner.btn_pause._visible = true;
owner._parent.pauseClip._visible = false;
owner.CallResume();
};
_parent.pauseClip.btn_restart.onRelease = function () {
owner.Reset();
owner._parent.play();
};
_parent.pauseClip.btn_mainmenu.onRelease = function () {
owner.Reset();
owner._parent.gotoAndStop("mainmenu");
};
_parent.pauseClip.btn_premium.onRelease = function () {
this.getURL(_root.urlname, "_blank");
};
popup_mc.btn_ok.onRollOver = function () {
this.gotoAndStop(2);
};
popup_mc.btn_ok.onRollOut = (popup_mc.btn_ok.onReleaseOutside = function () {
this.gotoAndStop(1);
});
chocolate_container.mc.type_triangle.onRollOver = (chocolate_container.mc.type_round.onRollOver = (chocolate_container.mc.type_box.onRollOver = function () {
if (!owner.isPaused) {
owner.keyTarget = this._name;
owner.chocolate_container.mc.type_triangle.gotoAndStop(1);
owner.chocolate_container.mc.type_round.gotoAndStop(1);
owner.chocolate_container.mc.type_box.gotoAndStop(1);
this.gotoAndStop(2);
}
}));
chocolate_container.mc.type_triangle.onRelease = (chocolate_container.mc.type_round.onRelease = (chocolate_container.mc.type_box.onRelease = function () {
if (!owner.isPaused) {
owner.infoClip._visible = false;
owner.chocolateClip._visible = true;
owner.chocolateClip.gotoAndStop(this._name);
owner.chocolateClip.mc.gotoAndPlay(1);
owner.isTargetReached = true;
owner.preferred_box_chocolate = this._name;
if (owner.choco_machines.status == "empty") {
owner.choco_machines.status = "prepared";
}
owner.preparecnt = 0;
owner.process_interval = setInterval(owner.IdleProcess, 100, owner);
owner.chocolate_container.gotoAndStop(2);
owner.dusbinStatus = "ready";
owner.machineStatus = "ready";
owner.isPopup = false;
owner.machineshake = "onn";
owner.keyTarget = "choco_machines";
if (_global.soundstat == "onn") {
_root.choco_producing_Sound.start();
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
}));
chocolate_container.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.machineStatus = "ready";
owner.chocolate_container._visible = false;
owner.isPopup = false;
owner.dusbinStatus = "ready";
owner.keyTarget = "choco_machines";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
special_chocolate_container.mc.type_rabbit.onRollOver = (special_chocolate_container.mc.type_fish.onRollOver = function () {
if (!owner.isPaused) {
owner.keyTarget = this._name;
owner.special_chocolate_container.mc.type_rabbit.gotoAndStop(1);
owner.special_chocolate_container.mc.type_fish.gotoAndStop(1);
this.gotoAndStop(2);
}
});
special_chocolate_container.mc.type_rabbit.onRelease = (special_chocolate_container.mc.type_fish.onRelease = function () {
if (!owner.isPaused) {
owner.infoClip._visible = false;
owner.specialChocolateClip._visible = true;
owner.specialChocolateClip.gotoAndStop(this._name);
owner.specialChocolateClip.mc.gotoAndPlay(1);
owner.isTargetReached = true;
owner.preferred_special_chocolate = this._name;
if (owner.special_choco_machines.status == "empty") {
owner.special_choco_machines.status = "prepared";
}
owner.spl_preparecnt = 0;
owner.special_process_interval = setInterval(owner.SpecialIdleProcess, 100, owner);
owner.special_chocolate_container.gotoAndStop(2);
owner.dusbinStatus = "ready";
owner.special_machineStatus = "ready";
owner.isPopup = false;
owner.specialmachineshake = "onn";
owner.keyTarget = "special_choco_machines";
if (_global.soundstat == "onn") {
_root.choco_producing_Sound.start();
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
});
special_chocolate_container.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.special_machineStatus = "ready";
owner.special_chocolate_container._visible = false;
owner.isPopup = false;
owner.dusbinStatus = "ready";
owner.keyTarget = "special_choco_machines";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
dusbinContainer.mc.chocobox1.type_triangle.onRollOver = (dusbinContainer.mc.chocobox1.type_round.onRollOver = (dusbinContainer.mc.chocobox1.type_box.onRollOver = (dusbinContainer.mc.chocobox2.type_triangle.onRollOver = (dusbinContainer.mc.chocobox2.type_round.onRollOver = (dusbinContainer.mc.chocobox2.type_box.onRollOver = (dusbinContainer.mc.chocobox1.type_rabbit.onRollOver = (dusbinContainer.mc.chocobox1.type_fish.onRollOver = (dusbinContainer.mc.chocobox2.type_rabbit.onRollOver = (dusbinContainer.mc.chocobox2.type_fish.onRollOver = function () {
owner.keyTarget = this._name;
this.gotoAndStop(2);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onRollOut = (dusbinContainer.mc.chocobox1.type_round.onRollOut = (dusbinContainer.mc.chocobox1.type_box.onRollOut = (dusbinContainer.mc.chocobox2.type_triangle.onRollOut = (dusbinContainer.mc.chocobox2.type_round.onRollOut = (dusbinContainer.mc.chocobox2.type_box.onRollOut = (dusbinContainer.mc.chocobox1.type_rabbit.onRollOut = (dusbinContainer.mc.chocobox1.type_fish.onRollOut = (dusbinContainer.mc.chocobox2.type_rabbit.onRollOut = (dusbinContainer.mc.chocobox2.type_fish.onRollOut = function () {
this.gotoAndStop(1);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_round.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_box.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_triangle.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_round.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_box.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_rabbit.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_fish.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_rabbit.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_fish.onReleaseOutside = function () {
this.gotoAndStop(1);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onRelease = (dusbinContainer.mc.chocobox1.type_round.onRelease = (dusbinContainer.mc.chocobox1.type_box.onRelease = (dusbinContainer.mc.chocobox2.type_triangle.onRelease = (dusbinContainer.mc.chocobox2.type_round.onRelease = (dusbinContainer.mc.chocobox2.type_box.onRelease = (dusbinContainer.mc.chocobox1.type_rabbit.onRelease = (dusbinContainer.mc.chocobox1.type_fish.onRelease = (dusbinContainer.mc.chocobox2.type_rabbit.onRelease = (dusbinContainer.mc.chocobox2.type_fish.onRelease = function () {
if (!owner.isPaused) {
if (this._name == owner.preferred_chocolate1) {
owner.preferred_chocolate1 = owner.preferred_chocolate2;
owner.preferred_chocolate2 = null;
owner.salesGirl.chocolateCount--;
owner.girlwalkframe = owner.girlwalkframe / 2;
owner.salesGirl.girlwalk.gotoAndStop(owner.girlwalkframe);
owner.salesGirl.girlwalk.chocobox1.gotoAndStop(owner.preferred_chocolate1);
owner.salesGirl.girlwalk.chocobox2.gotoAndStop(owner.preferred_chocolate2);
} else {
owner.preferred_chocolate2 = null;
owner.salesGirl.chocolateCount--;
owner.girlwalkframe = owner.girlwalkframe / 2;
owner.salesGirl.girlwalk.gotoAndStop(owner.girlwalkframe);
owner.salesGirl.girlwalk.chocobox1.gotoAndStop(owner.preferred_chocolate1);
owner.salesGirl.girlwalk.chocobox2.gotoAndStop(owner.preferred_chocolate2);
}
owner.dusbinStatus = "ready";
owner.dusbinContainer._visible = false;
owner.isPopup = false;
owner.keyTarget = "dusbin";
owner.setGreenHighLight();
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
})))))))));
dusbinContainer.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.dusbinStatus = "ready";
owner.dusbinContainer._visible = false;
owner.isPopup = false;
owner.keyTarget = "dusbin";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
reportMc.mc.btn_continue.onRelease = function () {
owner.Reset();
_global.calenderfrom = "game";
owner._parent.gotoAndStop("calender");
};
reportMc.mc.btn_menu.onRelease = function () {
owner.Reset();
owner._parent.gotoAndStop("mainmenu");
};
reportMc.mc.btn_retry.onRelease = function () {
owner.Reset();
owner._parent.play();
};
popup_mc.btn_ok.onRelease = function () {
if (owner.popup_info == "welcome") {
owner.combo_bookcnt = 0;
owner.combo_ordercnt = 0;
owner.combo_moneycnt = 0;
owner.btn_pause._visible = true;
owner.popupDisable();
var _local1 = owner.getRandom(0, 2);
owner.customerEnterInterval = setInterval(owner.CallCustomer, 2000, owner, owner.lobbyArr[_local1], "oldlady");
owner.lobbyArr.splice(_local1, 1);
owner.isPopup = false;
owner.popup_info = "level2_start";
owner.bg.gotoAndStop(2);
owner.shopopenClip._visible = true;
owner.shopopenClip.gotoAndPlay(1);
owner.ismoveready = true;
owner.machineStatus = "ready";
owner.special_machineStatus = "ready";
owner.dusbinStatus = "ready";
owner.timerClip._visible = true;
clearInterval(owner.gameInterval);
owner.gametimer = 0;
owner.gameInterval = setInterval(owner.GameTimeLimit, 700, owner);
owner.Re_customerEnterInterval = setInterval(owner.CallNewCustomer, 6000, owner);
} else if (owner.popup_info == "order") {
owner.popupDisable();
owner.isPopup = false;
owner.popup_info = "";
owner.selectClip._visible = true;
owner.selectClip._x = owner.choco_machines._x;
owner.selectClip._y = owner.choco_machines._y - 80;
} else if (owner.popup_info == "mismatch") {
owner.popupDisable();
owner.isPopup = false;
}
};
}
function shopperMovement() {
var _local3 = (salesGirl._x + salesGirl.pointer._x) - targetclip._x;
var _local2 = (salesGirl._y + salesGirl.pointer._y) - targetclip._y;
var _local5 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
var _local4 = 10;
if (_local5 >= _local4) {
salesGirl._x = salesGirl._x + (Math.cos(radian) * 12);
salesGirl._y = salesGirl._y + (Math.sin(radian) * 12);
} else if (!isTargetReached) {
isTargetReached = true;
salesGirl.gotoAndStop(targetDirection);
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
Manipulate();
updateScore();
}
}
function GameStart(_arg2) {
clearInterval(_arg2.gamestartInterval);
_arg2.isPopup = true;
_global.popupText = "Select the SPECIALTY CHOCOLATE machine to produce chocolate figures.";
_arg2.ShowPopup(_arg2);
}
function calculateAngle(mc) {
if (!isPopup) {
targetclip = mc;
var x_diff = (eval (mc)._x - (salesGirl._x + salesGirl.pointer._x));
var y_diff = (eval (mc)._y - (salesGirl._y + salesGirl.pointer._y));
radian = Math.atan2(y_diff, x_diff);
if (Math.abs(x_diff) > Math.abs(y_diff)) {
if (x_diff > 0) {
targetDirection = "right";
} else {
targetDirection = "left";
}
} else if (y_diff > 0) {
targetDirection = "down";
} else {
targetDirection = "up";
}
if (curtarget != selectedTarget) {
curtarget = selectedTarget;
salesGirl.gotoAndStop(targetDirection);
salesGirl.girlwalk.gotoAndStop(girlwalkframe - 1);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
}
}
}
function ShowPopup(_arg1) {
clearInterval(_arg1.popup_interval);
_arg1.isPopup = true;
_arg1.popup_mc._visible = true;
_arg1.popup_mc.swapDepths(_arg1.getNextHighestDepth());
_arg1.popup_mc.gotoAndPlay(1);
}
function popupDisable() {
popup_mc.gotoAndStop(1);
popup_mc._visible = false;
}
function CallNewCustomer(_arg1) {
if (!_arg1.isGameOver) {
if ((_arg1.customerCount != 0) && (_arg1.moneyCount != 0)) {
_arg1.CallNextCustomerSet();
}
} else {
clearInterval(_arg1.Re_customerEnterInterval);
}
}
function CallCustomer(_arg2, _arg3, _arg4) {
if (!_arg2.isPaused) {
clearInterval(_arg2.customerEnterInterval);
if (!_arg2.isGameOver) {
_arg2.customerEnter(_arg3, _arg4);
var _local1 = 0;
while (_local1 < _arg2.lobbyArr.length) {
if (_arg2.lobbyArr[_local1] == _arg3) {
_arg2.lobbyArr.splice(_local1, 1);
}
_local1++;
}
} else if ((_arg2.customerCount == 0) && (_arg2.moneyCount == 0)) {
_arg2.callResult();
}
}
}
function CallCustomer2(_arg2, _arg3, _arg4) {
if (!_arg2.isPaused) {
clearInterval(_arg2.customerEnterInterval2);
if (!_arg2.isGameOver) {
_arg2.customerEnter(_arg3, _arg4);
var _local1 = 0;
while (_local1 < _arg2.lobbyArr.length) {
if (_arg2.lobbyArr[_local1] == _arg3) {
_arg2.lobbyArr.splice(_local1, 1);
}
_local1++;
}
} else if ((_arg2.customerCount == 0) && (_arg2.moneyCount == 0)) {
_arg2.callResult();
}
}
}
function CallCustomer3(_arg2, _arg3, _arg4) {
if (!_arg2.isPaused) {
clearInterval(_arg2.customerEnterInterval3);
if (!_arg2.isGameOver) {
_arg2.customerEnter(_arg3, _arg4);
var _local1 = 0;
while (_local1 < _arg2.lobbyArr.length) {
if (_arg2.lobbyArr[_local1] == _arg3) {
_arg2.lobbyArr.splice(_local1, 1);
}
_local1++;
}
} else if ((_arg2.customerCount == 0) && (_arg2.moneyCount == 0)) {
_arg2.callResult();
}
}
}
function Re_CallCustomer(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.Re_customerEnterInterval);
if (!_arg1.isGameOver) {
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function customerEnter(_arg3, _arg2) {
if (_arg3 == 1) {
table1._visible = true;
customer1 = attachMovie(_arg2, "customer1", depthArr[_arg3 - 1], {_x:115, _y:356});
orderbook1 = attachMovie("orderbook", "orderbook1", getNextHighestDepth(), {_x:170, _y:374});
orderbook1.type = "book";
customer1.type = _arg2;
orderbook1.heatcnt = 0;
if (_arg2 == "oldlady") {
orderbook1.heatInterval = setInterval(HeatFunction, 600, orderbook1, this, 1);
} else if (_arg2 == "younglady") {
orderbook1.heatInterval = setInterval(HeatFunction, 300, orderbook1, this, 1);
}
} else if (_arg3 == 2) {
table2._visible = true;
customer2 = attachMovie(_arg2, "customer2", depthArr[_arg3 - 1], {_x:119, _y:235});
orderbook2 = attachMovie("orderbook", "orderbook2", getNextHighestDepth(), {_x:177, _y:278});
orderbook2.type = "book";
customer2.type = _arg2;
orderbook2.heatcnt = 0;
if (_arg2 == "oldlady") {
orderbook2.heatInterval = setInterval(HeatFunction, 600, orderbook2, this, 2);
} else if (_arg2 == "younglady") {
orderbook2.heatInterval = setInterval(HeatFunction, 300, orderbook2, this, 2);
}
} else if (_arg3 == 3) {
table3._visible = true;
customer3 = attachMovie(_arg2, "customer3", depthArr[_arg3 - 1], {_x:127, _y:140});
orderbook3 = attachMovie("orderbook", "orderbook3", getNextHighestDepth(), {_x:184, _y:185});
orderbook3.type = "book";
customer3.type = _arg2;
orderbook3.heatcnt = 0;
if (_arg2 == "oldlady") {
orderbook3.heatInterval = setInterval(HeatFunction, 600, orderbook3, this, 3);
} else if (_arg2 == "younglady") {
orderbook3.heatInterval = setInterval(HeatFunction, 300, orderbook3, this, 3);
}
}
customerCount++;
moneyCount++;
salesGirl.swapDepths(getNextHighestDepth());
scoreIndicateClip.swapDepths(getNextHighestDepth());
expertScoreClip.swapDepths(getNextHighestDepth());
chocolate_container.swapDepths(getNextHighestDepth());
special_chocolate_container.swapDepths(getNextHighestDepth());
dusbinContainer.swapDepths(getNextHighestDepth());
comboClip.swapDepths(getNextHighestDepth());
reportMc.swapDepths(getNextHighestDepth());
}
function Manipulate() {
var owner = this;
if (selectedTarget == "choco_machines") {
choco_machines.pointer._visible = false;
if (choco_machines.status == "empty") {
if (owner.salesGirl.chocolateCount < 3) {
chocolate_container._visible = true;
chocolate_container.gotoAndStop(1);
chocolate_container.mc.gotoAndPlay(1);
machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
keyTarget = "type_round";
}
} else if (choco_machines.status == "chocolateReady") {
if (owner.salesGirl.chocolateCount < 2) {
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = owner.preferred_box_chocolate;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = owner.preferred_box_chocolate;
}
owner.salesGirl.chocolateCount++;
chocolateClip._visible = false;
salesGirl.gotoAndStop(2);
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
choco_machines.status = "empty";
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
if (orderbook1.book_mc._currentframe == 74) {
orderbook1.green_highlight._visible = true;
}
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
if (orderbook2.book_mc._currentframe == 74) {
orderbook2.green_highlight._visible = true;
}
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
if (orderbook3.book_mc._currentframe == 74) {
orderbook3.green_highlight._visible = true;
}
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (selectedTarget == "special_choco_machines") {
special_choco_machines.pointer._visible = false;
if (special_choco_machines.status == "empty") {
if (owner.salesGirl.chocolateCount < 3) {
special_chocolate_container._visible = true;
special_chocolate_container.gotoAndStop(1);
special_chocolate_container.mc.gotoAndPlay(1);
special_machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
keyTarget = "type_rabbit";
}
} else if (special_choco_machines.status == "chocolateReady") {
if (owner.salesGirl.chocolateCount < 2) {
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = owner.preferred_special_chocolate;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = owner.preferred_special_chocolate;
}
owner.salesGirl.chocolateCount++;
specialChocolateClip._visible = false;
salesGirl.gotoAndStop(2);
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
special_choco_machines.status = "empty";
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (selectedTarget == "dusbin") {
dusbin.pointer._visible = false;
if (salesGirl.chocolateCount == 1) {
salesGirl.chocolateCount--;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
preferred_chocolate1 = null;
preferred_chocolate2 = null;
owner.setGreenHighLight();
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
} else if (salesGirl.chocolateCount >= 2) {
dusbinStatus = "notready";
isPopup = true;
_global.preferred_chocolate1 = preferred_chocolate1;
_global.preferred_chocolate2 = preferred_chocolate2;
keyTarget = _global.preferred_chocolate1;
dusbinContainer._visible = true;
dusbinContainer.gotoAndStop(1);
dusbinContainer.mc.gotoAndPlay(1);
}
} else if (((selectedTarget == "table1") || (selectedTarget == "table2")) || (selectedTarget == "table3")) {
eval ("this.orderbook" + selectedTable).pointer._visible = false;
if (eval ("this.orderbook" + selectedTable).type == "book") {
combo_bookcnt++;
combo_ordercnt = 0;
combo_moneycnt = 0;
eval ("this.orderbook" + selectedTable).type = "chocolateOrder";
var randomno = owner.getRandom(0, 4);
eval ("this.orderbook" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.customer" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.orderbook" + selectedTable).gotoAndStop(2);
eval ("this.customer" + selectedTable).gotoAndStop(3);
eval ("this.orderbook" + selectedTable).green_highlight._visible = false;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
var heatcntchange = int(eval ("this.orderbook" + selectedTable).heatcnt / 4);
if (heatcntchange > 1) {
eval ("this.orderbook" + selectedTable).heatcnt = heatcntchange;
} else {
eval ("this.orderbook" + selectedTable).heatcnt = 1;
}
CheckForBookCombo();
} else if (eval ("this.orderbook" + selectedTable).type == "chocolateOrder") {
if ((salesGirl.chocolateCount >= 1) && (eval ("this.orderbook" + selectedTable).book_mc._currentframe >= 74)) {
combo_bookcnt = 0;
combo_moneycnt = 0;
if (eval ("owner.customer" + owner.selectedTable).neededchocolate == owner.preferred_chocolate1) {
combo_ordercnt++;
preferred_chocolate1 = preferred_chocolate2;
preferred_chocolate2 = null;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
eval ("this.orderbook" + selectedTable).type = "money";
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable).gotoAndStop(3);
eval ("this.customer" + selectedTable).gotoAndStop(5);
if ((eval ("this.orderbook" + selectedTable).heatcnt > 60) && (eval ("this.orderbook" + selectedTable).heatcnt <= 100)) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(2);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
} else if (eval ("this.orderbook" + selectedTable).heatcnt > 100) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(3);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
eval ("this.orderbook" + selectedTable).highlight_small._visible = false;
}
clearInterval(eval ("this.orderbook" + selectedTable).heatInterval);
CheckForOrderCombo();
customerCount--;
if (salesGirl.chocolateCount == 1) {
preferred_chocolate1 = null;
}
salesGirl.chocolateCount--;
owner.setGreenHighLight();
if (_global.soundstat == "onn") {
_root.customer_happy_Sound.start();
}
if (!isGameOver) {
CallNextCustomerSet();
}
} else if (eval ("owner.customer" + owner.selectedTable).neededchocolate == owner.preferred_chocolate2) {
combo_ordercnt++;
salesGirl.chocolateCount--;
preferred_chocolate2 = null;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
eval ("this.orderbook" + selectedTable).type = "money";
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable).gotoAndStop(3);
eval ("this.customer" + selectedTable).gotoAndStop(5);
if ((eval ("this.orderbook" + selectedTable).heatcnt > 60) && (eval ("this.orderbook" + selectedTable).heatcnt <= 100)) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(2);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
} else if (eval ("this.orderbook" + selectedTable).heatcnt > 100) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(3);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
eval ("this.orderbook" + selectedTable).highlight_small._visible = false;
}
clearInterval(eval ("this.orderbook" + selectedTable).heatInterval);
CheckForOrderCombo();
customerCount--;
owner.setGreenHighLight();
if (_global.soundstat == "onn") {
_root.customer_happy_Sound.start();
}
if (!isGameOver) {
CallNextCustomerSet();
}
}
}
} else if (eval ("this.orderbook" + selectedTable).type == "money") {
combo_bookcnt = 0;
combo_ordercnt = 0;
combo_moneycnt++;
moneyCount--;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(2);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable)._visible = false;
eval ("this.customer" + selectedTable)._visible = false;
eval ("this.table" + selectedTable)._visible = false;
eval ("this.orderbook" + selectedTable).type = "empty";
CheckForMoneyCombo();
lobbyArr.push(selectedTable);
if ((customerCount == 0) && (moneyCount == 0)) {
if (!isGameOver) {
if (lobbyArr.length == 3) {
customerCount = 0;
moneyCount = 0;
owner.table2._visible = (owner.table3._visible = false);
owner.table1._visible = false;
CallNextCustomerSet();
}
} else {
callResult();
}
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
}
function CallNextCustomerSet() {
var _local2 = this;
clearInterval(_local2.customerEnterInterval);
clearInterval(_local2.customerEnterInterval2);
clearInterval(_local2.customerEnterInterval3);
if (lobbyArr.length == 1) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local6 = Math.ceil((Math.random() * 3) - 1);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 2000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local6]);
var _local5 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local2.lobbyArr.push(_local5);
} else if (lobbyArr.length == 2) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local6 = Math.ceil((Math.random() * 3) - 1);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 1000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local6]);
var _local5 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local6 = Math.ceil((Math.random() * 3) - 1);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 3000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local6]);
var _local7 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local2.lobbyArr.push(_local5);
_local2.lobbyArr.push(_local7);
} else if (lobbyArr.length == 3) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local6 = Math.ceil((Math.random() * 3) - 1);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 1000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local6]);
var _local5 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local6 = Math.ceil((Math.random() * 3) - 1);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 3500, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local6]);
var _local7 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local6 = Math.ceil((Math.random() * 3) - 1);
_local2.customerEnterInterval3 = setInterval(_local2.CallCustomer3, 4500, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local6]);
var _local4 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local2.lobbyArr.push(_local5);
_local2.lobbyArr.push(_local7);
_local2.lobbyArr.push(_local4);
}
}
function setGreenHighLight() {
if (orderbook1.book_mc._currentframe >= 74) {
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
} else {
orderbook1.green_highlight._visible = false;
}
}
if (orderbook2.book_mc._currentframe >= 74) {
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
} else {
orderbook2.green_highlight._visible = false;
}
}
if (orderbook3.book_mc._currentframe >= 74) {
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
} else {
orderbook3.green_highlight._visible = false;
}
}
}
function callResult() {
clearInterval(customerEnterInterval);
clearInterval(customerEnterInterval2);
clearInterval(customerEnterInterval3);
clearInterval(Re_customerEnterInterval);
clearInterval(reportInterval);
clearInterval(orderbook1.heatInterval);
clearInterval(orderbook2.heatInterval);
clearInterval(orderbook3.heatInterval);
machineStatus = "notready";
special_machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
_global.report_moneyEarned = score;
_global.report_tips = tips;
_global.targetScore = 150;
_global.expertScore = 250;
btn_pause._visible = false;
dusbinStatus = "notready";
score = score + tips;
if (score < 150) {
reportMc._visible = true;
reportMc.gotoAndStop(2);
reportMc.mc.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.level_failed_Sound.start();
}
} else {
if (_global.soundstat == "onn") {
_root.level_complete_Sound.start();
}
if (_global.levelSelected < 5) {
_global.levelSelected = 5;
}
if (_global.levelFinished <= 4) {
_global.levelFinished = 4;
}
if (score >= 250) {
_global.level4Status = "expert";
} else {
_global.level4Status = "target";
}
_global.level4Score = score;
if (((score >= 150) && (scoreClip.target._currentframe == 1)) || ((score >= 250) && (scoreClip.expert._currentframe == 1))) {
reportInterval = setInterval(CallReport, 2300, this);
} else {
reportMc._visible = true;
reportMc.gotoAndStop(1);
reportMc.mc.gotoAndPlay(2);
}
}
}
function CallReport(_arg1) {
clearInterval(_arg1.reportInterval);
_arg1.reportMc._visible = true;
_arg1.reportMc.gotoAndStop(1);
_arg1.reportMc.mc.gotoAndPlay(2);
}
function HeatFunction(owner, myparent, curpoint) {
if (!myparent.isPaused) {
owner.heatcnt++;
owner.timelimit.gotoAndStop(owner.heatcnt);
if (owner.heatcnt == 100) {
eval ("myparent.customer" + curpoint).gotoAndStop(4);
}
if (owner.heatcnt >= 120) {
clearInterval(owner.heatInterval);
eval ("myparent.customer" + curpoint).gotoAndStop(6);
myparent.moneyCount--;
myparent.customerCount--;
eval ("myparent.orderbook" + curpoint)._visible = false;
eval ("myparent.table" + curpoint)._visible = false;
if (eval ("myparent.customer" + curpoint).type == "oldlady") {
if (myparent.score > 0) {
myparent.curScoreClip._visible = true;
myparent.curScoreClip.gotoAndPlay(1);
if ((myparent.score >= 2) && (myparent.score < 10)) {
myparent.score = myparent.score - 2;
myparent.curScoreClip.disp.score.text = -2;
} else if (myparent.score >= 10) {
myparent.score = myparent.score - 10;
myparent.curScoreClip.disp.score.text = -10;
}
myparent.scoreClip.score_txt.text = myparent.score;
myparent.scoreClip.loading.gotoAndStop(myparent.score);
}
} else if (eval ("myparent.customer" + curpoint).type == "younglady") {
if (myparent.score > 0) {
myparent.curScoreClip._visible = true;
myparent.curScoreClip.gotoAndPlay(1);
if ((myparent.score >= 2) && (myparent.score < 15)) {
myparent.score = myparent.score - 2;
myparent.curScoreClip.disp.score.text = -2;
} else if (myparent.score >= 15) {
myparent.score = myparent.score - 15;
myparent.curScoreClip.disp.score.text = -15;
}
myparent.scoreClip.score_txt.text = myparent.score;
myparent.scoreClip.loading.gotoAndStop(myparent.score);
}
}
eval ("myparent.orderbook" + curpoint).type = "empty";
myparent.lobbyArr.push(curpoint);
if ((myparent.customerCount == 0) && (myparent.moneyCount == 0)) {
if (!myparent.isGameOver) {
myparent.CallNextCustomerSet();
} else {
myparent.callResult();
}
}
}
}
}
function GameTimeLimit(_arg1) {
if (!_arg1.isPaused) {
_arg1.gametimer++;
_arg1.timerClip.gotoAndStop(_arg1.gametimer);
if (_arg1.gametimer >= 90) {
_arg1.isGameOver = true;
_arg1.bg.gotoAndStop(1);
_arg1.shopclosedClip._visible = true;
_arg1.shopclosedClip.gotoAndPlay(1);
_arg1.gametimer = 0;
clearInterval(_arg1.gameInterval);
}
}
}
function CheckForBookCombo() {
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_bookcnt >= 2) {
comboClip._x = eval ("this.customer" + selectedTable)._x - 20;
comboClip._y = eval ("this.customer" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_bookcnt);
comboClip.combo.gotoAndPlay(1);
score = score + 4;
curScoreClip.disp.score.text = 4;
tips = tips + 4;
} else {
score = score + 2;
curScoreClip.disp.score.text = 2;
tips = tips + 2;
}
if (_global.soundstat == "onn") {
eval (("_root.combo" + combo_bookcnt) + "_Sound").start();
}
}
function CheckForOrderCombo() {
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_ordercnt >= 2) {
comboClip._x = eval ("this.customer" + selectedTable)._x - 20;
comboClip._y = eval ("this.customer" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_ordercnt);
comboClip.combo.gotoAndPlay(1);
score = score + 20;
curScoreClip.disp.score.text = 20;
} else {
score = score + 10;
curScoreClip.disp.score.text = 10;
}
if (_global.soundstat == "onn") {
eval (("_root.combo" + combo_ordercnt) + "_Sound").start();
}
}
function CheckForMoneyCombo() {
if (_global.soundstat == "onn") {
eval (("_root.money" + combo_moneycnt) + "_Sound").start();
}
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_moneycnt >= 2) {
comboClip._x = eval ("this.orderbook" + selectedTable)._x - 20;
comboClip._y = eval ("this.orderbook" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_moneycnt);
comboClip.combo.gotoAndPlay(1);
if (eval ("this.orderbook" + selectedTable).neededchocolate == "type_rabbit") {
score = score + (combo_moneycnt * 30);
curScoreClip.disp.score.text = combo_moneycnt * 30;
} else if (eval ("this.customer" + selectedTable).type == "oldlady") {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + (combo_moneycnt * 17);
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + (combo_moneycnt * 14);
curScoreClip.disp.score.text = combo_moneycnt * 14;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + (combo_moneycnt * 11);
curScoreClip.disp.score.text = combo_moneycnt * 11;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + (combo_moneycnt * 10);
curScoreClip.disp.score.text = combo_moneycnt * 10;
}
} else {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + (combo_moneycnt * 24);
curScoreClip.disp.score.text = combo_moneycnt * 24;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + (combo_moneycnt * 21);
curScoreClip.disp.score.text = combo_moneycnt * 21;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + (combo_moneycnt * 17);
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + (combo_moneycnt * 15);
curScoreClip.disp.score.text = combo_moneycnt * 15;
}
}
if (!isGameOver) {
CallNextCustomerSet();
}
} else if (eval ("this.customer" + selectedTable).type == "oldlady") {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + 17;
curScoreClip.disp.score.text = 17;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + 14;
curScoreClip.disp.score.text = 14;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + 11;
curScoreClip.disp.score.text = 11;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + 10;
curScoreClip.disp.score.text = 10;
}
} else {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + 24;
curScoreClip.disp.score.text = combo_moneycnt * 24;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + 21;
curScoreClip.disp.score.text = combo_moneycnt * 21;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + 17;
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + 15;
curScoreClip.disp.score.text = combo_moneycnt * 15;
}
}
}
function IdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.preparecnt++;
if (_arg3.preparecnt >= 20) {
clearInterval(_arg3.process_interval);
_arg3.machineStatus = "ready";
_arg3.machineshake = "off";
if (_arg3.choco_machines.status == "prepared") {
_arg3.choco_machines.status = "chocolateReady";
}
if (_global.soundstat == "onn") {
_root.choco_done_Sound.start();
}
}
}
}
function SpecialIdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.spl_preparecnt++;
if (_arg3.spl_preparecnt >= 40) {
clearInterval(_arg3.special_process_interval);
_arg3.special_machineStatus = "ready";
_arg3.specialmachineshake = "off";
if (_arg3.special_choco_machines.status == "prepared") {
_arg3.special_choco_machines.status = "chocolateReady";
}
if (_global.soundstat == "onn") {
_root.choco_done_Sound.start();
}
}
}
}
function getRandom(_arg4, _arg5) {
var _local3 = _arg5 - _arg4;
var _local2 = Math.random() * _local3;
var _local1 = Math.round(_local2);
_local1 = _local1 + _arg4;
return(_local1);
}
function StoreInSequence() {
var owner = this;
eval ("this." + moveTarget).onRelease();
}
function CallSequence() {
var owner = this;
if (sequenceArr[0] == choco_machines) {
if (((owner.isTargetReached && (owner.machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines";
owner.calculateAngle(owner.chomac_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == special_choco_machines) {
if (((owner.isTargetReached && (owner.special_machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "special_choco_machines";
owner.calculateAngle(owner.splmn_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == dusbin) {
if ((owner.isTargetReached && (owner.dusbinStatus == "ready")) && (!owner.isPaused)) {
owner.isTargetReached = false;
owner.selectedTarget = "dusbin";
owner.calculateAngle(owner.dusbin_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (((sequenceArr[0] == table1) || (sequenceArr[0] == table2)) || (sequenceArr[0] == table3)) {
if ((owner.isTargetReached && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = sequenceArr[0]._name;
owner.calculateAngle(sequenceArr[0]);
if (owner.selectedTarget == "table1") {
owner.selectedTable = 1;
} else if (owner.selectedTarget == "table2") {
owner.selectedTable = 2;
} else if (owner.selectedTarget == "table3") {
owner.selectedTable = 3;
}
eval ("owner.orderbook" + owner.selectedTable).pointer._visible = true;
}
}
}
function CallPause() {
var _local2 = this;
stopAllSounds();
_local2.bg.blink.gotoAndStop(_local2.bg.blink._currentframe);
_local2.customer1.customer.gotoAndStop(_local2.customer1.customer._currentframe);
_local2.customer2.customer.gotoAndStop(_local2.customer2.customer._currentframe);
_local2.customer3.customer.gotoAndStop(_local2.customer3.customer._currentframe);
_local2.special_choco_machines.machine1.blink.gotoAndStop(_local2.special_choco_machines.machine1.blink._currentframe);
_local2.choco_machines.single_machine.blink.gotoAndStop(_local2.choco_machines.single_machine.blink._currentframe);
_local2.salesGirl.coffeeicon.smoke.gotoAndStop(_local2.salesGirl.coffeeicon.smoke._currentframe);
_local2.customer4.customer.gotoAndStop(_local2.customer4.customer._currentframe);
_local2.coin_Anim1.coin.gotoAndStop(_local2.coin_Anim1.coin._currentframe);
_local2.coin_Anim2.coin.gotoAndStop(_local2.coin_Anim2.coin._currentframe);
_local2.coin_Anim3.coin.gotoAndStop(_local2.coin_Anim3.coin._currentframe);
_local2.coin_Anim4.coin.gotoAndStop(_local2.coin_Anim4.coin._currentframe);
_local2.comboClip.combo.gotoAndStop(_local2.comboClip.combo._currentframe);
_local2.orderbook1.heartinClip.gotoAndStop(_local2.orderbook1.heartinClip._currentframe);
_local2.orderbook2.heartinClip.gotoAndStop(_local2.orderbook2.heartinClip._currentframe);
_local2.orderbook3.heartinClip.gotoAndStop(_local2.orderbook3.heartinClip._currentframe);
_local2.orderbook4.heartinClip.gotoAndStop(_local2.orderbook4.heartinClip._currentframe);
_local2.curScoreClip.gotoAndStop(_local2.curScoreClip._currentframe);
_local2.coin_Anim1.coin.coin_rotate.gotoAndStop(_local2.coin_Anim1.coin.coin_rotate._currentframe);
_local2.coin_Anim1.coin.coin_rotate2.gotoAndStop(_local2.coin_Anim1.coin.coin_rotate2._currentframe);
_local2.coin_Anim1.coin.coin_rotate3.gotoAndStop(_local2.coin_Anim1.coin.coin_rotate3._currentframe);
_local2.coin_Anim1.coin.coin_rotate4.gotoAndStop(_local2.coin_Anim1.coin.coin_rotate4._currentframe);
_local2.coin_Anim2.coin.coin_rotate.gotoAndStop(_local2.coin_Anim2.coin.coin_rotate._currentframe);
_local2.coin_Anim2.coin.coin_rotate2.gotoAndStop(_local2.coin_Anim2.coin.coin_rotate2._currentframe);
_local2.coin_Anim2.coin.coin_rotate3.gotoAndStop(_local2.coin_Anim2.coin.coin_rotate3._currentframe);
_local2.coin_Anim2.coin.coin_rotate4.gotoAndStop(_local2.coin_Anim2.coin.coin_rotate4._currentframe);
_local2.coin_Anim3.coin.coin_rotate.gotoAndStop(_local2.coin_Anim3.coin.coin_rotate._currentframe);
_local2.coin_Anim3.coin.coin_rotate2.gotoAndStop(_local2.coin_Anim3.coin.coin_rotate2._currentframe);
_local2.coin_Anim3.coin.coin_rotate3.gotoAndStop(_local2.coin_Anim3.coin.coin_rotate3._currentframe);
_local2.coin_Anim3.coin.coin_rotate4.gotoAndStop(_local2.coin_Anim3.coin.coin_rotate4._currentframe);
_local2.coin_Anim4.coin.coin_rotate.gotoAndStop(_local2.coin_Anim4.coin.coin_rotate._currentframe);
_local2.coin_Anim4.coin.coin_rotate2.gotoAndStop(_local2.coin_Anim4.coin.coin_rotate2._currentframe);
_local2.coin_Anim4.coin.coin_rotate3.gotoAndStop(_local2.coin_Anim4.coin.coin_rotate3._currentframe);
_local2.coin_Anim4.coin.coin_rotate4.gotoAndStop(_local2.coin_Anim4.coin.coin_rotate4._currentframe);
_local2.comboClip.combo.coin_rotate.gotoAndStop(_local2.comboClip.combo.coin_rotate._currentframe);
if (_local2.scoreIndicateClip._visible) {
_local2.scoreIndicateClip.gotoAndStop(_local2.scoreIndicateClip._currentframe);
}
if (_local2.expertScoreClip._visible) {
_local2.expertScoreClip.gotoAndStop(_local2.expertScoreClip._currentframe);
}
_local2.chocolateClip.mc.gotoAndStop(_local2.chocolateClip.mc._currentframe);
_local2.specialChocolateClip.mc.gotoAndStop(_local2.specialChocolateClip.mc._currentframe);
}
function CallResume() {
var _local4 = this;
if (_global.soundstat == "onn") {
_root.gameSound.start();
}
_local4.bg.blink.gotoAndPlay(_local4.bg.blink._currentframe);
_local4.customer1.customer.gotoAndPlay(_local4.customer1.customer._currentframe);
_local4.customer2.customer.gotoAndPlay(_local4.customer2.customer._currentframe);
_local4.customer3.customer.gotoAndPlay(_local4.customer3.customer._currentframe);
_local4.special_choco_machines.machine1.blink.gotoAndPlay(_local4.special_choco_machines.machine1.blink._currentframe);
_local4.choco_machines.single_machine.blink.gotoAndPlay(_local4.choco_machines.single_machine.blink._currentframe);
_local4.salesGirl.coffeeicon.smoke.gotoAndPlay(_local4.salesGirl.coffeeicon.smoke._currentframe);
_local4.customer4.customer.gotoAndPlay(_local4.customer4.customer._currentframe);
_local4.coin_Anim1.coin.gotoAndPlay(_local4.coin_Anim1.coin._currentframe - 1);
_local4.coin_Anim2.coin.gotoAndPlay(_local4.coin_Anim2.coin._currentframe - 1);
_local4.coin_Anim3.coin.gotoAndPlay(_local4.coin_Anim3.coin._currentframe - 1);
_local4.coin_Anim4.coin.gotoAndPlay(_local4.coin_Anim4.coin._currentframe - 1);
_local4.comboClip.combo.gotoAndPlay(_local4.comboClip.combo._currentframe - 1);
_local4.orderbook1.heartinClip.gotoAndPlay(_local4.orderbook1.heartinClip._currentframe - 1);
_local4.orderbook2.heartinClip.gotoAndPlay(_local4.orderbook2.heartinClip._currentframe - 1);
_local4.orderbook3.heartinClip.gotoAndPlay(_local4.orderbook3.heartinClip._currentframe - 1);
_local4.orderbook4.heartinClip.gotoAndPlay(_local4.orderbook4.heartinClip._currentframe - 1);
_local4.curScoreClip.gotoAndPlay(_local4.curScoreClip._currentframe);
_local4.coin_Anim1.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate._currentframe);
_local4.coin_Anim1.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate2._currentframe);
_local4.coin_Anim1.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate3._currentframe);
_local4.coin_Anim1.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate4._currentframe);
_local4.coin_Anim2.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate._currentframe);
_local4.coin_Anim2.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate2._currentframe);
_local4.coin_Anim2.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate3._currentframe);
_local4.coin_Anim2.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate4._currentframe);
_local4.coin_Anim3.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate._currentframe);
_local4.coin_Anim3.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate2._currentframe);
_local4.coin_Anim3.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate3._currentframe);
_local4.coin_Anim3.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate4._currentframe);
_local4.coin_Anim4.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate._currentframe);
_local4.coin_Anim4.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate2._currentframe);
_local4.coin_Anim4.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate3._currentframe);
_local4.coin_Anim4.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate4._currentframe);
_local4.comboClip.combo.coin_rotate.gotoAndPlay(_local4.comboClip.combo.coin_rotate._currentframe);
if (_local4.scoreIndicateClip._visible) {
_local4.scoreIndicateClip.gotoAndPlay(_local4.scoreIndicateClip._currentframe - 1);
}
if (_local4.expertScoreClip._visible) {
_local4.expertScoreClip.gotoAndPlay(_local4.expertScoreClip._currentframe - 1);
}
_local4.chocolateClip.mc.gotoAndPlay(_local4.chocolateClip.mc._currentframe - 1);
_local4.specialChocolateClip.mc.gotoAndPlay(_local4.specialChocolateClip.mc._currentframe - 1);
}
function ObjectsRollOut() {
table1.onRollOut();
table2.onRollOut();
table3.onRollOut();
choco_machines.onRollOut();
dusbin.onRollOut();
special_choco_machines.onRollOut();
}
function Reset() {
targetclip = "table1";
lobbyArr.length = 0;
lobbyArr = new Array(1, 2, 3);
currentDirection = "down";
targetDirection = "";
isPopup = false;
popup_info = "welcome";
clearInterval(popup_interval);
clearInterval(special_process_interval);
clearInterval(process_interval);
popup_interval = -1;
isTargetReached = true;
selectedTarget = "";
orderno = 0;
score = 0;
ismoveready = false;
orderTaken = 0;
customerCount = 0;
machineStatus = "notready";
dusbinStatus = "notready";
girlwalkframe = 2;
isFirstServeFinished = false;
depthArr.length = 0;
depthArr = new Array(-10313, -10315, -10317);
chocolateTypeArr.length = 0;
chocolateTypeArr = new Array("type_triangle", "type_fish", "type_round", "type_rabbit", "type_box");
customerEnterset = "firstset";
moneyCount = 0;
clearInterval(gameInterval);
gametimer = 0;
isGameOver = false;
combo_bookcnt = 0;
combo_ordercnt = 0;
combo_moneycnt = 0;
curtarget = "";
clearInterval(customerEnterInterval);
clearInterval(customerEnterInterval2);
clearInterval(customerEnterInterval3);
clearInterval(reportInterval);
clearInterval(orderbook1.heatInterval);
clearInterval(orderbook2.heatInterval);
clearInterval(orderbook3.heatInterval);
clearInterval(Re_customerEnterInterval);
isPaused = false;
sequenceArr.length = 0;
sequenceArr = new Array();
Key.removeListener(keylistener);
Key.removeListener(leve4Keyobj);
keyTarget = undefined;
}
var targetclip = "table1";
var lobbyArr = new Array(1, 2, 3);
var currentDirection = "down";
var isPopup = false;
var popup_info = "welcome";
var popup_interval = -1;
var process_interval = -1;
var special_process_interval = -1;
var isTargetReached = true;
var selectedTarget = "";
var orderno = 0;
var ismoveready = false;
var orderTaken = 0;
var customerCount = 0;
var machineStatus = "notready";
var special_machineStatus = "notready";
var dusbinStatus = "notready";
var girlwalkframe = 2;
var isFirstServeFinished = false;
var score = 0;
var depthArr = new Array(-10313, -10315, -10317);
var chocolateTypeArr = new Array("type_triangle", "type_fish", "type_round", "type_rabbit", "type_box");
var customerEnterset = "firstset";
var moneyCount = 0;
var gameInterval = -1;
var gametimer = 0;
var isGameOver = false;
var combo_bookcnt = 0;
var combo_ordercnt = 0;
var combo_moneycnt = 0;
var gamestartInterval = -1;
var curtarget = "";
var customerEnterInterval = -1;
var customerEnterInterval2 = -1;
var customerEnterInterval3 = -1;
var reportInterval = -1;
var isPaused = false;
var machinespeed = 1;
var machineshake = "off";
var specialmachineshake = "off";
var specialmachinespeed = 1;
var sequenceArr = new Array();
var tips = 0;
var Re_customerEnterInterval = -1;
var cusArr = new Array("younglady", "oldlady", "younglady");
var preparecnt = 0;
var spl_preparecnt = 0;
}
Symbol 1702 MovieClip [__Packages.Level5] Frame 0
class Level5 extends MovieClip
{
var salesGirl, btn_pause, _parent, choco_machines, special_choco_machines, coffee_machine, scoreIndicateClip, shopclosedClip, timerClip, chocolate_container, special_chocolate_container, coffeeClip, chocolateClip, phone_mc, popup_mc, selectClip, heartinClip, shopopenClip, reportMc, cancel_mc, infoClip, comboClip, dusbinContainer, curScoreClip, specialChocolateClip, expertScoreClip, table3, table2, table1, coin_Anim3, coin_Anim2, coin_Anim1, dusbin, leve5Keyobj, keyTarget, pauseTarget, scoreClip, radian, targetDirection, preferred_chocolate1, preferred_chocolate2, customer1, attachMovie, orderbook1, getNextHighestDepth, customer2, orderbook2, customer3, orderbook3, selectedTable, moveTarget, keylistener;
function Level5 () {
super();
}
function onLoad() {
var owner = this;
clearInterval(popup_interval);
clearInterval(process_interval);
Reset();
salesGirl.coffeeicon._visible = false;
btn_pause._visible = false;
_parent.pauseClip._visible = false;
salesGirl.gotoAndStop(currentDirection);
salesGirl.chocolateCount = 0;
choco_machines.status = "empty";
special_choco_machines.status = "empty";
coffee_machine.status = "empty";
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
scoreIndicateClip._visible = false;
shopclosedClip._visible = false;
timerClip._visible = false;
chocolate_container._visible = false;
special_chocolate_container._visible = false;
special_chocolate_container.mc.gotoAndStop(1);
coffeeClip._visible = false;
chocolateClip._visible = false;
phone_mc._visible = false;
popup_mc._visible = false;
selectClip._visible = false;
heartinClip._visible = false;
shopopenClip._visible = false;
reportMc._visible = false;
cancel_mc._visible = false;
infoClip._visible = false;
comboClip._visible = false;
dusbinContainer._visible = false;
curScoreClip._visible = false;
specialChocolateClip._visible = false;
expertScoreClip._visible = false;
table2._visible = (table3._visible = false);
table1._visible = false;
coin_Anim2._visible = (coin_Anim3._visible = false);
coin_Anim1._visible = false;
table1.point = 1;
table2.point = 2;
table3.point = 3;
choco_machines._visible = true;
choco_machines.single_machine.gotoAndStop(2);
dusbin._visible = true;
dusbin.gotoAndStop(2);
special_choco_machines._visible = true;
special_choco_machines.gotoAndStop(1);
special_choco_machines.machine1.gotoAndStop(2);
coffee_machine._visible = true;
coffee_machine.gotoAndStop(1);
coffee_machine.intro.gotoAndPlay(1);
gamestartInterval = setInterval(GameStart, 3000, this);
btn_pause.onRelease = function () {
if (this._visible && (owner._parent.pauseClip._visible == false)) {
owner.pauseTarget = "btn_continue";
owner.isPaused = true;
owner.isPopup = true;
this._visible = false;
owner._parent.pauseClip._visible = true;
owner._parent.pauseClip.gotoAndPlay(2);
owner.CallPause();
}
};
leve5Keyobj = new Object();
Key.addListener(leve5Keyobj);
leve5Keyobj.onKeyUp = function () {
if (Key.getCode() == 13) {
if ((!owner.isPaused) && (!owner.isGameOver)) {
owner.StoreInSequence();
}
}
};
leve5Keyobj.onKeyDown = function () {
if (Key.getCode() == 37) {
if (!owner.isPaused) {
owner.LeftNavigation();
}
} else if (Key.getCode() == 39) {
if (!owner.isPaused) {
owner.RightNavigation();
}
} else if (Key.getCode() == 38) {
if (!owner.isPaused) {
owner.UpNavigation();
} else {
owner.pauseUpNavigation();
}
} else if (Key.getCode() == 40) {
if (!owner.isPaused) {
owner.DownNavigation();
} else {
owner.pauseDownNavigation();
}
} else if (Key.getCode() == 13) {
if (owner.popup_mc._visible) {
owner.popup_mc.btn_ok.onRelease();
} else if (owner.reportMc._visible) {
if (owner.reportMc._currentframe == 1) {
owner.reportMc.mc.btn_continue.onRelease();
} else {
owner.reportMc.mc.btn_retry.onRelease();
}
} else if (!owner.isPaused) {
owner.EnterFunction();
} else {
owner.PauseEnterFunction();
}
} else if (Key.getAscii() == 27) {
if (!owner.isPaused) {
owner.btn_pause.onRelease();
} else if (owner.isPaused) {
owner._parent.pauseClip.btn_continue.onRelease();
}
}
};
table1.onRollOver = (table2.onRollOver = (table3.onRollOver = function () {
if ((!owner.isPaused) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = this._name;
owner.moveTarget = this._name;
eval ("this.orderbook" + this.point).highlight.gotoAndStop(2);
if (eval ("this.orderbook" + this.point).money_mc._currentframe == 2) {
eval ("this.orderbook" + this.point).highlight_small.gotoAndStop(2);
} else if (eval ("this.orderbook" + this.point).money_mc._currentframe == 3) {
eval ("this.orderbook" + this.point).highlight_small_coin.gotoAndStop(2);
}
}
}));
table1.onRollOut = (table2.onRollOut = (table3.onRollOut = function () {
eval ("this.orderbook" + this.point).highlight.gotoAndStop(1);
if (eval ("this.orderbook" + this.point).money_mc._currentframe == 2) {
eval ("this.orderbook" + this.point).highlight_small.gotoAndStop(1);
} else if (eval ("this.orderbook" + this.point).money_mc._currentframe == 3) {
eval ("this.orderbook" + this.point).highlight_small_coin.gotoAndStop(1);
}
}));
choco_machines.onRollOver = function () {
if (((owner.machineStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.moveTarget = "choco_machines";
owner.keyTarget = "choco_machines";
this.single_machine.gotoAndStop(3);
}
};
choco_machines.onRollOut = (choco_machines.onReleaseOutside = function () {
this.single_machine.gotoAndStop(2);
});
dusbin.onRollOver = function () {
if ((owner.dusbinStatus == "ready") && (!owner.isPaused)) {
owner.ObjectsRollOut();
owner.moveTarget = "dusbin";
owner.keyTarget = "dusbin";
this.gotoAndStop(3);
}
};
dusbin.onRollOut = (dusbin.onReleaseOutside = function () {
this.gotoAndStop(2);
});
coffee_machine.onRollOver = function () {
if (((owner.coffeeStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.moveTarget = "coffee_machine";
owner.keyTarget = "coffee_machine";
this.gotoAndStop(3);
}
};
coffee_machine.onRollOut = (coffee_machine.onReleaseOutside = function () {
this.gotoAndStop(2);
});
special_choco_machines.onRollOver = function () {
if (((owner.special_machineStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.moveTarget = "special_choco_machines";
owner.keyTarget = "special_choco_machines";
this.machine1.gotoAndStop(3);
}
};
special_choco_machines.onRollOut = (special_choco_machines.onReleaseOutside = function () {
this.machine1.gotoAndStop(2);
});
coffee_machine.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.coffee_machine);
}
};
coffee_machine.onPress = function () {
if (((owner.isTargetReached && (!owner.isPaused)) && (owner.coffeeStatus == "ready")) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "coffee_machine";
owner.calculateAngle(owner.coffee_indicate);
this.pointer._visible = true;
}
};
choco_machines.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.choco_machines);
}
};
choco_machines.onPress = function () {
if (((owner.isTargetReached && (owner.machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines";
owner.calculateAngle(owner.chomac_indicate);
this.pointer._visible = true;
}
};
special_choco_machines.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.special_choco_machines);
}
};
special_choco_machines.onPress = function () {
if (((owner.isTargetReached && (owner.special_machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "special_choco_machines";
owner.calculateAngle(owner.splmn_indicate);
this.pointer._visible = true;
}
};
dusbin.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.dusbin);
}
};
dusbin.onPress = function () {
if ((owner.isTargetReached && (owner.dusbinStatus == "ready")) && (!owner.isPaused)) {
owner.isTargetReached = false;
owner.selectedTarget = "dusbin";
owner.calculateAngle(owner.dusbin_indicate);
this.pointer._visible = true;
}
};
table1.onRelease = (table2.onRelease = (table3.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(this);
}
}));
table1.onPress = (table2.onPress = (table3.onPress = function () {
if ((owner.isTargetReached && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = this._name;
owner.calculateAngle(this);
if (owner.selectedTarget == "table1") {
owner.selectedTable = 1;
} else if (owner.selectedTarget == "table2") {
owner.selectedTable = 2;
} else if (owner.selectedTarget == "table3") {
owner.selectedTable = 3;
}
eval ("owner.orderbook" + owner.selectedTable).pointer._visible = true;
}
}));
}
function LeftNavigation() {
if (chocolate_container._visible) {
if (keyTarget == "type_box") {
chocolate_container.mc.type_round.onRollOver();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_triangle.onRollOver();
}
} else if (special_chocolate_container._visible) {
if (special_chocolate_container.mc.type_rabbit._currentframe == 2) {
special_chocolate_container.mc.type_rabbit.onRollOut();
special_chocolate_container.mc.type_fish.onRollOver();
} else if (special_chocolate_container.mc.type_fish._currentframe == 2) {
special_chocolate_container.mc.type_fish.onRollOut();
special_chocolate_container.mc.type_rabbit.onRollOver();
}
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate2) {
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRollOut();
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRollOver();
}
} else if (keyTarget == "coffee_machine") {
coffee_machine.onRollOut();
if (table3._visible) {
table3.onRollOver();
} else if (table2._visible) {
table2.onRollOver();
} else if (table1._visible) {
table1.onRollOver();
}
} else if (keyTarget == "choco_machines") {
choco_machines.onRollOut();
coffee_machine.onRollOver();
} else if (keyTarget == "special_choco_machines") {
special_choco_machines.onRollOut();
choco_machines.onRollOver();
}
}
function RightNavigation() {
if (chocolate_container._visible) {
if (keyTarget == "type_triangle") {
chocolate_container.mc.type_round.onRollOver();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_box.onRollOver();
}
} else if (special_chocolate_container._visible) {
if (special_chocolate_container.mc.type_rabbit._currentframe == 2) {
special_chocolate_container.mc.type_rabbit.onRollOut();
special_chocolate_container.mc.type_fish.onRollOver();
} else if (special_chocolate_container.mc.type_fish._currentframe == 2) {
special_chocolate_container.mc.type_fish.onRollOut();
special_chocolate_container.mc.type_rabbit.onRollOver();
}
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate1) {
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRollOut();
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRollOver();
}
} else if (keyTarget == undefined) {
coffee_machine.onRollOver();
} else if (keyTarget == "coffee_machine") {
coffee_machine.onRollOut();
choco_machines.onRollOver();
} else if (keyTarget == "choco_machines") {
choco_machines.onRollOut();
special_choco_machines.onRollOver();
} else if (((keyTarget == "table1") || (keyTarget == "table2")) || (keyTarget == "table3")) {
eval ("this." + keyTarget).onRollOut();
coffee_machine.onRollOver();
}
}
function UpNavigation() {
if (keyTarget == "table1") {
if (table2._visible) {
table1.onRollOut();
table2.onRollOver();
} else if (table3._visible) {
table1.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "table2") {
if (table3._visible) {
table2.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "dusbin") {
dusbin.onRollOut();
special_choco_machines.onRollOver();
}
}
function DownNavigation() {
if (keyTarget == "table3") {
if (table2._visible) {
table3.onRollOut();
table2.onRollOver();
} else if (table1._visible) {
table3.onRollOut();
table1.onRollOver();
}
} else if (keyTarget == "table2") {
if (table1._visible) {
table2.onRollOut();
table1.onRollOver();
}
} else if (keyTarget == "special_choco_machines") {
special_choco_machines.onRollOut();
dusbin.onRollOver();
}
}
function EnterFunction() {
if (chocolate_container._visible) {
if (keyTarget == "type_triangle") {
chocolate_container.mc.type_triangle.onRelease();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_round.onRelease();
} else if (keyTarget == "type_box") {
chocolate_container.mc.type_box.onRelease();
}
} else if (special_chocolate_container._visible) {
eval ("this.special_chocolate_container.mc." + keyTarget).onRelease();
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate1) {
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRelease();
} else if (keyTarget == _global.preferred_chocolate2) {
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRelease();
}
} else {
eval ("this." + keyTarget).onPress();
}
}
function PauseEnterFunction() {
eval ("this._parent.pauseClip." + pauseTarget).onRelease();
}
function pauseUpNavigation() {
if (pauseTarget == "btn_premium") {
_parent.pauseClip.btn_premium.onRollOut();
_parent.pauseClip.btn_mainmenu.onRollOver();
} else if (pauseTarget == "btn_mainmenu") {
_parent.pauseClip.btn_mainmenu.onRollOut();
_parent.pauseClip.btn_restart.onRollOver();
} else if (pauseTarget == "btn_restart") {
_parent.pauseClip.btn_restart.onRollOut();
_parent.pauseClip.btn_continue.onRollOver();
}
}
function pauseDownNavigation() {
if (pauseTarget == "pause") {
_parent.pauseClip.btn_continue.onRollOver();
} else if (pauseTarget == "btn_continue") {
_parent.pauseClip.btn_continue.onRollOut();
_parent.pauseClip.btn_restart.onRollOver();
} else if (pauseTarget == "btn_restart") {
_parent.pauseClip.btn_restart.onRollOut();
_parent.pauseClip.btn_mainmenu.onRollOver();
} else if (pauseTarget == "btn_mainmenu") {
_parent.pauseClip.btn_mainmenu.onRollOut();
_parent.pauseClip.btn_premium.onRollOver();
}
}
function updateScore() {
scoreClip.score_txt.text = score;
scoreClip.loading.gotoAndStop(score);
if ((score >= 200) && (scoreClip.target._currentframe == 1)) {
scoreClip.target.gotoAndPlay(1);
scoreIndicateClip._visible = true;
scoreIndicateClip.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.target_score_Sound.start();
}
}
if ((score >= 300) && (scoreClip.expert._currentframe == 1)) {
scoreClip.expert.gotoAndPlay(1);
expertScoreClip._visible = true;
expertScoreClip.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.expert_score_Sound.start();
}
}
}
function onEnterFrame() {
var owner = this;
if (((!isPopup) && (!isTargetReached)) && (!owner.isPaused)) {
shopperMovement();
}
if (machineshake == "onn") {
machinespeed = -machinespeed;
choco_machines._x = choco_machines._x + ((1 * machinespeed) / 2);
choco_machines._y = choco_machines._y + ((1 * machinespeed) / 2);
}
if (specialmachineshake == "onn") {
specialmachinespeed = -specialmachinespeed;
special_choco_machines._x = special_choco_machines._x + ((1 * specialmachinespeed) / 2);
special_choco_machines._y = special_choco_machines._y + ((1 * specialmachinespeed) / 2);
} else {
special_choco_machines._x = 631;
special_choco_machines._y = 101;
}
if (coffeemachineshake == "onn") {
coffeemachinespeed = -coffeemachinespeed;
coffee_machine._x = coffee_machine._x + ((1 * coffeemachinespeed) / 2);
coffee_machine._y = coffee_machine._y + ((1 * coffeemachinespeed) / 2);
}
_parent.pauseClip.btn_continue.onRollOver = (_parent.pauseClip.btn_restart.onRollOver = (_parent.pauseClip.btn_mainmenu.onRollOver = (_parent.pauseClip.btn_premium.onRollOver = function () {
owner._parent.pauseClip.btn_continue.onRollOut();
owner._parent.pauseClip.btn_restart.onRollOut();
owner._parent.pauseClip.btn_mainmenu.onRollOut();
owner._parent.pauseClip.btn_premium.onRollOut();
owner.pauseTarget = this._name;
this.gotoAndStop(2);
})));
_parent.pauseClip.btn_continue.onRollOut = (_parent.pauseClip.btn_restart.onRollOut = (_parent.pauseClip.btn_mainmenu.onRollOut = (_parent.pauseClip.btn_premium.onRollOut = function () {
this.gotoAndStop(1);
})));
_parent.pauseClip.btn_continue.onRelease = function () {
owner.isPaused = false;
owner.isPopup = false;
owner.btn_pause._visible = true;
owner._parent.pauseClip._visible = false;
owner.CallResume();
};
_parent.pauseClip.btn_restart.onRelease = function () {
owner.Reset();
owner._parent.play();
};
_parent.pauseClip.btn_mainmenu.onRelease = function () {
owner.Reset();
owner._parent.gotoAndStop("mainmenu");
};
_parent.pauseClip.btn_premium.onRelease = function () {
this.getURL(_root.urlname, "_blank");
};
popup_mc.btn_ok.onRollOver = function () {
this.gotoAndStop(2);
};
popup_mc.btn_ok.onRollOut = (popup_mc.btn_ok.onReleaseOutside = function () {
this.gotoAndStop(1);
});
chocolate_container.mc.type_triangle.onRollOver = (chocolate_container.mc.type_round.onRollOver = (chocolate_container.mc.type_box.onRollOver = function () {
if (!owner.isPaused) {
owner.keyTarget = this._name;
owner.chocolate_container.mc.type_triangle.gotoAndStop(1);
owner.chocolate_container.mc.type_round.gotoAndStop(1);
owner.chocolate_container.mc.type_box.gotoAndStop(1);
this.gotoAndStop(2);
}
}));
chocolate_container.mc.type_triangle.onRelease = (chocolate_container.mc.type_round.onRelease = (chocolate_container.mc.type_box.onRelease = function () {
if (!owner.isPaused) {
owner.infoClip._visible = false;
owner.chocolateClip._visible = true;
owner.chocolateClip.gotoAndStop(this._name);
owner.chocolateClip.mc.gotoAndPlay(1);
owner.isTargetReached = true;
owner.preferred_box_chocolate = this._name;
if (owner.choco_machines.status == "empty") {
owner.choco_machines.status = "prepared";
}
owner.preparecnt = 0;
owner.process_interval = setInterval(owner.IdleProcess, 100, owner);
owner.chocolate_container.gotoAndStop(2);
owner.isPopup = false;
owner.dusbinStatus = "ready";
owner.machineStatus = "ready";
owner.machineshake = "onn";
owner.keyTarget = "choco_machines";
if (_global.soundstat == "onn") {
_root.choco_producing_Sound.start();
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
}));
chocolate_container.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.machineStatus = "ready";
owner.chocolate_container._visible = false;
owner.isPopup = false;
owner.dusbinStatus = "ready";
owner.keyTarget = "choco_machines";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
special_chocolate_container.mc.type_rabbit.onRollOver = (special_chocolate_container.mc.type_fish.onRollOver = function () {
if (!owner.isPaused) {
owner.keyTarget = this._name;
owner.special_chocolate_container.mc.type_rabbit.gotoAndStop(1);
owner.special_chocolate_container.mc.type_fish.gotoAndStop(1);
this.gotoAndStop(2);
}
});
special_chocolate_container.mc.type_rabbit.onRelease = (special_chocolate_container.mc.type_fish.onRelease = function () {
if (!owner.isPaused) {
owner.infoClip._visible = false;
owner.specialChocolateClip._visible = true;
owner.specialChocolateClip.gotoAndStop(this._name);
owner.specialChocolateClip.mc.gotoAndPlay(1);
owner.isTargetReached = true;
owner.preferred_special_chocolate = this._name;
if (owner.special_choco_machines.status == "empty") {
owner.special_choco_machines.status = "prepared";
}
owner.spl_preparecnt = 0;
owner.special_process_interval = setInterval(owner.SpecialIdleProcess, 100, owner);
owner.special_chocolate_container.gotoAndStop(2);
owner.isPopup = false;
owner.dusbinStatus = "ready";
owner.special_machineStatus = "ready";
owner.specialmachineshake = "onn";
owner.keyTarget = "special_choco_machines";
if (_global.soundstat == "onn") {
_root.choco_producing_Sound.start();
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
});
special_chocolate_container.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.special_machineStatus = "ready";
owner.special_chocolate_container._visible = false;
owner.isPopup = false;
owner.dusbinStatus = "ready";
owner.keyTarget = "special_choco_machines";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
dusbinContainer.mc.chocobox1.type_triangle.onRollOver = (dusbinContainer.mc.chocobox1.type_round.onRollOver = (dusbinContainer.mc.chocobox1.type_box.onRollOver = (dusbinContainer.mc.chocobox2.type_triangle.onRollOver = (dusbinContainer.mc.chocobox2.type_round.onRollOver = (dusbinContainer.mc.chocobox2.type_box.onRollOver = (dusbinContainer.mc.chocobox1.type_rabbit.onRollOver = (dusbinContainer.mc.chocobox1.type_fish.onRollOver = (dusbinContainer.mc.chocobox2.type_rabbit.onRollOver = (dusbinContainer.mc.chocobox2.type_fish.onRollOver = function () {
owner.keyTarget = this._name;
this.gotoAndStop(2);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onRollOut = (dusbinContainer.mc.chocobox1.type_round.onRollOut = (dusbinContainer.mc.chocobox1.type_box.onRollOut = (dusbinContainer.mc.chocobox2.type_triangle.onRollOut = (dusbinContainer.mc.chocobox2.type_round.onRollOut = (dusbinContainer.mc.chocobox2.type_box.onRollOut = (dusbinContainer.mc.chocobox1.type_rabbit.onRollOut = (dusbinContainer.mc.chocobox1.type_fish.onRollOut = (dusbinContainer.mc.chocobox2.type_rabbit.onRollOut = (dusbinContainer.mc.chocobox2.type_fish.onRollOut = function () {
this.gotoAndStop(1);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_round.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_box.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_triangle.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_round.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_box.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_rabbit.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_fish.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_rabbit.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_fish.onReleaseOutside = function () {
this.gotoAndStop(1);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onRelease = (dusbinContainer.mc.chocobox1.type_round.onRelease = (dusbinContainer.mc.chocobox1.type_box.onRelease = (dusbinContainer.mc.chocobox2.type_triangle.onRelease = (dusbinContainer.mc.chocobox2.type_round.onRelease = (dusbinContainer.mc.chocobox2.type_box.onRelease = (dusbinContainer.mc.chocobox1.type_rabbit.onRelease = (dusbinContainer.mc.chocobox1.type_fish.onRelease = (dusbinContainer.mc.chocobox2.type_rabbit.onRelease = (dusbinContainer.mc.chocobox2.type_fish.onRelease = function () {
if (!owner.isPaused) {
if (this._name == owner.preferred_chocolate1) {
owner.preferred_chocolate1 = owner.preferred_chocolate2;
owner.preferred_chocolate2 = null;
owner.salesGirl.chocolateCount--;
owner.girlwalkframe = owner.girlwalkframe / 2;
owner.salesGirl.girlwalk.gotoAndStop(owner.girlwalkframe);
owner.salesGirl.girlwalk.chocobox1.gotoAndStop(owner.preferred_chocolate1);
owner.salesGirl.girlwalk.chocobox2.gotoAndStop(owner.preferred_chocolate2);
} else {
owner.preferred_chocolate2 = null;
owner.salesGirl.chocolateCount--;
owner.girlwalkframe = owner.girlwalkframe / 2;
owner.salesGirl.girlwalk.gotoAndStop(owner.girlwalkframe);
owner.salesGirl.girlwalk.chocobox1.gotoAndStop(owner.preferred_chocolate1);
owner.salesGirl.girlwalk.chocobox2.gotoAndStop(owner.preferred_chocolate2);
}
owner.dusbinStatus = "ready";
owner.dusbinContainer._visible = false;
owner.isPopup = false;
owner.keyTarget = "dusbin";
owner.setGreenHighLight();
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
})))))))));
dusbinContainer.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.dusbinStatus = "ready";
owner.dusbinContainer._visible = false;
owner.isPopup = false;
owner.keyTarget = "dusbin";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
reportMc.mc.btn_continue.onRelease = function () {
owner.Reset();
_global.calenderfrom = "game";
owner._parent.gotoAndStop("calender");
};
reportMc.mc.btn_menu.onRelease = function () {
owner.Reset();
owner._parent.gotoAndStop("mainmenu");
};
reportMc.mc.btn_retry.onRelease = function () {
owner.Reset();
owner._parent.play();
};
popup_mc.btn_ok.onRelease = function () {
if (owner.popup_info == "welcome") {
owner.combo_bookcnt = 0;
owner.combo_ordercnt = 0;
owner.combo_moneycnt = 0;
owner.btn_pause._visible = true;
owner.popupDisable();
var _local1 = owner.getRandom(0, 2);
owner.customerEnterInterval = setInterval(owner.CallCustomer, 2000, owner, owner.lobbyArr[_local1], "younglady");
owner.lobbyArr.splice(_local1, 1);
_local1 = owner.getRandom(0, owner.lobbyArr.length - 1);
owner.customerEnterInterval2 = setInterval(owner.CallCustomer2, 4000, owner, owner.lobbyArr[_local1], "oldlady");
owner.lobbyArr.splice(_local1, 1);
owner.isPopup = false;
owner.popup_info = "level2_start";
owner.bg.gotoAndStop(2);
owner.shopopenClip._visible = true;
owner.shopopenClip.gotoAndPlay(1);
owner.ismoveready = true;
owner.machineStatus = "ready";
owner.special_machineStatus = "ready";
owner.dusbinStatus = "ready";
owner.coffeeStatus = "ready";
owner.timerClip._visible = true;
clearInterval(owner.gameInterval);
owner.gametimer = 0;
owner.gameInterval = setInterval(owner.GameTimeLimit, 700, owner);
owner.Re_customerEnterInterval = setInterval(owner.CallNewCustomer, 6000, owner);
} else if (owner.popup_info == "order") {
owner.popupDisable();
owner.isPopup = false;
owner.popup_info = "";
owner.selectClip._visible = true;
owner.selectClip._x = owner.choco_machines._x;
owner.selectClip._y = owner.choco_machines._y - 80;
} else if (owner.popup_info == "mismatch") {
owner.popupDisable();
owner.isPopup = false;
}
};
}
function shopperMovement() {
var _local3 = (salesGirl._x + salesGirl.pointer._x) - targetclip._x;
var _local2 = (salesGirl._y + salesGirl.pointer._y) - targetclip._y;
var _local5 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
var _local4 = 10;
if (_local5 >= _local4) {
salesGirl._x = salesGirl._x + (Math.cos(radian) * girlspeed);
salesGirl._y = salesGirl._y + (Math.sin(radian) * girlspeed);
} else if (!isTargetReached) {
isTargetReached = true;
salesGirl.gotoAndStop(targetDirection);
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
Manipulate();
updateScore();
}
}
function GameStart(_arg2) {
clearInterval(_arg2.gamestartInterval);
_arg2.isPopup = true;
_global.popupText = "Getting tired? Enjoying a cup of HOT CHOCOLATE from time to time.";
_arg2.ShowPopup(_arg2);
}
function calculateAngle(mc) {
if (!isPopup) {
targetclip = mc;
var x_diff = (eval (mc)._x - (salesGirl._x + salesGirl.pointer._x));
var y_diff = (eval (mc)._y - (salesGirl._y + salesGirl.pointer._y));
radian = Math.atan2(y_diff, x_diff);
if (Math.abs(x_diff) > Math.abs(y_diff)) {
if (x_diff > 0) {
targetDirection = "right";
} else {
targetDirection = "left";
}
} else if (y_diff > 0) {
targetDirection = "down";
} else {
targetDirection = "up";
}
if (curtarget != selectedTarget) {
curtarget = selectedTarget;
salesGirl.gotoAndStop(targetDirection);
salesGirl.girlwalk.gotoAndStop(girlwalkframe - 1);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
}
}
}
function ShowPopup(_arg1) {
clearInterval(_arg1.popup_interval);
_arg1.isPopup = true;
_arg1.popup_mc._visible = true;
_arg1.popup_mc.swapDepths(_arg1.getNextHighestDepth());
_arg1.popup_mc.gotoAndPlay(1);
}
function popupDisable() {
popup_mc.gotoAndStop(1);
popup_mc._visible = false;
}
function CallNewCustomer(_arg1) {
if (!_arg1.isGameOver) {
if ((_arg1.customerCount != 0) && (_arg1.moneyCount != 0)) {
_arg1.CallNextCustomerSet();
}
} else {
clearInterval(_arg1.Re_customerEnterInterval);
}
}
function CallCustomer(_arg2, _arg3, _arg4) {
if (!_arg2.isPaused) {
clearInterval(_arg2.customerEnterInterval);
if (!_arg2.isGameOver) {
_arg2.customerEnter(_arg3, _arg4);
var _local1 = 0;
while (_local1 < _arg2.lobbyArr.length) {
if (_arg2.lobbyArr[_local1] == _arg3) {
_arg2.lobbyArr.splice(_local1, 1);
}
_local1++;
}
} else if ((_arg2.customerCount == 0) && (_arg2.moneyCount == 0)) {
_arg2.callResult();
}
}
}
function CallCustomer2(_arg2, _arg3, _arg4) {
if (!_arg2.isPaused) {
clearInterval(_arg2.customerEnterInterval2);
if (!_arg2.isGameOver) {
_arg2.customerEnter(_arg3, _arg4);
var _local1 = 0;
while (_local1 < _arg2.lobbyArr.length) {
if (_arg2.lobbyArr[_local1] == _arg3) {
_arg2.lobbyArr.splice(_local1, 1);
}
_local1++;
}
} else if ((_arg2.customerCount == 0) && (_arg2.moneyCount == 0)) {
_arg2.callResult();
}
}
}
function CallCustomer3(_arg2, _arg3, _arg4) {
if (!_arg2.isPaused) {
clearInterval(_arg2.customerEnterInterval3);
if (!_arg2.isGameOver) {
_arg2.customerEnter(_arg3, _arg4);
var _local1 = 0;
while (_local1 < _arg2.lobbyArr.length) {
if (_arg2.lobbyArr[_local1] == _arg3) {
_arg2.lobbyArr.splice(_local1, 1);
}
_local1++;
}
} else if ((_arg2.customerCount == 0) && (_arg2.moneyCount == 0)) {
_arg2.callResult();
}
}
}
function Re_CallCustomer(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.Re_customerEnterInterval);
if (!_arg1.isGameOver) {
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function customerEnter(_arg3, _arg2) {
if (_arg3 == 1) {
table1._visible = true;
customer1 = attachMovie(_arg2, "customer1", depthArr[_arg3 - 1], {_x:115, _y:356});
orderbook1 = attachMovie("orderbook", "orderbook1", getNextHighestDepth(), {_x:170, _y:374});
orderbook1.type = "book";
customer1.type = _arg2;
orderbook1.heatcnt = 0;
if (_arg2 == "oldlady") {
orderbook1.heatInterval = setInterval(HeatFunction, 550, orderbook1, this, 1);
} else if (_arg2 == "younglady") {
orderbook1.heatInterval = setInterval(HeatFunction, 250, orderbook1, this, 1);
}
} else if (_arg3 == 2) {
table2._visible = true;
customer2 = attachMovie(_arg2, "customer2", depthArr[_arg3 - 1], {_x:119, _y:235});
orderbook2 = attachMovie("orderbook", "orderbook2", getNextHighestDepth(), {_x:177, _y:278});
orderbook2.type = "book";
customer2.type = _arg2;
orderbook2.heatcnt = 0;
if (_arg2 == "oldlady") {
orderbook2.heatInterval = setInterval(HeatFunction, 550, orderbook2, this, 2);
} else if (_arg2 == "younglady") {
orderbook2.heatInterval = setInterval(HeatFunction, 250, orderbook2, this, 2);
}
} else if (_arg3 == 3) {
table3._visible = true;
customer3 = attachMovie(_arg2, "customer3", depthArr[_arg3 - 1], {_x:127, _y:140});
orderbook3 = attachMovie("orderbook", "orderbook3", getNextHighestDepth(), {_x:184, _y:185});
orderbook3.type = "book";
customer3.type = _arg2;
orderbook3.heatcnt = 0;
if (_arg2 == "oldlady") {
orderbook3.heatInterval = setInterval(HeatFunction, 550, orderbook3, this, 3);
} else if (_arg2 == "younglady") {
orderbook3.heatInterval = setInterval(HeatFunction, 250, orderbook3, this, 3);
}
}
customerCount++;
moneyCount++;
orderTaken++;
salesGirl.swapDepths(getNextHighestDepth());
scoreIndicateClip.swapDepths(getNextHighestDepth());
expertScoreClip.swapDepths(getNextHighestDepth());
chocolate_container.swapDepths(getNextHighestDepth());
special_chocolate_container.swapDepths(getNextHighestDepth());
dusbinContainer.swapDepths(getNextHighestDepth());
comboClip.swapDepths(getNextHighestDepth());
reportMc.swapDepths(getNextHighestDepth());
}
function Manipulate() {
var owner = this;
if (selectedTarget == "coffee_machine") {
coffee_machine.pointer._visible = false;
if (coffee_machine.status == "empty") {
coffee_machine.status = "prepared";
coffeeClip._visible = true;
coffeeClip.gotoAndPlay(2);
owner.isTargetReached = true;
owner.coffee_preparecnt = 0;
owner.coffee_process_interval = setInterval(owner.CoffeeIdleProcess, 100, owner);
owner.isPopup = false;
owner.coffeemachineshake = "onn";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
} else if (coffee_machine.status == "coffeeReady") {
coffeeClip._visible = false;
coffee_machine.status = "empty";
salesGirl.coffeeicon._visible = false;
girlspeed = 12;
orderTaken = 0;
salesGirl.gotoAndStop(2);
if (salesGirl.chocolateCount == 0) {
girlwalkframe = 9;
} else if (salesGirl.chocolateCount == 1) {
girlwalkframe = 10;
} else if (salesGirl.chocolateCount == 2) {
girlwalkframe = 11;
}
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.jumpLady.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.jumpLady.chocobox2.gotoAndStop(preferred_chocolate2);
owner.machineStatus = "notready";
owner.special_machineStatus = "notready";
owner.dusbinStatus = "notready";
owner.coffeeStatus = "notready";
owner.isPopup = true;
jumpInterval = setInterval(JumpFinished, 1100, this);
}
} else if (selectedTarget == "choco_machines") {
choco_machines.pointer._visible = false;
if (choco_machines.status == "empty") {
if (owner.salesGirl.chocolateCount < 3) {
chocolate_container._visible = true;
chocolate_container.gotoAndStop(1);
chocolate_container.mc.gotoAndPlay(1);
machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
keyTarget = "type_round";
}
} else if (choco_machines.status == "chocolateReady") {
if (owner.salesGirl.chocolateCount < 2) {
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = owner.preferred_box_chocolate;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = owner.preferred_box_chocolate;
}
owner.salesGirl.chocolateCount++;
chocolateClip._visible = false;
salesGirl.gotoAndStop(2);
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
choco_machines.status = "empty";
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
if (orderbook1.book_mc._currentframe == 74) {
orderbook1.green_highlight._visible = true;
}
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
if (orderbook2.book_mc._currentframe == 74) {
orderbook2.green_highlight._visible = true;
}
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
if (orderbook3.book_mc._currentframe == 74) {
orderbook3.green_highlight._visible = true;
}
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (selectedTarget == "special_choco_machines") {
special_choco_machines.pointer._visible = false;
if (special_choco_machines.status == "empty") {
if (owner.salesGirl.chocolateCount < 3) {
special_chocolate_container._visible = true;
special_chocolate_container.gotoAndStop(1);
special_chocolate_container.mc.gotoAndPlay(1);
special_machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
keyTarget = "type_rabbit";
}
} else if (special_choco_machines.status == "chocolateReady") {
if (owner.salesGirl.chocolateCount < 2) {
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = owner.preferred_special_chocolate;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = owner.preferred_special_chocolate;
}
owner.salesGirl.chocolateCount++;
specialChocolateClip._visible = false;
salesGirl.gotoAndStop(2);
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
special_choco_machines.status = "empty";
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (selectedTarget == "dusbin") {
dusbin.pointer._visible = false;
if (salesGirl.chocolateCount == 1) {
salesGirl.chocolateCount--;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
preferred_chocolate1 = null;
preferred_chocolate2 = null;
owner.setGreenHighLight();
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
} else if (salesGirl.chocolateCount >= 2) {
dusbinStatus = "notready";
isPopup = true;
_global.preferred_chocolate1 = preferred_chocolate1;
_global.preferred_chocolate2 = preferred_chocolate2;
keyTarget = _global.preferred_chocolate1;
dusbinContainer._visible = true;
dusbinContainer.gotoAndStop(1);
dusbinContainer.mc.gotoAndPlay(1);
}
} else if (((selectedTarget == "table1") || (selectedTarget == "table2")) || (selectedTarget == "table3")) {
eval ("this.orderbook" + selectedTable).pointer._visible = false;
if (eval ("this.orderbook" + selectedTable).type == "book") {
combo_bookcnt++;
combo_ordercnt = 0;
combo_moneycnt = 0;
eval ("this.orderbook" + selectedTable).type = "chocolateOrder";
var randomno = owner.getRandom(0, 4);
eval ("this.orderbook" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.customer" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.orderbook" + selectedTable).gotoAndStop(2);
eval ("this.customer" + selectedTable).gotoAndStop(3);
eval ("this.orderbook" + selectedTable).green_highlight._visible = false;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
var heatcntchange = int(eval ("this.orderbook" + selectedTable).heatcnt / 4);
if (heatcntchange > 1) {
eval ("this.orderbook" + selectedTable).heatcnt = heatcntchange;
} else {
eval ("this.orderbook" + selectedTable).heatcnt = 1;
}
CheckForBookCombo();
} else if (eval ("this.orderbook" + selectedTable).type == "chocolateOrder") {
if ((salesGirl.chocolateCount >= 1) && (eval ("this.orderbook" + selectedTable).book_mc._currentframe >= 74)) {
combo_bookcnt = 0;
combo_moneycnt = 0;
if (eval ("owner.customer" + owner.selectedTable).neededchocolate == owner.preferred_chocolate1) {
combo_ordercnt++;
preferred_chocolate1 = preferred_chocolate2;
preferred_chocolate2 = null;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
eval ("this.orderbook" + selectedTable).type = "money";
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable).gotoAndStop(3);
eval ("this.customer" + selectedTable).gotoAndStop(5);
if ((eval ("this.orderbook" + selectedTable).heatcnt > 60) && (eval ("this.orderbook" + selectedTable).heatcnt <= 100)) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(2);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
} else if (eval ("this.orderbook" + selectedTable).heatcnt > 100) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(3);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
eval ("this.orderbook" + selectedTable).highlight_small._visible = false;
}
clearInterval(eval ("this.orderbook" + selectedTable).heatInterval);
CheckForOrderCombo();
customerCount--;
if (salesGirl.chocolateCount == 1) {
preferred_chocolate1 = null;
}
salesGirl.chocolateCount--;
owner.setGreenHighLight();
if (_global.soundstat == "onn") {
_root.customer_happy_Sound.start();
}
if (!isGameOver) {
CallNextCustomerSet();
}
} else if (eval ("owner.customer" + owner.selectedTable).neededchocolate == owner.preferred_chocolate2) {
combo_ordercnt++;
salesGirl.chocolateCount--;
preferred_chocolate2 = null;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
eval ("this.orderbook" + selectedTable).type = "money";
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable).gotoAndStop(3);
eval ("this.customer" + selectedTable).gotoAndStop(5);
if ((eval ("this.orderbook" + selectedTable).heatcnt > 60) && (eval ("this.orderbook" + selectedTable).heatcnt <= 100)) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(2);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
} else if (eval ("this.orderbook" + selectedTable).heatcnt > 100) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(3);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
eval ("this.orderbook" + selectedTable).highlight_small._visible = false;
}
clearInterval(eval ("this.orderbook" + selectedTable).heatInterval);
CheckForOrderCombo();
customerCount--;
owner.setGreenHighLight();
if (_global.soundstat == "onn") {
_root.customer_happy_Sound.start();
}
if (!isGameOver) {
CallNextCustomerSet();
}
}
}
} else if (eval ("this.orderbook" + selectedTable).type == "money") {
combo_bookcnt = 0;
combo_ordercnt = 0;
combo_moneycnt++;
moneyCount--;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(2);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable)._visible = false;
eval ("this.customer" + selectedTable)._visible = false;
eval ("this.table" + selectedTable)._visible = false;
eval ("this.orderbook" + selectedTable).type = "empty";
CheckForMoneyCombo();
if (orderTaken >= 6) {
salesGirl.coffeeicon._visible = true;
girlspeed = 6;
}
lobbyArr.push(selectedTable);
if ((customerCount == 0) && (moneyCount == 0)) {
if (!isGameOver) {
if (lobbyArr.length == 3) {
customerCount = 0;
moneyCount = 0;
owner.table2._visible = (owner.table3._visible = false);
owner.table1._visible = false;
CallNextCustomerSet();
}
} else {
callResult();
}
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
}
function CallNextCustomerSet() {
var _local2 = this;
clearInterval(_local2.customerEnterInterval);
clearInterval(_local2.customerEnterInterval2);
clearInterval(_local2.customerEnterInterval3);
if (lobbyArr.length == 1) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local6 = Math.ceil((Math.random() * 3) - 1);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 2000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local6]);
var _local5 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local2.lobbyArr.push(_local5);
} else if (lobbyArr.length == 2) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local6 = Math.ceil((Math.random() * 3) - 1);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 1000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local6]);
var _local5 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local6 = Math.ceil((Math.random() * 3) - 1);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 3000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local6]);
var _local7 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local2.lobbyArr.push(_local5);
_local2.lobbyArr.push(_local7);
} else if (lobbyArr.length == 3) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local6 = Math.ceil((Math.random() * 3) - 1);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 1000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local6]);
var _local5 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local6 = Math.ceil((Math.random() * 3) - 1);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 3000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local6]);
var _local7 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local6 = Math.ceil((Math.random() * 3) - 1);
_local2.customerEnterInterval3 = setInterval(_local2.CallCustomer3, 4000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local6]);
var _local4 = _local2.lobbyArr[_local3];
_local2.lobbyArr.splice(_local3, 1);
_local2.lobbyArr.push(_local5);
_local2.lobbyArr.push(_local7);
_local2.lobbyArr.push(_local4);
}
}
function JumpFinished(_arg1) {
clearInterval(_arg1.jumpInterval);
_arg1.machineStatus = "ready";
_arg1.special_machineStatus = "ready";
_arg1.dusbinStatus = "ready";
_arg1.coffeeStatus = "ready";
_arg1.isPopup = false;
_arg1.sequenceArr.splice(0, 1);
if (_arg1.sequenceArr.length >= 1) {
_arg1.CallSequence();
}
}
function setGreenHighLight() {
if (orderbook1.book_mc._currentframe >= 74) {
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
} else {
orderbook1.green_highlight._visible = false;
}
}
if (orderbook2.book_mc._currentframe >= 74) {
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
} else {
orderbook2.green_highlight._visible = false;
}
}
if (orderbook3.book_mc._currentframe >= 74) {
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
} else {
orderbook3.green_highlight._visible = false;
}
}
}
function callResult() {
clearInterval(customerEnterInterval);
clearInterval(customerEnterInterval2);
clearInterval(customerEnterInterval3);
clearInterval(Re_customerEnterInterval);
clearInterval(reportInterval);
clearInterval(orderbook1.heatInterval);
clearInterval(orderbook2.heatInterval);
clearInterval(orderbook3.heatInterval);
clearInterval(jumpInterval);
machineStatus = "notready";
special_machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
_global.report_moneyEarned = score;
_global.report_tips = tips;
_global.targetScore = 200;
_global.expertScore = 300;
btn_pause._visible = false;
dusbinStatus = "notready";
score = score + tips;
if (score < 200) {
reportMc._visible = true;
reportMc.gotoAndStop(2);
reportMc.mc.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.level_failed_Sound.start();
}
} else {
if (_global.soundstat == "onn") {
_root.level_complete_Sound.start();
}
if (_global.levelSelected < 6) {
_global.levelSelected = 6;
}
if (_global.levelFinished <= 5) {
_global.levelFinished = 5;
}
if (score >= 300) {
_global.level5Status = "expert";
} else {
_global.level5Status = "target";
}
_global.level5Score = score;
if (((score >= 200) && (scoreClip.target._currentframe == 1)) || ((score >= 300) && (scoreClip.expert._currentframe == 1))) {
reportInterval = setInterval(CallReport, 2300, this);
} else {
reportMc._visible = true;
reportMc.gotoAndStop(1);
reportMc.mc.gotoAndPlay(2);
}
}
}
function CallReport(_arg1) {
clearInterval(_arg1.reportInterval);
_arg1.reportMc._visible = true;
_arg1.reportMc.gotoAndStop(1);
_arg1.reportMc.mc.gotoAndPlay(2);
}
function HeatFunction(owner, myparent, curpoint) {
if (!myparent.isPaused) {
owner.heatcnt++;
owner.timelimit.gotoAndStop(owner.heatcnt);
if (owner.heatcnt == 100) {
eval ("myparent.customer" + curpoint).gotoAndStop(4);
}
if (owner.heatcnt >= 120) {
clearInterval(owner.heatInterval);
eval ("myparent.customer" + curpoint).gotoAndStop(6);
myparent.moneyCount--;
myparent.customerCount--;
eval ("myparent.orderbook" + curpoint)._visible = false;
eval ("myparent.table" + curpoint)._visible = false;
if (eval ("myparent.customer" + curpoint).type == "oldlady") {
if (myparent.score > 0) {
myparent.curScoreClip._visible = true;
myparent.curScoreClip.gotoAndPlay(1);
if ((myparent.score >= 2) && (myparent.score < 10)) {
myparent.score = myparent.score - 2;
myparent.curScoreClip.disp.score.text = -2;
} else if (myparent.score >= 10) {
myparent.score = myparent.score - 10;
myparent.curScoreClip.disp.score.text = -10;
}
myparent.scoreClip.score_txt.text = myparent.score;
myparent.scoreClip.loading.gotoAndStop(myparent.score);
}
} else if (eval ("myparent.customer" + curpoint).type == "younglady") {
if (myparent.score > 0) {
myparent.curScoreClip._visible = true;
myparent.curScoreClip.gotoAndPlay(1);
if ((myparent.score >= 2) && (myparent.score < 15)) {
myparent.score = myparent.score - 2;
myparent.curScoreClip.disp.score.text = -2;
} else if (myparent.score >= 15) {
myparent.score = myparent.score - 15;
myparent.curScoreClip.disp.score.text = -15;
}
myparent.scoreClip.score_txt.text = myparent.score;
myparent.scoreClip.loading.gotoAndStop(myparent.score);
}
}
eval ("myparent.orderbook" + curpoint).type = "empty";
myparent.lobbyArr.push(curpoint);
if ((myparent.customerCount == 0) && (myparent.moneyCount == 0)) {
if (!myparent.isGameOver) {
myparent.CallNextCustomerSet();
} else {
myparent.callResult();
}
}
}
}
}
function GameTimeLimit(_arg1) {
if (!_arg1.isPaused) {
_arg1.gametimer++;
_arg1.timerClip.gotoAndStop(_arg1.gametimer);
if (_arg1.gametimer >= 90) {
_arg1.isGameOver = true;
_arg1.bg.gotoAndStop(1);
_arg1.shopclosedClip._visible = true;
_arg1.shopclosedClip.gotoAndPlay(1);
_arg1.gametimer = 0;
clearInterval(_arg1.gameInterval);
}
}
}
function CheckForBookCombo() {
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_bookcnt >= 2) {
comboClip._x = eval ("this.customer" + selectedTable)._x - 20;
comboClip._y = eval ("this.customer" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_bookcnt);
comboClip.combo.gotoAndPlay(1);
score = score + 4;
curScoreClip.disp.score.text = 4;
tips = tips + 4;
} else {
score = score + 2;
curScoreClip.disp.score.text = 2;
tips = tips + 2;
}
if (_global.soundstat == "onn") {
eval (("_root.combo" + combo_bookcnt) + "_Sound").start();
}
}
function CheckForOrderCombo() {
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_ordercnt >= 2) {
comboClip._x = eval ("this.customer" + selectedTable)._x - 20;
comboClip._y = eval ("this.customer" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_ordercnt);
comboClip.combo.gotoAndPlay(1);
score = score + 20;
curScoreClip.disp.score.text = 20;
} else {
score = score + 10;
curScoreClip.disp.score.text = 10;
}
if (_global.soundstat == "onn") {
eval (("_root.combo" + combo_ordercnt) + "_Sound").start();
}
}
function CheckForMoneyCombo() {
if (_global.soundstat == "onn") {
eval (("_root.money" + combo_moneycnt) + "_Sound").start();
}
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_moneycnt >= 2) {
comboClip._x = eval ("this.orderbook" + selectedTable)._x - 20;
comboClip._y = eval ("this.orderbook" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_moneycnt);
comboClip.combo.gotoAndPlay(1);
if (eval ("this.orderbook" + selectedTable).neededchocolate == "type_rabbit") {
score = score + (combo_moneycnt * 30);
curScoreClip.disp.score.text = combo_moneycnt * 30;
} else if (eval ("this.customer" + selectedTable).type == "oldlady") {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + (combo_moneycnt * 17);
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + (combo_moneycnt * 14);
curScoreClip.disp.score.text = combo_moneycnt * 14;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + (combo_moneycnt * 11);
curScoreClip.disp.score.text = combo_moneycnt * 11;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + (combo_moneycnt * 10);
curScoreClip.disp.score.text = combo_moneycnt * 10;
}
} else {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + (combo_moneycnt * 24);
curScoreClip.disp.score.text = combo_moneycnt * 24;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + (combo_moneycnt * 21);
curScoreClip.disp.score.text = combo_moneycnt * 21;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + (combo_moneycnt * 17);
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + (combo_moneycnt * 15);
curScoreClip.disp.score.text = combo_moneycnt * 15;
}
}
if (!isGameOver) {
CallNextCustomerSet();
}
} else if (eval ("this.customer" + selectedTable).type == "oldlady") {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + 17;
curScoreClip.disp.score.text = 17;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + 14;
curScoreClip.disp.score.text = 14;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + 11;
curScoreClip.disp.score.text = 11;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + 10;
curScoreClip.disp.score.text = 10;
}
} else {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + 24;
curScoreClip.disp.score.text = combo_moneycnt * 24;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + 21;
curScoreClip.disp.score.text = combo_moneycnt * 21;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + 17;
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + 15;
curScoreClip.disp.score.text = combo_moneycnt * 15;
}
}
}
function IdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.preparecnt++;
if (_arg3.preparecnt >= 20) {
clearInterval(_arg3.process_interval);
_arg3.machineStatus = "ready";
_arg3.machineshake = "off";
if (_arg3.choco_machines.status == "prepared") {
_arg3.choco_machines.status = "chocolateReady";
}
if (_global.soundstat == "onn") {
_root.choco_done_Sound.start();
}
}
}
}
function SpecialIdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.spl_preparecnt++;
if (_arg3.spl_preparecnt >= 40) {
clearInterval(_arg3.special_process_interval);
_arg3.special_machineStatus = "ready";
_arg3.specialmachineshake = "off";
if (_arg3.special_choco_machines.status == "prepared") {
_arg3.special_choco_machines.status = "chocolateReady";
}
if (_global.soundstat == "onn") {
_root.choco_done_Sound.start();
}
}
}
}
function CoffeeIdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.coffee_preparecnt++;
if (_arg3.coffee_preparecnt >= 20) {
clearInterval(_arg3.coffee_process_interval);
_arg3.coffeeStatus = "ready";
_arg3.coffeemachineshake = "off";
_arg3.coffee_machine.status = "coffeeReady";
if (_global.soundstat == "onn") {
_root.hotchoco_done_Sound.start();
}
}
}
}
function getRandom(_arg4, _arg5) {
var _local3 = _arg5 - _arg4;
var _local2 = Math.random() * _local3;
var _local1 = Math.round(_local2);
_local1 = _local1 + _arg4;
return(_local1);
}
function StoreInSequence() {
var owner = this;
eval ("this." + moveTarget).onRelease();
}
function CallSequence() {
var owner = this;
if (sequenceArr[0] == choco_machines) {
if (((owner.isTargetReached && (owner.machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines";
owner.calculateAngle(owner.chomac_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == special_choco_machines) {
if (((owner.isTargetReached && (owner.special_machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "special_choco_machines";
owner.calculateAngle(owner.splmn_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == dusbin) {
if ((owner.isTargetReached && (owner.dusbinStatus == "ready")) && (!owner.isPaused)) {
owner.isTargetReached = false;
owner.selectedTarget = "dusbin";
owner.calculateAngle(owner.dusbin_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == coffee_machine) {
if (((owner.isTargetReached && (!owner.isPaused)) && (owner.coffeeStatus == "ready")) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "coffee_machine";
owner.calculateAngle(owner.coffee_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (((sequenceArr[0] == table1) || (sequenceArr[0] == table2)) || (sequenceArr[0] == table3)) {
if ((owner.isTargetReached && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = sequenceArr[0]._name;
owner.calculateAngle(sequenceArr[0]);
if (owner.selectedTarget == "table1") {
owner.selectedTable = 1;
} else if (owner.selectedTarget == "table2") {
owner.selectedTable = 2;
} else if (owner.selectedTarget == "table3") {
owner.selectedTable = 3;
}
eval ("owner.orderbook" + owner.selectedTable).pointer._visible = true;
}
}
}
function CallPause() {
var _local2 = this;
stopAllSounds();
_local2.bg.blink.gotoAndStop(_local2.bg.blink._currentframe);
_local2.customer1.customer.gotoAndStop(_local2.customer1.customer._currentframe);
_local2.customer2.customer.gotoAndStop(_local2.customer2.customer._currentframe);
_local2.customer3.customer.gotoAndStop(_local2.customer3.customer._currentframe);
_local2.special_choco_machines.machine1.blink.gotoAndStop(_local2.special_choco_machines.machine1.blink._currentframe);
_local2.choco_machines.single_machine.blink.gotoAndStop(_local2.choco_machines.single_machine.blink._currentframe);
_local2.salesGirl.coffeeicon.smoke.gotoAndStop(_local2.salesGirl.coffeeicon.smoke._currentframe);
_local2.customer4.customer.gotoAndStop(_local2.customer4.customer._currentframe);
_local2.coin_Anim1.coin.gotoAndStop(_local2.coin_Anim1.coin._currentframe);
_local2.coin_Anim2.coin.gotoAndStop(_local2.coin_Anim2.coin._currentframe);
_local2.coin_Anim3.coin.gotoAndStop(_local2.coin_Anim3.coin._currentframe);
_local2.coin_Anim4.coin.gotoAndStop(_local2.coin_Anim4.coin._currentframe);
_local2.comboClip.combo.gotoAndStop(_local2.comboClip.combo._currentframe);
_local2.orderbook1.heartinClip.gotoAndStop(_local2.orderbook1.heartinClip._currentframe);
_local2.orderbook2.heartinClip.gotoAndStop(_local2.orderbook2.heartinClip._currentframe);
_local2.orderbook3.heartinClip.gotoAndStop(_local2.orderbook3.heartinClip._currentframe);
_local2.orderbook4.heartinClip.gotoAndStop(_local2.orderbook4.heartinClip._currentframe);
_local2.curScoreClip.gotoAndStop(_local2.curScoreClip._currentframe);
_local2.coin_Anim1.coin.coin_rotate.gotoAndStop(_local2.coin_Anim1.coin.coin_rotate._currentframe);
_local2.coin_Anim1.coin.coin_rotate2.gotoAndStop(_local2.coin_Anim1.coin.coin_rotate2._currentframe);
_local2.coin_Anim1.coin.coin_rotate3.gotoAndStop(_local2.coin_Anim1.coin.coin_rotate3._currentframe);
_local2.coin_Anim1.coin.coin_rotate4.gotoAndStop(_local2.coin_Anim1.coin.coin_rotate4._currentframe);
_local2.coin_Anim2.coin.coin_rotate.gotoAndStop(_local2.coin_Anim2.coin.coin_rotate._currentframe);
_local2.coin_Anim2.coin.coin_rotate2.gotoAndStop(_local2.coin_Anim2.coin.coin_rotate2._currentframe);
_local2.coin_Anim2.coin.coin_rotate3.gotoAndStop(_local2.coin_Anim2.coin.coin_rotate3._currentframe);
_local2.coin_Anim2.coin.coin_rotate4.gotoAndStop(_local2.coin_Anim2.coin.coin_rotate4._currentframe);
_local2.coin_Anim3.coin.coin_rotate.gotoAndStop(_local2.coin_Anim3.coin.coin_rotate._currentframe);
_local2.coin_Anim3.coin.coin_rotate2.gotoAndStop(_local2.coin_Anim3.coin.coin_rotate2._currentframe);
_local2.coin_Anim3.coin.coin_rotate3.gotoAndStop(_local2.coin_Anim3.coin.coin_rotate3._currentframe);
_local2.coin_Anim3.coin.coin_rotate4.gotoAndStop(_local2.coin_Anim3.coin.coin_rotate4._currentframe);
_local2.coin_Anim4.coin.coin_rotate.gotoAndStop(_local2.coin_Anim4.coin.coin_rotate._currentframe);
_local2.coin_Anim4.coin.coin_rotate2.gotoAndStop(_local2.coin_Anim4.coin.coin_rotate2._currentframe);
_local2.coin_Anim4.coin.coin_rotate3.gotoAndStop(_local2.coin_Anim4.coin.coin_rotate3._currentframe);
_local2.coin_Anim4.coin.coin_rotate4.gotoAndStop(_local2.coin_Anim4.coin.coin_rotate4._currentframe);
_local2.comboClip.combo.coin_rotate.gotoAndStop(_local2.comboClip.combo.coin_rotate._currentframe);
if (_local2.scoreIndicateClip._visible) {
_local2.scoreIndicateClip.gotoAndStop(_local2.scoreIndicateClip._currentframe);
}
if (_local2.expertScoreClip._visible) {
_local2.expertScoreClip.gotoAndStop(_local2.expertScoreClip._currentframe);
}
_local2.chocolateClip.mc.gotoAndStop(_local2.chocolateClip.mc._currentframe);
_local2.specialChocolateClip.mc.gotoAndStop(_local2.specialChocolateClip.mc._currentframe);
_local2.coffeeClip.gotoAndStop(_local2.coffeeClip._currentframe);
}
function CallResume() {
var _local4 = this;
if (_global.soundstat == "onn") {
_root.gameSound.start();
}
_local4.bg.blink.gotoAndPlay(_local4.bg.blink._currentframe);
_local4.customer1.customer.gotoAndPlay(_local4.customer1.customer._currentframe);
_local4.customer2.customer.gotoAndPlay(_local4.customer2.customer._currentframe);
_local4.customer3.customer.gotoAndPlay(_local4.customer3.customer._currentframe);
_local4.special_choco_machines.machine1.blink.gotoAndPlay(_local4.special_choco_machines.machine1.blink._currentframe);
_local4.choco_machines.single_machine.blink.gotoAndPlay(_local4.choco_machines.single_machine.blink._currentframe);
_local4.salesGirl.coffeeicon.smoke.gotoAndPlay(_local4.salesGirl.coffeeicon.smoke._currentframe);
_local4.customer4.customer.gotoAndPlay(_local4.customer4.customer._currentframe);
_local4.coin_Anim1.coin.gotoAndPlay(_local4.coin_Anim1.coin._currentframe - 1);
_local4.coin_Anim2.coin.gotoAndPlay(_local4.coin_Anim2.coin._currentframe - 1);
_local4.coin_Anim3.coin.gotoAndPlay(_local4.coin_Anim3.coin._currentframe - 1);
_local4.coin_Anim4.coin.gotoAndPlay(_local4.coin_Anim4.coin._currentframe - 1);
_local4.comboClip.combo.gotoAndPlay(_local4.comboClip.combo._currentframe - 1);
_local4.orderbook1.heartinClip.gotoAndPlay(_local4.orderbook1.heartinClip._currentframe - 1);
_local4.orderbook2.heartinClip.gotoAndPlay(_local4.orderbook2.heartinClip._currentframe - 1);
_local4.orderbook3.heartinClip.gotoAndPlay(_local4.orderbook3.heartinClip._currentframe - 1);
_local4.orderbook4.heartinClip.gotoAndPlay(_local4.orderbook4.heartinClip._currentframe - 1);
_local4.curScoreClip.gotoAndPlay(_local4.curScoreClip._currentframe);
_local4.coin_Anim1.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate._currentframe);
_local4.coin_Anim1.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate2._currentframe);
_local4.coin_Anim1.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate3._currentframe);
_local4.coin_Anim1.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate4._currentframe);
_local4.coin_Anim2.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate._currentframe);
_local4.coin_Anim2.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate2._currentframe);
_local4.coin_Anim2.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate3._currentframe);
_local4.coin_Anim2.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate4._currentframe);
_local4.coin_Anim3.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate._currentframe);
_local4.coin_Anim3.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate2._currentframe);
_local4.coin_Anim3.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate3._currentframe);
_local4.coin_Anim3.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate4._currentframe);
_local4.coin_Anim4.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate._currentframe);
_local4.coin_Anim4.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate2._currentframe);
_local4.coin_Anim4.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate3._currentframe);
_local4.coin_Anim4.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate4._currentframe);
_local4.comboClip.combo.coin_rotate.gotoAndPlay(_local4.comboClip.combo.coin_rotate._currentframe);
if (_local4.scoreIndicateClip._visible) {
_local4.scoreIndicateClip.gotoAndPlay(_local4.scoreIndicateClip._currentframe - 1);
}
if (_local4.expertScoreClip._visible) {
_local4.expertScoreClip.gotoAndPlay(_local4.expertScoreClip._currentframe - 1);
}
_local4.chocolateClip.mc.gotoAndPlay(_local4.chocolateClip.mc._currentframe - 1);
_local4.specialChocolateClip.mc.gotoAndPlay(_local4.specialChocolateClip.mc._currentframe - 1);
_local4.coffeeClip.gotoAndPlay(_local4.coffeeClip._currentframe - 1);
}
function ObjectsRollOut() {
table1.onRollOut();
table2.onRollOut();
table3.onRollOut();
choco_machines.onRollOut();
dusbin.onRollOut();
coffee_machine.onRollOut();
special_choco_machines.onRollOut();
}
function Reset() {
targetclip = "table1";
lobbyArr.length = 0;
lobbyArr = new Array(1, 2, 3);
currentDirection = "down";
targetDirection = "";
isPopup = false;
popup_info = "welcome";
clearInterval(popup_interval);
clearInterval(special_process_interval);
clearInterval(process_interval);
popup_interval = -1;
isTargetReached = true;
selectedTarget = "";
orderno = 0;
score = 0;
ismoveready = false;
orderTaken = 0;
customerCount = 0;
machineStatus = "notready";
dusbinStatus = "notready";
girlwalkframe = 2;
isFirstServeFinished = false;
depthArr.length = 0;
depthArr = new Array(-10313, -10315, -10317);
chocolateTypeArr.length = 0;
chocolateTypeArr = new Array("type_triangle", "type_fish", "type_round", "type_rabbit", "type_box");
customerEnterset = "firstset";
moneyCount = 0;
clearInterval(gameInterval);
gametimer = 0;
isGameOver = false;
combo_bookcnt = 0;
combo_ordercnt = 0;
combo_moneycnt = 0;
curtarget = "";
clearInterval(customerEnterInterval);
clearInterval(customerEnterInterval2);
clearInterval(customerEnterInterval3);
clearInterval(Re_customerEnterInterval);
clearInterval(reportInterval);
clearInterval(orderbook1.heatInterval);
clearInterval(orderbook2.heatInterval);
clearInterval(orderbook3.heatInterval);
clearInterval(jumpInterval);
isPaused = false;
sequenceArr.length = 0;
sequenceArr = new Array();
girlspeed = 12;
Key.removeListener(keylistener);
Key.removeListener(leve5Keyobj);
keyTarget = undefined;
}
var targetclip = "table1";
var lobbyArr = new Array(1, 2, 3);
var currentDirection = "down";
var isPopup = false;
var popup_info = "welcome";
var popup_interval = -1;
var process_interval = -1;
var special_process_interval = -1;
var isTargetReached = true;
var selectedTarget = "";
var orderno = 0;
var ismoveready = false;
var orderTaken = 0;
var customerCount = 0;
var machineStatus = "notready";
var special_machineStatus = "notready";
var dusbinStatus = "notready";
var coffeeStatus = "notready";
var girlwalkframe = 2;
var isFirstServeFinished = false;
var score = 0;
var depthArr = new Array(-10313, -10315, -10317);
var chocolateTypeArr = new Array("type_triangle", "type_fish", "type_round", "type_rabbit", "type_box");
var customerEnterset = "firstset";
var moneyCount = 0;
var gameInterval = -1;
var gametimer = 0;
var isGameOver = false;
var combo_bookcnt = 0;
var combo_ordercnt = 0;
var combo_moneycnt = 0;
var gamestartInterval = -1;
var curtarget = "";
var customerEnterInterval = -1;
var customerEnterInterval2 = -1;
var customerEnterInterval3 = -1;
var reportInterval = -1;
var isPaused = false;
var coffee_process_interval = -1;
var machinespeed = 1;
var machineshake = "off";
var specialmachineshake = "off";
var coffeemachineshake = "off";
var specialmachinespeed = 1;
var coffeemachinespeed = 1;
var girlspeed = 12;
var sequenceArr = new Array();
var jumpInterval = -1;
var tips = 0;
var Re_customerEnterInterval = -1;
var cusArr = new Array("younglady", "oldlady", "younglady");
var preparecnt = 0;
var spl_preparecnt = 0;
var coffee_preparecnt = 0;
}
Symbol 1703 MovieClip [__Packages.Level6] Frame 0
class Level6 extends MovieClip
{
var deliveryboy, salesGirl, btn_pause, _parent, choco_machines, choco_machines2, special_choco_machines, coffee_machine, scoreIndicateClip, shopclosedClip, timerClip, chocolate_container, special_chocolate_container, coffeeClip, chocolateClip, chocolateClip2, popup_mc, selectClip, heartinClip, shopopenClip, reportMc, cancel_mc, infoClip, comboClip, dusbinContainer, curScoreClip, specialChocolateClip, expertScoreClip, table4, table3, table2, table1, coin_Anim4, coin_Anim3, coin_Anim2, coin_Anim1, dusbin, phone_mc, leve6Keyobj, keyTarget, pauseTarget, scoreClip, radian, targetDirection, preferred_chocolate1, preferred_chocolate2, customer4, orderbook4, attachMovie, getNextHighestDepth, customer1, orderbook1, customer2, orderbook2, customer3, orderbook3, selectedTable, re_entry, moveTarget, keylistener;
function Level6 () {
super();
}
function onLoad() {
var owner = this;
clearInterval(popup_interval);
clearInterval(process_interval);
Reset();
deliveryboy._visible = false;
salesGirl.coffeeicon._visible = false;
btn_pause._visible = false;
_parent.pauseClip._visible = false;
salesGirl.gotoAndStop(currentDirection);
salesGirl.chocolateCount = 0;
choco_machines.status = "empty";
choco_machines2.status = "empty";
special_choco_machines.status = "empty";
coffee_machine.status = "empty";
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
scoreIndicateClip._visible = false;
shopclosedClip._visible = false;
timerClip._visible = false;
chocolate_container._visible = false;
special_chocolate_container._visible = false;
special_chocolate_container.mc.gotoAndStop(1);
coffeeClip._visible = false;
chocolateClip._visible = false;
chocolateClip2._visible = false;
popup_mc._visible = false;
selectClip._visible = false;
heartinClip._visible = false;
shopopenClip._visible = false;
reportMc._visible = false;
cancel_mc._visible = false;
infoClip._visible = false;
comboClip._visible = false;
dusbinContainer._visible = false;
curScoreClip._visible = false;
specialChocolateClip._visible = false;
expertScoreClip._visible = false;
table3._visible = (table4._visible = false);
table2._visible = false;
table1._visible = false;
coin_Anim3._visible = (coin_Anim4._visible = false);
coin_Anim2._visible = false;
coin_Anim1._visible = false;
table1.point = 1;
table2.point = 2;
table3.point = 3;
table4.point = 4;
choco_machines._visible = true;
choco_machines.single_machine.gotoAndStop(2);
dusbin._visible = true;
dusbin.gotoAndStop(2);
special_choco_machines._visible = true;
special_choco_machines.gotoAndStop(1);
special_choco_machines.machine1.gotoAndStop(2);
coffee_machine._visible = true;
coffee_machine.gotoAndStop(2);
choco_machines2._visible = false;
choco_machines2.intro.gotoAndStop(1);
choco_machines2.intro.shadow.gotoAndStop(1);
choco_machines2.intro.star.gotoAndStop(1);
phone_mc._visible = true;
phone_mc.intro.gotoAndPlay(2);
_global.popupText = "Select the PHONE to answer a call. Take the order of the client and prepare it. A delivery boy will pick it up later.";
gamestartInterval = setInterval(GameStart, 3000, this);
btn_pause.onRelease = function () {
if (this._visible && (owner._parent.pauseClip._visible == false)) {
owner.pauseTarget = "btn_continue";
owner.isPaused = true;
owner.isPopup = true;
this._visible = false;
owner._parent.pauseClip._visible = true;
owner._parent.pauseClip.gotoAndPlay(2);
owner.CallPause();
}
};
leve6Keyobj = new Object();
Key.addListener(leve6Keyobj);
leve6Keyobj.onKeyUp = function () {
if (Key.getCode() == 13) {
if ((!owner.isPaused) && (!owner.isGameOver)) {
owner.StoreInSequence();
}
}
};
leve6Keyobj.onKeyDown = function () {
if (Key.getCode() == 37) {
if (!owner.isPaused) {
owner.LeftNavigation();
}
} else if (Key.getCode() == 39) {
if (!owner.isPaused) {
owner.RightNavigation();
}
} else if (Key.getCode() == 38) {
if (!owner.isPaused) {
owner.UpNavigation();
} else {
owner.pauseUpNavigation();
}
} else if (Key.getCode() == 40) {
if (!owner.isPaused) {
owner.DownNavigation();
} else {
owner.pauseDownNavigation();
}
} else if (Key.getCode() == 13) {
if (owner.popup_mc._visible) {
owner.popup_mc.btn_ok.onRelease();
} else if (owner.reportMc._visible) {
if (owner.reportMc._currentframe == 1) {
owner.reportMc.mc.btn_continue.onRelease();
} else {
owner.reportMc.mc.btn_retry.onRelease();
}
} else if (!owner.isPaused) {
owner.EnterFunction();
} else {
owner.PauseEnterFunction();
}
} else if (Key.getAscii() == 27) {
if (!owner.isPaused) {
owner.btn_pause.onRelease();
} else if (owner.isPaused) {
owner._parent.pauseClip.btn_continue.onRelease();
}
}
};
phone_mc.onRollOver = function () {
if (((!owner.isPaused) && (owner.table4._visible == true)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
if (owner.ringstat == "off") {
this.ring.gotoAndStop(1);
eval ("owner.orderbook" + this.point).highlight.gotoAndStop(2);
} else {
this.gotoAndStop(3);
}
owner.moveTarget = "phone_mc";
}
};
phone_mc.onRollOut = (phone_mc.onReleaseOutside = function () {
this.gotoAndStop(2);
if (owner.ringstat == "off") {
this.ring.gotoAndStop(1);
eval ("owner.orderbook" + this.point).highlight.gotoAndStop(1);
}
});
table1.onRollOver = (table2.onRollOver = (table3.onRollOver = (table4.onRollOver = function () {
if ((!owner.isPaused) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.moveTarget = this._name;
owner.keyTarget = this._name;
eval ("this.orderbook" + this.point).highlight.gotoAndStop(2);
if (eval ("this.orderbook" + this.point).money_mc._currentframe == 2) {
eval ("this.orderbook" + this.point).highlight_small.gotoAndStop(2);
} else if (eval ("this.orderbook" + this.point).money_mc._currentframe == 3) {
eval ("this.orderbook" + this.point).highlight_small_coin.gotoAndStop(2);
}
}
})));
table1.onRollOut = (table2.onRollOut = (table3.onRollOut = (table4.onRollOut = function () {
eval ("this.orderbook" + this.point).highlight.gotoAndStop(1);
if (eval ("this.orderbook" + this.point).money_mc._currentframe == 2) {
eval ("this.orderbook" + this.point).highlight_small.gotoAndStop(1);
} else if (eval ("this.orderbook" + this.point).money_mc._currentframe == 3) {
eval ("this.orderbook" + this.point).highlight_small_coin.gotoAndStop(1);
}
})));
choco_machines.onRollOver = function () {
if (((owner.machineStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "choco_machines";
owner.moveTarget = "choco_machines";
this.single_machine.gotoAndStop(3);
}
};
choco_machines.onRollOut = (choco_machines.onReleaseOutside = function () {
this.single_machine.gotoAndStop(2);
});
dusbin.onRollOver = function () {
if ((owner.dusbinStatus == "ready") && (!owner.isPaused)) {
owner.ObjectsRollOut();
owner.keyTarget = "dusbin";
owner.moveTarget = "dusbin";
this.gotoAndStop(3);
}
};
dusbin.onRollOut = (dusbin.onReleaseOutside = function () {
this.gotoAndStop(2);
});
coffee_machine.onRollOver = function () {
if (((owner.coffeeStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "coffee_machine";
owner.moveTarget = "coffee_machine";
this.gotoAndStop(3);
}
};
coffee_machine.onRollOut = (coffee_machine.onReleaseOutside = function () {
this.gotoAndStop(2);
});
special_choco_machines.onRollOver = function () {
if (((owner.special_machineStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.moveTarget = "special_choco_machines";
owner.keyTarget = "special_choco_machines";
this.machine1.gotoAndStop(3);
}
};
special_choco_machines.onRollOut = (special_choco_machines.onReleaseOutside = function () {
this.machine1.gotoAndStop(2);
});
coffee_machine.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.coffee_machine);
}
};
coffee_machine.onPress = function () {
if (((owner.isTargetReached && (!owner.isPaused)) && (owner.coffeeStatus == "ready")) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "coffee_machine";
owner.calculateAngle(owner.coffee_indicate);
this.pointer._visible = true;
}
};
choco_machines.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.choco_machines);
}
};
choco_machines.onPress = function () {
if (((owner.isTargetReached && (owner.machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines";
owner.calculateAngle(owner.chomac_indicate);
this.pointer._visible = true;
}
};
special_choco_machines.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.choco_machines2);
}
};
special_choco_machines.onPress = function () {
if (((owner.isTargetReached && (owner.special_machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "special_choco_machines";
owner.calculateAngle(owner.splmn_indicate);
this.pointer._visible = true;
}
};
dusbin.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.dusbin);
}
};
dusbin.onPress = function () {
if ((owner.isTargetReached && (owner.dusbinStatus == "ready")) && (!owner.isPaused)) {
owner.isTargetReached = false;
owner.selectedTarget = "dusbin";
owner.calculateAngle(owner.dusbin_indicate);
this.pointer._visible = true;
}
};
table1.onRelease = (table2.onRelease = (table3.onRelease = (table4.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(this);
}
})));
table1.onPress = (table2.onPress = (table3.onPress = (table4.onPress = function () {
if ((owner.isTargetReached && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = this._name;
if (owner.selectedTarget == "table1") {
owner.calculateAngle(this);
owner.selectedTable = 1;
} else if (owner.selectedTarget == "table2") {
owner.calculateAngle(this);
owner.selectedTable = 2;
} else if (owner.selectedTarget == "table3") {
owner.calculateAngle(this);
owner.selectedTable = 3;
} else if (owner.selectedTarget == "table4") {
owner.calculateAngle(owner.phone_indicate);
owner.selectedTable = 4;
}
eval ("owner.orderbook" + owner.selectedTable).pointer._visible = true;
}
})));
phone_mc.onRelease = function () {
if ((((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) && (owner.table4._visible == true)) {
owner.sequenceArr.push(owner.phone_mc);
}
};
phone_mc.onPress = function () {
if (((owner.isTargetReached && (!owner.isPaused)) && (owner.table4._visible == true)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "table4";
owner.calculateAngle(owner.phone_indicate);
owner.selectedTable = 4;
}
};
}
function LeftNavigation() {
if (chocolate_container._visible) {
if (keyTarget == "type_box") {
chocolate_container.mc.type_round.onRollOver();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_triangle.onRollOver();
}
} else if (special_chocolate_container._visible) {
if (special_chocolate_container.mc.type_rabbit._currentframe == 2) {
special_chocolate_container.mc.type_rabbit.onRollOut();
special_chocolate_container.mc.type_fish.onRollOver();
} else if (special_chocolate_container.mc.type_fish._currentframe == 2) {
special_chocolate_container.mc.type_fish.onRollOut();
special_chocolate_container.mc.type_rabbit.onRollOver();
}
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate2) {
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRollOut();
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRollOver();
}
} else if (keyTarget == "coffee_machine") {
coffee_machine.onRollOut();
if (table3._visible) {
table3.onRollOver();
} else if (table2._visible) {
table2.onRollOver();
} else if (table1._visible) {
table1.onRollOver();
} else if (table4._visible) {
table4.onRollOver();
phone_mc.onRollOver();
}
} else if (keyTarget == "choco_machines") {
choco_machines.onRollOut();
coffee_machine.onRollOver();
} else if (keyTarget == "special_choco_machines") {
special_choco_machines.onRollOut();
choco_machines.onRollOver();
}
}
function RightNavigation() {
if (chocolate_container._visible) {
if (keyTarget == "type_triangle") {
chocolate_container.mc.type_round.onRollOver();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_box.onRollOver();
}
} else if (special_chocolate_container._visible) {
if (special_chocolate_container.mc.type_rabbit._currentframe == 2) {
special_chocolate_container.mc.type_rabbit.onRollOut();
special_chocolate_container.mc.type_fish.onRollOver();
} else if (special_chocolate_container.mc.type_fish._currentframe == 2) {
special_chocolate_container.mc.type_fish.onRollOut();
special_chocolate_container.mc.type_rabbit.onRollOver();
}
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate1) {
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRollOut();
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRollOver();
}
} else if (keyTarget == undefined) {
coffee_machine.onRollOver();
} else if (keyTarget == "coffee_machine") {
coffee_machine.onRollOut();
choco_machines.onRollOver();
} else if (keyTarget == "choco_machines") {
choco_machines.onRollOut();
special_choco_machines.onRollOver();
} else if ((((keyTarget == "table1") || (keyTarget == "table2")) || (keyTarget == "table3")) || (keyTarget == "table4")) {
eval ("this." + keyTarget).onRollOut();
phone_mc.onRollOut();
coffee_machine.onRollOver();
}
}
function UpNavigation() {
if (keyTarget == "table4") {
if (table1._visible) {
table4.onRollOut();
phone_mc.onRollOut();
table1.onRollOver();
} else if (table2._visible) {
table4.onRollOut();
phone_mc.onRollOut();
table1.onRollOut();
table2.onRollOver();
} else if (table3._visible) {
table4.onRollOut();
phone_mc.onRollOut();
table1.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "table1") {
if (table2._visible) {
table1.onRollOut();
table2.onRollOver();
} else if (table3._visible) {
table1.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "table2") {
if (table3._visible) {
table2.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "dusbin") {
dusbin.onRollOut();
special_choco_machines.onRollOver();
}
}
function DownNavigation() {
if (keyTarget == "table3") {
if (table2._visible) {
table3.onRollOut();
table2.onRollOver();
} else if (table1._visible) {
table3.onRollOut();
table1.onRollOver();
} else if (table4._visible) {
table3.onRollOut();
table1.onRollOut();
table4.onRollOver();
phone_mc.onRollOver();
}
} else if (keyTarget == "table2") {
if (table1._visible) {
table2.onRollOut();
table1.onRollOver();
} else if (table4._visible) {
table2.onRollOut();
table1.onRollOut();
table4.onRollOver();
phone_mc.onRollOver();
}
} else if (keyTarget == "table1") {
if (table4._visible) {
table1.onRollOut();
table4.onRollOver();
phone_mc.onRollOver();
}
} else if (keyTarget == "special_choco_machines") {
special_choco_machines.onRollOut();
dusbin.onRollOver();
}
}
function EnterFunction() {
if (chocolate_container._visible) {
if (keyTarget == "type_triangle") {
chocolate_container.mc.type_triangle.onRelease();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_round.onRelease();
} else if (keyTarget == "type_box") {
chocolate_container.mc.type_box.onRelease();
}
} else if (special_chocolate_container._visible) {
eval ("this.special_chocolate_container.mc." + keyTarget).onRelease();
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate1) {
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRelease();
} else if (keyTarget == _global.preferred_chocolate2) {
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRelease();
}
} else {
eval ("this." + keyTarget).onPress();
}
}
function PauseEnterFunction() {
eval ("this._parent.pauseClip." + pauseTarget).onRelease();
}
function pauseUpNavigation() {
if (pauseTarget == "btn_premium") {
_parent.pauseClip.btn_premium.onRollOut();
_parent.pauseClip.btn_mainmenu.onRollOver();
} else if (pauseTarget == "btn_mainmenu") {
_parent.pauseClip.btn_mainmenu.onRollOut();
_parent.pauseClip.btn_restart.onRollOver();
} else if (pauseTarget == "btn_restart") {
_parent.pauseClip.btn_restart.onRollOut();
_parent.pauseClip.btn_continue.onRollOver();
}
}
function pauseDownNavigation() {
if (pauseTarget == "pause") {
_parent.pauseClip.btn_continue.onRollOver();
} else if (pauseTarget == "btn_continue") {
_parent.pauseClip.btn_continue.onRollOut();
_parent.pauseClip.btn_restart.onRollOver();
} else if (pauseTarget == "btn_restart") {
_parent.pauseClip.btn_restart.onRollOut();
_parent.pauseClip.btn_mainmenu.onRollOver();
} else if (pauseTarget == "btn_mainmenu") {
_parent.pauseClip.btn_mainmenu.onRollOut();
_parent.pauseClip.btn_premium.onRollOver();
}
}
function updateScore() {
scoreClip.score_txt.text = score;
scoreClip.loading.gotoAndStop(score);
if ((score >= 220) && (scoreClip.target._currentframe == 1)) {
scoreClip.target.gotoAndPlay(1);
scoreIndicateClip._visible = true;
scoreIndicateClip.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.target_score_Sound.start();
}
}
if ((score >= 480) && (scoreClip.expert._currentframe == 1)) {
scoreClip.expert.gotoAndPlay(1);
expertScoreClip._visible = true;
expertScoreClip.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.expert_score_Sound.start();
}
}
}
function onEnterFrame() {
var owner = this;
if (((!isPopup) && (!isTargetReached)) && (!owner.isPaused)) {
shopperMovement();
}
if (machineshake == "onn") {
machinespeed = -machinespeed;
choco_machines._x = choco_machines._x + ((1 * machinespeed) / 2);
choco_machines._y = choco_machines._y + ((1 * machinespeed) / 2);
}
if (specialmachineshake == "onn") {
specialmachinespeed = -specialmachinespeed;
special_choco_machines._x = special_choco_machines._x + ((1 * specialmachinespeed) / 2);
special_choco_machines._y = special_choco_machines._y + ((1 * specialmachinespeed) / 2);
} else {
special_choco_machines._x = 631;
special_choco_machines._y = 101;
}
if (coffeemachineshake == "onn") {
coffeemachinespeed = -coffeemachinespeed;
coffee_machine._x = coffee_machine._x + ((1 * coffeemachinespeed) / 2);
coffee_machine._y = coffee_machine._y + ((1 * coffeemachinespeed) / 2);
}
if (machine2shake == "onn") {
machine2speed = -machine2speed;
choco_machines2._x = choco_machines2._x + ((1 * machine2speed) / 2);
choco_machines2._y = choco_machines2._y + ((1 * machine2speed) / 2);
}
_parent.pauseClip.btn_continue.onRollOver = (_parent.pauseClip.btn_restart.onRollOver = (_parent.pauseClip.btn_mainmenu.onRollOver = (_parent.pauseClip.btn_premium.onRollOver = function () {
owner._parent.pauseClip.btn_continue.onRollOut();
owner._parent.pauseClip.btn_restart.onRollOut();
owner._parent.pauseClip.btn_mainmenu.onRollOut();
owner._parent.pauseClip.btn_premium.onRollOut();
owner.pauseTarget = this._name;
this.gotoAndStop(2);
})));
_parent.pauseClip.btn_continue.onRollOut = (_parent.pauseClip.btn_restart.onRollOut = (_parent.pauseClip.btn_mainmenu.onRollOut = (_parent.pauseClip.btn_premium.onRollOut = function () {
this.gotoAndStop(1);
})));
_parent.pauseClip.btn_continue.onRelease = function () {
owner.isPaused = false;
owner.isPopup = false;
owner.btn_pause._visible = true;
owner._parent.pauseClip._visible = false;
owner.CallResume();
};
_parent.pauseClip.btn_restart.onRelease = function () {
owner.Reset();
owner._parent.play();
};
_parent.pauseClip.btn_mainmenu.onRelease = function () {
owner.Reset();
owner._parent.gotoAndStop("mainmenu");
};
_parent.pauseClip.btn_premium.onRelease = function () {
this.getURL(_root.urlname, "_blank");
};
popup_mc.btn_ok.onRollOver = function () {
this.gotoAndStop(2);
};
popup_mc.btn_ok.onRollOut = (popup_mc.btn_ok.onReleaseOutside = function () {
this.gotoAndStop(1);
});
chocolate_container.mc.type_triangle.onRollOver = (chocolate_container.mc.type_round.onRollOver = (chocolate_container.mc.type_box.onRollOver = function () {
if (!owner.isPaused) {
owner.keyTarget = this._name;
owner.chocolate_container.mc.type_triangle.gotoAndStop(1);
owner.chocolate_container.mc.type_round.gotoAndStop(1);
owner.chocolate_container.mc.type_box.gotoAndStop(1);
this.gotoAndStop(2);
}
}));
chocolate_container.mc.type_triangle.onRelease = (chocolate_container.mc.type_round.onRelease = (chocolate_container.mc.type_box.onRelease = function () {
if (!owner.isPaused) {
if (owner.selectedTarget == "choco_machines") {
owner.chocolateClip._visible = true;
owner.chocolateClip.gotoAndStop(this._name);
owner.chocolateClip.mc.gotoAndPlay(1);
owner.isTargetReached = true;
owner.preferred_box_chocolate = this._name;
if (owner.choco_machines.status == "empty") {
owner.choco_machines.status = "prepared";
}
owner.machineshake = "onn";
owner.machineStatus = "ready";
owner.preparecnt = 0;
owner.process_interval = setInterval(owner.IdleProcess, 100, owner);
} else if (owner.selectedTarget == "choco_machines2") {
owner.chocolateClip2._visible = true;
owner.chocolateClip2.gotoAndStop(this._name);
owner.chocolateClip2.mc.gotoAndPlay(1);
owner.isTargetReached = true;
owner.preferred_box2_chocolate = this._name;
if (owner.choco_machines2.status == "empty") {
owner.choco_machines2.status = "prepared";
}
owner.machine2shake = "onn";
owner.machine2Status = "ready";
owner.process_interval = setInterval(owner.IdleProcess, 3000, owner);
}
owner.chocolate_container.gotoAndStop(2);
owner.isPopup = false;
owner.dusbinStatus = "ready";
owner.keyTarget = "choco_machines";
if (_global.soundstat == "onn") {
_root.choco_producing_Sound.start();
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
}));
chocolate_container.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.machineStatus = "ready";
owner.chocolate_container._visible = false;
owner.isPopup = false;
owner.dusbinStatus = "ready";
owner.keyTarget = "choco_machines";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
special_chocolate_container.mc.type_rabbit.onRollOver = (special_chocolate_container.mc.type_fish.onRollOver = function () {
if (!owner.isPaused) {
owner.keyTarget = this._name;
owner.special_chocolate_container.mc.type_rabbit.gotoAndStop(1);
owner.special_chocolate_container.mc.type_fish.gotoAndStop(1);
this.gotoAndStop(2);
}
});
special_chocolate_container.mc.type_rabbit.onRelease = (special_chocolate_container.mc.type_fish.onRelease = function () {
if (!owner.isPaused) {
owner.infoClip._visible = false;
owner.specialChocolateClip._visible = true;
owner.specialChocolateClip.gotoAndStop(this._name);
owner.specialChocolateClip.mc.gotoAndPlay(1);
owner.isTargetReached = true;
owner.preferred_special_chocolate = this._name;
if (owner.special_choco_machines.status == "empty") {
owner.special_choco_machines.status = "prepared";
}
owner.spl_preparecnt = 0;
owner.special_process_interval = setInterval(owner.SpecialIdleProcess, 100, owner);
owner.special_chocolate_container.gotoAndStop(2);
owner.isPopup = false;
owner.dusbinStatus = "ready";
owner.special_machineStatus = "ready";
owner.specialmachineshake = "onn";
owner.keyTarget = "special_choco_machines";
if (_global.soundstat == "onn") {
_root.choco_producing_Sound.start();
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
});
special_chocolate_container.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.special_machineStatus = "ready";
owner.special_chocolate_container._visible = false;
owner.isPopup = false;
owner.dusbinStatus = "ready";
owner.keyTarget = "special_choco_machines";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
dusbinContainer.mc.chocobox1.type_triangle.onRollOver = (dusbinContainer.mc.chocobox1.type_round.onRollOver = (dusbinContainer.mc.chocobox1.type_box.onRollOver = (dusbinContainer.mc.chocobox2.type_triangle.onRollOver = (dusbinContainer.mc.chocobox2.type_round.onRollOver = (dusbinContainer.mc.chocobox2.type_box.onRollOver = (dusbinContainer.mc.chocobox1.type_rabbit.onRollOver = (dusbinContainer.mc.chocobox1.type_fish.onRollOver = (dusbinContainer.mc.chocobox2.type_rabbit.onRollOver = (dusbinContainer.mc.chocobox2.type_fish.onRollOver = function () {
owner.keyTarget = this._name;
this.gotoAndStop(2);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onRollOut = (dusbinContainer.mc.chocobox1.type_round.onRollOut = (dusbinContainer.mc.chocobox1.type_box.onRollOut = (dusbinContainer.mc.chocobox2.type_triangle.onRollOut = (dusbinContainer.mc.chocobox2.type_round.onRollOut = (dusbinContainer.mc.chocobox2.type_box.onRollOut = (dusbinContainer.mc.chocobox1.type_rabbit.onRollOut = (dusbinContainer.mc.chocobox1.type_fish.onRollOut = (dusbinContainer.mc.chocobox2.type_rabbit.onRollOut = (dusbinContainer.mc.chocobox2.type_fish.onRollOut = function () {
this.gotoAndStop(1);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_round.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_box.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_triangle.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_round.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_box.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_rabbit.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_fish.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_rabbit.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_fish.onReleaseOutside = function () {
this.gotoAndStop(1);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onRelease = (dusbinContainer.mc.chocobox1.type_round.onRelease = (dusbinContainer.mc.chocobox1.type_box.onRelease = (dusbinContainer.mc.chocobox2.type_triangle.onRelease = (dusbinContainer.mc.chocobox2.type_round.onRelease = (dusbinContainer.mc.chocobox2.type_box.onRelease = (dusbinContainer.mc.chocobox1.type_rabbit.onRelease = (dusbinContainer.mc.chocobox1.type_fish.onRelease = (dusbinContainer.mc.chocobox2.type_rabbit.onRelease = (dusbinContainer.mc.chocobox2.type_fish.onRelease = function () {
if (!owner.isPaused) {
if (this._name == owner.preferred_chocolate1) {
owner.preferred_chocolate1 = owner.preferred_chocolate2;
owner.preferred_chocolate2 = null;
owner.salesGirl.chocolateCount--;
owner.girlwalkframe = owner.girlwalkframe / 2;
owner.salesGirl.girlwalk.gotoAndStop(owner.girlwalkframe);
owner.salesGirl.girlwalk.chocobox1.gotoAndStop(owner.preferred_chocolate1);
owner.salesGirl.girlwalk.chocobox2.gotoAndStop(owner.preferred_chocolate2);
} else {
owner.preferred_chocolate2 = null;
owner.salesGirl.chocolateCount--;
owner.girlwalkframe = owner.girlwalkframe / 2;
owner.salesGirl.girlwalk.gotoAndStop(owner.girlwalkframe);
owner.salesGirl.girlwalk.chocobox1.gotoAndStop(owner.preferred_chocolate1);
owner.salesGirl.girlwalk.chocobox2.gotoAndStop(owner.preferred_chocolate2);
}
owner.dusbinStatus = "ready";
owner.dusbinContainer._visible = false;
owner.isPopup = false;
owner.keyTarget = "dusbin";
owner.setGreenHighLight();
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
})))))))));
dusbinContainer.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.dusbinStatus = "ready";
owner.dusbinContainer._visible = false;
owner.isPopup = false;
owner.keyTarget = "dusbin";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
reportMc.mc.btn_continue.onRelease = function () {
owner.Reset();
_global.calenderfrom = "game";
owner._parent.gotoAndStop("calender");
};
reportMc.mc.btn_menu.onRelease = function () {
owner.Reset();
owner._parent.gotoAndStop("mainmenu");
};
reportMc.mc.btn_retry.onRelease = function () {
owner.Reset();
owner._parent.play();
};
popup_mc.btn_ok.onRelease = function () {
if (owner.popup_info == "welcome") {
owner.combo_bookcnt = 0;
owner.combo_ordercnt = 0;
owner.combo_moneycnt = 0;
owner.btn_pause._visible = true;
owner.popupDisable();
var _local1 = owner.getRandom(0, 2);
owner.customerEnterInterval = setInterval(owner.CallCustomer, 1500, owner, owner.lobbyArr[_local1], "oldlady");
owner.lobbyArr.splice(_local1, 1);
_local1 = owner.getRandom(0, owner.lobbyArr.length - 1);
owner.customerEnterInterval2 = setInterval(owner.CallCustomer2, 2500, owner, owner.lobbyArr[_local1], "younglady");
owner.lobbyArr.splice(_local1, 1);
owner.isPopup = false;
owner.popup_info = "level2_start";
owner.bg.gotoAndStop(2);
owner.shopopenClip._visible = true;
owner.shopopenClip.gotoAndPlay(1);
owner.ismoveready = true;
owner.machineStatus = "ready";
owner.machine2Status = "ready";
owner.special_machineStatus = "ready";
owner.dusbinStatus = "ready";
owner.coffeeStatus = "ready";
owner.timerClip._visible = true;
clearInterval(owner.gameInterval);
owner.gametimer = 0;
owner.gameInterval = setInterval(owner.GameTimeLimit, 650, owner);
owner.Re_customerEnterInterval = setInterval(owner.CallNewCustomer, 3500, owner);
owner.phone_mc.gotoAndStop(2);
owner.phone_mc.ring.gotoAndStop(1);
} else if (owner.popup_info == "order") {
owner.popupDisable();
owner.isPopup = false;
owner.popup_info = "";
owner.selectClip._visible = true;
owner.selectClip._x = owner.choco_machines._x;
owner.selectClip._y = owner.choco_machines._y - 80;
} else if (owner.popup_info == "mismatch") {
owner.popupDisable();
owner.isPopup = false;
}
};
}
function shopperMovement() {
var _local3 = (salesGirl._x + salesGirl.pointer._x) - targetclip._x;
var _local2 = (salesGirl._y + salesGirl.pointer._y) - targetclip._y;
var _local5 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
var _local4 = 10;
if (_local5 >= _local4) {
salesGirl._x = salesGirl._x + (Math.cos(radian) * girlspeed);
salesGirl._y = salesGirl._y + (Math.sin(radian) * girlspeed);
} else if (!isTargetReached) {
isTargetReached = true;
salesGirl.gotoAndStop(targetDirection);
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
Manipulate();
updateScore();
}
}
function GameStart(_arg1) {
clearInterval(_arg1.gamestartInterval);
_arg1.isPopup = true;
_arg1.ShowPopup(_arg1);
}
function calculateAngle(mc) {
if (!isPopup) {
targetclip = mc;
var x_diff = (eval (mc)._x - (salesGirl._x + salesGirl.pointer._x));
var y_diff = (eval (mc)._y - (salesGirl._y + salesGirl.pointer._y));
radian = Math.atan2(y_diff, x_diff);
if (Math.abs(x_diff) > Math.abs(y_diff)) {
if (x_diff > 0) {
targetDirection = "right";
} else {
targetDirection = "left";
}
} else if (y_diff > 0) {
targetDirection = "down";
} else {
targetDirection = "up";
}
if (curtarget != selectedTarget) {
curtarget = selectedTarget;
salesGirl.gotoAndStop(targetDirection);
salesGirl.girlwalk.gotoAndStop(girlwalkframe - 1);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
}
}
}
function ShowPopup(_arg1) {
clearInterval(_arg1.popup_interval);
_arg1.isPopup = true;
_arg1.popup_mc._visible = true;
_arg1.popup_mc.swapDepths(_arg1.getNextHighestDepth());
_arg1.popup_mc.gotoAndPlay(1);
}
function popupDisable() {
popup_mc.gotoAndStop(1);
popup_mc._visible = false;
}
function CallNewCustomer(_arg2) {
if (!_arg2.isGameOver) {
if (_arg2.table4._visible) {
var _local1 = 0;
while (_local1 < _arg2.lobbyArr.length) {
if (_arg2.lobbyArr[_local1] == 1) {
_arg2.lobbyArr.splice(_local1, 1);
}
_local1++;
}
}
if ((_arg2.customerCount != 0) && (_arg2.moneyCount != 0)) {
_arg2.CallNextCustomerSet();
}
} else {
clearInterval(_arg2.Re_customerEnterInterval);
}
}
function CallCustomer(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.customerEnterInterval);
if (!_arg1.isGameOver) {
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function CallCustomer2(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.customerEnterInterval2);
if (!_arg1.isGameOver) {
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function CallCustomer3(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.customerEnterInterval3);
if (!_arg1.isGameOver) {
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function Re_CallCustomer(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.Re_customerEnterInterval);
if (!_arg1.isGameOver) {
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function customerEnter(_arg5, _arg4) {
if (!isGameOver) {
if (_arg4 == "phoneorder") {
ringstat = "onn";
phone_mc._visible = true;
table4._visible = true;
customer4 = phone_mc;
phone_mc.ring._visible = true;
phone_mc.ring.gotoAndPlay(2);
orderbook4 = attachMovie("orderbook", "orderbook4", getNextHighestDepth(), {_x:170, _y:400});
orderbook4._visible = false;
orderbook4.type = "phone";
customer4.type = _arg4;
orderbook4.heatcnt = 0;
orderbook4.heatInterval = setInterval(HeatFunction, 550, orderbook4, this, 4);
phoneringcnt = 0;
phoneInterval = setInterval(HidePhoneOrder, 1000, this);
if (_global.soundstat == "onn") {
_root.phonering_Sound.start();
}
} else if (_arg5 == 1) {
table1._visible = true;
customer1 = attachMovie(_arg4, "customer1", depthArr[_arg5 - 1], {_x:115, _y:356});
orderbook1 = attachMovie("orderbook", "orderbook1", getNextHighestDepth(), {_x:170, _y:374});
orderbook1.type = "book";
customer1.type = _arg4;
orderbook1.heatcnt = 0;
if (_arg4 == "oldlady") {
orderbook1.heatInterval = setInterval(HeatFunction, 550, orderbook1, this, 1);
} else if (_arg4 == "younglady") {
orderbook1.heatInterval = setInterval(HeatFunction, 250, orderbook1, this, 1);
}
} else if (_arg5 == 2) {
table2._visible = true;
customer2 = attachMovie(_arg4, "customer2", depthArr[_arg5 - 1], {_x:119, _y:235});
orderbook2 = attachMovie("orderbook", "orderbook2", getNextHighestDepth(), {_x:177, _y:278});
orderbook2.type = "book";
customer2.type = _arg4;
orderbook2.heatcnt = 0;
if (_arg4 == "oldlady") {
orderbook2.heatInterval = setInterval(HeatFunction, 550, orderbook2, this, 2);
} else if (_arg4 == "younglady") {
orderbook2.heatInterval = setInterval(HeatFunction, 250, orderbook2, this, 2);
}
} else if (_arg5 == 3) {
table3._visible = true;
customer3 = attachMovie(_arg4, "customer3", depthArr[_arg5 - 1], {_x:127, _y:140});
orderbook3 = attachMovie("orderbook", "orderbook3", getNextHighestDepth(), {_x:184, _y:185});
orderbook3.type = "book";
customer3.type = _arg4;
orderbook3.heatcnt = 0;
if (_arg4 == "oldlady") {
orderbook3.heatInterval = setInterval(HeatFunction, 550, orderbook3, this, 3);
} else if (_arg4 == "younglady") {
orderbook3.heatInterval = setInterval(HeatFunction, 250, orderbook3, this, 3);
}
}
customerCount++;
moneyCount++;
orderTaken++;
salesGirl.swapDepths(getNextHighestDepth());
scoreIndicateClip.swapDepths(getNextHighestDepth());
expertScoreClip.swapDepths(getNextHighestDepth());
chocolate_container.swapDepths(getNextHighestDepth());
special_chocolate_container.swapDepths(getNextHighestDepth());
dusbinContainer.swapDepths(getNextHighestDepth());
comboClip.swapDepths(getNextHighestDepth());
reportMc.swapDepths(getNextHighestDepth());
}
}
function HidePhoneOrder(owner) {
if (!owner.isPaused) {
owner.phoneringcnt++;
if (owner.phoneringcnt >= 20) {
clearInterval(owner.phoneInterval);
clearInterval(owner.orderbook4.heatInterval);
owner.moneyCount--;
owner.customerCount--;
owner.orderbook4._visible = false;
owner.table4._visible = false;
owner.orderbook4.type = "empty";
owner.ringstat = "off";
owner.phone_mc.ring.gotoAndStop(1);
_root.phonering_Sound.stop();
if ((owner.customerCount == 0) && (owner.moneyCount == 0)) {
if (!owner.isGameOver) {
owner.CallNextCustomerSet();
} else {
owner.callResult();
}
}
}
}
}
function Manipulate() {
var owner = this;
if (selectedTarget == "coffee_machine") {
coffee_machine.pointer._visible = false;
if (coffee_machine.status == "empty") {
coffee_machine.status = "prepared";
coffeeClip._visible = true;
coffeeClip.gotoAndPlay(2);
owner.isTargetReached = true;
owner.coffee_preparecnt = 0;
owner.coffee_process_interval = setInterval(owner.CoffeeIdleProcess, 100, owner);
owner.isPopup = false;
owner.coffeemachineshake = "onn";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
} else if (coffee_machine.status == "coffeeReady") {
coffeeClip._visible = false;
coffee_machine.status = "empty";
salesGirl.coffeeicon._visible = false;
girlspeed = 12;
orderTaken = 0;
salesGirl.gotoAndStop(2);
if (salesGirl.chocolateCount == 0) {
girlwalkframe = 9;
} else if (salesGirl.chocolateCount == 1) {
girlwalkframe = 10;
} else if (salesGirl.chocolateCount == 2) {
girlwalkframe = 11;
}
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.jumpLady.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.jumpLady.chocobox2.gotoAndStop(preferred_chocolate2);
owner.machineStatus = "notready";
owner.special_machineStatus = "notready";
owner.dusbinStatus = "notready";
owner.coffeeStatus = "notready";
owner.isPopup = true;
jumpInterval = setInterval(JumpFinished, 1100, this);
}
} else if (selectedTarget == "choco_machines") {
choco_machines.pointer._visible = false;
if (choco_machines.status == "empty") {
if (owner.salesGirl.chocolateCount < 3) {
chocolate_container._visible = true;
chocolate_container.gotoAndStop(1);
chocolate_container.mc.gotoAndPlay(1);
machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
keyTarget = "type_round";
}
} else if (choco_machines.status == "chocolateReady") {
if (owner.salesGirl.chocolateCount < 2) {
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = owner.preferred_box_chocolate;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = owner.preferred_box_chocolate;
}
owner.salesGirl.chocolateCount++;
chocolateClip._visible = false;
salesGirl.gotoAndStop(2);
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
choco_machines.status = "empty";
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
if (orderbook1.book_mc._currentframe == 74) {
orderbook1.green_highlight._visible = true;
}
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
if (orderbook2.book_mc._currentframe == 74) {
orderbook2.green_highlight._visible = true;
}
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
if (orderbook3.book_mc._currentframe == 74) {
orderbook3.green_highlight._visible = true;
}
}
if ((orderbook4.neededchocolate == preferred_chocolate1) || (orderbook4.neededchocolate == preferred_chocolate2)) {
if (orderbook4.book_mc._currentframe == 74) {
orderbook4.green_highlight._visible = true;
}
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (selectedTarget == "choco_machines2") {
choco_machines2.pointer._visible = false;
if (choco_machines2.status == "empty") {
if (owner.salesGirl.chocolateCount < 3) {
chocolate_container._visible = true;
chocolate_container.gotoAndStop(1);
chocolate_container.mc.gotoAndPlay(1);
machine2Status = "notready";
dusbinStatus = "notready";
isPopup = true;
}
} else if (choco_machines2.status == "chocolateReady") {
if (owner.salesGirl.chocolateCount < 2) {
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = owner.preferred_box2_chocolate;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = owner.preferred_box2_chocolate;
}
owner.salesGirl.chocolateCount++;
chocolateClip2._visible = false;
salesGirl.gotoAndStop(2);
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
choco_machines2.status = "empty";
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
}
if ((orderbook4.neededchocolate == preferred_chocolate1) || (orderbook4.neededchocolate == preferred_chocolate2)) {
orderbook4.green_highlight._visible = true;
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (selectedTarget == "special_choco_machines") {
special_choco_machines.pointer._visible = false;
if (special_choco_machines.status == "empty") {
if (owner.salesGirl.chocolateCount < 3) {
special_chocolate_container._visible = true;
special_chocolate_container.gotoAndStop(1);
special_chocolate_container.mc.gotoAndPlay(1);
special_machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
keyTarget = "type_rabbit";
}
} else if (special_choco_machines.status == "chocolateReady") {
if (owner.salesGirl.chocolateCount < 2) {
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = owner.preferred_special_chocolate;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = owner.preferred_special_chocolate;
}
owner.salesGirl.chocolateCount++;
specialChocolateClip._visible = false;
salesGirl.gotoAndStop(2);
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
special_choco_machines.status = "empty";
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
}
if ((orderbook4.neededchocolate == preferred_chocolate1) || (orderbook4.neededchocolate == preferred_chocolate2)) {
orderbook4.green_highlight._visible = true;
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (selectedTarget == "dusbin") {
dusbin.pointer._visible = false;
if (salesGirl.chocolateCount == 1) {
salesGirl.chocolateCount--;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
preferred_chocolate1 = null;
preferred_chocolate2 = null;
owner.setGreenHighLight();
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
} else if (salesGirl.chocolateCount >= 2) {
dusbinStatus = "notready";
isPopup = true;
_global.preferred_chocolate1 = preferred_chocolate1;
_global.preferred_chocolate2 = preferred_chocolate2;
keyTarget = _global.preferred_chocolate1;
dusbinContainer._visible = true;
dusbinContainer.gotoAndStop(1);
dusbinContainer.mc.gotoAndPlay(1);
}
} else if ((((selectedTarget == "table1") || (selectedTarget == "table2")) || (selectedTarget == "table3")) || (selectedTarget == "table4")) {
eval ("this.orderbook" + selectedTable).pointer._visible = false;
if (eval ("this.orderbook" + selectedTable).type == "phone") {
isphonecalled = true;
_root.phonering_Sound.stop();
clearInterval(phoneInterval);
combo_bookcnt++;
combo_ordercnt = 0;
combo_moneycnt = 0;
ringstat = "off";
phone_mc.ring.gotoAndStop(1);
eval ("this.orderbook" + selectedTable).type = "chocolateOrder";
var randomno = owner.getRandom(0, 4);
eval ("this.orderbook" + selectedTable)._visible = true;
eval ("this.orderbook" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.customer" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.orderbook" + selectedTable).gotoAndStop(2);
eval ("this.customer" + selectedTable).gotoAndStop(2);
eval ("this.orderbook" + selectedTable).green_highlight._visible = false;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
var heatcntchange = int(eval ("this.orderbook" + selectedTable).heatcnt / 4);
if (heatcntchange > 1) {
eval ("this.orderbook" + selectedTable).heatcnt = heatcntchange;
} else {
eval ("this.orderbook" + selectedTable).heatcnt = 1;
}
CheckForBookCombo();
} else if (eval ("this.orderbook" + selectedTable).type == "book") {
combo_bookcnt++;
combo_ordercnt = 0;
combo_moneycnt = 0;
eval ("this.orderbook" + selectedTable).type = "chocolateOrder";
var randomno = owner.getRandom(0, 4);
eval ("this.orderbook" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.customer" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.orderbook" + selectedTable).gotoAndStop(2);
eval ("this.customer" + selectedTable).gotoAndStop(3);
eval ("this.orderbook" + selectedTable).green_highlight._visible = false;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
var heatcntchange = int(eval ("this.orderbook" + selectedTable).heatcnt / 4);
if (heatcntchange > 1) {
eval ("this.orderbook" + selectedTable).heatcnt = heatcntchange;
} else {
eval ("this.orderbook" + selectedTable).heatcnt = 1;
}
CheckForBookCombo();
} else if (eval ("this.orderbook" + selectedTable).type == "chocolateOrder") {
if ((salesGirl.chocolateCount >= 1) && (eval ("this.orderbook" + selectedTable).book_mc._currentframe >= 74)) {
combo_bookcnt = 0;
combo_moneycnt = 0;
if (eval ("owner.customer" + owner.selectedTable).neededchocolate == owner.preferred_chocolate1) {
combo_ordercnt++;
preferred_chocolate1 = preferred_chocolate2;
preferred_chocolate2 = null;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
if (selectedTarget == "table4") {
orderbook4.type = "none";
orderbook4.temp_box._visible = false;
orderbook4.green_highlight._visible = false;
orderbook4.highlight._visible = false;
orderbook4.timelimit._visible = false;
phone_mc.swapDepths(getNextHighestDepth());
scoreIndicateClip.swapDepths(getNextHighestDepth());
expertScoreClip.swapDepths(getNextHighestDepth());
reportMc.swapDepths(getNextHighestDepth());
deliveryboy._visible = true;
deliveryboy.gotoAndPlay(2);
clearInterval(deliveryinterval);
deliveryinterval = setInterval(callDeliveryBoy, 1500, this);
} else {
eval ("this.orderbook" + selectedTable).type = "money";
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable).gotoAndStop(3);
eval ("this.customer" + selectedTable).gotoAndStop(5);
if ((eval ("this.orderbook" + selectedTable).heatcnt > 60) && (eval ("this.orderbook" + selectedTable).heatcnt <= 100)) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(2);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
} else if (eval ("this.orderbook" + selectedTable).heatcnt > 100) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(3);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
eval ("this.orderbook" + selectedTable).highlight_small._visible = false;
}
if (_global.soundstat == "onn") {
_root.customer_happy_Sound.start();
}
if (!isGameOver) {
if (table4._visible) {
trace("table4visile");
var i = 0;
while (i < lobbyArr.length) {
if (lobbyArr[i] == 1) {
lobbyArr.splice(i, 1);
}
i++;
}
}
CallNextCustomerSet();
}
}
clearInterval(eval ("this.orderbook" + selectedTable).heatInterval);
CheckForOrderCombo();
customerCount--;
if (salesGirl.chocolateCount == 1) {
preferred_chocolate1 = null;
}
salesGirl.chocolateCount--;
owner.setGreenHighLight();
} else if (eval ("owner.customer" + owner.selectedTable).neededchocolate == owner.preferred_chocolate2) {
combo_ordercnt++;
salesGirl.chocolateCount--;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
if (selectedTarget == "table4") {
orderbook4.type = "none";
orderbook4.temp_box._visible = false;
orderbook4.green_highlight._visible = false;
orderbook4.highlight._visible = false;
orderbook4.timelimit._visible = false;
phone_mc.swapDepths(getNextHighestDepth());
scoreIndicateClip.swapDepths(getNextHighestDepth());
expertScoreClip.swapDepths(getNextHighestDepth());
reportMc.swapDepths(getNextHighestDepth());
deliveryboy._visible = true;
deliveryboy.gotoAndPlay(2);
clearInterval(deliveryinterval);
deliveryinterval = setInterval(callDeliveryBoy, 1500, this);
} else {
eval ("this.orderbook" + selectedTable).type = "money";
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable).gotoAndStop(3);
eval ("this.customer" + selectedTable).gotoAndStop(5);
if ((eval ("this.orderbook" + selectedTable).heatcnt > 60) && (eval ("this.orderbook" + selectedTable).heatcnt <= 100)) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(2);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
} else if (eval ("this.orderbook" + selectedTable).heatcnt > 100) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(3);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
eval ("this.orderbook" + selectedTable).highlight_small._visible = false;
}
if (_global.soundstat == "onn") {
_root.customer_happy_Sound.start();
}
if (!isGameOver) {
if (table4._visible) {
trace("table4visile");
var i = 0;
while (i < lobbyArr.length) {
if (lobbyArr[i] == 1) {
lobbyArr.splice(i, 1);
}
i++;
}
}
CallNextCustomerSet();
}
}
clearInterval(eval ("this.orderbook" + selectedTable).heatInterval);
CheckForOrderCombo();
customerCount--;
owner.setGreenHighLight();
}
}
} else if (eval ("this.orderbook" + selectedTable).type == "money") {
combo_bookcnt = 0;
combo_ordercnt = 0;
combo_moneycnt++;
moneyCount--;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(2);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable)._visible = false;
eval ("this.table" + selectedTable)._visible = false;
eval ("this.orderbook" + selectedTable).type = "empty";
if (owner.selectedTarget != "table4") {
eval ("this.customer" + selectedTable)._visible = false;
}
CheckForMoneyCombo();
if (orderTaken >= 6) {
salesGirl.coffeeicon._visible = true;
girlspeed = 6;
}
if (selectedTable != 4) {
lobbyArr.push(selectedTable);
} else if (table1._visible == false) {
lobbyArr.push(1);
}
trace((("money=" + lobbyArr.length) + ", lobby=") + lobbyArr);
if ((customerCount == 0) && (moneyCount == 0)) {
if (!isGameOver) {
customerCount = 0;
moneyCount = 0;
owner.table2._visible = (owner.table3._visible = false);
owner.table1._visible = false;
CallNextCustomerSet();
} else {
callResult();
}
} else if (isGameOver) {
if ((((table1._visible == false) && (table2._visible == false)) && (table3._visible == false)) && (table4._visible == false)) {
callResult();
}
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
}
function ReEntry() {
var _local2 = this;
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
if (table4._visible) {
_local3 = 1;
} else {
_local3 = 0;
}
_local2.Re_customerEnterInterval = setInterval(_local2.Re_CallCustomer, 100, _local2, _local2.lobbyArr[_local3], "younglady");
_local2.lobbyArr.splice(_local3, 1);
}
function CallNextCustomerSet() {
var _local2 = this;
trace("call next cus=" + lobbyArr);
if (lobbyArr.length >= 1) {
if (lobbyArr.length == 1) {
if (((!isphonecalled) && (table4._visible == false)) && (table1._visible == false)) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
clearInterval(_local2.customerEnterInterval2);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 2000, _local2, _local2.lobbyArr[_local3], "phoneorder");
} else {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 1000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
}
} else if (lobbyArr.length == 2) {
re_entry = "onn";
trace("in lobby arr 2=" + isphonecalled);
if (((!isphonecalled) && (table4._visible == false)) && (table1._visible == false)) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local4 = Math.ceil((Math.random() * 3) - 1);
if (_local2.lobbyArr[0] == 1) {
_local3 = 1;
} else if (_local2.lobbyArr[1] == 1) {
_local3 = 0;
}
clearInterval(_local2.customerEnterInterval);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 1000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
clearInterval(_local2.customerEnterInterval2);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 2000, _local2, _local2.lobbyArr[_local3], "phoneorder");
} else {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 100, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval2);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 2000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
}
} else if (lobbyArr.length == 3) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 1000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval2);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 2000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval3);
_local2.customerEnterInterval3 = setInterval(_local2.CallCustomer3, 4000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
}
}
}
function callDeliveryBoy(owner) {
clearInterval(owner.deliveryinterval);
owner.orderbook4.type = "money";
owner.coin_Anim4._visible = true;
owner.coin_Anim4.gotoAndStop(1);
owner.coin_Anim4.coin.gotoAndPlay(1);
owner.orderbook4.gotoAndStop(3);
if ((owner.orderbook4.heatcnt > 60) && (owner.orderbook4.heatcnt <= 100)) {
owner.orderbook4.money_mc.gotoAndStop(2);
owner.orderbook4.highlight._visible = false;
} else if (owner.orderbook4.heatcnt > 100) {
owner.orderbook4.money_mc.gotoAndStop(3);
owner.orderbook4.highlight._visible = false;
owner.orderbook4.highlight_small._visible = false;
}
if (!owner.isGameOver) {
if (owner.table4._visible) {
trace("table4visile");
var i = 0;
while (i < owner.lobbyArr.length) {
if (owner.lobbyArr[i] == 1) {
owner.lobbyArr.splice(i, 1);
}
i++;
}
}
owner.CallNextCustomerSet();
}
}
function JumpFinished(_arg1) {
clearInterval(_arg1.jumpInterval);
_arg1.machineStatus = "ready";
_arg1.special_machineStatus = "ready";
_arg1.dusbinStatus = "ready";
_arg1.coffeeStatus = "ready";
_arg1.isPopup = false;
_arg1.sequenceArr.splice(0, 1);
if (_arg1.sequenceArr.length >= 1) {
_arg1.CallSequence();
}
}
function setGreenHighLight() {
if (orderbook1.book_mc._currentframe >= 74) {
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
} else {
orderbook1.green_highlight._visible = false;
}
}
if (orderbook2.book_mc._currentframe >= 74) {
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
} else {
orderbook2.green_highlight._visible = false;
}
}
if (orderbook3.book_mc._currentframe >= 74) {
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
} else {
orderbook3.green_highlight._visible = false;
}
}
if (orderbook4.book_mc._currentframe >= 74) {
if ((orderbook4.neededchocolate == preferred_chocolate1) || (orderbook4.neededchocolate == preferred_chocolate2)) {
orderbook4.green_highlight._visible = true;
} else {
orderbook4.green_highlight._visible = false;
}
}
}
function callResult() {
clearInterval(customerEnterInterval);
clearInterval(customerEnterInterval2);
clearInterval(customerEnterInterval3);
clearInterval(Re_customerEnterInterval);
clearInterval(reportInterval);
clearInterval(orderbook1.heatInterval);
clearInterval(orderbook2.heatInterval);
clearInterval(orderbook3.heatInterval);
clearInterval(orderbook4.heatInterval);
clearInterval(deliveryinterval);
clearInterval(jumpInterval);
clearInterval(phoneInterval);
machineStatus = "notready";
special_machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
_global.report_moneyEarned = score;
_global.report_tips = tips;
_global.targetScore = 220;
_global.expertScore = 480;
btn_pause._visible = false;
dusbinStatus = "notready";
score = score + tips;
if (score < 220) {
reportMc._visible = true;
reportMc.gotoAndStop(2);
reportMc.mc.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.level_failed_Sound.start();
}
} else {
if (_global.soundstat == "onn") {
_root.level_complete_Sound.start();
}
if (_global.levelSelected < 7) {
_global.levelSelected = 7;
}
if (_global.levelFinished <= 6) {
_global.levelFinished = 6;
}
if (score >= 480) {
_global.level6Status = "expert";
} else {
_global.level6Status = "target";
}
_global.level6Score = score;
if (((score >= 220) && (scoreClip.target._currentframe == 1)) || ((score >= 480) && (scoreClip.expert._currentframe == 1))) {
reportInterval = setInterval(CallReport, 2300, this);
} else {
reportMc._visible = true;
reportMc.gotoAndStop(1);
reportMc.mc.gotoAndPlay(2);
}
}
}
function CallReport(_arg1) {
clearInterval(_arg1.reportInterval);
_arg1.reportMc._visible = true;
_arg1.reportMc.gotoAndStop(1);
_arg1.reportMc.mc.gotoAndPlay(2);
}
function HeatFunction(owner, myparent, curpoint) {
if (!myparent.isPaused) {
owner.heatcnt++;
owner.timelimit.gotoAndStop(owner.heatcnt);
if (owner.heatcnt == 100) {
eval ("myparent.customer" + curpoint).gotoAndStop(4);
}
if (owner.heatcnt >= 120) {
clearInterval(owner.heatInterval);
myparent.moneyCount--;
myparent.customerCount--;
eval ("myparent.orderbook" + curpoint)._visible = false;
eval ("myparent.table" + curpoint)._visible = false;
if (eval ("myparent.customer" + curpoint).type == "oldlady") {
eval ("myparent.customer" + curpoint).gotoAndStop(6);
if (myparent.score > 0) {
myparent.curScoreClip._visible = true;
myparent.curScoreClip.gotoAndPlay(1);
if ((myparent.score >= 2) && (myparent.score < 10)) {
myparent.score = myparent.score - 2;
myparent.curScoreClip.disp.score.text = -2;
} else if (myparent.score >= 10) {
myparent.score = myparent.score - 10;
myparent.curScoreClip.disp.score.text = -10;
}
myparent.scoreClip.score_txt.text = myparent.score;
myparent.scoreClip.loading.gotoAndStop(myparent.score);
}
} else if (eval ("myparent.customer" + curpoint).type == "younglady") {
eval ("myparent.customer" + curpoint).gotoAndStop(6);
if (myparent.score > 0) {
myparent.curScoreClip._visible = true;
myparent.curScoreClip.gotoAndPlay(1);
if ((myparent.score >= 2) && (myparent.score < 15)) {
myparent.score = myparent.score - 2;
myparent.curScoreClip.disp.score.text = -2;
} else if (myparent.score >= 15) {
myparent.score = myparent.score - 15;
myparent.curScoreClip.disp.score.text = -15;
}
myparent.scoreClip.score_txt.text = myparent.score;
myparent.scoreClip.loading.gotoAndStop(myparent.score);
}
}
eval ("myparent.orderbook" + curpoint).type = "empty";
myparent.lobbyArr.push(curpoint);
if ((myparent.customerCount == 0) && (myparent.moneyCount == 0)) {
if (!myparent.isGameOver) {
myparent.CallNextCustomerSet();
} else {
myparent.callResult();
}
}
}
}
}
function GameTimeLimit(_arg1) {
if (!_arg1.isPaused) {
_arg1.gametimer++;
_arg1.timerClip.gotoAndStop(_arg1.gametimer);
if (_arg1.gametimer >= 90) {
_arg1.isGameOver = true;
_arg1.bg.gotoAndStop(1);
_arg1.shopclosedClip._visible = true;
_arg1.shopclosedClip.gotoAndPlay(1);
_arg1.gametimer = 0;
clearInterval(_arg1.gameInterval);
}
}
}
function CheckForBookCombo() {
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_bookcnt >= 2) {
comboClip._x = eval ("this.customer" + selectedTable)._x - 20;
comboClip._y = eval ("this.customer" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_bookcnt);
comboClip.combo.gotoAndPlay(1);
score = score + 4;
curScoreClip.disp.score.text = 4;
tips = tips + 4;
} else {
score = score + 2;
curScoreClip.disp.score.text = 2;
tips = tips + 2;
}
if (_global.soundstat == "onn") {
eval (("_root.combo" + combo_bookcnt) + "_Sound").start();
}
}
function CheckForOrderCombo() {
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_ordercnt >= 2) {
comboClip._x = eval ("this.customer" + selectedTable)._x - 20;
comboClip._y = eval ("this.customer" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_ordercnt);
comboClip.combo.gotoAndPlay(1);
score = score + 20;
curScoreClip.disp.score.text = 20;
} else {
score = score + 10;
curScoreClip.disp.score.text = 10;
}
if (_global.soundstat == "onn") {
eval (("_root.combo" + combo_ordercnt) + "_Sound").start();
}
}
function CheckForMoneyCombo() {
if (_global.soundstat == "onn") {
eval (("_root.money" + combo_moneycnt) + "_Sound").start();
}
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_moneycnt >= 2) {
comboClip._x = eval ("this.orderbook" + selectedTable)._x - 20;
comboClip._y = eval ("this.orderbook" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_moneycnt);
comboClip.combo.gotoAndPlay(1);
if (eval ("this.orderbook" + selectedTable).neededchocolate == "type_rabbit") {
score = score + (combo_moneycnt * 30);
curScoreClip.disp.score.text = combo_moneycnt * 30;
} else if (eval ("this.customer" + selectedTable).type == "oldlady") {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + (combo_moneycnt * 17);
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + (combo_moneycnt * 14);
curScoreClip.disp.score.text = combo_moneycnt * 14;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + (combo_moneycnt * 11);
curScoreClip.disp.score.text = combo_moneycnt * 11;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + (combo_moneycnt * 10);
curScoreClip.disp.score.text = combo_moneycnt * 10;
}
} else {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + (combo_moneycnt * 24);
curScoreClip.disp.score.text = combo_moneycnt * 24;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + (combo_moneycnt * 21);
curScoreClip.disp.score.text = combo_moneycnt * 21;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + (combo_moneycnt * 17);
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + (combo_moneycnt * 15);
curScoreClip.disp.score.text = combo_moneycnt * 15;
}
}
if (!isGameOver) {
if (table4._visible) {
var i = 0;
while (i < lobbyArr.length) {
if (lobbyArr[i] == 1) {
lobbyArr.splice(i, 1);
}
i++;
}
}
CallNextCustomerSet();
}
} else if (eval ("this.customer" + selectedTable).type == "oldlady") {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + 17;
curScoreClip.disp.score.text = 17;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + 14;
curScoreClip.disp.score.text = 14;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + 11;
curScoreClip.disp.score.text = 11;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + 10;
curScoreClip.disp.score.text = 10;
}
} else {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + 24;
curScoreClip.disp.score.text = combo_moneycnt * 24;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + 21;
curScoreClip.disp.score.text = combo_moneycnt * 21;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + 17;
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + 15;
curScoreClip.disp.score.text = combo_moneycnt * 15;
}
}
}
function IdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.preparecnt++;
if (_arg3.preparecnt >= 20) {
clearInterval(_arg3.process_interval);
_arg3.machineStatus = "ready";
_arg3.machineshake = "off";
if (_arg3.choco_machines.status == "prepared") {
_arg3.choco_machines.status = "chocolateReady";
}
if (_global.soundstat == "onn") {
_root.choco_done_Sound.start();
}
}
}
}
function SpecialIdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.spl_preparecnt++;
if (_arg3.spl_preparecnt >= 40) {
clearInterval(_arg3.special_process_interval);
_arg3.special_machineStatus = "ready";
_arg3.specialmachineshake = "off";
if (_arg3.special_choco_machines.status == "prepared") {
_arg3.special_choco_machines.status = "chocolateReady";
}
if (_global.soundstat == "onn") {
_root.choco_done_Sound.start();
}
}
}
}
function CoffeeIdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.coffee_preparecnt++;
if (_arg3.coffee_preparecnt >= 20) {
clearInterval(_arg3.coffee_process_interval);
_arg3.coffeeStatus = "ready";
_arg3.coffeemachineshake = "off";
_arg3.coffee_machine.status = "coffeeReady";
if (_global.soundstat == "onn") {
_root.hotchoco_done_Sound.start();
}
}
}
}
function getRandom(_arg4, _arg5) {
var _local3 = _arg5 - _arg4;
var _local2 = Math.random() * _local3;
var _local1 = Math.round(_local2);
_local1 = _local1 + _arg4;
return(_local1);
}
function StoreInSequence() {
var owner = this;
eval ("this." + moveTarget).onRelease();
}
function CallSequence() {
var owner = this;
if (sequenceArr[0] == choco_machines) {
if (((owner.isTargetReached && (owner.machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines";
owner.calculateAngle(owner.chomac_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == special_choco_machines) {
if (((owner.isTargetReached && (owner.special_machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "special_choco_machines";
owner.calculateAngle(owner.splmn_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == dusbin) {
if ((owner.isTargetReached && (owner.dusbinStatus == "ready")) && (!owner.isPaused)) {
owner.isTargetReached = false;
owner.selectedTarget = "dusbin";
owner.calculateAngle(owner.dusbin_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == coffee_machine) {
if (((owner.isTargetReached && (!owner.isPaused)) && (owner.coffeeStatus == "ready")) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "coffee_machine";
owner.calculateAngle(owner.coffee_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if ((((sequenceArr[0] == table1) || (sequenceArr[0] == table2)) || (sequenceArr[0] == table3)) || (sequenceArr[0] == table4)) {
if ((owner.isTargetReached && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = sequenceArr[0]._name;
owner.calculateAngle(sequenceArr[0]);
if (owner.selectedTarget == "table1") {
owner.selectedTable = 1;
} else if (owner.selectedTarget == "table2") {
owner.selectedTable = 2;
} else if (owner.selectedTarget == "table3") {
owner.selectedTable = 3;
} else if (owner.selectedTarget == "table4") {
owner.selectedTable = 4;
}
eval ("owner.orderbook" + owner.selectedTable).pointer._visible = true;
}
}
}
function CallPause() {
var _local3 = this;
stopAllSounds();
_local3.bg.blink.gotoAndStop(_local3.bg.blink._currentframe);
_local3.customer1.customer.gotoAndStop(_local3.customer1.customer._currentframe);
_local3.customer2.customer.gotoAndStop(_local3.customer2.customer._currentframe);
_local3.customer3.customer.gotoAndStop(_local3.customer3.customer._currentframe);
_local3.special_choco_machines.machine1.blink.gotoAndStop(_local3.special_choco_machines.machine1.blink._currentframe);
_local3.choco_machines.single_machine.blink.gotoAndStop(_local3.choco_machines.single_machine.blink._currentframe);
_local3.salesGirl.coffeeicon.smoke.gotoAndStop(_local3.salesGirl.coffeeicon.smoke._currentframe);
_local3.customer4.customer.gotoAndStop(_local3.customer4.customer._currentframe);
_local3.coin_Anim1.coin.gotoAndStop(_local3.coin_Anim1.coin._currentframe);
_local3.coin_Anim2.coin.gotoAndStop(_local3.coin_Anim2.coin._currentframe);
_local3.coin_Anim3.coin.gotoAndStop(_local3.coin_Anim3.coin._currentframe);
_local3.coin_Anim4.coin.gotoAndStop(_local3.coin_Anim4.coin._currentframe);
_local3.comboClip.combo.gotoAndStop(_local3.comboClip.combo._currentframe);
_local3.orderbook1.heartinClip.gotoAndStop(_local3.orderbook1.heartinClip._currentframe);
_local3.orderbook2.heartinClip.gotoAndStop(_local3.orderbook2.heartinClip._currentframe);
_local3.orderbook3.heartinClip.gotoAndStop(_local3.orderbook3.heartinClip._currentframe);
_local3.orderbook4.heartinClip.gotoAndStop(_local3.orderbook4.heartinClip._currentframe);
_local3.curScoreClip.gotoAndStop(_local3.curScoreClip._currentframe);
_local3.coin_Anim1.coin.coin_rotate.gotoAndStop(_local3.coin_Anim1.coin.coin_rotate._currentframe);
_local3.coin_Anim1.coin.coin_rotate2.gotoAndStop(_local3.coin_Anim1.coin.coin_rotate2._currentframe);
_local3.coin_Anim1.coin.coin_rotate3.gotoAndStop(_local3.coin_Anim1.coin.coin_rotate3._currentframe);
_local3.coin_Anim1.coin.coin_rotate4.gotoAndStop(_local3.coin_Anim1.coin.coin_rotate4._currentframe);
_local3.coin_Anim2.coin.coin_rotate.gotoAndStop(_local3.coin_Anim2.coin.coin_rotate._currentframe);
_local3.coin_Anim2.coin.coin_rotate2.gotoAndStop(_local3.coin_Anim2.coin.coin_rotate2._currentframe);
_local3.coin_Anim2.coin.coin_rotate3.gotoAndStop(_local3.coin_Anim2.coin.coin_rotate3._currentframe);
_local3.coin_Anim2.coin.coin_rotate4.gotoAndStop(_local3.coin_Anim2.coin.coin_rotate4._currentframe);
_local3.coin_Anim3.coin.coin_rotate.gotoAndStop(_local3.coin_Anim3.coin.coin_rotate._currentframe);
_local3.coin_Anim3.coin.coin_rotate2.gotoAndStop(_local3.coin_Anim3.coin.coin_rotate2._currentframe);
_local3.coin_Anim3.coin.coin_rotate3.gotoAndStop(_local3.coin_Anim3.coin.coin_rotate3._currentframe);
_local3.coin_Anim3.coin.coin_rotate4.gotoAndStop(_local3.coin_Anim3.coin.coin_rotate4._currentframe);
_local3.coin_Anim4.coin.coin_rotate.gotoAndStop(_local3.coin_Anim4.coin.coin_rotate._currentframe);
_local3.coin_Anim4.coin.coin_rotate2.gotoAndStop(_local3.coin_Anim4.coin.coin_rotate2._currentframe);
_local3.coin_Anim4.coin.coin_rotate3.gotoAndStop(_local3.coin_Anim4.coin.coin_rotate3._currentframe);
_local3.coin_Anim4.coin.coin_rotate4.gotoAndStop(_local3.coin_Anim4.coin.coin_rotate4._currentframe);
_local3.comboClip.combo.coin_rotate.gotoAndStop(_local3.comboClip.combo.coin_rotate._currentframe);
if (_local3.scoreIndicateClip._visible) {
_local3.scoreIndicateClip.gotoAndStop(_local3.scoreIndicateClip._currentframe);
}
if (_local3.expertScoreClip._visible) {
_local3.expertScoreClip.gotoAndStop(_local3.expertScoreClip._currentframe);
}
_global.ringvisible = phone_mc.ring._visible;
phone_mc.ring._visible = false;
_local3.chocolateClip.mc.gotoAndStop(_local3.chocolateClip.mc._currentframe);
_local3.specialChocolateClip.mc.gotoAndStop(_local3.specialChocolateClip.mc._currentframe);
_local3.coffeeClip.gotoAndStop(_local3.coffeeClip._currentframe);
}
function CallResume() {
var _local4 = this;
if (_global.soundstat == "onn") {
_root.gameSound.start();
}
_local4.bg.blink.gotoAndPlay(_local4.bg.blink._currentframe);
_local4.customer1.customer.gotoAndPlay(_local4.customer1.customer._currentframe);
_local4.customer2.customer.gotoAndPlay(_local4.customer2.customer._currentframe);
_local4.customer3.customer.gotoAndPlay(_local4.customer3.customer._currentframe);
_local4.special_choco_machines.machine1.blink.gotoAndPlay(_local4.special_choco_machines.machine1.blink._currentframe);
_local4.choco_machines.single_machine.blink.gotoAndPlay(_local4.choco_machines.single_machine.blink._currentframe);
_local4.salesGirl.coffeeicon.smoke.gotoAndPlay(_local4.salesGirl.coffeeicon.smoke._currentframe);
_local4.customer4.customer.gotoAndPlay(_local4.customer4.customer._currentframe);
_local4.coin_Anim1.coin.gotoAndPlay(_local4.coin_Anim1.coin._currentframe - 1);
_local4.coin_Anim2.coin.gotoAndPlay(_local4.coin_Anim2.coin._currentframe - 1);
_local4.coin_Anim3.coin.gotoAndPlay(_local4.coin_Anim3.coin._currentframe - 1);
_local4.coin_Anim4.coin.gotoAndPlay(_local4.coin_Anim4.coin._currentframe - 1);
_local4.comboClip.combo.gotoAndPlay(_local4.comboClip.combo._currentframe - 1);
_local4.orderbook1.heartinClip.gotoAndPlay(_local4.orderbook1.heartinClip._currentframe - 1);
_local4.orderbook2.heartinClip.gotoAndPlay(_local4.orderbook2.heartinClip._currentframe - 1);
_local4.orderbook3.heartinClip.gotoAndPlay(_local4.orderbook3.heartinClip._currentframe - 1);
_local4.orderbook4.heartinClip.gotoAndPlay(_local4.orderbook4.heartinClip._currentframe - 1);
_local4.curScoreClip.gotoAndPlay(_local4.curScoreClip._currentframe);
_local4.coin_Anim1.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate._currentframe);
_local4.coin_Anim1.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate2._currentframe);
_local4.coin_Anim1.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate3._currentframe);
_local4.coin_Anim1.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate4._currentframe);
_local4.coin_Anim2.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate._currentframe);
_local4.coin_Anim2.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate2._currentframe);
_local4.coin_Anim2.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate3._currentframe);
_local4.coin_Anim2.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate4._currentframe);
_local4.coin_Anim3.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate._currentframe);
_local4.coin_Anim3.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate2._currentframe);
_local4.coin_Anim3.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate3._currentframe);
_local4.coin_Anim3.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate4._currentframe);
_local4.coin_Anim4.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate._currentframe);
_local4.coin_Anim4.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate2._currentframe);
_local4.coin_Anim4.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate3._currentframe);
_local4.coin_Anim4.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate4._currentframe);
_local4.comboClip.combo.coin_rotate.gotoAndPlay(_local4.comboClip.combo.coin_rotate._currentframe);
if (_local4.scoreIndicateClip._visible) {
_local4.scoreIndicateClip.gotoAndPlay(_local4.scoreIndicateClip._currentframe - 1);
}
if (_local4.expertScoreClip._visible) {
_local4.expertScoreClip.gotoAndPlay(_local4.expertScoreClip._currentframe - 1);
}
phone_mc.ring._visible = _global.ringvisible;
_local4.chocolateClip.mc.gotoAndPlay(_local4.chocolateClip.mc._currentframe - 1);
_local4.specialChocolateClip.mc.gotoAndPlay(_local4.specialChocolateClip.mc._currentframe - 1);
_local4.coffeeClip.gotoAndPlay(_local4.coffeeClip._currentframe - 1);
}
function ObjectsRollOut() {
table1.onRollOut();
table2.onRollOut();
table3.onRollOut();
table4.onRollOut();
phone_mc.onRollOut();
choco_machines.onRollOut();
dusbin.onRollOut();
coffee_machine.onRollOut();
special_choco_machines.onRollOut();
}
function Reset() {
targetclip = "table1";
lobbyArr.length = 0;
lobbyArr = new Array(1, 2, 3);
currentDirection = "down";
targetDirection = "";
isPopup = false;
popup_info = "welcome";
clearInterval(popup_interval);
clearInterval(special_process_interval);
clearInterval(process_interval);
popup_interval = -1;
isTargetReached = true;
selectedTarget = "";
orderno = 0;
score = 0;
ismoveready = false;
orderTaken = 0;
customerCount = 0;
machineStatus = "notready";
dusbinStatus = "notready";
girlwalkframe = 2;
isFirstServeFinished = false;
depthArr.length = 0;
depthArr = new Array(-10313, -10315, -10317);
chocolateTypeArr.length = 0;
chocolateTypeArr = new Array("type_triangle", "type_fish", "type_round", "type_rabbit", "type_box");
customerEnterset = "firstset";
moneyCount = 0;
clearInterval(gameInterval);
gametimer = 0;
isGameOver = false;
combo_bookcnt = 0;
combo_ordercnt = 0;
combo_moneycnt = 0;
curtarget = "";
clearInterval(customerEnterInterval);
clearInterval(customerEnterInterval2);
clearInterval(customerEnterInterval3);
clearInterval(Re_customerEnterInterval);
clearInterval(reportInterval);
clearInterval(orderbook1.heatInterval);
clearInterval(orderbook2.heatInterval);
clearInterval(orderbook3.heatInterval);
clearInterval(orderbook4.heatInterval);
clearInterval(deliveryinterval);
isPaused = false;
sequenceArr.length = 0;
sequenceArr = new Array();
girlspeed = 12;
Key.removeListener(keylistener);
clearInterval(jumpInterval);
clearInterval(phoneInterval);
Key.removeListener(leve6Keyobj);
keyTarget = undefined;
phoneringcnt = 0;
isphonecalled = false;
}
var targetclip = "table1";
var lobbyArr = new Array(1, 2, 3);
var currentDirection = "down";
var isPopup = false;
var popup_info = "welcome";
var popup_interval = -1;
var process_interval = -1;
var special_process_interval = -1;
var isTargetReached = true;
var selectedTarget = "";
var orderno = 0;
var ismoveready = false;
var orderTaken = 0;
var customerCount = 0;
var machineStatus = "notready";
var machine2Status = "notready";
var special_machineStatus = "notready";
var dusbinStatus = "notready";
var coffeeStatus = "notready";
var girlwalkframe = 2;
var isFirstServeFinished = false;
var score = 0;
var depthArr = new Array(-10313, -10315, -10317);
var chocolateTypeArr = new Array("type_triangle", "type_fish", "type_round", "type_rabbit", "type_box");
var customerEnterset = "firstset";
var moneyCount = 0;
var gameInterval = -1;
var gametimer = 0;
var isGameOver = false;
var combo_bookcnt = 0;
var combo_ordercnt = 0;
var combo_moneycnt = 0;
var gamestartInterval = -1;
var curtarget = "";
var customerEnterInterval = -1;
var customerEnterInterval2 = -1;
var reportInterval = -1;
var isPaused = false;
var coffee_process_interval = -1;
var ringstat = "off";
var phone_status = "notready";
var machinespeed = 1;
var machineshake = "off";
var specialmachineshake = "off";
var coffeemachineshake = "off";
var machine2shake = "off";
var specialmachinespeed = 1;
var coffeemachinespeed = 1;
var machine2speed = 1;
var girlspeed = 12;
var sequenceArr = new Array();
var customerEnterInterval3 = -1;
var deliveryinterval = -1;
var jumpInterval = -1;
var tips = 0;
var phoneInterval = -1;
var Re_customerEnterInterval = -1;
var phoneringcnt = 0;
var cusArr = new Array("younglady", "oldlady", "younglady");
var isphonecalled = false;
var preparecnt = 0;
var spl_preparecnt = 0;
var coffee_preparecnt = 0;
}
Symbol 1704 MovieClip [__Packages.Level7] Frame 0
class Level7 extends MovieClip
{
var dummy_highlight, deliveryboy, salesGirl, btn_pause, _parent, choco_machines, choco_machines2, special_choco_machines, coffee_machine, scoreIndicateClip, shopclosedClip, timerClip, chocolate_container, special_chocolate_container, coffeeClip, chocolateClip, chocolateClip2, popup_mc, selectClip, heartinClip, shopopenClip, reportMc, cancel_mc, infoClip, comboClip, dusbinContainer, curScoreClip, specialChocolateClip, expertScoreClip, table4, table3, table2, table1, coin_Anim4, coin_Anim3, coin_Anim2, coin_Anim1, dusbin, phone_mc, leve7Keyobj, keyTarget, pauseTarget, scoreClip, radian, targetDirection, preferred_chocolate1, preferred_chocolate2, customer4, orderbook4, attachMovie, getNextHighestDepth, customer1, orderbook1, customer2, orderbook2, customer3, orderbook3, selectedTable, re_entry, moveTarget, keylistener;
function Level7 () {
super();
}
function onLoad() {
var owner = this;
clearInterval(popup_interval);
clearInterval(process_interval);
Reset();
dummy_highlight._visible = false;
deliveryboy._visible = false;
salesGirl.coffeeicon._visible = false;
btn_pause._visible = false;
_parent.pauseClip._visible = false;
salesGirl.gotoAndStop(currentDirection);
salesGirl.chocolateCount = 0;
choco_machines.status = "empty";
choco_machines2.status = "empty";
special_choco_machines.status = "empty";
coffee_machine.status = "empty";
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
scoreIndicateClip._visible = false;
shopclosedClip._visible = false;
timerClip._visible = false;
chocolate_container._visible = false;
special_chocolate_container._visible = false;
special_chocolate_container.mc.gotoAndStop(1);
coffeeClip._visible = false;
chocolateClip._visible = false;
chocolateClip2._visible = false;
popup_mc._visible = false;
selectClip._visible = false;
heartinClip._visible = false;
shopopenClip._visible = false;
reportMc._visible = false;
cancel_mc._visible = false;
infoClip._visible = false;
comboClip._visible = false;
dusbinContainer._visible = false;
curScoreClip._visible = false;
specialChocolateClip._visible = false;
expertScoreClip._visible = false;
table3._visible = (table4._visible = false);
table2._visible = false;
table1._visible = false;
coin_Anim3._visible = (coin_Anim4._visible = false);
coin_Anim2._visible = false;
coin_Anim1._visible = false;
table1.point = 1;
table2.point = 2;
table3.point = 3;
table4.point = 4;
choco_machines._visible = true;
choco_machines.gotoAndStop(2);
dusbin._visible = true;
dusbin.gotoAndStop(2);
special_choco_machines._visible = true;
special_choco_machines.gotoAndStop(1);
special_choco_machines.machine1.gotoAndStop(2);
coffee_machine._visible = true;
coffee_machine.gotoAndStop(2);
choco_machines2._visible = true;
choco_machines2.intro.gotoAndStop(1);
choco_machines2.intro.shadow.gotoAndPlay(2);
choco_machines2.intro.star.gotoAndPlay(2);
phone_mc._visible = true;
phone_mc.gotoAndStop(2);
phone_mc.ring.gotoAndStop(1);
_global.popupText = "New BOXED CHOCOLATE machine has been added!";
gamestartInterval = setInterval(GameStart, 3000, this);
btn_pause.onRelease = function () {
if (this._visible && (owner._parent.pauseClip._visible == false)) {
owner.pauseTarget = "btn_continue";
owner.isPaused = true;
owner.isPopup = true;
this._visible = false;
owner._parent.pauseClip._visible = true;
owner._parent.pauseClip.gotoAndPlay(2);
owner.CallPause();
}
};
leve7Keyobj = new Object();
Key.addListener(leve7Keyobj);
leve7Keyobj.onKeyUp = function () {
if (Key.getCode() == 13) {
if ((!owner.isPaused) && (!owner.isGameOver)) {
owner.StoreInSequence();
}
}
};
leve7Keyobj.onKeyDown = function () {
if (Key.getCode() == 37) {
if (!owner.isPaused) {
owner.LeftNavigation();
}
} else if (Key.getCode() == 39) {
if (!owner.isPaused) {
owner.RightNavigation();
}
} else if (Key.getCode() == 38) {
if (!owner.isPaused) {
owner.UpNavigation();
} else {
owner.pauseUpNavigation();
}
} else if (Key.getCode() == 40) {
if (!owner.isPaused) {
owner.DownNavigation();
} else {
owner.pauseDownNavigation();
}
} else if (Key.getCode() == 13) {
if (owner.popup_mc._visible) {
owner.popup_mc.btn_ok.onRelease();
} else if (owner.reportMc._visible) {
if (owner.reportMc._currentframe == 1) {
owner.reportMc.mc.btn_continue.onRelease();
} else {
owner.reportMc.mc.btn_retry.onRelease();
}
} else if (!owner.isPaused) {
owner.EnterFunction();
} else {
owner.PauseEnterFunction();
}
} else if (Key.getAscii() == 27) {
if (!owner.isPaused) {
owner.btn_pause.onRelease();
} else if (owner.isPaused) {
owner._parent.pauseClip.btn_continue.onRelease();
}
}
};
phone_mc.onRollOver = function () {
if (((!owner.isPaused) && (owner.table4._visible == true)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
if (owner.ringstat == "off") {
this.ring.gotoAndStop(1);
eval ("owner.orderbook" + this.point).highlight.gotoAndStop(2);
} else {
this.gotoAndStop(3);
}
owner.moveTarget = "phone_mc";
}
};
phone_mc.onRollOut = (phone_mc.onReleaseOutside = function () {
this.gotoAndStop(2);
if (owner.ringstat == "off") {
this.ring.gotoAndStop(1);
eval ("owner.orderbook" + this.point).highlight.gotoAndStop(1);
}
});
table1.onRollOver = (table2.onRollOver = (table3.onRollOver = (table4.onRollOver = function () {
if ((!owner.isPaused) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = this._name;
owner.moveTarget = this._name;
eval ("this.orderbook" + this.point).highlight.gotoAndStop(2);
if (eval ("this.orderbook" + this.point).money_mc._currentframe == 2) {
eval ("this.orderbook" + this.point).highlight_small.gotoAndStop(2);
} else if (eval ("this.orderbook" + this.point).money_mc._currentframe == 3) {
eval ("this.orderbook" + this.point).highlight_small_coin.gotoAndStop(2);
}
}
})));
table1.onRollOut = (table2.onRollOut = (table3.onRollOut = (table4.onRollOut = function () {
eval ("this.orderbook" + this.point).highlight.gotoAndStop(1);
if (eval ("this.orderbook" + this.point).money_mc._currentframe == 2) {
eval ("this.orderbook" + this.point).highlight_small.gotoAndStop(1);
} else if (eval ("this.orderbook" + this.point).money_mc._currentframe == 3) {
eval ("this.orderbook" + this.point).highlight_small_coin.gotoAndStop(1);
}
})));
choco_machines.onRollOver = function () {
if (((owner.machineStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "choco_machines";
owner.moveTarget = "choco_machines";
this.gotoAndStop(3);
owner.dummy_highlight._visible = true;
}
};
choco_machines.onRollOut = (choco_machines.onReleaseOutside = function () {
this.gotoAndStop(2);
owner.dummy_highlight._visible = false;
});
choco_machines2.onRollOver = function () {
if (((owner.machine2Status == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "choco_machines2";
owner.moveTarget = "choco_machines2";
this.gotoAndStop(3);
}
};
choco_machines2.onRollOut = (choco_machines2.onReleaseOutside = function () {
this.gotoAndStop(2);
});
dusbin.onRollOver = function () {
if ((owner.dusbinStatus == "ready") && (!owner.isPaused)) {
owner.ObjectsRollOut();
owner.keyTarget = "dusbin";
owner.moveTarget = "dusbin";
this.gotoAndStop(3);
}
};
dusbin.onRollOut = (dusbin.onReleaseOutside = function () {
this.gotoAndStop(2);
});
coffee_machine.onRollOver = function () {
if (((owner.coffeeStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "coffee_machine";
owner.moveTarget = "coffee_machine";
this.gotoAndStop(3);
}
};
coffee_machine.onRollOut = (coffee_machine.onReleaseOutside = function () {
this.gotoAndStop(2);
});
special_choco_machines.onRollOver = function () {
if (((owner.special_machineStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "special_choco_machines";
owner.moveTarget = "special_choco_machines";
this.machine1.gotoAndStop(3);
}
};
special_choco_machines.onRollOut = (special_choco_machines.onReleaseOutside = function () {
this.machine1.gotoAndStop(2);
});
coffee_machine.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.coffee_machine);
}
};
coffee_machine.onPress = function () {
if (((owner.isTargetReached && (!owner.isPaused)) && (owner.coffeeStatus == "ready")) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "coffee_machine";
owner.calculateAngle(owner.coffee_indicate);
this.pointer._visible = true;
}
};
choco_machines.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.choco_machines);
}
};
choco_machines.onPress = function () {
if (((owner.isTargetReached && (owner.machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines";
owner.calculateAngle(owner.chomac_indicate);
this.pointer._visible = true;
}
};
choco_machines2.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.choco_machines2);
}
};
choco_machines2.onPress = function () {
if (((owner.isTargetReached && (owner.machine2Status == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines2";
owner.calculateAngle(owner.chomac_indicate2);
this.pointer._visible = true;
}
};
special_choco_machines.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.special_choco_machines);
}
};
special_choco_machines.onPress = function () {
if (((owner.isTargetReached && (owner.special_machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "special_choco_machines";
owner.calculateAngle(owner.splmn_indicate);
this.pointer._visible = true;
}
};
dusbin.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.dusbin);
}
};
dusbin.onPress = function () {
if ((owner.isTargetReached && (owner.dusbinStatus == "ready")) && (!owner.isPaused)) {
owner.isTargetReached = false;
owner.selectedTarget = "dusbin";
owner.calculateAngle(owner.dusbin_indicate);
this.pointer._visible = true;
}
};
table1.onRelease = (table2.onRelease = (table3.onRelease = (table4.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(this);
}
})));
table1.onPress = (table2.onPress = (table3.onPress = (table4.onPress = function () {
if ((owner.isTargetReached && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = this._name;
if (owner.selectedTarget == "table1") {
owner.calculateAngle(this);
owner.selectedTable = 1;
} else if (owner.selectedTarget == "table2") {
owner.calculateAngle(this);
owner.selectedTable = 2;
} else if (owner.selectedTarget == "table3") {
owner.calculateAngle(this);
owner.selectedTable = 3;
} else if (owner.selectedTarget == "table4") {
owner.calculateAngle(owner.phone_indicate);
owner.selectedTable = 4;
}
eval ("owner.orderbook" + owner.selectedTable).pointer._visible = true;
}
})));
phone_mc.onRelease = function () {
if ((((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) && (owner.table4._visible == true)) {
owner.sequenceArr.push(owner.phone_mc);
}
};
phone_mc.onPress = function () {
if (((owner.isTargetReached && (!owner.isPaused)) && (owner.table4._visible == true)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "table4";
owner.calculateAngle(owner.phone_indicate);
owner.selectedTable = 4;
}
};
}
function LeftNavigation() {
if (chocolate_container._visible) {
if (keyTarget == "type_box") {
chocolate_container.mc.type_round.onRollOver();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_triangle.onRollOver();
}
} else if (special_chocolate_container._visible) {
if (special_chocolate_container.mc.type_rabbit._currentframe == 2) {
special_chocolate_container.mc.type_rabbit.onRollOut();
special_chocolate_container.mc.type_fish.onRollOver();
} else if (special_chocolate_container.mc.type_fish._currentframe == 2) {
special_chocolate_container.mc.type_fish.onRollOut();
special_chocolate_container.mc.type_rabbit.onRollOver();
}
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate2) {
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRollOut();
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRollOver();
}
} else if (keyTarget == "coffee_machine") {
coffee_machine.onRollOut();
if (table3._visible) {
table3.onRollOver();
} else if (table2._visible) {
table2.onRollOver();
} else if (table1._visible) {
table1.onRollOver();
} else if (table4._visible) {
table4.onRollOver();
phone_mc.onRollOver();
}
} else if (keyTarget == "choco_machines") {
choco_machines.onRollOut();
coffee_machine.onRollOver();
} else if (keyTarget == "choco_machines2") {
choco_machines2.onRollOut();
choco_machines.onRollOver();
} else if (keyTarget == "special_choco_machines") {
special_choco_machines.onRollOut();
choco_machines2.onRollOver();
}
}
function RightNavigation() {
if (chocolate_container._visible) {
if (keyTarget == "type_triangle") {
chocolate_container.mc.type_round.onRollOver();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_box.onRollOver();
}
} else if (special_chocolate_container._visible) {
if (special_chocolate_container.mc.type_rabbit._currentframe == 2) {
special_chocolate_container.mc.type_rabbit.onRollOut();
special_chocolate_container.mc.type_fish.onRollOver();
} else if (special_chocolate_container.mc.type_fish._currentframe == 2) {
special_chocolate_container.mc.type_fish.onRollOut();
special_chocolate_container.mc.type_rabbit.onRollOver();
}
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate1) {
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRollOut();
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRollOver();
}
} else if (keyTarget == undefined) {
coffee_machine.onRollOver();
} else if (keyTarget == "coffee_machine") {
coffee_machine.onRollOut();
choco_machines.onRollOver();
} else if (keyTarget == "choco_machines") {
choco_machines.onRollOut();
choco_machines2.onRollOver();
} else if (keyTarget == "choco_machines2") {
choco_machines2.onRollOut();
special_choco_machines.onRollOver();
} else if ((((keyTarget == "table1") || (keyTarget == "table2")) || (keyTarget == "table3")) || (keyTarget == "table4")) {
eval ("this." + keyTarget).onRollOut();
phone_mc.onRollOut();
coffee_machine.onRollOver();
}
}
function UpNavigation() {
if (keyTarget == "table4") {
if (table1._visible) {
table4.onRollOut();
phone_mc.onRollOut();
table1.onRollOver();
} else if (table2._visible) {
table4.onRollOut();
phone_mc.onRollOut();
table1.onRollOut();
table2.onRollOver();
} else if (table3._visible) {
table4.onRollOut();
phone_mc.onRollOut();
table1.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "table1") {
if (table2._visible) {
table1.onRollOut();
table2.onRollOver();
} else if (table3._visible) {
table1.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "table2") {
if (table3._visible) {
table2.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "dusbin") {
dusbin.onRollOut();
special_choco_machines.onRollOver();
}
}
function DownNavigation() {
if (keyTarget == "table3") {
if (table2._visible) {
table3.onRollOut();
table2.onRollOver();
} else if (table1._visible) {
table3.onRollOut();
table1.onRollOver();
} else if (table4._visible) {
table3.onRollOut();
table1.onRollOut();
table4.onRollOver();
phone_mc.onRollOver();
}
} else if (keyTarget == "table2") {
if (table1._visible) {
table2.onRollOut();
table1.onRollOver();
} else if (table4._visible) {
table2.onRollOut();
table1.onRollOut();
table4.onRollOver();
phone_mc.onRollOver();
}
} else if (keyTarget == "table1") {
if (table4._visible) {
table1.onRollOut();
table4.onRollOver();
phone_mc.onRollOver();
}
} else if (keyTarget == "special_choco_machines") {
special_choco_machines.onRollOut();
dusbin.onRollOver();
}
}
function EnterFunction() {
if (chocolate_container._visible) {
if (keyTarget == "type_triangle") {
chocolate_container.mc.type_triangle.onRelease();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_round.onRelease();
} else if (keyTarget == "type_box") {
chocolate_container.mc.type_box.onRelease();
}
} else if (special_chocolate_container._visible) {
eval ("this.special_chocolate_container.mc." + keyTarget).onRelease();
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate1) {
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRelease();
} else if (keyTarget == _global.preferred_chocolate2) {
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRelease();
}
} else {
eval ("this." + keyTarget).onPress();
}
}
function PauseEnterFunction() {
eval ("this._parent.pauseClip." + pauseTarget).onRelease();
}
function pauseUpNavigation() {
if (pauseTarget == "btn_premium") {
_parent.pauseClip.btn_premium.onRollOut();
_parent.pauseClip.btn_mainmenu.onRollOver();
} else if (pauseTarget == "btn_mainmenu") {
_parent.pauseClip.btn_mainmenu.onRollOut();
_parent.pauseClip.btn_restart.onRollOver();
} else if (pauseTarget == "btn_restart") {
_parent.pauseClip.btn_restart.onRollOut();
_parent.pauseClip.btn_continue.onRollOver();
}
}
function pauseDownNavigation() {
if (pauseTarget == "pause") {
_parent.pauseClip.btn_continue.onRollOver();
} else if (pauseTarget == "btn_continue") {
_parent.pauseClip.btn_continue.onRollOut();
_parent.pauseClip.btn_restart.onRollOver();
} else if (pauseTarget == "btn_restart") {
_parent.pauseClip.btn_restart.onRollOut();
_parent.pauseClip.btn_mainmenu.onRollOver();
} else if (pauseTarget == "btn_mainmenu") {
_parent.pauseClip.btn_mainmenu.onRollOut();
_parent.pauseClip.btn_premium.onRollOver();
}
}
function updateScore() {
scoreClip.score_txt.text = score;
scoreClip.loading.gotoAndStop(score);
if ((score >= 280) && (scoreClip.target._currentframe == 1)) {
scoreClip.target.gotoAndPlay(1);
scoreIndicateClip._visible = true;
scoreIndicateClip.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.target_score_Sound.start();
}
}
if ((score >= 480) && (scoreClip.expert._currentframe == 1)) {
scoreClip.expert.gotoAndPlay(1);
expertScoreClip._visible = true;
expertScoreClip.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.expert_score_Sound.start();
}
}
}
function onEnterFrame() {
var owner = this;
if (((!isPopup) && (!isTargetReached)) && (!owner.isPaused)) {
shopperMovement();
}
if (machineshake == "onn") {
machinespeed = -machinespeed;
choco_machines._x = choco_machines._x + ((2 * machinespeed) / 2);
choco_machines._y = choco_machines._y + ((2 * machinespeed) / 2);
}
if (specialmachineshake == "onn") {
specialmachinespeed = -specialmachinespeed;
special_choco_machines._x = special_choco_machines._x + ((1 * specialmachinespeed) / 2);
special_choco_machines._y = special_choco_machines._y + ((1 * specialmachinespeed) / 2);
} else {
special_choco_machines._x = 631;
special_choco_machines._y = 101;
}
if (coffeemachineshake == "onn") {
coffeemachinespeed = -coffeemachinespeed;
coffee_machine._x = coffee_machine._x + ((1 * coffeemachinespeed) / 2);
coffee_machine._y = coffee_machine._y + ((1 * coffeemachinespeed) / 2);
}
if (machine2shake == "onn") {
machine2speed = -machine2speed;
choco_machines2._x = choco_machines2._x + ((2 * machine2speed) / 2);
choco_machines2._y = choco_machines2._y + ((2 * machine2speed) / 2);
}
_parent.pauseClip.btn_continue.onRollOver = (_parent.pauseClip.btn_restart.onRollOver = (_parent.pauseClip.btn_mainmenu.onRollOver = (_parent.pauseClip.btn_premium.onRollOver = function () {
owner._parent.pauseClip.btn_continue.onRollOut();
owner._parent.pauseClip.btn_restart.onRollOut();
owner._parent.pauseClip.btn_mainmenu.onRollOut();
owner._parent.pauseClip.btn_premium.onRollOut();
owner.pauseTarget = this._name;
this.gotoAndStop(2);
})));
_parent.pauseClip.btn_continue.onRollOut = (_parent.pauseClip.btn_restart.onRollOut = (_parent.pauseClip.btn_mainmenu.onRollOut = (_parent.pauseClip.btn_premium.onRollOut = function () {
this.gotoAndStop(1);
})));
_parent.pauseClip.btn_continue.onRelease = function () {
owner.isPaused = false;
owner.isPopup = false;
owner.btn_pause._visible = true;
owner._parent.pauseClip._visible = false;
owner.CallResume();
};
_parent.pauseClip.btn_restart.onRelease = function () {
owner.Reset();
owner._parent.play();
};
_parent.pauseClip.btn_mainmenu.onRelease = function () {
owner.Reset();
owner._parent.gotoAndStop("mainmenu");
};
_parent.pauseClip.btn_premium.onRelease = function () {
this.getURL(_root.urlname, "_blank");
};
popup_mc.btn_ok.onRollOver = function () {
this.gotoAndStop(2);
};
popup_mc.btn_ok.onRollOut = (popup_mc.btn_ok.onReleaseOutside = function () {
this.gotoAndStop(1);
});
chocolate_container.mc.type_triangle.onRollOver = (chocolate_container.mc.type_round.onRollOver = (chocolate_container.mc.type_box.onRollOver = function () {
if (!owner.isPaused) {
owner.keyTarget = this._name;
owner.chocolate_container.mc.type_triangle.gotoAndStop(1);
owner.chocolate_container.mc.type_round.gotoAndStop(1);
owner.chocolate_container.mc.type_box.gotoAndStop(1);
this.gotoAndStop(2);
}
}));
chocolate_container.mc.type_triangle.onRelease = (chocolate_container.mc.type_round.onRelease = (chocolate_container.mc.type_box.onRelease = function () {
if (!owner.isPaused) {
if (owner.selectedTarget == "choco_machines") {
owner.chocolateClip._visible = true;
owner.chocolateClip.gotoAndStop(this._name);
owner.chocolateClip.mc.gotoAndPlay(1);
owner.isTargetReached = true;
owner.preferred_box_chocolate = this._name;
if (owner.choco_machines.status == "empty") {
owner.choco_machines.status = "prepared";
}
owner.machineshake = "onn";
owner.machineStatus = "ready";
owner.keyTarget = "choco_machines";
owner.preparecnt = 0;
owner.process_interval = setInterval(owner.IdleProcess, 100, owner);
} else if (owner.selectedTarget == "choco_machines2") {
owner.chocolateClip2._visible = true;
owner.chocolateClip2.gotoAndStop(this._name);
owner.chocolateClip2.mc.gotoAndPlay(1);
owner.isTargetReached = true;
owner.preferred_box2_chocolate = this._name;
if (owner.choco_machines2.status == "empty") {
owner.choco_machines2.status = "prepared";
}
owner.machine2shake = "onn";
owner.machine2Status = "ready";
owner.keyTarget = "choco_machines2";
owner.prepare2cnt = 0;
owner.process_interval2 = setInterval(owner.IdleProcess2, 100, owner);
}
owner.chocolate_container.gotoAndStop(2);
owner.isPopup = false;
owner.dusbinStatus = "ready";
if (_global.soundstat == "onn") {
_root.choco_producing_Sound.start();
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
}));
chocolate_container.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.machineStatus = "ready";
owner.machine2Status = "ready";
owner.chocolate_container._visible = false;
owner.isPopup = false;
owner.dusbinStatus = "ready";
if (owner.selectedTarget == "choco_machines") {
owner.keyTarget = "choco_machines";
} else {
owner.keyTarget = "choco_machines2";
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
special_chocolate_container.mc.type_rabbit.onRollOver = (special_chocolate_container.mc.type_fish.onRollOver = function () {
if (!owner.isPaused) {
owner.keyTarget = this._name;
owner.special_chocolate_container.mc.type_rabbit.gotoAndStop(1);
owner.special_chocolate_container.mc.type_fish.gotoAndStop(1);
this.gotoAndStop(2);
}
});
special_chocolate_container.mc.type_rabbit.onRelease = (special_chocolate_container.mc.type_fish.onRelease = function () {
if (!owner.isPaused) {
owner.infoClip._visible = false;
owner.specialChocolateClip._visible = true;
owner.specialChocolateClip.gotoAndStop(this._name);
owner.specialChocolateClip.mc.gotoAndPlay(1);
owner.isTargetReached = true;
owner.preferred_special_chocolate = this._name;
if (owner.special_choco_machines.status == "empty") {
owner.special_choco_machines.status = "prepared";
}
owner.spl_preparecnt = 0;
owner.special_process_interval = setInterval(owner.SpecialIdleProcess, 100, owner);
owner.special_chocolate_container.gotoAndStop(2);
owner.isPopup = false;
owner.dusbinStatus = "ready";
owner.special_machineStatus = "ready";
owner.specialmachineshake = "onn";
owner.keyTarget = "special_choco_machines";
if (_global.soundstat == "onn") {
_root.choco_producing_Sound.start();
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
});
special_chocolate_container.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.special_machineStatus = "ready";
owner.special_chocolate_container._visible = false;
owner.isPopup = false;
owner.dusbinStatus = "ready";
owner.keyTarget = "special_choco_machines";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
dusbinContainer.mc.chocobox1.type_triangle.onRollOver = (dusbinContainer.mc.chocobox1.type_round.onRollOver = (dusbinContainer.mc.chocobox1.type_box.onRollOver = (dusbinContainer.mc.chocobox2.type_triangle.onRollOver = (dusbinContainer.mc.chocobox2.type_round.onRollOver = (dusbinContainer.mc.chocobox2.type_box.onRollOver = (dusbinContainer.mc.chocobox1.type_rabbit.onRollOver = (dusbinContainer.mc.chocobox1.type_fish.onRollOver = (dusbinContainer.mc.chocobox2.type_rabbit.onRollOver = (dusbinContainer.mc.chocobox2.type_fish.onRollOver = function () {
owner.keyTarget = this._name;
this.gotoAndStop(2);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onRollOut = (dusbinContainer.mc.chocobox1.type_round.onRollOut = (dusbinContainer.mc.chocobox1.type_box.onRollOut = (dusbinContainer.mc.chocobox2.type_triangle.onRollOut = (dusbinContainer.mc.chocobox2.type_round.onRollOut = (dusbinContainer.mc.chocobox2.type_box.onRollOut = (dusbinContainer.mc.chocobox1.type_rabbit.onRollOut = (dusbinContainer.mc.chocobox1.type_fish.onRollOut = (dusbinContainer.mc.chocobox2.type_rabbit.onRollOut = (dusbinContainer.mc.chocobox2.type_fish.onRollOut = function () {
this.gotoAndStop(1);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_round.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_box.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_triangle.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_round.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_box.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_rabbit.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_fish.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_rabbit.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_fish.onReleaseOutside = function () {
this.gotoAndStop(1);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onRelease = (dusbinContainer.mc.chocobox1.type_round.onRelease = (dusbinContainer.mc.chocobox1.type_box.onRelease = (dusbinContainer.mc.chocobox2.type_triangle.onRelease = (dusbinContainer.mc.chocobox2.type_round.onRelease = (dusbinContainer.mc.chocobox2.type_box.onRelease = (dusbinContainer.mc.chocobox1.type_rabbit.onRelease = (dusbinContainer.mc.chocobox1.type_fish.onRelease = (dusbinContainer.mc.chocobox2.type_rabbit.onRelease = (dusbinContainer.mc.chocobox2.type_fish.onRelease = function () {
if (!owner.isPaused) {
if (this._name == owner.preferred_chocolate1) {
owner.preferred_chocolate1 = owner.preferred_chocolate2;
owner.preferred_chocolate2 = null;
owner.salesGirl.chocolateCount--;
owner.girlwalkframe = owner.girlwalkframe / 2;
owner.salesGirl.girlwalk.gotoAndStop(owner.girlwalkframe);
owner.salesGirl.girlwalk.chocobox1.gotoAndStop(owner.preferred_chocolate1);
owner.salesGirl.girlwalk.chocobox2.gotoAndStop(owner.preferred_chocolate2);
} else {
owner.preferred_chocolate2 = null;
owner.salesGirl.chocolateCount--;
owner.girlwalkframe = owner.girlwalkframe / 2;
owner.salesGirl.girlwalk.gotoAndStop(owner.girlwalkframe);
owner.salesGirl.girlwalk.chocobox1.gotoAndStop(owner.preferred_chocolate1);
owner.salesGirl.girlwalk.chocobox2.gotoAndStop(owner.preferred_chocolate2);
}
owner.dusbinStatus = "ready";
owner.dusbinContainer._visible = false;
owner.isPopup = false;
owner.keyTarget = "dusbin";
owner.setGreenHighLight();
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
})))))))));
dusbinContainer.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.dusbinStatus = "ready";
owner.dusbinContainer._visible = false;
owner.isPopup = false;
owner.keyTarget = "dusbin";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
reportMc.mc.btn_continue.onRelease = function () {
owner.Reset();
_global.calenderfrom = "game";
owner._parent.gotoAndStop("calender");
};
reportMc.mc.btn_menu.onRelease = function () {
owner.Reset();
owner._parent.gotoAndStop("mainmenu");
};
reportMc.mc.btn_retry.onRelease = function () {
owner.Reset();
owner._parent.play();
};
popup_mc.btn_ok.onRelease = function () {
if (owner.popup_info == "welcome") {
owner.combo_bookcnt = 0;
owner.combo_ordercnt = 0;
owner.combo_moneycnt = 0;
owner.btn_pause._visible = true;
owner.popupDisable();
var _local1 = owner.getRandom(0, 2);
owner.customerEnterInterval = setInterval(owner.CallCustomer, 1500, owner, owner.lobbyArr[_local1], "younglady");
owner.lobbyArr.splice(_local1, 1);
_local1 = owner.getRandom(0, owner.lobbyArr.length - 1);
owner.customerEnterInterval2 = setInterval(owner.CallCustomer2, 2500, owner, owner.lobbyArr[_local1], "oldlady");
owner.lobbyArr.splice(_local1, 1);
owner.isPopup = false;
owner.popup_info = "level2_start";
owner.bg.gotoAndStop(2);
owner.shopopenClip._visible = true;
owner.shopopenClip.gotoAndPlay(1);
owner.ismoveready = true;
owner.machineStatus = "ready";
owner.machine2Status = "ready";
owner.special_machineStatus = "ready";
owner.dusbinStatus = "ready";
owner.coffeeStatus = "ready";
owner.timerClip._visible = true;
clearInterval(owner.gameInterval);
owner.gametimer = 0;
owner.gameInterval = setInterval(owner.GameTimeLimit, 660, owner);
owner.Re_customerEnterInterval = setInterval(owner.CallNewCustomer, 3500, owner);
owner.phone_mc.gotoAndStop(2);
owner.phone_mc.ring.gotoAndStop(1);
} else if (owner.popup_info == "order") {
owner.popupDisable();
owner.isPopup = false;
owner.popup_info = "";
owner.selectClip._visible = true;
owner.selectClip._x = owner.choco_machines._x;
owner.selectClip._y = owner.choco_machines._y - 80;
} else if (owner.popup_info == "mismatch") {
owner.popupDisable();
owner.isPopup = false;
}
};
}
function shopperMovement() {
var _local3 = (salesGirl._x + salesGirl.pointer._x) - targetclip._x;
var _local2 = (salesGirl._y + salesGirl.pointer._y) - targetclip._y;
var _local5 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
var _local4 = 10;
if (_local5 >= _local4) {
salesGirl._x = salesGirl._x + (Math.cos(radian) * girlspeed);
salesGirl._y = salesGirl._y + (Math.sin(radian) * girlspeed);
} else if (!isTargetReached) {
isTargetReached = true;
salesGirl.gotoAndStop(targetDirection);
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
Manipulate();
updateScore();
}
}
function GameStart(_arg1) {
clearInterval(_arg1.gamestartInterval);
_arg1.isPopup = true;
_arg1.ShowPopup(_arg1);
}
function calculateAngle(mc) {
if (!isPopup) {
targetclip = mc;
var x_diff = (eval (mc)._x - (salesGirl._x + salesGirl.pointer._x));
var y_diff = (eval (mc)._y - (salesGirl._y + salesGirl.pointer._y));
radian = Math.atan2(y_diff, x_diff);
if (Math.abs(x_diff) > Math.abs(y_diff)) {
if (x_diff > 0) {
targetDirection = "right";
} else {
targetDirection = "left";
}
} else if (y_diff > 0) {
targetDirection = "down";
} else {
targetDirection = "up";
}
if (curtarget != selectedTarget) {
curtarget = selectedTarget;
salesGirl.gotoAndStop(targetDirection);
salesGirl.girlwalk.gotoAndStop(girlwalkframe - 1);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
}
}
}
function ShowPopup(_arg1) {
clearInterval(_arg1.popup_interval);
_arg1.isPopup = true;
_arg1.popup_mc._visible = true;
_arg1.popup_mc.swapDepths(_arg1.getNextHighestDepth());
_arg1.popup_mc.gotoAndPlay(1);
}
function popupDisable() {
popup_mc.gotoAndStop(1);
popup_mc._visible = false;
}
function CallNewCustomer(_arg2) {
if (!_arg2.isGameOver) {
if (_arg2.table4._visible) {
var _local1 = 0;
while (_local1 < _arg2.lobbyArr.length) {
if (_arg2.lobbyArr[_local1] == 1) {
_arg2.lobbyArr.splice(_local1, 1);
}
_local1++;
}
}
if ((_arg2.customerCount != 0) && (_arg2.moneyCount != 0)) {
_arg2.CallNextCustomerSet();
}
} else {
clearInterval(_arg2.Re_customerEnterInterval);
}
}
function CallCustomer(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.customerEnterInterval);
if (!_arg1.isGameOver) {
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function CallCustomer2(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.customerEnterInterval2);
if (!_arg1.isGameOver) {
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function CallCustomer3(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.customerEnterInterval3);
if (!_arg1.isGameOver) {
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function Re_CallCustomer(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.Re_customerEnterInterval);
if (!_arg1.isGameOver) {
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function customerEnter(_arg5, _arg4) {
if (!isGameOver) {
if (_arg4 == "phoneorder") {
isphonecalled = true;
ringstat = "onn";
phone_mc._visible = true;
table4._visible = true;
customer4 = phone_mc;
phone_mc.ring._visible = true;
phone_mc.ring.gotoAndPlay(2);
orderbook4 = attachMovie("orderbook", "orderbook4", getNextHighestDepth(), {_x:170, _y:400});
orderbook4._visible = false;
orderbook4.type = "phone";
customer4.type = _arg4;
orderbook4.heatcnt = 0;
orderbook4.heatInterval = setInterval(HeatFunction, 550, orderbook4, this, 4);
phoneringcnt = 0;
phoneInterval = setInterval(HidePhoneOrder, 1000, this);
if (_global.soundstat == "onn") {
_root.phonering_Sound.start();
}
} else if (_arg5 == 1) {
table1._visible = true;
customer1 = attachMovie(_arg4, "customer1", depthArr[_arg5 - 1], {_x:115, _y:356});
orderbook1 = attachMovie("orderbook", "orderbook1", getNextHighestDepth(), {_x:170, _y:374});
orderbook1.type = "book";
customer1.type = _arg4;
orderbook1.heatcnt = 0;
if (_arg4 == "oldlady") {
orderbook1.heatInterval = setInterval(HeatFunction, 550, orderbook1, this, 1);
} else if (_arg4 == "younglady") {
orderbook1.heatInterval = setInterval(HeatFunction, 250, orderbook1, this, 1);
}
} else if (_arg5 == 2) {
table2._visible = true;
customer2 = attachMovie(_arg4, "customer2", depthArr[_arg5 - 1], {_x:119, _y:235});
orderbook2 = attachMovie("orderbook", "orderbook2", getNextHighestDepth(), {_x:177, _y:278});
orderbook2.type = "book";
customer2.type = _arg4;
orderbook2.heatcnt = 0;
if (_arg4 == "oldlady") {
orderbook2.heatInterval = setInterval(HeatFunction, 550, orderbook2, this, 2);
} else if (_arg4 == "younglady") {
orderbook2.heatInterval = setInterval(HeatFunction, 250, orderbook2, this, 2);
}
} else if (_arg5 == 3) {
table3._visible = true;
customer3 = attachMovie(_arg4, "customer3", depthArr[_arg5 - 1], {_x:127, _y:140});
orderbook3 = attachMovie("orderbook", "orderbook3", getNextHighestDepth(), {_x:184, _y:185});
orderbook3.type = "book";
customer3.type = _arg4;
orderbook3.heatcnt = 0;
if (_arg4 == "oldlady") {
orderbook3.heatInterval = setInterval(HeatFunction, 550, orderbook3, this, 3);
} else if (_arg4 == "younglady") {
orderbook3.heatInterval = setInterval(HeatFunction, 250, orderbook3, this, 3);
}
}
customerCount++;
moneyCount++;
orderTaken++;
salesGirl.swapDepths(getNextHighestDepth());
scoreIndicateClip.swapDepths(getNextHighestDepth());
expertScoreClip.swapDepths(getNextHighestDepth());
chocolate_container.swapDepths(getNextHighestDepth());
special_chocolate_container.swapDepths(getNextHighestDepth());
dusbinContainer.swapDepths(getNextHighestDepth());
comboClip.swapDepths(getNextHighestDepth());
reportMc.swapDepths(getNextHighestDepth());
}
}
function HidePhoneOrder(owner) {
if (!owner.isPaused) {
owner.phoneringcnt++;
if (owner.phoneringcnt >= 20) {
clearInterval(owner.phoneInterval);
clearInterval(owner.orderbook4.heatInterval);
owner.moneyCount--;
owner.customerCount--;
owner.orderbook4._visible = false;
owner.table4._visible = false;
owner.orderbook4.type = "empty";
owner.ringstat = "off";
owner.phone_mc.ring.gotoAndStop(1);
_root.phonering_Sound.stop();
if ((owner.customerCount == 0) && (owner.moneyCount == 0)) {
if (!owner.isGameOver) {
owner.CallNextCustomerSet();
} else {
owner.callResult();
}
}
}
}
}
function Manipulate() {
var owner = this;
if (selectedTarget == "coffee_machine") {
coffee_machine.pointer._visible = false;
if (coffee_machine.status == "empty") {
coffee_machine.status = "prepared";
coffeeClip._visible = true;
coffeeClip.gotoAndPlay(2);
owner.isTargetReached = true;
owner.coffee_preparecnt = 0;
owner.coffee_process_interval = setInterval(owner.CoffeeIdleProcess, 100, owner);
owner.isPopup = false;
owner.coffeemachineshake = "onn";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
} else if (coffee_machine.status == "coffeeReady") {
coffeeClip._visible = false;
coffee_machine.status = "empty";
salesGirl.coffeeicon._visible = false;
girlspeed = 12;
orderTaken = 0;
salesGirl.gotoAndStop(2);
if (salesGirl.chocolateCount == 0) {
girlwalkframe = 9;
} else if (salesGirl.chocolateCount == 1) {
girlwalkframe = 10;
} else if (salesGirl.chocolateCount == 2) {
girlwalkframe = 11;
}
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.jumpLady.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.jumpLady.chocobox2.gotoAndStop(preferred_chocolate2);
owner.machineStatus = "notready";
owner.special_machineStatus = "notready";
owner.dusbinStatus = "notready";
owner.coffeeStatus = "notready";
owner.isPopup = true;
jumpInterval = setInterval(JumpFinished, 1100, this);
}
} else if (selectedTarget == "choco_machines") {
choco_machines.pointer._visible = false;
if (choco_machines.status == "empty") {
if (owner.salesGirl.chocolateCount < 3) {
chocolate_container._visible = true;
chocolate_container.gotoAndStop(1);
chocolate_container.mc.gotoAndPlay(1);
machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
keyTarget = "type_round";
}
} else if (choco_machines.status == "chocolateReady") {
if (owner.salesGirl.chocolateCount < 2) {
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = owner.preferred_box_chocolate;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = owner.preferred_box_chocolate;
}
owner.salesGirl.chocolateCount++;
chocolateClip._visible = false;
salesGirl.gotoAndStop(2);
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
choco_machines.status = "empty";
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
if (orderbook1.book_mc._currentframe == 74) {
orderbook1.green_highlight._visible = true;
}
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
if (orderbook2.book_mc._currentframe == 74) {
orderbook2.green_highlight._visible = true;
}
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
if (orderbook3.book_mc._currentframe == 74) {
orderbook3.green_highlight._visible = true;
}
}
if ((orderbook4.neededchocolate == preferred_chocolate1) || (orderbook4.neededchocolate == preferred_chocolate2)) {
if (orderbook4.book_mc._currentframe == 74) {
orderbook4.green_highlight._visible = true;
}
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (selectedTarget == "choco_machines2") {
choco_machines2.pointer._visible = false;
if (choco_machines2.status == "empty") {
if (owner.salesGirl.chocolateCount < 3) {
chocolate_container._visible = true;
chocolate_container.gotoAndStop(1);
chocolate_container.mc.gotoAndPlay(1);
machine2Status = "notready";
dusbinStatus = "notready";
isPopup = true;
keyTarget = "type_round";
}
} else if (choco_machines2.status == "chocolateReady") {
if (owner.salesGirl.chocolateCount < 2) {
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = owner.preferred_box2_chocolate;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = owner.preferred_box2_chocolate;
}
owner.salesGirl.chocolateCount++;
chocolateClip2._visible = false;
salesGirl.gotoAndStop(2);
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
choco_machines2.status = "empty";
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
}
if ((orderbook4.neededchocolate == preferred_chocolate1) || (orderbook4.neededchocolate == preferred_chocolate2)) {
orderbook4.green_highlight._visible = true;
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (selectedTarget == "special_choco_machines") {
special_choco_machines.pointer._visible = false;
if (special_choco_machines.status == "empty") {
if (owner.salesGirl.chocolateCount < 3) {
special_chocolate_container._visible = true;
special_chocolate_container.gotoAndStop(1);
special_chocolate_container.mc.gotoAndPlay(1);
special_machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
keyTarget = "type_rabbit";
}
} else if (special_choco_machines.status == "chocolateReady") {
if (owner.salesGirl.chocolateCount < 2) {
trace("Ready");
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = owner.preferred_special_chocolate;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = owner.preferred_special_chocolate;
}
owner.salesGirl.chocolateCount++;
specialChocolateClip._visible = false;
salesGirl.gotoAndStop(2);
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
special_choco_machines.status = "empty";
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
}
if ((orderbook4.neededchocolate == preferred_chocolate1) || (orderbook4.neededchocolate == preferred_chocolate2)) {
orderbook4.green_highlight._visible = true;
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (selectedTarget == "dusbin") {
dusbin.pointer._visible = false;
if (salesGirl.chocolateCount == 1) {
salesGirl.chocolateCount--;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
preferred_chocolate1 = null;
preferred_chocolate2 = null;
owner.setGreenHighLight();
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
} else if (salesGirl.chocolateCount >= 2) {
dusbinStatus = "notready";
isPopup = true;
_global.preferred_chocolate1 = preferred_chocolate1;
_global.preferred_chocolate2 = preferred_chocolate2;
keyTarget = _global.preferred_chocolate1;
dusbinContainer._visible = true;
dusbinContainer.gotoAndStop(1);
dusbinContainer.mc.gotoAndPlay(1);
}
} else if ((((selectedTarget == "table1") || (selectedTarget == "table2")) || (selectedTarget == "table3")) || (selectedTarget == "table4")) {
eval ("this.orderbook" + selectedTable).pointer._visible = false;
if (eval ("this.orderbook" + selectedTable).type == "phone") {
isphonecalled = true;
_root.phonering_Sound.stop();
clearInterval(phoneInterval);
combo_bookcnt++;
combo_ordercnt = 0;
combo_moneycnt = 0;
ringstat = "off";
phone_mc.ring.gotoAndStop(1);
eval ("this.orderbook" + selectedTable).type = "chocolateOrder";
var randomno = owner.getRandom(0, 4);
eval ("this.orderbook" + selectedTable)._visible = true;
eval ("this.orderbook" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.customer" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.orderbook" + selectedTable).gotoAndStop(2);
eval ("this.customer" + selectedTable).gotoAndStop(2);
eval ("this.orderbook" + selectedTable).green_highlight._visible = false;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
var heatcntchange = int(eval ("this.orderbook" + selectedTable).heatcnt / 4);
if (heatcntchange > 1) {
eval ("this.orderbook" + selectedTable).heatcnt = heatcntchange;
} else {
eval ("this.orderbook" + selectedTable).heatcnt = 1;
}
CheckForBookCombo();
} else if (eval ("this.orderbook" + selectedTable).type == "book") {
combo_bookcnt++;
combo_ordercnt = 0;
combo_moneycnt = 0;
eval ("this.orderbook" + selectedTable).type = "chocolateOrder";
var randomno = owner.getRandom(0, 4);
eval ("this.orderbook" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.customer" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.orderbook" + selectedTable).gotoAndStop(2);
eval ("this.customer" + selectedTable).gotoAndStop(3);
eval ("this.orderbook" + selectedTable).green_highlight._visible = false;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
var heatcntchange = int(eval ("this.orderbook" + selectedTable).heatcnt / 4);
if (heatcntchange > 1) {
eval ("this.orderbook" + selectedTable).heatcnt = heatcntchange;
} else {
eval ("this.orderbook" + selectedTable).heatcnt = 1;
}
CheckForBookCombo();
} else if (eval ("this.orderbook" + selectedTable).type == "chocolateOrder") {
if ((salesGirl.chocolateCount >= 1) && (eval ("this.orderbook" + selectedTable).book_mc._currentframe >= 74)) {
combo_bookcnt = 0;
combo_moneycnt = 0;
if (eval ("owner.customer" + owner.selectedTable).neededchocolate == owner.preferred_chocolate1) {
combo_ordercnt++;
preferred_chocolate1 = preferred_chocolate2;
preferred_chocolate2 = null;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
if (selectedTarget == "table4") {
orderbook4.type = "none";
orderbook4.temp_box._visible = false;
orderbook4.green_highlight._visible = false;
orderbook4.highlight._visible = false;
orderbook4.timelimit._visible = false;
phone_mc.swapDepths(getNextHighestDepth());
scoreIndicateClip.swapDepths(getNextHighestDepth());
expertScoreClip.swapDepths(getNextHighestDepth());
reportMc.swapDepths(getNextHighestDepth());
deliveryboy._visible = true;
deliveryboy.gotoAndPlay(2);
clearInterval(deliveryinterval);
deliveryinterval = setInterval(callDeliveryBoy, 1500, this);
} else {
eval ("this.orderbook" + selectedTable).type = "money";
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable).gotoAndStop(3);
eval ("this.customer" + selectedTable).gotoAndStop(5);
if ((eval ("this.orderbook" + selectedTable).heatcnt > 60) && (eval ("this.orderbook" + selectedTable).heatcnt <= 100)) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(2);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
} else if (eval ("this.orderbook" + selectedTable).heatcnt > 100) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(3);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
eval ("this.orderbook" + selectedTable).highlight_small._visible = false;
}
if (_global.soundstat == "onn") {
_root.customer_happy_Sound.start();
}
if (!isGameOver) {
if (!isGameOver) {
if (table4._visible) {
trace("table4visile");
var i = 0;
while (i < lobbyArr.length) {
if (lobbyArr[i] == 1) {
lobbyArr.splice(i, 1);
}
i++;
}
}
CallNextCustomerSet();
}
}
}
clearInterval(eval ("this.orderbook" + selectedTable).heatInterval);
CheckForOrderCombo();
customerCount--;
if (salesGirl.chocolateCount == 1) {
preferred_chocolate1 = null;
}
salesGirl.chocolateCount--;
owner.setGreenHighLight();
} else if (eval ("owner.customer" + owner.selectedTable).neededchocolate == owner.preferred_chocolate2) {
combo_ordercnt++;
salesGirl.chocolateCount--;
preferred_chocolate2 = null;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
if (selectedTarget == "table4") {
orderbook4.type = "none";
orderbook4.temp_box._visible = false;
orderbook4.green_highlight._visible = false;
orderbook4.highlight._visible = false;
orderbook4.timelimit._visible = false;
phone_mc.swapDepths(getNextHighestDepth());
scoreIndicateClip.swapDepths(getNextHighestDepth());
expertScoreClip.swapDepths(getNextHighestDepth());
reportMc.swapDepths(getNextHighestDepth());
deliveryboy._visible = true;
deliveryboy.gotoAndPlay(2);
clearInterval(deliveryinterval);
deliveryinterval = setInterval(callDeliveryBoy, 1500, this);
} else {
eval ("this.orderbook" + selectedTable).type = "money";
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable).gotoAndStop(3);
eval ("this.customer" + selectedTable).gotoAndStop(5);
if ((eval ("this.orderbook" + selectedTable).heatcnt > 60) && (eval ("this.orderbook" + selectedTable).heatcnt <= 100)) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(2);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
} else if (eval ("this.orderbook" + selectedTable).heatcnt > 100) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(3);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
eval ("this.orderbook" + selectedTable).highlight_small._visible = false;
}
if (_global.soundstat == "onn") {
_root.customer_happy_Sound.start();
}
if (!isGameOver) {
if (table4._visible) {
trace("table4visile");
var i = 0;
while (i < lobbyArr.length) {
if (lobbyArr[i] == 1) {
lobbyArr.splice(i, 1);
}
i++;
}
}
CallNextCustomerSet();
}
}
clearInterval(eval ("this.orderbook" + selectedTable).heatInterval);
CheckForOrderCombo();
customerCount--;
owner.setGreenHighLight();
}
}
} else if (eval ("this.orderbook" + selectedTable).type == "money") {
combo_bookcnt = 0;
combo_ordercnt = 0;
combo_moneycnt++;
trace((("before cus cont=" + customerCount) + ", ") + moneyCount);
moneyCount--;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(2);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable)._visible = false;
eval ("this.table" + selectedTable)._visible = false;
eval ("this.orderbook" + selectedTable).type = "empty";
if (owner.selectedTarget != "table4") {
eval ("this.customer" + selectedTable)._visible = false;
}
CheckForMoneyCombo();
if (orderTaken >= 6) {
salesGirl.coffeeicon._visible = true;
girlspeed = 6;
}
if (selectedTable != 4) {
lobbyArr.push(selectedTable);
} else if (table1._visible == false) {
lobbyArr.push(1);
}
if ((customerCount == 0) && (moneyCount == 0)) {
if (!isGameOver) {
customerCount = 0;
moneyCount = 0;
owner.table2._visible = (owner.table3._visible = false);
owner.table1._visible = false;
CallNextCustomerSet();
} else {
callResult();
}
} else if (isGameOver) {
if ((((table1._visible == false) && (table2._visible == false)) && (table3._visible == false)) && (table4._visible == false)) {
callResult();
}
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
}
function CallNextCustomerSet() {
var _local2 = this;
if (lobbyArr.length >= 1) {
if (lobbyArr.length == 1) {
if (((!isphonecalled) && (table4._visible == false)) && (table1._visible == false)) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
clearInterval(_local2.customerEnterInterval2);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 2000, _local2, _local2.lobbyArr[_local3], "phoneorder");
} else {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 1000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
}
} else if (lobbyArr.length == 2) {
re_entry = "onn";
if (((!isphonecalled) && (table4._visible == false)) && (table1._visible == false)) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local4 = Math.ceil((Math.random() * 3) - 1);
if (_local2.lobbyArr[0] == 1) {
_local3 = 1;
} else if (_local2.lobbyArr[1] == 1) {
_local3 = 0;
}
clearInterval(_local2.customerEnterInterval);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 1000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
clearInterval(_local2.customerEnterInterval2);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 2000, _local2, _local2.lobbyArr[_local3], "phoneorder");
} else {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 100, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval2);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 2000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
}
} else if (lobbyArr.length == 3) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 1000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval2);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 2000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval3);
_local2.customerEnterInterval3 = setInterval(_local2.CallCustomer3, 4000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
}
}
}
function callDeliveryBoy(owner) {
clearInterval(owner.deliveryinterval);
owner.orderbook4.type = "money";
owner.coin_Anim4._visible = true;
owner.coin_Anim4.gotoAndStop(1);
owner.coin_Anim4.coin.gotoAndPlay(1);
owner.orderbook4.gotoAndStop(3);
if ((owner.orderbook4.heatcnt > 60) && (owner.orderbook4.heatcnt <= 100)) {
owner.orderbook4.money_mc.gotoAndStop(2);
owner.orderbook4.highlight._visible = false;
} else if (owner.orderbook4.heatcnt > 100) {
owner.orderbook4.money_mc.gotoAndStop(3);
owner.orderbook4.highlight._visible = false;
owner.orderbook4.highlight_small._visible = false;
}
if (!owner.isGameOver) {
if (owner.table4._visible) {
trace("table4visile");
var i = 0;
while (i < owner.lobbyArr.length) {
if (owner.lobbyArr[i] == 1) {
owner.lobbyArr.splice(i, 1);
}
i++;
}
}
owner.CallNextCustomerSet();
}
}
function JumpFinished(_arg1) {
clearInterval(_arg1.jumpInterval);
_arg1.machineStatus = "ready";
_arg1.special_machineStatus = "ready";
_arg1.dusbinStatus = "ready";
_arg1.coffeeStatus = "ready";
_arg1.isPopup = false;
_arg1.sequenceArr.splice(0, 1);
if (_arg1.sequenceArr.length >= 1) {
_arg1.CallSequence();
}
}
function setGreenHighLight() {
if (orderbook1.book_mc._currentframe >= 74) {
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
} else {
orderbook1.green_highlight._visible = false;
}
}
if (orderbook2.book_mc._currentframe >= 74) {
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
} else {
orderbook2.green_highlight._visible = false;
}
}
if (orderbook3.book_mc._currentframe >= 74) {
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
} else {
orderbook3.green_highlight._visible = false;
}
}
if (orderbook4.book_mc._currentframe >= 74) {
if ((orderbook4.neededchocolate == preferred_chocolate1) || (orderbook4.neededchocolate == preferred_chocolate2)) {
orderbook4.green_highlight._visible = true;
} else {
orderbook4.green_highlight._visible = false;
}
}
}
function callResult() {
clearInterval(customerEnterInterval);
clearInterval(customerEnterInterval2);
clearInterval(customerEnterInterval3);
clearInterval(Re_customerEnterInterval);
clearInterval(reportInterval);
clearInterval(orderbook1.heatInterval);
clearInterval(orderbook2.heatInterval);
clearInterval(orderbook3.heatInterval);
clearInterval(orderbook4.heatInterval);
clearInterval(deliveryinterval);
clearInterval(jumpInterval);
clearInterval(phoneInterval);
machineStatus = "notready";
special_machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
_global.report_moneyEarned = score;
_global.report_tips = tips;
_global.targetScore = 280;
_global.expertScore = 480;
btn_pause._visible = false;
dusbinStatus = "notready";
score = score + tips;
if (score < 280) {
reportMc._visible = true;
reportMc.gotoAndStop(2);
reportMc.mc.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.level_failed_Sound.start();
}
} else {
if (_global.soundstat == "onn") {
_root.level_complete_Sound.start();
}
if (_global.levelSelected < 8) {
_global.levelSelected = 8;
}
if (_global.levelFinished <= 7) {
_global.levelFinished = 7;
}
if (score >= 480) {
_global.level7Status = "expert";
} else {
_global.level7Status = "target";
}
_global.level7Score = score;
reportMc._visible = true;
reportMc.gotoAndStop(1);
reportMc.mc.gotoAndPlay(2);
}
}
function CallReport(_arg1) {
clearInterval(_arg1.reportInterval);
_arg1.reportMc._visible = true;
_arg1.reportMc.gotoAndStop(1);
_arg1.reportMc.mc.gotoAndPlay(2);
}
function HeatFunction(owner, myparent, curpoint) {
if (!myparent.isPaused) {
owner.heatcnt++;
owner.timelimit.gotoAndStop(owner.heatcnt);
if (owner.heatcnt == 100) {
eval ("myparent.customer" + curpoint).gotoAndStop(4);
}
if (owner.heatcnt >= 120) {
clearInterval(owner.heatInterval);
myparent.moneyCount--;
myparent.customerCount--;
eval ("myparent.orderbook" + curpoint)._visible = false;
eval ("myparent.table" + curpoint)._visible = false;
if (eval ("myparent.customer" + curpoint).type == "oldlady") {
eval ("myparent.customer" + curpoint).gotoAndStop(6);
if (myparent.score > 0) {
myparent.curScoreClip._visible = true;
myparent.curScoreClip.gotoAndPlay(1);
if ((myparent.score >= 2) && (myparent.score < 10)) {
myparent.score = myparent.score - 2;
myparent.curScoreClip.disp.score.text = -2;
} else if (myparent.score >= 10) {
myparent.score = myparent.score - 10;
myparent.curScoreClip.disp.score.text = -10;
}
myparent.scoreClip.score_txt.text = myparent.score;
myparent.scoreClip.loading.gotoAndStop(myparent.score);
}
} else if (eval ("myparent.customer" + curpoint).type == "younglady") {
eval ("myparent.customer" + curpoint).gotoAndStop(6);
if (myparent.score > 0) {
myparent.curScoreClip._visible = true;
myparent.curScoreClip.gotoAndPlay(1);
if ((myparent.score >= 2) && (myparent.score < 15)) {
myparent.score = myparent.score - 2;
myparent.curScoreClip.disp.score.text = -2;
} else if (myparent.score >= 15) {
myparent.score = myparent.score - 15;
myparent.curScoreClip.disp.score.text = -15;
}
myparent.scoreClip.score_txt.text = myparent.score;
myparent.scoreClip.loading.gotoAndStop(myparent.score);
}
}
eval ("myparent.orderbook" + curpoint).type = "empty";
myparent.lobbyArr.push(curpoint);
if ((myparent.customerCount == 0) && (myparent.moneyCount == 0)) {
if (!myparent.isGameOver) {
myparent.CallNextCustomerSet();
} else {
myparent.callResult();
}
}
}
}
}
function GameTimeLimit(_arg1) {
if (!_arg1.isPaused) {
_arg1.gametimer++;
_arg1.timerClip.gotoAndStop(_arg1.gametimer);
if (_arg1.gametimer >= 90) {
_arg1.isGameOver = true;
_arg1.bg.gotoAndStop(1);
_arg1.shopclosedClip._visible = true;
_arg1.shopclosedClip.gotoAndPlay(1);
_arg1.gametimer = 0;
clearInterval(_arg1.gameInterval);
}
}
}
function CheckForBookCombo() {
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_bookcnt >= 2) {
comboClip._x = eval ("this.customer" + selectedTable)._x - 20;
comboClip._y = eval ("this.customer" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_bookcnt);
comboClip.combo.gotoAndPlay(1);
score = score + 4;
curScoreClip.disp.score.text = 4;
tips = tips + 4;
} else {
score = score + 2;
curScoreClip.disp.score.text = 2;
tips = tips + 2;
}
if (_global.soundstat == "onn") {
eval (("_root.combo" + combo_bookcnt) + "_Sound").start();
}
}
function CheckForOrderCombo() {
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_ordercnt >= 2) {
comboClip._x = eval ("this.customer" + selectedTable)._x - 20;
comboClip._y = eval ("this.customer" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_ordercnt);
comboClip.combo.gotoAndPlay(1);
score = score + 20;
curScoreClip.disp.score.text = 20;
} else {
score = score + 10;
curScoreClip.disp.score.text = 10;
}
if (_global.soundstat == "onn") {
eval (("_root.combo" + combo_ordercnt) + "_Sound").start();
}
}
function CheckForMoneyCombo() {
if (_global.soundstat == "onn") {
eval (("_root.money" + combo_moneycnt) + "_Sound").start();
}
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_moneycnt >= 2) {
comboClip._x = eval ("this.orderbook" + selectedTable)._x - 20;
comboClip._y = eval ("this.orderbook" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_moneycnt);
comboClip.combo.gotoAndPlay(1);
if (eval ("this.orderbook" + selectedTable).neededchocolate == "type_rabbit") {
score = score + (combo_moneycnt * 30);
curScoreClip.disp.score.text = combo_moneycnt * 30;
} else if (eval ("this.customer" + selectedTable).type == "oldlady") {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + (combo_moneycnt * 17);
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + (combo_moneycnt * 14);
curScoreClip.disp.score.text = combo_moneycnt * 14;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + (combo_moneycnt * 11);
curScoreClip.disp.score.text = combo_moneycnt * 11;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + (combo_moneycnt * 10);
curScoreClip.disp.score.text = combo_moneycnt * 10;
}
} else {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + (combo_moneycnt * 24);
curScoreClip.disp.score.text = combo_moneycnt * 24;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + (combo_moneycnt * 21);
curScoreClip.disp.score.text = combo_moneycnt * 21;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + (combo_moneycnt * 17);
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + (combo_moneycnt * 15);
curScoreClip.disp.score.text = combo_moneycnt * 15;
}
}
if (!isGameOver) {
if (table4._visible) {
var i = 0;
while (i < lobbyArr.length) {
if (lobbyArr[i] == 1) {
lobbyArr.splice(i, 1);
}
i++;
}
}
CallNextCustomerSet();
}
} else if (eval ("this.customer" + selectedTable).type == "oldlady") {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + 17;
curScoreClip.disp.score.text = 17;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + 14;
curScoreClip.disp.score.text = 14;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + 11;
curScoreClip.disp.score.text = 11;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + 10;
curScoreClip.disp.score.text = 10;
}
} else {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + 24;
curScoreClip.disp.score.text = combo_moneycnt * 24;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + 21;
curScoreClip.disp.score.text = combo_moneycnt * 21;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + 17;
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + 15;
curScoreClip.disp.score.text = combo_moneycnt * 15;
}
}
}
function IdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.preparecnt++;
if (_arg3.preparecnt >= 20) {
clearInterval(_arg3.process_interval);
_arg3.machineStatus = "ready";
_arg3.machineshake = "off";
if (_arg3.choco_machines.status == "prepared") {
_arg3.choco_machines.status = "chocolateReady";
}
if (_global.soundstat == "onn") {
_root.choco_done_Sound.start();
}
}
}
}
function IdleProcess2(_arg3) {
if (!_arg3.isPaused) {
_arg3.prepare2cnt++;
if (_arg3.prepare2cnt >= 20) {
clearInterval(_arg3.process_interval2);
_arg3.machine2Status = "ready";
_arg3.machine2shake = "off";
if (_arg3.choco_machines2.status == "prepared") {
_arg3.choco_machines2.status = "chocolateReady";
}
if (_global.soundstat == "onn") {
_root.choco_done_Sound.start();
}
}
}
}
function SpecialIdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.spl_preparecnt++;
if (_arg3.spl_preparecnt >= 40) {
trace("special done");
clearInterval(_arg3.special_process_interval);
_arg3.special_machineStatus = "ready";
_arg3.specialmachineshake = "off";
if (_arg3.special_choco_machines.status == "prepared") {
_arg3.special_choco_machines.status = "chocolateReady";
}
if (_global.soundstat == "onn") {
_root.choco_done_Sound.start();
}
}
}
}
function CoffeeIdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.coffee_preparecnt++;
if (_arg3.coffee_preparecnt >= 20) {
clearInterval(_arg3.coffee_process_interval);
_arg3.coffeeStatus = "ready";
_arg3.coffeemachineshake = "off";
_arg3.coffee_machine.status = "coffeeReady";
if (_global.soundstat == "onn") {
_root.hotchoco_done_Sound.start();
}
}
}
}
function getRandom(_arg4, _arg5) {
var _local3 = _arg5 - _arg4;
var _local2 = Math.random() * _local3;
var _local1 = Math.round(_local2);
_local1 = _local1 + _arg4;
return(_local1);
}
function StoreInSequence() {
var owner = this;
eval ("this." + moveTarget).onRelease();
}
function CallSequence() {
var owner = this;
if (sequenceArr[0] == choco_machines) {
if (((owner.isTargetReached && (owner.machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines";
owner.calculateAngle(owner.chomac_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == choco_machines2) {
if (((owner.isTargetReached && (owner.machine2Status == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines2";
owner.calculateAngle(owner.chomac_indicate2);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == special_choco_machines) {
if (((owner.isTargetReached && (owner.special_machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "special_choco_machines";
owner.calculateAngle(owner.splmn_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == dusbin) {
if ((owner.isTargetReached && (owner.dusbinStatus == "ready")) && (!owner.isPaused)) {
owner.isTargetReached = false;
owner.selectedTarget = "dusbin";
owner.calculateAngle(owner.dusbin_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == coffee_machine) {
if (((owner.isTargetReached && (!owner.isPaused)) && (owner.coffeeStatus == "ready")) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "coffee_machine";
owner.calculateAngle(owner.coffee_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if ((((sequenceArr[0] == table1) || (sequenceArr[0] == table2)) || (sequenceArr[0] == table3)) || (sequenceArr[0] == table4)) {
if ((owner.isTargetReached && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = sequenceArr[0]._name;
owner.calculateAngle(sequenceArr[0]);
if (owner.selectedTarget == "table1") {
owner.selectedTable = 1;
} else if (owner.selectedTarget == "table2") {
owner.selectedTable = 2;
} else if (owner.selectedTarget == "table3") {
owner.selectedTable = 3;
} else if (owner.selectedTarget == "table4") {
owner.selectedTable = 4;
}
eval ("owner.orderbook" + owner.selectedTable).pointer._visible = true;
}
}
}
function CallPause() {
var _local3 = this;
stopAllSounds();
_local3.bg.blink.gotoAndStop(_local3.bg.blink._currentframe);
_local3.customer1.customer.gotoAndStop(_local3.customer1.customer._currentframe);
_local3.customer2.customer.gotoAndStop(_local3.customer2.customer._currentframe);
_local3.customer3.customer.gotoAndStop(_local3.customer3.customer._currentframe);
_local3.special_choco_machines.machine1.blink.gotoAndStop(_local3.special_choco_machines.machine1.blink._currentframe);
_local3.choco_machines.single_machine.blink.gotoAndStop(_local3.choco_machines.single_machine.blink._currentframe);
_local3.salesGirl.coffeeicon.smoke.gotoAndStop(_local3.salesGirl.coffeeicon.smoke._currentframe);
_local3.customer4.customer.gotoAndStop(_local3.customer4.customer._currentframe);
_local3.coin_Anim1.coin.gotoAndStop(_local3.coin_Anim1.coin._currentframe);
_local3.coin_Anim2.coin.gotoAndStop(_local3.coin_Anim2.coin._currentframe);
_local3.coin_Anim3.coin.gotoAndStop(_local3.coin_Anim3.coin._currentframe);
_local3.coin_Anim4.coin.gotoAndStop(_local3.coin_Anim4.coin._currentframe);
_local3.comboClip.combo.gotoAndStop(_local3.comboClip.combo._currentframe);
_local3.orderbook1.heartinClip.gotoAndStop(_local3.orderbook1.heartinClip._currentframe);
_local3.orderbook2.heartinClip.gotoAndStop(_local3.orderbook2.heartinClip._currentframe);
_local3.orderbook3.heartinClip.gotoAndStop(_local3.orderbook3.heartinClip._currentframe);
_local3.orderbook4.heartinClip.gotoAndStop(_local3.orderbook4.heartinClip._currentframe);
_local3.curScoreClip.gotoAndStop(_local3.curScoreClip._currentframe);
_local3.coin_Anim1.coin.coin_rotate.gotoAndStop(_local3.coin_Anim1.coin.coin_rotate._currentframe);
_local3.coin_Anim1.coin.coin_rotate2.gotoAndStop(_local3.coin_Anim1.coin.coin_rotate2._currentframe);
_local3.coin_Anim1.coin.coin_rotate3.gotoAndStop(_local3.coin_Anim1.coin.coin_rotate3._currentframe);
_local3.coin_Anim1.coin.coin_rotate4.gotoAndStop(_local3.coin_Anim1.coin.coin_rotate4._currentframe);
_local3.coin_Anim2.coin.coin_rotate.gotoAndStop(_local3.coin_Anim2.coin.coin_rotate._currentframe);
_local3.coin_Anim2.coin.coin_rotate2.gotoAndStop(_local3.coin_Anim2.coin.coin_rotate2._currentframe);
_local3.coin_Anim2.coin.coin_rotate3.gotoAndStop(_local3.coin_Anim2.coin.coin_rotate3._currentframe);
_local3.coin_Anim2.coin.coin_rotate4.gotoAndStop(_local3.coin_Anim2.coin.coin_rotate4._currentframe);
_local3.coin_Anim3.coin.coin_rotate.gotoAndStop(_local3.coin_Anim3.coin.coin_rotate._currentframe);
_local3.coin_Anim3.coin.coin_rotate2.gotoAndStop(_local3.coin_Anim3.coin.coin_rotate2._currentframe);
_local3.coin_Anim3.coin.coin_rotate3.gotoAndStop(_local3.coin_Anim3.coin.coin_rotate3._currentframe);
_local3.coin_Anim3.coin.coin_rotate4.gotoAndStop(_local3.coin_Anim3.coin.coin_rotate4._currentframe);
_local3.coin_Anim4.coin.coin_rotate.gotoAndStop(_local3.coin_Anim4.coin.coin_rotate._currentframe);
_local3.coin_Anim4.coin.coin_rotate2.gotoAndStop(_local3.coin_Anim4.coin.coin_rotate2._currentframe);
_local3.coin_Anim4.coin.coin_rotate3.gotoAndStop(_local3.coin_Anim4.coin.coin_rotate3._currentframe);
_local3.coin_Anim4.coin.coin_rotate4.gotoAndStop(_local3.coin_Anim4.coin.coin_rotate4._currentframe);
_local3.comboClip.combo.coin_rotate.gotoAndStop(_local3.comboClip.combo.coin_rotate._currentframe);
if (_local3.scoreIndicateClip._visible) {
_local3.scoreIndicateClip.gotoAndStop(_local3.scoreIndicateClip._currentframe);
}
if (_local3.expertScoreClip._visible) {
_local3.expertScoreClip.gotoAndStop(_local3.expertScoreClip._currentframe);
}
_global.ringvisible = phone_mc.ring._visible;
phone_mc.ring._visible = false;
_local3.chocolateClip.mc.gotoAndStop(_local3.chocolateClip.mc._currentframe);
_local3.specialChocolateClip.mc.gotoAndStop(_local3.specialChocolateClip.mc._currentframe);
_local3.chocolateClip2.mc.gotoAndStop(_local3.chocolateClip2.mc._currentframe);
_local3.coffeeClip.gotoAndStop(_local3.coffeeClip._currentframe);
}
function CallResume() {
var _local4 = this;
if (_global.soundstat == "onn") {
_root.gameSound.start();
}
_local4.bg.blink.gotoAndPlay(_local4.bg.blink._currentframe);
_local4.customer1.customer.gotoAndPlay(_local4.customer1.customer._currentframe);
_local4.customer2.customer.gotoAndPlay(_local4.customer2.customer._currentframe);
_local4.customer3.customer.gotoAndPlay(_local4.customer3.customer._currentframe);
_local4.special_choco_machines.machine1.blink.gotoAndPlay(_local4.special_choco_machines.machine1.blink._currentframe);
_local4.choco_machines.single_machine.blink.gotoAndPlay(_local4.choco_machines.single_machine.blink._currentframe);
_local4.salesGirl.coffeeicon.smoke.gotoAndPlay(_local4.salesGirl.coffeeicon.smoke._currentframe);
_local4.customer4.customer.gotoAndPlay(_local4.customer4.customer._currentframe);
_local4.coin_Anim1.coin.gotoAndPlay(_local4.coin_Anim1.coin._currentframe - 1);
_local4.coin_Anim2.coin.gotoAndPlay(_local4.coin_Anim2.coin._currentframe - 1);
_local4.coin_Anim3.coin.gotoAndPlay(_local4.coin_Anim3.coin._currentframe - 1);
_local4.coin_Anim4.coin.gotoAndPlay(_local4.coin_Anim4.coin._currentframe - 1);
_local4.comboClip.combo.gotoAndPlay(_local4.comboClip.combo._currentframe - 1);
_local4.orderbook1.heartinClip.gotoAndPlay(_local4.orderbook1.heartinClip._currentframe - 1);
_local4.orderbook2.heartinClip.gotoAndPlay(_local4.orderbook2.heartinClip._currentframe - 1);
_local4.orderbook3.heartinClip.gotoAndPlay(_local4.orderbook3.heartinClip._currentframe - 1);
_local4.orderbook4.heartinClip.gotoAndPlay(_local4.orderbook4.heartinClip._currentframe - 1);
_local4.curScoreClip.gotoAndPlay(_local4.curScoreClip._currentframe);
_local4.coin_Anim1.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate._currentframe);
_local4.coin_Anim1.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate2._currentframe);
_local4.coin_Anim1.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate3._currentframe);
_local4.coin_Anim1.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate4._currentframe);
_local4.coin_Anim2.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate._currentframe);
_local4.coin_Anim2.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate2._currentframe);
_local4.coin_Anim2.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate3._currentframe);
_local4.coin_Anim2.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate4._currentframe);
_local4.coin_Anim3.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate._currentframe);
_local4.coin_Anim3.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate2._currentframe);
_local4.coin_Anim3.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate3._currentframe);
_local4.coin_Anim3.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate4._currentframe);
_local4.coin_Anim4.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate._currentframe);
_local4.coin_Anim4.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate2._currentframe);
_local4.coin_Anim4.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate3._currentframe);
_local4.coin_Anim4.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate4._currentframe);
_local4.comboClip.combo.coin_rotate.gotoAndPlay(_local4.comboClip.combo.coin_rotate._currentframe);
if (_local4.scoreIndicateClip._visible) {
_local4.scoreIndicateClip.gotoAndPlay(_local4.scoreIndicateClip._currentframe - 1);
}
if (_local4.expertScoreClip._visible) {
_local4.expertScoreClip.gotoAndPlay(_local4.expertScoreClip._currentframe - 1);
}
phone_mc.ring._visible = _global.ringvisible;
_local4.chocolateClip.mc.gotoAndPlay(_local4.chocolateClip.mc._currentframe - 1);
_local4.specialChocolateClip.mc.gotoAndPlay(_local4.specialChocolateClip.mc._currentframe - 1);
_local4.chocolateClip2.mc.gotoAndPlay(_local4.chocolateClip2.mc._currentframe - 1);
_local4.coffeeClip.gotoAndPlay(_local4.coffeeClip._currentframe - 1);
}
function ObjectsRollOut() {
table1.onRollOut();
table2.onRollOut();
table3.onRollOut();
table4.onRollOut();
phone_mc.onRollOut();
choco_machines.onRollOut();
choco_machines2.onRollOut();
dusbin.onRollOut();
coffee_machine.onRollOut();
special_choco_machines.onRollOut();
}
function Reset() {
targetclip = "table1";
lobbyArr.length = 0;
lobbyArr = new Array(1, 2, 3);
currentDirection = "down";
targetDirection = "";
isPopup = false;
popup_info = "welcome";
clearInterval(popup_interval);
clearInterval(special_process_interval);
clearInterval(process_interval);
clearInterval(process_interval2);
popup_interval = -1;
isTargetReached = true;
selectedTarget = "";
orderno = 0;
score = 0;
ismoveready = false;
orderTaken = 0;
customerCount = 0;
machineStatus = "notready";
dusbinStatus = "notready";
girlwalkframe = 2;
isFirstServeFinished = false;
depthArr.length = 0;
depthArr = new Array(-10313, -10315, -10317);
chocolateTypeArr.length = 0;
chocolateTypeArr = new Array("type_triangle", "type_fish", "type_round", "type_rabbit", "type_box");
customerEnterset = "firstset";
moneyCount = 0;
clearInterval(gameInterval);
gametimer = 0;
isGameOver = false;
combo_bookcnt = 0;
combo_ordercnt = 0;
combo_moneycnt = 0;
curtarget = "";
clearInterval(customerEnterInterval);
clearInterval(customerEnterInterval2);
clearInterval(customerEnterInterval3);
clearInterval(Re_customerEnterInterval);
clearInterval(reportInterval);
clearInterval(orderbook1.heatInterval);
clearInterval(orderbook2.heatInterval);
clearInterval(orderbook3.heatInterval);
clearInterval(orderbook4.heatInterval);
clearInterval(deliveryinterval);
isPaused = false;
sequenceArr.length = 0;
sequenceArr = new Array();
girlspeed = 12;
Key.removeListener(keylistener);
clearInterval(jumpInterval);
clearInterval(phoneInterval);
Key.removeListener(leve7Keyobj);
keyTarget = undefined;
phoneringcnt = 0;
isphonecalled = false;
}
var targetclip = "table1";
var lobbyArr = new Array(1, 2, 3);
var currentDirection = "down";
var isPopup = false;
var popup_info = "welcome";
var popup_interval = -1;
var process_interval = -1;
var special_process_interval = -1;
var isTargetReached = true;
var selectedTarget = "";
var orderno = 0;
var ismoveready = false;
var orderTaken = 0;
var customerCount = 0;
var machineStatus = "notready";
var machine2Status = "notready";
var special_machineStatus = "notready";
var dusbinStatus = "notready";
var coffeeStatus = "notready";
var girlwalkframe = 2;
var isFirstServeFinished = false;
var score = 0;
var depthArr = new Array(-10313, -10315, -10317);
var chocolateTypeArr = new Array("type_triangle", "type_fish", "type_round", "type_rabbit", "type_box");
var customerEnterset = "firstset";
var moneyCount = 0;
var gameInterval = -1;
var gametimer = 0;
var isGameOver = false;
var combo_bookcnt = 0;
var combo_ordercnt = 0;
var combo_moneycnt = 0;
var gamestartInterval = -1;
var curtarget = "";
var customerEnterInterval = -1;
var customerEnterInterval2 = -1;
var reportInterval = -1;
var isPaused = false;
var coffee_process_interval = -1;
var ringstat = "off";
var phone_status = "notready";
var machinespeed = 1;
var machineshake = "off";
var specialmachineshake = "off";
var coffeemachineshake = "off";
var machine2shake = "off";
var specialmachinespeed = 1;
var coffeemachinespeed = 1;
var machine2speed = 1;
var girlspeed = 12;
var sequenceArr = new Array();
var customerEnterInterval3 = -1;
var deliveryinterval = -1;
var jumpInterval = -1;
var tips = 0;
var phoneInterval = -1;
var process_interval2 = -1;
var Re_customerEnterInterval = -1;
var phoneringcnt = 0;
var cusArr = new Array("younglady", "oldlady", "younglady");
var isphonecalled = false;
var preparecnt = 0;
var prepare2cnt = 0;
var spl_preparecnt = 0;
var coffee_preparecnt = 0;
}
Symbol 1705 MovieClip [__Packages.Level8] Frame 0
class Level8 extends MovieClip
{
var dummy_highlight, deliveryboy, salesGirl, _parent, choco_machines, choco_machines2, special_choco_machines, coffee_machine, scoreIndicateClip, shopclosedClip, timerClip, chocolate_container, special_chocolate_container, coffeeClip, chocolateClip, chocolateClip2, popup_mc, selectClip, heartinClip, shopopenClip, reportMc, cancel_mc, infoClip, comboClip, dusbinContainer, curScoreClip, specialChocolateClip, expertScoreClip, table4, table3, table2, table1, coin_Anim4, coin_Anim3, coin_Anim2, coin_Anim1, dusbin, phone_mc, btn_pause, leve8Keyobj, keyTarget, pauseTarget, scoreClip, radian, targetDirection, preferred_chocolate1, preferred_chocolate2, customer4, orderbook4, attachMovie, getNextHighestDepth, customer1, orderbook1, customer2, orderbook2, customer3, orderbook3, selectedTable, re_entry, moveTarget;
function Level8 () {
super();
}
function onLoad() {
var owner = this;
clearInterval(popup_interval);
clearInterval(process_interval);
Reset();
dummy_highlight._visible = false;
deliveryboy._visible = false;
salesGirl.coffeeicon._visible = false;
_parent.pauseClip._visible = false;
salesGirl.gotoAndStop(currentDirection);
salesGirl.chocolateCount = 0;
choco_machines.status = "empty";
choco_machines2.status = "empty";
special_choco_machines.status = "empty";
coffee_machine.status = "empty";
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
scoreIndicateClip._visible = false;
shopclosedClip._visible = false;
timerClip._visible = false;
chocolate_container._visible = false;
special_chocolate_container._visible = false;
special_chocolate_container.mc.gotoAndStop(1);
coffeeClip._visible = false;
chocolateClip._visible = false;
chocolateClip2._visible = false;
popup_mc._visible = false;
selectClip._visible = false;
heartinClip._visible = false;
shopopenClip._visible = false;
reportMc._visible = false;
cancel_mc._visible = false;
infoClip._visible = false;
comboClip._visible = false;
dusbinContainer._visible = false;
curScoreClip._visible = false;
specialChocolateClip._visible = false;
expertScoreClip._visible = false;
table3._visible = (table4._visible = false);
table2._visible = false;
table1._visible = false;
coin_Anim3._visible = (coin_Anim4._visible = false);
coin_Anim2._visible = false;
coin_Anim1._visible = false;
table1.point = 1;
table2.point = 2;
table3.point = 3;
table4.point = 4;
choco_machines._visible = true;
choco_machines.gotoAndStop(2);
dusbin._visible = true;
dusbin.gotoAndStop(2);
special_choco_machines._visible = true;
special_choco_machines.gotoAndStop(1);
special_choco_machines.machine1.gotoAndStop(2);
coffee_machine._visible = true;
coffee_machine.gotoAndStop(2);
choco_machines2._visible = true;
choco_machines2.gotoAndStop(2);
phone_mc._visible = true;
phone_mc.gotoAndStop(2);
phone_mc.ring.gotoAndStop(1);
owner.combo_bookcnt = 0;
owner.combo_ordercnt = 0;
owner.combo_moneycnt = 0;
owner.btn_pause._visible = true;
owner.popupDisable();
var randomno = owner.getRandom(0, 2);
owner.customerEnterInterval = setInterval(owner.CallCustomer, 1500, owner, owner.lobbyArr[randomno], "oldlady");
owner.lobbyArr.splice(randomno, 1);
var randomno = owner.getRandom(0, owner.lobbyArr.length - 1);
owner.customerEnterInterval2 = setInterval(owner.CallCustomer2, 2500, owner, owner.lobbyArr[randomno], "younglady");
owner.lobbyArr.splice(randomno, 1);
owner.isPopup = false;
owner.popup_info = "level2_start";
owner.bg.gotoAndStop(2);
owner.shopopenClip._visible = true;
owner.shopopenClip.gotoAndPlay(1);
owner.ismoveready = true;
owner.machineStatus = "ready";
owner.machine2Status = "ready";
owner.special_machineStatus = "ready";
owner.dusbinStatus = "ready";
owner.coffeeStatus = "ready";
owner.timerClip._visible = true;
clearInterval(owner.gameInterval);
owner.gametimer = 0;
owner.gameInterval = setInterval(owner.GameTimeLimit, 660, owner);
owner.Re_customerEnterInterval = setInterval(owner.CallNewCustomer, 3500, owner);
owner.phone_mc.gotoAndStop(2);
owner.phone_mc.ring.gotoAndStop(1);
btn_pause.onRelease = function () {
if (this._visible && (owner._parent.pauseClip._visible == false)) {
owner.pauseTarget = "btn_continue";
owner.isPaused = true;
owner.isPopup = true;
this._visible = false;
owner._parent.pauseClip._visible = true;
owner._parent.pauseClip.gotoAndPlay(2);
owner.CallPause();
}
};
leve8Keyobj = new Object();
Key.addListener(leve8Keyobj);
leve8Keyobj.onKeyUp = function () {
if (Key.getCode() == 13) {
if ((!owner.isPaused) && (!owner.isGameOver)) {
owner.StoreInSequence();
}
}
};
leve8Keyobj.onKeyDown = function () {
if (Key.getCode() == 37) {
if (!owner.isPaused) {
owner.LeftNavigation();
}
} else if (Key.getCode() == 39) {
if (!owner.isPaused) {
owner.RightNavigation();
}
} else if (Key.getCode() == 38) {
if (!owner.isPaused) {
owner.UpNavigation();
} else {
owner.pauseUpNavigation();
}
} else if (Key.getCode() == 40) {
if (!owner.isPaused) {
owner.DownNavigation();
} else {
owner.pauseDownNavigation();
}
} else if (Key.getCode() == 13) {
if (owner.popup_mc._visible) {
owner.popup_mc.btn_ok.onRelease();
} else if (owner.reportMc._visible) {
if (owner.reportMc._currentframe == 1) {
owner.reportMc.mc.btn_continue.onRelease();
} else {
owner.reportMc.mc.btn_retry.onRelease();
}
} else if (!owner.isPaused) {
owner.EnterFunction();
} else {
owner.PauseEnterFunction();
}
} else if (Key.getAscii() == 27) {
if (!owner.isPaused) {
owner.btn_pause.onRelease();
} else if (owner.isPaused) {
owner._parent.pauseClip.btn_continue.onRelease();
}
}
};
phone_mc.onRollOver = function () {
if (((!owner.isPaused) && (owner.table4._visible == true)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
if (owner.ringstat == "off") {
this.ring.gotoAndStop(1);
eval ("owner.orderbook" + this.point).highlight.gotoAndStop(2);
} else {
this.gotoAndStop(3);
}
owner.moveTarget = "phone_mc";
}
};
phone_mc.onRollOut = (phone_mc.onReleaseOutside = function () {
this.gotoAndStop(2);
if (owner.ringstat == "off") {
this.ring.gotoAndStop(1);
eval ("owner.orderbook" + this.point).highlight.gotoAndStop(1);
}
});
table1.onRollOver = (table2.onRollOver = (table3.onRollOver = (table4.onRollOver = function () {
if ((!owner.isPaused) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = this._name;
owner.moveTarget = this._name;
eval ("this.orderbook" + this.point).highlight.gotoAndStop(2);
if (eval ("this.orderbook" + this.point).money_mc._currentframe == 2) {
eval ("this.orderbook" + this.point).highlight_small.gotoAndStop(2);
} else if (eval ("this.orderbook" + this.point).money_mc._currentframe == 3) {
eval ("this.orderbook" + this.point).highlight_small_coin.gotoAndStop(2);
}
}
})));
table1.onRollOut = (table2.onRollOut = (table3.onRollOut = (table4.onRollOut = function () {
eval ("this.orderbook" + this.point).highlight.gotoAndStop(1);
if (eval ("this.orderbook" + this.point).money_mc._currentframe == 2) {
eval ("this.orderbook" + this.point).highlight_small.gotoAndStop(1);
} else if (eval ("this.orderbook" + this.point).money_mc._currentframe == 3) {
eval ("this.orderbook" + this.point).highlight_small_coin.gotoAndStop(1);
}
})));
choco_machines.onRollOver = function () {
if (((owner.machineStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "choco_machines";
owner.moveTarget = "choco_machines";
this.gotoAndStop(3);
owner.dummy_highlight._visible = true;
}
};
choco_machines.onRollOut = (choco_machines.onReleaseOutside = function () {
this.gotoAndStop(2);
owner.dummy_highlight._visible = false;
});
choco_machines2.onRollOver = function () {
if (((owner.machine2Status == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "choco_machines2";
owner.moveTarget = "choco_machines2";
this.gotoAndStop(3);
}
};
choco_machines2.onRollOut = (choco_machines2.onReleaseOutside = function () {
this.gotoAndStop(2);
});
dusbin.onRollOver = function () {
if ((owner.dusbinStatus == "ready") && (!owner.isPaused)) {
owner.ObjectsRollOut();
owner.keyTarget = "dusbin";
owner.moveTarget = "dusbin";
this.gotoAndStop(3);
}
};
dusbin.onRollOut = (dusbin.onReleaseOutside = function () {
this.gotoAndStop(2);
});
coffee_machine.onRollOver = function () {
if (((owner.coffeeStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "coffee_machine";
owner.moveTarget = "coffee_machine";
this.gotoAndStop(3);
}
};
coffee_machine.onRollOut = (coffee_machine.onReleaseOutside = function () {
this.gotoAndStop(2);
});
special_choco_machines.onRollOver = function () {
if (((owner.special_machineStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "special_choco_machines";
owner.moveTarget = "special_choco_machines";
this.machine1.gotoAndStop(3);
}
};
special_choco_machines.onRollOut = (special_choco_machines.onReleaseOutside = function () {
this.machine1.gotoAndStop(2);
});
coffee_machine.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.coffee_machine);
}
};
coffee_machine.onPress = function () {
if (((owner.isTargetReached && (!owner.isPaused)) && (owner.coffeeStatus == "ready")) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "coffee_machine";
owner.calculateAngle(owner.coffee_indicate);
this.pointer._visible = true;
}
};
choco_machines.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.choco_machines);
}
};
choco_machines.onPress = function () {
if (((owner.isTargetReached && (owner.machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines";
owner.calculateAngle(owner.chomac_indicate);
this.pointer._visible = true;
}
};
choco_machines2.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.choco_machines2);
}
};
choco_machines2.onPress = function () {
if (((owner.isTargetReached && (owner.machine2Status == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines2";
owner.calculateAngle(owner.chomac_indicate2);
this.pointer._visible = true;
}
};
special_choco_machines.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.special_choco_machines);
}
};
special_choco_machines.onPress = function () {
if (((owner.isTargetReached && (owner.special_machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "special_choco_machines";
owner.calculateAngle(owner.splmn_indicate);
this.pointer._visible = true;
}
};
dusbin.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.dusbin);
}
};
dusbin.onPress = function () {
if ((owner.isTargetReached && (owner.dusbinStatus == "ready")) && (!owner.isPaused)) {
owner.isTargetReached = false;
owner.selectedTarget = "dusbin";
owner.calculateAngle(owner.dusbin_indicate);
this.pointer._visible = true;
}
};
table1.onRelease = (table2.onRelease = (table3.onRelease = (table4.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(this);
}
})));
table1.onPress = (table2.onPress = (table3.onPress = (table4.onPress = function () {
if ((owner.isTargetReached && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = this._name;
if (owner.selectedTarget == "table1") {
owner.calculateAngle(this);
owner.selectedTable = 1;
} else if (owner.selectedTarget == "table2") {
owner.calculateAngle(this);
owner.selectedTable = 2;
} else if (owner.selectedTarget == "table3") {
owner.calculateAngle(this);
owner.selectedTable = 3;
} else if (owner.selectedTarget == "table4") {
owner.calculateAngle(owner.phone_indicate);
owner.selectedTable = 4;
}
eval ("owner.orderbook" + owner.selectedTable).pointer._visible = true;
}
})));
phone_mc.onRelease = function () {
if ((((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) && (owner.table4._visible == true)) {
owner.sequenceArr.push(owner.phone_mc);
}
};
phone_mc.onPress = function () {
if (((owner.isTargetReached && (!owner.isPaused)) && (owner.table4._visible == true)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "table4";
owner.calculateAngle(owner.phone_indicate);
owner.selectedTable = 4;
}
};
}
function LeftNavigation() {
if (chocolate_container._visible) {
if (keyTarget == "type_box") {
chocolate_container.mc.type_round.onRollOver();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_triangle.onRollOver();
}
} else if (special_chocolate_container._visible) {
if (special_chocolate_container.mc.type_rabbit._currentframe == 2) {
special_chocolate_container.mc.type_rabbit.onRollOut();
special_chocolate_container.mc.type_fish.onRollOver();
} else if (special_chocolate_container.mc.type_fish._currentframe == 2) {
special_chocolate_container.mc.type_fish.onRollOut();
special_chocolate_container.mc.type_rabbit.onRollOver();
}
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate2) {
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRollOut();
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRollOver();
}
} else if (keyTarget == "coffee_machine") {
coffee_machine.onRollOut();
if (table3._visible) {
table3.onRollOver();
} else if (table2._visible) {
table2.onRollOver();
} else if (table1._visible) {
table1.onRollOver();
} else if (table4._visible) {
table4.onRollOver();
phone_mc.onRollOver();
}
} else if (keyTarget == "choco_machines") {
choco_machines.onRollOut();
coffee_machine.onRollOver();
} else if (keyTarget == "choco_machines2") {
choco_machines2.onRollOut();
choco_machines.onRollOver();
} else if (keyTarget == "special_choco_machines") {
special_choco_machines.onRollOut();
choco_machines2.onRollOver();
}
}
function RightNavigation() {
if (chocolate_container._visible) {
if (keyTarget == "type_triangle") {
chocolate_container.mc.type_round.onRollOver();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_box.onRollOver();
}
} else if (special_chocolate_container._visible) {
if (special_chocolate_container.mc.type_rabbit._currentframe == 2) {
special_chocolate_container.mc.type_rabbit.onRollOut();
special_chocolate_container.mc.type_fish.onRollOver();
} else if (special_chocolate_container.mc.type_fish._currentframe == 2) {
special_chocolate_container.mc.type_fish.onRollOut();
special_chocolate_container.mc.type_rabbit.onRollOver();
}
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate1) {
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRollOut();
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRollOver();
}
} else if (keyTarget == undefined) {
coffee_machine.onRollOver();
} else if (keyTarget == "coffee_machine") {
coffee_machine.onRollOut();
choco_machines.onRollOver();
} else if (keyTarget == "choco_machines") {
choco_machines.onRollOut();
choco_machines2.onRollOver();
} else if (keyTarget == "choco_machines2") {
choco_machines2.onRollOut();
special_choco_machines.onRollOver();
} else if ((((keyTarget == "table1") || (keyTarget == "table2")) || (keyTarget == "table3")) || (keyTarget == "table4")) {
eval ("this." + keyTarget).onRollOut();
phone_mc.onRollOut();
coffee_machine.onRollOver();
}
}
function UpNavigation() {
if (keyTarget == "table4") {
if (table1._visible) {
table4.onRollOut();
phone_mc.onRollOut();
table1.onRollOver();
} else if (table2._visible) {
table4.onRollOut();
phone_mc.onRollOut();
table1.onRollOut();
table2.onRollOver();
} else if (table3._visible) {
table4.onRollOut();
phone_mc.onRollOut();
table1.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "table1") {
if (table2._visible) {
table1.onRollOut();
table2.onRollOver();
} else if (table3._visible) {
table1.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "table2") {
if (table3._visible) {
table2.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "dusbin") {
dusbin.onRollOut();
special_choco_machines.onRollOver();
}
}
function DownNavigation() {
if (keyTarget == "table3") {
if (table2._visible) {
table3.onRollOut();
table2.onRollOver();
} else if (table1._visible) {
table3.onRollOut();
table1.onRollOver();
} else if (table4._visible) {
table3.onRollOut();
table1.onRollOut();
table4.onRollOver();
phone_mc.onRollOver();
}
} else if (keyTarget == "table2") {
if (table1._visible) {
table2.onRollOut();
table1.onRollOver();
} else if (table4._visible) {
table2.onRollOut();
table1.onRollOut();
table4.onRollOver();
phone_mc.onRollOver();
}
} else if (keyTarget == "table1") {
if (table4._visible) {
table1.onRollOut();
table4.onRollOver();
phone_mc.onRollOver();
}
} else if (keyTarget == "special_choco_machines") {
special_choco_machines.onRollOut();
dusbin.onRollOver();
}
}
function EnterFunction() {
if (chocolate_container._visible) {
if (keyTarget == "type_triangle") {
chocolate_container.mc.type_triangle.onRelease();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_round.onRelease();
} else if (keyTarget == "type_box") {
chocolate_container.mc.type_box.onRelease();
}
} else if (special_chocolate_container._visible) {
eval ("this.special_chocolate_container.mc." + keyTarget).onRelease();
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate1) {
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRelease();
} else if (keyTarget == _global.preferred_chocolate2) {
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRelease();
}
} else {
eval ("this." + keyTarget).onPress();
}
}
function PauseEnterFunction() {
eval ("this._parent.pauseClip." + pauseTarget).onRelease();
}
function pauseUpNavigation() {
if (pauseTarget == "btn_premium") {
_parent.pauseClip.btn_premium.onRollOut();
_parent.pauseClip.btn_mainmenu.onRollOver();
} else if (pauseTarget == "btn_mainmenu") {
_parent.pauseClip.btn_mainmenu.onRollOut();
_parent.pauseClip.btn_restart.onRollOver();
} else if (pauseTarget == "btn_restart") {
_parent.pauseClip.btn_restart.onRollOut();
_parent.pauseClip.btn_continue.onRollOver();
}
}
function pauseDownNavigation() {
if (pauseTarget == "pause") {
_parent.pauseClip.btn_continue.onRollOver();
} else if (pauseTarget == "btn_continue") {
_parent.pauseClip.btn_continue.onRollOut();
_parent.pauseClip.btn_restart.onRollOver();
} else if (pauseTarget == "btn_restart") {
_parent.pauseClip.btn_restart.onRollOut();
_parent.pauseClip.btn_mainmenu.onRollOver();
} else if (pauseTarget == "btn_mainmenu") {
_parent.pauseClip.btn_mainmenu.onRollOut();
_parent.pauseClip.btn_premium.onRollOver();
}
}
function updateScore() {
scoreClip.score_txt.text = score;
scoreClip.loading.gotoAndStop(score);
if ((score >= 350) && (scoreClip.target._currentframe == 1)) {
scoreClip.target.gotoAndPlay(1);
scoreIndicateClip._visible = true;
scoreIndicateClip.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.target_score_Sound.start();
}
}
if ((score >= 670) && (scoreClip.expert._currentframe == 1)) {
scoreClip.expert.gotoAndPlay(1);
expertScoreClip._visible = true;
expertScoreClip.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.expert_score_Sound.start();
}
}
}
function onEnterFrame() {
var owner = this;
if (((!isPopup) && (!isTargetReached)) && (!owner.isPaused)) {
shopperMovement();
}
if (machineshake == "onn") {
machinespeed = -machinespeed;
choco_machines._x = choco_machines._x + ((2 * machinespeed) / 2);
choco_machines._y = choco_machines._y + ((2 * machinespeed) / 2);
}
if (specialmachineshake == "onn") {
specialmachinespeed = -specialmachinespeed;
special_choco_machines._x = special_choco_machines._x + ((1 * specialmachinespeed) / 2);
special_choco_machines._y = special_choco_machines._y + ((1 * specialmachinespeed) / 2);
} else {
special_choco_machines._x = 631;
special_choco_machines._y = 101;
}
if (coffeemachineshake == "onn") {
coffeemachinespeed = -coffeemachinespeed;
coffee_machine._x = coffee_machine._x + ((1 * coffeemachinespeed) / 2);
coffee_machine._y = coffee_machine._y + ((1 * coffeemachinespeed) / 2);
}
if (machine2shake == "onn") {
machine2speed = -machine2speed;
choco_machines2._x = choco_machines2._x + ((2 * machine2speed) / 2);
choco_machines2._y = choco_machines2._y + ((2 * machine2speed) / 2);
}
_parent.pauseClip.btn_continue.onRollOver = (_parent.pauseClip.btn_restart.onRollOver = (_parent.pauseClip.btn_mainmenu.onRollOver = (_parent.pauseClip.btn_premium.onRollOver = function () {
owner._parent.pauseClip.btn_continue.onRollOut();
owner._parent.pauseClip.btn_restart.onRollOut();
owner._parent.pauseClip.btn_mainmenu.onRollOut();
owner._parent.pauseClip.btn_premium.onRollOut();
owner.pauseTarget = this._name;
this.gotoAndStop(2);
})));
_parent.pauseClip.btn_continue.onRollOut = (_parent.pauseClip.btn_restart.onRollOut = (_parent.pauseClip.btn_mainmenu.onRollOut = (_parent.pauseClip.btn_premium.onRollOut = function () {
this.gotoAndStop(1);
})));
_parent.pauseClip.btn_continue.onRelease = function () {
owner.isPaused = false;
owner.isPopup = false;
owner.btn_pause._visible = true;
owner._parent.pauseClip._visible = false;
owner.CallResume();
};
_parent.pauseClip.btn_restart.onRelease = function () {
owner.Reset();
owner._parent.play();
};
_parent.pauseClip.btn_mainmenu.onRelease = function () {
owner.Reset();
owner._parent.gotoAndStop("mainmenu");
};
_parent.pauseClip.btn_premium.onRelease = function () {
this.getURL(_root.urlname, "_blank");
};
popup_mc.btn_ok.onRollOver = function () {
this.gotoAndStop(2);
};
popup_mc.btn_ok.onRollOut = (popup_mc.btn_ok.onReleaseOutside = function () {
this.gotoAndStop(1);
});
chocolate_container.mc.type_triangle.onRollOver = (chocolate_container.mc.type_round.onRollOver = (chocolate_container.mc.type_box.onRollOver = function () {
if (!owner.isPaused) {
owner.keyTarget = this._name;
owner.chocolate_container.mc.type_triangle.gotoAndStop(1);
owner.chocolate_container.mc.type_round.gotoAndStop(1);
owner.chocolate_container.mc.type_box.gotoAndStop(1);
this.gotoAndStop(2);
}
}));
chocolate_container.mc.type_triangle.onRelease = (chocolate_container.mc.type_round.onRelease = (chocolate_container.mc.type_box.onRelease = function () {
if (!owner.isPaused) {
if (owner.selectedTarget == "choco_machines") {
owner.chocolateClip._visible = true;
owner.chocolateClip.gotoAndStop(this._name);
owner.chocolateClip.mc.gotoAndPlay(1);
owner.isTargetReached = true;
owner.preferred_box_chocolate = this._name;
if (owner.choco_machines.status == "empty") {
owner.choco_machines.status = "prepared";
}
owner.machineshake = "onn";
owner.machineStatus = "ready";
owner.keyTarget = "choco_machines";
owner.preparecnt = 0;
owner.process_interval = setInterval(owner.IdleProcess, 100, owner);
} else if (owner.selectedTarget == "choco_machines2") {
owner.chocolateClip2._visible = true;
owner.chocolateClip2.gotoAndStop(this._name);
owner.chocolateClip2.mc.gotoAndPlay(1);
owner.isTargetReached = true;
owner.preferred_box2_chocolate = this._name;
if (owner.choco_machines2.status == "empty") {
owner.choco_machines2.status = "prepared";
}
owner.machine2shake = "onn";
owner.machine2Status = "ready";
owner.keyTarget = "choco_machines2";
owner.prepare2cnt = 0;
owner.process_interval2 = setInterval(owner.IdleProcess2, 100, owner);
}
owner.chocolate_container.gotoAndStop(2);
owner.isPopup = false;
owner.dusbinStatus = "ready";
if (_global.soundstat == "onn") {
_root.choco_producing_Sound.start();
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
}));
chocolate_container.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.machineStatus = "ready";
owner.machine2Status = "ready";
owner.chocolate_container._visible = false;
owner.isPopup = false;
owner.dusbinStatus = "ready";
if (owner.selectedTarget == "choco_machines") {
owner.keyTarget = "choco_machines";
} else {
owner.keyTarget = "choco_machines2";
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
special_chocolate_container.mc.type_rabbit.onRollOver = (special_chocolate_container.mc.type_fish.onRollOver = function () {
if (!owner.isPaused) {
owner.keyTarget = this._name;
owner.special_chocolate_container.mc.type_rabbit.gotoAndStop(1);
owner.special_chocolate_container.mc.type_fish.gotoAndStop(1);
this.gotoAndStop(2);
}
});
special_chocolate_container.mc.type_rabbit.onRelease = (special_chocolate_container.mc.type_fish.onRelease = function () {
if (!owner.isPaused) {
owner.infoClip._visible = false;
owner.specialChocolateClip._visible = true;
owner.specialChocolateClip.gotoAndStop(this._name);
owner.specialChocolateClip.mc.gotoAndPlay(1);
owner.isTargetReached = true;
owner.preferred_special_chocolate = this._name;
if (owner.special_choco_machines.status == "empty") {
owner.special_choco_machines.status = "prepared";
}
owner.spl_preparecnt = 0;
owner.special_process_interval = setInterval(owner.SpecialIdleProcess, 100, owner);
owner.special_chocolate_container.gotoAndStop(2);
owner.isPopup = false;
owner.dusbinStatus = "ready";
owner.special_machineStatus = "ready";
owner.specialmachineshake = "onn";
owner.keyTarget = "special_choco_machines";
if (_global.soundstat == "onn") {
_root.choco_producing_Sound.start();
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
});
special_chocolate_container.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.special_machineStatus = "ready";
owner.special_chocolate_container._visible = false;
owner.isPopup = false;
owner.dusbinStatus = "ready";
owner.keyTarget = "special_choco_machines";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
dusbinContainer.mc.chocobox1.type_triangle.onRollOver = (dusbinContainer.mc.chocobox1.type_round.onRollOver = (dusbinContainer.mc.chocobox1.type_box.onRollOver = (dusbinContainer.mc.chocobox2.type_triangle.onRollOver = (dusbinContainer.mc.chocobox2.type_round.onRollOver = (dusbinContainer.mc.chocobox2.type_box.onRollOver = (dusbinContainer.mc.chocobox1.type_rabbit.onRollOver = (dusbinContainer.mc.chocobox1.type_fish.onRollOver = (dusbinContainer.mc.chocobox2.type_rabbit.onRollOver = (dusbinContainer.mc.chocobox2.type_fish.onRollOver = function () {
owner.keyTarget = this._name;
this.gotoAndStop(2);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onRollOut = (dusbinContainer.mc.chocobox1.type_round.onRollOut = (dusbinContainer.mc.chocobox1.type_box.onRollOut = (dusbinContainer.mc.chocobox2.type_triangle.onRollOut = (dusbinContainer.mc.chocobox2.type_round.onRollOut = (dusbinContainer.mc.chocobox2.type_box.onRollOut = (dusbinContainer.mc.chocobox1.type_rabbit.onRollOut = (dusbinContainer.mc.chocobox1.type_fish.onRollOut = (dusbinContainer.mc.chocobox2.type_rabbit.onRollOut = (dusbinContainer.mc.chocobox2.type_fish.onRollOut = function () {
this.gotoAndStop(1);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_round.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_box.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_triangle.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_round.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_box.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_rabbit.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_fish.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_rabbit.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_fish.onReleaseOutside = function () {
this.gotoAndStop(1);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onRelease = (dusbinContainer.mc.chocobox1.type_round.onRelease = (dusbinContainer.mc.chocobox1.type_box.onRelease = (dusbinContainer.mc.chocobox2.type_triangle.onRelease = (dusbinContainer.mc.chocobox2.type_round.onRelease = (dusbinContainer.mc.chocobox2.type_box.onRelease = (dusbinContainer.mc.chocobox1.type_rabbit.onRelease = (dusbinContainer.mc.chocobox1.type_fish.onRelease = (dusbinContainer.mc.chocobox2.type_rabbit.onRelease = (dusbinContainer.mc.chocobox2.type_fish.onRelease = function () {
if (!owner.isPaused) {
if (this._name == owner.preferred_chocolate1) {
owner.preferred_chocolate1 = owner.preferred_chocolate2;
owner.preferred_chocolate2 = null;
owner.salesGirl.chocolateCount--;
owner.girlwalkframe = owner.girlwalkframe / 2;
owner.salesGirl.girlwalk.gotoAndStop(owner.girlwalkframe);
owner.salesGirl.girlwalk.chocobox1.gotoAndStop(owner.preferred_chocolate1);
owner.salesGirl.girlwalk.chocobox2.gotoAndStop(owner.preferred_chocolate2);
} else {
owner.preferred_chocolate2 = null;
owner.salesGirl.chocolateCount--;
owner.girlwalkframe = owner.girlwalkframe / 2;
owner.salesGirl.girlwalk.gotoAndStop(owner.girlwalkframe);
owner.salesGirl.girlwalk.chocobox1.gotoAndStop(owner.preferred_chocolate1);
owner.salesGirl.girlwalk.chocobox2.gotoAndStop(owner.preferred_chocolate2);
}
owner.dusbinStatus = "ready";
owner.dusbinContainer._visible = false;
owner.isPopup = false;
owner.keyTarget = "dusbin";
owner.setGreenHighLight();
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
})))))))));
dusbinContainer.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.dusbinStatus = "ready";
owner.dusbinContainer._visible = false;
owner.isPopup = false;
owner.keyTarget = "dusbin";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
reportMc.mc.btn_continue.onRelease = function () {
owner.Reset();
_global.calenderfrom = "game";
owner._parent.gotoAndStop("calender");
};
reportMc.mc.btn_menu.onRelease = function () {
owner.Reset();
owner._parent.gotoAndStop("mainmenu");
};
reportMc.mc.btn_retry.onRelease = function () {
owner.Reset();
owner._parent.play();
};
popup_mc.btn_ok.onRelease = function () {
if (owner.popup_info == "welcome") {
owner.btn_pause._visible = true;
owner.popupDisable();
var _local1 = owner.getRandom(0, 2);
owner.customerEnterInterval = setInterval(owner.CallCustomer, 2000, owner, owner.lobbyArr[_local1], "oldlady");
owner.isPopup = false;
owner.popup_info = "level2_start";
owner.bg.gotoAndStop(2);
owner.shopopenClip._visible = true;
owner.shopopenClip.gotoAndPlay(1);
owner.ismoveready = true;
owner.machineStatus = "ready";
owner.machine2Status = "ready";
owner.special_machineStatus = "ready";
owner.dusbinStatus = "ready";
owner.coffeeStatus = "ready";
owner.timerClip._visible = true;
clearInterval(owner.gameInterval);
owner.gametimer = 0;
owner.gameInterval = setInterval(owner.GameTimeLimit, 1000, owner);
owner.phone_mc.gotoAndStop(2);
owner.phone_mc.ring.gotoAndStop(1);
} else if (owner.popup_info == "order") {
owner.popupDisable();
owner.isPopup = false;
owner.popup_info = "";
owner.selectClip._visible = true;
owner.selectClip._x = owner.choco_machines._x;
owner.selectClip._y = owner.choco_machines._y - 80;
} else if (owner.popup_info == "mismatch") {
owner.popupDisable();
owner.isPopup = false;
}
};
}
function shopperMovement() {
var _local3 = (salesGirl._x + salesGirl.pointer._x) - targetclip._x;
var _local2 = (salesGirl._y + salesGirl.pointer._y) - targetclip._y;
var _local5 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
var _local4 = 10;
if (_local5 >= _local4) {
salesGirl._x = salesGirl._x + (Math.cos(radian) * girlspeed);
salesGirl._y = salesGirl._y + (Math.sin(radian) * girlspeed);
} else if (!isTargetReached) {
isTargetReached = true;
salesGirl.gotoAndStop(targetDirection);
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
Manipulate();
updateScore();
}
}
function GameStart(_arg2) {
clearInterval(_arg2.gamestartInterval);
_arg2.isPopup = true;
_global.popupText = "Select the PHONE to answer a call. Take the order of the client and prepare it. A delivery boy will pick it up later.";
_arg2.ShowPopup(_arg2);
}
function calculateAngle(mc) {
if (!isPopup) {
targetclip = mc;
var x_diff = (eval (mc)._x - (salesGirl._x + salesGirl.pointer._x));
var y_diff = (eval (mc)._y - (salesGirl._y + salesGirl.pointer._y));
radian = Math.atan2(y_diff, x_diff);
if (Math.abs(x_diff) > Math.abs(y_diff)) {
if (x_diff > 0) {
targetDirection = "right";
} else {
targetDirection = "left";
}
} else if (y_diff > 0) {
targetDirection = "down";
} else {
targetDirection = "up";
}
if (curtarget != selectedTarget) {
curtarget = selectedTarget;
salesGirl.gotoAndStop(targetDirection);
salesGirl.girlwalk.gotoAndStop(girlwalkframe - 1);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
}
}
}
function ShowPopup(_arg1) {
clearInterval(_arg1.popup_interval);
_arg1.isPopup = true;
_arg1.popup_mc._visible = true;
_arg1.popup_mc.swapDepths(_arg1.getNextHighestDepth());
_arg1.popup_mc.gotoAndPlay(1);
}
function popupDisable() {
popup_mc.gotoAndStop(1);
popup_mc._visible = false;
}
function CallNewCustomer(_arg2) {
if (!_arg2.isGameOver) {
trace((("new cus len=" + _arg2.lobbyArr.length) + ", ") + _arg2.lobbyArr);
if (_arg2.table4._visible) {
var _local1 = 0;
while (_local1 < _arg2.lobbyArr.length) {
if (_arg2.lobbyArr[_local1] == 1) {
_arg2.lobbyArr.splice(_local1, 1);
}
_local1++;
}
}
if ((_arg2.customerCount != 0) && (_arg2.moneyCount != 0)) {
trace("call new cus");
_arg2.CallNextCustomerSet();
}
} else {
clearInterval(_arg2.Re_customerEnterInterval);
}
}
function CallCustomer(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.customerEnterInterval);
if (!_arg1.isGameOver) {
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function CallCustomer2(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.customerEnterInterval2);
if (!_arg1.isGameOver) {
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function CallCustomer3(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.customerEnterInterval3);
if (!_arg1.isGameOver) {
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function Re_CallCustomer(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.Re_customerEnterInterval);
if (!_arg1.isGameOver) {
trace((("interval next customer=" + _arg3) + ", ") + _arg2);
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function customerEnter(_arg5, _arg4) {
if (!isGameOver) {
if (_arg4 == "phoneorder") {
isphonecalled = true;
ringstat = "onn";
phone_mc._visible = true;
table4._visible = true;
customer4 = phone_mc;
phone_mc.ring._visible = true;
phone_mc.ring.gotoAndPlay(2);
orderbook4 = attachMovie("orderbook", "orderbook4", getNextHighestDepth(), {_x:170, _y:400});
orderbook4._visible = false;
orderbook4.type = "phone";
customer4.type = _arg4;
orderbook4.heatcnt = 0;
orderbook4.heatInterval = setInterval(HeatFunction, 500, orderbook4, this, 4);
phoneringcnt = 0;
phoneInterval = setInterval(HidePhoneOrder, 1000, this);
if (_global.soundstat == "onn") {
_root.phonering_Sound.start();
}
} else if (_arg5 == 1) {
table1._visible = true;
customer1 = attachMovie(_arg4, "customer1", depthArr[_arg5 - 1], {_x:115, _y:356});
orderbook1 = attachMovie("orderbook", "orderbook1", getNextHighestDepth(), {_x:170, _y:374});
orderbook1.type = "book";
customer1.type = _arg4;
orderbook1.heatcnt = 0;
if (_arg4 == "oldlady") {
orderbook1.heatInterval = setInterval(HeatFunction, 500, orderbook1, this, 1);
} else if (_arg4 == "younglady") {
orderbook1.heatInterval = setInterval(HeatFunction, 250, orderbook1, this, 1);
}
} else if (_arg5 == 2) {
table2._visible = true;
customer2 = attachMovie(_arg4, "customer2", depthArr[_arg5 - 1], {_x:119, _y:235});
orderbook2 = attachMovie("orderbook", "orderbook2", getNextHighestDepth(), {_x:177, _y:278});
orderbook2.type = "book";
customer2.type = _arg4;
orderbook2.heatcnt = 0;
if (_arg4 == "oldlady") {
orderbook2.heatInterval = setInterval(HeatFunction, 500, orderbook2, this, 2);
} else if (_arg4 == "younglady") {
orderbook2.heatInterval = setInterval(HeatFunction, 250, orderbook2, this, 2);
}
} else if (_arg5 == 3) {
table3._visible = true;
customer3 = attachMovie(_arg4, "customer3", depthArr[_arg5 - 1], {_x:127, _y:140});
orderbook3 = attachMovie("orderbook", "orderbook3", getNextHighestDepth(), {_x:184, _y:185});
orderbook3.type = "book";
customer3.type = _arg4;
orderbook3.heatcnt = 0;
if (_arg4 == "oldlady") {
orderbook3.heatInterval = setInterval(HeatFunction, 500, orderbook3, this, 3);
} else if (_arg4 == "younglady") {
orderbook3.heatInterval = setInterval(HeatFunction, 250, orderbook3, this, 3);
}
}
customerCount++;
moneyCount++;
orderTaken++;
salesGirl.swapDepths(getNextHighestDepth());
scoreIndicateClip.swapDepths(getNextHighestDepth());
expertScoreClip.swapDepths(getNextHighestDepth());
chocolate_container.swapDepths(getNextHighestDepth());
special_chocolate_container.swapDepths(getNextHighestDepth());
dusbinContainer.swapDepths(getNextHighestDepth());
comboClip.swapDepths(getNextHighestDepth());
reportMc.swapDepths(getNextHighestDepth());
}
}
function HidePhoneOrder(owner) {
if (!owner.isPaused) {
owner.phoneringcnt++;
if (owner.phoneringcnt >= 20) {
clearInterval(owner.phoneInterval);
clearInterval(owner.orderbook4.heatInterval);
owner.moneyCount--;
owner.customerCount--;
owner.orderbook4._visible = false;
owner.table4._visible = false;
owner.orderbook4.type = "empty";
owner.ringstat = "off";
owner.phone_mc.ring.gotoAndStop(1);
_root.phonering_Sound.stop();
if ((owner.customerCount == 0) && (owner.moneyCount == 0)) {
if (!owner.isGameOver) {
owner.CallNextCustomerSet();
} else {
owner.callResult();
}
}
}
}
}
function Manipulate() {
var owner = this;
if (selectedTarget == "coffee_machine") {
coffee_machine.pointer._visible = false;
if (coffee_machine.status == "empty") {
coffee_machine.status = "prepared";
coffeeClip._visible = true;
coffeeClip.gotoAndPlay(2);
owner.isTargetReached = true;
owner.coffee_preparecnt = 0;
owner.coffee_process_interval = setInterval(owner.CoffeeIdleProcess, 100, owner);
owner.isPopup = false;
owner.coffeemachineshake = "onn";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
} else if (coffee_machine.status == "coffeeReady") {
coffeeClip._visible = false;
coffee_machine.status = "empty";
salesGirl.coffeeicon._visible = false;
girlspeed = 12;
orderTaken = 0;
salesGirl.gotoAndStop(2);
if (salesGirl.chocolateCount == 0) {
girlwalkframe = 9;
} else if (salesGirl.chocolateCount == 1) {
girlwalkframe = 10;
} else if (salesGirl.chocolateCount == 2) {
girlwalkframe = 11;
}
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.jumpLady.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.jumpLady.chocobox2.gotoAndStop(preferred_chocolate2);
owner.machineStatus = "notready";
owner.special_machineStatus = "notready";
owner.dusbinStatus = "notready";
owner.coffeeStatus = "notready";
owner.isPopup = true;
jumpInterval = setInterval(JumpFinished, 1100, this);
}
} else if (selectedTarget == "choco_machines") {
choco_machines.pointer._visible = false;
if (choco_machines.status == "empty") {
if (owner.salesGirl.chocolateCount < 3) {
chocolate_container._visible = true;
chocolate_container.gotoAndStop(1);
chocolate_container.mc.gotoAndPlay(1);
machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
keyTarget = "type_round";
}
} else if (choco_machines.status == "chocolateReady") {
if (owner.salesGirl.chocolateCount < 2) {
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = owner.preferred_box_chocolate;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = owner.preferred_box_chocolate;
}
owner.salesGirl.chocolateCount++;
chocolateClip._visible = false;
salesGirl.gotoAndStop(2);
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
choco_machines.status = "empty";
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
if (orderbook1.book_mc._currentframe == 74) {
orderbook1.green_highlight._visible = true;
}
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
if (orderbook2.book_mc._currentframe == 74) {
orderbook2.green_highlight._visible = true;
}
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
if (orderbook3.book_mc._currentframe == 74) {
orderbook3.green_highlight._visible = true;
}
}
if ((orderbook4.neededchocolate == preferred_chocolate1) || (orderbook4.neededchocolate == preferred_chocolate2)) {
if (orderbook4.book_mc._currentframe == 74) {
orderbook4.green_highlight._visible = true;
}
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (selectedTarget == "choco_machines2") {
choco_machines2.pointer._visible = false;
if (choco_machines2.status == "empty") {
if (owner.salesGirl.chocolateCount < 3) {
chocolate_container._visible = true;
chocolate_container.gotoAndStop(1);
chocolate_container.mc.gotoAndPlay(1);
machine2Status = "notready";
dusbinStatus = "notready";
isPopup = true;
keyTarget = "type_round";
}
} else if (choco_machines2.status == "chocolateReady") {
if (owner.salesGirl.chocolateCount < 2) {
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = owner.preferred_box2_chocolate;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = owner.preferred_box2_chocolate;
}
owner.salesGirl.chocolateCount++;
chocolateClip2._visible = false;
salesGirl.gotoAndStop(2);
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
choco_machines2.status = "empty";
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
}
if ((orderbook4.neededchocolate == preferred_chocolate1) || (orderbook4.neededchocolate == preferred_chocolate2)) {
orderbook4.green_highlight._visible = true;
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (selectedTarget == "special_choco_machines") {
special_choco_machines.pointer._visible = false;
if (special_choco_machines.status == "empty") {
if (owner.salesGirl.chocolateCount < 3) {
special_chocolate_container._visible = true;
special_chocolate_container.gotoAndStop(1);
special_chocolate_container.mc.gotoAndPlay(1);
special_machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
keyTarget = "type_rabbit";
}
} else if (special_choco_machines.status == "chocolateReady") {
if (owner.salesGirl.chocolateCount < 2) {
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = owner.preferred_special_chocolate;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = owner.preferred_special_chocolate;
}
owner.salesGirl.chocolateCount++;
specialChocolateClip._visible = false;
salesGirl.gotoAndStop(2);
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
special_choco_machines.status = "empty";
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
}
if ((orderbook4.neededchocolate == preferred_chocolate1) || (orderbook4.neededchocolate == preferred_chocolate2)) {
orderbook4.green_highlight._visible = true;
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (selectedTarget == "dusbin") {
dusbin.pointer._visible = false;
if (salesGirl.chocolateCount == 1) {
salesGirl.chocolateCount--;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
preferred_chocolate1 = null;
preferred_chocolate2 = null;
owner.setGreenHighLight();
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
} else if (salesGirl.chocolateCount >= 2) {
dusbinStatus = "notready";
isPopup = true;
_global.preferred_chocolate1 = preferred_chocolate1;
_global.preferred_chocolate2 = preferred_chocolate2;
keyTarget = _global.preferred_chocolate1;
dusbinContainer._visible = true;
dusbinContainer.gotoAndStop(1);
dusbinContainer.mc.gotoAndPlay(1);
}
} else if ((((selectedTarget == "table1") || (selectedTarget == "table2")) || (selectedTarget == "table3")) || (selectedTarget == "table4")) {
eval ("this.orderbook" + selectedTable).pointer._visible = false;
if (eval ("this.orderbook" + selectedTable).type == "phone") {
isphonecalled = true;
_root.phonering_Sound.stop();
clearInterval(phoneInterval);
combo_bookcnt++;
combo_ordercnt = 0;
combo_moneycnt = 0;
ringstat = "off";
phone_mc.ring.gotoAndStop(1);
eval ("this.orderbook" + selectedTable).type = "chocolateOrder";
var randomno = owner.getRandom(0, 4);
eval ("this.orderbook" + selectedTable)._visible = true;
eval ("this.orderbook" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.customer" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.orderbook" + selectedTable).gotoAndStop(2);
eval ("this.customer" + selectedTable).gotoAndStop(2);
eval ("this.orderbook" + selectedTable).green_highlight._visible = false;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
var heatcntchange = int(eval ("this.orderbook" + selectedTable).heatcnt / 4);
if (heatcntchange > 1) {
eval ("this.orderbook" + selectedTable).heatcnt = heatcntchange;
} else {
eval ("this.orderbook" + selectedTable).heatcnt = 1;
}
CheckForBookCombo();
} else if (eval ("this.orderbook" + selectedTable).type == "book") {
combo_bookcnt++;
combo_ordercnt = 0;
combo_moneycnt = 0;
eval ("this.orderbook" + selectedTable).type = "chocolateOrder";
var randomno = owner.getRandom(0, 4);
eval ("this.orderbook" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.customer" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.orderbook" + selectedTable).gotoAndStop(2);
eval ("this.customer" + selectedTable).gotoAndStop(3);
eval ("this.orderbook" + selectedTable).green_highlight._visible = false;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
var heatcntchange = int(eval ("this.orderbook" + selectedTable).heatcnt / 4);
if (heatcntchange > 1) {
eval ("this.orderbook" + selectedTable).heatcnt = heatcntchange;
} else {
eval ("this.orderbook" + selectedTable).heatcnt = 1;
}
CheckForBookCombo();
} else if (eval ("this.orderbook" + selectedTable).type == "chocolateOrder") {
if ((salesGirl.chocolateCount >= 1) && (eval ("this.orderbook" + selectedTable).book_mc._currentframe >= 74)) {
combo_bookcnt = 0;
combo_moneycnt = 0;
if (eval ("owner.customer" + owner.selectedTable).neededchocolate == owner.preferred_chocolate1) {
combo_ordercnt++;
preferred_chocolate1 = preferred_chocolate2;
preferred_chocolate2 = null;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
if (selectedTarget == "table4") {
orderbook4.type = "none";
orderbook4.temp_box._visible = false;
orderbook4.green_highlight._visible = false;
orderbook4.highlight._visible = false;
orderbook4.timelimit._visible = false;
phone_mc.swapDepths(getNextHighestDepth());
scoreIndicateClip.swapDepths(getNextHighestDepth());
expertScoreClip.swapDepths(getNextHighestDepth());
reportMc.swapDepths(getNextHighestDepth());
deliveryboy._visible = true;
deliveryboy.gotoAndPlay(2);
clearInterval(deliveryinterval);
deliveryinterval = setInterval(callDeliveryBoy, 1500, this);
} else {
eval ("this.orderbook" + selectedTable).type = "money";
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable).gotoAndStop(3);
eval ("this.customer" + selectedTable).gotoAndStop(5);
if ((eval ("this.orderbook" + selectedTable).heatcnt > 60) && (eval ("this.orderbook" + selectedTable).heatcnt <= 100)) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(2);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
} else if (eval ("this.orderbook" + selectedTable).heatcnt > 100) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(3);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
eval ("this.orderbook" + selectedTable).highlight_small._visible = false;
}
if (_global.soundstat == "onn") {
_root.customer_happy_Sound.start();
}
if (!isGameOver) {
if (table4._visible) {
var i = 0;
while (i < lobbyArr.length) {
if (lobbyArr[i] == 1) {
lobbyArr.splice(i, 1);
}
i++;
}
}
CallNextCustomerSet();
}
}
clearInterval(eval ("this.orderbook" + selectedTable).heatInterval);
CheckForOrderCombo();
customerCount--;
if (salesGirl.chocolateCount == 1) {
preferred_chocolate1 = null;
}
salesGirl.chocolateCount--;
owner.setGreenHighLight();
} else if (eval ("owner.customer" + owner.selectedTable).neededchocolate == owner.preferred_chocolate2) {
combo_ordercnt++;
salesGirl.chocolateCount--;
preferred_chocolate2 = null;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
if (selectedTarget == "table4") {
orderbook4.type = "none";
orderbook4.temp_box._visible = false;
orderbook4.green_highlight._visible = false;
orderbook4.highlight._visible = false;
orderbook4.timelimit._visible = false;
phone_mc.swapDepths(getNextHighestDepth());
scoreIndicateClip.swapDepths(getNextHighestDepth());
expertScoreClip.swapDepths(getNextHighestDepth());
reportMc.swapDepths(getNextHighestDepth());
deliveryboy._visible = true;
deliveryboy.gotoAndPlay(2);
clearInterval(deliveryinterval);
deliveryinterval = setInterval(callDeliveryBoy, 1500, this);
} else {
eval ("this.orderbook" + selectedTable).type = "money";
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable).gotoAndStop(3);
eval ("this.customer" + selectedTable).gotoAndStop(5);
if ((eval ("this.orderbook" + selectedTable).heatcnt > 60) && (eval ("this.orderbook" + selectedTable).heatcnt <= 100)) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(2);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
} else if (eval ("this.orderbook" + selectedTable).heatcnt > 100) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(3);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
eval ("this.orderbook" + selectedTable).highlight_small._visible = false;
}
if (_global.soundstat == "onn") {
_root.customer_happy_Sound.start();
}
if (!isGameOver) {
if (table4._visible) {
var i = 0;
while (i < lobbyArr.length) {
if (lobbyArr[i] == 1) {
lobbyArr.splice(i, 1);
}
i++;
}
}
CallNextCustomerSet();
}
}
clearInterval(eval ("this.orderbook" + selectedTable).heatInterval);
CheckForOrderCombo();
customerCount--;
owner.setGreenHighLight();
}
}
} else if (eval ("this.orderbook" + selectedTable).type == "money") {
combo_bookcnt = 0;
combo_ordercnt = 0;
combo_moneycnt++;
moneyCount--;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(2);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable)._visible = false;
eval ("this.table" + selectedTable)._visible = false;
eval ("this.orderbook" + selectedTable).type = "empty";
if (owner.selectedTarget != "table4") {
eval ("this.customer" + selectedTable)._visible = false;
}
if (orderTaken >= 6) {
salesGirl.coffeeicon._visible = true;
girlspeed = 6;
}
if (selectedTable != 4) {
lobbyArr.push(selectedTable);
} else if (table1._visible == false) {
lobbyArr.push(1);
}
CheckForMoneyCombo();
if ((customerCount == 0) && (moneyCount == 0)) {
if (!isGameOver) {
customerCount = 0;
moneyCount = 0;
owner.table2._visible = (owner.table3._visible = false);
owner.table1._visible = false;
CallNextCustomerSet();
} else {
callResult();
}
} else if (isGameOver) {
if ((((table1._visible == false) && (table2._visible == false)) && (table3._visible == false)) && (table4._visible == false)) {
callResult();
}
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
}
function CallNextCustomerSet() {
var _local2 = this;
if (lobbyArr.length >= 1) {
if (lobbyArr.length == 1) {
if (((!isphonecalled) && (table4._visible == false)) && (table1._visible == false)) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
clearInterval(_local2.customerEnterInterval2);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 2000, _local2, _local2.lobbyArr[_local3], "phoneorder");
} else {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 1000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
}
} else if (lobbyArr.length == 2) {
re_entry = "onn";
if (((!isphonecalled) && (table4._visible == false)) && (table1._visible == false)) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local4 = Math.ceil((Math.random() * 3) - 1);
if (_local2.lobbyArr[0] == 1) {
_local3 = 1;
} else if (_local2.lobbyArr[1] == 1) {
_local3 = 0;
}
clearInterval(_local2.customerEnterInterval);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 1000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
clearInterval(_local2.customerEnterInterval2);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 2000, _local2, _local2.lobbyArr[_local3], "phoneorder");
} else {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 100, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval2);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 2000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
}
} else if (lobbyArr.length == 3) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 1000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval2);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 2000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval3);
_local2.customerEnterInterval3 = setInterval(_local2.CallCustomer3, 4000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
}
}
}
function callDeliveryBoy(owner) {
clearInterval(owner.deliveryinterval);
owner.orderbook4.type = "money";
owner.coin_Anim4._visible = true;
owner.coin_Anim4.gotoAndStop(1);
owner.coin_Anim4.coin.gotoAndPlay(1);
owner.orderbook4.gotoAndStop(3);
if ((owner.orderbook4.heatcnt > 60) && (owner.orderbook4.heatcnt <= 100)) {
owner.orderbook4.money_mc.gotoAndStop(2);
owner.orderbook4.highlight._visible = false;
} else if (owner.orderbook4.heatcnt > 100) {
owner.orderbook4.money_mc.gotoAndStop(3);
owner.orderbook4.highlight._visible = false;
owner.orderbook4.highlight_small._visible = false;
}
if (!owner.isGameOver) {
if (owner.table4._visible) {
trace("table4visile");
var i = 0;
while (i < owner.lobbyArr.length) {
if (owner.lobbyArr[i] == 1) {
owner.lobbyArr.splice(i, 1);
}
i++;
}
}
owner.CallNextCustomerSet();
}
}
function JumpFinished(_arg1) {
clearInterval(_arg1.jumpInterval);
_arg1.machineStatus = "ready";
_arg1.special_machineStatus = "ready";
_arg1.dusbinStatus = "ready";
_arg1.coffeeStatus = "ready";
_arg1.isPopup = false;
_arg1.sequenceArr.splice(0, 1);
if (_arg1.sequenceArr.length >= 1) {
_arg1.CallSequence();
}
}
function setGreenHighLight() {
if (orderbook1.book_mc._currentframe >= 74) {
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
} else {
orderbook1.green_highlight._visible = false;
}
}
if (orderbook2.book_mc._currentframe >= 74) {
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
} else {
orderbook2.green_highlight._visible = false;
}
}
if (orderbook3.book_mc._currentframe >= 74) {
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
} else {
orderbook3.green_highlight._visible = false;
}
}
if (orderbook4.book_mc._currentframe >= 74) {
if ((orderbook4.neededchocolate == preferred_chocolate1) || (orderbook4.neededchocolate == preferred_chocolate2)) {
orderbook4.green_highlight._visible = true;
} else {
orderbook4.green_highlight._visible = false;
}
}
}
function callResult() {
clearInterval(customerEnterInterval);
clearInterval(customerEnterInterval2);
clearInterval(customerEnterInterval3);
clearInterval(Re_customerEnterInterval);
clearInterval(reportInterval);
clearInterval(orderbook1.heatInterval);
clearInterval(orderbook2.heatInterval);
clearInterval(orderbook3.heatInterval);
clearInterval(orderbook4.heatInterval);
clearInterval(deliveryinterval);
clearInterval(jumpInterval);
clearInterval(phoneInterval);
machineStatus = "notready";
special_machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
_global.report_moneyEarned = score;
_global.report_tips = tips;
_global.targetScore = 350;
_global.expertScore = 670;
btn_pause._visible = false;
dusbinStatus = "notready";
score = score + tips;
if (score < 350) {
reportMc._visible = true;
reportMc.gotoAndStop(2);
reportMc.mc.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.level_failed_Sound.start();
}
} else {
if (_global.soundstat == "onn") {
_root.level_complete_Sound.start();
}
if (_global.levelSelected < 9) {
_global.levelSelected = 9;
}
if (_global.levelFinished <= 8) {
_global.levelFinished = 8;
}
if (score >= 670) {
_global.level8Status = "expert";
} else {
_global.level8Status = "target";
}
_global.level8Score = score;
if (((score >= 350) && (scoreClip.target._currentframe == 1)) || ((score >= 670) && (scoreClip.expert._currentframe == 1))) {
reportInterval = setInterval(CallReport, 2300, this);
} else {
reportMc._visible = true;
reportMc.gotoAndStop(1);
reportMc.mc.gotoAndPlay(2);
}
}
}
function CallReport(_arg1) {
clearInterval(_arg1.reportInterval);
_arg1.reportMc._visible = true;
_arg1.reportMc.gotoAndStop(1);
_arg1.reportMc.mc.gotoAndPlay(2);
}
function HeatFunction(owner, myparent, curpoint) {
if (!myparent.isPaused) {
owner.heatcnt++;
owner.timelimit.gotoAndStop(owner.heatcnt);
if (owner.heatcnt == 100) {
eval ("myparent.customer" + curpoint).gotoAndStop(4);
}
if (owner.heatcnt >= 120) {
clearInterval(owner.heatInterval);
myparent.moneyCount--;
myparent.customerCount--;
eval ("myparent.orderbook" + curpoint)._visible = false;
eval ("myparent.table" + curpoint)._visible = false;
if (eval ("myparent.customer" + curpoint).type == "oldlady") {
eval ("myparent.customer" + curpoint).gotoAndStop(6);
if (myparent.score > 0) {
myparent.curScoreClip._visible = true;
myparent.curScoreClip.gotoAndPlay(1);
if ((myparent.score >= 2) && (myparent.score < 10)) {
myparent.score = myparent.score - 2;
myparent.curScoreClip.disp.score.text = -2;
} else if (myparent.score >= 10) {
myparent.score = myparent.score - 10;
myparent.curScoreClip.disp.score.text = -10;
}
myparent.scoreClip.score_txt.text = myparent.score;
myparent.scoreClip.loading.gotoAndStop(myparent.score);
}
} else if (eval ("myparent.customer" + curpoint).type == "younglady") {
eval ("myparent.customer" + curpoint).gotoAndStop(6);
if (myparent.score > 0) {
myparent.curScoreClip._visible = true;
myparent.curScoreClip.gotoAndPlay(1);
if ((myparent.score >= 2) && (myparent.score < 15)) {
myparent.score = myparent.score - 2;
myparent.curScoreClip.disp.score.text = -2;
} else if (myparent.score >= 15) {
myparent.score = myparent.score - 15;
myparent.curScoreClip.disp.score.text = -15;
}
myparent.scoreClip.score_txt.text = myparent.score;
myparent.scoreClip.loading.gotoAndStop(myparent.score);
}
}
eval ("myparent.orderbook" + curpoint).type = "empty";
myparent.lobbyArr.push(curpoint);
if ((myparent.customerCount == 0) && (myparent.moneyCount == 0)) {
if (!myparent.isGameOver) {
myparent.CallNextCustomerSet();
} else {
myparent.callResult();
}
}
}
}
}
function GameTimeLimit(_arg1) {
if (!_arg1.isPaused) {
_arg1.gametimer++;
_arg1.timerClip.gotoAndStop(_arg1.gametimer);
if (_arg1.gametimer >= 90) {
_arg1.isGameOver = true;
_arg1.bg.gotoAndStop(1);
_arg1.shopclosedClip._visible = true;
_arg1.shopclosedClip.gotoAndPlay(1);
_arg1.gametimer = 0;
clearInterval(_arg1.gameInterval);
}
}
}
function CheckForBookCombo() {
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_bookcnt >= 2) {
comboClip._x = eval ("this.customer" + selectedTable)._x - 20;
comboClip._y = eval ("this.customer" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_bookcnt);
comboClip.combo.gotoAndPlay(1);
score = score + 4;
curScoreClip.disp.score.text = 4;
tips = tips + 4;
} else {
score = score + 2;
curScoreClip.disp.score.text = 2;
tips = tips + 2;
}
if (_global.soundstat == "onn") {
eval (("_root.combo" + combo_bookcnt) + "_Sound").start();
}
}
function CheckForOrderCombo() {
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_ordercnt >= 2) {
comboClip._x = eval ("this.customer" + selectedTable)._x - 20;
comboClip._y = eval ("this.customer" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_ordercnt);
comboClip.combo.gotoAndPlay(1);
score = score + 20;
curScoreClip.disp.score.text = 20;
} else {
score = score + 10;
curScoreClip.disp.score.text = 10;
}
if (_global.soundstat == "onn") {
eval (("_root.combo" + combo_ordercnt) + "_Sound").start();
}
}
function CheckForMoneyCombo() {
if (_global.soundstat == "onn") {
eval (("_root.money" + combo_moneycnt) + "_Sound").start();
}
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_moneycnt >= 2) {
comboClip._x = eval ("this.orderbook" + selectedTable)._x - 20;
comboClip._y = eval ("this.orderbook" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_moneycnt);
comboClip.combo.gotoAndPlay(1);
if (eval ("this.orderbook" + selectedTable).neededchocolate == "type_rabbit") {
score = score + (combo_moneycnt * 30);
curScoreClip.disp.score.text = combo_moneycnt * 30;
} else if (eval ("this.customer" + selectedTable).type == "oldlady") {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + (combo_moneycnt * 17);
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + (combo_moneycnt * 14);
curScoreClip.disp.score.text = combo_moneycnt * 14;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + (combo_moneycnt * 11);
curScoreClip.disp.score.text = combo_moneycnt * 11;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + (combo_moneycnt * 10);
curScoreClip.disp.score.text = combo_moneycnt * 10;
}
} else {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + (combo_moneycnt * 24);
curScoreClip.disp.score.text = combo_moneycnt * 24;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + (combo_moneycnt * 21);
curScoreClip.disp.score.text = combo_moneycnt * 21;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + (combo_moneycnt * 17);
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + (combo_moneycnt * 15);
curScoreClip.disp.score.text = combo_moneycnt * 15;
}
}
if (!isGameOver) {
if (table4._visible) {
var i = 0;
while (i < lobbyArr.length) {
if (lobbyArr[i] == 1) {
lobbyArr.splice(i, 1);
}
i++;
}
}
CallNextCustomerSet();
}
} else if (eval ("this.customer" + selectedTable).type == "oldlady") {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + 17;
curScoreClip.disp.score.text = 17;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + 14;
curScoreClip.disp.score.text = 14;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + 11;
curScoreClip.disp.score.text = 11;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + 10;
curScoreClip.disp.score.text = 10;
}
} else {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + 24;
curScoreClip.disp.score.text = combo_moneycnt * 24;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + 21;
curScoreClip.disp.score.text = combo_moneycnt * 21;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + 17;
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + 15;
curScoreClip.disp.score.text = combo_moneycnt * 15;
}
}
}
function IdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.preparecnt++;
if (_arg3.preparecnt >= 20) {
clearInterval(_arg3.process_interval);
_arg3.machineStatus = "ready";
_arg3.machineshake = "off";
if (_arg3.choco_machines.status == "prepared") {
_arg3.choco_machines.status = "chocolateReady";
}
if (_global.soundstat == "onn") {
_root.choco_done_Sound.start();
}
}
}
}
function IdleProcess2(_arg3) {
if (!_arg3.isPaused) {
_arg3.prepare2cnt++;
if (_arg3.prepare2cnt >= 20) {
clearInterval(_arg3.process_interval2);
_arg3.machine2Status = "ready";
_arg3.machine2shake = "off";
if (_arg3.choco_machines2.status == "prepared") {
_arg3.choco_machines2.status = "chocolateReady";
}
if (_global.soundstat == "onn") {
_root.choco_done_Sound.start();
}
}
}
}
function SpecialIdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.spl_preparecnt++;
if (_arg3.spl_preparecnt >= 40) {
clearInterval(_arg3.special_process_interval);
_arg3.special_machineStatus = "ready";
_arg3.specialmachineshake = "off";
if (_arg3.special_choco_machines.status == "prepared") {
_arg3.special_choco_machines.status = "chocolateReady";
}
if (_global.soundstat == "onn") {
_root.choco_done_Sound.start();
}
}
}
}
function CoffeeIdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.coffee_preparecnt++;
if (_arg3.coffee_preparecnt >= 20) {
clearInterval(_arg3.coffee_process_interval);
_arg3.coffeeStatus = "ready";
_arg3.coffeemachineshake = "off";
_arg3.coffee_machine.status = "coffeeReady";
if (_global.soundstat == "onn") {
_root.hotchoco_done_Sound.start();
}
}
}
}
function getRandom(_arg4, _arg5) {
var _local3 = _arg5 - _arg4;
var _local2 = Math.random() * _local3;
var _local1 = Math.round(_local2);
_local1 = _local1 + _arg4;
return(_local1);
}
function StoreInSequence() {
var owner = this;
eval ("this." + moveTarget).onRelease();
}
function CallSequence() {
var owner = this;
if (sequenceArr[0] == choco_machines) {
if (((owner.isTargetReached && (owner.machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines";
owner.calculateAngle(owner.chomac_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == choco_machines2) {
if (((owner.isTargetReached && (owner.machine2Status == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines2";
owner.calculateAngle(owner.chomac_indicate2);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == special_choco_machines) {
if (((owner.isTargetReached && (owner.special_machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "special_choco_machines";
owner.calculateAngle(owner.splmn_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == dusbin) {
if ((owner.isTargetReached && (owner.dusbinStatus == "ready")) && (!owner.isPaused)) {
owner.isTargetReached = false;
owner.selectedTarget = "dusbin";
owner.calculateAngle(owner.dusbin_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == coffee_machine) {
if (((owner.isTargetReached && (!owner.isPaused)) && (owner.coffeeStatus == "ready")) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "coffee_machine";
owner.calculateAngle(owner.coffee_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if ((((sequenceArr[0] == table1) || (sequenceArr[0] == table2)) || (sequenceArr[0] == table3)) || (sequenceArr[0] == table4)) {
if ((owner.isTargetReached && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = sequenceArr[0]._name;
owner.calculateAngle(sequenceArr[0]);
if (owner.selectedTarget == "table1") {
owner.selectedTable = 1;
} else if (owner.selectedTarget == "table2") {
owner.selectedTable = 2;
} else if (owner.selectedTarget == "table3") {
owner.selectedTable = 3;
} else if (owner.selectedTarget == "table4") {
owner.selectedTable = 4;
}
eval ("owner.orderbook" + owner.selectedTable).pointer._visible = true;
}
}
}
function CallPause() {
var _local3 = this;
stopAllSounds();
_local3.bg.blink.gotoAndStop(_local3.bg.blink._currentframe);
_local3.customer1.customer.gotoAndStop(_local3.customer1.customer._currentframe);
_local3.customer2.customer.gotoAndStop(_local3.customer2.customer._currentframe);
_local3.customer3.customer.gotoAndStop(_local3.customer3.customer._currentframe);
_local3.special_choco_machines.machine1.blink.gotoAndStop(_local3.special_choco_machines.machine1.blink._currentframe);
_local3.choco_machines.single_machine.blink.gotoAndStop(_local3.choco_machines.single_machine.blink._currentframe);
_local3.salesGirl.coffeeicon.smoke.gotoAndStop(_local3.salesGirl.coffeeicon.smoke._currentframe);
_local3.customer4.customer.gotoAndStop(_local3.customer4.customer._currentframe);
_local3.coin_Anim1.coin.gotoAndStop(_local3.coin_Anim1.coin._currentframe);
_local3.coin_Anim2.coin.gotoAndStop(_local3.coin_Anim2.coin._currentframe);
_local3.coin_Anim3.coin.gotoAndStop(_local3.coin_Anim3.coin._currentframe);
_local3.coin_Anim4.coin.gotoAndStop(_local3.coin_Anim4.coin._currentframe);
_local3.comboClip.combo.gotoAndStop(_local3.comboClip.combo._currentframe);
_local3.orderbook1.heartinClip.gotoAndStop(_local3.orderbook1.heartinClip._currentframe);
_local3.orderbook2.heartinClip.gotoAndStop(_local3.orderbook2.heartinClip._currentframe);
_local3.orderbook3.heartinClip.gotoAndStop(_local3.orderbook3.heartinClip._currentframe);
_local3.orderbook4.heartinClip.gotoAndStop(_local3.orderbook4.heartinClip._currentframe);
_local3.curScoreClip.gotoAndStop(_local3.curScoreClip._currentframe);
_local3.coin_Anim1.coin.coin_rotate.gotoAndStop(_local3.coin_Anim1.coin.coin_rotate._currentframe);
_local3.coin_Anim1.coin.coin_rotate2.gotoAndStop(_local3.coin_Anim1.coin.coin_rotate2._currentframe);
_local3.coin_Anim1.coin.coin_rotate3.gotoAndStop(_local3.coin_Anim1.coin.coin_rotate3._currentframe);
_local3.coin_Anim1.coin.coin_rotate4.gotoAndStop(_local3.coin_Anim1.coin.coin_rotate4._currentframe);
_local3.coin_Anim2.coin.coin_rotate.gotoAndStop(_local3.coin_Anim2.coin.coin_rotate._currentframe);
_local3.coin_Anim2.coin.coin_rotate2.gotoAndStop(_local3.coin_Anim2.coin.coin_rotate2._currentframe);
_local3.coin_Anim2.coin.coin_rotate3.gotoAndStop(_local3.coin_Anim2.coin.coin_rotate3._currentframe);
_local3.coin_Anim2.coin.coin_rotate4.gotoAndStop(_local3.coin_Anim2.coin.coin_rotate4._currentframe);
_local3.coin_Anim3.coin.coin_rotate.gotoAndStop(_local3.coin_Anim3.coin.coin_rotate._currentframe);
_local3.coin_Anim3.coin.coin_rotate2.gotoAndStop(_local3.coin_Anim3.coin.coin_rotate2._currentframe);
_local3.coin_Anim3.coin.coin_rotate3.gotoAndStop(_local3.coin_Anim3.coin.coin_rotate3._currentframe);
_local3.coin_Anim3.coin.coin_rotate4.gotoAndStop(_local3.coin_Anim3.coin.coin_rotate4._currentframe);
_local3.coin_Anim4.coin.coin_rotate.gotoAndStop(_local3.coin_Anim4.coin.coin_rotate._currentframe);
_local3.coin_Anim4.coin.coin_rotate2.gotoAndStop(_local3.coin_Anim4.coin.coin_rotate2._currentframe);
_local3.coin_Anim4.coin.coin_rotate3.gotoAndStop(_local3.coin_Anim4.coin.coin_rotate3._currentframe);
_local3.coin_Anim4.coin.coin_rotate4.gotoAndStop(_local3.coin_Anim4.coin.coin_rotate4._currentframe);
_local3.comboClip.combo.coin_rotate.gotoAndStop(_local3.comboClip.combo.coin_rotate._currentframe);
if (_local3.scoreIndicateClip._visible) {
_local3.scoreIndicateClip.gotoAndStop(_local3.scoreIndicateClip._currentframe);
}
if (_local3.expertScoreClip._visible) {
_local3.expertScoreClip.gotoAndStop(_local3.expertScoreClip._currentframe);
}
_global.ringvisible = phone_mc.ring._visible;
phone_mc.ring._visible = false;
_local3.chocolateClip.mc.gotoAndStop(_local3.chocolateClip.mc._currentframe);
_local3.specialChocolateClip.mc.gotoAndStop(_local3.specialChocolateClip.mc._currentframe);
_local3.chocolateClip2.mc.gotoAndStop(_local3.chocolateClip2.mc._currentframe);
_local3.coffeeClip.gotoAndStop(_local3.coffeeClip._currentframe);
}
function CallResume() {
var _local4 = this;
if (_global.soundstat == "onn") {
_root.gameSound.start();
}
_local4.bg.blink.gotoAndPlay(_local4.bg.blink._currentframe);
_local4.customer1.customer.gotoAndPlay(_local4.customer1.customer._currentframe);
_local4.customer2.customer.gotoAndPlay(_local4.customer2.customer._currentframe);
_local4.customer3.customer.gotoAndPlay(_local4.customer3.customer._currentframe);
_local4.special_choco_machines.machine1.blink.gotoAndPlay(_local4.special_choco_machines.machine1.blink._currentframe);
_local4.choco_machines.single_machine.blink.gotoAndPlay(_local4.choco_machines.single_machine.blink._currentframe);
_local4.salesGirl.coffeeicon.smoke.gotoAndPlay(_local4.salesGirl.coffeeicon.smoke._currentframe);
_local4.customer4.customer.gotoAndPlay(_local4.customer4.customer._currentframe);
_local4.coin_Anim1.coin.gotoAndPlay(_local4.coin_Anim1.coin._currentframe - 1);
_local4.coin_Anim2.coin.gotoAndPlay(_local4.coin_Anim2.coin._currentframe - 1);
_local4.coin_Anim3.coin.gotoAndPlay(_local4.coin_Anim3.coin._currentframe - 1);
_local4.coin_Anim4.coin.gotoAndPlay(_local4.coin_Anim4.coin._currentframe - 1);
_local4.comboClip.combo.gotoAndPlay(_local4.comboClip.combo._currentframe - 1);
_local4.orderbook1.heartinClip.gotoAndPlay(_local4.orderbook1.heartinClip._currentframe - 1);
_local4.orderbook2.heartinClip.gotoAndPlay(_local4.orderbook2.heartinClip._currentframe - 1);
_local4.orderbook3.heartinClip.gotoAndPlay(_local4.orderbook3.heartinClip._currentframe - 1);
_local4.orderbook4.heartinClip.gotoAndPlay(_local4.orderbook4.heartinClip._currentframe - 1);
_local4.curScoreClip.gotoAndPlay(_local4.curScoreClip._currentframe);
_local4.coin_Anim1.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate._currentframe);
_local4.coin_Anim1.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate2._currentframe);
_local4.coin_Anim1.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate3._currentframe);
_local4.coin_Anim1.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate4._currentframe);
_local4.coin_Anim2.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate._currentframe);
_local4.coin_Anim2.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate2._currentframe);
_local4.coin_Anim2.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate3._currentframe);
_local4.coin_Anim2.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate4._currentframe);
_local4.coin_Anim3.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate._currentframe);
_local4.coin_Anim3.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate2._currentframe);
_local4.coin_Anim3.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate3._currentframe);
_local4.coin_Anim3.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate4._currentframe);
_local4.coin_Anim4.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate._currentframe);
_local4.coin_Anim4.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate2._currentframe);
_local4.coin_Anim4.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate3._currentframe);
_local4.coin_Anim4.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate4._currentframe);
_local4.comboClip.combo.coin_rotate.gotoAndPlay(_local4.comboClip.combo.coin_rotate._currentframe);
if (_local4.scoreIndicateClip._visible) {
_local4.scoreIndicateClip.gotoAndPlay(_local4.scoreIndicateClip._currentframe - 1);
}
if (_local4.expertScoreClip._visible) {
_local4.expertScoreClip.gotoAndPlay(_local4.expertScoreClip._currentframe - 1);
}
phone_mc.ring._visible = _global.ringvisible;
_local4.chocolateClip.mc.gotoAndPlay(_local4.chocolateClip.mc._currentframe - 1);
_local4.specialChocolateClip.mc.gotoAndPlay(_local4.specialChocolateClip.mc._currentframe - 1);
_local4.chocolateClip2.mc.gotoAndPlay(_local4.chocolateClip2.mc._currentframe - 1);
_local4.coffeeClip.gotoAndPlay(_local4.coffeeClip._currentframe - 1);
}
function ObjectsRollOut() {
table1.onRollOut();
table2.onRollOut();
table3.onRollOut();
table4.onRollOut();
phone_mc.onRollOut();
choco_machines.onRollOut();
choco_machines2.onRollOut();
dusbin.onRollOut();
coffee_machine.onRollOut();
special_choco_machines.onRollOut();
}
function Reset() {
targetclip = "table1";
lobbyArr.length = 0;
lobbyArr = new Array(1, 2, 3);
currentDirection = "down";
targetDirection = "";
isPopup = false;
popup_info = "welcome";
clearInterval(popup_interval);
clearInterval(special_process_interval);
clearInterval(process_interval);
popup_interval = -1;
isTargetReached = true;
selectedTarget = "";
orderno = 0;
score = 0;
ismoveready = false;
orderTaken = 0;
customerCount = 0;
machineStatus = "notready";
dusbinStatus = "notready";
girlwalkframe = 2;
isFirstServeFinished = false;
depthArr.length = 0;
depthArr = new Array(-10313, -10315, -10317);
chocolateTypeArr.length = 0;
chocolateTypeArr = new Array("type_triangle", "type_fish", "type_round", "type_rabbit", "type_box");
customerEnterset = "firstset";
moneyCount = 0;
clearInterval(gameInterval);
gametimer = 0;
isGameOver = false;
combo_bookcnt = 0;
combo_ordercnt = 0;
combo_moneycnt = 0;
curtarget = "";
clearInterval(customerEnterInterval);
clearInterval(customerEnterInterval2);
clearInterval(customerEnterInterval3);
clearInterval(Re_customerEnterInterval);
clearInterval(reportInterval);
clearInterval(orderbook1.heatInterval);
clearInterval(orderbook2.heatInterval);
clearInterval(orderbook3.heatInterval);
clearInterval(orderbook4.heatInterval);
clearInterval(deliveryinterval);
isPaused = false;
sequenceArr.length = 0;
sequenceArr = new Array();
girlspeed = 12;
clearInterval(jumpInterval);
clearInterval(phoneInterval);
Key.removeListener(leve8Keyobj);
keyTarget = undefined;
phoneringcnt = 0;
isphonecalled = false;
}
var targetclip = "table1";
var lobbyArr = new Array(1, 2, 3);
var currentDirection = "down";
var isPopup = false;
var popup_info = "welcome";
var popup_interval = -1;
var process_interval = -1;
var special_process_interval = -1;
var isTargetReached = true;
var selectedTarget = "";
var orderno = 0;
var ismoveready = false;
var orderTaken = 0;
var customerCount = 0;
var machineStatus = "notready";
var machine2Status = "notready";
var special_machineStatus = "notready";
var dusbinStatus = "notready";
var coffeeStatus = "notready";
var girlwalkframe = 2;
var isFirstServeFinished = false;
var score = 0;
var depthArr = new Array(-10313, -10315, -10317);
var chocolateTypeArr = new Array("type_triangle", "type_fish", "type_round", "type_rabbit", "type_box");
var customerEnterset = "firstset";
var moneyCount = 0;
var gameInterval = -1;
var gametimer = 0;
var isGameOver = false;
var combo_bookcnt = 0;
var combo_ordercnt = 0;
var combo_moneycnt = 0;
var gamestartInterval = -1;
var curtarget = "";
var customerEnterInterval = -1;
var customerEnterInterval2 = -1;
var reportInterval = -1;
var isPaused = false;
var coffee_process_interval = -1;
var ringstat = "off";
var phone_status = "notready";
var machinespeed = 1;
var machineshake = "off";
var specialmachineshake = "off";
var coffeemachineshake = "off";
var machine2shake = "off";
var specialmachinespeed = 1;
var coffeemachinespeed = 1;
var machine2speed = 1;
var girlspeed = 12;
var sequenceArr = new Array();
var callwaitInterval = -1;
var customerEnterInterval3 = -1;
var deliveryinterval = -1;
var jumpInterval = -1;
var tips = 0;
var phoneInterval = -1;
var process_interval2 = -1;
var Re_customerEnterInterval = -1;
var phoneringcnt = 0;
var cusArr = new Array("younglady", "oldlady", "younglady");
var isphonecalled = false;
var preparecnt = 0;
var prepare2cnt = 0;
var spl_preparecnt = 0;
var coffee_preparecnt = 0;
}
Symbol 1706 MovieClip [__Packages.Level9] Frame 0
class Level9 extends MovieClip
{
var dummy_highlight, deliveryboy, salesGirl, _parent, choco_machines, choco_machines2, special_choco_machines, coffee_machine, scoreIndicateClip, shopclosedClip, timerClip, chocolate_container, special_chocolate_container, coffeeClip, chocolateClip, chocolateClip2, popup_mc, selectClip, heartinClip, shopopenClip, reportMc, cancel_mc, infoClip, comboClip, dusbinContainer, curScoreClip, specialChocolateClip, expertScoreClip, table4, table3, table2, table1, coin_Anim4, coin_Anim3, coin_Anim2, coin_Anim1, dusbin, phone_mc, btn_pause, leve9Keyobj, keyTarget, pauseTarget, scoreClip, radian, targetDirection, preferred_chocolate1, preferred_chocolate2, customer4, orderbook4, attachMovie, getNextHighestDepth, customer1, orderbook1, customer2, orderbook2, customer3, orderbook3, selectedTable, re_entry, moveTarget;
function Level9 () {
super();
}
function onLoad() {
var owner = this;
clearInterval(popup_interval);
clearInterval(process_interval);
Reset();
dummy_highlight._visible = false;
deliveryboy._visible = false;
salesGirl.coffeeicon._visible = false;
_parent.pauseClip._visible = false;
salesGirl.gotoAndStop(currentDirection);
salesGirl.chocolateCount = 0;
choco_machines.status = "empty";
choco_machines2.status = "empty";
special_choco_machines.status = "empty";
coffee_machine.status = "empty";
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
scoreIndicateClip._visible = false;
shopclosedClip._visible = false;
timerClip._visible = false;
chocolate_container._visible = false;
special_chocolate_container._visible = false;
special_chocolate_container.mc.gotoAndStop(1);
coffeeClip._visible = false;
chocolateClip._visible = false;
chocolateClip2._visible = false;
popup_mc._visible = false;
selectClip._visible = false;
heartinClip._visible = false;
shopopenClip._visible = false;
reportMc._visible = false;
cancel_mc._visible = false;
infoClip._visible = false;
comboClip._visible = false;
dusbinContainer._visible = false;
curScoreClip._visible = false;
specialChocolateClip._visible = false;
expertScoreClip._visible = false;
table3._visible = (table4._visible = false);
table2._visible = false;
table1._visible = false;
coin_Anim3._visible = (coin_Anim4._visible = false);
coin_Anim2._visible = false;
coin_Anim1._visible = false;
table1.point = 1;
table2.point = 2;
table3.point = 3;
table4.point = 4;
choco_machines._visible = true;
choco_machines.gotoAndStop(2);
dusbin._visible = true;
dusbin.gotoAndStop(2);
special_choco_machines._visible = true;
special_choco_machines.gotoAndStop(1);
special_choco_machines.machine1.gotoAndStop(2);
coffee_machine._visible = true;
coffee_machine.gotoAndStop(2);
choco_machines2._visible = true;
choco_machines2.gotoAndStop(2);
phone_mc._visible = true;
owner.combo_ordercnt = 0;
owner.combo_moneycnt = 0;
owner.btn_pause._visible = true;
owner.popupDisable();
var randomno = owner.getRandom(0, 2);
owner.customerEnterInterval = setInterval(owner.CallCustomer, 1500, owner, owner.lobbyArr[randomno], "oldlady");
owner.lobbyArr.splice(randomno, 1);
var randomno = owner.getRandom(0, owner.lobbyArr.length - 1);
owner.customerEnterInterval2 = setInterval(owner.CallCustomer2, 2500, owner, owner.lobbyArr[randomno], "younglady");
owner.lobbyArr.splice(randomno, 1);
owner.isPopup = false;
owner.popup_info = "level2_start";
owner.bg.gotoAndStop(2);
owner.shopopenClip._visible = true;
owner.shopopenClip.gotoAndPlay(1);
owner.ismoveready = true;
owner.machineStatus = "ready";
owner.machine2Status = "ready";
owner.special_machineStatus = "ready";
owner.dusbinStatus = "ready";
owner.coffeeStatus = "ready";
owner.timerClip._visible = true;
clearInterval(owner.gameInterval);
owner.gametimer = 0;
owner.gameInterval = setInterval(owner.GameTimeLimit, 660, owner);
owner.Re_customerEnterInterval = setInterval(owner.CallNewCustomer, 3500, owner);
owner.phone_mc.gotoAndStop(2);
owner.phone_mc.ring.gotoAndStop(1);
btn_pause.onRelease = function () {
if (this._visible && (owner._parent.pauseClip._visible == false)) {
owner.pauseTarget = "btn_continue";
owner.isPaused = true;
owner.isPopup = true;
this._visible = false;
owner._parent.pauseClip._visible = true;
owner._parent.pauseClip.gotoAndPlay(2);
owner.CallPause();
}
};
leve9Keyobj = new Object();
Key.addListener(leve9Keyobj);
leve9Keyobj.onKeyUp = function () {
if (Key.getCode() == 13) {
if ((!owner.isPaused) && (!owner.isGameOver)) {
owner.StoreInSequence();
}
}
};
leve9Keyobj.onKeyDown = function () {
if (Key.getCode() == 37) {
if (!owner.isPaused) {
owner.LeftNavigation();
}
} else if (Key.getCode() == 39) {
if (!owner.isPaused) {
owner.RightNavigation();
}
} else if (Key.getCode() == 38) {
if (!owner.isPaused) {
owner.UpNavigation();
} else {
owner.pauseUpNavigation();
}
} else if (Key.getCode() == 40) {
if (!owner.isPaused) {
owner.DownNavigation();
} else {
owner.pauseDownNavigation();
}
} else if (Key.getCode() == 13) {
if (owner.popup_mc._visible) {
owner.popup_mc.btn_ok.onRelease();
} else if (owner.reportMc._visible) {
if (owner.reportMc._currentframe == 1) {
owner.reportMc.mc.btn_continue.onRelease();
} else {
owner.reportMc.mc.btn_retry.onRelease();
}
} else if (!owner.isPaused) {
owner.EnterFunction();
} else {
owner.PauseEnterFunction();
}
} else if (Key.getAscii() == 27) {
if (!owner.isPaused) {
owner.btn_pause.onRelease();
} else if (owner.isPaused) {
owner._parent.pauseClip.btn_continue.onRelease();
}
}
};
phone_mc.onRollOver = function () {
if (((!owner.isPaused) && (owner.table4._visible == true)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
if (owner.ringstat == "off") {
this.ring.gotoAndStop(1);
eval ("owner.orderbook" + this.point).highlight.gotoAndStop(2);
} else {
this.gotoAndStop(3);
}
owner.moveTarget = "phone_mc";
}
};
phone_mc.onRollOut = (phone_mc.onReleaseOutside = function () {
this.gotoAndStop(2);
if (owner.ringstat == "off") {
this.ring.gotoAndStop(1);
eval ("owner.orderbook" + this.point).highlight.gotoAndStop(1);
}
});
table1.onRollOver = (table2.onRollOver = (table3.onRollOver = (table4.onRollOver = function () {
if ((!owner.isPaused) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = this._name;
owner.moveTarget = this._name;
eval ("this.orderbook" + this.point).highlight.gotoAndStop(2);
if (eval ("this.orderbook" + this.point).money_mc._currentframe == 2) {
eval ("this.orderbook" + this.point).highlight_small.gotoAndStop(2);
} else if (eval ("this.orderbook" + this.point).money_mc._currentframe == 3) {
eval ("this.orderbook" + this.point).highlight_small_coin.gotoAndStop(2);
}
}
})));
table1.onRollOut = (table2.onRollOut = (table3.onRollOut = (table4.onRollOut = function () {
eval ("this.orderbook" + this.point).highlight.gotoAndStop(1);
if (eval ("this.orderbook" + this.point).money_mc._currentframe == 2) {
eval ("this.orderbook" + this.point).highlight_small.gotoAndStop(1);
} else if (eval ("this.orderbook" + this.point).money_mc._currentframe == 3) {
eval ("this.orderbook" + this.point).highlight_small_coin.gotoAndStop(1);
}
})));
choco_machines.onRollOver = function () {
if (((owner.machineStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "choco_machines";
owner.moveTarget = "choco_machines";
this.gotoAndStop(3);
owner.dummy_highlight._visible = true;
}
};
choco_machines.onRollOut = (choco_machines.onReleaseOutside = function () {
this.gotoAndStop(2);
owner.dummy_highlight._visible = false;
});
choco_machines2.onRollOver = function () {
if (((owner.machine2Status == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "choco_machines2";
owner.moveTarget = "choco_machines2";
this.gotoAndStop(3);
}
};
choco_machines2.onRollOut = (choco_machines2.onReleaseOutside = function () {
this.gotoAndStop(2);
});
dusbin.onRollOver = function () {
if ((owner.dusbinStatus == "ready") && (!owner.isPaused)) {
owner.ObjectsRollOut();
owner.keyTarget = "dusbin";
owner.moveTarget = "dusbin";
this.gotoAndStop(3);
}
};
dusbin.onRollOut = (dusbin.onReleaseOutside = function () {
this.gotoAndStop(2);
});
coffee_machine.onRollOver = function () {
if (((owner.coffeeStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "coffee_machine";
owner.moveTarget = "coffee_machine";
this.gotoAndStop(3);
}
};
coffee_machine.onRollOut = (coffee_machine.onReleaseOutside = function () {
this.gotoAndStop(2);
});
special_choco_machines.onRollOver = function () {
if (((owner.special_machineStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "special_choco_machines";
owner.moveTarget = "special_choco_machines";
this.machine1.gotoAndStop(3);
}
};
special_choco_machines.onRollOut = (special_choco_machines.onReleaseOutside = function () {
this.machine1.gotoAndStop(2);
});
coffee_machine.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.coffee_machine);
}
};
coffee_machine.onPress = function () {
if (((owner.isTargetReached && (!owner.isPaused)) && (owner.coffeeStatus == "ready")) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "coffee_machine";
owner.calculateAngle(owner.coffee_indicate);
this.pointer._visible = true;
}
};
choco_machines.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.choco_machines);
}
};
choco_machines.onPress = function () {
if (((owner.isTargetReached && (owner.machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines";
owner.calculateAngle(owner.chomac_indicate);
this.pointer._visible = true;
}
};
choco_machines2.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.choco_machines2);
}
};
choco_machines2.onPress = function () {
if (((owner.isTargetReached && (owner.machine2Status == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines2";
owner.calculateAngle(owner.chomac_indicate2);
this.pointer._visible = true;
}
};
special_choco_machines.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.special_choco_machines);
}
};
special_choco_machines.onPress = function () {
if (((owner.isTargetReached && (owner.special_machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "special_choco_machines";
owner.calculateAngle(owner.splmn_indicate);
this.pointer._visible = true;
}
};
dusbin.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.dusbin);
}
};
dusbin.onPress = function () {
if ((owner.isTargetReached && (owner.dusbinStatus == "ready")) && (!owner.isPaused)) {
owner.isTargetReached = false;
owner.selectedTarget = "dusbin";
owner.calculateAngle(owner.dusbin_indicate);
this.pointer._visible = true;
}
};
table1.onRelease = (table2.onRelease = (table3.onRelease = (table4.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(this);
}
})));
table1.onPress = (table2.onPress = (table3.onPress = (table4.onPress = function () {
if ((owner.isTargetReached && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = this._name;
if (owner.selectedTarget == "table1") {
owner.calculateAngle(this);
owner.selectedTable = 1;
} else if (owner.selectedTarget == "table2") {
owner.calculateAngle(this);
owner.selectedTable = 2;
} else if (owner.selectedTarget == "table3") {
owner.calculateAngle(this);
owner.selectedTable = 3;
} else if (owner.selectedTarget == "table4") {
owner.calculateAngle(owner.phone_indicate);
owner.selectedTable = 4;
}
eval ("owner.orderbook" + owner.selectedTable).pointer._visible = true;
}
})));
phone_mc.onRelease = function () {
if ((((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) && (owner.table4._visible == true)) {
owner.sequenceArr.push(owner.phone_mc);
}
};
phone_mc.onPress = function () {
if (((owner.isTargetReached && (!owner.isPaused)) && (owner.table4._visible == true)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "table4";
owner.calculateAngle(owner.phone_indicate);
owner.selectedTable = 4;
}
};
}
function LeftNavigation() {
if (chocolate_container._visible) {
if (keyTarget == "type_box") {
chocolate_container.mc.type_round.onRollOver();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_triangle.onRollOver();
}
} else if (special_chocolate_container._visible) {
if (special_chocolate_container.mc.type_rabbit._currentframe == 2) {
special_chocolate_container.mc.type_rabbit.onRollOut();
special_chocolate_container.mc.type_fish.onRollOver();
} else if (special_chocolate_container.mc.type_fish._currentframe == 2) {
special_chocolate_container.mc.type_fish.onRollOut();
special_chocolate_container.mc.type_rabbit.onRollOver();
}
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate2) {
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRollOut();
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRollOver();
}
} else if (keyTarget == "coffee_machine") {
coffee_machine.onRollOut();
if (table3._visible) {
table3.onRollOver();
} else if (table2._visible) {
table2.onRollOver();
} else if (table1._visible) {
table1.onRollOver();
} else if (table4._visible) {
table4.onRollOver();
phone_mc.onRollOver();
}
} else if (keyTarget == "choco_machines") {
choco_machines.onRollOut();
coffee_machine.onRollOver();
} else if (keyTarget == "choco_machines2") {
choco_machines2.onRollOut();
choco_machines.onRollOver();
} else if (keyTarget == "special_choco_machines") {
special_choco_machines.onRollOut();
choco_machines2.onRollOver();
}
}
function RightNavigation() {
if (chocolate_container._visible) {
if (keyTarget == "type_triangle") {
chocolate_container.mc.type_round.onRollOver();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_box.onRollOver();
}
} else if (special_chocolate_container._visible) {
if (special_chocolate_container.mc.type_rabbit._currentframe == 2) {
special_chocolate_container.mc.type_rabbit.onRollOut();
special_chocolate_container.mc.type_fish.onRollOver();
} else if (special_chocolate_container.mc.type_fish._currentframe == 2) {
special_chocolate_container.mc.type_fish.onRollOut();
special_chocolate_container.mc.type_rabbit.onRollOver();
}
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate1) {
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRollOut();
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRollOver();
}
} else if (keyTarget == undefined) {
coffee_machine.onRollOver();
} else if (keyTarget == "coffee_machine") {
coffee_machine.onRollOut();
choco_machines.onRollOver();
} else if (keyTarget == "choco_machines") {
choco_machines.onRollOut();
choco_machines2.onRollOver();
} else if (keyTarget == "choco_machines2") {
choco_machines2.onRollOut();
special_choco_machines.onRollOver();
} else if ((((keyTarget == "table1") || (keyTarget == "table2")) || (keyTarget == "table3")) || (keyTarget == "table4")) {
eval ("this." + keyTarget).onRollOut();
phone_mc.onRollOut();
coffee_machine.onRollOver();
}
}
function UpNavigation() {
if (keyTarget == "table4") {
if (table1._visible) {
table4.onRollOut();
phone_mc.onRollOut();
table1.onRollOver();
} else if (table2._visible) {
table4.onRollOut();
phone_mc.onRollOut();
table1.onRollOut();
table2.onRollOver();
} else if (table3._visible) {
table4.onRollOut();
phone_mc.onRollOut();
table1.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "table1") {
if (table2._visible) {
table1.onRollOut();
table2.onRollOver();
} else if (table3._visible) {
table1.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "table2") {
if (table3._visible) {
table2.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "dusbin") {
dusbin.onRollOut();
special_choco_machines.onRollOver();
}
}
function DownNavigation() {
if (keyTarget == "table3") {
if (table2._visible) {
table3.onRollOut();
table2.onRollOver();
} else if (table1._visible) {
table3.onRollOut();
table1.onRollOver();
} else if (table4._visible) {
table3.onRollOut();
table1.onRollOut();
table4.onRollOver();
phone_mc.onRollOver();
}
} else if (keyTarget == "table2") {
if (table1._visible) {
table2.onRollOut();
table1.onRollOver();
} else if (table4._visible) {
table2.onRollOut();
table1.onRollOut();
table4.onRollOver();
phone_mc.onRollOver();
}
} else if (keyTarget == "table1") {
if (table4._visible) {
table1.onRollOut();
table4.onRollOver();
phone_mc.onRollOver();
}
} else if (keyTarget == "special_choco_machines") {
special_choco_machines.onRollOut();
dusbin.onRollOver();
}
}
function EnterFunction() {
if (chocolate_container._visible) {
if (keyTarget == "type_triangle") {
chocolate_container.mc.type_triangle.onRelease();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_round.onRelease();
} else if (keyTarget == "type_box") {
chocolate_container.mc.type_box.onRelease();
}
} else if (special_chocolate_container._visible) {
eval ("this.special_chocolate_container.mc." + keyTarget).onRelease();
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate1) {
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRelease();
} else if (keyTarget == _global.preferred_chocolate2) {
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRelease();
}
} else {
eval ("this." + keyTarget).onPress();
}
}
function PauseEnterFunction() {
eval ("this._parent.pauseClip." + pauseTarget).onRelease();
}
function pauseUpNavigation() {
if (pauseTarget == "btn_premium") {
_parent.pauseClip.btn_premium.onRollOut();
_parent.pauseClip.btn_mainmenu.onRollOver();
} else if (pauseTarget == "btn_mainmenu") {
_parent.pauseClip.btn_mainmenu.onRollOut();
_parent.pauseClip.btn_restart.onRollOver();
} else if (pauseTarget == "btn_restart") {
_parent.pauseClip.btn_restart.onRollOut();
_parent.pauseClip.btn_continue.onRollOver();
}
}
function pauseDownNavigation() {
if (pauseTarget == "pause") {
_parent.pauseClip.btn_continue.onRollOver();
} else if (pauseTarget == "btn_continue") {
_parent.pauseClip.btn_continue.onRollOut();
_parent.pauseClip.btn_restart.onRollOver();
} else if (pauseTarget == "btn_restart") {
_parent.pauseClip.btn_restart.onRollOut();
_parent.pauseClip.btn_mainmenu.onRollOver();
} else if (pauseTarget == "btn_mainmenu") {
_parent.pauseClip.btn_mainmenu.onRollOut();
_parent.pauseClip.btn_premium.onRollOver();
}
}
function updateScore() {
scoreClip.score_txt.text = score;
scoreClip.loading.gotoAndStop(score);
if ((score >= 400) && (scoreClip.target._currentframe == 1)) {
scoreClip.target.gotoAndPlay(1);
scoreIndicateClip._visible = true;
scoreIndicateClip.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.target_score_Sound.start();
}
}
if ((score >= 880) && (scoreClip.expert._currentframe == 1)) {
scoreClip.expert.gotoAndPlay(1);
expertScoreClip._visible = true;
expertScoreClip.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.expert_score_Sound.start();
}
}
}
function onEnterFrame() {
var owner = this;
if (((!isPopup) && (!isTargetReached)) && (!owner.isPaused)) {
shopperMovement();
}
if (machineshake == "onn") {
machinespeed = -machinespeed;
choco_machines._x = choco_machines._x + ((2 * machinespeed) / 2);
choco_machines._y = choco_machines._y + ((2 * machinespeed) / 2);
}
if (specialmachineshake == "onn") {
specialmachinespeed = -specialmachinespeed;
special_choco_machines._x = special_choco_machines._x + ((1 * specialmachinespeed) / 2);
special_choco_machines._y = special_choco_machines._y + ((1 * specialmachinespeed) / 2);
} else {
special_choco_machines._x = 631;
special_choco_machines._y = 101;
}
if (coffeemachineshake == "onn") {
coffeemachinespeed = -coffeemachinespeed;
coffee_machine._x = coffee_machine._x + ((1 * coffeemachinespeed) / 2);
coffee_machine._y = coffee_machine._y + ((1 * coffeemachinespeed) / 2);
}
if (machine2shake == "onn") {
machine2speed = -machine2speed;
choco_machines2._x = choco_machines2._x + ((2 * machine2speed) / 2);
choco_machines2._y = choco_machines2._y + ((2 * machine2speed) / 2);
}
_parent.pauseClip.btn_continue.onRollOver = (_parent.pauseClip.btn_restart.onRollOver = (_parent.pauseClip.btn_mainmenu.onRollOver = (_parent.pauseClip.btn_premium.onRollOver = function () {
owner._parent.pauseClip.btn_continue.onRollOut();
owner._parent.pauseClip.btn_restart.onRollOut();
owner._parent.pauseClip.btn_mainmenu.onRollOut();
owner._parent.pauseClip.btn_premium.onRollOut();
owner.pauseTarget = this._name;
this.gotoAndStop(2);
})));
_parent.pauseClip.btn_continue.onRollOut = (_parent.pauseClip.btn_restart.onRollOut = (_parent.pauseClip.btn_mainmenu.onRollOut = (_parent.pauseClip.btn_premium.onRollOut = function () {
this.gotoAndStop(1);
})));
_parent.pauseClip.btn_continue.onRelease = function () {
owner.isPaused = false;
owner.isPopup = false;
owner.btn_pause._visible = true;
owner._parent.pauseClip._visible = false;
owner.CallResume();
};
_parent.pauseClip.btn_restart.onRelease = function () {
owner.Reset();
owner._parent.play();
};
_parent.pauseClip.btn_mainmenu.onRelease = function () {
owner.Reset();
owner._parent.gotoAndStop("mainmenu");
};
_parent.pauseClip.btn_premium.onRelease = function () {
this.getURL(_root.urlname, "_blank");
};
popup_mc.btn_ok.onRollOver = function () {
this.gotoAndStop(2);
};
popup_mc.btn_ok.onRollOut = (popup_mc.btn_ok.onReleaseOutside = function () {
this.gotoAndStop(1);
});
chocolate_container.mc.type_triangle.onRollOver = (chocolate_container.mc.type_round.onRollOver = (chocolate_container.mc.type_box.onRollOver = function () {
if (!owner.isPaused) {
owner.keyTarget = this._name;
owner.chocolate_container.mc.type_triangle.gotoAndStop(1);
owner.chocolate_container.mc.type_round.gotoAndStop(1);
owner.chocolate_container.mc.type_box.gotoAndStop(1);
this.gotoAndStop(2);
}
}));
chocolate_container.mc.type_triangle.onRelease = (chocolate_container.mc.type_round.onRelease = (chocolate_container.mc.type_box.onRelease = function () {
if (!owner.isPaused) {
if (owner.selectedTarget == "choco_machines") {
owner.chocolateClip._visible = true;
owner.chocolateClip.gotoAndStop(this._name);
owner.chocolateClip.mc.gotoAndPlay(1);
owner.isTargetReached = true;
owner.preferred_box_chocolate = this._name;
if (owner.choco_machines.status == "empty") {
owner.choco_machines.status = "prepared";
}
owner.machineshake = "onn";
owner.machineStatus = "ready";
owner.keyTarget = "choco_machines";
owner.preparecnt = 0;
owner.process_interval = setInterval(owner.IdleProcess, 100, owner);
} else if (owner.selectedTarget == "choco_machines2") {
owner.chocolateClip2._visible = true;
owner.chocolateClip2.gotoAndStop(this._name);
owner.chocolateClip2.mc.gotoAndPlay(1);
owner.isTargetReached = true;
owner.preferred_box2_chocolate = this._name;
if (owner.choco_machines2.status == "empty") {
owner.choco_machines2.status = "prepared";
}
owner.machine2shake = "onn";
owner.machine2Status = "ready";
owner.keyTarget = "choco_machines2";
owner.prepare2cnt = 0;
owner.process_interval2 = setInterval(owner.IdleProcess2, 100, owner);
}
owner.chocolate_container.gotoAndStop(2);
owner.isPopup = false;
owner.dusbinStatus = "ready";
if (_global.soundstat == "onn") {
_root.choco_producing_Sound.start();
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
}));
chocolate_container.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.machineStatus = "ready";
owner.machine2Status = "ready";
owner.chocolate_container._visible = false;
owner.isPopup = false;
owner.dusbinStatus = "ready";
if (owner.selectedTarget == "choco_machines") {
owner.keyTarget = "choco_machines";
} else {
owner.keyTarget = "choco_machines2";
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
special_chocolate_container.mc.type_rabbit.onRollOver = (special_chocolate_container.mc.type_fish.onRollOver = function () {
if (!owner.isPaused) {
owner.keyTarget = this._name;
owner.special_chocolate_container.mc.type_rabbit.gotoAndStop(1);
owner.special_chocolate_container.mc.type_fish.gotoAndStop(1);
this.gotoAndStop(2);
}
});
special_chocolate_container.mc.type_rabbit.onRelease = (special_chocolate_container.mc.type_fish.onRelease = function () {
if (!owner.isPaused) {
owner.infoClip._visible = false;
owner.specialChocolateClip._visible = true;
owner.specialChocolateClip.gotoAndStop(this._name);
owner.specialChocolateClip.mc.gotoAndPlay(1);
owner.isTargetReached = true;
owner.preferred_special_chocolate = this._name;
if (owner.special_choco_machines.status == "empty") {
owner.special_choco_machines.status = "prepared";
}
owner.spl_preparecnt = 0;
owner.special_process_interval = setInterval(owner.SpecialIdleProcess, 100, owner);
owner.special_chocolate_container.gotoAndStop(2);
owner.isPopup = false;
owner.dusbinStatus = "ready";
owner.special_machineStatus = "ready";
owner.specialmachineshake = "onn";
owner.keyTarget = "special_choco_machines";
if (_global.soundstat == "onn") {
_root.choco_producing_Sound.start();
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
});
special_chocolate_container.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.special_machineStatus = "ready";
owner.special_chocolate_container._visible = false;
owner.isPopup = false;
owner.dusbinStatus = "ready";
owner.keyTarget = "special_choco_machines";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
dusbinContainer.mc.chocobox1.type_triangle.onRollOver = (dusbinContainer.mc.chocobox1.type_round.onRollOver = (dusbinContainer.mc.chocobox1.type_box.onRollOver = (dusbinContainer.mc.chocobox2.type_triangle.onRollOver = (dusbinContainer.mc.chocobox2.type_round.onRollOver = (dusbinContainer.mc.chocobox2.type_box.onRollOver = (dusbinContainer.mc.chocobox1.type_rabbit.onRollOver = (dusbinContainer.mc.chocobox1.type_fish.onRollOver = (dusbinContainer.mc.chocobox2.type_rabbit.onRollOver = (dusbinContainer.mc.chocobox2.type_fish.onRollOver = function () {
owner.keyTarget = this._name;
this.gotoAndStop(2);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onRollOut = (dusbinContainer.mc.chocobox1.type_round.onRollOut = (dusbinContainer.mc.chocobox1.type_box.onRollOut = (dusbinContainer.mc.chocobox2.type_triangle.onRollOut = (dusbinContainer.mc.chocobox2.type_round.onRollOut = (dusbinContainer.mc.chocobox2.type_box.onRollOut = (dusbinContainer.mc.chocobox1.type_rabbit.onRollOut = (dusbinContainer.mc.chocobox1.type_fish.onRollOut = (dusbinContainer.mc.chocobox2.type_rabbit.onRollOut = (dusbinContainer.mc.chocobox2.type_fish.onRollOut = function () {
this.gotoAndStop(1);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_round.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_box.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_triangle.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_round.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_box.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_rabbit.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_fish.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_rabbit.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_fish.onReleaseOutside = function () {
this.gotoAndStop(1);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onRelease = (dusbinContainer.mc.chocobox1.type_round.onRelease = (dusbinContainer.mc.chocobox1.type_box.onRelease = (dusbinContainer.mc.chocobox2.type_triangle.onRelease = (dusbinContainer.mc.chocobox2.type_round.onRelease = (dusbinContainer.mc.chocobox2.type_box.onRelease = (dusbinContainer.mc.chocobox1.type_rabbit.onRelease = (dusbinContainer.mc.chocobox1.type_fish.onRelease = (dusbinContainer.mc.chocobox2.type_rabbit.onRelease = (dusbinContainer.mc.chocobox2.type_fish.onRelease = function () {
if (!owner.isPaused) {
if (this._name == owner.preferred_chocolate1) {
owner.preferred_chocolate1 = owner.preferred_chocolate2;
owner.preferred_chocolate2 = null;
owner.salesGirl.chocolateCount--;
owner.girlwalkframe = owner.girlwalkframe / 2;
owner.salesGirl.girlwalk.gotoAndStop(owner.girlwalkframe);
owner.salesGirl.girlwalk.chocobox1.gotoAndStop(owner.preferred_chocolate1);
owner.salesGirl.girlwalk.chocobox2.gotoAndStop(owner.preferred_chocolate2);
} else {
owner.preferred_chocolate2 = null;
owner.salesGirl.chocolateCount--;
owner.girlwalkframe = owner.girlwalkframe / 2;
owner.salesGirl.girlwalk.gotoAndStop(owner.girlwalkframe);
owner.salesGirl.girlwalk.chocobox1.gotoAndStop(owner.preferred_chocolate1);
owner.salesGirl.girlwalk.chocobox2.gotoAndStop(owner.preferred_chocolate2);
}
owner.dusbinStatus = "ready";
owner.dusbinContainer._visible = false;
owner.isPopup = false;
owner.keyTarget = "dusbin";
owner.setGreenHighLight();
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
})))))))));
dusbinContainer.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.dusbinStatus = "ready";
owner.dusbinContainer._visible = false;
owner.isPopup = false;
owner.keyTarget = "dusbin";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
reportMc.mc.btn_continue.onRelease = function () {
owner.Reset();
_global.calenderfrom = "game";
owner._parent.gotoAndStop("calender");
};
reportMc.mc.btn_menu.onRelease = function () {
owner.Reset();
owner._parent.gotoAndStop("mainmenu");
};
reportMc.mc.btn_retry.onRelease = function () {
owner.Reset();
owner._parent.play();
};
popup_mc.btn_ok.onRelease = function () {
if (owner.popup_info == "welcome") {
owner.btn_pause._visible = true;
owner.popupDisable();
var _local1 = owner.getRandom(0, 2);
owner.customerEnterInterval = setInterval(owner.CallCustomer, 2000, owner, owner.lobbyArr[_local1], "oldlady");
owner.isPopup = false;
owner.popup_info = "level2_start";
owner.bg.gotoAndStop(2);
owner.shopopenClip._visible = true;
owner.shopopenClip.gotoAndPlay(1);
owner.ismoveready = true;
owner.machineStatus = "ready";
owner.machine2Status = "ready";
owner.special_machineStatus = "ready";
owner.dusbinStatus = "ready";
owner.coffeeStatus = "ready";
owner.timerClip._visible = true;
clearInterval(owner.gameInterval);
owner.gametimer = 0;
owner.gameInterval = setInterval(owner.GameTimeLimit, 658, owner);
owner.phone_mc.gotoAndStop(2);
owner.phone_mc.ring.gotoAndStop(1);
} else if (owner.popup_info == "order") {
owner.popupDisable();
owner.isPopup = false;
owner.popup_info = "";
owner.selectClip._visible = true;
owner.selectClip._x = owner.choco_machines._x;
owner.selectClip._y = owner.choco_machines._y - 80;
} else if (owner.popup_info == "mismatch") {
owner.popupDisable();
owner.isPopup = false;
}
};
}
function shopperMovement() {
var _local3 = (salesGirl._x + salesGirl.pointer._x) - targetclip._x;
var _local2 = (salesGirl._y + salesGirl.pointer._y) - targetclip._y;
var _local5 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
var _local4 = 10;
if (_local5 >= _local4) {
salesGirl._x = salesGirl._x + (Math.cos(radian) * girlspeed);
salesGirl._y = salesGirl._y + (Math.sin(radian) * girlspeed);
} else if (!isTargetReached) {
isTargetReached = true;
salesGirl.gotoAndStop(targetDirection);
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
Manipulate();
updateScore();
}
}
function GameStart(_arg2) {
clearInterval(_arg2.gamestartInterval);
_arg2.isPopup = true;
_global.popupText = "Select the PHONE to answer a call. Take the order of the client and prepare it. A delivery boy will pick it up later.";
_arg2.ShowPopup(_arg2);
}
function calculateAngle(mc) {
if (!isPopup) {
targetclip = mc;
var x_diff = (eval (mc)._x - (salesGirl._x + salesGirl.pointer._x));
var y_diff = (eval (mc)._y - (salesGirl._y + salesGirl.pointer._y));
radian = Math.atan2(y_diff, x_diff);
if (Math.abs(x_diff) > Math.abs(y_diff)) {
if (x_diff > 0) {
targetDirection = "right";
} else {
targetDirection = "left";
}
} else if (y_diff > 0) {
targetDirection = "down";
} else {
targetDirection = "up";
}
if (curtarget != selectedTarget) {
curtarget = selectedTarget;
salesGirl.gotoAndStop(targetDirection);
salesGirl.girlwalk.gotoAndStop(girlwalkframe - 1);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
}
}
}
function ShowPopup(_arg1) {
clearInterval(_arg1.popup_interval);
_arg1.isPopup = true;
_arg1.popup_mc._visible = true;
_arg1.popup_mc.swapDepths(_arg1.getNextHighestDepth());
_arg1.popup_mc.gotoAndPlay(1);
}
function popupDisable() {
popup_mc.gotoAndStop(1);
popup_mc._visible = false;
}
function CallNewCustomer(_arg2) {
if (!_arg2.isGameOver) {
if (_arg2.table4._visible) {
var _local1 = 0;
while (_local1 < _arg2.lobbyArr.length) {
if (_arg2.lobbyArr[_local1] == 1) {
_arg2.lobbyArr.splice(_local1, 1);
}
_local1++;
}
}
if ((_arg2.customerCount != 0) && (_arg2.moneyCount != 0)) {
_arg2.CallNextCustomerSet();
}
} else {
clearInterval(_arg2.Re_customerEnterInterval);
}
}
function CallCustomer(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.customerEnterInterval);
if (!_arg1.isGameOver) {
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function CallCustomer2(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.customerEnterInterval2);
if (!_arg1.isGameOver) {
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function CallCustomer3(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.customerEnterInterval3);
if (!_arg1.isGameOver) {
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function Re_CallCustomer(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.Re_customerEnterInterval);
if (!_arg1.isGameOver) {
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function customerEnter(_arg5, _arg4) {
if (!isGameOver) {
if (_arg4 == "phoneorder") {
isphonecalled = true;
ringstat = "onn";
phone_mc._visible = true;
table4._visible = true;
customer4 = phone_mc;
phone_mc.ring._visible = true;
phone_mc.ring.gotoAndPlay(2);
orderbook4 = attachMovie("orderbook", "orderbook4", getNextHighestDepth(), {_x:170, _y:400});
orderbook4._visible = false;
orderbook4.type = "phone";
customer4.type = _arg4;
orderbook4.heatcnt = 0;
orderbook4.heatInterval = setInterval(HeatFunction, 500, orderbook4, this, 4);
phoneringcnt = 0;
phoneInterval = setInterval(HidePhoneOrder, 1000, this);
if (_global.soundstat == "onn") {
_root.phonering_Sound.start();
}
} else if (_arg5 == 1) {
table1._visible = true;
customer1 = attachMovie(_arg4, "customer1", depthArr[_arg5 - 1], {_x:115, _y:356});
orderbook1 = attachMovie("orderbook", "orderbook1", getNextHighestDepth(), {_x:170, _y:374});
orderbook1.type = "book";
customer1.type = _arg4;
orderbook1.heatcnt = 0;
if (_arg4 == "oldlady") {
orderbook1.heatInterval = setInterval(HeatFunction, 400, orderbook1, this, 1);
} else if (_arg4 == "younglady") {
orderbook1.heatInterval = setInterval(HeatFunction, 200, orderbook1, this, 1);
}
} else if (_arg5 == 2) {
table2._visible = true;
customer2 = attachMovie(_arg4, "customer2", depthArr[_arg5 - 1], {_x:119, _y:235});
orderbook2 = attachMovie("orderbook", "orderbook2", getNextHighestDepth(), {_x:177, _y:278});
orderbook2.type = "book";
customer2.type = _arg4;
orderbook2.heatcnt = 0;
if (_arg4 == "oldlady") {
orderbook2.heatInterval = setInterval(HeatFunction, 400, orderbook2, this, 2);
} else if (_arg4 == "younglady") {
orderbook2.heatInterval = setInterval(HeatFunction, 200, orderbook2, this, 2);
}
} else if (_arg5 == 3) {
table3._visible = true;
customer3 = attachMovie(_arg4, "customer3", depthArr[_arg5 - 1], {_x:127, _y:140});
orderbook3 = attachMovie("orderbook", "orderbook3", getNextHighestDepth(), {_x:184, _y:185});
orderbook3.type = "book";
customer3.type = _arg4;
orderbook3.heatcnt = 0;
if (_arg4 == "oldlady") {
orderbook3.heatInterval = setInterval(HeatFunction, 400, orderbook3, this, 3);
} else if (_arg4 == "younglady") {
orderbook3.heatInterval = setInterval(HeatFunction, 200, orderbook3, this, 3);
}
}
customerCount++;
moneyCount++;
orderTaken++;
salesGirl.swapDepths(getNextHighestDepth());
scoreIndicateClip.swapDepths(getNextHighestDepth());
expertScoreClip.swapDepths(getNextHighestDepth());
chocolate_container.swapDepths(getNextHighestDepth());
special_chocolate_container.swapDepths(getNextHighestDepth());
dusbinContainer.swapDepths(getNextHighestDepth());
comboClip.swapDepths(getNextHighestDepth());
reportMc.swapDepths(getNextHighestDepth());
}
}
function HidePhoneOrder(owner) {
if (!owner.isPaused) {
owner.phoneringcnt++;
if (owner.phoneringcnt >= 20) {
clearInterval(owner.phoneInterval);
clearInterval(owner.orderbook4.heatInterval);
owner.moneyCount--;
owner.customerCount--;
owner.orderbook4._visible = false;
owner.table4._visible = false;
owner.orderbook4.type = "empty";
owner.ringstat = "off";
owner.phone_mc.ring.gotoAndStop(1);
_root.phonering_Sound.stop();
if ((owner.customerCount == 0) && (owner.moneyCount == 0)) {
if (!owner.isGameOver) {
owner.CallNextCustomerSet();
} else {
owner.callResult();
}
}
}
}
}
function Manipulate() {
var owner = this;
if (selectedTarget == "coffee_machine") {
coffee_machine.pointer._visible = false;
if (coffee_machine.status == "empty") {
coffee_machine.status = "prepared";
coffeeClip._visible = true;
coffeeClip.gotoAndPlay(2);
owner.isTargetReached = true;
owner.coffee_preparecnt = 0;
owner.coffee_process_interval = setInterval(owner.CoffeeIdleProcess, 100, owner);
owner.isPopup = false;
owner.coffeemachineshake = "onn";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
} else if (coffee_machine.status == "coffeeReady") {
coffeeClip._visible = false;
coffee_machine.status = "empty";
salesGirl.coffeeicon._visible = false;
girlspeed = 12;
orderTaken = 0;
salesGirl.gotoAndStop(2);
if (salesGirl.chocolateCount == 0) {
girlwalkframe = 9;
} else if (salesGirl.chocolateCount == 1) {
girlwalkframe = 10;
} else if (salesGirl.chocolateCount == 2) {
girlwalkframe = 11;
}
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.jumpLady.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.jumpLady.chocobox2.gotoAndStop(preferred_chocolate2);
owner.machineStatus = "notready";
owner.special_machineStatus = "notready";
owner.dusbinStatus = "notready";
owner.coffeeStatus = "notready";
owner.isPopup = true;
jumpInterval = setInterval(JumpFinished, 1100, this);
}
} else if (selectedTarget == "choco_machines") {
choco_machines.pointer._visible = false;
if (choco_machines.status == "empty") {
if (owner.salesGirl.chocolateCount < 3) {
chocolate_container._visible = true;
chocolate_container.gotoAndStop(1);
chocolate_container.mc.gotoAndPlay(1);
machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
keyTarget = "type_round";
}
} else if (choco_machines.status == "chocolateReady") {
if (owner.salesGirl.chocolateCount < 2) {
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = owner.preferred_box_chocolate;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = owner.preferred_box_chocolate;
}
owner.salesGirl.chocolateCount++;
chocolateClip._visible = false;
salesGirl.gotoAndStop(2);
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
choco_machines.status = "empty";
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
if (orderbook1.book_mc._currentframe == 74) {
orderbook1.green_highlight._visible = true;
}
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
if (orderbook2.book_mc._currentframe == 74) {
orderbook2.green_highlight._visible = true;
}
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
if (orderbook3.book_mc._currentframe == 74) {
orderbook3.green_highlight._visible = true;
}
}
if ((orderbook4.neededchocolate == preferred_chocolate1) || (orderbook4.neededchocolate == preferred_chocolate2)) {
if (orderbook4.book_mc._currentframe == 74) {
orderbook4.green_highlight._visible = true;
}
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (selectedTarget == "choco_machines2") {
choco_machines2.pointer._visible = false;
if (choco_machines2.status == "empty") {
if (owner.salesGirl.chocolateCount < 3) {
chocolate_container._visible = true;
chocolate_container.gotoAndStop(1);
chocolate_container.mc.gotoAndPlay(1);
machine2Status = "notready";
dusbinStatus = "notready";
isPopup = true;
keyTarget = "type_round";
}
} else if (choco_machines2.status == "chocolateReady") {
if (owner.salesGirl.chocolateCount < 2) {
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = owner.preferred_box2_chocolate;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = owner.preferred_box2_chocolate;
}
owner.salesGirl.chocolateCount++;
chocolateClip2._visible = false;
salesGirl.gotoAndStop(2);
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
choco_machines2.status = "empty";
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
}
if ((orderbook4.neededchocolate == preferred_chocolate1) || (orderbook4.neededchocolate == preferred_chocolate2)) {
orderbook4.green_highlight._visible = true;
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (selectedTarget == "special_choco_machines") {
special_choco_machines.pointer._visible = false;
if (special_choco_machines.status == "empty") {
if (owner.salesGirl.chocolateCount < 3) {
special_chocolate_container._visible = true;
special_chocolate_container.gotoAndStop(1);
special_chocolate_container.mc.gotoAndPlay(1);
special_machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
keyTarget = "type_rabbit";
}
} else if (special_choco_machines.status == "chocolateReady") {
if (owner.salesGirl.chocolateCount < 2) {
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = owner.preferred_special_chocolate;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = owner.preferred_special_chocolate;
}
owner.salesGirl.chocolateCount++;
specialChocolateClip._visible = false;
salesGirl.gotoAndStop(2);
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
special_choco_machines.status = "empty";
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
}
if ((orderbook4.neededchocolate == preferred_chocolate1) || (orderbook4.neededchocolate == preferred_chocolate2)) {
orderbook4.green_highlight._visible = true;
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (selectedTarget == "dusbin") {
dusbin.pointer._visible = false;
if (salesGirl.chocolateCount == 1) {
salesGirl.chocolateCount--;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
preferred_chocolate1 = null;
preferred_chocolate2 = null;
owner.setGreenHighLight();
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
} else if (salesGirl.chocolateCount >= 2) {
dusbinStatus = "notready";
isPopup = true;
_global.preferred_chocolate1 = preferred_chocolate1;
_global.preferred_chocolate2 = preferred_chocolate2;
keyTarget = _global.preferred_chocolate1;
dusbinContainer._visible = true;
dusbinContainer.gotoAndStop(1);
dusbinContainer.mc.gotoAndPlay(1);
}
} else if ((((selectedTarget == "table1") || (selectedTarget == "table2")) || (selectedTarget == "table3")) || (selectedTarget == "table4")) {
eval ("this.orderbook" + selectedTable).pointer._visible = false;
if (eval ("this.orderbook" + selectedTable).type == "phone") {
isphonecalled = true;
_root.phonering_Sound.stop();
clearInterval(phoneInterval);
combo_bookcnt++;
combo_ordercnt = 0;
combo_moneycnt = 0;
ringstat = "off";
phone_mc.ring.gotoAndStop(1);
eval ("this.orderbook" + selectedTable).type = "chocolateOrder";
var randomno = owner.getRandom(0, 4);
eval ("this.orderbook" + selectedTable)._visible = true;
eval ("this.orderbook" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.customer" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.orderbook" + selectedTable).gotoAndStop(2);
eval ("this.customer" + selectedTable).gotoAndStop(2);
eval ("this.orderbook" + selectedTable).green_highlight._visible = false;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
var heatcntchange = int(eval ("this.orderbook" + selectedTable).heatcnt / 4);
if (heatcntchange > 1) {
eval ("this.orderbook" + selectedTable).heatcnt = heatcntchange;
} else {
eval ("this.orderbook" + selectedTable).heatcnt = 1;
}
CheckForBookCombo();
} else if (eval ("this.orderbook" + selectedTable).type == "book") {
combo_bookcnt++;
combo_ordercnt = 0;
combo_moneycnt = 0;
eval ("this.orderbook" + selectedTable).type = "chocolateOrder";
var randomno = owner.getRandom(0, 4);
eval ("this.orderbook" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.customer" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.orderbook" + selectedTable).gotoAndStop(2);
eval ("this.customer" + selectedTable).gotoAndStop(3);
eval ("this.orderbook" + selectedTable).green_highlight._visible = false;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
var heatcntchange = int(eval ("this.orderbook" + selectedTable).heatcnt / 4);
if (heatcntchange > 1) {
eval ("this.orderbook" + selectedTable).heatcnt = heatcntchange;
} else {
eval ("this.orderbook" + selectedTable).heatcnt = 1;
}
CheckForBookCombo();
} else if (eval ("this.orderbook" + selectedTable).type == "chocolateOrder") {
if ((salesGirl.chocolateCount >= 1) && (eval ("this.orderbook" + selectedTable).book_mc._currentframe >= 74)) {
combo_bookcnt = 0;
combo_moneycnt = 0;
if (eval ("owner.customer" + owner.selectedTable).neededchocolate == owner.preferred_chocolate1) {
combo_ordercnt++;
preferred_chocolate1 = preferred_chocolate2;
preferred_chocolate2 = null;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
if (selectedTarget == "table4") {
orderbook4.type = "none";
orderbook4.temp_box._visible = false;
orderbook4.green_highlight._visible = false;
orderbook4.highlight._visible = false;
orderbook4.timelimit._visible = false;
phone_mc.swapDepths(getNextHighestDepth());
scoreIndicateClip.swapDepths(getNextHighestDepth());
expertScoreClip.swapDepths(getNextHighestDepth());
reportMc.swapDepths(getNextHighestDepth());
deliveryboy._visible = true;
deliveryboy.gotoAndPlay(2);
clearInterval(deliveryinterval);
deliveryinterval = setInterval(callDeliveryBoy, 1500, this);
} else {
eval ("this.orderbook" + selectedTable).type = "money";
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable).gotoAndStop(3);
eval ("this.customer" + selectedTable).gotoAndStop(5);
if ((eval ("this.orderbook" + selectedTable).heatcnt > 60) && (eval ("this.orderbook" + selectedTable).heatcnt <= 100)) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(2);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
} else if (eval ("this.orderbook" + selectedTable).heatcnt > 100) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(3);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
eval ("this.orderbook" + selectedTable).highlight_small._visible = false;
}
if (_global.soundstat == "onn") {
_root.customer_happy_Sound.start();
}
if (!isGameOver) {
if (table4._visible) {
var i = 0;
while (i < lobbyArr.length) {
if (lobbyArr[i] == 1) {
lobbyArr.splice(i, 1);
}
i++;
}
}
CallNextCustomerSet();
}
}
clearInterval(eval ("this.orderbook" + selectedTable).heatInterval);
CheckForOrderCombo();
customerCount--;
if (salesGirl.chocolateCount == 1) {
preferred_chocolate1 = null;
}
salesGirl.chocolateCount--;
owner.setGreenHighLight();
} else if (eval ("owner.customer" + owner.selectedTable).neededchocolate == owner.preferred_chocolate2) {
combo_ordercnt++;
salesGirl.chocolateCount--;
preferred_chocolate2 = null;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
if (selectedTarget == "table4") {
orderbook4.type = "none";
orderbook4.temp_box._visible = false;
orderbook4.green_highlight._visible = false;
orderbook4.highlight._visible = false;
orderbook4.timelimit._visible = false;
phone_mc.swapDepths(getNextHighestDepth());
scoreIndicateClip.swapDepths(getNextHighestDepth());
expertScoreClip.swapDepths(getNextHighestDepth());
reportMc.swapDepths(getNextHighestDepth());
deliveryboy._visible = true;
deliveryboy.gotoAndPlay(2);
clearInterval(deliveryinterval);
deliveryinterval = setInterval(callDeliveryBoy, 1500, this);
} else {
eval ("this.orderbook" + selectedTable).type = "money";
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable).gotoAndStop(3);
eval ("this.customer" + selectedTable).gotoAndStop(5);
if ((eval ("this.orderbook" + selectedTable).heatcnt > 60) && (eval ("this.orderbook" + selectedTable).heatcnt <= 100)) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(2);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
} else if (eval ("this.orderbook" + selectedTable).heatcnt > 100) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(3);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
eval ("this.orderbook" + selectedTable).highlight_small._visible = false;
}
if (_global.soundstat == "onn") {
_root.customer_happy_Sound.start();
}
if (!isGameOver) {
if (table4._visible) {
var i = 0;
while (i < lobbyArr.length) {
if (lobbyArr[i] == 1) {
lobbyArr.splice(i, 1);
}
i++;
}
}
CallNextCustomerSet();
}
}
clearInterval(eval ("this.orderbook" + selectedTable).heatInterval);
CheckForOrderCombo();
customerCount--;
owner.setGreenHighLight();
}
}
} else if (eval ("this.orderbook" + selectedTable).type == "money") {
combo_bookcnt = 0;
combo_ordercnt = 0;
combo_moneycnt++;
moneyCount--;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(2);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable)._visible = false;
eval ("this.table" + selectedTable)._visible = false;
eval ("this.orderbook" + selectedTable).type = "empty";
if (owner.selectedTarget != "table4") {
eval ("this.customer" + selectedTable)._visible = false;
}
CheckForMoneyCombo();
if (orderTaken >= 6) {
salesGirl.coffeeicon._visible = true;
girlspeed = 6;
}
if (selectedTable != 4) {
lobbyArr.push(selectedTable);
} else if (table1._visible == false) {
lobbyArr.push(1);
}
if ((customerCount == 0) && (moneyCount == 0)) {
if (!isGameOver) {
customerCount = 0;
moneyCount = 0;
owner.table2._visible = (owner.table3._visible = false);
owner.table1._visible = false;
CallNextCustomerSet();
} else {
callResult();
}
} else if (isGameOver) {
if ((((table1._visible == false) && (table2._visible == false)) && (table3._visible == false)) && (table4._visible == false)) {
callResult();
}
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
}
function CallNextCustomerSet() {
var _local2 = this;
if (lobbyArr.length >= 1) {
if (lobbyArr.length == 1) {
if (((!isphonecalled) && (table4._visible == false)) && (table1._visible == false)) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
clearInterval(_local2.customerEnterInterval2);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 2000, _local2, _local2.lobbyArr[_local3], "phoneorder");
} else {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 1000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
}
} else if (lobbyArr.length == 2) {
re_entry = "onn";
if (((!isphonecalled) && (table4._visible == false)) && (table1._visible == false)) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local4 = Math.ceil((Math.random() * 3) - 1);
if (_local2.lobbyArr[0] == 1) {
_local3 = 1;
} else if (_local2.lobbyArr[1] == 1) {
_local3 = 0;
}
clearInterval(_local2.customerEnterInterval);
trace("lobbyphone 2,1=" + _local2.lobbyArr[_local3]);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 1000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
clearInterval(_local2.customerEnterInterval2);
trace("lobbyphone 2,2=" + _local2.lobbyArr[_local3]);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 2000, _local2, _local2.lobbyArr[_local3], "phoneorder");
} else {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval);
trace("lobby2,1=" + _local2.lobbyArr[_local3]);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 100, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval2);
trace("lobby2,2=" + _local2.lobbyArr[_local3]);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 2000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
}
} else if (lobbyArr.length == 3) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval);
trace("lobby3,1=" + _local2.lobbyArr[_local3]);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 1000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval2);
trace("lobby3,2=" + _local2.lobbyArr[_local3]);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 2000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval3);
trace("lobby3,3=" + _local2.lobbyArr[_local3]);
_local2.customerEnterInterval3 = setInterval(_local2.CallCustomer3, 4000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
}
}
trace("after nextcus=" + lobbyArr);
}
function callDeliveryBoy(owner) {
clearInterval(owner.deliveryinterval);
owner.orderbook4.type = "money";
owner.coin_Anim4._visible = true;
owner.coin_Anim4.gotoAndStop(1);
owner.coin_Anim4.coin.gotoAndPlay(1);
owner.orderbook4.gotoAndStop(3);
if ((owner.orderbook4.heatcnt > 60) && (owner.orderbook4.heatcnt <= 100)) {
owner.orderbook4.money_mc.gotoAndStop(2);
owner.orderbook4.highlight._visible = false;
} else if (owner.orderbook4.heatcnt > 100) {
owner.orderbook4.money_mc.gotoAndStop(3);
owner.orderbook4.highlight._visible = false;
owner.orderbook4.highlight_small._visible = false;
}
if (!owner.isGameOver) {
if (owner.table4._visible) {
var i = 0;
while (i < owner.lobbyArr.length) {
if (owner.lobbyArr[i] == 1) {
owner.lobbyArr.splice(i, 1);
}
i++;
}
}
owner.CallNextCustomerSet();
}
}
function JumpFinished(_arg1) {
clearInterval(_arg1.jumpInterval);
_arg1.machineStatus = "ready";
_arg1.special_machineStatus = "ready";
_arg1.dusbinStatus = "ready";
_arg1.coffeeStatus = "ready";
_arg1.isPopup = false;
_arg1.sequenceArr.splice(0, 1);
if (_arg1.sequenceArr.length >= 1) {
_arg1.CallSequence();
}
}
function setGreenHighLight() {
if (orderbook1.book_mc._currentframe >= 74) {
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
} else {
orderbook1.green_highlight._visible = false;
}
}
if (orderbook2.book_mc._currentframe >= 74) {
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
} else {
orderbook2.green_highlight._visible = false;
}
}
if (orderbook3.book_mc._currentframe >= 74) {
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
} else {
orderbook3.green_highlight._visible = false;
}
}
if (orderbook4.book_mc._currentframe >= 74) {
if ((orderbook4.neededchocolate == preferred_chocolate1) || (orderbook4.neededchocolate == preferred_chocolate2)) {
orderbook4.green_highlight._visible = true;
} else {
orderbook4.green_highlight._visible = false;
}
}
}
function callResult() {
clearInterval(customerEnterInterval);
clearInterval(customerEnterInterval2);
clearInterval(customerEnterInterval3);
clearInterval(Re_customerEnterInterval);
clearInterval(reportInterval);
clearInterval(orderbook1.heatInterval);
clearInterval(orderbook2.heatInterval);
clearInterval(orderbook3.heatInterval);
clearInterval(orderbook4.heatInterval);
clearInterval(deliveryinterval);
clearInterval(jumpInterval);
clearInterval(phoneInterval);
machineStatus = "notready";
special_machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
_global.report_moneyEarned = score;
_global.report_tips = tips;
_global.targetScore = 400;
_global.expertScore = 880;
btn_pause._visible = false;
dusbinStatus = "notready";
score = score + tips;
if (score < 400) {
reportMc._visible = true;
reportMc.gotoAndStop(2);
reportMc.mc.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.level_failed_Sound.start();
}
} else {
if (_global.soundstat == "onn") {
_root.level_complete_Sound.start();
}
if (_global.levelSelected < 10) {
_global.levelSelected = 10;
}
if (_global.levelFinished <= 9) {
_global.levelFinished = 9;
}
if (score >= 880) {
_global.level9Status = "expert";
} else {
_global.level9Status = "target";
}
_global.level9Score = score;
if (((score >= 400) && (scoreClip.target._currentframe == 1)) || ((score >= 880) && (scoreClip.expert._currentframe == 1))) {
reportInterval = setInterval(CallReport, 2300, this);
} else {
reportMc._visible = true;
reportMc.gotoAndStop(1);
reportMc.mc.gotoAndPlay(2);
}
}
}
function CallReport(_arg1) {
clearInterval(_arg1.reportInterval);
_arg1.reportMc._visible = true;
_arg1.reportMc.gotoAndStop(1);
_arg1.reportMc.mc.gotoAndPlay(2);
}
function HeatFunction(owner, myparent, curpoint) {
if (!myparent.isPaused) {
owner.heatcnt++;
owner.timelimit.gotoAndStop(owner.heatcnt);
if (owner.heatcnt == 100) {
eval ("myparent.customer" + curpoint).gotoAndStop(4);
}
if (owner.heatcnt >= 120) {
clearInterval(owner.heatInterval);
myparent.moneyCount--;
myparent.customerCount--;
eval ("myparent.orderbook" + curpoint)._visible = false;
eval ("myparent.table" + curpoint)._visible = false;
if (eval ("myparent.customer" + curpoint).type == "oldlady") {
eval ("myparent.customer" + curpoint).gotoAndStop(6);
if (myparent.score > 0) {
myparent.curScoreClip._visible = true;
myparent.curScoreClip.gotoAndPlay(1);
if ((myparent.score >= 2) && (myparent.score < 10)) {
myparent.score = myparent.score - 2;
myparent.curScoreClip.disp.score.text = -2;
} else if (myparent.score >= 10) {
myparent.score = myparent.score - 10;
myparent.curScoreClip.disp.score.text = -10;
}
myparent.scoreClip.score_txt.text = myparent.score;
myparent.scoreClip.loading.gotoAndStop(myparent.score);
}
} else if (eval ("myparent.customer" + curpoint).type == "younglady") {
eval ("myparent.customer" + curpoint).gotoAndStop(6);
if (myparent.score > 0) {
myparent.curScoreClip._visible = true;
myparent.curScoreClip.gotoAndPlay(1);
if ((myparent.score >= 2) && (myparent.score < 15)) {
myparent.score = myparent.score - 2;
myparent.curScoreClip.disp.score.text = -2;
} else if (myparent.score >= 15) {
myparent.score = myparent.score - 15;
myparent.curScoreClip.disp.score.text = -15;
}
myparent.scoreClip.score_txt.text = myparent.score;
myparent.scoreClip.loading.gotoAndStop(myparent.score);
}
}
eval ("myparent.orderbook" + curpoint).type = "empty";
myparent.lobbyArr.push(curpoint);
if ((myparent.customerCount == 0) && (myparent.moneyCount == 0)) {
if (!myparent.isGameOver) {
myparent.CallNextCustomerSet();
} else {
myparent.callResult();
}
}
}
}
}
function GameTimeLimit(_arg1) {
if (!_arg1.isPaused) {
_arg1.gametimer++;
_arg1.timerClip.gotoAndStop(_arg1.gametimer);
if (_arg1.gametimer >= 90) {
_arg1.isGameOver = true;
_arg1.bg.gotoAndStop(1);
_arg1.shopclosedClip._visible = true;
_arg1.shopclosedClip.gotoAndPlay(1);
_arg1.gametimer = 0;
clearInterval(_arg1.gameInterval);
}
}
}
function CheckForBookCombo() {
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_bookcnt >= 2) {
comboClip._x = eval ("this.customer" + selectedTable)._x - 20;
comboClip._y = eval ("this.customer" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_bookcnt);
comboClip.combo.gotoAndPlay(1);
score = score + 4;
curScoreClip.disp.score.text = 4;
tips = tips + 4;
} else {
score = score + 2;
curScoreClip.disp.score.text = 2;
tips = tips + 2;
}
if (_global.soundstat == "onn") {
eval (("_root.combo" + combo_bookcnt) + "_Sound").start();
}
}
function CheckForOrderCombo() {
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_ordercnt >= 2) {
comboClip._x = eval ("this.customer" + selectedTable)._x - 20;
comboClip._y = eval ("this.customer" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_ordercnt);
comboClip.combo.gotoAndPlay(1);
score = score + 20;
curScoreClip.disp.score.text = 20;
} else {
score = score + 10;
curScoreClip.disp.score.text = 10;
}
if (_global.soundstat == "onn") {
eval (("_root.combo" + combo_ordercnt) + "_Sound").start();
}
}
function CheckForMoneyCombo() {
if (_global.soundstat == "onn") {
eval (("_root.money" + combo_moneycnt) + "_Sound").start();
}
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_moneycnt >= 2) {
comboClip._x = eval ("this.orderbook" + selectedTable)._x - 20;
comboClip._y = eval ("this.orderbook" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_moneycnt);
comboClip.combo.gotoAndPlay(1);
if (eval ("this.orderbook" + selectedTable).neededchocolate == "type_rabbit") {
score = score + (combo_moneycnt * 30);
curScoreClip.disp.score.text = combo_moneycnt * 30;
} else if (eval ("this.customer" + selectedTable).type == "oldlady") {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + (combo_moneycnt * 17);
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + (combo_moneycnt * 14);
curScoreClip.disp.score.text = combo_moneycnt * 14;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + (combo_moneycnt * 11);
curScoreClip.disp.score.text = combo_moneycnt * 11;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + (combo_moneycnt * 10);
curScoreClip.disp.score.text = combo_moneycnt * 10;
}
} else {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + (combo_moneycnt * 24);
curScoreClip.disp.score.text = combo_moneycnt * 24;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + (combo_moneycnt * 21);
curScoreClip.disp.score.text = combo_moneycnt * 21;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + (combo_moneycnt * 17);
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + (combo_moneycnt * 15);
curScoreClip.disp.score.text = combo_moneycnt * 15;
}
}
if (!isGameOver) {
if (table4._visible) {
var i = 0;
while (i < lobbyArr.length) {
if (lobbyArr[i] == 1) {
lobbyArr.splice(i, 1);
}
i++;
}
}
CallNextCustomerSet();
}
} else if (eval ("this.customer" + selectedTable).type == "oldlady") {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + 17;
curScoreClip.disp.score.text = 17;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + 14;
curScoreClip.disp.score.text = 14;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + 11;
curScoreClip.disp.score.text = 11;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + 10;
curScoreClip.disp.score.text = 10;
}
} else {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + 24;
curScoreClip.disp.score.text = combo_moneycnt * 24;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + 21;
curScoreClip.disp.score.text = combo_moneycnt * 21;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + 17;
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + 15;
curScoreClip.disp.score.text = combo_moneycnt * 15;
}
}
}
function IdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.preparecnt++;
if (_arg3.preparecnt >= 20) {
clearInterval(_arg3.process_interval);
_arg3.machineStatus = "ready";
_arg3.machineshake = "off";
if (_arg3.choco_machines.status == "prepared") {
_arg3.choco_machines.status = "chocolateReady";
}
if (_global.soundstat == "onn") {
_root.choco_done_Sound.start();
}
}
}
}
function IdleProcess2(_arg3) {
if (!_arg3.isPaused) {
_arg3.prepare2cnt++;
if (_arg3.prepare2cnt >= 20) {
clearInterval(_arg3.process_interval2);
_arg3.machine2Status = "ready";
_arg3.machine2shake = "off";
if (_arg3.choco_machines2.status == "prepared") {
_arg3.choco_machines2.status = "chocolateReady";
}
if (_global.soundstat == "onn") {
_root.choco_done_Sound.start();
}
}
}
}
function SpecialIdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.spl_preparecnt++;
if (_arg3.spl_preparecnt >= 40) {
clearInterval(_arg3.special_process_interval);
_arg3.special_machineStatus = "ready";
_arg3.specialmachineshake = "off";
if (_arg3.special_choco_machines.status == "prepared") {
_arg3.special_choco_machines.status = "chocolateReady";
}
if (_global.soundstat == "onn") {
_root.choco_done_Sound.start();
}
}
}
}
function CoffeeIdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.coffee_preparecnt++;
if (_arg3.coffee_preparecnt >= 20) {
clearInterval(_arg3.coffee_process_interval);
_arg3.coffeeStatus = "ready";
_arg3.coffeemachineshake = "off";
_arg3.coffee_machine.status = "coffeeReady";
if (_global.soundstat == "onn") {
_root.hotchoco_done_Sound.start();
}
}
}
}
function getRandom(_arg4, _arg5) {
var _local3 = _arg5 - _arg4;
var _local2 = Math.random() * _local3;
var _local1 = Math.round(_local2);
_local1 = _local1 + _arg4;
return(_local1);
}
function StoreInSequence() {
var owner = this;
eval ("this." + moveTarget).onRelease();
}
function CallSequence() {
var owner = this;
if (sequenceArr[0] == choco_machines) {
if (((owner.isTargetReached && (owner.machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines";
owner.calculateAngle(owner.chomac_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == choco_machines2) {
if (((owner.isTargetReached && (owner.machine2Status == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines2";
owner.calculateAngle(owner.chomac_indicate2);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == special_choco_machines) {
if (((owner.isTargetReached && (owner.special_machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "special_choco_machines";
owner.calculateAngle(owner.splmn_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == dusbin) {
if ((owner.isTargetReached && (owner.dusbinStatus == "ready")) && (!owner.isPaused)) {
owner.isTargetReached = false;
owner.selectedTarget = "dusbin";
owner.calculateAngle(owner.dusbin_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == coffee_machine) {
if (((owner.isTargetReached && (!owner.isPaused)) && (owner.coffeeStatus == "ready")) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "coffee_machine";
owner.calculateAngle(owner.coffee_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if ((((sequenceArr[0] == table1) || (sequenceArr[0] == table2)) || (sequenceArr[0] == table3)) || (sequenceArr[0] == table4)) {
if ((owner.isTargetReached && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = sequenceArr[0]._name;
owner.calculateAngle(sequenceArr[0]);
if (owner.selectedTarget == "table1") {
owner.selectedTable = 1;
} else if (owner.selectedTarget == "table2") {
owner.selectedTable = 2;
} else if (owner.selectedTarget == "table3") {
owner.selectedTable = 3;
} else if (owner.selectedTarget == "table4") {
owner.selectedTable = 4;
}
eval ("owner.orderbook" + owner.selectedTable).pointer._visible = true;
}
}
}
function CallPause() {
var _local3 = this;
stopAllSounds();
_local3.bg.blink.gotoAndStop(_local3.bg.blink._currentframe);
_local3.customer1.customer.gotoAndStop(_local3.customer1.customer._currentframe);
_local3.customer2.customer.gotoAndStop(_local3.customer2.customer._currentframe);
_local3.customer3.customer.gotoAndStop(_local3.customer3.customer._currentframe);
_local3.special_choco_machines.machine1.blink.gotoAndStop(_local3.special_choco_machines.machine1.blink._currentframe);
_local3.choco_machines.single_machine.blink.gotoAndStop(_local3.choco_machines.single_machine.blink._currentframe);
_local3.salesGirl.coffeeicon.smoke.gotoAndStop(_local3.salesGirl.coffeeicon.smoke._currentframe);
_local3.customer4.customer.gotoAndStop(_local3.customer4.customer._currentframe);
_local3.coin_Anim1.coin.gotoAndStop(_local3.coin_Anim1.coin._currentframe);
_local3.coin_Anim2.coin.gotoAndStop(_local3.coin_Anim2.coin._currentframe);
_local3.coin_Anim3.coin.gotoAndStop(_local3.coin_Anim3.coin._currentframe);
_local3.coin_Anim4.coin.gotoAndStop(_local3.coin_Anim4.coin._currentframe);
_local3.comboClip.combo.gotoAndStop(_local3.comboClip.combo._currentframe);
_local3.orderbook1.heartinClip.gotoAndStop(_local3.orderbook1.heartinClip._currentframe);
_local3.orderbook2.heartinClip.gotoAndStop(_local3.orderbook2.heartinClip._currentframe);
_local3.orderbook3.heartinClip.gotoAndStop(_local3.orderbook3.heartinClip._currentframe);
_local3.orderbook4.heartinClip.gotoAndStop(_local3.orderbook4.heartinClip._currentframe);
_local3.curScoreClip.gotoAndStop(_local3.curScoreClip._currentframe);
_local3.coin_Anim1.coin.coin_rotate.gotoAndStop(_local3.coin_Anim1.coin.coin_rotate._currentframe);
_local3.coin_Anim1.coin.coin_rotate2.gotoAndStop(_local3.coin_Anim1.coin.coin_rotate2._currentframe);
_local3.coin_Anim1.coin.coin_rotate3.gotoAndStop(_local3.coin_Anim1.coin.coin_rotate3._currentframe);
_local3.coin_Anim1.coin.coin_rotate4.gotoAndStop(_local3.coin_Anim1.coin.coin_rotate4._currentframe);
_local3.coin_Anim2.coin.coin_rotate.gotoAndStop(_local3.coin_Anim2.coin.coin_rotate._currentframe);
_local3.coin_Anim2.coin.coin_rotate2.gotoAndStop(_local3.coin_Anim2.coin.coin_rotate2._currentframe);
_local3.coin_Anim2.coin.coin_rotate3.gotoAndStop(_local3.coin_Anim2.coin.coin_rotate3._currentframe);
_local3.coin_Anim2.coin.coin_rotate4.gotoAndStop(_local3.coin_Anim2.coin.coin_rotate4._currentframe);
_local3.coin_Anim3.coin.coin_rotate.gotoAndStop(_local3.coin_Anim3.coin.coin_rotate._currentframe);
_local3.coin_Anim3.coin.coin_rotate2.gotoAndStop(_local3.coin_Anim3.coin.coin_rotate2._currentframe);
_local3.coin_Anim3.coin.coin_rotate3.gotoAndStop(_local3.coin_Anim3.coin.coin_rotate3._currentframe);
_local3.coin_Anim3.coin.coin_rotate4.gotoAndStop(_local3.coin_Anim3.coin.coin_rotate4._currentframe);
_local3.coin_Anim4.coin.coin_rotate.gotoAndStop(_local3.coin_Anim4.coin.coin_rotate._currentframe);
_local3.coin_Anim4.coin.coin_rotate2.gotoAndStop(_local3.coin_Anim4.coin.coin_rotate2._currentframe);
_local3.coin_Anim4.coin.coin_rotate3.gotoAndStop(_local3.coin_Anim4.coin.coin_rotate3._currentframe);
_local3.coin_Anim4.coin.coin_rotate4.gotoAndStop(_local3.coin_Anim4.coin.coin_rotate4._currentframe);
_local3.comboClip.combo.coin_rotate.gotoAndStop(_local3.comboClip.combo.coin_rotate._currentframe);
if (_local3.scoreIndicateClip._visible) {
_local3.scoreIndicateClip.gotoAndStop(_local3.scoreIndicateClip._currentframe);
}
if (_local3.expertScoreClip._visible) {
_local3.expertScoreClip.gotoAndStop(_local3.expertScoreClip._currentframe);
}
_global.ringvisible = phone_mc.ring._visible;
phone_mc.ring._visible = false;
_local3.chocolateClip.mc.gotoAndStop(_local3.chocolateClip.mc._currentframe);
_local3.specialChocolateClip.mc.gotoAndStop(_local3.specialChocolateClip.mc._currentframe);
_local3.chocolateClip2.mc.gotoAndStop(_local3.chocolateClip2.mc._currentframe);
_local3.coffeeClip.gotoAndStop(_local3.coffeeClip._currentframe);
}
function CallResume() {
var _local4 = this;
if (_global.soundstat == "onn") {
_root.gameSound.start();
}
_local4.bg.blink.gotoAndPlay(_local4.bg.blink._currentframe);
_local4.customer1.customer.gotoAndPlay(_local4.customer1.customer._currentframe);
_local4.customer2.customer.gotoAndPlay(_local4.customer2.customer._currentframe);
_local4.customer3.customer.gotoAndPlay(_local4.customer3.customer._currentframe);
_local4.special_choco_machines.machine1.blink.gotoAndPlay(_local4.special_choco_machines.machine1.blink._currentframe);
_local4.choco_machines.single_machine.blink.gotoAndPlay(_local4.choco_machines.single_machine.blink._currentframe);
_local4.salesGirl.coffeeicon.smoke.gotoAndPlay(_local4.salesGirl.coffeeicon.smoke._currentframe);
_local4.customer4.customer.gotoAndPlay(_local4.customer4.customer._currentframe);
_local4.coin_Anim1.coin.gotoAndPlay(_local4.coin_Anim1.coin._currentframe - 1);
_local4.coin_Anim2.coin.gotoAndPlay(_local4.coin_Anim2.coin._currentframe - 1);
_local4.coin_Anim3.coin.gotoAndPlay(_local4.coin_Anim3.coin._currentframe - 1);
_local4.coin_Anim4.coin.gotoAndPlay(_local4.coin_Anim4.coin._currentframe - 1);
_local4.comboClip.combo.gotoAndPlay(_local4.comboClip.combo._currentframe - 1);
_local4.orderbook1.heartinClip.gotoAndPlay(_local4.orderbook1.heartinClip._currentframe - 1);
_local4.orderbook2.heartinClip.gotoAndPlay(_local4.orderbook2.heartinClip._currentframe - 1);
_local4.orderbook3.heartinClip.gotoAndPlay(_local4.orderbook3.heartinClip._currentframe - 1);
_local4.orderbook4.heartinClip.gotoAndPlay(_local4.orderbook4.heartinClip._currentframe - 1);
_local4.curScoreClip.gotoAndPlay(_local4.curScoreClip._currentframe);
_local4.coin_Anim1.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate._currentframe);
_local4.coin_Anim1.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate2._currentframe);
_local4.coin_Anim1.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate3._currentframe);
_local4.coin_Anim1.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate4._currentframe);
_local4.coin_Anim2.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate._currentframe);
_local4.coin_Anim2.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate2._currentframe);
_local4.coin_Anim2.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate3._currentframe);
_local4.coin_Anim2.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate4._currentframe);
_local4.coin_Anim3.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate._currentframe);
_local4.coin_Anim3.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate2._currentframe);
_local4.coin_Anim3.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate3._currentframe);
_local4.coin_Anim3.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate4._currentframe);
_local4.coin_Anim4.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate._currentframe);
_local4.coin_Anim4.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate2._currentframe);
_local4.coin_Anim4.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate3._currentframe);
_local4.coin_Anim4.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate4._currentframe);
_local4.comboClip.combo.coin_rotate.gotoAndPlay(_local4.comboClip.combo.coin_rotate._currentframe);
if (_local4.scoreIndicateClip._visible) {
_local4.scoreIndicateClip.gotoAndPlay(_local4.scoreIndicateClip._currentframe - 1);
}
if (_local4.expertScoreClip._visible) {
_local4.expertScoreClip.gotoAndPlay(_local4.expertScoreClip._currentframe - 1);
}
phone_mc.ring._visible = _global.ringvisible;
_local4.chocolateClip.mc.gotoAndPlay(_local4.chocolateClip.mc._currentframe - 1);
_local4.specialChocolateClip.mc.gotoAndPlay(_local4.specialChocolateClip.mc._currentframe - 1);
_local4.chocolateClip2.mc.gotoAndPlay(_local4.chocolateClip2.mc._currentframe - 1);
_local4.coffeeClip.gotoAndPlay(_local4.coffeeClip._currentframe - 1);
}
function ObjectsRollOut() {
table1.onRollOut();
table2.onRollOut();
table3.onRollOut();
table4.onRollOut();
phone_mc.onRollOut();
choco_machines.onRollOut();
choco_machines2.onRollOut();
dusbin.onRollOut();
coffee_machine.onRollOut();
special_choco_machines.onRollOut();
}
function Reset() {
targetclip = "table1";
lobbyArr.length = 0;
lobbyArr = new Array(1, 2, 3);
currentDirection = "down";
targetDirection = "";
isPopup = false;
popup_info = "welcome";
clearInterval(popup_interval);
clearInterval(special_process_interval);
clearInterval(process_interval);
popup_interval = -1;
isTargetReached = true;
selectedTarget = "";
orderno = 0;
score = 0;
ismoveready = false;
orderTaken = 0;
customerCount = 0;
machineStatus = "notready";
dusbinStatus = "notready";
girlwalkframe = 2;
isFirstServeFinished = false;
depthArr.length = 0;
depthArr = new Array(-10313, -10315, -10317);
chocolateTypeArr.length = 0;
chocolateTypeArr = new Array("type_triangle", "type_fish", "type_round", "type_rabbit", "type_box");
customerEnterset = "firstset";
moneyCount = 0;
clearInterval(gameInterval);
gametimer = 0;
isGameOver = false;
combo_bookcnt = 0;
combo_ordercnt = 0;
combo_moneycnt = 0;
curtarget = "";
clearInterval(customerEnterInterval);
clearInterval(customerEnterInterval2);
clearInterval(customerEnterInterval3);
clearInterval(Re_customerEnterInterval);
clearInterval(reportInterval);
clearInterval(orderbook1.heatInterval);
clearInterval(orderbook2.heatInterval);
clearInterval(orderbook3.heatInterval);
clearInterval(orderbook4.heatInterval);
clearInterval(deliveryinterval);
isPaused = false;
sequenceArr.length = 0;
sequenceArr = new Array();
girlspeed = 12;
clearInterval(jumpInterval);
clearInterval(phoneInterval);
Key.removeListener(leve9Keyobj);
keyTarget = undefined;
phoneringcnt = 0;
isphonecalled = false;
}
var targetclip = "table1";
var lobbyArr = new Array(1, 2, 3);
var currentDirection = "down";
var isPopup = false;
var popup_info = "welcome";
var popup_interval = -1;
var process_interval = -1;
var special_process_interval = -1;
var isTargetReached = true;
var selectedTarget = "";
var orderno = 0;
var ismoveready = false;
var orderTaken = 0;
var customerCount = 0;
var machineStatus = "notready";
var machine2Status = "notready";
var special_machineStatus = "notready";
var dusbinStatus = "notready";
var coffeeStatus = "notready";
var girlwalkframe = 2;
var isFirstServeFinished = false;
var score = 0;
var depthArr = new Array(-10313, -10315, -10317);
var chocolateTypeArr = new Array("type_triangle", "type_fish", "type_round", "type_rabbit", "type_box");
var customerEnterset = "firstset";
var moneyCount = 0;
var gameInterval = -1;
var gametimer = 0;
var isGameOver = false;
var combo_bookcnt = 0;
var combo_ordercnt = 0;
var combo_moneycnt = 0;
var gamestartInterval = -1;
var curtarget = "";
var customerEnterInterval = -1;
var customerEnterInterval2 = -1;
var reportInterval = -1;
var isPaused = false;
var coffee_process_interval = -1;
var ringstat = "off";
var phone_status = "notready";
var machinespeed = 1;
var machineshake = "off";
var specialmachineshake = "off";
var coffeemachineshake = "off";
var machine2shake = "off";
var specialmachinespeed = 1;
var coffeemachinespeed = 1;
var machine2speed = 1;
var girlspeed = 12;
var sequenceArr = new Array();
var customerEnterInterval3 = -1;
var deliveryinterval = -1;
var jumpInterval = -1;
var tips = 0;
var phoneInterval = -1;
var process_interval2 = -1;
var Re_customerEnterInterval = -1;
var phoneringcnt = 0;
var cusArr = new Array("younglady", "oldlady", "younglady");
var isphonecalled = false;
var preparecnt = 0;
var prepare2cnt = 0;
var spl_preparecnt = 0;
var coffee_preparecnt = 0;
}
Symbol 1707 MovieClip [__Packages.Level10] Frame 0
class Level10 extends MovieClip
{
var dummy_highlight, deliveryboy, salesGirl, _parent, choco_machines, choco_machines2, special_choco_machines, coffee_machine, scoreIndicateClip, shopclosedClip, timerClip, chocolate_container, special_chocolate_container, coffeeClip, chocolateClip, chocolateClip2, popup_mc, selectClip, heartinClip, shopopenClip, reportMc, cancel_mc, infoClip, comboClip, dusbinContainer, curScoreClip, specialChocolateClip, expertScoreClip, table4, table3, table2, table1, coin_Anim4, coin_Anim3, coin_Anim2, coin_Anim1, dusbin, phone_mc, btn_pause, leve10Keyobj, keyTarget, pauseTarget, scoreClip, radian, targetDirection, preferred_chocolate1, preferred_chocolate2, customer4, orderbook4, attachMovie, getNextHighestDepth, customer1, orderbook1, customer2, orderbook2, customer3, orderbook3, selectedTable, re_entry, moveTarget;
function Level10 () {
super();
}
function onLoad() {
var owner = this;
clearInterval(popup_interval);
clearInterval(process_interval);
Reset();
dummy_highlight._visible = false;
deliveryboy._visible = false;
salesGirl.coffeeicon._visible = false;
_parent.pauseClip._visible = false;
salesGirl.gotoAndStop(currentDirection);
salesGirl.chocolateCount = 0;
choco_machines.status = "empty";
choco_machines2.status = "empty";
special_choco_machines.status = "empty";
coffee_machine.status = "empty";
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
scoreIndicateClip._visible = false;
shopclosedClip._visible = false;
timerClip._visible = false;
chocolate_container._visible = false;
special_chocolate_container._visible = false;
special_chocolate_container.mc.gotoAndStop(1);
coffeeClip._visible = false;
chocolateClip._visible = false;
chocolateClip2._visible = false;
popup_mc._visible = false;
selectClip._visible = false;
heartinClip._visible = false;
shopopenClip._visible = false;
reportMc._visible = false;
cancel_mc._visible = false;
infoClip._visible = false;
comboClip._visible = false;
dusbinContainer._visible = false;
curScoreClip._visible = false;
specialChocolateClip._visible = false;
expertScoreClip._visible = false;
table3._visible = (table4._visible = false);
table2._visible = false;
table1._visible = false;
coin_Anim3._visible = (coin_Anim4._visible = false);
coin_Anim2._visible = false;
coin_Anim1._visible = false;
table1.point = 1;
table2.point = 2;
table3.point = 3;
table4.point = 4;
choco_machines._visible = true;
choco_machines.gotoAndStop(2);
dusbin._visible = true;
dusbin.gotoAndStop(2);
special_choco_machines._visible = true;
special_choco_machines.gotoAndStop(1);
special_choco_machines.machine1.gotoAndStop(2);
coffee_machine._visible = true;
coffee_machine.gotoAndStop(2);
choco_machines2._visible = true;
choco_machines2.gotoAndStop(2);
phone_mc._visible = true;
owner.combo_ordercnt = 0;
owner.combo_moneycnt = 0;
owner.btn_pause._visible = true;
owner.popupDisable();
var randomno = owner.getRandom(0, 2);
owner.customerEnterInterval = setInterval(owner.CallCustomer, 1500, owner, owner.lobbyArr[randomno], "oldlady");
owner.lobbyArr.splice(randomno, 1);
var randomno = owner.getRandom(0, owner.lobbyArr.length - 1);
owner.customerEnterInterval2 = setInterval(owner.CallCustomer2, 2500, owner, owner.lobbyArr[randomno], "younglady");
owner.lobbyArr.splice(randomno, 1);
owner.isPopup = false;
owner.popup_info = "level2_start";
owner.bg.gotoAndStop(2);
owner.shopopenClip._visible = true;
owner.shopopenClip.gotoAndPlay(1);
owner.ismoveready = true;
owner.machineStatus = "ready";
owner.machine2Status = "ready";
owner.special_machineStatus = "ready";
owner.dusbinStatus = "ready";
owner.coffeeStatus = "ready";
owner.timerClip._visible = true;
clearInterval(owner.gameInterval);
owner.gametimer = 0;
owner.gameInterval = setInterval(owner.GameTimeLimit, 750, owner);
owner.Re_customerEnterInterval = setInterval(owner.CallNewCustomer, 3500, owner);
owner.phone_mc.gotoAndStop(2);
owner.phone_mc.ring.gotoAndStop(1);
btn_pause.onRelease = function () {
if (this._visible && (owner._parent.pauseClip._visible == false)) {
owner.pauseTarget = "btn_continue";
owner.isPaused = true;
owner.isPopup = true;
this._visible = false;
owner._parent.pauseClip._visible = true;
owner._parent.pauseClip.gotoAndPlay(2);
owner.CallPause();
}
};
leve10Keyobj = new Object();
Key.addListener(leve10Keyobj);
leve10Keyobj.onKeyUp = function () {
if (Key.getCode() == 13) {
if ((!owner.isPaused) && (!owner.isGameOver)) {
owner.StoreInSequence();
}
}
};
leve10Keyobj.onKeyDown = function () {
if (Key.getCode() == 37) {
if (!owner.isPaused) {
owner.LeftNavigation();
}
} else if (Key.getCode() == 39) {
if (!owner.isPaused) {
owner.RightNavigation();
}
} else if (Key.getCode() == 38) {
if (!owner.isPaused) {
owner.UpNavigation();
} else {
owner.pauseUpNavigation();
}
} else if (Key.getCode() == 40) {
if (!owner.isPaused) {
owner.DownNavigation();
} else {
owner.pauseDownNavigation();
}
} else if (Key.getCode() == 13) {
if (owner.popup_mc._visible) {
owner.popup_mc.btn_ok.onRelease();
} else if (owner.reportMc._visible) {
if (owner.reportMc._currentframe == 1) {
owner.reportMc.mc.btn_continue.onRelease();
} else {
owner.reportMc.mc.btn_retry.onRelease();
}
} else if (!owner.isPaused) {
owner.EnterFunction();
} else {
owner.PauseEnterFunction();
}
} else if (Key.getAscii() == 27) {
if (!owner.isPaused) {
owner.btn_pause.onRelease();
} else if (owner.isPaused) {
owner._parent.pauseClip.btn_continue.onRelease();
}
}
};
phone_mc.onRollOver = function () {
if (((!owner.isPaused) && (owner.table4._visible == true)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
if (owner.ringstat == "off") {
this.ring.gotoAndStop(1);
eval ("owner.orderbook" + this.point).highlight.gotoAndStop(2);
} else {
this.gotoAndStop(3);
}
owner.moveTarget = "phone_mc";
}
};
phone_mc.onRollOut = (phone_mc.onReleaseOutside = function () {
this.gotoAndStop(2);
if (owner.ringstat == "off") {
this.ring.gotoAndStop(1);
eval ("owner.orderbook" + this.point).highlight.gotoAndStop(1);
}
});
table1.onRollOver = (table2.onRollOver = (table3.onRollOver = (table4.onRollOver = function () {
if ((!owner.isPaused) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = this._name;
owner.moveTarget = this._name;
eval ("this.orderbook" + this.point).highlight.gotoAndStop(2);
if (eval ("this.orderbook" + this.point).money_mc._currentframe == 2) {
eval ("this.orderbook" + this.point).highlight_small.gotoAndStop(2);
} else if (eval ("this.orderbook" + this.point).money_mc._currentframe == 3) {
eval ("this.orderbook" + this.point).highlight_small_coin.gotoAndStop(2);
}
}
})));
table1.onRollOut = (table2.onRollOut = (table3.onRollOut = (table4.onRollOut = function () {
eval ("this.orderbook" + this.point).highlight.gotoAndStop(1);
if (eval ("this.orderbook" + this.point).money_mc._currentframe == 2) {
eval ("this.orderbook" + this.point).highlight_small.gotoAndStop(1);
} else if (eval ("this.orderbook" + this.point).money_mc._currentframe == 3) {
eval ("this.orderbook" + this.point).highlight_small_coin.gotoAndStop(1);
}
})));
choco_machines.onRollOver = function () {
if (((owner.machineStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "choco_machines";
owner.moveTarget = "choco_machines";
this.gotoAndStop(3);
owner.dummy_highlight._visible = true;
}
};
choco_machines.onRollOut = (choco_machines.onReleaseOutside = function () {
this.gotoAndStop(2);
owner.dummy_highlight._visible = false;
});
choco_machines2.onRollOver = function () {
if (((owner.machine2Status == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "choco_machines2";
owner.moveTarget = "choco_machines2";
this.gotoAndStop(3);
}
};
choco_machines2.onRollOut = (choco_machines2.onReleaseOutside = function () {
this.gotoAndStop(2);
});
dusbin.onRollOver = function () {
if ((owner.dusbinStatus == "ready") && (!owner.isPaused)) {
owner.ObjectsRollOut();
owner.keyTarget = "dusbin";
owner.moveTarget = "dusbin";
this.gotoAndStop(3);
}
};
dusbin.onRollOut = (dusbin.onReleaseOutside = function () {
this.gotoAndStop(2);
});
coffee_machine.onRollOver = function () {
if (((owner.coffeeStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "coffee_machine";
owner.moveTarget = "coffee_machine";
this.gotoAndStop(3);
}
};
coffee_machine.onRollOut = (coffee_machine.onReleaseOutside = function () {
this.gotoAndStop(2);
});
special_choco_machines.onRollOver = function () {
if (((owner.special_machineStatus == "ready") && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.ObjectsRollOut();
owner.keyTarget = "special_choco_machines";
owner.moveTarget = "special_choco_machines";
this.machine1.gotoAndStop(3);
}
};
special_choco_machines.onRollOut = (special_choco_machines.onReleaseOutside = function () {
this.machine1.gotoAndStop(2);
});
coffee_machine.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.coffee_machine);
}
};
coffee_machine.onPress = function () {
if (((owner.isTargetReached && (!owner.isPaused)) && (owner.coffeeStatus == "ready")) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "coffee_machine";
owner.calculateAngle(owner.coffee_indicate);
this.pointer._visible = true;
}
};
choco_machines.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.choco_machines);
}
};
choco_machines.onPress = function () {
if (((owner.isTargetReached && (owner.machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines";
owner.calculateAngle(owner.chomac_indicate);
this.pointer._visible = true;
}
};
choco_machines2.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.choco_machines2);
}
};
choco_machines2.onPress = function () {
if (((owner.isTargetReached && (owner.machine2Status == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines2";
owner.calculateAngle(owner.chomac_indicate2);
this.pointer._visible = true;
}
};
special_choco_machines.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.special_choco_machines);
}
};
special_choco_machines.onPress = function () {
if (((owner.isTargetReached && (owner.special_machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "special_choco_machines";
owner.calculateAngle(owner.splmn_indicate);
this.pointer._visible = true;
}
};
dusbin.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(owner.dusbin);
}
};
dusbin.onPress = function () {
if ((owner.isTargetReached && (owner.dusbinStatus == "ready")) && (!owner.isPaused)) {
owner.isTargetReached = false;
owner.selectedTarget = "dusbin";
owner.calculateAngle(owner.dusbin_indicate);
this.pointer._visible = true;
}
};
table1.onRelease = (table2.onRelease = (table3.onRelease = (table4.onRelease = function () {
if (((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) {
owner.sequenceArr.push(this);
}
})));
table1.onPress = (table2.onPress = (table3.onPress = (table4.onPress = function () {
if ((owner.isTargetReached && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = this._name;
if (owner.selectedTarget == "table1") {
owner.calculateAngle(this);
owner.selectedTable = 1;
} else if (owner.selectedTarget == "table2") {
owner.calculateAngle(this);
owner.selectedTable = 2;
} else if (owner.selectedTarget == "table3") {
owner.calculateAngle(this);
owner.selectedTable = 3;
} else if (owner.selectedTarget == "table4") {
owner.calculateAngle(owner.phone_indicate);
owner.selectedTable = 4;
}
eval ("owner.orderbook" + owner.selectedTable).pointer._visible = true;
}
})));
phone_mc.onRelease = function () {
if ((((!owner.isPaused) && (owner.dusbinStatus == "ready")) && (!owner.isTargetReached)) && (owner.table4._visible == true)) {
owner.sequenceArr.push(owner.phone_mc);
}
};
phone_mc.onPress = function () {
if (((owner.isTargetReached && (!owner.isPaused)) && (owner.table4._visible == true)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "table4";
owner.calculateAngle(owner.phone_indicate);
owner.selectedTable = 4;
}
};
}
function LeftNavigation() {
if (chocolate_container._visible) {
if (keyTarget == "type_box") {
chocolate_container.mc.type_round.onRollOver();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_triangle.onRollOver();
}
} else if (special_chocolate_container._visible) {
if (special_chocolate_container.mc.type_rabbit._currentframe == 2) {
special_chocolate_container.mc.type_rabbit.onRollOut();
special_chocolate_container.mc.type_fish.onRollOver();
} else if (special_chocolate_container.mc.type_fish._currentframe == 2) {
special_chocolate_container.mc.type_fish.onRollOut();
special_chocolate_container.mc.type_rabbit.onRollOver();
}
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate2) {
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRollOut();
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRollOver();
}
} else if (keyTarget == "coffee_machine") {
coffee_machine.onRollOut();
if (table3._visible) {
table3.onRollOver();
} else if (table2._visible) {
table2.onRollOver();
} else if (table1._visible) {
table1.onRollOver();
} else if (table4._visible) {
table4.onRollOver();
phone_mc.onRollOver();
}
} else if (keyTarget == "choco_machines") {
choco_machines.onRollOut();
coffee_machine.onRollOver();
} else if (keyTarget == "choco_machines2") {
choco_machines2.onRollOut();
choco_machines.onRollOver();
} else if (keyTarget == "special_choco_machines") {
special_choco_machines.onRollOut();
choco_machines2.onRollOver();
}
}
function RightNavigation() {
if (chocolate_container._visible) {
if (keyTarget == "type_triangle") {
chocolate_container.mc.type_round.onRollOver();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_box.onRollOver();
}
} else if (special_chocolate_container._visible) {
if (special_chocolate_container.mc.type_rabbit._currentframe == 2) {
special_chocolate_container.mc.type_rabbit.onRollOut();
special_chocolate_container.mc.type_fish.onRollOver();
} else if (special_chocolate_container.mc.type_fish._currentframe == 2) {
special_chocolate_container.mc.type_fish.onRollOut();
special_chocolate_container.mc.type_rabbit.onRollOver();
}
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate1) {
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRollOut();
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRollOver();
}
} else if (keyTarget == undefined) {
coffee_machine.onRollOver();
} else if (keyTarget == "coffee_machine") {
coffee_machine.onRollOut();
choco_machines.onRollOver();
} else if (keyTarget == "choco_machines") {
choco_machines.onRollOut();
choco_machines2.onRollOver();
} else if (keyTarget == "choco_machines2") {
choco_machines2.onRollOut();
special_choco_machines.onRollOver();
} else if ((((keyTarget == "table1") || (keyTarget == "table2")) || (keyTarget == "table3")) || (keyTarget == "table4")) {
eval ("this." + keyTarget).onRollOut();
phone_mc.onRollOut();
coffee_machine.onRollOver();
}
}
function UpNavigation() {
if (keyTarget == "table4") {
if (table1._visible) {
table4.onRollOut();
phone_mc.onRollOut();
table1.onRollOver();
} else if (table2._visible) {
table4.onRollOut();
phone_mc.onRollOut();
table1.onRollOut();
table2.onRollOver();
} else if (table3._visible) {
table4.onRollOut();
phone_mc.onRollOut();
table1.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "table1") {
if (table2._visible) {
table1.onRollOut();
table2.onRollOver();
} else if (table3._visible) {
table1.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "table2") {
if (table3._visible) {
table2.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "dusbin") {
dusbin.onRollOut();
special_choco_machines.onRollOver();
}
}
function DownNavigation() {
if (keyTarget == "table3") {
if (table2._visible) {
table3.onRollOut();
table2.onRollOver();
} else if (table1._visible) {
table3.onRollOut();
table1.onRollOver();
} else if (table4._visible) {
table3.onRollOut();
table1.onRollOut();
table4.onRollOver();
phone_mc.onRollOver();
}
} else if (keyTarget == "table2") {
if (table1._visible) {
table2.onRollOut();
table1.onRollOver();
} else if (table4._visible) {
table2.onRollOut();
table1.onRollOut();
table4.onRollOver();
phone_mc.onRollOver();
}
} else if (keyTarget == "table1") {
if (table4._visible) {
table1.onRollOut();
table4.onRollOver();
phone_mc.onRollOver();
}
} else if (keyTarget == "special_choco_machines") {
special_choco_machines.onRollOut();
dusbin.onRollOver();
}
}
function EnterFunction() {
if (chocolate_container._visible) {
if (keyTarget == "type_triangle") {
chocolate_container.mc.type_triangle.onRelease();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_round.onRelease();
} else if (keyTarget == "type_box") {
chocolate_container.mc.type_box.onRelease();
}
} else if (special_chocolate_container._visible) {
eval ("this.special_chocolate_container.mc." + keyTarget).onRelease();
} else if (dusbinContainer._visible) {
if (keyTarget == _global.preferred_chocolate1) {
eval ("this.dusbinContainer.mc.chocobox1." + _global.preferred_chocolate1).onRelease();
} else if (keyTarget == _global.preferred_chocolate2) {
eval ("this.dusbinContainer.mc.chocobox2." + _global.preferred_chocolate2).onRelease();
}
} else {
eval ("this." + keyTarget).onPress();
}
}
function PauseEnterFunction() {
eval ("this._parent.pauseClip." + pauseTarget).onRelease();
}
function pauseUpNavigation() {
if (pauseTarget == "btn_premium") {
_parent.pauseClip.btn_premium.onRollOut();
_parent.pauseClip.btn_mainmenu.onRollOver();
} else if (pauseTarget == "btn_mainmenu") {
_parent.pauseClip.btn_mainmenu.onRollOut();
_parent.pauseClip.btn_restart.onRollOver();
} else if (pauseTarget == "btn_restart") {
_parent.pauseClip.btn_restart.onRollOut();
_parent.pauseClip.btn_continue.onRollOver();
}
}
function pauseDownNavigation() {
if (pauseTarget == "pause") {
_parent.pauseClip.btn_continue.onRollOver();
} else if (pauseTarget == "btn_continue") {
_parent.pauseClip.btn_continue.onRollOut();
_parent.pauseClip.btn_restart.onRollOver();
} else if (pauseTarget == "btn_restart") {
_parent.pauseClip.btn_restart.onRollOut();
_parent.pauseClip.btn_mainmenu.onRollOver();
} else if (pauseTarget == "btn_mainmenu") {
_parent.pauseClip.btn_mainmenu.onRollOut();
_parent.pauseClip.btn_premium.onRollOver();
}
}
function updateScore() {
scoreClip.score_txt.text = score;
scoreClip.loading.gotoAndStop(score);
if ((score >= 400) && (scoreClip.target._currentframe == 1)) {
scoreClip.target.gotoAndPlay(1);
scoreIndicateClip._visible = true;
scoreIndicateClip.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.target_score_Sound.start();
}
}
if ((score >= 1180) && (scoreClip.expert._currentframe == 1)) {
scoreClip.expert.gotoAndPlay(1);
expertScoreClip._visible = true;
expertScoreClip.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.expert_score_Sound.start();
}
}
}
function onEnterFrame() {
var owner = this;
if (((!isPopup) && (!isTargetReached)) && (!owner.isPaused)) {
shopperMovement();
}
if (machineshake == "onn") {
machinespeed = -machinespeed;
choco_machines._x = choco_machines._x + ((2 * machinespeed) / 2);
choco_machines._y = choco_machines._y + ((2 * machinespeed) / 2);
}
if (specialmachineshake == "onn") {
specialmachinespeed = -specialmachinespeed;
special_choco_machines._x = special_choco_machines._x + ((1 * specialmachinespeed) / 2);
special_choco_machines._y = special_choco_machines._y + ((1 * specialmachinespeed) / 2);
} else {
special_choco_machines._x = 631;
special_choco_machines._y = 101;
}
if (coffeemachineshake == "onn") {
coffeemachinespeed = -coffeemachinespeed;
coffee_machine._x = coffee_machine._x + ((1 * coffeemachinespeed) / 2);
coffee_machine._y = coffee_machine._y + ((1 * coffeemachinespeed) / 2);
}
if (machine2shake == "onn") {
machine2speed = -machine2speed;
choco_machines2._x = choco_machines2._x + ((2 * machine2speed) / 2);
choco_machines2._y = choco_machines2._y + ((2 * machine2speed) / 2);
}
_parent.pauseClip.btn_continue.onRollOver = (_parent.pauseClip.btn_restart.onRollOver = (_parent.pauseClip.btn_mainmenu.onRollOver = (_parent.pauseClip.btn_premium.onRollOver = function () {
owner._parent.pauseClip.btn_continue.onRollOut();
owner._parent.pauseClip.btn_restart.onRollOut();
owner._parent.pauseClip.btn_mainmenu.onRollOut();
owner._parent.pauseClip.btn_premium.onRollOut();
owner.pauseTarget = this._name;
this.gotoAndStop(2);
})));
_parent.pauseClip.btn_continue.onRollOut = (_parent.pauseClip.btn_restart.onRollOut = (_parent.pauseClip.btn_mainmenu.onRollOut = (_parent.pauseClip.btn_premium.onRollOut = function () {
this.gotoAndStop(1);
})));
_parent.pauseClip.btn_continue.onRelease = function () {
owner.isPaused = false;
owner.isPopup = false;
owner.btn_pause._visible = true;
owner._parent.pauseClip._visible = false;
owner.CallResume();
};
_parent.pauseClip.btn_restart.onRelease = function () {
owner.Reset();
owner._parent.play();
};
_parent.pauseClip.btn_mainmenu.onRelease = function () {
owner.Reset();
owner._parent.gotoAndStop("mainmenu");
};
_parent.pauseClip.btn_premium.onRelease = function () {
this.getURL(_root.urlname, "_blank");
};
popup_mc.btn_ok.onRollOver = function () {
this.gotoAndStop(2);
};
popup_mc.btn_ok.onRollOut = (popup_mc.btn_ok.onReleaseOutside = function () {
this.gotoAndStop(1);
});
chocolate_container.mc.type_triangle.onRollOver = (chocolate_container.mc.type_round.onRollOver = (chocolate_container.mc.type_box.onRollOver = function () {
if (!owner.isPaused) {
owner.keyTarget = this._name;
owner.chocolate_container.mc.type_triangle.gotoAndStop(1);
owner.chocolate_container.mc.type_round.gotoAndStop(1);
owner.chocolate_container.mc.type_box.gotoAndStop(1);
this.gotoAndStop(2);
}
}));
chocolate_container.mc.type_triangle.onRelease = (chocolate_container.mc.type_round.onRelease = (chocolate_container.mc.type_box.onRelease = function () {
if (!owner.isPaused) {
if (owner.selectedTarget == "choco_machines") {
owner.chocolateClip._visible = true;
owner.chocolateClip.gotoAndStop(this._name);
owner.chocolateClip.mc.gotoAndPlay(1);
owner.isTargetReached = true;
owner.preferred_box_chocolate = this._name;
if (owner.choco_machines.status == "empty") {
owner.choco_machines.status = "prepared";
}
owner.machineshake = "onn";
owner.machineStatus = "ready";
owner.keyTarget = "choco_machines";
owner.preparecnt = 0;
owner.process_interval = setInterval(owner.IdleProcess, 100, owner);
} else if (owner.selectedTarget == "choco_machines2") {
owner.chocolateClip2._visible = true;
owner.chocolateClip2.gotoAndStop(this._name);
owner.chocolateClip2.mc.gotoAndPlay(1);
owner.isTargetReached = true;
owner.preferred_box2_chocolate = this._name;
if (owner.choco_machines2.status == "empty") {
owner.choco_machines2.status = "prepared";
}
owner.machine2shake = "onn";
owner.machine2Status = "ready";
owner.keyTarget = "choco_machines2";
owner.prepare2cnt = 0;
owner.process_interval2 = setInterval(owner.IdleProcess2, 100, owner);
}
owner.chocolate_container.gotoAndStop(2);
owner.isPopup = false;
owner.dusbinStatus = "ready";
if (_global.soundstat == "onn") {
_root.choco_producing_Sound.start();
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
}));
chocolate_container.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.machineStatus = "ready";
owner.machine2Status = "ready";
owner.chocolate_container._visible = false;
owner.isPopup = false;
owner.dusbinStatus = "ready";
if (owner.selectedTarget == "choco_machines") {
owner.keyTarget = "choco_machines";
} else {
owner.keyTarget = "choco_machines2";
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
special_chocolate_container.mc.type_rabbit.onRollOver = (special_chocolate_container.mc.type_fish.onRollOver = function () {
if (!owner.isPaused) {
owner.keyTarget = this._name;
owner.special_chocolate_container.mc.type_rabbit.gotoAndStop(1);
owner.special_chocolate_container.mc.type_fish.gotoAndStop(1);
this.gotoAndStop(2);
}
});
special_chocolate_container.mc.type_rabbit.onRelease = (special_chocolate_container.mc.type_fish.onRelease = function () {
if (!owner.isPaused) {
owner.infoClip._visible = false;
owner.specialChocolateClip._visible = true;
owner.specialChocolateClip.gotoAndStop(this._name);
owner.specialChocolateClip.mc.gotoAndPlay(1);
owner.isTargetReached = true;
owner.preferred_special_chocolate = this._name;
if (owner.special_choco_machines.status == "empty") {
owner.special_choco_machines.status = "prepared";
}
owner.spl_preparecnt = 0;
owner.special_process_interval = setInterval(owner.SpecialIdleProcess, 100, owner);
owner.special_chocolate_container.gotoAndStop(2);
owner.isPopup = false;
owner.dusbinStatus = "ready";
owner.special_machineStatus = "ready";
owner.specialmachineshake = "onn";
owner.keyTarget = "special_choco_machines";
if (_global.soundstat == "onn") {
_root.choco_producing_Sound.start();
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
});
special_chocolate_container.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.special_machineStatus = "ready";
owner.special_chocolate_container._visible = false;
owner.isPopup = false;
owner.dusbinStatus = "ready";
owner.keyTarget = "special_choco_machines";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
dusbinContainer.mc.chocobox1.type_triangle.onRollOver = (dusbinContainer.mc.chocobox1.type_round.onRollOver = (dusbinContainer.mc.chocobox1.type_box.onRollOver = (dusbinContainer.mc.chocobox2.type_triangle.onRollOver = (dusbinContainer.mc.chocobox2.type_round.onRollOver = (dusbinContainer.mc.chocobox2.type_box.onRollOver = (dusbinContainer.mc.chocobox1.type_rabbit.onRollOver = (dusbinContainer.mc.chocobox1.type_fish.onRollOver = (dusbinContainer.mc.chocobox2.type_rabbit.onRollOver = (dusbinContainer.mc.chocobox2.type_fish.onRollOver = function () {
owner.keyTarget = this._name;
this.gotoAndStop(2);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onRollOut = (dusbinContainer.mc.chocobox1.type_round.onRollOut = (dusbinContainer.mc.chocobox1.type_box.onRollOut = (dusbinContainer.mc.chocobox2.type_triangle.onRollOut = (dusbinContainer.mc.chocobox2.type_round.onRollOut = (dusbinContainer.mc.chocobox2.type_box.onRollOut = (dusbinContainer.mc.chocobox1.type_rabbit.onRollOut = (dusbinContainer.mc.chocobox1.type_fish.onRollOut = (dusbinContainer.mc.chocobox2.type_rabbit.onRollOut = (dusbinContainer.mc.chocobox2.type_fish.onRollOut = function () {
this.gotoAndStop(1);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_round.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_box.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_triangle.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_round.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_box.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_rabbit.onReleaseOutside = (dusbinContainer.mc.chocobox1.type_fish.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_rabbit.onReleaseOutside = (dusbinContainer.mc.chocobox2.type_fish.onReleaseOutside = function () {
this.gotoAndStop(1);
})))))))));
dusbinContainer.mc.chocobox1.type_triangle.onRelease = (dusbinContainer.mc.chocobox1.type_round.onRelease = (dusbinContainer.mc.chocobox1.type_box.onRelease = (dusbinContainer.mc.chocobox2.type_triangle.onRelease = (dusbinContainer.mc.chocobox2.type_round.onRelease = (dusbinContainer.mc.chocobox2.type_box.onRelease = (dusbinContainer.mc.chocobox1.type_rabbit.onRelease = (dusbinContainer.mc.chocobox1.type_fish.onRelease = (dusbinContainer.mc.chocobox2.type_rabbit.onRelease = (dusbinContainer.mc.chocobox2.type_fish.onRelease = function () {
if (!owner.isPaused) {
if (this._name == owner.preferred_chocolate1) {
owner.preferred_chocolate1 = owner.preferred_chocolate2;
owner.preferred_chocolate2 = null;
owner.salesGirl.chocolateCount--;
owner.girlwalkframe = owner.girlwalkframe / 2;
owner.salesGirl.girlwalk.gotoAndStop(owner.girlwalkframe);
owner.salesGirl.girlwalk.chocobox1.gotoAndStop(owner.preferred_chocolate1);
owner.salesGirl.girlwalk.chocobox2.gotoAndStop(owner.preferred_chocolate2);
} else {
owner.preferred_chocolate2 = null;
owner.salesGirl.chocolateCount--;
owner.girlwalkframe = owner.girlwalkframe / 2;
owner.salesGirl.girlwalk.gotoAndStop(owner.girlwalkframe);
owner.salesGirl.girlwalk.chocobox1.gotoAndStop(owner.preferred_chocolate1);
owner.salesGirl.girlwalk.chocobox2.gotoAndStop(owner.preferred_chocolate2);
}
owner.dusbinStatus = "ready";
owner.dusbinContainer._visible = false;
owner.isPopup = false;
owner.keyTarget = "dusbin";
owner.setGreenHighLight();
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
})))))))));
dusbinContainer.mc.btn_close.onRelease = function () {
if (!owner.isPaused) {
owner.dusbinStatus = "ready";
owner.dusbinContainer._visible = false;
owner.isPopup = false;
owner.keyTarget = "dusbin";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
};
reportMc.mc.btn_continue.onRelease = function () {
owner.Reset();
_global.calenderfrom = "game";
stopAllSounds();
owner._parent.gotoAndStop("upshell");
};
reportMc.mc.btn_menu.onRelease = function () {
owner.Reset();
owner._parent.gotoAndStop("mainmenu");
};
reportMc.mc.btn_retry.onRelease = function () {
owner.Reset();
owner._parent.play();
};
popup_mc.btn_ok.onRelease = function () {
if (owner.popup_info == "welcome") {
owner.btn_pause._visible = true;
owner.popupDisable();
var _local1 = owner.getRandom(0, 2);
owner.customerEnterInterval = setInterval(owner.CallCustomer, 2000, owner, owner.lobbyArr[_local1], "oldlady");
owner.isPopup = false;
owner.popup_info = "level2_start";
owner.bg.gotoAndStop(2);
owner.shopopenClip._visible = true;
owner.shopopenClip.gotoAndPlay(1);
owner.ismoveready = true;
owner.machineStatus = "ready";
owner.machine2Status = "ready";
owner.special_machineStatus = "ready";
owner.dusbinStatus = "ready";
owner.coffeeStatus = "ready";
owner.timerClip._visible = true;
clearInterval(owner.gameInterval);
owner.gametimer = 0;
owner.gameInterval = setInterval(owner.GameTimeLimit, 1000, owner);
owner.phone_mc.gotoAndStop(2);
owner.phone_mc.ring.gotoAndStop(1);
} else if (owner.popup_info == "order") {
owner.popupDisable();
owner.isPopup = false;
owner.popup_info = "";
owner.selectClip._visible = true;
owner.selectClip._x = owner.choco_machines._x;
owner.selectClip._y = owner.choco_machines._y - 80;
} else if (owner.popup_info == "mismatch") {
owner.popupDisable();
owner.isPopup = false;
}
};
}
function shopperMovement() {
var _local3 = (salesGirl._x + salesGirl.pointer._x) - targetclip._x;
var _local2 = (salesGirl._y + salesGirl.pointer._y) - targetclip._y;
var _local5 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
var _local4 = 10;
if (_local5 >= _local4) {
salesGirl._x = salesGirl._x + (Math.cos(radian) * girlspeed);
salesGirl._y = salesGirl._y + (Math.sin(radian) * girlspeed);
} else if (!isTargetReached) {
isTargetReached = true;
salesGirl.gotoAndStop(targetDirection);
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
Manipulate();
updateScore();
}
}
function GameStart(_arg2) {
clearInterval(_arg2.gamestartInterval);
_arg2.isPopup = true;
_global.popupText = "Select the PHONE to answer a call. Take the order of the client and prepare it. A delivery boy will pick it up later.";
_arg2.ShowPopup(_arg2);
}
function calculateAngle(mc) {
if (!isPopup) {
targetclip = mc;
var x_diff = (eval (mc)._x - (salesGirl._x + salesGirl.pointer._x));
var y_diff = (eval (mc)._y - (salesGirl._y + salesGirl.pointer._y));
radian = Math.atan2(y_diff, x_diff);
if (Math.abs(x_diff) > Math.abs(y_diff)) {
if (x_diff > 0) {
targetDirection = "right";
} else {
targetDirection = "left";
}
} else if (y_diff > 0) {
targetDirection = "down";
} else {
targetDirection = "up";
}
if (curtarget != selectedTarget) {
curtarget = selectedTarget;
salesGirl.gotoAndStop(targetDirection);
salesGirl.girlwalk.gotoAndStop(girlwalkframe - 1);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
}
}
}
function ShowPopup(_arg1) {
clearInterval(_arg1.popup_interval);
_arg1.isPopup = true;
_arg1.popup_mc._visible = true;
_arg1.popup_mc.swapDepths(_arg1.getNextHighestDepth());
_arg1.popup_mc.gotoAndPlay(1);
}
function popupDisable() {
popup_mc.gotoAndStop(1);
popup_mc._visible = false;
}
function CallNewCustomer(_arg2) {
if (!_arg2.isGameOver) {
if (_arg2.table4._visible) {
var _local1 = 0;
while (_local1 < _arg2.lobbyArr.length) {
if (_arg2.lobbyArr[_local1] == 1) {
_arg2.lobbyArr.splice(_local1, 1);
}
_local1++;
}
}
if ((_arg2.customerCount != 0) && (_arg2.moneyCount != 0)) {
_arg2.CallNextCustomerSet();
}
} else {
clearInterval(_arg2.Re_customerEnterInterval);
}
}
function CallCustomer(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.customerEnterInterval);
if (!_arg1.isGameOver) {
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function CallCustomer2(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.customerEnterInterval2);
if (!_arg1.isGameOver) {
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function CallCustomer3(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.customerEnterInterval3);
if (!_arg1.isGameOver) {
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function Re_CallCustomer(_arg1, _arg3, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.Re_customerEnterInterval);
if (!_arg1.isGameOver) {
_arg1.customerEnter(_arg3, _arg2);
} else if ((_arg1.customerCount == 0) && (_arg1.moneyCount == 0)) {
_arg1.callResult();
}
}
}
function customerEnter(_arg5, _arg4) {
if (!isGameOver) {
if (_arg4 == "phoneorder") {
isphonecalled = true;
ringstat = "onn";
phone_mc._visible = true;
table4._visible = true;
customer4 = phone_mc;
phone_mc.ring._visible = true;
phone_mc.ring.gotoAndPlay(2);
orderbook4 = attachMovie("orderbook", "orderbook4", getNextHighestDepth(), {_x:170, _y:400});
orderbook4._visible = false;
orderbook4.type = "phone";
customer4.type = _arg4;
orderbook4.heatcnt = 0;
orderbook4.heatInterval = setInterval(HeatFunction, 400, orderbook4, this, 4);
phoneringcnt = 0;
phoneInterval = setInterval(HidePhoneOrder, 1000, this);
if (_global.soundstat == "onn") {
_root.phonering_Sound.start();
}
} else if (_arg5 == 1) {
table1._visible = true;
customer1 = attachMovie(_arg4, "customer1", depthArr[_arg5 - 1], {_x:115, _y:356});
orderbook1 = attachMovie("orderbook", "orderbook1", getNextHighestDepth(), {_x:170, _y:374});
orderbook1.type = "book";
customer1.type = _arg4;
orderbook1.heatcnt = 0;
if (_arg4 == "oldlady") {
orderbook1.heatInterval = setInterval(HeatFunction, 400, orderbook1, this, 1);
} else if (_arg4 == "younglady") {
orderbook1.heatInterval = setInterval(HeatFunction, 200, orderbook1, this, 1);
}
} else if (_arg5 == 2) {
table2._visible = true;
customer2 = attachMovie(_arg4, "customer2", depthArr[_arg5 - 1], {_x:119, _y:235});
orderbook2 = attachMovie("orderbook", "orderbook2", getNextHighestDepth(), {_x:177, _y:278});
orderbook2.type = "book";
customer2.type = _arg4;
orderbook2.heatcnt = 0;
if (_arg4 == "oldlady") {
orderbook2.heatInterval = setInterval(HeatFunction, 400, orderbook2, this, 2);
} else if (_arg4 == "younglady") {
orderbook2.heatInterval = setInterval(HeatFunction, 200, orderbook2, this, 2);
}
} else if (_arg5 == 3) {
table3._visible = true;
customer3 = attachMovie(_arg4, "customer3", depthArr[_arg5 - 1], {_x:127, _y:140});
orderbook3 = attachMovie("orderbook", "orderbook3", getNextHighestDepth(), {_x:184, _y:185});
orderbook3.type = "book";
customer3.type = _arg4;
orderbook3.heatcnt = 0;
if (_arg4 == "oldlady") {
orderbook3.heatInterval = setInterval(HeatFunction, 400, orderbook3, this, 3);
} else if (_arg4 == "younglady") {
orderbook3.heatInterval = setInterval(HeatFunction, 200, orderbook3, this, 3);
}
}
customerCount++;
moneyCount++;
orderTaken++;
trace((("in cus enter=" + customerCount) + ", ") + moneyCount);
salesGirl.swapDepths(getNextHighestDepth());
scoreIndicateClip.swapDepths(getNextHighestDepth());
expertScoreClip.swapDepths(getNextHighestDepth());
chocolate_container.swapDepths(getNextHighestDepth());
special_chocolate_container.swapDepths(getNextHighestDepth());
dusbinContainer.swapDepths(getNextHighestDepth());
comboClip.swapDepths(getNextHighestDepth());
reportMc.swapDepths(getNextHighestDepth());
}
}
function HidePhoneOrder(owner) {
if (!owner.isPaused) {
owner.phoneringcnt++;
if (owner.phoneringcnt >= 20) {
clearInterval(owner.phoneInterval);
clearInterval(owner.orderbook4.heatInterval);
owner.moneyCount--;
owner.customerCount--;
owner.orderbook4._visible = false;
owner.table4._visible = false;
owner.orderbook4.type = "empty";
owner.ringstat = "off";
owner.phone_mc.ring.gotoAndStop(1);
_root.phonering_Sound.stop();
if ((owner.customerCount == 0) && (owner.moneyCount == 0)) {
if (!owner.isGameOver) {
owner.CallNextCustomerSet();
} else {
owner.callResult();
}
}
}
}
}
function Manipulate() {
var owner = this;
if (selectedTarget == "coffee_machine") {
coffee_machine.pointer._visible = false;
if (coffee_machine.status == "empty") {
coffee_machine.status = "prepared";
coffeeClip._visible = true;
coffeeClip.gotoAndPlay(2);
owner.isTargetReached = true;
owner.coffee_preparecnt = 0;
owner.coffee_process_interval = setInterval(owner.CoffeeIdleProcess, 100, owner);
owner.isPopup = false;
owner.coffeemachineshake = "onn";
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
} else if (coffee_machine.status == "coffeeReady") {
coffeeClip._visible = false;
coffee_machine.status = "empty";
salesGirl.coffeeicon._visible = false;
girlspeed = 12;
orderTaken = 0;
salesGirl.gotoAndStop(2);
if (salesGirl.chocolateCount == 0) {
girlwalkframe = 9;
} else if (salesGirl.chocolateCount == 1) {
girlwalkframe = 10;
} else if (salesGirl.chocolateCount == 2) {
girlwalkframe = 11;
}
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.jumpLady.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.jumpLady.chocobox2.gotoAndStop(preferred_chocolate2);
owner.machineStatus = "notready";
owner.special_machineStatus = "notready";
owner.dusbinStatus = "notready";
owner.coffeeStatus = "notready";
owner.isPopup = true;
jumpInterval = setInterval(JumpFinished, 1100, this);
}
} else if (selectedTarget == "choco_machines") {
choco_machines.pointer._visible = false;
if (choco_machines.status == "empty") {
if (owner.salesGirl.chocolateCount < 3) {
chocolate_container._visible = true;
chocolate_container.gotoAndStop(1);
chocolate_container.mc.gotoAndPlay(1);
machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
keyTarget = "type_round";
}
} else if (choco_machines.status == "chocolateReady") {
if (owner.salesGirl.chocolateCount < 2) {
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = owner.preferred_box_chocolate;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = owner.preferred_box_chocolate;
}
owner.salesGirl.chocolateCount++;
chocolateClip._visible = false;
salesGirl.gotoAndStop(2);
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
choco_machines.status = "empty";
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
if (orderbook1.book_mc._currentframe == 74) {
orderbook1.green_highlight._visible = true;
}
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
if (orderbook2.book_mc._currentframe == 74) {
orderbook2.green_highlight._visible = true;
}
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
if (orderbook3.book_mc._currentframe == 74) {
orderbook3.green_highlight._visible = true;
}
}
if ((orderbook4.neededchocolate == preferred_chocolate1) || (orderbook4.neededchocolate == preferred_chocolate2)) {
if (orderbook4.book_mc._currentframe == 74) {
orderbook4.green_highlight._visible = true;
}
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (selectedTarget == "choco_machines2") {
choco_machines2.pointer._visible = false;
if (choco_machines2.status == "empty") {
if (owner.salesGirl.chocolateCount < 3) {
chocolate_container._visible = true;
chocolate_container.gotoAndStop(1);
chocolate_container.mc.gotoAndPlay(1);
machine2Status = "notready";
dusbinStatus = "notready";
isPopup = true;
keyTarget = "type_round";
}
} else if (choco_machines2.status == "chocolateReady") {
if (owner.salesGirl.chocolateCount < 2) {
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = owner.preferred_box2_chocolate;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = owner.preferred_box2_chocolate;
}
owner.salesGirl.chocolateCount++;
chocolateClip2._visible = false;
salesGirl.gotoAndStop(2);
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
choco_machines2.status = "empty";
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
}
if ((orderbook4.neededchocolate == preferred_chocolate1) || (orderbook4.neededchocolate == preferred_chocolate2)) {
orderbook4.green_highlight._visible = true;
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (selectedTarget == "special_choco_machines") {
special_choco_machines.pointer._visible = false;
if (special_choco_machines.status == "empty") {
if (owner.salesGirl.chocolateCount < 3) {
special_chocolate_container._visible = true;
special_chocolate_container.gotoAndStop(1);
special_chocolate_container.mc.gotoAndPlay(1);
special_machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
keyTarget = "type_rabbit";
}
} else if (special_choco_machines.status == "chocolateReady") {
if (owner.salesGirl.chocolateCount < 2) {
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = owner.preferred_special_chocolate;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = owner.preferred_special_chocolate;
}
owner.salesGirl.chocolateCount++;
specialChocolateClip._visible = false;
salesGirl.gotoAndStop(2);
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
special_choco_machines.status = "empty";
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
}
if ((orderbook4.neededchocolate == preferred_chocolate1) || (orderbook4.neededchocolate == preferred_chocolate2)) {
orderbook4.green_highlight._visible = true;
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
} else if (selectedTarget == "dusbin") {
dusbin.pointer._visible = false;
if (salesGirl.chocolateCount == 1) {
salesGirl.chocolateCount--;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
preferred_chocolate1 = null;
preferred_chocolate2 = null;
owner.setGreenHighLight();
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
} else if (salesGirl.chocolateCount >= 2) {
dusbinStatus = "notready";
isPopup = true;
_global.preferred_chocolate1 = preferred_chocolate1;
_global.preferred_chocolate2 = preferred_chocolate2;
keyTarget = _global.preferred_chocolate1;
dusbinContainer._visible = true;
dusbinContainer.gotoAndStop(1);
dusbinContainer.mc.gotoAndPlay(1);
}
} else if ((((selectedTarget == "table1") || (selectedTarget == "table2")) || (selectedTarget == "table3")) || (selectedTarget == "table4")) {
eval ("this.orderbook" + selectedTable).pointer._visible = false;
if (eval ("this.orderbook" + selectedTable).type == "phone") {
isphonecalled = true;
_root.phonering_Sound.stop();
clearInterval(phoneInterval);
combo_bookcnt++;
combo_ordercnt = 0;
combo_moneycnt = 0;
ringstat = "off";
phone_mc.ring.gotoAndStop(1);
eval ("this.orderbook" + selectedTable).type = "chocolateOrder";
var randomno = owner.getRandom(0, 4);
eval ("this.orderbook" + selectedTable)._visible = true;
eval ("this.orderbook" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.customer" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.orderbook" + selectedTable).gotoAndStop(2);
eval ("this.customer" + selectedTable).gotoAndStop(2);
eval ("this.orderbook" + selectedTable).green_highlight._visible = false;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
var heatcntchange = int(eval ("this.orderbook" + selectedTable).heatcnt / 4);
if (heatcntchange > 1) {
eval ("this.orderbook" + selectedTable).heatcnt = heatcntchange;
} else {
eval ("this.orderbook" + selectedTable).heatcnt = 1;
}
CheckForBookCombo();
} else if (eval ("this.orderbook" + selectedTable).type == "book") {
combo_bookcnt++;
combo_ordercnt = 0;
combo_moneycnt = 0;
eval ("this.orderbook" + selectedTable).type = "chocolateOrder";
var randomno = owner.getRandom(0, 4);
eval ("this.orderbook" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.customer" + selectedTable).neededchocolate = chocolateTypeArr[randomno];
eval ("this.orderbook" + selectedTable).gotoAndStop(2);
eval ("this.customer" + selectedTable).gotoAndStop(3);
eval ("this.orderbook" + selectedTable).green_highlight._visible = false;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
var heatcntchange = int(eval ("this.orderbook" + selectedTable).heatcnt / 4);
if (heatcntchange > 1) {
eval ("this.orderbook" + selectedTable).heatcnt = heatcntchange;
} else {
eval ("this.orderbook" + selectedTable).heatcnt = 1;
}
CheckForBookCombo();
} else if (eval ("this.orderbook" + selectedTable).type == "chocolateOrder") {
if ((salesGirl.chocolateCount >= 1) && (eval ("this.orderbook" + selectedTable).book_mc._currentframe >= 74)) {
combo_bookcnt = 0;
combo_moneycnt = 0;
if (eval ("owner.customer" + owner.selectedTable).neededchocolate == owner.preferred_chocolate1) {
combo_ordercnt++;
preferred_chocolate1 = preferred_chocolate2;
preferred_chocolate2 = null;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
if (selectedTarget == "table4") {
orderbook4.type = "none";
orderbook4.temp_box._visible = false;
orderbook4.green_highlight._visible = false;
orderbook4.highlight._visible = false;
orderbook4.timelimit._visible = false;
phone_mc.swapDepths(getNextHighestDepth());
scoreIndicateClip.swapDepths(getNextHighestDepth());
expertScoreClip.swapDepths(getNextHighestDepth());
reportMc.swapDepths(getNextHighestDepth());
deliveryboy._visible = true;
deliveryboy.gotoAndPlay(2);
clearInterval(deliveryinterval);
deliveryinterval = setInterval(callDeliveryBoy, 1500, this);
} else {
eval ("this.orderbook" + selectedTable).type = "money";
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable).gotoAndStop(3);
eval ("this.customer" + selectedTable).gotoAndStop(5);
if ((eval ("this.orderbook" + selectedTable).heatcnt > 60) && (eval ("this.orderbook" + selectedTable).heatcnt <= 100)) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(2);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
} else if (eval ("this.orderbook" + selectedTable).heatcnt > 100) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(3);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
eval ("this.orderbook" + selectedTable).highlight_small._visible = false;
}
if (_global.soundstat == "onn") {
_root.customer_happy_Sound.start();
}
if (!isGameOver) {
if (table4._visible) {
var i = 0;
while (i < lobbyArr.length) {
if (lobbyArr[i] == 1) {
lobbyArr.splice(i, 1);
}
i++;
}
}
CallNextCustomerSet();
}
}
clearInterval(eval ("this.orderbook" + selectedTable).heatInterval);
CheckForOrderCombo();
customerCount--;
if (salesGirl.chocolateCount == 1) {
preferred_chocolate1 = null;
}
salesGirl.chocolateCount--;
owner.setGreenHighLight();
} else if (eval ("owner.customer" + owner.selectedTable).neededchocolate == owner.preferred_chocolate2) {
combo_ordercnt++;
salesGirl.chocolateCount--;
preferred_chocolate2 = null;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
if (selectedTarget == "table4") {
orderbook4.type = "none";
orderbook4.temp_box._visible = false;
orderbook4.green_highlight._visible = false;
orderbook4.highlight._visible = false;
orderbook4.timelimit._visible = false;
phone_mc.swapDepths(getNextHighestDepth());
scoreIndicateClip.swapDepths(getNextHighestDepth());
expertScoreClip.swapDepths(getNextHighestDepth());
reportMc.swapDepths(getNextHighestDepth());
deliveryboy._visible = true;
deliveryboy.gotoAndPlay(2);
clearInterval(deliveryinterval);
deliveryinterval = setInterval(callDeliveryBoy, 1500, this);
} else {
eval ("this.orderbook" + selectedTable).type = "money";
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable).gotoAndStop(3);
eval ("this.customer" + selectedTable).gotoAndStop(5);
if ((eval ("this.orderbook" + selectedTable).heatcnt > 60) && (eval ("this.orderbook" + selectedTable).heatcnt <= 100)) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(2);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
} else if (eval ("this.orderbook" + selectedTable).heatcnt > 100) {
eval ("this.orderbook" + selectedTable).money_mc.gotoAndStop(3);
eval ("this.orderbook" + selectedTable).highlight._visible = false;
eval ("this.orderbook" + selectedTable).highlight_small._visible = false;
}
if (_global.soundstat == "onn") {
_root.customer_happy_Sound.start();
}
if (!isGameOver) {
if (table4._visible) {
var i = 0;
while (i < lobbyArr.length) {
if (lobbyArr[i] == 1) {
lobbyArr.splice(i, 1);
}
i++;
}
}
CallNextCustomerSet();
}
}
clearInterval(eval ("this.orderbook" + selectedTable).heatInterval);
CheckForOrderCombo();
customerCount--;
owner.setGreenHighLight();
}
}
} else if (eval ("this.orderbook" + selectedTable).type == "money") {
combo_bookcnt = 0;
combo_ordercnt = 0;
combo_moneycnt++;
trace((("money before=" + customerCount) + ", ") + moneyCount);
moneyCount--;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(2);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable)._visible = false;
eval ("this.table" + selectedTable)._visible = false;
eval ("this.orderbook" + selectedTable).type = "empty";
if (owner.selectedTarget != "table4") {
eval ("this.customer" + selectedTable)._visible = false;
}
CheckForMoneyCombo();
if (orderTaken >= 6) {
salesGirl.coffeeicon._visible = true;
girlspeed = 6;
}
if (selectedTable != 4) {
lobbyArr.push(selectedTable);
} else if (table1._visible == false) {
lobbyArr.push(1);
}
trace((("money after=" + customerCount) + ", ") + moneyCount);
if ((customerCount == 0) && (moneyCount == 0)) {
if (!isGameOver) {
customerCount = 0;
moneyCount = 0;
owner.table2._visible = (owner.table3._visible = false);
owner.table1._visible = false;
CallNextCustomerSet();
} else {
callResult();
}
} else if (isGameOver) {
if ((((table1._visible == false) && (table2._visible == false)) && (table3._visible == false)) && (table4._visible == false)) {
callResult();
}
}
}
owner.sequenceArr.splice(0, 1);
if (owner.sequenceArr.length >= 1) {
owner.CallSequence();
}
}
}
function ReEntry() {
var _local2 = this;
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
if (table4._visible) {
_local3 = 1;
} else {
_local3 = 0;
}
_local2.Re_customerEnterInterval = setInterval(_local2.Re_CallCustomer, 100, _local2, _local2.lobbyArr[_local3], "younglady");
_local2.lobbyArr.splice(_local3, 1);
}
function CallNextCustomerSet() {
var _local2 = this;
if (lobbyArr.length >= 1) {
if (lobbyArr.length == 1) {
if (((!isphonecalled) && (table4._visible == false)) && (table1._visible == false)) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
clearInterval(_local2.customerEnterInterval2);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 2000, _local2, _local2.lobbyArr[_local3], "phoneorder");
} else {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 1000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
}
} else if (lobbyArr.length == 2) {
re_entry = "onn";
if (((!isphonecalled) && (table4._visible == false)) && (table1._visible == false)) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local4 = Math.ceil((Math.random() * 3) - 1);
if (_local2.lobbyArr[0] == 1) {
_local3 = 1;
} else if (_local2.lobbyArr[1] == 1) {
_local3 = 0;
}
clearInterval(_local2.customerEnterInterval);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 1000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
clearInterval(_local2.customerEnterInterval2);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 2000, _local2, _local2.lobbyArr[_local3], "phoneorder");
} else {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 100, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval2);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 2000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
}
} else if (lobbyArr.length == 3) {
var _local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
var _local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval);
_local2.customerEnterInterval = setInterval(_local2.CallCustomer, 1000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval2);
_local2.customerEnterInterval2 = setInterval(_local2.CallCustomer2, 2000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
_local3 = _local2.getRandom(0, _local2.lobbyArr.length - 1);
_local4 = Math.ceil((Math.random() * 3) - 1);
clearInterval(_local2.customerEnterInterval3);
_local2.customerEnterInterval3 = setInterval(_local2.CallCustomer3, 4000, _local2, _local2.lobbyArr[_local3], _local2.cusArr[_local4]);
_local2.lobbyArr.splice(_local3, 1);
}
}
}
function callDeliveryBoy(owner) {
clearInterval(owner.deliveryinterval);
owner.orderbook4.type = "money";
owner.coin_Anim4._visible = true;
owner.coin_Anim4.gotoAndStop(1);
owner.coin_Anim4.coin.gotoAndPlay(1);
owner.orderbook4.gotoAndStop(3);
if ((owner.orderbook4.heatcnt > 60) && (owner.orderbook4.heatcnt <= 100)) {
owner.orderbook4.money_mc.gotoAndStop(2);
owner.orderbook4.highlight._visible = false;
} else if (owner.orderbook4.heatcnt > 100) {
owner.orderbook4.money_mc.gotoAndStop(3);
owner.orderbook4.highlight._visible = false;
owner.orderbook4.highlight_small._visible = false;
}
if (!owner.isGameOver) {
if (owner.table4._visible) {
var i = 0;
while (i < owner.lobbyArr.length) {
if (owner.lobbyArr[i] == 1) {
owner.lobbyArr.splice(i, 1);
}
i++;
}
}
owner.CallNextCustomerSet();
}
}
function JumpFinished(_arg1) {
clearInterval(_arg1.jumpInterval);
_arg1.machineStatus = "ready";
_arg1.special_machineStatus = "ready";
_arg1.dusbinStatus = "ready";
_arg1.coffeeStatus = "ready";
_arg1.isPopup = false;
_arg1.sequenceArr.splice(0, 1);
if (_arg1.sequenceArr.length >= 1) {
_arg1.CallSequence();
}
}
function setGreenHighLight() {
if (orderbook1.book_mc._currentframe >= 74) {
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
} else {
orderbook1.green_highlight._visible = false;
}
}
if (orderbook2.book_mc._currentframe >= 74) {
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
} else {
orderbook2.green_highlight._visible = false;
}
}
if (orderbook3.book_mc._currentframe >= 74) {
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
} else {
orderbook3.green_highlight._visible = false;
}
}
if (orderbook4.book_mc._currentframe >= 74) {
if ((orderbook4.neededchocolate == preferred_chocolate1) || (orderbook4.neededchocolate == preferred_chocolate2)) {
orderbook4.green_highlight._visible = true;
} else {
orderbook4.green_highlight._visible = false;
}
}
}
function callResult() {
clearInterval(customerEnterInterval);
clearInterval(customerEnterInterval2);
clearInterval(customerEnterInterval3);
clearInterval(Re_customerEnterInterval);
clearInterval(reportInterval);
clearInterval(orderbook1.heatInterval);
clearInterval(orderbook2.heatInterval);
clearInterval(orderbook3.heatInterval);
clearInterval(orderbook4.heatInterval);
clearInterval(deliveryinterval);
clearInterval(jumpInterval);
clearInterval(phoneInterval);
machineStatus = "notready";
special_machineStatus = "notready";
dusbinStatus = "notready";
isPopup = true;
_global.report_moneyEarned = score;
_global.report_tips = tips;
_global.targetScore = 400;
_global.expertScore = 1180;
btn_pause._visible = false;
dusbinStatus = "notready";
score = score + tips;
if (score < 400) {
reportMc._visible = true;
reportMc.gotoAndStop(2);
reportMc.mc.gotoAndPlay(2);
if (_global.soundstat == "onn") {
_root.level_failed_Sound.start();
}
} else {
if (_global.soundstat == "onn") {
_root.level_complete_Sound.start();
}
if (_global.levelSelected < 11) {
_global.levelSelected = 11;
}
if (_global.levelFinished <= 10) {
_global.levelFinished = 10;
}
if (score >= 1180) {
_global.level10Status = "expert";
} else {
_global.level10Status = "target";
}
_global.level10Score = score;
if (((score >= 400) && (scoreClip.target._currentframe == 1)) || ((score >= 1180) && (scoreClip.expert._currentframe == 1))) {
reportInterval = setInterval(CallReport, 2300, this);
} else {
reportMc._visible = true;
reportMc.gotoAndStop(1);
reportMc.mc.gotoAndPlay(2);
}
}
}
function CallReport(_arg1) {
clearInterval(_arg1.reportInterval);
_arg1.reportMc._visible = true;
_arg1.reportMc.gotoAndStop(1);
_arg1.reportMc.mc.gotoAndPlay(2);
}
function HeatFunction(owner, myparent, curpoint) {
if (!myparent.isPaused) {
owner.heatcnt++;
owner.timelimit.gotoAndStop(owner.heatcnt);
if (owner.heatcnt == 100) {
eval ("myparent.customer" + curpoint).gotoAndStop(4);
}
if (owner.heatcnt >= 120) {
clearInterval(owner.heatInterval);
trace((("lose before=" + myparent.customerCount) + ", ") + myparent.moneyCount);
myparent.moneyCount--;
myparent.customerCount--;
trace((("lose after=" + myparent.customerCount) + ", ") + myparent.moneyCount);
eval ("myparent.orderbook" + curpoint)._visible = false;
eval ("myparent.table" + curpoint)._visible = false;
if (eval ("myparent.customer" + curpoint).type == "oldlady") {
eval ("myparent.customer" + curpoint).gotoAndStop(6);
if (myparent.score > 0) {
myparent.curScoreClip._visible = true;
myparent.curScoreClip.gotoAndPlay(1);
if ((myparent.score >= 2) && (myparent.score < 10)) {
myparent.score = myparent.score - 2;
myparent.curScoreClip.disp.score.text = -2;
} else if (myparent.score >= 10) {
myparent.score = myparent.score - 10;
myparent.curScoreClip.disp.score.text = -10;
}
myparent.scoreClip.score_txt.text = myparent.score;
myparent.scoreClip.loading.gotoAndStop(myparent.score);
}
} else if (eval ("myparent.customer" + curpoint).type == "younglady") {
eval ("myparent.customer" + curpoint).gotoAndStop(6);
if (myparent.score > 0) {
myparent.curScoreClip._visible = true;
myparent.curScoreClip.gotoAndPlay(1);
if ((myparent.score >= 2) && (myparent.score < 15)) {
myparent.score = myparent.score - 2;
myparent.curScoreClip.disp.score.text = -2;
} else if (myparent.score >= 15) {
myparent.score = myparent.score - 15;
myparent.curScoreClip.disp.score.text = -15;
}
myparent.scoreClip.score_txt.text = myparent.score;
myparent.scoreClip.loading.gotoAndStop(myparent.score);
}
}
eval ("myparent.orderbook" + curpoint).type = "empty";
myparent.lobbyArr.push(curpoint);
if ((myparent.customerCount == 0) && (myparent.moneyCount == 0)) {
if (!myparent.isGameOver) {
myparent.CallNextCustomerSet();
} else {
myparent.callResult();
}
}
}
}
}
function GameTimeLimit(_arg1) {
if (!_arg1.isPaused) {
_arg1.gametimer++;
_arg1.timerClip.gotoAndStop(_arg1.gametimer);
if (_arg1.gametimer >= 90) {
_arg1.isGameOver = true;
_arg1.bg.gotoAndStop(1);
_arg1.shopclosedClip._visible = true;
_arg1.shopclosedClip.gotoAndPlay(1);
_arg1.gametimer = 0;
clearInterval(_arg1.gameInterval);
}
}
}
function CheckForBookCombo() {
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_bookcnt >= 2) {
comboClip._x = eval ("this.customer" + selectedTable)._x - 20;
comboClip._y = eval ("this.customer" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_bookcnt);
comboClip.combo.gotoAndPlay(1);
score = score + 4;
curScoreClip.disp.score.text = 4;
tips = tips + 4;
} else {
score = score + 2;
curScoreClip.disp.score.text = 2;
tips = tips + 2;
}
if (_global.soundstat == "onn") {
eval (("_root.combo" + combo_bookcnt) + "_Sound").start();
}
}
function CheckForOrderCombo() {
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_ordercnt >= 2) {
comboClip._x = eval ("this.customer" + selectedTable)._x - 20;
comboClip._y = eval ("this.customer" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_ordercnt);
comboClip.combo.gotoAndPlay(1);
score = score + 20;
curScoreClip.disp.score.text = 20;
} else {
score = score + 10;
curScoreClip.disp.score.text = 10;
}
if (_global.soundstat == "onn") {
eval (("_root.combo" + combo_ordercnt) + "_Sound").start();
}
}
function CheckForMoneyCombo() {
if (_global.soundstat == "onn") {
eval (("_root.money" + combo_moneycnt) + "_Sound").start();
}
curScoreClip._visible = true;
curScoreClip.gotoAndPlay(1);
if (combo_moneycnt >= 2) {
comboClip._x = eval ("this.orderbook" + selectedTable)._x - 20;
comboClip._y = eval ("this.orderbook" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop(combo_moneycnt);
comboClip.combo.gotoAndPlay(1);
if (eval ("this.orderbook" + selectedTable).neededchocolate == "type_rabbit") {
score = score + (combo_moneycnt * 30);
curScoreClip.disp.score.text = combo_moneycnt * 30;
} else if (eval ("this.customer" + selectedTable).type == "oldlady") {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + (combo_moneycnt * 17);
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + (combo_moneycnt * 14);
curScoreClip.disp.score.text = combo_moneycnt * 14;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + (combo_moneycnt * 11);
curScoreClip.disp.score.text = combo_moneycnt * 11;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + (combo_moneycnt * 10);
curScoreClip.disp.score.text = combo_moneycnt * 10;
}
} else {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + (combo_moneycnt * 24);
curScoreClip.disp.score.text = combo_moneycnt * 24;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + (combo_moneycnt * 21);
curScoreClip.disp.score.text = combo_moneycnt * 21;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + (combo_moneycnt * 17);
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + (combo_moneycnt * 15);
curScoreClip.disp.score.text = combo_moneycnt * 15;
}
}
if (!isGameOver) {
if (table4._visible) {
var i = 0;
while (i < lobbyArr.length) {
if (lobbyArr[i] == 1) {
lobbyArr.splice(i, 1);
}
i++;
}
}
CallNextCustomerSet();
}
} else if (eval ("this.customer" + selectedTable).type == "oldlady") {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + 17;
curScoreClip.disp.score.text = 17;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + 14;
curScoreClip.disp.score.text = 14;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + 11;
curScoreClip.disp.score.text = 11;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + 10;
curScoreClip.disp.score.text = 10;
}
} else {
var myheatcnt = eval ("this.orderbook" + selectedTable).heatcnt;
if ((myheatcnt >= 0) && (myheatcnt <= 30)) {
score = score + 24;
curScoreClip.disp.score.text = combo_moneycnt * 24;
} else if ((myheatcnt > 30) && (myheatcnt <= 60)) {
score = score + 21;
curScoreClip.disp.score.text = combo_moneycnt * 21;
} else if ((myheatcnt > 60) && (myheatcnt <= 90)) {
score = score + 17;
curScoreClip.disp.score.text = combo_moneycnt * 17;
} else if ((myheatcnt > 90) && (myheatcnt <= 119)) {
score = score + 15;
curScoreClip.disp.score.text = combo_moneycnt * 15;
}
}
}
function IdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.preparecnt++;
if (_arg3.preparecnt >= 20) {
clearInterval(_arg3.process_interval);
_arg3.machineStatus = "ready";
_arg3.machineshake = "off";
if (_arg3.choco_machines.status == "prepared") {
_arg3.choco_machines.status = "chocolateReady";
}
if (_global.soundstat == "onn") {
_root.choco_done_Sound.start();
}
}
}
}
function IdleProcess2(_arg3) {
if (!_arg3.isPaused) {
_arg3.prepare2cnt++;
if (_arg3.prepare2cnt >= 20) {
clearInterval(_arg3.process_interval2);
_arg3.machine2Status = "ready";
_arg3.machine2shake = "off";
if (_arg3.choco_machines2.status == "prepared") {
_arg3.choco_machines2.status = "chocolateReady";
}
if (_global.soundstat == "onn") {
_root.choco_done_Sound.start();
}
}
}
}
function SpecialIdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.spl_preparecnt++;
if (_arg3.spl_preparecnt >= 40) {
clearInterval(_arg3.special_process_interval);
_arg3.special_machineStatus = "ready";
_arg3.specialmachineshake = "off";
if (_arg3.special_choco_machines.status == "prepared") {
_arg3.special_choco_machines.status = "chocolateReady";
}
if (_global.soundstat == "onn") {
_root.choco_done_Sound.start();
}
}
}
}
function CoffeeIdleProcess(_arg3) {
if (!_arg3.isPaused) {
_arg3.coffee_preparecnt++;
if (_arg3.coffee_preparecnt >= 20) {
clearInterval(_arg3.coffee_process_interval);
_arg3.coffeeStatus = "ready";
_arg3.coffeemachineshake = "off";
_arg3.coffee_machine.status = "coffeeReady";
if (_global.soundstat == "onn") {
_root.hotchoco_done_Sound.start();
}
}
}
}
function getRandom(_arg4, _arg5) {
var _local3 = _arg5 - _arg4;
var _local2 = Math.random() * _local3;
var _local1 = Math.round(_local2);
_local1 = _local1 + _arg4;
return(_local1);
}
function StoreInSequence() {
var owner = this;
eval ("this." + moveTarget).onRelease();
}
function CallSequence() {
var owner = this;
if (sequenceArr[0] == choco_machines) {
if (((owner.isTargetReached && (owner.machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines";
owner.calculateAngle(owner.chomac_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == choco_machines2) {
if (((owner.isTargetReached && (owner.machine2Status == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines2";
owner.calculateAngle(owner.chomac_indicate2);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == special_choco_machines) {
if (((owner.isTargetReached && (owner.special_machineStatus == "ready")) && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "special_choco_machines";
owner.calculateAngle(owner.splmn_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == dusbin) {
if ((owner.isTargetReached && (owner.dusbinStatus == "ready")) && (!owner.isPaused)) {
owner.isTargetReached = false;
owner.selectedTarget = "dusbin";
owner.calculateAngle(owner.dusbin_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if (sequenceArr[0] == coffee_machine) {
if (((owner.isTargetReached && (!owner.isPaused)) && (owner.coffeeStatus == "ready")) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = "coffee_machine";
owner.calculateAngle(owner.coffee_indicate);
sequenceArr[0].pointer._visible = true;
}
} else if ((((sequenceArr[0] == table1) || (sequenceArr[0] == table2)) || (sequenceArr[0] == table3)) || (sequenceArr[0] == table4)) {
if ((owner.isTargetReached && (!owner.isPaused)) && (owner.dusbinStatus == "ready")) {
owner.isTargetReached = false;
owner.selectedTarget = sequenceArr[0]._name;
owner.calculateAngle(sequenceArr[0]);
if (owner.selectedTarget == "table1") {
owner.selectedTable = 1;
} else if (owner.selectedTarget == "table2") {
owner.selectedTable = 2;
} else if (owner.selectedTarget == "table3") {
owner.selectedTable = 3;
} else if (owner.selectedTarget == "table4") {
owner.selectedTable = 4;
}
eval ("owner.orderbook" + owner.selectedTable).pointer._visible = true;
}
}
}
function CallPause() {
var _local3 = this;
stopAllSounds();
_local3.bg.blink.gotoAndStop(_local3.bg.blink._currentframe);
_local3.customer1.customer.gotoAndStop(_local3.customer1.customer._currentframe);
_local3.customer2.customer.gotoAndStop(_local3.customer2.customer._currentframe);
_local3.customer3.customer.gotoAndStop(_local3.customer3.customer._currentframe);
_local3.special_choco_machines.machine1.blink.gotoAndStop(_local3.special_choco_machines.machine1.blink._currentframe);
_local3.choco_machines.single_machine.blink.gotoAndStop(_local3.choco_machines.single_machine.blink._currentframe);
_local3.salesGirl.coffeeicon.smoke.gotoAndStop(_local3.salesGirl.coffeeicon.smoke._currentframe);
_local3.customer4.customer.gotoAndStop(_local3.customer4.customer._currentframe);
_local3.coin_Anim1.coin.gotoAndStop(_local3.coin_Anim1.coin._currentframe);
_local3.coin_Anim2.coin.gotoAndStop(_local3.coin_Anim2.coin._currentframe);
_local3.coin_Anim3.coin.gotoAndStop(_local3.coin_Anim3.coin._currentframe);
_local3.coin_Anim4.coin.gotoAndStop(_local3.coin_Anim4.coin._currentframe);
_local3.comboClip.combo.gotoAndStop(_local3.comboClip.combo._currentframe);
_local3.orderbook1.heartinClip.gotoAndStop(_local3.orderbook1.heartinClip._currentframe);
_local3.orderbook2.heartinClip.gotoAndStop(_local3.orderbook2.heartinClip._currentframe);
_local3.orderbook3.heartinClip.gotoAndStop(_local3.orderbook3.heartinClip._currentframe);
_local3.orderbook4.heartinClip.gotoAndStop(_local3.orderbook4.heartinClip._currentframe);
_local3.curScoreClip.gotoAndStop(_local3.curScoreClip._currentframe);
_local3.coin_Anim1.coin.coin_rotate.gotoAndStop(_local3.coin_Anim1.coin.coin_rotate._currentframe);
_local3.coin_Anim1.coin.coin_rotate2.gotoAndStop(_local3.coin_Anim1.coin.coin_rotate2._currentframe);
_local3.coin_Anim1.coin.coin_rotate3.gotoAndStop(_local3.coin_Anim1.coin.coin_rotate3._currentframe);
_local3.coin_Anim1.coin.coin_rotate4.gotoAndStop(_local3.coin_Anim1.coin.coin_rotate4._currentframe);
_local3.coin_Anim2.coin.coin_rotate.gotoAndStop(_local3.coin_Anim2.coin.coin_rotate._currentframe);
_local3.coin_Anim2.coin.coin_rotate2.gotoAndStop(_local3.coin_Anim2.coin.coin_rotate2._currentframe);
_local3.coin_Anim2.coin.coin_rotate3.gotoAndStop(_local3.coin_Anim2.coin.coin_rotate3._currentframe);
_local3.coin_Anim2.coin.coin_rotate4.gotoAndStop(_local3.coin_Anim2.coin.coin_rotate4._currentframe);
_local3.coin_Anim3.coin.coin_rotate.gotoAndStop(_local3.coin_Anim3.coin.coin_rotate._currentframe);
_local3.coin_Anim3.coin.coin_rotate2.gotoAndStop(_local3.coin_Anim3.coin.coin_rotate2._currentframe);
_local3.coin_Anim3.coin.coin_rotate3.gotoAndStop(_local3.coin_Anim3.coin.coin_rotate3._currentframe);
_local3.coin_Anim3.coin.coin_rotate4.gotoAndStop(_local3.coin_Anim3.coin.coin_rotate4._currentframe);
_local3.coin_Anim4.coin.coin_rotate.gotoAndStop(_local3.coin_Anim4.coin.coin_rotate._currentframe);
_local3.coin_Anim4.coin.coin_rotate2.gotoAndStop(_local3.coin_Anim4.coin.coin_rotate2._currentframe);
_local3.coin_Anim4.coin.coin_rotate3.gotoAndStop(_local3.coin_Anim4.coin.coin_rotate3._currentframe);
_local3.coin_Anim4.coin.coin_rotate4.gotoAndStop(_local3.coin_Anim4.coin.coin_rotate4._currentframe);
_local3.comboClip.combo.coin_rotate.gotoAndStop(_local3.comboClip.combo.coin_rotate._currentframe);
if (_local3.scoreIndicateClip._visible) {
_local3.scoreIndicateClip.gotoAndStop(_local3.scoreIndicateClip._currentframe);
}
if (_local3.expertScoreClip._visible) {
_local3.expertScoreClip.gotoAndStop(_local3.expertScoreClip._currentframe);
}
_global.ringvisible = phone_mc.ring._visible;
phone_mc.ring._visible = false;
_local3.chocolateClip.mc.gotoAndStop(_local3.chocolateClip.mc._currentframe);
_local3.specialChocolateClip.mc.gotoAndStop(_local3.specialChocolateClip.mc._currentframe);
_local3.chocolateClip2.mc.gotoAndStop(_local3.chocolateClip2.mc._currentframe);
_local3.coffeeClip.gotoAndStop(_local3.coffeeClip._currentframe);
}
function CallResume() {
var _local4 = this;
if (_global.soundstat == "onn") {
_root.gameSound.start();
}
_local4.bg.blink.gotoAndPlay(_local4.bg.blink._currentframe);
_local4.customer1.customer.gotoAndPlay(_local4.customer1.customer._currentframe);
_local4.customer2.customer.gotoAndPlay(_local4.customer2.customer._currentframe);
_local4.customer3.customer.gotoAndPlay(_local4.customer3.customer._currentframe);
_local4.special_choco_machines.machine1.blink.gotoAndPlay(_local4.special_choco_machines.machine1.blink._currentframe);
_local4.choco_machines.single_machine.blink.gotoAndPlay(_local4.choco_machines.single_machine.blink._currentframe);
_local4.salesGirl.coffeeicon.smoke.gotoAndPlay(_local4.salesGirl.coffeeicon.smoke._currentframe);
_local4.customer4.customer.gotoAndPlay(_local4.customer4.customer._currentframe);
_local4.coin_Anim1.coin.gotoAndPlay(_local4.coin_Anim1.coin._currentframe - 1);
_local4.coin_Anim2.coin.gotoAndPlay(_local4.coin_Anim2.coin._currentframe - 1);
_local4.coin_Anim3.coin.gotoAndPlay(_local4.coin_Anim3.coin._currentframe - 1);
_local4.coin_Anim4.coin.gotoAndPlay(_local4.coin_Anim4.coin._currentframe - 1);
_local4.comboClip.combo.gotoAndPlay(_local4.comboClip.combo._currentframe - 1);
_local4.orderbook1.heartinClip.gotoAndPlay(_local4.orderbook1.heartinClip._currentframe - 1);
_local4.orderbook2.heartinClip.gotoAndPlay(_local4.orderbook2.heartinClip._currentframe - 1);
_local4.orderbook3.heartinClip.gotoAndPlay(_local4.orderbook3.heartinClip._currentframe - 1);
_local4.orderbook4.heartinClip.gotoAndPlay(_local4.orderbook4.heartinClip._currentframe - 1);
_local4.curScoreClip.gotoAndPlay(_local4.curScoreClip._currentframe);
_local4.coin_Anim1.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate._currentframe);
_local4.coin_Anim1.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate2._currentframe);
_local4.coin_Anim1.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate3._currentframe);
_local4.coin_Anim1.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate4._currentframe);
_local4.coin_Anim2.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate._currentframe);
_local4.coin_Anim2.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate2._currentframe);
_local4.coin_Anim2.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate3._currentframe);
_local4.coin_Anim2.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate4._currentframe);
_local4.coin_Anim3.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate._currentframe);
_local4.coin_Anim3.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate2._currentframe);
_local4.coin_Anim3.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate3._currentframe);
_local4.coin_Anim3.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate4._currentframe);
_local4.coin_Anim4.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate._currentframe);
_local4.coin_Anim4.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate2._currentframe);
_local4.coin_Anim4.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate3._currentframe);
_local4.coin_Anim4.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate4._currentframe);
_local4.comboClip.combo.coin_rotate.gotoAndPlay(_local4.comboClip.combo.coin_rotate._currentframe);
if (_local4.scoreIndicateClip._visible) {
_local4.scoreIndicateClip.gotoAndPlay(_local4.scoreIndicateClip._currentframe - 1);
}
if (_local4.expertScoreClip._visible) {
_local4.expertScoreClip.gotoAndPlay(_local4.expertScoreClip._currentframe - 1);
}
phone_mc.ring._visible = _global.ringvisible;
_local4.chocolateClip.mc.gotoAndPlay(_local4.chocolateClip.mc._currentframe - 1);
_local4.specialChocolateClip.mc.gotoAndPlay(_local4.specialChocolateClip.mc._currentframe - 1);
_local4.chocolateClip2.mc.gotoAndPlay(_local4.chocolateClip2.mc._currentframe - 1);
_local4.coffeeClip.gotoAndPlay(_local4.coffeeClip._currentframe - 1);
}
function ObjectsRollOut() {
table1.onRollOut();
table2.onRollOut();
table3.onRollOut();
table4.onRollOut();
phone_mc.onRollOut();
choco_machines.onRollOut();
choco_machines2.onRollOut();
dusbin.onRollOut();
coffee_machine.onRollOut();
special_choco_machines.onRollOut();
}
function Reset() {
targetclip = "table1";
lobbyArr.length = 0;
lobbyArr = new Array(1, 2, 3);
currentDirection = "down";
targetDirection = "";
isPopup = false;
popup_info = "welcome";
clearInterval(popup_interval);
clearInterval(special_process_interval);
clearInterval(process_interval);
popup_interval = -1;
isTargetReached = true;
selectedTarget = "";
orderno = 0;
score = 0;
ismoveready = false;
orderTaken = 0;
customerCount = 0;
machineStatus = "notready";
dusbinStatus = "notready";
girlwalkframe = 2;
isFirstServeFinished = false;
depthArr.length = 0;
depthArr = new Array(-10313, -10315, -10317);
chocolateTypeArr.length = 0;
chocolateTypeArr = new Array("type_triangle", "type_fish", "type_round", "type_rabbit", "type_box");
customerEnterset = "firstset";
moneyCount = 0;
clearInterval(gameInterval);
gametimer = 0;
isGameOver = false;
combo_bookcnt = 0;
combo_ordercnt = 0;
combo_moneycnt = 0;
curtarget = "";
clearInterval(customerEnterInterval);
clearInterval(customerEnterInterval2);
clearInterval(customerEnterInterval3);
clearInterval(Re_customerEnterInterval);
clearInterval(reportInterval);
clearInterval(orderbook1.heatInterval);
clearInterval(orderbook2.heatInterval);
clearInterval(orderbook3.heatInterval);
clearInterval(orderbook4.heatInterval);
clearInterval(deliveryinterval);
clearInterval(jumpInterval);
clearInterval(phoneInterval);
isPaused = false;
sequenceArr.length = 0;
sequenceArr = new Array();
girlspeed = 12;
Key.removeListener(leve10Keyobj);
keyTarget = undefined;
phoneringcnt = 0;
isphonecalled = false;
}
var targetclip = "table1";
var lobbyArr = new Array(1, 2, 3);
var currentDirection = "down";
var isPopup = false;
var popup_info = "welcome";
var popup_interval = -1;
var process_interval = -1;
var special_process_interval = -1;
var isTargetReached = true;
var selectedTarget = "";
var orderno = 0;
var ismoveready = false;
var orderTaken = 0;
var customerCount = 0;
var machineStatus = "notready";
var machine2Status = "notready";
var special_machineStatus = "notready";
var dusbinStatus = "notready";
var coffeeStatus = "notready";
var girlwalkframe = 2;
var isFirstServeFinished = false;
var score = 0;
var depthArr = new Array(-10313, -10315, -10317);
var chocolateTypeArr = new Array("type_triangle", "type_fish", "type_round", "type_rabbit", "type_box");
var customerEnterset = "firstset";
var moneyCount = 0;
var gameInterval = -1;
var gametimer = 0;
var isGameOver = false;
var combo_bookcnt = 0;
var combo_ordercnt = 0;
var combo_moneycnt = 0;
var gamestartInterval = -1;
var curtarget = "";
var customerEnterInterval = -1;
var customerEnterInterval2 = -1;
var reportInterval = -1;
var isPaused = false;
var coffee_process_interval = -1;
var ringstat = "off";
var phone_status = "notready";
var machinespeed = 1;
var machineshake = "off";
var specialmachineshake = "off";
var coffeemachineshake = "off";
var machine2shake = "off";
var specialmachinespeed = 1;
var coffeemachinespeed = 1;
var machine2speed = 1;
var girlspeed = 12;
var sequenceArr = new Array();
var callwaitInterval = -1;
var customerEnterInterval3 = -1;
var deliveryinterval = -1;
var jumpInterval = -1;
var tips = 0;
var phoneInterval = -1;
var process_interval2 = -1;
var Re_customerEnterInterval = -1;
var phoneringcnt = 0;
var cusArr = new Array("younglady", "oldlady", "younglady");
var isphonecalled = false;
var preparecnt = 0;
var prepare2cnt = 0;
var spl_preparecnt = 0;
var coffee_preparecnt = 0;
}
Symbol 1708 MovieClip [__Packages.Level1] Frame 0
class Level1 extends MovieClip
{
var salesGirl, btn_pause, _parent, scoreIndicateClip, shopclosedClip, timerClip, chocolate_container, specialcho_container, coffeeClip, chocolateClip, phone_mc, popup_mc, selectClip, choco_machines, special_choco_machines, dusbin, coffee_machine, heartinClip, shopopenClip, reportMc, cancel_mc, infoClip, comboClip, table3, table2, table1, coin_Anim3, coin_Anim2, coin_Anim1, leve1Keyobj, keyTarget, pauseTarget, scoreClip, radian, targetDirection, preferred_chocolate1, preferred_chocolate2, customer1, attachMovie, orderbook1, getNextHighestDepth, customer2, orderbook2, customer3, orderbook3, intervalstatus, iscorrectChocolateChoose, selectedTable, rantable1, rantable2, customerOrderbook1, customerOrderbook2, keylistener;
function Level1 () {
super();
}
function onLoad() {
var owner = this;
clearInterval(popup_interval);
clearInterval(process_interval);
Reset();
salesGirl.coffeeicon._visible = false;
btn_pause._visible = false;
_parent.pauseClip._visible = false;
salesGirl.gotoAndStop(currentDirection);
salesGirl.chocolateCount = 0;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
scoreIndicateClip._visible = false;
shopclosedClip._visible = false;
timerClip._visible = false;
chocolate_container._visible = false;
specialcho_container._visible = false;
coffeeClip._visible = false;
chocolateClip._visible = false;
phone_mc._visible = false;
popup_mc._visible = false;
selectClip._visible = false;
choco_machines._visible = false;
special_choco_machines._visible = false;
dusbin._visible = false;
coffee_machine._visible = false;
heartinClip._visible = false;
shopopenClip._visible = false;
reportMc._visible = false;
cancel_mc._visible = false;
infoClip._visible = false;
comboClip._visible = false;
table2._visible = (table3._visible = false);
table1._visible = false;
coin_Anim2._visible = (coin_Anim3._visible = false);
coin_Anim1._visible = false;
table1.point = 1;
table2.point = 2;
table3.point = 3;
isPopup = true;
_global.popupText = "Hi! Welcome to my chocolate shop. Let\u2019s have a look around! I\u2019ll show you 2 important things. Are you ready?";
ShowPopup(this);
btn_pause.onRelease = function () {
if (this._visible && (owner._parent.pauseClip._visible == false)) {
owner.pauseTarget = "btn_continue";
owner.isPaused = true;
owner.isPopup = true;
this._visible = false;
owner._parent.pauseClip._visible = true;
owner._parent.pauseClip.gotoAndPlay(2);
owner.CallPause();
}
};
leve1Keyobj = new Object();
Key.addListener(leve1Keyobj);
leve1Keyobj.onKeyDown = function () {
if (Key.getCode() == 37) {
if (!owner.isPaused) {
owner.LeftNavigation();
}
} else if (Key.getCode() == 39) {
if (!owner.isPaused) {
owner.RightNavigation();
}
} else if (Key.getCode() == 38) {
if (!owner.isPaused) {
owner.UpNavigation();
} else {
owner.pauseUpNavigation();
}
} else if (Key.getCode() == 40) {
if (!owner.isPaused) {
owner.DownNavigation();
} else {
owner.pauseDownNavigation();
}
} else if (Key.getCode() == 13) {
if (owner.popup_mc._visible) {
owner.popup_mc.btn_ok.onRelease();
} else if (owner.reportMc._visible) {
owner.reportMc.btn_continue.onRelease();
} else if (!owner.isPaused) {
owner.EnterFunction();
} else {
owner.PauseEnterFunction();
}
} else if (Key.getAscii() == 27) {
if (!owner.isPaused) {
owner.btn_pause.onRelease();
} else if (owner.isPaused) {
owner._parent.pauseClip.btn_continue.onRelease();
}
}
};
table1.onRollOver = (table2.onRollOver = (table3.onRollOver = function () {
if (owner.isTargetReached && (!owner.isPaused)) {
owner.ObjectsRollOut();
owner.keyTarget = this._name;
eval ("this.orderbook" + this.point).highlight.gotoAndStop(2);
}
}));
table1.onRollOut = (table2.onRollOut = (table3.onRollOut = function () {
eval ("this.orderbook" + this.point).highlight.gotoAndStop(1);
}));
choco_machines.onRollOver = function () {
if ((owner.machineStatus == "ready") && (!owner.isPaused)) {
owner.ObjectsRollOut();
owner.keyTarget = "choco_machines";
this.single_machine.gotoAndStop(3);
}
};
choco_machines.onRollOut = (choco_machines.onReleaseOutside = function () {
this.single_machine.gotoAndStop(2);
});
dusbin.onRollOver = function () {
if ((owner.dusbinStatus == "ready") && (!owner.isPaused)) {
owner.ObjectsRollOut();
owner.keyTarget = "dusbin";
this.gotoAndStop(3);
}
};
dusbin.onRollOut = (dusbin.onReleaseOutside = function () {
this.gotoAndStop(2);
});
choco_machines.onPress = function () {
trace((((owner.isTargetReached + ", ") + owner.machineStatus) + ", ") + owner.isPaused);
if ((owner.isTargetReached && (owner.machineStatus == "ready")) && (!owner.isPaused)) {
owner.isTargetReached = false;
owner.selectedTarget = "choco_machines";
owner.calculateAngle(owner.chomac_indicate);
this.pointer._visible = true;
}
};
dusbin.onPress = function () {
if (((owner.isTargetReached && (owner.dusbinStatus == "ready")) && (owner.machineStatus == "ready")) && (!owner.isPaused)) {
owner.isTargetReached = false;
owner.selectedTarget = "dusbin";
owner.calculateAngle(owner.dusbin_indicate);
this.pointer._visible = true;
}
};
table1.onPress = (table2.onPress = (table3.onPress = function () {
if (owner.isTargetReached && (!owner.isPaused)) {
owner.isTargetReached = false;
owner.selectedTarget = this._name;
owner.calculateAngle(this);
if (owner.selectedTarget == "table1") {
owner.selectedTable = 1;
} else if (owner.selectedTarget == "table2") {
owner.selectedTable = 2;
} else if (owner.selectedTarget == "table3") {
owner.selectedTable = 3;
}
eval ("owner.orderbook" + owner.selectedTable).pointer._visible = true;
}
}));
}
function LeftNavigation() {
if (chocolate_container._visible) {
if (keyTarget == "type_box") {
chocolate_container.mc.type_round.onRollOver();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_triangle.onRollOver();
}
} else if (keyTarget == undefined) {
if (table1._visible) {
table1.onRollOver();
} else if (table2._visible) {
table2.onRollOver();
} else if (table3._visible) {
table3.onRollOver();
}
} else if (keyTarget == "choco_machines") {
choco_machines.onRollOut();
if (table3._visible) {
table3.onRollOver();
} else if (table2._visible) {
table2.onRollOver();
} else if (table1._visible) {
table1.onRollOver();
}
} else if (keyTarget == "dusbin") {
dusbin.onRollOut();
choco_machines.onRollOver();
}
}
function RightNavigation() {
if (chocolate_container._visible) {
if (keyTarget == "type_triangle") {
chocolate_container.mc.type_round.onRollOver();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_box.onRollOver();
}
} else if (keyTarget == undefined) {
if (table1._visible) {
table1.onRollOver();
} else if (table2._visible) {
table2.onRollOver();
} else if (table3._visible) {
table3.onRollOver();
}
} else if (keyTarget == "choco_machines") {
choco_machines.onRollOut();
dusbin.onRollOver();
} else if (((keyTarget == "table1") || (keyTarget == "table2")) || (keyTarget == "table3")) {
eval ("this." + keyTarget).onRollOut();
choco_machines.onRollOver();
}
}
function UpNavigation() {
if (keyTarget == "table1") {
if (table2._visible) {
table1.onRollOut();
table2.onRollOver();
} else if (table3._visible) {
table1.onRollOut();
table3.onRollOver();
}
} else if (keyTarget == "table2") {
if (table3._visible) {
table2.onRollOut();
table3.onRollOver();
}
}
}
function DownNavigation() {
if (keyTarget == "table3") {
if (table2._visible) {
table3.onRollOut();
table2.onRollOver();
} else if (table1._visible) {
table3.onRollOut();
table1.onRollOver();
}
} else if (keyTarget == "table2") {
if (table1._visible) {
table2.onRollOut();
table1.onRollOver();
}
}
}
function EnterFunction() {
if (chocolate_container._visible) {
if (keyTarget == "type_triangle") {
chocolate_container.mc.type_triangle.onRelease();
} else if (keyTarget == "type_round") {
chocolate_container.mc.type_round.onRelease();
} else if (keyTarget == "type_box") {
chocolate_container.mc.type_box.onRelease();
}
} else {
eval ("this." + keyTarget).onPress();
}
}
function PauseEnterFunction() {
eval ("this._parent.pauseClip." + pauseTarget).onRelease();
}
function pauseUpNavigation() {
if (pauseTarget == "btn_premium") {
_parent.pauseClip.btn_premium.onRollOut();
_parent.pauseClip.btn_mainmenu.onRollOver();
} else if (pauseTarget == "btn_mainmenu") {
_parent.pauseClip.btn_mainmenu.onRollOut();
_parent.pauseClip.btn_restart.onRollOver();
} else if (pauseTarget == "btn_restart") {
_parent.pauseClip.btn_restart.onRollOut();
_parent.pauseClip.btn_continue.onRollOver();
}
}
function pauseDownNavigation() {
if (pauseTarget == "pause") {
_parent.pauseClip.btn_continue.onRollOver();
} else if (pauseTarget == "btn_continue") {
_parent.pauseClip.btn_continue.onRollOut();
_parent.pauseClip.btn_restart.onRollOver();
} else if (pauseTarget == "btn_restart") {
_parent.pauseClip.btn_restart.onRollOut();
_parent.pauseClip.btn_mainmenu.onRollOver();
} else if (pauseTarget == "btn_mainmenu") {
_parent.pauseClip.btn_mainmenu.onRollOut();
_parent.pauseClip.btn_premium.onRollOver();
}
}
function updateScore() {
scoreClip.score_txt.text = score;
scoreClip.loading.gotoAndStop(score);
if ((score >= 80) && (scoreClip.target._currentframe == 1)) {
scoreClip.target.gotoAndPlay(1);
if (_global.soundstat == "onn") {
_root.target_score_Sound.start();
}
}
if ((score >= 150) && (scoreClip.expert._currentframe == 1)) {
scoreClip.expert.gotoAndPlay(1);
if (_global.soundstat == "onn") {
_root.expert_score_Sound.start();
}
}
}
function onEnterFrame() {
var owner = this;
if ((!isPopup) && (!owner.isPaused)) {
shopperMovement();
}
if (machineshake == "onn") {
machinespeed = -machinespeed;
choco_machines._x = choco_machines._x + ((1 * machinespeed) / 2);
choco_machines._y = choco_machines._y + ((1 * machinespeed) / 2);
}
_parent.pauseClip.btn_continue.onRollOver = (_parent.pauseClip.btn_restart.onRollOver = (_parent.pauseClip.btn_mainmenu.onRollOver = (_parent.pauseClip.btn_premium.onRollOver = function () {
owner._parent.pauseClip.btn_continue.onRollOut();
owner._parent.pauseClip.btn_restart.onRollOut();
owner._parent.pauseClip.btn_mainmenu.onRollOut();
owner._parent.pauseClip.btn_premium.onRollOut();
owner.pauseTarget = this._name;
this.gotoAndStop(2);
})));
_parent.pauseClip.btn_continue.onRollOut = (_parent.pauseClip.btn_restart.onRollOut = (_parent.pauseClip.btn_mainmenu.onRollOut = (_parent.pauseClip.btn_premium.onRollOut = function () {
this.gotoAndStop(1);
})));
_parent.pauseClip.btn_continue.onRelease = function () {
owner.isPaused = false;
owner.isPopup = false;
owner.btn_pause._visible = true;
owner._parent.pauseClip._visible = false;
owner.CallResume();
};
_parent.pauseClip.btn_restart.onRelease = function () {
owner.Reset();
owner._parent.play();
};
_parent.pauseClip.btn_mainmenu.onRelease = function () {
owner.Reset();
owner._parent.gotoAndStop("mainmenu");
};
_parent.pauseClip.btn_premium.onRelease = function () {
this.getURL(_root.urlname, "_blank");
};
popup_mc.btn_ok.onRollOver = function () {
this.gotoAndStop(2);
};
popup_mc.btn_ok.onRollOut = (popup_mc.btn_ok.onReleaseOutside = function () {
this.gotoAndStop(1);
});
chocolate_container.mc.type_triangle.onRollOver = (chocolate_container.mc.type_round.onRollOver = (chocolate_container.mc.type_box.onRollOver = function () {
owner.keyTarget = this._name;
owner.chocolate_container.mc.type_triangle.gotoAndStop(1);
owner.chocolate_container.mc.type_round.gotoAndStop(1);
owner.chocolate_container.mc.type_box.gotoAndStop(1);
this.gotoAndStop(2);
}));
chocolate_container.mc.type_triangle.onRelease = (chocolate_container.mc.type_round.onRelease = (chocolate_container.mc.type_box.onRelease = function () {
owner.infoClip._visible = false;
owner.chocolateClip._visible = true;
owner.chocolateClip.gotoAndStop(this._name);
owner.chocolateClip.mc.gotoAndPlay(1);
owner.intervalstatus = "chocolateready";
owner.isTargetReached = true;
if (owner.salesGirl.chocolateCount == 0) {
owner.preferred_chocolate1 = this._name;
} else if (owner.salesGirl.chocolateCount == 1) {
owner.preferred_chocolate2 = this._name;
}
owner.preparecnt = 0;
owner.process_interval = setInterval(owner.IdleProcess, 100, owner);
owner.chocolate_container.gotoAndStop(2);
owner.machineshake = "onn";
owner.keyTarget = "choco_machines";
if (_global.soundstat == "onn") {
_root.choco_producing_Sound.start();
}
}));
chocolate_container.mc.btn_close.onRelease = function () {
owner.machineStatus = "ready";
owner.chocolate_container._visible = false;
owner.isPopup = false;
owner.keyTarget = "choco_machines";
};
reportMc.btn_continue.onRelease = function () {
owner.Reset();
_global.calenderfrom = "game";
owner._parent.gotoAndStop("calender");
};
popup_mc.btn_ok.onRelease = function () {
if (owner.popup_info == "welcome") {
owner.popupDisable();
owner.popup_info = "chocolate_machine_intro";
owner.choco_machines._visible = true;
owner.choco_machines.gotoAndStop(1);
owner.choco_machines.single_machine.intro.gotoAndPlay(1);
_global.popupText = "This is the BOXED CHOCOLATE machine. It produces round, square and triangle shaped chocolates.";
owner.popup_interval = setInterval(owner.ShowPopup, 4000, owner);
} else if (owner.popup_info == "chocolate_machine_intro") {
owner.popupDisable();
owner.popup_info = "serve_start";
owner.dusbin._visible = true;
owner.choco_machines.single_machine.gotoAndStop(2);
owner.dusbin.dusbin_intro.gotoAndPlay(1);
_global.popupText = "What happens if you make a mistake? No worries, just throw the unwanted chocolate to the TRASH BIN. Ready to start?";
owner.popup_interval = setInterval(owner.ShowPopup, 4000, owner);
} else if (owner.popup_info == "serve_start") {
owner.popupDisable();
owner.popup_info = "";
var _local2 = owner.getRandom(0, 2);
owner.customerEnterInterval = setInterval(owner.CallCustomer, 2000, owner, owner.lobbyArr[_local2]);
owner.isPopup = false;
owner.popup_info = "level1_start";
owner.bg.gotoAndStop(2);
owner.btn_pasue._visible = true;
owner.shopopenClip._visible = true;
owner.shopopenClip.gotoAndPlay(1);
owner.infoClip._visible = true;
owner.infoClip.gotoAndStop(2);
owner.infoClip.info.text = "Learn the basics. Click on the customer to hand her a MENU.";
owner.btn_pause._visible = true;
} else if (owner.popup_info == "order") {
owner.popupDisable();
owner.isPopup = false;
owner.popup_info = "";
owner.selectClip._visible = true;
owner.selectClip._x = owner.choco_machines._x;
owner.selectClip._y = owner.choco_machines._y - 80;
owner.btn_pause._visible = true;
} else if (owner.popup_info == "mismatch") {
owner.popupDisable();
owner.isPopup = false;
owner.btn_pause._visible = true;
}
};
}
function shopperMovement() {
var _local3 = (salesGirl._x + salesGirl.pointer._x) - targetclip._x;
var _local2 = (salesGirl._y + salesGirl.pointer._y) - targetclip._y;
var _local5 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
var _local4 = 10;
if (_local5 > _local4) {
salesGirl._x = salesGirl._x + (Math.cos(radian) * 12);
salesGirl._y = salesGirl._y + (Math.sin(radian) * 12);
} else if (!isTargetReached) {
isTargetReached = true;
salesGirl.gotoAndStop(targetDirection);
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
Manipulate();
updateScore();
}
}
function updateInfo(_arg1) {
clearInterval(_arg1.infointerval);
_arg1.infoClip._visible = true;
_arg1.infoClip.gotoAndStop(2);
_arg1.infoClip.info.text = "Nice! She wants a round box of chocolate. Click on the BOXED CHOCOLATE MACHINE and select the round box of chocolate to produce it.";
_arg1.selectClip._visible = true;
_arg1.selectClip._x = _arg1.choco_machines._x;
_arg1.selectClip._y = _arg1.choco_machines._y - 80;
}
function calculateAngle(mc) {
if (!isPopup) {
targetclip = mc;
var x_diff = (eval (mc)._x - (salesGirl._x + salesGirl.pointer._x));
var y_diff = (eval (mc)._y - (salesGirl._y + salesGirl.pointer._y));
radian = Math.atan2(y_diff, x_diff);
if (Math.abs(x_diff) > Math.abs(y_diff)) {
if (x_diff > 0) {
targetDirection = "right";
} else {
targetDirection = "left";
}
} else if (y_diff > 0) {
targetDirection = "down";
} else {
targetDirection = "up";
}
if (curtarget != selectedTarget) {
curtarget = selectedTarget;
salesGirl.gotoAndStop(targetDirection);
salesGirl.girlwalk.gotoAndStop(girlwalkframe - 1);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
}
}
}
function ShowPopup(_arg1) {
clearInterval(_arg1.popup_interval);
_arg1.btn_pause._visible = false;
_arg1.isPopup = true;
_arg1.popup_mc._visible = true;
_arg1.popup_mc.swapDepths(_arg1.getNextHighestDepth());
_arg1.popup_mc.gotoAndPlay(1);
}
function popupDisable() {
popup_mc.gotoAndStop(1);
popup_mc._visible = false;
}
function CallCustomer(_arg1, _arg2) {
if (!_arg1.isPaused) {
clearInterval(_arg1.customerEnterInterval);
_arg1.selectClip._visible = true;
_arg1.customerEnter(_arg2);
}
}
function CallCustomer2(owner, lobby) {
if (!owner.isPaused) {
clearInterval(owner.customerEnterInterval2);
owner.customerEnter(lobby);
owner.selectClip._visible = true;
owner.selectClip._x = eval ("owner.orderbook" + owner.rantable1)._x - 20;
owner.selectClip._y = eval ("owner.orderbook" + owner.rantable1)._y - 80;
owner.infoClip._visible = true;
owner.infoClip.gotoAndStop(2);
owner.infoClip.info.text = "Excellent! Let\u2019s learn how to make COMBOS. Click on the next customer to hand her a MENU.";
}
}
function customerEnter(_arg2) {
if (_arg2 == 1) {
table1._visible = true;
customer1 = attachMovie("younglady", "younglady1", depthArr[_arg2 - 1], {_x:115, _y:356});
orderbook1 = attachMovie("orderbook", "orderbook1", getNextHighestDepth(), {_x:170, _y:374});
orderbook1.type = "book";
selectClip._x = orderbook1._x - 20;
selectClip._y = orderbook1._y - 80;
} else if (_arg2 == 2) {
table2._visible = true;
customer2 = attachMovie("younglady", "younglady2", depthArr[_arg2 - 1], {_x:119, _y:235});
orderbook2 = attachMovie("orderbook", "orderbook2", getNextHighestDepth(), {_x:177, _y:278});
orderbook2.type = "book";
selectClip._x = orderbook2._x - 20;
selectClip._y = orderbook2._y - 80;
} else if (_arg2 == 3) {
table3._visible = true;
customer3 = attachMovie("younglady", "younglady3", depthArr[_arg2 - 1], {_x:127, _y:140});
orderbook3 = attachMovie("orderbook", "orderbook3", getNextHighestDepth(), {_x:184, _y:185});
orderbook3.type = "book";
selectClip._x = orderbook3._x - 20;
selectClip._y = orderbook3._y - 80;
}
customerCount++;
salesGirl.swapDepths(getNextHighestDepth());
infoClip.swapDepths(getNextHighestDepth());
selectClip.swapDepths(getNextHighestDepth());
scoreIndicateClip.swapDepths(getNextHighestDepth());
chocolate_container.swapDepths(getNextHighestDepth());
comboClip.swapDepths(getNextHighestDepth());
reportMc.swapDepths(getNextHighestDepth());
}
function Manipulate() {
var owner = this;
if (selectedTarget == "choco_machines") {
choco_machines.pointer._visible = false;
if (orderTaken <= 0) {
cancel_mc._visible = true;
cancel_mc._x = choco_machines._x + 100;
cancel_mc._y = choco_machines._y + 100;
cancel_mc.gotoAndPlay(1);
} else if (salesGirl.chocolateCount < orderTaken) {
if (intervalstatus == "chocolateready") {
intervalstatus = "empty";
salesGirl.chocolateCount++;
chocolateClip._visible = false;
salesGirl.gotoAndStop(2);
if ((orderTaken == 1) && (iscorrectChocolateChoose)) {
infoClip._visible = true;
owner.infoClip.gotoAndStop(3);
infoClip.info.text = "Take the chocolate to the customer!";
selectClip._visible = true;
selectClip._x = eval ("this.orderbook" + selectedTable)._x - 20;
selectClip._y = eval ("this.orderbook" + selectedTable)._y - 80;
} else if (((orderTaken == 2) && (iscorrectChocolateChoose)) && (salesGirl.chocolateCount == 1)) {
infoClip._visible = true;
owner.infoClip.gotoAndStop(2);
infoClip.info.text = "Good! Now click on the BOXED CHOCOLATE MACHINE again to produce another box.";
selectClip._visible = true;
selectClip._x = choco_machines._x;
selectClip._y = choco_machines._y - 80;
} else if (!iscorrectChocolateChoose) {
infoClip._visible = true;
owner.infoClip.gotoAndStop(3);
infoClip.info.text = "Take it to the TRASH BIN!";
selectClip._visible = true;
selectClip._x = dusbin._x - 50;
selectClip._y = dusbin._y - 100;
} else {
infoClip._visible = false;
selectClip._visible = true;
selectClip._x = eval ("this.orderbook" + rantable1)._x - 20;
selectClip._y = eval ("this.orderbook" + rantable1)._y - 80;
}
girlwalkframe = salesGirl.chocolateCount * 4;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
if ((orderbook1.neededchocolate == preferred_chocolate1) || (orderbook1.neededchocolate == preferred_chocolate2)) {
orderbook1.green_highlight._visible = true;
}
if ((orderbook2.neededchocolate == preferred_chocolate1) || (orderbook2.neededchocolate == preferred_chocolate2)) {
orderbook2.green_highlight._visible = true;
}
if ((orderbook3.neededchocolate == preferred_chocolate1) || (orderbook3.neededchocolate == preferred_chocolate2)) {
orderbook3.green_highlight._visible = true;
}
} else if ((!iscorrectChocolateChoose) && (salesGirl.chocolateCount >= 1)) {
cancel_mc._visible = true;
cancel_mc._x = choco_machines._x + 100;
cancel_mc._y = choco_machines._y + 100;
cancel_mc.gotoAndPlay(1);
} else if (eval ("this.orderbook" + selectedTable).type == "money") {
cancel_mc._visible = true;
cancel_mc._x = choco_machines._x + 100;
cancel_mc._y = choco_machines._y + 100;
cancel_mc.gotoAndPlay(1);
} else {
chocolate_container._visible = true;
chocolate_container.gotoAndStop(1);
chocolate_container.mc.gotoAndPlay(1);
machineStatus = "notready";
isPopup = true;
keyTarget = "type_round";
}
} else {
cancel_mc._visible = true;
cancel_mc._x = choco_machines._x + 100;
cancel_mc._y = choco_machines._y + 100;
cancel_mc.gotoAndPlay(1);
}
} else if (selectedTarget == "dusbin") {
dusbin.pointer._visible = false;
if (orderTaken <= 0) {
cancel_mc._visible = true;
cancel_mc._x = dusbin._x + 25;
cancel_mc._y = dusbin._y + 50;
cancel_mc.gotoAndPlay(1);
} else if (orderTaken == 1) {
if (salesGirl.chocolateCount >= 1) {
if (eval ("owner.customer" + owner.selectedTable).neededchocolate != owner.preferred_chocolate1) {
iscorrectChocolateChoose = true;
salesGirl.chocolateCount--;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
selectClip._visible = true;
selectClip._x = choco_machines._x;
selectClip._y = choco_machines._y - 80;
} else {
cancel_mc._visible = true;
cancel_mc._x = dusbin._x + 25;
cancel_mc._y = dusbin._y + 50;
cancel_mc.gotoAndPlay(1);
}
} else {
cancel_mc._visible = true;
cancel_mc._x = dusbin._x + 25;
cancel_mc._y = dusbin._y + 50;
cancel_mc.gotoAndPlay(1);
}
} else if (orderTaken == 2) {
if (salesGirl.chocolateCount == 2) {
if ((eval ("owner.customer" + owner.selectedTable).neededchocolate != owner.preferred_chocolate1) || (eval ("owner.customer" + owner.selectedTable).neededchocolate != owner.preferred_chocolate2)) {
iscorrectChocolateChoose = true;
salesGirl.chocolateCount--;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
selectClip._visible = true;
selectClip._x = choco_machines._x;
selectClip._y = choco_machines._y - 80;
} else {
cancel_mc._visible = true;
cancel_mc._x = dusbin._x + 25;
cancel_mc._y = dusbin._y + 50;
cancel_mc.gotoAndPlay(1);
}
} else if (salesGirl.chocolateCount == 1) {
if (eval ("owner.customer" + owner.selectedTable).neededchocolate != owner.preferred_chocolate1) {
iscorrectChocolateChoose = true;
salesGirl.chocolateCount--;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
selectClip._visible = true;
selectClip._x = choco_machines._x;
selectClip._y = choco_machines._y - 80;
} else {
cancel_mc._visible = true;
cancel_mc._x = dusbin._x + 25;
cancel_mc._y = dusbin._y + 50;
cancel_mc.gotoAndPlay(1);
}
} else {
cancel_mc._visible = true;
cancel_mc._x = dusbin._x + 25;
cancel_mc._y = dusbin._y + 50;
cancel_mc.gotoAndPlay(1);
}
}
} else if (((selectedTarget == "table1") || (selectedTarget == "table2")) || (selectedTarget == "table3")) {
eval ("this.orderbook" + selectedTable).pointer._visible = false;
if (eval ("this.orderbook" + selectedTable).type == "book") {
eval ("this.orderbook" + selectedTable).type = "chocolateOrder";
eval ("this.orderbook" + selectedTable).neededchocolate = "type_round";
eval ("this.customer" + selectedTable).neededchocolate = "type_round";
eval ("this.orderbook" + selectedTable).gotoAndStop(2);
eval ("this.customer" + selectedTable).gotoAndStop(3);
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable).green_highlight._visible = false;
selectClip._visible = false;
infoClip._visible = false;
orderTaken++;
trace((("order=" + rantable1) + ", ") + rantable2);
if (orderTaken == 1) {
score = score + 2;
if (popup_info != "level1_start") {
infoClip._visible = true;
owner.infoClip.gotoAndStop(3);
infoClip.info.text = "Then click on the other customer to make a COMBO.";
selectClip._visible = true;
if (rantable2 != selectedTable) {
selectClip._x = eval ("owner.orderbook" + rantable2)._x - 20;
selectClip._y = eval ("owner.orderbook" + rantable2)._y - 80;
}
} else if (popup_info == "level1_start") {
owner.machineStatus = "notready";
choco_interval = setInterval(ReadyToGetChocolate, 3000, this);
popup_info = "";
owner.ismoveready = true;
owner.dusbinStatus = "ready";
}
if (_global.soundstat == "onn") {
_root.combo1_Sound.start();
}
} else if (orderTaken == 2) {
infoClip._visible = true;
owner.infoClip.gotoAndStop(1);
infoClip.info.text = "Well done! Let\u2019s make another COMBO. Click on the BOXED CHOCOLATE MACHINE to produce a round box of chocolate.";
score = score + 4;
machineStatus = "ready";
dusbinStatus = "ready";
owner.selectClip._visible = true;
owner.selectClip._x = owner.choco_machines._x;
owner.selectClip._y = owner.choco_machines._y - 80;
comboClip._x = eval ("this.customer" + selectedTable)._x - 20;
comboClip._y = eval ("this.customer" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop("two");
comboClip.combo.gotoAndPlay(1);
if (_global.soundstat == "onn") {
_root.combo2_Sound.start();
}
}
} else if (eval ("this.orderbook" + selectedTable).type == "chocolateOrder") {
if (salesGirl.chocolateCount >= 1) {
if (orderTaken == 1) {
if (eval ("owner.customer" + owner.selectedTable).neededchocolate != owner.preferred_chocolate1) {
cancel_mc._visible = true;
cancel_mc.swapDepths(getNextHighestDepth());
cancel_mc._x = eval ("this.orderbook" + selectedTable)._x + 40;
cancel_mc._y = eval ("this.orderbook" + selectedTable)._y + 30;
cancel_mc.gotoAndPlay(1);
} else {
if (!isFirstServeFinished) {
score = score + 10;
} else {
score = score + 20;
}
salesGirl.chocolateCount--;
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
eval ("this.orderbook" + selectedTable).type = "money";
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable).gotoAndStop(3);
eval ("this.customer" + selectedTable).gotoAndStop(5);
infoClip._visible = true;
owner.infoClip.gotoAndStop(3);
infoClip.info.text = "Great! Now collect the money on the counter!";
selectClip._visible = true;
selectClip._x = eval ("this.orderbook" + selectedTable)._x - 20;
selectClip._y = eval ("this.orderbook" + selectedTable)._y - 80;
if (_global.soundstat == "onn") {
_root.combo1_Sound.start();
}
if (_global.soundstat == "onn") {
_root.customer_happy_Sound.start();
}
}
} else if ((orderTaken == 2) && (owner.salesGirl.chocolateCount == 2)) {
if ((eval ("owner.customer" + owner.selectedTable).neededchocolate != owner.preferred_chocolate1) || (eval ("owner.customer" + owner.selectedTable).neededchocolate != owner.preferred_chocolate2)) {
cancel_mc._visible = true;
cancel_mc.swapDepths(getNextHighestDepth());
cancel_mc._x = eval ("this.orderbook" + selectedTable)._x + 40;
cancel_mc._y = eval ("this.orderbook" + selectedTable)._y + 30;
cancel_mc.gotoAndPlay(1);
} else {
girlwalkframe = girlwalkframe / 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
eval ("this.orderbook" + selectedTable).type = "money";
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(1);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable).gotoAndStop(3);
eval ("this.customer" + selectedTable).gotoAndStop(5);
infoClip._visible = true;
if (infoClip.info.text == "Great! Now give the second box to the next customer.") {
comboClip._x = eval ("this.customer" + selectedTable)._x - 20;
comboClip._y = eval ("this.customer" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop("two");
comboClip.combo.gotoAndPlay(1);
score = score + 20;
owner.infoClip.gotoAndStop(1);
infoClip.info.text = "Well done! You can gain COMBO bonuses by doing similar actions in a row. Collect the money and you have accomplished the first level.";
} else {
score = score + 10;
owner.infoClip.gotoAndStop(3);
infoClip.info.text = "Great! Now give the second box to the next customer.";
if (eval ("this.orderbook" + rantable2).type != "money") {
selectClip._visible = true;
selectClip._x = eval ("this.orderbook" + rantable2)._x - 20;
selectClip._y = eval ("this.orderbook" + rantable2)._y - 80;
}
}
if (_global.soundstat == "onn") {
_root.combo2_Sound.start();
}
if (_global.soundstat == "onn") {
_root.customer_happy_Sound.start();
}
}
} else {
cancel_mc._visible = true;
cancel_mc.swapDepths(getNextHighestDepth());
cancel_mc._x = eval ("this.orderbook" + selectedTable)._x + 40;
cancel_mc._y = eval ("this.orderbook" + selectedTable)._y + 30;
cancel_mc.gotoAndPlay(1);
}
}
} else if (eval ("this.orderbook" + selectedTable).type == "money") {
if (orderTaken == 1) {
orderTaken--;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(2);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable)._visible = false;
eval ("this.customer" + selectedTable)._visible = false;
eval ("this.table" + selectedTable)._visible = false;
eval ("this.orderbook" + selectedTable).type = "empty";
owner.selectClip._visible = false;
if (orderTaken == 0) {
salesGirl.chocolateCount = 0;
girlwalkframe = 2;
salesGirl.girlwalk.gotoAndStop(girlwalkframe);
salesGirl.girlwalk.chocobox1.gotoAndStop(preferred_chocolate1);
salesGirl.girlwalk.chocobox2.gotoAndStop(preferred_chocolate2);
if (!isFirstServeFinished) {
if (_global.soundstat == "onn") {
_root.money1_Sound.start();
}
score = score + 27;
isFirstServeFinished = true;
owner.selectClip._visible = false;
owner.table2._visible = (owner.table3._visible = false);
owner.table1._visible = false;
var randomno = owner.getRandom(0, owner.lobbyArr.length - 1);
owner.customerEnterInterval = setInterval(owner.CallCustomer, 2000, owner, owner.lobbyArr[randomno]);
var tab1 = owner.lobbyArr[randomno];
customerOrderbook1 = tab1;
owner.lobbyArr.splice(randomno, 1);
var randomno = owner.getRandom(0, owner.lobbyArr.length - 1);
owner.customerEnterInterval2 = setInterval(owner.CallCustomer2, 2500, owner, owner.lobbyArr[randomno]);
var tab2 = owner.lobbyArr[randomno];
customerOrderbook2 = tab2;
owner.lobbyArr.splice(randomno, 1);
if (tab1 > tab2) {
rantable1 = tab1;
rantable2 = tab2;
} else {
rantable1 = tab2;
rantable2 = tab1;
}
infoClip._visible = false;
machineStatus = "notready";
dusbinStatus = "notready";
} else {
if (_global.soundstat == "onn") {
_root.money2_Sound.start();
}
comboClip._x = eval ("this.orderbook" + selectedTable)._x - 20;
comboClip._y = eval ("this.orderbook" + selectedTable)._y + 20;
comboClip._visible = true;
comboClip.gotoAndStop("two");
comboClip.combo.gotoAndPlay(1);
score = score + 54;
machineStatus = "notready";
isPopup = true;
_global.report_moneyEarned = 120;
_global.report_tips = 36;
if (_global.levelSelected < 2) {
_global.levelSelected = 2;
}
if (_global.levelFinished <= 1) {
_global.levelFinished = 1;
}
_global.level1Score = score;
_global.level1Status = "expert";
btn_pause._visible = false;
dusbinStatus = "notready";
reportMc._visible = true;
reportMc.gotoAndPlay(2);
infoClip._visible = false;
if (_global.soundstat == "onn") {
_root.level_complete_Sound.start();
}
}
}
} else if (orderTaken == 2) {
if ((eval ("this.orderbook" + customerOrderbook1).type == "money") && (eval ("this.orderbook" + customerOrderbook2).type == "money")) {
selectClip._visible = false;
score = score + 27;
orderTaken--;
salesGirl.chocolateCount--;
eval ("this.coin_Anim" + selectedTable)._visible = true;
eval ("this.coin_Anim" + selectedTable).gotoAndStop(2);
eval ("this.coin_Anim" + selectedTable).coin.gotoAndPlay(1);
eval ("this.orderbook" + selectedTable)._visible = false;
eval ("this.customer" + selectedTable)._visible = false;
eval ("this.orderbook" + selectedTable).type = "empty";
if (_global.soundstat == "onn") {
_root.money1_Sound.start();
}
} else {
cancel_mc._visible = true;
cancel_mc.swapDepths(getNextHighestDepth());
cancel_mc._x = eval ("this.orderbook" + selectedTable)._x + 40;
cancel_mc._y = eval ("this.orderbook" + selectedTable)._y + 30;
cancel_mc.gotoAndPlay(1);
}
selectClip._visible = true;
if (rantable2 != selectedTable) {
selectClip._x = eval ("owner.orderbook" + rantable2)._x - 20;
selectClip._y = eval ("owner.orderbook" + rantable2)._y - 80;
} else {
selectClip._x = eval ("owner.orderbook" + rantable1)._x - 20;
selectClip._y = eval ("owner.orderbook" + rantable1)._y - 80;
}
}
}
}
}
function ReadyToGetChocolate(_arg1) {
clearInterval(_arg1.choco_interval);
_arg1.machineStatus = "ready";
_arg1.infoClip._visible = true;
_arg1.infoClip.gotoAndStop(1);
_arg1.infoClip.info.text = "Nice! She wants a round box of chocolate. Click on the BOXED CHOCOLATE MACHINE and select the round box of chocolate to produce it.";
_arg1.selectClip._visible = true;
_arg1.selectClip._x = _arg1.choco_machines._x;
_arg1.selectClip._y = _arg1.choco_machines._y - 80;
}
function IdleProcess(owner) {
if (!owner.isPaused) {
owner.preparecnt++;
if (owner.preparecnt >= 20) {
clearInterval(owner.process_interval);
if (owner.intervalstatus == "chocolateready") {
owner.machineshake = "off";
owner.machineStatus = "ready";
owner.isPopup = false;
if (_global.soundstat == "onn") {
_root.choco_done_Sound.start();
}
if (owner.orderTaken == 1) {
if (eval ("owner.customer" + owner.selectedTable).neededchocolate != owner.preferred_chocolate1) {
owner.iscorrectChocolateChoose = false;
owner.popup_info = "mismatch";
_global.popupText = "Oops! You need to make a ROUND box of chocolate. Click on the chocolate to pick it up and then take it to the TRASH BIN!";
owner.ShowPopup(owner);
} else {
owner.iscorrectChocolateChoose = true;
owner.infoClip._visible = true;
owner.infoClip.gotoAndStop(2);
owner.infoClip.info.text = "Great! Now click on the BOXED CHOCOLATE MACHINE to pick up the chocolate.";
}
} else if (owner.orderTaken == 2) {
if (owner.salesGirl.chocolateCount == 0) {
if (eval ("owner.customer" + owner.selectedTable).neededchocolate != owner.preferred_chocolate1) {
owner.iscorrectChocolateChoose = false;
owner.popup_info = "mismatch";
_global.popupText = "Oops! You need to make a ROUND box of chocolate. Click on the chocolate to pick it up and then take it to the TRASH BIN!";
owner.ShowPopup(owner);
} else {
owner.iscorrectChocolateChoose = true;
owner.infoClip._visible = true;
owner.infoClip.gotoAndStop(3);
owner.infoClip.info.text = "Great! Pick up the round box of chocolate.";
}
} else if (owner.salesGirl.chocolateCount == 1) {
if ((eval ("owner.customer" + owner.selectedTable).neededchocolate != owner.preferred_chocolate1) || (eval ("owner.customer" + owner.selectedTable).neededchocolate != owner.preferred_chocolate2)) {
owner.iscorrectChocolateChoose = false;
owner.popup_info = "mismatch";
_global.popupText = "Oops! You need to make a ROUND box of chocolate. Click on the chocolate to pick it up and then take it to the TRASH BIN!";
owner.ShowPopup(owner);
} else {
owner.iscorrectChocolateChoose = true;
owner.infoClip._visible = true;
owner.infoClip.gotoAndStop(2);
owner.infoClip.info.text = "Nice! Pick up the second box and take the boxes to the customers.";
owner.selectClip._visible = true;
owner.selectClip._x = owner.choco_machines._x;
owner.selectClip._y = owner.choco_machines._y - 80;
}
}
}
}
}
}
}
function getRandom(_arg4, _arg5) {
var _local3 = _arg5 - _arg4;
var _local2 = Math.random() * _local3;
var _local1 = Math.round(_local2);
_local1 = _local1 + _arg4;
return(_local1);
}
function CallPause() {
var _local2 = this;
stopAllSounds();
_local2.bg.blink.gotoAndStop(_local2.bg.blink._currentframe);
_local2.customer1.customer.gotoAndStop(_local2.customer1.customer._currentframe);
_local2.customer2.customer.gotoAndStop(_local2.customer2.customer._currentframe);
_local2.customer3.customer.gotoAndStop(_local2.customer3.customer._currentframe);
_local2.special_choco_machines.machine1.blink.gotoAndStop(_local2.special_choco_machines.machine1.blink._currentframe);
_local2.choco_machines.single_machine.blink.gotoAndStop(_local2.choco_machines.single_machine.blink._currentframe);
_local2.salesGirl.coffeeicon.smoke.gotoAndStop(_local2.salesGirl.coffeeicon.smoke._currentframe);
_local2.customer4.customer.gotoAndStop(_local2.customer4.customer._currentframe);
_local2.coin_Anim1.coin.gotoAndStop(_local2.coin_Anim1.coin._currentframe);
_local2.coin_Anim2.coin.gotoAndStop(_local2.coin_Anim2.coin._currentframe);
_local2.coin_Anim3.coin.gotoAndStop(_local2.coin_Anim3.coin._currentframe);
_local2.coin_Anim4.coin.gotoAndStop(_local2.coin_Anim4.coin._currentframe);
_local2.comboClip.combo.gotoAndStop(_local2.comboClip.combo._currentframe);
_local2.orderbook1.heartinClip.gotoAndStop(_local2.orderbook1.heartinClip._currentframe);
_local2.orderbook2.heartinClip.gotoAndStop(_local2.orderbook2.heartinClip._currentframe);
_local2.orderbook3.heartinClip.gotoAndStop(_local2.orderbook3.heartinClip._currentframe);
_local2.orderbook4.heartinClip.gotoAndStop(_local2.orderbook4.heartinClip._currentframe);
_local2.curScoreClip.gotoAndStop(_local2.curScoreClip._currentframe);
_local2.coin_Anim1.coin.coin_rotate.gotoAndStop(_local2.coin_Anim1.coin.coin_rotate._currentframe);
_local2.coin_Anim1.coin.coin_rotate2.gotoAndStop(_local2.coin_Anim1.coin.coin_rotate2._currentframe);
_local2.coin_Anim1.coin.coin_rotate3.gotoAndStop(_local2.coin_Anim1.coin.coin_rotate3._currentframe);
_local2.coin_Anim1.coin.coin_rotate4.gotoAndStop(_local2.coin_Anim1.coin.coin_rotate4._currentframe);
_local2.coin_Anim2.coin.coin_rotate.gotoAndStop(_local2.coin_Anim2.coin.coin_rotate._currentframe);
_local2.coin_Anim2.coin.coin_rotate2.gotoAndStop(_local2.coin_Anim2.coin.coin_rotate2._currentframe);
_local2.coin_Anim2.coin.coin_rotate3.gotoAndStop(_local2.coin_Anim2.coin.coin_rotate3._currentframe);
_local2.coin_Anim2.coin.coin_rotate4.gotoAndStop(_local2.coin_Anim2.coin.coin_rotate4._currentframe);
_local2.coin_Anim3.coin.coin_rotate.gotoAndStop(_local2.coin_Anim3.coin.coin_rotate._currentframe);
_local2.coin_Anim3.coin.coin_rotate2.gotoAndStop(_local2.coin_Anim3.coin.coin_rotate2._currentframe);
_local2.coin_Anim3.coin.coin_rotate3.gotoAndStop(_local2.coin_Anim3.coin.coin_rotate3._currentframe);
_local2.coin_Anim3.coin.coin_rotate4.gotoAndStop(_local2.coin_Anim3.coin.coin_rotate4._currentframe);
_local2.coin_Anim4.coin.coin_rotate.gotoAndStop(_local2.coin_Anim4.coin.coin_rotate._currentframe);
_local2.coin_Anim4.coin.coin_rotate2.gotoAndStop(_local2.coin_Anim4.coin.coin_rotate2._currentframe);
_local2.coin_Anim4.coin.coin_rotate3.gotoAndStop(_local2.coin_Anim4.coin.coin_rotate3._currentframe);
_local2.coin_Anim4.coin.coin_rotate4.gotoAndStop(_local2.coin_Anim4.coin.coin_rotate4._currentframe);
_local2.comboClip.combo.coin_rotate.gotoAndStop(_local2.comboClip.combo.coin_rotate._currentframe);
_local2.chocolateClip.mc.gotoAndStop(_local2.chocolateClip.mc._currentframe);
_local2.selectClip.gotoAndStop(_local2.selectClip._currentframe);
}
function CallResume() {
var _local4 = this;
if (_global.soundstat == "onn") {
_root.gameSound.start();
}
_local4.bg.blink.gotoAndPlay(_local4.bg.blink._currentframe);
_local4.customer1.customer.gotoAndPlay(_local4.customer1.customer._currentframe);
_local4.customer2.customer.gotoAndPlay(_local4.customer2.customer._currentframe);
_local4.customer3.customer.gotoAndPlay(_local4.customer3.customer._currentframe);
_local4.special_choco_machines.machine1.blink.gotoAndPlay(_local4.special_choco_machines.machine1.blink._currentframe);
_local4.choco_machines.single_machine.blink.gotoAndPlay(_local4.choco_machines.single_machine.blink._currentframe);
_local4.salesGirl.coffeeicon.smoke.gotoAndPlay(_local4.salesGirl.coffeeicon.smoke._currentframe);
_local4.customer4.customer.gotoAndPlay(_local4.customer4.customer._currentframe);
_local4.coin_Anim1.coin.gotoAndPlay(_local4.coin_Anim1.coin._currentframe - 1);
_local4.coin_Anim2.coin.gotoAndPlay(_local4.coin_Anim2.coin._currentframe - 1);
_local4.coin_Anim3.coin.gotoAndPlay(_local4.coin_Anim3.coin._currentframe - 1);
_local4.coin_Anim4.coin.gotoAndPlay(_local4.coin_Anim4.coin._currentframe - 1);
_local4.comboClip.combo.gotoAndPlay(_local4.comboClip.combo._currentframe - 1);
_local4.orderbook1.heartinClip.gotoAndPlay(_local4.orderbook1.heartinClip._currentframe - 1);
_local4.orderbook2.heartinClip.gotoAndPlay(_local4.orderbook2.heartinClip._currentframe - 1);
_local4.orderbook3.heartinClip.gotoAndPlay(_local4.orderbook3.heartinClip._currentframe - 1);
_local4.orderbook4.heartinClip.gotoAndPlay(_local4.orderbook4.heartinClip._currentframe - 1);
_local4.curScoreClip.gotoAndPlay(_local4.curScoreClip._currentframe);
_local4.coin_Anim1.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate._currentframe);
_local4.coin_Anim1.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate2._currentframe);
_local4.coin_Anim1.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate3._currentframe);
_local4.coin_Anim1.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim1.coin.coin_rotate4._currentframe);
_local4.coin_Anim2.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate._currentframe);
_local4.coin_Anim2.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate2._currentframe);
_local4.coin_Anim2.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate3._currentframe);
_local4.coin_Anim2.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim2.coin.coin_rotate4._currentframe);
_local4.coin_Anim3.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate._currentframe);
_local4.coin_Anim3.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate2._currentframe);
_local4.coin_Anim3.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate3._currentframe);
_local4.coin_Anim3.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim3.coin.coin_rotate4._currentframe);
_local4.coin_Anim4.coin.coin_rotate.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate._currentframe);
_local4.coin_Anim4.coin.coin_rotate2.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate2._currentframe);
_local4.coin_Anim4.coin.coin_rotate3.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate3._currentframe);
_local4.coin_Anim4.coin.coin_rotate4.gotoAndPlay(_local4.coin_Anim4.coin.coin_rotate4._currentframe);
_local4.comboClip.combo.coin_rotate.gotoAndPlay(_local4.comboClip.combo.coin_rotate._currentframe);
_local4.chocolateClip.mc.gotoAndPlay(_local4.chocolateClip.mc._currentframe - 1);
_local4.selectClip.gotoAndPlay(_local4.selectClip._currentframe);
}
function ObjectsRollOut() {
table1.onRollOut();
table2.onRollOut();
table3.onRollOut();
choco_machines.onRollOut();
dusbin.onRollOut();
}
function Reset() {
targetclip = "table1";
lobbyArr.length = 0;
lobbyArr = new Array(1, 2, 3);
currentDirection = "down";
targetDirection = "";
isPopup = false;
popup_info = "welcome";
clearInterval(popup_interval);
clearInterval(process_interval);
clearInterval(customerEnterInterval);
clearInterval(customerEnterInterval2);
popup_interval = -1;
isTargetReached = true;
selectedTarget = "";
orderno = 0;
score = 0;
ismoveready = false;
Key.removeListener(keylistener);
Key.removeListener(leve1Keyobj);
keyTarget = undefined;
infoClip._visible = false;
}
var targetclip = "table1";
var lobbyArr = new Array(1, 2, 3);
var currentDirection = "down";
var isPopup = false;
var popup_info = "welcome";
var popup_interval = -1;
var process_interval = -1;
var isTargetReached = true;
var selectedTarget = "";
var orderno = 0;
var ismoveready = false;
var orderTaken = 0;
var customerCount = 0;
var machineStatus = "notready";
var dusbinStatus = "notready";
var girlwalkframe = 2;
var isFirstServeFinished = false;
var score = 0;
var depthArr = new Array(-10313, -10315, -10317);
var curtarget = "";
var infointerval = -1;
var customerEnterInterval = -1;
var customerEnterInterval2 = -1;
var choco_interval = -1;
var isPaused = false;
var machinespeed = 1;
var machineshake = "off";
var specialmachineshake = "off";
var preparecnt = 0;
}
Symbol 271 Button
on (rollOver) {
hud = true;
}
on (rollOut) {
hud = false;
}
Symbol 274 Button
on (release) {
getURL (_root.urlname, "_blank");
}
Symbol 277 MovieClip Frame 1
stop();
Symbol 277 MovieClip Frame 2
stop();
Symbol 283 MovieClip Frame 1
stop();
Symbol 283 MovieClip Frame 2
stop();
Symbol 287 MovieClip Frame 132
_parent.gotoAndPlay("title");
Symbol 301 MovieClip Frame 1
version_info.text = _root.versionno;
trace(_root.versionno);
Symbol 305 MovieClip Frame 126
_parent.gotoAndPlay("mainmenu");
Symbol 311 MovieClip Frame 1
stop();
Symbol 311 MovieClip Frame 2
stop();
Symbol 319 MovieClip Frame 1
stop();
Symbol 319 MovieClip Frame 2
stop();
Symbol 324 MovieClip Frame 1
stop();
Symbol 324 MovieClip Frame 2
stop();
Symbol 327 Button
on (release) {
getURL (_root.premiumurl, "_blank");
}
Symbol 330 MovieClip Frame 1
function menuNavigation(_arg1) {
btn_play.gotoAndStop(1);
btn_instructions.gotoAndStop(1);
btn_moregames.gotoAndStop(1);
if (_arg1 == 1) {
btn_play.gotoAndStop(2);
} else if (_arg1 == 2) {
btn_moregames.gotoAndStop(2);
}
}
var owner = this;
var cnt = 1;
var maxcnt = 2;
var menuobj = new Object();
Key.addListener(menuobj);
menuNavigation(cnt);
menuobj.onKeyDown = function () {
if (Key.getCode() == 38) {
if (cnt <= 1) {
cnt = maxcnt;
} else {
cnt--;
}
menuNavigation(cnt);
} else if (Key.getCode() == 40) {
if (cnt >= maxcnt) {
cnt = 1;
} else {
cnt++;
}
menuNavigation(cnt);
} else if ((Key.getCode() == 32) || (Key.getCode() == 13)) {
if (cnt == 1) {
Key.removeListener(menuobj);
btn_play.onRelease();
} else if (cnt == 2) {
Key.removeListener(menuobj);
btn_moregames.onRelease();
}
}
};
btn_play.onRollOver = function () {
cnt = 1;
menuNavigation(cnt);
};
btn_play.onRollOut = (btn_play.onReleaseOutside = function () {
btn_play.gotoAndStop(1);
});
btn_moregames.onRollOver = function () {
cnt = 2;
menuNavigation(cnt);
};
btn_moregames.onRollOut = (btn_moregames.onReleaseOutside = function () {
btn_moregames.gotoAndStop(1);
});
btn_play.onRelease = function () {
_root.menuSound.stop();
_global.calenderfrom = "mainmenu";
owner._parent.gotoAndStop("intro");
};
Instance of Symbol 324 MovieClip "btn_moregames" in Symbol 330 MovieClip Frame 1
on (release) {
getURL (_root.urlname, "_blank");
}
Symbol 410 MovieClip Frame 1
function start_play(clip) {
rectw = 700;
recth = 500;
xpos = random(rectw - 5);
ypos = random(recth - 5);
xyscale = random(100) + 100;
eval (clip)._x = xpos;
eval (clip)._rotation = random(10) - 5;
eval (clip)._xscale = xyscale;
eval (clip)._yscale = xyscale;
clip.gotoAndPlay(3);
}
threshold = 28;
num = random(30);
if (threshold < num) {
start_play(this);
}
Symbol 410 MovieClip Frame 2
gotoAndPlay (1);
Symbol 410 MovieClip Frame 3
counter = random(5);
gotoAndPlay("l" + counter);
Symbol 410 MovieClip Frame 133
gotoAndPlay (1);
Symbol 410 MovieClip Frame 327
gotoAndPlay (1);
Symbol 410 MovieClip Frame 449
stop();
gotoAndPlay (1);
Symbol 410 MovieClip Frame 623
stop();
gotoAndPlay (1);
Symbol 412 MovieClip Frame 1
var leafarr = new Array();
var k = 0;
while (k < leafarr.length) {
leafarr[k].removeMovieClip();
k++;
}
i = 1;
while (i < 60) {
duplicateMovieClip ("ani_clip", "ani_clip" + i, 16384 + i);
leafarr.push(eval ("ani_clip" + i));
i++;
}
Symbol 421 MovieClip Frame 1
function start_play(clip) {
rectw = 700;
recth = 500;
xpos = random(rectw - 5);
ypos = random(recth - 5);
xyscale = random(100) + 100;
eval (clip)._x = xpos;
eval (clip)._rotation = random(10) - 5;
eval (clip)._xscale = xyscale;
eval (clip)._yscale = xyscale;
clip.gotoAndPlay(3);
}
threshold = 28;
num = random(30);
if (threshold < num) {
start_play(this);
}
Symbol 421 MovieClip Frame 2
gotoAndPlay (1);
Symbol 421 MovieClip Frame 3
counter = random(20);
gotoAndPlay("l" + counter);
Symbol 421 MovieClip Frame 45
gotoAndPlay (1);
Symbol 422 MovieClip Frame 1
var rainarr = new Array();
var j = 0;
while (j < rainarr.length) {
rainarr[j].removeMovieClip();
j++;
}
i = 1;
while (i < 180) {
duplicateMovieClip ("ani_clip", "ani_clip" + i, 16384 + i);
rainarr.push(eval ("ani_clip" + i));
i++;
}
Symbol 428 MovieClip Frame 15
stop();
Symbol 441 MovieClip Frame 15
stop();
Symbol 448 MovieClip Frame 1
function start_play(clip) {
rectw = 700;
recth = 500;
xpos = random(rectw - 5);
ypos = random(recth - 5);
xyscale = random(100) + 100;
eval (clip)._x = xpos;
eval (clip)._rotation = random(10) - 5;
eval (clip)._xscale = xyscale;
eval (clip)._yscale = xyscale;
clip.gotoAndPlay(3);
}
threshold = 28;
num = random(30);
if (threshold < num) {
start_play(this);
}
Symbol 448 MovieClip Frame 2
gotoAndPlay (1);
Symbol 448 MovieClip Frame 3
counter = random(5);
gotoAndPlay("l" + counter);
Symbol 448 MovieClip Frame 133
gotoAndPlay (1);
Symbol 448 MovieClip Frame 327
gotoAndPlay (1);
Symbol 448 MovieClip Frame 449
stop();
gotoAndPlay (1);
Symbol 448 MovieClip Frame 623
stop();
gotoAndPlay (1);
Symbol 449 MovieClip Frame 1
var leafarr = new Array();
var k = 0;
while (k < leafarr.length) {
leafarr[k].removeMovieClip();
k++;
}
i = 1;
while (i < 30) {
duplicateMovieClip ("ani_clip", "ani_clip" + i, 16384 + i);
leafarr.push(eval ("ani_clip" + i));
i++;
}
Symbol 451 MovieClip Frame 12
stop();
Symbol 453 MovieClip Frame 15
stop();
Symbol 454 MovieClip Frame 20
stop();
Symbol 455 MovieClip Frame 13
stop();
var xScaleT = (new mx.transitions.Tween(sigla, "_y", mx.transitions.easing.Strong.easeOut, 520, 408.9, 1, true));
var mcTween = (new mx.transitions.Tween(box, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, 3, true));
var snowarr = new Array();
var i = 0;
while (i < snowarr.length) {
snowarr[i].removeMovieClip();
i++;
}
k = 0;
while (k < 100) {
duplicateMovieClip (snow, "snow" + k, k);
var eval (undefined) = undefined;
snowarr.push(eval ("snow" + k));
k++;
}
Symbol 456 MovieClip Frame 1
stop();
Symbol 456 MovieClip Frame 2
stop();
Symbol 456 MovieClip Frame 3
stop();
Symbol 456 MovieClip Frame 4
stop();
Symbol 456 MovieClip Frame 5
stop();
Symbol 456 MovieClip Frame 6
stop();
Symbol 456 MovieClip Frame 7
stop();
Symbol 480 MovieClip Frame 1
stop();
Symbol 480 MovieClip Frame 2
stop();
Symbol 485 MovieClip Frame 1
stop();
Symbol 485 MovieClip Frame 2
stop();
Symbol 490 MovieClip Frame 1
stop();
Symbol 490 MovieClip Frame 2
stop();
Symbol 495 MovieClip Frame 1
stop();
Symbol 495 MovieClip Frame 2
stop();
Symbol 503 MovieClip Frame 1
stop();
Symbol 503 MovieClip Frame 2
stop();
Symbol 524 MovieClip Frame 23
stop();
Symbol 538 MovieClip Frame 15
stop();
Symbol 549 MovieClip Frame 15
stop();
Symbol 550 MovieClip Frame 1
stop();
Symbol 550 MovieClip Frame 2
stop();
Symbol 550 MovieClip Frame 3
stop();
Symbol 550 MovieClip Frame 4
stop();
Symbol 571 MovieClip Frame 1
if (_global.levelSelected > 9) {
_global.calenderxPos = -100;
seasonMc.gotoAndStop(2);
} else {
btn_left._visible = false;
}
monthMc._x = _global.calenderxPos;
var total = 0;
var curmc;
var i = 1;
while (i <= 10) {
eval (("monthMc.level" + i) + ".hand_mc")._visible = false;
i++;
}
if (_global.levelFinished == undefined) {
_global.levelSelected = 1;
_global.gotolevel = 1;
_global.levelFinished = 0;
eval (("monthMc.level" + _global.levelSelected) + ".hand_mc")._visible = true;
monthMc.level1.gotoAndStop(2);
} else {
_global.gotolevel = _global.levelSelected;
eval (("monthMc.level" + _global.levelSelected) + ".hand_mc")._visible = true;
eval ("monthMc.level" + _global.levelSelected).gotoAndStop(2);
var i = 1;
while (i <= _global.levelFinished) {
if (eval (("_global.level" + i) + "Status") == "expert") {
eval ("monthMc.level" + i).gotoAndStop(3);
if ((i != _global.levelFinished) && (_global.calenderfrom != "game")) {
eval ("monthMc.level" + i).clip.gotoAndStop(10);
}
} else {
eval ("monthMc.level" + i).gotoAndStop(4);
if ((i != _global.levelFinished) && (_global.calenderfrom != "game")) {
eval ("monthMc.level" + i).clip.gotoAndStop(10);
}
}
eval ("monthMc.level" + i).blink_mc.gotoAndStop(1);
eval ("monthMc.level" + i).score.text = eval (("_global.level" + i) + "Score");
total = total + eval (("_global.level" + i) + "Score");
i++;
}
totalscoreMc.score.text = total;
}
monthMc.level1.onRelease = function () {
eval (("monthMc.level" + _global.gotolevel) + ".hand_mc")._visible = false;
eval ("monthMc.level" + _global.gotolevel).blink_mc.gotoAndStop(1);
monthMc.level1.hand_mc._visible = true;
monthMc.level1.blink_mc.gotoAndPlay(1);
_global.gotolevel = 1;
btn_play.onRelease();
};
monthMc.level2.onRelease = function () {
if (_global.levelFinished >= 1) {
eval (("monthMc.level" + _global.gotolevel) + ".hand_mc")._visible = false;
eval ("monthMc.level" + _global.gotolevel).blink_mc.gotoAndStop(1);
monthMc.level2.hand_mc._visible = true;
monthMc.level2.blink_mc.gotoAndPlay(1);
_global.gotolevel = 2;
btn_play.onRelease();
}
};
monthMc.level3.onRelease = function () {
if (_global.levelFinished >= 2) {
eval (("monthMc.level" + _global.gotolevel) + ".hand_mc")._visible = false;
eval ("monthMc.level" + _global.gotolevel).blink_mc.gotoAndStop(1);
monthMc.level3.hand_mc._visible = true;
monthMc.level3.blink_mc.gotoAndPlay(1);
_global.gotolevel = 3;
btn_play.onRelease();
}
};
monthMc.level4.onRelease = function () {
if (_global.levelFinished >= 3) {
eval (("monthMc.level" + _global.gotolevel) + ".hand_mc")._visible = false;
eval ("monthMc.level" + _global.gotolevel).blink_mc.gotoAndStop(1);
monthMc.level4.hand_mc._visible = true;
monthMc.level4.blink_mc.gotoAndPlay(1);
_global.gotolevel = 4;
btn_play.onRelease();
}
};
monthMc.level5.onRelease = function () {
if (_global.levelFinished >= 4) {
eval (("monthMc.level" + _global.gotolevel) + ".hand_mc")._visible = false;
eval ("monthMc.level" + _global.gotolevel).blink_mc.gotoAndStop(1);
monthMc.level5.hand_mc._visible = true;
monthMc.level5.blink_mc.gotoAndPlay(1);
_global.gotolevel = 5;
btn_play.onRelease();
}
};
monthMc.level6.onRelease = function () {
if (_global.levelFinished >= 5) {
eval (("monthMc.level" + _global.gotolevel) + ".hand_mc")._visible = false;
eval ("monthMc.level" + _global.gotolevel).blink_mc.gotoAndStop(1);
monthMc.level6.hand_mc._visible = true;
monthMc.level6.blink_mc.gotoAndPlay(1);
_global.gotolevel = 6;
btn_play.onRelease();
}
};
monthMc.level7.onRelease = function () {
if (_global.levelFinished >= 6) {
eval (("monthMc.level" + _global.gotolevel) + ".hand_mc")._visible = false;
eval ("monthMc.level" + _global.gotolevel).blink_mc.gotoAndStop(1);
monthMc.level7.hand_mc._visible = true;
monthMc.level7.blink_mc.gotoAndPlay(1);
_global.gotolevel = 7;
btn_play.onRelease();
}
};
monthMc.level8.onRelease = function () {
if (_global.levelFinished >= 7) {
eval (("monthMc.level" + _global.gotolevel) + ".hand_mc")._visible = false;
eval ("monthMc.level" + _global.gotolevel).blink_mc.gotoAndStop(1);
monthMc.level8.hand_mc._visible = true;
monthMc.level8.blink_mc.gotoAndPlay(1);
_global.gotolevel = 8;
btn_play.onRelease();
}
};
monthMc.level9.onRelease = function () {
if (_global.levelFinished >= 8) {
eval (("monthMc.level" + _global.gotolevel) + ".hand_mc")._visible = false;
eval ("monthMc.level" + _global.gotolevel).blink_mc.gotoAndStop(1);
monthMc.level9.hand_mc._visible = true;
monthMc.level9.blink_mc.gotoAndPlay(1);
_global.gotolevel = 9;
btn_play.onRelease();
}
};
monthMc.level10.onRelease = function () {
if (_global.levelFinished >= 9) {
eval (("monthMc.level" + _global.gotolevel) + ".hand_mc")._visible = false;
eval ("monthMc.level" + _global.gotolevel).blink_mc.gotoAndStop(1);
monthMc.level10.hand_mc._visible = true;
monthMc.level10.blink_mc.gotoAndPlay(1);
_global.gotolevel = 10;
btn_play.onRelease();
}
};
btn_play.onRelease = function () {
Key.removeListener(levelkeyobj);
this._parent._parent.gotoAndStop("level" + _global.gotolevel);
};
btn_menu.onRelease = function () {
Key.removeListener(levelkeyobj);
this._parent._parent.gotoAndStop("mainmenu");
};
function levelNavigationRight() {
if (levelcnt < _global.levelSelected) {
eval (("monthMc.level" + levelcnt) + ".hand_mc")._visible = false;
eval ("monthMc.level" + levelcnt).blink_mc.gotoAndStop(1);
levelcnt++;
eval (("monthMc.level" + levelcnt) + ".hand_mc")._visible = true;
eval ("monthMc.level" + levelcnt).blink_mc.gotoAndPlay(1);
_global.gotolevel = levelcnt;
}
}
function levelNavigationLeft() {
if (levelcnt > 1) {
eval (("monthMc.level" + levelcnt) + ".hand_mc")._visible = false;
eval ("monthMc.level" + levelcnt).blink_mc.gotoAndStop(1);
levelcnt--;
eval (("monthMc.level" + levelcnt) + ".hand_mc")._visible = true;
eval ("monthMc.level" + levelcnt).blink_mc.gotoAndPlay(1);
_global.gotolevel = levelcnt;
}
}
function seasonChange(_arg1) {
if ((_arg1.monthMc._x < 500) && (_arg1.monthMc._x >= -90)) {
if ((_arg1.seasonMc._currentframe != 1) && (_arg1.seasonMc._currentframe != 7)) {
_arg1.seasonMc.gotoAndStop(1);
}
} else if ((_arg1.monthMc._x < -90) && (_arg1.monthMc._x >= -920)) {
if ((_arg1.seasonMc._currentframe != 2) && (_arg1.seasonMc._currentframe != 6)) {
_arg1.seasonMc.gotoAndStop(2);
}
} else if ((_arg1.monthMc._x < -920) && (_arg1.monthMc._x >= -1750)) {
if ((_arg1.seasonMc._currentframe != 3) && (_arg1.seasonMc._currentframe != 5)) {
_arg1.seasonMc.gotoAndStop(3);
}
} else if (_arg1.monthMc._x < -1750) {
if (_arg1.seasonMc._currentframe != 4) {
_arg1.seasonMc.gotoAndStop(4);
}
}
}
function seasonChangeReverse(_arg1) {
if ((_arg1.monthMc._x < 500) && (_arg1.monthMc._x >= -90)) {
if ((_arg1.seasonMc._currentframe != 7) && (_arg1.seasonMc._currentframe != 1)) {
_arg1.seasonMc.gotoAndStop(7);
}
} else if ((_arg1.monthMc._x < -90) && (_arg1.monthMc._x >= -920)) {
if ((_arg1.seasonMc._currentframe != 6) && (_arg1.seasonMc._currentframe != 2)) {
_arg1.seasonMc.gotoAndStop(6);
}
} else if ((_arg1.monthMc._x < -920) && (_arg1.monthMc._x >= -1750)) {
if ((_arg1.seasonMc._currentframe != 5) && (_arg1.seasonMc._currentframe != 3)) {
_arg1.seasonMc.gotoAndStop(5);
}
} else if (_arg1.monthMc._x < -1750) {
if (_arg1.seasonMc._currentframe != 4) {
_arg1.seasonMc.gotoAndStop(4);
}
}
}
var levelkeyobj;
var rightInterval = -1;
var leftInterval = -1;
var owner = this;
var curframe = 1;
var easing = 0.003;
var easingright = 0.003;
var targetX;
var isRightready = false;
var isLeftready = false;
var levelcnt;
levelcnt = _global.levelSelected;
levelkeyobj = new Object();
Key.addListener(levelkeyobj);
levelkeyobj.onKeyDown = function () {
if (Key.getCode() == 39) {
levelNavigationRight();
} else if (Key.getCode() == 37) {
levelNavigationLeft();
} else if (Key.getCode() == 13) {
btn_play.onRelease();
} else if (Key.getAscii() == 27) {
btn_menu.onRelease();
}
};
btn_right.onPress = function () {
targetX = -10000;
isRightready = true;
};
btn_left.onPress = function () {
targetX = 8000;
isLeftready = true;
};
btn_right.onRelease = function () {
isRightready = false;
};
btn_left.onRelease = function () {
isLeftready = false;
};
this.onEnterFrame = function () {
if (isRightready) {
var _local2 = (targetX - monthMc._x) * easingright;
monthMc._x = monthMc._x + _local2;
if (monthMc._x <= -2130) {
btn_right._visible = false;
monthMc._x = -2130;
isRightready = false;
} else {
btn_left._visible = true;
}
seasonChange(this);
}
if (isLeftready) {
var _local2 = (targetX - monthMc._x) * easing;
monthMc._x = monthMc._x + _local2;
if (monthMc._x >= 430) {
btn_left._visible = false;
monthMc._x = 430;
isLeftready = false;
} else {
btn_right._visible = true;
}
seasonChangeReverse(this);
}
};
Symbol 579 MovieClip Frame 3
stop();
Symbol 587 MovieClip Frame 1
stop();
Symbol 587 MovieClip Frame 2
stop();
Symbol 588 MovieClip Frame 1
stop();
Symbol 588 MovieClip Frame 2
stop();
Symbol 597 MovieClip Frame 66
stop();
Symbol 598 MovieClip Frame 16
stop();
Symbol 606 MovieClip Frame 10
stop();
Symbol 607 MovieClip Frame 1
stop();
Instance of Symbol 175 MovieClip "pointer" in Symbol 607 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 607 MovieClip Frame 2
stop();
Symbol 607 MovieClip Frame 3
stop();
Symbol 618 MovieClip Frame 61
stop();
Symbol 619 MovieClip Frame 15
stop();
Symbol 628 MovieClip Frame 9
stop();
Symbol 629 MovieClip Frame 1
stop();
Symbol 629 MovieClip Frame 2
stop();
Symbol 629 MovieClip Frame 3
stop();
Symbol 638 MovieClip Frame 1
stop();
Symbol 638 MovieClip Frame 2
stop();
Symbol 639 MovieClip Frame 1
stop();
Instance of Symbol 175 MovieClip "pointer" in Symbol 639 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 639 MovieClip Frame 2
stop();
Symbol 678 MovieClip Frame 26
stop();
Symbol 679 MovieClip Frame 51
stop();
Symbol 700 MovieClip Frame 26
stop();
Symbol 701 MovieClip Frame 58
stop();
Symbol 726 MovieClip Frame 25
stop();
Symbol 727 MovieClip Frame 72
stop();
Symbol 728 MovieClip Frame 1
stop();
Symbol 728 MovieClip Frame 2
stop();
Symbol 728 MovieClip Frame 3
stop();
Symbol 778 MovieClip Frame 1
stop();
Symbol 789 MovieClip Frame 64
stop();
Symbol 790 MovieClip Frame 16
stop();
Symbol 799 MovieClip Frame 10
stop();
Symbol 800 MovieClip Frame 1
stop();
Symbol 800 MovieClip Frame 2
stop();
Symbol 800 MovieClip Frame 3
stop();
Symbol 818 MovieClip Frame 64
stop();
Symbol 819 MovieClip Frame 16
stop();
Symbol 830 MovieClip Frame 1
stop();
Symbol 830 MovieClip Frame 2
stop();
Symbol 830 MovieClip Frame 3
stop();
Symbol 831 MovieClip Frame 1
stop();
Instance of Symbol 175 MovieClip "pointer" in Symbol 831 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 831 MovieClip Frame 2
stop();
Symbol 835 MovieClip Frame 26
stop();
Symbol 836 MovieClip Frame 121
stop();
Symbol 840 MovieClip Frame 26
stop();
Symbol 841 MovieClip Frame 123
stop();
Symbol 849 MovieClip Frame 26
stop();
Symbol 850 MovieClip Frame 151
stop();
Symbol 858 MovieClip Frame 26
stop();
Symbol 859 MovieClip Frame 151
stop();
Symbol 867 MovieClip Frame 26
stop();
Symbol 868 MovieClip Frame 151
stop();
Symbol 876 MovieClip Frame 26
stop();
Symbol 877 MovieClip Frame 150
stop();
Symbol 878 MovieClip Frame 1
stop();
Symbol 878 MovieClip Frame 2
stop();
Symbol 878 MovieClip Frame 3
stop();
Symbol 878 MovieClip Frame 4
stop();
Symbol 878 MovieClip Frame 5
stop();
Symbol 878 MovieClip Frame 6
stop();
Symbol 883 MovieClip Frame 75
stop();
Symbol 884 MovieClip Frame 1
stop();
Symbol 884 MovieClip Frame 15
stop();
Symbol 892 MovieClip Frame 10
stop();
Symbol 893 MovieClip Frame 1
stop();
Instance of Symbol 175 MovieClip "pointer" in Symbol 893 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 893 MovieClip Frame 2
stop();
Symbol 893 MovieClip Frame 3
stop();
Symbol 944 MovieClip Frame 1
stop();
Symbol 944 MovieClip Frame 126
stop();
Symbol 947 MovieClip Frame 55
stop();
Symbol 951 MovieClip Frame 10
stop();
Symbol 973 MovieClip Frame 1
stop();
Symbol 973 MovieClip Frame 2
stop();
Symbol 973 MovieClip Frame 3
stop();
Symbol 994 MovieClip Frame 32
stop();
this._visible = false;
Symbol 1025 MovieClip Frame 35
stop();
Symbol 1056 MovieClip Frame 1
stop();
Symbol 1056 MovieClip Frame 2
stop();
Symbol 1058 MovieClip Frame 1
stop();
Symbol 1058 MovieClip Frame 2
stop();
Symbol 1060 MovieClip Frame 1
stop();
Symbol 1060 MovieClip Frame 2
stop();
Symbol 1062 MovieClip Frame 1
stop();
Symbol 1062 MovieClip Frame 2
stop();
Symbol 1064 MovieClip Frame 1
stop();
Symbol 1064 MovieClip Frame 2
stop();
Symbol 1066 MovieClip Frame 1
stop();
Symbol 1066 MovieClip Frame 2
stop();
Symbol 1068 MovieClip Frame 1
stop();
Symbol 1068 MovieClip Frame 2
stop();
Symbol 1069 MovieClip Frame 1
stop();
Symbol 1069 MovieClip Frame 2
stop();
Symbol 1069 MovieClip Frame 3
stop();
Symbol 1069 MovieClip Frame 4
stop();
Symbol 1069 MovieClip Frame 5
stop();
Symbol 1069 MovieClip Frame 6
stop();
Symbol 1069 MovieClip Frame 7
stop();
Symbol 1069 MovieClip Frame 8
stop();
Symbol 1069 MovieClip Frame 9
stop();
Symbol 1087 MovieClip Frame 1
stop();
Symbol 1087 MovieClip Frame 2
stop();
Symbol 1087 MovieClip Frame 3
stop();
Symbol 1087 MovieClip Frame 4
stop();
Symbol 1087 MovieClip Frame 5
stop();
Symbol 1087 MovieClip Frame 6
stop();
Symbol 1150 MovieClip Frame 21
stop();
_parent._parent._parent.girlwalkframe = 2;
_parent.gotoAndStop(2);
Symbol 1157 MovieClip Frame 21
stop();
_global.jump = true;
_global.jump_choco1 = chocobox1._currentframe;
_parent._parent._parent.girlwalkframe = 4;
_parent.gotoAndStop(4);
Symbol 1164 MovieClip Frame 21
stop();
_global.jump = true;
_global.jump_choco1 = chocobox1._currentframe;
_global.jump_choco2 = chocobox2._currentframe;
_parent._parent._parent.girlwalkframe = 8;
_parent.gotoAndStop(8);
Symbol 1165 MovieClip Frame 1
stop();
Symbol 1165 MovieClip Frame 2
stop();
Symbol 1165 MovieClip Frame 3
stop();
Symbol 1165 MovieClip Frame 4
stop();
if (_global.jump == true) {
_global.jump = false;
chocobox1.gotoAndStop(_global.jump_choco1);
}
Symbol 1165 MovieClip Frame 7
stop();
Symbol 1165 MovieClip Frame 8
stop();
if (_global.jump == true) {
_global.jump = false;
chocobox1.gotoAndStop(_global.jump_choco1);
chocobox2.gotoAndStop(_global.jump_choco2);
}
Symbol 1165 MovieClip Frame 9
stop();
Symbol 1165 MovieClip Frame 10
stop();
Symbol 1165 MovieClip Frame 11
stop();
Symbol 1227 MovieClip Frame 1
stop();
Symbol 1227 MovieClip Frame 2
stop();
Symbol 1227 MovieClip Frame 3
stop();
Symbol 1227 MovieClip Frame 4
stop();
Symbol 1227 MovieClip Frame 5
stop();
Symbol 1227 MovieClip Frame 6
stop();
Symbol 1227 MovieClip Frame 7
stop();
Symbol 1227 MovieClip Frame 8
stop();
Symbol 1231 MovieClip Frame 1
stop();
Symbol 1231 MovieClip Frame 2
stop();
Symbol 1231 MovieClip Frame 3
stop();
Symbol 1231 MovieClip Frame 4
stop();
Symbol 1231 MovieClip Frame 5
stop();
Symbol 1231 MovieClip Frame 6
stop();
Symbol 1231 MovieClip Frame 7
stop();
Symbol 1231 MovieClip Frame 8
stop();
Symbol 1232 MovieClip Frame 1
stop();
Symbol 1232 MovieClip Frame 2
stop();
Symbol 1232 MovieClip Frame 3
stop();
Symbol 1232 MovieClip Frame 4
stop();
Symbol 1237 MovieClip Frame 1
stop();
Symbol 1237 MovieClip Frame 2
stop();
Symbol 1238 MovieClip Frame 1
stop();
Symbol 1238 MovieClip Frame 2
stop();
Symbol 1239 MovieClip Frame 1
stop();
Symbol 1239 MovieClip Frame 2
stop();
Symbol 1245 MovieClip Frame 5
stop();
type_round.gotoAndStop(2);
Symbol 1246 MovieClip Frame 6
stop();
this._parent._visible = false;
Symbol 1247 MovieClip Frame 1
stop();
Symbol 1247 MovieClip Frame 2
stop();
Symbol 1256 MovieClip Frame 53
stop();
Symbol 1260 MovieClip Frame 53
stop();
Symbol 1264 MovieClip Frame 53
stop();
Symbol 1268 MovieClip Frame 53
stop();
Symbol 1269 MovieClip Frame 1
stop();
Symbol 1269 MovieClip Frame 2
stop();
Symbol 1269 MovieClip Frame 3
stop();
Symbol 1269 MovieClip Frame 4
stop();
Symbol 1269 MovieClip Frame 5
stop();
Symbol 1290 MovieClip Frame 1
stop();
Symbol 1290 MovieClip Frame 2
stop();
Symbol 1290 MovieClip Frame 3
stop();
Symbol 1291 MovieClip Frame 1
stop();
Symbol 1291 MovieClip Frame 7
stop();
popup_txt.text = _global.popupText;
Symbol 1299 MovieClip Frame 1
stop();
Symbol 1299 MovieClip Frame 2
stop();
Symbol 1299 MovieClip Frame 3
stop();
Symbol 1307 MovieClip Frame 1
stop();
Symbol 1307 MovieClip Frame 150
stop();
Symbol 1310 MovieClip Frame 1
stop();
Symbol 1310 MovieClip Frame 2
stop();
Symbol 1331 MovieClip Frame 1
stop();
Symbol 1331 MovieClip Frame 30
stop();
Symbol 1350 MovieClip Frame 1
stop();
Symbol 1350 MovieClip Frame 27
stop();
Symbol 1354 MovieClip Frame 1
stop();
Symbol 1398 MovieClip Frame 23
stop();
Symbol 1403 MovieClip Frame 23
stop();
Symbol 1404 MovieClip Frame 1
stop();
Symbol 1404 MovieClip Frame 2
stop();
Symbol 1406 MovieClip Frame 1
money_earned.text = _global.report_moneyEarned;
tips.text = _global.report_tips;
totalScore = _global.report_moneyEarned + _global.report_tips;
total.text = totalScore;
if ((totalScore >= _global.targetScore) && (totalScore < _global.expertScore)) {
result.gotoAndStop(1);
result.mc.gotoAndPlay(1);
} else if (totalScore >= _global.expertScore) {
result.gotoAndStop(2);
result.mc.gotoAndPlay(1);
}
Symbol 1414 MovieClip Frame 1
stop();
Symbol 1414 MovieClip Frame 7
stop();
starScore = _global.report_moneyEarned + _global.report_tips;
star_anim._visible = false;
if (starScore >= _global.expertScore) {
star_anim._visible = true;
}
Symbol 1421 MovieClip Frame 14
stop();
Symbol 1426 MovieClip Frame 8
stop();
Symbol 1427 MovieClip Frame 23
stop();
Symbol 1428 MovieClip Frame 21
stop();
Symbol 1429 MovieClip Frame 29
stop();
Symbol 1430 MovieClip Frame 1
stop();
Symbol 1430 MovieClip Frame 2
stop();
Symbol 1430 MovieClip Frame 3
stop();
Symbol 1431 MovieClip Frame 29
stop();
Symbol 1432 MovieClip Frame 25
stop();
Symbol 1433 MovieClip Frame 28
stop();
Symbol 1434 MovieClip Frame 1
stop();
Symbol 1434 MovieClip Frame 2
stop();
Symbol 1434 MovieClip Frame 3
stop();
Symbol 1435 MovieClip Frame 39
stop();
Symbol 1436 MovieClip Frame 27
stop();
Symbol 1437 MovieClip Frame 29
stop();
Symbol 1438 MovieClip Frame 1
stop();
Symbol 1438 MovieClip Frame 2
stop();
Symbol 1438 MovieClip Frame 3
stop();
Symbol 1439 MovieClip [level1] Frame 1
#initclip 26
Object.registerClass("level1", Level1);
#endinitclip
Symbol 1460 MovieClip Frame 1
stop();
Symbol 1460 MovieClip Frame 2
stop();
Symbol 1461 Button
on (release) {
getURL (_root.premiumurl, "_blank");
}
Symbol 1463 MovieClip Frame 1
stop();
Symbol 1463 MovieClip Frame 2
stop();
Symbol 1465 MovieClip Frame 1
stop();
Symbol 1465 MovieClip Frame 2
stop();
Symbol 1466 MovieClip Frame 1
stop();
Symbol 1466 MovieClip Frame 8
stop();
btn_continue.gotoAndStop(2);
Symbol 1468 MovieClip Frame 5
stop();
chocobox1.gotoAndStop(_global.preferred_chocolate1);
chocobox2.gotoAndStop(_global.preferred_chocolate2);
Symbol 1470 MovieClip Frame 1
stop();
Symbol 1470 MovieClip Frame 2
stop();
Symbol 1473 MovieClip Frame 40
stop();
this._visible = false;
Symbol 1487 MovieClip Frame 1
stop();
Symbol 1487 MovieClip Frame 5
stop();
Symbol 1489 MovieClip Frame 1
stop();
Symbol 1489 MovieClip Frame 220
stop();
Symbol 1493 MovieClip Frame 1
stop();
Symbol 1512 MovieClip Frame 18
stop();
Symbol 1513 MovieClip Frame 1
stop();
Symbol 1513 MovieClip Frame 56
stop();
Symbol 1518 MovieClip Frame 1
stop();
Symbol 1518 MovieClip Frame 56
stop();
Symbol 1526 MovieClip Frame 1
stop();
goal.text = _global.targetScore;
yougot.text = _global.report_moneyEarned + _global.report_tips;
Symbol 1533 MovieClip Frame 7
stop();
Symbol 1534 MovieClip Frame 1
stop();
Symbol 1534 MovieClip Frame 2
stop();
Symbol 1535 MovieClip [level2] Frame 1
#initclip 17
Object.registerClass("level2", Level2);
#endinitclip
Symbol 1539 MovieClip Frame 1
stop();
Symbol 1539 MovieClip Frame 7
stop();
popup_txt.text = _global.popupText;
Symbol 1541 MovieClip Frame 1
stop();
Symbol 1541 MovieClip Frame 250
stop();
Symbol 1545 MovieClip Frame 1
stop();
Symbol 1547 MovieClip Frame 5
stop();
var firstclipx = 7;
var firstclipy = 42;
var secondclipx = 75;
var secondclipy = 42;
var random = Math.ceil((1 + (Math.random() * 2)) - 1);
if (random == 1) {
this.pos = 1;
this._parent._parent.keyTarget = "type_rabbit";
type_rabbit.gotoAndStop(2);
type_rabbit._x = firstclipx;
type_rabbit._y = firstclipy;
type_fish._x = secondclipx;
type_fish._y = secondclipy;
} else if (random == 2) {
this.pos = 2;
this._parent._parent.keyTarget = "type_fish";
type_fish.gotoAndStop(2);
type_fish._x = firstclipx;
type_fish._y = firstclipy;
type_rabbit._x = secondclipx;
type_rabbit._y = secondclipy;
}
Symbol 1548 MovieClip Frame 6
stop();
this._parent._visible = false;
Symbol 1549 MovieClip Frame 1
stop();
Symbol 1549 MovieClip Frame 2
stop();
Symbol 1550 MovieClip [level3] Frame 1
#initclip 18
Object.registerClass("level3", Level3);
#endinitclip
Symbol 1551 MovieClip [level4] Frame 1
#initclip 19
Object.registerClass("level4", Level4);
#endinitclip
Symbol 1554 MovieClip Frame 1
stop();
Symbol 1554 MovieClip Frame 7
stop();
popup_txt.text = _global.popupText;
Symbol 1556 MovieClip Frame 1
stop();
Symbol 1556 MovieClip Frame 300
stop();
Symbol 1560 MovieClip Frame 1
stop();
Symbol 1563 MovieClip [level5] Frame 1
#initclip 20
Object.registerClass("level5", Level5);
#endinitclip
Symbol 1596 MovieClip Frame 1
stop();
Symbol 1596 MovieClip Frame 55
stop();
Symbol 1598 MovieClip Frame 1
stop();
Symbol 1598 MovieClip Frame 480
stop();
Symbol 1602 MovieClip Frame 1
stop();
Symbol 1603 MovieClip [level6] Frame 1
#initclip 21
Object.registerClass("level6", Level6);
#endinitclip
Symbol 1608 MovieClip Frame 61
stop();
Symbol 1612 MovieClip Frame 16
stop();
Symbol 1615 MovieClip Frame 10
stop();
Symbol 1616 MovieClip Frame 1
stop();
Instance of Symbol 175 MovieClip "pointer" in Symbol 1616 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 1616 MovieClip Frame 2
stop();
Symbol 1616 MovieClip Frame 3
stop();
Symbol 1624 MovieClip Frame 10
stop();
Symbol 1625 MovieClip Frame 1
stop();
Instance of Symbol 175 MovieClip "pointer" in Symbol 1625 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 1625 MovieClip Frame 2
stop();
Symbol 1625 MovieClip Frame 3
stop();
Symbol 1635 MovieClip Frame 1
stop();
Symbol 1635 MovieClip Frame 7
stop();
popup_txt.text = _global.popupText;
Symbol 1637 MovieClip Frame 1
stop();
Symbol 1637 MovieClip Frame 480
stop();
Symbol 1640 MovieClip Frame 1
stop();
Symbol 1641 MovieClip [level7] Frame 1
#initclip 22
Object.registerClass("level7", Level7);
#endinitclip
Symbol 1643 MovieClip Frame 1
stop();
Symbol 1643 MovieClip Frame 670
stop();
Symbol 1647 MovieClip Frame 1
stop();
Symbol 1648 MovieClip [level8] Frame 1
#initclip 23
Object.registerClass("level8", Level8);
#endinitclip
Symbol 1650 MovieClip Frame 1
stop();
Symbol 1650 MovieClip Frame 880
stop();
Symbol 1653 MovieClip Frame 1
stop();
Symbol 1653 MovieClip Frame 2
stop();
Symbol 1657 MovieClip Frame 1
stop();
Symbol 1658 MovieClip [level9] Frame 1
#initclip 24
Object.registerClass("level9", Level9);
#endinitclip
Symbol 1660 MovieClip Frame 1
stop();
Symbol 1660 MovieClip Frame 1180
stop();
Symbol 1663 MovieClip Frame 1
stop();
Symbol 1663 MovieClip Frame 2
stop();
Symbol 1666 MovieClip Frame 1
stop();
Symbol 1667 MovieClip [level10] Frame 1
#initclip 25
Object.registerClass("level10", Level10);
#endinitclip
Symbol 1674 MovieClip Frame 1
_global.calenderxPos = 430;
Mouse.hide();
this.onEnterFrame = function () {
mouseClip._x = _xmouse;
mouseClip._y = _ymouse;
if (Key.isDown(2)) {
Mouse.hide();
}
};
Symbol 1674 MovieClip Frame 2
stop();
Symbol 1674 MovieClip Frame 3
stop();
Symbol 1674 MovieClip Frame 4
stop();
_root.menuSound.stop();
_root.gameSound.stop();
_root.calenderSound.stop();
if (_global.soundstat == "onn") {
_root.menuSound.start();
}
music_btn.onRelease = function () {
if (_global.soundstat == "onn") {
_root.menuSound.stop();
_global.soundstat = "off";
music_btn.gotoAndStop(2);
} else if (_global.soundstat == "off") {
_root.menuSound.start();
_global.soundstat = "onn";
music_btn.gotoAndStop(1);
}
};
Symbol 1674 MovieClip Frame 5
stop();
_root.menuSound.stop();
_root.gameSound.stop();
_root.calenderSound.stop();
var intro_obj = new Object();
Key.addListener(intro_obj);
intro_obj.onKeyDown = function () {
if (Key.getCode() == 13) {
btn_continue.onRelease();
}
};
btn_continue.onRollOver = function () {
this.gotoAndStop(2);
};
btn_continue.onRollOut = (btn_continue.onReleaseOutside = function () {
this.gotoAndStop(1);
});
btn_continue.onRelease = function () {
Key.removeListener(intro_obj);
gotoAndStop ("Calender");
};
if (_global.soundstat == "onn") {
_root.menuSound.start();
}
music_btn.onRelease = function () {
if (_global.soundstat == "onn") {
_root.menuSound.stop();
_global.soundstat = "off";
music_btn.gotoAndStop(2);
} else if (_global.soundstat == "off") {
_root.menuSound.start();
_global.soundstat = "onn";
music_btn.gotoAndStop(1);
}
};
Symbol 1674 MovieClip Frame 6
stop();
_root.menuSound.stop();
_root.gameSound.stop();
_root.calenderSound.stop();
if (_global.soundstat == "onn") {
_root.calenderSound.start();
}
music_btn.onRelease = function () {
if (_global.soundstat == "onn") {
_root.calenderSound.stop();
_global.soundstat = "off";
music_btn.gotoAndStop(2);
} else if (_global.soundstat == "off") {
_root.calenderSound.start();
_global.soundstat = "onn";
music_btn.gotoAndStop(1);
}
};
Symbol 1674 MovieClip Frame 7
stop();
_root.menuSound.stop();
_root.gameSound.stop();
_root.calenderSound.stop();
if (_global.soundstat == "onn") {
_root.gameSound.start();
}
music_btn.onRelease = function () {
if (_global.soundstat == "onn") {
stopAllSounds();
_root.gameSound.stop();
_global.soundstat = "off";
music_btn.gotoAndStop(2);
} else if (_global.soundstat == "off") {
_root.gameSound.start();
_global.soundstat = "onn";
music_btn.gotoAndStop(1);
}
};
Symbol 1674 MovieClip Frame 8
gotoAndStop ("Level1");
Symbol 1674 MovieClip Frame 9
stop();
_root.menuSound.stop();
_root.gameSound.stop();
_root.calenderSound.stop();
if (_global.soundstat == "onn") {
_root.gameSound.start();
}
music_btn.onRelease = function () {
if (_global.soundstat == "onn") {
stopAllSounds();
_root.gameSound.stop();
_global.soundstat = "off";
music_btn.gotoAndStop(2);
} else if (_global.soundstat == "off") {
_root.gameSound.start();
_global.soundstat = "onn";
music_btn.gotoAndStop(1);
}
};
Symbol 1674 MovieClip Frame 10
gotoAndStop ("Level2");
Symbol 1674 MovieClip Frame 11
stop();
_root.menuSound.stop();
_root.gameSound.stop();
_root.calenderSound.stop();
if (_global.soundstat == "onn") {
_root.gameSound.start();
}
music_btn.onRelease = function () {
if (_global.soundstat == "onn") {
stopAllSounds();
_root.gameSound.stop();
_global.soundstat = "off";
music_btn.gotoAndStop(2);
} else if (_global.soundstat == "off") {
_root.gameSound.start();
_global.soundstat = "onn";
music_btn.gotoAndStop(1);
}
};
Symbol 1674 MovieClip Frame 12
gotoAndStop ("Level3");
Symbol 1674 MovieClip Frame 13
stop();
_root.menuSound.stop();
_root.gameSound.stop();
_root.calenderSound.stop();
if (_global.soundstat == "onn") {
_root.gameSound.start();
}
music_btn.onRelease = function () {
if (_global.soundstat == "onn") {
stopAllSounds();
_root.gameSound.stop();
_global.soundstat = "off";
music_btn.gotoAndStop(2);
} else if (_global.soundstat == "off") {
_root.gameSound.start();
_global.soundstat = "onn";
music_btn.gotoAndStop(1);
}
};
Symbol 1674 MovieClip Frame 14
gotoAndStop ("Level4");
Symbol 1674 MovieClip Frame 15
stop();
_root.menuSound.stop();
_root.gameSound.stop();
_root.calenderSound.stop();
if (_global.soundstat == "onn") {
_root.gameSound.start();
}
music_btn.onRelease = function () {
if (_global.soundstat == "onn") {
stopAllSounds();
_root.gameSound.stop();
_global.soundstat = "off";
music_btn.gotoAndStop(2);
} else if (_global.soundstat == "off") {
_root.gameSound.start();
_global.soundstat = "onn";
music_btn.gotoAndStop(1);
}
};
Symbol 1674 MovieClip Frame 16
gotoAndStop ("Level5");
Symbol 1674 MovieClip Frame 17
stop();
_root.menuSound.stop();
_root.gameSound.stop();
_root.calenderSound.stop();
if (_global.soundstat == "onn") {
_root.gameSound.start();
}
music_btn.onRelease = function () {
if (_global.soundstat == "onn") {
stopAllSounds();
_root.gameSound.stop();
_global.soundstat = "off";
music_btn.gotoAndStop(2);
} else if (_global.soundstat == "off") {
_root.gameSound.start();
_global.soundstat = "onn";
music_btn.gotoAndStop(1);
}
};
Symbol 1674 MovieClip Frame 18
gotoAndStop ("Level6");
Symbol 1674 MovieClip Frame 19
stop();
_root.menuSound.stop();
_root.gameSound.stop();
_root.calenderSound.stop();
if (_global.soundstat == "onn") {
_root.gameSound.start();
}
music_btn.onRelease = function () {
if (_global.soundstat == "onn") {
stopAllSounds();
_root.gameSound.stop();
_global.soundstat = "off";
music_btn.gotoAndStop(2);
} else if (_global.soundstat == "off") {
_root.gameSound.start();
_global.soundstat = "onn";
music_btn.gotoAndStop(1);
}
};
Symbol 1674 MovieClip Frame 20
gotoAndStop ("Level7");
Symbol 1674 MovieClip Frame 21
stop();
_root.menuSound.stop();
_root.gameSound.stop();
_root.calenderSound.stop();
if (_global.soundstat == "onn") {
_root.gameSound.start();
}
music_btn.onRelease = function () {
if (_global.soundstat == "onn") {
stopAllSounds();
_root.gameSound.stop();
_global.soundstat = "off";
music_btn.gotoAndStop(2);
} else if (_global.soundstat == "off") {
_root.gameSound.start();
_global.soundstat = "onn";
music_btn.gotoAndStop(1);
}
};
Symbol 1674 MovieClip Frame 22
gotoAndStop ("Level8");
Symbol 1674 MovieClip Frame 23
stop();
_root.menuSound.stop();
_root.gameSound.stop();
_root.calenderSound.stop();
if (_global.soundstat == "onn") {
_root.gameSound.start();
}
music_btn.onRelease = function () {
if (_global.soundstat == "onn") {
stopAllSounds();
_root.gameSound.stop();
_global.soundstat = "off";
music_btn.gotoAndStop(2);
} else if (_global.soundstat == "off") {
_root.gameSound.start();
_global.soundstat = "onn";
music_btn.gotoAndStop(1);
}
};
Symbol 1674 MovieClip Frame 24
gotoAndStop ("Level9");
Symbol 1674 MovieClip Frame 25
stop();
_root.menuSound.stop();
_root.gameSound.stop();
_root.calenderSound.stop();
if (_global.soundstat == "onn") {
_root.gameSound.start();
}
music_btn.onRelease = function () {
if (_global.soundstat == "onn") {
stopAllSounds();
_root.gameSound.stop();
_global.soundstat = "off";
music_btn.gotoAndStop(2);
} else if (_global.soundstat == "off") {
_root.gameSound.start();
_global.soundstat = "onn";
music_btn.gotoAndStop(1);
}
};
Symbol 1674 MovieClip Frame 26
gotoAndStop ("Level10");
Symbol 1674 MovieClip Frame 27
stop();
var upshell_obj = new Object();
Key.addListener(upshell_obj);
upshell_obj.onKeyDown = function () {
if (Key.getCode() == 13) {
upshell_mc.btn_menu.onRelease();
}
};
upshell_mc.btn_menu.onRelease = function () {
Key.removeListener(upshell_obj);
gotoAndStop ("Mainmenu");
};