Frame 2
stop();
Frame 3
stop();
Frame 4
game.game_type = _root.game_type;
stop();
_root._quality = "MEDIUM";
Instance of Symbol 739 MovieClip [DiamondMineComponent] "game" in Frame 4
//component parameters
onClipEvent (initialize) {
use_quiz = "False";
quiz_data_file = "";
quiz_piece_probability = 0.2;
correct_points = 100;
incorrect_points = -20;
max_quiz_per_level = 3;
game_type = "Timer";
time_percent_change = 0.025;
level_percent_change_increase = 0.01;
collapse_percent_increase = 3;
level_collapse_percent_change = 0.5;
minimum_collapse_percent = 0.5;
num_rows = 8;
num_columns = 8;
piece_acceleration = 2;
stage_width = 640;
stage_height = 480;
points_per_piece = 10;
level_point_increase = 5;
}
Frame 5
stop();
_root._quality = "HIGH";
Instance of Symbol 818 MovieClip in Frame 5
//component parameters
onClipEvent (initialize) {
scr = "_root.score";
}
Frame 6
this.gotoAndPlay("Starting Screen");
Symbol 10 MovieClip [MathExtensions] Frame 1
#initclip 5
Math.randf = function (a, b) {
return((Math.random() * (b - a)) + a);
};
Math.randi = function (a, b) {
return(Math.floor(Math.random() * (b - a)) + Math.floor(a));
};
#endinitclip
Symbol 11 MovieClip [ArrayExtensions] Frame 1
#initclip 6
Array.prototype.swap = function (a, b) {
var t = this[a];
this[a] = this[b];
this[b] = t;
};
Array.prototype.swap2D = function (a, b, c, d) {
var temp = this[a][b];
this[a][b] = this[c][d];
this[c][d] = temp;
};
Array.prototype.shuffle = function () {
var len = this.length;
var j = 0;
while (j < len) {
this.swap(j, Math.randi(0, len));
j++;
}
};
Array.prototype.rande = function () {
return(this[Math.randi(0, this.length)]);
};
Array.prototype._push = function (e) {
if (e != undefined) {
this[this.length] = e;
}
};
Array.negated_intersection = function (A, B) {
var _array = new Array();
var a_length = A.length;
var b_length = B.length;
var j = 0;
while (j < a_length) {
var found = false;
var k = 0;
while (k < b_length) {
if (A[j] == B[k]) {
found = true;
}
k++;
}
if (!found) {
_array._push(A[j]);
}
j++;
}
var k = 0;
while (k < b_length) {
var found = false;
var j = 0;
while (j < a_length) {
if (B[k] == A[j]) {
found = true;
}
j++;
}
if (!found) {
_array._push(B[k]);
}
k++;
}
return(_array);
};
Array.prototype.remove_repeats = function () {
var _array = new Array();
var j = 0;
while (j < this.length) {
found = false;
var k = 0;
while (k < _array.length) {
if (typeof(this[j]) == "object") {
var equal = true;
for (var n in this[j]) {
if (this[j][n] != _array[k][n]) {
equal = false;
}
}
if (equal) {
found = true;
}
} else if (this[j] == _array[k]) {
found = true;
}
k++;
}
if (!found) {
_array._push(this[j]);
}
j++;
}
return(_array);
};
Array.getIndices = function (a, b) {
var indices = new Array();
var j = a;
while (j <= b) {
indices._push(j);
j++;
}
return(indices);
};
Array.prototype.return_copy = function () {
var _array = new Array();
var j = 0;
while (j < this.length) {
_array[j] = this[j];
j++;
}
return(_array);
};
#endinitclip
Symbol 12 MovieClip [MovieClipExtensions] Frame 1
#initclip 2
MovieClip.prototype.playing = false;
MovieClip.prototype.mouseOver = false;
MovieClip.prototype._currentlabel = "";
MovieClip.prototype._play = function () {
this.playing = true;
this.play();
};
MovieClip.prototype._stop = function () {
this.playing = false;
this.stop();
};
MovieClip.prototype._gotoAndPlay = function (frame) {
this.playing = true;
if (typeof(frame) == "string") {
this._currentlabel = frame;
}
this.gotoAndPlay(frame);
};
MovieClip.prototype._gotoAndStop = function (frame) {
this.playing = false;
if (typeof(frame) == "string") {
this._currentlabel = frame;
}
this.gotoAndStop(frame);
};
MovieClip.prototype.hasLabel = function (label) {
this.duplicateMovieClip("__TEMP__", 97324, {_x:-1, _y:-1, _visible:false, _width:1, _height:1});
new Sound(this._parent.__TEMP__).setVolume(0);
this._parent.__TEMP__.gotoAndStop(label);
var frame_i = this._parent.__TEMP__._currentframe;
this._parent.__TEMP__.nextFrame();
this._parent.__TEMP__.gotoAndStop(label);
var frame_f = this._parent.__TEMP__._currentframe;
var bool = (frame_i == frame_f);
this._parent.__TEMP__.removeMovieClip();
return(bool);
};
MovieClip.prototype.gotoAndPlayRandom = function () {
this._gotoAndPlay(Math.randi(1, this._totalframes + 1));
};
MovieClip.prototype.gotoAndStopRandom = function () {
this._gotoAndStop(Math.randi(1, this._totalframes + 1));
};
#endinitclip
Symbol 44 MovieClip Frame 1
this._stop();
Symbol 44 MovieClip Frame 22
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 44 MovieClip Frame 37
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 44 MovieClip Frame 50
this._parent._parent.unloadMovie();
Symbol 100 MovieClip Frame 1
this._stop();
Symbol 100 MovieClip Frame 23
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 100 MovieClip Frame 36
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 100 MovieClip Frame 49
this._parent._parent.unloadMovie();
Symbol 126 MovieClip Frame 1
this._stop();
Symbol 126 MovieClip Frame 23
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 126 MovieClip Frame 36
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 126 MovieClip Frame 49
this._parent._parent.unloadMovie();
Symbol 175 MovieClip Frame 1
this._stop();
Symbol 175 MovieClip Frame 23
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 175 MovieClip Frame 36
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 175 MovieClip Frame 50
this._parent._parent.unloadMovie();
Symbol 199 MovieClip Frame 1
this._stop();
Symbol 199 MovieClip Frame 25
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 199 MovieClip Frame 44
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 199 MovieClip Frame 58
this._parent._parent.unloadMovie();
Symbol 223 MovieClip Frame 1
this._stop();
Symbol 223 MovieClip Frame 28
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 223 MovieClip Frame 44
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 223 MovieClip Frame 58
this._parent._parent.unloadMovie();
Symbol 266 MovieClip Frame 1
this._stop();
Symbol 266 MovieClip Frame 30
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 266 MovieClip Frame 44
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 266 MovieClip Frame 57
this._parent._parent.unloadMovie();
Symbol 290 MovieClip Frame 1
this._stop();
Symbol 290 MovieClip Frame 23
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 290 MovieClip Frame 37
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 290 MovieClip Frame 51
this._parent._parent.unloadMovie();
Symbol 337 MovieClip Frame 1
this._stop();
Symbol 337 MovieClip Frame 23
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 337 MovieClip Frame 37
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 337 MovieClip Frame 51
this._parent._parent.unloadMovie();
Symbol 360 MovieClip Frame 1
this._stop();
Symbol 360 MovieClip Frame 23
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 360 MovieClip Frame 36
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 360 MovieClip Frame 49
this._parent._parent.unloadMovie();
Symbol 408 MovieClip Frame 1
this._stop();
Symbol 408 MovieClip Frame 23
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 408 MovieClip Frame 36
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 408 MovieClip Frame 50
this._parent._parent.unloadMovie();
Symbol 429 MovieClip Frame 1
this._stop();
Symbol 429 MovieClip Frame 25
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 429 MovieClip Frame 44
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 429 MovieClip Frame 58
this._parent._parent.unloadMovie();
Symbol 457 MovieClip Frame 1
this._stop();
Symbol 457 MovieClip Frame 28
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 457 MovieClip Frame 44
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 457 MovieClip Frame 58
this._parent._parent.unloadMovie();
Symbol 500 MovieClip Frame 1
this._stop();
Symbol 500 MovieClip Frame 30
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 500 MovieClip Frame 44
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 500 MovieClip Frame 57
this._parent._parent.unloadMovie();
Symbol 501 MovieClip [game_piece] Frame 1
this._stop();
Symbol 503 MovieClip Frame 1
stop();
Symbol 503 MovieClip Frame 62
this._gotoAndPlay(2);
Symbol 504 MovieClip [PieceComponent] Frame 1
#initclip 3
PieceClass = function () {
if (this._name != undefined) {
this.initialize();
}
};
PieceClass.prototype = new MovieClip();
Object.registerClass("PieceComponent", PieceClass);
PieceClass.prototype.initialize = function () {
this.initialize_variables();
this.initialize_graphics();
};
PieceClass.prototype.initialize_variables = function () {
this.velocity_x = 0;
this.velocity_y = 0;
this.acceleration_x = 0;
this.acceleration_y = 0;
this.onEnterFrame = this.fall_to_position;
this.useHandCursor = false;
};
PieceClass.prototype.initialize_graphics = function () {
this.pieces._gotoAndStop(this.type);
if (this.quiz) {
this.pieces._gotoAndStop(this.pieces._currentframe + (this.pieces._totalframes / 2));
}
};
PieceClass.prototype.rattle = function () {
this._x = this.final_position_x + Math.randf(-5, 5);
this._y = this.final_position_y + Math.randf(-5, 5);
};
PieceClass.prototype.fall_to_position = function () {
this.velocity_x = this.velocity_x + this.acceleration_x;
this.velocity_y = this.velocity_y + this.acceleration_y;
this._x = this._x + this.velocity_x;
this._y = this._y + this.velocity_y;
if (this._y > this.final_position_y) {
if (this.remove_piece) {
this.onEnterFrame = undefined;
var no_movement = true;
for (var j in this._parent) {
if (this._parent[j].onEnterFrame != undefined) {
no_movement = false;
}
}
if (no_movement && (this.regenerate)) {
this._parent._parent.initialize_initial_pieces();
} else if (no_movement && (this.game_over)) {
_root.gotoAndStop("Game Over");
} else if (no_movement) {
trace("NEXT LEVEL");
this._parent._parent.initialize_level();
}
this.unloadMovie();
} else {
this.velocity_y = 0;
this._y = this.final_position_y;
delete this.onEnterFrame;
this._parent._parent.check_all_stopped();
}
}
};
PieceClass.prototype.wait_to_fall = function () {
if ((this.current_frame++) >= this.num_wait_frames) {
this.onEnterFrame = this.fall_to_position;
}
};
PieceClass.prototype.onMouseDown = function () {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this._parent._parent.clicked_piece(this);
}
};
PieceClass.prototype.slide_new_position = function () {
this._x = this._x + ((this.final_position_x - this._x) / 4);
this._y = this._y + ((this.final_position_y - this._y) / 4);
if ((Math.abs(this._x - this.final_position_x) <= 1) && (Math.abs(this._y - this.final_position_y) <= 1)) {
this.callback();
}
};
PieceClass.prototype.onRollOver = function () {
if (this.pieces.sub._currentframe != 1) {
return(undefined);
}
if (this.pieces.sub._currentlabel != "Clicked Animation") {
this._parent._parent.last_clicked_time = getTimer();
this.pieces.sub.mouseOver = true;
this.pieces.sub._gotoAndPlay("Rollover Animation");
}
};
PieceClass.prototype.onRollOut = function () {
if (this.pieces.sub._currentlabel != "Clicked Animation") {
this.pieces.sub.mouseOver = false;
}
};
#endinitclip
Symbol 505 MovieClip [TextfieldExtensions] Frame 1
#initclip 1
TextField.prototype.scrollToNumber = function (goToNumber, speed) {
this.current_num = Number(this.text);
this.goToNumber = goToNumber;
if (this.scroller_interval != undefined) {
clearInterval(this.scroller_interval);
}
this.scroller_interval = setInterval(this.incrementNumber, speed, this);
};
Textfield.prototype.incrementNumber = function (_txt) {
if (Number(_txt.text) < Number(_txt.goToNumber)) {
_txt.text = Number(_txt.text) + 1;
} else {
_txt.text = Number(_txt.text) - 1;
}
if (Number(_txt.text) == Number(_txt.goToNumber)) {
clearInterval(_txt.scroller_interval);
_txt.scroller_interval = undefined;
}
};
#endinitclip
Symbol 506 MovieClip [ObjectExtensions] Frame 1
#initclip 4
Object.prototype.swap = function (a, b) {
var temp = this[a];
this[a] = this[b];
this[b] = temp;
};
#endinitclip
Symbol 509 MovieClip [points_animation] Frame 16
this.unloadMovie();
Symbol 516 MovieClip Frame 1
Stage.scaleMode = "noScale";
fscommand ("trapallkeys", true);
Stage.showMenu = false;
this.uu = _root._url;
var a = _root._url.split("/");
var i = 0;
while (i < a.length) {
if (a[i] == "files") {
_root.gid = a[i + 1];
}
i++;
}
if ((a[2] == "www.netstupidity.com") || (a[2] == "netstupidity.com")) {
_root.ligin = 1;
}
_root.__url = "http://www.netstupidity.com/games/hof/";
_root.loadVariables((_root.__url + "hof_bsc.php?id=") + _root.gid);
_root.prc = 0;
this.onEnterFrame = function () {
var ld = _root.getBytesLoaded();
var tt = _root.getBytesTotal();
var pr = ((100 * ld) / tt);
this.pasek._xscale = pr;
var b = Math.round(pr / 20);
if (pr >= 100) {
this.onEnterFrame = null;
this._parent.play();
}
};
Symbol 530 MovieClip Frame 140
stop();
Symbol 569 MovieClip Frame 1
this.t = getTimer();
this.tm = 0;
this.onEnterFrame = function () {
if (_root._framesloaded < 2) {
this.t = getTimer();
return(undefined);
}
this.tm = this.tm + (getTimer() - this.t);
var tt = Math.round(this.tm / 33);
if (tt < 1) {
this.stop();
} else {
this.t = getTimer();
if (tt >= 145) {
this.onEnterFrame = null;
this.gotoAndStop(145);
_root.play();
} else {
this.gotoAndStop(tt);
}
}
};
stop();
Symbol 572 MovieClip Frame 1
_root.stop();
stop();
Symbol 572 MovieClip Frame 2
stop();
Symbol 583 Button
on (release) {
this.play();
}
Symbol 591 MovieClip Frame 1
this._visible = _root.ligin == undefined;
this.onPress = function () {
getURL ("http://www.netstupidity.com");
};
Symbol 600 Button
on (press) {
this.gotoAndStop(1);
}
Symbol 604 Button
on (press) {
this.gotoAndStop(2);
}
Symbol 615 MovieClip Frame 1
this._stop();
Symbol 615 MovieClip Frame 2
this._stop();
Symbol 615 MovieClip Frame 3
this._stop();
Symbol 615 MovieClip Frame 4
this._stop();
Symbol 615 MovieClip Frame 5
this._stop();
Symbol 619 MovieClip Frame 1
this._visible = false;
Symbol 625 MovieClip Frame 1
stop();
Symbol 626 MovieClip Frame 1
stop();
Symbol 634 Button
on (press) {
_root.gotoAndStop("Starting Screen");
}
Symbol 639 Button
on (press) {
if (_parent.paused_prompt._currentframe != 1) {
return(undefined);
}
_parent.pause_game();
this.nextFrame();
}
Symbol 642 Button
on (press) {
if (_parent.paused_prompt._currentframe != 22) {
return(undefined);
}
_parent.unpause_game();
this.prevFrame();
}
Symbol 643 MovieClip Frame 1
stop();
Symbol 645 Button
on (press) {
nextFrame();
}
Symbol 647 Button
on (press) {
prevFrame();
}
Symbol 648 MovieClip Frame 1
stop();
delete this.onEnterFrame;
Symbol 648 MovieClip Frame 2
this.onEnterFrame = function () {
stopAllSounds();
};
Symbol 663 Button
on (press) {
_parent._parent.evaluate_answer(this);
}
Symbol 683 MovieClip Frame 1
stop();
Symbol 683 MovieClip Frame 22
stop();
_parent.fill_quiz_form();
Symbol 683 MovieClip Frame 59
this._gotoAndStop(1);
Symbol 683 MovieClip Frame 96
this._gotoAndStop(1);
Symbol 698 MovieClip Frame 60
this._gotoAndStop(1);
Symbol 712 MovieClip Frame 1
stop();
Symbol 712 MovieClip Frame 75
this._gotoAndStop(1);
Symbol 725 MovieClip Frame 1
stop();
Symbol 725 MovieClip Frame 22
stop();
Symbol 738 MovieClip Frame 1
stop();
Symbol 738 MovieClip Frame 120
this._gotoAndStop(1);
Symbol 739 MovieClip [DiamondMineComponent] Frame 1
#initclip 7
DiamondMine = function () {
if (this._name != undefined) {
this.initialize();
}
};
DiamondMine.prototype = new MovieClip();
Object.registerClass("DiamondMineComponent", DiamondMine);
DiamondMine.prototype.initialize = function () {
this.load_quiz_data();
this.initialize_variables();
this.initialize_graphics();
this.initialize_level();
};
DiamondMine.prototype.load_quiz_data = function () {
this.quiz_loader = new LoadVars();
this.quiz_loader.load(this.quiz_data_file);
this.quiz_loader.onLoad = function () {
this.loaded_successfully = arguments[0];
this.num_choices_per_question = Number(this.num_choices_per_question);
this.questions = new Array();
var j = 0;
while (j >= 0) {
if (this[("question" + j) + "_text"] == undefined) {
break;
}
this.questions[j] = new Object();
this.questions[j].text = this[("question" + j) + "_text"];
this.questions[j].answer = Number(this[("question" + j) + "_answer"]);
this.questions[j].choices = new Array();
var k = 0;
while (k < this.num_choices_per_question) {
this.questions[j].choices[k] = this[(("question" + j) + "_choice") + k];
k++;
}
j++;
}
this.current_question_list = this.questions.return_copy();
this.questions.shuffle();
this.current_question_list.shuffle();
};
};
DiamondMine.prototype.initialize_variables = function () {
this.depth = 0;
this.score = 0;
this.piece_width = this.piece_holder.play_area._width / this.num_columns;
this.piece_height = this.piece_holder.play_area._height / this.num_rows;
this.piece = new Array();
this.current_level = -1;
this.selected_piece0_mc = undefined;
this.selected_piece1_mc = undefined;
var _mc = this.attachMovie("PieceComponent", "__TEMP__", 123);
this.num_pieces = _mc.pieces._totalframes / 2;
_mc.unloadMovie();
this.paused = false;
this.level_questions_maxed = false;
this.num_asked_questions = 0;
};
DiamondMine.prototype.initialize_graphics = function () {
};
DiamondMine.prototype.initialize_level = function () {
this.current_level++;
this.time_percentage = 50;
this.level_prompt._play();
this.level_prompt.field = ("Level " + (this.current_level + 1)) + "!";
this.initialize_initial_pieces();
this.piece_holder.backgrounds._play();
this.level_questions_maxed = false;
this.num_asked_questions = 0;
this.paused = false;
};
DiamondMine.prototype.initialize_initial_pieces = function () {
var grid = this.calculate_solutionless_grid();
this.pieces = new Array();
var j = (this.num_rows - 1);
while (j >= 0) {
var k = 0;
while (k < this.num_columns) {
if (j == (this.num_rows - 1)) {
var prev_y = (((this.piece_holder.play_area._y - this.piece_holder.play_area._height) + (this.num_rows * this.piece_height)) - Math.randf(0, 50));
} else {
var prev_y = this.piece_holder[(("piece_" + (j + 1)) + "_") + k]._y;
}
var initial_position_x = (this.piece_holder.play_area._x + (k * this.piece_width));
var initial_position_y = ((prev_y - (this.piece_height * 2)) - Math.randf(50, 100));
var final_position_x = this.calculate_final_position(j, k).x;
var final_position_y = this.calculate_final_position(j, k).y;
this.create_piece(j, k, initial_position_x, initial_position_y, final_position_x, final_position_y, grid[j][k]);
k++;
}
j--;
}
};
DiamondMine.prototype.create_piece = function (index_j, index_k, initial_position_x, initial_position_y, final_position_x, final_position_y, type) {
if (((this.use_quiz == "True") && (this.quiz_loader.loaded_successfully)) && (!this.level_questions_maxed)) {
if (Math.random() <= this.quiz_piece_probability) {
var quiz = true;
} else {
var quiz = false;
}
}
var _mc = this.piece_holder.attachMovie("PieceComponent", (("piece_" + index_j) + "_") + index_k, this.depth++, {type:type, quiz:quiz});
_mc.index_j = index_j;
_mc.index_k = index_k;
_mc._width = this.piece_width;
_mc._height = this.piece_height;
_mc._x = initial_position_x;
_mc._y = initial_position_y;
_mc.final_position_x = final_position_x;
_mc.final_position_y = final_position_y;
_mc.acceleration_y = this.piece_acceleration;
};
DiamondMine.prototype.clicked_piece = function (piece_mc) {
if (this.paused) {
return(undefined);
}
if (this.check_for_movement()) {
return(undefined);
}
this.last_clicked_time = getTimer();
if (piece_mc.selector_mc._currentframe != 1) {
this.unselect_piece(piece_mc);
} else if (this.selected_piece0_mc != undefined) {
this.select_piece(piece_mc);
this.evaluate_player_selection();
this.play_sound("egg_move_sound");
} else {
this.select_piece(piece_mc);
}
};
DiamondMine.prototype.unselect_piece = function (piece_mc, custom_animation) {
piece_mc.selector_mc._gotoAndStop(1);
if (!custom_animation) {
piece_mc.pieces.sub._gotoAndStop("Default");
}
if (piece_mc == this.selected_piece0_mc) {
this.selected_piece0_mc = undefined;
}
if (piece_mc == this.selected_piece1_mc) {
this.selected_piece1_mc = undefined;
}
};
DiamondMine.prototype.select_piece = function (piece_mc) {
piece_mc.selector_mc._gotoAndPlay(2);
piece_mc.pieces.sub._gotoAndPlay("Clicked Animation");
if (this.selected_piece0_mc == undefined) {
this.selected_piece0_mc = piece_mc;
} else {
this.selected_piece1_mc = piece_mc;
piece_mc.selector_mc._gotoAndPlay(this.selected_piece0_mc.selector_mc._currentframe);
}
};
DiamondMine.prototype.evaluate_player_selection = function () {
if (this.adjacent_selections()) {
this.selected_adjacent_pieces();
} else {
this.selected_nonadjacent_pieces();
}
};
DiamondMine.prototype.adjacent_selections = function () {
return(((this.selected_piece0_mc.index_j == this.selected_piece1_mc.index_j) && (Math.abs(this.selected_piece0_mc.index_k - this.selected_piece1_mc.index_k) == 1)) || ((this.selected_piece0_mc.index_k == this.selected_piece1_mc.index_k) && (Math.abs(this.selected_piece0_mc.index_j - this.selected_piece1_mc.index_j) == 1)));
};
DiamondMine.prototype.selected_adjacent_pieces = function () {
this.swap_selected_pieces();
this.selected_piece0_mc.selector_mc._gotoAndStop(1);
this.selected_piece1_mc.selector_mc._gotoAndStop(1);
this.selected_piece0_mc.pieces.sub._gotoAndStop("Default");
this.selected_piece1_mc.pieces.sub._gotoAndStop("Default");
};
DiamondMine.prototype.swap_selected_pieces = function () {
this.swap_selected_indices();
this.swap_selected_instance_names();
this.selected_piece0_mc.onEnterFrame = this.selected_piece0_mc.slide_new_position;
this.selected_piece1_mc.onEnterFrame = this.selected_piece1_mc.slide_new_position;
this.selected_piece0_mc.callback = this.piece_sliding_done_before;
this.selected_piece1_mc.callback = undefined;
this.update_final_position(this.selected_piece0_mc);
this.update_final_position(this.selected_piece1_mc);
};
DiamondMine.prototype.swap_selected_pieces_back = function () {
this.swap_selected_pieces();
this.selected_piece0_mc.callback = this.piece_sliding_done_after;
this.selected_piece1_mc.callback = undefined;
var mc0 = this.selected_piece0_mc;
var mc1 = this.selected_piece1_mc;
if (this.selected_piece0_mc.pieces.sub.hasLabel("Wrong Move")) {
mc0.pieces.sub._gotoAndPlay("Wrong Move");
}
if (this.selected_piece1_mc.pieces.sub.hasLabel("Wrong Move")) {
mc1.pieces.sub._gotoAndPlay("Wrong Move");
}
this.unselect_piece(this.selected_piece0_mc, true);
this.unselect_piece(this.selected_piece1_mc, true);
};
DiamondMine.prototype.swap_selected_indices = function () {
var indices_j = {a:this.selected_piece0_mc.index_j, b:this.selected_piece1_mc.index_j};
var indices_k = {a:this.selected_piece0_mc.index_k, b:this.selected_piece1_mc.index_k};
indices_j.swap("a", "b");
indices_k.swap("a", "b");
this.selected_piece0_mc.index_j = indices_j.a;
this.selected_piece0_mc.index_k = indices_k.a;
this.selected_piece1_mc.index_j = indices_j.b;
this.selected_piece1_mc.index_k = indices_k.b;
};
DiamondMine.prototype.swap_selected_instance_names = function () {
var name0 = this.selected_piece0_mc._name;
var name1 = this.selected_piece1_mc._name;
this.selected_piece0_mc._name = "name0";
this.selected_piece1_mc._name = "name1";
this.selected_piece0_mc._name = name1;
this.selected_piece1_mc._name = name0;
};
DiamondMine.prototype.piece_sliding_done_before = function () {
this._parent._parent.evaluate_grid();
};
DiamondMine.prototype.piece_sliding_done_after = function () {
this._parent._parent.stop_all_movement();
};
DiamondMine.prototype.stop_all_movement = function () {
var j = 0;
while (j < this.num_rows) {
var k = 0;
while (k < this.num_columns) {
this.piece_holder[(("piece_" + j) + "_") + k].onEnterFrame = undefined;
k++;
}
j++;
}
};
DiamondMine.prototype.evaluate_grid = function () {
this.selected_piece0_mc.onEnterFrame = undefined;
this.selected_piece1_mc.onEnterFrame = undefined;
if (this.alreadyHasSolution()) {
this.handle_solutions();
} else {
if (arguments.length == 0) {
this.play_sound("egg_move_sound");
}
this.swap_selected_pieces_back();
}
this.selected_piece0_mc = undefined;
this.selected_piece1_mc = undefined;
};
DiamondMine.prototype.handle_solutions = function () {
var remove_list = this.calculate_remove_list();
this.update_score(remove_list);
this.play_remove_animations(remove_list);
this.shift_pieces_down(remove_list);
this.add_new_pieces(remove_list);
this.increase_time_percentage(remove_list.length);
this.play_sound(["clear_sound0", "clear_sound1", "clear_sound2"].rande());
};
DiamondMine.prototype.increase_time_percentage = function (num_collapsed_pieces) {
if (this.game_type == "Timer") {
this.time_percentage = this.time_percentage + (this.collapse_percent_increase + (this.level_collapse_percent_change * num_collapsed_pieces));
} else {
this.time_percentage = this.time_percentage + (this.collapse_percent_increase + Math.max((-this.level_collapse_percent_change) * num_collapsed_pieces, this.minimum_collapse_percent));
}
};
DiamondMine.prototype.calculate_remove_list = function () {
var remove_list = new Array();
var j = 0;
while (j < this.num_rows) {
var k = 0;
while (k < this.num_columns) {
var near = this.get_neighborhood(j, k);
if (((near.left.type == near.middle.type) && (near.middle.type == near.right.type)) && (near.left.type == near.right.type)) {
remove_list._push({j:near.left.index_j, k:near.left.index_k});
remove_list._push({j:near.middle.index_j, k:near.middle.index_k});
remove_list._push({j:near.right.index_j, k:near.right.index_k});
} else if (((near.top.type == near.middle.type) && (near.middle.type == near.bottom.type)) && (near.top.type == near.bottom.type)) {
remove_list._push({j:near.top.index_j, k:near.top.index_k});
remove_list._push({j:near.middle.index_j, k:near.middle.index_k});
remove_list._push({j:near.bottom.index_j, k:near.bottom.index_k});
}
k++;
}
j++;
}
return(remove_list.remove_repeats());
};
DiamondMine.prototype.play_remove_animations = function (remove_list) {
var quiz_piece = false;
var j = 0;
while (j < remove_list.length) {
var index_j = remove_list[j].j;
var index_k = remove_list[j].k;
var _mc = this.piece_holder[(("piece_" + index_j) + "_") + index_k];
_mc.IAMDEAD = true;
_mc._name = "__TEMP__" + Math.randi(0, 10000);
_mc.pieces.sub._gotoAndPlay("Remove Animation");
if (_mc.quiz) {
quiz_piece = true;
}
_mc._x = -1000;
_mc._y = -1000;
_mc._visible = false;
_mc.unloadMovie();
j++;
}
if (quiz_piece && (!this.level_questions_maxed)) {
this.create_quiz();
}
};
DiamondMine.prototype.create_quiz = function () {
if (this.new_board_prompt.playing) {
return(undefined);
}
if (this.quiz_prompt._currentframe != 1) {
return(undefined);
}
this.paused = true;
this.quiz_prompt._play();
this.quiz_prompt.swapDepths(this.depth + 5000);
this.num_asked_questions++;
if (this.num_asked_questions >= this.max_quiz_per_level) {
this.level_questions_maxed = true;
var j = 0;
while (j < this.num_rows) {
var k = 0;
while (k < this.num_columns) {
var _mc = this.piece_holder[(("piece_" + j) + "_") + k];
if (_mc.pieces._currentframe > this.num_pieces) {
_mc.pieces.gotoAndStop(_mc.pieces._currentframe - this.num_pieces);
}
k++;
}
j++;
}
}
};
DiamondMine.prototype.fill_quiz_form = function () {
if (this.quiz_loader.current_question_list.length == 0) {
this.quiz_loader.current_question_list = this.quiz_loader.questions.return_copy();
this.quiz_loader.current_question_list.shuffle();
}
var question = this.quiz_loader.current_question_list.pop();
this.quiz_prompt.question = question.text;
var j = 0;
while (j < this.quiz_loader.num_choices_per_question) {
var choice_mc = this.quiz_prompt["choice" + j];
choice_mc.choice = String.fromCharCode("A".charCodeAt(0) + j);
choice_mc.field = question.choices[j];
if (j == question.answer) {
choice_mc.correct = true;
}
j++;
}
};
DiamondMine.prototype.evaluate_answer = function (choice_mc) {
this.paused = false;
if (choice_mc.correct) {
this.correct_answer();
} else {
this.incorrect_answer();
}
};
DiamondMine.prototype.correct_answer = function () {
this.score = this.score + this.correct_points;
this.score_txt.scrollToNumber(Math.round(this.score), 10);
this.quiz_prompt._gotoAndPlay("Correct Answer");
};
DiamondMine.prototype.incorrect_answer = function () {
this.score = this.score + this.incorrect_points;
this.score_txt.scrollToNumber(Math.round(this.score), 10);
this.quiz_prompt._gotoAndPlay("Incorrect Answer");
};
DiamondMine.prototype.shift_pieces_down = function (remove_list) {
var shift_columns = this.get_shifted_columns(remove_list);
var k = 0;
while (k < shift_columns.length) {
var j = (this.num_rows - 2);
while (j >= 0) {
var _mc = this.piece_holder[(("piece_" + j) + "_") + shift_columns[k]];
if (_mc != undefined) {
var done = false;
while (!done) {
if ((this.piece_holder[(("piece_" + (_mc.index_j + 1)) + "_") + _mc.index_k] == undefined) && ((_mc.index_j + 1) < this.num_rows)) {
_mc.index_j++;
_mc._name = (("piece_" + _mc.index_j) + "_") + _mc.index_k;
_mc.final_position_x = this.calculate_final_position(_mc.index_j, _mc.index_k).x;
_mc.final_position_y = this.calculate_final_position(_mc.index_j, _mc.index_k).y;
_mc.onEnterFrame = _mc.fall_to_position;
} else {
done = true;
}
}
}
j--;
}
k++;
}
};
DiamondMine.prototype.get_shifted_columns = function (remove_list) {
var columns = new Array();
var j = 0;
while (j < remove_list.length) {
columns._push(remove_list[j].k);
j++;
}
return(columns.remove_repeats());
};
DiamondMine.prototype.get_minimum_rows = function (columns, remove_list) {
var min_rows = new Array();
var j = 0;
while (j < columns.length) {
var c = columns[j];
var minimum = Number.MAX_VALUE;
var n = 0;
while (n < remove_list.length) {
if (remove_list[n].k == c) {
if (remove_list[n].j <= minimum) {
minimum = remove_list[n].j;
}
}
n++;
}
min_rows[j] = minimum;
j++;
}
return(min_rows);
};
DiamondMine.prototype.get_num_column_pieces = function (shift_columns, remove_list) {
var num_pieces = new Array();
var j = 0;
while (j < shift_columns.length) {
num_pieces[j] = 0;
var k = 0;
while (k < remove_list.length) {
if (remove_list[k].k == shift_columns[j]) {
num_pieces[j]++;
}
k++;
}
j++;
}
return(num_pieces);
};
DiamondMine.prototype.shift_above_pieces = function (minimum_rows, shift_columns, num_columns_pieces) {
var k = 0;
while (k < shift_columns.length) {
var j = (minimum_rows[k] - 1);
while (j >= 0) {
var _mc = this.piece_holder[(("piece_" + j) + "_") + shift_columns[k]];
_mc.index_j = _mc.index_j + num_columns_pieces[k];
_mc._name = (("piece_" + _mc.index_j) + "_") + _mc.index_k;
_mc.final_position_x = this.calculate_final_position(_mc.index_j, _mc.index_k).x;
_mc.final_position_y = this.calculate_final_position(_mc.index_j, _mc.index_k).y;
_mc.onEnterFrame = _mc.fall_to_position;
j--;
}
k++;
}
};
DiamondMine.prototype.add_new_pieces = function (remove_list) {
var j = 0;
while (j < this.num_rows) {
var k = 0;
while (k < this.num_columns) {
var _mc = this.piece_holder[(("piece_" + j) + "_") + k];
if (_mc == undefined) {
var n = j;
while (n < this.num_rows) {
var piece_mc = this.piece_holder[(("piece_" + n) + "_") + k];
if (piece_mc != undefined) {
var bottom = n;
break;
}
n++;
}
var initial_position_x = (this.piece_holder.play_area._x + (k * this.piece_width));
var initial_position_y = (((-this.piece_height) * 0) - ((bottom - j) * this.piece_height));
var final_position_x = this.calculate_final_position(j, k).x;
var final_position_y = this.calculate_final_position(j, k).y;
this.create_piece(j, k, initial_position_x, initial_position_y, final_position_x, final_position_y, Math.randi(1, this.num_pieces + 1));
}
k++;
}
j++;
}
};
DiamondMine.prototype.selected_nonadjacent_pieces = function () {
this.unselect_piece(this.selected_piece0_mc);
this.unselect_piece(this.selected_piece1_mc);
};
DiamondMine.prototype.hasSolution = function () {
return(this.alreadyHasSolution());
};
DiamondMine.prototype.alreadyHasSolution = function () {
var j = 0;
while (j < this.num_rows) {
var k = 0;
while (k < this.num_columns) {
var near = this.get_neighborhood(j, k);
if ((((near.left.type == near.middle.type) && (near.middle.type == near.right.type)) && (near.left.type == near.right.type)) || (((near.top.type == near.middle.type) && (near.middle.type == near.bottom.type)) && (near.top.type == near.bottom.type))) {
return(true);
}
k++;
}
j++;
}
return(false);
};
DiamondMine.prototype.hasPossibleSolution = function () {
var grid = this.get_current_grid();
var j = 0;
while (j < this.num_rows) {
var k = 0;
while (k < this.num_columns) {
var neighbors = this.get_neighbors(j, k);
if (this.check_possible_swaps(grid, j, k, neighbors)) {
return(true);
}
k++;
}
j++;
}
return(false);
};
DiamondMine.prototype.get_neighbors = function (j, k) {
if ((j == 0) && (k == 0)) {
return([[j + 1, k], [j, k + 1]]);
}
if ((j == 0) && (k == (this.num_columns - 1))) {
return([[j + 1, k], [j, k - 1]]);
}
if ((j == (this.num_rows - 1)) && (k == 0)) {
return([[j - 1, k], [j, k + 1]]);
}
if ((j == (this.num_rows - 1)) && (k == (this.num_columns - 1))) {
return([[j - 1, k], [j, k - 1]]);
}
if (j == 0) {
return([[j, k - 1], [j, k + 1], [j + 1, k]]);
}
if (k == 0) {
return([[j - 1, k], [j + 1, k], [j, k + 1]]);
}
if (j == (this.num_rows - 1)) {
return([[j, k - 1], [j, k + 1], [j - 1, k]]);
}
if (k == (this.num_columns - 1)) {
return([[j - 1, k], [j + 1, k], [j, k - 1]]);
}
return([[j - 1, k], [j + 1, k], [j, k - 1], [j, k + 1]]);
};
DiamondMine.prototype.check_possible_swaps = function (grid, j, k, neighbors) {
var n = 0;
while (n < neighbors.length) {
grid.swap2D(j, k, neighbors[n][0], neighbors[n][1]);
if (this.gridHasNeighborhoodSolution(grid, j, k)) {
return(true);
}
if (this.gridHasNeighborhoodSolution(grid, j + 1, k)) {
return(true);
}
if (this.gridHasNeighborhoodSolution(grid, j - 1, k)) {
return(true);
}
if (this.gridHasNeighborhoodSolution(grid, j, k + 1)) {
return(true);
}
if (this.gridHasNeighborhoodSolution(grid, j, k - 1)) {
return(true);
}
grid.swap2D(j, k, neighbors[n][0], neighbors[n][1]);
n++;
}
return(false);
};
DiamondMine.prototype.get_current_grid = function () {
var grid = new Array();
var j = 0;
while (j < this.num_rows) {
grid[j] = new Array();
var k = 0;
while (k < this.num_columns) {
grid[j][k] = this.piece_holder[(("piece_" + j) + "_") + k].type;
k++;
}
j++;
}
return(grid);
};
DiamondMine.prototype.gridHasSolution = function (grid) {
var j = 0;
while (j < this.num_rows) {
var k = 0;
while (k < this.num_columns) {
var near = new Object();
near.left = grid[j][k - 1];
near.right = grid[j][k + 1];
near.top = grid[j - 1][k];
near.bottom = grid[j + 1][k];
near.middle = grid[j][k];
if ((((near.left == near.middle) && (near.middle == near.right)) && (near.left == near.right)) || (((near.top == near.middle) && (near.middle == near.bottom)) && (near.top == near.bottom))) {
return(true);
}
k++;
}
j++;
}
return(false);
};
DiamondMine.prototype.gridHasNeighborhoodSolution = function (grid, j, k) {
if (grid[j][k] == undefined) {
return(false);
}
var near = new Object();
near.left = grid[j][k - 1];
near.right = grid[j][k + 1];
near.top = grid[j - 1][k];
near.bottom = grid[j + 1][k];
near.middle = grid[j][k];
if ((((near.left == near.middle) && (near.middle == near.right)) && (near.left == near.right)) || (((near.top == near.middle) && (near.middle == near.bottom)) && (near.top == near.bottom))) {
return(true);
}
return(false);
};
DiamondMine.prototype.update_final_position = function (piece_mc) {
var position = this.calculate_final_position(piece_mc.index_j, piece_mc.index_k);
piece_mc.final_position_x = position.x;
piece_mc.final_position_y = position.y;
};
DiamondMine.prototype.calculate_final_position = function (j, k) {
var coordinate = {};
coordinate.x = this.piece_holder.play_area._x + (k * this.piece_width);
coordinate.y = this.piece_holder.play_area._y + (j * this.piece_height);
return(coordinate);
};
DiamondMine.prototype.calculate_solutionless_grid = function () {
var grid = new Array();
var j = 0;
while (j < this.num_rows) {
grid[j] = new Array();
var k = 0;
while (k < this.num_columns) {
var left = grid[j][k - 1];
var right = grid[j][k + 1];
var top = grid[j - 1][k];
var bottom = grid[j + 1][k];
var possibilities = Array.getIndices(1, this.num_pieces);
var non_possibilities = [left, right, top, bottom];
var different_pieces = Array.negated_intersection(possibilities, non_possibilities);
grid[j][k] = different_pieces.rande();
k++;
}
j++;
}
return(grid);
};
DiamondMine.prototype.get_neighborhood = function (j, k) {
var neighborhood = new Array();
neighborhood.middle = this.piece_holder[(("piece_" + j) + "_") + k];
neighborhood.left = this.piece_holder[(("piece_" + j) + "_") + (k - 1)];
neighborhood.right = this.piece_holder[(("piece_" + j) + "_") + (k + 1)];
neighborhood.top = this.piece_holder[(("piece_" + (j - 1)) + "_") + k];
neighborhood.bottom = this.piece_holder[(("piece_" + (j + 1)) + "_") + k];
return(neighborhood);
};
DiamondMine.prototype.check_for_movement = function () {
var j = 0;
while (j < this.num_rows) {
var k = 0;
while (k < this.num_columns) {
var _mc = this.piece_holder[(("piece_" + j) + "_") + k];
if (_mc.onEnterFrame != undefined) {
return(true);
}
k++;
}
j++;
}
return(false);
};
DiamondMine.prototype.check_all_stopped = function () {
if (!this.check_for_movement()) {
this.evaluate_grid(0);
var bool = this.hasPossibleSolution();
if (!bool) {
if (this.game_type == "Timer") {
this.new_board();
} else {
this.game_over();
}
}
}
};
DiamondMine.prototype.game_over = function () {
var j = 0;
while (j < this.num_rows) {
var k = 0;
while (k < this.num_columns) {
this.piece_holder[(("piece_" + j) + "_") + k].game_over = true;
k++;
}
j++;
}
this.explode_pieces();
this.game_over_prompt._play();
};
DiamondMine.prototype.onEnterFrame = function () {
if (((getTimer() - this.last_clicked_time) > 3000) && (!this.check_for_movement())) {
this.last_clicked_time = getTimer();
var grid = this.get_current_grid();
var j = 0;
while (j < this.num_rows) {
var k = 0;
while (k < this.num_columns) {
var neighbors = this.get_neighbors(j, k);
if (this.check_possible_swaps(grid, j, k, neighbors)) {
var _mc = this.piece_holder[(("piece_" + j) + "_") + k];
_mc.onRollOver();
_mc.onRollOut();
return(undefined);
}
k++;
}
j++;
}
}
this.update_game_timer();
this.update_game_properties();
};
DiamondMine.prototype.update_game_timer = function () {
if ((this.game_type == "Timer") && (!this.paused)) {
this.time_percentage = this.time_percentage - (this.time_percent_change + (this.level_percent_change_increase * this.current_level));
}
this.render_game_timer();
};
DiamondMine.prototype.render_game_timer = function () {
var goToX = ((this.time_percentage / 100) * this.timer_mc.frame_mc._width);
this.timer_mc.bar_mc._x = this.timer_mc.bar_mc._x + ((goToX - this.timer_mc.bar_mc._x) / 10);
this.timer_mc.bar_mc._gotoAndStop(Math.round((this.time_percentage / 100) * this.timer_mc.bar_mc._totalframes) + 1);
if (this.time_percentage >= 100) {
this.next_level();
} else if (this.time_percentage <= 0) {
_root._gotoAndStop("Game Over");
}
};
DiamondMine.prototype.next_level = function () {
for (var j in this.piece_holder) {
var _mc = this.piece_holder[j];
if (typeof(_mc) == "movieclip") {
if ((_mc._name != "backgrounds") && (_mc._name != "play_area")) {
_mc.unloadMovie();
}
}
}
this.paused = true;
this.explode_pieces();
this.time_percentage = 50;
};
DiamondMine.prototype.explode_pieces = function () {
var j = 0;
while (j < this.num_rows) {
var k = 0;
while (k < this.num_columns) {
var _mc = this.piece_holder[(("piece_" + j) + "_") + k];
_mc.velocity_x = Math.randf(-10, 10);
_mc.velocity_y = Math.randf(-30, -20);
_mc.final_position_y = (this.piece_holder.play_area._y + this.piece_holder.play_area._height) + _mc._height;
_mc._y = _mc.final_position_y + 100;
_mc.remove_piece = true;
_mc.num_wait_frames = Math.randi(0, 50);
_mc.current_frame = 0;
_mc.swapDepths(this.depth++);
_mc._name = "__TEMP__" + Math.randi(0, 10000);
_mc.onEnterFrame = _mc.wait_to_fall;
k++;
}
j++;
}
};
DiamondMine.prototype.update_score = function (remove_list) {
var score_increase = (remove_list.length * (this.points_per_piece + (this.level_point_increase * this.current_level)));
this.score = this.score + score_increase;
this.score_txt.scrollToNumber(Math.round(this.score), 10);
this.depth++;
var _mc = this.attachMovie("points_animation", "points" + this.depth, this.depth);
var p = remove_list.rande();
_mc._x = this.piece_holder[(("piece_" + p.j) + "_") + p.k]._x;
_mc._y = this.piece_holder[(("piece_" + p.j) + "_") + p.k]._y;
_mc.points = "+" + score_increase;
};
DiamondMine.prototype.update_game_properties = function () {
_root.score = this.score;
};
DiamondMine.prototype.new_board = function () {
var j = 0;
while (j < this.num_rows) {
var k = 0;
while (k < this.num_columns) {
this.piece_holder[(("piece_" + j) + "_") + k].regenerate = true;
k++;
}
j++;
}
this.explode_pieces();
for (var j in this.piece_holder) {
var _mc = this.piece_holder[j];
if (typeof(_mc) == "movieclip") {
if (((!_mc.regenerate) && (_mc._name != "backgrounds")) && (_mc._name != "play_area")) {
_mc.unloadMovie();
}
}
}
this.new_board_prompt._play();
};
DiamondMine.prototype.pause_game = function () {
this.paused = true;
this.paused_prompt.play();
};
DiamondMine.prototype.unpause_game = function () {
this.paused = false;
this.paused_prompt.play();
};
DiamondMine.prototype.play_sound = function (linkage) {
var _sound = new Sound(this);
_sound.attachSound(linkage);
_sound.start(0, 1);
};
DiamondMine.prototype.onMouseDown = function () {
for (var j in this.piece_holder) {
var _mc = this.piece_holder[j];
if ((_mc.hitTest(_root._xmouse, _root._ymouse, true) && (_mc._name != "backgrounds")) && (_mc._name != "play_area")) {
trace((j + " , ") + _mc);
}
}
};
#endinitclip
this._x = 0;
this._y = 0;
Instance of Symbol 620 MovieClip "piece_holder" in Symbol 739 MovieClip [DiamondMineComponent] Frame 1
onClipEvent (keyDown) {
if (Key.isDown(16)) {
trace(_parent.hasPossibleSolution());
} else if (Key.isDown(32)) {
for (var j in this) {
if (typeof(this[j]) == "movieclip") {
trace(this[j]);
}
}
}
}
Symbol 744 Button
on (press) {
this.gotoAndPlay("Starting Screen");
}
Symbol 759 Button
on (press) {
this.gotoAndStop("weekly");
}
Symbol 760 Button
on (press) {
this.gotoAndStop("daily");
}
Symbol 761 Button
on (press) {
this.gotoAndStop("hourly");
}
Symbol 764 Button
on (press) {
this.gotoAndStop("monthly");
}
Symbol 769 Button
on (press) {
this.gotoAndStop("daily");
}
Symbol 772 MovieClip Frame 1
this._parent.tp = 2592000 /* 0x278D00 */;
this._parent.tc = 0;
this._parent.reload();
stop();
Symbol 772 MovieClip Frame 2
this._parent.tp = 604800 /* 0x093A80 */;
this._parent.tc = 0;
this._parent.reload();
Symbol 772 MovieClip Frame 3
this._parent.tp = 86400 /* 0x015180 */;
this._parent.tc = 0;
this._parent.reload();
Symbol 772 MovieClip Frame 4
this._parent.tp = 3600;
this._parent.tc = 0;
this._parent.reload();
Symbol 779 Button
on (press) {
this.tc--;
this.reload();
}
Symbol 784 Button
on (press) {
this.tc = ((this.tc < 0) ? (this.tc + 1) : 0);
this.reload();
}
Symbol 787 Button
on (press) {
if (this.submitted == false) {
this.loadVariables((((this.__url + "hof_put.php?id=") + this.gid) + "&s=") + this.sc);
}
}
Symbol 791 Button
on (press) {
this._parent.l = 10;
this._parent.reload();
this.gotoAndStop(2);
}
Symbol 794 Button
on (press) {
this._parent.l = 100;
this._parent.reload();
this.gotoAndStop(1);
}
Symbol 795 MovieClip Frame 1
stop();
Symbol 808 MovieClip Frame 1
stop();
Symbol 808 MovieClip Frame 18
stop();
Symbol 812 MovieClip Frame 1
function reset() {
this.m._x = this.s._x;
this.m._y = this.s._y;
}
function scroll(p) {
this._parent.rolki.f1.scroll = (this._parent.rolki.f2.scroll = (this._parent.rolki.f3.scroll = (this._parent.rolki.f4.scroll = int((this.mx * p) / 100))));
}
this.onEnterFrame = function () {
this.s._y = ((this.m._y > 5) ? (((this.m._y < 202) ? (this.m._y) : 202)) : 5);
this.mx = this._parent.rolki.f1.maxscroll;
scroll((100 * (this.s._y - 5)) / 197);
};
Instance of Symbol 811 MovieClip "m" in Symbol 812 MovieClip Frame 1
on (press) {
this.startDrag();
}
on (release, releaseOutside) {
this.stopDrag();
this._parent.reset();
}
Symbol 817 MovieClip Frame 1
this._visible = _root.ligin == undefined;
this.onPress = function () {
getURL ("http://www.netstupidity.com");
};
Symbol 818 MovieClip Frame 1
this.submitted = false;
Symbol 818 MovieClip Frame 2
function reload() {
if (this.rolki._currentframe > 1) {
this.rolki.gotoAndPlay(18);
}
var te = ((-this.tc) * this.tp);
var tb = ((-(this.tc - 1)) * this.tp);
this.loadVariables((((((((((this.__url + "hof_get.php?id=") + this.gid) + "&n=") + this.l) + "&tb=") + tb) + "&te=") + te) + "&s=") + this.sc);
}
this.uu = _root._url;
this.gid = _root.gid;
this.__url = _root.__url;
this.l = 10;
this.sc = eval (this.scr);
if (int(this.sc) > int(_root.bsc)) {
_root.bsc = this.sc;
}
this.onData = function () {
if (this.r == 1) {
this.rolki.gotoAndPlay(2);
clearInterval(this._itr);
return(undefined);
}
if (this.r == "3") {
this.submitted = true;
reload();
}
if (this.r == "2") {
getURL ("javascript:if(confirm('To submit Your score You have to be logged into netstupidity.com site. Do You wish to log in now?')) window.open('http://www.netstupidity.com/login.php'); void(0);");
}
};
stop();