Frame 1
_root._soundbuftime = 0;
totalBytes = Math.round(getBytesTotal() / 1024);
loadedBytes = Math.round(getBytesLoaded() / 1024);
percentDone = Math.round((loadedBytes / totalBytes) * 100);
percentone = totalBytes / 100;
percent = Math.round(loadedBytes / percentone);
if (_root._framesloaded >= _root._totalframes) {
gotoAndPlay (5);
}
Frame 2
gotoAndPlay (1);
Frame 5
function LoadMap(n) {
_root.gotoAndStop("load_map");
var _local1 = "" + n;
if (_local1.length == 1) {
_local1 = "00" + _local1;
} else if (_local1.length == 2) {
_local1 = "0" + _local1;
}
_local1 = _local1 + ".swf";
_local1 = "maps/" + _local1;
map_loader.filename = _local1;
map_loader.gotoAndPlay(3);
map_loader._x = 100;
}
function UpdateLifes() {
var vtotal = 5;
i = 1;
while (i <= vtotal) {
if (_root.Lifes >= i) {
eval ("lifes_panel.life" + i)._visible = true;
} else {
eval ("lifes_panel.life" + i)._visible = false;
}
i++;
}
if (vtotal < _root.Lifes) {
lifes_panel.more._visible = true;
} else {
lifes_panel.more._visible = false;
}
}
function UpdateFolders() {
var folders = (_root.Office.folders - _root.Office.FoldersCollected);
var vtotal = 5;
i = 1;
while (i <= vtotal) {
if (folders >= i) {
eval ("folders_panel.folder" + i)._visible = true;
} else {
eval ("folders_panel.folder" + i)._visible = false;
}
i++;
}
if (vtotal < folders) {
folders_panel.more._visible = true;
} else {
folders_panel.more._visible = false;
}
}
function UpdateTodayName() {
switch (Today.GetDate()) {
case 1 :
ext = "st";
break;
case 21 :
ext = "st";
break;
case 31 :
ext = "st";
break;
case 2 :
ext = "nd";
break;
case 22 :
ext = "nd";
break;
case 3 :
ext = "rd";
break;
case 23 :
ext = "rd";
break;
default :
ext = "th";
}
TodayName = (((((Today.GetDayName() + ", ") + Today.getMonthName()) + " ") + Today.GetDate()) + ext) + " ";
}
function IsModalOpen(wname) {
var ItsOpen = false;
i = 1;
while (i <= _root.popupwindows) {
if (eval ("_root.box" + i).title == wname) {
ItsOpen = true;
}
i++;
}
trace("wname is" + ItsOpen);
return(ItsOpen);
}
function CloseAllPopups() {
i = 1;
while (i <= _root.popupwindows) {
eval ("_root.box" + i).removeMovieClip();
i++;
}
_root.StopMusic("loop", true);
_root.popupwindows = 0;
}
function ModalWindow(wname) {
if (!_root.IsModalOpen(wname)) {
if (wname != "pause") {
_root.PlayMusic("loop");
}
popupwindows++;
var zorder = (_root.messageBoxZ + _root.popupwindows);
trace("zwindow order:" + zorder);
_root.createEmptyMovieClip("box" + popupwindows, zorder);
eval ("_root.box" + popupwindows)._x = 374;
eval ("_root.box" + popupwindows)._y = 200;
eval ("_root.box" + popupwindows).title = wname;
eval ("_root.box" + popupwindows).attachMovie("cover", "cover", 1);
eval ("_root.box" + popupwindows).attachMovie(wname + "_box", "box" + popupwindows, 2);
eval (((("_root.box" + popupwindows) + ".") + "box") + popupwindows)._x = eval (((("_root.box" + popupwindows) + ".") + "box") + popupwindows)._x + (3 * (popupwindows - 1));
eval (((("_root.box" + popupwindows) + ".") + "box") + popupwindows)._y = eval (((("_root.box" + popupwindows) + ".") + "box") + popupwindows)._y + (3 * (popupwindows - 1));
eval ("_root.box" + popupwindows).GlobalStop = _root.GlobalStop;
if (_root.GlobalStop == false) {
_root.GlobalStop = true;
}
eval (((("_root.box" + popupwindows) + ".") + "box") + popupwindows).message = _root.message;
if ((wname = "won")) {
eval (((("_root.box" + popupwindows) + ".") + "box") + popupwindows).message = "You did it! Now go enjoy all the benefits of a new life \u2013 lying on a beach, sipping on a cold drink, enjoying the sun, and feeling like a winner. You are far away from the office, your boss, and all cubicle life\u2026 \u2019til the end of vacation\u2026";
}
if ((wname = "lost")) {
eval (((("_root.box" + popupwindows) + ".") + "box") + popupwindows).message = " Your wife left you, your friends aren\u2019t calling, you sit for days without electricity in your small apartment. Face the facts! You are a LOSER!!! \n \n Though, you can always try again.";
}
}
}
function Bottler() {
var _local1 = _root;
_local1.attachMovie("bottler", "bpanel", BottlerZOrder);
trace(_local1.bpanel._x);
_local1.bpanel._x = 660;
_local1.bpanel._y = 50;
_local1.StopMusic("clock", true);
_local1.PlayMagicSound("clock", 50);
}
function UnBottler() {
var _local1 = _root;
_local1.MonsterStop = false;
_local1.StopMusic("clock", true);
_local1.bpanel.removeMovieClip();
}
function PlaySound(soundname, loops) {
if (SoundOn) {
s = new Sound();
s.attachSound(soundname);
s.start(0, loops);
}
}
function PlayMagicSound(soundname, loops) {
if (SoundOn) {
mloop = new Sound();
mloop.attachSound(soundname);
mloop.start(0, loops);
}
}
function PlayMusic(soundname) {
if ((SoundOn and MusicOn) && (!MusicPlaying)) {
sloop = new Sound();
sloop.setVolume(70);
sloop.attachSound(soundname);
sloop.start(0, 1000);
_root.MusicPlaying = true;
}
}
function StopMusic(soundname, force) {
if ((_root.popupwindows == 0) or force) {
sloop.stop(soundname);
sloop = null;
mloop.stop(soundname);
mloop = null;
_root.MusicPlaying = false;
}
}
function AddKeyListeners() {
KeyListener = new Object();
KeyListener.onKeyDown = function () {
switch (Key.getCode()) {
case 32 :
trace("game paused...");
ModalWindow("pause");
break;
case 27 :
trace("game paused...");
ModalWindow("pause");
break;
case 65 :
trace("game paused...");
ModalWindow("about");
break;
case 72 :
trace("game paused...");
ModalWindow("help");
break;
case 112 :
trace("game paused...");
ModalWindow("help");
break;
case 81 :
trace("game paused...");
ModalWindow("quit");
break;
case 83 :
trace("switch sound...");
_root.sound_panel.play();
break;
case 13 :
if (_root.popupwindows == 0) {
break;
}
if (_root.popupwindows == 1) {
_root.StopMusic("loop", true);
}
eval (((("_root.box" + popupwindows) + ".") + "box") + popupwindows).Enter();
}
if (Cheating) {
if (Key.isDown(71) && (Key.isDown(79))) {
_root.reset_map.ChangeMap = true;
_root.StopMusic("loop", true);
_root.reset_map.play();
}
if (Key.isDown(82) && (Key.isDown(85))) {
_root.reset_map.ChangeMap = true;
_root.StopMusic("loop", true);
_root.MapNumber = _root.MapNumber + 9;
if (MapNumber > maps) {
MapNumber = maps;
}
_root.reset_map.play();
}
if (Key.isDown(69) && (Key.isDown(82))) {
if (_root.MapNumber > 1) {
_root.StopMusic("loop", true);
_root.MapNumber = _root.MapNumber - 2;
_root.reset_map.ChangeMap = true;
_root.reset_map.play();
}
}
if (((Key.isDown(69) && (Key.isDown(70))) && (Key.isDown(73))) && (Key.isDown(76))) {
_root.Lifes++;
_root.UpdateLifes();
}
if ((Key.isDown(68) && (Key.isDown(73))) && (Key.isDown(69))) {
if (_root.Lifes > 0) {
_root.Lifes--;
}
_root.UpdateLifes();
}
}
};
Key.addListener(KeyListener);
}
function DeleteKeyListeners() {
Key.removeListener(KeyListener);
}
fscommand ("allowscale", false);
Stage.showMenu = false;
_highquality = 0;
database = false;
mOzaic = true;
Cheating = true;
domain = "http://www.dailyfreegames.com/hsgamefiles/treasure_hunter/";
if (String(disarea) == "") {
disarea = false;
}
disarea = true;
PlayerID = 0;
PlayerName = "";
_root.StopMusic("loop", true);
AddKeyListeners();
LoadSaved = true;
SoundOn = true;
MusicOn = true;
GameStarted = false;
Frame 6
function Character(name, style, logic, row, col, dir) {
var _local1 = this;
var _local2 = _root;
_local1.name = name;
_local1.style = style;
_local1.logic = logic;
_local1.row = row;
_local1.col = col;
_local1.dir = dir;
_local1.phase = 0;
_local1.mName = "m" + _local1.name;
var MaxCols = 30;
var _local3 = Math.getZOrder(row, col, _local2.CharacterZOrder);
_local2.mOffice.attachMovie("characters", _local1.mName, _local3);
_local1.TurnTo(_local1.dir);
_local2.mOffice[_local1.mName].attachMovie(_local1.logic, "brain", 1);
_local2.mOffice[_local1.mName].brain.oName = _local1.name;
_local2.Office.PlaceCharacter(_local1.name, _local1.row, _local1.col);
_local1.ReDraw();
}
function Map(xpos, ypos, rows, cols, tilew, tileh, aFloor, aFurniture, aCharacters) {
var _local1 = this;
_local1.rows = rows;
_local1.cols = cols;
_local1.tileW = tilew;
_local1.tileH = tileh;
_local1.aFloor = new Array();
_local1.aFloor = aFloor;
_local1.aFurniture = new Array();
_local1.aFurniture = aFurniture;
_local1.aCharacters = new Array();
_local1.aCharacters = aCharacters;
_local1.FurnitureAlpha = 100;
_local1.FoldersCollected = 0;
_local1.folders = 0;
_local1.Score = 0;
_local1.Draw();
}
_root.message_box.removeMovieClip();
_root.pause_box.removeMovieClip();
_root.help_box.removeMovieClip();
_root.about_box.removeMovieClip();
_root.quit_box.removeMovieClip();
debug = false;
editing = false;
GlobalStop = true;
MonsterStop = false;
Score = 0;
score_panel.Init();
Lifes = 3;
UpdateLifes();
UpdateFolders();
maps = 48;
MapNumber = 1;
Sex = "male";
MapEntered = 0;
BottleDuration = 9;
popupwindows = 0;
MusicPlaying = false;
PayCheckDay = 5;
FirstWorkDay = 3;
MouseEnabled = true;
MouseX = 0;
MouseY = 0;
bubbles = 0;
_root.FloorZ = 0;
_root.MaxFloorZ = 5000;
_root.CharacterZOrder = 10;
_root.ObjectZOrder = 2;
_root.mousePointerZOrder = 6;
_root.mouseUIZOrder = 7;
_root.BubblesZOrder = 30000;
_root.BottlerZOrder = 15898;
_root.EditGridZOrder = 20000;
_root.resetMap = 15899;
_root.messageBoxZ = 15900;
_root.messageBoxZLoader = 15921;
_root.attachMovie("reset_map", "reset_map", _root.resetMap);
_root.reset_map._x = -50;
_root.reset_map._x = -100;
Math.isEven = function (n) {
return((n % 2) == 0);
};
Math.getZOrder = function (row, col, personalOrder) {
var _local1 = personalOrder;
if (_local1 == undefined) {
_local1 = 1;
}
var _local2 = (((row * 500) + (col * 10)) + _root.MaxFloorZ) + _local1;
return(_local2);
};
Math.GetRandom = function (min, max) {
return(Math.floor(Math.random() * ((max - min) + 1)) + min);
};
Array.prototype.Init2D = function (rows, cols) {
var _local1 = this;
var _local2 = cols;
var _local3 = rows;
ii = 0;
while (ii < _local3) {
_local1[ii] = new Array(_local2);
jj = 0;
while (jj < _local2) {
_local1[ii][jj] = new Array("empty", 0);
jj++;
}
ii++;
}
};
Array.prototype.InitEmptyArray = function (rows, cols) {
var _local1 = this;
var _local2 = cols;
var _local3 = rows;
ii = 0;
while (ii < _local3) {
_local1[ii] = new Array(_local2);
jj = 0;
while (jj < _local2) {
_local1[ii][jj] = 0;
jj++;
}
ii++;
}
};
Array.prototype.Copy2D = function (fromA) {
var _local1 = fromA;
var _local2 = this;
ii = 0;
while (ii < _local1.length) {
jj = 0;
while (jj < _local1[0].length) {
_local2[ii][jj][0] = _local1[ii][jj][0];
_local2[ii][jj][1] = _local1[ii][jj][1];
jj++;
}
ii++;
}
};
Array.prototype.Show2D = function (rows, cols, el) {
var _local3 = el;
ii = 0;
while (ii < rows) {
jj = 0;
while (jj < cols) {
trace(this[ii][jj][_local3]);
var _local1 = ii + 1;
var _local2 = jj + 1;
jj++;
}
ii++;
}
};
Array.prototype.PrintFormat = function () {
var _local1 = this;
PrintFormat = "[";
PrintFormat = PrintFormat + newline;
ii = 0;
while (ii < _local1.length) {
PrintFormat = PrintFormat + "[";
jj = 0;
while (jj < _local1[0].length) {
PrintFormat = PrintFormat + "[";
PrintFormat = PrintFormat + (("'" + _local1[ii][jj][0]) + "'");
PrintFormat = PrintFormat + ",";
if (isNaN(_local1[ii][jj][1])) {
PrintFormat = PrintFormat + "'";
}
PrintFormat = PrintFormat + _local1[ii][jj][1];
if (isNaN(_local1[ii][jj][1])) {
PrintFormat = PrintFormat + "'";
}
PrintFormat = PrintFormat + "]";
if (jj != (_local1[0].length - 1)) {
PrintFormat = PrintFormat + ",";
}
jj++;
}
PrintFormat = PrintFormat + "]";
if (ii != (_local1.length - 1)) {
PrintFormat = PrintFormat + ",";
}
PrintFormat = PrintFormat + newline;
ii++;
}
PrintFormat = PrintFormat + "]";
return(PrintFormat);
};
Date.prototype.getDayName = function () {
var _local1 = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
return(_local1[this.getUTCDay()]);
};
Date.prototype.getMonthName = function () {
var _local1 = (monthnames = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"));
return(_local1[this.getUTCMonth()]);
};
Date.prototype.leapYear = function () {
var _local1 = this.getUTCFullYear();
if ((((_local1 % 4) == 0) && ((_local1 % 100) != 0)) || ((_local1 % 400) == 0)) {
return(true);
}
return(false);
};
Date.prototype.getDaysInMonth = function () {
var _local1 = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
if (this.leapyear() == true) {
_local1[1] = 29;
}
return(_local1[this.getUTCMonth()]);
};
Date.prototype.getNextWorkDay = function () {
var _local1 = new Date(this);
days = 1;
if (_local1.GetDay() == 5) {
days = 3;
}
if (_local1.GetDay() == 6) {
days = 2;
}
if (_local1.GetDay() == 7) {
days = 1;
}
_local1.setTime(_local1.getTime() + (86400000 * days));
return(_local1);
};
Date.prototype.getWorkDay = function (n) {
var _local2 = n;
var _local1 = new Date(this);
i = 1;
while (i < _local2) {
_local1 = _local1.getNextWorkDay();
i++;
}
return(_local1);
};
Character.prototype.Remove = function (row, col) {
_root.mOffice[this.mName].removeMovieClip();
this = null;
_root.Office.ClearCharacter(row, col);
};
Character.prototype.ReDraw = function () {
var _local1 = this;
var _local2 = _root;
var d;
var itmp;
var jtmp;
_local2.mOffice[_local1.mName]._x = ((tileW * _local1.col) + ((tileW * Math.IsEven(_local1.row)) / 2)) - (tileW / 2);
_local2.mOffice[_local1.mName]._y = (tileH / 2) * _local1.row;
_local2.mOffice[_local1.mName].gotoAndStop(_local1.style);
_local2.mOffice[_local1.mName].phases.gotoAndStop(_local1.phase);
};
Character.prototype.Move = function (dir) {
var _local1 = this;
var _local2 = dir;
var _local3 = _root;
if (_local3.GlobalStop) {
return(0);
}
if (_local3.MonsterStop && (_local1.name != "worker")) {
return(0);
}
if ((((_local2 == "up") || (_local2 == "down")) || (_local2 == "right")) || (_local2 == "left")) {
if (!_local3.Office.CheckStatus(_local1.name, _local1.ChangeRow(_local2, _local1.row, _local1.col), _local1.ChangeCol(_local2, _local1.row, _local1.col))) {
_local1.TurnTo(_local2);
_local2 = "whatever";
}
}
if (_local2 == "whatever") {
if (_local1.phase != 0) {
_local1.Step(_local1.dir, true);
}
} else {
_local1.Step(_local2, false);
}
return(undefined);
};
Character.prototype.Step = function (dir, tostop) {
var _local1 = this;
var _local2 = _root;
var _local3 = dir;
var MaxCols = 30;
if ((_local1.dir != _local3) && ((_local1.phase != 0) && (_local1.phase != _local2.steps))) {
_local3 = _local1.dir;
}
if ((((_local3 == "up") || (_local3 == "down")) || (_local3 == "right")) || (_local3 == "left")) {
if (_local1.dir == _local3) {
if (tostop && (_local1.phase == _local2.steps)) {
} else {
_local2.mOffice[_local1.mName]._x = _local1.ChangePosX(_local3, _local2.mOffice[_local1.mName]._x);
_local2.mOffice[_local1.mName]._y = _local1.ChangePosY(_local3, _local2.mOffice[_local1.mName]._y);
d = Math.getZOrder(_local1.row, _local1.col, _local2.CharacterZOrder);
_local2.mOffice[_local1.mName].swapDepths(d);
}
_local1.phase = _local1.phase + 1;
if (_local1.phase > _local2.steps) {
if (!tostop) {
_local1.phase = 1;
} else {
_local1.phase = 0;
}
}
}
_local2.mOffice[_local1.mName].phases.gotoAndStop(_local3 + "_stop");
_local2.mOffice[_local1.mName].phases.gotoAndStop(_local2.mOffice[_local1.mName].phases._currentframe + _local1.phase);
_local1.dir = _local3;
if (_local1.phase == 1) {
_local2.Office.ClearCharacter(_local1.row, _local1.col);
var hold_row = _local1.row;
_local1.row = _local1.ChangeRow(_local3, _local1.row, _local1.col);
_local1.col = _local1.ChangeCol(_local3, hold_row, _local1.col);
_local2.Office.PlaceCharacter(_local1.name, _local1.row, _local1.col);
if (_local1.name != "worker") {
_local2.PlaySound("step1");
} else {
_local2.PlaySound("step2");
}
}
}
};
Character.prototype.TurnTo = function (dir) {
_root.mOffice[this.mName].phases.gotoAndStop(dir + "_stop");
};
Character.prototype.ChangeRow = function (dir, row, col) {
var _local1 = row;
var _local2 = dir;
if (_local2 == "up") {
return(_local1 - 1);
}
if (_local2 == "left") {
return(_local1 + 1);
}
if (_local2 == "right") {
return(_local1 - 1);
}
if (_local2 == "down") {
return(_local1 + 1);
}
if (_local2 == "whatever") {
return(_local1);
}
return(undefined);
};
Character.prototype.ChangeCol = function (dir, row, col) {
var _local1 = col;
var _local2 = dir;
var _local3 = row;
if (_local2 == "up") {
if (!Math.IsEven(_local3)) {
return(_local1 - 1);
}
return(_local1);
}
if (_local2 == "down") {
if (Math.IsEven(_local3)) {
return(_local1 + 1);
}
return(_local1);
}
if (_local2 == "right") {
if (Math.IsEven(_local3)) {
return(_local1 + 1);
}
return(_local1);
}
if (_local2 == "left") {
if (!Math.IsEven(_local3)) {
return(_local1 - 1);
}
return(_local1);
}
if (_local2 == "whatever") {
return(_local1);
}
return(undefined);
};
Character.prototype.ChangePosX = function (dir, x) {
var _local1 = _root;
var _local2 = dir;
var _local3 = x;
if (_local2 == "up") {
return(_local3 - _local1.StepX);
}
if (_local2 == "down") {
return(_local3 + _local1.StepX);
}
if (_local2 == "right") {
return(_local3 + _local1.StepX);
}
if (_local2 == "left") {
return(_local3 - _local1.StepX);
}
return(undefined);
};
Character.prototype.ChangePosY = function (dir, y) {
var _local1 = _root;
var _local2 = y;
var _local3 = dir;
if (_local3 == "up") {
return(_local2 - _local1.StepY);
}
if (_local3 == "down") {
return(_local2 + _local1.StepY);
}
if (_local3 == "right") {
return(_local2 - _local1.StepY);
}
if (_local3 == "left") {
return(_local2 + _local1.StepY);
}
return(undefined);
};
Map.prototype.Draw = function () {
var _local3 = _root;
var d;
var _local2;
var _local1;
var MaxCols = 30;
_local3.createEmptyMovieClip("mOffice", 5);
_local3.mOffice._x = _local3.MapPozX;
_local3.mOffice._y = _local3.MapPozY;
i = 0;
while (i < this.rows) {
j = 0;
while (j < this.cols) {
_local2 = i + 1;
_local1 = j + 1;
d = ((_local2 * 70) + (_local1 * 1)) + _local3.FloorZ;
_local3.mOffice.attachMovie("floor", (("t_" + _local2) + "_") + _local1, d);
_local3.mOffice[(("t_" + _local2) + "_") + _local1]._x = ((tileW * j) - ((tileW * Math.IsEven(i)) / 2)) + (tileW / 2);
_local3.mOffice[(("t_" + _local2) + "_") + _local1]._y = (tileH / 2) * i;
_local3.mOffice[(("t_" + _local2) + "_") + _local1].gotoAndStop(this.aFloor[i][j][0]);
j++;
}
i++;
}
i = 0;
while (i < this.rows) {
j = 0;
while (j < this.cols) {
_local2 = i + 1;
_local1 = j + 1;
d = Math.getZOrder(_local2, _local1, 1);
var fName = this.aFurniture[i][j][0];
if (((fName != "empty") && (fName != "")) && (fName.substr(0, 6) != "volume")) {
_local3.mOffice.attachMovie("furniture", (("f_" + _local2) + "_") + _local1, d);
_local3.mOffice[(("f_" + _local2) + "_") + _local1]._x = ((tileW * j) - ((tileW * Math.IsEven(i)) / 2)) + (tileW / 2);
_local3.mOffice[(("f_" + _local2) + "_") + _local1]._y = (tileH / 2) * i;
_local3.mOffice[(("f_" + _local2) + "_") + _local1].gotoAndStop(this.aFurniture[i][j][0]);
if (fName == "folder") {
this.folders++;
}
}
j++;
}
i++;
}
this.InitCharacters();
};
Map.prototype.CheckBonuses = function (name, row, col) {
var _local1 = _root;
var _local2 = this;
var _local3 = row;
var sum = _local2.aFurniture[_local3 - 1][col - 1][1];
var bonusname = _local2.aFurniture[_local3 - 1][col - 1][0];
if (sum > 0) {
switch (bonusname) {
case "bottle" :
_local1.PlaySound("lamp", 1);
break;
case "folder" :
_local1.PlaySound("folder", 1);
break;
case "bonus1" :
_local1.PlaySound("bonus1", 1);
break;
default :
_local1.PlaySound("bonus", 1);
}
_local1.score = _local1.score + sum;
_local2.score = _local2.score + sum;
if (_local1.editing) {
_local1.mOffice[(("f_" + _local3) + "_") + col].gotoAndStop("empty");
} else {
_local2.RemoveFurniture(_local3, col);
}
_local2.Bubble("+" + sum, _local3, col);
_local2.aFurniture[_local3 - 1][col - 1][0] = "empty";
_local2.aFurniture[_local3 - 1][col - 1][1] = 0;
}
if (bonusname == "folder") {
trace("picked up a folder");
_local2.FoldersCollected++;
_local1.UpdateFolders();
if (_local2.folders == _local2.FoldersCollected) {
trace("done");
_local1.reset_map.ChangeMap = true;
_local1.reset_map.play();
}
}
if (bonusname == "bottle") {
trace("picked up a bottle");
_local1.Bottler();
}
if (bonusname == "heart") {
trace("picked up a heart");
_local1.Lifes++;
_local1.UpdateLifes();
}
};
Map.prototype.Bubble = function (txt, row, col) {
_root.bubbles = _root.bubbles + 1;
var bubble_name = ("bubble" + _root.bubbles);
_root.mOffice.attachMovie("bubble", bubble_name, _root.BubblesZOrder + _root.bubbles);
eval ("_root.mOffice." + bubble_name)._x = ((this.tileW * col) + ((this.tileW * Math.IsEven(row)) / 2)) - (this.tileW / 2);
eval ("_root.mOffice." + bubble_name)._y = ((this.tileH / 2) * row) - 60;
eval ("_root.mOffice." + bubble_name).bonus_text = txt;
};
Map.prototype.InitCharacters = function () {
var monsters = 0;
i = 0;
while (i < this.rows) {
j = 0;
while (j < this.cols) {
row = i + 1;
col = j + 1;
if (this.aCharacters[i][j][0] != "empty") {
var tstr = this.aCharacters[i][j][1];
var CLook = tstr.substring(0, tstr.indexOf(":"));
tstr = tstr.substring(tstr.indexOf(":") + 1);
var CBrain = tstr.substring(0, tstr.indexOf(":"));
tstr = tstr.substring(tstr.indexOf(":") + 1);
var CDir = tstr;
var CName = "";
if (CBrain == "controlled") {
CName = "worker";
} else {
monsters = monsters + 1;
CName = ("monster" + row) + col;
}
Set("_root." + CName, new Character(CName, CLook, CBrain, row, col, CDir));
eval ("_root." + CName).TurnTo(CDir);
this.aCharacters[i][j][0] = CName;
this.aCharacters[i][j][1] = 1;
}
j++;
}
i++;
}
};
Map.prototype.PlaceCharacter = function (name, row, col) {
var _local1 = this;
var _local2 = _root;
var _local3 = name;
if (((_local3 == "worker") && (_local1.aCharacters[row - 1][col - 1][1] != 0)) || ((_local3 != "worker") && (_local1.aCharacters[row - 1][col - 1][0] == "worker"))) {
_local2.GlobalStop = true;
_local2.PlaySound("lost", 1);
_local2.Lifes = _local2.Lifes - 1;
_local2.UpdateLifes();
_local2.score = _local2.score - _local1.score;
_local2.reset_map.play();
} else {
_local1.aCharacters[row - 1][col - 1][0] = _local3;
_local1.aCharacters[row - 1][col - 1][1] = 1;
if (_local3 == "worker") {
_local1.CheckBonuses(_local3, row, col);
}
}
};
Map.prototype.ClearCharacter = function (row, col) {
this.aCharacters[row - 1][col - 1][0] = "empty";
this.aCharacters[row - 1][col - 1][1] = 0;
};
Map.prototype.CheckStatus = function (name, row, col) {
var _local1 = row;
var _local2 = this;
var _local3 = col;
if (((_local2.aFloor[_local1 - 1][_local3 - 1][1] > 0) && (((_local2.aFurniture[_local1 - 1][_local3 - 1][1] >= 0) && (name == "worker")) || ((_local2.aFurniture[_local1 - 1][_local3 - 1][1] == 0) && (name != "worker")))) && ((((_local1 <= _local2.rows) && (_local1 > 0)) && (_local3 <= _local2.cols)) && (_local3 > 0))) {
if (_local2.aCharacters[_local1 - 1][_local3 - 1][1] != 0) {
if ((name == "worker") || (_local2.aCharacters[_local1 - 1][_local3 - 1][0] == "worker")) {
return(true);
}
return(false);
}
return(true);
}
return(false);
};
Map.prototype.Intercept = function (row, col) {
var _local1 = row;
var _local2 = this;
var _local3 = col;
if (((_local2.aFloor[_local1 - 1][_local3 - 1][1] >= 0) && (_local2.aFurniture[_local1 - 1][_local3 - 1][1] >= 0)) && ((((_local1 <= _local2.rows) && (_local1 > 0)) && (_local3 <= _local2.cols)) && (_local3 > 0))) {
if (_local2.aCharacters[_local1 - 1][_local3 - 1][1] != 0) {
if (_local2.aCharacters[_local1 - 1][_local3 - 1][0] == "worker") {
return(true);
}
return(false);
}
return(false);
}
return(false);
};
Map.prototype.RefreshFloor = function () {
var _local1 = this;
var d;
var _local3;
var _local2;
var MaxCols = 30;
i = 0;
while (i < _local1.rows) {
j = 0;
while (j < _local1.cols) {
_local3 = i + 1;
_local2 = j + 1;
_root.mOffice[(("t_" + _local3) + "_") + _local2].gotoAndStop(_local1.aFloor[i][j][0]);
j++;
}
i++;
}
};
Map.prototype.RemoveFurniture = function (row, col) {
var _local1 = row;
var _local2 = this;
var _local3 = col;
var TileName = _local2.aFurniture[_local1 - 1][_local3 - 1][0];
if (TileName.substr(0, 6) == "volume") {
_local2.RemoveFurniturebyVolume(TileName);
} else {
_local2.UnMarkFurnitureVolume(_local1, _local3);
_root.mOffice[(("f_" + _local1) + "_") + _local3].removeMovieClip();
_local2.aFurniture[_local1 - 1][_local3 - 1][0] = "empty";
_local2.aFurniture[_local1 - 1][_local3 - 1][1] = 0;
_local2.unMarkTile(_local1, _local3);
_local2.unMarkFurnitureVolume(_local1, _local3);
}
};
Map.prototype.RefreshFurniture = function () {
var _local1 = this;
var _local2 = _root;
var d;
var itmp;
var jtmp;
var MaxCols = 30;
i = 0;
while (i < _local1.rows) {
j = 0;
while (j < _local1.cols) {
row = i + 1;
col = j + 1;
_local2.mOffice[(("f_" + row) + "_") + col].gotoAndStop(_local1.aFurniture[i][j][0]);
j++;
}
i++;
}
};
Map.prototype.PlaceFloorTile = function (row, col, label, state, volume) {
var _local1 = row;
var _local2 = col;
var _local3 = this;
trace("label: " + label);
var TileName = _local3.aFloor[_local1 - 1][_local2 - 1][0];
if (_local3.CheckFloorVolume(_local1, _local2, label, volume)) {
if (label == "empty") {
_local3.RemoveFloor(_local1, _local2, label, volume);
_local3.RemoveFloorTile(_local1, _local2);
} else {
trace(_root.Grid.CArray[_local1 - 1][_local2 - 1][0]);
var Busy = ((_local3.aFurniture[_local1 - 1][_local2 - 1][0] != "empty") || (_root.Grid.CArray[_local1 - 1][_local2 - 1][0] != "empty"));
_local3.RemoveFloor(_local1, _local2, label, volume);
_root.mOffice[(("t_" + _local1) + "_") + _local2].gotoAndStop(label);
_root.mOffice[(("t_" + _local1) + "_") + _local2].volume = volume;
_local3.aFloor[_local1 - 1][_local2 - 1][0] = label;
_local3.aFloor[_local1 - 1][_local2 - 1][1] = state;
_local3.MarkFloorVolume(_local1, _local2, label, state, volume);
}
}
};
Map.prototype.PlaceDefaultFloorTile = function (row, col) {
var _local1 = row;
var _local2 = col;
tilenumber = 2;
_root.mOffice[(("t_" + _local1) + "_") + _local2].gotoAndStop(2 + ((tilenumber - 1) * _root.framespacing));
this.aFloor[_local1 - 1][_local2 - 1][0] = "tile1";
this.aFloor[_local1 - 1][_local2 - 1][1] = 1;
trace("default tile placed");
};
Map.prototype.PlaceFloor = function (label, state, overwrite) {
var _local1 = this;
var _local2 = label;
var _local3 = _root;
i = 0;
while (i < _local1.rows) {
j = 0;
while (j < _local1.cols) {
row = i + 1;
col = j + 1;
if (overwrite) {
var Busy = ((_local1.aFurniture[i][j][0] != "empty") || (_local3.Grid.CArray[i][j][0] != "empty"));
if (Busy && (_local2 == "empty")) {
} else {
_local1.aFloor[i][j][0] = _local2;
_local1.aFloor[i][j][1] = state;
_local3.mOffice[(("t_" + row) + "_") + col].gotoAndStop(_local2);
}
} else if (_local1.aFloor[i][j][0] != "empty") {
var Busy = ((_local1.aFurniture[i][j][0] != "empty") || (_local3.Grid.CArray[i][j][0] != "empty"));
if (Busy && (_local2 == "empty")) {
} else {
_local1.aFloor[i][j][0] = _local2;
_local1.aFloor[i][j][1] = state;
_local3.mOffice[(("t_" + row) + "_") + col].gotoAndStop(_local2);
}
}
j++;
}
i++;
}
};
Map.prototype.PlaceFurniture = function (row, col, label, state, volume) {
var _local1 = row;
var _local2 = col;
var _local3 = this;
if (_root.mOffice[(("f_" + _local1) + "_") + _local2] == null) {
if (_local3.CheckFurnitureVolume(_local1, _local2, label, volume)) {
if (label != "empty") {
d = Math.getZOrder(_local1, _local2, 1);
_root.mOffice.attachMovie("furniture", (("f_" + _local1) + "_") + _local2, d);
_root.mOffice[(("f_" + _local1) + "_") + _local2]._x = ((tileW * (_local2 - 1)) - ((tileW * Math.IsEven(_local1 - 1)) / 2)) + (tileW / 2);
_root.mOffice[(("f_" + _local1) + "_") + _local2]._y = (tileH / 2) * (_local1 - 1);
if (_local3.FurnitureAlpha != 100) {
_root.mOffice[(("f_" + _local1) + "_") + _local2]._alpha = _local3.FurnitureAlpha;
}
trace(_local3.FurnitureAlpha);
_root.mOffice[(("f_" + _local1) + "_") + _local2].gotoAndStop(label);
_local3.aFurniture[_local1 - 1][_local2 - 1][0] = label;
_local3.aFurniture[_local1 - 1][_local2 - 1][1] = state;
if (_local3.aFloor[_local1 - 1][_local2 - 1][0] == "empty") {
_local3.PlaceFloorTile(_local1, _local2, "tile1", 1, [[1, 0, 0], [0, 0, 0], [0, 0, 0]]);
}
_local3.MarkFurnitureVolume(_local1, _local2, label, state, volume);
}
}
}
trace(_root.Office.aFurniture[_local1 - 1][_local2 - 1][0]);
if ((label == "empty") && (_root.Office.aFurniture[_local1 - 1][_local2 - 1][0] != "empty")) {
_local3.RemoveFurniture(_local1, _local2);
}
};
Map.prototype.RemoveAllFurniture = function () {
var _local3 = this;
i = 0;
while (i < _local3.rows) {
j = 0;
while (j < _local3.cols) {
var _local1 = i + 1;
var _local2 = j + 1;
_local3.aFurniture[i][j][0] = "empty";
_local3.aFurniture[i][j][1] = 0;
if (_root.mOffice[(("f_" + _local1) + "_") + _local2] != null) {
_root.mOffice[(("f_" + _local1) + "_") + _local2].removeMovieClip();
}
_local3.UnMarkTile(_local1, _local2);
j++;
}
i++;
}
};
Map.prototype.TransparentAllFurniture = function () {
var _local3 = this;
i = 0;
while (i < _local3.rows) {
j = 0;
while (j < _local3.cols) {
var _local1 = i + 1;
var _local2 = j + 1;
if (_root.mOffice[(("f_" + _local1) + "_") + _local2] != null) {
_root.mOffice[(("f_" + _local1) + "_") + _local2]._alpha = _local3.FurnitureAlpha;
}
j++;
}
i++;
}
};
Map.prototype.MarkFurnitureVolume = function (row, col, label, state, volume) {
var _local3 = this;
var A = new Array();
A = volume;
var _local1 = row;
var tmpcol;
var _local2 = col;
_local2 = col;
var i;
var j;
var jlocal;
i = 0;
while (i < A.length) {
j = 0;
while (j < A.length) {
if (!Math.IsEven(i)) {
jlocal = (A.length - j) - 1;
} else {
jlocal = j;
}
if (!((i == 0) && (j == 0))) {
if (A[i][jlocal] != 0) {
_root.mOffice[(("f_" + _local1) + "_") + _local2].label = (("volume" + row) + ":") + col;
_local3.aFurniture[_local1 - 1][_local2 - 1][0] = (("volume" + row) + ":") + col;
_local3.aFurniture[_local1 - 1][_local2 - 1][1] = state;
if (_local3.aFloor[_local1 - 1][_local2 - 1][0] == "empty") {
_local3.PlaceFloorTile(_local1, _local2, "tile1", 1, [[1, 0, 0], [0, 0, 0], [0, 0, 0]]);
}
_local3.MarkTile(_local1, _local2);
}
} else if (A[i][jlocal] != 0) {
_local3.MarkTile(_local1, _local2);
}
tmpcol = _local2;
if (Math.IsEven(i)) {
if (jlocal != (A.length - 1)) {
tmpcol = col;
_local2 = _local3.ChangeCol("right", _local1, _local2);
_local1 = _local3.ChangeRow("right", _local1, tmpcol);
}
} else if (jlocal != 0) {
tmpcol = col;
_local2 = _local3.ChangeCol("left", _local1, _local2);
_local1 = _local3.ChangeRow("left", _local1, tmpcol);
}
j++;
}
tmpcol = col;
_local2 = _local3.ChangeCol("down", _local1, _local2);
_local1 = _local3.ChangeRow("down", _local1, tmpcol);
i++;
}
};
Map.prototype.MarkFloorVolume = function (row, col, label, state, volume) {
var _local3 = this;
if (volume == undefined) {
volume = [[1, 0, 0], [0, 0, 0], [0, 0, 0]];
}
var A = new Array();
A = volume;
var _local1 = row;
var tmpcol;
var _local2 = col;
_local2 = col;
var i;
var j;
var jlocal;
i = 0;
while (i < A.length) {
j = 0;
while (j < A.length) {
if (!Math.IsEven(i)) {
jlocal = (A.length - j) - 1;
} else {
jlocal = j;
}
if (!((i == 0) && (j == 0))) {
if (A[i][jlocal] != 0) {
_local3.aFloor[_local1 - 1][_local2 - 1][0] = (("volume" + row) + ":") + col;
_local3.aFloor[_local1 - 1][_local2 - 1][1] = state;
_local3.MarkTile(_local1, _local2);
}
} else if (A[i][jlocal] != 0) {
_local3.MarkTile(_local1, _local2);
}
tmpcol = _local2;
if (Math.IsEven(i)) {
if (jlocal != (A.length - 1)) {
tmpcol = col;
_local2 = _local3.ChangeCol("right", _local1, _local2);
_local1 = _local3.ChangeRow("right", _local1, tmpcol);
}
} else if (jlocal != 0) {
tmpcol = col;
_local2 = _local3.ChangeCol("left", _local1, _local2);
_local1 = _local3.ChangeRow("left", _local1, tmpcol);
}
j++;
}
tmpcol = col;
_local2 = _local3.ChangeCol("down", _local1, _local2);
_local1 = _local3.ChangeRow("down", _local1, tmpcol);
i++;
}
};
Map.prototype.UnMarkFurnitureVolume = function (row, col) {
var _local3 = this;
var A = new Array();
A = _root.mOffice[(("f_" + row) + "_") + col].volume;
var _local1 = row;
var tmpcol;
var _local2 = col;
_local2 = col;
i = 0;
while (i < A.length) {
j = 0;
while (j < A.length) {
if (!Math.IsEven(i)) {
jlocal = (A.length - j) - 1;
} else {
jlocal = j;
}
if (!((i == 0) && (j == 0))) {
if (A[i][jlocal] != 0) {
_local3.aFurniture[_local1 - 1][_local2 - 1][0] = "empty";
_local3.aFurniture[_local1 - 1][_local2 - 1][1] = 0;
_local3.UnMarkTile(_local1, _local2);
}
}
tmpcol = _local2;
if (Math.IsEven(i)) {
if (jlocal != (A.length - 1)) {
tmpcol = col;
_local2 = _local3.ChangeCol("right", _local1, _local2);
_local1 = _local3.ChangeRow("right", _local1, tmpcol);
}
} else if (jlocal != 0) {
tmpcol = col;
_local2 = _local3.ChangeCol("left", _local1, _local2);
_local1 = _local3.ChangeRow("left", _local1, tmpcol);
}
j++;
}
tmpcol = col;
_local2 = _local3.ChangeCol("down", _local1, _local2);
_local1 = _local3.ChangeRow("down", _local1, tmpcol);
i++;
}
};
Map.prototype.UnMarkFloorVolume = function (row, col) {
var _local3 = this;
var A = new Array();
A = _root.mOffice[(("t_" + row) + "_") + col].volume;
var _local1 = row;
var tmpcol;
var _local2 = col;
_local2 = col;
var i;
var j;
var jlocal;
i = 0;
while (i < A.length) {
j = 0;
while (j < A.length) {
if (!Math.IsEven(i)) {
jlocal = (A.length - j) - 1;
} else {
jlocal = j;
}
if (!((i == 0) && (j == 0))) {
if (A[i][jlocal] != 0) {
_local3.aFloor[_local1 - 1][_local2 - 1][0] = "empty";
_local3.aFloor[_local1 - 1][_local2 - 1][1] = 0;
_local3.UnMarkTile(_local1, _local2);
}
}
tmpcol = _local2;
if (Math.IsEven(i)) {
if (jlocal != (A.length - 1)) {
tmpcol = col;
_local2 = _local3.ChangeCol("right", _local1, _local2);
_local1 = _local3.ChangeRow("right", _local1, tmpcol);
}
} else if (jlocal != 0) {
tmpcol = col;
_local2 = _local3.ChangeCol("left", _local1, _local2);
_local1 = _local3.ChangeRow("left", _local1, tmpcol);
}
j++;
}
tmpcol = col;
_local2 = _local3.ChangeCol("down", _local1, _local2);
_local1 = _local3.ChangeRow("down", _local1, tmpcol);
i++;
}
};
Map.prototype.CheckFurnitureVolume = function (row, col, label, volume) {
var _local3 = this;
var OK = true;
var A = new Array();
A = volume;
var _local1 = row;
var tmpcol;
var _local2 = col;
_local2 = col;
var i;
var j;
var jlocal;
i = 0;
while (i < A.length) {
j = 0;
while (j < A.length) {
if (!Math.IsEven(i)) {
jlocal = (A.length - j) - 1;
} else {
jlocal = j;
}
if (A[i][jlocal] != 0) {
if ((((_local3.aFurniture[_local1 - 1][_local2 - 1][0] != "empty") || (_local3.aFurniture[_local1 - 1][_local2 - 1][1] != 0)) || (_local3.aFloor[_local1 - 1][_local2 - 1][1] < 0)) || (_root.Grid.CArray[_local1 - 1][_local2 - 1][0] != "empty")) {
OK = false;
trace("can not place here");
_root.messager.Message("can't place here");
}
}
tmpcol = _local2;
if (Math.IsEven(i)) {
if (jlocal != (A.length - 1)) {
tmpcol = col;
_local2 = _local3.ChangeCol("right", _local1, _local2);
_local1 = _local3.ChangeRow("right", _local1, tmpcol);
}
} else if (jlocal != 0) {
tmpcol = col;
_local2 = _local3.ChangeCol("left", _local1, _local2);
_local1 = _local3.ChangeRow("left", _local1, tmpcol);
}
j++;
}
tmpcol = col;
_local2 = _local3.ChangeCol("down", _local1, _local2);
_local1 = _local3.ChangeRow("down", _local1, tmpcol);
i++;
}
return(OK);
};
Map.prototype.CheckFloorVolume = function (row, col, label, volume) {
var OK = true;
var A = new Array();
A = volume;
var _local1 = row;
var _local3;
var _local2 = col;
_local2 = col;
var i;
var j;
var jlocal;
i = 0;
while (i < A.length) {
j = 0;
while (j < A.length) {
if (!Math.IsEven(i)) {
jlocal = (A.length - j) - 1;
} else {
jlocal = j;
}
if (A[i][jlocal] != 0) {
trace(_local1);
if ((((_local1 > _root.Grid.rows) || (_local1 < 1)) || (_local2 > _root.Grid.cols)) || (_local2 < 1)) {
OK = false;
trace("can not place here");
_root.messager.Message("can't place here");
}
}
_local3 = _local2;
if (Math.IsEven(i)) {
if (jlocal != (A.length - 1)) {
_local3 = col;
_local2 = this.ChangeCol("right", _local1, _local2);
_local1 = this.ChangeRow("right", _local1, _local3);
}
} else if (jlocal != 0) {
_local3 = col;
_local2 = this.ChangeCol("left", _local1, _local2);
_local1 = this.ChangeRow("left", _local1, _local3);
}
j++;
}
_local3 = col;
_local2 = this.ChangeCol("down", _local1, _local2);
_local1 = this.ChangeRow("down", _local1, _local3);
i++;
}
return(OK);
};
Map.prototype.RemoveFurniturebyVolume = function (volume) {
var _local1 = volume.substr(6);
var _local2 = Number(_local1.substring(0, _local1.indexOf(":")));
var _local3 = Number(_local1.substr(_local1.indexOf(":") + 1));
this.UnMarkFurnitureVolume(_local2, _local3);
this.RemoveFurniture(_local2, _local3);
};
Map.prototype.RemoveFloorTile = function (row, col) {
var _local1 = row;
var _local2 = col;
var _local3 = _root;
this.unMarkFloorVolume(_local1, _local2);
_local3.mOffice[(("t_" + _local1) + "_") + _local2].gotoAndStop(1);
_local3.mOffice[(("t_" + _local1) + "_") + _local2].state = 0;
_local3.mOffice[(("t_" + _local1) + "_") + _local2].label = "empty";
_local3.mOffice[(("t_" + _local1) + "_") + _local2].volume = [[1, 0, 0], [0, 0, 0], [0, 0, 0]];
this.aFloor[_local1 - 1][_local2 - 1][0] = "empty";
this.aFloor[_local1 - 1][_local2 - 1][1] = 0;
};
Map.prototype.RemoveFloor = function (row, col, label, volume) {
var _local3 = this;
var A = new Array();
A = volume;
var _local1 = row;
var tmpcol;
var _local2 = col;
_local2 = col;
var i;
var j;
var jlocal;
i = 0;
while (i < A.length) {
j = 0;
while (j < A.length) {
if (!Math.IsEven(i)) {
jlocal = (A.length - j) - 1;
} else {
jlocal = j;
}
if (A[i][jlocal] != 0) {
if (_local3.aFloor[_local1 - 1][_local2 - 1][0] != "empty") {
if (_local3.aFloor[_local1 - 1][_local2 - 1][0].substr(0, 6) == "volume") {
_local3.RemoveFloorByVolume(_local3.aFloor[_local1 - 1][_local2 - 1][0]);
} else {
_local3.RemoveFloorTile(_local1, _local2);
}
}
}
tmpcol = _local2;
if (Math.IsEven(i)) {
if (jlocal != (A.length - 1)) {
tmpcol = col;
_local2 = _local3.ChangeCol("right", _local1, _local2);
_local1 = _local3.ChangeRow("right", _local1, tmpcol);
}
} else if (jlocal != 0) {
tmpcol = col;
_local2 = _local3.ChangeCol("left", _local1, _local2);
_local1 = _local3.ChangeRow("left", _local1, tmpcol);
}
j++;
}
tmpcol = col;
_local2 = _local3.ChangeCol("down", _local1, _local2);
_local1 = _local3.ChangeRow("down", _local1, tmpcol);
i++;
}
return(OK);
};
Map.prototype.RemoveFloorbyVolume = function (volume) {
var _local1 = volume.substr(6);
var _local2 = Number(_local1.substring(0, _local1.indexOf(":")));
var _local3 = Number(_local1.substr(_local1.indexOf(":") + 1));
this.UnMarkFloorVolume(_local2, _local3);
this.PlaceFloorTile(_local2, _local3, "empty", 0, [[1, 0, 0], [0, 0, 0], [0, 0, 0]]);
};
Map.prototype.ChangeRow = function (dir, row, col) {
var _local1 = row;
var _local2 = dir;
if (_local2 == "up") {
return(_local1 - 1);
}
if (_local2 == "left") {
return(_local1 + 1);
}
if (_local2 == "right") {
return(_local1 - 1);
}
if (_local2 == "down") {
return(_local1 + 1);
}
if (_local2 == "whatever") {
return(_local1);
}
return(undefined);
};
Map.prototype.ChangeCol = function (dir, row, col) {
var _local1 = col;
var _local2 = dir;
var _local3 = row;
if (_local2 == "up") {
if (!Math.IsEven(_local3)) {
return(_local1 - 1);
}
return(_local1);
}
if (_local2 == "down") {
if (Math.IsEven(_local3)) {
return(_local1 + 1);
}
return(_local1);
}
if (_local2 == "right") {
if (Math.IsEven(_local3)) {
return(_local1 + 1);
}
return(_local1);
}
if (_local2 == "left") {
if (!Math.IsEven(_local3)) {
return(_local1 - 1);
}
return(_local1);
}
if (_local2 == "whatever") {
return(_local1);
}
return(undefined);
};
Map.prototype.MarkTile = function (row, col) {
if (_root.debug) {
_root.mOffice[(("t_" + row) + "_") + col].gotoAndStop("marker");
}
};
Map.prototype.UnMarkTile = function (row, col) {
if (_root.debug) {
_root.mOffice[(("t_" + row) + "_") + col].gotoAndStop(this.aFloor[row - 1][col - 1][0]);
}
};
Map.prototype.IsoToPlaneI = function (iI, iJ) {
var _local1 = this.rows - 1;
var _local3 = _local1 + Math.isEven(_local1);
var _local2 = Math.floor((_local3 - iI) / 2) + iJ;
return(_local2);
};
Map.prototype.IsoToPlaneJ = function (iI, iJ) {
var _local1 = Math.ceil(iI / 2) + iJ;
return(_local1);
};
StartDate = new Date(2003, 0, 2, 8, 0, 0);
Today = new Date();
Today = StartDate;
UpdateTodayName();
MapSizeX = 28;
MapSizeY = 20;
tileW = 36;
tileH = 18;
steps = 2;
stepX = (tileW / steps) / 2;
stepY = (tileH / steps) / 2;
MapPozX = 6;
MapPozY = 100;
MapFloor = new Array();
MapFloor.Init2D(MapSizeX, MapSizeY);
MapFurniture = new Array();
MapFurniture.Init2D(MapSizeX, MapSizeY);
MapCharacters = new Array();
MapCharacters.Init2D(MapSizeX, MapSizeY);
if (MouseEnabled) {
_root.attachMovie("mouseUI", "mouseUI", _root.mouseUIZOrder);
_root.mouseUI._x = -50;
_root.mouseUI._y = -50;
_root.attachMovie("mousePointer", "mousePointer", _root.mousePointerZOrder);
_root.mousePointer._x = -50;
_root.mousePointer._y = -50;
}
Frame 7
if (_root.GameStarted == false) {
stop();
_root.ModalWindow("welcome");
_root.GameStarted = true;
stop();
}
Frame 8
if (_root.LoadSaved) {
_root.createEmptyMovieClip("game_loader", _root.messageBoxZLoader);
_root.game_loader._x = 374;
_root.game_loader._y = 200;
_root.game_loader.attachMovie("cover", "cover", 1);
_root.game_loader.attachMovie("load_game", "load_game", 2);
stop();
}
_root.UnBottler();
Frame 9
trace("game loaded frame");
_root.UnBottler();
_root.loader_box.removeMovieClip();
_root.saver_box.removeMovieClip();
_root.StopMusic("loop", true);
LoadMap(_root.MapNumber);
Today = StartDate.GetWorkDay(_root.MapNumber);
UpdateTodayName();
_root.createEmptyMovieClip("loader_box", _root.messageBoxZLoader);
_root.loader_box._x = 374;
_root.loader_box._y = 200;
_root.loader_box.attachMovie("cover", "cover", 1);
_root.loader_box.attachMovie("map_loader", "map_loader", 2);
stop();
Frame 10
_root.Office = null;
_root.Office = new Map(_root.MapPozX, _root.MapPozY, _root.MapSizeX, _root.MapSizeY, _root.tilew, _root.tileh, _root.MapFloor, _root.MapFurniture, _root.MapCharacters);
UpdateFolders();
Frame 11
_root.loader_box.removeMovieClip();
_root.UnBottler();
_root.mouseUI.Reset();
trace("..MapEntered:" + _root.MapEntered);
trace("..MapNumber:" + _root.MapNumber);
if (((((_root.MapNumber + _root.FirstWorkDay) % _root.PayCheckDay) == 0) and ((_root.MapEntered + 1) == _root.MapNumber)) and (_root.MapNumber != 1)) {
trace("game saved as it's a payday");
_root.createEmptyMovieClip("game_saver", _root.messageBoxZLoader);
_root.game_saver._x = 374;
_root.game_saver._y = 200;
_root.game_saver.attachMovie("cover", "cover", 1);
_root.game_saver.attachMovie("save_game", "save_game", 2);
stop();
}
Frame 12
if (_root.MapEntered == _root.MapNumber) {
gotoAndPlay ("gaming");
} else if (_root.message != "") {
_root.GlobalStop = true;
_root.loader_box.removeMovieClip();
_root.saver_box.removeMovieClip();
score_panel.Init();
_root.ModalWindow("play");
_root.MapEntered = _root.MapNumber;
stop();
} else {
_root.loader_box.removeMovieClip();
_root.saver_box.removeMovieClip();
score_panel.Init();
_root.MapEntered = _root.MapNumber;
gotoAndPlay ("gaming");
}
Frame 13
_root.UnBottler();
_root.loader_box.removeMovieClip();
_root.saver_box.removeMovieClip();
_root.StopMusic("loop", true);
GlobalStop = false;
score_panel.Init();
_root.blinker.play();
stop();
Frame 14
_root.loader_box.removeMovieClip();
_root.UnBottler();
trace("MapEntered:" + _root.MapEntered);
trace("MapNumber:" + _root.MapNumber);
if (((((_root.MapNumber + _root.FirstWorkDay) % _root.PayCheckDay) == 0) and ((_root.MapEntered + 1) == _root.MapNumber)) and (_root.MapNumber != 1)) {
trace("game save 2. payday");
_root.createEmptyMovieClip("game_saver", _root.messageBoxZLoader);
_root.game_saver._x = 374;
_root.game_saver._y = 200;
_root.game_saver.attachMovie("cover", "cover", 1);
_root.game_saver.attachMovie("save_game", "save_game", 2);
stop();
}
Frame 15
trace("displaying WON window...");
score_panel.Init();
_root.Office = null;
_root.mOffice.removeMovieClip();
_root.loader_box.removeMovieClip();
if (_root.MapNumber != (_root.maps + 1)) {
trace("cheating!!!");
_root.MapNumber = 1;
gotoAndPlay ("init");
} else {
_root.ModalWindow("won");
stop();
}
Frame 16
score_panel.Init();
_root.ModalWindow("lost");
_root.GameStarted = false;
Frame 17
_root.StopMusic("loop", true);
_root.Office = null;
_root.mOffice.removeMovieClip();
_root.loader_box.removeMovieClip();
_root.saver_box.removeMovieClip();
_root.message_box.removeMovieClip();
stop();
Frame 18
stop();
Frame 21
Key.removeListener(KeyListener);
getURL ("http://www.dailyfreegames.com", "_blank");
Symbol 10 MovieClip Frame 35
stop();
Symbol 13 MovieClip Frame 1
this._visible = false;
Symbol 17 MovieClip Frame 1
_root.stop();
Symbol 17 MovieClip Frame 3
xyb1 = _root.getBytesLoaded();
xyb2 = _root.getBytesTotal();
xytgFrame = Math.round((xyb1 / xyb2) * 100) + 1;
prelbar.gotoAndStop(xytgFrame);
Symbol 17 MovieClip Frame 5
if ((xyb1 >= xyb2) && (xyb2 > 50)) {
stop();
_root.play();
} else {
gotoAndPlay ("xloop1");
}
Symbol 19 MovieClip [controlled] Frame 1
function ResetInterception() {
WalkedTiles.InitEmptyArray(_root.MapSizeX, _root.MapSizeY);
}
function Intercept(intI, intJ) {
var RowDiff;
var ColDiff;
var _local1;
var _local2;
var IntDir = "whatever";
var srow = (_root.Office.IsoToPlaneI(Character.row - 1, Character.col - 1) + 1);
var scol = (_root.Office.IsoToPlaneJ(Character.row - 1, Character.col - 1) + 1);
var erow = (_root.Office.IsoToPlaneI(intI, intJ) + 1);
var ecol = (_root.Office.IsoToPlaneJ(intI, intJ) + 1);
var cRowDiff = Math.abs(erow - srow);
var cColDiff = Math.abs(ecol - scol);
var _local3;
var fColDiff;
var frow;
var fcol;
var fdirection;
var d = (cRowDiff + cColDiff);
var brow = ((bcol = -1));
var bbrow = ((bbcol = -1));
if (d != 0) {
d = 100000 /* 0x0186A0 */;
var bd = 100000;
var bIntDir = "whatever";
if (ForkD) {
var dnames = ["up", "right", "down", "left"];
} else {
var dnames = ["left", "down", "right", "up"];
}
var i = 0;
while (i < 4) {
fdirection = dnames[i];
_local1 = Character.ChangeRow(fdirection, Character.row, Character.col);
_local2 = Character.ChangeCol(fdirection, Character.row, Character.col);
if (_root.Office.CheckStatus("worker", _local1, _local2)) {
frow = _root.Office.IsoToPlaneI(_local1 - 1, _local2 - 1) + 1;
fcol = _root.Office.IsoToPlaneJ(_local1 - 1, _local2 - 1) + 1;
_local3 = Math.abs(erow - frow);
fColDiff = Math.abs(ecol - fcol);
if ((PrevMIPRow == _local1) && (PrevMIPCol == _local2)) {
bIntDir = fdirection;
bd = Math.pow(_local3, 2) + Math.pow(fColDiff, 2);
bbrow = _local1;
bbcol = _local2;
} else {
if ((Math.pow(_local3, 2) + Math.pow(fColDiff, 2)) == d) {
trace("changed direction");
ForkD = !ForkD;
}
if ((Math.pow(_local3, 2) + Math.pow(fColDiff, 2)) < d) {
IntDir = fdirection;
d = Math.pow(_local3, 2) + Math.pow(fColDiff, 2);
brow = _local1;
bcol = _local2;
}
}
}
i++;
}
if (d <= bd) {
aSteps = maxSteps;
} else if ((brow == -1) && (bcol == -1)) {
IntDir = bIntDir;
brow = bbrow;
bcol = bbcol;
} else {
aSteps--;
if (aSteps <= 0) {
aSteps = maxSteps;
IntDir = bIntDir;
brow = bbrow;
bcol = bbcol;
}
}
}
if ((Character.row != PrevMIPRow) or (Character.col != PrevMIPCol)) {
_root.Office.UnMarkTile(PrevMIPRow, PrevMIPCol);
PrevMIPRow = Character.row;
PrevMIPCol = Character.col;
_root.Office.MarkTile(PrevMIPRow, PrevMIPCol);
}
return(IntDir);
}
function CleanMouse() {
var _local1 = _root;
_local1.MousePointer.i = -1;
_local1.MousePointer.j = -1;
mmove = "whatever";
mIntRow = -1;
mIntCol = -1;
cCol = Character.col;
cRow = Character.row;
_local1.MousePointer._visible = false;
}
var LastCRow = ((LastCCol = (LastMRow = (LastMCol = -1))));
var Character = eval ("_root." + this.oName);
var WalkedTiles = new Array();
ResetInterception();
var PrevTRow = ((PrevTCol = -1));
var PrevMIPRow = ((PrevMIPCol = -1));
var maxSteps = ((aSteps = 6));
var mmove = "whatever";
var ForkD = false;
Symbol 19 MovieClip [controlled] Frame 2
var KeyPressed = false;
if (Key.isDown(38) && (!KeyPressed)) {
eval ("_root." + this.oName).Move("up");
KeyPressed = true;
CleanMouse();
}
if (Key.isDown(40) && (!KeyPressed)) {
eval ("_root." + this.oName).Move("down");
KeyPressed = true;
CleanMouse();
}
if (Key.isDown(39) && (!KeyPressed)) {
eval ("_root." + this.oName).Move("right");
KeyPressed = true;
CleanMouse();
}
if (Key.isDown(37) && (!KeyPressed)) {
eval ("_root." + this.oName).Move("left");
KeyPressed = true;
CleanMouse();
}
if (!KeyPressed) {
if ((_root.MouseEnabled && (_root.MousePointer.i != -1)) && (_root.MousePointer.j != -1)) {
if ((Character.row == (_root.mousePointer.i + 1)) && (Character.col == (_root.mousePointer.j + 1))) {
CleanMouse();
aSteps = maxSteps;
_root.Office.UnMarkTile(PrevMIPRow, PrevMIPCol);
PrevMIPRow = (PrevMIPCol = -1);
eval ("_root." + this.oName).Move("whatever");
} else {
if ((((LastMRow != (_root.mousePointer.i + 1)) or (LastMCol != (_root.mousePointer.j + 1))) or (LastCRow != Character.row)) or (LastCCol != Character.col)) {
if ((LastMRow != (_root.mousePointer.i + 1)) or (LastMCol != (_root.mousePointer.j + 1))) {
_root.Office.UnMarkTile(PrevMIPRow, PrevMIPCol);
aSteps = maxSteps;
PrevMIPRow = (PrevMIPCol = -1);
}
LastCRow = Character.row;
LastCCol = Character.col;
LastMRow = _root.mousePointer.i + 1;
LastMCol = _root.mousePointer.j + 1;
LastCRow = Character.row;
LastCCol = Character.col;
mmove = this.Intercept(_root.mousePointer.i, _root.mousePointer.j);
}
eval ("_root." + this.oName).Move(mmove);
}
} else {
eval ("_root." + this.oName).Move("whatever");
CleanMouse();
}
}
Symbol 19 MovieClip [controlled] Frame 3
gotoAndPlay (2);
Symbol 20 MovieClip [executive] Frame 1
function Intercept(radius, direction) {
var _local1 = direction;
var RowDiff;
var ColDiff;
var crow = Character.row;
var ccol = Character.col;
var wrow = _root.Worker.row;
var _local3 = _root.Worker.col;
var RowDiff = (crow - wrow);
var ColDiff = (ccol - _local3);
var _local2 = "nowhere";
if ((Math.abs(RowDiff) <= radius) && (Math.abs(ColDiff) <= radius)) {
if ((crow > wrow) && (ccol <= _local3)) {
_local2 = "right";
}
if ((crow > wrow) && (ccol > _local3)) {
_local2 = "up";
}
if ((crow <= wrow) && (ccol > _local3)) {
_local2 = "left";
}
if ((crow <= wrow) && (ccol <= _local3)) {
_local2 = "down";
}
}
_local1 = "up";
if (_root.Office.Intercept(Character.ChangeRow(_local1, Character.row, Character.col), Character.ChangeCol(_local1, Character.row, Character.col))) {
_local2 = _local1;
}
_local1 = "down";
if (_root.Office.Intercept(Character.ChangeRow(_local1, Character.row, Character.col), Character.ChangeCol(_local1, Character.row, Character.col))) {
_local2 = _local1;
}
_local1 = "left";
if (_root.Office.Intercept(Character.ChangeRow(_local1, Character.row, Character.col), Character.ChangeCol(_local1, Character.row, Character.col))) {
_local2 = _local1;
}
_local1 = "right";
if (_root.Office.Intercept(Character.ChangeRow(_local1, Character.row, Character.col), Character.ChangeCol(_local1, Character.row, Character.col))) {
_local2 = _local1;
}
return(_local2);
}
rnd = 2000;
iRadius = 6;
var Character = eval ("_root." + this.oName);
direction = Character.dir;
if (direction == "") {
trace("init");
direction = Character.dir;
prev_direction = direction;
} else {
prev_direction = direction;
direction = Intercept(iRadius, direction);
}
dir = direction;
if (_root.Office.CheckStatus(Character.name, Character.ChangeRow(dir, Character.row, Character.col), Character.ChangeCol(dir, Character.row, Character.col))) {
} else {
direction = Math.GetRandom(1, rnd);
switch (direction) {
case 1 :
direction = "up";
break;
case 2 :
direction = "down";
break;
case 3 :
direction = "right";
break;
case 4 :
direction = "left";
break;
default :
if (Character.phase == 0) {
var exitFound = false;
var tmpDir;
var dir;
var antiBlocker = 12;
do {
tmpDir = Math.GetRandom(1, 4);
antiBlocker = antiBlocker - 1;
if (antiBlocker < 0) {
break;
}
switch (tmpDir) {
case 1 :
dir = "up";
break;
case 2 :
dir = "down";
break;
case 3 :
dir = "right";
break;
case 4 :
dir = "left";
break;
default :
trace("error generating random direction in executive's logic");
}
if (_root.Office.CheckStatus(Character.name, Character.ChangeRow(dir, Character.row, Character.col), Character.ChangeCol(dir, Character.row, Character.col))) {
direction = dir;
exitFound = true;
}
} while (!exitFound);
if (!exitFound) {
direction = prev_direction;
}
} else {
direction = prev_direction;
}
}
}
Character.Move(direction);
Symbol 20 MovieClip [executive] Frame 2
gotoAndPlay (1);
Symbol 21 MovieClip [manager] Frame 1
if (direction == "") {
direction = eval ("_root." + this.oName).dir;
switch (direction) {
case "up" :
direction = 1;
break;
case "down" :
direction = 2;
break;
case "right" :
direction = 3;
break;
case "left" :
direction = 4;
break;
default :
trace("error");
direction = 1;
prev_direction = direction;
}
} else {
prev_direction = direction;
direction = Math.GetRandom(1, 30);
}
var IDir = "";
var tmpDir = direction;
direction = "up";
if (_root.Office.Intercept(Character.ChangeRow(direction, Character.row, Character.col), Character.ChangeCol(direction, Character.row, Character.col))) {
IDir = 1;
trace("intercepting up...");
}
direction = "down";
if (_root.Office.Intercept(Character.ChangeRow(direction, Character.row, Character.col), Character.ChangeCol(direction, Character.row, Character.col))) {
IDir = 2;
trace("intercepting down...");
}
direction = "left";
if (_root.Office.Intercept(Character.ChangeRow(direction, Character.row, Character.col), Character.ChangeCol(direction, Character.row, Character.col))) {
IDir = 4;
trace("intercepting left...");
}
direction = "right";
if (_root.Office.Intercept(Character.ChangeRow(direction, Character.row, Character.col), Character.ChangeCol(direction, Character.row, Character.col))) {
IDir = 3;
trace("intercepting right...");
}
if (IDir != "") {
direction = IDir;
} else {
direction = tmpDir;
}
switch (direction) {
case 1 :
direction = "up";
break;
case 2 :
direction = "down";
break;
case 3 :
direction = "right";
break;
case 4 :
direction = "left";
break;
default :
if (eval ("_root." + this.oName).phase == 0) {
var Character = eval ("_root." + this.oName);
var exitFound = false;
var dir = "right";
if (_root.Office.CheckStatus(Character.name, Character.ChangeRow(dir, Character.row, Character.col), Character.ChangeCol(dir, Character.row, Character.col))) {
direction = dir;
exitFound = true;
}
var dir = "down";
if ((exitFound != true) && (_root.Office.CheckStatus(Character.name, Character.ChangeRow(dir, Character.row, Character.col), Character.ChangeCol(dir, Character.row, Character.col)))) {
direction = dir;
exitFound = true;
}
var dir = "left";
if ((exitFound != true) && (_root.Office.CheckStatus(Character.name, Character.ChangeRow(dir, Character.row, Character.col), Character.ChangeCol(dir, Character.row, Character.col)))) {
direction = dir;
exitFound = true;
}
var dir = "up";
if ((exitFound != true) && (_root.Office.CheckStatus(Character.name, Character.ChangeRow(dir, Character.row, Character.col), Character.ChangeCol(dir, Character.row, Character.col)))) {
direction = dir;
exitFound = true;
}
if (!exitFound) {
}
} else {
direction = prev_direction;
}
}
eval ("_root." + this.oName).Move(direction);
Symbol 21 MovieClip [manager] Frame 2
gotoAndPlay (1);
Symbol 26 MovieClip [bubble] Frame 1
function MoveUp() {
this._y = this._y - 2;
}
Symbol 26 MovieClip [bubble] Frame 2
this.MoveUp();
Symbol 26 MovieClip [bubble] Frame 3
this.MoveUp();
Symbol 26 MovieClip [bubble] Frame 4
this.MoveUp();
Symbol 26 MovieClip [bubble] Frame 5
this.MoveUp();
Symbol 26 MovieClip [bubble] Frame 6
this.MoveUp();
Symbol 26 MovieClip [bubble] Frame 7
_root.bubbles = _root.bubbles - 1;
this.removeMovieClip();
Symbol 51 MovieClip Frame 1
stop();
Symbol 51 MovieClip Frame 2
stop();
Symbol 51 MovieClip Frame 3
stop();
Symbol 51 MovieClip Frame 4
stop();
Symbol 51 MovieClip Frame 5
stop();
Symbol 51 MovieClip Frame 6
stop();
Symbol 51 MovieClip Frame 7
stop();
Symbol 51 MovieClip Frame 8
stop();
Symbol 51 MovieClip Frame 9
stop();
Symbol 51 MovieClip Frame 10
stop();
Symbol 51 MovieClip Frame 11
stop();
Symbol 51 MovieClip Frame 12
stop();
Symbol 76 MovieClip Frame 1
stop();
Symbol 76 MovieClip Frame 2
stop();
Symbol 76 MovieClip Frame 3
stop();
Symbol 76 MovieClip Frame 4
stop();
Symbol 76 MovieClip Frame 5
stop();
Symbol 76 MovieClip Frame 6
stop();
Symbol 76 MovieClip Frame 7
stop();
Symbol 76 MovieClip Frame 8
stop();
Symbol 76 MovieClip Frame 9
stop();
Symbol 76 MovieClip Frame 10
stop();
Symbol 76 MovieClip Frame 11
stop();
Symbol 76 MovieClip Frame 12
stop();
Symbol 93 MovieClip Frame 1
stop();
Symbol 93 MovieClip Frame 2
stop();
Symbol 93 MovieClip Frame 3
stop();
Symbol 93 MovieClip Frame 4
stop();
Symbol 93 MovieClip Frame 5
stop();
Symbol 93 MovieClip Frame 6
stop();
Symbol 93 MovieClip Frame 7
stop();
Symbol 93 MovieClip Frame 8
stop();
Symbol 93 MovieClip Frame 9
stop();
Symbol 93 MovieClip Frame 10
stop();
Symbol 93 MovieClip Frame 11
stop();
Symbol 93 MovieClip Frame 12
stop();
Symbol 94 MovieClip [characters] Frame 1
brain = "not set";
name = "not set";
type = "not set";
stop();
Symbol 94 MovieClip [characters] Frame 2
brain = "empty";
name = "empty";
type = "empty";
stop();
Symbol 94 MovieClip [characters] Frame 7
brain = "controlled";
name = "man";
type = "worker";
stop();
Symbol 94 MovieClip [characters] Frame 12
brain = "manager";
name = "manager";
type = "monster";
stop();
Symbol 94 MovieClip [characters] Frame 17
brain = "executive";
name = "executive";
type = "monster";
stop();
Symbol 263 MovieClip [furniture] Frame 1
state = 0;
volume = new Array([0, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 2
label = "empty";
state = 0;
volume = new Array([0, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 7
label = "shkaf2";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 12
label = "shkaf1";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 17
label = "shkaf3";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 22
label = "shkaf4";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 27
label = "shkaf5";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 32
label = "shkaf6";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 37
label = "wall5";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 42
label = "wall8";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 47
label = "piramid2";
state = -1;
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 52
label = "altar2";
state = -1;
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 57
label = "altar3";
state = -1;
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 62
label = "altar4";
state = -1;
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 67
label = "altar";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 72
label = "bricks1";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 77
label = "bricks2";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 82
label = "bricks3";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 87
label = "bricks";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 92
label = "fire";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 97
label = "fireplace";
state = -1;
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 102
label = "piramid";
state = -1;
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 107
label = "roots";
state = -1;
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 112
label = "shkaf8";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 117
label = "shkaf7";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 122
label = "shkaf9";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 127
label = "shkaf10";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 132
label = "shkaf11";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 137
label = "shkaf12";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 142
label = "shkaf14";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 147
label = "shkaf15";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 152
label = "skeleton2";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 157
label = "skeleton3";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 162
label = "skeleton4";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 167
label = "skeleton5";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 172
label = "skeleton6";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 177
label = "skeleton";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 182
label = "skulls";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 187
label = "thingy1";
state = -1;
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 192
label = "thingy2";
state = -1;
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 197
label = "eye";
state = -1;
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 202
label = "thumb1";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 207
label = "thumb2";
state = -1;
volume = new Array([1, 1, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 212
label = "thumb3";
state = -1;
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 217
label = "torch";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 222
label = "wall1";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 227
label = "wall2";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 232
label = "wall3";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 237
label = "wall4";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 242
label = "wall6";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 247
label = "wall7";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 252
label = "wall9";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 257
label = "wall10";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 262
label = "wall11";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 267
label = "wall12";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 272
label = "stone1";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 277
label = "stone2";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 282
label = "stone3";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 287
label = "stone4";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 292
label = "stone5";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 297
label = "stone6";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 302
label = "stone7";
state = -1;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 307
label = "bonus1";
state = 5;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 312
label = "folder";
state = 15;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 317
label = "bottle";
state = 5;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 263 MovieClip [furniture] Frame 322
label = "heart";
state = 10;
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
stop();
Symbol 266 MovieClip [bottler] Frame 1
_root.MonsterStop = true;
i = 1;
while (i <= _root.BottleDuration) {
this.attachMovie("status_block", "status" + i, i);
eval ("this.status" + i)._x = 7 + (8 * i);
eval ("this.status" + i)._y = 0;
i++;
}
coef = 10;
duration = _root.BottleDuration * coef;
Symbol 266 MovieClip [bottler] Frame 2
if (duration <= 0) {
_root.MonsterStop = false;
_root.StopMusic("clock", true);
this.removeMovieClip();
}
if (_root.GlobalStop) {
i = 1;
while (i <= _root.BottleDuration) {
eval ("this.status" + i).gotoAndStop(1);
i++;
}
} else {
i = 1;
while (i <= _root.BottleDuration) {
eval ("this.status" + i).play();
i++;
}
duration--;
}
i = 1;
while (i <= _root.BottleDuration) {
if (Math.floor(duration / coef) < i) {
eval ("this.status" + i).removeMovieClip();
}
i++;
}
Symbol 266 MovieClip [bottler] Frame 3
gotoAndPlay (2);
Symbol 275 Button
on (release) {
_root.MusicOn = false;
this.play();
}
Symbol 279 Button
on (release) {
_root.MusicOn = true;
this.play();
}
Symbol 282 MovieClip Frame 1
if (_root.MusicOn == false) {
gotoAndStop (2);
}
if (_root.sloop == null) {
_root.PlayMusic("loop");
}
stop();
Symbol 282 MovieClip Frame 2
_root.StopMusic("loop", true);
stop();
Symbol 291 Button
on (release) {
Enter();
}
Symbol 292 MovieClip [about_box] Frame 1
function Enter() {
var _local1 = _parent;
var _local2 = _root;
trace(_local1.GlobalStop);
if (_local1.GlobalStop == false) {
_local2.GlobalStop = false;
}
_local2.popupwindows--;
_local2.StopMusic("loop");
_local1.removeMovieClip();
}
Symbol 302 MovieClip [help_box] Frame 1
function Enter() {
var _local1 = _parent;
var _local2 = _root;
trace(_local1.GlobalStop);
if (_local1.GlobalStop == false) {
_local2.GlobalStop = false;
}
_local2.popupwindows--;
_local2.StopMusic("loop");
_local1.removeMovieClip();
}
Symbol 312 MovieClip [load_game] Frame 1
if (_root.mOzaic) {
delay = 0;
gotoAndPlay ("database");
} else {
gotoAndPlay ("cookies");
}
Symbol 312 MovieClip [load_game] Frame 2
myLoadVars = new LoadVars();
myLoadVars.onLoad = function (success) {
var _local1 = _root;
if (success) {
trace("data loaded from server...");
_local1.PlayerName = myLoadVars.PlayerName;
_local1.PlayerID = Number(myLoadVars.PlayerID);
_local1.MapNumber = Number(myLoadVars.MapNumber);
if (((isNaN(_local1.MapNumber) or (_local1.MapNumber == 0)) or (_local1.MapNumber == undefined)) or (_local1.MapNumber > _local1.Maps)) {
_local1.MapNumber = 1;
}
_local1.show.text = _local1.MapNumber;
if (_local1.MapNumber > _local1.maps) {
_local1.MapNumber = 1;
_local1.Score = 0;
_local1.Lifes = 3;
_local1.UpdateLifes();
} else {
_local1.Score = Number(myLoadVars.Score);
if ((isNaN(_local1.Score) or (_local1.Score == 0)) or (_local1.Score == undefined)) {
_local1.Score = 0;
}
_local1.Lifes = Number(myLoadVars.Lifes);
if ((isNaN(_local1.Lifes) or (_local1.Lifes == 0)) or (_local1.Lifes == undefined)) {
_local1.Lifes = 3;
}
_local1.UpdateLifes();
}
gotoAndPlay ("end loading");
} else {
trace("error loading data on server");
_local1.mOzaic = false;
gotoAndPlay ("end loading");
}
};
myLoadVars.load(_root.domain + "LoadScore.php");
Symbol 312 MovieClip [load_game] Frame 3
delay++;
if (delay > 70) {
trace("timeout");
gotoAndPlay ("end loading");
}
Symbol 312 MovieClip [load_game] Frame 4
gotoAndPlay (3);
Symbol 312 MovieClip [load_game] Frame 5
Cookies = SharedObject.getLocal("treasure_hunter");
Symbol 312 MovieClip [load_game] Frame 6
if ((((((Cookies.data.MapNumber != "") and (Cookies.data.MapNumber != undefined)) and (Cookies.data.Lifes != "")) and (Cookies.data.Lifes != undefined)) and (Cookies.data.Score != "")) and (Cookies.data.Score != undefined)) {
_root.MapNumber = Cookies.data.MapNumber;
_root.Lifes = Cookies.data.Lifes;
_root.UpdateLifes();
_root.Score = Cookies.data.Score;
trace("got the cookies");
if (_root.MapNumber > _root.maps) {
_root.MapNumber = 1;
_root.Score = 0;
_root.Lifes = 3;
_root.UpdateLifes();
}
} else {
trace("failed getting cookies");
}
gotoAndPlay ("end loading");
Symbol 312 MovieClip [load_game] Frame 7
_root.play();
_parent.removeMovieClip();
stop();
Symbol 320 Button
on (release) {
_parent.Enter();
}
Symbol 323 Button
on (release) {
_parent.TryAgain();
}
Symbol 326 Button
on (release) {
_parent.Quit();
}
Symbol 329 Button
on (release) {
_root.Office = null;
_root.mOffice.removeMovieClip();
_root.gotoAndPlay("scores");
Key.removeListener(PauseListener);
_parent._parent.removeMovieClip();
}
Symbol 330 MovieClip Frame 1
if (_root.mOzaic || (_root.disarea)) {
gotoAndStop (2);
}
stop();
Symbol 330 MovieClip Frame 2
stop();
Symbol 334 Button
on (release) {
getURL ("http://www.dailyfreegames.com", "_blank");
}
Symbol 336 MovieClip [lost_box] Frame 1
function Enter() {
var _local1 = _root;
_local1.LoadSaved = true;
_local1.Office = null;
_local1.mOffice.removeMovieClip();
_local1.gotoAndPlay("init");
_local1.popupwindows--;
_local1.StopMusic("loop");
_parent.removeMovieClip();
}
function TryAgain() {
var _local1 = _root;
_local1.LoadSaved = false;
_local1.Office = null;
_local1.mOffice.removeMovieClip();
_local1.gotoAndPlay("init");
_local1.popupwindows--;
_local1.StopMusic("loop");
_parent.removeMovieClip();
}
function Quit() {
var _local1 = _root;
Key.removeListener(PauseListener);
_local1.gotoAndPlay("quit");
_local1.StopMusic("loop", true);
_local1.popupwindows--;
_parent.removeMovieClip();
}
this.holder._x = -170;
this.holder._y = -53;
this.holder.loadMovie("images/lost_icon.swf");
Symbol 336 MovieClip [lost_box] Frame 3
if ((this.holder.getBytesLoaded() == this.holder.getBytesTotal()) and (this.holder.getBytesLoaded() > 1000)) {
play();
} else {
gotoAndPlay (2);
}
Symbol 336 MovieClip [lost_box] Frame 4
stop();
Symbol 341 Button
on (release) {
Enter();
}
Symbol 342 MovieClip [pause_box] Frame 1
function Enter() {
var _local1 = _parent;
var _local2 = _root;
trace(_local1.GlobalStop);
if (_local1.GlobalStop == false) {
_local2.GlobalStop = false;
}
_local2.popupwindows--;
_local2.StopMusic("loop");
_local1.removeMovieClip();
}
Symbol 347 Button
on (release) {
Enter();
}
Symbol 348 MovieClip [play_box] Frame 1
function Enter() {
var _local1 = _root;
_local1.play();
_local1.popupwindows--;
_local1.StopMusic("loop");
_parent.removeMovieClip();
}
message_text.text = this.message;
if (((_root.MapNumber + _root.FirstWorkDay) % _root.PayCheckDay) == 0) {
this.payday._visible = true;
} else {
this.payday._visible = false;
}
Symbol 352 Button
on (release) {
Enter();
}
Symbol 353 Button
on (release) {
Close();
}
Symbol 354 MovieClip [quit_box] Frame 1
function Close() {
var _local1 = _parent;
var _local2 = _root;
trace(_local1.GlobalStop);
if (_local1.GlobalStop == false) {
_local2.GlobalStop = false;
}
_local2.popupwindows--;
_local2.StopMusic("loop");
_local1.removeMovieClip();
}
function Enter() {
var _local1 = _root;
var _local2 = _parent;
trace(_local2.GlobalStop);
if (_local2.GlobalStop == false) {
_local1.GlobalStop = false;
}
_local1.gotoAndStop("quit");
_local1.StopMusic("loop");
_local1.popupwindows--;
_local2.removeMovieClip();
}
Symbol 356 MovieClip [save_game] Frame 1
if (_root.mOzaic) {
delay = 0;
gotoAndPlay ("database");
} else {
gotoAndPlay ("cookies");
}
Symbol 356 MovieClip [save_game] Frame 2
sendVars = new LoadVars();
myLoadVars = new LoadVars();
sendVars.UserID = _root.PlayerID;
sendVars.MapNumber = _root.MapNumber;
_root.show.text = "UserID=" + _root.PlayerID;
sendVars.Score = _root.Score;
sendVars.Lifes = _root.Lifes;
myLoadVars.onLoad = function (success) {
if (success) {
trace("data saved on server...");
gotoAndPlay ("end saving");
} else {
trace("error saving data on server");
_root.mOzaic = false;
gotoAndPlay ("end saving");
}
};
sendVars.sendAndLoad(_root.domain + "SaveScore.php", myLoadVars);
Symbol 356 MovieClip [save_game] Frame 3
delay++;
if (delay > 20) {
trace("timeout");
gotoAndPlay ("end saving");
}
Symbol 356 MovieClip [save_game] Frame 4
gotoAndPlay (3);
Symbol 356 MovieClip [save_game] Frame 5
Cookies = sharedobject.getlocal("treasure_hunter");
Symbol 356 MovieClip [save_game] Frame 6
Cookies.data.MapNumber = _root.MapNumber;
Cookies.data.Lifes = _root.Lifes;
Cookies.data.Score = _root.Score;
trace("saved the cookies");
Cookies.flush();
gotoAndPlay ("end saving");
Symbol 356 MovieClip [save_game] Frame 7
_root.play();
_parent.removeMovieClip();
stop();
Symbol 360 Button
on (release) {
_parent.Enter();
}
Symbol 361 Button
on (release) {
_parent.Enter();
}
Symbol 362 MovieClip Frame 1
if (_root.mOzaic || (_root.disarea)) {
gotoAndStop (2);
}
stop();
Symbol 362 MovieClip Frame 2
stop();
Symbol 364 MovieClip [won_box] Frame 1
function LoadGame() {
var _local1 = _root;
_local1.LoadSaved = true;
_local1.Office = null;
_local1.mOffice.removeMovieClip();
_local1.gotoAndPlay("init");
_local1.popupwindows--;
_parent.removeMovieClip();
}
function Enter() {
var _local1 = _root;
if (_local1.mOzaic || (_local1.disarea)) {
_local1.Office = null;
_local1.mOffice.removeMovieClip();
_local1.gotoAndPlay("scores");
_local1.popupwindows--;
_local1.StopMusic("loop");
_parent.removeMovieClip();
} else {
_local1.LoadSaved = false;
_local1.Office = null;
_local1.mOffice.removeMovieClip();
_local1.gotoAndPlay("init");
_local1.popupwindows--;
_local1.StopMusic("loop");
_parent.removeMovieClip();
}
}
function Quit() {
var _local1 = _root;
_local1.gotoAndPlay("quit");
_local1.popupwindows--;
_local1.StopMusic("loop");
_parent.removeMovieClip();
}
message_text.text = this.message;
this.holder._x = -182;
this.holder._y = -47;
this.holder.loadMovie("images/won_icon.swf");
Symbol 364 MovieClip [won_box] Frame 3
if ((this.holder.getBytesLoaded() == this.holder.getBytesTotal()) and (this.holder.getBytesLoaded() > 1000)) {
play();
} else {
gotoAndPlay (2);
}
Symbol 364 MovieClip [won_box] Frame 4
stop();
Symbol 371 MovieClip [reset_map] Frame 1
ChangeMap = false;
stop();
Symbol 371 MovieClip [reset_map] Frame 2
if (_root.Lifes == 0) {
trace("dead");
gotoAndPlay ("game over");
}
if (ChangeMap) {
gotoAndPlay ("change map");
} else {
play();
}
_root.Office = null;
Symbol 371 MovieClip [reset_map] Frame 3
_root.LoadMap(_root.MapNumber);
gotoAndStop (1);
Symbol 371 MovieClip [reset_map] Frame 4
_root.MapNumber = _root.MapNumber + 1;
_root.Today = _root.Today.GetNextWorkDay();
_root.UpdateTodayName();
if (_root.MapNumber == (_root.maps + 1)) {
trace("reset map:: game won");
gotoAndPlay ("game won");
} else {
_root.LoadMap(_root.MapNumber);
gotoAndStop (1);
}
Symbol 371 MovieClip [reset_map] Frame 5
_root.gotoAndStop("game over");
gotoAndStop (1);
Symbol 371 MovieClip [reset_map] Frame 19
_root.gotoAndPlay("game won");
gotoAndStop (1);
Symbol 380 Button
on (release) {
getURL ("http://www.disarea.com", "_blank");
}
Symbol 386 Button
on (release) {
_root.ModalWindow("help");
}
Symbol 389 MovieClip [welcome_box] Frame 1
function Enter() {
var _local1 = _root;
_local1.play();
_local1.popupwindows--;
_local1.StopMusic("loop");
_parent.removeMovieClip();
}
message_text.text = this.message;
Symbol 444 MovieClip [floor] Frame 1
label = "not set";
state = "not set";
stop();
Symbol 444 MovieClip [floor] Frame 2
label = "empty";
state = 0;
stop();
Symbol 444 MovieClip [floor] Frame 7
label = "tile1";
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 12
label = "tile2";
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 17
label = "tile3";
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 22
label = "tile4";
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 27
label = "tile5";
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 32
label = "tile6";
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 37
label = "tile7";
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 42
label = "tile8";
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 47
label = "marker";
volume = new Array([1, 0, 0], [0, 0, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 52
label = "dtile1";
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 57
label = "dtile2";
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 62
label = "dtile3";
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 67
label = "dtile4";
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 72
label = "dtile5";
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 77
label = "dtile6";
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 82
label = "dtile61";
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 87
label = "dtile7";
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 92
label = "dtile8";
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 97
label = "dtile9";
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 102
label = "dtile10";
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 107
label = "dtile11";
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 112
label = "dtile12";
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 117
label = "dtile13";
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 122
label = "dtile14";
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 127
label = "dtile15";
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 132
label = "dtile16";
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 444 MovieClip [floor] Frame 137
label = "dtile17";
volume = new Array([1, 1, 0], [1, 1, 0], [0, 0, 0]);
state = 1;
stop();
Symbol 447 Button
on (press) {
_root.mousePointer._x = this._x;
_root.mousePointer._y = this._y;
_root.mousePointer.i = this.i;
_root.mousePointer.j = this.j;
if ((this.i != -1) and (this.j != 0)) {
_root.mousePointer._visible = true;
} else {
_root.mousePointer._visible = false;
}
}
Symbol 450 MovieClip [mouseUI] Frame 1
function Reset() {
var _local1 = _root;
_local1.MousePointer.i = -1;
_local1.MousePointer.j = -1;
_local1.MousePointer._visible = false;
}
var tmpx;
var tmpy;
var irow;
var i;
var j;
tmpy = _root._ymouse;
tmpx = _root._xmouse;
i = Math.round((tmpy - _root.MapPozY) / (_root.tileH / 2)) - 1;
j = Math.round(((tmpx - _root.MapPozX) + ((_root.tileW * Math.IsEven(i)) / 2)) / _root.tileW) - 1;
if ((i < 0) or (i > (_root.MapSizeX - 1))) {
i = -1;
}
if ((j < 0) or (j > (_root.MapSizeY - 1))) {
j = -1;
}
if ((_root.Office.aFurniture[i][j][1] < 0) or (_root.Office.aFloor[i][j][1] <= 0)) {
i = -1;
j = -1;
}
if ((i == -1) or (j == -1)) {
this._visible = false;
} else {
this._visible = true;
}
this._x = ((_root.MapPozX + (_root.tileW * j)) - ((_root.tileW * Math.IsEven(i)) / 2)) + (_root.tileW / 2);
this._y = _root.MapPozY + ((_root.tileH / 2) * i);
Symbol 450 MovieClip [mouseUI] Frame 2
gotoAndPlay (1);
Symbol 451 MovieClip [mousePointer] Frame 1
i = -1;
j = -1;
Symbol 451 MovieClip [mousePointer] Frame 2
stop();
Symbol 470 Button
on (release) {
_root.ModalWindow("help");
}
Symbol 474 Button
on (release) {
_root.ModalWindow("about");
}
Symbol 478 Button
on (release) {
_root.ModalWindow("quit");
}
Symbol 485 MovieClip Frame 1
stop();
Symbol 489 MovieClip Frame 1
stop();
Symbol 493 Button
on (release) {
getURL ("http://www.dailyfreegames.com", "_blank");
}
Symbol 497 MovieClip Frame 1
this.createEmptyMovieClip("map_holder", 1);
Symbol 497 MovieClip Frame 2
stop();
Symbol 497 MovieClip Frame 3
this.map_holder.loadMovie(filename);
Symbol 497 MovieClip Frame 4
if ((this.map_holder.getBytesLoaded() >= this.map_holder.getBytesTotal()) && (this.map_holder.getBytesLoaded() > 1)) {
_root.play();
this.gotoAndStop(2);
}
Symbol 497 MovieClip Frame 5
gotoAndPlay (4);
Symbol 499 MovieClip Frame 1
blinks = 5;
_root.mOffice.mWorker._alpha = 100;
stop();
Symbol 499 MovieClip Frame 2
if (blinks <= 0) {
gotoAndStop (1);
}
_root.mOffice.mWorker._alpha = 0;
Symbol 499 MovieClip Frame 3
_root.mOffice.mWorker._alpha = 100;
Symbol 499 MovieClip Frame 4
blinks--;
gotoAndPlay (2);
Symbol 500 Button
on (release) {
_root.gotoAndStop("scores");
}
Symbol 502 Button
on (release) {
this.play();
}
Symbol 504 MovieClip Frame 1
_root.SoundOn = true;
stop();
Symbol 504 MovieClip Frame 2
_root.SoundOn = false;
stop();
Symbol 574 Button
on (release) {
SaveToDisarea();
_root.ModalWindow("quit");
}
Symbol 575 Button
on (release) {
SaveToDisarea();
_root.LoadSaved = true;
_root.Office = null;
_root.mOffice.removeMovieClip();
_root.gotoAndPlay("init");
}
Symbol 576 Button
on (release) {
SaveToDisarea();
_root.LoadSaved = false;
_root.Office = null;
_root.mOffice.removeMovieClip();
_root.gotoAndPlay("init");
}
Symbol 577 MovieClip Frame 1
function SaveToDisarea() {
var _local1 = _root;
sendVars = new LoadVars();
myLoadVars = new LoadVars();
sendVars.UserName = _parent.askname.text;
sendVars.UserID = _parent.askname.text;
if (sendVars.UserID == "") {
sendVars.UserID = "anonymous";
}
sendVars.MapNumber = _local1.MapNumber;
sendVars.Score = _local1.Score;
sendVars.Lifes = _local1.Lifes;
myLoadVars.onLoad = function (success) {
if (success) {
trace("data saved on server...");
gotoAndPlay ("end saving");
} else {
trace("error saving data on server");
gotoAndPlay ("end saving");
}
};
_local1.AddKeyListeners();
sendVars.sendAndLoad(_local1.domain + "SaveScore.php", myLoadVars);
}
if (_root.MapNumber > _root.maps) {
gotoAndStop (2);
}
stop();
stop();
Symbol 577 MovieClip Frame 2
stop();
Symbol 581 MovieClip Frame 1
delay = 0;
gotoAndPlay ("disarea");
stop();
Symbol 581 MovieClip Frame 2
TopLoadVars = new LoadVars();
TopLoadVars.onLoad = function (success) {
if (success and (TopLoadVars.Name1 != undefined)) {
trace("TOP loaded from server..." + TopLoadVars.Name1);
score.text = "$" + _root.score;
rank.text = ((("You are ranked " + TopLoadVars.PlayerRank) + " out of ") + TopLoadVars.TotalPlayers) + " other company workers";
i = 1;
while (i <= 20) {
if (String(eval ("TopLoadVars.Name" + i)) != "") {
eval ("name" + i).text = ((" " + i) + ". ") + eval ("TopLoadVars.Name" + i);
}
tmpscore = eval ("TopLoadVars.Score" + i);
if (String(tmpscore) != "") {
eval ("score" + i).text = tmpscore;
}
if (Number(eval ("TopLoadVars.MapNumber" + i)) > Number(_root.maps)) {
eval ("madeit" + i).text = "made it till vacation";
}
if (Number(eval ("TopLoadVars.ContactID" + i)) == Number(_root.PlayerID)) {
eval ("name" + i).textColor = "0xFF0000";
eval ("score" + i).textColor = "0xFF0000";
eval ("madeit" + i).textColor = "0xFF0000";
}
i = i + 1;
}
gotoAndStop ("end loading");
} else {
this.temp.text = "error";
trace("error loading top scores data on server");
_root.mOzaic = false;
gotoAndStop ("error");
}
};
TopLoadVars.load("LoadTopScores.php");
Symbol 581 MovieClip Frame 3
delay++;
if (delay > 160) {
trace("timeout");
gotoAndStop ("error");
}
Symbol 581 MovieClip Frame 4
gotoAndPlay (3);
Symbol 581 MovieClip Frame 5
stop();
Symbol 581 MovieClip Frame 8
TopLoadVars = new LoadVars();
TopLoadVars.onLoad = function (success) {
if (success) {
_root.DeleteKeyListeners();
score.text = _root.score;
icounter = 0;
insertname = false;
i = 1;
while (i <= 20) {
icounter++;
tmpscore = eval ("TopLoadVars.Score" + i);
if ((Number(tmpscore) < Number(_root.Score)) && (!insertname)) {
askname._x = eval ("name" + i)._x;
askname._y = eval ("name" + i)._y;
askname.text = "<type your name here...>";
askname.onSetFocus = function (ClearField) {
askname.text = "";
};
eval ("score" + i).text = _root.Score;
tmpmap = Number(_root.MapNumber);
if (tmpmap == (_root.Maps + 1)) {
tmpmap = _root.Maps;
}
eval ("madeit" + i).text = "level " + String(tmpmap);
if (Number(_root.MapNumber) > Number(_root.maps)) {
eval ("madeit" + i).text = eval ("madeit" + i).text + " - WON!!!";
}
eval ("name" + i).textColor = "0xFF0000";
eval ("score" + i).textColor = "0xFF0000";
eval ("madeit" + i).textColor = "0xFF0000";
icounter++;
insertname = true;
} else {
var j = (i - Number(insertname));
if (String(eval ("TopLoadVars.Name" + j)) != "") {
eval ("name" + i).text = ((" " + i) + ". ") + eval ("TopLoadVars.Name" + j);
}
tmpscore = eval ("TopLoadVars.Score" + j);
if (String(tmpscore) != "") {
eval ("score" + i).text = tmpscore;
}
tmpmap = Number(eval ("TopLoadVars.MapNumber" + j));
if (tmpmap == (_root.Maps + 1)) {
tmpmap = _root.Maps;
}
if (String(eval ("TopLoadVars.MapNumber" + j)) != "") {
eval ("madeit" + i).text = "level " + tmpmap;
}
if (Number(eval ("TopLoadVars.MapNumber" + j)) > Number(_root.maps)) {
eval ("madeit" + i).text = " - WON!!!";
}
}
i = i + 1;
}
if (!insertname) {
askname._x = eval ("name" + i)._x;
askname._y = eval ("name" + i)._y;
askname.text = "<type your name here...>";
askname.onSetFocus = function (ClearField) {
askname.text = "";
};
eval ("score" + i).text = _root.Score;
tmpmap = Number(_root.MapNumber);
if (tmpmap == (_root.Maps + 1)) {
tmpmap = _root.Maps;
}
eval ("madeit" + i).text = "level " + String(tmpmap);
if (Number(_root.MapNumber) > Number(_root.maps)) {
eval ("madeit" + i).text = eval ("madeit" + i).text + " & WON!!!";
}
eval ("name" + i).textColor = "0xFF0000";
eval ("score" + i).textColor = "0xFF0000";
eval ("madeit" + i).textColor = "0xFF0000";
icounter++;
insertname = true;
}
gotoAndStop ("end loading2");
} else {
this.temp.text = "error";
trace("error loading top scores data on server");
_root.disarea = false;
gotoAndStop ("error");
}
};
TopLoadVars.load(_root.domain + "LoadTopScores.php");
Symbol 581 MovieClip Frame 9
delay++;
if (delay > 260) {
trace("timeout");
gotoAndStop ("error");
}
Symbol 581 MovieClip Frame 10
gotoAndPlay ("delay2");
Symbol 581 MovieClip Frame 11
stop();
Symbol 581 MovieClip Frame 18
Symbol 581 MovieClip Frame 19
stop();