Frame 1
total_bytesstart = _root.getBytesTotal();
loaded_bytesstart = _root.getBytesLoaded();
percent_doneone = int((loaded_bytesstart / total_bytesstart) * 100);
bartwo.innerbar._xscale = percent_doneone;
if (_framesloaded == _totalframes) {
_root.gotoAndPlay("start");
}
Frame 2
gotoAndPlay (1);
Frame 4
gotoAndPlay (166);
Frame 166
stop();
Frame 182
stop();
Frame 199
stop();
var chosenPlayer1 = 0;
var chosenPlayer2 = 0;
chosenPlayer2 = 2;
Frame 219
if (typeof(_global.AsSetupPackage) == "undefined") {
_global.AsSetupPackage = function (path) {
var _local5 = path.split(".");
var _local3 = _global;
var _local4 = 0;
while (_local4 < _local5.length) {
var _local2 = _local5[_local4];
if (_local3[_local2] == undefined) {
_local3[_local2] = new Object();
}
_local3 = _local3[_local2];
_local4++;
}
};
}
if (typeof(_global.AsDependencyCheck) == "undefined") {
_global.AsDependencyCheck = function (path, caller) {
if (typeof(eval ("_global." + path)) == "undefined") {
trace((((" " + caller) + ": WARNING! '") + path) + "' has not been previously defined");
} else {
trace((((" " + caller) + ": OK! '") + path) + "' has been defined");
}
};
} else {
trace("AsDependencyCheck been previously defined");
}
AsSetupPackage("org.hsieh.lang");
AsDependencyCheck("AsSetupPackage", "org.hsieh.lang.Assertion");
org.hsieh.lang.Assertion = function () {
};
org.hsieh.lang.Assertion.Assert = function (args) {
if (arguments.length == 2) {
org.hsieh.lang.Assertion.AssertTrue(arguments[0], arguments[1]);
} else {
org.hsieh.lang.Assertion.AssertTrue(arguments[0]);
}
};
org.hsieh.lang.Assertion.AssertTrue = function (args) {
if (arguments.length == 2) {
var _local2 = arguments[0];
var _local3 = arguments[1];
} else {
var _local2 = "";
var _local3 = arguments[0];
}
if (_local3 == false) {
org.hsieh.lang.Assertion.Fail("Expected True " + _local2);
}
};
org.hsieh.lang.Assertion.AssertNull = function (args) {
if (arguments.length == 2) {
var _local2 = arguments[0];
var _local3 = arguments[1];
} else {
var _local2 = "";
var _local3 = arguments[0];
}
if (_local3 != null) {
org.hsieh.lang.Assertion.Fail("Expected Null " + _local2);
}
};
org.hsieh.lang.Assertion.AssertNotNull = function (args) {
if (arguments.length == 2) {
var _local2 = arguments[0];
var _local3 = arguments[1];
} else {
var _local2 = "";
var _local3 = arguments[0];
}
if (_local3 == null) {
org.hsieh.lang.Assertion.Fail("Expected Not Null " + _local2);
}
};
org.hsieh.lang.Assertion.AssertEquals = function (args) {
if (arguments.length == 3) {
var _local5 = arguments[0];
var _local2 = arguments[1];
var _local3 = arguments[2];
} else {
var _local5 = "";
var _local2 = arguments[0];
var _local3 = arguments[1];
}
var _local4 = false;
if (_local2.Equals != null) {
_local4 = _local2.Equals(_local3);
} else {
_local4 = _local2 == _local3;
}
if (_local4 == false) {
org.hsieh.lang.Assertion.FailNotEquals(_local5, _local2, _local3);
}
};
org.hsieh.lang.Assertion.AssertSame = function (args) {
if (arguments.length == 3) {
var _local4 = arguments[0];
var _local2 = arguments[1];
var _local3 = arguments[2];
} else {
var _local4 = "";
var _local2 = arguments[0];
var _local3 = arguments[1];
}
if (((typeof(_local2) == "number") || (typeof(_local2) == "string")) || (typeof(_local2) == "boolean")) {
org.hsieh.lang.Assertion.FailNotSame(_local4 + " <not reference objects>", _local2, _local3);
} else if (_local2 != _local3) {
org.hsieh.lang.Assertion.FailNotSame(_local4, _local2, _local3);
}
};
org.hsieh.lang.Assertion.Fail = function (message) {
trace(message);
};
org.hsieh.lang.Assertion.FailNotEquals = function (message, expected, actual) {
org.hsieh.lang.Assertion.Fail(((((message + "\n -expected:\t<") + expected) + "> \n -actual:\t<") + actual) + ">");
};
org.hsieh.lang.Assertion.FailNotSame = function (message, expected, actual) {
org.hsieh.lang.Assertion.Fail(message + " expected same");
};
_global.Assert = org.hsieh.lang.Assertion.Assert;
_global.AssertSame = org.hsieh.lang.Assertion.AssertSame;
_global.AssertEquals = org.hsieh.lang.Assertion.AssertEquals;
_global.AssertNotNull = org.hsieh.lang.Assertion.AssertNotNull;
_global.AssertNull = org.hsieh.lang.Assertion.AssertNull;
_global.AssertTrue = org.hsieh.lang.Assertion.AssertTrue;
AsSetupPackage("org.hsieh.util");
AsDependencyCheck("AsSetupPackage", "org.hsieh.util.Collection");
org.hsieh.util.Collection = function () {
this.aCollection = new Array();
this.iteratorIndex = 0;
};
org.hsieh.util.Collection.prototype.append = function (value) {
this.aCollection.push(value);
};
org.hsieh.util.Collection.prototype.remove = function (whichOne) {
if ((whichOne <= 0) && (whichOne < this.aCollection.length)) {
}
return(this.aCollection.splice(whichOne, 1));
};
org.hsieh.util.Collection.prototype.empty = function () {
aOther = this.aCollection.slice(0, aCollection.length);
this.aCollection.length = 0;
return(aOther);
};
org.hsieh.util.Collection.prototype.iteratorReset = function () {
this.iteratorIndex = 0;
};
org.hsieh.util.Collection.prototype.iteratorNext = function () {
var _local2 = null;
if (this.iteratorIndex < this.aCollection.length) {
}
_local2 = this.aCollection[this.iteratorIndex];
this.iteratorIndex++;
return(_local2);
};
org.hsieh.util.Collection.prototype.shuffle = function () {
var _local2 = this.aCollection.length - 1;
var _local4 = 0;
var _local3 = 0;
while (_local2 >= 0) {
_local3 = Math.floor(Math.random() * this.aCollection.length);
_local4 = this.aCollection[_local2];
this.aCollection[_local2] = this.aCollection[_local3];
this.aCollection[_local3] = _local4;
_local2--;
}
};
org.hsieh.util.Collection.prototype.merge = function (aMerge) {
var _local2 = aMerge.length;
while (_local2 > 0) {
this.aCollection.push(aMerge.shift());
_local2--;
}
};
trace("Done with Collection.as");
AsSetupPackage("org.hsieh.blackjack");
AsDependencyCheck("AsSetupPackage", "org.hsieh.blackjack.BlackJack");
AsDependencyCheck("org.hsieh.util.Collection", "org.hsieh.blackjack.BlackJack");
org.hsieh.blackJack.BlackJack = function (aPlayerChoice, dealer_mc, aCurtain_mc, indicator_mc, aFloorWin_mc, deckCount) {
this.playerCount = aPlayerChoice.length;
this.dealer_mc = dealer_mc;
this.aCurtain_mc = aCurtain_mc;
this.indicator_mc = indicator_mc;
this.aFloorWin_mc = aFloorWin_mc;
this.deckCount = deckCount;
aComputerSelectPool = new Array(1, 2, 3);
aComputerSelectPool.splice(aPlayerChoice[0] - 1, 1);
this.aPlayer = new Array();
var _local2 = 1;
while (_local2 <= this.PlayerCount) {
if (_local2 != this.PlayerCount) {
this.aPlayer[_local2] = new org.hsieh.blackjack.Player(_local2, aPlayerChoice.shift(), false);
} else {
this.aPlayer[_local2] = new org.hsieh.blackjack.Player(_local2, aComputerSelectPool[Math.floor(Math.random() * 2)], true);
}
_local2++;
}
this.shoe = new org.hsieh.util.Collection();
var _local3 = 0;
while (_local3 < deckCount) {
_local2 = 1;
while (_local2 <= 52) {
this.shoe.append(_local2);
_local2++;
}
_local3++;
}
this.shoe.shuffle();
this.discardPile = new org.hsieh.util.Collection();
this.currentPlayerIndex = 0;
this.currentPlayerAction = 0;
this.dealerState = this.STATE_OPENING_DEAL;
this.currentState = this.preMainLoop;
};
org.hsieh.blackjack.Blackjack.CARD_BACKFACE_FRAME = 53;
org.hsieh.blackjack.Blackjack.CARD_LAYOUT_MAX_COUNT = 11;
org.hsieh.blackjack.Blackjack.STATE_OPENING_DEAL = 1;
org.hsieh.blackjack.Blackjack.STATE_WAITING = 2;
org.hsieh.blackjack.Blackjack.STATE_DEALING = 3;
org.hsieh.blackjack.Blackjack.STATE_WAITING = 4;
org.hsieh.blackjack.Blackjack.STATE_WAITING = 5;
org.hsieh.blackjack.Blackjack.STATE_WAITING = 6;
org.hsieh.blackjack.Blackjack.ACTION_HIT = 1;
org.hsieh.blackjack.Blackjack.ACTION_STAND = 2;
org.hsieh.blackJack.BlackJack.getCardValue = function (card) {
if (card < 0) {
card = card * -1;
}
var _local1 = card % 13;
if ((_local1 == 0) || (_local1 >= 11)) {
_local1 = 10;
} else if (_local1 == 1) {
_local1 = 11;
}
return(_local1);
};
org.hsieh.blackJack.BlackJack.getHandValue = function (hand) {
var _local4 = 0;
var _local3 = 0;
var _local1 = 0;
var _local2 = 0;
if (hand instanceof org.hsieh.util.Collection) {
hand.iteratorReset();
while (_local4 = hand.iteratorNext() , _local4 != null) {
_local3 = org.hsieh.blackJack.BlackJack.getCardValue(_local4);
if (_local3 == 11) {
_local2++;
}
_local1 = _local1 + _local3;
}
while ((_local1 > 21) && (_local2 > 0)) {
_local1 = _local1 - 10;
_local2--;
}
return(_local1);
}
return(null);
};
org.hsieh.blackJack.BlackJack.prototype.playerHit = function () {
if (!this.dealer_mc.isAnimating) {
if (this.shoe.aCollection.length == 0) {
this.shoe.merge(this.discardPile.empty());
this.shoe.shuffle();
}
this.dealer_mc.dealCardCounter = 1;
this.dealer_mc.gotoAndPlay("deal");
this.currentPlayerAction = org.hsieh.blackjack.Blackjack.ACTION_HIT;
}
};
org.hsieh.blackJack.BlackJack.prototype.playerStand = function () {
this.currentPlayerAction = org.hsieh.blackjack.Blackjack.ACTION_STAND;
if ((++this.currentPlayerIndex) < this.playerCount) {
this.currentState = this.preMainloop;
} else {
this.currentState = this.preEndRoundLoop;
}
};
org.hsieh.blackJack.BlackJack.prototype.checkCurtain = function () {
var _local2 = null;
var _local3 = 0;
while (_local3 < this.playerCount) {
if (this.aCurtain_mc[_local3].isAnimating && (this.aCurtain_mc[_local3].isCovered)) {
_local2 = this.aPlayer[_local3 + 1];
if (_local2.testGameState(org.hsieh.blackjack.Player.GAMESTATE_WIN)) {
_local2.dress();
_local2.setGameState(org.hsieh.blackjack.Player.GAMESTATE_PAID);
} else if (_local2.testGameState(org.hsieh.blackjack.Player.GAMESTATE_LOSE)) {
_local2.undress();
_local2.setGameState(org.hsieh.blackjack.Player.GAMESTATE_PAID);
}
this.aCurtain_mc[_local3].isCovered = false;
}
_local3++;
}
};
org.hsieh.blackJack.BlackJack.prototype.preDealOpenLoop = function () {
this.currentPlayerIndex = 0;
var _local2 = 0;
while (_local2 < this.playerCount) {
this.discardPile.merge(this.aPlayer[_local2 + 1].hand.empty());
this.aPlayer[_local2 + 1].resetRound();
_local2++;
}
this.dealer_mc.dealCardCounter = this.playerCount * 2;
if (this.shoe.aCollection.length < this.dealer_mc.dealCardCounter) {
this.shoe.merge(this.discardPile.empty());
this.shoe.shuffle();
}
};
org.hsieh.blackJack.BlackJack.prototype.dealOpenLoop = function () {
if (this.dealer_mc.isCardArrived) {
var _local3 = (this.dealer_mc.dealCardCounter % this.playerCount) + 1;
var _local4 = this.shoe.remove(0);
var _local2 = _local4[0];
if (_local2 < 0) {
_local2 = _local2 * -1;
}
if (this.dealer_mc.dealCardCounter == (((this.playerCount * 2) - this.playerCount) - 1)) {
_local2 = _local2 * -1;
}
this.aPlayer[_local3].acceptCard(_local2);
}
};
org.hsieh.blackJack.BlackJack.prototype.preMainLoop = function () {
this.dealer_mc.isCardArrived = false;
var _local2 = 0;
while (_local2 < this.aFloorWin_mc.length) {
this.aFloorWin_mc[_local2].gotoAndStop("idle");
_local2++;
}
this.aFloorWin_mc[this.currentPlayerIndex].gotoAndPlay("flash");
this.indicator_mc.gotoAndPlay("animate" + (this.currentPlayerIndex + 1));
this.aPlayer[this.currentPlayerIndex + 1].faceupAllCards();
this.currentState = this.mainloop;
};
org.hsieh.blackJack.BlackJack.prototype.mainLoop = function () {
var _local5 = this.aPlayer[this.currentPlayerIndex + 1];
if (this.dealer_mc.isCardArrived) {
var _local7 = this.shoe.remove(0);
var _local4 = _local7[0];
if (_local4 < 0) {
_local4 = _local4 * -1;
}
this.dealer_mc.isCardArrived = false;
var _local8 = _local5.acceptCard(_local4);
if (_local8 > 21) {
_local5.gameState = org.hsieh.blackjack.Player.GAMESTATE_BUST + org.hsieh.blackjack.Player.GAMESTATE_LOSE;
this.aCurtain_mc[this.currentPlayerIndex].gotoAndPlay("animate");
this.playerStand();
}
}
if (((!this.dealer_mc.isAnimating) && (!this.aCurtain_mc[this.currentPlayerIndex].isAnimating)) && (_local5.isComputer)) {
var _local6 = true;
var _local3 = 0;
var _local2 = 0;
while (_local2 < this.playerCount) {
if (this.aPlayer[_local2 + 1].testGameState(org.hsieh.blackjack.Player.GAMESTATE_INPLAY) && (!this.aPlayer[_local2 + 1].isComputer)) {
_local3++;
}
_local2++;
}
if (_local3 > 0) {
_local6 = _local5.ai_hitOrStay();
if (_local6) {
this.playerHit();
} else {
this.playerStand();
}
} else {
this.playerStand();
}
}
this.checkCurtain();
};
org.hsieh.blackJack.BlackJack.prototype.preEndRoundLoop = function () {
var _local3 = new Array();
var _local4 = 0;
while (_local4 < this.playerCount) {
_local3[_local4] = {handValue:org.hsieh.blackJack.BlackJack.getHandValue(this.aPlayer[_local4 + 1].hand), player_id:_local4 + 1, player_mc:this.aPlayer[_local4 + 1]};
_local4++;
}
_local3.sortOn("handValue");
_local3.reverse();
var _local6 = -1;
var _local7 = -1;
_local4 = 0;
while (_local4 < this.playerCount) {
if ((_local6 == -1) && (_local3[_local4].handValue <= 21)) {
_local6 = _local4;
_local7 = _local3[_local4].handValue;
_local3[_local4].player_mc.setGameState(org.hsieh.blackjack.Player.GAMESTATE_WIN);
} else if (_local3[_local4].handValue == _local7) {
_local3[_local4].player_mc.setGameState(org.hsieh.blackjack.Player.GAMESTATE_PUSH);
_local3[_local6].player_mc.setGameState(org.hsieh.blackjack.Player.GAMESTATE_PUSH);
} else {
_local3[_local4].player_mc.setGameState(org.hsieh.blackjack.Player.GAMESTATE_LOSE);
}
_local4++;
}
_local4 = 0;
while (_local4 < this.playerCount) {
var _local2 = this.aPlayer[_local4 + 1];
var _local5 = false;
if (!_local2.testGameState(org.hsieh.blackjack.Player.GAMESTATE_PAID)) {
if (_local2.testGameState(org.hsieh.blackjack.Player.GAMESTATE_PUSH)) {
_local2.setGameState(org.hsieh.blackjack.Player.GAMESTATE_PAID);
} else if (_local2.testGameState(org.hsieh.blackjack.Player.GAMESTATE_WIN) && (!_local2.isFullyDressed())) {
_local5 = true;
} else if (_local2.testGameState(org.hsieh.blackjack.Player.GAMESTATE_WIN) && (_local2.isFullyDressed())) {
_local2.setGameState(org.hsieh.blackjack.Player.GAMESTATE_PAID);
} else if (_local2.testGameState(org.hsieh.blackjack.Player.GAMESTATE_LOSE)) {
_local5 = true;
}
if (_local5 && (!this.aCurtain_mc[_local4].isAnimating)) {
this.aCurtain_mc[_local4].gotoAndPlay("animate");
}
}
_local4++;
}
this.currentState = this.endRoundLoop;
};
org.hsieh.blackJack.BlackJack.prototype.endRoundLoop = function () {
this.checkCurtain();
var _local3 = true;
var _local2 = 0;
while (_local2 < this.playerCount) {
if (!this.aPlayer[_local2 + 1].testGameState(org.hsieh.blackjack.Player.GAMESTATE_PAID)) {
_local3 = false;
}
if (this.aCurtain_mc[_local2].isAnimating) {
_local3 = false;
}
_local2++;
}
if (_local3) {
if (this.aPlayer[1].isNaked()) {
this.dealer_mc.gotoAndPlay("lose");
gotoAndPlay (250);
} else if (this.aPlayer[2].isNaked()) {
this.dealer_mc.gotoAndPlay("win");
gotoAndPlay (250);
} else {
this.currentState = this.preMainLoop;
gotoAndPlay (223);
}
}
};
AsSetupPackage("org.hsieh.blackjack");
AsDependencyCheck("AsSetupPackage", "org.hsieh.blackjack.TestBlackJack");
AsDependencyCheck("org.hsieh.lang.Assertion", "org.hsieh.blackjack.TestBlackJack");
AsDependencyCheck("org.hsieh.util.Collection", "org.hsieh.blackjack.TestBlackJack");
AsDependencyCheck("org.hsieh.blackjack.BlackJack", "org.hsieh.blackjack.TestBlackJack");
org.hsieh.blackjack.TestBlackJack = function () {
};
org.hsieh.blackJack.TestBlackJack.executeTest = function () {
org.hsieh.blackJack.TestBlackJack.testGetCardValue();
org.hsieh.blackJack.TestBlackJack.testGetHandValue();
};
org.hsieh.blackJack.TestBlackJack.testGetCardValue = function () {
trace("** Testing getCardValue");
AssertTrue("Ace equals 11", org.hsieh.blackJack.BlackJack.getCardValue(1) == 11);
AssertTrue("2 equals 2", org.hsieh.blackJack.BlackJack.getCardValue(2) == 2);
AssertTrue("3 equals 3", org.hsieh.blackJack.BlackJack.getCardValue(3) == 3);
AssertTrue("4 equals 4", org.hsieh.blackJack.BlackJack.getCardValue(4) == 4);
AssertTrue("5 equals 5", org.hsieh.blackJack.BlackJack.getCardValue(5) == 5);
AssertTrue("6 equals 6", org.hsieh.blackJack.BlackJack.getCardValue(6) == 6);
AssertTrue("7 equals 7", org.hsieh.blackJack.BlackJack.getCardValue(7) == 7);
AssertTrue("8 equals 8", org.hsieh.blackJack.BlackJack.getCardValue(8) == 8);
AssertTrue("9 equals 9", org.hsieh.blackJack.BlackJack.getCardValue(9) == 9);
AssertTrue("10 equals 10", org.hsieh.blackJack.BlackJack.getCardValue(10) == 10);
AssertTrue("J equals 10", org.hsieh.blackJack.BlackJack.getCardValue(11) == 10);
AssertTrue("Q equals 10", org.hsieh.blackJack.BlackJack.getCardValue(12) == 10);
AssertTrue("K equals 10", org.hsieh.blackJack.BlackJack.getCardValue(13) == 10);
AssertTrue("Ace equals 11", org.hsieh.blackJack.BlackJack.getCardValue(14) == 11);
trace("** End Testing getCardValue");
};
org.hsieh.blackJack.TestBlackJack.testGetHandValue = function () {
trace("** Testing getHandValue");
var _local1 = new org.hsieh.util.Collection();
_local1.append(1);
_local1.append(13);
AssertTrue("Ace + King = 21", org.hsieh.blackJack.BlackJack.getHandValue(_local1) == 21);
_local1.empty();
_local1.append(1);
AssertTrue("Ace = 11", org.hsieh.blackJack.BlackJack.getHandValue(_local1) == 11);
_local1.append(2);
AssertTrue("Ace + 2 = 13", org.hsieh.blackJack.BlackJack.getHandValue(_local1) == 13);
_local1.append(6);
AssertTrue("Ace + 2 + 6 = 19", org.hsieh.blackJack.BlackJack.getHandValue(_local1) == 19);
_local1.append(5);
AssertTrue("Ace + 2 + 6 + 5 = 24 - 10 = 14", org.hsieh.blackJack.BlackJack.getHandValue(_local1) == 14);
_local1.append(14);
AssertTrue("Ace + 2 + 6 + 5 + Ace = 14 + 11 - 10 = 15", org.hsieh.blackJack.BlackJack.getHandValue(_local1) == 15);
_local1.append(12);
AssertTrue("Ace + 2 + 6 + 5 + Ace + Q = 25", org.hsieh.blackJack.BlackJack.getHandValue(_local1) == 25);
trace("** End Testing getHandValue");
};
AsSetupPackage("org.hsieh.blackjack");
AsDependencyCheck("AsSetupPackage", "org.hsieh.blackjack.Player");
AsDependencyCheck("org.hsieh.util.Collection", "org.hsieh.blackjack.Player");
AsDependencyCheck("org.hsieh.blackjack.BlackJack", "org.hsieh.blackjack.Player");
org.hsieh.blackJack.Player = function (id, playerChoice, isComputer) {
this.id = id;
this.isComputer = isComputer;
this.playerChoice = playerChoice;
this.hand = new org.hsieh.util.Collection();
this.gameState = 0;
var temp_mc = null;
this.playerStripperView_mc = eval (((("_root.player" + this.id) + "chick") + this.playerChoice) + "_mc");
this.playerStripperView_mc._visible = true;
this.playerStripperView_mc.gotoAndStop("idle1");
this.aPlayerCardView_mc = new Array();
this.index_playerCardView_mc = 0;
var counter = 1;
while (counter <= org.hsieh.blackjack.Blackjack.CARD_LAYOUT_MAX_COUNT) {
temp_mc = eval (((("_root.player" + id) + "Card") + counter) + "_mc");
this.aPlayerCardView_mc.push(temp_mc);
counter++;
}
this.resetRound();
};
org.hsieh.blackjack.Player.GAMESTATE_INPLAY = 1;
org.hsieh.blackjack.Player.GAMESTATE_BUST = 2;
org.hsieh.blackjack.Player.GAMESTATE_UNUSED = 4;
org.hsieh.blackjack.Player.GAMESTATE_UNUSED = 8;
org.hsieh.blackjack.Player.GAMESTATE_UNUSED = 16;
org.hsieh.blackjack.Player.GAMESTATE_UNUSED = 32;
org.hsieh.blackjack.Player.GAMESTATE_UNUSED = 64;
org.hsieh.blackjack.Player.GAMESTATE_UNUSED = 128;
org.hsieh.blackjack.Player.GAMESTATE_UNUSED = 256;
org.hsieh.blackjack.Player.GAMESTATE_PUSH = 512;
org.hsieh.blackjack.Player.GAMESTATE_LOSE = 1024;
org.hsieh.blackjack.Player.GAMESTATE_WIN = 2048;
org.hsieh.blackjack.Player.GAMESTATE_PAID = 4096;
org.hsieh.blackjack.Player.GAMESTATE_OVER = 8196;
org.hsieh.blackjack.Player.AI_STAY_THRESHOLD = 17;
org.hsieh.blackJack.Player.prototype.resetRound = function () {
var _local2 = 0;
while (_local2 < this.aPlayerCardView_mc.length) {
this.aPlayerCardView_mc[_local2]._visible = false;
this.aPlayerCardView_mc[_local2].gotoAndStop(org.hsieh.blackjack.Blackjack.CARD_BACKFACE_FRAME);
_local2++;
}
this.gameState = org.hsieh.blackjack.Player.GAMESTATE_INPLAY;
this.index_playerCardView_mc = 0;
return(this.hand.empty());
};
org.hsieh.blackJack.Player.prototype.getCurrentCardMC = function () {
return(this.aPlayerCardView_mc[this.index_playerCardView_mc]);
};
org.hsieh.blackJack.Player.prototype.nextCurrentCardMC = function () {
this.index_playerCardView_mc++;
return(this.getCurrentCardMC());
};
org.hsieh.blackJack.Player.prototype.acceptCard = function (cardValue) {
var _local2 = null;
this.hand.append(cardValue);
_local2 = this.getCurrentCardMC();
if (cardValue > 0) {
_local2.gotoAndStop(cardValue);
} else {
_local2.gotoAndStop(org.hsieh.blackjack.Blackjack.CARD_BACKFACE_FRAME);
}
_local2._visible = true;
this.nextCurrentCardMC();
return(org.hsieh.blackJack.BlackJack.getHandValue(this.hand));
};
org.hsieh.blackJack.Player.prototype.faceupAllCards = function () {
var _local4 = null;
var _local2 = null;
var _local3 = 0;
this.hand.iteratorReset();
while (_local2 = this.hand.iteratorNext() , _local2) {
if (_local2 < 0) {
_local2 = _local2 * -1;
}
this.aPlayerCardView_mc[_local3++].gotoAndStop(_local2);
}
return(org.hsieh.blackJack.BlackJack.getHandValue(this.hand));
};
org.hsieh.blackJack.Player.prototype.isFullyDressed = function () {
return(this.playerStripperView_mc._currentframe == 1);
};
org.hsieh.blackJack.Player.prototype.isNaked = function () {
return(this.playerStripperView_mc._totalframes == this.playerStripperView_mc._currentframe);
};
org.hsieh.blackJack.Player.prototype.dress = function () {
var _local2 = false;
this.playerStripperView_mc.prevFrame();
if (this.playerStripperView_mc._currentframe == 1) {
_local2 = true;
}
return(_local2);
};
org.hsieh.blackJack.Player.prototype.undress = function () {
var _local2 = false;
this.playerStripperView_mc.nextFrame();
if (this.playerStripperView_mc._totalframe == this.playerStripperView_mc._currentframe) {
_local2 = true;
}
return(_local2);
};
org.hsieh.blackJack.Player.prototype.ai_hitOrStay = function () {
var _local2 = false;
var _local3 = org.hsieh.blackJack.BlackJack.getHandValue(this.hand);
if (_local3 < org.hsieh.blackjack.Player.AI_STAY_THRESHOLD) {
_local2 = true;
}
return(_local2);
};
org.hsieh.blackJack.Player.prototype.setGameState = function (bits) {
return((this.gameState = this.gameState | bits));
};
org.hsieh.blackJack.Player.prototype.testGameState = function (bits) {
return(this.gameState & bits);
};
AsSetupPackage("org.hsieh.blackjack");
AsDependencyCheck("AsSetupPackage", "org.hsieh.blackjack.TestPlayer");
AsDependencyCheck("org.hsieh.lang.Assertion", "org.hsieh.blackjack.TestPlayer");
AsDependencyCheck("org.hsieh.util.Collection", "org.hsieh.blackjack.TestPlayer");
AsDependencyCheck("org.hsieh.blackjack.Player", "org.hsieh.blackjack.TestPlayer");
org.hsieh.blackjack.TestPlayer = function () {
};
org.hsieh.blackJack.TestPlayer.executeTest = function () {
_global.tempPlayer = null;
org.hsieh.blackJack.TestPlayer.testGetCurrentCardMC();
org.hsieh.blackJack.TestPlayer.testNextCurrentCardMC();
org.hsieh.blackJack.TestPlayer.testAcceptCard();
org.hsieh.blackJack.TestPlayer.testIsFullyDressed();
org.hsieh.blackJack.TestPlayer.testUndress();
org.hsieh.blackJack.TestPlayer.testDress();
org.hsieh.blackJack.TestPlayer.testai_HitOrStay();
};
org.hsieh.blackJack.TestPlayer.setup = function () {
_global.tempPlayer = new org.hsieh.blackjack.Player(1, 2, false);
};
org.hsieh.blackJack.TestPlayer.teardown = function () {
_global.tempPlayer = null;
};
org.hsieh.blackJack.TestPlayer.testGetCurrentCardMC = function () {
trace("** Testing GetCurrentCardMC");
org.hsieh.blackJack.TestPlayer.setup();
AssertTrue("Expected Player1card1_mc", _global.tempPlayer.getCurrentCardMC()._name == "player1card1_mc");
org.hsieh.blackjack.testplayer.teardown();
trace("** End Testing GetCurrentCardMC");
};
org.hsieh.blackJack.TestPlayer.testNextCurrentCardMC = function () {
trace("** Testing NextCurrentCardMC");
org.hsieh.blackjack.testplayer.setup();
AssertTrue("Expected Player1card2_mc", _global.tempPlayer.nextCurrentCardMC()._name == "player1card2_mc");
AssertTrue("Expected Player1card3_mc", _global.tempPlayer.nextCurrentCardMC()._name == "player1card3_mc");
AssertTrue("Expected Player1card4_mc", _global.tempPlayer.nextCurrentCardMC()._name == "player1card4_mc");
AssertTrue("Expected Player1card5_mc", _global.tempPlayer.nextCurrentCardMC()._name == "player1card5_mc");
AssertTrue("Expected Player1card6_mc", _global.tempPlayer.nextCurrentCardMC()._name == "player1card6_mc");
AssertTrue("Expected Player1card7_mc", _global.tempPlayer.nextCurrentCardMC()._name == "player1card7_mc");
AssertTrue("Expected Player1card8_mc", _global.tempPlayer.nextCurrentCardMC()._name == "player1card8_mc");
org.hsieh.blackjack.testplayer.teardown();
trace("** End Testing NextCurrentCardMC");
};
org.hsieh.blackJack.TestPlayer.testAcceptCard = function () {
trace("** Testing testAcceptCard");
org.hsieh.blackjack.testplayer.setup();
AssertTrue("step: 01 Expected 11", _global.tempPlayer.acceptCard(1) == 11);
AssertTrue("step: 02 Expected 12", _global.tempPlayer.acceptCard(-14) == 12);
AssertTrue("step: 03 Expected 13", _global.tempPlayer.acceptCard(27) == 13);
AssertTrue("step: 04 Expected 14", _global.tempPlayer.acceptCard(40) == 14);
AssertTrue("step: 05 Expected 16", _global.tempPlayer.acceptCard(2) == 16);
AssertTrue("step: 06 Expected 18", _global.tempPlayer.acceptCard(15) == 18);
AssertTrue("step: 07 Expected 20", _global.tempPlayer.acceptCard(28) == 20);
AssertTrue("step: 08 Expected 12", _global.tempPlayer.acceptCard(41) == 12);
AssertTrue("step: 09 Expected 15", _global.tempPlayer.acceptCard(-3) == 15);
AssertTrue("step: 10 Expected 18", _global.tempPlayer.acceptCard(16) == 18);
AssertTrue("step: 11 Expected 21", _global.tempPlayer.acceptCard(-29) == 21);
AssertTrue("step: 12 Expected 24", _global.tempPlayer.acceptCard(42) == 24);
org.hsieh.blackjack.testplayer.teardown();
trace("** End Testing testAcceptCard");
};
org.hsieh.blackJack.TestPlayer.testIsFullyDressed = function () {
trace("** Testing testIsFullyDressed");
org.hsieh.blackjack.testplayer.setup();
AssertTrue("Expected True from IsFullyDressed", _global.tempPlayer.isFullyDressed());
_global.tempPlayer.undress();
AssertFalse("After undress one layer, expected False from IsFullyDressed", _global.tempPlayer.isFullyDressed());
_global.tempPlayer.dress();
AssertTrue("After dress one layer, expected True from IsFullyDressed", _global.tempPlayer.isFullyDressed());
org.hsieh.blackjack.testplayer.teardown();
trace("** End Testing testIsFullyDressed");
};
org.hsieh.blackJack.TestPlayer.testUndress = function () {
trace("** Testing testUndress");
org.hsieh.blackjack.testplayer.setup();
AssertTrue("Expected result frame 1", _global.tempPlayer.playerStripperView_mc._currentframe == 1);
_global.tempPlayer.undress();
AssertTrue("After undress one layer, expected result frame 2", _global.tempPlayer.playerStripperView_mc._currentframe == 2);
_global.tempPlayer.undress();
AssertTrue("After undress one layer, expected result frame 3", _global.tempPlayer.playerStripperView_mc._currentframe == 3);
_global.tempPlayer.undress();
AssertTrue("After undress one layer, expected result frame 4", _global.tempPlayer.playerStripperView_mc._currentframe == 4);
_global.tempPlayer.undress();
AssertTrue("After undress one layer, expected result frame 5", _global.tempPlayer.playerStripperView_mc._currentframe == 5);
org.hsieh.blackjack.testplayer.teardown();
trace("** End Testing testUndress");
};
org.hsieh.blackJack.TestPlayer.testDress = function () {
trace("** Testing testUndress");
org.hsieh.blackjack.testplayer.setup();
AssertTrue("Expected result frame 1", _global.tempPlayer.playerStripperView_mc._currentframe == 1);
_global.tempPlayer.dress();
AssertTrue("After dress, Expected result frame 1", _global.tempPlayer.playerStripperView_mc._currentframe == 1);
_global.tempPlayer.undress();
AssertTrue("After undress one layer, expected result frame 2", _global.tempPlayer.playerStripperView_mc._currentframe == 2);
_global.tempPlayer.undress();
AssertTrue("After undress one layer, expected result frame 3", _global.tempPlayer.playerStripperView_mc._currentframe == 3);
_global.tempPlayer.undress();
AssertTrue("After undress one layer, expected result frame 4", _global.tempPlayer.playerStripperView_mc._currentframe == 4);
_global.tempPlayer.undress();
AssertTrue("After undress one layer, expected result frame 5", _global.tempPlayer.playerStripperView_mc._currentframe == 5);
_global.tempPlayer.dress();
AssertTrue("After dress one layer, expected result frame 4", _global.tempPlayer.playerStripperView_mc._currentframe == 4);
_global.tempPlayer.dress();
AssertTrue("After dress one layer, expected result frame 3", _global.tempPlayer.playerStripperView_mc._currentframe == 3);
_global.tempPlayer.dress();
AssertTrue("After dress one layer, expected result frame 2", _global.tempPlayer.playerStripperView_mc._currentframe == 2);
_global.tempPlayer.dress();
AssertTrue("After dress one layer, expected result frame 1", _global.tempPlayer.playerStripperView_mc._currentframe == 1);
org.hsieh.blackjack.testplayer.teardown();
trace("** End Testing testDress");
};
org.hsieh.blackJack.TestPlayer.testai_HitOrStay = function () {
var _local3 = 0;
trace("** Testing testai_HitOrStay");
org.hsieh.blackjack.testplayer.setup();
_local3 = _global.tempPlayer.acceptCard(1);
AssertTrue("step: 01 Expected 11", _local3 == 11);
AssertTrue((("step: 02 Should be Hitting because" + _local3) + " < ") + org.hsieh.util.blackjack.Player.AI_STAY_THRESHOLD, this.ai_hitOrStay);
_local3 = _global.tempPlayer.acceptCard(14);
AssertTrue("step: 03 Expected 12", _local3 == 12);
AssertTrue((("step: 04 Should be Hitting because" + _local3) + " < ") + org.hsieh.util.blackjack.Player.AI_STAY_THRESHOLD, this.ai_hitOrStay);
_local3 = _global.tempPlayer.acceptCard(27);
AssertTrue("step: 05 Expected 13", _local3 == 13);
AssertTrue((("step: 06 Should be Hitting because" + _local3) + " < ") + org.hsieh.util.blackjack.Player.AI_STAY_THRESHOLD, this.ai_hitOrStay);
_local3 = _global.tempPlayer.acceptCard(40);
AssertTrue("step: 07 Expected 14", _local3 == 14);
AssertTrue((("step: 08 Should be Hitting because" + _local3) + " < ") + org.hsieh.util.blackjack.Player.AI_STAY_THRESHOLD, this.ai_hitOrStay);
_local3 = _global.tempPlayer.acceptCard(2);
AssertTrue("step: 09 Expected 16", _local3 == 16);
AssertTrue((("step: 10 Should be Hitting because" + _local3) + " < ") + org.hsieh.util.blackjack.Player.AI_STAY_THRESHOLD, this.ai_hitOrStay);
_local3 = _global.tempPlayer.acceptCard(15);
AssertTrue("step: 11 Expected 18", _local3 == 18);
AssertFalse((("step: 12 Should NOT be Hitting because" + _local3) + " > ") + org.hsieh.util.blackjack.Player.AI_STAY_THRESHOLD, this.ai_hitOrStay);
_local3 = _global.tempPlayer.acceptCard(28);
AssertTrue("step: 13 Expected 20", _local3 == 20);
AssertFalse((("step: 14 Should NOT be Hitting because" + _local3) + " > ") + org.hsieh.util.blackjack.Player.AI_STAY_THRESHOLD, this.ai_hitOrStay);
_local3 = _global.tempPlayer.acceptCard(41);
AssertTrue("step: 15 Expected 12", _local3 == 12);
AssertTrue((("step: 16 Should be Hitting because" + _local3) + " < ") + org.hsieh.util.blackjack.Player.AI_STAY_THRESHOLD, this.ai_hitOrStay);
_local3 = _global.tempPlayer.acceptCard(3);
AssertTrue("step: 17 Expected 15", _local3 == 15);
AssertTrue((("step: 18 Should be Hitting because" + _local3) + " < ") + org.hsieh.util.blackjack.Player.AI_STAY_THRESHOLD, this.ai_hitOrStay);
_local3 = _global.tempPlayer.acceptCard(16);
AssertTrue("step: 19 Expected 18", _local3 == 18);
AssertFalse((("step: 20 Should NOT be Hitting because" + _local3) + " > ") + org.hsieh.util.blackjack.Player.AI_STAY_THRESHOLD, this.ai_hitOrStay);
_local3 = _global.tempPlayer.acceptCard(29);
AssertTrue("step: 21 Expected 21", _local3 == 21);
AssertFalse((("step: 22 Should NOT be Hitting because" + _local3) + " > ") + org.hsieh.util.blackjack.Player.AI_STAY_THRESHOLD, this.ai_hitOrStay);
AssertTrue("step: 23 Expected 24", _global.tempPlayer.acceptCard(42) == 24);
AssertFalse((("step: 24 Should NOT be Hitting because" + _local3) + " > ") + org.hsieh.util.blackjack.Player.AI_STAY_THRESHOLD, this.ai_hitOrStay);
org.hsieh.blackjack.testplayer.teardown();
trace("** End Testing testai_HitOrStay");
};
org.hsieh.blackJack.TestBlackJack.executeTest();
org.hsieh.blackjack.TestPlayer.executeTest();
player1chick1_mc._visible = false;
player1chick2_mc._visible = false;
player1chick3_mc._visible = false;
player2chick1_mc._visible = false;
player2chick2_mc._visible = false;
player2chick3_mc._visible = false;
var aPlayerSelection = new Array(chosenPlayer1, chosenPlayer2);
blackjack = new org.hsieh.blackjack.Blackjack(aPlayerSelection, sully_dealer_mc, [curtain1_mc, curtain2_mc], indicator_mc, [floor1_mc, floor2_mc], 1);
Frame 223
blackJack.preDealOpenLoop();
Frame 224
if (!sully_dealer_mc.isAnimating) {
sully_dealer_mc.gotoAndPlay("shuffle");
}
Frame 234
if (sully_dealer_mc.isAnimating) {
gotoAndPlay (230);
}
Frame 235
blackjack.preDealOpenLoop();
sully_dealer_mc.gotoAndPlay("deal");
Frame 239
blackjack.dealOpenLoop();
Frame 242
if (sully_dealer_mc.dealCardCounter > 0) {
gotoAndPlay (239);
}
Frame 243
blackjack.currentState();
Frame 249
gotoAndPlay (243);
Frame 256
if (sully_dealer_mc.isPlayAgain) {
gotoAndPlay (199);
} else {
gotoAndPlay (250);
}
Symbol 5 MovieClip Frame 1
stop();
Symbol 43 Button
on (press) {
gotoAndPlay (199);
}
Symbol 44 Button
on (press) {
gotoAndPlay (183);
}
Symbol 50 Button
on (release) {
chosenPlayer1 = 1;
gotoAndPlay (219);
}
Symbol 52 Button
on (release) {
chosenPlayer1 = 2;
gotoAndPlay (219);
}
Symbol 54 Button
on (release) {
chosenPlayer1 = 3;
gotoAndPlay (219);
}
Symbol 58 MovieClip Frame 1
stop();
Symbol 58 MovieClip Frame 2
stop();
Symbol 58 MovieClip Frame 3
stop();
Symbol 62 MovieClip Frame 1
stop();
Symbol 62 MovieClip Frame 9
gotoAndPlay (2);
Symbol 102 MovieClip Frame 1
stop();
Symbol 102 MovieClip Frame 2
stop();
Symbol 102 MovieClip Frame 3
stop();
Symbol 102 MovieClip Frame 4
stop();
Symbol 102 MovieClip Frame 5
stop();
Symbol 102 MovieClip Frame 6
stop();
Symbol 102 MovieClip Frame 7
stop();
Symbol 102 MovieClip Frame 8
stop();
Symbol 102 MovieClip Frame 9
stop();
Symbol 102 MovieClip Frame 10
stop();
Symbol 102 MovieClip Frame 11
stop();
Symbol 102 MovieClip Frame 12
stop();
Symbol 102 MovieClip Frame 13
stop();
Symbol 102 MovieClip Frame 14
stop();
Symbol 102 MovieClip Frame 15
stop();
Symbol 102 MovieClip Frame 16
stop();
Symbol 102 MovieClip Frame 17
stop();
Symbol 102 MovieClip Frame 18
stop();
Symbol 102 MovieClip Frame 19
stop();
Symbol 102 MovieClip Frame 20
stop();
Symbol 102 MovieClip Frame 21
stop();
Symbol 102 MovieClip Frame 22
stop();
Symbol 102 MovieClip Frame 23
stop();
Symbol 102 MovieClip Frame 24
stop();
Symbol 102 MovieClip Frame 25
stop();
Symbol 102 MovieClip Frame 26
stop();
Symbol 102 MovieClip Frame 27
stop();
Symbol 102 MovieClip Frame 28
stop();
Symbol 102 MovieClip Frame 29
stop();
Symbol 102 MovieClip Frame 30
stop();
Symbol 102 MovieClip Frame 31
stop();
Symbol 102 MovieClip Frame 32
stop();
Symbol 102 MovieClip Frame 33
stop();
Symbol 102 MovieClip Frame 34
stop();
Symbol 102 MovieClip Frame 35
stop();
Symbol 102 MovieClip Frame 36
stop();
Symbol 102 MovieClip Frame 37
stop();
Symbol 102 MovieClip Frame 38
stop();
Symbol 102 MovieClip Frame 39
stop();
Symbol 102 MovieClip Frame 40
stop();
Symbol 102 MovieClip Frame 41
stop();
Symbol 102 MovieClip Frame 42
stop();
Symbol 102 MovieClip Frame 43
stop();
Symbol 102 MovieClip Frame 44
stop();
Symbol 102 MovieClip Frame 45
stop();
Symbol 102 MovieClip Frame 46
stop();
Symbol 102 MovieClip Frame 47
stop();
Symbol 102 MovieClip Frame 48
stop();
Symbol 102 MovieClip Frame 49
stop();
Symbol 102 MovieClip Frame 50
stop();
Symbol 102 MovieClip Frame 51
stop();
Symbol 102 MovieClip Frame 52
stop();
Symbol 102 MovieClip Frame 53
stop();
Symbol 102 MovieClip Frame 54
stop();
Symbol 112 MovieClip Frame 1
stop();
Symbol 112 MovieClip Frame 2
stop();
Symbol 112 MovieClip Frame 3
stop();
Symbol 112 MovieClip Frame 4
stop();
Symbol 112 MovieClip Frame 5
stop();
Symbol 112 MovieClip Frame 6
stop();
Symbol 121 MovieClip Frame 1
stop();
Symbol 121 MovieClip Frame 2
stop();
Symbol 121 MovieClip Frame 3
stop();
Symbol 121 MovieClip Frame 4
stop();
Symbol 121 MovieClip Frame 5
stop();
Symbol 121 MovieClip Frame 6
stop();
Symbol 131 MovieClip Frame 1
stop();
Symbol 131 MovieClip Frame 2
stop();
Symbol 131 MovieClip Frame 3
stop();
Symbol 131 MovieClip Frame 4
stop();
Symbol 131 MovieClip Frame 5
stop();
Symbol 131 MovieClip Frame 6
stop();
Symbol 133 MovieClip Frame 1
stop();
Symbol 133 MovieClip Frame 2
stop();
Symbol 133 MovieClip Frame 3
stop();
Symbol 133 MovieClip Frame 4
stop();
Symbol 133 MovieClip Frame 5
stop();
Symbol 133 MovieClip Frame 6
stop();
Symbol 134 MovieClip Frame 1
stop();
Symbol 134 MovieClip Frame 2
stop();
Symbol 134 MovieClip Frame 3
stop();
Symbol 134 MovieClip Frame 4
stop();
Symbol 134 MovieClip Frame 5
stop();
Symbol 134 MovieClip Frame 6
stop();
Symbol 135 MovieClip Frame 1
stop();
Symbol 135 MovieClip Frame 2
stop();
Symbol 135 MovieClip Frame 3
stop();
Symbol 135 MovieClip Frame 4
stop();
Symbol 135 MovieClip Frame 5
stop();
Symbol 135 MovieClip Frame 6
stop();
Symbol 139 Button
on (release) {
blackjack.playerHit();
}
Symbol 144 Button
on (release) {
blackjack.playerStand();
}
Symbol 154 MovieClip Frame 1
stop();
Symbol 154 MovieClip Frame 7
gotoAndPlay (2);
Symbol 154 MovieClip Frame 16
gotoAndPlay (11);
Symbol 180 MovieClip Frame 1
var isAnimating = false;
var isDone = false;
var isCovered = false;
stop();
Symbol 180 MovieClip Frame 2
isAnimating = true;
isDone = false;
isCovered = false;
Symbol 180 MovieClip Frame 14
isCovered = true;
Symbol 180 MovieClip Frame 92
isCovered = false;
isDone = true;
Symbol 180 MovieClip Frame 110
gotoAndStop (1);
Symbol 188 Button
on (release) {
getURL ("http://www.sexflash.pp.ua", "_blank");
}
Symbol 269 Button
on (release) {
isPlayAgain = true;
}
Symbol 297 MovieClip Frame 1
stop();
var isCardArrived = false;
var isAnimating = false;
var isPlayAgain = false;
Symbol 297 MovieClip Frame 5
isCardArrived = false;
isAnimating = true;
Symbol 297 MovieClip Frame 9
isCardArrived = false;
Symbol 297 MovieClip Frame 16
isCardArrived = true;
Symbol 297 MovieClip Frame 19
if ((--dealCardCounter) > 0) {
gotoAndPlay (9);
}
Symbol 297 MovieClip Frame 43
gotoAndStop (1);
Symbol 297 MovieClip Frame 44
isAnimating = true;
Symbol 297 MovieClip Frame 87
gotoAndStop (1);
Symbol 297 MovieClip Frame 91
isAnimating = true;
Symbol 297 MovieClip Frame 129
isAnimating = false;
stop();
Symbol 297 MovieClip Frame 132
isAnimating = true;
Symbol 297 MovieClip Frame 202
isAnimating = false;
stop();