Frame 1
loadedbytes = getBytesLoaded();
totalbytes = getBytesTotal();
percentbytes = int(loadedbytes / (totalbytes / 100));
tellTarget (_root.loader) {
gotoAndStop(_root.percentbytes);
};
Frame 2
if (loadedbytes == totalbytes) {
} else {
gotoAndPlay (1);
}
Frame 3
_global.pts = 0;
_global.textA = "BUSTED!";
_global.free = true;
_global.Px = 0;
_global.Pup = 2;
fb._visible = false;
var keyListener = new Object();
keyListener.onKeyDown = function () {
if (Key.isDown(40)) {
fb._visible = true;
}
};
Key.addListener(keyListener);
stop();
Frame 4
function randRange(min, max) {
var randomNum0 = (Math.floor(Math.random() * 31) + min);
var i = 0;
while (i < randomNum0) {
var randomNum = (Math.floor(Math.random() * ((max - min) + 1)) + min);
i++;
}
return(randomNum);
}
_global.p_pts = 0;
_global.spl = 0;
_global.pts = 0;
_global.myCards = new Array();
_global.pcCards = new Array();
_global.myCards.push(randRange(2, 14));
_global.myCards.push(randRange(2, 14));
_global.pcCards.push(randRange(2, 14));
Frame 5
function redraw() {
y_s.text = "You: ";
var scr = 0;
var sA = 0;
y2_s.text = "Bank: ";
var scr = 0;
var sA = 0;
var sA2 = 0;
y2_s.text = "Bank: ";
var scrPl = 0;
var i = 0;
while (i < _global.pcCards.length) {
if (_global.pcCards[i] <= 10) {
scr = scr + _global.pcCards[i];
} else if (_global.pcCards[i] == 11) {
scr = scr + 10;
} else if (_global.pcCards[i] == 12) {
scr = scr + 10;
} else if (_global.pcCards[i] == 13) {
scr = scr + 10;
} else if (_global.pcCards[i] == 14) {
scr = scr + 1;
sA = sA + 1;
}
i++;
}
var i = 1;
while (i <= sA) {
if (scr <= 11) {
scr = scr + 10;
}
i++;
}
_level0.y2_s.text = _level0.y2_s.text + (" " + scr);
sA = 0;
scr = 0;
var i = 0;
while (i < _global.myCards.length) {
if (_global.myCards[i] <= 10) {
scr = scr + _global.myCards[i];
} else if (_global.myCards[i] == 11) {
scr = scr + 10;
} else if (_global.myCards[i] == 12) {
scr = scr + 10;
} else if (_global.myCards[i] == 13) {
scr = scr + 10;
} else if (_global.myCards[i] == 14) {
scr = scr + 1;
sA = sA + 1;
}
i++;
}
var i = 1;
while (i <= sA) {
if (scr <= 11) {
scr = scr + 10;
}
i++;
}
y_s.text = y_s.text + (" " + scr);
if (_global.spl == 1) {
_global.SplitScore = scr;
}
if (_global.spl == 2) {
if (_global.SplitScore != 0) {
y_s.text = y_s.text + (" or " + _global.SplitScore);
}
}
if (scr > 21) {
_global.std = 0;
var Len = _global.myCards.length;
_global.textA = "BUSTED!";
if (_global.spl == 1) {
_global.daBusted = true;
} else {
_global.daBusted = false;
}
if (_global.spl == 2) {
if (_global.SplitScore != 0) {
var i = 0;
while (i < _global.myCards.length) {
_global.myCards[i] = 0;
i++;
}
_global.pcCards.push(randRange(6, 14));
y_s.text = "Using previous split: " + _global.SplitScore;
gotoAndPlay ("NPC");
return(undefined);
}
}
if (!_global.daBusted) {
_global.pts--;
}
if (_global.pts < 0) {
_global.b = 1 - _global.pts;
} else if (_global.pts > 0) {
_global.b = 7 + _global.pts;
} else {
_global.b = 1;
}
_global.a = pupet._currentframe;
gotoAndPlay ("anim");
}
}
function AddCard() {
var ad = randRange(2, 14);
_global.myCards.push(ad);
var xx = _global.myCards.length;
var Nm = this.attachMovie("Card_Flop", "cf" + (_global.myCards.length - 1), this.getNextHighestDepth());
var xold = getProperty("cf" + (_global.myCards.length - 2), _x);
setProperty("cf" + (_global.myCards.length - 1), _x , xold + (crd._width * 1.2));
setProperty("cf" + (_global.myCards.length - 1), _y , crd._y);
var mst = (1.1 + ((Math.random() - 0.3) / 2));
Nm.face.gotoAndStop(ad - 1);
setProperty("cf" + (_global.myCards.length - 1), _xscale , mst * 100);
setProperty("cf" + (_global.myCards.length - 1), _xscale , mst * 100);
setProperty("cf" + (_global.myCards.length - 1), _yscale , mst * 100);
setProperty("cf" + (_global.myCards.length - 1), _rotation , (Math.random() - 0.5) * 90);
_global.free = false;
Nm.onEnterFrame = function () {
if (this._currentframe == 40) {
_global.free = true;
redraw();
}
};
}
function dosplit() {
var ad = randRange(2, 14);
_global.spl++;
split._visible = false;
var xx = _global.myCards.length;
var Nm = this.attachMovie("Card_Flop", "sf" + _global.spl, this.getNextHighestDepth());
setProperty("sf" + _global.spl, _x , crd3._x);
if (_global.spl == 2) {
setProperty("sf" + _global.spl, _x , crd3._x + (crd3._width * 1.2));
}
setProperty("sf" + _global.spl, _y , crd3._y);
var mst = 1.4;
Nm.face.gotoAndStop(13 + _global.spl);
setProperty("sf" + _global.spl, _xscale , mst * 100);
setProperty("sf" + _global.spl, _xscale , mst * 100);
setProperty("sf" + _global.spl, _yscale , mst * 100);
setProperty("sf" + _global.spl, _rotation , (Math.random() - 0.5) * 45);
_global.free = false;
Nm.onEnterFrame = function () {
if (this._currentframe <= 20) {
var Len = _global.myCards.length;
var i = 1;
while (i < Len) {
setProperty("_level0.cf" + i, _x , getProperty("_level0.cf" + i, _x) - 40);
setProperty("_level0.cf" + i, _rotation , getProperty("_level0.cf" + i, _rotation) - 10);
i++;
}
if (this._currentframe == 20) {
var i = (Len - 1);
while (i >= 1) {
removeMovieClip("_level0.cf" + i);
_global.myCards.pop();
i--;
}
AddCard();
}
}
if (this._currentframe == 40) {
_global.free = true;
}
};
}
pts.text = ("Score: " + _global.pts) + " pts";
var scl;
var xx;
var yy;
var b = pupet.getBounds(this);
if ((pupet._width * 600) > (pupet._height * 800)) {
scl = 790 / pupet._width;
} else {
scl = 600 / pupet._height;
}
pupet._xscale = pupet._xscale * scl;
pupet._yscale = pupet._yscale * scl;
var b = pupet.getBounds(this);
pupet._y = pupet._y - (b.yMax - 640);
pupet._x = 400;
var b = pupet.getBounds(this);
if (b.xMax > 800) {
pupet._x = pupet._x - (b.xMax - 802);
}
_global.Px = pupet._x;
_global.Py = pupet._y;
_global.Pw = pupet._xscale;
_global.Ph = pupet._yscale;
if (_global.daBusted) {
dosplit();
_global.daBusted = false;
stop();
return(undefined);
}
var Nm = this.attachMovie("Card_Flop", "cf0", 1000);
Nm.face.gotoAndStop(_global.myCards[0] - 1);
shield._visible = true;
_global.free = false;
split._visible = false;
if ((_global.myCards[0] == _global.myCards[1]) && (_global.spl == 0)) {
split._visible = true;
}
y_s._visible = true;
y2_s._visible = true;
bus._visible = true;
setProperty("cf0", _x , crd._x);
setProperty("cf0", _y , crd._y);
var mst = (1.1 + ((Math.random() - 0.3) / 3));
setProperty("cf0", _xscale , mst * 100);
setProperty("cf0", _yscale , mst * 100);
setProperty("cf0", _rotation , (Math.random() - 0.5) * 90);
Nm.onEnterFrame = function () {
if (this._currentframe == 40) {
_global.free = true;
}
};
var Nm3 = this.attachMovie("Card_Flop", "cf1", this.getNextHighestDepth());
var xold = getProperty("cf1", _x);
setProperty("cf1", _x , crd._x + (crd._width * 1.2));
setProperty("cf1", _y , crd._y);
var mst = (1.1 + ((Math.random() - 0.3) / 3));
Nm3.face.gotoAndStop(_global.myCards[1] - 1);
setProperty("cf1", _xscale , mst * 100);
setProperty("cf1", _xscale , mst * 100);
setProperty("cf1", _yscale , mst * 100);
setProperty("cf1", _rotation , (Math.random() - 0.5) * 90);
var Nm2 = this.attachMovie("Card_Flop", "ef0", this.getNextHighestDepth());
Nm2.face.gotoAndStop(_global.pcCards[0] - 1);
setProperty("ef0", _x , crd2._x);
setProperty("ef0", _y , crd2._y);
var mst = (1 + ((Math.random() - 0.5) / 10));
setProperty("ef0", _xscale , mst * 100);
setProperty("ef0", _yscale , mst * 100);
setProperty("ef0", _rotation , (Math.random() - 0.5) * 90);
redraw();
stop();
Frame 8
function NPCredraw() {
var xx = _global.pcCards.length;
var Nm = this.attachMovie("Card_Flop", "ef" + (_global.pcCards.length - 1), this.getNextHighestDepth());
var xold = getProperty("ef" + (_global.pcCards.length - 2), _x);
setProperty("ef" + (_global.pcCards.length - 1), _x , xold + (crd2._width * 1.2));
setProperty("ef" + (_global.pcCards.length - 1), _y , crd2._y);
var mst = (1 + ((Math.random() - 0.5) / 2));
Nm.face.gotoAndStop(_global.pcCards[_global.pcCards.length - 1] - 1);
setProperty("ef" + (_global.pcCards.length - 1), _xscale , mst * 100);
setProperty("ef" + (_global.pcCards.length - 1), _xscale , mst * 100);
setProperty("ef" + (_global.pcCards.length - 1), _yscale , mst * 100);
setProperty("ef" + (_global.pcCards.length - 1), _rotation , (Math.random() - 0.5) * 90);
Nm.onEnterFrame = function () {
if (this._currentframe == 40) {
var scr = 0;
var sA = 0;
var sA2 = 0;
y2_s.text = "Bank: ";
var scrPl = 0;
var i = 0;
while (i < _global.pcCards.length) {
if (_global.pcCards[i] <= 10) {
scr = scr + _global.pcCards[i];
} else if (_global.pcCards[i] == 11) {
scr = scr + 10;
} else if (_global.pcCards[i] == 12) {
scr = scr + 10;
} else if (_global.pcCards[i] == 13) {
scr = scr + 10;
} else if (_global.pcCards[i] == 14) {
scr = scr + 1;
sA = sA + 1;
}
i++;
}
var i = 1;
while (i <= sA) {
if (scr <= 11) {
scr = scr + 10;
}
i++;
}
_level0.y2_s.text = _level0.y2_s.text + (" " + scr);
if (scr < 17) {
var ad = randRange(2, 14);
_global.pcCards.push(ad);
NPCredraw();
} else {
var BJ = false;
var DRAW = false;
var lose = false;
if (scr <= 21) {
var i = 0;
while (i < _global.myCards.length) {
if (_global.myCards[i] <= 10) {
scrPl = scrPl + _global.myCards[i];
} else if (_global.myCards[i] == 11) {
scrPl = scrPl + 10;
} else if (_global.myCards[i] == 12) {
scrPl = scrPl + 10;
} else if (_global.myCards[i] == 13) {
scrPl = scrPl + 10;
} else if (_global.myCards[i] == 14) {
scrPl = scrPl + 1;
sA2 = sA2 + 1;
}
i++;
}
var i = 1;
while (i <= sA2) {
if (scrPl <= 11) {
scrPl = scrPl + 10;
}
i++;
}
if (scr >= scrPl) {
lose = true;
if (_global.spl == 2) {
if (scr < _global.SplitScore) {
lose = false;
}
if (scr == _global.SplitScore) {
scrPl = _global.SplitScore;
}
}
}
if (_global.spl == 0) {
if ((((_global.myCards[0] == 14) && (_global.myCards[1] > 10)) && (_global.myCards[1] < 14)) || (((_global.myCards[1] == 14) && (_global.myCards[0] > 10)) && (_global.myCards[0] < 14))) {
if (_global.myCards.length == 2) {
if ((((_global.pcCards[0] == 14) && (_global.pcCards[1] > 10)) && (_global.pcCards[1] < 14)) || (((_global.pcCards[1] == 14) && (_global.pcCards[0] > 10)) && (_global.pcCards[0] < 14))) {
BJ = false;
} else {
BJ = true;
lose = false;
_global.pts++;
}
}
}
}
}
if ((scr != scrPl) || (BJ)) {
if (lose) {
_global.pts--;
_global.textA = "BUSTED!";
} else {
_global.pts++;
_global.textA = "HELL YEAH!";
if (BJ) {
_global.textA = "BLACK JACK!";
}
}
} else {
_global.textA = "DRAW";
}
if (_global.pts < 0) {
_global.b = 1 - _global.pts;
} else if (_global.pts > 0) {
_global.b = 7 + _global.pts;
} else {
_global.b = 1;
}
_global.a = pupet._currentframe;
_global.std = 0;
gotoAndPlay ("anim");
}
}
};
}
NPCredraw();
stop();
Frame 10
bus.text = _global.textA;
pts.text = ("Score: " + _global.pts) + " pts";
_global.y_sx = y_s._x;
_global.busx = bus._x;
if (_global.Pup == 1) {
}
if (_global.Pup == 2) {
if (_global.pts < -11) {
_global.pts = -11;
}
if (_global.pts > 11) {
_global.pts = 11;
}
if (_global.pts < 0) {
_global.b = 1 - _global.pts;
} else if (_global.pts > 0) {
_global.b = 12 + _global.pts;
} else {
_global.b = 1;
}
}
var scl;
var xx;
var yy;
pup_Small.gotoAndStop(_global.b);
var b = pup_Small.getBounds(this);
if ((pup_Small._width * 600) > (pup_Small._height * 800)) {
scl = 790 / pup_Small._width;
} else {
scl = 600 / pup_Small._height;
}
pup_Small._xscale = pup_Small._xscale * scl;
pup_Small._yscale = pup_Small._yscale * scl;
var b = pup_Small.getBounds(this);
pup_Small._y = pup_Small._y - (b.yMax - 640);
pup_Small._x = 400;
var b = pup_Small.getBounds(this);
if (b.xMax > 800) {
pup_Small._x = pup_Small._x - (b.xMax - 802);
}
Frame 33
if (_global.daBusted) {
_global.SplitScore = 0;
gotoAndPlay ("game");
return(undefined);
}
if (bus.text == "DRAW") {
if (_global.spl == 2) {
_global.spl = 0;
removeMovieClip("sf1");
removeMovieClip("sf2");
}
var Len = _global.myCards.length;
var i = 0;
while (i < Len) {
removeMovieClip("cf" + i);
_global.myCards.pop();
i++;
}
Len = _global.pcCards.length;
var i = 0;
while (i < Len) {
removeMovieClip("ef" + i);
_global.pcCards.pop();
i++;
}
_global.spl = 0;
_global.myCards.push(randRange(2, 14));
_global.myCards.push(randRange(2, 14));
_global.pcCards.push(randRange(2, 14));
gotoAndStop ("Game");
}
var m = (((pup_Small._x - _global.Px) * (100 - shield._alpha)) / 100);
pupet._x = _global.Px + m;
pupet._y = _global.Py + (((pup_Small._y - _global.Py) * (100 - shield._alpha)) / 100);
pupet._xscale = _global.Pw + (((pup_Small._xscale - _global.Pw) * (100 - shield._alpha)) / 100);
pupet._yscale = _global.Ph + (((pup_Small._yscale - _global.Ph) * (100 - shield._alpha)) / 100);
shield._alpha = shield._alpha - 5;
y_s._x = y_s._x - 10;
y2_s._x = y2_s._x - 10;
bus._x = bus._x - 20;
if (_global.spl == 2) {
var i = 1;
while (i <= 2) {
setProperty("sf" + i, _x , getProperty("sf" + i, _x) - 40);
setProperty("sf" + i, _rotation , getProperty("sf" + i, _rotation) - 10);
i++;
}
}
var Len = _global.myCards.length;
var i = 0;
while (i < Len) {
setProperty("cf" + i, _x , getProperty("cf" + i, _x) - 40);
setProperty("cf" + i, _rotation , getProperty("cf" + i, _rotation) - 10);
i++;
}
Len = _global.pcCards.length;
var i = 0;
while (i < Len) {
setProperty("ef" + i, _x , getProperty("ef" + i, _x) - 40);
setProperty("ef" + i, _rotation , getProperty("ef" + i, _rotation) - 10);
i++;
}
if (shield._alpha < 10) {
_global.std = 0;
y_s._visible = false;
y2_s._visible = false;
bus._visible = false;
shield._visible = false;
shield._alpha = 100;
y_s._x = _global.y_sx;
y2_s._x = _global.y_sx;
bus._x = _global.busx;
gotoAndPlay ("out");
}
Frame 34
gotoAndPlay ("fadeOut");
Frame 35
pupet._x = pup_Small._x;
pupet._y = pup_Small._y;
pupet._xscale = pup_Small._xscale;
pupet._yscale = pup_Small._yscale;
Frame 39
var Len = _global.myCards.length;
var i = 0;
while (i < Len) {
removeMovieClip("cf" + i);
_global.myCards.pop();
i++;
}
if (_global.spl == 2) {
_global.spl = 0;
removeMovieClip("sf1");
removeMovieClip("sf2");
}
Len = _global.pcCards.length;
var i = 0;
while (i < Len) {
removeMovieClip("ef" + i);
_global.pcCards.pop();
i++;
}
Frame 40
_global.std = _global.std + 1;
var rnd = random(90);
if (_global.std <= 1) {
zap._x = pupet._x;
zap._y = pupet._y;
zap2._x = pupet._x;
zap2._y = pupet._y;
zap3._x = pupet._x;
zap3._y = pupet._y;
}
if (rnd > _global.std) {
pupet.gotoAndStop(_global.a);
} else {
pupet.gotoAndStop(_global.b);
}
if (_global.std > 94) {
zap._visible = false;
}
if (_global.std == 170) {
pupet.gotoAndStop(_global.b);
_global.myCards.push(randRange(2, 14));
_global.myCards.push(randRange(2, 14));
_global.spl = 0;
_global.pcCards.push(randRange(2, 14));
gotoAndStop ("Game");
}
Frame 41
gotoAndPlay ("anim0");
Symbol 19 MovieClip Frame 1
stop();
Symbol 19 MovieClip Frame 2
stop();
Symbol 19 MovieClip Frame 3
stop();
Symbol 19 MovieClip Frame 4
stop();
Symbol 41 MovieClip Frame 1
stop();
Symbol 41 MovieClip Frame 2
stop();
Symbol 41 MovieClip Frame 3
stop();
Symbol 41 MovieClip Frame 4
stop();
Symbol 41 MovieClip Frame 5
stop();
Symbol 41 MovieClip Frame 6
stop();
Symbol 41 MovieClip Frame 7
stop();
Symbol 41 MovieClip Frame 8
stop();
Symbol 41 MovieClip Frame 9
stop();
Symbol 41 MovieClip Frame 10
stop();
Symbol 41 MovieClip Frame 11
stop();
Symbol 41 MovieClip Frame 12
stop();
Symbol 41 MovieClip Frame 13
stop();
Symbol 41 MovieClip Frame 14
stop();
Symbol 41 MovieClip Frame 15
stop();
Symbol 44 MovieClip [Card_Flop] Frame 41
stop();
Symbol 64 Button
on (press) {
play();
}
Symbol 130 MovieClip Frame 1
stop();
Symbol 130 MovieClip Frame 2
stop();
Symbol 130 MovieClip Frame 3
stop();
Symbol 130 MovieClip Frame 4
stop();
Symbol 130 MovieClip Frame 5
stop();
Symbol 130 MovieClip Frame 6
stop();
Symbol 130 MovieClip Frame 7
stop();
Symbol 130 MovieClip Frame 8
stop();
Symbol 130 MovieClip Frame 9
stop();
Symbol 130 MovieClip Frame 10
stop();
Symbol 130 MovieClip Frame 11
stop();
Symbol 130 MovieClip Frame 12
stop();
Symbol 142 Button
on (press) {
if (!_global.free) {
return(undefined);
}
AddCard();
}
Symbol 144 Button
on (press) {
if (!_global.free) {
return(undefined);
}
if (_global.spl == 1) {
dosplit();
return(undefined);
}
_global.pcCards.push(randRange(6, 14));
gotoAndPlay ("NPC");
}
Symbol 151 Button
on (press) {
if (!_global.free) {
return(undefined);
}
dosplit();
}
Symbol 152 Button
on (press) {
_global.std = 0;
_global.spl = 0;
_global.a = pupet._currentframe;
_global.pts++;
gotoAndPlay ("anim");
}