Frame 1
Math.distance = function (obj1, obj2) {
var _local3 = Math.abs(obj1.pX - obj2.pX);
var _local2 = Math.abs(obj1.pY - obj2.pY);
var _local1 = Math.sqrt(Math.pow(_local3, 2) + Math.pow(_local2, 2));
return(_local1);
};
Frame 3
var tPC = Math.round((this.getBytesLoaded() / this.getBytesTotal()) * 100);
this.loadingbar_mc.gotoAndStop(tPC);
if (tPC == 100) {
play();
} else {
gotoAndPlay ("loading");
}
Frame 5
function pingHighScore(tPing) {
var _local1 = _global;
var _local2 = this;
if (tVar_lv == undefined) {
tVar_lv = new LoadVars();
}
if (tPing == "submit") {
tVar_lv.o = optin_mc.pState;
tVar_lv.n = usrname_txt.text;
tVar_lv.e = usremail_txt.text;
tVar_lv.s = _local1.gSC;
allOK = 1;
if (tVar_lv.e.indexOf("@") <= 0) {
allOK = 0;
}
if (tVar_lv.e.indexOf(".") <= 0) {
allOK = 0;
}
if (tVar_lv.e.indexOf("@") > tVar_lv.e.lastIndexOf(".")) {
allOK = 0;
}
if ((tVar_lv.n == undefined) || (tVar_lv.n == "Enter your name")) {
usrname_txt.text = "Enter your name";
} else if (allOK == 0) {
usremail_txt.text = "Enter your email address";
} else {
p3powergen_so.data.usrname = usrname_txt.text;
p3powergen_so.data.usremail = usremail_txt.text;
p3powergen_so.flush();
tVar_lv.onData = function (src) {
var _local1 = src;
trace("src = " + _local1);
if (_local1 == undefined) {
} else {
this.decode(_local1);
play();
}
};
var _local3 = (usrname_txt.text + usremail_txt.text) + _local1.gSC;
tVar_lv.m = calcMD5(_local3);
tVar_lv.sendAndLoad(_local1.gHSping, tVar_lv, "GET");
_local2.gotoAndPlay("pingwait");
}
} else {
tVar_lv.onData = function (src) {
var _local1 = src;
trace("src = " + _local1);
if (_local1 == undefined) {
} else {
this.decode(_local1);
play();
}
};
tVar_lv.sendAndLoad(_local1.gHSping, tVar_lv, "GET");
_local2.gotoAndPlay("pingwait");
}
}
function pingChallenge() {
var _local1 = this;
if (challenge_lv == undefined) {
challenge_lv = new LoadVars();
}
challenge_lv.n = usrname_txt.text;
challenge_lv.e = usremail_txt.text;
challenge_lv.f = challengeemail_txt.text;
challenge_lv.s = _global.gSC;
allOK = 0;
if (challenge_lv.e.indexOf("@") <= 0) {
allOK = 1;
}
if (challenge_lv.e.indexOf(".") <= 0) {
allOK = 1;
}
if (challenge_lv.e.indexOf("@") > challenge_lv.e.lastIndexOf(".")) {
allOK = 1;
}
if (challenge_lv.f.indexOf("@") <= 0) {
allOK = 2;
}
if (challenge_lv.f.indexOf(".") <= 0) {
allOK = 2;
}
if (challenge_lv.f.indexOf("@") > challenge_lv.f.lastIndexOf(".")) {
allOK = 2;
}
if ((challenge_lv.n == undefined) || (tVar_lv.n == "Enter your name")) {
usrname_txt.text = "Enter your name";
} else if (allOK == 1) {
usremail_txt.text = "Enter your email address";
} else if (allOK == 2) {
challengeemail_txt.text = "Enter your friend's email address";
} else {
p3powergen_so.data.usrname = usrname_txt.text;
p3powergen_so.data.usremail = usremail_txt.text;
p3powergen_so.flush();
challenge_lv.onData = function (src) {
var _local1 = src;
trace("src = " + _local1);
if (_local1 == undefined) {
} else {
this.decode(_local1);
this.gotoAndPlay("scoresready");
}
};
challenge_lv.sendAndLoad(_global.gChallengeping, challenge_lv, "GET");
_local1.gotoAndPlay("scoresready");
}
}
function bitOR(a, b) {
var _local1 = (a & 1) | (b & 1);
var _local2 = (a >>> 1) | (b >>> 1);
return((_local2 << 1) | _local1);
}
function bitXOR(a, b) {
var _local1 = (a & 1) ^ (b & 1);
var _local2 = (a >>> 1) ^ (b >>> 1);
return((_local2 << 1) | _local1);
}
function bitAND(a, b) {
var _local1 = (a & 1) & (b & 1);
var _local2 = (a >>> 1) & (b >>> 1);
return((_local2 << 1) | _local1);
}
function addme(x, y) {
var _local1 = (x & 65535) + (y & 65535);
var _local2 = ((x >> 16) + (y >> 16)) + (_local1 >> 16);
return((_local2 << 16) | (_local1 & 65535));
}
function rhex(num) {
var _local1 = num;
str = "";
j = 0;
while (j <= 3) {
str = str + (hex_chr.charAt((_local1 >> ((j * 8) + 4)) & 15) + hex_chr.charAt((_local1 >> (j * 8)) & 15));
j++;
}
return(str);
}
function str2blks_MD5(str) {
var _local1 = str;
nblk = ((_local1.length + 8) >> 6) + 1;
blks = new Array(nblk * 16);
i = 0;
while (i < (nblk * 16)) {
blks[i] = 0;
i++;
}
i = 0;
while (i < _local1.length) {
blks[i >> 2] = blks[i >> 2] | (_local1.charCodeAt(i) << ((((_local1.length * 8) + i) % 4) * 8));
i++;
}
blks[i >> 2] = blks[i >> 2] | (128 << ((((_local1.length * 8) + i) % 4) * 8));
var _local2 = _local1.length * 8;
blks[(nblk * 16) - 2] = _local2 & 255;
blks[(nblk * 16) - 2] = blks[(nblk * 16) - 2] | (((_local2 >>> 8) & 255) << 8);
blks[(nblk * 16) - 2] = blks[(nblk * 16) - 2] | (((_local2 >>> 16) & 255) << 16);
blks[(nblk * 16) - 2] = blks[(nblk * 16) - 2] | (((_local2 >>> 24) & 255) << 24);
return(blks);
}
function rol(num, cnt) {
return((num << cnt) | (num >>> (32 - cnt)));
}
function cmn(q, a, b, x, s, t) {
return(addme(rol(addme(addme(a, q), addme(x, t)), s), b));
}
function ff(a, b, c, d, x, s, t) {
var _local1 = b;
return(cmn(bitOR(bitAND(_local1, c), bitAND(~_local1, d)), a, _local1, x, s, t));
}
function gg(a, b, c, d, x, s, t) {
return(cmn(bitOR(bitAND(b, d), bitAND(c, ~d)), a, b, x, s, t));
}
function hh(a, b, c, d, x, s, t) {
return(cmn(bitXOR(bitXOR(b, c), d), a, b, x, s, t));
}
function ii(a, b, c, d, x, s, t) {
return(cmn(bitXOR(c, bitOR(b, ~d)), a, b, x, s, t));
}
function calcMD5(str) {
x = str2blks_MD5(str);
a = 1732584193 /* 0x67452301 */;
b = -271733879;
c = -1732584194;
d = 271733878 /* 0x10325476 */;
var _local1;
i = 0;
while (i < x.length) {
olda = a;
oldb = b;
oldc = c;
oldd = d;
_local1 = 0;
a = ff(a, b, c, d, x[i + 0], 7, -680876936);
d = ff(d, a, b, c, x[i + 1], 12, -389564586);
c = ff(c, d, a, b, x[i + 2], 17, 606105819);
b = ff(b, c, d, a, x[i + 3], 22, -1044525330);
a = ff(a, b, c, d, x[i + 4], 7, -176418897);
d = ff(d, a, b, c, x[i + 5], 12, 1200080426);
c = ff(c, d, a, b, x[i + 6], 17, -1473231341);
b = ff(b, c, d, a, x[i + 7], 22, -45705983);
a = ff(a, b, c, d, x[i + 8], 7, 1770035416);
d = ff(d, a, b, c, x[i + 9], 12, -1958414417);
c = ff(c, d, a, b, x[i + 10], 17, -42063);
b = ff(b, c, d, a, x[i + 11], 22, -1990404162);
a = ff(a, b, c, d, x[i + 12], 7, 1804603682);
d = ff(d, a, b, c, x[i + 13], 12, -40341101);
c = ff(c, d, a, b, x[i + 14], 17, -1502002290);
b = ff(b, c, d, a, x[i + 15], 22, 1236535329);
a = gg(a, b, c, d, x[i + 1], 5, -165796510);
d = gg(d, a, b, c, x[i + 6], 9, -1069501632);
c = gg(c, d, a, b, x[i + 11], 14, 643717713);
b = gg(b, c, d, a, x[i + 0], 20, -373897302);
a = gg(a, b, c, d, x[i + 5], 5, -701558691);
d = gg(d, a, b, c, x[i + 10], 9, 38016083);
c = gg(c, d, a, b, x[i + 15], 14, -660478335);
b = gg(b, c, d, a, x[i + 4], 20, -405537848);
a = gg(a, b, c, d, x[i + 9], 5, 568446438);
d = gg(d, a, b, c, x[i + 14], 9, -1019803690);
c = gg(c, d, a, b, x[i + 3], 14, -187363961);
b = gg(b, c, d, a, x[i + 8], 20, 1163531501);
a = gg(a, b, c, d, x[i + 13], 5, -1444681467);
d = gg(d, a, b, c, x[i + 2], 9, -51403784);
c = gg(c, d, a, b, x[i + 7], 14, 1735328473);
b = gg(b, c, d, a, x[i + 12], 20, -1926607734);
a = hh(a, b, c, d, x[i + 5], 4, -378558);
d = hh(d, a, b, c, x[i + 8], 11, -2022574463);
c = hh(c, d, a, b, x[i + 11], 16, 1839030562);
b = hh(b, c, d, a, x[i + 14], 23, -35309556);
a = hh(a, b, c, d, x[i + 1], 4, -1530992060);
d = hh(d, a, b, c, x[i + 4], 11, 1272893353);
c = hh(c, d, a, b, x[i + 7], 16, -155497632);
b = hh(b, c, d, a, x[i + 10], 23, -1094730640);
a = hh(a, b, c, d, x[i + 13], 4, 681279174);
d = hh(d, a, b, c, x[i + 0], 11, -358537222);
c = hh(c, d, a, b, x[i + 3], 16, -722521979);
b = hh(b, c, d, a, x[i + 6], 23, 76029189);
a = hh(a, b, c, d, x[i + 9], 4, -640364487);
d = hh(d, a, b, c, x[i + 12], 11, -421815835);
c = hh(c, d, a, b, x[i + 15], 16, 530742520);
b = hh(b, c, d, a, x[i + 2], 23, -995338651);
a = ii(a, b, c, d, x[i + 0], 6, -198630844);
d = ii(d, a, b, c, x[i + 7], 10, 1126891415);
c = ii(c, d, a, b, x[i + 14], 15, -1416354905);
b = ii(b, c, d, a, x[i + 5], 21, -57434055);
a = ii(a, b, c, d, x[i + 12], 6, 1700485571);
d = ii(d, a, b, c, x[i + 3], 10, -1894986606);
c = ii(c, d, a, b, x[i + 10], 15, -1051523);
b = ii(b, c, d, a, x[i + 1], 21, -2054922799);
a = ii(a, b, c, d, x[i + 8], 6, 1873313359);
d = ii(d, a, b, c, x[i + 15], 10, -30611744);
c = ii(c, d, a, b, x[i + 6], 15, -1560198380);
b = ii(b, c, d, a, x[i + 13], 21, 1309151649);
a = ii(a, b, c, d, x[i + 4], 6, -145523070);
d = ii(d, a, b, c, x[i + 11], 10, -1120210379);
c = ii(c, d, a, b, x[i + 2], 15, 718787259);
b = ii(b, c, d, a, x[i + 9], 21, -343485551);
a = addme(a, olda);
b = addme(b, oldb);
c = addme(c, oldc);
d = addme(d, oldd);
i = i + 16;
}
return(((rhex(a) + rhex(b)) + rhex(c)) + rhex(d));
}
_global.gChallengeping = "challenge.asp";
_global.gVol = 0;
trace(this._url);
var index = this._url.indexOf("file:");
_global.gHSping = "highscore.asp";
trace((index + " - ") + _global.gHSping);
var hex_chr = "0123456789abcdef";
Frame 7
_root.attachMovie("mc.soundclip", "snd_mc", 99999);
Frame 41
bplay_mc.onRelease = function () {
snd_mc.playsound("pButton");
play();
};
binstructions_mc.onRelease = function () {
snd_mc.playsound("pButton");
gotoAndPlay ("instructions");
};
bhighscores_mc.onRelease = function () {
snd_mc.playsound("pButton");
gotoAndPlay ("highscores");
};
stop();
Frame 57
bpete_mc.onRelease = function () {
snd_mc.playsound("pButton");
snd_mc.playsound("pJump");
_global.gPP = "pete";
gotoAndPlay ("petestart");
};
bpaula_mc.onRelease = function () {
snd_mc.playsound("pButton");
snd_mc.playsound("pJump");
_global.gPP = "paula";
gotoAndPlay ("paulastart");
};
stop();
Frame 76
gotoAndPlay ("divein");
Frame 119
function jumpKey() {
var _local1 = Key.getCode();
if ((_local1 == 32) || (_local1 == 38)) {
bod_mc.jump();
}
}
var pGameOverTimer;
this.onEnterFrame = function () {
tx = 0;
if (Key.isDown(37)) {
tx = tx - 2;
}
if (Key.isDown(39)) {
tx = tx + 2;
}
if (Key.isDown(40)) {
tx = 0;
}
this.bod_mc.nudge(tx);
this.camera_mc.render();
};
if (jumpListener != undefined) {
Key.removeListener(jumpListener);
jumpListener = undefined;
}
var jumpListener = new Object();
jumpListener.onKeyDown = jumpKey;
Key.addListener(jumpListener);
this.gameOver = function (tWinLose) {
var _local1 = this;
Key.removeListener(jumpListener);
delete onEnterFrame;
if (tWinLose == "win") {
_local1.snd_mc.win();
_local1.bod_mc.gameComplete();
} else {
_local1.snd_mc.lose();
_local1.bod_mc.gameOver();
}
pGameOverTimer = setInterval(moveOn, 4000);
};
this.moveOn = function () {
clearInterval(pGameOverTimer);
play();
};
snd_mc.playgamemusic();
stop();
Frame 132
snd_mc.playmenumusic();
Frame 139
p3powergen_so = SharedObject.getLocal("ciscocricket");
if (p3powergen_so.data.usrname != undefined) {
usrname_txt.text = p3powergen_so.data.usrname;
}
if (p3powergen_so.data.usremail != undefined) {
usremail_txt.text = p3powergen_so.data.usremail;
}
bsubmit_mc.onRelease = function () {
snd_mc.playsound("pButton");
pingHighScore("submit");
};
bcancel_mc.onRelease = function () {
snd_mc.playsound("pButton");
pingHighScore("grab");
};
stop();
Instance of Symbol 316 MovieClip "bpowergen_mc" in Frame 139
on (release) {
getURL ("http://www.powergen.co.uk", "_blank");
}
Frame 175
bok_mc.onrelease = function () {
snd_mc.playsound("pButton");
play();
};
stop();
Frame 187
gotoAndPlay ("menu");
Frame 225
pingHighScore("grab");
stop();
Frame 226
stop();
Frame 228
usrnames_txt.text = "";
scoreslist_txt.text = "";
var tnames = tVar_lv.HSnames.split(",");
var tscores = tVar_lv.HSscores.split(",");
var tengland = tVar_lv.EPscores.split(",");
i = 0;
while (i < 10) {
usrnames_txt.text = usrnames_txt.text + (tnames[i] + "\r");
scoreslist_txt.text = scoreslist_txt.text + (tscores[i] + "\r");
i++;
}
if (tengland[1] != "-") {
epnum_txt.text = tengland[0];
epname_txt.text = tengland[1];
epscore_txt.text = tengland[2];
}
Instance of Symbol 316 MovieClip "bpowergen_mc" in Frame 228
on (release) {
getURL ("http://www.powergen.co.uk", "_blank");
}
Frame 233
bplayagain_mc.onrelease = function () {
snd_mc.playsound("pButton");
gotoAndPlay ("backtomenu");
};
bchallengeafriend_mc.onrelease = function () {
snd_mc.playsound("pButton");
play();
};
stop();
Frame 245
p3powergen_so = SharedObject.getLocal("ciscocricket");
if (p3powergen_so.data.usrname != undefined) {
usrname_txt.text = p3powergen_so.data.usrname;
}
if (p3powergen_so.data.usremail != undefined) {
usremail_txt.text = p3powergen_so.data.usremail;
}
bsubmit_mc.onRelease = function () {
snd_mc.playsound("pButton");
pingChallenge();
};
bcancel_mc.onRelease = function () {
snd_mc.playsound("pButton");
gotoAndPlay ("scoresready");
};
stop();
Frame 279
gotoAndPlay ("menu");
Symbol 8 MovieClip [mc.soundclip] Frame 1
function setVol(x) {
var _local1 = x;
pButton.setVolume(_local1 * 100);
pFind.setVolume(_local1 * 100);
pFix.setVolume(_local1 * 100);
pGameover.setVolume(_local1 * 100);
pGunshot.setVolume(_local1 * 100);
pHit.setVolume(_local1 * 100);
pJump.setVolume(_local1 * 100);
pKettle.setVolume(_local1 * 100);
pMug.setVolume(_local1 * 100);
pSteam.setVolume(_local1 * 100);
pYouwin.setVolume(_local1 * 100);
pMainloop.setVolume(_local1 * 100);
pMenuloop.setVolume(_local1 * 80);
pSpanner.setVolume(_local1 * 100);
pTeabreak.setVolume(_local1 * 100);
if (_local1 == 1) {
if (this._parent._currentframe == 119) {
playgamemusic();
} else {
playmenumusic();
}
} else {
pMainloop.stop();
pMenuloop.stop();
}
}
function playsound(snd) {
eval (snd).start();
}
function onRelease() {
if (pVol == 100) {
pVol = 0;
this.setVol(0);
gotoAndStop (3);
} else {
pVol = 100;
this.setVol(1);
gotoAndStop (2);
}
}
var pVol = 100;
this._y = 24;
this._x = 716;
var pButton = new Sound();
pButton.attachSound("snd.button");
var pFind = new Sound();
pFind.attachSound("snd.find");
var pFix = new Sound();
pFix.attachSound("snd.fix");
var pGameover = new Sound();
pGameover.attachSound("snd.gameover");
var pGunshot = new Sound();
pGunshot.attachSound("snd.gunshot");
var pHit = new Sound();
pHit.attachSound("snd.hit");
var pJump = new Sound();
pJump.attachSound("snd.jump");
var pKettle = new Sound();
pKettle.attachSound("snd.kettle");
var pMug = new Sound();
pMug.attachSound("snd.mug");
var pSpanner = new Sound();
pSpanner.attachSound("snd.spanner");
var pSteam = new Sound();
pSteam.attachSound("snd.steam");
var pYouwin = new Sound();
pYouwin.attachSound("snd.youwin");
var pMainloop = new Sound(this);
pMainloop.attachSound("snd.mainloop");
var pMenuloop = new Sound(this);
pMenuloop.attachSound("snd.menuloop");
var pTeabreak = new Sound(this);
pTeabreak.attachSound("snd.teabreak");
this.playgamemusic = function () {
pMenuloop.stop();
pMainloop.start(0, 999);
};
this.playmenumusic = function () {
pMainloop.stop();
pMenuloop.start(0, 999);
};
this.win = function () {
pMainloop.stop();
pYouWin.start();
};
this.lose = function () {
pMainloop.stop();
pGameover.start();
};
this.teabreak = function (tt) {
if (tt == "start") {
pMainloop.stop();
pTeabreak.start(0, 10);
} else {
pTeabreak.stop();
pMainloop.start(0, 999);
}
};
playmenumusic();
stop();
Symbol 10 MovieClip Frame 1
this._alpha = 0;
this._parent.hitArea = this.hitArea;
stop();
Symbol 36 MovieClip [mc.paula] Frame 1
stop();
Symbol 36 MovieClip [mc.paula] Frame 59
stop();
Symbol 62 MovieClip [mc.pete] Frame 1
stop();
Symbol 62 MovieClip [mc.pete] Frame 59
stop();
Symbol 69 MovieClip Frame 1
stop();
Symbol 92 MovieClip Frame 1
stop();
Symbol 96 MovieClip Frame 1
stop();
Symbol 98 MovieClip Frame 1
stop();
Symbol 100 MovieClip Frame 1
stop();
Symbol 106 MovieClip Frame 1
var pY = 0;
this.setPos = function (ty) {
this._y = ty;
};
Symbol 112 MovieClip Frame 1
stop();
Symbol 116 MovieClip Frame 1
stop();
Symbol 124 MovieClip Frame 1
var pY = 0;
this.setPos = function (ty) {
this._y = ty;
};
Symbol 125 MovieClip Frame 1
var pState = "idle";
var pY = 0;
var pDir = 0;
var pTarget = -100;
this.render = function () {
var _local1 = this;
_local1._parent.bod_mc.setPos(pY);
var _local2 = 0;
while (_local2 < 12) {
_local1._parent[("platform" + _local2) + "_mc"].setPos(pY, pDir);
_local2++;
}
_local2 = 0;
while (_local2 < 5) {
_local1._parent[("detail" + _local2) + "_mc"].setPos(pY, pDir);
_local2++;
}
_local2 = 0;
while (_local2 < 5) {
_local1._parent[("target" + _local2) + "_mc"].setPos(pY, pDir);
_local2++;
}
_local2 = 0;
while (_local2 < 5) {
_local1._parent.obj_mc.setPos(pY);
_local2++;
}
_local2 = 0;
while (_local2 < 5) {
_local1._parent[("steam" + _local2) + "_mc"].setPos(pY, pDir);
_local2++;
}
_local2 = 0;
while (_local2 < 4) {
_local1._parent[("cowboy" + _local2) + "_mc"].setPos(pY, pDir);
_local2++;
}
_local2 = 0;
while (_local2 < 4) {
_local1._parent[("bullet" + _local2) + "_mc"].setPos(pY, pDir);
_local2++;
}
_local1._parent.kettle_mc.setPos(pY);
_local1._parent.mug_mc.setPos(pY);
_local1._parent.bg2_mc.setPos((-pY) / 2);
_local1._parent.bg_mc.setPos((-pY) / 8);
};
this.onEnterFrame = function () {
tBodY = this._parent.bod_mc.pY;
pDir = Math.floor(((tBodY - pY) - 240) / 3);
pY = pY + pDir;
};
this.setTarget = function (tt) {
pTarget = tt - 240;
};
stop();
Symbol 152 MovieClip Frame 1
var pNum = Number(this._name.slice(6, -3));
this.setPos = function (ty, tdir) {
var _local1 = this;
_local1._x = pX + 38;
_local1._y = pY - ty;
if ((_local1._y < -300) && (tdir > 0)) {
if (pNum < 3) {
pNum = pNum + 5;
_local1.resetMe();
}
} else if ((_local1._y > 500) && (tdir < 0)) {
if (pNum > 4) {
pNum = pNum - 5;
_local1.resetMe();
}
}
};
this.setUp = function (x, y, frame) {
var _local1 = this;
_local1.pX = x * 16;
_local1.pY = y * 16;
_local1.gotoAndStop(frame);
};
this.resetMe = function () {
var _local1 = this;
switch (pNum) {
case 0 :
_local1.setUp(24, 7, 5);
return;
case 1 :
_local1.setUp(0, 33, 12);
return;
case 2 :
_local1.setUp(0, 56, 7);
return;
case 3 :
_local1.setUp(29, 83, 11);
return;
case 4 :
_local1.setUp(0, 109, 13);
return;
case 5 :
_local1.setUp(34, 110, 10);
return;
case 6 :
_local1.setUp(0, 125, 8);
}
};
this.resetMe();
stop();
Symbol 173 MovieClip Frame 1
var pNum = Number(this._name.slice(8, -3));
this.ping = function () {
if (Math.abs(pY - this._parent.bod_mc.pY) < 300) {
pState = "active";
} else {
pState = "idle";
}
return(pState);
};
this.testRect = function (tx, ty) {
if ((tx >= pRect[0]) && (tx <= pRect[2])) {
if ((tY >= pRect[1]) && (ty <= pRect[3])) {
this._parent.camera_mc.setTarget(pY);
return(pY);
}
}
};
this.setPos = function (ty, tdir) {
var _local1 = this;
_local1._x = pX + 38;
_local1._y = pY - ty;
if ((_local1._y < -50) && (tdir > 0)) {
if (pNum < 20) {
pNum = pNum + 11;
_local1.resetMe();
}
} else if ((_local1._y > 430) && (tdir < 0)) {
if (pNum > 10) {
pNum = pNum - 11;
_local1.resetMe();
}
}
};
this.setUp = function (x, y, width, frame) {
var _local1 = this;
_local1.pX = x * 16;
_local1.pY = y * 16;
_local1.pWidth = width * 16;
_local1.pRect = Array(pX, pY, pX + pWidth, pY + 24);
_local1.gotoAndStop(frame);
};
this.resetMe = function () {
var _local1 = this;
switch (pNum) {
case 0 :
_local1.setUp(0, 7, 8, 31);
return;
case 1 :
_local1.setUp(24, 7, 18, 3);
return;
case 2 :
_local1.setUp(7, 15, 12, 12);
return;
case 3 :
_local1.setUp(0, 23, 28, 16);
return;
case 4 :
_local1.setUp(34, 23, 8, 41);
return;
case 5 :
_local1.setUp(28, 30, 4, 10);
return;
case 6 :
_local1.setUp(0, 33, 8, 50);
return;
case 7 :
_local1.setUp(18, 34, 4, 10);
return;
case 8 :
_local1.setUp(38, 35, 4, 10);
return;
case 9 :
_local1.setUp(11, 40, 8, 11);
return;
case 10 :
_local1.setUp(27, 41, 12, 12);
return;
case 11 :
_local1.setUp(7, 48, 8, 11);
return;
case 12 :
_local1.setUp(22, 53, 20, 44);
return;
case 13 :
_local1.setUp(0, 56, 16, 3);
return;
case 14 :
_local1.setUp(15, 64, 8, 11);
return;
case 15 :
_local1.setUp(29, 64, 8, 11);
return;
case 16 :
_local1.setUp(0, 68, 8, 11);
return;
case 17 :
_local1.setUp(33, 71, 4, 10);
return;
case 18 :
_local1.setUp(21, 75, 4, 10);
return;
case 19 :
_local1.setUp(0, 76, 8, 31);
return;
case 20 :
_local1.setUp(29, 83, 16, 50);
return;
case 21 :
_local1.setUp(0, 84, 8, 31);
return;
case 22 :
_local1.setUp(16, 86, 4, 10);
return;
case 23 :
_local1.setUp(18, 92, 24, 44);
return;
case 24 :
_local1.setUp(4, 100, 8, 21);
return;
case 25 :
_local1.setUp(17, 100, 8, 21);
return;
case 26 :
_local1.setUp(30, 100, 8, 21);
return;
case 27 :
_local1.setUp(0, 109, 28, 50);
return;
case 28 :
_local1.setUp(34, 110, 8, 50);
return;
case 29 :
_local1.setUp(20, 117, 8, 11);
return;
case 30 :
_local1.setUp(0, 125, 42, 50);
}
};
this.resetMe();
stop();
Symbol 198 MovieClip Frame 1
var pState;
var pX;
var pY;
var pNum;
var pNum = Number(this._name.slice(6, -3));
this.setPos = function (ty) {
this._x = pX + 38;
this._y = pY - ty;
};
this.activate = function () {
var _local1 = this;
trace("activated: " + pObj);
_local1.pState = "active";
_local1.gotoAndStop(_local1.pObj + "_active");
};
this.collect = function () {
var _local1 = this;
if (_local1.pState == "active") {
_local1._parent.snd_mc.playsound("pFix");
_local1.pState = "collected";
_local1._parent.top_mc.addTarget();
_local1._parent.obj_mc.activate();
trace("collected: " + pObj);
_local1.gotoAndStop(_local1.pObj + "_done");
}
};
this.setUp = function (x, y, tobj) {
var _local1 = this;
_local1.pX = x * 16;
_local1.pY = y * 16;
_local1.pObj = tobj;
_local1.gotoAndStop(tobj);
};
switch (pNum) {
case 0 :
this.setUp(8, 125, "screw");
break;
case 1 :
this.setUp(33, 7, "fuse");
break;
case 2 :
this.setUp(31, 53, "nozzle");
break;
case 3 :
this.setUp(12, 56, "nut");
break;
case 4 :
this.setUp(37, 83, "spring");
}
stop();
Symbol 209 MovieClip Frame 1
var pState;
var pX;
var pY;
var pNum;
var pObjList = new Array("screw", "fuse", "nozzle", "nut", "spring");
this.testRect = function (tx, ty) {
if ((tx >= pRect[0]) && (tx <= pRect[2])) {
if ((tY >= pRect[1]) && (ty <= pRect[3])) {
this._parent.camera_mc.setTarget(pY);
return(pY);
}
}
};
this.setPos = function (ty) {
this._x = pX + 38;
this._y = pY - ty;
};
this.activate = function () {
var _local1 = this;
var _local3 = pObjList.length;
if (_local3 == 0) {
_local1._parent.gameOver("win");
} else {
var _local2 = Math.floor(Math.random() * _local3);
_local1.pObj = pObjList[_local2];
_local1.pObjList.splice(_local2, 1);
switch (pObj) {
case "screw" :
_local1.setUp(4, 4);
break;
case "fuse" :
_local1.setUp(4, 64);
break;
case "nozzle" :
_local1.setUp(34, 61);
break;
case "nut" :
_local1.setUp(35, 96);
break;
case "spring" :
_local1.setUp(24, 115);
}
_local1._parent.top_mc.find_mc.gotoAndStop(pObj);
_local1._parent.top_mc.findtxt_mc.gotoAndStop("find");
_local1.pState = "active";
_local1.gotoAndStop(_local1.pObj);
}
};
this.collect = function () {
var _local1 = this;
_local1.pState = "collected";
_local1._parent.snd_mc.playsound("pFind");
_local1._parent.top_mc.addScore(10000);
_local1.pX = -1000;
switch (pObj) {
case "screw" :
_local1._parent.target0_mc.activate();
_local1._parent.bod_mc.setTarget(0);
break;
case "fuse" :
_local1._parent.target1_mc.activate();
_local1._parent.bod_mc.setTarget(1);
break;
case "nozzle" :
_local1._parent.target2_mc.activate();
_local1._parent.bod_mc.setTarget(2);
break;
case "nut" :
_local1._parent.target3_mc.activate();
_local1._parent.bod_mc.setTarget(3);
break;
case "spring" :
_local1._parent.target4_mc.activate();
_local1._parent.bod_mc.setTarget(4);
}
_local1._parent.top_mc.findtxt_mc.gotoAndStop("fix");
_local1.gotoAndStop(2);
};
this.setUp = function (x, y) {
this.pX = x * 16;
this.pY = y * 16;
};
this.activate();
stop();
Symbol 212 MovieClip Frame 1
var pState;
var pX;
var pY;
var pNum;
var pTimer;
this.setPos = function (ty) {
var _local1 = this;
_local1._x = pX + 38;
_local1._y = pY - ty;
if (pTimer > 0) {
pTimer--;
} else if (pTimer == 0) {
_local1.activate();
pTimer = -1;
}
};
this.activate = function () {
var _local1 = this;
trace("activating kettle now");
var _local2 = Math.floor(Math.random() * 5);
switch (_local2) {
case 0 :
_local1.setUp(16, 13);
break;
case 1 :
_local1.setUp(13, 38);
break;
case 2 :
_local1.setUp(11, 46);
break;
case 3 :
_local1.setUp(23, 73);
break;
case 4 :
_local1.setUp(5, 82);
}
_local1.pState = "active";
_local1.gotoAndPlay(5);
};
this.collect = function () {
var _local1 = this;
_local1.pState = "collected";
_local1._parent.top_mc.teaBreak();
_local1._parent.top_mc.addScore(1000);
_local1.pX = -1000;
_local1.gotoAndStop(2);
_local1.pTimer = 480;
};
this.hideMe = function () {
var _local1 = this;
_local1.pX = -1000;
_local1.gotoAndStop(2);
_local1.pTimer = 240;
};
this.setUp = function (x, y) {
this.pX = x * 16;
this.pY = y * 16;
};
this.activate();
Symbol 212 MovieClip Frame 271
this.hideMe();
stop();
Symbol 215 MovieClip Frame 1
var pState;
var pX;
var pY;
var pNum;
var pTimer;
this.setPos = function (ty) {
var _local1 = this;
_local1._x = pX + 38;
_local1._y = pY - ty;
if (pTimer > 0) {
pTimer--;
} else if (pTimer == 0) {
_local1.activate();
pTimer = -1;
}
};
this.activate = function () {
var _local1 = this;
var _local2 = Math.floor(Math.random() * 4);
switch (_local2) {
case 0 :
_local1.setUp(9, 13);
break;
case 1 :
_local1.setUp(20, 32);
break;
case 2 :
_local1.setUp(35, 69);
break;
case 3 :
_local1.setUp(18, 84);
}
_local1.pState = "active";
_local1.gotoAndPlay(5);
};
this.collect = function () {
var _local1 = this;
_local1.pState = "collected";
_local1._parent.snd_mc.playsound("pMug");
_local1._parent.top_mc.increaseEnergy(30);
_local1._parent.top_mc.addScore(2000);
_local1.pX = -1000;
_local1.gotoAndStop(2);
_local1.pTimer = 240;
};
this.hideMe = function () {
var _local1 = this;
_local1.pX = -1000;
_local1.gotoAndStop(2);
_local1.pTimer = 240;
};
this.setUp = function (x, y) {
this.pX = x * 16;
this.pY = y * 16;
};
this.activate();
Symbol 215 MovieClip Frame 12
var myTimer = 240;
this.onEnterFrame = function () {
myTimer--;
if (myTimer == 0) {
delete this.onEnterFrame;
play();
}
};
stop();
Symbol 215 MovieClip Frame 20
this.hideMe();
stop();
Symbol 218 MovieClip Frame 1
var pNum = Number(this._name.slice(6, -3));
var pState;
var pX;
var pY;
var pSpeed;
this.setPos = function (ty, tdir) {
this._x = pX + 38;
this._y = pY - ty;
};
this.onEnterFrame = function () {
var _local1 = this;
if (pState == "active") {
pX = pX + pSpeed;
if ((pX < 0) || (pX > 740)) {
_local1.setUp();
} else if (_local1.hitTest(_local1._parent.bod_mc.pete_mc.hitarea_mc)) {
_local1._parent.bod_mc.hitMe("bullet");
_local1.setUp();
}
}
};
this.setUp = function () {
var _local1 = this;
_local1.pState = "idle";
_local1.pX = -500;
_local1.pY = 10 * pNum;
};
this.fire = function (x, y, dir) {
pX = x;
pY = y;
pSpeed = dir;
if (pSpeed > 0) {
this._xscale = -100;
} else {
this._xscale = 100;
}
pState = "active";
};
this.setUp();
stop();
Symbol 219 MovieClip Frame 1
var pX;
var pY;
var pSpeedX;
var pSpeedY;
var pState;
var pAnim;
var pLR;
var pHitTimer;
var pAlpha;
var pTarget;
this.nudge = function (tx) {
var _local1 = this;
var _local3 = tx;
if (_local3 == 99) {
pState = "defend";
_local3 = 0;
}
if (pState == "dead") {
_local1._alpha = 100;
} else {
if (_local3 == 0) {
if (pSpeedX > 0) {
pSpeedX = pSpeedX - 2;
if (pSpeedX < 0) {
pSpeedX = 0;
}
} else if (pSpeedX < 0) {
pSpeedX = pSpeedX + 2;
if (pSpeedX > 0) {
pSpeedX = 0;
}
}
} else {
pSpeedX = pSpeedX + _local3;
if (_local3 > 0) {
pLR = "r";
} else if (_local3 < 0) {
pLR = "l";
}
if (pSpeedX < -8) {
pSpeedX = -8;
}
if (pSpeedX > 8) {
pSpeedX = 8;
}
}
pX = pX + pSpeedX;
pSpeedY = pSpeedY + 2;
if (pSpeedY > 24) {
pSpeedY = 24;
}
pY = pY + pSpeedY;
if (pSpeedY > 2) {
pState = "jumping";
}
if (pX < 16) {
pX = 16;
pSpeedX = 0;
}
if (pX > 664) {
pX = 664;
pSpeedX = 0;
}
if (pSpeedY > 0) {
var _local2 = 0;
while (_local2 < 12) {
ty = _local1._parent[("platform" + _local2) + "_mc"].testRect(pX, pY);
if (ty != undefined) {
pSpeedY = 0;
if (Key.isDown(40)) {
pState = "defend";
} else {
pState = "grounded";
}
pY = ty;
}
_local2++;
}
}
if (_local1.pete_mc.hitarea_mc.hitTest(_local1._parent.obj_mc)) {
_local1._parent.obj_mc.collect();
}
if (_local1.pete_mc.hitarea_mc.hitTest(_local1._parent.kettle_mc)) {
_local1._parent.kettle_mc.collect();
}
if (_local1.pete_mc.hitarea_mc.hitTest(_local1._parent.mug_mc)) {
_local1._parent.mug_mc.collect();
}
if (Math.distance(_local1, _local1._parent[("target" + pTarget) + "_mc"]) < 20) {
_local1._parent[("target" + pTarget) + "_mc"].collect();
}
if ((pHitTimer == 0) && (_local1._parent.top_mc.pTeaTime == 0)) {
var _local2 = 0;
while (_local2 < 5) {
if (_local1.pete_mc.hitarea_mc.hitTest(_local1._parent[("cowboy" + _local2) + "_mc"].hitarea_mc)) {
_local1.hitMe();
}
_local2++;
}
}
if (pHitTimer == 0) {
var _local2 = 0;
while (_local2 < 5) {
if (_local1.pete_mc.hitarea_mc.hitTest(_local1._parent[("steam" + _local2) + "_mc"].hitarea_mc)) {
_local1.hitMe();
}
_local2++;
}
}
if (pHitTimer > 0) {
pHitTimer--;
if (pHitTimer == 0) {
_local1._alpha = 100;
} else {
if (pAlpha == 20) {
pAlpha = 70;
} else {
pAlpha = 20;
}
_local1._alpha = pAlpha;
}
}
}
if (pLR == "l") {
_local1._xscale = -100;
} else {
_local1._xscale = 100;
}
if (pState == "dead") {
} else if (pState == "jumping") {
pete_mc.gotoAndStop(2);
} else if (pState == "defend") {
pete_mc.gotoAndStop(10);
} else if (pSpeedX == 0) {
pete_mc.gotoAndStop(9);
} else {
pAnim[0]++;
if (pAnim[0] > 1) {
pAnim[0] = 0;
pAnim[1]++;
if (pAnim[1] > 5) {
pAnim[1] = 0;
}
pete_mc.gotoAndStop(pAnim[1] + 3);
}
}
};
this.hitMe = function (ttype) {
var _local1 = this;
if ((ttype == "bullet") && (pState == "defend")) {
_local1._parent.snd_mc.playsound("pSpanner");
} else {
_local1._parent.snd_mc.playsound("pHit");
_local1._parent.top_mc.decreaseEnergy(10);
_local1.pHitTimer = 24;
}
};
this.jump = function () {
if (pState == "grounded") {
pSpeedY = -24;
this._parent.snd_mc.playsound("pJump");
pState = "jumping";
}
};
this.gameOver = function () {
pState = "dead";
this._alpha = 100;
pSpeedY = -24;
pete_mc.gotoAndPlay(20);
};
this.gameComplete = function () {
pState = "dead";
this._alpha = 100;
pSpeedY = 0;
pSpeedX = 0;
pete_mc.gotoAndStop(15);
};
this.setPos = function (ty) {
this._x = pX + 38;
this._y = pY - ty;
};
this.setTarget = function (tt) {
this.pTarget = tt;
};
this.init = function () {
var _local1 = this;
_local1.pX = 512;
_local1.pY = -10;
_local1.pSpeedX = 0;
_local1.pSpeedY = 0;
_local1.pLR = "r";
_local1.pAnim = new Array(0, 2);
_local1.pHitTimer = 0;
_local1.pAlpha = 100;
_local1.pTarget = 0;
};
this.init();
if (_global.gPP == "pete") {
this.attachMovie("mc.pete", "pete_mc", this.getNextHighestDepth());
} else {
this.attachMovie("mc.paula", "pete_mc", this.getNextHighestDepth());
}
stop();
Symbol 235 MovieClip Frame 1
var pNum = Number(this._name.slice(5, -3));
var pX;
var pY;
var pMyPause;
var pAnim;
this.setPos = function (ty) {
this._x = pX + 38;
this._y = pY - ty;
};
this.setUp = function (x, y, rot, frames) {
var _local1 = this;
var _local2 = rot;
_local1.pX = x * 16;
_local1.pY = y * 16;
_local1._rotation = 90 * _local2;
if ((_local2 == 1) || (_local2 == 3)) {
_local1.pY = _local1.pY + 10;
} else if (_local2 == 2) {
_local1.pY = _local1.pY + 20;
}
pMyPause = frames * 24;
_local1.pAnim = pMyPause;
};
switch (pNum) {
case 0 :
this.setUp(8, 7, 1, 4);
break;
case 1 :
this.setUp(34, 23, 3, 5);
break;
case 2 :
this.setUp(22, 53, 3, 4);
break;
case 3 :
this.setUp(8, 76, 1, 5);
break;
case 4 :
this.setUp(18, 92, 3, 4);
}
this.onEnterFrame = function () {
var _local1 = this;
pAnim--;
if (pAnim <= 0) {
pAnim = pMyPause;
pState = "active";
if (Math.distance(_local1, _local1._parent.bod_mc) < 300) {
_local1._parent.snd_mc.playsound("pSteam");
}
_local1.gotoAndPlay(2);
}
};
stop();
Symbol 235 MovieClip Frame 53
this.pState = "passive";
stop();
Symbol 272 MovieClip Frame 1
var pNum = Number(this._name.slice(6, -3));
var pX;
var pY;
var pState;
var pSpd;
var pLeftLimit;
var pRightLimit;
var pAnim;
this.setUp = function (x, y, toleft, toright, spd) {
var _local1 = this;
_local1.pX = x * 16;
_local1.pY = y * 16;
_local1.pLeftLimit = _local1.pX - (toleft * 16);
_local1.pRightLimit = _local1.pX + (toright * 16);
_local1.pSpd = spd;
_local1.pState = "active";
_local1.pAnim = new Array(0, 2);
};
this.onEnterFrame = function () {
var _local1 = this;
if (pState == "active") {
pX = pX + pSpd;
if ((pX > pRightLimit) || (pX < pLeftLimit)) {
pSpd = -pSpd;
pX = pX + pSpd;
}
if (pSpd < 0) {
_local1._xscale = -100;
} else {
_local1._xscale = 100;
}
pAnim[0]++;
if (pAnim[0] > 1) {
pAnim[0] = 0;
pAnim[1]++;
if (pAnim[1] > 5) {
pAnim[1] = 0;
}
_local1.gotoAndStop(pAnim[1] + 2);
}
if ((Math.random() * 100) < 2) {
if (_local1._parent[("bullet" + pNum) + "_mc"].pState == "idle") {
_local1.fire();
}
}
} else if ((pState == "firing") || (pState == "resting")) {
}
};
this.setPos = function (ty, tdir) {
this._x = pX + 38;
this._y = pY - ty;
};
this.fire = function () {
pState = "firing";
this.gotoAndPlay("shoot");
};
this.teaBreak = function () {
pState = "resting";
this.gotoAndPlay("sit");
};
this.resetMe = function () {
var _local1 = this;
switch (pNum) {
case 0 :
_local1.setUp(10, 23, 9, 17, 4);
return;
case 1 :
_local1.setUp(34, 41, 6, 4, 3);
return;
case 2 :
_local1.setUp(25, 53, 1, 16, 4);
return;
case 3 :
_local1.setUp(30, 92, 10, 10, -3);
}
};
this.resetMe();
stop();
Symbol 272 MovieClip Frame 15
if (pSpd < 0) {
this._parent[("bullet" + pNum) + "_mc"].fire(pX - 32, pY - 40, -12);
} else {
this._parent[("bullet" + pNum) + "_mc"].fire(pX + 32, pY - 40, 12);
}
Symbol 272 MovieClip Frame 24
this.pState = "active";
stop();
Symbol 272 MovieClip Frame 30
this._parent.snd_mc.teabreak("start");
Symbol 272 MovieClip Frame 245
this.pState = "active";
this._parent.snd_mc.teabreak("stop");
this._parent.top_mc.teaBreakOver();
Symbol 274 MovieClip Frame 1
stop();
Symbol 285 MovieClip Frame 1
stop();
Symbol 286 MovieClip Frame 1
function setNum(num) {
var tstr = ("000000" + String(num));
var _local3 = tstr.substr(-6);
var _local1 = 0;
while (_local1 < 6) {
var _local2 = Number(_local3.charAt(_local1)) + 1;
this[("num" + _local1) + "_mc"].gotoAndStop(_local2);
_local1++;
}
}
switch (this._name) {
case "score_mc" :
this.setNum(0);
break;
case "total_mc" :
this.setNum(_global.gSC);
}
stop();
Symbol 289 MovieClip Frame 1
function setNum(num) {
var tstr = ("00000" + String(num));
var _local3 = tstr.substr(-5);
var _local1 = 0;
while (_local1 < 5) {
var _local2 = Number(_local3.charAt(_local1)) + 1;
this[("num" + _local1) + "_mc"].gotoAndStop(_local2);
_local1++;
}
}
if (!(this._name === "timer_mc")) {
} else {
this.setNum(99999);
}
stop();
Symbol 306 MovieClip Frame 1
stop();
Symbol 311 MovieClip Frame 106
stop();
Symbol 312 MovieClip Frame 1
var pEnergy;
var pTeaTime;
var pBonus;
var pBonusAnim;
this.setHint = function (str) {
this.hint_txt.text = str;
};
this.addScore = function (num) {
_global.gSC = _global.gSC + num;
this.score_mc.setNum(_global.gSC);
};
this.teaBreak = function () {
var _local2 = this;
_local2._parent.snd_mc.playsound("pKettle");
pTeaTime = 1;
var _local1 = 0;
while (_local1 < 5) {
_local2._parent[("cowboy" + _local1) + "_mc"].teaBreak();
_local1++;
}
};
this.teaBreakOver = function () {
pTeaTime = 0;
};
this.decreaseEnergy = function (tx) {
pEnergy = pEnergy - tx;
if (pEnergy <= 0) {
pEnergy = 0;
this._parent.gameOver("lose");
}
this.energybar_mc.gotoAndStop(pEnergy + 5);
};
this.increaseEnergy = function (tx) {
pEnergy = pEnergy + tx;
if (pEnergy >= 100) {
pEnergy = 100;
}
this.energybar_mc.gotoAndStop(pEnergy + 5);
};
this.onEnterFrame = function () {
pBonusAnim[0]++;
if (pBonusAnim[0] == 3) {
pBonus--;
pBonusAnim[1]++;
pBonusAnim[0] = 0;
if (pBonusAnim[1] == 10) {
if (pBonus < 0) {
pBonus = 0;
this.blurnum_mc._y = -50;
}
this.timer_mc.setNum(pBonus + "00");
pBonusAnim[1] = 0;
}
}
};
this.addTarget = function () {
var _local2 = this;
var _local3 = Math.floor(Math.random() * 99);
var _local1 = (pBonus * 100) + _local3;
_local2.addScore(_local1);
pBonus = 1000;
pBonusAnim[0] = 0;
pBonusAnim[1] = 0;
_local2.timer_mc.setNum("99900");
_local2.blurnum_mc._y = 4;
};
this.init = function () {
var _local1 = this;
_global.gSC = 0;
_local1.pEnergy = 100;
_local1.pTeaTime = 0;
_local1.pBonus = 1000;
_local1.pBonusAnim = Array(0, 0);
};
this.init();
Symbol 312 MovieClip Frame 10
stop();
Symbol 319 MovieClip Frame 1
function onRelease() {
if (pState == 0) {
this.gotoAndStop(2);
pState = 1;
} else {
this.gotoAndStop(1);
pState = 0;
}
}
var pState = 0;
stop();
Symbol 325 MovieClip Frame 1
stop();
Symbol 327 MovieClip Frame 1
stop();
Symbol 351 MovieClip Frame 1
stop();
Symbol 362 MovieClip Frame 1
stop();
Symbol 364 MovieClip Frame 1
stop();