Section 1
//block_green_52 (BacteriaHysteria_fla.block_green_52)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class block_green_52 extends MovieClip {
public function block_green_52(){
addFrameScript(0, frame1, 12, frame13, 53, frame54);
}
function frame54(){
stop();
}
function frame1(){
stop();
}
function frame13(){
gotoAndStop(1);
}
}
}//package BacteriaHysteria_fla
Section 2
//block_grey_49 (BacteriaHysteria_fla.block_grey_49)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class block_grey_49 extends MovieClip {
public function block_grey_49(){
addFrameScript(0, frame1, 8, frame9, 52, frame53);
}
function frame53(){
stop();
}
function frame9(){
gotoAndStop(1);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 3
//block_orange_51 (BacteriaHysteria_fla.block_orange_51)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class block_orange_51 extends MovieClip {
public function block_orange_51(){
addFrameScript(0, frame1, 12, frame13, 53, frame54);
}
function frame54(){
stop();
}
function frame1(){
stop();
}
function frame13(){
gotoAndStop(1);
}
}
}//package BacteriaHysteria_fla
Section 4
//block_pink_54 (BacteriaHysteria_fla.block_pink_54)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class block_pink_54 extends MovieClip {
public function block_pink_54(){
addFrameScript(0, frame1, 29, frame30, 54, frame55);
}
function frame30(){
gotoAndStop(1);
}
function frame1(){
stop();
}
function frame55(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 5
//block_red_53 (BacteriaHysteria_fla.block_red_53)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class block_red_53 extends MovieClip {
public function block_red_53(){
addFrameScript(0, frame1, 7, frame8, 60, frame61);
}
function frame61(){
stop();
}
function frame8(){
gotoAndStop(1);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 6
//block_red_vanish_intro_57 (BacteriaHysteria_fla.block_red_vanish_intro_57)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class block_red_vanish_intro_57 extends MovieClip {
public function block_red_vanish_intro_57(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 7
//block_superstar_snurrar_42 (BacteriaHysteria_fla.block_superstar_snurrar_42)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class block_superstar_snurrar_42 extends MovieClip {
public function block_superstar_snurrar_42(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 8
//block_vanish_101 (BacteriaHysteria_fla.block_vanish_101)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class block_vanish_101 extends MovieClip {
public function block_vanish_101(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 9
//block_vanish_intro_58 (BacteriaHysteria_fla.block_vanish_intro_58)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class block_vanish_intro_58 extends MovieClip {
public function block_vanish_intro_58(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 10
//exit_sound_off_69 (BacteriaHysteria_fla.exit_sound_off_69)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class exit_sound_off_69 extends MovieClip {
public var mcToggleSound:MovieClip;
public var mcExitGame:MovieClip;
public var mcCross:MovieClip;
public function exit_sound_off_69(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 11
//fingertip_booststart_26 (BacteriaHysteria_fla.fingertip_booststart_26)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class fingertip_booststart_26 extends MovieClip {
public function fingertip_booststart_26(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 12
//FlashWarning_27 (BacteriaHysteria_fla.FlashWarning_27)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class FlashWarning_27 extends MovieClip {
public function FlashWarning_27(){
addFrameScript(0, frame1, 19, frame20);
}
function frame20(){
gotoAndPlay(2);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 13
//gubbe_frisk_level_3_36 (BacteriaHysteria_fla.gubbe_frisk_level_3_36)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class gubbe_frisk_level_3_36 extends MovieClip {
public function gubbe_frisk_level_3_36(){
addFrameScript(0, frame1, 69, frame70);
}
function frame1(){
stop();
}
function frame70(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 14
//gubbe_halvsjuk_level_2_37 (BacteriaHysteria_fla.gubbe_halvsjuk_level_2_37)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class gubbe_halvsjuk_level_2_37 extends MovieClip {
public function gubbe_halvsjuk_level_2_37(){
addFrameScript(0, frame1, 69, frame70);
}
function frame1(){
stop();
}
function frame70(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 15
//gubbe_sjuk_level_1_38 (BacteriaHysteria_fla.gubbe_sjuk_level_1_38)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class gubbe_sjuk_level_1_38 extends MovieClip {
public function gubbe_sjuk_level_1_38(){
addFrameScript(0, frame1, 69, frame70);
}
function frame1(){
stop();
}
function frame70(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 16
//guldbricka_96 (BacteriaHysteria_fla.guldbricka_96)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class guldbricka_96 extends MovieClip {
public function guldbricka_96(){
addFrameScript(0, frame1, 19, frame20);
}
function frame20(){
gotoAndPlay(2);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 17
//guldbricka_tray_63 (BacteriaHysteria_fla.guldbricka_tray_63)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class guldbricka_tray_63 extends MovieClip {
public function guldbricka_tray_63(){
addFrameScript(0, frame1, 19, frame20);
}
function frame20(){
gotoAndPlay(2);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 18
//levelbyte_35 (BacteriaHysteria_fla.levelbyte_35)
package BacteriaHysteria_fla {
import flash.display.*;
import flash.text.*;
public dynamic class levelbyte_35 extends MovieClip {
public var txtBonusScore:TextField;
public var txtTimeLeft:TextField;
public var mcGubbe1:MovieClip;
public var mcGubbe2:MovieClip;
public var mcGubbe3:MovieClip;
public var txtTotalScoreLabel:TextField;
public var txtItemsLiftedLabel:TextField;
public var txtCleared:TextField;
public var txtOpenUserEnd:TextField;
public var txtClickToCont:TextField;
public var txtRoundScoreLabel:TextField;
public var txtBonusScoreLabel:TextField;
public var txtItemsLifted:TextField;
public var txtRoundScore:TextField;
public var txtTotalScore:TextField;
public function levelbyte_35(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 19
//levelbyteanimerad_34 (BacteriaHysteria_fla.levelbyteanimerad_34)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class levelbyteanimerad_34 extends MovieClip {
public var mcSign:MovieClip;
public function levelbyteanimerad_34(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 20
//Logo_14 (BacteriaHysteria_fla.Logo_14)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class Logo_14 extends MovieClip {
public function Logo_14(){
addFrameScript(0, frame1, 49, frame50);
}
function frame50(){
stop();
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 21
//medicinburk_31 (BacteriaHysteria_fla.medicinburk_31)
package BacteriaHysteria_fla {
import flash.display.*;
import flash.text.*;
public dynamic class medicinburk_31 extends MovieClip {
public var txtCoinCap:TextField;
public var txtCoinCounter:TextField;
public var mcMedScore:MovieClip;
public function medicinburk_31(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 22
//MedicinBurkAnim_29 (BacteriaHysteria_fla.MedicinBurkAnim_29)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class MedicinBurkAnim_29 extends MovieClip {
public var mcJar:MovieClip;
public function MedicinBurkAnim_29(){
addFrameScript(0, frame1, 56, frame57);
}
function frame1(){
stop();
}
function frame57(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 23
//medicinscore_32 (BacteriaHysteria_fla.medicinscore_32)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class medicinscore_32 extends MovieClip {
public var mcScore:MovieClip;
public function medicinscore_32(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 24
//MetalTray_3 (BacteriaHysteria_fla.MetalTray_3)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class MetalTray_3 extends MovieClip {
public function MetalTray_3(){
addFrameScript(0, frame1, 193, frame194);
}
function frame1(){
stop();
}
function frame194(){
gotoAndPlay(48);
}
}
}//package BacteriaHysteria_fla
Section 25
//piller_faller_guld_74 (BacteriaHysteria_fla.piller_faller_guld_74)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class piller_faller_guld_74 extends MovieClip {
public function piller_faller_guld_74(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 26
//piller_silver_faller_75 (BacteriaHysteria_fla.piller_silver_faller_75)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class piller_silver_faller_75 extends MovieClip {
public function piller_silver_faller_75(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 27
//silverbricka_91 (BacteriaHysteria_fla.silverbricka_91)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class silverbricka_91 extends MovieClip {
public function silverbricka_91(){
addFrameScript(0, frame1, 19, frame20);
}
function frame20(){
gotoAndPlay(2);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 28
//special_colourbomb_green_77 (BacteriaHysteria_fla.special_colourbomb_green_77)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class special_colourbomb_green_77 extends MovieClip {
public function special_colourbomb_green_77(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 29
//special_colourbomb_grey_79 (BacteriaHysteria_fla.special_colourbomb_grey_79)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class special_colourbomb_grey_79 extends MovieClip {
public function special_colourbomb_grey_79(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 30
//special_colourbomb_orange_78 (BacteriaHysteria_fla.special_colourbomb_orange_78)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class special_colourbomb_orange_78 extends MovieClip {
public function special_colourbomb_orange_78(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 31
//special_colourbomb_pink_80 (BacteriaHysteria_fla.special_colourbomb_pink_80)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class special_colourbomb_pink_80 extends MovieClip {
public function special_colourbomb_pink_80(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 32
//special_colourbomb_red_81 (BacteriaHysteria_fla.special_colourbomb_red_81)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class special_colourbomb_red_81 extends MovieClip {
public function special_colourbomb_red_81(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 33
//special_green_bomb_46 (BacteriaHysteria_fla.special_green_bomb_46)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class special_green_bomb_46 extends MovieClip {
public var mcAnim:MovieClip;
public function special_green_bomb_46(){
addFrameScript(50, frame51);
}
function frame51(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 34
//special_green_flash_117 (BacteriaHysteria_fla.special_green_flash_117)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class special_green_flash_117 extends MovieClip {
public function special_green_flash_117(){
addFrameScript(0, frame1, 50, frame51);
}
function frame51(){
stop();
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 35
//special_green_star_activate_107 (BacteriaHysteria_fla.special_green_star_activate_107)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class special_green_star_activate_107 extends MovieClip {
public function special_green_star_activate_107(){
addFrameScript(0, frame1, 3, frame4, 50, frame51, 64, frame65);
}
function frame51(){
stop();
}
function frame65(){
stop();
}
function frame1(){
stop();
}
function frame4(){
gotoAndStop(1);
}
}
}//package BacteriaHysteria_fla
Section 36
//special_grey_star_activate_115 (BacteriaHysteria_fla.special_grey_star_activate_115)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class special_grey_star_activate_115 extends MovieClip {
public function special_grey_star_activate_115(){
addFrameScript(0, frame1, 6, frame7, 50, frame51, 64, frame65);
}
function frame51(){
stop();
}
function frame7(){
gotoAndStop(1);
}
function frame65(){
stop();
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 37
//special_orange_star_activate_109 (BacteriaHysteria_fla.special_orange_star_activate_109)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class special_orange_star_activate_109 extends MovieClip {
public function special_orange_star_activate_109(){
addFrameScript(0, frame1, 8, frame9, 50, frame51, 64, frame65);
}
function frame51(){
stop();
}
function frame9(){
gotoAndStop(1);
}
function frame1(){
stop();
}
function frame65(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 38
//special_pink_star_activate_113 (BacteriaHysteria_fla.special_pink_star_activate_113)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class special_pink_star_activate_113 extends MovieClip {
public function special_pink_star_activate_113(){
addFrameScript(0, frame1, 7, frame8, 50, frame51, 64, frame65);
}
function frame51(){
stop();
}
function frame8(){
gotoAndStop(1);
}
function frame1(){
stop();
}
function frame65(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 39
//special_red_star_activate_111 (BacteriaHysteria_fla.special_red_star_activate_111)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class special_red_star_activate_111 extends MovieClip {
public function special_red_star_activate_111(){
addFrameScript(0, frame1, 7, frame8, 50, frame51, 64, frame65);
}
function frame51(){
stop();
}
function frame8(){
gotoAndStop(1);
}
function frame1(){
stop();
}
function frame65(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 40
//spruta_sne_8 (BacteriaHysteria_fla.spruta_sne_8)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class spruta_sne_8 extends MovieClip {
public function spruta_sne_8(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 41
//ValveTrigger_23 (BacteriaHysteria_fla.ValveTrigger_23)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class ValveTrigger_23 extends MovieClip {
public function ValveTrigger_23(){
addFrameScript(0, frame1, 21, frame22);
}
function frame1(){
stop();
}
function frame22(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 42
//WaterBurst_24 (BacteriaHysteria_fla.WaterBurst_24)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class WaterBurst_24 extends MovieClip {
public function WaterBurst_24(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BacteriaHysteria_fla
Section 43
//vattensprut_68 (BacteriaHysteria_fla.vattensprut_68)
package BacteriaHysteria_fla {
import flash.display.*;
public dynamic class vattensprut_68 extends MovieClip {
public function vattensprut_68(){
addFrameScript(16, frame17);
}
function frame17(){
gotoAndPlay(10);
}
}
}//package BacteriaHysteria_fla
Section 44
//Communicator (src.comm.Communicator)
package src.comm {
import flash.system.*;
public class Communicator {
private var hasSentLastTick;// = false
private var hasSentGameEnd;// = false
private var hasSentGameOver;// = false
private var hasSentGameStart;// = false
private static var CMD_SEND_SCORE = 222;
private static var CMD_LAST_TICK = 862;
private static var CMD_BRICK_CLICKED = 456;
private static var CMD_START_ROUND = 598;
private static var CMD_LINE_PUSH = 911;
private static var CMD_VALVE_CLICKED = 454;
private static var CMD_SEND_BOARD = 914;
private static var CMD_SEND_RANDOM = 851;
private static var CMD_NEW_LINE = 913;
public function gameQuit(){
trace("GAME QUIT");
if (!hasSentGameOver){
hasSentGameOver = true;
fscommand("gameQuit");
};
}
public function valveClicked(_arg1, _arg2){
fscommand("playData", ((((CMD_VALVE_CLICKED + ",") + _arg1) + " ") + _arg2));
}
public function gameEnd(_arg1){
trace("GAME ENDS");
if (!hasSentGameEnd){
hasSentGameEnd = true;
fscommand("gameEnd", _arg1);
};
}
public function sendRandom(_arg1, _arg2){
fscommand("playData", ((((CMD_SEND_RANDOM + ",") + _arg1) + " ") + _arg2));
}
public function startRound(_arg1, _arg2, _arg3){
fscommand("playData", ((((((CMD_START_ROUND + ",") + _arg1) + " ") + _arg2) + " ") + _arg3));
}
public function sendBoard(_arg1, _arg2){
fscommand("playData", ((((CMD_SEND_BOARD + ",") + _arg1) + " ") + _arg2));
}
public function gameStarted(){
trace("GAME START");
if (!hasSentGameStart){
hasSentGameStart = true;
fscommand("gameStart");
};
}
public function sendScore(_arg1, _arg2){
fscommand("playData", ((((CMD_SEND_SCORE + ",") + _arg1) + " ") + _arg2));
}
public function newLine(_arg1){
fscommand("playData", ((CMD_NEW_LINE + ",") + _arg1));
}
public function linePush(_arg1, _arg2){
fscommand("playData", ((((CMD_LINE_PUSH + ",") + _arg1) + " ") + _arg2));
}
public function pieceClicked(_arg1, _arg2, _arg3){
fscommand("playData", ((((((CMD_BRICK_CLICKED + ",") + _arg1) + " ") + _arg2) + " ") + _arg3));
}
public function lastTick(_arg1, _arg2){
fscommand("playData", ((((CMD_LAST_TICK + ",") + _arg1) + " ") + _arg2));
}
}
}//package src.comm
Section 45
//GameDataParser (src.comm.GameDataParser)
package src.comm {
import flash.xml.*;
public class GameDataParser {
public static var textMappings:Object;
public static function parseGameData(_arg1:String):Object{
var _local2:Object = new Object();
var _local3:XMLDocument = new XMLDocument(_arg1);
textMappings = new Object();
_local2.textMappings = textMappings;
var _local4:* = _local3.firstChild.childNodes;
var _local5:int = parseInt(_local3.firstChild.attributes.randomseed);
_local2.randomSeed = _local5;
var _local6:* = 0;
while (_local6 < _local4.length) {
if (_local4[_local6].nodeName == "id"){
};
if (_local4[_local6].nodeName == "game"){
_local2.gameType = new String(_local4[_local6].attributes.type);
};
if (_local4[_local6].nodeName == "userType"){
_local2.userType = new String(_local4[_local6].firstChild.nodeValue);
};
if (_local4[_local6].nodeName == "text"){
if ((((_local4[_local6].firstChild == null)) || ((_local4[_local6].firstChild == undefined)))){
textMappings[_local4[_local6].attributes.id] = (("[" + _local4[_local6].attributes.id) + "]");
} else {
textMappings[_local4[_local6].attributes.id] = new String(_local4[_local6].firstChild.nodeValue);
};
};
_local6++;
};
return (_local2);
}
}
}//package src.comm
Section 46
//MtRandom (src.math.MtRandom)
package src.math {
import flash.utils.*;
public class MtRandom {
private var mti:uint;
private var mt:Array;
public static var MATRIX_A:uint = 2567483615;
public static var UPPER_MASK:uint = 2147483648;
public static var LOWER_MASK:uint = 2147483647;
public static var M:int = 397;
public static var N:int = 624;
private static var mag01:Array = [uint(0), uint(MATRIX_A)];
public function MtRandom(_arg1:uint=0){
mti = (N + 1);
super();
if (_arg1 == 0){
_arg1 = getTimer();
};
mt = new Array(N);
init_genrand(_arg1);
}
private function genrand_int32():uint{
var _local1:Number;
var _local2:uint;
if (mti >= N){
if (mti == (N + 1)){
init_genrand(5489);
};
_local2 = 0;
while (_local2 < (N - M)) {
_local1 = ((mt[_local2] & UPPER_MASK) | (mt[(_local2 + 1)] & LOWER_MASK));
mt[_local2] = ((mt[(_local2 + M)] ^ (_local1 >>> 1)) ^ mag01[uint((_local1 & 1))]);
_local2++;
};
while (_local2 < (N - 1)) {
_local1 = ((mt[_local2] & UPPER_MASK) | (mt[(_local2 + 1)] & LOWER_MASK));
mt[_local2] = ((mt[(_local2 + (M - N))] ^ (_local1 >>> 1)) ^ mag01[uint((_local1 & 1))]);
_local2++;
};
_local1 = ((mt[(N - 1)] & UPPER_MASK) | (mt[0] & LOWER_MASK));
mt[(N - 1)] = ((mt[(M - 1)] ^ (_local1 >>> 1)) ^ mag01[uint((_local1 & 1))]);
mti = 0;
};
_local1 = mt[mti++];
_local1 = (_local1 ^ (_local1 >>> 11));
_local1 = (_local1 ^ ((_local1 << 7) & 2636928640));
_local1 = (_local1 ^ ((_local1 << 15) & 4022730752));
_local1 = (_local1 ^ (_local1 >>> 18));
return (uint(_local1));
}
private function next(_arg1:uint):uint{
return ((genrand_int32() & ((uint(1) << _arg1) - uint(1))));
}
private function init_genrand(_arg1:uint){
var _local2:uint;
var _local3:uint;
mt[0] = uint(_arg1);
mti = 1;
while (mti < N) {
_local2 = (mt[(mti - 1)] ^ (mt[(mti - 1)] >>> 30));
_local3 = uint((_local2 * 1289));
_local3 = uint((_local3 * 1406077));
_local3 = uint((_local3 + mti));
mt[mti] = _local3;
mti++;
};
}
public function nextFloat():Number{
return ((next(24) / 16777216));
}
public function setSeed(_arg1:uint):void{
init_genrand(_arg1);
}
public function nextDouble():Number{
return ((next(24) / 16777216));
}
public function nextInt(_arg1:uint):uint{
return (((genrand_int32() & 2147483647) % _arg1));
}
}
}//package src.math
Section 47
//IFloat (src.timing.IFloat)
package src.timing {
public class IFloat {
public var ivalue:Number;
private var lastValue:Number;
private static var alpha:Number;
public function IFloat(_arg1:Number){
ivalue = _arg1;
lastValue = _arg1;
alpha = 0;
}
public function get value():Number{
return ((lastValue + ((ivalue - lastValue) * alpha)));
}
public function set(_arg1:Number){
lastValue = ivalue;
ivalue = _arg1;
}
public function get(_arg1:Number){
return ((lastValue + ((ivalue - lastValue) * _arg1)));
}
public function set value(_arg1:Number):void{
ivalue = _arg1;
lastValue = _arg1;
}
public function setTo(_arg1:Number){
ivalue = _arg1;
lastValue = _arg1;
}
public static function setAlpha(_arg1:Number):void{
alpha = _arg1;
}
}
}//package src.timing
Section 48
//Timeable (src.timing.Timeable)
package src.timing {
public interface Timeable {
function tick(_arg1:Number):void;
function render(_arg1:Number, _arg2:Number):void;
}
}//package src.timing
Section 49
//Timer (src.timing.Timer)
package src.timing {
import flash.utils.*;
public class Timer {
private var unprocessedTime:Number;// = 0
private var lastTime:Number;// = 0
private var millisPerGameTick:Number;// = 0
private var timeable:Timeable;
private var maxTickTime:Number;// = -1
private var startTime:Number;// = -1
private var time:Number;// = 0
private var tick:Number;// = 0
public function Timer(_arg1:Timeable, _arg2:Number){
millisPerGameTick = (1000 / _arg2);
this.timeable = _arg1;
this.maxTickTime = 500;
}
public function getMillisPerTick():Number{
return (millisPerGameTick);
}
public function advanceTime2():void{
var _local4:*;
var _local1:* = getTimer();
if (startTime < 0){
startTime = _local1;
unprocessedTime = millisPerGameTick;
};
time = (_local1 - startTime);
var _local2:* = (time - lastTime);
lastTime = time;
unprocessedTime = (unprocessedTime + _local2);
if (unprocessedTime >= millisPerGameTick){
_local4 = (maxTickTime + _local1);
do {
timeable.tick(tick);
tick++;
unprocessedTime = (unprocessedTime - millisPerGameTick);
} while ((((unprocessedTime >= millisPerGameTick)) && ((getTimer() < _local4))));
};
var _local3:Number = ((unprocessedTime % millisPerGameTick) / millisPerGameTick);
IFloat.setAlpha(_local3);
timeable.render(tick, _local3);
}
public function advanceTime(){
time = getTimer();
var _local1:* = (time - lastTime);
lastTime = time;
unprocessedTime = (unprocessedTime + _local1);
var _local2:Number = 0;
while (unprocessedTime > millisPerGameTick) {
unprocessedTime = (unprocessedTime - millisPerGameTick);
timeable.tick(tick);
tick++;
_local2++;
if (_local2 >= 10){
unprocessedTime = 0;
};
};
var _local3:Number = (unprocessedTime / millisPerGameTick);
timeable.render(tick, _local3);
}
public function setMaxTickTime(_arg1:Number):void{
maxTickTime = _arg1;
}
}
}//package src.timing
Section 50
//BacteriaHysteria (src.BacteriaHysteria)
package src {
import src.timing.*;
import flash.events.*;
import src.math.*;
import src.comm.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.external.*;
public class BacteriaHysteria extends MovieClip implements Timeable {
private var endGameClicked;// = false
public var parsedGameData:Object;// = null
public var mcButtons:MovieClip;
private var soundOn;// = true
private var startTime;
private var markArr;
private var communicator:Communicator;
public var txtFPS:TextField;
public var mcLogo:MovieClip;
public var mcLevelSign:MovieClip;
private var lastFps;
public var mcIntro:MovieClip;
public var mcFlash1:MovieClip;
public var mcFlash2:MovieClip;
public var mcFlash3:MovieClip;
public var mcFlash4:MovieClip;
public var mcFlash5:MovieClip;
public var mcFlash6:MovieClip;
public var mcFlash7:MovieClip;
public var mcFlash9:MovieClip;
public var mcScoreSign:MovieClip;
private var delay;
public var mcBackGround:MovieClip;
public var mcFlash8:MovieClip;
private var clientVersion;// = "1.0"
private var score;// = 0
private var level;// = 0
public var mcFlash10:MovieClip;
public var mcFlash11:MovieClip;
public var mcFlash12:MovieClip;
private var ticksLeft;
public var mcFinger:MovieClip;
var firstFrame:Boolean;// = true
public var mcJar:MovieClip;
private var frames;
public var mcGame:Game;
private var animCounter;
private var runGubbe;// = false
private var coinRandom:MtRandom;
private var currentTick;
private var m_mainTimer;
private var userType;
private var gameState;
private var noOfRend;// = 0
private var random:MtRandom;
public var mcNeedle:MovieClip;
private var bonusRandom;
private var fpsTimer;
private var gameTime;
private var gubbTarget;
private var fps;
public var mcTray:MovieClip;
private static var INTRO_LENGTH = 824;
private static var STATE_END_GAME = 4;
private static var STATE_NOT_RUNNING = 5;
private static var TICKS_PER_SEC = 30;
private static var STATE_SHOW_INFO_SCREEN = 1;
private static var STATE_BETWEEN_ROUNDS = 3;
private static var DEBUG_GAME_DATA = (((((((((((((((((((((((((((((((((("<gamedata randomseed=\"3\" timelimit=\"660\" lang=\"de\">" + "<text id=\"game_starts_in\">The game starts in [0] seconds!</text>") + "<text id=\"game_next_screen\">Next level in [0] seconds!</text>") + "<text id=\"game_ends_in\">Game ends in [0] seconds!</text>") + "<text id=\"round_starts_in\">Next level strats in [0] seconds!</text>") + "<text id=\"game_starts_in\">Game starkts in [0] seconds!</text>") + "<text id=\"instruction\">Instruction \n\n This is how you play. \n Trogdor!</text>") + "<text id=\"instruction2\">Also... \n\n You put the lime in the coconut and drink it all up</text>") + "<text id=\"instruction3\">And.. \n\n Dont forget to bring back the bacon!</text>") + "<text id=\"color_bomb_title\">Color Bomb!</text>") + "<text id=\"color_bomb_text\">Color bomb bla bla bla bla bla bla bla bla bla bla bla bla</text>") + "<text id=\"ghost_title\">Spöken!</text>") + "<text id=\"ghost_text\">Spöken bla bla bla bla bla bla bla bla bla bla bla bla</text>") + "<text id=\"star_title\">Stjärna!</text>") + "<text id=\"star_text\">Stjärna bla bla bla bla bla bla bla bla bla bla bla bla</text>") + "<text id=\"multi_title\">Multistar!</text>") + "<text id=\"multi_text\">Multistar bla bla bla bla bla bla bla bla bla bla bla bla</text>") + "<text id=\"vitamin_title\">Vitamin!</text>") + "<text id=\"vitamin_text\">Vitamin bla bla bla bla bla bla bla bla bla bla bla bla</text>") + "<text id=\"txtRoundScoreLabel\">Score!</text>") + "<text id=\"txtItemsLiftedLabel\">Items Lifted</text>") + "<text id=\"txtBonusScoreLabel\">Bonus</text>") + "<text id=\"txtTotalScoreLabel\">Total</text>") + "<text id=\"txtClickToCont\">Click to cont.</text>") + "<text id=\"txtClickToStart\">Click to Start</text>") + "<text id=\"txtLinesLeftLabel\">Lines Left</text>") + "<text id=\"txtLevelLabel\">Level</text>") + "<text id=\"txtScoreLabel\">Score</text>") + "<text id=\"txtOpenGameEndTitle\">omgwtfregister!</text>") + "<text id=\"txtOpenGameEndText\">Registrera = mjölk och kakor!</text>") + "<text id=\"txtLevelCleared\">Moving on!</text>") + "<text id=\"txtGameCleared\">You beat the game!</text>") + "<text id=\"txtGameFailed\">Epic fail nublar!</text>") + "<userType id=\"1\">1</userType>") + "</gamedata>");
private static var STATE_WAIT_FOR_GAMEDATA = 0;
private static var STATE_PLAY_GAME = 2;
private static var DEBUG_MODE = false;
private static var STATE_PRE_QUIT = 6;
public function BacteriaHysteria(){
var _local1:Object;
var _local2:String;
markArr = new Array();
super();
m_mainTimer = new Timer(this, TICKS_PER_SEC);
addEventListener("enterFrame", drive);
mcLevelSign.addEventListener(MouseEvent.CLICK, levelSignPressed);
mcIntro.addEventListener(MouseEvent.CLICK, introPressed);
mcButtons.mcExitGame.addEventListener(MouseEvent.CLICK, quitButtonClicked);
mcButtons.mcToggleSound.addEventListener(MouseEvent.CLICK, soundButtonClicked);
mcLevelSign.mcSign.mcGubbe1.visible = false;
mcLevelSign.mcSign.mcGubbe2.visible = false;
mcLevelSign.mcSign.mcGubbe3.visible = false;
communicator = new Communicator();
gameTime = (TICKS_PER_SEC * 120);
if (DEBUG_MODE){
_local1 = new Object();
_local1.message = DEBUG_GAME_DATA;
_local1.success = true;
} else {
_local1 = ExternalInterface.call("getGameData");
};
if ((((_local1 == null)) || (!(_local1.success)))){
trace(("oa kuka ur " + _local1));
} else {
_local2 = _local1.message;
parsedGameData = GameDataParser.parseGameData(_local2);
random = new MtRandom(parsedGameData.randomSeed);
coinRandom = new MtRandom(random.nextInt(5000));
userType = parsedGameData.userType;
mcIntro.mcIntroText.txtInstruction.text = parsedGameData.textMappings["instruction"];
mcIntro.mcTexts.txtColorBombTitle.text = parsedGameData.textMappings["color_bomb_title"];
mcIntro.mcTexts.txtColorBombText.text = parsedGameData.textMappings["color_bomb_text"];
mcIntro.mcTexts.txtGhostTitle.text = parsedGameData.textMappings["ghost_title"];
mcIntro.mcTexts.txtGhostText.text = parsedGameData.textMappings["ghost_text"];
mcIntro.mcTexts.txtStarTitle.text = parsedGameData.textMappings["star_title"];
mcIntro.mcTexts.txtStarText.text = parsedGameData.textMappings["star_text"];
mcIntro.mcTexts.txtVitaminTitle.text = parsedGameData.textMappings["vitamin_title"];
mcIntro.mcTexts.txtVitaminText.text = parsedGameData.textMappings["vitamin_text"];
mcLevelSign.mcSign.txtRoundScoreLabel.text = parsedGameData.textMappings["txtRoundScoreLabel"];
mcLevelSign.mcSign.txtItemsLiftedLabel.text = parsedGameData.textMappings["txtItemsLiftedLabel"];
mcLevelSign.mcSign.txtBonusScoreLabel.text = parsedGameData.textMappings["txtBonusScoreLabel"];
mcLevelSign.mcSign.txtTotalScoreLabel.text = parsedGameData.textMappings["txtTotalScoreLabel"];
mcLevelSign.mcSign.txtClickToCont.text = parsedGameData.textMappings["txtClickToCont"];
mcIntro.mcClickToStart.txtClickToStart.text = parsedGameData.textMappings["txtClickToStart"];
mcScoreSign.txtLinesLeftLabel.text = parsedGameData.textMappings["txtLinesLeftLabel"];
mcScoreSign.txtLevelLabel.text = parsedGameData.textMappings["txtLevelLabel"];
mcScoreSign.txtScoreLabel.text = parsedGameData.textMappings["txtScoreLabel"];
showInfoScreen();
};
}
public function introPressed(_arg1:Event){
if (gameState == STATE_SHOW_INFO_SCREEN){
ticksLeft = 1;
};
}
public function gamePreQuit():void{
gameState = STATE_PRE_QUIT;
ticksLeft = 75;
communicator.gameEnd(score);
}
public function startRound():void{
communicator.startRound((currentTick + 1), mcGame.getNumRandoms(), clientVersion);
mcLevelSign.gotoAndStop(1);
Sounds.stopIntroMusic();
Sounds.startGameMusic();
level++;
runGubbe = false;
mcScoreSign.txtLevel.text = level;
gameState = STATE_PLAY_GAME;
mcGame.startRound(level, random, coinRandom, userType, communicator, this, currentTick);
}
public function endGame(_arg1, _arg2, _arg3, _arg4):void{
communicator.lastTick(currentTick, mcGame.getNumRandoms());
if (_arg1){
Sounds.playEndGood();
mcLevelSign.mcSign.txtCleared.text = parsedGameData.textMappings["txtGameCleared"];
mcLevelSign.mcSign.mcGubbe2.visible = false;
mcLevelSign.mcSign.mcGubbe3.visible = true;
gubbTarget = mcLevelSign.mcSign.mcGubbe3;
} else {
Sounds.playEndBad();
mcGame.mcLid.visible = false;
mcJar.mcJar.gotoAndStop(2);
mcJar.play();
mcLevelSign.mcSign.txtCleared.text = parsedGameData.textMappings["txtGameFailed"];
};
mcLevelSign.mcSign.txtRoundScore.text = _arg2;
mcLevelSign.mcSign.txtItemsLifted.text = _arg3;
mcLevelSign.mcSign.txtTotalScore.text = score;
mcLevelSign.mcSign.txtBonusScore.text = _arg4;
animCounter = 0;
ticksLeft = (TICKS_PER_SEC * 10);
gameState = STATE_END_GAME;
}
public function gameQuit():void{
communicator.gameQuit();
}
public function levelSignPressed(_arg1:Event){
if ((((gameState == STATE_BETWEEN_ROUNDS)) || ((gameState == STATE_END_GAME)))){
ticksLeft = 12;
};
}
private function drive(_arg1:Event){
if (firstFrame){
firstFrame = false;
};
m_mainTimer.advanceTime2();
}
public function endRound(_arg1, _arg2, _arg3, _arg4):void{
score = (score + _arg2);
if (userType == 0){
openGameEnd(_arg2, _arg3, _arg4);
} else {
if (((_arg1) && ((level < 3)))){
betweenRounds(_arg2, _arg3, _arg4);
} else {
endGame(_arg1, _arg2, _arg3, _arg4);
};
};
}
public function render(_arg1:Number, _arg2:Number):void{
if (noOfRend == 0){
startTime = getTimer();
};
noOfRend++;
var _local3:* = (getTimer() - startTime);
if (_local3 > 2000){
txtFPS.text = String(Math.round(((noOfRend * 1000) / _local3)));
noOfRend = 0;
};
switch (gameState){
case STATE_SHOW_INFO_SCREEN:
break;
case STATE_PLAY_GAME:
mcGame.render(_arg1, _arg2);
break;
case STATE_BETWEEN_ROUNDS:
mcGame.render(_arg1, _arg2);
mcLevelSign.mcSign.txtTimeLeft.text = parsedGameData.textMappings["round_starts_in"].split("[0]").join(("" + Math.round((ticksLeft / TICKS_PER_SEC))));
if ((((animCounter == 15)) && (!(runGubbe)))){
mcLevelSign.gotoAndStop(animCounter);
runGubbe = true;
gubbTarget.gotoAndPlay(2);
} else {
if (animCounter != 15){
mcLevelSign.gotoAndStop(animCounter);
};
};
break;
case STATE_END_GAME:
mcLevelSign.mcSign.txtTimeLeft.text = parsedGameData.textMappings["game_ends_in"].split("[0]").join(("" + Math.round((ticksLeft / TICKS_PER_SEC))));
if ((((((animCounter == 15)) && (!(runGubbe)))) && (!((userType == 0))))){
mcLevelSign.gotoAndStop(animCounter);
runGubbe = true;
mcLevelSign.mcSign.mcGubbe3.gotoAndPlay(2);
trace("RUNNING GUBBJÄVEL");
trace(mcLevelSign.mcSign.mcGubbe3);
trace(mcLevelSign.mcSign.mcGubbe3.visible);
trace(mcLevelSign.mcSign.mcGubbe2.visible);
} else {
if (animCounter != 15){
trace("trace...");
mcLevelSign.gotoAndStop(animCounter);
};
};
mcLevelSign.gotoAndStop(animCounter);
break;
};
}
public function showInfoScreen():void{
Sounds.startIntroMusic();
ticksLeft = INTRO_LENGTH;
gameState = STATE_SHOW_INFO_SCREEN;
}
public function updateScoreSign(_arg1:Number, _arg2:Number){
if (Number(this["mcScoreSign"].txtScore.text) != (score + _arg1)){
this["mcScoreSign"].txtScore.text = Number((score + _arg1));
};
if (Number(this["mcScoreSign"].txtLinesLeft.text) != _arg2){
this["mcScoreSign"].txtLinesLeft.text = _arg2;
};
}
public function quitButtonClicked(_arg1:Event){
if (!endGameClicked){
endGameClicked = true;
if (gameState == STATE_SHOW_INFO_SCREEN){
gamePreQuit();
} else {
if (gameState != STATE_END_GAME){
mcGame.gameOver();
};
};
};
}
public function tick(_arg1:Number):void{
currentTick = _arg1;
switch (gameState){
case STATE_SHOW_INFO_SCREEN:
mcIntro.gotoAndStop((INTRO_LENGTH - ticksLeft));
ticksLeft = (ticksLeft - 1);
mcIntro.txtGameStartsIn.text = parsedGameData.textMappings["game_starts_in"].split("[0]").join(("" + Math.round((ticksLeft / TICKS_PER_SEC))));
if ((INTRO_LENGTH - ticksLeft) == 155){
mcIntro.mcIntroText.txtInstruction.text = parsedGameData.textMappings["instruction2"];
} else {
if ((INTRO_LENGTH - ticksLeft) == 310){
mcIntro.mcIntroText.txtInstruction.text = parsedGameData.textMappings["instruction3"];
};
};
if (ticksLeft <= 0){
communicator.gameStarted();
mcIntro.visible = false;
startRound();
};
break;
case STATE_PLAY_GAME:
mcGame.tick(_arg1, TICKS_PER_SEC);
break;
case STATE_BETWEEN_ROUNDS:
mcGame.tick(_arg1, TICKS_PER_SEC);
ticksLeft = (ticksLeft - 1);
if (ticksLeft > 11){
animCounter = Math.min((animCounter + 1), 15);
} else {
animCounter++;
};
if (ticksLeft == 0){
startRound();
};
break;
case STATE_END_GAME:
ticksLeft = (ticksLeft - 1);
if (ticksLeft > 11){
animCounter = Math.min((animCounter + 1), 15);
} else {
animCounter++;
};
if (ticksLeft == 0){
gamePreQuit();
};
break;
case STATE_NOT_RUNNING:
break;
case STATE_PRE_QUIT:
ticksLeft--;
if (ticksLeft == 0){
gameQuit();
};
break;
};
}
public function soundButtonClicked(_arg1:Event){
if (soundOn){
Sounds.soundOff();
soundOn = false;
mcButtons.gotoAndStop(2);
} else {
Sounds.soundOn();
soundOn = true;
mcButtons.gotoAndStop(1);
if (gameState == STATE_SHOW_INFO_SCREEN){
} else {
if (gameState == STATE_PLAY_GAME){
};
};
};
}
public function betweenRounds(_arg1, _arg2, _arg3):void{
Sounds.playLevelComplete();
switch (level){
case 1:
mcLevelSign.mcSign.mcGubbe1.visible = true;
gubbTarget = mcLevelSign.mcSign.mcGubbe1;
break;
case 2:
mcLevelSign.mcSign.mcGubbe1.visible = false;
mcLevelSign.mcSign.mcGubbe2.visible = true;
gubbTarget = mcLevelSign.mcSign.mcGubbe2;
break;
};
mcLevelSign.mcSign.txtCleared.text = parsedGameData.textMappings["txtLevelCleared"];
mcLevelSign.mcSign.txtRoundScore.text = _arg1;
mcLevelSign.mcSign.txtItemsLifted.text = _arg2;
mcLevelSign.mcSign.txtTotalScore.text = score;
mcLevelSign.mcSign.txtBonusScore.text = _arg3;
animCounter = 0;
ticksLeft = (TICKS_PER_SEC * 10);
gameState = STATE_BETWEEN_ROUNDS;
}
public function endGamePressed():void{
ticksLeft = (TICKS_PER_SEC * 10);
gameState = STATE_END_GAME;
}
public function openGameEnd(_arg1, _arg2, _arg3):void{
ticksLeft = (10 * TICKS_PER_SEC);
mcLevelSign.mcSign.txtCleared.text = parsedGameData.textMappings["txtOpenGameEndTitle"];
mcLevelSign.mcSign.txtOpenUserEnd.text = parsedGameData.textMappings["txtOpenGameEndText"];
mcLevelSign.mcSign.txtRoundScore.text = _arg1;
mcLevelSign.mcSign.txtItemsLifted.text = _arg2;
mcLevelSign.mcSign.txtTotalScore.text = score;
mcLevelSign.mcSign.txtBonusScore.text = _arg3;
mcLevelSign.mcSign.gotoAndStop(2);
animCounter = 0;
gameState = STATE_END_GAME;
}
}
}//package src
Section 51
//Coin (src.Coin)
package src {
import flash.display.*;
public class Coin extends MovieClip {
public var mod;// = 0
public var posY;
public var theX;
public var theY;
public var posX;
public var collapseCounter;// = 25
public var waitingTimer;// = 0
public var launchScore;
public var marked;// = false
public var collapsing;// = false
private var currentTick;
public var type;
public var squashCounterX;// = 0
public var squashCounterY;// = 0
public var firstDrop;// = true
public var mcBubble:MovieClip;
public var squashMod;// = 1
public var mcCoin:MovieClip;
public var launchBonus;// = false
public var launching;// = false
public var star;// = false
public var gotoX;
public var gotoY;
public var isCoin;// = true
public var coinValue;
public var cfe;// = false
public var deMark;// = false
public var value;
private var game:Game;
public var counter;
public var weight;
private static var WIDTH = 39;
private static var HEIGHT = 31;
private static var COLLAPSE_COUNTER = 1;
public function Coin(_arg1){
gotoAndStop(value);
if (!_arg1){
mcBubble.visible = false;
};
}
public function setGotoY(_arg1){
gotoY = _arg1;
}
public function init(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6):void{
x = ((_arg2 * WIDTH) + 46);
y = -100;
posX = _arg2;
posY = _arg1;
theX = x;
theY = y;
gotoY = ((_arg1 * HEIGHT) + 45);
gotoX = theX;
this.game = _arg4;
this.type = _arg3;
visible = true;
squashCounterY = _arg5;
collapsing = true;
counter = 300;
if (_arg6 < 16){
coinValue = 1;
weight = 3;
value = 1;
launchScore = 100;
} else {
if (_arg6 < 21){
coinValue = 2;
weight = 3;
value = 2;
launchScore = 250;
} else {
if (_arg6 < 26){
coinValue = 3;
weight = 3;
value = 3;
launchScore = 500;
} else {
if (_arg6 < 31){
coinValue = 4;
weight = 3;
value = 4;
launchScore = 1000;
} else {
if (_arg6 < 50){
coinValue = 5;
weight = 3;
value = 5;
launchScore = 2000;
} else {
if (_arg6 >= 50){
coinValue = 6;
weight = 3;
value = 6;
launchScore = 4000;
};
};
};
};
};
};
gotoAndStop(value);
}
public function setGotoX(_arg1){
gotoX = _arg1;
}
public function checked(){
cfe = true;
}
public function getMaxSpeed(){
if (firstDrop){
return (30);
};
return (15);
}
public function unChecked(){
cfe = false;
}
public function updatePosX(_arg1:Number){
posX = _arg1;
setGotoX(((_arg1 * WIDTH) + 46));
}
public function updatePosY(_arg1:Number){
posY = _arg1;
setGotoY(((_arg1 * HEIGHT) + 45));
}
public function resetCollapseCounter(){
collapseCounter = COLLAPSE_COUNTER;
}
}
}//package src
Section 52
//Explosion (src.Explosion)
package src {
import flash.display.*;
public class Explosion extends MovieClip {
public var animAt;// = 1
private var theX;
private var theY;
public var target;
public var animLength;// = 11
public var type;
public var mcExplosion:MovieClip;
public function Explosion(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
public function init(_arg1, _arg2, _arg3){
x = _arg1;
y = _arg2;
gotoAndStop((_arg3 + 1));
target = this.mcExplosion;
}
public function render(_arg1:Number, _arg2:Number):void{
}
public function tick(_arg1:Number, _arg2:Number):void{
}
}
}//package src
Section 53
//ExplosionColorBomb (src.ExplosionColorBomb)
package src {
import src.timing.*;
import flash.events.*;
import flash.display.*;
public class ExplosionColorBomb extends MovieClip {
public var type;
private var theX;
private var theY;
public var target;
public var animLength;// = 14
public var animAt;// = 1
public var mcExplosion1:MovieClip;
public var mcExplosion3:MovieClip;
public var mcExplosion4:MovieClip;
public var mcExplosion5:MovieClip;
public var mcExplosion2:MovieClip;
public function ExplosionColorBomb(){
mcExplosion1.visible = false;
mcExplosion2.visible = false;
mcExplosion3.visible = false;
mcExplosion4.visible = false;
mcExplosion5.visible = false;
}
public function render(_arg1:Number, _arg2:Number):void{
}
public function tick(_arg1:Number, _arg2:Number):void{
}
public function init(_arg1, _arg2, _arg3){
x = _arg1;
y = _arg2;
switch (_arg3){
case 0:
target = this.mcExplosion1;
break;
case 1:
target = this.mcExplosion2;
break;
case 2:
target = this.mcExplosion3;
break;
case 3:
target = this.mcExplosion4;
break;
case 4:
target = this.mcExplosion5;
break;
};
target.visible = true;
}
}
}//package src
Section 54
//Game (src.Game)
package src {
import src.timing.*;
import flash.events.*;
import flash.display.*;
import flash.ui.*;
public class Game extends MovieClip {
private var valveLaunchArr;
private var firstCoinBubbleRef:Coin;
private var tryNextTick;// = false
private var coinArr;
private var ghostFloatArr;
private var lastMarkPiece;
private var rightRowEffected;
private var runGhosts;// = false
public var mcFiller1:MovieClip;
public var mcFiller2:MovieClip;
public var mcFiller3:MovieClip;
public var mcFiller4:MovieClip;
public var mcFiller5:MovieClip;
public var mcFiller6:MovieClip;
public var mcFiller7:MovieClip;
public var mcFiller8:MovieClip;
public var mcFiller9:MovieClip;
private var communicator;
private var refillBoard;
private var gameGrid;
private var flashArr;
private var bombChanse;
private var pillArr;
private var sInc;
private var scoreArr;
private var fLV;
public var fullLaunchCounter;// = 0
private var inputString;
private var numPieces;// = 0
private var collapseBoardHorizontally;
private var markedArr;
public var mcFiller:MovieClip;
private var valveArr;
private var coinRandom;
private var currentTick;
private var random;
private var launchCounter;// = 0
private var refillCounter;
private var xFloatArr;
private var explosionArr;
public var mcLid:MovieClip;
private var noOfLaunched;
private var linePush;
private var runningFlashArr;
private var roundBonus;
public var mcValve10:Valve;
public var mcValve11:Valve;
public var mcValve12:Valve;
public var mcFiller10:MovieClip;
public var mcFiller11:MovieClip;
public var mcFiller12:MovieClip;
private var coinsCleared;// = 0
private var ghostArr;
private var noOfCollapse;
private var coinLevelCap;
private var firstCoin;// = true
private var valveLaunch;// = false
private var leftRowEffected;
private var colorMod1;
private var colorMod2;
private var colorMod3;
private var noOfRandoms;// = 0
private var gameGridObj;
private var roundOver;
private var delay;
private var level;
private var launched;// = false
private var collapseBoardVertically;
private var playedFlushSound;// = false
private var roundScore;// = 0
private var linesLeft;
private var launchArr;
private var gameState;
private var explodeArr;
private var completeWaterAnims;// = false
public var mcValve1:Valve;
public var mcValve2:Valve;
public var mcValve3:Valve;
public var mcValve4:Valve;
public var mcValve5:Valve;
public var mcValve6:Valve;
public var mcValve7:Valve;
public var mcValve8:Valve;
public var mcValve9:Valve;
private var noOfTypes;
private var ghostTargetsArr;
private var firstCoinBubbleCounter;// = -1
private var gameRoot;
private var yFloatArr;
private static var BOARD_HEIGHT = 16;
private static var LAUNCH_COUNTER_HANG = 137;
private static var LAUNCH_COUNTER_LAUNCH = 75;
private static var STATE_NOT_RUNNING = 1;
private static var TICKS_PER_SEC = 30;
private static var RAW_BONUS = 1000;
private static var STATE_RUNNING = 0;
private static var LAUNCH_COUNTER_DESC = 125;
private static var BOMB_CHANSE = 1;
private static var BOARD_START_LIMIT = 7;
private static var LINE_PUSH_TIMER = 105;
private static var BOARD_WIDTH = 12;
private static var STAR_CHANSE = 1;
private static var LAUNCH_BONUS = 5;
private static var GHOST_CHANSE = 1;
private static var STAR_MOD = 2;
private static var REFILL_TIME = 10;
private static var GHOST_PIECE_SCORE = 20;
public function Game(){
var _local1:*;
gameGrid = new Array();
gameGridObj = new Array();
explodeArr = new Array();
xFloatArr = new Array();
yFloatArr = new Array();
valveArr = new Array();
valveLaunchArr = new Array();
launchArr = new Array();
markedArr = new Array();
explosionArr = new Array();
scoreArr = new Array();
ghostArr = new Array();
ghostTargetsArr = new Array();
ghostFloatArr = new Array();
coinArr = new Array();
pillArr = new Array();
flashArr = new Array();
runningFlashArr = new Array();
super();
gameState = STATE_NOT_RUNNING;
valveArr.push(mcValve1);
valveArr.push(mcValve2);
valveArr.push(mcValve3);
valveArr.push(mcValve4);
valveArr.push(mcValve5);
valveArr.push(mcValve6);
valveArr.push(mcValve7);
valveArr.push(mcValve8);
valveArr.push(mcValve9);
valveArr.push(mcValve10);
valveArr.push(mcValve11);
valveArr.push(mcValve12);
_local1 = 0;
while (_local1 < BOARD_WIDTH) {
runningFlashArr.push(false);
_local1++;
};
_local1 = 0;
while (_local1 < valveArr.length) {
valveArr[_local1].init(_local1, this);
valveLaunchArr[_local1] = 0;
valveArr[_local1].mouseEnabled = false;
_local1++;
};
mcFiller1.addEventListener(MouseEvent.CLICK, valveArr[0].valveClicked);
mcFiller2.addEventListener(MouseEvent.CLICK, valveArr[1].valveClicked);
mcFiller3.addEventListener(MouseEvent.CLICK, valveArr[2].valveClicked);
mcFiller4.addEventListener(MouseEvent.CLICK, valveArr[3].valveClicked);
mcFiller5.addEventListener(MouseEvent.CLICK, valveArr[4].valveClicked);
mcFiller6.addEventListener(MouseEvent.CLICK, valveArr[5].valveClicked);
mcFiller7.addEventListener(MouseEvent.CLICK, valveArr[6].valveClicked);
mcFiller8.addEventListener(MouseEvent.CLICK, valveArr[7].valveClicked);
mcFiller9.addEventListener(MouseEvent.CLICK, valveArr[8].valveClicked);
mcFiller10.addEventListener(MouseEvent.CLICK, valveArr[9].valveClicked);
mcFiller11.addEventListener(MouseEvent.CLICK, valveArr[10].valveClicked);
mcFiller12.addEventListener(MouseEvent.CLICK, valveArr[11].valveClicked);
stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
mcFiller.addEventListener(MouseEvent.MOUSE_OVER, clearMarked);
}
public function removeLaunched(){
var _local2:*;
var _local3:*;
var _local4:*;
var _local1:* = 0;
while (_local1 < launchArr.length) {
if (launchArr[_local1].success){
_local2 = 0;
while (_local2 < launchArr[_local1].colsArr.length) {
_local3 = 0;
while (_local3 < BOARD_HEIGHT) {
if (gameGridObj[_local3][launchArr[_local1].colsArr[_local2]] != null){
if (gameGridObj[_local3][launchArr[_local1].colsArr[_local2]].isCoin){
_local4 = 0;
while (_local4 < coinArr.length) {
if (gameGridObj[_local3][launchArr[_local1].colsArr[_local2]] == coinArr[_local4]){
coinArr.splice(_local4, 1);
_local4 = coinArr.length;
};
_local4++;
};
};
removeChild(gameGridObj[_local3][launchArr[_local1].colsArr[_local2]]);
gameGridObj[_local3][launchArr[_local1].colsArr[_local2]] = null;
};
_local3++;
};
_local2++;
};
};
_local1++;
};
}
public function printBoard(){
var _local2:*;
var _local3:*;
var _local1:* = 0;
while (_local1 < BOARD_HEIGHT) {
_local2 = "";
_local3 = 0;
while (_local3 < BOARD_WIDTH) {
if (gameGridObj[_local1][_local3] != null){
_local2 = (_local2 + (gameGridObj[_local1][_local3].type + ","));
} else {
_local2 = (_local2 + "X,");
};
_local3++;
};
trace(_local2);
_local1++;
};
}
public function sendBoard(){
var _local3:*;
var _local1:* = "";
var _local2:* = 0;
while (_local2 < BOARD_HEIGHT) {
_local3 = 0;
while (_local3 < BOARD_WIDTH) {
if (gameGridObj[_local2][_local3] != null){
_local1 = (_local1 + (gameGridObj[_local2][_local3].type + ","));
} else {
_local1 = (_local1 + "X,");
};
_local3++;
};
if (_local3 != (BOARD_WIDTH - 1)){
_local1 = (_local1 + "_");
};
_local2++;
};
communicator.sendBoard((currentTick + 1), _local1);
}
public function startRound(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7):void{
fullLaunchCounter = 0;
currentTick = _arg7;
Sounds.playLevelStart();
level = _arg1;
random = _arg2;
coinRandom = _arg3;
communicator = _arg5;
gameRoot = _arg6;
roundBonus = 0;
flashArr.push(gameRoot.mcFlash1);
flashArr.push(gameRoot.mcFlash2);
flashArr.push(gameRoot.mcFlash3);
flashArr.push(gameRoot.mcFlash4);
flashArr.push(gameRoot.mcFlash5);
flashArr.push(gameRoot.mcFlash6);
flashArr.push(gameRoot.mcFlash7);
flashArr.push(gameRoot.mcFlash8);
flashArr.push(gameRoot.mcFlash9);
flashArr.push(gameRoot.mcFlash10);
flashArr.push(gameRoot.mcFlash11);
flashArr.push(gameRoot.mcFlash12);
var _local8:* = 0;
while (_local8 < BOARD_WIDTH) {
flashArr[_local8].mouseEnabled = false;
_local8++;
};
if (level < 3){
noOfTypes = 3;
} else {
noOfTypes = 3;
};
linePush = (LINE_PUSH_TIMER - (15 * Math.min(level, 2)));
bombChanse = BOMB_CHANSE;
if (level == 3){
bombChanse = (BOMB_CHANSE * 2);
};
refillBoard = false;
collapseBoardHorizontally = false;
collapseBoardVertically = false;
runGhosts = false;
roundOver = false;
gameRoot.mcTray.gotoAndStop(1);
switch (level){
case 1:
linesLeft = 25;
break;
case 2:
linesLeft = 30;
break;
case 3:
linesLeft = 35;
break;
};
roundScore = 0;
coinsCleared = 0;
coinLevelCap = (level * 5);
colorMod1 = getRandom(5);
colorMod2 = getRandom(5);
colorMod3 = getRandom(5);
while (colorMod1 == colorMod2) {
colorMod2 = getRandom(5);
};
while ((((colorMod1 == colorMod3)) || ((colorMod2 == colorMod3)))) {
colorMod3 = getRandom(5);
};
createBoard();
gameRoot.mcJar.mcJar.txtCoinCap.text = coinLevelCap;
gameRoot.mcJar.mcJar.txtCoinCounter.text = 0;
gameState = STATE_RUNNING;
}
public function collapseBoardHorizontallyFunc(){
var _local5:*;
var _local6:*;
noOfCollapse = 0;
var _local1:* = 0;
var _local2:* = undefined;
var _local3:* = false;
var _local4:* = (BOARD_HEIGHT - 1);
while (_local4 > 0) {
_local5 = 0;
while (_local5 < BOARD_WIDTH) {
if (gameGridObj[_local4][_local5] == null){
if (_local2 == undefined){
_local2 = _local4;
};
_local1 = (_local2 - _local4);
_local6 = (_local4 - 1);
while (_local6 >= 0) {
if (gameGridObj[_local6][_local5] != null){
noOfCollapse++;
gameGridObj[_local4][_local5] = gameGridObj[_local6][_local5];
gameGridObj[_local4][_local5].updatePosY(_local4);
gameGridObj[_local4][_local5].waitingTimer = (_local1 + 5);
gameGridObj[_local4][_local5].collapsing = true;
gameGridObj[_local4][_local5].resetCollapseCounter();
xFloatArr[_local4][_local5] = xFloatArr[_local6][_local5];
yFloatArr[_local4][_local5] = yFloatArr[_local6][_local5];
gameGridObj[_local6][_local5] = null;
_local3 = true;
break;
};
_local6--;
};
};
_local5++;
};
_local4--;
};
collapseBoardHorizontally = true;
}
public function addScore(_arg1:Piece, _arg2){
var _local3:* = new Score(_arg1.x, _arg1.y, _arg2);
addChild(_local3);
scoreArr.push(_local3);
}
public function valveClicked(_arg1){
if (fullLaunchCounter == 0){
communicator.valveClicked((currentTick + 1), _arg1.id);
Sounds.playValveClicked();
};
if (!launched){
_arg1.mcValveTrigger.gotoAndPlay(1);
if (!valveLaunch){
launchCounter = 0;
valveLaunch = true;
Sounds.playLaunchCount();
};
valveLaunchArr[_arg1.id] = 1;
return (true);
};
return (false);
}
public function collapseBoardVerticallyFunc(){
var _local3:*;
var _local4:*;
var _local5:*;
var _local1:* = false;
leftRowEffected = 1;
rightRowEffected = 1;
var _local2:* = 0;
_local3 = ((BOARD_WIDTH / 2) - 1);
while (_local3 > 0) {
if (gameGridObj[(BOARD_HEIGHT - 1)][_local3] == null){
_local4 = _local3;
while (_local4 >= 0) {
if (gameGridObj[(BOARD_HEIGHT - 1)][_local4] != null){
leftRowEffected++;
_local5 = 0;
while (_local5 < BOARD_HEIGHT) {
if (gameGridObj[_local5][_local4] != null){
noOfCollapse++;
gameGridObj[_local5][_local3] = gameGridObj[_local5][_local4];
gameGridObj[_local5][_local3].updatePosX(_local3);
gameGridObj[_local5][_local3].collapsing = true;
gameGridObj[_local5][_local3].resetCollapseCounter();
gameGridObj[_local5][_local3].waitingTimer = (BOARD_HEIGHT - _local5);
xFloatArr[_local5][_local3] = xFloatArr[_local5][_local4];
yFloatArr[_local5][_local3] = yFloatArr[_local5][_local4];
gameGridObj[_local5][_local4] = null;
_local1 = true;
};
_local5++;
};
break;
};
_local4--;
};
};
_local3--;
};
_local3 = (BOARD_WIDTH / 2);
while (_local3 < (BOARD_WIDTH - 1)) {
if (gameGridObj[(BOARD_HEIGHT - 1)][_local3] == null){
_local4 = _local3;
while (_local4 < BOARD_WIDTH) {
if (gameGridObj[(BOARD_HEIGHT - 1)][_local4] != null){
rightRowEffected++;
_local5 = 0;
while (_local5 < BOARD_HEIGHT) {
if (gameGridObj[_local5][_local4] != null){
noOfCollapse++;
gameGridObj[_local5][_local3] = gameGridObj[_local5][_local4];
gameGridObj[_local5][_local3].updatePosX(_local3);
gameGridObj[_local5][_local3].collapsing = true;
gameGridObj[_local5][_local3].waitingTimer = (BOARD_HEIGHT - _local5);
xFloatArr[_local5][_local3] = xFloatArr[_local5][_local4];
yFloatArr[_local5][_local3] = yFloatArr[_local5][_local4];
gameGridObj[_local5][_local4] = null;
_local1 = true;
};
_local5++;
};
break;
};
_local4++;
};
};
_local3++;
};
if (_local1){
Sounds.playContraction();
collapseBoardVertically = true;
};
}
public function score(_arg1){
communicator.sendScore((currentTick + 1), _arg1);
roundScore = (roundScore + _arg1);
}
public function clearBoard(){
var _local1:*;
var _local2:*;
_local1 = 0;
while (_local1 < BOARD_HEIGHT) {
_local2 = 0;
while (_local2 < BOARD_WIDTH) {
if (gameGridObj[_local1][_local2] != null){
removeChild(gameGridObj[_local1][_local2]);
gameGridObj[_local1][_local2] = null;
};
_local2++;
};
_local1++;
};
coinArr = [];
_local1 = 0;
while (_local1 < BOARD_WIDTH) {
runningFlashArr[_local1] = false;
flashArr[_local1].gotoAndStop(1);
_local1++;
};
}
public function checkPieceMark(_arg1:Piece){
markedArr.push(_arg1);
_arg1.checkedMark();
if (_arg1.posY > 0){
if (gameGridObj[(_arg1.posY - 1)][_arg1.posX] != null){
if ((((gameGridObj[(_arg1.posY - 1)][_arg1.posX].type == _arg1.type)) && ((gameGridObj[(_arg1.posY - 1)][_arg1.posX].cfeMark == false)))){
checkPieceMark(gameGridObj[(_arg1.posY - 1)][_arg1.posX]);
};
};
};
if (_arg1.posY < (BOARD_HEIGHT - 1)){
if (gameGridObj[(_arg1.posY + 1)][_arg1.posX] != null){
if ((((gameGridObj[(_arg1.posY + 1)][_arg1.posX].type == _arg1.type)) && ((gameGridObj[(_arg1.posY + 1)][_arg1.posX].cfeMark == false)))){
checkPieceMark(gameGridObj[(_arg1.posY + 1)][_arg1.posX]);
};
};
};
if (_arg1.posX > 0){
if (gameGridObj[_arg1.posY][(_arg1.posX - 1)] != null){
if ((((gameGridObj[_arg1.posY][(_arg1.posX - 1)].type == _arg1.type)) && ((gameGridObj[_arg1.posY][(_arg1.posX - 1)].cfeMark == false)))){
checkPieceMark(gameGridObj[_arg1.posY][(_arg1.posX - 1)]);
};
};
};
if (_arg1.posX < (BOARD_WIDTH - 1)){
if (gameGridObj[_arg1.posY][(_arg1.posX + 1)] != null){
if ((((gameGridObj[_arg1.posY][(_arg1.posX + 1)].type == _arg1.type)) && ((gameGridObj[_arg1.posY][(_arg1.posX + 1)].cfeMark == false)))){
checkPieceMark(gameGridObj[_arg1.posY][(_arg1.posX + 1)]);
};
};
};
}
public function createPills(_arg1, _arg2){
var _local3:*;
var _local4:*;
_local3 = 0;
while (_local3 < _arg1) {
_local4 = new Pill(0, pillArr.length);
addChild(_local4);
pillArr.push(_local4);
_local3++;
};
_local3 = 0;
while (_local3 < _arg2) {
_local4 = new Pill(1, pillArr.length);
addChild(_local4);
pillArr.push(_local4);
_local3++;
};
}
public function checkPiece(_arg1:Piece){
explodeArr.push(_arg1);
_arg1.checked();
if (_arg1.posY > 0){
if (gameGridObj[(_arg1.posY - 1)][_arg1.posX] != null){
if ((((gameGridObj[(_arg1.posY - 1)][_arg1.posX].type == _arg1.type)) && ((gameGridObj[(_arg1.posY - 1)][_arg1.posX].cfe == false)))){
checkPiece(gameGridObj[(_arg1.posY - 1)][_arg1.posX]);
};
};
};
if (_arg1.posY < (BOARD_HEIGHT - 1)){
if (gameGridObj[(_arg1.posY + 1)][_arg1.posX] != null){
if ((((gameGridObj[(_arg1.posY + 1)][_arg1.posX].type == _arg1.type)) && ((gameGridObj[(_arg1.posY + 1)][_arg1.posX].cfe == false)))){
checkPiece(gameGridObj[(_arg1.posY + 1)][_arg1.posX]);
};
};
};
if (_arg1.posX > 0){
if (gameGridObj[_arg1.posY][(_arg1.posX - 1)] != null){
if ((((gameGridObj[_arg1.posY][(_arg1.posX - 1)].type == _arg1.type)) && ((gameGridObj[_arg1.posY][(_arg1.posX - 1)].cfe == false)))){
checkPiece(gameGridObj[_arg1.posY][(_arg1.posX - 1)]);
};
};
};
if (_arg1.posX < (BOARD_WIDTH - 1)){
if (gameGridObj[_arg1.posY][(_arg1.posX + 1)] != null){
if ((((gameGridObj[_arg1.posY][(_arg1.posX + 1)].type == _arg1.type)) && ((gameGridObj[_arg1.posY][(_arg1.posX + 1)].cfe == false)))){
checkPiece(gameGridObj[_arg1.posY][(_arg1.posX + 1)]);
};
};
};
}
public function clearMarked(_arg1:Event){
var _local2:* = 0;
while (_local2 < markedArr.length) {
markedArr[_local2].deMark = true;
_local2++;
};
markedArr = [];
}
public function scoreLaunch(){
var _local6:*;
var _local7:*;
var _local1:* = 0;
var _local2:* = 1;
var _local3:* = 0;
var _local4:* = 0;
var _local5:* = 0;
while (_local5 < launchArr.length) {
if (launchArr[_local5].success){
_local6 = 0;
while (_local6 < launchArr[_local5].colsArr.length) {
_local7 = 0;
while (_local7 < BOARD_HEIGHT) {
if (gameGridObj[_local7][launchArr[_local5].colsArr[_local6]] != null){
_local1 = (_local1 + gameGridObj[_local7][launchArr[_local5].colsArr[_local6]].launchScore);
if (gameGridObj[_local7][launchArr[_local5].colsArr[_local6]].launchBonus){
_local2 = (_local2 + 0.5);
};
if (gameGridObj[_local7][launchArr[_local5].colsArr[_local6]].isCoin){
coinsCleared = (coinsCleared + gameGridObj[_local7][launchArr[_local5].colsArr[_local6]].coinValue);
if (gameGridObj[_local7][launchArr[_local5].colsArr[_local6]].coinValue < 4){
_local4 = (_local4 + gameGridObj[_local7][launchArr[_local5].colsArr[_local6]].coinValue);
} else {
_local3 = (_local3 + (gameGridObj[_local7][launchArr[_local5].colsArr[_local6]].coinValue - 3));
};
gameRoot.mcJar.mcJar.txtCoinCounter.text = coinsCleared;
};
};
_local7++;
};
_local6++;
};
};
_local5++;
};
createPills(_local4, _local3);
_local1 = Math.round((_local1 * _local2));
gameRoot.mcJar.mcJar.mcMedScore.mcScore.txtScore.text = _local1;
gameRoot.mcJar.mcJar.mcMedScore.gotoAndPlay(2);
if (coinsCleared >= coinLevelCap){
gameRoot.mcTray.gotoAndPlay(2);
};
score(_local1);
}
public function ghostEatBacteria(_arg1, _arg2){
if (((((!((_arg1 == null))) && (!(_arg1.isCoin)))) && (!(_arg1.launchBonus)))){
addExplosion(_arg1, 0);
addScore(_arg1, GHOST_PIECE_SCORE);
score(GHOST_PIECE_SCORE);
setChildIndex(ghostArr[_arg2], (numChildren - 1));
removeChild(_arg1);
gameGridObj[_arg1.posY][_arg1.posX] = null;
};
ghostTargetsArr[_arg2].splice(0, 1);
}
public function mouseOver(_arg1:Piece){
var _local2:*;
var _local3:*;
var _local4:*;
if (launchCounter < LAUNCH_COUNTER_DESC){
_local2 = false;
_local3 = 0;
while (_local3 < markedArr.length) {
if (_arg1 == markedArr[_local3]){
_local2 = true;
};
_local3++;
};
if (!_local2){
_local4 = 0;
while (_local4 < markedArr.length) {
markedArr[_local4].deMark = true;
_local4++;
};
markedArr = [];
checkPieceMark(_arg1);
if (markedArr.length > 2){
_local4 = 0;
while (_local4 < markedArr.length) {
markedArr[_local4].mcAnim.gotoAndPlay(50);
markedArr[_local4].marked = true;
_local4++;
};
};
_local4 = 0;
while (_local4 < markedArr.length) {
markedArr[_local4].unCheckedMark();
_local4++;
};
};
};
}
public function fullLaunch(){
fullLaunchCounter = 1;
fLV = 0;
roundOver = true;
}
public function createBoard(){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:Piece;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
var _local1:* = 0;
while (_local1 < BOARD_HEIGHT) {
_local2 = new Array();
_local3 = new Array();
_local4 = new Array();
_local5 = 0;
while (_local5 < BOARD_WIDTH) {
if (_local1 >= (BOARD_HEIGHT - BOARD_START_LIMIT)){
_local6 = new Piece();
_local7 = getRandom(noOfTypes);
switch (_local7){
case 0:
_local7 = colorMod1;
break;
case 1:
_local7 = colorMod2;
break;
case 2:
_local7 = colorMod3;
break;
};
_local8 = false;
_local9 = false;
_local10 = false;
_local11 = false;
if (getRandom(100) < bombChanse){
_local8 = true;
} else {
if (getRandom(100) < GHOST_CHANSE){
_local10 = true;
} else {
if (getRandom(1000) < LAUNCH_BONUS){
_local11 = true;
};
};
};
_local6.init(_local1, _local5, _local7, this, 0, _local8, _local9, _local10, _local11);
addChild(_local6);
_local2.push(_local6);
_local12 = new IFloat(_local6.theX);
_local13 = new IFloat(_local6.theY);
_local3.push(_local12);
_local4.push(_local13);
} else {
_local2.push(null);
};
_local5++;
};
gameGridObj[_local1] = _local2;
xFloatArr[_local1] = _local3;
yFloatArr[_local1] = _local4;
_local1++;
};
}
public function pieceClicked(_arg1:Piece){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
if (((((((((!(refillBoard)) && (!(collapseBoardHorizontally)))) && (!(collapseBoardVertically)))) && (!(launched)))) && (!(runGhosts)))){
communicator.pieceClicked((currentTick + 1), _arg1.posY, _arg1.posX);
communicator.sendRandom((currentTick + 1), getNumRandoms());
explodeArr = [];
if (_arg1.colorBomb){
Sounds.playColorBomb();
_local2 = _arg1.type;
_local3 = 0;
while (_local3 < BOARD_HEIGHT) {
_local4 = 0;
while (_local4 < BOARD_WIDTH) {
if (gameGridObj[_local3][_local4] != null){
if ((((gameGridObj[_local3][_local4].type == (_local2 - 5))) || ((gameGridObj[_local3][_local4].type == _local2)))){
addExplosion(gameGridObj[_local3][_local4], 1);
removeChild(gameGridObj[_local3][_local4]);
gameGridObj[_local3][_local4] = null;
};
};
_local4++;
};
_local3++;
};
collapseBoardHorizontallyFunc();
} else {
if (_arg1.launchBonus){
gameGridObj[_arg1.posY][_arg1.posX] = null;
addExplosion(_arg1, 0);
removeChild(_arg1);
collapseBoardHorizontallyFunc();
score(100);
addScore(_arg1, 100);
} else {
checkPiece(_arg1);
if (explodeArr.length > 2){
Sounds.playClickPieceTrue();
numPieces = 0;
_local5 = false;
_local6 = new Array();
_local7 = new Array();
_local3 = 0;
while (_local3 < explodeArr.length) {
if (gameGridObj[explodeArr[_local3].posY][explodeArr[_local3].posX].star){
_local5 = true;
};
if (gameGridObj[explodeArr[_local3].posY][explodeArr[_local3].posX].ghost){
_local6.push(explodeArr[_local3].posY);
_local7.push(explodeArr[_local3].posX);
};
gameGridObj[explodeArr[_local3].posY][explodeArr[_local3].posX] = null;
numPieces = (numPieces + 1);
valveArr[explodeArr[_local3].posX].powerCounter++;
addExplosion(explodeArr[_local3], 0);
removeChild(explodeArr[_local3]);
_local3++;
};
_local3 = 0;
while (_local3 < valveArr.length) {
valveArr[_local3].setPower();
_local3++;
};
_local8 = (numPieces + ((numPieces - 3) * 2));
if (_local5){
_local8 = Math.round((_local8 * STAR_MOD));
};
score(_local8);
addScore(_arg1, _local8);
if (_local6.length > 0){
createGhosts(_local6, _local7);
} else {
collapseBoardHorizontallyFunc();
createCoin(numPieces);
};
} else {
Sounds.playClickPieceFalse();
_local4 = 0;
while (_local4 < explodeArr.length) {
explodeArr[_local4].unChecked();
_local4++;
};
};
};
};
};
}
public function endRound(){
var _local1:*;
gameRoot.updateScoreSign(roundScore, linesLeft);
_local1 = 0;
while (_local1 < valveArr.length) {
valveArr[_local1].mcWaterBurst.gotoAndStop(1);
_local1++;
};
gameState = STATE_NOT_RUNNING;
var _local2:* = false;
if (coinsCleared >= coinLevelCap){
_local2 = true;
};
var _local3:* = true;
_local1 = 0;
while (_local1 < BOARD_WIDTH) {
if (gameGridObj[(BOARD_HEIGHT - 1)][_local1] != null){
_local3 = false;
};
_local1++;
};
if (((!(_local2)) || (!(_local3)))){
roundBonus = 0;
};
score(roundBonus);
clearBoard();
gameRoot.updateScoreSign(roundScore, linesLeft);
gameRoot.endRound(_local2, roundScore, coinsCleared, roundBonus);
roundScore = 0;
}
public function addExplosion(_arg1:Piece, _arg2:Number){
var _local3:*;
switch (_arg2){
case 0:
_local3 = new Explosion();
break;
case 1:
_local3 = new ExplosionColorBomb();
break;
};
_local3.init(_arg1.x, _arg1.y, (_arg1.type % 5));
addChild(_local3);
explosionArr.push(_local3);
}
public function render(_arg1:Number, _arg2:Number):void{
var _local3:*;
var _local4:*;
switch (gameState){
case STATE_RUNNING:
_local3 = 0;
while (_local3 < BOARD_HEIGHT) {
_local4 = 0;
while (_local4 < BOARD_WIDTH) {
if (gameGridObj[_local3][_local4] != null){
if (gameGridObj[_local3][_local4].x != xFloatArr[_local3][_local4].get(_arg2)){
gameGridObj[_local3][_local4].x = xFloatArr[_local3][_local4].get(_arg2);
};
if (gameGridObj[_local3][_local4].y != yFloatArr[_local3][_local4].get(_arg2)){
gameGridObj[_local3][_local4].y = yFloatArr[_local3][_local4].get(_arg2);
};
if (((!((gameGridObj[_local3][_local4].squashCounterY == 0))) || (!((gameGridObj[_local3][_local4].scaleY == 1))))){
gameGridObj[_local3][_local4].scaleY = (1 - gameGridObj[_local3][_local4].squashCounterY);
};
if (((!((gameGridObj[_local3][_local4].squashCounterX == 0))) || (!((gameGridObj[_local3][_local4].scaleX == 1))))){
gameGridObj[_local3][_local4].scaleX = (1 - gameGridObj[_local3][_local4].squashCounterX);
};
if (gameGridObj[_local3][_local4].deMark){
gameGridObj[_local3][_local4].deMark = false;
gameGridObj[_local3][_local4].marked = false;
gameGridObj[_local3][_local4].mcAnim.gotoAndStop(1);
};
};
_local4++;
};
_local3++;
};
gameRoot.mcNeedle.gotoAndStop(launchCounter);
_local3 = 0;
while (_local3 < valveArr.length) {
if (valveArr[_local3].waterAt != valveArr[_local3].waterGoTo){
valveArr[_local3].mcWaterBurst.gotoAndStop(valveArr[_local3].waterGoTo);
valveArr[_local3].waterAt = valveArr[_local3].waterGoTo;
};
_local3++;
};
_local3 = 0;
while (_local3 < explosionArr.length) {
explosionArr[_local3].target.gotoAndStop(explosionArr[_local3].animAt);
if (explosionArr[_local3].animAt >= explosionArr[_local3].animLength){
removeChild(explosionArr[_local3]);
explosionArr.splice(_local3, 1);
_local3--;
};
_local3++;
};
_local3 = 0;
while (_local3 < scoreArr.length) {
scoreArr[_local3].gotoAndStop(scoreArr[_local3].animAt);
if (scoreArr[_local3].animAt >= scoreArr[_local3].animLength){
removeChild(scoreArr[_local3]);
scoreArr.splice(_local3, 1);
_local3--;
};
_local3++;
};
_local3 = 0;
while (_local3 < ghostArr.length) {
if (ghostArr[_local3].theY != ghostFloatArr[_local3].get(_arg2)){
ghostArr[_local3].y = ghostFloatArr[_local3].get(_arg2);
};
_local3++;
};
gameRoot.updateScoreSign(roundScore, linesLeft);
if (fullLaunchCounter > 0){
gameRoot.mcFinger.gotoAndStop(fullLaunchCounter);
};
break;
};
_local3 = 0;
while (_local3 < pillArr.length) {
pillArr[_local3].target.gotoAndStop(pillArr[_local3].animAt);
if (pillArr[_local3].animAt >= pillArr[_local3].animLength){
removeChild(pillArr[_local3]);
pillArr.splice(_local3, 1);
_local3--;
};
_local3++;
};
}
public function tick(_arg1:Number, _arg2:Number):void{
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:*;
var _local15:*;
currentTick = _arg1;
if (fullLaunchCounter > 0){
if (((((fullLaunchCounter % 4) == 3)) && ((fullLaunchCounter < 49)))){
valveClicked(valveArr[fLV]);
fLV++;
};
fullLaunchCounter++;
};
if (firstCoinBubbleCounter > 0){
firstCoinBubbleCounter--;
if (firstCoinBubbleCounter == 0){
firstCoinBubbleRef.mcBubble.visible = false;
};
};
var _local3:* = false;
_local4 = 0;
while (_local4 < BOARD_WIDTH) {
if (((!((gameGridObj[0][_local4] == null))) && (!(runningFlashArr[_local4])))){
_local3 = true;
runningFlashArr[_local4] = true;
} else {
if ((((gameGridObj[0][_local4] == null)) && (runningFlashArr[_local4]))){
runningFlashArr[_local4] = false;
flashArr[_local4].gotoAndStop(1);
};
};
_local4++;
};
if (_local3){
_local4 = 0;
while (_local4 < BOARD_WIDTH) {
if (runningFlashArr[_local4]){
flashArr[_local4].gotoAndPlay(2);
};
_local4++;
};
};
if (((((Math.random() * 100) < 5)) || ((tryNextTick == true)))){
_local5 = false;
_local6 = 0;
while (_local6 < BOARD_WIDTH) {
if (gameGridObj[(BOARD_HEIGHT - 1)][_local6] != null){
if (gameGridObj[(BOARD_HEIGHT - 1)][_local6].type < 5){
_local5 = true;
};
};
_local6++;
};
if (_local5){
_local7 = gameGridObj[Math.round((Math.random() * (BOARD_HEIGHT - 1)))][Math.round((Math.random() * (BOARD_WIDTH - 1)))];
_local8 = 0;
while ((((_local7 == null)) || ((_local8 < 10)))) {
_local7 = gameGridObj[Math.round((Math.random() * (BOARD_HEIGHT - 1)))][Math.round((Math.random() * (BOARD_WIDTH - 1)))];
_local8++;
};
if (((((!((_local7 == null))) && ((_local7.type < 5)))) && ((_local7.marked == false)))){
_local7.mcAnim.gotoAndPlay(1);
tryNextTick = false;
} else {
tryNextTick = true;
};
};
};
switch (gameState){
case STATE_RUNNING:
linePush--;
if (!valveLaunch){
_local4 = 0;
while (_local4 < coinArr.length) {
if (coinArr[_local4] != null){
coinArr[_local4].counter--;
if (coinArr[_local4].counter == 90){
coinArr[_local4].mcCoin.mcBrick.gotoAndPlay(1);
};
} else {
coinArr.splice(_local4, 1);
_local4--;
};
_local4++;
};
};
if (refillBoard){
_local4 = 0;
while (_local4 < BOARD_HEIGHT) {
_local6 = 0;
while (_local6 < BOARD_WIDTH) {
if (_local4 == (BOARD_HEIGHT - 1)){
if (gameGridObj[_local4][_local6].collapsing){
if (gameGridObj[_local4][_local6].waitingTimer == 0){
gameGridObj[_local4][_local6].squashCounterY = Math.max((gameGridObj[_local4][_local6].squashCounterY - 0.2), 0);
if (gameGridObj[_local4][_local6].squashCounterY == 0){
noOfCollapse--;
gameGridObj[_local4][_local6].collapsing = false;
};
} else {
gameGridObj[_local4][_local6].waitingTimer--;
};
};
} else {
if (gameGridObj[_local4][_local6] != null){
if (gameGridObj[_local4][_local6].collapsing){
if (gameGridObj[_local4][_local6].waitingTimer == 0){
_local9 = (gameGridObj[_local4][_local6].collapseCounter = Math.min((gameGridObj[_local4][_local6].collapseCounter * 2), gameGridObj[_local4][_local6].getMaxSpeed()));
gameGridObj[_local4][_local6].theY = Math.max((gameGridObj[_local4][_local6].theY - _local9), gameGridObj[_local4][_local6].gotoY);
yFloatArr[_local4][_local6].set(gameGridObj[_local4][_local6].theY);
if (gameGridObj[_local4][_local6].theY == gameGridObj[_local4][_local6].gotoY){
yFloatArr[_local4][_local6].set(gameGridObj[_local4][_local6].theY);
gameGridObj[_local4][_local6].collapsing = false;
noOfCollapse--;
};
} else {
gameGridObj[_local4][_local6].waitingTimer--;
};
};
};
};
if (noOfCollapse == 0){
refillBoard = false;
break;
};
_local6++;
};
_local4++;
};
} else {
if (runGhosts){
_local4 = 0;
while (_local4 < ghostArr.length) {
ghostArr[_local4].mcGhost.gotoAndStop(((ghostArr[_local4].animAt++ % 12) + 1));
ghostArr[_local4].pathAt = (ghostArr[_local4].pathAt + 5);
ghostFloatArr[_local4].set((ghostArr[_local4].theY = (ghostArr[_local4].theY + 5)));
if ((ghostArr[_local4].pathAt % 30) == 0){
Sounds.playMunch();
ghostEatBacteria(ghostTargetsArr[_local4][0], _local4);
};
if (ghostTargetsArr[_local4].length == 0){
valveArr[ghostArr[_local4].colNum].setPowerToMax();
removeChild(ghostArr[_local4]);
ghostArr.splice(_local4, 1);
ghostTargetsArr.splice(_local4, 1);
if (ghostArr.length == 0){
ghostFloatArr = [];
runGhosts = false;
collapseBoardHorizontallyFunc();
createCoin(numPieces);
} else {
_local4--;
};
};
_local4++;
};
} else {
if (collapseBoardHorizontally){
_local4 = 0;
while (_local4 < BOARD_HEIGHT) {
_local6 = 0;
while (_local6 < BOARD_WIDTH) {
if (gameGridObj[_local4][_local6] != null){
if (gameGridObj[_local4][_local6].collapsing){
if (gameGridObj[_local4][_local6].waitingTimer == 0){
_local9 = (gameGridObj[_local4][_local6].collapseCounter = Math.min((gameGridObj[_local4][_local6].collapseCounter * 2), gameGridObj[_local4][_local6].getMaxSpeed()));
gameGridObj[_local4][_local6].theY = Math.min((gameGridObj[_local4][_local6].theY + _local9), gameGridObj[_local4][_local6].gotoY);
yFloatArr[_local4][_local6].set(gameGridObj[_local4][_local6].theY);
if (gameGridObj[_local4][_local6].theY == gameGridObj[_local4][_local6].gotoY){
yFloatArr[_local4][_local6].set(gameGridObj[_local4][_local6].theY);
gameGridObj[_local4][_local6].squashCounterY = (gameGridObj[_local4][_local6].squashCounterY + (0.2 * gameGridObj[_local4][_local6].squashMod));
if (gameGridObj[_local4][_local6].squashCounterY >= 0.3){
gameGridObj[_local4][_local6].squashMod = -1;
};
if (gameGridObj[_local4][_local6].squashCounterY <= 0){
gameGridObj[_local4][_local6].squashCounterY = 0;
gameGridObj[_local4][_local6].squashMod = 1;
gameGridObj[_local4][_local6].collapsing = false;
if (((gameGridObj[_local4][_local6].isCoin) && (gameGridObj[_local4][_local6].firstDrop))){
gameGridObj[_local4][_local6].firstDrop = false;
Sounds.playNewPill();
};
noOfCollapse--;
};
};
if (noOfCollapse == 0){
collapseBoardHorizontally = false;
collapseBoardVerticallyFunc();
_local4 = BOARD_HEIGHT;
_local6 = BOARD_WIDTH;
};
} else {
gameGridObj[_local4][_local6].waitingTimer--;
};
};
};
_local6++;
};
_local4++;
};
if ((((noOfCollapse == 0)) && (collapseBoardHorizontally))){
collapseBoardHorizontally = false;
collapseBoardVerticallyFunc();
};
} else {
if (collapseBoardVertically){
_local10 = 0;
_local11 = true;
_local6 = 0;
while (_local6 < BOARD_WIDTH) {
_local4 = 0;
while (_local4 < BOARD_HEIGHT) {
if (((_local11) && ((_local4 == 0)))){
_local11 = false;
_local10++;
};
if (gameGridObj[_local4][_local6] != null){
if (gameGridObj[_local4][_local6].collapsing){
_local11 = true;
if (gameGridObj[_local4][_local6].waitingTimer == 0){
if (_local6 < (BOARD_WIDTH / 2)){
_local9 = (gameGridObj[_local4][_local6].collapseCounter = Math.min((gameGridObj[_local4][_local6].collapseCounter * 2), gameGridObj[_local4][_local6].getMaxSpeed()));
gameGridObj[_local4][_local6].theX = Math.min((gameGridObj[_local4][_local6].theX + _local9), gameGridObj[_local4][_local6].gotoX);
if (gameGridObj[_local4][_local6].theX == gameGridObj[_local4][_local6].gotoX){
gameGridObj[_local4][_local6].squashCounterX = (gameGridObj[_local4][_local6].squashCounterX + (0.03 * gameGridObj[_local4][_local6].squashMod));
if (gameGridObj[_local4][_local6].squashCounterX >= 0.1){
gameGridObj[_local4][_local6].squashMod = -1;
};
if (gameGridObj[_local4][_local6].squashCounterX <= 0){
xFloatArr[_local4][_local6].set(gameGridObj[_local4][_local6].gotoX);
xFloatArr[_local4][_local6].set(gameGridObj[_local4][_local6].gotoX);
gameGridObj[_local4][_local6].squashCounterX = 0;
gameGridObj[_local4][_local6].squashMod = 1;
gameGridObj[_local4][_local6].collapsing = false;
noOfCollapse--;
} else {
_local12 = ((39 * gameGridObj[_local4][_local6].squashCounterX) / 2);
_local13 = (_local12 * (rightRowEffected - _local10));
xFloatArr[_local4][_local6].set((gameGridObj[_local4][_local6].theX + _local13));
};
} else {
xFloatArr[_local4][_local6].set(gameGridObj[_local4][_local6].theX);
};
} else {
_local9 = (gameGridObj[_local4][_local6].collapseCounter = Math.min((gameGridObj[_local4][_local6].collapseCounter * 2), gameGridObj[_local4][_local6].getMaxSpeed()));
gameGridObj[_local4][_local6].theX = Math.max((gameGridObj[_local4][_local6].theX - _local9), gameGridObj[_local4][_local6].gotoX);
if (gameGridObj[_local4][_local6].theX == gameGridObj[_local4][_local6].gotoX){
gameGridObj[_local4][_local6].squashCounterX = (gameGridObj[_local4][_local6].squashCounterX + (0.03 * gameGridObj[_local4][_local6].squashMod));
if (gameGridObj[_local4][_local6].squashCounterX >= 0.1){
gameGridObj[_local4][_local6].squashMod = -1;
};
if (gameGridObj[_local4][_local6].squashCounterX <= 0){
xFloatArr[_local4][_local6].set(gameGridObj[_local4][_local6].gotoX);
xFloatArr[_local4][_local6].set(gameGridObj[_local4][_local6].gotoX);
gameGridObj[_local4][_local6].squashCounterX = 0;
gameGridObj[_local4][_local6].squashMod = 1;
gameGridObj[_local4][_local6].collapsing = false;
noOfCollapse--;
} else {
_local12 = ((39 * gameGridObj[_local4][_local6].squashCounterX) / 2);
_local13 = (_local12 * (rightRowEffected - _local10));
xFloatArr[_local4][_local6].set((gameGridObj[_local4][_local6].theX - _local13));
};
} else {
xFloatArr[_local4][_local6].set(gameGridObj[_local4][_local6].theX);
};
};
} else {
gameGridObj[_local4][_local6].waitingTimer--;
};
if (noOfCollapse == 0){
collapseBoardVertically = false;
_local4 = BOARD_HEIGHT;
_local6 = BOARD_WIDTH;
};
};
};
_local4++;
};
_local6++;
};
} else {
if (!valveLaunch){
_local14 = false;
_local4 = 0;
while (_local4 < coinArr.length) {
if (coinArr[_local4].counter <= 0){
_local14 = true;
gameGridObj[coinArr[_local4].posY][coinArr[_local4].posX] = null;
removeChild(coinArr[_local4]);
coinArr.splice(_local4, 1);
_local4--;
};
_local4++;
};
if (_local14){
collapseBoardHorizontallyFunc();
} else {
if ((((linePush <= 0)) && ((linesLeft > 0)))){
newLine();
} else {
if ((((((linePush <= 0)) && ((linesLeft == 0)))) && ((fullLaunchCounter == 0)))){
fullLaunch();
};
};
};
};
};
};
};
};
if (valveLaunch){
launchCounter++;
if (launchCounter == LAUNCH_COUNTER_LAUNCH){
if (((((collapseBoardHorizontally) || (collapseBoardVertically))) || (runGhosts))){
launchCounter--;
} else {
if (fullLaunchCounter > 0){
roundBonus = getBonusScore();
};
launch();
};
} else {
if ((((launchCounter > LAUNCH_COUNTER_LAUNCH)) && ((launchCounter < LAUNCH_COUNTER_DESC)))){
_local4 = 0;
while (_local4 < launchArr.length) {
_local6 = 0;
while (_local6 < launchArr[_local4].colsArr.length) {
valveArr[launchArr[_local4].colsArr[_local6]].waterGoTo = Number((launchCounter - LAUNCH_COUNTER_LAUNCH));
_local6++;
};
_local4++;
};
_local4 = 0;
while (_local4 < launchArr.length) {
_local6 = 0;
while (_local6 < launchArr[_local4].colsArr.length) {
_local15 = 0;
while (_local15 < BOARD_HEIGHT) {
if (gameGridObj[_local15][launchArr[_local4].colsArr[_local6]] != null){
gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].theY = Math.max((gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].theY - 4), (((_local15 - 1) * 31) + 35));
yFloatArr[_local15][launchArr[_local4].colsArr[_local6]].set(gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].theY);
};
_local15++;
};
_local6++;
};
_local4++;
};
} else {
if (launchCounter == LAUNCH_COUNTER_DESC){
noOfCollapse = 0;
noOfLaunched = 0;
sInc = 3.5;
_local4 = 0;
while (_local4 < launchArr.length) {
if (launchArr[_local4].success){
_local6 = 0;
while (_local6 < launchArr[_local4].colsArr.length) {
_local15 = 0;
while (_local15 < BOARD_HEIGHT) {
if (gameGridObj[_local15][launchArr[_local4].colsArr[_local6]] != null){
gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].updatePosY((_local15 - (BOARD_HEIGHT + 1)));
gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].launching = true;
gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].resetCollapseCounter();
noOfLaunched++;
};
_local15++;
};
_local6++;
};
} else {
_local6 = 0;
while (_local6 < launchArr[_local4].colsArr.length) {
_local15 = 0;
while (_local15 < BOARD_HEIGHT) {
if (gameGridObj[_local15][launchArr[_local4].colsArr[_local6]] != null){
gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].launching = true;
gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].resetCollapseCounter();
gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].waitingTimer = ((BOARD_HEIGHT - 1) - _local15);
noOfLaunched++;
};
_local15++;
};
_local6++;
};
};
_local4++;
};
if (noOfLaunched == 0){
completeWaterAnims = true;
};
} else {
if ((((launchCounter > LAUNCH_COUNTER_DESC)) && ((launchCounter <= LAUNCH_COUNTER_HANG)))){
_local4 = 0;
while (_local4 < launchArr.length) {
if (launchArr[_local4].success){
_local6 = 0;
while (_local6 < launchArr[_local4].colsArr.length) {
valveArr[launchArr[_local4].colsArr[_local6]].waterGoTo = Number(((launchCounter - LAUNCH_COUNTER_LAUNCH) + 12));
_local6++;
};
} else {
_local6 = 0;
while (_local6 < launchArr[_local4].colsArr.length) {
valveArr[launchArr[_local4].colsArr[_local6]].waterGoTo = Number((launchCounter - LAUNCH_COUNTER_LAUNCH));
_local6++;
};
};
_local4++;
};
} else {
if (launchCounter > LAUNCH_COUNTER_HANG){
_local4 = 0;
while (_local4 < launchArr.length) {
if (launchArr[_local4].success){
if (!playedFlushSound){
Sounds.playIgnitionLaunch();
playedFlushSound = true;
};
sInc = Math.min((sInc * 2), 80);
_local6 = 0;
while (_local6 < launchArr[_local4].colsArr.length) {
if (completeWaterAnims){
valveArr[launchArr[_local4].colsArr[_local6]].mcWaterBurst.gotoAndPlay(74);
} else {
valveArr[launchArr[_local4].colsArr[_local6]].waterGoTo = Number(((launchCounter - LAUNCH_COUNTER_LAUNCH) + 12));
};
_local15 = 0;
while (_local15 < BOARD_HEIGHT) {
if (gameGridObj[_local15][launchArr[_local4].colsArr[_local6]] != null){
if (gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].launching){
gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].theY = Math.max((gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].theY - sInc), gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].gotoY);
yFloatArr[_local15][launchArr[_local4].colsArr[_local6]].set(gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].theY);
if (gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].theY == gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].gotoY){
yFloatArr[_local15][launchArr[_local4].colsArr[_local6]].set(gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].theY);
gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].launching = false;
valveArr[launchArr[_local4].colsArr[_local6]].waterGoTo = 1;
noOfLaunched--;
};
};
};
_local15++;
};
_local6++;
};
} else {
if (!playedFlushSound){
Sounds.playBoosterRunOut();
playedFlushSound = true;
};
_local6 = 0;
while (_local6 < launchArr[_local4].colsArr.length) {
_local15 = 0;
while (_local15 < BOARD_HEIGHT) {
if (gameGridObj[_local15][launchArr[_local4].colsArr[_local6]] != null){
if (gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].launching){
if (gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].waitingTimer == 0){
_local9 = (gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].collapseCounter = Math.min((gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].collapseCounter * 2), gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].getMaxSpeed()));
gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].theY = Math.min((gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].theY + _local9), gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].gotoY);
yFloatArr[_local15][launchArr[_local4].colsArr[_local6]].set(gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].theY);
if (gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].theY == gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].gotoY){
yFloatArr[_local15][launchArr[_local4].colsArr[_local6]].set(gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].theY);
gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].squashCounterY = (gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].squashCounterY + (0.1 * gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].squashMod));
if (gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].squashCounterY >= 0.3){
gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].squashMod = -1;
};
if (gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].squashCounterY <= 0){
gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].squashCounterY = 0;
gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].squashMod = 1;
gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].launching = false;
noOfLaunched--;
};
};
} else {
gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].waitingTimer = (gameGridObj[_local15][launchArr[_local4].colsArr[_local6]].waitingTimer - 1);
};
};
};
_local15++;
};
_local6++;
};
};
_local4++;
};
if (noOfLaunched == 0){
scoreLaunch();
removeLaunched();
launchCounter = 0;
completeWaterAnims = false;
_local4 = 0;
while (_local4 < valveLaunchArr.length) {
if (valveLaunchArr[_local4] == 1){
valveArr[_local4].resetValve();
};
valveLaunchArr[_local4] = 0;
_local4++;
};
valveLaunch = false;
launched = false;
playedFlushSound = false;
if (roundOver){
endRound();
} else {
collapseBoardVerticallyFunc();
};
};
};
};
};
};
};
};
break;
};
_local4 = 0;
while (_local4 < explosionArr.length) {
explosionArr[_local4].animAt++;
_local4++;
};
_local4 = 0;
while (_local4 < scoreArr.length) {
scoreArr[_local4].animAt++;
_local4++;
};
_local4 = 0;
while (_local4 < pillArr.length) {
pillArr[_local4].delay--;
if (pillArr[_local4].delay < 0){
pillArr[_local4].animAt++;
};
_local4++;
};
}
public function getNumRandoms(){
return (noOfRandoms);
}
public function getBonusScore(){
var _local3:*;
var _local1:* = 0;
var _local2:* = 0;
while (_local2 < BOARD_HEIGHT) {
_local3 = 0;
while (_local3 < BOARD_WIDTH) {
if (gameGridObj[_local2][_local3] != null){
_local1++;
};
_local3++;
};
_local2++;
};
return (Math.round(((((BOARD_HEIGHT * BOARD_WIDTH) - _local1) / (BOARD_HEIGHT * BOARD_WIDTH)) * RAW_BONUS)));
}
public function createCoin(_arg1:Number){
var _local2:*;
var _local3:*;
var _local4:*;
Sounds.playPillGenerated();
if (_arg1 > 9){
_local2 = new Coin(firstCoin);
if (firstCoin){
firstCoin = false;
};
firstCoinBubbleRef = _local2;
firstCoinBubbleCounter = 70;
coinArr.push(_local2);
_local3 = coinRandom.nextInt(BOARD_WIDTH);
while (gameGridObj[0][_local3] != null) {
_local3 = coinRandom.nextInt(BOARD_WIDTH);
};
_local4 = 0;
while (_local4 < BOARD_HEIGHT) {
if (gameGridObj[_local4][_local3] != null){
_local2.init((_local4 - 1), _local3, 999, this, 0, _arg1);
gameGridObj[(_local4 - 1)][_local3] = _local2;
noOfCollapse++;
xFloatArr[(_local4 - 1)][_local3] = new IFloat(_local2.theX);
yFloatArr[(_local4 - 1)][_local3] = new IFloat(_local2.theY);
addChild(_local2);
_local4 = BOARD_HEIGHT;
} else {
if (_local4 == (BOARD_HEIGHT - 1)){
_local2.init(_local4, _local3, 999, this, 0, _arg1);
gameGridObj[_local4][_local3] = _local2;
noOfCollapse++;
xFloatArr[_local4][_local3] = new IFloat(_local2.theX);
yFloatArr[_local4][_local3] = new IFloat(_local2.theY);
addChild(_local2);
};
};
_local4++;
};
collapseBoardHorizontally = true;
};
}
public function launch(){
var _local5:*;
var _local6:*;
Sounds.playBoosterFire();
launched = true;
launchArr = [];
var _local1:* = new Array();
var _local2:* = new Array();
var _local3:* = 0;
var _local4:* = 0;
while (_local4 < valveLaunchArr.length) {
if (valveLaunchArr[_local4] == 1){
_local1.push(valveArr[_local4].id);
_local2.push(valveArr[_local4].power);
_local5 = 0;
while (_local5 < BOARD_HEIGHT) {
if (gameGridObj[_local5][_local4] != null){
_local3 = (_local3 + gameGridObj[_local5][_local4].weight);
};
_local5++;
};
if (_local4 == (valveLaunchArr.length - 1)){
_local6 = new Launch(launchArr.length, this, _local1, _local2, _local3);
launchArr.push(_local6);
};
} else {
if (_local1.length > 0){
_local6 = new Launch(launchArr.length, this, _local1, _local2, _local3);
launchArr.push(_local6);
_local1 = [];
_local2 = [];
_local3 = 0;
};
};
_local4++;
};
}
public function newLine(){
var _local3:*;
var _local4:Piece;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
communicator.newLine((currentTick + 1));
Sounds.playNewLine();
refillBoard = true;
refillCounter = REFILL_TIME;
linePush = (LINE_PUSH_TIMER - (15 * Math.min(level, 2)));
linesLeft--;
if (linesLeft == 3){
Sounds.playLastRow();
};
noOfCollapse = 0;
var _local1:* = 0;
var _local2:* = 0;
while (_local2 < BOARD_HEIGHT) {
_local3 = 0;
while (_local3 < BOARD_WIDTH) {
if (gameGridObj[_local2][_local3] != null){
if (_local2 == 0){
gameOver();
return;
};
gameGridObj[(_local2 - 1)][_local3] = gameGridObj[_local2][_local3];
gameGridObj[(_local2 - 1)][_local3].updatePosY((_local2 - 1));
gameGridObj[(_local2 - 1)][_local3].setGotoY(gameGridObj[(_local2 - 1)][_local3].gotoY);
gameGridObj[(_local2 - 1)][_local3].collapsing = true;
gameGridObj[(_local2 - 1)][_local3].resetCollapseCounter();
gameGridObj[(_local2 - 1)][_local3].waitingTimer = 0;
xFloatArr[(_local2 - 1)][_local3] = xFloatArr[_local2][_local3];
yFloatArr[(_local2 - 1)][_local3] = yFloatArr[_local2][_local3];
noOfCollapse++;
};
if (_local2 == (BOARD_HEIGHT - 1)){
_local4 = new Piece();
_local5 = getRandom(noOfTypes);
switch (_local5){
case 0:
_local5 = colorMod1;
break;
case 1:
_local5 = colorMod2;
break;
case 2:
_local5 = colorMod3;
break;
};
_local6 = false;
_local7 = false;
_local8 = false;
_local9 = false;
if (getRandom(100) < bombChanse){
_local6 = true;
} else {
if (getRandom(100) < GHOST_CHANSE){
_local8 = true;
} else {
if (getRandom(1000) < LAUNCH_BONUS){
_local9 = true;
};
};
};
_local4.init(_local2, _local3, _local5, this, 1, _local6, _local7, _local8, _local9);
addChild(_local4);
gameGridObj[_local2][_local3] = _local4;
gameGridObj[_local2][_local3].waitingTimer = 0;
gameGridObj[_local2][_local3].collapsing = true;
noOfCollapse++;
xFloatArr[_local2][_local3] = new IFloat(_local4.theX);
yFloatArr[_local2][_local3] = new IFloat(_local4.theY);
};
_local3++;
};
_local2++;
};
sendBoard();
}
public function getRandom(_arg1:Number){
noOfRandoms++;
return (random.nextInt(_arg1));
}
function reportKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.SPACE){
if (((((((((!(refillBoard)) && (!(collapseBoardHorizontally)))) && (!(collapseBoardVertically)))) && (!(valveLaunch)))) && ((linesLeft > 0)))){
communicator.linePush((currentTick + 1), noOfRandoms);
linePush = 1;
};
} else {
if (String.fromCharCode(_arg1.charCode).toUpperCase() == "C"){
inputString = "";
} else {
inputString = (inputString + String.fromCharCode(_arg1.charCode).toUpperCase());
if (inputString == "REDIT"){
gameRoot.mcLogo.gotoAndPlay(2);
};
};
};
}
public function createGhosts(_arg1, _arg2){
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
runGhosts = true;
_local3 = 0;
while (_local3 < _arg2.length) {
_local4 = 0;
while (_local4 < _arg2.length) {
if ((((_arg2[_local3] == _arg2[_local4])) && (!((_local3 == _local4))))){
if (_arg1[_local3] < _arg1[_local4]){
_arg1.splice(_local4, 1);
_arg2.splice(_local4, 1);
_local4--;
} else {
_arg1.splice(_local3, 1);
_arg2.splice(_local3, 1);
_local3--;
};
};
_local4++;
};
_local3++;
};
_local3 = 0;
while (_local3 < _arg1.length) {
_local5 = new Ghost(_arg1[_local3], _arg2[_local3]);
ghostArr.push(_local5);
addChild(_local5);
ghostFloatArr.push(new IFloat(_local5.theY));
_local6 = new Array();
_local4 = (_arg1[_local3] + 1);
while (_local4 < BOARD_HEIGHT) {
_local6.push(gameGridObj[_local4][_arg2[_local3]]);
_local4++;
};
ghostTargetsArr.push(_local6);
_local3++;
};
}
public function gameOver(){
gameRoot.updateScoreSign(roundScore, linesLeft);
var _local1:* = 0;
while (_local1 < valveArr.length) {
valveArr[_local1].mcWaterBurst.gotoAndStop(1);
_local1++;
};
gameState = STATE_NOT_RUNNING;
var _local2:* = false;
clearBoard();
gameRoot.endRound(_local2, roundScore, coinsCleared, 0);
roundScore = 0;
}
}
}//package src
Section 55
//Ghost (src.Ghost)
package src {
import flash.display.*;
public class Ghost extends MovieClip {
public var animAt;// = 1
public var colNum;
public var theX;
public var theY;
public var pathAt;// = 0
public var mcGhost:MovieClip;
public function Ghost(_arg1, _arg2){
theY = ((_arg1 * 31) + 45);
theX = ((_arg2 * 39) + 46);
x = theX;
y = theY;
colNum = _arg2;
}
}
}//package src
Section 56
//Launch (src.Launch)
package src {
import src.timing.*;
import flash.events.*;
import flash.display.*;
public class Launch {
public var success;// = false
private var power;// = 0
private var totalWeight;
public var colsArr;
private var colsPowerArr;
private var game:Game;
public var id;
public function Launch(_arg1, _arg2, _arg3, _arg4, _arg5){
colsArr = new Array();
colsPowerArr = new Array();
super();
this.id = _arg1;
this.game = _arg2;
colsArr = _arg3;
colsPowerArr = _arg4;
this.totalWeight = _arg5;
setPower();
}
public function setPower():void{
var _local1:* = 0;
while (_local1 < colsArr.length) {
power = (power + (colsPowerArr[_local1] + (Math.min(_local1, 3) * 10)));
_local1++;
};
if (power >= totalWeight){
success = true;
};
}
public function render(_arg1:Number, _arg2:Number):void{
}
public function tick(_arg1:Number, _arg2:Number):void{
}
}
}//package src
Section 57
//Piece (src.Piece)
package src {
import flash.events.*;
import flash.display.*;
public class Piece extends MovieClip {
public var posX;
public var posY;
public var theX;
public var theY;
public var collapseCounter;// = 1
public var waitingTimer;// = 0
public var launchScore;// = 10
public var animAt;// = 1
public var ghost;// = false
public var launchBonus;// = false
public var collapsing;// = false
public var marked;// = false
public var colorBomb;// = false
public var type;
public var squashCounterY;// = 0
private var currentTick;
public var squashCounterX;// = 0
public var squashMod;// = 1
public var mcAnim:MovieClip;
public var cfeMark;// = false
public var star;
public var gotoX;
public var gotoY;
public var isCoin;// = false
public var launching;// = false
public var cfe;// = false
public var deMark;// = false
private var game:Game;
public var weight;// = 10
private static var WIDTH = 39;
private static var HEIGHT = 31;
private static var COLLAPSE_COUNTER = 1;
public function Piece(){
addFrameScript(0, frame1);
addEventListener(MouseEvent.MOUSE_DOWN, pieceClicked);
addEventListener(MouseEvent.MOUSE_OVER, mouseOver);
}
public function setGotoX(_arg1){
gotoX = _arg1;
}
public function checkedMark(){
cfeMark = true;
}
public function init(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9):void{
x = ((_arg2 * WIDTH) + 46);
y = ((_arg1 * HEIGHT) + 45);
posX = _arg2;
posY = _arg1;
theX = x;
theY = y;
gotoY = theY;
gotoX = theX;
this.game = _arg4;
this.colorBomb = _arg6;
this.launchBonus = _arg9;
if (_arg6){
_arg3 = (_arg3 + 5);
};
this.star = _arg7;
this.ghost = _arg8;
var _local10:* = 0;
if (_arg7){
_local10 = 10;
};
if (_arg8){
_local10 = 15;
};
if (_arg9){
_arg3 = 20;
};
this.type = _arg3;
gotoAndStop(((_arg3 + 1) + _local10));
visible = true;
squashCounterY = _arg5;
}
public function mouseOver(_arg1:Event){
game.mouseOver(this);
}
public function setGotoY(_arg1){
gotoY = _arg1;
}
public function tick(_arg1:Number, _arg2:Number):void{
currentTick = _arg1;
}
public function render(_arg1:Number, _arg2:Number):void{
}
public function killMe(){
}
public function getMaxSpeed(){
return (15);
}
public function checked(){
cfe = true;
}
public function unChecked(){
cfe = false;
}
public function unCheckedMark(){
cfeMark = false;
}
public function pieceClicked(_arg1:Event){
game.pieceClicked(this);
}
public function mouseOut(_arg1:Event){
}
function frame1(){
stop();
}
public function updatePosX(_arg1:Number){
posX = _arg1;
setGotoX(((_arg1 * WIDTH) + 46));
}
public function updatePosY(_arg1:Number){
posY = _arg1;
setGotoY(((_arg1 * HEIGHT) + 45));
}
public function resetCollapseCounter(){
collapseCounter = COLLAPSE_COUNTER;
}
}
}//package src
Section 58
//Pill (src.Pill)
package src {
import flash.display.*;
public class Pill extends MovieClip {
public var mcSilver:MovieClip;
public var animAt;// = 1
public var delay;
public var target;
public var mcGold:MovieClip;
public var animLength;// = 20
public var type;
public function Pill(_arg1, _arg2){
this.type = _arg1;
this.delay = (_arg2 * 3);
x = 640;
y = -5;
if (_arg1 == 0){
animLength = 15;
target = this.mcSilver;
mcSilver.visible = true;
mcGold.visible = false;
} else {
animLength = 15;
mcSilver.visible = false;
mcGold.visible = true;
target = this.mcGold;
};
this.visible = true;
}
}
}//package src
Section 59
//Score (src.Score)
package src {
import src.timing.*;
import flash.events.*;
import flash.display.*;
public class Score extends MovieClip {
public var animAt;// = 1
private var theX;
private var theY;
public var animLength;// = 20
public var mcScore:MovieClip;
public function Score(_arg1, _arg2, _arg3){
addFrameScript(0, frame1, 19, frame20);
x = _arg1;
y = _arg2;
mcScore.txtScore.text = _arg3;
}
function frame1(){
stop();
}
function frame20(){
stop();
}
}
}//package src
Section 60
//Sounds (src.Sounds)
package src {
import flash.media.*;
public class Sounds {
private static var ignitionLaunch:Sound = new IgnitionLaunch();
private static var introMusic:Sound = new IntroMusic();
private static var gameOverMusicChannel:SoundChannel;
private static var colorBomb:Sound = new ColorBomb();
private static var introMusicChannel:SoundChannel;
private static var gameMusicChannel:SoundChannel;
private static var endBad:Sound = new EndBad();
private static var newLine:Sound = new NewLine();
private static var contraction:Sound = new Contraction();
private static var endGood:Sound = new EndGood();
private static var levelStart:Sound = new LevelStart();
private static var levelMusicChannel:SoundChannel;
private static var pillLand:Sound = new PillLand();
public static var runGhostMunch = 0;
public static var isSoundOn:Boolean = true;
private static var gameMusic:Sound = new GameMusic();
private static var pillGenerated:Sound = new PillGenerated();
private static var levelComplete:Sound = new LevelComplete();
private static var launchCountDown:Sound = new LaunchCountDown();
private static var lastRow:Sound = new LastRow();
private static var munch2:Sound = new Munch2();
private static var munch4:Sound = new Munch4();
private static var munch1:Sound = new Munch1();
private static var munch3:Sound = new Munch3();
private static var boosterRunOut:Sound = new BoosterRunOut();
private static var clickPieceTrue:Sound = new ClickPieceTrue();
private static var boosterFire:Sound = new BoosterFire();
private static var valveClicked:Sound = new ValveClicked();
public static var predicting:Boolean = false;
private static var newPill:Sound = new NewPill();
private static var clickPieceFalse:Sound = new ClickPieceFalse();
public static function playNewLine(){
if (isSoundOn){
newLine.play(0, 1, new SoundTransform(1, 0.4));
};
}
public static function playLevelComplete(){
if (isSoundOn){
levelMusicChannel = levelComplete.play(0, 1, new SoundTransform(1, 0.4));
};
}
public static function soundOff(){
var _local1:SoundTransform;
if (introMusicChannel != null){
_local1 = introMusicChannel.soundTransform;
_local1.volume = 0;
introMusicChannel.soundTransform = _local1;
};
if (gameMusicChannel != null){
_local1 = gameMusicChannel.soundTransform;
_local1.volume = 0;
gameMusicChannel.soundTransform = _local1;
};
if (levelMusicChannel != null){
_local1 = levelMusicChannel.soundTransform;
_local1.volume = 0;
levelMusicChannel.soundTransform = _local1;
};
if (gameOverMusicChannel != null){
_local1 = gameOverMusicChannel.soundTransform;
_local1.volume = 0;
gameOverMusicChannel.soundTransform = _local1;
};
isSoundOn = false;
}
public static function playMunch(){
var _local1:*;
if (isSoundOn){
runGhostMunch = ((runGhostMunch + 1) % 2);
if (runGhostMunch == 1){
_local1 = Math.ceil((Math.random() * 4));
switch (_local1){
case 1:
munch1.play(0, 1, new SoundTransform(1, 0.4));
break;
case 2:
munch2.play(0, 1, new SoundTransform(1, 0.4));
break;
case 3:
munch3.play(0, 1, new SoundTransform(1, 0.4));
break;
case 4:
munch4.play(0, 1, new SoundTransform(1, 0.4));
break;
};
};
};
}
public static function playPillGenerated(){
if (isSoundOn){
pillGenerated.play(0, 1, new SoundTransform(1, 0.4));
};
}
public static function playBoosterFire(){
if (isSoundOn){
boosterFire.play(0, 2, new SoundTransform(0.5, 0));
};
}
public static function startGameMusic(){
stopIntroMusic();
stopGameMusic();
if (isSoundOn){
gameMusicChannel = gameMusic.play(0, 999999, new SoundTransform(0.5, 0));
};
}
public static function startIntroMusic(){
stopIntroMusic();
if (isSoundOn){
introMusicChannel = introMusic.play();
};
}
public static function playBoosterRunOut(){
if (isSoundOn){
boosterRunOut.play(0, 1, new SoundTransform(1, 0.4));
};
}
public static function playLevelStart(){
stopLevelMusic();
if (isSoundOn){
levelStart.play(0, 1, new SoundTransform(1, 0.4));
};
}
public static function stopLevelMusic(){
if (levelMusicChannel != null){
levelMusicChannel.stop();
levelMusicChannel = null;
};
}
public static function playLastRow(){
if (isSoundOn){
lastRow.play(0, 1, new SoundTransform(1, 0.4));
};
}
public static function playClickPieceFalse(){
if (isSoundOn){
clickPieceFalse.play(0, 1, new SoundTransform(1, 0.4));
};
}
public static function stopIntroMusic(){
if (introMusicChannel != null){
introMusicChannel.stop();
introMusicChannel = null;
};
}
public static function playNewPill(){
if (isSoundOn){
newPill.play(0, 1, new SoundTransform(1, 0.4));
};
}
public static function playColorBomb(){
if (isSoundOn){
colorBomb.play(0, 1, new SoundTransform(1, 0.4));
};
}
public static function soundOn(){
var _local1:SoundTransform;
isSoundOn = true;
if (introMusicChannel != null){
_local1 = introMusicChannel.soundTransform;
_local1.volume = 1;
introMusicChannel.soundTransform = _local1;
};
if (gameMusicChannel != null){
_local1 = gameMusicChannel.soundTransform;
_local1.volume = 1;
gameMusicChannel.soundTransform = _local1;
};
if (levelMusicChannel != null){
_local1 = levelMusicChannel.soundTransform;
_local1.volume = 1;
levelMusicChannel.soundTransform = _local1;
};
if (gameOverMusicChannel != null){
_local1 = gameOverMusicChannel.soundTransform;
_local1.volume = 1;
gameOverMusicChannel.soundTransform = _local1;
};
}
public static function playClickPieceTrue(){
if (isSoundOn){
clickPieceTrue.play(0, 1, new SoundTransform(0.7, 0.4));
};
}
public static function playValveClicked(){
if (isSoundOn){
valveClicked.play(0, 1, new SoundTransform(1, 0.4));
};
}
public static function playContraction(){
if (isSoundOn){
contraction.play(0, 1, new SoundTransform(1, 0.4));
};
}
public static function playLaunchCount(){
if (isSoundOn){
launchCountDown.play(0, 1, new SoundTransform(1, 0.4));
};
}
public static function playEndGood(){
if (isSoundOn){
gameOverMusicChannel = endGood.play(0, 1, new SoundTransform(1, 0.4));
};
}
public static function stopGameMusic(){
if (gameMusicChannel != null){
gameMusicChannel.stop();
gameMusicChannel = null;
};
}
public static function playIgnitionLaunch(){
if (isSoundOn){
ignitionLaunch.play(0, 1, new SoundTransform(1, 0.4));
};
}
public static function playEndBad(){
if (isSoundOn){
gameOverMusicChannel = endBad.play(0, 1, new SoundTransform(1, 0.4));
};
}
}
}//package src
Section 61
//Valve (src.Valve)
package src {
import flash.events.*;
import flash.display.*;
public class Valve extends MovieClip {
public var mcTube:MovieClip;
public var power;// = 0
public var locked;// = false
public var id;
public var waterAt;
private var game:Game;
public var powerCounter;// = 0
public var waterGoTo;
public var mcValveTrigger:MovieClip;
public var mcWaterBurst:MovieClip;
private static var MAX_POWER = 100;
public function Valve(){
addFrameScript(0, frame1, 17, frame18);
}
public function setPower():void{
var _local1:* = 0;
var _local2:* = 1;
while (_local2 <= powerCounter) {
_local1 = (_local1 + (_local2 * 2));
_local2++;
};
powerCounter = 0;
power = Math.min(MAX_POWER, (power + _local1));
this.gotoAndStop((1 + Math.floor((power / 10))));
}
public function valveClicked(_arg1:Event):void{
if ((((((power >= 10)) && (!(locked)))) && ((game.fullLaunchCounter == 0)))){
if (game.valveClicked(this)){
locked = true;
};
};
}
public function resetValve(){
locked = false;
power = 0;
waterGoTo = 1;
this.gotoAndStop(1);
mcValveTrigger.gotoAndPlay(23);
}
public function init(_arg1, _arg2):void{
this.id = _arg1;
this.game = _arg2;
}
public function render(_arg1:Number, _arg2:Number):void{
}
public function tick(_arg1:Number, _arg2:Number):void{
}
function frame18(){
stop();
}
public function setPowerToMax(){
power = MAX_POWER;
this.gotoAndStop((1 + Math.floor((power / 10))));
}
function frame1(){
stop();
}
}
}//package src
Section 62
//BoosterFire (BoosterFire)
package {
import flash.media.*;
public dynamic class BoosterFire extends Sound {
}
}//package
Section 63
//BoosterRunOut (BoosterRunOut)
package {
import flash.media.*;
public dynamic class BoosterRunOut extends Sound {
}
}//package
Section 64
//ClickPieceFalse (ClickPieceFalse)
package {
import flash.media.*;
public dynamic class ClickPieceFalse extends Sound {
}
}//package
Section 65
//ClickPieceTrue (ClickPieceTrue)
package {
import flash.media.*;
public dynamic class ClickPieceTrue extends Sound {
}
}//package
Section 66
//ColorBomb (ColorBomb)
package {
import flash.media.*;
public dynamic class ColorBomb extends Sound {
}
}//package
Section 67
//Contraction (Contraction)
package {
import flash.media.*;
public dynamic class Contraction extends Sound {
}
}//package
Section 68
//EndBad (EndBad)
package {
import flash.media.*;
public dynamic class EndBad extends Sound {
}
}//package
Section 69
//EndGood (EndGood)
package {
import flash.media.*;
public dynamic class EndGood extends Sound {
}
}//package
Section 70
//GameMusic (GameMusic)
package {
import flash.media.*;
public dynamic class GameMusic extends Sound {
}
}//package
Section 71
//IgnitionLaunch (IgnitionLaunch)
package {
import flash.media.*;
public dynamic class IgnitionLaunch extends Sound {
}
}//package
Section 72
//IntroMusic (IntroMusic)
package {
import flash.media.*;
public dynamic class IntroMusic extends Sound {
}
}//package
Section 73
//LastRow (LastRow)
package {
import flash.media.*;
public dynamic class LastRow extends Sound {
}
}//package
Section 74
//LaunchCountDown (LaunchCountDown)
package {
import flash.media.*;
public dynamic class LaunchCountDown extends Sound {
}
}//package
Section 75
//LevelComplete (LevelComplete)
package {
import flash.media.*;
public dynamic class LevelComplete extends Sound {
}
}//package
Section 76
//LevelStart (LevelStart)
package {
import flash.media.*;
public dynamic class LevelStart extends Sound {
}
}//package
Section 77
//Munch1 (Munch1)
package {
import flash.media.*;
public dynamic class Munch1 extends Sound {
}
}//package
Section 78
//Munch2 (Munch2)
package {
import flash.media.*;
public dynamic class Munch2 extends Sound {
}
}//package
Section 79
//Munch3 (Munch3)
package {
import flash.media.*;
public dynamic class Munch3 extends Sound {
}
}//package
Section 80
//Munch4 (Munch4)
package {
import flash.media.*;
public dynamic class Munch4 extends Sound {
}
}//package
Section 81
//NewLine (NewLine)
package {
import flash.media.*;
public dynamic class NewLine extends Sound {
}
}//package
Section 82
//NewPill (NewPill)
package {
import flash.media.*;
public dynamic class NewPill extends Sound {
}
}//package
Section 83
//PillGenerated (PillGenerated)
package {
import flash.media.*;
public dynamic class PillGenerated extends Sound {
}
}//package
Section 84
//PillLand (PillLand)
package {
import flash.media.*;
public dynamic class PillLand extends Sound {
}
}//package
Section 85
//ValveClicked (ValveClicked)
package {
import flash.media.*;
public dynamic class ValveClicked extends Sound {
}
}//package