Frame 1
gr_game = "B317C134";
gameID = "B317C134";
if (_root.gcode == null) {
getURL ("http://www.gamerival.com/utilities/redir.cfm?game=" add _root.gr_game, "_blank");
stop();
}
loader = {};
Frame 2
loader.loadedbytes = getBytesLoaded();
loader.totalbytes = getBytesTotal();
loader.loadedkbytes = Math.ceil(loadedbytes / 1000);
loader.totalkbytes = Math.ceil(totalbytes / 1000);
if (loader.loadedbytes == loader.totalbytes) {
gotoAndPlay (4);
}
frame = int(loader.loadedbytes / (loader.totalbytes / 100));
loadBar.bar._width = frame;
Frame 3
gotoAndPlay (2);
Frame 4
function cursor() {
this.theta1 = 0;
this.theta2 = 1.57;
this.r = 25;
this.r2 = 6;
this.adder = 2;
this.angle = 0;
this.speed = 10;
if ((dartInfo.game == 0) && (dartInfo.tt == 0)) {
dartInfo.prevScore = dartInfo.pScore;
}
this.onMouseMove();
}
function gauge() {
this.theta = 0.5;
this.r = 140;
this.reg = 0.1 + (dartInfo.fatigue / 50);
with (this.emp) {
lineStyle(3, 0, 100);
moveTo(0, 0);
lineTo(50 * sin(-2.57), 50 * cos(-2.57));
}
}
function darts() {
this.inPlace = false;
}
function explode() {
this.points = [];
this.count = 0;
var _local3 = this.points;
var _local6 = this.x;
var _local5 = this.y;
var _local2 = 0;
while (_local2 < 30) {
_local3[_local2] = {};
_local3[_local2].x = _local6 + random(10);
_local3[_local2].y = _local5 + random(15);
var _local4 = random(360);
_local4 = (_local4 * Math.PI) / 180;
_local3[_local2].speed = random(9) + 4;
_local3[_local2].xMove = _local3[_local2].speed * Math.cos(_local4);
_local3[_local2].yMove = _local3[_local2].speed * Math.sin(_local4);
_local2++;
}
}
cursor.prototype = new MovieClip();
cursor.prototype.onMouseMove = function () {
var _local3 = this._x - _xmouse;
var _local2 = this._y - _ymouse;
this.angle = atan2(_local2, _local3);
this.xP = _xmouse;
this.yP = _ymouse;
};
cursor.prototype.onMouseUp = function () {
attachMovie("booga", "bb", 5999);
bb.startDrag(true);
dartInfo.x = this._x;
dartInfo.y = this._y;
this.removeMovieClip();
};
cursor.prototype.onEnterFrame = function () {
var r = this.r;
var theta1 = this.theta1;
var theta2 = this.theta2;
var r2 = this.r2;
this.createEmptyMovieClip("lines", 6001);
with (this.lines) {
lineStyle(2, 0, 100);
moveTo(r2 * sin(theta1), r2 * cos(theta1));
lineTo(r * sin(theta1), r * cos(theta1));
lineStyle(2, 0, 100);
moveTo((r2 * sin(theta1)) * -1, (r2 * cos(theta1)) * -1);
lineTo((r * sin(theta1)) * -1, (r * cos(theta1)) * -1);
lineStyle(2, 16777215, 100);
moveTo(r2 * sin(theta2), r2 * cos(theta2));
lineTo(r * sin(theta2), r * cos(theta2));
lineStyle(2, 16777215, 100);
moveTo((r2 * sin(theta2)) * -1, (r2 * cos(theta2)) * -1);
lineTo((r * sin(theta2)) * -1, (r * cos(theta2)) * -1);
}
this.theta1 = this.theta1 + 0.2;
this.theta2 = this.theta2 + 0.2;
this.r2 = this.r2 + this.adder;
if ((this.r2 > 13) || (this.r2 < 6)) {
this.adder = this.adder * -1;
}
var xmov = (cos(this.angle) * ((this._x - this.xP) / this.speed));
if (this.xP < this._x) {
xmov = xmov * -1;
}
var ymov = (sin(this.angle) * ((this._y - this.yP) / this.speed));
if (this.yP < this._y) {
ymov = ymov * -1;
}
if ((abs(xmov) < 0.2) && (abs(ymov) < 0.2)) {
if ((this.xP != _xmouse) || (this.yP != _ymouse)) {
this.xP = _xmouse;
this.yP = _ymouse;
}
var xran = (random(28) - 14);
var yran = (random(28) - 14);
this.xP = this.xP + xran;
this.yP = this.yP + yran;
var x = (this._x - this.xP);
var y = (this._y - this.yP);
this.angle = atan2(y, x);
}
this._x = this._x + (xmov + (random(dartInfo.fatigue) - (dartInfo.fatigue / 2)));
this._y = this._y + (ymov + (random(dartInfo.fatigue) - (dartInfo.fatigue / 2)));
};
Object.registerClass("cursor", cursor);
gauge.prototype = new MovieClip();
gauge.prototype.onMouseUp = function () {
var _local4 = abs((this.theta * 57.2957795130823) + 147.250153348622) - 8;
if (_local4 > 0) {
var _local7 = random(_local4);
var _local5 = random(_local4);
var _local6 = random(2);
if (_local6 == 0) {
_local7 = _local7 * -1;
}
_local6 = random(2);
if (_local6 == 0) {
_local5 = _local5 * -1;
}
} else {
var _local5 = 0;
var _local7 = _local5;
}
_root["tDart2" + dartInfo.dShowing].removeMovieClip();
dartInfo.dShowing++;
var _local3 = attachMovie("dart2", "dart" + dartInfo.nCounter, 500 + dartInfo.nCounter);
dartInfo.x = dartInfo.x - _local7;
dartInfo.y = dartInfo.y - _local5;
_local3._x = dartInfo.x;
_local3._y = (dartInfo.y - 10) + 50;
_local3._xscale = (_local3._yscale = 400);
dartInfo.nCounter++;
this.removeMovieClip();
throwS.start();
};
gauge.prototype.onEnterFrame = function () {
var theta = this.theta;
var r = this.r;
var reg = this.reg;
this.createEmptyMovieClip("circle", 6002);
this.circ.setMask(this.circle);
with (this.circle) {
beginFill(255, 100);
lineStyle(0, 255, 100);
moveTo(0, 0);
lineTo(r * sin(0.5), r * cos(0.5));
lineTo(r * sin(theta / 2), r * cos(theta / 2));
lineTo(r * sin(theta), r * cos(theta));
lineTo(0, 0);
endFill();
}
this.theta = this.theta - this.reg;
if ((this.theta < -3.64) || (this.theta > 0.5)) {
this.reg = this.reg * -1;
}
};
Object.registerClass("booga", gauge);
darts.prototype = new MovieClip();
darts.prototype.onEnterFrame = function () {
if (this._currentframe != 19) {
this._xscale = (this._yscale = this._yscale - 21.4);
}
if (this._currentframe < 11) {
this._y = this._y - 10;
} else if ((this._currentframe >= 11) && (this._currentframe != 19)) {
this._y = this._y + 5;
}
if ((this._currentframe == 19) && (!this.inPlace)) {
dartHit.start();
dartInfo.tt++;
if (dartInfo.turn == 0) {
if (dartInfo.game == 0) {
var _local2 = determineScore(0);
} else if (dartInfo.game == 1) {
determineScore2(0);
} else {
determineScore3(0);
}
if (((dartInfo.game == 0) && (!_local2)) && (dartInfo.tt < 1000)) {
if ((dartInfo.game == 0) && (dartInfo.tt == 3)) {
dartInfo.turn = 1;
dartInfo.interval = setInterval(resetDarts2, 300);
} else {
attachMovie("cursor", "cur", 6000);
cur._x = _xmouse;
cur._y = _ymouse;
}
} else if ((dartInfo.game == 1) && (dartInfo.tt < 1000)) {
if ((dartInfo.game == 1) && (dartInfo.tt == 3)) {
dartInfo.turn = 1;
dartInfo.interval = setInterval(resetDarts2, 300);
} else {
attachMovie("cursor", "cur", 6000);
cur._x = _xmouse;
cur._y = _ymouse;
}
} else if ((dartInfo.game == 2) && (dartInfo.tt < 1000)) {
if (dartInfo.dShowing == 3) {
dartInfo.interval = setInterval(resetDarts, 500);
} else {
dartInfo.turn = 1;
followAI();
}
}
} else {
if (dartInfo.game == 0) {
var _local2 = determineScore(1);
} else if (dartInfo.game == 1) {
determineScore2(1);
} else {
determineScore3(1);
}
if (((dartInfo.game == 0) && (!_local2)) && (dartInfo.tt < 1000)) {
if (dartInfo.dShowing == 3) {
dartInfo.interval = setInterval(pauseFunc, 500);
} else {
dartInfo.interval = setInterval(firstToZeroAI, 600);
}
} else if ((dartInfo.game == 1) && (dartInfo.tt < 1000)) {
if (dartInfo.dShowing == 3) {
dartInfo.interval = setInterval(pauseFunc, 500);
} else {
dartInfo.interval = setInterval(cricketAI, 600);
}
} else if ((dartInfo.game == 2) && (dartInfo.tt < 1000)) {
dartInfo.turn = 0;
attachMovie("cursor", "cur", 6000);
cur._x = _xmouse;
cur._y = _ymouse;
}
}
this.inPlace = true;
}
};
Object.registerClass("dart", darts);
Object.registerClass("dart2", darts);
explode.prototype = new MovieClip();
explode.prototype.onEnterFrame = function () {
this.createEmptyMovieClip("holder", 3500);
this.holder._x = 0;
this.holder._y = 0;
var p = this.points;
var a = 0;
while (a < 25) {
p[a].x = p[a].x + p[a].xMove;
p[a].y = p[a].y + p[a].yMove;
with (this.holder) {
lineStyle(random(20) + 5, 6724044);
moveTo(p[a].x, p[a].y);
lineTo(p[a].x + 0.15, p[a].y);
}
a++;
}
this.count++;
if (this.count == 19) {
this.removeMovieClip();
}
};
Object.registerClass("explode", explode);
helpListener = {};
helpListener.onKeyUp = function () {
if (Key.getCode() == 72) {
if (helpWindow._x == undefined) {
_root.attachMovie("help" + dartInfo.game, "helpWindow", 18900);
helpWindow._x = 275;
helpWindow._y = 200;
} else {
helpWindow.removeMovieClip();
}
}
};
throwS = new Sound();
throwS.attachSound("throwS");
dartHit = new Sound();
dartHit.attachSound("dartHit");
music = new Sound();
music.attachSound("music");
gun = new Sound();
gun.attachSound("gun");
smash = new Sound();
smash.attachSound("smash");
cash = new Sound();
cash.attachSound("cash");
type = new Sound();
type.attachSound("type");
piano = new Sound();
piano.attachSound("piano");
gallop = new Sound();
gallop.attachSound("gallop");
function firstToZeroAI() {
clearInterval(dartInfo.interval);
var _local8 = dartInfo.oSkill;
var _local5 = dartInfo.oScore;
var _local4 = angleArray;
var _local2 = {};
_local2.val = 0;
choic.pos = 0;
if (_local5 > 59) {
if (_local8 > 45) {
_local4 = angleArray;
_local2 = {};
_local2.val = 0;
var _local6 = random(_local4.length);
var _local9 = random(3);
if (_local9 == 0) {
_local2.val = _local4[_local6][0];
_local2.th = _local4[_local6][1];
_local2.rc = 94.5;
}
if (_local9 == 1) {
_local2.val = _local4[_local6][0];
_local2.th = _local4[_local6][1];
_local2.rc = 57.5;
}
if (_local9 == 2) {
_local2.val = _local4[_local6][0];
_local2.th = _local4[_local6][1];
_local2.rc = 76;
}
if (_local2.th > 0) {
_local2.th = 270 - _local2.th;
} else {
_local2.th = Math.abs(_local2.th) - 90;
}
var _local11 = _local2.th * (Math.PI/180);
var _local14 = _local2.rc;
var _local16 = 275 + (_local14 * sin(_local11));
var _local15 = 158 + (_local14 * cos(_local11));
dartInfo.x = _local16;
dartInfo.y = _local15;
} else {
var _local11 = Math.PI;
var _local14 = 57.5;
var _local16 = 275 + (_local14 * sin(_local11));
var _local15 = 158 + (_local14 * cos(_local11));
dartInfo.x = _local16;
dartInfo.y = _local15;
}
} else {
var _local3 = 0;
while (_local3 < _local4.length) {
if (((_local4[_local3][0] * 2) <= _local5) && ((_local4[_local3][0] * 2) > _local2.val)) {
_local2.val = _local4[_local3][0] * 2;
_local2.th = _local4[_local3][1];
_local2.rc = 94.5;
}
if (((_local4[_local3][0] * 3) <= _local5) && ((_local4[_local3][0] * 3) > _local2.val)) {
_local2.val = _local4[_local3][0] * 3;
_local2.th = _local4[_local3][1];
_local2.rc = 57.5;
}
if ((_local4[_local3][0] <= _local5) && (_local4[_local3][0] >= _local2.val)) {
_local2.val = _local4[_local3][0];
_local2.th = _local4[_local3][1];
_local2.rc = 76;
}
_local3++;
}
if (_local2.th > 0) {
_local2.th = 270 - _local2.th;
} else {
_local2.th = Math.abs(_local2.th) - 90;
}
var _local11 = _local2.th * (Math.PI/180);
var _local14 = _local2.rc;
var _local16 = 275 + (_local14 * sin(_local11));
var _local15 = 158 + (_local14 * cos(_local11));
dartInfo.x = _local16;
dartInfo.y = _local15;
}
var _local12 = random(_local8 / 2);
var _local13 = random(_local8 / 2);
var _local10 = random(2);
if (_local10 == 0) {
_local12 = _local12 * -1;
}
_local10 = random(2);
if (_local10 == 0) {
_local13 = _local13 * -1;
}
var _local7 = attachMovie("dart", "dart" + dartInfo.nCounter, 500 + dartInfo.nCounter);
dartInfo.x = dartInfo.x - _local12;
dartInfo.y = dartInfo.y - _local13;
_local7._x = dartInfo.x;
_local7._y = (dartInfo.y - 10) + 50;
_local7._xscale = (_local7._yscale = 400);
dartInfo.nCounter++;
_root["tDart" + dartInfo.dShowing].removeMovieClip();
dartInfo.dShowing++;
}
function cricketAI() {
clearInterval(dartInfo.interval);
var _local7 = dartInfo.oSkill;
var _local16 = dartInfo.oScore;
var _local15 = dartInfo.pScore;
var _local8 = angleArray;
var _local2 = dartInfo.oSpots;
var _local4 = dartInfo.pSpots;
var _local6 = {};
_local6.val = 0;
choic.pos = 0;
if (dartInfo.oL2Close != 0) {
if ((_local16 >= _local15) || (dartInfo.pL2Close == 0)) {
var _local11 = random(_local2.length);
while (_local2[_local11][1] == 3) {
_local11 = random(_local2.length);
}
if (_local2[_local11][0] != 50) {
var _local5 = _local8[_local2[_local11][0]][1];
if (_local7 < 50) {
var _local14 = 57.5;
} else {
var _local14 = 76;
}
} else {
var _local5 = 0;
var _local14 = 3;
}
} else if (dartInfo.pL2Close >= 3) {
var _local11 = random(_local2.length);
while (_local2[_local11][1] == 3) {
_local11 = random(_local2.length);
}
if (_local2[_local11][0] != 50) {
var _local5 = _local8[_local2[_local11][0]][1];
if (_local7 < 50) {
var _local14 = 57.5;
} else {
var _local14 = 76;
}
} else {
var _local5 = 0;
var _local14 = 3;
}
} else {
_local6 = 0;
var _local3 = 0;
while (_local3 < _local2.length) {
if ((_local2[_local3][1] == 3) && (_local4[_local3][1] != 3)) {
_local6 = _local3;
}
_local3++;
}
if (_local6 == 0) {
var _local11 = random(_local2.length);
while (_local2[_local11][1] == 3) {
_local11 = random(_local2.length);
}
if (_local2[_local11][0] != 50) {
var _local5 = _local8[_local2[_local11][0]][1];
if (_local7 < 50) {
var _local14 = 57.5;
} else {
var _local14 = 76;
}
} else {
var _local5 = 0;
var _local14 = 3;
}
} else if (_local2[_local6][0] != 50) {
var _local5 = _local8[_local2[_local6][0]][1];
if (_local7 < 50) {
var _local14 = 57.5;
} else {
var _local14 = 76;
}
} else {
var _local5 = 0;
var _local14 = 3;
}
}
} else {
_local6 = 0;
var _local3 = 0;
while (_local3 < _local2.length) {
if ((_local2[_local3][1] == 3) && (_local4[_local3][1] != 3)) {
_local6 = _local3;
}
_local3++;
}
if (_local6 == 0) {
var _local11 = random(_local2.length);
if (_local2[_local11][0] != 50) {
var _local5 = _local8[_local2[_local11][0]][1];
if (_local7 < 50) {
var _local14 = 57.5;
} else {
var _local14 = 76;
}
} else {
var _local5 = 0;
var _local14 = 3;
}
} else if (_local2[_local6][0] != 50) {
var _local5 = _local8[_local2[_local6][0]][1];
if (_local7 < 50) {
var _local14 = 57.5;
} else {
var _local14 = 76;
}
} else {
var _local5 = 0;
var _local14 = 3;
}
}
if (_local5 > 0) {
var _local5 = 270 - _local5;
} else {
var _local5 = Math.abs(_local5) - 90;
}
var _local5 = _local5 * (Math.PI/180);
var _local18 = 275 + (_local14 * sin(_local5));
var _local17 = 158 + (_local14 * cos(_local5));
dartInfo.x = _local18;
dartInfo.y = _local17;
var _local12 = random(_local7 / 2);
var _local13 = random(_local7 / 2);
var _local10 = random(2);
if (_local10 == 0) {
_local12 = _local12 * -1;
}
_local10 = random(2);
if (_local10 == 0) {
_local13 = _local13 * -1;
}
var _local9 = attachMovie("dart", "dart" + dartInfo.nCounter, 500 + dartInfo.nCounter);
dartInfo.x = dartInfo.x - _local12;
dartInfo.y = dartInfo.y - _local13;
_local9._x = dartInfo.x;
_local9._y = (dartInfo.y - 10) + 50;
_local9._xscale = (_local9._yscale = 400);
dartInfo.nCounter++;
_root["tDart" + dartInfo.dShowing].removeMovieClip();
dartInfo.dShowing++;
}
function followAI() {
clearInterval(dartInfo.interval);
var _local5 = angleArray;
var _local2 = {};
_local2.val = 0;
var _local7 = random(_local5.length);
var _local3 = random(3);
if (_local3 == 0) {
_local2.rc = 94.5;
}
if (_local3 == 1) {
_local2.rc = 57.5;
}
if (_local3 == 2) {
_local2.rc = 76;
}
if (dartInfo.level < 4) {
_local3 = 2;
_local2.rc = 76;
}
_local2.val = _local5[_local7][0];
_local2.th = _local5[_local7][1];
if (_local2.th > 0) {
_local2.th = 270 - _local2.th;
} else {
_local2.th = Math.abs(_local2.th) - 90;
}
var _local6 = _local2.th * (Math.PI/180);
var _local8 = _local2.rc;
var _local10 = 275 + (_local8 * sin(_local6));
var _local9 = 158 + (_local8 * cos(_local6));
dartInfo.x = _local10;
dartInfo.y = _local9;
dartInfo.val = _local2.val;
dartInfo.dis = _local3;
var _local4 = attachMovie("dart", "dart" + dartInfo.nCounter, 500 + dartInfo.nCounter);
_local4._x = dartInfo.x;
_local4._y = (dartInfo.y - 10) + 50;
_local4._xscale = (_local4._yscale = 400);
dartInfo.nCounter++;
_root["tDart" + dartInfo.dShowing].removeMovieClip();
}
function placeDarts() {
var _local2 = 0;
while (_local2 < 3) {
var _local3 = _root.attachMovie("tDart2", "tDart2" + _local2, 5 + _local2);
_local3._xscale = (_local3._yscale = 25);
_local3._x = 37 + (21 * _local2);
_local3._y = 366;
_local2++;
}
_local2 = 0;
while (_local2 < 3) {
var _local3 = _root.attachMovie("tDart", "tDart" + _local2, 10 + _local2);
_local3._xscale = (_local3._yscale = 25);
_local3._x = 121 + (21 * _local2);
_local3._y = 366;
_local2++;
}
}
function resetDarts() {
var _local2 = 0;
while (_local2 < 6) {
_root["dart" + _local2].removeMovieClip();
_local2++;
}
placeDarts();
if (dartInfo.game == 2) {
dartInfo.tt = 0;
dartInfo.dShowing = 0;
dartInfo.nCounter = 0;
dartInfo.turn = 1;
followAI();
}
}
function resetDarts2() {
clearInterval(dartInfo.interval);
dartInfo.tt = 0;
resetDarts();
dartInfo.dShowing = 0;
dartInfo.prevScore = dartInfo.oScore;
if (dartInfo.game == 0) {
firstToZeroAI();
} else {
cricketAI();
}
}
function pauseFunc() {
clearInterval(dartInfo.interval);
resetDarts();
dartInfo.tt = 0;
attachMovie("cursor", "cur", 6000);
cur._x = _xmouse;
cur._y = _ymouse;
dartInfo.turn = 0;
dartInfo.dShowing = 0;
dartInfo.nCounter = 0;
}
function determineScore(val) {
if (bottle.hitTest(dartInfo.x, dartInfo.y, true)) {
_root.attachMovie("explode", "e", 2011, {x:0, y:0});
e._x = 95;
e._y = 313;
bottle.swapDepths(9);
bottle.removeMovieClip();
bottleS.swapDepths(9);
smash.start();
bottleS.removeMovieClip();
}
var _local5 = 0;
var _local4 = atan2(158 - dartInfo.y, 275 - dartInfo.x);
_local4 = int(_local4 * 57.2957795130823);
var _local2 = 0;
while (_local2 < angleArray.length) {
var _local3 = angleArray[_local2][1];
if (_local4 < -170) {
_local5 = 6;
_local2 = 500;
}
if ((_local4 <= (_local3 + 9)) && (_local4 >= (_local3 - 9))) {
_local5 = angleArray[_local2][0];
_local2 = 500;
}
_local2++;
}
var _local6 = Math.sqrt(Math.pow(275 - dartInfo.x, 2) + Math.pow(158 - dartInfo.y, 2));
var _local7 = 1;
if (_local6 <= 99) {
if (_local6 >= 90) {
_local7 = 2;
} else if ((_local6 >= 53) && (_local6 <= 62)) {
_local7 = 3;
} else if ((_local6 >= 3.5) && (_local6 <= 8.5)) {
_local5 = 25;
} else if (_local6 <= 3.5) {
_local5 = 50;
}
} else {
_local5 = 0;
}
_local5 = _local5 * _local7;
if (val == 0) {
poster.pScore = poster.pScore - _local5;
dartInfo.pScore = dartInfo.pScore - _local5;
if (dartInfo.pScore == 0) {
dartInfo.tt = 1000;
_root.attachMovie("youWin", "win", 1000);
win._x = 275;
win._y = 200;
Mouse.show();
music.start(0, 99);
win.onRelease = function () {
music.stop();
gun.start();
gotoAndPlay (9);
};
win.amount = "$" + dartInfo.bet;
dartInfo.whoWon = 0;
cash.start();
}
} else {
poster.oScore = poster.oScore - _local5;
dartInfo.oScore = dartInfo.oScore - _local5;
if (dartInfo.oScore == 0) {
dartInfo.tt = 1000;
_root.attachMovie("billWin", "win", 1000);
win._x = 275;
win._y = 200;
Mouse.show();
win.onRelease = function () {
gun.start();
gotoAndPlay (9);
};
win.amount = "$" + dartInfo.bet;
dartInfo.whoWon = 1;
cash.start();
}
}
var _local8 = checkForBust();
return(_local8);
}
function determineScore2(val) {
if (bottle.hitTest(dartInfo.x, dartInfo.y, true)) {
_root.attachMovie("explode", "e", 2011, {x:0, y:0});
e._x = 95;
e._y = 313;
bottle.swapDepths(9);
bottle.removeMovieClip();
bottleS.swapDepths(9);
smash.start();
bottleS.removeMovieClip();
}
if (val == 0) {
var _local5 = dartInfo.pSpots;
var _local8 = dartInfo.oSpots;
} else {
var _local5 = dartInfo.oSpots;
var _local8 = dartInfo.pSpots;
}
var _local6 = 1;
var _local2 = atan2(158 - dartInfo.y, 275 - dartInfo.x);
_local2 = int(_local2 * 57.2957795130823);
var _local4 = 0;
while (_local4 < angleArray.length) {
var _local3 = angleArray[_local4][1];
if ((_local2 <= (_local3 + 9)) && (_local2 >= (_local3 - 9))) {
_local2 = angleArray[_local4][0];
_local4 = 500;
}
_local4++;
}
var _local7 = Math.sqrt(Math.pow(275 - dartInfo.x, 2) + Math.pow(158 - dartInfo.y, 2));
if (((((((_local2 == 15) || (_local2 == 16)) || (_local2 == 17)) || (_local2 == 18)) || (_local2 == 19)) || (_local2 == 20)) || (_local7 < 8.5)) {
if (_local7 <= 99) {
if (_local7 >= 90) {
_local6 = 2;
} else if ((_local7 >= 53) && (_local7 <= 62)) {
_local6 = 3;
} else if ((_local7 >= 3.5) && (_local7 <= 8.5)) {
_local2 = 25;
_local6 = 1;
} else if (_local7 <= 3.5) {
_local2 = 50;
_local6 = 2;
}
} else {
_local6 = 0;
}
if (_local6 != 0) {
_local4 = _local2 - 15;
if ((_local2 == 50) || (_local2 == 25)) {
_local4 = 6;
}
if ((_local5[_local4][1] == 3) && (_local8[_local4][1] != 3)) {
if (val == 0) {
if (_local2 != 50) {
dartInfo.pScore = dartInfo.pScore + (_local2 * _local6);
} else {
dartInfo.pScore = dartInfo.pScore + _local2;
}
if ((dartInfo.pScore >= dartInfo.oScore) && (dartInfo.pL2Close <= 0)) {
dartInfo.tt = 1000;
_root.attachMovie("youWin", "win", 1000);
win._x = 275;
win._y = 200;
Mouse.show();
music.start(0, 99);
win.onRelease = function () {
music.stop();
gun.start();
gotoAndPlay (9);
};
win.amount = "$" + dartInfo.bet;
dartInfo.whoWon = 0;
cash.start();
}
} else {
dartInfo.oScore = dartInfo.oScore + (_local2 * _local6);
if ((dartInfo.oScore >= dartInfo.pScore) && (dartInfo.oL2Close <= 0)) {
dartInfo.tt = 1000;
_root.attachMovie("billWin", "win", 1000);
win._x = 275;
win._y = 200;
Mouse.show();
win.onRelease = function () {
gun.start();
gotoAndPlay (9);
};
win.amount = "$" + dartInfo.bet;
dartInfo.whoWon = 1;
cash.start();
}
}
player.pScore = dartInfo.pScore;
opp.oScore = dartInfo.oScore;
} else {
_local5[_local4][1] = _local5[_local4][1] + _local6;
if (_local5[_local4][1] > 3) {
if (dartInfo.turn == 0) {
dartInfo.pL2Close--;
if (dartInfo.pL2Close < 0) {
dartInfo.pL2Close = 0;
}
} else {
dartInfo.oL2Close--;
if (dartInfo.oL2Close < 0) {
dartInfo.oL2Close = 0;
}
}
if (_local8[_local4][1] != 3) {
var _local9 = _local5[_local4][1] - 3;
if (_local2 == 50) {
_local2 = 25;
}
if (val == 0) {
dartInfo.pScore = dartInfo.pScore + (_local2 * _local9);
} else {
dartInfo.oScore = dartInfo.oScore + (_local2 * _local9);
}
player.pScore = dartInfo.pScore;
opp.oScore = dartInfo.oScore;
}
_local5[_local4][1] = 3;
if ((dartInfo.pScore >= dartInfo.oScore) && (dartInfo.pL2Close == 0)) {
dartInfo.tt = 1000;
_root.attachMovie("youWin", "win", 1000);
win._x = 275;
win._y = 200;
Mouse.show();
music.start(0, 99);
win.onRelease = function () {
music.stop();
gun.start();
gotoAndPlay (9);
};
win.amount = "$" + dartInfo.bet;
dartInfo.whoWon = 0;
cash.start();
} else if ((dartInfo.oScore >= dartInfo.pScore) && (dartInfo.oL2Close == 0)) {
dartInfo.tt = 1000;
_root.attachMovie("billWin", "win", 1000);
win._x = 275;
win._y = 200;
Mouse.show();
win.onRelease = function () {
gun.start();
gotoAndPlay (9);
};
win.amount = "$" + dartInfo.bet;
dartInfo.whoWon = 1;
cash.start();
}
} else if (_local5[_local4][1] == 3) {
if (dartInfo.turn == 0) {
dartInfo.pL2Close--;
if (dartInfo.pL2Close < 0) {
dartInfo.pL2Close = 0;
}
if ((dartInfo.pScore >= dartInfo.oScore) && (dartInfo.pL2Close == 0)) {
dartInfo.tt = 1000;
_root.attachMovie("youWin", "win", 1000);
win._x = 275;
win._y = 200;
Mouse.show();
music.start(0, 99);
win.onRelease = function () {
music.stop();
gun.start();
gotoAndPlay (9);
};
win.amount = "$" + dartInfo.bet;
dartInfo.whoWon = 0;
cash.start();
}
} else {
dartInfo.oL2Close--;
if (dartInfo.oL2Close < 0) {
dartInfo.oL2Close = 0;
}
if ((dartInfo.oScore >= dartInfo.pScore) && (dartInfo.oL2Close == 0)) {
dartInfo.tt = 1000;
_root.attachMovie("billWin", "win", 1000);
win._x = 275;
win._y = 200;
Mouse.show();
win.onRelease = function () {
gun.start();
gotoAndPlay (9);
};
win.amount = "$" + dartInfo.bet;
dartInfo.whoWon = 1;
cash.start();
}
}
}
if (_local5[_local4][1] > 3) {
_local5[_local4][1] = 3;
}
if (dartInfo.turn == 0) {
player["m" + _local4].gotoAndStop(_local5[_local4][1] + 1);
} else {
opp["m" + _local4].gotoAndStop(_local5[_local4][1] + 1);
}
}
}
}
}
function determineScore3(val) {
if (val == 1) {
poster.num = dartInfo.val;
if (dartInfo.dis == 0) {
poster.value = "Double";
} else if (dartInfo.dis == 1) {
poster.value = "Triple";
} else {
poster.value = "Single";
}
} else {
var _local5 = 0;
var _local4 = atan2(158 - dartInfo.y, 275 - dartInfo.x);
_local4 = int(_local4 * 57.2957795130823);
var _local2 = 0;
while (_local2 < angleArray.length) {
var _local3 = angleArray[_local2][1];
if (_local4 < -170) {
_local5 = 6;
_local2 = 500;
}
if ((_local4 < (_local3 + 9)) && (_local4 > (_local3 - 9))) {
_local5 = angleArray[_local2][0];
_local2 = 500;
}
_local2++;
}
var _local7 = Math.sqrt(Math.pow(275 - dartInfo.x, 2) + Math.pow(158 - dartInfo.y, 2));
var _local6 = 2;
if (_local7 < 99) {
if (_local7 > 90) {
_local6 = 0;
} else if ((_local7 > 53) && (_local7 < 62)) {
_local6 = 1;
} else if ((_local7 > 3.5) && (_local7 < 8.5)) {
_local5 = 25;
_local6 = 4;
} else if (_local7 < 3.5) {
_local5 = 50;
_local6 = 4;
}
if (dartInfo.turn == 0) {
if (_local6 == 4) {
_local6 = 1;
}
}
} else {
_local5 = 0;
}
trace((((((dartInfo.val + "/") + dartInfo.dis) + " - ") + _local5) + "/") + _local6);
if ((_local5 != dartInfo.val) || (_local6 != dartInfo.dis)) {
dartInfo.tt = 1000;
_root.attachMovie("billWin", "win", 1000);
win._x = 275;
win._y = 200;
Mouse.show();
win.onRelease = function () {
gun.start();
gotoAndPlay (9);
};
win.amount = "$" + dartInfo.bet;
dartInfo.whoWon = 1;
cash.start();
} else {
dartInfo.fCount++;
poster.left = (8 - dartInfo.fCount) + " Remaining";
if (dartInfo.fCount == 8) {
dartInfo.tt = 1000;
_root.attachMovie("youWin", "win", 1000);
win._x = 275;
win._y = 200;
Mouse.show();
music.start(0, 99);
win.onRelease = function () {
music.stop();
gun.start();
gotoAndPlay (9);
};
win.amount = "$" + dartInfo.bet;
dartInfo.whoWon = 0;
cash.start();
}
}
}
}
function pLose() {
}
function checkForBust() {
if (dartInfo.turn == 0) {
if (dartInfo.pScore < 0) {
dartInfo.pScore = dartInfo.prevScore;
dartInfo.interval = setInterval(bust, 400);
return(true);
}
} else if (dartInfo.oScore < 0) {
dartInfo.oScore = dartInfo.prevScore;
dartInfo.interval = setInterval(bust, 400);
return(true);
}
return(false);
}
function bust() {
clearInterval(dartInfo.interval);
if (dartInfo.turn == 0) {
dartInfo.turn = 1;
poster.pScore = dartInfo.pScore;
resetDarts2();
} else {
dartInfo.turn = 0;
poster.oScore = dartInfo.oScore;
pauseFunc();
}
}
function playF1(val) {
if (val == 0) {
gotoAndPlay (10);
} else if (val == 1) {
gotoAndPlay (11);
} else {
gotoAndPlay (12);
}
}
function postScore() {
clearInterval(dartInfo.interval);
gcode = _root.gcode;
score = dartInfo.money;
if (score < 5) {
score = 5;
}
delete dartInfo;
delete loader;
delete keyListener;
delete helpListener;
delete player;
delete opp;
getURL ("game.cfm", "_self", "POST");
}
var abs = Math.abs;
var atan2 = Math.atan2;
var sin = Math.sin;
var cos = Math.cos;
dartInfo = {};
dartInfo.nCounter = 0;
dartInfo.turn = 0;
dartInfo.pScore = 0;
dartInfo.oScore = 0;
dartInfo.fatigue = 2.25;
dartInfo.oSkill = 120;
dartInfo.dShowing = 0;
dartInfo.game = 0;
dartInfo.tt = 0;
dartInfo.preScore = 0;
dartInfo.hLeft = 2;
dartInfo.mLeft = 0;
dartInfo.level = 0;
dartInfo.f2zHelp = false;
dartInfo.cHelp = false;
dartInfo.follHelp = false;
dartInfo.money = 25;
dartInfo.bet = 0;
dartInfo.whoWon = 1;
angleArray = [[11, 0], [14, 18], [9, 36], [12, 54], [5, 72], [20, 90], [1, 108], [18, 126], [4, 144], [13, 162], [6, 180], [10, -162], [15, -144], [2, -126], [17, -108], [3, -90], [19, -72], [7, -54], [16, -36], [8, -18]];
almostQ = false;
Frame 5
function showTitle() {
clearInterval(dartInfo.interval);
title._visible = true;
}
music.start(0, 99);
title.play.onRelease = function () {
if (!dartInfo.mHelp) {
gotoAndPlay (6);
music.stop();
gun.start();
}
};
title.help.onRelease = function () {
gun.start();
dartInfo.mHelp = true;
_root.attachMovie("instructions", "i", 5000);
i._x = 275;
i._y = 200;
};
title._visible = false;
dartInfo.interval = setInterval(showTitle, 400);
stop();
Frame 6
function checkOk() {
if ((gamble.input.text <= dartInfo.money) && (gamble.input.text >= 0)) {
Key.removeListener(keyListener);
dartInfo.bet = gamble.input.text;
gamble.removeMovieClip();
gun.start();
if (dartInfo.whoWon == 1) {
if (tChoice == 0) {
gotoAndPlay (10);
} else if (tChoice == 1) {
gotoAndPlay (11);
} else if (tChoice == 2) {
gotoAndPlay (12);
}
} else {
Key.removeListener(keyListener);
_root.attachMovie("options", "options", 500);
options._x = 275;
options._y = 200;
}
} else {
gamble.error = "You do not have enough money. Please enter another amount.";
Selection.setFocus("gamble.input");
}
}
if (dartInfo.whoWon == 1) {
_root.attachMovie("speechBubble2", "bubble", 900);
bubble._x = 190;
bubble._y = 155;
bubble.onRelease = function () {
gun.start();
_root.attachMovie("gamble", "gamble", 600);
gamble._x = 275;
gamble._y = 200;
gamble.money = "$" + dartInfo.money;
sco.text = _root.game.score;
gamble.input.text = "";
gamble.input.maxChars = 6;
Selection.setFocus("gamble.input");
gamble.ok.onRelease = function () {
gun.start();
checkOk();
};
Key.addListener(keyListener);
this.removeMovieClip();
};
tChoice = random(3);
if (tChoice == 0) {
bubble.speech = "Lets play a game of '501' this round.\n\nRemember if you win this round then next time you can choose the game we play.\n\nNow lets get started!";
} else if (tChoice == 1) {
bubble.speech = "Lets play a game of 'Cricket' this round.\n\nRemember if you win this round then next time you can choose the game we play.\n\nNow lets get started!";
} else if (tChoice == 2) {
bubble.speech = "Lets play a game of 'Follow the Leader' this round.\n\nRemember if you win this round then next time you can choose the game we play.\n\nNow lets get started!";
}
} else {
_root.attachMovie("gamble", "gamble", 600);
gamble._x = 275;
gamble._y = 200;
gamble.money = "$" + dartInfo.money;
sco.text = _root.game.score;
gamble.input.text = "";
gamble.input.maxChars = 6;
Selection.setFocus("gamble.input");
gamble.ok.onRelease = function () {
gun.start();
checkOk();
};
Key.addListener(keyListener);
}
dartInfo.level++;
if (dartInfo.level > 3) {
dartInfo.fatigue = dartInfo.fatigue + 0.75;
}
if (dartInfo.fatigue > 5.5) {
dartInfo.fatigue = 5.5;
}
if (dartInfo.level < 3) {
var diff = random(2);
if ((diff = 0)) {
dartInfo.oSkill = 80;
} else {
dartInfo.oSkill = 50;
}
} else if (dartInfo.level < 5) {
var diff = random(2);
if ((diff = 0)) {
dartInfo.oSkill = 50;
} else {
dartInfo.oSkill = 35;
}
} else if (dartInfo.level < 10) {
var diff = random(2);
if ((diff = 0)) {
dartInfo.oSkill = 35;
} else {
dartInfo.oSkill = 20;
}
} else {
var diff = random(2);
if ((diff = 0)) {
dartInfo.oSkill = 20;
} else {
dartInfo.oSkill = 15;
}
}
keyListener = {};
keyListener.onKeyUp = function () {
type.start();
if ((Key.getCode() == 13) && (gamble._x != undefined)) {
checkOk();
}
};
_root.onEnterFrame = function () {
};
stop();
Frame 7
music.start(0, 99);
gun.start();
dartInfo.interval = setInterval(postScore, 2500);
_root.onEnterFrame = function () {
};
stop();
Frame 8
function show() {
clearInterval(dartInfo.interval);
_root.attachMovie("congrats", "congrats", 12456);
congrats._x = 275;
congrats._y = 200;
congrats.score = dartInfo.money;
postScore();
}
music.start(0, 99);
gun.start();
dartInfo.interval = setInterval(show, 1000);
_root.onEnterFrame = function () {
};
stop();
Frame 9
Key.removeListener(helpListener);
Key.removeListener(keyListener);
if (dartInfo.whoWon == 0) {
dartInfo.money = dartInfo.money + int(dartInfo.bet);
} else {
dartInfo.money = dartInfo.money - int(dartInfo.bet);
}
var a = 0;
while (a < 6) {
_root["dart" + a].removeMovieClip();
a++;
}
var a = 0;
while (a < 3) {
_root["tDart2" + a].removeMovieClip();
a++;
}
var a = 0;
while (a < 3) {
_root["tDart" + a].removeMovieClip();
a++;
}
Mouse.show();
win.removeMovieClip();
gamble.removeMovieClip();
if (dartInfo.money <= 0) {
gotoAndPlay (7);
} else if (dartInfo.money >= 150000) {
gotoAndPlay (8);
}
quit.no.onRelease = function () {
gun.start();
postScore();
};
quit.yes.onRelease = function () {
gun.start();
gotoAndPlay (6);
};
var speakT = random(7);
if (speakT == 0) {
speech.speech = "I bet... that you're a sissy.";
} else if (speakT == 1) {
speech.speech = "Your winning ways will not continue.";
} else if (speakT == 2) {
speech.speech = "Are you really ready to lose all your money?";
} else if (speakT == 3) {
speech.speech = "It's going to be like taking candy from a baby this round!";
} else if (speakT == 4) {
speech.speech = "You shouldn't start what you can't finish.";
} else if (speakT == 5) {
speech.speech = "What's the matter kid? ...You chicken?!";
} else if (speakT == 6) {
speech.speech = "I was playin' darts before you were even born. Why don't you just give up?";
}
_root.onEnterFrame = function () {
};
stop();
Frame 10
Key.removeListener(keyListener);
Key.addListener(helpListener);
dartInfo.pScore = 501;
dartInfo.oScore = 501;
dartInfo.prevScore = 501;
dartInfo.game = 0;
dartInfo.tt = 0;
dartInfo.dShowing = 0;
dartInfo.turn = 0;
dartInfo.nCounter = 0;
sc.s = "$" + dartInfo.money;
if (dartInfo.f2zHelp) {
attachMovie("cursor", "cur", 6000);
Mouse.hide();
} else {
_root.attachMovie("f2zHelp", "f2zHelp", 7514);
f2zHelp._x = 275;
f2zHelp._y = 200;
f2zHelp.onRelease = function () {
gun.start();
_root.attachMovie("cursor", "cur", 6000);
Mouse.hide();
this.removeMovieClip();
};
dartInfo.f2zHelp = true;
}
placeDarts();
sndCount = 0;
_root.onEnterFrame = function () {
sndCount++;
if (sndCount > 600) {
var _local1 = random(10);
if (_local1 == 3) {
piano.start();
} else if (_local1 == 4) {
gallop.start();
}
sndCount = 0;
}
};
stop();
Frame 11
Key.removeListener(keyListener);
Key.addListener(helpListener);
dartInfo.pSpots = [[15, 0], [16, 0], [17, 0], [18, 0], [19, 0], [20, 0], [50, 0]];
dartInfo.pL2Close = 7;
dartInfo.pScore = 0;
dartInfo.oSpots = [[12, 0], [18, 0], [14, 0], [7, 0], [16, 0], [5, 0], [50, 0]];
dartInfo.oL2Close = 7;
dartInfo.oScore = 0;
dartInfo.game = 1;
dartInfo.tt = 0;
dartInfo.dShowing = 0;
dartInfo.turn = 0;
dartInfo.nCounter = 0;
sc.s = "$" + dartInfo.money;
player.pScore = 0;
opp.oScore = 0;
if (dartInfo.cHelp) {
attachMovie("cursor", "cur", 6000);
Mouse.hide();
} else {
_root.attachMovie("cHelp", "cHelp", 7419);
cHelp._x = 275;
cHelp._y = 200;
dartInfo.cHelp = true;
cHelp.onRelease = function () {
gun.start();
attachMovie("cursor", "cur", 6000);
Mouse.hide();
this.removeMovieClip();
};
}
placeDarts();
sndCount = 0;
_root.onEnterFrame = function () {
sndCount++;
if (sndCount > 600) {
var _local1 = random(10);
if (_local1 == 3) {
piano.start();
} else if (_local1 == 4) {
gallop.start();
}
sndCount = 0;
}
};
stop();
Frame 12
Key.removeListener(keyListener);
Key.addListener(helpListener);
dartInfo.game = 2;
dartInfo.tt = 0;
dartInfo.dShowing = 0;
dartInfo.turn = 1;
dartInfo.nCounter = 0;
dartInfo.fCount = 0;
sc.s = "$" + dartInfo.money;
if (dartInfo.follHelp) {
Mouse.hide();
followAI();
} else {
_root.attachMovie("follHelp", "follHelp", 7419);
follHelp._x = 275;
follHelp._y = 200;
dartInfo.follHelp = true;
follHelp.onRelease = function () {
gun.start();
Mouse.hide();
followAI();
this.removeMovieClip();
};
}
placeDarts();
poster.value = "";
poster.num = "";
sndCount = 0;
_root.onEnterFrame = function () {
sndCount++;
if (sndCount > 600) {
var _local1 = random(10);
if (_local1 == 3) {
piano.start();
} else if (_local1 == 4) {
gallop.start();
}
sndCount = 0;
}
};
stop();
Symbol 47 MovieClip [dart2] Frame 19
stop();
Symbol 67 MovieClip [dart] Frame 19
stop();
Symbol 87 MovieClip [gamble] Frame 1
f20.onRelease = function () {
_root.gun.start();
_root.playF1(0);
_root.options.removeMovieClip();
};
c.onRelease = function () {
_root.gun.start();
_root.playF1(1);
_root.options.removeMovieClip();
};
fTL.onRelease = function () {
_root.gun.start();
_root.playF1(2);
_root.options.removeMovieClip();
};
Symbol 100 MovieClip [options] Frame 1
f20.onRelease = function () {
_root.gun.start();
_root.playF1(0);
_root.options.removeMovieClip();
};
c.onRelease = function () {
_root.gun.start();
_root.playF1(1);
_root.options.removeMovieClip();
};
fTL.onRelease = function () {
_root.gun.start();
_root.playF1(2);
_root.options.removeMovieClip();
};
Symbol 159 MovieClip [instructions] Frame 1
next.onRelease = function () {
_root.gun.start();
nextFrame();
};
done.onRelease = function () {
_root.gun.start();
_root.dartInfo.mHelp = false;
_root.i.removeMovieClip();
};
stop();
Symbol 159 MovieClip [instructions] Frame 2
next.onRelease = function () {
_root.gun.start();
nextFrame();
};
back.onRelease = function () {
_root.gun.start();
prevFrame();
};
done.onRelease = function () {
_root.gun.start();
_root.dartInfo.mHelp = false;
_root.i.removeMovieClip();
};
stop();
Symbol 159 MovieClip [instructions] Frame 3
next.onRelease = function () {
_root.gun.start();
nextFrame();
};
back.onRelease = function () {
_root.gun.start();
prevFrame();
};
done.onRelease = function () {
_root.gun.start();
_root.dartInfo.mHelp = false;
_root.i.removeMovieClip();
};
stop();
Symbol 159 MovieClip [instructions] Frame 4
back.onRelease = function () {
_root.gun.start();
prevFrame();
};
done.onRelease = function () {
_root.gun.start();
_root.dartInfo.mHelp = false;
_root.i.removeMovieClip();
};
stop();
Symbol 216 MovieClip Frame 1
stop();
Symbol 216 MovieClip Frame 2
stop();
Symbol 300 MovieClip Frame 1
stop();
Symbol 300 MovieClip Frame 2
stop();
Symbol 300 MovieClip Frame 3
stop();
Symbol 300 MovieClip Frame 4
stop();