Section 1
//animatedTitle_9 (Stochastic_fla.animatedTitle_9)
package Stochastic_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
public dynamic class animatedTitle_9 extends MovieClip {
public var loop1:Sound;
public var bla:MovieClip;
public var musicChan2:SoundChannel;
public function animatedTitle_9(){
addFrameScript(0, frame1, 399, frame400);
}
public function moo(_arg1):void{
var _local2:*;
_local2 = Math.round((musicChan2.position / 24.5));
gotoAndStop((_local2 + 2));
}
function frame1(){
loop1 = new MenuLoop();
musicChan2 = loop1.play(0, 0);
this.addEventListener(Event.ENTER_FRAME, moo);
}
function frame400(){
musicChan2.stop();
this.addEventListener(Event.ENTER_FRAME, moo);
this.gotoAndPlay(1);
}
}
}//package Stochastic_fla
Section 2
//blockColored_8 (Stochastic_fla.blockColored_8)
package Stochastic_fla {
import flash.display.*;
public dynamic class blockColored_8 extends MovieClip {
public function blockColored_8(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Stochastic_fla
Section 3
//help_12 (Stochastic_fla.help_12)
package Stochastic_fla {
import flash.events.*;
import flash.display.*;
public dynamic class help_12 extends MovieClip {
public var page:int;
public var forward:SimpleButton;
public var back:SimpleButton;
public var a1:MovieClip;
public function help_12(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7);
}
public function b1(_arg1):void{
if (page == 2){
gotoAndStop(7);
page = 7;
} else {
prevFrame();
page--;
};
}
function frame3(){
back.addEventListener(MouseEvent.CLICK, b1);
forward.addEventListener(MouseEvent.CLICK, f1);
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
page = 2;
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame2(){
forward.addEventListener(MouseEvent.CLICK, f1);
stop();
}
public function f1(_arg1):void{
if (page == 7){
gotoAndStop(2);
page = 2;
} else {
nextFrame();
page++;
};
}
}
}//package Stochastic_fla
Section 4
//ins02_13 (Stochastic_fla.ins02_13)
package Stochastic_fla {
import flash.display.*;
public dynamic class ins02_13 extends MovieClip {
public function ins02_13(){
addFrameScript(399, frame400);
}
function frame400(){
stop();
}
}
}//package Stochastic_fla
Section 5
//ins03_16 (Stochastic_fla.ins03_16)
package Stochastic_fla {
import flash.display.*;
public dynamic class ins03_16 extends MovieClip {
public function ins03_16(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Stochastic_fla
Section 6
//ins04_18 (Stochastic_fla.ins04_18)
package Stochastic_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
public dynamic class ins04_18 extends MovieClip {
public var s1:Sound;
public var s2:Sound;
public var airShow:int;
public var show1:TextField;
public function ins04_18(){
addFrameScript(0, frame1, 39, frame40, 99, frame100, 199, frame200);
}
function frame200(){
this.removeEventListener(Event.ENTER_FRAME, burrow);
stop();
}
function frame1(){
airShow = 120;
show1.text = "120";
}
function frame100(){
this.removeEventListener(Event.ENTER_FRAME, rise);
this.addEventListener(Event.ENTER_FRAME, burrow);
s2 = new Splish();
s2.play(0, 0);
}
public function burrow(_arg1):void{
if (airShow < 120){
airShow = (airShow + 1);
show1.text = airShow.toString(10);
};
}
function frame40(){
this.addEventListener(Event.ENTER_FRAME, rise);
s1 = new Splash();
s1.play(0, 0);
}
public function rise(_arg1):void{
airShow = (airShow - 1);
show1.text = airShow.toString(10);
}
}
}//package Stochastic_fla
Section 7
//ins06_19 (Stochastic_fla.ins06_19)
package Stochastic_fla {
import flash.media.*;
import flash.display.*;
public dynamic class ins06_19 extends MovieClip {
public var tp1:Sound;
public function ins06_19(){
addFrameScript(0, frame1, 34, frame35, 105, frame106, 169, frame170);
}
function frame170(){
stop();
}
function frame1(){
tp1 = new teleSound();
}
function frame106(){
tp1.play(0, 0);
}
function frame35(){
tp1.play(0, 0);
}
}
}//package Stochastic_fla
Section 8
//ins07_20 (Stochastic_fla.ins07_20)
package Stochastic_fla {
import flash.display.*;
public dynamic class ins07_20 extends MovieClip {
public function ins07_20(){
addFrameScript(130, frame131);
}
function frame131(){
stop();
}
}
}//package Stochastic_fla
Section 9
//MainTimeline (Stochastic_fla.MainTimeline)
package Stochastic_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public const minimumDelay = 200;
public const p1UP = 38;
public const initialTeleport = 1;
public const bonusRepeat = 4100;
public const initialDelay = 1000;
public const p1I = 4;
public const p1J = 4;
public const alphaChange = 0.1;
public const p1RIGHT = 39;
public const powerupConst = 5000;
public const delayDecrease = 4;
public const riseRate = 300;
public const p1LEFT = 37;
public const maxAir = 120;
public const maxCrates = 200;
public const p1DOWN = 40;
public var waterSource:MovieClip;
public var water_timer:Timer;
public var music:Sound;
public var bonus:MovieClip;
public var bytesloaded;
public var containerArray:Array;
public var start:SimpleButton;
public var tp:MovieClip;
public var score:TextField;
public var waterIn:Sound;
public var teleportCount:int;
public var transOn:int;
public var winSound:Sound;
public var waterLevel:int;
public var waterOut:Sound;
public var powerupMulti:int;
public var special:Sound;
public var specialBonus:int;
public var powerupSnd:Sound;
public var crates:TextField;
public var msgs:MovieClip;
public var block_timer:Timer;
public var water:Water;
public var bonusUp:Boolean;
public var char_timer:Timer;
public var bonus_timer:Timer;
public var musicChan:SoundChannel;
public var teleport:TextField;
public var underwater:Boolean;
public var bla:MovieClip;
public var air:TextField;
public var color:MovieClip;
public var traceChange:int;
public var waterStarted:Boolean;
public var Help:MovieClip;
public var start_timer:Timer;
public var player1:MovieClip;
public var waterArray:Array;
public var heightArray:Array;
public var dont:Boolean;
public var showScore:Show;
public var warning:MovieClip;
public var animated:MovieClip;
public var scoreNum:int;
public var titleText:Sprite;
public var bytestotal;
public var bonusWave:Sound;
public var takenArray:Array;
public var airCount:int;
public var cratesCount:int;
public var ins:SimpleButton;
public var tpSound:Sound;
public var keys:SimpleButton;
public var flood:MovieClip;
public function MainTimeline(){
addFrameScript(19, frame20, 259, frame260, 260, frame261, 261, frame262);
}
public function giveScore(_arg1:int):void{
scoreNum = (scoreNum + _arg1);
}
public function teleportPlayer():void{
var _local1:int;
var _local2:int;
var _local3:Array;
var _local4:int;
var _local5:MovieClip;
var _local6:MovieClip;
var _local7:*;
var _local8:*;
var _local9:int;
var _local10:int;
teleportCount = (teleportCount - 1);
teleport.text = teleportCount.toString(10);
_local3 = new Array();
_local4 = 0;
while (_local4 < 8) {
_local9 = 0;
while (_local9 < 8) {
if (((((!((player1.i == _local4))) || (!((player1.j == _local9))))) && ((heightArray[_local4][_local9] >= waterLevel)))){
_local3.push(_local4);
_local3.push(_local9);
};
_local9++;
};
_local4++;
};
if (_local3.length == 0){
_local1 = Math.round((Math.random() * 7));
_local2 = Math.round((Math.random() * 7));
} else {
_local10 = Math.round((Math.random() * ((_local3.length / 2) - 1)));
_local1 = _local3[(2 * _local10)];
_local2 = _local3[((2 * _local10) + 1)];
};
if ((((_local1 == player1.i)) && ((_local2 == player1.j)))){
_local1 = 4;
_local2 = 4;
};
_local5 = new Teleport();
_local6 = new Teleport();
_local5.gotoAndPlay(2);
_local6.gotoAndPlay(2);
containerArray[player1.i][player1.j].addChild(_local5);
_local5.x = player1.x;
_local5.y = player1.y;
containerArray[player1.i][player1.j].removeChild(player1);
checkSpecial(player1.i, player1.j);
if (transOn == 1){
modifyTrans();
};
_local7 = player1.i;
_local8 = player1.j;
player1.i = _local1;
player1.j = _local2;
player1.x = ((160 + (_local2 * 20)) - (_local1 * 20));
player1.y = (((236.5 + (_local2 * 10)) + (_local1 * 10)) - (heightArray[_local1][_local2] * 16.5));
_local6.x = ((160 + (_local2 * 20)) - (_local1 * 20));
_local6.y = (((236.5 + (_local2 * 10)) + (_local1 * 10)) - (heightArray[_local1][_local2] * 16.5));
containerArray[_local1][_local2].addChild(player1);
if (waterStarted){
if (heightArray[_local7][_local8] >= (waterLevel + 1)){
waterArray[_local7][_local8].gotoAndStop(2);
} else {
waterArray[_local7][_local8].gotoAndStop(1);
};
if (heightArray[_local1][_local2] == waterLevel){
waterArray[_local1][_local2].gotoAndStop(3);
} else {
if (heightArray[_local1][_local2] > waterLevel){
waterArray[_local1][_local2].gotoAndStop(2);
} else {
waterArray[_local1][_local2].gotoAndStop(1);
};
};
containerArray[_local1][_local2].removeChild(waterArray[_local1][_local2]);
containerArray[_local1][_local2].addChild(waterArray[_local1][_local2]);
if ((((underwater == false)) && ((waterLevel > heightArray[_local1][_local2])))){
underwater = true;
waterOut.play(0, 0);
} else {
if (((underwater) && ((waterLevel <= heightArray[_local1][_local2])))){
underwater = false;
};
};
};
containerArray[_local1][_local2].addChild(_local6);
}
public function modifyTrans():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < 8) {
_local2 = 0;
while (_local2 < 8) {
if ((((player1.i < _local1)) || ((player1.j < _local2)))){
containerArray[_local1][_local2].alpha = alphaChange;
} else {
containerArray[_local1][_local2].alpha = 0.6;
};
_local2++;
};
_local1++;
};
player1.alpha = 10;
}
public function gameOverText(_arg1):void{
titleText = new Owned();
addChild(titleText);
MovieClip(titleText).score.text = (score.text + " POINTS");
titleText.x = 160;
titleText.y = 40;
stage.addEventListener(KeyboardEvent.KEY_DOWN, gameOverInput);
}
public function inst(_arg1):void{
Help.gotoAndStop(2);
}
public function checkDeath(_arg1, _arg2):void{
cratesCount = (cratesCount - 1);
crates.text = cratesCount.toString(10);
if ((((player1.i == _arg1)) && ((player1.j == _arg2)))){
kill(player1, _arg1, _arg2, "crate");
};
if ((((((bonusUp == true)) && ((bonus.i == _arg1)))) && ((bonus.j == _arg2)))){
bonus.scoreValue = 0;
bonusUp = false;
};
}
public function key(_arg1):void{
Help.gotoAndStop(1);
}
public function drown():void{
waterIn.play(0, 0);
kill(player1, player1.i, player1.j, "drown");
}
public function victoryText(_arg1):void{
titleText = new Good();
addChild(titleText);
MovieClip(titleText).score.text = (score.text + " POINTS");
titleText.x = 160;
titleText.y = 40;
stage.addEventListener(KeyboardEvent.KEY_DOWN, gameOverInput);
}
function frame20(){
bytestotal = stage.loaderInfo.bytesTotal;
bytesloaded = stage.loaderInfo.bytesLoaded;
if (bytesloaded >= bytestotal){
play();
} else {
gotoAndPlay(1);
};
}
public function dropBonus(_arg1):void{
var _local2:int;
var _local3:int;
bonus = null;
bonusUp = true;
_local2 = Math.round((Math.random() * 7));
_local3 = Math.round((Math.random() * 7));
if ((((takenArray[_local2][_local3] == true)) || ((((player1.i == _local2)) && ((player1.j == _local3)))))){
_local2 = 5;
_local3 = 5;
};
bonus = new Bonus();
bonus.scoreValue = 160;
bonus.i = _local2;
bonus.j = _local3;
containerArray[_local2][_local3].addChild(bonus);
bonus.x = ((160 + (_local3 * 20)) - (_local2 * 20));
bonus.y = (((248 - (heightArray[_local2][_local3] * 16.5)) + (_local3 * 10)) + (_local2 * 10));
}
public function createCharacters(_arg1):void{
char_timer.stop();
char_timer.removeEventListener("timer", createCharacters);
tp.play();
containerArray[p1I][p1J].addChild(player1);
containerArray[p1I][p1J].addChild(tp);
player1.i = p1I;
player1.j = p1J;
player1.x = ((160 + (p1J * 20)) - (p1I * 20));
player1.y = ((236.5 + (p1J * 10)) + (p1I * 10));
tp.x = player1.x;
tp.y = player1.y;
}
public function checkSpecial(_arg1, _arg2):void{
if ((((specialBonus == 0)) && ((heightArray[_arg1][_arg2] == 3)))){
dont = false;
special.play(0, 1);
giveScore(scoreNum);
specialBonus++;
showScore.scoreShow.text = "SCORE DOUBLED!";
showScore.gotoAndPlay(1);
};
if ((((specialBonus == 1)) && ((heightArray[_arg1][_arg2] == 6)))){
dont = false;
special.play(0, 1);
giveScore((scoreNum * 2));
specialBonus++;
showScore.scoreShow.text = "SCORE TRIPPLED!";
showScore.gotoAndPlay(1);
};
}
public function showScoreFunction(_arg1, _arg2):void{
if (_arg2 == 1){
showScore.scoreShow.text = (("+" + _arg1) + " POINTS!");
showScore.gotoAndPlay(1);
} else {
if (_arg2 == 2){
showScore.scoreShow.text = "TELEPORT GAINED!";
powerupSnd.play(0, 1);
showScore.gotoAndPlay(1);
} else {
if (_arg2 == 3){
showScore.scoreShow.text = (((("+" + _arg1) + " POINTS!") + "\r") + "TELEPORT GAINED!");
powerupSnd.play(0, 1);
showScore.gotoAndPlay(1);
};
};
};
}
public function trans():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < 8) {
_local2 = 0;
while (_local2 < 8) {
if (transOn == 1){
containerArray[_local1][_local2].alpha = 1;
water.alpha = 1;
waterArray[_local1][_local2].alpha = 1;
} else {
if ((((player1.i < _local1)) || ((player1.j < _local2)))){
containerArray[_local1][_local2].alpha = alphaChange;
water.alpha = 0;
waterArray[_local1][_local2].alpha = alphaChange;
} else {
containerArray[_local1][_local2].alpha = 0.6;
water.alpha = 0;
waterArray[_local1][_local2].alpha = alphaChange;
};
};
_local2++;
};
_local1++;
};
if (transOn == 0){
transOn = 1;
} else {
transOn = 0;
};
player1.alpha = 10;
}
public function scoreAndBonusUpdate(_arg1):void{
var _local2:int;
var _local3:int;
score.text = scoreNum.toString(10);
scoreNum++;
_local2 = 0;
_local3 = 0;
if (underwater){
airCount = (airCount - 1);
air.text = airCount.toString(10);
if (airCount == 0){
drown();
};
if ((((airCount == 30)) && ((warning.currentFrame == 1)))){
warning.gotoAndPlay(2);
};
} else {
if (airCount < maxAir){
airCount++;
air.text = airCount.toString(10);
};
};
if (((((bonusUp) && ((player1.i == bonus.i)))) && ((player1.j == bonus.j)))){
_local2 = takenBonus();
_local3++;
};
if ((scoreNum - (powerupConst * powerupMulti)) >= powerupConst){
teleportCount++;
teleport.text = teleportCount.toString(10);
powerupMulti++;
_local3 = (_local3 + 2);
};
if (cratesCount <= 0){
cratesCount = 0;
crates.text = "0";
finishGame();
};
if (dont){
showScoreFunction(_local2, _local3);
};
removeChild(water);
addChild(water);
}
public function createWaterTiles():void{
var _local1:int;
var _local2:int;
var _local3:MovieClip;
_local1 = 0;
while (_local1 < 8) {
_local2 = 0;
while (_local2 < 8) {
_local3 = new WaterTile();
_local3.i = _local1;
_local3.j = _local2;
containerArray[_local1][_local2].addChild(_local3);
waterArray[_local1][_local2] = _local3;
_local3.x = ((160 + (_local2 * 20)) - (_local1 * 20));
_local3.y = ((248 + (_local2 * 10)) + (_local1 * 10));
_local3.gotoAndStop(4);
_local2++;
};
_local1++;
};
}
public function beginFlood(){
var _local1:int;
var _local2:int;
waterStarted = true;
water_timer.start();
_local1 = 0;
while (_local1 < 8) {
_local2 = 0;
while (_local2 < 8) {
if (heightArray[_local1][_local2] > 0){
waterArray[_local1][_local2].gotoAndStop(2);
} else {
if ((((player1.i == _local1)) && ((player1.j == _local2)))){
waterArray[_local1][_local2].gotoAndStop(3);
} else {
waterArray[_local1][_local2].gotoAndStop(1);
};
};
_local2++;
};
_local1++;
};
}
public function dropBlock(_arg1):void{
var _local2:int;
var _local3:int;
var _local4:Number;
_local2 = Math.round((Math.random() * 7));
_local3 = Math.round((Math.random() * 7));
_local4 = (cratesCount / 20);
if (((!((cratesCount == maxCrates))) && (((_local4 - Math.round(_local4)) == 0)))){
_local2 = player1.i;
_local3 = player1.j;
};
if (takenArray[_local2][_local3] == false){
putBlockAt(_local2, _local3);
};
if (block_timer.delay > minimumDelay){
block_timer.delay = (block_timer.delay - delayDecrease);
};
}
public function checkWater(_arg1, _arg2:int):void{
if (heightArray[_arg1][_arg2] >= (waterLevel + 1)){
waterArray[_arg1][_arg2].gotoAndStop(2);
} else {
waterArray[_arg1][_arg2].gotoAndStop(1);
};
}
public function hDif(_arg1, _arg2, _arg3, _arg4:int):int{
return ((heightArray[_arg1][_arg2] - heightArray[_arg3][_arg4]));
}
public function finishGame():void{
var _local1:MovieClip;
var _local2:Timer;
block_timer.stop();
bonus_timer.stop();
water_timer.stop();
waterSource.play();
winSound.play();
musicChan.stop();
_local1 = new Argh();
containerArray[player1.i][player1.j].addChild(_local1);
_local1.play();
_local1.x = player1.x;
_local1.y = player1.y;
containerArray[player1.i][player1.j].removeChild(player1);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, input);
stage.removeEventListener(KeyboardEvent.KEY_UP, keyUpCheck);
stage.removeEventListener(Event.ENTER_FRAME, scoreAndBonusUpdate);
removeChild(msgs);
_local2 = new Timer(2000, 1);
_local2.addEventListener("timer", victoryText);
_local2.start();
}
public function createArrays():void{
var _local1:int;
var _local2:int;
var _local3:Sprite;
_local1 = 0;
while (_local1 < 8) {
containerArray[_local1] = new Array(8);
heightArray[_local1] = new Array(8);
takenArray[_local1] = new Array(8);
waterArray[_local1] = new Array(8);
_local2 = 0;
while (_local2 < 8) {
_local3 = new Sprite();
containerArray[_local1][_local2] = _local3;
addChild(_local3);
heightArray[_local1][_local2] = 0;
takenArray[_local1][_local2] = false;
_local2++;
};
_local1++;
};
}
public function kill(_arg1, _arg2, _arg3, _arg4):void{
var _local5:Timer;
if (_arg4 == "drown"){
_arg1.gotoAndStop(7);
} else {
if (heightArray[_arg2][_arg3] == 1){
_arg1.gotoAndStop(6);
} else {
_arg1.gotoAndStop(5);
};
};
block_timer.stop();
player1.death = true;
waterSource.play();
bonus_timer.stop();
water_timer.stop();
stage.removeEventListener(KeyboardEvent.KEY_DOWN, input);
stage.removeEventListener(KeyboardEvent.KEY_UP, keyUpCheck);
stage.removeEventListener(Event.ENTER_FRAME, scoreAndBonusUpdate);
_local5 = new Timer(2000, 1);
removeChild(msgs);
_local5.addEventListener("timer", gameOverText);
_local5.start();
}
public function startGame(_arg1):void{
animated.musicChan2.stop();
stage.removeEventListener(MouseEvent.CLICK, startGame);
ins.removeEventListener(MouseEvent.CLICK, inst);
keys.removeEventListener(MouseEvent.CLICK, key);
if ((((Help.currentFrame >= 2)) && ((Help.currentFrame <= 6)))){
Help.a1.stop();
};
removeChild(Help);
Help = null;
removeChild(animated);
gotoAndPlay("gameStart", "game");
}
public function gameOverInput(_arg1):void{
var _local2:int;
var _local3:int;
stage.removeEventListener(KeyboardEvent.KEY_DOWN, gameOverInput);
_local2 = 0;
while (_local2 < 8) {
_local3 = 0;
while (_local3 < 8) {
removeChild(containerArray[_local2][_local3]);
_local3++;
};
_local2++;
};
removeChild(water);
removeChild(titleText);
musicChan.stop();
gotoAndStop(1, "menu");
}
public function putBlockAt(_arg1, _arg2:int):void{
var _local3:int;
var _local4:MovieClip;
var _local5:MovieClip;
var _local6:int;
_local3 = heightArray[_arg1][_arg2];
_local4 = new Block();
_local5 = new Shade();
if ((((player1.i == _arg1)) && ((player1.j == _arg2)))){
containerArray[_arg1][_arg2].removeChild(player1);
containerArray[_arg1][_arg2].addChild(_local5);
containerArray[_arg1][_arg2].addChild(player1);
} else {
containerArray[_arg1][_arg2].addChild(_local5);
};
containerArray[_arg1][_arg2].addChild(_local4);
_local4.array = heightArray;
_local4.takenArray = takenArray;
_local4.i = _arg1;
_local4.j = _arg2;
_local4.x = ((160 + (_arg2 * 20)) - (_arg1 * 20));
_local4.y = (((-23 - (_local3 * 16.5)) + (_arg2 * 10)) + (_arg1 * 10));
_local5.x = ((160 + (_arg2 * 20)) - (_arg1 * 20));
_local5.y = (((248 - (_local3 * 16.5)) + (_arg2 * 10)) + (_arg1 * 10));
}
public function takenBonus():int{
var _local1:int;
bonusWave.play(0, 1);
_local1 = (bonus.scoreValue * 15);
giveScore(_local1);
if (takenArray[bonus.i][bonus.j] == false){
putBlockAt(bonus.i, bonus.j);
};
bonus.scoreValue = 0;
bonusUp = false;
return (_local1);
}
public function keyUpCheck(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case p1UP:
player1.key = true;
break;
case p1DOWN:
player1.key = true;
break;
case p1LEFT:
player1.key = true;
break;
case p1RIGHT:
player1.key = true;
break;
case 32:
player1.key = true;
break;
case 88:
player1.key = true;
trans();
break;
};
}
public function input(_arg1:KeyboardEvent):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = player1.i;
_local3 = player1.j;
switch (_arg1.keyCode){
case p1UP:
if (player1.key){
player1.key = false;
player1.gotoAndStop(3);
if (_local3 > 0){
_local4 = (_local3 - 1);
_local5 = hDif(_local2, _local3, _local2, _local4);
if (Math.abs(_local5) <= 1){
containerArray[_local2][_local3].removeChild(player1);
player1.j = (player1.j - 1);
player1.x = (player1.x - 20);
player1.y = (player1.y - (10 - (_local5 * 16.5)));
checkSpecial(_local2, _local4);
if (transOn == 1){
modifyTrans();
};
containerArray[_local2][_local4].addChild(player1);
if (waterStarted){
if (heightArray[_local2][_local3] >= (waterLevel + 1)){
waterArray[_local2][_local3].gotoAndStop(2);
} else {
waterArray[_local2][_local3].gotoAndStop(1);
};
if (heightArray[_local2][_local4] == waterLevel){
waterArray[_local2][_local4].gotoAndStop(3);
} else {
if (heightArray[_local2][_local4] > waterLevel){
waterArray[_local2][_local4].gotoAndStop(2);
} else {
waterArray[_local2][_local4].gotoAndStop(1);
};
};
containerArray[_local2][_local4].removeChild(waterArray[_local2][_local4]);
containerArray[_local2][_local4].addChild(waterArray[_local2][_local4]);
if ((((underwater == false)) && ((waterLevel > heightArray[_local2][_local4])))){
underwater = true;
waterOut.play(0, 0);
} else {
if (((underwater) && ((waterLevel <= heightArray[_local2][_local4])))){
underwater = false;
};
};
};
};
};
};
break;
case p1DOWN:
if (player1.key){
player1.gotoAndStop(2);
player1.key = false;
if (_local3 < 7){
_local4 = (_local3 + 1);
_local5 = hDif(_local2, _local3, _local2, _local4);
if (Math.abs(_local5) <= 1){
containerArray[_local2][_local3].removeChild(player1);
player1.j = (player1.j + 1);
player1.x = (player1.x + 20);
player1.y = (player1.y + (10 + (_local5 * 16.5)));
checkSpecial(_local2, _local4);
if (transOn == 1){
modifyTrans();
};
containerArray[_local2][_local4].addChild(player1);
if (waterStarted){
if (heightArray[_local2][_local3] >= (waterLevel + 1)){
waterArray[_local2][_local3].gotoAndStop(2);
} else {
waterArray[_local2][_local3].gotoAndStop(1);
};
if (heightArray[_local2][_local4] == waterLevel){
waterArray[_local2][_local4].gotoAndStop(3);
} else {
if (heightArray[_local2][_local4] > waterLevel){
waterArray[_local2][_local4].gotoAndStop(2);
} else {
waterArray[_local2][_local4].gotoAndStop(1);
};
};
containerArray[_local2][_local4].removeChild(waterArray[_local2][_local4]);
containerArray[_local2][_local4].addChild(waterArray[_local2][_local4]);
if ((((underwater == false)) && ((waterLevel > heightArray[_local2][_local4])))){
underwater = true;
waterOut.play(0, 0);
} else {
if (((underwater) && ((waterLevel <= heightArray[_local2][_local4])))){
underwater = false;
};
};
};
};
};
};
break;
case p1LEFT:
if (player1.key){
player1.gotoAndStop(1);
player1.key = false;
if (_local2 < 7){
_local4 = (_local2 + 1);
_local5 = hDif(_local2, _local3, _local4, _local3);
if (Math.abs(_local5) <= 1){
containerArray[_local2][_local3].removeChild(player1);
player1.i = (player1.i + 1);
player1.x = (player1.x - 20);
player1.y = (player1.y + (10 + (_local5 * 16.5)));
checkSpecial(_local4, _local3);
if (transOn == 1){
modifyTrans();
};
containerArray[_local4][_local3].addChild(player1);
if (waterStarted){
if (heightArray[_local2][_local3] >= (waterLevel + 1)){
waterArray[_local2][_local3].gotoAndStop(2);
} else {
waterArray[_local2][_local3].gotoAndStop(1);
};
if (heightArray[_local4][_local3] == waterLevel){
waterArray[_local4][_local3].gotoAndStop(3);
} else {
if (heightArray[_local4][_local3] > waterLevel){
waterArray[_local4][_local3].gotoAndStop(2);
} else {
waterArray[_local4][_local3].gotoAndStop(1);
};
};
containerArray[_local4][_local3].removeChild(waterArray[_local4][_local3]);
containerArray[_local4][_local3].addChild(waterArray[_local4][_local3]);
if ((((underwater == false)) && ((waterLevel > heightArray[_local4][_local3])))){
underwater = true;
waterOut.play(0, 0);
} else {
if (((underwater) && ((waterLevel <= heightArray[_local4][_local3])))){
underwater = false;
};
};
};
};
};
};
break;
case p1RIGHT:
if (player1.key){
player1.gotoAndStop(4);
player1.key = false;
if (_local2 > 0){
_local4 = (_local2 - 1);
_local5 = hDif(_local2, _local3, _local4, _local3);
if (Math.abs(_local5) <= 1){
containerArray[_local2][_local3].removeChild(player1);
player1.i = (player1.i - 1);
player1.x = (player1.x + 20);
player1.y = (player1.y - (10 - (_local5 * 16.5)));
checkSpecial((_local2 - 1), _local3);
if (transOn == 1){
modifyTrans();
};
containerArray[_local4][_local3].addChild(player1);
if (waterStarted){
if (heightArray[_local2][_local3] >= (waterLevel + 1)){
waterArray[_local2][_local3].gotoAndStop(2);
} else {
waterArray[_local2][_local3].gotoAndStop(1);
};
if (heightArray[_local4][_local3] == waterLevel){
waterArray[_local4][_local3].gotoAndStop(3);
} else {
if (heightArray[_local4][_local3] > waterLevel){
waterArray[_local4][_local3].gotoAndStop(2);
} else {
waterArray[_local4][_local3].gotoAndStop(1);
};
};
containerArray[_local4][_local3].removeChild(waterArray[_local4][_local3]);
containerArray[_local4][_local3].addChild(waterArray[_local4][_local3]);
if ((((underwater == false)) && ((waterLevel > heightArray[_local4][_local3])))){
underwater = true;
waterOut.play(0, 0);
} else {
if (((underwater) && ((waterLevel <= heightArray[_local4][_local3])))){
underwater = false;
};
};
};
};
};
};
break;
case 32:
if (((player1.key) && ((teleportCount > 0)))){
player1.key = false;
teleportPlayer();
};
break;
};
}
public function riseWater(_arg1):void{
var _local2:Boolean;
var _local3:int;
var _local4:int;
waterSource.holeMask.y = (waterSource.holeMask.y - 0.2);
water.risingWater.y = (water.risingWater.y - 0.2);
_local2 = false;
if (traceChange != waterLevel){
if ((((underwater == false)) && ((waterLevel > heightArray[player1.i][player1.j])))){
underwater = true;
waterOut.play(0, 0);
};
_local2 = true;
};
_local3 = 0;
while (_local3 < 8) {
_local4 = 0;
while (_local4 < 8) {
if (_local2){
if (heightArray[_local3][_local4] >= (waterLevel + 1)){
waterArray[_local3][_local4].gotoAndStop(2);
} else {
waterArray[_local3][_local4].gotoAndStop(1);
};
};
containerArray[_local3][_local4].removeChild(waterArray[_local3][_local4]);
containerArray[_local3][_local4].addChild(waterArray[_local3][_local4]);
waterArray[_local3][_local4].y = (waterArray[_local3][_local4].y - 0.2);
_local4++;
};
_local3++;
};
traceChange = waterLevel;
waterLevel = Math.floor((water_timer.currentCount / 82));
}
function frame261(){
start.addEventListener(MouseEvent.CLICK, startGame);
ins.addEventListener(MouseEvent.CLICK, inst);
keys.addEventListener(MouseEvent.CLICK, key);
stage.showDefaultContextMenu = false;
stop();
}
function frame262(){
underwater = false;
traceChange = 0;
waterLevel = 0;
waterStarted = false;
specialBonus = 0;
cratesCount = maxCrates;
airCount = maxAir;
teleportCount = initialTeleport;
scoreNum = 0;
dont = true;
transOn = 0;
bonusUp = false;
powerupMulti = 0;
waterOut = new Splish();
waterIn = new Splash();
music = new themeMusic();
tpSound = new teleSound();
powerupSnd = new GainPower();
bonusWave = new BonusTaken();
special = new Special();
winSound = new win();
tp = new Teleport();
player1 = new Char1();
containerArray = new Array(8);
heightArray = new Array(8);
takenArray = new Array(8);
waterArray = new Array(8);
char_timer = new Timer(500, 0);
block_timer = new Timer(initialDelay, 0);
start_timer = new Timer(3000, 0);
bonus_timer = new Timer(bonusRepeat, 0);
water_timer = new Timer(riseRate, 0);
stage.showDefaultContextMenu = false;
createArrays();
createWaterTiles();
block_timer.addEventListener("timer", dropBlock);
bonus_timer.addEventListener("timer", dropBonus);
start_timer.addEventListener("timer", game);
water_timer.addEventListener("timer", riseWater);
char_timer.addEventListener("timer", createCharacters);
teleport.text = initialTeleport.toString(10);
char_timer.start();
start_timer.start();
score.text = "0";
crates.text = cratesCount.toString(10);
air.text = maxAir.toString(10);
stop();
}
public function game(_arg1):void{
containerArray[p1I][p1J].removeChild(tp);
start_timer.removeEventListener("timer", game);
stage.addEventListener(KeyboardEvent.KEY_DOWN, input);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpCheck);
stage.addEventListener(Event.ENTER_FRAME, scoreAndBonusUpdate);
musicChan = music.play(0, 9999);
block_timer.start();
bonus_timer.start();
}
function frame260(){
removeChild(bla);
}
}
}//package Stochastic_fla
Section 10
//UKBFull_3 (Stochastic_fla.UKBFull_3)
package Stochastic_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
public dynamic class UKBFull_3 extends MovieClip {
public var musicChan3:SoundChannel;
public var loop2:Sound;
public function UKBFull_3(){
addFrameScript(0, frame1, 154, frame155);
}
function frame155(){
this.addEventListener(Event.ENTER_FRAME, moo);
stop();
}
public function moo(_arg1):void{
var _local2:*;
_local2 = Math.round((musicChan3.position / 24.5));
gotoAndStop((_local2 + 2));
}
function frame1(){
loop2 = new UKB();
musicChan3 = loop2.play(0, 0);
this.addEventListener(Event.ENTER_FRAME, moo);
}
}
}//package Stochastic_fla
Section 11
//warning_30 (Stochastic_fla.warning_30)
package Stochastic_fla {
import flash.display.*;
public dynamic class warning_30 extends MovieClip {
public function warning_30(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Stochastic_fla
Section 12
//waterFlood_27 (Stochastic_fla.waterFlood_27)
package Stochastic_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class waterFlood_27 extends MovieClip {
public function waterFlood_27(){
addFrameScript(299, frame300, 300, frame301);
}
function frame300(){
if (MovieClip(parent).player1.death == true){
stop();
} else {
MovieClip(parent).beginFlood();
gotoAndStop(301);
};
}
function frame301(){
stop();
}
}
}//package Stochastic_fla
Section 13
//waterHole_24 (Stochastic_fla.waterHole_24)
package Stochastic_fla {
import flash.display.*;
public dynamic class waterHole_24 extends MovieClip {
public var holeMask:MovieClip;
public function waterHole_24(){
addFrameScript(101, frame102, 129, frame130);
}
function frame102(){
stop();
}
function frame130(){
stop();
}
}
}//package Stochastic_fla
Section 14
//WhatThe_22 (Stochastic_fla.WhatThe_22)
package Stochastic_fla {
import flash.display.*;
public dynamic class WhatThe_22 extends MovieClip {
public function WhatThe_22(){
addFrameScript(189, frame190);
}
function frame190(){
stop();
}
}
}//package Stochastic_fla
Section 15
//Argh (Argh)
package {
import flash.display.*;
public dynamic class Argh extends MovieClip {
public function Argh(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package
Section 16
//Block (Block)
package {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Block extends MovieClip {
public var color:MovieClip;
public var i:int;
public var j:int;
public var array:Array;
public var takenArray:Array;
public function Block(){
addFrameScript(0, frame1, 1, frame2, 17, frame18, 19, frame20);
}
function frame18(){
array[i][j] = (array[i][j] + 1);
takenArray[i][j] = false;
MovieClip(this.parent.parent).checkDeath(i, j);
MovieClip(parent.parent).checkWater(i, j);
}
function frame1(){
color.gotoAndStop((array[i][j] + 1));
}
function frame20(){
stop();
}
function frame2(){
takenArray[i][j] = true;
}
}
}//package
Section 17
//Bonus (Bonus)
package {
import flash.events.*;
import flash.display.*;
public dynamic class Bonus extends MovieClip {
public var i;
public var j:int;
public var scoreValue:int;
public function Bonus(){
addFrameScript(0, frame1, 89, frame90);
}
function frame90(){
gotoAndPlay(2);
}
function frame1(){
this.alpha = 20;
this.addEventListener(Event.ENTER_FRAME, reduceValue);
}
public function reduceValue(_arg1):void{
if (scoreValue <= 0){
this.removeEventListener(Event.ENTER_FRAME, reduceValue);
parent.removeChild(this);
};
scoreValue--;
}
}
}//package
Section 18
//BonusTaken (BonusTaken)
package {
import flash.media.*;
public dynamic class BonusTaken extends Sound {
}
}//package
Section 19
//bub_death (bub_death)
package {
import flash.media.*;
public dynamic class bub_death extends Sound {
}
}//package
Section 20
//Char1 (Char1)
package {
import flash.display.*;
public dynamic class Char1 extends MovieClip {
public var key:Boolean;
public var i;
public var j:int;
public function Char1(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7);
}
function frame3(){
stop();
}
function frame1(){
key = true;
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 21
//GainPower (GainPower)
package {
import flash.media.*;
public dynamic class GainPower extends Sound {
}
}//package
Section 22
//Good (Good)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Good extends MovieClip {
public var score:TextField;
}
}//package
Section 23
//MenuLoop (MenuLoop)
package {
import flash.media.*;
public dynamic class MenuLoop extends Sound {
}
}//package
Section 24
//Owned (Owned)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Owned extends MovieClip {
public var score:TextField;
}
}//package
Section 25
//Pond (Pond)
package {
import flash.display.*;
public dynamic class Pond extends MovieClip {
}
}//package
Section 26
//Shade (Shade)
package {
import flash.display.*;
public dynamic class Shade extends MovieClip {
public function Shade(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package
Section 27
//Show (Show)
package {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Show extends MovieClip {
public var scoreShow:TextField;
public function Show(){
addFrameScript(39, frame40, 78, frame79);
}
function frame79(){
scoreShow.text = " ";
stop();
}
function frame40(){
MovieClip(parent).dont = true;
}
}
}//package
Section 28
//Special (Special)
package {
import flash.media.*;
public dynamic class Special extends Sound {
}
}//package
Section 29
//Splash (Splash)
package {
import flash.media.*;
public dynamic class Splash extends Sound {
}
}//package
Section 30
//Splish (Splish)
package {
import flash.media.*;
public dynamic class Splish extends Sound {
}
}//package
Section 31
//Teleport (Teleport)
package {
import flash.display.*;
public dynamic class Teleport extends MovieClip {
public function Teleport(){
addFrameScript(0, frame1, 29, frame30);
}
function frame1(){
stop();
}
function frame30(){
stop();
}
}
}//package
Section 32
//teleSound (teleSound)
package {
import flash.media.*;
public dynamic class teleSound extends Sound {
}
}//package
Section 33
//themeMusic (themeMusic)
package {
import flash.media.*;
public dynamic class themeMusic extends Sound {
}
}//package
Section 34
//UKB (UKB)
package {
import flash.media.*;
public dynamic class UKB extends Sound {
}
}//package
Section 35
//Water (Water)
package {
import flash.display.*;
public dynamic class Water extends MovieClip {
public var risingWater:Pond;
}
}//package
Section 36
//WaterTile (WaterTile)
package {
import flash.display.*;
public dynamic class WaterTile extends MovieClip {
public var i;
public var j:int;
public function WaterTile(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 37
//win (win)
package {
import flash.media.*;
public dynamic class win extends Sound {
}
}//package