Section 1
//NewgroundsAPIAsset_API_Conencted_4 (APIConnector_fla.NewgroundsAPIAsset_API_Conencted_4)
package APIConnector_fla {
import flash.display.*;
import com.newgrounds.components.*;
public dynamic class NewgroundsAPIAsset_API_Conencted_4 extends MovieClip {
public function NewgroundsAPIAsset_API_Conencted_4(){
addFrameScript(36, this.frame37);
}
function frame37(){
APIConnector(parent).clear();
}
}
}//package APIConnector_fla
Section 2
//NewgroundsAPIAsset_ConnectingAPI_2 (APIConnector_fla.NewgroundsAPIAsset_ConnectingAPI_2)
package APIConnector_fla {
import flash.display.*;
public dynamic class NewgroundsAPIAsset_ConnectingAPI_2 extends MovieClip {
public function NewgroundsAPIAsset_ConnectingAPI_2(){
addFrameScript(9, this.frame10);
}
function frame10(){
stop();
}
}
}//package APIConnector_fla
Section 3
//NewgroundsAPIAsset_Connection_Error_7 (APIConnector_fla.NewgroundsAPIAsset_Connection_Error_7)
package APIConnector_fla {
import flash.display.*;
import com.newgrounds.components.*;
public dynamic class NewgroundsAPIAsset_Connection_Error_7 extends MovieClip {
public function NewgroundsAPIAsset_Connection_Error_7(){
addFrameScript(9, this.frame10, 20, this.frame21);
}
function frame10(){
stop();
}
function frame21(){
APIConnector(parent).clear();
}
}
}//package APIConnector_fla
Section 4
//NewgroundsAPIAsset_Load_Indicator_3 (APIConnector_fla.NewgroundsAPIAsset_Load_Indicator_3)
package APIConnector_fla {
import flash.display.*;
import flash.events.*;
public dynamic class NewgroundsAPIAsset_Load_Indicator_3 extends MovieClip {
public function NewgroundsAPIAsset_Load_Indicator_3(){
addFrameScript(0, this.frame1);
}
public function onEnterFrame(_arg1:Event):void{
if (((visible) && (stage))){
rotation = (rotation + 30);
} else {
removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
};
}
function frame1(){
addEventListener(Event.ENTER_FRAME, this.onEnterFrame);
}
}
}//package APIConnector_fla
Section 5
//NewgroundsAPIAsset_Login_Warning_5 (APIConnector_fla.NewgroundsAPIAsset_Login_Warning_5)
package APIConnector_fla {
import flash.display.*;
import com.newgrounds.components.*;
public dynamic class NewgroundsAPIAsset_Login_Warning_5 extends MovieClip {
public function NewgroundsAPIAsset_Login_Warning_5(){
addFrameScript(9, this.frame10, 20, this.frame21);
}
function frame10(){
stop();
}
function frame21(){
APIConnector(parent).clear();
}
}
}//package APIConnector_fla
Section 6
//BeamLazor (bullets.BeamLazor)
package bullets {
import flash.display.*;
public class BeamLazor extends Bullet {
var boom:Boolean;// = false
public var hitbox:MovieClip;
var o:Number;// = 0
var splinters:Number;
var time:Number;// = 0
public function BeamLazor(x:Number, y:Number, angle:Number){
time = 0;
o = 0;
boom = false;
addFrameScript(6, frame7);
super(x, y, NaN, NaN, angle, 0);
this.time = time;
small = false;
stop();
time = 0;
}
override function hitPlayer(){
if (((hitbox) && (hitbox.hitTestPoint(player.x, player.y, true)))){
player.hit();
};
}
function frame7(){
if (this){
kill();
};
}
override function special(){
time++;
if (time == 37){
nextFrame();
};
if (time == 40){
nextFrame();
};
if (time == 77){
prevFrame();
};
if (time == 80){
prevFrame();
};
if (time == 83){
gotoAndPlay(4);
};
}
}
}//package bullets
Section 7
//BigWhiteBullet (bullets.BigWhiteBullet)
package bullets {
import flash.display.*;
public class BigWhiteBullet extends Bullet {
public var hitbox:MovieClip;
public function BigWhiteBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 8
//BlueBullet (bullets.BlueBullet)
package bullets {
import flash.display.*;
public class BlueBullet extends Bullet {
public var hitbox:MovieClip;
public function BlueBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 9
//BlueWave (bullets.BlueWave)
package bullets {
import flash.display.*;
public class BlueWave extends Bullet {
public var hitbox:MovieClip;
public function BlueWave(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
this.size = 25;
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 10
//BubbleBall (bullets.BubbleBall)
package bullets {
import flash.display.*;
public class BubbleBall extends Bullet {
public var hitbox:MovieClip;
var t:int;// = 0
var acc:Number;// = 0.1
public function BubbleBall(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
acc = 0.1;
t = 0;
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
};
}
override function special(){
t++;
if ((t % 13) == 0){
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, this.rotation, 3));
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, (this.rotation + 180), 3));
};
}
}
}//package bullets
Section 11
//BubbleBall2 (bullets.BubbleBall2)
package bullets {
import flash.display.*;
import levels.*;
public class BubbleBall2 extends Bullet {
var distance:Number;
var an:Number;
public var hitbox:MovieClip;
var t:int;// = 0
var ang:Number;
public function BubbleBall2(x:Number, y:Number, an:Number, distance:Number){
t = 0;
super(x, y);
this.an = an;
size = 10000;
glow();
this.distance = distance;
}
override function hitPlayer(){
if (((hitbox) && (hitbox.hitTestPoint(player.x, player.y, true)))){
player.hit();
};
}
override function death(){
var a:Number;
dead = true;
stop();
a = 0;
while (a < 15) {
parent.addChild(new GodBullet(x, y, (Math.random() * 360), ((Math.random() * 3) + 3)));
a++;
};
}
override function special(){
t++;
an = (an + 1);
ang = ((an * Math.PI) / 180);
this.x = ((parent as Level).player.x + (Math.cos(ang) * distance));
this.y = ((parent as Level).player.y + (Math.sin(ang) * distance));
if (x > 500){
x = 500;
};
if (y > 600){
y = 600;
};
if (y < 0){
y = 0;
};
if (x < 0){
x = 0;
};
if ((t % 3) == 0){
parent.addChild(new GodBullet(x, y, (t * 9), 2));
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, ((t * 9) + 180), 2));
};
return (false);
}
}
}//package bullets
Section 12
//BubbleBall3 (bullets.BubbleBall3)
package bullets {
import flash.display.*;
import levels.*;
public class BubbleBall3 extends Bullet {
var distance:Number;
var an:Number;
public var hitbox:MovieClip;
var t:int;// = 0
var ang:Number;
public function BubbleBall3(x:Number, y:Number, an:Number, distance:Number){
t = 0;
super(x, y);
this.an = an;
size = 10000;
glow();
this.distance = distance;
}
override function hitPlayer(){
if (((hitbox) && (hitbox.hitTestPoint(player.x, player.y, true)))){
player.hit();
};
}
override function death(){
dead = true;
stop();
}
override function special(){
var b:int;
t++;
this.x = (((parent as Level).player.x - 400) + (800 * an));
this.y = (parent as Level).player.y;
if (x > 500){
x = 500;
};
if (y > 600){
y = 600;
};
if (y < 0){
y = 0;
};
if (x < 0){
x = 0;
};
if ((t % 35) == 0){
b = 0;
while (b < 360) {
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, b, 3));
b = (b + 30);
};
};
if ((t % 5) == 0){
parent.addChild(new BlueWave(x, y, NaN, NaN, ((getAngle(x, y) + (Math.random() * 120)) - 60), 2));
};
return (false);
}
}
}//package bullets
Section 13
//BubbleBullet (bullets.BubbleBullet)
package bullets {
import flash.display.*;
public class BubbleBullet extends Bullet {
public var hitbox:MovieClip;
public function BubbleBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
this.size = 25;
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 14
//BubbleBullet2 (bullets.BubbleBullet2)
package bullets {
import flash.display.*;
public class BubbleBullet2 extends Bullet {
public var hitbox:MovieClip;
public function BubbleBullet2(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
this.scaleX = (this.scaleX * (this.scaleY = (this.scaleY * (0.7 + (Math.random() / 3)))));
this.size = 20;
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 15
//Bullet (bullets.Bullet)
package bullets {
import flash.display.*;
import levels.*;
import players.*;
import flash.geom.*;
public class Bullet extends MovieClip {
public var size:Number;// = 10
public var small:Boolean;// = true
public var hitbo:MovieClip;
public var dead:Boolean;// = false
public var yspeed:Number;
public var bounce:Number;// = 0
public var xspeed:Number;
public var player:Player;
public function Bullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=INF, speed:Number=NaN, spin:Number=NaN){
bounce = 0;
size = 10;
dead = false;
small = true;
super();
this.x = x;
this.y = y;
if (angle == Infinity){
this.xspeed = xspeed;
this.yspeed = yspeed;
} else {
this.rotation = Math.floor((angle - 90));
angle = (angle * (Math.PI / 180));
this.xspeed = (Math.cos(angle) * speed);
this.yspeed = (Math.sin(angle) * speed);
};
Global.vars.bulletArray.push(this);
cacheAsBitmap = true;
Global.vars.bullets++;
}
public function getAngle(x:Number, y:Number):Number{
var player:Player;
var n:Number;
player = (parent as Level).player;
n = ((Math.atan(((y - player.y) / (x - player.x))) / Math.PI) * 180);
if (x >= player.x){
return ((n + 180));
};
return (n);
}
function hitPlayer(){
if (hitbo.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
public function kill(){
Global.vars.bullets--;
death();
dead = true;
stop();
if (this){
parent.removeChild(this);
};
Global.vars.bulletArray.splice(Global.vars.bulletArray.indexOf(this), 1);
}
function death(){
}
function setBounce(b:Number){
this.bounce = b;
}
public function glow(){
if (Global.vars.options[1]){
stop();
} else {
gotoAndStop(2);
};
}
function special(){
}
function bounceOff(){
if (bounce == 0){
kill();
} else {
bounce--;
x = (x + xspeed);
y = (y + yspeed);
};
}
public function move(){
x = (x + xspeed);
y = (y + yspeed);
player = (parent as Level).player;
special();
if ((((((y < -(size))) || ((y > (600 + size))))) || ((parent as Level).gameOff))){
kill();
} else {
if ((((x > (500 + size))) || ((x < -(size))))){
kill();
} else {
hitPlayer();
};
};
}
}
}//package bullets
Section 16
//DemonBullet (bullets.DemonBullet)
package bullets {
import flash.display.*;
public class DemonBullet extends Bullet {
public var hitbox:MovieClip;
public function DemonBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
size = 40;
small = false;
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
};
}
}
}//package bullets
Section 17
//DevilBall (bullets.DevilBall)
package bullets {
import flash.display.*;
public class DevilBall extends Bullet {
public var hitbox:MovieClip;
var acc:Number;// = 0.3
var time:int;// = 150
public function DevilBall(x:Number, y:Number, angle:Number, speed:Number){
time = 150;
acc = 0.3;
addFrameScript(0, frame1, 2, frame3);
super(x, y, NaN, NaN, angle, speed);
size = 400;
small = false;
}
function death2(){
var a:Number;
a = 0;
while (a < 360) {
parent.addChild(new DevilBullet2(x, y, a, 5));
a = (a + 20);
};
play();
}
override function hitPlayer(){
if (((hitbox) && (hitbox.hitTestPoint(player.x, player.y, true)))){
player.hit();
};
}
function frame3(){
if (this){
kill();
};
}
function frame1(){
stop();
}
override function special(){
if (x > player.x){
xspeed = (xspeed - acc);
};
if (x < player.x){
xspeed = (xspeed + acc);
};
if (y > player.y){
yspeed = (yspeed - acc);
};
if (y < player.y){
yspeed = (yspeed + acc);
};
yspeed = (yspeed * 0.97);
xspeed = (xspeed * 0.97);
if ((time % 8) == 0){
parent.addChild(new DevilBullet(x, y, (Math.random() * 360), 3));
};
time--;
if (time == 0){
this.death2();
};
}
}
}//package bullets
Section 18
//DevilBullet (bullets.DevilBullet)
package bullets {
import flash.display.*;
public class DevilBullet extends Bullet {
public var hitbox:MovieClip;
public function DevilBullet(x:Number, y:Number, angle:Number, speed:Number){
super(x, y, NaN, NaN, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 19
//DevilBullet2 (bullets.DevilBullet2)
package bullets {
import flash.display.*;
public class DevilBullet2 extends Bullet {
public var hitbox:MovieClip;
public function DevilBullet2(x:Number, y:Number, angle:Number, speed:Number){
super(x, y, NaN, NaN, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 20
//DevilBullet3 (bullets.DevilBullet3)
package bullets {
import flash.display.*;
public class DevilBullet3 extends Bullet {
public var hitbox:MovieClip;
var bounc:int;// = 1
public function DevilBullet3(x:Number, y:Number, angle:Number, speed:Number){
bounc = 1;
super(x, y, NaN, NaN, angle, speed);
glow();
size = 20;
bounc = 1;
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
override function special(){
if (bounc > 0){
if (y < -5){
y = 605;
bounc--;
};
if (y > 605){
y = -5;
bounc--;
};
if (x < -5){
x = 505;
bounc--;
};
if (x > 505){
x = -5;
bounc--;
};
};
}
}
}//package bullets
Section 21
//DualBall (bullets.DualBall)
package bullets {
import flash.display.*;
public class DualBall extends Bullet {
public var hitbox:MovieClip;
var acc:Number;// = 0.2
var time:int;// = 90
public function DualBall(x:Number, y:Number, angle:Number, speed:Number){
time = 90;
acc = 0.2;
addFrameScript(0, frame1, 2, frame3);
super(x, y, NaN, NaN, angle, speed);
size = 400;
small = false;
}
function death2(){
var a:Number;
a = 0;
while (a < 360) {
parent.addChild(new GodBullet2(x, y, a, 3));
parent.addChild(new RedBullet(x, y, NaN, NaN, (a + 10), 8));
a = (a + 20);
};
play();
}
override function hitPlayer(){
if (((hitbox) && (hitbox.hitTestPoint(player.x, player.y, true)))){
player.hit();
};
}
function frame3(){
if (this){
kill();
};
}
function frame1(){
stop();
}
override function special(){
if ((time % 8) == 0){
parent.addChild(new SmallRedBullet(x, y, NaN, NaN, (Math.random() * 360), 3));
};
if ((time % 4) == 0){
parent.addChild(new GodBullet(x, y, (Math.random() * 360), 2));
};
time--;
if (time == 0){
this.death2();
};
}
}
}//package bullets
Section 22
//FlameBullet (bullets.FlameBullet)
package bullets {
import flash.display.*;
public class FlameBullet extends Bullet {
public var hitbox:MovieClip;
public function FlameBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 23
//GlowBall (bullets.GlowBall)
package bullets {
import flash.display.*;
public class GlowBall extends Bullet {
public var hitbox:MovieClip;
public function GlowBall(x:Number, y:Number, angle:Number, speed:Number){
super(x, y, NaN, NaN, angle, speed);
size = 60;
small = false;
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
};
}
}
}//package bullets
Section 24
//GodBall (bullets.GodBall)
package bullets {
import flash.display.*;
public class GodBall extends Bullet {
public var hitbox:MovieClip;
public function GodBall(x:Number, y:Number, angle:Number, speed:Number){
super(x, y, NaN, NaN, angle, speed);
size = 60;
small = false;
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
};
}
}
}//package bullets
Section 25
//GodBall2 (bullets.GodBall2)
package bullets {
public class GodBall2 extends Bullet {
var acc:Number;// = 0.2
var time:int;// = 180
public function GodBall2(x:Number, y:Number, angle:Number, speed:Number){
time = 180;
acc = 0.2;
addFrameScript(0, frame1, 1, frame2);
super(x, y, NaN, NaN, angle, speed);
size = 700;
small = false;
glow();
}
override function hitPlayer(){
}
function frame1(){
stop();
}
override function special(){
if (x > 500){
x = 500;
};
if (y > 600){
y = 600;
};
if (y < 0){
y = 0;
};
if (x < 0){
x = 0;
};
if (x > player.x){
xspeed = (xspeed - acc);
};
if (x < player.x){
xspeed = (xspeed + acc);
};
if (y > player.y){
yspeed = (yspeed - acc);
};
if (y < player.y){
yspeed = (yspeed + acc);
};
yspeed = (yspeed * 0.95);
xspeed = (xspeed * 0.95);
parent.addChild(new GodBullet2(x, y, ((time * 7) % 360), 3.5));
parent.addChild(new PurpleBullet(x, y, NaN, NaN, ((time * 7) % 360), 4.5));
time--;
}
function frame2(){
if (this){
kill();
};
}
}
}//package bullets
Section 26
//GodBullet (bullets.GodBullet)
package bullets {
import flash.display.*;
public class GodBullet extends Bullet {
public var hitbox:MovieClip;
public function GodBullet(x:Number, y:Number, angle:Number, speed:Number){
super(x, y, NaN, NaN, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 27
//GodBullet2 (bullets.GodBullet2)
package bullets {
import flash.display.*;
public class GodBullet2 extends Bullet {
public var hitbox:MovieClip;
public function GodBullet2(x:Number, y:Number, angle:Number, speed:Number){
super(x, y, NaN, NaN, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 28
//GodBullet3 (bullets.GodBullet3)
package bullets {
public class GodBullet3 extends GodBullet {
var bounc:int;// = 1
public function GodBullet3(x:Number, y:Number, angle:Number, speed:Number){
bounc = 1;
super(x, y, angle, speed);
size = 20;
bounc = 1;
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
override function special(){
if (bounc > 0){
if (y < 0){
yspeed = (yspeed * -1);
bounc--;
};
};
}
}
}//package bullets
Section 29
//GodDiamond (bullets.GodDiamond)
package bullets {
import flash.display.*;
public class GodDiamond extends Bullet {
public var hitbox:MovieClip;
public function GodDiamond(x:Number, y:Number, angle:Number, speed:Number){
super(x, y, NaN, NaN, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 30
//GreenBall (bullets.GreenBall)
package bullets {
import flash.display.*;
public class GreenBall extends Bullet {
public var hitbox:MovieClip;
public function GreenBall(x:Number, y:Number, angle:Number, speed:Number){
super(x, y, NaN, NaN, angle, speed);
size = 50;
small = false;
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
};
}
}
}//package bullets
Section 31
//GreenBullet (bullets.GreenBullet)
package bullets {
import flash.display.*;
public class GreenBullet extends Bullet {
var speedy:Number;
var speedx:Number;
public var hitbox:MovieClip;
var time:int;
public function GreenBullet(x:Number, y:Number, angle:Number, speed:Number, time:int){
super(x, y, NaN, NaN, angle, speed);
size = 50;
this.time = time;
small = false;
glow();
speedx = xspeed;
speedy = yspeed;
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
override function special(){
if (time > 0){
xspeed = (xspeed * 0.95);
yspeed = (yspeed * 0.95);
};
time--;
if (time == 0){
xspeed = speedx;
yspeed = speedy;
};
}
}
}//package bullets
Section 32
//GreenSlimeBullet (bullets.GreenSlimeBullet)
package bullets {
import flash.display.*;
public class GreenSlimeBullet extends Bullet {
public var hitbox:MovieClip;
public function GreenSlimeBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 33
//HomingBullet (bullets.HomingBullet)
package bullets {
import flash.display.*;
import levels.*;
public class HomingBullet extends Bullet {
public var hitbox:MovieClip;
var acc:Number;// = 0.2
public function HomingBullet(a:Number, b:Number, c:Number, d:Number){
acc = 0.2;
super(a, b, c, d);
width = (width * 1.5);
height = (height * 1.5);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
override public function move(){
player = (parent as Level).player;
if (x > player.x){
xspeed = (xspeed - acc);
};
if (x < player.x){
xspeed = (xspeed + acc);
};
if (y > player.y){
yspeed = (yspeed - acc);
};
if (y < player.y){
yspeed = (yspeed + acc);
};
x = (x + xspeed);
y = (y + yspeed);
if ((((x > (parent as Level).xlimit)) || ((x < 0)))){
kill();
} else {
if ((((((y > (parent as Level).ylimit)) || ((y < 0)))) || ((parent as Level).gameOff))){
kill();
} else {
hitPlayer();
};
};
}
}
}//package bullets
Section 34
//HugeDevilBullet (bullets.HugeDevilBullet)
package bullets {
import flash.display.*;
public class HugeDevilBullet extends Bullet {
public var hitbox:MovieClip;
public function HugeDevilBullet(x:Number, y:Number, angle:Number, speed:Number){
var scale:Number;
super(x, y, NaN, NaN, angle, speed);
scale = (1 - (Math.random() / 3));
this.scaleX = (this.scaleX * scale);
this.scaleY = (this.scaleY * scale);
size = 100;
small = false;
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
};
}
}
}//package bullets
Section 35
//HugeOrangeBullet (bullets.HugeOrangeBullet)
package bullets {
import flash.display.*;
public class HugeOrangeBullet extends Bullet {
public var hitbox:MovieClip;
public function HugeOrangeBullet(x:Number, y:Number, angle:Number, speed:Number){
var scale:Number;
super(x, y, NaN, NaN, angle, speed);
scale = (1.1 - (Math.random() / 3));
this.scaleX = (this.scaleX * scale);
this.scaleY = (this.scaleY * scale);
size = 100;
small = false;
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
};
}
}
}//package bullets
Section 36
//HugeRedBullet (bullets.HugeRedBullet)
package bullets {
import flash.display.*;
public class HugeRedBullet extends Bullet {
public var hitbox:MovieClip;
public function HugeRedBullet(x:Number, y:Number, angle:Number, speed:Number){
var scale:Number;
super(x, y, NaN, NaN, angle, speed);
scale = (1.2 - (Math.random() / 2));
this.scaleX = (this.scaleX * scale);
this.scaleY = (this.scaleY * scale);
size = 100;
small = false;
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
};
}
}
}//package bullets
Section 37
//LeafBullet (bullets.LeafBullet)
package bullets {
import flash.display.*;
public class LeafBullet extends Bullet {
public var hitbox:MovieClip;
public function LeafBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 38
//OrangeBomb (bullets.OrangeBomb)
package bullets {
import flash.display.*;
public class OrangeBomb extends Bullet {
var boom:Boolean;// = false
public var hitbox:MovieClip;
var o:Number;// = 0
var splinters:Number;
var time:Number;// = 0
public function OrangeBomb(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN, time:int=60, splinters:int=4){
time = 0;
o = 0;
boom = false;
addFrameScript(5, frame6, 26, frame27);
super(x, y, xspeed, yspeed, angle, speed);
this.time = time;
this.splinters = splinters;
small = false;
}
override function hitPlayer(){
if (((hitbox) && (hitbox.hitTestPoint(player.x, player.y, true)))){
player.hit();
};
}
function frame6(){
stop();
}
override function death(){
var a:Number;
boom = true;
size = 10000;
play();
a = 0;
while (a < splinters) {
if (((this) && (parent))){
parent.addChild(new OrangeBullet(x, y, NaN, NaN, (Math.random() * 360), ((Math.random() * 3) + 3)));
};
a++;
};
}
function frame27(){
if (this){
kill();
};
}
override function special(){
time--;
if (time == 0){
death();
};
if (boom){
x = (x - xspeed);
y = (y - yspeed);
};
}
}
}//package bullets
Section 39
//OrangeBullet (bullets.OrangeBullet)
package bullets {
import flash.display.*;
public class OrangeBullet extends Bullet {
public var hitbox:MovieClip;
public function OrangeBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 40
//OrangeLazor (bullets.OrangeLazor)
package bullets {
import flash.display.*;
public class OrangeLazor extends Bullet {
public var hitbox:MovieClip;
public function OrangeLazor(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 41
//OrbitBall (bullets.OrbitBall)
package bullets {
import flash.display.*;
import levels.*;
public class OrbitBall extends Bullet {
var distance:Number;
var an:Number;
public var hitbox:MovieClip;
var t:int;// = 0
var ang:Number;
public function OrbitBall(x:Number, y:Number, an:Number, distance:Number){
t = 0;
addFrameScript(12, frame13, 23, frame24);
super(x, y);
this.an = an;
size = 10000;
this.distance = distance;
}
override function hitPlayer(){
if (((hitbox) && (hitbox.hitTestPoint(player.x, player.y, true)))){
player.hit();
};
}
function frame13(){
stop();
}
function frame24(){
if (this){
kill();
};
}
override function death(){
var a:Number;
dead = true;
stop();
a = 0;
while (a < 30) {
parent.addChild(new OrangeBullet(x, y, NaN, NaN, (Math.random() * 360), ((Math.random() * 3) + 3)));
a++;
};
}
override function special(){
t++;
an = (an + 3);
ang = ((an * Math.PI) / 180);
this.x = ((parent as Level).player.x + (Math.cos(ang) * distance));
this.y = ((parent as Level).player.y + (Math.sin(ang) * distance));
if (x > 500){
x = 500;
};
if (y > 600){
y = 600;
};
if (y < 0){
y = 0;
};
if (x < 0){
x = 0;
};
if ((t % 4) == 0){
parent.addChild(new OrangeBullet(x, y, NaN, NaN, getAngle(x, y), 2));
parent.addChild(new OrangeBullet(x, y, NaN, NaN, -(getAngle(x, y)), 2));
parent.addChild(new OrangeBullet(x, y, NaN, NaN, getAngle(x, y), -2));
parent.addChild(new OrangeBullet(x, y, NaN, NaN, -(getAngle(x, y)), -2));
};
return (false);
}
}
}//package bullets
Section 42
//PinkBullet (bullets.PinkBullet)
package bullets {
import flash.display.*;
public class PinkBullet extends Bullet {
public var hitbox:MovieClip;
public function PinkBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed);
this.scaleX = (this.scaleX * (this.scaleY = (this.scaleY * (0.5 + (Math.random() / 2)))));
this.x = (this.x + ((Math.random() * 30) - 15));
this.y = (this.y + ((Math.random() * 30) - 15));
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 43
//PurpleBall (bullets.PurpleBall)
package bullets {
import flash.display.*;
public class PurpleBall extends Bullet {
public var hitbox:MovieClip;
var acc:Number;// = 0.3
public function PurpleBall(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
acc = 0.3;
addFrameScript(108, frame109);
super(x, y, xspeed, yspeed, angle, speed);
size = 200;
}
override function hitPlayer(){
if (((hitbox) && (hitbox.hitTestPoint(player.x, player.y, true)))){
player.hit();
};
}
function frame109(){
if (this){
kill();
};
}
override function special(){
if (x > player.x){
xspeed = (xspeed - acc);
};
if (x < player.x){
xspeed = (xspeed + acc);
};
if (y > player.y){
yspeed = (yspeed - acc);
};
if (y < player.y){
yspeed = (yspeed + acc);
};
yspeed = (yspeed * 0.97);
xspeed = (xspeed * 0.97);
}
}
}//package bullets
Section 44
//PurpleBullet (bullets.PurpleBullet)
package bullets {
import flash.display.*;
public class PurpleBullet extends Bullet {
public var hitbox:MovieClip;
public function PurpleBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 45
//RedBullet (bullets.RedBullet)
package bullets {
import flash.display.*;
public class RedBullet extends Bullet {
public var hitbox:MovieClip;
public function RedBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 46
//RedDiamond (bullets.RedDiamond)
package bullets {
import flash.display.*;
public class RedDiamond extends Bullet {
public var hitbox:MovieClip;
public function RedDiamond(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 47
//RedLazor (bullets.RedLazor)
package bullets {
import flash.display.*;
public class RedLazor extends Bullet {
public var hitbox:MovieClip;
public function RedLazor(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 48
//SmallRedBullet (bullets.SmallRedBullet)
package bullets {
import flash.display.*;
public class SmallRedBullet extends Bullet {
public var hitbox:MovieClip;
public function SmallRedBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 49
//SpikeBullet (bullets.SpikeBullet)
package bullets {
import flash.display.*;
public class SpikeBullet extends Bullet {
public var hitbox:MovieClip;
public function SpikeBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 50
//SporeBullet (bullets.SporeBullet)
package bullets {
import flash.display.*;
public class SporeBullet extends Bullet {
public var hitbox:MovieClip;
public function SporeBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
addFrameScript(54, frame55);
super(x, y, 0, 0);
this.scaleX = (this.scaleX * (this.scaleY = (this.scaleY * (0.5 + (Math.random() / 2)))));
this.x = (this.x + ((Math.random() * 30) - 15));
this.y = (this.y + ((Math.random() * 30) - 15));
}
override function hitPlayer(){
if (((hitbox) && (hitbox.hitTestPoint(player.x, player.y, true)))){
player.hit();
kill();
};
}
function frame55(){
stop();
if (this){
kill();
};
}
}
}//package bullets
Section 51
//ThunderBall (bullets.ThunderBall)
package bullets {
import flash.display.*;
public class ThunderBall extends Bullet {
public var hitbox:MovieClip;
var bounc:int;// = 1
public function ThunderBall(x:Number, y:Number, angle:Number, speed:Number){
bounc = 1;
super(x, y, NaN, NaN, angle, speed);
glow();
size = 50;
bounc = 1;
small = false;
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
override function special(){
if (bounc > 0){
if (y < -40){
y = 640;
bounc--;
};
if (y > 640){
y = -40;
bounc--;
};
if (x < -40){
x = 540;
bounc--;
};
if (x > 540){
x = -40;
bounc--;
};
};
}
}
}//package bullets
Section 52
//WaveBullet (bullets.WaveBullet)
package bullets {
import flash.display.*;
public class WaveBullet extends Bullet {
public var hitbox:MovieClip;
public function WaveBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 53
//WaveBullet2 (bullets.WaveBullet2)
package bullets {
import flash.display.*;
public class WaveBullet2 extends Bullet {
public var hitbox:MovieClip;
public function WaveBullet2(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 54
//WhiteBullet (bullets.WhiteBullet)
package bullets {
import flash.display.*;
public class WhiteBullet extends Bullet {
public var hitbox:MovieClip;
public function WhiteBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 55
//YellowBall (bullets.YellowBall)
package bullets {
import flash.display.*;
public class YellowBall extends Bullet {
public var hitbox:MovieClip;
var speed:Number;
var bin:Boolean;
var reps:Number;
var time:Number;// = 60
var angle:Number;// = 0
public function YellowBall(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN, reps:Number=3, bin:Boolean=false){
time = 60;
angle = 0;
addFrameScript(4, frame5, 14, frame15);
super(x, y, xspeed, yspeed, angle, speed);
this.angle = angle;
size = 50;
this.speed = speed;
this.reps = reps;
this.bin = bin;
this.scaleX = (this.scaleX * (this.scaleY = (this.scaleY * (0.7 + (0.2 * reps)))));
this.x = (this.x + ((Math.random() * 30) - 15));
this.y = (this.y + ((Math.random() * 30) - 15));
}
override function hitPlayer(){
if (((hitbox) && (hitbox.hitTestPoint(player.x, player.y, true)))){
player.hit();
};
}
function frame5(){
stop();
}
override function special(){
var c:Number;
xspeed = (xspeed * 0.9);
yspeed = (yspeed * 0.9);
time--;
if (time == 0){
play();
if (reps != 0){
c = getAngle(x, y);
parent.addChild(new YellowBall(x, y, NaN, NaN, c, speed, (reps - 1), bin));
if (bin){
parent.addChild(new YellowBall(x, y, NaN, NaN, (c - 30), speed, (reps - 1), bin));
parent.addChild(new YellowBall(x, y, NaN, NaN, (c + 30), speed, (reps - 1), bin));
};
};
};
}
function frame15(){
if (this){
kill();
};
}
}
}//package bullets
Section 56
//YellowBullet (bullets.YellowBullet)
package bullets {
import flash.display.*;
public class YellowBullet extends Bullet {
public var hitbox:MovieClip;
public function YellowBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 57
//YellowBullet2 (bullets.YellowBullet2)
package bullets {
import flash.display.*;
public class YellowBullet2 extends Bullet {
public var hitbox:MovieClip;
public function YellowBullet2(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 58
//YellowBullet3 (bullets.YellowBullet3)
package bullets {
public class YellowBullet3 extends YellowBullet {
var time2:int;
var speed:Number;
var loops:int;
var time:int;
var angle:Number;
var ang:Number;
public function YellowBullet3(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN, loops:int=5, ang:Number=10, time:int=30){
super(x, y, xspeed, yspeed, angle, speed);
this.loops = loops;
this.ang = ((ang + (Math.random() * 10)) - 5);
this.time = time;
this.time2 = time;
this.speed = speed;
this.angle = angle;
glow();
}
private function duplicate(){
parent.addChild(new YellowBullet3(x, y, NaN, NaN, (angle + ang), this.speed, (loops - 1), ang, time2));
parent.addChild(new YellowBullet3(x, y, NaN, NaN, (angle - ang), this.speed, (loops - 1), ang, time2));
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
override function special(){
time--;
if ((((time == 0)) && ((loops > 0)))){
duplicate();
death();
};
}
}
}//package bullets
Section 59
//MD5 (com.adobe.crypto.MD5)
package com.adobe.crypto {
import flash.utils.*;
import com.adobe.utils.*;
public class MD5 {
public static var digest:ByteArray;
public static function hash(_arg1:String):String{
var _local2:ByteArray = new ByteArray();
_local2.writeUTFBytes(_arg1);
return (hashBinary(_local2));
}
public static function hashBytes(_arg1:ByteArray):String{
return (hashBinary(_arg1));
}
public static function hashBinary(_arg1:ByteArray):String{
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local2 = 1732584193;
var _local3 = -271733879;
var _local4 = -1732584194;
var _local5 = 271733878;
var _local10:Array = createBlocks(_arg1);
var _local11:int = _local10.length;
var _local12:int;
while (_local12 < _local11) {
_local6 = _local2;
_local7 = _local3;
_local8 = _local4;
_local9 = _local5;
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 7, -680876936);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 1))], 12, -389564586);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 17, 606105819);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 3))], 22, -1044525330);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 7, -176418897);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 5))], 12, 1200080426);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 17, -1473231341);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 7))], 22, -45705983);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 7, 1770035416);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 9))], 12, -1958414417);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 17, -42063);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 11))], 22, -1990404162);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 7, 1804603682);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 13))], 12, -40341101);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 17, -1502002290);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 15))], 22, 1236535329);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 5, -165796510);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 6))], 9, -1069501632);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 14, 643717713);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 0))], 20, -373897302);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 5, -701558691);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 10))], 9, 38016083);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 14, -660478335);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 4))], 20, -405537848);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 5, 568446438);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 14))], 9, -1019803690);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 14, -187363961);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 8))], 20, 1163531501);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 5, -1444681467);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 2))], 9, -51403784);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 14, 1735328473);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 12))], 20, -1926607734);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 4, -378558);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 8))], 11, -2022574463);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 16, 1839030562);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 14))], 23, -35309556);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 4, -1530992060);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 4))], 11, 1272893353);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 16, -155497632);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 10))], 23, -1094730640);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 4, 681279174);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 0))], 11, -358537222);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 16, -722521979);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 6))], 23, 76029189);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 4, -640364487);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 12))], 11, -421815835);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 16, 530742520);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 2))], 23, -995338651);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 6, -198630844);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 7))], 10, 1126891415);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 15, -1416354905);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 5))], 21, -57434055);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 6, 1700485571);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 3))], 10, -1894986606);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 15, -1051523);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 1))], 21, -2054922799);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 6, 1873313359);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 15))], 10, -30611744);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 15, -1560198380);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 13))], 21, 1309151649);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 6, -145523070);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 11))], 10, -1120210379);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 15, 718787259);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 9))], 21, -343485551);
_local2 = (_local2 + _local6);
_local3 = (_local3 + _local7);
_local4 = (_local4 + _local8);
_local5 = (_local5 + _local9);
_local12 = (_local12 + 16);
};
digest = new ByteArray();
digest.writeInt(_local2);
digest.writeInt(_local3);
digest.writeInt(_local4);
digest.writeInt(_local5);
digest.position = 0;
return ((((IntUtil.toHex(_local2) + IntUtil.toHex(_local3)) + IntUtil.toHex(_local4)) + IntUtil.toHex(_local5)));
}
private static function f(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg2) | (~(_arg1) & _arg3)));
}
private static function g(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg3) | (_arg2 & ~(_arg3))));
}
private static function h(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 ^ _arg2) ^ _arg3));
}
private static function i(_arg1:int, _arg2:int, _arg3:int):int{
return ((_arg2 ^ (_arg1 | ~(_arg3))));
}
private static function transform(_arg1:Function, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):int{
var _local9:int = (((_arg2 + int(_arg1(_arg3, _arg4, _arg5))) + _arg6) + _arg8);
return ((IntUtil.rol(_local9, _arg7) + _arg3));
}
private static function ff(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(f, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function gg(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(g, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function hh(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(h, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function ii(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(i, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function createBlocks(_arg1:ByteArray):Array{
var _local2:Array = new Array();
var _local3:int = (_arg1.length * 8);
var _local4 = 0xFF;
var _local5:int;
while (_local5 < _local3) {
_local2[int((_local5 >> 5))] = (_local2[int((_local5 >> 5))] | ((_arg1[(_local5 / 8)] & _local4) << (_local5 % 32)));
_local5 = (_local5 + 8);
};
_local2[int((_local3 >> 5))] = (_local2[int((_local3 >> 5))] | (128 << (_local3 % 32)));
_local2[int(((((_local3 + 64) >>> 9) << 4) + 14))] = _local3;
return (_local2);
}
}
}//package com.adobe.crypto
Section 60
//PNGEncoder (com.adobe.images.PNGEncoder)
package com.adobe.images {
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
public class PNGEncoder {
private static var crcTable:Array;
private static var crcTableComputed:Boolean = false;
public static function encode(_arg1:BitmapData):ByteArray{
var _local6:uint;
var _local7:int;
var _local2:ByteArray = new ByteArray();
_local2.writeUnsignedInt(2303741511);
_local2.writeUnsignedInt(218765834);
var _local3:ByteArray = new ByteArray();
_local3.writeInt(_arg1.width);
_local3.writeInt(_arg1.height);
_local3.writeUnsignedInt(134610944);
_local3.writeByte(0);
writeChunk(_local2, 1229472850, _local3);
var _local4:ByteArray = new ByteArray();
var _local5:int;
while (_local5 < _arg1.height) {
_local4.writeByte(0);
if (!_arg1.transparent){
_local7 = 0;
while (_local7 < _arg1.width) {
_local6 = _arg1.getPixel(_local7, _local5);
_local4.writeUnsignedInt(uint((((_local6 & 0xFFFFFF) << 8) | 0xFF)));
_local7++;
};
} else {
_local7 = 0;
while (_local7 < _arg1.width) {
_local6 = _arg1.getPixel32(_local7, _local5);
_local4.writeUnsignedInt(uint((((_local6 & 0xFFFFFF) << 8) | (_local6 >>> 24))));
_local7++;
};
};
_local5++;
};
_local4.compress();
writeChunk(_local2, 1229209940, _local4);
writeChunk(_local2, 1229278788, null);
return (_local2);
}
private static function writeChunk(_arg1:ByteArray, _arg2:uint, _arg3:ByteArray):void{
var _local8:uint;
var _local9:uint;
var _local10:uint;
if (!crcTableComputed){
crcTableComputed = true;
crcTable = [];
_local9 = 0;
while (_local9 < 0x0100) {
_local8 = _local9;
_local10 = 0;
while (_local10 < 8) {
if ((_local8 & 1)){
_local8 = uint((uint(3988292384) ^ uint((_local8 >>> 1))));
} else {
_local8 = uint((_local8 >>> 1));
};
_local10++;
};
crcTable[_local9] = _local8;
_local9++;
};
};
var _local4:uint;
if (_arg3 != null){
_local4 = _arg3.length;
};
_arg1.writeUnsignedInt(_local4);
var _local5:uint = _arg1.position;
_arg1.writeUnsignedInt(_arg2);
if (_arg3 != null){
_arg1.writeBytes(_arg3);
};
var _local6:uint = _arg1.position;
_arg1.position = _local5;
_local8 = 4294967295;
var _local7:int;
while (_local7 < (_local6 - _local5)) {
_local8 = uint((crcTable[((_local8 ^ _arg1.readUnsignedByte()) & uint(0xFF))] ^ uint((_local8 >>> 8))));
_local7++;
};
_local8 = uint((_local8 ^ uint(4294967295)));
_arg1.position = _local6;
_arg1.writeUnsignedInt(_local8);
}
}
}//package com.adobe.images
Section 61
//JSON (com.adobe.serialization.json.JSON)
package com.adobe.serialization.json {
public class JSON {
public static function encode(_arg1:Object):String{
var _local2:JSONEncoder = new JSONEncoder(_arg1);
return (_local2.getString());
}
public static function decode(_arg1:String){
var _local2:JSONDecoder = new JSONDecoder(_arg1);
return (_local2.getValue());
}
}
}//package com.adobe.serialization.json
Section 62
//JSONDecoder (com.adobe.serialization.json.JSONDecoder)
package com.adobe.serialization.json {
public class JSONDecoder {
private var value;
private var tokenizer:JSONTokenizer;
private var token:JSONToken;
public function JSONDecoder(_arg1:String){
this.tokenizer = new JSONTokenizer(_arg1);
this.nextToken();
this.value = this.parseValue();
}
public function getValue(){
return (this.value);
}
private function nextToken():JSONToken{
return ((this.token = this.tokenizer.getNextToken()));
}
private function parseArray():Array{
var _local1:Array = new Array();
this.nextToken();
if (this.token.type == JSONTokenType.RIGHT_BRACKET){
return (_local1);
};
while (true) {
_local1.push(this.parseValue());
this.nextToken();
if (this.token.type == JSONTokenType.RIGHT_BRACKET){
return (_local1);
};
if (this.token.type == JSONTokenType.COMMA){
this.nextToken();
} else {
this.tokenizer.parseError(("Expecting ] or , but found " + this.token.value));
};
};
return (null);
}
private function parseObject():Object{
var _local2:String;
var _local1:Object = new Object();
this.nextToken();
if (this.token.type == JSONTokenType.RIGHT_BRACE){
return (_local1);
};
while (true) {
if (this.token.type == JSONTokenType.STRING){
_local2 = String(this.token.value);
this.nextToken();
if (this.token.type == JSONTokenType.COLON){
this.nextToken();
_local1[_local2] = this.parseValue();
this.nextToken();
if (this.token.type == JSONTokenType.RIGHT_BRACE){
return (_local1);
};
if (this.token.type == JSONTokenType.COMMA){
this.nextToken();
} else {
this.tokenizer.parseError(("Expecting } or , but found " + this.token.value));
};
} else {
this.tokenizer.parseError(("Expecting : but found " + this.token.value));
};
} else {
this.tokenizer.parseError(("Expecting string but found " + this.token.value));
};
};
return (null);
}
private function parseValue():Object{
if (this.token == null){
this.tokenizer.parseError("Unexpected end of input");
};
switch (this.token.type){
case JSONTokenType.LEFT_BRACE:
return (this.parseObject());
case JSONTokenType.LEFT_BRACKET:
return (this.parseArray());
case JSONTokenType.STRING:
case JSONTokenType.NUMBER:
case JSONTokenType.TRUE:
case JSONTokenType.FALSE:
case JSONTokenType.NULL:
return (this.token.value);
default:
this.tokenizer.parseError(("Unexpected " + this.token.value));
};
return (null);
}
}
}//package com.adobe.serialization.json
Section 63
//JSONEncoder (com.adobe.serialization.json.JSONEncoder)
package com.adobe.serialization.json {
import flash.utils.*;
public class JSONEncoder {
private var jsonString:String;
public function JSONEncoder(_arg1){
this.jsonString = this.convertToString(_arg1);
}
public function getString():String{
return (this.jsonString);
}
private function convertToString(_arg1):String{
if ((_arg1 is String)){
return (this.escapeString((_arg1 as String)));
};
if ((_arg1 is Number)){
return ((isFinite((_arg1 as Number))) ? _arg1.toString() : "null");
} else {
if ((_arg1 is Boolean)){
return ((_arg1) ? "true" : "false");
} else {
if ((_arg1 is Array)){
return (this.arrayToString((_arg1 as Array)));
};
if ((((_arg1 is Object)) && (!((_arg1 == null))))){
return (this.objectToString(_arg1));
};
};
};
return ("null");
}
private function escapeString(_arg1:String):String{
var _local3:String;
var _local6:String;
var _local7:String;
var _local2 = "";
var _local4:Number = _arg1.length;
var _local5:int;
while (_local5 < _local4) {
_local3 = _arg1.charAt(_local5);
switch (_local3){
case "\"":
_local2 = (_local2 + "\\\"");
break;
case "\\":
_local2 = (_local2 + "\\\\");
break;
case "\b":
_local2 = (_local2 + "\\b");
break;
case "\f":
_local2 = (_local2 + "\\f");
break;
case "\n":
_local2 = (_local2 + "\\n");
break;
case "\r":
_local2 = (_local2 + "\\r");
break;
case "\t":
_local2 = (_local2 + "\\t");
break;
default:
if (_local3 < " "){
_local6 = _local3.charCodeAt(0).toString(16);
_local7 = ((_local6.length == 2)) ? "00" : "000";
_local2 = (_local2 + (("\\u" + _local7) + _local6));
} else {
_local2 = (_local2 + _local3);
};
};
_local5++;
};
return ((("\"" + _local2) + "\""));
}
private function arrayToString(_arg1:Array):String{
var _local2 = "";
var _local3:int;
while (_local3 < _arg1.length) {
if (_local2.length > 0){
_local2 = (_local2 + ",");
};
_local2 = (_local2 + this.convertToString(_arg1[_local3]));
_local3++;
};
return ((("[" + _local2) + "]"));
}
private function objectToString(_arg1:Object):String{
var value:Object;
var key:String;
var v:XML;
var o = _arg1;
var s = "";
var classInfo:XML = describeType(o);
if (classInfo.@name.toString() == "Object"){
for (key in o) {
value = o[key];
if ((value is Function)){
} else {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((this.escapeString(key) + ":") + this.convertToString(value)));
};
};
} else {
for each (v in classInfo..*.(((name() == "variable")) || ((name() == "accessor")))) {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((this.escapeString(v.@name.toString()) + ":") + this.convertToString(o[v.@name])));
};
};
return ((("{" + s) + "}"));
}
}
}//package com.adobe.serialization.json
Section 64
//JSONParseError (com.adobe.serialization.json.JSONParseError)
package com.adobe.serialization.json {
public class JSONParseError extends Error {
private var _location:int;
private var _text:String;
public function JSONParseError(_arg1:String="", _arg2:int=0, _arg3:String=""){
super(_arg1);
name = "JSONParseError";
this._location = _arg2;
this._text = _arg3;
}
public function get location():int{
return (this._location);
}
public function get text():String{
return (this._text);
}
}
}//package com.adobe.serialization.json
Section 65
//JSONToken (com.adobe.serialization.json.JSONToken)
package com.adobe.serialization.json {
public class JSONToken {
private var _type:int;
private var _value:Object;
public function JSONToken(_arg1:int=-1, _arg2:Object=null){
this._type = _arg1;
this._value = _arg2;
}
public function get type():int{
return (this._type);
}
public function set type(_arg1:int):void{
this._type = _arg1;
}
public function get value():Object{
return (this._value);
}
public function set value(_arg1:Object):void{
this._value = _arg1;
}
}
}//package com.adobe.serialization.json
Section 66
//JSONTokenizer (com.adobe.serialization.json.JSONTokenizer)
package com.adobe.serialization.json {
public class JSONTokenizer {
private var obj:Object;
private var jsonString:String;
private var loc:int;
private var ch:String;
public function JSONTokenizer(_arg1:String){
this.jsonString = _arg1;
this.loc = 0;
this.nextChar();
}
public function getNextToken():JSONToken{
var _local2:String;
var _local3:String;
var _local4:String;
var _local1:JSONToken = new JSONToken();
this.skipIgnored();
switch (this.ch){
case "{":
_local1.type = JSONTokenType.LEFT_BRACE;
_local1.value = "{";
this.nextChar();
break;
case "}":
_local1.type = JSONTokenType.RIGHT_BRACE;
_local1.value = "}";
this.nextChar();
break;
case "[":
_local1.type = JSONTokenType.LEFT_BRACKET;
_local1.value = "[";
this.nextChar();
break;
case "]":
_local1.type = JSONTokenType.RIGHT_BRACKET;
_local1.value = "]";
this.nextChar();
break;
case ",":
_local1.type = JSONTokenType.COMMA;
_local1.value = ",";
this.nextChar();
break;
case ":":
_local1.type = JSONTokenType.COLON;
_local1.value = ":";
this.nextChar();
break;
case "t":
_local2 = ((("t" + this.nextChar()) + this.nextChar()) + this.nextChar());
if (_local2 == "true"){
_local1.type = JSONTokenType.TRUE;
_local1.value = true;
this.nextChar();
} else {
this.parseError(("Expecting 'true' but found " + _local2));
};
break;
case "f":
_local3 = (((("f" + this.nextChar()) + this.nextChar()) + this.nextChar()) + this.nextChar());
if (_local3 == "false"){
_local1.type = JSONTokenType.FALSE;
_local1.value = false;
this.nextChar();
} else {
this.parseError(("Expecting 'false' but found " + _local3));
};
break;
case "n":
_local4 = ((("n" + this.nextChar()) + this.nextChar()) + this.nextChar());
if (_local4 == "null"){
_local1.type = JSONTokenType.NULL;
_local1.value = null;
this.nextChar();
} else {
this.parseError(("Expecting 'null' but found " + _local4));
};
break;
case "\"":
_local1 = this.readString();
break;
default:
if (((this.isDigit(this.ch)) || ((this.ch == "-")))){
_local1 = this.readNumber();
} else {
if (this.ch == ""){
return (null);
};
this.parseError((("Unexpected " + this.ch) + " encountered"));
};
};
return (_local1);
}
private function readString():JSONToken{
var _local3:String;
var _local4:int;
var _local1:JSONToken = new JSONToken();
_local1.type = JSONTokenType.STRING;
var _local2 = "";
this.nextChar();
while (((!((this.ch == "\""))) && (!((this.ch == ""))))) {
if (this.ch == "\\"){
this.nextChar();
switch (this.ch){
case "\"":
_local2 = (_local2 + "\"");
break;
case "/":
_local2 = (_local2 + "/");
break;
case "\\":
_local2 = (_local2 + "\\");
break;
case "b":
_local2 = (_local2 + "\b");
break;
case "f":
_local2 = (_local2 + "\f");
break;
case "n":
_local2 = (_local2 + "\n");
break;
case "r":
_local2 = (_local2 + "\r");
break;
case "t":
_local2 = (_local2 + "\t");
break;
case "u":
_local3 = "";
_local4 = 0;
while (_local4 < 4) {
if (!this.isHexDigit(this.nextChar())){
this.parseError((" Excepted a hex digit, but found: " + this.ch));
};
_local3 = (_local3 + this.ch);
_local4++;
};
_local2 = (_local2 + String.fromCharCode(parseInt(_local3, 16)));
break;
default:
_local2 = (_local2 + ("\\" + this.ch));
};
} else {
_local2 = (_local2 + this.ch);
};
this.nextChar();
};
if (this.ch == ""){
this.parseError("Unterminated string literal");
};
this.nextChar();
_local1.value = _local2;
return (_local1);
}
private function readNumber():JSONToken{
var _local1:JSONToken = new JSONToken();
_local1.type = JSONTokenType.NUMBER;
var _local2 = "";
if (this.ch == "-"){
_local2 = (_local2 + "-");
this.nextChar();
};
if (!this.isDigit(this.ch)){
this.parseError("Expecting a digit");
};
if (this.ch == "0"){
_local2 = (_local2 + this.ch);
this.nextChar();
if (this.isDigit(this.ch)){
this.parseError("A digit cannot immediately follow 0");
};
} else {
while (this.isDigit(this.ch)) {
_local2 = (_local2 + this.ch);
this.nextChar();
};
};
if (this.ch == "."){
_local2 = (_local2 + ".");
this.nextChar();
if (!this.isDigit(this.ch)){
this.parseError("Expecting a digit");
};
while (this.isDigit(this.ch)) {
_local2 = (_local2 + this.ch);
this.nextChar();
};
};
if ((((this.ch == "e")) || ((this.ch == "E")))){
_local2 = (_local2 + "e");
this.nextChar();
if ((((this.ch == "+")) || ((this.ch == "-")))){
_local2 = (_local2 + this.ch);
this.nextChar();
};
if (!this.isDigit(this.ch)){
this.parseError("Scientific notation number needs exponent value");
};
while (this.isDigit(this.ch)) {
_local2 = (_local2 + this.ch);
this.nextChar();
};
};
var _local3:Number = Number(_local2);
if (((isFinite(_local3)) && (!(isNaN(_local3))))){
_local1.value = _local3;
return (_local1);
};
this.parseError((("Number " + _local3) + " is not valid!"));
return (null);
}
private function nextChar():String{
return ((this.ch = this.jsonString.charAt(this.loc++)));
}
private function skipIgnored():void{
var _local1:int;
do {
_local1 = this.loc;
this.skipWhite();
this.skipComments();
} while (_local1 != this.loc);
}
private function skipComments():void{
if (this.ch == "/"){
this.nextChar();
switch (this.ch){
case "/":
do {
this.nextChar();
} while (((!((this.ch == "\n"))) && (!((this.ch == "")))));
this.nextChar();
break;
case "*":
this.nextChar();
while (true) {
if (this.ch == "*"){
this.nextChar();
if (this.ch == "/"){
this.nextChar();
break;
};
} else {
this.nextChar();
};
if (this.ch == ""){
this.parseError("Multi-line comment not closed");
};
};
break;
default:
this.parseError((("Unexpected " + this.ch) + " encountered (expecting '/' or '*' )"));
};
};
}
private function skipWhite():void{
while (this.isWhiteSpace(this.ch)) {
this.nextChar();
};
}
private function isWhiteSpace(_arg1:String):Boolean{
return ((((((((_arg1 == " ")) || ((_arg1 == "\t")))) || ((_arg1 == "\n")))) || ((_arg1 == "\r"))));
}
private function isDigit(_arg1:String):Boolean{
return ((((_arg1 >= "0")) && ((_arg1 <= "9"))));
}
private function isHexDigit(_arg1:String):Boolean{
var _local2:String = _arg1.toUpperCase();
return (((this.isDigit(_arg1)) || ((((_local2 >= "A")) && ((_local2 <= "F"))))));
}
public function parseError(_arg1:String):void{
throw (new JSONParseError(_arg1, this.loc, this.jsonString));
}
}
}//package com.adobe.serialization.json
Section 67
//JSONTokenType (com.adobe.serialization.json.JSONTokenType)
package com.adobe.serialization.json {
public class JSONTokenType {
public static const UNKNOWN:int = -1;
public static const COMMA:int = 0;
public static const LEFT_BRACE:int = 1;
public static const RIGHT_BRACE:int = 2;
public static const LEFT_BRACKET:int = 3;
public static const RIGHT_BRACKET:int = 4;
public static const COLON:int = 6;
public static const TRUE:int = 7;
public static const FALSE:int = 8;
public static const NULL:int = 9;
public static const STRING:int = 10;
public static const NUMBER:int = 11;
}
}//package com.adobe.serialization.json
Section 68
//IntUtil (com.adobe.utils.IntUtil)
package com.adobe.utils {
public class IntUtil {
private static var hexChars:String = "0123456789abcdef";
public static function rol(_arg1:int, _arg2:int):int{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
public static function ror(_arg1:int, _arg2:int):uint{
var _local3:int = (32 - _arg2);
return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3))));
}
public static function toHex(_arg1:int, _arg2:Boolean=false):String{
var _local4:int;
var _local5:int;
var _local3 = "";
if (_arg2){
_local4 = 0;
while (_local4 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> (((3 - _local4) * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> ((3 - _local4) * 8)) & 15))));
_local4++;
};
} else {
_local5 = 0;
while (_local5 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> ((_local5 * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> (_local5 * 8)) & 15))));
_local5++;
};
};
return (_local3);
}
}
}//package com.adobe.utils
Section 69
//APIConnector (com.newgrounds.components.APIConnector)
package com.newgrounds.components {
import com.newgrounds.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class APIConnector extends MovieClip {
public var errorDialog:MovieClip;
public var background:MovieClip;
public var viewLatestButton:SimpleButton;
public var closeButton:SimpleButton;
public var viewAuthorizedButton:SimpleButton;
private var _initialized:Boolean;
private var _movieId:String;
private var _encryptionKey:String;
private var _movieVersion:String;
private var _showConnectingPopup:Boolean;// = true
private var _useErrorPopup:Boolean;// = true
private var _medalPopup:MedalPopup;
private var _popDelay:Timer;
public function APIConnector(){
this._popDelay = new Timer(3000, 1);
super();
addFrameScript(0, this.frame1, 6, this.frame7, 7, this.frame8);
if (((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent")))){
return;
};
this.useErrorPopup = true;
this.useMedalPopup = true;
this._popDelay.addEventListener(TimerEvent.TIMER, this.errorTimerHandler);
addEventListener(Event.ENTER_FRAME, this.enterFrameHandler);
if (stage){
addEventListener(Event.RENDER, this.renderHandler);
stage.invalidate();
} else {
this.clear();
};
}
public function get movieId():String{
return (this._movieId);
}
public function set movieId(_arg1:String):void{
this._movieId = _arg1;
}
public function get encryptionKey():String{
return (this._encryptionKey);
}
public function set encryptionKey(_arg1:String):void{
this._encryptionKey = _arg1;
}
public function get movieVersion():String{
return (this._movieVersion);
}
public function set movieVersion(_arg1:String):void{
this._movieVersion = _arg1;
}
public function get debugMode():Boolean{
return (API.debugMode);
}
public function set debugMode(_arg1:Boolean):void{
API.debugMode = true;
}
public function get useFakeSession():Boolean{
return (API.getFakeSession());
}
public function set useFakeSession(_arg1:Boolean):void{
API.setFakeSession(true);
}
public function get useMedalPopup():Boolean{
return (!((this._medalPopup == null)));
}
public function set useMedalPopup(_arg1:Boolean):void{
if (((_arg1) && (!(this._medalPopup)))){
this._medalPopup = new MedalPopup();
addChild(this._medalPopup);
} else {
if (((!(_arg1)) && (this._medalPopup))){
removeChild(this._medalPopup);
this._medalPopup = null;
};
};
}
public function get useErrorPopup():Boolean{
return (this._useErrorPopup);
}
public function set useErrorPopup(_arg1:Boolean):void{
this._useErrorPopup = _arg1;
API.addEventListener(APIEvent.API_CONNECTED, this.movieConnectedHandler);
if (this._useErrorPopup){
API.addEventListener(APIEvent.NEW_VERSION_AVAILABLE, this.newVersionAvailableHandler);
API.addEventListener(APIEvent.HOST_BLOCKED, this.hostBlockedHandler);
} else {
API.removeEventListener(APIEvent.NEW_VERSION_AVAILABLE, this.newVersionAvailableHandler);
API.removeEventListener(APIEvent.HOST_BLOCKED, this.hostBlockedHandler);
};
}
public function get showConnectingPopup():Boolean{
return (this._showConnectingPopup);
}
public function set showConnectingPopup(_arg1:Boolean):void{
this._showConnectingPopup = _arg1;
if (((!(_arg1)) && ((((currentLabel == "connecting")) || ((currentLabel == "connected")))))){
this.clear();
};
}
public function clear():void{
gotoAndStop("idle");
}
public function connect():void{
API.setVersion(this._movieVersion);
API.connect(root.loaderInfo, this._movieId, this._encryptionKey);
visible = true;
if (this.showConnectingPopup){
gotoAndStop("connecting");
};
}
private function renderHandler(_arg1:Event):void{
removeEventListener(Event.RENDER, this.renderHandler);
this.clear();
this.connect();
}
private function movieConnectedHandler(_arg1:APIEvent):void{
if (_arg1.success){
if (((((((API.isPublishedHost()) && (API.hostIsCompatible()))) && (!(API.hasUserSession())))) && (!(API.debugMode)))){
gotoAndStop("no_login");
this._popDelay.start();
visible = true;
} else {
if (this.showConnectingPopup){
gotoAndStop("connected");
};
};
} else {
gotoAndStop("no_connect");
this._popDelay.start();
visible = true;
};
}
private function newVersionAvailableHandler(_arg1:APIEvent):void{
gotoAndStop("new_version");
visible = true;
this.centerOnStage();
}
private function hostBlockedHandler(_arg1:APIEvent):void{
gotoAndStop("bad_host");
visible = true;
this.centerOnStage();
}
private function closeButtonClickHandler(_arg1:Event):void{
this.clear();
}
private function officialVersionClickHandler(_arg1:Event):void{
API.loadOfficialURL();
}
private function enterFrameHandler(_arg1:Event):void{
this.forceAlwaysOnTop();
}
private function initButtons():void{
if (this.viewLatestButton){
this.viewLatestButton.addEventListener(MouseEvent.CLICK, this.officialVersionClickHandler);
};
if (this.viewAuthorizedButton){
this.viewAuthorizedButton.addEventListener(MouseEvent.CLICK, this.officialVersionClickHandler);
};
if (this.closeButton){
this.closeButton.addEventListener(MouseEvent.CLICK, this.closeButtonClickHandler);
};
}
private function forceAlwaysOnTop():void{
var myIndex:uint;
var topIndex:uint;
if (((parent) && (visible))){
try {
myIndex = parent.getChildIndex(this);
topIndex = (parent.numChildren - 1);
if (myIndex != topIndex){
parent.setChildIndex(this, topIndex);
};
} catch(e:Error) {
};
};
}
private function centerOnStage():void{
if (stage){
x = (stage.stageWidth / 2);
y = (stage.stageHeight / 2);
};
}
private function errorTimerHandler(_arg1:TimerEvent):void{
if (this.errorDialog){
this.errorDialog.gotoAndPlay("closeme");
} else {
this.clear();
};
}
function frame1(){
stop();
}
function frame7(){
this.initButtons();
}
function frame8(){
this.initButtons();
}
}
}//package com.newgrounds.components
Section 70
//FlashAd (com.newgrounds.components.FlashAd)
package com.newgrounds.components {
import com.newgrounds.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class FlashAd extends Sprite {
public var background:MovieClip;
private var _showBackground:Boolean;
private var _adURLLoader:URLLoader;
private var _adRect:Sprite;
private var _mask:Shape;
private var _ad:Loader;
private static const DEBUG_AD_URL:String = "http://www.ngads.com/adtest.php";
private static const REMOVED_FROM_STAGE:String = "removedFromStage";
private static var _adResetTime:uint = 0;
private static var _adURL:URLRequest;
public function FlashAd(_arg1:Boolean=true){
if (((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent")))){
return;
};
Security.allowDomain("server.cpmstar.com");
this._adRect = new Sprite();
this._adRect.graphics.beginFill(0);
this._adRect.graphics.moveTo(0, 0);
this._adRect.graphics.lineTo(300, 0);
this._adRect.graphics.lineTo(300, 250);
this._adRect.graphics.lineTo(0, 250);
this._adRect.graphics.lineTo(0, 0);
this._adRect.graphics.endFill();
this._mask = new Shape();
this._mask.graphics.beginFill(0);
this._mask.graphics.moveTo(0, 0);
this._mask.graphics.lineTo(300, 0);
this._mask.graphics.lineTo(300, 250);
this._mask.graphics.lineTo(0, 250);
this._mask.graphics.lineTo(0, 0);
this._mask.graphics.endFill();
addChild(this._adRect);
this._adRect.addChild(this._mask);
this._adRect.visible = false;
x = Math.round(x);
y = Math.round(y);
scaleX = 1;
scaleY = 1;
if (this.background){
if (this.background.ngLinkButton){
this.background.ngLinkButton.addEventListener(MouseEvent.CLICK, this.linkClickHandler);
};
if (this.background.loadingClip){
this.background.loadingClip.visible = false;
};
};
if (API.isFlashVersion(9, 0, 28)){
addEventListener(REMOVED_FROM_STAGE, this.onRemovedFromStage);
};
if (API.adsApproved){
this.loadAdFeed(API.adFeedURL);
} else {
API.addEventListener(APIEvent.ADS_APPROVED, this.onAdsApproved, false, 0, true);
};
this.showBackground = _arg1;
}
public function get showBackground():Boolean{
return (this._showBackground);
}
public function set showBackground(_arg1:Boolean):void{
this._showBackground = _arg1;
if (this.background){
this.background.visible = _arg1;
this._adRect.mask = (_arg1) ? this.background.adMask : null;
};
}
public function removeAd():void{
removeEventListener(REMOVED_FROM_STAGE, this.onRemovedFromStage);
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = false;
};
if (this._adURLLoader){
try {
this._adURLLoader.close();
} catch(e:Error) {
};
};
if (this._adRect){
this._adRect.visible = false;
};
if (this._ad){
trace("[NewgroundsAPI] :: Ad removed");
try {
this._ad.close();
} catch(e:Error) {
};
try {
Object(this._ad).unloadAndStop(true);
} catch(e:Error) {
_ad.unload();
};
if (this._ad.parent){
this._ad.parent.removeChild(this._ad);
};
};
this._ad = null;
}
private function onAdsApproved(_arg1:APIEvent):void{
API.removeEventListener(APIEvent.ADS_APPROVED, this.onAdsApproved, false);
if (_arg1.success){
this.loadAdFeed(API.adFeedURL);
} else {
trace("[NewgroundsAPI] :: No ad feed URL supplied to Newgrounds API ad!");
};
}
private function loadAdFeed(_arg1:String):void{
var adFeedURL = _arg1;
this._adURLLoader = new URLLoader();
this._adURLLoader.addEventListener(Event.COMPLETE, this.onAdFeedLoaded);
this._adURLLoader.addEventListener(IOErrorEvent.IO_ERROR, this.onAdError);
this._adURLLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onAdError);
if (!adFeedURL){
trace("[Newgrounds API] :: Invalid feed URL!");
return;
};
if (this.hasAdElapsed){
if (adFeedURL.indexOf("?") > -1){
_adURL = new URLRequest(((adFeedURL + "&random=") + Math.random()));
} else {
_adURL = new URLRequest(((adFeedURL + "?random=") + Math.random()));
};
};
try {
this._adURLLoader.load(_adURL);
} catch(e:Error) {
onAdError(null);
};
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = true;
};
}
private function loadAd(_arg1:String):void{
var url = _arg1;
if (this._ad){
this.removeAd();
};
this._ad = new Loader();
this._ad.contentLoaderInfo.addEventListener(Event.COMPLETE, this.onAdLoaded);
this._ad.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, this.onAdError);
try {
Object(this._ad.contentLoaderInfo).uncaughtErrorEvents.addEventListener("uncaughtError", function (_arg1:Event):void{
});
} catch(error:Error) {
};
this._ad.load(new URLRequest(url), new LoaderContext(false, new ApplicationDomain(null)));
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = true;
};
}
private function onAdFeedLoaded(_arg1:Event):void{
var _local2:URLLoader = URLLoader(_arg1.target);
if (((_local2.data) && (!((_local2.data == ""))))){
this.loadAd((_local2.data as String));
} else {
dispatchEvent(new APIEvent(APIEvent.AD_ATTACHED, false, new APIError("FLASH_ADS_NOT_APPROVED", "Unable to render ad")));
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = false;
};
};
}
private function onAdFeedError(_arg1:Event):void{
trace("[NewgroundsAPI] :: Unable to load ad feed!");
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = false;
};
}
private function onAdError(_arg1:Event):void{
dispatchEvent(new APIEvent(APIEvent.AD_ATTACHED, false, new APIError("FLASH_ADS_NOT_APPROVED", "Unable to render ad")));
this.removeAd();
}
private function onAdLoaded(_arg1:Event):void{
this._adRect.addChild(this._ad);
this._ad.mask = this._mask;
this._adRect.visible = true;
if (this.background){
if (this._showBackground){
this._adRect.mask = this.background.adMask;
};
if (this.background.loadingClip){
this.background.loadingClip.visible = false;
};
};
trace("[NewgroundsAPI] :: Ad loaded!");
dispatchEvent(new APIEvent(APIEvent.AD_ATTACHED, true));
}
private function onRemovedFromStage(_arg1:Event):void{
this.removeAd();
}
private function get hasAdElapsed():Boolean{
if (getTimer() >= _adResetTime){
_adResetTime = (getTimer() + ((1000 * 60) * 5));
return (true);
};
return (false);
}
private function linkClickHandler(_arg1:MouseEvent):void{
API.loadNewgrounds();
}
}
}//package com.newgrounds.components
Section 71
//MedalPopup (com.newgrounds.components.MedalPopup)
package com.newgrounds.components {
import com.newgrounds.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.text.*;
public class MedalPopup extends MovieClip {
public var medalNameText:TextField;
public var medalValueText:TextField;
public var medalContainer:Sprite;
private var _initialized:Boolean;
private var _medal:Medal;
private var _medalIcon:Bitmap;
private var _medalQueue:Array;
private var _popDelay:Timer;
public function MedalPopup(){
this._medalQueue = [];
this._popDelay = new Timer(3000, 1);
super();
addFrameScript(0, this.frame1, 9, this.frame10, 18, this.frame19);
if (((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent")))){
return;
};
visible = false;
addEventListener(Event.ENTER_FRAME, this.enterFrameHandler);
stop();
API.addEventListener(APIEvent.MEDAL_UNLOCKED, this.onMedalUnlocked, false, 0, true);
this._popDelay.addEventListener(TimerEvent.TIMER, this.timerHandler);
}
public function get popupTime():Number{
return ((this._popDelay.delay / 1000));
}
public function set popupTime(_arg1:Number):void{
if (isNaN(_arg1)){
_arg1 = 3;
};
this._popDelay.delay = (_arg1 * 1000);
}
private function enterFrameHandler(_arg1:Event):void{
var myIndex:uint;
var topIndex:uint;
var event = _arg1;
if (((this._medalQueue.length) && (!(visible)))){
this._medal = this._medalQueue.pop();
this._popDelay.start();
gotoAndPlay("medal_show");
visible = true;
};
if (((visible) && (parent))){
try {
myIndex = parent.getChildIndex(this);
topIndex = (parent.numChildren - 1);
if (myIndex != topIndex){
parent.setChildIndex(this, topIndex);
};
} catch(error:Error) {
};
};
}
private function onMedalUnlocked(_arg1:APIEvent):void{
if (((((_arg1.success) && (_arg1.data))) && ((_arg1.data.medal is Medal)))){
this._medalQueue.push(Medal(_arg1.data.medal));
};
}
private function showMedalInfo():void{
if (!this._medal){
return;
};
if (this.medalContainer){
this._medalIcon = this._medal.createIconBitmap();
this.medalContainer.addChild(this._medalIcon);
};
if (this.medalNameText){
this.medalNameText.text = this._medal.name;
};
if (this.medalValueText){
this.medalValueText.text = (this._medal.value.toString() + "pts");
};
this._popDelay.start();
stop();
}
private function timerHandler(_arg1:TimerEvent):void{
if (((this._medalIcon) && (this._medalIcon.parent))){
this._medalIcon.parent.removeChild(this._medalIcon);
this._medalIcon = null;
};
gotoAndPlay("medal_hide");
this._popDelay.stop();
}
function frame1(){
stop();
}
function frame10(){
this.showMedalInfo();
stop();
}
function frame19(){
stop();
visible = false;
}
}
}//package com.newgrounds.components
Section 72
//API (com.newgrounds.API)
package com.newgrounds {
import flash.display.*;
import flash.events.*;
import com.newgrounds.components.*;
import flash.utils.*;
import com.adobe.serialization.json.*;
import flash.net.*;
import com.adobe.images.*;
import com.adobe.crypto.*;
import flash.system.*;
public class API {
public static const VERSION:String = "2.4.18";
private static const GATEWAY_URL:String = "http://www.ngads.com/gateway_v2.php";
private static const AD_TERMS_URL:String = "http://www.newgrounds.com/wiki/flashads/terms/";
private static const COMMANDS_WIKI_URL:String = "http://www.newgrounds.com/wiki/flashapi/commands/";
private static var do_echo:Boolean = false;
private static var _debug:Boolean = true;
private static var _connected:Boolean = false;
private static var _isMetadataLoaded:Boolean = false;
private static var _preloadComplete:Boolean = false;
private static var _adsApproved:Boolean = false;
private static var _saveGroupId:uint;
private static var _saveFileId:uint;
private static var _trackerId:uint;
private static var _movieId:String;
private static var _encryptionKey:String;
private static var _url:String;
private static var _host:String;
private static var connected:Boolean;
private static var version:String;
private static var ad_url:String;
private static var _fakeSession:Boolean = false;
private static var publisher_id:uint;
private static var session_id:String;
private static var user_email:String;
private static var user_name:String;
private static var user_id:uint;
private static var userpage_format:String;
private static var _medals:Array;
private static var timeoutTimer:Timer = new Timer(8000, 1);
private static var _userpageFormat:String;
private static var _scoreboards:Array = new Array();
private static var _bridge:Bridge;
private static var save_file:SaveFile;
private static var _imageFilePath:String;
private static var _saveFilePath:String;
private static var _saveGroups:Array = [];
private static var root:DisplayObject;
private static var _eventDispatcher:EventDispatcher = new EventDispatcher();
private static var score_page_counts:Object = new Object();
private static var compression_radix:String = "/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X";
private static var compressor:BaseN = new BaseN(compression_radix);
public static var errors:Dictionary = APIError.init_codes();
private static var sharedObjects:Dictionary = new Dictionary();
private static var _preloadAssets:Array = [];
public static var periods:Object = getPeriodAliases();
private static var period_aliases:Object = {t:{name:"Today", alias:"TODAY"}, p:{name:"Yesterday", alias:"YESTERDAY"}, w:{name:"This Week", alias:"THIS_WEEK"}, m:{name:"This Month", alias:"THIS_MONTH"}, y:{name:"This Year", alias:"THIS_YEAR"}, a:{name:"All-Time", alias:"ALL_TIME"}};
private static var secureCommand:String;
public static function get adFeedURL():String{
return (ad_url);
}
public static function get preloadComplete():Boolean{
return (_preloadComplete);
}
private static function assertConnected():Boolean{
if (!_connected){
return (false);
};
return (true);
}
public static function setVersion(_arg1:String):void{
if (((_arg1) && (!((_arg1 == ""))))){
version = _arg1;
};
}
public static function setUserEmail(_arg1:String):void{
user_email = _arg1;
}
public static function setFakeSession(_arg1:Boolean):void{
_fakeSession = _arg1;
}
public static function getFakeSession():Boolean{
return (_fakeSession);
}
public static function get debugMode():Boolean{
return (_debug);
}
public static function set debugMode(_arg1:Boolean):void{
_debug = _arg1;
}
public static function getTrackerID():uint{
return (_trackerId);
}
public static function getUserID():uint{
return (user_id);
}
public static function getUserName():String{
return (user_name);
}
public static function isConnected():Boolean{
return (_connected);
}
public static function getID():uint{
return (_trackerId);
}
public static function getOfficialURL():String{
var _local1:String = ((((((GATEWAY_URL + "?tracker_id=") + _movieId) + "&command_id=") + getCommandID("loadOfficalVersion")) + "&seed=") + Math.random());
if (debugMode){
_local1 = (_local1 + "&debug=1");
};
return (_local1);
}
public static function get adsApproved():Boolean{
return (_adsApproved);
}
public static function hasUserSession():Boolean{
return (((((!((session_id == null))) && (!((session_id == ""))))) && (!((publisher_id == 0)))));
}
public static function isNewgrounds():Boolean{
return ((((publisher_id == 1)) || (((_host) && ((_host.toLowerCase().indexOf("ungrounded.net") > -1))))));
}
public static function hostIsCompatible():Boolean{
return (!((publisher_id == 0)));
}
public static function hasUserEmail():Boolean{
return (((!((user_email == null))) && (!((user_email == "")))));
}
public static function connectionTimeOut(_arg1:Event=null):void{
dispatchEvent(new APIEvent(APIEvent.API_CONNECTED, false, new APIError("CONNECTION_FAILED", "Connection to NewgroundsAPI gateway timed out.")));
}
public static function connect(_arg1:LoaderInfo, _arg2:String, _arg3:String=null):void{
var loaderInfo = _arg1;
var m_id = _arg2;
var encrypt_key = _arg3;
if (!loaderInfo){
fatalError("Null loaderInfo paremeter passed in to connectMovie!", "");
return;
};
try {
if (loaderInfo.loader){
loaderInfo = loaderInfo.loader.loaderInfo;
};
} catch(error:Error) {
};
_url = loaderInfo.url;
_host = _url;
if ((((_host.indexOf("http://") > -1)) || ((_host.indexOf("https://") > -1)))){
_host = _host.split("/")[2].toLowerCase();
} else {
_host = "localhost";
};
var flashVars:Object = loaderInfo.parameters;
if (isPublishedHost()){
debugMode = false;
};
if (((!(debugMode)) && (flashVars))){
if (flashVars.NewgroundsAPI_UserName){
user_name = flashVars.NewgroundsAPI_UserName;
};
if (flashVars.NewgroundsAPI_UserID){
user_id = flashVars.NewgroundsAPI_UserID;
};
if (flashVars.NewgroundsAPI_PublisherID){
publisher_id = flashVars.NewgroundsAPI_PublisherID;
} else {
publisher_id = 0;
};
if (flashVars.NewgroundsAPI_UserpageFormat){
_userpageFormat = flashVars.NewgroundsAPI_UserpageFormat;
};
if (flashVars.NewgroundsAPI_SessionID){
session_id = flashVars.NewgroundsAPI_SessionID;
};
if (flashVars.NewgroundsAPI_SaveGroupID){
_saveGroupId = flashVars.NewgroundsAPI_SaveGroupID;
};
if (flashVars.NewgroundsAPI_SaveFileID){
_saveFileId = flashVars.NewgroundsAPI_SaveFileID;
};
if (flashVars.NewgroundsAPI_SandboxID){
_bridge = new Bridge(flashVars.NewgroundsAPI_SandboxID);
};
} else {
publisher_id = 1;
if (_fakeSession){
session_id = "D3bu64p1U53R";
user_id = 10;
user_name = "API-Debugger";
};
};
if (connected){
fatalError("NewgroundsAPI.connect() - connection already in progress", "connect");
return;
};
timeoutTimer.start();
if (!m_id){
fatalError("NewgroundsAPI.connectMovie() - missing required movieId parameter", "connectMovie");
};
_movieId = String(m_id);
_trackerId = uint(_movieId.substring(0, _movieId.indexOf(":")));
_encryptionKey = encrypt_key;
connected = true;
sendCommand("connectMovie", {host:getHost(), movie_version:version});
}
private static function getHost():String{
return (_host);
}
public static function isPublishedHost():Boolean{
return (((!((getHost() == "localhost"))) && ((getHost().indexOf("file://") == -1))));
}
public static function loadUserPage(_arg1:uint=0, _arg2:String=null):Boolean{
var _local3:String;
if ((((_arg1 == 0)) && ((_arg2 == null)))){
if (hasUserSession()){
_arg1 = user_id;
_arg2 = user_name;
} else {
return (false);
};
};
if (publisher_id == 1){
_local3 = (("http://" + _arg2.toLowerCase()) + ".newgrounds.com");
navigateToURL(new URLRequest(_local3), "_blank");
return (true);
};
if (userpage_format){
_local3 = userpage_format;
_local3 = _local3.split(":user_id:").join(_arg1.toString());
_local3 = _local3.split(":user_name:").join(escape(_arg2));
navigateToURL(new URLRequest(_local3), "_blank");
return (true);
};
return (false);
}
public static function loadNewgrounds():void{
sendCommand("loadNewgrounds", {host:getHost()}, true);
}
public static function loadOfficialURL():void{
navigateToURL(new URLRequest(getOfficialURL()));
}
public static function loadMySite():void{
sendCommand("loadMySite", {host:getHost()}, true);
}
public static function loadCustomLink(_arg1:String):void{
sendCommand("loadCustomLink", {host:getHost(), link:_arg1}, true);
}
public static function logCustomEvent(_arg1:String):void{
sendCommand("logCustomEvent", {host:getHost(), event:_arg1});
}
public static function getScoreBoard(_arg1:String):ScoreBoard{
var _local2:ScoreBoard;
for each (_local2 in _scoreboards) {
if (_local2.name == _arg1){
return (_local2);
};
};
return (null);
}
public static function getScoreBoardById(_arg1:uint):ScoreBoard{
var _local2:ScoreBoard;
for each (_local2 in _scoreboards) {
if (_local2.id == _arg1){
return (_local2);
};
};
return (null);
}
public static function postScore(_arg1:String, _arg2:uint, _arg3:String=""):void{
if (((!(_arg1)) || ((_arg1 == "")))){
sendError({command_id:getCommandID("postScore")}, new APIError("MISSING_PARAM", "missing required parameter(s)"));
return;
};
if (_arg3 == null){
_arg3 = "";
};
sendSecureCommand("postScore", {user_name:user_name, board:_arg1, value:_arg2, publisher_id:publisher_id, tag:_arg3});
}
public static function loadScores(_arg1:String, _arg2:String=null, _arg3:String=null):void{
var _local4 = "loadScores";
var _local5:ScoreBoard = getScoreBoard(_arg1);
if (((!(_local5)) || (!(_local5.id)))){
sendError({command_id:getCommandID(_local4)}, new APIError("MISSING_PARAM", "missing required ScoreBoard instance"));
return;
};
var _local6:Object = {};
_local6.publisher_id = publisher_id;
if (_arg2){
_local6.period = _arg2;
} else {
_local6.period = _local5.period;
};
_local6.board = _local5.id;
_local6.num_results = _local5.num_results;
_local6.page = _local5.page;
if (((!(_arg3)) || ((_arg3 == "")))){
_local6.tag = _local5.tag;
} else {
_local6.tag = _arg3;
};
sendCommand(_local4, _local6);
}
public static function loadScoresInRange(_arg1:String, _arg2:String="All-Time", _arg3:uint=1, _arg4:uint=10):void{
if (((!(_arg1)) || ((_arg1 == "")))){
sendError({command_id:getCommandID("postScore")}, new APIError("MISSING_PARAM", "missing required parameter(s)"));
return;
};
var _local5:ScoreBoard = getScoreBoard(_arg1);
if (_local5){
_local5.loadScoresInRange(_arg2, _arg3, _arg4);
} else {
sendWarning((("loadScoresInRange: Scoreboard " + _arg1) + " could not be found."));
};
}
private static function populateMedals(_arg1:Array):void{
var _local2:uint;
var _local3:Object;
if (_medals === null){
_medals = new Array();
_local2 = 0;
while (_local2 < _arg1.length) {
_local3 = _arg1[_local2];
_medals.push(Medal.createFromObject(_local3));
_local2++;
};
};
sendMessage("Medals loaded!");
}
private static function populateSaveGroups(_arg1:Array):void{
var _local3:SaveGroup;
_saveGroups = [];
var _local2:uint;
while (_local2 < _arg1.length) {
_local3 = SaveGroup.createFromObject(_arg1[_local2]);
_saveGroups.push(_local3);
_local2++;
};
}
private static function populateScoreBoards(_arg1:Array):void{
_scoreboards = [];
var _local2:uint;
while (_local2 < _arg1.length) {
_scoreboards.push(new ScoreBoard(_arg1[_local2].id, _arg1[_local2].name, ""));
_local2++;
};
}
public static function getMedals():Array{
return (_medals);
}
public static function getMedalById(_arg1:uint):Medal{
var _local2:Medal;
for each (_local2 in _medals) {
if (_local2.id == _arg1){
return (_local2);
};
};
return (null);
}
public static function getMedal(_arg1:String):Medal{
var _local2:Medal;
for each (_local2 in _medals) {
if (_local2.name == _arg1){
return (_local2);
};
};
return (null);
}
public static function unlockMedal(_arg1:String):void{
var _local3:Object;
var _local4:Object;
if (((!(_arg1)) || ((_arg1 == "")))){
sendError({command_id:getCommandID("unlockMedal")}, new APIError("MISSING_PARAM", "missing required medal name"));
return;
};
var _local2:Medal = getMedal(_arg1);
if (!_local2){
sendMessage(("No medal with name: " + _arg1));
return;
};
if (((hasUserSession()) || (debugMode))){
sendMessage((("Attempting to unlock '" + _local2.name) + "'"));
if (_local2.unlocked){
sendWarning((("Medal '" + _local2.name) + "' is already unlocked!"));
return;
};
_local3 = new Object();
_local3.medal_id = _local2.id;
sendSecureCommand("unlockMedal", _local3);
} else {
sendMessage(("Locally unlocking " + _local2.name));
if (_local2.unlocked){
sendWarning((("Medal '" + _local2.name) + "' is already unlocked!"));
return;
};
_local2.unlocked = true;
_local4 = loadLocal("medals_unlocked");
if (!_local4){
_local4 = new Object();
};
_local4[_local2.id.toString()] = true;
saveLocal("medals_unlocked", _local4);
callListener(APIEvent.UNLOCK_MEDAL, true, {medal:_local2});
};
}
public static function loadMedals():void{
if (_medals){
dispatchEvent(new APIEvent(APIEvent.MEDALS_LOADED, true, {medals:getMedals()}));
return;
};
var _local1:Object = new Object();
if (hasUserSession()){
_local1.publisher_id = publisher_id;
_local1.user_id = user_id;
};
sendCommand("getMedals", _local1);
}
public static function saveLocal(_arg1:String, _arg2:Object, _arg3:uint=0):void{
var sharedObj:SharedObject;
var save_id = _arg1;
var save_data = _arg2;
var size_allocation = _arg3;
try {
if (!sharedObjects[save_id]){
sharedObjects[save_id] = SharedObject.getLocal(((("ng_ap_secure_" + _trackerId) + "_") + save_id));
};
sharedObj = sharedObjects[save_id];
sharedObj.data[save_id] = encodeData(save_data);
sharedObj.flush();
} catch(e:Error) {
sendWarning(("saveLocal ERROR: " + e));
};
}
public static function loadLocal(_arg1:String):Object{
var sharedObj:SharedObject;
var save_id = _arg1;
try {
if (!sharedObjects[save_id]){
sharedObjects[save_id] = SharedObject.getLocal(((("ng_ap_secure_" + _trackerId) + "_") + save_id));
};
sharedObj = sharedObjects[save_id];
if (((((sharedObj) && (sharedObj.data))) && (sharedObj.data[save_id]))){
return (decodeData(sharedObj.data[save_id]));
} else {
return (null);
};
} catch(e:Error) {
sendWarning(("loadLocal ERROR: " + e));
};
return (null);
}
public static function encodeData(_arg1:Object):String{
return (compressHex(RC4.encrypt(JSON.encode(_arg1), _encryptionKey)));
}
public static function decodeData(_arg1:String){
return (JSON.decode(RC4.decrypt(uncompressHex(_arg1), _encryptionKey)));
}
private static function compressHex(_arg1:String):String{
var _local2:uint = (_arg1.length % 6);
var _local3 = "";
var _local4:uint;
while (_local4 < _arg1.length) {
_local3 = (_local3 + compressor.encode(uint(("0x" + _arg1.substr(_local4, 6))), 4));
_local4 = (_local4 + 6);
};
return ((_local2.toString() + _local3));
}
private static function uncompressHex(_arg1:String):String{
var _local4:uint;
var _local6:String;
var _local7:uint;
var _local8:String;
var _local2:uint = uint(_arg1.charAt(0));
var _local3 = "";
var _local5:uint = 1;
while (_local5 < _arg1.length) {
_local6 = _arg1.substr(_local5, 4);
_local7 = uint(compressor.decode(_local6));
_local8 = _local7.toString(16);
if ((_local5 + 4) < _arg1.length){
_local4 = 6;
} else {
_local4 = _local2;
};
while (_local8.length < _local4) {
_local8 = ("0" + _local8);
};
_local3 = (_local3 + _local8);
_local5 = (_local5 + 4);
};
return (_local3);
}
public static function getSaveGroupById(_arg1:uint):SaveGroup{
if (((!(_saveGroups)) || ((_saveGroups.length < 1)))){
sendWarning("No save groups found");
return (null);
};
var _local2:uint;
while (_local2 < _saveGroups.length) {
if (_saveGroups[_local2].id == _arg1){
return (_saveGroups[_local2]);
};
_local2++;
};
return (null);
}
public static function getSaveGroup(_arg1:String):SaveGroup{
if (((!(_saveGroups)) || ((_saveGroups.length < 1)))){
sendWarning("No save groups found");
return (null);
};
var _local2:uint;
while (_local2 < _saveGroups.length) {
if (_saveGroups[_local2].name == _arg1){
return (_saveGroups[_local2]);
};
_local2++;
};
return (null);
}
public static function getCurrentSaveFile(){
return (save_file);
}
public static function setCurrentSaveFile(_arg1:SaveFile){
save_file = _arg1;
}
public static function newSaveQuery(_arg1:String):SaveGroupQuery{
var _local2:SaveGroup = getSaveGroup(_arg1);
if (_local2){
return (_local2.newQuery());
};
return (null);
}
public static function executeSaveQuery(_arg1:SaveGroupQuery):void{
sendCommand("lookupSaveFiles", {publisher_id:publisher_id, group_id:_arg1.groupId, query:JSON.encode(_arg1.toObject())}, false, null, _arg1);
}
public static function lookupSaveFiles(_arg1:SaveGroup):void{
var _local2:SaveGroupQuery = _arg1.getQuery(false);
sendCommand("lookupSaveFiles", {publisher_id:publisher_id, group_id:_arg1.id, query:_local2.toObject()}, false, null, _local2);
}
public static function checkFilePrivledges(_arg1:SaveFile):void{
sendCommand("checkFilePrivs", {group:_arg1.groupId, filename:_arg1.name, user_id:(user_id) ? user_id : 0, publisher_id:publisher_id});
}
public static function newSaveFile(_arg1:String):SaveFile{
var _local2:SaveGroup = getSaveGroup(_arg1);
if (_local2){
return (new SaveFile(_local2));
};
sendError({command_id:"newSaveFile"}, new APIError("INVALID_SAVE_GROUP", (("'" + _local2) + "' is not a valid save group.")));
return (null);
}
public static function saveFile(_arg1:SaveFile, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local4:Object = _arg1.toObject();
_local4.user_name = user_name;
if (_arg1.id){
_local4.save_id = _arg1.id;
};
_local4.overwrite = (_arg2) ? 1 : 0;
if (_arg3){
_local4.draft = 1;
};
var _local5:ByteArray = new ByteArray();
if ((_arg1.contents is ByteArray)){
_local5.writeByte(0);
_local5.writeBytes(_arg1.contents);
} else {
_local5.writeByte(1);
_local5.writeObject(_arg1.contents);
};
_local5.compress();
var _local6:Object = new Object();
_local6.file = _local5;
if (_arg1.thumbnail){
_local6.thumbnail = PNGEncoder.encode(_arg1.thumbnail);
};
save_file = _arg1;
sendSecureCommand("saveFile", _local4, null, _local6, _arg1);
}
public static function rateSaveFile(_arg1:SaveFile, _arg2:SaveRating, _arg3:Number):void{
sendSecureCommand("rateSaveFile", {group:_arg1.groupId, save_id:_arg1.id, rating_id:_arg2.id, vote:_arg3, user_id:user_id}, null, null, _arg1);
}
public static function loadSaveFile(_arg1:Number, _arg2:Boolean=true){
var _local3:Object = {publisher_id:publisher_id, save_id:_arg1, get_contents:_arg2};
save_file = null;
sendCommand("loadSaveFile", _local3);
}
public static function loadFilesByDate(_arg1:String, _arg2:Boolean=true, _arg3:String=null, _arg4=null):void{
var _local7:*;
var _local5:SaveGroup = getSaveGroup(_arg1);
if (!_local5){
_local7 = new APIError("QUERY_INCOMPLETE", "The query could not be preformed, check the spelling of your save group name.");
sendError({command_id:"loadFilesByDate"}, _local7);
return;
};
var _local6:SaveGroupQuery = _local5.newQuery();
if (_arg3){
_local6.addKeyCondition(_arg3, "=", _arg4);
};
_local6.sortOn(SaveGroupQuery.CREATED_ON, _arg2);
_local6.execute();
}
public static function loadFilesByViews(_arg1:String, _arg2:Boolean=true, _arg3:String=null, _arg4=null):void{
var _local7:*;
var _local5:SaveGroup = getSaveGroup(_arg1);
if (!_local5){
_local7 = new APIError("QUERY_INCOMPLETE", "The query could not be preformed, check the spelling of your save group name.");
sendError({command_id:"loadFilesByViews"}, _local7);
return;
};
var _local6:SaveGroupQuery = _local5.newQuery();
if (_arg3){
_local6.addKeyCondition(_arg3, "=", _arg4);
};
_local6.sortOn(SaveGroupQuery.TOTAL_VIEWS, _arg2);
_local6.execute();
}
public static function loadFilesByRating(_arg1:String, _arg2:String, _arg3:Boolean=true, _arg4:String=null, _arg5=null):void{
var _local8:*;
var _local6:SaveGroup = getSaveGroup(_arg1);
if (!_local6){
_local8 = new APIError("QUERY_INCOMPLETE", "The query could not be preformed, check the spelling of your save group name.");
sendError({command_id:"loadFilesByDate"}, _local8);
return;
};
var _local7:SaveGroupQuery = _local6.newQuery();
if (_arg4){
_local7.addKeyCondition(_arg4, "=", _arg5);
};
_local7.sortOnRating(_arg2, _arg3);
_local7.execute();
}
public static function onRemoteAuthentication(_arg1:String){
var _local2:Object = JSON.decode(RC4.decrypt(_arg1, _encryptionKey));
user_id = _local2.NewgroundsAPI_UserID;
user_name = _local2.NewgroundsAPI_UserName;
session_id = _local2.NewgroundsAPI_SessionID;
publisher_id = _local2.NewgroundsAPI_PublisherID;
}
private static function doEvent(_arg1:Object):void{
var _local2:String;
var _local3:Object;
var _local4:String;
var _local5:Boolean;
var _local6:ScoreBoard;
var _local7:Array;
var _local8:*;
var _local9:String;
var _local10:Medal;
var _local11:SaveGroup;
var _local12:Object;
var _local13:Object;
var _local14:Object;
var _local15:SaveFile;
var _local16:uint;
var _local17:Object;
var _local18:uint;
var _local19:APIError;
var _local20:Object;
switch (getCommandName(_arg1.command_id)){
case "connectMovie":
timeoutTimer.stop();
if (_arg1.success){
sendMessage("You have successfully connected to the Newgrounds API Gateway");
sendMessage((("Movie identified as \"" + _arg1.movie_name) + "\""));
callListener(APIEvent.API_CONNECTED, _arg1.success, {title:_arg1.movie_name});
} else {
callListener(APIEvent.API_CONNECTED, _arg1.success, {});
return;
};
_local5 = false;
if (_arg1.ad_status === -1){
_local2 = "This movie was not approved to run Flash Ads.";
sendWarning(_local2);
sendWarning((("visit " + AD_TERMS_URL) + " to view our approval guidelines"));
if (!_arg1.ad_url){
callListener(APIEvent.ADS_APPROVED, false, new APIError("FLASH_ADS_NOT_APPROVED", _local2));
} else {
_local5 = true;
};
} else {
if (_arg1.ad_status === 0){
_local2 = "Flash Ads are currently awaiting approval.";
sendNotice(_local2);
if (!_arg1.ad_url){
callListener(APIEvent.ADS_APPROVED, false, new APIError("FLASH_ADS_NOT_APPROVED", _local2));
} else {
_local5 = true;
};
};
};
if (_arg1.ad_url){
ad_url = unescape(_arg1.ad_url);
if (!_local5){
sendMessage("This movie has been approved to run Flash Ads!");
};
_adsApproved = true;
callListener(APIEvent.ADS_APPROVED, true);
};
if (_arg1.deny_host){
_local2 = (getHost() + " does not have permission to run this movie!");
sendWarning(_local2);
sendWarning(("\tUpdate your API configuration to unblock " + getHost()));
callListener(APIEvent.HOST_BLOCKED, true, {real_url:unescape(_arg1.movie_url), url:getOfficialURL()});
};
if (_arg1.movie_version){
sendWarning("According to your API Configuration, this version is out of date.");
if (version){
sendWarning(("\tThe this movie is version " + version));
};
sendWarning(("\tThe most current version is " + _arg1.movie_version));
callListener(APIEvent.NEW_VERSION_AVAILABLE, true, {version:_arg1.movie_version, real_url:unescape(_arg1.movie_url), url:getOfficialURL()});
};
if (_arg1.request_portal_url){
sendCommand("setPortalID", {portal_url:_url});
};
sendCommand("preloadSettings", {publisher_id:publisher_id, user_id:user_id});
break;
case "preloadSettings":
if (_arg1.medals){
populateMedals(_arg1.medals);
if (((!(hasUserSession())) && (!(debugMode)))){
echo("Checking for SharedObject Medals...");
_local8 = loadLocal("medals_unlocked");
if (_local8){
for (_local9 in _local8) {
if (_local8[_local9]){
_local10 = getMedalById(uint(_local9));
echo(("Now unlocking " + _local10.name));
_local10.unlocked = true;
};
};
};
};
};
if (_arg1.save_groups){
populateSaveGroups(_arg1.save_groups);
};
if (_arg1.save_file_path){
_saveFilePath = (_arg1.save_file_path + "/");
};
if (_arg1.image_file_path){
_imageFilePath = (_arg1.image_file_path + "/");
};
if (_arg1.score_boards){
populateScoreBoards(_arg1.score_boards);
};
sendMessage("Metadata loaded!");
callListener(APIEvent.METADATA_LOADED, _arg1.success);
if (((_saveFileId) && (_saveGroupId))){
_local11 = getSaveGroupById(_saveGroupId);
if (_local11){
callListener(APIEvent.FILE_REQUESTED, true, {save_id:_saveFileId, group:_local11});
};
};
_preloadComplete = true;
break;
case "logCustomEvent":
if (_arg1.success){
sendMessage((("Event '" + _arg1.event) + "' was logged."));
};
callListener(APIEvent.EVENT_LOGGED, _arg1.success, {event:_arg1.event});
break;
case "postScore":
if (_arg1.success){
_local4 = "User";
if (user_email){
_local4 = user_email;
} else {
if (user_name){
_local4 = user_name;
};
};
_local6 = getScoreBoardById(_arg1.board);
if (_local6){
sendMessage((((((_local4 + " posted ") + _arg1.value) + " to '") + _local6.name) + "'"));
};
if (_arg1.best_scores){
_local12 = {today:_arg1.best_scores.D, yesterday:_arg1.best_scores.P, week:_arg1.best_scores.W, year:_arg1.best_scores.Y, all_time:_arg1.best_scores.A};
} else {
_local12 = {};
};
if (_arg1.best_ranks){
_local13 = {today:_arg1.best_ranks.D, yesterday:_arg1.best_ranks.P, week:_arg1.best_ranks.W, year:_arg1.best_ranks.Y, all_time:_arg1.best_ranks.A};
} else {
_local13 = {};
};
if (_arg1.num_scores){
_local14 = {today:_arg1.num_scores.D, yesterday:_arg1.num_scores.P, week:_arg1.num_scores.W, year:_arg1.num_scores.Y, all_time:_arg1.num_scores.A};
} else {
_local14 = {};
};
_local3 = {score:_arg1.score, value:_arg1.value, username:_local4, best_scores:_local12, best_ranks:_local13, num_scores:_local14};
};
callListener(APIEvent.SCORE_POSTED, _arg1.success, _local3);
break;
case "loadScores":
_local3 = new Object();
_local6 = getScoreBoardById(_arg1.board);
if (_local6){
_local6.setScores(_arg1.scores, _arg1.period, _arg1.page, _arg1.num_results, _arg1.num_scores);
};
callListener(APIEvent.SCORES_LOADED, _arg1.success, {board:_local6});
break;
case "unlockMedal":
if (_medals){
_local10 = getMedal(_arg1.medal_name);
if (_local10.unlocked){
return;
};
_local10.unlocked = true;
callListener(APIEvent.MEDAL_UNLOCKED, _arg1.success, {medal_id:_local10.id, medal:_local10});
};
break;
case "getMedals":
if (_arg1.success){
populateMedals(_arg1.medals);
};
callListener(APIEvent.MEDALS_LOADED, _arg1.success, _local3);
break;
case "loadSaveFile":
if (_arg1.success){
_local11 = getSaveGroupById(_arg1.group_id);
_local15 = new SaveFile(_local11);
_local15.id = _arg1.file.save_id;
_local15.name = _arg1.file.filename;
_local15.fileUrl = (_saveFilePath + _arg1.file.file);
_local15.thumbnailUrl = (_imageFilePath + _arg1.file.thumb);
_local15.authorName = _arg1.file.user_name;
_local15.authorId = _arg1.file.user_id;
_local15.setStatus(_arg1.file.status);
_local15.description = _arg1.file.description;
_local15.setFileSize(_arg1.file.file_size);
if (((_arg1.file.keys) && (_arg1.file.keys.length))){
_local16 = 0;
while (_local16 < _arg1.file.keys.length) {
_local15.setKey(_arg1.file.keys[_local16].id, _arg1.file.keys[_local16].value);
_local16++;
};
};
if (((_arg1.file.ratings) && (_arg1.file.ratings.length))){
_local16 = 0;
while (_local16 < _arg1.file.ratings.length) {
_local15.setRating(_arg1.file.ratings[_local16].id, _arg1.file.ratings[_local16].votes, _arg1.file.ratings[_local16].score);
_local16++;
};
};
if (_arg1.get_contents){
_local15.loadContents();
};
};
save_file = _local15;
callListener(APIEvent.FILE_INITIALIZED, _arg1.success, {save_id:_local15.id, file:_local15});
break;
case "lookupSaveFiles":
_local7 = [];
if (((_arg1.success) && (_arg1.files))){
_local16 = 0;
while (_local16 < _arg1.files.length) {
_local17 = _arg1.files[_local16];
_local15 = new SaveFile(getSaveGroupById(_arg1.group_id));
_local15.name = _local17.filename;
_local15.id = _local17.save_id;
_local15.description = _local17.description;
_local15.thumbnailUrl = (_imageFilePath + _local17.thumb);
_local15.fileUrl = (_saveFilePath + _local17.file);
_local15.authorName = _local17.user_name;
_local15.authorId = _local17.user_id;
_local15.setStatus(_local17.status);
_local15.setFileSize(_local17.file_size);
if (((_local17.keys) && (_local17.keys.length))){
_local18 = 0;
while (_local18 < _local17.keys.length) {
_local15.setKey(_local17.keys[_local18].id, _local17.keys[_local18].value);
_local18++;
};
};
if (((_local17.ratings) && (_local17.ratings.length))){
_local18 = 0;
while (_local18 < _local17.ratings.length) {
_local15.setRating(_local17.ratings[_local18].id, _local17.ratings[_local18].votes, _local17.ratings[_local18].score);
_local18++;
};
};
_local7.push(_local15);
_local16++;
};
};
_arg1.owner.setResults(_local7);
_arg1.owner.dispatchEvent(new APIEvent(APIEvent.QUERY_COMPLETE, _arg1.success, {query:_arg1.owner}));
callListener(APIEvent.QUERY_COMPLETE, _arg1.success, {query:_arg1.owner});
break;
case "rateSaveFile":
_local15 = _arg1.owner;
_arg1.success = ((_arg1.success) && (!(_arg1.already_voted)));
if (_arg1.success){
_local15.setRating(_arg1.rating_id, _arg1.votes, _arg1.score);
};
_arg1.file = _local15;
if (_arg1.already_voted){
_local19 = new APIError("PERMISSION_DENIED", "You have already voted on this item today");
_local15.dispatchEvent(new APIEvent(APIEvent.VOTE_COMPLETE, _arg1.success, {error:_local19, file:_local15, save_id:_local15.id}));
callListener(APIEvent.VOTE_COMPLETE, _arg1.success, _arg1);
} else {
_local20 = _local15.getRating(_arg1.rating_id);
_local15.dispatchEvent(new APIEvent(APIEvent.VOTE_COMPLETE, _arg1.success, {rating:_local20, file:_local15, save_id:_local15.id}));
API.callListener(APIEvent.VOTE_COMPLETE, _arg1.success, {rating:_local20, file:_local15, save_id:_local15.id});
};
break;
case "saveFile":
_local3 = {};
if (_arg1.success){
_local3 = {save_id:_arg1.save_id, filename:_arg1.filename, file_url:_arg1.file_url, thumbnail:_arg1.thumbnail, icon:_arg1.icon};
SaveFile(_arg1.owner).fileSaved(_local3);
};
_arg1.owner.dispatchEvent(new APIEvent(APIEvent.FILE_SAVED, _arg1.success, {save_id:save_file.id, file:save_file}));
callListener(APIEvent.FILE_SAVED, _arg1.success, {save_id:save_file.id, file:save_file});
save_file = null;
break;
case "checkFilePrivs":
_local3 = {filename:_arg1.filename, folder:_arg1.folder, can_read:_arg1.can_read, can_write:_arg1.can_write};
callListener(APIEvent.FILE_PRIVS_LOADED, _arg1.success, _local3);
break;
};
}
public static function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:uint=0, _arg5:Boolean=false):void{
_eventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public static function hasEventListener(_arg1:String):Boolean{
return (_eventDispatcher.hasEventListener(_arg1));
}
public static function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_eventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
private static function dispatchEvent(_arg1:Event):void{
_eventDispatcher.dispatchEvent(_arg1);
echo(("Fired Event: " + _arg1.type));
}
static function callListener(_arg1:String, _arg2:Boolean=true, _arg3=undefined):void{
dispatchEvent(new APIEvent(_arg1, _arg2, _arg3));
if (_bridge){
_bridge.sendEvent(_arg1, {success:_arg2, data:_arg3});
};
}
private static function getCommandName(_arg1:String):String{
return (_arg1);
}
private static function getCommandID(_arg1:String):String{
return (_arg1);
}
private static function getPeriodAliases():Object{
var _local2:String;
var _local1:Object = new Object();
for (_local2 in period_aliases) {
_local1[period_aliases[_local2].alias] = _local2;
};
return (_local1);
}
public static function getPeriodName(_arg1:String):String{
var _local2:String;
for (_local2 in period_aliases) {
if (_local2 == _arg1){
return (period_aliases[_local2].name);
};
};
return (null);
}
public static function getPeriodAlias(_arg1:String):String{
var _local2:String;
for (_local2 in period_aliases) {
if (_local2 == _arg1){
return (period_aliases[_local2].alias);
};
};
return (null);
}
private static function sendError(_arg1:Object, _arg2:APIError):void{
var _local3:String = ((((("[NewgroundsAPI ERROR] :: " + getCommandName(_arg1.command_id)) + "() - ") + _arg2.name) + ":\n\t\t\t\t") + _arg2.message);
trace(_local3);
if (_bridge){
_bridge.sendEvent("trace", {data:_local3});
};
}
private static function sendWarning(_arg1:String, _arg2:String=null):void{
if (_arg2){
_arg1 = (_arg1 + ((("\n[NewgroundsAPI WARNING] :: \tSee " + COMMANDS_WIKI_URL) + _arg2.toLowerCase()) + " for additional information."));
};
trace(_arg1);
if (_bridge){
_bridge.sendEvent("trace", {data:_arg1});
};
}
private static function sendNotice(_arg1:String, _arg2:String=null):void{
var _local3:String;
if (_arg2){
_arg1 = (_arg1 + ((("\n[NewgroundsAPI NOTICE] :: \tSee " + COMMANDS_WIKI_URL) + _arg2.toLowerCase()) + " for additional information."));
};
trace(_arg1);
if (_bridge){
_bridge.sendEvent("trace", {data:_arg1});
};
}
private static function fatalError(_arg1:String, _arg2:String):void{
if (_arg2){
_arg1 = (_arg1 + ((("\n\tSee " + COMMANDS_WIKI_URL) + _arg2.toLowerCase()) + " for additional information."));
};
trace(("***ERROR*** class=API\n\n" + _arg1));
}
public static function openLoginPage(){
if (hasUserSession()){
return;
};
}
public static function sendSecureCommand(_arg1:String, _arg2:Object, _arg3:Object=null, _arg4:Object=null, _arg5=null):void{
if (((((!(debugMode)) && (!(hasUserSession())))) && (!(hasUserEmail())))){
sendError({command_id:getCommandID(_arg1)}, new APIError("IDENTIFICATION_REQUIRED", (("You must be logged in or provide an e-mail address ( using NewgroundsAPI.setUserEmail(\"name@domain.com\"); ) to use " + _arg1) + "().")));
return;
};
if (!_arg1){
fatalError("Missing command", "sendSecureCommand");
};
if (!_arg2){
fatalError("Missing secure_params", "sendSecureCommand");
};
if (!_arg3){
_arg3 = new Object();
};
var _local6 = "";
var _local7:uint;
while (_local7 < 16) {
_local6 = (_local6 + compression_radix.charAt(Math.floor((Math.random() * compression_radix.length))));
_local7++;
};
if (((debugMode) && (!(session_id)))){
_arg2.session_id = "";
} else {
_arg2.session_id = session_id;
};
_arg2.as_version = 3;
_arg2.user_email = user_email;
_arg2.publisher_id = publisher_id;
_arg2.seed = _local6;
_arg2.command_id = getCommandID(_arg1);
var _local8:String = MD5.hash(_local6);
var _local9:String = RC4.encrypt(JSON.encode(_arg2), _encryptionKey);
var _local10:String = (_local8 + _local9);
_arg3.secure = compressHex(_local10);
secureCommand = _arg1;
sendCommand("securePacket", _arg3, false, _arg4, _arg5);
}
public static function stopPendingCommands():void{
SmartURLLoader.closeAll();
}
private static function onCommandComplete(_arg1:Event):void{
var response:Object;
var error:APIError;
var e = _arg1;
var loader:SmartURLLoader = SmartURLLoader(e.target);
echo((("INPUT: \n" + loader.response) + "\n"));
var i:uint;
while (i < _preloadAssets.length) {
if (_preloadAssets[i] == loader){
_preloadAssets.splice(i, 1);
break;
};
i = (i + 1);
};
try {
response = JSON.decode(loader.response);
} catch(error:Error) {
};
if (!response){
response = {command_id:loader._command, success:false};
};
response.owner = loader.owner;
if (((!(response)) || (!(response.success)))){
if (response.command_id == "connectMovie"){
connected = false;
};
error = new APIError(response.error_code, response.error_msg);
sendError(response, error);
if (response.command_id){
doEvent(response);
};
} else {
doEvent(response);
};
}
private static function onCommandError(_arg1:Event):void{
var _local2:Object = {success:false};
var _local3:SmartURLLoader = SmartURLLoader(_arg1.target);
_local2.owner = _local3.owner;
var _local4:uint;
while (_local4 < _preloadAssets.length) {
if (_preloadAssets[_local4] == _local3){
_preloadAssets.splice(_local4, 1);
break;
};
_local4++;
};
if (_local3._command){
_local2.command_id = _local3._command;
if (_local2.command_id == "connectMovie"){
connected = false;
};
doEvent(_local2);
};
}
private static function sendCommand(_arg1:String, _arg2:Object, _arg3:Boolean=false, _arg4:Object=null, _arg5=null):void{
var _local7:String;
var _local8:String;
var _local9:String;
if (((!(connected)) && (!((_arg1 == "connectMovie"))))){
_local7 = (("NewgroundsAPI." + _arg1) + "() - NewgroundsAPI.connectMovie() must be called before this command can be called\n");
fatalError(_local7, "connectMovie");
};
var _local6:SmartURLLoader = new SmartURLLoader();
_local6.addVariable("command_id", getCommandID(_arg1));
_local6.addVariable("tracker_id", _movieId);
if (debugMode){
_local6.addVariable("debug", 1);
};
if (_arg2){
for (_local8 in _arg2) {
_local6.addVariable(_local8, _arg2[_local8]);
};
};
if (_arg4){
for (_local9 in _arg4) {
_local6.addFile(_local9, _arg4[_local9], _local9);
};
};
if (_arg3){
_local6.method = URLRequestMethod.GET;
} else {
_local6.method = URLRequestMethod.POST;
};
_local6.preventCache = true;
if (_arg3){
_local6.openBrowser = true;
_local6.method = URLRequestMethod.GET;
} else {
_local6.addEventListener(Event.COMPLETE, onCommandComplete);
_local6.addEventListener(IOErrorEvent.IO_ERROR, onCommandError);
_local6.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onCommandError);
_local6.method = URLRequestMethod.POST;
};
if (_arg2.secure){
_local6._command = secureCommand;
} else {
_local6._command = getCommandID(_arg1);
};
_local6.owner = _arg5;
_local6.load(GATEWAY_URL);
}
public static function isFlashVersion(_arg1:uint, _arg2:uint=0, _arg3:uint=0, _arg4:uint=0):Boolean{
var _local6:Array = Capabilities.version.split(" ")[1].split(",");
var _local7:Array = arguments;
var _local8:uint;
while (_local8 < _local7.length) {
_local6[_local8] = uint(_local6[_local8]);
_local8++;
};
_local8 = 0;
while (_local8 < _local7.length) {
if (_local6[_local8] > _local7[_local8]){
return (true);
};
if (_local6[_local8] < _local7[_local8]){
return (false);
};
_local8++;
};
return (true);
}
public static function createAd():FlashAd{
sendMessage("You may see a security sandbox violation. This is normal!");
return (new FlashAd());
}
public static function sendMessage(_arg1:String, _arg2:Boolean=false):void{
var _local3:String = ("[NewgroundsAPI] :: " + _arg1);
trace(_local3);
if (_bridge){
_bridge.sendEvent("trace", {data:_local3});
};
}
private static function echo(_arg1:String):void{
if (do_echo){
trace(_arg1);
};
}
}
}//package com.newgrounds
Section 73
//APIError (com.newgrounds.APIError)
package com.newgrounds {
import flash.utils.*;
public class APIError {
public var code:Number;// = 0
public var message:String;
public var name:String;
public var alias:String;
public static const aliases:Array = new Array("UNKNOWN_ERROR", "INVALID_API_ID", "MISSING_PARAM", "INVALID_STAT_ID", "INVALID_COMMAND_ID", "FLASH_ADS_NOT_APPROVED", "PERMISSION_DENIED", "IDENTIFICATION_REQUIRED", "INVALID_EMAIL_ADDRESS", "BANNED_USER", "SESSION_EXPIRED", "INVALID_SCORE", "INVALID_MEDAL", "INVALID_FOLDER", "FILE_NOT_FOUND", "SITE_ID_REQUIRED", "UPLOAD_IN_PROGRESS", "USER_CANCELLED", "CONFIRM_REQUEST", "CONNECTION_FAILED");
private static const always_caps:Array = new Array("API", "URL", "ID");
public static const error_codes:Object = init_codes();
public static const error_names:Object = init_names();
public function APIError(_arg1, _arg2:String){
if ((_arg1 is String)){
_arg1 = error_codes[_arg1];
} else {
if (!(_arg1 is uint)){
_arg1 = 0;
};
};
this.code = _arg1;
this.message = _arg2;
this.name = error_names[_arg1];
this.alias = aliases[_arg1];
}
public function isError():Boolean{
return (true);
}
public static function init_codes():Dictionary{
var _local1:Dictionary = new Dictionary();
var _local2:uint;
while (_local2 < aliases.length) {
_local1[aliases[_local2]] = _local2;
_local2++;
};
return (_local1);
}
private static function init_names():Array{
var _local3:Array;
var _local4:uint;
var _local5:String;
var _local1:Array = new Array();
var _local2:uint;
while (_local2 < aliases.length) {
_local3 = aliases[_local2].toLowerCase().split("_");
_local4 = 0;
while (_local4 < _local3.length) {
_local3[_local4] = (_local3[_local4].substr(0, 1).toUpperCase() + _local3[_local4].substr(1, _local3[_local4].length));
for each (_local5 in always_caps) {
if (_local3[_local4].toUpperCase() == _local5){
_local3[_local4] = _local3[_local4].toUpperCase();
};
};
_local4++;
};
_local1[_local2] = _local3.join(" ");
_local2++;
};
return (_local1);
}
}
}//package com.newgrounds
Section 74
//APIEvent (com.newgrounds.APIEvent)
package com.newgrounds {
import flash.events.*;
public class APIEvent extends Event {
private var _data;
private var _success:Boolean;
private var _target;
private var _error:APIError;
public static const API_CONNECTED:String = "movieConnected";
public static const ADS_APPROVED:String = "adsApproved";
public static const AD_ATTACHED:String = "adAttached";
public static const HOST_BLOCKED:String = "hostBlocked";
public static const NEW_VERSION_AVAILABLE:String = "newVersionAvailable";
public static const EVENT_LOGGED:String = "eventLogged";
public static const SCORE_POSTED:String = "scorePosted";
public static const SCORES_LOADED:String = "scoresLoaded";
public static const UNLOCK_MEDAL:String = "unlockMedal";
public static const MEDAL_UNLOCKED:String = "medalUnlocked";
public static const MEDALS_LOADED:String = "medalsLoaded";
public static const METADATA_LOADED:String = "metadataLoaded";
public static const FILE_PRIVS_LOADED:String = "filePrivsLoaded";
public static const FILE_SAVED:String = "fileSaved";
public static const FILE_LOADED:String = "fileLoaded";
public static const FILE_INITIALIZED:String = "fileInitialized";
public static const FILE_REQUESTED:String = "fileRequested";
public static const QUERY_COMPLETE:String = "queryComplete";
public static const VOTE_COMPLETE:String = "voteComplete";
public function APIEvent(_arg1:String, _arg2:Boolean=true, _arg3=undefined){
super(_arg1);
this._data = _arg3;
this._success = _arg2;
}
public function get success():Boolean{
return (this._success);
}
public function get data(){
return (this._data);
}
}
}//package com.newgrounds
Section 75
//BaseN (com.newgrounds.BaseN)
package com.newgrounds {
import flash.utils.*;
public class BaseN {
private var _hashIndex:String;
private var _hashVal:Dictionary;
private var _base:Number;
public function BaseN(_arg1:String=null){
if (_arg1){
this._hashIndex = _arg1;
} else {
this._hashIndex = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/";
};
this._base = this._hashIndex.length;
this._hashVal = new Dictionary();
var _local2:uint;
while (_local2 < this._base) {
this._hashVal[this._hashIndex.charAt(_local2)] = _local2;
_local2++;
};
}
public function encode(_arg1:Number, _arg2:uint=1):String{
var _local3:String = _arg1.toString();
var _local4 = "";
if (_local3.charAt(0) == "-"){
_local4 = "-";
_local3 = _local3.substring(1);
};
var _local5:Array = _local3.split(".", 2);
_local4 = (_local4 + this.baseNEncoder(_local5[0], _arg2));
if (_local5.length > 1){
_local4 = (_local4 + ("." + this.baseNEncoder(_local5[1])));
};
return (_local4);
}
public function decode(_arg1:String):Number{
var _local2 = "";
if (_arg1.charAt(0) == "-"){
_local2 = "-";
_arg1 = _arg1.substring(1);
};
var _local3:Array = _arg1.split(".", 2);
_local2 = (_local2 + this.baseNDecoder(_local3[0]));
if (_local3.length > 1){
_local2 = (_local2 + ".");
_local2 = (_local2 + this.baseNDecoder(_local3[1]));
};
return (Number(_local2));
}
private function baseNEncoder(_arg1:uint, _arg2:uint=1):String{
var _local3 = "";
var _local4:uint = _arg1;
while (_local4 != 0) {
_local3 = (this._hashIndex.charAt((_local4 % this._base)) + _local3);
_local4 = (_local4 / this._base);
};
if (_arg2){
while (_local3.length < _arg2) {
_local3 = (this._hashIndex.charAt(0) + _local3);
};
};
return (_local3);
}
private function baseNDecoder(_arg1:String):uint{
var _local2:uint;
var _local3:uint;
while (_local3 < _arg1.length) {
_local2 = (_local2 * this._base);
_local2 = (_local2 + this._hashVal[_arg1.charAt(_local3)]);
_local3++;
};
return (_local2);
}
}
}//package com.newgrounds
Section 76
//Bridge (com.newgrounds.Bridge)
package com.newgrounds {
import flash.events.*;
import flash.net.*;
public class Bridge {
private var _inConnection:LocalConnection;
private var _outConnection:LocalConnection;
private var _widgetId:String;
public function Bridge(_arg1:String){
this._widgetId = _arg1;
this._inConnection = new LocalConnection();
this._outConnection = new LocalConnection();
this._inConnection.client = this;
this._inConnection.connect(("rec_" + this._widgetId));
this._outConnection.addEventListener(StatusEvent.STATUS, this.onStatus);
}
public function sendCommand(_arg1:String, _arg2:Object):void{
if (this._outConnection){
this._outConnection.send(this._widgetId, "sendCommand", _arg1, this.scrubParameters(_arg2));
};
}
public function sendEvent(_arg1:String, _arg2:Object):void{
if (this._outConnection){
this._outConnection.send(this._widgetId, "sendEvent", _arg1, this.scrubParameters(_arg2));
};
}
public function receiveEvent(_arg1:String, _arg2:Object):void{
API.callListener(_arg1, _arg2.success, _arg2.data);
}
public function scrubParameters(_arg1:Object):Object{
var _local3:String;
var _local2:Object = new Object();
for (_local3 in _arg1) {
if ((((((((((_arg1[_local3] is String)) || ((_arg1[_local3] is Number)))) || ((_arg1[_local3] is uint)))) || ((_arg1[_local3] is int)))) || ((_arg1[_local3] is Boolean)))){
_local2[_local3] = _arg1[_local3];
};
};
return (_local2);
}
private function onStatus(_arg1:Event):void{
}
}
}//package com.newgrounds
Section 77
//Medal (com.newgrounds.Medal)
package com.newgrounds {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class Medal {
private var _id:uint;
private var _name:String;
private var _value:uint;
private var _difficultyId:uint;
private var _unlocked:Boolean;// = false
private var _iconUrl:URLRequest;
private var _iconLoader:Loader;
private var _icon:BitmapData;
private static const DEFAULT_ICON:BitmapData = new BitmapData(50, 50, false, 0);
private static const DIFFICULT_NAMES:Array = [null, "Easy", "Moderate", "Challenging", "Difficult", "Brutal"];
public function Medal(_arg1:uint, _arg2:String, _arg3:uint, _arg4:uint, _arg5:Boolean, _arg6:String){
var id = _arg1;
var name = _arg2;
var value = _arg3;
var difficulty = _arg4;
var unlocked = _arg5;
var iconUrl = _arg6;
this._icon = DEFAULT_ICON;
super();
this._id = id;
this._name = name;
this._value = value;
this._difficultyId = difficulty;
this._unlocked = unlocked;
if (iconUrl){
this._iconUrl = new URLRequest(iconUrl);
this._iconLoader = new Loader();
this._iconLoader.contentLoaderInfo.addEventListener(Event.INIT, this.onIconLoaderInit);
this._iconLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, this.onIconLoaderError);
this._iconLoader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onIconLoaderError);
this._iconLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, this.onIconLoaderComplete);
try {
this._iconLoader.load(this._iconUrl, new LoaderContext(true));
} catch(e:Error) {
onIconLoaderError(null);
};
};
}
public function get difficulty():String{
return (DIFFICULT_NAMES[this._difficultyId]);
}
public function get difficultyId():uint{
return (this._difficultyId);
}
public function get icon():BitmapData{
return (this._icon);
}
public function get id():uint{
return (this._id);
}
public function get name():String{
return (this._name);
}
public function get unlocked():Boolean{
return (this._unlocked);
}
public function isUnlocked():Boolean{
return (this._unlocked);
}
public function set unlocked(_arg1:Boolean):void{
this._unlocked = _arg1;
}
public function get value():uint{
return (this._value);
}
public function get bytesLoaded():uint{
return ((this._iconLoader) ? this._iconLoader.contentLoaderInfo.bytesLoaded : 0);
}
public function get bytesTotal():uint{
return ((this._iconLoader) ? this._iconLoader.contentLoaderInfo.bytesTotal : 0);
}
public function getID():uint{
return (this._id);
}
public function getName():String{
return (this._name);
}
public function getValue():uint{
return (this._value);
}
public function getDifficulty():String{
return (DIFFICULT_NAMES[this._difficultyId]);
}
private function onIconLoaderInit(_arg1:Event):void{
}
private function onIconLoaderError(_arg1:IOErrorEvent):void{
trace((((("[NewgroundsAPI WARNING] :: Failed to load medal icon for " + this.name) + " (") + this._iconUrl.url.split("/").pop()) + ")"));
this._iconLoader.unload();
this._iconLoader = null;
}
private function onIconLoaderComplete(_arg1:Event):void{
var _local2:Bitmap = (this._iconLoader.content as Bitmap);
this._icon = _local2.bitmapData;
this._iconLoader.unload();
this._iconLoader = null;
}
public function unlock():void{
if (!this._unlocked){
API.unlockMedal(this._name);
};
}
public function createIconBitmap():Bitmap{
return (new Bitmap(this.icon));
}
public function toString():String{
return (this._name);
}
public static function createFromObject(_arg1:Object):Medal{
return (new Medal(_arg1.medal_id, _arg1.medal_name, _arg1.medal_value, _arg1.medal_difficulty, _arg1.medal_unlocked, _arg1.medal_icon));
}
}
}//package com.newgrounds
Section 78
//RC4 (com.newgrounds.RC4)
package com.newgrounds {
public class RC4 {
private static var sbox:Array = new Array(0xFF);
private static var mykey:Array = new Array(0xFF);
public static function encrypt(_arg1:String, _arg2:String):String{
var _local3:Array = strToChars(_arg1);
var _local4:Array = strToChars(_arg2);
var _local5:Array = calculate(_local3, _local4);
return (charsToHex(_local5));
}
public static function encryptbin(_arg1:String, _arg2:String):Array{
var _local3:Array = strToChars(_arg1);
var _local4:Array = strToChars(_arg2);
var _local5:Array = calculate(_local3, _local4);
return (_local5);
}
public static function decrypt(_arg1:String, _arg2:String):String{
var _local3:Array = hexToChars(_arg1);
var _local4:Array = strToChars(_arg2);
var _local5:Array = calculate(_local3, _local4);
return (charsToStr(_local5));
}
private static function initialize(_arg1:Array):void{
var _local3:uint;
var _local2:uint;
var _local4:uint = _arg1.length;
var _local5:uint;
while (_local5 <= 0xFF) {
mykey[_local5] = _arg1[(_local5 % _local4)];
sbox[_local5] = _local5;
_local5++;
};
_local5 = 0;
while (_local5 <= 0xFF) {
_local2 = (((_local2 + sbox[_local5]) + mykey[_local5]) % 0x0100);
_local3 = sbox[_local5];
sbox[_local5] = sbox[_local2];
sbox[_local2] = _local3;
_local5++;
};
}
private static function calculate(_arg1:Array, _arg2:Array):Array{
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local10:uint;
initialize(_arg2);
var _local3:uint;
var _local4:uint;
var _local5:Array = new Array();
var _local9:uint;
while (_local9 < _arg1.length) {
_local3 = ((_local3 + 1) % 0x0100);
_local4 = ((_local4 + sbox[_local3]) % 0x0100);
_local7 = sbox[_local3];
sbox[_local3] = sbox[_local4];
sbox[_local4] = _local7;
_local10 = ((sbox[_local3] + sbox[_local4]) % 0x0100);
_local6 = sbox[_local10];
_local8 = (_arg1[_local9] ^ _local6);
_local5.push(_local8);
_local9++;
};
return (_local5);
}
private static function charsToHex(_arg1:Array):String{
var _local2:String = new String("");
var _local3:Array = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
var _local4:uint;
while (_local4 < _arg1.length) {
_local2 = (_local2 + (_local3[(_arg1[_local4] >> 4)] + _local3[(_arg1[_local4] & 15)]));
_local4++;
};
return (_local2);
}
private static function hexToChars(_arg1:String):Array{
var _local2:Array = new Array();
var _local3:uint = ((_arg1.substr(0, 2))=="0x") ? 2 : 0;
while (_local3 < _arg1.length) {
_local2.push(parseInt(_arg1.substr(_local3, 2), 16));
_local3 = (_local3 + 2);
};
return (_local2);
}
private static function charsToStr(_arg1:Array):String{
var _local2:String = new String("");
var _local3:uint;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode(_arg1[_local3]));
_local3++;
};
return (_local2);
}
private static function strToChars(_arg1:String):Array{
var _local2:Array = new Array();
var _local3:uint;
while (_local3 < _arg1.length) {
_local2.push(_arg1.charCodeAt(_local3));
_local3++;
};
return (_local2);
}
}
}//package com.newgrounds
Section 79
//SaveFile (com.newgrounds.SaveFile)
package com.newgrounds {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class SaveFile extends EventDispatcher {
private var _filename:String;
private var _id:uint;
private var _description:String;
private var _contents;
private var _loader:SmartURLLoader;
private var _group:SaveGroup;
private var _keys:Dictionary;
private var _ratings:Dictionary;
private var _fileUrl:String;
private var _thumbnail:BitmapData;
private var _thumbnailUrl:String;
private var _authorId:uint;
private var _authorName:String;
private var _contentSize:uint;
private var _locked:Boolean;
private var _status:uint;
private var duplicate_id:uint;
private var _draft:Boolean;
public static const STATUS_PRIVATE = 1;
public static const STATUS_SHARED = 2;
public static const STATUS_UNAPPROVED = 3;
public static const STATUS_APPROVED = 4;
public function SaveFile(_arg1:SaveGroup){
this._keys = new Dictionary();
this._ratings = new Dictionary();
this._group = _arg1;
this._description = "";
}
public function get name():String{
return (this._filename);
}
public function set name(_arg1:String):void{
this._filename = _arg1;
}
public function get id():uint{
return (this._id);
}
public function set id(_arg1:uint):void{
this._id = _arg1;
}
public function get description():String{
return (this._description);
}
public function set description(_arg1:String):void{
this._description = _arg1;
}
public function get contents(){
return (this._contents);
}
public function set contents(_arg1):void{
this._contents = _arg1;
this._contentSize = 0;
}
public function get thumbnailUrl():String{
return (this._thumbnailUrl);
}
public function set thumbnailUrl(_arg1:String):void{
this._thumbnailUrl = _arg1;
}
public function get fileUrl():String{
return (this._fileUrl);
}
public function set fileUrl(_arg1:String):void{
this._fileUrl = _arg1;
}
public function get thumbnail():BitmapData{
return (this._thumbnail);
}
public function set thumbnail(_arg1:BitmapData):void{
if (this._thumbnail){
this._thumbnail.dispose();
};
this._thumbnail = _arg1.clone();
}
public function loadThumbnail():Loader{
var _local1:Loader = new Loader();
if (this._thumbnailUrl){
_local1.load(new URLRequest(this._thumbnailUrl));
};
return (_local1);
}
public function get bytesLoaded():uint{
return ((this._loader) ? this._loader.bytesLoaded : this._contentSize);
}
public function get bytesTotal():uint{
return (this._contentSize);
}
public function get status():uint{
return (this._status);
}
function setStatus(_arg1:uint):void{
this._status = _arg1;
}
public function get groupId():uint{
return (this._group.id);
}
public function get groupName():String{
return (this._group.name);
}
public function get groupType():uint{
return (this._group.type);
}
public function get authorName():String{
return (this._authorName);
}
public function set authorName(_arg1:String):void{
this._authorName = _arg1;
}
public function get authorId():uint{
return (this._authorId);
}
public function set authorId(_arg1:uint):void{
this._authorId = _arg1;
}
public function get draft():Boolean{
return (this._draft);
}
public function set draft(_arg1:Boolean):void{
this._draft = _arg1;
}
public function get locked():Boolean{
return (this._locked);
}
public function get shared():Boolean{
return ((this._status == STATUS_SHARED));
}
public function get isPrivate():Boolean{
return ((this._status == STATUS_PRIVATE));
}
public function get isPublic():Boolean{
if (this.isPrivate){
return (false);
};
if (((this._group.isType("SYSTEM")) || (this._group.isType("PRIVATE")))){
return (false);
};
if (this._group.isType("PUBLIC")){
return (true);
};
if (this.approved){
return (true);
};
return (false);
}
public function get approved():Boolean{
return ((this._status > STATUS_UNAPPROVED));
}
public function get keys():Dictionary{
return (this._keys);
}
public function get ratings():Dictionary{
return (this._ratings);
}
function setPermissions(_arg1:uint, _arg2:Boolean){
_arg2 = this._locked;
this._status = _arg1;
}
function setFileSize(_arg1:uint):void{
this._contentSize = _arg1;
}
public function isLocked():Boolean{
return (this._locked);
}
public function getDescription():String{
return (this._description);
}
public function getShared():Boolean{
return (this._draft);
}
public function getDuplicateID():uint{
return (this.duplicate_id);
}
public function getKeys():Dictionary{
return (this._keys);
}
public function getRatings():Dictionary{
return (this._ratings);
}
public function setKey(_arg1, _arg2):void{
var _local3:SaveKey;
if ((_arg1 is String)){
_local3 = this._group.getKeyName(_arg1);
} else {
_local3 = this._group.getKeyID(_arg1);
};
if (_local3){
switch (_local3.type){
case SaveKey.TYPE_BOOLEAN:
this._keys[_local3] = {id:_local3.id, value:Boolean(int(_arg2))};
break;
case SaveKey.TYPE_FLOAT:
this._keys[_local3] = {id:_local3.id, value:Number(_arg2)};
break;
case SaveKey.TYPE_INTEGER:
this._keys[_local3] = {id:_local3.id, value:int(_arg2)};
break;
case SaveKey.TYPE_STRING:
default:
this._keys[_local3] = {id:_local3.id, value:_arg2.toString()};
break;
};
};
}
public function getKey(_arg1){
var _local2:SaveKey;
if ((_arg1 is String)){
_local2 = this._group.getKeyName(_arg1);
} else {
_local2 = this._group.getKeyID(_arg1);
};
if (_local2){
return (this._keys[_local2]);
};
return (null);
}
public function setRating(_arg1, _arg2:Number, _arg3:Number):void{
var _local4:SaveRating;
if ((_arg1 is String)){
_local4 = this._group.getRatingName(_arg1);
} else {
_local4 = this._group.getRatingID(_arg1);
};
if (_local4){
this._ratings[_local4] = {id:_local4.id, name:_local4.name, votes:_arg2, score:_arg3};
};
}
public function getRating(_arg1):Object{
var _local2:SaveRating;
if ((_arg1 is String)){
_local2 = this._group.getRatingName(_arg1);
} else {
_local2 = this._group.getRatingID(_arg1);
};
if (_local2){
return (this._ratings[_local2]);
};
return (null);
}
public function sendRating(_arg1:String, _arg2:Number):void{
var _local3:SaveRating = this._group.getRatingName(_arg1);
if (!_local3){
trace((("[NewgroundsAPISaveFile] " + _arg1) + " is not a recognized save file"));
return;
};
if ((((_arg2 < _local3.minValue)) || ((_arg2 > _local3.maxValue)))){
trace(((("[NewgroundsAPISaveFile] Vote must be between " + _local3.minValue) + " and ") + _local3.maxValue));
return;
};
_local3.voted = true;
API.rateSaveFile(this, _local3, _arg2);
}
override public function toString():String{
var _local2:Object;
var _local3:Object;
var _local1 = (((((("Save File " + this._filename) + " ID: ") + this._id) + "\n ") + this._description) + "\n");
for each (_local2 in this._keys) {
_local1 = (_local1 + ((((" " + this._group.getKeyID(_local2.id).name) + ": ") + _local2.val) + "\n"));
};
for each (_local3 in this._ratings) {
_local1 = (_local1 + ((((((" " + this._group.getRatingID(_local3.id).name) + "\n Score: ") + _local3.score) + " Votes: ") + _local3.votes) + "\n"));
};
return (_local1);
}
public function toObject():Object{
var _local2:Object;
var _local1:Object = {group:this.groupId, filename:this.name, description:this.description, shared:true};
_local1.keys = [];
for each (_local2 in this._keys) {
_local1.keys.push({id:_local2.id, value:_local2.val});
};
return (_local1);
}
public function save(_arg1:Boolean=false, _arg2:Boolean=false):void{
API.saveFile(this, _arg1, _arg2);
}
public function loadContents():void{
if (this._fileUrl){
this._loader = new SmartURLLoader();
this._loader.responseFormat = URLLoaderDataFormat.BINARY;
this._loader.addEventListener(Event.COMPLETE, this.onContentsLoaded);
this._loader.addEventListener(IOErrorEvent.IO_ERROR, this.onContentsError);
this._loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onContentsError);
this._loader.load(this._fileUrl);
};
}
private function onContentsError(_arg1:Event):void{
this._loader = null;
dispatchEvent(new APIEvent(APIEvent.FILE_LOADED, false));
API.callListener(APIEvent.FILE_LOADED, false);
}
private function onContentsLoaded(_arg1:Event):void{
var _local2:ByteArray = _arg1.target.response;
this._contentSize = _local2.length;
_local2.uncompress();
var _local3:uint = _local2.readUnsignedByte();
if (_local3 == 0){
this._contents = new ByteArray();
this._contents.writeBytes(_local2, 1);
} else {
this._contents = _local2.readObject();
};
this._loader = null;
dispatchEvent(new APIEvent(APIEvent.FILE_LOADED, true, {file:this}));
API.callListener(APIEvent.FILE_LOADED, true, {file:this});
}
public function loadAuthorPage(){
API.loadUserPage(this._authorId, this._authorName);
}
function fileSaved(_arg1:Object):void{
this._id = _arg1.save_id;
this._thumbnailUrl = _arg1.thumbnail;
this._fileUrl = _arg1.file_url;
}
}
}//package com.newgrounds
Section 80
//SaveGroup (com.newgrounds.SaveGroup)
package com.newgrounds {
public class SaveGroup {
private var _name:String;
private var _id:uint;
private var _type:uint;
private var _keys:Array;
private var _ratings:Array;
private var _files:Array;
private var _query:SaveGroupQuery;
public static const TYPE_SYSTEM:uint = 0;
public static const TYPE_PRIVATE:uint = 1;
public static const TYPE_PUBLIC:uint = 2;
public static const TYPE_MODERATED:uint = 3;
public static const KEY_TYPES:Array = [null, "float", "integer", "string", "boolean"];
public static const TYPES:Object = {SYSTEM:0, PRIVATE:1, PUBLIC:2, MODERATED:3};
public function SaveGroup(_arg1:uint, _arg2:String, _arg3:uint){
this._name = _arg2;
this._id = _arg1;
this._type = _arg3;
this._ratings = [];
this._keys = [];
this._files = [];
this._query = new SaveGroupQuery(this);
}
public function get name():String{
return (this._name);
}
public function get id():uint{
return (this._id);
}
public function get type():uint{
return (this._type);
}
public function get keys():Array{
return (this._keys);
}
public function get ratings():Array{
return (this._ratings);
}
public function get group_id():uint{
return (this._id);
}
public function get group_name():String{
return (this._name);
}
public function addRating(_arg1:SaveRating):void{
this._ratings.push(_arg1);
}
function getRating(_arg1):SaveRating{
var _local2:uint;
while (_local2 < this._ratings.length) {
if ((((((((_arg1 is uint)) || ((_arg1 is int)))) || ((_arg1 is Number)))) && ((this._ratings[_local2].rating_id == _arg1)))){
return (this._ratings[_local2]);
};
if (this._ratings[_local2].name == _arg1){
return (this._ratings[_local2]);
};
_local2++;
};
return (null);
}
public function getRatingID(_arg1:uint):SaveRating{
var _local2:uint;
while (_local2 < this._ratings.length) {
if (this._ratings[_local2].id == _arg1){
return (this._ratings[_local2]);
};
_local2++;
};
return (null);
}
public function getRatingName(_arg1:String):SaveRating{
var _local2:uint;
while (_local2 < this._ratings.length) {
if (this._ratings[_local2].name == _arg1){
return (this._ratings[_local2]);
};
_local2++;
};
return (null);
}
public function addKey(_arg1:SaveKey):void{
this._keys.push(_arg1);
}
public function getKey(_arg1):SaveKey{
var _local2:uint;
while (_local2 < this._keys.length) {
if ((((((((_arg1 is Number)) || ((_arg1 is uint)))) || ((_arg1 is int)))) && ((this._keys[_local2].key_id == _arg1)))){
return (this._keys[_local2]);
};
if (this._keys[_local2].key_name == _arg1){
return (this._keys[_local2]);
};
_local2++;
};
return (null);
}
public function getKeyID(_arg1:uint):SaveKey{
var _local2:uint;
while (_local2 < this._keys.length) {
if (this._keys[_local2].id == _arg1){
return (this._keys[_local2]);
};
_local2++;
};
return (null);
}
public function getKeyType(_arg1:String, _arg2:Boolean=false){
var _local3:SaveKey = this.getKey(_arg1);
if (_local3){
return ((_arg2) ? KEY_TYPES[_local3.key_type] : _local3.key_type);
};
return (null);
}
public function getKeyName(_arg1:String):SaveKey{
var _local2:uint;
while (_local2 < this._keys.length) {
if (this._keys[_local2].name == _arg1){
return (this._keys[_local2]);
};
_local2++;
};
return (null);
}
public function isType(_arg1:String):Boolean{
return ((TYPES[this._type] == _arg1));
}
public function getID():uint{
return (this._id);
}
public function getName():String{
return (this._name);
}
public function getQuery(_arg1:Boolean=false){
return ((_arg1) ? this._query.toObject() : this._query);
}
public function newQuery():SaveGroupQuery{
return (new SaveGroupQuery(this));
}
public function newFile():SaveFile{
return (new SaveFile(this));
}
public function toString():String{
return ((((((("SaveGroup { name: " + this._name) + ", id: ") + this._id) + ", keys: ") + this._keys) + "}"));
}
public static function createFromObject(_arg1:Object):SaveGroup{
var _local4:Object;
var _local5:Object;
var _local2:SaveGroup = new SaveGroup(_arg1.group_id, _arg1.group_name, _arg1.group_type);
var _local3:uint;
while (_local3 < _arg1.keys.length) {
_local4 = _arg1.keys[_local3];
_local2.addKey(new SaveKey(_local4.id, _local4.name, _local4.type));
_local3++;
};
_local3 = 0;
while (_local3 < _arg1.ratings.length) {
_local5 = _arg1.ratings[_local3];
_local2.addRating(new SaveRating(_local5.id, _local5.name, _local5.float, _local5.min, _local5.max));
_local3++;
};
return (_local2);
}
}
}//package com.newgrounds
Section 81
//SaveGroupQuery (com.newgrounds.SaveGroupQuery)
package com.newgrounds {
import flash.events.*;
public class SaveGroupQuery extends EventDispatcher {
private var _group:SaveGroup;
private var _groupBy:Array;
private var _lookupKeys:Array;
private var _lookupRatings:Array;
private var _fileConditions:Array;
private var _keyConditions:Array;
private var _ratingConditions:Array;
private var _sortConditions:Array;
private var _page:uint;
private var _resultsPerPage:uint;
private var _randomizeResults:Boolean;
private var _results:Array;
public static const TABLE_FILES:uint = 1;
public static const TABLE_KEYS:uint = 2;
public static const TABLE_RATINGS:uint = 3;
public static const FILE_ID:uint = 0;
public static const AUTHOR_ID:uint = 1;
public static const AUTHOR_NAME:uint = 2;
public static const FILE_NAME:uint = 3;
public static const CREATED_ON:uint = 4;
public static const UPDATED_ON:uint = 5;
public static const TOTAL_VIEWS:uint = 6;
public static const FILE_STATUS:uint = 7;
public static const SCORE:String = "score";
public static const TOTAL_VOTES:String = "votes";
public function SaveGroupQuery(_arg1:SaveGroup){
this._results = [];
super();
this._group = _arg1;
this.reset();
}
public function clearCache():void{
this._results = [];
}
public function get group():SaveGroup{
return (this._group);
}
public function get groupId():uint{
return (this._group.id);
}
public function get resultsPerPage():uint{
return (this._resultsPerPage);
}
public function set resultsPerPage(_arg1:uint):void{
this._resultsPerPage = _arg1;
}
public function get page():uint{
return (this._page);
}
public function set page(_arg1:uint):void{
this._page = _arg1;
}
public function get randomized():Boolean{
return (this._randomizeResults);
}
public function set randomized(_arg1:Boolean):void{
this._randomizeResults = _arg1;
}
public function get results():Array{
return (this._results);
}
public function reset():void{
this._fileConditions = [];
this._keyConditions = [];
this._ratingConditions = [];
this._sortConditions = [];
this._groupBy = [];
this._lookupKeys = [];
this._lookupRatings = [];
this._randomizeResults = false;
this._resultsPerPage = 20;
this._page = 1;
this.clearCache();
}
function getGroup():SaveGroup{
return (this._group);
}
function getGroupID():uint{
return (this._group.getID());
}
public function includeKey(_arg1:String):void{
var _local2:SaveKey = this._group.getKeyName(_arg1);
if (_local2){
this._lookupKeys.push(_local2.id);
};
}
public function isRandomized():Boolean{
return (this._randomizeResults);
}
public function includeRating(_arg1:String):void{
var _local2:SaveRating = this._group.getRatingName(_arg1);
if (_local2){
this._lookupRatings.push(_local2.id);
};
}
public function excludeKey(_arg1:String):void{
var _local2:SaveKey = this._group.getKeyName(_arg1);
var _local3:uint;
while (_local3 < this._lookupKeys.length) {
if (this._lookupKeys[_local3] == _local2.id){
this._lookupKeys.splice(_local3, 1);
return;
};
_local3++;
};
}
public function excludeRating(_arg1:String):void{
var _local2:SaveRating = this._group.getRatingName(_arg1);
var _local3:uint;
while (_local3 < this._lookupRatings.length) {
if (this._lookupRatings[_local3] == _local2.id){
this._lookupRatings.splice(_local3, 1);
return;
};
_local3++;
};
}
public function groupBy(_arg1:uint):void{
this._groupBy.push({table:TABLE_FILES, field:_arg1});
}
public function groupByRating(_arg1:String):void{
var _local2:SaveRating = this._group.getRatingName(_arg1);
if (!_local2){
return;
};
this._groupBy.push({table:TABLE_RATINGS, field:_local2.id});
}
public function groupByKey(_arg1:String):void{
var _local2:SaveKey = this._group.getKeyName(_arg1);
if (!_local2){
return;
};
this._groupBy.push({table:TABLE_KEYS, field:_local2.id});
}
public function addFileCondition(_arg1:uint, _arg2:String, _arg3):void{
this._fileConditions.push({field:_arg1, operator:_arg2, value:_arg3});
}
public function addKeyCondition(_arg1:String, _arg2:String, _arg3):void{
var _local4:SaveKey = this._group.getKeyName(_arg1);
if (!_local4){
return;
};
if (!this.checkValue(_arg3, _local4.type)){
return;
};
this._keyConditions.push({key_id:_local4.id, operator:_arg2, value:_arg3});
}
public function addRatingCondition(_arg1:String, _arg2:String, _arg3, _arg4:String="score"):void{
var _local5:SaveRating = this._group.getRatingName(_arg1);
if (!_local5){
return;
};
this._ratingConditions.push({rating_id:_local5.id, operator:_arg2, value:_arg3, column:_arg4});
}
private function addSortCondition(_arg1:uint, _arg2:uint, _arg3:Boolean=false, _arg4=null):void{
var _local5:Object = {table:_arg1, field:_arg2, desc:_arg3};
if (_arg4){
_local5.extra = _arg4;
};
this._sortConditions.push(_local5);
}
public function sortOn(_arg1:uint, _arg2:Boolean=false):void{
this.addSortCondition(TABLE_FILES, _arg1, _arg2);
}
public function sortOnKey(_arg1:String, _arg2:Boolean=false):void{
this.addSortCondition(TABLE_KEYS, this._group.getKeyName(_arg1).id, _arg2);
}
public function sortOnRating(_arg1:String, _arg2:Boolean=false, _arg3:String="score"):void{
this.addSortCondition(TABLE_RATINGS, this._group.getRatingName(_arg1).id, _arg2, _arg3);
}
public function sortOnRatingScore(_arg1:String, _arg2:Boolean){
this.sortOnRating(_arg1, _arg2, SCORE);
}
public function sortOnRatingVotes(_arg1:String, _arg2:Boolean){
this.sortOnRating(_arg1, _arg2, TOTAL_VOTES);
}
public function setResultsPerPage(_arg1:uint){
this._resultsPerPage = _arg1;
this.clearCache();
}
public function setPage(_arg1:Number){
this._page = _arg1;
this.clearCache();
}
public function setRandomize(_arg1:Boolean):void{
this._randomizeResults = _arg1;
}
public function execute():void{
API.executeSaveQuery(this);
}
private function checkValue(_arg1, _arg2:uint):Boolean{
return (true);
}
function setResults(_arg1:Array):void{
this._results = _arg1;
}
override public function toString():String{
return ("");
}
public function toObject():Object{
var _local1:Object = {page:this._page, num_results:this._resultsPerPage};
if (this.isRandomized()){
_local1.randomize = 1;
};
if (((this._fileConditions) && ((this._fileConditions.length > 0)))){
_local1.file_conditions = this._fileConditions;
};
if (((this._keyConditions) && ((this._keyConditions.length > 0)))){
_local1.key_conditions = this._keyConditions;
};
if (((this._ratingConditions) && ((this._ratingConditions.length > 0)))){
_local1.rating_conditions = this._ratingConditions;
};
if (((this._sortConditions) && ((this._sortConditions.length > 0)))){
_local1.sort_conditions = this._sortConditions;
};
if (((this._lookupKeys) && ((this._lookupKeys.length > 0)))){
_local1.lookup_keys = this._lookupKeys;
};
if (((this._lookupRatings) && ((this._lookupRatings.length > 0)))){
_local1.lookup_ratings = this._lookupRatings;
};
if (((this._groupBy) && ((this._groupBy.length > 0)))){
_local1.group_by = this._groupBy;
};
return (_local1);
}
}
}//package com.newgrounds
Section 82
//SaveKey (com.newgrounds.SaveKey)
package com.newgrounds {
public class SaveKey {
private var _id:uint;
private var _name:String;
private var _type:uint;
public static const TYPE_FLOAT:uint = 1;
public static const TYPE_INTEGER:uint = 2;
public static const TYPE_STRING:uint = 3;
public static const TYPE_BOOLEAN:uint = 4;
public function SaveKey(_arg1:uint, _arg2:String, _arg3:uint){
this._id = _arg1;
this._name = _arg2;
this._type = _arg3;
}
public function get id():uint{
return (this._id);
}
public function get name():String{
return (this._name);
}
public function get type():uint{
return (this._type);
}
public function get key_id():uint{
return (this._id);
}
public function get key_name():String{
return (this._name);
}
public function get key_type():uint{
return (this._type);
}
public function isValueValid(_arg1):Boolean{
if (this._type == TYPE_INTEGER){
return ((((_arg1 is int)) || ((_arg1 is uint))));
};
if (this._type == TYPE_FLOAT){
return ((((((_arg1 is int)) || ((_arg1 is uint)))) || ((_arg1 is Number))));
};
if (this._type == TYPE_STRING){
return ((_arg1 is String));
};
if (this._type == TYPE_BOOLEAN){
return ((((((((_arg1 is Boolean)) || ((_arg1 === 0)))) || ((_arg1 === 1)))) || ((_arg1 == ""))));
};
return (false);
}
public function toString():String{
return (this._name);
}
}
}//package com.newgrounds
Section 83
//SaveRating (com.newgrounds.SaveRating)
package com.newgrounds {
public class SaveRating {
private var _id:uint;
private var _name:String;
private var _minValue:Number;
private var _maxValue:Number;
private var _isFloat:Boolean;
private var _voted:Boolean;
public function SaveRating(_arg1:uint, _arg2:String, _arg3:Boolean, _arg4:Number=-INF, _arg5:Number=INF){
this._id = _arg1;
this._name = _arg2;
this._isFloat = _arg3;
this._minValue = _arg4;
this._maxValue = _arg5;
}
public function get rating_id():uint{
return (this._id);
}
public function get rating_name():String{
return (this._name);
}
public function get id():uint{
return (this._id);
}
public function get name():String{
return (this._name);
}
public function get minValue():Number{
return (this._minValue);
}
public function get maxValue():Number{
return (this._maxValue);
}
public function get isFloat():Boolean{
return (this._isFloat);
}
public function get voted():Boolean{
return (this._voted);
}
public function set voted(_arg1:Boolean):void{
this._voted = _arg1;
}
public function toString():String{
return (this._name);
}
}
}//package com.newgrounds
Section 84
//Score (com.newgrounds.Score)
package com.newgrounds {
public class Score {
private var _board:ScoreBoard;
private var _position:uint;
private var _username:String;
private var _value:String;
private var _numeric_value:uint;
private var _tag:String;
public function Score(_arg1:ScoreBoard, _arg2:Number, _arg3:String, _arg4:String, _arg5:uint, _arg6:String){
this._board = _arg1;
this._position = _arg2;
this._username = _arg3;
this._value = _arg4;
this._numeric_value = _arg5;
this._tag = _arg6;
}
public function get board():ScoreBoard{
return (this._board);
}
public function get position():uint{
return (this._position);
}
public function get username():String{
return (this._username);
}
public function get value():String{
return (this._value);
}
public function get numeric_value():uint{
return (this._numeric_value);
}
public function get tag():String{
return (this._tag);
}
}
}//package com.newgrounds
Section 85
//ScoreBoard (com.newgrounds.ScoreBoard)
package com.newgrounds {
import flash.events.*;
public class ScoreBoard extends EventDispatcher {
private var _name:String;
private var _id:uint;
private var _scores:Array;
private var _period:String;// = "Today"
private var _num_results:uint;// = 10
private var _numScores:uint;
private var _desiredNumResults:uint;
private var _startRank:uint;
private var _endRank:uint;
private var _page:uint;// = 1
private var _tag:String;
public function ScoreBoard(_arg1:uint, _arg2:String, _arg3:String){
this._name = _arg2;
this._id = _arg1;
this._scores = [];
this._tag = _arg3;
}
public function exists():Boolean{
return ((this._id > 0));
}
public function get id():Number{
return (this._id);
}
public function get name():String{
return (this._name);
}
public function get period():String{
return (this._period);
}
public function get page():uint{
return (this._page);
}
public function get num_results():uint{
return (this._num_results);
}
public function get scores():Array{
return (this._scores);
}
public function get tag():String{
return (this._tag);
}
public function get num_scores():uint{
return (this._numScores);
}
public function postScore(_arg1:uint, _arg2:String=null):void{
if (_arg2){
this._tag = _arg2;
};
API.postScore(this._name, _arg1);
}
public function loadScores(_arg1:String="Today", _arg2:uint=1, _arg3:uint=10):void{
this._period = _arg1;
if (((!(this._period)) || ((this._period == "")))){
this._period = ScoreBoardPeriod.TODAY;
};
this._page = _arg2;
this._num_results = _arg3;
this._desiredNumResults = 0;
API.loadScores(this.name);
}
public function loadScoresInRange(_arg1:String="Today", _arg2:uint=1, _arg3:uint=10):void{
if (_arg2 == 0){
_arg2 = 1;
};
if (_arg3 < _arg2){
_arg3 = _arg2;
};
this._period = _arg1;
if (((!(this._period)) || ((this._period == "")))){
this._period = ScoreBoardPeriod.TODAY;
};
this._desiredNumResults = ((_arg3 - _arg2) + 1);
this._num_results = this._desiredNumResults;
while (int(((_arg2 - 1) / this._num_results)) != int(((_arg3 - 1) / this._num_results))) {
this._num_results++;
};
this._page = ((_arg2 - 1) / this._num_results);
this._startRank = _arg2;
this._endRank = _arg3;
this._page++;
API.loadScores(this.name);
}
function setScores(_arg1:Array, _arg2:String, _arg3:Number, _arg4:Number, _arg5:uint):void{
var _local7:uint;
this._period = _arg2;
this._page = _arg3;
this._num_results = _arg4;
this._numScores = _arg5;
this._scores = [];
var _local6:uint;
while (_local6 < _arg1.length) {
_local7 = (((this._num_results * (this._page - 1)) + 1) + _local6);
if (((!(this._desiredNumResults)) || ((((_local7 >= this._startRank)) && ((_local7 <= this._endRank)))))){
this._scores.push(new Score(this, _local7, _arg1[_local6].username, _arg1[_local6].value, _arg1[_local6].numeric_value, _arg1[_local6].tag));
};
_local6++;
};
this._num_results = this._scores.length;
}
}
}//package com.newgrounds
Section 86
//ScoreBoardPeriod (com.newgrounds.ScoreBoardPeriod)
package com.newgrounds {
public class ScoreBoardPeriod {
public static const TODAY:String = "Today";
public static const WEEK:String = "This Week";
public static const MONTH:String = "This Month";
public static const YEAR:String = "This Year";
public static const ALL_TIME:String = "All-Time";
}
}//package com.newgrounds
Section 87
//SmartURLLoader (com.newgrounds.SmartURLLoader)
package com.newgrounds {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.errors.*;
public class SmartURLLoader extends EventDispatcher {
private var _variables:Dictionary;
private var _files:Dictionary;
private var _hasVariables:Boolean;
private var _method:String;// = "GET"
private var _urlRequest:URLRequest;
private var _urlLoader:URLLoader;
private var _dataFormat:String;// = "text"
private var _openBrowser:Boolean;// = false
private var _preventCache:Boolean;// = false
var _command:String;
public var owner;
private static const CRLF:String = "
";
private static var _loaders:Dictionary = new Dictionary();
public function SmartURLLoader(){
this._urlRequest = new URLRequest();
this._variables = new Dictionary();
}
public function get responseFormat():String{
return (this._dataFormat);
}
public function set responseFormat(_arg1:String):void{
this._dataFormat = _arg1;
}
public function get response(){
return (this._urlLoader.data);
}
public function get hasFiles():Boolean{
return (Boolean(this._files));
}
public function get method():String{
return (this._method);
}
public function set method(_arg1:String):void{
if (((this.hasFiles) && ((_arg1 == URLRequestMethod.GET)))){
throw (new IllegalOperationError("GET cannot be used to upload files."));
};
this._method = _arg1;
}
public function get openBrowser():Boolean{
return (this._openBrowser);
}
public function set openBrowser(_arg1:Boolean):void{
this._openBrowser = _arg1;
}
public function get preventCache():Boolean{
return (this._preventCache);
}
public function set preventCache(_arg1:Boolean):void{
this._preventCache = _arg1;
}
public function get bytesLoaded():uint{
return ((this._urlLoader) ? this._urlLoader.bytesLoaded : 0);
}
public function get bytesTotal():uint{
return ((this._urlLoader) ? this._urlLoader.bytesTotal : 0);
}
public function addVariable(_arg1:String, _arg2=""):void{
this._variables[_arg1] = _arg2;
if (_arg2){
this._hasVariables = true;
};
}
public function addFile(_arg1:String, _arg2:ByteArray, _arg3:String, _arg4:String="application/octet-stream"):void{
this.method = URLRequestMethod.POST;
if (!this._files){
this._files = new Dictionary();
};
this._files[_arg1] = new File(_arg1, _arg2, _arg3, _arg4);
}
public function clearVariables():void{
this._variables = new Dictionary();
}
public function clearFiles():void{
this._files = null;
}
public function load(_arg1:String):void{
var urlVariables:URLVariables;
var key:String;
var boundary:String;
var i:uint;
var event:SecurityErrorEvent;
var url = _arg1;
this._urlRequest.url = url;
if (this._preventCache){
url = (url + ("?seed=" + Math.random()));
if (this._hasVariables){
url = (url + "&");
};
};
this._urlRequest.method = this._method;
if ((((this._urlRequest.method == URLRequestMethod.GET)) || (!(this.hasFiles)))){
this._urlRequest.contentType = "application/x-www-form-urlencoded";
if (this._hasVariables){
urlVariables = new URLVariables();
for (key in this._variables) {
urlVariables[key] = this._variables[key];
};
this._urlRequest.data = urlVariables;
};
} else {
boundary = "";
i = 0;
while (i < 32) {
boundary = (boundary + String.fromCharCode(uint((97 + (Math.random() * 25)))));
i = (i + 1);
};
this._urlRequest.contentType = (("multipart/form-data; boundary=\"" + boundary) + "\"");
this._urlRequest.data = this.buildMultipartData(boundary);
};
if (this.openBrowser){
navigateToURL(this._urlRequest, "_blank");
} else {
this._urlLoader = new URLLoader();
this._urlLoader.dataFormat = this._dataFormat;
this._urlLoader.addEventListener(Event.COMPLETE, this.onComplete);
this._urlLoader.addEventListener(ProgressEvent.PROGRESS, this.onProgress);
this._urlLoader.addEventListener(IOErrorEvent.IO_ERROR, this.onIOError);
this._urlLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, this.onHTTPStatus);
this._urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onSecurityError);
_loaders[this._urlLoader] = this;
try {
this._urlLoader.load(this._urlRequest);
} catch(error:Error) {
event = new SecurityErrorEvent(SecurityErrorEvent.SECURITY_ERROR, false, false, error.message);
onSecurityError(event);
};
};
}
public function close():void{
try {
this._urlLoader.close();
} catch(e:Error) {
};
}
public function dispose():void{
this.close();
this._files = null;
this._variables = null;
if (this._urlLoader){
this._urlLoader.removeEventListener(Event.COMPLETE, this.onComplete);
this._urlLoader.removeEventListener(ProgressEvent.PROGRESS, this.onProgress);
this._urlLoader.removeEventListener(IOErrorEvent.IO_ERROR, this.onIOError);
this._urlLoader.removeEventListener(HTTPStatusEvent.HTTP_STATUS, this.onHTTPStatus);
this._urlLoader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onSecurityError);
this._urlLoader = null;
};
this._urlRequest = null;
delete _loaders[this];
}
private function buildMultipartData(_arg1:String):ByteArray{
var _local3:String;
var _local4:File;
var _local2:ByteArray = new ByteArray();
_local2.endian = Endian.BIG_ENDIAN;
_arg1 = ("--" + _arg1);
for (_local3 in this._variables) {
_local2.writeUTFBytes((_arg1 + CRLF));
_local2.writeUTFBytes(((("Content-Disposition: form-data; name=\"" + _local3) + "\"") + CRLF));
_local2.writeUTFBytes(CRLF);
_local2.writeUTFBytes((this._variables[_local3] + CRLF));
};
if (this.hasFiles){
for each (_local4 in this._files) {
_local2.writeUTFBytes((_arg1 + CRLF));
_local2.writeUTFBytes(("Content-Disposition: form-data; name=\"Filename\"" + CRLF));
_local2.writeUTFBytes(CRLF);
_local2.writeUTFBytes((_local4.fileName + CRLF));
_local2.writeUTFBytes((_arg1 + CRLF));
_local2.writeUTFBytes(((((("Content-Disposition: form-data; name=\"" + _local4.dataField) + "\"; filename=\"") + _local4.fileName) + "\"") + CRLF));
_local2.writeUTFBytes((("Content-Type: " + _local4.contentType) + CRLF));
_local2.writeUTFBytes(CRLF);
_local2.writeBytes(_local4.data);
_local2.writeUTFBytes(CRLF);
};
_local2.writeUTFBytes((_arg1 + CRLF));
_local2.writeUTFBytes(("Content-Disposition: form-data; name=\"Upload\"" + CRLF));
_local2.writeUTFBytes(CRLF);
_local2.writeUTFBytes(("Submit Query" + CRLF));
};
_local2.writeUTFBytes((_arg1 + "--"));
_local2.position = 0;
_local2.position = 0;
return (_local2);
}
private function onComplete(_arg1:Event):void{
dispatchEvent(_arg1);
this.dispose();
}
private function onProgress(_arg1:ProgressEvent):void{
dispatchEvent(_arg1);
}
private function onIOError(_arg1:IOErrorEvent):void{
dispatchEvent(_arg1);
this.dispose();
}
private function onSecurityError(_arg1:SecurityErrorEvent):void{
dispatchEvent(_arg1);
this.dispose();
}
private function onHTTPStatus(_arg1:HTTPStatusEvent):void{
dispatchEvent(_arg1);
}
public static function closeAll():void{
var _local1:SmartURLLoader;
for each (_local1 in _loaders) {
if (_local1){
_local1.dispose();
};
};
_loaders = new Dictionary();
}
}
}//package com.newgrounds
import flash.utils.*;
class File {
private var fileName:String;
private var data:ByteArray;
private var dataField:String;
private var contentType:String;
private function File(_arg1:String, _arg2:ByteArray, _arg3:String="Filedata", _arg4:String="application/octet-stream"){
this.fileName = _arg1;
this.data = _arg2;
this.dataField = _arg3;
this.contentType = _arg4;
}
}
Section 88
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class AdLoader extends Sprite {
private var contentspotid:String;
private var cpmstarLoader:Loader;
public function AdLoader(contentspotid:String){
super();
this.contentspotid = contentspotid;
addEventListener(Event.ADDED, addedHandler);
}
private function addedHandler(event:Event):void{
var cpmstarViewSWFUrl:String;
var container:DisplayObjectContainer;
removeEventListener(Event.ADDED, addedHandler);
Security.allowDomain("server.cpmstar.com");
cpmstarViewSWFUrl = "http://server.cpmstar.com/adviewas3.swf";
container = parent;
cpmstarLoader = new Loader();
cpmstarLoader.contentLoaderInfo.addEventListener(Event.INIT, dispatchHandler);
cpmstarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dispatchHandler);
cpmstarLoader.load(new URLRequest(((cpmstarViewSWFUrl + "?contentspotid=") + contentspotid)));
addChild(cpmstarLoader);
}
private function dispatchHandler(event:Event):void{
dispatchEvent(event);
}
}
}//package CPMStar
Section 89
//Barrier (drops.Barrier)
package drops {
import levels.*;
public class Barrier extends Drop {
public var value:Number;
public function Barrier(x:Number, y:Number){
addFrameScript(0, frame1, 14, frame15);
super(x, y, Infinity, NaN);
}
function frame15(){
kill();
}
function frame1(){
stop();
}
override public function getItem(){
(root as Main).makeSound("shield", "i");
gotoAndPlay("die");
(parent as Level).player.getShield();
}
}
}//package drops
Section 90
//Buff (drops.Buff)
package drops {
import levels.*;
public class Buff extends Drop {
public function Buff(x:Number, y:Number){
addFrameScript(0, frame1, 14, frame15);
super(x, y, Infinity, NaN);
}
function frame15(){
kill();
}
function frame1(){
stop();
}
override public function getItem(){
(root as Main).makeSound("buff", "i");
gotoAndPlay("die");
(parent as Level).player.getBuff();
}
}
}//package drops
Section 91
//Drop (drops.Drop)
package drops {
import flash.display.*;
import levels.*;
import players.*;
public class Drop extends MovieClip {
public var dead:Boolean;// = false
public var yspeed:Number;// = 2
public var taken:Boolean;// = false
public var xspeed:Number;// = 0
var xness:Number;// = 1
public function Drop(x:Number, y:Number, angle:Number=INF, speed:Number=NaN){
xspeed = 0;
yspeed = 2;
taken = false;
dead = false;
xness = 1;
super();
if (angle != Infinity){
angle = (angle * (Math.PI / 180));
this.xspeed = (Math.cos(angle) * speed);
this.yspeed = ((Math.random() * 5) + 1);
};
this.x = x;
this.y = y;
Global.vars.dropArray.push(this);
cacheAsBitmap = true;
}
function hitStuff(){
if ((((parent as Level).player.hitTestPoint(this.x, this.y)) && (!(taken)))){
cacheAsBitmap = false;
taken = true;
getItem();
yspeed = 0;
xspeed = 0;
};
}
public function kill(){
dead = true;
taken = true;
Global.vars.dropArray.splice(Global.vars.dropArray.indexOf(this), 1);
stop();
parent.removeChild(this);
}
public function getItem(){
}
public function onFrame(){
if (!taken){
x = (x + xspeed);
y = (y + yspeed);
};
yspeed = (yspeed + 0.05);
xness = ((parent as Level).player.x - this.x);
if ((((xness > -50)) && ((xness <= 0)))){
xness = -200;
};
if ((((xness < 50)) && ((xness > 0)))){
xness = 200;
};
if (this.y < (parent as Level).player.y){
xspeed = (xspeed + (((800 * (parent as Level).player.magnet) / xness) / (((parent as Level).player.y - this.y) + 20)));
xspeed = (xspeed * 0.92);
} else {
xspeed = (xspeed * 0.96);
};
if (y > ((parent as Level).ylimit + 30)){
kill();
} else {
hitStuff();
};
}
}
}//package drops
Section 92
//Heart (drops.Heart)
package drops {
import levels.*;
public class Heart extends Drop {
public var value:Number;
public function Heart(x:Number, y:Number){
addFrameScript(0, frame1, 14, frame15);
super(x, y, Infinity, NaN);
}
function frame15(){
kill();
}
function frame1(){
stop();
}
override public function getItem(){
(root as Main).makeSound("heart", "i");
gotoAndPlay("die");
(parent as Level).player.getHeart();
}
}
}//package drops
Section 93
//Money (drops.Money)
package drops {
import levels.*;
public class Money extends Drop {
public var value:Number;
public function Money(x:Number, y:Number, type:Number, angle:Number=INF, speed:Number=NaN){
addFrameScript(17, frame18);
super(x, y, angle, speed);
if (type == 1){
value = 1;
gotoAndStop(1);
};
if (type == 2){
value = 2;
gotoAndStop(2);
};
if (type == 3){
value = 5;
gotoAndStop(3);
};
if (type == 4){
value = 10;
gotoAndStop(4);
};
if (type == 5){
value = 20;
gotoAndStop(5);
};
if (type == 6){
value = 30;
gotoAndStop(6);
};
if (type == 7){
value = 50;
gotoAndStop(7);
};
this.alpha = 0.55;
}
function frame18(){
kill();
}
override public function getItem(){
(root as Main).makeSound("money", "i");
gotoAndPlay("die");
(parent as Level).addMoney(value);
}
}
}//package drops
Section 94
//BigBrick (foes.BigBrick)
package foes {
public class BigBrick extends Foe {
var decel:Number;
public function BigBrick(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 5, frame6);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(Infinity);
score = 0;
money = 0;
dropRate = 0;
dropChance = 0;
cutoff = 100;
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
}
}//package foes
Section 95
//BigBush (foes.BigBush)
package foes {
import bullets.*;
public class BigBush extends Foe {
var decel:Number;
public function BigBush(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 20, frame21);
super(x, y, xspeed, yspeed, motion);
this.delay = type;
setHP(20);
score = 200;
money = 2;
dropRate = 1;
dropChance = 0.1;
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("bush2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("bush", "f");
}
function frame21(){
if (this){
kill();
};
}
override function special():Boolean{
if ((t % delay) == 0){
parent.addChild(new LeafBullet(x, y, NaN, NaN, (Math.random() * 360), 3));
};
return (false);
}
}
}//package foes
Section 96
//BigLog (foes.BigLog)
package foes {
import levels.*;
public class BigLog extends Foe {
var b:Number;// = 3
public function BigLog(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
b = 3;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 11, frame12);
super(x, y, xspeed, yspeed, motion);
this.delay = type;
setHP(12);
score = 100;
money = 2;
dropRate = 0.7;
deathSpin = false;
dropChance = 0;
}
function frame12(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
override public function death(){
(parent as Level).addFoe(new LeftLog(x, y, -1, yspeed));
(parent as Level).addFoe(new RightLog(x, y, 1, yspeed));
}
function frame2(){
(root as Main).makeSound("log", "f");
}
function frame8(){
(root as Main).makeSound("log2", "f");
}
}
}//package foes
Section 97
//BigRock (foes.BigRock)
package foes {
import levels.*;
public class BigRock extends Foe {
var b:Number;// = 3
public function BigRock(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
b = 3;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 11, frame12);
super(x, y, xspeed, yspeed, motion);
this.delay = type;
setHP(40);
score = 200;
money = 3;
dropRate = 0.8;
dropChance = 0.1;
deathSpin = false;
}
function frame12(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
override public function death(){
(parent as Level).addFoe(new MediumRock(((x + (Math.random() * 50)) - 25), ((y + (Math.random() * 50)) - 25), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new SmallRock(((x + (Math.random() * 20)) - 10), ((y + (Math.random() * 10)) - 5), (Math.random() * 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new SmallRock(((x + (Math.random() * 40)) - 20), ((y + (Math.random() * 40)) - 20), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new TinyRock(((x + (Math.random() * 40)) - 20), ((y + (Math.random() * 40)) - 20), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
}
function frame2(){
(root as Main).makeSound("rock3", "f");
}
function frame8(){
(root as Main).makeSound("rock2", "f");
}
}
}//package foes
Section 98
//BigShrub (foes.BigShrub)
package foes {
import bullets.*;
public class BigShrub extends Foe {
var decel:Number;
var p:Number;// = 0
var q:Number;// = 0
public function BigShrub(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
p = 0;
q = 0;
addFrameScript(0, frame1, 1, frame2, 6, frame7, 7, frame8, 21, frame22);
super(x, y, xspeed, yspeed, motion);
this.delay = type;
setHP(1100);
score = 4000;
money = 4;
dropRate = 8;
cutoff = 100;
}
function frame7(){
if (!dead){
gotoAndStop(1);
};
}
function frame22(){
if (this){
kill();
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("bush", "f");
}
function frame8(){
(root as Main).makeSound("bush2", "f");
}
override function special():Boolean{
parent.addChild(new FlameBullet(x, (y + 10), NaN, NaN, p, 4));
parent.addChild(new FlameBullet(x, (y + 10), NaN, NaN, -(p), 4));
p = (p + q);
q = (q + 0.1);
if ((t % 3) == 0){
parent.addChild(new FlameBullet(x, (y + 10), NaN, NaN, ((getAngle(x, y) + (Math.random() * 30)) - 15), 5));
};
return (false);
}
}
}//package foes
Section 99
//BigSlime (foes.BigSlime)
package foes {
import bullets.*;
public class BigSlime extends Foe {
public function BigSlime(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(900);
score = 2500;
money = 4;
dropRate = 8;
cutoff = 100;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("slime2", "f");
}
function frame1(){
stop();
}
override public function death(){
var a:Number;
a = 0;
while (a < 60) {
parent.addChild(new SmallRedBullet(x, (y + 40), NaN, NaN, (Math.random() * 360), (3 + (Math.random() * 3))));
a++;
};
}
function frame2(){
(root as Main).makeSound("slime", "f");
}
override function special():Boolean{
if ((t % delay) < 6){
parent.addChild(new SmallRedBullet(x, (y + 40), NaN, NaN, ((getAngle(x, y) + (Math.random() * 90)) - 45), (2 + (t % delay))));
parent.addChild(new SmallRedBullet(x, (y + 40), NaN, NaN, ((getAngle(x, y) + (Math.random() * 90)) - 45), (2 + ((t % delay) / 2))));
};
return (false);
}
}
}//package foes
Section 100
//Bird (foes.Bird)
package foes {
import bullets.*;
public class Bird extends Foe {
var decel:Number;
public function Bird(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 5, frame6, 6, frame7, 20, frame21);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(55);
score = 300;
money = 3;
dropRate = 5;
dropChance = 0.05;
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("bird", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("shroom", "f");
}
function frame21(){
if (this){
kill();
};
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new YellowBullet2(x, (y + 10), NaN, NaN, ((getAngle(x, y) + (Math.random() * 60)) - 30), 5));
};
return (false);
}
}
}//package foes
Section 101
//BlueJelly (foes.BlueJelly)
package foes {
import bullets.*;
public class BlueJelly extends Foe {
var decel:Number;
public function BlueJelly(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(14);
score = 150;
money = 3;
dropRate = 0.5;
dropChance = 0.02;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("slime2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("slime", "f");
}
override function special():Boolean{
if ((t % type) < 3){
parent.addChild(new BlueBullet(x, y, NaN, NaN, ((getAngle(x, y) + (Math.random() * 40)) - 20), (4 + Math.random())));
};
return (false);
}
}
}//package foes
Section 102
//BossBot (foes.BossBot)
package foes {
import levels.*;
import bullets.*;
public class BossBot extends Foe {
var decel:Number;
var halt:Boolean;// = true
var b:Number;// = 1
var m:Number;// = 1
var p:Number;// = 0
var o:Number;// = 0
public function BossBot(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
p = 0;
o = 0;
b = 1;
m = 1;
halt = true;
addFrameScript(0, frame1, 1, frame2, 6, frame7, 7, frame8, 32, frame33);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(5000);
this.boom = true;
score = 40000;
money = 5;
dropRate = 20;
dropChance = 1;
cutoff = 150;
deathSpin = false;
}
function frame7(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
override public function death(){
(parent as Level).addFoe(new LazorBot(x, y, 8, 0, 2, 20));
(parent as Level).addFoe(new LazorBot(x, y, 5, 0, 2, 20));
(parent as Level).addFoe(new LazorBot(x, y, -8, 0, 2, 20));
(parent as Level).addFoe(new LazorBot(x, y, -5, 0, 2, 20));
}
function frame2(){
(root as Main).makeSound("metal", "f");
}
function frame33(){
if (this){
kill();
};
}
function frame8(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
if ((t % 30) == 0){
(parent as Level).addFoe(new Missile(((Math.random() * 450) + 25), -48, 0, 6));
};
if ((t % 6) == 0){
parent.addChild(new RedLazor((x + 0), (y - 30), NaN, NaN, getAngle(x, y), 5));
parent.addChild(new RedLazor((x + 0), (y + 55), NaN, NaN, getAngle(x, y), 5));
parent.addChild(new RedLazor((x - 40), (y + 15), NaN, NaN, getAngle(x, y), 5));
parent.addChild(new RedLazor((x + 40), (y + 15), NaN, NaN, getAngle(x, y), 5));
};
return (false);
}
}
}//package foes
Section 103
//BossBush (foes.BossBush)
package foes {
import bullets.*;
public class BossBush extends Foe {
var decel:Number;
var p:Number;// = 0
public function BossBush(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
p = 0;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 21, frame22);
super(x, y, xspeed, yspeed, motion);
this.delay = type;
setHP(300);
score = 5000;
money = 3;
dropRate = 10;
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame22(){
if (this){
kill();
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("bush", "f");
}
function frame8(){
(root as Main).makeSound("bush2", "f");
}
override function special():Boolean{
parent.addChild(new LeafBullet((x + 50), (y - 80), NaN, NaN, p, 4));
parent.addChild(new LeafBullet((x - 50), (y - 80), NaN, NaN, -(p), 4));
p = (p + 7);
if ((t % 30) == 0){
parent.addChild(new LeafBullet(((x + (Math.random() * 80)) - 40), ((y + (Math.random() * 80)) - 40), NaN, NaN, ((getAngle(x, y) + (Math.random() * 10)) - 5), 6));
};
return (false);
}
}
}//package foes
Section 104
//Bush (foes.Bush)
package foes {
import bullets.*;
public class Bush extends Foe {
var decel:Number;
public function Bush(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(3);
score = 50;
money = 1;
dropRate = 0.6;
dropChance = 0.04;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("bush2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("bush", "f");
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new LeafBullet(x, y, NaN, NaN, getAngle(x, y), 3));
};
return (false);
}
}
}//package foes
Section 105
//Butterfly (foes.Butterfly)
package foes {
import bullets.*;
public class Butterfly extends Foe {
var decel:Number;
public function Butterfly(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 5, frame6, 6, frame7, 20, frame21);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(15);
score = 150;
money = 3;
dropRate = 1;
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("bug2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("bug", "f");
}
function frame21(){
if (this){
kill();
};
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new PurpleBall(x, y, NaN, NaN, getAngle(x, y), 5));
};
return (false);
}
}
}//package foes
Section 106
//Cactus (foes.Cactus)
package foes {
import bullets.*;
public class Cactus extends Foe {
var decel:Number;
public function Cactus(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(120);
score = 300;
money = 5;
dropRate = 1;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
override public function death(){
var a:int;
a = 2;
while (a > 0) {
parent.addChild(new SpikeBullet(x, y, NaN, NaN, (Math.random() * 360), (3 + (Math.random() * 3))));
a--;
};
a = 6;
while (a > 0) {
parent.addChild(new PinkBullet(x, y, 0, ((Math.random() * 3) + 1)));
a--;
};
}
function frame2(){
(root as Main).makeSound("log", "f");
}
function frame8(){
(root as Main).makeSound("log2", "f");
}
override function special():Boolean{
if ((t % delay) == 0){
parent.addChild(new SpikeBullet(x, y, NaN, NaN, (Math.random() * 360), 6));
};
return (false);
}
}
}//package foes
Section 107
//CatRam (foes.CatRam)
package foes {
import levels.*;
import bullets.*;
public class CatRam extends Foe {
public function CatRam(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 5, frame6, 7, frame8, 35, frame36);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(33);
score = 100;
money = 3;
dropRate = 1;
deathSpin = false;
}
function frame3(){
(root as Main).makeSound("fort", "f");
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
kitten = (Math.floor((Math.random() * 6)) + 1);
}
override public function death(){
(parent as Level).addFoe(new Kitten(x, y, ((xspeed + (Math.random() * 4)) - 2), yspeed, 0, 0));
(parent as Level).addFoe(new Kitten(x, y, ((xspeed + (Math.random() * 4)) - 2), yspeed, 0, 0));
(parent as Level).addFoe(new Kitten(x, y, xspeed, (yspeed + 1), 0, 0));
}
function frame2(){
stop();
}
function frame36(){
if (this){
kill();
};
}
function frame8(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new SmallRedBullet(x, y, NaN, NaN, getAngle(x, y), 5));
parent.addChild(new SmallRedBullet(x, y, NaN, NaN, (getAngle(x, y) + 10), 5));
parent.addChild(new SmallRedBullet(x, y, NaN, NaN, (getAngle(x, y) - 10), 5));
};
return (false);
}
}
}//package foes
Section 108
//Coral (foes.Coral)
package foes {
import bullets.*;
public class Coral extends Foe {
var decel:Number;
var p:Number;// = 0
public function Coral(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
p = 0;
addFrameScript(0, frame1, 1, frame2, 6, frame7, 7, frame8, 20, frame21);
super(x, y, xspeed, yspeed, motion);
this.delay = type;
setHP(1200);
score = 10000;
money = 5;
dropRate = 10;
cutoff = 100;
}
function frame7(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("coral", "f");
}
function frame8(){
(root as Main).makeSound("coral2", "f");
}
function frame21(){
if (this){
kill();
};
}
override function special():Boolean{
if ((t % delay) == 0){
parent.addChild(new YellowBall(x, y, NaN, NaN, ((getAngle(x, y) + (Math.random() * 20)) - 10), 15, 4, true));
};
return (false);
}
}
}//package foes
Section 109
//CrossBomb (foes.CrossBomb)
package foes {
import bullets.*;
public class CrossBomb extends Foe {
public function CrossBomb(a:Number, b:Number, c:Number, d:Number){
addFrameScript(0, frame1, 1, frame2, 6, frame7, 7, frame8, 10, frame11);
super(a, b, c, d);
setHP(60);
this.boom = true;
score = 0;
money = 0;
dropRate = 0;
dropChance = 0;
}
function frame7(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
override public function death(){
var a:Number;
a = 0;
while (a < 7) {
parent.addChild(new YellowBullet(x, y, NaN, NaN, ((0 + (Math.random() * 20)) - 10), (3 + (Math.random() * 5))));
parent.addChild(new YellowBullet(x, y, NaN, NaN, ((90 + (Math.random() * 20)) - 10), (3 + (Math.random() * 5))));
parent.addChild(new YellowBullet(x, y, NaN, NaN, ((180 + (Math.random() * 20)) - 10), (3 + (Math.random() * 5))));
parent.addChild(new YellowBullet(x, y, NaN, NaN, ((270 + (Math.random() * 20)) - 10), (3 + (Math.random() * 5))));
a++;
};
}
function frame11(){
if (this){
kill();
};
}
function frame2(){
(root as Main).makeSound("metal", "f");
}
function frame8(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
if (this.y > player.y){
return (true);
};
return (false);
}
}
}//package foes
Section 110
//DeadCat (foes.DeadCat)
package foes {
public class DeadCat extends Foe {
public function DeadCat(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 20, frame21);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(15);
score = 100;
money = 4;
dropRate = 0.7;
cutoff = 100;
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("eye", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("eye", "f");
}
function frame21(){
if (this){
kill();
};
}
}
}//package foes
Section 111
//Demon (foes.Demon)
package foes {
import bullets.*;
public class Demon extends Foe {
public function Demon(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 5, frame6, 6, frame7, 31, frame32);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(550);
score = 1000;
money = 6;
dropRate = 4;
dropChance = 0.04;
cutoff = 100;
deathSpin = false;
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("demon2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("demon", "f");
}
function frame32(){
if (this){
kill();
};
}
override function special():Boolean{
if (((t % type) * 2) == 0){
parent.addChild(new OrangeBullet((x - 20), (y + 30), NaN, NaN, ((90 + (Math.random() * 30)) - 15), 3));
parent.addChild(new OrangeBullet((x - 20), (y + 30), NaN, NaN, ((90 + (Math.random() * 30)) - 15), 3));
parent.addChild(new DemonBullet((x - 20), (y + 30), NaN, NaN, ((90 + (Math.random() * 30)) - 15), 4));
};
if (((t % type) * 2) == type){
parent.addChild(new OrangeBullet((x + 20), (y + 30), NaN, NaN, ((90 + (Math.random() * 30)) - 15), 3));
parent.addChild(new OrangeBullet((x + 20), (y + 30), NaN, NaN, ((90 + (Math.random() * 30)) - 15), 3));
parent.addChild(new DemonBullet((x + 20), (y + 30), NaN, NaN, ((90 + (Math.random() * 30)) - 15), 4));
};
return (false);
}
}
}//package foes
Section 112
//DoubleBrick (foes.DoubleBrick)
package foes {
public class DoubleBrick extends Foe {
var decel:Number;
public function DoubleBrick(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 5, frame6);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(Infinity);
score = 0;
money = 0;
dropRate = 0;
dropChance = 0;
cutoff = 100;
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
}
}//package foes
Section 113
//EyeBall (foes.EyeBall)
package foes {
import bullets.*;
public class EyeBall extends Foe {
var decel:Number;
public function EyeBall(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 15, frame16);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(20);
score = 200;
money = 4;
dropRate = 0.5;
dropChance = 0.02;
}
function frame16(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("eye2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("eye", "f");
}
override function special():Boolean{
if ((t % type) < 3){
parent.addChild(new OrangeLazor(x, y, NaN, NaN, getAngle(x, y), (5 + (t % type))));
};
return (false);
}
}
}//package foes
Section 114
//EyeBit (foes.EyeBit)
package foes {
import bullets.*;
public class EyeBit extends Foe {
var b:Number;
public function EyeBit(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 3, frame4, 6, frame7, 14, frame15);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(40);
score = 0;
money = 3;
dropRate = 2;
}
function frame15(){
if (this){
kill();
};
}
function frame4(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("rock3", "f");
}
function frame1(){
stop();
}
override public function death(){
var a:int;
a = 8;
while (a > 0) {
parent.addChild(new OrangeBullet(x, y, NaN, NaN, (Math.random() * 360), (3 + (Math.random() * 3))));
a--;
};
}
function frame2(){
(root as Main).makeSound("rock4", "f");
}
override function special():Boolean{
return (false);
}
}
}//package foes
Section 115
//EyeGuy (foes.EyeGuy)
package foes {
import levels.*;
import bullets.*;
public class EyeGuy extends Foe {
var b:Number;
public function EyeGuy(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 14, frame15);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(240);
score = 600;
money = 5;
dropRate = 2;
cutoff = 100;
}
function frame15(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("rock2", "f");
}
function frame1(){
stop();
}
override public function death(){
(parent as Level).addFoe(new EyeBit((x + 50), y, (xspeed + (Math.random() * 2)), ((yspeed + 2) + (Math.random() * 4)), 0, 0));
(parent as Level).addFoe(new EyeBit((x - 50), y, (xspeed - (Math.random() * 2)), ((yspeed + 2) + (Math.random() * 4)), 0, 0));
(parent as Level).addFoe(new EyeBit(x, (y + 50), ((xspeed + (Math.random() * 4)) - 2), ((yspeed + 2) + (Math.random() * 2)), 0, 0));
(parent as Level).addFoe(new EyeBit(x, (y - 50), ((xspeed + (Math.random() * 4)) - 2), (yspeed + (Math.random() * 2)), 0, 0));
}
function frame2(){
(root as Main).makeSound("rock3", "f");
}
override function special():Boolean{
if ((t % 4) == 0){
parent.addChild(new OrangeBullet(x, y, NaN, NaN, ((getAngle(x, y) + (Math.random() * 90)) - 45), 5));
};
return (false);
}
}
}//package foes
Section 116
//FaceBot (foes.FaceBot)
package foes {
import bullets.*;
public class FaceBot extends Foe {
public function FaceBot(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 6, frame7, 7, frame8, 32, frame33);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(900);
score = 2500;
money = 7;
dropRate = 3;
dropChance = 0.1;
cutoff = 100;
deathSpin = false;
}
function frame7(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("metal", "f");
}
function frame33(){
if (this){
kill();
};
}
function frame8(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
if ((t % type) < 30){
parent.addChild(new RedBullet((x + 20), (y + 20), NaN, NaN, getAngle((x + 20), (y + 20)), (4 + ((t % type) / 2))));
parent.addChild(new RedBullet((x - 20), (y + 20), NaN, NaN, getAngle((x - 20), (y + 20)), (4 + ((t % type) / 2))));
};
return (false);
}
}
}//package foes
Section 117
//FireGuy (foes.FireGuy)
package foes {
import bullets.*;
public class FireGuy extends Foe {
var decel:Number;
var p:Number;// = 0
public function FireGuy(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
p = 0;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(110);
score = 300;
money = 3;
dropRate = 3;
dropChance = 0.03;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("flame2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("flame", "f");
}
override function special():Boolean{
if ((t % type) == 0){
p = (p + 4);
parent.addChild(new WaveBullet(x, y, NaN, NaN, ((getAngle(x, y) + p) - 20), 4));
if (p > 40){
p = 0;
};
};
return (false);
}
}
}//package foes
Section 118
//FlameGuy (foes.FlameGuy)
package foes {
import bullets.*;
public class FlameGuy extends Foe {
var decel:Number;
var p:Number;// = 0
public function FlameGuy(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
p = 0;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(100);
score = 300;
money = 3;
dropRate = 3;
dropChance = 0.03;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("flame2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("flame", "f");
}
override function special():Boolean{
if ((t % type) == 0){
p = (p + 15);
parent.addChild(new WaveBullet2(x, y, NaN, NaN, p, 3));
};
return (false);
}
}
}//package foes
Section 119
//Foe (foes.Foe)
package foes {
import flash.display.*;
import levels.*;
import drops.*;
import players.*;
import bullets.*;
import misc.*;
public class Foe extends MovieClip {
public var HP:Number;
public var boom:Boolean;// = false
public var dropChance:Number;// = 0.05
public var shoot:Boolean;// = true
public var cutoff:Number;// = 50
public var deathSpinR:Number;
public var ydecel:Number;// = 0
public var by:Number;
public var dead2:Boolean;// = false
public var dead:Boolean;// = false
public var boss:Boolean;// = false
public var yspeed:Number;
public var dropRate:Number;// = 0.4
public var bx:Number;
public var maxHP:Number;
public var delay:Number;// = 10
public var waitFlag:Boolean;// = false
public var s:Number;// = 0
public var score:Number;
public var type:Number;
public var kitten:int;// = 3
public var t:Number;// = 0
public var superArmor:Number;// = 0
public var xdecel:Number;// = 0
public var motion:Number;// = 0
public var xspeed:Number;
public var deathSpin:Boolean;// = true
public var player:Player;
public var money:int;// = 1
public var drop:String;// = ""
public function Foe(a:Number, b:Number, c:Number, d:Number, motion:Number=0){
boom = false;
s = 0;
dead = false;
dead2 = false;
shoot = true;
waitFlag = false;
money = 1;
dropRate = 0.4;
motion = 0;
deathSpin = true;
t = 0;
delay = 10;
cutoff = 50;
drop = "";
xdecel = 0;
ydecel = 0;
kitten = 3;
boss = false;
dropChance = 0.05;
superArmor = 0;
super();
x = a;
y = b;
xspeed = c;
yspeed = d;
this.motion = motion;
deathSpinR = ((Math.random() * 50) - 25);
money = Math.floor(((Math.random() * 3) + 1));
Global.vars.foes++;
if ((((motion == 2)) && ((xspeed > 0)))){
xdecel = 0.2;
};
if ((((motion == 2)) && ((xspeed < 0)))){
xdecel = -0.2;
};
if ((((motion == 4)) && ((yspeed > 0)))){
ydecel = 0.2;
};
if ((((motion == 4)) && ((yspeed < 0)))){
ydecel = -0.2;
};
}
function extraHeart(){
if (((!((parent as Level).level.survival)) && (Global.vars.options[13]))){
parent.addChild(new Heart(x, y));
};
}
public function getAngle(x:Number, y:Number):Number{
var n:Number;
n = ((Math.atan(((y - player.y) / (x - player.x))) / Math.PI) * 180);
if (x >= player.x){
return ((n + 180));
};
return (n);
}
function specialHit(){
}
function nextPattern(drops:int, combo:int){
var d:uint;
(parent as Level).addScore((score / 4), x, y);
(parent as Level).addCombo(combo);
d = 0;
while (d < drops) {
(parent as Level).addItem(new Money(x, y, money, (Math.random() * 360), (Math.random() * 9)));
d++;
};
t = 0;
superArmor = 60;
}
public function timeOut(){
dead = true;
deathSpin = false;
gotoAndPlay("die");
death();
xspeed = 0;
yspeed = 0;
(parent as Level).addChild(new ScoreLabel(-1, 0, x, y));
}
function hitPlayer(){
if (((((this.hitTestPoint(player.x, player.y, true)) && ((player.superArmor == 0)))) && (!(player.dead)))){
player.hit();
this.hit(15);
};
}
public function kill(){
dead = true;
dead2 = true;
stop();
if (waitFlag){
(parent as Level).wait--;
};
(parent as Level).foeList.splice((parent as Level).foeList.indexOf(this), 1);
parent.removeChild(this);
}
public function die(){
var h:int;
var d:uint;
var u:int;
(parent as Level).bottomBar.bossHP.visible = false;
dead = true;
if (score != 0){
(parent as Level).addScore(score, x, y);
(parent as Level).addCombo(1);
(parent as Level).foesKilled = ((parent as Level).foesKilled + 1);
(parent as Level).comboCounter = 60;
(parent as Level).updateBars();
if ((((parent as Level).level.survival) && ((Math.random() > 0.6)))){
} else {
if (dropRate > 1){
d = 0;
while (d < dropRate) {
(parent as Level).addItem(new Money(x, y, money, (Math.random() * 360), (Math.random() * 9)));
d++;
};
} else {
if (Math.random() < dropRate){
(parent as Level).addItem(new Money(x, y, money, 0, 2));
};
};
};
h = 1;
if (((!((parent as Level).level.survival)) && (Global.vars.options[13]))){
h = 1.6;
};
if (drop == "heart"){
(parent as Level).addItem(new Heart(x, y));
} else {
if (drop == "shield"){
(parent as Level).addItem(new Barrier(x, y));
} else {
if (drop == "buff"){
(parent as Level).addItem(new Buff(x, y));
} else {
if (Math.random() < (dropChance * h)){
u = Math.floor((Math.random() * 3));
if (!(parent as Level).level.survival){
if (u == 0){
(parent as Level).addItem(new Heart(x, y));
};
};
if (u == 1){
(parent as Level).addItem(new Barrier(x, y));
};
if (u == 2){
(parent as Level).addItem(new Buff(x, y));
};
};
};
};
};
};
gotoAndPlay("die");
death();
xspeed = 0;
yspeed = 0;
}
public function hit(damage:Number){
HP = (HP - damage);
if (((!((parent as Level).level.survival)) && (Global.vars.options[15]))){
HP = (HP - (damage / 2));
};
specialHit();
if (!dead){
if (HP <= 0){
die();
} else {
play();
};
};
}
function special():Boolean{
return (false);
}
public function death(){
}
public function move(){
if (boss){
if (!dead){
(parent as Level).bottomBar.bossHP.visible = true;
(parent as Level).bottomBar.bossHP.gotoAndStop(Math.floor((((HP / maxHP) * 100) + 2)));
};
superArmor--;
if (superArmor > 0){
visible = !(visible);
} else {
visible = true;
};
};
x = (x + xspeed);
y = (y + yspeed);
t++;
if (motion == 1){
xspeed = (xspeed * 0.92);
};
if (motion == 3){
yspeed = (yspeed * 0.92);
};
xspeed = (xspeed - xdecel);
yspeed = (yspeed - ydecel);
if (!dead){
if (special()){
die();
} else {
if ((((x > ((parent as Level).xlimit + cutoff))) || ((x < -(cutoff))))){
kill();
} else {
if ((((y > ((parent as Level).ylimit + cutoff))) || ((y < -(cutoff))))){
kill();
} else {
hitPlayer();
};
};
};
} else {
if (deathSpin){
xspeed = 0;
yspeed = -7;
rotation = (rotation + deathSpinR);
};
};
}
public function setHP(h:Number){
HP = h;
maxHP = h;
}
}
}//package foes
Section 120
//FoeBar (foes.FoeBar)
package foes {
import flash.display.*;
public dynamic class FoeBar extends MovieClip {
public function FoeBar(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(100);
}
}
}//package foes
Section 121
//Ghost (foes.Ghost)
package foes {
import bullets.*;
public class Ghost extends Foe {
var decel:Number;
var p:int;// = 0
public function Ghost(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
p = 0;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(300);
score = 1000;
money = 7;
dropRate = 1;
dropChance = 0.1;
cutoff = 80;
deathSpin = false;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("log", "f");
}
function frame8(){
(root as Main).makeSound("log2", "f");
}
override function special():Boolean{
var b:Number;
if ((t % type) == 0){
b = 0;
while (b < 360) {
parent.addChild(new WaveBullet(x, y, NaN, NaN, b, 3));
b = (b + 15);
};
};
if ((t % type) == 1){
b = 7.5;
while (b < 360) {
parent.addChild(new WaveBullet(x, y, NaN, NaN, b, 3));
b = (b + 15);
};
};
if ((t % 13) == 0){
parent.addChild(new WaveBullet2(x, y, NaN, NaN, getAngle(x, y), 4));
};
return (false);
}
}
}//package foes
Section 122
//GiantCrab (foes.GiantCrab)
package foes {
import drops.*;
import bullets.*;
public class GiantCrab extends Foe {
var inc:Number;// = 1
var decel:Number;
var halt:Boolean;// = true
var b:Number;// = 1
var m:Number;// = 1
var p:Number;// = 0
var o:Number;// = 0
var w:Number;// = 0
var r:Number;// = 0
var bx2:Number;
var mode2:Number;// = 0
var mode:Number;// = 0
public function GiantCrab(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
p = 0;
o = 0;
b = 1;
m = 1;
halt = true;
mode = 0;
mode2 = 0;
w = 0;
inc = 1;
r = 0;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 8, frame9, 14, frame15, 22, frame23, 52, frame53);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(10000);
score = 40000;
money = 5;
dropRate = 30;
cutoff = 200;
deathSpin = false;
boss = true;
}
function frame15(){
(root as Main).makeSound("explode", "f");
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame23(){
(root as Main).makeSound("explode", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("fort", "f");
}
function frame9(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
var b:int;
by = (y + 50);
bx = (x - 120);
bx2 = (x + 120);
w++;
r = (r + 0.02);
if ((((mode == 1)) && ((w > 30)))){
b = 0;
while (b < 5) {
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, (Math.random() * 360), 5));
b++;
};
} else {
if ((((mode == 2)) && ((w > 50)))){
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, (Math.random() * 360), 2));
if ((t % 20) == 0){
b = 0;
while (b < 360) {
parent.addChild(new BubbleBullet(x, y, NaN, NaN, (b + (Math.random() * 15)), 3));
b = (b + 15);
};
};
} else {
if ((((mode == 3)) && ((w > 70)))){
if ((t % 60) < 30){
b = 0;
while (b < 4) {
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, ((getAngle(x, y) + (Math.random() * 30)) - 15), (7 + (Math.random() * 3))));
b++;
};
};
} else {
if ((((mode == 4)) && ((w > 50)))){
if ((t % 4) == 0){
parent.addChild(new BubbleBullet(x, y, NaN, NaN, (Math.random() * 360), 3));
};
if ((t % 3) == 0){
p = (p + inc);
b = 0;
while (b < 18) {
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, ((b * 20) + p), 6));
if (p == 0){
inc = 2;
};
if (p == 70){
inc = -2;
};
b++;
};
};
} else {
if ((((mode == 5)) && ((w > 50)))){
if ((t % 50) == 0){
parent.addChild(new BubbleBall(150, 150, NaN, NaN, getAngle(x, y), 3));
parent.addChild(new BubbleBall(350, 150, NaN, NaN, getAngle(x, y), 3));
};
} else {
if ((((mode == 6)) && ((w > 100)))){
if ((t % 7) == 0){
b = 0;
while (b < 10) {
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, (((t * 2) + (r * 2)) + 4), (2 + b)));
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, ((((t * 2) + (r * 2)) + 180) + 4), (2 + b)));
b = (b + 1);
};
};
if ((t % 8) == 0){
b = 0;
while (b < 8) {
parent.addChild(new BlueWave(x, y, NaN, NaN, ((t * 3) + r), (1 + b)));
parent.addChild(new BlueWave(x, y, NaN, NaN, (((t * 3) + 180) + r), (1 + b)));
b = (b + 1);
};
};
if ((t % 50) == 30){
b = 0;
while (b < 3) {
parent.addChild(new GodBall(x, y, ((t * 3) + r), (3 + (b * 2))));
parent.addChild(new GodBall(x, y, (((t * 3) + 180) + r), (3 + (b * 2))));
b = (b + 1);
};
};
};
};
};
};
};
};
if (HP > ((maxHP * 5) / 6)){
if (mode != 1){
mode = 1;
w = 0;
superArmor = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 4) / 6)){
if (mode != 2){
mode = 2;
w = 0;
superArmor = 60;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 3) / 6)){
if (mode != 3){
mode = 3;
w = 0;
p = 0;
superArmor = 60;
extraHeart();
};
} else {
if (HP > ((maxHP * 2) / 6)){
if (mode != 4){
mode = 4;
w = 0;
superArmor = 60;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 1) / 6)){
if (mode != 5){
mode = 5;
w = 0;
superArmor = 60;
extraHeart();
};
} else {
if (HP <= ((maxHP * 1) / 6)){
if (mode != 6){
mode = 6;
w = 0;
superArmor = 60;
};
};
};
};
};
};
};
return (false);
}
function frame53(){
if (this){
kill();
};
}
}
}//package foes
Section 123
//GiantCrab2 (foes.GiantCrab2)
package foes {
import drops.*;
import bullets.*;
public class GiantCrab2 extends GiantCrab {
var ball1:Bullet;
var ball2:Bullet;
var aa:int;
var ss:Number;// = 0
var sb:Boolean;// = true
var u:Number;// = 0
var si:Number;// = 0
var v:Number;// = 0
var xx:int;
var yy:int;
public function GiantCrab2(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
u = 0;
v = 0;
ss = 0;
si = 0;
sb = true;
super(x, y, xspeed, yspeed, motion, type);
setHP(21000);
score = 200000;
money = 5;
dropRate = 25;
}
override function special():Boolean{
var b:int;
by = (y + 50);
bx = (x - 120);
bx2 = (x + 120);
w++;
u = (u + 0.02);
if ((((mode == 1)) && ((w > 30)))){
if ((t % 30) == 0){
b = 0;
while (b < 360) {
parent.addChild(new GodBullet3(x, y, (b + u), 2.5));
b = (b + 10);
};
};
if ((t % 30) == 10){
b = 0;
while (b < 360) {
parent.addChild(new GodBullet3(x, y, ((b + 5) + u), 3.5));
b = (b + 10);
};
};
if ((t % 30) == 20){
b = 0;
while (b < 10) {
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, (t / 2), (2 + b)));
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, ((t / 2) + 120), (2 + b)));
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, ((t / 2) - 120), (2 + b)));
b = (b + 1);
};
};
} else {
if ((((mode == 2)) && ((w > 100)))){
if ((t % 160) == 0){
b = 0;
while (b <= 600) {
parent.addChild(new BubbleBullet2(505, b, NaN, NaN, ((180 - 50) + (b / 6)), 2));
parent.addChild(new BubbleBullet2(-5, b, NaN, NaN, ((0 + 50) - (b / 6)), 2));
b = (b + 60);
};
b = 0;
while (b <= 500) {
parent.addChild(new BubbleBullet2(b, -5, NaN, NaN, ((90 - 50) + (b / 5)), 2));
parent.addChild(new BubbleBullet2(b, 605, NaN, NaN, ((-90 + 50) - (b / 5)), 2));
b = (b + 50);
};
};
if ((t % 160) == 80){
b = 0;
while (b <= 600) {
parent.addChild(new BubbleBullet(505, b, NaN, NaN, ((180 - 100) + (b / 3)), 2));
parent.addChild(new BubbleBullet(-5, b, NaN, NaN, ((0 + 100) - (b / 3)), 2));
b = (b + 60);
};
b = 0;
while (b <= 500) {
parent.addChild(new BubbleBullet(b, -5, NaN, NaN, ((90 - 100) + (b / 2.5)), 2));
parent.addChild(new BubbleBullet(b, 605, NaN, NaN, ((-90 + 100) - (b / 2.5)), 2));
b = (b + 50);
};
};
} else {
if ((((mode == 3)) && ((w > 120)))){
if ((t % 60) == 0){
b = 0;
while (b <= 6) {
parent.addChild(new BlueWave(x, y, NaN, NaN, getAngle(x, y), (3 + b)));
b = (b + 1);
};
};
if ((t % 5) == 0){
b = 50;
while (b <= 450) {
parent.addChild(new GodBullet(b, 605, (-100 + (Math.random() * 20)), 2));
b = (b + 100);
};
};
} else {
if ((((mode == 4)) && ((w > 120)))){
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, (Math.sin((t / 20)) * 270), 4));
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, (180 - (Math.sin((t / 20)) * 270)), 4));
parent.addChild(new BlueBullet(x, y, NaN, NaN, (Math.sin((t / 10)) * 270), 3));
parent.addChild(new BlueBullet(x, y, NaN, NaN, (180 - (Math.sin((t / 10)) * 270)), 3));
} else {
if ((((mode == 5)) && ((w > 120)))){
if ((t % 90) < 6){
xx = ((x - 150) + (Math.random() * 300));
yy = ((y - 75) + (Math.random() * 150));
aa = (Math.random() * 90);
b = 0;
while (b < 5) {
parent.addChild(new BubbleBullet2(xx, yy, NaN, NaN, (((getAngle(xx, yy) - 15) + (Math.random() * 30)) + aa), (4 + (Math.random() * 2))));
parent.addChild(new BubbleBullet2(xx, yy, NaN, NaN, ((((getAngle(xx, yy) + 90) - 15) + (Math.random() * 30)) + aa), (4 + (Math.random() * 2))));
parent.addChild(new BubbleBullet2(xx, yy, NaN, NaN, ((((getAngle(xx, yy) + 180) - 15) + (Math.random() * 30)) + aa), (4 + (Math.random() * 2))));
parent.addChild(new BubbleBullet2(xx, yy, NaN, NaN, ((((getAngle(xx, yy) + 270) - 15) + (Math.random() * 30)) + aa), (4 + (Math.random() * 2))));
b++;
};
};
if (((((t % 90) < 35)) && (((t % 90) >= 30)))){
xx = ((x - 150) + (Math.random() * 300));
yy = ((y - 75) + (Math.random() * 150));
aa = (Math.random() * 90);
b = 0;
while (b < 5) {
parent.addChild(new BlueWave(xx, yy, NaN, NaN, (((getAngle(xx, yy) - 7) + (Math.random() * 14)) + aa), (6 + (Math.random() * 2))));
parent.addChild(new BlueWave(xx, yy, NaN, NaN, ((((getAngle(xx, yy) + 90) - 7) + (Math.random() * 14)) + aa), (6 + (Math.random() * 2))));
parent.addChild(new BlueWave(xx, yy, NaN, NaN, ((((getAngle(xx, yy) + 180) - 7) + (Math.random() * 14)) + aa), (6 + (Math.random() * 2))));
parent.addChild(new BlueWave(xx, yy, NaN, NaN, ((((getAngle(xx, yy) + 270) - 7) + (Math.random() * 14)) + aa), (6 + (Math.random() * 2))));
b++;
};
};
if (((((t % 90) < 67)) && (((t % 90) >= 60)))){
xx = ((x - 150) + (Math.random() * 300));
yy = ((y - 75) + (Math.random() * 150));
aa = (Math.random() * 90);
b = 0;
while (b < 5) {
parent.addChild(new GodBullet(xx, yy, (((getAngle(xx, yy) - 25) + (Math.random() * 50)) + aa), (2 + (Math.random() * 1))));
parent.addChild(new GodBullet(xx, yy, ((((getAngle(xx, yy) + 90) - 25) + (Math.random() * 50)) + aa), (2 + (Math.random() * 1))));
parent.addChild(new GodBullet(xx, yy, ((((getAngle(xx, yy) + 180) - 25) + (Math.random() * 50)) + aa), (2 + (Math.random() * 1))));
parent.addChild(new GodBullet(xx, yy, ((((getAngle(xx, yy) + 270) - 25) + (Math.random() * 50)) + aa), (2 + (Math.random() * 1))));
b++;
};
};
} else {
if ((((mode == 6)) && ((w > 80)))){
if ((((ball1 == undefined)) || (ball1.dead))){
ball1 = new BubbleBall2(-100, -100, 0, 200);
ball2 = new BubbleBall2(-100, -100, 180, 200);
parent.addChild(ball1);
parent.addChild(ball2);
};
} else {
if ((((mode == 7)) && ((w > 80)))){
if ((t % 5) != 0){
parent.addChild(new BubbleBullet(x, y, NaN, NaN, ((t * 5) % 360), 3));
};
if ((t % 5) != 1){
parent.addChild(new BubbleBullet(x, y, NaN, NaN, (((t * 5) % 360) + 90), 3));
};
if ((t % 5) != 2){
parent.addChild(new BubbleBullet(x, y, NaN, NaN, (((t * 5) % 360) + 180), 3));
};
if ((t % 5) != 3){
parent.addChild(new BubbleBullet(x, y, NaN, NaN, (((t * 5) % 360) + 270), 3));
};
} else {
if ((((mode == 8)) && ((w > 80)))){
if ((((ball1 == undefined)) || (ball1.dead))){
ball1 = new BubbleBall3(-100, -100, 0, 200);
ball2 = new BubbleBall3(-100, -100, 1, 200);
parent.addChild(ball1);
parent.addChild(ball2);
};
} else {
if ((((mode == 9)) && ((w > 80)))){
if ((t % 2) == 0){
if (sb){
si = (si + 0.3);
ss = (ss + si);
if (si > 20){
sb = !(sb);
};
};
if (!sb){
si = (si - 0.3);
ss = (ss + si);
if (si < -20){
sb = !(sb);
};
};
b = 0;
while (b < 360) {
parent.addChild(new GodBullet(x, y, (b + ss), 4));
b = (b + 60);
};
b = 10;
while (b < 360) {
parent.addChild(new BlueWave(x, y, NaN, NaN, (b - ss), 2));
b = (b + 120);
};
};
};
};
};
};
};
};
};
};
};
if (HP > ((maxHP * 8) / 9)){
if (mode != 1){
mode = 1;
superArmor = 0;
};
} else {
if (HP > ((maxHP * 7) / 9)){
if (mode != 2){
mode = 2;
nextPattern(5, 30);
w = 0;
};
} else {
if (HP > ((maxHP * 6) / 9)){
if (mode != 3){
mode = 3;
nextPattern(7, 30);
w = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 5) / 9)){
if (mode != 4){
mode = 4;
nextPattern(9, 30);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 4) / 9)){
if (mode != 5){
mode = 5;
nextPattern(10, 30);
w = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 3) / 9)){
if (mode != 6){
mode = 6;
nextPattern(11, 30);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 2) / 9)){
if (mode != 7){
mode = 7;
nextPattern(13, 30);
w = 0;
ball1.kill();
ball2.kill();
extraHeart();
};
} else {
if (HP > ((maxHP * 1) / 9)){
if (mode != 8){
mode = 8;
nextPattern(15, 30);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP < ((maxHP * 1) / 9)){
if (mode != 9){
mode = 9;
nextPattern(18, 30);
w = 0;
ball1.kill();
ball2.kill();
};
};
};
};
};
};
};
};
};
};
return (false);
}
}
}//package foes
Section 124
//Girder (foes.Girder)
package foes {
public class Girder extends Foe {
var spin:Number;
public function Girder(a:Number, b:Number, c:Number, d:Number, rotate:Number, spin:Number){
addFrameScript(0, frame1, 6, frame7, 15, frame16);
super(a, b, c, d);
this.rotation = rotate;
this.spin = spin;
setHP(90);
score = 20;
}
function frame16(){
if (this){
kill();
};
}
function frame7(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
override function special():Boolean{
rotation = (rotation + spin);
return (false);
}
}
}//package foes
Section 125
//GodCat (foes.GodCat)
package foes {
import levels.*;
import drops.*;
import bullets.*;
public class GodCat extends Foe {
var inc:Number;// = 1
var ball1:OrbitBall;
var ball2:OrbitBall;
var decel:Number;
var halt:Boolean;// = true
var a:int;// = 0
var b:Number;// = 1
var m:Number;// = 1
var p:Number;// = 0
var u:Number;// = 5
var o:Number;// = 0
var w:Number;// = 0
var godBall:GodBall2;
var bx2:Number;
var mode2:Number;// = 0
var mode:Number;// = -1
public function GodCat(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
p = 0;
o = 0;
b = 1;
m = 1;
halt = true;
mode = -1;
mode2 = 0;
w = 0;
inc = 1;
a = 0;
u = 5;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 8, frame9, 14, frame15, 22, frame23, 30, frame31, 37, frame38, 45, frame46, 76, frame77);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(45000);
score = 160000;
money = 7;
dropRate = 20;
cutoff = 200;
deathSpin = false;
boss = true;
}
function frame15(){
(root as Main).makeSound("explode", "f");
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame23(){
(root as Main).makeSound("explode", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("rock3", "f");
}
function frame31(){
(root as Main).makeSound("explode", "f");
}
function frame38(){
(root as Main).makeSound("explode", "f");
}
function frame9(){
(root as Main).makeSound("explode", "f");
}
function frame46(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
var b:int;
var c:int;
var x2:int;
var y2:int;
w++;
if (t == 360){
t = 0;
};
if ((((mode == -1)) && ((w > 60)))){
if ((t % 11) == 0){
x2 = (((x + (Math.random() * 150)) - 75) - 30);
y2 = (((y + (Math.random() * 150)) - 75) - 30);
c = 0;
while (c < 360) {
parent.addChild(new GodBullet3(x2, y2, c, 4));
c = (c + 10);
};
b = 0;
while (b < 360) {
parent.addChild(new GodBullet2(x2, y2, b, 5));
b = (b + 20);
};
};
} else {
if ((((mode == 0)) && ((w > 50)))){
if ((t % 60) == 0){
parent.addChild(new DevilBall((x + 40), y, getAngle((x + 40), y), 5));
};
} else {
if ((((mode == 1)) && ((w > 120)))){
if ((t % 30) == 0){
b = 0;
while (b < 360) {
parent.addChild(new GodBall((x - 40), y, b, 5));
b = (b + 14);
};
};
if ((t % 30) == 15){
b = 0;
while (b < 360) {
parent.addChild(new GodBall((x - 40), y, (b + 7), 5));
b = (b + 14);
};
};
parent.addChild(new GodBullet((x - 40), y, (Math.random() * 360), 6));
} else {
if ((((mode == 2)) && ((w > 50)))){
parent.addChild(new DevilBullet2((x + 40), y, (t * 6), 5));
parent.addChild(new DevilBullet2((x + 40), y, (122 + (t * 6)), 5));
parent.addChild(new DevilBullet2((x + 40), y, (244 + (t * 6)), 5));
parent.addChild(new DevilBullet((x + 40), y, (Math.random() * 360), 6));
parent.addChild(new DevilBullet((x + 40), y, (Math.random() * 360), 6));
parent.addChild(new DevilBullet((x + 40), y, (Math.random() * 360), 6));
} else {
if ((((mode == 3)) && ((w > 60)))){
if ((t % 2) == 0){
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) + 6), 4.5));
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) + 4), 5));
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) + 2), 5.5));
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) + 0), 6));
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) - 2), 5.5));
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) - 4), 5));
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) - 6), 4.5));
parent.addChild(new GodBullet2((x - 40), y, ((t * u) % 360), 4.5));
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) + 4), 4));
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) + 2), 3.5));
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) + 0), 3));
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) - 2), 3.5));
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) - 4), 4));
parent.addChild(new GodBullet2((x - 40), y, (((t * u) % 360) + 180), 4));
parent.addChild(new GodBullet2((x - 40), y, ((((t * u) % 360) + 180) + 2), 4.5));
parent.addChild(new GodBullet2((x - 40), y, ((((t * u) % 360) + 180) + 4), 5));
u = (u + 0.03);
};
} else {
if ((((mode == 4)) && ((w > 60)))){
if ((t % 60) < 50){
parent.addChild(new DevilBullet3((x + 40), y, ((getAngle((x + 40), y) + (Math.random() * 4)) - 2), (4 + ((t % 60) / 4))));
parent.addChild(new DevilBullet3((x + 40), y, ((getAngle((x + 40), y) + (Math.random() * 8)) - 4), (4 + ((t % 60) / 4))));
};
} else {
if ((((mode == 5)) && ((w > 60)))){
parent.addChild(new GodBullet(-5, (Math.random() * 900), 0, 3));
parent.addChild(new DevilBullet(505, (Math.random() * 900), 180, 3));
} else {
if ((((mode == 6)) && ((w > 60)))){
x2 = x;
y2 = y;
parent.addChild(new GodBullet2(x2, y2, ((t * 10) % 360), 4));
parent.addChild(new DevilBullet2(x2, y2, (((t * 11) % 360) + 30), 5));
parent.addChild(new GodBullet(x2, y2, (((t * 8) % 360) + 80), 3));
parent.addChild(new DevilBullet(x2, y2, (((t * 9) % 360) + 110), 3.8));
parent.addChild(new GodBullet2(x2, y2, (((t * 10) % 360) + 180), 4));
parent.addChild(new DevilBullet2(x2, y2, ((((t * 11) % 360) + 30) + 180), 5));
parent.addChild(new GodBullet(x2, y2, ((((t * 8) % 360) + 80) + 180), 3));
parent.addChild(new DevilBullet(x2, y2, ((((t * 9) % 360) + 110) + 180), 3.8));
};
};
};
};
};
};
};
};
if (HP > ((maxHP * 7) / 8)){
if (mode != -1){
mode = -1;
w = 0;
superArmor = 0;
t = 0;
};
} else {
if (HP > ((maxHP * 6) / 8)){
if (mode != 0){
mode = 0;
w = 0;
superArmor = 60;
t = 0;
diamonds(2);
};
} else {
if (HP > ((maxHP * 5) / 8)){
if (mode != 1){
mode = 1;
w = 0;
superArmor = 60;
parent.addChild(new Heart(x, y));
t = 0;
diamonds(3);
};
} else {
if (HP > ((maxHP * 4) / 8)){
if (mode != 2){
mode = 2;
w = 0;
superArmor = 60;
ball1.play();
t = 0;
diamonds(5);
};
} else {
if (HP > ((maxHP * 3) / 8)){
if (mode != 3){
mode = 3;
w = 0;
p = 0;
superArmor = 60;
parent.addChild(new Heart(x, y));
t = 0;
diamonds(7);
};
} else {
if (HP > ((maxHP * 2) / 8)){
if (mode != 4){
mode = 4;
w = 0;
superArmor = 60;
t = 0;
diamonds(10);
};
} else {
if (HP > ((maxHP * 1) / 8)){
if (mode != 5){
mode = 5;
w = 0;
superArmor = 60;
parent.addChild(new Heart(x, y));
t = 0;
diamonds(12);
};
} else {
if (HP <= ((maxHP * 1) / 8)){
if (mode != 6){
mode = 6;
w = 0;
superArmor = 60;
t = 0;
};
};
};
};
};
};
};
};
};
return (false);
}
function frame77(){
if (this){
kill();
};
}
function diamonds(a:int){
var d:uint;
d = 0;
while (d < a) {
(parent as Level).addItem(new Money(x, y, money, (Math.random() * 360), (Math.random() * 9)));
d++;
};
}
}
}//package foes
Section 126
//GodCat2 (foes.GodCat2)
package foes {
import drops.*;
import bullets.*;
public class GodCat2 extends GodCat {
public function GodCat2(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
super(x, y, xspeed, yspeed, motion, type);
this.type = type;
setHP(70000);
score = 800000;
money = 7;
dropRate = 25;
}
override function special():Boolean{
var b:int;
var c:int;
var x2:int;
var y2:int;
w++;
u = (u + 0.02);
if (t == 360){
t = 0;
};
if ((((mode == 0)) && ((w > 60)))){
if ((t % 50) == 0){
parent.addChild(new DualBall(x, y, ((getAngle((x + 40), y) + (Math.random() * 60)) - 39), (3 + (Math.random() * 2))));
};
} else {
if ((((mode == 1)) && ((w > 100)))){
if ((t % 22) < 4){
b = ((t % 18) * 10);
while (b < 360) {
c = 5;
while (c < 7) {
parent.addChild(new WaveBullet((x + 40), y, NaN, NaN, (b + a), c));
c = (c + 1);
};
b = (b + 40);
};
a = (a + 2);
};
if ((t % 50) < 3){
b = 5;
while (b < 15) {
parent.addChild(new RedBullet((x + 40), y, NaN, NaN, ((getAngle((x + 40), y) + (Math.random() * 10)) - 5), b));
b = (b + 2);
};
};
} else {
if ((((mode == 2)) && ((w > 80)))){
if ((t % 4) == 0){
parent.addChild(new ThunderBall((x - 40), y, ((t * 3) + (u * 3)), 3.5));
} else {
parent.addChild(new BigWhiteBullet((x - 40), y, NaN, NaN, ((t * 8) + (u * 5)), 4.5));
parent.addChild(new BigWhiteBullet((x - 40), y, NaN, NaN, (((t * 8) + (u * 5)) + 180), 4.5));
};
} else {
if ((((mode == 3)) && ((w > 100)))){
if ((t % 120) < 30){
parent.addChild(new RedBullet(-5, ((t % 120) * 20), NaN, NaN, ((Math.random() * 180) - 90), 3));
parent.addChild(new WhiteBullet(-5, ((t % 120) * 20), NaN, NaN, ((Math.random() * 180) - 90), 2));
} else {
if ((t % 120) < 60){
x2 = (((t % 120) - 30) * 17);
parent.addChild(new RedBullet(x2, 605, NaN, NaN, (-(Math.random()) * 180), 3));
parent.addChild(new WhiteBullet(x2, 605, NaN, NaN, (-(Math.random()) * 180), 2));
} else {
if ((t % 120) < 90){
y2 = (600 - (((t % 120) - 60) * 20));
parent.addChild(new RedBullet(505, y2, NaN, NaN, ((Math.random() * 180) + 90), 3));
parent.addChild(new WhiteBullet(505, y2, NaN, NaN, ((Math.random() * 180) + 90), 2));
} else {
x2 = (500 - (((t % 120) - 90) * 17));
parent.addChild(new RedBullet(x2, -5, NaN, NaN, (Math.random() * 180), 3));
parent.addChild(new WhiteBullet(x2, -5, NaN, NaN, (Math.random() * 180), 2));
};
};
};
} else {
if ((((mode == 4)) && ((w > 80)))){
if ((t % 8) == 0){
parent.addChild(new BubbleBall((x - 40), y, NaN, NaN, ((t * 3) + (u * 3)), 3.5));
};
} else {
if ((((mode == 5)) && ((w > 150)))){
if ((t % 4) == 0){
b = 0;
while (b < 360) {
parent.addChild(new GodDiamond((x - 40), y, ((b - (t % 30)) + (u * 2)), 6));
parent.addChild(new GodDiamond((x - 40), y, ((b + (t % 30)) + (u * 2)), 6));
b = (b + 60);
};
};
if ((t % 4) == 2){
b = 0;
while (b < 360) {
parent.addChild(new RedDiamond((x + 40), y, NaN, NaN, ((b - (t % 30)) + u), 3));
parent.addChild(new RedDiamond((x + 40), y, NaN, NaN, ((b + (t % 30)) + u), 3));
b = (b + 60);
};
};
} else {
if ((((mode == 9)) && ((w > 80)))){
parent.addChild(new GodDiamond((x - 40), y, ((getAngle((x - 40), y) + ((t % 60) * 4)) - (60 * 2)), 4));
parent.addChild(new GodDiamond((x - 40), y, ((getAngle((x - 40), y) - ((t % 60) * 4)) + (60 * 2)), 4));
parent.addChild(new GodBullet((x - 40), y, ((getAngle((x - 40), y) + ((t % 60) * 6)) - (60 * 3)), 3));
parent.addChild(new GodBullet((x - 40), y, ((getAngle((x - 40), y) - ((t % 60) * 6)) + (60 * 3)), 3));
parent.addChild(new DevilBullet2((x + 40), y, ((getAngle((x + 40), y) + ((t % 40) * 4)) - (40 * 2)), 5));
parent.addChild(new DevilBullet2((x + 40), y, ((getAngle((x + 40), y) - ((t % 40) * 4)) + (40 * 2)), 5));
parent.addChild(new DevilBullet((x + 40), y, ((getAngle((x + 40), y) + ((t % 40) * 6)) - (40 * 3)), 2.5));
parent.addChild(new DevilBullet((x + 40), y, ((getAngle((x + 40), y) - ((t % 40) * 6)) + (40 * 3)), 2.5));
} else {
if ((((mode == 10)) && ((w > 80)))){
if ((t % 2)){
if ((t % 120) < 10){
b = 0;
while (b < 360) {
parent.addChild(new WhiteBullet((x - 40), y, NaN, NaN, (b + u), ((t % 120) + 2)));
b = (b + 60);
};
};
if (((((t % 120) < 34)) && (((t % 120) >= 20)))){
b = 0;
while (b < 360) {
parent.addChild(new ThunderBall((x - 40), y, (b + u), ((t % 120) - 16)));
parent.addChild(new BigWhiteBullet((x - 40), y, NaN, NaN, (Math.random() * 360), ((((t % 120) - 20) + 6) / 2)));
parent.addChild(new BigWhiteBullet((x - 40), y, NaN, NaN, (Math.random() * 360), ((((t % 120) - 20) + 6) / 2)));
b = (b + 60);
};
};
if (((((t % 120) < 76)) && (((t % 120) >= 60)))){
b = 0;
while (b < 360) {
parent.addChild(new FlameBullet((x + 40), y, NaN, NaN, (b + u), (((t % 120) - 60) + 4)));
b = (b + 60);
};
};
if (((((t % 120) < 106)) && (((t % 120) >= 90)))){
b = 0;
while (b < 360) {
parent.addChild(new DemonBullet((x + 40), y, NaN, NaN, (b + u), (((t % 120) - 90) + 6)));
parent.addChild(new WaveBullet2((x + 40), y, NaN, NaN, (Math.random() * 360), ((((t % 120) - 90) + 4) / 2)));
parent.addChild(new WaveBullet2((x + 40), y, NaN, NaN, (Math.random() * 360), ((((t % 120) - 90) + 4) / 2)));
b = (b + 60);
};
};
};
} else {
if ((((mode == 11)) && ((w > 50)))){
u = (u + 0.4);
if ((t % 2) == 0){
if ((t % 120) < 50){
b = 0;
while (b < 360) {
parent.addChild(new WhiteBullet((x - 40), y, NaN, NaN, (b + u), (((t % 120) + 2) / 2)));
parent.addChild(new GodDiamond((x - 40), y, (b + u), (((t % 120) + 2) / 3)));
b = (b + 60);
};
};
if (((((t % 120) < 56)) && (((t % 120) >= 30)))){
b = 0;
while (b < 360) {
if ((t % 4) == 0){
parent.addChild(new BubbleBall((x - 40), y, NaN, NaN, (b + u), (((t % 120) - 16) / 2)));
};
parent.addChild(new BigWhiteBullet((x - 40), y, NaN, NaN, (Math.random() * 360), ((((t % 120) - 20) + 5) / 6)));
parent.addChild(new BigWhiteBullet((x - 40), y, NaN, NaN, (Math.random() * 360), ((((t % 120) - 20) + 15) / 5)));
parent.addChild(new BigWhiteBullet((x - 40), y, NaN, NaN, (Math.random() * 360), ((((t % 120) - 20) + 15) / 5)));
parent.addChild(new BigWhiteBullet((x - 40), y, NaN, NaN, (Math.random() * 360), ((((t % 120) - 20) + 10) / 5)));
b = (b + 60);
};
};
if (((((t % 120) < 102)) && (((t % 120) >= 62)))){
b = 0;
while (b < 360) {
parent.addChild(new OrangeLazor((x + 40), y, NaN, NaN, (b + u), ((((t % 120) - 60) + 2) * 0.9)));
parent.addChild(new FlameBullet((x + 40), y, NaN, NaN, (b + u), ((((t % 120) - 60) + 2) * 0.6)));
b = (b + 60);
};
};
if (((((t % 120) < 88)) && (((t % 120) >= 70)))){
b = 0;
while (b < 360) {
parent.addChild(new WaveBullet2((x + 40), y, NaN, NaN, (Math.random() * 360), (((t % 120) - 64) / 2)));
parent.addChild(new WaveBullet2((x + 40), y, NaN, NaN, (Math.random() * 360), (((t % 120) - 64) / 2)));
parent.addChild(new WaveBullet2((x + 40), y, NaN, NaN, (Math.random() * 360), (((t % 120) - 64) / 2)));
b = (b + 60);
};
};
if (((((t % 120) < 120)) && (((t % 120) >= 90)))){
b = 0;
while (b < 360) {
parent.addChild(new DemonBullet((x + 40), y, NaN, NaN, (b + u), ((((t % 120) - 90) + 6) / 1.5)));
parent.addChild(new WaveBullet2((x + 40), y, NaN, NaN, (Math.random() * 360), ((((t % 120) - 90) + 20) / 5)));
parent.addChild(new WaveBullet2((x + 40), y, NaN, NaN, (Math.random() * 360), ((((t % 120) - 90) + 15) / 5)));
b = (b + 60);
};
};
};
} else {
if ((((mode == 6)) && ((w > 100)))){
parent.addChild(new WhiteBullet((x - 40), y, NaN, NaN, (Math.random() * 360), 2.5));
parent.addChild(new BigWhiteBullet((x - 40), y, NaN, NaN, (Math.random() * 360), 4));
parent.addChild(new BigWhiteBullet((x - 40), y, NaN, NaN, (Math.random() * 360), 5.5));
parent.addChild(new GlowBall((x - 40), y, (Math.random() * 360), 5));
parent.addChild(new BubbleBullet2((x - 40), y, NaN, NaN, (Math.random() * 360), 5));
parent.addChild(new BubbleBullet2((x - 40), y, NaN, NaN, (Math.random() * 360), 6));
} else {
if ((((mode == 7)) && ((w > 100)))){
parent.addChild(new WaveBullet((x + 40), y, NaN, NaN, (Math.random() * 360), 3));
parent.addChild(new WaveBullet2((x + 40), y, NaN, NaN, (Math.random() * 360), 2.5));
parent.addChild(new RedBullet((x + 40), y, NaN, NaN, (Math.random() * 360), 5));
parent.addChild(new DevilBullet((x + 40), y, (Math.random() * 360), 4));
if ((t % 3)){
parent.addChild(new DemonBullet((x + 40), y, NaN, NaN, (Math.random() * 360), 2));
};
parent.addChild(new YellowBullet((x + 40), y, NaN, NaN, (Math.random() * 360), 4.5));
} else {
if ((((mode == 8)) && ((w > 100)))){
parent.addChild(new WhiteBullet((x - 40), y, NaN, NaN, (Math.random() * 360), 2.5));
parent.addChild(new BigWhiteBullet((x - 40), y, NaN, NaN, (Math.random() * 360), 3));
parent.addChild(new BubbleBullet2((x - 40), y, NaN, NaN, (Math.random() * 360), 4));
parent.addChild(new BubbleBullet2((x - 40), y, NaN, NaN, (Math.random() * 360), 4.5));
parent.addChild(new SmallRedBullet((x + 40), y, NaN, NaN, (Math.random() * 360), 2.5));
parent.addChild(new WaveBullet((x + 40), y, NaN, NaN, (Math.random() * 360), 3));
parent.addChild(new RedBullet((x + 40), y, NaN, NaN, (Math.random() * 360), 5));
parent.addChild(new YellowBullet((x + 40), y, NaN, NaN, (Math.random() * 360), 4.5));
};
};
};
};
};
};
};
};
};
};
};
};
if (HP > ((maxHP * 11) / 12)){
if (mode != 0){
mode = 0;
superArmor = 0;
};
} else {
if (HP > ((maxHP * 10) / 12)){
if (mode != 1){
mode = 1;
nextPattern(5, 30);
w = 0;
};
} else {
if (HP > ((maxHP * 9) / 12)){
if (mode != 2){
mode = 2;
nextPattern(5, 30);
w = 0;
};
} else {
if (HP > ((maxHP * 8) / 12)){
if (mode != 3){
mode = 3;
nextPattern(5, 30);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 7) / 12)){
if (mode != 4){
mode = 4;
nextPattern(5, 30);
w = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 6) / 12)){
if (mode != 5){
mode = 5;
nextPattern(10, 30);
w = 0;
};
} else {
if (HP > ((maxHP * 5) / 12)){
if (mode != 6){
mode = 6;
nextPattern(15, 30);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 4) / 12)){
if (mode != 7){
mode = 7;
nextPattern(20, 30);
w = 0;
};
} else {
if (HP > ((maxHP * 3) / 12)){
if (mode != 8){
mode = 8;
nextPattern(25, 30);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 2) / 12)){
if (mode != 9){
mode = 9;
nextPattern(25, 30);
w = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 1) / 12)){
if (mode != 10){
mode = 10;
nextPattern(30, 30);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP < ((maxHP * 1) / 12)){
if (mode != 11){
mode = 11;
nextPattern(30, 30);
w = 0;
};
};
};
};
};
};
};
};
};
};
};
};
};
return (false);
}
}
}//package foes
Section 127
//Golem (foes.Golem)
package foes {
import bullets.*;
public class Golem extends Foe {
var decel:Number;
public function Golem(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 5, frame6, 6, frame7, 35, frame36);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(1700);
score = 20000;
money = 4;
dropRate = 40;
dropChance = 0;
deathSpin = false;
cutoff = 120;
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("explode", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("rock3", "f");
}
function frame36(){
if (this){
kill();
};
}
override function special():Boolean{
parent.addChild(new RedDiamond(x, (y - 5), NaN, NaN, (getAngle(x, y) + ((Math.sin(t) * 360) / 8)), 5));
parent.addChild(new RedDiamond(x, (y - 5), NaN, NaN, (getAngle(x, y) - ((Math.sin(t) * 360) / 8)), 5));
parent.addChild(new SmallRedBullet(x, (y - 5), NaN, NaN, ((getAngle(x, y) - 75) + (Math.random() * 150)), 4));
return (false);
}
}
}//package foes
Section 128
//GreenJelly (foes.GreenJelly)
package foes {
import bullets.*;
public class GreenJelly extends Foe {
var decel:Number;
public function GreenJelly(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(17);
score = 150;
money = 3;
dropRate = 0.7;
dropChance = 0.02;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("slime2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("slime", "f");
}
override function special():Boolean{
if ((t % delay) == 0){
parent.addChild(new LeafBullet(x, y, NaN, NaN, (Math.random() * 360), 3));
};
return (false);
}
}
}//package foes
Section 129
//GreenSlime (foes.GreenSlime)
package foes {
import bullets.*;
public class GreenSlime extends Foe {
public function GreenSlime(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 12, frame13);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(5);
score = 50;
money = 1;
dropRate = 0.5;
}
function frame13(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("slime2", "f");
}
function frame1(){
stop();
}
override public function death(){
var a:Number;
a = 0;
while (a < 4) {
parent.addChild(new GreenSlimeBullet(x, y, NaN, NaN, (Math.random() * 360), 5));
a++;
};
}
function frame2(){
(root as Main).makeSound("slime", "f");
}
}
}//package foes
Section 130
//GunBot (foes.GunBot)
package foes {
import bullets.*;
public class GunBot extends Foe {
public function GunBot(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 12, frame13);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(110);
this.boom = true;
score = 350;
money = 5;
dropRate = 1;
dropChance = 0.02;
}
function frame13(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("metal", "f");
}
function frame8(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new RedBullet((x - 30), (y + 40), NaN, NaN, ((90 + (Math.random() * 6)) - 3), 7));
parent.addChild(new RedBullet((x + 30), (y + 40), NaN, NaN, ((90 + (Math.random() * 6)) - 3), 7));
};
return (false);
}
}
}//package foes
Section 131
//HomingBomb (foes.HomingBomb)
package foes {
import flash.display.*;
import bullets.*;
public class HomingBomb extends Foe {
public var zone:MovieClip;
public function HomingBomb(a:Number, b:Number, c:Number, d:Number, type:Number){
addFrameScript(0, frame1, 6, frame7, 17, frame18);
super(a, b, c, d);
setHP(14);
this.type = type;
score = 12;
if (type == 2){
score = 18;
setHP(22);
this.scaleX = (this.scaleY = 1.4);
};
if (type == 0){
score = 6;
setHP(8);
this.scaleX = (this.scaleY = 0.7);
};
this.boom = true;
}
function frame18(){
if (this){
kill();
};
}
function frame7(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
override public function death(){
var a:Number;
if (type == 0){
parent.addChild(new HomingBullet(x, y, 4, 0));
parent.addChild(new HomingBullet(x, y, -4, 0));
};
if (type == 1){
parent.addChild(new HomingBullet(x, y, 3, 0));
parent.addChild(new HomingBullet(x, y, -3, 0));
parent.addChild(new HomingBullet(x, y, 0, 3));
parent.addChild(new HomingBullet(x, y, 0, -3));
};
if (type == 2){
a = 0;
while (a < 2) {
parent.addChild(new HomingBullet(x, y, (3 + a), 0));
parent.addChild(new HomingBullet(x, y, (-3 - a), 0));
parent.addChild(new HomingBullet(x, y, 0, (3 - a)));
parent.addChild(new HomingBullet(x, y, 0, (-3 - a)));
a++;
};
};
}
override function special():Boolean{
if (!zone){
return (false);
};
return (zone.hitTestPoint(player.x, player.y));
}
}
}//package foes
Section 132
//HugeBrick (foes.HugeBrick)
package foes {
public class HugeBrick extends Foe {
var decel:Number;
public function HugeBrick(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 5, frame6);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(Infinity);
score = 0;
money = 0;
dropRate = 0;
dropChance = 0;
cutoff = 200;
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
}
}//package foes
Section 133
//HugeRock (foes.HugeRock)
package foes {
import levels.*;
public class HugeRock extends Foe {
var b:Number;// = 3
public function HugeRock(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
b = 3;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 11, frame12);
super(x, y, xspeed, yspeed, motion);
this.delay = type;
setHP(90);
score = 300;
money = 4;
dropRate = 4;
dropChance = 0.25;
cutoff = 100;
deathSpin = false;
}
function frame12(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
override public function death(){
(parent as Level).addFoe(new BigRock(((x + (Math.random() * 100)) - 50), ((y + (Math.random() * 60)) - 30), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new BigRock(((x + (Math.random() * 100)) - 50), ((y + (Math.random() * 60)) - 30), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new MediumRock(((x + (Math.random() * 100)) - 50), ((y + (Math.random() * 60)) - 30), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new SmallRock(((x + (Math.random() * 100)) - 50), ((y + (Math.random() * 60)) - 30), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new SmallRock(((x + (Math.random() * 100)) - 50), ((y + (Math.random() * 60)) - 30), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new TinyRock(((x + (Math.random() * 100)) - 50), ((y + (Math.random() * 60)) - 30), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new TinyRock(((x + (Math.random() * 100)) - 50), ((y + (Math.random() * 60)) - 30), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
}
function frame2(){
(root as Main).makeSound("rock2", "f");
}
function frame8(){
(root as Main).makeSound("rock1", "f");
}
}
}//package foes
Section 134
//Hydra (foes.Hydra)
package foes {
import bullets.*;
public class Hydra extends Foe {
var left:Boolean;
var decel:Number;
var dir:Number;// = 0
var accel:Number;// = 0.2
var closed:Boolean;// = true
public function Hydra(x:Number, y:Number, left:Boolean, xspeed:Number, yspeed:Number, type:Number){
accel = 0.2;
closed = true;
dir = 0;
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 11, frame12, 12, frame13, 25, frame26);
super(x, y, xspeed, yspeed, 2);
if (left){
this.x = 600;
dir = 180;
} else {
this.x = -100;
this.scaleX = (this.scaleX * -1);
};
cutoff = 150;
this.left = left;
this.type = type;
setHP(200);
score = 800;
money = 6;
dropRate = 1;
deathSpin = false;
cutoff = 100;
}
function fire(){
var a:int;
a = 0;
while (a < 7) {
parent.addChild(new WaveBullet2(x, y, NaN, NaN, (((Math.random() * 20) - 10) + dir), ((Math.random() * 6) + 2)));
a++;
};
parent.addChild(new OrangeBullet(x, y, NaN, NaN, (((Math.random() * 20) - 10) + dir), ((Math.random() * 6) + 2)));
parent.addChild(new FlameBullet(x, y, NaN, NaN, (((Math.random() * 20) - 10) + dir), ((Math.random() * 6) + 2)));
}
function frame3(){
if (this){
fire();
};
}
function frame4(){
if (this){
fire();
};
}
function frame5(){
if (this){
fire();
};
}
function frame6(){
if (this){
fire();
};
}
function frame7(){
if (this){
fire();
};
}
function frame12(){
stop();
}
function frame13(){
(root as Main).makeSound("log2", "f");
}
function frame1(){
stop();
}
function frame2(){
if (this){
fire();
};
}
function frame8(){
if (this){
fire();
};
}
function frame9(){
if (this){
fire();
};
}
function frame26(){
if (this){
kill();
};
}
override function special():Boolean{
if (((((t % type) == 0)) && (closed))){
closed = false;
play();
};
return (false);
}
}
}//package foes
Section 135
//Kitten (foes.Kitten)
package foes {
public class Kitten extends Foe {
public function Kitten(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(1);
score = 30;
money = 1;
dropRate = 0.6;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("kitten", "f");
}
function frame1(){
kitten = (Math.floor((Math.random() * 6)) + 1);
stop();
}
}
}//package foes
Section 136
//LazorBot (foes.LazorBot)
package foes {
import bullets.*;
public class LazorBot extends Foe {
public function LazorBot(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 12, frame13);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(110);
this.boom = true;
score = 350;
money = 5;
dropRate = 1;
dropChance = 0.02;
}
function frame13(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("metal", "f");
}
function frame8(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
var a:int;
if ((t % type) == 0){
a = 4;
while (a > 0) {
parent.addChild(new RedLazor((x - 30), (y + 40), NaN, NaN, 90, (3 + a)));
parent.addChild(new RedLazor((x + 30), (y + 40), NaN, NaN, 90, (3 + a)));
a--;
};
};
return (false);
}
}
}//package foes
Section 137
//LeftLog (foes.LeftLog)
package foes {
public class LeftLog extends Foe {
public function LeftLog(a:Number, b:Number, c:Number, d:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 13, frame14);
super(a, b, c, d);
setHP(6);
score = 50;
deathSpin = false;
dropChance = 0;
}
function frame14(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("log", "f");
}
function frame8(){
(root as Main).makeSound("log2", "f");
}
}
}//package foes
Section 138
//Mage (foes.Mage)
package foes {
import bullets.*;
public class Mage extends Foe {
var decel:Number;
public function Mage(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 20, frame21);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(32);
score = 250;
money = 4;
dropRate = 1;
dropChance = 0.02;
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("eye", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("eye", "f");
}
function frame21(){
if (this){
kill();
};
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new OrangeBomb(x, y, NaN, NaN, getAngle(x, y), 4, Math.floor(((Math.random() * 30) + 60))));
};
return (false);
}
}
}//package foes
Section 139
//MediumRock (foes.MediumRock)
package foes {
import levels.*;
public class MediumRock extends Foe {
public function MediumRock(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 10, frame11);
super(x, y, xspeed, yspeed, motion);
this.delay = type;
setHP(12);
score = 100;
money = 2;
dropRate = 0.5;
dropChance = 0;
deathSpin = false;
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
override public function death(){
(parent as Level).addFoe(new SmallRock(((x + (Math.random() * 40)) - 20), ((y + (Math.random() * 40)) - 20), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new TinyRock(((x + (Math.random() * 40)) - 20), ((y + (Math.random() * 40)) - 20), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new SmallRock(((x + (Math.random() * 20)) - 10), ((y + (Math.random() * 20)) - 10), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new TinyRock(((x + (Math.random() * 20)) - 10), ((y + (Math.random() * 20)) - 10), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
}
function frame11(){
if (this){
kill();
};
}
function frame2(){
(root as Main).makeSound("rock4", "f");
}
function frame8(){
(root as Main).makeSound("rock3", "f");
}
}
}//package foes
Section 140
//Missile (foes.Missile)
package foes {
import bullets.*;
public class Missile extends Foe {
public function Missile(a:Number, b:Number, c:Number, d:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 17, frame18);
super(a, b, c, d);
setHP(60);
this.boom = true;
score = 0;
money = 0;
dropRate = 0;
dropChance = 0;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
override public function death(){
var a:Number;
a = 2;
while (a < 7) {
parent.addChild(new OrangeBullet(x, y, NaN, NaN, ((90 + (Math.random() * 60)) - 30), (5 + (Math.random() * 4))));
a++;
};
}
function frame2(){
(root as Main).makeSound("metal", "f");
}
function frame8(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
if (this.y > (player.y - 200)){
return (true);
};
return (false);
}
}
}//package foes
Section 141
//Monolith (foes.Monolith)
package foes {
import bullets.*;
public class Monolith extends Foe {
public function Monolith(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 35, frame36);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(1200);
score = 5000;
money = 7;
dropRate = 4;
dropChance = 0.1;
cutoff = 100;
deathSpin = false;
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("explode", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("rock3", "f");
}
function frame36(){
if (this){
kill();
};
}
override function special():Boolean{
var a:int;
var ss:Number;
if ((t % 30) == 0){
a = 0;
while (a < 360) {
parent.addChild(new RedBullet(x, y, NaN, NaN, (getAngle(x, y) + a), 5));
a = (a + 30);
};
};
if ((t % 30) == 1){
a = 10;
while (a < 360) {
parent.addChild(new RedBullet(x, y, NaN, NaN, (getAngle(x, y) + a), 5));
a = (a + 30);
};
};
if ((t % 30) == 2){
a = 20;
while (a < 360) {
parent.addChild(new RedBullet(x, y, NaN, NaN, (getAngle(x, y) + a), 5));
a = (a + 30);
};
};
if ((t % type) < 16){
ss = (2 + ((t % type) / 2));
parent.addChild(new RedDiamond(x, y, NaN, NaN, ((getAngle(x, y) + (Math.random() * 20)) - 10), (ss + (Math.random() * 2))));
parent.addChild(new RedBullet(x, y, NaN, NaN, ((getAngle(x, y) + (Math.random() * 10)) - 5), (ss + (Math.random() * 2))));
};
return (false);
}
}
}//package foes
Section 142
//Moor (foes.Moor)
package foes {
import bullets.*;
public class Moor extends Foe {
var left:Boolean;
var decel:Number;
var p:Number;// = 0
var accel:Number;// = 0.2
public function Moor(x:Number, y:Number, left:Boolean, type:Number){
accel = 0.2;
p = 0;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 14, frame15);
super(x, y, 0, 0, 0);
if (left){
this.x = 550;
this.scaleX = (this.scaleX * -1);
p = (p + 180);
} else {
this.x = -50;
};
cutoff = 150;
this.type = type;
this.left = left;
setHP(40);
score = 300;
money = 5;
dropRate = 1;
}
function frame15(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("fish2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("fish", "f");
}
override function special():Boolean{
p = (p + 4);
if (left){
xspeed = (xspeed - accel);
} else {
xspeed = (xspeed + accel);
};
if ((t % 2) == 0){
parent.addChild(new OrangeLazor(x, y, NaN, NaN, p, 3));
parent.addChild(new OrangeLazor(x, y, NaN, NaN, (360 - p), 3));
};
return (false);
}
}
}//package foes
Section 143
//Obelisk (foes.Obelisk)
package foes {
import bullets.*;
public class Obelisk extends Foe {
var decel:Number;
public function Obelisk(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 35, frame36);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(330);
score = 700;
money = 4;
dropRate = 5;
dropChance = 0.2;
deathSpin = false;
cutoff = 100;
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("explode", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("rock3", "f");
}
function frame36(){
if (this){
kill();
};
}
override function special():Boolean{
if ((t % type) < 25){
parent.addChild(new RedDiamond(x, (y - 16), NaN, NaN, ((getAngle(x, y) + (Math.random() * 20)) - 10), (4 + ((t % type) / 2))));
parent.addChild(new RedDiamond(x, (y - 16), NaN, NaN, (((getAngle(x, y) + (Math.random() * 20)) - 10) + 180), (4 + ((t % type) / 2))));
};
return (false);
}
}
}//package foes
Section 144
//PinkJelly (foes.PinkJelly)
package foes {
import bullets.*;
public class PinkJelly extends Foe {
var decel:Number;
public function PinkJelly(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(14);
score = 150;
money = 3;
dropRate = 0.5;
dropChance = 0.02;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("slime2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("slime", "f");
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new PinkBullet(x, y, 0, 3));
};
return (false);
}
}
}//package foes
Section 145
//PurpleJelly (foes.PurpleJelly)
package foes {
import bullets.*;
public class PurpleJelly extends Foe {
var decel:Number;
public function PurpleJelly(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 5, frame6, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(14);
score = 150;
money = 3;
dropRate = 0.5;
dropChance = 0.02;
}
function frame18(){
if (this){
kill();
};
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("slime2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("slime", "f");
}
override function special():Boolean{
if ((t % type) < 4){
parent.addChild(new PurpleBullet(x, y, NaN, NaN, getAngle(x, y), (6 + (t % type))));
};
return (false);
}
}
}//package foes
Section 146
//RedSlime (foes.RedSlime)
package foes {
import bullets.*;
public class RedSlime extends Foe {
public function RedSlime(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(32);
score = 150;
money = 4;
dropRate = 0.8;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("slime2", "f");
}
function frame1(){
stop();
}
override public function death(){
var a:Number;
a = 0;
while (a < 7) {
parent.addChild(new SmallRedBullet(x, y, NaN, NaN, (Math.random() * 360), (3 + (Math.random() * 3))));
a++;
};
}
function frame2(){
(root as Main).makeSound("slime", "f");
}
}
}//package foes
Section 147
//RightLog (foes.RightLog)
package foes {
public class RightLog extends Foe {
public function RightLog(a:Number, b:Number, c:Number, d:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 13, frame14);
super(a, b, c, d);
setHP(6);
score = 50;
deathSpin = false;
dropChance = 0;
}
function frame14(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("log", "f");
}
function frame8(){
(root as Main).makeSound("log2", "f");
}
}
}//package foes
Section 148
//SeaBomb (foes.SeaBomb)
package foes {
import bullets.*;
public class SeaBomb extends Foe {
var b:Number;
public function SeaBomb(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 6, frame7, 7, frame8, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.delay = type;
setHP(60);
score = 200;
money = 3;
dropRate = 5;
}
function frame18(){
if (this){
kill();
};
}
function frame7(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
override public function death(){
var a:Number;
trace("BOOM");
a = 0;
while (a < delay) {
parent.addChild(new SmallRedBullet(x, y, NaN, NaN, (Math.random() * 360), 6));
parent.addChild(new SmallRedBullet(x, y, NaN, NaN, (Math.random() * 360), 4));
a++;
};
}
function frame2(){
(root as Main).makeSound("metal", "f");
}
function frame8(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
if (this.y > player.y){
return (true);
};
return (false);
}
}
}//package foes
Section 149
//Shark (foes.Shark)
package foes {
import bullets.*;
public class Shark extends Foe {
var left:Boolean;
var decel:Number;
var accel:Number;// = 0.2
public function Shark(x:Number, y:Number, left:Boolean, type:Number){
accel = 0.2;
addFrameScript(0, frame1, 5, frame6, 20, frame21);
super(x, y, 0, 0, 0);
if (left){
this.x = 550;
this.scaleX = (this.scaleX * -1);
} else {
this.x = -50;
};
cutoff = 150;
this.type = type;
this.left = left;
setHP(70);
score = 300;
money = 4;
dropRate = 1;
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame21(){
if (this){
kill();
};
}
override function special():Boolean{
if (left){
xspeed = (xspeed - accel);
} else {
xspeed = (xspeed + accel);
};
if ((t % type) == 0){
parent.addChild(new BlueBullet(x, y, NaN, NaN, (Math.random() * 360), ((Math.random() * 2) + 3)));
};
return (false);
}
}
}//package foes
Section 150
//Shroom (foes.Shroom)
package foes {
import bullets.*;
public class Shroom extends Foe {
var decel:Number;
public function Shroom(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 18, frame19);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(12);
score = 100;
money = 2;
dropRate = 2;
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame19(){
if (this){
kill();
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("shroom", "f");
}
function frame8(){
(root as Main).makeSound("shroom2", "f");
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new SporeBullet(x, y, 0, 0));
};
return (false);
}
}
}//package foes
Section 151
//Shrub (foes.Shrub)
package foes {
import bullets.*;
public class Shrub extends Foe {
var decel:Number;
public function Shrub(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(24);
score = 100;
money = 4;
dropRate = 0.7;
dropChance = 0.03;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("bush2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("bush", "f");
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new FlameBullet(x, y, NaN, NaN, ((getAngle(x, y) + (Math.random() * 20)) - 10), 3));
};
return (false);
}
}
}//package foes
Section 152
//SlimeKing (foes.SlimeKing)
package foes {
import drops.*;
import bullets.*;
public class SlimeKing extends Foe {
var decel:Number;
var halt:Boolean;// = true
var b:Number;// = 1
var m:Number;// = 1
var p:Number;// = 0
var u:Number;// = 0
var o:Number;// = 0
var w:Number;// = 0
var bx2:Number;
var mode2:Number;// = 0
var mode:Number;// = 0
public function SlimeKing(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
p = 0;
o = 0;
b = 1;
m = 1;
halt = true;
mode = 0;
mode2 = 0;
w = 0;
u = 0;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 5, frame6, 9, frame10, 16, frame17, 21, frame22, 50, frame51);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(2000);
score = 20000;
money = 3;
dropRate = 25;
cutoff = 200;
deathSpin = false;
boss = true;
}
function frame10(){
(root as Main).makeSound("explode", "f");
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame6(){
(root as Main).makeSound("explode", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("slime", "f");
}
function frame17(){
(root as Main).makeSound("explode", "f");
}
function frame22(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
var a:int;
by = (y + 50);
bx = (x - 120);
bx2 = (x + 120);
w++;
if ((((mode == 1)) && ((w > 30)))){
parent.addChild(new YellowBullet(bx, by, NaN, NaN, (Math.random() * 360), 4));
parent.addChild(new YellowBullet(bx2, by, NaN, NaN, (Math.random() * 360), 4));
} else {
if ((((mode == 2)) && ((w > 70)))){
if ((t % 32) < 16){
parent.addChild(new YellowBullet(bx, by, NaN, NaN, getAngle(bx, by), (4 + (t % 16))));
parent.addChild(new YellowBullet(bx2, by, NaN, NaN, getAngle(bx2, by), (4 + (t % 16))));
};
} else {
if ((((mode == 3)) && ((w > 50)))){
a = 0;
while (a < 2) {
parent.addChild(new YellowBullet(bx, by, NaN, NaN, (Math.random() * 360), 3));
parent.addChild(new YellowBullet(bx2, by, NaN, NaN, (Math.random() * 360), 3));
a++;
};
} else {
if ((((mode == 4)) && ((w > 50)))){
a = 0;
while (a < 2) {
parent.addChild(new YellowBullet(bx2, by, NaN, NaN, ((-90 + ((t % 100) * 8)) + (Math.random() * 3)), (4 + a)));
parent.addChild(new YellowBullet(bx, by, NaN, NaN, ((-90 - ((t % 100) * 8)) + (Math.random() * 3)), (4 + a)));
a++;
};
} else {
if ((((mode == 5)) && ((w > 50)))){
if ((t % 5) == 0){
if ((t % 40) > 19){
b = 0;
while (b < 360) {
parent.addChild(new YellowBullet2(bx, by, NaN, NaN, ((b + ((t % 20) * 4)) + u), (2 + ((t % 20) / 5))));
parent.addChild(new YellowBullet2(bx2, by, NaN, NaN, ((b + ((t % 20) * 4)) + u), (2 + ((t % 20) / 5))));
u = (u + 0.3);
b = (b + 40);
};
};
};
};
};
};
};
};
if (HP > ((maxHP * 4) / 5)){
if (mode != 1){
mode = 1;
w = 0;
superArmor = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 3) / 5)){
if (mode != 2){
mode = 2;
w = 0;
superArmor = 60;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 2) / 5)){
if (mode != 3){
mode = 3;
w = 0;
superArmor = 60;
extraHeart();
};
} else {
if (HP > ((maxHP * 1) / 5)){
if (mode != 4){
mode = 4;
w = 0;
superArmor = 60;
parent.addChild(new Heart(x, y));
};
} else {
if (HP < ((maxHP * 1) / 5)){
if (mode != 5){
mode = 5;
w = 0;
superArmor = 60;
};
};
};
};
};
};
return (false);
}
function frame51(){
if (this){
kill();
};
}
}
}//package foes
Section 153
//SlimeKing2 (foes.SlimeKing2)
package foes {
import drops.*;
import bullets.*;
public class SlimeKing2 extends SlimeKing {
public function SlimeKing2(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
super(x, y, xspeed, yspeed, motion, type);
setHP(8000);
score = 100000;
money = 3;
dropRate = 25;
}
override function special():Boolean{
var a:int;
var b:int;
by = (y + 50);
bx = (x - 120);
bx2 = (x + 120);
w++;
if ((((mode == 1)) && ((w > 30)))){
if ((t % 5) == 0){
if ((t % 40) < 20){
b = 0;
while (b < 360) {
parent.addChild(new LeafBullet(bx, by, NaN, NaN, ((b + ((t % 20) * 6)) + u), (1.5 + ((t % 10) / 6))));
parent.addChild(new LeafBullet(bx2, by, NaN, NaN, ((b + ((t % 20) * 6)) + u), (1.5 + ((t % 10) / 6))));
u = (u + 0.1);
b = (b + 40);
};
};
if ((t % 40) > 19){
b = 0;
while (b < 360) {
parent.addChild(new YellowBullet2(bx, by, NaN, NaN, ((b + ((t % 20) * 4)) + u), (2 + ((t % 20) / 5))));
parent.addChild(new YellowBullet2(bx2, by, NaN, NaN, ((b + ((t % 20) * 4)) + u), (2 + ((t % 20) / 5))));
u = (u + 0.3);
b = (b + 40);
};
};
};
} else {
if ((((mode == 2)) && ((w > 140)))){
if ((t % 60) < 6){
b = 0;
while (b < 3) {
parent.addChild(new BigWhiteBullet(bx, by, NaN, NaN, ((getAngle(bx, by) + (Math.random() * 30)) - 15), (2 + ((t % 6) / 2))));
parent.addChild(new BigWhiteBullet(bx2, by, NaN, NaN, ((getAngle(bx2, by) + (Math.random() * 80)) - 40), (2 + ((t % 6) / 2))));
parent.addChild(new YellowBullet2(bx, by, NaN, NaN, ((getAngle(bx, by) + (Math.random() * 40)) - 20), (2 + ((t % 6) / 2))));
parent.addChild(new YellowBullet2(bx2, by, NaN, NaN, ((getAngle(bx2, by) + (Math.random() * 120)) - 60), (2 + ((t % 6) / 2))));
b++;
};
};
} else {
if ((((mode == 3)) && ((w > 50)))){
if ((t % 3) == 0){
b = 0;
while (b < 3) {
p = (p + 3);
parent.addChild(new LeafBullet(150, 150, NaN, NaN, (p + u), 2.5));
parent.addChild(new LeafBullet(350, 150, NaN, NaN, ((360 - p) + u), 2.5));
p = (p + 3);
parent.addChild(new YellowBullet(150, 150, NaN, NaN, (p + u), 1.8));
parent.addChild(new YellowBullet(350, 150, NaN, NaN, ((360 - p) + u), 1.8));
b++;
};
u = (u + 0.1);
};
} else {
if ((((mode == 4)) && ((w > 120)))){
b = 0;
while (b < 3) {
p = (p + 1);
if ((t % 2) == 0){
parent.addChild(new YellowBullet(bx, by, NaN, NaN, ((90 - p) + u), 2.5));
parent.addChild(new YellowBullet(bx2, by, NaN, NaN, ((90 + p) + u), 2.5));
u = (u + 0.2);
};
b++;
};
b = 0;
while (b < 3) {
p = (p + 1);
if ((t % 2) == 1){
parent.addChild(new YellowBullet(bx, by, NaN, NaN, (((90 - p) + u) + 192), 2.5));
parent.addChild(new YellowBullet(bx2, by, NaN, NaN, (((90 + p) + u) + 192), 2.5));
u = (u + 0.2);
};
b++;
};
} else {
if ((((mode == 5)) && ((w > 120)))){
parent.addChild(new GreenBullet(bx, by, ((-(t) * 6) - u), 5, (100 - (t % 100))));
parent.addChild(new GreenBullet(bx2, by, ((t * 6) + u), 5, (120 - (t % 100))));
parent.addChild(new GreenBullet(bx, by, (((-(t) * 6) - u) + 180), (3 + (t % 4)), (100 - (t % 100))));
parent.addChild(new GreenBullet(bx2, by, (((t * 6) + u) + 180), (3 + (t % 4)), (100 - (t % 100))));
parent.addChild(new LeafBullet(bx, by, NaN, NaN, ((-(t) * 5) - u), 3.5));
parent.addChild(new LeafBullet(bx2, by, NaN, NaN, ((t * 5) + u), 3.5));
u = (u + 0.4);
} else {
if ((((mode == 6)) && ((w > 120)))){
if ((t % 2) == 0){
parent.addChild(new GreenBall(bx, by, ((-(t) * 7) - u), 3));
parent.addChild(new GreenBall(bx2, by, ((t * 7) + u), 3));
parent.addChild(new LeafBullet(bx, by, NaN, NaN, ((-(t) * 5) - u), 6));
parent.addChild(new LeafBullet(bx2, by, NaN, NaN, ((t * 5) + u), 6));
parent.addChild(new GreenSlimeBullet(bx, by, NaN, NaN, ((-(t) * 6) - u), 4));
parent.addChild(new GreenSlimeBullet(bx2, by, NaN, NaN, ((t * 6) + u), 4));
parent.addChild(new GreenBullet(bx, by, ((-(t) * 9) - u), 5.5, (50 - (t % 50))));
parent.addChild(new GreenBullet(bx2, by, ((t * 9) + u), 5.5, (50 - (t % 50))));
u = (u + 0.1);
};
} else {
if ((((mode == 7)) && ((w > 120)))){
if ((t % 3) == 0){
if ((t % 40) < 20){
b = 0;
while (b < 360) {
parent.addChild(new LeafBullet(bx, by, NaN, NaN, ((b + ((t % 20) * 2)) + u), (1.5 + ((t % 20) / 4))));
parent.addChild(new LeafBullet(bx2, by, NaN, NaN, ((b + ((t % 20) * 2)) + u), (1.5 + ((t % 20) / 4))));
u = (u + 0.1);
b = (b + 40);
};
};
if ((t % 40) > 19){
b = 0;
while (b < 360) {
parent.addChild(new PurpleBullet(bx, by, NaN, NaN, ((b + ((t % 20) * 2)) + u), (1.5 + ((t % 20) / 5))));
parent.addChild(new PurpleBullet(bx2, by, NaN, NaN, ((b + ((t % 20) * 2)) + u), (1.5 + ((t % 20) / 5))));
u = (u + 0.3);
b = (b + 40);
};
};
};
} else {
if ((((mode == 8)) && ((w > 120)))){
o = (Math.sin(t) + 1);
if ((t % 2) == 0){
parent.addChild(new GreenBall(bx, by, ((-(t) * 7) - u), (2 + (o * 2))));
parent.addChild(new GreenBall(bx2, by, ((t * 7) + u), (2 + (o * 2))));
parent.addChild(new LeafBullet(bx, by, NaN, NaN, ((-(t) * 5) - u), (4 + o)));
parent.addChild(new LeafBullet(bx2, by, NaN, NaN, ((t * 5) + u), (4 + o)));
parent.addChild(new YellowBullet2(bx, by, NaN, NaN, ((-(t) * 6) - u), (3 + o)));
parent.addChild(new YellowBullet2(bx2, by, NaN, NaN, ((t * 6) + u), (3 + o)));
parent.addChild(new WhiteBullet(bx, by, NaN, NaN, ((-(t) * 7) - u), (2.5 + o)));
parent.addChild(new WhiteBullet(bx2, by, NaN, NaN, ((t * 7) + u), (2.5 + o)));
parent.addChild(new GreenBullet(bx, by, ((-(t) * 9) - u), (3 + (Math.random() * 2)), (80 - (t % 80))));
parent.addChild(new GreenBullet(bx2, by, ((t * 9) + u), (3 + (Math.random() * 2)), (80 - (t % 80))));
u = (u + 0.1);
};
};
};
};
};
};
};
};
};
if (HP > ((maxHP * 7) / 8)){
if (mode != 1){
mode = 1;
superArmor = 0;
};
} else {
if (HP > ((maxHP * 6) / 8)){
if (mode != 2){
mode = 2;
nextPattern(10, 20);
w = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 5) / 8)){
if (mode != 3){
mode = 3;
nextPattern(10, 20);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 4) / 8)){
if (mode != 4){
mode = 4;
nextPattern(15, 20);
w = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 3) / 8)){
if (mode != 5){
mode = 5;
nextPattern(15, 20);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 2) / 8)){
if (mode != 6){
mode = 6;
nextPattern(15, 20);
w = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 1) / 8)){
if (mode != 7){
mode = 7;
nextPattern(20, 20);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP < ((maxHP * 1) / 8)){
if (mode != 8){
mode = 8;
nextPattern(20, 20);
w = 0;
};
};
};
};
};
};
};
};
};
return (false);
}
}
}//package foes
Section 154
//Slinger (foes.Slinger)
package foes {
import bullets.*;
public class Slinger extends Foe {
var decel:Number;
public function Slinger(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 20, frame21);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(35);
score = 250;
money = 3;
dropRate = 3;
dropChance = 0.02;
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("metal", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("metal", "f");
}
function frame21(){
if (this){
kill();
};
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new OrangeBullet(x, y, NaN, NaN, getAngle(x, y), 7));
};
return (false);
}
}
}//package foes
Section 155
//SmallBrick (foes.SmallBrick)
package foes {
public class SmallBrick extends Foe {
var decel:Number;
public function SmallBrick(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 5, frame6);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(Infinity);
score = 0;
money = 0;
dropRate = 0;
dropChance = 0;
cutoff = 100;
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
}
}//package foes
Section 156
//SmallRock (foes.SmallRock)
package foes {
public class SmallRock extends Foe {
public function SmallRock(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 11, frame12);
super(x, y, xspeed, yspeed, motion);
this.delay = type;
setHP(4);
score = 0;
money = 1;
dropRate = 0.5;
dropChance = 0;
}
function frame12(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("rock5", "f");
}
function frame8(){
(root as Main).makeSound("rock4", "f");
}
}
}//package foes
Section 157
//Sphinx (foes.Sphinx)
package foes {
import drops.*;
import bullets.*;
public class Sphinx extends Foe {
var inc:Number;// = 1
var ball1:OrbitBall;
var ball2:OrbitBall;
var decel:Number;
var halt:Boolean;// = true
var b:Number;// = 1
var m:Number;// = 1
var p:Number;// = 0
var o:Number;// = 0
var w:Number;// = 0
var bx2:Number;
var mode2:Number;// = 0
var mode:Number;// = 0
public function Sphinx(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
p = 0;
o = 0;
b = 1;
m = 1;
halt = true;
mode = 0;
mode2 = 0;
w = 0;
inc = 1;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 8, frame9, 14, frame15, 22, frame23, 30, frame31, 37, frame38, 45, frame46, 76, frame77);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(25000);
score = 80000;
money = 6;
dropRate = 40;
cutoff = 200;
deathSpin = false;
boss = true;
}
function frame15(){
(root as Main).makeSound("explode", "f");
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame23(){
(root as Main).makeSound("explode", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("rock3", "f");
}
function frame31(){
(root as Main).makeSound("explode", "f");
}
function frame38(){
(root as Main).makeSound("explode", "f");
}
function frame9(){
(root as Main).makeSound("explode", "f");
}
function frame46(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
var b:int;
var a:uint;
by = (y + 50);
bx = (x - 120);
bx2 = (x + 120);
w++;
if (t == 360){
t = 0;
};
if ((((mode == 0)) && ((w > 60)))){
parent.addChild(new RedDiamond((x - 35), (y - 90), NaN, NaN, (t * 4), 5));
parent.addChild(new RedDiamond((x + 35), (y - 90), NaN, NaN, (360 - (t * 4)), 5));
parent.addChild(new OrangeLazor((x - 35), (y - 90), NaN, NaN, ((t * 4) + 2), 3));
parent.addChild(new OrangeLazor((x + 35), (y - 90), NaN, NaN, ((360 - (t * 4)) - 2), 3));
parent.addChild(new YellowBullet2((x - 35), (y - 90), NaN, NaN, ((t * 4) + 2), 7));
parent.addChild(new YellowBullet2((x + 35), (y - 90), NaN, NaN, ((360 - (t * 4)) - 2), 7));
} else {
if ((((mode == 1)) && ((w > 120)))){
if ((((ball1 == undefined)) || (ball1.dead))){
ball1 = new OrbitBall(0, 0, -90, 150);
parent.addChild(ball1);
};
} else {
if ((((mode == 2)) && ((w > 50)))){
if ((t % 10) == 0){
parent.addChild(new OrangeBomb(x, (y + 20), NaN, NaN, ((getAngle(x, y) + (Math.random() * 90)) - 45), ((Math.random() * 4) + 3), 40, 13));
};
} else {
if ((((mode == 3)) && ((w > 70)))){
if ((t % 90) < 9){
a = 18;
while (a > 0) {
parent.addChild(new RedDiamond((x - 100), (y - 60), NaN, NaN, (Math.random() * 360), ((Math.random() * 4) + 6)));
parent.addChild(new SmallRedBullet((x - 100), (y - 60), NaN, NaN, (Math.random() * 360), ((Math.random() * 2) + 3)));
a--;
};
};
if (((((t % 90) > 45)) && (((t % 90) < 53)))){
a = 18;
while (a > 0) {
parent.addChild(new RedDiamond((x + 100), (y - 60), NaN, NaN, (Math.random() * 360), ((Math.random() * 4) + 4)));
parent.addChild(new SmallRedBullet((x + 100), (y - 60), NaN, NaN, (Math.random() * 360), ((Math.random() * 2) + 3)));
a--;
};
};
} else {
if ((((mode == 4)) && ((w > 120)))){
if ((t % 45) == 0){
parent.addChild(new YellowBullet3(x, (y + 20), NaN, NaN, getAngle(x, y), 6, 6, 17, 3));
};
} else {
if ((((mode == 5)) && ((w > 40)))){
t++;
parent.addChild(new RedDiamond((x - 100), (y - 60), NaN, NaN, (getAngle(x, y) + ((Math.sin(t) * 360) / 6)), 5));
parent.addChild(new SmallRedBullet((x - 100), (y - 60), NaN, NaN, (getAngle(x, y) - ((Math.sin(t) * 360) / 6)), 5));
parent.addChild(new RedDiamond((x + 100), (y - 60), NaN, NaN, (getAngle(x, y) - ((Math.sin(t) * 360) / 6)), 5));
parent.addChild(new SmallRedBullet((x + 100), (y - 60), NaN, NaN, (getAngle(x, y) + ((Math.sin(t) * 360) / 6)), 5));
} else {
if ((((mode == 6)) && ((w > 60)))){
parent.addChild(new RedDiamond(x, (y - 30), NaN, NaN, (Math.random() * 360), 7));
parent.addChild(new RedDiamond(x, (y - 30), NaN, NaN, (Math.random() * 360), 5));
parent.addChild(new YellowBullet2(x, (y - 30), NaN, NaN, (Math.random() * 360), 4.5));
parent.addChild(new OrangeLazor(x, (y - 30), NaN, NaN, (Math.random() * 360), 4));
parent.addChild(new SmallRedBullet(x, (y - 30), NaN, NaN, (Math.random() * 360), 5.5));
parent.addChild(new YellowBullet(x, (y - 30), NaN, NaN, (Math.random() * 360), 3.5));
parent.addChild(new OrangeBullet(x, (y - 30), NaN, NaN, (Math.random() * 360), 6));
};
};
};
};
};
};
};
if (HP > ((maxHP * 6) / 7)){
if (mode != 0){
mode = 0;
w = 0;
superArmor = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 5) / 7)){
if (mode != 1){
mode = 1;
w = 0;
superArmor = 60;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 4) / 7)){
if (mode != 2){
mode = 2;
w = 0;
superArmor = 60;
ball1.play();
extraHeart();
};
} else {
if (HP > ((maxHP * 3) / 7)){
if (mode != 3){
mode = 3;
w = 0;
p = 0;
superArmor = 60;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 2) / 7)){
if (mode != 4){
mode = 4;
w = 0;
superArmor = 60;
extraHeart();
};
} else {
if (HP > ((maxHP * 1) / 7)){
if (mode != 5){
mode = 5;
w = 0;
superArmor = 60;
parent.addChild(new Heart(x, y));
};
} else {
if (HP <= ((maxHP * 1) / 7)){
if (mode != 6){
mode = 6;
w = 0;
superArmor = 60;
};
};
};
};
};
};
};
};
return (false);
}
function frame77(){
if (this){
kill();
};
}
}
}//package foes
Section 158
//Sphinx2 (foes.Sphinx2)
package foes {
import drops.*;
import bullets.*;
public class Sphinx2 extends Sphinx {
var u:Number;// = 0
public function Sphinx2(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
u = 0;
super(x, y, xspeed, yspeed, motion, type);
setHP(55000);
score = 400000;
money = 6;
dropRate = 30;
}
override function special():Boolean{
var b:int;
by = (y + 50);
bx = (x - 120);
bx2 = (x + 120);
w++;
u = (u + 0.2);
if (t == 360){
t = 0;
};
if ((((mode == 0)) && ((w > 60)))){
parent.addChild(new DemonBullet(x, (y + 20), NaN, NaN, ((t * 13) + u), 4));
parent.addChild(new OrangeBullet(x, (y + 20), NaN, NaN, ((t * 6) + u), 5));
parent.addChild(new OrangeBullet(x, (y + 20), NaN, NaN, ((t * 5) + u), 3));
parent.addChild(new OrangeLazor(x, (y + 20), NaN, NaN, ((t * 7) + u), 7));
} else {
if ((((mode == 1)) && ((w > 120)))){
if ((t % 8) == 0){
b = 3;
while (b < 9) {
parent.addChild(new DemonBullet(x, (y - 30), NaN, NaN, ((t * 2) + u), (4 + (b * 2))));
parent.addChild(new DemonBullet(x, (y - 30), NaN, NaN, (((t * 2) + u) + 180), (4 + (b * 2))));
b++;
};
};
if ((t % 30) == 0){
b = 0;
while (b < 360) {
parent.addChild(new OrangeLazor(x, (y - 30), NaN, NaN, (b + u), 6));
b = (b + 10);
};
};
if ((t % 30) == 10){
b = 0;
while (b < 360) {
parent.addChild(new OrangeBullet(x, (y - 30), NaN, NaN, (b + u), 5));
b = (b + 6);
};
};
if ((t % 30) == 20){
b = 0;
while (b < 360) {
parent.addChild(new WaveBullet2(x, (y - 30), NaN, NaN, (b + u), 4));
b = (b + 20);
};
};
} else {
if ((((mode == 2)) && ((w > 50)))){
if ((t % 2) == 0){
parent.addChild(new OrangeBullet((Math.random() * 500), -5, NaN, NaN, 90, (2 + (Math.random() * 2))));
};
if ((t % 200) == 0){
b = 0;
while (b < 8) {
parent.addChild(new BeamLazor((Math.random() * 500), 603, (((90 - 180) + (Math.random() * 30)) - 15)));
b++;
};
};
if ((t % 200) == 100){
b = 0;
while (b < 8) {
parent.addChild(new BeamLazor((Math.random() * 500), -3, ((90 + (Math.random() * 30)) - 15)));
b++;
};
};
if ((t % 200) == 50){
b = 0;
while (b < 9) {
parent.addChild(new BeamLazor(-3, (Math.random() * 600), ((0 + (Math.random() * 30)) - 15)));
b++;
};
};
if ((t % 200) == 150){
b = 0;
while (b < 9) {
parent.addChild(new BeamLazor(503, (Math.random() * 600), ((180 + (Math.random() * 30)) - 15)));
b++;
};
};
} else {
if ((((mode == 3)) && ((w > 70)))){
if ((t % 10) == 0){
parent.addChild(new OrangeBomb(x, (y - 20), NaN, NaN, (t * 3), 4, 40, 6));
};
if ((t % 5) == 0){
parent.addChild(new OrangeBomb(x, (y - 20), NaN, NaN, ((t * 3) + 180), 10, 48, 5));
};
} else {
if ((((mode == 4)) && ((w > 120)))){
if ((t % 50) == 0){
};
if ((t % 30) < 5){
b = 0;
while (b < 360) {
parent.addChild(new YellowBullet((x - 100), (y - 60), NaN, NaN, ((-(b) - (t * 8)) - u), 3));
parent.addChild(new YellowBullet((x + 100), (y - 60), NaN, NaN, ((b + (t * 8)) + u), 3));
b = (b + 60);
};
};
if ((t % 120) == 60){
b = 0;
while (b < 9) {
parent.addChild(new BeamLazor(-3, (Math.random() * 600), ((0 + (Math.random() * 30)) - 15)));
b++;
};
};
if ((t % 120) == 0){
b = 0;
while (b < 9) {
parent.addChild(new BeamLazor(503, (Math.random() * 600), ((180 + (Math.random() * 30)) - 15)));
b++;
};
};
} else {
if ((((mode == 5)) && ((w > 40)))){
if ((t % 80) < 40){
b = 0;
while (b < 360) {
parent.addChild(new WaveBullet2(x, (y + 20), NaN, NaN, ((b + ((t % 40) * 8)) + u), (2 + ((t % 40) / 13))));
b = (b + 90);
};
};
if ((t % 80) > 39){
b = 0;
while (b < 360) {
parent.addChild(new WaveBullet2(x, (y + 20), NaN, NaN, (((b + ((t % 40) * 8)) + 45) + u), (2 + ((49 - (t % 40)) / 10))));
b = (b + 90);
};
};
if ((t % 40) < 4){
b = 0;
while (b < 360) {
parent.addChild(new WaveBullet(x, (y + 20), NaN, NaN, (((b + ((t % 40) * 6)) + 45) + u), (2 + ((t % 40) / 2))));
b = (b + 30);
};
};
} else {
if ((((mode == 6)) && ((w > 60)))){
if ((t % 15) == 0){
parent.addChild(new HugeOrangeBullet((Math.random() * 500), -99, 90, (1.5 + (Math.random() * 2))));
};
if ((t % 10) == 0){
parent.addChild(new DemonBullet((Math.random() * 500), -39, NaN, NaN, 90, (3 + (Math.random() * 2))));
};
if ((t % 3) == 0){
parent.addChild(new OrangeBullet((Math.random() * 500), -5, NaN, NaN, 90, (3 + (Math.random() * 4))));
};
} else {
if ((((mode == 7)) && ((w > 60)))){
if ((t % 14) == 0){
parent.addChild(new HugeRedBullet((Math.random() * 500), 699, -90, (1.5 + (Math.random() * 2))));
};
if ((t % 2) == 0){
parent.addChild(new SmallRedBullet((Math.random() * 500), 606, NaN, NaN, -90, (3 + (Math.random() * 2))));
};
} else {
if ((((mode == 8)) && ((w > 100)))){
if ((t % 80) == 0){
parent.addChild(new PurpleBall((x - 100), (y - 60), NaN, NaN, getAngle((x - 100), (y - 60)), 6));
parent.addChild(new PurpleBall((x + 100), (y - 60), NaN, NaN, getAngle((x + 100), (y - 60)), 6));
};
if ((t % 50) < 8){
b = 0;
while (b < 360) {
parent.addChild(new PurpleBullet((x - 100), (y - 60), NaN, NaN, (b + (t * 5)), 4));
parent.addChild(new PurpleBullet((x + 100), (y - 60), NaN, NaN, (b + (t * 5)), 4));
b = (b + 60);
};
};
if ((t % 20) == 0){
b = 0;
while (b < 360) {
parent.addChild(new SmallRedBullet(x, (y - 30), NaN, NaN, (b + u), 5));
b = (b + 12);
};
};
if ((t % 20) == 5){
b = 0;
while (b < 360) {
parent.addChild(new RedBullet(x, (y - 30), NaN, NaN, (b + u), 7));
b = (b + 10);
};
};
} else {
if ((((mode == 9)) && ((w > 60)))){
parent.addChild(new WaveBullet(x, (y + 20), NaN, NaN, ((t * 9) + u), 4));
parent.addChild(new YellowBullet(x, (y + 20), NaN, NaN, ((t * 11) + u), 5));
parent.addChild(new OrangeBullet(x, (y + 20), NaN, NaN, ((t * 7.5) + u), 3.5));
parent.addChild(new LeafBullet(x, (y + 20), NaN, NaN, ((t * 9) + u), 4.5));
parent.addChild(new PurpleBullet(x, (y + 20), NaN, NaN, ((t * 7) + u), 6));
parent.addChild(new BlueWave(x, (y + 20), NaN, NaN, ((t * 10) + u), 3));
parent.addChild(new GreenSlimeBullet(x, (y + 20), NaN, NaN, ((t * 8.5) + u), 3.8));
};
};
};
};
};
};
};
};
};
};
if (HP > ((maxHP * 9) / 10)){
if (mode != 0){
mode = 0;
superArmor = 0;
};
} else {
if (HP > ((maxHP * 8) / 10)){
if (mode != 1){
mode = 1;
nextPattern(5, 30);
w = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 7) / 10)){
if (mode != 2){
mode = 2;
nextPattern(5, 30);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 6) / 10)){
if (mode != 3){
mode = 3;
nextPattern(10, 30);
w = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 5) / 10)){
if (mode != 4){
mode = 4;
nextPattern(15, 30);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 4) / 10)){
if (mode != 5){
mode = 5;
nextPattern(20, 30);
w = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 3) / 10)){
if (mode != 6){
mode = 6;
nextPattern(25, 30);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 2) / 10)){
if (mode != 7){
mode = 7;
nextPattern(25, 30);
w = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 1) / 10)){
if (mode != 8){
mode = 8;
nextPattern(30, 30);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP < ((maxHP * 1) / 10)){
if (mode != 9){
mode = 9;
nextPattern(30, 30);
w = 0;
};
};
};
};
};
};
};
};
};
};
};
return (false);
}
}
}//package foes
Section 159
//SpikeFish (foes.SpikeFish)
package foes {
import bullets.*;
public class SpikeFish extends Foe {
var decel:Number;
public function SpikeFish(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(90);
score = 250;
money = 5;
dropRate = 1;
}
override function specialHit(){
scaleX = (scaleX + 0.04);
scaleY = (scaleY + 0.04);
parent.addChild(new SpikeBullet(x, y, NaN, NaN, (Math.random() * 360), 3));
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("fish2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("fish", "f");
}
}
}//package foes
Section 160
//Spikes (foes.Spikes)
package foes {
public class Spikes extends Foe {
var decel:Number;
public function Spikes(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 6, frame7);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(Infinity);
score = 0;
money = 0;
dropRate = 0;
dropChance = 0;
cutoff = 100;
}
function frame7(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("metal", "f");
}
}
}//package foes
Section 161
//SteelBox (foes.SteelBox)
package foes {
public class SteelBox extends Foe {
public function SteelBox(a:Number, b:Number, c:Number, d:Number){
addFrameScript(0, frame1, 6, frame7, 17, frame18);
super(a, b, c, d);
setHP(30);
score = 10;
}
function frame18(){
if (this){
kill();
};
}
function frame7(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
}
}//package foes
Section 162
//Tank (foes.Tank)
package foes {
import levels.*;
import bullets.*;
public class Tank extends Foe {
public function Tank(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 32, frame33);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(900);
this.boom = true;
score = 2000;
money = 7;
dropRate = 3;
dropChance = 0.2;
cutoff = 100;
deathSpin = false;
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("metal", "f");
}
function frame33(){
if (this){
kill();
};
}
function frame8(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
if ((t % 2) == 0){
parent.addChild(new OrangeBullet(((x - 40) + (Math.random() * 80)), (y - 50), NaN, NaN, (((Math.random() * 30) - 15) - 90), 5));
};
if ((t % type) == 0){
(parent as Level).addFoe(new CrossBomb(((x + (Math.random() * 2)) - 1), (y + 40), 0, 6));
};
return (false);
}
}
}//package foes
Section 163
//TinyRock (foes.TinyRock)
package foes {
public class TinyRock extends Foe {
public function TinyRock(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 11, frame12);
super(x, y, xspeed, yspeed, motion);
this.delay = type;
setHP(2);
score = 0;
money = 0;
dropRate = 0;
dropChance = 0;
}
function frame12(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("rock5", "f");
}
function frame8(){
(root as Main).makeSound("rock4", "f");
}
}
}//package foes
Section 164
//Tree (foes.Tree)
package foes {
import bullets.*;
public class Tree extends Foe {
var decel:Number;
public function Tree(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(50);
score = 250;
money = 4;
dropRate = 1;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("log", "f");
}
function frame8(){
(root as Main).makeSound("log2", "f");
}
override function special():Boolean{
if ((t % type) < 5){
parent.addChild(new BigWhiteBullet(x, (y + 10), NaN, NaN, (getAngle(x, y) + ((t % type) * 3)), 6));
parent.addChild(new BigWhiteBullet(x, (y + 10), NaN, NaN, (getAngle(x, y) - ((t % type) * 3)), 6));
};
return (false);
}
}
}//package foes
Section 165
//Wasp (foes.Wasp)
package foes {
import bullets.*;
public class Wasp extends Foe {
var decel:Number;
public function Wasp(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 5, frame6, 6, frame7, 20, frame21);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(44);
score = 300;
money = 4;
dropRate = 2;
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("bug2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("bug", "f");
}
function frame21(){
if (this){
kill();
};
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new SmallRedBullet(x, y, NaN, NaN, (Math.random() * 360), 3));
};
return (false);
}
}
}//package foes
Section 166
//YellowJelly (foes.YellowJelly)
package foes {
import bullets.*;
public class YellowJelly extends Foe {
var decel:Number;
public function YellowJelly(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(23);
score = 150;
money = 2;
dropRate = 3;
dropChance = 0.02;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("slime2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("slime", "f");
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new YellowBall(x, y, NaN, NaN, ((getAngle(x, y) + (Math.random() * 20)) - 10), 12, 3));
};
return (false);
}
}
}//package foes
Section 167
//Level (levels.Level)
package levels {
import com.newgrounds.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import mochi.as3.*;
import foes.*;
import flash.text.*;
import drops.*;
import players.*;
import bullets.*;
import shots.*;
import misc.*;
import flash.geom.*;
public class Level extends MovieClip {
public var bestCombo:int;// = 0
var foeListP:int;// = 0
public var gameOff:Boolean;// = false
public var keyIsDown:Array;
var rank:Number;// = 0
public var xlimit:int;// = 500
public var bg:Number;
public var b:Number;// = 1
public var moneyCollected:int;// = 0
public var d:Number;// = 0
public var t:Number;// = 0
public var pauseMenu:PauseScreen;
private var ti:int;
public var levelNo:Number;
public var foesKilled:int;// = 0
public var comboCounter:int;// = 0
public var score:int;// = 0
public var totalFoes:int;// = 0
public var bomb:Boolean;// = false
public var theBomb:PlayerBomb;
var foe:Foe;
private var time:int;
public var player:Player;
private var fps:int;
var drop:Drop;
public var ylimit:int;// = 600
public var bullet:Bullet;
var shot:Shot;
public var noTip:Boolean;// = false
public var background:MovieClip;
public var hitsTaken:int;// = 0
public var gameOn:Number;// = 0
public var wait:Number;// = 1
public var foeList:Array;
public var bombsUsed:int;// = 0
public var level:Levels;
public var combo:int;// = 1
var levelEnded:Boolean;// = false
private var prevTime:int;// = 0
public var ready:MovieClip;
var aRanks:int;// = 0
public var bottomBar:MovieClip;
public var timeTaken:int;// = 0
public var pause:Boolean;// = false
public function Level(selectedPlayer:Number, selectedLevel:Number){
keyIsDown = [];
foeList = [];
score = 0;
xlimit = 500;
ylimit = 600;
b = 1;
t = 0;
d = 0;
gameOff = false;
gameOn = 0;
wait = 1;
combo = 1;
comboCounter = 0;
bomb = false;
bestCombo = 0;
hitsTaken = 0;
foesKilled = 0;
timeTaken = 0;
moneyCollected = 0;
totalFoes = 0;
pause = false;
bombsUsed = 0;
noTip = false;
prevTime = 0;
foeListP = 0;
rank = 0;
aRanks = 0;
levelEnded = false;
super();
trace("starting level");
Global.vars.bulletArray = [];
Global.vars.shotArray = [];
Global.vars.foeArray = [];
Global.vars.dropArray = [];
pauseMenu = new PauseScreen();
this.addChild(pauseMenu);
pauseMenu.x = 250;
pauseMenu.y = 300;
pauseMenu.visible = false;
this.levelNo = selectedLevel;
Medals.level = this;
if (selectedLevel == 0){
level = new Level0(this);
bg = 2;
BGM.play("starMusic");
};
if (selectedLevel == 1){
level = new Level1(this);
bg = 2;
BGM.play("starMusic");
};
if (selectedLevel == 2){
level = new Level2(this);
bg = 2;
BGM.play("starMusic");
};
if (selectedLevel == 3){
level = new Level3(this);
bg = 1;
BGM.play("starMusic");
};
if (selectedLevel == 4){
level = new Level4(this);
bg = 1;
BGM.play("starMusic");
};
if (selectedLevel == 5){
level = new Level5(this);
bg = 2;
BGM.play("starMusic");
};
if (selectedLevel == 21){
level = new Level21(this);
bg = 1;
BGM.play("starMusic");
};
if (selectedLevel == 6){
level = new Level6(this);
bg = 4;
BGM.play("waterMusic");
};
if (selectedLevel == 7){
level = new Level7(this);
bg = 4;
BGM.play("waterMusic");
};
if (selectedLevel == 8){
level = new Level8(this);
bg = 3;
BGM.play("waterMusic");
};
if (selectedLevel == 9){
level = new Level9(this);
bg = 3;
BGM.play("waterMusic");
};
if (selectedLevel == 10){
level = new Level10(this);
bg = 3;
BGM.play("waterMusic");
};
if (selectedLevel == 22){
level = new Level22(this);
bg = 3;
BGM.play("waterMusic");
};
if (selectedLevel == 11){
level = new Level11(this);
bg = 5;
BGM.play("neverMusic");
};
if (selectedLevel == 12){
level = new Level12(this);
bg = 5;
BGM.play("neverMusic");
};
if (selectedLevel == 13){
level = new Level13(this);
bg = 6;
BGM.play("neverMusic");
};
if (selectedLevel == 14){
level = new Level14(this);
bg = 5;
BGM.play("neverMusic");
};
if (selectedLevel == 15){
level = new Level15(this);
bg = 6;
BGM.play("neverMusic");
};
if (selectedLevel == 23){
level = new Level23(this);
bg = 6;
BGM.play("neverMusic");
};
if (selectedLevel == 16){
level = new Level16(this);
bg = 8;
BGM.play("spaceMusic");
};
if (selectedLevel == 17){
level = new Level17(this);
bg = 7;
BGM.play("spaceMusic");
};
if (selectedLevel == 18){
level = new Level18(this);
bg = 8;
BGM.play("spaceMusic");
};
if (selectedLevel == 19){
level = new Level19(this);
bg = 7;
BGM.play("spaceMusic");
};
if (selectedLevel == 20){
level = new Level20(this);
bg = 8;
BGM.play("spaceMusic");
};
if (selectedLevel == 24){
level = new Level24(this);
bg = 7;
BGM.play("bossMusic");
};
if (selectedLevel == 25){
level = new Level25(this);
bg = 8;
BGM.play("starMusic");
};
if (selectedPlayer == 0){
player = new NoLegs();
};
if (selectedPlayer == 1){
player = new Matt();
};
if (selectedPlayer == 2){
player = new Natalie();
};
if (selectedPlayer == 3){
player = new Lance();
};
if (selectedPlayer == 4){
player = new Anna();
};
this.addChild(player);
(player as Player).setup();
if (selectedLevel == 25){
(player as Player).survivalStats();
};
ready = new GetReady();
this.addChild(ready);
ready.x = (ready.x - 50);
ready.y = (ready.y + 150);
if (((!(level.survival)) && (Global.vars.options[16]))){
player.bombs = (player.bombs * 2);
};
bottomBar.bossHP.visible = false;
bottomBar.bombs.text = player.bombs;
bottomBar.bomb.gotoAndStop((player.playerNo + 15));
if (level.survival){
bottomBar.waves.gotoAndStop(2);
bottomBar.powah.gotoAndStop(2);
};
if ((player is NoLegs)){
bottomBar.weaponIcon1.gotoAndStop(1);
bottomBar.weaponIcon2.gotoAndStop(6);
bottomBar.p0.icons.gotoAndStop(1);
};
if ((player is Matt)){
bottomBar.weaponIcon1.gotoAndStop(2);
bottomBar.weaponIcon2.gotoAndStop(7);
bottomBar.p0.icons.gotoAndStop(2);
};
if ((player is Natalie)){
bottomBar.weaponIcon1.gotoAndStop(3);
bottomBar.weaponIcon2.gotoAndStop(8);
bottomBar.p0.icons.gotoAndStop(3);
};
if ((player is Lance)){
bottomBar.weaponIcon1.gotoAndStop(4);
bottomBar.weaponIcon2.gotoAndStop(9);
bottomBar.p0.icons.gotoAndStop(4);
};
if ((player is Anna)){
bottomBar.weaponIcon1.gotoAndStop(5);
bottomBar.weaponIcon2.gotoAndStop(10);
bottomBar.p0.icons.gotoAndStop(5);
};
addEventListener(Event.ENTER_FRAME, onFrame);
addEventListener(Event.ENTER_FRAME, getFps);
addEventListener(Event.ENTER_FRAME, moveBullets);
this.t = 0;
}
public function unlockMedal(medal:String){
var a:int;
a = 0;
while (a < Medals.medals.length) {
if (medal == Medals.medals[a].name){
if (Medals.locks[a]){
trace(("Medal already unlocked: " + a));
} else {
Medals.locks[a] = true;
Medals.current = Medals.medals[a].pic;
(bottomBar.medalBox as MovieClip).gotoAndPlay(0);
trace(("Unlocking medal: " + a));
API.unlockMedal(Medals.medals[a].name);
(root as Main).saveGame();
};
};
a++;
};
}
public function clearScore(){
var f:*;
combo = 1;
gameOff = true;
score = 0;
bottomBar.score.text = score;
bottomBar.multiplier.text = combo;
trace(("best combo: " + bestCombo));
trace(("foes killed: " + foesKilled));
t = 0;
for each (f in foeList) {
f.dead = true;
f.kill();
};
}
public function addFoe(foe:Foe):Foe{
addChild(foe);
foe.player = player;
foeList.push(foe);
if (foe.score != 0){
totalFoes++;
};
return (foe);
}
public function addScore(a:Number, x:Number, y:Number){
score = (score + (a * combo));
this.addChild(new ScoreLabel(a, combo, x, y));
bottomBar.score.text = score;
}
public function kongStats(){
var kongregate:*;
var meds:int;
var mm:int;
trace("SENDING STATS TO KONGREGATE");
kongregate = (root as Main).kongregate;
kongregate.stats.submit("totalKills", Medals.stats.kills);
kongregate.stats.submit("totalHits", Medals.stats.damage);
kongregate.stats.submit("totalPowerUps", Medals.stats.powerUps);
kongregate.stats.submit(("highScore" + levelNo), (parent as Main).levelScores[levelNo]);
kongregate.stats.submit("waves", (root as Main).survivalWaves);
kongregate.stats.submit("kills", (root as Main).survivalKills);
kongregate.stats.submit("maxMoney", (root as Main).money);
meds = 0;
mm = 0;
while (mm < Medals.locks.length) {
if (Medals.locks[mm] == true){
meds++;
};
mm++;
};
kongregate.stats.submit("medalsEarned", meds);
kongregate.stats.submit("Aranks", aRanks);
meds = 0;
mm = 0;
while (mm < (root as Main).playersUnlocked.length) {
if ((root as Main).playersUnlocked[mm] == true){
meds++;
};
mm++;
};
kongregate.stats.submit("playersUnlocked", meds);
meds = 0;
mm = 1;
while (mm <= 20) {
if ((root as Main).levelRanks[mm] >= 2){
meds++;
};
mm++;
};
kongregate.stats.submit("gameProgress", meds);
meds = 0;
mm = 21;
while (mm <= 24) {
if ((root as Main).levelRanks[mm] >= 2){
meds++;
};
mm++;
};
kongregate.stats.submit("bonusProgress", meds);
meds = 0;
mm = 1;
while (mm <= 24) {
if ((root as Main).levelRanks[mm] >= 2){
meds++;
};
mm++;
};
kongregate.stats.submit("levelProgress", meds);
}
public function addMoney(v:Number){
moneyCollected = (moneyCollected + v);
}
public function moveBullets(e:Event){
var i:int;
if (!pause){
i = 0;
while (i < Global.vars.bulletArray.length) {
bullet = Global.vars.bulletArray[i];
bullet.move();
if (bullet.dead){
i--;
};
i++;
};
foeListP = foesKilled;
i = 0;
while (i < foeList.length) {
foe = foeList[i];
foe.move();
if (foe.dead2){
i--;
foeListP++;
trace(foeListP);
};
i++;
};
i = 0;
while (i < Global.vars.shotArray.length) {
shot = Global.vars.shotArray[i];
shot.onFrame();
if (shot.dead2){
i--;
};
i++;
};
i = 0;
while (i < Global.vars.dropArray.length) {
drop = Global.vars.dropArray[i];
drop.onFrame();
if (drop.dead){
i--;
};
i++;
};
player.move();
if (((bomb) && (theBomb))){
theBomb.onFrame();
};
(parent as Main).countSound = 0;
updateBars();
if ((foesKilled - foeListP) >= 25){
Medals.unlockMedal("Ultimate Blade");
};
};
}
public function useBomb(){
bomb = true;
bombsUsed++;
bottomBar.bombs.text = player.bombs;
}
public function onFrame(e:Event){
var foe:Foe;
if (!pause){
if (((!(gameOff)) && (!(ready)))){
level.timer();
if (wait == 0){
level.spawn(t);
t++;
};
} else {
gameOn++;
if (gameOn == 30){
gameOn = 0;
gameOff = false;
t = 0;
};
};
comboCounter--;
if (comboCounter == 0){
addCombo(-10);
};
};
}
public function foeTimeOut(){
var i:int;
var foe:Foe;
trace("Time out!");
i = 0;
while (i < foeList.length) {
foe = foeList[i];
if (!foe.dead){
foe.timeOut();
if (foe.dead2){
i--;
};
};
i++;
};
}
public function exitLevel(){
kongStats();
Global.vars.bullets = 0;
removeEventListener(Event.ENTER_FRAME, onFrame);
removeEventListener(Event.ENTER_FRAME, moveBullets);
removeEventListener(Event.ENTER_FRAME, getFps);
if (!level.survival){
(parent as Main).money = ((parent as Main).money + moneyCollected);
trace(("adding money: " + moneyCollected));
moneyCollected = 0;
};
trace("BACK TO MENU");
(parent as MovieClip).gotoAndStop("levelSelect");
Medals.level = undefined;
parent.removeChild(this);
}
public function waitFor(foe:Foe):Foe{
foe.waitFlag = true;
wait++;
return (foe);
}
public function pauseGame(){
if (((!(levelEnded)) && (!(ready)))){
pause = !(pause);
if (pause){
BGM.pause();
background.stop();
} else {
BGM.resume();
if (Global.vars.options[0]){
background.play();
};
};
pauseMenu.visible = !(pauseMenu.visible);
if (pause){
setChildIndex(pauseMenu, (numChildren - 1));
setChildIndex(bottomBar, (numChildren - 1));
} else {
setChildIndex(bottomBar, 0);
};
};
}
public function winLevel(){
trace((((("killed " + foesKilled) + " / ") + totalFoes) + " foes."));
if (((((((parent as Main).levelRanks[(levelNo + 1)] < 0)) || (((parent as Main).levelRanks[(levelNo + 1)] == undefined)))) && (!(player.dead)))){
if (levelNo < 20){
trace(("unlocking level " + (levelNo + 1)));
(parent as Main).levelRanks[(levelNo + 1)] = 1;
(parent as Main).unlockedLevel = (levelNo + 1);
(parent as Main).levelUnlock = true;
};
};
endLevel();
}
public function updateBars(){
bottomBar.mainChargeBar.scaleX = (player.mainCharge / 100);
bottomBar.subChargeBar.scaleX = (player.subCharge / 100);
bottomBar.hpBar.scaleX = (player.HP / player.maxHP);
bottomBar.kills.text = foesKilled;
bottomBar.money.text = moneyCollected;
bottomBar.bullets.text = Global.vars.bullets;
bottomBar.health.text = player.HP;
bottomBar.main.text = Math.floor(player.mainCharge);
bottomBar.sub.text = Math.floor(player.subCharge);
if (ready){
setChildIndex(ready, (numChildren - 1));
};
setChildIndex(bottomBar, (numChildren - 1));
}
public function addHit(){
hitsTaken++;
combo = 1;
if (!level.survival){
score = (Math.floor((score * 0.09)) * 10);
bottomBar.hits.text = hitsTaken;
bottomBar.score.text = score;
};
}
public function unlockMedalNo(medal:Number){
if (Medals.locks[medal]){
trace(("Medal already unlocked: " + medal));
} else {
Medals.locks[medal] = true;
Medals.current = Medals.medals[medal].pic;
(bottomBar.medalBox as MovieClip).gotoAndPlay(0);
trace(("Unlocking medal: " + medal));
API.unlockMedal(Medals.medals[medal].name);
(root as Main).saveGame();
};
}
public function getMedals(){
var unbeaten:Boolean;
var a:int;
if ((((moneyCollected >= 3000)) && (!((levelNo == 25))))){
Medals.unlockMedal("Gold Farmer");
};
if ((((levelNo == 20)) && (!(player.dead)))){
Medals.unlockMedal("The End");
if (player.maxHP == 3){
Medals.unlockMedal("3 Heart Challenge");
};
};
if ((((score >= 500000)) && (!((levelNo == 25))))){
Medals.unlockMedal("500k");
};
if ((((score >= 1000000)) && (!((levelNo == 25))))){
Medals.unlockMedal("Millionaire");
};
if (aRanks >= 5){
Medals.unlockMedalNo(0);
(parent as Main).unlockPlayer(2);
};
if (aRanks >= 10){
Medals.unlockMedalNo(1);
(parent as Main).unlockPlayer(3);
};
if (aRanks >= 15){
Medals.unlockMedalNo(2);
(parent as Main).unlockPlayer(4);
};
if (aRanks >= 20){
Medals.unlockMedalNo(3);
};
if (aRanks >= 25){
Medals.unlockMedalNo(4);
};
unbeaten = false;
a = 0;
while (a < 4) {
if (((((((parent as Main).levelRanks[(21 + a)] == 0)) || (((parent as Main).levelRanks[(21 + a)] == 1)))) || (((parent as Main).levelRanks[(21 + a)] == undefined)))){
unbeaten = true;
};
a++;
};
if (!unbeaten){
Medals.unlockMedal("Bullet Master");
};
if ((((((hitsTaken == 0)) && ((levelNo > 15)))) && ((levelNo < 21)))){
Medals.unlockMedal("Perfect Run");
};
if (Medals.stats.powerUps >= 100){
Medals.unlockMedalNo(14);
};
if (Medals.stats.damage >= 100){
Medals.unlockMedalNo(15);
};
if (Medals.stats.kills >= 300){
Medals.unlockMedalNo(8);
};
if (Medals.stats.kills >= 1000){
Medals.unlockMedalNo(9);
(parent as Main).unlockPlayer(2);
};
if (Medals.stats.kills >= 3000){
Medals.unlockMedalNo(10);
(parent as Main).unlockPlayer(3);
};
if (Medals.stats.kills >= 10000){
Medals.unlockMedalNo(11);
(parent as Main).unlockPlayer(4);
};
if (foesKilled >= 1000){
Medals.unlockMedalNo(6);
};
trace(("Total Power Ups: " + Medals.stats.powerUps));
trace(("Total Damage: " + Medals.stats.damage));
trace(("Total Kills: " + Medals.stats.kills));
}
public function addItem(drop:Drop){
this.addChild(drop);
this.setChildIndex(drop, getChildIndex(player));
}
public function endLevel(){
var hasCheats:Boolean;
var bestWaves:Boolean;
var bestKills:Boolean;
var board:LevelEnd;
var a:int;
var j:int;
var percent:Number;
levelEnded = true;
background.stop();
root.stage.frameRate = 30;
pause = true;
Global.vars.bulletArray = [];
Global.vars.shotArray = [];
Global.vars.foeArray = [];
Global.vars.dropArray = [];
hasCheats = false;
bestWaves = false;
bestKills = false;
if (((((parent as Main).levelRanks[levelNo] < 2)) && (!(player.dead)))){
MochiEvents.trackEvent(("beat level " + levelNo));
trace("BEAT NEW LEVEL!!!");
};
rank = 0;
aRanks = 0;
if (level.survival){
if ((level as Level25).waveCount >= 100){
rank = 8;
} else {
if ((level as Level25).waveCount >= 80){
rank = 7;
} else {
if ((level as Level25).waveCount >= 60){
rank = 6;
} else {
if ((level as Level25).waveCount >= 40){
rank = 5;
} else {
if ((level as Level25).waveCount >= 20){
rank = 4;
} else {
if ((level as Level25).waveCount >= 10){
rank = 3;
} else {
rank = 2;
};
};
};
};
};
};
if ((level as Level25).waveCount > (root as Main).survivalWaves){
(root as Main).survivalWaves = (level as Level25).waveCount;
bestWaves = true;
};
if (foesKilled > (root as Main).survivalKills){
(root as Main).survivalKills = foesKilled;
bestKills = true;
};
} else {
percent = (20 + Math.floor((((foesKilled / totalFoes) * 80) - (hitsTaken * 4))));
if (Global.vars.options[13]){
percent = (percent - 12);
score = (score * 0.7);
hasCheats = true;
};
if (Global.vars.options[14]){
percent = (percent - 12);
score = (score * 0.7);
hasCheats = true;
};
if (Global.vars.options[15]){
percent = (percent - 12);
score = (score * 0.7);
hasCheats = true;
};
if (Global.vars.options[16]){
percent = (percent - 12);
score = (score * 0.7);
hasCheats = true;
};
score = (Math.floor((score / 10)) * 10);
if (percent >= 90){
rank = 8;
} else {
if (percent >= 80){
rank = 7;
} else {
if (percent >= 70){
rank = 6;
} else {
if (percent >= 60){
rank = 5;
} else {
if (percent >= 50){
rank = 4;
} else {
if (percent >= 40){
rank = 3;
} else {
rank = 2;
};
};
};
};
};
};
if (player.dead){
rank = 1;
};
};
board = new LevelEnd(score, (((foesKilled + " (") + Math.floor(((foesKilled / totalFoes) * 100))) + "%)"), hitsTaken, bestCombo, moneyCollected, rank);
this.addChild(board);
board.x = 250;
board.y = 300;
if (((!(hasCheats)) || (player.dead))){
board.cheats.visible = false;
};
Medals.stats.kills = (Medals.stats.kills + foesKilled);
var _local8 = Medals.stats.playerLevels;
var _local9 = player.playerNo;
var _local10 = (_local8[_local9] + 1);
_local8[_local9] = _local10;
trace((("Beaten " + Medals.stats.playerLevels[player.playerNo]) + " levels as this player"));
if (Medals.stats.playerLevels[player.playerNo] >= 9){
Medals.unlockMedalNo((16 + player.playerNo));
};
if (board.best1){
board.best1.visible = false;
};
if (level.survival){
board.gotoAndStop(2);
if (((board.best2) && (!(bestWaves)))){
board.best2.visible = false;
};
if (board.best3){
board.best3.visible = false;
};
if (((board.best4) && (!(bestKills)))){
board.best4.visible = false;
};
};
if ((parent as Main).levelRanks[levelNo] == undefined){
(parent as Main).levelRanks[levelNo] = 0;
};
if (rank > (parent as Main).levelRanks[levelNo]){
(parent as Main).levelRanks[levelNo] = rank;
};
if (score > (parent as Main).levelScores[levelNo]){
(parent as Main).levelScores[levelNo] = score;
if (board.best1){
board.best1.visible = true;
};
if (board.best3){
board.best3.visible = true;
};
};
for each (a in (parent as Main).levelRanks) {
if (a > 6){
aRanks++;
};
};
trace((("A or S ranks in " + aRanks) + " levels."));
for each (j in [21, 22, 23, 24]) {
if ((((aRanks >= ((j - 20) * 5))) && (((((parent as Main).levelRanks[j] < 0)) || (((parent as Main).levelRanks[j] == undefined)))))){
(parent as Main).levelRanks[j] = 1;
(parent as Main).unlockedLevel = j;
(parent as Main).levelUnlock = true;
};
};
trace(("rrrank: " + rank));
board.rr = rank;
getMedals();
kongStats();
Global.vars.bullets = 0;
(parent as Main).saveGame();
}
public function addCombo(n:Number){
combo = (combo + n);
if (combo > 9){
combo = 9;
};
if (combo < 1){
combo = 1;
};
comboCounter = 60;
}
private function getFps(e:Event):void{
ti++;
if ((ti % 30) == 0){
ti = 0;
time = getTimer();
fps = ((30000 / (time - prevTime)) + 1);
if (fps > 30){
fps = 30;
};
bottomBar.fps.text = ("" + fps);
prevTime = getTimer();
};
}
public function retryLevel(){
kongStats();
Global.vars.bullets = 0;
if (!level.survival){
(parent as Main).money = ((parent as Main).money + moneyCollected);
trace(("adding money: " + moneyCollected));
moneyCollected = 0;
};
trace("RETRY LEVEL");
(parent as Main).retryLevel();
}
}
}//package levels
Section 168
//Level0 (levels.Level0)
package levels {
import foes.*;
import bullets.*;
public class Level0 extends Levels {
var p:Number;// = 0
var s:Number;// = 0
public function Level0(l:Level){
p = 0;
s = 0;
super(l);
}
function makeCat(x:Number){
l.addFoe(new Kitten(x, -30, 0, 4, 0, 30));
}
function makeLog(x:Number){
l.addFoe(new BigLog(x, -30, 0, 4, 0, 30));
}
override public function spawn(t:Number){
var b:int;
if ((t % 1) == 0){
b = 0;
while (b < 4) {
p = (p + 3);
l.addChild(new LeafBullet(150, 150, NaN, NaN, p, 2));
l.addChild(new LeafBullet(350, 150, NaN, NaN, (360 - p), 2));
p = (p + 3);
l.addChild(new YellowBullet(150, 150, NaN, NaN, p, 1.5));
l.addChild(new YellowBullet(350, 150, NaN, NaN, (360 - p), 1.5));
b++;
};
};
switch (t){
};
}
function makeTank(x:Number){
l.addFoe(new CatRam(x, -49, 0, 4, 0, 30));
}
}
}//package levels
Section 169
//Level1 (levels.Level1)
package levels {
import foes.*;
public class Level1 extends Levels {
public function Level1(l:Level){
super(l);
}
function makeCat(x:Number){
l.addFoe(new Kitten(x, -30, 0, 4, 0, 30));
}
function makeLog(x:Number){
l.addFoe(new BigLog(x, -30, 0, 4, 0, 30));
}
override public function spawn(t:Number){
if (((((t % 13) == 0)) && ((t < 340)))){
makeCat(((Math.random() * 450) + 25));
};
if (((((((t % 12) == 0)) && ((t > 577)))) && ((t < 666)))){
makeCat(270);
makeCat(230);
};
if (((((((t % 12) == 0)) && ((t > 666)))) && ((t < 777)))){
makeCat(100);
makeCat(140);
makeCat(400);
makeCat(360);
};
if (((((((t % 12) == 0)) && ((t > 870)))) && ((t < 1000)))){
makeCat(((Math.random() * 450) + 25));
};
if (((((((t % 16) == 0)) && ((t > 1100)))) && ((t < 1220)))){
makeCat(100);
makeCat(140);
makeCat(400);
makeCat(360);
};
switch (t){
case 400:
makeCat(100);
makeCat(160);
makeLog(130);
break;
case 410:
makeCat(100);
makeCat(160);
break;
case 450:
makeCat(340);
makeCat(400);
makeLog(370);
break;
case 460:
makeCat(340);
makeCat(400);
break;
case 500:
makeCat(220);
makeCat(280);
makeLog(250);
break;
case 510:
makeCat(220);
makeCat(280);
break;
case 850:
makeTank(250).drop = "heart";
break;
case 890:
makeTank(200);
makeTank(300);
break;
case 1060:
makeTank(100);
makeTank(400);
break;
case 1160:
makeTank(250).drop = "heart";
makeLog(200);
makeLog(300);
break;
case 1440:
l.winLevel();
};
}
function makeTank(x:Number):Foe{
return (l.addFoe(new CatRam(x, -49, 0, 4, 0, 30)));
}
}
}//package levels
Section 170
//Level10 (levels.Level10)
package levels {
import foes.*;
public class Level10 extends Levels {
public function Level10(l:Level){
super(l);
}
function makeBushWall(yspeed:Number){
var b:Number;
b = 0;
while (b < 7) {
l.addFoe(new Bush((100 + (b * 50)), -30, 0, yspeed, 0, 20));
b++;
};
}
function makeLogWall(){
var b:Number;
b = 0;
while (b < 9) {
l.addFoe(new BigLog((50 + (b * 50)), -30, 0, 6, 0, 30));
b++;
};
}
function makeBush2(){
l.addFoe(new Bush(-30, -30, ((Math.random() * 5) + 8), ((Math.random() * 5) + 5), 2, 30));
}
function makeBush3(){
l.addFoe(new Bush(530, -30, ((-(Math.random()) * 5) - 8), ((Math.random() * 5) + 5), 2, 30));
}
function makeBigBush(x:Number){
l.addFoe(new BigBush(x, -49, 0, 4, 0, 3));
}
function makeBigBush2(x:Number){
makeBigBush(x);
makeBigBush((500 - x));
}
function makeLog(x:Number){
l.addFoe(new BigLog(x, -30, 0, 4, 0, 30));
}
function makeSlime(){
l.addFoe(new GreenSlime(((Math.random() * 450) + 25), -30, 0, 5, 0, 0));
}
override public function spawn(t:Number){
if (((((t % 12) == 0)) && ((t < 500)))){
l.addFoe(new PinkJelly(-30, 300, 6, 0, 0, 999990));
l.addFoe(new PurpleJelly(549, 250, -6, 0, 0, 999990));
};
if (((((t % 18) == 0)) && ((t < 500)))){
l.addFoe(new BlueJelly(-49, 150, 5.5, 0, 0, 10000));
l.addFoe(new GreenJelly(530, 200, -5.5, 0, 0, 10));
};
if (((((t % 24) == 0)) && ((t < 500)))){
l.addFoe(new YellowJelly(-30, 100, 5, 0, 0, 10000));
l.addFoe(new SpikeFish(530, 50, -5, 0, 0, 10000));
};
switch (t){
case 600:
l.waitFor(l.addFoe(new GiantCrab(250, -150, 0, 21, 3, 0)));
BGM.play("bossMusic");
break;
case 800:
l.winLevel();
break;
};
}
function makeBush(x:Number){
l.addFoe(new Bush(x, -49, 0, 4, 0, 30));
}
function makeTank(x:Number){
l.addFoe(new CatRam(x, -49, 0, 4, 0, 30));
}
}
}//package levels
Section 171
//Level11 (levels.Level11)
package levels {
import foes.*;
public class Level11 extends Levels {
public function Level11(l:Level){
super(l);
}
function makeTree(x:Number, y:Number){
return (l.waitFor(l.addFoe(new Tree(x, -49, 0, y, 3, 30))));
}
function makeWasps(i:int){
var n:int;
n = 0;
while (n < i) {
l.waitFor(l.addFoe(new Wasp(((Math.random() * 450) + 25), -49, 0, (11 + (Math.random() * 7)), 3, 1)));
n++;
};
}
function makeEye2(x:Number){
l.addFoe(new EyeBall(x, -30, 0, 3, 0, 50));
l.addFoe(new EyeBall((500 - x), -30, 0, 3, 0, 50));
}
function makeEye3(i:int){
var n:int;
n = 0;
while (n < i) {
l.addFoe(new EyeBall(((Math.random() * 450) + 25), -30, 0, (6 + (Math.random() * 5)), 0, 5000));
n++;
};
}
override public function spawn(t:Number){
if (((((t % 26) == 0)) && ((t < 500)))){
makeEye2(((Math.random() * 190) + 25));
};
if (((((((t % 46) == 0)) && ((t > 1650)))) && ((t < 2200)))){
l.addFoe(new Wasp(((Math.random() * 450) + 25), -30, 0, 4, 0, 1));
};
if (((((((t % 2) == 0)) && ((t > 660)))) && ((t < 674)))){
l.addFoe(new Shroom(530, (-50 + (40 * (t % 20))), -9, 0, 0, 4));
};
if (((((((t % 2) == 0)) && ((t > 900)))) && ((t < 914)))){
l.addFoe(new Shroom(-30, (-50 + (40 * (t % 20))), 9, 0, 0, 4));
};
switch (t){
case 570:
makeTree(150, 14);
makeTree(350, 14);
makeTree(250, 17);
break;
case 600:
makeTree(150, 16);
makeTree(350, 16);
makeTree(60, 13);
makeTree(440, 13);
makeTree(250, 17);
break;
case 800:
makeTree(170, 12);
makeTree(330, 12);
makeTree(150, 16);
makeTree(350, 16);
makeTree(60, 13);
makeTree(440, 13);
makeTree(250, 17);
break;
case 830:
makeTree(80, 11);
makeTree(420, 11);
makeTree(170, 12);
makeTree(330, 12);
makeTree(150, 16);
makeTree(350, 16);
makeTree(60, 13);
makeTree(440, 13);
makeTree(250, 17);
break;
case 970:
makeTree(170, 12);
makeTree(330, 12);
makeTree(150, 16);
makeTree(350, 16);
makeTree(60, 13);
makeTree(440, 13);
makeTree(250, 17);
makeEye3(3);
break;
case 1030:
makeTree(80, 11);
makeTree(420, 11);
makeTree(170, 12);
makeTree(330, 12);
makeTree(150, 16);
makeTree(350, 16);
makeTree(60, 13);
makeTree(440, 13);
makeEye3(5);
break;
case 1100:
makeEye3(8);
break;
case 1250:
makeEye3(12);
break;
case 1400:
makeEye3(16);
break;
case 1550:
makeEye3(20);
break;
case 2300:
makeWasps(2);
break;
case 2400:
makeWasps(4);
makeEye3(2);
break;
case 2500:
makeWasps(6);
makeEye3(4);
break;
case 2720:
l.winLevel();
break;
};
}
}
}//package levels
Section 172
//Level12 (levels.Level12)
package levels {
import foes.*;
public class Level12 extends Levels {
public function Level12(l:Level){
super(l);
}
function makeTree(x:Number, y:Number){
return (l.waitFor(l.addFoe(new Tree(x, -49, 0, y, 3, 30))));
}
function makeSlingers(i:int){
var n:int;
n = 0;
while (n < i) {
l.waitFor(l.addFoe(new Slinger(((Math.random() * 450) + 25), -49, 0, (7 + (Math.random() * 6)), 4, 6)));
n++;
};
}
function makeWasps(i:int){
var n:int;
n = 0;
while (n < i) {
l.waitFor(l.addFoe(new Wasp(((Math.random() * 450) + 25), -49, 0, (10 + (Math.random() * 14)), 3, 1)));
n++;
};
}
function makeEye2(x:Number){
l.addFoe(new EyeBall(x, -30, 0, 3, 0, 50));
l.addFoe(new EyeBall((500 - x), -30, 0, 3, 0, 50));
}
function makeEye3(i:int){
var n:int;
n = 0;
while (n < i) {
l.addFoe(new EyeBall(((Math.random() * 450) + 25), -30, 0, (6 + (Math.random() * 5)), 0, 5000));
n++;
};
}
function makeMages(i:int){
var n:int;
n = 0;
while (n < i) {
l.waitFor(l.addFoe(new Mage(((Math.random() * 450) + 25), -49, 0, (7 + (Math.random() * 6)), 4, 40)));
n++;
};
}
override public function spawn(t:Number){
if (((((((t % 150) == 0)) && ((t > 100)))) && ((t < 2000)))){
l.addFoe(new HugeRock(((Math.random() * 450) + 25), -90, 0, ((Math.random() * 2) + 3), 0, 4));
};
if (((((((t % 60) == 0)) && ((t > 100)))) && ((t < 2300)))){
l.addFoe(new BigRock(((Math.random() * 450) + 25), -30, 0, ((Math.random() * 3) + 3), 0, 4));
};
if (((((((t % 30) == 0)) && ((t > 100)))) && ((t < 2300)))){
l.addFoe(new MediumRock(((Math.random() * 450) + 25), -30, 0, ((Math.random() * 5) + 3), 0, 4));
};
if (((((((t % 15) == 0)) && ((t > 100)))) && ((t < 2300)))){
l.addFoe(new SmallRock(((Math.random() * 450) + 25), -30, 0, ((Math.random() * 5) + 3), 0, 4));
};
if (((((((t % 10) == 0)) && ((t > 100)))) && ((t < 2300)))){
l.addFoe(new TinyRock(((Math.random() * 450) + 25), -30, 0, ((Math.random() * 5) + 4), 0, 4));
};
if (((((((t % 35) == 0)) && ((t > 1100)))) && ((t < 2300)))){
l.addFoe(new Mage(((Math.random() * 450) + 25), -49, 0, 4, 0, 60));
};
if (((((((t % 80) == 0)) && ((t > 1600)))) && ((t < 2300)))){
l.addFoe(new Slinger(((Math.random() * 450) + 25), -49, 0, 5, 0, 10));
};
switch (t){
case 50:
makeWasps(7);
break;
case 200:
makeEye3(1);
break;
case 250:
makeEye3(2);
break;
case 300:
makeEye3(3);
break;
case 350:
makeEye3(4);
break;
case 400:
makeEye3(5);
break;
case 450:
makeEye3(6);
break;
case 500:
makeEye3(7);
break;
case 550:
makeWasps(2);
break;
case 600:
makeWasps(4);
break;
case 700:
makeSlingers(4);
break;
case 750:
makeMages(4);
break;
case 800:
makeSlingers(7);
break;
case 850:
makeMages(7);
break;
case 900:
makeSlingers(10);
break;
case 950:
makeMages(10);
break;
case 1000:
makeSlingers(9);
makeMages(9);
break;
case 2500:
l.winLevel();
break;
};
}
}
}//package levels
Section 173
//Level13 (levels.Level13)
package levels {
import foes.*;
public class Level13 extends Levels {
public function Level13(l:Level){
super(l);
l.t = 100;
}
function makeWall3(){
l.addFoe(new DoubleBrick(0, -70, 0, 7, 0, 0));
l.addFoe(new DoubleBrick(440, -70, 0, 7, 0, 0));
l.addFoe(new DoubleBrick(140, -70, 0, 7, 0, 0));
l.addFoe(new DoubleBrick(300, -70, 0, 7, 0, 0));
}
function makeSlingers(i:int){
var n:int;
n = 0;
while (n < i) {
l.waitFor(l.addFoe(new Slinger(((Math.random() * 450) + 25), -49, 0, (4 + (Math.random() * 3)), 0, 6)));
n++;
};
}
function makeTree(x:Number, y:Number){
return (l.waitFor(l.addFoe(new Tree(x, -49, 0, y, 3, 30))));
}
function makeCats1(){
l.addFoe(new DeadCat(230, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(270, -30, 0, 7, 0, 0));
}
function makeCat(xx:int){
l.addFoe(new DeadCat(xx, -30, 0, 7, 0, 0));
}
function makeMages(i:int){
var n:int;
n = 0;
while (n < i) {
l.waitFor(l.addFoe(new Mage(((Math.random() * 450) + 25), -49, 0, (4 + (Math.random() * 3)), 0, 40)));
n++;
};
}
function makeWasps(i:int){
var n:int;
n = 0;
while (n < i) {
l.addFoe(new Wasp(((Math.random() * 340) + 80), -49, 0, (7 + (Math.random() * 5)), 0, 1));
n++;
};
}
function makeCats2(){
l.addFoe(new DeadCat(420, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(370, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(80, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(130, -30, 0, 7, 0, 0));
}
function makeEye3(i:int){
var n:int;
n = 0;
while (n < i) {
l.addFoe(new EyeBall(((Math.random() * 450) + 25), -30, 0, (6 + (Math.random() * 5)), 0, 5000));
n++;
};
}
function makeBirds(i:int){
var n:int;
n = 0;
while (n < i) {
l.addFoe(new Bird(((Math.random() * 450) + 25), -49, 0, (5 + (Math.random() * 6)), 0, 6));
n++;
};
}
function makeEye2(x:Number){
l.addFoe(new EyeBall(x, -30, 0, 3, 0, 50));
l.addFoe(new EyeBall((500 - x), -30, 0, 3, 0, 50));
}
function makeWall1(){
l.addFoe(new HugeBrick(0, -70, 0, 7, 0, 0));
l.addFoe(new HugeBrick(300, -70, 0, 7, 0, 0));
}
function makeWall2(){
l.addFoe(new HugeBrick(150, -70, 0, 7, 0, 0));
l.addFoe(new DoubleBrick(0, -70, 0, 7, 0, 0));
l.addFoe(new DoubleBrick(440, -70, 0, 7, 0, 0));
}
override public function spawn(t:Number){
if (((((((t % 10) == 0)) && ((t > 120)))) && ((t < 900)))){
makeWall0();
};
switch (t){
case 30:
l.waitFor(l.addFoe(new Obelisk(250, -30, 0, 16, 3, 30)));
break;
case 90:
l.waitFor(l.addFoe(new Obelisk(100, -30, 0, 14, 3, 40)));
l.waitFor(l.addFoe(new Obelisk(400, -30, 0, 14, 3, 40)));
break;
case 120:
makeWall1();
break;
case 130:
makeWall1();
makeCats1();
break;
case 140:
makeWall1();
break;
case 150:
makeWall1();
makeCats1();
break;
case 160:
makeWall1();
break;
case 170:
makeWall1();
makeCats1();
break;
case 180:
makeWall1();
break;
case 190:
makeWall1();
makeCats1();
break;
case 200:
makeWall1();
break;
case 210:
makeWall1();
makeCats1();
break;
case 220:
makeWall0();
break;
case 230:
makeWall0();
break;
case 240:
makeWall2();
break;
case 250:
makeWall2();
makeCats2();
break;
case 260:
makeWall2();
break;
case 270:
makeWall2();
break;
case 280:
makeWall2();
break;
case 290:
makeWall2();
break;
case 300:
l.addFoe(new Spikes(20, -70, 0, 7, 0, 0));
l.addFoe(new HugeBrick(0, -120, 0, 7, 0, 0));
makeWall2();
break;
case 310:
makeWall2();
break;
case 370:
makeWasps(1);
break;
case 380:
makeWasps(1);
break;
case 390:
makeWasps(1);
break;
case 400:
makeWasps(1);
break;
case 410:
makeWasps(1);
break;
case 470:
makeWall2();
break;
case 480:
makeWall2();
makeCats2();
break;
case 490:
makeWall2();
break;
case 500:
makeWall2();
break;
case 510:
makeWall2();
break;
case 520:
makeWall2();
break;
case 530:
l.addFoe(new Spikes(320, -70, 0, 7, 0, 0));
l.addFoe(new HugeBrick(300, -120, 0, 7, 0, 0));
makeWall2();
break;
case 540:
makeWall2();
break;
case 640:
l.addFoe(new Obelisk(150, -30, 0, 8, 0, 40));
l.addFoe(new Obelisk(350, -30, 0, 8, 0, 40));
break;
case 750:
makeWall3();
makeCat(90);
makeCat(250);
makeCat(410);
break;
case 760:
makeWall3();
makeCat(90);
makeCat(250);
makeCat(410);
break;
case 770:
makeWall3();
makeCat(90);
break;
case 780:
makeWall3();
makeCat(90);
break;
case 790:
makeWall3();
makeCat(90);
break;
case 800:
makeWall3();
makeCat(90);
break;
case 810:
makeWall3();
makeCat(90);
break;
case 820:
makeWall3();
makeCat(90);
break;
case 830:
makeWall3();
makeCat(90);
break;
case 840:
makeWall3();
makeCat(90);
break;
case 850:
makeWall3();
makeCat(90);
break;
case 860:
makeWall3();
makeCat(90);
break;
case 900:
makeWall3();
makeCat(90);
makeCat(250);
makeCat(410);
break;
case 910:
makeWall3();
makeCat(90);
makeCat(250);
makeCat(410);
break;
case 920:
makeWall3();
makeCat(410);
break;
case 930:
makeWall3();
makeCat(410);
break;
case 940:
makeWall3();
makeCat(410);
break;
case 950:
makeWall3();
makeCat(410);
break;
case 960:
makeWall3();
makeCat(410);
break;
case 970:
makeWall3();
makeCat(410);
break;
case 980:
makeWall3();
makeCat(410);
break;
case 990:
makeWall3();
makeCat(410);
break;
case 1000:
makeWall3();
makeCat(410);
break;
case 1010:
makeWall3();
makeCat(410);
break;
case 1100:
l.waitFor(l.addFoe(new Obelisk(80, -30, 0, 13, 3, 60)));
l.waitFor(l.addFoe(new Obelisk(420, -30, 0, 13, 3, 60)));
l.waitFor(l.addFoe(new Obelisk(180, -30, 0, 16, 3, 60)));
l.waitFor(l.addFoe(new Obelisk(320, -30, 0, 16, 3, 60)));
break;
case 1160:
makeBirds(3);
break;
case 1220:
makeMages(2);
makeBirds(2);
break;
case 0x0500:
makeBirds(3);
break;
case 1340:
makeMages(2);
makeSlingers(2);
makeBirds(3);
break;
case 1400:
makeBirds(7);
break;
case 1560:
l.waitFor(l.addFoe(new Obelisk(530, 250, -15, 0, 1, 40)));
l.waitFor(l.addFoe(new Obelisk(-30, 250, 15, 0, 1, 40)));
l.waitFor(l.addFoe(new Obelisk(530, 350, -15, 0, 1, 40)));
l.waitFor(l.addFoe(new Obelisk(-30, 350, 15, 0, 1, 40)));
break;
case 1630:
l.waitFor(l.addFoe(new Obelisk(530, 300, -11, 0, 1, 40)));
l.waitFor(l.addFoe(new Obelisk(-30, 300, 11, 0, 1, 40)));
break;
case 1700:
l.waitFor(l.addFoe(new Golem(250, -100, 0, 16, 3, 30)));
break;
case 1900:
l.winLevel();
break;
};
}
function makeWall0(){
l.addFoe(new DoubleBrick(0, -70, 0, 7, 0, 0));
l.addFoe(new DoubleBrick(440, -70, 0, 7, 0, 0));
}
}
}//package levels
Section 174
//Level14 (levels.Level14)
package levels {
import foes.*;
public class Level14 extends Levels {
public function Level14(l:Level){
super(l);
}
function makeMage(x:int){
l.addFoe(new Mage(x, -30, 0, 5, 0, 60));
}
override public function spawn(t:Number){
var a:int;
if (((((((t % 20) == 0)) && ((t > 40)))) && ((t < 220)))){
makeCactus(((Math.random() * 400) + 50));
};
if (((((((t % 20) == 0)) && ((t > 360)))) && ((t < 500)))){
makeCactus(((Math.random() * 400) + 50));
};
if (((((((t % 30) == 0)) && ((t > 620)))) && ((t < 920)))){
makeCactus(((Math.random() * 400) + 50));
};
if (((((((t % 20) == 0)) && ((t > 620)))) && ((t < 850)))){
makeMage(((Math.random() * 400) + 50));
};
if (((((((t % 35) == 0)) && ((t > 1090)))) && ((t < 1450)))){
makeCactus(((Math.random() * 400) + 50));
};
if (((((((t % 45) == 0)) && ((t > 1090)))) && ((t < 1450)))){
makeMage(((Math.random() * 400) + 50));
};
if (((((((t % 50) == 0)) && ((t > 1090)))) && ((t < 1450)))){
makeSlinger(((Math.random() * 400) + 50));
};
if (((((((t % 8) == 0)) && ((t > 1700)))) && ((t < 2100)))){
makeEyeBit(((Math.random() * 400) + 50));
};
if (((((((t % 25) == 0)) && ((t > 1700)))) && ((t < 2100)))){
makeSlinger(((Math.random() * 400) + 50));
};
if (((((((t % 20) == 0)) && ((t > 2500)))) && ((t < 3000)))){
makeCactus(((Math.random() * 200) + 25));
makeCactus(((Math.random() * 200) + 275));
};
switch (t){
case 30:
makeEye(100, 15);
makeEye(400, 15);
break;
case 300:
makeEye(100, 15);
makeEye(400, 15);
makeEye(200, 18);
makeEye(300, 18);
break;
case 560:
makeEye(100, 15);
makeEye(400, 15);
makeEye(200, 18);
makeEye(300, 18);
break;
case 1000:
makeEye(100, 14);
makeEye(400, 14);
makeEye(200, 17);
makeEye(300, 17);
break;
case 1600:
makeEye(100, 14);
makeEye(400, 14);
makeEye(150, 19);
makeEye(350, 19);
makeEye(200, 17);
makeEye(300, 17);
break;
case 2250:
makeEye(100, 17);
makeEye(400, 17);
makeEye(200, 26);
makeEye(300, 26);
break;
case 2350:
a = 0;
while (a < 10) {
makeEyeBit(((Math.random() * 400) + 50));
a++;
};
break;
case 2400:
a = 0;
while (a < 10) {
makeEyeBit(((Math.random() * 400) + 50));
a++;
};
break;
case 2450:
a = 0;
while (a < 10) {
makeEyeBit(((Math.random() * 400) + 50));
a++;
};
break;
case 3220:
l.winLevel();
break;
};
}
function makeEye(x:Number, y:Number){
l.waitFor(l.addFoe(new EyeGuy(x, -70, 0, y, 3, 10)));
}
function makeSlinger(x:int){
l.addFoe(new Slinger(x, -30, 0, 5, 0, 7));
}
function makeEyeBit(x:int){
l.addFoe(new EyeBit(x, -30, 0, (5 + (Math.random() * 3)), 0, 0));
}
function makeSlingers(i:int){
var n:int;
n = 0;
while (n < i) {
l.waitFor(l.addFoe(new Slinger(((Math.random() * 450) + 25), -49, 0, (4 + (Math.random() * 3)), 0, 6)));
n++;
};
}
function makeCats2(){
l.addFoe(new DeadCat(420, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(370, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(80, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(130, -30, 0, 7, 0, 0));
}
function makeEye3(i:int){
var n:int;
n = 0;
while (n < i) {
l.addFoe(new EyeBall(((Math.random() * 450) + 25), -30, 0, (6 + (Math.random() * 5)), 0, 5000));
n++;
};
}
function makeHydra(y:Number, left:Boolean, xp:Number, tt:Number){
return (l.addFoe(new Hydra(0, y, left, xp, 4, tt)));
}
function makeGhost(x:Number, y:Number){
return (l.waitFor(l.addFoe(new Ghost(x, -50, 0, y, 3, 50))));
}
function makeCactus(x:int){
l.addFoe(new Cactus(x, -30, 0, 4, 0, 5));
}
}
}//package levels
Section 175
//Level15 (levels.Level15)
package levels {
import foes.*;
public class Level15 extends Levels {
public function Level15(l:Level){
super(l);
}
function makeWall3(){
l.addFoe(new DoubleBrick(0, -70, 0, 5, 0, 0));
l.addFoe(new DoubleBrick(440, -70, 0, 5, 0, 0));
l.addFoe(new DoubleBrick(140, -70, 0, 5, 0, 0));
l.addFoe(new DoubleBrick(300, -70, 0, 5, 0, 0));
}
function makeRow1(){
l.addFoe(new SmallBrick(0, -70, 0, 6, 0, 0));
l.addFoe(new SmallBrick(440, -70, 0, 6, 0, 0));
l.addFoe(new SmallBrick(140, -70, 0, 6, 0, 0));
l.addFoe(new SmallBrick(300, -70, 0, 6, 0, 0));
l.addFoe(new DeadCat(100, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(250, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(400, -40, 0, 6, 0, 0));
}
function makeRow2(){
l.addFoe(new BigBrick(0, -70, 0, 6, 0, 0));
l.addFoe(new BigBrick(380, -70, 0, 6, 0, 0));
l.addFoe(new DeadCat(200, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(250, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(300, -40, 0, 6, 0, 0));
}
function makeRow4(){
l.addFoe(new SmallBrick(50, -70, 0, 6, 0, 0));
l.addFoe(new SmallBrick(390, -70, 0, 6, 0, 0));
l.addFoe(new DeadCat(200, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(250, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(300, -40, 0, 6, 0, 0));
}
function makeRow5(){
l.addFoe(new BigBrick(190, -70, 0, 6, 0, 0));
l.addFoe(new DeadCat(350, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(400, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(450, -40, 0, 6, 0, 0));
}
function makeCats1(){
l.addFoe(new DeadCat(230, -30, 0, 5, 0, 0));
l.addFoe(new DeadCat(270, -30, 0, 5, 0, 0));
}
function makeRow3(){
l.addFoe(new BigBrick(190, -70, 0, 6, 0, 0));
l.addFoe(new DeadCat(50, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(100, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(150, -40, 0, 6, 0, 0));
}
function makeCats2(){
l.addFoe(new DeadCat(420, -30, 0, 5, 0, 0));
l.addFoe(new DeadCat(370, -30, 0, 5, 0, 0));
l.addFoe(new DeadCat(80, -30, 0, 5, 0, 0));
l.addFoe(new DeadCat(130, -30, 0, 5, 0, 0));
}
function makeCat(xx:int){
l.addFoe(new DeadCat(xx, -30, 0, 5, 0, 0));
}
function makeWall2(){
l.addFoe(new HugeBrick(150, -70, 0, 5, 0, 0));
l.addFoe(new DoubleBrick(0, -70, 0, 5, 0, 0));
l.addFoe(new DoubleBrick(440, -70, 0, 5, 0, 0));
}
override public function spawn(t:Number){
var b:int;
if (((((t % 30) == 0)) && ((t < 900)))){
b = (Math.random() * 5);
if (b == 0){
makeRow1();
};
if (b == 1){
makeRow2();
};
if (b == 2){
makeRow3();
};
if (b == 3){
makeRow4();
};
if (b == 4){
makeRow5();
};
};
if (((((t % 30) == 15)) && ((t < 900)))){
l.addFoe(new DeadCat(100, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(200, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(300, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(400, -40, 0, 6, 0, 0));
};
switch (t){
case 1030:
l.waitFor(l.addFoe(new Sphinx(250, -150, 0, 23, 3, 0)));
BGM.play("bossMusic");
break;
case 1150:
l.winLevel();
break;
};
}
function makeWall0(){
l.addFoe(new DoubleBrick(0, -70, 0, 5, 0, 0));
l.addFoe(new DoubleBrick(440, -70, 0, 5, 0, 0));
}
}
}//package levels
Section 176
//Level16 (levels.Level16)
package levels {
import foes.*;
public class Level16 extends Levels {
public function Level16(l:Level){
super(l);
}
function makeMage(x:int){
l.addFoe(new Mage(x, -30, 0, 5, 0, 60));
}
function makeCactus(x:int){
l.addFoe(new Cactus(x, -30, 0, 4, 0, 5));
}
function makeEye(x:Number, y:Number){
l.waitFor(l.addFoe(new EyeGuy(x, -70, 0, y, 3, 10)));
}
function makeShrubWall(yspeed:Number){
var b:Number;
b = 0;
while (b < 7) {
l.waitFor(l.addFoe(new Shrub((100 + (b * 50)), -30, 0, yspeed, 3, 17)));
b++;
};
}
function makeSlinger(x:int){
l.addFoe(new Slinger(x, -30, 0, 5, 0, 7));
}
function makeEyeBit(x:int){
l.addFoe(new EyeBit(x, -30, 0, (5 + (Math.random() * 3)), 0, 0));
}
function makeSlingers(i:int){
var n:int;
n = 0;
while (n < i) {
l.waitFor(l.addFoe(new Slinger(((Math.random() * 450) + 25), -49, 0, (4 + (Math.random() * 3)), 0, 6)));
n++;
};
}
function makeCats2(){
l.addFoe(new DeadCat(420, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(370, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(80, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(130, -30, 0, 7, 0, 0));
}
function makeEye3(i:int){
var n:int;
n = 0;
while (n < i) {
l.addFoe(new EyeBall(((Math.random() * 450) + 25), -30, 0, (6 + (Math.random() * 5)), 0, 5000));
n++;
};
}
function makeGhost2(x:Number){
return (l.addFoe(new Ghost(x, -50, 0, 4, 0, 50)));
}
function makeHydra(y:Number, left:Boolean, xp:Number, tt:Number){
if (!left){
return (l.addFoe(new Hydra(0, (((l.player.y * 5) / 6) + 50), left, xp, 0, tt)));
};
return (l.addFoe(new Hydra(500, (((l.player.y * 5) / 6) + 50), left, -(xp), 0, tt)));
}
function makeShrubs(x:int){
l.addFoe(new Shrub(x, -30, 0, 4, 0, 17));
l.addFoe(new Shrub((500 - x), -30, 0, 4, 0, 17));
}
function makeGhost(x:Number, y:Number){
return (l.waitFor(l.addFoe(new Ghost(x, -50, 0, y, 3, 50))));
}
override public function spawn(t:Number){
if (((((((t % 20) == 0)) && ((t > 0)))) && ((t < 120)))){
makeShrubs(170);
makeShrubs(223);
};
if (((((((t % 20) == 0)) && ((t >= 120)))) && ((t < 240)))){
makeShrubs(50);
makeShrubs(120);
};
if (((((((t % 30) == 0)) && ((t >= 1400)))) && ((t < 1900)))){
makeShrubs(((Math.random() * 200) + 25));
};
if (((((((t % 200) == 100)) && ((t >= 1400)))) && ((t < 2500)))){
makeHydra(((Math.random() * 500) + 50), false, 10, 40);
};
if (((((((t % 200) == 0)) && ((t >= 1400)))) && ((t < 2500)))){
makeHydra(((Math.random() * 500) + 50), true, 10, 40);
};
if (((((((t % 80) == 0)) && ((t >= 2000)))) && ((t < 2500)))){
makeGhost2(((Math.random() * 200) + 25));
};
switch (t){
case 300:
makeShrubWall(10);
makeShrubWall(17);
break;
case 360:
makeShrubWall(12);
makeShrubWall(17);
makeShrubWall(22);
break;
case 420:
l.waitFor(l.addFoe(new BigShrub(250, -80, 0, 15, 3, 0)));
break;
case 500:
makeShrubWall(10);
makeShrubWall(15);
makeShrubWall(20);
makeShrubWall(25);
break;
case 570:
l.waitFor(l.addFoe(new BigShrub(150, -80, 0, 14, 3, 0)));
l.waitFor(l.addFoe(new BigShrub(350, -80, 0, 14, 3, 0)));
break;
case 660:
makeGhost(100, 14);
makeGhost(400, 14);
break;
case 620:
makeGhost(150, 14);
makeGhost(250, 16);
makeGhost(350, 14);
break;
case 700:
makeHydra(((Math.random() * 500) + 50), true, 8, 90);
break;
case 750:
makeHydra(((Math.random() * 500) + 50), false, 8, 90);
break;
case 800:
makeHydra(((Math.random() * 500) + 50), true, 8, 60);
break;
case 850:
makeHydra(((Math.random() * 500) + 50), false, 9, 60);
break;
case 900:
makeHydra(((Math.random() * 500) + 50), true, 9, 50);
break;
case 950:
makeHydra(((Math.random() * 500) + 50), false, 10, 50);
break;
case 980:
makeHydra(((Math.random() * 500) + 50), true, 10, 40);
break;
case 1010:
makeHydra(((Math.random() * 500) + 50), false, 10, 40);
break;
case 1040:
makeHydra(((Math.random() * 500) + 50), true, 11, 30);
break;
case 1060:
makeHydra(((Math.random() * 500) + 50), false, 11, 30);
break;
case 1080:
makeHydra(((Math.random() * 500) + 50), true, 12, 20);
break;
case 1100:
makeHydra(((Math.random() * 500) + 50), false, 12, 20);
break;
case 1180:
makeGhost(100, 15);
makeGhost(200, 17);
makeGhost(300, 17);
makeGhost(400, 15);
break;
case 1240:
makeGhost(120, 14);
makeGhost(380, 14);
makeGhost(100, 17);
makeGhost(200, 15);
makeGhost(300, 15);
makeGhost(400, 17);
break;
case 2690:
l.winLevel();
break;
};
}
}
}//package levels
Section 177
//Level17 (levels.Level17)
package levels {
import foes.*;
public class Level17 extends Levels {
public function Level17(l:Level){
super(l);
}
function makeMage(x:int){
l.addFoe(new Mage(x, -30, 0, 5, 0, 60));
}
function makeCactus(x:int){
l.addFoe(new Cactus(x, -30, 0, 4, 0, 5));
}
function makeSlinger(x:int){
l.addFoe(new Slinger(x, -30, 0, 5, 0, 7));
}
function makeEyeBit(x:int){
l.addFoe(new EyeBit(x, -30, 0, (5 + (Math.random() * 3)), 0, 0));
}
function makeSlingers(i:int){
var n:int;
n = 0;
while (n < i) {
l.waitFor(l.addFoe(new Slinger(((Math.random() * 450) + 25), -49, 0, (4 + (Math.random() * 3)), 0, 6)));
n++;
};
}
function makeFireWall(yspeed:Number){
var b:Number;
b = 0;
while (b < 7) {
l.waitFor(l.addFoe(new FireGuy((100 + (b * 50)), -30, 0, yspeed, 3, 9)));
b++;
};
}
function makeFlameWall(yspeed:Number){
var b:Number;
b = 0;
while (b < 7) {
l.waitFor(l.addFoe(new FlameGuy((100 + (b * 50)), -30, 0, yspeed, 3, 4)));
b++;
};
}
function makeGhost(x:Number, y:Number){
return (l.waitFor(l.addFoe(new Ghost(x, -50, 0, y, 3, 50))));
}
function makeGhost2(x:Number){
return (l.addFoe(new Ghost(x, -50, 0, 4, 0, 100)));
}
function makeHydra(y:Number, left:Boolean, xp:Number, tt:Number){
if (!left){
return (l.addFoe(new Hydra(0, (((l.player.y * 5) / 6) + 50), left, xp, 0, tt)));
};
return (l.addFoe(new Hydra(500, (((l.player.y * 5) / 6) + 50), left, -(xp), 0, tt)));
}
function makeShrubs(x:int){
l.addFoe(new Shrub(x, -30, 0, 4, 0, 17));
l.addFoe(new Shrub((500 - x), -30, 0, 4, 0, 17));
}
override public function spawn(t:Number){
if (((((((t % 19) == 0)) && ((t > 0)))) && ((t < 500)))){
l.addFoe(new FlameGuy(((Math.random() * 450) + 25), -30, 0, 4, 0, 3));
};
if (((((((t % 24) == 0)) && ((t > 700)))) && ((t < 1200)))){
l.addFoe(new FlameGuy(((Math.random() * 450) + 25), -30, 0, 4, 0, 4));
};
if (((((((t % 17) == 0)) && ((t > 700)))) && ((t < 1200)))){
l.addFoe(new RedSlime(((Math.random() * 450) + 25), -30, 0, 4, 0, 3));
};
if (((((((t % 32) == 0)) && ((t > 1400)))) && ((t < 1900)))){
l.addFoe(new FireGuy(((Math.random() * 450) + 25), -30, 0, 4, 0, 9));
};
if (((((((t % 90) == 0)) && ((t > 1400)))) && ((t < 1900)))){
makeGhost2(((Math.random() * 450) + 25));
};
if (((((((t % 33) == 0)) && ((t > 2100)))) && ((t < 2600)))){
l.addFoe(new FlameGuy(((Math.random() * 450) + 25), -30, 0, 4, 0, 4));
};
if (((((((t % 27) == 0)) && ((t > 2100)))) && ((t < 2600)))){
l.addFoe(new FlameGuy(((Math.random() * 450) + 25), -30, 0, 4, 0, 4));
};
if (((((((t % 39) == 0)) && ((t > 2800)))) && ((t < 3250)))){
l.addFoe(new FlameGuy(((Math.random() * 450) + 25), -30, 0, 4, 0, 4));
};
if (((((((t % 38) == 0)) && ((t > 2800)))) && ((t < 3250)))){
l.addFoe(new FireGuy(((Math.random() * 450) + 25), -30, 0, 4, 0, 10));
};
if (((((((t % 28) == 0)) && ((t > 2800)))) && ((t < 3250)))){
l.addFoe(new RedSlime(((Math.random() * 450) + 25), -30, 0, 4, 0, 4));
};
switch (t){
case 600:
makeFireWall(12);
break;
case 1300:
makeFlameWall(12);
makeFireWall(17);
break;
case 2000:
makeFlameWall(15);
makeFireWall(20);
break;
case 2700:
makeBigSlime(250, 23);
break;
case 3350:
makeBigSlime(150, 16);
makeBigSlime(350, 16);
break;
case 3590:
l.winLevel();
break;
};
}
function makeBigSlime(x:Number, y:Number){
l.waitFor(l.addFoe(new BigSlime(x, -70, 0, y, 3, 30)));
}
function makeCats2(){
l.addFoe(new DeadCat(420, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(370, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(80, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(130, -30, 0, 7, 0, 0));
}
}
}//package levels
Section 178
//Level18 (levels.Level18)
package levels {
import foes.*;
public class Level18 extends Levels {
public function Level18(l:Level){
super(l);
}
function makeMage(x:int){
l.addFoe(new Mage(x, -30, 0, 5, 0, 60));
}
function makeCactus(x:int){
l.addFoe(new Cactus(x, -30, 0, 4, 0, 5));
}
function makeSlinger(x:int){
l.addFoe(new Slinger(x, -30, 0, 5, 0, 7));
}
function makeEyeBit(x:int){
l.addFoe(new EyeBit(x, -30, 0, (5 + (Math.random() * 3)), 0, 0));
}
function makeSlingers(i:int){
var n:int;
n = 0;
while (n < i) {
l.waitFor(l.addFoe(new Slinger(((Math.random() * 450) + 25), -49, 0, (4 + (Math.random() * 3)), 0, 6)));
n++;
};
}
function makeFireWall(yspeed:Number){
var b:Number;
b = 0;
while (b < 7) {
l.waitFor(l.addFoe(new FireGuy((100 + (b * 50)), -30, 0, yspeed, 3, 9)));
b++;
};
}
function makeFlameWall(yspeed:Number){
var b:Number;
b = 0;
while (b < 7) {
l.waitFor(l.addFoe(new FlameGuy((100 + (b * 50)), -30, 0, yspeed, 3, 4)));
b++;
};
}
function makeGhost(x:Number, y:Number){
return (l.waitFor(l.addFoe(new Ghost(x, -50, 0, y, 3, 50))));
}
function makeGhost2(x:Number){
return (l.addFoe(new Ghost(x, -50, 0, 4, 0, 100)));
}
function makeHydra(y:Number, left:Boolean, xp:Number, tt:Number){
if (!left){
return (l.addFoe(new Hydra(0, (((l.player.y * 5) / 6) + 50), left, xp, 0, tt)));
};
return (l.addFoe(new Hydra(500, (((l.player.y * 5) / 6) + 50), left, -(xp), 0, tt)));
}
function makeShrubs(x:int){
l.addFoe(new Shrub(x, -30, 0, 4, 0, 17));
l.addFoe(new Shrub((500 - x), -30, 0, 4, 0, 17));
}
override public function spawn(t:Number){
if (((((((t % 30) == 0)) && ((t > 0)))) && ((t < 300)))){
l.addFoe(new GunBot(-30, 120, 4, 0, 0, 10));
l.addFoe(new GunBot(530, 200, -4, 0, 0, 10));
};
if (((((((t % 30) == 0)) && ((t > 660)))) && ((t < 960)))){
l.addFoe(new LazorBot(-30, ((Math.random() * 350) + 25), 4, 0, 0, (20 + Math.floor((Math.random() * 5)))));
l.addFoe(new LazorBot(530, ((Math.random() * 350) + 25), -4, 0, 0, (20 + Math.floor((Math.random() * 5)))));
};
if (((((((t % 20) == 0)) && ((t > 1360)))) && ((t < 2400)))){
l.addFoe(new Missile(((Math.random() * 450) + 25), -30, 0, (7 + (Math.random() * 3))));
};
if (((((((t % 65) == 0)) && ((t > 1500)))) && ((t < 2400)))){
l.addFoe(new GunBot(-30, ((Math.random() * 200) + 100), 14, 0, 2, 12));
l.addFoe(new GunBot(530, ((Math.random() * 200) + 100), -14, 0, 2, 12));
};
if (((((((t % 109) == 0)) && ((t > 1850)))) && ((t < 2400)))){
l.addFoe(new LazorBot(-30, ((Math.random() * 200) + 100), 14, 0, 2, 20));
l.addFoe(new LazorBot(530, ((Math.random() * 200) + 100), -14, 0, 2, 20));
};
if (((((((t % 20) == 0)) && ((t > 2580)))) && ((t < 3000)))){
l.addFoe(new Missile(((Math.random() * 450) + 25), -30, 0, (7 + (Math.random() * 3))));
};
if (((((((t % 42) == 0)) && ((t > 2580)))) && ((t < 3000)))){
l.addFoe(new SeaBomb(((Math.random() * 450) + 25), -45, 0, (3 + (Math.random() * 3)), 0, 60));
};
switch (t){
case 400:
l.addFoe(new GunBot(-30, 400, 6, 0, 2, 8));
break;
case 420:
l.addFoe(new GunBot(-30, 350, 8, 0, 2, 8));
break;
case 440:
l.addFoe(new GunBot(-30, 300, 10, 0, 2, 8));
break;
case 460:
l.addFoe(new GunBot(-30, 250, 12, 0, 2, 8));
break;
case 480:
l.addFoe(new GunBot(-30, 200, 14, 0, 2, 8));
break;
case 500:
l.addFoe(new GunBot(-30, 150, 16, 0, 2, 8));
break;
case 520:
l.addFoe(new GunBot(530, 400, -6, 0, 2, 8));
break;
case 530:
l.addFoe(new GunBot(530, 350, -8, 0, 2, 8));
break;
case 540:
l.addFoe(new GunBot(530, 300, -10, 0, 2, 8));
break;
case 550:
l.addFoe(new GunBot(530, 250, -12, 0, 2, 8));
break;
case 560:
l.addFoe(new GunBot(530, 200, -14, 0, 2, 8));
break;
case 570:
l.addFoe(new GunBot(530, 150, -16, 0, 2, 8));
break;
case 1030:
l.addFoe(new LazorBot(-30, 400, 6, 0, 2, 20));
break;
case 1040:
l.addFoe(new LazorBot(-30, 350, 8, 0, 2, 20));
break;
case 1050:
l.addFoe(new LazorBot(-30, 300, 10, 0, 2, 20));
break;
case 1060:
l.addFoe(new LazorBot(-30, 250, 12, 0, 2, 20));
break;
case 1070:
l.addFoe(new LazorBot(-30, 200, 14, 0, 2, 20));
break;
case 1080:
l.addFoe(new LazorBot(-30, 150, 16, 0, 2, 20));
break;
case 1100:
l.addFoe(new LazorBot(530, 400, -6, 0, 2, 20));
break;
case 1110:
l.addFoe(new LazorBot(530, 350, -8, 0, 2, 20));
break;
case 1120:
l.addFoe(new LazorBot(530, 300, -10, 0, 2, 20));
break;
case 1130:
l.addFoe(new LazorBot(530, 250, -12, 0, 2, 20));
break;
case 1140:
l.addFoe(new LazorBot(530, 200, -14, 0, 2, 20));
break;
case 1150:
l.addFoe(new LazorBot(530, 150, -16, 0, 2, 20));
break;
case 1260:
l.waitFor(l.addFoe(new Tank(150, -70, 0, 15, 3, 50)));
l.waitFor(l.addFoe(new Tank(350, -70, 0, 15, 3, 33)));
break;
case 2500:
l.waitFor(l.addFoe(new Tank(150, -70, 0, 15, 3, 36)));
l.waitFor(l.addFoe(new Tank(350, -70, 0, 15, 3, 27)));
break;
case 3160:
l.waitFor(l.addFoe(new BossBot(250, -90, 0, 15, 3, 0)));
break;
case 3360:
l.winLevel();
break;
};
}
function makeBigSlime(x:Number, y:Number){
l.waitFor(l.addFoe(new BigSlime(x, -70, 0, y, 3, 30)));
}
function makeCats2(){
l.addFoe(new DeadCat(420, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(370, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(80, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(130, -30, 0, 7, 0, 0));
}
}
}//package levels
Section 179
//Level19 (levels.Level19)
package levels {
import foes.*;
public class Level19 extends Levels {
public function Level19(l:Level){
super(l);
}
function makeMage(x:int){
l.addFoe(new Mage(x, -30, 0, 5, 0, 60));
}
function makeCactus(x:int){
l.addFoe(new Cactus(x, -30, 0, 4, 0, 5));
}
function makeSlinger(x:int){
l.addFoe(new Slinger(x, -30, 0, 5, 0, 7));
}
function makeEyeBit(x:int){
l.addFoe(new EyeBit(x, -30, 0, (5 + (Math.random() * 3)), 0, 0));
}
function makeSlingers(i:int){
var n:int;
n = 0;
while (n < i) {
l.waitFor(l.addFoe(new Slinger(((Math.random() * 450) + 25), -49, 0, (4 + (Math.random() * 3)), 0, 6)));
n++;
};
}
function makeFireWall(yspeed:Number){
var b:Number;
b = 0;
while (b < 4) {
l.waitFor(l.addFoe(new FireGuy((100 + (b * 100)), -30, 0, yspeed, 4, 12)));
b++;
};
}
function makeFlameWall(yspeed:Number){
var b:Number;
b = 0;
while (b < 4) {
l.waitFor(l.addFoe(new FlameGuy((100 + (b * 100)), -30, 0, yspeed, 4, 6)));
b++;
};
}
function makeGhost(x:Number, y:Number){
return (l.waitFor(l.addFoe(new Ghost(x, -50, 0, y, 3, 50))));
}
function makeGhost2(x:Number){
return (l.addFoe(new Ghost(x, -50, 0, 4, 0, 100)));
}
function makeHydra(y:Number, left:Boolean, xp:Number, tt:Number){
if (!left){
return (l.addFoe(new Hydra(0, (((l.player.y * 5) / 6) + 50), left, xp, 0, tt)));
};
return (l.addFoe(new Hydra(500, (((l.player.y * 5) / 6) + 50), left, -(xp), 0, tt)));
}
function makeShrubs(x:int){
l.addFoe(new Shrub(x, -30, 0, 8, 0, 10000));
l.addFoe(new Shrub((500 - x), -30, 0, 8, 0, 10000));
}
override public function spawn(t:Number){
if (((((((t % 9) == 0)) && ((t > 760)))) && ((t < 1160)))){
makeShrubs(100);
makeShrubs(150);
makeShrubs(200);
};
switch (t){
case 30:
l.waitFor(l.addFoe(new Monolith(250, -90, 0, 15, 3, 40)));
break;
case 60:
l.addFoe(new LazorBot(-30, 50, 14, 0, 2, 20));
l.addFoe(new LazorBot(530, 100, -14, 0, 2, 20));
break;
case 90:
l.waitFor(l.addFoe(new FaceBot(250, -90, 0, 17, 3, 50)));
break;
case 150:
l.waitFor(l.addFoe(new FaceBot(150, -90, 0, 17, 3, 60)));
l.waitFor(l.addFoe(new FaceBot(350, -90, 0, 17, 3, 60)));
break;
case 210:
l.waitFor(l.addFoe(new FaceBot(150, -90, 0, 14, 3, 70)));
l.waitFor(l.addFoe(new Monolith(250, -90, 0, 19, 3, 70)));
l.waitFor(l.addFoe(new FaceBot(350, -90, 0, 14, 3, 70)));
break;
case 270:
makeFlameWall(10);
makeFireWall(12);
break;
case 300:
makeFlameWall(13);
makeFireWall(17);
break;
case 360:
makeFlameWall(11);
makeFireWall(14);
l.waitFor(l.addFoe(new Demon(250, -90, 0, 16, 3, 20)));
break;
case 400:
makeFlameWall(12);
makeFireWall(15);
l.waitFor(l.addFoe(new Demon(100, -90, 0, 24, 3, 35)));
l.waitFor(l.addFoe(new Demon(400, -90, 0, 24, 3, 35)));
break;
case 460:
l.waitFor(l.addFoe(new Monolith(150, -90, 0, 14, 3, Infinity)));
l.waitFor(l.addFoe(new Monolith(350, -90, 0, 14, 3, Infinity)));
break;
case 520:
l.waitFor(l.addFoe(new Demon(150, -90, 0, 14, 3, 26)));
l.waitFor(l.addFoe(new BigSlime(250, -90, 0, 19, 3, 45)));
l.waitFor(l.addFoe(new Demon(350, -90, 0, 14, 3, 26)));
break;
case 580:
l.waitFor(l.addFoe(new BigSlime(150, -90, 0, 14, 3, 60)));
l.waitFor(l.addFoe(new BigSlime(350, -90, 0, 14, 3, 60)));
break;
case 640:
l.waitFor(l.addFoe(new Tank(150, -70, 0, 15, 3, 49)));
l.waitFor(l.addFoe(new Tank(350, -70, 0, 19, 3, 37)));
l.waitFor(l.addFoe(new Tank(250, -70, 0, 25, 3, 64)));
break;
case 700:
l.waitFor(l.addFoe(new Demon(150, -90, 0, 14, 3, 28)));
l.waitFor(l.addFoe(new Monolith(250, -90, 0, 19, 3, Infinity)));
l.waitFor(l.addFoe(new Demon(350, -90, 0, 14, 3, 28)));
break;
case 1200:
l.waitFor(l.addFoe(new Monolith(150, -90, 0, 14, 3, Infinity)));
l.waitFor(l.addFoe(new Monolith(350, -90, 0, 14, 3, Infinity)));
l.waitFor(l.addFoe(new Monolith(300, -90, 0, 19, 3, Infinity)));
l.waitFor(l.addFoe(new Monolith(200, -90, 0, 19, 3, Infinity)));
break;
case 1360:
l.winLevel();
break;
};
}
function makeBigSlime(x:Number, y:Number){
l.waitFor(l.addFoe(new BigSlime(x, -70, 0, y, 3, 30)));
}
function makeCats2(){
l.addFoe(new DeadCat(420, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(370, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(80, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(130, -30, 0, 7, 0, 0));
}
}
}//package levels
Section 180
//Level2 (levels.Level2)
package levels {
import foes.*;
import bullets.*;
public class Level2 extends Levels {
public function Level2(l:Level){
super(l);
}
function makeLogWall(){
var b:Number;
b = 0;
while (b < 9) {
l.addFoe(new BigLog((50 + (b * 50)), -30, 0, 6, 0, 30));
b++;
};
}
function makeTree(x:Number, y:Number){
return (l.waitFor(l.addFoe(new Tree(x, -49, 0, y, 3, 40))));
}
function makeCat(x:Number){
l.addFoe(new Kitten(x, -30, 0, 4, 0, 30));
}
function makeSlimeWall(){
var b:Number;
b = 0;
while (b < 10) {
l.addFoe(new GreenSlime((25 + (b * 50)), -30, 0, 4, 0, 20));
b++;
};
}
function makeSlime2(){
l.addFoe(new GreenSlime(-30, -30, ((Math.random() * 7) + 5), ((Math.random() * 5) + 3), 1, 30));
}
function makeBigBush2(x:Number, y:Number){
makeBigBush(x, y);
makeBigBush((500 - x), y);
}
function makeLog(x:Number){
l.addFoe(new BigLog(x, -30, 0, 3, 0, 30));
}
function makeSlime3(){
l.addFoe(new GreenSlime(530, -30, ((-(Math.random()) * 7) - 5), ((Math.random() * 5) + 3), 1, 30));
}
function makeBigBush(x:Number, y:Number){
l.waitFor(l.addFoe(new BigBush(x, -49, 0, y, 3, 5)));
}
override public function spawn(t:Number){
if (((((t % 17) == 0)) && ((t < 160)))){
makeSlime2();
makeSlime3();
};
if (((((((t % 15) == 0)) && ((t > 360)))) && ((t < 490)))){
makeBush(((Math.random() * 450) + 25));
};
if (((((((t % 12) == 0)) && ((t > 910)))) && ((t < 1000)))){
makeCat(100);
makeCat(140);
makeCat(400);
makeCat(360);
};
if (((((((t % 12) == 0)) && ((t > 870)))) && ((t < 1080)))){
};
if (((((((t % 16) == 0)) && ((t > 1100)))) && ((t < 1220)))){
};
switch (t){
case 270:
makeSlimeWall();
break;
case 300:
makeSlimeWall();
break;
case 580:
makeTank(200);
makeTank(300);
break;
case 640:
makeTank(150);
makeTank(350);
break;
case 700:
makeTank(200).drop = "shield";
makeTank(300).drop = "heart";
break;
case 820:
makeLogWall();
break;
case 940:
makeTank(250);
break;
case 990:
makeTank(250);
break;
case 1120:
makeBigBush2(100, 15);
break;
case 1150:
makeBigBush2(200, 17);
break;
case 1220:
makeTree(150, 14);
makeTree(350, 14).drop = "heart";
makeTree(250, 17);
break;
case 1300:
l.winLevel();
};
}
function makeBush(x:Number){
l.addFoe(new Bush(x, -49, 0, 4, 0, 30));
}
function makeTank(x:Number){
return (l.addFoe(new CatRam(x, -49, 0, 3, 0, 40)));
}
}
}//package levels
Section 181
//Level20 (levels.Level20)
package levels {
import foes.*;
public class Level20 extends Levels {
public function Level20(l:Level){
super(l);
}
override public function spawn(t:Number){
if (((((t % 14) == 0)) && ((t < 600)))){
l.addFoe(new Shrub(-30, 300, 6, 0, 0, 111111110));
l.addFoe(new RedSlime(530, 250, -6, 0, 0, 111111110));
};
if (((((t % 19) == 0)) && ((t < 600)))){
l.addFoe(new Shrub(-30, 200, 5, 0, 0, 1000));
};
if (((((t % 50) == 0)) && ((t < 600)))){
l.addFoe(new FlameGuy(-30, 150, 2, 0, 0, 12));
l.addFoe(new FireGuy(530, 100, -2, 0, 0, 20));
};
switch (t){
case 750:
l.waitFor(l.addFoe(new GodCat(250, -150, 0, 23, 3, 0)));
BGM.play("bossMusic");
break;
case 900:
l.winLevel();
break;
};
}
}
}//package levels
Section 182
//Level21 (levels.Level21)
package levels {
import foes.*;
public class Level21 extends Levels {
public function Level21(l:Level){
super(l);
}
override public function spawn(t:Number){
var a:int;
a = 0;
switch (t){
case 60:
l.waitFor(l.addFoe(new SlimeKing2(250, -150, 0, 19, 3, 0)));
break;
case 250:
l.winLevel();
break;
};
}
}
}//package levels
Section 183
//Level22 (levels.Level22)
package levels {
import foes.*;
public class Level22 extends Levels {
public function Level22(l:Level){
super(l);
}
override public function spawn(t:Number){
var a:int;
a = 0;
switch (t){
case 60:
l.waitFor(l.addFoe(new GiantCrab2(250, -150, 0, 24, 3, 0)));
break;
case 250:
l.winLevel();
break;
};
}
}
}//package levels
Section 184
//Level23 (levels.Level23)
package levels {
import foes.*;
public class Level23 extends Levels {
public function Level23(l:Level){
super(l);
}
override public function spawn(t:Number){
var a:int;
a = 0;
switch (t){
case 60:
l.waitFor(l.addFoe(new Sphinx2(250, -150, 0, 23, 3, 0)));
break;
case 250:
l.winLevel();
break;
};
}
}
}//package levels
Section 185
//Level24 (levels.Level24)
package levels {
import foes.*;
public class Level24 extends Levels {
public function Level24(l:Level){
super(l);
}
override public function spawn(t:Number){
var a:int;
a = 0;
switch (t){
case 60:
l.waitFor(l.addFoe(new GodCat2(250, -150, 0, 23, 3, 0)));
break;
case 250:
l.winLevel();
break;
};
}
}
}//package levels
Section 186
//Level25 (levels.Level25)
package levels {
import foes.*;
import drops.*;
import bullets.*;
public class Level25 extends Levels {
var lastRandom:int;// = -1
var b:int;// = 0
var pnext:int;// = 20
var r:int;// = 0
public var waveCount:int;// = 0
var waveTimer:int;// = 0
public function Level25(l:Level){
b = 0;
r = 0;
waveCount = 0;
waveTimer = 0;
lastRandom = -1;
pnext = 20;
super(l);
survival = true;
}
override public function timer(){
if (l.moneyCollected >= pnext){
pnext = (pnext * 2);
l.player.levelUp();
};
waveTimer++;
if (waveTimer > 300){
l.foeTimeOut();
waveTimer = 0;
};
}
public function random(a:int):int{
var b:int;
b = (Math.random() * a);
while (b == lastRandom) {
b = (Math.random() * a);
};
lastRandom = b;
return (b);
}
function waves(c:int){
var a:int;
if (c > 80){
r = random(9);
if (r == 8){
b = 50;
while (b < 490) {
l.waitFor(l.addFoe(new LazorBot(b, -30, 0, 8, 3, 18)));
l.waitFor(l.addFoe(new CrossBomb(b, -30, 0, (3 + (Math.random() * 2)))));
b = (b + 80);
};
};
if (r == 7){
l.waitFor(l.addFoe(new Tank(150, -70, 0, 12, 3, 56)));
l.waitFor(l.addFoe(new FaceBot(250, -30, 0, 18, 3, 7)));
l.waitFor(l.addFoe(new Tank(350, -70, 0, 12, 3, 69)));
};
if (r == 6){
b = 50;
while (b < 490) {
l.waitFor(l.addFoe(new Tree((b + 20), -30, 0, 9, 3, 25)));
l.waitFor(l.addFoe(new PurpleJelly((b - 20), -30, 0, 12, 3, 18)));
l.waitFor(l.addFoe(new PinkJelly((b + 20), -30, 0, 16, 3, 10)));
b = (b + 80);
};
};
if (r == 5){
l.waitFor(l.addFoe(new Monolith(-80, 150, 22, 0, 1, Infinity))).t = 5;
l.waitFor(l.addFoe(new Monolith(580, 150, -22, 0, 1, Infinity))).t = 10;
l.waitFor(l.addFoe(new Monolith(-80, 220, 22, 0, 1, Infinity))).t = 15;
l.waitFor(l.addFoe(new Monolith(580, 220, -22, 0, 1, Infinity))).t = 20;
};
if (r == 4){
l.waitFor(l.addFoe(new BossBot(120, -90, 0, 15, 3, 0)));
l.waitFor(l.addFoe(new BossBot(380, -90, 0, 15, 3, 0)));
};
if (r == 3){
b = 50;
while (b < 500) {
l.waitFor(l.addFoe(new SeaBomb(b, -40, 0, (1 + (Math.random() * 4)), 0, 30)));
l.waitFor(l.addFoe(new Missile(((Math.random() * 450) + 25), -30, 0, (2 + (Math.random() * 3)))));
b = (b + 50);
};
l.waitFor(l.addFoe(new CrossBomb(((Math.random() * 450) + 25), -30, 0, (2 + (Math.random() * 2)))));
};
if (r == 2){
l.waitFor(l.addFoe(new Golem(150, -100, 0, 16, 3, 30)));
l.waitFor(l.addFoe(new Golem(350, -100, 0, 16, 3, 30)));
};
if (r == 1){
l.waitFor(l.addFoe(new Monolith(-80, 100, 15, 0, 1, Infinity))).t = 5;
l.waitFor(l.addFoe(new Monolith(580, 100, -15, 0, 1, Infinity))).t = 10;
l.waitFor(l.addFoe(new Monolith(-80, 500, 15, 0, 1, Infinity))).t = 15;
l.waitFor(l.addFoe(new Monolith(580, 500, -15, 0, 1, Infinity))).t = 20;
};
if (r == 0){
l.waitFor(l.addFoe(new LazorBot(70, -30, 0, 15, 3, 40)));
l.waitFor(l.addFoe(new FaceBot(160, -70, 0, 11, 3, 18)));
l.waitFor(l.addFoe(new FaceBot(250, -30, 0, 17, 3, 12)));
l.waitFor(l.addFoe(new FaceBot(340, -70, 0, 11, 3, 18)));
l.waitFor(l.addFoe(new LazorBot(430, -30, 0, 15, 3, 40)));
};
} else {
if (c > 70){
r = random(10);
if (r == 9){
for each (b in [150, 200, 250, 300, 350]) {
l.waitFor(l.addFoe(new RedSlime(b, -30, 0, 10, 3, 0)));
l.waitFor(l.addFoe(new RedSlime(b, -30, 0, 13.2, 3, 0)));
l.waitFor(l.addFoe(new RedSlime(b, -30, 0, 16, 3, 0)));
};
for each (b in [50, 450]) {
l.waitFor(l.addFoe(new Ghost(b, -30, 0, 12, 3, 70)));
l.waitFor(l.addFoe(new Ghost(b, -30, 0, 18, 3, 70))).t = 10;
};
};
if (r == 8){
l.waitFor(l.addFoe(new BigSlime(250, -90, 0, 14, 3, 60)));
for each (b in [50, 100, 150, 350, 400, 450]) {
l.waitFor(l.addFoe(new RedSlime(b, -30, 0, 10, 3, 0)));
l.waitFor(l.addFoe(new RedSlime(b, -30, 0, 13.2, 3, 0)));
l.waitFor(l.addFoe(new RedSlime(b, -30, 0, 16, 3, 0)));
};
};
if (r == 7){
b = 200;
while (b < 350) {
l.waitFor(l.addFoe(new DeadCat(b, -30, 0, 12, 3, 12)));
l.waitFor(l.addFoe(new Ghost(b, -30, 0, 16, 3, 70)));
b = (b + 50);
};
l.waitFor(l.addFoe(new Demon(100, -90, 0, 15, 3, 28)));
l.waitFor(l.addFoe(new Demon(400, -90, 0, 15, 3, 28)));
};
if (r == 6){
l.waitFor(l.addFoe(new BigSlime(150, -90, 0, 14, 3, 60)));
l.waitFor(l.addFoe(new BigSlime(350, -90, 0, 14, 3, 60)));
};
if (r == 0){
l.waitFor(l.addFoe(new Demon(150, -90, 0, 15, 3, 28)));
l.waitFor(l.addFoe(new FaceBot(250, -30, 0, 17, 3, 12)));
l.waitFor(l.addFoe(new Demon(350, -90, 0, 15, 3, 28)));
};
if (r == 5){
l.waitFor(l.addFoe(new Monolith(-80, 100, 22, 0, 1, 50))).t = 5;
l.waitFor(l.addFoe(new Monolith(580, 100, -22, 0, 1, 50))).t = 5;
};
if (r == 4){
l.waitFor(l.addFoe(new GunBot(100, -30, 0, 15, 3, 15)));
l.waitFor(l.addFoe(new Tank(160, -70, 0, 15, 3, 36)));
l.waitFor(l.addFoe(new GunBot(250, -30, 0, 15, 3, 15)));
l.waitFor(l.addFoe(new Tank(340, -70, 0, 15, 3, 36)));
l.waitFor(l.addFoe(new GunBot(400, -30, 0, 15, 3, 15)));
};
if (r == 3){
b = 50;
while (b < 490) {
l.waitFor(l.addFoe(new Tree((b + 20), -30, 0, 9, 3, 40)));
l.waitFor(l.addFoe(new FlameGuy((b - 20), -30, 0, 12, 3, 6)));
l.waitFor(l.addFoe(new FireGuy((b + 20), -30, 0, 16, 3, 12)));
l.waitFor(l.addFoe(new DeadCat((b - 20), -30, 0, 19, 3, 20)));
b = (b + 80);
};
};
if (r == 2){
b = 50;
while (b < 490) {
l.waitFor(l.addFoe(new FlameGuy((b + 20), -30, 0, 9, 3, 7)));
l.waitFor(l.addFoe(new PurpleJelly((b - 20), -30, 0, 12, 3, 30)));
l.waitFor(l.addFoe(new FireGuy((b + 20), -30, 0, 16, 3, 11)));
l.waitFor(l.addFoe(new Shrub((b - 20), -30, 0, 19, 3, 20)));
b = (b + 80);
};
};
if (r == 1){
l.waitFor(l.addFoe(new BossBot(250, -90, 0, 15, 3, 0)));
l.waitFor(l.addFoe(new GunBot(400, -30, 0, 18, 3, 20)));
l.waitFor(l.addFoe(new GunBot(100, -30, 0, 18, 3, 20)));
};
} else {
if (c > 60){
r = random(10);
if (r == 9){
l.waitFor(l.addFoe(new GunBot(250, -49, 0, 9, 3, 40)));
l.waitFor(l.addFoe(new GunBot(180, -49, 0, 13, 3, 40)));
l.waitFor(l.addFoe(new GunBot(320, -49, 0, 13, 3, 40)));
l.waitFor(l.addFoe(new LazorBot(100, -49, 0, 17, 3, 40)));
l.waitFor(l.addFoe(new SeaBomb(210, -40, 0, 17, 3, 40)));
l.waitFor(l.addFoe(new SeaBomb(290, -40, 0, 17, 3, 40)));
l.waitFor(l.addFoe(new SeaBomb(250, -40, 0, 15, 3, 40)));
l.waitFor(l.addFoe(new SeaBomb(250, -40, 0, 19, 3, 40)));
l.waitFor(l.addFoe(new LazorBot(400, -49, 0, 17, 3, 40)));
l.waitFor(l.addFoe(new GunBot(180, -49, 0, 21, 3, 40)));
l.waitFor(l.addFoe(new GunBot(320, -49, 0, 21, 3, 40)));
l.waitFor(l.addFoe(new GunBot(250, -49, 0, 25, 3, 40)));
};
if (r == 8){
l.waitFor(l.addFoe(new GunBot(100, -30, 0, 15, 3, 15)));
l.waitFor(l.addFoe(new FaceBot(160, -70, 0, 15, 3, 36)));
l.waitFor(l.addFoe(new GunBot(250, -30, 0, 15, 3, 15)));
l.waitFor(l.addFoe(new FaceBot(340, -70, 0, 15, 3, 36)));
l.waitFor(l.addFoe(new GunBot(400, -30, 0, 15, 3, 15)));
};
if (r == 7){
b = 50;
while (b < 490) {
l.waitFor(l.addFoe(new LazorBot((b + 12), -30, ((Math.random() * 4) - 2), (8 + (Math.random() * 4)), 4, (25 + Math.floor((Math.random() * 15))))));
l.waitFor(l.addFoe(new LazorBot((b - 12), -30, ((Math.random() * 4) - 2), (11 + (Math.random() * 5)), 4, (25 + Math.floor((Math.random() * 15))))));
b = (b + 80);
};
};
if (r == 6){
b = 50;
while (b < 490) {
l.waitFor(l.addFoe(new GunBot((b + 12), -30, 0, 9, 3, 15)));
l.waitFor(l.addFoe(new GunBot((b - 12), -30, 0, 12, 3, 15)));
b = (b + 80);
};
};
if (r == 5){
b = 50;
while (b < 490) {
l.waitFor(l.addFoe(new FireGuy(b, -30, 0, 12, 3, 11)));
l.waitFor(l.addFoe(new FlameGuy(b, -30, 0, 18, 3, 7)));
b = (b + 80);
};
};
if (r == 4){
l.waitFor(l.addFoe(new Ghost(150, -50, 0, 17, 3, 70))).t = 10;
l.waitFor(l.addFoe(new Ghost(350, -50, 0, 17, 3, 70))).t = 10;
l.waitFor(l.addFoe(new Ghost(120, -50, 0, 12, 3, 70))).t = 20;
l.waitFor(l.addFoe(new Ghost(380, -50, 0, 12, 3, 70))).t = 20;
l.waitFor(l.addFoe(new Ghost(250, -50, 0, 11, 3, 70))).t = 0;
l.waitFor(l.addFoe(new Ghost(250, -50, 0, 22, 3, 70))).t = 30;
};
if (r == 3){
l.waitFor(l.addFoe(new BigShrub(250, -80, 0, 14, 3, 0)));
for each (b in [50, 100, 400, 450]) {
l.waitFor(l.addFoe(new Mage(b, -49, 0, 9, 3, 65)));
l.waitFor(l.addFoe(new Shrub(b, -49, 0, 15, 3, 40)));
};
};
if (r == 2){
l.waitFor(l.addFoe(new BigShrub(150, -80, 0, 14, 3, 0)));
l.waitFor(l.addFoe(new BigShrub(350, -80, 0, 14, 3, 0)));
};
if (r == 1){
b = 0;
while (b < 14) {
l.waitFor(l.addFoe(new Shrub(-30, ((Math.random() * 300) + 50), ((Math.random() * 10) + 7), ((Math.random() * 4) - 2), 2, 12)));
l.waitFor(l.addFoe(new Shrub(530, ((Math.random() * 300) + 50), ((-(Math.random()) * 10) - 7), ((Math.random() * 4) - 2), 2, 12)));
b++;
};
};
if (r == 0){
l.waitFor(l.addFoe(new Obelisk(250, -49, 0, 9, 3, 40)));
l.waitFor(l.addFoe(new Obelisk(200, -49, 0, 13, 3, 40)));
l.waitFor(l.addFoe(new Obelisk(300, -49, 0, 13, 3, 40)));
l.waitFor(l.addFoe(new Obelisk(150, -49, 0, 17, 3, 40)));
l.waitFor(l.addFoe(new Obelisk(350, -49, 0, 17, 3, 40)));
l.waitFor(l.addFoe(new Obelisk(200, -49, 0, 21, 3, 40)));
l.waitFor(l.addFoe(new Obelisk(300, -49, 0, 21, 3, 40)));
l.waitFor(l.addFoe(new Obelisk(250, -49, 0, 25, 3, 40)));
};
} else {
if (c > 50){
r = random(10);
if (r == 9){
b = 0;
while (b < 10) {
l.waitFor(l.addFoe(new Shrub(-30, ((Math.random() * 200) + 50), ((Math.random() * 10) + 7), ((Math.random() * 4) - 2), 2, 25)));
l.waitFor(l.addFoe(new Shrub(530, ((Math.random() * 200) + 50), ((-(Math.random()) * 10) - 7), ((Math.random() * 4) - 2), 2, 25)));
b++;
};
};
if (r == 8){
b = 0;
while (b < 4) {
l.waitFor(l.addFoe(new FlameGuy(530, ((Math.random() * 500) + 50), (-6 - (Math.random() * 12)), 0, 1, 8)));
b++;
};
l.waitFor(l.addFoe(new Hydra(500, ((Math.random() * 150) + 50), true, (-8 - (Math.random() * 3)), 0, 60)));
l.waitFor(l.addFoe(new Hydra(500, ((Math.random() * 200) + 200), true, (-8 - (Math.random() * 3)), 0, 70)));
l.waitFor(l.addFoe(new Hydra(500, ((Math.random() * 150) + 400), true, (-8 - (Math.random() * 3)), 0, 60)));
};
if (r == 7){
b = 0;
while (b < 4) {
l.waitFor(l.addFoe(new FireGuy(-30, ((Math.random() * 500) + 50), (6 + (Math.random() * 12)), 0, 1, 14)));
b++;
};
l.waitFor(l.addFoe(new Hydra(0, ((Math.random() * 150) + 50), false, (8 + (Math.random() * 3)), 0, 60)));
l.waitFor(l.addFoe(new Hydra(0, ((Math.random() * 200) + 200), false, (8 + (Math.random() * 3)), 0, 70)));
l.waitFor(l.addFoe(new Hydra(0, ((Math.random() * 150) + 400), false, (8 + (Math.random() * 3)), 0, 60)));
};
if (r == 6){
l.waitFor(l.addFoe(new Hydra(0, (((l.player.y * 5) / 6) + 50), false, (8 + (Math.random() * 3)), 0, 50)));
l.waitFor(l.addFoe(new Hydra(500, (((l.player.y * 5) / 6) - 50), true, (-8 - (Math.random() * 3)), 0, 50)));
l.waitFor(l.addFoe(new Hydra(0, ((((l.player.y * 5) / 6) - 200) % 600), false, (8 + (Math.random() * 3)), 0, 50)));
l.waitFor(l.addFoe(new Hydra(500, ((((l.player.y * 5) / 6) + 200) % 600), true, (-8 - (Math.random() * 3)), 0, 50)));
};
if (r == 5){
l.waitFor(l.addFoe(new HugeRock(250, -40, 0, 16, 3, 4)));
l.waitFor(l.addFoe(new HugeRock(90, -40, 0, 15, 3, 4)));
l.waitFor(l.addFoe(new HugeRock(410, -40, 0, 14, 3, 4)));
l.waitFor(l.addFoe(new Obelisk(100, -49, 0, 11, 3, 50)));
l.waitFor(l.addFoe(new Obelisk(400, -49, 0, 11, 3, 50)));
l.waitFor(l.addFoe(new DeadCat(200, -49, 0, 11, 3, 8)));
l.waitFor(l.addFoe(new DeadCat(250, -49, 0, 11, 3, 8)));
l.waitFor(l.addFoe(new DeadCat(300, -49, 0, 11, 3, 8)));
l.waitFor(l.addFoe(new Wasp(220, -49, 0, 15, 3, 3)));
l.waitFor(l.addFoe(new Wasp(280, -49, 0, 15, 3, 3)));
};
if (r == 4){
l.waitFor(l.addFoe(new HugeRock(250, -40, 0, 16, 3, 4)));
l.waitFor(l.addFoe(new HugeRock(90, -40, 0, 15, 3, 4)));
l.waitFor(l.addFoe(new HugeRock(410, -40, 0, 14, 3, 4)));
l.waitFor(l.addFoe(new EyeGuy(100, -49, 0, 11, 3, 8)));
l.waitFor(l.addFoe(new EyeGuy(400, -49, 0, 11, 3, 8)));
l.waitFor(l.addFoe(new Slinger(200, -49, 0, 11, 3, 8)));
l.waitFor(l.addFoe(new Slinger(250, -49, 0, 11, 3, 8)));
l.waitFor(l.addFoe(new Slinger(300, -49, 0, 11, 3, 8)));
l.waitFor(l.addFoe(new Mage(220, -49, 0, 15, 3, 40)));
l.waitFor(l.addFoe(new Mage(280, -49, 0, 15, 3, 40)));
};
if (r == 3){
l.waitFor(l.addFoe(new EyeGuy(100, -49, 0, 13, 3, 8)));
l.waitFor(l.addFoe(new EyeGuy(170, -49, 0, 15, 3, 8)));
l.waitFor(l.addFoe(new EyeGuy(250, -49, 0, 10, 3, 8)));
l.waitFor(l.addFoe(new EyeGuy(250, -49, 0, 19, 3, 8)));
l.waitFor(l.addFoe(new EyeGuy(330, -49, 0, 15, 3, 8)));
l.waitFor(l.addFoe(new EyeGuy(400, -49, 0, 13, 3, 8)));
};
if (r == 2){
l.waitFor(l.addFoe(new Obelisk(-80, 100, 13, 0, 1, 120))).t = 0;
l.waitFor(l.addFoe(new Obelisk(580, 100, -13, 0, 1, 120))).t = 30;
l.waitFor(l.addFoe(new Obelisk(-80, 500, 13, 0, 1, 120))).t = 60;
l.waitFor(l.addFoe(new Obelisk(580, 500, -13, 0, 1, 120))).t = 90;
};
if (r == 1){
l.waitFor(l.addFoe(new Golem(250, -100, 0, 16, 3, 30)));
b = 0;
while (b < 7) {
l.waitFor(l.addFoe(new BigRock(250, -40, ((Math.random() * 8) - 4), ((Math.random() * 4) + 2), 0, 4)));
l.waitFor(l.addFoe(new SmallRock(250, -40, ((Math.random() * 8) - 4), ((Math.random() * 4) + 2), 0, 4)));
l.waitFor(l.addFoe(new MediumRock(250, -40, ((Math.random() * 8) - 4), ((Math.random() * 4) + 2), 0, 4)));
b++;
};
};
if (r == 0){
l.waitFor(l.addFoe(new EyeGuy(150, -49, 0, 11, 3, 10)));
l.waitFor(l.addFoe(new EyeGuy(150, -49, 0, 18, 3, 10)));
l.waitFor(l.addFoe(new EyeGuy(350, -49, 0, 11, 3, 10)));
l.waitFor(l.addFoe(new EyeGuy(350, -49, 0, 18, 3, 10)));
l.waitFor(l.addFoe(new Obelisk(250, -49, 0, 15, 3, 30)));
};
} else {
if (c > 40){
r = random(9);
if (r == 8){
for each (b in [100, 200, 300, 400]) {
l.waitFor(l.addFoe(new Mage((b - 30), -49, 0, 10, 3, 45)));
l.waitFor(l.addFoe(new Slinger((b - 10), -49, 0, 14, 3, 12)));
l.waitFor(l.addFoe(new Cactus((b + 10), -49, 0, 18, 3, 18)));
l.waitFor(l.addFoe(new EyeBall((b + 30), -49, 0, 22, 3, 30)));
};
};
if (r == 7){
l.waitFor(l.addFoe(new HugeRock(((Math.random() * 450) + 25), -90, 0, ((Math.random() * 3) + 3), 0, 4)));
l.waitFor(l.addFoe(new BigRock(((Math.random() * 450) + 25), -40, 0, ((Math.random() * 4) + 2), 0, 4)));
l.waitFor(l.addFoe(new BigRock(((Math.random() * 450) + 25), -40, 0, ((Math.random() * 4) + 3), 0, 4)));
l.waitFor(l.addFoe(new BigRock(((Math.random() * 450) + 25), -40, 0, ((Math.random() * 4) + 3), 0, 4)));
b = 0;
while (b < 7) {
l.waitFor(l.addFoe(new MediumRock(((Math.random() * 450) + 25), -30, 0, ((Math.random() * 11) + 2), 0, 4)));
l.waitFor(l.addFoe(new SmallRock(((Math.random() * 450) + 25), -30, 0, ((Math.random() * 11) + 2), 0, 4)));
l.waitFor(l.addFoe(new TinyRock(((Math.random() * 450) + 25), -30, 0, ((Math.random() * 11) + 2), 0, 4)));
b++;
};
l.waitFor(l.addFoe(new EyeBall(((Math.random() * 450) + 25), -49, 0, 4, 0, 10)));
l.waitFor(l.addFoe(new EyeBall(((Math.random() * 450) + 25), -49, 0, 5, 0, 10)));
l.waitFor(l.addFoe(new EyeBall(((Math.random() * 450) + 25), -49, 0, 6, 0, 10)));
};
if (r == 6){
l.waitFor(l.addFoe(new DeadCat(350, -49, 0, 10, 3, 40)));
l.waitFor(l.addFoe(new DeadCat(350, -49, 0, 15, 3, 40)));
l.waitFor(l.addFoe(new DeadCat(400, -49, 0, 12, 3, 40)));
l.waitFor(l.addFoe(new DeadCat(400, -49, 0, 17, 3, 40)));
l.waitFor(l.addFoe(new DeadCat(100, -49, 0, 12, 3, 40)));
l.waitFor(l.addFoe(new DeadCat(100, -49, 0, 17, 3, 40)));
l.waitFor(l.addFoe(new DeadCat(150, -49, 0, 10, 3, 40)));
l.waitFor(l.addFoe(new DeadCat(150, -49, 0, 15, 3, 40)));
l.waitFor(l.addFoe(new Obelisk(200, -49, 0, 14, 3, 40)));
l.waitFor(l.addFoe(new Obelisk(300, -49, 0, 14, 3, 40)));
l.waitFor(l.addFoe(new Obelisk(250, -49, 0, 18, 3, 40)));
};
if (r == 5){
for each (b in [50, 100, 400, 450]) {
l.waitFor(l.addFoe(new Mage(b, -49, 0, 9, 3, 45)));
l.waitFor(l.addFoe(new Mage(b, -49, 0, 15, 3, 50)));
};
l.waitFor(l.addFoe(new EyeGuy(180, -49, 0, 11, 3, 10))).t = 20;
l.waitFor(l.addFoe(new EyeGuy(320, -49, 0, 11, 3, 10))).t = 20;
};
if (r == 4){
for each (b in [50, 100, 400, 450]) {
l.waitFor(l.addFoe(new Cactus(b, -49, 0, 9, 3, 14)));
l.waitFor(l.addFoe(new Cactus(b, -49, 0, 15, 3, 14)));
};
l.waitFor(l.addFoe(new Tree(200, -49, 0, 11, 3, 30))).t = 20;
l.waitFor(l.addFoe(new Tree(300, -49, 0, 11, 3, 30))).t = 20;
l.waitFor(l.addFoe(new Tree(200, -49, 0, 18, 3, 30)));
l.waitFor(l.addFoe(new Tree(300, -49, 0, 18, 3, 30)));
l.waitFor(l.addFoe(new Mage(250, -49, 0, 23, 3, 45)));
};
if (r == 3){
b = 50;
while (b < 460) {
l.waitFor(l.addFoe(new Cactus((b + 20), -30, 0, 9, 3, 20)));
l.waitFor(l.addFoe(new Slinger((b - 20), -30, 0, (3 + (Math.random() * 2)), 0, 9)));
b = (b + 100);
};
};
if (r == 2){
b = 50;
while (b < 460) {
l.waitFor(l.addFoe(new Slinger((b - 20), -30, 0, 9, 3, 12)));
l.waitFor(l.addFoe(new Bird((b + 20), -30, 0, 15, 3, 12)));
b = (b + 80);
};
};
if (r == 1){
b = 50;
while (b < 460) {
l.waitFor(l.addFoe(new Mage((b - 20), -30, 0, 9, 3, 40)));
l.waitFor(l.addFoe(new Bird((b + 20), -30, 0, 15, 3, 12)));
b = (b + 100);
};
};
if (r == 0){
b = 50;
while (b < 500) {
l.waitFor(l.addFoe(new SeaBomb(b, -40, 0, (2 + (Math.random() * 4)), 0, 30)));
b = (b + 50);
};
};
} else {
if (c > 30){
r = random(10);
if (r == 9){
l.waitFor(l.addFoe(new Shark(0, ((Math.random() * 250) + 50), true, 1)));
l.waitFor(l.addFoe(new Shark(0, ((Math.random() * 250) + 50), false, 2)));
l.waitFor(l.addFoe(new Shark(0, ((Math.random() * 250) + 300), true, 2)));
l.waitFor(l.addFoe(new Shark(0, ((Math.random() * 250) + 300), false, 1)));
};
if (r == 8){
for each (b in [50, 100, 400, 450]) {
l.waitFor(l.addFoe(new GreenJelly(b, -49, 0, 9, 3, 30)));
l.waitFor(l.addFoe(new GreenJelly(b, -49, 0, 15, 3, 30)));
};
l.waitFor(l.addFoe(new Tree(200, -49, 0, 11, 3, 30))).t = 20;
l.waitFor(l.addFoe(new Tree(300, -49, 0, 11, 3, 30))).t = 20;
l.waitFor(l.addFoe(new Tree(200, -49, 0, 18, 3, 30)));
l.waitFor(l.addFoe(new Tree(300, -49, 0, 18, 3, 30)));
};
if (r == 7){
l.waitFor(l.addFoe(new Tree(100, -49, 0, 15, 3, 30))).t = 10;
l.waitFor(l.addFoe(new Tree(200, -49, 0, 11, 3, 30))).t = 20;
l.waitFor(l.addFoe(new Tree(300, -49, 0, 11, 3, 30))).t = 20;
l.waitFor(l.addFoe(new Tree(200, -49, 0, 18, 3, 30)));
l.waitFor(l.addFoe(new Tree(300, -49, 0, 18, 3, 30)));
l.waitFor(l.addFoe(new Tree(400, -49, 0, 15, 3, 30))).t = 10;
};
if (r == 6){
for each (b in [50, 100, 400, 450]) {
l.waitFor(l.addFoe(new EyeBall(b, -49, 0, 9, 3, 30)));
l.waitFor(l.addFoe(new EyeBall(b, -49, 0, 15, 3, 30)));
l.waitFor(l.addFoe(new EyeBall(b, -49, 0, 22, 3, 30)));
};
};
if (r == 5){
b = 0;
while (b < 12) {
l.waitFor(l.addFoe(new EyeBall(((Math.random() * 450) + 25), -30, 0, (6 + (Math.random() * 5)), 0, 5000)));
b++;
};
};
if (r == 4){
l.waitFor(l.addFoe(new PurpleJelly(-30, 100, 19, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(530, 100, -19, 0, 1, 40)));
l.waitFor(l.addFoe(new GreenJelly(-30, 150, 15, 0, 1, 40)));
l.waitFor(l.addFoe(new GreenJelly(530, 150, -15, 0, 1, 40)));
l.waitFor(l.addFoe(new BlueJelly(-30, 200, 11, 0, 1, 40)));
l.waitFor(l.addFoe(new BlueJelly(530, 200, -11, 0, 1, 40)));
l.waitFor(l.addFoe(new GreenJelly(-30, 250, 15, 0, 1, 40)));
l.waitFor(l.addFoe(new GreenJelly(530, 250, -15, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(-30, 300, 19, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(530, 300, -19, 0, 1, 40)));
l.waitFor(l.addFoe(new SeaBomb(530, 200, -18, 0, 1, 40)));
l.waitFor(l.addFoe(new SeaBomb(-30, 200, 18, 0, 1, 40)));
};
if (r == 3){
l.waitFor(l.addFoe(new PurpleJelly(-30, 100, 19, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(530, 100, -19, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(-30, 150, 15, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(530, 150, -15, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(-30, 200, 11, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(530, 200, -11, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(-30, 250, 15, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(530, 250, -15, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(-30, 300, 19, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(530, 300, -19, 0, 1, 40)));
l.waitFor(l.addFoe(new PinkJelly(530, 200, -19, 0, 1, 8)));
l.waitFor(l.addFoe(new PinkJelly(-30, 200, 19, 0, 1, 8)));
};
if (r == 2){
b = 50;
while (b < 460) {
l.waitFor(l.addFoe(new GreenJelly((b - 15), -30, 0, 9, 3, 40)));
l.waitFor(l.addFoe(new PurpleJelly((b + 15), -30, 0, 13, 3, 45)));
b = (b + 80);
};
b = 50;
while (b < 460) {
l.waitFor(l.addFoe(new SeaBomb(b, -40, 0, 19, 3, 20)));
b = (b + 100);
};
};
if (r == 1){
l.waitFor(l.addFoe(new Moor(0, ((Math.random() * 250) + 50), true, 1)));
l.waitFor(l.addFoe(new Moor(0, ((Math.random() * 250) + 300), true, 1)));
l.waitFor(l.addFoe(new Moor(0, ((Math.random() * 250) + 50), false, 1)));
l.waitFor(l.addFoe(new Moor(0, ((Math.random() * 250) + 300), false, 1)));
};
if (r == 0){
b = 50;
while (b < 460) {
l.waitFor(l.addFoe(new BlueJelly((b - 15), -30, 0, 9, 3, 40)));
l.waitFor(l.addFoe(new PurpleJelly(b, -30, 0, 13, 3, 45)));
l.waitFor(l.addFoe(new PinkJelly((b + 15), -30, 0, 17, 3, 16)));
b = (b + 80);
};
};
} else {
if (c > 20){
r = random(10);
if (r == 9){
l.waitFor(l.addFoe(new Shark(0, ((l.player.y + 100) % 600), true, 1)));
l.waitFor(l.addFoe(new Shark(0, ((l.player.y - 100) % 600), false, 1)));
};
if (r == 8){
b = 100;
while (b < 450) {
l.waitFor(l.addFoe(new SpikeFish(b, -40, 0, (1 + (Math.random() * 2)), 0, 30)));
l.waitFor(l.addFoe(new BlueJelly(((Math.random() * 400) + 50), -40, 0, (2 + (Math.random() * 3)), 0, 25)));
b = (b + 50);
};
};
if (r == 7){
b = 50;
while (b < 460) {
l.waitFor(l.addFoe(new BlueJelly((b - 15), -30, 0, 9, 3, 40)));
l.waitFor(l.addFoe(new YellowJelly((b + 15), -30, 0, 13, 3, 40)));
b = (b + 80);
};
};
if (r == 6){
b = 50;
while (b < 460) {
l.waitFor(l.addFoe(new PurpleJelly((b - 15), -30, 0, 9, 3, 45)));
l.waitFor(l.addFoe(new PinkJelly((b + 15), -30, 0, 13, 3, 12)));
b = (b + 80);
};
};
if (r == 5){
b = 50;
while (b < 500) {
l.waitFor(l.addFoe(new Butterfly(b, -40, 0, (9 + (Math.random() * 12)), 3, 30)));
b = (b + 50);
};
l.waitFor(l.addFoe(new Wasp(((Math.random() * 300) + 100), -40, 0, (9 + (Math.random() * 12)), 3, 2)));
l.waitFor(l.addFoe(new Wasp(((Math.random() * 300) + 100), -40, 0, (9 + (Math.random() * 12)), 3, 2)));
};
if (r == 4){
a = 0;
while (a < 3) {
l.waitFor(l.addFoe(new BlueJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 50)));
l.waitFor(l.addFoe(new BlueJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 50)));
l.waitFor(l.addFoe(new BlueJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 50)));
l.waitFor(l.addFoe(new BlueJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 50)));
a++;
};
l.waitFor(l.addFoe(new SpikeFish(530, 400, -10, 0, 1, 40)));
l.waitFor(l.addFoe(new SpikeFish(-30, 400, 10, 0, 1, 40)));
};
if (r == 3){
a = 0;
while (a < 3) {
l.waitFor(l.addFoe(new PurpleJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 60)));
l.waitFor(l.addFoe(new PurpleJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 60)));
l.waitFor(l.addFoe(new PurpleJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 60)));
l.waitFor(l.addFoe(new PurpleJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 60)));
a++;
};
l.waitFor(l.addFoe(new SeaBomb(400, -40, 0, 29, 3, 40)));
l.waitFor(l.addFoe(new SeaBomb(100, -40, 0, 29, 3, 40)));
};
if (r == 2){
while (a < 6) {
l.waitFor(l.addFoe(new YellowJelly(530, (50 + (a * 80)), (-15 + (a * 2)), 0, 2, 35)));
l.waitFor(l.addFoe(new GreenJelly(-30, (50 + (a * 80)), (15 - (a * 2)), 0, 2, 3)));
a++;
};
};
if (r == 1){
l.waitFor(l.addFoe(new BossBush(150, -49, 0, 14, 3, 30)));
l.waitFor(l.addFoe(new BossBush(350, -49, 0, 14, 3, 30)));
};
if (r == 0){
while (a < 5) {
l.waitFor(l.addFoe(new PurpleJelly(530, (80 + (a * 80)), (-13 + (a * 2)), 0, 2, 40)));
l.waitFor(l.addFoe(new PurpleJelly(-30, (80 + (a * 80)), (13 - (a * 2)), 0, 2, 40)));
a++;
};
};
} else {
if (c > 10){
r = random(10);
if (r == 9){
a = 0;
while (a < 3) {
l.waitFor(l.addFoe(new GreenJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 12)));
l.waitFor(l.addFoe(new GreenJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 12)));
l.waitFor(l.addFoe(new Bush(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new Bush(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 30)));
a++;
};
};
if (r == 8){
a = 0;
while (a < 3) {
l.waitFor(l.addFoe(new GreenJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 15)));
l.waitFor(l.addFoe(new GreenJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 15)));
l.waitFor(l.addFoe(new YellowJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 40)));
l.waitFor(l.addFoe(new YellowJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 40)));
a++;
};
};
if (r == 7){
while (a < 5) {
l.waitFor(l.addFoe(new PinkJelly(530, (80 + (a * 80)), (-13 + (a * 2)), 0, 2, 12)));
l.waitFor(l.addFoe(new PinkJelly(-30, (80 + (a * 80)), (13 - (a * 2)), 0, 2, 12)));
a++;
};
};
if (r == 6){
while (a < 5) {
l.waitFor(l.addFoe(new BlueJelly(530, (80 + (a * 80)), (-13 + (a * 2)), 0, 2, 25)));
l.waitFor(l.addFoe(new BlueJelly(-30, (80 + (a * 80)), (13 - (a * 2)), 0, 2, 25)));
a++;
};
};
if (r == 5){
b = 50;
while (b < 500) {
l.waitFor(l.addFoe(new Shroom(b, -40, 0, (2 + (Math.random() * 3)), 0, 7)));
b = (b + 100);
};
b = 100;
while (b < 500) {
l.waitFor(l.addFoe(new BigBush(b, -40, 0, (2 + (Math.random() * 3)), 0, 4)));
b = (b + 100);
};
};
if (r == 4){
b = 100;
while (b < 350) {
l.waitFor(l.addFoe(new BigBush(540, b, (-2 - (Math.random() * 3)), 0, 0, 5)));
l.waitFor(l.addFoe(new BigBush(-40, b, (2 + (Math.random() * 3)), 0, 0, 5)));
l.waitFor(l.addFoe(new Wasp(540, (b - 50), (-1 - (Math.random() * 2)), 0, 0, 5)));
l.waitFor(l.addFoe(new Wasp(-40, (b - 50), (1 + (Math.random() * 2)), 0, 0, 5)));
b = (b + 100);
};
};
if (r == 3){
b = 100;
while (b < 350) {
l.waitFor(l.addFoe(new BigBush(540, b, (-2 - (Math.random() * 3)), 0, 0, 3)));
l.waitFor(l.addFoe(new BigBush(-40, b, (2 + (Math.random() * 3)), 0, 0, 3)));
b = (b + 50);
};
};
if (r == 2){
b = 50;
while (b < 500) {
l.waitFor(l.addFoe(new Wasp(((Math.random() * 300) + 100), -40, 0, (9 + (Math.random() * 12)), 3, 2)));
b = (b + 100);
};
};
if (r == 1){
b = 50;
while (b < 500) {
l.waitFor(l.addFoe(new Butterfly(b, -40, 0, (9 + (Math.random() * 12)), 3, 40)));
b = (b + 50);
};
};
if (r == 0){
l.waitFor(l.addFoe(new Bush(100, -49, 0, 13, 3, 15)));
l.waitFor(l.addFoe(new Bush(150, -49, 0, 15, 3, 15)));
l.waitFor(l.addFoe(new BossBush(250, -49, 0, 14, 3, 30)));
l.waitFor(l.addFoe(new Bush(350, -49, 0, 15, 3, 15)));
l.waitFor(l.addFoe(new Bush(400, -49, 0, 13, 3, 15)));
};
} else {
r = random(10);
if (r == 9){
l.waitFor(l.addFoe(new Butterfly(540, 200, -14, 0, 1, 40)));
l.waitFor(l.addFoe(new Butterfly(-40, 200, 14, 0, 1, 40)));
l.waitFor(l.addFoe(new Butterfly(540, 140, -30, 0, 1, 40)));
l.waitFor(l.addFoe(new Butterfly(-40, 140, 30, 0, 1, 40)));
};
if (r == 8){
l.waitFor(l.addFoe(new BigBush(540, 200, -14, 0, 1, 3)));
l.waitFor(l.addFoe(new BigBush(-40, 200, 14, 0, 1, 3)));
l.waitFor(l.addFoe(new BigBush(540, 250, -16, 0, 1, 3)));
l.waitFor(l.addFoe(new BigBush(-40, 250, 16, 0, 1, 3)));
};
if (r == 7){
l.waitFor(l.addFoe(new BigBush(100, -49, 0, 13, 3, 3)));
l.waitFor(l.addFoe(new BigBush(400, -49, 0, 13, 3, 3)));
b = 150;
while (b <= 350) {
l.waitFor(l.addFoe(new Bush(b, -40, 0, (2 + (Math.random() * 3)), 0, 18)));
b = (b + 50);
};
};
if (r == 6){
b = 50;
while (b < 500) {
l.waitFor(l.addFoe(new Shroom(b, -40, 0, (2 + (Math.random() * 3)), 0, 6)));
b = (b + 100);
};
b = 100;
while (b < 500) {
l.waitFor(l.addFoe(new Bush(b, -40, 0, (2 + (Math.random() * 3)), 0, 18)));
b = (b + 100);
};
};
if (r == 5){
b = 50;
while (b < 500) {
l.waitFor(l.addFoe(new Shroom(b, -40, 0, (2 + (Math.random() * 3)), 0, 6)));
b = (b + 50);
};
};
if (r == 4){
l.waitFor(l.addFoe(new CatRam(250, -49, 0, 3, 0, 30)));
l.waitFor(l.addFoe(new Bush(50, -49, 0, 2, 0, 25)));
l.waitFor(l.addFoe(new Bush(100, -49, 0, 3, 0, 25)));
l.waitFor(l.addFoe(new Bush(150, -49, 0, 4, 0, 25)));
l.waitFor(l.addFoe(new Bush(200, -49, 0, 5, 0, 25)));
l.waitFor(l.addFoe(new Bush(250, -49, 0, 6, 0, 25)));
l.waitFor(l.addFoe(new Bush(300, -49, 0, 5, 0, 25)));
l.waitFor(l.addFoe(new Bush(350, -49, 0, 4, 0, 25)));
l.waitFor(l.addFoe(new Bush(400, -49, 0, 3, 0, 25)));
l.waitFor(l.addFoe(new Bush(450, -49, 0, 2, 0, 25)));
};
if (r == 3){
for each (b in [50, 100, 400, 450]) {
l.waitFor(l.addFoe(new Bush(b, -49, 0, 9, 3, 25)));
l.waitFor(l.addFoe(new Bush(b, -49, 0, 12, 3, 25)));
l.waitFor(l.addFoe(new Bush(b, -49, 0, 16, 3, 25)));
};
};
if (r == 2){
l.waitFor(l.addFoe(new BigLog(100, -49, 0, 8, 3, 30)));
l.waitFor(l.addFoe(new Bush(150, -49, 0, 9, 3, 15)));
l.waitFor(l.addFoe(new Bush(150, -49, 0, 12, 3, 15)));
l.waitFor(l.addFoe(new BigLog(200, -49, 0, 8, 3, 30)));
l.waitFor(l.addFoe(new BigBush(250, -49, 0, 13, 3, 3)));
l.waitFor(l.addFoe(new BigLog(300, -49, 0, 8, 3, 30)));
l.waitFor(l.addFoe(new Bush(350, -49, 0, 12, 3, 15)));
l.waitFor(l.addFoe(new Bush(350, -49, 0, 9, 3, 15)));
l.waitFor(l.addFoe(new BigLog(400, -49, 0, 8, 3, 30)));
};
if (r == 1){
l.waitFor(l.addFoe(new BigLog(100, -49, 0, 9, 3, 30)));
l.waitFor(l.addFoe(new CatRam(150, -49, 0, 11, 3, 30)));
l.waitFor(l.addFoe(new BigLog(200, -49, 0, 11, 3, 30)));
l.waitFor(l.addFoe(new CatRam(250, -49, 0, 13, 3, 30)));
l.waitFor(l.addFoe(new BigLog(300, -49, 0, 11, 3, 30)));
l.waitFor(l.addFoe(new CatRam(350, -49, 0, 11, 3, 30)));
l.waitFor(l.addFoe(new BigLog(400, -49, 0, 9, 3, 30)));
l.waitFor(l.addFoe(new Kitten(200, -49, 0, 9, 3, 30)));
l.waitFor(l.addFoe(new Kitten(300, -49, 0, 9, 3, 30)));
};
if (r == 0){
l.waitFor(l.addFoe(new CatRam(100, -49, 0, 4, 0, 30)));
l.waitFor(l.addFoe(new CatRam(200, -49, 0, 4, 0, 30)));
l.waitFor(l.addFoe(new CatRam(300, -49, 0, 4, 0, 30)));
l.waitFor(l.addFoe(new CatRam(400, -49, 0, 4, 0, 30)));
};
};
};
};
};
};
};
};
};
}
override public function spawn(t:Number){
var c:Number;
if ((t % 5) == 0){
waveTimer = 0;
waveCount++;
if ((((waveCount == 33)) && ((l.foesKilled == 0)))){
Medals.unlockMedal("Pacifism");
};
if ((waveCount % 10) == 0){
l.addItem(new Heart(250, -10));
};
trace(("Wave " + waveCount));
c = (((waveCount * 0.8) + (Math.random() * 6)) - 3);
if ((((c > 80)) && ((Math.random() > 0.8)))){
c = (c - 10);
};
waves(c);
l.bottomBar.hits.text = waveCount;
};
}
}
}//package levels
Section 187
//Level3 (levels.Level3)
package levels {
import foes.*;
import bullets.*;
public class Level3 extends Levels {
public function Level3(l:Level){
super(l);
}
function makeBushWall(yspeed:Number){
var b:Number;
b = 0;
while (b < 7) {
l.waitFor(l.addFoe(new Bush((100 + (b * 50)), -30, 0, yspeed, 3, 20)));
b++;
};
}
function makeLogWall(){
var b:Number;
b = 0;
while (b < 9) {
l.addFoe(new BigLog((50 + (b * 50)), -30, 0, 6, 0, 30));
b++;
};
}
function makeBush2(){
l.addFoe(new Bush(-30, -30, ((Math.random() * 5) + 8), ((Math.random() * 5) + 5), 2, 30));
}
function makeBush3(){
l.addFoe(new Bush(530, -30, ((-(Math.random()) * 5) - 8), ((Math.random() * 5) + 5), 2, 30));
}
function makeBigBush(x:Number){
l.addFoe(new BigBush(x, -49, 0, 4, 0, 3));
}
function makeBigBush2(x:Number){
makeBigBush(x);
makeBigBush((500 - x));
}
function makeLog(x:Number){
l.addFoe(new BigLog(x, -30, 0, 4, 0, 30));
}
function makeSlime(){
l.addFoe(new GreenSlime(((Math.random() * 450) + 25), -30, 0, 5, 0, 0));
}
override public function spawn(t:Number){
if (((((t % 13) == 0)) && ((t < 230)))){
makeBush2();
makeBush3();
};
if (((((((t % 15) == 0)) && ((t > 900)))) && ((t < 1020)))){
l.addFoe(new Kitten(-30, 300, 4, 0, 0, 0));
l.addFoe(new Kitten(530, 200, -4, 0, 0, 0));
};
if (((((((t % 6) == 0)) && ((t > 1050)))) && ((t < 1200)))){
makeSlime();
};
if (((((((t % 12) == 0)) && ((t > 870)))) && ((t < 1000)))){
};
if (((((((t % 16) == 0)) && ((t > 1100)))) && ((t < 1220)))){
};
switch (t){
case 300:
makeBushWall(11);
break;
case 330:
makeBushWall(9);
makeBushWall(13);
break;
case 350:
makeLogWall();
break;
case 370:
makeBigBush2(100);
break;
case 480:
makeBigBush2(200);
break;
case 550:
makeLogWall();
break;
case 630:
makeBushWall(9);
makeBushWall(13);
makeBushWall(16);
break;
case 640:
makeBigBush2(100);
break;
case 700:
makeBigBush2(200);
break;
case 730:
makeTank(250).drop = "heart";
break;
case 790:
makeTank(100);
makeTank(400);
break;
case 1300:
l.waitFor(l.addFoe(new BigBush(-30, 100, 12, 0, 1, 3)));
l.waitFor(l.addFoe(new BigBush(-30, 200, 14, 0, 1, 3)));
l.waitFor(l.addFoe(new BigBush(-30, 300, 16, 0, 1, 3)));
break;
case 1360:
l.waitFor(l.addFoe(new BigBush(530, 100, -12, 0, 1, 3)));
l.waitFor(l.addFoe(new BigBush(530, 200, -14, 0, 1, 3)));
l.waitFor(l.addFoe(new BigBush(530, 300, -16, 0, 1, 3)));
break;
case 1450:
l.waitFor(l.addFoe(new BossBush(250, -45, 0, 13, 3, 0)));
l.waitFor(l.addFoe(new BigBush(100, -40, 0, 15, 3, 3))).drop = "heart";
l.waitFor(l.addFoe(new BigBush(400, -40, 0, 15, 3, 3))).drop = "shield";
break;
case 1650:
l.winLevel();
};
}
function makeBush(x:Number){
l.addFoe(new Bush(x, -49, 0, 4, 0, 30));
}
function makeTank(x:Number){
return (l.addFoe(new CatRam(x, -49, 0, 4, 0, 30)));
}
}
}//package levels
Section 188
//Level4 (levels.Level4)
package levels {
import foes.*;
public class Level4 extends Levels {
public function Level4(l:Level){
super(l);
}
function makeBushWall(yspeed:Number){
var b:Number;
b = 0;
while (b < 7) {
l.addFoe(new Bush((100 + (b * 50)), -30, 0, yspeed, 0, 20));
b++;
};
}
function makeLogWall(){
var b:Number;
b = 0;
while (b < 9) {
l.addFoe(new BigLog((50 + (b * 50)), -30, 0, 6, 0, 30));
b++;
};
}
function makeBush2(){
l.addFoe(new Bush(-30, -30, ((Math.random() * 5) + 8), ((Math.random() * 5) + 5), 2, 30));
}
function makeBush3(){
l.addFoe(new Bush(530, -30, ((-(Math.random()) * 5) - 8), ((Math.random() * 5) + 5), 2, 30));
}
function makeBigBush(x:Number){
l.addFoe(new BigBush(x, -49, 0, 4, 0, 4));
}
function makeBigBush2(x:Number){
makeBigBush(x);
makeBigBush((500 - x));
}
function makeLog(x:Number){
l.addFoe(new BigLog(x, -30, 0, 4, 0, 30));
}
function makeSlime(){
l.addFoe(new GreenSlime(((Math.random() * 450) + 25), -30, 0, 5, 0, 0));
}
override public function spawn(t:Number){
if (((((((t % 13) == 0)) && ((t > 30)))) && ((t < 180)))){
l.addFoe(new Shroom(((Math.random() * 450) + 25), -30, 0, 5, 0, 4));
};
if (((((((t % 12) == 0)) && ((t > 500)))) && ((t < 620)))){
l.addFoe(new Shroom(530, ((Math.random() * 550) + 25), -5, 0, 0, 4));
};
if (((((((t % 12) == 0)) && ((t > 620)))) && ((t < 740)))){
l.addFoe(new Shroom(-30, ((Math.random() * 550) + 25), 5, 0, 0, 4));
};
if (((((((t % 12) == 0)) && ((t > 740)))) && ((t < 860)))){
l.addFoe(new Shroom(((Math.random() * 450) + 25), 630, 0, -5, 0, 4));
};
if (((((((t % 23) == 0)) && ((t > 1170)))) && ((t < 1400)))){
l.addFoe(new Butterfly(((Math.random() * 450) + 25), -30, 0, 5, 0, 40));
};
switch (t){
case 260:
makeBigBush2(100);
break;
case 300:
makeBigBush2(200);
break;
case 370:
makeBushWall(5);
break;
case 400:
makeBushWall(5);
break;
case 430:
makeBushWall(5);
break;
case 950:
makeBigBush2(70);
break;
case 980:
makeBigBush2(140);
break;
case 1010:
makeBigBush2(210);
break;
case 1040:
makeBigBush2(140);
break;
case 1070:
makeBigBush2(70);
break;
case 1560:
l.winLevel();
break;
};
}
function makeBush(x:Number){
l.addFoe(new Bush(x, -49, 0, 4, 0, 30));
}
function makeTank(x:Number){
l.addFoe(new CatRam(x, -49, 0, 4, 0, 30));
}
}
}//package levels
Section 189
//Level5 (levels.Level5)
package levels {
import foes.*;
public class Level5 extends Levels {
public function Level5(l:Level){
super(l);
}
function makeBushWall(yspeed:Number){
var b:Number;
b = 0;
while (b < 7) {
l.addFoe(new Bush((100 + (b * 50)), -30, 0, yspeed, 0, 20));
b++;
};
}
function makeLogWall(){
var b:Number;
b = 0;
while (b < 9) {
l.addFoe(new BigLog((50 + (b * 50)), -30, 0, 6, 0, 30));
b++;
};
}
function makeBush2(){
l.addFoe(new Bush(-30, -30, ((Math.random() * 5) + 8), ((Math.random() * 5) + 5), 2, 30));
}
function makeBush3(){
l.addFoe(new Bush(530, -30, ((-(Math.random()) * 5) - 8), ((Math.random() * 5) + 5), 2, 30));
}
function makeBigBush(x:Number){
l.addFoe(new BigBush(x, -49, 0, 4, 0, 3));
}
function makeBigBush2(x:Number){
makeBigBush(x);
makeBigBush((500 - x));
}
function makeLog(x:Number){
l.addFoe(new BigLog(x, -30, 0, 4, 0, 30));
}
function makeSlime(){
l.addFoe(new GreenSlime(((Math.random() * 450) + 25), -30, 0, 5, 0, 0));
}
override public function spawn(t:Number){
if (((((t % 12) == 0)) && ((t < 500)))){
l.addFoe(new Kitten(-30, 300, 6, 0, 0, 0));
l.addFoe(new Kitten(530, 250, -6, 0, 0, 0));
};
if (((((t % 16) == 0)) && ((t < 500)))){
l.addFoe(new Bush(-30, 150, 5, 0, 0, 1000));
l.addFoe(new Bush(530, 200, -5, 0, 0, 1000));
};
if (((((t % 21) == 0)) && ((t < 500)))){
l.addFoe(new GreenSlime(-30, 100, 4, 0, 0, 1000));
l.addFoe(new GreenSlime(530, 50, -4, 0, 0, 1000));
};
switch (t){
case 600:
l.waitFor(l.addFoe(new SlimeKing(250, -150, 0, 19, 3, 0)));
BGM.play("bossMusic");
break;
case 720:
l.winLevel();
break;
};
}
function makeBush(x:Number){
l.addFoe(new Bush(x, -49, 0, 4, 0, 30));
}
function makeTank(x:Number){
l.addFoe(new CatRam(x, -49, 0, 4, 0, 30));
}
}
}//package levels
Section 190
//Level6 (levels.Level6)
package levels {
import foes.*;
public class Level6 extends Levels {
public function Level6(l:Level){
super(l);
}
function makeAmbush(){
var a:int;
while (a < 3) {
l.waitFor(l.addFoe(new BlueJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new BlueJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new PurpleJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new PurpleJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 30)));
a++;
};
}
override public function spawn(t:Number){
if (((((t % 30) == 0)) && ((t < 300)))){
l.addFoe(new BlueJelly(-30, 100, 4, 0, 0, 30));
l.addFoe(new BlueJelly(530, 170, -4, 0, 0, 30));
};
if (((((((t % 30) == 0)) && ((t > 330)))) && ((t < 630)))){
l.addFoe(new PurpleJelly(-30, 100, 4, 0, 0, 30));
l.addFoe(new PurpleJelly(530, 170, -4, 0, 0, 30));
};
if (((((((t % 24) == 0)) && ((t > 630)))) && ((t < 930)))){
l.addFoe(new PurpleJelly(-30, 100, 4, 0, 0, 30));
l.addFoe(new PinkJelly(530, 170, -4, 0, 0, 8));
};
if (((((((t % 28) == 0)) && ((t > 1360)))) && ((t < 1960)))){
l.addFoe(new PinkJelly(-30, 60, 4, 0, 0, 10));
l.addFoe(new PinkJelly(530, 120, -4, 0, 0, 10));
};
switch (t){
case 1060:
makeBlueAmbush();
break;
case 1190:
makePurpleAmbush();
break;
case 1320:
makeAmbush();
break;
case 1600:
makeMiniAmbush1();
break;
case 1700:
makeMiniAmbush1();
break;
case 1800:
makeMiniAmbush1();
break;
case 1900:
makeMiniAmbush1();
break;
case 2200:
l.winLevel();
break;
};
}
function makeBlueAmbush(){
var a:int;
while (a < 5) {
l.addFoe(new BlueJelly(530, (80 + (a * 80)), (-13 + (a * 2)), 0, 2, 30));
l.addFoe(new BlueJelly(-30, (80 + (a * 80)), (13 - (a * 2)), 0, 2, 30));
a++;
};
}
function makePurpleAmbush(){
var a:int;
while (a < 5) {
l.addFoe(new PurpleJelly(530, (80 + (a * 80)), (-13 + (a * 2)), 0, 2, 30));
l.addFoe(new PurpleJelly(-30, (80 + (a * 80)), (13 - (a * 2)), 0, 2, 30));
a++;
};
}
function makeMiniAmbush1(){
var a:int;
while (a < 2) {
l.addFoe(new BlueJelly(530, (200 + (a * 60)), (-12 + (a * 2)), 0, 2, 30));
l.addFoe(new BlueJelly(-30, (200 + (a * 60)), (12 - (a * 2)), 0, 2, 30));
a++;
};
}
}
}//package levels
Section 191
//Level7 (levels.Level7)
package levels {
import foes.*;
public class Level7 extends Levels {
public var b:Number;// = 0
public function Level7(l:Level){
b = 0;
super(l);
}
function makeBlueAmbush(){
var a:int;
while (a < 5) {
l.addFoe(new BlueJelly(530, (80 + (a * 80)), (-13 + (a * 2)), 0, 2, 30));
l.addFoe(new BlueJelly(-30, (80 + (a * 80)), (13 - (a * 2)), 0, 2, 30));
a++;
};
}
function makeAmbush(){
var a:int;
a = 0;
while (a < 3) {
l.waitFor(l.addFoe(new GreenJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 3)));
l.waitFor(l.addFoe(new GreenJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 3)));
l.waitFor(l.addFoe(new YellowJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 60)));
l.waitFor(l.addFoe(new YellowJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 60)));
a++;
};
}
function makePurpleAmbush(){
var a:int;
while (a < 5) {
l.addFoe(new PurpleJelly(530, (80 + (a * 80)), (-13 + (a * 2)), 0, 2, 30));
l.addFoe(new PurpleJelly(-30, (80 + (a * 80)), (13 - (a * 2)), 0, 2, 30));
a++;
};
}
function makeAmbush2(){
var a:int;
a = 0;
while (a < 3) {
l.waitFor(l.addFoe(new PinkJelly(530, (110 + (a * 80)), (-16 + (a * 1)), 0, 1, 5)));
l.waitFor(l.addFoe(new PinkJelly(-30, (110 + (a * 80)), (16 - (a * 1)), 0, 1, 5)));
l.waitFor(l.addFoe(new GreenJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new GreenJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 30)));
a++;
};
}
function makeAmbush3(){
var a:int;
a = 0;
while (a < 3) {
l.waitFor(l.addFoe(new PurpleJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new PurpleJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new GreenJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new GreenJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 30)));
a++;
};
l.waitFor(l.addFoe(new YellowJelly(530, 400, -10, 0, 1, 40))).drop = "heart";
l.waitFor(l.addFoe(new YellowJelly(-30, 400, 10, 0, 1, 40))).drop = "shield";
}
function makeMiniAmbush2(){
l.addFoe(new BlueJelly(530, 100, -11, 0, 0, 3));
l.addFoe(new BlueJelly(-30, 200, 11, 0, 0, 3));
}
function makeMiniAmbush3(){
l.addFoe(new PurpleJelly(530, 100, -12, 0, 0, 3));
l.addFoe(new PurpleJelly(-30, 200, 12, 0, 0, 3));
}
override public function spawn(t:Number){
if (((((t % 25) == 0)) && ((t < 480)))){
l.addFoe(new SpikeFish(((Math.random() * 400) + 50), -40, 0, 4, 0, 30));
};
if (((((((t % 30) == 0)) && ((t > 540)))) && ((t < 840)))){
l.addFoe(new YellowJelly((50 + (b * 20)), -30, 0, 5, 0, 55));
l.addFoe(new YellowJelly((450 - (b * 20)), -30, 0, 5, 0, 55));
b++;
};
if (((((((t % 30) == 0)) && ((t > 900)))) && ((t < 1140)))){
l.addFoe(new GreenJelly((50 + (b * 50)), -30, 0, 5, 0, 3));
l.addFoe(new GreenJelly((450 - (b * 50)), -30, 0, 5, 0, 3));
b++;
};
switch (t){
case 850:
b = 0;
break;
case 1200:
makeAmbush();
break;
case 1290:
makeAmbush2();
break;
case 1360:
makeAmbush3();
break;
case 1440:
makeMiniAmbush1();
break;
case 1460:
makeMiniAmbush1();
break;
case 1480:
makeMiniAmbush1();
break;
case 1570:
makeMiniAmbush2();
break;
case 1600:
makeMiniAmbush2();
break;
case 1690:
makeMiniAmbush3();
break;
case 1720:
makeMiniAmbush3();
break;
case 1820:
l.winLevel();
break;
};
}
function makeMiniAmbush1(){
l.addFoe(new GreenJelly(530, 100, -9, 0, 0, 1));
l.addFoe(new GreenJelly(-30, 200, 9, 0, 0, 1));
}
}
}//package levels
Section 192
//Level8 (levels.Level8)
package levels {
import foes.*;
public class Level8 extends Levels {
public var b:Number;// = 0
public function Level8(l:Level){
b = 0;
super(l);
}
function makeAmbush(){
var a:int;
a = 0;
while (a < 2) {
l.waitFor(l.addFoe(new PinkJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 6)));
l.waitFor(l.addFoe(new PinkJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 6)));
l.waitFor(l.addFoe(new Butterfly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new Butterfly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 30)));
a++;
};
}
function makeAmbush2(){
var a:int;
a = 0;
while (a < 3) {
l.waitFor(l.addFoe(new YellowJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new YellowJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new Butterfly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new Butterfly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 30)));
a++;
};
}
function makeAmbush3(){
var a:int;
a = 0;
while (a < 4) {
l.waitFor(l.addFoe(new BlueJelly(530, (110 + (a * 80)), (-16 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new GreenJelly(-30, (110 + (a * 80)), (16 - (a * 1)), 0, 1, 5)));
l.waitFor(l.addFoe(new PurpleJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new YellowJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 30)));
a++;
};
}
function makeAmbush4(){
var a:int;
a = 0;
while (a < 3) {
l.waitFor(l.addFoe(new PurpleJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new PurpleJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new GreenJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new GreenJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 30)));
a++;
};
l.waitFor(l.addFoe(new YellowJelly(530, 400, -10, 0, 1, 40))).drop = "heart";
l.waitFor(l.addFoe(new YellowJelly(-30, 400, 10, 0, 1, 40))).drop = "shield";
}
function makeMiniAmbush2(){
l.addFoe(new BlueJelly(530, 100, -11, 0, 0, 3));
l.addFoe(new BlueJelly(-30, 200, 11, 0, 0, 3));
}
function makeMiniAmbush3(){
l.addFoe(new PurpleJelly(530, 100, -12, 0, 0, 3));
l.addFoe(new PurpleJelly(-30, 200, 12, 0, 0, 3));
}
override public function spawn(t:Number){
if (((((t % 90) == 0)) && ((t < 480)))){
l.addFoe(new SeaBomb(((Math.random() * 400) + 50), -40, 0, 4, 0, 40));
};
if (((((((t % 35) == 0)) && ((t > 540)))) && ((t < 800)))){
l.addFoe(new YellowJelly(((Math.random() * 400) + 50), -30, 0, 5, 0, 40));
l.addFoe(new PurpleJelly(((Math.random() * 400) + 50), -30, 0, 5, 0, 60));
b++;
};
switch (t){
case 900:
makeAmbush();
break;
case 1000:
makeAmbush2();
break;
case 1100:
l.waitFor(l.addFoe(new Coral(250, -50, 0, 14, 3, 50)));
break;
case 1240:
l.winLevel();
break;
};
}
function makeMiniAmbush1(){
l.addFoe(new GreenJelly(530, 100, -9, 0, 0, 1));
l.addFoe(new GreenJelly(-30, 200, 9, 0, 0, 1));
}
}
}//package levels
Section 193
//Level9 (levels.Level9)
package levels {
import foes.*;
import bullets.*;
public class Level9 extends Levels {
public var b:Number;// = 0
public function Level9(l:Level){
b = 0;
super(l);
}
function makeMiniAmbush3(){
l.addFoe(new PurpleJelly(530, 100, -12, 0, 0, 3));
l.addFoe(new PurpleJelly(-30, 200, 12, 0, 0, 3));
}
function makeBlue(x:Number){
l.addFoe(new BlueJelly(x, -40, 0, 5, 0, 5000));
}
function makeAmbush(){
var a:int;
a = 0;
while (a < 5) {
l.waitFor(l.addFoe(new BlueJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 6)));
l.waitFor(l.addFoe(new BlueJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 6)));
l.waitFor(l.addFoe(new BlueJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new BlueJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 30)));
a++;
};
}
function makePurple(x:Number){
l.addFoe(new PurpleJelly(x, -40, 0, 5, 0, 5000));
}
function makePink(x:Number){
l.addFoe(new PinkJelly(x, -40, 0, 5, 0, 5000));
}
function makeAmbush2(){
var a:int;
a = 0;
while (a < 3) {
l.waitFor(l.addFoe(new YellowJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new YellowJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new Butterfly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new Butterfly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 30)));
a++;
};
}
function makeAmbush3(){
var a:int;
a = 0;
while (a < 4) {
l.waitFor(l.addFoe(new BlueJelly(530, (110 + (a * 80)), (-16 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new GreenJelly(-30, (110 + (a * 80)), (16 - (a * 1)), 0, 1, 5)));
l.waitFor(l.addFoe(new PurpleJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new YellowJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 30)));
a++;
};
}
function makeAmbush4(){
var a:int;
a = 0;
while (a < 3) {
l.waitFor(l.addFoe(new PurpleJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new PurpleJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new GreenJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new GreenJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 30)));
a++;
};
l.waitFor(l.addFoe(new YellowJelly(530, 400, -10, 0, 1, 40)));
l.waitFor(l.addFoe(new YellowJelly(-30, 400, 10, 0, 1, 40)));
}
function makeShark(y:Number, left:Boolean){
return (l.addFoe(new Shark(0, y, left, 1)));
}
function makeMiniAmbush2(){
l.addFoe(new BlueJelly(530, 100, -11, 0, 0, 3));
l.addFoe(new BlueJelly(-30, 200, 11, 0, 0, 3));
}
function makeMoor(y:Number, left:Boolean){
l.addFoe(new Moor(0, y, left, 1));
}
override public function spawn(t:Number){
if (((((((t % 25) == 0)) && ((t > 580)))) && ((t < 770)))){
makeBlue(70);
makePurple(140);
makeBlue(430);
makePurple(360);
makePink(290);
makePink(210);
};
if (((((((t % 35) == 0)) && ((t > 1200)))) && ((t < 1650)))){
l.addFoe(new SpikeFish(((Math.random() * 400) + 50), -40, 0, 4, 0, 30));
};
if (((((((t % 16) == 0)) && ((t > 1200)))) && ((t < 1650)))){
l.addFoe(new PurpleJelly(((Math.random() * 400) + 50), -40, 0, 5, 0, 50));
};
if (((((((t % 90) == 0)) && ((t > 1750)))) && ((t < 2100)))){
makeMoor(((Math.random() * 500) + 50), true);
};
if (((((((t % 90) == 45)) && ((t > 1750)))) && ((t < 2100)))){
makeMoor(((Math.random() * 500) + 50), false);
};
switch (t){
case 60:
makeShark(300, true);
break;
case 120:
makeShark(200, false);
break;
case 180:
makeShark(400, true);
break;
case 230:
makeShark(250, false);
break;
case 280:
makeShark(500, true);
break;
case 330:
makeShark(400, false);
break;
case 370:
makeShark(150, true);
break;
case 410:
makeShark(200, false);
break;
case 440:
makeShark(500, true);
break;
case 470:
makeShark(300, false);
break;
case 880:
makeShark(100, false);
makeShark(200, true).drop = "shield";
break;
case 960:
l.addFoe(new SeaBomb(400, -40, 0, 4, 0, 30));
l.addFoe(new SeaBomb(100, -40, 0, 4, 0, 30));
break;
case 1000:
l.addFoe(new SeaBomb(320, -40, 0, 4, 0, 30));
l.addFoe(new SeaBomb(180, -40, 0, 4, 0, 30));
break;
case 1130:
makeShark(100, false).drop = "heart";
makeShark(200, true);
break;
case 2290:
l.winLevel();
break;
};
}
function makeMiniAmbush1(){
l.addFoe(new GreenJelly(530, 100, -9, 0, 0, 1));
l.addFoe(new GreenJelly(-30, 200, 9, 0, 0, 1));
}
}
}//package levels
Section 194
//Levels (levels.Levels)
package levels {
public class Levels {
var l:Level;
public var survival:Boolean;// = false
public function Levels(l:Level){
survival = false;
super();
this.l = l;
}
public function timer(){
}
public function spawn(t:Number){
}
}
}//package levels
Section 195
//backgroundscrolling_375 (main_fla.backgroundscrolling_375)
package main_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class backgroundscrolling_375 extends MovieClip {
public var tiles:MovieClip;
public function backgroundscrolling_375(){
super();
addFrameScript(0, frame1);
}
function frame1(){
if (!Global.vars.options[0]){
stop();
};
}
}
}//package main_fla
Section 196
//backgroundstrips_377 (main_fla.backgroundstrips_377)
package main_fla {
import flash.display.*;
import levels.*;
public dynamic class backgroundstrips_377 extends MovieClip {
public function backgroundstrips_377(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8);
}
function frame3(){
stop();
gotoAndStop((parent.parent.parent as Level).bg);
}
function frame6(){
stop();
gotoAndStop((parent.parent.parent as Level).bg);
}
function frame7(){
stop();
gotoAndStop((parent.parent.parent as Level).bg);
}
function frame1(){
stop();
gotoAndStop((parent.parent.parent as Level).bg);
}
function frame4(){
stop();
gotoAndStop((parent.parent.parent as Level).bg);
}
function frame5(){
stop();
gotoAndStop((parent.parent.parent as Level).bg);
}
function frame8(){
stop();
gotoAndStop((parent.parent.parent as Level).bg);
}
function frame2(){
stop();
gotoAndStop((parent.parent.parent as Level).bg);
}
}
}//package main_fla
Section 197
//backgroundtiles_376 (main_fla.backgroundtiles_376)
package main_fla {
import flash.display.*;
public dynamic class backgroundtiles_376 extends MovieClip {
public var tile1:MovieClip;
public var tile2:MovieClip;
public var tile3:MovieClip;
public var tile4:MovieClip;
public function backgroundtiles_376(){
super();
addFrameScript(0, frame1, 102, frame103);
}
function frame1(){
stop();
}
function frame103(){
stop();
}
}
}//package main_fla
Section 198
//bottomBar_378 (main_fla.bottomBar_378)
package main_fla {
import flash.display.*;
import flash.events.*;
import foes.*;
import flash.text.*;
import flash.net.*;
public dynamic class bottomBar_378 extends MovieClip {
public var mainChargeBar:MovieClip;
public var hpBar:MovieClip;
public var weaponIcon1:MovieClip;
public var bombs:TextField;
public var weaponIcon2:MovieClip;
public var bossHP:FoeBar;
public var medalBox:MovieClip;
public var subChargeBar:MovieClip;
public var health:TextField;
public var hits:TextField;
public var powah:MovieClip;
public var konglink:SimpleButton;
public var score:TextField;
public var waves:MovieClip;
public var bomb:MovieClip;
public var sub:TextField;
public var main:TextField;
public var multiplier:TextField;
public var bullets:TextField;
public var p0:MovieClip;
public var kills:TextField;
public var fps:TextField;
public var money:TextField;
public function bottomBar_378(){
super();
addFrameScript(0, frame1);
}
function frame1(){
getChildByName("konglink").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kongregate.com/?gamereferral=bullet-heaven"), "_blank");
});
}
}
}//package main_fla
Section 199
//coral2_102 (main_fla.coral2_102)
package main_fla {
import flash.display.*;
public dynamic class coral2_102 extends MovieClip {
public function coral2_102(){
super();
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package main_fla
Section 200
//fader_12 (main_fla.fader_12)
package main_fla {
import flash.display.*;
public dynamic class fader_12 extends MovieClip {
public var l:String;
public function fader_12(){
super();
addFrameScript(0, frame1, 7, frame8, 14, frame15);
}
function frame15(){
if (this){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame8(){
MovieClip(root).gotoAndStop(l);
}
}
}//package main_fla
Section 201
//kittenbody_164 (main_fla.kittenbody_164)
package main_fla {
import flash.display.*;
import foes.*;
public dynamic class kittenbody_164 extends MovieClip {
public function kittenbody_164(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop((parent as Foe).kitten);
}
}
}//package main_fla
Section 202
//kittenhead_94 (main_fla.kittenhead_94)
package main_fla {
import flash.display.*;
import foes.*;
public dynamic class kittenhead_94 extends MovieClip {
public function kittenhead_94(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop((parent as Foe).kitten);
}
}
}//package main_fla
Section 203
//Kongintro12fps_41 (main_fla.Kongintro12fps_41)
package main_fla {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class Kongintro12fps_41 extends MovieClip {
public var konglink:SimpleButton;
public function Kongintro12fps_41(){
super();
addFrameScript(0, frame1, 90, frame91);
}
function frame91(){
stop();
(root as Main).fadeTo("ads");
}
function frame1(){
getChildByName("konglink").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kongregate.com/?gamereferral=bullet-heaven"), "_blank");
});
}
}
}//package main_fla
Section 204
//levelDisplay_417 (main_fla.levelDisplay_417)
package main_fla {
import flash.display.*;
import flash.text.*;
public dynamic class levelDisplay_417 extends MovieClip {
public var scoreT:TextField;
public var killsT:TextField;
public var waveT:TextField;
public function levelDisplay_417(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 21, frame22, 22, frame23, 23, frame24, 24, frame25, 25, frame26, 26, frame27, 27, frame28);
}
function frame10(){
showScore();
}
function frame14(){
showScore();
}
function frame18(){
showScore();
}
function frame12(){
showScore();
}
function frame3(){
showScore();
}
function frame6(){
showScore();
}
function frame7(){
showScore();
}
function frame1(){
gotoAndStop((root as Main).selectedLevel);
showScore();
}
function frame19(){
showScore();
}
function frame25(){
showScore();
waveT.text = ("Best Wave: " + (root as Main).survivalWaves);
killsT.text = ("Most Kills: " + (root as Main).survivalKills);
}
function frame13(){
showScore();
}
function frame17(){
showScore();
}
function frame4(){
showScore();
}
function frame5(){
showScore();
}
function frame22(){
showScore();
}
function frame16(){
showScore();
}
function frame8(){
showScore();
}
function frame9(){
showScore();
}
function frame2(){
showScore();
}
function frame15(){
showScore();
}
function frame23(){
showScore();
}
function frame24(){
showScore();
}
public function showScore(){
scoreT.text = ("High Score: " + (root as Main).levelScores[currentFrame]);
}
function frame20(){
showScore();
}
function frame21(){
showScore();
}
function frame27(){
showScore();
}
function frame11(){
showScore();
}
function frame28(){
showScore();
}
function frame26(){
showScore();
}
}
}//package main_fla
Section 205
//levelicons_409 (main_fla.levelicons_409)
package main_fla {
import flash.display.*;
public dynamic class levelicons_409 extends MovieClip {
public function levelicons_409(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 206
//levelstatus_403 (main_fla.levelstatus_403)
package main_fla {
import flash.display.*;
public dynamic class levelstatus_403 extends MovieClip {
public function levelstatus_403(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 207
//levelunlocked_420 (main_fla.levelunlocked_420)
package main_fla {
import flash.display.*;
public dynamic class levelunlocked_420 extends MovieClip {
public function levelunlocked_420(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
visible = false;
if ((root as Main).levelUnlock){
(root as Main).selectedLevel = (root as Main).unlockedLevel;
play();
(root as Main).levelUnlock = false;
if ((root as Main).levelScores[(root as Main).selectedLevel] == undefined){
(root as Main).levelScores[(root as Main).selectedLevel] = 0;
};
(root as Main).selectLevel((root as Main).selectedLevel);
};
}
function frame2(){
visible = true;
}
}
}//package main_fla
Section 208
//medalBox_15 (main_fla.medalBox_15)
package main_fla {
import flash.display.*;
public dynamic class medalBox_15 extends MovieClip {
public var icon:MedalIcon;
public function medalBox_15(){
super();
addFrameScript(0, frame1);
}
function frame1(){
icon.icon.gotoAndStop(Medals.current);
}
}
}//package main_fla
Section 209
//medalBox2_14 (main_fla.medalBox2_14)
package main_fla {
import flash.display.*;
public dynamic class medalBox2_14 extends MovieClip {
public function medalBox2_14(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 210
//menuselecy_349 (main_fla.menuselecy_349)
package main_fla {
import flash.display.*;
public dynamic class menuselecy_349 extends MovieClip {
public function menuselecy_349(){
super();
addFrameScript(5, frame6);
}
function frame6(){
stop();
}
}
}//package main_fla
Section 211
//playaunlocked_418 (main_fla.playaunlocked_418)
package main_fla {
import flash.display.*;
public dynamic class playaunlocked_418 extends MovieClip {
public function playaunlocked_418(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
visible = false;
if ((root as Main).playerUnlock){
play();
(root as Main).playerUnlock = false;
};
}
function frame2(){
visible = true;
}
}
}//package main_fla
Section 212
//playerButton_386 (main_fla.playerButton_386)
package main_fla {
import flash.display.*;
public dynamic class playerButton_386 extends MovieClip {
public var icons:MovieClip;
public function playerButton_386(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 213
//playerIcons_387 (main_fla.playerIcons_387)
package main_fla {
import flash.display.*;
public dynamic class playerIcons_387 extends MovieClip {
public function playerIcons_387(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 214
//playerPreview_411 (main_fla.playerPreview_411)
package main_fla {
import flash.display.*;
public dynamic class playerPreview_411 extends MovieClip {
public function playerPreview_411(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 215
//playerpreview2_410 (main_fla.playerpreview2_410)
package main_fla {
import flash.display.*;
public dynamic class playerpreview2_410 extends MovieClip {
public var showPlayer:MovieClip;
public function playerpreview2_410(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 216
//powah_391 (main_fla.powah_391)
package main_fla {
import flash.display.*;
public dynamic class powah_391 extends MovieClip {
public function powah_391(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 217
//rankIcon_394 (main_fla.rankIcon_394)
package main_fla {
import flash.display.*;
public dynamic class rankIcon_394 extends MovieClip {
public function rankIcon_394(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 218
//showlevels_416 (main_fla.showlevels_416)
package main_fla {
import flash.display.*;
public dynamic class showlevels_416 extends MovieClip {
public var showLevel:MovieClip;
public function showlevels_416(){
super();
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
}
}//package main_fla
Section 219
//swordLoader_3 (main_fla.swordLoader_3)
package main_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public dynamic class swordLoader_3 extends MovieClip {
public var loaded:Number;
public var bar:MovieClip;
public var percent:TextField;
public var playButton:SimpleButton;
public var loadingComplete:Boolean;
public function swordLoader_3(){
super();
addFrameScript(0, frame1, 14, frame15);
}
public function enterFrameHandler(e:Event=null){
if (!loadingComplete){
if (loaderInfo){
loaded = (loaderInfo.bytesLoaded / loaderInfo.bytesTotal);
};
if (bar){
bar.scaleY = loaded;
percent.text = (("" + int((loaded * 100))) + "%");
};
if (loaded >= 1){
loadingComplete = true;
gotoAndPlay("loaded");
};
};
}
public function playButtonClickHandler(e:Event=null):void{
startMovie();
}
function frame15(){
stop();
if (((playButton) && (!(playButton.hasEventListener(MouseEvent.CLICK))))){
playButton.addEventListener(MouseEvent.CLICK, playButtonClickHandler, false, 0, true);
};
}
function frame1(){
addEventListener(Event.ENTER_FRAME, enterFrameHandler, false, 0, true);
loadingComplete = false;
loaded = 0;
stop();
}
public function startMovie():void{
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
if (((root) && ((root is MovieClip)))){
MovieClip(root).play();
};
}
}
}//package main_fla
Section 220
//tick1_370 (main_fla.tick1_370)
package main_fla {
import flash.display.*;
public dynamic class tick1_370 extends MovieClip {
public function tick1_370(){
super();
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package main_fla
Section 221
//tickBox_368 (main_fla.tickBox_368)
package main_fla {
import flash.display.*;
public dynamic class tickBox_368 extends MovieClip {
public var tick:MovieClip;
public function tickBox_368(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 222
//ticky_369 (main_fla.ticky_369)
package main_fla {
import flash.display.*;
public dynamic class ticky_369 extends MovieClip {
public function ticky_369(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 223
//Timeline_19 (main_fla.Timeline_19)
package main_fla {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class Timeline_19 extends MovieClip {
public var b2:SimpleButton;
public var b4:SimpleButton;
public var b9:SimpleButton;
public var b5:SimpleButton;
public var b6:SimpleButton;
public var b7:SimpleButton;
public var b1:SimpleButton;
public var b3:SimpleButton;
public var b8:SimpleButton;
public var k:SimpleButton;
public var konglink:SimpleButton;
public function Timeline_19(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21);
}
function frame10(){
getChildByName("b8").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://halcyonicfalconx.newgrounds.com/news/post/579117"), "_blank");
});
}
function frame14(){
getChildByName("konglink").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kongregate.com/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame18(){
getChildByName("k").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/shooter-games/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame12(){
getChildByName("b8").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.zazzle.com/kupo707*"), "_blank");
});
}
function frame3(){
getChildByName("b3").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/epic-battle-fantasy-3/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame6(){
getChildByName("b4").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/mecha-dress-up-game/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame7(){
getChildByName("b6").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kupo707.deviantart.com/"), "_blank");
});
}
function frame19(){
getChildByName("k").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/shooter-games/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame13(){
getChildByName("konglink").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kongregate.com/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame17(){
getChildByName("k").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/shooter-games/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame4(){
getChildByName("b3").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/epic-battle-fantasy-3/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame5(){
getChildByName("b5").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/the-kitten-game/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame9(){
getChildByName("b9").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.facebook.com/pages/Halcyonic-Falcon-X/148298581863486"), "_blank");
});
}
function frame16(){
getChildByName("k").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/shooter-games/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame8(){
getChildByName("b7").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.facebook.com/pages/Epic-Battle-Fantasy-3/121491377896263"), "_blank");
});
}
function frame21(){
getChildByName("k").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/shooter-games/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame2(){
getChildByName("b2").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/epic-battle-fantasy-2/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame15(){
getChildByName("k").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/shooter-games/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame1(){
stop();
gotoAndStop((int((Math.random() * 21)) + 1));
getChildByName("b1").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/epic-battle-fantasy/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame20(){
getChildByName("k").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/shooter-games/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame11(){
getChildByName("b8").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://halcyonicfalconx.newgrounds.com/news/post/579117"), "_blank");
});
}
}
}//package main_fla
Section 224
//Timeline_284 (main_fla.Timeline_284)
package main_fla {
import flash.display.*;
public dynamic class Timeline_284 extends MovieClip {
public function Timeline_284(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 225
//Timeline_335 (main_fla.Timeline_335)
package main_fla {
import flash.display.*;
public dynamic class Timeline_335 extends MovieClip {
public function Timeline_335(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 226
//Timeline_347 (main_fla.Timeline_347)
package main_fla {
import flash.display.*;
public dynamic class Timeline_347 extends MovieClip {
public function Timeline_347(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 227
//Timeline_406 (main_fla.Timeline_406)
package main_fla {
import flash.display.*;
public dynamic class Timeline_406 extends MovieClip {
public function Timeline_406(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 228
//Timeline_408 (main_fla.Timeline_408)
package main_fla {
import flash.display.*;
public dynamic class Timeline_408 extends MovieClip {
public var icons:MovieClip;
public function Timeline_408(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 229
//Timeline_57 (main_fla.Timeline_57)
package main_fla {
import flash.display.*;
public dynamic class Timeline_57 extends MovieClip {
public function Timeline_57(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 230
//upgradecomplete_422 (main_fla.upgradecomplete_422)
package main_fla {
import flash.display.*;
public dynamic class upgradecomplete_422 extends MovieClip {
public function upgradecomplete_422(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
visible = false;
}
function frame2(){
visible = true;
}
}
}//package main_fla
Section 231
//waves_388 (main_fla.waves_388)
package main_fla {
import flash.display.*;
public dynamic class waves_388 extends MovieClip {
public function waves_388(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 232
//weaponIcons_382 (main_fla.weaponIcons_382)
package main_fla {
import flash.display.*;
public dynamic class weaponIcons_382 extends MovieClip {
public function weaponIcons_382(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 233
//ScoreLabel (misc.ScoreLabel)
package misc {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class ScoreLabel extends MovieClip {
public var label:TextField;
var score:String;
var time:Number;
public function ScoreLabel(score:Number, combo:Number, x:Number, y:Number){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
this.x = x;
this.y = y;
this.score = ("" + score);
if (combo != 1){
this.score = (this.score + ("x" + combo));
};
if (score == -1){
gotoAndStop(6);
time = 30;
} else {
if (score < 300){
gotoAndStop(1);
time = 20;
} else {
if (score < 1000){
gotoAndStop(2);
time = 30;
} else {
if (score < 3000){
gotoAndStop(3);
time = 40;
} else {
if (score < 10000){
gotoAndStop(4);
time = 50;
} else {
gotoAndStop(5);
time = 90;
};
};
};
};
};
addEventListener(Event.ENTER_FRAME, fade);
cacheAsBitmap = true;
}
function frame3(){
label.text = ("" + score);
}
function frame1(){
label.text = ("" + score);
}
function kill(){
removeEventListener(Event.ENTER_FRAME, fade);
if (this){
parent.removeChild(this);
};
}
function frame4(){
label.text = ("" + score);
}
function frame5(){
label.text = ("" + score);
}
function fade(e:Event){
if (time < 20){
cacheAsBitmap = false;
alpha = ((time * 5) / 100);
};
time--;
if (time == 0){
kill();
};
}
function frame2(){
label.text = ("" + score);
}
}
}//package misc
Section 234
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const NO_USER:String = "NoUser";
public static const IO_ERROR:String = "IOError";
public static const ITEM_NEW:String = "ItemNew";
public static const ITEM_OWNED:String = "ItemOwned";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const STORE_SHOW:String = "StoreShow";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _inventory:MochiInventory;
public function MochiCoins(){
super();
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function showStore(options:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:options}, null, null);
}
public static function requestFunding(properties:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestFunding", properties);
}
public static function showItem(options:Object=null):void{
if (((!(options)) || (!((typeof(options.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:options}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showVideo(options:Object=null):void{
if (((!(options)) || (!((typeof(options.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:options}, null, null);
}
addEventListener(MochiSocial.LOGGED_IN, function (args:Object):void{
_inventory = new MochiInventory();
});
addEventListener(MochiSocial.LOGGED_OUT, function (args:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 235
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(digit:Number=0, index:uint=0):void{
super();
Encoder = 0;
setValue(digit, index);
}
public function set value(v:Number):void{
setValue(v);
}
public function reencode():void{
var newEncode:uint;
newEncode = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (newEncode ^ Encoder));
Encoder = newEncode;
}
public function toString():String{
var s:String;
s = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
s = (s + Sibling.toString());
};
return (s);
}
public function get value():Number{
return (Number(this.toString()));
}
public function setValue(digit:Number=0, index:uint=0):void{
var s:String;
s = digit.toString();
var _temp1 = index;
index = (index + 1);
Fragment = (s.charCodeAt(_temp1) ^ Encoder);
if (index < s.length){
Sibling = new MochiDigits(digit, index);
} else {
Sibling = null;
};
reencode();
}
public function addValue(inc:Number):void{
value = (value + inc);
}
}
}//package mochi.as3
Section 236
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
super();
eventTable = {};
}
public function triggerEvent(event:String, args:Object):void{
var i:Object;
if (eventTable[event] == undefined){
return;
};
for (i in eventTable[event]) {
var _local6 = eventTable[event];
_local6[i](args);
};
}
public function removeEventListener(event:String, delegate:Function):void{
var s:Object;
if (eventTable[event] == undefined){
eventTable[event] = [];
return;
};
for (s in eventTable[event]) {
if (eventTable[event][s] != delegate){
} else {
eventTable[event].splice(Number(s), 1);
};
};
}
public function addEventListener(event:String, delegate:Function):void{
removeEventListener(event, delegate);
eventTable[event].push(delegate);
}
}
}//package mochi.as3
Section 237
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public function MochiEvents(){
super();
}
public static function endPlay():void{
MochiServices.send("events_clearRoundID", null, null, null);
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
public static function trackEvent(tag:String, value=null):void{
MochiServices.send("events_trackEvent", {tag:tag, value:value}, null, null);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function startSession(achievementID:String):void{
MochiServices.send("events_beginSession", {achievementID:achievementID}, null, null);
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function setNotifications(clip:MovieClip, style:Object):void{
var args:Object;
var s:Object;
args = {};
for (s in style) {
args[s] = style[s];
};
args.clip = clip;
MochiServices.send("events_setNotifications", args, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startPlay(tag:String="gameplay"):void{
MochiServices.send("events_setRoundID", {tag:String(tag)}, null, null);
}
}
}//package mochi.as3
Section 238
//MochiInventory (mochi.as3.MochiInventory)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
public dynamic class MochiInventory extends Proxy {
private var _timer:Timer;
private var _names:Array;
private var _consumableProperties:Object;
private var _syncID:Number;
private var _storeSync:Object;
private var _outstandingID:Number;
private var _syncPending:Boolean;
public static const READY:String = "InvReady";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
private static const KEY_SALT:String = " syncMaint";
public static const WRITTEN:String = "InvWritten";
public static const NOT_READY:String = "InvNotReady";
public static const VALUE_ERROR:String = "InvValueError";
private static const CONSUMER_KEY:String = "MochiConsumables";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
super();
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut);
_storeSync = new Object();
_syncPending = false;
_outstandingID = 0;
_syncID = 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
loggedOut();
};
}
private function newItems(event:Object):void{
if (!this[(event.id + KEY_SALT)]){
this[(event.id + KEY_SALT)] = 0;
};
if (!this[event.id]){
this[event.id] = 0;
};
this[(event.id + KEY_SALT)] = (this[(event.id + KEY_SALT)] + event.count);
this[event.id] = (this[event.id] + event.count);
if (((event.privateProperties) && (event.privateProperties.consumable))){
if (!this[event.privateProperties.tag]){
this[event.privateProperties.tag] = 0;
};
this[event.privateProperties.tag] = (this[event.privateProperties.tag] + (event.privateProperties.inc * event.count));
};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(name){
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if (_consumableProperties[name]){
return (MochiDigits(_consumableProperties[name]).value);
};
return (undefined);
}
public function release():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(name):Boolean{
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if (_consumableProperties[name] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(index:int):int{
return (((index)>=_names.length) ? 0 : (index + 1));
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(name, value):void{
var d:MochiDigits;
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!(value is Number)){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:value});
return;
};
if (_consumableProperties[name]){
d = MochiDigits(_consumableProperties[name]);
if (d.value == value){
return;
};
d.value = value;
} else {
_names.push(name);
_consumableProperties[name] = new MochiDigits(value);
};
_syncID++;
}
private function sync(e:Event=null):void{
var output:Object;
var key:String;
if (((_syncPending) || ((_syncID == _outstandingID)))){
return;
};
_outstandingID = _syncID;
output = {};
for (key in _consumableProperties) {
output[key] = MochiDigits(_consumableProperties[key]).value;
};
MochiUserData.put(CONSUMER_KEY, output, putConsumableBag);
_syncPending = true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(index:int):String{
return (_names[(index - 1)]);
}
private function loggedIn(args:Object=null):void{
MochiUserData.get(CONSUMER_KEY, getConsumableBag);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(name):Boolean{
if (!_consumableProperties[name]){
return (false);
};
_names.splice(_names.indexOf(name), 1);
delete _consumableProperties[name];
return (true);
}
private function itemOwned(event:Object):void{
_storeSync[event.id] = {properties:event.properties, count:event.count};
}
private function putConsumableBag(userData:MochiUserData):void{
_syncPending = false;
if (userData.error){
triggerEvent(ERROR, {type:IO_ERROR, error:userData.error});
_outstandingID = -1;
};
triggerEvent(WRITTEN, {});
}
private function getConsumableBag(userData:MochiUserData):void{
var key:String;
var unsynced:Number;
if (userData.error){
triggerEvent(ERROR, {type:IO_ERROR, error:userData.error});
return;
};
_consumableProperties = {};
_names = new Array();
if (userData.data){
for (key in userData.data) {
_names.push(key);
_consumableProperties[key] = new MochiDigits(userData.data[key]);
};
};
for (key in _storeSync) {
unsynced = _storeSync[key].count;
if (_consumableProperties[(key + KEY_SALT)]){
unsynced = (unsynced - _consumableProperties[(key + KEY_SALT)].value);
};
if (unsynced == 0){
} else {
newItems({id:key, count:unsynced, properties:_storeSync[key].properties});
};
};
triggerEvent(READY, {});
}
private function loggedOut(args:Object=null):void{
_consumableProperties = null;
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
}
}//package mochi.as3
Section 239
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
public class MochiServices {
public static const CONNECTED:String = "onConnected";
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _queue:Array;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
private static var _nextCallbackID:Number;
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var _callbacks:Object;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public function MochiServices(){
super();
}
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(pkg:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var methodName:String;
var obj:Object;
var pkg = pkg;
cb = pkg.callbackID;
cblst = _callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
methodName = "";
obj = 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){
method.apply(obj, pkg.args);
//unresolved jump
var _slot1 = error;
trace(((("Error invoking callback method '" + methodName) + "': ") + _slot1.toString()));
} else {
if (obj != null){
obj(pkg.args);
//unresolved jump
var _slot1 = error;
trace(("Error invoking method on object: " + _slot1.toString()));
};
};
delete _callbacks[cb];
}
public static function send(methodName:String, args:Object=null, callbackObject:Object=null, callbackMethod:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_nextCallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + methodName));
handleError(args, callbackObject, callbackMethod);
flush(true);
return;
};
_queue.push({methodName:methodName, args:args, callbackID:_nextCallbackID});
};
if (_clip != null){
if (_callbacks != null){
_callbacks[_nextCallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_nextCallbackID++;
};
};
}
private static function init(id:String, clip:Object):void{
_id = id;
if (clip != null){
_container = clip;
loadCommunicator(id, _container);
};
}
private static function clickMovie(url:String, cb:Function):MovieClip{
var avm1_bytecode:Array;
var b:int;
var header:Array;
var footer:Array;
var mc:MovieClip;
var lc:LocalConnection;
var lc_name:String;
var ba:ByteArray;
var cpool:ByteArray;
var actionLength:uint;
var fileLength:uint;
var loader:Loader;
avm1_bytecode = [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];
header = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
footer = [0, 64, 0, 0, 0];
mc = new MovieClip();
lc = new LocalConnection();
lc_name = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
lc = new LocalConnection();
mc.lc = lc;
mc.click = cb;
lc.client = mc;
lc.connect(lc_name);
ba = new ByteArray();
cpool = new ByteArray();
cpool.endian = Endian.LITTLE_ENDIAN;
cpool.writeShort(1);
cpool.writeUTFBytes(((url + " ") + lc_name));
cpool.writeByte(0);
actionLength = ((avm1_bytecode.length + cpool.length) + 4);
fileLength = (actionLength + 35);
ba.endian = Endian.LITTLE_ENDIAN;
ba.writeUTFBytes("FWS");
ba.writeByte(8);
ba.writeUnsignedInt(fileLength);
for each (b in header) {
ba.writeByte(b);
};
ba.writeUnsignedInt(actionLength);
ba.writeByte(136);
ba.writeShort(cpool.length);
ba.writeBytes(cpool);
for each (b in avm1_bytecode) {
ba.writeByte(b);
};
for each (b in footer) {
ba.writeByte(b);
};
loader = new Loader();
loader.loadBytes(ba);
mc.addChild(loader);
return (mc);
}
private static function detach(event:Event):void{
var loader:LoaderInfo;
loader = LoaderInfo(event.target);
loader.removeEventListener(Event.COMPLETE, detach);
loader.removeEventListener(IOErrorEvent.IO_ERROR, detach);
loader.removeEventListener(Event.COMPLETE, loadLCBridgeComplete);
loader.removeEventListener(IOErrorEvent.IO_ERROR, loadError);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
private static function loadLCBridgeComplete(e:Event):void{
var loader:Loader;
loader = LoaderInfo(e.target).loader;
_mochiLocalConnection = MovieClip(loader.content);
listen();
}
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);
_mochiLocalConnection.close();
//unresolved jump
var _slot1 = error;
};
if (_timer != null){
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, connectWait);
_timer = null;
//unresolved jump
var _slot1 = error;
};
}
public static function allowDomains(server:String):String{
var hostname:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (server.indexOf("http://") != -1){
hostname = server.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(hostname);
Security.allowInsecureDomain(hostname);
};
};
return (hostname);
}
public static function getVersion():String{
return ("3.9.2 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
public static function warnID(bid:String, leaderboard:Boolean):void{
var i:Number;
bid = bid.toLowerCase();
if (bid.length != 16){
trace((("WARNING: " + (leaderboard) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (bid == "1e113c7239048b3f"){
if (leaderboard){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (bid == "84993a1de4031cd8"){
if (leaderboard){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
i = 0;
while (i < bid.length) {
switch (bid.charAt(i)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + bid));
return;
};
i++;
};
}
private static function flush(error:Boolean):void{
var request:Object;
var callback:Object;
if (((_clip) && (_queue))){
while (_queue.length > 0) {
request = _queue.shift();
callback = null;
if (request != null){
if (request.callbackID != null){
callback = _callbacks[request.callbackID];
};
delete _callbacks[request.callbackID];
if (((error) && (!((callback == null))))){
handleError(request.args, callback.callbackObject, callback.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(pkg:Object):void{
var target:String;
var event:String;
target = pkg.target;
event = pkg.event;
switch (target){
case "services":
MochiServices.triggerEvent(pkg.event, pkg.args);
break;
case "events":
MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case "coins":
MochiCoins.triggerEvent(pkg.event, pkg.args);
break;
case "social":
MochiSocial.triggerEvent(pkg.event, pkg.args);
break;
};
}
private static function urlOptions(clip:Object):Object{
var opts:Object;
var options:String;
var pairs:Array;
var i:Number;
var kv:Array;
opts = {};
if (clip.stage){
options = clip.stage.loaderInfo.parameters.mochiad_options;
} else {
options = clip.loaderInfo.parameters.mochiad_options;
};
if (options){
pairs = options.split("&");
i = 0;
while (i < pairs.length) {
kv = pairs[i].split("=");
opts[unescape(kv[0])] = unescape(kv[1]);
i++;
};
};
return (opts);
}
public static function addLinkEvent(url:String, burl:String, btn:DisplayObjectContainer, onClick:Function=null):void{
var vars:Object;
var avm1Click:DisplayObject;
var s:String;
var i:Number;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = url;
var burl = burl;
var btn = btn;
var onClick = onClick;
vars = 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 = "?";
i = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://link.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (url:String):void{
var rect:Rectangle;
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(url, onClick);
rect = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = rect.x;
avm1Click.y = rect.y;
avm1Click.scaleX = (0.01 * rect.width);
avm1Click.scaleY = (0.01 * rect.height);
};
err = function (ev:Object):void{
netup = false;
ev.target.removeEventListener(ev.type, arguments.callee);
setURL(burl);
};
complete = function (ev:Object):void{
ev.target.removeEventListener(ev.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function setContainer(container:Object=null, doAdd:Boolean=true):void{
if (_clip.parent){
_clip.parent.removeChild(_clip);
};
if (container != null){
if ((container is DisplayObjectContainer)){
_container = container;
};
};
if (doAdd){
if ((_container is DisplayObjectContainer)){
DisplayObjectContainer(_container).addChild(_clip);
};
};
}
private static function handleError(args:Object, callbackObject:Object, callbackMethod:Object):void{
var args = args;
var callbackObject = callbackObject;
var callbackMethod = callbackMethod;
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)))){
var _local5 = callbackObject;
_local5[callbackMethod](args);
//unresolved jump
var _slot1 = error;
} else {
if (callbackMethod != null){
callbackMethod.apply(args);
//unresolved jump
var _slot1 = error;
};
};
};
}
private static function loadError(ev:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
public static function get childClip():Object{
return (_clip);
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _queue.shift());
};
};
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (args:Object):void{
MochiServices.comChannelName = args.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
private static function loadLCBridge(clip:Object):void{
var loader:Loader;
var mochiLCURL:String;
var req:URLRequest;
loader = new Loader();
mochiLCURL = (_servURL + _mochiLC);
req = new URLRequest(mochiLCURL);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, detach);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadLCBridgeComplete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
public static function set comChannelName(val:String):void{
if (val != null){
if (val.length > 3){
_sendChannelName = (val + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(id:String, clip:Object):MovieClip{
var servicesURL:String;
var req:URLRequest;
var vars:URLVariables;
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(clip).servURL){
_servURL = urlOptions(clip).servURL;
};
servicesURL = (_servURL + _services);
if (urlOptions(clip).servicesURL){
servicesURL = urlOptions(clip).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(servicesURL);
_clip = new MovieClip();
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, detach);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
req = new URLRequest(servicesURL);
vars = new URLVariables();
vars.listenLC = _listenChannelName;
vars.mochiad_options = clip.loaderInfo.parameters.mochiad_options;
vars.api_version = getVersion();
if (widget){
vars.widget = true;
};
req.data = vars;
_loader.load(req);
_clip.addChild(_loader);
_sendChannel = new LocalConnection();
_queue = [];
_nextCallbackID = 0;
_callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function get clip():Object{
return (_container);
}
public static function connect(id:String, clip:Object, onError:Object=null):void{
var id = id;
var clip = clip;
var onError = onError;
warnID(id, false);
if ((clip is DisplayObject)){
if (clip.stage == null){
trace("MochiServices connect requires the containing clip be attached to the stage");
};
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 (errorCode:String):void{
trace(errorCode);
};
};
};
}
public static function bringToTop(e:Event=null):void{
var e = e;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
//unresolved jump
var _slot1 = errorObject;
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
}
public static function connectWait(e:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
} else {
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, connectWait);
_timer = null;
};
}
}
}//package mochi.as3
Section 240
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const ACTION_CANCELED:String = "onCancel";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const IO_ERROR:String = "IOError";
public static const NO_USER:String = "NoUser";
public static const FRIEND_LIST:String = "FriendsList";
public static const PROFILE_DATA:String = "ProfileData";
public static const GAMEPLAY_DATA:String = "GameplayData";
public static const ACTION_COMPLETE:String = "onComplete";
public static const LOGIN_SHOW:String = "LoginShow";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const USER_INFO:String = "UserInfo";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const ERROR:String = "Error";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_HIDE:String = "LoginHide";
public static const LOGIN_SHOWN:String = "LoginShown";
public static var _user_info:Object = null;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiSocial(){
super();
}
public static function requestFan(properties:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestFan", properties);
}
public static function postToStream(properties:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_postToStream", properties);
}
public static function getFriendsList(properties:Object=null):void{
MochiServices.send("social_getFriendsList", properties);
}
public static function requestLogin(properties:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestLogin", properties);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function saveUserProperties(properties:Object):void{
MochiServices.send("social_saveUserProperties", properties);
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function inviteFriends(properties:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_inviteFriends", properties);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
public static function showLoginWidget(options:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_showLoginWidget", {options:options});
}
public static function getAPIURL():String{
if (!_user_info){
return (null);
};
return (_user_info.api_url);
}
public static function hideLoginWidget():void{
MochiServices.send("social_hideLoginWidget");
}
public static function getAPIToken():String{
if (!_user_info){
return (null);
};
return (_user_info.api_token);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (args:Object):void{
_user_info = args;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (args:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 241
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class MochiUserData extends EventDispatcher {
public var callback:Function;// = null
public var error:Event;// = null
public var key:String;// = null
public var operation:String;// = null
public var data;// = null
public var _loader:URLLoader;
public function MochiUserData(key:String="", callback:Function=null){
key = null;
data = null;
error = null;
operation = null;
callback = null;
super();
this.key = key;
this.callback = callback;
}
public function securityErrorHandler(event:SecurityErrorEvent):void{
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + event.toString())));
}
public function putEvent(obj):void{
request("put", serialize(obj));
}
public function request(_operation:String, _data:ByteArray):void{
var api_url:String;
var api_token:String;
var args:URLVariables;
var req:URLRequest;
var _operation = _operation;
var _data = _data;
operation = _operation;
api_url = MochiSocial.getAPIURL();
api_token = MochiSocial.getAPIToken();
if ((((api_url == null)) || ((api_token == null)))){
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in"));
return;
};
_loader = new URLLoader();
args = new URLVariables();
args.op = _operation;
args.key = key;
req = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString()));
req.method = URLRequestMethod.POST;
req.contentType = "application/x-mochi-userdata";
req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)];
req.data = _data;
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.load(req);
//unresolved jump
var _slot1 = e;
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _slot1.toString())));
}
public function completeHandler(event:Event):void{
var event = event;
if (_loader.data.length){
data = deserialize(_loader.data);
} else {
data = null;
};
//unresolved jump
var _slot1 = e;
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + _slot1.toString())));
return;
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function performCallback():void{
callback(this);
//unresolved jump
var _slot1 = e;
trace(("[MochiUserData] exception during callback: " + _slot1));
}
public function serialize(obj):ByteArray{
var arr:ByteArray;
arr = new ByteArray();
arr.objectEncoding = ObjectEncoding.AMF3;
arr.writeObject(obj);
arr.compress();
return (arr);
}
public function errorHandler(event:IOErrorEvent):void{
data = null;
error = event;
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function getEvent():void{
request("get", serialize(null));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public function close():void{
if (_loader){
_loader.removeEventListener(Event.COMPLETE, completeHandler);
_loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.close();
_loader = null;
};
error = null;
callback = null;
}
public function deserialize(arr:ByteArray){
arr.objectEncoding = ObjectEncoding.AMF3;
arr.uncompress();
return (arr.readObject());
}
public static function get(key:String, callback:Function):void{
var userData:MochiUserData;
userData = new MochiUserData(key, callback);
userData.getEvent();
}
public static function put(key:String, obj, callback:Function):void{
var userData:MochiUserData;
userData = new MochiUserData(key, callback);
userData.putEvent(obj);
}
}
}//package mochi.as3
Section 242
//HolyParticle (particles.HolyParticle)
package particles {
public class HolyParticle extends Particle {
public function HolyParticle(x:Number, y:Number){
addFrameScript(8, frame9);
super(x, y);
}
function frame9(){
kill();
}
}
}//package particles
Section 243
//LeafParticle (particles.LeafParticle)
package particles {
public class LeafParticle extends Particle {
public function LeafParticle(x:Number, y:Number){
addFrameScript(8, frame9);
super(x, y);
}
function frame9(){
kill();
}
}
}//package particles
Section 244
//OrangeParticle (particles.OrangeParticle)
package particles {
public class OrangeParticle extends Particle {
public function OrangeParticle(x:Number, y:Number){
addFrameScript(12, frame13);
super(x, y);
}
function frame13(){
kill();
}
}
}//package particles
Section 245
//Particle (particles.Particle)
package particles {
import flash.display.*;
public class Particle extends MovieClip {
public var yspeed:Number;
public var xspeed:Number;
public function Particle(x:Number, y:Number, r:Number=0){
super();
this.x = x;
this.y = y;
this.scaleX = (this.scaleX * (this.scaleY = (this.scaleY * ((Math.random() / 2) + 0.8))));
this.rotation = (Math.random() * 360);
}
public function kill(){
stop();
parent.removeChild(this);
}
}
}//package particles
Section 246
//SmashParticle (particles.SmashParticle)
package particles {
public class SmashParticle extends Particle {
public function SmashParticle(x:Number, y:Number){
addFrameScript(2, frame3);
super(x, y);
}
function frame3(){
kill();
}
}
}//package particles
Section 247
//YellowParticle (particles.YellowParticle)
package particles {
public class YellowParticle extends Particle {
public function YellowParticle(x:Number, y:Number){
addFrameScript(11, frame12);
super(x, y);
}
function frame12(){
if (this){
kill();
};
}
}
}//package particles
Section 248
//Anna (players.Anna)
package players {
import levels.*;
import shots.*;
public class Anna extends Player {
public var tree1:TreeShot;
public var tree2:TreeShot;
public var trees:Boolean;// = false
public var bxs:Number;// = 0
public var bys:Number;// = 0
public function Anna(){
bxs = 0;
bys = 0;
trees = false;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 49, frame50);
}
override public function statBonus(){
baseDamage = (baseDamage * 1.05);
}
function frame10(){
root.y = 50;
(root as Main).makeSound("hit", "p");
}
function frame16(){
root.y = 12;
}
function frame14(){
root.y = 20;
}
function frame15(){
root.y = -20;
}
function frame11(){
root.y = -50;
}
function frame5(){
root.y = -12;
}
function frame7(){
root.y = -6;
}
function frame19(){
root.y = -6;
}
function frame9(){
root.y = 0;
if (((this) && (!(dead)))){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame3(){
root.y = -20;
}
function frame4(){
root.y = 12;
}
function frame8(){
root.y = 3;
}
function frame2(){
root.y = 20;
(root as Main).makeSound("hit", "p");
}
function frame18(){
root.y = 6;
}
function frame21(){
root.y = 0;
}
override public function subAttack(){
if (trees){
tree1.dead = true;
tree2.dead = true;
trees = false;
} else {
if ((((subCharge > (maxCharge / 4))) && (!(trees)))){
(root as Main).makeSound("tree", "p");
tree1 = new TreeShot(x, y, false, this);
tree2 = new TreeShot(x, y, true, this);
parent.addChild(tree1);
parent.addChild(tree2);
subCharge = (subCharge - (maxCharge / 6));
trees = true;
};
};
}
function frame12(){
root.y = 40;
}
function frame6(){
root.y = 6;
}
function frame20(){
root.y = 3;
}
function frame13(){
root.y = -30;
}
function frame17(){
root.y = -12;
}
function frame50(){
stop();
end();
}
override public function shootStuff(){
if (trees){
subCharge = (subCharge - 0.7);
};
if (keyIsDown[leftKey]){
bxs = (bxs - 3);
} else {
if (keyIsDown[rightKey]){
bxs = (bxs + 3);
} else {
if (!((keyIsDown[mainKey]) || (keyIsDown[89]))){
bxs = 0;
};
};
};
bxs = (bxs * 0.7);
if (((((((((keyIsDown[mainKey]) || (keyIsDown[89]))) || (autoMain))) || (keyIsDown[1]))) && ((mainCharge > 5)))){
(root as Main).makeSound("arrow", "p");
parent.addChild(new ArrowShot((x + bxs), (y - 18), bxs, -28, bxs, (baseDamage * 3)));
if (buff > 0){
parent.addChild(new LeafShot(x, (y - 25), ((Math.random() * 20) - 10), -15, 0, (baseDamage * 3)));
};
mainCharge = (mainCharge - 5);
};
if (bombCondition()){
doBomb();
};
}
override public function loadStats(){
playerNo = 4;
baseDamage = (baseDamage * 1.05);
focusDot.gotoAndStop(2);
}
override public function doBomb(){
var bomb:PlayerBomb;
bombs--;
bomb = new AnnaBomb(x, y, (baseDamage * 3.8), (parent as Level));
parent.addChild(bomb);
parent.setChildIndex(bomb, 1);
(parent as Level).useBomb();
(parent as Level).theBomb = bomb;
}
}
}//package players
Section 249
//AnnaBomb (players.AnnaBomb)
package players {
public class AnnaBomb extends PlayerBomb {
public function AnnaBomb(x, y, damage, level){
addFrameScript(0, frame1, 129, frame130, 139, frame140, 149, frame150);
super(x, y, damage, level);
}
function frame1(){
(root as Main).makeSound("cross", "p");
}
override function special(){
this.x = level.player.x;
this.y = level.player.y;
}
function frame130(){
(root as Main).makeSound("cross2", "p");
}
function frame140(){
active = false;
}
function frame150(){
if (this){
kill();
};
}
}
}//package players
Section 250
//Lance (players.Lance)
package players {
import levels.*;
import shots.*;
public class Lance extends Player {
public var bxs:Number;// = 0
public var bys:Number;// = 0
public function Lance(){
bxs = 0;
bys = 0;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 48, frame49);
}
override public function statBonus(){
baseDamage = (baseDamage * 1.02);
subChargeSpeed = (subChargeSpeed * 1.1);
}
function frame10(){
root.y = 50;
(root as Main).makeSound("hit", "p");
}
function frame16(){
root.y = 12;
}
function frame14(){
root.y = 20;
}
function frame15(){
root.y = -20;
}
function frame11(){
root.y = -50;
(root as Main).makeSound("explode", "p");
}
function frame17(){
root.y = -12;
}
function frame18(){
root.y = 6;
}
function frame5(){
root.y = -12;
}
function frame7(){
root.y = -6;
}
function frame19(){
root.y = -6;
}
function frame9(){
root.y = 0;
if (((this) && (!(dead)))){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame3(){
root.y = -20;
}
function frame4(){
root.y = 12;
}
function frame8(){
root.y = 3;
}
function frame2(){
root.y = 20;
(root as Main).makeSound("hit", "p");
}
function frame21(){
root.y = 0;
}
override public function subAttack(){
bxs = 0;
bys = 0;
if (keyIsDown[leftKey]){
bxs = -20;
};
if (keyIsDown[rightKey]){
bxs = 20;
};
if (keyIsDown[upKey]){
bys = -20;
};
if (keyIsDown[downKey]){
bys = 20;
};
if (((((((!(keyIsDown[rightKey])) && (!(keyIsDown[leftKey])))) && (!(keyIsDown[downKey])))) && (!(keyIsDown[upKey])))){
bys = -20;
};
bys = -20;
bxs = 0;
if (subCharge == maxCharge){
(root as Main).makeSound("mine", "p");
shot = new BulletBomb(x, y, (bxs * 1.3), (bys * 1.3), baseDamage);
parent.addChild(shot);
parent.setChildIndex(shot, 2);
subCharge = (subCharge - (maxCharge / 4));
};
if (subCharge >= ((maxCharge * 3) / 4)){
(root as Main).makeSound("mine", "p");
shot = new BulletBomb(x, y, (bxs * 1.2), (bys * 1.2), baseDamage);
parent.addChild(shot);
parent.setChildIndex(shot, 2);
subCharge = (subCharge - (maxCharge / 4));
};
if (subCharge >= (maxCharge / 2)){
(root as Main).makeSound("mine", "p");
shot = new BulletBomb(x, y, (bxs * 1.1), (bys * 1.1), baseDamage);
parent.addChild(shot);
parent.setChildIndex(shot, 2);
subCharge = (subCharge - (maxCharge / 4));
};
if (subCharge >= (maxCharge / 4)){
(root as Main).makeSound("mine", "p");
shot = new BulletBomb(x, y, bxs, bys, baseDamage);
parent.addChild(shot);
parent.setChildIndex(shot, 2);
subCharge = (subCharge - (maxCharge / 4));
};
}
function frame6(){
root.y = 6;
}
function frame12(){
root.y = 40;
}
function frame49(){
stop();
end();
}
function frame20(){
root.y = 3;
}
function frame13(){
root.y = -30;
}
override public function shootStuff(){
while (((((((((keyIsDown[mainKey]) || (keyIsDown[89]))) || (autoMain))) || (keyIsDown[1]))) && ((mainCharge > 7)))) {
(root as Main).makeSound("bullet", "p");
parent.addChild(new BulletShot((x + 17), (y - 18), 0, -25, 0, (baseDamage * 2)));
parent.addChild(new BulletShot((x - 16), (y - 18), 0, -25, 0, (baseDamage * 2)));
mainCharge = (mainCharge - 7);
if (buff > 0){
parent.addChild(new BulletShot((x - 16), (y - 18), -13, -22, -33, (baseDamage * 2)));
parent.addChild(new BulletShot((x + 17), (y - 18), 13, -22, 33, (baseDamage * 2)));
};
};
if (bombCondition()){
doBomb();
};
}
override public function loadStats(){
playerNo = 3;
baseDamage = (baseDamage * 1.02);
subChargeSpeed = (subChargeSpeed * 1.1);
}
override public function doBomb(){
var bomb:PlayerBomb;
bombs--;
bomb = new LanceBomb(x, y, (baseDamage * 4), (parent as Level));
parent.addChild(bomb);
parent.setChildIndex(bomb, 1);
(parent as Level).useBomb();
(parent as Level).theBomb = bomb;
}
}
}//package players
Section 251
//LanceBomb (players.LanceBomb)
package players {
public class LanceBomb extends PlayerBomb {
public function LanceBomb(x, y, damage, level){
addFrameScript(0, frame1, 12, frame13, 14, frame15, 21, frame22, 25, frame26, 135, frame136);
super(x, y, damage, level);
}
function frame15(){
damage = (damage * 3);
}
function frame1(){
stop();
}
function frame13(){
(root as Main).makeSound("lance", "p");
}
function frame22(){
damage = (damage / 3);
}
function frame26(){
(root as Main).makeSound("lance2", "p");
}
override function special(){
this.x = level.player.x;
this.y = level.player.y;
}
function frame136(){
if (this){
kill();
};
}
}
}//package players
Section 252
//Matt (players.Matt)
package players {
import levels.*;
import shots.*;
public class Matt extends Player {
public var bxs:Number;// = 0
public var bys:Number;// = 0
public function Matt(){
bxs = 0;
bys = 0;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 53, frame54);
}
override public function statBonus(){
baseDamage = (baseDamage * 1.1);
}
function frame10(){
root.y = 50;
(root as Main).makeSound("hit", "p");
}
function frame16(){
root.y = 12;
}
function frame14(){
root.y = 20;
}
function frame15(){
root.y = -20;
}
function frame11(){
root.y = -50;
}
function frame17(){
root.y = -12;
}
function frame18(){
root.y = 6;
}
function frame5(){
root.y = -12;
}
function frame7(){
root.y = -6;
}
function frame19(){
root.y = -6;
}
function frame9(){
root.y = 0;
if (((this) && (!(dead)))){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame3(){
root.y = -20;
}
function frame4(){
root.y = 12;
}
function frame8(){
root.y = 3;
}
function frame2(){
root.y = 20;
(root as Main).makeSound("hit", "p");
}
function frame21(){
root.y = 0;
}
override public function subAttack(){
bxs = (bys = 0);
if (keyIsDown[leftKey]){
bxs = -20;
};
if (keyIsDown[rightKey]){
bxs = 20;
};
if (keyIsDown[upKey]){
bys = -20;
};
if (keyIsDown[downKey]){
bys = 20;
};
if (subCharge > (maxCharge / 4)){
(root as Main).makeSound("sword2", "p");
shot = new HugeSwordShot(x, y, 0, -20, (baseDamage * 2.4), 90, this, true);
parent.addChild(shot);
parent.setChildIndex(shot, 1);
subCharge = (subCharge - (maxCharge / 4));
};
}
function frame6(){
root.y = 6;
}
function frame12(){
root.y = 40;
}
function frame20(){
root.y = 3;
}
function frame13(){
root.y = -30;
}
function frame54(){
stop();
end();
}
override public function shootStuff(){
if (((((((((keyIsDown[mainKey]) || (keyIsDown[89]))) || (autoMain))) || (keyIsDown[1]))) && ((mainCharge > 8)))){
mainCharge = (mainCharge - 8);
if (buff > 0){
parent.addChild(new SwordShot((x + 10), (y - 18), 0, -25, 0, (baseDamage * 5)));
parent.addChild(new SwordShot((x - 10), (y - 18), 0, -25, 0, (baseDamage * 5)));
} else {
parent.addChild(new SwordShot(x, (y - 18), 0, -20, 0, (baseDamage * 5)));
};
(root as Main).makeSound("sword", "p");
if (mainCharge > 50){
parent.addChild(new SwordShot(x, (y - 18), (0 + 2), -18, 0, (baseDamage * 5)));
parent.addChild(new SwordShot(x, (y - 18), (0 - 2), -18, 0, (baseDamage * 5)));
parent.addChild(new SwordShot(x, (y - 18), (0 + 4), -16, 0, (baseDamage * 5)));
parent.addChild(new SwordShot(x, (y - 18), (0 - 4), -16, 0, (baseDamage * 5)));
parent.addChild(new SwordShot(x, (y - 18), (0 + 6), -14, 0, (baseDamage * 5)));
parent.addChild(new SwordShot(x, (y - 18), (0 - 6), -14, 0, (baseDamage * 5)));
mainCharge = (mainCharge - 16);
};
};
if (bombCondition()){
doBomb();
};
}
override public function loadStats(){
playerNo = 1;
speed = (speed * 0.95);
baseDamage = (baseDamage * 1.1);
focusDot.gotoAndStop(2);
bombs++;
}
override public function doBomb(){
var bomb:PlayerBomb;
bombs--;
bomb = new MattBomb(x, y, (baseDamage * 60), (parent as Level));
parent.addChild(bomb);
parent.setChildIndex(bomb, 1);
(parent as Level).useBomb();
(parent as Level).theBomb = bomb;
}
}
}//package players
Section 253
//MattBomb (players.MattBomb)
package players {
public class MattBomb extends PlayerBomb {
public function MattBomb(x, y, damage, level){
addFrameScript(3, frame4, 4, frame5, 5, frame6, 9, frame10, 54, frame55);
super(x, y, damage, level);
this.x = 0;
this.y = 0;
active = false;
blower = false;
}
function frame10(){
active = false;
}
function frame6(){
(root as Main).makeSound("rag2", "p");
}
function frame5(){
(root as Main).makeSound("rag", "p");
}
function frame4(){
active = true;
}
function frame55(){
if (this){
kill();
};
}
}
}//package players
Section 254
//Natalie (players.Natalie)
package players {
import levels.*;
import shots.*;
public class Natalie extends Player {
public var ball:HolyBallShot;
public var ball1:HolyBallShot;
public var ball2:HolyBallShot;
public var ball3:HolyBallShot;
public var bxs:Number;// = 0
public var holy:Boolean;// = false
public var bys:Number;// = 0
public var shieldCharge:int;// = 0
public function Natalie(){
bxs = 0;
bys = 0;
holy = false;
shieldCharge = 0;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 39, frame40);
}
override public function statBonus(){
baseDamage = (baseDamage * 1);
subChargeSpeed = (subChargeSpeed * 1);
}
function frame10(){
root.y = 50;
(root as Main).makeSound("hit", "p");
}
function frame16(){
root.y = 12;
}
function frame14(){
root.y = 20;
}
function frame15(){
root.y = -20;
}
function frame11(){
root.y = -50;
}
function frame17(){
root.y = -12;
}
function frame18(){
root.y = 6;
}
function frame5(){
root.y = -12;
}
function frame7(){
root.y = -6;
}
function frame19(){
root.y = -6;
}
function frame9(){
root.y = 0;
if (((this) && (!(dead)))){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame3(){
root.y = -20;
}
function frame4(){
root.y = 12;
}
function frame8(){
root.y = 3;
}
function frame2(){
root.y = 20;
(root as Main).makeSound("hit", "p");
}
function frame21(){
root.y = 0;
}
override public function subAttack(){
if (holy){
holy = false;
ball1.dead = true;
ball2.dead = true;
ball3.dead = true;
} else {
if ((((subCharge > (maxCharge / 4))) && (!(holy)))){
(root as Main).makeSound("holy", "p");
ball1 = new HolyBallShot(x, y, 0, 0, this, 0);
parent.addChild(ball1);
ball2 = new HolyBallShot(x, y, 0, 0, this, 1);
parent.addChild(ball2);
ball3 = new HolyBallShot(x, y, 0, 0, this, 2);
parent.addChild(ball3);
subCharge = (subCharge - (maxCharge / 8));
holy = true;
};
};
}
function frame6(){
root.y = 6;
}
function frame12(){
root.y = 40;
}
function frame40(){
stop();
end();
}
function frame20(){
root.y = 3;
}
function frame13(){
root.y = -30;
}
override public function shootStuff(){
var a:int;
if (holy){
subCharge = (subCharge - 1.4);
};
if (subCharge < 5){
holy = false;
};
if (keyIsDown[leftKey]){
bxs = (bxs - 2);
} else {
if (keyIsDown[rightKey]){
bxs = (bxs + 2);
} else {
if (!((keyIsDown[mainKey]) || (keyIsDown[89]))){
bxs = 0;
};
};
};
bxs = (bxs * 0.7);
if (((((((((keyIsDown[mainKey]) || (keyIsDown[89]))) || (autoMain))) || (keyIsDown[1]))) && ((mainCharge > 6)))){
(root as Main).makeSound("flame", "p");
if (buff > 0){
parent.addChild(new FlameShot((x + bxs), (y - 18), (bxs + 1), -12, (bxs + 1), (baseDamage * 4)));
parent.addChild(new FlameShot((x + bxs), (y - 18), (bxs - 1), -12, (bxs - 1), (baseDamage * 4)));
if (mainCharge > 70){
a = 0;
while (a < 16) {
parent.addChild(new FlameShot((x + bxs), (y - 18), ((bxs + (Math.random() * 10)) - 5), (-8 - (Math.random() * 10)), bxs, (baseDamage * 4)));
a++;
};
mainCharge = (mainCharge - 12);
};
} else {
parent.addChild(new FlameShot((x + bxs), (y - 18), bxs, -12, bxs, (baseDamage * 4)));
if (mainCharge > 70){
a = 0;
while (a < 8) {
parent.addChild(new FlameShot((x + bxs), (y - 18), ((bxs + (Math.random() * 10)) - 5), (-8 - (Math.random() * 10)), bxs, (baseDamage * 4)));
a++;
};
mainCharge = (mainCharge - 14);
};
};
t++;
mainCharge = (mainCharge - 6);
};
if (bombCondition()){
doBomb();
};
}
override public function loadStats(){
playerNo = 2;
speed = (speed * 0.9);
baseDamage = (baseDamage * 1);
subChargeSpeed = (subChargeSpeed * 1);
}
override public function doBomb(){
var bomb:PlayerBomb;
bombs--;
bomb = new NatalieBomb(x, y, (baseDamage * 8), (parent as Level));
parent.addChild(bomb);
(parent as Level).useBomb();
(parent as Level).theBomb = bomb;
}
}
}//package players
Section 255
//NatalieBomb (players.NatalieBomb)
package players {
public class NatalieBomb extends PlayerBomb {
public function NatalieBomb(x, y, damage, level){
addFrameScript(0, frame1, 24, frame25, 80, frame81);
super(x, y, damage, level);
this.x = 0;
this.y = 0;
blower = false;
}
function frame81(){
if (this){
kill();
};
}
function frame1(){
(root as Main).makeSound("cross", "p");
}
function frame25(){
(root as Main).makeSound("nuke", "p");
active = true;
}
}
}//package players
Section 256
//NoLegs (players.NoLegs)
package players {
import levels.*;
import shots.*;
public class NoLegs extends Player {
public function NoLegs(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 37, frame38);
}
override public function statBonus(){
subChargeSpeed = (subChargeSpeed * 0.8);
}
function frame10(){
root.y = 50;
(root as Main).makeSound("hit", "p");
}
function frame16(){
root.y = 12;
}
function frame14(){
root.y = 20;
}
function frame15(){
root.y = -20;
}
function frame11(){
root.y = -50;
(root as Main).makeSound("meow2", "p");
}
function frame17(){
root.y = -12;
}
function frame18(){
root.y = 6;
}
function frame5(){
root.y = -12;
}
function frame7(){
root.y = -6;
}
function frame19(){
root.y = -6;
}
function frame9(){
root.y = 0;
if (((this) && (!(dead)))){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame3(){
root.y = -20;
(root as Main).makeSound("meow", "p");
}
function frame4(){
root.y = 12;
}
function frame8(){
root.y = 3;
}
function frame2(){
root.y = 20;
(root as Main).makeSound("hit", "p");
}
function frame38(){
stop();
end();
}
function frame21(){
root.y = 0;
}
override public function subAttack(){
if (subCharge == maxCharge){
(root as Main).makeSound("star3", "p");
shot = new SuperBigStarShot(x, y, (13 * spread), 0, (baseDamage * 2), (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new SuperBigStarShot(x, y, (-13 * spread), 0, (baseDamage * 2), (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new SuperBigStarShot(x, y, (9 * spread), 0, (baseDamage * 2), (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new SuperBigStarShot(x, y, (-9 * spread), 0, (baseDamage * 2), (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new BigStarShot(x, y, (15 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new BigStarShot(x, y, (-15 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new BigStarShot(x, y, (7 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new BigStarShot(x, y, (-7 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
subCharge = (subCharge - maxCharge);
} else {
if (subCharge > ((maxCharge * 3) / 4)){
(root as Main).makeSound("star3", "p");
shot = new BigStarShot(x, y, (14 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new BigStarShot(x, y, (-14 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new SuperBigStarShot(x, y, (12 * spread), 0, (baseDamage * 2), (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new SuperBigStarShot(x, y, (-12 * spread), 0, (baseDamage * 2), (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new BigStarShot(x, y, (9 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new BigStarShot(x, y, (-9 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
subCharge = (subCharge - ((maxCharge * 3) / 4));
} else {
if (subCharge > (maxCharge / 2)){
(root as Main).makeSound("star2", "p");
shot = new BigStarShot(x, y, (13 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new BigStarShot(x, y, (-13 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new BigStarShot(x, y, (9 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new BigStarShot(x, y, (-9 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
subCharge = (subCharge - (maxCharge / 2));
} else {
if (subCharge > (maxCharge / 4)){
(root as Main).makeSound("star2", "p");
shot = new BigStarShot(x, y, (12 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new BigStarShot(x, y, (-12 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
subCharge = (subCharge - (maxCharge / 4));
};
};
};
};
}
function frame6(){
root.y = 6;
}
function frame12(){
root.y = 40;
}
function frame20(){
root.y = 3;
}
function frame13(){
root.y = -30;
}
override public function shootStuff(){
while (((((((((keyIsDown[mainKey]) || (keyIsDown[89]))) || (autoMain))) || (keyIsDown[1]))) && ((mainCharge > 5)))) {
(root as Main).makeSound("star", "p");
parent.addChild(new StarShot(x, (y - 10), (((Math.random() * 4) - 2) * spread), (-7 - (Math.random() * 6)), (baseDamage * 3)));
mainCharge = (mainCharge - 5);
if (buff > 0){
parent.addChild(new StarShot(x, (y - 10), ((((Math.random() * 4) - 2) * spread) * 2), (-7 - (Math.random() * 6)), (baseDamage * 3)));
};
};
if (bombCondition()){
doBomb();
};
}
override public function loadStats(){
playerNo = 0;
subChargeSpeed = (subChargeSpeed * 0.8);
}
override public function doBomb(){
var bomb:PlayerBomb;
bombs--;
bomb = new NoLegsBomb(x, y, (baseDamage * 1.5), (parent as Level));
parent.addChild(bomb);
parent.setChildIndex(bomb, 1);
(parent as Level).useBomb();
(parent as Level).theBomb = bomb;
}
}
}//package players
Section 257
//NoLegsBomb (players.NoLegsBomb)
package players {
import shots.*;
public class NoLegsBomb extends PlayerBomb {
public function NoLegsBomb(x, y, damage, level){
addFrameScript(0, frame1, 1, frame2, 8, frame9, 26, frame27);
super(x, y, damage, level);
}
function pew(){
parent.addChild(new SuperBigStarShot(x, y, (12 * 2), -6, (damage * 2), damage));
parent.addChild(new SuperBigStarShot(x, y, (-12 * 2), -6, (damage * 2), damage));
}
function frame1(){
(root as Main).makeSound("starbomb", "p");
}
override public function kill(){
this.stop();
active = false;
if (this){
parent.removeChild(this);
};
}
function frame9(){
if (this){
nextStar();
};
}
function frame2(){
pew();
}
function frame27(){
if (this){
kill();
};
}
function nextStar(){
parent.addChild(new StarBomb(damage, 2, level));
}
}
}//package players
Section 258
//Player (players.Player)
package players {
import flash.display.*;
import levels.*;
import foes.*;
import bullets.*;
import shots.*;
public class Player extends MovieClip {
public var autoMain:Boolean;// = false
public var bombs:int;// = 0
public var recoveryRate:Number;
var aa:int;// = 0
public var keyIsDown:Array;
public var speed:Number;// = 10
public var blue:MovieClip;
public var buff:int;// = 0
var sq:Number;
public var focusKey:Number;// = 16
public var autoFocus:Boolean;// = false
public var damageUp:Number;
public var dead:Boolean;// = false
public var t:int;// = 0
public var bombKey:Number;// = 67
public var downKey:Number;// = 40
public var superArmor:Number;// = 90
public var playerNo:int;// = -1
var dx:Number;
public var rightKey:Number;// = 39
var dy:Number;
public var mainChargeSpeed:Number;// = 3.3
public var bounced:int;// = 0
public var leftKey:Number;// = 37
public var shot:Shot;
public var HP:Number;// = 3
public var subCharge:Number;// = 0
public var subLevel:Number;
public var shieldOn:int;// = 0
public var autoFocusKey:Number;// = 81
public var maxCharge;// = 100
public var bulletUp:Number;
public var autoMainKey:Number;// = 65
public var maxSpeed:Number;// = 10
var kc:int;// = 0
public var focusDot:MovieClip;
public var magnet:Number;// = 0
public var shield:MovieClip;
public var maxHP:Number;// = 3
public var spread:Number;// = 1
public var level:int;// = 0
public var baseDamage:Number;// = 3
public var subChargeSpeed:Number;// = 0.9
public var mainCharge:Number;// = 0
public var upKey:Number;// = 38
public var mainKey:Number;// = 90
public var grabRadius:Number;
public var subKey:Number;// = 88
public static var magnetLevel:int = 0;
public static var bombLevel:int = 0;
public static var speedTree:Array = [[9, 0], [10, 100], [11, 500], [12, 2000]];
public static var mainDamageTree:Array = [[1, 0], [1.3, 50], [1.6, 150], [2, 300], [2.4, 700], [2.8, 1500], [3.2, 3000], [3.6, 6000], [4, 12000]];
public static var healthLevel:int = 0;
public static var mainChargeTree:Array = [[0.7, 0], [1, 30], [1.3, 100], [1.7, 200], [2.1, 500], [2.5, 1200], [3, 3000], [3.6, 6000]];
public static var subChargeTree:Array = [[0.13, 0], [0.2, 30], [0.26, 70], [0.33, 150], [0.4, 400], [0.46, 1100], [0.52, 2200], [0.59, 4000], [0.65, 8000]];
public static var healthTree:Array = [[3, 0], [4, 40], [5, 160], [6, 400], [7, 1500], [8, 3500], [9, 10000]];
public static var mainDamageLevel:int = 0;
public static var subChargeLevel:int = 0;
public static var bombTree:Array = [[1, 0], [2, 800], [3, 6000]];
public static var magnetTree:Array = [[0, 0], [2, 30], [3, 80], [4, 150], [6, 300], [8, 600], [10, 1200], [12, 2000], [15, 4000]];
public static var mainChargeLevel:int = 0;
public static var speedLevel:int = 0;
public function Player(){
keyIsDown = [];
speed = 10;
magnet = 0;
maxSpeed = 10;
bounced = 0;
mainCharge = 0;
subCharge = 0;
mainChargeSpeed = (1.1 * 3);
subChargeSpeed = (0.3 * 3);
maxCharge = 100;
baseDamage = 3;
maxHP = 3;
HP = 3;
superArmor = 90;
autoMain = false;
autoFocus = false;
spread = 1;
mainKey = 90;
subKey = 88;
bombKey = 67;
focusKey = 16;
autoMainKey = 65;
autoFocusKey = 81;
upKey = 38;
leftKey = 37;
rightKey = 39;
downKey = 40;
dead = false;
bombs = 0;
shieldOn = 0;
buff = 0;
t = 0;
kc = 0;
playerNo = -1;
level = 0;
aa = 0;
super();
focusDot = new FocusDot();
addChild(focusDot);
focusDot.alpha = 0;
}
public function survivalStats(){
mainChargeSpeed = 1;
subChargeSpeed = 0.2;
baseDamage = 1;
magnet = 15;
speed = 12;
maxHP = 9;
HP = 9;
bombs = 3;
if (playerNo == 1){
bombs++;
};
if (playerNo == 2){
speed = (speed * 0.9);
};
if (playerNo == 1){
speed = (speed * 0.95);
};
statBonus();
}
public function keyDownGet(e:Number){
if (!keyIsDown[e]){
if (!(parent as Level).pause){
if (!(parent as Level).pause){
if (e == subKey){
subAttack();
};
if (e == -2){
subAttack();
};
if ((((e == autoFocusKey)) && (false))){
autoFocus = !(autoFocus);
};
if ((((e == autoMainKey)) && (false))){
autoMain = !(autoMain);
};
};
};
if ((((((e == 80)) || ((e == 27)))) || ((e == 17)))){
(parent as Level).pauseGame();
};
};
}
public function statBonus(){
}
public function setStatTrees(){
}
public function getShield(){
shieldOn = 240;
shield.visible = true;
Medals.stats.powerUps++;
}
public function setup(){
if ((parent is Level)){
keyIsDown = (parent as Level).keyIsDown;
x = ((parent as Level).xlimit / 2);
y = ((parent as Level).ylimit - 100);
};
shield = new Shield();
this.addChild(shield);
blue = new BlueGlow();
this.addChild(blue);
autoMain = Global.vars.options[7];
baseDamage = mainDamageTree[Player.mainDamageLevel][0];
mainChargeSpeed = mainChargeTree[Player.mainChargeLevel][0];
subChargeSpeed = subChargeTree[Player.subChargeLevel][0];
maxHP = healthTree[Player.healthLevel][0];
HP = maxHP;
magnet = magnetTree[Player.magnetLevel][0];
speed = speedTree[Player.speedLevel][0];
bombs = (bombLevel + 1);
loadStats();
}
public function getHeart(){
HP = (HP + 1);
if (HP > maxHP){
HP = maxHP;
};
}
public function bombCondition(){
return (((((((keyIsDown[bombKey]) || (keyIsDown[32]))) && (!((parent as Level).bomb)))) && ((bombs > 0))));
}
public function subAttack(){
}
public function getBuff(){
buff = 360;
blue.visible = true;
Medals.stats.powerUps++;
}
public function end(){
trace("DEAD!");
(parent as Level).endLevel();
}
public function shootStuff(){
}
public function levelUp(){
level++;
if (level == 10){
level = 9;
};
mainChargeSpeed = (1 + (3.5 / (10 - level)));
subChargeSpeed = (0.2 + (0.6 / (10 - level)));
baseDamage = (1 + (3.5 / (10 - level)));
trace(("LEVEL UP!!: " + level));
trace(((((("" + mainChargeSpeed) + " ") + subChargeSpeed) + " ") + baseDamage));
statBonus();
}
public function loadStats(){
}
public function shieldBounce(){
var i:int;
var bullet:Bullet;
var nb:HolyShot;
if (shieldOn != 0){
shieldOn--;
if (shieldOn < 60){
shield.visible = !(shield.visible);
};
i = 0;
while (i < Global.vars.bulletArray.length) {
bullet = Global.vars.bulletArray[i];
if (this.hitTestPoint(bullet.x, bullet.y, true)){
(root as Main).makeSound("shield2", "i");
nb = new HolyShot(bullet.x, bullet.y, ((-(bullet.xspeed) * 1.5) * ((Math.random() / 2) + 0.8)), ((-(bullet.yspeed) * 1.5) * ((Math.random() / 2) + 0.8)), (baseDamage * 2));
if ((((((nb.xspeed < 2)) && ((nb.xspeed > -2)))) && ((((nb.yspeed < 2)) && ((nb.yspeed > -2)))))){
nb.yspeed = -2.5;
};
parent.addChild(nb);
bullet.kill();
i--;
bounced++;
if (bounced == 100){
Medals.unlockMedal("Counter Attack");
};
};
i++;
};
} else {
shield.visible = false;
bounced = 0;
};
}
public function hit(){
if ((((((superArmor <= 0)) && (!((parent as Level).bomb)))) && (!(dead)))){
(parent as Level).addCombo(-10);
(parent as Level).addHit();
play();
HP = (HP - 1);
Medals.stats.damage++;
superArmor = 90;
if (HP == 0){
focusDot.alpha = 0;
mainCharge = 0;
subCharge = 0;
dead = true;
gotoAndPlay("die");
if (Global.vars.bullets >= 666){
Medals.unlockMedalNo(26);
};
if (((((parent as Level).foeList.length == 0)) || (((((parent as Level).foeList.length == 1)) && ((((parent as Level).foeList[0] as Foe).HP <= 0)))))){
Medals.unlockMedal("Stray Bullets");
};
};
};
}
public function move(){
if (!dead){
if ((((superArmor > 0)) || ((parent as Level).bomb))){
superArmor--;
alpha = (1 - alpha);
} else {
alpha = 1;
};
mainCharge = (mainCharge + mainChargeSpeed);
subCharge = (subCharge + subChargeSpeed);
spread = 1;
if (mainCharge > maxCharge){
mainCharge = maxCharge;
};
if (subCharge > maxCharge){
subCharge = maxCharge;
};
if (((((keyIsDown[focusKey]) && (!(Global.vars.options[8])))) || (((!(keyIsDown[focusKey])) && (Global.vars.options[8]))))){
speed = (speed * 0.5);
spread = 0.5;
};
if ((root as Main).mouse){
dx = (root.mouseX - this.x);
dy = (root.mouseY - this.y);
sq = Math.sqrt((Math.pow(dx, 2) + Math.pow(dy, 2)));
if (sq > speed){
x = (x + ((speed / sq) * dx));
y = (y + ((speed / sq) * dy));
} else {
x = (x + dx);
y = (y + dy);
};
keyIsDown[rightKey] = (keyIsDown[leftKey] = (keyIsDown[upKey] = (keyIsDown[downKey] = false)));
if ((((dx > (dy / 3))) && ((dx > 3)))){
keyIsDown[rightKey] = true;
};
if ((((dx < (dy / 3))) && ((dx < -3)))){
keyIsDown[leftKey] = true;
};
if ((((dy > (dx / 3))) && ((dy > 3)))){
keyIsDown[downKey] = true;
};
if ((((dy < (dx / 3))) && ((dy < -3)))){
keyIsDown[upKey] = true;
};
} else {
kc = 0;
if (keyIsDown[leftKey]){
kc++;
};
if (keyIsDown[upKey]){
kc++;
};
if (keyIsDown[rightKey]){
kc++;
};
if (keyIsDown[downKey]){
kc++;
};
if (kc > 1){
speed = (speed * 0.8);
};
if (keyIsDown[leftKey]){
x = (x - speed);
};
if (keyIsDown[upKey]){
y = (y - speed);
};
if (keyIsDown[rightKey]){
x = (x + speed);
};
if (keyIsDown[downKey]){
y = (y + speed);
};
if (kc > 1){
speed = (speed / 0.8);
};
};
if (((((keyIsDown[focusKey]) && (!(Global.vars.options[8])))) || (((!(keyIsDown[focusKey])) && (Global.vars.options[8]))))){
speed = (speed * 2);
focusDot.alpha = 1;
} else {
focusDot.alpha = 0;
};
shootStuff();
shieldBounce();
if (buff < 60){
blue.visible = !(blue.visible);
};
if (buff < 1){
blue.visible = false;
};
if (x > 500){
x = 500;
};
if (y > 598){
y = 598;
};
if (x < 2){
x = 2;
};
if (y < 2){
y = 2;
};
buff--;
};
}
public function doBomb(){
}
}
}//package players
Section 259
//PlayerBomb (players.PlayerBomb)
package players {
import flash.display.*;
import levels.*;
import foes.*;
import bullets.*;
public class PlayerBomb extends MovieClip {
public var active:Boolean;// = true
public var damage:Number;
public var level:Level;
public var blower:Boolean;// = true
public function PlayerBomb(x, y, damage, level){
active = true;
blower = true;
super();
this.x = x;
this.y = y;
this.damage = damage;
this.level = level;
stop();
Medals.unlockMedal("Boom");
}
public function kill(){
(parent as Level).bomb = false;
this.stop();
if (this){
parent.removeChild(this);
};
}
function special(){
}
public function onFrame(){
var bullet:Bullet;
var i:int;
var foes:Array;
var f:Foe;
special();
if (active){
i = 0;
while (i < Global.vars.bulletArray.length) {
bullet = Global.vars.bulletArray[i];
if (this.hitTestPoint(bullet.x, bullet.y, true)){
if (blower){
bullet.yspeed = (bullet.yspeed - 2);
if (bullet.yspeed == 0){
bullet.yspeed = -1;
};
} else {
bullet.kill();
i--;
};
};
i++;
};
foes = (parent as Level).foeList;
for each (f in foes) {
if (((((this.hitTestPoint(f.x, f.y, true)) && (!(f.dead)))) && (!((f.superArmor > 0))))){
f.hit(damage);
};
};
};
nextFrame();
}
}
}//package players
Section 260
//ArrowShot (shots.ArrowShot)
package shots {
import particles.*;
public class ArrowShot extends Shot {
public function ArrowShot(x:Number, y:Number, xspeed:Number, yspeed:Number, rotation:Number, damage:Number){
super(x, y, xspeed, yspeed, damage);
alpha = 0.5;
this.rotation = rotation;
}
override function death(){
parent.addChild(new SmashParticle(x, (y - 20)));
}
}
}//package shots
Section 261
//BigStarShot (shots.BigStarShot)
package shots {
import levels.*;
import particles.*;
public class BigStarShot extends Shot {
public function BigStarShot(x:Number, y:Number, xspeed:Number, yspeed:Number, damage:Number){
super(x, y, xspeed, yspeed, damage);
HP = (20 * damage);
}
override function death(){
parent.addChild(new YellowParticle(x, y));
parent.addChild(new YellowParticle(x, y));
parent.addChild(new YellowParticle(x, y));
parent.addChild(new YellowParticle(x, y));
parent.addChild(new YellowParticle(x, y));
}
override public function onFrame(){
if (xspeed > 0){
xspeed = (xspeed - 0.5);
} else {
if (xspeed < 0){
xspeed = (xspeed + 0.5);
} else {
yspeed = (yspeed - 1);
};
};
x = (x + xspeed);
y = (y + yspeed);
if ((((x > ((parent as Level).xlimit + 10))) || ((x < (0 - 10))))){
xspeed = (xspeed * -1);
x = (x + xspeed);
};
if ((((y > ((parent as Level).ylimit + 10))) || ((y < (0 - 10))))){
kill();
} else {
hitStuff();
};
}
}
}//package shots
Section 262
//BulletBomb (shots.BulletBomb)
package shots {
import particles.*;
public class BulletBomb extends Shot {
var bullet:Shot;
var decel:Number;// = 2
var alim2:Number;// = 0
var level:Number;
var direction:String;// = ""
var alim:Number;// = 360
var time:Number;// = 30
var angle:Number;// = 0
public function BulletBomb(x:Number, y:Number, xspeed:Number, yspeed:Number, damage:Number, level:Number=1){
decel = 2;
angle = 0;
alim = 360;
alim2 = 0;
direction = "";
time = 30;
super(x, y, xspeed, yspeed, (damage * 3));
this.level = level;
HP = 20;
if (((!((yspeed == 0))) || (!((xspeed == 0))))){
alim = 90;
};
if ((((yspeed > 0)) && ((xspeed == 0)))){
alim2 = (135 + 180);
};
if ((((yspeed < 0)) && ((xspeed == 0)))){
alim2 = (-45 + 180);
};
if ((((yspeed < 0)) && ((xspeed > 0)))){
alim2 = -270;
};
if ((((yspeed < 0)) && ((xspeed < 0)))){
alim2 = -180;
};
if ((((yspeed > 0)) && ((xspeed > 0)))){
alim2 = 0;
};
if ((((yspeed > 0)) && ((xspeed < 0)))){
alim2 = -90;
};
if ((((yspeed == 0)) && ((xspeed < 0)))){
alim2 = (180 + 45);
};
if ((((yspeed == 0)) && ((xspeed > 0)))){
alim2 = 45;
};
this.xspeed = (int(((Math.random() * 10) - 5)) * 2);
time = int((40 - (Math.random() * 20)));
}
override function death(){
var a:Number;
(root as Main).makeSound("mine2", "p");
a = 0;
while (a < 30) {
parent.addChild(new OrangeParticle(x, y));
angle = ((Math.random() * alim) + alim2);
angle = (angle * (Math.PI / 180));
parent.addChild(new BulletShot(x, y, (Math.sin(angle) * 8), (Math.cos(angle) * 8), ((((angle / Math.PI) * 180) * -1) + 180), ((damage / 3) * 2)));
a++;
};
}
override function special():Boolean{
time--;
if (xspeed > 0){
xspeed = (xspeed - decel);
};
if (xspeed < 0){
xspeed = (xspeed + decel);
};
if (yspeed > 0){
yspeed = (yspeed - decel);
};
if (yspeed < 0){
yspeed = (yspeed + decel);
};
if (time == 0){
die();
return (true);
};
return (false);
}
}
}//package shots
Section 263
//BulletShot (shots.BulletShot)
package shots {
import particles.*;
public class BulletShot extends Shot {
public function BulletShot(x:Number, y:Number, xspeed:Number, yspeed:Number, rotation:Number, damage:Number){
super(x, y, xspeed, yspeed, damage);
alpha = 0.4;
this.rotation = rotation;
}
override function death(){
parent.addChild(new OrangeParticle(x, y));
}
}
}//package shots
Section 264
//FlameShot (shots.FlameShot)
package shots {
import particles.*;
public class FlameShot extends Shot {
public function FlameShot(x:Number, y:Number, xspeed:Number, yspeed:Number, rotation:Number, damage:Number){
super(x, y, xspeed, yspeed, damage);
alpha = 0.6;
this.rotation = rotation;
}
override function death(){
parent.addChild(new OrangeParticle(x, y));
}
}
}//package shots
Section 265
//HolyBallShot (shots.HolyBallShot)
package shots {
import players.*;
public class HolyBallShot extends Shot {
var an:Number;// = 0
public var dead:Boolean;// = false
var p:Player;
var alim2:Number;// = 0
var delay:Number;// = 0
var direction:String;// = ""
var alim:Number;// = 360
var time:Number;// = 30
var angle:Number;// = 0
var accel:Number;// = 1
public function HolyBallShot(x:Number, y:Number, xspeed, yspeed, p:Player, side:int){
angle = 0;
alim = 360;
alim2 = 0;
direction = "";
time = 30;
dead = false;
accel = 1;
delay = 0;
an = 0;
addFrameScript(8, frame9, 13, frame14);
super(0, 0, 0, 0, (p.baseDamage * 1.4));
alpha = 0.7;
this.HP = Infinity;
this.p = p;
size = 2000;
this.scaleX = (this.scaleX * 0.7);
this.scaleY = (this.scaleY * 0.7);
an = (180 * side);
}
function frame14(){
kill();
}
function frame9(){
stop();
}
override function special():Boolean{
if ((((delay == 0)) && (!(dead)))){
delay = 5;
parent.addChild(new FlameShot(x, y, ((Math.random() * 6) - 3), (-8 - (Math.random() * 4)), 0, (p.baseDamage * 3)));
};
delay--;
an = (an + 0.2);
this.x = (p.x + (Math.cos(an) * 140));
this.y = (p.y + (Math.sin(an) * 200));
if ((((p.subCharge < 5)) || (dead))){
if (p.subCharge < 5){
(p as Natalie).holy = false;
};
dead = true;
play();
};
return (false);
}
}
}//package shots
Section 266
//HolyShot (shots.HolyShot)
package shots {
import particles.*;
public class HolyShot extends Shot {
public function HolyShot(x:Number, y:Number, xspeed:Number, yspeed:Number, damage:Number){
super(x, y, xspeed, yspeed, damage);
alpha = 0.6;
if ((((((((yspeed > -2)) && ((yspeed < 2)))) && ((xspeed > -2)))) && ((xspeed < 2)))){
yspeed = -2;
};
}
override function death(){
parent.addChild(new HolyParticle(x, y));
}
}
}//package shots
Section 267
//HugeSwordShot (shots.HugeSwordShot)
package shots {
import players.*;
import particles.*;
public class HugeSwordShot extends Shot {
var bullet:Shot;
var decel:Number;// = 2
var p:Player;
var level:Number;
var direction:String;// = ""
var time:Number;// = 30
var angle:Number;// = 0
public function HugeSwordShot(x:Number, y:Number, xspeed:Number, yspeed:Number, damage:Number, HP:Number, p:Player, b:Boolean=false){
decel = 2;
angle = 0;
direction = "";
time = 30;
addFrameScript(19, frame20);
super(x, y, xspeed, yspeed, damage);
alpha = 0.7;
this.HP = Infinity;
if ((((yspeed > 0)) && ((xspeed == 0)))){
rotation = 180;
if (b){
this.scaleX = (this.scaleX * 1.5);
this.scaleY = (this.scaleY * 1.5);
};
};
if ((((yspeed < 0)) && ((xspeed == 0)))){
rotation = 0;
if (b){
this.scaleX = (this.scaleX * 1.5);
this.scaleY = (this.scaleY * 1.5);
};
};
if ((((yspeed < 0)) && ((xspeed > 0)))){
rotation = 45;
};
if ((((yspeed < 0)) && ((xspeed < 0)))){
rotation = -45;
};
if ((((yspeed > 0)) && ((xspeed > 0)))){
rotation = 135;
};
if ((((yspeed > 0)) && ((xspeed < 0)))){
rotation = -135;
};
if ((((yspeed == 0)) && ((xspeed < 0)))){
rotation = 270;
if (b){
this.scaleX = (this.scaleX * 1.5);
this.scaleY = (this.scaleY * 1.5);
};
};
if ((((yspeed == 0)) && ((xspeed > 0)))){
rotation = 90;
if (b){
this.scaleX = (this.scaleX * 1.5);
this.scaleY = (this.scaleY * 1.5);
};
};
this.xspeed = 0;
this.yspeed = 0;
this.p = p;
}
function frame20(){
if (this){
this.kill();
};
}
override function death(){
var a:Number;
play();
a = 0;
while (a < 5) {
parent.addChild(new YellowParticle(x, y));
a++;
};
}
override function special():Boolean{
this.x = p.x;
this.y = p.y;
HP--;
if (HP == 0){
death();
return (true);
};
return (false);
}
override public function spark(x:Number, y:Number){
}
}
}//package shots
Section 268
//LeafShot (shots.LeafShot)
package shots {
import particles.*;
public class LeafShot extends Shot {
public function LeafShot(x:Number, y:Number, xspeed:Number, yspeed:Number, rotation:Number, damage:Number){
super(x, y, xspeed, yspeed, damage);
alpha = 0.4;
this.rotation = rotation;
}
override function death(){
parent.addChild(new LeafParticle(x, y));
parent.addChild(new LeafParticle(x, y));
}
}
}//package shots
Section 269
//Shot (shots.Shot)
package shots {
import flash.display.*;
import levels.*;
import foes.*;
public class Shot extends MovieClip {
public var size:int;// = 10
public var HP:Number;
public var dead2:Boolean;// = false
public var yspeed:Number;
public var damage:Number;
public var bounce:Number;// = 0
public var xspeed:Number;
public function Shot(x:Number, y:Number, xspeed:Number, yspeed:Number, damage:Number, rotation:Number=INF){
bounce = 0;
dead2 = false;
size = 10;
super();
this.damage = damage;
this.x = x;
this.y = y;
this.xspeed = xspeed;
this.yspeed = yspeed;
if (rotation != Infinity){
this.rotation = rotation;
};
HP = 1;
cacheAsBitmap = true;
Global.vars.shotArray.push(this);
}
function hitStuff(){
var foes:Array;
var f:Foe;
foes = (parent as Level).foeList;
for each (f in foes) {
if (((((this.hitTestObject(f)) && (!(f.dead)))) && (!((f.superArmor > 0))))){
f.hit(damage);
HP = (HP - damage);
if (f){
spark(f.x, f.y);
};
if (HP < 0){
die();
break;
};
};
};
}
public function kill(){
Global.vars.shotArray.splice(Global.vars.shotArray.indexOf(this), 1);
this.stop();
dead2 = true;
if (this){
parent.removeChild(this);
};
}
function death(){
}
public function die(){
death();
kill();
}
function special():Boolean{
return (false);
}
public function onFrame(){
x = (x + xspeed);
y = (y + yspeed);
if (special()){
} else {
if ((((x > ((parent as Level).xlimit + size))) || ((x < -(size))))){
kill();
} else {
if ((((y > ((parent as Level).ylimit + size))) || ((y < -(size))))){
kill();
} else {
hitStuff();
};
};
};
}
public function spark(x:Number, y:Number){
}
}
}//package shots
Section 270
//StarBomb (shots.StarBomb)
package shots {
import levels.*;
import foes.*;
import bullets.*;
public class StarBomb extends Shot {
public var active:Boolean;// = true
var repeats:Number;
public var level:Level;
public function StarBomb(damage:Number, repeats:Number, level:Level){
active = true;
addFrameScript(0, frame1, 1, frame2, 14, frame15, 26, frame27);
super(0, 0, 0, 0, damage);
height = (height * 0.7);
width = (width * 0.7);
this.x = ((Math.random() * 400) + 100);
this.y = ((Math.random() * 500) + 100);
this.repeats = repeats;
this.level = level;
stop();
}
function pew(){
parent.addChild(new BigStarShot(x, y, 12, -3, (damage * 2)));
parent.addChild(new BigStarShot(x, y, -12, -3, (damage * 2)));
}
function frame15(){
if (this){
nextStar();
};
}
function frame1(){
(root as Main).makeSound("starbomb", "p");
}
function frame27(){
if (this){
kill2();
};
}
function kill2(){
if (repeats == 0){
(parent as Level).bomb = false;
};
kill();
}
override public function onFrame(){
var i:int;
var foes:Array;
var f:Foe;
var bullet:Bullet;
special();
if (active){
i = 0;
while (i < Global.vars.bulletArray.length) {
bullet = Global.vars.bulletArray[i];
if (this.hitTestPoint(bullet.x, bullet.y, true)){
bullet.yspeed = (bullet.yspeed - 2);
if (bullet.yspeed == 0){
bullet.yspeed = -1;
};
};
i++;
};
foes = (parent as Level).foeList;
for each (f in foes) {
if (((((this.hitTestPoint(f.x, f.y, true)) && (!(f.dead)))) && (!((f.superArmor > 0))))){
f.hit(damage);
};
};
};
nextFrame();
}
function nextStar(){
if (repeats != 0){
parent.addChild(new StarBomb(damage, (repeats - 1), level));
};
}
function frame2(){
pew();
}
}
}//package shots
Section 271
//StarShot (shots.StarShot)
package shots {
import particles.*;
public class StarShot extends Shot {
public function StarShot(x:Number, y:Number, xspeed:Number, yspeed:Number, damage:Number){
super(x, y, xspeed, yspeed, damage);
alpha = 0.4;
height = (height * 0.5);
width = (width * 0.5);
}
override function death(){
parent.addChild(new YellowParticle(x, y));
}
}
}//package shots
Section 272
//SuperBigStarShot (shots.SuperBigStarShot)
package shots {
import levels.*;
import particles.*;
public class SuperBigStarShot extends Shot {
var c:Number;// = 0
var damage2:Number;
public function SuperBigStarShot(x:Number, y:Number, xspeed:Number, yspeed:Number, damage:Number, damage2:Number){
c = 0;
super(x, y, xspeed, yspeed, damage);
this.damage2 = damage2;
height = (height * 1.5);
width = (width * 1.5);
HP = (30 * damage);
}
override function death(){
parent.addChild(new YellowParticle(x, y));
parent.addChild(new YellowParticle(x, y));
parent.addChild(new YellowParticle(x, y));
parent.addChild(new YellowParticle(x, y));
parent.addChild(new YellowParticle(x, y));
parent.addChild(new YellowParticle(x, y));
}
override public function onFrame(){
if (xspeed > 0){
xspeed = (xspeed - 0.5);
} else {
if (xspeed < 0){
xspeed = (xspeed + 0.5);
} else {
yspeed = (yspeed - 1);
};
};
x = (x + xspeed);
y = (y + yspeed);
c++;
if (((((c % 4) == 0)) && ((yspeed < -4)))){
parent.addChild(new StarShot(x, y, ((Math.random() * 4) - 2), (yspeed / 2), damage2));
};
if ((((x > ((parent as Level).xlimit + 10))) || ((x < -10)))){
xspeed = (xspeed * -1);
x = (x + xspeed);
};
if ((((y > ((parent as Level).ylimit + 10))) || ((y < -10)))){
kill();
} else {
hitStuff();
};
}
}
}//package shots
Section 273
//SwordShot (shots.SwordShot)
package shots {
import particles.*;
public class SwordShot extends Shot {
public function SwordShot(x:Number, y:Number, xspeed:Number, yspeed:Number, rotation:Number, damage:Number){
super(x, y, xspeed, yspeed, damage);
alpha = 0.5;
this.rotation = rotation;
}
override function death(){
parent.addChild(new YellowParticle(x, y));
parent.addChild(new YellowParticle(x, y));
}
}
}//package shots
Section 274
//TreeShot (shots.TreeShot)
package shots {
import players.*;
import particles.*;
public class TreeShot extends Shot {
var bullet:Shot;
var decel:Number;// = 2
var position:Boolean;
public var dead:Boolean;// = false
var p:Player;
var delay:Number;// = -10
var level:Number;
var direction:String;// = ""
var time:Number;// = 30
var angle:Number;// = 0
public function TreeShot(x:Number, y:Number, position:Boolean, p:Player){
decel = 2;
angle = 0;
direction = "";
time = 30;
dead = false;
delay = -10;
addFrameScript(12, frame13, 30, frame31);
super(x, y, 0, 0, 1);
alpha = 0.5;
this.HP = Infinity;
this.xspeed = 0;
this.yspeed = 0;
this.p = p;
this.position = position;
if (position){
this.scaleX = (this.scaleX * -1);
};
}
function frame13(){
stop();
}
override function special():Boolean{
var a:int;
if (delay == -10){
a = 0;
while (a < 2) {
parent.addChild(new LeafShot(x, (y - 25), ((Math.random() * 20) - 10), (-10 - (Math.random() * 8)), 0, (p.baseDamage * 2)));
a++;
};
delay = 0;
};
if ((((delay == 0)) && (!(dead)))){
delay = 4;
(root as Main).makeSound("leaf", "p");
parent.addChild(new LeafShot(x, (y - 25), ((Math.random() * 20) - 10), -15, 0, (p.baseDamage * 2)));
};
delay--;
if (position){
this.x = (p.x + 70);
} else {
this.x = (p.x - 70);
};
this.y = p.y;
if ((((p.subCharge < 5)) || (dead))){
if (p.subCharge < 5){
(p as Anna).trees = false;
};
dead = true;
play();
};
if (x < 0){
x = 0;
};
if (x > 500){
x = 500;
};
return (true);
}
function frame31(){
kill();
}
override public function spark(x:Number, y:Number){
parent.addChild(new LeafParticle(x, (y - 15)));
}
}
}//package shots
Section 275
//BGM (BGM)
package {
import flash.events.*;
import flash.media.*;
public class BGM {
static var paus:Boolean = false;
static var thisSong:String = "1";
static var mute:Boolean = false;
static var volume:Number = 0;
static var music:SoundChannel = new SoundChannel();
static var nextSong:String = "";
static var maxvol:Number = 1;
static var fader:SoundTransform = new SoundTransform();
static var fade:Boolean = false;
public function BGM(){
super();
}
public static function stop(){
music.stop();
}
public static function resume(){
trace("Resume music.");
paus = false;
volume = maxvol;
setVolume();
}
static function getSong():Sound{
if (nextSong == "starMusic"){
return (new starMusic());
};
if (nextSong == "waterMusic"){
return (new waterMusic());
};
if (nextSong == "spaceMusic"){
return (new spaceMusic());
};
if (nextSong == "neverMusic"){
return (new rainMusic());
};
if (nextSong == "menuMusic"){
return (new menuMusic());
};
if (nextSong == "bossMusic"){
return (new bossMusic());
};
return (new starMusic());
}
static function setVolume(){
fader.volume = volume;
music.soundTransform = fader;
}
public static function loop(e:Event){
if (!Global.vars.options[5]){
volume = 0;
} else {
if (paus){
volume = 0.2;
} else {
if ((((volume < maxvol)) && (fade))){
volume = (volume + 0.02);
};
if ((((volume > 0)) && (!(fade)))){
volume = (volume - 0.02);
};
if ((((volume <= 0)) && (!((nextSong == ""))))){
music.stop();
trace(("Playing music: " + nextSong));
music = getSong().play(0, int.MAX_VALUE);
music.soundTransform = fader;
thisSong = nextSong;
nextSong = "";
volume = 0.02;
fade = true;
};
};
};
setVolume();
}
public static function play(track:String){
paus = false;
if (!(((thisSong == track)) && (fade))){
trace("Prepared next song.");
fade = false;
nextSong = track;
} else {
trace("Same song already playing.");
};
}
public static function pause(){
trace("Pause music.");
paus = true;
volume = 0.2;
setVolume();
}
}
}//package
Section 276
//BlueGlow (BlueGlow)
package {
import flash.display.*;
public dynamic class BlueGlow extends MovieClip {
public function BlueGlow(){
super();
}
}
}//package
Section 277
//bossMusic (bossMusic)
package {
import flash.media.*;
public dynamic class bossMusic extends Sound {
public function bossMusic(){
super();
}
}
}//package
Section 278
//fire (fire)
package {
import flash.display.*;
public dynamic class fire extends MovieClip {
public function fire(){
super();
addFrameScript(25, frame26);
}
function frame26(){
if (this){
parent.removeChild(this);
};
}
}
}//package
Section 279
//FocusDot (FocusDot)
package {
import flash.display.*;
public dynamic class FocusDot extends MovieClip {
public function FocusDot(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 280
//GetReady (GetReady)
package {
import flash.display.*;
import flash.events.*;
import levels.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class GetReady extends MovieClip {
public var start:SimpleButton;
public var tip:MovieClip;
public function GetReady(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 10, frame11, 90, frame91, 113, frame114);
}
function frame91(){
(parent as Level).wait--;
(parent as Level).background.tiles.play();
}
function frame3(){
tip.gotoAndStop((parent as Level).levelNo);
}
function frame1(){
visible = false;
}
function frame2(){
visible = true;
if ((root as Main).levelRanks[(parent as Level).levelNo] > 1){
gotoAndPlay("notip");
};
}
function frame114(){
(parent as Level).ready = null;
stage.focus = stage;
parent.removeChild(this);
}
function frame11(){
stop();
getChildByName("start").addEventListener(MouseEvent.CLICK, function (e:Event=null){
play();
});
}
}
}//package
Section 281
//Global (Global)
package {
public class Global {
public static var vars:Object = {};
public function Global(){
super();
}
}
}//package
Section 282
//LevelEnd (LevelEnd)
package {
import flash.display.*;
import flash.events.*;
import levels.*;
import flash.text.*;
public class LevelEnd extends MovieClip {
public var cheats:MovieClip;
public var scoreT:TextField;
public var moneyCollectedT:TextField;
var s1:String;// = "s1"
var s2:String;// = "s2"
var s3:String;// = "s3"
public var menu:SimpleButton;
public var foesKilledT:TextField;
public var waveT:TextField;
public var bestComboT:TextField;
public var retry:SimpleButton;
public var rankT:MovieClip;
public var hitsTakenT:TextField;
public var best2:MovieClip;
public var best3:MovieClip;
public var best4:MovieClip;
public var best1:MovieClip;
public var rr:int;// = 1
public var status:MovieClip;
public function LevelEnd(score:Number, foesKilled:String, hitsTaken:Number, bestCombo:Number, moneyCollected:Number, rank:Number){
var score = score;
var foesKilled = foesKilled;
var hitsTaken = hitsTaken;
var bestCombo = bestCombo;
var moneyCollected = moneyCollected;
var rank = rank;
s1 = "s1";
s2 = "s2";
s3 = "s3";
rr = 1;
super();
addFrameScript(0, frame1, 1, frame2);
scoreT.text = (s1 = String(score));
foesKilledT.text = (s2 = String(foesKilled));
bestComboT.text = String(bestCombo);
hitsTakenT.text = String(hitsTaken);
moneyCollectedT.text = String(moneyCollected);
getChildByName("menu").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(parent as Level).exitLevel();
});
getChildByName("retry").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(parent as Level).retryLevel();
});
}
function frame1(){
stop();
rankT.gotoAndStop(rr);
if (rr == 1){
rankT.gotoAndStop(9);
status.gotoAndStop(2);
};
}
function frame2(){
scoreT.text = s1;
foesKilledT.text = s2;
waveT.text = s3;
waveT.text = ("" + ((parent as Level).level as Level25).waveCount);
rankT.gotoAndStop(rr);
if (rr == 1){
rankT.gotoAndStop(9);
};
trace(("rank: " + rr));
}
}
}//package
Section 283
//Main (Main)
package {
import flash.display.*;
import flash.events.*;
import levels.*;
import com.newgrounds.components.*;
import flash.utils.*;
import mochi.as3.*;
import foes.*;
import flash.text.*;
import flash.net.*;
import players.*;
import CPMStar.*;
import flash.ui.*;
import bullets.*;
import shots.*;
import misc.*;
import flash.system.*;
import flash.geom.*;
public class Main extends MovieClip {
public var survivalWaves:int;// = 0
public var b1:SimpleButton;
public var b2:SimpleButton;
public var b3:SimpleButton;
public var b4:SimpleButton;
public var b5:SimpleButton;
public var b6:SimpleButton;
public var b8:SimpleButton;
public var b9:SimpleButton;
public var loader:Loader;
public var b7:SimpleButton;
public var ad:DisplayObject;
public var keyIsDown:Array;
public var showPlayer:MovieClip;
public var survivalKills:int;// = 0
public var musicLink2;
public var __setPropDict:Dictionary;
public var li10:MovieClip;
public var li11:MovieClip;
public var li13:MovieClip;
public var li14:MovieClip;
public var li15:MovieClip;
public var li16:MovieClip;
public var li17:MovieClip;
public var li12:MovieClip;
public var li18:MovieClip;
public var e1:MovieClip;
public var e2:MovieClip;
public var e3:MovieClip;
public var e4:MovieClip;
public var e5:MovieClip;
public var e6:MovieClip;
public var li20:MovieClip;
public var tick10:MovieClip;
public var tick11:MovieClip;
public var tick12:MovieClip;
public var tick14:MovieClip;
public var tick16:MovieClip;
public var li22:MovieClip;
public var tick13:MovieClip;
public var li25:MovieClip;
public var tick15:MovieClip;
public var li21:MovieClip;
public var li24:MovieClip;
public var b:int;
public var delsel:SimpleButton;
public var tick17:MovieClip;
public var e7:MovieClip;
public var li23:MovieClip;
public var __id0_:APIConnector;
public var moreGames;
public var musicLink3;
public var ths:int;
public var j:Number;
public var CPMStarContentSpotID:String;
public var mouse:Boolean;// = false
public var a:int;
public var li19:MovieClip;
public var mattLink3;
public var levelRanks:Array;
public var mattLink2;
public var levelScores:Array;
public var domain:String;
public var money:int;// = 0
public var cla:Class;
public var ii:int;
public var myMenu:ContextMenu;
public var paramObj:Object;
public var mattLink;
public var sounds:MovieClip;
public var moreGames2;
public var moreGames3;
public var jj:int;
public var countSound:int;// = 0
public var maxedStats:int;
public var apiPath:String;
public var selectedPlayer:Number;// = 1
public var m1:SimpleButton;
public var m2:SimpleButton;
public var m3:SimpleButton;
public var m6:SimpleButton;
public var m4:SimpleButton;
public var m5:SimpleButton;
public var fader:MovieClip;
public var playerUnlock:Boolean;// = false
public var mcc:MovieClip;
public var allowed:String;
public var selectedLevel:Number;// = 1
public var newGame:Boolean;
public var p0:MovieClip;
public var p1:MovieClip;
public var p2:MovieClip;
public var p3:MovieClip;
public var upgraded:MovieClip;
public var p4:MovieClip;
public var le2:TextField;
public var le3:TextField;
public var le4:TextField;
public var le5:TextField;
public var le6:TextField;
public var le7:TextField;
public var le1:TextField;
public var kongregate;
public var survivalScore:int;// = 0
public var levelicon:MovieClip;
public var r0:MovieClip;
public var r1:MovieClip;
public var r2:MovieClip;
public var r3:MovieClip;
public var r4:MovieClip;
public var r5:MovieClip;
public var r6:MovieClip;
public var r7:MovieClip;
public var r8:MovieClip;
public var r9:MovieClip;
public var r11:MovieClip;
public var r12:MovieClip;
public var r14:MovieClip;
public var r15:MovieClip;
public var r16:MovieClip;
public var r10:MovieClip;
public var r19:MovieClip;
public var r13:MovieClip;
public var s1:TextField;
public var r18:MovieClip;
public var s4:TextField;
public var s5:TextField;
public var s6:TextField;
public var s2:TextField;
public var s3:TextField;
public var medalDesc:TextField;
public var medalName:TextField;
public var r20:MovieClip;
public var r21:MovieClip;
public var r22:MovieClip;
public var r23:MovieClip;
public var startButton:SimpleButton;
public var tick2:MovieClip;
public var tick3:MovieClip;
public var tick4:MovieClip;
public var tick5:MovieClip;
public var tick8:MovieClip;
public var tick9:MovieClip;
public var t2:Number;// = 200000
public var tick1:MovieClip;
public var r25:MovieClip;
public var r17:MovieClip;
public var tick6:MovieClip;
public var tick7:MovieClip;
public var r24:MovieClip;
public var li0:MovieClip;
public var li2:MovieClip;
public var li3:MovieClip;
public var li4:MovieClip;
public var li5:MovieClip;
public var li6:MovieClip;
public var li8:MovieClip;
public var u1:SimpleButton;
public var u2:SimpleButton;
public var u3:SimpleButton;
public var u4:SimpleButton;
public var u5:SimpleButton;
public var li7:MovieClip;
public var u7:SimpleButton;
public var li9:MovieClip;
public var lastPage:String;
public var u6:SimpleButton;
public var t1:Number;// = 0
public var unlockedLevel:Number;// = 0
public var li1:MovieClip;
public var showLevel:MovieClip;
public var request:URLRequest;
public var mm1:TextField;
public var mm4:TextField;
public var mm5:TextField;
public var mm6:TextField;
public var mm7:TextField;
public var mm2:TextField;
public var mm3:TextField;
public var prevSound:String;// = ""
public var adBox:MovieClip;
public var playersUnlocked:Array;
public var playericon:MovieClip;
public var totalhigh:TextField;
public var medal:Object;
public var icons:Array;
public var medalBox:MovieClip;
public var mu1:SimpleButton;
public var mu2:SimpleButton;
public var mu3:SimpleButton;
public var mu5:SimpleButton;
public var mu6:SimpleButton;
public var mu4:SimpleButton;
public var moneyT:TextField;
public var konglink:SimpleButton;
public var level:Level;
public var mtt:TextField;
public var musicLink;
public var playerUpgrades:Array;
public var levelUnlock:Boolean;// = false
public function Main(){
__setPropDict = new Dictionary(true);
selectedLevel = 1;
unlockedLevel = 0;
selectedPlayer = 1;
keyIsDown = [];
t1 = 0;
t2 = 200000;
money = 0;
levelRanks = [0];
playersUnlocked = [true, true, false, false, false];
levelScores = [];
levelUnlock = false;
playerUnlock = false;
playerUpgrades = [];
mouse = false;
prevSound = "";
countSound = 0;
survivalKills = 0;
survivalScore = 0;
survivalWaves = 0;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11);
MochiServices.connect("dc089a30e5985f83", root, onConnectError);
MochiEvents.trackEvent("viewed preloader");
Global.vars.bullets = 0;
Global.vars.foes = 0;
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownGet);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpGet);
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseUp);
}
public function deleteData(){
if (Global.vars.options[9]){
trace("Reset progress & upgrades!");
levelRanks = [0];
money = 0;
Player.bombLevel = 0;
Player.mainChargeLevel = 0;
Player.subChargeLevel = 0;
Player.healthLevel = 0;
Player.speedLevel = 0;
Player.magnetLevel = 0;
Player.mainDamageLevel = 0;
saveGame();
};
if (Global.vars.options[10]){
trace("Reset medals & scores!");
Medals.locks = [];
Medals.stats = {kills:0, powerUps:0, damage:0, playerLevels:[0, 0, 0, 0, 0]};
levelScores = [];
survivalKills = 0;
survivalWaves = 0;
saveGame();
};
}
public function upgradePlayer(m:TextField, t:String, l:String, yy:int, e:Event=null){
if (money >= Number(m.text)){
money = (money - Number(m.text));
var _local6 = cla;
var _local7 = l;
var _local8 = (_local6[_local7] + 1);
_local6[_local7] = _local8;
showUpgrades();
(upgraded as MovieClip).gotoAndPlay(2);
(upgraded as MovieClip).y = (0 + (yy * 68));
saveGame();
trace(("UPGRADE " + l));
} else {
trace("NOT ENOUGH MONEY");
};
}
public function keyDownGet(e:KeyboardEvent){
if (level){
level.player.keyDownGet(e.keyCode);
level.player.keyIsDown = keyIsDown;
if (((level.ready) && (level.ready.tip))){
level.ready.play();
};
};
keyIsDown[e.keyCode] = true;
if (e.keyCode == 57){
debug();
};
}
public function loadComplete(event:Event):void{
kongregate = event.target.content;
kongregate.services.connect();
}
public function startLevel(){
level = new Level(selectedPlayer, selectedLevel);
addChild(level);
level.keyIsDown = keyIsDown;
if (((!(level.level.survival)) && (Global.vars.options[14]))){
stage.frameRate = 25;
};
}
function frame10(){
stop();
startLevel();
}
function frame3(){
newGame = loadGame();
lastPage = "mainMenu";
addEventListener(Event.ENTER_FRAME, BGM.loop);
if (!Global.vars.options[11]){
stage.quality = "low";
} else {
stage.quality = "high";
};
mouse = Global.vars.options[6];
startButton.addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("mainMenu");
});
getChildByName("b1").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/epic-battle-fantasy/?gamereferral=bullet-heaven"), "_blank");
});
getChildByName("b2").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/epic-battle-fantasy-2/?gamereferral=bullet-heaven"), "_blank");
});
getChildByName("b3").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/epic-battle-fantasy-3/?gamereferral=bullet-heaven"), "_blank");
});
getChildByName("b4").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/mecha-dress-up-game/?gamereferral=bullet-heaven"), "_blank");
});
getChildByName("b5").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/the-kitten-game/?gamereferral=bullet-heaven"), "_blank");
});
getChildByName("b6").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kupo707.deviantart.com/"), "_blank");
});
getChildByName("b7").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.facebook.com/pages/Epic-Battle-Fantasy-3/121491377896263"), "_blank");
});
getChildByName("b8").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.zazzle.com/kupo707*"), "_blank");
});
getChildByName("b9").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.facebook.com/pages/Halcyonic-Falcon-X/148298581863486"), "_blank");
});
}
public function upgradeMagnet(e:Event=null){
upgradePlayer(mm6, "magnetTree", "magnetLevel", 5);
}
public function upgradeDamage(e:Event=null){
upgradePlayer(mm4, "mainDamageTree", "mainDamageLevel", 3);
}
public function mouseDouble(){
trace("double click");
if (level){
level.player.keyDownGet(-2);
};
}
function frame1(){
if ((((__setPropDict[__id0_] == undefined)) || (!((int(__setPropDict[__id0_]) == 1))))){
__setPropDict[__id0_] = currentFrame;
__setProp___id0__Scene1_Layer13_1();
};
paramObj = LoaderInfo(root.loaderInfo).parameters;
apiPath = ((paramObj.kongregate_api_path) || ("http://www.kongregate.com/flash/API_AS3_Local.swf"));
Security.allowDomain(apiPath);
request = new URLRequest(apiPath);
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
loader.load(request);
this.addChild(loader);
myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
moreGames = new ContextMenuItem("Sponsored by Kongregate");
moreGames2 = new ContextMenuItem("-> Play more Shooters");
moreGames3 = new ContextMenuItem("-> Play Matt's other games");
mattLink = new ContextMenuItem("Game by Matt Roszak");
mattLink2 = new ContextMenuItem("-> Follow him on Facebook");
mattLink3 = new ContextMenuItem("-> Follow him on DeviantArt");
musicLink = new ContextMenuItem("Music by Halcyonic Falcon X");
musicLink2 = new ContextMenuItem("-> Follow her on Facebook");
musicLink3 = new ContextMenuItem("-> Download the soundtrack");
mattLink.separatorBefore = true;
musicLink.separatorBefore = true;
moreGames.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, openLink);
moreGames2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, openLink2);
moreGames3.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, openLink3);
mattLink2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, openLink4);
mattLink3.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, openLink5);
musicLink2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, openLink6);
musicLink3.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, openLink7);
myMenu.customItems.push(moreGames, moreGames2, moreGames3, mattLink, mattLink2, mattLink3, musicLink, musicLink2, musicLink3);
contextMenu = myMenu;
stop();
getChildByName("konglink").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kongregate.com/?gamereferral=bullet-heaven"), "_blank");
});
allowed = "kongregate.";
domain = this.root.loaderInfo.url.split("/")[2];
adBox.visible = false;
if (domain.indexOf(allowed) >= 0){
} else {
adBox.visible = true;
CPMStarContentSpotID = "4235Q55C262F5";
ad = new AdLoader(CPMStarContentSpotID);
adBox.addChild(ad);
};
}
function frame11(){
b = 1;
while (b < 18) {
tickenize("tick", b);
b++;
};
getChildByName("b1").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo(lastPage);
});
getChildByName("delsel").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).deleteData();
});
}
function frame7(){
getChildByName("b1").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo(lastPage);
});
MochiEvents.trackEvent("viewed credits");
getChildByName("b2").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/epic-battle-fantasy-2/?gamereferral=bullet-heaven"), "_blank");
});
getChildByName("b3").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/epic-battle-fantasy-3/?gamereferral=bullet-heaven"), "_blank");
});
getChildByName("b4").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/mecha-dress-up-game/?gamereferral=bullet-heaven"), "_blank");
});
getChildByName("b5").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/the-kitten-game/?gamereferral=bullet-heaven"), "_blank");
});
getChildByName("b6").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kupo707.deviantart.com/"), "_blank");
});
getChildByName("b7").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.facebook.com/pages/Epic-Battle-Fantasy-3/121491377896263"), "_blank");
});
getChildByName("b8").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://halcyonicfalconx.newgrounds.com/news/post/579117"), "_blank");
});
getChildByName("b9").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.facebook.com/pages/Halcyonic-Falcon-X/148298581863486"), "_blank");
});
getChildByName("mu1").addEventListener(MouseEvent.CLICK, function (e:Event=null){
BGM.play("menuMusic");
});
getChildByName("mu2").addEventListener(MouseEvent.CLICK, function (e:Event=null){
BGM.play("starMusic");
});
getChildByName("mu3").addEventListener(MouseEvent.CLICK, function (e:Event=null){
BGM.play("waterMusic");
});
getChildByName("mu4").addEventListener(MouseEvent.CLICK, function (e:Event=null){
BGM.play("neverMusic");
});
getChildByName("mu5").addEventListener(MouseEvent.CLICK, function (e:Event=null){
BGM.play("spaceMusic");
});
getChildByName("mu6").addEventListener(MouseEvent.CLICK, function (e:Event=null){
BGM.play("bossMusic");
});
getChildByName("konglink").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kongregate.com/?gamereferral=bullet-heaven"), "_blank");
});
}
public function buttonize(m:String, i:Number){
var mc:MovieClip;
var m = m;
var i = i;
mc = (getChildByName(m) as MovieClip);
if (playersUnlocked[(i - 1)]){
mc.icons.gotoAndStop(i);
mc.buttonMode = true;
mc.addEventListener(MouseEvent.MOUSE_DOWN, function (e:Event=null){
selectPlayer((i - 1));
mc.gotoAndStop(3);
saveGame();
});
mc.addEventListener(MouseEvent.ROLL_OVER, function (e:Event=null){
mc.gotoAndStop(2);
});
mc.addEventListener(MouseEvent.MOUSE_UP, function (e:Event=null){
mc.gotoAndStop(2);
});
mc.addEventListener(MouseEvent.ROLL_OUT, function (e:Event=null){
mc.gotoAndStop(1);
});
} else {
mc.icons.gotoAndStop(6);
};
}
function frame4(){
stop();
lastPage = "mainMenu";
BGM.play("menuMusic");
MochiEvents.trackEvent("viewed main menu");
sounds = new Sounds();
getChildByName("m1").addEventListener(MouseEvent.CLICK, function (e:Event=null){
if (newGame){
(root as Main).fadeTo("instructions");
newGame = false;
} else {
(root as Main).fadeTo("levelSelect");
};
});
getChildByName("m2").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("instructions");
newGame = false;
});
getChildByName("m3").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("options");
});
getChildByName("m4").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("medals");
});
getChildByName("m5").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("credits");
});
getChildByName("m6").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kongregate.com/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame5(){
BGM.play("menuMusic");
getChildByName("konglink").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kongregate.com/?gamereferral=bullet-heaven"), "_blank");
});
lastPage = "levelSelect";
y = 0;
stage.frameRate = 30;
moneyT.text = String(money);
if ((((levelRanks[1] == 0)) || ((levelRanks[1] == undefined)))){
levelRanks[1] = 1;
};
selectLevel(selectedLevel);
selectPlayer(selectedPlayer);
j = 1;
while (j <= 25) {
levelbutton(("li" + j), j);
j++;
};
buttonize("p0", 1);
buttonize("p1", 2);
buttonize("p2", 3);
buttonize("p3", 4);
buttonize("p4", 5);
getChildByName("b1").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("mainMenu");
});
getChildByName("b2").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("upgrades");
});
getChildByName("b3").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("playLevel");
});
getChildByName("b4").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("instructions");
newGame = false;
});
getChildByName("b5").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("options");
});
getChildByName("b6").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("medals");
});
getChildByName("b7").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("credits");
});
}
public function tickenize(m:String, b:int){
var mc:MovieClip;
var m = m;
var b = b;
mc = (getChildByName((m + b)) as MovieClip);
mc.buttonMode = true;
mc.addEventListener(MouseEvent.MOUSE_DOWN, function (e:Event=null){
toggleOption(mc, b);
mc.gotoAndStop(3);
saveGame();
});
mc.addEventListener(MouseEvent.ROLL_OVER, function (e:Event=null){
mc.gotoAndStop(2);
});
mc.addEventListener(MouseEvent.MOUSE_UP, function (e:Event=null){
mc.gotoAndStop(2);
});
mc.addEventListener(MouseEvent.ROLL_OUT, function (e:Event=null){
mc.gotoAndStop(1);
});
if (Global.vars.options[(b - 1)]){
mc.tick.nextFrame();
};
}
function frame8(){
getChildByName("b1").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo(lastPage);
});
getChildByName("b2").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("levelSelect");
});
}
function frame9(){
a = 0;
icons = [];
ths = 0;
ii = 0;
while (ii < levelScores.length) {
if (levelScores[ii] != undefined){
ths = (ths + levelScores[ii]);
};
ii++;
};
totalhigh.text = ("" + ths);
kongregate.stats.submit("totalScore", ths);
getChildByName("b1").addEventListener(MouseEvent.CLICK, function (e:Event=null){
jj = 0;
while (jj < icons.length) {
removeChild(icons[jj]);
jj++;
};
(root as Main).fadeTo(lastPage);
});
for each (medal in Medals.medals) {
medalIconize(medal, a);
a++;
};
}
public function toggleOption(mc:MovieClip, b:int){
if (mc.tick.currentFrame == 1){
mc.tick.nextFrame();
Global.vars.options[(b - 1)] = true;
trace((("Option " + b) + " is on."));
} else {
if (mc.tick.currentFrame == 2){
mc.tick.prevFrame();
Global.vars.options[(b - 1)] = false;
trace((("Option " + b) + " is off."));
};
};
if (!Global.vars.options[11]){
stage.quality = "low";
} else {
stage.quality = "high";
};
mouse = Global.vars.options[6];
}
function frame6(){
maxedStats = 0;
showUpgrades();
(getChildByName("p0") as MovieClip).icons.gotoAndStop((selectedPlayer + 1));
getChildByName("b1").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("levelSelect");
});
if (getChildByName("u1")){
getChildByName("u1").addEventListener(MouseEvent.CLICK, upgradeHealth, false, 0, true);
};
if (getChildByName("u2")){
getChildByName("u2").addEventListener(MouseEvent.CLICK, upgradeMain, false, 0, true);
};
if (getChildByName("u3")){
getChildByName("u3").addEventListener(MouseEvent.CLICK, upgradeSub, false, 0, true);
};
if (getChildByName("u4")){
getChildByName("u4").addEventListener(MouseEvent.CLICK, upgradeDamage, false, 0, true);
};
if (getChildByName("u5")){
getChildByName("u5").addEventListener(MouseEvent.CLICK, upgradeSpeed, false, 0, true);
};
if (getChildByName("u6")){
getChildByName("u6").addEventListener(MouseEvent.CLICK, upgradeMagnet, false, 0, true);
};
if (getChildByName("u7")){
getChildByName("u7").addEventListener(MouseEvent.CLICK, upgradeBomb, false, 0, true);
};
for each (mcc in [e1, e2, e3, e4, e5, e6, e7]) {
mcc.mouseEnabled = false;
};
for each (mtt in [le1, le2, le3, le4, le5, le6, le7, mm1, mm2, mm3, mm4, mm5, mm6, mm7]) {
mtt.mouseEnabled = false;
};
upgraded.mouseEnabled = false;
}
public function resetUpgrades(){
trace("HAX: reset upgrades");
Player.healthLevel = 0;
Player.mainChargeLevel = 0;
Player.subChargeLevel = 0;
Player.speedLevel = 0;
Player.magnetLevel = 0;
Player.mainDamageLevel = 0;
Player.bombLevel = 0;
}
public function openLink(e:ContextMenuEvent):void{
navigateToURL(new URLRequest("http://www.kongregate.com/?gamereferral=bullet-heaven"));
}
function frame2(){
stop();
}
public function setFrameRate(r:int){
stage.frameRate = r;
}
public function retryLevel(){
Medals.level = undefined;
removeChild(level);
gotoAndStop(14);
gotoAndStop("playLevel");
stage.focus = stage;
}
public function unlockPlayers(){
trace("HAX: unlock players");
}
public function unlockLevels(){
trace("HAX: unlock levels");
levelRanks = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
}
public function upgradeMain(e:Event=null){
upgradePlayer(mm2, "mainChargeTree", "mainChargeLevel", 1);
}
public function loadGame():Boolean{
var so:SharedObject;
trace("LOADING");
so = SharedObject.getLocal("EBF33save");
survivalWaves = so.data.survivalWaves;
survivalKills = so.data.survivalKills;
if (so.data.stats != undefined){
Medals.locks = so.data.medals;
Medals.stats = so.data.stats;
};
if (so.data.options != undefined){
Global.vars.options = so.data.options;
} else {
Global.vars.options = [true, true, true, true, true, true, true, false, false, false, false, true, false, false, false, false, false, false];
};
if (so.data.money != undefined){
trace("data loaded successfully");
money = so.data.money;
trace(so.data.selectedLevel);
trace(Boolean(so.data.selectedLevel));
if (so.data.selectedLevel != undefined){
selectedLevel = so.data.selectedLevel;
};
if (so.data.selectedPlayer != undefined){
selectedPlayer = so.data.selectedPlayer;
};
levelRanks = so.data.levelRanks;
playersUnlocked = so.data.playersUnlocked;
levelScores = so.data.levelScores;
loadPlayer("players.Player", so);
return (false);
};
money = 0;
trace("no data found");
return (true);
}
public function fadeTo(label:String){
trace(("fade to " + label));
MovieClip(fader).l = label;
MovieClip(fader).gotoAndPlay("fade");
}
public function mouseUp(e:Event){
keyIsDown[1] = false;
if (level){
level.player.keyIsDown = keyIsDown;
};
}
public function debug(){
}
public function lockLevels(){
trace("HAX: lock levels");
levelRanks = [0];
}
public function upgradeSub(e:Event=null){
upgradePlayer(mm3, "subChargeTree", "subChargeLevel", 2);
}
public function onConnectError(status:String):void{
}
public function savePlayer(playa:String, so:SharedObject){
var cla:Class;
cla = (getDefinitionByName(playa) as Class);
so.data[playa] = [cla.healthLevel, cla.mainChargeLevel, cla.subChargeLevel, cla.speedLevel, cla.magnetLevel, cla.mainDamageLevel, cla.bombLevel];
}
public function upgradeBomb(e:Event=null){
upgradePlayer(mm7, "bombTree", "bombLevel", 6);
}
public function mouseDown(e:Event){
t2 = getTimer();
if ((t2 - t1) < 600){
mouseDouble();
t2 = 0;
};
t1 = t2;
keyIsDown[1] = true;
if (level){
level.player.keyDownGet(-1);
level.player.keyIsDown = keyIsDown;
};
}
public function selectPlayer(p:Number){
selectedPlayer = p;
showPlayer.showPlayer.gotoAndStop(11);
showPlayer.showPlayer.gotoAndStop((p + 1));
showPlayer.gotoAndPlay(2);
playericon.icons.gotoAndStop((p + 1));
}
public function getMoney(){
trace("HAX: get money");
money = (money + 10000);
}
public function saveGame(){
var so:SharedObject;
trace("SAVING");
so = SharedObject.getLocal("EBF33save");
so.data.medals = Medals.locks;
so.data.stats = Medals.stats;
so.data.selectedLevel = selectedLevel;
so.data.selectedPlayer = selectedPlayer;
so.data.money = money;
so.data.survivalWaves = survivalWaves;
so.data.survivalKills = survivalKills;
so.data.levelRanks = levelRanks;
so.data.playersUnlocked = playersUnlocked;
so.data.levelScores = levelScores;
so.data.options = Global.vars.options;
savePlayer("players.Player", so);
so.flush();
}
public function medalIconize(medal:Object, a:int){
var mi:MovieClip;
var medal = medal;
var a = a;
mi = new MedalIcon();
addChild(mi);
icons[a] = mi;
mi.x = (((a % 8) * 58) + 62);
mi.y = (100 + (58 * Math.floor((a / 8))));
if (Medals.locks[a]){
mi.icon.gotoAndStop(medal.pic);
} else {
mi.icon.gotoAndStop(33);
};
mi.buttonMode = true;
mi.addEventListener(MouseEvent.MOUSE_DOWN, function (e:Event=null){
viewMedal(medal);
mi.gotoAndStop(3);
});
mi.addEventListener(MouseEvent.ROLL_OVER, function (e:Event=null){
mi.gotoAndStop(2);
});
mi.addEventListener(MouseEvent.MOUSE_UP, function (e:Event=null){
mi.gotoAndStop(2);
});
mi.addEventListener(MouseEvent.ROLL_OUT, function (e:Event=null){
mi.gotoAndStop(1);
});
}
public function unlockPlayer(p:int){
if (!playersUnlocked[p]){
playersUnlocked[p] = true;
playerUnlock = true;
saveGame();
};
}
public function openLink2(e:ContextMenuEvent):void{
navigateToURL(new URLRequest("http://www.kongregate.com/shooter-games/?gamereferral=bullet-heaven"));
}
public function openLink3(e:ContextMenuEvent):void{
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/?gamereferral=bullet-heaven"));
}
public function openLink4(e:ContextMenuEvent):void{
navigateToURL(new URLRequest("http://www.facebook.com/pages/Epic-Battle-Fantasy-3/121491377896263"));
}
public function openLink6(e:ContextMenuEvent):void{
navigateToURL(new URLRequest("http://www.facebook.com/pages/Halcyonic-Falcon-X/148298581863486"));
}
public function openLink7(e:ContextMenuEvent):void{
navigateToURL(new URLRequest("http://halcyonicfalconx.newgrounds.com/news/post/579117"));
}
public function openLink5(e:ContextMenuEvent):void{
navigateToURL(new URLRequest("http://kupo707.deviantart.com/"));
}
public function viewMedal(m:Object){
medalName.text = m.name;
medalDesc.text = m.desc;
}
public function loadPlayer(playa:String, so:SharedObject){
var cla:Class;
cla = (getDefinitionByName(playa) as Class);
cla.healthLevel = so.data[playa][0];
cla.mainChargeLevel = so.data[playa][1];
cla.subChargeLevel = so.data[playa][2];
cla.speedLevel = so.data[playa][3];
cla.magnetLevel = so.data[playa][4];
cla.mainDamageLevel = so.data[playa][5];
cla.bombLevel = so.data[playa][6];
}
public function upgradeSpeed(e:Event=null){
upgradePlayer(mm5, "speedTree", "speedLevel", 4);
}
function __setProp___id0__Scene1_Layer13_1(){
__id0_["componentInspectorSetting"] = true;
//unresolved jump
var _slot1 = e;
__id0_.movieId = "17779:D0TErlKv";
__id0_.debugMode = true;
__id0_.encryptionKey = "95kpSlfkYxxvyqg7KeWjFGsmNMwwl4OW";
__id0_.movieVersion = "";
__id0_.showConnectingPopup = true;
__id0_.useErrorPopup = true;
__id0_.useMedalPopup = false;
__id0_.useFakeSession = true;
__id0_["componentInspectorSetting"] = false;
//unresolved jump
var _slot1 = e;
}
public function upgradeHealth(e:Event=null){
upgradePlayer(mm1, "healthTree", "healthLevel", 0);
}
public function getPrice(t:TextField, a:Array, l:Number){
if (l >= (a.length - 1)){
maxedStats++;
if (maxedStats == 7){
Medals.unlockMedal("Max Power", medalBox);
};
t.text = "maxed";
Medals.unlockMedal("Power Up", medalBox);
return (true);
//unresolved jump
};
t.text = a[(l + 1)][1];
return (false);
}
public function keyUpGet(e:KeyboardEvent){
keyIsDown[e.keyCode] = false;
}
public function makeSound(s:String, t:String){
if (s == prevSound){
countSound++;
} else {
countSound = 0;
prevSound = s;
};
if ((((countSound < 3)) && ((((((((t == "p")) && (Global.vars.options[2]))) || ((((t == "f")) && (Global.vars.options[3]))))) || ((((t == "i")) && (Global.vars.options[4]))))))){
(sounds as MovieClip).gotoAndStop(s);
(sounds as MovieClip).gotoAndStop(1);
};
}
public function levelbutton(m:String, i:Number){
var mc:MovieClip;
var rc:MovieClip;
var m = m;
var i = i;
mc = (getChildByName(m) as MovieClip);
rc = (getChildByName(("r" + i)) as MovieClip);
if ((((((levelRanks[i] > 0)) || ((i <= 0)))) || ((i == 25)))){
rc.gotoAndStop(levelRanks[i]);
rc.scaleX = (rc.scaleX * 0.7);
rc.scaleY = (rc.scaleY * 0.7);
rc.y = (rc.y + 5);
mc.buttonMode = true;
mc.addEventListener(MouseEvent.MOUSE_DOWN, function (e:Event=null){
selectLevel(i);
mc.gotoAndStop(3);
saveGame();
});
mc.icons.gotoAndStop((i + 1));
mc.addEventListener(MouseEvent.ROLL_OVER, function (e:Event=null){
mc.gotoAndStop(2);
});
mc.addEventListener(MouseEvent.MOUSE_UP, function (e:Event=null){
mc.gotoAndStop(2);
});
mc.addEventListener(MouseEvent.ROLL_OUT, function (e:Event=null){
mc.gotoAndStop(1);
});
};
}
public function selectLevel(p:Number){
trace(("displaying level " + p));
selectedLevel = p;
showLevel.showLevel.gotoAndStop(30);
showLevel.showLevel.gotoAndStop(p);
if (levelScores[p] == undefined){
levelScores[p] = 0;
};
showLevel.gotoAndPlay(3);
levelicon.icons.gotoAndStop((p + 1));
}
public function showUpgrades(){
moneyT.text = String(money);
cla = (Player as Class);
maxedStats = 0;
if (((getPrice(mm1, cla.healthTree, cla.healthLevel)) && (getChildByName("u1")))){
removeChild(getChildByName("u1"));
};
if (((getPrice(mm2, cla.mainChargeTree, cla.mainChargeLevel)) && (getChildByName("u2")))){
removeChild(getChildByName("u2"));
};
if (((getPrice(mm3, cla.subChargeTree, cla.subChargeLevel)) && (getChildByName("u3")))){
removeChild(getChildByName("u3"));
};
if (((getPrice(mm4, cla.mainDamageTree, cla.mainDamageLevel)) && (getChildByName("u4")))){
removeChild(getChildByName("u4"));
};
if (((getPrice(mm5, cla.speedTree, cla.speedLevel)) && (getChildByName("u5")))){
removeChild(getChildByName("u5"));
};
if (((getPrice(mm6, cla.magnetTree, cla.magnetLevel)) && (getChildByName("u6")))){
removeChild(getChildByName("u6"));
};
if (((getPrice(mm7, cla.bombTree, cla.bombLevel)) && (getChildByName("u7")))){
removeChild(getChildByName("u7"));
};
s1.text = String(cla.healthTree[cla.healthLevel][0]);
s2.text = String(cla.mainChargeTree[cla.mainChargeLevel][0]);
s3.text = String(cla.subChargeTree[cla.subChargeLevel][0]);
s4.text = String(cla.mainDamageTree[cla.mainDamageLevel][0]);
s5.text = String(cla.speedTree[cla.speedLevel][0]);
s6.text = String(cla.magnetTree[cla.magnetLevel][0]);
le1.text = String(("Level " + cla.healthLevel));
le2.text = String(("Level " + cla.mainChargeLevel));
le3.text = String(("Level " + cla.subChargeLevel));
le4.text = String(("Level " + cla.mainDamageLevel));
le5.text = String(("Level " + cla.speedLevel));
le6.text = String(("Level " + cla.magnetLevel));
le7.text = String(("Level " + cla.bombLevel));
e1.gotoAndStop(11);
e2.gotoAndStop((selectedPlayer + 1));
e3.gotoAndStop((selectedPlayer + 6));
e4.gotoAndStop(12);
e5.gotoAndStop(13);
e6.gotoAndStop(14);
e7.gotoAndStop((selectedPlayer + 15));
}
}
}//package
Section 284
//MedalIcon (MedalIcon)
package {
import flash.display.*;
public dynamic class MedalIcon extends MovieClip {
public var icon:MovieClip;
public function MedalIcon(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 285
//Medals (Medals)
package {
import com.newgrounds.*;
import flash.display.*;
import levels.*;
public class Medals {
public static var level:Level;
public static var locks:Array = [];
public static var current:int = 33;
public static var medals:Array = [{name:"Bronze Badge", desc:"Get A ranks in 5 or more levels.", pic:25}, {name:"Silver Badge", desc:"Get A ranks in 10 or more levels.", pic:26}, {name:"Gold Badge", desc:"Get A ranks in 15 or more levels.", pic:27}, {name:"Platinum Badge", desc:"Get A ranks in 20 or more levels.", pic:28}, {name:"Diamond Badge", desc:"Get A ranks in all 25 levels.", pic:29}, {name:"Pacifism", desc:"Reach wave 33 in Survival without killing anything.", pic:21}, {name:"Mass Murderer", desc:"Kill 1,000 foes in a single game of Survival.", pic:22}, {name:"Perfect Run", desc:"Beat any level between 16 and 20 without taking any damage.", pic:24}, {name:"Shooter", desc:"Kill 300 enemies in total.", pic:1}, {name:"Sniper", desc:"Kill 1000 enemies in total.", pic:2}, {name:"Killer", desc:"Kill 3000 enemies in total.", pic:3}, {name:"Slayer", desc:"Kill 10000 enemies in total.", pic:4}, {name:"Power Up", desc:"Fully upgrade any stat.", pic:19}, {name:"Max Power", desc:"Fully upgrade all stats", pic:17}, {name:"Shields On", desc:"Collect 100 power ups in total.", pic:18}, {name:"Punching Bag", desc:"Get hit 100 times in total.", pic:23}, {name:"Stars Everywhere", desc:"Play 10 levels as NoLegs.", pic:5}, {name:"I Like Swords", desc:"Play 10 levels as Matt.", pic:6}, {name:"Angel Wings", desc:"Play 10 levels as Natalie.", pic:7}, {name:"Pew Pew Pew", desc:"Play 10 levels as Lance.", pic:8}, {name:"Tree Hugger", desc:"Play 10 levels as Anna.", pic:9}, {name:"500k", desc:"Get a score of 500,000 in any level except survival.", pic:31}, {name:"Millionaire", desc:"Get a score of 1,000,000 in any level except survival.", pic:30}, {name:"Gold Farmer", desc:"Finish any level except Survival with over 3,000 coins.", pic:20}, {name:"Boom", desc:"Use a bomb for the first time.", pic:15}, {name:"Ultimate Blade", desc:"Kill 25 enemies instantly.", pic:14}, {name:"Bullet Hell", desc:"Die with over 666 enemy bullets on screen.", pic:11}, {name:"Counter Attack", desc:"Reflect over 100 bullets with a single shield.", pic:12}, {name:"Bullet Master", desc:"Complete all bonus levels.", pic:10}, {name:"The End", desc:"Defeat the final boss and complete the standard set of 20 levels.", pic:32}, {name:"Stray Bullets", desc:"Get killed with no enemies on screen.", pic:13}, {name:"3 Heart Challenge", desc:"Beat the first 20 levels without upgrading your health.", pic:16}];
public static var stats:Object = {kills:0, powerUps:0, damage:0, playerLevels:[0, 0, 0, 0, 0]};
public function Medals(){
super();
}
public static function unlockMedal(medal:String, box:MovieClip=null){
var a:int;
if (level){
level.unlockMedal(medal);
} else {
a = 0;
while (a < medals.length) {
if (medal == medals[a].name){
if (locks[a]){
trace(("Medal already unlocked: " + a));
} else {
locks[a] = true;
current = medals[a].pic;
box.gotoAndPlay(0);
trace(("Unlocking medal: " + a));
API.unlockMedal(medals[a].name);
};
};
a++;
};
};
}
public static function unlockMedalNo(medal:Number){
if (level){
level.unlockMedalNo(medal);
};
}
}
}//package
Section 286
//menuMusic (menuMusic)
package {
import flash.media.*;
public dynamic class menuMusic extends Sound {
public function menuMusic(){
super();
}
}
}//package
Section 287
//NewgroundsAPIAsset_big_popup_background (NewgroundsAPIAsset_big_popup_background)
package {
import flash.display.*;
public dynamic class NewgroundsAPIAsset_big_popup_background extends MovieClip {
public var tl:MovieClip;
public var br:MovieClip;
public var tr:MovieClip;
public var l:MovieClip;
public var shadow:MovieClip;
public var r:MovieClip;
public var b:MovieClip;
public var bl:MovieClip;
public var t:MovieClip;
public var c:MovieClip;
}
}//package
Section 288
//PauseScreen (PauseScreen)
package {
import flash.display.*;
import flash.events.*;
import levels.*;
public class PauseScreen extends MovieClip {
public var tick2:MovieClip;
public var tick3:MovieClip;
public var tick5:MovieClip;
public var tick8:MovieClip;
public var tick9:MovieClip;
public var tick4:MovieClip;
public var tick1:MovieClip;
public var tick6:MovieClip;
public var menu:SimpleButton;
public var b:int;
public var tick7:MovieClip;
public var retry:SimpleButton;
public var tick12:MovieClip;
public function PauseScreen(){
super();
addFrameScript(0, frame1);
getChildByName("menu").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(parent as Level).exitLevel();
});
getChildByName("retry").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(parent as Level).retryLevel();
});
}
function frame1(){
b = 1;
while (b < 10) {
tickenize("tick", b);
b++;
};
tickenize("tick", 12);
}
public function tickenize(m:String, b:int){
var mc:MovieClip;
var m = m;
var b = b;
mc = (getChildByName((m + b)) as MovieClip);
mc.buttonMode = true;
mc.addEventListener(MouseEvent.MOUSE_DOWN, function (e:Event=null){
toggleOption(mc, b);
mc.gotoAndStop(3);
(root as Main).saveGame();
});
mc.addEventListener(MouseEvent.ROLL_OVER, function (e:Event=null){
mc.gotoAndStop(2);
});
mc.addEventListener(MouseEvent.MOUSE_UP, function (e:Event=null){
mc.gotoAndStop(2);
});
mc.addEventListener(MouseEvent.ROLL_OUT, function (e:Event=null){
mc.gotoAndStop(1);
});
if (Global.vars.options[(b - 1)]){
mc.tick.nextFrame();
};
}
public function toggleOption(mc:MovieClip, b:int){
if (mc.tick.currentFrame == 1){
mc.tick.nextFrame();
Global.vars.options[(b - 1)] = true;
trace((("Option " + b) + " is on."));
} else {
if (mc.tick.currentFrame == 2){
mc.tick.prevFrame();
Global.vars.options[(b - 1)] = false;
trace((("Option " + b) + " is off."));
};
};
if (!Global.vars.options[11]){
stage.quality = "low";
} else {
stage.quality = "high";
};
(root as Main).mouse = Global.vars.options[6];
(parent as Level).player.autoMain = Global.vars.options[7];
}
}
}//package
Section 289
//rainMusic (rainMusic)
package {
import flash.media.*;
public dynamic class rainMusic extends Sound {
public function rainMusic(){
super();
}
}
}//package
Section 290
//Shield (Shield)
package {
import flash.display.*;
public class Shield extends MovieClip {
public function Shield(){
super();
}
}
}//package
Section 291
//Sounds (Sounds)
package {
import flash.display.*;
public dynamic class Sounds extends MovieClip {
public function Sounds(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 292
//spaceMusic (spaceMusic)
package {
import flash.media.*;
public dynamic class spaceMusic extends Sound {
public function spaceMusic(){
super();
}
}
}//package
Section 293
//starMusic (starMusic)
package {
import flash.media.*;
public dynamic class starMusic extends Sound {
public function starMusic(){
super();
}
}
}//package
Section 294
//waterMusic (waterMusic)
package {
import flash.media.*;
public dynamic class waterMusic extends Sound {
public function waterMusic(){
super();
}
}
}//package