Frame 4
_global.gRoot = this;
_global.gTrace = function (str) {
gRoot.tBox.text = gRoot.tBox.text + (str + "\r");
};
_global.gTrace2 = function (str) {
gRoot.tBox.text = gRoot.tBox.text + (str + " ");
};
_global.gSilent = false;
init = function () {
_global.gPapa = new Papa(this);
gPapa.init();
};
Papa = function (mc) {
this.mc = mc;
this.settings();
};
Papa.prototype.settings = function () {
_global.gWidth = 590;
_global.gHeight = 460;
this.levels = 3;
this.levelStart = 0;
};
Papa.prototype.init = function () {
this.preload();
};
Papa.prototype.preload = function () {
var _local1 = this;
var _local2 = _global;
_local1.mc.mcSound.loadMovie("papa_sound.swf");
_local1.mc.mcSound.hide();
_local2.gSplash = new Splash(_local1.mc.mcSplash);
_local2.gPreloader = new Preloader(_local1.mc.mcPreloader, "preloadDone", _local1);
_local2.gInstruct = new Instruct(_local1.mc.mcInstruct);
_local2.gJukebox = new Jukebox(_local1.mc.mcJukebox);
gJukebox.buildPre();
gPreloader.begin();
gSplash.open();
};
Papa.prototype.preloadDone = function () {
};
Papa.prototype.enter = function () {
var _local1 = this;
gRoot.gotoAndStop("begin");
_local1.build();
gCast.open();
_local1.mc.mcMain._alpha = 100;
gLevel.setNum(_local1.levelStart);
};
Papa.prototype.action = function () {
gLevel.reset();
gLevel.begin();
gLevel.action();
};
Papa.prototype.build = function () {
var _local1 = _global;
var _local2 = this;
_local1.gUser = new User();
_local1.gCast = new Cast(_local2.mc.mcCast);
_local1.gWorld = new World();
_local1.gMapData = new MapData();
_local1.gBoard = new Board(_local2.mc.mcMain.mcBoard);
_local1.gClocker = new Clocker(_local2.mc.mcMain.mcDash.mcClocker);
_local1.gHealth = new Health(_local2.mc.mcMain.mcDash.mcHealth);
_local1.gScore = new Score(_local2.mc.mcMain.mcDash.mcScore);
_local1.gInterface = new Interface(_local2.mc.mcMain.mcInterface);
_local1.gTrans = new Trans(_local2.mc.mcTrans);
_local1.gFinale = new Finale(_local2.mc.mcFinale);
_local1.gLevel = new Level();
gJukebox.buildMain();
};
World = function () {
this.settings();
this.init();
};
World.prototype.settings = function () {
this.aGrav = -4;
};
World.prototype.init = function () {
};
User = function (mc) {
var _local1 = this;
_local1.mc = mc;
_local1.settings();
_local1.init();
};
User.prototype.settings = function () {
};
User.prototype.init = function () {
var _local1 = this;
Mouse.addListener(_local1);
Key.addListener(_local1);
_local1.reset();
};
User.prototype.keyToInd = function (k) {
var _local1;
switch (k) {
case 38 :
_local1 = 0;
break;
case 40 :
_local1 = 1;
break;
case 37 :
_local1 = 2;
break;
case 39 :
_local1 = 3;
break;
case 32 :
_local1 = 4;
break;
}
return(_local1);
return(_local1);
};
User.prototype.onKeyDownOn = function () {
this.first();
gAvatar.keyDown(this.keyToInd(Key.getCode()));
};
User.prototype.onKeyUpOn = function () {
gAvatar.keyUp(this.keyToInd(Key.getCode()));
};
User.prototype.reset = function () {
this.first = this.firstOn;
};
User.prototype.enable = function () {
var _local1 = this;
_local1.onKeyDown = _local1.onKeyDownOn;
_local1.onKeyUp = _local1.onKeyUpOn;
};
User.prototype.disable = function () {
var _local1 = this;
_local1.keyUpAll();
_local1.onKeyDown = null;
_local1.onKeyUp = null;
};
User.prototype.firstOn = function () {
this.first = null;
gInterface.userFirst();
gLevel.prepareEnemy(1);
};
Preloader = function (mc, funcName, funcScope) {
var _local1 = this;
_local1.mc = mc;
_local1.funcName = funcName;
_local1.funcScope = funcScope;
_local1.settings();
_local1.init();
};
Preloader.prototype.settings = function () {
var _local1 = this;
_local1.mc0 = gRoot;
_local1.mc1 = gRoot;
_local1.tMin = 3;
};
Preloader.prototype.init = function () {
var _local1 = this;
_local1.mc.obj = _local1;
_local1.mc.onEnterFrame = function () {
this.obj.update();
};
_local1.setDisplay(0);
_local1.mc._alpha = 100;
_local1.hide();
};
Preloader.prototype.begin = function () {
var _local1 = this;
_local1.t0 = getTimer() / 1000;
_local1.update = _local1.updateOn;
};
Preloader.prototype.updateOn = function () {
var _local1 = this;
var ld0 = (_local1.mc0.getBytesLoaded() / 1024);
var ld1 = (_local1.mc1.getBytesLoaded() / 1024);
var tot0 = (_local1.mc0.getBytesTotal() / 1024);
var tot1 = (_local1.mc1.getBytesTotal() / 1024);
var _local3 = 5;
if (tot0 < _local3) {
ld0 = 0;
}
if (tot1 < _local3) {
ld1 = 0;
}
var _local2 = (ld0 + ld1) / (tot0 + tot1);
var elap = ((getTimer() / 1000) - _local1.t0);
var tRat = (elap / _local1.tMin);
if (_local2 > tRat) {
_local2 = tRat;
}
if (_local2 >= 1) {
_local1.done();
} else {
_local1.setDisplay(_local2);
}
};
Preloader.prototype.setDisplay = function (rat) {
this.mc.tBox.text = Math.round(rat * 100) + "%";
};
Preloader.prototype.done = function () {
var _local1 = this;
_local1.setDisplay(1);
_local1.mc.mcText.hide();
_local1.mc.gotoAndStop(2);
var _local2 = _local1.funcScope[_local1.funcName];
_local2.call(_local1.funcScope);
_local1.funcScope = (_local1.funcName = null);
_local1.update = null;
delete _local1.mc.onEnterFrame;
};
Preloader.prototype.show = function () {
this.mc.show();
};
Preloader.prototype.hide = function () {
this.mc.hide();
};
Clocker = function (mc) {
var _local1 = this;
_local1.mc = mc;
_local1.settings();
_local1.init();
};
Clocker.prototype.settings = function () {
var _local1 = this;
_local1.isPaused = true;
_local1.tTotal = 0;
_local1.fUpdate = 15;
_local1.tBox = _local1.mc.mcDigital.tBox;
_local1.f = 0;
_local1.tSec0;
var hours = 7;
var _local2 = 0;
var _local3 = 0;
_local1.tSec1 = (((hours * 60) + _local2) * 60) + _local3;
};
Clocker.prototype.init = function () {
var _local1 = this;
_local1.mc.obj = _local1;
_local1.mc.onEnterFrame = function () {
this.obj.update();
};
};
Clocker.prototype.updateOn = function () {
var _local1 = this;
_local1.f++;
if ((_local1.f % _local1.fUpdate) == 0) {
_local1.tTotal = getTimer() - _local1.t0;
_local1.setTextElapsed(_local1.tTotal);
_local1.checkDeadline();
}
};
Clocker.prototype.togglePause = function () {
var _local1 = this;
if (_local1.isPaused) {
_local1.unpause();
} else {
_local1.pause();
}
};
Clocker.prototype.unpause = function () {
var _local1 = this;
if (_local1.isPaused) {
if (_local1.t0 == null) {
_local1.t0 = getTimer();
} else {
var _local2 = getTimer() - _local1.tMark;
_local1.t0 = _local1.t0 + _local2;
}
_local1.isPaused = false;
_local1.update = _local1.updateOn;
}
};
Clocker.prototype.pause = function () {
var _local1 = this;
if (!_local1.isPaused) {
_local1.tMark = getTimer();
_local1.isPaused = true;
_local1.update = null;
}
};
Clocker.prototype.reset = function () {
var _local1 = this;
_local1.tDeadline = gLevel.deadline;
_local1.tSec0 = _local1.tSec1 - _local1.tDeadline;
_local1.tTotal = 0;
_local1.t0 = null;
_local1.setTextElapsed(0);
};
Clocker.prototype.kill = function () {
};
Clocker.prototype.checkDeadline = function (sec) {
var _local1 = sec;
_local1 = Math.floor(this.tTotal / 1000);
if ((_local1 > gLevel.deadline) && (!gAvatar.isOver)) {
gLevel.late();
}
};
Clocker.prototype.setTextElapsed = function (pTime) {
var _local3 = this;
var _local1 = pTime;
var _local2;
_local1 = _local1 + (1000 * _local3.tSec0);
var mill = (_local1 % 1000);
if (mill < 10) {
_local2 = "00";
} else if (mill < 100) {
_local2 = "0";
} else {
_local2 = "";
}
var millStr = (_local2 + mill);
_local1 = (_local1 - mill) / 1000;
var secs = (_local1 % 60);
if (secs < 10) {
_local2 = "0";
} else {
_local2 = "";
}
var secsStr = (_local2 + secs);
_local1 = (_local1 - secs) / 60;
var mins = (_local1 % 60);
if (mins < 10) {
_local2 = "0";
} else {
_local2 = "";
}
var minsStr = (_local2 + mins);
_local1 = (_local1 - mins) / 60;
var hour = _local1;
_local2 = "";
var hourStr = (_local2 + hour);
var fElapsed = _local3.tBox;
fElapsed.text = (hourStr + ":") + minsStr;
if (secs != _local3.secs0) {
var mcHand = _local3.mc.mcAnalog.mcHandSec;
var incr = 6;
mcHand._rotation = incr * secs;
}
_local3.mill0 = mill;
_local3.secs0 = secs;
_local3.mins0 = mins;
_local3.hour0 = hour;
};
Health = function (mc) {
var _local1 = this;
_local1.mc = mc;
_local1.settings();
_local1.init();
};
Health.prototype.settings = function () {
this.width = 300;
this.rat;
};
Health.prototype.init = function () {
var _local1 = this;
_local1.build();
_local1.mc.obj = _local1;
_local1.mc.onEnterFrame = function () {
this.obj.update();
};
_local1.reset();
};
Health.prototype.build = function () {
var _local3 = this;
var _local2 = _local3.mc.mcMeter.mcLights;
_local3.lightArr = new Array();
for (var name in _local2) {
var _local1 = _local2[name];
if (typeof(_local1) == "movieclip") {
_local3.lightArr.push(_local1);
}
}
_local3.lights = _local3.lightArr.length;
};
Health.prototype.setValue = function (rat) {
var _local1 = rat;
_local1 = Math.constrain(_local1, 0, 1);
this.rat = _local1;
this.checkDeath();
};
Health.prototype.incr = function (d) {
this.setValue(this.getValue() + d);
};
Health.prototype.getValue = function () {
return(this.rat);
};
Health.prototype.reset = function () {
var _local1 = this;
_local1.setValue(1);
_local1.setDisplay(1);
_local1.switchAllLights(1);
};
Health.prototype.startUpdate = function () {
this.update = this.updateOn;
};
Health.prototype.stopUpdate = function () {
this.update = null;
};
Health.prototype.updateOn = function () {
var _local1 = this;
var _local3 = _local1.rat - _local1.ratDisplay;
var _local2 = 0.5;
_local1.setDisplay(_local1.ratDisplay + (_local3 * _local2));
_local1.updateLights();
};
Health.prototype.setDisplay = function (rat) {
var _local1 = this;
_local1.ratDisplay = rat;
var _local2 = _local1.mc.mcMeter.mcMark;
_local2._x = Math.round(_local1.width * rat);
};
Health.prototype.updateLights = function () {
var _local1 = this;
var _local2 = Math.floor(_local1.ratDisplay * _local1.lights);
if (_local2 != _local1.ind0) {
if (Math.abs(dir) > 1) {
_local1.splitAllLights(_local2);
} else {
_local1.switchLight(_local2, 0.5);
var dir = (_local2 - _local1.ind0);
if (dir > 0) {
_local1.switchLight(_local1.ind0, 1);
} else {
_local1.switchLight(_local1.ind0, 0);
}
}
_local1.ind0 = _local2;
}
};
Health.prototype.splitAllLights = function (indSplit) {
var _local2 = this;
var _local3 = indSplit;
_local2.switchLight(_local3, 0.5);
var _local1 = 0;
while (_local1 < _local2.lightArr.length) {
if (_local1 < _local3) {
_local2.switchLight(_local1, 1);
} else if (_local1 > _local3) {
_local2.switchLight(_local1, 0);
}
_local1++;
}
};
Health.prototype.switchAllLights = function (mode) {
var _local2 = this;
var _local3 = mode;
var _local1 = 0;
while (_local1 < _local2.lightArr.length) {
_local2.switchLight(_local1, _local3);
_local1++;
}
};
Health.prototype.checkDeath = function () {
if (this.rat <= 0) {
this.switchAllLights(0);
gLevel.die();
}
};
Health.prototype.switchLight = function (ind, mode) {
var _local1 = this.lightArr[ind];
switch (mode) {
case 1 :
_local1.mcOn._alpha = 100;
_local1.mcOn.gotoAndStop("norm");
_local1.mcOn.show();
return;
case 0.5 :
_local1.mcOn._alpha = 70;
_local1.mcOn.gotoAndPlay("flicker");
_local1.mcOn.show();
return;
case 0 :
_local1.mcOn.hide();
_local1.mcOn.gotoAndStop("norm");
return;
}
};
Score = function (mc) {
var _local1 = this;
_local1.mc = mc;
_local1.settings();
_local1.init();
};
Score.prototype.settings = function () {
};
Score.prototype.init = function () {
this.build();
this.reset();
};
Score.prototype.build = function () {
};
Score.prototype.setValue = function (v) {
this.value = v;
this.updateDisplay();
};
Score.prototype.incr = function (v) {
var _local1 = this;
_local1.setValue(_local1.getValue() + v);
if (_local1.getValue() >= gLevel.coinTotal) {
if (gLevel.getNum() != 2) {
_local1.switchSecret(1);
}
}
};
Score.prototype.getValue = function () {
return(this.value);
};
Score.prototype.reset = function () {
this.setValue(0);
this.switchSecret(0);
};
Score.prototype.updateDisplay = function () {
this.mc.tBox.text = this.value;
};
Score.prototype.switchSecret = function (mode) {
switch (mode) {
case 1 :
this.mc.mcSecret.show();
return;
case 0 :
this.mc.mcSecret.hide();
return;
}
};
Interface = function (mc) {
var _local1 = this;
_local1.mc = mc;
_local1.settings();
_local1.init();
};
Interface.prototype.settings = function () {
};
Interface.prototype.init = function () {
this.hide();
};
Interface.prototype.setContent = function (id) {
this.show();
this.mc.mcContent.gotoAndStop(id);
};
Interface.prototype.show = function () {
this.mc.show();
};
Interface.prototype.hide = function () {
this.mc.hide();
};
Interface.prototype.open = function () {
this.show();
};
Interface.prototype.close = function () {
this.hide();
};
Interface.prototype.press = function (id, param) {
var _local1 = this;
switch (id) {
case "retry" :
gLevel.replay();
_local1.close();
return;
case "replay" :
gLevel.replay();
_local1.close();
return;
case "advance" :
gLevel.advance();
_local1.close();
return;
case "resume" :
gLevel.resume();
return;
case "finale" :
gLevel.finale();
_local1.close();
}
};
Celeb = function (mc, index, id, myCast, isSecret) {
var _local1 = this;
var _local2 = isSecret;
if (_local2 == null) {
_local2 = false;
}
_local1.mc = mc;
_local1.index = index;
_local1.id = id;
_local1.myCast = myCast;
_local1.isSecret = _local2;
_local1.settings();
_local1.init();
};
Celeb.prototype.settings = function () {
this.transHex = 16711782 /* 0xFF0066 */;
};
Celeb.prototype.init = function () {
var _local1 = this;
_local1.build();
_local1.mc.obj = _local1;
_local1.mc.mcContent.obj = _local1;
_local1.mc.onEnterFrame = function () {
this.obj.update();
};
var _local2 = _local1.mc.mcContent.mcHit;
_local2.obj = _local1;
_local2.onRollOver = function () {
this.obj.onRollOver();
};
_local2.onRollOut = function () {
this.obj.onRollOut();
};
_local2.onRelease = function () {
this.obj.onRelease();
};
};
Celeb.prototype.build = function () {
};
Celeb.prototype.lock = function () {
var _local1 = this;
_local1.isLocked = true;
if (_local1.isSecret) {
_local1.hide();
}
_local1.mc.mcContent.gotoAndStop("locked");
_local1.mc.mcContent.mcPerson.mcAvatar.gotoAndStop(_local1.id);
_local1.mc.mcContent.mcShadow.mcAvatar.gotoAndStop(_local1.id);
_local1.mc.mcContent.mcPerson.mcAvatar.mcAnim.mcHead.gotoAndStop(_local1.id);
_local1.mc.mcContent.mcShadow.mcAvatar.mcAnim.mcHead.gotoAndStop(_local1.id);
_local1.mc.mcContent.mcText.gotoAndStop("locked");
};
Celeb.prototype.unlock = function () {
var _local1 = this;
_local1.isLocked = false;
_local1.mc.mcContent.gotoAndStop("unlocked");
_local1.mc.mcContent.mcText.gotoAndStop(_local1.id);
_local1.mc.mcContent.mcPerson.mcAvatar.gotoAndStop(_local1.id);
_local1.mc.mcContent.mcShadow.mcAvatar.gotoAndStop(_local1.id);
_local1.mc.mcContent.mcPerson.mcAvatar.mcAnim.mcHead.gotoAndStop(_local1.id);
_local1.mc.mcContent.mcShadow.mcAvatar.mcAnim.mcHead.gotoAndStop(_local1.id);
_local1.mc.mcContent.mcPerson.mcAvatar.mcAnim.obj = _local1;
if (_local1.isSecret) {
_local1.show();
}
_local1.hideText();
};
Celeb.prototype.enable = function () {
var _local1 = this.mc.mcContent.mcHit;
_local1.enabled = (_local1.useHandCursor = true);
};
Celeb.prototype.disable = function () {
var _local1 = this.mc.mcContent.mcHit;
_local1.enabled = (_local1.useHandCursor = false);
};
Celeb.prototype.enter = function (delay) {
var _local1 = this;
var _local2 = delay;
if (_local2 == null) {
_local2 = 0;
}
var _local3 = true;
if (_local1.isSecret && (_local1.isLocked)) {
_local3 = false;
}
if (_local3) {
_local1.hide();
if (_local2 > 0) {
var id = "enterNowId";
_local1.mc.pauseAndInvokeKillAll();
_local1.mc.pauseAndInvoke(id, _local2, "enterNow", _local1);
} else {
_local1.enterNow();
}
}
};
Celeb.prototype.enterNow = function () {
var _local1 = this;
_local1.mc.setColor(_local1.transHex, 80);
_local1.fEnter = 0;
_local1.update = _local1.updateEnter;
_local1.enable();
};
Celeb.prototype.updateEnter = function () {
var _local1 = this;
if (_local1.fEnter <= 4) {
_local1.mc._visible = !_local1.mc._visible;
} else {
_local1.mc.show();
_local1.update = null;
var _local2 = 15;
_local1.mc.transformColor("linearTween", _local2, "restore");
}
_local1.fEnter++;
};
Celeb.prototype.exit = function (delay) {
var _local1 = this;
var _local2 = delay;
if (_local2 == null) {
_local2 = 0;
}
var _local3 = true;
if (_local1.isSecret && (_local1.isLocked)) {
_local3 = false;
}
if (_local3) {
_local1.disable();
if (_local2 > 0) {
var id = "exitNowId";
_local1.mc.pauseAndInvokeKillAll();
_local1.mc.pauseAndInvoke(id, _local2, "exitNow", _local1);
} else {
_local1.exitNow();
}
}
};
Celeb.prototype.exitNow = function () {
var _local1 = this;
_local1.mc.setColor(_local1.transHex, 80);
_local1.fExit = 0;
_local1.update = _local1.updateExit;
};
Celeb.prototype.updateExit = function () {
var _local1 = this;
if (_local1.fExit <= 3) {
_local1.mc._visible = !_local1.mc._visible;
} else {
_local1.hide();
_local1.update = null;
}
_local1.fExit++;
};
Celeb.prototype.exitSelected = function () {
var _local1 = this;
_local1.update = _local1.updateExitSelected;
_local1.fExit = 0;
_local1.anim("run");
_local1.hideText();
_local1.disable();
};
Celeb.prototype.updateExitSelected = function () {
var _local1 = this;
if (_local1.fExit > gCast.durExit) {
_local1.update = null;
_local1.mc.hide();
} else {
var _local2 = 18;
_local1.mc.mcContent._x = _local1.mc.mcContent._x + _local2;
}
_local1.fExit++;
};
Celeb.prototype.reset = function () {
var _local1 = this;
_local1.anim("still");
_local1.hideText();
_local1.mc.setColor("restore");
_local1.mc.pauseAndInvokeKillAll();
_local1.update = null;
_local1.mc.mcContent._x = 0;
};
Celeb.prototype.onRelease = function () {
if (!this.isLocked) {
gCast.select(this.id);
}
};
Celeb.prototype.onRollOver = function () {
this.anim("run");
this.showText();
var ind = ((Math.random() > 0.5) ? 0 : 2);
var _local2 = "woosh" + ind;
var _local1 = 40;
var _local3 = 0;
gJukebox.startSound(_local2, _local1, _local3);
};
Celeb.prototype.onRollOut = function () {
this.anim("still");
this.hideText();
};
Celeb.prototype.hide = function () {
this.mc.hide();
};
Celeb.prototype.show = function () {
this.mc.show();
};
Celeb.prototype.anim = function (mode) {
var _local1 = this;
var _local2 = mode;
if (_local1.animMode != _local2) {
_local1.animMode = _local2;
_local1.mc.mcContent.mcPerson.mcAvatar.mcAnim.gotoAndPlay(_local2);
_local1.mc.mcContent.mcShadow.mcAvatar.mcAnim.gotoAndPlay(_local2);
}
};
Celeb.prototype.hideText = function () {
this.mc.mcContent.mcText.hide();
};
Celeb.prototype.showText = function () {
this.mc.mcContent.mcText.show();
};
Celeb.prototype.express = function (mode) {
this.mc.mcContent.mcPerson.mcAvatar.mcAnim.mcHead.mcCeleb.mcExpress.gotoAndStop(mode);
};
Cast = function (mc) {
var _local1 = this;
_local1.mc = mc;
_local1.settings();
_local1.init();
};
Cast.prototype.settings = function () {
var _local1 = this;
_local1.celebs = 6;
_local1.idArr = ["russ", "jolie", "tom", "paris", "tara", "mj"];
_local1.nameArr = ["Russell Crowe", "Angelina Jolie", "Tom Cruise", "Paris Hilton", "Tara Reid", "Michael Jackson"];
_local1.unlockSeqArr = [[0, 1], [2], [3]];
_local1.unlockSecretSeqArr = [[], [4], [5]];
_local1.secretCelebs = 2;
_local1.durExit = 50;
_local1.selected;
};
Cast.prototype.init = function () {
var _local1 = this;
_local1.unlockedArr = new Array();
_local1.build();
_local1.hide();
_local1.mc.mcContent.mcCelebs._alpha = 100;
var _local2 = _local1.mc.btnCover;
_local2.hide();
_local2.useHandCursor = (_local2.enabled = false);
};
Cast.prototype.build = function () {
var _local2 = this;
_local2.celebArr = new Array(_local2.celebs);
var _local1 = 0;
while (_local1 < _local2.celebs) {
var index = _local1;
var id = _local2.idArr[_local1];
var mc = _local2.mc.mcContent.mcCelebs["mcCeleb" + _local1];
var isSecret = (_local1 >= (_local2.celebs - _local2.secretCelebs));
var _local3 = new Celeb(mc, index, id, _local2, isSecret);
_local2.celebArr[_local1] = _local3;
_local3.lock();
_local1++;
}
_local2.unlockForLevel(-1);
};
Cast.prototype.unlockForLevel = function (num, secret) {
var _local1 = this;
if (secret == null) {
secret = false;
}
var _local3 = num + 1;
var _local2 = 0;
while (_local2 < _local1.unlockSeqArr[_local3].length) {
var index = _local1.unlockSeqArr[_local3][_local2];
_local1.unlock(index);
_local2++;
}
if (secret) {
_local2 = 0;
while (_local2 < _local1.unlockSecretSeqArr[_local3].length) {
var index = _local1.unlockSecretSeqArr[_local3][_local2];
_local1.unlock(index);
_local2++;
}
}
};
Cast.prototype.select = function (param) {
var _local2 = this;
var _local1 = _local2.getCeleb(param);
_local2.selected = _local1;
_local2.close();
};
Cast.prototype.getSelected = function (prop) {
if (prop == null) {
return(this.selected);
}
return(this.selected[prop]);
};
Cast.prototype.unlock = function (param) {
var _local1 = this.getCeleb(param);
_local1.unlock();
};
Cast.prototype.unlockAll = function () {
var _local2 = this;
var _local1 = 0;
while (_local1 < _local2.celebArr.length) {
_local2.celebArr[_local1].unlock();
_local1++;
}
};
Cast.prototype.getCeleb = function (param) {
var _local3 = this;
var _local2 = param;
if (isNaN(_local2)) {
var _local1 = 0;
while (_local1 < _local3.celebArr.length) {
if (_local2 == _local3.celebArr[_local1].id) {
_local2 = _local1;
break;
}
_local1++;
}
}
return(_local3.celebArr[_local2]);
};
Cast.prototype.open = function () {
var _local3 = this;
_local3.reset();
_local3.show();
_quality = "BEST";
gJukebox.startPiano();
var delay = 0;
var incr = 7;
var _local1 = 0;
while (_local1 < _local3.celebArr.length) {
var _local2 = _local3.celebArr[_local1];
_local2.enter(delay);
delay = delay + incr;
_local1++;
}
_local3.switchText(1);
};
Cast.prototype.close = function () {
var _local2 = this;
var delay = 0;
var incr = 4;
var _local1 = 0;
while (_local1 < _local2.celebArr.length) {
var _local3 = _local2.celebArr[_local1];
if (_local3 != _local2.selected) {
_local3.exit(delay, false);
delay = delay + incr;
}
_local1++;
}
var cSelected = _local2.celebArr[_local2.selected.index];
cSelected.exitSelected();
gJukebox.stopPiano(30);
_local2.switchText(0);
var dur = 30;
var del = ((_local2.durExit - dur) - 5);
var alp = 100;
gTrans.fadeToBlack(dur, alp, del);
var id = "closeDoneId";
_local2.mc.pauseAndInvokeKill(id);
_local2.mc.pauseAndInvoke(id, _local2.durExit, "closeDone", _local2);
};
Cast.prototype.closeDone = function () {
this.hide();
var _local1 = 30;
var _local3 = 0;
var _local2 = 0;
gTrans.fadeToBlack(_local1, _local2, _local3);
gPapa.action();
};
Cast.prototype.show = function () {
this.mc.show();
};
Cast.prototype.hide = function () {
this.mc.hide();
};
Cast.prototype.switchText = function (mode) {
var _local1 = this.mc.mcInstruct;
switch (mode) {
case 1 :
_local1.gotoAndPlay("on");
return;
case 0 :
_local1.gotoAndStop("off");
return;
}
};
Cast.prototype.reset = function () {
var _local2 = this;
var _local1 = 0;
while (_local1 < _local2.celebArr.length) {
_local2.celebArr[_local1].reset();
_local1++;
}
};
Cast.prototype.press = function (id, param) {
if (!(id === "select")) {
} else {
this.select(param);
}
};
Jukebox = function (mc) {
var _local1 = this;
_local1.mc = mc;
_local1.settings();
_local1.init();
};
Jukebox.prototype.settings = function () {
var _local1 = this;
_local1.mcSound = gRoot.mcSound;
_local1.mcSoundPre = gRoot.mcSoundPre;
_local1.sndPreArr = ["music2"];
_local1.sndArr = ["coin0", "latte0", "pop0", "bomb0", "bomb1", "fall0", "fall1", "fall2", "woosh0", "woosh1", "woosh2", "crash0", "music0", "music1"];
_local1.musicMode = 0;
_local1.volMusic0 = 75;
_local1.volMusic1 = 155;
_local1.volPiano = 65;
if (gSilent) {
_local1.volPiano = (_local1.volMusic0 = (_local1.volMusic1 = 0));
}
_local1.isPianoOn = false;
_local1.isMusicOn = false;
};
Jukebox.prototype.init = function () {
var _local1 = this;
_local1.mc.obj = _local1;
_local1.mc.onEnterFrame = function () {
this.obj.update();
};
_local1.isMute = false;
_local1.isMusicOn = false;
_local1.setMasterVol(1);
};
Jukebox.prototype.buildPre = function () {
var _local2 = this.sndPreArr;
var _local1 = 0;
while (_local1 < _local2.length) {
var _local3 = this.makePreSound(_local2[_local1]);
_local1++;
}
};
Jukebox.prototype.buildMain = function () {
var _local2 = this.sndArr;
var _local1 = 0;
while (_local1 < _local2.length) {
var _local3 = this.makeSound(_local2[_local1]);
_local1++;
}
};
Jukebox.prototype.makePreSound = function (linkage) {
var _local1 = this.mcSoundPre;
this.makeSoundIn(linkage, _local1);
};
Jukebox.prototype.makeSound = function (linkage) {
var _local1 = this.mcSound;
this.makeSoundIn(linkage, _local1);
};
Jukebox.prototype.makeSoundIn = function (linkage, mcLoc) {
var _local1 = mcLoc;
var _local2 = linkage;
if (_local1 == null) {
_local1 = this.mcSound;
}
_local1.createEmptyMovieClip(_local2 + "SndHolder", _local1.nextHighestDepth++);
var _local3 = (this[_local2 + "Snd"] = new Sound(_local1[_local2 + "SndHolder"]));
_local3.attachSound(_local2);
return(_local3);
};
Jukebox.prototype.getSound = function (id) {
return(this[id + "Snd"]);
};
Jukebox.prototype.startSound = function (id, vol, pan, offset, loops) {
var _local1 = vol;
var _local3 = loops;
if (_local1 == null) {
_local1 = 100;
}
if (pan == null) {
pan = 0;
}
if (offset == null) {
offset = 0;
}
if (_local3 == null) {
_local3 = 1;
}
_local1 = _local1 * this.masterVol;
var _local2 = this.getSound(id);
if (gSilent) {
_local1 = 0;
}
_local2.setVolume(_local1);
_local2.setPan(pan);
if (!this.isMute) {
_local2.start(offset, _local3);
}
};
Jukebox.prototype.stopSound = function (id) {
var _local1 = this.getSound(id);
_local1.stop();
};
Jukebox.prototype.switchMute = function (mode) {
var _local2 = this;
var _local1 = gPapa.mc.mcMain.mcDash.mcSoundToggle;
switch (mode) {
case 1 :
_local2.isMute = true;
_local2.stopMusic(15);
_local1.gotoAndStop(2);
return;
case 0 :
_local2.isMute = false;
_local2.startMusic();
_local1.gotoAndStop(1);
return;
}
};
Jukebox.prototype.toggle = function () {
var _local1 = this;
if (_local1.isMute) {
_local1.switchMute(0);
} else {
_local1.switchMute(1);
}
};
Jukebox.prototype.setMasterVol = function (rat) {
this.masterVol = rat;
};
Jukebox.prototype.update = function () {
this.updateMusic();
this.updatePiano();
};
Jukebox.prototype.startMusic = function () {
var _local1 = this;
if (!_local1.isMusicOn) {
var _local2 = 1000;
var _local3 = _local1["volMusic" + _local1.musicMode];
_local1.stopSound("music" + _local1.musicMode);
_local1.updateMusic = null;
_local1.startSound("music" + _local1.musicMode, _local3, null, null, _local2);
_local1.isMusicOn = true;
}
};
Jukebox.prototype.stopMusic = function (dur) {
var _local1 = this;
var _local2 = dur;
if (_local2 == null) {
_local2 = 0;
}
if (_local1.isMusicOn) {
_local1.isMusicOn = false;
if (_local2 == 0) {
_local1.stopSound("music0");
} else {
var snd = _local1.getSound("music0");
_local1.updateMusic = _local1.updateFadeMusicOut;
_local1.dFade = _local2;
_local1.fFade = 0;
}
}
};
Jukebox.prototype.switchMusic = function (mode) {
var _local1 = this;
switch (mode) {
case 0 :
if (_local1.musicMode != 0) {
_local1.musicMode = 0;
var _local2 = _local1.getSound("music0");
if (_local2.getVolume() == 0) {
_local1.startSound("music0", _local1.volMusic0, null, null, 10000);
} else {
_local2.setVolume(_local1.volMusic0);
}
_local1.stopSound("music1");
}
return;
case 1 :
if (_local1.musicMode != 1) {
_local1.musicMode = 1;
var _local2 = _local1.getSound("music0");
if (_local2.getVolume() == _local1.volMusic0) {
_local2.setVolume(1);
}
_local1.startSound("music1", _local1.volMusic1, null, null, 10000);
}
return;
}
};
Jukebox.prototype.updateFadeMusicOut = function () {
var _local1 = this;
var snd0 = _local1.getSound("music0");
var snd1 = _local1.getSound("music1");
_local1.fFade++;
if (_local1.fFade >= _local1.dFade) {
snd0.setVolume(0);
snd1.setVolume(0);
_local1.stopSound("music0");
_local1.stopSound("music1");
_local1.updateMusic = null;
} else {
var r = (_local1.fFade / _local1.dFade);
var _local2 = 0;
var _local3 = Math.normalize(_local1.volMusic0, _local2, r);
_local2 = Math.normalize(_local1.volMusic1, _local2, r);
if (_local3 == 1) {
_local3 = 2;
}
if (_local2 == 1) {
_local2 = 2;
}
snd0.setVolume(_local3);
snd1.setVolume(_local2);
}
};
Jukebox.prototype.startPiano = function () {
var _local1 = this;
if (!_local1.isPianoOn) {
var _local2 = 1000;
var _local3 = _local1.volPiano;
_local1.stopSound("music2");
_local1.updatePiano = null;
_local1.startSound("music2", _local3, null, null, _local2);
_local1.isPianoOn = true;
}
};
Jukebox.prototype.stopPiano = function (dur) {
var _local1 = this;
var _local2 = dur;
if (_local2 == null) {
_local2 = 0;
}
if (_local1.isPianoOn) {
_local1.isPianoOn = false;
if (_local2 == 0) {
_local1.stopSound("music2");
} else {
var snd = _local1.getSound("music2");
_local1.updatePiano = _local1.updateFadePianoOut;
_local1.dPiano = _local2;
_local1.fPiano = 0;
}
}
};
Jukebox.prototype.updateFadePianoOut = function () {
var _local1 = this;
var _local2 = _local1.getSound("music2");
_local1.fPiano++;
if (_local1.fPiano >= _local1.dPiano) {
_local2.setVolume(0);
_local1.stopSound("music2");
_local1.updatePiano = null;
} else {
var r = (_local1.fPiano / _local1.dPiano);
var _local3 = Math.normalize(_local1.volPiano, 0, r);
_local2.setVolume(_local3);
}
};
Splash = function (mc) {
var _local1 = this;
_local1.mc = mc;
_local1.settings();
_local1.init();
};
Splash.prototype.settings = function () {
};
Splash.prototype.init = function () {
var _local2 = this;
var _local1 = _local2.mc.mcContent.mcPlay.mcHit;
_local1.obj = _local2;
_local1.onRollOver = function () {
this.obj.playBtnAction("over");
};
_local1.onRollOut = function () {
this.obj.playBtnAction("out");
};
_local1.onRelease = function () {
this.obj.playBtnAction("release");
};
_local1.useHandCursor = (_local1.enabled = false);
};
Splash.prototype.press = function (id, param) {
switch (id) {
case "skip" :
gPapa.levelStart = param;
gPapa.enter();
this.close();
return;
case "start" :
gPapa.enter();
this.close();
return;
}
};
Splash.prototype.open = function () {
var _local1 = this;
_quality = "LOW";
_local1.show();
_local1.mc.mcContent.mcTitle.gotoAndPlay("in");
_local1.switchBeams(1);
_local1.switchLights(1);
gJukebox.startPiano();
};
Splash.prototype.switchBeams = function (mode) {
var _local1 = this;
var _local3 = _local1.mc.mcContent.mcBg.mcSky.mcMask.mcShape;
switch (mode) {
case 1 :
_local3.onEnterFrame = function () {
var _local2 = this;
_local2.f++;
if ((_local2.f % 9) == 0) {
var _local1 = _local2._rotation + 0.6;
if (_local1 >= 90) {
_local1 = 0;
}
_local2._rotation = _local1;
}
};
return;
case 0 :
delete _local3.onEnterFrame;
return;
}
};
Splash.prototype.switchLights = function (mode) {
var mcLights = this.mc.mcContent.mcTitle.mcPapa.mcLights;
switch (mode) {
case 1 :
var offLetter = 0;
for (var name0 in mcLights) {
var _local2 = mcLights[name0];
if (typeof(_local2) == "movieclip") {
var _local3 = offLetter;
for (var name1 in _local2) {
var _local1 = _local2[name1];
if (typeof(_local1) == "movieclip") {
_local1.gotoAndPlay(_local3);
_local3 = _local3 + 2;
}
}
offLetter = offLetter + 4;
}
}
return;
case 0 :
return;
}
};
Splash.prototype.close = function () {
this.hide();
gInstruct.close();
this.switchBeams(0);
};
Splash.prototype.closeFront = function () {
this.mc.mcContent.mcPlay.hide();
this.mc.mcContent.mcTitle.hide();
};
Splash.prototype.show = function () {
this.mc.show();
};
Splash.prototype.hide = function () {
this.mc.hide();
};
Splash.prototype.playNow = function () {
gInstruct.open();
gPreloader.show();
_quality = "BEST";
this.closeFront();
};
Splash.prototype.playBtnAction = function (mode) {
var _local1 = this;
switch (mode) {
case "release" :
_local1.playNow();
_local1.mc.mcContent.mcPlay.mcText.gotoAndPlay("out");
return;
case "over" :
_local1.mc.mcContent.mcPlay.mcText.gotoAndPlay("over");
return;
case "out" :
_local1.mc.mcContent.mcPlay.mcText.gotoAndPlay("out");
}
};
Splash.prototype.animTrig = function (mode) {
switch (mode) {
case "enablePlay" :
var _local1 = this.mc.mcContent.mcPlay.mcHit;
_local1.enabled = (_local1.useHandCursor = true);
gJukebox.stopPiano(90);
return;
default :
}
};
Limo = function (mcHolder) {
var _local1 = this;
_local1.mcHolder = mcHolder;
_local1.settings();
_local1.init();
_local1.build();
};
Limo.prototype.settings = function () {
this.x = 420;
this.y = 290;
};
Limo.prototype.init = function () {
};
Limo.prototype.build = function () {
var _local1 = this;
_local1.mc = _local1.mcHolder.attachMovie("mcLimo", "mcLimo", _local1.mcHolder.nextHighestDepth++);
_local1.mc.obj = _local1;
_local1.mc.mcAnim.obj = _local1;
_local1.mc._x = _local1.x;
_local1.mc._y = _local1.y;
};
Limo.prototype.begin = function () {
this.anim("begin");
};
Limo.prototype.anim = function (mode) {
this.mc.mcAnim.gotoAndPlay(mode);
};
Limo.prototype.kill = function () {
this.mc.removeMovieClip();
};
Limo.prototype.switchDoor = function (mode) {
var _local1 = this.mc.mcAnim.mcBody.mcShell.mcDoor;
switch (mode) {
case 1 :
_local1.show();
return;
case 0 :
_local1.hide();
return;
}
};
Limo.prototype.animTrig = function (mode) {
switch (mode) {
case "enemy" :
gLevel.beginEnemy();
return;
case "avatar" :
gLevel.revealAvatar();
return;
case "done" :
return;
}
};
Trans = function (mc) {
var _local1 = this;
_local1.mc = mc;
_local1.settings();
_local1.init();
};
Trans.prototype.settings = function () {
};
Trans.prototype.init = function () {
var _local1 = this;
_local1.hide();
_local1.mc._alpha = 100;
_local1.mc.mcBlack._alpha = 0;
};
Trans.prototype.show = function () {
this.mc.show();
};
Trans.prototype.hide = function () {
this.mc.hide();
};
Trans.prototype.reset = function () {
this.mc.pauseAndInvokeKillAll();
this.hide();
};
Trans.prototype.fadeToBlack = function (dur, alpha, delay) {
var _local1 = delay;
var _local2 = this;
if (_local1 == null) {
_local1 = 0;
}
if (_local1 > 0) {
_local2.mc.pauseAndInvoke("fadeToBlackId", _local1, "fadeToBlackNow", _local2, dur, alpha);
} else {
_local2.fadeToBlackNow(dur, alpha);
}
};
Trans.prototype.fadeToBlackNow = function (dur, alpha) {
var _local1 = this;
_local1.show();
_local1.mc.mcBlack.transform("linearTween", dur, "_alpha", alpha);
if (alpha == 0) {
_local1.mc.pauseAndInvoke("hideId", dur + 1, "hide", _local1);
}
};
Instruct = function (mc) {
var _local1 = this;
_local1.mc = mc;
_local1.settings();
_local1.init();
};
Instruct.prototype.settings = function () {
this.page = 1;
};
Instruct.prototype.init = function () {
this.mc.mcContent._alpha = 100;
this.hide();
};
Instruct.prototype.hide = function () {
this.mc.hide();
};
Instruct.prototype.show = function () {
this.mc.show();
};
Instruct.prototype.open = function () {
this.show();
};
Instruct.prototype.close = function () {
this.hide();
};
Instruct.prototype.setPage = function (n) {
var _local1 = n;
var _local2 = this;
if (_local1 != _local2.page) {
var mcNav = _local2.mc.mcContent.mcNav;
var _local3 = _local2.mc.mcContent.mcBody;
mcNav.gotoAndStop(_local1);
_local3.gotoAndStop(_local1);
_local2.page = _local1;
}
};
Instruct.prototype.press = function (mode, param) {
switch (mode) {
case "nav" :
this.setPage(param);
return;
case "start" :
return;
}
};
Finale = function (mc) {
var _local1 = this;
_local1.mc = mc;
_local1.settings();
_local1.init();
_local1.build();
};
Finale.prototype.settings = function () {
var _local1 = this;
_local1.patrons = gCast.celebs;
_local1.secretPatrons = gCast.secretCelebs;
_local1.externalSwf = "papa_finale.swf";
_local1.masterDanceArr = [["twist"], ["punch"], ["twist"], ["punch"], ["punch"], ["twist"]];
_local1.dirArr = [1, -1, 1, -1, 1, -1];
_local1.tInitial = 2;
_local1.tReading = 7;
_local1.tBetween = 2;
};
Finale.prototype.init = function () {
var _local1 = this;
_local1.mc._alpha = 100;
_local1.hide();
var _local2 = _local1.mc.btnBlock;
_local2.useHandCursor = (_local2.enabled = false);
_local1.mc.obj = _local1;
};
Finale.prototype.build = function () {
var _local2 = this;
_local2.loadExternal();
_local2.patronArr = new Array(_local2.patrons);
var _local1 = 0;
while (_local1 < _local2.patronArr.length) {
var celebObj = gCast.celebArr[_local1];
var index = _local1;
var id = gCast.idArr[_local1];
var _local3 = _local2.mc.mcContent.mcPatrons["mcPatron" + _local1];
var isSecret = (_local1 >= (_local2.patrons - _local2.secretPatrons));
var p = new Patron(_local3, index, id, _local2, isSecret);
_local2.patronArr[_local1] = p;
_local1++;
}
};
Finale.prototype.loadExternal = function () {
var _local1 = this.mc.mcContent.mcExternal.mcHolder;
_local1.loadMovie(this.externalSwf);
};
Finale.prototype.hide = function () {
this.mc.hide();
};
Finale.prototype.show = function () {
this.mc.show();
};
Finale.prototype.open = function () {
this.show();
var delay = 10;
var incr = 5;
this.orderArr = new Array();
var _local2 = 0;
while (_local2 < this.patronArr.length) {
var _local1 = this.patronArr[_local2];
var celebObj = gCast.celebArr[_local2];
var _local3 = true;
if (celebObj.isLocked) {
_local3 = false;
}
_local1.hide();
if (_local3) {
_local1.open();
_local1.enter(delay);
delay = delay + incr;
this.orderArr.push(_local1);
}
_local2++;
}
var delayDone = delay;
this.mc.pauseAndInvoke("enterDoneId", delayDone, "enterDone", this);
gJukebox.startPiano();
};
Finale.prototype.close = function () {
var _local3 = this;
_local3.hide();
gJukebox.stopPiano(30);
_local3.switchUpdate(0);
var _local1 = 0;
while (_local1 < _local3.orderArr.length) {
var _local2 = _local3.orderArr[_local1];
_local2.close();
_local1++;
}
};
Finale.prototype.enterDone = function () {
this.switchUpdate(1);
};
Finale.prototype.switchUpdate = function (mode) {
var _local1 = this;
switch (mode) {
case 1 :
_local1.mc.onEnterFrame = function () {
this.obj.update();
};
_local1.indOrder = 0;
_local1.update = _local1.updateOn;
_local1.t0 = getTimer() / 1000;
_local1.textMode = "initial";
return;
case 0 :
_local1.mc.onEnterFrame = null;
_local1.update = null;
return;
}
};
Finale.prototype.updateOn = function () {
var _local1 = this;
var _local2 = getTimer() / 1000;
var _local3 = _local2 - _local1.t0;
switch (_local1.textMode) {
case "initial" :
if (_local3 > _local1.tInitial) {
_local1.textMode = "reading";
_local1.openNewText();
_local1.t0 = _local2;
}
return;
case "reading" :
if (_local3 > _local1.tReading) {
_local1.textMode = "between";
_local1.closeCurrText();
_local1.t0 = _local2;
}
return;
case "between" :
if (_local3 > _local1.tBetween) {
_local1.textMode = "reading";
_local1.openNewText();
_local1.t0 = _local2;
}
return;
}
};
Finale.prototype.openNewText = function () {
var _local1 = this;
_local1.indOrder = (_local1.indOrder + 1) % _local1.orderArr.length;
var _local2 = _local1.orderArr[_local1.indOrder];
_local1.patronCurr = _local2;
_local2.openText();
};
Finale.prototype.closeCurrText = function () {
this.patronCurr.closeText();
};
Finale.prototype.press = function (mode) {
switch (mode) {
case "replay" :
this.close();
gLevel.replayAll();
return;
default :
}
};
Patron = function (mc, index, id, myFinale, isSecret) {
var _local1 = this;
var _local2 = isSecret;
if (_local2 == null) {
_local2 = false;
}
_local1.mc = mc;
_local1.index = index;
_local1.myFinale = myFinale;
_local1.id = id;
_local1.isSecret = _local2;
_local1.settings();
_local1.init();
};
Patron.prototype.settings = function () {
var _local1 = this;
_local1.transHex = 16711782 /* 0xFF0066 */;
_local1.thinkHex = 16711782 /* 0xFF0066 */;
_local1.thinkPerc = 50;
_local1.danceArr = _local1.myFinale.masterDanceArr[_local1.index];
};
Patron.prototype.init = function () {
var _local1 = this;
_local1.build();
_local1.mc.obj = _local1;
_local1.mc.mcContent.obj = _local1;
_local1.mc.onEnterFrame = function () {
this.obj.update();
};
mcHit.obj = _local1;
mcHit.onRollOver = function () {
this.obj.onRollOver();
};
mcHit.onRollOut = function () {
this.obj.onRollOut();
};
mcHit.onRelease = function () {
this.obj.onRelease();
};
_local1.hide();
_local1.mcText = _local1.mc._parent["mcText" + _local1.index];
_local1.mcLine = _local1.mc._parent["mcLine" + _local1.index];
var _local3 = _local1.mcText.mcCopy.mcBody;
var _local2 = _local3._totalframes;
_local1.ctText = Math.floor(Math.random() * (_local2 - 0.0001));
_local1.hideText();
};
Patron.prototype.build = function () {
};
Patron.prototype.open = function () {
var _local1 = this;
_local1.mc.mcContent.mcPerson.mcAvatar.gotoAndStop(_local1.id);
_local1.mc.mcContent.mcShadow.mcAvatar.gotoAndStop(_local1.id);
_local1.mc.mcContent.mcPerson.mcAvatar.mcAnim.mcHead.gotoAndStop(_local1.id);
_local1.mc.mcContent.mcShadow.mcAvatar.mcAnim.mcHead.gotoAndStop(_local1.id);
_local1.mcText.mcCopy.gotoAndStop(_local1.id);
_local1.mcText.mcBg.mcFill.gotoAndStop(_local1.id);
_local1.mc.mcContent.mcPerson.mcAvatar.mcAnim.obj = _local1;
var _local2 = _local1.myFinale.dirArr[_local1.index];
_local1.setDir(_local2);
};
Patron.prototype.close = function () {
this.reset();
this.hide();
};
Patron.prototype.enable = function () {
var _local1 = this.mc.mcContent.mcHit;
_local1.enabled = (_local1.useHandCursor = true);
};
Patron.prototype.disable = function () {
var _local1 = this.mc.mcContent.mcHit;
_local1.enabled = (_local1.useHandCursor = false);
};
Patron.prototype.enter = function (delay) {
var _local1 = this;
var _local2 = delay;
if (_local2 == null) {
_local2 = 0;
}
var _local3 = true;
if (_local1.isSecret && (_local1.isLocked)) {
_local3 = false;
}
if (_local3) {
_local1.hide();
if (_local2 > 0) {
var id = "enterNowId";
_local1.mc.pauseAndInvokeKillAll();
_local1.mc.pauseAndInvoke(id, _local2, "enterNow", _local1);
} else {
_local1.enterNow();
}
}
};
Patron.prototype.enterNow = function () {
var _local1 = this;
_local1.switchDance(1);
_local1.mc.setColor(_local1.transHex, 80);
_local1.fEnter = 0;
_local1.update = _local1.updateEnter;
_local1.enable();
};
Patron.prototype.updateEnter = function () {
var _local1 = this;
if (_local1.fEnter <= 4) {
_local1.mc._visible = !_local1.mc._visible;
} else {
_local1.mc.show();
_local1.update = null;
var _local2 = 15;
_local1.mc.transformColor("linearTween", _local2, "restore");
_local1.enterDone();
}
_local1.fEnter++;
};
Patron.prototype.enterDone = function () {
};
Patron.prototype.reset = function () {
var _local1 = this;
_local1.anim("still");
_local1.hideText();
_local1.mc.setColor("restore");
_local1.mc.pauseAndInvokeKillAll();
_local1.update = null;
_local1.mc.mcContent._x = 0;
};
Patron.prototype.onRelease = function () {
};
Patron.prototype.onRollOver = function () {
};
Patron.prototype.onRollOut = function () {
};
Patron.prototype.hide = function () {
this.mc.hide();
};
Patron.prototype.show = function () {
this.mc.show();
};
Patron.prototype.switchDance = function (mode) {
var _local1 = this;
switch (mode) {
case 1 :
var _local2 = _local1.danceArr[0];
_local1.setMove(_local2);
return;
case 0 :
_local1.anim("still");
return;
}
};
Patron.prototype.setNewMove = function () {
var _local1 = this;
var _local2 = Math.floor(Math.random() * (_local1.danceArr.length - 0.0001));
var _local3 = _local1.danceArr[_local2];
_local1.setMove(_local3);
_local1.moveLoopCt = 0;
if (Math.random() > 0.4) {
_local1.flip();
}
};
Patron.prototype.setMove = function (m) {
this.move = m;
this.anim(m, true);
};
Patron.prototype.moveLoop = function () {
var _local1 = this;
_local1.moveLoopCt++;
var _local2 = 3;
if (_local1.moveLoopCt > _local2) {
_local1.setNewMove();
} else {
_local1.anim(_local1.move, true);
}
};
Patron.prototype.flip = function () {
this.setDir(-this.dirCurr);
};
Patron.prototype.anim = function (mode, force) {
var _local1 = this;
var _local2 = mode;
if ((_local1.animMode != _local2) || (force)) {
_local1.animMode = _local2;
_local1.mc.mcContent.mcPerson.mcAvatar.mcAnim.gotoAndPlay(_local2);
_local1.mc.mcContent.mcShadow.mcAvatar.mcAnim.gotoAndPlay(_local2);
}
};
Patron.prototype.express = function (mode) {
this.mc.mcContent.mcPerson.mcAvatar.mcAnim.mcHead.mcCeleb.mcExpress.gotoAndStop(mode);
};
Patron.prototype.openText = function () {
var _local1 = this;
var _local2 = _local1.mcText.mcCopy.mcBody;
var _local3 = _local2._totalframes;
_local1.ctText = (_local1.ctText + 1) % _local3;
_local2.gotoAndStop(_local1.ctText + 1);
var w = (_local2._width + 20);
var h = (_local2._height + 20);
_local1.showText();
var dur = 6;
_local1.mc.transformColor("linearTween", dur, _local1.thinkHex, _local1.thinkPerc);
};
Patron.prototype.closeText = function () {
this.hideText();
var _local1 = 5;
this.mc.transformColor("linearTween", _local1, "restore");
};
Patron.prototype.hideText = function () {
this.mcText.hide();
this.mcLine.hide();
};
Patron.prototype.showText = function () {
this.mcText.show();
this.mcLine.show();
};
Patron.prototype.setDir = function (dir) {
var _local1 = this;
if (dir != _local1.dirCurr) {
_local1.dirCurr = dir;
var _local3 = _local1.mc.mcContent.mcPerson.mcAvatar.mcAnim;
var _local2 = _local1.mc.mcContent.mcShadow.mcAvatar.mcAnim;
_local3._xscale = (_local2._xscale = _local1.dirCurr * 100);
}
};
Patron.prototype.animTrig = function (mode) {
switch (mode) {
case "danceDone" :
this.moveLoop();
return;
default :
}
};
Board = function (mc) {
var _local1 = this;
_local1.mc = mc;
_local1.settings();
_local1.init();
};
Board.prototype.settings = function () {
var _local1 = this;
_local1.sWidth = gWidth;
_local1.sHeight = gHeight;
_local1.sxMin = 0;
_local1.sxMax = _local1.sWidth;
_local1.x0 = 0;
_local1.y0 = 291;
_local1.cellSca = 100;
_local1.cellWid = 70;
_local1.cellHei = 24;
_local1.depthRow0 = 2000;
_local1.depthRowSteps = 1000;
_local1.depthRowStepsRes = 200;
_local1.scrollMargRight = 240;
_local1.scrollMargLeft = 140;
_local1.scrollSpd = 13;
_local1.qPlay0 = "MEDIUM";
_local1.qPlay1 = "BEST";
_local1.qNorm = "BEST";
};
Board.prototype.init = function () {
var _local1 = this;
_local1.mc.obj = _local1;
_local1.mc.onEnterFrame = function () {
this.obj.updateScroll();
this.obj.updateOuter();
};
_local1.vx = 0;
_local1.mc._xscale = (_local1.mc._yscale = 100);
_local1.mc._alpha = 100;
};
Board.prototype.build = function () {
this.buildMap(gLevel.num);
};
Board.prototype.reset = function () {
this.kill();
this.build();
};
Board.prototype.kill = function () {
this.mcHolder.removeMovieClip();
};
Board.prototype.begin = function () {
var _local1 = this;
_local1.resetScroll();
_local1.switchScroll(1);
_local1.switchQuality(1);
};
Board.prototype.buildMap = function (id) {
var _local1 = this;
var mcLoc = _local1.mc.mcContent;
_local1.mcHolder = mcLoc.createEmptyMovieClip("mcHolder" + id, mcLoc.nextHighestDepth++);
delete _local1.mapCurr;
_local1.mapCurr = new Map(id);
var rows = _local1.mapCurr.getRows();
var cols = _local1.mapCurr.getCols();
_local1.cellArr = new Array(rows);
var row = 0;
while (row < rows) {
_local1.cellArr[row] = new Array(cols);
var mcRow = _local1.mcHolder.createEmptyMovieClip("mcRow" + row, _local1.mcHolder.nextHighestDepth++);
var newDepth = (((_local1.depthRow0 + (_local1.depthRowSteps * row)) + _local1.depthRowStepsRes) - 1);
mcRow.swapDepths(newDepth);
var _local2 = 0;
while (_local2 < cols) {
var genus = _local1.mapCurr.getGenus(row, _local2);
var _local3 = new Cell(row, _local2, genus);
_local1.cellArr[row][_local2] = _local3;
_local2++;
}
row++;
}
var row = 0;
while (row < rows) {
var _local2 = 0;
while (_local2 < cols) {
var _local3 = _local1.cellArr[row][_local2];
_local3.build();
_local2++;
}
row++;
}
var mcTiles = _local1.mc.mcBg.mcBase.mcImage.mcRoad.mcTiles;
for (var name in mcTiles) {
var mc = mcTiles[name];
if (typeof(mc) == "movieclip") {
mc.gotoAndStop(gLevel.getNum() + 1);
}
}
var mcBuildings = _local1.mc.mcBg.mcBase.mcImage.mcBuildings;
mcBuildings.gotoAndStop(gLevel.getNum() + 1);
};
Board.prototype.getPersonHolder = function () {
return(this.mcHolder);
};
Board.prototype.getCellHolder = function (row) {
return(this.mcHolder["mcRow" + row]);
};
Board.prototype.getX = function (col, mode) {
var _local1 = this;
var _local3 = mode;
if (_local3 == null) {
_local3 = "corner";
}
switch (_local3) {
case "corner" :
var _local2 = _local1.x0 + (col * _local1.cellWid);
break;
case "center" :
_local2 = _local1.x0 + ((col + 0.5) * _local1.cellWid);
break;
}
return(_local2);
return(_local3);
};
Board.prototype.getY = function (row, mode) {
var _local1 = this;
var _local3 = mode;
if (_local3 == null) {
_local3 = "corner";
}
switch (_local3) {
case "corner" :
var _local2 = _local1.y0 + (row * _local1.cellHei);
break;
case "center" :
_local2 = _local1.y0 + ((row + 0.5) * _local1.cellHei);
break;
}
return(_local2);
return(_local3);
};
Board.prototype.getPersonDepth = function (rowEx, depthOffset) {
var _local1 = this;
var _local2 = rowEx % 1;
var _local3 = rowEx - _local2;
var depthExact = (((_local1.depthRow0 + (_local1.depthRowSteps * _local3)) + _local1.depthRowStepsRes) + Math.floor((_local1.depthRowSteps - _local1.depthRowStepsRes) * _local2));
return(depthExact + depthOffset);
};
Board.prototype.getRow = function (y) {
var _local1 = y - this.y0;
return(Math.floor(_local1 / this.cellHei));
};
Board.prototype.getCol = function (x) {
var _local1 = x - this.x0;
return(Math.floor(_local1 / this.cellWid));
};
Board.prototype.getRowEx = function (y) {
var _local1 = y - this.y0;
return(_local1 / this.cellHei);
};
Board.prototype.markCell = function (row, col) {
var _local1 = this;
_local1.cellMark.mark("off");
_local1.cellMark = _local1.cellArr[row][col];
_local1.cellMark.mark("on");
};
Board.prototype.getCell = function (row, col) {
return(this.cellArr[row][col]);
};
Board.prototype.resetScroll = function () {
this.setScroll(0);
};
Board.prototype.setScroll = function (x) {
var _local1 = this;
var _local2 = x;
var xMin = (-(_local1.getWidth() - _local1.sWidth));
var xMax = 0;
_local2 = Math.round(Math.constrain(_local2, xMin, xMax));
_local1.mc.mcContent._x = _local2;
_local1.mc.mcBg.mcBase._x = _local2;
_local1.x = _local2;
var bgRat = ((_local2 - xMin) / (xMax - xMin));
var xMin = (-(_local1.mc.mcFore._width - _local1.sWidth));
var xMax = 0;
var _local3 = Math.normalize(xMin, xMax, bgRat);
_local1.mc.mcFore._x = _local3;
};
Board.prototype.updateScrollOn = function () {
var _local1 = this;
var x0 = _local1.x;
var _local3 = _local1.xBoardToScreen(gAvatar.x);
if (_local3 < _local1.scrollMargLeft) {
_local1.vx = _local1.scrollSpd;
} else if (_local3 > (_local1.sWidth - _local1.scrollMargRight)) {
_local1.vx = -_local1.scrollSpd;
} else {
_local1.vx = _local1.vx * 0.5;
if (Math.abs(_local1.vx) < 1) {
_local1.vx = 0;
}
}
var _local2 = _local1.x + _local1.vx;
if (_local2 != x0) {
_local1.setScroll(_local2);
_quality = _local1.q0;
} else {
_quality = _local1.q1;
}
};
Board.prototype.switchScroll = function (mode) {
var _local1 = this;
switch (mode) {
case 1 :
_local1.updateScroll = _local1.updateScrollOn;
return;
case 0 :
_local1.updateScroll = null;
return;
}
};
Board.prototype.switchQuality = function (mode) {
var _local1 = this;
switch (mode) {
case 1 :
_local1.q0 = _local1.qPlay0;
_local1.q1 = _local1.qPlay1;
return;
case 0 :
_local1.q0 = (_local1.q1 = _local1.qNorm);
return;
}
};
Board.prototype.xScreenToBoard = function (x) {
return(x - this.x);
};
Board.prototype.xBoardToScreen = function (x) {
return(x + this.x);
};
Board.prototype.getWidth = function () {
return(this.mapCurr.getCols() * this.cellWid);
};
Board.prototype.getHeight = function () {
return(this.mapCurr.getRows() * this.cellHei);
};
Board.prototype.getScreenPan = function (x) {
var _local1 = this;
var _local2 = gBoard.xBoardToScreen(x);
_local2 = Math.constrain(_local2, _local1.sxMin, _local1.sxMax);
var _local3 = (_local2 - _local1.sxMin) / (_local1.sxMax - _local1.sxMin);
var pan = Math.normalize(-100, 100, _local3);
return(pan);
};
Board.prototype.getScreenVicinity = function (x) {
var _local3 = this;
var r;
var isOff;
var maxDist = 800;
var _local2 = _local3.xBoardToScreen(x);
if (_local2 > _local3.sxMax) {
var _local1 = _local2 - _local3.sxMax;
isOff = true;
} else if (_local2 < _local3.sxMin) {
var _local1 = _local3.sxMin - _local2;
isOff = true;
}
if (isOff) {
var _local1 = Math.abs(_local1);
if (_local1 > maxDist) {
_local1 = maxDist;
}
r = 1 - (_local1 / maxDist);
} else {
r = 1;
}
return(r);
};
Map = function (id) {
var _local1 = this;
_local1.id = id;
_local1.settings();
_local1.init();
};
Map.prototype.settings = function () {
};
Map.prototype.init = function () {
this.parse();
};
Map.prototype.parse = function () {
var _local2 = this;
_local2.sourceArr = gMapData["arr" + _local2.id];
_local2.dataArr = new Array(_local2.sourceArr.length);
var _local1 = 0;
while (_local1 < _local2.dataArr.length) {
_local2.dataArr[_local1] = _local2.sourceArr[_local1].split(" ");
_local1++;
}
};
Map.prototype.build = function () {
};
Map.prototype.getRows = function () {
return(this.dataArr.length);
};
Map.prototype.getCols = function () {
return(this.dataArr[0].length);
};
Map.prototype.getGenus = function (row, col) {
return(this.dataArr[row][col]);
};
MapData = function () {
this.settings();
this.init();
};
MapData.prototype.settings = function () {
var _local1 = this;
_local1.arr0 = ["--c --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*+ -*. -*+ --- --- --- -*- -*- -*- --- --- --= --- --+ --. --- --- --- --- --- --- --- --- --- --- --- --- --- -*- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*- -*- -*- -*- --- w-- w-- w-- w-- --- --- ---", "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*- -*- -*- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*+ --- -*+ --- --- --- -*- -*- -*- --- --- --- --- --- -*. --- --- --- --- --- --- --- --- --- --- --- --- -*- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*- -*- -*- -*- --- w-- w-- w-- w-- --- --- ---", "--- --- --- --- --- --- --- --- --- --- --- --- -*- -*- -*. --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*- -*- -*- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*. -b- -*. --- --- --- -*- -*- -*- --- --- --- --- --- -*. --- --- --- --- --- --- --- --- --- --- --- -*- --- -*- --- --- --- --- --- --- --- --- --- --- --- --- -*- -b- -*- --- --- --- --- --- --- --- --- --- --- --- --- ---", "--- --- --- --- --- --- -*- -*- -*- -*- -*- -*- -*- -*- -*+ --- --- -b- --- --- -*- -*= -l- -^- -^- -^- -^- -^- -^- -^- --- -*- -s- -*- --- --- --- --- -*= -*- -*. -*t -*; -*; -lT -^- -^- -^- -sT -^- -^- -^- -*= -*- -*= -*- -*+ -*+ -*. --- -*= --- --- --- -*- -s- -*- --- --- --- -b- --- -*. --- --- --- --- --- --- --- --- --- --- -*- --- --- -*- --- --= --- -*= -*- --- -st --- -*= -*- -*= -*- -*- -*- -*- --- --- --- --- --- --- --- --- --- --- --- --- ---", "--- --- --- --- --- --- --- --- --- --- --- --- -*- -*- -*. --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*- -*- -*- --- --- --- --- -*+ --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*- -*- -*- --- --- --- --- --- -*. --- --- --- --- --- --- --- --- --- -*- --- --- --- -*- --- --- --- --- --- --- --- --- --- --- --- --- -*- -*- -*- --- --- --- --- --- --- --- --- --- --- --- --- ---", "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*- -*- -*- --- --- --- --- -*+ --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*- -*- -*- --- --- --- --- --- -*. --- --- --- --- --- --- --- --- -*- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---", "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*= -*- -*+ --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*- -*- -*- --- --- --- --- --- --. --+ --+ --- -*t -*t -*T -s; --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---"];
_local1.arr1 = ["--c --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*+ --- --- -*- -s- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*= -b- --- --- --- --- --- --- --- --- --- --- --- --- --- w-- w-- w-- w-- --- --- ---", "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -b- --- --- --- --- --- --- --- --- --- --- -*. --- --- -*- -*- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*- --- -*- --- --- --- --- --- --- --- --- --- -*- --- --- --- --- -*- -*- -*- -b- -*- -*- -*- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*- -*- --- --- --- --- --- --- --- --- --- --- --- --- --- w-- w-- w-- w-- --- --- ---", "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*. -*. -*. --- --- -*- -*- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*- --- --- --- -*- --- --- --- --- --- --- --- -*- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*- -*- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---", "--- --- --- --- --- --- -*- -*- -*- -*- -*. -*t -*; -^- -^- -lT -^- -^- -^- -^- -^- -s; -^- -^- -^- --- --- -*. --- --- --- --- -*- -*- --- --- -*= -*- -*t -*: -*; --- --- --- --- --- --- -*- --- --- --- --- --- -s: --- --- --- --- --- -*- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*- -*- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---", "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*+ --- --- --- --- -*- -*- --- --- -*. --- --- --- --- --- --- --- --- --- -b- --- --- --- --- --- --- --- -*- --- --- --- -*- --- --- --- --- -s; --: --= --- --. --. -*. --- -*. --. --. --+ --- -*t -*: -*t --- -*T -*; -*T -*; -sT -^- -*; -*; -^- -^- -lT -^- --- --- --- --- --- -^- -^- -^- -^- -^- -^- -^- -^- --- --- --- --- --- --- --- --- --- ---", "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*+ --- --- --- --- -*- -*- --- --- -*. --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*- --- -*- --- --- --- --- --- --- --- --- --- --- --- -*+ --- -*+ --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -lt ---", "--- --- --- --- --- --- --- --- --- --- -*- -*- -*- -b- -*- -*- --- --- --- --- --- --- --- --- -*f -*- --- --+ --- --- --- --- -b- -*- --- --- -*. --- --- --- --- --- -sT -*t -*. --- --- --- --- --- --- --- --- --- --- --- -*- --- --- --- --- --- --- --- --- --- --- --- --- -*. --. -*. --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*; -*T -*; -*T -*; --- -*T -*; -*T --- -l; --- --- --- --- --- --- --- ---"];
_local1.arr2 = ["--c --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -lT -*- -b- -*- -lT --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- w-- w-- w-- w-- --- --- ---", "--- --- --- --- --- --- --- -b- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*- -*- -*- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -b- -*- --- --- --- --- --- --- --- --- --- --- --- --- -b- --- --- --- -s- --- --- --- --- --- --- --- --- --- -*; -*; -*T --- -*f -*- --- --- --- --- --- --- --- -b- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*+ -*. -*. --+ --- --- --- w-- w-- w-- w-- --- --- ---", "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*: -*: -*T --- --- --- --- --- --- --- --- --- -*- -*- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*+ --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*. --- --- --- --- --- --- --- --- --- --- --- --- ---", "--- --- --- --- --- --- --- --- --- -*. -s: -^- -*f -*- -^- -*: -*t -^- -l; -^- -^- -^- -^- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*- -*- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*: -*t -l: --- --- --- --- --- -*+ --- -b- --- --- --- --- --- --- --- --- --- --- --- -*t -*t --- --- --- --- -*; -*; -s; --- --- --- --- --- -*. --- --- --- --- --- --- --- --- --- --- --- --- ---", "--- --- --- --- --- --- --- --- -*+ -*+ --- --- --- --- --- --- --- --- --- --- --- -*. --- --- --- --- --- --- --- --- --- --- --- -*f -*- --- --- --- --- --- --- -*- -*- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*. --- -*- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*+ --- -*- -s- -*- -*- --- --- --- --- --- --- --- ---", "--- --- --- --- -*- -*- -*- -*= -*- --- --- --- --- --- --- --- --- --- --- --- --- -*+ -*+ --- --- -s- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*- -s- --- -*t -*t -^- -*; -*; -^- -*T -*T -^- -l; -^- -^- -^- -^- -^- -^- -^- -*t -*: -*t --- --- -s- --- --- --- --- --- -*. -*. --- -*- --- -*: -*: -^- -lt -^- -^- -^- -*: -*: --- --- -s- --- -*: -*: --- --- --- --- --- -*f -*- -*. -*= -*- --- --- --- --- --- --- --- --- --- --- --- --- ---", "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -b- --- --- --- -*. -*. --- --- --- --- --- --- --- --- --- --- --- --- -*T -*: -*: --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -*= -*- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---"];
};
MapData.prototype.init = function () {
};
Level = function () {
this.settings();
this.init();
};
Level.prototype.settings = function () {
var _local1 = this;
_local1.scoreAdvanceArr = [100, 100, 100];
_local1.deadlineArr = [540, 360, 240];
_local1.razzTotalArr = [4, 5, 5];
_local1.razzHeadArr = [[2, 3, 1, 1], [2, 3, 1, 1, 1], [2, 3, 1, 1, 1]];
_local1.razzCamArr = [[2, 2, 1, 1], [2, 2, 1, 1, 1], [2, 2, 1, 1, 1]];
};
Level.prototype.init = function () {
};
Level.prototype.reset = function () {
var _local1 = this;
_local1.coinCt = 0;
_local1.coinHighCt = 0;
_local1.kill();
gBoard.reset();
gUser.reset();
gHealth.reset();
gScore.reset();
gClocker.reset();
gLevel.build();
_local1.deadline = _local1.deadlineArr[_local1.getNum()];
};
Level.prototype.build = function () {
this.buildAvatar();
this.buildEnemy();
};
Level.prototype.kill = function () {
gLimo.kill();
gAvatar.kill();
this.killEnemy();
};
Level.prototype.begin = function () {
this.coinTotal = this.coinCt;
gLimo.begin();
gAvatar.begin();
gBoard.begin();
gClocker.reset();
};
Level.prototype.action = function () {
gJukebox.startMusic();
};
Level.prototype.revealAvatar = function () {
gAvatar.intro();
};
Level.prototype.engage = function () {
gClocker.unpause();
gUser.enable();
gAvatar.engage();
};
Level.prototype.die = function () {
this.end();
gAvatar.die();
gInterface.setContent("die");
};
Level.prototype.late = function () {
this.end();
gAvatar.die();
gInterface.setContent("late");
};
Level.prototype.win = function () {
var _local3 = this;
_local3.end();
gAvatar.win();
var _local1 = gScore.getValue();
var _local2 = _local3.getData("scoreAdvance");
if (_local1 >= _local2) {
if (_local3.num >= (gPapa.levels - 1)) {
gInterface.setContent("finale");
} else if (_local1 >= _local3.coinTotal) {
gInterface.setContent("secret");
} else {
gInterface.setContent("advance");
}
} else {
var scoreRemain = (_local1 - _local2);
gInterface.setContent("win");
gInterface.mc.mcContent.tRemain.text = scoreRemain;
}
};
Level.prototype.getNum = function () {
return(this.num);
};
Level.prototype.end = function () {
gJukebox.stopMusic(90);
gUser.disable();
gClocker.pause();
gBoard.switchQuality(0);
};
Level.prototype.buildAvatar = function () {
_global.gAvatar = new Avatar();
_global.gLimo = new Limo(gBoard.mc.mcBg.mcBase.mcHolder);
gAvatar.reset();
gAvatar.placeIn(3, 4);
};
Level.prototype.buildEnemy = function () {
var total = this.getData("razzTotal");
this.razzArr = new Array(total);
var c = 0;
var _local2 = 0;
while (_local2 < total) {
var id = _local2;
var _local1 = new Razz(id);
this.razzArr.push(_local1);
var _local3 = _local1.rowInitial;
var col = _local1.colInitial;
var zAir = _local1.zInitial;
_local1.placeIn(_local3, col, zAir);
_local2++;
}
};
Level.prototype.setNum = function (num) {
this.num = num;
var _local1 = gScore.mc.mcLevelNum;
_local1.gotoAndStop(num + 1);
};
Level.prototype.replayAll = function () {
this.setNum(0);
this.replay();
};
Level.prototype.replay = function () {
this.kill();
gCast.open();
};
Level.prototype.resume = function () {
gJukebox.startMusic();
gAvatar.resume();
gInterface.hide();
gUser.enable();
gClocker.unpause();
};
Level.prototype.advance = function () {
var _local1 = this;
_local1.kill();
var _local2 = ((gScore.getValue() >= _local1.coinTotal) ? true : false);
gCast.unlockForLevel(_local1.num, _local2);
gCast.open();
_local1.setNum(_local1.num + 1);
};
Level.prototype.finale = function () {
this.kill();
gFinale.open();
};
Level.prototype.beginEnemy = function () {
var _local2 = this;
var _local1 = 0;
while (_local1 < _local2.razzArr.length) {
_local2.razzArr[_local1].begin();
_local1++;
}
};
Level.prototype.killEnemy = function () {
var _local2 = this;
var _local1 = 0;
while (_local1 < _local2.razzArr.length) {
_local2.razzArr[_local1].kill();
_local1++;
}
};
Level.prototype.bombAll = function (bombObj) {
var _local3 = this;
var _local1 = 0;
while (_local1 < _local3.razzArr.length) {
var _local2 = _local3.razzArr[_local1];
if (!_local2.isLeech) {
_local2.bomb(bombObj);
}
_local1++;
}
gAvatar.removeAllLeech("bomb", bombObj);
};
Level.prototype.switchEnemyTarget = function (mode) {
var _local3 = this;
var _local1 = 0;
while (_local1 < _local3.razzArr.length) {
var _local2 = _local3.razzArr[_local1];
_local2.switchTarget(mode);
_local1++;
}
};
Level.prototype.prepareEnemy = function (mode) {
var _local3 = this;
var _local1 = 0;
while (_local1 < _local3.razzArr.length) {
var _local2 = _local3.razzArr[_local1];
_local2.prepare();
_local1++;
}
};
Level.prototype.getData = function (id) {
var _local1 = this[id + "Arr"];
return(_local1[this.num]);
};
Cell = function (row, col, genus) {
var _local1 = this;
_local1.genus = genus;
_local1.row = row;
_local1.col = col;
_local1.settings();
_local1.init();
};
Cell.prototype.settings = function () {
};
Cell.prototype.init = function () {
this.setZ(0);
};
Cell.prototype.build = function () {
this.buildGenus();
};
Cell.prototype.setZ = function (z) {
this.z = z;
};
Cell.prototype.setObstacle = function (obst, rowOff, colOff) {
this.myObstacle = obst;
};
Cell.prototype.buildGenus = function () {
var _local1 = this;
var c0 = _local1.genus.substr(0, 1);
var _local3 = _local1.genus.substr(1, 1);
var _local2 = _local1.genus.substr(2, 1);
if ((_local3 != "-") || (_local2 != "-")) {
_local1.buildHolder();
}
switch (c0) {
case "w" :
_local1.isGoal = true;
break;
default :
}
switch (_local2) {
case "." :
_local1.myObstacle = new Hay(_local1, 0);
break;
case ":" :
_local1.myObstacle = new Hay(_local1, 1);
break;
case ";" :
_local1.myObstacle = new Hay(_local1, 2);
break;
case "f" :
_local1.myObstacle = new Fruit(_local1);
break;
case "=" :
_local1.myObstacle = new Bench(_local1);
break;
case "+" :
_local1.myObstacle = new Tree(_local1, 0);
break;
case "t" :
_local1.myObstacle = new Tree(_local1, 1);
break;
case "T" :
_local1.myObstacle = new Tree(_local1, 2);
break;
case "c" :
_local1.myObstacle = new Car(_local1);
break;
}
switch (_local3) {
case "*" :
_local1.myCollect = new Coin(_local1);
return;
case "^" :
_local1.myCollect = new Coin(_local1, true);
return;
case "s" :
_local1.myCollect = new Shield(_local1);
return;
case "l" :
_local1.myCollect = new Latte(_local1);
return;
case "b" :
_local1.myCollect = new Bomb(_local1);
return;
}
};
Cell.prototype.buildHolder = function () {
var _local1 = this;
var _local2 = gBoard.getCellHolder(_local1.row);
var _local3 = (("mcCell_" + _local1.row) + "_") + _local1.col;
if (_local2[_local3] == null) {
_local1.mc = _local2.attachMovie("mcCell", (("mcCell_" + _local1.row) + "_") + _local1.col, _local2.nextHighestDepth++);
_local1.mc._x = gBoard.getX(_local1.col, "corner");
_local1.mc._y = gBoard.getY(_local1.row, "corner");
_local1.mc.mcContent._x = Math.round(gBoard.cellWid / 2);
_local1.mc.mcContent._y = Math.round(gBoard.cellHei / 2);
_local1.mc.mcBorder._xscale = gBoard.cellWid;
_local1.mc.mcBorder._yscale = gBoard.cellHei;
}
};
Cell.prototype.mark = function (mode) {
switch (mode) {
case "on" :
this.mc.mcMark.show();
return;
case "off" :
this.mc.mcMark.hide();
return;
}
};
Cell.prototype.hit = function (p) {
};
Cell.prototype.hitAvatar = function (force) {
var _local1 = this;
var _local3 = force;
if (_local3 == null) {
_local3 = false;
}
if (_local1.hasCollect()) {
var _local2 = gAvatar.getAirZ() - _local1.myCollect.z;
if (_local1.myCollect.z < 100) {
if ((_local2 < 10) || (_local3)) {
_local1.collect();
}
} else if (Math.abs(_local2) < 120) {
_local1.collect();
}
}
if (_local1.isGoal) {
if (gAvatar.isOnGround() || (_local3)) {
if (gAvatar.allowWin) {
gLevel.win();
}
}
} else {
gAvatar.offGoal();
}
};
Cell.prototype.collect = function () {
if (this.hasCollect()) {
this.myCollect.hit();
}
};
Cell.prototype.hasObstacle = function () {
return(this.myObstacle != null);
};
Cell.prototype.hasCollect = function () {
var _local1 = false;
if (this.myCollect != null) {
if (!this.myCollect.isCollected) {
_local1 = true;
}
}
return(_local1);
};
Obstacle = function () {
this.settings();
};
Obstacle.prototype.settings = function () {
this.isVisible = true;
};
Obstacle.prototype.genInit = function () {
};
Obstacle.prototype.build = function () {
var _local2 = this;
var mcLoc = _local2.myCell.mc.mcContent;
if (_local2.isVisible) {
_local2.mc = mcLoc.attachMovie("mcObstacle" + _local2.id, "mcObstacle", mcLoc.nextHighestDepth++);
}
var rows = _local2.zConfig.length;
var cols = _local2.zConfig[0].length;
var row = 0;
while (row < rows) {
var _local1 = 0;
while (_local1 < cols) {
var _local3 = gBoard.cellArr[_local2.myCell.row + row][_local2.myCell.col + _local1];
_local3.setObstacle(_local2);
_local3.setZ(_local2.getZ(row, _local1));
_local1++;
}
row++;
}
};
Obstacle.prototype.getZ = function (rowOff, colOff) {
return(this.zConfig[rowOff][colOff]);
};
Fruit = function (myCell) {
var _local1 = this;
_local1.id = "Fruit";
_local1.myCell = myCell;
_local1.genSettings();
_local1.settings();
_local1.genInit();
_local1.init();
};
Fruit.prototype = new Obstacle();
Fruit.prototype.settings = function () {
this.zConfig = [[82, 82]];
};
Fruit.prototype.init = function () {
this.build();
};
Hay = function (myCell, stack) {
var _local1 = this;
_local1.id = "Hay";
_local1.myCell = myCell;
_local1.stack = stack;
_local1.genSettings();
_local1.settings();
_local1.genInit();
_local1.init();
};
Hay.prototype = new Obstacle();
Hay.prototype.settings = function () {
var _local1 = this;
_local1.zConfig0 = [[50]];
_local1.zConfig1 = [[100]];
_local1.zConfig2 = [[150]];
_local1.fArr0 = [1, 2, 3, 4, 5, 6, 7, 8];
_local1.fArr1 = [20, 21, 22, 23];
_local1.fArr2 = [40, 41, 42, 43, 44];
};
Hay.prototype.init = function () {
var _local1 = this;
_local1.zConfig = _local1["zConfig" + _local1.stack];
_local1.build();
_local1.setStack(_local1.stack);
};
Hay.prototype.setStack = function (num) {
var _local1 = this["fArr" + num];
var _local2 = (_global["hayFrameCt" + num]++) % _local1.length;
var _local3 = _local1[_local2];
this.mc.mcItem.gotoAndStop(_local3);
};
Car = function (myCell) {
var _local1 = this;
_local1.id = "Car";
_local1.myCell = myCell;
_local1.genSettings();
_local1.settings();
_local1.genInit();
_local1.init();
};
Car.prototype = new Obstacle();
Car.prototype.settings = function () {
this.isVisible = false;
this.zConfig = [[120, 120, 120, 70, 70, 70]];
};
Car.prototype.init = function () {
this.build();
};
Bench = function (myCell) {
var _local1 = this;
_local1.id = "Bench";
_local1.myCell = myCell;
_local1.genSettings();
_local1.settings();
_local1.genInit();
_local1.init();
};
Bench.prototype = new Obstacle();
Bench.prototype.settings = function () {
this.zConfig = [[23, 23]];
};
Bench.prototype.init = function () {
this.build();
};
Tree = function (myCell, stack) {
var _local1 = this;
_local1.id = "Tree";
_local1.myCell = myCell;
_local1.stack = stack;
_local1.genSettings();
_local1.settings();
_local1.genInit();
_local1.init();
};
Tree.prototype = new Obstacle();
Tree.prototype.settings = function () {
var _local1 = this;
_local1.zConfig0 = [[50]];
_local1.zConfig1 = [[100]];
_local1.zConfig2 = [[150]];
_local1.fArr0 = [1, 2, 3, 4, 5];
_local1.fArr1 = [20, 21, 22, 23, 24];
_local1.fArr2 = [40, 41, 42, 43];
};
Tree.prototype.init = function () {
var _local1 = this;
_local1.zConfig = _local1["zConfig" + _local1.stack];
_local1.build();
_local1.setStack(_local1.stack);
};
Tree.prototype.setStack = function (num) {
var _local1 = this["fArr" + num];
var _local2 = (_global["treeFrameCt" + num]++) % _local1.length;
var _local3 = _local1[_local2];
this.mc.mcItem.gotoAndStop(_local3);
};
Collect = function () {
this.settings();
};
Collect.prototype.settings = function () {
var _local1 = this;
_local1.isCollected = false;
_local1.z = 25;
_local1.animSuffix = "";
};
Collect.prototype.genInit = function () {
this.build();
};
Collect.prototype.build = function () {
var _local1 = this;
var _local2 = _local1.myCell.mc.mcContent;
_local1.mc = _local2.attachMovie("mcCollect" + _local1.id, "mcCollect", _local2.nextHighestDepth++);
_local1.mc._y = -_local1.myCell.z;
var _local3 = _local1.mc.mcContent.mcAnim;
_local3.obj = _local1;
};
Collect.prototype.hit = function () {
var _local1 = this;
_local1.anim("hit" + _local1.animSuffix);
_local1.subHit();
_local1.isCollected = true;
};
Collect.prototype.hide = function () {
this.mc.mcContent.hide();
};
Collect.prototype.kill = function () {
this.mc.removeMovieClip();
delete this;
};
Collect.prototype.anim = function (mode) {
this.mc.mcContent.mcAnim.gotoAndPlay(mode);
var _local1 = this.mc.mcContent.mcShadow;
if (_local1 != null) {
_local1.gotoAndPlay(mode);
}
};
Collect.prototype.animTrig = function (mode) {
switch (mode) {
case "hitDone" :
this.kill();
return;
case "postCollect" :
this.postCollect();
return;
}
};
Coin = function (myCell, isHigh) {
var _local1 = this;
var _local2 = isHigh;
if (_local2 == null) {
_local2 = false;
}
_local1.id = "Coin";
_local1.isHigh = _local2;
_local1.myCell = myCell;
_local1.settings();
_local1.genInit();
_local1.init();
};
Coin.prototype = new Collect();
Coin.prototype.settings = function () {
var _local1 = this;
_local1.scoreValue = 1;
_local1.dHealth = 0.015;
if (_local1.isHigh) {
_local1.z = 260;
_local1.animSuffix = "High";
} else {
_local1.z = 25;
_local1.animSuffix = "Low";
}
};
Coin.prototype.init = function () {
var _local1 = this;
gLevel.coinCt++;
var _local2 = _local1.mc.mcContent.mcAnim;
var _local3 = _local1.mc.mcContent.mcShadow;
if (_local1.isHigh) {
_local2._y = -_local1.z;
gLevel.coinHighCt++;
_local2.fOffset = (gLevel.coinHighCt * 3) % 8;
}
_local2.gotoAndPlay("norm" + _local1.animSuffix);
_local3.gotoAndStop("norm" + _local1.animSuffix);
};
Coin.prototype.subHit = function () {
gScore.incr(this.scoreValue);
gHealth.incr(this.dHealth);
var _local1 = 80;
var _local2 = gBoard.getScreenPan(gAvatar.x);
gJukebox.startSound("coin0", _local1, _local2);
};
Latte = function (myCell) {
var _local1 = this;
_local1.id = "Latte";
_local1.myCell = myCell;
_local1.settings();
_local1.genInit();
};
Latte.prototype = new Collect();
Latte.prototype.settings = function () {
this.tDur = 5;
this.z = 50;
};
Latte.prototype.init = function () {
};
Latte.prototype.subHit = function () {
gAvatar.boost(this.tDur);
var _local2 = "latte0";
var x = gBoard.getX(this.myCell.col);
var _local1 = 75;
var _local3 = gBoard.getScreenPan(x);
gJukebox.startSound(_local2, _local1, _local3);
};
Bomb = function (myCell) {
var _local1 = this;
_local1.id = "Bomb";
_local1.myCell = myCell;
_local1.settings();
_local1.genInit();
};
Bomb.prototype = new Collect();
Bomb.prototype.settings = function () {
this.z = 55;
};
Bomb.prototype.init = function () {
};
Bomb.prototype.subHit = function () {
var _local2 = "bomb1";
var x = gBoard.getX(this.myCell.col);
var _local1 = 25;
var _local3 = gBoard.getScreenPan(x);
gJukebox.startSound(_local2, _local1, _local3);
};
Bomb.prototype.postCollect = function () {
gLevel.bombAll(this);
var _local3 = "bomb0";
gJukebox.stopSound("bomb1");
var _local1 = gBoard.getX(this.myCell.col);
var vol0 = 40;
var vol1 = 70;
var _local2 = Math.normalize(vol0, vol1, gBoard.getScreenVicinity(_local1));
var pan = gBoard.getScreenPan(_local1);
gJukebox.startSound(_local3, _local2, pan);
};
Shield = function (myCell) {
var _local1 = this;
_local1.id = "Shield";
_local1.myCell = myCell;
_local1.settings();
_local1.genInit();
_local1.init();
};
Shield.prototype = new Collect();
Shield.prototype.settings = function () {
var _local1 = this;
_local1.tDur = 10;
_local1.zArr = {russ:70, tara:70, tom:70, jolie:70, mj:70, paris:70};
_local1.z = _local1.zArr[gCast.getSelected("id")];
};
Shield.prototype.init = function () {
var _local1 = gCast.getSelected("id");
this.mc.mcContent.gotoAndStop(_local1);
};
Shield.prototype.subHit = function () {
gAvatar.invince(this.tDur);
this.kill();
};
Person = function () {
};
Person.prototype.genSettings = function () {
var _local1 = this;
_local1.spdMaxHorDef;
_local1.spdMaxVerDef;
_local1.accRunHor;
_local1.accRunVer;
_local1.zSpdBounceMax = 30;
_local1.sxMax;
_local1.dampBrakeNorm = 0.7;
_local1.dampBrakeAir = 1;
_local1.dampBounceLatOn;
_local1.dampBounceVer;
_local1.aGravOn = gWorld.aGrav;
_local1.aJumpMinDef;
_local1.aJumpMaxDef;
_local1.aJumpSecMinDef;
_local1.aJumpSecMaxDef;
_local1.keyTotal = 5;
_local1.sxMax = gBoard.sWidth - 60;
_local1.sxMin = 60;
_local1.isParalyzed = false;
};
Person.prototype.genInit = function () {
var _local1 = this;
_local1.updatePos = _local1.updatePosNorm;
_local1.freeze();
_local1.switchBounceLat(1);
_local1.setCrippleSpd(1);
_local1.setCrippleJump(1);
_local1.initKey();
_local1.spdMax = Math.sqrt((_local1.spdMaxHorDef * _local1.spdMaxHorDef) + (_local1.spdMaxVerDef * _local1.spdMaxVerDef));
_local1.setDir(1);
_local1.setBaseScaleRat(1);
_local1.isShaking = false;
_local1.switchFly(0);
_local1.switchJump(1);
_local1.switchZLim(0);
_local1.isGrounded = false;
};
Person.prototype.initKey = function () {
var _local3 = this;
var _local2 = _local3.keyTotal;
_local3.keyDownArr = new Array(_local2);
var _local1 = 0;
while (_local1 < _local2) {
_local3.keyDownArr[_local1] = false;
_local1++;
}
};
Person.prototype.buildGhost = function () {
var _local1 = this;
_local1.myGhost = new Ghost(_local1);
_local1.updateGhost = _local1.updateGhostOn;
};
Person.prototype.freeze = function () {
var _local1 = this;
_local1.ayu = (_local1.ayd = (_local1.axl = (_local1.axr = 0)));
_local1.dampHor = (_local1.dampVer = 1);
};
Person.prototype.switchZLim = function (mode) {
var _local1 = this;
switch (mode) {
case 0 :
_local1.zMin = -1000000;
_local1.zMax = 1000000 /* 0x0F4240 */;
return;
case 1 :
_local1.zMin = _local1.zMinFly;
_local1.zMax = _local1.zMaxFly;
return;
}
};
Person.prototype.setBaseScaleRat = function (rat) {
var _local1 = this;
var _local2 = rat;
_local1.mc.mcContent._xscale = (_local1.mc.mcContent._yscale = _local2 * 100);
_local1.myGhost.setBaseScaleRat(_local2);
_local1.baseScaRat = _local2;
};
Person.prototype.initUpdate = function () {
var _local1 = this;
_local1.mc.obj = _local1;
_local1.mc.onEnterFrame = function () {
this.obj.update();
};
_local1.mc.mcContent.mcAnim.obj = _local1;
_local1.mc.mcSeq.obj = _local1;
};
Person.prototype.startUpdate = function () {
this.update = this.updateOn;
};
Person.prototype.stopUpdate = function () {
this.update = null;
};
Person.prototype.placeIn = function (row, col, zAir) {
var _local1 = this;
var _local3 = zAir;
if (_local3 == null) {
_local3 = 0;
}
var x = gBoard.getX(col, "center");
var y = gBoard.getY(row, "center");
var _local2 = gBoard.getCell(row, col);
var z = (_local2.z + _local3);
_local1.setPos(x, y);
_local1.setZ(z);
_local1.updateScreen();
_local1.updateGhost();
};
Person.prototype.updateOn = function () {
var _local1 = this;
_local1.updatePos();
_local1.updateGhost();
_local1.updateAuto();
_local1.updateScreen();
_local1.updateHealth();
_local1.updateSub();
};
Person.prototype.isOnGround = function () {
return(this.getAirZ() < 2);
};
Person.prototype.switchZip = function (mode) {
var _local1 = this;
switch (mode) {
case 0 :
_local1.spdMaxHor = _local1.spdMaxHorDef;
_local1.spdMaxVer = _local1.spdMaxVerDef;
return;
case 1 :
_local1.spdMaxHor = (_local1.spdMaxVer = 100000);
return;
}
};
Person.prototype.updatePosNorm = function () {
var _local1 = this;
_local1.az = _local1.aJumpOn + _local1.aGrav;
if (_local1.aJumpOn != 0) {
_local1.aJumpOn = 0;
}
_local1.ay = _local1.ayu + _local1.ayd;
_local1.ax = _local1.axl + _local1.axr;
_local1.vz = _local1.vz + _local1.az;
_local1.vy = _local1.vy + _local1.ay;
_local1.vx = _local1.vx + _local1.ax;
if (Math.abs(_local1.vx) > _local1.spdMaxHor) {
_local1.vx = Math.sgn(_local1.vx) * _local1.spdMaxHor;
}
if (Math.abs(_local1.vy) > _local1.spdMaxVer) {
_local1.vy = Math.sgn(_local1.vy) * _local1.spdMaxVer;
}
if (_local1.isOnGround() || (_local1.isFlying)) {
var dampHorUse = _local1.dampHor;
var dampVerUse = _local1.dampVer;
} else {
var dampHorUse = _local1.dampBrakeAir;
var dampVerUse = _local1.dampBrakeAir;
}
_local1.vx = _local1.vx * dampHorUse;
_local1.vy = _local1.vy * dampVerUse;
_local1.x1 = _local1.x + _local1.vx;
_local1.y1 = _local1.y + _local1.vy;
_local1.z1 = _local1.z + _local1.vz;
_local1.x1 = _local1.limitToScreen(_local1.x1, "x");
_local1.setZ(_local1.z1);
var row1 = gBoard.getRow(_local1.y1);
var col1 = gBoard.getCol(_local1.x1);
var _local3 = gBoard.getCell(row1, col1);
if (_local3 != _local1.cellCurr) {
if (_local1.mayEnter(row1, col1)) {
_local1.setPos(_local1.x1, _local1.y1);
_local1.enteredCell(_local3);
} else {
var _local2;
var dHor = Math.sgn(_local3.col - _local1.cellCurr.col);
var dVer = Math.sgn(_local3.row - _local1.cellCurr.row);
if (_local3 == null) {
if (_local1.cellCurr.row == 0) {
_local2 = 0;
} else if (_local1.cellCurr.row == (gBoard.mapCurr.getRows() - 1)) {
_local2 = 1;
} else if (_local1.cellCurr.col == 0) {
_local2 = 2;
} else if (_local1.cellCurr.col == (gBoard.mapCurr.getCols() - 1)) {
_local2 = 3;
}
} else if ((Math.abs(dHor) == 1) && (Math.abs(dVer) == 1)) {
_local2 = -1;
} else if (dVer == -1) {
_local2 = 0;
} else if (dVer == 1) {
_local2 = 1;
} else if (dHor == -1) {
_local2 = 2;
} else if (dHor == 1) {
_local2 = 3;
}
_local1.hitWall(_local2);
_local1.x1 = _local1.x + _local1.vx;
_local1.y1 = _local1.y + _local1.vy;
_local1.x1 = _local1.limitToScreen(_local1.x1, "x");
var row1 = gBoard.getRow(_local1.y1);
var col1 = gBoard.getCol(_local1.x1);
if (_local1.mayEnter(row1, col1)) {
_local1.setPos(_local1.x1, _local1.y1);
} else {
_local1.hitWall(-1);
}
}
} else {
_local1.setPos(_local1.x1, _local1.y1);
}
};
Person.prototype.setZ = function (z) {
var _local1 = this;
var _local2 = z;
var z0 = _local1.z;
var _local3 = _local1.cellCurr.z;
var zSnap = 1;
if ((_local2 < _local3) || (Math.abs(_local2 - _local3) <= zSnap)) {
_local2 = _local3;
if (!_local1.isGrounded) {
_local1.hitGround();
}
_local1.isGrounded = true;
} else {
_local1.isGrounded = false;
}
_local2 = Math.constrain(_local2, _local1.zMin, _local1.zMax);
_local1.z = _local2;
if (z0 != null) {
var dz = (_local2 - z0);
_local1.vz = dz;
}
};
Person.prototype.getAirZ = function (z) {
return(this.z - this.cellCurr.z);
};
Person.prototype.setPos = function (x, y) {
var _local1 = this;
_local1.x = x;
_local1.y = y;
_local1.row = gBoard.getRow(_local1.y);
_local1.col = gBoard.getCol(_local1.x);
_local1.cellCurr = gBoard.getCell(_local1.row, _local1.col);
};
Person.prototype.limitToScreen = function (value, coord) {
return(value);
};
Person.prototype.updateGhostOn = function () {
var _local1 = this;
_local1.myGhost.setZ(_local1.cellCurr.z);
_local1.myGhost.updateSize();
};
Person.prototype.hitGround = function () {
var _local1 = this;
_local1.vz = -(_local1.vz * _local1.dampBounceVer);
if (Math.abs(_local1.vz) > _local1.zSpdBounceMax) {
_local1.vz = Math.sgn(_local1.vz) * _local1.zSpdBounceMax;
}
_local1.hitGroundSub();
};
Person.prototype.hitWall = function (ind) {
var _local1 = this;
var _local2 = ind;
if (_local2 == null) {
_local2 = -1;
}
var bx = false;
var by = false;
var damp = _local1.dampBounceLat;
var _local3 = 3;
if (_local2 == -1) {
_local1.vx = (_local1.vy = 0);
} else if ((_local2 == 2) || (_local2 == 3)) {
_local1.vx = (-damp) * _local1.vx;
if (Math.abs(_local1.vx) < _local3) {
_local1.vx = 0;
}
} else {
_local1.vy = (-damp) * _local1.vy;
if (Math.abs(_local1.vy) < _local3) {
_local1.vy = 0;
}
}
_local1.hitWallSub(_local2);
};
Person.prototype.mayEnter = function (row, col) {
var _local2 = row;
var _local3 = gBoard.getCell(_local2, col);
var _local1 = true;
var cellZ = _local3.z;
if (this.z < cellZ) {
_local1 = false;
} else if ((((_local2 < 0) || (_local2 > (gBoard.mapCurr.getRows() - 1))) || (col < 0)) || (col > (gBoard.mapCurr.getCols() - 1))) {
_local1 = false;
}
return(_local1);
};
Person.prototype.enteredCell = function (cellObj) {
this.subEnteredCell(cellObj);
};
Person.prototype.updateScreen = function () {
this.updateScreenPos();
this.updateScreenDep();
};
Person.prototype.updateScreenPos = function () {
var _local1 = this;
_local1.mc._x = _local1.x;
_local1.mc._y = _local1.y;
_local1.mc.mcContent._y = -_local1.z;
};
Person.prototype.updateScreenDep = function () {
var _local2 = this;
var _local3 = gBoard.getRowEx(_local2.y);
var _local1 = gBoard.getPersonDepth(_local3, _local2.depthOffset);
if (_local1 != _local2.currDepth) {
_local2.currDepth = _local1;
_local2.mc.swapDepths(_local1);
}
};
Person.prototype.setDir = function (dir, force) {
var _local1 = this;
var _local2 = dir;
if ((_local2 != 1) && (_local2 != -1)) {
_local2 = 1;
}
if ((_local2 != _local1.dirCurr) || (force)) {
_local1.dirCurr = _local2;
if (!_local1.isParalyzed) {
_local1.mc.mcContent._xscale = (_local1.baseScaRat * _local1.dirCurr) * 100;
}
}
};
Person.prototype.resetRot = function () {
this.setRot(0);
};
Person.prototype.setRot = function (rot) {
this.mc.mcContent.mcAnim._rotation = rot;
};
Person.prototype.setCrippleSpd = function (r) {
var _local1 = this;
_local1.spdMaxHor = _local1.spdMaxHorDef * r;
_local1.spdMaxVer = _local1.spdMaxVerDef * r;
};
Person.prototype.setCrippleJump = function (r) {
var _local1 = this;
var _local2 = r;
_local1.aJumpMin = _local1.aJumpMinDef * _local2;
_local1.aJumpMax = _local1.aJumpMaxDef * _local2;
_local1.aJumpSecMin = _local1.aJumpSecMinDef * _local2;
_local1.aJumpSecMax = _local1.aJumpSecMaxDef * _local2;
};
Person.prototype.switchBounceLat = function (mode) {
var _local1 = this;
switch (mode) {
case 1 :
_local1.dampBounceLat = _local1.dampBounceLatOn;
return;
case 0 :
_local1.dampBounceLat = 0;
return;
}
};
Person.prototype.tryJump = function () {
var _local1 = this;
if ((_local1.genus == "Avatar") && (_local1.isFlying)) {
_local1.unboost();
} else if (_local1.getAirZ() < _local1.zMinJumpNorm) {
_local1.jump();
} else if (_local1.getAirZ() < _local1.zMinJumpsec) {
if (_local1.genus == "Avatar") {
_local1.jump(true);
}
}
};
Person.prototype.getSpd = function () {
var _local1 = this;
return(Math.sqrt((_local1.vx * _local1.vx) + (_local1.vy * _local1.vy)));
};
Person.prototype.switchFly = function (mode) {
var _local1 = this;
switch (mode) {
case 1 :
_local1.isFlying = true;
_local1.aGrav = 0;
_local1.switchJump(0);
_local1.switchZLim(1);
_local1.switchBounceLat(0);
_local1.switchShake(0);
_local1.switchDefense(1);
return;
case 0 :
_local1.isFlying = false;
_local1.aGrav = _local1.aGravOn;
_local1.switchJump(1);
_local1.switchZLim(0);
_local1.switchBounceLat(1);
_local1.switchShake(1);
_local1.switchDefense(0);
return;
}
};
Person.prototype.switchJump = function (mode) {
var _local1 = this;
switch (mode) {
case 1 :
_local1.jump = _local1.jumpOn;
return;
case 0 :
_local1.jump = null;
return;
}
};
Person.prototype.jumpOn = function (isSecond) {
var _local1 = this;
if (isSecond == null) {
isSecond = false;
}
var _local2 = _local1.getSpd();
_local2 = Math.constrain(_local2, 0, _local1.spdMax);
var _local3 = _local2 / _local1.spdMax;
if (isSecond) {
_local1.aJumpOn = Math.normalize(_local1.aJumpSecMin, _local1.aJumpSecMax, _local3);
} else {
_local1.aJumpOn = Math.normalize(_local1.aJumpMin, _local1.aJumpMax, _local3);
}
_local1.jumpSub();
};
Person.prototype.updateJumpOn = function () {
var _local1 = this;
if (_local1.fJump <= (_local1.fJumpDur / 2)) {
_local1.vzj = _local1.spdJump;
} else if (_local1.fJump <= _local1.fJumpDur) {
_local1.vzj = -_local1.spdJump;
} else {
_local1.vzj = 0;
_local1.setZ(0);
_local1.updateJump = null;
_local1.isJumping = false;
}
_local1.fJump++;
};
Person.prototype.anim = function (mode) {
var _local1 = this;
var _local2 = mode;
if (_local2 != _local1.animMode) {
_local1.animMode = _local2;
_local1.mc.mcContent.mcAnim.gotoAndPlay(_local2);
}
};
Person.prototype.keyDown = function (ind) {
var _local1 = this;
var _local2 = ind;
if (!_local1.keyDownArr[_local2]) {
_local1.checkShake(_local2);
_local1.keyDownArr[_local2] = true;
switch (_local2) {
case 0 :
_local1.ayu = -_local1.accRunVer;
_local1.dampVer = 1;
return;
case 1 :
_local1.ayd = _local1.accRunVer;
_local1.dampVer = 1;
return;
case 2 :
_local1.axl = -_local1.accRunHor;
_local1.dampHor = 1;
_local1.setDir(-1);
return;
case 3 :
_local1.axr = _local1.accRunHor;
_local1.dampHor = 1;
_local1.setDir(1);
return;
case 4 :
_local1.tryJump();
return;
}
}
};
Person.prototype.keyUp = function (ind) {
var _local1 = this;
var _local2 = ind;
if (_local1.keyDownArr[_local2]) {
_local1.keyDownArr[_local2] = false;
switch (_local2) {
case 0 :
_local1.ayu = 0;
if (!_local1.isKeyDown(1)) {
_local1.dampVer = _local1.dampBrake;
}
return;
case 1 :
_local1.ayd = 0;
if (!_local1.isKeyDown(0)) {
_local1.dampVer = _local1.dampBrake;
}
return;
case 2 :
_local1.axl = 0;
if (!_local1.isKeyDown(3)) {
_local1.dampHor = _local1.dampBrake;
}
return;
case 3 :
_local1.axr = 0;
if (!_local1.isKeyDown(2)) {
_local1.dampHor = _local1.dampBrake;
}
return;
}
}
};
Person.prototype.isKeyDown = function (ind) {
return(this.keyDownArr[ind]);
};
Person.prototype.keyUpAll = function () {
var _local2 = this;
var _local1 = 0;
while (_local1 < _local2.keyTotal) {
_local2.keyUp(_local1);
_local1++;
}
_local2.dampHor = (_local2.dampVer = _local2.dampBrakeNorm);
};
Person.prototype.show = function () {
this.mc.mcContent.show();
this.myGhost.show();
};
Person.prototype.hide = function () {
this.mc.mcContent.hide();
this.myGhost.hide();
};
Ghost = function (myPerson) {
var _local1 = this;
_local1.myPerson = myPerson;
_local1.settings();
_local1.init();
};
Ghost.prototype.settings = function () {
var _local1 = this;
_local1.zMin = 0;
_local1.zMax = 400;
_local1.alpAvatar0 = 60;
_local1.alpAvatar1 = 55;
_local1.scaAvatar0 = 100;
_local1.scaAvatar1 = 35;
_local1.alpEnemy0 = 50;
_local1.alpEnemy1 = 20;
_local1.scaEnemy0 = 100;
_local1.scaEnemy1 = 25;
_local1.alp0 = _local1[("alp" + _local1.myPerson.genus) + 0];
_local1.alp1 = _local1[("alp" + _local1.myPerson.genus) + 1];
_local1.sca0 = _local1[("sca" + _local1.myPerson.genus) + 0];
_local1.sca1 = _local1[("sca" + _local1.myPerson.genus) + 1];
_local1.baseScaleRat = 1;
};
Ghost.prototype.init = function () {
var _local1 = this;
_local1.build();
_local1.setZ(0);
_local1.updateSize();
};
Ghost.prototype.build = function () {
var _local1 = this;
var _local2 = _local1.myPerson.mc;
var _local3 = ("mcGhost" + _local1.myPerson.genus) + _local1.myPerson.subGenus;
_local1.mc = _local2.attachMovie(_local3, "mcGhost", _local2.nextHighestDepth++);
_local1.myPerson.mc.mcContent.swapDepths(_local2.nextHighestDepth++);
_local1.myPerson.mc.mcOverlay.swapDepths(_local2.nextHighestDepth++);
};
Ghost.prototype.kill = function () {
this.mc.removeMovieClip();
delete this;
};
Ghost.prototype.setZ = function (z) {
this.mc.mcContent._y = -z;
};
Ghost.prototype.setBaseScaleRat = function (rat) {
this.baseScaleRat = rat;
};
Ghost.prototype.updateSize = function () {
var _local1 = this;
var _local2 = _local1.myPerson.getAirZ();
_local2 = Math.constrain(_local2, _local1.zMin, _local1.zMax);
var _local3 = (_local2 - _local1.zMin) / (_local1.zMax - _local1.zMin);
_local1.mc.mcContent._xscale = (_local1.mc.mcContent._yscale = _local1.baseScaleRat * Math.normalize(_local1.sca0, _local1.sca1, _local3));
_local1.mc.mcContent._alpha = Math.normalize(_local1.alp0, _local1.alp1, _local3);
};
Ghost.prototype.forcePos = function (x, y) {
this.mc._x = x;
this.mc._y = y;
};
Ghost.prototype.show = function () {
this.mc.show();
};
Ghost.prototype.hide = function () {
this.mc.hide();
};
Avatar = function () {
var _local1 = this;
_local1.genSettings();
_local1.settings();
_local1.genInit();
_local1.init();
};
Avatar.prototype = new Person();
Avatar.prototype.settings = function () {
var _local1 = this;
_local1.genus = "Avatar";
_local1.subGenus = "";
_local1.depthOffset = 0;
var _local2 = gLevel.getNum();
_local1.spdMaxHorDef = 18;
_local1.spdMaxVerDef = 4.5;
_local1.accRunHor = 2;
_local1.accRunVer = 0.6;
_local1.dampBounceLatOn = 0.3;
_local1.dampBounceVer = 0.3;
_local1.rCrippleSpd = 0.1;
_local1.rCrippleJump = 0.6;
_local1.aJumpMinDef = 23;
_local1.aJumpMaxDef = 34;
_local1.aJumpSecMinDef = 10;
_local1.aJumpSecMaxDef = 10;
_local1.aJumpBoost = 30;
var _local3 = [-0.00015, -0.00015, -0.00015];
_local1.dHealthPerLeech = _local3[_local2];
_local3 = [-0.0065, -0.0065, -0.0065];
_local1.dHealthSumLeechMin = _local3[_local2];
_local3 = [-0.0032, -0.0032, -0.0032];
_local1.dHealthSumLeechMax = _local3[_local2];
_local1.dHealthNorm = 0;
_local1.blinkHex = 16711782 /* 0xFF0066 */;
_local1.blinkPerc0 = 70;
_local1.blinkPerc1 = 20;
_local1.tShake = 0.3;
_local1.zMinFly = 0;
_local1.zMaxFly = 240;
_local1.zMinJumpNorm = 5;
_local1.zMinJumpSec = 65;
};
Avatar.prototype.init = function () {
this.leechArr = new Array();
this.switchShake(1);
};
Avatar.prototype.begin = function () {
this.offGoalOn();
this.hide();
};
Avatar.prototype.intro = function () {
this.startSeq("intro");
};
Avatar.prototype.updateSeq = function () {
var _local1 = this;
_local1.mc.mcContent._x = _local1.mcRef._x;
_local1.mc.mcContent._y = _local1.mcRef._y;
if (_local1.mcRef._rotation != 0) {
_local1.hide();
} else {
_local1.show();
}
var _local2 = 1;
if (_local1.mc.mcSeq.mcRef._xscale != 100) {
_local2 = -1;
}
_local1.mc.mcContent._xscale = _local2 * 100;
_local1.myGhost.forcePos(_local1.mc.mcContent._x, _local1.mc.mcContent._y);
};
Avatar.prototype.endSeq = function () {
var _local1 = this;
_local1.mc.mcContent._x = 0;
_local1.mc.mcContent._y = 0;
_local1.mc.mccontent._xscale = 100;
_local1.myGhost.forcePos(0, 0);
};
Avatar.prototype.engage = function () {
this.startUpdate();
gHealth.startUpdate();
this.switchBlink(0);
};
Avatar.prototype.jumpSub = function () {
this.anim("jump");
this.stopShake();
};
Avatar.prototype.subEnteredCell = function (cellObj) {
cellObj.hitAvatar();
};
Avatar.prototype.hitGroundSub = function () {
this.cellCurr.hitAvatar(true);
};
Avatar.prototype.build = function () {
var _local1 = this;
var _local3 = gBoard.getPersonHolder();
var _local2 = ("mc" + _local1.genus) + _local1.subGenus;
var strName = _local2;
_local1.mc = _local3.attachMovie(_local2, strName, _local3.nextHighestDepth++);
_local1.mc.mcSeq.hide();
_local1.mcRef = _local1.mc.mcSeq.mcRef;
_local1.buildGhost();
_local1.setCeleb();
_local1.initUpdate();
};
Avatar.prototype.setCeleb = function () {
var _local1 = gCast.getSelected("id");
this.mc.mcContent.gotoAndStop(_local1);
this.mc.mcContent.mcAnim.mcHead.gotoAndStop(_local1);
};
Avatar.prototype.reset = function () {
var _local1 = this;
_local1.kill();
_local1.build();
_local1.isOver = false;
};
Avatar.prototype.kill = function () {
var _local1 = this;
_local1.mc.removeMovieClip();
_local1.myGhost.kill();
};
Avatar.prototype.addLeechOn = function (personObj) {
this.leechArr.push(personObj);
this.updateCripple();
return(true);
};
Avatar.prototype.updateCripple = function () {
var _local2 = this;
var _local3 = gLevel.getData("razzTotal");
var _local1 = _local2.leechArr.length / _local3;
if (_local3 == 0) {
_local1 = 0;
}
_local1 = Math.pow(_local1, 0.3);
var rSpd = (1 - (_local1 * (1 - _local2.rCrippleSpd)));
_local2.setCrippleSpd(rSpd);
var rJump = (1 - (_local1 * (1 - _local2.rCrippleJump)));
_local2.setCrippleJump(rJump);
};
Avatar.prototype.updateHealth = function () {
var _local1 = this;
var _local2 = 0;
if (_local1.hasLeech()) {
var _local3 = _local1.leechArr.length;
_local2 = _local1.dHealthPerLeech * _local3;
_local2 = Math.constrain(_local2, _local1.dHealthSumLeechMin, _local1.dHealthSumLeechMax);
}
gHealth.incr(_local2 + _local1.dHealthNorm);
};
Avatar.prototype.updateSub = function () {
var _local1 = this;
_local1.updateShake();
_local1.updateAnim();
_local1.updateBoost();
_local1.updateInvince();
};
Avatar.prototype.updateInvinceOn = function () {
var _local1 = this;
var elap = ((getTimer() / 1000) - _local1.tInvince0);
if (_local1.isParalyzed) {
} else if (elap > _local1.tInvinceDur) {
_local1.uninvince();
_local1.restoreColor();
} else {
var _local3 = elap / _local1.tInvinceDur;
var incr0 = 2;
var incr1 = 0.5;
var incr = Math.normalize(incr0, incr1, _local3);
_local1.fOsc = _local1.fOsc + incr;
var _local2 = Math.sin(_local1.fOsc);
_local2 = (_local2 / 2) + 0.5;
var p = Math.normalize(_local1.blinkPerc0, _local1.blinkPerc1, _local3);
var perc = (_local2 * p);
if ((_local1.fInvince % 2) == 0) {
_local1.mc.mcContent.mcAnim.setColor(_local1.blinkHex, perc);
}
}
_local1.fInvince++;
};
Avatar.prototype.invince = function (tDur) {
var _local1 = this;
_local1.paralyze();
_local1.restoreColor();
_local1.anim(gCast.getSelected("id") + "Power");
_local1.tInvince0 = getTimer() / 1000;
_local1.tInvinceDur = tDur;
_local1.updateInvince = _local1.updateInvinceOn;
_local1.isInvince = true;
_local1.fInvince = 0;
var _local2 = 10;
if (_local1.getAirZ() > _local2) {
_local1.setZ(_local1.cellCurr.z + _local2);
}
gJukebox.switchMusic(1);
_local1.removeAllLeech();
};
Avatar.prototype.uninvince = function () {
this.updateInvince = null;
gJukebox.switchMusic(0);
this.isInvince = false;
};
Avatar.prototype.paralyze = function () {
var _local1 = this;
_local1.switchJump(0);
_local1.isParalyzed = true;
_local1.updatePos = null;
};
Avatar.prototype.unparalyze = function () {
var _local1 = this;
_local1.switchJump(1);
_local1.isParalyzed = false;
_local1.updatePos = _local1.updatePosNorm;
_local1.setDir(_local1.dirCurr, true);
};
Avatar.prototype.restoreColor = function () {
this.mc.mcContent.mcAnim.setColor("restore");
};
Avatar.prototype.updateAnim = function () {
var _local1 = this;
if (_local1.isDone) {
} else if (_local1.isParalyzed) {
} else if (_local1.isShaking) {
_local1.anim("shakeDown");
} else if (_local1.isBoosting) {
_local1.anim("boost");
} else if (_local1.getAirZ() < 5) {
if (_local1.animMode == "jump") {
_local1.anim("land");
} else if (_local1.animMode != "land") {
if (_local1.animMode == "shakeDown") {
_local1.anim("shakeUp");
} else {
var _local2 = _local1.getSpd();
if (_local2 > 0.2) {
_local1.anim("run");
} else {
_local1.anim("still");
}
}
}
}
};
Avatar.prototype.boost = function (tDur) {
var _local1 = this;
_local1.tBoost0 = getTimer() / 1000;
_local1.tBoostDur = tDur;
_local1.updateBoost = _local1.updateBoostOn;
_local1.isBoosting = true;
_local1.aJumpOn = _local1.aJumpBoost;
_local1.switchFly(1);
_local1.removeAllLeech();
};
Avatar.prototype.unboost = function () {
var _local1 = this;
_local1.updateBoost = null;
_local1.isBoosting = false;
_local1.switchFly(0);
};
Avatar.prototype.updateBoostOn = function () {
var _local1 = this;
var _local2 = (getTimer() / 1000) - _local1.tBoost0;
if (_local2 > _local1.tBoostDur) {
_local1.unboost();
}
};
Avatar.prototype.updateShakeOn = function () {
var _local1 = this;
var _local2 = (getTimer() / 1000) - _local1.tLastShake;
if (_local2 > _local1.tShake) {
_local1.stopShake();
}
};
Avatar.prototype.switchShake = function (mode) {
var _local1 = this;
switch (mode) {
case 1 :
_local1.startShake = _local1.startShakeOn;
return;
case 0 :
_local1.startShake = null;
}
};
Avatar.prototype.switchDefense = function (mode) {
var _local1 = this;
switch (mode) {
case 1 :
_local1.addLeech = null;
return;
case 0 :
_local1.addLeech = _local1.addLeechOn;
}
};
Avatar.prototype.startShakeOn = function () {
var _local1 = this;
if (!_local1.isShaking) {
_local1.isShaking = true;
_local1.ctShake = 0;
_local1.updateShake = _local1.updateShakeOn;
}
};
Avatar.prototype.stopShake = function () {
var _local1 = this;
if (_local1.isShaking) {
_local1.isShaking = false;
_local1.updateShake = null;
}
};
Avatar.prototype.shakeNow = function () {
var _local1 = this;
_local1.tLastShake = getTimer() / 1000;
_local1.ctShake++;
if (_local1.hasLeech()) {
if ((_local1.ctShake % 2) == 0) {
if (Math.random() > 0.6) {
_local1.removeRandomLeech();
}
} else if ((_local1.ctShake % 3) == 0) {
_local1.removeRandomLeech();
}
}
};
Avatar.prototype.die = function () {
var _local1 = this;
_local1.isDone = true;
_local1.stopUpdate();
_local1.anim("still");
_local1.freeze();
_local1.keyUpAll();
};
Avatar.prototype.win = function () {
var _local1 = this;
_local1.isDone = true;
_local1.stopUpdate();
_local1.anim("still");
_local1.freeze();
_local1.keyUpAll();
_local1.allowWin = false;
_local1.offGoal = _local1.offGoalOn;
gLevel.switchEnemyTarget(0);
_local1.removeAllLeech();
if (_local1.isInvince) {
_local1.uninvince();
}
};
Avatar.prototype.resume = function () {
this.isDone = false;
this.startUpdate();
gLevel.switchEnemyTarget(1);
};
Avatar.prototype.checkShake = function (ind) {
var _local1 = this;
var _local2 = ind;
if ((_local2 == 2) || (_local2 == 3)) {
var _local3 = getTimer() / 1000;
var elap = (_local3 - _local1.tLast);
if (elap < _local1.tShake) {
if (((_local1.keyLast == 2) && (_local2 == 3)) || ((_local1.keyLast == 3) && (_local2 == 2))) {
_local1.shakeNow();
}
_local1.startShake();
}
_local1.keyLast = _local2;
_local1.tLast = _local3;
}
};
Avatar.prototype.limitToScreen = function (value, coord) {
var _local1 = value;
var _local2 = this;
if (coord == "x") {
var _local3 = gBoard.xBoardToScreen(_local1);
if (_local3 > _local2.sxMax) {
_local1 = gBoard.xScreenToBoard(_local2.sxMax);
} else if (_local3 < _local2.sxMin) {
_local1 = gBoard.xScreenToBoard(_local2.sxMin);
}
}
return(_local1);
};
Avatar.prototype.removeRandomLeech = function () {
var _local1 = this;
if (_local1.hasLeech()) {
var _local2 = Math.floor(Math.random() * (_local1.leechArr.length - 0.0001));
_local1.removeLeech(_local2);
}
_local1.updateCripple();
};
Avatar.prototype.removeLeech = function (i, method, bombObj, isMute) {
var _local1 = isMute;
var _local3 = method;
if (_local1 == null) {
_local1 = false;
}
if (_local3 == null) {
_local3 = "unleech";
}
if (_local3 == "bomb") {
_local1 = false;
}
var _local2 = this.leechArr[i];
var func = _local2[_local3];
func.call(_local2, _local1);
this.leechArr.splice(i, 1);
};
Avatar.prototype.hasLeech = function () {
return(this.leechArr.length > 0);
};
Avatar.prototype.removeAllLeech = function (method, bombObj) {
var _local3 = this;
if (_local3.hasLeech()) {
var total = _local3.leechArr.length;
var _local1 = 0;
while (_local1 < total) {
var _local2 = ((_local1 == 0) ? false : true);
_local3.removeLeech(0, method, bombObj, _local2);
_local1++;
}
}
_local3.updateCripple();
};
Avatar.prototype.bombAllLeech = function (bombObj) {
};
Avatar.prototype.offGoalOn = function () {
this.allowWin = true;
this.offGoal = null;
};
Avatar.prototype.animTrig = function (mode) {
var _local1 = this;
switch (mode) {
case "shakeUpDone" :
_local1.anim("still");
return;
case "landDone" :
_local1.anim("still");
return;
case "powerDone" :
_local1.anim("still");
_local1.unparalyze();
return;
case "introDone" :
gLevel.engage();
return;
}
};
Avatar.prototype.animSeqTrig = function (mode, param) {
switch (mode) {
case "introDone" :
gLevel.engage();
this.endSeq();
return;
case "anim" :
this.anim(param);
return;
}
};
Avatar.prototype.animOverlay = function (mode) {
var _local1 = this;
if (mode == "off") {
_local1.mc.mcOverlay.hide();
} else {
_local1.mc.mcOverlay.show();
}
_local1.mc.mcOverlay.gotoAndPlay(mode);
};
Avatar.prototype.startSeq = function (mode) {
var _local1 = this;
_local1.mc.mcSeq.gotoAndPlay(mode);
_local1.update = _local1.updateSeq;
_local1.update();
};
Avatar.prototype.express = function (mode) {
this.mc.mcContent.mcAnim.mcHead.mcCeleb.mcExpress.gotoAndStop(mode);
};
Razz = function (id) {
var _local1 = this;
_local1.id = id;
_local1.genSettings();
_local1.settings();
_local1.genInit();
_local1.init();
};
Razz.prototype = new Person();
Razz.prototype.settings = function () {
var _local1 = this;
_local1.genus = "Enemy";
_local1.subGenus = "Razz";
_local1.depthOffset = _local1.id + 1;
var _local3 = gLevel.getNum();
var _local2 = _local1.getOrderRat();
_local1.orderRat = _local2;
_local1.distFlatLeech = 30;
_local1.distVertLeech = 10;
_local1.dampBounceLatOn = 0.6;
_local1.dampBounceVer = 0.5;
_local1.distMoveX = Math.normalize(10, 14, _local2);
_local1.distMoveY = Math.normalize(10, 14, _local2);
var arrHor = [[5, 10], [4, 18], [4, 19]];
var arrVer = [[1, 6], [1, 9], [1, 10]];
_local1.spdMaxHorDef = Math.normalize(arrHor[_local3][0], arrHor[_local3][1], _local2);
_local1.spdMaxVerDef = Math.normalize(arrVer[_local3][0], arrVer[_local3][1], _local2);
_local1.accRunHor = Math.normalize(0.3, 1.2, 1 - _local2);
_local1.accRunVer = Math.normalize(0.03, 0.2, _local2);
_local1.aJumpMinDef = 30;
_local1.aJumpMaxDef = 30;
_local1.aJumpSecMinDef;
_local1.aJumpSecMaxDef;
var arr = [[0.05, 3], [0.05, 7], [0.05, 7]];
_local1.tInitial = Math.normalize(arr[_local3][0], arr[_local3][1], 1 - _local2);
_local1.rowInitial = Math.vary(0, 0.2);
_local1.colInitial = Math.vary(Math.normalize(0.2, 1.5, _local2), 0.2);
_local1.colSafe = Math.normalize(0.5, 1.8, _local2);
_local1.rowSafe = 0;
_local1.vxInitial = 0;
_local1.zInitial = Math.vary(480, 50);
var arr = [[2.2, 5], [2.2, 7], [2.5, 7.5]];
_local1.tRecover = Math.normalize(arr[_local3][0], arr[_local3][1], _local2);
_local1.zMinJumpNorm = 10;
};
Razz.prototype.init = function () {
this.build();
};
Razz.prototype.begin = function () {
var _local1 = this;
_local1.vx = _local1.vxInitial;
_local1.startUpdate();
_local1.switchBounceLat(0);
_local1.switchTarget(0);
_local1.intro();
_local1.anim("still");
};
Razz.prototype.intro = function () {
var _local1 = this;
_local1.fIntro = 0;
_local1.updateIntro = _local1.updateIntroOn;
};
Razz.prototype.updateIntroOn = function () {
var _local1 = this;
_local1.fIntro++;
if ((_local1.fIntro % (3 + _local1.id)) == 0) {
if (Math.random() > 0.8) {
_local1.tryJump();
}
}
if (Math.random() > 0.92) {
var _local2 = 0.15;
if (Math.random() > 0.5) {
_local1.axl = 0;
_local1.axr = _local2;
} else {
_local1.axr = 0;
_local1.axl = -_local2;
}
} else {
_local1.axl = (_local1.axr = 0);
}
if (Math.random() > 0.95) {
var _local2 = 0.05;
if (Math.random() > 0.5) {
_local1.ayu = 0;
_local1.ayd = _local2;
} else {
_local1.ayd = 0;
_local1.ayu = -_local2;
}
} else {
_local1.ayu = (_local1.ayd = 0);
}
_local1.updateAnim();
};
Razz.prototype.build = function () {
var _local1 = this;
var _local3 = gBoard.getPersonHolder();
var _local2 = ("mc" + _local1.genus) + _local1.subGenus;
var strName = (_local2 + _local1.id);
_local1.mc = _local3.attachMovie(_local2, strName, _local3.nextHighestDepth++);
_local1.initUpdate();
var headNum = gLevel.razzHeadArr[gLevel.getNum()][_local1.id];
var camNum = gLevel.razzCamArr[gLevel.getNum()][_local1.id];
_local1.mc.mcContent.mcAnim.mcHead.gotoAndStop(headNum);
_local1.mc.mcContent.mcAnim.mcCam.mcModel.gotoAndStop(camNum);
_local1.buildGhost();
_local1.setBaseScaleRat(0.6);
};
Razz.prototype.prepare = function () {
this.waitFor(this.tInitial);
};
Razz.prototype.kill = function () {
this.mc.removeMovieClip();
this.myGhost.kill();
};
Razz.prototype.hitWallSub = function () {
var _local1 = this;
if (!_local1.isRecovering) {
_local1.keyDown(4);
_local1.keyUp(4);
}
};
Razz.prototype.updateSub = function () {
this.updateIntro();
};
Razz.prototype.tryLeech = function () {
var _local2 = this;
if (gAvatar.isInvince) {
_local2.unleech();
} else {
var _local1 = gAvatar.addLeech(_local2);
if (_local1) {
_local2.leech();
}
}
};
Razz.prototype.leech = function () {
var _local1 = this;
_local1.anim("leech");
_local1.isLeech = true;
_local1.updatePos = _local1.updatePosLeech;
_local1.updateAuto = null;
_local1.keyUpAll();
var _local2 = _local1.orderRat;
if ((_local1.dirCurr * gAvatar.dirCurr) == -1) {
_local1.sideLeech = -1;
var x0 = 6;
var x1 = 11;
var z0 = 4;
var _local3 = 30;
var rot0 = -60;
var rot1 = -80;
} else {
_local1.sideLeech = 1;
var x0 = 10;
var x1 = 6;
var z0 = 8;
var _local3 = 45;
var rot0 = -40;
var rot1 = -60;
}
_local1.dxLeech = Math.vary(Math.normalize(x0, x1, _local2), 3);
_local1.dyLeech = 0;
_local1.dzLeech = Math.vary(Math.normalize(z0, _local3, _local2), 4);
_local1.setRot(Math.vary(Math.normalize(rot0, rot1, _local2), 3));
};
Razz.prototype.unleech = function (isMute) {
var _local1 = this;
if (isMute == null) {
isMute = false;
}
_local1.recover();
_local1.resetRot();
_local1.anim("unleech");
_local1.keyUpAll();
var xDir = (-_local1.dirCurr);
var xSpd = Math.vary(12, 4);
var _local2 = ((Math.random() > 0.5) ? 1 : -1);
var ySpd = Math.vary(2, 2);
_local1.vx = xDir * xSpd;
_local1.vy = _local2 * ySpd;
_local1.vz = Math.vary(20, 4);
if (!isMute) {
var _local3 = 3;
var ind = Math.floor(Math.random() * (_local3 - 0.0001));
var id = ("woosh" + ind);
var vol = 40;
var dir = ((-_local1.sideLeech) * gAvatar.dirCurr);
var pan = (70 * dir);
gJukebox.startSound(id, vol, pan);
}
};
Razz.prototype.getOrderRat = function () {
return(this.id / (gLevel.getData("razzTotal") - 1));
};
Razz.prototype.bomb = function (bombObj) {
var _local2 = this;
_local2.recover();
_local2.anim("unleech");
_local2.resetRot();
_local2.keyUpAll();
var dx = (_local2.x - gBoard.getX(bombObj.myCell.col));
var dy = (_local2.y - gBoard.getX(bombObj.myCell.row));
var dist = Math.sqrt((dx * dx) + (dy * dy));
var _local1 = 20;
var _local3 = 300;
dxa = Math.constrain(Math.abs(dx), _local1, _local3);
dya = Math.constrain(Math.abs(dx), _local1, _local3);
dist = Math.constrain(dist, _local1, _local3);
var r = ((dist - _local1) / (_local3 - _local1));
var rx = ((dxa - _local1) / (_local3 - _local1));
var ry = ((dya - _local1) / (_local3 - _local1));
var xDir = Math.sgn(dx);
var xSpd = Math.vary(Math.normalize(25, 10, rx), 3);
var yDir = Math.sgn(dy);
var ySpd = Math.vary(Math.normalize(20, 7, ry), 3);
_local2.vx = xDir * xSpd;
_local2.vy = yDir * ySpd;
_local2.vz = Math.vary(Math.normalize(35, 25, r), 3);
};
Razz.prototype.recover = function () {
var _local1 = this;
_local1.isRecovering = true;
_local1.isLeech = false;
_local1.switchZip(1);
_local1.t0 = getTimer() / 1000;
_local1.updatePos = _local1.updatePosNorm;
_local1.updateAuto = _local1.updateAutoRecover;
_local1.switchBounceLat(1);
};
Razz.prototype.unrecover = function () {
var _local1 = this;
_local1.isRecovering = false;
_local1.switchBounceLat(0);
_local1.updateAuto = _local1.updateAutoNorm;
_local1.switchZip(0)();
};
Razz.prototype.jumpSub = function () {
this.anim("jump");
};
Razz.prototype.updatePosLeech = function () {
var _local1 = this;
var _local2 = gAvatar.dirCurr * _local1.sideLeech;
_local1.setDir(_local2);
var x1 = (gAvatar.x + (_local1.dxLeech * (-_local2)));
var y1 = (gAvatar.y + _local1.dyLeech);
var _local3 = gAvatar.z + _local1.dzLeech;
_local1.setZ(_local3);
_local1.setPos(x1, y1);
};
Razz.prototype.updateAutoRecover = function () {
var _local1 = this;
var _local2 = (getTimer() / 1000) - _local1.t0;
if (_local2 > (_local1.tRecover - 1.2)) {
_local1.anim("unrecover");
} else if (_local1.isOnGround()) {
if (_local1.animMode != "recover") {
var _local3 = 3;
var ind = Math.floor(Math.random() * (_local3 - 0.0001));
var id = ("fall" + ind);
var vol0 = 40;
var vol1 = 170;
var vol = Math.normalize(vol0, vol1, gBoard.getScreenVicinity(_local1.x));
var pan = gBoard.getScreenPan(_local1.x);
gJukebox.startSound(id, vol, pan);
}
_local1.anim("recover");
}
if (_local2 > _local1.tRecover) {
_local1.unrecover();
}
};
Razz.prototype.animTrig = function (mode) {
var _local3 = this;
switch (mode) {
case "landDone" :
_local3.anim("still");
return;
case "flash" :
_local3.mc.mcContent.mcAnim.mcCam.gotoAndPlay("on");
var _local2 = "pop0";
var _local1 = 50;
var dir = ((-_local3.sideLeech) * gAvatar.dirCurr);
var pan = (80 * dir);
gJukebox.startSound(_local2, _local1, pan);
}
};
Razz.prototype.waitFor = function (tDur) {
var _local1 = this;
_local1.tWait = tDur;
_local1.t0 = getTimer() / 1000;
_local1.updateAuto = _local1.updateAutoWait;
};
Razz.prototype.updateAutoWait = function () {
var _local1 = this;
var _local2 = (getTimer() / 1000) - _local1.t0;
if (_local2 > _local1.tWait) {
_local1.engage();
}
};
Razz.prototype.engage = function (mode) {
var _local1 = this;
_local1.switchTarget(1);
_local1.updateAuto = _local1.updateAutoNorm;
_local1.updateIntro = null;
};
Razz.prototype.switchTarget = function (mode) {
var _local1 = this;
switch (mode) {
case 1 :
_local1.setTarget = _local1.setTargetAvatar;
_local1.modeTarget = 1;
return;
case 0 :
_local1.setTargetSafe();
_local1.setTarget = null;
_local1.modeTarget = 0;
return;
}
};
Razz.prototype.setTargetSafe = function () {
var _local1 = this;
_local1.xTarg = gBoard.getX(_local1.colSafe);
_local1.yTarg = gBoard.getY(_local1.rowSafe);
};
Razz.prototype.setTargetAvatar = function () {
this.xTarg = gAvatar.x;
this.yTarg = gAvatar.y;
};
Razz.prototype.updateAnim = function () {
var _local1 = this;
if (_local1.getAirZ() < 5) {
if (_local1.animMode == "jump") {
_local1.anim("land");
} else if (_local1.animMode != "land") {
var _local2 = _local1.getSpd();
if (_local2 > 0.2) {
_local1.anim("run");
} else {
_local1.anim("still");
}
}
}
};
Razz.prototype.updateAutoNorm = function () {
var _local1 = this;
_local1.setTarget();
var _local3 = _local1.xTarg - _local1.x;
var _local2 = _local1.yTarg - _local1.y;
var dirX = Math.sgn(_local3);
var dirY = Math.sgn(_local2);
_local1.updateAnim();
if (Math.abs(_local3) > _local1.distMoveX) {
if (dirX > 0) {
_local1.keyDown(3);
_local1.keyUp(2);
} else {
_local1.keyDown(2);
_local1.keyUp(3);
}
} else {
_local1.keyUp(2);
_local1.keyUp(3);
}
if (Math.abs(_local2) > _local1.distMoveY) {
if (dirY > 0) {
_local1.keyDown(1);
_local1.keyUp(0);
} else {
_local1.keyDown(0);
_local1.keyUp(1);
}
} else {
_local1.keyUp(0);
_local1.keyUp(1);
}
var distFlat = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
var distVert = Math.abs(gAvatar.z - _local1.z);
if ((distFlat < _local1.distFlatLeech) && (distVert < _local1.distVertLeech)) {
if (_local1.modeTarget == 1) {
_local1.tryLeech();
}
}
};
trace("#include Array.as");
Array.prototype.getLength = function () {
var _local1 = this;
var _local2 = 0;
for (var _local3 in _local1) {
if (typeof(_local1[_local3]) != "function") {
_local2 = _local2 + 1;
}
}
return(_local2);
};
Array.prototype.first = function () {
return(this[0]);
};
Array.prototype.last = function () {
return(this[this.length - 1]);
};
Array.prototype.sortOn = function (p, d) {
Array.$sortprop = p;
var sortfunc = function (a, b) {
var p = Array.$sortprop;
if (d == "down") {
return(eval ("b." + p) < eval ("a." + p));
}
return(eval ("b." + p) > eval ("a." + p));
};
this.sort(sortfunc);
delete Array.$sortprop;
};
Array.prototype.copy = function () {
return(this.slice(0, this.length));
};
Array.prototype.deleteAll = function () {
var _local1 = this;
while (_local1.length > 0) {
_local1.pop();
}
if (_local1.length > 0) {
return(false);
}
return(true);
};
Array.prototype.max = function () {
var _local1 = this.copy();
_local1.sort();
return(_local1[_local1.length - 1]);
};
Array.prototype.min = function () {
var _local1 = this.copy();
_local1.sort();
return(_local1[0]);
};
Array.prototype.swapElements = function (index1, index2) {
var _local1 = this;
var _local2 = _local1[index1];
_local1[index1] = _local1[index2];
_local1[index2] = _local2;
};
Array.prototype.insertAt = function (theIndex, item) {
this.splice(theIndex, 0, item);
};
Array.prototype.removeAt = function (theIndex) {
this.splice(theIndex, 1);
};
Array.prototype.contains = function (item) {
var _local2 = this;
var _local3 = item;
var _local1 = 0;
while (_local1 < _local2.length) {
if (_local3 == _local2[_local1]) {
return(true);
}
_local1++;
}
return(false);
};
Array.prototype.getRandom = function () {
var _local1 = Math.floor(Math.random() * (this.length - 1E-5));
return(this[_local1]);
};
trace("#include Color.as");
Color.rgbToHex = function (r, g, b) {
return(((r << 16) | (g << 8)) | b);
};
Color.hexToRGB = function (hex) {
var r = (hex >> 16);
var _local1 = hex - (r << 16);
var g = (_local1 >> 8);
var b = (_local1 - (g << 8));
return({r:r, g:g, b:b});
};
Color.hexToRed = function (hex) {
return(hex >> 16);
};
Color.hexToGreen = function (hex) {
var _local1 = hex >> 16;
var _local2 = hex - (_local1 << 16);
return(_local2 >> 8);
};
Color.hexToBlue = function (hex) {
var _local2 = hex >> 16;
var _local1 = hex - (_local2 << 16);
var _local3 = _local1 >> 8;
return(_local1 - (_local3 << 8));
};
Color.blend = function (hex0, hex1, rat) {
var _local1 = rat;
if (_local1 == null) {
_local1 = 0.5;
}
var r0 = (hex0 >> 16);
var _local3 = hex0 - (r0 << 16);
var g0 = (_local3 >> 8);
var b0 = (_local3 - (g0 << 8));
var r1 = (hex1 >> 16);
var _local2 = hex1 - (r1 << 16);
var g1 = (_local2 >> 8);
var b1 = (_local2 - (g1 << 8));
var r = (((1 - _local1) * r0) + (_local1 * r1));
var g = (((1 - _local1) * g0) + (_local1 * g1));
var b = (((1 - _local1) * b0) + (_local1 * b1));
return(((r << 16) | (g << 8)) | b);
};
trace("#include MovieClip.as");
MovieClip.MAX_MC_DEPTH = 1048575 /* 0x0FFFFF */;
MovieClip.prototype.getPercentLoaded = function () {
var _local1 = this;
if (_local1.getBytesTotal() < 70) {
return(0);
}
return((_local1.getBytesLoaded() * 100) / _local1.getBytesTotal());
};
MovieClip.prototype.getLowestDepth = function () {
var _local1 = this;
var _local2 = 0;
for (var _local3 in _local1) {
if (typeof(_local1[_local3]) == "movieclip") {
_local2 = _local1[_local3].getDepth();
}
}
return(_local2);
};
MovieClip.prototype.getHighestDepth = function () {
var _local1 = this;
var _local2 = 0;
for (var _local3 in _local1) {
if (typeof(_local1[_local3]) == "movieclip") {
_local2 = _local1[_local3].getDepth();
break;
}
}
return(_local2);
};
MovieClip.prototype.getNextHighestDepth = function () {
return(++this.nextHighestDepth);
};
MovieClip.prototype.pause = function (duration) {
var _local1 = this;
_local1.stop();
_local1.pauseAndInvoke("MCPause", duration, "play", _local1);
};
MovieClip.prototype.unpause = function () {
this.pauseAndInvokeKill("MCPause");
this.play();
};
MovieClip.prototype.pauseAndInvoke = function (myID, myDelay, myFunction, myLocation, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39) {
var _local1 = this;
var timerDepth = (++_local1.nextHighestDepth);
if (myID == null) {
var _local2 = "mcTimer" + timerDepth;
} else {
var _local2 = "mcTimer" + myID;
}
trace((_local1._target + ".pauseAndInvoke ") + _local2);
_local1.createEmptyMovieClip(_local2, timerDepth);
var _local3 = _local1[_local2];
_local3.time = myDelay;
_local3.onEnterFrame = function () {
var _local1 = this;
if (_local1.time <= 0) {
myLocation[myFunction](p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39);
delete _local1.onEnterFrame;
_local1.removeMovieClip();
} else {
_local1.time--;
}
};
};
MovieClip.prototype.pauseAndInvokeKill = function (myID) {
var _local2 = this;
var _local1 = _local2["mcTimer" + mcID];
if (_local1 != null) {
delete _local2["mcTimer" + myID].onEnterFrame;
_local2["mcTimer" + myID].removeMovieClip();
}
};
MovieClip.prototype.pauseAndInvokeKillAll = function () {
var _local1 = this;
for (var _local2 in _local1) {
if ((_local2.slice(0, 7) == "mcTimer") && (typeof(_local1[_local2]) == "movieclip")) {
delete _local1[_local2].onEnterFrame;
_local1[_local2].removeMovieClip();
}
}
};
MovieClip.prototype.setProperty = function (myProperty, myValue) {
var _local2 = arguments;
var _local3 = this;
var _local1 = 0;
while (_local1 < _local2.length) {
_local3[_local2[_local1]] = _local2[_local1 + 1];
_local1 = _local1 + 2;
}
};
MovieClip.prototype.transform = function (myTween, myDuration, myProperty, myValue) {
var _local3 = this;
var input = arguments;
var inputLength = ((arguments.length - 3) / 2);
var duration = myDuration;
var property = new Array();
var pStart = new Array();
var pChange = new Array();
var _local2 = null;
var v = null;
var _local1 = 0;
while (_local1 < inputLength) {
_local2 = input[2 + (_local1 * 2)];
v = input[3 + (_local1 * 2)];
property.push(_local2);
pStart.push(_local3[_local2]);
pChange.push(v - _local3[_local2]);
_local1++;
}
_local3.time = 0;
_local3.createEmptyMovieClip("mcControlTransform", 999999);
_local3.mcControlTransform.onEnterFrame = function () {
var _local2 = this._parent;
var _local3 = myTween;
var _local1 = 0;
while (_local1 < inputLength) {
if (pChange[_local1] != 0) {
_local2[property[_local1]] = Math[_local3](_local2.time, pStart[_local1], pChange[_local1], duration, amplitude, period);
}
_local1++;
}
if (_local2.time >= duration) {
delete this.onEnterFrame;
this.removeMovieClip();
}
_local2.time++;
};
};
MovieClip.prototype.setColor = function (hex, percent, alpha, offset) {
var _local2 = percent;
var col = new Color(this);
var _local1 = new Object();
var _local3 = Color.hexToRGB(hex);
if (_local2 == undefined) {
_local2 = 100;
}
if (alpha == undefined) {
alpha = 100;
}
if (offset == undefined) {
offset = 0;
}
_local2 = _local2 / 100;
alpha = alpha / 100;
if (hex == "restore") {
_local1.ra = 100;
_local1.ga = 100;
_local1.ba = 100;
_local1.aa = 100 * alpha;
_local1.rb = 0;
_local1.gb = 0;
_local1.bb = 0;
_local1.ab = 0;
} else if (typeof(hex) == "object") {
_local1 = hex;
} else {
_local1.ra = (100 * (1 - _local2)) + offset;
_local1.ga = (100 * (1 - _local2)) + offset;
_local1.ba = (100 * (1 - _local2)) + offset;
_local1.aa = 100 * alpha;
_local1.rb = _local3.r * _local2;
_local1.gb = _local3.g * _local2;
_local1.bb = _local3.b * _local2;
_local1.ab = 0;
}
col.setTransform(_local1);
};
MovieClip.prototype.transformColor = function (tween, duration, hex, percent, alpha, offset) {
if (percent == undefined) {
percent = 100;
}
if (alpha == undefined) {
alpha = 100;
}
if (offset == undefined) {
offset = 0;
}
this.transformColorData = new Object();
var mcData = this.transformColorData;
mcData.timer = 0;
mcData.duration = duration;
mcData.percent = percent / 100;
mcData.alpha = alpha / 100;
mcData.tween = tween;
mcData.mcColor = new Color(this);
mcData.colorStart = mcData.mcColor.getTransform();
mcData.colorHolder = new Object();
mcData.colorsArray = new Array("r", "g", "b", "a");
mcData.typeArray = new Array("b", "a");
if (hex == "restore") {
mcData.deltara = (100 - mcData.colorStart.ra) + offset;
mcData.deltaga = (100 - mcData.colorStart.ga) + offset;
mcData.deltaba = (100 - mcData.colorStart.ba) + offset;
mcData.deltaaa = (100 * mcData.alpha) - mcData.colorStart.aa;
mcData.deltarb = -mcData.colorStart.rb;
mcData.deltagb = -mcData.colorStart.gb;
mcData.deltabb = -mcData.colorStart.bb;
mcData.deltaab = -mcData.colorStart.ab;
} else if (typeof(hex) == "object") {
mcData.deltara = hex.ra - mcData.colorStart.ra;
mcData.deltaga = hex.ga - mcData.colorStart.ga;
mcData.deltaba = hex.ba - mcData.colorStart.ba;
mcData.deltaaa = hex.aa - mcData.colorStart.aa;
mcData.deltarb = hex.rb - mcData.colorStart.rb;
mcData.deltagb = hex.gb - mcData.colorStart.gb;
mcData.deltabb = hex.bb - mcData.colorStart.bb;
mcData.deltaab = hex.ab - mcData.colorStart.ab;
} else {
mcData.colorDest = Color.hexToRGB(hex);
mcData.deltara = ((100 * (1 - mcData.percent)) - mcData.colorStart.ra) + offset;
mcData.deltaga = ((100 * (1 - mcData.percent)) - mcData.colorStart.ga) + offset;
mcData.deltaba = ((100 * (1 - mcData.percent)) - mcData.colorStart.ba) + offset;
mcData.deltaaa = (100 * mcData.alpha) - mcData.colorStart.aa;
mcData.deltarb = (mcData.colorDest.r * mcData.percent) - mcData.colorStart.rb;
mcData.deltagb = (mcData.colorDest.g * mcData.percent) - mcData.colorStart.gb;
mcData.deltabb = (mcData.colorDest.b * mcData.percent) - mcData.colorStart.bb;
mcData.deltaab = -mcData.colorStart.ab;
}
this.createEmptyMovieClip("mcControlTransformColor", -1);
this.mcControlTransformColor.onEnterFrame = function () {
var i = 0;
while (i <= (mcData.typeArray.length - 1)) {
var _local3 = mcData.typeArray[i];
var _local2 = 0;
while (_local2 <= (mcData.colorsArray.length - 1)) {
var _local1 = mcData.colorsArray[_local2];
var myDelta = mcData[("delta" + _local1) + _local3];
if (myDelta != 0) {
mcData.colorHolder[_local1 + _local3] = Math[mcData.tween](mcData.timer, mcData.colorStart[_local1 + _local3], mcData[("delta" + _local1) + _local3], mcData.duration, mcData.amplitude, mcData.period);
}
_local2++;
}
i++;
}
mcData.mcColor.setTransform(mcData.colorHolder);
if (mcData.timer >= mcData.duration) {
delete this.onEnterFrame;
this.removeMovieClip();
} else {
mcData.timer++;
}
};
};
MovieClip.prototype.hide = function () {
this._visible = false;
};
MovieClip.prototype.show = function () {
this._visible = true;
};
MovieClip.prototype.enable = function () {
this.enabled = true;
};
MovieClip.prototype.disable = function () {
this.enabled = false;
};
MovieClip.prototype.drawLine = function (x1, y1, x2, y2, lineWeight, lineColor, lineAlpha) {
var _local1 = this;
_local1.lineStyle(lineWeight, lineColor, lineAlpha);
_local1.moveTo(x1, y1);
_local1.lineTo(x2, y2);
};
MovieClip.prototype.drawRect = function (x, y, w, h, lineWeight, lineColor, lineAlpha, fillColor, fillAlpha) {
var _local1 = this;
var _local3 = x;
var right = (x + w);
var _local2 = y;
var bottom = (y + h);
if (((lineWeight + lineColor) + lineAlpha) != -3) {
_local1.lineStyle(lineWeight, lineColor, lineAlpha);
}
if ((fillColor + fillAlpha) != -2) {
_local1.beginFill(fillColor, fillAlpha);
}
_local1.moveTo(_local3, _local2);
_local1.lineTo(right, _local2);
_local1.lineTo(right, bottom);
_local1.lineTo(_local3, bottom);
_local1.lineTo(_local3, _local2);
if ((fillColor + fillAlpha) != -2) {
_local1.endFill();
}
};
MovieClip.prototype.drawPolygon = function (x, y, radius, vertices, lineWeight, lineColor, lineAlpha, fillColor, fillAlpha) {
if (((lineWeight + lineColor) + lineAlpha) != -3) {
this.lineStyle(lineWeight, lineColor, lineAlpha);
}
if ((fillColor + fillAlpha) != -2) {
this.beginFill(fillColor, fillAlpha);
}
if (typeof(vertices) == "object") {
} else {
var _local2 = 0;
var vx = 0;
var _local3 = 0;
var _local1 = 0;
while (_local1 < vertices) {
_local2 = Math.degreesToRadians(360 / vertices) * _local1;
vx = (Math.cos(_local2) * radius) + x;
_local3 = (Math.sin(_local2) * radius) + y;
if (_local1 < 1) {
this.moveTo(vx, _local3);
} else {
this.lineTo(vx, _local3);
}
_local1++;
}
}
if ((fillColor + fillAlpha) != -2) {
this.endFill();
}
};
MovieClip.prototype.drawPie = function (x, y, radius, slicesCurrent, slicesTotal, lineWeight, lineColor, lineAlpha, fillColor, fillAlpha) {
var _local2 = this;
if (((lineWeight + lineColor) + lineAlpha) != -3) {
_local2.lineStyle(lineWeight, lineColor, lineAlpha);
}
if ((fillColor + fillAlpha) != -2) {
_local2.beginFill(fillColor, fillAlpha);
}
var theta = 0;
var vx = 0;
var _local3 = 0;
var _local1 = 0;
while (_local1 <= slicesCurrent) {
theta = Math.degreesToRadians(360 / slicesTotal) * _local1;
vx = (Math.cos(theta) * radius) + x;
_local3 = (Math.sin(theta) * radius) + y;
if (_local1 < 1) {
if (slicesCurrent < slicesTotal) {
_local2.moveTo(x, y);
_local2.lineTo(vx, _local3);
} else {
_local2.moveTo(vx, _local3);
}
} else {
_local2.lineTo(vx, _local3);
}
_local1++;
}
if (slicesCurrent < slicesTotal) {
_local2.lineTo(x, y);
}
if ((fillColor + fillAlpha) != -2) {
_local2.endFill();
}
};
MovieClip.prototype.removeAllMovieClips = function () {
var _local1 = this;
for (var _local2 in _local1) {
if (typeof(_local1[_local2]) == "movieclip") {
_local1[_local2].removeMovieClip();
}
}
};
MovieClip.prototype.makeSound = function (linkage) {
var _local1 = linkage;
var _local2 = this;
_local2.mcSound.createEmptyMovieClip(_local1 + "SndHolder", _local2.mcSound.nextHighestDepth++);
var _local3 = (_local2[_local1 + "Snd"] = new Sound(_local2.mcSound[_local1 + "SndHolder"]));
_local3.attachSound(_local1);
};
MovieClip.prototype.makeShadow = function (alp) {
var _local1 = alp;
if (_local1 == undefined) {
_local1 = 40;
}
var newShadow = new Shadow(this, _local1);
};
MovieClip.prototype.updateShadow = function () {
this.shadowObj.update();
};
MovieClip.prototype.removeShadow = function () {
this.shadowObj.remove();
};
MovieClip.prototype.gotoAndStopRat = function (rat) {
var _local1 = 1 + Math.floor((this._totalframes - 1) * rat);
this.gotoAndStop(_local1);
};
trace("#include MathEasing.as");
Math.linearTween = function (t, b, c, d) {
return(((c * t) / d) + b);
};
Math.easeInQuad = function (t, b, c, d) {
return(((c * ((t = t / d))) * t) + b);
};
Math.easeOutQuad = function (t, b, c, d) {
return((((-c) * ((t = t / d))) * (t - 2)) + b);
};
Math.easeInOutQuad = function (t, b, c, d) {
var _local1 = t;
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return((((c / 2) * _local1) * _local1) + b);
}
_local1--;
return((((-c) / 2) * ((_local1 * (_local1 - 2)) - 1)) + b);
};
Math.easeInCubic = function (t, b, c, d) {
var _local1 = t;
_local1 = _local1 / d;
return((((c * _local1) * _local1) * _local1) + b);
};
Math.easeOutCubic = function (t, b, c, d) {
var _local1 = t;
_local1 = (_local1 / d) - 1;
return((c * (((_local1 * _local1) * _local1) + 1)) + b);
};
Math.easeInOutCubic = function (t, b, c, d) {
var _local1 = t;
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return(((((c / 2) * _local1) * _local1) * _local1) + b);
}
_local1 = _local1 - 2;
return(((c / 2) * (((_local1 * _local1) * _local1) + 2)) + b);
};
Math.easeInQuart = function (t, b, c, d) {
var _local1 = t;
_local1 = _local1 / d;
return(((((c * _local1) * _local1) * _local1) * _local1) + b);
};
Math.easeOutQuart = function (t, b, c, d) {
var _local1 = t;
_local1 = (_local1 / d) - 1;
return(((-c) * ((((_local1 * _local1) * _local1) * _local1) - 1)) + b);
};
Math.easeInOutQuart = function (t, b, c, d) {
var _local1 = t;
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return((((((c / 2) * _local1) * _local1) * _local1) * _local1) + b);
}
_local1 = _local1 - 2;
return((((-c) / 2) * ((((_local1 * _local1) * _local1) * _local1) - 2)) + b);
};
Math.easeInQuint = function (t, b, c, d) {
var _local1 = t;
_local1 = _local1 / d;
return((((((c * _local1) * _local1) * _local1) * _local1) * _local1) + b);
};
Math.easeOutQuint = function (t, b, c, d) {
var _local1 = t;
_local1 = (_local1 / d) - 1;
return((c * (((((_local1 * _local1) * _local1) * _local1) * _local1) + 1)) + b);
};
Math.easeInOutQuint = function (t, b, c, d) {
var _local1 = t;
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return(((((((c / 2) * _local1) * _local1) * _local1) * _local1) * _local1) + b);
}
_local1 = _local1 - 2;
return(((c / 2) * (((((_local1 * _local1) * _local1) * _local1) * _local1) + 2)) + b);
};
Math.easeInSine = function (t, b, c, d) {
return((((-c) * Math.cos((t / d) * (Math.PI/2))) + c) + b);
};
Math.easeOutSine = function (t, b, c, d) {
return((c * Math.sin((t / d) * (Math.PI/2))) + b);
};
Math.easeInOutSine = function (t, b, c, d) {
return((((-c) / 2) * (Math.cos((Math.PI * t) / d) - 1)) + b);
};
Math.easeInExpo = function (t, b, c, d) {
return(((t == 0) ? (b) : ((c * Math.pow(2, 10 * ((t / d) - 1))) + b)));
};
Math.easeOutExpo = function (t, b, c, d) {
return(((t == d) ? (b + c) : ((c * ((-Math.pow(2, (-10 * t) / d)) + 1)) + b)));
};
Math.easeInOutExpo = function (t, b, c, d) {
var _local1 = t;
var _local2 = b;
var _local3 = c;
if (_local1 == 0) {
return(_local2);
}
if (_local1 == d) {
return(_local2 + _local3);
}
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return(((_local3 / 2) * Math.pow(2, 10 * (_local1 - 1))) + _local2);
}
_local1--;
return(((_local3 / 2) * ((-Math.pow(2, -10 * _local1)) + 2)) + _local2);
};
Math.easeInCirc = function (t, b, c, d) {
return(((-c) * (Math.sqrt(1 - (((t = t / d)) * t)) - 1)) + b);
};
Math.easeOutCirc = function (t, b, c, d) {
var _local1 = t;
_local1 = (_local1 / d) - 1;
return((c * Math.sqrt(1 - (_local1 * _local1))) + b);
};
Math.easeInOutCirc = function (t, b, c, d) {
var _local1 = t;
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return((((-c) / 2) * (Math.sqrt(1 - (_local1 * _local1)) - 1)) + b);
}
_local1 = _local1 - 2;
return(((c / 2) * (Math.sqrt(1 - (_local1 * _local1)) + 1)) + b);
};
Math.easeInElastic = function (t, b, c, d, a, p) {
var _local1 = p;
var _local2 = t;
var _local3 = c;
if (_local2 == 0) {
return(b);
}
_local2 = _local2 / d;
if (_local2 == 1) {
return(b + _local3);
}
if (!_local1) {
_local1 = d * 0.3;
}
if (a < Math.abs(_local3)) {
a = _local3;
var s = (_local1 / 4);
} else {
var s = ((_local1 / (Math.PI*2)) * Math.asin(_local3 / a));
}
_local2 = _local2 - 1;
return((-((a * Math.pow(2, 10 * _local2)) * Math.sin((((_local2 * d) - s) * (Math.PI*2)) / _local1))) + b);
};
Math.easeOutElastic = function (t, b, c, d, a, p) {
var _local1 = c;
var _local2 = p;
var _local3 = t;
if (_local3 == 0) {
return(b);
}
_local3 = _local3 / d;
if (_local3 == 1) {
return(b + _local1);
}
if (!_local2) {
_local2 = d * 0.3;
}
if (a < Math.abs(_local1)) {
a = _local1;
var s = (_local2 / 4);
} else {
var s = ((_local2 / (Math.PI*2)) * Math.asin(_local1 / a));
}
return((((a * Math.pow(2, -10 * _local3)) * Math.sin((((_local3 * d) - s) * (Math.PI*2)) / _local2)) + _local1) + b);
};
Math.easeInOutElastic = function (t, b, c, d, a, p) {
var _local1 = t;
var _local2 = p;
var _local3 = c;
if (_local1 == 0) {
return(b);
}
_local1 = _local1 / (d / 2);
if (_local1 == 2) {
return(b + _local3);
}
if (!_local2) {
_local2 = d * 0.45;
}
if (a < Math.abs(_local3)) {
a = _local3;
var s = (_local2 / 4);
} else {
var s = ((_local2 / (Math.PI*2)) * Math.asin(_local3 / a));
}
if (_local1 < 1) {
_local1 = _local1 - 1;
return((-0.5 * ((a * Math.pow(2, 10 * _local1)) * Math.sin((((_local1 * d) - s) * (Math.PI*2)) / _local2))) + b);
}
_local1 = _local1 - 1;
return(((((a * Math.pow(2, -10 * _local1)) * Math.sin((((_local1 * d) - s) * (Math.PI*2)) / _local2)) * 0.5) + _local3) + b);
};
Math.easeInBack = function (t, b, c, d, s) {
var _local1 = s;
var _local2 = t;
if (_local1 == undefined) {
_local1 = 1.70158;
}
_local2 = _local2 / d;
return((((c * _local2) * _local2) * (((_local1 + 1) * _local2) - _local1)) + b);
};
Math.easeOutBack = function (t, b, c, d, s) {
var _local1 = t;
var _local2 = s;
if (_local2 == undefined) {
_local2 = 2;
}
_local1 = (_local1 / d) - 1;
return((c * (((_local1 * _local1) * (((_local2 + 1) * _local1) + _local2)) + 1)) + b);
};
Math.easeInOutBack = function (t, b, c, d, s) {
var _local1 = t;
var _local2 = s;
if (_local2 == undefined) {
_local2 = 1.70158;
}
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
_local2 = _local2 * 1.525;
return(((c / 2) * ((_local1 * _local1) * (((_local2 + 1) * _local1) - _local2))) + b);
}
_local1 = _local1 - 2;
_local2 = _local2 * 1.525;
return(((c / 2) * (((_local1 * _local1) * (((_local2 + 1) * _local1) + _local2)) + 2)) + b);
};
Math.easeInBounce = function (t, b, c, d) {
return((c - Math.easeOutBounce(d - t, 0, c, d)) + b);
};
Math.easeOutBounce = function (t, b, c, d) {
var _local1 = t;
var _local2 = c;
var _local3 = b;
_local1 = _local1 / d;
if (_local1 < 0.363636363636364) {
return((_local2 * ((7.5625 * _local1) * _local1)) + _local3);
}
if (_local1 < 0.727272727272727) {
_local1 = _local1 - 0.545454545454545;
return((_local2 * (((7.5625 * _local1) * _local1) + 0.75)) + _local3);
}
if (_local1 < 0.909090909090909) {
_local1 = _local1 - 0.818181818181818;
return((_local2 * (((7.5625 * _local1) * _local1) + 0.9375)) + _local3);
}
_local1 = _local1 - 0.954545454545455;
return((_local2 * (((7.5625 * _local1) * _local1) + 0.984375)) + _local3);
};
Math.easeInOutBounce = function (t, b, c, d) {
var _local1 = d;
var _local2 = t;
var _local3 = c;
if (_local2 < (_local1 / 2)) {
return((Math.easeInBounce(_local2 * 2, 0, _local3, _local1) * 0.5) + b);
}
return(((Math.easeOutBounce((_local2 * 2) - _local1, 0, _local3, _local1) * 0.5) + (_local3 * 0.5)) + b);
};
trace("#include Math.as");
Math.mean = function (args) {
var _local2 = arguments;
var _local3 = 0;
var _local1 = 0;
while (_local1 < _local2.length) {
_local3 = _local3 + _local2[_local1];
_local1++;
}
return(_local3 / _local2.length);
};
Math.median = function (args) {
};
Math.getChance = function (chance) {
var _local1 = Math.floor(Math.random() * (chance + 1));
if (_local1 == chance) {
return(true);
}
return(false);
};
Math.degreesToRadians = function (degrees) {
return(degrees * (Math.PI/180));
};
Math.radiansToDegrees = function (radians) {
return(radians / (Math.PI/180));
};
Math.getAngle = function (x1, y1, x2, y2) {
var _local2 = x2 - x1;
var _local3 = y2 - y1;
var _local1 = (-(180 * Math.atan2(_local3, _local2))) / Math.PI;
return(Math.round(_local1));
};
Math.getDistance = function (x1, y1, x2, y2) {
var _local2 = x2 - x1;
var _local3 = y2 - y1;
var _local1 = Math.sqrt(Math.pow(_local2, 2) + Math.pow(_local3, 2));
return(_local1);
};
Math.getRadPoint = function (angle, radius, mc) {
var _local2 = mc;
var rads = Math.degreesToRadians(angle);
var x = (radius * Math.cos(rads));
var y = (radius * Math.sin(rads));
var _local1 = new Object();
if (((_local2 != null) && (_local2 != undefined)) && (_local2 != "")) {
var _local3 = new syncPos(_local2);
_local1.x = _local3.x + x;
_local1.y = _local3.y - y;
} else {
_local1.x = x;
_local1.y = y;
}
return(_local1);
};
Math.constrain = function (num, lower, upper) {
var _local1 = num;
if (_local1 < lower) {
return(lower);
}
if (_local1 > upper) {
return(upper);
}
return(_local1);
};
Math.sgn = function (num) {
if (num < 0) {
return(-1);
}
if (num > 0) {
return(1);
}
return(0);
};
Math.normalize = function (s0, s1, rat) {
return(s0 + (rat * (s1 - s0)));
};
Math.vary = function (s0, s1) {
return((s0 - s1) + (Math.random() * (s1 * 2)));
};
trace("#include String.as");
String.prototype.splice = function (start, deleteCount, insert) {
var _local2 = insert;
var _local1 = this.slice(0, start);
var _local3 = this.slice(start + deleteCount);
return((_local1 + _local2) + _local3);
};
String.prototype.searchAndReplace = function (stringSearch, stringReplace) {
var _local2 = this.split(stringSearch);
var _local3 = "";
var _local1 = 0;
while (_local1 < _local2.length) {
if (_local1 == (_local2.length - 1)) {
_local3 = _local3 + _local2[_local1];
} else {
_local3 = _local3 + (_local2[_local1] + stringReplace);
}
_local1++;
}
return(_local3);
};
String.prototype.countWords = function () {
var _local1 = this.split(" ");
return(_local1.length);
};
String.prototype.extractWords = function () {
var words = new Array();
var _local3 = "";
var _local2 = 0;
while (_local2 < this.length) {
var _local1 = this.charCodeAt(_local2);
if ((((_local1 > 48) && (_local1 < 58)) || ((_local1 > 64) && (_local1 < 91))) || ((_local1 > 96) && (_local1 < 123))) {
_local3 = _local3 + String.fromCharCode(_local1);
} else if (_local3.length > 0) {
words.push(_local3);
_local3 = "";
}
_local2++;
}
return(words);
};
String.prototype.addPadding = function (variableLength, padLength, padString) {
var _local3 = padString;
var _local1 = this;
if (variableLength) {
while (_local1.length < padLength) {
_local1 = _local3 + _local1;
}
} else {
var _local2 = 0;
while (_local2 < padLength) {
_local1 = _local3 + _local1;
_local2++;
}
}
return(_local1);
};
String.prototype.generateRandomUpperCase = function (stringLength) {
var _local3 = "";
var _local2 = 0;
if (arguments.length == 0) {
_local2 = random(26) + 65;
_local3 = _local3 + String.fromCharCode(_local2);
} else {
var _local1 = 0;
while (_local1 < stringLength) {
_local2 = random(26) + 65;
_local3 = _local3 + String.fromCharCode(_local2);
_local1++;
}
}
return(_local3);
};
String.prototype.generateRandomLowerCase = function (stringLength) {
var _local3 = "";
var _local2 = 0;
if (arguments.length == 0) {
_local2 = random(26) + 97;
_local3 = _local3 + String.fromCharCode(_local2);
} else {
var _local1 = 0;
while (_local1 < stringLength) {
_local2 = random(26) + 97;
_local3 = _local3 + String.fromCharCode(_local2);
_local1++;
}
}
return(_local3);
};
String.prototype.generateRandomNumber = function (stringLength) {
var _local3 = stringLength;
var _local2 = "";
if (arguments.length == 0) {
_local2 = _local2 + random(10);
} else {
var _local1 = 0;
while (_local1 < _local3) {
_local2 = _local2 + random(10);
_local1++;
}
}
return(_local2);
};
String.prototype.generateRandomAlphaNumeric = function (stringLength) {
var _local3 = this;
var _local2 = "";
var charType = null;
if (arguments.length == 0) {
var stringLength = 1;
}
var _local1 = 0;
while (_local1 < stringLength) {
charType = random(3);
switch (charType) {
case 0 :
_local2 = _local2 + _local3.generateRandomNumber();
break;
case 1 :
_local2 = _local2 + _local3.generateRandomUpperCase();
break;
case 2 :
_local2 = _local2 + _local3.generateRandomLowerCase();
}
_local1++;
}
return(_local2);
};
String.prototype.scramble = function () {
var _local2 = this.split("");
var _local1 = 0;
while (_local1 < _local2.length) {
_local2.swapElements(random(_local2.length), random(_local2.length));
_local1++;
}
var _local3 = "";
_local1 = 0;
while (_local1 < _local2.length) {
_local3 = _local3 + _local2[_local1];
_local1++;
}
return(_local3);
};
String.prototype.capFirst = function () {
var _local1 = this;
return(_local1.substr(0, 1).toUpperCase() + _local1.substr(1, _local1.length - 1));
};
Frame 10
init();
stop();
Frame 20
stop();
Symbol 15 MovieClip Frame 1
stop();
Symbol 36 MovieClip Frame 1
Symbol 36 MovieClip Frame 4
play();
Symbol 36 MovieClip Frame 16
play();
Symbol 36 MovieClip Frame 20
gotoAndPlay ("bounce");
Symbol 43 MovieClip Frame 1
stop();
Symbol 45 MovieClip Frame 25
stop();
Symbol 60 MovieClip Frame 7
gotoAndPlay (1);
Symbol 72 MovieClip Frame 1
stop();
Symbol 74 MovieClip Frame 1
stop();
Symbol 74 MovieClip Frame 6
play();
Symbol 74 MovieClip Frame 10
stop();
Symbol 75 MovieClip Frame 2
stop();
Symbol 75 MovieClip Frame 50
var skip = Math.floor(Math.random() * 6);
this.gotoAndPlay(_currentframe + skip);
Symbol 75 MovieClip Frame 67
if (Math.random() > 0.5) {
gotoAndPlay ("jump1");
}
Symbol 75 MovieClip Frame 69
if (Math.random() > 0.5) {
mcArm.mcBulb.gotoAndStop(2);
} else {
mcArm.mcBulb.gotoAndStop(1);
}
play();
Symbol 75 MovieClip Frame 81
mcArm.gotoAndPlay("flash");
Symbol 75 MovieClip Frame 92
gotoAndPlay ("loop");
Symbol 75 MovieClip Frame 99
if (Math.random() > 0.5) {
mcArm.mcBulb.gotoAndStop(2);
} else {
mcArm.mcBulb.gotoAndStop(1);
}
play();
Symbol 75 MovieClip Frame 110
mcArm.gotoAndPlay("flash");
Symbol 75 MovieClip Frame 115
mcArm.gotoAndPlay("flash");
Symbol 75 MovieClip Frame 128
gotoAndPlay ("loop");
Symbol 76 MovieClip Frame 50
stop();
mcEnemy0.gotoAndPlay(2);
mcEnemy1.gotoAndPlay(40);
mcEnemy2.gotoAndPlay(12);
mcEnemy3.gotoAndPlay(30);
Symbol 112 MovieClip Frame 1
stop();
Symbol 112 MovieClip Frame 43
stop();
if (this._name == "mcMask0") {
this._parent.play();
}
Symbol 120 MovieClip Frame 1
var skip = Math.floor(Math.random() * 30);
this.gotoAndPlay(_currentframe + skip);
Symbol 127 MovieClip Frame 5
var skip = Math.floor(Math.random() * 20);
this.gotoAndPlay(_currentframe + skip);
Symbol 137 MovieClip Frame 1
var skip = Math.floor(Math.random() * 70);
gotoAndPlay(_currentframe + skip);
Symbol 139 MovieClip Frame 1
var skip = Math.floor(Math.random() * 70);
gotoAndPlay(_currentframe + skip);
Symbol 141 MovieClip Frame 39
mcMask2.gotoAndPlay(17);
mcMask1.gotoAndPlay(14);
mcMask0.gotoAndPlay(11);
stop();
Symbol 141 MovieClip Frame 43
stop();
Symbol 144 MovieClip Frame 3
var skip = Math.floor(Math.random() * 25);
this.gotoAndPlay(_currentframe + skip);
Symbol 148 MovieClip Frame 1
stop();
Symbol 148 MovieClip Frame 14
play();
Symbol 148 MovieClip Frame 22
gotoAndPlay ("overLoop");
Symbol 148 MovieClip Frame 35
play();
Symbol 148 MovieClip Frame 37
stop();
Symbol 150 MovieClip Frame 74
gSplash.animTrig("enablePlay");
Symbol 150 MovieClip Frame 83
stop();
Symbol 158 MovieClip Frame 98
gotoAndPlay ("loop");
Symbol 170 MovieClip Frame 2
stop();
Symbol 170 MovieClip Frame 5
play();
Symbol 170 MovieClip Frame 54
stop();
Symbol 182 Button
on (release) {
gInstruct.press("nav", 1);
}
Symbol 183 Button
on (release) {
gInstruct.press("nav", 2);
}
Symbol 184 Button
on (release) {
gInstruct.press("nav", 3);
}
Symbol 193 MovieClip Frame 1
stop();
Symbol 241 MovieClip Frame 2
stop();
Symbol 241 MovieClip Frame 4
play();
Symbol 241 MovieClip Frame 11
stop();
Symbol 241 MovieClip Frame 16
stop();
Symbol 241 MovieClip Frame 19
play();
Symbol 241 MovieClip Frame 25
stop();
Symbol 253 MovieClip Frame 1
stop();
Symbol 264 MovieClip Frame 1
this._xscale = (100 / this._parent._xscale) * 100;
Symbol 264 MovieClip Frame 3
stop();
Symbol 266 MovieClip Frame 4
stop();
Symbol 267 MovieClip Frame 1
this._xscale = (100 / this._parent._xscale) * 100;
Symbol 267 MovieClip Frame 3
stop();
Symbol 268 Button
on (release) {
gSplash.press("start");
}
Symbol 269 MovieClip Frame 1
stop();
Symbol 270 MovieClip [mcCell] Frame 1
stop();
Symbol 292 MovieClip Frame 1
stop();
Symbol 292 MovieClip Frame 7
stop();
Symbol 298 MovieClip Frame 1
stop();
Symbol 298 MovieClip Frame 7
stop();
Symbol 304 MovieClip Frame 1
stop();
Symbol 306 MovieClip Frame 1
stop();
Symbol 312 MovieClip Frame 3
play();
this.obj.express("norm");
Symbol 312 MovieClip Frame 6
stop();
Symbol 312 MovieClip Frame 10
play();
this.obj.express("norm");
Symbol 312 MovieClip Frame 23
stop();
Symbol 312 MovieClip Frame 24
play();
this.obj.express("norm");
Symbol 312 MovieClip Frame 28
this.obj.animTrig("landDone");
Symbol 312 MovieClip Frame 35
play();
this.obj.express("norm");
Symbol 312 MovieClip Frame 46
play();
Symbol 312 MovieClip Frame 62
gotoAndPlay ("boostLoop");
Symbol 312 MovieClip Frame 77
play();
this.obj.express("run");
Symbol 312 MovieClip Frame 83
play();
Symbol 312 MovieClip Frame 91
gotoAndPlay ("shakeLoop");
Symbol 312 MovieClip Frame 92
play();
Symbol 312 MovieClip Frame 98
this.obj.animTrig("shakeUpDone");
Symbol 312 MovieClip Frame 103
play();
this.obj.express("run");
Symbol 312 MovieClip Frame 115
gotoAndPlay ("run");
Symbol 312 MovieClip Frame 126
play();
this.obj.express("norm");
Symbol 312 MovieClip Frame 153
this.obj.animTrig("powerDone");
Symbol 312 MovieClip Frame 159
play();
this.obj.express("norm");
Symbol 312 MovieClip Frame 193
this.obj.animTrig("powerDone");
Symbol 312 MovieClip Frame 197
play();
this.obj.express("norm");
Symbol 312 MovieClip Frame 233
this.obj.animTrig("powerDone");
Symbol 312 MovieClip Frame 241
play();
this.obj.express("norm");
Symbol 312 MovieClip Frame 259
this.obj.animTrig("danceDone");
Symbol 327 MovieClip Frame 1
stop();
Symbol 327 MovieClip Frame 4
play();
Symbol 327 MovieClip Frame 16
play();
Symbol 327 MovieClip Frame 20
gotoAndPlay ("norm");
Symbol 335 MovieClip Frame 1
stop();
Symbol 335 MovieClip Frame 7
stop();
Symbol 341 MovieClip Frame 1
stop();
Symbol 341 MovieClip Frame 7
stop();
Symbol 346 MovieClip Frame 5
stop();
Symbol 349 MovieClip Frame 1
stop();
Symbol 349 MovieClip Frame 8
stop();
Symbol 349 MovieClip Frame 14
stop();
Symbol 351 MovieClip Frame 1
stop();
Symbol 352 MovieClip Frame 25
stop();
Symbol 354 MovieClip Frame 5
stop();
Symbol 355 MovieClip Frame 5
stop();
Symbol 358 MovieClip Frame 1
stop();
Symbol 358 MovieClip Frame 5
play();
Symbol 358 MovieClip Frame 9
stop();
Symbol 358 MovieClip Frame 13
play();
Symbol 358 MovieClip Frame 18
stop();
Symbol 360 MovieClip Frame 1
stop();
Symbol 360 MovieClip Frame 4
play();
Symbol 360 MovieClip Frame 9
stop();
Symbol 361 MovieClip Frame 3
play();
this.obj.express("norm");
Symbol 361 MovieClip Frame 6
stop();
Symbol 361 MovieClip Frame 10
play();
this.obj.express("norm");
Symbol 361 MovieClip Frame 12
mcTorso.gotoAndPlay("bounce");
Symbol 361 MovieClip Frame 23
stop();
Symbol 361 MovieClip Frame 24
play();
this.obj.express("norm");
Symbol 361 MovieClip Frame 28
this.obj.animTrig("landDone");
Symbol 361 MovieClip Frame 35
play();
this.obj.express("norm");
Symbol 361 MovieClip Frame 46
play();
Symbol 361 MovieClip Frame 52
mcTorso.gotoAndPlay("bounce");
Symbol 361 MovieClip Frame 62
gotoAndPlay ("boostLoop");
Symbol 361 MovieClip Frame 77
play();
this.obj.express("run");
Symbol 361 MovieClip Frame 83
play();
Symbol 361 MovieClip Frame 91
gotoAndPlay ("shakeLoop");
Symbol 361 MovieClip Frame 92
play();
Symbol 361 MovieClip Frame 98
this.obj.animTrig("shakeUpDone");
Symbol 361 MovieClip Frame 103
play();
this.obj.express("run");
Symbol 361 MovieClip Frame 104
mcTorso.gotoAndPlay("bounce");
Symbol 361 MovieClip Frame 115
gotoAndPlay ("run");
Symbol 361 MovieClip Frame 123
play();
this.obj.express("norm");
Symbol 361 MovieClip Frame 155
this.obj.animTrig("powerDone");
Symbol 361 MovieClip Frame 163
play();
this.obj.express("norm");
Symbol 361 MovieClip Frame 170
mcBrad.gotoAndPlay("kiss");
Symbol 361 MovieClip Frame 185
mcBrad.gotoAndPlay("last");
Symbol 361 MovieClip Frame 193
this.obj.animTrig("powerDone");
Symbol 361 MovieClip Frame 199
play();
this.obj.express("norm");
Symbol 361 MovieClip Frame 203
this.obj.express("glow");
Symbol 361 MovieClip Frame 204
mcSide.gotoAndPlay("flash");
Symbol 361 MovieClip Frame 209
mcSide.gotoAndPlay("flash");
Symbol 361 MovieClip Frame 214
mcSide.gotoAndPlay("flash");
Symbol 361 MovieClip Frame 220
this.obj.express("norm");
Symbol 361 MovieClip Frame 223
this.obj.animTrig("powerDone");
Symbol 361 MovieClip Frame 228
play();
this.obj.express("norm");
ct0 = 0;
ct1 = 0;
Symbol 361 MovieClip Frame 234
play();
Symbol 361 MovieClip Frame 240
ct0++;
if (ct0 < 4) {
gotoAndPlay ("punchLoop0");
}
Symbol 361 MovieClip Frame 250
play();
Symbol 361 MovieClip Frame 251
mcTorso.gotoAndPlay("bounce");
Symbol 361 MovieClip Frame 256
ct1++;
if (ct1 < 4) {
gotoAndPlay ("punchLoop1");
}
Symbol 361 MovieClip Frame 257
this.obj.animTrig("danceDone");
Symbol 362 MovieClip Frame 1
stop();
Symbol 364 MovieClip Frame 1
stop();
Symbol 364 MovieClip Frame 5
play();
Symbol 364 MovieClip Frame 6
this.obj.animOverlay("open");
Symbol 364 MovieClip Frame 21
this.obj.animSeqTrig("anim", "run");
Symbol 364 MovieClip Frame 32
this.obj.animSeqTrig("anim", "still");
Symbol 364 MovieClip Frame 37
this.obj.animOverlay("close");
Symbol 364 MovieClip Frame 42
this.obj.animOverlay("off");
Symbol 364 MovieClip Frame 44
this.obj.animSeqTrig("anim", "run");
Symbol 364 MovieClip Frame 64
this.obj.animSeqTrig("anim", "still");
Symbol 364 MovieClip Frame 68
this.obj.animSeqTrig("introDone");
stop();
Symbol 367 MovieClip Frame 5
stop();
Symbol 367 MovieClip Frame 9
play();
gLimo.switchDoor(0);
Symbol 367 MovieClip Frame 15
stop();
Symbol 367 MovieClip Frame 16
play();
Symbol 367 MovieClip Frame 20
gLimo.switchDoor(1);
stop();
Symbol 383 MovieClip Frame 1
stop();
Symbol 384 MovieClip Frame 1
stop();
Symbol 384 MovieClip Frame 5
play();
Symbol 384 MovieClip Frame 14
stop();
Symbol 389 MovieClip Frame 3
stop();
Symbol 389 MovieClip Frame 8
play();
Symbol 389 MovieClip Frame 17
gotoAndStop ("norm");
Symbol 394 MovieClip Frame 1
stop();
Symbol 397 MovieClip Frame 3
play();
Symbol 397 MovieClip Frame 6
stop();
Symbol 397 MovieClip Frame 10
play();
Symbol 397 MovieClip Frame 20
stop();
Symbol 397 MovieClip Frame 34
this.obj.animTrig("landDone");
Symbol 397 MovieClip Frame 43
play();
Symbol 397 MovieClip Frame 54
this.gotoAndPlay(this._currentframe + Math.floor(Math.random() * 10));
Symbol 397 MovieClip Frame 67
this.obj.animTrig("flash");
Symbol 397 MovieClip Frame 75
gotoAndPlay ("leech_loop");
Symbol 397 MovieClip Frame 82
play();
Symbol 397 MovieClip Frame 84
this.mcHead.mcBelly.gotoAndStop("bounce");
Symbol 397 MovieClip Frame 90
gotoAndPlay ("run");
Symbol 397 MovieClip Frame 95
play();
Symbol 397 MovieClip Frame 110
stop();
Symbol 397 MovieClip Frame 115
play();
Symbol 397 MovieClip Frame 183
stop();
Symbol 397 MovieClip Frame 185
play();
Symbol 397 MovieClip Frame 199
stop();
Symbol 437 MovieClip Frame 1
stop();
Symbol 452 MovieClip Frame 1
stop();
Symbol 462 MovieClip Frame 1
stop();
Symbol 462 MovieClip Frame 5
play();
Symbol 462 MovieClip Frame 6
stop();
Symbol 462 MovieClip Frame 12
play();
Symbol 462 MovieClip Frame 35
stop();
this.obj.animTrig("hitDone");
Symbol 462 MovieClip Frame 42
play();
this.gotoAndPlay(this._currentframe + this.fOffset);
Symbol 462 MovieClip Frame 60
stop();
Symbol 462 MovieClip Frame 68
play();
Symbol 462 MovieClip Frame 91
stop();
this.obj.animTrig("hitDone");
Symbol 466 MovieClip Frame 1
stop();
Symbol 466 MovieClip Frame 4
play();
Symbol 466 MovieClip Frame 25
stop();
this.obj.animTrig("hitDone");
Symbol 474 MovieClip Frame 1
stop();
Symbol 474 MovieClip Frame 5
play();
Symbol 474 MovieClip Frame 11
gotoAndPlay ("run");
Symbol 480 MovieClip Frame 1
stop();
Symbol 480 MovieClip Frame 9
play();
Symbol 480 MovieClip Frame 53
mcDriver.gotoAndPlay("run");
Symbol 480 MovieClip Frame 89
stop();
Symbol 483 MovieClip Frame 1
play();
Symbol 483 MovieClip Frame 17
gotoAndPlay ("spin");
Symbol 483 MovieClip Frame 23
play();
Symbol 483 MovieClip Frame 32
stop();
Symbol 484 MovieClip Frame 2
play();
Symbol 484 MovieClip Frame 6
gotoAndPlay ("bounce");
Symbol 484 MovieClip Frame 13
mcWheel.gotoAndPlay("flat");
mcShell.gotoAndPlay("flat");
play();
Symbol 484 MovieClip Frame 19
stop();
Symbol 485 MovieClip Frame 1
stop();
Symbol 485 MovieClip Frame 2
play();
Symbol 485 MovieClip Frame 45
this.obj.animTrig("enemy");
Symbol 485 MovieClip Frame 56
mcBody.gotoAndPlay("flat");
var vol = 80;
var pan = -75;
gJukebox.startSound("crash0", vol, pan);
Symbol 485 MovieClip Frame 93
this.obj.animTrig("avatar");
stop();
Symbol 487 MovieClip Frame 1
stop();
Symbol 487 MovieClip Frame 2
stop();
Symbol 487 MovieClip Frame 11
play();
Symbol 487 MovieClip Frame 36
stop();
Symbol 559 MovieClip Frame 50
stop();
Symbol 560 MovieClip Frame 1
stop();
mcShape.gotoAndStop("open");
Symbol 560 MovieClip Frame 3
play();
Symbol 560 MovieClip Frame 10
mcShape.gotoAndPlay("close");
Symbol 560 MovieClip Frame 35
this.obj.animTrig("postCollect");
Symbol 560 MovieClip Frame 71
stop();
this.obj.animTrig("hitDone");
Symbol 563 MovieClip Frame 1
stop();
Symbol 566 MovieClip Frame 1
stop();
Symbol 573 MovieClip Frame 1
stop();
Symbol 593 MovieClip Frame 1
stop();
Symbol 593 MovieClip Frame 6
play();
Symbol 593 MovieClip Frame 11
gotoAndPlay ("flicker");
Symbol 615 Button
on (release) {
gJukebox.toggle();
}
Symbol 617 MovieClip Frame 1
stop();
Symbol 628 MovieClip Frame 1
stop();
Symbol 639 Button
on (release) {
gInterface.press("retry");
}
Symbol 650 Button
on (release) {
gInterface.press("resume");
}
Symbol 651 Button
on (release) {
gInterface.press("replay");
}
Symbol 661 Button
on (release) {
gInterface.press("advance");
}
Symbol 674 Button
on (release) {
gInterface.press("finale");
}
Symbol 679 MovieClip Frame 1
stop();
Symbol 689 MovieClip Frame 11
stop();
Symbol 691 MovieClip Frame 9
stop();
Symbol 694 MovieClip Frame 11
stop();
Symbol 697 MovieClip Frame 11
stop();
Symbol 699 MovieClip Frame 9
stop();
Symbol 701 MovieClip Frame 9
stop();
Symbol 702 MovieClip Frame 4
stop();
Symbol 702 MovieClip Frame 10
play();
Symbol 702 MovieClip Frame 304
gotoAndPlay ("on");
Symbol 712 MovieClip Frame 1
stop();
Symbol 716 MovieClip Frame 1
stop();
Symbol 724 MovieClip Frame 1
stop();
Symbol 728 MovieClip Frame 1
stop();
Symbol 734 MovieClip Frame 1
stop();
Symbol 739 MovieClip Frame 1
stop();
Symbol 744 MovieClip Frame 1
stop();
Symbol 749 MovieClip Frame 1
stop();
Symbol 754 MovieClip Frame 1
stop();
Symbol 759 MovieClip Frame 1
stop();
Symbol 760 MovieClip Frame 1
stop();
Symbol 768 Button
on (release) {
gFinale.press("replay");
}