Frame 1
_root.gamemode = 2;
var game = (new com.midasplayer.game.dond2.Game());
stop();
Symbol 86 MovieClip Frame 1
stop();
Symbol 117 MovieClip Frame 1
stop();
Symbol 129 MovieClip Frame 1
stop();
Symbol 136 MovieClip Frame 1
stop();
Symbol 140 MovieClip Frame 1
stop();
Symbol 180 MovieClip [star] Frame 1
stop();
Symbol 315 MovieClip Frame 1
stop();
Symbol 323 MovieClip Frame 1
stop();
Symbol 331 MovieClip Frame 1
stop();
Symbol 339 MovieClip Frame 1
stop();
Symbol 417 MovieClip [case] Frame 1
stop();
Symbol 549 MovieClip Frame 1
stop();
Symbol 549 MovieClip Frame 10
gotoAndPlay (3);
Symbol 566 MovieClip Frame 1
stop();
Symbol 571 MovieClip [__Packages.com.midasplayer.util.GameBase] Frame 0
class com.midasplayer.util.GameBase
{
static var playDataEntryId_, playData_, gameData, game_, checkGameDataIntervalId_;
function GameBase () {
gameMode_ = GAME_MODE_MONEY;
playDataEntryId_ = 0;
playData_ = "";
}
function startGame() {
}
static function setGameMode(gameMode) {
gameMode_ = gameMode;
}
static function getGameMode() {
return(gameMode_);
}
static function setGameType(gameType) {
gameType_ = gameType;
}
static function getGameType() {
return(gameType_);
}
static function getGameData() {
return(gameData);
}
static function reportGameStart() {
com.midasplayer.util.Log.debug("gameStart");
fscommand ("gameStart");
}
static function reportGameEnd(score) {
com.midasplayer.util.Log.debug("gameEnd " + String(score));
fscommand ("gameEnd", String(score));
playData_ = (("<result><![CDATA[" + score) + "]]></result>\n") + playData_;
}
static function reportGameQuit() {
com.midasplayer.util.Log.debug("gameQuit");
fscommand ("gameQuit");
}
function reportGameOver(score) {
com.midasplayer.util.Log.debug("gameOver " + String(score));
fscommand ("gameOver", String(score));
}
static function reportPlayData(pCode, pData, pScore) {
if (gameMode_ != GAME_MODE_MONEY) {
return(undefined);
}
var _local1;
_local1 = String(pCode);
if ((pData != null) && (pData.length > 0)) {
_local1 = _local1 + ("," + pData);
}
if (((pScore != undefined) && (pScore != null)) && (pScore.length > 0)) {
_local1 = _local1 + ("=" + pScore);
}
com.midasplayer.util.Log.debug("playData " + _local1);
fscommand ("playData", "" + _local1);
playDataEntryId_++;
playData_ = playData_ + (("<entry id=\"" + playDataEntryId_) + "\"");
playData_ = playData_ + " time=\"2007-08-27 12:13:45\">";
playData_ = playData_ + (("<![CDATA[" + _local1) + "]]></entry>\n");
}
static function getPlayData() {
var _local1 = newline;
_local1 = _local1 + "<midas>\n";
_local1 = _local1 + "<client action=\"gameover\" slotId=\"57990\" playId=\"0\" request=\"3\" magic=\"443172449\">\n";
_local1 = _local1 + (("<gameover time=\"2007-08-27 12:14:01\" lastplaydataid=\"" + playDataEntryId_) + "\" elapsed=\"18000\" sync=\"0\" cheat=\"0\">\n");
_local1 = _local1 + playData_;
_local1 = _local1 + "</gameover>\n";
_local1 = _local1 + "</client>\n";
_local1 = _local1 + "</midas>";
return(_local1);
}
static function runsLocal() {
return(_root._URL.substr(0, 5).toLowerCase() == "file:");
}
function init(game) {
game_ = game;
checkGameDataIntervalId_ = setInterval(this, "checkGameData", 200);
}
function checkGameData() {
if (!hasGameData_) {
if (((_root.gameData != null) && (_root.gameData != undefined)) && (_root.gameData != "")) {
hasGameData_ = true;
parseGameData(_root.gameData);
clearInterval(checkGameDataIntervalId_);
game_.startGame();
}
}
}
function parseGameData(myData) {
gameData = new com.midasplayer.util.Map();
var _local2 = new XML();
_local2.ignoreWhite = true;
_local2.parseXML(myData);
var _local3 = _local2.firstChild;
if (_local3.nodeName == "gamedata") {
parseChild(_local3, "");
}
}
function parseChild(child, parentName) {
if (child == null) {
return(undefined);
}
var _local3 = parentName;
if (child.nodeName == "gamedata") {
_local3 = "";
} else if (parentName.length > 0) {
_local3 = (parentName + ".") + child.nodeName;
} else {
_local3 = child.nodeName;
}
if (child.nodeName == "text") {
com.midasplayer.util.I18n.addTranslation(String(child.attributes.id), String(child.firstChild));
}
for (var _local6 in child.attributes) {
var _local5;
var _local2 = child.attributes[_local6];
if (_local6 == "id") {
_local3 = _local3 + ("." + _local2);
} else if (_local3.length > 0) {
gameData.put((_local3 + ".") + _local6, _local2);
} else {
gameData.put(_local6, _local2);
}
}
if (!child.firstChild.hasChildNodes()) {
gameData.put(_local3, child.firstChild);
} else {
parseChild(child.firstChild, _local3);
}
if (child.nextSibling != null) {
parseChild(child.nextSibling, parentName);
}
}
static var GAME_MODE_DEBUG = 0;
static var GAME_MODE_PRACTICE = 1;
static var GAME_MODE_MONEY = 2;
static var GAME_TYPE_SINGLE = 0;
static var GAME_TYPE_MULTI = 1;
static var gameMode_ = GAME_MODE_DEBUG;
static var gameType_ = GAME_TYPE_SINGLE;
static var hasGameData_ = false;
}
Symbol 572 MovieClip [__Packages.com.midasplayer.util.Map] Frame 0
class com.midasplayer.util.Map
{
var map, lastSize;
function Map (init) {
map = new Object();
for (var _local3 in init) {
map["@" + _local3] = init[_local3];
}
lastSize = -1;
}
function put(key, value) {
map["@" + key] = value;
lastSize = -1;
}
function get(key) {
return(map["@" + key]);
}
function remove(key) {
var _local2 = map["@" + key];
delete map["@" + key];
lastSize = -1;
return(_local2);
}
function count() {
if (lastSize < 0) {
lastSize = 0;
for (var _local2 in map) {
lastSize++;
}
}
return(lastSize);
}
function size() {
return(count());
}
function clear() {
map = {};
lastSize = 0;
}
function dump() {
var _local2 = "";
for (var _local3 in map) {
_local2 = _local2 + "x";
_local2 = _local2 + (((_local3 + "=>") + map[_local3]) + newline);
}
}
function toArray() {
var _local2 = [];
for (var _local3 in map) {
_local2[_local2.length] = map[_local3];
}
return(_local2);
}
function keySet() {
var _local2 = [];
for (var _local3 in map) {
_local2[_local2.length] = _local3.substring(1);
}
return(_local2);
}
function foreach(fn) {
do {
if ((in map) == null) {
break;
}
var _local3 = in map;
} while (fn(_local3.substring(1), map[_local3]) != false);
do {
} while ("foreach" != null);
lastSize = -1;
}
}
Symbol 573 MovieClip [__Packages.com.midasplayer.util.ArrayList] Frame 0
class com.midasplayer.util.ArrayList
{
var value;
function ArrayList () {
value = new Array();
}
function insert(obj, pos) {
var _local3 = value.length;
if (pos == undefined) {
value.push(obj);
return(_local3);
}
if (pos > _local3) {
pos = _local3;
}
var _local2 = _local3 - 1;
while (_local2 > (pos - 1)) {
value[_local2 + 1] = value[_local2];
_local2--;
}
value[pos] = obj;
return(pos);
}
function get(pos) {
return(value[pos]);
}
function indexOf(obj) {
var _local2 = 0;
while (_local2 < value.length) {
if (obj == value[_local2]) {
return(_local2);
}
_local2++;
}
return(-1);
}
function remove(obj) {
return(removeByIndex(indexOf(obj)));
}
function removeByIndex(pos) {
var _local5;
var _local3 = value.length;
if ((pos < _local3) && (pos >= 0)) {
_local5 = value[pos];
delete value[pos];
var _local2 = pos;
while (_local2 < (_local3 - 1)) {
value[_local2] = value[_local2 + 1];
_local2++;
}
value.length = _local3 - 1;
}
return(_local5);
}
function size() {
return(value.length);
}
function clear() {
value = new Array();
}
function toArray() {
return(value);
}
function foreach(fn) {
var _local2 = 0;
var _local3 = value.length;
while (_local2 < _local3) {
if (fn(_local2, value[_local2]) == false) {
break;
}
_local2++;
}
}
function sortOn(field) {
value.sortOn(field);
}
function sort() {
value.sort();
}
function subList(from, to) {
if (!to) {
to = value.length;
}
var _local3 = new com.midasplayer.util.ArrayList();
var _local2 = from;
while (_local2 < to) {
_local3.insert(get(_local2));
_local2++;
}
return(_local3);
}
}
Symbol 574 MovieClip [__Packages.com.midasplayer.util.Log] Frame 0
class com.midasplayer.util.Log
{
function Log () {
}
static function setLevel(level) {
level_ = level;
}
static function debug(msg) {
if (level_ <= LEVEL_DEBUG) {
log_.insert(new com.midasplayer.util.LogEntry(LEVEL_DEBUG, msg));
}
}
static function warning(msg) {
if (level_ <= LEVEL_WARNING) {
log_.insert(new com.midasplayer.util.LogEntry(LEVEL_WARNING, msg));
}
}
static function error(msg) {
if (level_ <= LEVEL_ERROR) {
log_.insert(new com.midasplayer.util.LogEntry(LEVEL_ERROR, msg));
}
}
static function getLog() {
if (log_.size() != logStringLastUpdatedSize_) {
logString_ = "";
var _local1 = 0;
while (_local1 < log_.size()) {
var _local2 = com.midasplayer.util.LogEntry(log_.get(_local1));
if (_local1 > 0) {
logString_ = logString_ + newline;
}
logString_ = logString_ + LEVEL_STRINGS[_local2.getLevel()];
logString_ = logString_ + ": ";
logString_ = logString_ + _local2.getMessage();
logStringLastUpdatedSize_ = log_.size();
_local1++;
}
}
return(logString_);
}
static var LEVEL_ALL = -1;
static var LEVEL_NONE = 1000;
static var LEVEL_DEBUG = 0;
static var LEVEL_WARNING = 1;
static var LEVEL_ERROR = 2;
static var LEVEL_STRINGS = ["DEBUG", "WARNING", "ERROR"];
static var level_ = LEVEL_ALL;
static var log_ = new com.midasplayer.util.ArrayList();
static var logString_ = "";
static var logStringLastUpdatedSize_ = 0;
}
Symbol 575 MovieClip [__Packages.com.midasplayer.util.LogEntry] Frame 0
class com.midasplayer.util.LogEntry
{
var level_, message_;
function LogEntry (level, msg) {
level_ = level;
message_ = msg;
}
function getLevel() {
return(level_);
}
function getMessage() {
return(message_);
}
}
Symbol 576 MovieClip [__Packages.com.midasplayer.util.I18n] Frame 0
class com.midasplayer.util.I18n
{
function I18n () {
}
static function addTranslation(name, val) {
val = val.split("'").join("'");
val = val.split("&").join("&");
val = val.split("\r\n").join(newline);
translations_.put(name, val);
}
static function format(name, replace0, replace1, replace2) {
var _local3 = translations_.get(name);
if (_local3 == undefined) {
return(("{" + name) + "}");
}
var _local1 = _local3.toString();
if (replace0 != undefined) {
var _local2 = _local1.split("{0}");
_local1 = _local2.join(replace0);
if (replace1 != undefined) {
_local2 = _local1.split("{1}");
_local1 = _local2.join(replace1);
if (replace2 != undefined) {
_local2 = _local1.split("{2}");
_local1 = _local2.join(replace2);
}
}
}
return(_local1);
}
static var translations_ = new com.midasplayer.util.Map();
}
Symbol 577 MovieClip [__Packages.com.midasplayer.game.dond2.Game] Frame 0
class com.midasplayer.game.dond2.Game extends com.midasplayer.util.GameBase
{
static var lang;
var init, seed_, shortMode_, rules_, board_, introAnimDriver_, introSign_, introCase1_, introCase2_, endGamePressed_, logoAnimDriver_, signupSign_;
function Game () {
super();
Stage.showMenu = false;
_root._quality = "high";
_root._focusrect = false;
_root.gamemode = 2;
com.midasplayer.util.GameBase.setGameMode(_root.gamemode);
com.midasplayer.util.Log.setLevel(com.midasplayer.util.Log.LEVEL_NONE);
init(this);
}
function startGame() {
if (DEBUG_MODE) {
var _local2 = new com.midasplayer.game.dond2.Replay(this);
} else {
startGame2();
}
}
function startGame2() {
com.midasplayer.util.GameBase.reportGameStart();
seed_ = Number(com.midasplayer.util.GameBase.gameData.get("seed"));
shortMode_ = com.midasplayer.util.GameBase.gameData.get("mode") == "short";
rules_ = new com.midasplayer.game.dond2.Rules();
com.midasplayer.util.GameBase.reportPlayData(19, (VERSION + " ") + seed_, "0");
_root.bg = _root.attachMovie("bg", "bg", _root.getNextHighestDepth());
_root.logo = _root.attachMovie("logo", "logo", _root.getNextHighestDepth());
_root.logo._x = 170;
_root.logo._y = 8;
_root.rainlayer1 = _root.createEmptyMovieClip("rainlayer1", _root.getNextHighestDepth());
_root.board = _root.createEmptyMovieClip("board", _root.getNextHighestDepth());
_root.checklayer = _root.createEmptyMovieClip("checklayer", _root.getNextHighestDepth());
_root.rainlayer2 = _root.createEmptyMovieClip("rainlayer2", _root.getNextHighestDepth());
_root.infobox = _root.attachMovie("infobox", "infobox", _root.getNextHighestDepth());
_root.infobox._x = 178;
_root.infobox._y = -260;
board_ = new com.midasplayer.game.dond2.Board(rules_, seed_, _root.board);
_root.instructionsShowed = false;
showIntro();
}
function showIntro() {
_root.movie = _root.attachMovie("intro", "movie", _root.getNextHighestDepth());
playIntroSound();
introAnimDriver_ = new com.midasplayer.util.AnimDriver(_root.movie, 15);
introAnimDriver_.playOnce();
com.midasplayer.util.AnimPlayer.delay({callback:showInstructions, callback_scope:this, millis:11000});
_root.board._visible = true;
_root.movie.onPress = function () {
_root.game.showInstructions();
};
}
function showInstructions() {
if (_root.instructionsShowed) {
return(undefined);
}
_root.instructionsShowed = true;
_root.movie.removeMovieClip();
_root.lowerbar = _root.attachMovie("lowerbar", "lowerbar", _root.getNextHighestDepth());
_root.lowerbar._x = 3;
_root.lowerbar._y = 549;
_root.lowerbar.endgame.text = com.midasplayer.util.I18n.format("end_game");
_root.lowerbar.sound.text = com.midasplayer.util.I18n.format("sound_off");
_root.lowerbar.endgamebtn.onPress = function () {
_root.game.endGamePressed();
};
_root.lowerbar.soundbtn.onPress = function () {
_root.game.switchSound();
};
introSign_ = new com.midasplayer.game.dond2.Sign(_root, Stage.width - 100, 430, 50, 80);
_root.instructions = introSign_.attach("instructions", 0, 0);
_root.instructions.text1.text = com.midasplayer.util.I18n.format("instructions");
_root.instructions.note.text = com.midasplayer.util.I18n.format("instructions_note");
_root.instructions.casetext1.text = com.midasplayer.util.I18n.format("instructions_case1");
_root.instructions.casetext2.text = com.midasplayer.util.I18n.format("instructions_case2");
introCase1_ = new com.midasplayer.game.dond2.Case(undefined, _root.instructions, 1);
introCase1_.setFrame(46);
introCase1_.setScale(38);
introCase1_.setX(482);
introCase1_.setY(25);
introCase1_.showIntroQuestion();
introCase2_ = new com.midasplayer.game.dond2.Case(undefined, _root.instructions, 2);
introCase2_.setFrame(46);
introCase2_.setScale(38);
introCase2_.setX(482);
introCase2_.setY(165);
introCase2_.showIntroRotation();
introSign_.show();
_root.instructions.time_to_start.text = "";
_root.instructions.onPress = function () {
this.clicked = true;
};
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:showInstructionsAnim}], callback:showInstructionsEnd, callback_scope:this, tps:50});
}
function showInstructionsAnim(tick, alpha) {
var _local4 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 1000);
var _local3 = Math.ceil(20 - (_local4 * 20));
if (_local3 == 0) {
_local3 = "";
}
_root.instructions.time_to_start.text = _local3;
if (_root.instructions.clicked || (endGamePressed_)) {
_local4 = 1;
}
return(_local4 == 1);
}
function showInstructionsEnd() {
_root.movie.stop();
_root.movie.removeMovieClip();
introSign_.remove();
com.midasplayer.util.AnimPlayer.delay({callback:startBoard, callback_scope:this, millis:1000});
}
function startBoard() {
logoAnimDriver_ = new com.midasplayer.util.AnimDriver(_root.logo, 20);
logoAnimDriver_.playStart(1);
board_.start();
if (endGamePressed_) {
board_.endGamePressed();
}
}
function quitGame() {
if ((com.midasplayer.util.GameBase.gameData.get("mode") == "standalone") || (_root.registrationEnabled == "true")) {
showSignUp();
return(undefined);
}
com.midasplayer.fx.SoundManager.stopAll();
com.midasplayer.util.GameBase.reportGameQuit();
}
function showSignUp() {
signupSign_ = new com.midasplayer.game.dond2.Sign(_root, Stage.width - 50, 450, 25, 55);
_root.signup = signupSign_.attach("signup", 0, 0);
var _local3 = _root.signup;
_local3.in_username.tabIndex = 1;
_local3.in_password.tabIndex = 2;
_local3.in_password2.tabIndex = 3;
_local3.in_email.tabIndex = 4;
_local3.btn_email.tabIndex = 5;
_local3.btn_check.tabIndex = 6;
_local3.btn_submit.tabIndex = 7;
_local3.btn_check.gotoAndStop(2);
_local3.btn_check.onPress = function () {
if (this._currentframe != 2) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
};
_local3.btn_email.gotoAndStop(2);
_local3.btn_email.onPress = function () {
if (this._currentframe != 2) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
};
_local3.btn_play.onRelease = function () {
getURL ("javascript:window.location.reload();");
};
_local3.btn_submit.form = _local3;
_local3.btn_submit.onPress = function () {
this.gotoAndStop(2);
};
_local3.btn_submit.onRelease = function () {
this.gotoAndStop(1);
var _local5 = this.form.in_username.text;
var _local3 = this.form.in_password.text;
var _local4 = this.form.in_password2.text;
var _local2 = this.form.in_email.text;
var _local6 = ((this.form.btn_email._currentframe == 2) ? "true" : "false");
if (_local5.length < 2) {
this.form.error_txt.text = "The username is too short.";
} else if (_local3.length < 3) {
this.form.error_txt.text = "The password is too short.";
} else if (_local3 != _local4) {
this.form.error_txt.text = "The password does not match.";
} else if (_local2.length < 6) {
this.form.error_txt.text = "Invalid email.";
} else if (_local2.indexOf("@") < 0) {
this.form.error_txt.text = "Invalid email.";
} else if (_local2.indexOf(".") < 0) {
this.form.error_txt.text = "Invalid email.";
} else if (this.form.btn_check._currentframe != 2) {
this.form.error_txt.text = "Please check the box and confirming your interest in the Deal or No Deal skill game.";
this.form.btn_check.gotoAndPlay(3);
} else {
this.form.error_txt.text = "";
this.form.username = _local5;
this.form.password = _local3;
this.form.password_validation = _local4;
this.form.email = _local2;
this.form.wantsEmail = _local6;
this.form.gameType = "dond2_game";
this.form.partner = com.midasplayer.util.GameBase.gameData.get("partner");
if (this.form.partner == undefined) {
this.form.partner = "nbc";
}
this.form.getURL("https://www.king.com/partnerpages/auto_register.jsp", "_top", "POST");
}
};
signupSign_.show();
}
function isShortMode() {
return(shortMode_);
}
static function playIntroSound() {
if (lang == "en") {
com.midasplayer.fx.SoundManager.play("intro_en", 100, true);
} else {
com.midasplayer.fx.SoundManager.play("intro_theme_full_quality", 100, false, function () {
com.midasplayer.fx.SoundManager.play("Bank offers deal - heat", 100, true);
});
}
}
static function stopIntroSound() {
com.midasplayer.fx.SoundManager.stop("intro_theme_full_quality");
}
static function playBankOfferSound() {
if (lang == "en") {
com.midasplayer.fx.SoundManager.play("bankeroffer_en", 100, true);
} else {
com.midasplayer.fx.SoundManager.play("Bank offers deal - heat", 100, true);
}
}
static function stopBankOfferSound() {
if (lang == "en") {
com.midasplayer.fx.SoundManager.stop("bankeroffer_en");
} else {
com.midasplayer.fx.SoundManager.stop("Bank offers deal - heat");
}
}
static function playPickingSound() {
if (lang == "en") {
com.midasplayer.fx.SoundManager.play("picking_en", 100, true);
} else {
com.midasplayer.fx.SoundManager.play("background when pickign cases", 100, true);
}
}
static function stopPickingSound() {
if (lang == "en") {
com.midasplayer.fx.SoundManager.stop("picking_en");
} else {
com.midasplayer.fx.SoundManager.stop("background when pickign cases");
}
}
static function playGameEndSound() {
if (lang == "en") {
com.midasplayer.fx.SoundManager.play("gameoversnd_en");
} else {
com.midasplayer.fx.SoundManager.play("game end");
}
}
function endGamePressed() {
endGamePressed_ = true;
if (board_ != undefined) {
board_.endGamePressed();
}
}
function switchSound() {
if (com.midasplayer.fx.SoundManager.isSoundEnabled()) {
_root.lowerbar.sound.text = com.midasplayer.util.I18n.format("sound_on");
} else {
_root.lowerbar.sound.text = com.midasplayer.util.I18n.format("sound_off");
}
com.midasplayer.fx.SoundManager.enableSounds(!com.midasplayer.fx.SoundManager.isSoundEnabled());
}
static var VERSION = "1.0.0";
static var DEBUG_MODE = false;
}
Symbol 578 MovieClip [__Packages.com.midasplayer.timing.Timeable] Frame 0
interface com.midasplayer.timing.Timeable
{
}
Symbol 579 MovieClip [__Packages.com.midasplayer.game.dond2.Board] Frame 0
class com.midasplayer.game.dond2.Board implements com.midasplayer.timing.Timeable
{
static var blurFilters_;
var rules_, layer_, livesLeft_, random_, comm_, clip_, prizeLayer_, caseLayer_, dealLayer_, infoBox_, timer_, prizes_, questions_, questionNumber_, cases_, casesLeft_, numCases_, clickedCase_, ownCase_, round_, endGamePressed_, state_, autoPickId_, deal_, lastAnswerCorrect_, started_, stopped_;
function Board (rules, seed, layer) {
rules_ = rules;
layer_ = layer;
livesLeft_ = rules_.getNumLives();
random_ = new com.midasplayer.util.Random(seed);
comm_ = new com.midasplayer.game.dond2.Comm();
clip_ = layer_.createEmptyMovieClip("boardlayer", layer_.getNextHighestDepth());
prizeLayer_ = layer_.createEmptyMovieClip("prizelayer", layer_.getNextHighestDepth());
caseLayer_ = layer_.createEmptyMovieClip("caselayer", layer_.getNextHighestDepth());
dealLayer_ = layer_.createEmptyMovieClip("deallayer", layer_.getNextHighestDepth());
infoBox_ = new com.midasplayer.game.dond2.InfoBox();
blurFilters_ = new Array();
var _local2 = 0;
while (_local2 < 35) {
var _local3 = new flash.filters.BlurFilter(_local2, _local2, 2);
blurFilters_.push([_local3]);
_local2++;
}
initTimer();
initPrizes();
initQuestions();
initCases();
}
function initTimer() {
timer_ = new com.midasplayer.timing.Timer(this, TPS);
clip_.timer = timer_;
clip_.onEnterFrame = function () {
this.timer.advanceTime2();
};
}
function removeTimer() {
clip_.onEnterFrame = undefined;
delete timer_;
}
function initPrizes() {
prizes_ = new Array();
var _local5 = com.midasplayer.game.dond2.Rules.PRIZES.length;
var _local2 = 0;
while (_local2 < _local5) {
var _local4 = _local2 < (_local5 / 2);
var _local3 = new com.midasplayer.game.dond2.Prize(prizeLayer_, com.midasplayer.game.dond2.Rules.PRIZES[_local2].value, _local4, com.midasplayer.util.I18n.format("currency_symbol"), "" + rules_.prizeToText(com.midasplayer.game.dond2.Rules.PRIZES[_local2].value));
prizes_.push(_local3);
var _local6 = ((_local2 % (_local5 / 2)) * 37) + 30;
var _local7 = (_local4 ? -230 : 845);
_local3.setY(_local6);
_local3.setX(_local7);
_local2++;
}
}
function fixStr(s) {
s = s.split("'").join("'");
s = s.split(""").join("\"");
s = s.split("&").join("&");
return(s);
}
function initQuestions() {
questions_ = new Array();
questionNumber_ = 0;
var _local2 = 0;
while (_local2 < 10) {
var _local4 = String(com.midasplayer.util.GameBase.gameData.get(("question." + (_local2 + 1)) + ".question"));
var _local8 = String(com.midasplayer.util.GameBase.gameData.get(("question." + (_local2 + 1)) + ".choice.1"));
var _local7 = String(com.midasplayer.util.GameBase.gameData.get(("question." + (_local2 + 1)) + ".choice.2"));
var _local6 = String(com.midasplayer.util.GameBase.gameData.get(("question." + (_local2 + 1)) + ".choice.3"));
var _local5 = String(com.midasplayer.util.GameBase.gameData.get(("question." + (_local2 + 1)) + ".choice.4"));
var _local9 = com.midasplayer.util.GameBase.gameData.get(("question." + (_local2 + 1)) + ".difficulty");
if (_local4 != null) {
var _local3 = new com.midasplayer.game.dond2.Question();
_local4 = fixStr(_local4);
_local8 = fixStr(_local8);
_local7 = fixStr(_local7);
_local6 = fixStr(_local6);
_local5 = fixStr(_local5);
_local3.question = _local4;
_local3.choice1 = _local8;
_local3.choice2 = _local7;
_local3.choice3 = _local6;
_local3.choice4 = _local5;
_local3.difficulty = _local9;
questions_.push(_local3);
}
_local2++;
}
}
function initCases() {
var _local3;
cases_ = new Array();
casesLeft_ = new com.midasplayer.util.ArrayList();
var _local2 = 0;
while (_local2 < casePositions_.length) {
_local3 = new com.midasplayer.game.dond2.Case(this, caseLayer_, _local2 + 1);
_local3.setX(rowProperties[casePositions_[_local2].row].x + (rowProperties[casePositions_[_local2].row].dx * casePositions_[_local2].col));
_local3.setY(rowProperties[casePositions_[_local2].row].y);
_local3.setScale(rowProperties[casePositions_[_local2].row].scale);
_local3.setBrightness(rowProperties[casePositions_[_local2].row].brightness);
_local3.setRotation(casePositions_[_local2].rot);
_local3.setClickable(false);
cases_.push(_local3);
casesLeft_.insert(_local3);
_local2++;
}
numCases_ = cases_.length;
}
function activateCases() {
clickedCase_ = undefined;
var _local3;
var _local2 = 0;
while (_local2 < numCases_) {
_local3 = cases_[_local2];
if (_local3 != ownCase_) {
_local3.setClickable(true);
}
_local2++;
}
}
function deactivateCases() {
var _local3;
var _local2 = 0;
while (_local2 < numCases_) {
_local3 = cases_[_local2];
_local3.setClickable(false);
_local2++;
}
}
function removeCases() {
var _local3;
var _local2 = 0;
while (_local2 < numCases_) {
_local3 = cases_[_local2];
_local3.remove();
_local2++;
}
}
function getLowestPrizes() {
var _local4 = new Array();
var _local5 = com.midasplayer.game.dond2.Rules.PRIZES.length;
var _local7 = Math.ceil(rules_.getNumPrizesLeft(prizes_) / 3);
var _local6 = ((_local7 > 6) ? (_local7) : 6);
var _local2 = 0;
while (_local2 < _local5) {
var _local3 = prizes_[_local2];
if (!_local3.isRemoved()) {
_local4.unshift(_local3);
}
if (_local4.length == _local6) {
break;
}
_local2++;
}
return(_local4);
}
function getHighestPrizes() {
var _local4 = new Array();
var _local5 = com.midasplayer.game.dond2.Rules.PRIZES.length;
var _local7 = Math.ceil(rules_.getNumPrizesLeft(prizes_) / 3);
var _local6 = ((_local7 > 6) ? (_local7) : 6);
var _local2 = _local5 - 1;
while (_local2 >= 0) {
var _local3 = prizes_[_local2];
if (!_local3.isRemoved()) {
_local4.push(_local3);
}
if (_local4.length == _local6) {
break;
}
_local2--;
}
return(_local4);
}
function removeCase(c) {
c.remove();
}
function getRandomCase() {
var _local14 = casesLeft_.size();
var _local12 = round_.getCases();
var _local13 = _local12.length;
var _local9 = 0;
while (_local9 < 20) {
var _local11 = random_.nextInt(_local14);
var _local8 = com.midasplayer.game.dond2.Case(casesLeft_.get(_local11));
var _local7 = casePositions_[_local8.getNum() - 1].row;
var _local10 = casePositions_[_local8.getNum() - 1].col;
var _local6 = false;
var _local2 = 0;
while (_local2 < _local13) {
var _local3 = com.midasplayer.game.dond2.Case(_local12[_local2]);
var _local5 = casePositions_[_local3.getNum() - 1].row;
var _local4 = casePositions_[_local3.getNum() - 1].col;
if ((Math.abs(_local5 - _local7) <= 1) && (Math.abs(_local4 - _local10) <= 1)) {
_local6 = true;
}
_local2++;
}
if (!_local6) {
break;
}
_local9++;
}
return(casesLeft_.removeByIndex(_local11));
}
function blurIn() {
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:blurInAnim}], callback:blurInAnimEnd, callback_scope:this, tps:50});
}
function blurInAnim(tick, alpha) {
var _local3 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 30);
var _local4 = Math.floor(24 * (1 - _local3));
_root.bg.filters = blurFilters_[_local4];
caseLayer_.filters = blurFilters_[_local4];
return(_local3 == 1);
}
function blurInAnimEnd() {
}
function blurOut() {
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:blurOutAnim, params:{clip:_root.bg, len:24}}], callback:undefined, callback_scope:this, tps:50});
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:blurOutAnim, params:{clip:caseLayer_, len:24}}], callback:undefined, callback_scope:this, tps:50});
}
function blurOutBg() {
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:blurOutAnim, params:{clip:_root.bg, len:24}}], callback:undefined, callback_scope:this, tps:50});
}
function blurOutDeal() {
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:blurOutAnim, params:{clip:dealLayer_, len:10}}], callback:undefined, callback_scope:this, tps:50});
}
function blurOutAnim(tick, alpha, params) {
var _local1 = 1 - com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 15);
var _local2 = Math.floor(params.len * (1 - _local1));
params.clip.filters = blurFilters_[_local2];
return(_local1 == 0);
}
function prizesIn() {
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:prizesInAnim}], callback:undefined, callback_scope:this, tps:50});
}
function prizesInAnim(tick, alpha) {
var _local8 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 30);
var _local7 = com.midasplayer.game.dond2.Rules.PRIZES.length;
var _local2 = 0;
while (_local2 < _local7) {
var _local4 = _local2 < (_local7 / 2);
var _local5 = prizes_[_local2];
var _local3 = _local8 * 200;
var _local6 = (_local4 ? (-230 + _local3) : (845 - _local3));
_local5.setX(_local6);
_local2++;
}
return(_local8 == 1);
}
function prizesOut() {
var _local2 = prizes_[0];
var _local3 = _local2.getX();
var _local6 = _local3 + 230;
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:prizesOutAnim, params:{dx:_local6}}], callback:undefined, callback_scope:this, tps:50});
}
function prizesOutAnim(tick, alpha, params) {
var _local8 = 1 - com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 30);
var _local7 = com.midasplayer.game.dond2.Rules.PRIZES.length;
var _local2 = 0;
while (_local2 < _local7) {
var _local4 = _local2 < (_local7 / 2);
var _local5 = prizes_[_local2];
var _local3 = _local8 * params.dx;
var _local6 = (_local4 ? (-230 + _local3) : (845 - _local3));
_local5.setX(_local6);
_local2++;
}
return(_local8 == 0);
}
function start() {
if (endGamePressed_) {
return(undefined);
}
askPickOwnCase();
}
function stop() {
}
function askPickOwnCase() {
if (endGamePressed_) {
return(undefined);
}
infoBox_.setText(com.midasplayer.util.I18n.format("pick_your_case"));
infoBox_.show();
state_ = STATE_PICK_OWN_CASE;
activateCases();
autoPickId_ = com.midasplayer.util.AnimPlayer.delay({callback:autoPickCase, callback_scope:this, millis:7000});
}
function autoPickCase() {
if (endGamePressed_) {
return(undefined);
}
if (clickedCase_ == undefined) {
caseClicked(com.midasplayer.game.dond2.Case(casesLeft_.get(0)));
}
}
function ownCasePicked() {
if (endGamePressed_) {
return(undefined);
}
if (ownCase_ != undefined) {
return(undefined);
}
infoBox_.remove();
ownCase_ = clickedCase_;
clickedCase_.markAsOwn();
com.midasplayer.util.GameBase.reportPlayData(40, "" + clickedCase_.getNum(), "0");
casesLeft_.remove(clickedCase_);
}
function caseMarkedAsOwn() {
if (endGamePressed_) {
return(undefined);
}
com.midasplayer.util.AnimPlayer.delay({callback:startRound, callback_scope:this, millis:200});
}
function startRound() {
if (endGamePressed_) {
return(undefined);
}
com.midasplayer.game.dond2.Game.stopIntroSound();
com.midasplayer.game.dond2.Game.playPickingSound();
round_ = rules_.getNextRound();
com.midasplayer.util.GameBase.reportPlayData(10, "" + round_.getRoundNum(), "0");
if (_root.game.isShortMode() && (round_.getRoundNum() == 3)) {
shortModeExit();
return(undefined);
}
askPickQuestionCase();
}
function endRound() {
if (endGamePressed_) {
return(undefined);
}
if (rules_.getNumPrizesLeft(prizes_) == 1) {
showFinalCase();
return(undefined);
}
showDeal();
}
function showDeal() {
if (endGamePressed_) {
return(undefined);
}
blurOut();
com.midasplayer.game.dond2.Game.stopPickingSound();
com.midasplayer.game.dond2.Game.playBankOfferSound();
var _local2 = rules_.getBankOffer(prizes_);
com.midasplayer.util.GameBase.reportPlayData(80, "" + _local2, "0");
deal_ = new com.midasplayer.game.dond2.Deal(dealLayer_, this, _local2);
deal_.clip_.lives.gotoAndStop(4 - livesLeft_);
}
function dealEnded(dealTaken) {
if (endGamePressed_) {
return(undefined);
}
com.midasplayer.game.dond2.Game.stopBankOfferSound();
if (dealTaken) {
showDealTaken();
} else {
com.midasplayer.util.GameBase.reportPlayData(89, "", "0");
blurIn();
deal_.remove();
prizesOut();
com.midasplayer.util.AnimPlayer.delay({callback:startRound, callback_scope:this, millis:500});
}
}
function askPickQuestionCase() {
if (endGamePressed_) {
return(undefined);
}
infoBox_.setText(com.midasplayer.util.I18n.format("pick_question_case"));
infoBox_.show();
state_ = STATE_PICK_QUESTION_CASE;
activateCases();
autoPickId_ = com.midasplayer.util.AnimPlayer.delay({callback:autoPickCase, callback_scope:this, millis:7000});
}
function questionCasePicked() {
if (endGamePressed_) {
return(undefined);
}
infoBox_.remove();
casesLeft_.remove(clickedCase_);
com.midasplayer.util.GameBase.reportPlayData(41, "" + clickedCase_.getNum(), "0");
com.midasplayer.fx.SoundManager.play("Question case chosen", 80);
clickedCase_.zoomUp();
}
function caseZoomedUp() {
if (endGamePressed_) {
return(undefined);
}
var _local2 = questions_[questionNumber_];
clickedCase_.openQuestion(_local2);
}
function questionCaseOpen() {
if (endGamePressed_) {
return(undefined);
}
clickedCase_.clip_.lives.gotoAndStop(4 - livesLeft_);
clickedCase_.clip_.lives._alpha = 100;
}
function questionAnswerPressed(choice) {
if (endGamePressed_) {
return(undefined);
}
comm_.submitAnswer(questionNumber_, choice, 1000 * clickedCase_.getAnswerTimeLeft(), this, questionAnswerChecked);
}
function questionAnswerChecked(id, time, choice, correct, checksum) {
if (endGamePressed_) {
return(undefined);
}
var _local6 = clickedCase_.getQuestion();
_local6.correct = correct;
var _local7 = -1;
lastAnswerCorrect_ = true;
var _local2 = 0;
if (choice != correct) {
_local7 = choice;
lastAnswerCorrect_ = false;
com.midasplayer.fx.SoundManager.play("negative sting 1 -life lost", 100);
} else {
com.midasplayer.fx.SoundManager.play("positive sting 1", 100);
}
_local2 = rules_.getAnswerBonus(_local6, choice, time / 1000);
if (lastAnswerCorrect_) {
new com.midasplayer.game.dond2.ScorePopup(((com.midasplayer.util.I18n.format("correct") + newline) + com.midasplayer.util.I18n.format("currency_symbol")) + rules_.prizeToText(_local2), 1);
com.midasplayer.util.GameBase.reportPlayData(61, (((((((((("" + id) + " ") + time) + " ") + choice) + " ") + correct) + " ") + checksum) + " ") + _local2, "0");
} else {
livesLeft_--;
var _local5;
if (livesLeft_ > 1) {
_local5 = com.midasplayer.util.I18n.format("lives_left", "" + livesLeft_);
} else if (livesLeft_ == 1) {
_local5 = com.midasplayer.util.I18n.format("life_left", "" + livesLeft_);
} else {
_local5 = com.midasplayer.util.I18n.format("zero_lives_left");
}
new com.midasplayer.game.dond2.ScorePopup((com.midasplayer.util.I18n.format("incorrect") + newline) + _local5, 2);
com.midasplayer.util.GameBase.reportPlayData(62, (((((((((("" + id) + " ") + time) + " ") + choice) + " ") + correct) + " ") + checksum) + " ") + _local2, "0");
}
clickedCase_.clip_.lives.gotoAndStop(4 - livesLeft_);
clickedCase_.markAnswer(_local7, correct);
}
function answerMarked() {
if (endGamePressed_) {
return(undefined);
}
com.midasplayer.util.AnimPlayer.delay({callback:answerMarked2, callback_scope:this, millis:1000});
}
function answerMarked2() {
if (endGamePressed_) {
return(undefined);
}
if (livesLeft_ == 0) {
showGameOver();
return(undefined);
}
clickedCase_.zoomDown();
questionNumber_++;
prizesIn();
}
function caseZoomedDown() {
if (endGamePressed_) {
return(undefined);
}
var _local5;
var _local4;
if (lastAnswerCorrect_) {
_local5 = getLowestPrizes();
_local4 = 0 + ((round_.getRoundNum() / 2) / com.midasplayer.game.dond2.Rules.ROUNDS.length);
} else {
_local5 = getHighestPrizes();
_local4 = 0.5 + ((round_.getRoundNum() / 2) / com.midasplayer.game.dond2.Rules.ROUNDS.length);
}
clickedCase_.openRotation(_local5, _local4);
com.midasplayer.util.GameBase.reportPlayData(42, "" + clickedCase_.getNum(), "0");
round_.caseOpened(clickedCase_);
var _local2;
var _local3 = 0;
while (_local3 < (round_.getNumCasesToOpen() - 1)) {
_local2 = getRandomCase();
_local2.openRotation(_local5, _local4);
com.midasplayer.util.GameBase.reportPlayData(42, "" + _local2.getNum(), "0");
round_.caseOpened(_local2);
_local3++;
}
}
function caseRotated(c) {
if (endGamePressed_) {
return(undefined);
}
removeCase(c);
round_.caseClosed(c);
if (round_.isRoundEnded()) {
endRound();
}
}
function casePrizePressed(c, p) {
if (endGamePressed_) {
return(undefined);
}
com.midasplayer.fx.SoundManager.play("clear case", 40);
p.remove();
com.midasplayer.util.GameBase.reportPlayData(50, (c.getNum() + " ") + p.getValue(), "0");
var _local4 = round_.getCases();
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
if (_local3 != c) {
_local3.removePrize(p);
}
_local2++;
}
}
function caseClicked(c) {
com.midasplayer.util.AnimPlayer.stop(autoPickId_);
if (endGamePressed_) {
return(undefined);
}
deactivateCases();
clickedCase_ = c;
if (state_ == STATE_PICK_OWN_CASE) {
ownCasePicked();
} else if (state_ == STATE_PICK_QUESTION_CASE) {
questionCasePicked();
}
}
function endGamePressed() {
if (endGamePressed_) {
return(undefined);
}
com.midasplayer.util.GameBase.reportPlayData(99, "", "0");
endGamePressed_ = true;
_root.lowerbar._visible = false;
deactivateCases();
removeCases();
prizesOut();
blurOut();
blurOutDeal();
infoBox_.remove();
showCheck(0, rules_.getTotalBonus());
}
function showGameOver() {
com.midasplayer.util.GameBase.reportPlayData(92, "", "0");
_root.lowerbar._visible = false;
blurOut();
if (livesLeft_ == 0) {
showCheck(0, rules_.getTotalBonus());
}
}
function showDealTaken() {
_root.lowerbar._visible = false;
prizesOut();
blurOutDeal();
var _local4 = deal_.getDealValue();
com.midasplayer.util.GameBase.reportPlayData(90, "" + _local4, "0");
if (_local4 > 100000) {
var _local3 = (_local4 - 100000) / 1000000;
if (_local3 > 1) {
_local3 = 1;
}
_local3 = _local3 * _local3;
new com.midasplayer.game.dond2.Rain("confetti1", 20 + (_local3 * 40));
new com.midasplayer.game.dond2.Rain("confetti2", 20 + (_local3 * 40));
}
showCheck(deal_.getDealValue() - rules_.getTotalBonus(), rules_.getTotalBonus());
}
function showFinalCase() {
_root.lowerbar._visible = false;
prizesOut();
blurOutBg();
var _local5 = rules_.getFinalPrize(prizes_);
var _local3 = _local5.getValue();
com.midasplayer.util.GameBase.reportPlayData(91, "" + Math.floor(_local3), "0");
var _local4 = com.midasplayer.util.I18n.format("currency_symbol") + rules_.prizeToText(_local3);
ownCase_.showFinalPrize(_local4);
com.midasplayer.util.AnimPlayer.delay({callback:playFinalSound, callback_scope:this, millis:600});
com.midasplayer.util.AnimPlayer.delay({callback:showMoney, callback_scope:this, millis:800});
com.midasplayer.util.AnimPlayer.delay({callback:showFinalCaseCheck, callback_scope:this, millis:4000});
}
function playFinalSound() {
com.midasplayer.game.dond2.Game.stopPickingSound();
com.midasplayer.fx.SoundManager.play("Last case opens positive", 100);
}
function showMoney() {
_root.lowerbar._visible = false;
var _local5 = rules_.getFinalPrize(prizes_);
var _local4 = _local5.getValue();
if (_local4 > 100000) {
var _local3 = (_local4 - 100000) / 1000000;
if (_local3 > 1) {
_local3 = 1;
}
_local3 = _local3 * _local3;
new com.midasplayer.game.dond2.Rain("coin1", 12 + (_local3 * 20));
new com.midasplayer.game.dond2.Rain("coin2", 12 + (_local3 * 20));
new com.midasplayer.game.dond2.Rain("money1", 2 + (_local3 * 30));
}
}
function showFinalCaseCheck() {
_root.lowerbar._visible = false;
ownCase_.removeFinalPrize();
var _local3 = rules_.getFinalPrize(prizes_);
showCheck(_local3.getValue(), rules_.getTotalBonus());
}
function showCheck(score, bonus) {
com.midasplayer.game.dond2.Game.playGameEndSound();
var _local3 = Math.floor(score + bonus);
com.midasplayer.util.GameBase.reportGameEnd(_local3);
var _local6 = com.midasplayer.util.I18n.format("currency_symbol") + rules_.prizeToText(score);
var _local4 = com.midasplayer.util.I18n.format("currency_symbol") + rules_.prizeToText(bonus);
var _local5 = com.midasplayer.util.I18n.format("currency_symbol") + rules_.prizeToText(_local3);
new com.midasplayer.game.dond2.Check(_local6, _local4, _local5);
com.midasplayer.util.AnimPlayer.delay({callback:_root.game.quitGame, callback_scope:_root.game, millis:6000});
}
function shortModeExit() {
_root.lowerbar._visible = false;
var _local2 = new com.midasplayer.game.dond2.Sign(_root, Stage.width - 200, 230, 100, 140);
_local2.attach("opengameover", 70, 20);
_local2.show();
com.midasplayer.util.GameBase.reportGameEnd(0);
com.midasplayer.util.AnimPlayer.delay({callback:_root.game.quitGame, callback_scope:_root.game, millis:4000});
}
function tick(tick) {
if (started_ && (!stopped_)) {
}
}
function render(tick, alpha) {
}
static var TPS = 25;
static var STATE_PICK_OWN_CASE = 1;
static var STATE_PICK_QUESTION_CASE = 2;
var rowProperties = [{y:99, scale:22, brightness:82, x:207, dx:53}, {y:143, scale:24, brightness:50, x:163, dx:58}, {y:195, scale:27, brightness:20, x:128, dx:67}, {y:260, scale:32, brightness:0, x:120, dx:80}];
var casePositions_ = [{col:0, row:3, rot:-1}, {col:1, row:3, rot:0}, {col:2, row:3, rot:0}, {col:3, row:3, rot:0}, {col:4, row:3, rot:0}, {col:5, row:3, rot:0}, {col:0, row:2, rot:0}, {col:1, row:2, rot:0}, {col:2, row:2, rot:0}, {col:3, row:2, rot:0}, {col:4, row:2, rot:0}, {col:5, row:2, rot:0}, {col:6, row:2, rot:0}, {col:0, row:1, rot:0}, {col:1, row:1, rot:0}, {col:2, row:1, rot:0}, {col:3, row:1, rot:0}, {col:4, row:1, rot:0}, {col:5, row:1, rot:0}, {col:6, row:1, rot:0}, {col:0, row:0, rot:0}, {col:1, row:0, rot:0}, {col:2, row:0, rot:0}, {col:3, row:0, rot:0}, {col:4, row:0, rot:0}, {col:5, row:0, rot:0}];
}
Symbol 580 MovieClip [__Packages.com.midasplayer.timing.Timer] Frame 0
class com.midasplayer.timing.Timer
{
var timeable;
function Timer (timeable, gameTicksPerSecond) {
millisPerGameTick = 1000 / gameTicksPerSecond;
this.gameTicksPerSecond = gameTicksPerSecond;
this.timeable = timeable;
maxTickTime = 500;
}
function getMillisPerTick() {
return(millisPerGameTick);
}
function getTicksPerSecond() {
return(gameTicksPerSecond);
}
function setMaxTickTime(millis) {
maxTickTime = millis;
}
function advanceTime2() {
var _local3 = getTimer();
if (startTime < 0) {
startTime = _local3;
unprocessedTime = millisPerGameTick;
}
time = _local3 - startTime;
var _local5 = time - lastTime;
lastTime = time;
unprocessedTime = unprocessedTime + _local5;
if (unprocessedTime >= millisPerGameTick) {
var _local2 = maxTickTime + _local3;
do {
timeable.tick(tick);
tick++;
if ((tick % gameTicksPerSecond) == 0) {
fps = frames;
frames = 0;
}
unprocessedTime = unprocessedTime - millisPerGameTick;
} while ((unprocessedTime >= millisPerGameTick) && (getTimer() < _local2));
}
var _local4 = (unprocessedTime % millisPerGameTick) / millisPerGameTick;
com.midasplayer.timing.IFloat.setAlpha(_local4);
timeable.render(tick, _local4);
frames++;
}
function advanceTime() {
time = getTimer();
var _local3 = time - lastTime;
lastTime = time;
unprocessedTime = unprocessedTime + _local3;
var _local2 = 0;
while (unprocessedTime > millisPerGameTick) {
unprocessedTime = unprocessedTime - millisPerGameTick;
timeable.tick(tick);
tick++;
_local2++;
if (_local2 >= 10) {
unprocessedTime = 0;
}
}
var _local4 = unprocessedTime / millisPerGameTick;
timeable.render(tick, _local4);
}
var time = 0;
var startTime = -1;
var lastTime = 0;
var unprocessedTime = 0;
var gameTicksPerSecond = 0;
var tick = 0;
var millisPerGameTick = 0;
var maxTickTime = -1;
var frames = 0;
var fps = 0;
}
Symbol 581 MovieClip [__Packages.com.midasplayer.timing.IFloat] Frame 0
class com.midasplayer.timing.IFloat
{
static var alpha;
var ivalue, lastValue;
function IFloat (initial) {
ivalue = initial;
lastValue = initial;
alpha = 0;
}
function setTo(initial) {
ivalue = initial;
lastValue = initial;
}
function set(newValue) {
lastValue = ivalue;
ivalue = newValue;
}
function get(lalpha) {
return(lastValue + ((ivalue - lastValue) * lalpha));
}
static function setAlpha(na) {
alpha = na;
}
function get value() {
return(lastValue + ((ivalue - lastValue) * alpha));
}
function set value(v) {
ivalue = v;
lastValue = v;
//return(value);
}
}
Symbol 582 MovieClip [__Packages.com.midasplayer.game.dond2.Comm] Frame 0
class com.midasplayer.game.dond2.Comm
{
var clip_, cbObject_, cbFunction_;
function Comm () {
var _local3 = _root.getNextHighestDepth();
clip_ = _root.createEmptyMovieClip("communictor", _local3);
clip_.onEnterFrame = mx.utils.Delegate.create(this, onEnterFrame);
}
function submitAnswer(id, answer, timeLeft, cbObject, cbFunction) {
cbObject_ = cbObject;
cbFunction_ = cbFunction;
var _local2 = new String();
_local2 = ((((("<answer id=\"" + id) + "\" time=\"") + timeLeft) + "\">") + answer) + "</answer>";
fscommand ("request", _local2);
}
function replace(str, from, to) {
return(str.split(from).join(to));
}
function handleResponse(response) {
response = replace(response, "<", "<");
response = replace(response, ">", ">");
response = replace(response, """, "\"");
var _local2 = new XML(response);
var _local9 = _local2.firstChild.childNodes;
var _local5 = Number(_local2.firstChild.attributes.id.toString());
var _local4 = Number(_local2.firstChild.attributes.time.toString());
var _local8 = Number(_local2.firstChild.attributes.choice.toString());
var _local6 = Number(_local2.firstChild.attributes.correct.toString());
var _local7 = String(_local2.firstChild.attributes.c.toString());
cbFunction_.call(cbObject_, _local5, _local4, _local8, _local6, _local7);
}
function onEnterFrame() {
if (_root.response != undefined) {
var _local3 = new String(_root.response);
handleResponse(_local3);
_root.response = undefined;
}
}
}
Symbol 583 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 584 MovieClip [__Packages.com.midasplayer.game.dond2.Rules] Frame 0
class com.midasplayer.game.dond2.Rules
{
var roundIndex_, totalBonus_;
function Rules () {
roundIndex_ = 0;
totalBonus_ = 0;
}
function getNumLives() {
return(3);
}
function getNextRound() {
var _local2 = new com.midasplayer.game.dond2.Round();
_local2.setRoundNum(ROUNDS[roundIndex_].roundNum);
_local2.setNumCasesToOpen(ROUNDS[roundIndex_].numCases);
roundIndex_++;
return(_local2);
}
function getNumPrizesLeft(prizes) {
var _local3 = 0;
var _local4 = prizes.length;
var _local1 = 0;
while (_local1 < _local4) {
var _local2 = com.midasplayer.game.dond2.Prize(prizes[_local1]);
if (!_local2.isRemoved()) {
_local3++;
}
_local1++;
}
return(_local3);
}
function getFinalPrize(prizes) {
var _local3 = prizes.length;
var _local1 = 0;
while (_local1 < _local3) {
var _local2 = com.midasplayer.game.dond2.Prize(prizes[_local1]);
if (!_local2.isRemoved()) {
return(_local2);
}
_local1++;
}
}
function getBankOffer(prizes) {
var _local4 = 0;
var _local5 = 0;
var _local6 = prizes.length;
var _local2 = 0;
while (_local2 < _local6) {
var _local3 = com.midasplayer.game.dond2.Prize(prizes[_local2]);
if (!_local3.isRemoved()) {
_local4 = _local4 + _local3.getValue();
_local5++;
}
_local2++;
}
var _local8 = _local6 - _local5;
var _local10 = _local8;
var _local13 = ((_local8 * _local8) + 1) / ((_local10 * _local10) + 1);
var _local11 = roundIndex_;
var _local9 = ROUNDS.length;
var _local12 = 0.333333333333333 + ((0.666666666666667 * (_local11 - 1)) / _local9);
_local12 = Math.log(2 * _local11) / Math.log(2 * _local9);
_local4 = ((_local4 / _local5) * _local13) * _local12;
_local4 = Math.round(_local4);
_local4 = _local4 + totalBonus_;
if (_local4 == 1) {
_local4 = 2;
}
if (_local4 == 0) {
_local4 = 1;
}
return(_local4);
}
function prizeToText(p) {
if (p < 1) {
return(p);
}
var _local1 = String(p);
if (_local1.length > 3) {
_local1 = (_local1.substring(0, _local1.length - 3) + ",") + _local1.substring(_local1.length - 3, _local1.length);
}
if (_local1.length > 7) {
_local1 = (_local1.substring(0, _local1.length - 7) + ",") + _local1.substring(_local1.length - 7, _local1.length);
}
return(_local1);
}
function getAnswerBonus(question, answer, timeLeft) {
var _local2 = 0;
if (answer == question.correct) {
var _local3 = 10000 + (5000 * (question.difficulty - 1));
_local2 = Math.round(_local3 * timeLeft);
}
totalBonus_ = totalBonus_ + _local2;
return(_local2);
}
function getTotalBonus() {
return(totalBonus_);
}
static var PRIZES = [{value:0.01, valuetext:"0.01"}, {value:1, valuetext:"1"}, {value:5, valuetext:"5"}, {value:10, valuetext:"10"}, {value:25, valuetext:"25"}, {value:50, valuetext:"50"}, {value:75, valuetext:"75"}, {value:100, valuetext:"100"}, {value:200, valuetext:"200"}, {value:300, valuetext:"300"}, {value:400, valuetext:"400"}, {value:500, valuetext:"500"}, {value:750, valuetext:"750"}, {value:1000, valuetext:"1,000"}, {value:5000, valuetext:"5,000"}, {value:10000, valuetext:"10,000"}, {value:25000, valuetext:"25,000"}, {value:50000, valuetext:"50,000"}, {value:75000, valuetext:"75,000"}, {value:100000, valuetext:"100,000"}, {value:200000, valuetext:"200,000"}, {value:300000, valuetext:"300,000"}, {value:400000, valuetext:"400,000"}, {value:500000, valuetext:"500,000"}, {value:750000, valuetext:"750,000"}, {value:1000000, valuetext:"1,000,000"}];
static var ROUNDS = [{roundNum:1, numCases:3}, {roundNum:2, numCases:3}, {roundNum:3, numCases:3}, {roundNum:4, numCases:3}, {roundNum:5, numCases:3}, {roundNum:6, numCases:2}, {roundNum:7, numCases:2}, {roundNum:8, numCases:2}, {roundNum:9, numCases:2}, {roundNum:10, numCases:2}];
}
Symbol 585 MovieClip [__Packages.com.midasplayer.game.dond2.Round] Frame 0
class com.midasplayer.game.dond2.Round
{
var numCasesOpened_, numCasesClosed_, openedCases_, roundNum_, numCasesToOpen_;
function Round () {
numCasesOpened_ = 0;
numCasesClosed_ = 0;
openedCases_ = new Array();
}
function setRoundNum(n) {
roundNum_ = n;
}
function getRoundNum() {
return(roundNum_);
}
function setNumCasesToOpen(n) {
numCasesToOpen_ = n;
}
function getNumCasesToOpen() {
return(numCasesToOpen_);
}
function caseOpened(c) {
numCasesOpened_++;
openedCases_.push(c);
}
function getCases() {
return(openedCases_);
}
function caseClosed(c) {
numCasesClosed_++;
}
function isRoundEnded() {
return(numCasesClosed_ == numCasesOpened_);
}
}
Symbol 586 MovieClip [__Packages.com.midasplayer.game.dond2.Case] Frame 0
class com.midasplayer.game.dond2.Case
{
var board_, layer_, num_, random_, clip_, question_, type_, scale_, x_, y_, brightness_, answerTimeLeft_, scoretxt_, questionAnswer_, prizes_, rotationSpeed_, rotationBoxes_, rotationBoxClicked_;
function Case (board, layer, num, seed) {
board_ = board;
layer_ = layer;
num_ = num;
seed = Number(com.midasplayer.util.GameBase.gameData.get("seed"));
seed = seed + num;
random_ = new com.midasplayer.util.Random(seed);
var _local2 = layer_.getNextHighestDepth();
clip_ = layer_.attachMovie("case", "case" + _local2, _local2);
clip_.gotoAndStop(1);
clip_.num.num.text = num_;
}
function getNum() {
return(num_);
}
function getQuestion() {
return(question_);
}
function setType(type) {
type_ = type;
}
function getType() {
return(type_);
}
function setScale(s) {
scale_ = s;
clip_._xscale = s;
clip_._yscale = s;
}
function setX(x) {
x_ = x;
clip_._x = x;
}
function setY(y) {
y_ = y;
clip_._y = y;
}
function setRotation(r) {
return(undefined);
}
function setBrightness(v) {
brightness_ = v;
var _local2 = [1, 0, 0, 0, brightness_, 0, 1, 0, 0, brightness_, 0, 0, 1, 0, brightness_, 0, 0, 0, 1, 0];
var _local3 = new flash.filters.ColorMatrixFilter(_local2);
clip_.filters = [_local3];
}
function setClickable(t) {
if (t) {
clip_.hit.useHandCursor = true;
clip_.hit.onPress = mx.utils.Delegate.create(this, onPress);
} else {
clip_.hit.useHandCursor = false;
clip_.hit.onPress = undefined;
}
}
function onPress() {
board_.caseClicked(this);
}
function remove() {
clip_.removeMovieClip();
}
function getAnswerTimeLeft() {
return(Math.round(1000 * answerTimeLeft_) / 1000);
}
function transformAnim(tick, alpha, params) {
var _local3 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, params.ticks);
var _local6 = Math.floor(params.startFrame + ((params.stopFrame - params.startFrame) * _local3));
var _local4 = params.startScale + ((params.stopScale - params.startScale) * _local3);
var _local8 = params.startX + ((params.stopX - params.startX) * _local3);
var _local7 = params.startY + ((params.stopY - params.startY) * _local3);
var _local5 = params.startBrightness + ((params.stopBrightness - params.startBrightness) * _local3);
clip_.gotoAndStop(_local6);
clip_._xscale = _local4;
clip_._yscale = _local4;
clip_._x = _local8;
clip_._y = _local7;
setBrightness(_local5);
clip_.num.num.text = num_;
clip_.score.score.text = scoretxt_;
return(_local3 == 1);
}
function markAsOwn() {
clip_.swapDepths(layer_.getNextHighestDepth());
_root.mycasenum = num_;
var _local3 = clip_._currentframe;
var _local18 = {ticks:50, startFrame:_local3, stopFrame:31, startScale:clip_._xscale, stopScale:100, startX:clip_._x, stopX:200, startY:clip_._y, stopY:20, startBrightness:brightness_, stopBrightness:0};
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:transformAnim, params:_local18}], callback:markAsOwn2, callback_scope:this, tps:50});
}
function markAsOwn2() {
com.midasplayer.fx.SoundManager.play("my briefcase chosen", 100);
clip_.attachMovie("star", "star", clip_.getNextHighestDepth());
clip_.star._x = 198;
clip_.star._y = 232;
var _local2 = new com.midasplayer.util.AnimDriver(clip_.star, 20);
_local2.playStart(1);
com.midasplayer.util.AnimPlayer.delay({callback:markAsOwn3, callback_scope:this, millis:700});
}
function markAsOwn3() {
clip_.swapDepths(layer_.getNextHighestDepth());
var _local2 = clip_._currentframe;
var _local17 = {ticks:40, startFrame:_local2, stopFrame:_local2, startScale:clip_._xscale, stopScale:100, startX:clip_._x, stopX:clip_._x, startY:clip_._y, stopY:clip_._y + 500, startBrightness:brightness_, stopBrightness:0};
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:transformAnim, params:_local17}], callback:markAsOwnEnd, callback_scope:this, tps:50});
}
function markAsOwnEnd() {
board_.caseMarkedAsOwn();
}
function zoomUp() {
clip_.swapDepths(layer_.getNextHighestDepth());
var _local2 = clip_._currentframe;
var _local17 = {ticks:80, startFrame:_local2, stopFrame:53, startScale:clip_._xscale, stopScale:100, startX:clip_._x, stopX:200, startY:clip_._y, stopY:20, startBrightness:brightness_, stopBrightness:0};
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:transformAnim, params:_local17}], callback:zoomUpEnd, callback_scope:this, tps:50});
}
function zoomUpEnd() {
board_.caseZoomedUp(this);
}
function zoomDown() {
var _local2 = clip_._currentframe;
var _local17 = {ticks:60, startFrame:_local2, stopFrame:53, startScale:clip_._xscale, stopScale:scale_ + 10, startX:clip_._x, stopX:x_ - 17, startY:clip_._y, stopY:y_ - 24, startBrightness:0, stopBrightness:brightness_};
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:transformAnim, params:_local17}], callback:zoomDownEnd, callback_scope:this, tps:50});
}
function zoomDownEnd() {
board_.caseZoomedDown(this);
}
function openQuestion(question) {
question_ = question;
com.midasplayer.fx.SoundManager.play("Good Case Opening TP 1", 50);
var _local2 = clip_._currentframe;
var _local17 = {ticks:60, startFrame:_local2, stopFrame:68, startScale:clip_._xscale, stopScale:clip_._xscale, startX:clip_._x, stopX:clip_._x, startY:clip_._y, stopY:clip_._y, startBrightness:brightness_, stopBrightness:brightness_};
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:transformAnim, params:_local17}], callback:openQuestionEnd, callback_scope:this, tps:50});
}
function openQuestionEnd() {
clip_.q.autoSize = true;
clip_.q.text = question_.question;
clip_.q._y = Math.round(25 + ((75 - clip_.q._height) / 2));
clip_.c1.autoSize = true;
clip_.c1.text = question_.choice1;
clip_.c1._y = Math.round(125 + ((38 - clip_.c1._height) / 2));
clip_.c2.autoSize = true;
clip_.c2.text = question_.choice2;
clip_.c2._y = Math.round(190 + ((38 - clip_.c2._height) / 2));
clip_.c3.autoSize = true;
clip_.c3.text = question_.choice3;
clip_.c3._y = Math.round(256 + ((38 - clip_.c3._height) / 2));
clip_.c4.autoSize = true;
clip_.c4.text = question_.choice4;
clip_.c4._y = Math.round(327 + ((38 - clip_.c4._height) / 2));
questionAnswer_ = 0;
answerTimeLeft_ = 1;
clip_.qbox1.onRollOver = function () {
this.gotoAndStop(2);
com.midasplayer.fx.SoundManager.play("sound5", 50);
};
clip_.qbox1.onRollOut = function () {
this.gotoAndStop(1);
};
clip_.qbox1.onPress = mx.utils.Delegate.create(this, choice1Pressed);
clip_.qbox2.onRollOver = function () {
this.gotoAndStop(2);
com.midasplayer.fx.SoundManager.play("sound5", 50);
};
clip_.qbox2.onRollOut = function () {
this.gotoAndStop(1);
};
clip_.qbox2.onPress = mx.utils.Delegate.create(this, choice2Pressed);
clip_.qbox3.onRollOver = function () {
this.gotoAndStop(2);
com.midasplayer.fx.SoundManager.play("sound5", 50);
};
clip_.qbox3.onRollOut = function () {
this.gotoAndStop(1);
};
clip_.qbox3.onPress = mx.utils.Delegate.create(this, choice3Pressed);
clip_.qbox4.onRollOver = function () {
this.gotoAndStop(2);
com.midasplayer.fx.SoundManager.play("sound5", 50);
};
clip_.qbox4.onRollOut = function () {
this.gotoAndStop(1);
};
clip_.qbox4.onPress = mx.utils.Delegate.create(this, choice4Pressed);
clip_.qboxes = new Array();
clip_.qboxes.push(clip_.qbox1);
clip_.qboxes.push(clip_.qbox2);
clip_.qboxes.push(clip_.qbox3);
clip_.qboxes.push(clip_.qbox4);
board_.questionCaseOpen();
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:showQuestionAnim}], callback:showQuestionEnd, callback_scope:this, tps:50});
}
function showQuestionAnim(tick, alpha) {
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 750);
clip_.qtimer.timer._width = 318 - (_local2 * 318);
if (questionAnswer_ > 0) {
return(true);
}
answerTimeLeft_ = 1 - _local2;
if (((20 * answerTimeLeft_) < 3.3) && (!clip_.warning)) {
clip_.warning = true;
com.midasplayer.fx.SoundManager.play("count down - 3 sec", 80);
}
return(_local2 == 1);
}
function showQuestionEnd() {
com.midasplayer.fx.SoundManager.stop("count down - 3 sec");
deactivateQuestion();
if (questionAnswer_ > 0) {
return(undefined);
}
board_.questionAnswerPressed(0);
}
function deactivateQuestion() {
var _local2 = 0;
while (_local2 < 4) {
clip_.qboxes[_local2].useHandCursor = false;
clip_.qboxes[_local2].onRollOver = undefined;
clip_.qboxes[_local2].onRollOut = undefined;
clip_.qboxes[_local2].onPress = undefined;
_local2++;
}
}
function choice1Pressed() {
questionAnswer_ = 1;
deactivateQuestion();
board_.questionAnswerPressed(1);
}
function choice2Pressed() {
questionAnswer_ = 2;
deactivateQuestion();
board_.questionAnswerPressed(2);
}
function choice3Pressed() {
questionAnswer_ = 3;
deactivateQuestion();
board_.questionAnswerPressed(3);
}
function choice4Pressed() {
questionAnswer_ = 4;
deactivateQuestion();
board_.questionAnswerPressed(4);
}
function markAnswer(incorrectChoice, correctChoice) {
var _local8 = {correct:correctChoice, incorrect:incorrectChoice};
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:markAnswerAnim, params:_local8}], callback:markAnswerEnd, callback_scope:this, tps:50});
}
function markAnswerAnim(tick, alpha, params) {
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 60);
if (params.incorrect > 0) {
if (_local2 >= 0.2) {
clip_.qboxes[params.incorrect - 1].gotoAndStop(4);
}
if (_local2 >= 0.6) {
clip_.qboxes[params.correct - 1].gotoAndStop(3);
}
} else if (_local2 >= 0.2) {
clip_.qboxes[params.correct - 1].gotoAndStop(3);
}
return(_local2 == 1);
}
function markAnswerEnd() {
board_.answerMarked();
}
function openRotation(prizes, speed) {
prizes_ = prizes;
clip_.swapDepths(layer_.getNextHighestDepth());
rotationSpeed_ = speed;
rotationBoxes_ = new Array();
var _local3 = 0;
while (_local3 < 6) {
var _local4 = clip_.getNextHighestDepth();
var _local2 = clip_.attachMovie("rbox", "rbox" + _local4, _local4);
_local2._x = 67;
_local2.framepos = _local3 * rotationFrames_;
_local2._y = rotationPositions_[_local2.framepos].y;
_local2._yscale = rotationPositions_[_local2.framepos].yscale;
_local2._alpha = 0;
rotationBoxes_.push(_local2);
_local3++;
}
var _local5 = random_.nextInt(2000);
com.midasplayer.util.AnimPlayer.delay({callback:openRotation2, callback_scope:this, millis:_local5});
}
function openRotation2() {
com.midasplayer.fx.SoundManager.play("Good Case Opening 3", 50);
clip_.gotoAndStop(69);
var _local18 = clip_._currentframe;
var _local16 = {ticks:30, startFrame:69, stopFrame:78, startScale:clip_._xscale, stopScale:scale_ + 10, startX:clip_._x, stopX:x_ - 17, startY:clip_._y, stopY:y_ - 24, startBrightness:brightness_, stopBrightness:0};
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:transformAnim, params:_local16}], callback:openRotationEnd, callback_scope:this, tps:50});
}
function openRotationEnd() {
rotate();
}
function rotate() {
var _local14 = clip_._currentframe;
var _local2 = 0;
while (_local2 < 6) {
var _local3 = rotationBoxes_[_local2];
_local3.onPress = function () {
this.me.rotationBoxClicked(this);
};
_local2++;
}
var _local7 = 0;
var _local13 = 140 + (rotationSpeed_ * 100);
var _local11 = {startFrame:79, stopFrame:85, rotStart:_local7, rotLength:_local13};
var _local8 = 50;
if (rotationSpeed_ <= 0.5) {
_local8 = 40;
}
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:rotateAnim, params:_local11}], callback:rotateEnd, callback_scope:this, tps:_local8});
}
function rotateAnim(tick, alpha, params) {
var _local11 = 15;
var _local8 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 50 * _local11);
var _local7 = params.rotStart + Math.round(params.rotLength * _local8);
var _local13 = params.stopFrame - params.startFrame;
clip_.gotoAndStop((params.startFrame + (_local7 % _local13)) + 1);
var _local10 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, (_local11 * 50) - 100, 80);
var _local15 = 3;
var _local14 = _local15 * Math.sin(_local10 * Math.PI);
var _local12 = _local14 * Math.sin((_local10 * 12) * Math.PI);
clip_._x = (x_ - 17) + _local12;
var _local5 = 0;
while (_local5 < 6) {
var _local2 = rotationBoxes_[_local5];
var _local6 = ((_local2.framepos + _local7) + 1) % (rotationFrames_ * 6);
_local2._y = rotationPositions_[_local6].y;
_local2._yscale = rotationPositions_[_local6].yscale;
if (_local2._yscale == 1) {
_local2.hasPrize = false;
} else if (!_local2.hasPrize) {
var _local4 = false;
while (!_local4) {
var _local3 = prizes_[random_.nextInt(prizes_.length)];
_local4 = !_local3.isRemoved();
if (!_local4) {
}
}
_local2._visible = true;
_local2.myprize = _local3;
_local2.prize.text = (_local3.getCurrency() + " ") + _local3.getValueText();
_local2.me = this;
_local2.hasPrize = true;
}
if (_local2._alpha < 100) {
_local2._alpha = _local2._alpha + 10;
}
_local5++;
}
if (rotationBoxClicked_) {
_local8 = 1;
}
return(_local8 == 1);
}
function rotateEnd() {
if (!rotationBoxClicked_) {
rotationBoxClicked_ = true;
var _local2 = 0;
while (_local2 < prizes_.length) {
var _local3 = prizes_[_local2];
if (!_local3.isRemoved()) {
board_.casePrizePressed(this, _local3);
break;
}
_local2++;
}
}
board_.caseRotated(this);
}
function rotationBoxClicked(c) {
var _local2;
_local2 = c.myprize;
if (!_local2.isRemoved()) {
if (rotationBoxClicked_) {
return(undefined);
}
rotationBoxClicked_ = true;
board_.casePrizePressed(this, _local2);
}
}
function removePrize(p) {
var _local2 = 0;
while (_local2 < 6) {
var _local3 = rotationBoxes_[_local2];
if (_local3.myprize == p) {
_local3._visible = false;
}
_local2++;
}
}
function showFinalPrize(score) {
scoretxt_ = score;
var _local16 = {ticks:40, startFrame:31, stopFrame:31, startScale:100, stopScale:100, startX:clip_._x, stopX:clip_._x, startY:clip_._y, stopY:clip_._y - 500, startBrightness:0, stopBrightness:0};
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:transformAnim, params:_local16}], callback:showFinalPrize2, callback_scope:this, tps:50});
}
function showFinalPrize2() {
clip_.star.removeMovieClip();
var _local16 = {ticks:40, startFrame:31, stopFrame:46, startScale:100, stopScale:100, startX:clip_._x, stopX:clip_._x, startY:clip_._y, stopY:clip_._y, startBrightness:0, stopBrightness:0};
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:transformAnim, params:_local16}], callback:showFinalPrize3, callback_scope:this, tps:50});
}
function showFinalPrize3() {
clip_.star.removeMovieClip();
var _local16 = {ticks:30, startFrame:90, stopFrame:101, startScale:100, stopScale:100, startX:clip_._x, stopX:clip_._x, startY:clip_._y, stopY:clip_._y, startBrightness:0, stopBrightness:0};
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:transformAnim, params:_local16}], callback:showFinalPrize4, callback_scope:this, tps:50});
}
function showFinalPrize4() {
}
function removeFinalPrize() {
clip_.swapDepths(layer_.getNextHighestDepth());
var _local18 = clip_._currentframe;
var _local16 = {ticks:40, startFrame:101, stopFrame:90, startScale:clip_._xscale, stopScale:100, startX:clip_._x, stopX:clip_._x, startY:clip_._y, stopY:clip_._y + 500, startBrightness:brightness_, stopBrightness:0};
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:transformAnim, params:_local16}], callback:undefined, callback_scope:this, tps:50});
}
function setFrame(f) {
clip_.gotoAndStop(f);
}
function showIntroQuestion() {
var _local10 = {ticks:100, startFrame:46, stopFrame:68, startBrightness:0, stopBrightness:0};
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:transformAnim, params:_local10}], callback:showIntroQuestion2, callback_scope:this, tps:50});
}
function showIntroQuestion2() {
clip_.q.autoSize = true;
clip_.q.html = true;
clip_.q.htmlText = ("<font size=\"30\">" + com.midasplayer.util.I18n.format("intro_question")) + "</font>";
clip_.q._y = Math.round(25 + ((75 - clip_.q._height) / 2));
clip_.c1.html = true;
clip_.c1.htmlText = ("<font size=\"28\">" + com.midasplayer.util.I18n.format("intro_alt1")) + "</font>";
clip_.c2.html = true;
clip_.c2.htmlText = ("<font size=\"28\">" + com.midasplayer.util.I18n.format("intro_alt2")) + "</font>";
clip_.c3.html = true;
clip_.c3.htmlText = ("<font size=\"28\">" + com.midasplayer.util.I18n.format("intro_alt3")) + "</font>";
clip_.c4.html = true;
clip_.c4.htmlText = ("<font size=\"28\">" + com.midasplayer.util.I18n.format("intro_alt4")) + "</font>";
}
function showIntroRotation() {
rotationSpeed_ = 0.1;
rotationBoxes_ = new Array();
var _local3 = 0;
while (_local3 < 6) {
var _local4 = clip_.getNextHighestDepth();
var _local2 = clip_.attachMovie("rbox", "rbox" + _local4, _local4);
_local2._x = 67;
_local2.framepos = _local3 * rotationFrames_;
_local2._y = rotationPositions_[_local2.framepos].y;
_local2._yscale = rotationPositions_[_local2.framepos].yscale;
_local2.prize.text = (com.midasplayer.util.I18n.format("currency_symbol") + " ") + com.midasplayer.game.dond2.Rules.PRIZES[_local3].valuetext;
_local2._alpha = 0;
rotationBoxes_.push(_local2);
_local3++;
}
var _local13 = {ticks:200, startFrame:46, stopFrame:54, startBrightness:0, stopBrightness:0};
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:transformAnim, params:_local13}], callback:showIntroRotation2, callback_scope:this, tps:50});
}
function showIntroRotation2() {
var _local10 = {ticks:60, startFrame:69, stopFrame:78, startBrightness:brightness_, stopBrightness:0};
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:transformAnim, params:_local10}], callback:showIntroRotation3, callback_scope:this, tps:50});
}
function showIntroRotation3() {
var _local12 = clip_._currentframe;
var _local5 = 0;
var _local11 = 50;
var _local9 = {startFrame:79, stopFrame:85, rotStart:_local5, rotLength:_local11};
var _local6 = 50;
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:showIntroRotation4, params:_local9}], callback:showIntroRotation5, callback_scope:this, tps:_local6});
}
function showIntroRotation4(tick, alpha, params) {
var _local9 = 13;
var _local7 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 50 * _local9);
var _local5 = params.rotStart + Math.round(params.rotLength * _local7);
var _local8 = params.stopFrame - params.startFrame;
clip_.gotoAndStop((params.startFrame + (_local5 % _local8)) + 1);
var _local3 = 0;
while (_local3 < 6) {
var _local2 = rotationBoxes_[_local3];
var _local4 = ((_local2.framepos + _local5) + 1) % (rotationFrames_ * 6);
_local2._y = rotationPositions_[_local4].y;
_local2._yscale = rotationPositions_[_local4].yscale;
if (_local2._alpha < 100) {
_local2._alpha = _local2._alpha + 10;
}
_local3++;
}
return(_local7 == 1);
}
function showIntroRotation5() {
}
var rotationFrames_ = 6;
var rotationPositions_ = [{y:354, yscale:31}, {y:332, yscale:54}, {y:304, yscale:80}, {y:278, yscale:92}, {y:247, yscale:100}, {y:247, yscale:100}, {y:247, yscale:100}, {y:227, yscale:98}, {y:212, yscale:85}, {y:202, yscale:65}, {y:201, yscale:40}, {y:201, yscale:40}, {y:201, yscale:40}, {y:198, yscale:25}, {y:199, yscale:9}, {y:1000, yscale:1}, {y:1000, yscale:1}, {y:1000, yscale:1}, {y:1000, yscale:1}, {y:1000, yscale:1}, {y:1000, yscale:1}, {y:1000, yscale:1}, {y:1000, yscale:1}, {y:1000, yscale:1}, {y:1000, yscale:1}, {y:1000, yscale:1}, {y:1000, yscale:1}, {y:1000, yscale:1}, {y:1000, yscale:1}, {y:1000, yscale:1}, {y:1000, yscale:1}, {y:1000, yscale:1}, {y:1000, yscale:1}, {y:1000, yscale:1}, {y:354, yscale:31}, {y:354, yscale:31}];
}
Symbol 587 MovieClip [__Packages.com.midasplayer.util.Random] Frame 0
class com.midasplayer.util.Random
{
var mta, mti, lastSeed;
function Random (aSeed) {
mta = new Array(N);
mti = N + 1;
if (aSeed != undefined) {
init_genrand(aSeed);
}
}
function set seed(s) {
init_genrand(s);
//return(seed);
}
function get seed() {
return(lastSeed);
}
function nextInt(n) {
return((genrand_int32() & 2147483647) % n);
}
function nextFloat() {
return(next(24) / 16777216);
}
function next(bits) {
if (bits < 32) {
return(genrand_int32() & ((1 << bits) - 1));
}
return(genrand_int32());
}
function init_genrand(s) {
var _local5 = getTimer();
lastSeed = s;
mta[0] = s;
var _local2 = s;
var _local3 = new com.midasplayer.util.Integer64();
mti = 1;
while (mti < N) {
_local3.init32((_local2 >>> 30) ^ _local2);
_local3.mulu32(1812433253);
_local2 = (mta[mti] = _local3.lsb + mti);
mti++;
}
var _local6 = getTimer();
}
function genrand_int32() {
var _local3 = 0;
if (mti >= N) {
if (mti == (N + 1)) {
init_genrand(5489);
}
var _local4 = getTimer();
var _local2 = 0;
_local2 = 0;
while (_local2 < (N - M)) {
_local3 = (mta[_local2] & UPPER_MASK) | (mta[_local2 + 1] & LOWER_MASK);
mta[_local2] = (mta[_local2 + M] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
_local2++;
}
while (_local2 < (N - 1)) {
_local3 = (mta[_local2] & UPPER_MASK) | (mta[_local2 + 1] & LOWER_MASK);
mta[_local2] = (mta[_local2 + (M - N)] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
_local2++;
}
_local3 = (mta[N - 1] & UPPER_MASK) | (mta[0] & LOWER_MASK);
mta[N - 1] = (mta[M - 1] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
mti = 0;
var _local5 = getTimer();
}
_local3 = mta[mti++];
_local3 = _local3 ^ (_local3 >>> 11);
_local3 = _local3 ^ ((_local3 << 7) & 2636928640);
_local3 = _local3 ^ ((_local3 << 15) & 4022730752);
_local3 = _local3 ^ (_local3 >>> 18);
return(_local3);
}
static var N = 624;
static var M = 397;
static var MATRIX_A = 2567483615;
static var UPPER_MASK = 2147483648;
static var LOWER_MASK = 2147483647;
static var mag01 = [0, 2567483615];
}
Symbol 588 MovieClip [__Packages.com.midasplayer.util.Integer64] Frame 0
class com.midasplayer.util.Integer64
{
var r, p, s;
function Integer64 (lowInt) {
r = [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]];
p = [0, 0, 0, 0, 0];
s = [0, 0, 0];
if (lowInt != undefined) {
merge(lowInt);
}
}
function init(v) {
var _local2 = 0;
while (_local2 < p.length) {
p[_local2] = v.p[_local2];
_local2++;
}
}
function init32(n) {
p[0] = n & 32767;
n = n >>> 15;
p[1] = n & 32767;
n = n >>> 15;
p[2] = n & 3;
p[3] = 0;
p[4] = 0;
}
function get lsb() {
return((p[0] | (p[1] << SH)) | ((p[2] & 3) << 30));
}
function get msb() {
return((((p[2] >> 2) | ((p[3] << SH) >> 2)) | ((p[4] << (SH * 2)) >> 2)) & 2147483647);
}
function binaryShiftLeft(step) {
var _local2 = 0;
while (_local2 < step) {
shl();
_local2++;
}
}
function binaryShiftRight(step) {
var _local4 = (step / SH) >> 0;
var _local5 = step - (_local4 * SH);
var _local2 = p.length - 1;
while (_local2 > 0) {
var _local3 = 0;
while (_local3 < _local4) {
p[_local3] = p[_local3 + 1];
_local3++;
}
p[_local2--] = 0;
}
if (_local5 > 0) {
var _local3 = 0;
while (_local3 < _local5) {
shr();
_local3++;
}
}
}
function binaryNot(o) {
p[0] = p[0] ^ o.p[0];
p[1] = p[1] ^ o.p[1];
p[2] = p[2] ^ o.p[2];
p[3] = p[3] ^ o.p[3];
p[4] = p[4] ^ o.p[4];
}
function add64(o) {
var _local4 = 0;
var _local3 = 1;
var _local2 = 0;
while ((_local3 < p.length) && (o.p[_local2] != 0)) {
_local3++;
}
_local2 = 0;
while (_local2 < _local3) {
_local4 = _local4 + (p[_local2] + o.p[_local2]);
p[_local2] = _local4 & MASK;
_local4 = _local4 >> SH;
_local2++;
}
}
function add32(num) {
var _local2 = 0;
var _local5 = num & MASK;
num = num >> SH;
var _local6 = num & MASK;
num = num >> SH;
var _local4 = num & 3;
_local2 = _local2 + (p[0] + _local5);
p[0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (p[1] + _local6);
p[1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (p[2] + _local4);
p[2] = _local2 & MASK;
}
function mulu32(num) {
var _local3 = 0;
s[0] = num & MASK;
num = num >>> 15;
s[1] = num & MASK;
num = num >>> 15;
s[2] = num & 3;
var _local2 = 0;
while (_local2 < 3) {
var _local4 = s[_local2];
_local3 = _local4 * p[0];
r[_local2][0] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (_local4 * p[1]);
r[_local2][1] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (_local4 * p[2]);
r[_local2][2] = _local3 & 3;
_local2++;
}
_local3 = r[0][0];
p[0] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (r[0][1] + r[1][0]);
p[1] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + ((r[0][2] + r[1][1]) + r[2][0]);
p[2] = _local3 & 3;
p[3] = 0;
p[4] = 0;
}
function mul64(o) {
var _local2 = 0;
var _local3 = 0;
while (_local3 < 5) {
var _local4 = o.p[_local3];
_local2 = _local4 * p[0];
r[_local3][0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[1]);
r[_local3][1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[2]);
r[_local3][2] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[3]);
r[_local3][3] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[4]);
r[_local3][4] = _local2 & MASK;
_local3++;
}
_local2 = r[0][0];
p[0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (r[0][1] + r[1][0]);
p[1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + ((r[0][2] + r[1][1]) + r[2][0]);
p[2] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (((r[0][3] + r[1][2]) + r[2][1]) + r[3][0]);
p[3] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + ((((r[0][4] + r[1][3]) + r[2][2]) + r[3][1]) + r[4][0]);
p[4] = _local2 & 7;
}
function mul32(value) {
mul64(new com.midasplayer.util.Integer64(value));
}
function toString() {
return(((((("Integer64[value=0x" + com.midasplayer.util.Numbers.dec2hex(msb)) + ":") + com.midasplayer.util.Numbers.dec2hex(lsb)) + ":(") + p) + ")]");
}
function merge(a) {
var _local2 = 0;
while (_local2 < 3) {
p[_local2] = p[_local2] + (a & 32767);
a = a >>> 15;
_local2++;
}
return(a);
}
function shl() {
var _local5 = 0;
var _local4 = 0;
var _local2 = 0;
var _local3 = p.length;
while (_local2 < _local3) {
_local5 = (p[_local2] & 16384) >> 14;
p[_local2] = p[_local2] << 1;
p[_local2] = (p[_local2] | _local4) & 32767;
_local2++;
_local4 = _local5;
}
}
function shr() {
var _local4 = 0;
var _local3 = 0;
var _local2 = p.length - 1;
while (_local2 >= 0) {
_local4 = (p[_local2] & 1) << 14;
p[_local2] = p[_local2] >> 1;
p[_local2] = (p[_local2] | _local3) & 32767;
_local2--;
_local3 = _local4;
}
}
static var MASK = 32767;
static var SH = 15;
}
Symbol 589 MovieClip [__Packages.com.midasplayer.util.Numbers] Frame 0
class com.midasplayer.util.Numbers
{
function Numbers () {
}
static function dec2hex(iValue, padding) {
var _local1 = "";
while (iValue != 0) {
_local1 = "0123456789abcdef".charAt(iValue & 15) + _local1;
iValue = iValue >>> 4;
}
if (padding) {
if (_local1.length == 0) {
_local1 = "00";
}
if (_local1.length < 2) {
_local1 = "0" + _local1;
}
} else if (_local1.length == 0) {
_local1 = "0";
}
return(_local1);
}
static function itoa(value, numZeroPadding) {
var _local2 = "" + value;
if (numZeroPadding) {
var _local1 = numZeroPadding - 1;
while (_local1 > 0) {
if (value < Math.pow(10, _local1)) {
_local2 = "0" + _local2;
}
_local1--;
}
}
return(_local2);
}
static function asTime(millis, alwaysHours, alwaysMinutes) {
if (alwaysHours) {
alwaysMinutes = true;
}
if (millis < 0) {
millis = 0;
}
millis = millis / 1000;
millis = Math.floor(millis);
var _local3 = Math.floor(millis / 3600);
var _local4 = Math.floor(millis / 60) % 60;
var _local5 = millis % 60;
var _local1 = "";
if (alwaysHours || (_local3 > 0)) {
_local1 = _local1 + itoa(_local3, 2);
}
if (alwaysHours || (_local1.length > 0)) {
_local1 = _local1 + ":";
}
var _local6 = _local1.length;
if ((alwaysMinutes || (_local4 > 0)) || (_local3 > 0)) {
_local1 = _local1 + itoa(_local4, 2);
}
if (alwaysMinutes || (_local1.length != _local6)) {
_local1 = _local1 + ":";
}
return(_local1 + itoa(_local5, 2));
}
}
Symbol 590 MovieClip [__Packages.com.midasplayer.game.dond2.Question] Frame 0
class com.midasplayer.game.dond2.Question
{
function Question () {
}
}
Symbol 591 MovieClip [__Packages.com.midasplayer.util.AnimPlayer] Frame 0
class com.midasplayer.util.AnimPlayer
{
static var clip_;
function AnimPlayer () {
}
static function staticInitializer(Void) {
clip_ = _root.createEmptyMovieClip("timer", _root.getNextHighestDepth());
clip_.onEnterFrame = function () {
com.midasplayer.util.AnimPlayer.onEnterFrame();
};
return(true);
}
static function play(props) {
animId_++;
var _local3 = props.playlist;
var _local4 = props.callback;
var _local5 = props.callback_scope;
var _local1 = props.tps;
if (_local1 == undefined) {
_local1 = 100;
}
callbacks_.put(animId_, _local4);
callbackScopes_.put(animId_, _local5);
animEntries_.put(animId_, new com.midasplayer.util.AnimEntry(_local3, animId_));
timers_.put(animId_, new com.midasplayer.timing.Timer(com.midasplayer.util.AnimEntry(animEntries_.get(animId_)), _local1));
return(animId_);
}
static function end(animId) {
delete eval (timers_.get(animId));
timers_.remove(animId);
delete eval (animEntries_.get(animId));
animEntries_.remove(animId);
var _local2 = callbacks_.get(animId);
callbacks_.remove(animId);
var _local3 = callbackScopes_.get(animId);
callbackScopes_.remove(animId);
_local2.call(_local3);
}
static function stop(animId) {
delete eval (timers_.get(animId));
timers_.remove(animId);
delete eval (animEntries_.get(animId));
animEntries_.remove(animId);
var _local2 = callbacks_.get(animId);
callbacks_.remove(animId);
var _local3 = callbackScopes_.get(animId);
callbackScopes_.remove(animId);
}
static function setTps(animId, tps) {
timers_.get(animId).setTps(tps);
}
static function tickToPercent(tick, startTick, numTicks) {
var _local1 = (tick - startTick) / numTicks;
_local1 = ((_local1 < 0) ? 0 : (_local1));
_local1 = ((_local1 > 1) ? 1 : (_local1));
return(_local1);
}
static function delay(props) {
return(play({playlist:[{obj:com.midasplayer.util.AnimPlayer, func:delayAnim, params:{millis:props.millis}}], callback:props.callback, callback_scope:props.callback_scope, tps:50}));
}
static function delayAnim(tick, alpha, params) {
if ((tick / 50) >= (params.millis / 1000)) {
return(true);
}
return(false);
}
static function easeInOutQuad(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static function easeInOutBack(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / (d / 2);
if (t < 1) {
s = s * 1.525;
return(((c / 2) * ((t * t) * (((s + 1) * t) - s))) + b);
}
t = t - 2;
s = s * 1.525;
return(((c / 2) * (((t * t) * (((s + 1) * t) + s)) + 2)) + b);
}
static function onEnterFrame() {
timers_.foreach(function (key, obj) {
com.midasplayer.timing.Timer(obj).advanceTime2();
});
}
static var animId_ = 0;
static var animEntries_ = new com.midasplayer.util.Map();
static var timers_ = new com.midasplayer.util.Map();
static var callbacks_ = new com.midasplayer.util.Map();
static var callbackScopes_ = new com.midasplayer.util.Map();
static var staticInitialized = staticInitializer();
}
Symbol 592 MovieClip [__Packages.com.midasplayer.util.AnimEntry] Frame 0
class com.midasplayer.util.AnimEntry implements com.midasplayer.timing.Timeable
{
var playList_, animId_;
function AnimEntry (playList, animId) {
playList_ = playList;
animId_ = animId;
}
function tick(tick) {
}
function render(tick, alpha) {
if (baseTick_ == -1) {
baseTick_ = tick;
}
var _local2 = play(playList_, tick - baseTick_, alpha);
if (_local2) {
com.midasplayer.util.AnimPlayer.end(animId_);
}
}
function play(playList, tick, alpha) {
var _local12 = playList.length;
var _local4 = true;
var _local3 = 0;
while (_local3 < _local12) {
var _local2 = playList[_local3];
if (_local2 == undefined) {
} else if (_local2.length == undefined) {
var _local9 = _local2.func;
var _local8 = _local2.obj;
var _local10 = _local2.params;
var _local6 = _local9.call(_local8, tick, alpha, _local10);
if (_local6) {
playList[_local3] = undefined;
} else {
_local4 = false;
}
} else {
var _local6 = play(_local2, tick, alpha);
if (_local6) {
playList[_local3] = undefined;
baseTick_ = baseTick_ + tick;
_local4 = false;
break;
}
_local4 = false;
break;
}
_local3++;
}
return(_local4);
}
var baseTick_ = -1;
}
Symbol 593 MovieClip [__Packages.com.midasplayer.fx.SoundManager] Frame 0
class com.midasplayer.fx.SoundManager
{
function SoundManager () {
}
static function isSoundEnabled() {
return(soundEnabled);
}
static function enableSounds(enabled) {
soundEnabled = enabled;
if (!enabled) {
muteAll();
} else {
restoreMuteAll();
}
}
static function stopAll() {
sounds.foreach(function (name, soundEntry) {
soundEntry.sound.stop();
soundEntry.playStatus = false;
});
}
static function muteAll() {
sounds.foreach(function (name, soundEntry) {
soundEntry.sound.setVolume(0);
});
}
static function restoreMuteAll() {
sounds.foreach(function (name, soundEntry) {
soundEntry.sound.setVolume(soundEntry.realVol);
});
}
static function stop(resource) {
var _local1 = sounds.get(resource);
if (_local1 != undefined) {
_local1.sound.stop();
_local1.playStatus = false;
}
}
static function getCalibratedVolume(flashVolume) {
flashVolume = Math.min(100, flashVolume);
flashVolume = Math.max(0, flashVolume);
return(Math.ceil(Math.pow(flashVolume / 100, 1.46) * 100));
}
static function setVolume(resource, percent) {
var _local1 = sounds.get(resource);
if (_local1 == undefined) {
var _local3 = new Array();
_local3.push(resource);
initialize(_local3);
}
_local1 = sounds.get(resource);
if (_local1 != undefined) {
var _local2 = percent;
_local1.sound.setVolume(_local2);
_local1.sound.volume = _local2;
}
}
static function getVolume(resource) {
var _local1 = sounds.get(resource);
if (_local1 != undefined) {
return(_local1.sound.getVolume());
}
return(100);
}
static function isPlaying(resource) {
var _local1 = sounds.get(resource);
return((_local1 != undefined) && (_local1.playStatus == true));
}
static function initialize(list) {
for (var _local9 in list) {
var resource = list[_local9];
var _local3 = _root.getNextHighestDepth();
var _local2 = new Sound(_root.createEmptyMovieClip("sm_sndhold_" + _local3, _local3));
_local2.attachSound(resource);
_local2.onSoundComplete = function () {
var _local1 = com.midasplayer.fx.SoundManager.sounds.get(resource);
_local1.playStatus = false;
};
sounds.put(resource, {realVol:100, sound:_local2, playStatus:false});
}
}
static function play(resource, volume, isLoop, fn) {
if (volume == undefined) {
volume = getVolume(resource);
}
if (isLoop == undefined) {
isLoop = false;
}
var _local2 = sounds.get(resource);
if (_local2 != undefined) {
_local2.sound.setVolume((soundEnabled ? (volume) : 0));
_local2.realVol = volume;
_local2.playStatus = true;
_local2.onPlayedFn = fn;
_local2.sound.start(0, (isLoop ? 32767 : 1));
} else {
var _local6 = _root.getNextHighestDepth();
var _local3 = new Sound(_root.createEmptyMovieClip("sm_sndhold_" + _local6, _local6));
_local3.attachSound(resource);
_local3.onSoundComplete = function () {
var _local1 = com.midasplayer.fx.SoundManager.sounds.get(resource);
_local1.playStatus = false;
com.midasplayer.fx.SoundManager.onPlayed_(resource);
};
_local3.setVolume((soundEnabled ? (volume) : 0));
_local3.start(0, (isLoop ? 32767 : 1));
sounds.put(resource, {realVol:volume, onPlayedFn:fn, sound:_local3, playStatus:true});
}
}
static function onPlayed_(name) {
var _local1 = sounds.get(name);
if ((_local1 != undefined) && (_local1.onPlayedFn != undefined)) {
_local1.onPlayedFn();
}
}
static var sounds = new com.midasplayer.util.Map();
static var soundEnabled = true;
}
Symbol 594 MovieClip [__Packages.com.midasplayer.util.AnimDriver] Frame 0
class com.midasplayer.util.AnimDriver
{
var m_clip, m_isFrozen, m_ticks, m_direction, m_frameRate, m_frameTime, m_frameCounts, m_toFrames, m_clips, m_stopped, m_once, m_lastTime, m_numTimes, m_fromFrame, m_toFrame;
function AnimDriver (clip, frameRate) {
m_clip = clip;
m_isFrozen = false;
m_ticks = 0;
m_direction = 1;
m_frameRate = frameRate;
m_frameTime = (1 / m_frameRate) * 1000;
m_frameCounts = {};
m_toFrames = {};
m_clips = find(m_clip);
for (var _local2 in m_clips) {
m_frameCounts[m_clips[_local2]._name] = 0;
m_toFrames[m_clips[_local2]._name] = m_clips[_local2]._totalFrames;
}
m_stopped = true;
m_once = false;
m_lastTime = getTimer();
}
function drive() {
if (m_stopped) {
m_clip.onEnterFrame = undefined;
return(undefined);
}
var _local9 = getTimer();
var _local10 = _local9 - m_lastTime;
m_lastTime = _local9;
m_ticks = m_ticks + (_local10 / m_frameTime);
var _local6 = int(m_ticks);
if (_local6 > 0) {
if (m_direction > 0) {
m_ticks = m_ticks - (m_direction * _local6);
} else if (m_direction < 0) {
m_ticks = m_ticks + (m_direction * _local6);
}
var _local5 = 0;
var _local7 = 0;
for (var _local8 in m_clips) {
var _local2 = m_clips[_local8];
if (com.midasplayer.util.AnimDriver(_local2) != null) {
var _local4 = com.midasplayer.util.AnimDriver(_local2);
if (_local4.frozen == true) {
continue;
}
}
m_frameCounts[_local2._name] = m_frameCounts[_local2._name] + (m_direction * _local6);
if (m_once) {
if ((m_direction > 0) && (m_frameCounts[_local2._name] >= m_toFrames[_local2._name])) {
m_frameCounts[_local2._name] = m_toFrames[_local2._name] - 1;
_local2.frozen = true;
_local5++;
}
if ((m_direction < 0) && (m_frameCounts[_local2._name] <= 0)) {
m_frameCounts[_local2._name] = 0;
_local2.frozen = true;
_local5++;
}
}
var _local3 = (m_frameCounts[_local2._name] % m_toFrames[_local2._name]) + 1;
_local2.gotoAndStop(_local3);
_local7++;
}
if (_local5 == _local7) {
m_numTimes--;
if (m_numTimes == 0) {
m_stopped = true;
} else {
for (var _local8 in m_clips) {
var _local2 = m_clips[_local8];
m_frameCounts[_local2._name] = m_fromFrame;
_local2.gotoAndStop(m_frameCounts[_local2._name] + 1);
_local2.frozen = false;
}
}
}
}
}
function get frozen() {
return(m_isFrozen);
}
function set frozen(b) {
m_isFrozen = b;
//return(frozen);
}
function forceCompleted() {
m_clip.onEnterFrame = undefined;
var _local7 = 0;
var _local6 = 0;
for (var _local5 in m_clips) {
var _local2 = m_clips[_local5];
if (com.midasplayer.util.AnimDriver(_local2) != null) {
var _local4 = com.midasplayer.util.AnimDriver(_local2);
if (_local4.frozen == true) {
continue;
}
}
m_frameCounts[_local2._name] = m_frameCounts[_local2._name] + (m_direction * 10000);
if (m_once) {
if ((m_direction > 0) && (m_frameCounts[_local2._name] >= m_toFrames[_local2._name])) {
m_frameCounts[_local2._name] = m_toFrames[_local2._name] - 1;
_local2.frozen = true;
}
if ((m_direction < 0) && (m_frameCounts[_local2._name] <= 0)) {
m_frameCounts[_local2._name] = 0;
_local2.frozen = true;
}
var _local3 = (m_frameCounts[_local2._name] % m_toFrames[_local2._name]) + 1;
_local2.gotoAndStop(_local3);
}
}
}
function isRunning() {
return(m_clip.onEnterFrame != undefined);
}
function playOnce(dir, fromFrame, toFrame, numTimes) {
m_fromFrame = fromFrame;
if (fromFrame == undefined) {
fromFrame = 1;
}
if (dir == undefined) {
m_direction = 1;
} else {
m_direction = dir;
}
if (numTimes == undefined) {
m_numTimes = 1;
} else {
m_numTimes = numTimes;
}
m_toFrame = toFrame;
m_isFrozen = false;
m_ticks = 0;
m_stopped = false;
m_once = true;
m_lastTime = getTimer();
for (var _local5 in m_clips) {
var _local2 = m_clips[_local5];
if (com.midasplayer.util.AnimDriver(_local2) != null) {
var _local3 = com.midasplayer.util.AnimDriver(_local2);
if (_local3.frozen == true) {
continue;
}
}
m_frameCounts[_local2._name] = fromFrame - 1;
if (m_toFrame == undefined) {
m_toFrames[_local2._name] = _local2._totalFrames;
} else {
m_toFrames[_local2._name] = m_toFrame;
}
_local2.gotoAndStop(fromFrame);
}
m_clip.onEnterFrame = mx.utils.Delegate.create(this, drive);
}
function playStart(startFrom) {
if (startFrom == undefined) {
startFrom = 0;
}
m_ticks = 0;
m_stopped = false;
m_lastTime = getTimer();
for (var _local5 in m_clips) {
var _local2 = m_clips[_local5];
if (com.midasplayer.util.AnimDriver(_local2) != null) {
var _local3 = com.midasplayer.util.AnimDriver(_local2);
if (_local3.frozen == true) {
continue;
}
}
m_frameCounts[_local2._name] = startFrom;
_local2.gotoAndStop(1);
}
m_clip.onEnterFrame = mx.utils.Delegate.create(this, drive);
}
function playStop() {
m_stopped = true;
m_clip.onEnterFrame = undefined;
}
function find(clip) {
var _local4 = new Array();
if (clip._totalframes > 1) {
clip.stop();
_local4.push(clip);
}
for (var _local7 in clip) {
var _local3 = clip[_local7];
var _local2 = find(_local3);
for (var _local6 in _local2) {
_local4.push(_local2[_local6]);
}
}
return(_local4);
}
}
Symbol 595 MovieClip [__Packages.com.midasplayer.game.dond2.Prize] Frame 0
class com.midasplayer.game.dond2.Prize
{
var clip_, isLeft_, value_, removed_;
function Prize (layer_, value, isLeft, currency, valueText) {
var _local2 = layer_.getNextHighestDepth();
clip_ = layer_.attachMovie("prize", "prize" + _local2, _local2);
isLeft_ = isLeft;
value_ = value;
clip_.currency.text = currency;
clip_.value.text = valueText;
if (!isLeft_) {
clip_.currency._x = clip_.currency._x - 15;
clip_.value._x = clip_.value._x - 17;
}
}
function setX(x) {
clip_._x = x;
}
function getX() {
return(clip_._x);
}
function setY(y) {
clip_._y = y;
}
function getValue() {
return(value_);
}
function getValueText() {
return(clip_.value.text);
}
function getCurrency() {
return(clip_.currency.text);
}
function remove() {
removed_ = true;
clip_._alpha = 40;
}
function isRemoved() {
return(removed_);
}
}
Symbol 596 MovieClip [__Packages.com.midasplayer.game.dond2.Deal] Frame 0
class com.midasplayer.game.dond2.Deal
{
var clip_, clip2_, board_, dealValue_, autoId_, dealTaken_;
function Deal (layer_, board, dealValue) {
clip_ = layer_.attachMovie("deal", "deal", 1);
clip2_ = layer_.attachMovie("deal_case", "deal_case", 2);
var _local3 = new com.midasplayer.util.AnimDriver(clip2_.star, 15);
_local3.playStart(1);
board_ = board;
dealValue_ = dealValue;
clip_._x = ((Stage.width - clip_._width) / 2) - 10;
clip_.deal_btn.onPress = mx.utils.Delegate.create(this, onDeal);
clip_.nodeal_btn.onPress = mx.utils.Delegate.create(this, onNoDeal);
clip_.dealvalue.text = (com.midasplayer.util.I18n.format("currency_symbol") + " ") + board_.rules_.prizeToText(dealValue_);
clip_.yes.text = com.midasplayer.util.I18n.format("deal_yes");
clip_.no.text = com.midasplayer.util.I18n.format("deal_no");
clip2_.owncase.num.num.text = _root.mycasenum;
clip2_._y = 210;
clip2_._x = clip_._x + 260;
autoId_ = com.midasplayer.util.AnimPlayer.delay({callback:autoNoDeal, callback_scope:this, millis:15000});
}
function getDealValue() {
return(dealValue_);
}
function autoNoDeal() {
if (clip_.deal_btn.onPress != undefined) {
clip_.deal_btn.onPress = undefined;
clip_.nodeal_btn.onPress = undefined;
onNoDeal();
}
}
function overDeal() {
clip_.deal_btn2.gotoAndStop(3);
}
function outDeal() {
clip_.deal_btn2.gotoAndStop(1);
}
function overNoDeal() {
clip_.nodeal_btn2.gotoAndStop(3);
}
function outNoDeal() {
clip_.nodeal_btn2.gotoAndStop(1);
}
function onDeal() {
com.midasplayer.util.AnimPlayer.stop(autoId_);
clip_.deal_btn2.gotoAndStop(2);
clip_.deal_btn.onPress = undefined;
clip_.nodeal_btn.onPress = undefined;
clip_.deal_btn.onRollOver = undefined;
clip_.deal_btn.onRollOut = undefined;
clip_.nodeal_btn.onRollOver = undefined;
clip_.nodeal_btn.onRollOut = undefined;
dealTaken_ = true;
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:dealAnim}], callback:dealEnd, callback_scope:this, tps:50});
}
function dealEnd() {
board_.dealEnded(dealTaken_);
}
function remove() {
clip_.removeMovieClip();
clip2_.removeMovieClip();
}
function onNoDeal() {
com.midasplayer.util.AnimPlayer.stop(autoId_);
clip_.nodeal_btn2.gotoAndStop(2);
clip_.deal_btn.onPress = undefined;
clip_.nodeal_btn.onPress = undefined;
clip_.deal_btn.onRollOver = undefined;
clip_.deal_btn.onRollOut = undefined;
clip_.nodeal_btn.onRollOver = undefined;
clip_.nodeal_btn.onRollOut = undefined;
clip_.yes._visible = false;
clip_.yes_arrow._visible = false;
clip_.no._visible = false;
clip_.no_arrow._visible = false;
com.midasplayer.fx.SoundManager.play("Deal declined", 100);
dealTaken_ = false;
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:noDealAnim}], callback:dealEnd, callback_scope:this, tps:50});
}
function dealAnim(tick, alpha) {
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 25);
var _local3 = Math.round(1 + (4 * _local2));
clip_.table.gotoAndStop(_local3);
return(_local2 == 1);
}
function noDealAnim(tick, alpha) {
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 25);
var _local3 = Math.round(6 + (4 * _local2));
clip_.table.gotoAndStop(_local3);
return(_local2 == 1);
}
}
Symbol 597 MovieClip [__Packages.com.midasplayer.game.dond2.InfoBox] Frame 0
class com.midasplayer.game.dond2.InfoBox
{
var clip_, animId_;
function InfoBox () {
clip_ = _root.infobox;
}
function setText(t) {
clip_.text.text = t;
}
function show() {
com.midasplayer.util.AnimPlayer.end(animId_);
animId_ = com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:showAnim}], callback:undefined, callback_scope:this, tps:50});
}
function showAnim(tick, alpha) {
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 50);
var _local3 = com.midasplayer.util.AnimPlayer.easeInOutBack(_local2, -260, 140, 1);
clip_._y = _local3;
return(_local2 == 1);
}
function remove() {
com.midasplayer.util.AnimPlayer.end(animId_);
animId_ = com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:removeAnim}], callback:undefined, callback_scope:this, tps:50});
}
function removeAnim(tick, alpha) {
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 50);
var _local3 = com.midasplayer.util.AnimPlayer.easeInOutBack(_local2, -120, -140, 1);
clip_._y = _local3;
return(_local2 == 1);
}
}
Symbol 598 MovieClip [__Packages.com.midasplayer.game.dond2.ScorePopup] Frame 0
class com.midasplayer.game.dond2.ScorePopup
{
var clip_;
function ScorePopup (txt, type) {
clip_ = _root.attachMovie("scorepopup" + type, "scorepopup", _root.getNextHighestDepth());
clip_.score.text = txt;
clip_._x = 200;
clip_._y = 410;
clip_._alpha = 0;
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:showAnim}], callback:undefined, callback_scope:this, tps:50});
}
function showAnim(tick, alpha) {
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 80);
clip_._y = 410 - (_local2 * 30);
if (_local2 < 0.1) {
clip_._alpha = _local2 * 1000;
} else {
clip_._alpha = 100 - ((((_local2 * _local2) * _local2) * _local2) * 100);
}
return(_local2 == 1);
}
}
Symbol 599 MovieClip [__Packages.com.midasplayer.game.dond2.Rain] Frame 0
class com.midasplayer.game.dond2.Rain
{
var layer1_, layer2_, clipName_, numClips_, clips_;
function Rain (clipName, numClips) {
layer1_ = _root.rainlayer1;
layer2_ = _root.rainlayer2;
clipName_ = clipName;
numClips_ = numClips;
generate();
start();
}
function generate() {
clips_ = new Array();
var _local6 = 100;
var _local8 = Stage.width - 100;
var _local3 = -50;
var _local5 = 100;
var _local7 = 0;
var _local9 = 300;
var _local4 = 0;
while (_local4 < numClips_) {
var _local2 = new Object();
_local2.z = _local3 + ((_local4 * (_local5 - _local3)) / numClips_);
if (_local2.z < 0) {
_local2.clip = layer1_.attachMovie(clipName_, clipName_ + _local4, layer1_.getNextHighestDepth());
} else {
_local2.clip = layer2_.attachMovie(clipName_, clipName_ + _local4, layer2_.getNextHighestDepth());
}
_local2.clip.gotoAndStop(1);
_local2.clip._x = _local6 + random(_local8 - _local6);
_local2.clip._y = -50;
_local2.numFrames = _local2.clip._totalframes;
_local2.frameSpeed = 4 + random(10);
_local2.startTick = _local7 + random(_local9 - _local7);
_local2.ySpeed = (((_local2.z - _local3) / (_local5 - _local3)) * 1.5) + 1.2;
if ((clipName_ == "money1") || (clipName_ == "confetti1")) {
_local2.ySpeed = _local2.ySpeed - 0.6;
}
_local2.clip._xscale = (((_local2.z - _local3) / (_local5 - _local3)) * 20) + 80;
_local2.clip._yscale = (((_local2.z - _local3) / (_local5 - _local3)) * 20) + 80;
clips_.push(_local2);
_local4++;
}
}
function start() {
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:playAnim}], callback:playEnd, callback_scope:this, tps:50});
}
function playAnim(tick, alpha) {
var _local3 = 0;
while (_local3 < numClips_) {
var _local2 = clips_[_local3];
if (tick >= _local2.startTick) {
var _local5 = (tick + alpha) - _local2.startTick;
var _local4 = Math.round(_local5 / _local2.frameSpeed);
_local2.clip.gotoAndStop((_local4 % _local2.numFrames) + 1);
_local2.clip._y = _local2.clip._y + _local2.ySpeed;
_local2.ySpeed = _local2.ySpeed + (_local2.ySpeed / 500);
}
_local3++;
}
}
function playEnd() {
}
}
Symbol 600 MovieClip [__Packages.com.midasplayer.game.dond2.Check] Frame 0
class com.midasplayer.game.dond2.Check
{
var clip_, animId_;
function Check (score, bonus, total) {
clip_ = _root.checklayer.attachMovie("check", "check", 1);
clip_._x = -500;
clip_._y = 180;
var _local3 = com.midasplayer.util.GameBase.gameData.get("username");
if ((_local3 == undefined) || (_local3 == null)) {
_local3 = "Player";
}
clip_.name.text = _local3;
clip_.score.text = score;
clip_.bonus.text = bonus;
clip_.total.text = total;
show();
}
function show() {
com.midasplayer.util.AnimPlayer.end(animId_);
animId_ = com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:showAnim}], callback:undefined, callback_scope:this, tps:50});
}
function showAnim(tick, alpha) {
var _local3 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 100);
var _local2 = -500;
var _local4 = (Stage.width - clip_._width) / 2;
var _local5 = com.midasplayer.util.AnimPlayer.easeInOutBack(_local3, _local2, _local4 - _local2, 1);
clip_._x = _local5;
return(_local3 == 1);
}
}
Symbol 601 MovieClip [__Packages.com.midasplayer.game.dond2.Sign] Frame 0
class com.midasplayer.game.dond2.Sign
{
var height_, y_, clip_, animId_;
function Sign (layer, width, height, x, y) {
var _local2 = layer.getNextHighestDepth();
height_ = height;
y_ = y;
clip_ = layer.createEmptyMovieClip("sign", _local2);
clip_.attachMovie("sign", "sign", 1);
clip_.sign._width = width;
clip_.sign._height = height;
clip_.attachMovie("str", "str1", 2);
clip_.str1._x = 27.5;
clip_.str1._y = -200;
clip_.str1._height = 200;
clip_.attachMovie("str", "str2", 3);
clip_.str2._x = width - 35;
clip_.str2._y = -200;
clip_.str2._height = 200;
clip_._x = x;
clip_._y = (-height_) - 50;
}
function setText(t) {
clip_.text.text = t;
}
function attach(n, x, y) {
var _local3 = clip_.getNextHighestDepth();
var _local2 = clip_.attachMovie(n, n, _local3);
_local2._x = x;
_local2._y = y;
return(_local2);
}
function show() {
com.midasplayer.util.AnimPlayer.end(animId_);
animId_ = com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:showAnim}], callback:undefined, callback_scope:this, tps:50});
}
function showAnim(tick, alpha) {
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 50);
var _local3 = y_ - ((-height_) - 50);
var _local4 = com.midasplayer.util.AnimPlayer.easeInOutBack(_local2, (-height_) - 50, _local3, 1);
clip_._y = _local4;
return(_local2 == 1);
}
function remove() {
com.midasplayer.util.AnimPlayer.end(animId_);
animId_ = com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:removeAnim}], callback:removeEnd, callback_scope:this, tps:50});
}
function removeAnim(tick, alpha) {
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 50);
var _local3 = y_ - ((-height_) - 50);
var _local4 = com.midasplayer.util.AnimPlayer.easeInOutBack(_local2, y_, -_local3, 1);
clip_._y = _local4;
return(_local2 == 1);
}
function removeEnd() {
clip_.removeMovieClip();
}
}
Symbol 602 MovieClip [__Packages.com.midasplayer.game.dond2.Replay] Frame 0
class com.midasplayer.game.dond2.Replay
{
function Replay () {
}
}