Frame 1
function initSplashScreen(logo) {
createEmptyMovieClip("snd", 99);
snd.loadMovie("Sounds2.swf", "GET");
snd._visible = false;
snd.tabIndex = 1;
vol = 80;
volM = 50;
snd.onLoad();
createEmptyMovieClip("preloader", 5);
preloader.attachMovie("bkgdSplash", "bkgdSplash", 3);
preloader.bkgdSplash.btn_start._visible = false;
preloader.bkgdSplash.vsint._visible = false;
preloader.bkgdSplash.vs._visible = false;
if (_global.noZoneAPI == true) {
preloader.bkgdSplash.zonelogo._visible = false;
preloader.bkgdSplash.zonelogo.gotoAndStop(1);
} else {
preloader.bkgdSplash.zonelogo._visible = true;
preloader.bkgdSplash.zonelogo.gotoAndStop(2);
}
preloader.bkgdSplash.btn_start.btn.onRelease = function () {
_root.initMenu();
if (_global.noZoneAPI == true) {
} else {
clearInterval(photomaker);
DoGameReady();
}
_root.preloader.removeMovieClip();
};
preloader.bkgdSplash.btn_start.btn.onPress = function () {
PlaySoundEffect("SOUND_CLICK1");
};
preloader.createEmptyMovieClip("lgf", 7);
preloader.lgf.loadMovie(logo);
preloader.lgf._x = 0 + logobufferx;
preloader.lgf._y = 0 + logobuffery;
preloader.lgf._yscale = 100;
preloader.lgf._xscale = 100;
photoArray = new Array();
photoArray[0] = {img:"p-2p16", first:"Barry", last:"Greenstein", lTag:"CALIFORNIA STATE POKER CHAMPION"};
photoArray[1] = {img:"p-2p12", first:"Cyndy", last:"Violette", lTag:"WORLD SERIES BRACELET WINNER"};
photoArray[2] = {img:"p-2p6", first:"Johnny", last:"Chan", lTag:"9-TIME WSOP BRACELET WINNER"};
photoArray[3] = {img:"p-2p5", first:"Kathy", last:"Liebert", lTag:"2004 WSOP BRACELET WINNER"};
photoArray[4] = {img:"p-2p13", first:"Carlos", last:"Mortensen", lTag:"2001 WORLD SERIES CHAMPION"};
photoArray[5] = {img:"p-2p1", first:"Ted", last:"Forrest", lTag:"5-TIME WSOP BRACELET WINNER"};
photoArray[6] = {img:"p-2p10", first:"David", last:"Sklansky", lTag:"3-TIME WSOP BRACELET WINNER"};
photoArray[7] = {img:"p-2p3", first:"Player", last:"", lTag:"THE FUTURE OF POKER?"};
photoArray[8] = {img:"p-2p15", first:"Todd", last:"Brunson", lTag:"2004 FIESTA AL LAGO CHAMPION"};
photoArray[9] = {img:"p-2p14", first:"Antonio", last:"Esfandiari", lTag:"SHOWMAN/MAGICIAN TURNED POKER PLAYER"};
photoArray[10] = {img:"p-2p8", first:"Freddy", last:"Deeb", lTag:"TOP HIGH-STAKES CASH GAME PLAYER"};
photoArray[11] = {img:"p-2p11", first:"David", last:"Grey", lTag:"WORLD SERIES BRACELET WINNER"};
photoArray[12] = {img:"p-2p9", first:"Eli", last:"Elezra", lTag:"BUSINESSMAN TURNED POKER PLAYER"};
photoArray[13] = {img:"p-2p4", first:"Mike", last:"Caro", lTag:"THE MAD GENIUS OF POKER"};
photoArray[14] = {img:"p-2p2", first:"Scotty", last:"Nguyen", lTag:"1998 WORLD SERIES CHAMPION"};
photoArray[15] = {img:"p-2p7", first:"Huck", last:"Seed", lTag:"4-TIME WSOP BRACELET WINNER"};
photocount = 0;
placePhoto();
photomaker = setInterval(placePhoto, 6000);
}
function placePhoto() {
var _local3;
var _local4 = 0;
if (photocount == 1) {
_local4 = 8;
}
var _local5 = _local4 + 8;
var _local1 = 0;
var _local2 = _local4;
while (_local2 < _local5) {
preloader.bkgdSplash["pslot" + _local1].photoholder.removeMovieClip(photo);
_local3 = photoArray[_local2].img;
preloader.bkgdSplash["pslot" + _local1].photoholder.attachMovie(_local3, "photo", 1);
preloader.bkgdSplash["pslot" + _local1].fname.text = (preloader.bkgdSplash["pslot" + _local1].fnames.text = photoArray[_local2].first);
preloader.bkgdSplash["pslot" + _local1].lname.text = (preloader.bkgdSplash["pslot" + _local1].lnames.text = photoArray[_local2].last);
_local1++;
_local2++;
}
photocount++;
((photocount == 1) ? 0 : null);
}
function DoCustomEvent(event) {
trace("DOWNLOADING NOW");
if (_global.download != null) {
if (_global.downloadtype == "blank") {
getURL (_global.download, "_blank");
} else {
getURL (_global.download);
}
return(undefined);
}
eventhardcoded = "CustomEvent";
fscommand ("CustomEvent", ("<gamedata>" + eventhardcoded) + "</gamedata>");
if (_root.gFake) {
DoCustomReturn(null);
}
}
function DoCustomReturn(customData) {
}
function DoGameBreak() {
zoneBreaks++;
fscommand ("GameBreak", ("<data><breakpoint>" + zoneBreaks) + "</breakpoint></data>");
numHandsPlayed++;
if (_root.gFake) {
DoGameContinue(null);
}
}
function DoGameContinue(gameBreakData) {
doLog("game continue: " + gameBreakData);
_root.getDealStandings();
}
function DoGameEnd() {
DoScoreSubmit(zoneScore);
fscommand ("GameEnd", "<gamedata></gamedata>");
}
function DoGameError() {
}
function DoGameMenu() {
}
function DoGameReady() {
fscommand ("GameReady", "<data><mode>round</mode><difficulty></difficulty><startlevel></startlevel></data>");
if (_root.gFake) {
DoGameStart();
}
}
function DoGameStart() {
if (gamestartrun) {
PlayMusic("MUSIC_INTRO", _root.volM);
}
gamestartrun = true;
_root.gBreakId = 1;
_root.gGameStartTime = getTimer();
}
function DoScoreEvent(what, myscore) {
var _local2 = int((getTimer() - _root.gGameStartTime) / 1000);
fscommand (what, ((("<game><score>" + myscore) + "</score><time>") + _local2) + "</time></game>");
}
function DoScoreBroadcast() {
DoScoreEvent("ScoreBroadcast", zoneScore);
}
function DoScoreSubmit(fscore) {
DoScoreEvent("ScoreSubmit", fscore);
}
function DoSessionReady() {
fscommand ("SessionReady", "<data></data>");
if (_root.gFake) {
DoSessionStart();
}
}
function DoSessionStart() {
preloader.bkgdSplash.btn_start._visible = true;
_root.PlaySoundEffect("SOUND_CHIP1");
_root.PlayMusic("MUSIC_INTRO", _root.volM);
}
function initLoader() {
if (!loaded) {
loaded = true;
isGameTimerActive = false;
maxHandsAllowed = 0;
_global.logo = "";
_global.shockwave = false;
shockcheat = false;
_global.noZoneAPI = true;
_global.realmode = false;
_global.download = null;
_global.downloadType = "self";
zoneBreaks = 0;
blindincrement = 4;
_root.settings.load("pokerss2.xml");
} else {
if (_global.noZoneAPI == true) {
initSplashScreen(_global.logo);
} else {
initSplashScreen(_global.logo, true);
}
initSplashScreen();
}
}
function setEnterNameListener() {
listenForEnter_obj = new Object();
listenForEnter_obj.onKeyDown = function () {
if (Key.isDown(13) && (this.pressedOnce == undefined)) {
if (gameMenu.active == "menu") {
gameMenu.bkgdMenu.btn_play.btn.onRelease();
} else if (gameMenu.active == "enterName") {
gameMenu.bkgdEnterName.btn_okay.btn.onRelease();
}
this.pressedOnce = true;
}
};
listenForEnter_obj.onKeyUp = function () {
this.pressedOnce = undefined;
};
Key.addListener(listenForEnter_obj);
}
function initMenu(defer, makenoise) {
createEmptyMovieClip("gameMenu", _root.menudepth);
gameMenu.mydepth = 0;
gameMenu.active = "menu";
gameMenu.attachMovie("bkgdMenu", "bkgdMenu", gameMenu.mydepth++);
gameMenu.buttonNames = new Array("howtoplay", "options", "quit", "play", "download", "round", "season", "cashgame");
i = 0;
while (i < gameMenu.buttonNames.length) {
gameMenu.bkgdMenu["btn_" + gameMenu.buttonNames[i]].btn.onRelease = function () {
if (_root.gameMenu.active == "menu") {
_root.menuButtons(this._parent.myname.text);
}
};
gameMenu.bkgdMenu["btn_" + gameMenu.buttonNames[i]].btn.onPress = function () {
if (_root.gameMenu.active == "menu") {
_root.buttonSound();
}
};
i++;
}
gameMenu.bkgdMenu.btn_round.radio.gotoAndStop(2);
gameMenu.bkgdMenu.playerCard.highlite.onRelease = function () {
if (_root.gameMenu.active == "menu") {
getUpsell();
}
};
gameMenu.bkgdMenu.playerCard.highlite.onPress = function () {
if (_root.gameMenu.active == "menu") {
_root.buttonSound();
}
};
gameMenu.bkgdMenu.playerCard.highlite.onRollOver = function () {
this.gotoAndStop(2);
};
gameMenu.bkgdMenu.playerCard.highlite.onRollOut = (gameMenu.bkgdMenu.playerCard.highlite.onReleaseOutside = function () {
this.gotoAndStop(1);
});
if (_global.realmode == true) {
gameMenu.bkgdMenu.btn_download._visible = false;
}
if (_global.shockwave) {
gameMenu.bkgdMenu.vs._visible = true;
gameMenu.bkgdMenu.vsint._visible = true;
if (shockcheat == true) {
gameMenu.bkgdMenu.attachMovie("cheatbox", "cheatbox", 52);
gameMenu.bkgdMenu.cheatbox._x = 200;
gameMenu.bkgdMenu.cheatbox._y = 310;
}
} else {
gameMenu.bkgdMenu.vsint._visible = false;
gameMenu.bkgdMenu.vs._visible = false;
}
PlaySoundEffect("SOUND_CHIP1");
if (!defer) {
getEnterName();
} else if (makenoise != "nosound") {
trace("here");
_root.SetMusicVolume();
_root.PlayMusic("MUSIC_INTRO");
}
setEnterNameListener();
}
function menuButtons(myname) {
myname = myname.toLowerCase();
switch (myname) {
case "play" :
mygame = new Game();
gameMenu.removeMovieClip();
break;
case "quit" :
getUpsell("quit");
break;
case "how to play" :
trace("getting help");
getHelp();
break;
case "options" :
getOptions();
break;
case "round" :
getUpsell();
break;
case "season" :
getUpsell();
break;
case "download" :
downloadAction();
break;
case "limit" :
getUpsell();
}
}
function getOptions() {
gameMenu.attachMovie("bkgdOptions", "bkgdOptions", gameMenu.mydepth++);
gameMenu.optionNames = new Array("okay", "credits", "switch", "change", "change2");
i = 0;
while (i < gameMenu.optionNames.length) {
gameMenu.bkgdOptions["btn_" + gameMenu.optionNames[i]].btn.onRelease = function () {
if (gameMenu.active == "options") {
_root.optionButtons(this._parent.myname.text);
}
};
gameMenu.bkgdOptions["btn_" + gameMenu.optionNames[i]].btn.onPress = function () {
if (gameMenu.active == "options") {
_root.buttonSound();
}
};
i++;
}
gameMenu.bkgdOptions.gamespeed.onPress = function () {
if (gameMenu.active == "options") {
_root.buttonSound();
_root.optionButtons("gamespeed");
}
};
gameMenu.active = "options";
gameMenu.bkgdOptions.tSnd._x = Math.round(273 + (vol / 0.623));
gameMenu.bkgdOptions.tMusic._x = Math.round(273 + (volM / 0.623));
}
function optionButtons(myname) {
myname = myname.toLowerCase();
switch (myname) {
case "okay" :
gameMenu.active = "menu";
gameMenu.bkgdOptions.removeMovieClip();
break;
case "credits" :
getCredits();
break;
case "switch" :
getUpsell();
break;
case "change" :
getUpsell();
break;
case "change2" :
getUpsell();
break;
case "gamespeed" :
getUpsell();
}
}
function getCredits() {
gameMenu.attachMovie("bkgdCredits", "bkgdCredits", gameMenu.mydepth++);
gameMenu.bkgdCredits.btn_okay.btn.onRelease = function () {
if (gameMenu.active == "credits") {
_root.gameMenu.active = "options";
_root.gameMenu.bkgdCredits.removeMovieClip();
}
};
gameMenu.bkgdCredits.btn_okay.btn.onPress = function () {
if (gameMenu.active == "credits") {
_root.buttonSound();
}
};
gameMenu.active = "credits";
}
function getUpsell(type) {
myActive = gameMenu.active;
gameMenu.attachMovie("bkgdUpsell", "bkgdUpsell", gameMenu.mydepth++);
gameMenu.bkgdUpsell.btn_okay.btn.onRelease = function () {
if (gameMenu.active == "upsell") {
_root.gameMenu.active = _root.myActive;
_root.gameMenu.bkgdUpsell.removeMovieClip();
}
};
gameMenu.bkgdUpsell.btn_okay.btn.onPress = function () {
if (gameMenu.active == "upsell") {
_root.buttonSound();
}
};
gameMenu.bkgdUpsell.btn_download.btn.onRelease = function () {
if (gameMenu.active == "upsell") {
_root.downloadAction();
}
};
gameMenu.bkgdUpsell.btn_download.btn.onPress = function () {
if (gameMenu.active == "upsell") {
_root.buttonSound();
}
};
if (_global.realmode == true) {
gameMenu.bkgdUpsell.btn_download._visible = false;
gameMenu.bkgdUpsell.btn_okay._x = gameMenu.bkgdUpsell.btn_okay._x + 60;
}
gameMenu.active = "upsell";
}
function getEnterName(type) {
gameMenu.attachMovie("bkgdEnterName", "bkgdEnterName", gameMenu.mydepth++);
if (_root.username) {
gameMenu.bkgdEnterName.username.text = _root.username;
}
gameMenu.bkgdEnterName.btn_okay.btn.onRelease = function () {
if (gameMenu.active == "enterName") {
if ((this._parent._parent.username.text == "") || (this._parent._parent.username.text == undefined)) {
_root.setName("Player");
} else {
_root.setName(this._parent._parent.username.text);
}
_root.gameMenu.active = "menu";
_root.gameMenu.bkgdEnterName.removeMovieClip();
}
};
gameMenu.bkgdEnterName.btn_okay.btn.onPress = function () {
if (gameMenu.active == "enterName") {
_root.buttonSound();
}
};
gameMenu.bkgdEnterName.btn_cancel.btn.onRelease = function () {
if (gameMenu.active == "enterName") {
if ((this._parent._parent.username.text == "") || (this._parent._parent.username.text == undefined)) {
_root.setName("Player");
}
_root.gameMenu.active = "menu";
_root.gameMenu.bkgdEnterName.removeMovieClip();
}
};
gameMenu.bkgdEnterName.btn_cancel.btn.onPress = function () {
if (gameMenu.active == "enterName") {
_root.buttonSound();
}
};
gameMenu.active = "enterName";
}
function getHelp() {
loadMovieNum ("Howtoplay2.swf", 23);
}
function getTableHelp() {
loadMovieNum ("Howtoplay2.swf", 23);
}
function setName(name) {
_root.username = name;
if (_root.username) {
gameMenu.bkgdMenu.playerCard.username.text = _root.username;
}
}
function buttonSound() {
_root.PlaySoundEffect("SOUND_CLICK1");
}
function initTableMenu() {
createEmptyMovieClip("tableMenu", _root.tablemenudepth);
tableMenu.mydepth = 0;
tableMenu.attachMovie("btn_pause", "btn_pause", tableMenu.mydepth++);
tableMenu.btn_pause._x = 529;
tableMenu.btn_pause._y = 275.5;
if (_global.noZoneAPI == true) {
tableMenu.btn_pause._visible = false;
}
tableMenu.attachMovie("btn_help", "btn_help", tableMenu.mydepth++);
tableMenu.btn_help._x = 529;
tableMenu.btn_help._y = 350.5;
tableMenu.attachMovie("btn_options", "btn_options", tableMenu.mydepth++);
tableMenu.btn_options._x = 529;
tableMenu.btn_options._y = 325.5;
tableMenu.attachMovie("btn_download", "btn_download", tableMenu.mydepth++);
tableMenu.btn_download._x = 529;
tableMenu.btn_download._y = 300.5;
if (_global.realmode == true) {
tableMenu.btn_download._visible = false;
}
tableMenu.attachMovie("btn_quit", "btn_quit", tableMenu.mydepth++);
tableMenu.btn_quit._x = 529;
tableMenu.btn_quit._y = 375.5;
tableMenu.active = "menu";
tableMenu.buttonNames = new Array("options", "help", "download", "quit", "pause");
i = 0;
while (i < tableMenu.buttonNames.length) {
tableMenu["btn_" + tableMenu.buttonNames[i]].btn.onRelease = function () {
if (_root.tableMenu.active == "menu") {
_root.tableMenuButtons(this._parent.myname.text);
}
};
tableMenu["btn_" + tableMenu.buttonNames[i]].btn.onPress = function () {
if (_root.tableMenu.active == "menu") {
_root.buttonSound();
}
};
i++;
}
}
function tableMenuButtons(myname) {
myname = myname.toLowerCase();
switch (myname) {
case "help" :
getTableHelp();
break;
case "pause" :
gamePause();
break;
case "get tip" :
getTableUpsell("quit");
break;
case "options" :
getTableOptions();
break;
case "download" :
_root.downloadAction();
break;
case "quit" :
getTableQuit();
}
}
function getTableQuit() {
tableMenu.attachMovie("bkgdQuit", "bkgdQuit", tableMenu.mydepth++);
tableMenu.bkgdQuit.btn_yes.btn.onRelease = function () {
if (tableMenu.active == "quit") {
DoGameEnd();
killTheGame("defer");
}
};
tableMenu.bkgdQuit.btn_no.btn.onRelease = function () {
if (tableMenu.active == "quit") {
tableMenu.active = "menu";
tableMenu.bkgdQuit.removeMovieClip();
}
};
tableMenu.bkgdQuit.btn_yes.btn.onPress = function () {
if (tableMenu.active == "quit") {
_root.buttonSound();
}
};
tableMenu.bkgdQuit.btn_no.btn.onPress = function () {
if (tableMenu.active == "quit") {
_root.buttonSound();
}
};
tableMenu.active = "quit";
}
function getTableOptions() {
tableMenu.attachMovie("bkgdOptions", "bkgdOptions", tableMenu.mydepth++);
tableMenu.optionNames = new Array("okay", "credits", "switch");
i = 0;
while (i < tableMenu.optionNames.length) {
tableMenu.bkgdOptions["btn_" + tableMenu.optionNames[i]].btn.onRelease = function () {
trace("this._parent.myname.text");
if (tableMenu.active == "options") {
_root.tableOptionButtons(this._parent.myname.text);
}
};
tableMenu.bkgdOptions["btn_" + tableMenu.optionNames[i]].btn.onPress = function () {
if (tableMenu.active == "options") {
_root.buttonSound();
}
};
i++;
}
tableMenu.bkgdOptions.gamespeed.onPress = function () {
if (tableMenu.active == "options") {
_root.buttonSound();
_root.tableOptionButtons("gamespeed");
}
};
tableMenu.active = "options";
tableMenu.bkgdOptions.tSnd._x = Math.round(273 + (vol / 0.623));
tableMenu.bkgdOptions.tMusic._x = Math.round(273 + (volM / 0.623));
}
function tableOptionButtons(myname) {
myname = myname.toLowerCase();
switch (myname) {
case "okay" :
tableMenu.active = "menu";
tableMenu.bkgdOptions.removeMovieClip();
break;
case "credits" :
getTableCredits();
break;
case "switch" :
getTableUpsell();
break;
case "gamespeed" :
getTableUpsell();
}
}
function getTableCredits() {
tableMenu.attachMovie("bkgdCredits", "bkgdCredits", tableMenu.mydepth++);
tableMenu.bkgdCredits.btn_okay.btn.onRelease = function () {
if (tableMenu.active == "credits") {
_root.tableMenu.active = "options";
_root.tableMenu.bkgdCredits.removeMovieClip();
}
};
tableMenu.bkgdCredits.btn_okay.btn.onPress = function () {
if (tableMenu.active == "credits") {
_root.buttonSound();
}
};
tableMenu.active = "credits";
}
function getTableUpsell(type) {
myActive = tableMenu.active;
tableMenu.attachMovie("bkgdUpsell", "bkgdUpsell", tableMenu.mydepth++);
tableMenu.bkgdUpsell.btn_okay.btn.onRelease = function () {
if (tableMenu.active == "upsell") {
_root.tableMenu.active = _root.myActive;
_root.tableMenu.bkgdUpsell.removeMovieClip();
}
};
tableMenu.bkgdUpsell.btn_okay.btn.onPress = function () {
if (tableMenu.active == "upsell") {
_root.buttonSound();
}
};
tableMenu.bkgdUpsell.btn_download.btn.onRelease = function () {
if (tableMenu.active == "upsell") {
_root.downloadAction();
}
};
if (_global.realmode == true) {
tableMenu.bkgdUpsell.btn_download._visible = false;
tableMenu.bkgdUpsell.btn_okay._x = 260;
}
tableMenu.bkgdUpsell.btn_download.btn.onPress = function () {
if (tableMenu.active == "upsell") {
_root.buttonSound();
}
};
tableMenu.active = "upsell";
}
function downloadAction() {
trace("GOT TO DOWNLOAD BUTTON");
_root.DoCustomEvent("download");
}
function Bubble() {
createEmptyMovieClip("bubbles", _root.bubbledepth);
this.mydepth = 0;
}
function processHand(who) {
var _local6;
_local6 = 0;
while (_local6 < 8) {
this["x" + _local6] = null;
_local6++;
}
this["bestHand" + who] = new Array();
cAr = new Array();
x1 = arena[("card_" + who) + "_0"].mycard;
x2 = arena[("card_" + who) + "_1"].mycard;
_local6 = 0;
while (_local6 < 5) {
this["x" + (_local6 + 3)] = arena["card_comm_" + _local6].mycard;
_local6++;
}
if ((x3 == null) || (x3 == undefined)) {
hh1 = x1;
hh2 = x2;
divider = 0;
_local6 = 1;
while (_local6 < 3) {
if ((this["hh" + _local6] > 13) && (this["hh" + _local6] < 27)) {
divider = 13;
} else if ((this["hh" + _local6] > 26) && (this["hh" + _local6] < 40)) {
divider = 26;
} else if (this["hh" + _local6] > 39) {
divider = 39;
}
this["hh" + _local6] = this["hh" + _local6] - divider;
_local6++;
}
if (hh1 == 1) {
hh1 = 14;
}
if (hh2 == 1) {
hh2 = 14;
}
if (hh1 == hh2) {
playerHand = 1;
thisPair0 = hh1;
} else {
playerHand = 0;
}
bestHand = new Array();
bestHand.push(playerHand);
hc = hh1;
if (playerHand == 0) {
if (hh1 > hh2) {
bestHand.push(hh1);
bestHand.push(hh2);
} else {
bestHand.push(hh2);
bestHand.push(hh1);
hc = hh2;
}
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
dval = getVal(bestHand[1]);
handText = "HIGH CARD - " + dval;
}
if ((playerHand == 1) || ((playerhand == 0) && (pairNum0 > 0))) {
bestHand.push(thisPair0);
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
dval = getVal(bestHand[1]);
handText = ("Pair of " + dval) + "'s";
hc = hh1;
}
aString = "";
gg = 0;
while (gg < bestHand.length) {
if ((bestHand[gg].toString().substring(0, 2).length == 1) && (gg > 0)) {
aString = aString + ("0" + bestHand[gg]);
} else {
aString = aString + bestHand[gg].toString();
}
gg++;
}
aNumber = Number(aString);
pos = new Array();
if (hc == hh1) {
pos.push({loc:0, card:hh1});
pos.push({loc:1, card:hh2});
} else {
pos.push({loc:1, card:hh2});
pos.push({loc:0, card:hh1});
}
this["bestHand" + who].push({h:bestHand, t:handText, a:aNumber, p:pos, hc:hc, pair0:thisPair0, pair1:0});
trace("--besthand " + bestHand);
trace("--handtext " + handText);
trace("--anumber " + aNumber);
} else {
_local6 = 0;
while (_local6 < 8) {
if ((this["x" + _local6] != undefined) && (this["x" + _local6] != null)) {
cAr.push(this["x" + _local6]);
}
_local6++;
}
var aString = "";
var gg = 0;
var _local17 = 0;
var _local7 = 0;
var _local5 = 0;
var _local4 = 0;
var _local2 = 0;
var _local3 = 0;
_local7 = 0;
while (_local7 < (cAr.length - 4)) {
_local5 = _local7 + 1;
while (_local5 < (cAr.length - 3)) {
_local4 = _local5 + 1;
while (_local4 < (cAr.length - 2)) {
_local2 = _local4 + 1;
while (_local2 < (cAr.length - 1)) {
_local3 = _local2 + 1;
while (_local3 < cAr.length) {
hAr = new Array(cAr[_local7], cAr[_local5], cAr[_local4], cAr[_local2], cAr[_local3]);
scoreHand(hAr);
aString = "";
gg = 0;
while (gg < bestHand.length) {
if ((bestHand[gg].toString().substring(0, 2).length == 1) && (gg > 0)) {
aString = aString + ("0" + bestHand[gg]);
} else {
aString = aString + bestHand[gg].toString();
}
gg++;
}
if (aString.substring(0, 1) == 0) {
aString = aString.substring(1, aString.length);
}
aNumber = Number(aString);
pos = new Array();
pos.push({loc:_local7, card:cAr[_local7]});
pos.push({loc:_local5, card:cAr[_local5]});
pos.push({loc:_local4, card:cAr[_local4]});
pos.push({loc:_local2, card:cAr[_local2]});
pos.push({loc:_local3, card:cAr[_local3]});
this["bestHand" + who].push({h:bestHand, t:handText, a:aNumber, p:pos, hc:hc, pair0:thisPair0, pair1:thisPair1});
_local17++;
_local3++;
}
_local2++;
}
_local4++;
}
_local5++;
}
_local7++;
}
this["bestHand" + who].sortOn("a", 18);
trace(("-----FINAL HAND " + who) + " -----");
trace("h - " + this["bestHand" + who][0].h);
trace("a - " + this["bestHand" + who][0].a);
trace("");
}
}
function highlightWinningCards(who, where) {
var _local2;
if (!who) {
who = 0;
}
var _local3 = new Array();
var _local5 = new Array();
var _local10 = _root["bestHand" + who][0].h[0];
var _local6 = _root["bestHand" + who][0].hc;
var _local8 = _root["bestHand" + who][0].pair0;
var _local9 = _root["bestHand" + who][0].pair1;
var _local4 = _root["bestHand" + who][0].p;
if (_local10 == 0) {
_local2 = 0;
while (_local2 < _local4.length) {
tmpcard = getDivider(_local4[_local2].card);
tmploc = _local4[_local2].loc;
if (tmpcard == _local6) {
_local3.push(tmploc);
break;
}
_local2++;
}
}
if (_local10 == 1) {
_local2 = 0;
while (_local2 < _local4.length) {
tmpcard = getDivider(_local4[_local2].card);
tmploc = _local4[_local2].loc;
if (tmpcard == _local8) {
_local3.push(tmploc);
}
if (tmpcard == _local6) {
_local5.push(tmploc);
}
_local2++;
}
}
if (_local10 == 2) {
_local2 = 0;
while (_local2 < _local4.length) {
tmpcard = getDivider(_local4[_local2].card);
tmploc = _local4[_local2].loc;
if ((tmpcard == _local8) || (tmpcard == _local9)) {
_local3.push(tmploc);
}
if (tmpcard == _local6) {
_local5.push(tmploc);
}
_local2++;
}
}
if (_local10 == 3) {
_local2 = 0;
while (_local2 < _local4.length) {
tmpcard = getDivider(_local4[_local2].card);
tmploc = _local4[_local2].loc;
if (tmpcard == _local8) {
_local3.push(tmploc);
}
if (tmpcard == _local6) {
_local5.push(tmploc);
}
_local2++;
}
}
if (_local10 == 6) {
_local2 = 0;
while (_local2 < _local4.length) {
tmpcard = getDivider(_local4[_local2].card);
tmploc = _local4[_local2].loc;
if ((tmpcard == _local8) || (tmpcard == _local9)) {
_local3.push(tmploc);
}
if (tmpcard == _local6) {
_local5.push(tmploc);
}
_local2++;
}
}
if (_local10 == 7) {
_local2 = 0;
while (_local2 < _local4.length) {
tmpcard = getDivider(_local4[_local2].card);
tmploc = _local4[_local2].loc;
if (tmpcard == _local8) {
_local3.push(tmploc);
}
if (tmpcard == _local6) {
_local5.push(tmploc);
}
_local2++;
}
}
if ((((_local10 == 4) || (_local10 == 5)) || (_local10 == 8)) || (_local10 == 9)) {
_local2 = 0;
while (_local2 < _local4.length) {
tmploc = _local4[_local2].loc;
_local3.push(tmploc);
_local2++;
}
}
k = 0;
while (k < mygame.myhand.handPlayers.length) {
_local2 = 0;
while (_local2 < 3) {
arena[(("card_" + mygame.myhand.handPlayers[k]) + "_") + _local2].cardback._visible = true;
arena[(("card_" + mygame.myhand.handPlayers[k]) + "_") + _local2].cardback.gotoAndStop(4);
_local2++;
}
k++;
}
if (!where) {
if ((_local5[0] == 0) || (_local5[0] == 1)) {
arena[(("card_" + who) + "_") + _local5[0]].cardback.gotoAndStop(3);
} else {
arena["card_comm_" + (_local5[0] - 2)].cardback.gotoAndStop(3);
}
_local2 = 0;
while (_local2 < _local3.length) {
if ((_local3[_local2] == 0) || (_local3[_local2] == 1)) {
arena[(("card_" + who) + "_") + _local3[_local2]].cardback._visible = true;
arena[(("card_" + who) + "_") + _local3[_local2]].cardback.gotoAndStop(2);
} else {
arena["card_comm_" + (_local3[_local2] - 2)].cardback._visible = true;
arena["card_comm_" + (_local3[_local2] - 2)].cardback.gotoAndStop(2);
}
_local2++;
}
} else {
if ((_local5[0] == 0) || (_local5[0] == 1)) {
allin[(("card_" + who) + "_") + _local5[0]].cardback.gotoAndStop(3);
} else {
allin["card_comm_" + (_local5[0] - 2)].cardback.gotoAndStop(3);
}
_local2 = 0;
while (_local2 < _local3.length) {
if ((_local3[_local2] == 0) || (_local3[_local2] == 1)) {
allin[(("card_" + who) + "_") + _local3[_local2]].cardback._visible = true;
allin[(("card_" + who) + "_") + _local3[_local2]].cardback.gotoAndStop(2);
} else {
allin["card_comm_" + (_local3[_local2] - 2)].cardback._visible = true;
allin["card_comm_" + (_local3[_local2] - 2)].cardback.gotoAndStop(2);
}
_local2++;
}
}
}
function getDivider(c) {
divider = 0;
if ((c > 13) && (c < 27)) {
divider = 13;
} else if ((c > 26) && (c < 40)) {
divider = 26;
} else if (c > 39) {
divider = 39;
}
c = c - divider;
if (c == 1) {
c = 14;
}
return(c);
}
function shockMe(type, gamescore) {
myshock = new ShockwaveHubDialog(type, gamescore);
myshock.Init();
}
function ShockwaveHubDialog(type, gamescore) {
this.fName = "ShockwaveHubDialog";
this.fDefaultButton = null;
this.fObj = obj;
this.fCallback = callback;
this.fInterval = null;
this.fbDidUnload = false;
this.fStart = getTimer();
var _local2 = new Object();
_local2.showTab = type;
_local2.gameId = "pokersuperstars2web";
_local2.gameTitle = "Poker Superstars 2 Single Round";
_local2.screenWidth = 600;
_local2.screenHeight = 400;
_local2.scoreDescriptor = "Power Rank";
_local2.numPlayers = 1;
_local2.player1Score = gamescore;
_local2.player2Score = 0;
_local2.player3Score = 0;
_local2.player4Score = 0;
_level0.swHighScoreObject = _local2;
_level0.playAgain = function () {
arena.standings.sscover.gotoAndStop(2);
arena.standings.powerranking = 0;
};
System.security.allowDomain("gameblast.shockwave.com", "www.shockwave.com", "dev.shockwave.com", "staging.shockwave.com");
}
function gamePause() {
if ((pauseOn == false) && (_global.noZoneAPI == false)) {
pauseOn = true;
voltemp = vol;
vol = 0;
snd.onMute(true);
createEmptyMovieClip("stopGo", _root.pausedepth);
stopGo.attachMovie("bkgdPause", "bkgdPause", 2);
stopGo.bkgdPause.btn_resume.btn.onRelease = function () {
gamePauseOff();
};
stopGo.bkgdPause.btn_resume.btn.onPress = function () {
_root.buttonSound();
};
baseTime = getTimer();
pauseInterval = setInterval(calcZoneTime, 100);
}
}
function gamePauseOff() {
if (pauseOn == true) {
pauseOn = false;
vol = voltemp;
snd.onMute(false);
gGameStartTime = gGameStartTime + newtime;
clearInterval(pauseInterval);
if ((pauseReturnAction != "") && (pauseReturnAction != undefined)) {
mygame.myhand[pauseReturnAction]();
}
pauseReturnAction = "";
stopGo.removeMovieClip();
}
}
function calcZoneTime() {
newtime = getTimer() - baseTime;
}
function setPlayerPhoto(whop, action) {
var _local2 = action;
var _local3 = this.gPlayers["player" + whop].img;
table["pBox" + whop].player[_local3].gotoAndStop(_local2);
}
function resetAllPhotos() {
var _local4 = "playing";
var _local2 = 0;
while (_local2 < 16) {
var _local3 = this.gPlayers["player" + _local2].img;
table["pBox" + _local2].player[_local3].gotoAndStop(_local4);
_local2++;
}
}
function createMyInfoBox() {
chadHandCount++;
var _local3 = chadHandCount;
var _local2 = mygame.smallblind;
var _local4 = mygame.bigblind;
table.attachMovie("infoBox", "infoBox", _root.mygame.mydepth + 100);
table.infoBox._x = 52;
table.infoBox._y = 317;
table.infoBox.myname.text = "One Round - Hand " + _local3;
table.infoBox.mytag.text = (("Small Blind $" + _local2) + " Big Blind $") + _local4;
infoeeeInt = setInterval(hideinfobox, 3500);
}
function hideinfobox() {
table.infoBox.removeMovieClip();
clearInterval(infoeeeInt);
}
function makeStarburst(who) {
if (who) {
var _local2 = 0;
while (_local2 < 4) {
var _local1 = 0;
while (_local1 < 3) {
table["pBox" + who]["pop" + _local2]["pop" + _local1].gotoAndPlay(2);
_local1++;
}
_local2++;
}
}
}
function loadAI() {
loadMovieNum ("AIapp_final2.swf", 22);
}
function unloadAI() {
unloadMovieNum (22);
}
function getBetLevel() {
ante = prePay[betLevel][2];
bigblind = prePay[betLevel][0];
smallblind = prePay[betLevel][1];
minRaise = bigblind;
mygame.ante = ante;
mygame.smallblind = smallblind;
mygame.bigblind = bigblind;
}
function Game() {
if (isGameTimerActive == true) {
gameStartTime = getTimer();
}
Key.removeListener(listenForEnter_obj);
botsDoAll = false;
betLevel = 0;
getBetLevel();
this.ante = _root.ante;
this.bigblind = _root.bigblind;
this.smallblind = _root.smallblind;
this.mybubble = new Bubble();
this.mydepth = 0;
this.defaultBalance = 100000 /* 0x0186A0 */;
this.isNew = true;
numHandsPlayedX = 0;
numHandsPlayed = 0;
nhrecord = 0;
chadHandCount = 0;
this.finalrank = new Array("4th Place", "3rd Place", "2nd Place", "Winner");
createEmptyMovieClip("table", _root.tabledepth);
table.attachMovie("bkgdTable", "bkgdTable", this.mydepth++);
initTableMenu();
this.elimPlayers = new Array();
this.currentPlayers = new Array(0, 1, 2, 3, 4);
if (maxplayers < 5) {
this.currentPlayers[2] = "e";
}
t = new Array(0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15);
t.shuffle();
trace("t = " + t);
this.gPlayers = new Object();
var _local3 = 0;
while (_local3 < 15) {
this.gPlayers["player" + _local3] = photoArray[t[_local3]];
_local3++;
}
this.gPlayers.player3 = photoArray[7];
this.gPlayers.player3.first = _root.username;
this.gPbox = new Object();
if (maxplayers == 5) {
this.gPbox.b0 = {x:-6.7, y:-7.3, chipx:4, chipy:113, dbx:102, dby:7.2, cx:99, cy:46, bsx:128.3, bsy:94, blx:128.3, bly:83};
this.gPbox.b1 = {x:431.8, y:-4.3, chipx:350.3, chipy:7.2, dbx:536, dby:29, cx:377, cy:84, bsx:296.6, bsy:37.5, blx:286.6, bly:26.6};
this.gPbox.b2 = {x:493, y:121.8, chipx:505.6, chipy:238.4, dbx:567, dby:93, cx:440, cy:142, bsx:483.7, bsy:92.9, blx:473.7, bly:81.9};
this.gPbox.b3 = {x:384.8, y:282.4, chipx:393, chipy:218.2, dbx:490, dby:353, cx:330, cy:290, bsx:0, bsy:0, blx:442.4, bly:169};
this.gPbox.b4 = {x:3.4, y:283.4, chipx:14, chipy:220, dbx:109, dby:356, cx:107, cy:279, bsx:0, bsy:0, blx:0, bly:0};
} else {
this.gPbox.b0 = {x:11.4, y:-5.8, chipx:22, chipy:113, dbx:116, dby:94, cx:117, cy:21, bsx:-2.7, bsy:101, blx:-12.7, bly:101};
this.gPbox.b1 = {x:475.8, y:-5.8, chipx:489, chipy:113, dbx:448, dby:94, cx:421, cy:21, bsx:461, bsy:101, blx:451, bly:101};
this.gPbox.b2 = {x:493, y:121.8, chipx:505.6, chipy:238.4, dbx:567, dby:93, cx:440, cy:142, bsx:483.7, bsy:92.9, blx:473.7, bly:81.9};
this.gPbox.b3 = {x:434.8, y:283.4, chipx:443, chipy:220, dbx:406, dby:273.6, cx:380, cy:310, bsx:420, bsy:230, blx:410, bly:210};
this.gPbox.b4 = {x:11.4, y:283.4, chipx:22, chipy:220, dbx:116, dby:273.6, cx:117, cy:310, bsx:-2.7, bsy:230, blx:-12.7, bly:210};
}
this.gChip = new Object();
this.gChip.inc = 1;
this.gChip.oflow = 15;
this.gChip.defaultChips = {c100:10, c500:10, c1000:24, c5000:14, c25000:0};
this.gChip.chip0 = {x:0, y:0};
this.gChip.chip1 = {x:30, y:0};
this.gChip.chip2 = {x:60, y:0};
this.gChip.chip3 = {x:0, y:28};
this.gChip.chip4 = {x:30, y:28};
this.gChip.chip5 = {x:60, y:28};
_local3 = 0;
while (_local3 < 5) {
this.gChip["chip" + _local3].c100 = 10;
this.gChip["chip" + _local3].c500 = 10;
this.gChip["chip" + _local3].c1000 = 24;
this.gChip["chip" + _local3].c5000 = 14;
this.gChip["chip" + _local3].c25000 = 0;
_local3++;
}
this.gChip.chipD = {x:226, y:93};
this.gChip.chipD.c100 = 0;
this.gChip.chipD.c500 = 0;
this.gChip.chipD.c1000 = 0;
this.gChip.chipD.c5000 = 0;
this.gChip.chipD.c25000 = 0;
this.gChip.mchip0 = {x:0, y:0};
this.gChip.mchip1 = {x:30, y:0};
this.gChip.mchip2 = {x:60, y:0};
this.gChip.mchip3 = {x:90, y:0};
this.gChip.mchip4 = {x:120, y:0};
this.gChip.mchip5 = {x:0, y:30};
this.gChip.mchip6 = {x:30, y:30};
this.gChip.mchip7 = {x:60, y:30};
this.gChip.mchip8 = {x:90, y:30};
this.gChip.mchip9 = {x:120, y:30};
this.gChip.chipBet = {x:334.6, y:235.7};
this.gChip.chipBet.c100 = 0;
this.gChip.chipBet.c500 = 0;
this.gChip.chipBet.c1000 = 0;
this.gChip.chipBet.c5000 = 0;
this.gChip.chipBet.c25000 = 0;
this.gChip.bchip0 = {x:0, y:0};
this.gChip.bchip1 = {x:30, y:0};
this.gChip.bchip2 = {x:15, y:25};
this.gChip.bchip3 = {x:60, y:0};
this.gChip.bchip4 = {x:45, y:25};
this.gChip.bchip5 = {x:75, y:25};
this.gBubble = new Object();
if (maxplayers == 5) {
this.gBubble.b0 = {sx:61.8, sy:69, lx:61.8, ly:58, tri:1};
this.gBubble.b1 = {sx:417.2, sy:67.9, lx:407.2, ly:56.9, tri:1};
this.gBubble.b2 = {sx:396, sy:155, lx:375, ly:144, tri:2};
this.gBubble.b3 = {sx:250, sy:315, lx:230, ly:304, tri:3};
this.gBubble.b4 = {sx:30, sy:232, lx:20, ly:212, tri:3};
} else {
this.gBubble.b0 = {sx:-2.7, sy:101, lx:-12.7, ly:101, tri:1};
this.gBubble.b1 = {sx:461, sy:101, lx:451, ly:101, tri:1};
this.gBubble.b3 = {sx:420, sy:230, lx:410, ly:210, tri:3};
this.gBubble.b4 = {sx:-2.7, sy:230, lx:-12.7, ly:210, tri:3};
}
this.gBubble.b5 = {sx:230, sy:12.6, lx:220, ly:1.6, tri:1};
this.gBubble.b6 = {sx:230, sy:12.6, lx:220, ly:1.6, tri:1};
this.gBubble.b10 = {sx:230, sy:320.6, lx:230, ly:320.6, tri:3};
this.gBubble.bspecial = {specialx:207.5, specialy:332.8, lx:0, ly:0, tri:0};
var _local4 = new Array();
_local3 = 0;
while (_local3 < this.currentPlayers.length) {
if (this.currentPlayers[_local3] != "e") {
_local4.push(_local3);
}
_local3++;
}
_local4.shuffle();
table.attachMovie("dealercontrol", "dealerButton", this.mydepth++);
this.dealer = _local4[0];
trace("DEALER #1 = " + this.dealer);
this.placeDealerButton(this.currentPlayers[this.dealer]);
table.dealerButton._visible = false;
this.introDialog();
}
function sortChips() {
p.sortOn("amt", 18);
}
function getStacks(maxOflow) {
if (!maxOflow) {
maxOflow = 1;
}
checkAgain = false;
numStacks = 1;
numOflow = 0;
var _local1 = 0;
while (_local1 < 5) {
if (p[_local1].amt > 0) {
numStacks++;
}
_local1++;
}
_local1 = 0;
while (_local1 < 5) {
if (p[_local1].amt > oflow) {
if (numStacks >= 6) {
numOflow++;
} else {
numStacks++;
}
}
_local1++;
}
if (numOflow >= maxOflow) {
_local1 = 3;
while (_local1 > -1) {
if (p[_local1].amt > oflow) {
convertChip(_local1);
numOflow = 0;
checkAgain = true;
break;
}
_local1--;
}
}
}
function convertChip(chip) {
numToGrab = p[chip].amt - oflow;
if (numToGrab <= p[chip].tonext) {
numToGrab = p[chip].tonext;
} else {
ok = false;
while (ok == false) {
var _local2 = numToGrab / p[chip].tonext;
var _local1 = Math.round(numToGrab / p[chip].tonext);
if (_local2 != _local1) {
numToGrab++;
} else {
ok = true;
}
}
}
p[chip].amt = p[chip].amt - numToGrab;
p[chip + 1].amt = p[chip + 1].amt + (numToGrab / p[chip].tonext);
}
function TheHand(ds, hp, firsthand) {
if (!nhrecord) {
nhrecord = 1;
} else {
nhrecord++;
}
if (((((((((nhrecord == blindincrement) || (nhrecord == (blindincrement * 2))) || (nhrecord == (blindincrement * 3))) || (nhrecord == (blindincrement * 4))) || (nhrecord == (blindincrement * 5))) || (nhrecord == (blindincrement * 6))) || (nhrecord == (blindincrement * 7))) || (nhrecord == (blindincrement * 8))) || (nhrecord == (blindincrement * 9))) {
betLevel++;
getBetLevel();
}
if (!ntrecord) {
ntrecord = getTimer();
}
if (nhrecord == 1) {
DoScoreBroadcast();
}
var _local3;
yup = false;
if (!xtraPot) {
xtraPot = 0;
}
this.basicPot = xtraPot;
this.potStore = new Array(0, 0, 0, 0, 0);
this.AllInPool = new Array(0, 0, 0, 0, 0);
this.currentpot = 0;
this.dealerSlot = ds;
this.handPlayers = new Array();
_local3 = 0;
while (_local3 < hp.length) {
this.handPlayers[_local3] = hp[_local3];
table["chipBox" + _local3].enchilada = 0;
table["chipBox" + _local3].mybet = 0;
table["pBox" + _local3].mybet = 0;
_local3++;
}
trace(this.handPlayers);
trace("Starting a new hand!");
this.mydepth = 0;
this.dealType = new Array("flop", "turn", "river", "end");
this.cardOffsetX = 10;
this.cardOffsetY = 3;
this.betStop = this.dealerSlot;
this.betStart = this.returnNextPlayer(this.handPlayers[this.dealerSlot]);
this.currentBet = 0;
this.commcardcount = 0;
this.AllInActive = 0;
this.numBettors = 0;
this.numRaises = 0;
createEmptyMovieClip("arena", _root.rounddepth);
this.makePot();
if (firsthand) {
arena.attachMovie("btn_deal", "btn_deal", this.mydepth++);
if (maxplayers == 5) {
arena.btn_deal._x = 255;
arena.btn_deal._y = 245;
} else {
arena.btn_deal._x = 255;
arena.btn_deal._y = 255;
}
arena.btn_deal.btn.onRelease = function () {
createMyInfoBox();
StopMusic();
PlayMusic("MUSIC_PLAY", _root.volM);
table.dealerButton._visible = true;
_root.mygame.myhand.postAnte();
arena.btn_standings.removeMovieClip();
this._parent.removeMovieClip();
};
arena.btn_deal.btn.onPress = function () {
_root.buttonSound();
};
arena.attachMovie("btn_standings", "btn_standings", this.mydepth++);
if (maxplayers == 5) {
arena.btn_standings._x = 255;
arena.btn_standings._y = 280;
} else {
arena.btn_standings._x = 255;
arena.btn_standings._y = 290;
}
arena.btn_standings.btn.onRelease = function () {
mygame.myhand.getStandings();
};
arena.btn_standings.btn.onPress = function () {
_root.buttonSound();
};
mygame.mybubble.makeBubble(5, "Ready to Play?", "Press Deal", 1, 1200);
intID0000 = setInterval(dealsound, 900);
} else {
_local3 = 0;
while (_local3 < this.handPlayers.length) {
table["pBox" + _local3].cover._visible = false;
if ((mygame.gChip["chip" + _local3].c25000 > 0) && ((((mygame.gChip["chip" + _local3].c5000 == 0) || (mygame.gChip["chip" + _local3].c1000 == 0)) || (mygame.gChip["chip" + _local3].c500 == 0)) || (mygame.gChip["chip" + _local3].c100 == 0))) {
mygame.colorUpChips(_local3);
}
_local3++;
}
mygame.moveDealerButton(this.dealerSlot);
PlaySoundEffect("SOUND_SHUFFLE");
this.postAnte();
}
}
function betBoxIbutton(str) {
PlaySoundEffect("SOUND_CHIP2");
samt = Number(str.substring(1, 8));
if ((arena.betBox.bal - samt) < (callamount + minRaise)) {
ok = false;
PlaySoundEffect("SOUND_ATTENTION3");
} else {
ok = true;
PlaySoundEffect("SOUND_CHIP2");
mygame.updateBalance(3, samt, "pos");
mygame.addClickables(3);
arena.betBox.bal = arena.betBox.bal - samt;
mygame.gChip.chipBet[str] = mygame.gChip.chipBet[str] - 1;
arena.betBox.balance.text = _root.balanceFormat(arena.betBox.bal - callamount, 0, ",");
}
}
function chipBoxIbutton(str) {
PlaySoundEffect("SOUND_CHIP2");
samt = Number(str.substring(1, 8));
mygame.myhand.addToBet(samt);
arena.betBox.balance.text = _root.balanceFormat(arena.betBox.bal - callamount, 0, ",");
table.chipBox3.mybalance = table.chipBox3.mybalance - samt;
table.chipBox3.enchilada = table.chipBox3.enchilada - samt;
mygame.gChip.chip3[str] = mygame.gChip.chip3[str] - 1;
table.chipBox3.balance.text = _root.balanceFormat(table.chipBox3.mybalance, 0, ",");
}
function initAI(who) {
_level22.initAI(who);
arena.attachMovie("aiman", "aiman" + who, mygame.myhand.mydepth++);
arena["aiman" + who].who = who;
arena["aiman" + who].gotoAndStop(2);
}
function checkForTies() {
numTies = 0;
i = 0;
while (i < wArray.length) {
if (wArray[i].a == wArray[i + 1].a) {
numTies++;
} else {
i = 500;
break;
}
i++;
}
if (numTies > 0) {
return(true);
}
return(false);
}
function getWinner(whoArray) {
wArray = new Array();
var _local2 = 0;
while (_local2 < whoArray.length) {
wArray.push({seat:whoArray[_local2], a:_root["bestHand" + whoArray[_local2]][0].a});
_local2++;
}
wArray.sortOn("a", 18);
who = wArray[0].seat;
winnerName = table["pBox" + who].myname.text;
winnings = arena.potBox.bal;
count = 0;
intID0011 = setInterval(winScript, 1750);
trace((("WINNER = " + wArray[0].seat) + " NAME = ") + table["pBox" + wArray[0].seat].myname.text);
trace("HAND = " + _root["bestHand" + wArray[0].seat][0].h);
}
function winScript() {
if (pauseOn == false) {
if (count == 0) {
PlaySoundEffect("SOUND_CHEER");
mygame.mybubble.makeBubble(5, "And the winner is...", "blank", 1, 0);
} else if (count == 1) {
PlaySoundEffect("SOUND_CLAP2");
mygame.mybubble.makeBubble(5, winnerName, "blank", 1, 0);
makeStarburst(who);
} else if (count == 2) {
PlaySoundEffect("SOUND_CLAP3");
subwinnings = winnings + table["chipBox" + who].enchilada;
trace(((subwinnings + " -- ") + table["chipBox" + who].enchilada) + " winner stuf");
mygame.updateBalance(who, arena.potBox.bal, "pos");
var _local5;
var _local3 = 0;
while (_local3 < mygame.myhand.handPlayers.length) {
_local5 = table["chipBox" + _local3].enchilada;
if (_local5 < 0) {
_local5 = _local5 - (_local5 * 2);
}
table["pBox" + _local3].statusBox.display.text = "Lost " + _root.balanceFormat(_local5, 0, ",");
table["pBox" + _local3].statusBox.colorBox.gotoAndStop(1);
_local3++;
}
table["chipBox" + who]._visible = true;
table["pBox" + who].statusBox.display.text = "Won " + _root.balanceFormat(subwinnings, 0, ",");
table["pBox" + who].statusBox.colorBox.gotoAndStop(3);
trace("--------------");
trace("WINNERS BALANCE " + table["chipBox" + who].mybalance);
arena.potBox.bal = 0;
arena.potBox.removeMovieClip();
DoScoreBroadcast();
} else if (count == 3) {
PlaySoundEffect("SOUND_CLAP1");
mygame.mybubble.makeBubble(6, winnerName + " wins", _root.balanceFormat(subwinnings, 0, ","), 3, 0);
}
count++;
if (count >= 5) {
var _local7 = _root.bigblind;
var _local8 = _root.ante;
if (((((((((nhrecord == blindincrement) || (nhrecord == (blindincrement * 2))) || (nhrecord == (blindincrement * 3))) || (nhrecord == (blindincrement * 4))) || (nhrecord == (blindincrement * 5))) || (nhrecord == (blindincrement * 6))) || (nhrecord == (blindincrement * 7))) || (nhrecord == (blindincrement * 8))) || (nhrecord == (blindincrement * 9))) {
var _local9 = betLevel + 1;
_local7 = prePay[_local9][0];
_local8 = prePay[_local9][2];
}
var _local6 = new Array();
var _local4 = 0;
while (_local4 < mygame.myhand.handPlayers.length) {
if ((table["chipBox" + _local4].mybalance <= (_local7 + _local8)) && (table["chipBox" + _local4].mybalance != undefined)) {
_local6.push(_local4);
}
_local4++;
}
if (_local6.length > 0) {
sayGoodbye(_local6);
clearInterval(intID0011);
} else {
trace("Got here");
if (_global.noZoneAPI == true) {
trace("no zone");
trace(isGameTimerActive);
if (isGameTimerActive == true) {
var _local10 = getTimer();
if (_local10 > (gameStartTime + gametimer)) {
if (timeraction == "allin") {
botsDoAll = true;
getDealStandings();
} else {
tableMenu.removeMovieClip();
mygame.myhand.getStandings("expired");
}
} else {
getDealStandings();
}
} else {
trace((maxHandsAllowed + " === ") + numHandsPlayed);
if (maxHandsAllowed > 0) {
numHandsPlayed++;
if (numHandsPlayed == maxHandsAllowed) {
if (timeraction == "allin") {
botsDoAll = true;
getDealStandings();
} else {
tableMenu.removeMovieClip();
mygame.myhand.getStandings("maxed");
}
} else {
getDealStandings();
}
} else {
getDealStandings();
}
}
} else if (gamebreaker > (numHandsPlayedX + 1)) {
numHandsPlayedX++;
numHandsPlayed++;
getDealStandings();
} else {
numHandsPlayedX = 0;
DoGameBreak();
}
clearInterval(intID0011);
}
}
}
}
function getDealStandings() {
PlaySoundEffect("SOUND_SHUFFLE");
var _local3 = 0;
while (_local3 < mygame.currentPlayers.length) {
if (mygame.currentPlayers[_local3] != "e") {
table["chipBox" + _local3]._visible = true;
}
_local3++;
}
arena.attachMovie("btn_deal", "btn_deal", mygame.myhand.mydepth++);
if (maxplayers == 5) {
arena.btn_deal._x = 175;
arena.btn_deal._y = 283;
} else {
arena.btn_deal._x = 255;
arena.btn_deal._y = 255;
}
arena.btn_deal.btn.onRelease = function () {
killTheHand();
var _local3 = mygame.nextDealer(mygame.dealer);
mygame.dealer = _local3;
_root.mygame.myhand = new TheHand(_local3, mygame.currentPlayers);
createMyInfoBox();
arena.btn_standings.removeMovieClip();
this.removeMovieClip();
};
arena.btn_deal.btn.onPress = function () {
_root.buttonSound();
};
arena.attachMovie("btn_standings", "btn_standings", mygame.myhand.mydepth++);
if (maxplayers == 5) {
arena.btn_standings._x = 175;
arena.btn_standings._y = 316;
} else {
arena.btn_standings._x = 255;
arena.btn_standings._y = 290;
}
arena.btn_standings.btn.onRelease = function () {
_root.hideFlopTurnRiver();
mygame.mybubble.killBubble(5);
mygame.mybubble.killBubble(6);
mygame.myhand.getStandings();
};
arena.btn_standings.btn.onPress = function () {
_root.buttonSound();
};
}
function hideFlopTurnRiver() {
arena.aturn._visible = false;
arena.ariver._visible = false;
arena.aflop._visible = false;
}
function showFlopTurnRiver() {
arena.aturn._visible = true;
arena.ariver._visible = true;
arena.aflop._visible = true;
}
function killTheHand() {
delete playerKill;
delete gbcount;
delete pkcount;
delete mytry;
delete playerIsInTheGame;
mygame.gChip.chipD.c100 = 0;
mygame.gChip.chipD.c500 = 0;
mygame.gChip.chipD.c1000 = 0;
mygame.gChip.chipD.c5000 = 0;
mygame.gChip.chipD.c25000 = 0;
delete mygame.myhand;
mygame.mybubble.killBubble(5);
mygame.mybubble.killBubble(6);
arena.removeMovieClip();
}
function killTheGame(type) {
nhrecord = 0;
ntrecord = getTimer();
clearInterval(gijoe);
clearInterval(intID0000);
clearInterval(intID0001);
clearInterval(intID0002);
clearInterval(intID0003);
clearInterval(intID0004);
clearInterval(intID0005);
clearInterval(intID0006);
clearInterval(intID0007);
clearInterval(intID0008);
clearInterval(intID0009);
clearInterval(intID0010);
clearInterval(intID00011);
clearInterval(intID00015);
clearInterval(intID00016);
clearInterval(intID00017);
clearInterval(intID00018);
clearInterval(infoeeeInt);
clearInterval(killme);
trace("killing game now");
allin.removeMovieClip();
mygame.mybubble.killBubble(5);
mygame.mybubble.killBubble(6);
mygame.mybubble.killBubble(10);
killTheHand();
unloadAI();
arena.aaturn.removeMovieClip();
arena.aariver.removeMovieClip();
arena.aaflop.removeMovieClip();
table.aturn.removeMovieClip();
table.ariver.removeMovieClip();
table.aflop.removeMovieClip();
arena.standings.removeMovieClip();
table.removeMovieClip();
tableMenu.removeMovieClip();
delete mygame;
delete ideal;
delete numOflow;
delete numStacks;
delete xtraPot;
delete p;
delete mycontinue;
delete count;
delete cardcount;
delete cc;
delete cb;
delete callamount;
delete amt;
delete ii;
delete faction;
delete aibet;
delete inc;
delete num;
delete toinc;
delete aiaction;
delete k;
delete myallin;
delete x0;
delete x1;
delete x2;
delete x3;
delete x4;
delete x5;
delete x6;
delete x7;
delete bestHand0;
delete cAr;
delete hAr;
delete ycard1;
delete ycard2;
delete ycard3;
delete ycard4;
delete ycard5;
delete ycard6;
delete ycard7;
delete yz1;
delete yz2;
delete yz3;
delete yz4;
delete yz5;
delete yz6;
delete yz7;
delete playerHand;
delete pairNum0;
delete pairNum1;
delete straight;
delete flush;
delete hc;
delete hh1;
delete hh2;
delete hh3;
delete hh4;
delete hh5;
delete thisPair0;
delete thisPair1;
delete bestHand;
delete dval;
delete handText;
delete aNumber;
delete pos;
delete bestHand1;
delete wom0;
delete wom2;
delete wom1;
delete bestHand2;
delete bestHand3;
delete bestHand4;
delete bestHand5;
delete wom;
delete dval2;
delete wArray;
delete numTies;
delete tie;
delete mywho;
delete winnerName;
delete winnerLastName;
delete winnings;
delete divider;
delete tmpcard;
delete tmploc;
delete who;
delete cashback;
delete mylost;
delete origmylost;
delete killme;
delete finalscore;
delete totalTimePlayed;
delete powerranking;
delete myrank;
delete attachNOchips;
delete amountToCall;
delete adjustedWinnings;
delete adjustedWinnings2;
loadAI();
trace(type);
if (type == "defer") {
stopAllSounds();
initMenu(true, "sound");
} else if (type == "new") {
mygame = new Game();
} else {
initMenu(true, "nosound");
}
}
function runVersionCheck() {
var _local5 = 7;
var _local2 = System.capabilities.version;
var _local6 = _local2.length;
var _local4 = _local2.indexOf(" ");
var _local3 = _local2.substr(_local4 + 1, _local2.length);
trace(_local3);
var _local1 = _local3.substring(0, _local3.length - (_local3.length - 1));
trace(_local1);
_local1 = Number(_local1);
trace(_local1);
if (_local1 < _local5) {
mywindow = createEmptyMovieClip("errorMenu", 10);
mywindow.attachMovie("bkgdVersionCheck", "vc", 10);
mywindow.vc.btn_okay.btn.onRelease = function () {
dload = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
getURL (dload, _blank);
};
} else {
initLoader();
}
}
function initAllin() {
myallin = new AllinScreen();
}
myversion = "v1.01.02";
Array.prototype.shuffle = function () {
var _local2 = this.length;
while (_local2) {
var _local3 = random(_local2);
_local2--;
var _local4 = this[_local2];
this[_local2] = this[_local3];
this[_local3] = _local4;
}
};
MovieClip.prototype.fadeTo = function (v_alpha, vel, type) {
this.onEnterFrame = function () {
var _local2 = this._alpha;
if (type == "out") {
this._alpha = this._alpha - ((this._alpha - v_alpha) / vel);
if ((Math.abs(this._alpha - v_alpha) < 1) || (_local2 == this._alpha)) {
this._alpha = v_alpha;
this.onEnterFrame = null;
}
}
if (type == "in") {
this._alpha = this._alpha + ((this._alpha + v_alpha) / vel);
if ((Math.abs(this._alpha + v_alpha) > 199) || (_local2 == this._alpha)) {
this._alpha = v_alpha;
this.onEnterFrame = null;
}
}
};
};
MovieClip.prototype.goToPoint = function (x, y, vel, kill) {
var _local4;
var _local3;
var _local6;
var _local5;
var movX;
var movY;
((!vel) ? (vel = 10) : null);
_local4 = this._x;
_local3 = this._y;
_local6 = Math.round(x - _local4);
_local5 = Math.round(y - _local3);
movX = _local6 / vel;
movY = _local5 / vel;
var movetype = 0;
if ((movX < 0) && (movY < 0)) {
movetype = 1;
}
if ((movX > 0) && (movY < 0)) {
movetype = 2;
}
if ((movX > 0) && (movY > 0)) {
movetype = 3;
}
if ((movX < 0) && (movY > 0)) {
movetype = 4;
}
var movecount = 0;
this.onEnterFrame = function () {
endthis = false;
((this._y != y) ? ((this._y = this._y + movY)) : null);
((this._x != x) ? ((this._x = this._x + movX)) : null);
if (((movetype == 1) && (this._y <= y)) && (this._x <= x)) {
endthis = true;
}
if (((movetype == 2) && (this._y <= y)) && (this._x >= x)) {
endthis = true;
}
if (((movetype == 3) && (this._y >= y)) && (this._x >= x)) {
endthis = true;
}
if (((movetype == 4) && (this._y >= y)) && (this._x <= x)) {
endthis = true;
}
movecount++;
if (movecount > 25) {
endthis = true;
}
if (endthis == true) {
this._x = x;
this._y = y;
if (kill == true) {
this.removeMovieClip();
}
this.onEnterFrame = null;
}
};
};
balanceFormat = function (uknumValue, uknPlaces, strSeparator) {
strResult = "";
var _local6 = false;
var _local9 = false;
if (typeof(uknumValue) == "string") {
var _local4 = parseFloat(uknumValue);
if (isNaN(_local4)) {
_local6 = true;
}
} else if (typeof(uknumValue) == "number") {
var _local4 = uknumValue;
} else {
_local6 = true;
}
if (typeof(uknPlaces) == "string") {
var _local5 = (((uknPlaces == "") || (uknPlaces == null)) ? 0 : (parseInt(uknPlaces)));
if (isNaN(_local5)) {
_local9 = true;
}
} else if (typeof(uknPlaces) == "number") {
var _local5 = uknPlaces;
} else {
_local9 = true;
}
if (_local6 || (_local9)) {
strResult = ((_local6 && (_local9)) ? "bad Value & bad Places" : "");
strResult = ((!_local6) ? "bad Places" : "bad Value");
} else {
var _local12 = Math.pow(10, _local5);
var _local4 = Math.round(_local4 * _local12);
var _local10 = ((_local5 > 0) ? ("." + String(_local4).substr(String(_local4).length - _local5)) : "");
var _local3 = String(_local4).substr(0, String(_local4).length - _local5);
strValue = String(parseFloat(strValue));
var _local2 = _local3.length;
numTriple = Math.floor((_local2 - 1) / 3);
numRemainder = ((_local2 - 1) % 3) + 1;
var _local1 = 0;
while (_local1 < numTriple) {
strResult = (strSeparator + _local3.substr(_local2 - (3 * (_local1 + 1)), 3)) + strResult;
_local1++;
}
if (numRemainder) {
strResult = _local3.substr(0, numRemainder) + strResult;
}
if (_local5 && (_local10.length)) {
strResult = ((strResult == "") ? "0" : (strResult));
strResult = strResult + _local10;
}
}
return("$" + strResult);
};
idealChips = function (amt) {
var _local4 = new Array(0, 0, 0, 0, 0);
var _local2 = amt;
var _local3 = 0;
if (_local2 >= 25000) {
_local3 = 0;
var _local1 = 25000;
while (_local1 < (_local2 + 1)) {
if (_local2 >= _local1) {
_local3++;
}
_local1 = _local1 + 25000;
}
_local4[4] = _local3;
_local2 = _local2 - (25000 * _local3);
}
if ((_local2 >= 5000) && (_local2 < 25000)) {
_local3 = 0;
var _local1 = 5000;
while (_local1 < 25000) {
if (_local2 >= _local1) {
_local3++;
}
_local1 = _local1 + 5000;
}
_local4[3] = _local3;
_local2 = _local2 - (5000 * _local3);
}
if ((_local2 >= 1000) && (_local2 < 5000)) {
_local3 = 0;
var _local1 = 1000;
while (_local1 < 5000) {
if (_local2 >= _local1) {
_local3++;
}
_local1 = _local1 + 1000;
}
_local4[2] = _local3;
_local2 = _local2 - (1000 * _local3);
}
if ((_local2 >= 500) && (_local2 < 1000)) {
_local4[1] = 1;
_local2 = _local2 - 500;
}
if ((_local2 >= 100) && (_local2 < 500)) {
_local3 = 0;
var _local1 = 100;
while (_local1 < 500) {
if (_local2 >= _local1) {
_local3++;
}
_local1 = _local1 + 100;
}
_local4[0] = _local3;
_local2 = _local2 - (_local3 * 100);
}
return(_local4);
};
PlaySoundEffect = function (snd) {
_root.snd.PlaySoundEffect(snd, vol);
};
PlayMusic = function (snd) {
_root.snd.PlayMusic(snd, volM);
};
StopMusic = function (snd) {
_root.snd.StopMusic();
};
SetMusicVolume = function () {
_root.snd.SetMusicVolume(volM);
};
_root.gFake = _global.noZoneAPI;
_root.gBreakId = 1;
_root.gGameStartTime = getTimer();
_root.settings = new XML();
_root.settings.getSetting = function (what) {
var _local5 = this.childNodes;
var _local6 = _local5.length;
var _local2 = 0;
while (_local2 < _local6) {
var _local3 = _local5[_local2].nodeName;
var _local4 = _local5[_local2].childNodes[0].nodeValue;
if (what == _local3) {
return(_local4);
}
_local2++;
}
return(null);
};
_root.settings.onLoad = function (bSuccess) {
if (bSuccess) {
var _local3 = this.getSetting("scorebroadcastinterval");
if (_local3 != null) {
_global.scorebroadcastinterval = _local3;
}
_local3 = this.getSetting("logo");
if (_local3 != null) {
_global.logo = _local3;
}
_local3 = this.getSetting("file_path");
if (_local3 != null) {
mypath = _local3 + "help.txt";
}
_local3 = this.getSetting("maxlevels");
if (_local3 != null) {
gamebreaker = Number(_local3);
}
_local3 = this.getSetting("logobufferx");
if (_local3 != null) {
logobufferx = Number(_local3);
}
_local3 = this.getSetting("logobuffery");
if (_local3 != null) {
logobuffery = Number(_local3);
}
_local3 = this.getSetting("blindincrement");
if (_local3 != null) {
blindincrement = Number(_local3);
}
_local3 = this.getSetting("gametimer");
if (_local3 != null) {
gametimer = Number(_local3);
}
_local3 = this.getSetting("timertype");
if (_local3 != null) {
timertype = _local3;
if (timertype == "hands") {
maxHandsAllowed = gametimer;
} else {
gametimer = gametimer * 1000;
isGameTimerActive = true;
}
}
_local3 = this.getSetting("timeraction");
if (_local3 != null) {
timeraction = _local3;
}
_local3 = this.getSetting("download");
if (_local3 != null) {
_global.download = _local3;
} else {
_global.realmode = true;
}
_local3 = this.getSetting("downloadtype");
if (_local3 != null) {
_global.downloadtype = _local3;
}
_local3 = this.getSetting("shockwave");
if (_local3 != null) {
_global.noZoneAPI = true;
_global.shockwave = true;
}
_local3 = this.getSetting("shockcheat");
if (_local3 != null) {
shockcheat = true;
}
_local3 = this.getSetting("zone");
if (_local3 != null) {
_global.noZoneAPI = false;
_global.realmode = false;
} else {
_global.noZoneAPI = true;
}
}
if (_global.noZoneAPI == true) {
initSplashScreen(_global.logo);
} else {
initSplashScreen(_global.logo, true);
}
};
clearInterval(hubTimer);
Bubble.prototype.makeBubble = function (who, msg0, msg1, mycolor, fader) {
if ((((who == 5) || (who == 6)) || (who == 10)) || (who == "special")) {
PlaySoundEffect("SOUND_ATTENTION4");
this.killBubble(who);
}
var _local4 = "";
if (msg1 != "blank") {
_local4 = "l";
} else {
_local4 = "s";
}
if (who == "special") {
_local4 = "special";
}
var _local5 = mygame.gBubble["b" + who].tri;
var _local7 = mygame.gBubble["b" + who][_local4 + "x"];
var _local6 = mygame.gBubble["b" + who][_local4 + "y"];
bubbles.attachMovie("bubble" + _local4, "bubble" + who, this.mydepth++);
bubbles["bubble" + who]._x = _local7;
bubbles["bubble" + who]._y = _local6;
bubbles["bubble" + who].msg0.text = msg0;
bubbles["bubble" + who].msg1.text = msg1;
var _local2 = 0;
while (_local2 < 4) {
bubbles["bubble" + who]["t" + _local2]._visible = false;
_local2++;
}
bubbles["bubble" + who]["t" + _local5]._visible = true;
bubbles["bubble" + who]["t" + _local5].gotoAndStop(mycolor);
bubbles["bubble" + who].gotoAndStop(mycolor);
if (fader > 0) {
this.fadeBubble(who, fader);
}
};
Bubble.prototype.fadeBubble = function (who, wait) {
bubbles["bubble" + who].onEnterFrame = function () {
bubbles["bubble" + who].wait = wait;
if (!bubbles["bubble" + who].start) {
bubbles["bubble" + who].start = getTimer();
}
if ((bubbles["bubble" + who].start + bubbles["bubble" + who].wait) < getTimer()) {
bubbles["bubble" + who]._alpha = bubbles["bubble" + who]._alpha - 34;
if (bubbles["bubble" + who]._alpha <= 0) {
bubbles["bubble" + who].removeMovieClip();
}
}
};
};
Bubble.prototype.killBubble = function (who) {
if (who) {
bubbles["bubble" + who].removeMovieClip();
} else {
var _local1 = 0;
while (_local1 < 7) {
bubbles["bubble" + _local1].removeMovieClip();
_local1++;
}
}
};
scoreHand = function (hand) {
var i;
i = 0;
while (i < 7) {
var divider = 0;
var suit = 1;
if ((hand[i] > 13) && (hand[i] < 27)) {
suit = 2;
divider = 13;
} else if ((hand[i] > 26) && (hand[i] < 40)) {
suit = 3;
divider = 26;
} else if (hand[i] > 39) {
suit = 4;
divider = 39;
}
this["ycard" + (i + 1)] = hand[i] - divider;
this["yz" + (i + 1)] = suit;
i++;
}
i = 1;
while (i < 6) {
if (this["ycard" + i] == 1) {
this["ycard" + i] = 14;
}
i++;
}
var sort = 0;
while (sort == 0) {
sort = 1;
var j = 1;
var tmp = 0;
while (j < 5) {
if (eval ("ycard" + j) > eval ("ycard" + (j + 1))) {
sort = 0;
tmp = eval ("ycard" + j);
Set("ycard" + j, eval ("ycard" + (j + 1)));
Set("ycard" + (j + 1), tmp);
tmp = eval ("yz" + j);
Set("yz" + j, eval ("yz" + (j + 1)));
Set("yz" + (j + 1), tmp);
}
j = j + 1;
}
}
playerHand = 0;
pairNum0 = 0;
pairNum1 = 0;
i = 2;
var u0 = 0;
var u1 = 0;
var un = 0;
while (i < 6) {
if (eval ("ycard" + i) == eval ("ycard" + (i - 1))) {
Set("u" + un, eval ("u" + un) + 1);
Set("pairNum" + un, eval ("ycard" + i));
} else if (eval ("u" + un) > 0) {
un = un + 1;
}
i = i + 1;
}
if (u0 == 3) {
playerHand = 7;
}
if (u0 == 2) {
playerHand = 3;
}
if (u0 == 1) {
playerHand = 1;
if ((_root.gamemode == 1) && (pairNum0 < 11)) {
playerHand = 0;
}
}
if (((u0 == 2) && (u1 == 1)) || ((u0 == 1) && (u1 == 2))) {
if (u0 == 2) {
tmpPN = pairNum0;
tmpPN2 = pairNum1;
} else {
tmpPN = pairNum1;
tmpPN2 = pairNum0;
}
pairNum0 = tmpPN;
pairNum1 = tmpPN2;
playerHand = 6;
}
if ((u0 == 1) && (u1 == 1)) {
playerHand = 2;
}
i = 2;
straight = 1;
while (i < 6) {
if (eval ("ycard" + i) != (eval ("ycard" + (i - 1)) + 1)) {
straight = 0;
}
i = i + 1;
}
if ((straight == 1) || (((((ycard5 == 14) && (ycard2 == 3)) && (ycard3 == 4)) && (ycard4 == 5)) && (ycard1 == 2))) {
straight = 1;
playerHand = 4;
}
i = 2;
flush = 1;
while (i < 6) {
if (eval ("yz" + i) != eval ("yz" + (i - 1))) {
flush = 0;
}
i = i + 1;
}
if (flush == 1) {
playerHand = 5;
}
if ((straight == 1) && (flush == 1)) {
playerHand = 8;
}
if ((((straight == 1) && (flush == 1)) && (ycard1 == 10)) && (ycard5 == 14)) {
playerHand = 9;
}
notateHand();
};
notateHand = function () {
var i;
var a;
hc = 0;
hh1 = ycard1;
hh2 = ycard2;
hh3 = ycard3;
hh4 = ycard4;
hh5 = ycard5;
thisPair0 = pairNum0;
thisPair1 = pairNum1;
bestHand = new Array();
bestHand.push(playerHand);
if (playerHand == 0) {
i = 5;
while (i > 0) {
bestHand.push(this["hh" + i]);
i--;
}
dval = getVal(bestHand[1]);
handText = "HIGH CARD - " + dval;
hc = hh5;
}
if (playerHand == 1) {
a = 0;
i = 1;
while (i < 6) {
if (eval ("hh" + i) != thisPair0) {
Set("wom" + a, eval ("hh" + i));
a = a + 1;
}
i++;
}
bestHand.push(thisPair0);
bestHand.push(wom2);
bestHand.push(wom1);
bestHand.push(wom0);
bestHand.push(0);
dval = getVal(bestHand[1]);
handText = ("Pair of " + dval) + "'s";
hc = wom2;
}
if (playerHand == 2) {
i = 1;
while (i < 6) {
if ((eval ("hh" + i) != thisPair0) and (eval ("hh" + i) != thisPair1)) {
wom = eval ("hh" + i);
}
i++;
}
if (thisPair0 > thisPair1) {
bestHand.push(thisPair0);
bestHand.push(thisPair1);
} else {
bestHand.push(thisPair1);
bestHand.push(thisPair0);
hc = thisPair1;
thisPair1 = thisPair0;
thisPair0 = hc;
}
bestHand.push(wom);
bestHand.push(0);
bestHand.push(0);
dval = getVal(bestHand[1]);
dval2 = getVal(bestHand[2]);
handText = ((("Two Pair " + dval) + "'s & ") + dval2) + "'s";
hc = wom;
}
if (playerHand == 3) {
a = 0;
i = 1;
while (i < 6) {
if (eval ("hh" + i) != thisPair0) {
Set("wom" + a, eval ("hh" + i));
a = a + 1;
}
i++;
}
bestHand.push(thisPair0);
bestHand.push(wom1);
bestHand.push(wom0);
bestHand.push(0);
bestHand.push(0);
dval = getVal(bestHand[1]);
handText = ("Three of a Kind " + dval) + "'s";
hc = wom1;
}
if (playerHand == 4) {
if ((hh5 == 14) && (hh1 == 2)) {
bestHand.push(hh4);
} else {
bestHand.push(hh5);
}
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
dval = getVal(bestHand[1]);
handText = dval + " High Straight";
hc = hh5;
}
if (playerHand == 5) {
i = 5;
while (i > 0) {
bestHand.push(this["hh" + i]);
i--;
}
dval = getVal(bestHand[1]);
handText = dval + " High Flush";
hc = hh5;
}
if (playerHand == 6) {
wom = 0;
i = 1;
while (i < 6) {
if (eval ("hh" + i) == thisPair0) {
wom = wom + 1;
}
i++;
}
if (wom == 3) {
bestHand.push(thisPair0);
bestHand.push(thisPair1);
hc = thisPair0;
}
if (wom == 2) {
bestHand.push(thisPair1);
bestHand.push(thisPair0);
hc = thisPair1;
thisPair1 = thisPair0;
thisPair0 = hc;
}
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
dval = getVal(bestHand[1]);
dval2 = getVal(bestHand[2]);
handText = ((("Full House " + dval) + "'s over ") + dval2) + "'s";
}
if (playerHand == 7) {
i = 1;
while (i < 6) {
if (eval ("hh" + i) != thisPair0) {
wom = eval ("hh" + i);
}
i++;
}
bestHand.push(thisPair0);
bestHand.push(wom);
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
dval = getVal(bestHand[1]);
handText = ("Four of a Kind " + dval) + "'s";
hc = wom;
}
if (playerHand == 8) {
if ((hh5 == 14) && (hh1 == 2)) {
bestHand.push(14);
} else {
bestHand.push(hh5);
}
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
dval = getVal(bestHand[1]);
handText = ("Straight Flush " + dval) + " High";
hc = hh5;
}
if (playerHand == 9) {
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
handText = "*** Royal Flush ***";
hc = hh5;
}
};
getVal = function (num) {
if (num == 11) {
return("JACK");
}
if (num == 12) {
return("QUEEN");
}
if (num == 13) {
return("KING");
}
if (num == 14) {
return("ACE");
}
if (num == 2) {
return("2");
}
if (num == 3) {
return("3");
}
if (num == 4) {
return("4");
}
if (num == 5) {
return("5");
}
if (num == 6) {
return("6");
}
if (num == 7) {
return("7");
}
if (num == 8) {
return("8");
}
if (num == 9) {
return("9");
}
if (num == 10) {
return("10");
}
};
ShockwaveHubDialog.prototype.Init = function () {
var _local2 = "http://www.shockwave.com/content/highscores/scorez-2002.swf";
loadMovieNum (_local2, 2);
this.fInterval = setInterval(this, "Timer", 100);
};
ShockwaveHubDialog.prototype.End = function () {
if (this.fInterval != null) {
clearInterval(this.fInterval);
this.fInterval = null;
}
};
ShockwaveHubDialog.prototype.Timer = function () {
if (_level2.getBytesTotal() >= 0) {
clearInterval(this.fInterval);
this.fInterval = null;
} else {
var _local5 = getTimer();
if ((_local5 - this.fStart) < 30000) {
var _local3 = "";
var _local4 = int(((_local5 - this.fStart) % 1000) / 200);
var _local2 = 0;
while (_local2 < _local4) {
_local3 = _local3 + ".";
_local2++;
}
this.fClip.msg1.text = "contacting shockwave.com" + _local3;
this.fClip.msg2.text = this.fClip.msg1.text;
} else {
if (!this.fbDidUnload) {
this.fbDidUnload = true;
_level2.unloadMovie();
}
this.fClip.msg1.text = "failed to contact shockwave.com";
this.fClip.msg2.text = this.fClip.msg1.text;
if ((_local5 - this.fStart) > 33000) {
this.End();
}
}
}
};
debug = false;
menudepth = 25;
tabledepth = 50;
rounddepth = 100;
allindepth = 125;
bubbledepth = 150;
tablemenudepth = 200;
pausedepth = 777;
pauseOn = false;
prePay = new Array();
prePay[0] = new Array(2000, 1000, 200);
prePay[1] = new Array(3000, 1500, 300);
prePay[2] = new Array(4000, 2000, 500);
prePay[3] = new Array(6000, 3000, 500);
prePay[4] = new Array(8000, 4000, 1000);
prePay[5] = new Array(12000, 6000, 1000);
prePay[6] = new Array(16000, 8000, 2000);
prePay[7] = new Array(20000, 10000, 2000);
prePay[8] = new Array(30000, 15000, 3000);
prePay[9] = new Array(30000, 15000, 3000);
prePay[10] = new Array(30000, 15000, 3000);
prePay[11] = new Array(30000, 15000, 3000);
prePay[12] = new Array(30000, 15000, 3000);
prePay[13] = new Array(30000, 15000, 3000);
prePay[14] = new Array(30000, 15000, 3000);
prePay[15] = new Array(30000, 15000, 3000);
loadAI();
betLevel = 0;
getBetLevel();
if (!maxplayers) {
maxplayers = 5;
}
maxplayers = 4;
maxraises = 3;
logobufferx = 0;
logobuffery = 0;
Game.prototype.introDialog = function () {
table.attachMovie("dialogRed", "introDialog", this.mydepth++);
table.introDialog.btn_play.btn.onRelease = function () {
mygame.intro();
table.introDialog.removeMovieClip();
};
table.introDialog.btn_play.btn.onPress = function () {
_root.buttonSound();
};
};
Game.prototype.intro = function () {
function introCallback() {
if (pauseOn == false) {
if (count < introOrder.length) {
if (count == 0) {
PlaySoundEffect("SOUND_CLAP4");
table.attachMovie("infoBox", "infoBox", _root.mygame.mydepth + 100);
table.infoBox._x = 52;
table.infoBox._y = 317;
}
_root.mygame.createPlayerBoxes(introOrder[count]);
} else {
_root.table.infoBox.removeMovieClip();
_root.mygame.mybubble.killBubble();
}
count++;
if (count > introOrder.length) {
count = 0;
introChips();
clearInterval(intID0001);
}
}
}
function introChips() {
function introChipsCallback() {
PlaySoundEffect("SOUND_CHIP1");
_root.mygame.createChips(introOrder[count]);
count++;
if (count >= introOrder.length) {
_root.mygame.makeNewRound();
clearInterval(intID0003);
}
}
_root.gGameStartTime = getTimer();
intID0003 = setInterval(introChipsCallback, 300);
}
var introOrder;
var count = 0;
if (maxplayers == 5) {
introOrder = new Array(4, 0, 1, 2, 3);
} else {
introOrder = new Array(4, 0, 1, 3);
}
this.mybubble.makeBubble(5, "Please Welcome", "Our Players", 0);
intID0001 = setInterval(introCallback, 2100);
};
Game.prototype.createPlayerBoxes = function (who) {
function movePlayerBox(where) {
PlaySoundEffect("SOUND_SPIN");
var _local3 = _root.mygame.gPbox["b" + where].x;
var _local2 = _root.mygame.gPbox["b" + where].y;
_root.table["pBox" + where].goToPoint(_local3, _local2, 5);
clearInterval(intID0002);
}
PlaySoundEffect("SOUND_ATTENTION5");
table.infoBox.myname.text = (this.gPlayers["player" + who].first + " ") + this.gPlayers["player" + who].last;
table.infoBox.mytag.text = this.gPlayers["player" + who].lTag;
table.attachMovie("playerBox", "pBox" + who, this.mydepth++);
table["pBox" + who]._x = 244.8;
table["pBox" + who]._y = 118.3;
table["pBox" + who]._xscale = 85;
table["pBox" + who]._yscale = 85;
table["pBox" + who].cover._visible = false;
table["pBox" + who].highlite._visible = false;
table["pBox" + who].statusBox._visible = false;
table["pBox" + who].statusBox.display.text = "";
table["pBox" + who].mybet = 0;
table["pBox" + who].myname.text = this.gPlayers["player" + who].first;
table["pBox" + who].mylastname = this.gPlayers["player" + who].last;
var _local6;
if (who == 3) {
table["pBox" + who].player.gotoAndStop("player");
} else {
_local6 = this.gPlayers["player" + who].img;
table["pBox" + who].player.gotoAndStop(_local6);
}
intID0002 = setInterval(movePlayerBox, 1600, who);
};
Game.prototype.createChips = function (who) {
table.attachMovie("chipBox", "chipBox" + who, this.mydepth++);
table["chipBox" + who]._x = this.gPbox["b" + who].chipx;
table["chipBox" + who]._y = this.gPbox["b" + who].chipy;
table["chipBox" + who].mybalance = this.defaultBalance;
table["chipBox" + who].balance.text = balanceFormat(table["chipBox" + who].mybalance, 0, ",");
table["chipBox" + who].chipCount = new Object();
table["chipBox" + who].chipCount = this.gChip.defaultChips;
this.makeChipStacks(who);
};
Game.prototype.colorUpChips = function (who) {
var _local3 = new Array();
_local3 = this.getP(who);
if (_local3[4].amt > 0) {
if ((_local3[4].amt > 1) && (_local3[3].amt < 5)) {
this.gChip["chip" + who].c100 = this.gChip["chip" + who].c100 + 10;
this.gChip["chip" + who].c500 = this.gChip["chip" + who].c500 + 10;
this.gChip["chip" + who].c1000 = this.gChip["chip" + who].c1000 + 14;
this.gChip["chip" + who].c5000 = this.gChip["chip" + who].c5000 + 6;
this.gChip["chip" + who].c25000 = this.gChip["chip" + who].c25000 - 2;
} else {
this.gChip["chip" + who].c100 = this.gChip["chip" + who].c100 + 10;
this.gChip["chip" + who].c500 = this.gChip["chip" + who].c500 + 10;
this.gChip["chip" + who].c1000 = this.gChip["chip" + who].c1000 + 14;
this.gChip["chip" + who].c5000 = this.gChip["chip" + who].c5000 + 1;
this.gChip["chip" + who].c25000 = this.gChip["chip" + who].c25000 - 1;
}
}
this.clearChips(who);
this.makeChipStacks(who);
};
Game.prototype.makeChipStacks = function (who) {
oflow = this.gChip.oflow;
p = this.getP(who);
checkAgain = true;
while (checkAgain == true) {
getStacks();
}
sortChips();
var _local2 = 0;
while (_local2 < 6) {
this["stack" + _local2] = new Object();
this["stack" + _local2].amt = p[0].amt;
this["stack" + _local2].n = p[0].n;
if (this["stack" + _local2].amt > oflow) {
this["stack" + _local2].amt = oflow;
p[0].amt = p[0].amt - oflow;
} else {
p[0].amt = 0;
}
sortChips();
_local2++;
}
this.cdpth = 0;
table["chipBox" + who].chipcount = 0;
_local2 = 0;
while (_local2 < 6) {
var _local4 = 0;
while (_local4 < this["stack" + _local2].amt) {
table["chipBox" + who].attachMovie("chipmaster", "chip" + this.cdpth, this.cdpth++);
table["chipBox" + who]["chip" + this.cdpth]._x = this.gChip["chip" + _local2].x;
table["chipBox" + who]["chip" + this.cdpth]._y = this.gChip["chip" + _local2].y - (this.gChip.inc * _local4);
table["chipBox" + who]["chip" + this.cdpth].gotoAndStop(this["stack" + _local2].n);
table["chipBox" + who]["chip" + this.cdpth].myvalue = this["stack" + _local2].n;
table["chipBox" + who].chipcount++;
_local4++;
}
_local2++;
}
};
Game.prototype.addClickables = function (who) {
var _local2 = 0;
while (_local2 < table["chipBox" + who].chipcount) {
table["chipBox" + who]["chip" + _local2].iButton.gotoAndStop(2);
table["chipBox" + who]["chip" + _local2].iButton.btn.onRelease = function () {
str = this._parent._parent.myvalue;
chipBoxIbutton(str);
this._parent._parent.removeMovieClip();
};
_local2++;
}
};
Game.prototype.clearChips = function (who) {
var _local1 = 0;
while (_local1 < (table["chipBox" + who].chipcount + 1)) {
table["chipBox" + who]["chip" + _local1].removeMovieClip();
_local1++;
}
};
Game.prototype.getP = function (who) {
anArray = new Array();
anArray.push({n:"c100", amt:this.gChip["chip" + who].c100, tonext:5, toprev:0});
anArray.push({n:"c500", amt:this.gChip["chip" + who].c500, tonext:2, toprev:5});
anArray.push({n:"c1000", amt:this.gChip["chip" + who].c1000, tonext:5, toprev:2});
anArray.push({n:"c5000", amt:this.gChip["chip" + who].c5000, tonext:5, toprev:5});
anArray.push({n:"c25000", amt:this.gChip["chip" + who].c25000, tonext:0, toprev:5});
return(anArray);
};
Game.prototype.updateBalance = function (who, amt, type) {
function unconvertChip(chip, amt) {
if (p[chip].amt < amt) {
found = false;
var _local1 = chip + 1;
while (found == false) {
if (p[_local1].amt > 0) {
found = true;
} else {
_local1++;
}
}
p[_local1].amt = p[_local1].amt - 1;
p[_local1 - 1].amt = p[_local1 - 1].amt + p[_local1].toprev;
if ((_local1 - 1) == chip) {
mycontinue = false;
} else {
mycontinue = true;
}
} else {
mycontinue = false;
}
}
var _local3;
var _local7;
if (type == "pos") {
table["chipBox" + who].mybalance = table["chipBox" + who].mybalance + amt;
table["chipBox" + who].enchilada = table["chipBox" + who].enchilada + amt;
} else {
table["chipBox" + who].mybalance = table["chipBox" + who].mybalance - amt;
table["chipBox" + who].enchilada = table["chipBox" + who].enchilada - amt;
}
table["chipBox" + who].balance.text = _root.balanceFormat(table["chipBox" + who].mybalance, 0, ",");
ideal = idealChips(amt);
if (table["chipBox" + who].mybalance > 0) {
if (type == "pos") {
this.gChip["chip" + who].c100 = this.gChip["chip" + who].c100 + ideal[0];
this.gChip["chip" + who].c500 = this.gChip["chip" + who].c500 + ideal[1];
this.gChip["chip" + who].c1000 = this.gChip["chip" + who].c1000 + ideal[2];
this.gChip["chip" + who].c5000 = this.gChip["chip" + who].c5000 + ideal[3];
this.gChip["chip" + who].c25000 = this.gChip["chip" + who].c25000 + ideal[4];
} else {
p = mygame.getP(who);
_local7 = mygame.getMyColor(who);
if (amt > table["chipBox" + who].mybalance) {
_local7 = true;
}
if (_local7 == false) {
_local3 = 0;
while (_local3 < ideal.length) {
if (ideal[_local3] > 0) {
mycontinue = true;
while (mycontinue == true) {
unconvertChip(_local3, ideal[_local3]);
}
}
p[_local3].amt = p[_local3].amt - ideal[_local3];
_local3++;
}
this.gChip["chip" + who].c100 = p[0].amt;
this.gChip["chip" + who].c500 = p[1].amt;
this.gChip["chip" + who].c1000 = p[2].amt;
this.gChip["chip" + who].c5000 = p[3].amt;
this.gChip["chip" + who].c25000 = p[4].amt;
} else {
ideal = idealChips(table["chipBox" + who].mybalance);
this.gChip["chip" + who].c100 = ideal[0];
this.gChip["chip" + who].c500 = ideal[1];
this.gChip["chip" + who].c1000 = ideal[2];
this.gChip["chip" + who].c5000 = ideal[3];
this.gChip["chip" + who].c25000 = ideal[4];
}
}
} else {
this.gChip["chip" + who].c100 = 0;
this.gChip["chip" + who].c500 = 0;
this.gChip["chip" + who].c1000 = 0;
this.gChip["chip" + who].c5000 = 0;
this.gChip["chip" + who].c25000 = 0;
}
this.clearChips(who);
this.makeChipStacks(who);
if (_local7 == true) {
if ((this.gChip["chip" + who].c25000 > 0) && ((((this.gChip["chip" + who].c5000 == 0) || (this.gChip["chip" + who].c1000 == 0)) || (this.gChip["chip" + who].c500 == 0)) || (this.gChip["chip" + who].c100 == 0))) {
mygame.colorUpChips(who);
}
}
};
Game.prototype.getMyColor = function (who) {
var _local1 = false;
i = 4;
while (i > 0) {
if ((ideal[i] > 0) && (p[i].amt < ideal[i])) {
_local1 = true;
break;
}
if (((_local1 == false) && (ideal[i] == 0)) && (p[i].amt > 0)) {
_local1 = false;
break;
}
i--;
}
return(_local1);
};
Game.prototype.addToPot = function (amt) {
var _local2;
ideal = idealChips(amt);
this.gChip.chipD.c100 = this.gChip.chipD.c100 + ideal[0];
this.gChip.chipD.c500 = this.gChip.chipD.c500 + ideal[1];
this.gChip.chipD.c1000 = this.gChip.chipD.c1000 + ideal[2];
this.gChip.chipD.c5000 = this.gChip.chipD.c5000 + ideal[3];
this.gChip.chipD.c25000 = this.gChip.chipD.c25000 + ideal[4];
_local2 = 0;
while (_local2 < (arena.potBox.chipcount + 1)) {
arena.potBox["chip" + _local2].removeMovieClip();
_local2++;
}
oflow = this.gChip.oflow;
p = new Array();
p.push({n:"c100", amt:this.gChip.chipD.c100, tonext:5, toprev:0});
p.push({n:"c500", amt:this.gChip.chipD.c500, tonext:2, toprev:5});
p.push({n:"c1000", amt:this.gChip.chipD.c1000, tonext:5, toprev:2});
p.push({n:"c5000", amt:this.gChip.chipD.c5000, tonext:5, toprev:5});
p.push({n:"c25000", amt:this.gChip.chipD.c25000, tonext:0, toprev:5});
checkAgain = true;
while (checkAgain == true) {
getStacks(4);
}
sortChips();
_local2 = 0;
while (_local2 < 10) {
this["stack" + _local2] = new Object();
this["stack" + _local2].amt = p[0].amt;
this["stack" + _local2].n = p[0].n;
if (this["stack" + _local2].amt > oflow) {
this["stack" + _local2].amt = oflow;
p[0].amt = p[0].amt - oflow;
} else {
p[0].amt = 0;
}
sortChips();
_local2++;
}
this.cdpth = 0;
arena.potBox.chipcount = 0;
_local2 = 0;
while (_local2 < 6) {
var _local3 = 0;
while (_local3 < this["stack" + _local2].amt) {
arena.potBox.attachMovie("chipmaster", "chip" + this.cdpth, this.cdpth++);
arena.potBox["chip" + this.cdpth]._x = this.gChip["mchip" + _local2].x;
arena.potBox["chip" + this.cdpth]._y = this.gChip["mchip" + _local2].y - (this.gChip.inc * _local3);
arena.potBox["chip" + this.cdpth].gotoAndStop(this["stack" + _local2].n);
arena.potBox.chipcount++;
_local3++;
}
_local2++;
}
};
Game.prototype.addToBetBox = function (amt) {
ideal = idealChips(amt);
this.gChip.chipBet.c100 = this.gChip.chipBet.c100 + ideal[0];
this.gChip.chipBet.c500 = this.gChip.chipBet.c500 + ideal[1];
this.gChip.chipBet.c1000 = this.gChip.chipBet.c1000 + ideal[2];
this.gChip.chipBet.c5000 = this.gChip.chipBet.c5000 + ideal[3];
this.gChip.chipBet.c25000 = this.gChip.chipBet.c25000 + ideal[4];
var _local2 = 0;
while (_local2 < (arena.betBox.chipcount + 1)) {
arena.betBox["chip" + _local2].removeMovieClip();
_local2++;
}
oflow = this.gChip.oflow;
p = new Array();
p.push({n:"c100", amt:this.gChip.chipBet.c100, tonext:5, toprev:0});
p.push({n:"c500", amt:this.gChip.chipBet.c500, tonext:2, toprev:5});
p.push({n:"c1000", amt:this.gChip.chipBet.c1000, tonext:5, toprev:2});
p.push({n:"c5000", amt:this.gChip.chipBet.c5000, tonext:5, toprev:5});
p.push({n:"c25000", amt:this.gChip.chipBet.c25000, tonext:0, toprev:5});
checkAgain = true;
while (checkAgain == true) {
getStacks();
}
sortChips();
_local2 = 0;
while (_local2 < 10) {
this["stack" + _local2] = new Object();
this["stack" + _local2].amt = p[0].amt;
this["stack" + _local2].n = p[0].n;
if (this["stack" + _local2].amt > oflow) {
this["stack" + _local2].amt = oflow;
p[0].amt = p[0].amt - oflow;
} else {
p[0].amt = 0;
}
sortChips();
_local2++;
}
this.cdpth = 0;
arena.betBox.chipcount = 0;
_local2 = 0;
while (_local2 < 6) {
var _local3 = 0;
while (_local3 < this["stack" + _local2].amt) {
arena.betBox.attachMovie("chipmaster", "chip" + this.cdpth, this.cdpth++);
arena.betBox["chip" + this.cdpth]._x = this.gChip["bchip" + _local2].x;
arena.betBox["chip" + this.cdpth]._y = this.gChip["bchip" + _local2].y - (this.gChip.inc * _local3);
arena.betBox["chip" + this.cdpth].gotoAndStop(this["stack" + _local2].n);
arena.betBox["chip" + this.cdpth].myvalue = this["stack" + _local2].n;
arena.betBox["chip" + this.cdpth].iButton.gotoAndStop(2);
arena.betBox["chip" + this.cdpth].iButton.btn.onRelease = function () {
str = this._parent._parent.myvalue;
betBoxIbutton(str);
if (ok == true) {
this._parent._parent.removeMovieClip();
}
};
arena.betBox.chipcount++;
_local3++;
}
_local2++;
}
};
Game.prototype.placeDealerButton = function (who) {
table.dealerButton._x = this.gPbox["b" + who].dbx;
table.dealerButton._y = this.gPbox["b" + who].dby;
};
Game.prototype.moveDealerButton = function (who) {
var _local4 = this.gPbox["b" + who].dbx;
var _local3 = this.gPbox["b" + who].dby;
table.dealerButton._x = this.gPbox["b" + who].dbx;
table.dealerButton._y = this.gPbox["b" + who].dby;
};
Game.prototype.nextDealer = function (slot) {
var _local2;
var _local3 = slot;
var _local4 = true;
while ((this.currentPlayers[_local2] == "e") || (_local4 == true)) {
_local4 = false;
_local2 = _local3 + 1;
if (_local2 == this.currentPlayers.length) {
_local2 = 0;
}
if (this.currentPlayers[_local2] == "e") {
_local3++;
if (_local3 == this.currentPlayers.length) {
_local3 = 0;
}
}
if (_local3 == 25) {
this.currentPlayers[_local2] = 4;
}
}
return(_local2);
};
Game.prototype.makeNewRound = function () {
mygame.myhand = new TheHand(this.dealer, this.currentPlayers, true);
};
Game.prototype.killPlayer = function (who) {
var _local2 = 0;
while (_local2 < this.currentPlayers.length) {
if (this.currentPlayers[_local2] == who) {
this.currentPlayers.splice(_local2, 1);
break;
}
_local2++;
}
table["pBox" + who].removeMovieClip();
table["chipBox" + who].removeMovieClip();
};
TheHand.prototype.makePot = function (type) {
if (!type) {
arena.attachMovie("potBox", "potBox", this.mydepth++);
arena.potBox.bal = 0;
arena.potBox.chipCount = 0;
arena.potBox._x = mygame.gChip.chipD.x;
arena.potBox._y = mygame.gChip.chipD.y;
} else {
arena.attachMovie("betBox", "betBox", 650);
arena.betBox.bal = 0;
arena.betBox.chipCount = 0;
arena.betBox._x = mygame.gChip.chipBet.x;
arena.betBox._y = mygame.gChip.chipBet.y;
mygame.gChip.chipBet.c100 = 0;
mygame.gChip.chipBet.c500 = 0;
mygame.gChip.chipBet.c1000 = 0;
mygame.gChip.chipBet.c5000 = 0;
mygame.gChip.chipBet.c25000 = 0;
}
};
TheHand.prototype.addToPot = function (amt, pot, addStore) {
if (!pot) {
pot = 0;
}
if (!addStore) {
this.potStore[pot] = this.potStore[pot] + amt;
trace(this.potStore[pot]);
}
arena.potBox.bal = arena.potBox.bal + amt;
arena.potBox.balance.text = _root.balanceFormat(arena.potBox.bal, 0, ",");
mygame.addToPot(amt);
};
TheHand.prototype.createBet = function (callamountB) {
var _local3;
this.makePot("bet");
callamount = callamountB;
minRaise = bigblind;
arena.betBox.callamt.text = _root.balanceFormat(callamount, 0, ",");
amt = callamount + minRaise;
this.addToBet(amt);
arena.betBox.balance.text = _root.balanceFormat(arena.betBox.bal - callamount, 0, ",");
mygame.updateBalance(3, amt);
_local3 = 0;
while (_local3 < (arena.betBox.chipcount + 1)) {
arena.betBox["chip" + _local3].iButton.gotoAndStop(2);
arena.betBox["chip" + _local3].iButton.btn.onRelease = function () {
mygame.isNew = false;
str = this._parent._parent.myvalue;
betBoxIbutton(str);
if (ok == true) {
this._parent._parent.removeMovieClip();
}
};
_local3++;
}
_local3 = 0;
while (_local3 < (table.chipBox3.chipcount + 1)) {
table.chipBox3["chip" + _local3].iButton.gotoAndStop(2);
table.chipBox3["chip" + _local3].iButton.btn.onRelease = function () {
mygame.isNew = false;
str = this._parent._parent.myvalue;
chipBoxIbutton(str);
this._parent._parent.removeMovieClip();
};
_local3++;
}
};
TheHand.prototype.addToBet = function (amt) {
arena.betBox.bal = arena.betBox.bal + amt;
arena.betBox.balance.text = _root.balanceFormat(arena.betBox.bal, 0, ",");
mygame.addToBetBox(amt);
};
TheHand.prototype.postAnte = function () {
mygame.mybubble.makeBubble(5, "Ante Up", "blank", 1, 750);
arena.ct = 0;
trace((("1 " + this.handPlayers[this.dealerSlot]) + " --- 2 ") + this.handPlayers);
this.playOrder = this.getPlayOrder(this.handPlayers[this.dealerSlot], this.handPlayers);
trace("POSTING ANTE " + this.playOrder);
intID0004 = setInterval(this.placeAnte, 200);
};
TheHand.prototype.placeAnte = function () {
if (pauseOn == false) {
PlaySoundEffect("SOUND_CHIP1");
var _local2 = mygame.myhand.playOrder[arena.ct];
table["pBox" + _local2].statusBox.display.text = "Ante " + _root.balanceFormat(mygame.ante, 0, ",");
table["pBox" + _local2].statusBox._visible = true;
table["pBox" + _local2].statusBox.colorBox.gotoAndStop(1);
mygame.updateBalance(_local2, mygame.ante);
mygame.myhand.addToPot(mygame.ante, 0, true);
mygame.myhand.basicPot = mygame.myhand.basicPot + mygame.ante;
arena.ct++;
if (arena.ct >= mygame.myhand.playOrder.length) {
mygame.myhand.postBlinds(mygame.myhand.handPlayers[mygame.myhand.dealerSlot]);
clearInterval(intID0004);
}
}
};
TheHand.prototype.postBlinds = function (slot) {
function doPostBlinds() {
if (pauseOn == false) {
mygame.myhand.betStart = mygame.myhand.returnNextPlayer(mygame.myhand.betStart);
PlaySoundEffect("SOUND_CHIP1");
var _local3 = table["pBox" + mygame.myhand.playOrder[count]].myname.text;
var _local2 = mygame.myhand.playOrder[count];
trace("BLIND to " + _local2);
if (count == 0) {
mygame.mybubble.makeBubble(6, _local3 + " posts", "the Small Blind", 1, 750);
mygame.mybubble.makeBubble(mygame.myhand.playOrder[count], "posting " + _root.balanceFormat(mygame.smallblind, 0, ","), "blank", 1, 1250);
table["pBox" + _local2].statusBox.display.text = "Posting " + _root.balanceFormat(mygame.smallblind, 0, ",");
table["pBox" + _local2].statusBox.colorBox.gotoAndStop(3);
mygame.updateBalance(_local2, mygame.smallblind);
mygame.myhand.addToPot(mygame.smallblind, 0);
table["pBox" + _local2].mybet = mygame.smallblind;
} else {
mygame.mybubble.makeBubble(5, _local3 + " posts", "the Big Blind", 1, 750);
mygame.mybubble.makeBubble(mygame.myhand.playOrder[count], "posting " + _root.balanceFormat(mygame.bigblind, 0, ","), "blank", 1, 1250);
table["pBox" + _local2].statusBox.display.text = "Posting " + _root.balanceFormat(mygame.bigblind, 0, ",");
table["pBox" + _local2].statusBox.colorBox.gotoAndStop(3);
mygame.updateBalance(_local2, mygame.bigblind);
mygame.myhand.addToPot(mygame.bigblind, 0);
table["pBox" + _local2].mybet = mygame.bigblind;
mygame.myhand.currentBet = mygame.myhand.currentBet + mygame.bigblind;
mygame.myhand.dealCards();
clearInterval(intID0005);
}
count++;
}
}
mygame.mybubble.makeBubble(5, table["pBox" + slot].myname.text, "is the Dealer", 1, 1250);
count = 0;
intID0005 = setInterval(doPostBlinds, 1250);
};
TheHand.prototype.dealCards = function () {
trace("DEALING CARDS");
this.deck = new Array();
var _local2 = 1;
while (_local2 < 53) {
this.deck.push(_local2);
_local2++;
}
this.deck.shuffle();
if (debug == true) {
this.deck[0] = 2;
this.deck[1] = 15;
this.deck[2] = 4;
this.deck[3] = 17;
this.deck[4] = 18;
this.deck[5] = 31;
this.deck[6] = 47;
this.deck[7] = 48;
this.deck[8] = 50;
}
cardcount = 0;
intID0006 = setInterval(this.deliverCard, 200);
};
TheHand.prototype.deliverCard = function () {
PlaySoundEffect("SOUND_DEAL2");
if (cardcount < mygame.myhand.playOrder.length) {
var _local3 = mygame.myhand.playOrder[cardcount];
cc = 0;
} else {
var _local6 = cardcount - mygame.myhand.playOrder.length;
var _local3 = mygame.myhand.playOrder[_local6];
cc = 1;
}
var _local2 = (("card_" + _local3) + "_") + cc;
arena.attachMovie("card", _local2, mygame.myhand.mydepth++);
arena[_local2]._xscale = 75;
arena[_local2]._yscale = 75;
arena[_local2]._x = 220;
arena[_local2]._y = 10;
arena[_local2].mycard = mygame.myhand.deck[cardcount];
arena[_local2].gotoAndStop(mygame.myhand.deck[cardcount]);
if ((_local3 == 3) || (debug == true)) {
arena[_local2].cardback._visible = false;
}
var _local5 = _root.mygame.gPbox["b" + _local3].cx + (12 * cc);
var _local4 = _root.mygame.gPbox["b" + _local3].cy + (3 * cc);
arena[_local2].goToPoint(_local5, _local4, 3);
cardcount++;
if (cardcount >= (mygame.myhand.playOrder.length * 2)) {
mygame.myhand.getBigCards();
clearInterval(intID0006);
}
};
TheHand.prototype.getBigCards = function () {
function doSwap(t0, t1) {
if (count == 0) {
PlaySoundEffect("SOUND_SPIN");
var _local3 = 240;
var _local2 = 405;
arena.card_3_0.goToPoint(_local3, _local2, 3, true);
_local3 = 240;
_local2 = 405;
arena.card_3_1.goToPoint(_local3, _local2, 3, true);
} else if (count == 1) {
var _local1 = "card_3_0";
arena.attachMovie("card", _local1, mygame.myhand.mydepth++);
if (maxplayers == 5) {
arena[_local1]._x = 295;
arena[_local1]._y = 335;
} else {
arena[_local1]._x = 252;
arena[_local1]._y = 354;
}
arena[_local1].mycard = t0;
arena[_local1].gotoAndStop(t0);
arena[_local1].cardback._visible = false;
_local1 = "card_3_1";
arena.attachMovie("card", _local1, mygame.myhand.mydepth++);
if (maxplayers == 5) {
arena[_local1]._x = 325;
arena[_local1]._y = 340;
} else {
arena[_local1]._x = 282;
arena[_local1]._y = 359;
}
arena[_local1].mycard = t1;
arena[_local1].gotoAndStop(t1);
arena[_local1].cardback._visible = false;
}
count++;
if (count == 2) {
mygame.myhand.startBetting();
clearInterval(intID0007);
}
}
count = 0;
var _local4 = arena.card_3_0._currentframe;
var _local5 = arena.card_3_1._currentframe;
intID0007 = setInterval(doSwap, 350, _local4, _local5);
};
TheHand.prototype.dealCommunityCards = function () {
function doComm() {
PlaySoundEffect("SOUND_DEAL2");
var _local1 = "card_comm_" + mygame.myhand.commcardcount;
arena.attachMovie("card", _local1, mygame.myhand.mydepth++);
arena[_local1]._xscale = 75;
arena[_local1]._yscale = 75;
arena[_local1]._x = 220;
arena[_local1]._y = 10;
arena[_local1].mycard = mygame.myhand.deck[cardcount];
arena[_local1].gotoAndStop(mygame.myhand.deck[cardcount]);
arena[_local1].cardback._visible = false;
if (maxplayers == 5) {
var _local3 = 140 + (inc * toinc);
var _local2 = 179;
} else {
var _local3 = 175 + (inc * toinc);
var _local2 = 175;
}
arena[_local1].goToPoint(_local3, _local2, 3);
toinc++;
count++;
cardcount++;
mygame.myhand.commcardcount++;
if (count >= num) {
intID0010 = setInterval(endComm, 1000);
clearInterval(intID0008);
}
}
function endComm() {
mygame.myhand.keepBetting();
clearInterval(intID0010);
}
inc = 50;
if (this.dealType[0] == "flop") {
num = 3;
toinc = 0;
arena.attachMovie("aflop", "aflop", 611);
arena.aflop._x = 174;
arena.aflop._y = 235;
} else if (this.dealType[0] == "turn") {
num = 1;
toinc = 3;
arena.attachMovie("aturn", "aturn", 612);
arena.aturn._x = 324;
arena.aturn._y = 235;
} else if (this.dealType[0] == "river") {
num = 1;
toinc = 4;
arena.attachMovie("ariver", "ariver", 613);
arena.ariver._x = 374;
arena.ariver._y = 235;
}
mygame.mybubble.makeBubble(5, "The " + this.dealType[0], "blank", 1, 1000);
this.dealType.splice(0, 1);
count = 0;
intID0008 = setInterval(doComm, 350);
};
TheHand.prototype.gotoPlayer = function () {
if (pauseOn == false) {
if (this.AllInPool[this.betStart] > 0) {
} else {
var _local2 = table["pBox" + this.betStart].myname.text;
mygame.mybubble.makeBubble(5, _local2 + "?", "blank", 1, 0);
table["pBox" + this.betStart].highlite._visible = true;
}
this.determineBetButtons(this.betStart);
} else {
pauseReturnAction = "gotoPlayer";
}
};
TheHand.prototype.determineBetButtons = function (who) {
var _local5 = 0;
if (table["pBox" + who].mybet > 0) {
_local5 = table["pBox" + who].mybet;
}
var _local7 = false;
_root.attachNOchips = false;
var _local6 = false;
var _local9 = new Array();
_local9 = this.whosLeft();
if ((this.AllInActive == (_local9.length - 1)) && (who == 3)) {
_local6 = true;
}
trace("ALLIN = " + this.AllInActive);
trace("PLAYERS LEFT = " + _local9);
trace("PLAYERS LEFT len = " + _local9.length);
trace("SPECAC = " + _local6);
trace("CURRENT BET = " + this.currentBet);
trace("PLAYER BET = " + _local5);
if (((this.AllInPool[who] > 0) && (who != 3)) && (this.betStart != 3)) {
_local6 = true;
this.betStart = this.returnNextPlayer(this.betStart);
this.playOrder = this.getPlayOrder(this.betStart, this.handPlayers);
this.gotoPlayer();
}
if ((((this.currentBet > 0) && (_local5 >= this.currentBet)) && (_local6 == true)) && (who == 3)) {
_root.attachNOchips = true;
this.attachBetButtons(who, "allin", "", "", "", "", cb, _root.attachNOchips);
}
if ((((this.currentBet > 0) && (_local5 < this.currentBet)) && (_local6 == true)) && (who == 3)) {
_root.attachNOchips = true;
this.attachBetButtons(who, "allin", "fold", "", "", "", cb, _root.attachNOchips);
}
if ((((this.currentBet + minRaise) - _local5) >= table["chipBox" + who].mybalance) && (_local6 == false)) {
_local7 = true;
cb = this.currentBet;
_root.attachNOchips = true;
if ((this.currentBet == 0) || (_local5 == this.currentBet)) {
this.attachBetButtons(who, "allin", "check", "fold", "", "", cb, _root.attachNOchips);
} else {
this.attachBetButtons(who, "allin", "fold", "", "", "", cb, _root.attachNOchips);
}
}
if (((this.currentBet == 0) && (_local7 == false)) && (_local6 == false)) {
_local7 = true;
cb = this.currentBet;
this.attachBetButtons(who, "allin", "bet", "check", "", "", cb, _root.attachNOchips);
}
if ((((this.currentBet > 0) && (_local5 < this.currentBet)) && (_local7 == false)) && (_local6 == false)) {
_local7 = true;
cb = this.currentBet - _local5;
if (this.numRaises >= _root.maxraises) {
if (this.AllInActive > 0) {
_root.attachNOchips = true;
this.attachBetButtons(who, "allin", "fold", "", "", "", cb, _root.attachNOchips);
} else {
_root.attachNOchips = true;
this.attachBetButtons(who, "call", "fold", "", "", "", cb, _root.attachNOchips);
}
} else {
var _local8 = this.AllInActive;
var _local3 = 0;
while (_local3 < this.handPlayers.length) {
if ((this.handPlayers == "f") || (this.handPlayers == "e")) {
_local8++;
}
_local3++;
}
if (_local8 >= 3) {
_root.attachNOchips = true;
this.attachBetButtons(who, "allin", "fold", "", "", "", cb, _root.attachNOchips);
} else {
this.attachBetButtons(who, "allin", "raise", "call", "fold", "", cb, _root.attachNOchips);
}
}
}
if ((((this.currentBet > 0) && (_local5 == this.currentBet)) && (_local7 == false)) && (_local6 == false)) {
_local7 = true;
cb = 0;
this.attachBetButtons(who, "allin", "raise", "check", "", "", cb, _root.attachNOchips);
}
};
TheHand.prototype.attachBetButtons = function (who, b0, b1, b2, b3, b4, cb, isChips) {
if (who == 3) {
if (!isChips) {
if ((mygame.gChip.chip3.c25000 > 0) && ((((mygame.gChip.chip3.c5000 == 0) || (mygame.gChip.chip3.c1000 == 0)) || (mygame.gChip.chip3.c500 == 0)) || (mygame.gChip.chip3.c100 == 0))) {
mygame.colorUpChips(3);
}
this.createBet(cb);
}
var myname = "";
if (maxplayers == 5) {
var inc = 27;
var x = 175;
var y = 258;
} else {
var inc = 23;
var x = 265;
var y = 260.4;
}
arena.attachMovie("chipclicktext", "chipclicktext", mygame.myhand.mydepth++);
if ((mygame.isNew == true) && ((this.dealType[0] == "flop") || (this.dealType[0] == "turn"))) {
arena.chipclicktext._visible = true;
} else {
arena.chipclicktext._visible = false;
}
arena.chipclicktext._x = 394;
arena.chipclicktext._y = 163;
var i = 0;
while (i < 5) {
var action = eval ("b" + i);
if (action != "") {
myname = "bb_" + action;
arena.attachMovie(myname, myname, mygame.myhand.mydepth++);
arena[myname]._x = x;
arena[myname]._y = y + (i * inc);
arena[myname].action = action;
arena[myname].who = who;
arena[myname].btn.onRelease = function () {
mygame.myhand.doBetAction(this._parent.who, this._parent.action);
};
arena[myname].btn.onPress = function () {
_root.buttonSound();
};
}
i++;
}
} else {
_root.initAI(who);
}
};
TheHand.prototype.killBetButtons = function () {
arena.chipclicktext.removeMovieClip();
arena.bb_allin.removeMovieClip();
arena.bb_raise.removeMovieClip();
arena.bb_bet.removeMovieClip();
arena.bb_call.removeMovieClip();
arena.bb_check.removeMovieClip();
arena.bb_fold.removeMovieClip();
};
TheHand.prototype.doAIBetAction = function (who) {
faction = undefined;
aibet = _level22.mybet;
if (((aibet + 2) + 3) != (aibet + 5)) {
aibet = bigblind;
}
aiaction = _level22.myaction[0];
if ((aibet == table["chipBox" + who].mybalance) && (aiaction == "R")) {
faction = "allin";
}
if (((aibet + this.currentBet) >= (table["chipBox" + who].mybalance - 10000)) && (aiaction == "R")) {
faction = "allin";
}
if ((faction != "allin") && (aiaction == "R")) {
if ((mygame.myhand.numBettors == 0) && (this.currentBet == 0)) {
faction = "bet";
} else {
faction = "raise";
}
if ((faction == "raise") && (this.numRaises >= _root.maxraises)) {
faction = "call";
}
if (mygame.myhand.AllInActive > 0) {
faction = "allin";
}
}
if ((aiaction == "C") && (this.currentBet >= table["chipBox" + who].mybalance)) {
faction = "allin";
}
if ((aiaction == "C") && (faction != "allin")) {
if ((mygame.myhand.currentBet == 0) || (((mygame.myhand.dealType[0] == "flop") && (mygame.myhand.currentBet == bigblind)) && (table["pBox" + who].mybet == bigblind))) {
faction = "check";
} else {
faction = "call";
}
if (this.AllInActive > 0) {
if ((random(3) == 0) || (table["pBox" + who].mybet > mygame.myhand.currentBet)) {
faction = "allin";
} else {
faction = "fold";
}
}
}
if (aiaction == "F") {
faction = "fold";
}
if (botsDoAll == true) {
faction = "allin";
}
if (doodyhead == true) {
faction = "fold";
}
trace((("AI RESULT = " + faction) + " ---- ") + aiaction);
mygame.myhand.doBetAction(who, faction, aibet);
};
TheHand.prototype.doBetAction = function (who, action, aibet) {
var _local14;
mygame.mybubble.killBubble();
if (who == 3) {
this.killBetButtons();
}
table["pBox" + who].highlite._visible = false;
switch (action) {
case "allin" :
var _local5;
var _local11;
this.AllInActive++;
if (table["pBox" + who].mybet > 0) {
trace("AMT REMOVED FROM POT 0 " + table["pBox" + who].mybet);
this.potStore[0] = this.potStore[0] - table["pBox" + who].mybet;
}
amountToCall = this.currentBet - table["pBox" + who].mybet;
if ((who == 3) && (_root.attachNOchips == false)) {
var _local12 = arena.betBox.bal;
mygame.updateBalance(who, _local12, "pos");
}
_local5 = table["chipBox" + who].mybalance;
_local11 = _local5 + table["pBox" + who].mybet;
this.AllInPool[who] = _local11;
PlaySoundEffect("SOUND_CHIP3");
PlaySoundEffect("SOUND_ALLIN");
if (this.numBettors > 0) {
this.numRaises++;
}
this.numBettors++;
if (this.currentBet < _local5) {
this.currentBet = _local5;
}
table["pBox" + who].mybet = _local5;
mygame.mybubble.makeBubble(who, "All In ", _root.balanceFormat(_local11, 0, ","), 3, 1250);
table["pBox" + who].statusBox.display.text = "All In " + _root.balanceFormat(_local11, 0, ",");
table["pBox" + who].statusBox.colorBox.gotoAndStop(3);
mygame.updateBalance(who, _local5);
table["chipBox" + who]._visible = false;
if (this.AllInActive == 1) {
this.potStore[1] = this.AllInPool[who];
this.currentpot = 1;
mygame.myhand.addToPot(_local5, 0, true);
} else if (this.AllInActive == 2) {
var _local9 = true;
if (this.currentpot == 1) {
this.currentpot = 2;
if (this.AllInPool[who] < this.potStore[1]) {
_local9 = false;
}
if (_local9 == true) {
this.potStore[2] = this.AllInPool[who] - this.potStore[1];
this.potStore[1] = this.potStore[1] * 2;
this.currentpot = 2;
trace("BIGGER POT 1 = " + this.potStore[1]);
trace("POT 2 = " + this.potStore[2]);
trace("Aliin who = " + this.AllInPool[who]);
} else {
this.potStore[2] = this.potStore[1];
this.potStore[1] = this.AllInPool[who] * 2;
this.potStore[2] = this.potStore[2] - this.AllInPool[who];
trace("SMALL POT 1 = " + this.potStore[1]);
trace("POT 2 = " + this.potStore[2]);
trace("Aliin who = " + this.AllInPool[who]);
}
trace("Currentpot = " + this.currentpot);
} else if (this.currentpot == 2) {
if (this.AllInPool[who] <= (this.potStore[1] / 2)) {
_local9 = false;
}
if (_local9 == false) {
this.potStore[3] = this.potStore[2];
this.potStore[2] = this.potStore[1];
this.potStore[1] = this.AllInPool[who] * 3;
this.potStore[2] = this.potStore[2] - (this.AllInPool[who] * 2);
}
if ((_local9 == true) && (this.AllInPool[who] < (this.potStore[2] + (this.potStore[1] / 2)))) {
this.potStore[3] = this.potStore[2];
this.potStore[2] = this.AllInPool[who] - (this.potStore[1] / 2);
this.potStore[1] = this.potStore[1] + (this.potStore[1] / 2);
this.potStore[3] = this.potStore[3] - this.potStore[2];
this.potStore[2] = this.potStore[2] + this.potStore[2];
} else if ((_local9 == true) && (this.AllInPool[who] >= (this.potStore[2] + (this.potStore[1] / 2)))) {
this.potStore[3] = (this.AllInPool[who] - this.potStore[2]) - (this.potStore[1] / 2);
this.potStore[1] = this.potStore[1] + (this.potStore[1] / 2);
this.potStore[2] = this.potStore[2] + this.potStore[2];
}
this.currentpot = 3;
}
mygame.myhand.addToPot(_local5, 0, true);
} else if (this.AllInActive == 3) {
trace("Currentpot = " + this.currentpot);
var _local9 = true;
if (this.currentpot == 2) {
if (this.AllInPool[who] <= (this.potStore[1] / 2)) {
_local9 = false;
}
trace(_local9);
trace(this.AllInPool[who]);
trace(this.potStore[1]);
trace(this.potStore[2]);
trace("00000000000000000");
if (_local9 == false) {
this.potStore[3] = this.potStore[2];
this.potStore[2] = this.potStore[1];
this.potStore[1] = this.AllInPool[who] * 3;
this.potStore[2] = this.potStore[2] - (this.AllInPool[who] * 2);
}
if ((_local9 == true) && (this.AllInPool[who] < (this.potStore[2] + (this.potStore[1] / 2)))) {
this.potStore[3] = this.potStore[2];
this.potStore[2] = this.AllInPool[who] - (this.potStore[1] / 2);
this.potStore[1] = this.potStore[1] + (this.potStore[1] / 2);
this.potStore[3] = this.potStore[3] - this.potStore[2];
this.potStore[2] = this.potStore[2] + this.potStore[2];
} else if ((_local9 == true) && (this.AllInPool[who] >= (this.potStore[2] + (this.potStore[1] / 2)))) {
this.potStore[3] = (this.AllInPool[who] - this.potStore[2]) - (this.potStore[1] / 2);
this.potStore[1] = this.potStore[1] + (this.potStore[1] / 2);
this.potStore[2] = this.potStore[2] + this.potStore[2];
}
this.currentpot = 3;
} else if (this.currentpot == 3) {
if (this.AllInPool[who] < (this.potStore[1] / 3)) {
_local9 = false;
}
if (_local9 == false) {
this.potStore[3] = this.potStore[2];
this.potStore[2] = this.potStore[1];
this.potStore[1] = this.AllInPool[who] * 4;
this.potStore[2] = this.potStore[2] - (this.AllInPool[who] * 3);
}
if ((_local9 == true) && (this.AllInPool[who] < (this.potStore[2] + (this.potStore[1] / 3)))) {
this.potStore[3] = this.potStore[2];
this.potStore[2] = this.AllInPool[who] - (this.potStore[1] / 3);
this.potStore[1] = this.potStore[1] + (this.potStore[1] / 3);
this.potStore[3] = this.potStore[3] - (this.potStore[2] * 2);
this.potStore[2] = this.potStore[2] * 2;
_local9 = false;
} else if ((_local9 == true) && (this.AllInPool[who] < ((this.potStore[3] + (this.potStore[2] / 2)) + (this.potStore[1] / 3)))) {
this.potStore[3] = this.potStore[2];
this.potStore[2] = this.potStore[2] + (this.potStore[2] / 2);
this.potStore[1] = this.potStore[1] + (this.potStore[1] / 3);
this.potStore[3] = (this.AllInPool[who] - (this.potStore[1] / 3)) - (this.potStore[2] / 2);
this.potStore[3] = this.potStore[3] + this.potStore[3];
_local9 = false;
} else if ((_local9 == true) && (this.AllInPool[who] >= ((this.potStore[3] + (this.potStore[2] / 2)) + (this.potStore[1] / 3)))) {
this.potStore[3] = this.potStore[3] + this.potStore[3];
this.potStore[1] = this.potStore[1] + (this.potStore[1] / 3);
this.potStore[2] = this.potStore[2] + (this.potStore[2] / 2);
}
this.currentpot = 3;
}
mygame.myhand.addToPot(_local5, 0, true);
} else if (this.AllInActive == 4) {
var _local9 = true;
if (this.AllInPool[who] <= (this.potStore[1] / 3)) {
_local9 = false;
}
if (_local9 == false) {
trace("opt1");
this.potStore[4] = this.potStore[3];
this.potStore[3] = this.potStore[2];
this.potStore[2] = this.potStore[1];
this.potStore[1] = this.AllInPool[who] * 4;
this.potStore[2] = this.potStore[2] - (this.AllInPool[who] * 3);
}
if ((_local9 == true) && (this.AllInPool[who] < ((this.potStore[2] / 2) + (this.potStore[1] / 3)))) {
trace("opt2");
this.potStore[4] = this.potStore[3];
this.potStore[3] = this.potStore[2];
this.potStore[2] = this.AllInPool[who] - (this.potStore[1] / 3);
this.potStore[1] = this.potStore[1] + (this.potStore[1] / 3);
this.potStore[3] = this.potStore[3] - (this.potStore[2] * 2);
this.potStore[2] = this.potStore[2] * 2;
_local9 = false;
} else if ((_local9 == true) && (this.AllInPool[who] < ((this.potStore[3] + (this.potStore[2] / 2)) + (this.potStore[1] / 3)))) {
trace("opt3");
this.potStore[4] = this.potStore[3];
this.potStore[3] = (this.AllInPool[who] - (this.potStore[1] / 3)) - (this.potStore[2] / 2);
this.potStore[2] = this.potStore[2] + (this.potStore[2] / 2);
this.potStore[1] = this.potStore[1] + (this.potStore[1] / 3);
this.potStore[4] = this.potStore[4] - (this.potStore[3] * 2);
this.potStore[3] = this.potStore[3] * 2;
_local9 = false;
} else if ((_local9 == true) && (this.AllInPool[who] >= ((this.potStore[3] + (this.potStore[2] / 2)) + (this.potStore[1] / 3)))) {
trace("opt4");
this.potStore[4] = ((this.AllInPool[who] - (this.potStore[1] / 3)) - (this.potStore[2] / 2)) - this.potStore[3];
this.potStore[3] = this.potStore[3] + this.potStore[3];
this.potStore[1] = this.potStore[1] + (this.potStore[1] / 3);
this.potStore[2] = this.potStore[2] + (this.potStore[2] / 2);
}
this.currentpot = 3;
mygame.myhand.addToPot(_local5, 0, true);
}
trace("POTS ALERT *************");
trace(this.potStore[0]);
trace(this.potStore[1]);
trace(this.potStore[2]);
trace(this.potStore[3]);
trace(this.potStore[4]);
trace("POTS ALERT *************");
break;
case "raise" :
var _local6;
var amountToCall;
amountToCall = this.currentBet - table["pBox" + who].mybet;
if (who == 3) {
_local6 = arena.betBox.bal - amountToCall;
} else {
_local6 = aibet;
}
_local11 = _local6 + amountToCall;
if (this.numBettors > 0) {
this.numRaises++;
}
this.numBettors++;
this.currentBet = this.currentBet + _local6;
table["pBox" + who].mybet = table["pBox" + who].mybet + _local11;
PlaySoundEffect("SOUND_CHIP2");
if (amountToCall > 0) {
mygame.mybubble.makeBubble(who, "I Call " + _root.balanceFormat(amountToCall, 0, ","), "& Raise " + _root.balanceFormat(_local6, 0, ","), 3, 1250);
} else {
mygame.mybubble.makeBubble(who, "I Raise " + _root.balanceFormat(_local6, 0, ","), "blank", 3, 1250);
}
table["pBox" + who].statusBox.display.text = "Raise " + _root.balanceFormat(_local6, 0, ",");
table["pBox" + who].statusBox.colorBox.gotoAndStop(3);
if (who != 3) {
mygame.updateBalance(who, _local11);
}
if (this.AllInActive == 1) {
this.potStore[1] = this.potStore[1] + amountToCall;
this.potStore[2] = _local6;
this.currentpot = 2;
yup = true;
}
if (this.AllInActive == 2) {
this.potStore[2] = amountToCall - (this.potStore[1] / 2);
this.potStore[1] = this.potStore[1] + (this.potStore[1] / 2);
this.potStore[3] = _local6;
this.currentpot = 3;
yup = true;
}
if (this.AllInActive == 0) {
mygame.myhand.addToPot(_local11, 0);
} else {
mygame.myhand.addToPot(_local11, 0, true);
}
break;
case "bet" :
var _local4;
if (who == 3) {
_local4 = arena.betBox.bal;
} else {
_local4 = aibet;
}
this.numBettors++;
PlaySoundEffect("SOUND_CHIP2");
this.currentBet = _local4;
table["pBox" + who].mybet = _local4;
mygame.mybubble.makeBubble(who, "I Bet ", _root.balanceFormat(_local4, 0, ","), 3, 1250);
table["pBox" + who].statusBox.display.text = "Bet " + _root.balanceFormat(_local4, 0, ",");
table["pBox" + who].statusBox.colorBox.gotoAndStop(3);
if (who != 3) {
mygame.updateBalance(who, _local4);
}
mygame.myhand.addToPot(_local4);
break;
case "call" :
_local4 = this.currentBet - table["pBox" + who].mybet;
PlaySoundEffect("SOUND_CHIP2");
table["pBox" + who].mybet = table["pBox" + who].mybet + _local4;
mygame.mybubble.makeBubble(who, "I Call " + _root.balanceFormat(_local4, 0, ","), "blank", 2, 1250);
table["pBox" + who].statusBox.display.text = "Call " + _root.balanceFormat(_local4, 0, ",");
table["pBox" + who].statusBox.colorBox.gotoAndStop(2);
if ((who == 3) && (_root.attachNOchips == false)) {
var _local12 = arena.betBox.bal - _local4;
trace(" ");
trace(" ");
trace("ADDING BACK TO MY BALANCE " + _local12);
trace(" ");
trace(" ");
mygame.updateBalance(who, _local12, "pos");
} else {
mygame.updateBalance(who, _local4);
}
if (this.AllInActive == 1) {
this.potStore[1] = this.potStore[1] + _local4;
yup = true;
}
if (this.AllInActive == 2) {
this.potStore[2] = _local4 - (this.potStore[1] / 2);
this.potStore[1] = this.potStore[1] + (this.potStore[1] / 2);
this.currentpot = 3;
yup = true;
}
if (this.AllInActive == 0) {
mygame.myhand.addToPot(_local4, 0);
} else {
mygame.myhand.addToPot(_local4, 0, true);
}
break;
case "check" :
mygame.mybubble.makeBubble(who, "Check", "blank", 2, 1250);
table["pBox" + who].statusBox.display.text = "Check";
table["pBox" + who].statusBox.colorBox.gotoAndStop(2);
if (who == 3) {
var _local12 = arena.betBox.bal;
mygame.updateBalance(who, _local12, "pos");
}
break;
case "fold" :
this.AllInPool[who] = 0;
PlaySoundEffect("SOUND_SPIN");
arena[("card_" + who) + "_0"]._visible = false;
arena[("card_" + who) + "_1"]._visible = false;
this.handPlayers[who] = "f";
table["pBox" + who].statusBox.display.text = "Folded";
table["pBox" + who].statusBox.colorBox.gotoAndStop(4);
if ((who == 3) && (_root.attachNOchips == false)) {
var _local12 = arena.betBox.bal;
mygame.updateBalance(who, _local12, "pos");
}
table["pBox" + who].cover._visible = true;
}
if (who == 3) {
arena.betBox.removeMovieClip();
ii = 0;
while (ii < (table.chipBox3.chipcount + 1)) {
table["chipBox" + who]["chip" + ii].iButton.gotoAndStop(1);
ii++;
}
}
var _local10 = false;
var ii;
if (((action == "call") || (action == "fold")) || (action == "check")) {
if (this.betStart == this.betStop) {
_local10 = true;
} else {
this.betStart = this.returnNextPlayer(this.betStart);
}
}
if ((action == "raise") || (action == "bet")) {
this.betStop = this.returnNextPlayer(this.betStart, "negative");
this.betStart = this.returnNextPlayer(this.betStart);
this.playOrder = this.getPlayOrder(this.betStart, this.handPlayers);
}
if (((this.AllInActive > 0) && ((action == "call") || (action == "raise"))) && (who == 3)) {
_local10 = false;
this.betStop = 3;
} else if (action == "allin") {
trace(this.AllInActive + " --- allinactive");
if (this.AllInActive < 2) {
this.betStop = this.returnNextPlayer(this.betStart, "negative");
this.betStart = this.returnNextPlayer(this.betStart);
this.playOrder = this.getPlayOrder(this.betStart, this.handPlayers);
} else if (this.betStart == this.betStop) {
_local10 = true;
} else {
this.betStart = this.returnNextPlayer(this.betStart);
this.playOrder = this.getPlayOrder(this.betStart, this.handPlayers);
}
}
var _local7 = 0;
ii = 0;
while (ii < this.handPlayers.length) {
if ((this.handPlayers[ii] == "f") || (this.handPlayers[ii] == "e")) {
_local7++;
}
ii++;
}
if (_local7 >= 4) {
_local10 = true;
}
trace("BET START " + mygame.myhand.betStart);
trace("BET STOP " + mygame.myhand.betStop);
trace(("PLAY ORDER " + this.playOrder) + newline);
if (_local10 == false) {
this.gotoPlayer();
} else {
this.checkRoundStatus();
}
};
TheHand.prototype.checkRoundStatus = function () {
function doComm2() {
mygame.myhand.dealCommunityCards();
clearInterval(intID0009);
}
trace("checking round status");
var _local4 = 0;
var _local6;
var _local3 = 0;
while (_local3 < this.handPlayers.length) {
if ((this.handPlayers[_local3] != "f") && (this.handPlayers[_local3] != "e")) {
table["pBox" + this.handPlayers[_local3]].mybet = 0;
_local4++;
}
_local3++;
}
if (this.AllInActive > 1) {
_local4 = 0;
}
if ((_local4 >= 2) && (this.dealType[0] != "end")) {
_local6 = 1500;
if (this.handPlayers[3] == "f") {
_local6 = 500;
}
intID0009 = setInterval(doComm2, _local6);
} else {
trace("GETTING WINNER");
var _local5 = this.whosLeft();
if (_local4 == 1) {
processHand(_local5[0]);
getWinner(_local5);
} else {
_root.attachMovie("runner", "runner", 1501);
}
}
};
TheHand.prototype.whosLeft = function () {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < this.handPlayers.length) {
if ((this.handPlayers[_local2] != "f") && (this.handPlayers[_local2] != "e")) {
_local3.push(_local2);
}
_local2++;
}
return(_local3);
};
TheHand.prototype.startBetting = function () {
this.numBettors = 0;
this.numRaises = 0;
this.betStop = this.returnNextPlayer(this.dealerSlot);
this.betStop = this.returnNextPlayer(this.betStop);
this.playOrder = this.getPlayOrder(this.betStop, this.handPlayers);
trace("BET START " + mygame.myhand.betStart);
trace("BET STOP " + mygame.myhand.betStop);
trace(("PLAY ORDER " + this.playOrder) + newline);
this.gotoPlayer();
};
TheHand.prototype.keepBetting = function () {
this.numBettors = 0;
this.numRaises = 0;
this.currentBet = 0;
this.betStart = this.returnNextPlayer(this.dealerSlot);
if ((this.handPlayers[this.dealerSlot] != "e") && (this.handPlayers[this.dealerSlot] != "f")) {
this.betStop = this.dealerSlot;
} else {
this.betStop = this.returnNextPlayer(this.dealerSlot, "negative");
}
this.playOrder = this.getPlayOrder(this.betStart, this.handPlayers);
trace("BET START " + mygame.myhand.betStart);
trace("BET STOP " + mygame.myhand.betStop);
trace(("PLAY ORDER " + this.playOrder) + newline);
this.gotoPlayer();
};
TheHand.prototype.returnNextPlayer = function (slot, type) {
var _local2;
var _local3 = slot;
var _local4 = true;
while (((this.handPlayers[_local2] == "f") || (_local4 == true)) || (this.handPlayers[_local2] == "e")) {
_local4 = false;
if (type != "negative") {
_local2 = _local3 + 1;
if (_local2 == this.handPlayers.length) {
_local2 = 0;
}
if ((this.handPlayers[_local2] == "f") || (this.handPlayers[_local2] == "e")) {
_local3++;
if (_local3 == this.handPlayers.length) {
_local3 = 0;
}
}
} else {
_local2 = _local3 - 1;
if (_local2 < 0) {
_local2 = this.handPlayers.length - 1;
}
if ((this.handPlayers[_local2] == "f") || (this.handPlayers[_local2] == "e")) {
_local3--;
if (_local3 < 0) {
_local3 = this.handPlayers.length;
}
}
}
if ((_local3 == 25) || (_local3 < -25)) {
this.handPlayers[_local2] = 4;
}
}
return(_local2);
};
TheHand.prototype.getPlayOrder = function (d, hp) {
var _local6 = new Array();
var _local3 = 0;
var _local5;
_local5 = d + 1;
if (_local5 == 5) {
_local5 = 0;
}
if ((hp[_local5] == "e") || (hp[_local5] == "f")) {
_local5 = this.gpoFix(_local5, hp);
}
var _local4 = 0;
while (_local4 < hp.length) {
if (hp[_local5] == hp[_local4]) {
_local3 = _local4;
break;
}
_local4++;
}
if (_local3 >= hp.length) {
_local3 = 0;
}
_local4 = 0;
while (_local4 < hp.length) {
if ((hp[_local3] != "f") && (hp[_local3] != "e")) {
_local6.push(hp[_local3]);
}
_local3++;
if (_local3 >= hp.length) {
_local3 = 0;
}
_local4++;
}
return(_local6);
};
TheHand.prototype.gpoFix = function (c, ar) {
var _local5;
var _local1 = c;
var _local2 = true;
while (((ar[_local1] == "e") || (ar[_local1] == "f")) || (_local2 == true)) {
_local2 = false;
_local1++;
if (_local1 == 5) {
_local1 = 0;
}
}
return(_local1);
};
TheHand.prototype.getRank = function () {
this.aR = new Array();
var _local2 = 0;
while (_local2 < 5) {
if (_local2 != 2) {
if ((table["chipBox" + _local2].mybalance > 0) && (table["chipBox" + _local2].mybalance != undefined)) {
this.aR.push({amt:table["chipBox" + _local2].mybalance, n:table["pBox" + _local2].myname.text, place:"0"});
} else if (table["pBox" + _local2].myname.text != "") {
this.aR.push({amt:0, n:table["pBox" + _local2].myname.text, place:table["pBox" + _local2].rank});
}
}
_local2++;
}
this.aR.sortOn("place", 18);
this.aR.sortOn("amt", 18);
return(this.aR);
};
TheHand.prototype.getStandings = function (action) {
arena.attachMovie("standings", "standings", this.mydepth++);
if (action == "win") {
arena.standings.gotoAndStop(2);
} else if (action == "lose") {
arena.standings.gotoAndStop(3);
} else if (action == "expired") {
arena.standings.gotoAndStop(4);
} else if (action == "maxed") {
arena.standings.gotoAndStop(5);
arena.standing.msg1.text = ("This web version has a " + maxHandsAllowed) + " hand limit per Round";
arena.standing.msg2.text = ("This web version has a " + maxHandsAllowed) + " hand limit per Round";
arena.standing.msg3.text = ("This web version has a " + maxHandsAllowed) + " hand limit per Round";
}
if ((((action == "win") || (action == "lose")) || (action == "expired")) || (action == "maxed")) {
finalscore = table.chipBox3.mybalance;
if (finalscore == undefined) {
finalscore = 0;
}
totalTimePlayed = Math.floor((getTimer() - ntrecord) / 1000) * 0.01;
if (totalTimePlayed < 0.5) {
totalTimePlayed = 0.5;
}
trace("ttp = " + totalTimePlayed);
trace("nhrec = " + nhrecord);
trace("finalscore = " + finalscore);
powerranking = Math.floor((finalscore / nhrecord) / totalTimePlayed);
arena.standings.powerranking = powerranking;
mygame.mybubble.killBubble();
arena.standings.btn_okay._visible = false;
arena.standings.btn_playagain._visible = true;
arena.standings.btn_download._visible = true;
PlayMusic("MUSIC_INTRO", _root.volM);
arena.standings.btn_playagain.btn.onRelease = function () {
_root.killTheGame("new");
arena.standings.removeMovieClip();
};
arena.standings.btn_mainmenu.btn.onRelease = function () {
_root.killTheGame();
arena.standings.removeMovieClip();
};
arena.standings.btn_download.btn.onRelease = function () {
trace("download pressed");
_root.downloadAction();
};
if (_global.noZoneAPI == true) {
} else {
_root.DoGameEnd();
}
if (_global.realmode == true) {
arena.standings.btn_download._visible = false;
arena.standings.btn_mainmenu._x = arena.standings.btn_mainmenu._x + 60;
arena.standings.btn_playagain._x = arena.standings.btn_playagain._x + 60;
}
} else {
arena.standings.btn_okay._visible = true;
arena.standings.btn_playagain._visible = false;
arena.standings.btn_mainmenu._visible = false;
arena.standings.btn_download._visible = false;
arena.standings.btn_okay.btn.onRelease = function () {
showFlopTurnRiver();
arena.standings.removeMovieClip();
};
}
arena.standings.btn_okay.btn.onPress = function () {
_root.buttonSound();
};
myrank = this.getRank();
var _local4 = 0;
while (_local4 < myrank.length) {
arena.standings["p" + _local4].text = myrank[_local4].n;
if (myrank[_local4].amt > 0) {
arena.standings["score" + _local4].text = balanceFormat(myrank[_local4].amt, 0, ",");
} else {
arena.standings["score" + _local4].text = myrank[_local4].place;
}
trace(arena.standings["p" + _local4].text);
if ((arena.standings["p" + _local4].text == undefined) || (arena.standings["p" + _local4].text == "undefined")) {
arena.standings["p" + _local4].text = " ";
arena.standings["score" + _local4].text = " ";
}
_local4++;
}
var _local5 = 4;
_local4 = mygame.elimPlayers.length - 1;
while (_local4 > -1) {
arena.standings["p" + _local5].text = mygame.elimPlayers[_local4].name;
arena.standings["score" + _local5].text = mygame.elimPlayers[_local4].place;
_local5--;
_local4--;
}
};
killHand = function (who) {
arena.potBox.removeMovieClip();
};
runVersionCheck();
myr = 0;
stop();
function AllinScreen() {
mygame.mybubble.killBubble(5);
mygame.mybubble.killBubble(6);
this.mydepth = 0;
this.dpbox = new Object();
this.dpbox.y = 2;
this.dpbox.b2 = {x0:129.8, x1:359.8};
this.dpbox.b3 = {x0:69.8, x1:244.8, x2:419.8};
this.dpbox.b4 = {x0:29.8, x1:173.1, x2:316.4, x3:459.7};
this.dpbox.b5 = {x0:9.8, x1:127.3, x2:244.8, x3:362.3, x4:479.8};
createEmptyMovieClip("allin", _root.allindepth);
allin.attachMovie("bkgdAllin", "bkgdAllin", this.mydepth++);
this.mydepth++;
this.push3 = false;
this.hp = mygame.myhand.handPlayers;
this.party = new Array();
var _local4 = 0;
while (_local4 < this.hp.length) {
if ((this.hp[_local4] != "f") && (this.hp[_local4] != "e")) {
if (this.hp[_local4] == 3) {
this.push3 = true;
} else {
this.party.push(this.hp[_local4]);
}
}
_local4++;
}
if (this.push3 == true) {
this.party.push(3);
}
var _local5 = "b" + this.party.length;
_local4 = 0;
while (_local4 < this.party.length) {
var _local3 = this.party[_local4];
allin.attachMovie("playerBox", "pBox" + _local3, this.mydepth++);
allin["pBox" + _local3]._x = this.dpbox[_local5]["x" + _local4];
allin["pBox" + _local3]._y = this.dpbox.y;
allin["pBox" + _local3]._xscale = 85;
allin["pBox" + _local3]._yscale = 85;
allin["pBox" + _local3].cover._visible = false;
allin["pBox" + _local3].highlite._visible = false;
allin["pBox" + _local3].statusBox.display.text = table["pBox" + _local3].statusBox.display.text;
allin["pBox" + _local3].myname.text = table["pBox" + _local3].myname.text;
if (_local3 == 3) {
allin["pBox" + _local3].player.gotoAndStop("player");
} else {
myphoto = mygame.gPlayers["player" + _local3].img;
allin["pBox" + _local3].player.gotoAndStop(myphoto);
}
this.c0 = arena[("card_" + _local3) + "_0"]._currentframe;
this.c1 = arena[("card_" + _local3) + "_1"]._currentframe;
allin.attachMovie("card", ("card_" + _local3) + "_0", this.mydepth++);
allin.attachMovie("card", ("card_" + _local3) + "_1", this.mydepth++);
allin[("card_" + _local3) + "_0"].cardback._visible = false;
allin[("card_" + _local3) + "_1"].cardback._visible = false;
allin[("card_" + _local3) + "_0"].gotoAndStop(this.c0);
allin[("card_" + _local3) + "_1"].gotoAndStop(this.c1);
allin[("card_" + _local3) + "_0"]._x = allin["pBox" + _local3]._x + 7;
allin[("card_" + _local3) + "_0"]._y = allin["pBox" + _local3]._y + 120;
allin[("card_" + _local3) + "_1"]._x = allin[("card_" + _local3) + "_0"]._x + 30;
allin[("card_" + _local3) + "_1"]._y = allin[("card_" + _local3) + "_0"]._y + 5;
_local4++;
}
allin.bkgdAllin.potAmount.pot.text = arena.potBox.balance.text;
this.numComm = 0;
if (mygame.myhand.dealType[0] == "turn") {
this.numComm = 3;
} else if (mygame.myhand.dealType[0] == "river") {
this.numComm = 4;
} else if (mygame.myhand.dealType[0] == "end") {
this.numComm = 5;
}
if (this.numComm > 0) {
_local4 = 0;
while (_local4 < this.numComm) {
this.c0 = arena["card_comm_" + _local4]._currentframe;
allin.attachMovie("card", "card_comm_" + _local4, this.mydepth++);
allin["card_comm_" + _local4].cardback._visible = false;
allin["card_comm_" + _local4].gotoAndStop(this.c0);
allin["card_comm_" + _local4]._x = 127 + (70 * _local4);
allin["card_comm_" + _local4]._y = 228;
_local4++;
}
}
if (this.numComm < 5) {
this.dealCommunityCards();
} else {
this.newEndProcess();
}
}
function sayGoodbye(pk) {
playerKill = new Array();
var _local1 = 0;
while (_local1 < pk.length) {
playerKill.push(pk[_local1]);
_local1++;
}
gbcount = 0;
pkcount = 0;
mytry = 0;
killme = setInterval(goodbye, 1400);
mygame.mybubble.makeBubble(6, "Let's thank our", "eliminated players", 3, 2500);
}
function goodbye() {
if (pauseOn == false) {
if (gbcount > 1) {
var _local4 = playerKill[pkcount];
if (pkcount < playerKill.length) {
if (mytry == 0) {
mytry++;
PlaySoundEffect("SOUND_CLAP4");
var _local7 = (table["pBox" + _local4].myname.text + " ") + table["pBox" + _local4].mylastname;
mygame.mybubble.makeBubble(6, _local7, "blank", 3, 1500);
arena.attachMovie("infoBox", "infoBox", _root.mygame.mydepth + 100);
arena.infoBox._x = 52;
arena.infoBox._y = 317;
arena.infoBox.myname.text = (mygame.gPlayers["player" + _local4].first + " ") + mygame.gPlayers["player" + _local4].last;
arena.infoBox.mytag.text = mygame.gPlayers["player" + _local4].lTag;
} else {
mytry = 0;
mygame.currentPlayers[_local4] = "e";
mygame.myhand.handPlayers[_local4] = "e";
table["pBox" + _local4]._visible = false;
table["pBox" + _local4].rank = mygame.finalrank[0];
mygame.finalrank.splice(0, 1);
table["chipBox" + _local4].removeMovieClip();
arena.infoBox.removeMovieClip();
pkcount++;
}
}
}
gbcount++;
if (pkcount >= playerKill.length) {
var _local6 = 0;
var _local3;
var _local5 = false;
_local3 = 0;
while (_local3 < 5) {
if (mygame.currentPlayers[_local3] == "e") {
if (_local3 == 3) {
_local5 = true;
}
_local6++;
}
_local3++;
}
if ((_local6 >= 4) && (_local5 == false)) {
tableMenu.removeMovieClip();
arena.aflop.removeMovieClip();
arena.aturn.removeMovieClip();
arena.ariver.removeMovieClip();
mygame.myhand.getStandings("win");
} else if (_local5 == true) {
mygame.myhand.getStandings("lose");
arena.aflop.removeMovieClip();
arena.aturn.removeMovieClip();
arena.ariver.removeMovieClip();
tableMenu.removeMovieClip();
} else if (_global.noZoneAPI == true) {
trace("no zone");
trace(isGameTimerActive);
if (isGameTimerActive == true) {
var _local8 = getTimer();
if (_local8 > (gameStartTime + gametimer)) {
if (timeraction == "allin") {
botsDoAll = true;
getDealStandings();
} else {
tableMenu.removeMovieClip();
mygame.myhand.getStandings("expired");
}
} else {
getDealStandings();
}
} else {
trace((maxHandsAllowed + " === ") + numHandsPlayed);
if (maxHandsAllowed > 0) {
numHandsPlayed++;
if (numHandsPlayed == maxHandsAllowed) {
if (timeraction == "allin") {
botsDoAll = true;
getDealStandings();
} else {
tableMenu.removeMovieClip();
mygame.myhand.getStandings("maxed");
}
} else {
getDealStandings();
}
} else {
getDealStandings();
}
}
} else if (gamebreaker > (numHandsPlayedX + 1)) {
numHandsPlayedX++;
numHandsPlayed++;
getDealStandings();
} else {
numHandsPlayedX = 0;
DoGameBreak();
}
clearInterval(killme);
}
}
}
if (this.dealType[0] == "flop") {
num = 3;
toinc = 0;
} else if (this.dealType[0] == "turn") {
num = 1;
toinc = 3;
} else if (this.dealType[0] == "river") {
num = 1;
toinc = 4;
}
AllinScreen.prototype.dealCommunityCards = function () {
inc = 70;
if (mygame.myhand.dealType[0] == "flop") {
num = 5;
toinc = 0;
} else if (mygame.myhand.dealType[0] == "turn") {
num = 2;
toinc = 3;
allin.attachMovie("aaflop", "aaflop", 611);
allin.aaflop._x = 129;
allin.aaflop._y = 297;
} else if (mygame.myhand.dealType[0] == "river") {
num = 1;
toinc = 4;
allin.attachMovie("aaflop", "aaflop", 611);
allin.aaflop._x = 129;
allin.aaflop._y = 297;
allin.attachMovie("aaturn", "aaturn", 612);
allin.aaturn._x = 335;
allin.aaturn._y = 297;
}
mygame.myhand.dealType.splice(0, 1);
count = 0;
intID0015 = setInterval(this.doComm, 1000);
};
AllinScreen.prototype.doComm = function () {
if (pauseOn == false) {
if ((num == 5) && (count == 0)) {
allin.attachMovie("aaflop", "aaflop", 611);
allin.aaflop._x = 129;
allin.aaflop._y = 297;
arena.attachMovie("aflop", "aflop", 611);
arena.aflop._x = 174;
arena.aflop._y = 235;
} else if (((num == 5) && (count == 3)) || ((num == 2) && (count == 0))) {
allin.attachMovie("aaturn", "aaturn", 612);
allin.aaturn._x = 335;
allin.aaturn._y = 297;
arena.attachMovie("aturn", "aturn", 612);
arena.aturn._x = 324;
arena.aturn._y = 235;
} else if ((((num == 5) && (count == 4)) || ((num == 2) && (count == 1))) || ((num == 1) && (count == 0))) {
allin.attachMovie("aariver", "aariver", 613);
allin.aariver._x = 406;
allin.aariver._y = 297;
arena.attachMovie("ariver", "ariver", 613);
arena.ariver._x = 374;
arena.ariver._y = 235;
}
PlaySoundEffect("SOUND_DEAL2");
var _local1 = "card_comm_" + mygame.myhand.commcardcount;
arena.attachMovie("card", _local1, mygame.myhand.mydepth++);
arena[_local1]._xscale = 75;
arena[_local1]._yscale = 75;
arena[_local1]._x = 140 + (50 * toinc);
arena[_local1]._y = 179;
allin.attachMovie("card", "card_comm_" + mygame.myhand.commcardcount, myallin.mydepth++);
allin["card_comm_" + mygame.myhand.commcardcount].cardback._visible = false;
allin["card_comm_" + mygame.myhand.commcardcount].gotoAndStop(mygame.myhand.deck[cardcount]);
allin["card_comm_" + mygame.myhand.commcardcount]._x = 127 + (70 * toinc);
allin["card_comm_" + mygame.myhand.commcardcount]._y = 228;
arena[_local1].mycard = mygame.myhand.deck[cardcount];
arena[_local1].gotoAndStop(mygame.myhand.deck[cardcount]);
arena[_local1].cardback._visible = false;
toinc++;
count++;
cardcount++;
mygame.myhand.commcardcount++;
if (count >= num) {
trace(((("count " + count) + " ---- ") + " num ") + num);
myallin.newEndProcess();
clearInterval(intID0015);
}
}
};
AllinScreen.prototype.newEndProcess = function () {
var _local3 = mygame.myhand.whosLeft();
k = 0;
while (k < _local3.length) {
processHand(_local3[k]);
k++;
}
wArray = new Array();
k = 0;
while (k < _local3.length) {
wArray.push({seat:_local3[k], a:_root["bestHand" + _local3[k]][0].a});
k++;
}
wArray.sortOn("a", 18);
tie = checkForTies();
if (tie) {
nameString = "";
k = 0;
while (k < (numTies + 1)) {
_root["who" + k] = wArray[k].seat;
namestring = namestring + table["pBox" + _root["who" + k]].myname.text;
if (k < numTies) {
namestring = namestring + ", ";
}
k++;
}
if (mygame.myhand.AllInActive > 0) {
winnings = Math.floor(arena.potBox.bal / (numTies + 1));
} else {
winnings = Math.floor(arena.potBox.bal / (numTies + 1));
}
remainder = arena.potBox.bal - (winnings * (numTies + 1));
} else {
mywho = wArray[0].seat;
winnerName = table["pBox" + mywho].myname.text;
winnerLastName = table["pBox" + mywho].mylastname;
winnings = arena.potBox.bal;
}
mygame.mybubble.makeBubble(10, "Lets see what", "we got", 1, 1000);
intID0016 = setInterval(this.endComm, 1500);
};
AllinScreen.prototype.endComm = function () {
count = 0;
playerIsInTheGame = false;
var _local1 = myallin.party.length - 1;
if (myallin.party[_local1] == 3) {
playerIsInTheGame = true;
count = _local1;
myallin.finalCut();
myallin.party.splice(_local1, 1);
count = 0;
} else {
myallin.finalCut();
}
intID0017 = setInterval(myallin.finalCut, 3500);
clearInterval(intID0016);
};
AllinScreen.prototype.finalCut = function () {
if (pauseOn == false) {
var _local5 = myallin.party[count];
if (allin["pBox" + _local5].myname.text != undefined) {
var _local2 = 0;
while (_local2 < myallin.party.length) {
allin["pBox" + myallin.party[_local2]].highlite._visible = false;
_local2++;
}
allin.pBox3.highlite._visible = false;
allin["pBox" + _local5].highlite._visible = true;
_local2 = 0;
while (_local2 < 5) {
allin["card_comm_" + _local2].cardback._visible = true;
allin[(("card_" + _local2) + "_") + 0].cardback._visible = true;
allin[(("card_" + _local2) + "_") + 1].cardback._visible = true;
allin["card_comm_" + _local2].cardback.gotoAndStop(4);
allin[(("card_" + _local2) + "_") + 0].cardback.gotoAndStop(4);
allin[(("card_" + _local2) + "_") + 1].cardback.gotoAndStop(4);
_local2++;
}
highlightWinningCards(_local5, true);
var _local4 = _root["bestHand" + _local5][0].h[0];
var _local3 = "";
if (_local4 == 0) {
PlaySoundEffect("SOUND_HIGHCARD");
_local3 = "HIGH CARD";
} else if (_local4 == 1) {
PlaySoundEffect("SOUND_PAIR");
_local3 = "PAIR";
} else if (_local4 == 2) {
PlaySoundEffect("SOUND_2PAIR");
_local3 = "TWO PAIR";
} else if (_local4 == 3) {
PlaySoundEffect("SOUND_3KIND");
_local3 = "3 of a Kind";
} else if (_local4 == 4) {
PlaySoundEffect("SOUND_STRAIGHT");
_local3 = "Straight";
} else if (_local4 == 5) {
PlaySoundEffect("SOUND_FLUSH");
_local3 = "Flush";
} else if (_local4 == 6) {
PlaySoundEffect("SOUND_FULLHOUSE");
_local3 = "Full House";
} else if (_local4 == 7) {
PlaySoundEffect("SOUND_4KIND");
_local3 = "4 of a Kind";
} else if (_local4 == 8) {
PlaySoundEffect("SOUND_STRAIGHTFLUSH");
_local3 = "Straight Flush";
} else if (_local4 == 9) {
PlaySoundEffect("SOUND_ROYALFLUSH");
_local3 = "Royal Flush";
}
allin["pBox" + _local5].statusBox.display.text = _local3;
allin["pBox" + _local5].statusBox.colorBox.gotoAndStop(1);
mygame.mybubble.makeBubble(10, allin["pBox" + _local5].myname.text + " has a", _local3, 1, 3000);
}
count++;
if (count > myallin.party.length) {
trace("Announcing Winner");
count = 0;
intID0018 = setInterval(myallin.announceWinner, 1000);
clearInterval(intID0017);
}
}
};
AllinScreen.prototype.announceWinner = function () {
if (pauseOn == false) {
var _local2;
if (!tie) {
if (count == 0) {
mygame.mybubble.makeBubble(10, "And the winner is...", "blank", 1, 1500);
}
if (count == 2) {
PlaySoundEffect("SOUND_CHEER");
mygame.mybubble.makeBubble(10, winnerName + "!", "blank", 1, 1500);
}
if (count == 4) {
mygame.mybubble.makeBubble("special", "With a", _root["bestHand" + wArray[0].seat][0].t, 1, 2250);
arena.attachMovie("greentext", "greentext", mygame.myhand.mydepth++);
arena.greentext._x = 178.6;
arena.greentext._y = 155.7;
arena.greentext.display.text = _root["bestHand" + wArray[0].seat][0].t;
arena.greentext.shadow.text = _root["bestHand" + wArray[0].seat][0].t;
k = 0;
while (k < 5) {
allin["card_comm_" + k].cardback.gotoAndStop(4);
allin[(("card_" + k) + "_") + 0].cardback.gotoAndStop(4);
allin[(("card_" + k) + "_") + 1].cardback.gotoAndStop(4);
k++;
}
highlightWinningCards(mywho, true);
highlightWinningCards(mywho);
var k = 0;
while (k < myallin.party.length) {
allin["pBox" + myallin.party[k]].highlite._visible = false;
allin["pBox" + myallin.party[k]].cover._visible = true;
allin["pBox" + myallin.party[k]].statusBox.display.text = "LOST";
allin["pBox" + myallin.party[k]].statusBox.colorBox.gotoAndStop(4);
k++;
}
if (playerIsInTheGame == true) {
allin.pBox3.highlite._visible = false;
allin.pBox3.cover._visible = true;
allin.pBox3.statusBox.display.text = "LOST";
allin.pBox3.statusBox.colorBox.gotoAndStop(4);
}
allin.pBox3.highlite._visible = false;
allin["pBox" + mywho].highlite._visible = true;
allin["pBox" + mywho].cover._visible = false;
allin["pBox" + mywho].statusBox.display.text = "WINNER!";
allin["pBox" + mywho].statusBox.colorBox.gotoAndStop(3);
}
if (count == 6) {
trace("trying to finish allin");
myallin.finishAllin();
clearInterval(intID0018);
}
} else {
if (count == 0) {
mygame.mybubble.makeBubble(10, "And the winner is...", "blank", 1, 1500);
}
if (count == 2) {
mygame.mybubble.makeBubble(10, "Split Pot!", "blank", 1, 1500);
}
if (count == 4) {
PlaySoundEffect("SOUND_CLAP1");
mygame.mybubble.makeBubble("special", "With a", _root["bestHand" + wArray[0].seat][0].t, 1, 1500);
arena.attachMovie("greentext", "greentext", mygame.myhand.mydepth++);
arena.greentext._x = 180.6;
arena.greentext._y = 155.7;
arena.greentext.display.text = _root["bestHand" + wArray[0].seat][0].t;
arena.greentext.shadow.text = _root["bestHand" + wArray[0].seat][0].t;
_local2 = 0;
while (_local2 < myallin.party.length) {
allin["pBox" + myallin.party[_local2]].highlite._visible = false;
allin["pBox" + myallin.party[_local2]].cover._visible = true;
allin["pBox" + myallin.party[_local2]].statusBox.display.text = "LOST";
allin["pBox" + myallin.party[_local2]].statusBox.colorBox.gotoAndStop(4);
_local2++;
}
if (playerIsInTheGame == true) {
allin.pBox3.highlite._visible = false;
allin.pBox3.cover._visible = true;
allin.pBox3.statusBox.display.text = "LOST";
allin.pBox3.statusBox.colorBox.gotoAndStop(4);
}
allin.pBox3.highlite._visible = false;
_local2 = 0;
while (_local2 < (numTies + 1)) {
allin["pBox" + wArray[_local2].seat].highlite._visible = true;
allin["pBox" + wArray[_local2].seat].cover._visible = false;
allin["pBox" + wArray[_local2].seat].statusBox.display.text = "WINNER!";
allin["pBox" + wArray[_local2].seat].statusBox.colorBox.gotoAndStop(3);
highlightWinningCards(wArray[_local2].seat, true);
highlightWinningCards(wArray[_local2].seat);
_local2++;
}
}
if (count == 7) {
myallin.finishAllin();
clearInterval(intID0018);
}
}
count++;
}
};
AllinScreen.prototype.finishAllin = function () {
var _local29;
trace("finishin allin");
var _local3;
var _local4;
var _local5;
who = mywho;
PlaySoundEffect("SOUND_CLAP3");
var _local28 = mygame.myhand.whosLeft();
trace("ALL PLAYERS IN SHOWDOWN " + _local28.length);
if (mygame.myhand.AllInActive > 2) {
var _local8;
var _local7 = new Array(new Array(), new Array(), new Array(), new Array(), new Array());
var _local6 = new Array();
_local4 = 0;
while (_local4 < 5) {
if (mygame.myhand.AllInPool[_local4] > 0) {
_local6.push({who:_local4, amt:mygame.myhand.AllInPool[_local4], a:0});
}
_local4++;
}
_local4 = 0;
while (_local4 < 5) {
_local5 = 0;
while (_local5 < 5) {
if (wArray[_local4].seat == _local6[_local5].who) {
_local6[_local5].a = wArray[_local4].a;
}
_local5++;
}
_local4++;
}
_local6.sortOn("amt", 18);
mygame.myhand.potStore[1] = mygame.myhand.potStore[1] + mygame.myhand.basicPot;
if (mygame.myhand.AllInActive == 3) {
if (numTies == 0) {
_local7[0].push(wArray[0].seat);
_local7[1].push(wArray[0].seat);
} else if (numTies == 1) {
mygame.myhand.potStore[0] = mygame.myhand.potStore[0] / 2;
mygame.myhand.potStore[1] = mygame.myhand.potStore[1] / 2;
_local7[0].push(wArray[0].seat);
_local7[0].push(wArray[1].seat);
_local7[1].push(wArray[0].seat);
_local7[1].push(wArray[1].seat);
} else if (numTies == 2) {
mygame.myhand.potStore[0] = mygame.myhand.potStore[0] / 3;
mygame.myhand.potStore[1] = mygame.myhand.potStore[1] / 3;
_local7[0].push(wArray[0].seat);
_local7[0].push(wArray[1].seat);
_local7[0].push(wArray[2].seat);
_local7[1].push(wArray[0].seat);
_local7[1].push(wArray[1].seat);
_local7[1].push(wArray[2].seat);
}
if (_local6[0].a > _local6[1].a) {
_local7[2].push(_local6[0].who);
} else if (_local6[0].a < _local6[1].a) {
_local7[2].push(_local6[1].who);
} else if (_local6[0].a == _local6[1].a) {
mygame.myhand.potStore[2] = mygame.myhand.potStore[2] / 2;
_local7[2].push(_local6[0].who);
_local7[2].push(_local6[1].who);
}
_local7[3].push(_local6[0].who);
} else if (mygame.myhand.AllInActive == 4) {
if (numTies == 0) {
trace("if spot = 1");
_local7[0].push(wArray[0].seat);
_local7[1].push(wArray[0].seat);
} else if (numTies == 1) {
trace("if spot = 2");
mygame.myhand.potStore[0] = mygame.myhand.potStore[0] / 2;
mygame.myhand.potStore[1] = mygame.myhand.potStore[1] / 2;
_local7[0].push(wArray[0].seat);
_local7[0].push(wArray[1].seat);
_local7[1].push(wArray[0].seat);
_local7[1].push(wArray[1].seat);
} else if (numTies == 2) {
trace("if spot = 3");
mygame.myhand.potStore[0] = mygame.myhand.potStore[0] / 3;
mygame.myhand.potStore[1] = mygame.myhand.potStore[1] / 3;
_local7[0].push(wArray[0].seat);
_local7[0].push(wArray[1].seat);
_local7[0].push(wArray[2].seat);
_local7[1].push(wArray[0].seat);
_local7[1].push(wArray[1].seat);
_local7[1].push(wArray[2].seat);
} else if (numTies == 3) {
trace("if spot = 4");
mygame.myhand.potStore[0] = mygame.myhand.potStore[0] / 4;
mygame.myhand.potStore[1] = mygame.myhand.potStore[1] / 4;
_local7[0].push(wArray[0].seat);
_local7[0].push(wArray[1].seat);
_local7[0].push(wArray[2].seat);
_local7[0].push(wArray[3].seat);
_local7[1].push(wArray[0].seat);
_local7[1].push(wArray[1].seat);
_local7[1].push(wArray[2].seat);
_local7[1].push(wArray[3].seat);
}
var _local24 = false;
if ((_local6[0].a == _local6[1].a) && (_local6[0].a == _local6[2].a)) {
trace("if spot = 5");
_local24 = true;
mygame.myhand.potStore[2] = mygame.myhand.potStore[2] / 3;
_local7[2].push(_local6[0].who);
_local7[20].push(_local6[1].who);
_local7[2].push(_local6[2].who);
}
if ((_local6[0].a == _local6[1].a) && (_local6[0].a != _local6[2].a)) {
trace("if spot = 6");
_local24 = true;
mygame.myhand.potStore[2] = mygame.myhand.potStore[2] / 2;
_local7[2].push(_local6[0].who);
_local7[2].push(_local6[1].who);
}
if ((_local6[0].a == _local6[2].a) && (_local6[0].a != _local6[1].a)) {
trace("if spot = 7");
_local24 = true;
mygame.myhand.potStore[2] = mygame.myhand.potStore[2] / 2;
_local7[2].push(_local6[0].who);
_local7[2].push(_local6[2].who);
}
if ((_local6[1].a == _local6[2].a) && (_local6[1].a != _local6[0].a)) {
trace("if spot = 8");
_local24 = true;
mygame.myhand.potStore[2] = mygame.myhand.potStore[2] / 2;
_local7[2].push(_local6[2].who);
_local7[2].push(_local6[1].who);
}
if (_local24 == false) {
if ((_local6[0].a > _local6[1].a) && (_local6[0].a > _local6[2].a)) {
trace("if spot = 9");
_local7[2].push(_local6[0].who);
} else if ((_local6[1].a > _local6[0].a) && (_local6[1].a > _local6[2].a)) {
trace("if spot = 10");
_local7[2].push(_local6[1].who);
} else if ((_local6[2].a > _local6[1].a) && (_local6[2].a > _local6[0].a)) {
trace("if spot = 11");
_local7[2].push(_local6[2].who);
}
}
if (_local6[0].a > _local6[1].a) {
trace("if spot = 12");
_local7[3].push(_local6[0].who);
} else if (_local6[0].a < _local6[1].a) {
trace("if spot = 13");
_local7[3].push(_local6[1].who);
} else if (_local6[0].a == _local6[1].a) {
trace("if spot = 14");
mygame.myhand.potStore[3] = mygame.myhand.potStore[3] / 2;
_local7[3].push(_local6[0].who);
_local7[3].push(_local6[1].who);
}
_local7[4].push(_local6[0].who);
}
trace("pot1 " + mygame.myhand.potStore[1]);
_local4 = 0;
while (_local4 < 5) {
cashback = 0;
if (_local4 != 2) {
mylost = table["chipBox" + _local4].enchilada;
if (mylost < 0) {
mylost = mylost - (mylost * 2);
}
origmylost = mylost;
_local5 = 0;
while (_local5 < 5) {
_local8 = 0;
while (_local8 < _local7[_local5].length) {
if (_local7[_local5][_local8] == _local4) {
mylost = mylost - mygame.myhand.potStore[_local5];
cashback = cashback + mygame.myhand.potStore[_local5];
}
_local8++;
}
_local5++;
}
mygame.updateBalance(_local4, cashback, "pos");
if (mylost >= cashback) {
table["pBox" + _local4].statusBox.display.text = "Lost " + _root.balanceFormat(mylost, 0, ",");
table["pBox" + _local4].statusBox.colorBox.gotoAndStop(1);
} else if (cashback > origmylost) {
var _local9 = cashback - origmylost;
table["pBox" + _local4].statusBox.display.text = "Won " + _root.balanceFormat(_local9, 0, ",");
table["pBox" + _local4].statusBox.colorBox.gotoAndStop(3);
table["pBox" + _local4].cover._visible = false;
table["chipBox" + _local4]._visible = true;
} else {
mylost = origmylost - cashback;
table["pBox" + _local4].statusBox.display.text = "Lost " + _root.balanceFormat(mylost, 0, ",");
table["pBox" + _local4].statusBox.colorBox.gotoAndStop(1);
}
if ((_local4 == who) && (numTies == 0)) {
mygame.mybubble.makeBubble(6, winnerName + " Wins", _root.balanceFormat(_local9, 0, ","), 3, 2500);
}
}
_local4++;
}
arena.potBox.bal = 0;
arena.potBox.removeMovieClip();
if (numTies > 0) {
mygame.mybubble.makeBubble(6, "Congratulations", "winners!", 3, 2500);
}
} else if (!tie) {
var mylost;
var _local10;
var _local26;
var _local11 = 0;
var _local19 = 0;
_local26 = table["chipBox" + who].enchilada;
_local10 = _local26 - (_local26 * 2);
_local3 = 0;
while (_local3 < mygame.myhand.handPlayers.length) {
mylost = table["chipBox" + _local3].enchilada;
if (mylost < 0) {
mylost = mylost - (mylost * 2);
}
if ((mylost > _local10) && (_local3 != who)) {
_local11 = mylost - _local10;
_local19 = _local19 + _local11;
mygame.updateBalance(_local3, _local11, "pos");
table["pBox" + _local3].statusBox.display.text = "Lost " + _root.balanceFormat(_local10, 0, ",");
} else {
table["pBox" + _local3].statusBox.display.text = "Lost " + _root.balanceFormat(mylost, 0, ",");
}
table["pBox" + _local3].statusBox.colorBox.gotoAndStop(1);
_local3++;
}
_local29 = winnings + table["chipBox" + who].enchilada;
adjustedWinnings = arena.potBox.bal - _local19;
adjustedWinnings2 = adjustedWinnings - _local10;
mygame.updateBalance(who, adjustedWinnings, "pos");
table["pBox" + who].statusBox.display.text = "Won " + _root.balanceFormat(adjustedWinnings2, 0, ",");
table["pBox" + who].statusBox.colorBox.gotoAndStop(3);
table["pBox" + who].cover._visible = false;
table["chipBox" + who]._visible = true;
arena.potBox.bal = 0;
arena.potBox.removeMovieClip();
mygame.mybubble.makeBubble(6, winnerName + " Wins", _root.balanceFormat(adjustedWinnings2, 0, ","), 3, 2500);
} else {
var _local13 = 0;
var _local25 = arena.potBox.bal;
var _local21 = 0;
var _local12 = 0;
PlaySoundEffect("SOUND_CLAP3");
var mylost;
_local3 = 0;
while (_local3 < mygame.myhand.handPlayers.length) {
mylost = table["chipBox" + _local3].enchilada;
if (mylost < 0) {
mylost = mylost - (mylost * 2);
}
table["pBox" + _local3].statusBox.display.text = "Lost " + _root.balanceFormat(mylost, 0, ",");
table["pBox" + _local3].statusBox.colorBox.gotoAndStop(1);
_local3++;
}
var _local23 = new Array();
var _local14 = new Array();
_local3 = 0;
while (_local3 < (numTies + 1)) {
_local21 = _local21 + table["pBox" + _root["who" + _local3]].mybet;
_local14 = new Array({pos:_root["who" + _local3], amt:table["pBox" + _root["who" + _local3]].mybet});
_local23.push(_local14);
_local3++;
}
this.xtra0 = 0;
this.xtra1 = 0;
this.xtra2 = 0;
this.xtra3 = 0;
this.xtra4 = 0;
if (mygame.myhand.AllInActive > 0) {
if (mygame.myhand.AllInPool[_root.who0] > mygame.myhand.AllInPool[_root.who1]) {
this["xtra" + _root.who0] = mygame.myhand.AllInPool[_root.who0] - mygame.myhand.AllInPool[_root.who1];
_local25 = _local25 - this["xtra" + _root.who0];
} else if (mygame.myhand.AllInPool[_root.who1] > mygame.myhand.AllInPool[_root.who0]) {
this["xtra" + _root.who1] = mygame.myhand.AllInPool[_root.who1] - mygame.myhand.AllInPool[_root.who0];
_local25 = _local25 - this["xtra" + _root.who1];
}
}
trace("TOTAL POT " + _local25);
trace("xtra - " + this["xtra" + _root.who0]);
trace("xtra - " + this["xtra" + _root.who1]);
_local12 = Math.floor((_local25 - _local21) / (numTies + 1));
_local3 = 0;
while (_local3 < (numTies + 1)) {
_local13 = (table["pBox" + _root["who" + _local3]].mybet + _local12) + this["xtra" + _root["who" + _local3]];
mygame.updateBalance(_root["who" + _local3], _local13, "pos");
_local3++;
}
_local3 = 0;
while (_local3 < (numTies + 1)) {
table["pBox" + _root["who" + _local3]].statusBox.display.text = "Won " + _root.balanceFormat(_local12, 0, ",");
table["pBox" + _root["who" + _local3]].statusBox.colorBox.gotoAndStop(3);
_local3++;
}
arena.potBox.bal = 0;
arena.potBox.removeMovieClip();
mygame.mybubble.makeBubble(6, "Winners Each Get", _root.balanceFormat(_local12, 0, ","), 3, 2500);
}
DoScoreBroadcast();
var _local20 = _root.bigblind;
var _local22 = _root.ante;
if (((((((((nhrecord == blindincrement) || (nhrecord == (blindincrement * 2))) || (nhrecord == (blindincrement * 3))) || (nhrecord == (blindincrement * 4))) || (nhrecord == (blindincrement * 5))) || (nhrecord == (blindincrement * 6))) || (nhrecord == (blindincrement * 7))) || (nhrecord == (blindincrement * 8))) || (nhrecord == (blindincrement * 9))) {
var _local27 = betLevel + 1;
_local20 = prePay[_local27][0];
_local22 = prePay[_local27][2];
}
var _local18 = new Array();
xtraPot = 0;
_local3 = 0;
while (_local3 < mygame.myhand.handPlayers.length) {
trace("balances - " + table["chipBox" + _local3].mybalance);
if ((table["chipBox" + _local3].mybalance <= (_local20 + _local22)) && (table["chipBox" + _local3].mybalance != undefined)) {
if (table["chipBox" + _local3].mybalance > 0) {
xtraPot = xtraPot + table["chipBox" + _local3].mybalance;
table["chipBox" + _local3].mybalance = 0;
}
_local18.push(_local3);
}
_local3++;
}
if (_local18.length > 0) {
sayGoodbye(_local18);
myallin.closeAllin(who);
} else {
getDealStandings();
myallin.closeAllin(who);
}
};
AllinScreen.prototype.closeAllin = function (mywho) {
var _local1;
_local1 = 0;
while (_local1 < 5) {
var _local2 = "card_comm_" + _local1;
arena[_local2]._x = 175 + (50 * _local1);
arena[_local2]._y = 175;
_local1++;
}
allin.removeMovieClip();
makeStarburst(mywho);
};
Frame 5
DoCustomReturn(_root.CustomData);
stop();
Frame 10
DoGameContinue(_root.GameBreakData);
stop();
Frame 15
DoGameMenu();
stop();
Frame 20
tmpvol = vol;
tmpvolM = volM;
vol = 0;
volM = 0;
this.SetMusicVolume();
stop();
Frame 25
vol = tmpvol;
volM = tmpvolM;
this.SetMusicVolume();
stop();
Frame 30
gamePause();
stop();
Frame 35
gamePauseOff();
stop();
Frame 40
DoGameStart();
stop();
Frame 45
DoSessionStart();
stop();
Symbol 18 MovieClip [loading] Frame 1
function loadedIndicatorFrame() {
var _local2 = int((_parent.getBytesLoaded() / _parent.getBytesTotal()) * 65) + 2;
if ((_local2 - lastFrame) > 4) {
lastFrame = lastFrame + 4;
loadedText = ((int(((_parent.getBytesTotal() / 1024) * (lastFrame - 2)) / 65) + "kb of ") + int(_parent.getBytesTotal() / 1024)) + "kb";
} else if ((_local2 - lastFrame) > 0) {
lastFrame++;
loadedText = ((int(_parent.getBytesLoaded() / 1024) + "kb of ") + int(_parent.getBytesTotal() / 1024)) + "kb";
} else {
loadedText = ((int(_parent.getBytesLoaded() / 1024) + "kb of ") + int(_parent.getBytesTotal() / 1024)) + "kb";
}
return(lastFrame);
}
lastFrame = 1;
Symbol 65 Button
on (release) {
_root.shockMe("view", 0);
}
on (press) {
_root.playSound("click");
}
Symbol 75 MovieClip Frame 1
stop();
Symbol 78 MovieClip [bkgdSplash] Frame 1
stop();
Instance of Symbol 18 MovieClip [loading] in Symbol 78 MovieClip [bkgdSplash] Frame 1
onClipEvent (load) {
if (_root.getBytesTotal() == _root.getBytesLoaded()) {
quickPlay = true;
} else {
preLoad = _root.getBytesTotal() * 0.75;
}
}
onClipEvent (enterFrame) {
gotoAndStop(loadedIndicatorFrame());
if (quickPlay == true) {
if (_currentframe == _totalframes) {
if (_global.noZoneAPI == true) {
_parent.btn_start._visible = true;
if (_global.shockwave) {
_parent.vs._visible = true;
_parent.vsint._visible = true;
} else {
_parent.vsint._visible = false;
_parent.vs._visible = false;
}
_root.PlaySoundEffect("SOUND_CHIP1");
_parent.play();
} else {
_root.DoSessionReady();
_parent.play();
}
}
} else if ((_root.getBytesLoaded() >= preLoad) && (_currentframe == _totalframes)) {
if (_global.noZoneAPI == true) {
_parent.btn_start._visible = true;
_root.PlaySoundEffect("SOUND_CHIP1");
_parent.play();
} else {
_root.DoSessionReady();
_parent.play();
}
}
}
Symbol 78 MovieClip [bkgdSplash] Frame 2
stop();
Symbol 155 MovieClip Frame 1
stop();
Symbol 180 MovieClip Frame 1
stop();
Symbol 194 MovieClip [bkgdUpsell] Frame 1
stop();
Symbol 217 Button
on (press) {
startDrag ("", false, left, top, right, bottom);
dragging = true;
}
on (release, releaseOutside) {
stopDrag();
dragging = false;
}
Instance of Symbol 218 MovieClip "tSnd" in Symbol 229 MovieClip [bkgdOptions] Frame 1
onClipEvent (load) {
top = _y;
bottom = _y;
center = 353;
left = center - 80;
right = center + 80;
count = 9;
}
onClipEvent (enterFrame) {
if (dragging == true) {
count++;
if (count == 10) {
_root.PlaySoundEffect("SOUND_BEEP1");
count = 0;
}
_root.vol = Math.round((_x - 273) * 0.623);
}
}
Instance of Symbol 218 MovieClip "tMusic" in Symbol 229 MovieClip [bkgdOptions] Frame 1
onClipEvent (load) {
top = _y;
bottom = _y;
center = 353;
left = center - 80;
right = center + 80;
count = 9;
}
onClipEvent (enterFrame) {
if (dragging == true) {
count++;
if (count == 10) {
_root.PlaySoundEffect("SOUND_BEEP1");
count = 0;
}
_root.volM = Math.round((_x - 273) * 0.623);
_root.SetMusicVolume();
}
}
Symbol 240 MovieClip Frame 1
stop();
Symbol 242 Button
on (rollOver) {
_parent.chipRollOver.gotoAndStop(2);
}
on (rollOut, dragOut, releaseOutside) {
_parent.chipRollOver.gotoAndStop(1);
}
Symbol 243 MovieClip Frame 1
stop();
Symbol 243 MovieClip Frame 2
stop();
Symbol 268 MovieClip [p-2p16] Frame 1
stop();
Symbol 281 MovieClip [p-2p15] Frame 1
stop();
Symbol 294 MovieClip [p-2p14] Frame 1
stop();
Symbol 307 MovieClip [p-2p13] Frame 1
stop();
Symbol 320 MovieClip [p-2p12] Frame 1
stop();
Symbol 333 MovieClip [p-2p11] Frame 1
stop();
Symbol 346 MovieClip [p-2p10] Frame 1
stop();
Symbol 359 MovieClip [p-2p9] Frame 1
stop();
Symbol 372 MovieClip [p-2p8] Frame 1
stop();
Symbol 385 MovieClip [p-2p7] Frame 1
stop();
Symbol 398 MovieClip [p-2p6] Frame 1
stop();
Symbol 411 MovieClip [p-2p5] Frame 1
stop();
Symbol 424 MovieClip [p-2p4] Frame 1
stop();
Symbol 429 MovieClip [p-2p3] Frame 1
stop();
Symbol 442 MovieClip [p-2p2] Frame 1
stop();
Symbol 455 MovieClip [p-2p1] Frame 1
stop();
Symbol 461 MovieClip Frame 1
function killPlayers(who) {
var _local2 = 0;
while (_local2 < 16) {
this["po" + _local2]._visible = false;
_local2++;
}
this["po" + who]._visible = true;
}
killPlayers(0);
myid = 0;
this["po" + myid].gotoAndStop("playing");
Symbol 461 MovieClip Frame 2
killPlayers(1);
myid = 1;
this["po" + myid].gotoAndStop("playing");
Symbol 461 MovieClip Frame 3
killPlayers(2);
myid = 2;
this["po" + myid].gotoAndStop("playing");
Symbol 461 MovieClip Frame 4
killPlayers(3);
myid = 3;
this["po" + myid].gotoAndStop("playing");
Symbol 461 MovieClip Frame 5
killPlayers(4);
myid = 4;
this["po" + myid].gotoAndStop("playing");
Symbol 461 MovieClip Frame 6
killPlayers(5);
myid = 5;
this["po" + myid].gotoAndStop("playing");
Symbol 461 MovieClip Frame 7
killPlayers(6);
myid = 6;
this["po" + myid].gotoAndStop("playing");
Symbol 461 MovieClip Frame 8
killPlayers(7);
myid = 7;
this["po" + myid].gotoAndStop("playing");
Symbol 461 MovieClip Frame 9
killPlayers(8);
myid = 8;
this["po" + myid].gotoAndStop("playing");
Symbol 461 MovieClip Frame 10
killPlayers(9);
myid = 9;
this["po" + myid].gotoAndStop("playing");
Symbol 461 MovieClip Frame 11
killPlayers(10);
myid = 10;
this["po" + myid].gotoAndStop("playing");
Symbol 461 MovieClip Frame 12
killPlayers(11);
myid = 11;
this["po" + myid].gotoAndStop("playing");
Symbol 461 MovieClip Frame 13
killPlayers(12);
myid = 12;
this["po" + myid].gotoAndStop("playing");
Symbol 461 MovieClip Frame 14
killPlayers(13);
myid = 13;
this["po" + myid].gotoAndStop("playing");
Symbol 461 MovieClip Frame 15
killPlayers(14);
myid = 14;
this["po" + myid].gotoAndStop("playing");
Symbol 461 MovieClip Frame 16
killPlayers(15);
myid = 15;
this["po" + myid].gotoAndStop("playing");
Symbol 473 MovieClip Frame 1
stop();
Symbol 478 MovieClip Frame 1
stop();
Symbol 478 MovieClip Frame 2
play();
Symbol 488 MovieClip Frame 1
stop();
Symbol 615 MovieClip [bkgdEnterName] Frame 1
Selection.setFocus("username");
Symbol 625 MovieClip Frame 1
stop();
Symbol 630 MovieClip [bubbles] Frame 1
stop();
Symbol 637 MovieClip [bubblel] Frame 1
stop();
Symbol 663 Button
on (release) {
if (_parent.powerranking > 0) {
_root.shockMe("submit", _parent.powerranking);
}
}
Symbol 667 MovieClip Frame 1
stop();
Symbol 674 Button
on (release) {
_root.shockMe("view", _parent.powerranking);
}
on (press) {
_root.playSound("click");
}
Symbol 680 MovieClip [standings] Frame 1
stop();
Symbol 680 MovieClip [standings] Frame 2
if (_global.shockwave) {
btn_mainmenu._x = 482.4;
vs._visible = true;
vsint._visible = true;
ss._visible = true;
ssint._visible = true;
} else if (_global.noZoneAPI == false) {
vsint._visible = false;
vs._visible = false;
ssint._visible = false;
ss._visible = false;
btn_mainmenu._x = 482.4;
} else {
vsint._visible = false;
vs._visible = false;
ssint._visible = false;
ss._visible = false;
pr._visible = false;
}
if ((_root.powerranking == 0) && (_global.shockwave)) {
ssint._visible = false;
ss._visible = false;
}
Symbol 680 MovieClip [standings] Frame 3
if (_global.shockwave) {
btn_mainmenu._x = 482.4;
vs._visible = true;
vsint._visible = true;
ss._visible = true;
ssint._visible = true;
sscover.gotoAndStop(2);
} else if (_global.noZoneAPI == false) {
vsint._visible = false;
vs._visible = false;
ssint._visible = false;
ss._visible = false;
btn_mainmenu._x = 482.4;
} else {
vsint._visible = false;
vs._visible = false;
ssint._visible = false;
ss._visible = false;
pr._visible = false;
}
if ((_root.powerranking == 0) && (_global.shockwave)) {
ssint._visible = false;
ss._visible = false;
}
Symbol 680 MovieClip [standings] Frame 4
if (_global.shockwave) {
btn_mainmenu._x = 482.4;
vs._visible = true;
vsint._visible = true;
ss._visible = true;
ssint._visible = true;
} else if (_global.noZoneAPI == false) {
vsint._visible = false;
vs._visible = false;
ssint._visible = false;
ss._visible = false;
btn_mainmenu._x = 482.4;
} else {
vsint._visible = false;
vs._visible = false;
ssint._visible = false;
ss._visible = false;
pr._visible = false;
}
if ((_root.powerranking == 0) && (_global.shockwave)) {
ssint._visible = false;
ss._visible = false;
}
Symbol 680 MovieClip [standings] Frame 5
if (_global.shockwave) {
btn_mainmenu._x = 482.4;
vs._visible = true;
vsint._visible = true;
ss._visible = true;
ssint._visible = true;
} else if (_global.noZoneAPI == false) {
vsint._visible = false;
vs._visible = false;
ssint._visible = false;
ss._visible = false;
btn_mainmenu._x = 482.4;
} else {
vsint._visible = false;
vs._visible = false;
ssint._visible = false;
ss._visible = false;
pr._visible = false;
}
if ((_root.powerranking == 0) && (_global.shockwave)) {
ssint._visible = false;
ss._visible = false;
}
Symbol 699 MovieClip [runner] Frame 1
play();
Symbol 699 MovieClip [runner] Frame 45
_root.initAllin();
this.removeMovieClip();
Symbol 700 MovieClip [aiman] Frame 1
play();
Symbol 700 MovieClip [aiman] Frame 30
trace(who + " CALLING FROM AIPAUSER");
_root.mygame.myhand.doAIBetAction(who);
_parent[this._name].removeMovieClip();
Symbol 700 MovieClip [aiman] Frame 31
stop();