Frame 1
this.scrollRect = new flash.geom.Rectangle(0, 0, 700, 525);
Frame 3
function g2w_playagain() {
game_stage.gotoAndStop("begin");
}
function getphstatus(phno) {
swfurl = this._url;
if (swfurl.split("games2win.com").length == 1) {
obj_game.ph1_status = true;
}
var _local2 = obj_game[("ph" + phno) + "_status"];
if (!_local2) {
play();
}
}
function checkhost() {
swfurl = this._url;
trace("swfurl >>> " + swfurl.indexOf("games2win.com"));
if (swfurl.indexOf("games2win.com") == -1) {
return(false);
}
return(true);
}
function load_rgames(trgt) {
var rel_games = new XML();
rel_games.ignoreWhite = true;
rel_games.onLoad = function () {
game_details = new Object();
var _local1 = 0;
while (_local1 < trgt.rel_games.firstChild.childNodes.length) {
game_details[rel_games.firstChild.childNodes[_local1].nodeName] = rel_games.firstChild.childNodes[_local1].firstChild.nodeValue;
_local1++;
}
};
rel_games.load((curl + "game_details.xml?") + getTimer());
}
function getScore(_loc) {
_loc.gotoAndStop("lbl_top_scores");
_root.g_trg = _loc;
int_gscore = setInterval(_root, "getTop10", 150);
}
function getTop10() {
trace("getTop10");
clearInterval(int_gscore);
_root.send_lv = new XML();
_root.rst_lv = new XML();
_root.rst_lv.onLoad = function (success) {
if (success) {
var _local3 = new it.sephiroth.XML2Object();
_root.lst_top_scorer = _local3.parseXML(this);
_root.g_trg.gotoAndStop("top10");
} else {
_root.c_fail++;
if (_root.c_fail >= 3) {
_root.g_trg.gotoAndStop("error_screen");
} else {
_root.send_lv.sendAndLoad(url, _root.rst_lv, "POST");
}
}
};
var url = ((((((obj_partner.top10URL + "?game_id=") + _root.obj_game._gid) + "&order=") + obj_game._score_ord) + "&timspam") + getTimer());
trace(url + " Url");
_root.send_lv.sendAndLoad(url, _root.rst_lv, "POST");
}
function itemHandler(obj, item) {
getURL (obj_partner.clickthru, "_blank");
}
function _newUser() {
getURL (_registerurl, "_blank");
}
function _trackClickThru(mc) {
trace(mc + " _trackClickThru");
if (obj_partner._allowclick) {
mc.hit_area.onRelease = function () {
getURL (obj_partner.clickthru, "_blank");
};
} else {
mc.hit_area.useHandCursor = false;
}
}
function _readSharedData() {
so_uname = ((_sostatus.data.so_uname == undefined) ? "" : (_sostatus.data.so_uname));
so_jumpframe = ((_sostatus.data.so_jumpframe == undefined) ? "" : (_sostatus.data.so_jumpframe));
so_sound = ((_sostatus.data.so_sound == undefined) ? 0 : (_sostatus.data.so_sound));
_resetString = _sostatus.data.so_resetString;
trace("==========================");
trace((("so_jumpframe : " + _sostatus.data.so_jumpframe) + " : ") + so_uname);
if (so_jumpframe != "") {
_assignValue(_resetString);
createEmptyMovieClip("eye", getNextHighestDepth());
eye.onEnterFrame = function () {
if ((getBytesTotal() == getBytesLoaded()) and (getBytesLoaded() > 50000)) {
intro = 0;
_sostatus.data.so_jumpframe = "";
_sostatus.flush();
this.onEnterFrame = null;
gotoAndStop(so_jumpframe);
}
};
} else {
intro = 1;
play();
}
uname = so_uname;
gamesound = so_sound;
}
function _writeSharedData(jumpframe, jumpurl, _resetString) {
_sostatus.data.so_uname = ((so_uname == undefined) ? "" : (so_uname));
_sostatus.data.so_resetString = _resetString;
_sostatus.data.so_jumpframe = jumpframe;
_writeSoundData();
if (jumpurl != "") {
getURL (jumpurl);
} else {
gotoAndPlay (1);
}
}
function _writeSoundData() {
trace("Sound Share Data Called:");
_sostatus.data.so_sound = so_sound;
_sostatus.flush();
}
function _assignValue(_val) {
_arr = new Array();
_arr = _val.split("|");
i = 0;
while (i < (_arr.length / 2)) {
_var2 = ((i * 2) + 1) - 1;
_var3 = _var2 + 1;
_val = _arr[_var3];
_rst = isNaN(_val);
if (_rst) {
_root[_arr[_var2]] = _arr[_var3];
} else {
_root[_arr[_var2]] = int(_arr[_var3]);
}
i++;
}
}
function _playAgain(mc, jumpframe, _resetString) {
intro = 0;
_assignValue(_resetString);
trace("jumpframe " + jumpframe);
mc.gotoAndStop(jumpframe);
}
stop();
var obj_game = new Array();
obj_game._gid = "1092";
obj_game.game_name = "pizza_match";
obj_game._gtitle = "Pizza Match";
obj_game._google_text = "Pizza Match";
obj_game.StageW = 700;
obj_game.StageH = 525;
obj_game._res = (Stage.width + "x") + Stage.height;
obj_game._score_ord = "desc";
obj_game.mochi_tag = "";
obj_game.g2wbot = "";
obj_game.g2wbotid = 10301;
obj_game.ph1_status = false;
obj_game.ph2_status = false;
obj_game.adv_zedo = true;
obj_game.adv_mochi = false;
obj_game.inviziads = ("http://ads.inviziads.com/ad.html/g=" + obj_game._gid) + "&h=g2w";
zedo_tim = 15;
var obj_partner = new Array();
obj_partner.partner_name = "g2w";
obj_partner.partner_id = 1;
obj_partner.invalid_txt = "Invalid Nickname!";
obj_partner.show_submit = false;
obj_partner.submitURL = "/submit_score.asp";
obj_partner.top10URL = "/get_top_scorer.asp";
obj_partner.lblsubmit = "Enter your Games2win Nickname below";
obj_partner.show_g2w_slate = true;
obj_partner.show_register = true;
obj_partner.text_register = "Create Nickname";
obj_partner.url_register = "http://www.games2win.com/register.asp";
obj_partner.clickthru = "http://www.games2win.com/";
obj_partner._allowclick = true;
_root.uname = "";
scoreSubmit = function (_loc) {
trace(_loc + " _loc");
myname = _root.partner_uname;
myscore = _root.partner_score;
mygameid = _root.obj_game._gid;
myname = myname.trim();
if ((((myname.length == 0) or (myname == obj_partner.invalid_txt)) or (myname == "Connecting Error!")) or (myname == undefined)) {
trace(obj_partner.invalid_txt);
_root.partner_uname = obj_partner.invalid_txt;
} else {
_root.send_lv = new LoadVars();
_root.send_lv.onLoad = function (success) {
if (success) {
if (_root.send_lv.isreg == 0) {
_root.uname = obj_partner.invalid_txt;
_loc.gotoAndStop("invalid_user_screen");
} else if (_root.send_lv.isreg == 1) {
Key.removeListener(_loc.keyListener);
_root.getScore(_loc);
}
} else {
_loc.gotoAndStop("error_screen");
}
};
_root.send_lv.nickname = myname;
_root.send_lv.points = myscore;
_root.send_lv.gameid = mygameid;
_root.send_lv.sendAndLoad(obj_partner.submitURL, _root.send_lv, "POST");
trace(_root.send_lv);
_loc.gotoAndStop("lbl_submit_screen");
}
};
c_fail = 0;
var g2w_menu = new ContextMenu();
g2w_menu.hideBuiltInItems();
g2w_menu.customItems.push(new ContextMenuItem("Games2win.com", itemHandler));
this.menu = g2w_menu;
var _sostatus = SharedObject.getLocal("gamestatus", "/");
String.prototype.trim = function () {
var _local3 = 0;
var _local2 = this.length;
white = new Object();
white._32 = 1;
_local2--;
while (white["_" + ord(this.charAt(_local2))]) {
}
while (white["_" + ord(this.charAt(_local3++))]) {
}
return(this.slice(_local3 - 1, _local2 + 1));
};
_readSharedData();
Frame 9
stop();
getphstatus(1);
Frame 21
stop();
Instance of Symbol 140 MovieClip in Frame 31
onClipEvent (load) {
total = _root.getBytesTotal();
}
onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
percent = int((loaded / total) * 100);
_root.text1 = ("Loaded " + percent) + "%";
gotoAndStop(percent);
if (loaded == total) {
_root.play();
}
}
Frame 31
if (false) {
}
Frame 38
gotoAndStop ("lblgame");
Frame 48
stop();
Frame 60
gotoAndStop ("lblgame");
Symbol 7 MovieClip Frame 1
Symbol 8 MovieClip Frame 1
function brain() {
create_assets(myself, _global.obj_iads.type);
switch (_global.obj_iads.type) {
case "FULL" :
mcLoader.loadClip(_global.obj_iads.url, trgt_main);
break;
case "EMBED" :
mcLoader.loadClip(_global.obj_iads.url, trgt_main.trgt_ads);
if (_global.obj_iads.link ne undefined) {
trgt_main.onRelease = function () {
trace("_global.obj_iads.link " + _global.obj_iads.link);
getURL (_global.obj_iads.link, "_blank");
};
}
break;
case "NOOP" :
_parent._parent._visible = 0;
break;
}
}
function get_iads() {
lv_iads = new XML();
lv_result = new XML();
lv_result.ignoreWhite = true;
lv_result.onLoad = function (success) {
trace("success " + success);
if (success) {
parse_iads(lv_result);
myself.attachMovie("invizi_logo", "invizi_logo", this.getNextHighestDepth(), {_x:Stage.width - 120, _y:Stage.height - 20});
}
};
lv_iads.sendAndLoad(adurl, lv_result, "POST");
}
function parse_iads(lv_result) {
_global.obj_iads = new Array();
var _local2 = 0;
while (_local2 < lv_result.firstChild.childNodes.length) {
if (lv_result.firstChild.childNodes[_local2].firstChild.nodeValue != null) {
obj_iads[lv_result.firstChild.childNodes[_local2].nodeName] = lv_result.firstChild.childNodes[_local2].firstChild.nodeValue;
} else if (lv_result.firstChild.childNodes[_local2].firstChild.firstChild.nodeValue != null) {
var _local5 = new Object();
var _local4 = 0;
while (_local4 < lv_result.firstChild.childNodes[_local2].childNodes.length) {
_local5[lv_result.firstChild.childNodes[_local2].childNodes[_local4].nodeName] = lv_result.firstChild.childNodes[_local2].childNodes[_local4].firstChild.nodeValue;
_local4++;
}
obj_iads[lv_result.firstChild.childNodes[_local2].nodeName] = _local5;
}
_local2++;
}
show_time = int(_global.obj_iads.t);
check_type();
}
function create_assets(mc, _type) {
trace((("Create _ assets " + mc) + " ") + _type);
mc.createEmptyMovieClip("trgt_main", 4);
mcLoader = new MovieClipLoader();
mcLoader.addListener(mc);
if (_type != "FULL") {
mc.createEmptyMovieClip("square_mc", 5);
var _local4 = trgt_main.createEmptyMovieClip("trgt_ads", getNextHighestDepth());
var _local2 = new TextFormat();
_local2.align = "center";
_local2.font = "Verdana";
_local2.size = 10;
mc.createTextField("h_txt", mc.getNextHighestDepth(), 0, 0, 100, 22);
mc.createTextField("b_txt", mc.getNextHighestDepth(), 0, 0, 100, 22);
b_txt.autoSize = true;
b_txt.selectable = false;
h_txt.selectable = false;
b_txt.multiline = true;
b_txt.setNewTextFormat(_local2);
h_txt.autoSize = true;
h_txt.setNewTextFormat(_local2);
h_txt.text = "";
}
}
function onLoadInit(mc) {
ad_width = int(_global.obj_iads.x);
ad_height = int(_global.obj_iads.y);
_x = ((336 - ad_width) / 2);
_y = ((280 - ad_height) / 2);
progressBar.tim = show_time;
progressBar.width = _global.obj_iads.x;
progressBar.height = 15;
progressBar.start = function () {
maxw = this.width - 2;
this.ad = maxw / (this.tim + 1);
this.ad = this.ad / game_fps;
};
progressBar.onEnterFrame = function () {
if (this.bar._width < (this.width - 2)) {
this.bar._width = this.bar._width + this.ad;
} else {
this.bar._width = this.width;
}
};
progressBar._x = 100;
progressBar._y = 100;
bar_mc = progressBar.createEmptyMovieClip("bar", 1);
box_mc = progressBar.createEmptyMovieClip("box", 2);
bar_mc.beginFill(26112);
bar_mc.moveTo(0, 0);
bar_mc.lineTo(1, 0);
bar_mc.lineTo(1, progressBar.height - 2);
bar_mc.lineTo(0, progressBar.height - 2);
bar_mc.lineTo(0, 0);
bar_mc.endFill();
bar_mc._x = 1.5;
bar_mc._y = 1.5;
box_mc.lineStyle(1, 3355443, 100, true, "none", "round", "miter", 1);
box_mc.lineTo(progressBar.width, 0);
box_mc.lineTo(progressBar.width, progressBar.height);
box_mc.lineTo(0, progressBar.height);
box_mc.lineTo(0, 0);
box_mc._x = 0;
box_mc._y = 0;
progressBar.start();
x = 0;
y = 0;
mc._x = x;
mc._y = y;
square_mc.beginFill(16711680);
square_mc.moveTo(0, 0);
square_mc.lineTo(ad_width, 0);
square_mc.lineTo(ad_width, ad_height);
square_mc.lineTo(0, ad_height);
square_mc.lineTo(0, 0);
square_mc.endFill();
square_mc._x = x;
square_mc._y = y;
trgt_main.setMask(square_mc);
}
function check_type() {
if (_global.obj_iads.type eq "UPDATE") {
this.createEmptyMovieClip("holder", 100);
var _local4 = _global.obj_iads.url;
_root.obj_iads = _global.obj_iads.payload;
holder.loadMovie(_global.obj_iads.url);
holder.obj_iads = _root.obj_iads;
show_time = 20;
} else {
brain();
}
}
function parse_xml(mydata) {
var _local4 = new Array();
var _local1 = 0;
while (_local1 < mydata.firstChild.childNodes.length) {
if (mydata.firstChild.childNodes[_local1].firstChild.nodeValue != null) {
_local4[mydata.firstChild.childNodes[_local1].nodeName] = mydata.firstChild.childNodes[_local1].firstChild.nodeValue;
} else if (mydata.firstChild.childNodes[_local1].firstChild.firstChild.nodeValue != null) {
var _local5 = new Object();
var _local2 = 0;
while (_local2 < lv_result.firstChild.childNodes[_local1].childNodes.length) {
_local4[lv_result.firstChild.childNodes[_local1].childNodes[_local2].nodeName] = mydata.firstChild.childNodes[_local1].childNodes[_local2].firstChild.nodeValue;
_local2++;
}
_local4[lv_result.firstChild.childNodes[_local1].nodeName] = _local5;
}
_local1++;
}
return(_local4);
}
System.security.allowDomain("*");
this.getFps = function () {
if (signal == true) {
time = getTimer();
} else {
tempo = int(1000 / (getTimer() - time));
}
signal = !signal;
return(tempo);
};
this.onEnterFrame = function () {
game_fps = getFps();
if ((game_fps ne 0) and (game_fps ne undefined)) {
this.onEnterFrame = null;
}
};
myself = this;
signal = true;
adurl = (_root.obj_game.inviziads + "&type=post&ts=") + getTimer();
trace(adurl);
get_iads();
stop();
Symbol 12 MovieClip Frame 1
invizi_logo.onRelease = function () {
getURL ("http://inviziads.com/", "_blank");
};
Symbol 24 MovieClip Frame 1
_root._trackClickThru(this);
Symbol 49 MovieClip Frame 2
stop();
gotoAndStop(_root.obj_game._gstatus);
Symbol 55 Button
on (release) {
tryAgain();
}
Symbol 83 MovieClip [mc_topscore_box] Frame 1
trace("_root.checkhost() " + _root.checkhost());
trace("this._url " + this._url);
if (_root.checkhost()) {
gotoAndStop ("login_screen");
} else {
gotoAndStop ("lblalienhost");
}
Symbol 83 MovieClip [mc_topscore_box] Frame 2
function tryAgain() {
gotoAndStop ("login_screen");
}
function filltopscore(destmc) {
trace(_root.lst_top_scorer.top_score.status.data);
if ((_root.lst_top_scorer.top_score.status.data == 0) or (_root.lst_top_scorer.top_score.user[0].score.data == 0)) {
_top10_lbl._visible = false;
var _local2 = 0;
while (_local2 < 10) {
destmc["row" + _local2]._visible = false;
_local2++;
}
} else {
_noscore_mc._visible = false;
var _local2 = 0;
while (_local2 < 10) {
if ((_root.lst_top_scorer.top_score.user[_local2] == undefined) or (_root.lst_top_scorer.top_score.user[_local2].score.data == 0)) {
destmc["row" + _local2].txtrollno.text = "";
destmc["row" + _local2].txtusername.text = "";
destmc["row" + _local2].txtscore.text = "";
} else {
destmc["row" + _local2].txtrollno.text = _local2 + 1;
destmc["row" + _local2].txtusername.text = _root.lst_top_scorer.top_score.user[_local2].nick_name.data;
destmc["row" + _local2].txtscore.text = _root.lst_top_scorer.top_score.user[_local2].score.data;
}
_local2++;
}
}
}
stop();
playAgain_btn.onRelease = function () {
trace("Login");
_root.g2w_playagain();
};
username_txt.onSetFocus = function () {
trace((this.text + " ") + _root.obj_partner.invalid_txt);
if ((this.text == _root.obj_partner.invalid_txt) or (this.text == "Connecting Error!")) {
this.text = "";
}
};
Selection.setFocus("username_txt");
btn_scoresubmit.onRelease = function () {
_root.scoreSubmit(this._parent);
};
_trg_loc = this;
var keyListener = new Object();
keyListener.onKeyDown = function () {
if (!(Key.getCode() === 13)) {
} else {
Selection.setFocus("btn_scoresubmit");
_root.scoreSubmit(_trg_loc);
}
};
Key.addListener(keyListener);
btn_create_nickname.onRelease = function () {
getURL (_root.obj_partner.url_register, "_blank");
};
if (_root.obj_partner.show_submit) {
btn_scoresubmit._visible = false;
}
stop();
_btn_g2w.useHandCursor = false;
Symbol 83 MovieClip [mc_topscore_box] Frame 31
stop();
Symbol 83 MovieClip [mc_topscore_box] Frame 45
stop();
Symbol 83 MovieClip [mc_topscore_box] Frame 60
stop();
playAgain_btn.onRelease = function () {
_root._playAgain(_root, "lblgameintro");
};
Symbol 83 MovieClip [mc_topscore_box] Frame 74
stop();
filltopscore(this);
playAgain_btn.onRelease = function () {
_root._playAgain(_root, "lblgameintro");
};
Symbol 83 MovieClip [mc_topscore_box] Frame 85
function tryAgain() {
gotoAndStop ("login_screen");
}
function filltopscore(destmc) {
trace(_root.lst_top_scorer.top_score.status.data);
if ((_root.lst_top_scorer.top_score.status.data == 0) or (_root.lst_top_scorer.top_score.user[0].score.data == 0)) {
_top10_lbl._visible = false;
var _local2 = 0;
while (_local2 < 10) {
destmc["row" + _local2]._visible = false;
_local2++;
}
} else {
_noscore_mc._visible = false;
var _local2 = 0;
while (_local2 < 10) {
if ((_root.lst_top_scorer.top_score.user[_local2] == undefined) or (_root.lst_top_scorer.top_score.user[_local2].score.data == 0)) {
destmc["row" + _local2].txtrollno.text = "";
destmc["row" + _local2].txtusername.text = "";
destmc["row" + _local2].txtscore.text = "";
} else {
destmc["row" + _local2].txtrollno.text = _local2 + 1;
destmc["row" + _local2].txtusername.text = _root.lst_top_scorer.top_score.user[_local2].nick_name.data;
destmc["row" + _local2].txtscore.text = _root.lst_top_scorer.top_score.user[_local2].score.data;
}
_local2++;
}
}
}
playAgain_btn.onRelease = function () {
trace("Login");
_root.g2w_playagain();
};
username_txt.onSetFocus = function () {
trace((this.text + " ") + _root.obj_partner.invalid_txt);
if ((this.text == _root.obj_partner.invalid_txt) or (this.text == "Connecting Error!")) {
this.text = "";
}
};
Selection.setFocus("username_txt");
btn_scoresubmit.onRelease = function () {
_root.scoreSubmit(this._parent);
};
_trg_loc = this;
var keyListener = new Object();
keyListener.onKeyDown = function () {
if (!(Key.getCode() === 13)) {
} else {
Selection.setFocus("btn_scoresubmit");
_root.scoreSubmit(_trg_loc);
}
};
Key.addListener(keyListener);
btn_create_nickname.onRelease = function () {
getURL (_root.obj_partner.url_register, "_blank");
};
if (_root.obj_partner.show_submit) {
btn_scoresubmit._visible = false;
}
stop();
stop();
Symbol 87 MovieClip [game_sound_ctrl] Frame 1
_gameSounds = new Sound();
var frame = "on";
changeVol = function (targetvol, step) {
this.onEnterFrame = function () {
var _local3 = _gameSounds.getVolume();
if ((step < 0) and (_local3 <= targetvol)) {
_local3 = targetvol;
delete this.onEnterFrame;
_root.so_sound = 1;
} else if ((step > 0) and (_local3 >= targetvol)) {
_local3 = targetvol;
delete this.onEnterFrame;
_root.so_sound = 0;
} else {
_gameSounds.setVolume(_local3 + step);
}
};
};
if (_root.so_sound == 1) {
frame = "off";
this.gotoAndPlay(frame);
}
this.onRelease = function () {
if (frame == "on") {
frame = "off";
} else {
frame = "on";
}
this.gotoAndPlay(frame);
};
Symbol 87 MovieClip [game_sound_ctrl] Frame 2
stop();
changeVol(100, 5);
Symbol 87 MovieClip [game_sound_ctrl] Frame 3
stop();
changeVol(0, -5);
Symbol 91 MovieClip Frame 1
_root._trackClickThru(this);
Symbol 94 MovieClip [brain_inviziads] Frame 1
function brain() {
create_assets(myself, _global.obj_iads.type);
switch (_global.obj_iads.type) {
case "FULL" :
mcLoader.loadClip(_global.obj_iads.url, trgt_main);
break;
case "EMBED" :
mcLoader.loadClip(_global.obj_iads.url, trgt_main.trgt_ads);
if (_global.obj_iads.link ne undefined) {
trgt_main.onRelease = function () {
trace("_global.obj_iads.link " + _global.obj_iads.link);
getURL (_global.obj_iads.link, "_blank");
};
}
break;
case "NOOP" :
clearInterval(int1);
_parent.play();
break;
}
}
function get_iads() {
lv_iads = new XML();
lv_result = new XML();
lv_result.ignoreWhite = true;
lv_result.onLoad = function (success) {
trace("success " + success);
if (success) {
parse_iads(lv_result);
} else {
_root.play();
}
};
lv_iads.g = game_id;
lv_iads.sendAndLoad(_root.adurl, lv_result, "POST");
}
function parse_iads(lv_result) {
_global.obj_iads = new Array();
var _local2 = 0;
while (_local2 < lv_result.firstChild.childNodes.length) {
if (lv_result.firstChild.childNodes[_local2].firstChild.nodeValue != null) {
obj_iads[lv_result.firstChild.childNodes[_local2].nodeName] = lv_result.firstChild.childNodes[_local2].firstChild.nodeValue;
} else if (lv_result.firstChild.childNodes[_local2].firstChild.firstChild.nodeValue != null) {
var _local5 = new Object();
var _local4 = 0;
while (_local4 < lv_result.firstChild.childNodes[_local2].childNodes.length) {
_local5[lv_result.firstChild.childNodes[_local2].childNodes[_local4].nodeName] = lv_result.firstChild.childNodes[_local2].childNodes[_local4].firstChild.nodeValue;
_local4++;
}
obj_iads[lv_result.firstChild.childNodes[_local2].nodeName] = _local5;
}
_local2++;
}
show_time = int(_global.obj_iads.t);
check_type();
}
function time_delay() {
tim = 0;
int1 = setInterval(timespam, 1000);
}
function timespam() {
tim++;
trace(((tim + " tim Tim") + " show_time") + show_time);
if (tim == show_time) {
clearInterval(int1);
_parent.play();
}
}
function create_assets(mc, _type) {
trace((("Create _ assets " + mc) + " ") + _type);
mc.createEmptyMovieClip("trgt_main", 4);
mcLoader = new MovieClipLoader();
mcLoader.addListener(mc);
if (_type != "FULL") {
mc.createEmptyMovieClip("square_mc", 5);
var _local4 = trgt_main.createEmptyMovieClip("trgt_ads", getNextHighestDepth());
var _local2 = new TextFormat();
_local2.align = "center";
_local2.font = "Verdana";
_local2.size = 10;
mc.createTextField("h_txt", mc.getNextHighestDepth(), 0, 0, 100, 22);
mc.createTextField("b_txt", mc.getNextHighestDepth(), 0, 0, 100, 22);
b_txt.autoSize = true;
b_txt.selectable = false;
h_txt.selectable = false;
b_txt.multiline = true;
b_txt.setNewTextFormat(_local2);
h_txt.autoSize = true;
h_txt.setNewTextFormat(_local2);
h_txt.text = "";
mc.createEmptyMovieClip("progressBar", 500);
}
}
function onLoadInit(mc) {
ad_width = int(_global.obj_iads.x);
ad_height = int(_global.obj_iads.y);
trace("Ad Width : " + ad_width);
trace("Ad Height : " + ad_height);
h_txt.text = "Advertisement";
progressBar.tim = show_time;
progressBar.width = _global.obj_iads.x;
progressBar.height = 15;
progressBar.start = function () {
game_fps = getFps();
maxw = this.width - 2;
this.ad = maxw / (this.tim + 1);
this.ad = this.ad / game_fps;
};
progressBar.onEnterFrame = function () {
if (this.bar._width < (this.width - 2)) {
this.bar._width = this.bar._width + this.ad;
} else {
this.bar._width = this.width;
}
};
progressBar._x = 100;
progressBar._y = 100;
bar_mc = progressBar.createEmptyMovieClip("bar", 1);
box_mc = progressBar.createEmptyMovieClip("box", 2);
bar_mc.beginFill(26112);
bar_mc.moveTo(0, 0);
bar_mc.lineTo(1, 0);
bar_mc.lineTo(1, progressBar.height - 2);
bar_mc.lineTo(0, progressBar.height - 2);
bar_mc.lineTo(0, 0);
bar_mc.endFill();
bar_mc._x = 1.5;
bar_mc._y = 1.5;
box_mc.lineStyle(1, 3355443, 100, true, "none", "round", "miter", 1);
box_mc.lineTo(progressBar.width, 0);
box_mc.lineTo(progressBar.width, progressBar.height);
box_mc.lineTo(0, progressBar.height);
box_mc.lineTo(0, 0);
box_mc._x = 0;
box_mc._y = 0;
progressBar.start();
b_txt.text = "Note Clicking on the above Ad won't interrupt your game. Ad link opens in a new window.\rThanks to our sponsors, we provide you free games to play.";
myself._y = b_txt._y - 10;
x = (Stage.width / 2) - (ad_width / 2);
y = (Stage.height / 2) - (ad_height / 2);
mc._x = x;
mc._y = y;
h_txt._x = (x + (ad_width / 2)) - (h_txt._width / 2);
if ((_embedscale = "down")) {
h_txt._y = y - 40;
}
progressBar._x = (x + (ad_width / 2)) - (progressBar._width / 2);
progressBar._y = (y + 5) + ad_height;
myself.attachMovie("invizi_logo", "invizi_logo", this.getNextHighestDepth(), {_x:int(progressBar._x + progressBar._width) - 114, _y:int((progressBar._y + progressBar._height) + 5)});
myself.invizi_logo.onRelease = function () {
getURL ("http://www.inviziads.com", "_blank");
};
b_txt._x = (x + (ad_width / 2)) - (b_txt._width / 2);
b_txt._y = progressBar._y + 30;
square_mc.beginFill(16711680);
square_mc.moveTo(0, 0);
square_mc.lineTo(ad_width, 0);
square_mc.lineTo(ad_width, ad_height);
square_mc.lineTo(0, ad_height);
square_mc.lineTo(0, 0);
square_mc.endFill();
square_mc._x = x;
square_mc._y = y;
trgt_main.setMask(square_mc);
var _local5 = ((Stage.width - scaled_width) / scaled_width) * 100;
var _local4 = ((Stage.height - scaled_height) / scaled_height) * 100;
this._xscale = 100 + _local5;
this._yscale = 100 + _local4;
new_xpos = (-(((Stage.width * this._xscale) / 100) - Stage.width)) / 2;
new_ypos = (-(((Stage.height * this._yscale) / 100) - Stage.height)) / 2;
_parent[this._name]._x = new_xpos;
_parent[this._name]._y = new_ypos;
}
function check_type() {
if (_global.obj_iads.type eq "UPDATE") {
trace(" _global.obj_iads.payload.type " + _global.obj_iads.payload.type);
this.createEmptyMovieClip("holder", 100);
var _local4 = _global.obj_iads.url;
_root.obj_iads = _global.obj_iads.payload;
holder.loadMovie(_global.obj_iads.url);
holder.obj_iads = _root.obj_iads;
show_time = 20;
} else {
brain();
}
time_delay();
}
function parse_xml(mydata) {
var _local4 = new Array();
var _local1 = 0;
while (_local1 < mydata.firstChild.childNodes.length) {
if (mydata.firstChild.childNodes[_local1].firstChild.nodeValue != null) {
_local4[mydata.firstChild.childNodes[_local1].nodeName] = mydata.firstChild.childNodes[_local1].firstChild.nodeValue;
} else if (mydata.firstChild.childNodes[_local1].firstChild.firstChild.nodeValue != null) {
var _local5 = new Object();
var _local2 = 0;
while (_local2 < lv_result.firstChild.childNodes[_local1].childNodes.length) {
_local4[lv_result.firstChild.childNodes[_local1].childNodes[_local2].nodeName] = mydata.firstChild.childNodes[_local1].childNodes[_local2].firstChild.nodeValue;
_local2++;
}
_local4[lv_result.firstChild.childNodes[_local1].nodeName] = _local5;
}
_local1++;
}
return(_local4);
}
System.security.allowDomain("*");
Stage.scaleMode = "noscale";
scaled_width = Stage.width;
scaled_height = Stage.height;
Stage.scaleMode = "showAll";
Object.prototype.getFps = function () {
if (signal == true) {
time = getTimer();
} else {
tempo = int(1000 / (getTimer() - time));
}
signal = !signal;
return(tempo);
};
this.onEnterFrame = function () {
game_fps = getFps();
if ((game_fps != 0) && (game_fps != undefined)) {
this.onEnterFrame = null;
}
};
myself = this;
signal = true;
_root.adurl = (_root.obj_game.inviziads + "&ts=") + getTimer();
get_iads();
stop();
Symbol 800 MovieClip [__Packages.it.sephiroth.XML2Object] Frame 0
class it.sephiroth.XML2Object
{
var oXML;
function XML2Object () {
}
function get xml() {
return(oXML);
}
function parseXML(sFile) {
oResult = new Object();
oXML = sFile;
oResult = translateXML();
return(oResult);
}
function translateXML(from, path, name, position) {
var _local2;
var _local9;
var _local4;
var _local10;
if (path == undefined) {
path = this;
name = "oResult";
}
path = path[name];
if (from == undefined) {
from = new XML(xml.toString());
from.ignoreWhite = true;
}
if (from.hasChildNodes()) {
_local9 = from.childNodes;
if (position != undefined) {
_local10 = path;
path = path[position];
}
while (_local9.length > 0) {
_local4 = _local9.shift();
_local2 = _local4.nodeName;
if (_local2 != undefined) {
var _local5 = new Object();
_local5.attributes = _local4.attributes;
_local5.data = _local4.firstChild.nodeValue;
if (position != undefined) {
_local10 = path;
}
if (path[_local2] != undefined) {
if (path[_local2].__proto__ == Array.prototype) {
path[_local2].push(_local5);
name = _local4.nodeName;
position = path[_local2].length - 1;
} else {
var _local8 = path[_local2];
path[_local2] = new Array();
path[_local2].push(_local8);
path[_local2].push(_local5);
name = _local2;
position = path[_local2].length - 1;
}
} else {
path[_local2] = _local5;
name = _local2;
position = undefined;
}
}
if (_local4.hasChildNodes()) {
translateXML(_local4, path, name, position);
}
}
}
return(oResult);
}
var oResult = new Object();
}
Symbol 801 MovieClip [__Packages.Mission] Frame 0
class Mission
{
var _mc, terminated, data, _tables, _door, _waitress, _kitchen;
function Mission ($id, $mc) {
_id = $id;
_mc = $mc;
terminated = false;
data = MissionData.DATA[id];
}
static function get totalCashes() {
var _local2 = 0;
var _local1 = 0;
while (_local1 < MissionData.DATA.length) {
_local2 = _local2 + MissionData.DATA[_local1].cash;
_local1++;
}
return(_local2);
}
static function getMission() {
if (_missionObj == null) {
trace("\u6CA1\u6709\u83B7\u53D6\u5230Mission\uFF0C\u5BF9\u8C61\u4E3ANull");
return(null);
}
return(_missionObj);
}
static function terminateCurrent() {
if (_missionObj != null) {
_missionObj.terminate();
}
}
static function createMission($id, $mc) {
if ($id == undefined) {
$id = 0;
}
if ($mc == undefined) {
trace("\u4E25\u91CD\u9519\u8BEF\uFF1A\u521B\u5EFAMission\u65F6\u6CA1\u6709\u627E\u5230\u9700\u8981\u7684MovieClip");
return(null);
}
current = $id;
_missionObj = new Mission($id, $mc);
return(_missionObj);
}
static function missionAgain() {
root.gotoAndStop("missionSwitch");
}
static function nextMission() {
if (_missionObj.__get__id() >= MAXLEVEL) {
allComplete();
} else {
root.gotoAndStop(_missionObj.__get__id() + 3);
}
}
static function allComplete() {
root.gotoAndStop("end");
}
function refreshDepth() {
function sortFunction(a, b) {
if (a._y > b._y) {
return(1);
}
if (a._y < b._y) {
return(-1);
}
if (a._x > b._x) {
return(1);
}
return(-1);
}
var _local3 = [waitress.__get__mc()];
var _local2 = 0;
while (_local2 < tables.length) {
_local3.push(tables[_local2].mc);
_local2++;
}
_local3.sort(sortFunction);
_local3.push(door.__get__mc());
if (draggingMc) {
_local3.push(draggingMc);
}
if (ui) {
_local3.push(ui);
}
_local2 = 0;
while (_local2 < _local3.length) {
_local3[_local2].swapDepths(mc.getNextHighestDepth());
_local2++;
}
}
function checkEnd() {
if (isEmpty) {
missionOver();
}
}
function tableCustomersLeave(t) {
if (t.__get__isLove()) {
numLoves++;
}
cashes = cashes + t.cashes;
if (numLoves >= 2) {
if (!boundHeart) {
boundAll(1);
boundHeart = true;
}
}
if (isEmpty) {
missionOver();
}
}
function terminate() {
terminated = true;
if (waitress.tween != null) {
waitress.tween.stop();
waitress.tween = null;
}
waitress.__get__mc()._visible = false;
if (candle) {
candle.__get__mc().onPress = null;
}
createCandle = function () {
trace("Mission is terminated, Don't create candle");
};
if (harp) {
harp.__get__mc().onRelease = null;
}
door.stopAddCustomer();
var _local2 = 0;
while (_local2 < tables.length) {
Table(tables[_local2]).__set__status(Table.NOTFULL);
_local2++;
}
trace(("mission" + id) + " terminated");
}
function initMission() {
_tables = [];
_door = new Door(mc[data.door.mcName]);
_waitress = new Waitress(mc[data.waitress.mcName]);
_kitchen = new Kitchen(mc[data.kitchen.mcName], data.kitchen);
var _local2 = 0;
while (_local2 < data.tables.length) {
var _local3 = data.tables[_local2];
_tables.push(new Table(mc[_local3.mcName], _local3));
_local2++;
}
if (MissionData.DATA[id].candle) {
createCandle();
}
if ((harp == null) && (MissionData.DATA[id].harp)) {
harp = BoundItem.getHarp(door.__get__mc(), {_x:-10, _y:-30});
}
refreshDepth();
}
function boundAll(numHearts) {
trace("bound for all: +" + numHearts);
var _local4 = door.__get__customersArray().concat();
var _local3 = 0;
while (_local3 < tables.length) {
var _local2 = 0;
while (_local2 < Table(tables[_local3]).__get__customersArray().length) {
_local4.push(tables[_local3].customersArray[_local2]);
_local2++;
}
_local3++;
}
_local3 = 0;
while (_local3 < _local4.length) {
Customer(_local4[_local3]).changeHearts(numHearts);
_local3++;
}
_local4 = [];
}
function getBound(bound) {
switch (bound) {
case candle :
trace((("bound for " + bound.__get__table()) + ": +") + bound.__get__heartsNum());
var _local2 = 0;
while (_local2 < bound.__get__table().__get__numCustomers()) {
bound.__get__table().__get__customersArray()[_local2].changeHearts(bound.__get__heartsNum());
_local2++;
}
createCandle();
break;
case harp :
_local2 = 0;
for(;;){
if (_local2 >= door.__get__customersArray().length) {
break;
}
var _local4 = Customer(door.__get__customersArray()[_local2]);
_local4.changeHearts(bound.__get__heartsNum());
_local2++;
};
}
}
function createCandle() {
var _local2 = (Math.random() * 20000) + 10000;
var obj = this;
var interval = setInterval(function () {
if (!obj.terminated) {
obj.candle = BoundItem.getCandle(obj.__get__mc(), {_x:obj.__get__kitchen().__get__mc()._x - 100, _y:obj.__get__kitchen().__get__mc()._y + 30});
}
clearInterval(interval);
}, _local2);
}
function toString() {
return("Mission " + id);
}
function get happyTablesNum() {
return(_happyTablesNum);
}
function get kitchen() {
return(_kitchen);
}
function get waitress() {
return(_waitress);
}
function get isEmpty() {
var _local2 = 0;
while (_local2 < tables.length) {
if (!Table(tables[_local2]).__get__isEmpty()) {
return(false);
}
_local2++;
}
return(door.__get__isEmpty());
}
function get door() {
return(_door);
}
function get id() {
return(_id);
}
function get mc() {
return(_mc);
}
function get tables() {
return(_tables);
}
function missionOver() {
MissionData.DATA[id].cash = cashes;
if (passLimit > numLoves) {
fail();
} else {
pass();
}
terminate();
}
function fail() {
ui = mc.attachMovie("UI", "ui", mc.getNextHighestDepth());
ui.gotoAndStop("fail");
ui.loves_txt.text = numLoves;
ui.cash_txt.text = cashes;
ui.again_btn.onRelease = function () {
Mission.missionAgain();
};
}
function pass() {
ui = mc.attachMovie("UI", "ui", mc.getNextHighestDepth());
ui.gotoAndStop("pass");
ui.loves_txt.text = numLoves;
ui.cash_txt.text = cashes;
ui.again_btn.onRelease = function () {
Mission.missionAgain();
};
ui.next_btn.onRelease = function () {
Mission.nextMission();
};
}
function statusChangedHandle(event) {
if (!(event.target.CLASS === Customer)) {
} else {
customerStatusHandle(event.status);
}
}
function customerStatusHandle(s) {
if (!(s === Customer.SIT)) {
}
}
static var _missionObj = null;
static var root = null;
static var current = 0;
static var MAXLEVEL = 2;
var _id = 0;
var _happyTablesNum = 0;
var draggingMc = null;
var numLoves = 0;
var passLimit = 2;
var cashes = 0;
var ui = null;
var boundHeart = false;
var harp = null;
var candle = null;
}
Symbol 802 MovieClip [__Packages.MissionData] Frame 0
class MissionData
{
function MissionData () {
}
static var DATA = [{cash:0, listNum:4, harp:false, candle:false, items:{addHeart:"HeartPlus", removeHeart:"HeartMinus"}, customer:{status:"status"}, tables:[{mcName:"table1", deskName:"desk", chair1Name:"chair1", chair2Name:"chair2", musicName:"musicBtn", i:0, j:0}, {mcName:"table2", deskName:"desk", chair1Name:"chair1", chair2Name:"chair2", musicName:"musicBtn", i:0, j:1}, {mcName:"table3", deskName:"desk", chair1Name:"chair1", chair2Name:"chair2", musicName:"musicBtn", i:1, j:0}, {mcName:"table4", deskName:"desk", chair1Name:"chair1", chair2Name:"chair2", musicName:"musicBtn", i:1, j:1}], waitress:{mcName:"waitress", bornPoint:{x:405, y:162}}, kitchen:{mcName:"kitchen", chefName:"chef"}, door:{mcName:"door"}, food:{linkName:"Plate"}}, {cash:0, listNum:3, harp:true, candle:false, items:{addHeart:"HeartPlus", removeHeart:"HeartMinus"}, customer:{status:"status"}, tables:[{mcName:"table1", deskName:"desk", chair1Name:"chair1", chair2Name:"chair2", musicName:"musicBtn", i:0, j:0}, {mcName:"table2", deskName:"desk", chair1Name:"chair1", chair2Name:"chair2", musicName:"musicBtn", i:0, j:1}, {mcName:"table3", deskName:"desk", chair1Name:"chair1", chair2Name:"chair2", musicName:"musicBtn", i:1, j:0}, {mcName:"table4", deskName:"desk", chair1Name:"chair1", chair2Name:"chair2", musicName:"musicBtn", i:1, j:1}, {mcName:"table5", deskName:"desk", chair1Name:"chair1", chair2Name:"chair2", musicName:"musicBtn", i:2, j:0}, {mcName:"table6", deskName:"desk", chair1Name:"chair1", chair2Name:"chair2", musicName:"musicBtn", i:2, j:1}], waitress:{mcName:"waitress", bornPoint:{x:426, y:164}}, kitchen:{mcName:"kitchen", chefName:"chef"}, door:{mcName:"door"}, food:{linkName:"Plate"}}, {cash:0, listNum:2, harp:true, candle:true, items:{addHeart:"HeartPlus", removeHeart:"HeartMinus"}, customer:{status:"status"}, tables:[{mcName:"table1", deskName:"desk", chair1Name:"chair1", chair2Name:"chair2", musicName:"musicBtn", i:0, j:0}, {mcName:"table2", deskName:"desk", chair1Name:"chair1", chair2Name:"chair2", musicName:"musicBtn", i:0, j:1}, {mcName:"table3", deskName:"desk", chair1Name:"chair1", chair2Name:"chair2", musicName:"musicBtn", i:1, j:0}], waitress:{mcName:"waitress", bornPoint:{x:349.4, y:181.5}}, kitchen:{mcName:"kitchen", chefName:"chef"}, door:{mcName:"door"}, food:{linkName:"Plate"}}];
}
Symbol 803 MovieClip [__Packages.Door] Frame 0
class Door
{
var fixedList, _mc, customers, addInterval;
function Door ($mc) {
fixedList = [0, 1, 2, 3, 4, 4, 5, 5, 0, 1, 2, 3];
_mc = $mc;
customers = new Array();
createCustomer();
addInterval = setInterval(this, "createCustomer", addDelay);
}
function get customersArray() {
return(customers);
}
function get mc() {
return(_mc);
}
function get isEmpty() {
return((maxNum <= 0) && (customers.length <= 0));
}
function customerLeave(c) {
var _local2 = 0;
while (_local2 < customers.length) {
if (customers[_local2] == c) {
customers.splice(_local2, 1);
refresh();
Mission.getMission().checkEnd();
break;
}
_local2++;
}
}
function stopAddCustomer() {
clearInterval(addInterval);
}
function createCustomer() {
if (numCustomers >= MissionData.DATA[Mission.getMission().__get__id()].listNum) {
return(undefined);
}
if (maxNum <= 0) {
stopAddCustomer();
return(undefined);
}
maxNum--;
var _local2 = ((Mission.current == 0) ? (fixedList.shift()) : (random(6)));
var _local5 = mc.attachMovie(CustomerType.__get__TYPES()[_local2], CustomerType.__get__TYPES()[_local2] + getTimer(), mc.getNextHighestDepth(), {_x:0, _y:0});
var _local4 = new Customer(_local5, _local2);
customers.push(_local4);
refresh();
var _local3 = new Sound();
_local3.attachSound("DoorSnd");
_local3.start();
return(_local4);
}
function refresh() {
var _local2 = 0;
while (_local2 < numCustomers) {
var _local3 = Customer(customers[_local2]);
_local3.__get__mc().swapDepths(MissionData.DATA[Mission.getMission().__get__id()].listNum - _local2);
if (!_local3.__get__isDragging()) {
_local3.__get__mc()._x = (_local2 * -50) + 150;
_local3.__get__mc()._y = 0;
}
_local2++;
}
}
function reduceCustomer(c) {
var _local2 = 0;
while (_local2 < numCustomers) {
if (customers[_local2] == c) {
customers.splice(_local2, 1);
break;
}
_local2++;
}
refresh();
}
function get numCustomers() {
return(customers.length);
}
var _numCustomers = 0;
var maxNum = 12;
var addDelay = 2000;
}
Symbol 804 MovieClip [__Packages.MissionItem] Frame 0
class MissionItem
{
var _mc, eventDispatcher, _status;
function MissionItem ($mc) {
_mc = $mc;
eventDispatcher = new mx.events.EventDispatcher();
}
function get mc() {
return(_mc);
}
function set status(value) {
_status = value;
mc.gotoAndStop(status);
if (this[status + "Handle"]) {
this[status + "Handle"]();
}
eventDispatcher.dispatchEvent({type:STATUSCHANGEDEVENT, target:this, status:status});
//return(status);
}
function get status() {
return(_status);
}
function addStatusChangedHandle(listener) {
eventDispatcher.addEventListener(STATUSCHANGEDEVENT, listener);
}
static var STATUSCHANGEDEVENT = "statusChangedHandle";
}
Symbol 805 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local7 = "__q_" + eventObj.type;
var _local4 = queueObj[_local7];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 806 MovieClip [__Packages.Customer] Frame 0
class Customer extends MissionItem
{
var lostHeartInterval, __get__mc, __get__status, _mc;
function Customer ($mc, $type) {
super($mc);
_type = $type;
status = (STAND);
beginLoseHeart();
var _local3 = Math.random();
if (_local3 >= 0.5) {
happy();
} else {
sad();
}
}
function beginLoseHeart() {
lostHeartInterval = setInterval(this, "wait", 1000);
}
function happy() {
maxPatience = 30000;
}
function sad() {
mood.gotoAndStop("sad");
maxPatience = 15000;
}
function stopLoseHeart() {
clearInterval(lostHeartInterval);
}
function get isDragging() {
return(_isDragging);
}
function get mood() {
return(MovieClip(__get__mc().mood));
}
function set status(value) {
super.__set__status(value);
refreshDirection();
refreshHearts();
//return(__get__status());
}
function get directionNow() {
return(direction);
}
function get table() {
return(_table);
}
function get CLASS() {
return(Customer);
}
function set mc(value) {
_mc = value;
__get__mc().gotoAndStop(__get__status());
refreshDirection();
refreshHearts();
//return(__get__mc());
}
function get type() {
return(_type);
}
function get numHearts() {
return(_numHearts);
}
function setDirection(d) {
direction = d;
refreshDirection();
}
function terminate() {
__get__mc().removeMovieClip();
stopLoseHeart();
}
function changeHearts(h) {
if (h > 0) {
plusHearts(h);
} else if (h < 0) {
minusHearts(h * -1);
} else {
return(numHearts);
}
refreshHearts();
return(numHearts);
}
function leave(fromTable) {
if ((table && (!fromTable)) && (__get__status() == SIT)) {
table.customersLeave(this);
}
if (fromTable) {
_numHearts = 1;
refreshHearts();
__get__mc()[MissionData.DATA[Mission.getMission().__get__id()].customer.status].gotoAndStop("angry");
}
if (__get__status() == STAND) {
Mission.getMission().__get__door().customerLeave(this);
}
if (!table) {
terminate();
}
}
function refreshDirection() {
__get__mc()[__get__status()].gotoAndStop(direction);
}
function plusHearts(h) {
_numHearts = _numHearts + h;
_numHearts = ((_numHearts > MAXNUMHEARTS) ? (MAXNUMHEARTS) : (_numHearts));
return(numHearts);
}
function minusHearts(h) {
if (_numHearts > 0) {
_numHearts = _numHearts - h;
}
if (_numHearts <= 0) {
leave();
__get__mc()[MissionData.DATA[Mission.getMission().__get__id()].customer.status].gotoAndStop("angry");
return(0);
}
return(numHearts);
}
function refreshHearts() {
var obj = this;
var _local2 = MissionData.DATA[Mission.getMission().__get__id()];
__get__mc()[_local2.customer.status].gotoAndStop(numHearts);
if (!mood._visible) {
mood._visible = true;
var interval = setInterval(function () {
obj.__get__mood()._visible = false;
clearInterval(interval);
}, 2000);
}
if (numHearts >= 5) {
mood.gotoAndStop("happy");
} else if (numHearts >= 3) {
mood.gotoAndStop("general");
} else {
mood.gotoAndStop("sad");
}
return(numHearts);
}
function wait() {
patience = patience - 1000;
if (patience <= 0) {
patience = maxPatience;
changeHearts(-1);
}
}
function standHandle() {
var obj = this;
__get__mc().onPress = function () {
obj.__get__mc().startDrag();
Mission.getMission().draggingMc = this;
this.swapDepths(Mission.getMission().__get__mc().getNextHighestDepth());
obj._isDragging = true;
this.onMouseMove = function () {
obj.onMouseMoveWhenStand();
updateAfterEvent();
};
};
__get__mc().onRelease = (__get__mc().onReleaseOutside = function () {
obj.__get__mc().stopDrag();
Mission.getMission().draggingMc = null;
obj._isDragging = false;
obj.__get__mc().onMouseMove = null;
obj.mcDropped();
Mission.getMission().__get__door().refresh();
});
}
function onMouseMoveWhenStand() {
if (table == null) {
_table = getTouchTable();
} else if (McTools.isMouseInMc(table.__get__mc())) {
table.onRollOver();
} else {
table.onRollOut();
_table = null;
}
}
function sitHandle() {
__get__mc().onPress = null;
__get__mc().onMouseMove = null;
__get__mc().onRelease = null;
}
function mcDropped() {
_table = getTouchTable();
if (table != null) {
table.onRollOut();
table.addCustomer(this);
} else {
Mission.getMission().__get__door().refresh();
}
}
function getTouchTable() {
var _local2 = Mission.getMission().__get__tables();
var _local1 = 0;
while (_local1 < _local2.length) {
if ((McTools.isMouseInMc(_local2[_local1].mc) && (Table(_local2[_local1]).__get__isNotFull())) && (Table(_local2[_local1]).__get__numCustomers() < Table(_local2[_local1]).__get__maxNumCustomers())) {
return(_local2[_local1]);
}
_local1++;
}
return(null);
}
function toString() {
return(CustomerType.__get__TYPES()[type]);
}
static var STAND = "stand";
static var SIT = "sit";
static var MAXNUMHEARTS = 6;
var _numHearts = 3;
var direction = 3;
var _type = 0;
var _table = null;
var maxPatience = 30000;
var patience = 30000;
var _isDragging = false;
}
Symbol 807 MovieClip [__Packages.Table] Frame 0
class Table extends MissionItem
{
var _status, customers, __set__status, __get__mc, desk, __get__status, row_num, chairs, musicInterval, musicBtn;
function Table ($mc, $data) {
super($mc);
_status = NOTFULL;
customers = [];
initTableData($data);
__set__status(NOTFULL);
var obj = this;
__get__mc().onMouseUp = function () {
obj.onRollOut();
};
}
static function getTableByIJ(ii, jj) {
var _local2 = Mission.getMission().__get__tables();
var _local1 = 0;
while (_local1 < _local2.length) {
if ((_local2[_local1].RowNum.i == ii) && (_local2[_local1].RowNum.j == jj)) {
return(_local2[_local1]);
}
_local1++;
}
return(_local2[0]);
}
function get food() {
return(_food);
}
function get maxNumCustomers() {
return(2);
}
function get deskMc() {
return(desk);
}
function get customerLeave() {
return(_coustomerLeave);
}
function get rendezvousPoint() {
return({x:__get__mc()._x, y:__get__mc()._y - 51});
}
function get leftPoint() {
return({x:__get__mc()._x - 50, y:__get__mc()._y - 25});
}
function get isHappy() {
if (customers.length < 2) {
return(false);
}
var _local2 = 0;
while (_local2 < customers.length) {
if (customers[_local2].numHearts < 5) {
return(false);
}
_local2++;
}
return(true);
}
function get isEmpty() {
return(customers.length <= 0);
}
function get customersArray() {
return(customers);
}
function get isNotFull() {
return(__get__status() == NOTFULL);
}
function get isLove() {
return(_isLove);
}
function get rightPoint() {
return({x:__get__mc()._x + 50, y:__get__mc()._y - 25});
}
function get arrivePoint() {
return({x:__get__mc()._x, y:__get__mc()._y - 1});
}
function get RowNum() {
return(row_num);
}
function get numCustomers() {
return(customers.length);
}
function get cashes() {
return(cash);
}
function addCustomer(c) {
var obj = this;
customers.push(c);
c.__get__mc().removeMovieClip();
Mission.getMission().__get__door().reduceCustomer(c);
c.__set__status(Customer.SIT);
c.__set__mc(__get__mc().attachMovie(CustomerType.__get__TYPES()[c.__get__type()], "customerMc" + numCustomers, __get__mc().getNextHighestDepth()));
if (numCustomers == 1) {
c.setDirection(Direction.RIGHT);
} else if (numCustomers == 2) {
c.setDirection(Direction.LEFT);
CustomerType.createCouple(customers[0], customers[1]);
var interval = setInterval(function () {
if ((!obj.__get__isEmpty()) && (!obj.__get__customerLeave())) {
obj.__set__status(Table.MENU);
}
clearInterval(interval);
}, menuDelay);
}
desk.swapDepths(__get__mc().getNextHighestDepth());
c.__get__mc()._x = chairs[numCustomers - 1]._x;
c.__get__mc()._y = chairs[numCustomers - 1]._y;
}
function getFood($food) {
_food = $food;
__set__status(EATING);
food.__set__mc(desk.attachMovie(MissionData.DATA[Mission.getMission().__get__id()].food.linkName, "food", desk.getNextHighestDepth()));
}
function listenMusic() {
var obj = this;
musicInterval = setInterval(function () {
var _local1 = 0;
while (_local1 < obj.customers.length) {
Customer(obj.customers[_local1]).changeHearts(1);
_local1++;
}
}, musicDelay);
}
function musicStop() {
var _local2 = this;
clearInterval(musicInterval);
}
function onRollOver() {
__get__mc()._alpha = 50;
}
function onRollOut() {
__get__mc()._alpha = 100;
}
function customersLeave(c) {
var obj = this;
Mission.getMission().__get__kitchen().tableCustomerAngry(obj);
var _local2 = 0;
while (_local2 < obj.customers.length) {
if (obj.customers[_local2] != c) {
Customer(obj.customers[_local2]).leave(true);
}
_local2++;
}
var love = obj.desk.attachMovie("Fire", "fire" + getTimer(), obj.desk.getNextHighestDepth(), {_y:10});
var _local6 = Customer(obj.customers[0]);
var _local5 = Customer(obj.customers[1]);
var _local8 = CustomerType.__get__KISSDEPTHS()[_local6.__get__type()];
var _local4 = CustomerType.__get__KISSDEPTHS()[_local5.__get__type()];
_local4 = ((_local8 == _local4) ? (_local8 + 1) : (_local4));
var _local7 = CustomerType.__get__TYPES()[_local6.__get__type()] + "Angry";
var _local11 = CustomerType.__get__TYPES()[_local5.__get__type()] + "Angry";
var _local10 = love.attachMovie(_local7, _local7 + getTimer(), _local8);
var _local9 = love.attachMovie(_local11, _local7 + getTimer(), _local4);
_local10.gotoAndStop(_local6.__get__directionNow());
_local9.gotoAndStop(_local5.__get__directionNow());
_coustomerLeave = true;
var interval = setInterval(function () {
love.removeMovieClip();
var _local1 = 0;
while (_local1 < obj.customers.length) {
obj.customers[_local1].terminate();
_local1++;
}
obj.customers = [];
Mission.getMission().tableCustomersLeave(obj);
obj.__set__status(Table.NOTFULL);
clearInterval(interval);
}, 2000);
}
function initTableData(data) {
desk = __get__mc()[data.deskName];
chairs = [__get__mc()[data.chair1Name], __get__mc()[data.chair2Name]];
row_num = {i:data.i, j:data.j};
musicBtn = MovieClip(desk[data.musicName]);
}
function notFullHandle() {
musicBtn.onRelease = null;
_coustomerLeave = false;
_isLove = false;
for (var _local2 in desk) {
if (typeof(desk[_local2]) == "movieclip") {
desk[_local2].removeMovieClip();
}
}
}
function menuHandle() {
var obj = this;
var _local2 = desk.attachMovie("Menu", "menu" + getTimer(), desk.getNextHighestDepth(), {_x:0, _y:0});
_local2.onRelease = function () {
var _local2 = Mission.getMission().__get__waitress();
if (!_local2.__get__isBusy()) {
Mission.getMission().__get__waitress().menuService(obj, this);
}
};
}
function eatingHandle() {
function eatHalf() {
obj._food.__set__status(Food.HALF);
clearInterval(interval);
}
function eatAll() {
obj.pay();
obj.musicBtn.onRelease = null;
obj._food.__set__status(Food.EMPTY);
clearInterval(interval2);
}
var obj = this;
var _local2 = 0;
while (_local2 < obj.customers.length) {
Customer(obj.customers[_local2]).stopLoseHeart();
_local2++;
}
musicBtn.onRelease = function () {
if (!Mission.getMission().__get__waitress().__get__isBusy()) {
Mission.getMission().__get__waitress().musicService(obj);
}
};
var interval = setInterval(eatHalf, eatDelay / 2);
var interval2 = setInterval(eatAll, eatDelay);
}
function pay() {
function love() {
obj._isLove = true;
var love = obj.desk.attachMovie("Love", "love" + getTimer(), obj.desk.getNextHighestDepth(), {_y:10, _xscale:0, _yscale:0});
var _local1 = new Sound();
_local1.attachSound("Gita");
_local1.start();
var c1 = Customer(obj.customers[0]);
var c2 = Customer(obj.customers[1]);
var d1 = CustomerType.__get__KISSDEPTHS()[c1.__get__type()];
var d2 = CustomerType.__get__KISSDEPTHS()[c2.__get__type()];
d2 = ((d1 == d2) ? (d1 + 1) : (d2));
var mc1 = (CustomerType.__get__TYPES()[c1.__get__type()] + "Kiss");
var mc2 = (CustomerType.__get__TYPES()[c2.__get__type()] + "Kiss");
var _local4 = new mx.transitions.Tween(love, "_xscale", mx.transitions.easing.Elastic.easeOut, 0, 80, 1.5, true);
var _local5 = new mx.transitions.Tween(love, "_yscale", mx.transitions.easing.Elastic.easeOut, 0, 80, 1.5, true);
_local4.onMotionFinished = function () {
var _local2 = love.attachMovie(mc1, mc1 + getTimer(), d1, {_xscale:80, _yscale:80});
var _local1 = love.attachMovie(mc2, mc1 + getTimer(), d2, {_xscale:80, _yscale:80});
_local2.gotoAndStop(c1.__get__directionNow());
_local1.gotoAndStop(c2.__get__directionNow());
};
var interval = setInterval(function () {
love.removeMovieClip();
allLeave();
clearInterval(interval);
}, 3000);
}
function allLeave() {
var _local1 = 0;
while (_local1 < obj.customers.length) {
obj.customers[_local1].terminate();
_local1++;
}
obj._food.__get__mc().onRelease = function () {
var _local1 = Mission.getMission().__get__waitress();
if (!_local1.__get__isBusy()) {
Mission.getMission().__get__waitress().cleanService(obj);
}
};
var _local2 = new Sound();
_local2.attachSound("CashSnd");
_local2.start();
obj.customers = [];
Mission.getMission().tableCustomersLeave(obj);
}
var obj = this;
_coustomerLeave = true;
var _local3 = Customer.MAXNUMHEARTS;
var _local2 = 0;
while (_local2 < customers.length) {
if (_local3 > Customer(customers[_local2]).__get__numHearts()) {
_local3 = Customer(customers[_local2]).numHearts;
}
_local2++;
}
cash = _local3 * 100;
if (_local3 >= NUMHEARTSFORLOVE) {
love();
} else {
allLeave();
}
}
function eattedHandle() {
__set__status(NOTFULL);
}
function toString() {
return((((("table (" + RowNum.i) + ", ") + RowNum.j) + "): ") + __get__mc()._name);
}
static var STATUSCHANGEDEVENT = "tableStatusChangedHandle";
static var NOTFULL = "notFull";
static var FULL = "full";
static var MENU = "menu";
static var WAITFOOD = "waitFood";
static var EATING = "eating";
static var EATTED = "eatted";
static var NUMHEARTSFORLOVE = 5;
var _money = 0;
var menuDelay = 2500;
var _food = null;
var eatDelay = 20000;
var _rendezvousPoint = null;
var _arrivePoint = null;
var musicDelay = 3000;
var _isLove = false;
var cash = 0;
var _coustomerLeave = false;
}
Symbol 808 MovieClip [__Packages.Food] Frame 0
class Food extends MissionItem
{
var _table, __set__status, __get__mc, _mc, __get__status;
function Food ($mc, $t) {
super($mc);
_table = $t;
__set__status(FULL);
putOnKitchen();
}
function putOnKitchen() {
var obj = this;
__get__mc().onRelease = function () {
var _local1 = Mission.getMission().__get__waitress();
if (!_local1.__get__isBusy()) {
Mission.getMission().__get__waitress().foodService(Mission.getMission().__get__kitchen().getFood(obj), obj.__get__table());
}
};
}
function get table() {
return(_table);
}
function set mc(value) {
_mc = value;
__get__mc().gotoAndStop(__get__status());
//return(__get__mc());
}
static var FULL = "full";
static var HALF = "half";
static var EMPTY = "empty";
}
Symbol 809 MovieClip [__Packages.Waitress] Frame 0
class Waitress extends MissionItem
{
var __get__status, __get__mc, tween;
function Waitress ($mc) {
super($mc);
status = (STAND);
}
function setDirection(d) {
direction = d;
refreshDirection();
}
function menuService(t, mc) {
function backToKitchen() {
obj._isBusy = false;
if ((!t.__get__customerLeave()) && (!t.__get__isNotFull())) {
Mission.getMission().__get__kitchen().addMenu(t);
}
}
if (isMusicing) {
stopMusic();
}
var obj = this;
_isBusy = true;
status = (WALK);
setPath(createPath(t).concat(), function () {
obj.currentTable = t;
obj.goBack(t, backToKitchen);
if (mc) {
mc.removeMovieClip();
}
});
}
function foodService(food, t) {
function gotFood() {
food.__get__mc().removeMovieClip();
if (t.__get__customerLeave() || (t.__get__isNotFull())) {
delete food;
obj._isBusy = false;
return(undefined);
}
obj.__set__status(Waitress.FULL);
obj.setPath(obj.createPath(t).concat(), function () {
obj.currentTable = t;
obj._isBusy = false;
obj.__set__status(Waitress.STAND);
if ((!t.__get__customerLeave()) && (!t.__get__isNotFull())) {
t.getFood(food);
} else {
delete food;
}
});
}
if (isMusicing) {
stopMusic();
}
var obj = this;
_isBusy = true;
if (currentTable == null) {
gotFood();
} else {
goBack(currentTable, gotFood);
}
}
function cleanService(t) {
function backToKitchen() {
obj._isBusy = false;
}
if (isMusicing) {
stopMusic();
}
var obj = this;
_isBusy = true;
status = (WALK);
setPath(createPath(t).concat(), function () {
obj.currentTable = t;
t.__get__food().__get__mc().removeMovieClip();
t.__set__status(Table.EATTED);
obj.goBack(t, backToKitchen, Waitress.EMPTY);
});
}
function musicService(t) {
if (isMusicing) {
stopMusic();
}
var obj = this;
_isBusy = true;
status = (WALK);
setPath(createPath(t).concat(), function () {
obj._isBusy = false;
obj.currentTable = t;
obj.__set__status(Waitress.MUSIC);
t.listenMusic();
});
}
function get isMusicing() {
return(__get__status() == MUSIC);
}
function stopMusic() {
currentTable.musicStop();
}
function set status(value) {
super.__set__status(value);
refreshDirection();
//return(__get__status());
}
function get isBusy() {
return(_isBusy);
}
function get bornPoint() {
return(MissionData.DATA[Mission.getMission().__get__id()].waitress.bornPoint);
}
function get rendezvousPoint() {
return(MissionData.DATA[Mission.getMission().__get__id()].waitress.rendezous);
}
function createPath(t) {
if (currentTable == t) {
return([]);
}
var _local2;
if (currentTable == null) {
_local2 = PathFinding.getPathToTable(t);
} else {
_local2 = PathFinding.getPathBetweenTables(currentTable, t);
}
return(_local2);
}
function createBackPath(t) {
if (currentTable == null) {
return([]);
}
var _local2 = PathFinding.getPathFromTable(t);
return(_local2);
}
function addPointToPath(p, path) {
var _local2 = path[path.length - 1];
var _local1 = p;
if ((_local2.x == _local1.x) && (_local2.y == _local1.y)) {
return(undefined);
}
if ((_local2.x == _local1.x) || (_local2.y == _local1.y)) {
path.push(p);
} else {
path.push({x:_local1.x, y:_local2.y});
path.push(p);
}
}
function goBack(t, callBack, s) {
status = ((s ? (s) : (WALK)));
var obj = this;
setPath(createBackPath(t), function () {
obj.currentTable = null;
obj.__set__status(Waitress.STAND);
callBack();
});
}
function refreshDirection() {
__get__mc()[__get__status()].gotoAndStop(direction);
}
function setPath(path, endHandle) {
if (path.length == 0) {
tween.onMotionFinished = null;
tween.onMotionChanged = null;
tween = null;
endHandle();
return(undefined);
}
var obj = this;
var _local2 = path.shift();
var _local3 = Math.sqrt(((_local2.x - __get__mc()._x) * (_local2.x - __get__mc()._x)) + ((_local2.y - __get__mc()._y) * (_local2.y - __get__mc()._y))) / v;
if (_local2.x > __get__mc()._x) {
if (_local2.y > __get__mc()._y) {
setDirection(Direction.FACE);
} else {
setDirection(Direction.RIGHT);
}
} else if (_local2.y > __get__mc()._y) {
setDirection(Direction.LEFT);
} else {
setDirection(Direction.BACK);
}
tween = new mx.transitions.Tween(__get__mc(), "_y", mx.transitions.easing.None.easeOut, __get__mc()._y, _local2.y, _local3, true);
new mx.transitions.Tween(__get__mc(), "_x", mx.transitions.easing.None.easeOut, __get__mc()._x, _local2.x, _local3, true);
tween.onMotionFinished = function () {
obj.setPath(path, endHandle);
};
tween.onMotionChanged = function () {
Mission.getMission().refreshDepth();
};
}
static var STATUSCHANGEDEVENT = "waitressStatusChangedHandle";
static var STAND = "stand";
static var WALK = "walk";
static var FULL = "full";
static var EMPTY = "empty";
static var MUSIC = "music";
var direction = 1;
var v = 200;
var _isBusy = false;
var currentTable = null;
}
Symbol 810 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 811 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 812 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 813 MovieClip [__Packages.PathFinding] Frame 0
class PathFinding
{
function PathFinding () {
}
static function getPathToTable(t2) {
return(getPathBetweenTables(Table.getTableByIJ(0, 0), t2));
}
static function getPathFromTable(t1) {
var _local1 = [];
var _local2 = Table.getTableByIJ(0, 0);
_local1 = getPathBetweenTables(t1, _local2);
var _local4 = (((t1.__get__RowNum().i != _local2.__get__RowNum().i) && (t1.__get__RowNum().j != _local2.__get__RowNum().j)) ? (((t1.__get__rendezvousPoint().x < _local2.__get__rendezvousPoint().x) ? (Table.getTableByIJ(t1.__get__RowNum().i, _local2.__get__RowNum().j)) : (Table.getTableByIJ(_local2.__get__RowNum().i, t1.__get__RowNum().j)))) : (_local2));
if (_local4 == t1) {
_local1.pop();
_local1.push(_local4.__get__rendezvousPoint());
} else if (_local4 == _local2) {
_local1.pop();
_local1.push(_local4.__get__rendezvousPoint());
} else {
_local1.pop();
_local1.pop();
_local1.push(_local2.__get__rendezvousPoint());
}
return(_local1);
}
static function getPathBetweenTables(t1, t2) {
if (isSameTable(t1, t2)) {
return([t1.__get__rightPoint(), t1.__get__arrivePoint()]);
}
var _local4 = [];
var _local2 = (((t1.__get__RowNum().i != t2.__get__RowNum().i) && (t1.__get__RowNum().j != t2.__get__RowNum().j)) ? (((t1.__get__rendezvousPoint().x < t2.__get__rendezvousPoint().x) ? (Table.getTableByIJ(t1.__get__RowNum().i, t2.__get__RowNum().j)) : (Table.getTableByIJ(t2.__get__RowNum().i, t1.__get__RowNum().j)))) : (t2));
_local4.push(((((t1.__get__arrivePoint().x - _local2.__get__arrivePoint().x) * (t1.__get__arrivePoint().y - _local2.__get__arrivePoint().y)) > 0) ? (t1.__get__rightPoint()) : (t1.__get__leftPoint())));
if (t2 == _local2) {
_local4.push(((((t1.__get__arrivePoint().x - _local2.__get__arrivePoint().x) * (t1.__get__arrivePoint().y - _local2.__get__arrivePoint().y)) > 0) ? (_local2.__get__rightPoint()) : (_local2.__get__leftPoint())));
_local4.push(_local2.__get__arrivePoint());
} else {
_local4.push(_local2.__get__rendezvousPoint());
_local4.push(((((t2.__get__arrivePoint().x - _local2.__get__arrivePoint().x) * (t2.__get__arrivePoint().y - _local2.__get__arrivePoint().y)) > 0) ? (t2.__get__rightPoint()) : (t2.__get__leftPoint())));
_local4.push(t2.__get__arrivePoint());
}
return(_local4);
}
static function isSameTable(t1, t2) {
return((t1.__get__rendezvousPoint().x == t2.__get__rendezvousPoint().x) && (t1.__get__rendezvousPoint().y == t2.__get__rendezvousPoint().y));
}
}
Symbol 814 MovieClip [__Packages.Direction] Frame 0
class Direction
{
function Direction () {
}
static var FACE = 1;
static var BACK = 2;
static var LEFT = 3;
static var RIGHT = 4;
}
Symbol 815 MovieClip [__Packages.mx.transitions.easing.None] Frame 0
class mx.transitions.easing.None
{
function None () {
}
static function easeNone(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeIn(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeInOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static var version = "1.1.0.52";
}
Symbol 816 MovieClip [__Packages.CustomerType] Frame 0
class CustomerType
{
function CustomerType () {
}
static function get HEPGUY() {
return(0);
}
static function get HEPGIRL() {
return(1);
}
static function get GEEKGUY() {
return(2);
}
static function get GEEKGIRL() {
return(3);
}
static function get LESBIAN() {
return(4);
}
static function get GAY() {
return(5);
}
static function get TYPES() {
return(["HepGuy", "HepGirl", "GeekGuy", "GeekGirl", "Lesbian", "Gay"]);
}
static function get RELASION() {
return([[-1, 3, -2, 1, 1, -2], [3, -1, 1, -2, 1, -1], [-1, 2, -1, 2, 1, -1], [2, -2, 2, 2, -2, -1], [1, 2, -1, 1, 2, -1], [2, -1, 1, -1, 1, 3]]);
}
static function get KISSDEPTHS() {
return([2, 0, 1, 2, 2, 2]);
}
static function createCouple(c1, c2) {
var _local2 = RELASION[c1.__get__type()][c2.__get__type()];
var _local1 = RELASION[c2.__get__type()][c1.__get__type()];
c1.changeHearts(_local2);
c2.changeHearts(_local1);
}
}
Symbol 817 MovieClip [__Packages.mx.transitions.easing.Elastic] Frame 0
class mx.transitions.easing.Elastic
{
function Elastic () {
}
static function easeIn(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
t = t - 1;
return((-((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
static function easeOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
return((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) + c) + b);
}
static function easeInOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / (d / 2);
if (t == 2) {
return(b + c);
}
if (!p) {
p = d * 0.45;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
if (t < 1) {
t = t - 1;
return((-0.5 * ((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
t = t - 1;
return(((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) * 0.5) + c) + b);
}
static var version = "1.1.0.52";
}
Symbol 818 MovieClip [__Packages.McTools] Frame 0
class McTools
{
function McTools () {
}
static function isAncestorOf(mc1, mc2) {
while (mc2 != _root) {
if (mc1 == mc2) {
return(true);
}
mc2 = mc2._parent;
}
return(false);
}
static function isMouseInMc(mc) {
var _local2 = mc.getBounds(mc);
return((((mc._xmouse <= _local2.xMax) && (mc._xmouse >= _local2.xMin)) && (mc._ymouse <= _local2.yMax)) && (mc._ymouse >= _local2.yMin));
}
}
Symbol 819 MovieClip [__Packages.Kitchen] Frame 0
class Kitchen extends MissionItem
{
var chef, __get__mc, menuList, foodList, __set__status, _status;
function Kitchen ($mc, $data) {
super($mc);
chef = __get__mc()[$data.chefName];
menuList = [];
foodList = [];
__set__status(REST);
}
function busyHandle() {
chef.gotoAndStop(BUSY);
}
function restHandle() {
chef.gotoAndStop(REST);
}
function addMenu(t) {
menuList.push(t);
cook();
}
function tableCustomerAngry(t) {
var _local2 = 0;
while (_local2 < foodList.length) {
var _local3 = Food(foodList[_local2]);
if (_local3.__get__table() == t) {
_local3.__get__mc().removeMovieClip();
foodList.splice(_local2, 1);
break;
}
_local2++;
}
_local2 = 0;
while (_local2 < menuList.length) {
if (t == menuList[_local2]) {
menuList.splice(_local2, 1);
cook();
break;
}
_local2++;
}
}
function getFood(food) {
var _local2 = 0;
while (_local2 < foodList.length) {
if (food == foodList[_local2]) {
foodList.splice(_local2, 1);
refresh();
break;
}
_local2++;
}
return(food);
}
function cook() {
if (isBusy()) {
return(undefined);
}
__set__status(BUSY);
var t = Table(menuList.shift());
var obj = this;
var interval = setInterval(function () {
obj.createFood(t);
clearInterval(interval);
}, cookDelay);
}
function isBusy() {
return(_status == BUSY);
}
function createFood(t) {
if (t.__get__isNotFull() || (t.__get__customerLeave())) {
__set__status(REST);
if (menuList.length > 0) {
cook();
}
return(undefined);
}
var _local3 = new Food(__get__mc().attachMovie(MissionData.DATA[Mission.getMission().__get__id()].food.linkName, "food" + getTimer(), __get__mc().getNextHighestDepth()), t);
foodList.unshift(_local3);
refresh();
var _local2 = new Sound();
_local2.attachSound("Ling");
_local2.start();
__set__status(REST);
if (menuList.length > 0) {
cook();
}
return(_local3);
}
function refresh() {
var _local2 = 0;
while (_local2 < foodList.length) {
Food(foodList[_local2]).__get__mc().swapDepths(_local2);
_local2++;
}
}
static var BUSY = "busy";
static var REST = "rest";
var cookDelay = 3000;
}
Symbol 820 MovieClip [__Packages.BoundItem] Frame 0
class BoundItem extends MissionItem
{
var _num, _heartsNum, __get__mc;
function BoundItem ($mc, $num, $heartsNum) {
super($mc);
_num = ($num ? ($num) : 1);
_heartsNum = ($heartsNum ? ($heartsNum) : 1);
}
static function getHarp(_parent, initObj) {
trace("\u7AD6\u7434");
var _local2 = (_parent ? (_parent.attachMovie(Harp.__get__MCLINK(), "harp" + getTimer(), _parent.getNextHighestDepth(), initObj)) : null);
var _local3 = new Harp(_local2, 1, 1);
return(_local3);
}
static function getCandle(_parent, initObj) {
trace("\u8721\u70DB");
var _local2 = (_parent ? (_parent.attachMovie(Candle.__get__MCLINK(), "candle" + getTimer(), _parent.getNextHighestDepth(), initObj)) : null);
var _local3 = new Candle(_local2, 1, 2);
return(_local3);
}
function get num() {
return(_num);
}
function get table() {
return(_table);
}
function get heartsNum() {
return(_heartsNum);
}
function terminate() {
__get__mc().removeMovieClip();
}
var _table = null;
}
Symbol 821 MovieClip [__Packages.Harp] Frame 0
class Harp extends BoundItem
{
var __get__mc, _num, __get__num, terminate;
function Harp ($mc, $num, $heartsNum) {
super($mc, $num, $heartsNum);
init();
}
static function get MCLINK() {
return("Harp");
}
static function get PLAYDELAY() {
return(3000);
}
static function get READYLABEL() {
return("ready");
}
static function get PLAYINGLABEL() {
return("playing");
}
function init() {
var obj = this;
__get__mc().gotoAndStop(READYLABEL);
__get__mc().onRelease = function () {
obj.__get__mc().gotoAndStop(Harp.__get__PLAYINGLABEL());
var interval = setInterval(function () {
obj.active();
clearInterval(interval);
}, Harp.__get__PLAYDELAY());
};
}
function active() {
Mission.getMission().getBound(this);
_num--;
if (__get__mc() && (__get__num() <= 0)) {
terminate();
}
}
}
Symbol 822 MovieClip [__Packages.Candle] Frame 0
class Candle extends BoundItem
{
var _mc, __get__mc, bornPoint, __get__table, _table, _num, __get__num, terminate;
function Candle ($mc, $num, $heartsNum) {
super($mc, $num, $heartsNum);
init();
}
static function get MCLINK() {
return("Candle");
}
static function get FIREDELAY() {
return(3000);
}
function set mc(value) {
_mc.removeMovieClip();
_mc = value;
//return(__get__mc());
}
function init() {
bornPoint = new flash.geom.Point(__get__mc()._x, __get__mc()._y);
var obj = this;
__get__mc().onPress = function () {
obj.__get__mc().onMouseMove = function () {
obj.onMouseMove();
updateAfterEvent();
};
obj.__get__mc().startDrag();
Mission.getMission().draggingMc = this;
Mission.getMission().refreshDepth();
};
__get__mc().onRelease = function () {
obj.mcDropped();
};
}
function onMouseMove() {
if (__get__table() == null) {
_table = getTouchTable();
} else if (McTools.isMouseInMc(__get__table().__get__mc())) {
__get__table().onRollOver();
} else {
__get__table().onRollOut();
_table = null;
}
}
function mcDropped() {
_table = getTouchTable();
__get__mc().stopDrag();
__get__mc().onMouseMove = null;
Mission.getMission().draggingMc = null;
var obj = this;
if (__get__table() != null) {
__get__mc().onPress = null;
__get__mc().onRelease = null;
__get__mc().removeMovieClip();
mc = (__get__table().__get__deskMc().attachMovie(MCLINK, "candleOnDesk" + getTimer(), __get__table().__get__deskMc().getNextHighestDepth(), {_x:-15, _y:-20}));
var interval = setInterval(function () {
obj.active();
clearInterval(interval);
}, FIREDELAY);
} else {
__get__mc()._x = bornPoint.x;
__get__mc()._y = bornPoint.y;
}
}
function getTouchTable() {
var _local2 = Mission.getMission().__get__tables();
var _local1 = 0;
while (_local1 < _local2.length) {
if ((McTools.isMouseInMc(_local2[_local1].mc) && (Table(_local2[_local1]).__get__numCustomers() >= Table(_local2[_local1]).__get__maxNumCustomers())) && (!Table(_local2[_local1]).__get__customerLeave())) {
return(_local2[_local1]);
}
_local1++;
}
return(null);
}
function active() {
Mission.getMission().getBound(this);
_num--;
if (__get__mc() && (__get__num() <= 0)) {
terminate();
}
}
}
Symbol 100 MovieClip Frame 120
stop();
trace("----------------------------");
_root.gotoAndStop("lblloader");
Symbol 216 MovieClip Frame 1
back_btn.onRelease = function () {
_visible = false;
};
start_btn.onRelease = function () {
_parent._parent.nextFrame();
};
Symbol 220 MovieClip Frame 1
back_btn.onRelease = function () {
_visible = false;
};
start_btn.onRelease = function () {
_parent._parent.nextFrame();
};
Symbol 221 MovieClip Frame 1
skip_btn.onRelease = function () {
gotoAndStop (141);
};
Symbol 221 MovieClip Frame 141
start_btn.onRelease = function () {
_parent.nextFrame();
};
story_btn.onRelease = function () {
story_mc._visible = true;
};
intr_btn.onRelease = function () {
intr_mc._visible = true;
};
story_mc._visible = false;
intr_mc._visible = false;
Symbol 221 MovieClip Frame 151
stop();
Symbol 303 MovieClip [UI] Frame 2
_root.obj_game._gstatus = "gameover";
_root.partner_score = Mission.totalCashes;
submit_btn.onRelease = function () {
Mission.root.gotoAndStop("gameover");
};
Symbol 745 MovieClip Frame 1
stop();
startBtn.onRelease = function () {
gotoAndStop (2);
};
Symbol 745 MovieClip Frame 2
var mission = Mission.createMission(0, mc);
mission.initMission();
Symbol 772 MovieClip Frame 1
stop();
startBtn.onRelease = function () {
gotoAndStop (2);
};
Symbol 772 MovieClip Frame 2
var mission = Mission.createMission(1, mc);
mission.initMission();
Symbol 785 MovieClip Frame 1
stop();
startBtn.onRelease = function () {
gotoAndStop (2);
};
Symbol 785 MovieClip Frame 2
var mission = Mission.createMission(2, mc);
mission.initMission();
Symbol 795 MovieClip Frame 71
stop();
Symbol 799 MovieClip Frame 1
Mission.root = this;
stop();
Symbol 799 MovieClip Frame 2
stop();
Symbol 799 MovieClip Frame 3
Mission.terminateCurrent();
Symbol 799 MovieClip Frame 4
Mission.terminateCurrent();
Symbol 799 MovieClip Frame 5
_root.obj_game._gstatus = "gamecompleted";
_root.partner_score = Mission.totalCashes;
btn.onRelease = function () {
gotoAndStop (1);
};
submit_btn.onRelease = function () {
gotoAndStop ("gameover");
};
Symbol 799 MovieClip Frame 6
gotoAndStop(Mission.current + 2);