Combined Code
movieClip 3 chip_10 {
}
movieClip 5 chip_100 {
}
movieClip 7 {
}
movieClip 8 chip_500 {
}
movieClip 10 chip_50 {
}
frame 1 {
function a() {
0();
}
stopAllSounds();
_root.YourName = '';
if (_root.MusicIsOn == undefined) {
_root.MusicIsOn = true;
}
}
movieClip 14 {
}
movieClip 17 {
}
movieClip 20 {
}
instance LittleLoader of movieClip 20 {
onClipEvent (load) {
this.Elipses = new Array('', '.', '..', '...');
this.ElipsisCounter = 3;
}
onClipEvent (enterFrame) {
this.ElipsisBox.text = this.Elipses[parseInt(this.ElipsisCounter)];
this.ElipsisCounter += 0.25;
if (this.ElipsisCounter >= this.Elipses.length) {
this.ElipsisCounter = 0;
}
}
}
frame 2 {
MusicOffButton._visible = _root.MusicIsOn;
MusicOnButton._visible = !_root.MusicIsOn;
}
movieClip 22 {
}
movieClip 24 {
}
movieClip 27 {
}
movieClip 29 {
}
movieClip 31 {
}
movieClip 33 {
}
movieClip 35 {
}
button 37 {
on (release) {
_root.LoopEngine.stop();
_root.MusicIsOn = false;
_root.MusicOffButton._visible = false;
_root.MusicOnButton._visible = true;
}
}
movieClip 39 {
}
movieClip 40 {
}
instance LoopEngine of movieClip 40 {
onClipEvent (load) {
if (!_root.MusicIsOn) {
this.stop();
}
_root.MusicOffButton._visible = _root.MusicIsOn;
_root.MusicOnButton._visible = !_root.MusicIsOn;
this._visible = false;
}
}
movieClip 42 {
}
movieClip 44 {
}
movieClip 46 {
}
movieClip 48 {
}
movieClip 50 {
}
button 51 {
on (release) {
_root.LoopEngine.gotoAndPlay(_root._currentframe);
_root.MusicIsOn = true;
_root.MusicOnButton._visible = false;
_root.MusicOffButton._visible = true;
}
}
movieClip 52 {
}
movieClip 56 {
}
movieClip 57 {
}
movieClip 58 {
}
movieClip 60 {
}
movieClip 61 {
}
movieClip 62 {
}
movieClip 63 {
}
movieClip 69 {
}
frame 128 {
_root.NumberOfOpponents = 4;
_root.SkillOfOpponents = 'hard';
if (parseInt((_root.getBytesLoaded() / _root.getBytesTotal()) * 100) < 100) {
stop();
}
}
movieClip 72 {
}
movieClip 74 {
instance LittleLoader of movieClip 20 {
onClipEvent (load) {
this.Elipses = new Array('', '.', '..', '...');
this.ElipsisCounter = 3;
}
onClipEvent (enterFrame) {
this.ElipsisBox.text = this.Elipses[parseInt(this.ElipsisCounter)];
this.ElipsisCounter += 0.25;
if (this.ElipsisCounter >= this.Elipses.length) {
this.ElipsisCounter = 0;
}
}
}
}
instance ThePreloader of movieClip 74 {
onClipEvent (enterFrame) {
PercentLoaded = parseInt((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
this.PercentBox.text = PercentLoaded.toString() + '%';
if (PercentLoaded >= 100) {
_root.MenuEngine.MenuStatus = 'name';
_root.gotoAndPlay('Menu');
}
}
}
movieClip 76 {
}
instance MenuEngine of movieClip 40 {
onClipEvent (load) {
if (!_root.MusicIsOn) {
this.stop();
}
_root.MusicOffButton._visible = _root.MusicIsOn;
_root.MusicOnButton._visible = !_root.MusicIsOn;
this._visible = false;
_root.PlayNextLoop = function () {
if (_root.Playlist[0] != undefined) {
_root.Orchestra.attachSound(_root.Playlist.shift());
_root.Orchestra.onSoundComplete = _root.PlayNextLoop;
if (_root.MusicIsOn) {
_root.Orchestra.start();
}
}
};
_root.Playlist = new Array();
_root.Orchestra = new Sound();
_root.Orchestra.setVolume(100);
this.MenuStatus = 'loading';
if (parseInt((_root.getBytesLoaded() / _root.getBytesTotal()) * 100) >= 100) {
this.MenuStatus = 'name';
}
if (_root.YourName != undefined && _root.YourName.length > 0 && _root.YourName.length <= 12) {
this.MenuStatus = 'main';
}
}
}
button 77 {
on (release) {
_root.MenuEngine.stop();
_root.MusicIsOn = false;
_root.MusicOffButton._visible = false;
_root.MusicOnButton._visible = true;
}
}
button 78 {
on (release) {
_root.MenuEngine.gotoAndPlay(_root.MenuTexa._currentframe);
_root.MusicIsOn = true;
_root.MusicOnButton._visible = false;
_root.MusicOffButton._visible = true;
}
}
frame 129 {
function TrimWhiteSpace(TheText) {
var v2 = '';
var v3 = '';
gg = 0;
while (gg < TheText.length) {
var v1 = TheText.charAt(gg);
v2 += (v1 == ' ') ? v3 : v1;
v3 = (v1 == ' ') ? '' : ' ';
++gg;
}
if (v2.charAt(v2.length - 1) == ' ') {
v2 = v2.substr(0, v2.length - 1);
}
return v2;
}
function ArrayToWorth(tA) {
for (xx in tA) {
if (tA[xx].toString() == 'NaN') {
tA[xx] = 0;
}
}
Zeroes = new Array(0, 0, 0, 0, 0);
tA = tA.concat(Zeroes);
tWorth = 1 * tA[5] + 20 * tA[4] + 400 * tA[3] + 8000 * tA[2] + 160000 * tA[1] + 3200000 * tA[0];
return tWorth;
}
function AssessPreflop(H) {
cAr = Rankify(H[0].charAt(0));
cAs = H[0].charAt(1);
cBr = Rankify(H[1].charAt(0));
cBs = H[1].charAt(1);
Power = cAr * cBr;
Description = LetterToWord(_root.TheRanks[Math.max(cAr, cBr) - 1]);
Description += ' and ';
Description += LetterToWord(_root.TheRanks[Math.min(cAr, cBr) - 1]);
if (cAs == cBs) {
Power += 60;
Description = 'Suited ' + Description;
} else {
Description += ', Unsuited';
}
if (cAr == cBr) {
Power = Math.max(120, Power * 2);
Description = 'Pair of ' + LetterToWord(_root.TheRanks[cAr - 1]) + 's';
}
gg = new Array(Power, Description);
return gg;
}
function AssessFlop(H) {
MoreCardsComing = 0;
if (_root.GameEngine.GameStatus == 'dealing turn') {
MoreCardsComing = 1;
}
if (_root.GameEngine.GameStatus == 'dealing flop') {
MoreCardsComing = 2;
}
Assessment = new Array();
Assessment[0] = 0;
Description = 'Nothing';
ExtraDescription = '';
FullOf = undefined;
Hr = RankCount(H, 'n');
Hs = SuitCount(H);
Hp = MatchCount(Hr, 2);
if (Hp[0] != undefined) {
Assessment[0] = 1;
}
if (Hp[1] != undefined) {
Assessment[0] = 2;
}
Ht = MatchCount(Hr, 3);
if (Ht[0] != undefined) {
FullOf = (Ht[1] != undefined) ? Ht[1] : Hp[0];
Assessment[0] = 3;
}
Hx = StraightCount(Hr);
if (Hx[0] >= 5) {
Assessment[0] = 4;
}
Hf = FlushCount(Hs);
if (Hf[0] >= 5) {
Assessment[0] = 5;
}
if (FullOf != undefined) {
Assessment[0] = 6;
}
Hq = MatchCount(Hr, 4);
if (Hq[0] != undefined) {
Assessment[0] = 7;
}
if (Hf >= 5 && Hx[0] >= 5) {
Hsf = StraightFlushCount(H);
if (Hsf[0] >= 5) {
Assessment[0] = 8;
if (Hsf[1] == 'A') {
Assessment[0] = 9;
}
}
}
if (Hf[0] == 3 && MoreCardsComing == 2) {
Assessment[0] += 0.3;
}
if (Hf[0] == 4 && MoreCardsComing == 2) {
Assessment[0] += 1;
}
if (Hf[0] == 4 && MoreCardsComing == 1) {
Assessment[0] += 0.3;
}
if (Hx[0] == 3 && MoreCardsComing == 2) {
Assessment[0] += 0.2;
}
if (Hx[0] == 4 && MoreCardsComing == 2) {
Assessment[0] += 0.9;
}
if (Hx[0] == 4 && MoreCardsComing == 1) {
Assessment[0] += 0.3;
}
Kickers = new Array();
switch (Assessment[0]) {
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription);
return RtnArr;
case 0:
MC = MatchCount(Hr, 1);
i = 0;
while (i < 5) {
K = _root.Rankify(MC[i]);
Kickers.push(K);
++i;
}
Description = _root.LetterToWord(MC[0]) + ' high';
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription);
return RtnArr;
case 1:
PP = _root.Rankify(Hp[0]);
Kickers.push(PP);
MC = MatchCount(Hr, 1);
i = 0;
while (i < 3) {
K = Rankify(MC[i]);
Kickers.push(K);
++i;
}
Description = 'Pair of ' + _root.LetterToWord(Hp[0]) + 's';
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription);
return RtnArr;
case 2:
PP = _root.Rankify(Hp[0]);
Kickers.push(PP);
PP = _root.Rankify(Hp[1]);
Kickers.push(PP);
MC = MatchCount(Hr, 1);
K = _root.Rankify(MC[0]);
if (Hp[2] != undefined) {
PP = _root.Rankify(Hp[2]);
K = Math.max(PP, KK);
}
Kickers.push(K);
Description = 'Two Pair';
ExtraDescription = _root.LetterToWord(Hp[0]) + 's over ' + _root.LetterToWord(Hp[1]) + 's';
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription);
return RtnArr;
case 3:
PP = _root.Rankify(Ht[0]);
Kickers.push(PP);
MC = MatchCount(Hr, 1);
i = 0;
while (i < 2) {
K = Rankify(MC[i]);
Kickers.push(K);
++i;
}
Description = 'Three ' + _root.LetterToWord(Ht[0]) + 's';
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription);
return RtnArr;
case 4:
PP = _root.Rankify(Hx[1]);
Kickers.push(PP);
Description = _root.LetterToWord(Hx[1]) + '-high Straight';
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription);
return RtnArr;
case 5:
Sr = RankCount(H, Hf[1]);
MC = MatchCount(Sr, 1);
i = 0;
while (i < 5) {
K = _root.Rankify(MC[i]);
Kickers.push(K);
++i;
}
Description = _root.LetterToWord(MC[0]) + '-high Flush';
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription);
return RtnArr;
case 6:
PP = _root.Rankify(Ht[0]);
Kickers.push(PP);
PP = _root.Rankify(FullOf);
Kickers.push(PP);
Description = 'Full House';
ExtraDescription = _root.LetterToWord(Ht[0]) + 's full of ' + _root.LetterToWord(FullOf) + 's';
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription);
return RtnArr;
case 7:
PP = _root.Rankify(Hq[0]);
Kickers.push(PP);
MC = MatchCount(Hr, 1);
K = _root.Rankify(MC[0]);
if (Hp[0] != undefined) {
PP = _root.Rankify(Hp[0]);
K = Math.max(PP, K);
}
if (Ht[0] != undefined) {
PP = _root.Rankify(Ht[0]);
K = Math.max(PP, K);
}
Kickers.push(K);
Description = 'Four ' + _root.LetterToWord(Hq[0]) + 's';
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription);
return RtnArr;
case 8:
PP = _root.Rankify(Hsf[1]);
Kickers.push(PP);
Description = 'Straight Flush';
ExtraDescription = _root.LetterToWord(Hsf[1]) + '-high';
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription);
return RtnArr;
case 9:
Description = 'Royal Flush';
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription);
return RtnArr;
}
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription);
return RtnArr;
}
function AssessRiver(H) {
Assessment = new Array();
Assessment[0] = 0;
Majors = new Array();
Minors = new Array();
Description = 'Nothing';
ExtraDescription = '';
FullOf = undefined;
Hr = RankCount(H, 'n');
Hs = SuitCount(H);
Hp = MatchCount(Hr, 2);
if (Hp[0] != undefined) {
Assessment[0] = 1;
}
if (Hp[1] != undefined) {
Assessment[0] = 2;
}
Ht = MatchCount(Hr, 3);
if (Ht[0] != undefined) {
FullOf = (Ht[1] != undefined) ? Ht[1] : Hp[0];
Assessment[0] = 3;
}
Hx = StraightCount(Hr);
if (Hx[0] >= 5) {
Assessment[0] = 4;
}
Hf = FlushCount(Hs);
if (Hf[0] >= 5) {
Assessment[0] = 5;
}
if (FullOf != undefined) {
Assessment[0] = 6;
}
Hq = MatchCount(Hr, 4);
if (Hq[0] != undefined) {
Assessment[0] = 7;
}
if (Hf >= 5 && Hx[0] >= 5) {
Hsf = StraightFlushCount(H);
if (Hsf[0] >= 5) {
Assessment[0] = 8;
if (Hsf[1] == 'A') {
Assessment[0] = 9;
}
}
}
Kickers = new Array();
switch (Assessment[0]) {
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription, Majors, Minors);
return RtnArr;
case 0:
MC = MatchCount(Hr, 1);
i = 0;
while (i < 5) {
K = _root.Rankify(MC[i]);
Kickers.push(K);
Minors.push(FindinHand(K, H));
++i;
}
Description = _root.LetterToWord(MC[0]) + ' high';
Majors[0] = Minors.shift();
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription, Majors, Minors);
return RtnArr;
case 1:
PP = _root.Rankify(Hp[0]);
Kickers.push(PP);
Majors = FindInHand(PP, H);
MC = MatchCount(Hr, 1);
i = 0;
while (i < 3) {
K = Rankify(MC[i]);
Kickers.push(K);
Minors.push(FindinHand(K, H));
++i;
}
Description = 'Pair of ' + _root.LetterToWord(Hp[0]) + 's';
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription, Majors, Minors);
return RtnArr;
case 2:
PP = _root.Rankify(Hp[0]);
Kickers.push(PP);
Majors = FindInHand(PP, H);
PP = _root.Rankify(Hp[1]);
Kickers.push(PP);
Majors = Majors.concat(FindInHand(PP, H));
MC = MatchCount(Hr, 1);
K = _root.Rankify(MC[0]);
if (Hp[2] != undefined) {
PP = _root.Rankify(Hp[2]);
K = Math.max(PP, KK);
}
Kickers.push(K);
Minors[0] = FindInHand(K, H, 1);
Description = 'Two Pair';
ExtraDescription = _root.LetterToWord(Hp[0]) + 's over ' + _root.LetterToWord(Hp[1]) + 's';
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription, Majors, Minors);
return RtnArr;
case 3:
PP = _root.Rankify(Ht[0]);
Kickers.push(PP);
Majors = FindInHand(PP, H);
MC = MatchCount(Hr, 1);
i = 0;
while (i < 2) {
K = Rankify(MC[i]);
Kickers.push(K);
Minors.push(FindinHand(K, H));
++i;
}
Description = 'Three ' + _root.LetterToWord(Ht[0]) + 's';
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription, Majors, Minors);
return RtnArr;
case 4:
PP = _root.Rankify(Hx[1]);
Kickers.push(PP);
i = 0;
while (i < 5) {
Majors.push(FindInHand(PP - i, H, 1));
++i;
}
Description = _root.LetterToWord(Hx[1]) + '-high Straight';
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription, Majors, Minors);
return RtnArr;
case 5:
Sr = RankCount(H, Hf[1]);
MC = MatchCount(Sr, 1);
i = 0;
while (i < 5) {
K = _root.Rankify(MC[i]);
Kickers.push(K);
Majors.push(MC[i].toString() + Hf[1]);
++i;
}
Description = _root.LetterToWord(MC[0]) + '-high Flush';
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription, Majors, Minors);
return RtnArr;
case 6:
PP = _root.Rankify(Ht[0]);
Kickers.push(PP);
Majors = FindInHand(PP, H);
PP = _root.Rankify(FullOf);
Kickers.push(PP);
Majors = Majors.concat(FindInHand(FullOf, H, 2));
Description = 'Full House';
ExtraDescription = _root.LetterToWord(Ht[0]) + 's full of ' + _root.LetterToWord(FullOf) + 's';
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription, Majors, Minors);
return RtnArr;
case 7:
PP = _root.Rankify(Hq[0]);
Kickers.push(PP);
Majors = FindInHand(PP, H);
MC = MatchCount(Hr, 1);
K = _root.Rankify(MC[0]);
if (Hp[0] != undefined) {
PP = _root.Rankify(Hp[0]);
K = Math.max(PP, K);
}
if (Ht[0] != undefined) {
PP = _root.Rankify(Ht[0]);
K = Math.max(PP, K);
}
Kickers.push(K);
Minors[0] = FindInHand(K, H, 1);
Description = 'Four ' + _root.LetterToWord(Hq[0]) + 's';
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription, Majors, Minors);
return RtnArr;
case 8:
PP = _root.Rankify(Hsf[1]);
Kickers.push(PP);
i = 0;
while (i < 5) {
gg = FindInHand(PP - i, H, 1);
Majors.push(gg.charAt(0) + Hf[1]);
++i;
}
Description = 'Straight Flush';
ExtraDescription = _root.LetterToWord(Hsf[1]) + '-high';
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription, Majors, Minors);
return RtnArr;
case 9:
PP = 14;
i = 0;
while (i < 5) {
gg = FindInHand(PP - i, H, 1);
Majors.push(gg.charAt(0) + Hf[1]);
++i;
}
Description = 'Royal Flush';
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription, Majors, Minors);
return RtnArr;
}
Assessment = Assessment.concat(Kickers);
RtnArr = new Array(Assessment, Description, ExtraDescription, Majors, Minors);
return RtnArr;
}
function FindInHand(Needle, Hand, MaxNo) {
if (MaxNo == 0 || MaxNo == undefined) {
MaxNo = 4;
}
NA = new Array();
Needle = Rankify(Needle);
for (ii in Hand) {
if (Rankify(Hand[ii]) == Needle && NA.length < MaxNo) {
NA.push(Hand[ii]);
}
}
return (NA.length == 1) ? NA[0] : NA;
}
function Rankify(RankLetter) {
RankNumber = parseInt(RankLetter);
if (RankNumber == 0 || RankNumber.toString() == 'NaN') {
RankNumber = _root.LetterToNumber(RankLetter);
}
if (RankNumber == 1) {
RankNumber = 14;
}
return RankNumber;
}
function StraightFlushCount(Hand) {
F = 0;
HighCard = '';
ii = 0;
while (ii < 4) {
sCards = RankCount(Hand, _root.TheSuits[ii]);
sCx = StraightCount(sCards);
if (sCx[0] >= F) {
F = sCx[0];
HighCard = sCx[1];
}
++ii;
}
G = new Array(F, HighCard);
return G;
}
function StraightCount(Hr) {
R = 0;
F = 0;
H = '';
i = 0;
while (i <= 13) {
R = Hr[i] > 0 ? R + 1 : 0;
if (R >= F) {
F = R;
H = _root.TheRanks[i];
}
++i;
}
G = new Array(F, H);
return G;
}
function MatchCount(Hr, V) {
M = new Array();
for (i in Hr) {
if (Hr[i] == V && i != 0) {
g = _root.TheRanks[i];
M.push(g);
}
}
return M;
}
function FlushCount(Hs) {
M = 0;
i = 0;
while (i <= 3) {
if (M <= Hs[i]) {
M = Hs[i];
TheSuit = _root.TheSuits[i];
}
++i;
}
g = new Array(M, TheSuit);
return g;
}
function RankCount(H, suitonly) {
g = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
if (suitonly == undefined) {
suitonly = 'n';
}
for (i in H) {
if (suitonly == 'n' || suitonly == H[i].charAt(1)) {
gg = _root.LetterToNumber(H[i]);
++g[gg - 1];
}
}
g[13] = g[0];
return g;
}
function SuitCount(TheHand) {
g = new Array(0, 0, 0, 0);
ggg = 'sdch';
for (gg in TheHand) {
++g[ggg.indexOf(TheHand[gg].charAt(1))];
}
return g;
}
function MoveCards() {
_root.cardsInMotion = false;
OptimumTraversal = 1.8;
MinimumTraversal = 18;
g = 11;
while (g <= _root.DealerCounter) {
ThisCard = eval('GameCard.dealt' + g.toString());
if (ThisCard.GinMotion()) {
HereItIs = true;
TheDifference = ThisCard.GdestS() - ThisCard._xscale;
if (Math.abs(TheDifference) > MinimumTraversal) {
HereItIs = false;
TheTraversal = (0.75 + Math.random() * 0.5) * TheDifference / OptimumTraversal;
if (Math.abs(TheTraversal) < MinimumTraversal) {
TheTraversal = MinimumTraversal * TheTraversal / Math.abs(TheTraversal);
}
ThisCard._xscale += TheTraversal;
} else {
ThisCard._xscale = ThisCard.GdestS();
}
TheDifference = ThisCard.GdestS() - ThisCard._yscale;
if (Math.abs(TheDifference) > MinimumTraversal) {
HereItIs = false;
TheTraversal = (0.75 + Math.random() * 0.5) * TheDifference / OptimumTraversal;
if (Math.abs(TheTraversal) < MinimumTraversal) {
TheTraversal = MinimumTraversal * TheTraversal / Math.abs(TheTraversal);
}
ThisCard._yscale += TheTraversal;
} else {
ThisCard._yscale = ThisCard.GdestS();
}
TheDifference = ThisCard.GdestX() - ThisCard._x;
if (Math.abs(TheDifference) > MinimumTraversal) {
HereItIs = false;
TheTraversal = (0.75 + Math.random() * 0.5) * TheDifference / OptimumTraversal;
if (Math.abs(TheTraversal) < MinimumTraversal) {
TheTraversal = MinimumTraversal * TheTraversal / Math.abs(TheTraversal);
}
ThisCard._x += TheTraversal;
} else {
ThisCard._x = ThisCard.GdestX();
}
TheDifference = ThisCard.GdestY() - ThisCard._y;
if (Math.abs(TheDifference) > MinimumTraversal) {
HereItIs = false;
TheTraversal = (0.75 + Math.random() * 0.5) * TheDifference / OptimumTraversal;
if (Math.abs(TheTraversal) < MinimumTraversal) {
TheTraversal = MinimumTraversal * TheTraversal / Math.abs(TheTraversal);
}
ThisCard._y += TheTraversal;
} else {
ThisCard._y = ThisCard.GdestY();
}
TheDifference = ThisCard.GdestR() - ThisCard._rotation;
if (Math.abs(TheDifference) > MinimumTraversal) {
HereItIs = false;
TheTraversal = (0.75 + Math.random() * 0.5) * TheDifference / OptimumTraversal;
if (Math.abs(TheTraversal) < MinimumTraversal) {
TheTraversal = MinimumTraversal * TheTraversal / Math.abs(TheTraversal);
}
ThisCard._rotation += TheTraversal;
} else {
ThisCard._rotation = ThisCard.GdestR();
}
ThisCard.SinMotion(!HereItIs);
_root.cardsInMotion = _root.cardsInMotion ? true : !HereItIs;
}
++g;
}
}
function MoveChips() {
_root.chipsInMotion = false;
OptimumTraversal = 1.8;
MinimumTraversal = 18;
g = 61;
while (g <= _root.ChipCounter) {
ThisChip = eval('GameChip.chip' + g.toString());
if (ThisChip.GinMotion()) {
HereItIs = true;
TheDifference = ThisChip.GdestX() - ThisChip._x;
if (Math.abs(TheDifference) > MinimumTraversal) {
HereItIs = false;
TheTraversal = (0.75 + Math.random() * 0.5) * TheDifference / OptimumTraversal;
if (Math.abs(TheTraversal) < MinimumTraversal) {
TheTraversal = MinimumTraversal * TheTraversal / Math.abs(TheTraversal);
}
ThisChip._x += TheTraversal;
} else {
ThisChip._x = ThisChip.GdestX();
}
TheDifference = ThisChip.GdestY() - ThisChip._y;
if (Math.abs(TheDifference) > MinimumTraversal) {
HereItIs = false;
TheTraversal = (0.75 + Math.random() * 0.5) * TheDifference / OptimumTraversal;
if (Math.abs(TheTraversal) < MinimumTraversal) {
TheTraversal = MinimumTraversal * TheTraversal / Math.abs(TheTraversal);
}
ThisChip._y += TheTraversal;
} else {
ThisChip._y = ThisChip.GdestY();
}
TheDifference = ThisChip.GdestR() - ThisChip._rotation;
if (Math.abs(TheDifference) > MinimumTraversal) {
TheTraversal = (0.75 + Math.random() * 0.5) * TheDifference / OptimumTraversal;
if (Math.abs(TheTraversal) < MinimumTraversal) {
TheTraversal = MinimumTraversal * TheTraversal / Math.abs(TheTraversal);
}
ThisChip._rotation += TheTraversal;
} else {
ThisChip._rotation = ThisChip.GdestR();
}
if (HereItIs) {
_root.ChipSound.start();
ThisChip.SinMotion(false);
} else {
_root.chipsInMotion = true;
}
}
++g;
}
}
function LetterToNumber(Rank) {
gg = 0;
Rank = Rank.charAt(0);
switch (Rank) {
case 'A':
gg = 1;
return gg;
case 'T':
gg = 10;
return gg;
case 'J':
gg = 11;
return gg;
case 'Q':
gg = 12;
return gg;
case 'K':
gg = 13;
return gg;
}
gg = parseInt(Rank);
return gg;
}
function LetterToWord(Rank) {
gg = '';
switch (Rank.charAt(0)) {
case 'A':
gg = 'Ace';
return gg;
case 'T':
gg = '10';
return gg;
case 'J':
gg = 'Jack';
return gg;
case 'Q':
gg = 'Queen';
return gg;
case 'K':
gg = 'King';
return gg;
}
gg = Rank.charAt(0);
return gg;
}
function DollarString(TheNumber) {
RtnTxt = '$';
TheNumber = parseInt(TheNumber);
if (TheNumber <= 0 || TheNumber.toString() == 'NaN') {
TheNumber = 0;
}
if (TheNumber > 999999999999.0) {
TheNumber = 999999999999.0;
}
Started = false;
if (TheNumber >= 1000000000) {
Treon = parseInt(TheNumber / 1000000000);
RtnTxt += Treon.toString() + ',';
TheNumber -= Treon * 1000000000;
Started = true;
}
if (TheNumber >= 1000000 || Started) {
Treon = parseInt(TheNumber / 1000000);
if (Started) {
RtnTxt += (Treon < 100 ? '0' : '') + (Treon < 10 ? '0' : '') + (Treon < 1 ? '0' : '');
}
RtnTxt += Treon.toString() + ',';
TheNumber -= Treon * 1000000;
Started = true;
}
if (TheNumber >= 1000 || Started) {
Treon = parseInt(TheNumber / 1000);
if (Started) {
RtnTxt += (Treon < 100 ? '0' : '') + (Treon < 10 ? '0' : '') + (Treon < 1 ? '0' : '');
}
RtnTxt += Treon.toString() + ',';
TheNumber -= Treon * 1000;
Started = true;
}
if (Started) {
RtnTxt += (TheNumber < 100 ? '0' : '') + (TheNumber < 10 ? '0' : '');
}
RtnTxt += TheNumber.toString();
return RtnTxt;
}
function orderInt(a, b) {
var v2 = parseInt(a);
var v1 = parseInt(b);
if (v2 < v1) {
return -1;
} else {
if (v2 > v1) {
return 1;
} else {
return 0;
}
}
}
_root.NamesOfOpponents = new Array();
}
movieClip 80 {
}
movieClip 84 {
}
movieClip 89 {
}
movieClip 91 {
}
movieClip 93 {
}
movieClip 95 {
}
movieClip 97 {
}
movieClip 99 {
}
movieClip 100 {
}
button 102 {
on (release) {
_root.NameInput.OKButtonPressed();
}
on (keyPress '<Enter>') {
_root.NameInput.OKButtonPressed();
}
}
movieClip 103 {
}
instance NameInput of movieClip 103 {
onClipEvent (load) {
this._visible = false;
this.OKButtonPressed = function () {
var v3 = _root.TrimWhiteSpace(this.NameBox.text);
if (v3.length > 12) {
v3 = '';
}
if (v3 == '') {
v3 = 'You';
}
if (v3.length > 0) {
_root.YourName = v3;
this._visible = false;
_root.MenuEngine.MenuStatus = 'options';
} else {
this.NameBox.text = v3;
Selection.setFocus(this.NameBox);
}
};
}
onClipEvent (enterFrame) {
if (!this._visible && _root.MenuEngine.MenuStatus == 'name') {
this._visible = true;
Selection.setFocus(this.NameBox);
}
if (this._visible && _root.MenuEngine.MenuStatus != 'name') {
this._visible = false;
}
}
}
movieClip 105 {
}
movieClip 109 {
}
movieClip 113 {
}
button 117 {
on (release) {
_root.MainMenu.PlayButtonPressed();
}
}
movieClip 120 {
}
movieClip 123 {
}
movieClip 124 {
frame 1 {
}
}
instance MainMenu of movieClip 124 {
onClipEvent (load) {
function PlayButtonPressed() {
_root.MenuEngine.MenuStatus = 'options';
}
function LearnButtonPressed() {
_root.gotoAndPlay('Learn');
}
this._visible = false;
}
onClipEvent (enterFrame) {
if (!this._visible && _root.MenuEngine.MenuStatus == 'main') {
this._visible = true;
Selection.setFocus(this.NameBox);
}
if (this._visible && _root.MenuEngine.MenuStatus != 'main') {
this._visible = false;
}
}
}
movieClip 127 {
}
movieClip 131 {
}
movieClip 133 {
}
movieClip 136 {
}
movieClip 138 {
}
movieClip 140 {
}
movieClip 144 {
}
movieClip 145 {
frame 10 {
stop();
}
}
button 146 {
on (release) {
_root.OptionsInput.PlayerButton(4);
}
}
movieClip 149 {
}
movieClip 150 {
frame 10 {
stop();
}
}
button 151 {
on (release) {
_root.OptionsInput.PlayerButton(3);
}
}
movieClip 152 {
}
movieClip 154 {
}
movieClip 156 {
frame 10 {
stop();
}
}
button 157 {
on (release) {
_root.OptionsInput.PlayerButton(2);
}
}
movieClip 159 {
}
movieClip 160 {
frame 10 {
stop();
}
}
button 161 {
on (release) {
_root.OptionsInput.PlayerButton(1);
}
}
movieClip 163 {
}
button 166 {
on (release) {
_root.OptionsInput.SkillButton('easy');
}
}
button 169 {
on (release) {
_root.OptionsInput.SkillButton('hard');
}
}
movieClip 171 {
}
movieClip 173 {
}
movieClip 175 {
}
button 181 {
on (release) {
_root.OptionsInput.PlayButtonPressed();
}
on (keyPress '<Enter>') {
_root.OptionsInput.PlayButtonPressed();
}
}
movieClip 182 {
}
instance OptionsInput of movieClip 182 {
onClipEvent (load) {
function BackButtonPressed() {
this._visible = false;
_root.MenuEngine.MenuStatus = 'main';
}
function PlayerButton(whichone) {
this.PQty = whichone;
this.NumberBox.text = this.PQty.toString();
this.Pbutton1._visible = this.PQty != 1;
this.Pbutton2._visible = this.PQty != 2;
this.Pbutton3._visible = this.PQty != 3;
this.Pbutton4._visible = this.PQty != 4;
}
function SkillButton(whichone) {
this.PSkill = whichone;
this.DifficultyBox.text = this.PSkill;
this.FishButton._visible = this.PSkill != 'easy';
this.SharkButton._visible = this.PSkill != 'hard';
}
function PlayButtonPressed() {
this._visible = false;
_root.NumberOfOpponents = this.PQty;
_root.SkillOfOpponents = this.PSkill;
_root.gotoAndPlay('GoodLuck');
}
this._visible = false;
this.PQty = 4;
this.Pbutton1._visible = this.PQty != 1;
this.Pbutton2._visible = this.PQty != 2;
this.Pbutton3._visible = this.PQty != 3;
this.Pbutton4._visible = this.PQty != 4;
this.PSkill = 'hard';
this.FishButton._visible = this.PSkill != 'easy';
this.SharkButton._visible = this.PSkill != 'hard';
}
onClipEvent (enterFrame) {
if (!this._visible && _root.MenuEngine.MenuStatus == 'options') {
this._visible = true;
Selection.setFocus(this.NameBox);
}
if (this._visible && _root.MenuEngine.MenuStatus != 'options') {
this._visible = false;
}
}
}
frame 147 {
stop();
}
movieClip 184 {
}
movieClip 185 Ad {
}
movieClip 187 {
}
movieClip 188 Ac {
}
movieClip 190 {
}
movieClip 191 Ah {
}
movieClip 193 {
}
movieClip 194 2c {
}
movieClip 196 {
}
movieClip 197 2d {
}
movieClip 199 {
}
movieClip 200 2h {
}
movieClip 202 {
}
movieClip 203 2s {
}
movieClip 205 {
}
movieClip 206 3c {
}
movieClip 208 {
}
movieClip 209 3d {
}
movieClip 211 {
}
movieClip 212 3h {
}
movieClip 214 {
}
movieClip 215 3s {
}
movieClip 217 {
}
movieClip 218 4c {
}
movieClip 220 {
}
movieClip 221 4d {
}
movieClip 223 {
}
movieClip 224 4h {
}
movieClip 226 {
}
movieClip 227 4s {
}
movieClip 229 {
}
movieClip 230 5c {
}
movieClip 232 {
}
movieClip 233 5d {
}
movieClip 235 {
}
movieClip 236 5h {
}
movieClip 238 {
}
movieClip 239 5s {
}
movieClip 241 {
}
movieClip 242 6c {
}
movieClip 244 {
}
movieClip 245 6d {
}
movieClip 247 {
}
movieClip 248 6h {
}
movieClip 250 {
}
movieClip 251 6s {
}
movieClip 253 {
}
movieClip 254 7c {
}
movieClip 256 {
}
movieClip 257 7d {
}
movieClip 259 {
}
movieClip 260 7h {
}
movieClip 262 {
}
movieClip 263 7s {
}
movieClip 265 {
}
movieClip 266 8c {
}
movieClip 268 {
}
movieClip 269 8d {
}
movieClip 271 {
}
movieClip 272 8h {
}
movieClip 274 {
}
movieClip 275 8s {
}
movieClip 277 {
}
movieClip 278 9c {
}
movieClip 280 {
}
movieClip 281 9d {
}
movieClip 283 {
}
movieClip 284 9h {
}
movieClip 286 {
}
movieClip 287 9s {
}
movieClip 289 {
}
movieClip 290 Tc {
}
movieClip 292 {
}
movieClip 293 Td {
}
movieClip 295 {
}
movieClip 296 Th {
}
movieClip 298 {
}
movieClip 299 Ts {
}
movieClip 301 {
}
movieClip 302 Jc {
}
movieClip 304 {
}
movieClip 305 Jd {
}
movieClip 307 {
}
movieClip 308 Jh {
}
movieClip 310 {
}
movieClip 311 Js {
}
movieClip 313 {
}
movieClip 314 Qc {
}
movieClip 316 {
}
movieClip 317 Qd {
}
movieClip 319 {
}
movieClip 320 Qh {
}
movieClip 322 {
}
movieClip 323 Qs {
}
movieClip 325 {
}
movieClip 326 Kc {
}
movieClip 328 {
}
movieClip 329 Kd {
}
movieClip 331 {
}
movieClip 332 Kh {
}
movieClip 334 {
}
movieClip 335 Ks {
}
movieClip 337 {
}
movieClip 338 Back {
}
movieClip 340 {
}
movieClip 341 CardGlow {
}
movieClip 342 BlueChip {
}
movieClip 343 MagentaChip {
}
movieClip 344 OrangeChip {
}
movieClip 345 WhiteChip {
}
movieClip 350 {
}
instance MusicEngine of movieClip 350 {
onClipEvent (load) {
function TurnMusicOff() {
_root.Orchestra.stop();
_root.ChipSound.attachSound('chip.aiff');
_root.Orchestra.onSoundComplete = function () {};
_root.Orchestra.stop();
_root.MusicIsOn = false;
_root.MusicOffButton._visible = false;
_root.MusicOnButton._visible = true;
}
function TurnMusicOn() {
_root.MusicIsOn = true;
_root.PlayNextLoop();
_root.MusicOnButton._visible = false;
_root.MusicOffButton._visible = true;
}
function Swell(dir) {
this.Swelling = dir;
}
_root.MusicOffButton._visible = _root.MusicIsOn;
_root.MusicOnButton._visible = !_root.MusicIsOn;
this._visible = false;
_root.Orchestra.setVolume(100);
_root.Playlist = new Array();
mm = 0;
while (mm < 200) {
_root.Playlist.push('BlatLoopC', 'BlatLoopA', 'BlatLoopB');
++mm;
}
if (_root.MusicIsOn) {
_root.PlayNextLoop();
}
this.Swelling = false;
this.MinVolume = 40;
this.StepVolume = 1;
}
onClipEvent (enterFrame) {
if (this.Swelling == 'up') {
if (_root.Orchestra.getVolume() < 100) {
_root.Orchestra.setVolume(_root.Orchestra.getVolume() + this.StepVolume * 2);
} else {
this.Swelling == false;
}
}
if (this.Swelling == 'down') {
if (_root.Orchestra.getVolume() > this.MinVolume) {
_root.Orchestra.setVolume(_root.Orchestra.getVolume() - this.StepVolume);
} else {
this.Swelling == false;
}
}
}
}
button 353 {
on (release) {
_root.MusicEngine.TurnMusicOff();
}
}
button 354 {
on (release) {
_root.MusicEngine.TurnMusicOn();
}
}
movieClip 358 {
}
movieClip 360 {
}
movieClip 362 {
}
movieClip 365 {
}
movieClip 367 {
}
movieClip 370 {
}
movieClip 372 {
}
movieClip 374 {
}
button 375 {
on (release) {
_root.Orchestra.stop();
_root.gotoAndPlay('Menu');
}
on (keyPress '<Home>') {
_root.Orchestra.stop();
_root.gotoAndPlay('Menu');
}
}
movieClip 377 {
}
movieClip 379 {
}
movieClip 381 {
}
button 383 {
on (release) {
_root.gotoAndStop('TH object');
}
}
button 384 {
on (release) {
_root.gotoAndStop('TH min');
}
}
button 385 {
on (release) {
_root.gotoAndStop('TH bets');
}
}
button 386 {
on (release) {
_root.gotoAndStop('TH hands');
}
}
button 387 {
on (release) {
_root.gotoAndStop('TH hand');
}
}
button 388 {
on (release) {
_root.gotoAndStop('TH ranks');
}
}
button 389 {
on (release) {
_root.gotoAndStop('TH game');
}
}
instance of movieClip 24 {
onClipEvent (load) {
this.WhenIReachTheEnd = function () {
_root.gotoAndPlay(12);
};
}
}
instance of movieClip 24 {
onClipEvent (load) {
this.WhenIReachTheEnd = function () {
_root.gotoAndPlay(12);
};
}
}
frame 178 {
_root.MusicEngine.Swell('down');
stop();
}
movieClip 394 {
}
movieClip 396 {
}
movieClip 398 {
}
movieClip 401 {
}
movieClip 404 {
}
movieClip 406 {
}
movieClip 408 {
}
movieClip 410 {
}
movieClip 412 {
}
movieClip 414 {
}
button 416 {
on (release) {
_root.gotoAndStop(_root._currentframe + 1);
}
on (keyPress '<Right>') {
_root.gotoAndStop(_root._currentframe + 1);
}
}
movieClip 419 {
}
movieClip 421 {
}
movieClip 423 {
}
movieClip 425 {
}
movieClip 427 {
}
movieClip 429 {
}
button 431 {
on (release) {
_root.gotoAndStop(_root._currentframe - 1);
}
on (keyPress '<Left>') {
_root.gotoAndStop(_root._currentframe - 1);
}
}
movieClip 433 {
}
movieClip 435 {
}
movieClip 438 {
}
movieClip 440 {
}
movieClip 442 {
}
movieClip 444 {
}
movieClip 446 {
}
movieClip 449 {
}
movieClip 451 {
}
movieClip 456 {
}
movieClip 463 {
}
movieClip 465 {
}
movieClip 467 {
}
movieClip 471 {
}
movieClip 473 {
}
movieClip 474 As {
}
movieClip 476 {
}
movieClip 478 {
}
movieClip 480 {
}
movieClip 482 {
}
movieClip 484 {
}
movieClip 493 {
}
movieClip 497 {
}
movieClip 501 {
}
movieClip 503 {
}
movieClip 505 {
}
movieClip 507 {
}
movieClip 509 {
}
movieClip 511 {
}
movieClip 513 {
}
movieClip 515 {
}
movieClip 517 {
}
movieClip 519 {
}
movieClip 521 {
}
button 522 {
on (release) {
_root.gotoAndStop(_root._currentframe + 1);
}
}
button 523 {
on (release) {
_root.gotoAndStop(_root._currentframe + 2);
}
}
button 524 {
on (release) {
_root.gotoAndStop(_root._currentframe + 3);
}
}
button 525 {
on (release) {
_root.gotoAndStop(_root._currentframe + 4);
}
}
button 526 {
on (release) {
_root.gotoAndStop(_root._currentframe + 5);
}
}
button 527 {
on (release) {
_root.gotoAndStop(_root._currentframe + 6);
}
}
button 528 {
on (release) {
_root.gotoAndStop(_root._currentframe + 7);
}
}
button 529 {
on (release) {
_root.gotoAndStop(_root._currentframe + 8);
}
}
button 530 {
on (release) {
_root.gotoAndStop(_root._currentframe + 9);
}
}
movieClip 532 {
}
button 533 {
on (release) {
_root.gotoAndStop(_root._currentframe + 10);
}
}
movieClip 535 {
}
movieClip 538 {
}
movieClip 540 {
}
movieClip 542 {
}
movieClip 544 {
}
movieClip 546 {
}
movieClip 548 {
}
movieClip 550 {
}
movieClip 552 {
}
movieClip 554 {
}
movieClip 556 {
}
movieClip 558 {
}
movieClip 560 {
}
movieClip 562 {
}
movieClip 564 {
}
movieClip 566 {
}
movieClip 568 {
}
movieClip 570 {
}
movieClip 572 {
}
movieClip 574 {
}
movieClip 576 {
}
movieClip 578 {
}
movieClip 580 {
}
movieClip 582 {
}
movieClip 584 {
}
movieClip 586 {
}
movieClip 588 {
}
movieClip 590 {
}
movieClip 592 {
}
movieClip 594 {
}
movieClip 598 {
}
movieClip 600 {
}
movieClip 602 {
}
movieClip 604 {
}
movieClip 606 {
}
movieClip 608 {
}
movieClip 610 {
}
movieClip 612 {
}
movieClip 615 {
}
movieClip 617 {
}
movieClip 619 {
}
movieClip 621 {
}
movieClip 623 {
}
movieClip 625 {
}
movieClip 628 {
}
movieClip 630 {
}
movieClip 632 {
}
movieClip 636 {
}
movieClip 638 {
}
movieClip 640 {
}
movieClip 642 {
}
movieClip 644 {
}
movieClip 646 {
}
movieClip 647 {
}
movieClip 649 {
}
movieClip 651 {
}
movieClip 653 {
}
movieClip 655 {
}
movieClip 657 {
}
movieClip 658 {
}
movieClip 660 {
}
movieClip 662 {
}
movieClip 664 {
}
movieClip 665 {
}
movieClip 666 {
}
movieClip 667 {
}
movieClip 668 {
}
movieClip 670 {
}
movieClip 672 {
}
movieClip 673 {
}
movieClip 674 {
}
movieClip 675 {
}
movieClip 676 {
}
movieClip 678 {
}
movieClip 680 {
}
movieClip 681 {
}
movieClip 682 {
}
movieClip 683 {
}
movieClip 684 {
}
movieClip 686 {
}
movieClip 688 {
}
movieClip 690 {
}
movieClip 692 {
}
movieClip 693 {
}
movieClip 695 {
}
movieClip 697 {
}
movieClip 699 {
}
movieClip 701 {
}
movieClip 704 {
}
movieClip 707 {
}
movieClip 709 {
}
movieClip 710 {
}
instance MusicEngine of movieClip 710 {
onClipEvent (load) {
if (!_root.MusicIsOn) {
this.stop();
}
_root.MusicOffButton._visible = _root.MusicIsOn;
_root.MusicOnButton._visible = !_root.MusicIsOn;
this._visible = false;
}
}
button 711 {
on (release) {
_root.MusicEngine.stop();
_root.MusicIsOn = false;
_root.MusicOffButton._visible = false;
_root.MusicOnButton._visible = true;
}
}
button 712 {
on (release) {
_root.MusicEngine.gotoAndPlay(_root.MissTexa._currentframe);
_root.MusicIsOn = true;
_root.MusicOnButton._visible = false;
_root.MusicOffButton._visible = true;
}
}
movieClip 714 {
}
instance MissTexa of movieClip 24 {
onClipEvent (load) {
this.WhenIReachTheEnd = function () {
_root.gotoAndPlay(12);
};
}
}
frame 226 {
_root.Deal1Sound = new Sound();
_root.Deal1Sound.attachSound('deal1.aiff');
_root.Deal2Sound = new Sound();
_root.Deal2Sound.attachSound('deal2.aiff');
_root.ChipSound = new Sound();
_root.ChipSound.attachSound('chip.aiff');
_root.ShuffleSound = new Sound();
_root.ShuffleSound.attachSound('shuffle.aiff');
}
movieClip 716 {
}
frame 287 {
function PickOpponents(howmany) {
var v1 = new Array();
Dugout = new Array();
Dugout.push({'Name': 'Lucy', 'Order': (Math.random()).toString()});
Dugout.push({'Name': 'James', 'Order': (Math.random()).toString()});
Dugout.push({'Name': 'Stephen', 'Order': (Math.random()).toString()});
Dugout.push({'Name': 'Rod', 'Order': (Math.random()).toString()});
Dugout.sortOn('Order');
i = 1;
while (i <= howmany) {
v1.push(Dugout[i - 1].Name);
++i;
}
return v1;
}
_root.WeCanPlay = true;
_root.YouLost = false;
gotoAndPlay('Meet2');
}
instance MusicEngine of movieClip 350 {
onClipEvent (load) {
function TurnMusicOff() {
_root.Orchestra.stop();
_root.ChipSound.attachSound('chip.aiff');
_root.Orchestra.onSoundComplete = function () {};
_root.Orchestra.stop();
_root.MusicIsOn = false;
_root.MusicOffButton._visible = false;
_root.MusicOnButton._visible = true;
}
function TurnMusicOn() {
_root.MusicIsOn = true;
_root.PlayNextLoop();
_root.Orchestra.setVolume(100);
_root.MusicOnButton._visible = false;
_root.MusicOffButton._visible = true;
}
_root.MusicOffButton._visible = _root.MusicIsOn;
_root.MusicOnButton._visible = !_root.MusicIsOn;
this._visible = false;
_root.Orchestra.setVolume(_root.MusicIsOn ? 100 : 0);
_root.Playlist = new Array();
mm = 0;
while (mm < 50) {
_root.Playlist.push('HappyLoop', 'HappyLoop');
++mm;
}
if (_root.MusicIsOn) {
_root.PlayNextLoop();
}
}
}
movieClip 718 {
}
movieClip 720 {
}
movieClip 721 AnIris {
}
movieClip 722 {
}
instance NameEngine of movieClip 722 {
onClipEvent (load) {
function OKButtonPressed() {
_root.gotoAndPlay('Meet2');
}
function EndReached() {
++this.NowMeetingNum;
if (this.NowMeetingNum < _root.NumberOfOpponents) {
this.NowMeeting = _root.NamesOfOpponents[this.NowMeetingNum];
_root.gotoAndPlay('Meet1');
}
}
this._visible = false;
_root.NamesOfOpponents = _root.PickOpponents(_root.NumberOfOpponents);
this.NowMeetingNum = 0;
this.NowMeeting = _root.NamesOfOpponents[0];
}
}
frame 295 {
}
frame 302 {
NameEngine.EndReached();
}
movieClip 724 {
}
movieClip 728 {
}
movieClip 729 {
}
movieClip 730 {
frame 1 {
stop();
}
frame 2 {
stop();
}
}
movieClip 733 {
frame 1 {
var date:Date = new Date();
var s = date.getMonth() + 1 + '/' + date.getDate() + ' ' + date.getFullYear();
txt.text = s;
}
}
movieClip 734 {
instance of movieClip 733 {
onClipEvent (load) {
days = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'thursday', 'Friday', 'Saturday', 'Sunday');
months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
timedate = new Date();
}
onClipEvent (enterFrame) {
hour = timedate.getHours();
minutes = timedate.getMinutes();
seconds = timedate.getSeconds();
todaydate = timedate.getDate();
day = timedate.getDay();
dayname = days[day];
month = timedate.getMonth();
monthname = months[month];
year = timedate.getFullYear();
if (length(hour) == 1) {
hour = '0' + hour;
}
if (length(minutes) == 1) {
minutes = '0' + minutes;
}
if (length(seconds) == 1) {
seconds = '0' + seconds;
}
if (length(todaydate) == 1) {
todaydate = '0' + todaydate;
}
currenttime = hour + ':' + minutes + ':' + seconds;
currentdate = todaydate + '/' + month + '/' + year;
fulldate = dayname + ' ' + todaydate + ' ' + monthname + ' ' + year;
delete timedate;
timedate = new Date();
txt.text = fulldate;
}
}
frame 24 {
this.stop();
}
instance of movieClip 730 {
onClipEvent (release) {
_root.Orchestra.stop();
_root.gotoAndPlay('Menu');
}
}
}
movieClip 736 {
}
movieClip 738 {
}
movieClip 740 {
}
movieClip 741 DealerChip {
}
instance Dchip of movieClip 741 DealerChip {
onClipEvent (load) {
function MoveDchip(Xend, Yend) {
Sloppiness = 10;
this._rotation = Math.random() * 360;
Xend += (Math.random() - 0.5) * Sloppiness * 1.4;
Yend += (Math.random() - 0.5) * Sloppiness;
Rend = (Math.random() - 0.5) * Sloppiness;
this.SdestX(Xend);
this.SdestY(Yend);
this.SdestR(Rend);
this.SinMotion(true);
}
this.GinMotion = function () {
return this.inMotion;
};
this.SinMotion = function (vv) {
this.inMotion = vv;
};
this.addProperty('inMotion', this.GinMotion, this.SinMotion);
this.SinMotion(false);
this.GdestX = function () {
return this.destX;
};
this.SdestX = function (vv) {
this.destX = vv;
};
this.addProperty('destX', this.GdestX, this.SdestX);
this.SdestX(0);
this.GdestY = function () {
return this.destY;
};
this.SdestY = function (vv) {
this.destY = vv;
};
this.addProperty('destY', this.GdestY, this.SdestY);
this.SdestY(0);
this.GdestR = function () {
return this.destR;
};
this.SdestR = function (vv) {
this.destR = vv;
};
this.addProperty('destR', this.GdestR, this.SdestR);
this.SdestR(0);
OptimumTraversal = 1.8;
MinimumTraversal = 18;
}
onClipEvent (enterFrame) {
if (this.GinMotion()) {
HereItIs = true;
TheDifference = this.GdestX() - this._x;
if (Math.abs(TheDifference) > MinimumTraversal) {
HereItIs = false;
TheTraversal = (0.75 + Math.random() * 0.5) * TheDifference / OptimumTraversal;
if (Math.abs(TheTraversal) < MinimumTraversal) {
TheTraversal = MinimumTraversal * TheTraversal / Math.abs(TheTraversal);
}
this._x += TheTraversal;
} else {
this._x = this.GdestX();
}
TheDifference = this.GdestY() - this._y;
if (Math.abs(TheDifference) > MinimumTraversal) {
HereItIs = false;
TheTraversal = (0.75 + Math.random() * 0.5) * TheDifference / OptimumTraversal;
if (Math.abs(TheTraversal) < MinimumTraversal) {
TheTraversal = MinimumTraversal * TheTraversal / Math.abs(TheTraversal);
}
this._y += TheTraversal;
} else {
this._y = this.GdestY();
}
TheDifference = this.GdestR() - this._rotation;
if (Math.abs(TheDifference) > MinimumTraversal) {
HereItIs = false;
TheTraversal = (0.75 + Math.random() * 0.5) * TheDifference / OptimumTraversal;
if (Math.abs(TheTraversal) < MinimumTraversal) {
TheTraversal = MinimumTraversal * TheTraversal / Math.abs(TheTraversal);
}
this._rotation += TheTraversal;
} else {
this._rotation = this.GdestR();
}
this.SinMotion(!HereItIs);
}
}
}
instance GameChip of movieClip 342 BlueChip {
onClipEvent (load) {
this.GinMotion = function () {
return this.inMotion;
};
this.SinMotion = function (vv) {
this.inMotion = vv;
};
this.addProperty('inMotion', this.GinMotion, this.SinMotion);
this.GdestX = function () {
return this.destX;
};
this.SdestX = function (vv) {
this.destX = vv;
};
this.addProperty('destX', this.GdestX, this.SdestX);
this.GdestY = function () {
return this.destY;
};
this.SdestY = function (vv) {
this.destY = vv;
};
this.addProperty('destY', this.GdestY, this.SdestY);
this.GdestR = function () {
return this.destR;
};
this.SdestR = function (vv) {
this.destR = vv;
};
this.addProperty('destR', this.GdestR, this.SdestR);
}
}
movieClip 743 {
}
movieClip 744 GreenBrick {
}
movieClip 747 {
}
movieClip 748 InPotBox {
}
instance PotTally of movieClip 748 InPotBox {
onClipEvent (load) {
this._visible = false;
this._x = 410;
this._y = 200;
this.UpdatePot = function (Amount) {
if (Amount <= 0 || _root.SpeechEngine.NowAnnouncing) {
this._visible = false;
} else {
this.MoneyBox.text = _root.DollarString(Amount);
this.MoneyBox.autoSize = 'left';
this.MoneyBox._x = -(this.MoneyBox._width / 2);
this.Mortise._width = Math.max(60, this.MoneyBox._width + 10);
this._visible = true;
}
};
}
}
instance GameCard of movieClip 338 Back {
onClipEvent (load) {
this.LoadColor = function () {
this.theColor = new Color(this);
this.unhicolor = _root.CardUnHighlight;
this.bighicolor = _root.CardMajorHighlight;
this.littlehicolor = _root.CardMinorHighlight;
};
this.GHstate = function () {
return this.highlightstate;
};
this.SHstate = function (vv) {
this.highlightstate = vv;
};
this.addProperty('highlightstate', this.GHstate, this.SHstate);
this.Gcolor = function () {
return this.theColor;
};
this.Scolor = function (vv) {
this.theColor = vv;
};
this.addProperty('theColor', this.Gcolor, this.Scolor);
this.GH0 = function () {
return this.unhicolor;
};
this.SH0 = function (vv) {
this.unhicolor = vv;
};
this.addProperty('unhicolor', this.GH0, this.SH0);
this.GH1 = function () {
return this.bighicolor;
};
this.SH1 = function (vv) {
this.bighicolor = vv;
};
this.addProperty('bighicolor', this.GH1, this.SH1);
this.GH2 = function () {
return this.littlehicolor;
};
this.SH2 = function (vv) {
this.littlehicolor = vv;
};
this.addProperty('littlehicolor', this.GH2, this.SH2);
this.Highlight = function (newState) {
if (this.GHstate() == 1 && newState != 1) {
this.glow.removeMovieClip();
}
switch (newState) {
case 1:
if (this.GHstate() != 1) {
this.theColor.setTransform(this.bighicolor);
this.attachMovie('CardGlow', 'glow', this.getDepth(), this);
this.SHstate(1);
}
return undefined;
case 2:
if (this.GHstate() != 2) {
this.theColor.setTransform(this.littlehicolor);
this.SHstate(2);
}
return undefined;
}
if (this.GHstate() == 0) {
} else {
this.theColor.setTransform(this.unhicolor);
this.SHstate(0);
}
};
this.Gvalue = function () {
return this.RankAndSuit;
};
this.Svalue = function (vv) {
this.RankAndSuit = vv;
};
this.addProperty('RankAndSuit', this.Gvalue, this.Svalue);
this.Gupness = function () {
return this.Uposity;
};
this.Supness = function (vv) {
this.Uposity = vv;
};
this.addProperty('Uposity', this.Gupness, this.Supness);
this.GinMotion = function () {
return this.inMotion;
};
this.SinMotion = function (vv) {
this.inMotion = vv;
};
this.addProperty('inMotion', this.GinMotion, this.SinMotion);
this.SinMotion(false);
this.GdestX = function () {
return this.destX;
};
this.SdestX = function (vv) {
this.destX = vv;
};
this.addProperty('destX', this.GdestX, this.SdestX);
this.GdestY = function () {
return this.destY;
};
this.SdestY = function (vv) {
this.destY = vv;
};
this.addProperty('destY', this.GdestY, this.SdestY);
this.GdestR = function () {
return this.destR;
};
this.SdestR = function (vv) {
this.destR = vv;
};
this.addProperty('destR', this.GdestR, this.SdestR);
this.GdestS = function () {
return this.destS;
};
this.SdestS = function (vv) {
this.destS = vv;
};
this.addProperty('destS', this.GdestS, this.SdestS);
}
}
movieClip 750 {
}
movieClip 752 {
}
movieClip 754 {
}
movieClip 755 WinnerBox {
}
movieClip 757 {
}
movieClip 759 {
}
movieClip 760 ExtraWhite {
}
movieClip 765 PlayerInfoBox {
instance WinnerSign of movieClip 755 WinnerBox {
onClipEvent (load) {
this._visible = false;
}
}
instance ExtraWhite of movieClip 760 ExtraWhite {
onClipEvent (load) {
this._visible = false;
}
}
}
instance NameTag of movieClip 765 PlayerInfoBox {
onClipEvent (load) {
this.LoadColor = function () {
this.theColor = new Color(this);
this.fullcolor = _root.CardUnHighlight;
this.graycolor = _root.GrayOutColor;
};
this.GrayState = function () {
return this.grayoutstate;
};
this.SetGray = function (vv) {
this.grayoutstate = vv;
};
this.addProperty('grayoutstate', this.GrayState, this.SetGray);
this.Gcolor = function () {
return this.theColor;
};
this.Scolor = function (vv) {
this.theColor = vv;
};
this.addProperty('theColor', this.Gcolor, this.Scolor);
this.GFC = function () {
return this.fullcolor;
};
this.SFC = function (vv) {
this.fullcolor = vv;
};
this.addProperty('fullcolor', this.GFC, this.SFC);
this.GGC = function () {
return this.graycolor;
};
this.SGC = function (vv) {
this.graycolor = vv;
};
this.addProperty('graycolor', this.GGC, this.SGC);
this.Brightness = function (newState) {
if (newState !== 0) {
} else {
if (this.GrayState() != 0) {
this.theColor.setTransform(this.graycolor);
this.SetGray(0);
}
return undefined;
}
if (this.GrayState() == 1) {
} else {
this.theColor.setTransform(this.fullcolor);
this.SetGray(1);
}
};
this.WriteName = function (TheName) {
this.NameBox.text = TheName;
};
this.WriteBank = function (amt) {
if (amt == parseInt(amt)) {
this.BankBox.text = _root.DollarString(amt);
} else {
this.BankBox.text = amt;
}
};
this.WriteBig = function (TheText) {
this.BigLine.text = TheText;
};
this.WriteLittle = function (TheText) {
if (TheText == '') {
this.ExtraWhite._visible = false;
} else {
this.ExtraWhite._visible = true;
}
this.LittleLine.text = TheText;
};
this.ShowWinner = function (whether) {
if (whether) {
this.WinnerSign.gotoAndPlay(1);
} else {
this.WinnerSign.stop();
}
this.WinnerSign._visible = whether;
};
}
}
movieClip 767 {
}
movieClip 768 AnnouncementBox {
}
movieClip 770 Announcer {
}
instance GameMsg of movieClip 770 Announcer {
onClipEvent (load) {
this._visible = false;
this._x = 300;
this._y = 196;
this.sayWords = function (TheWords) {
this.MsgBox.text = TheWords;
this.MsgBox.autoSize = 'center';
this.MsgBox._y = -(this.MsgBox._height / 2);
};
this.sayWords('');
}
}
movieClip 772 {
}
movieClip 773 {
}
movieClip 776 SpeechBalloon {
}
instance GameSpeech of movieClip 776 SpeechBalloon {
onClipEvent (load) {
this._visible = false;
this.point = function (direction) {
if (direction == 'upleft') {
this.spike._xscale = -100;
this.spike._rotation = 180;
this.spikeshadow._xscale = -100;
this.spikeshadow._rotation = 180;
}
if (direction == 'upright') {
this.spike._xscale = 100;
this.spike._rotation = 180;
this.spikeshadow._xscale = 100;
this.spikeshadow._rotation = 180;
}
if (direction == 'left') {
this.spike._xscale = 100;
this.spike._rotation = 0;
this.spikeshadow._xscale = 100;
this.spikeshadow._rotation = 0;
}
if (direction == 'right') {
this.spike._xscale = -100;
this.spike._rotation = 0;
this.spikeshadow._xscale = -100;
this.spikeshadow._rotation = 0;
}
if (direction == 'down') {
this.spike._xscale = -100;
this.spike._rotation = 70;
this.spikeshadow._xscale = -100;
this.spikeshadow._rotation = 70;
}
};
this.sayWords = function (TheWords) {
this.WordBox.text = TheWords;
this.WordBox.autoSize = 'center';
this.WordBox._y = -(this.WordBox._height / 2);
};
this.sayWords('');
}
}
movieClip 778 {
}
movieClip 779 {
}
movieClip 782 {
}
movieClip 785 {
}
movieClip 787 {
}
movieClip 791 {
}
button 794 {
on (release) {
_root.YouBalloon.CheckButtonPressed();
}
}
button 798 {
on (release) {
_root.YouBalloon.CallButtonPressed();
}
}
movieClip 803 {
}
button 804 {
on (release) {
_root.YouBalloon.BetButtonPressed();
}
}
movieClip 808 {
}
button 809 {
on (release) {
_root.YouBalloon.RaiseButtonPressed();
}
}
button 813 {
on (release) {
_root.YouBalloon.AllInButtonPressed();
}
}
button 817 {
on (release) {
_root.YouBalloon.FoldButtonPressed();
}
}
movieClip 821 {
}
movieClip 824 {
}
movieClip 829 {
}
movieClip 831 {
}
movieClip 833 {
}
movieClip 835 {
}
button 836 {
on (release) {
_root.YouBalloon.OKButtonPressed();
}
}
movieClip 838 {
}
movieClip 840 {
}
movieClip 842 {
}
button 843 {
on (release) {
_root.YouBalloon.CancelButtonPressed();
}
}
movieClip 845 {
}
movieClip 847 {
}
button 849 {
on (release) {
AdjustQty(250);
}
}
movieClip 851 {
}
movieClip 853 {
}
button 854 {
on (release) {
AdjustQty(-250);
}
}
button 855 {
on (release) {
AdjustQty(1000);
}
}
button 856 {
on (release) {
AdjustQty(-1000);
}
}
button 857 {
on (release) {
AdjustQty(25000);
}
}
button 858 {
on (release) {
AdjustQty(-5000);
}
}
button 859 {
on (release) {
AdjustQty(5000);
}
}
button 860 {
on (release) {
AdjustQty(-25000);
}
}
movieClip 861 {
}
movieClip 862 {
instance Quantifier of movieClip 861 {
onClipEvent (load) {
function AdjustQty(Delta) {
this.Yqty += Delta;
this.Yqty = Math.max(this.YqtyMin, this.Yqty);
this.Yqty = Math.min(this.YqtyMax, this.Yqty);
this.BetBox.text = _root.DollarString(this.Yqty);
}
this._visible = false;
}
}
}
instance OldYouBalloon of movieClip 862 {
onClipEvent (load) {
function HideChoices(YourChoice, YourAmt) {
this._visible = false;
this.Quantifier._visible = false;
this.CheckButton._visible = false;
this.CallButton._visible = false;
this.BetButton._visible = false;
this.RaiseButton._visible = false;
this.AllInButton._visible = false;
this.FoldButton._visible = false;
this.AdviceButton._visible = false;
this.CallBox._visible = false;
_root.GameEngine.YourDecision[0] = YourChoice;
_root.GameEngine.YourDecision[1] = YourAmt;
_root.GameEngine.GotYourBet = true;
_root.needInput = false;
this.aChoices = new Array();
}
function ShowChoices(ChoicesArray) {
bbTop = -82;
bbBottom = 42;
bbCenter = -20;
bbDelta = 28;
bb = 0;
while (bb < ChoicesArray.length) {
var tButton = eval('this.' + ((ChoicesArray[bb] == 'All In') ? 'AllIn' : ChoicesArray[bb]) + 'Button');
tButton._y = bbCenter + bbDelta * (bb - ChoicesArray.length / 2 + 0.5);
if (ChoicesArray[bb] == 'Call') {
this.CallBox._y = this.CallButton._y - 10;
this.CallBox.text = _root.DollarString(_root.BettingRound.AmountToCall(1));
this.CallBox._visible = true;
}
tButton._visible = true;
++bb;
}
this.Quantifier._visible = false;
this._visible = true;
this.aChoices = ChoicesArray;
}
function BetButtonPressed() {
this.Quantifier.Yqty = _root.BettingRound.BetMinimum;
this.Quantifier.YqtyMin = _root.BettingRound.BetMinimum;
this.Quantifier.YqtyMax = _root.Player1.Gbank();
this.Quantifier.SpecifyBox.text = 'Bet';
this.Quantifier.BetBox.text = _root.DollarString(this.Quantifier.Yqty);
this.Quantifier._visible = true;
this.CheckButton._visible = false;
this.CallButton._visible = false;
this.BetButton._visible = false;
this.RaiseButton._visible = false;
this.AllInButton._visible = false;
this.FoldButton._visible = false;
this.AdviceButton._visible = false;
}
function RaiseButtonPressed() {
this.Quantifier.Yqty = _root.BettingRound.BetMinimum;
this.Quantifier.YqtyMin = _root.BettingRound.BetMinimum;
this.Quantifier.YqtyMax = _root.Player1.Gbank() - _root.BettingRound.AmountToCall(1);
this.Quantifier.SpecifyBox.text = 'Raise';
this.Quantifier.BetBox.text = _root.DollarString(this.Quantifier.Yqty);
this.Quantifier._visible = true;
this.CheckButton._visible = false;
this.CallButton._visible = false;
this.BetButton._visible = false;
this.RaiseButton._visible = false;
this.AllInButton._visible = false;
this.FoldButton._visible = false;
this.AdviceButton._visible = false;
}
function OKButtonPressed() {
HideChoices(this.Quantifier.SpecifyBox.text, this.Quantifier.Yqty);
}
function CancelButtonPressed() {
ShowChoices(this.aChoices);
}
function CheckButtonPressed() {
HideChoices('Check', 0);
}
function CallButtonPressed() {
HideChoices('Call', _root.BettingRound.AmountToCall(1));
}
function AllInButtonPressed() {
HideChoices('All In', _root.Player1.Gbank());
}
function FoldButtonPressed() {
HideChoices('Fold', 0);
}
this._visible = false;
this._x = 150;
this._y = 272;
this.Quantifier._visible = false;
this.CheckButton._visible = false;
this.CallButton._visible = false;
this.BetButton._visible = false;
this.RaiseButton._visible = false;
this.AllInButton._visible = false;
this.FoldButton._visible = false;
this.AdviceButton._visible = false;
this.CallBox._visible = false;
}
}
movieClip 864 {
}
movieClip 866 {
}
movieClip 868 {
}
movieClip 870 {
}
movieClip 872 {
}
button 874 {
on (release) {
_root.GameEngine.QuitButtonPressed();
}
}
movieClip 876 {
}
movieClip 877 {
}
instance GamePlayer of movieClip 877 {
onClipEvent (load) {
this._visible = false;
this.Gname = function () {
return this.PlayerName;
};
this.Sname = function (vv) {
this.PlayerName = vv;
};
this.addProperty('PlayerName', this.Gname, this.Sname);
this.Gbank = function () {
return this.Bank;
};
this.Sbank = function (vv) {
this.Bank = vv;
};
this.ToBank = function (vv) {
this.Bank += vv;
return this.Bank;
};
this.addProperty('Bank', this.Gbank, this.Sbank);
this.Gdchip = function () {
return this.DchipLocation;
};
this.Sdchip = function (Xplace, Yplace) {
this.DchipLocation = new Array(Xplace, Yplace);
};
this.addProperty('DchipLocation', this.Gdchip, this.Sdchip);
this.sezAt = function () {
return this.SpeechLocation;
};
this.sayAt = function (Xplace, Yplace, Direction) {
this.SpeechLocation = new Array(Xplace, Yplace, Direction);
};
this.addProperty('SpeechLocation', this.sezAt, this.sayAt);
this.Xcard = function () {
return this.XCardStart;
};
this.sXcard = function (vv) {
this.XCardStart = vv;
};
this.addProperty('XCardStart', this.Xcard, this.sXcard);
this.Ycard = function () {
return this.YCardStart;
};
this.sYcard = function (vv) {
this.YCardStart = vv;
};
this.addProperty('YCardStart', this.Ycard, this.sYcard);
this.Dcard = function () {
return this.DeltaCard;
};
this.sDcard = function (vv) {
this.DeltaCard = vv;
};
this.addProperty('DeltaCard', this.Dcard, this.sDcard);
this.IsFolded = function () {
return this.HasFolded;
};
this.Fold = function (vv) {
this.HasFolded = (vv == undefined) ? true : vv;
};
this.addProperty('HasFolded', this.IsFolded, this.Fold);
this.Ghand = function () {
return this.CardsHeld;
};
this.Shand = function (vv) {
this.CardsHeld = vv;
};
this.ClearHand = function () {
vv = new Array();
this.CardsHeld = vv;
};
this.AddCard = function (vv) {
vvv = this.CardsHeld;
vvv.push(vv);
this.CardsHeld = vvv;
};
this.addProperty('CardsHeld', this.Ghand, this.Shand);
this.Gworth = function () {
return this.Worth;
};
this.Sworth = function (vv) {
this.Worth = vv;
};
this.addProperty('Worth', this.Gworth, this.Sworth);
this.ClearHand();
}
}
instance DeckEngine of movieClip 722 {
onClipEvent (load) {
function HighlightCard(whichCard, whichState) {
whichCard = IdentifyCard(whichCard);
whichCard.Highlight(whichState);
}
function IdentifyCard(wC) {
if (typeof wC == 'movieclip') {
return wC;
}
if (wC == parseInt(wC)) {
return eval('_root.GameCard.dealt' + wC.toString());
}
g = 12;
while (g <= _root.DealerCounter) {
Xc = eval('_root.GameCard.dealt' + g.toString());
if (Xc.Gvalue() == wC) {
return Xc;
}
++g;
}
return false;
}
function ShuffleCards(Silently) {
if (Silently != 'silently') {
_root.ShuffleSound.start();
}
_root.DeckThing._rotation = 0;
_root.DeckThing._visible = true;
g = 11;
while (g <= _root.DealerCounter) {
removeMovieClip('_root.GameCard.dealt' + g.toString());
++g;
}
_root.DealerCounter = 11;
_root.cardsInDeck = 52;
for (ThisCard in _root.TheDeck) {
_root.TheDeck[ThisCard].Order = (Math.random()).toString();
}
_root.TheDeck.sortOn('Order');
}
function DealCard(Xend, Yend, Rend, Upness, Sloppiness, Scaling) {
if (_root.cardsInDeck > 0) {
if (Scaling == undefined) {
Scaling = 100;
}
if (Math.random() > 0.27) {
_root.Deal1Sound.start();
} else {
_root.Deal2Sound.start();
}
--_root.cardsInDeck;
if (_root.cardsInDeck == 0) {
_root.DeckThing._visible = false;
}
++_root.DealerCounter;
_root.DeckThing._rotation += Math.random() * 4 - 2;
ThisCard = 'dealt' + _root.DealerCounter.toString();
TheDealtCard = _root.TheDeck[51 - _root.cardsInDeck].Card;
if (Upness == 'up') {
_root.GameCard.attachMovie(TheDealtCard, ThisCard, _root.DealerCounter, _root.GameCard);
} else {
_root.GameCard.attachMovie('Back', ThisCard, _root.DealerCounter, _root.GameCard);
}
cardObject = eval('_root.GameCard.' + ThisCard);
cardObject._x = _root.DeckThing._x - _root.GameCard._x;
cardObject._y = _root.DeckThing._y - _root.GameCard._y;
cardObject._rotation = Math.random() * 360;
cardObject._xscale = 10 + Math.random() * 70;
cardObject.SinMotion(true);
cardObject.Svalue(TheDealtCard);
cardObject.Supness(Upness);
cardObject.LoadColor();
Xend = Xend + (Math.random() - 0.5) * Sloppiness * 1.4 - _root.GameCard._x;
Yend = Yend + (Math.random() - 0.5) * Sloppiness - _root.GameCard._y;
Rend += (Math.random() - 0.5) * Sloppiness;
cardObject.SdestX(Xend);
cardObject.SdestY(Yend);
cardObject.SdestR(Rend);
cardObject.SdestS(Scaling);
_root.cardsInMotion = true;
return TheDealtCard;
} else {
return 0;
}
}
function TurnUpCard(whichCard) {
cObject = IdentifyCard(whichCard);
if (cObject != false) {
cNumber = cObject.getDepth();
if (cObject.Gupness() != 'up') {
_root.Deal1Sound.start();
tX = cObject._x;
tY = cObject._y;
tR = cObject._rotation;
tXs = cObject._xscale;
tYs = cObject._yscale;
tV = cObject._visible;
tRS = cObject.Gvalue();
removeMovieClip('_root.GameCard.dealt' + cNumber.toString());
_root.GameCard.attachMovie(tRS, 'dealt' + cNumber.toString(), cNumber, _root.GameCard);
cObject = eval('_root.GameCard.dealt' + cNumber.toString());
cObject._x = tX;
cObject._y = tY;
cObject._rotation = tR;
cObject._xscale = tXs;
cObject._yscale = tYs;
cObject._visible = tV;
cObject.Svalue(tRS);
cObject.Supness('up');
cObject.LoadColor();
}
}
}
function TurnDownCard(whichCard) {
cObject = IdentifyCard(whichCard);
if (cObject != false) {
cNumber = cObject.getDepth();
if (cObject.Gupness() == 'up') {
_root.Deal1Sound.start();
tX = cObject._x;
tY = cObject._y;
tR = cObject._rotation;
tXs = cObject._xscale;
tYs = cObject._yscale;
tV = cObject._visible;
tRS = cObject.Gvalue();
removeMovieClip('_root.GameCard.dealt' + cNumber.toString());
_root.GameCard.attachMovie('Back', 'dealt' + cNumber.toString(), cNumber, _root.GameCard);
cObject = eval('_root.GameCard.dealt' + cNumber.toString());
cObject._x = tX;
cObject._y = tY;
cObject._rotation = tR;
cObject._xscale = tXs;
cObject._yscale = tYs;
cObject._visible = tV;
cObject.Svalue(tRS);
cObject.Supness('up');
cObject.LoadColor();
}
}
}
function GatherCards(Xend, Yend, Rend, Variance) {
_root.Deal2Sound.start(0, 2);
g = 12;
while (g <= _root.DealerCounter) {
cardObject = eval('_root.GameCard.dealt' + g.toString());
HighlightCard(cardObject, 0);
cardObject.SinMotion(true);
cardObject.SdestX(Xend + 2 * (Math.random() - 0.5) * Variance);
cardObject.SdestY(Yend + 2 * (Math.random() - 0.5) * Variance);
cardObject.SdestR(Rend + 2 * (Math.random() - 0.5) * Variance);
cardObject.SdestS(100);
++g;
}
_root.cardsInMotion = true;
}
function DiscardCard(whichCard) {
TurnDownCard(whichCard);
cObject = IdentifyCard(whichCard);
_root.Deal2Sound.start();
HighlightCard(cObject, 0);
cObject.SinMotion(true);
cObject.SdestX(375 + (Math.random() - 0.5) * 6 - _root.GameCard._x);
cObject.SdestY(35 + (Math.random() - 0.5) * 6 - _root.GameCard._y);
cObject.SdestR(90 + (Math.random() - 0.5) * 6);
cObject.SdestS(100);
_root.cardsInMotion = true;
}
this._visible = false;
_root.cardsInMotion = false;
_root.DealerCounter = 11;
_root.cardsInDeck = 52;
_root.TheRanks = new Array('A', '2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K');
_root.TheSuits = new Array('s', 'd', 'c', 'h');
_root.TheDeck = new Array();
for (ThisSuit in _root.TheSuits) {
for (ThisRank in _root.TheRanks) {
_root.TheDeck.push({'Card': _root.TheRanks[ThisRank] + _root.TheSuits[ThisSuit], 'Order': (Math.random()).toString()});
}
}
_root.TheRanks.push('A');
_root.cardsInDeck = 52;
_root.CardUnHighlight = new Object();
_root.CardUnHighlight = {'ra': '100', 'rb': '0', 'ga': '100', 'gb': '0', 'ba': '100', 'bb': '0', 'aa': '100', 'ab': '0'};
_root.CardMajorHighlight = new Object();
_root.CardMajorHighlight = {'ra': '90', 'rb': '+80', 'ga': '90', 'gb': '+20', 'ba': '90', 'bb': '-75', 'aa': '100', 'ab': '0'};
_root.CardMinorHighlight = new Object();
_root.CardMinorHighlight = {'ra': '100', 'rb': '+80', 'ga': '90', 'gb': '-20', 'ba': '90', 'bb': '-100', 'aa': '100', 'ab': '0'};
_root.GrayOutColor = {'ra': '70', 'rb': '+0', 'ga': '70', 'gb': '+16', 'ba': '70', 'bb': '+19', 'aa': '100', 'ab': '0'};
}
onClipEvent (enterFrame) {
if (_root.cardsInMotion) {
_root.MoveCards();
}
}
}
movieClip 879 {
}
movieClip 880 {
}
instance GameBoard of movieClip 880 {
onClipEvent (load) {
this._visible = false;
this.Xcard = function () {
return this.XCardStart;
};
this.sXcard = function (vv) {
this.XCardStart = vv;
};
this.addProperty('XCardStart', this.Xcard, this.sXcard);
this.Ycard = function () {
return this.YCardStart;
};
this.sYcard = function (vv) {
this.YCardStart = vv;
};
this.addProperty('YCardStart', this.Ycard, this.sYcard);
this.Dcard = function () {
return this.DeltaCard;
};
this.sDcard = function (vv) {
this.DeltaCard = vv;
};
this.addProperty('DeltaCard', this.Dcard, this.sDcard);
this.sDcard(58);
this.sYcard(125);
this.sXcard(300 - this.Dcard() * 2);
this.Ghand = function () {
return this.CardsHeld;
};
this.Shand = function (vv) {
this.CardsHeld = vv;
};
this.ClearHand = function () {
vv = new Array();
this.CardsHeld = vv;
};
this.AddCard = function (vv) {
vvv = this.CardsHeld;
vvv.push(vv);
this.CardsHeld = vvv;
};
this.addProperty('CardsHeld', this.Ghand, this.Shand);
this.Gworth = function () {
return this.Worth;
};
this.Sworth = function (vv) {
this.Worth = vv;
};
this.addProperty('Worth', this.Gworth, this.Sworth);
this.ClearHand();
}
}
movieClip 882 {
}
movieClip 883 {
}
instance GameTable of movieClip 883 {
onClipEvent (load) {
this._visible = false;
this.PotX = 300;
this.PotY = 200;
this.DiscardX = 370;
this.DiscardY = 35;
this.Seats = new Array();
this.Seats[0] = new Array(300, 300, 40, 190, 370, 170, 230, 'right');
this.Seats[1] = new Array(60, 270, 40, 145, 255, 215, 225, 'left');
this.Seats[2] = new Array(60, 100, 40, 135, 75, 215, 200, 'upleft');
this.Seats[3] = new Array(540, 100, 40, 465, 75, 385, 200, 'upright');
this.Seats[4] = new Array(540, 270, 40, 455, 255, 385, 225, 'right');
}
}
instance ChipEngine of movieClip 722 {
onClipEvent (load) {
function DealChip(ChipColor, Xstart, Ystart, Xend, Yend, Sloppiness) {
++_root.ChipCounter;
ThisChip = 'chip' + _root.ChipCounter.toString();
_root.GameChip.attachMovie(ChipColor + 'Chip', ThisChip, _root.ChipCounter, _root.GameChip);
chipObject = eval('_root.GameChip.' + ThisChip);
chipObject._x = Xstart - _root.GameChip._x;
chipObject._y = Ystart - _root.GameChip._y;
chipObject._rotation = Math.random() * 360;
chipObject.SinMotion(true);
Xend = Xend + (Math.random() - 0.5) * Sloppiness * 2 - _root.GameChip._x;
Yend = Yend + (Math.random() - 0.5) * Sloppiness - _root.GameChip._y;
Rend = Math.random() * 360;
chipObject.SdestX(Xend);
chipObject.SdestY(Yend);
chipObject.SdestR(Rend);
_root.chipsInMotion = true;
}
function ClearChips() {
g = 61;
while (g <= _root.ChipCounter) {
removeMovieClip('_root.GameChip.chip' + g.toString());
++g;
}
_root.ChipCounter = 60;
}
function ChipsToPot(pNumber, dAmt) {
ThePlayer = eval('_root.Player' + pNumber.toString());
StartX = ThePlayer.Xcard();
StartY = ThePlayer.Ycard();
EndX = _root.GameTable.PotX;
EndY = _root.GameTable.PotY;
TheChips = CheckChange(dAmt);
for (TT in TheChips) {
if (TheChips[TT] > 0) {
j = 0;
while (j < TheChips[TT]) {
DealChip(_root.TheChipColors[TT], StartX, StartY, EndX, EndY, 60);
++j;
}
}
}
}
function ChipsToPlayers(pNarray) {
Sloppiness = 10;
pNcounter = 0;
ggg = 61;
while (ggg <= _root.ChipCounter) {
ThePlayer = eval('_root.Player' + pNarray[pNcounter]);
chipObject = eval('_root.GameChip.chip' + ggg.toString());
chipObject.SinMotion(true);
Xdest = ThePlayer.Xcard() + (Math.random() - 0.5) * Sloppiness * 1.4 - _root.GameChip._x;
Ydest = ThePlayer.Ycard() + (Math.random() - 0.5) * Sloppiness - _root.GameChip._y;
chipObject.SdestX(Xdest);
chipObject.SdestY(Ydest);
chipObject.SdestR(Math.random() * 360);
++pNcounter;
if (pNcounter >= pNarray.length) {
pNcounter = 0;
}
++ggg;
}
_root.chipsInMotion = true;
}
function CheckChange(Amt) {
ChipArray = new Array();
Amt = parseInt(Amt);
if (Amt <= 0 || Amt.toString() == 'NaN') {
return ChipArray;
}
if (Amt > 50000000) {
Amt = 50000000;
}
DD = parseInt(Amt / 25000);
ChipArray.push(DD);
Amt -= DD * 25000;
DD = parseInt(Amt / 5000);
ChipArray.push(DD);
Amt -= DD * 5000;
DD = parseInt(Amt / 1000);
ChipArray.push(DD);
Amt -= DD * 1000;
DD = parseInt(Amt / 250);
Amt -= DD * 250;
if (Amt > 0) {
++DD;
}
ChipArray.push(DD);
return ChipArray;
}
this._visible = false;
_root.TheChipColors = new Array('Orange', 'Blue', 'White', 'Magenta');
_root.ChipCounter = 60;
_root.chipsInMotion = false;
}
onClipEvent (enterFrame) {
if (_root.chipsInMotion) {
_root.MoveChips();
}
}
}
instance SpeechEngine of movieClip 776 SpeechBalloon {
onClipEvent (load) {
function Announce(statement, fLast, fDelay) {
if (fLast == undefined) {
fLast = 12;
}
if (fDelay == undefined) {
fDelay = 12;
}
_root.GameMsg.sayWords(statement);
_root.GameMsg._visible = true;
MsgShower = fLast;
MsgDelayer = fDelay;
NowAnnouncing = true;
_root.PotTally._visible = false;
_root.announcing = fDelay > 0;
}
function PlayerSez(tPnum, statement, fDelay) {
if (fDelay == undefined) {
fDelay = 12;
}
sLoc = (eval('_root.Player' + tPnum.toString())).sezAt();
_root.GameSpeech._x = sLoc[0];
_root.GameSpeech._y = sLoc[1];
_root.GameSpeech.point(sLoc[2]);
_root.GameSpeech.sayWords(statement);
_root.GameSpeech._visible = true;
SpeechDelayer = fDelay;
_root.playerSpeaking = true;
}
function EndSpeech() {
_root.GameSpeech._visible = false;
_root.GameSpeech.sayWords('');
_root.GameSpeech._x = BalloonOx;
_root.GameSpeech._y = BalloonOy;
_root.playerSpeaking = false;
SpeechDelayer = 0;
}
function TurnOffAnnounce() {
_root.GameMsg._visible = false;
_root.GameMsg.sayWords('');
NowAnnouncing = false;
_root.PotTally.UpdatePot(_root.PotAmount);
MsgShower = 0;
}
function StopDelay() {
_root.announcing = false;
MsgDelayer = 0;
}
function DoCommercial(activity) {
MyAd = _root.TheCommercial;
switch (activity) {
case 'Play':
MyAd._visible = true;
MyAd.gotoAndPlay(1);
_root.adRunning = true;
AdDelayer = 40;
return undefined;
case 'Hide':
MyAd._visible = false;
MyAd.gotoAndStop(1);
_root.adRunning = false;
AdDelayer = 0;
return undefined;
}
}
this._visible = false;
_root.playerSpeaking = false;
_root.announcing = false;
_root.adRunning = false;
NowAnnouncing = false;
BalloonOx = _root.GameSpeech._x;
BalloonOy = _root.GameSpeech._y;
SpeechDelayer = 0;
MsgShower = 0;
MsgDelayer = 0;
AdDelayer = 0;
}
onClipEvent (enterFrame) {
if (MsgShower > 0) {
--MsgShower;
}
if (NowAnnouncing && MsgShower <= 0) {
TurnOffAnnounce();
}
if (SpeechDelayer > 0) {
--SpeechDelayer;
}
if (_root.playerSpeaking && SpeechDelayer <= 0) {
EndSpeech();
}
if (MsgDelayer > 0) {
--MsgDelayer;
}
if (_root.announcing && MsgDelayer <= 0) {
StopDelay();
}
if (AdDelayer > 0) {
--AdDelayer;
}
if (_root.adRunning && AdDelayer <= 0) {
DoCommercial('Hide');
}
}
}
instance BettingRound of movieClip 721 AnIris {
onClipEvent (load) {
function NewRound(dOrder) {
this.RoundOrder = dOrder;
this.BetMinimum = _root.TheSmallBet;
if (_root.GameEngine.GameStatus == 'dealing turn' || _root.GameEngine.GameStatus == 'dealing river') {
this.BetMinimum = _root.TheBigBet;
}
this.HighestBet = 0;
for (iii in this.AmountInRound) {
this.AmountInHand[iii] += this.AmountInRound[iii];
}
this.AmountInRound = new Array(0, 0, 0, 0, 0, 0);
this.RaisesSoFar = 0;
this.CanOpen = true;
this.CanRaise = false;
}
function BetDecide(Pnumber) {
WhichRound = _root.GameEngine.GameStatus;
Pobj = eval('_root.Player' + Pnumber.toString());
Pbank = Pobj.Gbank();
ToCall = AmountToCall(Pnumber);
MinBet = this.BetMinimum;
InPot = _root.PotAmount;
MyWorth = Pobj.Gworth();
MyPlace = PlaceInOrder(Pnumber);
MyQuality = HandQuality(MyWorth, WhichRound, MyPlace);
BestChoice = 'Fold';
BestAmount = 0;
if (!this.MustAllIn && ToCall <= 0) {
BestChoice = 'Check';
BestAmount = 0;
}
if (this.CanOpen && Pbank >= MinBet) {
if (MyQuality >= 2 && _root.PotAmount / MinBet > 2) {
BestChoice = 'Bet';
BestAmount = MinBet;
}
if (MyQuality >= 3 && _root.PotAmount / MinBet > 1) {
BestChoice = 'Bet';
BestAmount = 0.75 * _root.PotAmount / _root.GameEngine.HowManyPlayers;
}
if (MyQuality >= 4) {
BestChoice = 'Bet';
BestAmount = 2.5 * _root.PotAmount / _root.GameEngine.HowManyPlayers;
}
}
if (BestChoice == 'Bet') {
BestAmount = 250 * Math.round(BestAmount / 250);
BestAmount = Math.max(MinBet, BestAmount);
BestAmount = Math.min(Pbank, BestAmount);
}
if (Pbank >= ToCall && ToCall > 0) {
if (MyQuality >= 1 && _root.PotAmount / ToCall > 3) {
BestChoice = 'Call';
BestAmount = ToCall;
}
if (MyQuality >= 2 && _root.PotAmount / ToCall > 2) {
BestChoice = 'Call';
BestAmount = ToCall;
}
if (MyQuality >= 3) {
BestChoice = 'Call';
BestAmount = ToCall;
}
}
if (this.CanRaise && Pbank >= ToCall + MinBet) {
if (MyQuality >= 2 && _root.PotAmount / (ToCall + MinBet) > 4) {
BestChoice = 'Raise';
BestAmount = MinBet;
}
if (MyQuality >= 3 && _root.PotAmount / (ToCall + MinBet) > 1.2) {
BestChoice = 'Raise';
BestAmount = 1.25 * _root.PotAmount / _root.GameEngine.HowManyPlayers;
}
if (MyQuality >= 4) {
BestChoice = 'Raise';
BestAmount = 3.5 * _root.PotAmount / _root.GameEngine.HowManyPlayers;
}
}
if (BestChoice == 'Raise') {
BestAmount = 250 * Math.round(BestAmount / 250);
BestAmount = Math.max(MinBet, BestAmount);
BestAmount = Math.min(Pbank - ToCall, BestAmount);
}
if (this.MustAllIn) {
if (MyQuality >= 3 && _root.PotAmount / _root.TheBigBet > 1 + _root.GameEngine.HowManyPlayers) {
BestChoice = 'All In';
BestAmount = Pbank;
}
if (MyQuality >= 4) {
BestChoice = 'All In';
BestAmount = Pbank;
}
}
if (BestChoice == 'Call' && Pbank / _root.TheBigBet < 5) {
BestChoice = 'All In';
BestAmount = Pbank;
}
if (BestChoice == 'Call' && ToCall / Pbank > 0.8) {
BestChoice = 'All In';
BestAmount = Pbank;
}
if (BestChoice == 'Raise' && Pbank / _root.TheBigBet < 10) {
BestChoice = 'All In';
BestAmount = Pbank;
}
if (BestChoice == 'Raise' && BestAmount / Pbank > 0.6) {
BestChoice = 'All In';
BestAmount = Pbank;
}
if (MyQuality >= 4 && _root.PotAmount / _root.TheBigBet > 1 + _root.GameEngine.HowManyPlayers) {
BestChoice = 'All In';
BestAmount = Pbank;
}
if (Pbank / _root.TheBigBet < 2) {
BestChoice = 'All In';
BestAmount = Pbank;
}
gg = new Array(BestChoice, BestAmount);
return gg;
}
function HandQuality(pWorth, pRound, pPlace) {
if (pRound != 'preflop round') {
BoardWorth = _root.GameBoard.Gworth();
}
NiceFactor = 1;
NiceFactor = (pPlace == 1) ? NiceFactor * 1.4 : NiceFactor;
NiceFactor = pPlace > 0.6 ? NiceFactor * 1.3 : NiceFactor;
NiceFactor = _root.GameEngine.HowManyPlayers < 4 ? NiceFactor * 1.3 : NiceFactor;
NiceFactor = _root.GameEngine.HowManyPlayers < 3 ? NiceFactor * 1.4 : NiceFactor;
switch (pRound) {
case 'preflop round':
Bnum = pWorth[0] * NiceFactor;
Qnum = Bnum > 70 ? 1 : 0;
Qnum = Bnum > 110 ? 2 : Qnum;
Qnum = Bnum > 200 ? 3 : Qnum;
Qnum = Bnum > 300 ? 4 : Qnum;
break;
case 'flop round':
Wnum = _root.ArrayToWorth(pWorth[0]);
Bnum = _root.ArrayToWorth(BoardWorth[0]);
Inum = (Wnum - Bnum) * NiceFactor;
if (pWorth[0][0] >= 3) {
Inum *= pWorth[0][0] - 2;
}
Qnum = Inum > 1200000 ? 1 : 0;
Qnum = Inum > 2400000 ? 2 : Qnum;
Qnum = Inum > 4800000 ? 3 : Qnum;
Qnum = Inum > 8000000 ? 4 : Qnum;
break;
case 'turn round':
Wnum = _root.ArrayToWorth(pWorth[0]);
Bnum = _root.ArrayToWorth(BoardWorth[0]);
Inum = (Wnum - Bnum) * NiceFactor;
if (pWorth[0][0] >= 4) {
Inum *= pWorth[0][0] - 3;
}
Qnum = Inum > 1600000 ? 1 : 0;
Qnum = Inum > 3200000 ? 2 : Qnum;
Qnum = Inum > 6400000 ? 3 : Qnum;
Qnum = Inum > 10000000 ? 4 : Qnum;
break;
case 'river round':
Wnum = _root.ArrayToWorth(pWorth[0]);
Bnum = _root.ArrayToWorth(BoardWorth[0]);
Inum = (Wnum - Bnum) * NiceFactor;
if (pWorth[0][0] >= 5) {
Inum *= pWorth[0][0] - 4;
}
Qnum = Inum > 2000000 ? 1 : 0;
Qnum = Inum > 4000000 ? 2 : Qnum;
Qnum = Inum > 8000000 ? 3 : Qnum;
Qnum = Inum > 12000000 ? 4 : Qnum;
}
if (!Skilled) {
Qdum = 2;
Qdum = (Qnum == 0) ? 2 : Qdum;
Qdum = (Qnum == 1) ? 3 : Qdum;
Qdum = (Qnum == 2) ? 1 : Qdum;
Qdum = (Qnum == 3) ? 0 : Qdum;
Qdum = (Qnum == 4) ? 4 : Qdum;
Qnum = Qdum;
}
return Qnum;
}
function PlaceInOrder(Pnumber) {
tP = 0;
for (ii in this.dOrder) {
tP = (this.dOrder[ii] == Pnumber) ? ii : tP;
}
return (tP + 1) / this.dOrder.length;
}
function AmountToCall(pN) {
RtnAmt = this.HighestBet - this.AmountInRound[pN];
if (this.MustAllIn) {
RtnAmt = (eval('_root.Player' + pN.toString())).Gbank() * 2 + this.BetMinimum;
}
if (this.AmountAllIn[pN] > 0) {
RtnAmt = 0;
}
return RtnAmt;
}
function AffectChoices(kBet, bAmt, pN) {
switch (kBet) {
case 'Bet':
this.HighestBet += bAmt;
this.AmountInRound[pN] += bAmt;
this.BetMinimum = Math.max(bAmt, this.BetMinimum);
this.CanOpen = false;
this.CanRaise = this.RaisesSoFar >= this.RaiseLimit ? false : true;
return undefined;
case 'Call':
this.AmountInRound[pN] = this.HighestBet;
return undefined;
case 'Raise':
this.HighestBet += bAmt;
this.AmountInRound[pN] = this.HighestBet;
this.BetMinimum = Math.max(bAmt, this.BetMinimum);
++this.RaisesSoFar;
this.CanOpen = false;
this.CanRaise = this.RaisesSoFar >= this.RaiseLimit ? false : true;
return undefined;
case 'All In':
this.HighestBet += bAmt;
this.AmountInRound[pN] += bAmt;
this.AmountAllIn[pN] = this.AmountInRound[pN] + this.AmountInHand[pN];
this.MustAllIn = true;
this.CanOpen = false;
this.CanRaise = false;
return undefined;
}
}
function BetChoices(Pnumber) {
Pobj = eval('_root.Player' + Pnumber.toString());
Pbank = Pobj.Gbank();
ToCall = AmountToCall(Pnumber);
MinBet = this.BetMinimum;
BC = new Array();
if (!this.MustAllIn && ToCall <= 0) {
BC.push('Check');
}
if (this.CanOpen && Pbank >= MinBet) {
BC.push('Bet');
}
if (Pbank >= ToCall && ToCall > 0) {
BC.push('Call');
}
if (this.CanRaise && Pbank >= ToCall + MinBet) {
BC.push('Raise');
}
BC.push('All In');
if (ToCall > 0) {
BC.push('Fold');
}
return BC;
}
this._visible = false;
Skilled = _root.SkillOfOpponents == 'hard';
this.RaiseLimit = 3;
this.RoundOrder = new Array();
this.HighestBet = 0;
this.AmountInRound = new Array(0, 0, 0, 0, 0, 0);
this.AmountInHand = new Array(0, 0, 0, 0, 0, 0);
this.AmountAllIn = new Array(0, 0, 0, 0, 0, 0);
this.RaisesSoFar = 0;
this.BetMinimum = 0;
this.CanOpen = true;
this.CanRaise = false;
this.MustAllIn = false;
}
}
instance GameEngine of movieClip 722 {
onClipEvent (load) {
function QuitButtonPressed() {
removeMovieClip('_root.YouBalloon');
_root.Playlist = new Array('BlatLoopC', 'ToughLuck');
_root.MusicEngine.CutIn('BlatLoopA', 'BlatLoopB');
_root.MusicEngine.Swell('up');
_root.SpeechEngine.PlayerSez(1, 'I quit.', 24);
_root.needInput = false;
_root.YouLost = true;
_root.WeCanPlay = false;
this.GameStatus = 'game over';
}
function FindWinnersAmong(PNarray) {
wWorth = 0;
wPlayers = new Array();
for (ppp in PNarray) {
Pnum = PNarray[ppp].toString();
NotFolded = !(eval('_root.Player' + Pnum)).IsFolded();
tWorth = _root.ArrayToWorth(((eval('_root.Player' + Pnum)).Gworth())[0]);
if (tWorth == wWorth && NotFolded) {
wPlayers.push(Pnum);
}
if (tWorth > wWorth && NotFolded) {
wWorth = tWorth;
wPlayers = new Array(Pnum);
}
}
return wPlayers;
}
function FoldPlayer(Pnum) {
fPlayer = eval('_root.Player' + Pnumber.toString());
fPlayer.Fold(true);
fBox = eval('_root.Info' + Pnumber.toString());
fBox.WriteBig('Folded');
fBox.Brightness(0);
_root.DeckEngine.DiscardCard((fPlayer.Ghand())[0]);
_root.DeckEngine.DiscardCard((fPlayer.Ghand())[1]);
++this.FoldedPlayers;
}
function WeAre(AreWe) {
return this.GameStatus == AreWe && NotWaiting();
}
function NotWaiting() {
GameDelayed = false;
if (_root.cardsInMotion || _root.chipsInMotion) {
GameDelayed = true;
}
if (_root.playerSpeaking || _root.announcing || _root.adRunning) {
GameDelayed = true;
}
if (_root.needInput) {
GameDelayed = true;
}
return !GameDelayed;
}
function SetBetLimits(AA) {
_root.TheAnte = AA * 250;
_root.TheSmallBlind = _root.TheAnte * 2;
_root.TheBigBlind = _root.TheSmallBlind * 2;
_root.TheSmallBet = _root.TheBigBlind;
_root.TheBigBet = _root.TheSmallBet * 2;
_root.TheBuyIn = _root.TheBigBet * 25;
}
function PlayerMakeBet(pN, kBet, Amt) {
MyPlayer = eval('_root.Player' + pN.toString());
WhatToSay = '';
WhatToPay = 0;
CallAmount = _root.BettingRound.AmountToCall(pN);
switch (kBet) {
case 'Post':
WhatToSay = 'Post ' + _root.DollarString(Amt) + '.' + '\n' + '(';
WhatToSay += (SmallBlindPosted ? 'big' : 'small') + ' blind)';
WhatToPay = Amt;
break;
case 'Check':
WhatToSay = 'Check.';
WhatToPay = 0;
Amt = WhatToPay;
break;
case 'Bet':
WhatToSay = 'Bet ' + _root.DollarString(Amt) + '.';
WhatToPay = Amt;
break;
case 'Call':
WhatToSay = 'Call ' + _root.DollarString(CallAmount) + '.';
WhatToPay = CallAmount;
Amt = WhatToPay;
break;
case 'Raise':
if (CallAmount > 0) {
WhatToSay = 'Call ' + _root.DollarString(CallAmount) + '... and ';
}
WhatToSay += 'Raise ' + _root.DollarString(Amt) + '.';
WhatToPay = CallAmount + Amt;
break;
case 'All In':
WhatToSay = 'All In.';
WhatToPay = MyPlayer.Gbank();
Amt = WhatToPay;
break;
case 'Fold':
WhatToSay = 'Fold.';
WhatToPay = 0;
Amt = WhatToPay;
break;
default:
WhatToSay = 'Huh?';
WhatToPay = 0;
}
_root.SpeechEngine.PlayerSez(pN, WhatToSay, 30);
if (WhatToPay > 0) {
PlayerPayPot(pN, WhatToPay, kBet);
}
if (kBet == 'Post') {
kBet = SmallBlindPosted ? 'Raise' : 'Bet';
Amt = SmallBlindPosted ? Amt / 2 : Amt;
(eval('_root.Info' + pN.toString())).WriteLittle((SmallBlindPosted ? 'BIG' : 'SMALL') + ' BLIND');
}
if (kBet == 'All In' && !_root.BettingRound.MustAllIn && _root.MusicIsOn) {
_root.MusicEngine.CutIn('GuitarLoop');
}
_root.BettingRound.AffectChoices(kBet, Amt, pN);
}
function PlayerPayPot(NN, AA, Msg) {
Pobj = eval('_root.Player' + NN.toString());
Bobj = eval('_root.Info' + NN.toString());
NewBank = Pobj.ToBank(-AA);
Bobj.WriteBank(NewBank);
Bobj.WriteBig(Msg + ' ' + _root.DollarString(AA));
_root.PotAmount += AA;
_root.PotTally.UpdatePot(_root.PotAmount);
_root.ChipEngine.ChipsToPot(Pnumber, AA);
}
function HilitePlayerCards(thePlayer, toggle) {
PlayerWorth = thePlayer.Gworth();
for (g in PlayerWorth[3]) {
_root.DeckEngine.HighlightCard(PlayerWorth[3][g], toggle);
}
for (g in PlayerWorth[4]) {
_root.DeckEngine.HighlightCard(PlayerWorth[4][g], toggle * 2);
}
}
function PlayerLeftOf(PP, rightinstead) {
Pindex = TheSeatOf(PP);
AA = _root.GameEngine.ActivePlayers.concat(_root.GameEngine.ActivePlayers);
if (rightinstead == 'right') {
NNN = parseInt(AA.length) / 2 + parseInt(Pindex) - 1;
ii = 1;
while (ii < AA.length) {
if (parseInt(AA[NNN]) > 0) {
return AA[NNN];
} else {
--NNN;
}
++ii;
}
return 0;
}
NNN = parseInt(Pindex) + 1;
ii = 1;
while (ii < AA.length) {
if (parseInt(AA[NNN]) > 0) {
return AA[NNN];
} else {
++NNN;
}
++ii;
}
return 0;
}
function DealToPlayer(wP, Upness, Sloppiness) {
Scaling = (wP == _root.Player1) ? 180 : 100;
Xoffset = wP.Dcard() * (wP.Ghand()).length;
wP.AddCard(_root.DeckEngine.DealCard(wP.Xcard() + Xoffset, wP.Ycard(), 0, Upness, Sloppiness, Scaling));
}
function MakeAPlayer(pNumber, seat, bank, name) {
_root.GamePlayer.duplicateMovieClip('Player' + pNumber.toString(), 20 + pNumber, _root.GamePlayer);
MyPlayer = eval('_root.Player' + pNumber.toString());
MyPlayer.Sname(name);
MyPlayer.Sbank(bank);
MyPlayer.Fold(false);
seatingarray = _root.GameTable.Seats[seat];
MyPlayer.sYcard(seatingarray[1]);
MyPlayer.sDcard(seatingarray[2]);
MyPlayer.sXcard(seatingarray[0] - seatingarray[2] / 2);
MyPlayer.Sdchip(seatingarray[3], seatingarray[4]);
MyPlayer.sayAt(seatingarray[5], seatingarray[6], seatingarray[7]);
_root.GameEngine.ActivePlayers[seat] = pNumber;
++_root.GameEngine.HowManyPlayers;
_root.NameTag.duplicateMovieClip('Info' + pNumber.toString(), 10 + pNumber, _root.NameTag);
MyNameTag = eval('_root.Info' + pNumber.toString());
if (pNumber == 1) {
MyNameTag._xscale = 140;
MyNameTag._yscale = 140;
}
MyNameTag.LoadColor();
MyNameTag.WriteName(name);
MyNameTag.WriteBank(bank);
MyNameTag.WriteBig('');
MyNameTag.WriteLittle('');
MyNameTag._x = seatingarray[0];
MyNameTag._y = seatingarray[1] + 40;
}
function PlayerExists(pNumber) {
TheAnswer = false;
for (ii in _root.GameEngine.ActivePlayers) {
if (_root.GameEngine.ActivePlayers[ii] == pNumber) {
TheAnswer = true;
}
}
return pNumber <= 0 ? false : TheAnswer;
}
function TheSeatOf(pNumber) {
HisSeat = 0;
for (ii in _root.GameEngine.ActivePlayers) {
if (_root.GameEngine.ActivePlayers[ii] == pNumber) {
HisSeat = ii;
}
}
return HisSeat;
}
function KillPlayer(pNumber) {
if (PlayerExists(pNumber)) {
removeMovieClip('_root.Player' + pNumber.toString());
removeMovieClip('_root.Info' + pNumber.toString());
--_root.GameEngine.HowManyPlayers;
HisSeat = TheSeatOf(pNumber);
_root.GameEngine.ActivePlayers[HisSeat] = 0;
}
}
this._visible = false;
this.ActivePlayers = new Array(0, 0, 0, 0, 0);
this.HowManyPlayers = 0;
this.FoldedPlayers = 0;
this.WhoseDeal = 1;
this.HandsPlayed = 0;
_root.needInput = false;
this.GotYourBet = false;
if (_root.WeCanPlay) {
this.GameStatus = 'initializing';
} else {
_root.gotoAndPlay(_root.YouLost ? 'TooBad' : 'Congrats');
}
}
onClipEvent (enterFrame) {
if (WeAre('game over')) {
KillPlayer(1);
KillPlayer(2);
KillPlayer(3);
KillPlayer(4);
KillPlayer(5);
removeMovieClip('_root.YouBalloon');
_root.gotoAndPlay(_root.YouLost ? 'TooBad' : 'Congrats');
}
if (WeAre('initializing')) {
removeMovieClip('_root.YouBalloon');
KillPlayer(1);
KillPlayer(2);
KillPlayer(3);
KillPlayer(4);
KillPlayer(5);
this.HowManyPlayers = 0;
this.ActivePlayers = new Array(0, 0, 0, 0, 0);
SetBetLimits(1);
MakeAPlayer(1, 0, _root.TheBuyIn, _root.YourName);
MakeAPlayer(3, 2, _root.TheBuyIn, _root.NamesOfOpponents[0]);
if (_root.NumberOfOpponents > 1) {
MakeAPlayer(4, 3, _root.TheBuyIn, _root.NamesOfOpponents[1]);
}
if (_root.NumberOfOpponents > 2) {
MakeAPlayer(2, 1, _root.TheBuyIn, _root.NamesOfOpponents[2]);
}
if (_root.NumberOfOpponents > 3) {
MakeAPlayer(5, 4, _root.TheBuyIn, _root.NamesOfOpponents[3]);
}
this.WhoseDeal = parseInt(Math.random() * this.HowManyPlayers + 0.5);
this.WhoseDeal = Math.max(1, Math.min(this.HowManyPlayers, this.WhoseDeal));
this.HandsPlayed = 0;
_root.YouLost = false;
this.GotYourBet = false;
this.GameStatus = 'new hand';
_root.OldYouBalloon.duplicateMovieClip('YouBalloon', 30, _root.OldYouBalloon);
}
if (WeAre('new hand')) {
_root.DeckEngine.ShuffleCards();
_root.PotAmount = 0;
_root.BettingInProgress = false;
_root.BettingRound.AmountInHand = new Array(0, 0, 0, 0, 0, 0);
_root.BettingRound.AmountAllIn = new Array(0, 0, 0, 0, 0, 0);
_root.BettingRound.AmountInRound = new Array(0, 0, 0, 0, 0, 0);
_root.BettingRound.MustAllIn = false;
this.FoldedPlayers = 0;
DealingOrder = new Array();
WhoseDeal = PlayerLeftOf(WhoseDeal);
DealerChipGoes = (eval('_root.Player' + WhoseDeal.toString())).Gdchip();
_root.Dchip.MoveDchip(DealerChipGoes[0], DealerChipGoes[1]);
ThingToSay = 'New hand. ' + ((WhoseDeal == 1) ? 'You are' : (eval('_root.Player' + WhoseDeal.toString())).Gname() + ' is') + ' the dealer...';
_root.SpeechEngine.Announce(ThingToSay, 10, 12);
this.GotYourBet = false;
this.GameStatus = 'hello dealer';
_root.MusicEngine.Swell('up');
}
if (WeAre('hello dealer')) {
_root.SpeechEngine.DoCommercial('Play');
this.GameStatus = 'promo message';
}
if (WeAre('promo message')) {
pA = WhoseDeal;
gg = 1;
while (gg <= HowManyPlayers) {
pA = PlayerLeftOf(pA);
DealingOrder.push(pA);
++gg;
}
PlayingCounter = 0;
_root.SpeechEngine.Announce('Everyone ante ' + _root.DollarString(_root.TheAnte), 12, 0);
this.GameStatus = 'anteing';
}
if (WeAre('anteing')) {
Pnumber = DealingOrder[PlayingCounter];
PlayerPayPot(Pnumber, _root.TheAnte, 'Ante');
_root.BettingRound.AmountInHand[Pnumber] += _root.TheAnte;
++PlayingCounter;
if (PlayingCounter >= DealingOrder.length) {
FloppingOrder = DealingOrder.concat(DealingOrder);
PlayingCounter = 0;
this.GameStatus = 'dealing preflop';
}
}
if (WeAre('dealing preflop')) {
Pnumber = FloppingOrder[PlayingCounter];
Uppitude = (Pnumber == 1) ? 'up' : 'down';
Sloppitude = (Pnumber == 1) ? 6 : 10;
DealToPlayer(eval('_root.Player' + Pnumber.toString()), Uppitude, Sloppitude);
++PlayingCounter;
if (PlayingCounter >= FloppingOrder.length) {
for (pp in ActivePlayers) {
if (ActivePlayers[pp] > 0) {
PlayerHand = (eval('_root.Player' + ActivePlayers[pp].toString())).Ghand();
TheAssessment = _root.AssessPreflop(PlayerHand);
(eval('_root.Player' + ActivePlayers[pp].toString())).Sworth(TheAssessment);
}
}
PlayingCounter = 0;
_root.BettingRound.NewRound(DealingOrder);
BettingInProgress = true;
SmallBlindPosted = false;
BigBlindPosted = false;
PosterCheck = true;
this.GotYourBet = false;
this.GameStatus = 'preflop round';
_root.MusicEngine.Swell('down');
}
}
if (WeAre('preflop round')) {
Pnumber = DealingOrder[PlayingCounter];
MyPlayer = eval('_root.Player' + Pnumber.toString());
if (!_root.BettingRound.CanOpen && _root.BettingRound.AmountToCall(Pnumber) <= 0) {
if (PosterCheck && PlayingCounter == 1 && _root.BettingRound.HighestBet == _root.TheBigBlind) {
BettingInProgress = true;
PosterCheck = false;
} else {
BettingInProgress = false;
}
}
if (BettingInProgress || this.GotYourBet) {
if (!SmallBlindPosted) {
BetDecision = new Array('Post', _root.TheSmallBlind);
PlayerMakeBet(Pnumber, BetDecision[0], BetDecision[1]);
SmallBlindPosted = true;
} else {
if (!BigBlindPosted) {
BetDecision = new Array('Post', _root.TheBigBlind);
PlayerMakeBet(Pnumber, BetDecision[0], BetDecision[1]);
BigBlindPosted = true;
} else {
if (!MyPlayer.IsFolded() && _root.BettingRound.AmountAllIn[Pnumber] <= 0) {
if (Pnumber == 1) {
if (this.GotYourBet) {
if (this.YourDecision[0] == 'Raise') {
BettingInProgress = true;
}
if (this.YourDecision[0] == 'All In' && !_root.BettingRound.MustAllIn) {
BettingInProgress = true;
}
PlayerMakeBet(1, this.YourDecision[0], this.YourDecision[1]);
if (this.YourDecision[0] == 'Fold') {
_root.MusicEngine.Swell('up');
FoldPlayer(1);
}
this.GotYourBet = false;
} else {
_root.Info1.WriteBig('');
this.YourDecision = _root.BettingRound.BetDecide(1);
YourChoices = _root.BettingRound.BetChoices(1);
_root.YouBalloon.ShowChoices(YourChoices);
_root.needInput = true;
}
} else {
BetDecision = _root.BettingRound.BetDecide(Pnumber);
PlayerMakeBet(Pnumber, BetDecision[0], BetDecision[1]);
if (BetDecision[0] == 'Fold') {
FoldPlayer(Pnumber);
}
}
}
}
}
}
if (this.FoldedPlayers >= this.HowManyPlayers - 1) {
this.GameStatus = 'resolving';
}
if (!_root.needInput) {
++PlayingCounter;
}
if (PlayingCounter >= DealingOrder.length) {
if (BettingInProgress && _root.BettingRound.HighestBet > 0) {
PlayingCounter = 0;
} else {
BettingInProgress = false;
}
}
if (!BettingInProgress && this.GameStatus != 'resolving' && NotWaiting()) {
PlayingCounter = 0;
FlopCounter = 0;
_root.SpeechEngine.Announce('Dealing the flop...', 12, 6);
_root.MusicEngine.Swell('up');
this.GameStatus = 'dealing flop';
}
}
if (WeAre('dealing flop')) {
++FlopCounter;
if (FlopCounter <= 3) {
DealToPlayer(_root.GameBoard, 'up', 0);
} else {
BoardHand = _root.GameBoard.Ghand();
TheAssessment = _root.AssessFlop(BoardHand);
_root.GameBoard.Sworth(TheAssessment);
for (pp in DealingOrder) {
PlayerHand = (eval('_root.Player' + DealingOrder[pp].toString())).Ghand();
PlayerHand = PlayerHand.concat(BoardHand);
TheAssessment = _root.AssessFlop(PlayerHand);
(eval('_root.Player' + DealingOrder[pp].toString())).Sworth(TheAssessment);
}
PlayingCounter = 0;
_root.BettingRound.NewRound(DealingOrder);
BettingInProgress = true;
this.GotYourBet = false;
this.GameStatus = 'flop round';
if (!_root.Player1.IsFolded()) {
_root.MusicEngine.Swell('down');
}
}
}
if (WeAre('flop round')) {
Pnumber = DealingOrder[PlayingCounter];
MyPlayer = eval('_root.Player' + Pnumber.toString());
if (!_root.BettingRound.CanOpen && _root.BettingRound.AmountToCall(Pnumber) <= 0) {
BettingInProgress = false;
}
if (BettingInProgress) {
if (!MyPlayer.IsFolded() && _root.BettingRound.AmountAllIn[Pnumber] <= 0) {
if (Pnumber == 1) {
if (this.GotYourBet) {
PlayerMakeBet(1, this.YourDecision[0], this.YourDecision[1]);
if (this.YourDecision[0] == 'Fold') {
_root.MusicEngine.Swell('up');
FoldPlayer(1);
}
this.GotYourBet = false;
} else {
_root.Info1.WriteBig('');
this.YourDecision = _root.BettingRound.BetDecide(1);
YourChoices = _root.BettingRound.BetChoices(1);
_root.YouBalloon.ShowChoices(YourChoices);
_root.needInput = true;
}
} else {
BetDecision = _root.BettingRound.BetDecide(Pnumber);
PlayerMakeBet(Pnumber, BetDecision[0], BetDecision[1]);
if (BetDecision[0] == 'Fold') {
FoldPlayer(Pnumber);
}
}
}
}
if (this.FoldedPlayers >= this.HowManyPlayers - 1) {
this.GameStatus = 'resolving';
}
if (!_root.needInput) {
++PlayingCounter;
}
if (PlayingCounter >= DealingOrder.length) {
if (BettingInProgress && _root.BettingRound.HighestBet > 0) {
PlayingCounter = 0;
} else {
BettingInProgress = false;
}
}
if (!BettingInProgress && this.GameStatus != 'resolving' && NotWaiting()) {
PlayingCounter = 0;
_root.SpeechEngine.Announce('Dealing the turn...', 12, 6);
_root.MusicEngine.Swell('up');
this.GameStatus = 'dealing turn';
}
}
if (WeAre('dealing turn')) {
DealToPlayer(_root.GameBoard, 'up', 0);
BoardHand = _root.GameBoard.Ghand();
TheAssessment = _root.AssessFlop(BoardHand);
_root.GameBoard.Sworth(TheAssessment);
for (pp in DealingOrder) {
PlayerHand = (eval('_root.Player' + DealingOrder[pp].toString())).Ghand();
PlayerHand = PlayerHand.concat(BoardHand);
TheAssessment = _root.AssessFlop(PlayerHand);
(eval('_root.Player' + DealingOrder[pp].toString())).Sworth(TheAssessment);
}
PlayingCounter = 0;
_root.BettingRound.NewRound(DealingOrder);
BettingInProgress = true;
this.GotYourBet = false;
this.GameStatus = 'turn round';
if (!_root.Player1.IsFolded()) {
_root.MusicEngine.Swell('down');
}
}
if (WeAre('turn round')) {
Pnumber = DealingOrder[PlayingCounter];
MyPlayer = eval('_root.Player' + Pnumber.toString());
if (!_root.BettingRound.CanOpen && _root.BettingRound.AmountToCall(Pnumber) <= 0) {
BettingInProgress = false;
}
if (BettingInProgress) {
if (!MyPlayer.IsFolded() && _root.BettingRound.AmountAllIn[Pnumber] <= 0) {
if (Pnumber == 1) {
if (this.GotYourBet) {
PlayerMakeBet(1, this.YourDecision[0], this.YourDecision[1]);
if (this.YourDecision[0] == 'Fold') {
_root.MusicEngine.Swell('up');
FoldPlayer(1);
}
this.GotYourBet = false;
} else {
_root.Info1.WriteBig('');
this.YourDecision = _root.BettingRound.BetDecide(1);
YourChoices = _root.BettingRound.BetChoices(1);
_root.YouBalloon.ShowChoices(YourChoices);
_root.needInput = true;
}
} else {
BetDecision = _root.BettingRound.BetDecide(Pnumber);
PlayerMakeBet(Pnumber, BetDecision[0], BetDecision[1]);
if (BetDecision[0] == 'Fold') {
FoldPlayer(Pnumber);
}
}
}
}
if (this.FoldedPlayers >= this.HowManyPlayers - 1) {
this.GameStatus = 'resolving';
}
if (!_root.needInput) {
++PlayingCounter;
}
if (PlayingCounter >= DealingOrder.length) {
if (BettingInProgress && _root.BettingRound.HighestBet > 0) {
PlayingCounter = 0;
} else {
BettingInProgress = false;
}
}
if (!BettingInProgress && this.GameStatus != 'resolving' && NotWaiting()) {
PlayingCounter = 0;
_root.SpeechEngine.Announce('Dealing the river...', 12, 6);
_root.MusicEngine.Swell('up');
this.GameStatus = 'dealing river';
}
}
if (WeAre('dealing river')) {
DealToPlayer(_root.GameBoard, 'up', 0);
BoardHand = _root.GameBoard.Ghand();
TheAssessment = _root.AssessFlop(BoardHand);
_root.GameBoard.Sworth(TheAssessment);
for (pp in DealingOrder) {
PlayerHand = ((eval('_root.Player' + DealingOrder[pp].toString())).Ghand()).concat(BoardHand);
TheAssessment = _root.AssessRiver(PlayerHand);
(eval('_root.Player' + DealingOrder[pp].toString())).Sworth(TheAssessment);
}
PlayingCounter = 0;
_root.BettingRound.NewRound(DealingOrder);
BettingInProgress = true;
this.GotYourBet = false;
this.GameStatus = 'river round';
if (!_root.Player1.IsFolded()) {
_root.MusicEngine.Swell('down');
}
}
if (WeAre('river round')) {
Pnumber = DealingOrder[PlayingCounter];
MyPlayer = eval('_root.Player' + Pnumber.toString());
if (!_root.BettingRound.CanOpen && _root.BettingRound.AmountToCall(Pnumber) <= 0) {
BettingInProgress = false;
}
if (BettingInProgress) {
if (!MyPlayer.IsFolded() && _root.BettingRound.AmountAllIn[Pnumber] <= 0) {
if (Pnumber == 1) {
if (this.GotYourBet) {
PlayerMakeBet(1, this.YourDecision[0], this.YourDecision[1]);
if (this.YourDecision[0] == 'Fold') {
_root.MusicEngine.Swell('up');
FoldPlayer(1);
}
this.GotYourBet = false;
} else {
_root.Info1.WriteBig('');
this.YourDecision = _root.BettingRound.BetDecide(1);
YourChoices = _root.BettingRound.BetChoices(1);
_root.YouBalloon.ShowChoices(YourChoices);
_root.needInput = true;
}
} else {
BetDecision = _root.BettingRound.BetDecide(Pnumber);
PlayerMakeBet(Pnumber, BetDecision[0], BetDecision[1]);
if (BetDecision[0] == 'Fold') {
FoldPlayer(Pnumber);
}
}
}
}
if (this.FoldedPlayers >= this.HowManyPlayers - 1) {
PlayingCounter = 0;
this.GameStatus = 'resolving';
}
if (!_root.needInput) {
++PlayingCounter;
}
if (PlayingCounter >= DealingOrder.length) {
if (BettingInProgress && _root.BettingRound.HighestBet > 0) {
PlayingCounter = 0;
} else {
BettingInProgress = false;
}
}
if (!BettingInProgress && this.GameStatus != 'resolving' && NotWaiting()) {
PlayingCounter = 0;
_root.BettingRound.NewRound(DealingOrder);
_root.SpeechEngine.Announce('Showdown...', 6, 12);
if (!_root.BettingRound.MustAllIn && _root.MusicIsOn) {
_root.MusicEngine.CutIn('Fanfare');
}
_root.MusicEngine.Swell('up');
this.GameStatus = 'showdown';
}
}
if (WeAre('showdown')) {
Pnumber = DealingOrder[PlayingCounter];
HilitePlayerCards(MyPlayer, 0);
MyPlayer = eval('_root.Player' + Pnumber.toString());
if (!MyPlayer.IsFolded()) {
MyHand = MyPlayer.Ghand();
_root.DeckEngine.TurnUpCard(MyHand[0]);
_root.DeckEngine.TurnUpCard(MyHand[1]);
if (Pnumber == 1) {
_root.Deal1Sound.start();
}
MyWorth = MyPlayer.Gworth();
HilitePlayerCards(MyPlayer, 1);
ThingToSay = ((Pnumber == 1) ? 'You have' : MyPlayer.Gname() + ' has') + ': ';
ThingToSay += MyWorth[1] + ((MyWorth[2] == '') ? '' : ', ' + MyWorth[2]) + '.';
_root.SpeechEngine.Announce(ThingToSay, 22, 24);
_root.SpeechEngine.PlayerSez(Pnumber, MyWorth[1] + '.', 12);
(eval('_root.Info' + Pnumber.toString())).WriteBig(MyWorth[1]);
(eval('_root.Info' + Pnumber.toString())).WriteLittle(MyWorth[2]);
}
++PlayingCounter;
if (PlayingCounter >= DealingOrder.length) {
PlayingCounter = 0;
this.GameStatus = 'resolving';
}
}
if (WeAre('resolving')) {
_root.MusicEngine.Swell('up');
HilitePlayerCards(MyPlayer, 0);
HandPots = new Array();
WinningPlayers = FindWinnersAmong(DealingOrder);
if (_root.BettingRound.MustAllIn) {
ShowdownArray = new Array();
SortedArray = new Array();
for (pp in DealingOrder) {
Pnumber = DealingOrder[pp];
MyPlayer = eval('_root.Player' + Pnumber.toString());
Pai = _root.BettingRound.AmountAllIn[Pnumber];
if (!MyPlayer.IsFolded()) {
SortedArray.push(_root.BettingRound.AmountAllIn[Pnumber]);
ShowdownArray.push({'Player': Pnumber, 'Worth': MyPlayer.Gworth(), 'AmtInHand': _root.BettingRound.AmountAllIn[Pnumber]});
}
}
SortedArray.sort(_root.OrderInt);
NumberToBeat = 0;
LeftoverMoney = _root.PotAmount;
PlayersCompeting = SortedArray.length;
ai = 0;
while (ai < SortedArray.length) {
if (SortedArray[ai] > NumberToBeat) {
AmountInThisPot = (SortedArray[ai] - NumberToBeat) * PlayersCompeting;
LeftoverMoney -= AmountInThisPot;
NumberToBeat = SortedArray[ai];
PlayersInThisPot = new Array();
for (pp in ShowdownArray) {
if (ShowdownArray[pp].AmtInHand >= SortedArray[ai]) {
PlayersInThisPot.push(ShowdownArray[pp].Player);
}
}
HandPots.push({'Amount': AmountInThisPot, 'Winners': FindWinnersAmong(PlayersInThisPot)});
}
--PlayersCompeting;
++ai;
}
HandPots[0].Amount += LeftoverMoney;
} else {
HandPots.push({'Amount': _root.PotAmount, 'Winners': WinningPlayers});
}
wNames = new Array();
for (pp in WinningPlayers) {
wPlayer = eval('_root.Player' + WinningPlayers[pp].toString());
wNames.push(wPlayer.Gname());
if (this.FoldedPlayers < this.HowManyPlayers - 1) {
HilitePlayerCards(wPlayer, 1);
}
(eval('_root.Info' + WinningPlayers[pp].toString())).ShowWinner(true);
}
ThingToSay = wNames.join(' and ');
ThingToSay += wNames.length > 1 ? ' split the pot.' : ((ThingToSay == 'You') ? ' win the hand.' : ' wins the hand.');
_root.SpeechEngine.Announce(ThingToSay, 22, 60);
_root.PotAmount = 0;
_root.PotTally.UpdatePot(_root.PotAmount);
Payouts = new Array(0, 0, 0, 0, 0, 0);
for (xx in HandPots) {
Payees = HandPots[xx].Winners;
for (yy in Payees) {
Payouts[Payees[yy]] += HandPots[xx].Amount / Payees.length;
}
}
Payees = new Array();
for (zz in Payouts) {
if (Payouts[zz] > 0) {
wPlayer = eval('_root.Player' + zz.toString());
toPay = Math.round(Payouts[zz]);
NewBank = wPlayer.ToBank(toPay);
(eval('_root.Info' + zz.toString())).WriteBank(NewBank);
Payees.push(zz.toString());
}
}
_root.ChipEngine.ChipsToPlayers(Payees);
PlayingCounter = 0;
this.GameStatus = 'raking';
}
if (WeAre('raking')) {
_root.ChipEngine.ClearChips();
this.GameStatus = 'gathering';
}
if (WeAre('gathering')) {
for (pp in DealingOrder) {
(eval('_root.Player' + DealingOrder[pp].toString())).ClearHand();
(eval('_root.Player' + DealingOrder[pp].toString())).Fold(false);
(eval('_root.Info' + DealingOrder[pp].toString())).Brightness(1);
(eval('_root.Info' + DealingOrder[pp].toString())).ShowWinner(false);
(eval('_root.Info' + DealingOrder[pp].toString())).WriteBig('');
(eval('_root.Info' + DealingOrder[pp].toString())).WriteLittle('');
}
_root.GameBoard.ClearHand();
_root.DeckEngine.GatherCards(_root.DeckThing._x - _root.GameCard._x, _root.DeckThing._y - _root.GameCard._y, 30, 1);
this.GameStatus = 'jogging';
}
if (WeAre('jogging')) {
_root.DeckEngine.ShuffleCards('silently');
PlayingCounter = 0;
MarkedForDeath = 0;
KilledAGuy = false;
ImDying = _root.Player1.Gbank() < _root.TheBigBet;
if (ImDying) {
_root.Playlist = new Array('BlatLoopC', 'ToughLuck');
_root.MusicEngine.CutIn('BlatLoopA', 'BlatLoopB');
}
this.GameStatus = 'eliminating';
}
if (WeAre('eliminating')) {
if (MarkedForDeath > 0) {
if (this.WhoseDeal == MarkedForDeath) {
this.WhoseDeal = PlayerLeftOf(MarkedForDeath, 'right');
}
KillPlayer(MarkedForDeath);
MarkedForDeath = 0;
}
Pnumber = DealingOrder[PlayingCounter];
if (PlayingCounter < DealingOrder.length) {
MyPlayer = eval('_root.Player' + Pnumber.toString());
if (MyPlayer.Gbank() < _root.TheBigBet) {
if (!ImDying && !KilledAGuy && _root.MusicIsOn) {
_root.MusicEngine.CutIn('BlatLoopA');
}
KilledAGuy = true;
_root.SpeechEngine.PlayerSez(Pnumber, 'Goodbye.', 32);
MarkedForDeath = Pnumber;
if (Pnumber == 1) {
_root.YouLost = true;
}
}
}
++PlayingCounter;
if (PlayingCounter > DealingOrder.length) {
++this.HandsPlayed;
if (this.HowManyPlayers <= 1 || _root.YouLost) {
_root.Dchip.MoveDchip(300, -30);
_root.SpeechEngine.Announce('Game Over', 24, 24);
_root.WeCanPlay = false;
this.GameStatus = 'game over';
if (!_root.YouLost) {
_root.Playlist = new Array();
_root.MusicEngine.CutIn('HailVictor');
}
} else {
if (this.HandsPlayed / 5 == parseInt(this.HandsPlayed / 5)) {
SetBetLimits(parseInt(this.HandsPlayed / 5));
if (this.HandsPlayed / 5 > 1) {
_root.SpeechEngine.Announce('The minimum bets\rhave been raised.', 28, 30);
}
}
PlayingCounter = 0;
this.GameStatus = 'new hand';
}
}
}
}
}
instance MusicEngine of movieClip 350 {
onClipEvent (load) {
function TurnMusicOff() {
_root.Orchestra.stop();
_root.Orchestra.attachSound('chip.aiff');
_root.Orchestra.onSoundComplete = function () {};
_root.Orchestra.stop();
_root.MusicIsOn = false;
_root.MusicOffButton._visible = false;
_root.MusicOnButton._visible = true;
}
function TurnMusicOn() {
_root.MusicIsOn = true;
_root.PlayNextLoop();
_root.MusicOnButton._visible = false;
_root.MusicOffButton._visible = true;
}
function CutIn(Atune, Btune, Ctune) {
if (_root.MusicIsOn) {
if (Ctune != undefined) {
_root.Playlist.unshift(Ctune);
}
if (Btune != undefined) {
_root.Playlist.unshift(Btune);
}
_root.Playlist.unshift(Atune);
_root.Orchestra.stop();
_root.PlayNextLoop();
}
}
function Swell(dir) {
this.Swelling = dir;
}
_root.MusicOffButton._visible = _root.MusicIsOn;
_root.MusicOnButton._visible = !_root.MusicIsOn;
this._visible = false;
_root.Orchestra.setVolume(100);
mm = 0;
while (mm < 200) {
_root.Playlist.push('HappyLoop', 'HappyLoop', 'HappyLoop');
++mm;
}
this.Swelling = false;
this.MinVolume = 52;
this.StepVolume = 2;
}
onClipEvent (enterFrame) {
if (this.Swelling == 'up' && _root.MusicIsOn) {
if (_root.Orchestra.getVolume() < 100) {
_root.Orchestra.setVolume(_root.Orchestra.getVolume() + this.StepVolume * 2);
} else {
this.Swelling == false;
}
}
if (this.Swelling == 'down' && _root.MusicIsOn) {
if (_root.Orchestra.getVolume() > this.MinVolume) {
_root.Orchestra.setVolume(_root.Orchestra.getVolume() - this.StepVolume);
} else {
this.Swelling == false;
}
}
}
}
frame 419 {
gotoAndPlay(304);
}
instance MusicEngine of movieClip 350 {
onClipEvent (load) {
function TurnMusicOff() {
_root.Orchestra.setVolume(0);
_root.MusicIsOn = false;
_root.MusicOffButton._visible = false;
_root.MusicOnButton._visible = true;
}
function TurnMusicOn() {
_root.Orchestra.setVolume(100);
_root.MusicIsOn = true;
_root.MusicOnButton._visible = false;
_root.MusicOffButton._visible = true;
}
_root.Orchestra.setVolume(_root.MusicIsOn ? 100 : 0);
_root.MusicOffButton._visible = _root.MusicIsOn;
_root.MusicOnButton._visible = !_root.MusicIsOn;
this._visible = false;
ItsTheLastLoop = false;
}
onClipEvent (enterFrame) {
if (!ItsTheLastLoop && _root.Orchestra.duration < 5000) {
ItsTheLastLoop = true;
_root.Orchestra.onSoundComplete = function () {
_root.gotoAndPlay('Menu');
};
}
}
}
movieClip 887 {
}
movieClip 889 {
}
movieClip 890 {
}
frame 493 {
stop();
}
instance MusicEngine of movieClip 350 {
onClipEvent (load) {
function TurnMusicOff() {
_root.Orchestra.setVolume(0);
_root.MusicIsOn = false;
_root.MusicOffButton._visible = false;
_root.MusicOnButton._visible = true;
}
function TurnMusicOn() {
_root.Orchestra.setVolume(100);
_root.MusicIsOn = true;
_root.MusicOnButton._visible = false;
_root.MusicOffButton._visible = true;
}
_root.Orchestra.setVolume(_root.MusicIsOn ? 100 : 0);
_root.Orchestra.onSoundComplete = function () {
_root.gotoAndPlay('Menu');
};
_root.MusicOffButton._visible = _root.MusicIsOn;
_root.MusicOnButton._visible = !_root.MusicIsOn;
this._visible = false;
}
}
movieClip 892 {
}
movieClip 895 {
}
movieClip 899 {
}
movieClip 903 {
}
movieClip 904 {
}
movieClip 907 {
}
movieClip 910 {
}
movieClip 911 {
}
movieClip 912 {
}
movieClip 913 {
}
movieClip 915 {
}
movieClip 916 {
}
frame 665 {
stop();
}
frame 675 {
stop();
}