Frame 1
_root.gamemode = 2;
var game = (new com.midasplayer.game.bompbompdeluxe.Game());
stop();
Symbol 24 MovieClip [intro2] Frame 1
stop();
Symbol 24 MovieClip [intro2] Frame 315
stop();
Symbol 67 MovieClip Frame 1
stop();
Symbol 398 MovieClip [intro] Frame 1
stop();
Symbol 409 MovieClip Frame 1
stop();
Symbol 409 MovieClip Frame 16
stop();
Symbol 418 MovieClip Frame 1
stop();
Symbol 418 MovieClip Frame 16
stop();
Symbol 622 MovieClip Frame 1
stop();
Symbol 622 MovieClip Frame 300
stop();
Symbol 637 MovieClip Frame 1
stop();
Symbol 637 MovieClip Frame 300
stop();
Symbol 640 MovieClip [__Packages.com.midasplayer.util.GameBase] Frame 0
class com.midasplayer.util.GameBase
{
static var gameData, game_, checkGameDataIntervalId_;
function GameBase () {
gameMode_ = GAME_MODE_MONEY;
}
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));
}
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);
trace(_local1);
fscommand ("playData", "" + _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 _local7 = new XML();
_local7.ignoreWhite = true;
_local7.parseXML(myData);
var _local4 = _local7.firstChild;
if (_local4.nodeName == "gamedata") {
for (var _local6 in _local4.attributes) {
var _local5;
var _local2 = _local4.attributes[_local6];
gameData.put(_local6, _local2);
}
var _local1 = _local4.firstChild;
while (_local1 != null) {
if (_local1.nodeName == "text") {
com.midasplayer.util.I18n.addTranslation(String(_local1.attributes.id), String(_local1.firstChild));
} else {
var _local3 = "0";
for (var _local6 in _local1.attributes) {
var _local2 = _local1.attributes[_local6];
if (_local6 == "id") {
_local3 = _local2;
} else {
gameData.put((((_local1.nodeName + ".") + _local3) + ".") + _local6, _local2);
}
}
gameData.put(((_local1.nodeName + ".") + _local3) + ".nodeData", _local1.firstChild);
}
_local1 = _local1.nextSibling;
}
}
}
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 641 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);
}
trace(_local2);
}
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 642 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 643 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 644 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 645 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("\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 646 MovieClip [__Packages.com.midasplayer.game.bompbompdeluxe.Game] Frame 0
class com.midasplayer.game.bompbompdeluxe.Game extends com.midasplayer.util.GameBase
{
static var score_, maxTime_, timeLeft_, seed_, random_, boardLayer_, effectsLayer_, board_, gameEnded_, animId_, bonus_, quitIntervalId_;
var init, aDriver_;
function Game () {
super();
_root.version.text = "";
Stage.showMenu = false;
Stage.scaleMode = "noScale";
_root._quality = "best";
_root._focusrect = false;
com.midasplayer.util.GameBase.setGameMode(_root.gamemode);
com.midasplayer.util.Log.setLevel(com.midasplayer.util.Log.LEVEL_NONE);
init(this);
}
function startGame() {
score_ = 0;
com.midasplayer.fx.SoundManager.enableSounds(true);
_root.version.text = "Version: " + VERSION;
maxTime_ = Number(com.midasplayer.util.GameBase.gameData.get("time"));
timeLeft_ = maxTime_;
seed_ = Number(com.midasplayer.util.GameBase.gameData.get("seed"));
random_ = new com.midasplayer.util.Random(seed_);
_root.attachMovie("top", "top", _root.getNextHighestDepth());
boardLayer_ = _root.createEmptyMovieClip("boardlayer", _root.getNextHighestDepth());
effectsLayer_ = _root.createEmptyMovieClip("effectslayer", _root.getNextHighestDepth());
board_ = new com.midasplayer.game.bompbompdeluxe.Board(this, boardLayer_, random_.nextInt(1000000));
_root.attachMovie("lowerbar", "lowerbar", _root.getNextHighestDepth());
_root.lowerbar.soundbtn.txt.text = com.midasplayer.util.I18n.format("sound_off");
_root.lowerbar.endgamebtn.txt.text = com.midasplayer.util.I18n.format("end_game");
_root.lowerbar._x = 0;
_root.lowerbar._y = 470;
_root.lowerbar.soundbtn.onRelease = function () {
com.midasplayer.game.bompbompdeluxe.Game.switchSound();
};
_root.lowerbar.endgamebtn.onRelease = function () {
com.midasplayer.game.bompbompdeluxe.Game.endGamePressed();
};
com.midasplayer.util.GameBase.reportGameStart();
com.midasplayer.util.GameBase.reportPlayData(19, VERSION, "0");
showInstructions();
}
static function isDeluxe() {
var _local1 = com.midasplayer.util.GameBase.gameData.get("mode");
return(_local1 == "deluxe");
}
static function switchSound() {
var _local2 = com.midasplayer.fx.SoundManager.isSoundEnabled();
com.midasplayer.fx.SoundManager.enableSounds(!_local2);
if (_local2) {
_root.lowerbar.soundbtn.txt.text = com.midasplayer.util.I18n.format("sound_on");
_root.lowerbar.soundbtn.gotoAndStop(5);
} else {
_root.lowerbar.soundbtn.txt.text = com.midasplayer.util.I18n.format("sound_off");
}
}
static function endGamePressed() {
if (gameEnded_) {
return(undefined);
}
gameEndPressed_ = true;
_root.lowerbar.endgame.onRelease = undefined;
_root.lowerbar.endgame.useHandCursor = false;
_root.lowerbar.removeMovieClip();
if (board_ == null) {
com.midasplayer.util.AnimPlayer.stop(animId_);
com.midasplayer.util.GameBase.reportPlayData(177, "", "0");
_root.game.gameOver();
} else if (!board_.isStopped()) {
com.midasplayer.util.AnimPlayer.stop(animId_);
board_.endGamePressed();
com.midasplayer.util.GameBase.reportPlayData(177, "", "0");
}
}
function playLoop() {
if (_root.playingloop) {
return(undefined);
}
_root.playingloop = true;
var _local2 = random(2) + 1;
var _local3 = 50;
com.midasplayer.fx.SoundManager.play("snd_loop" + _local2, _local3, false, _root.game.playLoopAgain);
}
function playLoopAgain() {
_root.playingloop = false;
_root.game.playLoop();
}
function stopLoop() {
com.midasplayer.fx.SoundManager.stop("snd_loop1");
com.midasplayer.fx.SoundManager.stop("snd_loop2");
}
function showInstructions() {
_root.attachMovie("instructions", "instructions", _root.getNextHighestDepth());
_root.instructions._x = 323;
_root.instructions._y = 71;
_root.instructions.instructions_header.text = com.midasplayer.util.I18n.format("instructions_header");
_root.instructions.instructions_text.text = com.midasplayer.util.I18n.format("instructions_text");
_root.instructions.instructions_police1.text = com.midasplayer.util.I18n.format("instructions_police1");
_root.instructions.instructions_police2.text = com.midasplayer.util.I18n.format("instructions_police2");
_root.instructions.instructions_start.text = com.midasplayer.util.I18n.format("instructions_start");
_root.instructions.instructions_start.text = com.midasplayer.util.I18n.format("game_starts_in", "15");
var _local3;
var _local5 = 44;
var _local4 = 40;
_root.ianim1 = _root.createEmptyMovieClip("ianim1", _root.getNextHighestDepth());
_local3 = new com.midasplayer.game.bompbompdeluxe.Bomp(null, _root.ianim1, com.midasplayer.game.bompbompdeluxe.Bomp.COLOR_ORANGE, com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_STAR, _root.ianim1);
_local3.setPos(_local5 * 0, _local4 * 0);
_local3.setFallHeight(0);
_root.ianim1.b1 = _local3;
_local3 = new com.midasplayer.game.bompbompdeluxe.Bomp(null, _root.ianim1, com.midasplayer.game.bompbompdeluxe.Bomp.COLOR_GREEN, com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NORMAL, _root.ianim1);
_local3.setPos(_local5 * 0, _local4 * 1);
_local3.setFallHeight(0);
_root.ianim1.b2 = _local3;
_local3 = new com.midasplayer.game.bompbompdeluxe.Bomp(null, _root.ianim1, com.midasplayer.game.bompbompdeluxe.Bomp.COLOR_BLACK, com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_STAR, _root.ianim1);
_local3.setPos(_local5 * 1, _local4 * 1);
_root.ianim1.b3 = _local3;
_local3 = new com.midasplayer.game.bompbompdeluxe.Bomp(null, _root.ianim1, com.midasplayer.game.bompbompdeluxe.Bomp.COLOR_BLUE, com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_STAR, _root.ianim1);
_local3.setPos(_local5 * 2, _local4 * 1);
_root.ianim1.b4 = _local3;
_local3 = new com.midasplayer.game.bompbompdeluxe.Bomp(null, _root.ianim1, com.midasplayer.game.bompbompdeluxe.Bomp.COLOR_BLUE, com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_COP, _root.ianim1);
_local3.setPos(_local5 * 0, _local4 * 2);
_root.ianim1.b5 = _local3;
_local3 = new com.midasplayer.game.bompbompdeluxe.Bomp(null, _root.ianim1, com.midasplayer.game.bompbompdeluxe.Bomp.COLOR_ORANGE, com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_COP, _root.ianim1);
_local3.setPos(_local5 * 1, _local4 * 2);
_root.ianim1.b6 = _local3;
_local3 = new com.midasplayer.game.bompbompdeluxe.Bomp(null, _root.ianim1, com.midasplayer.game.bompbompdeluxe.Bomp.COLOR_RED, com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_COP, _root.ianim1);
_local3.setPos(_local5 * 2, _local4 * 2);
_root.ianim1.b7 = _local3;
_root.ianim2 = _root.createEmptyMovieClip("ianim2", _root.getNextHighestDepth());
_local3 = new com.midasplayer.game.bompbompdeluxe.Bomp(null, _root.ianim2, com.midasplayer.game.bompbompdeluxe.Bomp.COLOR_GREEN, com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NORMAL, _root.ianim2);
_local3.setPos(_local5 * 0, _local4 * 0);
_local3.setFallHeight(0);
_root.ianim2.b1 = _local3;
_local3 = new com.midasplayer.game.bompbompdeluxe.Bomp(null, _root.ianim2, com.midasplayer.game.bompbompdeluxe.Bomp.COLOR_RED, com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NORMAL, _root.ianim2);
_local3.setPos(_local5 * 0, _local4 * 1);
_local3.setFallHeight(0);
_root.ianim2.b2 = _local3;
_local3 = new com.midasplayer.game.bompbompdeluxe.Bomp(null, _root.ianim2, com.midasplayer.game.bompbompdeluxe.Bomp.COLOR_GREEN, com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_STAR, _root.ianim2);
_local3.setPos(_local5 * 1, _local4 * 1);
_root.ianim2.b3 = _local3;
_local3 = new com.midasplayer.game.bompbompdeluxe.Bomp(null, _root.ianim2, com.midasplayer.game.bompbompdeluxe.Bomp.COLOR_GREEN, com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_BOMB, _root.ianim2);
_local3.setPos(_local5 * 2, _local4 * 1);
_root.ianim2.b4 = _local3;
_local3 = new com.midasplayer.game.bompbompdeluxe.Bomp(null, _root.ianim2, com.midasplayer.game.bompbompdeluxe.Bomp.COLOR_GREEN, com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_COP, _root.ianim2);
_local3.setPos(_local5 * 0, _local4 * 2);
_root.ianim2.b5 = _local3;
_local3 = new com.midasplayer.game.bompbompdeluxe.Bomp(null, _root.ianim2, com.midasplayer.game.bompbompdeluxe.Bomp.COLOR_ORANGE, com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_COP, _root.ianim2);
_local3.setPos(_local5 * 1, _local4 * 2);
_root.ianim2.b6 = _local3;
_local3 = new com.midasplayer.game.bompbompdeluxe.Bomp(null, _root.ianim2, com.midasplayer.game.bompbompdeluxe.Bomp.COLOR_RED, com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_COP, _root.ianim2);
_local3.setPos(_local5 * 2, _local4 * 2);
_root.ianim2.b7 = _local3;
_root.ianim1._x = 345;
_root.ianim1._y = 225;
_root.ianim2._x = 540;
_root.ianim2._y = 225;
com.midasplayer.util.AnimPlayer.play({playlist:[[{obj:this, func:anim1Select}], [{obj:this, func:anim1Move}], [{obj:this, func:anim1Explode}]], callback:null, callback_scope:this, tps:50});
com.midasplayer.util.AnimPlayer.play({playlist:[[{obj:this, func:anim2Select}], [{obj:this, func:anim2Move}], [{obj:this, func:anim2Explode}], [{obj:this, func:anim2Move2}]], callback:null, callback_scope:this, tps:50});
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:showInstructionsAnim}], callback:endShowInstructions, callback_scope:this, tps:50});
showBar();
}
function anim1Select(tick, alpha) {
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 100, 50);
if (_local2 == 1) {
_root.ianim1.b1.setSelected(true);
}
return(_local2 == 1);
}
function anim1Move(tick, alpha) {
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 50, 40);
var _local4 = _root.ianim1.b1;
var _local3 = _root.ianim1.b2;
_local4.setY(_local4.getPreviousY() + (_local2 * 40));
_local3.setY(_local3.getPreviousY() - (_local2 * 40));
if (_local2 == 1) {
_root.ianim1.b1.setSelected(false);
}
return(_local2 == 1);
}
function anim1Explode(tick, alpha) {
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 50, 20);
var _local9 = _root.ianim1.b1;
var _local8 = _root.ianim1.b2;
var _local7 = _root.ianim1.b3;
var _local6 = _root.ianim1.b4;
var _local5 = _root.ianim1.b5;
var _local4 = _root.ianim1.b6;
var _local3 = _root.ianim1.b7;
if (_local2 > 0) {
_local9.remove(true);
_local8.remove(true);
_local7.remove(true);
_local6.remove(true);
_local9.blink(1);
_local8.blink(2);
_local7.blink(3);
_local6.blink(4);
_local5.blink(5);
_local4.blink(6);
_local3.blink(7);
}
if (_local2 == 1) {
_local5.remove();
_local4.remove();
_local3.remove();
}
return(_local2 == 1);
}
function anim2Select(tick, alpha) {
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 350, 50);
if (_local2 == 1) {
_root.ianim2.b1.setSelected(true);
}
return(_local2 == 1);
}
function anim2Move(tick, alpha) {
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 50, 40);
var _local4 = _root.ianim2.b1;
var _local3 = _root.ianim2.b2;
_local4.setY(_local4.getPreviousY() + (_local2 * 40));
_local3.setY(_local3.getPreviousY() - (_local2 * 40));
if (_local2 == 1) {
_root.ianim2.b1.setSelected(false);
}
return(_local2 == 1);
}
function anim2Explode(tick, alpha) {
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 50, 20);
var _local6 = _root.ianim2.b1;
var _local7 = _root.ianim2.b2;
var _local5 = _root.ianim2.b3;
var _local4 = _root.ianim2.b4;
var _local3 = _root.ianim2.b5;
var _local9 = _root.ianim2.b6;
var _local8 = _root.ianim2.b7;
if (_local2 > 0) {
_local7.setFallHeight(0);
_local6.remove(true);
_local5.remove(true);
_local4.remove(true);
_local6.blink(2);
_local5.blink(3);
_local4.blink(4);
_local3.blink(5);
}
if (_local2 == 1) {
_local3.remove();
}
return(_local2 == 1);
}
function anim2Move2(tick, alpha) {
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 30);
var _local3 = _root.ianim2.b2;
_local3.setY(_local3.getPreviousY() + (_local2 * 40));
return(_local2 == 1);
}
function showInstructionsAnim(tick, alpha) {
var _local3 = false;
var _local4 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 750);
var _local5 = Math.ceil(15 - (_local4 * 15));
_root.instructions.instructions_start.text = com.midasplayer.util.I18n.format("game_starts_in", "" + _local5);
if (((tick > 25) && (_root.instructions.onPress == undefined)) && (!gameEndPressed_)) {
_root.instructions.onPress = function () {
this.clicked = true;
};
_root.instructions.click.text = com.midasplayer.util.I18n.format("instructions_click");
}
if ((_local4 == 1) || (_root.instructions.clicked)) {
_root.intro._visible = false;
_local3 = true;
}
return(_local3);
}
function endShowInstructions() {
_root.instructions.removeMovieClip();
_root.ianim1.b1.remove(true);
_root.ianim1.b2.remove(true);
_root.ianim1.b3.remove(true);
_root.ianim1.b4.remove(true);
_root.ianim1.b5.remove(true);
_root.ianim1.b6.remove(true);
_root.ianim1.b7.remove(true);
_root.ianim1.removeMovieClip();
_root.ianim2.b1.remove(true);
_root.ianim2.b2.remove(true);
_root.ianim2.b3.remove(true);
_root.ianim2.b4.remove(true);
_root.ianim2.b5.remove(true);
_root.ianim2.b6.remove(true);
_root.ianim2.b7.remove(true);
_root.ianim2.removeMovieClip();
if (gameEndPressed_) {
return(undefined);
}
prepareRound();
}
function showLogo() {
}
function removeLogo() {
}
function showBar() {
_root.bar = _root.attachMovie("bar", "bar", boardLayer_.getNextHighestDepth());
_root.bar.infobox.score_txt.text = com.midasplayer.util.I18n.format("score");
_root.bar.infobox.timeleft_txt.text = com.midasplayer.util.I18n.format("timeleft");
_root.bar.infobox.round_txt.text = com.midasplayer.util.I18n.format("round");
displayRoundNum();
_root.bar._x = -195;
_root.bar._y = -1;
_root.bar.infobox._y = -184;
_root.bar.resetbox._y = 539;
displayScore();
displayTime();
var _local3 = new Array();
_local3.push({obj:this, func:barInAnim});
com.midasplayer.util.AnimPlayer.play({playlist:_local3, callback:endShowBar, callback_scope:this, tps:50});
}
function endShowBar() {
com.midasplayer.fx.SoundManager.play("snd_intro", 70, false, _root.game.playLoop);
aDriver_ = new com.midasplayer.util.AnimDriver(_root.bar.intro, 25);
aDriver_.playOnce();
}
function prepareRound() {
var _local3 = new Array();
var _local2 = new Array();
var _local4 = new Array();
_local2.push({obj:this, func:barLogoOutAnim});
_local2.push({obj:this, func:barInfoBoxInAnim});
_local2.push({obj:this, func:barResetBoxInAnim});
_local4.push({obj:board_, func:board_.showBompsAnim});
_local4.push({obj:board_, func:board_.showNotesAnim});
_local3.push(_local2);
_local3.push(_local4);
com.midasplayer.util.AnimPlayer.play({playlist:_local3, callback:startRound, callback_scope:this, tps:50});
}
function barInAnim(tick, alpha) {
var _local3 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 50);
var _local4 = easeInOutQuad(_local3, -195, 200, 1);
_root.bar._x = _local4;
return(_local3 == 1);
}
function barOutAnim(tick, alpha) {
var _local3 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 50);
var _local4 = easeInOutQuad(_local3, 5, -200, 1);
_root.bar._x = _local4;
return(_local3 == 1);
}
function barInfoBoxInAnim(tick, alpha) {
var _local3 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 50, 50);
var _local4 = easeInOutQuad(_local3, -184, 220, 1);
_root.bar.infobox._y = _local4;
return(_local3 == 1);
}
function barLogoOutAnim(tick, alpha) {
var _local3 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 50);
var _local4 = easeInOutQuad(_local3, 166, -220, 1);
_root.bar.intro._y = _local4;
return(_local3 == 1);
}
function barResetBoxInAnim(tick, alpha) {
var _local3 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 50, 50);
var _local4 = easeInOutQuad(_local3, 539, -300, 1);
_root.bar.resetbox._y = _local4;
return(_local3 == 1);
}
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);
}
function startRound() {
trace("start round");
_root.bar.intro.stop();
_root.bar.intro._visible = false;
aDriver_.playStop();
maxTime_ = Number(com.midasplayer.util.GameBase.gameData.get("time"));
com.midasplayer.util.GameBase.reportPlayData(132, "", "0");
board_.start(DEBUG_MODE);
if (DEBUG_MODE) {
var _local3 = new com.midasplayer.game.bompbompdeluxe.Replay(board_);
}
}
function endRound() {
if (gameEnded_) {
return(undefined);
}
gameOver();
}
function gameOver() {
_root.intro.removeMovieClip();
_root.instructions.removeMovieClip();
_root.lowerbar.removeMovieClip();
if (gameEnded_) {
return(undefined);
}
gameEnded_ = true;
showGameOver();
}
function showGameOver() {
var _local3 = 0;
if (board_ != undefined) {
_local3 = board_.getNumRemovedBomps();
}
bonus_ = _local3 * 3;
score_ = score_ + bonus_;
if (timeLeft_ == undefined) {
timeLeft_ = 0;
}
com.midasplayer.util.GameBase.reportPlayData(31, "" + timeLeft_, "" + bonus_);
com.midasplayer.util.GameBase.reportGameEnd(score_);
com.midasplayer.fx.SoundManager.play("snd_end", 100);
var _local2 = new Array();
if (board_ != undefined) {
_local2.push([{obj:board_, func:board_.removeBompsAnim}]);
}
_local2.push([{obj:this, func:barOutAnim}]);
_local2.push([{obj:this, func:playToNightAnim}]);
_local2.push([{obj:this, func:playChopperAnim}]);
_local2.push([{obj:this, func:showGameOverAnim}]);
com.midasplayer.util.AnimPlayer.play({playlist:_local2, callback:endShowGameOver, callback_scope:this, tps:50});
}
function showSign() {
if (_root.sign != undefined) {
return(undefined);
}
_root.attachMovie("sign", "sign", _root.getNextHighestDepth());
_root.sign.gotoAndStop(1);
_root.sign._x = 340;
_root.sign._y = 140;
_root.sign.header.text = com.midasplayer.util.I18n.format("game_over");
_root.sign.txt_score.text = com.midasplayer.util.I18n.format("score");
_root.sign.txt_bonus.text = com.midasplayer.util.I18n.format("bonus");
_root.sign.txt_total.text = com.midasplayer.util.I18n.format("total_score");
_root.sign.score.text = score_ - bonus_;
_root.sign.bonus.text = bonus_;
_root.sign.total.text = score_;
_root.sign.ends_in.text = com.midasplayer.util.I18n.format("game_ends_in", "10");
}
function playToNightAnim(tick, alpha) {
var _local3 = 150 - sceneFrame_;
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, _local3 / 2);
var _local4 = Math.round(sceneFrame_ + (_local2 * _local3));
_root.scene.gotoAndStop(_local4);
_root.scene.shadows.gotoAndStop(_local4 * 2);
if (_local2 == 1) {
com.midasplayer.fx.SoundManager.stop("snd_intro");
com.midasplayer.fx.SoundManager.stop("snd_loop1");
com.midasplayer.fx.SoundManager.stop("snd_loop2");
com.midasplayer.fx.SoundManager.play("snd_gameover", 100);
}
if (_local2 == 1) {
_root._quality = "high";
}
return(_local2 == 1);
}
function playChopperAnim(tick, alpha) {
var _local3 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 250);
var _local4 = 150 + Math.round(150 * _local3);
_root.scene.gotoAndStop(_local4);
if (_local4 >= 215) {
showSign();
}
return(_local3 == 1);
}
function showGameOverAnim(tick) {
var _local3 = false;
var _local4 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 500);
var _local6 = Math.ceil(10 - (_local4 * 10));
var _local7 = Math.round(24 * com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 50)) + 1;
_root.sign.gotoAndStop(_local7);
_root.sign.ends_in.text = com.midasplayer.util.I18n.format("game_ends_in", "" + _local6);
if ((tick > 25) && (_root.sign.onPress == undefined)) {
_root.sign.onPress = function () {
this.clicked = true;
};
_root.sign.click.text = com.midasplayer.util.I18n.format("instructions_click");
}
if ((_local4 == 1) || (_root.sign.clicked)) {
_local3 = true;
}
return(_local3);
}
function endShowGameOver() {
endGame();
}
static function endGame() {
quitIntervalId_ = setInterval(quitGame, 1600);
}
static function quitGame() {
clearInterval(quitIntervalId_);
com.midasplayer.fx.SoundManager.stopAll();
com.midasplayer.util.GameBase.reportGameQuit();
}
static function addScore(score) {
score_ = score_ + score;
score_ = ((score_ < 0) ? 0 : (score_));
displayScore();
}
static function getScore() {
return(score_);
}
static function displayScore() {
_root.bar.infobox.score.text = score_;
}
static function displayTime() {
var _local4 = Math.max(timeLeft_, 0);
var _local2 = _local4 / 60;
_local2 = Math.floor(_local2);
var _local3 = _local4 - (_local2 * 60);
if (_local3 < 10) {
_local3 = "0" + _local3;
}
var _local5 = (_local2 + ":") + _local3;
if (_root.bar.infobox.timeleft.text != _local5) {
_root.bar.infobox.timeleft.text = _local5;
}
}
static function nextRound() {
roundNum_++;
displayRoundNum();
}
static function displayRoundNum() {
_root.bar.infobox.round.text = "0" + roundNum_;
}
static function setTime(t) {
timeLeft_ = maxTime_ - Math.round(t);
displayTime();
updateScene(t);
}
static function getMaxTime() {
return(maxTime_);
}
static function updateScene(t) {
if (board_.isMovingBomps()) {
return(undefined);
}
var _local2 = shadowsFrame_;
shadowsFrame_ = Math.round(300 * (t / 240));
shadowsFrame_ = ((shadowsFrame_ < 1) ? 1 : (shadowsFrame_));
shadowsFrame_ = ((shadowsFrame_ > 300) ? 300 : (shadowsFrame_));
if (_local2 != shadowsFrame_) {
_root.scene.shadows.gotoAndStop(shadowsFrame_);
}
_local2 = sceneFrame_;
sceneFrame_ = Math.round(150 * (t / 240));
sceneFrame_ = ((sceneFrame_ < 1) ? 1 : (sceneFrame_));
sceneFrame_ = ((sceneFrame_ > 150) ? 150 : (sceneFrame_));
if (_local2 != sceneFrame_) {
_root.scene.gotoAndStop(sceneFrame_);
}
}
static var VERSION = "1.14";
static var DEBUG_MODE = false;
static var gameEndPressed_ = false;
static var sceneFrame_ = 1;
static var shadowsFrame_ = 1;
static var roundNum_ = 1;
}
Symbol 647 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 _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;
}
_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 648 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 649 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 650 MovieClip [__Packages.com.midasplayer.timing.Timeable] Frame 0
interface com.midasplayer.timing.Timeable
{
}
Symbol 651 MovieClip [__Packages.com.midasplayer.game.bompbompdeluxe.Board] Frame 0
class com.midasplayer.game.bompbompdeluxe.Board implements com.midasplayer.timing.Timeable
{
static var random_;
var game_, clip_, seed_, cols_, rows_, colMovedIn_, noteMovedIn_, bompLayer_, floorLayer_, effectsLayer_, maskLayer_, tiles_, bomps_, bompCount_, handleClick_, stopped_, comboNumber_, comboMade_, policeAnim_, oldCopBomps_, timer_, started_;
function Board (game, clip, seed) {
game_ = game;
clip_ = clip;
seed_ = seed;
cols_ = Number(com.midasplayer.util.GameBase.gameData.get("cols"));
rows_ = Number(com.midasplayer.util.GameBase.gameData.get("rows"));
random_ = new com.midasplayer.util.Random(seed_);
initLayers();
initBomps();
bombReset_ = new com.midasplayer.game.bompbompdeluxe.BombReset(this);
colMovedIn_ = new Array();
noteMovedIn_ = new Array();
}
function initLayers() {
bompLayer_ = clip_.createEmptyMovieClip("bomplayer", clip_.getNextHighestDepth());
floorLayer_ = bompLayer_.createEmptyMovieClip("floorlayer", bompLayer_.getNextHighestDepth());
initTiles();
effectsLayer_ = clip_.createEmptyMovieClip("effectslayer", clip_.getNextHighestDepth());
maskLayer_ = clip_.createEmptyMovieClip("masklayer", clip_.getNextHighestDepth());
bompLayer_._visible = false;
}
function initTiles() {
floorLayer_._alpha = 0;
tiles_ = new Array();
var _local5 = 0;
while (_local5 < rows_) {
var _local3 = 0;
while (_local3 < cols_) {
var _local4 = floorLayer_.getNextHighestDepth();
var _local2 = floorLayer_.attachMovie("danceTile", "tile" + _local4, _local4);
_local2._x = (BOARD_X - 0) + (_local3 * com.midasplayer.game.bompbompdeluxe.Bomp.WIDTH);
_local2._y = (BOARD_Y + 1) + (_local5 * com.midasplayer.game.bompbompdeluxe.Bomp.HEIGHT);
tiles_.push(_local2);
_local2.initFrame = random(_local2._totalframes);
_local2.gotoAndStop(_local2.initFrame);
_local3++;
}
_local5++;
}
}
function copConverted() {
copsConverted_++;
if (copsConverted_ == cols_) {
copsConverted_ = 0;
partyModeActive_ = true;
partyModeStartedAt_ = reportedTick_;
startDanceFloor();
}
}
function isPartyMode() {
if (!partyModeActive_) {
return(false);
}
if (reportedTick_ < (partyModeStartedAt_ + (TPS * 20))) {
return(true);
}
partyModeActive_ = false;
return(false);
}
function startDanceFloor() {
partyModePlaying_ = true;
com.midasplayer.fx.SoundManager.play("snd_party", 100, true);
_root.game.stopLoop();
_root.danceframe = 0;
_root.dancemaxframes = tiles_[0]._totalframes;
var _local3 = new Array();
_local3.push({obj:this, func:startDanceFloorAnim});
_local3.push({obj:this, func:playDanceFloorAnim});
danceFloorAnimId_ = com.midasplayer.util.AnimPlayer.play({playlist:_local3, callback:undefined, callback_scope:this, tps:50});
}
function startDanceFloorAnim(tick, alpha) {
var _local3 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 15);
var _local4 = _local3 * 100;
floorLayer_._alpha = _local4;
_root.dancei = 0;
return(_local3 == 1);
}
function playDanceFloorAnim(tick, alpha) {
var _local7 = Math.floor((tick + alpha) * 0.6);
_root.dancei++;
var _local6 = 0;
var _local5 = Math.floor(tiles_.length / 2);
if ((_root.dancei % 2) == 1) {
_local6 = _local5 + 1;
_local5 = tiles_.length;
}
if (_root.danceframe != _local7) {
_root.danceframe = _local7;
var _local8 = tiles_.length;
var _local3 = _local6;
while (_local3 < _local5) {
var _local4 = tiles_[_local3];
_local4.gotoAndStop(1 + ((_local4.initFrame + _root.danceframe) % _root.dancemaxframes));
_local3++;
}
}
return(false);
}
function stopDanceFloor() {
com.midasplayer.util.AnimPlayer.stop(danceFloorAnimId_);
if (partyModePlaying_) {
com.midasplayer.fx.SoundManager.stop("snd_party");
_root.game.playLoopAgain();
partyModePlaying_ = false;
var _local3 = new Array();
_local3.push({obj:this, func:stopDanceFloorAnim});
com.midasplayer.util.AnimPlayer.play({playlist:_local3, callback:stopDanceFloorEnd, callback_scope:this, tps:50});
}
}
function stopDanceFloorAnim(tick, alpha) {
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 15);
var _local3 = 100 - (_local2 * 100);
floorLayer_._alpha = _local3;
return(_local2 == 1);
}
function stopDanceFloorEnd() {
com.midasplayer.util.AnimPlayer.stop(danceFloorAnimId_);
}
function insertNotes() {
var _local3;
var _local5 = rows_ - 1;
var _local7 = BOARD_X;
var _local8 = BOARD_Y + (com.midasplayer.game.bompbompdeluxe.Bomp.HEIGHT * _local5);
var _local2 = 0;
while (_local2 < cols_) {
_local3 = getBomp(_local5 - 2, _local2);
var _local6 = random_.nextInt(com.midasplayer.game.bompbompdeluxe.Bomp.HEIGHT);
var _local4 = random_.nextInt(2);
if (_local4 == 1) {
_local4 = com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE1;
} else {
_local4 = com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE2;
}
addBomp(_local5, _local2, _local7, _local8 - _local6, _local4, _local3.getColor());
_local3 = bomps_[_local5][_local2];
_local3.setFallHeight(0);
_local3.setY(_local3.getPreviousY() + (2 * com.midasplayer.game.bompbompdeluxe.Bomp.HEIGHT));
_local3.setFallHeight(0);
noteMovedIn_[_local2] = false;
_local7 = _local7 + com.midasplayer.game.bompbompdeluxe.Bomp.WIDTH;
_local2++;
}
}
function initBomps() {
var _local3;
var _local6 = BOARD_Y;
bomps_ = new Array();
bompCount_ = 0;
var _local4 = 0;
while (_local4 < rows_) {
var _local5 = BOARD_X;
bomps_[_local4] = new Array();
var _local2 = 0;
while (_local2 < cols_) {
addBomp(_local4, _local2, _local5, _local6);
_local5 = _local5 + com.midasplayer.game.bompbompdeluxe.Bomp.WIDTH;
if (_local4 > (rows_ - 3)) {
bomps_[_local4][_local2].remove();
}
_local2++;
}
_local6 = _local6 + com.midasplayer.game.bompbompdeluxe.Bomp.HEIGHT;
_local4++;
}
insertNotes();
_local4 = 0;
while (_local4 < rows_) {
var _local2 = 0;
while (_local2 < cols_) {
_local3 = getBomp(_local4, _local2);
if (_local4 < (rows_ - 1)) {
_local3.setY(_local3.getPreviousY() - 400);
}
_local3.makeReadyForUse();
_local2++;
}
_local4++;
}
maskLayer_.beginFill(255);
var _local8 = (BOARD_X - (com.midasplayer.game.bompbompdeluxe.Bomp.WIDTH / 2)) - 3;
var _local7 = BOARD_Y - (com.midasplayer.game.bompbompdeluxe.Bomp.HEIGHT / 2);
var _local10 = (cols_ * com.midasplayer.game.bompbompdeluxe.Bomp.WIDTH) + 4;
var _local9 = (rows_ * com.midasplayer.game.bompbompdeluxe.Bomp.HEIGHT) - 3;
maskLayer_.moveTo(_local8 + (_local10 * 0), _local7 + (_local9 * 0));
maskLayer_.lineTo(_local8 + (_local10 * 1), _local7 + (_local9 * 0));
maskLayer_.lineTo(_local8 + (_local10 * 1), _local7 + (_local9 * 1));
maskLayer_.lineTo(_local8 + (_local10 * 0), _local7 + (_local9 * 1));
maskLayer_.lineTo(_local8 + (_local10 * 0), _local7 + (_local9 * 0));
maskLayer_.endFill();
bompLayer_.setMask(maskLayer_);
}
function addBomp(row, col, x, y, forceType, forceColor) {
var _local5;
var _local3;
var _local2;
if (forceType != undefined) {
_local3 = forceType;
} else if ((bompCount_ < (cols_ * rows_)) && (row == (rows_ - 3))) {
_local3 = com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_COP;
} else {
_local3 = getNextBompType();
}
if (forceColor != undefined) {
_local5 = forceColor;
} else {
_local5 = getNextBompColor();
}
_local2 = new com.midasplayer.game.bompbompdeluxe.Bomp(this, bompLayer_, _local5, _local3, effectsLayer_);
_local2.setPos(x, y);
_local2.setCol(col);
_local2.setRow(row);
bomps_[row][col] = _local2;
if (bompCount_ < (cols_ * rows_)) {
var _local6 = findCombos();
if (_local6.length > 0) {
_local2.remove();
addBomp(row, col, x, y);
} else {
bompCount_++;
}
} else {
_local2.setClickable(true);
bompCount_++;
}
}
function getNumRows() {
return(rows_);
}
function getNumCols() {
return(cols_);
}
function getNextBompColor() {
var _local1;
var _local2 = 6;
_local1 = random_.nextInt(_local2);
return(_local1);
}
function getNextBompType() {
var _local2;
var _local3 = random_.nextInt(100);
var _local4 = getBombPercent();
var _local5 = getStarPercent();
if (_local3 < _local4) {
_local2 = com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_BOMB;
} else if (_local3 < (_local4 + _local5)) {
_local2 = com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_STAR;
} else {
_local2 = com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NORMAL;
}
return(_local2);
}
function getBombPercent() {
if (bompCount_ < (cols_ * rows_)) {
return(0);
}
return(4);
}
function getStarPercent() {
if (bompCount_ < (cols_ * rows_)) {
return(0);
}
return(10);
}
function bompClicked(bomp) {
if (handleClick_) {
return(undefined);
}
if (stopped_) {
return(undefined);
}
handleClick_ = true;
okToUpdateScene_ = false;
reportedTick_ = currentTick_;
reportedRow_ = bomp.getRow();
reportedCol_ = bomp.getCol();
reportedScore_ = com.midasplayer.game.bompbompdeluxe.Game.getScore();
if (clickedBomp_ == null) {
clickedBomp_ = bomp;
clickedBomp_.setSelected(true);
bompClickedEnd();
return(undefined);
}
if (clickedBomp_.adjacentTo(bomp)) {
switchBomps(clickedBomp_, bomp);
return(undefined);
}
if (clickedBomp_ == bomp) {
clickedBomp_.setSelected(false);
clickedBomp_ = null;
bompClickedEnd();
return(undefined);
}
clickedBomp_.setSelected(false);
clickedBomp_ = null;
bompClickedEnd();
return(undefined);
}
function bompClickedEnd() {
reportedScore_ = com.midasplayer.game.bompbompdeluxe.Game.getScore() - reportedScore_;
com.midasplayer.util.GameBase.reportPlayData(5, (((reportedTick_ + " ") + reportedRow_) + " ") + reportedCol_, "" + reportedScore_);
handleClick_ = false;
okToUpdateScene_ = true;
}
function switchBomps(bomp1, bomp2) {
var _local6 = bomp1.getCol();
var _local8 = bomp1.getRow();
var _local4 = bomp2.getCol();
var _local7 = bomp2.getRow();
var _local12 = _local6 - _local4;
var _local11 = _local8 - _local7;
var _local5 = new Array();
_local5.push({obj:this, func:moveBompAnim, params:{bomp:bomp1, x:bomp1.getX(), y:bomp1.getY(), dx:-_local12, dy:-_local11}});
_local5.push({obj:this, func:moveBompAnim, params:{bomp:bomp2, x:bomp2.getX(), y:bomp2.getY(), dx:_local12, dy:_local11}});
com.midasplayer.util.AnimPlayer.play({playlist:_local5, callback:endSwitchBomps, callback_scope:this, tps:50});
bomp1.setCol(_local4);
bomp1.setRow(_local7);
bomp2.setCol(_local6);
bomp2.setRow(_local8);
bomps_[_local8][_local6] = bomp2;
bomps_[_local7][_local4] = bomp1;
com.midasplayer.fx.SoundManager.play("snd_switch", 100);
}
function moveBompAnim(tick, alpha, params) {
var _local7 = params.x;
var _local5 = params.y;
var _local4 = params.dx;
var _local3 = params.dy;
var _local8 = params.bomp;
var _local1 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 15);
var _local9 = ((_local1 * _local4) * com.midasplayer.game.bompbompdeluxe.Bomp.WIDTH) + _local7;
var _local6 = ((_local1 * _local3) * com.midasplayer.game.bompbompdeluxe.Bomp.HEIGHT) + _local5;
_local8.setPos(_local9, _local6);
return(_local1 == 1);
}
function endSwitchBomps() {
comboNumber_ = 1;
comboMade_ = false;
clickedBomp_.setSelected(false);
clickedBomp_ = null;
handleCombos();
}
function handleCombos() {
var _local2;
_local2 = findCombos();
if (_local2.length > 0) {
comboMade_ = true;
removeCombos(_local2);
} else if (checkDiamonds()) {
fallDown();
} else {
if (!comboMade_) {
com.midasplayer.game.bompbompdeluxe.Game.addScore(-11);
}
var _local3 = checkBombs();
if (!_local3) {
checkCops();
}
}
}
function findCombos() {
var _local4;
var _local7;
var _local2;
var _local3;
var _local10 = new Array();
var _local5 = 0;
while (_local5 < rows_) {
var _local6 = 0;
var _local8 = 0;
while (_local8 <= cols_) {
_local4 = bomps_[_local5][_local8];
_local2 = _local4.getType();
if (_local2 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_STAR) {
_local6++;
} else if (_local6 >= 3) {
_local3 = new com.midasplayer.game.bompbompdeluxe.Combo(this, comboNumber_, com.midasplayer.game.bompbompdeluxe.Combo.TYPE_STAR, _local8 - _local6, _local5, _local8 - 1, _local5);
comboNumber_++;
_local10.push(_local3);
_local6 = 0;
} else {
_local6 = 0;
}
_local8++;
}
_local5++;
}
var _local8 = 0;
while (_local8 < cols_) {
var _local6 = 0;
_local5 = 0;
while (_local5 <= rows_) {
_local4 = bomps_[_local5][_local8];
_local2 = _local4.getType();
if (_local2 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_STAR) {
_local6++;
} else if (_local6 >= 3) {
_local3 = new com.midasplayer.game.bompbompdeluxe.Combo(this, comboNumber_, com.midasplayer.game.bompbompdeluxe.Combo.TYPE_STAR, _local8, _local5 - _local6, _local8, _local5 - 1);
comboNumber_++;
_local10.push(_local3);
_local6 = 0;
} else {
_local6 = 0;
}
_local5++;
}
_local8++;
}
_local5 = 0;
while (_local5 < rows_) {
var _local13 = -1;
var _local6 = 0;
_local8 = 0;
while (_local8 <= cols_) {
_local4 = bomps_[_local5][_local8];
_local7 = _local4.getColor();
_local2 = _local4.getType();
if (((((_local7 == _local13) && (_local2 != com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_COP)) && (_local2 != com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE1)) && (_local2 != com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE2)) && (_local7 != undefined)) {
_local6++;
} else if (_local6 >= 3) {
var _local9 = _local5;
var _local14 = 0;
var _local12 = 0;
var _local11 = _local8 - _local6;
while (_local11 < _local8) {
_local4 = bomps_[_local9][_local11];
_local2 = _local4.getType();
if (_local2 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_BOMB) {
_local14++;
} else if (_local2 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_STAR) {
_local12++;
} else if (_local2 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_DIAMOND) {
_local3 = new com.midasplayer.game.bompbompdeluxe.Combo(this, comboNumber_, com.midasplayer.game.bompbompdeluxe.Combo.TYPE_DIAMOND, _local11, 0, _local11, rows_ - 1);
comboNumber_++;
_local10.push(_local3);
}
_local11++;
}
if (_local12 != _local6) {
if ((_local12 >= 1) && (_local14 >= 1)) {
_local3 = new com.midasplayer.game.bompbompdeluxe.Combo(this, comboNumber_, com.midasplayer.game.bompbompdeluxe.Combo.TYPE_STAR_BOMB, _local8 - _local6, _local5, _local8 - 1, _local5);
} else {
_local3 = new com.midasplayer.game.bompbompdeluxe.Combo(this, comboNumber_, com.midasplayer.game.bompbompdeluxe.Combo.TYPE_COLOR, _local8 - _local6, _local5, _local8 - 1, _local5);
}
comboNumber_++;
_local10.push(_local3);
_local13 = -1;
_local6 = 0;
} else {
_local13 = _local7;
_local6 = ((((_local2 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_COP) || (_local2 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE1)) || (_local2 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE2)) ? 0 : 1);
}
} else {
_local13 = _local7;
_local6 = ((((_local2 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_COP) || (_local2 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE1)) || (_local2 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE2)) ? 0 : 1);
}
_local8++;
}
_local5++;
}
_local8 = 0;
while (_local8 < cols_) {
var _local13 = -1;
var _local6 = 0;
_local5 = 0;
while (_local5 <= rows_) {
_local4 = bomps_[_local5][_local8];
_local7 = _local4.getColor();
_local2 = _local4.getType();
if (((((_local7 == _local13) && (_local2 != com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_COP)) && (_local2 != com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE1)) && (_local2 != com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE2)) && (_local7 != undefined)) {
_local6++;
} else if (_local6 >= 3) {
var _local11 = _local8;
var _local14 = 0;
var _local12 = 0;
var _local9 = _local5 - _local6;
while (_local9 < _local5) {
_local4 = bomps_[_local9][_local11];
_local2 = _local4.getType();
if (_local2 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_BOMB) {
_local14++;
} else if (_local2 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_STAR) {
_local12++;
} else if (_local2 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_DIAMOND) {
_local3 = new com.midasplayer.game.bompbompdeluxe.Combo(this, comboNumber_, com.midasplayer.game.bompbompdeluxe.Combo.TYPE_DIAMOND, _local11, 0, _local11, rows_ - 1);
comboNumber_++;
_local10.push(_local3);
}
_local9++;
}
if (_local12 != _local6) {
if ((_local12 >= 1) && (_local14 >= 1)) {
_local3 = new com.midasplayer.game.bompbompdeluxe.Combo(this, comboNumber_, com.midasplayer.game.bompbompdeluxe.Combo.TYPE_STAR_BOMB, _local8, _local5 - _local6, _local8, _local5 - 1);
} else {
_local3 = new com.midasplayer.game.bompbompdeluxe.Combo(this, comboNumber_, com.midasplayer.game.bompbompdeluxe.Combo.TYPE_COLOR, _local8, _local5 - _local6, _local8, _local5 - 1);
}
comboNumber_++;
_local10.push(_local3);
_local13 = -1;
_local6 = 0;
} else {
_local13 = _local7;
_local6 = ((((_local2 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_COP) || (_local2 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE1)) || (_local2 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE2)) ? 0 : 1);
}
} else {
_local13 = _local7;
_local6 = ((((_local2 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_COP) || (_local2 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE1)) || (_local2 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE2)) ? 0 : 1);
}
_local5++;
}
_local8++;
}
return(_local10);
}
function removeCombos(combos) {
var _local8 = combos.length;
var _local7 = new Array();
var _local2 = 0;
while (_local2 < _local8) {
_local7.push({obj:this, func:removeCombosAnim, params:{i:_local2, combo:combos[_local2]}});
_local2++;
}
com.midasplayer.util.AnimPlayer.play({playlist:_local7, callback:endRemoveCombos, callback_scope:this, tps:50});
}
function removeCombosAnim(tick, alpha, params) {
var _local2 = params.combo;
var _local4 = params.i;
var _local3 = ((_local2.getType() == com.midasplayer.game.bompbompdeluxe.Combo.TYPE_COLOR) ? 8 : 20);
var _local1 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, _local4 * 2, _local3);
if (_local1 > 0) {
_local2.removeBompsAnim(_local1);
}
return(_local1 == 1);
}
function endRemoveCombos() {
fallDown();
}
function fallDown() {
var _local13;
var _local9;
var _local7;
var _local8 = new Array();
var _local4 = 0;
while (_local4 < cols_) {
var _local2 = 0;
_local9 = undefined;
var _local3 = rows_ - 1;
while (_local3 >= 0) {
_local13 = getBomp(_local3, _local4);
_local7 = _local13.getType();
if (_local13 == undefined) {
_local2++;
} else if ((_local7 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE1) || (_local7 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE2)) {
_local2++;
_local9 = _local13;
} else if (!_local13.isMovable()) {
_local2 = 0;
} else if (_local2 > 0) {
_local13.setFallHeight(_local2);
bomps_[_local3 + _local2][_local4] = _local13;
_local13.setRow(_local3 + _local2);
bomps_[_local3][_local4] = undefined;
_local8.push({obj:this, func:fallDownAnim, params:{bomp:_local13, note:_local9}});
_local9 = undefined;
}
_local3--;
}
var _local5 = 0;
while (_local5 < _local2) {
var _local6 = (_local2 - _local5) - 1;
addBomp(_local6, _local4, BOARD_X + (_local4 * com.midasplayer.game.bompbompdeluxe.Bomp.WIDTH), BOARD_Y - ((_local5 + 1) * com.midasplayer.game.bompbompdeluxe.Bomp.HEIGHT));
_local13 = bomps_[_local6][_local4];
_local13.setFallHeight(_local2);
_local8.push({obj:this, func:fallDownAnim, params:{bomp:_local13, note:_local9}});
_local5++;
}
_local4++;
}
com.midasplayer.util.AnimPlayer.play({playlist:_local8, callback:endFallDown, callback_scope:this, tps:50});
}
function fallDownAnim(tick, alpha, params) {
var _local4 = params.bomp;
var _local3 = params.note;
var _local6 = _local4.getFallHeight();
var _local2 = Math.min(_local6, 10) / 10;
_local2 = 1 - (((1 - _local2) * (1 - _local2)) * (1 - _local2));
_local2 = 40 * _local2;
var _local8 = tick + alpha;
var _local5 = com.midasplayer.util.AnimPlayer.tickToPercent(_local8, 0, _local2);
var _local7 = easeInOutQuad(_local5, _local4.getPreviousY(), com.midasplayer.game.bompbompdeluxe.Bomp.HEIGHT * _local6, 1);
_local4.setY(_local7);
if (_local3 != undefined) {
if ((_local7 + com.midasplayer.game.bompbompdeluxe.Bomp.HEIGHT) >= _local3.getY()) {
_local3.remove(true);
}
}
return(_local5 == 1);
}
function easeInQuad(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
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);
}
function endFallDown() {
handleCombos();
}
function checkDiamonds() {
var _local3;
var _local6;
var _local8 = 1;
var _local7 = false;
var _local5 = 0;
while (_local5 < rows_) {
var _local2 = 0;
while (_local2 <= cols_) {
_local3 = getBomp(_local5, _local2);
_local6 = _local3.getType();
if (_local6 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_DIAMOND) {
var _local4 = _local3.reduceDiamondCount(_local8);
if (_local4 == 0) {
_local3.remove();
_local7 = true;
}
}
_local2++;
}
_local5++;
}
return(_local7);
}
function checkBombs() {
var _local3;
var _local6;
var _local8 = (comboMade_ ? 1 : 2);
var _local7 = false;
var _local5 = 0;
while (_local5 < rows_) {
var _local2 = 0;
while (_local2 <= cols_) {
_local3 = getBomp(_local5, _local2);
_local6 = _local3.getType();
if (_local6 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_BOMB) {
var _local4 = _local3.reduceBombCount(_local8);
if (_local4 == 0) {
_local7 = true;
}
}
_local2++;
}
_local5++;
}
if (_local7) {
bompClickedEnd();
gameOver();
}
return(_local7);
}
function checkCops() {
if (copCount_ >= COP_ROW_LIMIT) {
copCount_ = 0;
copsConverted_ = 0;
newCopLine();
} else {
bompClickedEnd();
}
}
function newCopLine() {
com.midasplayer.fx.SoundManager.play("snd_siren", 100);
paused_ = true;
partyModeActive_ = false;
var _local10 = new Array();
var _local6 = new Array();
var _local7 = new Array();
var _local3 = rows_ - 3;
var _local5 = BOARD_X;
var _local9 = BOARD_Y + (_local3 * com.midasplayer.game.bompbompdeluxe.Bomp.HEIGHT);
var _local8 = (cols_ * com.midasplayer.game.bompbompdeluxe.Bomp.WIDTH) + 10;
var _local2 = 0;
while (_local2 < cols_) {
_local6.push(getBomp(_local3, _local2));
addBomp(_local3, _local2, _local5 + _local8, _local9, com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_COP);
_local7.push(getBomp(_local3, _local2));
_local5 = _local5 + com.midasplayer.game.bompbompdeluxe.Bomp.WIDTH;
_local2++;
}
_local3 = rows_ - 2;
while (_local3 < rows_) {
_local2 = 0;
while (_local2 < cols_) {
var _local4 = getBomp(_local3, _local2);
_local4.setFallHeight(0);
_local2++;
}
_local3++;
}
policeAnim_ = clip_.attachMovie("policeanim", "pa", clip_.getNextHighestDepth());
policeAnim_._x = 375;
policeAnim_._y = 250;
policeAnim_.gotoAndStop(1);
oldCopBomps_ = _local6;
_local10.push([{obj:this, func:policeInAnim}]);
_local10.push([{obj:this, func:newCopLineAnim, params:{oldbomps:_local6, newbomps:_local7}}]);
_local10.push({obj:this, func:removeOldBompsAnim});
com.midasplayer.util.AnimPlayer.play({playlist:_local10, callback:insertNewNotes, callback_scope:this, tps:50});
}
function policeInAnim(tick, alpha) {
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 100);
var _local3 = Math.floor(_local2 * 32) + 1;
policeAnim_.gotoAndStop(_local3);
return(_local2 == 1);
}
function policeOutAnim(tick, alpha) {
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 120);
var _local3 = Math.floor(_local2 * 47) + 33;
policeAnim_.gotoAndStop(_local3);
return(_local2 == 1);
}
function newCopLineAnim(tick, alpha, params) {
var _local6 = params.oldbomps;
var _local5 = params.newbomps;
var _local10 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 30);
var _local9 = com.midasplayer.util.AnimPlayer.tickToPercent((tick + alpha) - 40, 0, 30);
var _local7 = (10 + (cols_ * com.midasplayer.game.bompbompdeluxe.Bomp.WIDTH)) * _local10;
var _local2 = 0;
while (_local2 < _local6.length) {
var _local3 = _local6[_local2];
var _local4 = (_local3.getCol() * com.midasplayer.game.bompbompdeluxe.Bomp.WIDTH) + BOARD_X;
_local4 = _local4 - _local7;
_local3.setX(_local4);
_local2++;
}
var _local8 = (10 + (cols_ * com.midasplayer.game.bompbompdeluxe.Bomp.WIDTH)) * _local9;
_local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2];
var _local4 = ((10 + (_local3.getCol() * com.midasplayer.game.bompbompdeluxe.Bomp.WIDTH)) + BOARD_X) + (cols_ * com.midasplayer.game.bompbompdeluxe.Bomp.WIDTH);
_local4 = _local4 - _local8;
_local3.setX(_local4);
_local2++;
}
return(_local9 == 1);
}
function removeOldBompsAnim(tick, alpha) {
okToUpdateScene_ = true;
var _local7 = true;
var _local4 = 0;
while (_local4 < cols_) {
var _local5 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, _local4 * 5, 20);
if (_local5 < 1) {
_local7 = false;
}
var _local6 = easeInOutQuad(_local5, 0, com.midasplayer.game.bompbompdeluxe.Bomp.HEIGHT * 2, 1);
var _local2 = rows_ - 2;
while (_local2 < rows_) {
var _local3 = getBomp(_local2, (cols_ - _local4) - 1);
_local3.setY(_local3.getPreviousY() + _local6);
_local2++;
}
_local4++;
}
return(_local7);
}
function insertNewNotes() {
com.midasplayer.game.bompbompdeluxe.Game.nextRound();
var _local5 = 0;
while (_local5 < oldCopBomps_.length) {
var _local4 = oldCopBomps_[_local5];
_local4.remove(true);
_local5++;
}
var _local3 = rows_ - 2;
while (_local3 < rows_) {
var _local2 = 0;
while (_local2 < cols_) {
var _local4 = getBomp(_local3, _local2);
_local4.remove();
_local2++;
}
_local3++;
}
insertNotes();
var _local6 = new Array();
_local6.push({obj:this, func:policeOutAnim});
_local6.push({obj:this, func:showNotesAnim});
com.midasplayer.util.AnimPlayer.play({playlist:_local6, callback:endNewCopLine, callback_scope:this, tps:100});
}
function endNewCopLine() {
paused_ = false;
policeAnim_.removeMovieClip();
bompClickedEnd();
}
function getBomp(row, col) {
return(bomps_[row][col]);
}
function removeBomp(row, col) {
bomps_[row][col] = undefined;
}
function addResetValue(n) {
bombReset_.addValue(n);
copCount_ = copCount_ + n;
removedBompCount_ = removedBompCount_ + n;
}
function resetBombs() {
com.midasplayer.util.GameBase.reportPlayData(15, "", "0");
var _local3;
var _local4;
var _local5 = 0;
while (_local5 < rows_) {
var _local2 = 0;
while (_local2 <= cols_) {
_local3 = getBomp(_local5, _local2);
_local4 = _local3.getType();
if ((_local4 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_BOMB) || (_local4 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_BOMB_SELECTED)) {
_local3.resetBombCount();
}
_local2++;
}
_local5++;
}
}
function getNumRemovedBomps() {
return(removedBompCount_);
}
function showNotesAnim(tick, alpha) {
var _local6 = true;
var _local7 = rows_ - 1;
var _local2 = 0;
while (_local2 <= cols_) {
var _local3 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, _local2 * 10, 40);
if (_local3 < 1) {
_local6 = false;
}
if (noteMovedIn_[_local2] != true) {
var _local5 = easeInOutQuad(_local3, 0, (-com.midasplayer.game.bompbompdeluxe.Bomp.HEIGHT) * 2, 1);
var _local4 = getBomp(_local7, _local2);
_local4.setY(_local4.getPreviousY() + _local5);
if (_local3 == 1) {
noteMovedIn_[_local2] = true;
}
}
_local2++;
}
return(_local6);
}
function showBompsAnim(tick, alpha) {
bompLayer_._visible = true;
var _local7 = true;
var _local3 = 0;
while (_local3 <= cols_) {
var _local5 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, _local3 * 10, 40);
if (_local5 < 1) {
_local7 = false;
}
if (colMovedIn_[_local3] != true) {
var _local6 = easeInOutQuad(_local5, -400, 400, 1);
var _local2 = 0;
while (_local2 < (rows_ - 1)) {
var _local4 = getBomp(_local2, _local3);
_local4.setY(_local4.getPreviousY() + _local6);
_local2++;
}
if (_local5 == 1) {
colMovedIn_[_local3] = true;
}
}
_local3++;
}
return(_local7);
}
function removeBompsAnim(tick, alpha) {
var _local8 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 40);
var _local7 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 20, 40);
var _local3;
var _local6 = 0;
var _local5 = 0;
while (_local5 < rows_) {
var _local2 = 0;
while (_local2 <= cols_) {
if ((_local6 % 2) == 0) {
_local3 = _local8;
} else {
_local3 = _local7;
}
var _local4 = getBomp(_local5, _local2);
_local4.clip_._alpha = 100 - (_local3 * 100);
if (_local3 == 1) {
_local4.remove();
}
_local6++;
_local2++;
}
_local6++;
_local5++;
}
return((_local8 == 1) && (_local7 == 1));
}
function initTimer() {
timer_ = new com.midasplayer.timing.Timer(this, TPS);
clip_.timer = timer_;
clip_.onEnterFrame = function () {
this.timer.advanceTime();
};
}
function removeTimer() {
clip_.onEnterFrame = undefined;
delete timer_;
}
function remove() {
removeTimer();
}
function start(debugMode) {
started_ = true;
if (!debugMode) {
initTimer();
}
var _local3 = 0;
while (_local3 < rows_) {
var _local2 = 0;
while (_local2 <= cols_) {
var _local4 = getBomp(_local3, _local2);
_local4.setClickable(true);
_local2++;
}
_local3++;
}
}
function isStopped() {
return(stopped_);
}
function stop() {
Mouse.removeListener(this);
stopped_ = true;
}
function endGamePressed() {
endGamePressed_ = true;
if (!started_) {
gameOver();
}
}
function gameOver() {
stop();
stopDanceFloor();
_root.game.gameOver();
}
function isMovingBomps() {
return(!okToUpdateScene_);
}
function isHandelingClick() {
return(handleClick_);
}
function tick(tick) {
if (stopped_) {
return(undefined);
}
currentTick_ = tick;
var _local2 = tick / TPS;
if (paused_) {
pauseLength_ = pauseLength_ + ((tick - lastTick_) / 50);
}
_local2 = _local2 - pauseLength_;
com.midasplayer.game.bompbompdeluxe.Game.setTime(_local2);
if ((!handleClick_) && (endGamePressed_ || (_local2 > com.midasplayer.game.bompbompdeluxe.Game.getMaxTime()))) {
gameOver();
return(undefined);
}
if (partyModePlaying_) {
if ((!partyModeActive_) || (currentTick_ > (partyModeStartedAt_ + (TPS * 20)))) {
stopDanceFloor();
}
}
lastTick_ = tick;
}
function render(tick, alpha) {
}
static var TPS = 50;
static var BOARD_X = 323;
static var BOARD_Y = 74;
static var COP_ROW_LIMIT = 500;
var lastTick_ = 0;
var currentTick_ = 0;
var clickedBomp_ = null;
var removedBompCount_ = 0;
var copCount_ = 0;
var bombReset_ = null;
var reportedRow_ = 0;
var reportedCol_ = 0;
var reportedTick_ = 0;
var reportedScore_ = 0;
var okToUpdateScene_ = true;
var partyModeActive_ = false;
var partyModePlaying_ = false;
var partyModeStartedAt_ = 0;
var copsConverted_ = 0;
var danceFloorAnimId_ = 0;
var endGamePressed_ = false;
var paused_ = false;
var pauseLength_ = 0;
}
Symbol 652 MovieClip [__Packages.com.midasplayer.timing.Timer] Frame 0
class com.midasplayer.timing.Timer
{
var gameTicksPerSecond, timeable;
function Timer (timeable, gameTicksPerSecond) {
this.gameTicksPerSecond = gameTicksPerSecond;
millisPerGameTick = 1000 / gameTicksPerSecond;
this.timeable = timeable;
}
function setTps(gameTicksPerSecond) {
this.gameTicksPerSecond = gameTicksPerSecond;
millisPerGameTick = 1000 / gameTicksPerSecond;
}
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++;
if ((tick % gameTicksPerSecond) == 0) {
fps = frames;
frames = 0;
}
_local2++;
if (_local2 >= 10) {
unprocessedTime = 0;
}
}
var _local4 = unprocessedTime / millisPerGameTick;
timeable.render(tick, _local4);
frames++;
}
var time = 0;
var lastTime = 0;
var unprocessedTime = 0;
var tick = 0;
var millisPerGameTick = 0;
var fps = 0;
var frames = 0;
}
Symbol 653 MovieClip [__Packages.com.midasplayer.game.bompbompdeluxe.Bomp] Frame 0
class com.midasplayer.game.bompbompdeluxe.Bomp
{
var color_, type_, board_, layer_, effectsLayer_, clip_, diamondClip_, sparkClip_, explosionClip_, row_, col_, x_, y_, fallHeight_, previousY_, removeClipSequenceNum_, removeClipLength_, removeClipNumFrames_, removeClip_;
function Bomp (board, layer, color, type, effectsLayer) {
color_ = color;
type_ = type;
board_ = board;
layer_ = layer;
effectsLayer_ = effectsLayer;
var _local2 = layer.getNextHighestDepth();
clip_ = layer.attachMovie("bomp", "bomp" + _local2, _local2);
_local2++;
diamondClip_ = layer.attachMovie("diamond", "diamond" + _local2, _local2);
diamondClip_._visible = false;
if (type_ == TYPE_BOMB) {
_local2 = clip_.getNextHighestDepth();
sparkClip_ = clip_.attachMovie("spark", "spark" + _local2, _local2);
sparkClip_._x = -29.5;
sparkClip_._y = -29.5;
sparkClip_.gotoAndStop(1);
sparkle();
_local2 = layer.getNextHighestDepth();
explosionClip_ = layer.attachMovie("explosion", "explosion" + _local2, _local2);
explosionClip_.gotoAndStop(1);
explosionClip_._visible = false;
}
setSelected(false);
display();
}
function isMovable() {
if (type_ == TYPE_COP) {
return(false);
}
if (type_ == TYPE_DIAMOND) {
return(false);
}
if (type_ == TYPE_DIAMOND_SMALL) {
return(false);
}
return(true);
}
function remove(force) {
if (force) {
clip_.removeMovieClip();
diamondClip_.removeMovieClip();
removed_ = true;
return(undefined);
}
if (type_ == TYPE_COP) {
diamondClip_.removeMovieClip();
type_ = TYPE_DIAMOND;
display();
} else {
board_.removeBomp(row_, col_);
clip_.removeMovieClip();
diamondClip_.removeMovieClip();
removed_ = true;
}
}
function setSelected(b) {
if (b) {
if (type_ == TYPE_NORMAL) {
selected_ = true;
type_ = TYPE_NORMAL_SELECTED;
}
if (type_ == TYPE_STAR) {
selected_ = true;
type_ = TYPE_STAR_SELECTED;
}
if (type_ == TYPE_BOMB) {
selected_ = true;
type_ = TYPE_BOMB_SELECTED;
sparkClip_._y = -4.5;
}
clip_.filters = [new flash.filters.GlowFilter(GLOW_COLORS[color_], 80, 12, 12, 1, 1, false, false)];
} else {
if (selected_) {
selected_ = false;
if (type_ == TYPE_NORMAL_SELECTED) {
type_ = TYPE_NORMAL;
}
if (type_ == TYPE_STAR_SELECTED) {
type_ = TYPE_STAR;
}
if (type_ == TYPE_BOMB_SELECTED) {
type_ = TYPE_BOMB;
sparkClip_._y = -29.5;
}
}
clip_.filters = [];
}
display();
}
function getColor() {
return(color_);
}
function getType() {
return(type_);
}
function setType(type) {
type_ = type;
display();
}
function setPos(x, y) {
x_ = x;
y_ = y;
clip_._x = x_;
clip_._y = y_;
}
function setY(y) {
y_ = y;
clip_._y = y_;
}
function setX(x) {
x_ = x;
clip_._x = x_;
}
function getX() {
return(x_);
}
function getY() {
return(y_);
}
function setCol(col) {
col_ = col;
}
function setRow(row) {
row_ = row;
}
function getCol() {
return(col_);
}
function getRow() {
return(row_);
}
function setFallHeight(fallHeight) {
fallHeight_ = fallHeight;
previousY_ = clip_._y;
}
function getFallHeight() {
return(fallHeight_);
}
function getPreviousY() {
return(previousY_);
}
function adjacentTo(bomp) {
var _local3 = col_ - bomp.getCol();
var _local2 = row_ - bomp.getRow();
if ((_local3 == 0) && ((_local2 * _local2) == 1)) {
return(true);
}
if ((_local2 == 0) && ((_local3 * _local3) == 1)) {
return(true);
}
return(false);
}
function setClickable(t) {
if (type_ == TYPE_COP) {
t = false;
}
if (type_ == TYPE_NOTE1) {
t = false;
}
if (type_ == TYPE_NOTE2) {
t = false;
}
if (t) {
clip_.me = this;
clip_.onPress = function () {
this.me.onPress();
};
clip_.onDragOut = function () {
this.me.onDrag();
};
} else {
clip_.useHandCursor = false;
clip_.onPress = undefined;
clip_.onRelease = undefined;
clip_.onRollOver = undefined;
clip_.onDragOver = undefined;
clip_.onRollOut = undefined;
clip_.onDragOut = undefined;
}
}
function onPress() {
board_.bompClicked(this);
clip_.onDragOut = function () {
this.me.onDrag();
};
}
function onRelease() {
}
function onDrag() {
var _local5 = _root._xmouse - x_;
var _local4 = _root._ymouse - y_;
var _local8 = board_.getNumCols();
var _local7 = board_.getNumRows();
var _local6 = (_local5 * _local5) > (_local4 * _local4);
var _local3;
if (_local6 && (_local5 >= 10)) {
_local3 = board_.getBomp(row_, col_ + 1);
} else if (_local6 && (_local5 <= -10)) {
_local3 = board_.getBomp(row_, col_ - 1);
} else if (_local4 >= 10) {
_local3 = board_.getBomp(row_ + 1, col_);
} else if (_local4 <= -10) {
_local3 = board_.getBomp(row_ - 1, col_);
}
if (_local3.clip_.onPress != undefined) {
if (!selected_) {
board_.bompClicked(this);
}
_local3.clip_.onPress();
clip_.onDragOut = undefined;
} else {
onPress();
}
}
function markForColorCombo() {
markedForColorCombo_ = true;
}
function markForStarCombo() {
markedForStarCombo_ = true;
}
function isMarkedForStarCombo() {
return(markedForStarCombo_);
}
function isMarkedForColorCombo() {
return(markedForColorCombo_);
}
function makeReadyForUse() {
markedForStarCombo_ = false;
markedForColorCombo_ = false;
setFallHeight(0);
}
function isMarkedForCombo() {
return(isMarkedForStarCombo() || (isMarkedForColorCombo()));
}
function convertedFromCop() {
return(convertedFromCop_);
}
function setConvertedFromCop() {
convertedFromCop_ = true;
}
function removeAnim(tick, alpha) {
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, removeClipSequenceNum_ * 2, removeClipLength_);
if (_local2 > 0) {
var _local3 = 1 + Math.floor((removeClipNumFrames_ - 1) * _local2);
removeClip_.exp.gotoAndStop(_local3);
if (removeClip_._visible == false) {
removeClip_._visible = true;
}
}
return(_local2 == 1);
}
function removeAnimEnd() {
removeClip_._visible = false;
}
function blink(n, type) {
if (blinked_) {
return(undefined);
}
blinked_ = true;
var _local2 = effectsLayer_.getNextHighestDepth();
if (type == com.midasplayer.game.bompbompdeluxe.Combo.TYPE_DIAMOND) {
removeClip_ = effectsLayer_.attachMovie("exp3", "exp" + _local2, _local2);
removeClip_._visible = false;
removeClip_._x = x_;
removeClip_._y = y_;
removeClip_._rotation = random(360);
removeClip_.exp.gotoAndStop(1);
removeClipSequenceNum_ = n;
removeClipNumFrames_ = removeClip_.exp._totalframes;
removeClipLength_ = 20;
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:removeAnim}], callback:removeAnimEnd, callback_scope:this, tps:50});
return(undefined);
}
if (((type == com.midasplayer.game.bompbompdeluxe.Combo.TYPE_STAR) || (type == com.midasplayer.game.bompbompdeluxe.Combo.TYPE_STAR_BOMB)) && ((type_ == TYPE_STAR) || (type_ == TYPE_STAR_SELECTED))) {
removeClip_ = effectsLayer_.attachMovie("exp2", "exp" + _local2, _local2);
removeClip_._visible = false;
removeClip_._x = x_;
removeClip_._y = y_;
removeClip_.exp.gotoAndStop(1);
removeClipSequenceNum_ = n;
removeClipNumFrames_ = removeClip_.exp._totalframes;
removeClipLength_ = 36;
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:removeAnim}], callback:removeAnimEnd, callback_scope:this, tps:50});
return(undefined);
}
removeClip_ = effectsLayer_.attachMovie("exp1_" + COLOR_STRING[color_], "exp" + _local2, _local2);
removeClip_._visible = false;
removeClip_._x = x_;
removeClip_._y = y_;
removeClip_.exp.gotoAndStop(1);
removeClipSequenceNum_ = n;
removeClipNumFrames_ = removeClip_.exp._totalframes;
removeClipLength_ = 20;
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:removeAnim}], callback:removeAnimEnd, callback_scope:this, tps:50});
return(undefined);
}
function reduceDiamondCount(n) {
diamondCount_--;
display();
return(diamondCount_);
}
function resetBombCount() {
bombCount_ = 9;
display();
}
function reduceBombCount(n) {
if (bombCount_ == 10) {
bombCount_ = 9;
} else {
bombCount_ = bombCount_ - n;
bombCount_ = ((bombCount_ < 0) ? 0 : (bombCount_));
}
display();
if (bombCount_ > 0) {
shake();
}
if (bombCount_ == 0) {
explode();
}
return(bombCount_);
}
function sparkle() {
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:sparkleAnim}], callback:endSparkle, callback_scope:this, tps:25});
}
function sparkleAnim(tick, alpha) {
if (removed_ || (bombCount_ == 0)) {
return(true);
}
var _local2 = tick + 1;
if (_local2 > 18) {
_local2 = 18 + ((_local2 - 18) % 63);
}
sparkClip_.gotoAndStop(_local2);
return(false);
}
function endSparkle() {
}
function shake() {
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:shakeAnim}], callback:endShake, callback_scope:this, tps:20});
}
function shakeAnim(tick, alpha) {
var _local3 = random(4) - 2;
var _local2 = random(4) - 2;
var _local4 = false;
if (tick >= 15) {
_local3 = 0;
_local2 = 0;
_local4 = true;
}
clip_._x = x_ + _local3;
clip_._y = y_ + _local2;
return(_local4);
}
function endShake() {
}
function explode() {
com.midasplayer.fx.SoundManager.play("bomb_end.wav");
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:explodeAnim}], callback:endExplode, callback_scope:this, tps:50});
explosionClip_.gotoAndStop(1);
explosionClip_._xscale = 200;
explosionClip_._yscale = 200;
explosionClip_._x = x_ + 2;
explosionClip_._y = y_ + 2;
explosionClip_._visible = true;
clip_.removeMovieClip();
}
function explodeAnim(tick, alpha) {
var _local3 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 25);
var _local2 = Math.floor(_local3 * 8);
_local2 = Math.min(_local2, 8);
explosionClip_.gotoAndStop(_local2);
return(_local3 == 1);
}
function endExplode() {
explosionClip_.removeMovieClip();
}
function display() {
clip_._visible = true;
if ((type_ == TYPE_BOMB) || (type_ == TYPE_BOMB_SELECTED)) {
clip_.bombcount.gotoAndStop(bombCount_ + 1);
clip_.bombcount._visible = true;
} else if (type_ == TYPE_DIAMOND) {
if (diamondCount_ >= 3) {
clip_._xscale = 80;
clip_._yscale = 80;
} else if (diamondCount_ == 2) {
clip_._xscale = 60;
clip_._yscale = 60;
} else if (diamondCount_ == 1) {
clip_._xscale = 40;
clip_._yscale = 40;
}
} else if (type_ == TYPE_NOTE1) {
clip_._xscale = 80;
clip_._yscale = 80;
} else if (type_ == TYPE_NOTE2) {
clip_._xscale = 80;
clip_._yscale = 80;
} else {
clip_.bombcount._visible = false;
}
var _local2 = (1 + (color_ * 20)) + type_;
clip_.gotoAndStop(_local2);
}
static var WIDTH = 44;
static var HEIGHT = 44;
static var COLOR_BLUE = 0;
static var COLOR_GREEN = 1;
static var COLOR_ORANGE = 2;
static var COLOR_PURPLE = 3;
static var COLOR_RED = 4;
static var COLOR_BLACK = 5;
static var COLOR_CYAN = 6;
static var TYPE_NORMAL = 0;
static var TYPE_NORMAL_SELECTED = 7;
static var TYPE_BOMB = 1;
static var TYPE_BOMB_SELECTED = 9;
static var TYPE_STAR = 2;
static var TYPE_STAR_SELECTED = 8;
static var TYPE_COP = 3;
static var TYPE_DIAMOND_SMALL = 4;
static var TYPE_DIAMOND = 5;
static var TYPE_NOTE1 = 18;
static var TYPE_NOTE2 = 19;
static var COLOR_STRING = ["b", "g", "o", "p", "r", "w"];
static var GLOW_COLORS = ["0x5555F3", "0x00C51E", "0xFEE400", "0x9A00D7", "0xF30000", "0xFFFFFF"];
var markedForStarCombo_ = false;
var markedForColorCombo_ = false;
var bombCount_ = 10;
var diamondCount_ = 4;
var removed_ = false;
var selected_ = false;
var blinked_ = false;
var convertedFromCop_ = false;
}
Symbol 654 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) {
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 onEnterFrame() {
timers_.foreach(function (key, obj) {
com.midasplayer.timing.Timer(obj).advanceTime();
});
}
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 655 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 656 MovieClip [__Packages.com.midasplayer.game.bompbompdeluxe.Combo] Frame 0
class com.midasplayer.game.bompbompdeluxe.Combo
{
var board_, sequenceNumber_, type_, col1_, col2_, row1_, row2_, midx_, midy_, isHorizontal_, bomps_;
function Combo (board, sequenceNumber, type, startCol, startRow, endCol, endRow) {
board_ = board;
sequenceNumber_ = sequenceNumber;
type_ = type;
col1_ = startCol;
col2_ = endCol;
row1_ = startRow;
row2_ = endRow;
var _local2 = board_.getBomp(row1_, col1_);
var _local3 = board_.getBomp(row2_, col2_);
midx_ = _local2.getX() + ((_local3.getX() - _local2.getX()) / 2);
midy_ = _local2.getY() + ((_local3.getY() - _local2.getY()) / 2);
isHorizontal_ = row1_ == row2_;
bomps_ = new Array();
markBomps();
score_ = getScore();
}
function getType() {
return(type_);
}
function markBomps() {
if (type_ == TYPE_STAR) {
markStarCombo();
} else if (type_ == TYPE_STAR_BOMB) {
markStarBombCombo();
} else if (type_ == TYPE_DIAMOND) {
markDiamondCombo();
} else {
markColorCombo();
}
}
function playSound() {
if (type_ == TYPE_COLOR) {
var _local2 = Math.min(sequenceNumber_, 6);
com.midasplayer.fx.SoundManager.play(("kick_" + _local2) + ".wav", 100);
}
if (type_ == TYPE_STAR) {
com.midasplayer.fx.SoundManager.play("scratch" + (random(4) + 1), 100);
} else if (type_ == TYPE_STAR_BOMB) {
com.midasplayer.fx.SoundManager.play("scratch" + (random(4) + 1), 100);
} else if (type_ == TYPE_DIAMOND) {
com.midasplayer.fx.SoundManager.play("scratch" + (random(4) + 1), 100);
}
}
function removeBompsAnim(p) {
if (lastBlink_ == -1) {
new com.midasplayer.game.bompbompdeluxe.ScorePopup(score_, midx_, midy_);
playSound();
var _local2 = 0;
while (_local2 < bomps_.length) {
bomps_[_local2].blink(_local2, type_);
_local2++;
}
lastBlink_ = 1;
}
if (p == 1) {
removeBomps();
updateScore();
updateResetValue();
}
}
function removeBomps() {
var _local2 = 0;
while (_local2 < bomps_.length) {
bomps_[_local2].remove();
_local2++;
}
}
function updateScore() {
com.midasplayer.game.bompbompdeluxe.Game.addScore(score_);
}
function updateResetValue() {
board_.addResetValue(getResetValue());
}
function copConverted(bomp) {
if (!bomp.convertedFromCop()) {
bomp.setConvertedFromCop();
numCopsConverted_++;
board_.copConverted();
}
}
function markStarCombo() {
var _local2;
if (isHorizontal_) {
numStars_ = (1 + col2_) - col1_;
var _local3 = row1_ - 1;
while (_local3 <= (row1_ + 1)) {
var _local5 = col1_ - 1;
while (_local5 <= (col2_ + 1)) {
_local2 = board_.getBomp(_local3, _local5);
var _local4 = _local2.getType();
if (((_local2 != undefined) && (_local4 != com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE1)) && (_local4 != com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE2)) {
if (_local2.getType() == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_COP) {
copConverted(_local2);
}
_local2.markForStarCombo();
bomps_.push(_local2);
resetValue_++;
}
_local5++;
}
_local3++;
}
} else {
numStars_ = (1 + row2_) - row1_;
var _local5 = col1_ - 1;
while (_local5 <= (col1_ + 1)) {
var _local3 = row1_ - 1;
while (_local3 <= (row2_ + 1)) {
_local2 = board_.getBomp(_local3, _local5);
var _local4 = _local2.getType();
if (((_local2 != undefined) && (_local4 != com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE1)) && (_local4 != com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE2)) {
if (_local2.getType() == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_COP) {
copConverted(_local2);
}
_local2.markForStarCombo();
bomps_.push(_local2);
resetValue_++;
}
_local3++;
}
_local5++;
}
}
}
function markColorCombo() {
var _local2;
var _local4 = row1_;
while (_local4 <= row2_) {
var _local3 = col1_;
while (_local3 <= col2_) {
_local2 = board_.getBomp(_local4, _local3);
if (_local2 != undefined) {
if (_local2.getType() == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_STAR) {
numStars_++;
}
if (_local2.getType() == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_BOMB) {
numBombs_++;
}
_local2.markForColorCombo();
bomps_.push(_local2);
resetValue_++;
}
_local3++;
}
_local4++;
}
}
function markStarBombCombo() {
markColorCombo();
var _local2;
var _local6 = bomps_[0].getColor();
var _local5 = 0;
while (_local5 < board_.getNumRows()) {
var _local3 = 0;
while (_local3 < board_.getNumCols()) {
_local2 = board_.getBomp(_local5, _local3);
if (((_local2 != undefined) && (_local2.getColor() == _local6)) && (!_local2.isMarkedForCombo())) {
var _local4 = _local2.getType();
if ((_local4 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE1) || (_local4 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE2)) {
} else {
if (_local4 == com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_COP) {
copConverted(_local2);
}
_local2.markForColorCombo();
bomps_.push(_local2);
resetValue_++;
}
}
_local3++;
}
_local5++;
}
}
function markDiamondCombo() {
var _local2;
var _local5 = row2_;
while (_local5 >= row1_) {
var _local3 = col1_;
while (_local3 <= col2_) {
_local2 = board_.getBomp(_local5, _local3);
var _local4 = _local2.getType();
if (((_local2 != undefined) && (_local4 != com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE1)) && (_local4 != com.midasplayer.game.bompbompdeluxe.Bomp.TYPE_NOTE2)) {
_local2.markForColorCombo();
bomps_.push(_local2);
resetValue_++;
}
_local3++;
}
_local5--;
}
}
function getResetValue() {
return(resetValue_);
}
function getScore() {
var _local2 = 0;
var _local3 = bomps_.length;
var _local4 = Math.min(sequenceNumber_, 9);
var _local6 = (_local4 - 1) * 50;
if (type_ == TYPE_COLOR) {
_local2 = ((_local3 == 3) ? 50 : (_local2));
_local2 = ((_local3 == 4) ? 100 : (_local2));
_local2 = ((_local3 == 5) ? 150 : (_local2));
_local2 = ((_local3 == 6) ? 250 : (_local2));
_local2 = ((_local3 >= 7) ? 500 : (_local2));
_local2 = _local2 + (numBombs_ * 200);
var _local5 = Math.pow(2, numStars_);
_local2 = _local2 + _local6;
_local2 = _local2 * _local5;
} else if (type_ == TYPE_STAR_BOMB) {
_local2 = 1000;
} else if (type_ == TYPE_DIAMOND) {
_local2 = 1000;
} else if (type_ == TYPE_STAR) {
_local2 = 1500 + ((numStars_ - 3) * 500);
}
_local2 = _local2 + (numCopsConverted_ * 100);
if (board_.isPartyMode()) {
_local2 = _local2 + Math.floor(_local2 * 0.1);
}
return(_local2);
}
static var TYPE_STAR = 1;
static var TYPE_COLOR = 2;
static var TYPE_STAR_BOMB = 3;
static var TYPE_DIAMOND = 4;
var lastBlink_ = -1;
var score_ = 0;
var resetValue_ = 0;
var numStars_ = 0;
var numBombs_ = 0;
var numCopsConverted_ = 0;
}
Symbol 657 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 658 MovieClip [__Packages.com.midasplayer.game.bompbompdeluxe.ScorePopup] Frame 0
class com.midasplayer.game.bompbompdeluxe.ScorePopup
{
var clip_, y_;
function ScorePopup (score, x, y) {
y = y - 10;
var _local3 = _root.getNextHighestDepth();
clip_ = _root.attachMovie("scorepopup", "sp" + _local3, _local3);
clip_.score.autoSize = "left";
clip_.score.text = "" + score;
var _local5 = clip_.score._width;
clip_.bg._width = _local5 + 4;
clip_.bg._x = 0;
clip_._x = x - (_local5 / 2);
clip_._y = y;
y_ = y;
show();
}
function show() {
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:playAnim}], callback:endPlay, callback_scope:this, tps:50});
}
function playAnim(tick, alpha) {
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 35);
clip_._y = y_ - ((_local2 * _local2) * 20);
return(_local2 == 1);
}
function endPlay() {
clip_.removeMovieClip();
}
}
Symbol 659 MovieClip [__Packages.com.midasplayer.game.bompbompdeluxe.BombReset] Frame 0
class com.midasplayer.game.bompbompdeluxe.BombReset
{
var board_, layer_;
function BombReset (board) {
board_ = board;
layer_ = _root.createEmptyMovieClip("bombresetlayer", _root.getNextHighestDepth());
}
function addValue(n) {
if (!targetReached()) {
resetCount_ = resetCount_ + n;
if (targetReached()) {
activate();
} else {
render();
}
}
}
function render() {
var _local4 = resetTarget_;
var _local6 = Math.min(resetCount_, _local4);
var _local5 = _local6 / _local4;
var _local3 = Math.floor(16 * _local5);
if (_local3 == 0) {
_local3 = 1;
}
_root.bar.resetbox.scale.gotoAndStop(_local3);
}
function activate() {
render();
_root.bar.resetbox.gotoAndStop(16);
_root.bar.resetbox.btn.me = this;
_root.bar.resetbox.btn.onPress = function () {
this.me.reset();
};
}
function inactivate() {
resetCount_ = 0;
_root.bar.resetbox.gotoAndStop(1);
_root.bar.resetbox.btn.onPress = undefined;
render();
}
function targetReached() {
return(resetCount_ >= resetTarget_);
}
function reset() {
inactivate();
board_.resetBombs();
}
var resetTarget_ = 200;
var resetCount_ = 0;
}
Symbol 660 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_clips, m_stopped, m_once, m_lastTime;
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_clips = find(m_clip);
for (var _local2 in m_clips) {
m_frameCounts[m_clips[_local2]._name] = 0;
}
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] >= _local2._totalframes)) {
m_frameCounts[_local2._name] = _local2._totalframes - 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] % _local2._totalframes) + 1;
_local2.gotoAndStop(_local3);
_local7++;
}
if (_local5 == _local7) {
m_stopped = true;
}
}
}
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] >= _local2._totalframes)) {
m_frameCounts[_local2._name] = _local2._totalframes - 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] % _local2._totalframes) + 1;
_local2.gotoAndStop(_local3);
}
}
}
function isRunning() {
return(m_clip.onEnterFrame != undefined);
}
function playOnce(dir, fromFrame) {
if (fromFrame == undefined) {
fromFrame = 1;
}
if (dir == undefined) {
m_direction = 1;
} else {
m_direction = dir;
}
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;
_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 661 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 662 MovieClip [__Packages.com.midasplayer.game.bompbompdeluxe.Replay] Frame 0
class com.midasplayer.game.bompbompdeluxe.Replay
{
var board_, entries_, xml;
function Replay (board) {
board_ = board;
entries_ = new Array();
xml = new XML();
xml.ignoreWhite = true;
xml.onLoad = mx.utils.Delegate.create(this, xmlLoaded);
xml.load("playdata.xml");
}
function xmlLoaded(success) {
if (success) {
parse();
trace("num entries: " + entries_.length);
setInterval(this, "doReplay", 100);
}
}
function doReplay() {
if (board_.isHandelingClick()) {
return(undefined);
}
var _local2 = entriesIndex_;
entriesIndex_++;
if (_local2 >= entries_.length) {
trace("reached end");
return(undefined);
}
trace("entry: " + _local2);
if (entries_[_local2].code == "5") {
var _local4 = entries_[_local2].data[0];
var _local3 = entries_[_local2].data[1];
var _local5 = entries_[_local2].data[2];
board_.tick(_local4);
var _local6 = board_.getBomp(_local3, _local5);
_local6.onPress();
}
if (entries_[_local2].code == "15") {
trace("reset");
board_.resetBombs();
}
}
function parseEntry(xml) {
var _local2 = String(xml.firstChild);
_local2 = _local2.substring(0, _local2.indexOf("="));
var _local5 = _local2.split(",");
var _local3 = _local5[1].split(" ");
entries_.push({code:_local5[0], data:_local3});
}
function parse() {
var _local3 = xml.firstChild.firstChild.firstChild.childNodes;
var _local2 = 0;
while (_local2 < _local3.length) {
var _local4 = new String(_local3[_local2].nodeName);
if (_local4 == "entry") {
parseEntry(_local3[_local2]);
}
_local2++;
}
}
var entriesIndex_ = 0;
}