Section 1
//SUIElement (ek.sui.SUIElement)
package ek.sui {
import flash.display.*;
public interface SUIElement {
function mouseUp():void;
function draw(_arg1:BitmapData):void;
function mouseMove(_arg1:Number, _arg2:Number):void;
function mouseDown():void;
function update(_arg1:Number):void;
}
}//package ek.sui
Section 2
//SUIImage (ek.sui.SUIImage)
package ek.sui {
import flash.display.*;
import flash.geom.*;
public class SUIImage implements SUIElement {
public var img:BitmapData;
public var x:Number;
public var y:Number;
public function SUIImage(){
img = null;
x = 0;
y = 0;
}
public function mouseUp():void{
}
public function setEmbedImage(_arg1:Class):void{
img = new (_arg1).bitmapData;
}
public function update(_arg1:Number):void{
}
public function draw(_arg1:BitmapData):void{
if (img != null){
_arg1.copyPixels(img, new Rectangle(0, 0, img.width, img.height), new Point(x, y));
};
}
public function mouseDown():void{
}
public function mouseMove(_arg1:Number, _arg2:Number):void{
}
}
}//package ek.sui
Section 3
//SUIScreen (ek.sui.SUIScreen)
package ek.sui {
import flash.display.*;
public class SUIScreen {
private var elements:Array;
public function SUIScreen(){
elements = new Array();
}
public function mouseUp():void{
var _local1:SUIElement;
for each (_local1 in elements) {
_local1.mouseUp();
};
}
public function add(_arg1:SUIElement):void{
elements.push(_arg1);
}
public function draw(_arg1:BitmapData):void{
var _local2:SUIElement;
for each (_local2 in elements) {
_local2.draw(_arg1);
};
}
public function mouseDown():void{
var _local1:SUIElement;
for each (_local1 in elements) {
_local1.mouseDown();
};
}
public function update(_arg1:Number):void{
var _local2:SUIElement;
for each (_local2 in elements) {
_local2.update(_arg1);
};
}
public function mouseMove(_arg1:Number, _arg2:Number):void{
var _local3:SUIElement;
for each (_local3 in elements) {
_local3.mouseMove(_arg1, _arg2);
};
}
}
}//package ek.sui
Section 4
//SUISystem (ek.sui.SUISystem)
package ek.sui {
import flash.events.*;
import flash.display.*;
public class SUISystem {
public var mx:Number;
public var my:Number;
public var overlay:SUIScreen;
public var current:SUIScreen;
public function SUISystem(){
mx = (my = 0);
}
public function draw(_arg1:BitmapData):void{
if (current != null){
current.draw(_arg1);
};
if (overlay != null){
overlay.draw(_arg1);
};
}
public function listen(_arg1:Stage):void{
_arg1.addEventListener(MouseEvent.MOUSE_MOVE, mouseMove);
_arg1.addEventListener(MouseEvent.MOUSE_UP, mouseUp);
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
}
public function update(_arg1:Number):void{
if (current != null){
current.update(_arg1);
};
if (overlay != null){
overlay.update(_arg1);
};
}
public function clear():void{
}
public function mouseDown(_arg1:MouseEvent):void{
if (current != null){
current.mouseDown();
};
if (overlay != null){
overlay.mouseDown();
};
}
public function mouseUp(_arg1:MouseEvent):void{
if (current != null){
current.mouseUp();
};
if (overlay != null){
overlay.mouseUp();
};
}
public function setCurrent(_arg1:SUIScreen):void{
current = _arg1;
current.mouseMove(mx, my);
}
public function mouseMove(_arg1:MouseEvent):void{
mx = _arg1.localX;
my = _arg1.localY;
if (current != null){
current.mouseMove(mx, my);
};
if (overlay != null){
overlay.mouseMove(mx, my);
};
}
}
}//package ek.sui
Section 5
//ekDevice (ek.ekDevice)
package ek {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class ekDevice {
private var stageQuality:int;
public var callbackFPS:Function;
private var fps:int;
public var dt:Number;
private var fpsCounter:int;
public var listener:ekIListener;
private var last:int;
public var stage:Stage;
public static const instance:ekDevice = new (ekDevice);
;
public function set quality(_arg1:int):void{
var _local2:String;
switch (_arg1){
case 0:
_local2 = StageQuality.HIGH;
break;
case 1:
_local2 = StageQuality.MEDIUM;
break;
case 2:
_local2 = StageQuality.LOW;
break;
};
stage.quality = _local2;
stageQuality = _arg1;
}
public function run(_arg1:Stage):void{
stage = _arg1;
stage.showDefaultContextMenu = false;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
stage.addEventListener(Event.ENTER_FRAME, onRender);
}
public function onKeyDown(_arg1:KeyboardEvent):void{
if (listener != null){
listener.keyDown(_arg1);
};
}
public function onRender(_arg1:Event):void{
var _local2:int = getTimer();
var _local3:int = (_local2 - last);
last = _local2;
dt = (_local3 * 0.001);
if (_local3 > 300){
dt = 0.3;
};
if (listener != null){
listener.frame(dt);
};
}
public function onKeyUp(_arg1:KeyboardEvent):void{
if (listener != null){
listener.keyUp(_arg1);
};
}
public function resetTimer():void{
last = getTimer();
dt = 0.001;
fps = 0;
fpsCounter = 0;
}
public function get quality():int{
return (stageQuality);
}
}
}//package ek
Section 6
//ekIListener (ek.ekIListener)
package ek {
import flash.events.*;
public interface ekIListener {
function keyDown(_arg1:KeyboardEvent):void;
function keyUp(_arg1:KeyboardEvent):void;
function frame(_arg1:Number):void;
}
}//package ek
Section 7
//ekPreLoader (ek.ekPreLoader)
package ek {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class ekPreLoader extends MovieClip implements ekIListener {
protected const urlsAllowed:Array;
protected var offlineAllowed:Boolean;
public var completed:Boolean;
public var progress:Number;
protected var mainClassName:String;
public var device:ekDevice;
public function ekPreLoader(){
urlsAllowed = new Array();
super();
device = ekDevice.instance;
device.run(stage);
stop();
progress = 0;
completed = false;
}
public function keyDown(_arg1:KeyboardEvent):void{
}
protected function checkLock():Boolean{
var _local8:String;
var _local1:Boolean;
var _local2:String = stage.loaderInfo.url;
var _local3:int = (_local2.indexOf("://") + 3);
var _local4:int = _local2.indexOf("/", _local3);
var _local5:String = _local2.substring(_local3, _local4);
var _local6:int = (_local5.lastIndexOf(".") - 1);
var _local7:int = (_local5.lastIndexOf(".", _local6) + 1);
_local5 = _local5.substring(_local7, _local5.length);
for each (_local8 in urlsAllowed) {
if (_local8 == _local5){
_local1 = true;
};
};
if (((!(_local1)) && (offlineAllowed))){
_local1 = (_local2.substr(0, 4) == "file");
};
return (_local1);
}
protected function createMainClass():void{
nextFrame();
var _local1:Class = Class(getDefinitionByName(mainClassName));
var _local2:Object = new (_local1);
}
public function keyUp(_arg1:KeyboardEvent):void{
}
public function updateProgress():void{
progress = (root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal);
if (((((!(completed)) && ((framesLoaded == totalFrames)))) && ((progress >= 1)))){
completed = true;
onComplete();
};
}
protected function onComplete():void{
}
public function frame(_arg1:Number):void{
var _local2:Graphics = this.graphics;
_local2.clear();
_local2.beginFill(0);
_local2.drawRect(0, ((stage.stageHeight / 2) - 10), (stage.stageWidth * progress), 20);
_local2.endFill();
}
}
}//package ek
Section 8
//EnvEffect (Envi.EnvEffect)
package Envi {
import flash.display.*;
public class EnvEffect {
public var power:Number;
public var peak:Number;
public var c1:uint;
public var c2:uint;
public function EnvEffect(){
power = 0;
c1 = 0;
c2 = 0;
peak = 0;
}
public function draw(_arg1:BitmapData):void{
}
public function update(_arg1:Number):void{
}
}
}//package Envi
Section 9
//EnvEffect1 (Envi.EnvEffect1)
package Envi {
import flash.display.*;
public class EnvEffect1 extends EnvEffect {
private var shape:Shape;
private var t:Number;
public function EnvEffect1(){
shape = new Shape();
t = 0;
}
override public function update(_arg1:Number):void{
t = (t + ((_arg1 * 160) * (power - 0.5)));
if (t > 80){
t = (t - 80);
};
}
override public function draw(_arg1:BitmapData):void{
var _local2:Number;
var _local3:Boolean;
var _local4:Graphics = shape.graphics;
_local4.clear();
_local4.lineStyle();
_local4.beginFill(c1);
_local4.drawRect(0, 0, 640, 400);
_local4.endFill();
_local2 = (-160 + t);
while (_local2 < 400) {
_local4.beginFill(c2);
_local4.moveTo(0, _local2);
_local4.lineTo(640, (_local2 + 40));
_local4.lineTo(640, (_local2 + 80));
_local4.lineTo(0, (_local2 + 40));
_local4.endFill();
_local3 = !(_local3);
_local2 = (_local2 + 80);
};
_arg1.draw(shape);
}
}
}//package Envi
Section 10
//EnvEffect2 (Envi.EnvEffect2)
package Envi {
import flash.display.*;
public class EnvEffect2 extends EnvEffect {
private var shape:Shape;
private var t:Number;
public function EnvEffect2(){
shape = new Shape();
t = 0;
}
override public function update(_arg1:Number):void{
t = (t + ((_arg1 * 6.28) * (power - 0.5)));
if (t > 6.28){
t = (t - 6.28);
};
}
override public function draw(_arg1:BitmapData):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Graphics = shape.graphics;
_local5.clear();
_local5.lineStyle();
_local5.beginFill(c2);
_local5.drawRect(0, 0, 640, 400);
_local5.endFill();
_local2 = 40;
_local3 = 40;
_local4 = (22.5 + (12.5 * Math.sin(t)));
while (_local2 < 640) {
while (_local3 < 400) {
_local5.beginFill(c1);
_local5.drawCircle(_local2, _local3, _local4);
_local5.endFill();
_local3 = (_local3 + 80);
};
_local3 = 40;
_local2 = (_local2 + 80);
};
_local2 = 80;
_local3 = 80;
_local4 = (22.5 - (12.5 * Math.sin(t)));
while (_local2 < 640) {
while (_local3 < 400) {
_local5.beginFill(c1);
_local5.drawCircle(_local2, _local3, _local4);
_local5.endFill();
_local3 = (_local3 + 80);
};
_local3 = 80;
_local2 = (_local2 + 80);
};
_arg1.draw(shape);
}
}
}//package Envi
Section 11
//EnvEffect3 (Envi.EnvEffect3)
package Envi {
import flash.display.*;
public class EnvEffect3 extends EnvEffect {
private var shape:Shape;
private var t:Number;
public function EnvEffect3(){
shape = new Shape();
t = 0;
}
override public function update(_arg1:Number):void{
t = (t + ((_arg1 * 200) * (power - 0.5)));
if (t > 100){
t = (t - 100);
};
}
override public function draw(_arg1:BitmapData):void{
var _local2:Number;
var _local3:Boolean;
var _local4:Graphics = shape.graphics;
_local4.clear();
_local4.lineStyle();
_local4.beginFill(c1);
_local4.drawRect(0, 0, 640, 400);
_local4.endFill();
_local2 = (0x0200 - t);
while (_local2 > 0) {
_local4.beginFill(c2);
_local4.drawCircle(320, 200, _local2);
if (_local2 > 50){
_local4.drawCircle(320, 200, (_local2 - 50));
};
_local4.endFill();
_local2 = (_local2 - 100);
};
_arg1.draw(shape);
}
}
}//package Envi
Section 12
//EnvEffect4 (Envi.EnvEffect4)
package Envi {
import flash.display.*;
public class EnvEffect4 extends EnvEffect {
private var shape:Shape;
private var t:Number;
public function EnvEffect4(){
shape = new Shape();
t = 0;
}
override public function update(_arg1:Number):void{
t = (t + ((_arg1 * 1.256) * (power - 0.5)));
if (t > 6.28){
t = (t - 6.28);
};
}
override public function draw(_arg1:BitmapData):void{
var _local2:Number = 0;
var _local3:Number = t;
var _local4:Number = (t + 0.314);
var _local5:Graphics = shape.graphics;
_local5.clear();
_local5.lineStyle();
_local5.beginFill(c2);
_local5.drawRect(0, 0, 640, 400);
_local5.endFill();
while (_local2 < 6.28) {
_local5.beginFill(c1);
_local5.moveTo((320 + (0x0200 * Math.cos(_local3))), (200 + (0x0200 * Math.sin(_local3))));
_local5.lineTo(320, 200);
_local5.lineTo((320 + (0x0200 * Math.cos(_local4))), (200 + (0x0200 * Math.sin(_local4))));
_local5.endFill();
_local3 = (_local3 + 0.628);
_local4 = (_local4 + 0.628);
_local2 = (_local2 + 0.628);
};
_local5.beginFill(c1);
_local5.drawCircle(320, 200, (peak * 25));
_local5.endFill();
_arg1.draw(shape);
}
}
}//package Envi
Section 13
//FrogActor (lev.fx.FrogActor)
package lev.fx {
import flash.display.*;
import flash.geom.*;
public class FrogActor {
public var y:Number;
public var aHands:Number;
protected var media:StageMedia;
public var open:Boolean;
public var phaseEyes:Number;
public var openCounter:Number;
public var openVel:Number;
public var angleEyes:Number;
public var x:Number;
public var speedHands:Number;
public var visible:Boolean;
public function FrogActor(_arg1:StageMedia){
media = _arg1;
x = 0;
y = 0;
visible = true;
openCounter = 0;
open = false;
openVel = 1.5;
aHands = 0;
speedHands = 0;
phaseEyes = Math.random();
angleEyes = Math.random();
}
public function draw(_arg1:BitmapData):void{
var _local2:Matrix = new Matrix(1, 0, 0, 1, (x + 2), y);
var _local3:Number = ((y - 17) - ((42 * (1 - Math.cos((openCounter * 3.14)))) * 0.5));
var _local4:ColorTransform = new ColorTransform(1, 1, 1, (0.5 + (openCounter * 0.5)));
var _local5:Number = (((1 - Math.cos(aHands)) * 0.5) * 1.57);
var _local6:Number = (((1 - Math.cos((aHands + (openCounter * 3.14)))) * 0.5) * 1.57);
_arg1.draw(media.imgFrogBody, _local2);
_local2.tx = -5;
_local2.ty = -2;
_local2.rotate(-(_local5));
_local2.translate(((x + 48) + 5), (((y + 58) - 17) - 2));
_arg1.draw(media.imgFrogHand1, _local2, null, null, null, true);
_local2.identity();
_local2.tx = -13;
_local2.rotate(_local6);
_local2.translate(((x + 92) - 3), ((y + 55) - 17));
_arg1.draw(media.imgFrogHand2, _local2, null, null, null, true);
_local2.identity();
_local2.tx = (x + 20);
_local2.ty = _local3;
_arg1.draw(media.imgFrogHead, _local2, null, null, null, true);
_local2.tx = -12;
_local2.ty = -10;
_local2.scale((1 + (0.1 * Math.sin((angleEyes * 6.28)))), (1 + (0.1 * Math.cos((angleEyes * 6.28)))));
_local2.translate((x + 58), (20 + _local3));
_arg1.draw(media.imgFrogEye1, _local2, null, null, null, true);
_local2.identity();
_local2.tx = -15;
_local2.ty = -13;
_local2.scale((1 + (0.1 * Math.sin(((angleEyes + phaseEyes) * 6.28)))), (1 + (0.1 * Math.cos(((angleEyes + phaseEyes) * 6.28)))));
_local2.translate((x + 87), (19 + _local3));
_arg1.draw(media.imgFrogEye2, _local2, null, null, null, true);
_local2.identity();
_local2.tx = (x + 51);
_local2.ty = (_local3 + 14);
_arg1.draw(media.imgFrogEmo1, _local2, _local4, null, null, true);
_local4.alphaMultiplier = openCounter;
_local2.tx = (x + 47);
_local2.ty = _local3;
_arg1.draw(media.imgFrogEmo2, _local2, _local4, null, null, true);
}
public function update(_arg1:Number):void{
angleEyes = (angleEyes + (_arg1 * openCounter));
if (angleEyes > 1){
angleEyes = (angleEyes - int(angleEyes));
};
if (open){
if (openCounter < 1){
openCounter = (openCounter + (_arg1 * openVel));
if (openCounter > 1){
openCounter = 1;
};
};
aHands = (aHands + ((_arg1 * speedHands) * openCounter));
if (aHands > 6.28){
aHands = (aHands - 6.28);
};
} else {
if (openCounter > 0){
openCounter = (openCounter - (_arg1 * openVel));
if (openCounter < 0){
openCounter = 0;
};
};
if ((((aHands > 0)) && ((aHands < 6.28)))){
aHands = (aHands + (_arg1 * speedHands));
if (aHands >= 6.28){
aHands = 0;
};
};
};
}
}
}//package lev.fx
Section 14
//HintArrow (lev.fx.HintArrow)
package lev.fx {
import flash.display.*;
import flash.geom.*;
public class HintArrow {
public var visible:Boolean;
private var img:BitmapData;
public var color:ColorTransform;
public var visibleCounter:Number;
public var angle:Number;
private var t:Number;
public var x:Number;
public var y:Number;
public function HintArrow(_arg1:StageMedia){
img = _arg1.imgHintArrow;
color = new ColorTransform();
t = 0;
}
public function place(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:uint, _arg5:Boolean):void{
t = 0;
x = _arg1;
y = _arg2;
angle = _arg3;
utils.ctSetRGB(color, _arg4);
visible = _arg5;
if (_arg5){
visibleCounter = 1;
} else {
visibleCounter = 0;
};
}
public function update(_arg1:Number):void{
t = (t + _arg1);
if (t > 1){
t = (t - int(t));
};
if (visible){
if (visibleCounter < 1){
visibleCounter = (visibleCounter + _arg1);
if (visibleCounter > 1){
visibleCounter = 1;
};
};
} else {
if (visibleCounter > 0){
visibleCounter = (visibleCounter - _arg1);
if (visibleCounter < 0){
visibleCounter = 0;
};
};
};
}
public function draw(_arg1:BitmapData):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Matrix;
var _local2:Number = Math.sin((t * 6.28));
if (visibleCounter > 0){
if (_local2 < 0){
_local3 = 0;
_local4 = (0.6 + ((_local2 + 1) * 0.4));
_local5 = (1 - (_local2 * 0.25));
} else {
_local3 = (_local2 * 15);
_local5 = 1;
_local4 = _local5;
};
_local6 = new Matrix(1, 0, 0, 1, -28, (-63 - _local3));
_local6.scale(_local5, _local4);
_local6.rotate(angle);
_local6.translate(x, y);
color.alphaMultiplier = visibleCounter;
_arg1.draw(img, _local6, color, null, null, true);
};
}
}
}//package lev.fx
Section 15
//StageMedia (lev.fx.StageMedia)
package lev.fx {
import flash.display.*;
public class StageMedia {
public var imgPedestalL:BitmapData;
private var gfxPump:Class;
private var gfxTheEnd:Class;
public var imgPedestalR:BitmapData;
public var imgTrip:BitmapData;
private var gfxPedestalL:Class;
private var gfxFrogEye2:Class;
private var gfxPedestalR:Class;
public var imgCatL:BitmapData;
public var imgCatR:BitmapData;
private var gfxCatHum:Class;
private var gfxFrogEmo1:Class;
private var gfxFrogEmo2:Class;
public var imgFrogHead:BitmapData;
public var imgCatSmile:BitmapData;
private var gfxFrogHead:Class;
public var imgHintArrow:BitmapData;
private var gfxStageEnd:Class;
private var gfxTrip:Class;
public var imgFrogEye1:BitmapData;
public var imgFrogEye2:BitmapData;
private var gfxHintArrow:Class;
public var imgPump:BitmapData;
private var gfxCatL:Class;
public var imgTheEnd:BitmapData;
private var gfxCatR:Class;
public var imgFrogBody:BitmapData;
public var imgFrogHand1:BitmapData;
public var imgFrogHand2:BitmapData;
public var imgStageEnd:BitmapData;
public var imgParty:BitmapData;
private var gfxFrogHand1:Class;
private var gfxFrogHand2:Class;
private var gfxCatSmile:Class;
public var imgCatHum:BitmapData;
public var imgFrogEmo1:BitmapData;
public var imgFrogEmo2:BitmapData;
private var gfxParty:Class;
private var gfxFrogEye1:Class;
private var gfxFrogBody:Class;
public function StageMedia(){
gfxPedestalL = StageMedia_gfxPedestalL;
gfxPedestalR = StageMedia_gfxPedestalR;
gfxCatR = StageMedia_gfxCatR;
gfxCatL = StageMedia_gfxCatL;
gfxCatSmile = StageMedia_gfxCatSmile;
gfxCatHum = StageMedia_gfxCatHum;
gfxHintArrow = StageMedia_gfxHintArrow;
gfxFrogBody = StageMedia_gfxFrogBody;
gfxFrogEmo1 = StageMedia_gfxFrogEmo1;
gfxFrogEmo2 = StageMedia_gfxFrogEmo2;
gfxFrogEye1 = StageMedia_gfxFrogEye1;
gfxFrogEye2 = StageMedia_gfxFrogEye2;
gfxFrogHand1 = StageMedia_gfxFrogHand1;
gfxFrogHand2 = StageMedia_gfxFrogHand2;
gfxFrogHead = StageMedia_gfxFrogHead;
gfxPump = StageMedia_gfxPump;
gfxParty = StageMedia_gfxParty;
gfxTrip = StageMedia_gfxTrip;
gfxTheEnd = StageMedia_gfxTheEnd;
gfxStageEnd = StageMedia_gfxStageEnd;
super();
imgPedestalL = new gfxPedestalL().bitmapData;
imgPedestalR = new gfxPedestalR().bitmapData;
imgCatR = new gfxCatR().bitmapData;
imgCatL = new gfxCatL().bitmapData;
imgCatSmile = new gfxCatSmile().bitmapData;
imgCatHum = new gfxCatHum().bitmapData;
imgHintArrow = new gfxHintArrow().bitmapData;
imgFrogBody = new gfxFrogBody().bitmapData;
imgFrogEmo1 = new gfxFrogEmo1().bitmapData;
imgFrogEmo2 = new gfxFrogEmo2().bitmapData;
imgFrogEye1 = new gfxFrogEye1().bitmapData;
imgFrogEye2 = new gfxFrogEye2().bitmapData;
imgFrogHand1 = new gfxFrogHand1().bitmapData;
imgFrogHand2 = new gfxFrogHand2().bitmapData;
imgFrogHead = new gfxFrogHead().bitmapData;
imgPump = new gfxPump().bitmapData;
imgParty = new gfxParty().bitmapData;
imgTrip = new gfxTrip().bitmapData;
imgTheEnd = new gfxTheEnd().bitmapData;
imgStageEnd = new gfxStageEnd().bitmapData;
}
}
}//package lev.fx
Section 16
//StageMedia_gfxCatHum (lev.fx.StageMedia_gfxCatHum)
package lev.fx {
import mx.core.*;
public class StageMedia_gfxCatHum extends BitmapAsset {
}
}//package lev.fx
Section 17
//StageMedia_gfxCatL (lev.fx.StageMedia_gfxCatL)
package lev.fx {
import mx.core.*;
public class StageMedia_gfxCatL extends BitmapAsset {
}
}//package lev.fx
Section 18
//StageMedia_gfxCatR (lev.fx.StageMedia_gfxCatR)
package lev.fx {
import mx.core.*;
public class StageMedia_gfxCatR extends BitmapAsset {
}
}//package lev.fx
Section 19
//StageMedia_gfxCatSmile (lev.fx.StageMedia_gfxCatSmile)
package lev.fx {
import mx.core.*;
public class StageMedia_gfxCatSmile extends BitmapAsset {
}
}//package lev.fx
Section 20
//StageMedia_gfxFrogBody (lev.fx.StageMedia_gfxFrogBody)
package lev.fx {
import mx.core.*;
public class StageMedia_gfxFrogBody extends BitmapAsset {
}
}//package lev.fx
Section 21
//StageMedia_gfxFrogEmo1 (lev.fx.StageMedia_gfxFrogEmo1)
package lev.fx {
import mx.core.*;
public class StageMedia_gfxFrogEmo1 extends BitmapAsset {
}
}//package lev.fx
Section 22
//StageMedia_gfxFrogEmo2 (lev.fx.StageMedia_gfxFrogEmo2)
package lev.fx {
import mx.core.*;
public class StageMedia_gfxFrogEmo2 extends BitmapAsset {
}
}//package lev.fx
Section 23
//StageMedia_gfxFrogEye1 (lev.fx.StageMedia_gfxFrogEye1)
package lev.fx {
import mx.core.*;
public class StageMedia_gfxFrogEye1 extends BitmapAsset {
}
}//package lev.fx
Section 24
//StageMedia_gfxFrogEye2 (lev.fx.StageMedia_gfxFrogEye2)
package lev.fx {
import mx.core.*;
public class StageMedia_gfxFrogEye2 extends BitmapAsset {
}
}//package lev.fx
Section 25
//StageMedia_gfxFrogHand1 (lev.fx.StageMedia_gfxFrogHand1)
package lev.fx {
import mx.core.*;
public class StageMedia_gfxFrogHand1 extends BitmapAsset {
}
}//package lev.fx
Section 26
//StageMedia_gfxFrogHand2 (lev.fx.StageMedia_gfxFrogHand2)
package lev.fx {
import mx.core.*;
public class StageMedia_gfxFrogHand2 extends BitmapAsset {
}
}//package lev.fx
Section 27
//StageMedia_gfxFrogHead (lev.fx.StageMedia_gfxFrogHead)
package lev.fx {
import mx.core.*;
public class StageMedia_gfxFrogHead extends BitmapAsset {
}
}//package lev.fx
Section 28
//StageMedia_gfxHintArrow (lev.fx.StageMedia_gfxHintArrow)
package lev.fx {
import mx.core.*;
public class StageMedia_gfxHintArrow extends BitmapAsset {
}
}//package lev.fx
Section 29
//StageMedia_gfxParty (lev.fx.StageMedia_gfxParty)
package lev.fx {
import mx.core.*;
public class StageMedia_gfxParty extends BitmapAsset {
}
}//package lev.fx
Section 30
//StageMedia_gfxPedestalL (lev.fx.StageMedia_gfxPedestalL)
package lev.fx {
import mx.core.*;
public class StageMedia_gfxPedestalL extends BitmapAsset {
}
}//package lev.fx
Section 31
//StageMedia_gfxPedestalR (lev.fx.StageMedia_gfxPedestalR)
package lev.fx {
import mx.core.*;
public class StageMedia_gfxPedestalR extends BitmapAsset {
}
}//package lev.fx
Section 32
//StageMedia_gfxPump (lev.fx.StageMedia_gfxPump)
package lev.fx {
import mx.core.*;
public class StageMedia_gfxPump extends BitmapAsset {
}
}//package lev.fx
Section 33
//StageMedia_gfxStageEnd (lev.fx.StageMedia_gfxStageEnd)
package lev.fx {
import mx.core.*;
public class StageMedia_gfxStageEnd extends BitmapAsset {
}
}//package lev.fx
Section 34
//StageMedia_gfxTheEnd (lev.fx.StageMedia_gfxTheEnd)
package lev.fx {
import mx.core.*;
public class StageMedia_gfxTheEnd extends BitmapAsset {
}
}//package lev.fx
Section 35
//StageMedia_gfxTrip (lev.fx.StageMedia_gfxTrip)
package lev.fx {
import mx.core.*;
public class StageMedia_gfxTrip extends BitmapAsset {
}
}//package lev.fx
Section 36
//Generator (lev.gen.Generator)
package lev.gen {
public class Generator {
private var mapPointer:int;
public var heroSqrDist:Number;
public var pillsCount:int;
public var speed:Number;
public var begining:Boolean;
public var pills:Array;
public var map:Array;
private var pillsMan:Pills;
public var finished:Boolean;
public var counter:Number;
public var regen:Boolean;
public function Generator(){
counter = 0;
speed = 4;
mapPointer = 0;
heroSqrDist = 1200;
regen = true;
pillsMan = Pills.instance;
map = new Array();
pills = new Array();
}
public function update(_arg1:Number):void{
var _local2:*;
var _local3:int;
var _local4:Pill;
var _local6:Pill;
var _local5:int;
counter = (counter + (speed * _arg1));
if (((!(finished)) && ((counter > 1)))){
if (pills.length < map.length){
_local4 = pillsMan.findDead();
if (_local4 != null){
Placer(map[mapPointer]).place(_local4);
pills.push(_local4);
_local4.parent = parentCallback;
_local5++;
mapPointer++;
};
} else {
begining = false;
if (regen){
_local3 = 0;
for each (_local6 in pills) {
if (_local6 == null){
_local6 = pillsMan.findDead();
if (_local6 != null){
if (Placer(map[_local3]).placeAvoidHero(_local6, heroSqrDist) != null){
_local6.parent = parentCallback;
pills[_local3] = _local6;
_local5++;
break;
};
};
};
_local3++;
};
};
};
counter = (counter - int(counter));
pillsMan.actives = (pillsMan.actives + _local5);
pillsCount = (pillsCount + _local5);
};
}
public function clearPills():void{
var _local1:Pill;
if (pills.length > 0){
for each (_local1 in pills) {
if (_local1 != null){
_local1.kill();
};
};
pills.length = 0;
pillsCount = 0;
};
}
public function addCircle(_arg1:Setuper, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:int, _arg6:Number, _arg7:Number):void{
var _local8:int = _arg5;
var _local9:Number = _arg7;
if (_local8 == 0){
_local8 = int((6.28 / _arg6));
};
while (_local8 > 0) {
map.push(new Placer(_arg1, (_arg2 + (_arg4 * Math.cos(_local9))), (_arg3 + (_arg4 * Math.sin(_local9)))));
_local8--;
_local9 = (_local9 + _arg6);
};
}
public function finish():void{
var _local1:Pill;
for each (_local1 in pills) {
if (_local1 != null){
_local1.kill();
};
};
mapPointer = map.length;
pillsCount = 0;
finished = true;
}
public function clearMap():void{
map.length = 0;
mapPointer = 0;
}
public function start():void{
clearPills();
mapPointer = 0;
counter = 0;
pillsCount = 0;
begining = true;
finished = false;
}
public function parentCallback(_arg1:Pill):void{
var _local3:Pill;
var _local2:int;
for each (_local3 in pills) {
if (_local3 == _arg1){
pills[_local2] = null;
pillsCount--;
break;
};
_local2++;
};
}
public function addLine(_arg1:Setuper, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:int):void{
var _local7:int = _arg6;
var _local8:Number = _arg2;
var _local9:Number = _arg3;
while (_local7 > 0) {
map.push(new Placer(_arg1, _local8, _local9));
_local8 = (_local8 + _arg4);
_local9 = (_local9 + _arg5);
_local7--;
};
}
}
}//package lev.gen
Section 37
//JumpStarter (lev.gen.JumpStarter)
package lev.gen {
public class JumpStarter extends Setuper {
override public function start(_arg1:Number, _arg2:Number, _arg3:Pill):Pill{
_arg3.user = userCallback;
_arg3.startJump(_arg1, _arg2);
return (_arg3);
}
}
}//package lev.gen
Section 38
//PartySetuper (lev.gen.PartySetuper)
package lev.gen {
public class PartySetuper extends Setuper {
public var sleeps:Number;
public var dangerH:Number;
public var toxics:Number;
public var jump:Number;
public var powers:Number;
public function PartySetuper(){
powers = 0.8;
sleeps = 0.9;
toxics = 1;
dangerH = 200;
jump = 0;
}
override public function start(_arg1:Number, _arg2:Number, _arg3:Pill):Pill{
var _local4:Number = Math.random();
_arg3.user = userCallback;
if ((((_local4 < powers)) || ((_arg2 > dangerH)))){
_arg3.startPower(_arg1, _arg2, int((Math.random() * 3)), (Math.random() < jump));
} else {
if (_local4 < sleeps){
_arg3.startSleep(_arg1, _arg2);
} else {
_arg3.startToxic(_arg1, _arg2, int((Math.random() * 2)));
};
};
return (_arg3);
}
}
}//package lev.gen
Section 39
//Placer (lev.gen.Placer)
package lev.gen {
public class Placer {
public var x:Number;
public var y:Number;
public var setuper:Setuper;
public function Placer(_arg1:Setuper, _arg2:Number, _arg3:Number){
x = _arg2;
y = _arg3;
setuper = _arg1;
}
public function place(_arg1:Pill):Pill{
return (setuper.start(x, y, _arg1));
}
public function placeAvoidHero(_arg1:Pill, _arg2:Number=0):Pill{
var _local4:Pill;
var _local3:Pills = Pills.instance;
if ((((_arg2 <= 0)) || (!(_local3.tooCloseHero(x, y, _arg2))))){
_local4 = setuper.start(x, y, _arg1);
};
return (_local4);
}
}
}//package lev.gen
Section 40
//PowerSetuper (lev.gen.PowerSetuper)
package lev.gen {
public class PowerSetuper extends Setuper {
public var ids:Array;
public var probJump:Number;
public static const POWERS:Array = [0, 1, 2];
public static const POWER1:Array = [0];
public static const POWER2:Array = [1];
public static const POWER3:Array = [2];
public function PowerSetuper(_arg1:Number, _arg2:Array){
ids = _arg2;
probJump = _arg1;
}
override public function start(_arg1:Number, _arg2:Number, _arg3:Pill):Pill{
var _local5:int;
var _local4:uint = ids.length;
if (_local4 > 0){
if (_local4 > 1){
_local5 = ids[int((Math.random() * _local4))];
} else {
_local5 = ids[0];
};
} else {
_local5 = 0;
};
_arg3.user = userCallback;
_arg3.startPower(_arg1, _arg2, _local5, (Math.random() < probJump));
return (_arg3);
}
}
}//package lev.gen
Section 41
//Setuper (lev.gen.Setuper)
package lev.gen {
public class Setuper {
public var userCallback:Function;
public function start(_arg1:Number, _arg2:Number, _arg3:Pill):Pill{
return (null);
}
}
}//package lev.gen
Section 42
//AirAttack (lev.AirAttack)
package lev {
public class AirAttack extends LevelStage {
private var party:Number;
private var partyCount:int;
private var regen:Number;
public function AirAttack(){
super(1);
goalTime = 60;
}
override public function update(_arg1:Number):void{
var _local2:Pill;
var _local3:int;
var _local4:Number = level.power;
super.update(_arg1);
if (!win){
regen = (regen - _arg1);
if (regen <= 0){
_local2 = pills.findDead();
if (_local2 != null){
_local2.startMissle((10 + (Math.random() * 620)), -10, 0);
_local2.t2 = 0.1;
_local2.vx = (((Math.random() * 300) - 150) * (_local4 + 0.1));
_local2.vy = (((Math.random() * _local4) * 200) + (100 * (1 + _local4)));
_local2.user = rainLogic;
regen = (regen + (2 - (_local4 * 1.5)));
_local3++;
};
};
if (partyCount < 20){
party = (party - _arg1);
if (party <= 0){
_local2 = pills.findDead();
if (_local2 != null){
_local2.startPower((10 + (Math.random() * 620)), (390 - ((Math.random() * 160) * _local4)), int((Math.random() * 3)), false);
_local2.parent = parentParty;
party = (party + (1 - (_local4 * 0.75)));
_local3++;
partyCount++;
};
};
};
};
pills.actives = (pills.actives + _local3);
hero.diveK = 1.5;
}
override public function start():void{
super.start();
startX = 293;
regen = 1;
party = 1;
partyCount = 0;
}
public function rainLogic(_arg1:Pill, _arg2:String, _arg3:Number):void{
if ((((_arg2 == null)) && ((_arg1.state == 2)))){
_arg1.t2 = (_arg1.t2 - _arg3);
if (_arg1.t2 < 0){
_arg1.t2 = 0.05;
particles.startStarToxic(_arg1.x, _arg1.y, -(_arg1.vx), -(_arg1.vy), 0);
};
_arg1.x = (_arg1.x + (_arg1.vx * _arg3));
_arg1.y = (_arg1.y + (_arg1.vy * _arg3));
if ((((_arg1.x < 10)) || ((_arg1.x > 630)))){
_arg1.vx = -(_arg1.vx);
if (_arg1.x < 10){
_arg1.x = 10;
} else {
_arg1.x = 630;
};
};
if (_arg1.y > 390){
particles.explStarsToxic(_arg1.x, _arg1.y, 0, true);
_arg1.kill();
};
};
}
public function parentParty(_arg1:Pill):void{
partyCount--;
}
}
}//package lev
Section 43
//BetweenCatsStage (lev.BetweenCatsStage)
package lev {
import flash.display.*;
import flash.geom.*;
import lev.gen.*;
import lev.fx.*;
public class BetweenCatsStage extends LevelStage {
private var catToxic:Pill;
private var catStage:int;
private var catHum:Number;
private var gen:Generator;
private var catArrow:HintArrow;
private var catAliveL:Boolean;
private var catGen:Number;
private var catAliveR:Boolean;
private var gen1:Generator;
private var gen2:Generator;
private var catFinalAttack:Number;
private var catAttack:Number;
public function BetweenCatsStage(){
var _local1:int;
super(2);
catArrow = new HintArrow(media);
goalTime = 100;
}
private function launchMissle(_arg1:Pill, _arg2:Number, _arg3:Number):void{
_arg1.startMissle(_arg2, _arg3, 0);
if (catStage == 0){
_arg1.t1 = 5;
_arg1.vx = (((27 + level.hero.x) - _arg2) / 1.2);
_arg1.vy = ((((20 + level.hero.y) - _arg3) / 1.2) - (450 * 1.2));
if (_arg1.vy > 100){
_arg1.vy = 100;
} else {
if (_arg1.vy < -100){
_arg1.vy = -100;
};
};
} else {
if (catStage == 1){
_arg1.t1 = 5;
_arg1.vx = (((27 + level.hero.x) - _arg2) / 1.2);
_arg1.vy = ((((20 + level.hero.y) - _arg3) / 1.2) - (450 * 1.2));
if (_arg1.vy > 100){
_arg1.vy = 100;
} else {
if (_arg1.vy < -100){
_arg1.vy = -100;
};
};
} else {
if (catStage == 2){
_arg1.t1 = 5;
_arg1.vx = (((27 + level.hero.x) - _arg2) / 1.2);
_arg1.vy = ((((20 + level.hero.y) - _arg3) / 1.2) - (450 * 1.2));
if (_arg1.vy > 100){
_arg1.vy = 100;
} else {
if (_arg1.vy < -100){
_arg1.vy = -100;
};
};
};
};
};
_arg1.t2 = 0.1;
catToxic = _arg1;
}
public function catPillsCallback(_arg1:Pill, _arg2:String, _arg3:Number):void{
var _local4:Number;
if (_arg2 == null){
_arg1.t1 = (_arg1.t1 + (_arg3 * 0.5));
_local4 = (((Math.cos((_arg1.t1 * 10.064)) * 0.2) + 0.8) * 212);
_arg1.x = (320 - (_local4 * Math.cos(_arg1.t1)));
_arg1.y = (224 - (_local4 * Math.sin(_arg1.t1)));
if (_arg1.state < 3){
if ((((_arg1.t1 > 2.95)) && ((_arg1.t1 < 3.12)))){
catHum = 0.5;
} else {
if (_arg1.t1 >= 3.12){
_arg1.kill();
level.pills.ps.startAcid(_arg1.x, _arg1.y);
catHum = 0;
};
};
};
};
}
public function partyLogic(_arg1:Pill, _arg2:String, _arg3:Number):void{
var _local4:Number = 0.7;
if ((((_arg2 == null)) && (_arg1.enabled))){
_arg1.vy = (_arg1.vy + (300 * _arg3));
_arg1.x = (_arg1.x + (_arg1.vx * _arg3));
_arg1.y = (_arg1.y + (_arg1.vy * _arg3));
if (_arg1.x > 630){
_arg1.vx = (-(_arg1.vx) * _local4);
_arg1.vy = (_arg1.vy * _local4);
_arg1.x = 630;
};
if (_arg1.x < 10){
_arg1.vx = (-(_arg1.vx) * _local4);
_arg1.vy = (_arg1.vy * _local4);
_arg1.x = 10;
};
if (_arg1.y < 10){
_arg1.vy = (-(_arg1.vy) * _local4);
_arg1.vx = (_arg1.vx * _local4);
_arg1.y = 10;
};
if (_arg1.y > 390){
_arg1.vy = (-(_arg1.vy) * _local4);
_arg1.vx = (_arg1.vx * _local4);
_arg1.y = 390;
};
} else {
if (_arg2 == "born"){
_arg1.vx = (300 * ((Math.random() * 2) - 1));
_arg1.vy = (-300 - (Math.random() * 200));
};
};
}
override public function start():void{
var _local5:int;
var _local1:JumpStarter = new JumpStarter();
var _local2:PartySetuper = new PartySetuper();
var _local3:Placer = new Placer(_local2, 105, 296);
var _local4:Placer = new Placer(_local2, 535, 296);
_local2.userCallback = partyLogic;
super.start();
gen = new Generator();
gen.map.push(new Placer(_local1, 300, 370));
gen.map.push(new Placer(_local1, 340, 340));
gen.map.push(new Placer(_local1, 300, 310));
gen.map.push(new Placer(_local1, 340, 280));
gen.map.push(new Placer(_local1, 500, 250));
gen.map.push(new Placer(_local1, 540, 220));
gen.map.push(new Placer(_local1, 500, 190));
gen.map.push(new Placer(_local1, 540, 160));
gen.map.push(new Placer(_local1, 100, 250));
gen.map.push(new Placer(_local1, 140, 220));
gen.map.push(new Placer(_local1, 100, 190));
gen.map.push(new Placer(_local1, 140, 160));
gen.regen = false;
gen.heroSqrDist = 0;
gen.start();
gen1 = new Generator();
gen2 = new Generator();
gen1.regen = (gen2.regen = false);
_local5 = 40;
while (_local5 > 0) {
gen1.map.push(_local3);
_local5--;
};
_local5 = 40;
while (_local5 > 0) {
gen2.map.push(_local4);
_local5--;
};
pills.findDead().startMatrix(320, 100);
pills.findDead().startToxic(220, 180, 1);
pills.findDead().startToxic(420, 180, 1);
pills.actives = (pills.actives + 3);
catGen = 1;
catHum = 0;
catAttack = 0;
catFinalAttack = 0;
catToxic = null;
catAliveL = true;
catAliveR = true;
catStage = 0;
catArrow.place(110, 150, 0, 4294418657, false);
startX = 293;
}
override public function update(_arg1:Number):void{
var _local2:Pill;
var _local4:Number;
var _local5:*;
var _local3:int;
super.update(_arg1);
if (!catAliveL){
gen1.update(_arg1);
};
if (!catAliveR){
gen2.update(_arg1);
};
gen.update(_arg1);
if (level.power >= 0.5){
gen.clearPills();
gen.clearMap();
};
if (catToxic != null){
if (catToxic.state != 0){
if (catToxic.state < 3){
catToxic.t2 = (catToxic.t2 - _arg1);
if (catToxic.t2 < 0){
catToxic.t2 = 0.05;
pills.ps.startStarToxic(catToxic.x, catToxic.y, (-(catToxic.vx) * 0.2), (-(catToxic.vy) * 0.2), 0);
};
catToxic.vy = (catToxic.vy + (900 * _arg1));
catToxic.x = (catToxic.x + (catToxic.vx * _arg1));
catToxic.y = (catToxic.y + (catToxic.vy * _arg1));
catToxic.t1 = (catToxic.t1 - _arg1);
if ((((catToxic.x < 10)) || ((catToxic.x > 630)))){
catToxic.vx = (-(catToxic.vx) * 0.7);
if (catToxic.x < 10){
catToxic.x = 10;
} else {
catToxic.x = 630;
};
};
if ((((catToxic.y > 390)) || ((catToxic.y < 10)))){
catToxic.vy = (-(catToxic.vy) * 0.7);
if (catToxic.y < 10){
catToxic.y = 10;
} else {
catToxic.y = 390;
};
};
if (catToxic.t1 < 0){
pills.ps.explStarsToxic(catToxic.x, catToxic.y, 0, true);
catToxic.kill();
};
};
} else {
catToxic = null;
};
};
if (level.power >= 0.5){
if (catHum > 0){
catHum = (catHum - _arg1);
};
catGen = (catGen + (_arg1 * 2));
if (catGen > 1){
_local2 = pills.findDead();
if (_local2 != null){
if (catStage == 0){
_local2.startPower(107, 224, 1, false);
_local2.t1 = 0;
_local2.user = catPillsCallback;
catGen = (catGen - 1);
_local3++;
};
};
};
if (catStage != 0){
catAttack = (catAttack - _arg1);
if (((((((catAliveR) && ((catHum <= 0)))) && ((catAttack < 0)))) && ((catToxic == null)))){
_local2 = pills.findDead();
if (_local2 != null){
launchMissle(_local2, 532, 221);
if (catStage == 0){
catAttack = 5;
} else {
if (catStage == 1){
catAttack = 2;
} else {
if (catStage == 2){
catAttack = 1.5;
};
};
};
catHum = 0.5;
_local3++;
};
};
};
catArrow.update(_arg1);
};
switch (catStage){
case 0:
if (collected >= 25){
catStage = 1;
catArrow.visible = true;
};
break;
case 1:
if ((((((((level.hero.x >= (76 - 54))) && ((level.hero.x <= 140)))) && ((level.hero.yLast < (178 - 40))))) && ((level.hero.y >= (178 - 40))))){
level.hero.jump(120);
level.env.blanc = 1;
catAliveL = false;
catStage = 2;
catFinalAttack = 15;
catArrow.x = 532;
catArrow.visible = false;
catArrow.visibleCounter = 0;
utils.ctSetRGB(catArrow.color, 0xFFB300);
};
break;
case 2:
catFinalAttack = (catFinalAttack - _arg1);
catArrow.visible = (catFinalAttack <= 5);
if (catFinalAttack < 0){
catFinalAttack = 15;
} else {
if (catFinalAttack < 5){
catAttack = 5;
if ((((((((level.hero.x >= (500 - 54))) && ((level.hero.x <= 566)))) && ((level.hero.yLast < (178 - 40))))) && ((level.hero.y >= (178 - 40))))){
level.hero.jump(120);
level.env.blanc = 1;
catAliveR = false;
catStage = 3;
catArrow.visible = false;
};
};
};
break;
};
pills.actives = (pills.actives + _local3);
}
override public function draw1(_arg1:BitmapData):void{
var _local2:Rectangle;
var _local3:Point;
var _local4:BitmapData;
var _local5:*;
if (level.power >= 0.5){
_local2 = new Rectangle();
_local3 = new Point();
if (catAliveL){
_local4 = media.imgCatL;
_local2.width = _local4.width;
_local2.height = _local4.height;
_local3.x = 54;
_local3.y = 137;
_arg1.copyPixels(_local4, _local2, _local3);
if (catGen < 0.5){
_local4 = media.imgCatHum;
_local2.width = _local4.width;
_local2.height = _local4.height;
_local3.x = 92;
_local3.y = 212;
_arg1.copyPixels(_local4, _local2, _local3);
} else {
_local4 = media.imgCatSmile;
_local2.width = _local4.width;
_local2.height = _local4.height;
_local3.x = 92;
_local3.y = 219;
_arg1.copyPixels(_local4, _local2, _local3);
};
};
if (catAliveR){
_local4 = media.imgCatR;
_local2.width = _local4.width;
_local2.height = _local4.height;
_local3.x = 384;
_local3.y = 134;
_arg1.copyPixels(_local4, _local2, _local3);
if (catHum > 0){
_local4 = media.imgCatHum;
_local2.width = _local4.width;
_local2.height = _local4.height;
_local3.x = 517;
_local3.y = 209;
_arg1.copyPixels(_local4, _local2, _local3);
} else {
_local4 = media.imgCatSmile;
_local2.width = _local4.width;
_local2.height = _local4.height;
_local3.x = 516;
_local3.y = 216;
_arg1.copyPixels(_local4, _local2, _local3);
};
};
_local4 = media.imgPedestalL;
_local2.width = _local4.width;
_local2.height = _local4.height;
_local3.x = 0;
_local3.y = 286;
_arg1.copyPixels(_local4, _local2, _local3);
_local4 = media.imgPedestalR;
_local2.width = _local4.width;
_local2.height = _local4.height;
_local3.x = 408;
_local3.y = 288;
_arg1.copyPixels(_local4, _local2, _local3);
catArrow.draw(_arg1);
};
}
}
}//package lev
Section 44
//Bubbles (lev.Bubbles)
package lev {
import flash.display.*;
import lev.gen.*;
import lev.fx.*;
public class Bubbles extends LevelStage {
private var arrow1:HintArrow;
private var arrow2:HintArrow;
private var arrow3:HintArrow;
private var count:int;
public var gen:Generator;
private var danger:int;
private var arrowHider:Number;
public var setuper:PartySetuper;
private var counter:Number;
public var jumper:JumpStarter;
private var x:Number;
public function Bubbles(_arg1:Array){
super(0);
pumpVel = _arg1[0];
danger = _arg1[1];
arrow1 = new HintArrow(media);
arrow2 = new HintArrow(media);
arrow3 = new HintArrow(media);
}
override public function onWin():void{
gen.finish();
}
override public function update(_arg1:Number):void{
var _local2:*;
var _local4:Pill;
var _local3:int;
super.update(_arg1);
gen.update(_arg1);
if (count > 0){
counter = (counter - _arg1);
if (counter <= 0){
_local4 = pills.findDead();
if (_local4 != null){
setuper.start(((x - 150) + (Math.random() * 300)), 380, _local4);
pills.actives++;
};
count--;
counter = 0.1;
};
};
if (hero.y < 0){
hero.y = 0;
if (hero.jumpVel > 0){
hero.jumpVel = 0;
};
};
if (arrowHider > 0){
arrowHider = (arrowHider - _arg1);
if (arrowHider <= 0){
arrow1.visible = (arrow2.visible = (arrow3.visible = false));
};
};
arrow1.update(_arg1);
arrow2.update(_arg1);
arrow3.update(_arg1);
}
public function jumpLogic(_arg1:Pill, _arg2:String, _arg3:Number):void{
var _local4:Number;
var _local5:Pill;
var _local6:int;
if (_arg2 == null){
_arg1.y = (420 - hero.getJumpHeight());
if (_arg1.y < 90){
_arg1.y = 90;
};
} else {
if (_arg2 == "born"){
_arg1.y = (420 - hero.getJumpHeight());
} else {
if (_arg2 == "jump"){
x = _arg1.x;
count = (count + (2 + (level.power * 5)));
};
};
};
}
override public function start():void{
var _local1:Number = 350;
var _local2:Number = 40;
var _local3:Number = 110;
var _local4:Number = 30;
super.start();
setuper = new PartySetuper();
setuper.userCallback = partyLogic;
jumper = new JumpStarter();
jumper.userCallback = jumpLogic;
if (danger == 0){
setuper.dangerH = 0;
setuper.jump = 0.1;
} else {
if (danger == 1){
setuper.powers = 0.8;
setuper.sleeps = 0.9;
setuper.toxics = 1;
setuper.dangerH = 400;
setuper.jump = 0.1;
} else {
if (danger == 2){
setuper.powers = 0.6;
setuper.sleeps = 0.8;
setuper.toxics = 1;
setuper.dangerH = 400;
setuper.jump = 0.1;
};
};
};
gen = new Generator();
gen.regen = false;
gen.speed = 4;
gen.map.push(new Placer(jumper, 320, 380));
gen.map.push(new Placer(jumper, 170, 380));
gen.map.push(new Placer(jumper, 470, 380));
gen.start();
counter = 0.1;
count = 0;
x = 320;
if (Math.random() > 0.5){
startX = 218;
} else {
startX = 368;
};
arrow1.place(320, 350, 0, 4294947584, true);
arrow2.place(170, 350, 0, 4294947584, true);
arrow3.place(470, 350, 0, 4294947584, true);
arrow1.visibleCounter = 0;
arrow2.visibleCounter = 0;
arrow3.visibleCounter = 0;
arrow1.visible = true;
arrow2.visible = true;
arrow3.visible = true;
arrowHider = 3;
}
override public function draw1(_arg1:BitmapData):void{
arrow1.draw(_arg1);
arrow2.draw(_arg1);
arrow3.draw(_arg1);
}
public function partyLogic(_arg1:Pill, _arg2:String, _arg3:Number):void{
var _local4:Number;
if ((((_arg2 == null)) && (_arg1.enabled))){
_arg1.vy = (_arg1.vy - (((level.power + 0.1) * 30) * _arg3));
_arg1.vx = (_arg1.vx + ((200 * Math.sin(((_arg1.t1 + _arg1.t2) * 6.2831))) * _arg3));
_arg1.x = (_arg1.x + (_arg1.vx * _arg3));
_arg1.y = (_arg1.y + (_arg1.vy * _arg3));
if (_arg1.x >= 630){
_arg1.vx = -(_arg1.vx);
_arg1.t1 = -(_arg1.t1);
_arg1.x = 630;
};
if (_arg1.x <= 10){
_arg1.vx = -(_arg1.vx);
_arg1.t1 = -(_arg1.t1);
_arg1.x = 10;
};
_arg1.t2 = (_arg1.t2 + _arg3);
if (_arg1.y <= -10){
_arg1.die();
};
} else {
if (_arg2 == "born"){
_arg1.t1 = Math.random();
_arg1.t2 = (0.5 + Math.random());
_arg1.vx = (-10 + (Math.random() * 20));
_arg1.vy = (-5 - ((50 * level.power) * Math.random()));
};
};
}
}
}//package lev
Section 45
//DoubleFrog (lev.DoubleFrog)
package lev {
import flash.display.*;
import lev.gen.*;
import lev.fx.*;
public class DoubleFrog extends LevelStage {
private var arrow1:HintArrow;
private var arrow2:HintArrow;
private var frog1:FrogActor;
private var gen:Generator;
private var frog2:FrogActor;
private var jumper:JumpStarter;
private var frog2c:Number;
private var frogGen1:Generator;
private var frogGen2:Generator;
private var arrowHider:Number;
private var setuper:PartySetuper;
private var frog1c:Number;
public function DoubleFrog(){
super(2);
goalTime = 100;
frog1 = new FrogActor(media);
frog2 = new FrogActor(media);
frog1.speedHands = 5;
frog2.speedHands = 5;
frog1.x = 0;
frog2.x = (640 - 144);
frog2.y = (frog1.y = (400 - 64));
arrow1 = new HintArrow(media);
arrow2 = new HintArrow(media);
}
override public function onWin():void{
gen.finish();
}
override public function update(_arg1:Number):void{
var _local2:*;
var _local4:Pill;
var _local3:int;
super.update(_arg1);
gen.update(_arg1);
if (((frog1.open) && ((frog1.openCounter >= 1)))){
frogGen1.update(_arg1);
frog1c = (frog1c - _arg1);
if (frog1c <= 0){
frog1c = 0;
frog1.open = false;
};
};
if (((frog2.open) && ((frog2.openCounter >= 1)))){
frogGen2.update(_arg1);
frog2c = (frog2c - _arg1);
if (frog2c <= 0){
frog2c = 0;
frog2.open = false;
};
};
frog1.update(_arg1);
frog2.update(_arg1);
if (arrowHider > 0){
arrowHider = (arrowHider - _arg1);
if (arrowHider <= 0){
arrow1.visible = (arrow2.visible = false);
};
};
arrow1.update(_arg1);
arrow2.update(_arg1);
}
public function jumpLogic(_arg1:Pill, _arg2:String, _arg3:Number):void{
var _local4:FrogActor;
if (_arg2 == "jump"){
if (_arg1.x > 320){
_local4 = frog1;
frog1c = 3;
} else {
_local4 = frog2;
frog2c = 3;
};
if (_local4.openCounter <= 0){
_local4.open = true;
};
};
}
override public function start():void{
var _local1:Placer;
super.start();
setuper = new PartySetuper();
setuper.userCallback = partyLogic;
jumper = new JumpStarter();
jumper.userCallback = jumpLogic;
setuper.dangerH = 0;
setuper.jump = 0.1;
frogGen1 = new Generator();
frogGen1.regen = true;
frogGen1.speed = 4;
_local1 = new Placer(setuper, 72, 346);
frogGen1.map.push(_local1);
frogGen1.map.push(_local1);
frogGen1.map.push(_local1);
frogGen1.map.push(_local1);
frogGen1.map.push(_local1);
frogGen1.map.push(_local1);
frogGen1.map.push(_local1);
frogGen1.map.push(_local1);
frogGen1.map.push(_local1);
frogGen1.map.push(_local1);
frogGen2 = new Generator();
frogGen2.regen = true;
frogGen2.speed = 4;
_local1 = new Placer(setuper, (640 - 72), 346);
frogGen2.map.push(_local1);
frogGen2.map.push(_local1);
frogGen2.map.push(_local1);
frogGen2.map.push(_local1);
frogGen2.map.push(_local1);
frogGen2.map.push(_local1);
frogGen2.map.push(_local1);
frogGen2.map.push(_local1);
frogGen2.map.push(_local1);
frogGen2.map.push(_local1);
frog1c = 0;
frog2c = 0;
gen = new Generator();
gen.regen = false;
gen.speed = 4;
gen.map.push(new Placer(jumper, 170, 380));
gen.map.push(new Placer(jumper, 470, 380));
arrow1.place(190, 360, (3.14 * 0.25), 4294418657, true);
arrow2.place(450, 360, (-3.14 * 0.25), 4294418657, true);
arrow1.visibleCounter = 0;
arrow2.visibleCounter = 0;
arrow1.visible = true;
arrow2.visible = true;
arrowHider = 3;
gen.start();
startX = 293;
}
override public function draw1(_arg1:BitmapData):void{
frog1.draw(_arg1);
frog2.draw(_arg1);
arrow1.draw(_arg1);
arrow2.draw(_arg1);
}
public function partyLogic(_arg1:Pill, _arg2:String, _arg3:Number):void{
var _local4:Number = (0.7 + (level.power * 0.3));
if ((((_arg2 == null)) && (_arg1.enabled))){
_arg1.vy = (_arg1.vy + (300 * _arg3));
_arg1.x = (_arg1.x + (_arg1.vx * _arg3));
_arg1.y = (_arg1.y + (_arg1.vy * _arg3));
if (_arg1.x > 630){
_arg1.vx = (-(_arg1.vx) * _local4);
_arg1.vy = (_arg1.vy * _local4);
_arg1.x = 630;
};
if (_arg1.x < 10){
_arg1.vx = (-(_arg1.vx) * _local4);
_arg1.vy = (_arg1.vy * _local4);
_arg1.x = 10;
};
if (_arg1.y < 10){
_arg1.vy = (-(_arg1.vy) * _local4);
_arg1.vx = (_arg1.vx * _local4);
_arg1.y = 10;
};
if (_arg1.y > 390){
_arg1.vy = (-(_arg1.vy) * _local4);
_arg1.vx = (_arg1.vx * _local4);
_arg1.y = 390;
};
} else {
if (_arg2 == "born"){
_arg1.vx = ((150 + (150 * level.power)) * ((Math.random() * 2) - 1));
_arg1.vy = ((-100 - (Math.random() * 200)) - (200 * level.power));
};
};
}
}
}//package lev
Section 46
//Harvesting (lev.Harvesting)
package lev {
import flash.display.*;
import lev.gen.*;
public class Harvesting extends LevelStage {
public var powers1:PowerSetuper;
public var powers2:PowerSetuper;
public var powers3:PowerSetuper;
public var gen:Generator;
public var prog:Number;
public function Harvesting(){
super(0);
pumpVel = 0.2;
}
override public function start():void{
super.start();
startX = 293;
win = false;
prog = 0;
gen = new Generator();
powers1 = new PowerSetuper(0, PowerSetuper.POWER1);
powers2 = new PowerSetuper(0.3, PowerSetuper.POWER2);
powers3 = new PowerSetuper(1, PowerSetuper.POWER3);
powers1.userCallback = pillLogic;
powers2.userCallback = pillLogic;
powers3.userCallback = pillLogic;
gen.regen = true;
gen.addLine(powers1, 40, 340, 40, 0, 15);
gen.start();
}
override public function update(_arg1:Number):void{
var _local2:*;
var _local3:int;
super.update(_arg1);
gen.update(_arg1);
for each (_local2 in gen.map) {
if (_local3 < 15){
Placer(_local2).y = (380 - hero.getJumpHeight());
} else {
if (_local3 < 30){
Placer(_local2).y = (380 - (hero.getJumpHeight() * 0.5));
} else {
if (_local3 < 45){
break;
};
};
};
_local3++;
};
if ((((gen.map.length < 30)) && ((level.power > 0.33)))){
_local3 = (380 - (hero.getJumpHeight() * 0.5));
gen.addLine(powers2, 40, _local3, 40, 0, 15);
} else {
if ((((gen.map.length < 45)) && ((level.power > 0.66)))){
_local3 = 370;
gen.addLine(powers3, 40, _local3, 40, 0, 15);
};
};
}
public function pillLogic(_arg1:Pill, _arg2:String, _arg3:Number):void{
var _local4:Number;
if (_arg2 == null){
_local4 = _arg1.t1;
_local4 = (_local4 + (_arg3 * (0.5 + (level.power * 0.5))));
if (_local4 > 1){
_local4 = (_local4 - int(_local4));
};
_arg1.t1 = _local4;
_arg1.y = ((380 - (hero.getJumpHeight() * _arg1.t2)) + (10 * Math.sin((_arg1.t1 * 6.28))));
} else {
if (_arg2 == "born"){
_arg1.t1 = 0;
_arg1.t2 = ((380 - _arg1.y) / hero.getJumpHeight());
};
};
}
override public function draw1(_arg1:BitmapData):void{
}
override public function onWin():void{
gen.regen = false;
}
}
}//package lev
Section 47
//LevelStage (lev.LevelStage)
package lev {
import flash.display.*;
import flash.geom.*;
import lev.fx.*;
import flash.text.*;
public class LevelStage {
public var goalTime:Number;
protected var type:int;
protected var level:Level;
public var collected:int;
protected var pumpVel:Number;
protected var startTitle:BitmapData;
protected var pills:Pills;
protected var end:Boolean;
public var win:Boolean;
protected var startCounter:Number;
protected var pumpProg:Number;
public var media:StageMedia;
protected var heroStarted:Boolean;
protected var endImg:BitmapData;
protected var env:Env;
protected var endCounter:Number;
protected var startX:Number;
protected var hero:Hero;
protected var particles:Particles;
public function LevelStage(_arg1:int){
level = Level.instance;
media = level.stageMedia;
pills = level.pills;
particles = level.pills.ps;
hero = level.hero;
env = level.env;
if (_arg1 == 0){
goalTime = 2;
pumpVel = 1;
} else {
if (_arg1 == 1){
};
};
type = _arg1;
}
public function draw1(_arg1:BitmapData):void{
}
public function update(_arg1:Number):void{
var _local2:Number;
var _local3:int;
var _local4:String;
if (!heroStarted){
heroStarted = true;
hero.start(startX);
};
if (!win){
if (type == 0){
level.progress.updateProgress((level.power + pumpProg));
if (level.power >= 1){
pumpProg = (pumpProg + (_arg1 * pumpVel));
if (pumpProg > 1){
pumpProg = 1;
};
};
_local4 = (int((level.progress.perc * 100)).toString() + "%");
if (level.infoText.text != _local4){
level.infoText.text = _local4;
};
} else {
if (type == 1){
level.progress.updateProgress(pumpProg);
if ((((startTitle == null)) && ((pumpProg < goalTime)))){
pumpProg = (pumpProg + _arg1);
if (pumpProg > goalTime){
pumpProg = goalTime;
};
};
_local2 = ((1 - level.progress.perc) * goalTime);
_local3 = (_local2 / 60);
if (_local3 < 10){
_local4 = (("0" + _local3.toString()) + ":");
} else {
_local4 = (_local3.toString() + ":");
};
_local3 = (int(_local2) % 60);
if (_local3 < 10){
_local4 = (_local4 + ("0" + _local3.toString()));
} else {
_local4 = (_local4 + _local3.toString());
};
if (level.infoText.text != _local4){
level.infoText.text = _local4;
};
} else {
if (type == 2){
level.progress.updateProgress(collected);
_local4 = ((collected.toString() + " OF ") + int(goalTime).toString());
if (level.infoText.text != _local4){
level.infoText.text = _local4;
};
};
};
};
if (level.progress.full){
win = true;
level.infoText.text = "";
this.onWin();
end = true;
endImg = media.imgStageEnd;
endCounter = 0;
} else {
if (((!(end)) && ((hero.state.health <= 0)))){
level.infoText.text = "";
end = true;
endImg = media.imgTheEnd;
endCounter = 0;
};
};
};
if (end){
endCounter = (endCounter + _arg1);
};
if (((!((startTitle == null))) && ((startCounter < 5)))){
startCounter = (startCounter + _arg1);
if (startCounter >= 5){
startCounter = 5;
startTitle = null;
};
};
}
public function onWin():void{
}
public function draw2(_arg1:BitmapData):void{
var _local2:ColorTransform = new ColorTransform();
var _local3:Matrix = new Matrix();
var _local4:Number = startCounter;
var _local5:Number = startCounter;
var _local6:TextField = level.infoText;
if (((!((startTitle == null))) && ((_local4 < 5)))){
if (_local5 > 4){
_local5 = (5 - _local5);
} else {
if (_local5 > 2){
_local5 = 1;
} else {
_local5 = (_local5 * 0.5);
};
};
_local2.alphaMultiplier = _local5;
_local3.tx = (320 - (startTitle.width * 0.5));
_local3.ty = 180;
_arg1.draw(startTitle, _local3, _local2);
if (_local6.text.length != 0){
_local3.tx = (-(_local6.textWidth) * 0.5);
_local3.ty = (-(_local6.textHeight) * 0.5);
if (_local4 < 2){
_local5 = (Math.sin(((2.355 * _local4) / 2)) * 1.4148);
} else {
if (_local4 < 4){
_local5 = 1;
} else {
_local5 = (5 - _local4);
};
};
_local3.scale(_local5, _local5);
_local3.translate(320, 230);
_arg1.draw(_local6, _local3);
if (_local4 > 4){
_local5 = (_local4 - 4);
_local3.identity();
_local3.tx = (-(_local6.textWidth) * 0.5);
_local3.ty = (-(_local6.textHeight) * 0.5);
_local3.scale(_local5, _local5);
_local3.translate(320, (410 + (_local6.textHeight * 0.5)));
_arg1.draw(_local6, _local3);
};
};
} else {
if (_local6.text.length != 0){
_local3.tx = (320 - (_local6.textWidth * 0.5));
_local3.ty = 410;
_arg1.draw(_local6, _local3);
};
};
if (((end) && ((endCounter < 2)))){
_local3.identity();
_local3.tx = (320 - (endImg.width * 0.5));
_local3.ty = 180;
_local4 = endCounter;
if (_local4 > 1){
_local2.alphaMultiplier = ((Math.cos((3.14 * (_local4 - 1))) * 0.5) + 0.5);
} else {
_local2.alphaMultiplier = 1;
};
_arg1.draw(endImg, _local3, _local2);
};
}
public function start():void{
win = false;
startCounter = 0;
if (type == 0){
startTitle = media.imgPump;
} else {
if (type == 1){
startTitle = media.imgParty;
} else {
startTitle = media.imgTrip;
};
};
pumpProg = 0;
collected = 0;
startX = (Math.random() * (640 - 54));
heroStarted = false;
end = false;
}
}
}//package lev
Section 48
//PartyTime (lev.PartyTime)
package lev {
import flash.display.*;
import lev.gen.*;
public class PartyTime extends LevelStage {
public var gen:Generator;
private var danger:int;
public var setuper:PartySetuper;
public function PartyTime(_arg1:Array){
super(1);
goalTime = _arg1[0];
danger = _arg1[1];
}
override public function update(_arg1:Number):void{
var _local2:*;
var _local3:int;
super.update(_arg1);
if (gen.speed > 2){
gen.speed = (gen.speed - (_arg1 * 0.5));
if (gen.speed < 2){
gen.speed = 2;
};
};
gen.update(_arg1);
}
override public function start():void{
var _local1:Number = 350;
var _local2:Number = 40;
var _local3:Number = 110;
var _local4:Number = 30;
super.start();
setuper = new PartySetuper();
if (danger == 0){
setuper.dangerH = 0;
setuper.jump = 0.1;
} else {
if (danger == 1){
setuper.powers = 0.8;
setuper.sleeps = 0.9;
setuper.toxics = 1;
setuper.dangerH = 200;
setuper.jump = 0.1;
} else {
if (danger == 2){
setuper.powers = 0.6;
setuper.sleeps = 0.8;
setuper.toxics = 1;
setuper.dangerH = 300;
setuper.jump = 0.1;
};
};
};
gen = new Generator();
gen.regen = true;
gen.speed = 8;
while (_local1 >= 50) {
gen.addLine(setuper, (_local2 + (_local3 * 0.5)), _local1, _local3, 0, 5);
gen.addLine(setuper, _local2, (_local1 - _local4), _local3, 0, 6);
_local1 = (_local1 - (_local4 * 2));
};
gen.start();
startX = (20 + (600 * Math.random()));
}
override public function draw1(_arg1:BitmapData):void{
}
override public function onWin():void{
gen.regen = false;
}
}
}//package lev
Section 49
//Trains (lev.Trains)
package lev {
import flash.display.*;
import flash.geom.*;
import lev.gen.*;
import lev.fx.*;
public class Trains extends LevelStage {
private var jumpGen:Generator;
private var frog:FrogActor;
private var cat:FrogActor;
private var frogCounter:Number;
private var catGen:Number;
public function Trains(){
super(2);
goalTime = 100;
frog = new FrogActor(media);
frog.speedHands = 2;
frog.x = 10;
frog.y = 253;
}
override public function update(_arg1:Number):void{
var _local2:*;
var _local4:Pill;
var _local3:int;
var _local5:int;
super.update(_arg1);
jumpGen.update(_arg1);
frog.update(_arg1);
if (((((frog.open) && ((frog.openCounter >= 0.5)))) && (!(win)))){
frogCounter = (frogCounter + (_arg1 * (0.5 + (level.power * 2))));
if (frogCounter >= 1){
_local4 = pills.findDead();
if (_local4 != null){
_local4.user = toxicLogic;
if (Math.random() > 0.2){
_local4.startMissle(80, 260, 1);
} else {
_local4.startSleep(80, 260);
};
_local5++;
};
frogCounter = (frogCounter - int(frogCounter));
};
} else {
frogCounter = 1;
};
frog.speedHands = (2 + (level.power * 2));
if ((((level.power >= 0.5)) && (!(win)))){
catGen = (catGen + (_arg1 * (0.25 + (0.75 * (level.power - 0.5)))));
if (catGen > 1){
_local4 = pills.findDead();
if (_local4 != null){
_local4.user = rocketLogic;
_local4.startMissle(548, 228, 0);
_local4.t2 = 0.1;
catGen = (catGen - 1);
_local5++;
};
};
} else {
catGen = 1;
};
frog.open = (((hero.y <= 250)) && (!(win)));
pills.actives = (pills.actives + _local5);
}
public function toxicLogic(_arg1:Pill, _arg2:String, _arg3:Number):void{
var _local4:int;
var _local5:Pill;
if ((((_arg2 == null)) && ((_arg1.state == 2)))){
if ((((_arg1.x >= 630)) || ((_arg1.x <= 10)))){
_arg1.kill();
if (_arg1.type == 1){
particles.explStarsToxic(_arg1.x, _arg1.y, 1, false);
} else {
if (_arg1.type == 2){
particles.explStarsSleep(_arg1.x, _arg1.y);
};
};
} else {
_arg1.x = (_arg1.x + ((_arg1.t1 * (1 + (4 * level.power))) * _arg3));
};
} else {
if (_arg2 == "attack"){
_local4 = (1 + int((level.power * 5)));
while (_local4 > 0) {
_local5 = pills.findDead();
if (_local5 != null){
_local5.user = partyLogic;
_local5.startPower(_arg1.x, _arg1.y, int((Math.random() * 3)), false);
pills.actives++;
};
_local4--;
};
} else {
if (_arg2 == "born"){
if (_arg1.x > 320){
_arg1.t1 = -40;
} else {
_arg1.t1 = 40;
};
};
};
};
}
override public function start():void{
var _local1:JumpStarter = new JumpStarter();
super.start();
jumpGen = new Generator();
jumpGen.regen = false;
jumpGen.speed = 4;
jumpGen.map.push(new Placer(_local1, 160, 370));
jumpGen.map.push(new Placer(_local1, 480, 370));
jumpGen.map.push(new Placer(_local1, 200, 340));
jumpGen.map.push(new Placer(_local1, 440, 340));
jumpGen.map.push(new Placer(_local1, 240, 310));
jumpGen.map.push(new Placer(_local1, 400, 310));
jumpGen.map.push(new Placer(_local1, 280, 280));
jumpGen.map.push(new Placer(_local1, 360, 280));
jumpGen.map.push(new Placer(_local1, 320, 250));
jumpGen.start();
env.day = false;
env.updateNorm();
frog.openCounter = 0;
frog.open = true;
frogCounter = 1;
catGen = 1;
startX = 293;
}
public function rocketLogic(_arg1:Pill, _arg2:String, _arg3:Number):void{
var _local4:int;
var _local5:Pill;
var _local6:Number = level.power;
if ((((_arg2 == null)) && ((_arg1.state == 2)))){
if (_local6 >= 0.5){
_arg1.t2 = (_arg1.t2 - _arg3);
if (_arg1.t2 < 0){
_arg1.t2 = 0.1;
particles.startStarToxic((_arg1.x + 12), _arg1.y, (100 * _local6), 0, 0);
};
if (_arg1.x <= 10){
_arg1.kill();
particles.explStarsToxic(_arg1.x, _arg1.y, 0, true);
} else {
_arg1.x = (_arg1.x - ((100 * _local6) * _arg3));
};
};
} else {
if (_arg2 == "attack"){
_local4 = (1 + int((_local6 * 5)));
while (_local4 > 0) {
_local5 = pills.findDead();
if (_local5 != null){
_local5.user = partyLogic;
_local5.startPower(_arg1.x, _arg1.y, int((Math.random() * 3)), false);
pills.actives++;
};
_local4--;
};
};
};
}
override public function draw1(_arg1:BitmapData):void{
var _local4:BitmapData;
var _local5:*;
var _local2:Rectangle = new Rectangle();
var _local3:Point = new Point();
_local4 = media.imgCatL;
_local2.width = _local4.width;
_local2.height = _local4.height;
_local3.x = 495;
_local3.y = 140;
_arg1.copyPixels(_local4, _local2, _local3);
if (catGen < 0.5){
_local4 = media.imgCatHum;
_local2.width = _local4.width;
_local2.height = _local4.height;
_local3.x = 533;
_local3.y = 212;
_arg1.copyPixels(_local4, _local2, _local3);
} else {
_local4 = media.imgCatSmile;
_local2.width = _local4.width;
_local2.height = _local4.height;
_local3.x = 533;
_local3.y = 219;
_arg1.copyPixels(_local4, _local2, _local3);
};
frog.draw(_arg1);
_local4 = media.imgPedestalL;
_local2.width = _local4.width;
_local2.height = _local4.height;
_local3.x = -27;
_local3.y = (400 - 115);
_arg1.copyPixels(_local4, _local2, _local3);
_local4 = media.imgPedestalR;
_local2.width = _local4.width;
_local2.height = _local4.height;
_local3.x = 432;
_local3.y = (400 - 113);
_arg1.copyPixels(_local4, _local2, _local3);
}
override public function onWin():void{
jumpGen.finish();
}
public function partyLogic(_arg1:Pill, _arg2:String, _arg3:Number):void{
var _local6:Number;
var _local7:Number;
var _local4:Number = level.power;
var _local5:Number = (0.8 - (_local4 * 0.1));
if ((((_arg2 == null)) && (_arg1.enabled))){
_local6 = ((hero.x - _arg1.x) + 27);
_local7 = ((hero.y - _arg1.y) + 20);
_arg1.vy = (_arg1.vy + ((300 + (_local7 * 10)) * _arg3));
_arg1.vx = (_arg1.vx + ((_local6 * 5) * _arg3));
_arg1.x = (_arg1.x + (_arg1.vx * _arg3));
_arg1.y = (_arg1.y + (_arg1.vy * _arg3));
_arg1.t2 = (_arg1.t2 - _arg3);
if (_arg1.t2 < 0){
_arg1.t2 = 0.05;
particles.startStarPower(_arg1.x, _arg1.y, -(_arg1.vx), -(_arg1.vy), _arg1.id);
};
if (_arg1.x > 630){
_arg1.vx = (-(_arg1.vx) * _local5);
_arg1.vy = (_arg1.vy * _local5);
_arg1.x = 630;
};
if (_arg1.x < 10){
_arg1.vx = (-(_arg1.vx) * _local5);
_arg1.vy = (_arg1.vy * _local5);
_arg1.x = 10;
};
if (_arg1.y < 10){
_arg1.vy = (-(_arg1.vy) * _local5);
_arg1.vx = (_arg1.vx * _local5);
_arg1.y = 10;
};
if (_arg1.y > 390){
_arg1.vy = (-(_arg1.vy) * _local5);
_arg1.vx = (_arg1.vx * _local5);
_arg1.y = 390;
};
} else {
if (_arg2 == "born"){
_arg1.vx = ((150 + (150 * _local4)) * ((Math.random() * 2) - 1));
_arg1.vy = (75 + (Math.random() * 50));
_arg1.t2 = 0.05;
};
};
}
}
}//package lev
Section 50
//MochiScores (mochi.MochiScores)
package mochi {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(_arg1:Object=null):void{
var options = _arg1;
if (options != null){
if (options.clip != null){
if ((options.clip is Sprite)){
MochiServices.setContainer(options.clip);
};
delete options.clip;
} else {
MochiServices.setContainer();
};
MochiServices.stayOnTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
var _local2:Object = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (_arg1 != null){
if (_arg1.error != null){
if (_arg1.error == true){
if (onErrorHandler != null){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
};
};
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi
Section 51
//MochiServices (mochi.MochiServices)
package mochi {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
private static var _sendChannel:LocalConnection;
private static var _rcvChannelName:String;
private static var _gatewayURL:String = "http://www.mochiads.com/static/lib/services/services.swf";
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _listenChannel:LocalConnection;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _startTime:Number;
private static var _connecting:Boolean = false;
public static var onError:Object;
private static var _listenChannelName:String = "__mochiservices";
private static var _rcvChannel:LocalConnection;
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_sendChannel.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
onError("NotConnected");
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_clip._nextcallbackID++;
};
};
}
public static function get connected():Boolean{
return (_connected);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (_clip != null){
if (_clip._queue != null){
while (_clip._queue.length > 0) {
_local2 = _clip._queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _clip._callbacks[_local2.callbackID];
};
delete _clip._callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local4:int;
var _local14:Loader;
var _local3:Array = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
var _local5:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
var _local6:Array = [0, 64, 0, 0, 0];
var _local7:MovieClip = new MovieClip();
var _local8:LocalConnection = new LocalConnection();
var _local9:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().getTime()));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
var _local10:ByteArray = new ByteArray();
var _local11:ByteArray = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
var _local12:uint = ((_local3.length + _local11.length) + 4);
var _local13:uint = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
public static function get childClip():Object{
return (_clip);
}
public static function get id():String{
return (_id);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var netup:Boolean;
var s:String;
var x:String;
var req:URLRequest;
var loader:Loader;
var err:Function;
var complete:Function;
var setURL:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
var vars:Object = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
s = "?";
var i:Number = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
complete = function (_arg1:Object):void{
netup = true;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
setURL = function ():void{
var _local1:String;
if (netup){
_local1 = (url + s);
} else {
_local1 = burl;
};
var _local2:DisplayObject = clickMovie(_local1, onClick);
btn.addChild(_local2);
_local2.scaleX = (0.01 * btn.width);
_local2.scaleY = (0.01 * btn.height);
};
setTimeout(setURL, 1500);
}
public static function getVersion():String{
return ("1.35");
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_listenChannel.close();
_rcvChannel.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
Security.allowDomain("*");
Security.allowInsecureDomain("*");
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
return (_local2);
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
if (_clip.parent != null){
Sprite(_clip.parent).removeChild(_clip);
};
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_arg1 != null){
if ((_arg1 is Sprite)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function onStatus(_arg1:StatusEvent):void{
switch (_arg1.level){
case "error":
_connected = false;
_listenChannel.connect(_listenChannelName);
break;
};
}
private static function initComChannels():void{
if (!_connected){
_sendChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_container, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_rcvChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_clip.onReceive = function (_arg1:Object):void{
var methodName:String;
var pkg = _arg1;
var cb:String = pkg.callbackID;
var cblst:Object = this.client._callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
methodName = "";
var obj:Object = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete this.client._callbacks[cb];
};
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_clip._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function listen():void{
_listenChannel = new LocalConnection();
_listenChannel.client = _clip;
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
_listenChannel.allowDomain("*", "localhost");
_listenChannel.allowInsecureDomain("*", "localhost");
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
_rcvChannelName = _arg1;
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var id = _arg1;
var clip = _arg2;
var clipname:String = ("_mochiservices_com_" + id);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
MochiServices.allowDomains(_gatewayURL);
_clip = createEmptyMovieClip(clip, clipname, 10336, false);
_loader = new Loader();
_timer = new Timer(1000, 0);
_startTime = getTimer();
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
var f:Function = function (_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
var req:URLRequest = new URLRequest(_gatewayURL);
_loader.load(req);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain("*", "localhost");
_rcvChannel.allowInsecureDomain("*", "localhost");
_rcvChannel.client = _clip;
_clip._nextcallbackID = 0;
_clip._callbacks = {};
listen();
return (_clip);
}
public static function bringToTop(_arg1:Event):void{
var e = _arg1;
if (MochiServices.clip != null){
if (MochiServices.childClip != null){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
};
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
if ((clip is DisplayObject)){
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
var mc:MovieClip = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
try {
parent[name] = mc;
} catch(e:Error) {
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
mc["_name"] = name;
return (mc);
}
public static function connectWait(_arg1:TimerEvent):void{
if ((getTimer() - _startTime) > 10000){
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_timer.stop();
};
}
}
}//package mochi
Section 52
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "3.0.0.0";
public function BitmapAsset(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
public function get measuredWidth():Number{
if (bitmapData){
return (bitmapData.width);
};
return (0);
}
public function get measuredHeight():Number{
if (bitmapData){
return (bitmapData.height);
};
return (0);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
}
}//package mx.core
Section 53
//EdgeMetrics (mx.core.EdgeMetrics)
package mx.core {
public class EdgeMetrics {
public var top:Number;
public var left:Number;
public var bottom:Number;
public var right:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
;
public function EdgeMetrics(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
this.left = _arg1;
this.top = _arg2;
this.right = _arg3;
this.bottom = _arg4;
}
public function clone():EdgeMetrics{
return (new EdgeMetrics(left, top, right, bottom));
}
}
}//package mx.core
Section 54
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexBitmap(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
var bitmapData = _arg1;
var pixelSnapping = _arg2;
var smoothing = _arg3;
super(bitmapData, pixelSnapping, smoothing);
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 55
//FlexSprite (mx.core.FlexSprite)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexSprite extends Sprite {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexSprite(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 56
//FontAsset (mx.core.FontAsset)
package mx.core {
import flash.text.*;
public class FontAsset extends Font implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
}
}//package mx.core
Section 57
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 58
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 59
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.accessibility.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get visible():Boolean;
function get rotation():Number;
function localToGlobal(_arg1:Point):Point;
function get name():String;
function set width(_arg1:Number):void;
function get measuredHeight():Number;
function get blendMode():String;
function get scale9Grid():Rectangle;
function set name(_arg1:String):void;
function set scaleX(_arg1:Number):void;
function set scaleY(_arg1:Number):void;
function get measuredWidth():Number;
function get accessibilityProperties():AccessibilityProperties;
function set scrollRect(_arg1:Rectangle):void;
function get cacheAsBitmap():Boolean;
function globalToLocal(_arg1:Point):Point;
function get height():Number;
function set blendMode(_arg1:String):void;
function get parent():DisplayObjectContainer;
function getBounds(_arg1:DisplayObject):Rectangle;
function get opaqueBackground():Object;
function set scale9Grid(_arg1:Rectangle):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set alpha(_arg1:Number):void;
function set accessibilityProperties(_arg1:AccessibilityProperties):void;
function get width():Number;
function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean;
function set cacheAsBitmap(_arg1:Boolean):void;
function get scaleX():Number;
function get scaleY():Number;
function get scrollRect():Rectangle;
function get mouseX():Number;
function get mouseY():Number;
function set height(_arg1:Number):void;
function set mask(_arg1:DisplayObject):void;
function getRect(_arg1:DisplayObject):Rectangle;
function get alpha():Number;
function set transform(_arg1:Transform):void;
function move(_arg1:Number, _arg2:Number):void;
function get loaderInfo():LoaderInfo;
function get root():DisplayObject;
function hitTestObject(_arg1:DisplayObject):Boolean;
function set opaqueBackground(_arg1:Object):void;
function set visible(_arg1:Boolean):void;
function get mask():DisplayObject;
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function get transform():Transform;
function set filters(_arg1:Array):void;
function get x():Number;
function get y():Number;
function get filters():Array;
function set rotation(_arg1:Number):void;
function get stage():Stage;
}
}//package mx.core
Section 60
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function get instanceIndices():Array;
function set instanceIndices(_arg1:Array):void;
function get isDocument():Boolean;
function set repeaters(_arg1:Array):void;
function initializeRepeaterArrays(_arg1:IRepeaterClient):void;
function get repeaters():Array;
function set repeaterIndices(_arg1:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 61
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 62
//SoundAsset (mx.core.SoundAsset)
package mx.core {
import flash.media.*;
public class SoundAsset extends Sound implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
}
}//package mx.core
Section 63
//SpriteAsset (mx.core.SpriteAsset)
package mx.core {
public class SpriteAsset extends FlexSprite implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function SpriteAsset(){
_measuredWidth = width;
_measuredHeight = height;
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
public function get borderMetrics():EdgeMetrics{
if (scale9Grid == null){
return (EdgeMetrics.EMPTY);
};
return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom))));
}
}
}//package mx.core
Section 64
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.0.0.0";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var _local2:String;
var _local4:String;
var _local5:Array;
var _local3:DisplayObject = _arg1;
while (_local3 != null) {
if (((((_local3.parent) && (_local3.stage))) && ((_local3.parent == _local3.stage)))){
break;
};
_local4 = _local3.name;
if ((_local3 is IRepeaterClient)){
_local5 = IRepeaterClient(_local3).instanceIndices;
if (_local5){
_local4 = (_local4 + (("[" + _local5.join("][")) + "]"));
};
};
_local2 = ((_local2 == null)) ? _local4 : ((_local4 + ".") + _local2);
_local3 = _local3.parent;
};
return (_local2);
}
public static function createUniqueName(_arg1:Object):String{
if (!_arg1){
return (null);
};
var _local2:String = getQualifiedClassName(_arg1);
var _local3:int = _local2.indexOf("::");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 2));
};
var _local4:int = _local2.charCodeAt((_local2.length - 1));
if ((((_local4 >= 48)) && ((_local4 <= 57)))){
_local2 = (_local2 + "_");
};
return ((_local2 + counter++));
}
}
}//package mx.utils
Section 65
//CircleButton (ui.CircleButton)
package ui {
import flash.display.*;
import ek.sui.*;
import flash.geom.*;
import flash.media.*;
public class CircleButton implements SUIElement {
private const MATRIX:Matrix;
private const COLOR:ColorTransform;
public var callback:Function;
public var enabled:Boolean;
public var radius:Number;
private var angle:Number;
public var holdMin:Number;
public var img:BitmapData;
public var bgColor:uint;
public var sndClick:Sound;
public var shape:Shape;
public var sndOn:Sound;
private var mouseOn:Boolean;
public var linesColor:uint;
public var x:Number;
public var y:Number;
public var hold:Number;
public static var sndClickHolder:Sound;
public static var sndOnHolder:Sound;
public function CircleButton(){
COLOR = new ColorTransform();
MATRIX = new Matrix();
super();
shape = new Shape();
angle = 0;
x = (y = 0);
radius = 40;
mouseOn = false;
holdMin = 0;
hold = 0;
enabled = true;
sndClick = sndClickHolder;
sndOn = sndOnHolder;
bgColor = 14021375;
linesColor = 10079487;
}
public function draw(_arg1:BitmapData):void{
var _local2:Graphics = shape.graphics;
var _local3:Number = 6.28;
var _local4:Number = angle;
var _local5:Number = (angle + 0.314);
var _local6:Number = (radius * (1 + (hold * 0.2)));
var _local7:uint = bgColor;
var _local8:uint = linesColor;
if (!enabled){
_local7 = 0xEAEAEA;
_local8 = 0xCCCCCC;
};
_local2.clear();
_local2.beginFill(_local7);
_local2.drawCircle(x, y, _local6);
_local2.endFill();
while (_local3 > 0) {
_local2.beginFill(_local8);
_local2.moveTo((x + (_local6 * Math.cos(_local4))), (y + (_local6 * Math.sin(_local4))));
_local2.lineTo(x, y);
_local2.lineTo((x + (_local6 * Math.cos(_local5))), (y + (_local6 * Math.sin(_local5))));
_local2.endFill();
_local4 = (_local4 + 0.628);
_local5 = (_local5 + 0.628);
_local3 = (_local3 - 0.628);
};
_local2.beginFill(_local7);
_local2.drawCircle(x, y, (0.6 * _local6));
_local2.endFill();
_local2.beginFill(utils.multColorScalar(0xFFFFFF, hold));
_local2.drawCircle(x, y, _local6);
_local2.drawCircle(x, y, (0.95 * _local6));
_local2.endFill();
_arg1.draw(shape);
if (img != null){
MATRIX.tx = (x - (img.width >> 1));
MATRIX.ty = (y - (img.height >> 1));
utils.ARGB2ColorTransform(utils.lerpColor(_local8, 0xFFFFFF, (hold + ((Math.sin((angle * 100)) * (1 - hold)) * 0.1))), COLOR);
COLOR.alphaMultiplier = 1;
_arg1.draw(img, MATRIX, COLOR);
};
}
public function update(_arg1:Number):void{
if (enabled){
if (((mouseOn) && ((hold < 1)))){
hold = (hold + (10 * _arg1));
if (hold > 1){
hold = 1;
};
} else {
if (((!(mouseOn)) && ((hold > holdMin)))){
hold = (hold - (10 * _arg1));
if (hold < holdMin){
hold = holdMin;
};
};
};
angle = (angle + (((hold * 2) + 1) * _arg1));
if (angle > 6.28){
angle = (angle - 6.28);
};
} else {
if (hold > holdMin){
hold = (hold - (10 * _arg1));
if (hold < holdMin){
hold = holdMin;
};
};
};
}
public function setImage(_arg1:Class):void{
img = new (_arg1).bitmapData;
}
public function mouseMove(_arg1:Number, _arg2:Number):void{
var _local3:Boolean = mouseOn;
var _local4:Number = (_arg1 - x);
var _local5:Number = (_arg2 - y);
mouseOn = (((_local4 * _local4) + (_local5 * _local5)) < (radius * radius));
if (((((((enabled) && (!(_local3)))) && (mouseOn))) && (!((sndOn == null))))){
sndOn.play();
};
}
public function mouseUp():void{
}
public function mouseDown():void{
if (((((mouseOn) && (!((callback == null))))) && (enabled))){
if (sndClick != null){
sndClick.play();
};
callback();
};
}
}
}//package ui
Section 66
//DefaultButton (ui.DefaultButton)
package ui {
import flash.display.*;
import ek.sui.*;
import flash.geom.*;
import flash.media.*;
public class DefaultButton implements SUIElement {
public var y:Number;
public var enabled:Boolean;
private var press:Number;
public var callback:Function;
public var imgs:Array;
public var sndClick:Sound;
private var mouseOn:Boolean;
public var sndOn:Sound;
public var rc:Rectangle;
public var x:Number;
public var visible:Boolean;
public var hold:Number;
public static var sndClickHolder:Sound;
public static var sndOnHolder:Sound;
public function DefaultButton(){
x = (y = 0);
mouseOn = false;
press = 0;
hold = 0;
enabled = true;
visible = true;
sndClick = sndClickHolder;
sndOn = sndOnHolder;
}
public function draw(_arg1:BitmapData):void{
var _local2:BitmapData;
if (((!((imgs == null))) && (visible))){
if (enabled){
if (press > 0){
_local2 = imgs[2];
} else {
_local2 = imgs[1];
};
} else {
_local2 = imgs[3];
};
if (hold > 0){
_arg1.draw(imgs[0], new Matrix(1, 0, 0, 1, x, y), new ColorTransform(1, 1, 1, hold));
};
_arg1.copyPixels(_local2, new Rectangle(0, 0, _local2.width, _local2.height), new Point(x, y));
};
}
public function update(_arg1:Number):void{
if (enabled){
if (mouseOn){
if (hold < 1){
hold = (hold + (10 * _arg1));
if (hold > 1){
hold = 1;
};
};
} else {
if (hold > 0){
hold = (hold - (10 * _arg1));
if (hold < 0){
hold = 0;
};
};
};
if (press > 0){
press = (press - (10 * _arg1));
if (press < 0){
press = 0;
};
};
} else {
press = 0;
if (hold > 0){
hold = (hold - (10 * _arg1));
if (hold < 0){
hold = 0;
};
};
};
}
public function mouseMove(_arg1:Number, _arg2:Number):void{
var _local3:Boolean = mouseOn;
var _local4:Number = (_arg1 - x);
var _local5:Number = (_arg2 - y);
mouseOn = (((((((_local5 >= rc.y)) && ((_local5 < (rc.y + rc.height))))) && ((_local4 >= rc.x)))) && ((_local4 < (rc.x + rc.width))));
if (((((((enabled) && (!(_local3)))) && (mouseOn))) && (!((sndOn == null))))){
sndOn.play();
};
}
public function mouseUp():void{
}
public function mouseDown():void{
if (((mouseOn) && (enabled))){
if (sndClick != null){
sndClick.play();
};
if (callback != null){
callback();
};
press = 1;
};
}
}
}//package ui
Section 67
//DescScreen (ui.DescScreen)
package ui {
import flash.display.*;
import ek.sui.*;
public class DescScreen extends SUIScreen {
private var gfxCredits:Class;
public var btnBack:CircleButton;
private var imgHelp:BitmapData;
private var splash:SUIImage;
private var prev:SUIScreen;
private var imgCredits:BitmapData;
private var gfxHelp:Class;
private var gui:SUISystem;
public function DescScreen(_arg1:SUISystem){
gfxHelp = DescScreen_gfxHelp;
gfxCredits = DescScreen_gfxCredits;
imgHelp = new gfxHelp().bitmapData;
imgCredits = new gfxCredits().bitmapData;
super();
gui = _arg1;
btnBack = new CircleButton();
btnBack.x = 308;
btnBack.y = 271;
btnBack.radius = 55;
btnBack.callback = back;
btnBack.img = Game.instance.uiMedia.imgCBBack;
splash = new SUIImage();
add(splash);
add(btnBack);
}
public function go(_arg1:int):void{
prev = gui.current;
gui.setCurrent(this);
switch (_arg1){
case 0:
splash.img = imgHelp;
btnBack.x = 308;
btnBack.y = 271;
break;
case 1:
splash.img = imgCredits;
btnBack.x = 320;
btnBack.y = 355;
break;
};
splash.x = (320 - (splash.img.width >> 1));
splash.y = (240 - (splash.img.height >> 1));
}
public function back():void{
gui.setCurrent(prev);
prev = null;
}
}
}//package ui
Section 68
//DescScreen_gfxCredits (ui.DescScreen_gfxCredits)
package ui {
import mx.core.*;
public class DescScreen_gfxCredits extends BitmapAsset {
}
}//package ui
Section 69
//DescScreen_gfxHelp (ui.DescScreen_gfxHelp)
package ui {
import mx.core.*;
public class DescScreen_gfxHelp extends BitmapAsset {
}
}//package ui
Section 70
//GameMenu (ui.GameMenu)
package ui {
import flash.display.*;
import ek.sui.*;
import flash.geom.*;
import flash.media.*;
public class GameMenu extends SUIScreen {
public var imgSp:BitmapData;
private var sfxClick:Class;
private var imgContinue:BitmapData;
private var sndClickL:Sound;
private var btnVolume:DefaultButton;
private var imgMainMenu:BitmapData;
private var btnCredits:CircleButton;
private var sndClick:Sound;
private var btnContinue:CircleButton;
private var btnSpLogo:DefaultButton;
private var sndOn:Sound;
private var sfxClickL:Class;
private var btnRes:CircleButton;
public var imgSp2:BitmapData;
private var imgHelp:BitmapData;
private var gui:SUISystem;
private var gfxSp2:Class;
private var btnHelp:CircleButton;
private var gfxLogo:Class;
private var gfxSp:Class;
private var sfxOn:Class;
private var imgRestart:BitmapData;
private var btnNewGame:CircleButton;
private var imgLowRes:BitmapData;
private var imgResume:BitmapData;
private var imgScores:BitmapData;
private var btnSp:CircleButton;
private var imgHiRes:BitmapData;
private var gfxTitle:Class;
private var btnHighScores:DefaultButton;
private var media:UIMedia;
private var imgNewGame:BitmapData;
private var imgCredits:BitmapData;
public var shop:UpgradeMenu;
private var gfxBG:Class;
public function GameMenu(_arg1:Game, _arg2:SUISystem){
gfxBG = GameMenu_gfxBG;
gfxTitle = GameMenu_gfxTitle;
gfxLogo = GameMenu_gfxLogo;
gfxSp = GameMenu_gfxSp;
gfxSp2 = GameMenu_gfxSp2;
sfxClick = GameMenu_sfxClick;
sfxClickL = GameMenu_sfxClickL;
sfxOn = GameMenu_sfxOn;
super();
media = _arg1.uiMedia;
gui = _arg2;
imgHiRes = media.imgCBHiRes;
imgLowRes = media.imgCBLowRes;
imgNewGame = media.imgCBNewGame;
imgContinue = media.imgCBContinue;
imgMainMenu = media.imgCBMainMenu;
imgRestart = media.imgCBRestart;
imgResume = media.imgCBResume;
imgCredits = media.imgCBCredits;
imgSp = new gfxSp().bitmapData;
imgSp2 = new gfxSp2().bitmapData;
imgScores = new BitmapData(390, 80, true, 0);
sndClick = new sfxClick();
sndOn = new sfxOn();
sndClickL = new sfxClickL();
CircleButton.sndClickHolder = sndClick;
CircleButton.sndOnHolder = sndOn;
DefaultButton.sndOnHolder = sndOn;
DefaultButton.sndClickHolder = sndClickL;
var _local3:SUIImage = new SUIImage();
_local3.setEmbedImage(gfxLogo);
_local3.y = (480 - 127);
_local3.x = (640 - 120);
add(_local3);
_local3 = new SUIImage();
_local3.setEmbedImage(gfxBG);
_local3.x = (320 - 128);
_local3.y = (200 - 128);
add(_local3);
_local3 = new SUIImage();
_local3.setEmbedImage(gfxTitle);
_local3.x = (320 - 175);
_local3.y = (200 - 52);
add(_local3);
btnNewGame = new CircleButton();
btnNewGame.x = 229;
btnNewGame.y = 79;
btnNewGame.radius = 55;
btnNewGame.callback = _arg1.clickNewGame;
btnContinue = new CircleButton();
btnContinue.x = 411;
btnContinue.y = 79;
btnContinue.radius = 55;
btnContinue.callback = _arg1.startLevel;
btnContinue.img = imgContinue;
btnCredits = new CircleButton();
btnCredits.x = 411;
btnCredits.y = 307;
btnCredits.radius = 55;
btnCredits.callback = _arg1.goCredits;
refreshInGame(_arg1);
btnRes = new CircleButton();
btnRes.x = 69;
btnRes.y = 192;
btnRes.radius = 45;
btnRes.callback = _arg1.changeRes;
refreshRes(_arg1);
btnSp = new CircleButton();
btnSp.x = 562;
btnSp.y = 192;
btnSp.radius = 45;
btnSp.img = media.imgCBSp;
btnSp.linesColor = 14021375;
btnSp.bgColor = 10079487;
btnSp.hold = (btnSp.holdMin = 0.9);
btnSp.callback = _arg1.goSp;
btnSpLogo = new DefaultButton();
btnSpLogo.imgs = [imgSp2, imgSp, imgSp, imgSp];
btnSpLogo.rc = new Rectangle(6, 6, 170, 66);
btnSpLogo.x = 5;
btnSpLogo.y = (480 - 77);
btnSpLogo.callback = _arg1.goSp;
btnHelp = new CircleButton();
btnHelp.x = 229;
btnHelp.y = 307;
btnHelp.radius = 55;
btnHelp.callback = _arg1.goHelp;
btnHelp.img = media.imgCBHelp;
btnHighScores = media.createDefaultButton(media.imgBtnHighScores);
btnHighScores.x = 258;
btnHighScores.y = 443;
btnHighScores.callback = _arg1.showHighScores;
btnVolume = media.createDefaultButtonImgs(media.imgsSfx);
btnVolume.x = 258;
btnVolume.y = 412;
btnVolume.callback = _arg1.changeMute;
refreshVol(_arg1);
add(btnSpLogo);
add(btnNewGame);
add(btnContinue);
add(btnCredits);
add(btnRes);
add(btnVolume);
add(btnHelp);
add(btnHighScores);
add(btnSp);
}
public function updateScores():void{
}
public function refreshRes(_arg1:Game):void{
if (_arg1.hires){
btnRes.img = imgHiRes;
} else {
btnRes.img = imgLowRes;
};
}
public function refreshInGame(_arg1:Game):void{
if (_arg1.inGame){
btnNewGame.img = imgResume;
btnContinue.enabled = true;
btnContinue.img = imgRestart;
btnCredits.img = imgMainMenu;
} else {
btnNewGame.img = imgNewGame;
btnContinue.enabled = !((_arg1.gameSave.level == 0));
btnContinue.img = imgContinue;
btnCredits.img = imgCredits;
};
}
public function go():void{
gui.setCurrent(this);
Game.instance.updateResults();
}
public function refreshVol(_arg1:Game):void{
if (_arg1.mute){
btnVolume.imgs = media.imgsNoSfx;
} else {
btnVolume.imgs = media.imgsSfx;
};
}
}
}//package ui
Section 71
//GameMenu_gfxBG (ui.GameMenu_gfxBG)
package ui {
import mx.core.*;
public class GameMenu_gfxBG extends BitmapAsset {
}
}//package ui
Section 72
//GameMenu_gfxLogo (ui.GameMenu_gfxLogo)
package ui {
import mx.core.*;
public class GameMenu_gfxLogo extends BitmapAsset {
}
}//package ui
Section 73
//GameMenu_gfxSp (ui.GameMenu_gfxSp)
package ui {
import mx.core.*;
public class GameMenu_gfxSp extends BitmapAsset {
}
}//package ui
Section 74
//GameMenu_gfxSp2 (ui.GameMenu_gfxSp2)
package ui {
import mx.core.*;
public class GameMenu_gfxSp2 extends BitmapAsset {
}
}//package ui
Section 75
//GameMenu_gfxTitle (ui.GameMenu_gfxTitle)
package ui {
import mx.core.*;
public class GameMenu_gfxTitle extends BitmapAsset {
}
}//package ui
Section 76
//GameMenu_sfxClick (ui.GameMenu_sfxClick)
package ui {
import mx.core.*;
public class GameMenu_sfxClick extends SoundAsset {
}
}//package ui
Section 77
//GameMenu_sfxClickL (ui.GameMenu_sfxClickL)
package ui {
import mx.core.*;
public class GameMenu_sfxClickL extends SoundAsset {
}
}//package ui
Section 78
//GameMenu_sfxOn (ui.GameMenu_sfxOn)
package ui {
import mx.core.*;
public class GameMenu_sfxOn extends SoundAsset {
}
}//package ui
Section 79
//LevelMenu (ui.LevelMenu)
package ui {
import ek.sui.*;
public class LevelMenu extends SUIScreen {
private var btnUpgrade:DefaultButton;
private var game:Game;
private var media:UIMedia;
private var btnGameMenu:DefaultButton;
private var btnUpgradeImgs:Array;
private var btnRestart:DefaultButton;
public var btnSubmit:DefaultButton;
private var title:SUIImage;
private var btnSp:DefaultButton;
private var btnGameMenuImgs:Array;
public function LevelMenu(_arg1:Game){
game = _arg1;
media = game.uiMedia;
super();
title = new SUIImage();
title.y = 410;
btnGameMenu = media.createDefaultButton(media.imgBtnGameMenu);
btnUpgrade = media.createDefaultButton(media.imgBtnUpgrade);
btnRestart = media.createDefaultButton(media.imgBtnRestart);
btnSubmit = media.createDefaultButton(media.imgBtnSubmit);
btnSp = media.createDefaultButton(media.imgBtnSpGray);
btnUpgrade.x = (5 + (122 + 5));
btnUpgrade.y = 450;
btnUpgrade.callback = game.level.goUpgradeMenu;
btnRestart.x = (5 + (2 * (122 + 5)));
btnRestart.y = 450;
btnRestart.callback = game.startLevel;
btnGameMenu.x = 5;
btnGameMenu.y = 450;
btnGameMenu.callback = game.goPause;
btnSubmit.x = (5 + (3 * (122 + 5)));
btnSubmit.y = 450;
btnSubmit.callback = submit;
btnSp.x = ((640 - 5) - 122);
btnSp.y = 450;
btnSp.callback = game.goSp;
add(btnSp);
add(btnUpgrade);
add(btnGameMenu);
add(btnSubmit);
add(btnRestart);
add(title);
}
public function go(_arg1:SUISystem):void{
_arg1.setCurrent(this);
}
public function setState(_arg1:int):void{
switch (_arg1){
case 0:
btnSubmit.visible = false;
btnSubmit.enabled = false;
btnRestart.visible = false;
btnRestart.enabled = false;
btnUpgrade.visible = true;
btnUpgrade.enabled = true;
btnGameMenu.visible = true;
btnGameMenu.enabled = true;
break;
case 1:
btnSubmit.visible = false;
btnSubmit.enabled = false;
btnRestart.visible = false;
btnRestart.enabled = false;
btnUpgrade.visible = true;
btnUpgrade.enabled = true;
btnGameMenu.visible = true;
btnGameMenu.enabled = true;
break;
case 2:
btnSubmit.visible = (game.gameState.scores > 0);
btnSubmit.enabled = (game.gameState.scores > 0);
btnRestart.visible = true;
btnRestart.enabled = true;
btnUpgrade.visible = false;
btnUpgrade.enabled = false;
btnGameMenu.visible = true;
btnGameMenu.enabled = true;
break;
};
}
public function submit():void{
game.submitHighScores();
btnSubmit.visible = false;
btnSubmit.enabled = false;
}
}
}//package ui
Section 80
//PillImage (ui.PillImage)
package ui {
import flash.display.*;
import flash.geom.*;
public class PillImage {
public const HAPPY:int = 0;
public const SHAKE:int = 1;
public const SMILE:int = 2;
private var imgEmo:BitmapData;
private var emoParam:Number;
private var emo:Boolean;
private var imgNid:BitmapData;
public var hy:Number;
public var hx:Number;
public var id:int;
private var imgMain:BitmapData;
private var emoType:int;
private var media:PillsMedia;
private var emoPause:Number;
private var emoCounter:Number;
public var x:Number;
public var y:Number;
public function PillImage(_arg1:Number, _arg2:Number, _arg3:int, _arg4:Boolean, _arg5:PillsMedia){
media = _arg5;
emo = _arg4;
id = _arg3;
x = _arg1;
y = _arg2;
hx = (hy = 0);
switch (id){
case 0:
imgMain = media.imgPower1;
imgEmo = media.imgPPower1;
break;
case 1:
imgMain = media.imgPower2;
imgEmo = media.imgPPower2;
break;
case 2:
imgMain = media.imgPower3;
imgEmo = media.imgPPower3;
break;
};
init();
}
private function startEmo(_arg1:int):void{
switch (_arg1){
case HAPPY:
emoParam = (1 + int((Math.random() * 3)));
if (Math.random() < 0.5){
emoParam = -(emoParam);
};
case SHAKE:
case SMILE:
emoCounter = 3;
break;
};
emoType = _arg1;
}
public function update(_arg1:Number):void{
if (emo){
if (emoCounter > 0){
emoCounter = (emoCounter - _arg1);
if (emoCounter < 0){
emoCounter = 0;
emoPause = ((Math.random() * 3) + 2);
};
} else {
emoPause = (emoPause - _arg1);
if (emoPause <= 0){
startEmo(int((Math.random() * 3)));
};
};
};
}
public function draw(_arg1:BitmapData):void{
var _local4:BitmapData;
var _local5:Matrix;
var _local2:Rectangle = new Rectangle(0, 0, 20, 20);
var _local3:Point = new Point((x - 10), (y - 10));
if (emo){
_arg1.copyPixels(imgEmo, _local2, _local3);
if (emoCounter > 0){
switch (emoType){
case HAPPY:
drawEmoHappy(_arg1);
break;
case SHAKE:
drawEmoShake(_arg1);
break;
case SMILE:
drawEmoSmile(_arg1);
break;
};
} else {
drawEmoDefaultA(_arg1);
};
} else {
_arg1.copyPixels(imgMain, _local2, _local3);
_arg1.copyPixels(imgNid, _local2, _local3);
};
}
public function init():void{
if (emo){
emoPause = ((Math.random() * 3) + 2);
emoCounter = 0;
} else {
imgNid = BitmapData(media.imgNids[int((Math.random() * 4))]);
};
}
private function drawEmoDefaultA(_arg1:BitmapData):void{
var _local2:Matrix = new Matrix(1, 0, 0, 1, -4, 2);
_local2.translate(x, y);
_arg1.draw(media.imgSmile1, _local2, null, null, null, true);
_local2.identity();
_local2.translate(-5, -3);
_local2.translate((x + hx), (y + hy));
_arg1.draw(media.imgEyes1, _local2, null, null, null, true);
}
private function drawEmoDefault(_arg1:BitmapData, _arg2:Number, _arg3:Number):void{
var _local4:Matrix = new Matrix(1, 0, 0, 1, -4, 2);
var _local5:ColorTransform = new ColorTransform(1, 1, 1, _arg2);
_local4.rotate(_arg3);
_local4.translate(x, y);
_arg1.draw(media.imgSmile1, _local4, _local5, null, null, true);
_local4.identity();
_local4.translate(-5, -3);
_local4.rotate(_arg3);
_local4.translate((x + hx), (y + hy));
_arg1.draw(media.imgEyes1, _local4, _local5, null, null, true);
}
private function drawEmoSmile(_arg1:BitmapData):void{
var _local3:ColorTransform;
var _local2:Matrix = new Matrix(1, 0, 0, 1, -8, 1);
var _local4:Number = 0.5;
if (emoCounter > 2.5){
_local4 = (3 - emoCounter);
} else {
if (emoCounter < 0.5){
_local4 = emoCounter;
};
};
_local4 = (_local4 * 2);
if (_local4 < 1){
_local3 = new ColorTransform(1, 1, 1, _local4);
};
if (_local3 != null){
drawEmoDefault(_arg1, (1 - _local4), 0);
};
_local2.translate(x, y);
_arg1.draw(media.imgSmile2, _local2, _local3, null, null, true);
_local2.identity();
_local2.translate(-5, -3);
_local2.translate(x, y);
_arg1.draw(media.imgEyes1, _local2, _local3, null, null, true);
}
public function updateSpy(_arg1:Number, _arg2:Number):void{
var _local3:Number = (_arg1 - x);
var _local4:Number = (_arg2 - y);
var _local5:Number = (1 / Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
hx = (_local3 * _local5);
hy = (_local4 * _local5);
}
private function drawEmoShake(_arg1:BitmapData):void{
var _local3:ColorTransform;
var _local2:Matrix = new Matrix(1, 0, 0, 1, -6, 1);
var _local4:Number = 0.5;
var _local5:Number = Math.sin((emoCounter * 6.28));
if (emoCounter > 2.5){
_local4 = (3 - emoCounter);
} else {
if (emoCounter < 0.5){
_local4 = emoCounter;
};
};
_local4 = (_local4 * 2);
if (_local4 < 1){
_local3 = new ColorTransform(1, 1, 1, _local4);
};
if (_local5 < 0){
_local5 = 0;
} else {
if (_local5 >= 0){
_local5 = 0.5;
};
};
if (_local3 != null){
drawEmoDefault(_arg1, (1 - _local4), 0);
};
_local2.translate(x, y);
_arg1.draw(media.imgSmile3, _local2, _local3, null, null, true);
_local2.identity();
_local2.translate(-7, -5);
_local2.translate(x, (y + _local5));
_arg1.draw(media.imgEyes2, _local2, _local3, null, null, true);
}
private function drawEmoHappy(_arg1:BitmapData):void{
var _local3:ColorTransform;
var _local2:Matrix = new Matrix(1, 0, 0, 1, -6, 1);
var _local4:Number = 0.5;
var _local5:Number = (emoCounter / 3);
if (emoCounter > 2.5){
_local4 = (3 - emoCounter);
} else {
if (emoCounter < 0.5){
_local4 = emoCounter;
};
};
_local4 = (_local4 * 2);
if (_local4 < 1){
_local3 = new ColorTransform(1, 1, 1, _local4);
};
if (emoParam > 0){
_local5 = (1 - _local5);
};
_local5 = (_local5 * (Math.abs(emoParam) * 6.28));
if (_local3 != null){
drawEmoDefault(_arg1, (1 - _local4), _local5);
};
_local2.rotate(_local5);
_local2.translate(x, y);
_arg1.draw(media.imgSmile3, _local2, _local3, null, null, true);
_local2.identity();
_local2.translate(-7, -5);
_local2.rotate(_local5);
_local2.translate(x, y);
_arg1.draw(media.imgEyes2, _local2, _local3, null, null, true);
}
}
}//package ui
Section 81
//ScoresTable (ui.ScoresTable)
package ui {
import flash.display.*;
import ek.sui.*;
import flash.geom.*;
import ek.*;
import flash.filters.*;
import mochi.*;
public class ScoresTable extends SUIScreen {
private const SHAPE:Shape;
private const GAME_ID:String = "74e833da17589294";
private const BACK_IMG:BitmapData;
private const CLIP:MovieClip;
private const SHAPE2:Shape;
private const BG_IMG:SUIImage;
private const POINT:Point;
private const RC:Rectangle;
private const BG_FILTER:BlurFilter;
private const BOARD_ID:String = "507e25923e6b4015";
public var lastScreen:SUIScreen;
public var bg:BitmapData;
private var BACK_BITMAP:Bitmap;
public var game:Game;
public var stage:Stage;
public function ScoresTable(){
RC = new Rectangle();
POINT = new Point();
BG_FILTER = new BlurFilter(16, 16, 2);
CLIP = new MovieClip();
SHAPE = new Shape();
SHAPE2 = new Shape();
BG_IMG = new SUIImage();
BACK_IMG = new BitmapData(640, 480, true, 0);
game = Game.instance;
bg = game.imgBG;
stage = ekDevice.instance.stage;
stage.addChildAt(CLIP, 1);
CLIP.visible = false;
CLIP.x = 85;
CLIP.y = 80;
SHAPE2.graphics.lineStyle(4, 0, 1, true);
SHAPE2.graphics.drawRoundRect(85, 80, 470, 320, 4, 4);
SHAPE.graphics.lineStyle(4, 0, 1, false);
SHAPE.graphics.beginFill(0, 0.5);
SHAPE.graphics.drawRect(85, 80, 470, 320);
SHAPE.graphics.endFill();
SHAPE.filters = [BG_FILTER];
BACK_IMG.draw(SHAPE);
BACK_IMG.draw(SHAPE2);
RC.x = 85;
RC.y = 80;
RC.width = 470;
RC.height = 320;
BACK_IMG.fillRect(RC, 2130706432);
BACK_BITMAP = new Bitmap(BACK_IMG);
BACK_BITMAP.x = -85;
BACK_BITMAP.y = -80;
CLIP.addChild(BACK_BITMAP);
MochiServices.connect(GAME_ID, CLIP);
MochiScores.setBoardID(BOARD_ID);
super();
BG_IMG.img = bg;
BG_IMG.x = 0;
BG_IMG.y = 0;
add(BG_IMG);
}
public function showScores():void{
go();
MochiScores.showLeaderboard({res:"470x320", clip:CLIP, onClose:onClose, previewScores:true, showTableRank:true});
}
public function submitScores():void{
go();
MochiScores.showLeaderboard({res:"470x320", clip:CLIP, onClose:onClose, score:game.gameState.scores, previewScores:true, showTableRank:true});
}
private function go():void{
POINT.x = (POINT.y = 0);
RC.x = (RC.y = 0);
RC.width = 640;
RC.height = 480;
bg.copyPixels(game.back, RC, POINT);
bg.applyFilter(bg, RC, POINT, BG_FILTER);
lastScreen = game.gui.current;
game.gui.setCurrent(this);
CLIP.visible = true;
if (lastScreen == game.levelMenu){
game.level.setPause(true);
};
}
public function onClose():void{
game.gui.setCurrent(lastScreen);
game.level.env.blanc = 1;
CLIP.visible = false;
if (lastScreen == game.levelMenu){
game.level.setPause(false);
};
}
}
}//package ui
Section 82
//UIMedia (ui.UIMedia)
package ui {
import flash.display.*;
import flash.geom.*;
import flash.text.*;
import flash.filters.*;
public class UIMedia {
private const DEF_BTN_RC:Rectangle;
private const BLUR8:BlurFilter;
private const RC:Rectangle;
private const MATRIX:Matrix;
private const WHITE_MASK:ColorTransform;
private const POINT:Point;
public var imgHkSpace:BitmapData;
public var imgCBBack:BitmapData;
public var imgBtnNoSfx:BitmapData;
public var imgCBCredits:BitmapData;
public var imgCBHelp:BitmapData;
private var gfxHkSpace:Class;
private var gfxUnmute:Class;
public var imgBtnSubmit:BitmapData;
public var imgCBRestart:BitmapData;
public var imgCBHiRes:BitmapData;
public var cbMiniText:TextField;
public var miniText:TextField;
public var btnText:TextField;
public var imgBtnGameMenu:BitmapData;
public var imgBtnSfx:BitmapData;
public var imgCBResume:BitmapData;
public var imgCBContinue:BitmapData;
private var gfxMute:Class;
public var cbText:TextField;
public var imgCBLowRes:BitmapData;
public var imgBtnRestart:BitmapData;
private var gfxBtnLight:Class;
public var imgBtnUpgrade:BitmapData;
public var imgCBBuy:BitmapData;
public var bigText:TextField;
public var imgsSfx:Array;
public var imgBtnSpGray:BitmapData;
public var imgBtnBody:BitmapData;
private var gfxHkEnter:Class;
public var imgHkEnter:BitmapData;
private var gfxBtnBody:Class;
public var imgBtnHighScores:BitmapData;
public var imgUnmute:BitmapData;
public var imgCBSp:BitmapData;
public var imgHkEsc:BitmapData;
public var imgCBMainMenu:BitmapData;
public var imgsNoSfx:Array;
public var imgCBNewGame:BitmapData;
private var gfxHkEsc:Class;
public var imgMute:BitmapData;
public var imgBtnLight:BitmapData;
public function UIMedia(){
MATRIX = new Matrix();
DEF_BTN_RC = new Rectangle(3, 3, 116, 22);
WHITE_MASK = new ColorTransform(1, 1, 1, 1, 0xFF, 0xFF, 0xFF);
RC = new Rectangle();
POINT = new Point();
BLUR8 = new BlurFilter(4, 4, 8);
gfxBtnBody = UIMedia_gfxBtnBody;
gfxBtnLight = UIMedia_gfxBtnLight;
gfxHkSpace = UIMedia_gfxHkSpace;
gfxHkEnter = UIMedia_gfxHkEnter;
gfxHkEsc = UIMedia_gfxHkEsc;
gfxMute = UIMedia_gfxMute;
gfxUnmute = UIMedia_gfxUnmute;
super();
bigText = new TextField();
bigText.defaultTextFormat = new TextFormat("_default", 25, 4294967295);
bigText.embedFonts = true;
bigText.cacheAsBitmap = false;
bigText.autoSize = TextFieldAutoSize.LEFT;
bigText.filters = [new DropShadowFilter(0, 0, 0, 1, 4, 4, 4, 1)];
miniText = new TextField();
miniText.defaultTextFormat = new TextFormat("_default", 16, 4294967295);
miniText.embedFonts = true;
miniText.cacheAsBitmap = false;
miniText.multiline = true;
miniText.autoSize = TextFieldAutoSize.LEFT;
btnText = new TextField();
btnText.defaultTextFormat = new TextFormat("_default", 16, 4294967295);
btnText.embedFonts = true;
btnText.cacheAsBitmap = false;
btnText.autoSize = TextFieldAutoSize.LEFT;
btnText.filters = [new DropShadowFilter(0, 0, 0x272727, 1, 4, 4, 32, 1)];
cbText = new TextField();
cbText.defaultTextFormat = new TextFormat("_default", 40, 4294967295, false, null, null, null, null, TextFormatAlign.CENTER, null, null, null, -20);
cbText.embedFonts = true;
cbText.cacheAsBitmap = false;
cbText.multiline = true;
cbText.autoSize = TextFieldAutoSize.NONE;
cbText.filters = [new DropShadowFilter(0, 0, 0, 1, 6, 6, 8, 1)];
cbMiniText = new TextField();
cbMiniText.defaultTextFormat = new TextFormat("_default", 30, 4294967295, false, null, null, null, null, TextFormatAlign.CENTER, null, null, null, -16);
cbMiniText.embedFonts = true;
cbMiniText.cacheAsBitmap = false;
cbMiniText.multiline = true;
cbMiniText.autoSize = TextFieldAutoSize.NONE;
cbMiniText.filters = [new DropShadowFilter(0, 0, 0, 1, 6, 6, 8, 1)];
imgHkSpace = new gfxHkSpace().bitmapData;
imgHkEnter = new gfxHkEnter().bitmapData;
imgHkEsc = new gfxHkEsc().bitmapData;
imgMute = new gfxMute().bitmapData;
imgUnmute = new gfxUnmute().bitmapData;
imgBtnBody = new gfxBtnBody().bitmapData;
imgBtnLight = new gfxBtnLight().bitmapData;
imgBtnUpgrade = createTextBtnHK("UPGRADE", imgHkEnter);
imgBtnGameMenu = createTextBtnHK("GAME MENU", imgHkEsc);
imgBtnSubmit = createTextBtnHK("SUBMIT", imgHkSpace);
imgBtnRestart = createTextBtnHK("TRY AGAIN", imgHkEnter);
imgBtnHighScores = createTextBtn("HIGH SCORES");
imgBtnSfx = createTextBtnHK("MUTE SFX", imgUnmute, -1);
imgBtnNoSfx = createTextBtnHK("UNMUTE SFX", imgMute, -1);
imgBtnSpGray = createTextBtn("MORE GAMES");
imgsSfx = [imgBtnLight, imgBtnSfx, imgBtnSfx, imgBtnSfx];
imgsNoSfx = [imgBtnLight, imgBtnNoSfx, imgBtnNoSfx, imgBtnNoSfx];
imgCBNewGame = createCB("NEW\nGAME", 110, 10);
imgCBHiRes = createCB("HIGH\nDETAILS", 90, 18, true);
imgCBLowRes = createCB("LOW\nDETAILS", 90, 18, true);
imgCBContinue = createCB("LAST\nSAVE", 110, 10);
imgCBHelp = createCB("HELP", 110, 24);
imgCBCredits = createCB("ABOUT", 110, 24);
imgCBMainMenu = createCB("MAIN\nMENU", 110, 10);
imgCBResume = createCB("RESUME\nLEVEL", 110, 22, true);
imgCBRestart = createCB("RESTART\nLEVEL", 110, 22, true);
imgCBBuy = createCB("BUY", 110, 24);
imgCBBack = createCB("BACK", 110, 24);
imgCBSp = createCB("MORE\nGAMES", 110, 10);
}
public function createDefaultButtonImgs(_arg1:Array):DefaultButton{
var _local2:DefaultButton = new DefaultButton();
_local2.imgs = _arg1;
_local2.rc = DEF_BTN_RC;
return (_local2);
}
private function createTextBtnHK(_arg1:String, _arg2:BitmapData, _arg3:int=0):BitmapData{
var _local5:Number;
var _local4:BitmapData = new BitmapData(imgBtnBody.width, imgBtnBody.height, true, 0);
_local4.draw(imgBtnBody);
btnText.text = _arg1;
_local5 = ((((122 - btnText.width) - _arg2.width) + 4) / 3);
MATRIX.tx = (3 + _local5);
MATRIX.ty = ((imgBtnBody.height - btnText.height) * 0.5);
_local4.draw(btnText, MATRIX);
MATRIX.tx = (((3 + (2 * _local5)) + btnText.width) - 4);
MATRIX.ty = ((((imgBtnBody.height - _arg2.height) * 0.5) + 1) + _arg3);
_local4.draw(_arg2, MATRIX);
return (_local4);
}
private function createCB(_arg1:String, _arg2:int, _arg3:int=0, _arg4:Boolean=false):BitmapData{
var _local6:TextField;
var _local5:BitmapData = new BitmapData(_arg2, _arg2, true, 0);
if (_arg4){
_local6 = cbMiniText;
} else {
_local6 = cbText;
};
_local6.text = _arg1;
MATRIX.tx = ((_arg2 - _local6.width) * 0.5);
MATRIX.ty = (((_arg2 - _local6.height) * 0.5) + _arg3);
RC.width = (RC.height = _arg2);
POINT.x = (POINT.y = 0);
_local5.draw(_local6, MATRIX, WHITE_MASK);
_local5.applyFilter(_local5, RC, POINT, BLUR8);
_local5.draw(_local6, MATRIX);
_local6 = null;
return (_local5);
}
public function createDefaultButton(_arg1:BitmapData):DefaultButton{
var _local2:DefaultButton = new DefaultButton();
_local2.imgs = [imgBtnLight, _arg1, _arg1, _arg1];
_local2.rc = DEF_BTN_RC;
return (_local2);
}
private function createTextBtn(_arg1:String):BitmapData{
var _local2:BitmapData = new BitmapData(imgBtnBody.width, imgBtnBody.height, true, 0);
_local2.draw(imgBtnBody);
btnText.text = _arg1;
MATRIX.tx = ((imgBtnBody.width - btnText.width) * 0.5);
MATRIX.ty = ((imgBtnBody.height - btnText.height) * 0.5);
_local2.draw(btnText, MATRIX);
return (_local2);
}
}
}//package ui
Section 83
//UIMedia_gfxBtnBody (ui.UIMedia_gfxBtnBody)
package ui {
import mx.core.*;
public class UIMedia_gfxBtnBody extends BitmapAsset {
}
}//package ui
Section 84
//UIMedia_gfxBtnLight (ui.UIMedia_gfxBtnLight)
package ui {
import mx.core.*;
public class UIMedia_gfxBtnLight extends BitmapAsset {
}
}//package ui
Section 85
//UIMedia_gfxHkEnter (ui.UIMedia_gfxHkEnter)
package ui {
import mx.core.*;
public class UIMedia_gfxHkEnter extends BitmapAsset {
}
}//package ui
Section 86
//UIMedia_gfxHkEsc (ui.UIMedia_gfxHkEsc)
package ui {
import mx.core.*;
public class UIMedia_gfxHkEsc extends BitmapAsset {
}
}//package ui
Section 87
//UIMedia_gfxHkSpace (ui.UIMedia_gfxHkSpace)
package ui {
import mx.core.*;
public class UIMedia_gfxHkSpace extends BitmapAsset {
}
}//package ui
Section 88
//UIMedia_gfxMute (ui.UIMedia_gfxMute)
package ui {
import mx.core.*;
public class UIMedia_gfxMute extends BitmapAsset {
}
}//package ui
Section 89
//UIMedia_gfxUnmute (ui.UIMedia_gfxUnmute)
package ui {
import mx.core.*;
public class UIMedia_gfxUnmute extends BitmapAsset {
}
}//package ui
Section 90
//UpgradeMenu (ui.UpgradeMenu)
package ui {
import flash.display.*;
import ek.sui.*;
import flash.geom.*;
import flash.text.*;
public class UpgradeMenu extends SUIScreen {
private const priceDef:int = 765;
private const priceHP:int = 1234;
private const priceHell:int = 3456;
private const priceNorm:int = 2009;
private var cashText:BitmapData;
private var btnSkip:CircleButton;
private var gfxDecDis:Class;
private var hp:int;
private var def:Number;
private var incImgs:Array;
private var btnDefInc:DefaultButton;
private var imgIncDecGlow:BitmapData;
private var gfxIncDef:Class;
public var text:TextField;
private var decImgs:Array;
private var cash:int;
private var hpRC:Rectangle;
private var gui:SUISystem;
private var hell:int;
private var gfxDecClick:Class;
private var imgDef:BitmapData;
private var gfxIncDecGlow:Class;
private var hpText:BitmapData;
private var mini:TextField;
private var pills:Array;
private var btnHellInc:DefaultButton;
private var btnDefDec:DefaultButton;
private var hpPulse:Number;
private var helpLast:int;
private var helpCounter:Number;
private var gfxDecDef:Class;
private var btnNormInc:DefaultButton;
private var btnHellDec:DefaultButton;
public var btnBuy:CircleButton;
private var level:Level;
private var state:GameState;
private var helpNew:int;
private var gfxIncDis:Class;
public var pillsMedia:PillsMedia;
private var cashRC:Rectangle;
private var btnNormDec:DefaultButton;
private var norm:int;
public var gameInfo:GameInfo;
private var gfxDef:Class;
private var defText:BitmapData;
private var hpCounter:Number;
private var btnHPInc:DefaultButton;
private var gfxIncClick:Class;
public var media:UIMedia;
private var helpImgs:Array;
private var defRC:Rectangle;
private var imgLabel:BitmapData;
private var priceImgs:Array;
private var gfxLabel:Class;
private var btnHPDec:DefaultButton;
public function UpgradeMenu(_arg1:SUISystem, _arg2:Level){
var _local4:BitmapData;
gfxIncDef = UpgradeMenu_gfxIncDef;
gfxIncClick = UpgradeMenu_gfxIncClick;
gfxIncDis = UpgradeMenu_gfxIncDis;
gfxDecDef = UpgradeMenu_gfxDecDef;
gfxIncDecGlow = UpgradeMenu_gfxIncDecGlow;
gfxDecClick = UpgradeMenu_gfxDecClick;
gfxDecDis = UpgradeMenu_gfxDecDis;
gfxLabel = UpgradeMenu_gfxLabel;
gfxDef = UpgradeMenu_gfxDef;
var _local3:Rectangle = new Rectangle(6, 6, 29, 29);
gui = _arg1;
level = _arg2;
state = _arg2.state;
pillsMedia = _arg2.pills.media;
media = Game.instance.uiMedia;
hpCounter = 0;
hpPulse = 0;
imgIncDecGlow = new gfxIncDecGlow().bitmapData;
incImgs = [imgIncDecGlow, new gfxIncDef().bitmapData, new gfxIncClick().bitmapData, new gfxIncDis().bitmapData];
decImgs = [imgIncDecGlow, new gfxDecDef().bitmapData, new gfxDecClick().bitmapData, new gfxDecDis().bitmapData];
imgLabel = new gfxLabel().bitmapData;
imgDef = new gfxDef().bitmapData;
pills = [new PillImage(220, 179, 0, false, pillsMedia), new PillImage(236, 162, 1, false, pillsMedia), new PillImage(252, 179, 2, false, pillsMedia), new PillImage(220, (179 + 72), 0, true, pillsMedia), new PillImage(236, (162 + 72), 1, true, pillsMedia), new PillImage(252, (179 + 72), 2, true, pillsMedia)];
text = media.bigText;
mini = media.miniText;
text.text = "100";
hpRC = new Rectangle(0, 0, int((text.width + 1)), int((text.height + 1)));
hpText = new BitmapData(hpRC.width, hpRC.height, true, 0);
text.text = "75%";
defRC = new Rectangle(0, 0, int((text.width + 1)), int((text.height + 1)));
defText = new BitmapData(defRC.width, defRC.height, true, 0);
cashRC = new Rectangle(0, 0, 300, 100);
cashText = new BitmapData(cashRC.width, cashRC.height, true, 0);
priceImgs = new Array();
text.text = (priceHP.toString() + ".0 $");
_local4 = new BitmapData(int((text.width + 1)), int((text.height + 1)), true, 0);
_local4.draw(text);
priceImgs.push(_local4);
text.text = (priceDef.toString() + ".0 $");
_local4 = new BitmapData(int((text.width + 1)), int((text.height + 1)), true, 0);
_local4.draw(text);
priceImgs.push(_local4);
text.text = (priceNorm.toString() + ".0 $");
_local4 = new BitmapData(int((text.width + 1)), int((text.height + 1)), true, 0);
_local4.draw(text);
priceImgs.push(_local4);
text.text = (priceHell.toString() + ".0 $");
_local4 = new BitmapData(int((text.width + 1)), int((text.height + 1)), true, 0);
_local4.draw(text);
priceImgs.push(_local4);
initHelp();
super();
btnSkip = new CircleButton();
btnSkip.x = 455;
btnSkip.y = 284;
btnSkip.radius = 55;
btnSkip.callback = level.closeUpgradeMenu;
btnSkip.img = media.imgCBBack;
btnBuy = new CircleButton();
btnBuy.x = 455;
btnBuy.y = 110;
btnBuy.radius = 55;
btnBuy.callback = buy;
btnBuy.img = media.imgCBBuy;
btnHPInc = new DefaultButton();
btnHPInc.x = 272;
btnHPInc.y = 32;
btnHPInc.imgs = incImgs;
btnHPInc.rc = _local3;
btnHPInc.callback = incHP;
btnHPDec = new DefaultButton();
btnHPDec.x = 160;
btnHPDec.y = 32;
btnHPDec.imgs = decImgs;
btnHPDec.rc = _local3;
btnHPDec.callback = decHP;
btnDefInc = new DefaultButton();
btnDefInc.x = 272;
btnDefInc.y = 104;
btnDefInc.imgs = incImgs;
btnDefInc.rc = _local3;
btnDefInc.callback = incDef;
btnDefDec = new DefaultButton();
btnDefDec.x = 160;
btnDefDec.y = 104;
btnDefDec.imgs = decImgs;
btnDefDec.rc = _local3;
btnDefDec.callback = decDef;
btnNormInc = new DefaultButton();
btnNormDec = new DefaultButton();
btnNormInc.imgs = incImgs;
btnNormDec.imgs = decImgs;
btnNormInc.rc = (btnNormDec.rc = _local3);
btnNormInc.y = (btnNormDec.y = 176);
btnNormInc.x = 272;
btnNormDec.x = 160;
btnNormInc.callback = incNorm;
btnNormDec.callback = decNorm;
btnHellInc = new DefaultButton();
btnHellDec = new DefaultButton();
btnHellInc.imgs = incImgs;
btnHellDec.imgs = decImgs;
btnHellInc.rc = (btnHellDec.rc = _local3);
btnHellInc.y = (btnHellDec.y = 248);
btnHellInc.x = 272;
btnHellDec.x = 160;
btnHellInc.callback = incHell;
btnHellDec.callback = decHell;
add(btnSkip);
add(btnBuy);
add(btnHPInc);
add(btnHPDec);
add(btnDefInc);
add(btnDefDec);
add(btnNormInc);
add(btnNormDec);
add(btnHellInc);
add(btnHellDec);
}
override public function mouseMove(_arg1:Number, _arg2:Number):void{
var _local3:*;
super.mouseMove(_arg1, _arg2);
for each (_local3 in pills) {
PillImage(_local3).updateSpy(_arg1, _arg2);
};
helpNew = -1;
if ((((_arg1 >= 166)) && ((_arg1 <= (166 + 141))))){
if ((((_arg2 >= 10)) && ((_arg2 <= 75)))){
helpNew = 0;
} else {
if ((((_arg2 >= 78)) && ((_arg2 <= (78 + 68))))){
helpNew = 1;
} else {
if ((((_arg2 >= 151)) && ((_arg2 <= (151 + 67))))){
helpNew = 2;
} else {
if ((((_arg2 >= 223)) && ((_arg2 <= (223 + 67))))){
helpNew = 3;
};
};
};
};
};
}
override public function draw(_arg1:BitmapData):void{
var _local7:BitmapData;
var _local8:BitmapData;
var _local9:BitmapData;
var _local10:int;
var _local11:*;
var _local2:Matrix = new Matrix(1, 0, 0, 1, -25, -23);
var _local3:ColorTransform = new ColorTransform();
var _local4:Rectangle = new Rectangle();
var _local5:Point = new Point();
var _local6:Number = (1 + (0.3 * hpPulse));
_local2.scale(_local6, _local6);
_local2.translate(237, 32);
_arg1.draw(level.imgHP1, _local2, null, null, null, true);
_arg1.draw(level.imgHP3, _local2, null, null, null, true);
_local5.x = (237 - 27);
_local5.y = (104 - 33);
_local4.width = imgDef.width;
_local4.height = imgDef.height;
_arg1.copyPixels(imgDef, _local4, _local5);
_local4.width = imgLabel.width;
_local4.height = imgLabel.height;
_local5.x = 203;
_local5.y = 47;
_arg1.copyPixels(imgLabel, _local4, _local5);
_local5.y = 119;
_arg1.copyPixels(imgLabel, _local4, _local5);
_local5.y = 191;
_arg1.copyPixels(imgLabel, _local4, _local5);
_local5.y = 263;
_arg1.copyPixels(imgLabel, _local4, _local5);
_local5.x = 218;
_local5.y = 44;
_arg1.copyPixels(hpText, hpRC, _local5);
_local5.x = 219;
_local5.y = 116;
_arg1.copyPixels(defText, defRC, _local5);
_local5.y = 10;
for each (_local11 in priceImgs) {
_local7 = BitmapData(_local11);
_local4.width = _local7.width;
_local4.height = _local7.height;
_local5.x = (128 - _local7.width);
_arg1.copyPixels(_local7, _local4, _local5);
_local5.y = (_local5.y + 72);
};
for each (_local11 in pills) {
PillImage(_local11).draw(_arg1);
};
if (norm == 0){
_local7 = gameInfo.one;
} else {
_local7 = gameInfo.powers[(norm - 1)];
};
_local4.width = _local7.width;
_local4.height = _local7.height;
_local5.x = (235 - (_local7.width >> 1));
_local5.y = 193;
_arg1.copyPixels(_local7, _local4, _local5);
_local7 = gameInfo.powers[hell];
_local8 = gameInfo.powers[(hell + 1)];
_local9 = gameInfo.powers[(hell + 2)];
_local4.width = _local8.width;
_local4.height = _local8.height;
_local5.x = (235 - (_local8.width >> 1));
_local5.y = 259;
_arg1.copyPixels(_local8, _local4, _local5);
_local4.width = _local7.width;
_local4.height = _local7.height;
_local5.x = (221 - (_local7.width >> 1));
_local5.y = 270;
_arg1.copyPixels(_local7, _local4, _local5);
_local4.width = _local9.width;
_local4.height = _local9.height;
_local5.x = (251 - (_local9.width >> 1));
_arg1.copyPixels(_local9, _local4, _local5);
_local5.x = 90;
_local5.y = 295;
_arg1.copyPixels(cashText, cashRC, _local5);
if (helpLast >= 0){
_local7 = helpImgs[helpLast];
_local2.identity();
_local2.tx = -((_local7.width >> 1));
_local2.ty = -((_local7.height >> 1));
_local2.scale(helpCounter, helpCounter);
_local2.translate(320, 440);
_local3.alphaMultiplier = helpCounter;
_arg1.draw(_local7, _local2, _local3);
};
super.draw(_arg1);
}
public function incDef():void{
def = (def + 5);
refresh();
}
public function incHell():void{
hell++;
refresh();
}
public function decHell():void{
hell--;
refresh();
}
public function incHP():void{
hp = (hp + 5);
refresh();
}
public function buy():void{
var _local1:Number = (state.health / state.maxHP);
state.maxHP = hp;
state.health = (hp * _local1);
state.def = def;
state.norm = norm;
state.hell = hell;
state.scores = (state.scores - cash);
level.syncScores();
level.closeUpgradeMenu();
}
private function initHelp():void{
var _local1:BitmapData;
var _local2:Shape = new Shape();
var _local3:Graphics = _local2.graphics;
var _local4:Matrix = new Matrix(1, 0, 0, 1, 5, 2.5);
helpImgs = new Array();
mini.text = (("HEALTH:\nTHE LEVEL OF YOUR HEALTH.\n(" + priceHP.toString()) + " MONEY FOR 5 HIT POINTS)");
_local1 = new BitmapData(int(((mini.width + 1) + 10)), int(((mini.height + 1) + 10)), true, 0);
_local3.clear();
_local3.lineStyle(1, 0xFFFFFF, 1, true);
_local3.beginFill(0, 0.8);
_local3.drawRoundRect(0, 0, (mini.width + 10), (mini.height + 4), 20);
_local3.endFill();
_local1.draw(_local2);
_local1.draw(mini, _local4);
helpImgs.push(_local1);
mini.text = (("ARMOR:\nREDUCES THE NEGATIVE DAMAGE.\n(" + priceDef.toString()) + " MONEY FOR 5 ARMOR POINTS)");
_local1 = new BitmapData(int(((mini.width + 1) + 10)), int(((mini.height + 1) + 10)), true, 0);
_local3.clear();
_local3.lineStyle(1, 0xFFFFFF, 1, true);
_local3.beginFill(0, 0.8);
_local3.drawRoundRect(0, 0, (mini.width + 10), (mini.height + 4), 20);
_local3.endFill();
_local1.draw(_local2);
_local1.draw(mini, _local4);
helpImgs.push(_local1);
mini.text = (("NORMAL POWER-UPS:\nPROVIDE A SPECIFIED NUMBER OF POINTS.\n(EACH UPGRADE COSTS " + priceNorm.toString()) + " MONEY)");
_local1 = new BitmapData(int(((mini.width + 1) + 10)), int(((mini.height + 1) + 10)), true, 0);
_local3.clear();
_local3.lineStyle(1, 0xFFFFFF, 1, true);
_local3.beginFill(0, 0.8);
_local3.drawRoundRect(0, 0, (mini.width + 10), (mini.height + 4), 20);
_local3.endFill();
_local1.draw(_local2);
_local1.draw(mini, _local4);
helpImgs.push(_local1);
mini.text = (("TRIP POWER-UPS:\nEACH OF THEM GIVES THE SPECIFIED NUMBER OF POINTS.\n(EACH UPGRADE COSTS " + priceHell.toString()) + " MONEY)");
_local1 = new BitmapData(int(((mini.width + 1) + 10)), int(((mini.height + 1) + 10)), true, 0);
_local3.clear();
_local3.lineStyle(1, 0xFFFFFF, 1, true);
_local3.beginFill(0, 0.8);
_local3.drawRoundRect(0, 0, (mini.width + 10), (mini.height + 4), 20);
_local3.endFill();
_local1.draw(_local2);
_local1.draw(mini, _local4);
helpImgs.push(_local1);
helpLast = -1;
helpCounter = 0;
helpNew = -1;
}
public function decHP():void{
hp = (hp - 5);
refresh();
}
public function decDef():void{
def = (def - 5);
refresh();
}
private function refreshCash():void{
var _local1:Matrix = new Matrix();
cash = ((((((hp - state.maxHP) * priceHP) / 5) + (((def - state.def) * priceDef) / 5)) + ((norm - state.norm) * priceNorm)) + ((hell - state.hell) * priceHell));
btnBuy.enabled = (((cash > 0)) && ((cash <= state.scores)));
cashText.fillRect(cashRC, 0);
text.text = "YOUR CASH: ";
_local1.tx = (200 - text.width);
cashText.draw(text, _local1);
text.text = state.scores.toString();
_local1.tx = 200;
cashText.draw(text, _local1);
_local1.ty = 26;
text.text = "TOTAL PRICE: ";
_local1.tx = (200 - text.width);
cashText.draw(text, _local1);
text.text = cash.toString();
_local1.tx = 200;
cashText.draw(text, _local1);
_local1.ty = 62;
text.text = "CASH LEFT: ";
_local1.tx = (200 - text.width);
cashText.draw(text, _local1);
text.text = (state.scores - cash).toString();
_local1.tx = 200;
cashText.draw(text, _local1);
}
public function incNorm():void{
norm++;
refresh();
}
override public function update(_arg1:Number):void{
var _local4:*;
var _local2:Number = (15 * _arg1);
var _local3:Number = level.power;
super.update(_arg1);
for each (_local4 in pills) {
PillImage(_local4).update(_arg1);
};
if ((((helpLast < 0)) && ((helpCounter <= 0)))){
helpLast = helpNew;
};
if (helpLast >= 0){
if (helpLast == helpNew){
if (helpCounter < 1){
helpCounter = (helpCounter + _local2);
if (helpCounter >= 1){
helpCounter = 1;
};
};
} else {
helpCounter = (helpCounter - _local2);
if (helpCounter <= 0){
helpCounter = 0;
helpLast = helpNew;
};
};
};
if (hpPulse > 0){
hpPulse = (hpPulse - (4 * _arg1));
if (hpPulse < 0){
hpPulse = 0;
};
};
hpCounter = (hpCounter + (4 * _arg1));
if (_local3 < 0.33){
if (hpCounter > 4){
hpCounter = (hpCounter - 4);
hpPulse = 1;
};
} else {
if (_local3 < 0.66){
if (hpCounter > 2){
hpCounter = (hpCounter - 2);
hpPulse = 1;
};
} else {
if (hpCounter > 1){
hpCounter = (hpCounter - 1);
hpPulse = 1;
};
};
};
}
private function refresh():void{
var _local1:Matrix = new Matrix();
refreshCash();
text.text = hp.toString();
_local1.tx = ((hpRC.width - text.width) * 0.5);
hpText.fillRect(hpRC, 0);
hpText.draw(text, _local1);
text.text = (def.toString() + "%");
_local1.tx = ((defRC.width - text.width) * 0.5);
defText.fillRect(defRC, 0);
defText.draw(text, _local1);
btnHPDec.enabled = !((hp == state.maxHP));
btnHPInc.enabled = (((hp < 100)) && (((state.scores - cash) >= priceHP)));
btnDefDec.enabled = (def > state.def);
btnDefInc.enabled = (((def < 75)) && (((state.scores - cash) >= priceDef)));
btnNormDec.enabled = !((norm == state.norm));
btnNormInc.enabled = (((norm <= hell)) && (((state.scores - cash) >= priceNorm)));
btnHellDec.enabled = ((!((hell == state.hell))) && ((norm <= hell)));
btnHellInc.enabled = (((hell < 3)) && (((state.scores - cash) >= priceHell)));
}
public function decNorm():void{
norm--;
refresh();
}
public function go():Boolean{
var _local1:Boolean;
if (_local1){
gui.setCurrent(this);
hp = state.maxHP;
def = state.def;
norm = state.norm;
hell = state.hell;
cash = 0;
refresh();
};
return (_local1);
}
}
}//package ui
Section 91
//UpgradeMenu_gfxDecClick (ui.UpgradeMenu_gfxDecClick)
package ui {
import mx.core.*;
public class UpgradeMenu_gfxDecClick extends BitmapAsset {
}
}//package ui
Section 92
//UpgradeMenu_gfxDecDef (ui.UpgradeMenu_gfxDecDef)
package ui {
import mx.core.*;
public class UpgradeMenu_gfxDecDef extends BitmapAsset {
}
}//package ui
Section 93
//UpgradeMenu_gfxDecDis (ui.UpgradeMenu_gfxDecDis)
package ui {
import mx.core.*;
public class UpgradeMenu_gfxDecDis extends BitmapAsset {
}
}//package ui
Section 94
//UpgradeMenu_gfxDef (ui.UpgradeMenu_gfxDef)
package ui {
import mx.core.*;
public class UpgradeMenu_gfxDef extends BitmapAsset {
}
}//package ui
Section 95
//UpgradeMenu_gfxIncClick (ui.UpgradeMenu_gfxIncClick)
package ui {
import mx.core.*;
public class UpgradeMenu_gfxIncClick extends BitmapAsset {
}
}//package ui
Section 96
//UpgradeMenu_gfxIncDecGlow (ui.UpgradeMenu_gfxIncDecGlow)
package ui {
import mx.core.*;
public class UpgradeMenu_gfxIncDecGlow extends BitmapAsset {
}
}//package ui
Section 97
//UpgradeMenu_gfxIncDef (ui.UpgradeMenu_gfxIncDef)
package ui {
import mx.core.*;
public class UpgradeMenu_gfxIncDef extends BitmapAsset {
}
}//package ui
Section 98
//UpgradeMenu_gfxIncDis (ui.UpgradeMenu_gfxIncDis)
package ui {
import mx.core.*;
public class UpgradeMenu_gfxIncDis extends BitmapAsset {
}
}//package ui
Section 99
//UpgradeMenu_gfxLabel (ui.UpgradeMenu_gfxLabel)
package ui {
import mx.core.*;
public class UpgradeMenu_gfxLabel extends BitmapAsset {
}
}//package ui
Section 100
//Env (Env)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import Envi.*;
public class Env {
private const hell:Array;
private const hellCount:int = 7;
private var imgClouds:Array;
private var musicLenght:Number;
public var colors:EnvColor;
private var effects:Array;
private var channel:SoundChannel;
private var power:Number;
private var musicTrans:SoundTransform;
private var rGrass2Img:Class;
public var colGrass:uint;
private var sndPower:Sound;
public var day:Boolean;
private var music:Sound;
public var colGround:uint;
private var shape:Shape;
private var rTex2Snd:Class;
private var imgGround:BitmapData;
private var imgGrass:BitmapData;
private var imgStar:BitmapData;
private var rPowerSnd:Class;
private var rStarImg:Class;
public var ctGrass:ColorTransform;
private var rGrassImg:Class;
private var norm:EnvColor;
public var blanc:Number;
private var musicAttack:Number;
private var rCloudImg1:Class;
private var rCloudImg2:Class;
private var rCloudImg3:Class;
public var ctProgress:ColorTransform;
private var time:Number;
private var imgSky:BitmapData;
private var imgGrass2:BitmapData;
private var clouds:Array;
private var nightSky:Array;
private var grassCounter:Number;
public var colProgress:uint;
private var curEffect:EnvEffect;
private var sndTex2:Sound;
private var shBlanc:Shape;
public var x:Number;
public var y:Number;
public function Env(){
var _local2:int;
rCloudImg1 = Env_rCloudImg1;
rCloudImg2 = Env_rCloudImg2;
rCloudImg3 = Env_rCloudImg3;
rGrassImg = Env_rGrassImg;
rGrass2Img = Env_rGrass2Img;
rStarImg = Env_rStarImg;
rTex2Snd = Env_rTex2Snd;
rPowerSnd = Env_rPowerSnd;
hell = [new EnvColor(0xFF0000, 0xFFFF00), new EnvColor(0xFFFF00, 0xFF0000), new EnvColor(0xFF00, 0xFF), new EnvColor(0xFFFF, 0xFFFF00), new EnvColor(0xFF, 0xFFFF00), new EnvColor(0xFF00FF, 0xFFFF00), new EnvColor(0xFF0000, 0xFFFF00)];
super();
var _local1:Number = 0;
shape = new Shape();
norm = new EnvColor(4175346, 0);
colors = new EnvColor(0, 0);
effects = [new EnvEffect1(), new EnvEffect2(), new EnvEffect3(), new EnvEffect4()];
shBlanc = new Shape();
blanc = 0;
grassCounter = 0;
power = 0;
day = true;
updateNorm();
time = 0;
initGrass();
initDay();
initNight();
curEffect = effects[3];
colGrass = 4278255360;
colGround = 4281801990;
colProgress = 4284297484;
ctGrass = new ColorTransform();
utils.ARGB2ColorTransform(colGrass, ctGrass);
ctProgress = new ColorTransform();
utils.ARGB2ColorTransform(colProgress, ctProgress);
sndPower = new rPowerSnd();
sndTex2 = new rTex2Snd();
musicTrans = new SoundTransform(0);
music = sndTex2;
channel = music.play(0, 0, musicTrans);
channel.addEventListener(Event.SOUND_COMPLETE, loopMusic);
musicAttack = 0;
}
private function initNight():void{
var _local1:*;
var _local2 = 30;
imgStar = new rStarImg().bitmapData;
nightSky = new Array(30);
while (_local2 > 0) {
nightSky[_local2] = new EnvStar();
_local2--;
};
}
public function loopMusic(_arg1:Event):void{
if (power < 0.5){
musicTrans.volume = (power * 0.3);
};
if (channel != null){
channel.stop();
channel.removeEventListener(Event.SOUND_COMPLETE, loopMusic);
channel = music.play(0, 0, musicTrans);
channel.addEventListener(Event.SOUND_COMPLETE, loopMusic);
};
}
public function draw1(_arg1:BitmapData):void{
var _local2:Rectangle = new Rectangle(0, 0, 640, 400);
var _local3:Graphics = shape.graphics;
if (power < 0.5){
if (day){
_arg1.copyPixels(imgSky, _local2, new Point(0, 0));
drawSky(_arg1);
} else {
_arg1.fillRect(_local2, 1118515);
drawNight(_arg1);
};
} else {
curEffect.draw(_arg1);
_local3.clear();
_local3.beginFill(colors.bg, (0.4 * musicAttack));
_local3.drawCircle((613 - x), (380 - y), (musicAttack * 30));
_local3.drawCircle((320 - ((x - 293) * 0.97)), (200 - ((y - 180) * 0.97)), (musicAttack * 25));
_local3.drawCircle((320 + ((x - 293) * 0.7)), (200 + ((y - 180) * 0.7)), (musicAttack * 10));
_local3.endFill();
_arg1.draw(shape);
};
}
public function drawNight(_arg1:BitmapData):void{
var _local2:Number;
var _local4:*;
var _local5:EnvStar;
var _local3:Matrix = new Matrix();
for each (_local4 in nightSky) {
_local5 = EnvStar(_local4);
_local2 = _local5.t;
_local3.identity();
_local3.translate(-7, -7);
_local3.rotate(_local5.a);
_local3.scale((0.75 + (0.25 * Math.sin((_local2 * 6.28)))), (0.75 + (0.25 * Math.sin((_local2 * 6.28)))));
_local3.translate(_local5.x, _local5.y);
_arg1.draw(imgStar, _local3, _local5.color, null, null, true);
};
}
public function updateBlanc(_arg1:Number):void{
if (blanc > 0){
blanc = (blanc - (0.5 * _arg1));
};
}
private function updateColors():void{
var _local1:int;
var _local2:Number = time;
var _local3:Number = (power * power);
_local1 = int(_local2);
_local2 = (_local2 - _local1);
colors.lerp(_local2, hell[_local1], hell[(_local1 + 1)]);
colGrass = (4278190080 | utils.lerpColor(utils.multColorScalar(1537797, (1 - _local3)), colors.bg, (_local3 * grassCounter)));
colGround = (4278190080 | utils.lerpColor(3611910, utils.multColorScalar(colors.bg, (grassCounter * power)), _local3));
colProgress = (4278190080 | utils.lerpColor(6107404, colors.bg, _local3));
utils.ARGB2ColorTransform(colGrass, ctGrass);
utils.ARGB2ColorTransform(colProgress, ctProgress);
}
public function drawBlanc(_arg1:BitmapData):void{
shBlanc.graphics.clear();
shBlanc.graphics.beginFill(0xFFFFFF, blanc);
shBlanc.graphics.drawRect(0, 0, 640, 480);
shBlanc.graphics.endFill();
_arg1.draw(shBlanc);
}
public function updateNorm():void{
if (day){
norm.bg = 4175346;
norm.text = 0;
} else {
norm.bg = 1118515;
norm.text = 0xFFFFFF;
};
}
public function drawSky(_arg1:BitmapData):void{
var _local2:Number;
var _local4:BitmapData;
var _local5:EnvCloud;
var _local3:Matrix = new Matrix();
for each (_local5 in clouds) {
_local2 = _local5.counter;
_local4 = BitmapData(imgClouds[_local5.id]);
_local3.identity();
_local3.translate((-(_local4.width) * 0.5), (-(_local4.height) * 0.5));
_local3.scale((0.9 + (0.1 * Math.sin((_local2 * 6.28)))), (0.95 + (0.05 * Math.sin(((_local2 * 6.28) + 3.14)))));
_local3.translate(_local5.x, _local5.y);
_arg1.draw(_local4, _local3, null, null, null, true);
};
}
public function update(_arg1:Number, _arg2:Number):void{
var _local3:Number;
var _local4:int;
var _local5:SoundTransform;
var _local6:EnvCloud;
var _local7:EnvStar;
if (_arg2 != power){
if ((((_arg2 >= 0.5)) && ((power < 0.5)))){
day = !(day);
updateNorm();
blanc = 1;
musicTrans.volume = 1;
channel.soundTransform = musicTrans;
sndPower.play();
} else {
if ((((power >= 0.5)) && ((_arg2 < 0.5)))){
blanc = 1;
colGrass = 4278255360;
colGround = 4281801990;
colProgress = 4284297484;
utils.ARGB2ColorTransform(colGrass, ctGrass);
utils.ARGB2ColorTransform(colProgress, ctProgress);
curEffect = effects[int((Math.random() * effects.length))];
};
};
power = _arg2;
if (power < 0.5){
musicTrans.volume = (power * 0.3);
channel.soundTransform = musicTrans;
};
};
if (grassCounter > 0){
grassCounter = (grassCounter - (_arg1 * 4));
if (grassCounter < 0){
grassCounter = 0;
};
};
if (power < 0.5){
if (day){
for each (_local6 in clouds) {
_local6.update(_arg1, power);
};
} else {
for each (_local7 in nightSky) {
_local7.update(_arg1, power);
};
};
} else {
curEffect.power = power;
curEffect.c1 = colors.bg;
curEffect.c2 = utils.multColorScalar(colors.bg, 0.5);
curEffect.update(_arg1);
time = (time + (_arg1 * 0.1));
while (time > (hellCount - 1)) {
time = (time - (hellCount - 1));
};
_local3 = ((channel.leftPeak + channel.rightPeak) * 0.5);
updateColors();
musicAttack = ((musicAttack * 0.7) + (_local3 * 0.7));
curEffect.peak = musicAttack;
};
}
private function initGrass():void{
var _local1:Rectangle = new Rectangle(0, 0, 128, 16);
var _local2:BitmapData = new rGrassImg().bitmapData;
var _local3:BitmapData = new rGrass2Img().bitmapData;
var _local4:Point = new Point();
var _local5 = 5;
var _local6:Matrix = new Matrix();
_local6.createGradientBox(640, 80, 1.57, 0, 0);
imgGrass = new BitmapData(640, 8, true, 0);
imgGrass2 = new BitmapData(640, 8, true, 0);
imgGround = new BitmapData(640, 80, false, 0);
imgGrass.lock();
imgGrass2.lock();
while (_local5 > 0) {
imgGrass.copyPixels(_local2, _local1, _local4, null, null, true);
imgGrass2.copyPixels(_local3, _local1, _local4, null, null, true);
_local4.x = (_local4.x + 128);
_local5--;
};
imgGrass.unlock();
imgGrass2.unlock();
shape.graphics.clear();
shape.graphics.beginGradientFill(GradientType.LINEAR, [3611910, 6107404], [1, 1], [0, 0xFF], _local6);
shape.graphics.drawRect(0, 0, 640, 80);
shape.graphics.endFill();
imgGround.draw(shape);
}
public function beat():void{
grassCounter = 1;
}
private function initDay():void{
var _local3:EnvCloud;
var _local1:Number = 0;
var _local2:Matrix = new Matrix();
_local2.createGradientBox(640, 400, 1.57, 0, 0);
shape.graphics.clear();
shape.graphics.beginGradientFill(GradientType.LINEAR, [4175346, 14545663], [1, 1], [0, 0xFF], _local2);
shape.graphics.drawRect(0, 0, 640, 480);
shape.graphics.endFill();
imgSky = new BitmapData(640, 400, false);
imgSky.draw(shape);
imgClouds = [new rCloudImg1().bitmapData, new rCloudImg2().bitmapData, new rCloudImg3().bitmapData];
clouds = [new EnvCloud(), new EnvCloud(), new EnvCloud(), new EnvCloud(), new EnvCloud()];
for each (_local3 in clouds) {
_local3.init(_local1);
_local1 = (_local1 + (128 + (Math.random() * 22)));
};
}
public function draw2(_arg1:BitmapData):void{
var _local2:Matrix = new Matrix(1, 0, 0, 1, 0, 392);
var _local3:Rectangle = new Rectangle(0, 400, 640, 80);
if (power < 0.5){
_arg1.draw(imgGround, new Matrix(1, 0, 0, 1, 0, 400));
_arg1.draw(imgGrass, _local2, ctGrass);
} else {
_arg1.fillRect(_local3, colGround);
_arg1.draw(imgGrass2, _local2, ctGrass);
};
}
}
}//package
Section 101
//Env_rCloudImg1 (Env_rCloudImg1)
package {
import mx.core.*;
public class Env_rCloudImg1 extends BitmapAsset {
}
}//package
Section 102
//Env_rCloudImg2 (Env_rCloudImg2)
package {
import mx.core.*;
public class Env_rCloudImg2 extends BitmapAsset {
}
}//package
Section 103
//Env_rCloudImg3 (Env_rCloudImg3)
package {
import mx.core.*;
public class Env_rCloudImg3 extends BitmapAsset {
}
}//package
Section 104
//Env_rGrass2Img (Env_rGrass2Img)
package {
import mx.core.*;
public class Env_rGrass2Img extends BitmapAsset {
}
}//package
Section 105
//Env_rGrassImg (Env_rGrassImg)
package {
import mx.core.*;
public class Env_rGrassImg extends BitmapAsset {
}
}//package
Section 106
//Env_rPowerSnd (Env_rPowerSnd)
package {
import mx.core.*;
public class Env_rPowerSnd extends SoundAsset {
}
}//package
Section 107
//Env_rStarImg (Env_rStarImg)
package {
import mx.core.*;
public class Env_rStarImg extends BitmapAsset {
}
}//package
Section 108
//Env_rTex2Snd (Env_rTex2Snd)
package {
import mx.core.*;
public class Env_rTex2Snd extends SoundAsset {
}
}//package
Section 109
//EnvCloud (EnvCloud)
package {
public class EnvCloud {
public var x:Number;
public var y:Number;
public var id:int;
public var counter:Number;
public function update(_arg1:Number, _arg2:Number):void{
x = (x - (((0.75 + (0.25 * Math.sin((counter * 6.2832)))) * (30 + (_arg2 * 200))) * _arg1));
if (x <= -50){
x = (x + 740);
y = (40 + (Math.random() * 90));
id = int((Math.random() * 3));
};
counter = (counter + ((0.1 + (0.9 * _arg2)) * _arg1));
if (counter >= 1){
counter = (counter - int(counter));
};
}
public function init(_arg1:Number):void{
x = _arg1;
y = utils.rnd_float(40, 90);
id = utils.rnd_int(0, 2);
counter = Math.random();
}
}
}//package
Section 110
//EnvColor (EnvColor)
package {
public class EnvColor {
public var text:uint;
public var bg:uint;
public function EnvColor(_arg1:uint, _arg2:uint){
bg = _arg1;
text = _arg2;
}
public function lerp(_arg1:Number, _arg2:EnvColor, _arg3:EnvColor):void{
bg = utils.lerpColor(_arg2.bg, _arg3.bg, _arg1);
text = utils.lerpColor(_arg2.text, _arg3.text, _arg1);
}
}
}//package
Section 111
//EnvStar (EnvStar)
package {
import flash.geom.*;
public class EnvStar {
public var a:Number;
public var vx:Number;
public var vy:Number;
public var color:ColorTransform;
public var t:Number;
public var x:Number;
public var y:Number;
public function EnvStar(){
color = new ColorTransform();
x = (640 * Math.random());
y = (400 * Math.random());
a = (Math.random() * 6.28);
vx = (400 * Math.cos(a));
vy = (400 * Math.sin(a));
t = Math.random();
}
public function update(_arg1:Number, _arg2:Number):void{
var _local3:Number = (_arg1 * _arg2);
x = (x + (vx * _local3));
y = (y + (vy * _local3));
if (x < -7){
x = (x + 654);
} else {
if (x > 647){
x = (x - 654);
};
};
if (y < -7){
y = (y + 414);
} else {
if (y > 407){
y = (y - 414);
};
};
t = (t + ((5 * _arg2) * _arg1));
if (t >= 1){
t = (t - int(t));
};
_local3 = (1 - (y / 400));
color.alphaMultiplier = Math.sqrt(_local3);
}
}
}//package
Section 112
//FloatText (FloatText)
package {
import flash.display.*;
import flash.geom.*;
public class FloatText {
public var img:BitmapData;
public var t:Number;
public var x:Number;
public var y:Number;
public var color:ColorTransform;
public function FloatText(){
t = 0;
color = new ColorTransform();
}
}
}//package
Section 113
//Game (Game)
package {
import flash.events.*;
import flash.display.*;
import ui.*;
import ek.sui.*;
import ek.*;
import flash.text.*;
import flash.media.*;
import flash.net.*;
public class Game implements ekIListener {
public const MENU:int = 0;
public const LEVEL:int = 1;
public var levelMenu:LevelMenu;
public var level:Level;
public var gameSave:GameState;
private var state:int;
public var stage:Stage;
public var maxScoresFinish:Boolean;
public var mute:Boolean;
public var maxScores:int;
public var scoresTable:ScoresTable;
public var uiMedia:UIMedia;
public var inGame:Boolean;
public var mainMenu:GameMenu;
public var gui:SUISystem;
public var gameState:GameState;
private var resourceManager:Resources;
public var imgBG:BitmapData;
public var lastScoresFinish:Boolean;
private var device:ekDevice;
public var lastScores:int;
private var canvas:BitmapData;
public var descScreen:DescScreen;
public var back:BitmapData;
private var debugInfoText:TextField;
public var backBitmap:Bitmap;
private var debugInfoTgl:Boolean;
private var shopMenu:UpgradeMenu;
public var hires:Boolean;
public static var instance:Game;
public function Game(){
instance = this;
device = ekDevice.instance;
device.callbackFPS = updateFPS;
device.listener = this;
stage = device.stage;
stage.frameRate = 75;
device.quality = 0;
gameState = new GameState();
gameSave = new GameState();
resourceManager = new Resources();
back = new BitmapData(640, 480, false, 0);
backBitmap = new Bitmap(back);
canvas = back;
imgBG = new BitmapData(640, 480, false);
level = new Level(gameState);
debugInfoTgl = true;
state = MENU;
inGame = false;
mute = false;
hires = true;
maxScores = 0;
maxScoresFinish = false;
lastScores = 0;
lastScoresFinish = false;
stage.addChildAt((backBitmap as DisplayObject), 0);
debugInfoText = new TextField();
debugInfoText.defaultTextFormat = new TextFormat("_mini", 15, 0xFFFFFF);
debugInfoText.embedFonts = true;
debugInfoText.cacheAsBitmap = true;
gui = new SUISystem();
level.gui = gui;
gui.listen(stage);
uiMedia = new UIMedia();
mainMenu = new GameMenu(this, gui);
levelMenu = new LevelMenu(this);
descScreen = new DescScreen(gui);
shopMenu = new UpgradeMenu(gui, level);
mainMenu.shop = shopMenu;
level.initShopMenu(shopMenu);
level.levelMenu = levelMenu;
scoresTable = new ScoresTable();
mainMenu.go();
level.env.blanc = 1;
level.sndStart.play();
}
public function changeMute():void{
mute = !(mute);
if (mute){
SoundMixer.soundTransform = new SoundTransform(0);
} else {
SoundMixer.soundTransform = new SoundTransform(1);
};
mainMenu.refreshVol(this);
}
public function clickNewGame():void{
if (inGame){
level.setPause(false);
levelMenu.go(gui);
} else {
newGame();
};
}
public function save():void{
gameSave.assign(gameState);
}
public function goCredits():void{
if (inGame){
updateResults();
state = MENU;
inGame = false;
if (gui.current != mainMenu){
gui.current = mainMenu;
};
mainMenu.refreshInGame(this);
level.env.blanc = 1;
level.progress.end();
} else {
descScreen.go(1);
};
}
public function updateResults():void{
var _local1:Boolean;
if (level.stage != null){
_local1 = (((gameState.level >= (level.stagesCount - 1))) && (level.stage.win));
};
if (gameState.scores >= maxScores){
if ((((gameState.scores == maxScores)) && (_local1))){
maxScoresFinish = true;
} else {
maxScoresFinish = _local1;
};
maxScores = gameState.scores;
};
lastScores = gameState.scores;
lastScoresFinish = _local1;
mainMenu.updateScores();
}
public function goPause():void{
level.setPause(true);
mainMenu.go();
mainMenu.refreshInGame(this);
}
public function keyDown(_arg1:KeyboardEvent):void{
var _local2:uint = _arg1.keyCode;
if (_local2 == 112){
debugInfoTgl = !(debugInfoTgl);
} else {
if (state == LEVEL){
level.keyDown(_local2);
};
if ((((gui.current == descScreen)) && ((((_local2 == 27)) || ((_local2 == 13)))))){
descScreen.back();
};
};
}
public function submitHighScores():void{
scoresTable.submitScores();
}
private function newGame():void{
gameSave.reset();
startLevel();
}
public function showHighScores():void{
scoresTable.showScores();
}
public function startLevel():void{
levelMenu.go(gui);
gameState.assign(gameSave);
level.start();
setState(LEVEL);
inGame = true;
}
public function goHelp():void{
descScreen.go(0);
}
public function changeRes():void{
hires = !(hires);
if (hires){
device.quality = 0;
} else {
device.quality = 2;
};
mainMenu.refreshRes(this);
level.env.blanc = 1;
}
private function setState(_arg1:int):void{
state = _arg1;
}
public function keyUp(_arg1:KeyboardEvent):void{
var _local2:uint = _arg1.keyCode;
if (state == LEVEL){
level.keyUp(_local2);
};
}
public function goSp():void{
navigateToURL(new URLRequest("http://www.gameshed.com/"), "_blank");
}
public function goNextLevel():void{
level.nextLevel();
}
public function frame(_arg1:Number):void{
var _local2:Env = level.env;
switch (state){
case MENU:
_local2.update(_arg1, 0);
level.progress.update(_arg1, 0);
break;
case LEVEL:
level.update(_arg1);
break;
};
gui.update(_arg1);
_local2.updateBlanc(_arg1);
canvas.lock();
if (gui.current != scoresTable){
switch (state){
case MENU:
_local2.draw1(canvas);
_local2.draw2(canvas);
level.progress.draw(canvas);
break;
case LEVEL:
level.draw(canvas);
break;
};
};
gui.draw(canvas);
if (_local2.blanc > 0){
_local2.drawBlanc(canvas);
};
if (debugInfoTgl){
canvas.draw(debugInfoText);
};
canvas.unlock();
}
public function updateFPS(_arg1:int):void{
if (debugInfoTgl){
debugInfoText.text = _arg1.toString();
};
}
}
}//package
Section 114
//GameInfo (GameInfo)
package {
import flash.display.*;
import flash.geom.*;
import flash.text.*;
public class GameInfo {
private const ftSize:int = 50;
private var ftPool:Array;
public var powers:Array;
public var toxics:Array;
private var ftCount:int;
public var b:Number;
public var damages:Array;
public var one:BitmapData;
public var g:Number;
private var text:TextField;
public var r:Number;
public var sleeps:Array;
public function GameInfo(){
var _local1:int;
var _local2:BitmapData;
super();
ftPool = new Array(ftSize);
while (_local1 < ftSize) {
ftPool[_local1] = new FloatText();
_local1++;
};
ftCount = 0;
text = new TextField();
text.defaultTextFormat = new TextFormat("_mini", 15, 4294967295);
text.embedFonts = true;
text.cacheAsBitmap = true;
text.autoSize = TextFieldAutoSize.LEFT;
powers = new Array();
toxics = new Array();
sleeps = new Array();
damages = new Array();
text.text = "+1";
one = new BitmapData(text.width, text.height, true, 0);
one.draw(text);
text.text = "+5";
_local2 = new BitmapData(text.width, text.height, true, 0);
_local2.draw(text);
powers.push(_local2);
text.text = "+10";
_local2 = new BitmapData(text.width, text.height, true, 0);
_local2.draw(text);
powers.push(_local2);
text.text = "+25";
_local2 = new BitmapData(text.width, text.height, true, 0);
_local2.draw(text);
powers.push(_local2);
text.text = "+50";
_local2 = new BitmapData(text.width, text.height, true, 0);
_local2.draw(text);
powers.push(_local2);
text.text = "+100";
_local2 = new BitmapData(text.width, text.height, true, 0);
_local2.draw(text);
powers.push(_local2);
text.text = "+150";
_local2 = new BitmapData(text.width, text.height, true, 0);
_local2.draw(text);
powers.push(_local2);
text.text = "FIRST BLOOD! +100";
_local2 = new BitmapData(text.width, text.height, true, 0);
_local2.draw(text);
toxics.push(_local2);
text.text = "MANIACALISTIC! +150";
_local2 = new BitmapData(text.width, text.height, true, 0);
_local2.draw(text);
toxics.push(_local2);
text.text = "SUPER RESISTANCE! +200";
_local2 = new BitmapData(text.width, text.height, true, 0);
_local2.draw(text);
toxics.push(_local2);
text.text = "WAKE UP!";
_local2 = new BitmapData(text.width, text.height, true, 0);
_local2.draw(text);
sleeps.push(_local2);
text.text = "LULLABY...";
_local2 = new BitmapData(text.width, text.height, true, 0);
_local2.draw(text);
sleeps.push(_local2);
text.text = "FALLING ASLEEP..";
_local2 = new BitmapData(text.width, text.height, true, 0);
_local2.draw(text);
sleeps.push(_local2);
text.text = "OOPS!";
_local2 = new BitmapData(text.width, text.height, true, 0);
_local2.draw(text);
damages.push(_local2);
text.text = "REALLY HARD...";
_local2 = new BitmapData(text.width, text.height, true, 0);
_local2.draw(text);
damages.push(_local2);
text.text = "BE CAREFUL!";
_local2 = new BitmapData(text.width, text.height, true, 0);
_local2.draw(text);
damages.push(_local2);
}
public function update(_arg1:Number, _arg2:Number):void{
var _local5:Number;
var _local6:FloatText;
var _local3:int;
var _local4:int = ftCount;
for each (_local6 in ftPool) {
if (_local3 == _local4){
break;
};
if (_local6.t > 0){
_local6.t = (_local6.t - _arg2);
if (_local6.t <= 0){
ftCount--;
} else {
_local6.y = (_local6.y - (50 * _arg2));
_local5 = 0.25;
if (_local6.t > 0.75){
_local5 = (1 - _local6.t);
} else {
if (_local6.t < 0.25){
_local5 = _local6.t;
};
};
_local5 = (_local5 * 4);
ctCalc(_local6.color, _local6.t);
_local6.color.alphaMultiplier = _local5;
};
_local3++;
};
};
}
public function setRGB(_arg1:uint):void{
r = (((_arg1 >> 16) & 0xFF) * 0.003921569);
g = (((_arg1 >> 8) & 0xFF) * 0.003921569);
b = ((_arg1 & 0xFF) * 0.003921569);
}
public function reset():void{
var _local1:FloatText;
for each (_local1 in ftPool) {
_local1.t = 0;
_local1.img = null;
};
ftCount = 0;
}
public function drawFT(_arg1:BitmapData):void{
var _local4:FloatText;
var _local2:int;
var _local3:Matrix = new Matrix();
for each (_local4 in ftPool) {
if (_local2 == ftCount){
break;
};
if (_local4.t > 0){
_local3.tx = _local4.x;
_local3.ty = int(_local4.y);
_arg1.draw(_local4.img, _local3, _local4.color, null, null, false);
_local2++;
};
};
}
public function add(_arg1:Number, _arg2:Number, _arg3:BitmapData):void{
var _local4:FloatText;
for each (_local4 in ftPool) {
if (_local4.t <= 0){
_local4.t = 1;
_local4.x = (_arg1 - (_arg3.width >> 1));
_local4.y = (_arg2 - (_arg3.height >> 1));
_local4.img = _arg3;
ftCount++;
break;
};
};
}
private function ctCalc(_arg1:ColorTransform, _arg2:Number):void{
var _local3:Number = (0.5 * (1 + Math.sin(((_arg2 * 6.28) * 4))));
_arg1.redMultiplier = (r * _local3);
_arg1.greenMultiplier = (g * _local3);
_arg1.blueMultiplier = (b * _local3);
}
}
}//package
Section 115
//GameState (GameState)
package {
public class GameState {
public var scores:int;
public var health:int;
public var level:int;
public var def:int;
public var maxHP:int;
public var norm:int;
public var hell:int;
public function GameState(){
reset();
}
public function calcHellScores(_arg1:int):int{
var _local2 = 1;
switch (_arg1){
case 0:
_local2 = 5;
break;
case 1:
_local2 = 10;
break;
case 2:
_local2 = 25;
break;
case 3:
_local2 = 50;
break;
case 4:
_local2 = 100;
break;
case 5:
_local2 = 150;
break;
};
return (_local2);
}
public function reset():void{
def = 0;
maxHP = 25;
norm = 0;
hell = 0;
health = maxHP;
level = 0;
scores = 0;
}
public function assign(_arg1:GameState):void{
def = _arg1.def;
maxHP = _arg1.maxHP;
norm = _arg1.norm;
hell = _arg1.hell;
health = _arg1.health;
level = _arg1.level;
scores = _arg1.scores;
}
}
}//package
Section 116
//Hero (Hero)
package {
import flash.display.*;
public class Hero {
private const duck_jump_gravity:Number = 200;
private const duck_wings_limit:Number = -20;
private const duck_h2:int = 40;
private const duck_jump_toxic:Number = 100;
private const duck_h:int = 20;
private const duck_wings_bonus:Number = 60;
private const duck_w:int = 27;
private const duck_move_slowing:Number = 10;
private const duck_move_slowing_in_the_sky:Number = 1;
private const duck_move_speed_min:Number = 40;
private const duck_jump_start_vel_min:Number = 127;
private const duck_move_speed_max:Number = 250;
private const duck_move_acc:Number = 5;
private const duck_jump_start_vel_max:Number = 379;
private const duck_w2:int = 54;
private var slow:Number;
private var power:Number;
private var jumpStartVel:Number;
public var xLast:Number;
private var key_right:Boolean;
public var toxic_collected:int;
private var blinkTime:Number;
private var wingYLocked:Boolean;
public var flip:Boolean;
private var wingCounter:Number;
private var fly:Boolean;
public var y:Number;
private var key_up:Boolean;
private var started:Boolean;
private var key_down:Boolean;
private var jumpWingVel:Number;
public var x:Number;
private var wingAngle:Number;
public var state:GameState;
private var dx:Number;
private var dy:Number;
public var jumpVel:Number;
private var steping:Boolean;
public var particles:Particles;
public var yLast:Number;
private var wingY:Number;
public var frags:int;
private var step:Number;
private var move:Number;
private var wingLock:Boolean;
public var sleep:Boolean;
public var diveK:Number;
public var media:HeroMedia;
private var key_left:Boolean;
public var env:Env;
public var sleep_collected:int;
private var wingMod:Number;
public function Hero(){
media = new HeroMedia();
flip = true;
sleep = false;
started = false;
}
public function overlapsCircle(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
var _local4:Boolean;
if ((((x < 0)) && ((_arg1 > (630 - duck_w2))))){
_arg1 = (_arg1 - 640);
};
if (flip){
_arg1 = ((2 * (x + duck_w)) - _arg1);
};
if (sleep){
_local4 = rectCircle((x + 1), (y + 11), (x + 41), (y + 39), _arg1, _arg2, _arg3);
} else {
_local4 = ((((rectCircle((x + 14), (y + 13), (x + 49), (y + 38), _arg1, _arg2, _arg3)) || (rectCircle((x + 9), (y + 1), (x + 24), (y + 17), _arg1, _arg2, _arg3)))) || (rectCircle((x + 1), (y + 13), (x + 8), (y + 17), _arg1, _arg2, _arg3)));
};
return (_local4);
}
public function doSleep():void{
if (!sleep){
startSleepParticles();
media.playSleep();
sleep = true;
};
sleep_collected++;
}
public function doHeal(_arg1:int):void{
state.health = (state.health + _arg1);
if (state.health > state.maxHP){
state.health = state.maxHP;
};
particles.explHeal(x, y);
}
public function checkDive(_arg1:Number, _arg2:Number):Boolean{
var _local3:Boolean;
var _local4:Number = _arg1;
var _local5:Number = _arg2;
if ((((x < 0)) && ((_local4 > (630 - duck_w2))))){
_local4 = (_local4 - 640);
};
if (flip){
_local4 = ((2 * (x + duck_w)) - _local4);
};
_local3 = ((((fly) && (((yLast + duck_h2) <= _local5)))) && (((y + duck_h2) >= (_local5 - 10))));
if (sleep){
_local3 = ((((_local3) && ((_local4 >= ((x + 1) - 9))))) && ((_local4 <= ((x + 43) + 9))));
} else {
_local3 = ((((_local3) && ((_local4 >= ((x + 14) - 9))))) && ((_local4 <= ((x + 50) + 9))));
};
return (_local3);
}
public function init():void{
move = 0;
step = 0;
keysReset();
fly = false;
sleep = false;
started = false;
jumpVel = 0;
jumpStartVel = 0;
jumpWingVel = 0;
diveK = 0;
wingMod = 0;
wingCounter = 0;
wingAngle = 0;
wingYLocked = false;
blinkTime = 0;
y = (400 - duck_h2);
x = 0;
power = 0;
sleep_collected = 0;
toxic_collected = 0;
frags = 0;
}
public function jump(_arg1:Number):void{
var _local2:Number = Math.sqrt(((2 * duck_jump_gravity) * _arg1));
if (jumpVel < _local2){
jumpVel = _local2;
};
}
public function draw(_arg1:BitmapData):void{
if (started){
dx = x;
dy = y;
if ((((step > 1)) && (!(fly)))){
dy = (dy - 1);
};
drawHero(_arg1, dx, dy);
if (dx < 0){
dx = (dx + 640);
drawHero(_arg1, dx, dy);
} else {
if (dx > (640 - duck_w2)){
dx = (dx - 640);
drawHero(_arg1, dx, dy);
};
};
};
}
private function wingBeat():void{
wingCounter = 1;
media.playWing();
}
private function drawHero(_arg1:BitmapData, _arg2:Number, _arg3:Number):void{
var _local4:Boolean = (((blinkTime <= 0)) || ((int(blinkTime) & !((1 == 0)))));
if (_local4){
if (sleep){
media.drawSleep(_arg1, _arg2, _arg3, flip);
} else {
media.drawDuck(_arg1, _arg2, _arg3, power, flip, wingAngle);
};
};
}
private function doStepBubble():void{
var _local1:Number = (x + 4);
if (!flip){
_local1 = (x + 50);
};
particles.startStepBubble(_local1, (y + 39));
}
public function keyUp(_arg1:uint):void{
switch (_arg1){
case 40:
key_down = false;
break;
case 37:
key_left = false;
break;
case 38:
if (((key_up) && (started))){
if (fly){
if (wingLock){
wingLock = false;
if (jumpVel < 0){
jumpVel = 0;
};
};
};
};
key_up = false;
break;
case 39:
key_right = false;
break;
};
}
public function start(_arg1:Number):void{
started = true;
x = _arg1;
flip = (Math.random() < 0.5);
startSleepParticles();
media.playAwake();
}
private function doLandBubbles():void{
var _local1:Number;
var _local2:int = Math.abs((jumpVel * 0.05));
while (_local2 > 0) {
_local1 = ((x + 17) + (Math.random() * 20));
particles.startBubble(_local1, (y + duck_h2), 4288256409);
_local2--;
};
}
public function keyDown(_arg1:uint):void{
switch (_arg1){
case 40:
key_down = true;
break;
case 37:
key_left = true;
break;
case 38:
if (((!(key_up)) && (started))){
if (!fly){
if (!sleep){
fly = true;
jumpVel = jumpStartVel;
media.playJump();
doLandBubbles();
};
} else {
if (((!(wingLock)) && (!(sleep)))){
wingLock = true;
wingMod = 1;
wingYLocked = false;
wingBeat();
};
};
};
key_up = true;
break;
case 39:
key_right = true;
break;
};
}
private function get_jump_start_vel(_arg1:Number):Number{
return (utils.lerp(_arg1, duck_jump_start_vel_min, duck_jump_start_vel_max));
}
private function startSleepParticles():void{
var _local2:Number;
var _local3:Number;
var _local1 = 25;
while (_local1 > 0) {
_local2 = (x + (Math.random() * duck_w2));
_local3 = (y + (Math.random() * duck_h2));
particles.startBubble(_local2, _local3, 4285074554);
_local1--;
};
}
public function keysReset():void{
key_up = false;
key_right = false;
key_left = false;
key_down = false;
wingLock = false;
}
public function doHigh(_arg1:Number, _arg2:Number):Boolean{
var _local3:Boolean;
if (checkDive(_arg1, _arg2)){
jump(40);
_local3 = true;
};
return (_local3);
}
public function update(_arg1:Number, _arg2:Number):void{
if (!started){
return;
};
xLast = x;
yLast = y;
media.updateSFX((x + duck_w));
power = _arg2;
jumpStartVel = get_jump_start_vel(power);
if (((sleep) && ((power <= 0)))){
sleep = false;
startSleepParticles();
media.playAwake();
};
if (blinkTime > 0){
blinkTime = (blinkTime - (_arg1 * 8));
};
steping = false;
if (key_left){
steping = true;
flip = false;
move = (move - (duck_move_acc * _arg1));
if (move < -1){
move = -1;
};
};
if (key_right){
steping = true;
flip = true;
move = (move + (duck_move_acc * _arg1));
if (move > 1){
move = 1;
};
};
if (steping){
if (move >= 0){
step = (step + ((move * _arg1) * 15));
} else {
step = (step - ((move * _arg1) * 15));
};
if (step > 2){
step = (step - 2);
if (!fly){
media.playStep();
doStepBubble();
};
};
};
if (((!(key_left)) && (!(key_right)))){
if (fly){
slow = duck_move_slowing_in_the_sky;
} else {
slow = duck_move_slowing;
};
move = (move - ((move * slow) * _arg1));
if (step > 1){
if (!fly){
media.playStep();
};
step = 0;
};
};
x = (x + ((move * utils.lerp(power, duck_move_speed_min, duck_move_speed_max)) * _arg1));
if (x < -(duck_w)){
x = (x + 640);
};
if (x > (640 - duck_w)){
x = (x - 640);
};
if (((wingLock) && (!(sleep)))){
wingMod = (wingMod - (_arg1 * 7));
if (wingMod <= 0){
wingMod = (wingMod + 1);
wingBeat();
};
if (((wingYLocked) && ((y > wingY)))){
jumpWingVel = 28;
};
};
if (fly){
if (key_down){
diveK = (diveK + (_arg1 * 6));
if (diveK > 3){
diveK = 3;
};
} else {
diveK = (diveK - (_arg1 * 6));
if (diveK < 0){
diveK = 0;
};
};
if (jumpVel > 0){
wingYLocked = false;
};
if (((((wingLock) && (!(sleep)))) && (wingYLocked))){
jumpWingVel = (jumpWingVel - (392 * _arg1));
y = (y - (jumpWingVel * _arg1));
} else {
if (((wingLock) && (!(sleep)))){
if (jumpVel >= 0){
jumpVel = (jumpVel - ((duck_jump_gravity * (diveK + 1)) * _arg1));
y = (y - (jumpVel * _arg1));
if (jumpVel <= 0){
wingYLocked = true;
wingY = y;
};
} else {
jumpVel = (jumpVel + ((5 * duck_jump_gravity) * _arg1));
y = (y - (jumpVel * _arg1));
};
} else {
jumpVel = (jumpVel - ((duck_jump_gravity * (diveK + 1)) * _arg1));
y = (y - (jumpVel * _arg1));
};
};
if (y >= (400 - duck_h2)){
wingLock = false;
fly = false;
y = (400 - duck_h2);
media.playLand();
doLandBubbles();
sleep_collected = 0;
toxic_collected = 0;
frags = 0;
diveK = 0;
} else {
if (y < -50){
y = -50;
};
};
};
if (wingCounter > 0){
wingCounter = (wingCounter - (10 * _arg1));
if (wingCounter < 0){
wingCounter = 0;
};
wingAngle = (0.5 * Math.sin((wingCounter * 4.71)));
};
}
private function rectCircle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Boolean{
var _local8:Number = 0;
var _local9:Number = 0;
if (_arg5 < _arg1){
_local8 = (_arg5 - _arg1);
_local9 = (_local9 + (_local8 * _local8));
} else {
if (_arg5 > _arg3){
_local8 = (_arg5 - _arg3);
_local9 = (_local9 + (_local8 * _local8));
};
};
if (_arg6 < _arg2){
_local8 = (_arg6 - _arg2);
_local9 = (_local9 + (_local8 * _local8));
} else {
if (_arg6 > _arg4){
_local8 = (_arg6 - _arg4);
_local9 = (_local9 + (_local8 * _local8));
};
};
return ((_local9 <= (_arg7 * _arg7)));
}
public function getJumpHeight():Number{
return ((((jumpStartVel * jumpStartVel) * 0.5) / duck_jump_gravity));
}
public function doToxicDamage(_arg1:Number, _arg2:Number, _arg3:int, _arg4:int):int{
var _local5:int = (_arg3 - int(((_arg3 * state.def) / 100)));
var _local6 = -1;
if (checkDive(_arg1, _arg2)){
jump(40);
media.sndAttack.play(49);
particles.explStarsToxic(_arg1, (_arg2 - 10), _arg4, false);
if (frags < 3){
_local6 = 0;
} else {
if (frags < 6){
_local6 = 1;
} else {
_local6 = 2;
};
};
frags++;
} else {
if (_local5 > 0){
if (blinkTime <= 0){
if (state.health > 1){
state.health = (state.health - _local5);
if (state.health < 1){
state.health = 1;
};
} else {
state.health = 0;
};
blinkTime = 12;
particles.explStarsToxic(_arg1, _arg2, _arg4, true);
env.blanc = 1;
media.sndToxic.play();
} else {
particles.explStarsToxic(_arg1, _arg2, _arg4, false);
};
toxic_collected++;
};
};
return (_local6);
}
}
}//package
Section 117
//HeroMedia (HeroMedia)
package {
import flash.display.*;
import flash.geom.*;
import flash.media.*;
public class HeroMedia {
private var transformPanVol:SoundTransform;
private var imgEye1:BitmapData;
private var imgEye2:BitmapData;
private var rJumpSnd:Class;
private var sndSleep:Sound;
public var sndAttack:Sound;
private var trigStep:Boolean;
private var transformPan:SoundTransform;
private var imgDuck:BitmapData;
private var sndWing1:Sound;
private var sndWing2:Sound;
private var rSleepSnd:Class;
private var rWingSnd1:Class;
private var rWingSnd2:Class;
private var sndAwake:Sound;
private var rLandSnd:Class;
private var rAttackSnd:Class;
private var rAwakeSnd:Class;
private var sndJump:Sound;
private var rToxicSnd:Class;
private var trigWing:Boolean;
private var rEyeImg1:Class;
private var rEyeImg2:Class;
private var imgSleep:BitmapData;
public var sndToxic:Sound;
private var rWingImg:Class;
private var rStepSnd2:Class;
private var rStepSnd1:Class;
private var sndLand:Sound;
private var imgWing:BitmapData;
private var sndStep1:Sound;
private var sndStep2:Sound;
private var rSleepImg:Class;
private var rDuckImg:Class;
public function HeroMedia(){
rDuckImg = HeroMedia_rDuckImg;
rSleepImg = HeroMedia_rSleepImg;
rWingImg = HeroMedia_rWingImg;
rEyeImg1 = HeroMedia_rEyeImg1;
rEyeImg2 = HeroMedia_rEyeImg2;
rStepSnd1 = HeroMedia_rStepSnd1;
rStepSnd2 = HeroMedia_rStepSnd2;
rWingSnd1 = HeroMedia_rWingSnd1;
rWingSnd2 = HeroMedia_rWingSnd2;
rLandSnd = HeroMedia_rLandSnd;
rJumpSnd = HeroMedia_rJumpSnd;
rAwakeSnd = HeroMedia_rAwakeSnd;
rSleepSnd = HeroMedia_rSleepSnd;
rAttackSnd = HeroMedia_rAttackSnd;
rToxicSnd = HeroMedia_rToxicSnd;
super();
initGFX();
initSFX();
}
public function playSleep():void{
sndSleep.play(49, 0, transformPan);
}
public function updateSFX(_arg1:Number):void{
var _local2:Number = utils.pos2pan(_arg1);
if (_local2 > 1){
_local2 = 1;
} else {
if (_local2 < -1){
_local2 = -1;
};
};
transformPan.pan = _local2;
transformPanVol.pan = _local2;
transformPanVol.volume = (0.3 + (Math.random() * 0.7));
}
public function playStep():void{
var _local1:Sound;
if (trigStep){
_local1 = sndStep1;
} else {
_local1 = sndStep2;
};
trigStep = !(trigStep);
_local1.play(49, 0, transformPanVol);
}
public function playAwake():void{
sndAwake.play(49, 0, transformPan);
}
public function drawDuck(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean, _arg6:Number):void{
var _local7:Matrix = new Matrix(1, 0, 0, 1, _arg2, _arg3);
var _local8:ColorTransform = new ColorTransform(1, 1, 1, (1 - _arg4));
if (_arg5){
_local7.a = -1;
_local7.tx = (_arg2 + 54);
_arg1.draw(imgDuck, _local7, null, null, null, true);
_local7.tx = (44 + _arg2);
_local7.ty = (5 + _arg3);
_arg1.draw(imgEye1, _local7, _local8, null, null, true);
_local8.alphaMultiplier = _arg4;
_arg1.draw(imgEye2, _local7, _local8, null, null, true);
_local7.tx = 3;
_local7.ty = -7;
_local7.rotate(-(_arg6));
_local7.translate((21 + _arg2), (26 + _arg3));
_arg1.draw(imgWing, _local7, null, null, null, true);
} else {
_arg1.draw(imgDuck, _local7, null, null, null, true);
_local7.tx = (10 + _arg2);
_local7.ty = (5 + _arg3);
_arg1.draw(imgEye1, _local7, _local8, null, null, true);
_local8.alphaMultiplier = _arg4;
_arg1.draw(imgEye2, _local7, _local8, null, null, true);
_local7.tx = -3;
_local7.ty = -7;
_local7.rotate(_arg6);
_local7.translate((33 + _arg2), (26 + _arg3));
_arg1.draw(imgWing, _local7, null, null, null, true);
};
}
public function playJump():void{
sndJump.play(49, 0, transformPan);
}
public function playLand():void{
sndLand.play(49, 0, transformPan);
}
private function initGFX():void{
imgEye1 = new rEyeImg1().bitmapData;
imgEye2 = new rEyeImg2().bitmapData;
imgWing = new rWingImg().bitmapData;
imgDuck = new rDuckImg().bitmapData;
imgSleep = new rSleepImg().bitmapData;
}
public function playWing():void{
var _local1:Sound;
if (trigWing){
_local1 = sndWing1;
} else {
_local1 = sndWing2;
};
trigWing = !(trigWing);
_local1.play(49, 0, transformPanVol);
}
private function initSFX():void{
sndStep1 = new rStepSnd1();
sndStep2 = new rStepSnd2();
sndWing1 = new rWingSnd1();
sndWing2 = new rWingSnd2();
sndJump = new rJumpSnd();
sndLand = new rLandSnd();
sndAwake = new rAwakeSnd();
sndSleep = new rSleepSnd();
sndAttack = new rAttackSnd();
sndToxic = new rToxicSnd();
transformPan = new SoundTransform();
transformPanVol = new SoundTransform();
}
public function drawSleep(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Boolean):void{
var _local5:Matrix = new Matrix(1, 0, 0, 1, _arg2, _arg3);
if (_arg4){
_local5.a = -1;
_local5.tx = (_arg2 + 54);
};
_arg1.draw(imgSleep, _local5, null, null, null, true);
}
}
}//package
Section 118
//HeroMedia_rAttackSnd (HeroMedia_rAttackSnd)
package {
import mx.core.*;
public class HeroMedia_rAttackSnd extends SoundAsset {
}
}//package
Section 119
//HeroMedia_rAwakeSnd (HeroMedia_rAwakeSnd)
package {
import mx.core.*;
public class HeroMedia_rAwakeSnd extends SoundAsset {
}
}//package
Section 120
//HeroMedia_rDuckImg (HeroMedia_rDuckImg)
package {
import mx.core.*;
public class HeroMedia_rDuckImg extends BitmapAsset {
}
}//package
Section 121
//HeroMedia_rEyeImg1 (HeroMedia_rEyeImg1)
package {
import mx.core.*;
public class HeroMedia_rEyeImg1 extends BitmapAsset {
}
}//package
Section 122
//HeroMedia_rEyeImg2 (HeroMedia_rEyeImg2)
package {
import mx.core.*;
public class HeroMedia_rEyeImg2 extends BitmapAsset {
}
}//package
Section 123
//HeroMedia_rJumpSnd (HeroMedia_rJumpSnd)
package {
import mx.core.*;
public class HeroMedia_rJumpSnd extends SoundAsset {
}
}//package
Section 124
//HeroMedia_rLandSnd (HeroMedia_rLandSnd)
package {
import mx.core.*;
public class HeroMedia_rLandSnd extends SoundAsset {
}
}//package
Section 125
//HeroMedia_rSleepImg (HeroMedia_rSleepImg)
package {
import mx.core.*;
public class HeroMedia_rSleepImg extends BitmapAsset {
}
}//package
Section 126
//HeroMedia_rSleepSnd (HeroMedia_rSleepSnd)
package {
import mx.core.*;
public class HeroMedia_rSleepSnd extends SoundAsset {
}
}//package
Section 127
//HeroMedia_rStepSnd1 (HeroMedia_rStepSnd1)
package {
import mx.core.*;
public class HeroMedia_rStepSnd1 extends SoundAsset {
}
}//package
Section 128
//HeroMedia_rStepSnd2 (HeroMedia_rStepSnd2)
package {
import mx.core.*;
public class HeroMedia_rStepSnd2 extends SoundAsset {
}
}//package
Section 129
//HeroMedia_rToxicSnd (HeroMedia_rToxicSnd)
package {
import mx.core.*;
public class HeroMedia_rToxicSnd extends SoundAsset {
}
}//package
Section 130
//HeroMedia_rWingImg (HeroMedia_rWingImg)
package {
import mx.core.*;
public class HeroMedia_rWingImg extends BitmapAsset {
}
}//package
Section 131
//HeroMedia_rWingSnd1 (HeroMedia_rWingSnd1)
package {
import mx.core.*;
public class HeroMedia_rWingSnd1 extends SoundAsset {
}
}//package
Section 132
//HeroMedia_rWingSnd2 (HeroMedia_rWingSnd2)
package {
import mx.core.*;
public class HeroMedia_rWingSnd2 extends SoundAsset {
}
}//package
Section 133
//Level (Level)
package {
import flash.display.*;
import ui.*;
import ek.sui.*;
import flash.geom.*;
import lev.fx.*;
import flash.text.*;
import flash.filters.*;
import flash.media.*;
import lev.*;
public class Level {
private const HARVEST_TEXT:String = "HARVESTING";
private const NEXT_LEVEL_TEXT_BEGIN:String = "WARP IN ";
private const NEXT_LEVEL_TEXT_END:String = " SEC...";
private var ps:Particles;
public var power:Number;
private var scoreCounter:Number;
public var levelMenu:LevelMenu;
public var progress:LevelProgress;
private var scoreOld:int;
private var rStartSnd:Class;
public var gui:SUISystem;
private var stages:Array;
private var hpText:TextField;
private var rScoreImg:Class;
public var pills:Pills;
private var nextLevelCounter:Number;
private var hpPulse:Number;
public var sndStart:Sound;
private var powerUp:Number;
public var imgHP1:BitmapData;
private var imgHP2:BitmapData;
public var imgHP3:BitmapData;
public var stageMedia:StageMedia;
private var imgScore:BitmapData;
public var state:GameState;
public var finish:Boolean;
public var upgradeMenu:UpgradeMenu;
public var info:GameInfo;
private var harvestProcess:int;
public var stagesCount:int;
private var hpCounter:Number;
private var scoreText:TextField;
private var nextLevelCountdown:int;
private var rHPImg1:Class;
private var finishCounter:Number;
private var rHPImg3:Class;
public var env:Env;
private var rHPImg2:Class;
public var game:Game;
public var imgPause:BitmapData;
public var pause:Boolean;
public var hero:Hero;
public var infoText:TextField;
public var stage:LevelStage;
public static var instance:Level;
public function Level(_arg1:GameState){
var _local4:*;
rHPImg1 = Level_rHPImg1;
rHPImg2 = Level_rHPImg2;
rHPImg3 = Level_rHPImg3;
rScoreImg = Level_rScoreImg;
rStartSnd = Level_rStartSnd;
super();
var _local2:TextFormat = new TextFormat("_default", 28, 4294967295);
var _local3:DropShadowFilter = new DropShadowFilter(0, 0, 0, 1, 4, 4, 4, 1);
instance = this;
state = _arg1;
info = new GameInfo();
ps = new Particles();
env = new Env();
hero = new Hero();
pills = new Pills(hero, ps, this);
progress = new LevelProgress();
hero.particles = ps;
hero.state = state;
hero.env = env;
progress.env = env;
hero.init();
stageMedia = new StageMedia();
stages = new Array();
stages.push([Harvesting, null]);
stages.push([PartyTime, [30, 0]]);
stages.push([Bubbles, [0.05, 0]]);
stages.push([DoubleFrog, null]);
stages.push([PartyTime, [60, 1]]);
stages.push([BetweenCatsStage, null]);
stages.push([Bubbles, [0.04, 1]]);
stages.push([AirAttack, null]);
stages.push([PartyTime, [120, 2]]);
stages.push([Trains, null]);
stages.push([Bubbles, [0.03, 2]]);
stagesCount = stages.length;
stage = null;
finish = false;
imgHP1 = new rHPImg1().bitmapData;
imgHP2 = new rHPImg2().bitmapData;
imgHP3 = new rHPImg3().bitmapData;
imgScore = new rScoreImg().bitmapData;
sndStart = new rStartSnd();
hpCounter = 0;
hpPulse = 0;
hpText = new TextField();
hpText.defaultTextFormat = _local2;
hpText.embedFonts = true;
hpText.cacheAsBitmap = true;
hpText.autoSize = TextFieldAutoSize.LEFT;
hpText.filters = [_local3];
scoreText = new TextField();
scoreText.defaultTextFormat = _local2;
scoreText.embedFonts = true;
scoreText.cacheAsBitmap = true;
scoreText.autoSize = TextFieldAutoSize.LEFT;
scoreText.filters = [_local3];
infoText = new TextField();
infoText.defaultTextFormat = _local2;
infoText.embedFonts = true;
infoText.cacheAsBitmap = true;
infoText.autoSize = TextFieldAutoSize.LEFT;
infoText.filters = [_local3];
scoreOld = 0;
scoreCounter = 0;
game = Game.instance;
imgPause = game.imgBG;
}
private function winLevel():void{
pills.finish();
nextLevelCountdown = 3;
harvestProcess = 2;
infoText.text = (HARVEST_TEXT + "...");
nextLevelCounter = 0;
finish = true;
env.blanc = 1;
levelMenu.setState(1);
}
public function resetPower(_arg1:Number=0):void{
power = (powerUp = _arg1);
}
public function draw(_arg1:BitmapData):void{
if (pause){
_arg1.draw(imgPause);
} else {
env.draw1(_arg1);
stage.draw1(_arg1);
info.drawFT(_arg1);
pills.draw(_arg1);
if (state.health > 0){
hero.draw(_arg1);
};
ps.draw(_arg1);
env.draw2(_arg1);
progress.draw(_arg1);
drawUI(_arg1);
stage.draw2(_arg1);
};
}
public function nextLevel():void{
if (state.level >= (stagesCount - 1)){
game.goCredits();
game.submitHighScores();
} else {
state.level++;
start();
};
}
public function keyUp(_arg1:uint):void{
if (!pause){
hero.keyUp(_arg1);
};
}
public function start():void{
var _local1:Class = stages[state.level][0];
var _local2:Array = stages[state.level][1];
env.blanc = 1;
power = 0;
powerUp = 0;
if (_local2 != null){
stage = new _local1(_local2);
} else {
stage = new (_local1);
};
ps.clear();
pills.clear();
info.reset();
progress.start(stage.goalTime);
hero.init();
game.save();
finish = false;
pause = false;
state.health = state.maxHP;
syncScores();
enterLevel();
}
public function switchEvnPower():void{
if (power >= 0.5){
powerUp = (power = 0.49);
} else {
powerUp = (power = 0.5);
};
}
private function updateHarvesting(_arg1:Number):void{
var _local3:int;
var _local2 = "";
pills.harvest(_arg1);
if (pills.harvestCount > 0){
nextLevelCounter = (nextLevelCounter + _arg1);
if (nextLevelCounter >= 1){
nextLevelCounter--;
harvestProcess++;
if (harvestProcess > 2){
harvestProcess = 0;
};
_local3 = harvestProcess;
while (_local3 > 0) {
_local2 = (_local2 + ".");
_local3--;
};
infoText.text = (HARVEST_TEXT + _local2);
};
} else {
nextLevelCounter = 0;
infoText.text = ((NEXT_LEVEL_TEXT_BEGIN + nextLevelCountdown.toString()) + NEXT_LEVEL_TEXT_END);
};
}
public function closeUpgradeMenu():void{
if (pause){
levelMenu.go(gui);
setPause(false);
};
}
public function gainSleep():void{
powerUp = 0;
}
public function goUpgradeMenu():void{
if (!pause){
upgradeMenu.go();
setPause(true);
};
}
public function syncScores():void{
scoreOld = state.scores;
scoreText.text = scoreOld.toString();
}
public function keyDown(_arg1:uint):void{
if (pause){
if (_arg1 == 27){
if (gui.current == game.mainMenu){
game.clickNewGame();
} else {
if (gui.current == upgradeMenu){
closeUpgradeMenu();
};
};
} else {
if ((((((_arg1 == 13)) && ((gui.current == upgradeMenu)))) && (upgradeMenu.btnBuy.enabled))){
upgradeMenu.buy();
};
};
} else {
if (finish){
if (state.health > 0){
hero.keyDown(_arg1);
} else {
if (_arg1 == 13){
game.startLevel();
} else {
if (_arg1 == 27){
game.goPause();
} else {
if ((((_arg1 == 32)) && (levelMenu.btnSubmit.enabled))){
levelMenu.submit();
};
};
};
};
} else {
hero.keyDown(_arg1);
if (_arg1 == 27){
game.goPause();
} else {
if (_arg1 == 13){
goUpgradeMenu();
};
};
};
};
}
public function enterLevel():void{
gui.setCurrent(levelMenu);
levelMenu.setState(0);
env.blanc = 1;
stage.start();
sndStart.play();
}
public function initShopMenu(_arg1:UpgradeMenu):void{
upgradeMenu = _arg1;
upgradeMenu.pillsMedia = pills.media;
upgradeMenu.gameInfo = info;
}
public function setPause(_arg1:Boolean):void{
if (_arg1){
draw(imgPause);
imgPause.applyFilter(imgPause, new Rectangle(0, 0, 640, 480), new Point(), new BlurFilter(16, 16, 2));
pause = true;
hero.keysReset();
} else {
pause = false;
};
env.blanc = 1;
}
public function update(_arg1:Number):void{
var _local3:int;
var _local2:Number = 0;
if (!pause){
if (stage != null){
stage.update(_arg1);
if (((stage.win) && (!(finish)))){
winLevel();
};
};
if (state.health <= 0){
if (!finish){
finish = true;
state.health = 0;
env.blanc = 1;
progress.play = false;
levelMenu.setState(2);
};
} else {
if (finish){
if (pills.harvestCount > 0){
updateHarvesting(_arg1);
} else {
if (nextLevelCountdown > 0){
nextLevelCounter = (nextLevelCounter + _arg1);
if (nextLevelCounter > 1){
nextLevelCounter--;
nextLevelCountdown--;
infoText.text = ((NEXT_LEVEL_TEXT_BEGIN + nextLevelCountdown.toString()) + NEXT_LEVEL_TEXT_END);
};
} else {
nextLevel();
};
};
};
};
if (hero.sleep){
_local2 = 0.3;
};
if (powerUp < power){
power = (power - (_arg1 * _local2));
if (power < 0){
power = 0;
};
} else {
power = (power + (_arg1 * 0.05));
if (power > powerUp){
power = powerUp;
};
};
if (state.health > 0){
hero.update(_arg1, power);
};
pills.update(_arg1, power);
env.x = hero.x;
env.y = hero.y;
env.update(_arg1, power);
progress.update(_arg1, power);
ps.update(_arg1);
if (hpPulse > 0){
hpPulse = (hpPulse - (4 * _arg1));
if (hpPulse < 0){
hpPulse = 0;
};
};
hpCounter = (hpCounter + (4 * _arg1));
if (power < 0.33){
if (hpCounter > 4){
hpCounter = (hpCounter - 4);
hpPulse = 1;
};
} else {
if (power < 0.66){
if (hpCounter > 2){
hpCounter = (hpCounter - 2);
hpPulse = 1;
};
} else {
if (hpCounter > 1){
hpCounter = (hpCounter - 1);
hpPulse = 1;
};
};
};
if (power >= 0.5){
info.setRGB(env.colors.bg);
} else {
if (env.day){
info.setRGB(0);
} else {
info.setRGB(0xFFFFFF);
};
};
info.update(power, _arg1);
if (state.scores > scoreOld){
scoreCounter = (scoreCounter + (30 * _arg1));
if (scoreCounter > 1){
_local3 = ((state.scores - scoreOld) / 5);
if (_local3 == 0){
scoreOld = state.scores;
scoreCounter = 0;
} else {
scoreOld = (scoreOld + _local3);
scoreCounter = (scoreCounter - int(scoreCounter));
};
scoreText.text = scoreOld.toString();
};
};
};
}
public function drawUI(_arg1:BitmapData):void{
var _local5:String;
var _local2:Matrix = new Matrix(1, 0, 0, 1, -25, -23);
var _local3:ColorTransform = new ColorTransform(1, 1, 1, power);
var _local4:Number = (1 + (0.3 * hpPulse));
_local2.scale(_local4, _local4);
_local2.translate(22, (410 + 18));
_arg1.draw(imgHP1, _local2, null, null, null, true);
_arg1.draw(imgHP2, _local2, _local3, null, null, true);
_arg1.draw(imgHP3, _local2, null, null, null, true);
_local2.identity();
_local2.tx = -24;
_local2.ty = -24;
_local4 = (1 + (0.3 * scoreCounter));
_local2.scale(_local4, _local4);
_local2.translate(620, (410 + 18));
_arg1.draw(imgScore, _local2, null, null, null, true);
_local2.identity();
_local2.tx = 40;
_local2.ty = 410;
_local5 = ((state.health.toString() + "/") + state.maxHP.toString());
if (hpText.text != _local5){
hpText.text = _local5;
};
_arg1.draw(hpText, _local2);
_local2.tx = (600 - scoreText.textWidth);
_arg1.draw(scoreText, _local2);
}
public function gainPower(_arg1:Number):void{
powerUp = (powerUp + _arg1);
if (powerUp > 1){
powerUp = 1;
};
}
}
}//package
Section 134
//Level_rHPImg1 (Level_rHPImg1)
package {
import mx.core.*;
public class Level_rHPImg1 extends BitmapAsset {
}
}//package
Section 135
//Level_rHPImg2 (Level_rHPImg2)
package {
import mx.core.*;
public class Level_rHPImg2 extends BitmapAsset {
}
}//package
Section 136
//Level_rHPImg3 (Level_rHPImg3)
package {
import mx.core.*;
public class Level_rHPImg3 extends BitmapAsset {
}
}//package
Section 137
//Level_rScoreImg (Level_rScoreImg)
package {
import mx.core.*;
public class Level_rScoreImg extends BitmapAsset {
}
}//package
Section 138
//Level_rStartSnd (Level_rStartSnd)
package {
import mx.core.*;
public class Level_rStartSnd extends SoundAsset {
}
}//package
Section 139
//LevelProgress (LevelProgress)
package {
import flash.display.*;
import flash.geom.*;
public class LevelProgress {
private var ld2:Array;
private var power:Number;
public var imgPoint:BitmapData;
public var full:Boolean;
private var line_c:Number;
private var shape:Shape;
private var rPointImg:Class;
public var perc:Number;
private var progress:Number;
public var env:Env;
private var progressMax:Number;
private var ld1:Array;
public var play:Boolean;
private var line1:Array;
private var line2:Array;
public function LevelProgress(){
rPointImg = LevelProgress_rPointImg;
super();
ld1 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
ld2 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
line1 = [0, 0, 0, 0, 0, 0, 0];
line2 = [0, 0, 0, 0, 0, 0, 0];
line_c = 0;
shape = new Shape();
imgPoint = new rPointImg().bitmapData;
end();
}
public function draw(_arg1:BitmapData):void{
var _local2:Number;
var _local3:int;
var _local4:Number;
var _local6:Number;
var _local11:Number;
var _local5:Matrix = new Matrix();
var _local7:ColorTransform = env.ctProgress;
var _local8:ColorTransform = new ColorTransform();
var _local9:ColorTransform = new ColorTransform();
var _local10:Number = (progress / progressMax);
_local5.identity();
_local5.translate(0, 400);
shape.graphics.clear();
shape.graphics.beginFill(env.colProgress, 1);
shape.graphics.moveTo(0, ld1[0]);
_local2 = 32;
_local3 = 1;
while (_local3 < 21) {
shape.graphics.lineTo(_local2, ld1[_local3]);
_local2 = (_local2 + 32);
_local3++;
};
_local2 = 640;
_local3 = 20;
while (_local3 >= 0) {
shape.graphics.lineTo(_local2, ld2[_local3]);
_local2 = (_local2 - 32);
_local3--;
};
shape.graphics.endFill();
_arg1.draw(shape, _local5);
if (play){
_local2 = 22;
_local3 = 1;
while (_local3 < 20) {
_local11 = ld1[_local3];
_local6 = ((390 + _local11) + (0.5 * (ld2[_local3] - _local11)));
_local5.identity();
_local5.translate(_local2, _local6);
if (_local10 > 0.05263){
_local9 = _local8;
} else {
if (_local10 <= 0){
_local9 = _local7;
} else {
_local4 = (_local10 * 19);
_local9.redMultiplier = ((_local7.redMultiplier * (1 - _local4)) + _local4);
_local9.greenMultiplier = ((_local7.greenMultiplier * (1 - _local4)) + _local4);
_local9.blueMultiplier = ((_local7.blueMultiplier * (1 - _local4)) + _local4);
};
};
_arg1.draw(imgPoint, _local5, _local9, null, null, true);
_local2 = (_local2 + 32);
_local10 = (_local10 - 0.05263);
_local3++;
};
};
}
public function update(_arg1:Number, _arg2:Number):void{
var _local3:Number;
var _local4:Number;
var _local5:int;
var _local6:Number;
var _local7:*;
power = _arg2;
line_c = (line_c + (((_arg1 * 1.57) * power) * power));
if (line_c > 1){
line_c = (line_c - int(line_c));
};
_local5 = 0;
while (_local5 < 7) {
_local6 = (line_c * 6.2832);
_local3 = (40 + (17 * Math.sin((_local6 + (1.5708 * (_local5 - 2))))));
_local4 = (12.5 + (2.5 * Math.sin((_local6 + (3.1416 * (_local5 - 2))))));
line1[_local5] = (_local3 - _local4);
line2[_local5] = (_local3 + _local4);
_local5++;
};
calcLines();
}
public function updateProgress(_arg1:Number):void{
if (play){
if (!full){
progress = _arg1;
perc = (progress / progressMax);
if (progress >= progressMax){
progress = progressMax;
perc = 1;
full = true;
};
};
};
}
public function end():void{
perc = 0;
progress = 0;
progressMax = 0;
play = false;
full = false;
}
public function start(_arg1:Number):void{
progress = 0;
progressMax = _arg1;
play = true;
full = false;
}
public function calcLines():void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local1:int;
var _local2:int;
while (_local1 < 5) {
_local3 = line1[_local1];
_local4 = line1[(_local1 + 1)];
_local5 = line1[(_local1 + 2)];
_local6 = line1[(_local1 + 3)];
_local7 = line2[_local1];
_local8 = line2[(_local1 + 1)];
_local9 = line2[(_local1 + 2)];
_local10 = line2[(_local1 + 3)];
ld1[_local2] = _local4;
ld2[_local2] = _local8;
_local2++;
_local15 = 0.2;
while (_local15 < 1) {
_local16 = (_local15 * _local15);
_local11 = (((_local6 - _local5) - _local3) + _local4);
_local12 = ((_local3 - _local4) - _local11);
_local13 = (_local5 - _local3);
_local14 = _local4;
ld1[_local2] = (((((_local11 * _local16) * _local15) + (_local12 * _local16)) + (_local13 * _local15)) + _local14);
_local11 = (((_local10 - _local9) - _local7) + _local8);
_local12 = ((_local7 - _local8) - _local11);
_local13 = (_local9 - _local7);
_local14 = _local8;
ld2[_local2] = (((((_local11 * _local16) * _local15) + (_local12 * _local16)) + (_local13 * _local15)) + _local14);
_local2++;
_local15 = (_local15 + 0.2);
};
_local1++;
};
ld1[20] = line1[5];
ld2[20] = line2[5];
}
}
}//package
Section 140
//LevelProgress_rPointImg (LevelProgress_rPointImg)
package {
import mx.core.*;
public class LevelProgress_rPointImg extends BitmapAsset {
}
}//package
Section 141
//Particle (Particle)
package {
import flash.display.*;
import flash.geom.*;
public class Particle {
public var col:ColorTransform;
public var p1:Number;
public var vx:Number;
public var vy:Number;
public var px:Number;
public var img:BitmapData;
public var py:Number;
public var p2:Number;
public var alpha:Number;
public var a:Number;
public var va:Number;
public var s:Number;
public var t:Number;
public var x:Number;
public var y:Number;
public var type:int;
public function Particle(){
t = 0;
col = new ColorTransform();
}
}
}//package
Section 142
//Particles (Particles)
package {
import flash.display.*;
import flash.geom.*;
public class Particles {
public const BUBBLE:int = 1;
public const RING:int = 4;
public const poolSize:int = 100;
public const ACID:int = 0;
public const STAR:int = 3;
private const mat:Matrix;
public const WARNING:int = 2;
private var rFXOutImg:Class;
private var rFXInImg:Class;
public var imgFXWarning:BitmapData;
private var pool:Array;
private var rFXStarImg:Class;
public var imgFXAcid:BitmapData;
public var imgFXOut:BitmapData;
private var rFXBubbleImg:Class;
public var imgFXBubble:BitmapData;
public var imgFXStar:BitmapData;
public var imgFXStar2:BitmapData;
public var imgFXIn:BitmapData;
private var rFXAcidImg:Class;
private var rFXWarningImg:Class;
private var rFXStar2Img:Class;
private var parts:int;
public function Particles(){
var _local1:int;
rFXAcidImg = Particles_rFXAcidImg;
rFXBubbleImg = Particles_rFXBubbleImg;
rFXWarningImg = Particles_rFXWarningImg;
rFXStarImg = Particles_rFXStarImg;
rFXStar2Img = Particles_rFXStar2Img;
rFXOutImg = Particles_rFXOutImg;
rFXInImg = Particles_rFXInImg;
mat = new Matrix();
super();
pool = new Array(poolSize);
while (_local1 < poolSize) {
pool[_local1] = new Particle();
_local1++;
};
imgFXAcid = new rFXAcidImg().bitmapData;
imgFXBubble = new rFXBubbleImg().bitmapData;
imgFXWarning = new rFXWarningImg().bitmapData;
imgFXStar = new rFXStarImg().bitmapData;
imgFXStar2 = new rFXStar2Img().bitmapData;
imgFXOut = new rFXOutImg().bitmapData;
imgFXIn = new rFXInImg().bitmapData;
}
public function startStarPower(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:int):void{
var _local6:Particle;
var _local7:uint;
var _local8:uint;
switch (_arg5){
case 0:
_local7 = 4292214269;
_local8 = 4278239487;
break;
case 1:
_local7 = 4294967040;
_local8 = 4294934272;
break;
case 2:
_local7 = 4294879225;
_local8 = 4294901868;
break;
};
_local6 = findDead();
if (_local6 != null){
_local6.t = (0.2 + (Math.random() * 0.5));
_local6.vx = _arg3;
_local6.vy = _arg4;
_local6.x = _arg1;
_local6.y = _arg2;
_local6.type = STAR;
setCT(_local6.col, utils.lerpColor(_local7, _local8, Math.random()));
_local6.alpha = _local6.col.alphaMultiplier;
_local6.px = -7;
_local6.py = -7;
_local6.s = 1;
_local6.a = (Math.random() * 3.14);
_local6.img = imgFXStar;
parts++;
};
}
public function startStepBubble(_arg1:Number, _arg2:Number):void{
var _local3:Particle;
_local3 = findDead();
if (_local3 != null){
_local3.p1 = Math.random();
_local3.p2 = (0.5 + Math.random());
_local3.t = (0.5 + Math.random());
_local3.vx = (-10 + (Math.random() * 20));
_local3.vy = (-(Math.random()) * 100);
_local3.col.alphaMultiplier = 1;
_local3.col.redMultiplier = 0.5;
_local3.col.greenMultiplier = (0.2 + (0.1 * Math.random()));
_local3.col.blueMultiplier = 0;
_local3.alpha = _local3.col.alphaMultiplier;
_local3.x = _arg1;
_local3.y = _arg2;
_local3.px = -4;
_local3.py = -4;
_local3.s = 1;
_local3.a = 0;
_local3.img = imgFXBubble;
_local3.type = BUBBLE;
parts++;
};
}
public function startBubble(_arg1:Number, _arg2:Number, _arg3:uint):void{
var _local4:Particle;
_local4 = findDead();
if (_local4 != null){
_local4.p1 = Math.random();
_local4.p2 = (0.5 + Math.random());
_local4.t = (0.5 + Math.random());
_local4.vx = (-10 + (Math.random() * 20));
_local4.vy = (-(Math.random()) * 100);
setCT(_local4.col, _arg3);
_local4.alpha = _local4.col.alphaMultiplier;
_local4.x = _arg1;
_local4.y = _arg2;
_local4.px = -4;
_local4.py = -4;
_local4.s = 1;
_local4.a = 0;
_local4.img = imgFXBubble;
_local4.type = BUBBLE;
parts++;
};
}
public function explStarsToxic(_arg1:Number, _arg2:Number, _arg3:int, _arg4:Boolean):void{
var _local7:Number;
var _local8:Particle;
var _local9:uint;
var _local10:uint;
var _local11:Boolean;
var _local5 = 10;
var _local6:Number = (Math.random() * 6.28);
if (_arg4){
_local5 = 30;
};
switch (_arg3){
case 0:
_local9 = 4278190080;
_local10 = 4294967295;
break;
case 1:
_local9 = 4294967040;
_local10 = 4294934272;
break;
};
while (_local5 > 0) {
_local8 = findDead();
if (_local8 != null){
_local7 = (10 + (Math.random() * 90));
_local8.t = (0.2 + (Math.random() * 0.5));
if (_arg4){
_local7 = (_local7 * 3);
};
_local8.vx = (Math.cos(_local6) * _local7);
_local8.vy = (Math.sin(_local6) * _local7);
_local8.x = _arg1;
_local8.y = _arg2;
_local8.type = STAR;
if (_local11){
setCT(_local8.col, _local9);
} else {
setCT(_local8.col, _local10);
};
_local8.alpha = _local8.col.alphaMultiplier;
_local8.px = -7;
_local8.py = -7;
_local8.s = 1;
_local8.a = (Math.random() * 3.14);
_local8.img = imgFXStar;
_local11 = !(_local11);
_local6 = (_local6 + (1 + (Math.random() * 0.5)));
parts++;
} else {
break;
};
_local5--;
};
}
public function startAcid(_arg1:Number, _arg2:Number, _arg3:uint=4278190080):void{
var _local6:Number;
var _local7:Particle;
var _local4 = 5;
var _local5:Number = (Math.random() * 6.28);
while (_local4 > 0) {
_local7 = findDead();
if (_local7 != null){
_local6 = (10 + (Math.random() * 190));
_local7.t = (0.2 + (Math.random() * 0.5));
_local7.vx = Math.cos(_local5);
_local7.vy = Math.sin(_local5);
_local7.x = ((9 * _local7.vx) + _arg1);
_local7.y = ((9 * _local7.vy) + _arg2);
_local7.vx = (_local7.vx * _local6);
_local7.vy = (_local7.vy * _local6);
_local7.type = ACID;
setCT(_local7.col, _arg3);
_local7.alpha = _local7.col.alphaMultiplier;
_local7.px = -3;
_local7.py = -7;
_local7.s = 1;
_local7.a = (Math.atan2(_local7.vy, _local7.vx) - 1.57);
_local7.img = imgFXAcid;
_local5 = (_local5 + (1 + (Math.random() * 0.5)));
parts++;
} else {
break;
};
_local4--;
};
}
public function startStarToxic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:int):void{
var _local6:Particle;
var _local7:uint;
var _local8:uint;
_local6 = findDead();
if (_local6 != null){
switch (_arg5){
case 0:
_local7 = 4278190080;
_local8 = 4294967295;
break;
case 1:
_local7 = 4294967040;
_local8 = 4294934272;
break;
};
_local6.t = (0.2 + (Math.random() * 0.5));
_local6.vx = _arg3;
_local6.vy = _arg4;
_local6.x = _arg1;
_local6.y = _arg2;
_local6.type = STAR;
if (Math.random() >= 0.5){
setCT(_local6.col, _local7);
} else {
setCT(_local6.col, _local8);
};
_local6.alpha = _local6.col.alphaMultiplier;
_local6.px = -7;
_local6.py = -7;
_local6.s = 1;
_local6.a = (Math.random() * 3.14);
_local6.img = imgFXStar;
parts++;
};
}
public function explStarsSleep(_arg1:Number, _arg2:Number):void{
var _local5:Number;
var _local6:Particle;
var _local9:Boolean;
var _local3 = 10;
var _local4:Number = (Math.random() * 6.28);
var _local7:uint = 4281206392;
var _local8:uint = 4289750735;
while (_local3 > 0) {
_local6 = findDead();
if (_local6 != null){
_local5 = (10 + (Math.random() * 90));
_local6.t = (0.2 + (Math.random() * 0.5));
_local6.vx = (Math.cos(_local4) * _local5);
_local6.vy = (Math.sin(_local4) * _local5);
_local6.x = _arg1;
_local6.y = _arg2;
_local6.type = STAR;
if (_local9){
setCT(_local6.col, _local7);
} else {
setCT(_local6.col, _local8);
};
_local6.alpha = _local6.col.alphaMultiplier;
_local6.px = -7;
_local6.py = -7;
_local6.s = 1;
_local6.a = (Math.random() * 3.14);
_local6.img = imgFXStar;
_local9 = !(_local9);
_local4 = (_local4 + (1 + (Math.random() * 0.5)));
parts++;
} else {
break;
};
_local3--;
};
}
public function update(_arg1:Number):void{
var _local4:Particle;
var _local2:int;
var _local3:int = parts;
for each (_local4 in pool) {
if (_local2 == _local3){
break;
};
if (_local4.t > 0){
switch (_local4.type){
case STAR:
_local4.a = (_local4.a + (1.5708 * _arg1));
_local4.vy = (_local4.vy + (200 * _arg1));
_local4.x = (_local4.x + (_local4.vx * _arg1));
_local4.y = (_local4.y + (_local4.vy * _arg1));
if ((_local4.y + 3) > 400){
_local4.y = 397;
_local4.vy = (-0.5 * _local4.vy);
_local4.vx = (0.7 * _local4.vx);
};
if (_local4.t < 0.5){
_local4.s = (_local4.t * 2);
_local4.col.alphaMultiplier = (_local4.alpha * _local4.s);
};
break;
case ACID:
_local4.vy = (_local4.vy + (200 * _arg1));
_local4.x = (_local4.x + (_local4.vx * _arg1));
_local4.y = (_local4.y + (_local4.vy * _arg1));
if ((_local4.y + 3) > 400){
_local4.y = 397;
_local4.vy = (-0.5 * _local4.vy);
_local4.vx = (0.7 * _local4.vx);
};
if (_local4.t < 0.5){
_local4.s = (_local4.t * 2);
_local4.col.alphaMultiplier = (_local4.alpha * _local4.s);
};
_local4.a = (Math.atan2(_local4.vy, _local4.vx) - 1.57);
break;
case BUBBLE:
_local4.vy = (_local4.vy - (100 * _arg1));
_local4.vx = (_local4.vx + ((200 * Math.sin(((_local4.p1 + _local4.t) * 6.2831))) * _arg1));
_local4.x = (_local4.x + (_local4.vx * _arg1));
_local4.y = (_local4.y + (_local4.vy * _arg1));
if (_local4.x >= 644){
_local4.x = (_local4.x - 643);
};
if (_local4.y <= -4){
_local4.y = (_local4.y + 647);
};
if (_local4.t < 1){
_local4.s = _local4.t;
};
break;
case WARNING:
_local4.a = ((8 * 3.14) * (_local4.p1 - _local4.t));
_local4.s = Math.cos(((3.14 * 0.5) * (1 - (_local4.t / _local4.p1))));
_local4.col.alphaMultiplier = (_local4.alpha * _local4.s);
break;
case RING:
if (_local4.p2 > 0){
_local4.s = (_local4.p2 * (1 - (_local4.t / _local4.p1)));
} else {
_local4.s = ((-(_local4.p2) * _local4.t) / _local4.p1);
};
_local4.col.alphaMultiplier = (_local4.alpha * Math.sin(((3.14 * _local4.t) / _local4.p1)));
break;
};
_local4.t = (_local4.t - _arg1);
if (_local4.t <= 0){
parts--;
};
_local2++;
};
};
}
public function startRing(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:uint):void{
var _local7:Particle;
_local7 = findDead();
if (_local7 != null){
_local7.p1 = _arg4;
_local7.p2 = _arg3;
_local7.t = _arg5;
setCT(_local7.col, _arg6);
_local7.alpha = _local7.col.alphaMultiplier;
_local7.x = _arg1;
_local7.y = _arg2;
_local7.px = -32;
_local7.py = -32;
_local7.s = 0;
_local7.a = 0;
if (_arg3 > 0){
_local7.img = imgFXOut;
} else {
_local7.img = imgFXIn;
};
_local7.type = RING;
parts++;
};
}
public function clear():void{
var _local1:Particle;
for each (_local1 in pool) {
_local1.t = 0;
};
parts = 0;
}
public function draw(_arg1:BitmapData):void{
var _local3:Number;
var _local4:Number;
var _local5:Particle;
var _local2:int;
for each (_local5 in pool) {
if (_local2 == parts){
break;
};
if (_local5.t > 0){
_local3 = _local5.a;
_local4 = _local5.s;
mat.identity();
mat.tx = _local5.px;
mat.ty = _local5.py;
if (_local3 != 0){
mat.rotate(_local3);
};
mat.scale(_local4, _local4);
mat.translate(_local5.x, _local5.y);
_arg1.draw(_local5.img, mat, _local5.col, null, null, true);
_local2++;
};
};
}
private function findDead():Particle{
var _local1:Particle;
for each (_local1 in pool) {
if (_local1.t <= 0){
return (_local1);
};
};
return (null);
}
public function startWarning(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):void{
var _local7:Particle;
_local7 = findDead();
if (_local7 != null){
_local7.p1 = _arg3;
_local7.t = _arg3;
_local7.col.alphaMultiplier = 1;
_local7.col.redMultiplier = _arg4;
_local7.col.greenMultiplier = _arg5;
_local7.col.blueMultiplier = _arg6;
_local7.alpha = 1;
_local7.x = _arg1;
_local7.y = _arg2;
_local7.px = -15;
_local7.py = -13;
_local7.s = 0;
_local7.a = 0;
_local7.img = imgFXWarning;
_local7.type = WARNING;
parts++;
};
}
public function explStarsPower(_arg1:Number, _arg2:Number, _arg3:int):void{
var _local6:Number;
var _local7:Particle;
var _local8:uint;
var _local9:uint;
var _local4 = 10;
var _local5:Number = (Math.random() * 6.28);
switch (_arg3){
case 0:
_local8 = 4292214269;
_local9 = 4278239487;
break;
case 1:
_local8 = 4294967040;
_local9 = 4294934272;
break;
case 2:
_local8 = 4294879225;
_local9 = 4294901868;
break;
};
while (_local4 > 0) {
_local7 = findDead();
if (_local7 != null){
_local6 = (10 + (Math.random() * 90));
_local7.t = (0.2 + (Math.random() * 0.5));
_local7.vx = (Math.cos(_local5) * _local6);
_local7.vy = (Math.sin(_local5) * _local6);
_local7.x = _arg1;
_local7.y = _arg2;
_local7.type = STAR;
setCT(_local7.col, utils.lerpColor(_local8, _local9, Math.random()));
_local7.alpha = _local7.col.alphaMultiplier;
_local7.px = -7;
_local7.py = -7;
_local7.s = 1;
_local7.a = (Math.random() * 3.14);
_local7.img = imgFXStar;
_local5 = (_local5 + (1 + (Math.random() * 0.5)));
parts++;
} else {
break;
};
_local4--;
};
}
private function setCT(_arg1:ColorTransform, _arg2:uint):void{
_arg1.alphaMultiplier = (0.0039216 * ((_arg2 >> 24) & 0xFF));
_arg1.redMultiplier = (0.0039216 * ((_arg2 >> 16) & 0xFF));
_arg1.greenMultiplier = (0.0039216 * ((_arg2 >> 8) & 0xFF));
_arg1.blueMultiplier = (0.0039216 * (_arg2 & 0xFF));
}
public function explHeal(_arg1:Number, _arg2:Number):void{
var _local4:Particle;
var _local3 = 10;
while (_local3 > 0) {
_local4 = findDead();
if (_local4 != null){
_local4.p1 = Math.random();
_local4.p2 = (0.5 + Math.random());
_local4.t = (0.5 + Math.random());
_local4.vx = (-10 + (Math.random() * 20));
_local4.vy = (-(Math.random()) * 100);
setCT(_local4.col, 4294901760);
_local4.alpha = _local4.col.alphaMultiplier;
_local4.x = (_arg1 + (Math.random() * 54));
_local4.y = (_arg2 + (Math.random() * 40));
_local4.px = -4;
_local4.py = -4;
_local4.s = 1;
_local4.a = 0;
_local4.img = imgFXBubble;
_local4.type = BUBBLE;
parts++;
} else {
break;
};
_local3--;
};
}
}
}//package
Section 143
//Particles_rFXAcidImg (Particles_rFXAcidImg)
package {
import mx.core.*;
public class Particles_rFXAcidImg extends BitmapAsset {
}
}//package
Section 144
//Particles_rFXBubbleImg (Particles_rFXBubbleImg)
package {
import mx.core.*;
public class Particles_rFXBubbleImg extends BitmapAsset {
}
}//package
Section 145
//Particles_rFXInImg (Particles_rFXInImg)
package {
import mx.core.*;
public class Particles_rFXInImg extends BitmapAsset {
}
}//package
Section 146
//Particles_rFXOutImg (Particles_rFXOutImg)
package {
import mx.core.*;
public class Particles_rFXOutImg extends BitmapAsset {
}
}//package
Section 147
//Particles_rFXStar2Img (Particles_rFXStar2Img)
package {
import mx.core.*;
public class Particles_rFXStar2Img extends BitmapAsset {
}
}//package
Section 148
//Particles_rFXStarImg (Particles_rFXStarImg)
package {
import mx.core.*;
public class Particles_rFXStarImg extends BitmapAsset {
}
}//package
Section 149
//Particles_rFXWarningImg (Particles_rFXWarningImg)
package {
import mx.core.*;
public class Particles_rFXWarningImg extends BitmapAsset {
}
}//package
Section 150
//Pill (Pill)
package {
import flash.display.*;
import flash.geom.*;
public class Pill {
public const TOXIC:int = 1;
public const JUMP:int = 5;
private const RC:Rectangle;
private const MAT:Matrix;
private const COLOR:ColorTransform;
public const HEALTH:int = 3;
private const POINT:Point;
public const SLEEP:int = 2;
public const MATRIX:int = 4;
private const BLACK:ColorTransform;
public const POWER:int = 0;
private var hero:Hero;
private var ps:Particles;
private var imgEmo:BitmapData;
public var power:Number;
private var emoParam:Number;
public var hx:Number;
public var hy:Number;
public var id:int;
private var imgMain:BitmapData;
public var scores:int;
public var hook:Boolean;
public var type:int;
private var emoCounter:Number;
public var t1:Number;
public var t2:Number;
public var enabled:Boolean;
private var imgNid:BitmapData;
private var hookCounter:Number;
public var damage:int;
public var r:Number;
private var emoPause:Number;
public var y:Number;
public var v:Number;
public var x:Number;
private var level:Level;
private var hookTime:Number;
public var state:int;
public var rMax:Number;
public var dx:Number;
private var appear:Number;
public var warning:Number;
private var emoType:int;
public var dy:Number;
public var high:Boolean;
public var parent:Function;
public var spy:Boolean;
public var vx:Number;
public var vy:Number;
public var emo:Boolean;
public var user:Function;
public var move:Boolean;
private var media:PillsMedia;
public var highCounter:Number;
public function Pill(_arg1:PillsMedia, _arg2:Hero, _arg3:Particles, _arg4:Level){
RC = new Rectangle(0, 0, 20, 20);
POINT = new Point(0, 0);
COLOR = new ColorTransform();
BLACK = new ColorTransform(0, 0, 0);
MAT = new Matrix();
super();
media = _arg1;
hero = _arg2;
ps = _arg3;
level = _arg4;
init();
}
private function startEmo(_arg1:int):void{
switch (_arg1){
case 0:
emoParam = (1 + int((Math.random() * 3)));
if (Math.random() < 0.5){
emoParam = -(emoParam);
};
case 1:
case 2:
emoCounter = 3;
break;
};
emoType = _arg1;
}
public function init():void{
state = 0;
move = false;
highCounter = 0;
parent = null;
user = null;
}
private function drawNid(_arg1:BitmapData):void{
MAT.identity();
MAT.tx = -4;
MAT.ty = 2;
MAT.scale(appear, appear);
MAT.translate(dx, dy);
_arg1.draw(media.imgSmile1, MAT, null, null, null, true);
MAT.identity();
MAT.tx = -5;
MAT.ty = -3;
MAT.scale(appear, appear);
MAT.translate((dx + hx), (dy + hy));
_arg1.draw(media.imgEyes1, MAT, null, null, null, true);
}
public function updateSpy():void{
var _local1:Number = ((hero.x - x) + 27);
var _local2:Number = ((hero.y - y) + 20);
var _local3:Number = (1 / Math.sqrt(((_local1 * _local1) + (_local2 * _local2))));
hx = (_local1 * _local3);
hy = (_local2 * _local3);
}
private function setState(_arg1:int):void{
switch (_arg1){
case 0:
if (user != null){
user(this, "dead", 0);
user = null;
};
if (parent != null){
parent(this);
parent = null;
};
move = false;
break;
case 1:
if (user != null){
user(this, "born", 0);
};
appear = 0;
r = 0;
break;
case 2:
appear = 1;
r = rMax;
break;
};
state = _arg1;
}
public function draw(_arg1:BitmapData):void{
if (state != 2){
MAT.identity();
MAT.tx = (MAT.ty = -10);
MAT.scale(appear, appear);
MAT.translate(dx, dy);
_arg1.draw(imgMain, MAT, null, null, null, true);
} else {
POINT.x = (dx - 10);
POINT.y = (dy - 10);
_arg1.copyPixels(imgMain, RC, POINT);
};
}
public function kill():void{
setState(3);
appear = 0.5;
}
public function heroTouch():void{
var _local1:int;
var _local2:GameInfo = level.info;
switch (type){
case POWER:
if (!hero.sleep){
level.gainPower(power);
};
if (level.power >= 0.5){
_local1 = (id + level.state.hell);
level.state.scores = (level.state.scores + level.state.calcHellScores(_local1));
_local2.add(x, y, _local2.powers[_local1]);
level.env.beat();
} else {
_local1 = level.state.norm;
if (_local1 == 0){
level.state.scores++;
_local2.add(x, y, _local2.one);
} else {
_local2.add(x, y, _local2.powers[(_local1 - 1)]);
level.state.scores = (level.state.scores + level.state.calcHellScores((_local1 - 1)));
};
};
utils.playSound(media.sndPowers[id], 1, x);
if (((high) && (hero.doHigh(x, y)))){
media.sndHigh.play();
ps.explStarsPower(x, (y - r), id);
} else {
ps.explStarsPower(x, y, id);
};
level.stage.collected++;
break;
case TOXIC:
_local1 = hero.doToxicDamage(x, y, damage, id);
if (_local1 >= 0){
if (level.power >= 0.5){
if (_local1 == 0){
level.state.scores = (level.state.scores + 100);
} else {
if (_local1 == 1){
level.state.scores = (level.state.scores + 150);
} else {
if (_local1 == 2){
level.state.scores = (level.state.scores + 200);
};
};
};
_local2.add(x, y, _local2.toxics[_local1]);
level.env.beat();
} else {
if (_local1 == 0){
level.state.scores = (level.state.scores + 5);
} else {
if (_local1 == 1){
level.state.scores = (level.state.scores + 10);
} else {
if (_local1 == 2){
level.state.scores = (level.state.scores + 25);
};
};
};
_local2.add(x, y, _local2.powers[_local1]);
};
if (user != null){
user(this, "attack", 0);
};
} else {
_local2.add(x, y, _local2.damages[int((Math.random() * 3))]);
};
break;
case SLEEP:
if (!hero.sleep){
hero.doSleep();
level.gainSleep();
level.env.beat();
};
ps.explStarsSleep(x, y);
_local2.add(x, y, _local2.sleeps[int((Math.random() * 3))]);
break;
case HEALTH:
media.sndHeal.play();
hero.doHeal(5);
level.env.beat();
break;
case MATRIX:
level.switchEvnPower();
level.env.beat();
break;
case JUMP:
if ((((highCounter <= 0)) && (hero.doHigh(x, y)))){
media.sndJumper.play();
highCounter = 1;
level.env.beat();
if (user != null){
user(this, "jump", 0);
};
};
return;
};
kill();
}
public function startMissle(_arg1:Number, _arg2:Number, _arg3:int):void{
x = int(_arg1);
y = int(_arg2);
type = TOXIC;
switch (_arg3){
case 0:
damage = 20;
imgMain = media.imgToxic;
break;
case 1:
damage = 20;
imgMain = media.imgToxic2;
break;
};
hook = false;
id = _arg3;
enabled = true;
spy = false;
rMax = 10;
v = 20;
emo = false;
high = false;
setState(1);
}
public function die():void{
setState(0);
}
public function updateHook(_arg1:Number):void{
if (hookCounter > 0){
hookCounter = (hookCounter - _arg1);
if (hookCounter > 0){
updateSpy();
vx = (hx * v);
vy = (hy * v);
} else {
move = false;
ps.startRing(x, y, -1, 0.25, 0.25, 4278190080);
};
} else {
if (utils.vec2distSqr(x, y, (hero.x + 27), (hero.y + 20)) < 10000){
hookCounter = hookTime;
move = true;
updateSpy();
vx = (hx * v);
vy = (hy * v);
ps.startRing(x, y, 1, 0.25, 0.125, 4278190080);
};
};
}
public function drawJump(_arg1:BitmapData):void{
var _local2:Number = (0.8 + (0.4 * Math.sin((highCounter * 1.57))));
if (state != 2){
_local2 = (_local2 * appear);
};
MAT.identity();
MAT.tx = (MAT.ty = -12);
MAT.scale(_local2, _local2);
MAT.translate(x, y);
if (level.power >= 0.5){
_arg1.draw(imgMain, MAT, null, BlendMode.INVERT, null, true);
} else {
if (level.env.day){
_arg1.draw(imgMain, MAT, BLACK, null, null, true);
} else {
_arg1.draw(imgMain, MAT, null, null, null, true);
};
};
}
public function startCure(_arg1:Number, _arg2:Number):void{
x = int(_arg1);
y = int(_arg2);
type = HEALTH;
emo = false;
spy = false;
hook = false;
high = false;
enabled = true;
rMax = 10;
imgMain = media.imgCure;
setState(1);
ps.startAcid(x, y);
utils.playSound(media.sndGenerate, 1, x);
}
public function startSleep(_arg1:Number, _arg2:Number):void{
x = int(_arg1);
y = int(_arg2);
type = SLEEP;
emo = false;
spy = false;
hook = false;
high = false;
enabled = true;
rMax = 10;
imgMain = media.imgSleep;
setState(1);
ps.startAcid(x, y);
utils.playSound(media.sndGenerate, 1, x);
}
public function startJump(_arg1:Number, _arg2:Number):void{
x = int(_arg1);
y = int(_arg2);
type = JUMP;
imgMain = media.imgHigh;
rMax = 10;
damage = 0;
spy = false;
hook = false;
high = false;
enabled = true;
setState(1);
highCounter = 0;
ps.startAcid(x, y, 4294967295);
utils.playSound(media.sndGenerate, 1, x);
}
private function drawEmoHappy(_arg1:BitmapData):void{
var _local2:ColorTransform;
var _local3:Number = 0.5;
var _local4:Number = (emoCounter / 3);
if (emoCounter > 2.5){
_local3 = (3 - emoCounter);
} else {
if (emoCounter < 0.5){
_local3 = emoCounter;
};
};
_local3 = (_local3 * 2);
if (emoParam > 0){
_local4 = (1 - _local4);
};
_local4 = (_local4 * (Math.abs(emoParam) * 6.28));
if (_local3 < 1){
drawEmoDefault(_arg1, (1 - _local3), _local4);
};
COLOR.alphaMultiplier = _local3;
MAT.identity();
MAT.tx = -6;
MAT.ty = 1;
MAT.rotate(_local4);
MAT.scale(appear, appear);
MAT.translate(dx, dy);
_arg1.draw(media.imgSmile3, MAT, COLOR, null, null, true);
MAT.identity();
MAT.tx = -7;
MAT.ty = -5;
MAT.rotate(_local4);
MAT.scale(appear, appear);
MAT.translate(dx, dy);
_arg1.draw(media.imgEyes2, MAT, COLOR, null, null, true);
}
public function update(_arg1:Number):Boolean{
if (((((!((state == 3))) && (enabled))) && ((hero.state.health > 0)))){
if (((((y + r) > hero.y)) || (((y - r) < (hero.y + 40))))){
if (((((x + r) > hero.x)) || (((x - r) < (hero.x + 54))))){
if (hero.overlapsCircle(x, y, r)){
heroTouch();
};
};
};
};
switch (state){
case 1:
if (!enabled){
warning = (warning - _arg1);
if (warning <= 0){
enabled = true;
ps.startAcid(x, y);
if (type == TOXIC){
utils.playSound(media.sndToxicBorn, 1, x);
};
};
} else {
appear = (appear + (10 * _arg1));
r = (rMax * appear);
if (appear >= 1){
setState(2);
};
};
break;
case 2:
if (spy){
updateSpy();
};
if (hook){
updateHook(_arg1);
};
if (move){
x = (x + (vx * _arg1));
y = (y + (vy * _arg1));
};
if (((emo) && ((media.power > 0.5)))){
if (emoCounter > 0){
emoCounter = (emoCounter - _arg1);
if (emoCounter < 0){
emoCounter = 0;
emoPause = ((Math.random() * 3) + 2);
};
} else {
emoPause = (emoPause - _arg1);
if (emoPause <= 0){
startEmo(int((Math.random() * 3)));
};
};
};
if (high){
if (level.power >= 0.5){
highCounter = (highCounter + _arg1);
} else {
highCounter = (highCounter + (_arg1 * (1 + (7 * level.power))));
};
if (highCounter >= 1){
highCounter = (highCounter - int(highCounter));
};
};
if ((((type == JUMP)) && ((highCounter > 0)))){
highCounter = (highCounter - _arg1);
if (highCounter < 0){
highCounter = 0;
};
};
break;
case 3:
appear = (appear - (10 * _arg1));
if (appear <= 0){
setState(0);
};
break;
};
if (user != null){
user(this, null, _arg1);
};
return ((state == 0));
}
public function startPower(_arg1:Number, _arg2:Number, _arg3:int, _arg4:Boolean):void{
x = int(_arg1);
y = int(_arg2);
type = POWER;
switch (_arg3){
case 0:
scores = 5;
power = 0.01;
imgMain = media.imgPower1;
imgEmo = media.imgPPower1;
break;
case 1:
scores = 25;
power = 0.025;
imgMain = media.imgPower2;
imgEmo = media.imgPPower2;
break;
case 2:
scores = 50;
power = 0.05;
imgMain = media.imgPower3;
imgEmo = media.imgPPower3;
break;
};
rMax = 10;
damage = 0;
id = _arg3;
emo = true;
emoPause = ((Math.random() * 3) + 2);
emoCounter = 0;
hx = 0;
hy = 0;
imgNid = BitmapData(media.imgNids[int((Math.random() * 4))]);
spy = true;
hook = false;
high = _arg4;
enabled = true;
setState(1);
ps.startAcid(x, y);
utils.playSound(media.sndGenerate, 1, x);
}
public function startMatrix(_arg1:Number, _arg2:Number):void{
x = int(_arg1);
y = int(_arg2);
type = MATRIX;
imgMain = media.imgHole;
rMax = 10;
spy = false;
hook = false;
high = false;
enabled = true;
setState(1);
ps.startAcid(x, y);
utils.playSound(media.sndGenerate, 1, x);
}
public function drawEmo(_arg1:BitmapData):void{
if (media.power < 0.5){
if (state != 2){
MAT.identity();
MAT.tx = (MAT.ty = -10);
MAT.scale(appear, appear);
MAT.translate(dx, dy);
_arg1.draw(imgMain, MAT, null, null, null, true);
_arg1.draw(imgNid, MAT, null, null, null, true);
} else {
POINT.x = (dx - 10);
POINT.y = (dy - 10);
_arg1.copyPixels(imgMain, RC, POINT);
_arg1.copyPixels(imgNid, RC, POINT);
};
} else {
if (state != 2){
MAT.identity();
MAT.tx = (MAT.ty = -10);
MAT.scale(appear, appear);
MAT.translate(dx, dy);
_arg1.draw(imgEmo, MAT, null, null, null, true);
} else {
POINT.x = (dx - 10);
POINT.y = (dy - 10);
_arg1.copyPixels(imgEmo, RC, POINT);
};
if (emoCounter > 0){
switch (emoType){
case 0:
drawEmoHappy(_arg1);
break;
case 1:
drawEmoShake(_arg1);
break;
case 2:
drawEmoSmile(_arg1);
break;
};
} else {
drawNid(_arg1);
};
};
if (((((high) && ((highCounter > 0.5)))) && ((state == 2)))){
MAT.identity();
MAT.tx = (dx - 12);
MAT.ty = (dy - 12);
COLOR.alphaMultiplier = (2 - (highCounter * 2));
_arg1.draw(media.imgHigh, MAT, COLOR, null, null, false);
};
}
private function drawEmoShake(_arg1:BitmapData):void{
var _local2:Number = 0.5;
var _local3:Number = Math.sin((emoCounter * 6.28));
if (emoCounter > 2.5){
_local2 = (3 - emoCounter);
} else {
if (emoCounter < 0.5){
_local2 = emoCounter;
};
};
_local2 = (_local2 * 2);
if (_local2 < 1){
drawEmoDefault(_arg1, (1 - _local2), 0);
};
COLOR.alphaMultiplier = _local2;
if (_local3 < 0){
_local3 = 0;
} else {
if (_local3 >= 0){
_local3 = 0.5;
};
};
MAT.identity();
MAT.tx = -6;
MAT.ty = 1;
MAT.scale(appear, appear);
MAT.translate(dx, dy);
_arg1.draw(media.imgSmile3, MAT, COLOR, null, null, true);
MAT.identity();
MAT.tx = -7;
MAT.ty = -5;
MAT.scale(appear, appear);
MAT.translate(dx, (dy + _local3));
_arg1.draw(media.imgEyes2, MAT, COLOR, null, null, true);
}
public function startToxic(_arg1:Number, _arg2:Number, _arg3:int):void{
x = int(_arg1);
y = int(_arg2);
type = TOXIC;
switch (_arg3){
case 0:
damage = 20;
imgMain = media.imgToxic;
hook = true;
hookTime = 3;
hookCounter = 0;
break;
case 1:
damage = 20;
imgMain = media.imgToxic2;
hook = false;
break;
};
id = _arg3;
warning = 3;
enabled = false;
spy = false;
rMax = 10;
v = 20;
emo = false;
high = false;
setState(1);
if ((((level.power < 0.5)) && (!(level.env.day)))){
ps.startWarning(x, y, 3, 1, 1, 1);
} else {
ps.startWarning(x, y, 3, 0, 0, 0);
};
media.sndWarning.play();
}
private function drawEmoDefault(_arg1:BitmapData, _arg2:Number, _arg3:Number):void{
COLOR.alphaMultiplier = _arg2;
MAT.identity();
MAT.tx = -4;
MAT.ty = 2;
MAT.rotate(_arg3);
MAT.scale(appear, appear);
MAT.translate(dx, dy);
_arg1.draw(media.imgSmile1, MAT, COLOR, null, null, true);
MAT.identity();
MAT.tx = -5;
MAT.ty = -3;
MAT.rotate(_arg3);
MAT.scale(appear, appear);
MAT.translate((dx + hx), (dy + hy));
_arg1.draw(media.imgEyes1, MAT, COLOR, null, null, true);
}
private function drawEmoSmile(_arg1:BitmapData):void{
var _local2:Number = 0.5;
if (emoCounter > 2.5){
_local2 = (3 - emoCounter);
} else {
if (emoCounter < 0.5){
_local2 = emoCounter;
};
};
_local2 = (_local2 * 2);
if (_local2 < 1){
drawEmoDefault(_arg1, (1 - _local2), 0);
};
COLOR.alphaMultiplier = _local2;
MAT.identity();
MAT.tx = -8;
MAT.ty = 1;
MAT.scale(appear, appear);
MAT.translate(dx, dy);
_arg1.draw(media.imgSmile2, MAT, COLOR, null, null, true);
MAT.identity();
MAT.tx = -5;
MAT.ty = -3;
MAT.scale(appear, appear);
MAT.translate(dx, dy);
_arg1.draw(media.imgEyes1, MAT, COLOR, null, null, true);
}
}
}//package
Section 151
//Pills (Pills)
package {
import flash.display.*;
public class Pills {
public var hero:Hero;
public var ps:Particles;
public var media:PillsMedia;
public var actives:int;
public var harvestCount:int;
public var harvesting:Number;
public var pool:Array;
public static const poolSize:int = 120;
public static var instance:Pills;
public function Pills(_arg1:Hero, _arg2:Particles, _arg3:Level){
instance = this;
var _local4:int = poolSize;
media = new PillsMedia();
ps = _arg2;
hero = _arg1;
pool = new Array(poolSize);
while (_local4 > 0) {
pool[_local4] = new Pill(media, _arg1, _arg2, _arg3);
_local4--;
};
clear();
harvesting = 0;
}
public function finish():void{
var _local1:int;
var _local2:int;
var _local3:Pill;
_local2 = actives;
harvestCount = 0;
for each (_local3 in pool) {
if (_local1 == _local2){
break;
};
if (_local3.state != 0){
if (_local3.type == 0){
if ((((_local3.state == 1)) || ((_local3.state == 2)))){
harvestCount++;
};
} else {
if ((((_local3.type == 1)) || ((_local3.type == 2)))){
ps.explStarsSleep(_local3.x, _local3.y);
_local3.die();
actives--;
};
};
_local1++;
};
};
}
public function clear():void{
var _local1:Pill;
for each (_local1 in pool) {
_local1.init();
};
actives = 0;
}
public function harvest(_arg1:Number):void{
var _local4:Pill;
var _local2:int;
var _local3:Boolean;
harvesting = (harvesting + (_arg1 * 8));
if (harvesting >= 1){
harvesting = (harvesting - 1);
harvestCount = 0;
if (actives > 0){
for each (_local4 in pool) {
if (_local2 == actives){
break;
};
if (_local4.state > 0){
if (_local4.type == 0){
harvestCount++;
if (((_local3) && ((_local4.state == 2)))){
_local4.heroTouch();
_local3 = false;
};
};
_local2++;
};
};
};
};
}
public function isBusy(_arg1:Number, _arg2:Number):Boolean{
var _local4:int;
var _local5:Pill;
var _local3:Boolean;
if (utils.vec2distSqr((hero.x + 27), (hero.y + 20), _arg1, _arg2) >= 3600){
for each (_local5 in pool) {
if (_local4 == actives){
break;
};
if (_local5.state){
if (utils.vec2distSqr(_local5.x, _local5.y, _arg1, _arg2) < 900){
_local3 = true;
break;
};
_local4++;
};
};
} else {
_local3 = true;
};
return (_local3);
}
public function draw(_arg1:BitmapData):void{
var _local2:int;
var _local3:Pill;
for each (_local3 in pool) {
if (_local2 == actives){
break;
};
if (_local3.state){
_local3.dx = int(_local3.x);
_local3.dy = int(_local3.y);
if (_local3.type == 0){
_local3.drawEmo(_arg1);
} else {
if (_local3.type == 5){
_local3.drawJump(_arg1);
} else {
_local3.draw(_arg1);
};
};
_local2++;
};
};
}
public function update(_arg1:Number, _arg2:Number):void{
var _local3:int;
var _local4:int;
var _local5:Pill;
media.power = _arg2;
_local4 = actives;
for each (_local5 in pool) {
if (_local3 == _local4){
break;
};
if (_local5.state){
if (_local5.update(_arg1)){
actives--;
};
_local3++;
};
};
}
public function findDead():Pill{
var _local1:*;
var _local2:Pill;
for each (_local2 in pool) {
if (!_local2.state){
return (_local2);
};
};
return (null);
}
public function tooCloseHero(_arg1:Number, _arg2:Number, _arg3:Number=3600):Boolean{
var _local4:Number = ((_arg1 - hero.x) - 27);
var _local5:Number = ((_arg2 - hero.y) - 20);
return ((((_local4 * _local4) + (_local5 * _local5)) < _arg3));
}
}
}//package
Section 152
//PillsMedia (PillsMedia)
package {
import flash.display.*;
import flash.media.*;
public class PillsMedia {
public var sndGenerate:Sound;
private var rPower2Snd:Class;
public var imgHigh:BitmapData;
public var imgEyes2:BitmapData;
public var imgEyes1:BitmapData;
public var imgPPower1:BitmapData;
public var imgPPower2:BitmapData;
public var imgPPower3:BitmapData;
public var power:Number;
private var rPowerImg1:Class;
private var rPowerImg2:Class;
private var rPowerImg3:Class;
public var sndJumper:Sound;
public var imgToxic:BitmapData;
public var imgHole:BitmapData;
private var rWarningSnd:Class;
private var rSuperPowerImg1:Class;
private var rSuperPowerImg2:Class;
private var rSuperPowerImg3:Class;
private var rPower3Snd:Class;
public var imgPower1:BitmapData;
public var imgPower2:BitmapData;
public var imgPower3:BitmapData;
public var imgToxic2:BitmapData;
public var imgCure:BitmapData;
private var rCureImg:Class;
private var rHighSnd:Class;
private var rToxic2Img:Class;
private var rToxicImg:Class;
private var rSmileImg1:Class;
private var rNidImg1:Class;
private var rNidImg2:Class;
private var rNidImg3:Class;
private var rNidImg4:Class;
private var rPower1Snd:Class;
private var rSmileImg2:Class;
private var rSmileImg3:Class;
public var sndToxicBorn:Sound;
public var sndHigh:Sound;
private var rToxicBornSnd:Class;
private var rJumperSnd:Class;
public var imgSmile1:BitmapData;
public var imgSmile2:BitmapData;
public var imgSmile3:BitmapData;
public var imgSleep:BitmapData;
public var sndPowers:Array;
private var gfxHole:Class;
private var rEyesImg2:Class;
private var rEyesImg1:Class;
public var imgNids:Array;
private var rHighImg:Class;
private var rGenerateSnd:Class;
public var sndWarning:Sound;
public var sndHeal:Sound;
private var rSleepImg:Class;
public function PillsMedia(){
rPowerImg1 = PillsMedia_rPowerImg1;
rPowerImg2 = PillsMedia_rPowerImg2;
rPowerImg3 = PillsMedia_rPowerImg3;
rSuperPowerImg1 = PillsMedia_rSuperPowerImg1;
rSuperPowerImg2 = PillsMedia_rSuperPowerImg2;
rSuperPowerImg3 = PillsMedia_rSuperPowerImg3;
rNidImg1 = PillsMedia_rNidImg1;
rNidImg2 = PillsMedia_rNidImg2;
rNidImg3 = PillsMedia_rNidImg3;
rNidImg4 = PillsMedia_rNidImg4;
rHighImg = PillsMedia_rHighImg;
rToxicImg = PillsMedia_rToxicImg;
rToxic2Img = PillsMedia_rToxic2Img;
rCureImg = PillsMedia_rCureImg;
gfxHole = PillsMedia_gfxHole;
rSleepImg = PillsMedia_rSleepImg;
rSmileImg1 = PillsMedia_rSmileImg1;
rSmileImg2 = PillsMedia_rSmileImg2;
rSmileImg3 = PillsMedia_rSmileImg3;
rEyesImg1 = PillsMedia_rEyesImg1;
rEyesImg2 = PillsMedia_rEyesImg2;
rWarningSnd = PillsMedia_rWarningSnd;
rToxicBornSnd = PillsMedia_rToxicBornSnd;
rGenerateSnd = PillsMedia_rGenerateSnd;
rPower1Snd = PillsMedia_rPower1Snd;
rPower2Snd = PillsMedia_rPower2Snd;
rPower3Snd = PillsMedia_rPower3Snd;
rJumperSnd = PillsMedia_rJumperSnd;
rHighSnd = PillsMedia_rHighSnd;
super();
imgPower1 = new rPowerImg1().bitmapData;
imgPower2 = new rPowerImg2().bitmapData;
imgPower3 = new rPowerImg3().bitmapData;
imgPPower1 = new rSuperPowerImg1().bitmapData;
imgPPower2 = new rSuperPowerImg2().bitmapData;
imgPPower3 = new rSuperPowerImg3().bitmapData;
imgNids = [new rNidImg1().bitmapData, new rNidImg2().bitmapData, new rNidImg3().bitmapData, new rNidImg4().bitmapData];
imgHigh = new rHighImg().bitmapData;
imgToxic = new rToxicImg().bitmapData;
imgToxic2 = new rToxic2Img().bitmapData;
imgCure = new rCureImg().bitmapData;
imgSleep = new rSleepImg().bitmapData;
imgHole = new gfxHole().bitmapData;
imgSmile1 = new rSmileImg1().bitmapData;
imgSmile2 = new rSmileImg2().bitmapData;
imgSmile3 = new rSmileImg3().bitmapData;
imgEyes1 = new rEyesImg1().bitmapData;
imgEyes2 = new rEyesImg2().bitmapData;
sndPowers = [new rPower1Snd(), new rPower2Snd(), new rPower3Snd()];
sndWarning = new rWarningSnd();
sndGenerate = new rGenerateSnd();
sndJumper = new rJumperSnd();
sndHigh = new rHighSnd();
sndToxicBorn = new rToxicBornSnd();
power = 0;
}
}
}//package
Section 153
//PillsMedia_gfxHole (PillsMedia_gfxHole)
package {
import mx.core.*;
public class PillsMedia_gfxHole extends BitmapAsset {
}
}//package
Section 154
//PillsMedia_rCureImg (PillsMedia_rCureImg)
package {
import mx.core.*;
public class PillsMedia_rCureImg extends BitmapAsset {
}
}//package
Section 155
//PillsMedia_rEyesImg1 (PillsMedia_rEyesImg1)
package {
import mx.core.*;
public class PillsMedia_rEyesImg1 extends BitmapAsset {
}
}//package
Section 156
//PillsMedia_rEyesImg2 (PillsMedia_rEyesImg2)
package {
import mx.core.*;
public class PillsMedia_rEyesImg2 extends BitmapAsset {
}
}//package
Section 157
//PillsMedia_rGenerateSnd (PillsMedia_rGenerateSnd)
package {
import mx.core.*;
public class PillsMedia_rGenerateSnd extends SoundAsset {
}
}//package
Section 158
//PillsMedia_rHighImg (PillsMedia_rHighImg)
package {
import mx.core.*;
public class PillsMedia_rHighImg extends BitmapAsset {
}
}//package
Section 159
//PillsMedia_rHighSnd (PillsMedia_rHighSnd)
package {
import mx.core.*;
public class PillsMedia_rHighSnd extends SoundAsset {
}
}//package
Section 160
//PillsMedia_rJumperSnd (PillsMedia_rJumperSnd)
package {
import mx.core.*;
public class PillsMedia_rJumperSnd extends SoundAsset {
}
}//package
Section 161
//PillsMedia_rNidImg1 (PillsMedia_rNidImg1)
package {
import mx.core.*;
public class PillsMedia_rNidImg1 extends BitmapAsset {
}
}//package
Section 162
//PillsMedia_rNidImg2 (PillsMedia_rNidImg2)
package {
import mx.core.*;
public class PillsMedia_rNidImg2 extends BitmapAsset {
}
}//package
Section 163
//PillsMedia_rNidImg3 (PillsMedia_rNidImg3)
package {
import mx.core.*;
public class PillsMedia_rNidImg3 extends BitmapAsset {
}
}//package
Section 164
//PillsMedia_rNidImg4 (PillsMedia_rNidImg4)
package {
import mx.core.*;
public class PillsMedia_rNidImg4 extends BitmapAsset {
}
}//package
Section 165
//PillsMedia_rPower1Snd (PillsMedia_rPower1Snd)
package {
import mx.core.*;
public class PillsMedia_rPower1Snd extends SoundAsset {
}
}//package
Section 166
//PillsMedia_rPower2Snd (PillsMedia_rPower2Snd)
package {
import mx.core.*;
public class PillsMedia_rPower2Snd extends SoundAsset {
}
}//package
Section 167
//PillsMedia_rPower3Snd (PillsMedia_rPower3Snd)
package {
import mx.core.*;
public class PillsMedia_rPower3Snd extends SoundAsset {
}
}//package
Section 168
//PillsMedia_rPowerImg1 (PillsMedia_rPowerImg1)
package {
import mx.core.*;
public class PillsMedia_rPowerImg1 extends BitmapAsset {
}
}//package
Section 169
//PillsMedia_rPowerImg2 (PillsMedia_rPowerImg2)
package {
import mx.core.*;
public class PillsMedia_rPowerImg2 extends BitmapAsset {
}
}//package
Section 170
//PillsMedia_rPowerImg3 (PillsMedia_rPowerImg3)
package {
import mx.core.*;
public class PillsMedia_rPowerImg3 extends BitmapAsset {
}
}//package
Section 171
//PillsMedia_rSleepImg (PillsMedia_rSleepImg)
package {
import mx.core.*;
public class PillsMedia_rSleepImg extends BitmapAsset {
}
}//package
Section 172
//PillsMedia_rSmileImg1 (PillsMedia_rSmileImg1)
package {
import mx.core.*;
public class PillsMedia_rSmileImg1 extends BitmapAsset {
}
}//package
Section 173
//PillsMedia_rSmileImg2 (PillsMedia_rSmileImg2)
package {
import mx.core.*;
public class PillsMedia_rSmileImg2 extends BitmapAsset {
}
}//package
Section 174
//PillsMedia_rSmileImg3 (PillsMedia_rSmileImg3)
package {
import mx.core.*;
public class PillsMedia_rSmileImg3 extends BitmapAsset {
}
}//package
Section 175
//PillsMedia_rSuperPowerImg1 (PillsMedia_rSuperPowerImg1)
package {
import mx.core.*;
public class PillsMedia_rSuperPowerImg1 extends BitmapAsset {
}
}//package
Section 176
//PillsMedia_rSuperPowerImg2 (PillsMedia_rSuperPowerImg2)
package {
import mx.core.*;
public class PillsMedia_rSuperPowerImg2 extends BitmapAsset {
}
}//package
Section 177
//PillsMedia_rSuperPowerImg3 (PillsMedia_rSuperPowerImg3)
package {
import mx.core.*;
public class PillsMedia_rSuperPowerImg3 extends BitmapAsset {
}
}//package
Section 178
//PillsMedia_rToxic2Img (PillsMedia_rToxic2Img)
package {
import mx.core.*;
public class PillsMedia_rToxic2Img extends BitmapAsset {
}
}//package
Section 179
//PillsMedia_rToxicBornSnd (PillsMedia_rToxicBornSnd)
package {
import mx.core.*;
public class PillsMedia_rToxicBornSnd extends SoundAsset {
}
}//package
Section 180
//PillsMedia_rToxicImg (PillsMedia_rToxicImg)
package {
import mx.core.*;
public class PillsMedia_rToxicImg extends BitmapAsset {
}
}//package
Section 181
//PillsMedia_rWarningSnd (PillsMedia_rWarningSnd)
package {
import mx.core.*;
public class PillsMedia_rWarningSnd extends SoundAsset {
}
}//package
Section 182
//PreLoader (PreLoader)
package {
import flash.events.*;
import flash.display.*;
import mx.core.*;
import flash.geom.*;
import ek.*;
import flash.text.*;
import flash.filters.*;
import flash.net.*;
public class PreLoader extends ekPreLoader {
private var rMiniFnt:Class;
public var loaded:Boolean;
public var spC:Number;
public var imgProgress:BitmapData;
public var pulse:Number;
public var shape:Shape;
public var fakeProgress:Number;
public var mx:Number;
public var my:Number;
public var commonProgress:Number;
private var rDefaultFnt:Class;
public var tfProgress:TextField;
public var mcLoading:MovieClip;
public var imgLoadingBmp:Bitmap;
public var spRC:Rectangle;
public var imgProgressBmp:Bitmap;
public var pulsePause:Number;
public var sp:SpriteAsset;
public var tfLoading:TextField;
public var t:Number;
public var pause:Number;
public var filter:DropShadowFilter;
public var imgLoading:BitmapData;
private var PROGRESS_TEXT:String;
public function PreLoader(){
rDefaultFnt = PreLoader_rDefaultFnt;
rMiniFnt = PreLoader_rMiniFnt;
super();
mainClassName = "Game";
offlineAllowed = true;
stage.addChild(this);
device.listener = this;
gfxInit();
}
public function mouseMove(_arg1:MouseEvent):void{
mx = _arg1.stageX;
my = _arg1.stageY;
}
public function gfxUpdate(_arg1:Number):void{
var _local2:Number;
if (((!(loaded)) && ((commonProgress >= 1)))){
loaded = true;
tfLoading.text = "LOADING\nCOMPLETED";
tfLoading.x = ((640 - tfLoading.textWidth) * 0.5);
tfLoading.y = 340;
};
PROGRESS_TEXT = (int((commonProgress * 100)).toString() + "%");
if (tfProgress.text != PROGRESS_TEXT){
tfProgress.text = PROGRESS_TEXT;
tfProgress.x = ((640 - tfProgress.textWidth) * 0.5);
};
if ((((((((mx > spRC.x)) && ((mx < (spRC.x + spRC.width))))) && ((my > spRC.y)))) && ((my < (spRC.y + spRC.height))))){
if (spC < 1){
spC = (spC + (_arg1 * 10));
if (spC > 1){
spC = 1;
};
};
} else {
if (spC > 0){
spC = (spC - (_arg1 * 10));
if (spC < 0){
spC = 0;
};
};
};
t = (t + (_arg1 * 20));
if (t > 80){
t = (t - 80);
};
if (pulse > 0){
pulse = (pulse - (_arg1 * 2));
if (pulse < 0){
pulse = 0;
pulsePause = 1;
};
} else {
pulsePause = (pulsePause - _arg1);
if (pulsePause <= 0){
pulse = 1;
};
};
if (!loaded){
tfProgress.textColor = utils.lerpColor(0x999999, 0xDDDDDD, pulse);
tfLoading.textColor = utils.lerpColor(0x999999, 0xDDDDDD, pulse);
filter.color = utils.lerpColor(0x333333, 0x555555, pulse);
tfProgress.filters = [filter];
tfLoading.filters = [filter];
} else {
pause = (pause - _arg1);
tfProgress.textColor = utils.lerpColor(0x999999, 0xFFFFFF, (pause / 2.5));
tfLoading.textColor = utils.lerpColor(0x999999, 0xFFFFFF, (pause / 2.5));
filter.color = utils.lerpColor(0x333333, 0x777777, (pause / 2.5));
tfProgress.filters = [filter];
tfLoading.filters = [filter];
};
filter.color = utils.lerpColor(0x333333, 0x555555, spC);
sp.filters = [filter];
var _local3:Boolean;
var _local4:Graphics = shape.graphics;
_local4.clear();
_local4.lineStyle();
_local4.beginFill(0x555555);
_local4.drawRect(0, 0, 640, 500);
_local4.endFill();
_local2 = (-160 + t);
while (_local2 < 500) {
_local4.beginFill(0x333333);
_local4.moveTo(0, _local2);
_local4.lineTo(640, (_local2 + 80));
_local4.lineTo(640, (_local2 + 120));
_local4.lineTo(0, (_local2 + 40));
_local4.endFill();
_local3 = !(_local3);
_local2 = (_local2 + 80);
};
}
public function mouseUp(_arg1:MouseEvent):void{
}
public function gfxInit():void{
new Resources();
fakeProgress = 0;
t = 0;
pulse = 1;
pulsePause = 0;
spC = 1;
pause = 2.5;
loaded = false;
filter = new DropShadowFilter(0, 0, 0x333333, 1, 6, 6, 8, 1);
sp = Resources.instance.sprSp;
sp.x = ((640 - sp.width) * 0.5);
sp.y = ((480 - sp.height) * 0.5);
sp.filters = [filter];
tfLoading = new TextField();
tfLoading.defaultTextFormat = new TextFormat("_default", 30, 4294967295, false, null, null, null, null, TextFormatAlign.CENTER, null, null, null, -16);
tfLoading.embedFonts = true;
tfLoading.cacheAsBitmap = true;
tfLoading.selectable = false;
tfLoading.multiline = true;
tfLoading.autoSize = TextFieldAutoSize.LEFT;
tfLoading.filters = [filter];
tfLoading.text = "LOADING\nPLEASE WAIT";
tfLoading.x = ((640 - tfLoading.textWidth) * 0.5);
tfLoading.y = 340;
tfProgress = new TextField();
tfProgress.defaultTextFormat = new TextFormat("_default", 40, 4294967295, false, null, null, null, null, TextFormatAlign.LEFT);
tfProgress.embedFonts = true;
tfProgress.cacheAsBitmap = true;
tfProgress.selectable = false;
tfProgress.autoSize = TextFieldAutoSize.LEFT;
tfProgress.filters = [filter];
tfProgress.textColor = 0xFFFFFF;
tfProgress.y = 400;
shape = new Shape();
mcLoading = new MovieClip();
mcLoading.addChild(shape);
mcLoading.addChild(tfProgress);
mcLoading.addChild(tfLoading);
mcLoading.addChild(sp);
stage.addChild(mcLoading);
spRC = sp.getRect(stage);
stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMove);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseUp);
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
}
public function gfxDestroy():void{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMove);
stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUp);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
mcLoading.removeChild(sp);
sp = null;
mcLoading.removeChild(shape);
shape = null;
mcLoading.removeChild(tfProgress);
tfProgress = null;
mcLoading.removeChild(tfLoading);
tfLoading = null;
stage.removeChild(mcLoading);
mcLoading = null;
spRC = null;
}
public function mouseDown(_arg1:MouseEvent):void{
if ((((mx > sp.x)) && ((mx < (sp.x + sp.width))))){
if ((((my > sp.y)) && ((my < (sp.y + sp.height))))){
navigateToURL(new URLRequest("http://www.gameshed.com/"), "_blank");
};
};
}
override public function frame(_arg1:Number):void{
super.frame(_arg1);
this.updateProgress();
if (fakeProgress < 1){
fakeProgress = (fakeProgress + (0.5 * _arg1));
if (fakeProgress > 1){
fakeProgress = 1;
};
};
commonProgress = (fakeProgress * progress);
gfxUpdate(_arg1);
if (((((completed) && ((commonProgress >= 1)))) && ((pause <= 0)))){
gfxDestroy();
device.listener = null;
stage.removeChild(this);
createMainClass();
};
}
}
}//package
Section 183
//PreLoader_rDefaultFnt (PreLoader_rDefaultFnt)
package {
import mx.core.*;
public class PreLoader_rDefaultFnt extends FontAsset {
}
}//package
Section 184
//PreLoader_rMiniFnt (PreLoader_rMiniFnt)
package {
import mx.core.*;
public class PreLoader_rMiniFnt extends FontAsset {
}
}//package
Section 185
//Resources (Resources)
package {
import mx.core.*;
public class Resources {
public var sprSp:SpriteAsset;
private var rSp:Class;
public static var instance:Resources;
public function Resources(){
rSp = Resources_rSp;
super();
instance = this;
sprSp = new rSp();
}
}
}//package
Section 186
//Resources_rSp (Resources_rSp)
package {
import mx.core.*;
public class Resources_rSp extends SpriteAsset {
}
}//package
Section 187
//utils (utils)
package {
import flash.geom.*;
import flash.media.*;
public class utils {
public static function vec2norm(_arg1:Point):Point{
var _local2:Number = (1 / Math.sqrt(((_arg1.x * _arg1.x) + (_arg1.y * _arg1.y))));
return (new Point((_arg1.x * _local2), (_arg1.y * _local2)));
}
public static function rnd_float(_arg1:Number, _arg2:Number):Number{
return (((Math.random() * (_arg2 - _arg1)) + _arg1));
}
public static function pos2pan(_arg1:Number):Number{
var _local2:Number = ((_arg1 - 320) / 320);
if (_local2 > 1){
_local2 = 1;
} else {
if (_local2 < -1){
_local2 = -1;
};
};
return (_local2);
}
public static function rnd_int(_arg1:int, _arg2:int):int{
return (int(rnd_float(_arg1, (_arg2 + 1))));
}
public static function calcARGB(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):uint{
var _local5:uint = (_arg4 * 0xFF);
var _local6:uint = (_arg1 * 0xFF);
var _local7:uint = (_arg2 * 0xFF);
var _local8:uint = (_arg3 * 0xFF);
var _local9:uint = ((((_local5 << 24) | (_local6 << 16)) | (_local7 << 8)) | _local8);
return (_local9);
}
public static function mixAlpha(_arg1:uint, _arg2:Number):uint{
var _local3:uint = ((_arg1 >> 24) & 0xFF);
var _local4:uint = (_arg1 & 0xFFFFFF);
var _local5:uint = (_local3 * _arg2);
var _local6:uint = ((_local5 << 24) | _local4);
return (_local6);
}
public static function splineInter(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Number{
var _local6:Number = ((_arg4 - _arg3) - (_arg1 - _arg2));
var _local7:Number = ((_arg1 - _arg2) - _local6);
var _local8:Number = (_arg3 - _arg1);
var _local9:Number = _arg2;
var _local10:Number = (_arg5 * _arg5);
return (((((_local6 * (_local10 * _arg5)) + (_local7 * _local10)) + (_local8 * _arg5)) + _local9));
}
public static function lerpColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number = (1 - _arg3);
var _local5:uint = ((_arg1 >> 24) & 0xFF);
var _local6:uint = ((_arg1 >> 16) & 0xFF);
var _local7:uint = ((_arg1 >> 8) & 0xFF);
var _local8:uint = (_arg1 & 0xFF);
var _local9:uint = ((_arg2 >> 24) & 0xFF);
var _local10:uint = ((_arg2 >> 16) & 0xFF);
var _local11:uint = ((_arg2 >> 8) & 0xFF);
var _local12:uint = (_arg2 & 0xFF);
var _local13:uint = ((_local5 * _local4) + (_local9 * _arg3));
var _local14:uint = ((_local6 * _local4) + (_local10 * _arg3));
var _local15:uint = ((_local7 * _local4) + (_local11 * _arg3));
var _local16:uint = ((_local8 * _local4) + (_local12 * _arg3));
var _local17:uint = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16);
return (_local17);
}
public static function ARGB2ColorTransform(_arg1:uint, _arg2:ColorTransform):void{
var _local3:uint = ((_arg1 >> 24) & 0xFF);
var _local4:uint = ((_arg1 >> 16) & 0xFF);
var _local5:uint = ((_arg1 >> 8) & 0xFF);
var _local6:uint = (_arg1 & 0xFF);
_arg2.redMultiplier = (_local4 * 0.0039216);
_arg2.greenMultiplier = (_local5 * 0.0039216);
_arg2.blueMultiplier = (_local6 * 0.0039216);
_arg2.alphaMultiplier = (_local3 * 0.0039216);
}
public static function vec2distSqr(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number = (_arg1 - _arg3);
var _local6:Number = (_arg2 - _arg4);
return (((_local5 * _local5) + (_local6 * _local6)));
}
public static function vec2angle(_arg1:Point, _arg2:Point):Number{
return ((Math.atan2(_arg1.y, _arg1.x) - Math.atan2(_arg2.y, _arg2.x)));
}
public static function lerp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
return ((_arg2 + (_arg1 * (_arg3 - _arg2))));
}
public static function vec2norm2(_arg1:Point, _arg2:Point):Point{
var _local3:Number = (_arg1.x - _arg2.x);
var _local4:Number = (_arg1.y - _arg2.y);
var _local5:Number = (1 / Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
return (new Point((_local3 * _local5), (_local4 * _local5)));
}
public static function rnd_bool():Boolean{
return ((Math.random() >= 0.5));
}
public static function vec2multScalar(_arg1:Point, _arg2:Number):Point{
var _local3:Number = (_arg2 * _arg1.x);
var _local4:Number = (_arg2 * _arg1.y);
return (new Point(_local3, _local4));
}
public static function playSound(_arg1:Sound, _arg2:Number, _arg3:Number):void{
var _local4:Number = ((_arg3 - 320) / 320);
if (_local4 > 1){
_local4 = 1;
} else {
if (_local4 < -1){
_local4 = -1;
};
};
var _local5:SoundTransform = new SoundTransform(_arg2, _local4);
_arg1.play(49, 0, _local5);
}
public static function ctSetRGB(_arg1:ColorTransform, _arg2:uint):void{
_arg1.redMultiplier = (((_arg2 >> 16) & 0xFF) / 0xFF);
_arg1.greenMultiplier = (((_arg2 >> 8) & 0xFF) / 0xFF);
_arg1.blueMultiplier = ((_arg2 & 0xFF) / 0xFF);
}
public static function vec2lenSqr(_arg1:Point):Number{
return (((_arg1.x * _arg1.x) + (_arg1.y * _arg1.y)));
}
public static function multColorScalar(_arg1:uint, _arg2:Number):uint{
var _local3:uint = ((_arg1 >> 24) & 0xFF);
var _local4:uint = ((_arg1 >> 16) & 0xFF);
var _local5:uint = ((_arg1 >> 8) & 0xFF);
var _local6:uint = (_arg1 & 0xFF);
var _local7:uint = (_local3 * _arg2);
var _local8:uint = (_local4 * _arg2);
var _local9:uint = (_local5 * _arg2);
var _local10:uint = (_local6 * _arg2);
var _local11:uint = ((((_local7 << 24) | (_local8 << 16)) | (_local9 << 8)) | _local10);
return (_local11);
}
}
}//package