Frame 2
stop();
Frame 3
function unknownToArray(ob) {
if (ob.length == undefined) {
return(new Array(ob));
}
var _local3 = new Array();
var _local1 = 0;
while (_local1 < ob.length) {
_local3.push(ob[_local1]);
_local1++;
}
return(_local3);
}
function setColorChoices(pantsChoice, shirtChoice) {
switch (shirtChoice) {
case "Shirt0" :
shirtAll = "DCF1FF|7CCBFF";
tie = "|BC3131";
break;
case "Shirt1" :
shirtAll = "DCF1FF|7CCBFF";
tie = "|FFFAA4";
break;
case "Shirt2" :
shirtAll = "FFFFFF|DCDCDC";
tie = "|BC3131";
break;
case "Shirt3" :
shirtAll = "FFFFFF|DCDCDC";
tie = "|FFFAA4";
break;
case "Shirt4" :
shirtAll = "FF66FF|FF33FF";
tie = "|66FFFF";
break;
case "Shirt5" :
shirtAll = "00FFFF|00CCCC";
tie = "|FFFFFF";
break;
default :
shirtAll = "DCF1FF|7CCBFF";
tie = "|BC3131";
}
switch (pantsChoice) {
case "pants0" :
pantsAll = "|ECCFB3|DFAF81|C58135|B36817";
break;
case "pants1" :
pantsAll = "|ECCFB3|DFAF81|C58135|B36817";
break;
case "pants2" :
pantsAll = "|ECCFB3|DFAF81|C58135|B36817";
break;
case "pants3" :
pantsAll = "|ECCFB3|DFAF81|C58135|B36817";
break;
case "pants4" :
pantsAll = "|FFFFFF|EEEEFF|C58135|B36817";
break;
case "pants5" :
pantsAll = "|FFFFFF|EEEEFF|C58135|B36817";
break;
default :
pantsAll = "|ECCFB3|DFAF81|C58135|B36817";
}
characterColors = (((shirtAll + "") + pantsAll) + "") + tie;
}
function loadInit() {
this.createEmptyMovieClip("loader", this.getNextHighestDepth());
loader._visible = false;
loader._x = -400;
loader.volumeControl = new Sound(loader);
loader.volumeControl.setVolume(0);
var _local2 = 0;
while (_local2 < toLoadAr.length) {
loader.createEmptyMovieClip(toLoadAr[_local2], loader.getNextHighestDepth());
_local2++;
}
loadDude();
}
function loadConfigFile() {
xparser = new com.doodlehead.xml.XMLLoader("config.xml");
xparser.addEventListener("xmlLoadedAndParsed", mx.utils.Delegate.create(this, xmlLoadFinished));
xparser.doLoad();
}
function getSwfs() {
var _local5 = new Array();
var _local4 = 0;
while (_local4 < configob.levels.level.length) {
var _local6 = configob.levels.level[_local4];
var _local9 = _local6.drones.drone;
var _local7 = _local6.seekers.seeker;
var _local3 = [unknownToArray(_local9), unknownToArray(_local7)];
var _local1 = 0;
while (_local1 < _local3.length) {
if ((_local3[_local1].length != 0) && (_local3[_local1] != undefined)) {
var _local2 = 0;
while (_local2 < _local3[_local1].length) {
if (_local3[_local1][_local2].swf != undefined) {
_local5[_local3[_local1][_local2].swf] = "";
}
_local2++;
}
}
_local1++;
}
_local4++;
}
for (var _local10 in _local5) {
var _local8 = _local10.split(".");
toLoadAr.push(_local8[0]);
}
}
function xmlLoadFinished(eventObj) {
if (eventObj.goodload) {
configob = eventObj.ar.config;
delete xparser;
getSwfs();
loadInit();
} else {
trace("ERROR XML LOAD FINISHED");
}
}
function clearOut() {
mcLoadOther.loadInit(toLoadLaterAr);
mcLoader.removeListener(mylistener);
for (var _local1 in loader) {
if (loader[_local1].getBytesTotal() != undefined) {
byteTotal = byteTotal + loader[_local1].getBytesTotal();
}
}
trace("TOTAL BYTES " + byteTotal);
delete mcLoader;
delete mylistener;
delete loadListener;
delete onEnterFrame;
loader.removeMovieClip();
_mcLoadBar.setPercent(1);
}
function addToTotal() {
runningTotal = runningTotal + loader[toLoadAr[toLoadCtr]].getBytesTotal();
}
function loadDude() {
trace((((("LOAD " + toLoadAr[toLoadCtr]) + " ") + toLoadCtr) + " :: ") + toLoadAr.length);
mcLoader.loadClip(toLoadAr[toLoadCtr] + ".swf", loader[toLoadAr[toLoadCtr]]);
loadListener.onLoadComplete = function (target_mc, httpStatus) {
this.parent.addToTotal();
this.parent.toLoadCtr++;
if (this.parent.toLoadCtr < this.parent.toLoadAr.length) {
this.parent.loadDude();
} else {
this.parent.clearOut();
}
};
}
function initialLoad() {
var _local3 = this.getBytesLoaded();
var _local2 = this.getBytesTotal();
if ((_local3 == _local2) && (_local2 > 40)) {
runningTotal = _local2;
loadConfigFile();
this.onEnterFrame = this.subLoad;
} else {
pctLoaded = _local3 / knownTotal;
if (pctLoaded > 1) {
pctLoaded = 1;
}
_mcLoadBar.setPercent(pctLoaded);
}
}
function subLoad() {
var _local1 = loader[toLoadAr[toLoadCtr]].getBytesLoaded();
if (_local1 != undefined) {
pctLoaded = (_local1 + runningTotal) / knownTotal;
if (pctLoaded > 1) {
pctLoaded = 1;
}
_mcLoadBar.setPercent(pctLoaded);
}
}
var fallFromSky = false;
var bInitialLoad = true;
stop();
radioStationMgr = this.attachMovie(com.doodlehead.sound.RadioStation.id, "rsmgr", 999);
var loadListener = new Object();
loadListener.parent = this;
var mcLoader = new MovieClipLoader();
var mylistener = mcLoader.addListener(loadListener);
var toLoadAr = new Array("shell", "character_player");
var toLoadLaterAr = new Array("endMeeting", "deathSequence");
var toLoadCtr = 0;
var xparser;
var configob;
var pctLoaded = 0;
var byteTotal = this.getBytesTotal();
var knownTotal = 4724149;
var runningTotal = 0;
var shirtAll = "";
var pantsAll = "";
var tie = "";
var characterColors = "";
var FRIDAY = 5;
var d = new Date();
this.onEnterFrame = initialLoad;
Frame 5
function toggleSound(eventObj) {
if (eventObj.value == true) {
radioStationMgr.mute = false;
radioStationMgr.playClip(0);
} else {
radioStationMgr.mute = true;
radioStationMgr.stopClip();
}
}
function clearOut() {
mcLoader.removeListener(mylistener);
delete mcLoader;
delete mylistener;
delete loadListener;
mcIntro.gotoAndPlay(2);
playBackgroundMusic();
}
function playBackgroundMusic() {
var _local2 = unknownToArray(configob.audio.bgloops.song);
var _local6 = new Array();
var _local1 = 0;
while (_local1 < _local2.length) {
_local6.push({soundfile:_local2[_local1].location, loops:parseInt(_local2[_local1].defreps), markers:[]});
_local1++;
}
radioStationMgr.clearPlaylist();
radioStationMgr.setPlaylist(_local6);
if (!radioStationMgr.mute) {
radioStationMgr.playClip(0);
}
}
function playElevatorMusic() {
var _local2 = unknownToArray(configob.audio.elevatorLoop.song);
var _local6 = new Array();
var _local1 = 0;
while (_local1 < _local2.length) {
_local6.push({soundfile:_local2[_local1].location, loops:parseInt(_local2[_local1].defreps), markers:[]});
_local1++;
}
radioStationMgr.clearPlaylist();
radioStationMgr.setPlaylist(_local6);
if (!radioStationMgr.mute) {
radioStationMgr.playClip(0);
}
}
stop();
stop();
var loadListener = new Object();
loadListener.parent = this;
var mcLoader = new MovieClipLoader();
var mylistener = mcLoader.addListener(loadListener);
mcLoader.loadClip("shell.swf", mcIntro);
loadListener.onLoadComplete = function (target_mc, httpStatus) {
this.parent.clearOut();
};
_btnOnOff.addEventListener("statechange", mx.utils.Delegate.create(this, toggleSound));
Frame 6
fallFromSky = false;
gotoAndPlay ("gameplay");
Frame 7
fallFromSky = true;
gotoAndPlay ("gameplay");
Frame 8
_mcFMTKY.congifob = configob;
playBackgroundMusic();
stop();
Frame 9
stop();
Symbol 2 MovieClip [l_sprite] Frame 1
#initclip 53
Object.registerClass("l_sprite", com.doodlehead.actors.CharacterSprite);
#endinitclip
Symbol 38 MovieClip [l_fx_explosion] Frame 20
stop();
this.removeMovieClip();
Symbol 60 MovieClip Frame 1
stop();
Symbol 61 MovieClip [l_damageIndicator] Frame 1
#initclip 45
Object.registerClass("l_damageIndicator", com.doodlehead.view.DamageIndicator);
#endinitclip
Symbol 63 MovieClip [l_convoBalloonWedge] Frame 9
stop();
Symbol 63 MovieClip [l_convoBalloonWedge] Frame 15
stop();
Symbol 70 MovieClip [M_Convo Interface] Frame 1
#initclip 46
Object.registerClass("M_Convo Interface", com.doodlehead.userdisplay.ConvoInterface);
#endinitclip
Symbol 117 MovieClip [microwave] Frame 1
#initclip 47
Object.registerClass("microwave", com.doodlehead.view.ObjectActionable);
#endinitclip
stop();
Symbol 117 MovieClip [microwave] Frame 14
gotoAndStop (1);
Symbol 117 MovieClip [microwave] Frame 75
endAnimation();
Symbol 117 MovieClip [microwave] Frame 78
stop();
Symbol 134 MovieClip [M_Object Toilet] Frame 1
#initclip 48
Object.registerClass("M_Object Toilet", com.doodlehead.view.ObjectActionable);
#endinitclip
stop();
Symbol 134 MovieClip [M_Object Toilet] Frame 3
gotoAndStop (1);
Symbol 134 MovieClip [M_Object Toilet] Frame 19
endAnimation();
stop();
Symbol 137 MovieClip Frame 1
stop();
Symbol 137 MovieClip Frame 5
stop();
Symbol 137 MovieClip Frame 10
stop();
Symbol 137 MovieClip Frame 15
stop();
Symbol 137 MovieClip Frame 20
stop();
Symbol 137 MovieClip Frame 25
stop();
Symbol 138 MovieClip [l_playerMap] Frame 1
#initclip 49
Object.registerClass("l_playerMap", com.doodlehead.userdisplay.PlayerMap);
#endinitclip
Symbol 139 MovieClip [l_pieChart] Frame 1
#initclip 50
Object.registerClass("l_pieChart", com.doodlehead.drawing.PieChart);
#endinitclip
Symbol 155 MovieClip [l_mapAndHealth] Frame 1
#initclip 51
Object.registerClass("l_mapAndHealth", com.doodlehead.userdisplay.MapAndHealth);
#endinitclip
Symbol 156 MovieClip [l_userInterface] Frame 1
#initclip 52
Object.registerClass("l_userInterface", com.doodlehead.userdisplay.UserInterface);
#endinitclip
Symbol 159 MovieClip [l_dividerMulti] Frame 1
stop();
Symbol 162 MovieClip [l_divider] Frame 1
stop();
Symbol 861 MovieClip [__Packages.com.doodlehead.view.DamageIndicator] Frame 0
class com.doodlehead.view.DamageIndicator extends MovieClip
{
var $reverse, $cval, $dy, damageMC, $damageText, damageScore, _xscale, _yscale, _alpha, _y, removeMovieClip;
function DamageIndicator () {
super();
$reverse = false;
}
function init(c1, c2, dn, dd) {
$cval = c1;
$reverse = false;
$dy = -5;
if (dn > 0) {
$cval = c2;
damageMC.gotoAndStop(2);
}
$damageText = dn + "%";
damageScore.txtPoints.text = dn + " %";
damageScore.txtPoints.htmlText = dn + " %";
damageScore.txtDesc._x = (damageScore.txtPoints.textWidth + damageScore.txtPoints._x) + 8;
damageScore.txtDesc.htmlText = dd;
damageScore.txtBackground._width = (damageScore.txtPoints.textWidth + damageScore.txtDesc.textWidth) + 40;
_xscale = (_yscale = 1);
}
function onEnterFrame() {
var _local2 = new com.wis.math.alg.Vector(_xscale, _yscale);
_local2.x = (((_local2.x * 2) > 100) ? 100 : (_local2.x * 2));
_local2.y = (((_local2.y * 2) > 100) ? 100 : (_local2.y * 2));
_xscale = _local2.x;
_yscale = _local2.y;
if (!$reverse) {
_alpha = (((_alpha * 2) > 150) ? 150 : (_alpha * 2));
$dy = $dy * 1.1;
if ($dy < -1) {
$dy = -1;
}
_y = _y + $dy;
if (_alpha >= 150) {
$reverse = true;
}
} else {
_alpha = _alpha - 2.5;
_y = _y + $dy;
if (_alpha <= 0) {
removeMovieClip();
}
}
}
}
Symbol 862 MovieClip [__Packages.com.wis.math.alg.Vector] Frame 0
class com.wis.math.alg.Vector
{
var x, y, z, $b3;
function Vector (vx, vy, vz) {
x = vx;
y = vy;
z = vz;
if (vz != undefined) {
$b3 = true;
} else {
$b3 = false;
}
}
function toString() {
var _local2;
if ($b3) {
_local2 = ((((("[" + x) + ",") + y) + ",") + z) + "]";
} else {
_local2 = ((("[" + x) + ",") + y) + "]";
}
return(_local2);
}
function resetComponents(vx, vy, vz) {
x = vx;
y = vy;
if ($b3) {
z = vz;
}
}
function copyComponents(V) {
x = V.x;
y = V.y;
if ($b3) {
z = V.z;
}
}
function incrementX(incX) {
x = x + incX;
}
function incrementY(incY) {
y = y + incY;
}
function incrementZ(incZ) {
if ($b3) {
z = z + incZ;
}
}
function incrementComponents(incX, incY, incZ) {
x = x + incX;
y = y + incY;
if ($b3) {
z = z + incZ;
}
}
function adds(V) {
x = x + V.x;
y = y + V.y;
if ($b3) {
z = z + V.z;
}
return(this);
}
function returnAddition(V) {
var _local3;
if ($b3) {
_local3 = new com.wis.math.alg.Vector(x + V.x, y + V.y, z + V.z);
} else {
_local3 = new com.wis.math.alg.Vector(x + V.x, y + V.y);
}
return(_local3);
}
function subtract(V) {
x = x - V.x;
y = y - V.y;
if ($b3) {
z = z - V.z;
}
return(this);
}
function returnSubtraction(V) {
var _local3;
if ($b3) {
_local3 = new com.wis.math.alg.Vector(x - V.x, y - V.y, z - V.z);
} else {
_local3 = new com.wis.math.alg.Vector(x - V.x, y - V.y);
}
return(_local3);
}
function scalar(s) {
x = x * s;
y = y * s;
if ($b3) {
z = z * s;
}
}
function returnScalar(s) {
var _local3;
if ($b3) {
_local3 = new com.wis.math.alg.Vector(x * s, y * s, z * s);
} else {
_local3 = new com.wis.math.alg.Vector(x * s, y * s);
}
return(_local3);
}
function scalarComponent(V) {
var _local2;
if ($b3) {
_local2 = new com.wis.math.alg.Vector(x, y, z);
} else {
_local2 = new com.wis.math.alg.Vector(x, y);
}
_local2.unitVector(V);
return(dotProduct(_local2));
}
function divide(s) {
x = x / s;
y = y / s;
if ($b3) {
z = z / s;
}
return(this);
}
function returnDivide(s) {
var _local3;
if ($b3) {
_local3 = new com.wis.math.alg.Vector(x / s, y / s, z / s);
} else {
_local3 = new com.wis.math.alg.Vector(x / s, y / s);
}
return(_local3);
}
function dotProduct(V) {
var _local3;
if ($b3) {
_local3 = ((x * V.x) + (y * V.y)) + (z * V.z);
} else {
_local3 = (x * V.x) + (y * V.y);
}
return(_local3);
}
function crossProduct(V) {
var _local2 = new com.wis.math.alg.Vector(0, 0, 0);
if ($b3) {
_local2.x = (y * V.z) - (z * V.y);
_local2.y = (z * V.x) - (x * V.z);
_local2.z = (x * V.y) - (y * V.x);
} else {
_local2.x = 0;
_local2.y = 0;
_local2.z = (x * V.y) - (y * V.x);
}
return(_local2);
}
function norm() {
var _local2;
if ($b3) {
_local2 = Math.sqrt(((x * x) + (y * y)) + (z * z));
} else {
_local2 = Math.sqrt((x * x) + (y * y));
}
return(_local2);
}
function unitVector() {
var _local2;
var _local3 = norm();
if ($b3) {
_local2 = new com.wis.math.alg.Vector(x, y, z);
} else {
_local2 = new com.wis.math.alg.Vector(x, y);
}
_local2.x = _local2.x / _local3;
_local2.y = _local2.y / _local3;
if ($b3) {
_local2.z = _local2.z / _local3;
}
return(_local2);
}
function normalize() {
var _local2 = norm();
x = x / _local2;
y = y / _local2;
if ($b3) {
z = z / _local2;
}
}
function swap(V) {
var _local5;
var _local4;
var _local3;
_local5 = x;
_local4 = y;
x = V.x;
y = V.y;
V.x = _local5;
V.y = _local4;
if ($b3) {
_local3 = z;
z = V.z;
V.z = _local3;
}
}
function angleVector(V) {
return(dotProduct(V) / (norm() * V.norm()));
}
function areaPara(V) {
var _local2;
if ($b3) {
_local2 = new com.wis.math.alg.Vector(x, y, z);
} else {
_local2 = new com.wis.math.alg.Vector(x, y);
}
_local2.crossProduct(V);
return(_local2.norm());
}
function areaTriangle(A, B) {
var _local2;
var _local3;
if ($b3) {
_local2 = new com.wis.math.alg.Vector(x, y, z);
_local3 = new com.wis.math.alg.Vector(x, y, z);
} else {
_local2 = new com.wis.math.alg.Vector(x, y);
_local3 = new com.wis.math.alg.Vector(x, y);
}
_local2 = subtract(A);
_local3 = subtract(B);
return(0.5 * _local2.areaPara(_local3));
}
function volumePara3d(A, B) {
var _local2 = new com.wis.math.alg.Vector(x, y, z);
_local2 = A.crossProduct(B);
return(Math.abs(A.dotProduct(_local2)));
}
function perp() {
var _local2;
if ($b3) {
_local2 = new com.wis.math.alg.Vector(-y, x, z);
} else {
_local2 = new com.wis.math.alg.Vector(-y, x);
}
return(_local2);
}
function fromPointVals(x1, x2, y1, y2, z1, z2) {
var _local1;
if (z1) {
_local1 = new com.wis.math.alg.Vector(x2 - x1, y2 - y1, z2 - z1);
} else {
_local1 = new com.wis.math.alg.Vector(x2 - x1, y2 - y1);
}
return(_local1);
}
function equal(V) {
var _local3;
if ($b3) {
_local3 = ((round3(x) == round3(V.x)) && (round3(y) == round3(V.y))) && (round3(z) == round3(V.z));
} else {
_local3 = (round3(x) == round3(V.x)) && (round3(y) == round3(V.y));
}
return(_local3);
}
function sameDirection(V) {
var _local3;
var _local2;
if ($b3) {
_local3 = new com.wis.math.alg.Vector(x, y, z);
_local2 = new com.wis.math.alg.Vector(x, y, z);
} else {
_local3 = new com.wis.math.alg.Vector(x, y);
_local2 = new com.wis.math.alg.Vector(x, y);
}
_local3.unitVector(this);
_local2.unitVector(V);
return(_local3.equal(_local2));
}
function greater(V) {
var _local3;
if ($b3) {
_local3 = ((round3(x) > round3(V.x)) && (round3(y) > round3(V.y))) && (round3(z) > round3(V.z));
} else {
_local3 = (round3(x) > round3(V.x)) && (round3(y) > round3(V.y));
}
return(_local3);
}
function greaterEqual(V) {
var _local3;
if ($b3) {
_local3 = ((round3(x) >= round3(V.x)) && (round3(y) >= round3(V.y))) && (round3(z) >= round3(V.z));
} else {
_local3 = (round3(x) >= round3(V.x)) && (round3(y) >= round3(V.y));
}
return(_local3);
}
function less(V) {
var _local3;
if ($b3) {
_local3 = ((round3(x) < round3(V.x)) && (round3(y) < round3(V.y))) && (round3(z) < round3(V.z));
} else {
_local3 = (round3(x) < round3(V.x)) && (round3(y) < round3(V.y));
}
return(_local3);
}
function lessEqual(V) {
var _local3;
if ($b3) {
_local3 = ((round3(x) <= round3(V.x)) && (round3(y) <= round3(V.y))) && (round3(z) <= round3(V.z));
} else {
_local3 = (round3(x) <= round3(V.x)) && (round3(y) <= round3(V.y));
}
return(_local3);
}
function round3(n) {
return(Math.round(n * 1000) / 1000);
}
function inv() {
return(new com.wis.math.alg.Vector(1 / x, 1 / y, 1 / z));
}
function get _len() {
return(Math.sqrt(((x * x) + (y * y)) + (z * z)));
}
function get _lenSq() {
return(((x * x) + (y * y)) + (z * z));
}
function copy() {
return(new com.wis.math.alg.Vector(x, y, z));
}
function transform(trans, dontTranslate) {
var _local5;
var _local4;
var _local3;
if (dontTranslate) {
_local5 = dot(trans.$vx, this);
_local4 = dot(trans.$vy, this);
_local3 = dot(trans.$vz, this);
} else {
_local5 = dot(trans.$vx, this) + trans.$c.x;
_local4 = dot(trans.$vy, this) + trans.$c.y;
_local3 = dot(trans.$vz, this) + trans.$c.z;
}
x = _local5;
y = _local4;
z = _local3;
}
function transformed(trans, dontTranslate) {
if (dontTranslate) {
return(new com.wis.math.alg.Vector(dot(trans.$vx, this), dot(trans.$vy, this), dot(trans.$vz, this)));
}
return(new com.wis.math.alg.Vector(dot(trans.$vx, this) + trans.$c.x, dot(trans.$vy, this) + trans.$c.y, dot(trans.$vz, this) + trans.$c.z));
}
static function normalizer(vec) {
var _local1 = 1 / vec.__get___len();
return(new com.wis.math.alg.Vector(vec.x * _local1, vec.y * _local1, vec.z * _local1));
}
static function neg(v) {
return(new com.wis.math.alg.Vector(-v.x, -v.y, -v.z));
}
static function adder(v1, v2) {
return(new com.wis.math.alg.Vector(v1.x + v2.x, v1.y + v2.y, v1.z + v2.z));
}
static function scaler(v1, s) {
return(new com.wis.math.alg.Vector(v1.x * s, v1.y * s, v1.z * s));
}
static function compare(v1, v2) {
return(((v1.x == v2.x) && (v1.y == v2.y)) && (v1.z == v2.z));
}
static function mult(v1, v2) {
return(new com.wis.math.alg.Vector(v1.x * v2.x, v1.y * v2.y, v1.z * v2.z));
}
static function dot(v1, v2) {
return(((v1.x * v2.x) + (v1.y * v2.y)) + (v1.z * v2.z));
}
static function cross(v1, v2) {
return(new com.wis.math.alg.Vector((v1.y * v2.z) - (v1.z * v2.y), (v1.z * v2.x) - (v1.x * v2.z), (v1.x * v2.y) - (v1.y * v2.x)));
}
static var XX = new com.wis.math.alg.Vector(1, 0, 0);
static var YY = new com.wis.math.alg.Vector(0, 1, 0);
static var ZZ = new com.wis.math.alg.Vector(0, 0, 1);
static var OO = new com.wis.math.alg.Vector(0, 0, 0);
}
Symbol 863 MovieClip [__Packages.com.wis.math.geom.util.Transformation] Frame 0
class com.wis.math.geom.util.Transformation
{
var $vx, $vy, $vz, $c, $identity, $inverse;
function Transformation (vx, vy, vz, c, dontFindInverse, actualOrder) {
if (actualOrder) {
$vx = vx;
$vy = vy;
$vz = vz;
} else {
$vx = new com.wis.math.alg.Vector(vx.x, vy.x, vz.x);
$vy = new com.wis.math.alg.Vector(vx.y, vy.y, vz.y);
$vz = new com.wis.math.alg.Vector(vx.z, vy.z, vz.z);
}
$c = c;
$identity = false;
if (((com.wis.math.alg.Vector.compare(vx, com.wis.math.alg.Vector.XX) && (com.wis.math.alg.Vector.compare(vy, com.wis.math.alg.Vector.YY))) && (com.wis.math.alg.Vector.compare(vz, com.wis.math.alg.Vector.ZZ))) && (com.wis.math.alg.Vector.compare(c, com.wis.math.alg.Vector.OO))) {
$identity = true;
}
if ((typeof(dontFindInverse) == "undefined") || (!dontFindInverse)) {
if ($identity) {
$inverse = this;
} else {
$inverse = findInverse(this);
}
}
}
function copy() {
var _local3 = true;
if (typeof($inverse) == "undefined") {
_local3 = false;
}
var _local2 = new com.wis.math.geom.util.Transformation($vx.copy(), $vy.copy(), $vz.copy(), $c.copy(), _local3, true);
if (_local3) {
if (!$identity) {
_local2.$inverse = new com.wis.math.geom.util.Transformation($inverse.$vx.copy(), $inverse.$vy.copy(), $inverse.$vz.copy(), $inverse.$c.copy(), true, true);
} else {
_local2.$inverse = _local2;
}
}
return(_local2);
}
function findInverse(trans) {
var _local2 = reducedRowEchelonForm([[trans.$vx.x, trans.$vx.y, trans.$vx.z, 1, 0, 0], [trans.$vy.x, trans.$vy.y, trans.$vy.z, 0, 1, 0], [trans.$vz.x, trans.$vz.y, trans.$vz.z, 0, 0, 1]]);
$vx = new com.wis.math.alg.Vector(_local2[0][3], _local2[0][4], _local2[0][5]);
$vy = new com.wis.math.alg.Vector(_local2[1][3], _local2[1][4], _local2[1][5]);
$vz = new com.wis.math.alg.Vector(_local2[2][3], _local2[2][4], _local2[2][5]);
var _local4 = new com.wis.math.geom.util.Transformation(new com.wis.math.alg.Vector($vx.x, $vy.x, $vz.x), new com.wis.math.alg.Vector($vx.y, $vy.y, $vz.y), new com.wis.math.alg.Vector($vx.z, $vy.z, $vz.z), new com.wis.math.alg.Vector(0, 0, 0), true);
_local4.$c = com.wis.math.alg.Vector.neg(trans.$c.transformed(_local4));
_local4.$inverse = trans;
return(_local4);
}
static function reducedRowEchelonForm(rows) {
var _local7 = rows.length;
var _local5 = rows[0].length;
var _local6;
var _local2;
var _local4;
var _local1;
var _local9;
var _local8;
_local2 = 0;
while (_local2 < _local7) {
if (Math.abs(rows[_local2][_local2] - 0) < $ACCURACY) {
_local4 = _local2 + 1;
while (_local4 < _local7) {
if (Math.abs(rows[_local4][_local2] - 0) > $ACCURACY) {
_local1 = 0;
while (_local1 < _local5) {
_local6 = rows[_local2][_local1];
rows[_local2][_local1] = rows[_local4][_local1];
rows[_local4][_local1] = _local6;
_local1++;
}
break;
}
_local4++;
}
}
_local9 = rows[_local2][_local2];
_local1 = 0;
while (_local1 < _local5) {
rows[_local2][_local1] = rows[_local2][_local1] / _local9;
_local1++;
}
_local4 = 0;
while (_local4 < _local7) {
if (_local4 != _local2) {
_local8 = rows[_local4][_local2];
_local1 = _local2;
while (_local1 < _local5) {
rows[_local4][_local1] = rows[_local4][_local1] - (rows[_local2][_local1] * _local8);
_local1++;
}
}
_local4++;
}
_local2++;
}
return(rows);
}
function toString() {
var _local4 = [[$vx.x, $vx.y, $vx.z], [$vy.x, $vy.y, $vy.z], [$vz.x, $vz.y, $vz.z], [$c.x, $c.y, $c.z]];
var _local3;
var _local2;
var _local5;
_local5 = "[ ";
_local3 = 0;
while (_local3 < _local4.length) {
_local2 = 0;
while (_local2 < _local4[_local3].length) {
if (Math.abs(_local4[_local3][_local2] - 0) < $ACCURACY) {
_local5 = _local5 + "0 ";
} else {
_local5 = _local5 + (_local4[_local3][_local2] + " ");
}
_local2++;
}
if (_local3 < (_local4.length - 1)) {
_local5 = _local5 + "\n ";
}
_local3++;
}
return(_local5 + " ]");
}
static function multipleTrans(trans_arr) {
if (trans_arr.length == 0) {
return($IdentityTrans);
}
var _local1;
var _local2;
if (trans_arr.length == 1) {
_local1 = trans_arr[0].copy();
} else {
_local1 = trans_arr[0];
}
_local2 = 1;
while (_local2 < trans_arr.length) {
_local1 = new com.wis.math.geom.util.Transformation(new com.wis.math.alg.Vector(com.wis.math.alg.Vector.dot(trans_arr[_local2].$vx, new com.wis.math.alg.Vector(_local1.$vx.x, _local1.$vy.x, _local1.$vz.x)), com.wis.math.alg.Vector.dot(trans_arr[_local2].$vx, new com.wis.math.alg.Vector(_local1.$vx.y, _local1.$vy.y, _local1.$vz.y)), com.wis.math.alg.Vector.dot(trans_arr[_local2].vx, new com.wis.math.alg.Vector(_local1.$vx.z, _local1.$vy.z, _local1.$vz.z))), new com.wis.math.alg.Vector(com.wis.math.alg.Vector.dot(trans_arr[_local2].$vy, new com.wis.math.alg.Vector(_local1.$vx.x, _local1.$vy.x, _local1.$vz.x)), com.wis.math.alg.Vector.dot(trans_arr[_local2].$vy, new com.wis.math.alg.Vector(_local1.$vx.y, _local1.$vy.y, _local1.$vz.y)), com.wis.math.alg.Vector.dot(trans_arr[_local2].vy, new com.wis.math.alg.Vector(_local1.$vx.z, _local1.$vy.z, _local1.$vz.z))), new com.wis.math.alg.Vector(com.wis.math.alg.Vector.dot(trans_arr[_local2].$vz, new com.wis.math.alg.Vector(_local1.$vx.x, _local1.$vy.x, _local1.$vz.x)), com.wis.math.alg.Vector.dot(trans_arr[_local2].$vz, new com.wis.math.alg.Vector(_local1.$vx.y, _local1.$vy.y, _local1.$vz.y)), com.wis.math.alg.Vector.dot(trans_arr[_local2].vz, new com.wis.math.alg.Vector(_local1.$vx.z, _local1.$vy.z, _local1.$vz.z))), _local1.$c.transformed(trans_arr[_local2]), false, true);
_local2++;
}
return(_local1);
}
function scale(amount) {
return(new com.wis.math.geom.util.Transformation(com.wis.math.alg.Vector.scaler(com.wis.math.alg.Vector.XX, amount.x), com.wis.math.alg.Vector.scaler(com.wis.math.alg.Vector.YY, amount.y), com.wis.math.alg.Vector.scaler(com.wis.math.alg.Vector.ZZ, amount.z), com.wis.math.alg.Vector.OO));
}
function rotate(dim, amnt) {
if ((dim == 0) || (dim == "x")) {
return(new com.wis.math.geom.util.Transformation(com.wis.math.alg.Vector.XX, com.wis.math.alg.Vector.adder(com.wis.math.alg.Vector.scaler(com.wis.math.alg.Vector.YY, Math.cos(amnt)), com.wis.math.alg.Vector.scaler(com.wis.math.alg.Vector.ZZ, Math.sin(amnt))), com.wis.math.alg.Vector.adder(com.wis.math.alg.Vector.scaler(com.wis.math.alg.Vector.ZZ, Math.cos(amnt)), com.wis.math.alg.Vector.neg(com.wis.math.alg.Vector.scaler(com.wis.math.alg.Vector.YY, Math.sin(amnt)))), com.wis.math.alg.Vector.OO));
}
if ((dim == 1) || (dim == "y")) {
return(new com.wis.math.geom.util.Transformation(com.wis.math.alg.Vector.adder(com.wis.math.alg.Vector.scaler(com.wis.math.alg.Vector.XX, Math.cos(amnt)), com.wis.math.alg.Vector.neg(com.wis.math.alg.Vector.scaler(com.wis.math.alg.Vector.ZZ, Math.sin(amnt)))), com.wis.math.alg.Vector.YY, com.wis.math.alg.Vector.adder(com.wis.math.alg.Vector.scaler(com.wis.math.alg.Vector.ZZ, Math.cos(amnt)), com.wis.math.alg.Vector.scaler(com.wis.math.alg.Vector.XX, Math.sin(amnt))), com.wis.math.alg.Vector.OO));
}
if ((dim == 2) || (dim == "z")) {
return(new com.wis.math.geom.util.Transformation(com.wis.math.alg.Vector.adder(com.wis.math.alg.Vector.scaler(com.wis.math.alg.Vector.XX, Math.cos(amnt)), com.wis.math.alg.Vector.scaler(com.wis.math.alg.Vector.YY, Math.sin(amnt))), com.wis.math.alg.Vector.adder(com.wis.math.alg.Vector.scaler(com.wis.math.alg.Vector.YY, Math.cos(amnt)), com.wis.math.alg.Vector.neg(com.wis.math.alg.Vector.scaler(com.wis.math.alg.Vector.XX, Math.sin(amnt)))), com.wis.math.alg.Vector.ZZ, com.wis.math.alg.Vector.OO));
}
}
function translate(amount) {
return(new com.wis.math.geom.util.Transformation(com.wis.math.alg.Vector.XX, com.wis.math.alg.Vector.YY, com.wis.math.alg.Vector.ZZ, amount));
}
static var $IdentityTrans = new com.wis.math.geom.util.Transformation(com.wis.math.alg.Vector.XX, com.wis.math.alg.Vector.YY, com.wis.math.alg.Vector.ZZ, com.wis.math.alg.Vector.OO);
static var $ACCURACY = 1E-8;
}
Symbol 864 MovieClip [__Packages.com.doodlehead.userdisplay.ConvoInterface] Frame 0
class com.doodlehead.userdisplay.ConvoInterface extends MovieClip
{
var colorOff, colorOn, myspeed, respGap, baseRespY, curResp, aryResp, mcArrow, mcUp, mcDown, curBalloon, mydirection, myIsPlayer, elid, mcResponses, clear, dispatchEvent, getNextHighestDepth, attachMovie, _y, bShow, bHide;
function ConvoInterface () {
super();
mx.events.EventDispatcher.initialize(this);
colorOff = 12303291 /* 0xBBBBBB */;
colorOn = 3355443 /* 0x333333 */;
myspeed = 4;
respGap = 7;
baseRespY = 23;
curResp = 0;
aryResp = new Array();
mcArrow._visible = false;
mcUp._visible = false;
mcDown._visible = false;
curBalloon = 0;
mydirection = 0;
myIsPlayer = false;
elid = null;
}
function hiliteResponse(n) {
if (myIsPlayer) {
mcResponses.hiliteResponse(n);
clear();
var _local3 = 0;
while (_local3 < aryResp.length) {
var _local2 = mcResponses["r" + _local3];
if (_local2.c == undefined) {
_local2.c = new Color(_local2);
}
if (_local3 == n) {
_local2.c.setRGB(colorOn);
} else {
_local2.c.setRGB(colorOff);
}
_local3++;
}
}
}
function balloonDone() {
trace("BALLOON DONE GROWING");
dispatchEvent({type:"doneGrowing", target:this});
}
function setResponses(ar, c, isPlayer) {
if (ar.length > 0) {
mcResponses.shrinkWedge();
myIsPlayer = isPlayer;
var _local7 = getNextHighestDepth();
curBalloon = _local7;
attachMovie(com.doodlehead.userdisplay.ConvoInterfaceBalloon.id, "balloon" + _local7, _local7, {_x:95});
mcResponses = this["balloon" + _local7];
if (elid != null) {
mcResponses.removeEventListener(elid);
}
elid = mcResponses.addEventListener("doneGrowing", mx.utils.Delegate.create(this, balloonDone));
mcResponses.init(mydirection, myIsPlayer);
trace((("DIRETION: " + mydirection) + " IS PLAYER: ") + myIsPlayer);
if (c != undefined) {
mcResponses.setColor(c);
} else {
mcResponses.setColor(14414079);
}
aryResp = ar;
curResp = 0;
mcResponses._y = baseRespY;
var _local6 = 0;
var _local2 = 0;
while (_local2 < aryResp.length) {
if (aryResp[_local2] != undefined) {
mcResponses.attachMovie("l_convoTextResponse", "r" + _local2, _local2 + 20, {_x:25});
var _local3 = mcResponses["r" + _local2];
_local3._visible = false;
_local3.txtResponse.text = aryResp[_local2];
if (_local2 != 0) {
var _local4 = mcResponses["r" + (_local2 - 1)];
_local3._y = (_local4._y + _local4.txtResponse.textHeight) + respGap;
} else {
_local3._y = respGap;
}
_local6 = (_local3._y + _local3.txtResponse.textHeight) + respGap;
}
_local2++;
}
mcResponses.tgtDim = new com.wis.math.alg.Vector(417, _local6);
mcResponses.numbResponses = aryResp.length;
hiliteResponse(curResp);
showHideArrows();
}
}
function get currentResponse() {
return(curResp);
}
function showHideArrows() {
mcUp._visible = ((curResp > 0) ? true : false);
mcDown._visible = ((curResp < (aryResp.length - 1)) ? true : false);
}
function nextResponse() {
if (curResp < (aryResp.length - 1)) {
curResp++;
}
hiliteResponse(curResp);
showHideArrows();
}
function previousResponse() {
if (curResp > 0) {
curResp--;
}
hiliteResponse(curResp);
showHideArrows();
}
function show(d) {
if (d <= 1) {
_y = 153;
} else {
_y = 130;
}
mydirection = d;
bShow = true;
bHide = false;
clearBalloons();
}
function clearBalloons() {
var _local4 = getNextHighestDepth();
var _local2 = 0;
while (_local2 < _local4) {
var _local3 = this["balloon" + _local2];
if (_local3 != undefined) {
_local3.removeMovieClip();
}
_local2++;
}
}
function hide() {
bShow = false;
bHide = true;
mcArrow._visible = false;
clearBalloons();
}
function onEnterFrame() {
var _local6 = getNextHighestDepth();
var _local4 = 0;
var _local3 = curBalloon;
while (_local3 >= 0) {
var _local2 = this["balloon" + _local3];
if (_local2 != undefined) {
var _local5 = this["balloon" + (_local3 + 1)];
if (_local5 != undefined) {
_local4 = _local4 - (_local2.boxHeight + 3);
} else {
_local4 = _local4 - _local2.boxHeight;
}
_local2._y = _local4;
}
_local3--;
}
}
}
Symbol 865 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 866 MovieClip [__Packages.com.doodlehead.userdisplay.ConvoInterfaceBalloon] Frame 0
class com.doodlehead.userdisplay.ConvoInterfaceBalloon extends MovieClip
{
var startDimensions, endDimensions, growFrames, growFramesCtr, myresponseCount, respGap, myAryResp, balloonHeight, mySelectedResponse, attachMovie, getNextHighestDepth, createEmptyMovieClip, convoDirection, myIsPlayer, wedgeMC, __get__responses, myColor, __get__tgtDim, __get__numbResponses, mcHilite, wedgeColor, myBox, dispatchEvent;
function ConvoInterfaceBalloon () {
super();
mx.events.EventDispatcher.initialize(this);
startDimensions = new com.wis.math.alg.Vector(100, 20);
endDimensions = new com.wis.math.alg.Vector(-1, -1);
growFrames = 5;
growFramesCtr = 0;
myresponseCount = 0;
respGap = 7;
myAryResp = new Array();
balloonHeight = 0;
mySelectedResponse = -1;
attachMovie("l_convoBalloonWedge", "wedgeMC", getNextHighestDepth(), {_x:205, _y:0});
attachMovie(com.doodlehead.drawing.BoxRoundedCorners.id, "myBox", getNextHighestDepth());
createEmptyMovieClip("mcHilite", getNextHighestDepth());
}
function init(d, isp) {
convoDirection = d;
myIsPlayer = isp;
if (myIsPlayer) {
if ((d == 0) || (d == 3)) {
wedgeMC._xscale = -100;
}
} else {
switch (d) {
case 0 :
wedgeMC._x = wedgeMC._x + 40;
break;
case 1 :
wedgeMC._x = wedgeMC._x - 40;
break;
case 2 :
wedgeMC._x = wedgeMC._x - 40;
break;
case 3 :
wedgeMC._x = wedgeMC._x + 40;
break;
}
}
}
function set responses(ar) {
myAryResp = ar;
//return(__get__responses());
}
function setColor(c) {
myColor = c;
}
function get boxHeight() {
return(balloonHeight);
}
function set tgtDim(v) {
endDimensions = v;
//return(__get__tgtDim());
}
function set numbResponses(n) {
myresponseCount = n;
//return(__get__numbResponses());
}
function shrinkWedge() {
wedgeMC.gotoAndPlay("shrink");
}
function hiliteResponse(n) {
mySelectedResponse = n;
drawHiliteBox();
}
function drawHiliteBox() {
if (mySelectedResponse != -1) {
var _local4 = mySelectedResponse;
mcHilite.clear();
var _local3 = this["r" + _local4]._x;
var _local6 = _local3 + this["r" + _local4]._width;
var _local2 = this["r" + _local4]._y;
var _local5 = (_local2 + this["r" + _local4].txtResponse.textHeight) + 4;
mcHilite.beginFill(11394815, 100);
mcHilite.moveTo(_local3, _local2);
mcHilite.lineTo(_local6, _local2);
mcHilite.lineTo(_local6, _local5);
mcHilite.lineTo(_local3, _local5);
mcHilite.lineTo(_local3, _local2);
mcHilite.endFill();
}
}
function onEnterFrame() {
if ((growFramesCtr < growFrames) && (endDimensions.x != -1)) {
wedgeColor = new Color(wedgeMC);
wedgeColor.setRGB(myColor);
growFramesCtr++;
var _local7 = (endDimensions.x - startDimensions.x) / growFrames;
var _local6 = (endDimensions.y - startDimensions.y) / growFrames;
myBox.clear();
var _local9 = startDimensions.x + (growFramesCtr * _local7);
var _local3 = startDimensions.y + (growFramesCtr * _local6);
var _local8 = 0;
var _local4 = 0;
var _local5 = 8;
if (_local3 >= (_local5 * 2)) {
wedgeMC._y = _local4 + _local3;
balloonHeight = _local3;
myBox.drawRoundBox(_local8, _local4, _local9, _local3, _local5, myColor, myColor, 1, 100, 100);
}
} else {
balloonHeight = endDimensions.y;
for (var _local2 in this) {
if (_local2.substr(0, 1) == "r") {
this[_local2]._visible = true;
}
}
if (myIsPlayer) {
drawHiliteBox();
dispatchEvent({type:"doneGrowing", target:this});
}
onEnterFrame = null;
}
}
static var id = ((id = "__Packages.com.doodlehead.userdisplay.ConvoInterfaceBalloon")) + (Object.registerClass(id, com.doodlehead.userdisplay.ConvoInterfaceBalloon) ? "" : "");
}
Symbol 867 MovieClip [__Packages.com.doodlehead.drawing.BoxRoundedCorners] Frame 0
class com.doodlehead.drawing.BoxRoundedCorners extends MovieClip
{
var boxMC, createEmptyMovieClip;
function BoxRoundedCorners () {
super();
}
function drawRoundBox(xPos, yPos, boxWidth, boxHeight, cornerRadius, startColor, endColor, depth, boxAlpha, boxAlpha2) {
if (boxMC != undefined) {
boxMC.removeMovieClip();
}
boxMC = createEmptyMovieClip("box" + depth, depth);
boxMC._x = xPos;
boxMC._y = yPos;
var _local7 = [startColor, endColor];
var _local5 = [boxAlpha, boxAlpha2];
var _local8 = [0, 100];
var _local6 = {matrixType:"box", x:xPos, y:yPos, w:boxWidth, h:boxHeight, r:(Math.PI/2)};
boxMC.beginGradientFill("linear", _local7, _local5, _local8, _local6);
boxMC.moveTo(cornerRadius, 0);
boxMC.lineTo(boxWidth - cornerRadius, 0);
boxMC.curveTo(boxWidth, 0, boxWidth, cornerRadius);
boxMC.lineTo(boxWidth, cornerRadius);
boxMC.lineTo(boxWidth, boxHeight - cornerRadius);
boxMC.curveTo(boxWidth, boxHeight, boxWidth - cornerRadius, boxHeight);
boxMC.lineTo(boxWidth - cornerRadius, boxHeight);
boxMC.lineTo(cornerRadius, boxHeight);
boxMC.curveTo(0, boxHeight, 0, boxHeight - cornerRadius);
boxMC.lineTo(0, boxHeight - cornerRadius);
boxMC.lineTo(0, cornerRadius);
boxMC.curveTo(0, 0, cornerRadius, 0);
boxMC.lineTo(cornerRadius, 0);
boxMC.endFill();
}
static var id = ((id = "__Packages.com.doodlehead.drawing.BoxRoundedCorners")) + (Object.registerClass(id, com.doodlehead.drawing.BoxRoundedCorners) ? "" : "");
}
Symbol 868 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 869 MovieClip [__Packages.com.doodlehead.view.ObjectActionable] Frame 0
class com.doodlehead.view.ObjectActionable extends MovieClip
{
var myvars, $disabledFrame, onEnterFrame;
function ObjectActionable () {
super();
myvars = undefined;
$disabledFrame = undefined;
}
function goToFrame(s) {
onEnterFrame = function () {
if (this._currentframe == 1) {
(this.gotoAndPlay(this.$disabledFrame));// not popped
} else {
delete this.onEnterFrame;
}
};
}
function set endvars(ob) {
myvars = ob;
//return(endvars);
}
function get endvars() {
return(myvars);
}
function endAnimation() {
if (myvars != undefined) {
myvars.ob[myvars.func](myvars.ar);
delete eval (endvars);
}
}
}
Symbol 870 MovieClip [__Packages.com.doodlehead.userdisplay.PlayerMap] Frame 0
class com.doodlehead.userdisplay.PlayerMap extends MovieClip
{
var layersAr, createEmptyMovieClip, layerIndicators, colorsAr, _x, myscale, myw, _y, myh, myalph, beginFill, moveTo, lineTo, endFill, _xmouse, _ymouse;
function PlayerMap () {
super();
layersAr = new Array();
layersAr.push(createEmptyMovieClip("layerBase", 1));
layersAr.push(createEmptyMovieClip("layerObs", 2));
layersAr.push(createEmptyMovieClip("layerChars", 3));
layersAr.push(createEmptyMovieClip("layerIndicators", 4));
layersAr.push(createEmptyMovieClip("layerWalls", 5));
layerIndicators.ctr = 0;
layerIndicators.onEnterFrame = function () {
this.ctr++;
if (this.ctr > 4) {
this.ctr = 0;
if (this._visible) {
this._visible = false;
} else {
this._visible = true;
}
}
};
colorsAr = new Array(6710886, 0, 16711680, 65280);
}
function centerAroundPoint(x, y) {
_x = x - ((myw * myscale) / 2);
_y = y - ((myh * myscale) / 2);
}
function init(w, h, ts) {
myscale = 10;
myalph = 100;
myw = w;
myh = h;
myscale = ts;
beginFill(9145227, myalph);
moveTo(-mymargin, -mymargin);
lineTo((myw * myscale) + mymargin, -mymargin);
lineTo((myw * myscale) + mymargin, (myh * myscale) + mymargin);
lineTo(-mymargin, (myh * myscale) + mymargin);
lineTo(-mymargin, -mymargin);
endFill();
}
function clearChars() {
layersAr[2].clear();
}
function clearLayer(n) {
if (layersAr[n] != undefined) {
layersAr[n].clear();
}
}
function drawPlayer(x, y, t) {
var _local2 = new Object();
_local2.DroneCharacter = 16764416 /* 0xFFCE00 */;
_local2.SeekerCharacter = 3407667 /* 0x33FF33 */;
_local2.PlayerCharacter = 65535;
var _local3 = _local2[t];
if (_local3 == undefined) {
_local3 = 16776960 /* 0xFFFF00 */;
}
fillSquare(2, x, y, _local3);
}
function drawWall(n, o, x, y) {
n = 4;
layersAr[n].lineStyle(2, 6645093, 100);
switch (o) {
case 0 :
layersAr[n].moveTo((x * myscale) + myscale, y * myscale);
layersAr[n].lineTo((x * myscale) + myscale, (y * myscale) + myscale);
break;
case 1 :
layersAr[n].moveTo(x * myscale, (y * myscale) + myscale);
layersAr[n].lineTo((x * myscale) + myscale, (y * myscale) + myscale);
break;
case 2 :
layersAr[n].moveTo(x * myscale, y * myscale);
layersAr[n].lineTo(x * myscale, (y * myscale) + myscale);
break;
case 3 :
layersAr[n].moveTo(x * myscale, y * myscale);
layersAr[n].lineTo((x * myscale) + myscale, y * myscale);
break;
}
}
function onPress() {
var _local3 = Math.floor(_xmouse / myscale);
var _local2 = Math.floor(_ymouse / myscale);
trace((_local3 + ", ") + _local2);
}
function drawDoor(x, y, d, c, dl) {
var _local4;
var _local3 = layersAr[4];
if (dl != undefined) {
_local4 = _local3.attachMovie("l_playerMapDoorLabel", "lbl" + _local3.getNextHighestDepth(), _local3.getNextHighestDepth());
_local4.txtLabel.htmlText = dl;
}
var _local6 = x * myscale;
var _local5 = y * myscale;
var _local8 = 0;
var _local7 = 0;
switch (d) {
case 0 :
if (_local4 != undefined) {
_local4._x = _local6 - myscale;
_local4._y = _local5;
}
_local6 = _local6 + myscale;
_local5 = _local5 + (myscale / 2);
_local7 = myscale / 4;
_local8 = myscale / 2;
break;
case 1 :
if (_local4 != undefined) {
_local4._x = _local6;
_local4._y = _local5 - myscale;
}
_local6 = _local6 + (myscale / 2);
_local5 = _local5 + myscale;
_local7 = myscale / 2;
_local8 = myscale / 4;
break;
case 2 :
if (_local4 != undefined) {
_local4._x = _local6 + myscale;
_local4._y = _local5;
}
_local5 = _local5 + (myscale / 2);
_local7 = myscale / 4;
_local8 = myscale / 2;
break;
case 4 :
if (_local4 != undefined) {
_local4._x = _local6;
_local4._y = _local5 + myscale;
}
_local6 = _local6 + (myscale / 2);
_local7 = myscale / 2;
_local8 = myscale / 4;
break;
}
_local6 = Math.round(_local6);
_local5 = Math.round(_local5);
_local7 = Math.round(_local7);
_local8 = Math.round(_local8);
var _local12 = _local6 - _local7;
var _local10 = _local5 - _local8;
var _local11 = _local6 + _local7;
var _local9 = _local5 + _local8;
var _local2 = _local12;
while (_local2 < _local11) {
_local3.lineStyle(1, 0, 100);
_local3.moveTo(_local2, _local10);
_local3.lineTo(_local2, _local9);
_local2++;
}
}
function fillSquare(n, x, y, c) {
if ((x >= 0) && (y >= 0)) {
var _local5 = colorsAr[n];
if (c != undefined) {
_local5 = c;
}
layersAr[n].beginFill(_local5, myalph);
layersAr[n].lineStyle(0, 0, 0);
layersAr[n].moveTo(x * myscale, y * myscale);
layersAr[n].lineTo((x * myscale) + myscale, y * myscale);
layersAr[n].lineTo((x * myscale) + myscale, (y * myscale) + myscale);
layersAr[n].lineTo(x * myscale, (y * myscale) + myscale);
layersAr[n].lineTo(x * myscale, y * myscale);
layersAr[n].endFill();
}
}
static var mymargin = 0;
}
Symbol 871 MovieClip [__Packages.com.doodlehead.drawing.PieChart] Frame 0
class com.doodlehead.drawing.PieChart extends MovieClip
{
var clipsAr, createEmptyMovieClip, slicesAr, myw, myh, myr, myYscale, attachMovie, mcBase, _yscale, __get__slices;
function PieChart () {
super();
clipsAr = new Array();
clipsAr.push(createEmptyMovieClip("pie3d", 2));
clipsAr.push(createEmptyMovieClip("pietop", 3));
slicesAr = new Array({c:[4210752, 6710886], pct:15}, {c:[6710886, 9211020], pct:10}, {c:[9211020, 11711154], pct:60}, {c:[11449524, 16777215], pct:15});
myw = 100;
myh = 100;
myr = myw / 2;
myYscale = 100;
setDimensions(140, 83, 14);
attachMovie(com.doodlehead.drawing.Circle.id, "mcBase", 1, {r:myr, c:16745096});
mcBase._y = myh;
setPct(100);
}
function setDimensions(w, h, d) {
myw = w;
var _local2 = h / w;
myh = Math.round(d / _local2);
myr = w / 2;
_yscale = Math.round(100 * _local2);
}
function set slices(ar) {
slicesAr = ar;
//return(__get__slices());
}
function setSlice(mc, ang) {
var _local4 = new Array({x:1, y:1}, {x:-1, y:1}, {x:-1, y:-1}, {x:1, y:-1});
var _local6 = new Array({x:myr, y:0}, {x:0, y:myr}, {x:-myr, y:0}, {x:0, y:-myr});
ang = ang % 360;
var _local7 = (Math.PI * ang) / 180;
var _local10 = Math.cos(_local7) * myr;
var _local9 = Math.sin(_local7) * myr;
mc.m.clear();
var _local5 = Math.floor(ang / 90);
var _local3 = 0;
while (_local3 < _local5) {
mc.m.beginFill(16711680, 100);
mc.m.moveTo(0, 0);
mc.m.lineTo(_local4[_local3].x * myr, 0);
mc.m.lineTo(_local4[_local3].x * myr, _local4[_local3].y * myr);
mc.m.lineTo(0, _local4[_local3].y * myr);
mc.m.lineTo(0, 0);
mc.m.endFill();
_local3++;
}
mc.m.beginFill(16711935, 100);
mc.m.moveTo(0, 0);
mc.m.lineTo(_local6[_local5].x, _local6[_local5].y);
mc.m.lineTo(myr * _local4[_local5].x, myr * _local4[_local5].y);
mc.m.lineTo(_local10, _local9);
mc.m.lineTo(0, 0);
mc.m.endFill();
mc._mc.setMask(mc.m);
}
function setPct(bl) {
var _local3 = 0;
while (_local3 < clipsAr.length) {
clipsAr[_local3]._x = (clipsAr[_local3]._y = 0);
_local3++;
}
var _local6 = bl * 3.6;
_local3 = 0;
var _local2 = myh;
while (_local2 > 0) {
var _local7 = 0;
var _local4 = 0;
while (_local4 < slicesAr.length) {
clipsAr[_local3].createEmptyMovieClip((("p" + _local2) + "_") + _local4, (_local2 * (slicesAr.length - _local2)) + _local4);
clipsAr[_local3][(("p" + _local2) + "_") + _local4].attachMovie(com.doodlehead.drawing.Circle.id, "_mc", 1, {r:myr, c:slicesAr[_local4].c[_local3]});
clipsAr[_local3][(("p" + _local2) + "_") + _local4].createEmptyMovieClip("m", 2);
clipsAr[_local3][(("p" + _local2) + "_") + _local4]._rotation = _local7;
var _local5 = (_local6 * slicesAr[_local4].pct) / 100;
_local7 = _local7 + _local5;
setSlice(clipsAr[_local3][(("p" + _local2) + "_") + _local4], _local5 + 2);
clipsAr[_local3][(("p" + _local2) + "_") + _local4]._y = _local2;
_local4++;
}
_local2--;
}
_local3 = 1;
var _local7 = 0;
var _local4 = 0;
while (_local4 < slicesAr.length) {
clipsAr[_local3].createEmptyMovieClip("p" + _local4, _local4);
clipsAr[_local3]["p" + _local4].attachMovie(com.doodlehead.drawing.Circle.id, "_mc", 1, {r:myr, c:slicesAr[_local4].c[_local3]});
clipsAr[_local3]["p" + _local4].createEmptyMovieClip("m", 2);
clipsAr[_local3]["p" + _local4]._rotation = _local7;
var _local5 = (_local6 * slicesAr[_local4].pct) / 100;
_local7 = _local7 + _local5;
setSlice(clipsAr[_local3]["p" + _local4], _local5 + 2);
_local4++;
}
}
}
Symbol 872 MovieClip [__Packages.com.doodlehead.drawing.Circle] Frame 0
class com.doodlehead.drawing.Circle extends MovieClip
{
var r, beginFill, c, moveTo, curveTo, endFill;
function Circle () {
super();
init();
}
function init() {
var _local3 = r * 0.414213562373095;
var _local2 = r * Math.SQRT1_2;
beginFill(c, 100);
moveTo(r, 0);
curveTo(r, _local3, _local2, _local2);
curveTo(_local3, r, 0, r);
curveTo(-_local3, r, -_local2, _local2);
curveTo(-r, _local3, -r, 0);
curveTo(-r, -_local3, -_local2, -_local2);
curveTo(-_local3, -r, 0, -r);
curveTo(_local3, -r, _local2, -_local2);
curveTo(r, -_local3, r, 0);
endFill();
}
static var id = ((id = "__Packages.com.doodlehead.drawing.Circle")) + (Object.registerClass(id, com.doodlehead.drawing.Circle) ? "" : "");
}
Symbol 873 MovieClip [__Packages.com.doodlehead.userdisplay.MapAndHealth] Frame 0
class com.doodlehead.userdisplay.MapAndHealth extends MovieClip
{
function MapAndHealth () {
super();
}
function setDoorLabel(n, s) {
this["txtDoor" + n].htmlText = s;
}
}
Symbol 874 MovieClip [__Packages.com.doodlehead.userdisplay.UserInterface] Frame 0
class com.doodlehead.userdisplay.UserInterface extends MovieClip
{
var dialogYDiff, hscale, tscale, tweenAr, _mcDialog, curOption, myhealth, mapShow, mapShowY, mapHideY, mcMapAndHealth, mcDarkener, mapTween, _mcTimebar, _mcTimebarEnd, _mcGreenBar, __get__timeLeft, _mcConvo;
function UserInterface () {
super();
dialogYDiff = Math.abs(dialogShowY - dialogHideY);
hscale = (tscale = 238);
health = (100);
timeLeft = (100);
tweenAr = new Array();
_mcDialog._alpha = 0;
curOption = 0;
myhealth = 100;
mapShow = false;
mapShowY = 24;
mapHideY = -350;
}
function set health(n) {
myhealth = Math.round(n);
mcMapAndHealth._mcLoadbar.setPct(myhealth);
n = 100 - myhealth;
mcMapAndHealth.txtHealthPercent.htmlText = ("-" + n) + "%";
//return(health);
}
function get health() {
return(myhealth);
}
function onEnterFrame() {
var _local2 = Math.round(60 * (1 - ((mapShowY - mcMapAndHealth._y) / (mapShowY - mapHideY))));
mcDarkener._alpha = _local2;
}
function set show(b) {
if (mapShow != b) {
mapShow = b;
if (mapShow) {
var _local2 = (1.5 * (mapShowY - mcMapAndHealth._y)) / (mapShowY - mapHideY);
if (_local2 != 0) {
mapTween.stop();
mapTween = new mx.transitions.Tween(mcMapAndHealth, "_y", mx.transitions.easing.Regular.easeOut, mcMapAndHealth._y, mapShowY, _local2, true);
mapTween.ob = this;
mapTween.onMotionFinished = function () {
this.ob.showMapItems();
};
}
} else {
var _local2 = 1.5 - ((1.5 * (mapShowY - mcMapAndHealth._y)) / (mapShowY - mapHideY));
if (_local2 != 0) {
mapTween.stop();
mapTween = new mx.transitions.Tween(mcMapAndHealth, "_y", mx.transitions.easing.Regular.easeOut, mcMapAndHealth._y, mapHideY, _local2, true);
mapTween.ob = this;
mapTween.onMotionFinished = function () {
this.ob.hideMapItems();
};
}
}
}
//return(show);
}
function showMapItems() {
}
function hideMapItems() {
}
function get show() {
return(mapShow);
}
function set option(n) {
if ((n >= 0) && (n <= 3)) {
_mcDialog._mcOption._x = 91 + (n * _mcDialog._mcOption._width);
curOption = n;
}
//return(option);
}
function get option() {
return(curOption);
}
function set timeLeft(n) {
_mcTimebar._width = Math.floor((n / 100) * tscale);
_mcTimebarEnd._x = _mcTimebar._x - _mcTimebar._width;
_mcGreenBar._x = _mcTimebar._x - _mcTimebar._width;
//return(__get__timeLeft());
}
function clearTweens() {
var _local2 = 0;
while (_local2 < tweenAr.length) {
tweenAr[_local2].stop();
_local2++;
}
tweenAr = new Array();
}
function showDialog() {
_mcConvo._alpha = 100;
var _local3 = Math.abs(_mcDialog._alpha - dialogShowY);
if (_mcDialog._alpha != dialogShowY) {
clearTweens();
var _local2 = Math.abs((basetime * _local3) / dialogYDiff);
if (_local2 < 0.1) {
_local2 = 0.1;
}
new mx.transitions.Tween(_mcDialog, "_alpha", mx.transitions.easing.Strong.easeOut, _mcDialog._alpha, dialogShowY, _local2, true);
}
}
function hideDialog() {
_mcConvo._alpha = 0;
var _local4 = Math.abs(_mcDialog._alpha - dialogHideY);
if (_mcDialog._alpha != dialogHideY) {
clearTweens();
var _local2 = Math.abs((basetime * _local4) / dialogYDiff);
if (_local2 < 0.5) {
_local2 = 0.5;
}
var _local3 = new mx.transitions.Tween(_mcDialog, "_alpha", mx.transitions.easing.Strong.easeOut, _mcDialog._alpha, dialogHideY, _local2, true);
_local3.myspace = this;
_local3.onMotionFinished = function () {
this.hideDialogBox();
};
}
}
function hideDialogBox() {
_mcConvo._alpha = 0;
}
var dialogShowY = 100;
var dialogHideY = 0;
var basetime = 0.3;
}
Symbol 875 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 876 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 877 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 878 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 879 MovieClip [__Packages.mx.transitions.easing.Strong] Frame 0
class mx.transitions.easing.Strong
{
function Strong () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static var version = "1.1.0.52";
}
Symbol 880 MovieClip [__Packages.com.doodlehead.actors.CharacterSprite] Frame 0
class com.doodlehead.actors.CharacterSprite extends MovieClip
{
var isFriday, decalsOb, mystate, overlayAr, isSick, myctrlr, sprite, dispatchEvent, myname, __get__charName, myMask, createEmptyMovieClip, getNextHighestDepth;
function CharacterSprite () {
super();
var _local3 = new Date();
isFriday = ((_local3.getDay() == FRIDAY) ? true : false);
init();
}
function init() {
mx.events.EventDispatcher.initialize(this);
decalsOb = new Object();
decalsOb.clipChest = new Array();
decalsOb.clipHead = new Array();
decalsOb.clipHeadMasked = new Array();
decalsOb.clipLeftArmUpper = new Array();
decalsOb.clipChestMasked = new Array();
mystate = "";
overlayAr = new Array();
overlayAr.ovrBurn0 = false;
overlayAr.ovrBloodHead0 = false;
overlayAr.torsoburn = false;
isSick = false;
}
function setShirtColor(s, n) {
this["shirtColor" + s] = n;
}
function checkbored() {
var _local1 = Math.floor(Math.random() * 1000);
if (_local1 < 5) {
return(true);
}
return(false);
}
function set ctrlr(ob) {
myctrlr = ob;
//return(ctrlr);
}
function set burn(b) {
overlayAr.ovrBurn0 = b;
//return(burn);
}
function get burn() {
return(overlayAr.ovrBurn0);
}
function set torsoburn(b) {
overlayAr.torsoburn = b;
//return(torsoburn);
}
function get torsoburn() {
return(overlayAr.torsoburn);
}
function set sick(b) {
isSick = b;
//return(sick);
}
function get sick() {
return(isSick);
}
function setState(s) {
if (mystate != s) {
mystate = s;
sprite.gotoAndPlay(s);
frameAction();
}
}
function get state() {
return(mystate);
}
function getState() {
return(mystate);
}
function get ctrlr() {
return(myctrlr);
}
function notifyActionDone() {
dispatchEvent({type:"actiondone", target:this, ctrlr:ctrlr, state:ctrlr.state});
}
function getDecals() {
return(decalsOb);
}
function setDecals(ob, s) {
decalsOb[s] = ob;
}
function addDecal(bodyPart, decalname, v) {
decalsOb[bodyPart].push({name:decalname, position:v});
}
function set charName(s) {
sprite.txtName.text = s;
sprite.txtName.htmlText = s;
myname = s;
//return(__get__charName());
}
function updateClothesColors(tgt) {
if (tgt == undefined) {
tgt = sprite.sprite;
}
var _local3 = new Array("mcShirtLight", "mcShirtDark", "mcPantsLight", "mcPantsDark", "mcHairLight", "mcHairDark", "mcTie");
var _local2 = 0;
while (_local2 < _local3.length) {
if (tgt[_local3[_local2]].c == undefined) {
tgt[_local3[_local2]].c = new Color(tgt[_local3[_local2]]);
if (ctrlr.aColor[_local2] != undefined) {
tgt[_local3[_local2]].c.setRGB(ctrlr.aColor[_local2]);
}
}
tgt[_local3[_local2]]._alpha = 100;
tgt[_local3[_local2]]._visible = true;
_local2++;
}
}
function makeMyMask(offV) {
if (myMask == undefined) {
createEmptyMovieClip("myMask", getNextHighestDepth());
myMask.beginFill(0, 100);
myMask.moveTo(-164, 22);
myMask.lineTo(163, -164);
myMask.lineTo(54, -300);
myMask.lineTo(-55, -300);
myMask.moveTo(-164, 22);
myMask.endFill();
sprite.setMask(myMask);
}
myMask._x = -offV.x;
myMask._y = -offV.y;
}
function setNoMask() {
if (myMask != undefined) {
sprite.setMask(null);
myMask.removeMovieClip();
}
}
function frameAction() {
if (myctrlr.pinata) {
sprite.sprite.pinataFront._alpha = 100;
sprite.sprite.pinataRear._alpha = 100;
}
if (sprite.txtName != undefined) {
sprite.txtName.htmlText = ctrlr.name;
}
if (isSick) {
if (sprite.sprite.clipHeadMasked.mcSick == undefined) {
sprite.sprite.clipHeadMasked.attachMovie("l_sickFace", "mcSick", sprite.sprite.clipHeadMasked.getNextHighestDepth());
}
}
for (var _local6 in overlayAr) {
if (overlayAr[_local6]) {
sprite.sprite.mcOverlay[_local6]._alpha = 100;
} else {
sprite.sprite.mcOverlay[_local6]._alpha = 0;
}
}
for (var _local6 in decalsOb) {
var _local4 = decalsOb[_local6];
var _local3 = sprite.sprite[_local6];
if (_local6 == "clipHeadMasked") {
_local3.blendMode = "multiply";
}
if ((sprite.sprite[_local6] != undefined) && (_local4.length > 0)) {
var _local2 = 0;
while (_local2 < _local4.length) {
if (_local3["sc" + _local2] == undefined) {
var _local5 = _local3.getNextHighestDepth();
_local3.attachMovie(_local4[_local2].name, "sc" + _local2, _local2);
_local3["sc" + _local2]._x = _local4[_local2].position.x;
_local3["sc" + _local2]._y = _local4[_local2].position.y;
}
_local2++;
}
}
}
updateClothesColors();
}
static var FRIDAY = 5;
}
Symbol 881 MovieClip [__Packages.com.doodlehead.view.FMTKYLoadIndicator] Frame 0
class com.doodlehead.view.FMTKYLoadIndicator extends MovieClip
{
var bReachedBeginFrame, loadFrames, gotoAndPlay, gotoAndStop, _currentframe, _parent, stop, _totalframes;
function FMTKYLoadIndicator () {
super();
bReachedBeginFrame = false;
loadFrames = lEndFrame - lBeginFrame;
}
function setPercent(n) {
trace("SET PERCENT " + n);
if (bReachedBeginFrame) {
if (n == 1) {
gotoAndPlay(lEndFrame);
} else {
var _local2 = Math.round(lBeginFrame + (n * loadFrames));
trace("GO TO FRAME " + _local2);
gotoAndStop(_local2);
}
}
}
function onEnterFrame() {
if (!bReachedBeginFrame) {
if (_currentframe >= lBeginFrame) {
bReachedBeginFrame = true;
_parent.gotoAndPlay("preload");
(stop());// not popped
}
} else if (_currentframe == _totalframes) {
_parent.gotoAndPlay("landing");
(stop());// not popped
}
}
var lBeginFrame = 55;
var lEndFrame = 96;
}
Symbol 882 MovieClip [__Packages.com.doodlehead.sound.RadioStation] Frame 0
class com.doodlehead.sound.RadioStation extends MovieClip
{
var isStopped, $mute, myplaylist, mysoundmcs, curSong, fadeOut, fadeInc, nextSong, createEmptyMovieClip, getNextHighestDepth;
function RadioStation () {
super();
init();
isStopped = true;
$mute = false;
}
function init() {
myplaylist = new Array();
mysoundmcs = new Array();
curSong = 0;
fadeOut = false;
fadeInc = 0;
nextSong = 0;
}
function get mute() {
return($mute);
}
function set mute(b) {
$mute = b;
//return(mute);
}
function clearPlaylist() {
stopClip();
init();
}
function setPlaylist(ar) {
var _local2 = 0;
while (_local2 < ar.length) {
var _local5 = createEmptyMovieClip("mcs" + _local2, getNextHighestDepth());
var _local3 = new Sound(_local5);
mysoundmcs.push(_local3);
myplaylist.push(new com.doodlehead.sound.SoundClip(_local3, ar[_local2].soundfile, ar[_local2].loops, ar[_local2].markers));
_local2++;
}
}
function setPromos(ar) {
}
function playClip(n) {
if (myplaylist[n] != undefined) {
curSong = n;
myplaylist[n].soundOb.loadSound(myplaylist[n].soundfile, true);
myplaylist[n].soundOb.parent = this;
myplaylist[n].soundOb.onLoad = function () {
};
myplaylist[n].soundOb.onSoundComplete = function () {
this.parent.curSongComplete();
};
clearFades();
} else {
trace("THAT SONG IS NOT DEFINED");
}
}
function curSongComplete() {
curSong++;
nextSong = curSong + 1;
curSong = curSong % myplaylist.length;
nextSong = nextSong % myplaylist.length;
playClip(curSong);
}
function clearFades() {
fadeOut = false;
fadeInc = 0;
}
function startCrossfade() {
fadeOut = true;
fadeInc = 0.952380952380952;
}
function startClip() {
myplaylist[curSong].soundOb.start(0, myplaylist[curSong].loops);
isStopped = false;
}
function stopClip() {
myplaylist[curSong].soundOb.stop();
myplaylist[curSong].soundOb.onLoad = null;
isStopped = true;
}
function onEnterFrame() {
if (!isStopped) {
var _local2 = myplaylist[curSong];
if (_local2 != undefined) {
if (_local2.__get__soundOb().getBytesLoaded() == _local2.__get__soundOb().getBytesTotal()) {
var _local4 = _local2.checkForEvent();
switch (_local4) {
case "start crossfade" :
startCrossfade();
break;
default :
}
}
}
if (fadeOut) {
var _local3 = Math.floor(_local2.__get__soundOb().getVolume() - fadeInc);
if (_local3 < 0) {
_local3 = 0;
clearFades();
}
if (_local3 > 100) {
_local3 = 100;
}
_local2.__get__soundOb().setVolume(_local3);
}
}
}
static var id = ((id = "__Packages.com.doodlehead.sound.RadioStation")) + (Object.registerClass(id, com.doodlehead.sound.RadioStation) ? "" : "");
}
Symbol 883 MovieClip [__Packages.com.doodlehead.sound.SoundClip] Frame 0
class com.doodlehead.sound.SoundClip
{
var mysound, swfloc, myloops, mymarkers, myob;
function SoundClip (snd, s, n, m) {
mysound = snd;
swfloc = s;
myloops = n;
mymarkers = m;
myob = new Object();
mymarkers.sort(orderMarkers);
}
function get ob() {
return(myob);
}
function set ob(o) {
myob = o;
//return(ob);
}
function get soundfile() {
return(swfloc);
}
function set soundfile(s) {
swfloc = s;
//return(soundfile);
}
function get soundOb() {
return(mysound);
}
function set soundOb(s) {
mysound = s;
//return(soundOb);
}
function get loops() {
return(myloops);
}
function set loops(n) {
myloops = n;
//return(loops);
}
function checkForEvent(t) {
if (mymarkers[0] == undefined) {
return("");
}
if (mymarkers[0].getTimeLeft(mysound.position, mysound.duration, myloops) <= 0) {
var _local2 = mymarkers[0].eventName;
mymarkers.splice(0, 1);
return(_local2);
}
return("");
}
function orderMarkers(a, b) {
var _local2 = a.__get__time();
var _local1 = b.__get__time();
if (_local2 < _local1) {
return(-1);
}
if (_local2 > _local1) {
return(1);
}
return(0);
}
}
Symbol 884 MovieClip [__Packages.com.doodlehead.sound.SoundMarker] Frame 0
class com.doodlehead.sound.SoundMarker
{
var mytime, myevent, curloop, lastposition;
function SoundMarker (t, e) {
mytime = t * 1000;
myevent = e;
curloop = 0;
lastposition = -1;
}
function get time() {
return(mytime);
}
function getTimeLeft(t, d, l) {
if (t < lastposition) {
curloop++;
}
lastposition = t;
var _local2 = t + (curloop * d);
if (((_local2 != undefined) && (d != undefined)) && (d != 0)) {
if (mytime < 0) {
var _local5 = (d * l) + mytime;
return(_local5 - _local2);
}
return(mytime - _local2);
}
return(null);
}
function get eventName() {
return(myevent);
}
}
Symbol 885 MovieClip [__Packages.com.doodlehead.xml.XMLLoader] Frame 0
class com.doodlehead.xml.XMLLoader
{
var xmlFile, retob, xHolder, xparser, dispatchEvent;
function XMLLoader (s) {
mx.events.EventDispatcher.initialize(this);
xmlFile = s;
retob = new Object();
trace("FILE TO LOAD " + xmlFile);
}
function doLoad() {
xHolder = new XML();
xHolder.ignoreWhite = true;
xHolder.hostInstance = this;
xHolder.onLoad = function (success) {
this.hostInstance.parseAndReturn(success);
};
xHolder.load(xmlFile);
}
function parseAndReturn(success) {
if (success) {
xparser = new com.doodlehead.xml.XMLParser();
dispatchEvent({type:"xmlLoadedAndParsed", target:this, goodload:true, ar:xparser.makeObject(xHolder)});
} else {
dispatchEvent({type:"xmlLoadedAndParsed", target:this, goodload:false, ar:null});
}
}
}
Symbol 886 MovieClip [__Packages.com.doodlehead.xml.XMLParser] Frame 0
class com.doodlehead.xml.XMLParser
{
var dataXML;
function XMLParser () {
dataXML = new Object();
}
function makeObject(theXML) {
dataXML = new Object();
dataXML[theXML.firstChild.nodeName] = new Object();
xmlPop(theXML.firstChild, dataXML[theXML.firstChild.nodeName]);
return(dataXML);
}
function xmlPop(xob, dob) {
var _local8 = xob.attributes;
var _local10 = xob.firstChild.nodeValue;
for (var _local9 in _local8) {
dob[_local9] = _local8[_local9];
}
if (_local10 != undefined) {
dob.nodeval = _local10;
}
var _local2 = xob.childNodes;
var _local7 = new Object();
var _local5 = 0;
while (_local5 < _local2.length) {
if (_local2[_local5].nodeName != null) {
if (_local7[_local2[_local5].nodeName] == undefined) {
_local7[_local2[_local5].nodeName] = 0;
} else {
_local7[_local2[_local5].nodeName]++;
}
}
_local5++;
}
for (var _local9 in _local7) {
if (_local7[_local9] > 0) {
dob[_local9] = new Array();
var _local6 = 0;
var _local3 = 0;
while (_local3 < _local2.length) {
if (_local2[_local3].nodeName == _local9) {
dob[_local9].push(new Object());
xmlPop(_local2[_local3], dob[_local9][_local6]);
_local6++;
}
_local3++;
}
} else {
dob[_local9] = new Object();
var _local3 = 0;
while (_local3 < _local2.length) {
if (_local2[_local3].nodeName == _local9) {
xmlPop(_local2[_local3], dob[_local9]);
}
_local3++;
}
}
}
}
}
Symbol 887 MovieClip [__Packages.com.doodlehead.userdisplay.AudioOnOff] Frame 0
class com.doodlehead.userdisplay.AudioOnOff extends MovieClip
{
var $isOn, gotoAndStop, dispatchEvent;
function AudioOnOff () {
super();
mx.events.EventDispatcher.initialize(this);
$isOn = true;
}
function onRelease() {
isOn = ((isOn ? false : true));
}
function get isOn() {
return($isOn);
}
function set isOn(b) {
if (b != $isOn) {
$isOn = b;
if (isOn) {
(gotoAndStop(1));// not popped
} else {
(gotoAndStop(2));// not popped
}
dispatchEvent({type:"statechange", target:this, value:$isOn});
}
//return(isOn);
}
}
Symbol 888 MovieClip [__Packages.com.doodlehead.tilegame.FMTKY] Frame 0
class com.doodlehead.tilegame.FMTKY extends MovieClip
{
var $configob, _parent, $fallFromSky, $characterColors, mcGameScreen, _btnOnOff;
function FMTKY () {
super();
$configob = _parent.configob;
$fallFromSky = _parent.fallFromSky;
$characterColors = _parent.characterColors;
trace("PARNET COLORS " + _parent.characterColors);
}
function get configob() {
return($configob);
}
function set configob(ob) {
$configob = ob;
//return(configob);
}
function initGamePlay() {
mcGameScreen.init($configob, $fallFromSky, $characterColors);
}
function toggleSound(eventObj) {
if (eventObj.value == true) {
mcGameScreen.radioStationMgr.playClip(0);
} else {
mcGameScreen.radioStationMgr.stopClip();
}
}
function initSoundButton() {
_btnOnOff.addEventListener("statechange", mx.utils.Delegate.create(this, toggleSound));
}
}
Symbol 889 MovieClip [__Packages.com.doodlehead.maincontroller.MainController] Frame 0
class com.doodlehead.maincontroller.MainController extends MovieClip
{
var stop, gameState, winTime, $fallFromSky, $characterColors, retval, oemManager, convoSound, gameMap, endConvoFlag, convoListenerID, isReadyForResponse, convoEndAction, levelDataAr, balloonDoneGrowing, currentActionObject, sfxWin, rise, run, gameTime, ordinal_ar, dgap, configob, curlevel, leveldata, charLastPositionOb, defaultLevelColor, charSpriteHolder, charLastOb, charLastPos, colorTweenArray, floorObArray, actionEndDamage, divLvl, inputmgr, stateAr, objectDefs, objectDynDefs, ary_four, startTime, endTime, mapShowID, responseKeyID, radioStationMgr, gameBoard, gameBoardOverlay, gameElements, hasBeenElectrocuted, pchar, onEnterFrame, gamew, gameh, convoAr, doorsAr, curConvo, convoDel, ary_aic, elevatorArray, charAr, amgr, dynamicControllers, dynamicObsMap, actionName, theMask, theBoardMask, theBoardOverlayMask, gameHUDMask, mcClock, attachMovie, getNextHighestDepth, levelStartTime, gameHUD, createEmptyMovieClip, sfxEngine, hudmap, _parent, actionDesc, mgrActionSequence, actionEndFunc, mcEndSeq, xparser, mycon, balloonListenerID, charSprite0;
function MainController () {
super();
(stop());// not popped
}
function init(cob, fallFromSky, characterColors) {
gameState = "play";
winTime = 0;
$fallFromSky = fallFromSky;
$characterColors = characterColors;
retval = new Object();
oemManager = new com.doodlehead.utils.OnEnterFrameMgr(this);
convoSound = new Sound(this);
gameMap = new Array();
endConvoFlag = false;
convoListenerID = 0;
isReadyForResponse = false;
convoEndAction = "";
levelDataAr = new Array();
balloonDoneGrowing = false;
currentActionObject = undefined;
sfxWin = new Sound(this);
sfxWin.attachSound("l_sfxAscend");
rise = 23;
run = 40;
gameTime = 300000 /* 0x0493E0 */;
ordinal_ar = ["east", "south", "west", "north"];
dgap = 10;
configob = cob;
dtrace(configob.startlevel.nodeval);
curlevel = configob.startlevel.nodeval;
leveldata = new Object();
charLastPositionOb = new Object();
defaultLevelColor = 15663075 /* 0xEEFFE3 */;
charSpriteHolder = {decals:{}, sick:false, burn:false, health:100};
charLastOb = new Object();
charLastPos = new com.wis.math.alg.Vector(0, 0);
colorTweenArray = new Array();
floorObArray = new Array();
actionEndDamage = 0;
var _local9;
var _local11;
var _local12;
divLvl = new Array(dgap - 1, dgap - 2, dgap + 1, dgap + 2);
inputmgr = new com.doodlehead.input.InputTranslator();
convoSound = new Sound();
stateAr = new Array(1, 0);
objectDefs = new Object();
objectDynDefs = new Object();
ary_four = new Array(new com.wis.math.alg.Vector(1, 0), new com.wis.math.alg.Vector(0, 1), new com.wis.math.alg.Vector(-1, 0), new com.wis.math.alg.Vector(0, -1));
mx.events.EventDispatcher.initialize(this);
initLevelData();
levelInit();
objectifyObjects();
setUpBoard();
startTime = getTimer();
endTime = startTime + gameTime;
mapShowID = inputmgr.addEventListener("keyHit", mx.utils.Delegate.create(this, hideShowMap));
responseKeyID = inputmgr.addEventListener("keyHit", mx.utils.Delegate.create(this, doNextResponse));
radioStationMgr = _root.radioStationMgr;
gameBoard._visible = false;
gameBoardOverlay._visible = false;
gameElements._visible = false;
oemManager.setTimeout(this, "revealNextLevel", 1.5, [this], 1);
hasBeenElectrocuted = false;
}
function clearOutAll() {
inputmgr.removeEventListener(mapShowID);
inputmgr.removeEventListener(responseKeyID);
delete inputmgr;
pchar.__set__visible(true);
pchar.__set__interactFlag(false);
}
function initLevelData() {
var _local2 = 0;
while (_local2 < configob.levels.level.length) {
levelDataAr[configob.levels.level[_local2].id] = new com.doodlehead.tilegame.FMTKYLevel(configob.levels.level[_local2].id, []);
_local2++;
}
var _local3 = new Array();
_local3.hasWeaseled = false;
_local3.hasSharked = false;
levelDataAr.execrecep = new com.doodlehead.tilegame.FMTKYLevel("execrecep", _local3);
_local3 = new Array();
_local3.isFlooded = false;
levelDataAr.mensroom = new com.doodlehead.tilegame.FMTKYLevel("mensroom", _local3);
_local3 = new Array();
_local3.hasHandOfGod = false;
levelDataAr.mid = new com.doodlehead.tilegame.FMTKYLevel("mid", _local3);
_local3 = new Array();
_local3.isUmbrellaReady = false;
_local3.hasUmbrellad = false;
levelDataAr.mailroom = new com.doodlehead.tilegame.FMTKYLevel("mailroom", _local3);
}
function levelInit() {
endConversation();
if (oemManager != undefined) {
delete oemManager;
}
oemManager = new com.doodlehead.utils.OnEnterFrameMgr(this);
onEnterFrame = function () {
this.oemManager.execute();
};
gamew = 0;
gameh = 0;
convoAr = new Array();
doorsAr = new Array();
curConvo = new Object();
convoDel = new Object();
ary_aic = new Array();
elevatorArray = new Array();
gameMap = new Array();
charAr = new Array();
amgr = new com.doodlehead.pathfinding.AStarManager(10, gameMap);
dynamicControllers = new Array();
dynamicObsMap = levelDataAr[curlevel].dynamicObsMap;
floorObArray = levelDataAr[curlevel].floorObArray;
ary_aic = new Array();
actionName = "";
}
function loadNextLevel() {
delete oemManager;
levelInit();
setUpBoard();
gameElements._visible = false;
gameBoard._visible = false;
gameBoardOverlay._visible = false;
oemManager.setTimeout(this, "revealNextLevel", 1, [this], 1);
}
function revealNextLevel() {
theMask.removeMovieClip();
theBoardMask.removeMovieClip();
theBoardOverlayMask.removeMovieClip();
gameHUDMask.removeMovieClip();
gameElements._visible = true;
gameBoard._visible = true;
gameBoardOverlay._visible = true;
mcClock._visible = true;
attachMovie("l_transitionMaskIn", "theMask", getNextHighestDepth());
theMask.loadNextLevel = function () {
this._parent.loadNextLevel();
};
gameElements.setMask(theMask);
attachMovie("l_transitionMaskIn", "theBoardMask", getNextHighestDepth());
gameBoard.setMask(theBoardMask);
attachMovie("l_transitionMaskIn", "theBoardOverlayMask", getNextHighestDepth());
gameBoardOverlay.setMask(theBoardOverlayMask);
attachMovie("l_transitionMaskIn", "gameHUDMask", getNextHighestDepth());
mcClock.setMask(gameHUDMask);
levelStartTime = getTimer();
if ($fallFromSky) {
oemManager.register(this, "fallFromSkyPt1");
}
}
function gotoLevel(ar) {
var _local3 = ar[0];
if (_local3.indexOf("|") != -1) {
var _local5 = _local3.split("|");
var _local6 = Math.floor(Math.random() * _local5.length);
_local3 = _local5[_local6];
if (elevatorArray.length > 0) {
if (elevatorArray[0].clip.sprite._mcUpDownArrows.state == "up") {
_local3 = _local5[1];
} else {
_local3 = _local5[0];
}
oemManager.deleteOEF(this, "toggleElevator");
}
}
if (charLastPositionOb[curlevel] == undefined) {
charLastPositionOb[curlevel] = new Object();
}
charLastPositionOb[curlevel].tile = pchar.tile;
charLastPositionOb[curlevel].direction = (pchar.__get__direction() + 2) % 4;
storePlayerDecals();
storeFloorObState();
charSpriteHolder.health = pchar.health;
var _local4 = false;
var _local2 = 0;
while (_local2 < configob.levels.level.length) {
if (configob.levels.level[_local2].id == _local3) {
_local4 = true;
}
_local2++;
}
if (_local4) {
curlevel = _local3;
attachMovie("l_transitionMask", "theMask", getNextHighestDepth());
theMask.loadNextLevel = function () {
this._parent.loadNextLevel();
};
gameElements.setMask(theMask);
attachMovie("l_transitionMask", "theBoardMask", getNextHighestDepth());
gameBoard.setMask(theBoardMask);
attachMovie("l_transitionMask", "theBoardOverlayMask", getNextHighestDepth());
gameBoardOverlay.setMask(theBoardOverlayMask);
attachMovie("l_transitionMask", "gameHUDMask", getNextHighestDepth());
mcClock.setMask(gameHUDMask);
} else {
trace("THE LEVEL WAS NOT FOUND");
}
}
function translatePosition(x, y) {
var _local3 = (x * run) - (y * run);
var _local2 = (x * rise) + (y * rise);
return({_x:_local3, _y:_local2});
}
function translatePipedCoordsToArray(s) {
var _local3 = s.split("|");
var _local4 = new Array();
var _local1 = 0;
while (_local1 < _local3.length) {
var _local2 = _local3[_local1].split(",");
_local4.push(new com.wis.math.alg.Vector(parseInt(_local2[0]), parseInt(_local2[1])));
_local1++;
}
return(_local4);
}
function unknownToArray(ob) {
if (ob.length == undefined) {
return(new Array(ob));
}
var _local3 = new Array();
var _local1 = 0;
while (_local1 < ob.length) {
_local3.push(ob[_local1]);
_local1++;
}
return(_local3);
}
function checkValidMove(v, ob) {
var _local4 = 0;
if (v.x == ob.tile.x) {
if (v.y < ob.tile.y) {
_local4 = 3;
}
if (v.y > ob.tile.y) {
_local4 = 1;
}
}
if (v.y == ob.tile.y) {
if (v.x < ob.tile.x) {
_local4 = 2;
}
if (v.x > ob.tile.x) {
_local4 = 0;
}
}
if (!((v.x == ob.tile.x) && (v.y == ob.tile.y))) {
if (gameMap[v.y][v.x].isEmpty) {
if ((!gameMap[v.y][v.x].walls[(_local4 + 2) % 4]) && (gameMap[v.y][v.x] != undefined)) {
if (!gameMap[ob.tile.y][ob.tile.x].walls[_local4]) {
return(true);
}
}
}
}
return(false);
}
function checkNotWall(v, ob) {
if (!((v.x == ob.tile.x) && (v.y == ob.tile.y))) {
if ((!gameMap[v.y][v.x].walls[(ob.direction + 2) % 4]) && (gameMap[v.y][v.x] != undefined)) {
if (!gameMap[ob.tile.y][ob.tile.x].walls[ob.direction]) {
return(true);
}
}
}
return(false);
}
function checkDivider(v, d, pdir, ppos) {
var _local2;
if (d == 2) {
_local2 = new com.wis.math.alg.Vector(v.x + 1, v.y);
}
if (d == 3) {
_local2 = new com.wis.math.alg.Vector(v.x, v.y + 1);
}
if (gameMap[_local2.y][_local2.x] == undefined) {
return(false);
}
if (gameMap[_local2.y][_local2.x].walls[d]) {
if (((pdir == 1) && (gameMap[_local2.y + 1][_local2.x].walls[d])) && (ppos.y > v.y)) {
return(true);
}
if (((pdir == 3) && (gameMap[_local2.y - 1][_local2.x].walls[d])) && (ppos.y < v.y)) {
return(true);
}
return(false);
}
}
function checkValidMoveDynamic(v, ob) {
var _local5 = checkValidMove(v, ob);
if (!_local5) {
return(_local5);
}
var _local2 = 0;
while (_local2 < dynamicControllers.length) {
if (dynamicControllers[_local2] != ob) {
if ((dynamicControllers[_local2].tile.x == v.x) && (dynamicControllers[_local2].tile.y == v.y)) {
return(false);
}
if (dynamicControllers[_local2].nextTile != undefined) {
if ((dynamicControllers[_local2].nextTile.x == v.x) && (dynamicControllers[_local2].nextTile.y == v.y)) {
return(false);
}
}
}
_local2++;
}
return(true);
}
function checkTileEmptyDynamic(v) {
if (!gameMap[v.y][v.x].isEmpty) {
return(false);
}
var _local2 = 0;
while (_local2 < dynamicControllers.length) {
if ((dynamicControllers[_local2].tile.x == v.x) && (dynamicControllers[_local2].tile.y == v.y)) {
return(false);
}
if (dynamicControllers[_local2].nextTile != undefined) {
if ((dynamicControllers[_local2].nextTile.x == v.x) && (dynamicControllers[_local2].nextTile.y == v.y)) {
return(false);
}
}
_local2++;
}
return(true);
}
function getOrthDepth(i, j) {
return(com.doodlehead.maincontroller.MainControllerSubsidiary.getOrthDepth(i, j, dgap));
}
function registerForInput(ar, ob, t) {
inputmgr.addSet(ar, ob, t);
return(inputmgr);
}
function playerCoords() {
return(pchar.__get__tile());
}
function initArrayAIC() {
ary_aic = new Array({type:"drone", data:leveldata.drones.drone}, {type:"seeker", data:leveldata.seekers.seeker}, {type:"wanderer", data:leveldata.wanderers.wanderer});
}
function removeCharacterByReference(ob) {
var _local2 = 0;
while (_local2 < charAr.length) {
if (charAr[_local2] == ob) {
gameElements[charAr[_local2].getClip()].removeMovieClip();
charAr.splice(_local2, 1);
}
_local2++;
}
}
function setUpBoard() {
if (configob.levels.level.length > 0) {
var _local5 = 0;
while (_local5 < configob.levels.level.length) {
if (configob.levels.level[_local5].id == curlevel) {
leveldata = configob.levels.level[_local5];
break;
}
_local5++;
}
} else {
leveldata = configob.levels.level;
}
var _local14 = parseInt(leveldata.playerstart.x);
var _local13 = parseInt(leveldata.playerstart.y);
if (charLastPositionOb[curlevel] != undefined) {
_local14 = charLastPositionOb[curlevel].tile.x;
_local13 = charLastPositionOb[curlevel].tile.y;
}
pchar = new com.doodlehead.actors.PlayerCharacter("PlayerCharacter", "", this, amgr, _local14, _local13, "DONN", undefined);
if ($fallFromSky) {
pchar.__set__interactFlag(true);
}
gamew = parseInt(leveldata.width);
gameh = parseInt(leveldata.height);
if (gameBoard != undefined) {
gameBoard.removeMovieClip();
}
if (gameElements != undefined) {
gameElements.removeMovieClip();
}
if (gameHUD != undefined) {
gameHUD.removeMovieClip();
}
createEmptyMovieClip("gameBoard", 1);
createEmptyMovieClip("gameBoardOverlay", 2);
attachMovie(com.doodlehead.view.GameDisplay.id, "gameElements", 4);
attachMovie("l_userInterface", "gameHUD", 5);
attachMovie(com.doodlehead.sound.SFXEngine.id, "sfxEngine", 6);
attachMovie("l_digitalTimer", "mcClock", 2999, {_x:240, _y:356});
mcClock._visible = false;
var _local8 = unknownToArray(configob.audio.sfx.sfx);
var _local5 = 0;
while (_local5 < _local8.length) {
sfxEngine.loadSound(_local8[_local5].id, _local8[_local5].file);
_local5++;
}
hudmap = gameHUD.mcMapAndHealth.mcMap;
if (leveldata.levelcolor.type == "tile") {
var _local12 = leveldata.levelcolor.nodeval.split("|");
var _local15 = parseInt(_local12[0], 16);
var _local10 = parseInt(_local12[1], 16);
gameBoard.beginFill(_local15, 100);
gameBoard.moveTo(translatePosition(-0.5, -0.5)._x, translatePosition(-0.5, -0.5)._y);
gameBoard.lineTo(translatePosition(gamew - 0.5, -0.5)._x, translatePosition(gamew - 0.5, -0.5)._y);
gameBoard.lineTo(translatePosition(gamew - 0.5, gameh - 0.5)._x, translatePosition(gamew - 0.5, gameh - 0.5)._y);
gameBoard.lineTo(translatePosition(-0.5, gameh - 0.5)._x, translatePosition(-0.5, gameh - 0.5)._y);
gameBoard.lineTo(translatePosition(-0.5, -0.5)._x, translatePosition(-0.5, -0.5)._y);
gameBoard.endFill();
var _local4 = -0.5;
while (_local4 < (gameh - 1)) {
var _local7 = (_local4 + 0.5) % 2;
var _local11 = _local4;
var _local2 = _local7 - 0.5;
while (_local2 < (gamew - 1)) {
var _local6 = _local2 - 0.5;
gameBoard.beginFill(_local10, 100);
gameBoard.moveTo(translatePosition(_local2, _local4)._x, translatePosition(_local2, _local4)._y);
gameBoard.lineTo(translatePosition(_local2 + 1, _local4)._x, translatePosition(_local2 + 1, _local4)._y);
gameBoard.lineTo(translatePosition(_local2 + 1, _local4 + 1)._x, translatePosition(_local2 + 1, _local4 + 1)._y);
gameBoard.lineTo(translatePosition(_local2, _local4 + 1)._x, translatePosition(_local2, _local4 + 1)._y);
gameBoard.lineTo(translatePosition(_local2, _local4)._x, translatePosition(_local2, _local4)._y);
gameBoard.endFill();
_local2 = _local2 + 2;
}
_local4++;
}
} else if (leveldata.levelcolor.type == "graphictile") {
var _local3 = 0;
var _local9 = leveldata.levelcolor.nodeval;
var _local4 = 0;
while (_local4 < gameh) {
var _local2 = 0;
while (_local2 < gamew) {
gameBoard.attachMovie(_local9, "t" + _local3, gameBoard.getNextHighestDepth());
gameBoard["t" + _local3]._x = translatePosition(_local2, _local4)._x;
gameBoard["t" + _local3]._y = translatePosition(_local2, _local4)._y;
_local3++;
_local2++;
}
_local4++;
}
} else {
if (leveldata.levelcolor.nodeval == undefined) {
gameBoard.beginFill(defaultLevelColor, 100);
} else {
gameBoard.beginFill(parseInt(leveldata.levelcolor.nodeval, 16), 100);
}
gameBoard.moveTo(translatePosition(-0.5, -0.5)._x, translatePosition(-0.5, -0.5)._y);
gameBoard.lineTo(translatePosition(gamew - 0.5, -0.5)._x, translatePosition(gamew - 0.5, -0.5)._y);
gameBoard.lineTo(translatePosition(gamew - 0.5, gameh - 0.5)._x, translatePosition(gamew - 0.5, gameh - 0.5)._y);
gameBoard.lineTo(translatePosition(-0.5, gameh - 0.5)._x, translatePosition(-0.5, gameh - 0.5)._y);
gameBoard.lineTo(translatePosition(-0.5, -0.5)._x, translatePosition(-0.5, -0.5)._y);
gameBoard.endFill();
}
if (leveldata.overlay.nodeval != undefined) {
_parent.mcOverlay.gotoAndStop(leveldata.overlay.nodeval);
} else {
_parent.mcOverlay.gotoAndStop("default");
}
oemManager.setTimeout(this, "setUpBoard_pt2", 0.1, [this], 1);
}
function setUpBoard_pt2() {
hudmap.init(gamew, gameh, 6);
hudmap.centerAroundPoint(gameHUD.mcMapAndHealth.mcMapGuide._x + (gameHUD.mcMapAndHealth.mcMapGuide._width / 2), gameHUD.mcMapAndHealth.mcMapGuide._y + (gameHUD.mcMapAndHealth.mcMapGuide._height / 2));
gameHUD.mcMapAndHealth.txtMapLabel.htmlText = leveldata.title;
var _local5 = 0;
var _local59 = [];
var _local29 = "l_wall_midlevel";
if (leveldata.defaultwall != undefined) {
_local29 = leveldata.defaultwall;
}
var _local23 = 0;
while (_local23 < gameh) {
var _local27 = [];
var _local3 = 0;
while (_local3 < gamew) {
if (_local3 == 0) {
gameBoard.attachMovie(_local29, (("ww" + _local23) + "_") + _local3, gameBoard.getNextHighestDepth(), translatePosition(_local3, _local23));
}
if (_local23 == 0) {
gameBoard.attachMovie(_local29, (("wn" + _local23) + "_") + _local3, gameBoard.getNextHighestDepth(), translatePosition(_local3, _local23));
gameBoard[(("wn" + _local23) + "_") + _local3].gotoAndStop("north");
}
var _local14 = new Array();
var _local9 = 0;
while (_local9 < 4) {
_local14.push(false);
_local9++;
}
_local27.push(new com.doodlehead.tilegame.TileWithBorders(true, _local14, false));
_local3++;
}
gameMap.push(_local27);
_local23++;
}
var _local9 = 0;
while (_local9 < leveldata.staticobjects.object.length) {
var _local10 = leveldata.staticobjects.object[_local9];
var _local32 = _local10.coords.nodeval.split(",");
_local23 = parseInt(_local32[1]);
var _local3 = parseInt(_local32[0]);
var _local26 = 0;
while (_local26 < objectDefs[_local10.type.nodeval].length) {
var _local16 = objectDefs[_local10.type.nodeval][_local26].x;
var _local17 = objectDefs[_local10.type.nodeval][_local26].y;
var _local12 = gameMap[_local23 + _local17][_local3 + _local16];
if ((_local10.special != "door") && (_local10.special != "walkable")) {
_local12.isEmpty = false;
_local12.walkable = false;
hudmap.fillSquare(1, _local3 + _local16, _local23 + _local17);
}
_local12.numb = _local5;
if (_local10.orientation.nodeval != undefined) {
_local12.orientation = parseInt(_local10.orientation.nodeval);
}
_local26++;
}
if (_local10.special == "door") {
var _local8 = (_local10.leadsto + "_") + _local10.doorcode;
if (doorsAr[_local8] == undefined) {
doorsAr[_local8] = new Object();
doorsAr[_local8].mcs = new Array();
doorsAr[_local8].tile = new Array();
doorsAr[_local8].leadsto = _local10.leadsto;
doorsAr[_local8].opendirection = parseInt(_local10.opendirection);
doorsAr[_local8].doorcode = _local10.doorcode;
doorsAr[_local8].title = _local10.title;
if (_local10.sfx != undefined) {
doorsAr[_local8].sfx = _local10.sfx;
}
}
doorsAr[_local8].mcs.push("mapitem" + _local5);
doorsAr[_local8].tile.push({x:_local3, y:_local23});
}
var _local15 = gameElements.attachMovie("l_object", "mapitem" + _local5, getOrthDepth(_local23, _local3));
gameElements["mapitem" + _local5].gotoAndStop(_local10.type.nodeval);
if (_local10.type.nodeval.substr(0, 8) == "elevator") {
elevatorArray.push({clip:gameElements["mapitem" + _local5], leadsto:_local10.leadsto});
}
if (_local10.orientation != undefined) {
_local15.sprite.gotoAndStop("or" + parseInt(_local10.orientation.nodeval));
}
_local15.cacheAsBitmap = true;
_local15._x = translatePosition(_local3, _local23)._x;
_local15._y = translatePosition(_local3, _local23)._y;
_local15.xp = _local3;
_local15.yp = _local23;
var _local13 = new Array(new com.wis.math.alg.Vector(-run, 0), new com.wis.math.alg.Vector((-run) / 2, rise / 2), new com.wis.math.alg.Vector(0, 0), new com.wis.math.alg.Vector((-run) / 2, (-rise) / 2));
if (_local10.subobs != undefined) {
var _local2 = new Array();
if (_local10.subobs.subob.length == undefined) {
_local2 = [_local10.subobs.subob];
} else {
_local2 = _local10.subobs.subob;
}
_local26 = 0;
while (_local26 < _local2.length) {
var _local19 = parseInt(_local2[_local26].level);
var _local11 = parseInt(_local2[_local26].placement) - 1;
var _local6 = _local2[_local26].coords.split(",");
var _local16 = translatePosition(parseInt(_local6[0]), parseInt(_local6[1]))._x;
var _local17 = translatePosition(parseInt(_local6[0]), parseInt(_local6[1]))._y;
var _local22 = (("mp_" + (_local23 + parseInt(_local6[1]))) + "_") + (_local3 + parseInt(_local6[0]));
if ((!levelDataAr[curlevel].visited) || (!objectDynDefs[_local2[_local26].id].actionable)) {
var _local31 = _local15.attachMovie("l_dynamicObject", "ob" + _local26, _local15.getNextHighestDepth());
var _local44 = _local15["ob" + _local26];
_local44.gotoAndStop(_local2[_local26].id);
_local44._x = _local16 + _local13[_local11].x;
_local44._y = (_local17 - (_local19 * 45)) + _local13[_local11].y;
if (objectDynDefs[_local2[_local26].id].actionable) {
if (dynamicObsMap[_local22] == undefined) {
dynamicObsMap[_local22] = new Array();
}
dynamicObsMap[_local22].push({name:_local2[_local26].id, xoff:parseInt(_local6[0]), yoff:parseInt(_local6[1]), actions:objectDynDefs[_local2[_local26].id].actions, position:new com.wis.math.alg.Vector(_local3, _local23), mcclip:gameElements["mapitem" + _local5], invbool:objectDynDefs[_local2[_local26].id].invbool, mcid:"ob" + _local26, state:"enabled", actiondirection:objectDynDefs[_local2[_local26].id].actiondirection, type:"subob", tobsub:_local44});
}
if (objectDynDefs[_local2[_local26].id].landmine) {
gameMap[_local23][_local3].setLandMine(true, objectDynDefs[_local2[_local26].id].landmineOrders);
}
} else if (levelDataAr[curlevel].dynamicObsMap[_local22][0] == undefined) {
} else {
var _local31 = _local15.attachMovie("l_dynamicObject", "ob" + _local26, _local15.getNextHighestDepth());
var _local44 = _local15["ob" + _local26];
var _local28 = levelDataAr[curlevel].dynamicObsMap[_local22][0].state;
_local44.gotoAndStop(_local2[_local26].id);
_local44._x = _local16 + _local13[_local11].x;
_local44._y = (_local17 - (_local19 * 45)) + _local13[_local11].y;
if (objectDynDefs[_local2[_local26].id].landmine) {
gameMap[_local23][_local3].setLandMine(true, objectDynDefs[_local2[_local26].id].landmineOrders);
}
}
_local26++;
}
}
_local5++;
_local9++;
}
if (leveldata.dividers.divider != undefined) {
var _local36 = unknownToArray(leveldata.dividers.divider);
_local9 = 0;
while (_local9 < _local36.length) {
var _local10 = _local36[_local9];
var _local32 = _local10.coords.split(",");
_local23 = parseInt(_local32[1]);
var _local3 = parseInt(_local32[0]);
var _local24 = parseInt(_local10.pos);
var _local7 = "l_divider";
if (_local10.walltype != undefined) {
_local7 = _local10.walltype;
}
if ((_local24 == 3) && (_local10.run != undefined)) {
var _local45 = "";
var _local35 = parseInt(_local10.run);
var _local26 = _local3;
while (_local26 < (_local3 + _local35)) {
gameMap[_local23][_local26].walls[_local24] = true;
var _local25 = "div" + _local5;
if ((_local7 == "l_divider") && (_local26 > _local3)) {
_local45 = "Multi";
}
var _local15 = gameElements.attachMovie(_local7 + _local45, _local25, getOrthDepth(_local23, _local26) - _local24);
_local15.cacheAsBitmap = true;
_local15._x = translatePosition(_local26, _local23)._x;
if (_local7 == "l_divider") {
_local15._y = translatePosition(_local26, _local23)._y - rise;
if (_local24 == 3) {
_local15.gotoAndStop(2);
}
} else {
_local15._y = translatePosition(_local26, _local23)._y;
_local15.gotoAndStop("north");
}
hudmap.drawWall(1, _local24, _local26, _local23);
_local15.xp = _local26;
_local15.yp = _local23;
_local5++;
_local26++;
}
} else if ((_local24 == 2) && (_local10.rise != undefined)) {
var _local45 = "";
var _local34 = parseInt(_local10.rise);
var _local26 = _local23;
while (_local26 < (_local23 + _local34)) {
gameMap[_local26][_local3].walls[_local24] = true;
if ((_local7 == "l_divider") && (_local26 > _local23)) {
_local45 = "Multi";
}
var _local15 = gameElements.attachMovie(_local7 + _local45, "div" + _local5, getOrthDepth(_local26, _local3) - _local24);
_local15.cacheAsBitmap = true;
_local15._x = translatePosition(_local3, _local26)._x;
if (_local7 == "l_divider") {
_local15._y = translatePosition(_local3, _local26)._y - rise;
if (_local24 == 3) {
_local15.gotoAndStop(2);
}
} else {
_local15._y = translatePosition(_local3, _local26)._y;
}
hudmap.drawWall(1, _local24, _local3, _local26);
_local15.xp = _local3;
_local15.yp = _local26;
_local5++;
_local26++;
}
} else {
var _local45 = "";
gameMap[_local23][_local3].walls[_local24] = true;
var _local15 = gameElements.attachMovie(_local7, "div" + _local5, getOrthDepth(_local23, _local3) - _local24);
_local15.cacheAsBitmap = true;
_local15._x = translatePosition(_local3, _local23)._x;
_local15._y = translatePosition(_local3, _local23)._y - rise;
if (_local24 == 3) {
_local15.gotoAndStop(2);
}
if (_local10.sec != undefined) {
_local15.sprite.gotoAndStop(parseInt(_local10.sec));
}
hudmap.drawWall(1, _local24, _local3, _local23);
_local15.xp = _local3;
_local15.yp = _local23;
_local5++;
}
_local9++;
}
}
if (leveldata.decals != undefined) {
var _local36 = unknownToArray(leveldata.decals.decal);
_local9 = 0;
while (_local9 < _local36.length) {
var _local33 = _local36[_local9].coords.split(",");
var _local21 = parseInt(_local33[0]);
var _local20 = parseInt(_local33[1]);
var _local24 = parseInt(_local36[_local9].pos);
var _local38 = getOrthDepth(_local20, _local21) - _local24;
var _local4 = gameElements.getInstanceAtDepth(_local38);
var _local22 = (("mp_" + _local20) + "_") + _local21;
if (_local4 == undefined) {
_local4 = gameElements.attachMovie("l_blank", "div" + _local5, getOrthDepth(_local20, _local21) - _local24);
_local4._x = translatePosition(_local21, _local20)._x;
_local4._y = translatePosition(_local21, _local20)._y - rise;
_local4.xp = _local3;
_local4.yp = _local26;
_local5++;
}
if ((!levelDataAr[curlevel].visited) || (!objectDynDefs[_local36[_local9].id].actionable)) {
_local4.attachMovie("l_wallDecals", "wallob", _local4.getNextHighestDepth());
_local4.wallob.gotoAndStop(_local36[_local9].id);
if (_local4.wallob.sprite != undefined) {
_local4.wallob.sprite.gotoAndStop("or" + _local24);
}
if (objectDynDefs[_local36[_local9].id].actionable) {
if (dynamicObsMap[_local22] == undefined) {
dynamicObsMap[_local22] = new Array();
}
dynamicObsMap[_local22].push({name:_local36[_local9].id, xoff:0, yoff:0, actions:objectDynDefs[_local36[_local9].id].actions, position:new com.wis.math.alg.Vector(_local21, _local20), mcclip:_local4, invbool:objectDynDefs[_local36[_local9].id].invbool, mcid:"wallob", state:"enabled", clipref:_local4.wallob, actiondirection:objectDynDefs[_local36[_local9].id].actiondirection, actionDescription:objectDynDefs[_local36[_local9].id].actionDescription, type:"walldecal", decal:_local4.wallob, tobsub:_local4.wallob});
}
} else if (levelDataAr[curlevel].dynamicObsMap[_local22][0] == undefined) {
} else {
_local4.attachMovie("l_wallDecals", "wallob", _local4.getNextHighestDepth());
_local4.wallob.gotoAndStop(_local36[_local9].id);
if (_local4.wallob.sprite != undefined) {
_local4.wallob.sprite.gotoAndStop("or" + _local24);
}
var _local28 = levelDataAr[curlevel].dynamicObsMap[_local22][0].state;
if ((_local28 != "enabled") && (_local28 != undefined)) {
_local4.wallob.sprite.sprite.gotoAndPlay(_local28);
}
}
_local9++;
}
}
if (!levelDataAr[curlevel].visited) {
if (leveldata.floorobs != undefined) {
var _local36 = unknownToArray(leveldata.floorobs.floorob);
_local9 = 0;
while (_local9 < _local36.length) {
var _local33 = _local36[_local9].coords.split(",");
var _local39 = parseInt(_local33[0]);
var _local37 = parseInt(_local33[1]);
addFloorObject(_local39, _local37, _local36[_local9].id);
_local9++;
}
}
} else {
for (var _local26 in floorObArray) {
addFloorObject(floorObArray[_local26].x, floorObArray[_local26].y, floorObArray[_local26].id);
}
}
initArrayAIC();
var _local40 = "character_player.swf";
gameElements.attachMovie("l_sprite", "charSprite0", gameElements.getNextHighestDepth());
gameElements.charSprite0.createEmptyMovieClip("sprite", 1);
gameElements.charSprite0.sprite.loadMovie(_local40);
redoPlayerDecals(gameElements.charSprite0);
pchar.__set__health(charSpriteHolder.health);
var _local30 = 1;
if ((ary_aic.length != undefined) && (ary_aic != undefined)) {
var _local26 = 0;
while (_local26 < ary_aic.length) {
if (ary_aic[_local26].data != undefined) {
var _local18 = unknownToArray(ary_aic[_local26].data);
_local9 = 0;
while (_local9 < _local18.length) {
_local23 = _local30;
gameElements.attachMovie("l_sprite", "charSprite" + _local23, gameElements.getNextHighestDepth());
gameElements["charSprite" + _local23].createEmptyMovieClip("sprite", 1);
if (_local18[_local9].swf != undefined) {
gameElements["charSprite" + _local23].sprite.loadMovie(_local18[_local9].swf);
} else {
gameElements["charSprite" + _local23].sprite.loadMovie(_local40);
}
_local30++;
_local9++;
}
}
_local26++;
}
}
_local23 = 0;
while (_local23 < charAr.length) {
if (gameElements["charSprite" + _local23].sprite.__proto__ != com.doodlehead.actors.CharacterSubSprite.prototype) {
gameElements["charSprite" + _local23].sprite.__proto__ = com.doodlehead.actors.CharacterSubSprite.prototype;
}
com.doodlehead.actors.CharacterSubSprite.apply(gameElements["charSprite" + _local23].sprite, ["george mcgovern"]);
_local23++;
}
gameHUD.health = pchar.health;
if (elevatorArray.length > 0) {
initiateElevators(elevatorArray);
}
levelDataAr[curlevel].visited = true;
oemManager.setTimeout(this, "restoreObStates", 0.2, [this], 1);
oemManager.setTimeout(this, "restoreFloorObState", 0.2, [this], 1);
oemManager.register(this, "maintainSFX");
oemManager.register(gameElements.charSprite0, "frameAction");
finishMap();
}
function restoreObStates() {
for (var _local4 in dynamicObsMap) {
var _local2 = levelDataAr[curlevel].dynamicObsMap[_local4][0].state;
var _local3 = levelDataAr[curlevel].dynamicObsMap[_local4][0].tobsub;
if ((_local2 != "enabled") && (_local2 != undefined)) {
if (_local3.sprite.sprite._visible != undefined) {
_local3.sprite.sprite.gotoAndPlay(_local2);
} else {
_local3.sprite.gotoAndPlay(_local2);
}
}
}
if (levelDataAr[curlevel].getFlag("isUmbrellaReady") && (!levelDataAr[curlevel].getFlag("hasUmbrellad"))) {
updateMapComboItems("umbrellaIndicator");
}
}
function storePlayerDecals() {
charSpriteHolder.burn = gameElements[pchar.getClip()].burn;
charSpriteHolder.sick = gameElements[pchar.getClip()].sick;
charSpriteHolder.decals = gameElements[pchar.getClip()].getDecals();
}
function redoPlayerDecals(tgt) {
for (var _local3 in charSpriteHolder.decals) {
tgt.setDecals(charSpriteHolder.decals[_local3], _local3);
}
tgt.__set__burn(charSpriteHolder.burn);
tgt.__set__sick(charSpriteHolder.sick);
}
function initiateElevators(ar) {
var _local4 = "up";
if (ar[0].leadsto.indexOf("|") == -1) {
if (ar[0].leadsto == "mailroom") {
_local4 = "down";
}
if (ar[0].leadsto == "mid") {
if (curlevel == "execrecep") {
_local4 = "down";
}
}
} else {
oemManager.setTimeout(this, "toggleElevator", 4, [this], 999);
}
var _local2 = 0;
while (_local2 < ar.length) {
ar[_local2].clip.sprite._mcUpDownArrows.gotoAndStop(_local4);
ar[_local2].clip.sprite._mcfloorIndicator.gotoAndStop(curlevel);
_local2++;
}
}
function toggleElevator() {
if (elevatorArray.length > 0) {
var _local3 = "up";
if (elevatorArray[0].clip.sprite._mcUpDownArrows.state == "up") {
_local3 = "down";
}
var _local2 = 0;
while (_local2 < elevatorArray.length) {
elevatorArray[_local2].clip.sprite._mcUpDownArrows.gotoAndStop(_local3);
elevatorArray[_local2].clip.sprite._mcfloorIndicator.gotoAndStop(curlevel);
_local2++;
}
}
}
function floodBathroom(ar) {
addFloorObject(ar[0], ar[1], "bathroomflood");
levelDataAr[curlevel].setFlag("isFlooded", true);
}
function addFloorObject(x, y, id) {
var _local3 = "fo" + gameBoardOverlay.getNextHighestDepth();
gameBoardOverlay.attachMovie("l_floorObs", _local3, gameBoardOverlay.getNextHighestDepth());
gameBoardOverlay[_local3].gotoAndStop(id);
gameBoardOverlay[_local3]._x = translatePosition(x, y)._x;
gameBoardOverlay[_local3]._y = translatePosition(x, y)._y;
var _local9 = (((id + "_") + x) + "_") + y;
var _local2 = false;
for (var _local4 in floorObArray) {
if (floorObArray[_local4].uid == _local9) {
_local2 = true;
}
}
if (!_local2) {
floorObArray.push({uid:_local9, id:id, clip:gameBoardOverlay[_local3], x:x, y:y, curFrame:undefined});
}
}
function storeFloorObState() {
for (var _local2 in floorObArray) {
floorObArray[_local2].curFrame = floorObArray[_local2].clip.sprite._currentframe;
}
}
function restoreFloorObState() {
for (var _local2 in floorObArray) {
if (floorObArray[_local2].curFrame != undefined) {
floorObArray[_local2].clip.sprite.gotoAndStop(floorObArray[_local2].curFrame);
}
}
}
function maintainSFX() {
sfxEngine.maintainSounds(pchar.__get__position().x, pchar.__get__position().y);
}
function setCharacterColors(newch, dob) {
var _local4 = 11184810 /* 0xAAAAAA */;
var _local2 = 10066329 /* 0x999999 */;
var _local3 = 6710886 /* 0x666666 */;
var _local8 = 2236962 /* 0x222222 */;
var _local6 = 8939076 /* 0x886644 */;
var _local5 = 6702114 /* 0x664422 */;
var _local7 = 39168;
if (dob.colors != undefined) {
var _local1 = dob.colors.split("|");
_local4 = parseInt(_local1[0], 16);
_local2 = parseInt(_local1[1], 16);
_local3 = parseInt(_local1[2], 16);
_local8 = parseInt(_local1[3], 16);
_local6 = parseInt(_local1[4], 16);
_local5 = parseInt(_local1[5], 16);
_local7 = parseInt(_local1[6], 16);
}
newch.setColors(_local4, _local2, _local3, _local8, _local6, _local5, _local7);
}
function smartenCharacters() {
initArrayAIC();
var _local15 = "character_player.swf";
gameElements.charSprite0._x = translatePosition(3, 3)._x;
gameElements.charSprite0._y = translatePosition(3, 3)._y;
gameElements.charSprite0.ctrlr = pchar;
gameElements.charSprite0.ctrlr.setClip("charSprite0");
gameElements.charSprite0.sprite.notifyActionDone = function () {
this._parent.notifyActionDone();
};
pchar.addEventListener("statechange", mx.utils.Delegate.create(this, clipStateChange));
pchar.addEventListener("propchange", mx.utils.Delegate.create(this, propChange));
pchar.addEventListener("positionchange", mx.utils.Delegate.create(this, positionChange));
gameElements.charSprite0.addEventListener("actiondone", mx.utils.Delegate.create(this, clipAnimationDone));
gameElements.addActiveOb("charSprite0");
dynamicControllers.push(pchar);
setCharacterColors(pchar, {colors:$characterColors});
charAr.push(pchar);
var _local12 = 0;
while (_local12 < ary_aic.length) {
if (ary_aic[_local12].data != undefined) {
var _local13 = unknownToArray(ary_aic[_local12].data);
var _local10 = 0;
while (_local10 < _local13.length) {
var _local2 = _local13[_local10];
var _local3 = charAr.length;
var _local9 = translatePipedCoordsToArray(_local2.coords)[0].x;
var _local8 = translatePipedCoordsToArray(_local2.coords)[0].y;
var _local5;
var _local6 = new Array(new com.wis.math.alg.Vector(0, 0), new com.wis.math.alg.Vector(gamew, gameh));
switch (ary_aic[_local12].type) {
case "drone" :
charAr.push(new com.doodlehead.actors.GameCharacter("DroneCharacter", _local2.type, this, amgr, _local9, _local8, _local2.name, _local2.speechfile, _local2.orders, _local2.mutterings, 999, 4, _local6));
_local5 = charAr[charAr.length - 1];
setCharacterColors(_local5, _local2);
break;
case "seeker" :
if ((_local2.movementBox != undefined) && (_local2.movementBox != "")) {
var _local11 = _local2.movementBox.split("|");
_local6 = new Array();
var _local4 = 0;
while (_local4 < _local11.length) {
var _local7 = _local11[_local4].split(",");
_local6.push(new com.wis.math.alg.Vector(parseInt(_local7[0]), parseInt(_local7[1])));
_local4++;
}
}
charAr.push(new com.doodlehead.actors.GameCharacter("SeekerCharacter", _local2.type, this, amgr, _local9, _local8, _local2.name, _local2.speechfile, _local2.orders, _local2.mutterings, parseInt(_local2.range), parseInt(_local2.speed), _local6));
_local5 = charAr[charAr.length - 1];
break;
}
if (_local2.dialogfile != undefined) {
_local5.dialogfile = _local2.dialogfile;
}
if (_local2.sbubblec != undefined) {
var _local14 = parseInt(_local2.sbubblec, 16);
_local5.sbubblec = _local14;
}
gameElements["charSprite" + _local3].ctrlr = charAr[_local3];
gameElements["charSprite" + _local3].ctrlr.setClip("charSprite" + _local3);
gameElements["charSprite" + _local3]._x = translatePosition(_local9, _local8)._x;
gameElements["charSprite" + _local3]._y = translatePosition(_local9, _local8)._y;
gameElements["charSprite" + _local3].sprite.notifyActionDone = function () {
this._parent.notifyActionDone();
};
gameElements["charSprite" + _local3].charName = charAr[_local3].name;
gameElements["charSprite" + _local3].sprite.charName = "doodle";
gameElements["charSprite" + _local3].setShirtColor("Dark", 11180288);
gameElements["charSprite" + _local3].setShirtColor("Light", 16763904);
charAr[_local3].addEventListener("statechange", mx.utils.Delegate.create(this, clipStateChange));
charAr[_local3].addEventListener("positionchange", mx.utils.Delegate.create(this, positionChange));
gameElements["charSprite" + _local3].addEventListener("actiondone", mx.utils.Delegate.create(this, clipAnimationDone));
gameElements.addActiveOb("charSprite" + _local3);
dynamicControllers.push(charAr[_local3]);
_local10++;
}
}
_local12++;
}
oemManager.deleteOEF(this, "smartenCharacters");
}
function finishMap() {
var _local13 = unknownToArray(leveldata.deadspaces.space);
var _local2 = 0;
while (_local2 < _local13.length) {
var _local8 = _local13[_local2];
var _local12 = _local8.coords.split(",");
var _local3 = parseInt(_local12[0]);
var _local7 = parseInt(_local12[1]);
if (_local8.type == "single") {
gameMap[_local7][_local3].isEmpty = false;
} else if (_local8.type == "row") {
var _local10 = parseInt(_local8.run);
var _local4 = _local3;
while (_local4 < (_local3 + _local10)) {
gameMap[_local7][_local4].isEmpty = false;
_local4++;
}
} else if (_local8.type == "square") {
var _local10 = parseInt(_local8.run);
var _local11 = parseInt(_local8.rise);
var _local5 = _local7;
while (_local5 < (_local7 + _local11)) {
var _local4 = _local3;
while (_local4 < (_local3 + _local10)) {
gameMap[_local5][_local4].isEmpty = false;
_local4++;
}
_local5++;
}
}
_local2++;
}
_local2 = 0;
while (_local2 < gameh) {
var _local4 = 0;
while (_local4 < gamew) {
if (gameMap[_local2][_local4].isEmpty) {
hudmap.fillSquare(1, _local4, _local2, 11645361);
}
_local4++;
}
_local2++;
}
var _local9 = 0;
for (var _local14 in doorsAr) {
_local2 = 0;
while (_local2 < (doorsAr[_local14].tile.length / 2)) {
var _local6 = String.fromCharCode(65 + _local9) + ".";
if ((_local2 == 0) && (doorsAr[_local14].title != undefined)) {
gameHUD.mcMapAndHealth.setDoorLabel(_local9, (_local6 + " - ") + doorsAr[_local14].title);
_local9++;
} else {
_local6 = undefined;
}
hudmap.drawDoor(doorsAr[_local14].tile[_local2].x, doorsAr[_local14].tile[_local2].y, doorsAr[_local14].opendirection, 0, _local6);
_local2++;
}
}
trace((curlevel + " ;;; ") + levelDataAr[curlevel].getFlag("hasSharked"));
if ((curlevel == "execrecep") && (levelDataAr[curlevel].getFlag("hasSharked"))) {
trace("IN HERE");
unwalkSharkFloor();
}
oemManager.register(this, "mainLoop");
oemManager.register(this, "smartenCharacters");
}
function fallFromSkyPt1() {
if (gameElements[pchar.getClip()].sprite.getBytesLoaded() == gameElements[pchar.getClip()].sprite.getBytesTotal()) {
pchar.__set__state("beatdownsouth");
gameElements[pchar.getClip()].sprite.gotoAndStop("beatdownsouth");
gameElements[pchar.getClip()].sprite.sprite.gotoAndStop(20);
gameElements[pchar.getClip()].sprite._y = -400;
oemManager.deleteOEF(this, "fallFromSkyPt1");
oemManager.register(this, "fallFromSkyPt2");
}
}
function fallFromSkyPt2() {
if (gameElements[pchar.getClip()].sprite._y < 0) {
gameElements[pchar.getClip()].sprite._y = gameElements[pchar.getClip()].sprite._y + 40;
} else {
gameElements[pchar.getClip()].sprite._y = 0;
pchar.__set__interactFlag(false);
pchar.setState("standsouth");
$fallFromSky = false;
oemManager.deleteOEF(this, "fallFromSkyPt2");
}
}
function doExplode(ar) {
var _local8 = ar[0];
var _local7 = ar[1];
var _local4 = ar[2];
var _local3 = ar[3];
var _local5 = ar[4];
var _local6 = ar[5];
gameElements.attachMovie("l_fx_explosion", "explosion", gameElements.getNextHighestDepth(), {_x:_local8, _y:_local7});
if ((Math.abs(pchar.__get__tile().x - _local4) <= 2) && (Math.abs(pchar.__get__tile().y - _local3) <= 2)) {
oemManager.setTimeout(this, "setStateChar", 0.3, ["onfire"], 1);
}
oemManager.setTimeout(this, "setStateOb", 0.3, [_local5, _local6], 1);
}
function setEndFrameAction(ob, f) {
if (gameElements[ob.getClip()].sprite.__proto__ != com.doodlehead.actors.CharacterSubSprite.prototype) {
gameElements[ob.getClip()].sprite.__proto__ = com.doodlehead.actors.CharacterSubSprite.prototype;
}
gameElements[ob.getClip()].sprite.setEndFrameAction(ob, f);
}
function setStateOb(cob, dob) {
cob.gotoAndPlay("broken");
dob.state = "broken";
}
function setPlayerAttacked(ob, s) {
if (ob.attackName != undefined) {
actionDesc = ob.attackName;
}
pchar.health = pchar.health - 5;
if (pchar.__get__pinata()) {
pchar.setState("pinata" + s);
} else {
pchar.setState("attacked" + s);
}
bloodyTheHead(2);
bloodyTheBody(3);
}
function setStateChar(ar) {
pchar.setState(ar[0]);
}
function removeSub(ar) {
gameElements.removeSubObject(ar[0], ar[1], ar[2]);
}
function removeDecal(ar) {
gameElements.removeDecal(ar[0]);
}
function clearMapComboItems() {
for (var _local3 in dynamicObsMap) {
var _local2 = 0;
while (_local2 < dynamicObsMap[_local3].length) {
dynamicObsMap[_local3][_local2].mcclip[dynamicObsMap[_local3][_local2].mcid].mcIndicator.gotoAndStop(1);
_local2++;
}
}
setMapComboHint("default");
}
function initiateCoordinatedManeuver(ea, npc) {
var _local9;
var _local3 = unknownToArray(configob.comboactions.combo);
var _local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2].id == ea) {
var _local5 = 10;
if (_local3[_local2].damage != undefined) {
_local5 = parseInt(_local3[_local2].damage);
}
var _local6 = "";
var _local4 = "";
if (_local3[_local2].actionDescription != undefined) {
_local4 = _local3[_local2].actionDescription;
}
if (_local3[_local2].sequence != undefined) {
_local6 = _local3[_local2].sequence;
}
mgrActionSequence = new com.doodlehead.actors.ActionSequencer(this, _local6, npc, gameElements[npc.getClip()], pchar, gameElements[pchar.getClip()], charAr, _local5, _local4);
mgrActionSequence.addEventListener("sequenceDone", mx.utils.Delegate.create(this, releaseCoordinatedManeuver));
mgrActionSequence.addEventListener("occupyPSquare", mx.utils.Delegate.create(this, maneuverOccupySame));
mgrActionSequence.addEventListener("occupyOSquare", mx.utils.Delegate.create(this, maneuverOccupyOriginal));
return(true);
}
_local2++;
}
return(false);
}
function maneuverOccupySame(eventObj) {
var _local2 = 1;
while (_local2 < charAr.length) {
if (charAr[_local2].name == eventObj.ctrl.name) {
var _local3 = charAr[_local2].name;
charAr[_local2].tile = new com.wis.math.alg.Vector(pchar.__get__tile().x, pchar.__get__tile().y);
charAr[_local2].position = new com.wis.math.alg.Vector(pchar.__get__tile().x, pchar.__get__tile().y);
charAr[_local2].direction = 0;
charAr[_local2].zoffset = 1;
gameElements[charAr[_local2].getClip()]._x = gameElements[pchar.getClip()]._x;
gameElements[charAr[_local2].getClip()]._y = gameElements[pchar.getClip()]._y + 1;
}
_local2++;
}
}
function maneuverOccupyOriginal(eventObj) {
eventObj.ctrl.tile = eventObj.tile;
eventObj.ctrl.position = eventObj.tile;
eventObj.ctrl.zoffset = 0;
gameElements[eventObj.ctrl.getClip()]._x = translatePosition(eventObj.tile.x, eventObj.tile.y)._x;
gameElements[eventObj.ctrl.getClip()]._y = translatePosition(eventObj.tile.x, eventObj.tile.y)._y;
}
function releaseCoordinatedManeuver(eventObj) {
eventObj.ctrl.tile = eventObj.tile;
eventObj.ctrl.position = eventObj.tile;
gameElements[eventObj.ctrl.getClip()]._x = translatePosition(eventObj.tile.x, eventObj.tile.y)._x;
gameElements[eventObj.ctrl.getClip()]._y = translatePosition(eventObj.tile.x, eventObj.tile.y)._y;
actionDesc = mgrActionSequence.actionDescription;
pchar.health = pchar.health - mgrActionSequence.damage;
mgrActionSequence.__get__npc().endConversation();
pchar.endConversation();
mgrActionSequence = undefined;
}
function moveCharacterThroughDoor(ar) {
ar[0].setExitWalk();
}
function makeCharacterEnter(ar) {
ar[0].setEntranceWalk();
}
function exitInUse(name) {
for (var _local2 in doorsAr) {
if (doorsAr[_local2].title.toLowerCase() == _local2.toLowerCase()) {
if (gameElements[doorsAr[_local2].mcs[0]].sprite._currentframe == 1) {
return(false);
}
return(true);
}
}
}
function finishCharacterExit(ob, s, v, d, name) {
gameElements[s].setMask(null);
gameElements[s + "Mask"].removeMovieClip();
var _local2 = 0;
while (_local2 < doorsAr[name].mcs.length) {
gameElements[doorsAr[name].mcs[_local2]].sprite.gotoAndStop(1);
_local2++;
}
}
function initiateWeaselAttack() {
var _local3;
var _local2 = 0;
while (_local2 < charAr.length) {
if (charAr[_local2].subTypeOf == "weasel") {
charAr[_local2].position.x = (charAr[_local2].tile.x = 3 + _local2);
charAr[_local2].position.y = (charAr[_local2].tile.y = 9);
}
_local2++;
}
giveCharacterOrders(((("move:" + pchar.__get__tile().x) + ",") + pchar.__get__tile().y) + "|setstate:weasel", "all", "weasel", "WORK FOR THE WEASEL");
}
function initiatePinataAttack() {
actionDesc = "I WANT CANDY";
var _local2 = 0;
while (_local2 < charAr.length) {
if (charAr[_local2].subTypeOf == "drone") {
charAr[_local2].initScriptedSeeker(((("move:" + pchar.__get__tile().x) + ",") + pchar.__get__tile().y) + "|setstate:stick", "I WANT CANDY");
}
_local2++;
}
oemManager.setTimeout(this, "releasePinataAttack", 20, [this], 1);
}
function releasePinataAttack() {
var _local2 = 0;
while (_local2 < charAr.length) {
if (charAr[_local2].subTypeOf == "drone") {
charAr[_local2].releaseScriptedSeeker();
}
_local2++;
}
pchar.__set__pinata(false);
}
function getDoorwayEnterDirection(v) {
for (var _local4 in doorsAr) {
var _local2 = 0;
while (_local2 < doorsAr[_local4].tile.length) {
if ((v.x == doorsAr[_local4].tile[_local2].x) && (v.y == doorsAr[_local4].tile[_local2].y)) {
return((doorsAr[_local4].opendirection + 2) % 4);
}
_local2++;
}
}
return(0);
}
function unMaskMe(ob, s, v) {
gameElements[s].setMask(null);
gameElements[s + "Mask"].removeMovieClip();
for (var _local5 in doorsAr) {
var _local3 = false;
var _local2 = 0;
while (_local2 < doorsAr[_local5].tile.length) {
if ((v.x == doorsAr[_local5].tile[_local2].x) && (v.y == doorsAr[_local5].tile[_local2].y)) {
_local3 = true;
}
_local2++;
}
if (_local3) {
_local2 = 0;
while (_local2 < doorsAr[_local5].mcs.length) {
gameElements[doorsAr[_local5].mcs[_local2]].sprite.gotoAndStop(1);
_local2++;
}
return(undefined);
}
}
}
function doorMaskMe(ob, s, v, d, isEntering) {
gameElements.attachMovie("l_doorMasks", s + "Mask", gameElements.getNextHighestDepth());
gameElements[s + "Mask"]._x = translatePosition(v.x, v.y)._x;
gameElements[s + "Mask"]._y = translatePosition(v.x, v.y)._y;
gameElements[s + "Mask"].gotoAndStop(d);
gameElements[s].setMask(gameElements[s + "Mask"]);
for (var _local9 in doorsAr) {
var _local4 = false;
var _local2 = 0;
while (_local2 < doorsAr[_local9].tile.length) {
if ((v.x == doorsAr[_local9].tile[_local2].x) && (v.y == doorsAr[_local9].tile[_local2].y)) {
ob.direction = doorsAr[_local9].opendirection;
ob.exitClipName = _local9;
if (!isEntering) {
ob.setStandDoor();
}
_local4 = true;
}
_local2++;
}
if (_local4) {
_local2 = 0;
while (_local2 < doorsAr[_local9].mcs.length) {
gameElements[doorsAr[_local9].mcs[_local2]].sprite.gotoAndPlay("default");
if (_local2 == 0) {
if (isEntering) {
gameElements[doorsAr[_local9].mcs[_local2]].sprite.endvars = {func:"makeCharacterEnter", ob:this, ar:[ob]};
} else {
gameElements[doorsAr[_local9].mcs[_local2]].sprite.endvars = {func:"moveCharacterThroughDoor", ob:this, ar:[ob]};
}
}
_local2++;
}
}
}
}
function setMapComboHint(comboID) {
gameHUD.mcMapAndHealth.MSIE.gotoAndStop(comboID);
}
function updateMapComboItems(item) {
if (item == "umbrellaIndicator") {
hudmap.clearLayer(3);
for (var _local8 in dynamicObsMap) {
var _local2 = 0;
while (_local2 < dynamicObsMap[_local8].length) {
var _local4 = false;
if (dynamicObsMap[_local8][_local2].name == "umbrellaIndicator") {
_local4 = true;
}
if (_local4) {
dynamicObsMap[_local8][_local2].mcclip[dynamicObsMap[_local8][_local2].mcid].mcIndicator.gotoAndPlay(2);
hudmap.fillSquare(3, dynamicObsMap[_local8][_local2].mcclip.xp + dynamicObsMap[_local8][_local2].xoff, dynamicObsMap[_local8][_local2].mcclip.yp + dynamicObsMap[_local8][_local2].yoff);
} else {
dynamicObsMap[_local8][_local2].mcclip[dynamicObsMap[_local8][_local2].mcid].mcIndicator.gotoAndStop(1);
}
_local2++;
}
}
} else {
hudmap.clearLayer(3);
var _local5 = new Array();
if (objectDynDefs[item] != undefined) {
var _local6 = 0;
while (_local6 < objectDynDefs[item].combos.length) {
_local5.push(objectDynDefs[item].combos[_local6].id);
_local6++;
}
} else {
trace("DEFINITION UNDEFINED");
return(undefined);
}
for (var _local8 in dynamicObsMap) {
var _local2 = 0;
while (_local2 < dynamicObsMap[_local8].length) {
var _local4 = false;
var _local3 = 0;
while (_local3 < _local5.length) {
if (dynamicObsMap[_local8][_local2].name == _local5[_local3]) {
_local4 = true;
}
_local3++;
}
if (_local4) {
dynamicObsMap[_local8][_local2].mcclip[dynamicObsMap[_local8][_local2].mcid].mcIndicator.gotoAndPlay(2);
hudmap.fillSquare(3, dynamicObsMap[_local8][_local2].mcclip.xp + dynamicObsMap[_local8][_local2].xoff, dynamicObsMap[_local8][_local2].mcclip.yp + dynamicObsMap[_local8][_local2].yoff);
} else {
dynamicObsMap[_local8][_local2].mcclip[dynamicObsMap[_local8][_local2].mcid].mcIndicator.gotoAndStop(1);
}
_local2++;
}
}
}
}
function clearMapSquare(y, x) {
gameMap[y][x].isEmpty = true;
}
function getActionObjectAt(ob, v, myinventory) {
actionName = "";
actionDesc = "";
actionEndFunc = undefined;
actionEndDamage = 0;
for (var _local19 in doorsAr) {
var _local16 = false;
var _local10 = 0;
while (_local10 < doorsAr[_local19].tile.length) {
if (((ob.direction == doorsAr[_local19].opendirection) && (ob.tile.x == doorsAr[_local19].tile[_local10].x)) && (ob.tile.y == doorsAr[_local19].tile[_local10].y)) {
_local16 = true;
}
_local10++;
}
if (_local16) {
pchar.__set__interactFlag(true);
_local10 = 0;
while (_local10 < doorsAr[_local19].mcs.length) {
if (gameElements[doorsAr[_local19].mcs[_local10]].sprite._currentframe == 1) {
gameElements[doorsAr[_local19].mcs[_local10]].sprite.gotoAndPlay("default");
if (_local10 == 0) {
gameElements[doorsAr[_local19].mcs[_local10]].sprite.endvars = {func:"gotoLevel", ob:this, ar:[doorsAr[_local19].leadsto]};
if (doorsAr[_local19].sfx != undefined) {
sfxEngine.startSound(doorsAr[_local19].sfx, doorsAr[_local19].tile[0].x, doorsAr[_local19].tile[0].y);
}
}
}
_local10++;
}
}
}
var _local3 = (("mp_" + ob.tile.y) + "_") + ob.tile.x;
if (dynamicObsMap[_local3] != undefined) {
v.x = ob.x;
v.y = ob.y;
var _local24 = {x:0, y:0};
var _local2 = 0;
while (_local2 < dynamicObsMap[_local3].length) {
var _local13;
for (var _local19 in dynamicObsMap[_local3][_local2]) {
if (_local19 == "clipref") {
_local13 = dynamicObsMap[_local3][_local2][_local19];
}
}
if (dynamicObsMap[_local3][_local2].state == "enabled") {
var _local7 = "";
var _local11 = "";
var _local12 = false;
var _local14 = false;
var _local4 = 0;
while (_local4 < dynamicObsMap[_local3][_local2].actions.length) {
if (dynamicObsMap[_local3][_local2].actions[_local4].playeraction != undefined) {
if ((dynamicObsMap[_local3][_local2].actiondirection == pchar.__get__direction()) || (dynamicObsMap[_local3][_local2].actiondirection == undefined)) {
_local7 = dynamicObsMap[_local3][_local2].actions[_local4].playeraction;
_local11 = dynamicObsMap[_local3][_local2].actions[_local4].actionDescription;
if (dynamicObsMap[_local3][_local2].actions[_local4].damage != undefined) {
actionEndDamage = dynamicObsMap[_local3][_local2].actions[_local4].damage;
}
if (dynamicObsMap[_local3][_local2].actions[_local4].obremove == "yes") {
_local12 = true;
}
if (dynamicObsMap[_local3][_local2].actions[_local4].hideonaction == "yes") {
_local14 = true;
}
}
_local24 = dynamicObsMap[_local3][_local2].actions[_local4].actionDepth;
}
_local4++;
}
if (_local7 == "blowDie") {
if (levelDataAr[curlevel].getFlag("isFlooded")) {
_local7 = "electrocute";
} else {
_local7 = "";
_local11 = "";
actionEndDamage = 0;
_local12 = false;
_local14 = false;
return("");
}
}
if (_local7 == "actionumbrella") {
levelDataAr[curlevel].setFlag("isUmbrellaReady", true);
updateMapComboItems("umbrellaIndicator");
}
if (_local7 != "") {
if (_local12) {
removeDecal([dynamicObsMap[_local3][_local2].decal]);
delete dynamicObsMap[_local3][_local2];
}
if (_local14) {
removeDecal([dynamicObsMap[_local3][_local2].decal]);
}
actionEndFunc = doActionResult;
actionName = _local7;
actionDesc = _local11;
charLastOb = {ctrlr:dynamicObsMap[_local3][_local2], view:_local13};
return({resp:_local7, name:"", actionDepth:_local24});
}
if (dynamicObsMap[_local3][_local2].invbool) {
var _local18 = dynamicObsMap[_local3][_local2].name;
oemManager.setTimeout(this, "removeDecal", 0.4, [dynamicObsMap[_local3][_local2].decal], 1);
if ((myinventory != "") && (myinventory != undefined)) {
dynamicObsMap[_local3][_local2].name = myinventory;
} else {
delete dynamicObsMap[_local3][_local2];
}
updateMapComboItems(_local18);
return({resp:"inventory", name:_local18});
}
if ((dynamicObsMap[_local3][_local2].actiondirection == pchar.__get__direction()) || (dynamicObsMap[_local3][_local2].actiondirection == undefined)) {
gameElements["mapitem" + gameMap[v.y][v.x].numb][dynamicObsMap[_local3][_local2].mcid].sprite.gotoAndPlay("default");
updateMapComboItems(dynamicObsMap[_local3][_local2].name);
return({resp:"action", name:dynamicObsMap[_local3][_local2].name});
}
}
_local2++;
}
}
if (checkNotWall(v, ob)) {
_local3 = (("mp_" + v.y) + "_") + v.x;
if (dynamicObsMap[_local3] != undefined) {
var _local2 = 0;
while (_local2 < dynamicObsMap[_local3].length) {
if (dynamicObsMap[_local3][_local2].state == "enabled") {
var _local7 = "";
var _local11 = "";
var _local9 = "";
var _local12 = false;
var _local14 = false;
var _local15 = false;
var _local24 = {x:0, y:0};
var _local4 = 0;
while (_local4 < dynamicObsMap[_local3][_local2].actions.length) {
if ((dynamicObsMap[_local3][_local2].actions[_local4].inventory == myinventory) || (dynamicObsMap[_local3][_local2].actions[_local4].inventory == undefined)) {
_local9 = dynamicObsMap[_local3][_local2].actions[_local4].objectaction;
if (dynamicObsMap[_local3][_local2].actions[_local4].playeraction != undefined) {
if ((dynamicObsMap[_local3][_local2].actiondirection == pchar.__get__direction()) || (dynamicObsMap[_local3][_local2].actiondirection == undefined)) {
_local7 = dynamicObsMap[_local3][_local2].actions[_local4].playeraction;
_local11 = dynamicObsMap[_local3][_local2].actions[_local4].actionDescription;
if (dynamicObsMap[_local3][_local2].actions[_local4].damage != undefined) {
actionEndDamage = dynamicObsMap[_local3][_local2].actions[_local4].damage;
}
if (dynamicObsMap[_local3][_local2].actions[_local4].obremove == "yes") {
_local12 = true;
}
if (dynamicObsMap[_local3][_local2].actions[_local4].hideonaction == "yes") {
_local14 = true;
}
if (dynamicObsMap[_local3][_local2].actions[_local4].clearsquare == "yes") {
_local15 = true;
}
if (dynamicObsMap[_local3][_local2].actions[_local4].inventory == pchar.__get__inventory()) {
pchar.addToInventory("");
}
_local24 = dynamicObsMap[_local3][_local2].actions[_local4].actionDepth;
}
}
if (dynamicObsMap[_local3][_local2].actions[_local4].sfx != undefined) {
sfxEngine.startSound(dynamicObsMap[_local3][_local2].actions[_local4].sfx, pchar.__get__tile().x, pchar.__get__tile().y);
}
}
_local4++;
}
if (_local7 != "") {
if (_local12) {
oemManager.setTimeout(this, "removeSub", 0.1, [dynamicObsMap[_local3][_local2].mcid, gameMap[v.y][v.x].numb, ""], 1);
delete dynamicObsMap[_local3][_local2];
}
if (_local14) {
gameElements["mapitem" + gameMap[v.y][v.x].numb][dynamicObsMap[_local3][_local2].mcid].sprite._visible = false;
}
if (_local15) {
clearMapSquare(v.y, v.x);
}
if (_local7 == "pinata") {
pchar.__set__pinata(true);
initiatePinataAttack();
return("");
}
actionEndFunc = doActionResult;
actionName = _local7;
actionDesc = _local11;
charLastOb = {ctrlr:dynamicObsMap[_local3][_local2], view:gameElements["mapitem" + gameMap[v.y][v.x].numb][dynamicObsMap[_local3][_local2].mcid].sprite};
return({resp:_local7, name:"", actionDepth:_local24});
}
if (dynamicObsMap[_local3][_local2].invbool) {
var _local18 = dynamicObsMap[_local3][_local2].name;
oemManager.setTimeout(this, "removeSub", 0.4, [dynamicObsMap[_local3][_local2].mcid, gameMap[v.y][v.x].numb, myinventory], 1);
if ((myinventory != "") && (myinventory != undefined)) {
dynamicObsMap[_local3][_local2].name = myinventory;
} else {
delete dynamicObsMap[_local3][_local2];
}
updateMapComboItems(_local18);
return({resp:"inventory", name:_local18});
}
if ((dynamicObsMap[_local3][_local2].actiondirection == pchar.__get__direction()) || (dynamicObsMap[_local3][_local2].actiondirection == undefined)) {
if ((myinventory != "") && (myinventory != undefined)) {
if ((dynamicObsMap[_local3][_local2].name == "microwave") && (myinventory == "metalobject1")) {
var _local22 = getActionForObject(dynamicObsMap[_local3][_local2].name);
gameElements["mapitem" + gameMap[v.y][v.x].numb][dynamicObsMap[_local3][_local2].mcid].sprite.gotoAndPlay("explode");
gameElements["mapitem" + gameMap[v.y][v.x].numb][dynamicObsMap[_local3][_local2].mcid].sprite.endvars = {func:"doExplode", ob:this, ar:[gameElements["mapitem" + gameMap[v.y][v.x].numb]._x, gameElements["mapitem" + gameMap[v.y][v.x].numb]._y, v.x, v.y, gameElements["mapitem" + gameMap[v.y][v.x].numb][dynamicObsMap[_local3][_local2].mcid].sprite, dynamicObsMap[_local3][_local2]]};
clearMapComboItems();
dynamicObsMap[_local3][_local2].state = "broken";
return({resp:"inventory", name:""});
}
} else if (dynamicObsMap[_local3][_local2].name != "microwave") {
var _local8 = "default";
if (_local9 != undefined) {
_local8 = _local9;
}
if (_local8 != "default") {
dynamicObsMap[_local3][_local2].state = _local9;
}
gameElements["mapitem" + gameMap[v.y][v.x].numb][dynamicObsMap[_local3][_local2].mcid].sprite.gotoAndPlay(_local8);
if ((_local8 == "alarm") && (!levelDataAr[curlevel].getFlag("hasWeaseled"))) {
levelDataAr[curlevel].setFlag("hasWeaseled", true);
initiateWeaselAttack();
dynamicObsMap[_local3][_local2].state = "broken";
return({resp:"action", name:""});
}
if (_local8 == "flood") {
gameElements["mapitem" + gameMap[v.y][v.x].numb][dynamicObsMap[_local3][_local2].mcid].sprite.endvars = {func:"floodBathroom", ob:this, ar:[v.x, v.y]};
} else {
gameElements["mapitem" + gameMap[v.y][v.x].numb][dynamicObsMap[_local3][_local2].mcid].sprite.endvars = undefined;
}
updateMapComboItems(dynamicObsMap[_local3][_local2].name);
return({resp:"action", name:dynamicObsMap[_local3][_local2].name});
}
} else {
trace("SATISFIED NO CONDITIONS " + dynamicObsMap[_local3][_local2].actiondirection);
}
}
_local2++;
}
}
var _local10 = 0;
while (_local10 < charAr.length) {
if ((charAr[_local10].tile.x == v.x) && (charAr[_local10].tile.y == v.y)) {
if (initiateConversation(ob, charAr[_local10], (ob.direction + 2) % 4)) {
return({resp:"conversation", name:""});
}
return("");
}
_local10++;
}
}
return("");
}
function startConvoWithPlayer(ob) {
if (pchar.isInConversation) {
return(undefined);
}
var _local5 = pchar.__get__position().x - ob.position.x;
var _local4 = pchar.__get__position().y - ob.position.y;
var _local8 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
var _local6 = Math.atan2(_local4, _local5);
var _local3 = (720 + ((_local6 * 180) / Math.PI)) % 360;
var _local7 = ob.direction;
if ((_local3 < 45) || (_local3 > 315)) {
ob.direction = 0;
} else if (_local3 < 135) {
ob.direction = 1;
} else if (_local3 < 215) {
ob.direction = 2;
} else {
ob.direction = 3;
}
initiateConversation(pchar, ob, ob.direction);
}
function getActionForObject(s) {
for (var _local3 in objectDynDefs) {
if (s == _local3) {
if ((objectDynDefs[_local3].actions != undefined) && (objectDynDefs[_local3].actions.length > 0)) {
var _local2 = 0;
while (_local2 < objectDynDefs[_local3].actions.length) {
_local2++;
}
}
}
}
return(null);
}
function getObjectsAround(v) {
var _local4 = 0;
while (_local4 < ary_four.length) {
var _local5 = ary_four[_local4].x + v.x;
var _local6 = ary_four[_local4].y + v.y;
var _local3 = (("mp_" + _local6) + "_") + _local5;
if (dynamicObsMap[_local3] != undefined) {
var _local7 = ((_local5 + ", ") + _local6) + ":: ";
var _local2 = 0;
while (_local2 < dynamicObsMap[_local3].length) {
_local7 = _local7 + (dynamicObsMap[_local3][_local2].name + " | ");
_local2++;
}
}
_local4++;
}
}
function playMuttering(nm, s, v) {
return(undefined);
}
function updateMutteringPosition(n, v) {
}
function registerSoundCtrlr(ob, n) {
return(false);
}
function stopMuttering(n) {
return(0);
}
function getExit(pos, s) {
if (s == "random") {
var _local8 = Math.floor(Math.random() * doorsAr.length);
return({pos:doorsAr[_local8].tile, doorcode:doorsAr[_local8].doorcode});
}
if (s == "closest") {
var _local5 = {pos:new com.wis.math.alg.Vector(0, 0), d:99999, doorcode:""};
for (var _local6 in doorsAr) {
var _local4 = doorsAr[_local6].tile[0].x - pos.x;
var _local3 = doorsAr[_local6].tile[0].y - pos.y;
var _local2 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if (_local2 < _local5.d) {
_local5 = {pos:doorsAr[_local6].tile[0], d:_local2, doorcode:doorsAr[_local6].doorcode};
}
}
return({pos:_local5.pos, doorcode:_local5.doorcode});
}
var _local5 = {pos:new com.wis.math.alg.Vector(0, 0), d:99999, doorcode:""};
_local5 = {pos:doorsAr[s].tile[0], d:_local2, doorcode:doorsAr[s].doorcode};
if (_local5.d != 99999) {
return({pos:_local5.pos, doorcode:_local5.doorcode});
}
return(undefined);
}
function clipAnimationDone(eventObj) {
if (eventObj.ctrlr.typeOf == "PlayerCharacter") {
if (actionEndFunc != undefined) {
actionEndFunc(eventObj.state);
} else {
doActionResult(eventObj.state);
}
}
oemManager.setFrameTimeout(this, "triggerEndAction", 1, [eventObj.ctrlr], 1);
}
function triggerEndAction(args) {
args[0].endAction();
}
function doActionResult(s) {
pchar.health = pchar.health - actionEndDamage;
if (actionName == "scissors") {
gameElements[pchar.getClip()].addDecal("clipChest", "l_decalScissors", new com.wis.math.alg.Vector(10, 13));
}
if (s == "onfire") {
gameElements[pchar.getClip()].burn = true;
actionDesc = "NUKED";
pchar.health = pchar.health - 18;
}
if (s.substr(0, 12) == "flamethrower") {
gameElements[pchar.getClip()].torsoburn = true;
}
if (s.substr(0, 6) == "staple") {
gameElements[pchar.getClip()].addDecal("clipHead", "l_decalBlood", new com.wis.math.alg.Vector(4, 0));
gameElements[pchar.getClip()].addDecal("clipLeftArmUpper", "l_decalBlood", new com.wis.math.alg.Vector(0, 2));
}
if (s.substr(0, 11) == "copymachine") {
charLastOb.ctrlr.state = "disabled";
charLastOb.view.sprite.gotoAndPlay("disabled");
charLastOb.view._visible = true;
bloodyTheHead(3);
bloodyTheBody(7);
}
if (s.substr(0, 8) == "shredder") {
charLastOb.ctrlr.state = "disabled";
charLastOb.view._visible = true;
bloodyTheHead(4);
bloodyTheBody(7);
}
if (s.substr(0, 11) == "electrocute") {
charLastOb.ctrlr.state = "disabled";
hasBeenElectrocuted = true;
}
if (s.substr(0, 10) == "clownstall") {
charLastOb.ctrlr.state = "disabled";
charLastOb.view.sprite.gotoAndPlay("disabled");
charLastOb.view._visible = true;
bloodyTheHead(4);
bloodyTheBody(7);
}
if (s.substr(0, 6) == "urinal") {
charLastOb.ctrlr.state = "disabled";
charLastOb.view.sprite.sprite.gotoAndPlay("disabled");
gameElements[pchar.getClip()].sick = true;
}
if (s.substr(0, 7) == "urinate") {
charLastOb.ctrlr.state = "disabled";
}
if (s.substr(0, 6) == "bucket") {
charLastOb.ctrlr.state = "disabled";
charLastOb.view.sprite.gotoAndPlay("disabled");
charLastOb.view._visible = true;
gameElements[pchar.getClip()].sick = true;
}
if ((mgrActionSequence != undefined) && (mgrActionSequence.__get__goodToGo())) {
releaseCoordinatedManeuver();
}
}
function bloodyTheHead(n) {
var _local2 = 0;
while (_local2 < n) {
var _local4 = Math.floor(Math.random() * 20);
var _local3 = Math.floor(Math.random() * 20);
gameElements[pchar.getClip()].addDecal("clipHeadMasked", "l_decalBloodBuild", new com.wis.math.alg.Vector(_local4, _local3));
_local2++;
}
}
function bloodyTheBody(n) {
var _local2 = 0;
while (_local2 < n) {
var _local4 = Math.floor(Math.random() * 20);
var _local3 = Math.floor(Math.random() * 20);
gameElements[pchar.getClip()].addDecal("clipChestMasked", "l_decalBloodBuild", new com.wis.math.alg.Vector(_local4, _local3));
_local2++;
}
}
function clipStateChange(eventObj) {
var _local3 = gameElements[eventObj.sprite].sprite;
if (gameElements[eventObj.sprite].state != eventObj.state) {
gameElements[eventObj.sprite].setState(eventObj.state);
}
if (_local3.frameAction != undefined) {
_local3.frameAction();
}
if (gameElements[eventObj.sprite].ctrlr.typeOf == "PlayerCharacter") {
_local3.attachDecal();
gameElements[eventObj.sprite].attachDecal();
}
}
function positionChange(eventObj) {
var _local6 = eventObj.target;
if (_local6.typeOf == "PlayerCharacter") {
if (gameMap[_local6.tile.y][_local6.tile.x].landMine) {
var _local5 = gameMap[_local6.tile.y][_local6.tile.x].landMineOrders.split("|");
var _local4 = new Object();
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split(":");
_local4[_local3[0]] = _local3[1];
_local2++;
}
switch (_local4.trigger) {
case "inventory" :
if (pchar.__get__inventory() == _local4.parameter) {
setOffLandMine(_local4.result);
}
break;
case "flag" :
trace(levelDataAr[curlevel].getFlag(_local4.parameter) + " PARAMETER");
if (levelDataAr[curlevel].getFlag(_local4.parameter)) {
setOffLandMine(_local4.result);
}
break;
}
}
}
}
function setOffLandMine(val) {
switch (val) {
case "sharkAttack" :
clearMapComboItems();
performSharkAttack();
break;
case "umbrella" :
if (!levelDataAr[curlevel].getFlag("hasUmbrellad")) {
levelDataAr[curlevel].setFlag("hasUmbrellad", true);
clearMapComboItems();
pchar.setState("umbrellaeast");
gameElements[pchar.getClip()].addDecal("clipChest", "l_decalBlood", new com.wis.math.alg.Vector(6, 10));
pchar.health = pchar.health - 18;
}
break;
}
}
function performSharkAttack() {
pchar.__set__interactFlag(true);
oemManager.setFrameTimeout(this, "makeCharacterDisappear", 19, [this], 1);
var _local2 = 0;
while (_local2 < floorObArray.length) {
if (floorObArray[_local2].id == "aquarium") {
floorObArray[_local2].clip.sprite.endvars = {func:"releaseSharkAttack", ob:this, ar:[this]};
floorObArray[_local2].clip.sprite.gotoAndPlay("sharkhit");
currentActionObject = floorObArray[_local2].clip;
oemManager.register(this, "updateSharkClothes");
unwalkSharkFloor();
return(undefined);
}
_local2++;
}
}
function unwalkSharkFloor() {
var _local3 = 6;
while (_local3 <= 9) {
var _local2 = 6;
while (_local2 <= 11) {
gameMap[_local3][_local2].isEmpty = false;
gameMap[_local3][_local2].walkable = false;
deleteWeaselsOnSquare(_local2, _local3);
_local2++;
}
_local3++;
}
}
function updateSharkClothes() {
var _local4 = gameBoardOverlay.fo0.sprite.sprite;
var _local3 = new Array("mcShirtLight", "mcShirtDark", "mcPantsLight", "mcPantsDark", "mcHairLight", "mcHairDark", "mcTie");
var _local2 = 0;
while (_local2 < _local3.length) {
if (_local4[_local3[_local2]].c == undefined) {
_local4[_local3[_local2]].c = new Color(_local4[_local3[_local2]]);
if (pchar.__get__aColor()[_local2] != undefined) {
_local4[_local3[_local2]].c.setRGB(pchar.__get__aColor()[_local2]);
}
}
_local4[_local3[_local2]]._alpha = 100;
_local4[_local3[_local2]]._visible = true;
_local2++;
}
}
function releaseSharkAttack() {
oemManager.deleteOEF(this, "updateSharkClothes");
pchar.__set__interactFlag(false);
pchar.__set__visible(true);
actionDesc = "WITH LASERS...";
pchar.health = pchar.health - 20;
levelDataAr[curlevel].setFlag("hasSharked", true);
}
function deleteWeaselsOnSquare(x, y) {
var _local3;
var _local2 = 0;
while (_local2 < charAr.length) {
if ((charAr[_local2].tile.x == x) && (charAr[_local2].tile.y == y)) {
_local3 = charAr[_local2];
break;
}
_local2++;
}
if (_local3 != undefined) {
removeCharacterByReference(_local3);
}
}
function makeCharacterDisappear() {
currentActionObject = undefined;
pchar.__set__visible(false);
pchar.addToInventory("");
}
function propChange(eventObj) {
gameElements[eventObj.sprite].sprite.gotoAndPlay(eventObj.state);
if (eventObj.prop == "health") {
if (eventObj.oldval != 0) {
var _local3 = gameElements[eventObj.sprite].getNextHighestDepth();
gameElements[pchar.getClip()].attachMovie("l_damageIndicator", "di" + _local3, _local3, {_x:0, _y:-120});
gameElements[pchar.getClip()]["di" + _local3].init(12288, 3145728, eventObj.oldval, actionDesc);
}
gameHUD.health = eventObj.val;
if (pchar.__get__health() <= 0) {
trace("YOU'VE WON");
gameWin();
return(undefined);
}
}
}
function objectifyObjects() {
var _local4 = 0;
while (_local4 < configob.objectprops.object.length) {
var _local3 = configob.objectprops.object[_local4];
var _local8 = new Array();
objectDefs[_local3.id] = translatePipedCoordsToArray(_local3.occupancy);
_local4++;
}
var _local7 = [configob.subobjects.subobject, configob.decals.decal];
var _local6 = 0;
while (_local6 < _local7.length) {
var _local5 = unknownToArray(_local7[_local6]);
_local4 = 0;
while (_local4 < _local5.length) {
var _local3 = _local5[_local4];
var _local2 = new Object();
if (_local3.actionable == "true") {
_local2.actionable = true;
} else {
_local2.actionable = false;
}
if (_local3.invbool == "true") {
_local2.invbool = true;
} else {
_local2.invbool = false;
}
_local2.occupancy = _local3.occupancy;
_local2.playeraction = _local3.playeraction;
_local2.obremove = _local3.obremove;
_local2.actions = processObjectActions(unknownToArray(_local3.actions.action));
_local2.combos = processObjectCombos(unknownToArray(_local3.combos.combo));
_local2.landmine = ((_local3.landmine == "true") ? true : false);
if (_local2.landmine) {
_local2.landmineOrders = _local3.landmineOrders;
}
if (_local3.actiondirection != undefined) {
_local2.actiondirection = parseInt(_local3.actiondirection);
}
objectDynDefs[_local3.id] = _local2;
_local4++;
}
_local6++;
}
}
function processObjectActions(ob) {
if (ob == undefined) {
return(new Array());
}
var _local19 = new Array();
var _local1 = 0;
while (_local1 < ob.length) {
var _local3 = {x:0, y:0};
if ((ob[_local1].actionDepth != undefined) && (ob[_local1].actionDepth.indexOf(",") > 0)) {
var _local4 = ob[_local1].actionDepth.split(",");
_local3.x = parseInt(_local4[0]);
_local3.y = parseInt(_local4[1]);
}
_local19.push({id:ob[_local1].id, damage:ob[_local1].damage, sfx:ob[_local1].sfx, sfxframe:ob[_local1].sfxframe, objectaction:ob[_local1].objectaction, playeraction:ob[_local1].playeraction, obremove:ob[_local1].obremove, hideonaction:ob[_local1].hideonaction, actionDescription:ob[_local1].actionDescription, inventory:ob[_local1].inventory, actionDepth:_local3, clearsquare:ob[_local1].clearsquare});
_local1++;
}
return(_local19);
}
function giveCharacterOrders(s, t, st, aDesc) {
if (st == undefined) {
var _local2 = 0;
while (_local2 < charAr.length) {
if (charAr[_local2].typeOf != "PlayerCharacter") {
charAr[_local2].initScriptedSeeker(s);
}
_local2++;
}
} else {
var _local2 = 0;
while (_local2 < charAr.length) {
if ((charAr[_local2].typeOf != "PlayerCharacter") && (charAr[_local2].subTypeOf == st)) {
charAr[_local2].initScriptedSeeker(s);
charAr[_local2].attackName = aDesc;
}
_local2++;
}
}
}
function processObjectCombos(ob) {
if (ob == undefined) {
return(new Array());
}
var _local5 = new Array();
var _local1 = 0;
while (_local1 < ob.length) {
_local5.push({id:ob[_local1].id, action:ob[_local1].action});
_local1++;
}
return(_local5);
}
function hideShowMap(eventObj) {
if (eventObj.ar == 77) {
gameHUD.show = (gameHUD.show ? false : true);
if (gameHUD.show) {
if ((pchar.__get__inventory() != undefined) && (pchar.__get__inventory() != "")) {
setMapComboHint(objectDynDefs[pchar.__get__inventory()].combos[0].id);
} else if (levelDataAr[curlevel].getFlag("isFlooded") && (!hasBeenElectrocuted)) {
setMapComboHint("handDryer");
} else if (levelDataAr[curlevel].getFlag("isUmbrellaReady") && (!levelDataAr[curlevel].getFlag("hasUmbrellad"))) {
setMapComboHint("umbrellaIndicator");
} else {
setMapComboHint("default");
}
}
}
}
function getTimeAsPercent() {
return((100 * (endTime - getTimer())) / gameTime);
}
function getTimeFormatted(n) {
var _local1 = 0;
var _local4 = 0;
n = Math.floor(n / 1000);
_local1 = Math.floor(n % 60);
_local4 = Math.floor(n / 60);
var _local2 = "";
_local2 = _local4.toString() + ":";
if (_local1 < 10) {
_local2 = _local2 + ("0" + _local1.toString());
} else {
_local2 = _local2 + _local1.toString();
}
return(_local2);
}
function updateClock() {
var _local3 = 0;
var _local2 = 0;
var _local5 = 0;
var _local4 = Math.floor((endTime - getTimer()) / 1000);
_local2 = Math.floor(_local4 % 60);
_local5 = Math.floor(_local4 / 60);
_local4 = Math.floor((endTime - getTimer()) / 10);
_local3 = Math.floor(_local4 % 100);
if (_local2 < 10) {
mcClock.txtSeconds.text = "0" + _local2;
} else {
mcClock.txtSeconds.text = _local2;
}
if (_local5 < 10) {
mcClock.txtMinutes.text = "0" + _local5;
} else {
mcClock.txtMinutes.text = _local5;
}
if (_local3 < 10) {
mcClock.txtHundredths.text = "0" + _local3;
} else {
mcClock.txtHundredths.text = _local3;
}
}
function updateActionableIndicators() {
for (var _local8 in dynamicObsMap) {
var _local2 = 0;
while (_local2 < dynamicObsMap[_local8].length) {
var _local4 = dynamicObsMap[_local8][_local2];
var _local3 = _local4.mcclip[dynamicObsMap[_local8][_local2].mcid].mcActionIndicator;
if (dynamicObsMap[_local8][_local2].state == "enabled") {
var _local6 = _local4.position.x - pchar.__get__position().x;
var _local5 = _local4.position.y - pchar.__get__position().y;
var _local7 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
if (_local7 < 5) {
_local3._visible = true;
_local3._xscale = (_local3._yscale = 100 - ((100 * _local7) / 5));
} else {
_local3._visible = false;
}
} else {
_local3._visible = false;
}
_local2++;
}
}
}
function stopAllClips(m) {
for (var _local3 in m) {
if (m[_local3]._visible) {
m[_local3].stop();
stopAllClips(m[_local3]);
}
}
}
function stopAllCharClips() {
var _local2 = 0;
while (_local2 < charAr.length) {
_local2++;
}
}
function gameWin() {
pchar.__set__pinata(false);
winTime = Math.abs(getTimer() - endTime);
clearOutAll();
gameState = "win";
storePlayerDecals();
radioStationMgr.stopClip();
stopAllClips(gameElements);
gameElements.attachMovie("l_whiteBox", "mcFader", gameElements.getNextHighestDepth());
gameElements.mcFader._x = -gameElements._x;
gameElements.mcFader._y = -gameElements._y;
gameElements.mcFader._width = gameElements._width;
gameElements.mcFader._height = gameElements._height;
gameElements.mcFader._alpha = 0;
var _local2 = new mx.transitions.Tween(gameElements.mcFader, "_alpha", mx.transitions.easing.Regular.easeOut, 0, 100, 3, true);
gameElements.charSprite0._visible = true;
gameElements.createEmptyMovieClip("dummy", gameElements.getNextHighestDepth());
gameElements.charSprite0.swapDepths(gameElements.dummy);
oemManager.deleteAll();
oemManager.register(this, "updateCharWinClothes");
oemManager.register(this, "updateCharacterMasks");
oemManager.setTimeout(this, "gameWinPartTwo", 0.2, [this], 1);
}
function gameWinPartTwo() {
actionEndFunc = null;
gameElements.charSprite0.sprite.gotoAndPlay("beatdownsouth");
gameElements.charSprite0.sprite.sprite.receiver = this;
gameElements.charSprite0.sprite.sprite.onEnterFrame = function () {
if (this._currentframe >= 55) {
this.receiver.gameWinPartThree();
this.stop();
delete this.onEnterFrame;
}
};
}
function gameWinPartThree() {
sfxWin.start(0, 1);
oemManager.setTimeout(this, "gameWinPartFour", 0.05, [this], 50);
}
function gameWinPartFour() {
gameHUD._alpha = gameHUD._alpha - 5;
gameElements.charSprite0._alpha = gameElements.charSprite0._alpha - 5;
gameElements.charSprite0._y = gameElements.charSprite0._y - 4;
if (gameElements.charSprite0._alpha <= 0) {
oemManager.deleteTO(this, "gameWinPartFour");
gameWinPartFive();
}
}
function gameWinPartFive() {
trace("PART FIVE!");
gameHUD.removeMovieClip();
createEmptyMovieClip("mcEndSeq", getNextHighestDepth());
var _local2 = "deathSequence.swf?percentDead=100&timePassed=" + getTimeFormatted(winTime);
trace(_local2);
mcEndSeq.loadMovie(_local2);
oemManager.deleteAll();
oemManager.register(this, "loadPlayerIntoWin");
oemManager.register(this, "updateLoseCharClothes");
}
function loadPlayerIntoWin() {
if (mcEndSeq.charSprite != undefined) {
trace("LOAD PLAYER INTO WIN!");
gameElements.removeMovieClip();
mcEndSeq.charSprite.createEmptyMovieClip("sprite", 1);
mcEndSeq.charSprite.sprite.loadMovie("character_player.swf");
redoPlayerDecals(mcEndSeq.charSprite);
oemManager.deleteOEF(this, "loadPlayerIntoWin");
oemManager.register(this, "makeWinPlayerWalk");
}
}
function gameLose() {
clearOutAll();
gameState = "lose";
storePlayerDecals();
radioStationMgr.stopClip();
stopAllClips(gameElements);
oemManager.deleteOEF(this, "mainLoop");
createEmptyMovieClip("mcEndSeq", getNextHighestDepth());
var _local2 = ("endMeeting.swf?percentDead=" + (100 - pchar.__get__health())) + "&timePassed=0:00";
trace(_local2);
mcEndSeq.loadMovie(_local2);
oemManager.register(this, "updateCharacterMasks");
oemManager.setTimeout(this, "loadPlayerIntoLose", 0.5, [this], 1);
oemManager.setTimeout(this, "makeWinPlayerWalk", 0.2, [this], 1);
}
function loadPlayerIntoLose() {
mcEndSeq.charSprite.sprite.loadMovie("character_player.swf");
redoPlayerDecals(mcEndSeq.charSprite);
oemManager.register(this, "updateLoseCharClothes");
oemManager.register(this, "updateCharacterMasks");
}
function makeWinPlayerWalk() {
mcEndSeq.charSprite.sprite.gotoAndStop("walksouth");
}
function updateCharWinClothes() {
gameElements.charSprite0.ctrlr = pchar;
gameElements.charSprite0.frameAction();
}
function updateLoseCharClothes() {
var _local3 = mcEndSeq.charSprite.sprite;
var _local2 = mcEndSeq.charSprite;
if (_local2 != undefined) {
if (_local3.__proto__ != com.doodlehead.actors.CharacterSubSprite.prototype) {
_local3.__proto__ = com.doodlehead.actors.CharacterSubSprite.prototype;
com.doodlehead.actors.CharacterSubSprite.apply(_local3, ["george mcgovern"]);
}
_local2.ctrlr = pchar;
_local2.frameAction();
}
}
function initiateConversation(ch1, ch2, d) {
var _local4 = new Object();
var _local5 = "";
convoEndAction = "";
if (ch1.interactFlag || (ch2.interactFlag)) {
trace("stop con at the start");
stopCon();
return(undefined);
}
if ((ch1.dialogfile == undefined) && (ch2.dialogfile == undefined)) {
trace("dialogue file undefined, stop con");
stopCon();
return(undefined);
}
if (convoAr[curConvo.ch1] != undefined) {
_local4 = convoAr[curConvo.ch1];
_local5 = ch2.name;
} else {
_local4 = convoAr[curConvo.ch2];
_local5 = ch1.name;
}
if (!(ch1.dontDisturb || (ch2.dontDisturb))) {
curConvo.ch0 = ch1;
curConvo.ch1 = ch2;
ch1.startConversation((d + 2) % 4);
ch2.startConversation(d);
gameHUD.mcConvo.show(pchar.__get__direction());
endConvoFlag = false;
if (_local4 != undefined) {
xmlConvoLoaded({ar:{dialogue:convoAr[ch2.name]}, goodload:true});
} else {
if (ch1.dialogfile != undefined) {
xparser = new com.doodlehead.xml.XMLLoader(ch1.dialogfile);
} else if (ch2.dialogfile != undefined) {
xparser = new com.doodlehead.xml.XMLLoader(ch2.dialogfile);
}
convoListenerID = xparser.addEventListener("xmlLoadedAndParsed", mx.utils.Delegate.create(this, xmlConvoLoaded));
xparser.doLoad();
}
}
}
function endConversation() {
trace("end conversation");
curConvo = {};
gameHUD.mcConvo.show();
}
function xmlConvoLoaded(eventObj) {
if (eventObj.goodload) {
mycon = new com.doodlehead.dialoguer.Conversationer(eventObj.ar.dialogue, this);
convoAr[curConvo.ch1] = eventObj.ar.dialogue;
xparser.removeEventListener(convoListenerID);
delete xparser;
startCon();
} else {
xparser.removeEventListener(convoListenerID);
trace("ERROR XMLCONVOLOADED");
stopCon();
}
}
function doNextResponse(eventObj) {
if ((pchar.isInConversation && (isReadyForResponse)) && (balloonDoneGrowing)) {
if ((eventObj.ar == 32) && (isReadyForResponse)) {
isReadyForResponse = false;
balloonDoneGrowing = false;
convoEndAction = "";
var _local4 = gameHUD.mcConvo.currentResponse;
if (_local4 == undefined) {
trace("N IS UNDEFINED EXIT");
return(undefined);
}
var _local2 = mycon.doResponseOb(_local4, curConvo.ch1.attitude);
if ((((_local2.response == undefined) || (_local2.response == "")) || (_local2.rtext == undefined)) || (_local2.rtext == "")) {
trace("response undefined, stop con");
stopCon();
} else {
var _local3 = _local2.rtext;
convoShowResponse(_local3);
var _local5 = curConvo.ch1.sbubblec;
gameHUD.mcConvo.setResponses([_local3], _local5, false);
if (balloonListenerID != null) {
gameHUD.mcConvo.removeEventListener(balloonListenerID);
}
balloonListenerID = gameHUD.mcConvo.addEventListener("doneGrowing", mx.utils.Delegate.create(this, balloonDone));
if (_local2.continue == true) {
endConvoFlag = false;
} else {
endConvoFlag = true;
}
if (_local2.endaction != undefined) {
convoEndAction = _local2.endaction;
}
}
setInputLock(0.2);
} else if (eventObj.ar == 38) {
trace("previous response " + getTimer());
gameHUD.mcConvo.previousResponse();
setInputLock(0.2);
} else if (eventObj.ar == 40) {
trace("next response " + getTimer());
gameHUD.mcConvo.nextResponse();
setInputLock(0.2);
}
}
}
function balloonDone() {
trace("MAIN, BALLOON DONE");
balloonDoneGrowing = true;
}
function stopCon() {
if (convoEndAction != "") {
var _local2;
if (curConvo.ch0.typeOf != "PlayerCharacter") {
_local2 = curConvo.ch0;
} else {
_local2 = curConvo.ch1;
}
if (convoEndAction == "hog") {
trace("HAND OF GOD!!!");
if (!levelDataAr[curlevel].getFlag("hasHandOfGod")) {
trace("DO IT");
initiateCoordinatedManeuver(convoEndAction, _local2);
levelDataAr[curlevel].setFlag("hasHandOfGod", true);
} else {
stopCharCons();
}
} else {
initiateCoordinatedManeuver(convoEndAction, _local2);
}
} else {
stopCharCons();
}
gameHUD.mcConvo.hide();
curConvo = {};
convoDel = new Object();
}
function stopCharCons() {
curConvo.ch0.endConversation();
curConvo.ch1.endConversation();
}
function setInputLock(n) {
isReadyForResponse = false;
oemManager.setTimeout(this, "releaseInputLock", n, [this], 1);
}
function releaseInputLock() {
isReadyForResponse = true;
}
function readyToRespond() {
listNextResponses();
isReadyForResponse = true;
}
function convoShowResponse(s) {
if (s == "") {
stopCon();
} else {
balloonDoneGrowing = false;
isReadyForResponse = false;
var _local2 = s.length / 15;
if (_local2 > 3) {
_local2 = 3;
}
if (_local2 < 1) {
_local2 = 1;
}
if (_local2 == undefined) {
_local2 = 3;
}
sfxEngine.startSound("l_convoSfx", pchar.__get__position().x, pchar.__get__position().y, true, 1);
oemManager.setTimeout(this, "readyToRespond", _local2, [this], 1);
}
}
function startCon() {
var _local2 = mycon.getConvo(curConvo.ch1.attitude);
var _local3 = curConvo.ch1.sbubblec;
gameHUD.mcConvo.setResponses([(mycon.getGreeting(curConvo.ch1.attitude) + " ") + _local2.text], _local3, false);
convoShowResponse(_local2.text);
if (balloonListenerID != null) {
gameHUD.mcConvo.removeEventListener(balloonListenerID);
}
balloonListenerID = gameHUD.mcConvo.addEventListener("doneGrowing", mx.utils.Delegate.create(this, balloonDone));
}
function listNextResponses() {
var _local2 = mycon.getNextResponses();
if (endConvoFlag) {
trace("list next response stop con");
stopCon();
} else {
gameHUD.mcConvo.setResponses(_local2, 14414079, true);
}
}
function dtrace(s) {
trace(s);
}
function mainLoop() {
if (getTimeAsPercent() <= 0) {
gameLose();
return(undefined);
}
inputmgr.checkForInput();
gameHUD.timeLeft = getTimeAsPercent();
updateClock();
amgr.maintainPaths();
hudmap.clearChars();
if (mgrActionSequence != undefined) {
mgrActionSequence.run();
}
var _local2 = 0;
while (_local2 < charAr.length) {
if (_local2 == 0) {
hudmap.drawPlayer(charAr[_local2].tile.x, charAr[_local2].tile.y, "PlayerCharacter");
} else {
hudmap.drawPlayer(charAr[_local2].tile.x, charAr[_local2].tile.y);
}
charAr[_local2].performAction();
gameElements["charSprite" + _local2]._x = translatePosition(charAr[_local2].position.x, charAr[_local2].position.y)._x;
gameElements["charSprite" + _local2]._y = translatePosition(charAr[_local2].position.x, charAr[_local2].position.y)._y;
gameElements["charSprite" + _local2].frameAction();
_local2++;
}
updateActionableIndicators();
charLastPos = new com.wis.math.alg.Vector(charSprite0._x, charSprite0._y);
var _local3 = new com.wis.math.alg.Vector(gameBoard._x, gameBoard._y);
_local3.x = Math.round((((_local3.x * 3) + 300) - gameElements.charSprite0._x) / 4);
_local3.y = Math.round((((_local3.y * 3) + 300) - gameElements.charSprite0._y) / 4);
gameBoard._x = (gameElements._x = (gameBoardOverlay._x = _local3.x));
gameBoard._y = (gameElements._y = (gameBoardOverlay._y = _local3.y));
if (_parent.txtPos != undefined) {
_parent.txtPos.htmlText = (("X: " + pchar.__get__tile().x) + " Y: ") + pchar.__get__tile().y;
}
_local2 = 0;
while (_local2 < charAr.length) {
if (charAr[_local2].state == "") {
if (!($fallFromSky && (_local2 == 0))) {
charAr[_local2].setState("standeast");
}
}
gameElements["charSprite" + _local2].updateClothesColors();
gameElements["charSprite" + _local2].ctrlr = charAr[_local2];
_local2++;
}
updateCharacterMasks();
gameElements.frameAction();
}
function updateCharacterMasks() {
var _local2 = 0;
while (_local2 < charAr.length) {
if (gameState != "play") {
gameElements["charSprite" + _local2].setNoMask();
} else if (checkDivider(charAr[_local2].tile, 2, charAr[_local2].direction, charAr[_local2].position)) {
var _local3 = new com.wis.math.alg.Vector(translatePosition(charAr[_local2].position.x - charAr[_local2].tile.x, charAr[_local2].position.y - charAr[_local2].tile.y)._x, translatePosition(charAr[_local2].position.x - charAr[_local2].tile.x, charAr[_local2].position.y - charAr[_local2].tile.y)._y);
gameElements["charSprite" + _local2].makeMyMask(_local3);
} else {
gameElements["charSprite" + _local2].setNoMask();
}
_local2++;
}
}
}
Symbol 890 MovieClip [__Packages.com.doodlehead.utils.OnEnterFrameMgr] Frame 0
class com.doodlehead.utils.OnEnterFrameMgr
{
var pob, funcAr, timeoutAr, timeoutFrameAr, atCtr, atfCtr, timeoutArToDelete;
function OnEnterFrameMgr (ob) {
pob = ob;
init();
}
function init() {
funcAr = new Array();
timeoutAr = new Array();
timeoutFrameAr = new Array();
atCtr = 0;
atfCtr = 0;
}
function register(ob, f, ar) {
funcAr.push({ob:ob, func:f, arg:ar});
}
function setTimeout(ob, f, t, ar, r) {
timeoutAr.push({ob:ob, func:f, startTime:getTimer(), t:t, arg:ar, ctr:0, ctrmax:r});
atCtr++;
return(atCtr);
}
function setFrameTimeout(ob, f, t, ar, r) {
timeoutFrameAr.push({ob:ob, frctr:0, func:f, startTime:getTimer(), t:t, arg:ar, ctr:0, ctrmax:r});
atfCtr++;
return(atfCtr);
}
function execute() {
cleanUp();
var _local2 = 0;
while (_local2 < funcAr.length) {
if (funcAr[_local2].ob == undefined) {
} else if (funcAr[_local2].arg != undefined) {
funcAr[_local2].ob[funcAr[_local2].func](funcAr[_local2].arg);
} else {
funcAr[_local2].ob[funcAr[_local2].func]();
}
_local2++;
}
timeoutArToDelete = new Array();
_local2 = 0;
while (_local2 < timeoutAr.length) {
var _local4 = getTimer() - timeoutAr[_local2].startTime;
var _local3 = timeoutAr[_local2].t * 1000;
if (_local4 > _local3) {
if (timeoutAr[_local2].arg != undefined) {
timeoutAr[_local2].ob[timeoutAr[_local2].func](timeoutAr[_local2].arg);
} else {
timeoutAr[_local2].ob[timeoutAr[_local2].func]();
}
timeoutAr[_local2].startTime = timeoutAr[_local2].startTime + _local3;
timeoutAr[_local2].ctr++;
}
if (timeoutAr[_local2].ctrmax != undefined) {
if (timeoutAr[_local2].ctr >= timeoutAr[_local2].ctrmax) {
timeoutArToDelete.push({ob:timeoutAr[_local2].ob, func:timeoutAr[_local2].func});
}
}
_local2++;
}
if (timeoutArToDelete.length > 0) {
_local2 = 0;
while (_local2 < timeoutArToDelete.length) {
deleteTO(timeoutArToDelete[_local2].ob, timeoutArToDelete[_local2].func);
_local2++;
}
}
timeoutArToDelete = new Array();
_local2 = 0;
while (_local2 < timeoutFrameAr.length) {
timeoutFrameAr[_local2].frctr++;
if (timeoutFrameAr[_local2].frctr >= timeoutFrameAr[_local2].t) {
if (timeoutFrameAr[_local2].arg != undefined) {
timeoutFrameAr[_local2].ob[timeoutFrameAr[_local2].func](timeoutFrameAr[_local2].arg);
} else {
timeoutFrameAr[_local2].ob[timeoutFrameAr[_local2].func]();
}
timeoutFrameAr[_local2].frctr = 0;
timeoutFrameAr[_local2].ctr++;
}
if (timeoutFrameAr[_local2].ctrmax != undefined) {
if (timeoutFrameAr[_local2].ctr >= timeoutFrameAr[_local2].ctrmax) {
timeoutArToDelete.push({ob:timeoutFrameAr[_local2].ob, func:timeoutFrameAr[_local2].func});
}
}
_local2++;
}
if (timeoutArToDelete.length > 0) {
_local2 = 0;
while (_local2 < timeoutArToDelete.length) {
deleteFrTO(timeoutArToDelete[_local2].ob, timeoutArToDelete[_local2].func);
_local2++;
}
}
}
function clearTimeouts() {
timeoutAr = new Array();
}
function clearOEF() {
funcAr = new Array();
}
function deleteFrTO(ob, f) {
var _local2 = 0;
while (_local2 < timeoutFrameAr.length) {
if ((timeoutFrameAr[_local2].func == f) && (timeoutFrameAr[_local2].ob == ob)) {
timeoutFrameAr.splice(_local2, 1);
deleteTO(f);
break;
}
_local2++;
}
}
function deleteTO(ob, f) {
var _local2 = 0;
while (_local2 < timeoutAr.length) {
if ((timeoutAr[_local2].func == f) && (timeoutAr[_local2].ob == ob)) {
timeoutAr.splice(_local2, 1);
deleteTO(f);
break;
}
_local2++;
}
}
function deleteTOByObject(ob) {
do {
trace("DELETE IT");
} while (deleteTOByObjectSub(ob));
}
function deleteTOByObjectSub(ob) {
var _local2 = 0;
while (_local2 < timeoutAr.length) {
if (timeoutAr[_local2].ob == ob) {
timeoutAr.splice(_local2, 1);
return(true);
}
_local2++;
}
return(false);
}
function deleteAll() {
init();
}
function cleanUp() {
var _local2 = 0;
while (_local2 < funcAr.length) {
if ((funcAr[_local2].func == undefined) && (funcAr[_local2].ob == undefined)) {
funcAr.splice(_local2, 1);
cleanUp();
break;
}
_local2++;
}
}
function deleteOEF(ob, f) {
var _local2 = 0;
while (_local2 < funcAr.length) {
if ((funcAr[_local2].func == f) && (funcAr[_local2].ob == ob)) {
funcAr.splice(_local2, 1);
deleteOEF(f);
break;
}
_local2++;
}
}
}
Symbol 891 MovieClip [__Packages.com.doodlehead.input.InputTranslator] Frame 0
class com.doodlehead.input.InputTranslator extends MovieClip
{
var keysToLookFor, ctr, myListener, dispatchEvent;
function InputTranslator () {
super();
mx.events.EventDispatcher.initialize(this);
keysToLookFor = [];
ctr = 0;
myListener = new Object();
myListener.parent = this;
Key.addListener(myListener);
myListener.onKeyDown = function () {
this.parent.notifyKeyPress();
};
myListener.onKeyUp = function () {
this.parent.notifyKeyRelease();
};
}
function addSet(ar, ob) {
ctr++;
keysToLookFor["s" + ctr] = {ob:ob, keyarray:ar};
return(ctr);
}
function addSetKeyPress(ar, ob) {
return(0);
}
function notifyKeyPress() {
var _local2 = Key.getCode();
dispatchEvent({type:"keyHit", target:this, ar:_local2});
}
function notifyKeyRelease() {
}
function deleteSet(n) {
delete keysToLookFor["s" + n];
}
function checkForInput() {
var _local5 = getKeys();
var _local2 = 0;
while (_local2 < _local5.length) {
dispatchEvent({type:"inputGotten", target:this, receiver:_local5[_local2].ob, ar:_local5[_local2].ar});
_local2++;
}
}
function getKeys() {
var _local6 = new Array();
for (var _local7 in keysToLookFor) {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < keysToLookFor[_local7].keyarray.length) {
if (Key.isDown(keysToLookFor[_local7].keyarray[_local2].kcode)) {
_local3.push(keysToLookFor[_local7].keyarray[_local2].rcode);
}
_local2++;
}
_local6.push({ob:keysToLookFor[_local7].ob, ar:_local3});
}
return(_local6);
}
}
Symbol 892 MovieClip [__Packages.com.doodlehead.dialoguer.Conversationer] Frame 0
class com.doodlehead.dialoguer.Conversationer
{
var mydata, myparent, mylevel, leveldata, __get__level, curnode;
function Conversationer (dataob, ob) {
mydata = dataob;
myparent = ob;
level = (1);
}
function set level(n) {
mylevel = n;
var _local3 = myparent.unknownToArray(mydata.level);
var _local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2].id == String(mylevel)) {
leveldata = _local3[_local2];
return;
}
_local2++;
}
//return(__get__level());
}
function getAppropriateMessage(tarr, n) {
var _local6 = "";
var _local4 = 999;
var _local7 = 1;
var _local5 = new Array();
var _local10 = false;
var _local1 = 0;
while (_local1 < tarr.length) {
var _local2 = Math.abs(n - parseInt(tarr[_local1].level));
if (_local2 <= _local7) {
_local5.push(tarr[_local1].text);
}
if (_local2 < _local4) {
_local4 = _local2;
_local6 = tarr[_local1].text;
}
_local1++;
}
if (_local5.length > 0) {
var _local9 = Math.floor(Math.random() * _local5.length);
return(_local5[_local9]);
}
return(_local6);
}
function getGreeting(n) {
var _local3 = myparent.unknownToArray(leveldata.intros.intro);
var _local2 = getAppropriateMessage(_local3, n);
if (_local2 == undefined) {
_local2 = "";
}
return(_local2);
}
function getGoodbye(n) {
var _local2 = myparent.unknownToArray(leveldata.ends.end);
return(getAppropriateMessage(_local2, n));
}
function getConvo(n) {
var _local3 = myparent.unknownToArray(leveldata.nodes.prompt);
trace((("LENGTH OF TEMP " + _local3.length) + " LENGTH ") + leveldata.nodes.prompt.length);
for (var _local2 in leveldata.nodes.prompt) {
trace((_local2 + ":: ") + leveldata.nodes.prompt[_local2]);
}
var _local4 = Math.floor(Math.random() * _local3.length);
curnode = _local3[_local4];
getNextResponses(curnode.response);
return(curnode);
}
function getNextResponses() {
var _local3 = myparent.unknownToArray(curnode.response);
var _local4 = new Array();
if (_local3.length != undefined) {
var _local2 = 0;
while (_local2 < _local3.length) {
_local4.push(_local3[_local2].text);
_local2++;
}
}
return(_local4);
}
function doResponseOb(n, hlevel) {
var _local4 = myparent.unknownToArray(curnode.response);
var _local3 = new Object();
var _local2 = 0;
while (_local2 < _local4.length) {
if (_local2 == String(n)) {
_local3.response = _local4[_local2].text;
if (_local4[_local2].prompt != undefined) {
var _local5 = myparent.unknownToArray(_local4[_local2].prompt);
var _local6 = Math.floor(Math.random() * _local5.length);
_local3.rtext = _local5[_local6].text;
curnode = _local5[_local6];
if (curnode.response == undefined) {
_local3.continue = false;
} else {
_local3.continue = true;
}
_local3.endaction = _local4[_local2].prompt.endaction;
} else if (n < 3) {
} else {
_local3.rtext = getGoodbye(hlevel);
_local3.continue = false;
}
trace(_local3.endaction + " END ACTION");
break;
}
_local2++;
}
return(_local3);
}
function doResponse(n, hlevel) {
var _local3 = myparent.unknownToArray(curnode.response);
var _local4 = new Array();
var _local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2].type == String(n)) {
_local4.push(_local3[_local2].text);
if (_local3[_local2].prompt != undefined) {
var _local5 = myparent.unknownToArray(_local3[_local2].prompt);
var _local6 = Math.floor(Math.random() * _local5.length);
_local4.push(_local5[_local6]);
curnode = _local5[_local6];
if (curnode.response == undefined) {
_local4.push(false);
} else {
_local4.push(true);
}
}
_local4.endaction = _local3[_local2].endaction;
break;
}
_local2++;
}
return(_local4);
}
}
Symbol 893 MovieClip [__Packages.com.doodlehead.pathfinding.AStarManager] Frame 0
class com.doodlehead.pathfinding.AStarManager
{
var ctr, astar_ar, priorityTotal, maxIterations, gameMap, knownPathAr, maxtime;
function AStarManager (mi, gm) {
ctr = -1;
astar_ar = [];
priorityTotal = 0;
maxIterations = mi;
gameMap = gm;
knownPathAr = new Object();
maxtime = 8;
}
function registerPath(ob, p0, p1, pr) {
if ((((p1 != undefined) && (p0 != undefined)) && (ob != undefined)) && (pr != undefined)) {
var _local5 = p0.x;
var _local3 = p0.y;
var _local4 = p1.x;
var _local2 = p1.y;
var _local7 = (((((("p_" + _local4) + "_") + _local2) + "_") + _local5) + "_") + _local3;
p1 = (((((("p_" + _local5) + "_") + _local3) + "_") + _local4) + "_") + _local2;
if (knownPathAr[p1] != undefined) {
ob.setPath(knownPathAr[p1].arrayCopy());
return(null);
}
if (knownPathAr[_local7] != undefined) {
ob.setPath(knownPathAr[_local7].arrayCopy().reverse());
return(null);
}
ctr++;
astar_ar["p" + ctr] = {requester:ob, priority:pr, calcpath:new com.doodlehead.pathfinding.AStarCalculator(gameMap, _local5, _local3, _local4, _local2, pr)};
priorityTotal = priorityTotal + pr;
return(ctr);
}
return(null);
}
function deletePathByObject(ob) {
for (var _local3 in astar_ar) {
if (astar_ar[_local3].requester == ob) {
delete astar_ar[_local3];
return(undefined);
}
}
}
function removePath(n) {
if (astar_ar["p" + n] != undefined) {
priorityTotal = priorityTotal - astar_ar["p" + n].priority;
delete astar_ar["p" + n];
return(true);
}
return(false);
}
function maintainPaths() {
for (var _local5 in astar_ar) {
if (astar_ar[_local5] != undefined) {
var _local3 = astar_ar[_local5].calcpath;
_local3.setMaxCycles(Math.floor((maxtime * astar_ar[_local5].priority) / priorityTotal));
var _local2 = _local3.maintainCalculation();
if (_local2 != null) {
if (_local2.length > 3) {
knownPathAr[(((((("p_" + _local2[0].x) + "_") + _local2[0].y) + "_") + _local2[_local2.length - 1].x) + "_") + _local2[_local2.length - 1].y] = _local2.arrayCopy();
}
astar_ar[_local5].requester.setPath(_local2);
var _local4 = parseInt(_local5.substr(1, _local5.length - 1));
removePath(_local4);
return(_local2);
}
}
}
return(null);
}
}
Symbol 894 MovieClip [__Packages.com.doodlehead.pathfinding.AStarCalculator] Frame 0
class com.doodlehead.pathfinding.AStarCalculator
{
var astarctr, startP, endP, ary_open, ary_closed, ary_four, ary_c, amax, gameMap;
function AStarCalculator (gmap, asx, asy, asx2, asy2, priority) {
astarctr = 0;
startP = new com.wis.math.alg.Vector(asx, asy);
endP = new com.wis.math.alg.Vector(asx2, asy2);
ary_open = new Array(new com.doodlehead.pathfinding.AStarOb(startP.x, startP.y, null, 0, astar_cost(startP.x, startP.y, endP)));
ary_closed = new Array();
ary_four = new Array(new com.wis.math.alg.Vector(1, 0), new com.wis.math.alg.Vector(0, 1), new com.wis.math.alg.Vector(-1, 0), new com.wis.math.alg.Vector(0, -1));
ary_c = new Array(10, 10, 10, 10);
amax = priority;
gameMap = gmap;
}
function astar_cost(x, y, p) {
return(10 * (Math.abs(x - p.x) + Math.abs(y - p.y)));
}
function setMaxCycles(n) {
amax = n;
}
function maintainCalculation() {
var _local2 = [];
var _local3 = astar_main(amax);
if (_local3) {
_local2 = astar_getPath();
return(_local2);
}
return(null);
}
function astar_getPath() {
var _local9 = [];
var _local7 = 0;
var _local8 = 200;
var _local5 = ary_closed[ary_closed.length - 1].x;
var _local4 = ary_closed[ary_closed.length - 1].y;
var _local3 = ary_closed[ary_closed.length - 1].p;
var _local6 = new Array(new com.wis.math.alg.Vector(_local5, _local4));
ary_closed.splice(ary_closed.length - 1, 1);
do {
var _local2 = 0;
while (_local2 < ary_closed.length) {
if ((ary_closed[_local2].x == _local3.x) && (ary_closed[_local2].y == _local3.y)) {
_local5 = ary_closed[_local2].x;
_local4 = ary_closed[_local2].y;
_local3 = ary_closed[_local2].p;
_local6.push(new com.wis.math.alg.Vector(_local5, _local4));
break;
}
_local2++;
}
_local7++;
} while ((!((_local5 == startP.x) && (_local4 == startP.y))) && (_local7 < _local8));
_local6.reverse();
return(_local6);
}
function astar_main(timeTot) {
var _local9 = true;
var _local5 = 0;
var _local11 = 40;
var _local6 = 0;
var _local10 = getTimer();
do {
var _local4 = ary_open[0].f;
var _local3 = 0;
var _local2 = 1;
while (_local2 < ary_open.length) {
if (ary_open[_local2].f < _local4) {
_local4 = ary_open[_local2].f;
_local3 = _local2;
}
_local2++;
}
if (ary_open[_local3].e == 0) {
ary_closed.push(ary_open[_local3]);
return(true);
}
var _local8 = ary_open[_local3].x;
var _local7 = ary_open[_local3].y;
ary_closed.push(ary_open[_local3]);
ary_open.splice(_local3, 1);
astar_check(ary_closed[ary_closed.length - 1]);
_local5++;
_local6 = getTimer() - _local10;
if (_local6 >= timeTot) {
return(false);
}
} while (((ary_open.length > 0) && (_local9)) && (_local5 < _local11));
return(false);
}
function astar_check(ob) {
var _local6 = 0;
while (_local6 < ary_four.length) {
var _local5 = ob.x + ary_four[_local6].x;
var _local4 = ob.y + ary_four[_local6].y;
if ((!gameMap[ob.y][ob.x].walls[_local6]) && (gameMap[_local4][_local5] != undefined)) {
if (!gameMap[_local4][_local5].walls[(_local6 + 2) % 4]) {
if (gameMap[_local4][_local5].isEmpty) {
var _local9 = true;
var _local2 = 0;
while (_local2 < ary_closed.length) {
if ((_local5 == ary_closed[_local2].x) && (_local4 == ary_closed[_local2].y)) {
_local9 = false;
break;
}
_local2++;
}
if (_local9) {
var _local7 = ob.c + ary_c[_local6];
var _local8 = true;
_local2 = 0;
while (_local2 < ary_open.length) {
if ((ary_open[_local2].x == _local5) && (ary_open[_local2].y == _local4)) {
if (ary_open[_local2].c > _local7) {
ary_open[_local2].p = new com.wis.math.alg.Vector(ob.x, ob.y);
ary_open[_local2].c = _local7;
}
_local8 = false;
}
_local2++;
}
if (_local8) {
ary_open.push(new com.doodlehead.pathfinding.AStarOb(_local5, _local4, new com.wis.math.alg.Vector(ob.x, ob.y), _local7, astar_cost(_local5, _local4, endP)));
}
}
}
}
}
_local6++;
}
}
}
Symbol 895 MovieClip [__Packages.com.doodlehead.pathfinding.AStarOb] Frame 0
class com.doodlehead.pathfinding.AStarOb
{
var _x, _y, _p, _c, _e, _f;
function AStarOb (vx, vy, vp, vc, ve) {
_x = vx;
_y = vy;
_p = vp;
_c = vc;
_e = ve;
_f = vc + ve;
}
function get x() {
return(_x);
}
function set x(n) {
_x = n;
//return(x);
}
function get y() {
return(_y);
}
function set y(n) {
_y = n;
//return(y);
}
function get p() {
return(_p);
}
function set p(v) {
_p = v;
//return(p);
}
function get c() {
return(_c);
}
function set c(n) {
_c = n;
_f = _c + _e;
//return(c);
}
function get e() {
return(_e);
}
function set e(n) {
_e = n;
_f = _c + _e;
//return(e);
}
function get f() {
return(_f);
}
function set f(n) {
_f = n;
//return(f);
}
}
Symbol 896 MovieClip [__Packages.com.doodlehead.actors.GameCharacter] Frame 0
class com.doodlehead.actors.GameCharacter
{
var mypath, myTempOrders, myparent, ary_four, mybounds, mypathmgr, mytile, myposition, myname, mydirection, myzoffset, myattitude, doNotDisturb, $actionDepth, myAttackName, origSpeed, myExitClipName, ordinal_ar, doNextOrder, myhealth, myspeechfile, isInConversation, isOffLevel, isWalkingThroughDoor, convoPauseSeconds, lastConvoTime, timeBetweenConvo, seekingPlayer, lastDoorway, doAgain, orderName, mysbubblec, myColors, mypathEscCtr, mypathEscCtrMax, isCalculatingPath, $visible, loopOrders, myMutterings, isMuttering, mutteringid, mutteringPause, mytype, mySubtype, origType, origOrderString, mystate, curOrder, isSeekingExit, isWaiting, exitPosition, exitName, myOrders, __get__type, walkcyclelength, walkinc, __get__movement, mysprite, mydialogfile, dispatchEvent, tryToResumePath, oldPlayerCoords, mydestination, myrange, myFloorArea;
function GameCharacter (mt, st, mgr, mgrp, argx, argy, nm, sf, orderString, mar, r, sp, bb) {
mx.events.EventDispatcher.initialize(this);
mypath = [];
myTempOrders = [];
myparent = mgr;
ary_four = myparent.ary_four;
mybounds = new com.wis.math.alg.Vector(myparent.gamew, myparent.gameh);
mypathmgr = mgrp;
mytile = new com.wis.math.alg.Vector(argx, argy);
myposition = new com.wis.math.alg.Vector(argx, argy);
myname = nm;
mydirection = 0;
myzoffset = 0;
myattitude = 5;
doNotDisturb = false;
$actionDepth = {x:0, y:0};
myAttackName = "";
if (sp == undefined) {
origSpeed = 3;
movement = (3);
} else {
origSpeed = sp;
movement = (sp);
}
myExitClipName = "";
ordinal_ar = mgr.ordinal_ar;
doNextOrder = false;
myhealth = 100;
myspeechfile = sf;
isInConversation = false;
isOffLevel = false;
isWalkingThroughDoor = false;
convoPauseSeconds = 3;
lastConvoTime = 0;
timeBetweenConvo = 9;
seekingPlayer = false;
lastDoorway = new Object();
doAgain = false;
orderName = "";
mysbubblec = 16759937 /* 0xFFBC81 */;
myColors = {shirt_lite:6710937, shirt_dark:3355477, pants_lite:3355443, pants_dark:0, hair_lite:13421772, hair_dark:11184810};
mypathEscCtr = 0;
mypathEscCtrMax = 40;
isCalculatingPath = false;
$visible = true;
ary_four = new Array(new com.wis.math.alg.Vector(1, 0), new com.wis.math.alg.Vector(0, 1), new com.wis.math.alg.Vector(-1, 0), new com.wis.math.alg.Vector(0, -1));
loopOrders = false;
myMutterings = ((mar != undefined) ? (mar.split("|")) : ([]));
isMuttering = false;
mutteringid = 0;
mutteringPause = 10;
if (mt != "") {
mytype = mt;
if (mytype == "SeekerCharacter") {
initSeeker(r, sp, bb);
}
}
mySubtype = st;
origType = mt;
var _local2 = new Array();
if (orderString != undefined) {
origOrderString = orderString;
_local2 = processOrdersString(orderString);
}
mystate = "";
initOrders(_local2, true);
executeOrder();
}
function set attackName(s) {
myAttackName = s;
//return(attackName);
}
function get attackName() {
return(myAttackName);
}
function get actionDepth() {
return($actionDepth);
}
function get shouldSort() {
if (isWalkingThroughDoor) {
return(false);
}
return(true);
}
function initOrders(ar, b) {
curOrder = 0;
isSeekingExit = false;
isWaiting = false;
exitPosition = new com.wis.math.alg.Vector(0, 0);
exitName = "";
loopOrders = b;
myOrders = ar;
}
function init() {
}
function get typeOf() {
return(mytype);
}
function set type(s) {
mytype = s;
//return(__get__type());
}
function get subTypeOf() {
return(mySubtype);
}
function set exitClipName(s) {
myExitClipName = s;
//return(exitClipName);
}
function get exitClipName() {
return(myExitClipName);
}
function get sbubblec() {
return(mysbubblec);
}
function set sbubblec(n) {
mysbubblec = n;
//return(sbubblec);
}
function set visible(b) {
$visible = b;
//return(visible);
}
function get visible() {
return($visible);
}
function set interactFlag(b) {
isInConversation = b;
//return(interactFlag);
}
function get interactFlag() {
return(isInConversation);
}
function get aColor() {
return([myColors.shirt_lite, myColors.shirt_dark, myColors.pants_lite, myColors.pants_dark, myColors.hair_lite, myColors.hair_dark, myColors.tie]);
}
function setColors(c0, c1, c2, c3, c4, c5, c6) {
myColors.shirt_lite = c0;
myColors.shirt_dark = c1;
myColors.pants_lite = c2;
myColors.pants_dark = c3;
myColors.hair_lite = c4;
myColors.hair_dark = c5;
myColors.tie = c6;
}
function set movement(n) {
walkcyclelength = n;
walkinc = 1 / walkcyclelength;
//return(__get__movement());
}
function distanceFromPlayer() {
var _local3 = mytile.x - myparent.playerCoords().x;
var _local2 = mytile.y - myparent.playerCoords().y;
var _local4 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
return(_local4);
}
function endisInConversationTimeout() {
isInConversation = false;
lastConvoTime = getTimer();
if (mypath.length == 0) {
calculateNewTarget();
}
}
function setClip(s) {
mysprite = s;
}
function getClip() {
return(mysprite);
}
function get name() {
return(myname);
}
function get speechfile() {
return(myspeechfile);
}
function get dialogfile() {
return(mydialogfile);
}
function set dialogfile(s) {
mydialogfile = s;
//return(dialogfile);
}
function sfxDone(n) {
endMutteringLock();
}
function endMutteringLock() {
isMuttering = false;
}
function get state() {
return(mystate);
}
function set state(s) {
mystate = s;
//return(state);
}
function get position() {
return(myposition);
}
function set position(v) {
myposition = v;
//return(position);
}
function get zoffset() {
return(myzoffset);
}
function set zoffset(n) {
myzoffset = n;
//return(zoffset);
}
function get tile() {
return(mytile);
}
function set tile(v) {
mytile = v;
//return(tile);
}
function set dontDisturb(b) {
doNotDisturb = b;
//return(dontDisturb);
}
function get dontDisturb() {
return(doNotDisturb);
}
function get attitude() {
return(myattitude);
}
function endAction() {
setState("stand" + ordinal_ar[mydirection]);
dontDisturb = (false);
$actionDepth.x = 0;
$actionDepth.y = 0;
}
function setStandDoor() {
setState("stand" + ordinal_ar[mydirection]);
}
function get walkingThroughDoor() {
return(isWalkingThroughDoor);
}
function setExitWalk() {
mypath = new Array();
mypath.push(new com.wis.math.alg.Vector(mytile.x + (2 * ary_four[mydirection].x), mytile.y + (2 * ary_four[mydirection].y)));
isWalkingThroughDoor = true;
setState("walk" + ordinal_ar[mydirection]);
}
function setEntranceWalk() {
isOffLevel = false;
isWalkingThroughDoor = true;
mydirection = myparent.getDoorwayEnterDirection(lastDoorway.position);
setState("walk" + ordinal_ar[mydirection]);
mypath = new Array();
mypath.push(new com.wis.math.alg.Vector(lastDoorway.position.x, lastDoorway.position.y));
mytile.x = lastDoorway.position.x;
myposition.x = lastDoorway.position.x - (2 * ary_four[mydirection].x);
mytile.y = lastDoorway.position.y;
myposition.y = lastDoorway.position.y - (2 * ary_four[mydirection].y);
dispatchEvent({type:"positionchange", target:this, position:myposition, depthcoords:lastDoorway.position});
}
function endConversation() {
dontDisturb = (false);
setState("stand" + ordinal_ar[mydirection]);
myposition.x = mytile.x;
myposition.y = mytile.y;
clearOutPathBits();
if (mytype != "ScriptedSeeker") {
executeOrder();
}
myparent.oemManager.setTimeout(this, "endisInConversationTimeout", convoPauseSeconds, [this], 1);
}
function startConversation(d) {
myparent.oemManager.deleteTOByObject(this);
mypathmgr.deletePathByObject(this);
dontDisturb = (true);
mydirection = d;
mystate = "conversation";
isInConversation = true;
isCalculatingPath = false;
myposition.x = mytile.x;
myposition.y = mytile.y;
curOrder--;
if (curOrder < 0) {
curOrder = myOrders.length - 1;
}
if (d != undefined) {
setState("stand" + ordinal_ar[mydirection]);
}
}
function get highTile() {
return(mytile);
}
function get nextTile() {
return(mypath[0]);
}
function findDirection() {
if (mytile.x < mypath[0].x) {
return(0);
}
if (mytile.x > mypath[0].x) {
return(2);
}
if (mytile.y > mypath[0].y) {
return(3);
}
if (mytile.y < mypath[0].y) {
return(1);
}
return(0);
}
function get direction() {
return(mydirection);
}
function set direction(n) {
mydirection = n;
//return(direction);
}
function set health(n) {
var _local2 = myhealth - n;
myhealth = ((n < 0) ? 0 : (n));
dispatchEvent({type:"propchange", target:this, prop:"health", val:myhealth, oldval:_local2});
//return(health);
}
function get health() {
return(myhealth);
}
function setState(s) {
if ((mytype == "ScriptedSeeker") && (mySubtype == "itguy")) {
if (s.substr(0, 4) == "walk") {
s = "darkwalk" + ordinal_ar[mydirection];
}
if (s.substr(0, 5) == "stand") {
return(undefined);
}
}
if (s != mystate) {
mystate = s;
dispatchEvent({type:"statechange", target:this, state:s, sprite:mysprite});
}
}
function setStateNoDir(s) {
if (s != mystate) {
mystate = s;
dispatchEvent({type:"statechange", target:this, state:s, sprite:mysprite});
}
}
function setStatePlain(s) {
s = s + ordinal_ar[mydirection];
if (s != mystate) {
mystate = s;
dispatchEvent({type:"statechange", target:this, state:s, sprite:mysprite});
}
}
function endWaitOrder() {
isWaiting = false;
jorgeTrace("END WAIT ORDER");
executeOrder();
}
function processOrdersString(s) {
var _local1 = new Array();
var _local5 = s.split("|");
var _local3 = 0;
while (_local3 < _local5.length) {
var _local2 = _local5[_local3].split(":");
switch (_local2[0]) {
case "random" :
_local1.push({order:"random"});
break;
case "move" :
var _local4 = _local2[1].split(",");
_local1.push({order:"move", loc:new com.wis.math.alg.Vector(parseInt(_local4[0]), parseInt(_local4[1]))});
break;
case "wait" :
_local1.push({order:"wait", duration:parseInt(_local2[1])});
break;
case "turn" :
_local1.push({order:"turn", direction:parseInt(_local2[1])});
break;
case "setstate" :
_local1.push({order:"setstate", state:_local2[1]});
break;
case "action" :
_local1.push({order:"action"});
_local1.push({order:"wait", duration:8});
break;
case "exit" :
_local1.push({order:"exit", exitname:_local2[1]});
break;
case "enter" :
_local1.push({order:"enter", entrance:_local2[1]});
break;
}
_local3++;
}
return(_local1);
}
function executeOrder() {
if (((mytype == "ScriptedSeeker") && (distanceFromPlayer() > 1)) && (((myOrders[curOrder].state == "swing") || (myOrders[curOrder].state == "weasel")) || (myOrders[curOrder].state == "stick"))) {
seekerFindPlayer();
return(undefined);
}
if (doMyLogic != undefined) {
if (doMyLogic()) {
return(undefined);
}
}
orderName = myOrders[curOrder].order;
doAgain = false;
switch (myOrders[curOrder].order) {
case "random" :
moveNSEW();
break;
case "move" :
registerPath(myOrders[curOrder].loc.x, myOrders[curOrder].loc.y);
break;
case "wait" :
isWaiting = true;
myparent.oemManager.setTimeout(this, "endWaitOrder", myOrders[curOrder].duration, [this], 1);
break;
case "turn" :
direction = (myOrders[curOrder].direction);
setState("stand" + ordinal_ar[direction]);
doAgain = true;
break;
case "action" :
isWaiting = true;
setState("action" + ordinal_ar[direction]);
doAgain = true;
break;
case "setstate" :
if ((((mypath.length == 0) && (mytype == "ScriptedSeeker")) && (distanceFromPlayer() > 1)) && (!isCalculatingPath)) {
seekerFindPlayer();
return(undefined);
}
facePlayer();
makePlayerReact();
setState(myOrders[curOrder].state + ordinal_ar[direction]);
break;
case "exit" :
seekExit();
break;
case "enter" :
if (!myparent.exitInUse(exitName)) {
if (!myparent.checkTileEmptyDynamic(lastDoorway.position)) {
myparent.oemManager.setTimeout(this, "endWaitOrder", 5, [this], 1);
return(undefined);
}
isOffLevel = false;
isWalkingThroughDoor = true;
if (lastDoorway.position != undefined) {
myparent.doorMaskMe(this, mysprite, new com.wis.math.alg.Vector(lastDoorway.position.x, lastDoorway.position.y), lastDoorway.name, true);
}
}
break;
}
curOrder++;
if ((curOrder == myOrders.length) && (mytype == "ScriptedSeeker")) {
myparent.setEndFrameAction(this, "releaseScriptedSeeker");
} else if ((curOrder >= myOrders.length) && (loopOrders)) {
curOrder = 0;
}
}
function jorgeTrace(s) {
if (myname == "jorge") {
trace(s);
}
}
function performActionSS() {
if (myOrders[curOrder - 1].order == "setstate") {
return(undefined);
}
if ((((mypath.length == 0) && (mytype == "ScriptedSeeker")) && (distanceFromPlayer() > 1)) && (!isCalculatingPath)) {
seekerFindPlayer();
return(undefined);
}
doMyLogic();
if (isCalculatingPath) {
if (mypathEscCtr >= mypathEscCtrMax) {
clearOutPathBits();
seekerFindPlayer();
}
} else {
var _local2 = doMovementWithStatus();
if (_local2 == "path done") {
if (tryToResumePath) {
tryToResumePath = false;
seekerFindPlayer();
} else {
executeOrder();
}
} else if (_local2 == "path blocked") {
myposition.x = mytile.x;
myposition.y = mytile.y;
setState("stand" + ordinal_ar[mydirection]);
clearOutPathBits();
moveNSEW();
tryToResumePath = true;
}
}
}
function performAction() {
if (mytype == "ScriptedSeeker") {
performActionSS();
return(undefined);
}
if (isOffLevel) {
return(undefined);
}
if (myOrders[curOrder - 1].order == "setstate") {
return(undefined);
}
if (doNextOrder) {
clearOutPathBits();
doNextOrder = false;
executeOrder();
return(undefined);
}
if (doAgain) {
doAgain = false;
jorgeTrace("DO AGAIN");
executeOrder();
}
if (isWalkingThroughDoor) {
if ((myposition.x == mypath[0].x) && (myposition.y == mypath[0].y)) {
jorgeTrace("GOT TO POSITION " + orderName);
if (orderName == "exit") {
mytile.x = (myposition.x = -50);
mytile.y = (myposition.y = 1);
dispatchEvent({type:"positionchange", target:this, position:myposition});
clearOutPathBits();
myparent.finishCharacterExit(this, mysprite, new com.wis.math.alg.Vector(exitPosition.x, exitPosition.y), exitName, myExitClipName);
jorgeTrace("WALK ORDER EXIT");
executeOrder();
isWalkingThroughDoor = false;
isSeekingExit = false;
isOffLevel = true;
} else if (orderName == "enter") {
jorgeTrace("AND FINISH IT");
myparent.unMaskMe(this, mysprite, mypath[0]);
isWalkingThroughDoor = false;
isSeekingExit = false;
jorgeTrace("WALK ORDER ENTER");
executeOrder();
}
} else {
moveClip();
}
return(undefined);
}
doMyLogic();
if (!(isInConversation || (isWaiting))) {
if (isCalculatingPath) {
if (mypathEscCtr >= mypathEscCtrMax) {
clearOutPathBits();
calculateNewTarget();
}
} else {
var _local2 = doMovementWithStatus();
if (_local2 == "path done") {
setState("stand" + ordinal_ar[mydirection]);
if (isSeekingExit) {
if (!myparent.exitInUse(exitName)) {
if ((exitPosition.x == myposition.x) && (exitPosition.y == myposition.y)) {
lastDoorway = {position:exitPosition, name:exitName};
myparent.doorMaskMe(this, mysprite, exitPosition, exitName, false);
dispatchEvent({type:"positionchange", target:this, position:myposition});
isWalkingThroughDoor = true;
} else {
seekExit();
}
}
} else {
if (tryToResumePath) {
tryToResumePath = false;
curOrder--;
if (curOrder < 0) {
curOrder = myOrders.length - 1;
}
}
jorgeTrace("RESUME EXECUTE");
if (mytype != "ScriptedSeeker") {
executeOrder();
}
}
} else if (_local2 == "path blocked") {
setState("stand" + ordinal_ar[mydirection]);
clearOutPathBits();
moveNSEW();
tryToResumePath = true;
}
}
}
}
function clearOutPathBits() {
mypath = new Array();
dontDisturb = (false);
isCalculatingPath = false;
setState("stand" + ordinal_ar[mydirection]);
mypathEscCtr = 0;
}
function seekExit() {
isSeekingExit = true;
var _local2 = myparent.getExit(mytile, "closest");
exitName = _local2.doorcode;
exitPosition = new com.wis.math.alg.Vector(_local2.pos.x, _local2.pos.y);
registerPath(_local2.pos.x, _local2.pos.y);
}
function moveClip() {
var _local3 = mypath[0].x - myposition.x;
var _local2 = mypath[0].y - myposition.y;
if (mypath[0].x != myposition.x) {
if (mypath[0].x > myposition.x) {
if (_local3 < walkinc) {
myposition.x = myposition.x + _local3;
} else {
myposition.x = myposition.x + walkinc;
}
} else if (mypath[0].x < myposition.x) {
if (Math.abs(_local3) < walkinc) {
myposition.x = myposition.x + _local3;
} else {
myposition.x = myposition.x - walkinc;
}
}
}
if (mypath[0].y != myposition.y) {
if (mypath[0].y > myposition.y) {
if (_local2 < walkinc) {
myposition.y = myposition.y + _local2;
} else {
myposition.y = myposition.y + walkinc;
}
} else if (mypath[0].y < myposition.y) {
if (_local2 > walkinc) {
myposition.y = myposition.y + _local2;
} else {
myposition.y = myposition.y - walkinc;
}
}
}
dispatchEvent({type:"positionchange", target:this, position:myposition});
return(true);
}
function doMovement() {
if (mypath.length > 0) {
if ((Math.abs(myposition.x - mypath[0].x) < walkinc) && (Math.abs(myposition.y - mypath[0].y) < walkinc)) {
mytile.x = (myposition.x = mypath[0].x);
mytile.y = (myposition.y = mypath[0].y);
mypath.splice(0, 1);
if (mypath.length == 0) {
return(false);
}
if (!myparent.checkValidMoveDynamic(mypath[0], this)) {
return(false);
}
mydirection = findDirection();
setState("walk" + ordinal_ar[mydirection]);
moveClip();
return(true);
}
mydirection = findDirection();
setState("walk" + ordinal_ar[mydirection]);
moveClip();
return(true);
}
return(false);
}
function doMovementWithStatus() {
if (mypath.length > 0) {
if ((Math.abs(myposition.x - mypath[0].x) < walkinc) && (Math.abs(myposition.y - mypath[0].y) < walkinc)) {
mytile.x = (myposition.x = mypath[0].x);
mytile.y = (myposition.y = mypath[0].y);
mypath.splice(0, 1);
if (mypath.length == 0) {
return("path done");
}
if (!myparent.checkValidMoveDynamic(mypath[0], this)) {
return("path blocked");
}
mydirection = findDirection();
setState("walk" + ordinal_ar[mydirection]);
moveClip();
return("true");
}
if (!myparent.checkValidMoveDynamic(mypath[0], this)) {
return("path blocked");
}
mydirection = findDirection();
setState("walk" + ordinal_ar[mydirection]);
moveClip();
return("true");
}
return("path done");
}
function calculateNewTarget() {
if (mytype == "ScriptedSeeker") {
if (myOrders[curOrder].order == "SEEKPLAYER") {
if (distanceFromPlayer() <= 1) {
executeOrder();
} else {
seekingPlayer = true;
oldPlayerCoords = new com.wis.math.alg.Vector(myparent.playerCoords().x, myparent.playerCoords().y);
registerPath(myparent.playerCoords().x, myparent.playerCoords().y);
return(undefined);
}
}
}
if ((myposition.x == myOrders[curOrder].x) && (myposition.y == myOrders[curOrder].y)) {
jorgeTrace("CALC NEW TARGET EXECUTE");
executeOrder();
} else {
registerPath(myOrders[curOrder].loc.x, myOrders[curOrder].loc.y);
}
}
function moveNSEW() {
var _local2 = new Array();
var _local3 = 0;
while (_local3 < ary_four.length) {
_local2.push(ary_four[_local3]);
_local3++;
}
_local3 = 0;
while (_local3 < 10) {
var _local6 = Math.floor(Math.random() * ary_four.length);
var _local5 = Math.floor(Math.random() * ary_four.length);
if (_local6 != _local5) {
var _local7 = _local2[_local6];
_local2[_local6] = _local2[_local5];
_local2[_local5] = _local7;
}
_local3++;
}
_local3 = 0;
while (_local3 < _local2.length) {
var _local4 = new com.wis.math.alg.Vector(mytile.x + _local2[_local3].x, mytile.y + _local2[_local3].y);
if (myparent.checkValidMoveDynamic(_local4, this)) {
registerPath(_local4.x, _local4.y);
return(undefined);
}
_local3++;
}
}
function pointInMyBox(px, py, boxAr) {
if ((((px >= boxAr[0].x) && (px <= boxAr[1].x)) && (py >= boxAr[0].y)) && (py <= boxAr[1].y)) {
return(true);
}
return(false);
}
function registerPath(tgtx, tgty) {
mypathEscCtr = 0;
isCalculatingPath = true;
mydestination = new com.wis.math.alg.Vector(tgtx, tgty);
mypathmgr.deletePathByObject(this);
mypathmgr.registerPath(this, mytile, {x:tgtx, y:tgty}, 1);
}
function setPath(ar) {
if (ar != null) {
mypath = ar;
isCalculatingPath = false;
} else {
isCalculatingPath = true;
calculateNewTarget();
}
}
function doMyLogic() {
switch (mytype) {
case "DroneCharacter" :
if (((distanceFromPlayer() < 10) && (myMutterings.length > 0)) && (!(isMuttering || (isInConversation)))) {
var _local3 = Math.floor(Math.random() * 66);
if (_local3 < 1) {
_local3 = Math.floor(Math.random() * myMutterings.length);
var _local2 = "audio/" + myMutterings[0];
mutteringid = myparent.playMuttering(myname + _local2, _local2, myposition);
isMuttering = myparent.registerSoundCtrlr(this, mutteringid);
}
}
if (isMuttering) {
myparent.registerSoundCtrlr(this, mutteringid);
if (isInConversation) {
isMuttering = false;
myparent.stopMuttering(mutteringid);
} else {
myparent.updateMutteringPosition(mutteringid, myposition);
}
}
return(false);
case "SeekerCharacter" :
var _local4 = getTimer() - lastConvoTime;
if (_local4 < (timeBetweenConvo * 1000)) {
seekingPlayer = false;
}
if (seekingPlayer) {
var _local5 = distanceFromPlayer();
if ((_local5 <= 1) && (!isInConversation)) {
myparent.startConvoWithPlayer(this);
} else if ((myparent.playerCoords().x != oldPlayerCoords.x) && (myparent.playerCoords().y != oldPlayerCoords.y)) {
seekerFindPlayer();
}
} else {
seekerCalculateNewTarget();
}
return(true);
case "ScriptedSeeker" :
doNextOrder = false;
if ((mypath.length == 0) && (distanceFromPlayer > 1)) {
seekerFindPlayer();
} else if ((distanceFromPlayer() <= 1) && (myOrders[curOrder - 1].order == "move")) {
turnTowardsPlayer();
clearOutPathBits();
doNextOrder = true;
}
if (mypathEscCtr > 8) {
seekerFindPlayer();
}
return(false);
}
}
function turnTowardsPlayer() {
if (myparent.playerCoords().x < myposition.x) {
mydirection = 2;
}
if (myparent.playerCoords().x > myposition.x) {
mydirection = 0;
}
if (myparent.playerCoords().y < myposition.y) {
mydirection = 3;
}
if (myparent.playerCoords().y > myposition.y) {
mydirection = 1;
}
}
function facePlayer() {
var _local2 = 0;
while (_local2 < ary_four.length) {
if (((mytile.x + ary_four[_local2].x) == Math.round(myparent.playerCoords().x)) && ((mytile.y + ary_four[_local2].y) == Math.round(myparent.playerCoords().y))) {
mydirection = _local2;
break;
}
_local2++;
}
}
function makePlayerReact() {
myparent.setPlayerAttacked(this, ordinal_ar[(mydirection + 2) % 4], myAttackName);
}
function releaseScriptedSeeker() {
mytype = origType;
movement = (origSpeed);
loopOrders = true;
myposition.x = mytile.x;
myposition.y = mytile.y;
setState("stand");
myOrders = new Array();
var _local2 = processOrdersString(origOrderString);
initOrders(_local2, true);
executeOrder();
}
function initScriptedSeeker(orderString, aName) {
myAttackName = aName;
curOrder = 0;
mytype = "ScriptedSeeker";
myposition.x = mytile.x;
myposition.y = mytile.y;
loopOrders = false;
myOrders = new Array();
var _local2 = processOrdersString(orderString);
initOrders(_local2, true);
executeOrder();
}
function initSeeker(r, sp, bb) {
if (mytype != "PlayerCharacter") {
if (r != undefined) {
myrange = r;
} else {
myrange = 999;
}
if (bb != undefined) {
myFloorArea = bb;
} else {
myFloorArea = [new com.wis.math.alg.Vector(0, 0), new com.wis.math.alg.Vector(100, 100)];
}
mytype = "SeekerCharacter";
if (sp != undefined) {
walkcyclelength = sp;
}
seekerCalculateNewTarget();
oldPlayerCoords = new com.wis.math.alg.Vector(0, 0);
}
}
function seekerGetRandomPosition(coordsAr) {
var _local3 = coordsAr[1].x - coordsAr[0].x;
var _local2 = coordsAr[1].y - coordsAr[0].y;
var _local5 = coordsAr[0].x + Math.floor(Math.random() * _local3);
var _local4 = coordsAr[0].y + Math.floor(Math.random() * _local2);
return([_local5, _local4]);
}
function seekerSetRandomPosition() {
dontDisturb = (false);
var _local2 = new Array();
var _local3 = 0;
var _local4 = 10;
do {
_local2 = seekerGetRandomPosition(myFloorArea);
_local3++;
} while ((_local3 < _local4) && (!myparent.checkValidMove(new com.wis.math.alg.Vector(_local2[0], _local2[1]), this)));
if (_local3 != _local4) {
registerPath(_local2[0], _local2[1]);
}
}
function shuffSort(a, b) {
if (a.v < b.v) {
return(-1);
}
if (a.v > b.v) {
return(1);
}
if (a.v == b.v) {
return(0);
}
}
function seekerFindPlayer() {
clearOutPathBits();
seekingPlayer = true;
oldPlayerCoords = new com.wis.math.alg.Vector(myparent.playerCoords().x, myparent.playerCoords().y);
var _local4 = new Array({v:Math.random(), c:0}, {v:Math.random(), c:1}, {v:Math.random(), c:2}, {v:Math.random(), c:3});
_local4.sort(shuffSort);
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = new com.wis.math.alg.Vector(myparent.playerCoords().x + ary_four[_local4[_local2].c].x, myparent.playerCoords().y + ary_four[_local4[_local2].c].y);
if (myparent.checkValidMove(_local3, this)) {
registerPath(_local3.x, _local3.y);
return(undefined);
}
_local2++;
}
}
function seekerCalculateNewTarget() {
var _local2 = distanceFromPlayer();
seekerFindPlayer();
return(undefined);
}
}
Symbol 897 MovieClip [__Packages.com.doodlehead.actors.PlayerCharacter] Frame 0
class com.doodlehead.actors.PlayerCharacter extends com.doodlehead.actors.GameCharacter
{
var mytype, setToStand, isPinata, __set__dontDisturb, convoPauseSeconds, myparent, isInConversation, mystate, __get__dontDisturb, mypath, mytile, mydirection, setState, ary_four, myinventory, startConversation, ordinal_ar, $actionDepth, moveClip, walkinc, myposition;
function PlayerCharacter (mt, st, mgr, mgrp, argx, argy, nm, sf, orderString, mar, r, sp, bb) {
super(mt, st, mgr, mgrp, argx, argy, nm, sf, orderString, mar, r, sp, bb);
mytype = "PlayerCharacter";
setToStand = false;
isPinata = false;
init();
}
function init() {
__set__dontDisturb(false);
convoPauseSeconds = 1.5;
var _local2 = [];
_local2.push({rcode:"north", kcode:38});
_local2.push({rcode:"east", kcode:39});
_local2.push({rcode:"south", kcode:40});
_local2.push({rcode:"west", kcode:37});
_local2.push({rcode:"action", kcode:32});
myparent.registerForInput(_local2, this).addEventListener("inputGotten", mx.utils.Delegate.create(this, inputEvent));
}
function inputEvent(eventObj) {
if ((eventObj.receiver == this) && (!isInConversation)) {
if (!((mystate.substr(0, 5) == "stand") || (mystate.substr(0, 4) == "walk"))) {
trace("NOT READY FOR INPUT!!!");
return(undefined);
}
if (!__get__dontDisturb()) {
if (mystate.substr(0, 5) == "stand") {
var _local2 = 0;
while (_local2 < eventObj.ar.length) {
if ((eventObj.ar[_local2] == "action") && (!isPinata)) {
doAction();
return(undefined);
}
_local2++;
}
}
mypath = new Array();
var _local2 = 0;
while (_local2 < eventObj.ar.length) {
switch (eventObj.ar[_local2]) {
case "north" :
mypath = [new com.wis.math.alg.Vector(mytile.x, mytile.y - 1)];
mydirection = 3;
__set__dontDisturb(true);
setState("walknorth");
break;
case "east" :
mypath = [new com.wis.math.alg.Vector(mytile.x + 1, mytile.y)];
__set__dontDisturb(true);
mydirection = 0;
setState("walkeast");
break;
case "west" :
mypath = [new com.wis.math.alg.Vector(mytile.x - 1, mytile.y)];
__set__dontDisturb(true);
mydirection = 2;
setState("walkwest");
break;
case "south" :
mypath = [new com.wis.math.alg.Vector(mytile.x, mytile.y + 1)];
__set__dontDisturb(true);
mydirection = 1;
setState("walksouth");
break;
case "debug" :
fullDump();
break;
}
_local2++;
}
}
}
}
function doAction() {
var _local2 = myparent.getActionObjectAt(this, new com.wis.math.alg.Vector(mytile.x + ary_four[mydirection].x, mytile.y + ary_four[mydirection].y), myinventory);
if (_local2 != "") {
if (_local2.resp == "conversation") {
startConversation();
} else if ((_local2.resp == "inventory") || (_local2.resp == "action")) {
setState("action" + ordinal_ar[mydirection]);
__set__dontDisturb(true);
if (_local2.resp == "inventory") {
myinventory = _local2.name;
}
} else {
setState(_local2.resp + ordinal_ar[mydirection]);
if (_local2.actionDepth != undefined) {
$actionDepth = _local2.actionDepth;
}
__set__dontDisturb(true);
}
}
}
function fullDump() {
trace("______________FULL DUMP____________________");
for (var _local2 in this) {
trace((_local2 + ": ") + this[_local2]);
}
}
function get inventory() {
return(myinventory);
}
function addToInventory(s) {
var _local2 = myinventory;
myinventory = s;
return(_local2);
}
function get direction() {
return(mydirection);
}
function get pinata() {
return(isPinata);
}
function set pinata(b) {
isPinata = b;
//return(pinata);
}
function performAction() {
if ((mypath.length > 0) && (__get__dontDisturb())) {
if (!myparent.checkValidMoveDynamic(mypath[0], this)) {
mypath = new Array();
if (__get__dontDisturb()) {
__set__dontDisturb(false);
}
setState("stand" + ordinal_ar[mydirection]);
return(undefined);
}
moveClip();
if ((Math.abs(myposition.x - mypath[0].x) < (walkinc / 10)) && (Math.abs(myposition.y - mypath[0].y) < (walkinc / 10))) {
mytile.x = (myposition.x = mypath[0].x);
mytile.y = (myposition.y = mypath[0].y);
mypath.splice(0, 1);
if (mypath.length == 0) {
if (__get__dontDisturb()) {
__set__dontDisturb(false);
}
return(undefined);
}
}
} else if (!__get__dontDisturb()) {
if (setToStand) {
setToStand = false;
setState("stand" + ordinal_ar[mydirection]);
} else if (mystate.substr(0, 4) == "walk") {
setToStand = true;
}
}
}
function initScriptedSeeker(s) {
}
function calculateNewTarget() {
}
}
Symbol 898 MovieClip [__Packages.com.doodlehead.view.GameDisplay] Frame 0
class com.doodlehead.view.GameDisplay extends MovieClip
{
var numbdiv, gamew, activeObsAr, _parent, getInstanceAtDepth, createEmptyMovieClip, playercharacter;
function GameDisplay () {
super();
init();
}
function init() {
numbdiv = 0;
gamew = 12;
activeObsAr = new Array();
}
function addActiveOb(s) {
activeObsAr.push(s);
}
function depthSort(a, b) {
var _local6 = a.depth;
var _local5 = b.depth;
var _local2 = a.y;
var _local1 = b.y;
if (_local2 < _local1) {
return(-1);
}
if (_local2 > _local1) {
return(1);
}
if (a.x < b.x) {
return(-1);
}
if (a.x > b.x) {
return(1);
}
return(0);
}
function sortDivs(ary_elements) {
ary_elements.sort(depthSort);
var _local2 = 1;
while (_local2 < ary_elements.length) {
if (this[ary_elements[_local2].mcname].getDepth() != (_local2 * 10)) {
this[ary_elements[_local2].mcname].swapDepths(_local2 * 10);
}
_local2++;
}
}
function roundUp(n) {
if ((n % 1) != 0) {
return(Math.floor(n) + 1);
}
return(n);
}
function getNDepth(x, y, d) {
var _local1 = 0;
return(Math.round(((y * 500) + (x * 10)) + 5));
}
function sortClips(cn) {
var _local2 = this[cn];
if (_local2.ctrlr == undefined) {
var _local6 = parseInt(cn.substr(10));
_local2.ctrlr = _parent.char_ar[_local6];
}
if (_local2 != undefined) {
var _local11 = 0;
var _local9 = 0;
var _local10 = _local2.ctrlr.position;
var _local3 = 0;
var _local4 = new com.wis.math.alg.Vector(_local2.ctrlr.tile.x, _local2.ctrlr.tile.y);
var _local5 = _local2.ctrlr.nextTile;
if ((_local2.ctrlr.actionDepth.x != 0) || (_local2.ctrlr.actionDepth.y != 0)) {
trace("DEPTH DEPTH DEPTH " + getTimer());
_local4.x = _local4.x + _local2.ctrlr.actionDepth.x;
_local4.y = _local4.y + _local2.ctrlr.actionDepth.y;
_local3 = getNDepth(_local4.x, _local4.y, 2);
} else if ((_local5 == undefined) || (_local2.ctrlr.direction == undefined)) {
_local3 = getNDepth(_local4.x, _local4.y);
} else if (_local2.ctrlr.walkingThroughDoor) {
_local3 = getNDepth(_local2.ctrlr.tile.x + 1, _local2.ctrlr.tile.y, 2);
} else {
switch (_local2.ctrlr.direction) {
case 0 :
_local3 = getNDepth(_local5.x, _local5.y, 0);
break;
case 1 :
_local3 = getNDepth(_local2.ctrlr.nextTile.x, _local2.ctrlr.nextTile.y, 2);
break;
case 2 :
_local3 = getNDepth(_local2.ctrlr.nextTile.x, _local2.ctrlr.nextTile.y, 2);
break;
case 3 :
_local3 = getNDepth(_local5.x, _local5.y + 1, 3);
break;
default :
_local3 = null;
}
}
_local3 = _local3 + _local2.ctrlr.zoffset;
if ((_local3 != null) && (_local3 != undefined)) {
if (getInstanceAtDepth(_local3)) {
_local2.swapDepths(_local3);
} else {
var _local7 = createEmptyMovieClip("d0", _local3);
_local2.swapDepths(_local3);
_local7.removeMovieClip();
}
}
}
}
function withinBounds(v0, v1, v2, v3) {
if (!(((((v0.x < v2.x) && (v1.x < v2.x)) || ((v0.x > v3.x) && (v1.x > v3.x))) || ((v0.y < v2.y) && (v1.y < v2.y))) || ((v0.y > v3.y) && (v1.y > v3.y)))) {
return(true);
}
return(false);
}
function removeSubObject(s, n, gtf) {
var _local2;
_local2 = this["mapitem" + n][s];
if (_local2 != undefined) {
if ((gtf != "") && (gtf != undefined)) {
_local2.gotoAndStop(gtf);
} else {
_local2.removeMovieClip();
}
}
}
function removeDecal(mcd, gtf) {
if (mcd != undefined) {
if ((gtf != "") && (gtf != undefined)) {
mcd.gotoAndStop(gtf);
} else {
mcd.removeMovieClip();
}
}
}
function frameAction() {
var _local7 = new com.wis.math.alg.Vector(playercharacter._x - 350, playercharacter._y - 250);
var _local6 = new com.wis.math.alg.Vector(playercharacter._x + 350, playercharacter._y + 300);
for (var _local8 in this) {
var _local2 = this[_local8];
if (_local2._visible != undefined) {
var _local4 = new com.wis.math.alg.Vector(0, 0);
var _local3 = new com.wis.math.alg.Vector(0, 0);
_local4.x = (_local3.x = _local2._x);
_local4.y = (_local3.y = _local2._y);
if (withinBounds(_local7, _local6, _local4, _local3)) {
if (_local2.ctrlr != undefined) {
if (_local2.ctrlr.visible && (!_local2._visible)) {
_local2._visible = true;
_local2.play();
} else if (!_local2.ctrlr.visible) {
_local2._visible = false;
}
} else if (!_local2._visible) {
_local2._visible = true;
_local2.play();
}
} else if (_local2._visible) {
_local2._visible = false;
_local2.stop();
}
}
}
var _local5 = 0;
while (_local5 < activeObsAr.length) {
sortClips(activeObsAr[_local5]);
_local5++;
}
}
static var id = ((id = "__Packages.com.doodlehead.view.GameDisplay")) + (Object.registerClass(id, com.doodlehead.view.GameDisplay) ? "" : "");
}
Symbol 899 MovieClip [__Packages.com.doodlehead.sound.SFXEngine] Frame 0
class com.doodlehead.sound.SFXEngine extends MovieClip
{
var maxsounds, soundsAr, soundsPlayingAr, mysoundmcsAr, ctr, getNextHighestDepth, createEmptyMovieClip;
function SFXEngine () {
super();
maxsounds = 8;
soundsAr = new Array();
soundsPlayingAr = new Array();
mysoundmcsAr = new Array();
ctr = 0;
}
function loadSound(name, sf) {
var _local4 = getNextHighestDepth();
var _local5 = createEmptyMovieClip("mcs" + _local4, _local4);
var _local3 = new Sound(_local5);
mysoundmcsAr.push(_local3);
soundsAr[name] = new com.doodlehead.sound.SoundClip(_local3, sf, 1, []);
soundsAr[name].soundOb.loadSound(soundsAr[name].soundfile);
soundsAr[name].soundOb.parent = soundsAr[name];
soundsAr[name].soundOb.onLoad = function () {
this.parent.status = "loaded";
};
}
function allSoundsLoaded() {
var _local2 = 0;
while (_local2 < soundsAr.length) {
if (soundsAr[_local2].status != "loaded") {
return(false);
}
_local2++;
}
return(true);
}
function startSound(name, x, y, libraryItem, loops) {
var nl = 1;
if (loops != undefined) {
nl = loops;
}
var _local5 = getNextHighestDepth();
var _local3 = createEmptyMovieClip("scp" + ctr, _local5);
var _local4 = new Sound(_local3);
var sob = (new com.doodlehead.sound.SoundClip(_local4, soundsAr[name].soundfile, 1, []));
var _local8 = soundsPlayingAr.length;
soundsPlayingAr.push({sc:sob, index:ctr, name:name, clip:"scp" + ctr, x:x, y:y});
sob.parent = soundsPlayingAr[soundsPlayingAr.length - 1];
sob.mgr = this;
if (libraryItem) {
sob.__get__soundOb().attachSound(name);
sob.__get__soundOb().start(0, nl);
} else {
sob.__get__soundOb().loadSound(soundsAr[name].soundfile);
sob.__get__soundOb().onLoad = function () {
this.start(0, nl);
};
}
sob.__get__soundOb().onSoundComplete = function () {
sob.mgr.removeSoundClip(sob.parent);
};
ctr++;
}
function removeSoundClip(ob) {
this[ob.clip].removeMovieClip();
var _local2 = 0;
while (_local2 < soundsPlayingAr.length) {
if (soundsPlayingAr[_local2].index == ob.index) {
soundsPlayingAr.splice(_local2, 1);
return(undefined);
}
_local2++;
}
}
function stopAll() {
var _local2 = 0;
while (_local2 < soundsPlayingAr.length) {
soundsPlayingAr[_local2].sc.soundOb.setVolume(0);
soundsPlayingAr[_local2].sc.soundOb.stop();
soundsPlayingAr[_local2].removeMovieClip();
_local2++;
}
}
function stopSound(s) {
var _local2 = 0;
while (_local2 < soundsPlayingAr.length) {
if (soundsPlayingAr[_local2].name == s) {
soundsPlayingAr[_local2].sc.soundOb.setVolume(0);
soundsPlayingAr[_local2].sc.soundOb.stop();
this[soundsPlayingAr[_local2].clip].removeMovieClip();
}
_local2++;
}
}
function maintainSounds(x, y) {
var _local2 = 0;
while (_local2 < soundsPlayingAr.length) {
if ((soundsPlayingAr[_local2].x != undefined) && (soundsPlayingAr[_local2].y != undefined)) {
var _local4 = soundsPlayingAr[_local2].x - x;
var _local3 = soundsPlayingAr[_local2].y - y;
var _local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if (_local5 < 10) {
if (soundsPlayingAr[_local2].sc.soundOb.getVolume()) {
var _local6 = 100 - Math.floor(_local5 * 10);
soundsPlayingAr[_local2].sc.soundOb.setVolume(_local6);
}
}
}
_local2++;
}
}
static var id = ((id = "__Packages.com.doodlehead.sound.SFXEngine")) + (Object.registerClass(id, com.doodlehead.sound.SFXEngine) ? "" : "");
}
Symbol 900 MovieClip [__Packages.com.doodlehead.actors.ActionSequencer] Frame 0
class com.doodlehead.actors.ActionSequencer
{
var $myparent, $actionsAr, $npc, $npc_sprite, $pc, $pc_sprite, $actionDescription, $ctr, $origTile, $damage, ary_four, dispatchEvent;
function ActionSequencer (mp, sq, npc, mc0, pc, mc1, charAr, hv, aDesc) {
mx.events.EventDispatcher.initialize(this);
$myparent = mp;
$actionsAr = processSequence(sq);
$npc = npc;
$npc_sprite = mc0;
$pc = pc;
$pc_sprite = mc1;
$actionDescription = aDesc;
$ctr = 0;
$origTile = new com.wis.math.alg.Vector($npc.tile.x, $npc.tile.y);
if (hv != undefined) {
$damage = hv;
} else {
$damage = 10;
}
ary_four = new Array(new com.wis.math.alg.Vector(1, 0), new com.wis.math.alg.Vector(0, 1), new com.wis.math.alg.Vector(-1, 0), new com.wis.math.alg.Vector(0, -1));
}
function get actionDescription() {
return($actionDescription);
}
function get damage() {
return($damage);
}
function get pc() {
return($pc);
}
function get npc() {
return($npc);
}
function get goodToGo() {
if ($actionsAr.length == 0) {
return(true);
}
return(false);
}
function sortSequence(a, b) {
if (a.step < b.step) {
return(-1);
}
if (a.step > b.step) {
return(1);
}
return(0);
}
function processSequence(sq) {
var _local10 = new Array();
var _local12 = sq.split("|");
var _local3 = "";
var _local7 = 0;
while (_local7 < _local12.length) {
var _local8 = _local12[_local7].split(":");
var _local5 = _local8[1].split(",");
var _local9 = false;
if (_local5[2] != undefined) {
_local9 = true;
}
var _local18 = _local5[1];
var _local16 = "";
if (_local5[1].indexOf("SEQUENCE") != -1) {
_local18 = "SEQUENCE";
var _local11 = _local5[1].split("...");
var _local4 = _local11[1].split("-");
var _local6 = new com.wis.math.alg.Vector($myparent.playerCoords().x, $myparent.playerCoords().y);
var _local2 = 0;
while (_local2 < _local4.length) {
if (_local3 != "") {
_local3 = _local3 + "|";
}
if (_local4[_local2] == "SEEKPLAYER") {
_local3 = _local3 + ((("move:" + _local6.x) + ",") + _local6.y);
} else {
_local3 = _local3 + ("setstate:" + _local4[_local2]);
}
_local2++;
}
}
_local10.push({step:parseInt(_local8[0]), target:_local5[0], action:_local18, nodir:_local9, subaction:_local16, subtarget:_local5[2], orderstring:_local3});
var _local17 = _local10[_local10.length - 1];
_local7++;
}
_local10.sort(sortSequence);
return(_local10);
}
function run() {
if ($npc_sprite.sprite.__proto__ != com.doodlehead.actors.CharacterSubSprite.prototype) {
$npc_sprite.sprite.__proto__ = com.doodlehead.actors.CharacterSubSprite.prototype;
}
com.doodlehead.actors.CharacterSubSprite.apply($npc_sprite.sprite, []);
var _local2 = 0;
if ($actionsAr.length > 0) {
while ((($actionsAr[0].step == $ctr) && ($actionsAr.length > 0)) && (_local2 < 10)) {
trace(((((($actionsAr[0].step + " ") + $actionsAr[0].target) + " ") + $actionsAr[0].action) + " ") + $actionsAr[0].subtarget);
switch ($actionsAr[0].action) {
case "RELEASE" :
dispatchEvent({type:"sequenceDone", target:this, ctrl:$npc, sprite:$npc_sprite, tile:$origTile});
break;
case "GOPLAYERSQ" :
dispatchEvent({type:"occupyPSquare", target:this, ctrl:$npc, sprite:$npc_sprite, tile:$pc.tile});
break;
case "GOORIGSQ" :
dispatchEvent({type:"occupyOSquare", target:this, ctrl:$npc, sprite:$npc_sprite, tile:$origTile});
$npc.tile = $origTile;
break;
case "SEQUENCE" :
if ($actionsAr[0].target == "all") {
$myparent.giveCharacterOrders($actionsAr[0].orderstring, $actionsAr[0].target, $actionsAr[0].subtarget);
} else {
$npc.initScriptedSeeker($actionsAr[0].orderstring);
}
break;
default :
if ($actionsAr[0].target == "npc") {
if ($actionsAr[0].nodir) {
$npc.setStateNoDir($actionsAr[0].action);
} else {
$npc.setStatePlain($actionsAr[0].action);
}
} else {
if ($actionsAr[0].target != "player") {
break;
}
$pc.setStatePlain($actionsAr[0].action);
}
}
_local2++;
$actionsAr.splice(0, 1);
}
}
$ctr++;
}
}
Symbol 901 MovieClip [__Packages.com.doodlehead.actors.CharacterSubSprite] Frame 0
class com.doodlehead.actors.CharacterSubSprite extends MovieClip
{
var targetObject, actionToTrigger;
function CharacterSubSprite (s) {
super();
}
function setEndFrameAction(ob, f) {
targetObject = ob;
actionToTrigger = f;
}
function endFrameAction() {
targetObject[actionToTrigger]();
}
}
Symbol 902 MovieClip [__Packages.com.doodlehead.tilegame.FMTKYLevel] Frame 0
class com.doodlehead.tilegame.FMTKYLevel
{
var $name, $boolAr, $dynamicObsMap, $floorObArray, $visited;
function FMTKYLevel (n, bArray) {
trace("INIT " + n);
$name = n;
$boolAr = bArray;
$dynamicObsMap = new Object();
$floorObArray = new Array();
$visited = false;
}
function set visited(b) {
$visited = b;
//return(visited);
}
function get visited() {
return($visited);
}
function getFlag(cs) {
if ($boolAr[cs] != undefined) {
return($boolAr[cs]);
}
return(false);
}
function setFlag(cs, b) {
$boolAr[cs] = b;
}
function set floorObArray(ar) {
$floorObArray = ar;
//return(floorObArray);
}
function get floorObArray() {
return($floorObArray);
}
function set dynamicObsMap(ob) {
$dynamicObsMap = ob;
//return(dynamicObsMap);
}
function get dynamicObsMap() {
return($dynamicObsMap);
}
}
Symbol 903 MovieClip [__Packages.com.doodlehead.maincontroller.MainControllerSubsidiary] Frame 0
class com.doodlehead.maincontroller.MainControllerSubsidiary
{
function MainControllerSubsidiary () {
}
static function getOrthDepth(i, j, dgap) {
var _local2 = 0;
var _local1 = 0;
var _local5 = 0;
if (i > j) {
_local2 = i;
_local1 = j;
} else {
_local2 = j;
_local1 = i;
_local5 = 1;
}
_local2 = i;
_local1 = j;
return(((_local2 * 500) + (_local1 * dgap)) + _local5);
}
}
Symbol 904 MovieClip [__Packages.com.doodlehead.tilegame.TileWithBorders] Frame 0
class com.doodlehead.tilegame.TileWithBorders
{
var occupied, wallsar, moveable, mynumb, myorientation, isLandMine, myLandMineOrders;
function TileWithBorders (oc, wl, mo) {
occupied = oc;
wallsar = wl;
moveable = mo;
mynumb = -1;
myorientation = 1;
isLandMine = false;
myLandMineOrders = "";
}
function get orientation() {
return(myorientation);
}
function set orientation(n) {
myorientation = n;
//return(orientation);
}
function get numb() {
return(mynumb);
}
function set numb(n) {
mynumb = n;
//return(numb);
}
function get walkable() {
return(moveable);
}
function set walkable(b) {
moveable = b;
//return(walkable);
}
function get walls() {
return(wallsar);
}
function set walls(ar) {
wallsar = ar;
//return(walls);
}
function get isEmpty() {
return(occupied);
}
function set isEmpty(b) {
occupied = b;
//return(isEmpty);
}
function setLandMine(b, s) {
isLandMine = b;
myLandMineOrders = s;
}
function get landMine() {
return(isLandMine);
}
function get landMineOrders() {
return(myLandMineOrders);
}
}
Symbol 194 MovieClip [M_Load Indicator] Frame 1
#initclip 54
Object.registerClass("M_Load Indicator", com.doodlehead.view.FMTKYLoadIndicator);
#endinitclip
Symbol 196 MovieClip Frame 1
function unknownToArray(ob) {
if (ob.length == undefined) {
return(new Array(ob));
}
var _local3 = new Array();
var _local1 = 0;
while (_local1 < ob.length) {
_local3.push(ob[_local1]);
_local1++;
}
return(_local3);
}
function loadInit(ar) {
toLoadAr = ar;
this.createEmptyMovieClip("loader", this.getNextHighestDepth());
loader._visible = false;
loader._x = -400;
loader.volumeControl = new Sound(loader);
loader.volumeControl.setVolume(0);
var _local2 = 0;
while (_local2 < toLoadAr.length) {
loader.createEmptyMovieClip(toLoadAr[_local2], loader.getNextHighestDepth());
_local2++;
}
loadDude();
}
function clearOut() {
mcLoader.removeListener(mylistener);
for (var _local1 in loader) {
if (loader[_local1].getBytesTotal() != undefined) {
byteTotal = byteTotal + loader[_local1].getBytesTotal();
}
}
trace("TOTAL BYTES " + byteTotal);
delete mcLoader;
delete mylistener;
delete loadListener;
delete onEnterFrame;
loader.removeMovieClip();
isLoadDone = true;
}
function addToTotal() {
runningTotal = runningTotal + loader[toLoadAr[toLoadCtr]].getBytesTotal();
}
function loadDude() {
trace((((("LOAD " + toLoadAr[toLoadCtr]) + " ") + toLoadCtr) + " :: ") + toLoadAr.length);
mcLoader.loadClip(toLoadAr[toLoadCtr] + ".swf", loader[toLoadAr[toLoadCtr]]);
loadListener.onLoadComplete = function (target_mc, httpStatus) {
this.parent.addToTotal();
this.parent.toLoadCtr++;
if (this.parent.toLoadCtr < this.parent.toLoadAr.length) {
this.parent.loadDude();
} else {
this.parent.clearOut();
}
};
}
function subLoad() {
var _local1 = loader[toLoadAr[toLoadCtr]].getBytesLoaded();
if (_local1 != undefined) {
pctLoaded = (_local1 + runningTotal) / knownTotal;
_mcLoadBar.setPercent(pctLoaded);
}
}
stop();
var loadListener = new Object();
loadListener.parent = this;
var mcLoader = new MovieClipLoader();
var mylistener = mcLoader.addListener(loadListener);
var toLoadAr = new Array();
var toLoadCtr = 0;
var xparser;
var configob;
var pctLoaded = 0;
var byteTotal = this.getBytesTotal();
var knownTotal = 1351613;
var runningTotal = 0;
var isLoadDone = false;
this.onEnterFrame = initialLoad;
Symbol 206 MovieClip Frame 1
stop();
Symbol 206 MovieClip Frame 14
gotoAndPlay (6);
Symbol 214 MovieClip Frame 2
stop();
Symbol 214 MovieClip Frame 4
stop();
Symbol 226 MovieClip Frame 1
stop();
Symbol 226 MovieClip Frame 25
gotoAndStop (1);
Symbol 226 MovieClip Frame 36
gotoAndStop (1);
Symbol 229 MovieClip Frame 2
stop();
Symbol 229 MovieClip Frame 4
stop();
Symbol 230 MovieClip Frame 1
stop();
Symbol 230 MovieClip Frame 2
stop();
Symbol 236 MovieClip Frame 2
stop();
Symbol 236 MovieClip Frame 4
stop();
Symbol 271 MovieClip Frame 1
stop();
Symbol 271 MovieClip Frame 2
stop();
Symbol 274 MovieClip Frame 1
stop();
Symbol 274 MovieClip Frame 2
stop();
Symbol 290 MovieClip Frame 1
stop();
Symbol 292 MovieClip Frame 1
stop();
Symbol 292 MovieClip Frame 3
gotoAndStop (1);
Symbol 292 MovieClip Frame 153
endAnimation();
stop();
Symbol 293 MovieClip Frame 1
stop();
Symbol 293 MovieClip Frame 2
stop();
Symbol 293 MovieClip Frame 3
gotoAndStop (1);
Symbol 293 MovieClip Frame 153
endAnimation();
Symbol 293 MovieClip Frame 156
stop();
Symbol 294 MovieClip [l_dynamicObject] Frame 1
stop();
Symbol 308 MovieClip Frame 1
stop();
Symbol 308 MovieClip Frame 2
stop();
Symbol 329 MovieClip Frame 5
this.stop();
Symbol 330 MovieClip [M_Object Copy Room Door] Frame 1
#initclip 62
Object.registerClass("M_Object Copy Room Door", com.doodlehead.view.ObjectActionable);
#endinitclip
stop();
Symbol 330 MovieClip [M_Object Copy Room Door] Frame 5
endAnimation();
stop();
Symbol 333 MovieClip [l_doortile] Frame 1
#initclip 55
Object.registerClass("l_doortile", com.doodlehead.view.ObjectActionable);
#endinitclip
stop();
Symbol 333 MovieClip [l_doortile] Frame 5
endAnimation();
stop();
Symbol 342 MovieClip Frame 25
stop();
Symbol 347 MovieClip Frame 25
stop();
Symbol 348 MovieClip Frame 1
stop();
state = "down";
Symbol 348 MovieClip Frame 2
stop();
state = "up";
Symbol 353 MovieClip Frame 1
stop();
Symbol 353 MovieClip Frame 5
stop();
Symbol 353 MovieClip Frame 10
stop();
Symbol 357 MovieClip [l_elevator] Frame 1
#initclip 56
Object.registerClass("l_elevator", com.doodlehead.view.ObjectActionable);
#endinitclip
stop();
Symbol 357 MovieClip [l_elevator] Frame 9
endAnimation();
stop();
Symbol 387 MovieClip Frame 1
stop();
Symbol 387 MovieClip Frame 2
stop();
Symbol 395 MovieClip Frame 1
stop();
Symbol 395 MovieClip Frame 5
endAnimation();
stop();
Symbol 398 MovieClip Frame 1
stop();
Symbol 398 MovieClip Frame 2
stop();
Symbol 495 MovieClip [l_restroom_mens] Frame 1
#initclip 57
Object.registerClass("l_restroom_mens", com.doodlehead.view.ObjectActionable);
#endinitclip
stop();
Symbol 495 MovieClip [l_restroom_mens] Frame 9
endAnimation();
stop();
Symbol 497 MovieClip [l_restroom_womens] Frame 1
#initclip 58
Object.registerClass("l_restroom_womens", com.doodlehead.view.ObjectActionable);
#endinitclip
stop();
Symbol 497 MovieClip [l_restroom_womens] Frame 9
endAnimation();
stop();
Symbol 511 MovieClip [l_serverRoomDoor] Frame 1
#initclip 59
Object.registerClass("l_serverRoomDoor", com.doodlehead.view.ObjectActionable);
#endinitclip
stop();
Symbol 511 MovieClip [l_serverRoomDoor] Frame 5
endAnimation();
stop();
Symbol 540 MovieClip Frame 2
var nd = this.getNextHighestDepth();
var rx = (Math.floor(Math.random() * 20) + 10);
this.attachMovie("l_eyeball", "eye" + nd, nd, {_x:rx, _y:35, _alpha:1});
var eyeob = this["eye" + nd];
eyeob.dy = 0;
eyeob.onEnterFrame = function () {
if (this._y > 10) {
this.dy = this.dy - 0.1;
if (this.dy < -1.2) {
this.dy = -1.2;
}
this._y = this._y + this.dy;
if (this._y < 10) {
this._y = 10;
}
this._alpha = Math.floor(40 - ((40 * (this._y - 10)) / 25));
if (this._y == 10) {
delete this.onEnterFrame;
}
}
};
Symbol 540 MovieClip Frame 5
gotoAndStop (1);
Symbol 541 MovieClip Frame 1
stop();
Symbol 541 MovieClip Frame 2
stop();
Symbol 550 MovieClip [l_object] Frame 1
stop();
Symbol 552 MovieClip [l_transitionMask] Frame 16
loadNextLevel();
stop();
Symbol 552 MovieClip [l_transitionMask] Frame 32
this.removeMovieClip();
Symbol 553 MovieClip [l_transitionMaskIn] Frame 16
this.removeMovieClip();
Symbol 559 MovieClip Frame 1
stop();
Symbol 560 MovieClip [l_bathroomStall] Frame 1
stop();
Symbol 575 MovieClip [l_wall_execrecep] Frame 1
stop();
Symbol 578 MovieClip [l_wall_midlevel] Frame 1
stop();
Symbol 582 MovieClip Frame 1
stop();
Symbol 584 MovieClip Frame 1
stop();
Symbol 594 MovieClip Frame 1
stop();
Symbol 603 MovieClip Frame 1
stop();
Symbol 614 MovieClip Frame 1
stop();
Symbol 621 MovieClip Frame 1
stop();
Symbol 621 MovieClip Frame 3
stop();
Symbol 629 MovieClip Frame 1
stop();
Symbol 629 MovieClip Frame 40
endAnimation();
stop();
Symbol 630 MovieClip [l_wallDecals] Frame 1
stop();
Symbol 633 MovieClip [l_wall_server] Frame 1
stop();
Symbol 643 MovieClip Frame 1
gotoAndPlay(random(200) + 1);
Symbol 644 MovieClip Frame 1
gotoAndPlay(random(300) + 1);
Symbol 647 MovieClip Frame 1
gotoAndPlay(random(400) + 1);
Symbol 797 MovieClip [K_shark_attack] Frame 1
#initclip 60
Object.registerClass("K_shark_attack", com.doodlehead.view.ObjectActionable);
#endinitclip
Symbol 797 MovieClip [K_shark_attack] Frame 74
stop();
this._parent.play();
Symbol 801 MovieClip Frame 1
stop();
Symbol 802 MovieClip [aquarium_mc] Frame 1
#initclip 61
Object.registerClass("aquarium_mc", com.doodlehead.view.ObjectActionable);
#endinitclip
Symbol 802 MovieClip [aquarium_mc] Frame 2
stop();
Symbol 802 MovieClip [aquarium_mc] Frame 4
stop();
Symbol 802 MovieClip [aquarium_mc] Frame 5
endAnimation();
gotoAndPlay ("diabled");
Symbol 802 MovieClip [aquarium_mc] Frame 7
stop();
Symbol 802 MovieClip [aquarium_mc] Frame 8
endAnimation();
gotoAndPlay ("diabled");
Symbol 802 MovieClip [aquarium_mc] Frame 10
stop();
Symbol 832 MovieClip Frame 59
stop();
Symbol 833 MovieClip [l_floorObs] Frame 1
stop();
Symbol 833 MovieClip [l_floorObs] Frame 4
stop();
Symbol 833 MovieClip [l_floorObs] Frame 7
stop();
Symbol 854 MovieClip [on-off_btn] Frame 1
#initclip 63
Object.registerClass("on-off_btn", com.doodlehead.userdisplay.AudioOnOff);
#endinitclip
stop();
Symbol 855 MovieClip [M_GameScreen] Frame 1
#initclip 65
Object.registerClass("M_GameScreen", com.doodlehead.maincontroller.MainController);
#endinitclip
Symbol 860 MovieClip [M_FMTKY GAME] Frame 1
#initclip 64
Object.registerClass("M_FMTKY GAME", com.doodlehead.tilegame.FMTKY);
#endinitclip
Symbol 860 MovieClip [M_FMTKY GAME] Frame 2
initSoundButton();
initGamePlay();
Symbol 860 MovieClip [M_FMTKY GAME] Frame 4
stop();
Symbol 860 MovieClip [M_FMTKY GAME] Frame 7
stop();
Symbol 860 MovieClip [M_FMTKY GAME] Frame 10
stop();