Frame 1
_root.debugbutton._visible = false;
_root.txtdebug._visible = false;
_root.txtdebuglist._visible = false;
stop();
Instance of Symbol 333 MovieClip [FScrollBarSymbol] "txtdebuglist" in Frame 1
//component parameters
onClipEvent (initialize) {
_targetInstanceName = "txtdebug";
horizontal = false;
}
Instance of Symbol 338 MovieClip "debugbutton" in Frame 1
on (release) {
_root.txtdebug._visible = !_root.txtdebug._visible;
_root.txtdebuglist._visible = !_root.txtdebuglist._visible;
}
Frame 5
startEvent = new Object();
startEvent.timeleft = 10;
startEvent.waitTimeLeft = 60;
startEvent.callback = function () {
var _local1 = _root;
var _local2 = this;
if (Game.gameEnded()) {
clearInterval(_local1.startEventIntervalID);
} else if (Game.getOpponent().isConnected()) {
_local1.intro.startbutton._visible = true;
if (_local2.timeleft == 0) {
clearInterval(_local1.startEventIntervalID);
if (!_local1.gameStartGamePressed) {
Game.debug("calling startgame");
_local1.myGame.startGame();
}
} else {
_local1.txt_automatic_start = I18n.getLabelReplace("automatic_start", _local2.timeleft);
}
_local2.timeleft--;
} else if (Game.gameEnded()) {
clearInterval(_local1.startEventIntervalID);
} else {
if (_local2.waitTimeLeft == 0) {
Game.debug("wait time over");
clearInterval(_local1.startEventIntervalID);
Game.openDialog(I18n.getLabel("opponent_noconnect"), "", true);
e = new Object();
e.callback = function () {
Game.debug("e callback");
clearInterval(_root.startEventeIntervalID);
Game.gameOver();
};
_local1.startEventeIntervalID = setInterval(e, "callback", 3000);
}
Game.debug("wait time: " + _local2.waitTimeLeft);
_local2.waitTimeLeft--;
}
};
_root.startEventIntervalID = setInterval(startEvent, "callback", 1000);
_root.intro.startbutton._visible = false;
Instance of Symbol 361 MovieClip in Frame 5
on (rollOver) {
_root.exitbutton2._alpha = 100;
}
on (rollOut) {
_root.exitbutton2._alpha = 75;
}
on (release) {
Game.exitGame();
}
Frame 6
stop();
Frame 22
stop();
Frame 147
Communicator.sendClientIsReady();
Frame 154
Frame 155
_root.myGame.nextRound();
this.paintmask.gotoAndStop(40);
Frame 156
stop();
Frame 172
stop();
Frame 194
stop();
Symbol 11 MovieClip [FUIComponentSymbol] Frame 1
#initclip 13
function FUIComponentClass() {
this.init();
}
FUIComponentClass.prototype = new MovieClip();
FUIComponentClass.prototype.init = function () {
var _local1 = this;
var _local3 = _global;
_local1.enable = true;
_local1.focused = false;
_local1.useHandCursor = false;
_local1._accImpl = new Object();
_local1._accImpl.stub = true;
_local1.styleTable = new Array();
if (_local3.globalStyleFormat == undefined) {
_local3.globalStyleFormat = new FStyleFormat();
globalStyleFormat.isGlobal = true;
_local3._focusControl = new Object();
_local3._focusControl.onSetFocus = function (oldFocus, newFocus) {
oldFocus.myOnKillFocus();
newFocus.myOnSetFocus();
};
Selection.addListener(_local3._focusControl);
}
if (_local1._name != undefined) {
_local1._focusrect = false;
_local1.tabEnabled = true;
_local1.focusEnabled = true;
_local1.tabChildren = false;
_local1.tabFocused = true;
if (_local1.hostStyle == undefined) {
globalStyleFormat.addListener(_local1);
} else {
_local1.styleTable = _local1.hostStyle;
}
_local1.deadPreview._visible = false;
_local1.deadPreview._width = (_local1.deadPreview._height = 1);
_local1.methodTable = new Object();
_local1.keyListener = new Object();
_local1.keyListener.controller = _local1;
_local1.keyListener.onKeyDown = function () {
this.controller.myOnKeyDown();
};
_local1.keyListener.onKeyUp = function () {
this.controller.myOnKeyUp();
};
for (var _local2 in _local1.styleFormat_prm) {
_local1.setStyleProperty(_local2, _local1.styleFormat_prm[_local2]);
}
}
};
FUIComponentClass.prototype.setEnabled = function (enabledFlag) {
var _local1 = this;
_local1.enable = ((arguments.length > 0) ? (enabledFlag) : true);
_local1.tabEnabled = (_local1.focusEnabled = enabledFlag);
if ((!_local1.enable) && (_local1.focused)) {
Selection.setFocus(undefined);
}
};
FUIComponentClass.prototype.getEnabled = function () {
return(this.enable);
};
FUIComponentClass.prototype.setSize = function (w, h) {
var _local1 = this;
_local1.width = w;
_local1.height = h;
_local1.focusRect.removeMovieClip();
};
FUIComponentClass.prototype.setChangeHandler = function (chng, obj) {
var _local1 = this;
_local1.handlerObj = ((obj == undefined) ? (_local1._parent) : (obj));
_local1.changeHandler = chng;
};
FUIComponentClass.prototype.invalidate = function (methodName) {
var _local1 = this;
_local1.methodTable[methodName] = true;
_local1.onEnterFrame = _local1.cleanUI;
};
FUIComponentClass.prototype.cleanUI = function () {
var _local1 = this;
if (_local1.methodTable.setSize) {
_local1.setSize(_local1.width, _local1.height);
} else {
_local1.cleanUINotSize();
}
_local1.methodTable = new Object();
delete _local1.onEnterFrame;
};
FUIComponentClass.prototype.cleanUINotSize = function () {
var _local1 = this;
for (var _local2 in _local1.methodTable) {
_local1[_local2]();
}
};
FUIComponentClass.prototype.drawRect = function (x, y, w, h) {
var _local1 = this;
var _local2 = y;
var _local3 = x;
var inner = _local1.styleTable.focusRectInner.value;
var outer = _local1.styleTable.focusRectOuter.value;
if (inner == undefined) {
inner = 16777215 /* 0xFFFFFF */;
}
if (outer == undefined) {
outer = 0;
}
_local1.createEmptyMovieClip("focusRect", 1000);
_local1.focusRect.controller = _local1;
_local1.focusRect.lineStyle(1, outer);
_local1.focusRect.moveTo(_local3, _local2);
_local1.focusRect.lineTo(_local3 + w, _local2);
_local1.focusRect.lineTo(_local3 + w, _local2 + h);
_local1.focusRect.lineTo(_local3, _local2 + h);
_local1.focusRect.lineTo(_local3, _local2);
_local1.focusRect.lineStyle(1, inner);
_local1.focusRect.moveTo(_local3 + 1, _local2 + 1);
_local1.focusRect.lineTo((_local3 + w) - 1, _local2 + 1);
_local1.focusRect.lineTo((_local3 + w) - 1, (_local2 + h) - 1);
_local1.focusRect.lineTo(_local3 + 1, (_local2 + h) - 1);
_local1.focusRect.lineTo(_local3 + 1, _local2 + 1);
};
FUIComponentClass.prototype.pressFocus = function () {
var _local1 = this;
_local1.tabFocused = false;
_local1.focusRect.removeMovieClip();
Selection.setFocus(_local1);
};
FUIComponentClass.prototype.drawFocusRect = function () {
var _local1 = this;
_local1.drawRect(-2, -2, _local1.width + 4, _local1.height + 4);
};
FUIComponentClass.prototype.myOnSetFocus = function () {
var _local1 = this;
_local1.focused = true;
Key.addListener(_local1.keyListener);
if (_local1.tabFocused) {
_local1.drawFocusRect();
}
};
FUIComponentClass.prototype.myOnKillFocus = function () {
var _local1 = this;
_local1.tabFocused = true;
_local1.focused = false;
_local1.focusRect.removeMovieClip();
Key.removeListener(_local1.keyListener);
};
FUIComponentClass.prototype.executeCallBack = function () {
var _local1 = this;
_local1.handlerObj[_local1.changeHandler](_local1);
};
FUIComponentClass.prototype.updateStyleProperty = function (styleFormat, propName) {
this.setStyleProperty(propName, styleFormat[propName], styleFormat.isGlobal);
};
FUIComponentClass.prototype.setStyleProperty = function (propName, value, isGlobal) {
var _local1 = this;
var _local2 = propName;
if (value == "") {
} else {
var tmpValue = parseInt(value);
if (!isNaN(tmpValue)) {
value = tmpValue;
}
var global = ((arguments.length > 2) ? (isGlobal) : false);
if (_local1.styleTable[_local2] == undefined) {
_local1.styleTable[_local2] = new Object();
_local1.styleTable[_local2].useGlobal = true;
}
if (_local1.styleTable[_local2].useGlobal || (!global)) {
_local1.styleTable[_local2].value = value;
if (_local1.setCustomStyleProperty(_local2, value)) {
} else if (_local2 == "embedFonts") {
_local1.invalidate("setSize");
} else if (_local2.subString(0, 4) == "text") {
if (_local1.textStyle == undefined) {
_local1.textStyle = new TextFormat();
}
var textProp = _local2.subString(4, _local2.length);
_local1.textStyle[textProp] = value;
_local1.invalidate("setSize");
} else {
for (var j in _local1.styleTable[_local2].coloredMCs) {
var _local3 = new Color(_local1.styleTable[_local2].coloredMCs[j]);
if (_local1.styleTable[_local2].value == undefined) {
var myTObj = {ra:"100", rb:"0", ga:"100", gb:"0", ba:"100", bb:"0", aa:"100", ab:"0"};
_local3.setTransform(myTObj);
} else {
_local3.setRGB(value);
}
}
}
_local1.styleTable[_local2].useGlobal = global;
}
}
};
FUIComponentClass.prototype.registerSkinElement = function (skinMCRef, propName) {
var _local1 = this;
var _local2 = propName;
if (_local1.styleTable[_local2] == undefined) {
_local1.styleTable[_local2] = new Object();
_local1.styleTable[_local2].useGlobal = true;
}
if (_local1.styleTable[_local2].coloredMCs == undefined) {
_local1.styleTable[_local2].coloredMCs = new Object();
}
_local1.styleTable[_local2].coloredMCs[skinMCRef] = skinMCRef;
if (_local1.styleTable[_local2].value != undefined) {
var _local3 = new Color(skinMCRef);
_local3.setRGB(_local1.styleTable[_local2].value);
}
};
_global.FStyleFormat = function () {
var _local1 = arguments;
var _local2 = this;
_local2.nonStyles = {listeners:true, isGlobal:true, isAStyle:true, addListener:true, removeListener:true, nonStyles:true, applyChanges:true};
_local2.listeners = new Object();
_local2.isGlobal = false;
if (_local1.length > 0) {
for (var _local3 in _local1[0]) {
_local2[_local3] = _local1[0][_local3];
}
}
};
_global.FStyleFormat.prototype = new Object();
FStyleFormat.prototype.addListener = function () {
var _local1 = this;
var _local2 = 0;
while (_local2 < arguments.length) {
var _local3 = arguments[_local2];
_local1.listeners[arguments[_local2]] = _local3;
for (var i in _local1) {
if (_local1.isAStyle(i)) {
_local3.updateStyleProperty(_local1, i.toString());
}
}
_local2++;
}
};
FStyleFormat.prototype.removeListener = function (component) {
var _local1 = this;
var _local2 = component;
_local1.listeners[_local2] = undefined;
for (var prop in _local1) {
if (_local1.isAStyle(prop)) {
if (_local2.styleTable[prop].useGlobal == _local1.isGlobal) {
_local2.styleTable[prop].useGlobal = true;
var _local3 = (_local1.isGlobal ? undefined : (globalStyleFormat[prop]));
_local2.setStyleProperty(prop, _local3, true);
}
}
}
};
FStyleFormat.prototype.applyChanges = function () {
var _local1 = this;
var _local2 = arguments;
var count = 0;
for (var i in _local1.listeners) {
var _local3 = _local1.listeners[i];
if (_local2.length > 0) {
var j = 0;
while (j < _local2.length) {
if (_local1.isAStyle(_local2[j])) {
_local3.updateStyleProperty(_local1, _local2[j]);
}
j++;
}
} else {
for (var j in _local1) {
if (_local1.isAStyle(j)) {
_local3.updateStyleProperty(_local1, j.toString());
}
}
}
}
};
FStyleFormat.prototype.isAStyle = function (name) {
return((this.nonStyles[name] ? false : true));
};
#endinitclip
Symbol 24 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 34 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 43 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "foregroundDisabled");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 44 MovieClip [UpArrow] Frame 1
stop();
Symbol 44 MovieClip [UpArrow] Frame 2
stop();
Symbol 44 MovieClip [UpArrow] Frame 3
stop();
Symbol 51 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 58 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 63 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(highlight3D_mc, "highlight3D");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
Symbol 64 MovieClip [ScrollThumb] Frame 1
stop();
Symbol 72 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 80 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 88 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "foregroundDisabled");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 89 MovieClip [DownArrow] Frame 1
stop();
Symbol 89 MovieClip [DownArrow] Frame 2
stop();
Symbol 89 MovieClip [DownArrow] Frame 3
stop();
Symbol 97 MovieClip [PlayCard] Frame 1
#initclip 10
Object.registerClass("PlayCard", PlayCard);
#endinitclip
frontCover._visible = true;
Symbol 97 MovieClip [PlayCard] Frame 4
frontCover._visible = false;
Symbol 111 MovieClip [Bagge2] Frame 65
removeMovieClip(this);
Symbol 112 MovieClip [Bagge] Frame 65
removeMovieClip(this);
Symbol 212 MovieClip [pc2] Frame 1
#initclip 11
Object.registerClass("pc2", PlayCard);
#endinitclip
Symbol 332 MovieClip Frame 1
var component = _parent;
component.registerSkinElement(track_mc, "scrollTrack");
Symbol 333 MovieClip [FScrollBarSymbol] Frame 1
#initclip 14
FScrollBarClass = function () {
var _local1 = this;
if (_local1._height == 4) {
} else {
_local1.init();
_local1.minPos = (_local1.maxPos = (_local1.pageSize = (_local1.largeScroll = 0)));
_local1.smallScroll = 1;
_local1.width = (_local1.horizontal ? (_local1._width) : (_local1._height));
_local1._xscale = (_local1._yscale = 100);
_local1.setScrollPosition(0);
_local1.tabEnabled = false;
if (_local1._targetInstanceName.length > 0) {
_local1.setScrollTarget(_local1._parent[_local1._targetInstanceName]);
}
_local1.tabChildren = false;
_local1.setSize(_local1.width);
}
};
FScrollBarClass.prototype = new FUIComponentClass();
FScrollBarClass.prototype.setHorizontal = function (flag) {
var _local1 = this;
var _local2 = flag;
if (_local1.horizontal && (!_local2)) {
_local1._xscale = 100;
_local1._rotation = 0;
} else if (_local2 && (!_local1.horizontal)) {
_local1._xscale = -100;
_local1._rotation = -90;
}
_local1.horizontal = _local2;
};
FScrollBarClass.prototype.setScrollProperties = function (pSize, mnPos, mxPos) {
var _local1 = this;
if (!_local1.enable) {
} else {
_local1.pageSize = pSize;
_local1.minPos = Math.max(mnPos, 0);
_local1.maxPos = Math.max(mxPos, 0);
_local1.scrollPosition = Math.max(_local1.minPos, _local1.scrollPosition);
_local1.scrollPosition = Math.min(_local1.maxPos, _local1.scrollPosition);
if ((_local1.maxPos - _local1.minPos) <= 0) {
_local1.scrollThumb_mc.removeMovieClip();
_local1.upArrow_mc.gotoAndStop(3);
_local1.downArrow_mc.gotoAndStop(3);
_local1.downArrow_mc.onPress = (_local1.downArrow_mc.onRelease = (_local1.downArrow_mc.onDragOut = null));
_local1.upArrow_mc.onPress = (_local1.upArrow_mc.onRelease = (_local1.upArrow_mc.onDragOut = null));
_local1.scrollTrack_mc.onPress = (_local1.scrollTrack_mc.onRelease = null);
_local1.scrollTrack_mc.onDragOut = (_local1.scrollTrack_mc.onRollOut = null);
_local1.scrollTrack_mc.useHandCursor = false;
} else {
var _local2 = _local1.getScrollPosition();
_local1.upArrow_mc.gotoAndStop(1);
_local1.downArrow_mc.gotoAndStop(1);
_local1.upArrow_mc.onPress = (_local1.upArrow_mc.onDragOver = _local1.startUpScroller);
_local1.upArrow_mc.onRelease = (_local1.upArrow_mc.onDragOut = _local1.stopScrolling);
_local1.downArrow_mc.onPress = (_local1.downArrow_mc.onDragOver = _local1.startDownScroller);
_local1.downArrow_mc.onRelease = (_local1.downArrow_mc.onDragOut = _local1.stopScrolling);
_local1.scrollTrack_mc.onPress = (_local1.scrollTrack_mc.onDragOver = _local1.startTrackScroller);
_local1.scrollTrack_mc.onRelease = _local1.stopScrolling;
_local1.scrollTrack_mc.onDragOut = _local1.stopScrolling;
_local1.scrollTrack_mc.onRollOut = _local1.stopScrolling;
_local1.scrollTrack_mc.useHandCursor = false;
_local1.attachMovie("ScrollThumb", "scrollThumb_mc", 3);
_local1.scrollThumb_mc._x = 0;
_local1.scrollThumb_mc._y = _local1.upArrow_mc._height;
_local1.scrollThumb_mc.onPress = _local1.startDragThumb;
_local1.scrollThumb_mc.controller = _local1;
_local1.scrollThumb_mc.onRelease = (_local1.scrollThumb_mc.onReleaseOutside = _local1.stopDragThumb);
_local1.scrollThumb_mc.useHandCursor = false;
_local1.thumbHeight = (_local1.pageSize / ((_local1.maxPos - _local1.minPos) + _local1.pageSize)) * _local1.trackSize;
_local1.thumbMid_mc = _local1.scrollThumb_mc.mc_sliderMid;
_local1.thumbTop_mc = _local1.scrollThumb_mc.mc_sliderTop;
_local1.thumbBot_mc = _local1.scrollThumb_mc.mc_sliderBot;
_local1.thumbHeight = Math.max(_local1.thumbHeight, 6);
_local1.midHeight = (_local1.thumbHeight - _local1.thumbTop_mc._height) - _local1.thumbBot_mc._height;
_local1.thumbMid_mc._yScale = (_local1.midHeight * 100) / _local1.thumbMid_mc._height;
_local1.thumbMid_mc._y = _local1.thumbTop_mc._height;
_local1.thumbBot_mc._y = _local1.thumbTop_mc._height + _local1.midHeight;
_local1.scrollTop = _local1.scrollThumb_mc._y;
_local1.trackHeight = _local1.trackSize - _local1.thumbHeight;
_local1.scrollBot = _local1.trackHeight + _local1.scrollTop;
_local2 = Math.min(_local2, _local1.maxPos);
_local1.setScrollPosition(Math.max(_local2, _local1.minPos));
}
}
};
FScrollBarClass.prototype.getScrollPosition = function () {
return(this.scrollPosition);
};
FScrollBarClass.prototype.setScrollPosition = function (pos) {
var _local1 = this;
var _local2 = pos;
_local1.scrollPosition = _local2;
if (_local1.scrollThumb_mc != undefined) {
_local2 = Math.min(_local2, _local1.maxPos);
_local2 = Math.max(_local2, _local1.minPos);
}
_local1.scrollThumb_mc._y = (((_local2 - _local1.minPos) * _local1.trackHeight) / (_local1.maxPos - _local1.minPos)) + _local1.scrollTop;
_local1.executeCallBack();
};
FScrollBarClass.prototype.setLargeScroll = function (lScroll) {
this.largeScroll = lScroll;
};
FScrollBarClass.prototype.setSmallScroll = function (sScroll) {
this.smallScroll = sScroll;
};
FScrollBarClass.prototype.setEnabled = function (enabledFlag) {
var _local1 = this;
var _local2 = enabledFlag;
var _local3 = _local1.enable;
if (_local2 && (!_local3)) {
_local1.enable = _local2;
if (_local1.textField != undefined) {
_local1.setScrollTarget(_local1.textField);
} else {
_local1.setScrollProperties(_local1.pageSize, _local1.cachedMinPos, _local1.cachedMaxPos);
_local1.setScrollPosition(_local1.cachedPos);
}
_local1.clickFilter = undefined;
} else if ((!_local2) && (_local3)) {
_local1.textField.removeListener(_local1);
_local1.cachedPos = _local1.getScrollPosition();
_local1.cachedMinPos = _local1.minPos;
_local1.cachedMaxPos = _local1.maxPos;
if (_local1.clickFilter == undefined) {
_local1.setScrollProperties(_local1.pageSize, 0, 0);
} else {
_local1.clickFilter = true;
}
_local1.enable = _local2;
}
};
FScrollBarClass.prototype.setSize = function (hgt) {
var _local1 = this;
if (_local1._height == 1) {
} else {
_local1.width = hgt;
_local1.scrollTrack_mc._yscale = 100;
_local1.scrollTrack_mc._yscale = (100 * _local1.width) / _local1.scrollTrack_mc._height;
if (_local1.upArrow_mc == undefined) {
_local1.attachMovie("UpArrow", "upArrow_mc", 1);
_local1.attachMovie("DownArrow", "downArrow_mc", 2);
_local1.downArrow_mc.controller = (_local1.upArrow_mc.controller = _local1);
_local1.upArrow_mc.useHandCursor = (_local1.downArrow_mc.useHandCursor = false);
_local1.upArrow_mc._x = (_local1.upArrow_mc._y = 0);
_local1.downArrow_mc._x = 0;
}
_local1.scrollTrack_mc.controller = _local1;
_local1.downArrow_mc._y = _local1.width - _local1.downArrow_mc._height;
_local1.trackSize = _local1.width - (2 * _local1.downArrow_mc._height);
if (_local1.textField != undefined) {
_local1.onTextChanged();
} else {
_local1.setScrollProperties(_local1.pageSize, _local1.minPos, _local1.maxPos);
}
}
};
FScrollBarClass.prototype.scrollIt = function (inc, mode) {
var _local1 = this;
var _local3 = _local1.smallScroll;
if (inc != "one") {
_local3 = ((_local1.largeScroll == 0) ? (_local1.pageSize) : (_local1.largeScroll));
}
var _local2 = _local1.getScrollPosition() + (mode * _local3);
if (_local2 > _local1.maxPos) {
_local2 = _local1.maxPos;
} else if (_local2 < _local1.minPos) {
_local2 = _local1.minPos;
}
_local1.setScrollPosition(_local2);
};
FScrollBarClass.prototype.startDragThumb = function () {
var _local1 = this;
_local1.lastY = _local1._ymouse;
_local1.onMouseMove = _local1.controller.dragThumb;
};
FScrollBarClass.prototype.dragThumb = function () {
var _local1 = this;
_local1.scrollMove = _local1._ymouse - _local1.lastY;
_local1.scrollMove = _local1.scrollMove + _local1._y;
if (_local1.scrollMove < _local1.controller.scrollTop) {
_local1.scrollMove = _local1.controller.scrollTop;
} else if (_local1.scrollMove > _local1.controller.scrollBot) {
_local1.scrollMove = _local1.controller.scrollBot;
}
_local1._y = _local1.scrollMove;
var _local2 = _local1.controller;
_local2.scrollPosition = Math.round(((_local2.maxPos - _local2.minPos) * (_local1._y - _local2.scrollTop)) / _local2.trackHeight) + _local2.minPos;
_local1.controller.isScrolling = true;
updateAfterEvent();
_local1.controller.executeCallBack();
};
FScrollBarClass.prototype.stopDragThumb = function () {
this.controller.isScrolling = false;
this.onMouseMove = null;
};
FScrollBarClass.prototype.startTrackScroller = function () {
var _local1 = this;
_local1.controller.trackScroller();
_local1.controller.scrolling = setInterval(_local1.controller, "scrollInterval", 500, "page", -1);
};
FScrollBarClass.prototype.scrollInterval = function (inc, mode) {
var _local1 = this;
var _local2 = inc;
clearInterval(_local1.scrolling);
if (_local2 == "page") {
_local1.trackScroller();
} else {
_local1.scrollIt(_local2, mode);
}
_local1.scrolling = setInterval(_local1, "scrollInterval", 35, _local2, mode);
};
FScrollBarClass.prototype.trackScroller = function () {
var _local1 = this;
if ((_local1.scrollThumb_mc._y + _local1.thumbHeight) < _local1._ymouse) {
_local1.scrollIt("page", 1);
} else if (_local1.scrollThumb_mc._y > _local1._ymouse) {
_local1.scrollIt("page", -1);
}
};
FScrollBarClass.prototype.stopScrolling = function () {
var _local1 = this;
_local1.controller.downArrow_mc.gotoAndStop(1);
_local1.controller.upArrow_mc.gotoAndStop(1);
clearInterval(_local1.controller.scrolling);
};
FScrollBarClass.prototype.startUpScroller = function () {
var _local1 = this;
_local1.controller.upArrow_mc.gotoAndStop(2);
_local1.controller.scrollIt("one", -1);
_local1.controller.scrolling = setInterval(_local1.controller, "scrollInterval", 500, "one", -1);
};
FScrollBarClass.prototype.startDownScroller = function () {
var _local1 = this;
_local1.controller.downArrow_mc.gotoAndStop(2);
_local1.controller.scrollIt("one", 1);
_local1.controller.scrolling = setInterval(_local1.controller, "scrollInterval", 500, "one", 1);
};
FScrollBarClass.prototype.setScrollTarget = function (tF) {
var _local1 = this;
var _local2 = tF;
if (_local2 == undefined) {
_local1.textField.removeListener(_local1);
delete _local1.textField[(_local1.horizontal ? "hScroller" : "vScroller")];
if ((_local1.textField.hScroller != undefined) && (_local1.textField.vScroller != undefined)) {
_local1.textField.unwatch("text");
_local1.textField.unwatch("htmltext");
}
}
_local1.textField = undefined;
if (!(_local2 instanceof TextField)) {
} else {
_local1.textField = _local2;
_local1.textField[(_local1.horizontal ? "hScroller" : "vScroller")] = _local1;
_local1.onTextChanged();
_local1.onChanged = function () {
this.onTextChanged();
};
_local1.onScroller = function () {
var _local1 = this;
if (!_local1.isScrolling) {
if (!_local1.horizontal) {
_local1.setScrollPosition(_local1.textField.scroll);
} else {
_local1.setScrollPosition(_local1.textField.hscroll);
}
}
};
_local1.textField.addListener(_local1);
_local1.textField.watch("text", _local1.callback);
_local1.textField.watch("htmlText", _local1.callback);
}
};
FScrollBarClass.prototype.callback = function (prop, oldVal, newVal) {
var _local1 = this;
clearInterval(_local1.hScroller.synchScroll);
clearInterval(_local1.vScroller.synchScroll);
_local1.hScroller.synchScroll = setInterval(_local1.hScroller, "onTextChanged", 50);
_local1.vScroller.synchScroll = setInterval(_local1.vScroller, "onTextChanged", 50);
return(newVal);
};
FScrollBarClass.prototype.onTextChanged = function () {
var _local1 = this;
if ((!_local1.enable) || (_local1.textField == undefined)) {
} else {
clearInterval(_local1.synchScroll);
if (_local1.horizontal) {
var _local2 = _local1.textField.hscroll;
_local1.setScrollProperties(_local1.textField._width, 0, _local1.textField.maxhscroll);
_local1.setScrollPosition(Math.min(_local2, _local1.textField.maxhscroll));
} else {
var _local2 = _local1.textField.scroll;
var _local3 = _local1.textField.bottomScroll - _local1.textField.scroll;
_local1.setScrollProperties(_local3, 1, _local1.textField.maxscroll);
_local1.setScrollPosition(Math.min(_local2, _local1.textField.maxscroll));
}
}
};
FScrollBarClass.prototype.executeCallBack = function () {
var _local1 = this;
if (_local1.textField == undefined) {
super.executeCallBack();
} else if (_local1.horizontal) {
_local1.textField.hscroll = _local1.getScrollPosition();
} else {
_local1.textField.scroll = _local1.getScrollPosition();
}
};
Object.registerClass("FScrollBarSymbol", FScrollBarClass);
#endinitclip
Symbol 334 MovieClip [Game] Frame 1
#initclip 12
Object.registerClass("Game", Game);
#endinitclip
Symbol 422 MovieClip [__Packages.Movable] Frame 0
class Movable extends MovieClip
{
var doAnimate_, onMoveEndListener_;
function Movable () {
super();
doAnimate_ = false;
onMoveEndListener_ = null;
}
function onFrameEntered() {
var _local1 = this;
if (_local1.doAnimate_) {
if (_local1.startTime_ == null) {
_local1.startTime_ = getTimer();
}
var _local3 = _local1.targetX_;
var _local2 = _local1.targetY_;
var deltaX = (_local3 - _local1.startX_);
var deltaY = (_local2 - _local1.startY_);
if (_local1.algorithm_ == "cubic_out") {
var dx = Math.round(_local1.easeOutCubic(getTimer() - _local1.startTime_, _local1.startX_, deltaX, _local1.duration_));
var dy = Math.round(_local1.easeOutCubic(getTimer() - _local1.startTime_, _local1.startY_, deltaY, _local1.duration_));
} else if (_local1.algorithm_ == "easeInQuad") {
var dx = Math.round(_local1.easeInQuad(getTimer() - _local1.startTime_, _local1.startX_, deltaX, _local1.duration_));
var dy = Math.round(_local1.easeInQuad(getTimer() - _local1.startTime_, _local1.startY_, deltaY, _local1.duration_));
} else if (_local1.algorithm_ == "easeOutElastic") {
var dx = Math.round(_local1.easeOutElastic(getTimer() - _local1.startTime_, _local1.startX_, deltaX, _local1.duration_));
var dy = Math.round(_local1.easeOutElastic(getTimer() - _local1.startTime_, _local1.startY_, deltaY, _local1.duration_));
}
_local1._x = dx;
_local1._y = dy;
if ((Math.abs(_local1._x - _local3) < 2) && (Math.abs(_local1._y - _local2) < 2)) {
_local1.startTime_ = null;
_local1._x = _local3;
_local1._y = _local2;
_local1.doAnimate_ = false;
if (_local1.onMoveEndListener_ != null) {
_local1.onMoveEndListener_.moved(_local1);
}
}
}
}
function setMoveEndListener(list) {
onMoveEndListener_ = list;
}
function animate(targetX, targetY, duration) {
var _local1 = this;
_local1.targetX_ = targetX;
_local1.targetY_ = targetY;
_local1.startX_ = _local1._x;
_local1.startY_ = _local1._y;
_local1.duration_ = duration;
_local1.doAnimate_ = true;
_local1.startTime_ = null;
_local1.algorithm_ = "cubic_out";
}
function easeInQuad(t, b, c, d) {
var _local1 = d;
var _local2 = t;
if (_local2 > _local1) {
_local2 = _local1;
}
return((((c * _local2) * _local2) / (_local1 * _local1)) + b);
}
function easeOutQuad(t, b, c, d) {
var _local1 = d;
var _local2 = t;
if (_local2 > _local1) {
_local2 = _local1;
}
return((((((-c) * _local2) * _local2) / (_local1 * _local1)) + (((2 * c) * _local2) / _local1)) + b);
}
function easeOutCubic(t, b, c, d) {
var _local1 = t;
var _local2 = d;
if (_local1 > _local2) {
_local1 = _local2;
}
_local1 = (_local1 / _local2) - 1;
return((c * (((_local1 * _local1) * _local1) + 1)) + b);
}
function easeOutQuart(t, b, c, d) {
var _local1 = t;
var _local2 = d;
if (_local1 > _local2) {
_local1 = _local2;
}
_local1 = (_local1 / _local2) - 1;
return(((-c) * ((((_local1 * _local1) * _local1) * _local1) - 1)) + b);
}
function easeOutElastic(t, b, c, d, a, p) {
var _local1 = c;
var _local2 = p;
var _local3 = t;
if (_local3 == 0) {
return(b);
}
_local3 = _local3 / d;
if (_local3 == 1) {
return(b + _local1);
}
if (!_local2) {
_local2 = d * 0.3;
}
if (a < Math.abs(_local1)) {
a = _local1;
var s = (_local2 / 4);
} else {
var s = ((_local2 / (Math.PI*2)) * Math.asin(_local1 / a));
}
return((((a * Math.pow(2, -10 * _local3)) * Math.sin((((_local3 * d) - s) * (Math.PI*2)) / _local2)) + _local1) + b);
}
}
Symbol 423 MovieClip [__Packages.PlayCard] Frame 0
class PlayCard extends Movable
{
var id_, label, value, row, children, parents, isOpponent, onFrameEntered, gotoAndStop, behavior;
function PlayCard () {
var _local1 = this;
super();
_local1.label = null;
_local1.value = null;
_local1.row = null;
}
function initialize(lbl, val, id) {
var _local1 = this;
_local1.id_ = id;
_local1.label = lbl;
_local1.value = val;
_local1.frontCover.attachMovie(_local1.label, "frontCover", 1);
_local1.clickListener = null;
_local1.children = new Array();
_local1.parents = new Array();
}
function getId() {
return(id_);
}
function getLabel() {
return(label);
}
function getValue() {
return(value);
}
function getRow() {
return(row);
}
function setIsOpponent(value) {
var _local1 = this;
_local1.isOpponent = value;
if (_local1.isOpponent) {
_local1.useHandCursor = false;
}
}
function setRow(row) {
this.row = row;
}
function addChild(child) {
children.push(child);
child.addParent(this);
}
function addParent(parent) {
parents.push(parent);
}
function hasChildren() {
return(children.length != 0);
}
function removeChild(child) {
var _local2 = this;
var _local3 = child;
var _local1 = 0;
while (_local1 < _local2.children.length) {
if (_local2.children[_local1]._name == _local3._name) {
_local2.children.splice(_local1, 1);
return;
}
_local1++;
}
}
function removeFromParents() {
var _local2 = this;
var _local1 = 0;
while (_local1 < _local2.parents.length) {
_local2.parents[_local1].removeChild(_local2);
_local1++;
}
}
function isOpen() {
if (isOpponent) {
return(false);
}
if (!hasChildren()) {
return(true);
}
return(false);
}
function onEnterFrame() {
onFrameEntered();
}
function onRelease() {
var _local1 = this;
if ((!Game.getRound().started()) || (Game.getRound().ended())) {
} else {
if (_local1.behavior == "foundation") {
if (_local1.isOpen()) {
var _local2 = Game.getRound().TOP_CARD;
if (_local1.compare(_local2)) {
if (_local1.getRow() == 4) {
Communicator.sendScarabRemoved(_local1.label.substring(1, _local1.label.length), _local2.getId(), Game.getTimeLeft());
return;
}
if (_local1.getValue() != -1) {
Communicator.sendCardRemoved(_local1.label.substring(1, _local1.label.length));
}
_local1.onValidClick(Game.getTimeLeft(), _local2.getId());
} else {
Game.getRound().wrongClick(_local1);
}
}
}
if (_local1.behavior == "topstack") {
_level0.snd_turncard.start();
_local1.gotoAndStop(1);
if (_local1.getDepth() < Game.getRound().TOP_CARD.getDepth()) {
_local1.swapDepths(Game.getRound().TOP_CARD);
}
Game.getRound().PREVIOUS_TOP_CARD = Game.getRound().TOP_CARD;
Game.getRound().TOP_CARD = _local1;
var evt = new Object();
evt._self = _local1;
evt.moved = function (ref) {
evt._self.onMovedToStack(ref);
};
_local1.setMoveEndListener(evt);
_local1.animate(Game.getRound().STACK_X, Game.getRound().STACK_Y, 50);
_local1.setBehaviour("openstack");
Game.report("playData", (("824," + _local1.getId()) + "=") + getTimer());
Game.getRound().NUM_CARDS_HIDDEN--;
Game.getRound().updateStatusInfo();
Game.getRound().anymoreMoves();
}
}
}
function onRollOver() {
var _local1 = this;
if (!Game.getRound().started()) {
} else if (_local1.behavior == "foundation") {
if (_local1.isOpen()) {
_local1.gotoAndStop(2);
}
}
}
function onRollOut() {
var _local1 = this;
if (!Game.getRound().started()) {
} else if (_local1.behavior == "foundation") {
if (_local1.isOpen()) {
_local1.gotoAndStop(1);
}
}
}
function onLoad() {
gotoAndStop(4);
}
function setBehaviour(behave) {
behavior = behave;
}
function getBehaviour() {
return(behavior);
}
function onValidClick(timeLeft, usedCardId) {
var _local1 = this;
_local1.onRollOver = null;
_local1.onRelease = null;
if (_local1.getDepth() < Game.getRound().TOP_CARD.getDepth()) {
_local1.swapDepths(Game.getRound().TOP_CARD);
}
Game.getRound().PREVIOUS_TOP_CARD = Game.getRound().TOP_CARD;
Game.getRound().TOP_CARD = _local1;
_local1.onTable = false;
Game.getRound().cardCleared(_local1, usedCardId, timeLeft);
var evt = new Object();
evt._self = _local1;
evt.moved = function (ref) {
evt._self.onMovedToStack(ref);
};
_local1.setMoveEndListener(evt);
_local1.animate(Game.getRound().STACK_X, Game.getRound().STACK_Y, 250);
_local1.removeFromParents();
Game.getRound().anymoreMoves();
}
function onValidOpponentClick(timeLeft) {
var _local1 = this;
_local1.onTable = false;
Game.getRound().opponentCardCleared(_local1, timeLeft);
var evt = new Object();
evt._self = _local1;
evt.moved = function (ref) {
evt._self.removeMovieClip();
};
_local1.setMoveEndListener(evt);
_local1.animate(Game.getRound().STACK_X, Game.getRound().STACK_Y - 400, 250);
_local1.removeFromParents();
}
function onMovedToStack(ref) {
if (Game.getRound().PREVIOUS_TOP_CARD != null) {
Game.getRound().PREVIOUS_TOP_CARD._visible = false;
ref.gotoAndStop(1);
}
}
function compare(comp) {
if ((getValue() > -1) && (comp.getValue() > -1)) {
var _local1 = Math.abs(getValue() - comp.getValue());
if ((_local1 == 1) || (_local1 == 12)) {
return(true);
}
return(false);
}
return(true);
}
}
Symbol 424 MovieClip [__Packages.Player] Frame 0
class Player
{
var playerNum_, username_, avatarString_, scoreTotal_, scoreRound_, scarabsTotal_, scarabsRound_, moreMoves_, roundEnded_, exitGame_;
function Player () {
var _local1 = this;
_local1.scoreTotal_ = 0;
_local1.scoreRound_ = 0;
_local1.scarabsTotal_ = 0;
_local1.scarabsRound_ = 0;
}
function getPlayerNum() {
return(playerNum_);
}
function setPlayerNum(playerNum) {
playerNum_ = playerNum;
}
function getUsername() {
return(username_);
}
function setUsername(username) {
username_ = username;
}
function getAvatarString() {
return(avatarString_);
}
function setAvatarString(avatarString) {
avatarString_ = avatarString;
}
function getScoreTotal() {
return(scoreTotal_);
}
function getScoreRound() {
return(scoreRound_);
}
function getScarabsTotal() {
return(scarabsTotal_);
}
function getScarabsRound() {
return(scarabsRound_);
}
function newRound() {
var _local1 = this;
_local1.scoreRound_ = 0;
_local1.scarabsRound_ = 0;
_local1.roundEnded_ = false;
_local1.moreMoves_ = true;
}
function addScore(score) {
var _local1 = this;
_local1.scoreTotal_ = _local1.scoreTotal_ + score;
_local1.scoreRound_ = _local1.scoreRound_ + score;
if (_local1.scoreTotal_ < 0) {
_local1.scoreTotal_ = 0;
_local1.scoreRound_ = 0;
}
}
function addScarab() {
scarabsTotal_ = scarabsTotal_ + 1;
scarabsRound_ = scarabsRound_ + 1;
}
function setNoMoreMoves() {
moreMoves_ = false;
roundEnded_ = true;
}
function setRoundEnded() {
roundEnded_ = true;
}
function isRoundEnded() {
return(roundEnded_);
}
function hasMoreMoves() {
return(moreMoves_);
}
function setExitGame() {
var _local1 = this;
_local1.scoreTotal_ = 0;
_local1.scarabsTotal_ = 0;
_local1.exitGame_ = true;
}
function getExitGame() {
return(exitGame_);
}
function hasExitGame() {
return(exitGame_);
}
function setConnected(c) {
connected_ = c;
}
function isConnected() {
return(connected_);
}
function setAvatar(avatar) {
avatar_ = avatar;
}
function getAvatar() {
return(avatar_);
}
function setMood(mood) {
if (_level0.chatbox.getBytesLoaded() == _level0.chatbox.getBytesTotal()) {
_level0.chatbox.setMood(avatar_, mood);
}
}
var avatar_ = null;
var connected_ = false;
}
Symbol 425 MovieClip [__Packages.Game] Frame 0
class Game extends MovieClip
{
static var timeLimit_, getplayer;
function Game () {
super();
}
static function getPlayer() {
return(player_);
}
static function getOpponent() {
return(opponent_);
}
static function getTimeLimit() {
return(timeLimit_);
}
function init(gameData) {
var _local1 = this;
_local1.parseGameData(gameData);
_local1.initChatBox();
initTimer();
_local1.initLabels();
_local1.initSounds();
_local1.initCommunication();
}
function initCommunication() {
var _local1 = this;
pingIntervalId_ = setInterval(_local1, "ping", 5000);
Communicator.onClientAccepted = _local1.clientAccepted;
Communicator.onAnotherClientAccepted = _local1.anotherClientAccepted;
Communicator.onPlayerDisconnect = _local1.playerDisconnect;
Communicator.onOpponentDisconnect = _local1.opponentDisconnect;
Communicator.onStartGame = _local1.onStartGame;
Communicator.doConnect();
}
static function initTimer() {
timer_ = new Timer();
timer_.setTime(timeLimit_);
var t = setInterval(timer_, "onTimerEvent", 1000);
}
function initChatBox() {
System.security.allowDomain(_root.gameDomain);
_level0.createEmptyMovieClip("chatbox", 1911);
_level0.CHATCONTROL_ALLOW_DOMAIN = _root.gameDomain;
_level0.chatbox.loadMovie("/ctl/ChatControl.swf");
}
function initLabels() {
var _local1 = _root;
_local1.txt_timeleft = I18n.getLabel("timeleft");
_local1.txt_score = I18n.getLabel("score");
_local1.txt_scarabs = I18n.getLabel("round_results_scarabs");
_local1.txt_total_score = I18n.getLabel("round_results_total_score");
_local1.txt_start_game = I18n.getLabel("start_game");
_local1.txt_exit_game = I18n.getLabel("exit_game");
_local1.txt_instructions_header = I18n.getLabel("instructions_header");
_local1.txt_instructions = I18n.getLabel("instructions");
_local1.txt_connectstatus = I18n.getLabel("waiting_for_opponent_to_connect");
}
function initSounds() {
_level0.snd_cardcleared = new Sound();
_level0.snd_cardcleared.attachSound("SndCardClick");
_level0.snd_turncard = new Sound();
_level0.snd_turncard.attachSound("SndCardFromHand");
_level0.snd_scarab = new Sound();
_level0.snd_scarab.attachSound("SndScarab");
_level0.snd_intro = new Sound();
_level0.snd_intro.attachSound("SndIntro");
_level0.snd_startRound = new Sound();
_level0.snd_startRound.attachSound("SndRound");
_level0.snd_endRound = new Sound();
_level0.snd_endRound.attachSound("SndEndRound");
_level0.snd_endGame = new Sound();
_level0.snd_endGame.attachSound("SndEndGame");
_level0.snd_joker = new Sound();
_level0.snd_joker.attachSound("SndJoker");
_level0.snd_timeout = new Sound();
_level0.snd_timeout.attachSound("SndTimeOut");
_level0.snd_endplate = new Sound();
_level0.snd_endplate.attachSound("SndEndPlate");
_level0.snd_shuffle = new Sound();
_level0.snd_shuffle.attachSound("SndShuffle");
}
function parseGameData(myData) {
debug("parsing gamedata");
var parser = new XML();
parser.ignoreWhite = true;
parser.parseXML(myData);
var gData = parser.firstChild;
if (gData.nodeName == "gamedata") {
timeLimit_ = gData.attributes.timelimit;
var _local1 = gData.firstChild;
while (_local1 != null) {
if (_local1.nodeName == "multiplayer") {
var hostname = _local1.attributes.hostname;
var port = Number(_local1.attributes.port);
var _local3 = _local1.attributes.slotid;
var magic = _local1.attributes.magic;
Communicator.init(hostname, port, _local3, magic);
}
if (_local1.nodeName == "cards") {
var cardVals = _local1.attributes.value;
addDeck(cardVals);
} else if (_local1.nodeName == "text") {
var _local2 = new Array();
var lbl = String(_local1.attributes.id);
var txt = String(_local1.firstChild);
_local2.push(lbl);
_local2.push(txt);
I18n.addLabel(_local2);
}
_local1 = _local1.nextSibling;
}
}
}
static function formatTimeLeft(lft) {
var _local1 = lft / 60;
_local1 = Math.floor(_local1);
var _local2 = lft - (_local1 * 60);
if (_local2 < 10) {
_local2 = "0" + _local2;
}
return((_local1 + ":") + _local2);
}
static function updateTimeLeft(lft) {
var _local1 = lft;
if (_local1 <= 10) {
if ((_local1 != _level0.lastPlaySec) && (_local1 != 0)) {
_level0.snd_timeout.start();
_level0.lastPlaySec = _local1;
}
}
_level0.txtTimeLeft.text = formatTimeLeft(_local1);
}
static function roundEnded() {
var _local1 = _root;
if (getPlayer().hasExitGame() || (getOpponent().hasExitGame())) {
} else {
closeDialog();
timer_.stopTimer();
avatarPlayer_.hide();
avatarOpponent_.hide();
if (getRound() != null) {
report("playData", "1523,8=" + getPlayer().getScoreTotal());
}
if (getOpponent().getScarabsTotal() == NUM_SCARABS_NEEDED) {
gameOver();
} else if (getPlayer().getScarabsTotal() == NUM_SCARABS_NEEDED) {
gameOver();
} else if (ROUND_ID < MAX_ROUNDS) {
debug("round ended");
_level0.snd_endRound.start();
evt = new Object();
evt.timeLeft = 5;
_local1.nextroundtime = I18n.getLabelReplace("round_results_next_round_starts", evt.timeLeft);
evt.onEvent = function () {
_root.nextroundtime = I18n.getLabelReplace("round_results_next_round_starts", evt.timeLeft);
evt.timeLeft--;
if (evt.timeLeft < 0) {
clearInterval(this.intervalID);
_root.gotoAndPlay("_root.lblNextRound");
}
};
evt.intervalID = setInterval(evt, "onEvent", 1000);
_local1.gotoAndPlay("_root.lblRoundResults");
} else {
gameOver();
}
}
}
static function exitGame() {
timer_.stopTimer();
if (getOpponent().hasExitGame()) {
debug("exitGame-opponent has already exit");
return(undefined);
}
report("playData", "0");
Communicator.sendExitGame();
getPlayer().setExitGame();
gameOver();
}
static function gameOver() {
//var _local1 = this;
if (gameEnded_ == true) {
debug("-- game already ended");
} else {
gameEnded_ = true;
_level0.snd_endGame.start();
closeDialog();
getRound().clear();
avatarPlayer_.hide();
avatarOpponent_.hide();
_root.gotoAndPlay("_root.lblGameOver");
debug("game over event");
clearInterval(pingIntervalId_);
Communicator.sendGameOver();
evt2 = new Object();
evt.sentGameOver = false;
evt2.onEvent = function () {
var _local1 = this;
clearInterval(_local1.intervalID);
if (_local1.sentGameOver) {
}
_local1.sentGameOver = true;
points = Game.getPlayer().getScoreTotal();
if (Game.getPlayer().getScarabsTotal() != Game.getOpponent().getScarabsTotal()) {
points = Game.getPlayer().getScarabsTotal();
}
if (Game.getOpponent().hasExitGame()) {
points = 1000;
}
if ((!Game.getOpponent().isConnected()) && (Game.gameStarted())) {
points = 1000;
}
if ((!Game.getOpponent().isConnected()) && (!Game.gameStarted())) {
points = 0;
}
if (!Game.getPlayer().isConnected()) {
points = 0;
}
Game.report("gameOver", points);
_local1 = _local1.stop();
};
evt2.intervalID = setInterval(evt2, "onEvent", 3500);
}
}
static function gameStarted() {
return(gameStarted_);
}
static function gameEnded() {
return(gameEnded_);
}
function startGame() {
_root.gameStartGamePressed = true;
if (getPlayer().isConnected() && (getOpponent().isConnected())) {
debug("game started");
debug(("player: " + (player_.getPlayerNum() + 1)) + player_.getUsername());
debug(("opponent: " + (opponent_.getPlayerNum() + 1)) + opponent_.getUsername());
_root.gotoAndPlay("lblStartGame");
} else {
debug("Got startgame after a player disconnected");
}
}
static function startRound() {
if (getPlayer().hasExitGame() || (getOpponent().hasExitGame())) {
return(undefined);
}
closeDialog();
getRound().openRound();
}
static function setAvatarMoods() {
if (getPlayer().getScarabsTotal() > getOpponent().getScarabsTotal()) {
getPlayer().setMood("happy");
getOpponent().setMood("neutral");
} else if (getPlayer().getScarabsTotal() < getOpponent().getScarabsTotal()) {
getPlayer().setMood("neutral");
getOpponent().setMood("happy");
} else if (getPlayer().getScoreTotal() > getOpponent().getScoreTotal()) {
getPlayer().setMood("happy");
getOpponent().setMood("neutral");
} else if (getPlayer().getScoreTotal() < getOpponent().getScoreTotal()) {
getPlayer().setMood("neutral");
getOpponent().setMood("happy");
} else {
getPlayer().setMood("happy");
getOpponent().setMood("happy");
}
}
function nextRound() {
if (getPlayer().hasExitGame() || (getOpponent().hasExitGame())) {
} else {
debug("nextRound called");
updateTimeLeft(getTimeLimit());
debug(getPlayer().getAvatarString());
debug(getOpponent().getAvatarString());
if (getPlayer().getAvatar() == null) {
avatarPlayer_ = _level0.chatbox.getAvatar(0, getPlayer().getAvatarString(), 10, 260, true);
getPlayer().setAvatar(avatarPlayer_);
}
if (getOpponent().getAvatar() == null) {
avatarOpponent_ = _level0.chatbox.getAvatar(1, getOpponent().getAvatarString(), 10, 146, false);
getOpponent().setAvatar(avatarOpponent_);
}
setAvatarMoods();
avatarPlayer_.show();
avatarOpponent_.show();
initTimer();
getPlayer().newRound();
getOpponent().newRound();
var _local1 = new GameRound();
_local1.setRoundId(ROUND_ID);
CURRENT_ROUND = _local1;
ROUND_ID++;
_level0.roundId.text = ROUND_ID;
var _local2 = getNextDeck();
_local1.setDeck(_local2);
_local1.generateCards();
_local1.linkAndInitCards();
obj = new Object();
obj.callback = function () {
Game.debug("interval");
if (Game.getPlayer().hasExitGame() || (Game.getOpponent().hasExitGame())) {
} else {
Communicator.sendNextRound();
}
clearInterval(this.intervalID);
};
obj.intervalID = setInterval(obj, "callback", 1200);
}
}
static function startTimer() {
timer_.startTimer();
}
static function stopTimer() {
timer_.stopTimer();
}
static function getTimeLeft() {
return(timer_.getTime());
}
static function getRound() {
return(CURRENT_ROUND);
}
static function addDeck(data) {
var c = data.split("_");
var deck = new Array();
var _local3 = 0;
while (_local3 < c.length) {
var _local1 = c[_local3].toLowerCase();
var val = _local1.substring(1, _local1.length);
var _local2 = new Array();
_local2.push(val);
_local2.push(_local1);
deck.push(_local2);
_local3++;
}
decks.push(deck);
}
static function getDecks() {
return(decks);
}
static function getNextDeck() {
deckId++;
return(decks[deckId]);
}
static function openDialog(txt, txt2, useSound) {
closeDialog();
if (useSound) {
_level0.snd_endplate.start();
}
_level0.attachMovie("dialog", "dialog", 2000);
_level0.dialog.txtdialog.text = txt;
_level0.dialog.txtdialog2.text = txt2;
_level0.dialog._x = 190;
_level0.dialog._y = 200;
}
static function closeDialog() {
_level0.dialog.removeMovieClip();
}
static function rnd(lowNumber, highNumber) {
var _local3 = highNumber - lowNumber;
var _local2 = Math.random() * _local3;
var _local1 = Math.round(_local2);
_local1 = _local1 + lowNumber;
return(_local1);
}
function clientAccepted(playerNum, username, avatar) {
player_.setPlayerNum(playerNum);
player_.setUsername(username);
player_.setAvatarString(avatar);
_level0.snd_intro.start();
player_.setConnected(true);
_root.txt_player_username = username.toUpperCase();
_root.gotoAndPlay("_root.lblWaitForOpponent");
}
function anotherClientAccepted(playerNum, username, avatar) {
opponent_.setPlayerNum(playerNum);
opponent_.setUsername(username);
opponent_.setAvatarString(avatar);
_root.txt_opponent_username = username.toUpperCase();
_root.txt_connectstatus = I18n.getLabel("opponent_connect");
debug("another player connected");
opponent_.setConnected(true);
}
function playerDisconnect() {
var _local1 = this;
timer_.stopTimer();
debug("playerDisconnect");
report("playData", "990");
if (gameStarted_) {
debug("-game started");
getPlayer().setConnected(false);
getPlayer().setExitGame();
getRound().clear();
openDialog(I18n.getLabel("local_disconnect"), "", true);
playerDisconnectEvent = new Object();
playerDisconnectEvent.callback = function () {
Game.debug("--interval");
clearInterval(this.intervalID);
Game.gameOver();
};
playerDisconnectEvent.intervalID = setInterval(playerDisconnectEvent, "callback", 3000);
} else {
(_local1.stop());// not popped
debug("-game not started");
getPlayer().setConnected(false);
getPlayer().setExitGame();
getRound().clear();
openDialog(I18n.getLabel("local_disconnect"), "", true);
playerDisconnectEvent = new Object();
playerDisconnectEvent.callback = function () {
Game.debug("--interval");
clearInterval(this.intervalID);
Game.gameOver();
};
playerDisconnectEvent.intervalID = setInterval(playerDisconnectEvent, "callback", 3000);
}
}
function opponentDisconnect() {
var _local1 = this;
timer_.stopTimer();
if (getOpponent().hasExitGame()) {
debug("-opponent has exit");
} else if (gameEnded_) {
debug("-game ended");
} else {
debug("opponentDisconnect");
report("playData", "991");
if (gameStarted_) {
debug("-game started");
getOpponent().setConnected(false);
getOpponent().setExitGame();
getRound().clear();
openDialog(I18n.getLabel("opponent_disconnect"), "", true);
opponentDisconnectEvent = new Object();
opponentDisconnectEvent.callback = function () {
Game.debug("--interval");
clearInterval(this.intervalID);
Game.gameOver();
};
opponentDisconnectEvent.intervalID = setInterval(opponentDisconnectEvent, "callback", 3000);
} else {
(_local1.stop());// not popped
debug("-game not started");
getOpponent().setConnected(false);
getOpponent().setExitGame();
getRound().clear();
openDialog(I18n.getLabel("opponent_noconnect"), "", true);
opponentDisconnectEvent = new Object();
opponentDisconnectEvent.callback = function () {
Game.debug("--interval");
clearInterval(this.intervalID);
Game.gameOver();
};
opponentDisconnectEvent.intervalID = setInterval(opponentDisconnectEvent, "callback", 3000);
}
}
}
static function opponentExitGame() {
getOpponent().setExitGame();
timer_.stopTimer();
report("playData", "1");
getRound().clear();
openDialog(I18n.getLabel("opponent_forfeited"), "", true);
opponentExitGameEvent = new Object();
opponentExitGameEvent.callback = function () {
clearInterval(this.intervalID);
Game.gameOver();
};
opponentExitGameEvent.intervalID = setInterval(opponentExitGameEvent, "callback", 3000);
}
static function opponentGameOver() {
}
function onStartGame() {
gameStarted_ = true;
report("gameStart", "");
report("playData", "321");
}
function ping() {
if (!gameEnded_) {
Communicator.sendPing();
}
}
function ccom() {
}
static function debug(str) {
_root.txtdebug.text = (str + newline) + _root.txtdebug.text;
}
static function getState() {
return(state_);
}
static function setState(state) {
state_ = state;
}
function gotoNextRound() {
_root.gotoAndPlay("lblNextRound");
}
static function report(type, data) {
var _local1 = type;
if (practice_ && (_local1 == "playData")) {
} else {
debug((("Reporting: " + _local1) + ",") + data);
fscommand (_local1, "" + data);
}
}
static function setPracticeMode() {
practice_ = true;
}
function onEnterFrame() {
var _local1 = _root;
if (!(getState() === STATE_NOT_INITIALIZED)) {
} else if (((_local1.gameData != null) && (_local1.gameData != undefined)) && (_local1.gameData != "")) {
setState(STATE_PENDING);
init(_local1.gameData);
setState(STATE_INITIALIZED);
}
if (!_level0.chatbox.inited) {
if ((((getPlayer().isConnected() && (getOpponent().isConnected())) && (_level0.chatbox != null)) && (_level0.chatbox.getBytesLoaded() > 0)) && (_level0.chatbox.getBytesLoaded() == _level0.chatbox.getBytesTotal())) {
debug("INIT CHATBOX");
_level0.chatbox.inited = true;
_level0.chatbox.init(this);
}
}
if (getplayer().isConnected() && (getOpponent().isConnected())) {
if (getRound().NUM_SPECIALS_CLEARED == 3) {
getRound().closeRound();
}
if (getPlayer().isRoundEnded() && (getOpponent().isRoundEnded())) {
getRound().closeRound();
}
}
}
static var ANIM_INDEX = 3000;
static var CURRENT_ROUND = null;
static var TOTAL_SCORE = 0;
static var ROUND_ID = 0;
static var timeoutSounder = null;
static var onEndTimern = null;
static var decks = new Array();
static var deckId = -1;
static var practice_ = false;
static var gameStarted_ = false;
static var gameEnded_ = false;
static var STATE_NOT_INITIALIZED = 0;
static var STATE_INITIALIZING = 1;
static var STATE_INITIALIZED = 2;
static var STATE_OPPONENT_CONNECTED = 3;
static var STATE_PENDING = -1;
static var state_ = STATE_NOT_INITIALIZED;
static var pingIntervalId_ = null;
static var timer_ = null;
static var player_ = new Player();
static var opponent_ = new Player();
static var avatarPlayer_ = null;
static var avatarOpponent_ = null;
static var MAX_ROUNDS = 3;
static var NUM_SCARABS_NEEDED = 5;
}
Symbol 426 MovieClip [__Packages.Communicator] Frame 0
class Communicator
{
static var hostname_, port_, slotid_, magic_;
function Communicator () {
}
static function init(hostname, port, slotid, magic) {
hostname_ = hostname;
port_ = port;
slotid_ = slotid;
magic_ = magic;
socket_.onConnect = handleConnect;
socket_.onClose = handleClose;
socket_.onData = handleData;
}
static function doConnect() {
socket_.connect(hostname_, port_);
}
static function handleConnect(success) {
if (!success) {
onPlayerDisconnect();
} else {
sendClientConnect();
}
}
static function handleClose() {
onPlayerDisconnect();
Game.debug("close");
}
static function handleData(msg) {
var st = new StringTokenizer(msg);
var cmd = st.nextToken();
Game.debug("received: " + msg);
if (cmd == "SCA") {
var playerNum = Number(st.nextToken());
var username = st.nextToken();
username = username.substring(1, username.length);
if (username.charAt(username.length - 1) != "\"") {
username = username + st.nextToken();
}
username = username.substring(0, username.length - 1);
var avatar = st.nextToken();
onClientAccepted(playerNum, username, avatar);
} else if (cmd == "SAC") {
var playerNum = Number(st.nextToken());
var username = st.nextToken();
username = username.substring(1, username.length);
if (username.charAt(username.length - 1) != "\"") {
username = username + st.nextToken();
}
username = username.substring(0, username.length - 1);
var avatar = st.nextToken();
onAnotherClientAccepted(playerNum, username, avatar);
} else if (cmd == "SCD") {
var playerNum = Number(st.nextToken());
var numPlayers = Number(st.nextToken());
Game.debug("acting on SCD");
if (playerNum == Game.getPlayer().getPlayerNum()) {
Game.debug("acting on SCD 0");
onPlayerDisconnect();
} else if (playerNum == Game.getOpponent().getPlayerNum()) {
Game.debug("acting on SCD 1");
onOpponentDisconnect();
} else {
Game.debug("acting on SCD ?");
}
} else if (cmd == "SSG") {
onStartGame();
} else if (cmd == "STM") {
} else if (cmd == "PCR") {
var card = st.nextToken();
onCardRemoved(card);
} else if (cmd == "GSR") {
var card = st.nextToken();
var round = Number(st.nextToken());
var player = Number(st.nextToken());
var usedCardId = Number(st.nextToken());
var timeLeft = Number(st.nextToken());
if (player == Game.getPlayer().getPlayerNum()) {
var e = eval ("p" + card);
e.onValidClick(timeLeft, usedCardId);
} else {
var e = eval ("o" + card);
e.onValidOpponentClick(timeLeft);
}
} else if (cmd == "PWC") {
Game.getRound().opponentWrongClick();
} else if (cmd == "PNM") {
Game.getOpponent().setNoMoreMoves();
} else if (cmd == "PXG") {
Game.opponentExitGame();
} else if (cmd == "PGO") {
Game.opponentGameOver();
} else if (cmd == "MCC") {
_level0.chatbox.hm(msg);
} else if (cmd == "GNR") {
var roundid = Number(st.nextToken());
Game.startRound();
}
}
static function onCardRemoved(card) {
var e = eval ("o" + card);
e.onValidOpponentClick();
}
static function onLeave() {
}
static function onEnter() {
}
static function sendWrongClick() {
var _local1 = "PWC";
Game.debug("sending: " + _local1);
socket_.send(_local1);
}
static function sendCardRemoved(card) {
var _local1 = ("PCR " + card) + "";
Game.debug("sending: " + _local1);
socket_.send(_local1);
}
static function sendScarabRemoved(card, usedCardId, timeLeft) {
var _local1 = ((((((((("GSR " + card) + " ") + Game.getRound().getRoundId()) + " ") + Game.getPlayer().getPlayerNum()) + " ") + usedCardId) + " ") + timeLeft) + "";
Game.debug("sending: " + _local1);
socket_.send(_local1);
}
static function sendNextRound() {
var _local1 = ("GNR " + Game.getRound().getRoundId()) + "";
Game.debug("sending: " + _local1);
socket_.send(_local1);
}
static function sendNoMoreMoves() {
var _local1 = "PNM";
Game.debug("sending: " + _local1);
socket_.send(_local1);
}
static function sendGameOver() {
var _local1 = "PGO";
Game.debug("sending: " + _local1);
socket_.send(_local1);
_local1 = "CGO";
Game.debug("sending: " + _local1);
socket_.send(_local1);
}
static function sendClientConnect() {
var _local1 = ((("CCC " + slotid_) + " ") + magic_) + "";
Game.debug("sending: " + _local1);
socket_.send(_local1);
}
static function sendClientIsReady() {
var _local1 = "CIR";
Game.debug("sending: " + _local1);
socket_.send(_local1);
}
static function sendExitGame() {
var _local1 = "PXG";
Game.debug("sending: " + _local1);
socket_.send(_local1);
}
static function sendPing() {
var _local1 = "CTM";
socket_.send(_local1);
}
static function onClientAccepted(playerNum) {
}
static function onAnotherClientAccepted() {
}
static function onPlayerDisconnect() {
}
static function onOpponentDisconnect() {
}
static function onStartGame() {
}
static var socket_ = new XMLSocket();
}
Symbol 427 MovieClip [__Packages.StringTokenizer] Frame 0
class StringTokenizer
{
function StringTokenizer (str) {
var _local1 = this;
_local1.str_ = str;
_local1.index_ = 0;
_local1.delim = " ";
}
function hasMoreTokens() {
var _local1 = this;
var _local2 = _local1.str_.indexOf(_local1.delim, _local1.index_);
return(_local2 != -1);
}
function nextToken() {
var _local1 = this;
var _local2 = _local1.str_.indexOf(_local1.delim, _local1.index_);
if (_local2 == -1) {
_local2 = _local1.str_.length;
}
var _local3 = _local1.str_.substring(_local1.index_, _local2);
_local1.index_ = _local2 + 1;
return(_local3);
}
}
Symbol 428 MovieClip [__Packages.Timer] Frame 0
class Timer
{
var length_, totalTime_;
function Timer () {
var _local1 = this;
_local1.started_ = false;
_local1.length_ = 300;
_local1.totalTime_ = 300;
_local1.elapsed_ = 0;
}
function setTime(time) {
length_ = time;
totalTime_ = time;
}
function getTime() {
return(length_);
}
function onTimerEvent() {
var _local1 = this;
if (_local1.started_) {
var _local2 = Math.floor((getTimer() - _local1.initialStartTime_) / 1000);
_local1.length_ = _local1.totalTime_ - (_local1.elapsed_ + _local2);
if ((_local1.totalTime_ - (_local1.elapsed_ + _local2)) < 0) {
Game.updateTimeLeft(0);
_local1.length_ = 0;
Game.getRound().closeRound();
} else {
Game.updateTimeLeft(_local1.totalTime_ - (_local1.elapsed_ + _local2));
}
}
}
function startTimer() {
var _local1 = this;
if ((_local1.initialStartTime_ == null) || (_local1.initialStartTime_ == undefined)) {
_local1.initialStartTime_ = getTimer();
}
_local1.started_ = true;
}
function stopTimer() {
var _local1 = this;
if ((_local1.started_ && (_local1.initialStartTime_ != null)) && (_local1.initialStartTime_ != 0)) {
_local1.elapsed_ = _local1.elapsed_ + Math.floor((getTimer() - _local1.initialStartTime_) / 1000);
}
_local1.initialStartTime_ = null;
_local1.started_ = false;
}
}
Symbol 429 MovieClip [__Packages.I18n] Frame 0
class I18n
{
function I18n () {
}
static function addLabel(label) {
var _local1 = label;
_local1[1] = _local1[1].split("\r\n").join(newline);
labels_.push(_local1);
}
static function getLabel(label) {
var _local2 = label;
var _local1 = 0;
while (_local1 < labels_.length) {
if (labels_[_local1][0].toLowerCase() == _local2.toLowerCase()) {
return(labels_[_local1][1]);
}
_local1++;
}
return("M: " + _local2.toUpperCase());
}
static function getLabelReplace(label, replace1) {
var _local1 = getLabel(label);
var _local2 = _local1.split("{1}");
_local1 = _local2.join(replace1);
return(_local1);
}
static var labels_ = new Array();
}
Symbol 430 MovieClip [__Packages.GameRound] Frame 0
class GameRound extends MovieClip
{
var endWaiterRef, DECK;
function GameRound () {
var _local1 = this;
super();
_local1.CARDS = new Array();
_local1.OPPONENTCARDS = new Array();
_local1.started_ = false;
}
function started() {
return(started_);
}
function ended() {
return(closingRound);
}
function setRoundId(id) {
rndId = id;
}
function getRoundId() {
return(rndId);
}
function isCompleted() {
return(NUM_SPECIALS_CLEARED == 3);
}
function wrongClick(crd) {
var _local1 = -20;
Game.getPlayer().addScore(_local1);
_level0.points.text = Game.getPlayer().getScoreTotal();
Communicator.sendWrongClick();
Game.report("playData", (("51," + crd.getId()) + "=") + getTimer());
}
function opponentWrongClick(crd) {
var _local1 = -20;
Game.getOpponent().addScore(_local1);
_level0.opponent_points.text = Game.getOpponent().getScoreTotal();
}
function getTotalScore() {
return(Game.getPlayer().getScoreTotal());
}
function updateStatusInfo() {
_level0.cardsLeft.text = NUM_CARDS_HIDDEN;
if (NUM_CARDS_HIDDEN == 0) {
_level0.cardsLeft.text = "";
}
}
function cardCleared(card, usedCardId, timeLeft) {
if (card.getValue() == -1) {
JOKER_USED = true;
_level0.snd_joker.start();
Game.report("playData", "666=0");
return(undefined);
}
var cardPoint = (100 * card.getRow());
var specialCleared = false;
if (card.getRow() == 4) {
NUM_SPECIALS_CLEARED++;
Game.getPlayer().addScarab();
Game.getPlayer().setMood("happy");
Game.getOpponent().setMood("angry");
specialCleared = true;
_level0.attachMovie("Bagge", "bagge" + card._name, Game.ANIM_INDEX++);
var y = eval ("bagge" + card._name);
if (card.specialNum == 1) {
y._x = 311;
} else if (card.specialNum == 2) {
y._x = 463;
} else if (card.specialNum == 3) {
y._x = 610;
}
y._y = 178;
var specialBonus = 0;
if (NUM_SPECIALS_CLEARED == 1) {
specialBonus = 1000;
}
if (NUM_SPECIALS_CLEARED == 2) {
specialBonus = 1000;
}
if (NUM_SPECIALS_CLEARED == 3) {
specialBonus = 1500;
var timeBonus = Math.round((timeLeft * 100) / Game.getTimeLimit());
specialBonus = specialBonus + timeBonus;
}
if (cardPoint < specialBonus) {
cardPoint = specialBonus;
}
}
Game.getPlayer().addScore(cardPoint);
_level0.points.text = Game.getPlayer().getScoreTotal();
Game.report("playData", (((((("34," + card.getId()) + " ") + usedCardId) + " ") + timeLeft) + "=") + cardPoint);
if (specialCleared) {
_level0.snd_scarab.start();
} else {
_level0.snd_cardcleared.start();
}
if (Game.getPlayer().getScarabsTotal() == Game.NUM_SCARABS_NEEDED) {
closeRound();
}
}
function opponentCardCleared(card, timeLeft) {
var cardPoint = (100 * card.getRow());
if (card.getRow() == 4) {
Game.getOpponent().addScarab();
Game.getPlayer().setMood("angry");
Game.getOpponent().setMood("happy");
var lbl = card.getLabel();
Game.debug("p" + lbl.substring(1, lbl.length));
var myCard = eval ("p" + lbl.substring(1, lbl.length));
myCard.removeFromParents();
myCard.removeMovieClip();
NUM_SPECIALS_CLEARED++;
_level0.attachMovie("Bagge2", "bagge2" + card._name, Game.ANIM_INDEX++);
var y = eval ("bagge2" + card._name);
if (card.specialNum == 1) {
y._x = 311;
} else if (card.specialNum == 2) {
y._x = 463;
} else if (card.specialNum == 3) {
y._x = 610;
}
y._y = 178;
var specialBonus = 0;
if (NUM_SPECIALS_CLEARED == 1) {
specialBonus = 1000;
}
if (NUM_SPECIALS_CLEARED == 2) {
specialBonus = 1000;
}
if (NUM_SPECIALS_CLEARED == 3) {
specialBonus = 1500;
var timeBonus = Math.round((timeLeft * 100) / Game.getTimeLimit());
specialBonus = specialBonus + timeBonus;
}
if (cardPoint < specialBonus) {
cardPoint = specialBonus;
}
Game.report("playData", (((("43," + card.getId()) + " ") + timeLeft) + "=") + cardPoint);
}
Game.getOpponent().addScore(cardPoint);
_level0.opponent_points.text = Game.getOpponent().getScoreTotal();
if (card.getRow() == 4) {
_level0.snd_scarab.start();
}
if (Game.getOpponent().getScarabsTotal() == Game.NUM_SCARABS_NEEDED) {
closeRound();
}
}
function clear() {
var _local2 = this;
var _local1 = 0;
while (_local1 < _local2.CARDS.length) {
var _local3 = _local2.CARDS[_local1];
_local3.removeMovieClip();
_local1++;
}
_local1 = 0;
while (_local1 < _local2.OPPONENTCARDS.length) {
var _local3 = _local2.OPPONENTCARDS[_local1];
_local3.removeMovieClip();
_local1++;
}
_level0.joker.removeMovieClip();
}
function doflip() {
var _local2 = this;
clearInterval(_root.flipIntervalID);
var _local1 = 0;
while (_local1 < _local2.CARDS.length) {
var _local3 = _local2.CARDS[_local1];
if ((_local3.getBehaviour() == "openstack") || (_local3.getBehaviour() == "foundation")) {
_local3.gotoAndStop(1);
}
_local1++;
}
_local1 = 0;
while (_local1 < _local2.OPPONENTCARDS.length) {
var _local3 = _local2.OPPONENTCARDS[_local1];
if ((_local3.getBehaviour() == "openstack") || (_local3.getBehaviour() == "foundation")) {
_local3.gotoAndStop(1);
}
_local1++;
}
var _local3 = _level0.joker;
if ((_local3.getBehaviour() == "openstack") || (_local3.getBehaviour() == "foundation")) {
_local3.gotoAndStop(1);
}
}
function flip() {
_level0.snd_shuffle.start();
_root.flipIntervalID = setInterval(this, "doflip", 200);
}
function endWaitEnded() {
clearInterval(endWaiterRef);
clear();
_level0.topRun.text = "";
_level0.points.text = "";
_level0.cardsLeft.text = "";
Game.roundEnded();
}
function closeRound() {
var _local2 = this;
if ((Game.getOpponent().hasExitGame() || (Game.gameEnded())) || (_local2.closingRound)) {
} else {
Game.debug("ending round");
_local2.closingRound = true;
Game.stopTimer();
var _local1 = 0;
while (_local1 < _local2.CARDS.length) {
var _local3 = _local2.CARDS[_local1];
_local3.onRelease = "undefined";
_local3.onRollOver = "undefined";
_local1++;
}
var _local3 = _level0.joker;
_local3.onRelease = "undefined";
_local3.onRollOver = "undefined";
var playSound = false;
if (((Game.getTimeLeft() == 0) && (_local2.NUM_SPECIALS_CLEARED < 3)) && (Game.getPlayer().getScarabsTotal() != Game.NUM_SCARABS_NEEDED)) {
Game.openDialog(I18n.getLabel("timesup"), "", true);
} else if ((_local2.NO_MORE_MOVES && (_local2.NUM_SPECIALS_CLEARED < 3)) && (Game.getPlayer().getScarabsTotal() != Game.NUM_SCARABS_NEEDED)) {
Game.openDialog(I18n.getLabel("nomoremoves"), (Game.getOpponent().hasMoreMoves() ? (I18n.getLabel("nomoremoves_info")) : ""), true);
}
_local2.endWaiterRef = setInterval(_local2, "endWaitEnded", 3500);
}
}
function openRound() {
var _local1 = this;
_local1.flip();
_local1.started_ = true;
Game.report("playData", ("56," + Game.ROUND_ID) + "=0");
_level0.topRun.text = "0";
_level0.points.text = Game.getPlayer().getScoreTotal();
_level0.opponent_points.text = Game.getOpponent().getScoreTotal();
Game.debug("new round: " + _local1.getRoundId());
Game.updateTimeLeft(Game.getTimeLeft());
Game.startTimer();
}
function anymoreMoves() {
var _local3 = this;
var retval = false;
if (_local3.NUM_SPECIALS_CLEARED == 3) {
retval = false;
} else if (!_local3.JOKER_USED) {
retval = true;
} else if (_local3.NUM_CARDS_HIDDEN > 0) {
retval = true;
} else {
var _local2 = 0;
while (_local2 < _local3.CARDS.length) {
var _local1 = _local3.CARDS[_local2];
if ((_local1.isOpen() && (_local1.onTable)) && (_local1.compare(_local3.TOP_CARD))) {
retval = true;
break;
}
_local2++;
}
}
if (retval) {
} else if (_local3.NUM_SPECIALS_CLEARED == 3) {
_local3.closeRound();
} else {
Communicator.sendNoMoreMoves();
_local3.NO_MORE_MOVES = true;
Game.getPlayer().setNoMoreMoves();
if (!Game.getOpponent().isRoundEnded()) {
Game.openDialog(I18n.getLabel("nomoremoves"), (Game.getOpponent().hasMoreMoves() ? (I18n.getLabel("nomoremoves_info")) : ""), true);
}
}
}
function generateCards() {
generatePlayerCards();
generateOpponentCards();
}
function generatePlayerCards() {
var _local2 = this;
var _local1 = 0;
while (_local1 < _local2.DECK.length) {
var _local3 = _level0.attachMovie("PlayCard", "p" + _local2.DECK[_local1][1], 100 + _local1);
_local3._x = _local2.STACK_X - 87;
_local3._y = _local2.STACK_Y;
_local3.initialize("p" + _local2.DECK[_local1][1], _local2.DECK[_local1][0], _local1);
_local2.CARDS.push(_local3);
_local3.onTable = false;
if (_local1 < 28) {
_local3.setBehaviour("foundation");
_local3.animate(_local2.CARDCOORD[_local1][0], _local2.CARDCOORD[_local1][1], 1000);
_local3.onTable = true;
} else if (_local1 == 28) {
_local3.setBehaviour("openstack");
_local3.animate(_local2.STACK_X, _local2.STACK_Y, 500);
_local2.TOP_CARD = _local3;
} else {
_local3.setBehaviour("topstack");
}
_local1++;
}
_level0.cardsLeft.text = _local2.NUM_CARDS_HIDDEN;
var _local3 = _level0.attachMovie("PlayCard", "joker", 160);
_local3._x = _local2.STACK_X - 240;
_local3._y = _local2.STACK_Y;
_local3.initialize("joker", -1, -1);
_local3.animate(_local2.STACK_X - 240, _local2.STACK_Y, 500);
_local3.setBehaviour("foundation");
}
function generateOpponentCards() {
var _local3 = this;
var _local2 = 0;
while (_local2 < 28) {
var _local1 = _level0.attachMovie("PlayCard", "o" + _local3.DECK[_local2][1], 300 + _local2);
if (_local2 < 3) {
_local1._visible = false;
}
_local1._x = _local3.STACK_X - 87;
_local1._y = _local3.STACK_Y - 320;
_local1.initialize("o" + _local3.DECK[_local2][1], _local3.DECK[_local2][0], _local2);
_local3.OPPONENTCARDS.push(_local1);
_local1.onTable = false;
_local1.setBehaviour("foundation");
var posx = _local3.CARDCOORD_OPPONENT[_local2][0];
var posy = _local3.CARDCOORD_OPPONENT[_local2][1];
_local1.animate(posx, posy, 1000);
_local1.onTable = true;
_local1.setIsOpponent(true);
_local2++;
}
}
function linkAndInitCards() {
linkAndInitPlayerCards();
linkAndInitOpponentCards();
}
function linkAndInitPlayerCards() {
var _local1 = this;
var _local2 = 0;
while (_local2 < 28) {
if (_local2 == 0) {
_local1.CARDS[_local2].specialNum = 1;
_local1.CARDS[_local2].setRow(4);
_local1.CARDS[_local2].addChild(_local1.CARDS[3]);
_local1.CARDS[_local2].addChild(_local1.CARDS[4]);
} else if (_local2 == 1) {
_local1.CARDS[_local2].specialNum = 2;
_local1.CARDS[_local2].setRow(4);
_local1.CARDS[_local2].addChild(_local1.CARDS[5]);
_local1.CARDS[_local2].addChild(_local1.CARDS[6]);
} else if (_local2 == 2) {
_local1.CARDS[_local2].specialNum = 3;
_local1.CARDS[_local2].setRow(4);
_local1.CARDS[_local2].addChild(_local1.CARDS[7]);
_local1.CARDS[_local2].addChild(_local1.CARDS[8]);
} else if (_local2 == 3) {
_local1.CARDS[_local2].setRow(3);
_local1.CARDS[_local2].addChild(_local1.CARDS[9]);
_local1.CARDS[_local2].addChild(_local1.CARDS[10]);
} else if (_local2 == 4) {
_local1.CARDS[_local2].setRow(3);
_local1.CARDS[_local2].addChild(_local1.CARDS[10]);
_local1.CARDS[_local2].addChild(_local1.CARDS[11]);
} else if (_local2 == 5) {
_local1.CARDS[_local2].setRow(3);
_local1.CARDS[_local2].addChild(_local1.CARDS[12]);
_local1.CARDS[_local2].addChild(_local1.CARDS[13]);
} else if (_local2 == 6) {
_local1.CARDS[_local2].setRow(3);
_local1.CARDS[_local2].addChild(_local1.CARDS[13]);
_local1.CARDS[_local2].addChild(_local1.CARDS[14]);
} else if (_local2 == 7) {
_local1.CARDS[_local2].setRow(3);
_local1.CARDS[_local2].addChild(_local1.CARDS[15]);
_local1.CARDS[_local2].addChild(_local1.CARDS[16]);
} else if (_local2 == 8) {
_local1.CARDS[_local2].setRow(3);
_local1.CARDS[_local2].addChild(_local1.CARDS[16]);
_local1.CARDS[_local2].addChild(_local1.CARDS[17]);
} else if (_local2 == 9) {
_local1.CARDS[_local2].setRow(2);
_local1.CARDS[_local2].addChild(_local1.CARDS[18]);
_local1.CARDS[_local2].addChild(_local1.CARDS[19]);
} else if (_local2 == 10) {
_local1.CARDS[_local2].setRow(2);
_local1.CARDS[_local2].addChild(_local1.CARDS[19]);
_local1.CARDS[_local2].addChild(_local1.CARDS[20]);
} else if (_local2 == 11) {
_local1.CARDS[_local2].setRow(2);
_local1.CARDS[_local2].addChild(_local1.CARDS[20]);
_local1.CARDS[_local2].addChild(_local1.CARDS[21]);
} else if (_local2 == 12) {
_local1.CARDS[_local2].setRow(2);
_local1.CARDS[_local2].addChild(_local1.CARDS[21]);
_local1.CARDS[_local2].addChild(_local1.CARDS[22]);
} else if (_local2 == 13) {
_local1.CARDS[_local2].setRow(2);
_local1.CARDS[_local2].addChild(_local1.CARDS[22]);
_local1.CARDS[_local2].addChild(_local1.CARDS[23]);
} else if (_local2 == 14) {
_local1.CARDS[_local2].setRow(2);
_local1.CARDS[_local2].addChild(_local1.CARDS[23]);
_local1.CARDS[_local2].addChild(_local1.CARDS[24]);
} else if (_local2 == 15) {
_local1.CARDS[_local2].setRow(2);
_local1.CARDS[_local2].addChild(_local1.CARDS[24]);
_local1.CARDS[_local2].addChild(_local1.CARDS[25]);
} else if (_local2 == 16) {
_local1.CARDS[_local2].setRow(2);
_local1.CARDS[_local2].addChild(_local1.CARDS[25]);
_local1.CARDS[_local2].addChild(_local1.CARDS[26]);
} else if (_local2 == 17) {
_local1.CARDS[_local2].setRow(2);
_local1.CARDS[_local2].addChild(_local1.CARDS[26]);
_local1.CARDS[_local2].addChild(_local1.CARDS[27]);
} else {
_local1.CARDS[_local2].setRow(1);
}
_local2++;
}
}
function linkAndInitOpponentCards() {
var _local1 = this;
var _local2 = 0;
while (_local2 < 28) {
if (_local2 == 0) {
_local1.OPPONENTCARDS[_local2].specialNum = 1;
_local1.OPPONENTCARDS[_local2].setRow(4);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[3]);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[4]);
} else if (_local2 == 1) {
_local1.OPPONENTCARDS[_local2].specialNum = 2;
_local1.OPPONENTCARDS[_local2].setRow(4);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[5]);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[6]);
} else if (_local2 == 2) {
_local1.OPPONENTCARDS[_local2].specialNum = 3;
_local1.OPPONENTCARDS[_local2].setRow(4);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[7]);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[8]);
} else if (_local2 == 3) {
_local1.OPPONENTCARDS[_local2].setRow(3);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[9]);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[10]);
} else if (_local2 == 4) {
_local1.OPPONENTCARDS[_local2].setRow(3);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[10]);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[11]);
} else if (_local2 == 5) {
_local1.OPPONENTCARDS[_local2].setRow(3);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[12]);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[13]);
} else if (_local2 == 6) {
_local1.OPPONENTCARDS[_local2].setRow(3);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[13]);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[14]);
} else if (_local2 == 7) {
_local1.OPPONENTCARDS[_local2].setRow(3);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[15]);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[16]);
} else if (_local2 == 8) {
_local1.OPPONENTCARDS[_local2].setRow(3);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[16]);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[17]);
} else if (_local2 == 9) {
_local1.OPPONENTCARDS[_local2].setRow(2);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[18]);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[19]);
} else if (_local2 == 10) {
_local1.OPPONENTCARDS[_local2].setRow(2);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[19]);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[20]);
} else if (_local2 == 11) {
_local1.OPPONENTCARDS[_local2].setRow(2);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[20]);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[21]);
} else if (_local2 == 12) {
_local1.OPPONENTCARDS[_local2].setRow(2);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[21]);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[22]);
} else if (_local2 == 13) {
_local1.OPPONENTCARDS[_local2].setRow(2);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[22]);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[23]);
} else if (_local2 == 14) {
_local1.OPPONENTCARDS[_local2].setRow(2);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[23]);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[24]);
} else if (_local2 == 15) {
_local1.OPPONENTCARDS[_local2].setRow(2);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[24]);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[25]);
} else if (_local2 == 16) {
_local1.OPPONENTCARDS[_local2].setRow(2);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[25]);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[26]);
} else if (_local2 == 17) {
_local1.OPPONENTCARDS[_local2].setRow(2);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[26]);
_local1.OPPONENTCARDS[_local2].addChild(_local1.OPPONENTCARDS[27]);
} else {
_local1.OPPONENTCARDS[_local2].setRow(1);
}
_local2++;
}
}
function setDeck(dck) {
DECK = dck;
}
var STACK_X = 478;
var STACK_Y = 330;
var rndId = 0;
var CARDS = new Array();
var OPPONENTCARDS = new Array();
var NUM_CARDS_HIDDEN = 23;
var TOP_CARD = null;
var PREVIOUS_TOP_CARD = null;
var JOKER_USED = false;
var NUM_SPECIALS_CLEARED = 0;
var closingRound = false;
var started_ = false;
var CARDCOORD = [[290, 145], [440, 145], [590, 145], [262, 180], [312, 180], [415, 180], [465, 180], [565, 180], [615, 180], [240, 220], [290, 220], [340, 220], [390, 220], [440, 220], [490, 220], [540, 220], [587, 220], [640, 220], [215, 260], [265, 260], [315, 260], [365, 260], [415, 260], [465, 260], [515, 260], [565, 260], [615, 260], [665, 260]];
var CARDCOORD_OPPONENT = [[290, 145], [440, 145], [590, 145], [262, 100], [312, 100], [415, 100], [465, 100], [565, 100], [615, 100], [240, 60], [290, 60], [340, 60], [390, 60], [440, 60], [490, 60], [540, 60], [587, 60], [640, 60], [215, 20], [265, 20], [315, 20], [365, 20], [415, 20], [465, 20], [515, 20], [565, 20], [615, 20], [665, 20]];
}
Instance of Symbol 345 MovieClip "startbutton" in Symbol 358 MovieClip Frame 1
on (release) {
_root.myGame.startGame();
}
Symbol 358 MovieClip Frame 83
gotoAndPlay ("waiting");
Symbol 377 MovieClip Frame 40
stop();
Symbol 404 MovieClip Frame 1
this.txt_round_results.text = I18n.getLabelReplace("round_results_header", Game.getRound().getRoundId() + 1);
this.txt_round_playtime_left.text = I18n.getLabelReplace("round_results_time_left", Game.formatTimeLeft(Game.getTimeLeft()));
this.txt_player_scarabs_round.text = Game.getPlayer().getScarabsTotal();
this.txt_player_score_round.text = Game.getPlayer().getScoreRound();
this.txt_player_score_total.text = Game.getPlayer().getScoreTotal();
this.txt_opponent_scarabs_round.text = Game.getOpponent().getScarabsTotal();
this.txt_opponent_score_round.text = Game.getOpponent().getScoreRound();
this.txt_opponent_score_total.text = Game.getOpponent().getScoreTotal();
Instance of Symbol 341 MovieClip " " in Symbol 404 MovieClip Frame 1
/* no clip actions */
Symbol 420 MovieClip Frame 1
this.txt_gameover.text = I18n.getLabel("gameover");
this.playerScarabsClip.txt_player_scarabs_round.text = Game.getPlayer().getScarabsTotal();
this.playerScoreClip.txt_player_score_total.text = Game.getPlayer().getScoreTotal();
this.opponentScarabsClip.txt_opponent_scarabs_round.text = Game.getOpponent().getScarabsTotal();
this.opponentScoreClip.txt_opponent_score_total.text = Game.getOpponent().getScoreTotal();
var evt = new Object();
evt.clip = this;
evt.degree = 0;
evt.playerScarabsClip = this.playerScarabsClip;
evt.opponentScarabsClip = this.opponentScarabsClip;
evt.playerScoreClip = this.playerScoreClip;
evt.opponentScoreClip = this.opponentScoreClip;
evt.onEvent = function () {
var _local2 = this;
_local2.degree = _local2.degree + 5;
var _local3 = (_local2.degree / 180) * Math.PI;
var _local1 = 100 + (50 * Math.abs(Math.sin(_local3)));
if (Game.getPlayer().getScarabsTotal() > Game.getOpponent().getScarabsTotal()) {
_local2.playerScarabsClip._xscale = _local1;
_local2.playerScarabsClip._yscale = _local1;
} else if (Game.getPlayer().getScarabsTotal() < Game.getOpponent().getScarabsTotal()) {
_local2.opponentScarabsClip._xscale = _local1;
_local2.opponentScarabsClip._yscale = _local1;
} else if (Game.getPlayer().getScoreTotal() > Game.getOpponent().getScoreTotal()) {
_local2.playerScoreClip._xscale = _local1;
_local2.playerScoreClip._yscale = _local1;
} else if (Game.getPlayer().getScoreTotal() < Game.getOpponent().getScoreTotal()) {
_local2.opponentScoreClip._xscale = _local1;
_local2.opponentScoreClip._yscale = _local1;
}
};
evt.intervalId = setInterval(evt, "onEvent", 20);
Instance of Symbol 341 MovieClip " " in Symbol 420 MovieClip Frame 1
/* no clip actions */
Symbol 420 MovieClip Frame 2
stop();