Section 1
//buyPing_65 (08ng_fla.buyPing_65)
package 08ng_fla {
import flash.display.*;
public dynamic class buyPing_65 extends MovieClip {
public function buyPing_65(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package 08ng_fla
Section 2
//coolSplash_6 (08ng_fla.coolSplash_6)
package 08ng_fla {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class coolSplash_6 extends MovieClip {
public var coolButton:MovieClip;
public function coolSplash_6(){
addFrameScript(0, frame1, 52, frame53);
}
public function goCool(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.coolbuddy.com/"), "_blank");
}
function frame1(){
coolButton.addEventListener(MouseEvent.CLICK, goCool, false, 0, true);
this.buttonMode = true;
}
function frame53(){
coolButton.removeEventListener(MouseEvent.CLICK, goCool);
stop();
MovieClip(parent).gotoAndPlay(9);
}
}
}//package 08ng_fla
Section 3
//creditsBg_47 (08ng_fla.creditsBg_47)
package 08ng_fla {
import flash.display.*;
public dynamic class creditsBg_47 extends MovieClip {
public var gamereclaimButton:MovieClip;
public var stratalesButton:MovieClip;
}
}//package 08ng_fla
Section 4
//dump_8 (08ng_fla.dump_8)
package 08ng_fla {
import flash.display.*;
public dynamic class dump_8 extends MovieClip {
public function dump_8(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package 08ng_fla
Section 5
//endConsol_98 (08ng_fla.endConsol_98)
package 08ng_fla {
import flash.display.*;
public dynamic class endConsol_98 extends MovieClip {
public var mapButton:MovieClip;
public var shopButton:MovieClip;
public var coolButton:MovieClip;
}
}//package 08ng_fla
Section 6
//endConsolRetry_110 (08ng_fla.endConsolRetry_110)
package 08ng_fla {
import flash.display.*;
public dynamic class endConsolRetry_110 extends MovieClip {
public var retryButton:MovieClip;
public var mapButton:MovieClip;
public var shopButton:MovieClip;
public var coolButton:MovieClip;
}
}//package 08ng_fla
Section 7
//failgrassGfx_108 (08ng_fla.failgrassGfx_108)
package 08ng_fla {
import flash.display.*;
public dynamic class failgrassGfx_108 extends MovieClip {
public function failgrassGfx_108(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package 08ng_fla
Section 8
//failMc_112 (08ng_fla.failMc_112)
package 08ng_fla {
import flash.display.*;
public dynamic class failMc_112 extends MovieClip {
public function failMc_112(){
addFrameScript(60, frame61);
}
function frame61(){
stop();
}
}
}//package 08ng_fla
Section 9
//failMcScore_115 (08ng_fla.failMcScore_115)
package 08ng_fla {
import flash.display.*;
import flash.text.*;
public dynamic class failMcScore_115 extends MovieClip {
public var txt:TextField;
public function failMcScore_115(){
addFrameScript(60, frame61);
}
function frame61(){
stop();
}
}
}//package 08ng_fla
Section 10
//failMcTime_105 (08ng_fla.failMcTime_105)
package 08ng_fla {
import flash.display.*;
public dynamic class failMcTime_105 extends MovieClip {
public function failMcTime_105(){
addFrameScript(60, frame61);
}
function frame61(){
stop();
}
}
}//package 08ng_fla
Section 11
//fillupIcon_11 (08ng_fla.fillupIcon_11)
package 08ng_fla {
import flash.display.*;
public dynamic class fillupIcon_11 extends MovieClip {
public var myMask:MovieClip;
}
}//package 08ng_fla
Section 12
//game_76 (08ng_fla.game_76)
package 08ng_fla {
import flash.utils.*;
import flash.display.*;
import dvmClasses.elements.enemies.*;
import com.newgrounds.*;
import flash.events.*;
import com.greensock.*;
import dvmClasses.elements.*;
import dvmClasses.elements.beams.*;
import dvmClasses.elements.bullets.*;
import flash.net.*;
import dvmClasses.math.*;
import dvmClasses.mechanics.*;
import flash.geom.*;
import dvmClasses.gfx.*;
import com.greensock.easing.*;
import dvmClasses.elements.effects.clouds.*;
import dvmClasses.elements.money.*;
import dvmClasses.elements.effects.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class game_76 extends MovieClip {
public var enemyBeams:Array;
public var winTicker:Ticker;
public var pauseScreen:PauseScreen;
public var effectMan:EffectManager;
public var GAME_HEIGHT:uint;
public var shieldDuration:uint;
public var BEAM_VOL:Number;
public var enemies:Array;
public var slomoCharge:uint;
public var healthCharge:uint;
public var displayedScore:uint;
public var shieldLock:Boolean;
public var shieldKey:uint;
public var doubleClick:uint;
public var beamKey:uint;
public var resultsAreIn:Boolean;
public var playerBeams:Array;
public var beamSc:SoundChannel;
public var bombLength:uint;
public var slomoNow:int;
public var sb:MovieClip;
public var beamSt:SoundTransform;
public var myMoney:uint;
public var w:white;
public var timeDiff:uint;
public var sloMoSpell:Number;
public var slomoLocked:Boolean;
public var resultString:String;
public var v:Vault;
public var score:String;
public var moneyMultiplier:uint;
public var slomoLock:Boolean;
public var resultsTicker:Ticker;
public var secondTicker:Ticker;
public var beamNow:uint;
public var lastWave:Boolean;
public var gameMode:uint;
public var heroWeapon:uint;
public var shieldNow:uint;
public var bombNow:uint;
public var bosses:Array;
public var clouds:Array;
public var cLevel:uint;
public var chargeTicker;
public var bombLock:Boolean;
public var isPaused:Boolean;
public var effects:Array;
public var math:gMath;
public var enemyBullets:Array;
public var canUnpause:Boolean;
public var GAME_WIDTH:uint;
public var secondsToEnd:int;
public var haveAll:Boolean;
public var gui:gameGui;
public var COLLISION_DAMAGE:Number;
public var cloudTypes:Array;
public var beamLife:uint;
public var bossHp:BossHp;
public var canvas:Canvas;
public var beamCharge:uint;
public var spawner:Spawner;
public var healthMax:uint;
public var sloMo:Number;
public var beamLock:Boolean;
public var shieldCharge:uint;
public var cMusic:uint;
public var dad:MovieClip;
public var playerBullets:Array;
public var moneyTypes:Array;
public var cloudTicker:Ticker;
public var prevTime:uint;
public var moneys:Array;
public var noGun:Boolean;
public var secondsPassed:uint;
public var shieldTicker:Ticker;
public var taskDivider:uint;
public var costume:uint;
public var slomoKey:uint;
public var hero:Hero;
public var counter:Counter;
public var bombCharge:uint;
public var beamDamage:Number;
public function game_76(){
addFrameScript(0, frame1);
}
public function startSlomo(){
if ((((slomoNow >= 500)) && (!(slomoLock)))){
sloMoSpell = 0.4;
};
}
public function doPause(){
if (isPaused){
if (canUnpause){
isPaused = false;
if (this.contains(pauseScreen)){
dad.deButtonize(pauseScreen.resumeButton, doResume);
dad.deButtonize(pauseScreen.mapButton, quit);
this.removeChild(pauseScreen);
};
dad.mb.unmuteGameMusic();
dad.mButton.visible = false;
Mouse.hide();
stage.focus = canvas;
};
} else {
if (!resultsAreIn){
beamSoundOff();
isPaused = true;
dad.mb.muteGameMusic();
dad.mButton.visible = true;
this.addChild(pauseScreen);
dad.buttonize(pauseScreen.mapButton, quit);
dad.buttonize(pauseScreen.resumeButton, doResume);
pauseScreen.alpha = 1;
TweenLite.from(pauseScreen, 0.5, {alpha:0, ease:Sine.easeOut});
Mouse.show();
};
};
}
public function addEnemyBullets(_arg1:Array){
enemyBullets = enemyBullets.concat(_arg1);
sb.playRandom([5, 6]);
}
public function sloMoImpulse(){
if (slomoLocked){
return;
};
sloMo = 0.3;
slomoLocked = true;
TweenLite.to(this, 4, {sloMo:1, ease:Sine.easeIn, onComplete:unlockSlomo});
}
function frame1(){
stop();
GAME_WIDTH = 800;
GAME_HEIGHT = 550;
BEAM_VOL = 0.9;
myMoney = 0;
haveAll = false;
COLLISION_DAMAGE = 0.5;
pauseScreen = new PauseScreen();
gui = new gameGui();
effectMan = new EffectManager(this);
math = new gMath();
hero = new Hero();
counter = new Counter();
dad = MovieClip(parent);
timeDiff = 0;
secondTicker = new Ticker(1000);
resultsTicker = new Ticker(3500);
secondsPassed = 0;
sloMo = 1;
sloMoSpell = 1;
slomoLocked = false;
prevTime = 0;
taskDivider = 0;
doubleClick = 0;
resultsAreIn = false;
noGun = false;
isPaused = true;
canUnpause = false;
lastWave = false;
winTicker = new Ticker(500);
effects = new Array();
playerBullets = new Array();
enemies = new Array();
bosses = new Array();
enemyBullets = new Array();
playerBeams = new Array();
enemyBeams = new Array();
moneys = new Array();
clouds = new Array();
cloudTypes = new Array(cloud1, cloud2, cloud3);
cloudTicker = new Ticker(4000);
moneyTypes = new Array(money50, money200, money500, money1000, money2000);
chargeTicker = new Ticker(200);
shieldNow = 999;
shieldLock = false;
slomoNow = 999;
slomoLock = false;
beamNow = 1000;
beamLock = false;
bombNow = 999;
bombLock = true;
cLevel = 0;
healthMax = 1000;
healthCharge = 5;
beamDamage = 3;
beamLife = 1500;
shieldKey = 65;
slomoKey = 83;
beamKey = 68;
shieldDuration = 2000;
shieldCharge = 30;
slomoCharge = 20;
beamCharge = 250;
bombCharge = 200;
heroWeapon = 6;
bombLength = 1;
costume = 0;
moneyMultiplier = 1;
gameMode = 0;
secondsToEnd = 5;
score = "§";
displayedScore = 0;
beamSt = new SoundTransform();
v = new Vault();
cMusic = 0;
}
public function quit(_arg1:MouseEvent){
dad.mb.unmuteGameMusic();
dad.deButtonize(pauseScreen.resumeButton, doResume);
dad.deButtonize(pauseScreen.mapButton, quit);
resultsAreIn = true;
resultString = "quit";
checkResults();
}
public function unlockSlomo(){
slomoLocked = false;
trace("slomo over");
}
public function initBossHp(){
if (bossHp){
return;
};
bossHp = new BossHp();
this.addChildAt(bossHp, 2);
bossHp.x = (GAME_WIDTH / 2);
bossHp.y = 20;
}
public function playBeamSfx(_arg1:uint){
var _local2:Array;
_local2 = [0, 0, 1, 2];
trace(_local2[_arg1]);
sb.playGameSound(_local2[_arg1]);
}
public function doKeyDown(_arg1:KeyboardEvent){
switch (_arg1.keyCode){
case shieldKey:
if (!isPaused){
doShield();
};
break;
case slomoKey:
if (((!(isPaused)) && (!(resultsAreIn)))){
startSlomo();
};
break;
case beamKey:
if (!isPaused){
doBeam();
};
break;
case 80:
doPause();
break;
};
}
public function doResume(_arg1:MouseEvent){
doPause();
}
public function beamSoundOn(_arg1:Number=0){
if (_arg1 > 1){
_arg1 = 1;
};
_arg1 = (_arg1 + BEAM_VOL);
beamSt.volume = _arg1;
beamSc.soundTransform = beamSt;
}
public function checkShield(){
if (hero.isShield){
if (shieldTicker.tick(timeDiff)){
hero.offShield();
};
};
}
public function doMouseDown(_arg1:MouseEvent){
if (isPaused){
return;
};
if (doubleClick < 250){
doBomb();
};
doubleClick = 0;
hero.mouseIsDown = true;
}
public function setupCounter(){
if (((((spawner.bossLevel) && ((gameMode == 0)))) || ((cLevel == 15)))){
return;
};
this.addChildAt(counter, 2);
if (gameMode != 0){
counter.nam.text = "seconds left";
};
updateCounter();
}
public function levelResult(_arg1:String){
var _local2:Number;
var _local3:Number;
if (resultsAreIn){
return;
};
_local2 = 0.1;
_local3 = 6;
w = new white();
this.addChildAt(w, (this.getChildIndex(gui) - 1));
w.alpha = 0;
w.mouseEnabled = false;
dad.mb.endFadeOut();
if (((spawner.bossLevel) && ((_arg1 == "complete")))){
_local2 = 1;
_local3 = 8;
};
if (_arg1 == "dead"){
_local3 = 4;
};
TweenLite.to(this, _local3, {sloMoSpell:_local2, ease:Sine.easeOut});
TweenLite.to(w, _local3, {alpha:0.7, ease:Sine.easeOut, onComplete:checkResults});
resultsAreIn = true;
trace("seconds passed: ", secondsPassed);
resultString = _arg1;
switch (_arg1){
case "dead":
trace("game over, health is zero");
w.gotoAndStop(2);
if (cLevel == 15){
if (v.codeToNum(score) > 160000){
ngMedal("Cleaning up");
};
};
return;
case "timeUp":
trace("game over, Time is up");
w.gotoAndStop(2);
return;
case "complete":
trace("level Complete");
if (cLevel == 1){
ngMedal("Warmed Up");
} else {
if (cLevel == 4){
ngMedal("Just Die Already");
} else {
if (cLevel == 8){
ngMedal("Scrap Metal");
} else {
if (cLevel == 11){
ngMedal("Jeweller");
} else {
if (cLevel == 14){
ngMedal("Egg of Fail");
};
};
};
};
};
if (dad.isChalenge){
doKong("challengeCompleted", (dad.cChal + 1));
ngMedal("Adventurous");
if (dad.cChal == 3){
ngMedal("Can't Touch This!");
} else {
if (dad.cChal == 2){
ngMedal("Too Easy");
};
};
} else {
doKong("levelCompleted", (cLevel + 1));
};
w.gotoAndStop(3);
return;
};
}
public function beamSoundOff(){
beamSt.volume = 0;
beamSc.soundTransform = beamSt;
}
public function ngMedal(_arg1:String){
trace("is Newgrounds **********", API.isNewgrounds);
if (API.isNewgrounds){
trace(API.medals);
API.unlockMedal(_arg1);
};
}
public function doBeam(){
var _local1:Beam;
if ((((beamNow == 1000)) && (!(beamLock)))){
beamNow = 0;
_local1 = new Beam(0, 0, 0, (beamDamage / 10), 0.07, 500, beamLife);
trace("beamlife", beamLife);
_local1.turnSpeed = 0.002;
_local1.damage = beamDamage;
trace(beamDamage);
playerBeams.push(_local1);
};
}
public function addClouds(){
var _local1:Class;
var _local2:cloud;
if (cloudTicker.tick(timeDiff)){
cloudTicker.setDelay(math.randomNumber(2000, 3000));
_local1 = math.randomGetFromArray(cloudTypes);
_local2 = new (_local1);
_local2.x = GAME_WIDTH;
_local2.y = (Math.random() * (GAME_HEIGHT - 100));
clouds.push(_local2);
};
}
public function lockLastWave(){
lastWave = true;
}
public function doMouseUp(_arg1:MouseEvent){
hero.mouseIsDown = false;
}
public function initGame(){
var _local1:uint;
trace("INIT");
initBeamSound();
spawner = new Spawner(this, cLevel);
_local1 = spawner.getBgID();
cMusic = spawner.getMusic();
canvas = new Canvas(GAME_WIDTH, (GAME_HEIGHT + 30), _local1);
this.addChild(canvas);
if (noGun){
hero.noGun = true;
};
hero.init(GAME_WIDTH, GAME_HEIGHT, this, costume);
hero.bombLength = bombLength;
hero.health = healthMax;
hero.setShot(heroWeapon);
this.addChild(hero);
this.addChild(gui);
setupCounter();
gui.setLocks(shieldLock, slomoLock, beamLock, bombLock);
gui.setTooltip(dad.so);
this.addEventListener(Event.ENTER_FRAME, doFrame, false, 0, true);
this.canvas.addEventListener(MouseEvent.MOUSE_DOWN, doMouseDown, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, doMouseUp, false, 0, true);
stage.addEventListener(KeyboardEvent.KEY_DOWN, doKeyDown, false, 0, true);
stage.addEventListener(KeyboardEvent.KEY_UP, doKeyUp, false, 0, true);
shieldTicker = new Ticker(shieldDuration);
}
public function updateCounter(_arg1:int=-1){
if (gameMode == 0){
if (_arg1 >= 0){
counter.num.text = String(_arg1);
};
} else {
counter.num.text = String(secondsToEnd);
if (secondsToEnd <= 0){
if (gameMode == 1){
levelResult("complete");
} else {
levelResult("timeUp");
};
};
};
}
public function chargeAbilities(){
if (((!(shieldLock)) && ((shieldNow < 1000)))){
shieldNow = (shieldNow + shieldCharge);
gui.setShield(shieldNow, 1000);
if (shieldNow >= 1000){
shieldNow = 1000;
gui.pingShield();
};
};
if (((!(slomoLock)) && ((slomoNow < 1000)))){
slomoNow = (slomoNow + slomoCharge);
gui.setTime(slomoNow, 1000);
if (slomoNow >= 1000){
slomoNow = 1000;
gui.pingTime();
};
};
if (((!(beamLock)) && ((beamNow < 1000)))){
beamNow = (beamNow + beamCharge);
gui.setBeam(beamNow, 1000);
if (beamNow >= 1000){
beamNow = 1000;
gui.pingBeam();
};
};
if (((!(bombLock)) && ((bombNow < 1000)))){
bombNow = (bombNow + bombCharge);
gui.setBomb(bombNow, 1000);
if (bombNow >= 1000){
bombNow = 1000;
gui.pingBomb();
};
};
if (hero.health < healthMax){
hero.health = (hero.health + healthCharge);
gui.setHealth(hero.health, healthMax);
if (hero.health >= healthMax){
hero.health = healthMax;
};
};
}
public function endSlomo(){
if (!resultsAreIn){
sloMoSpell = 1;
};
}
public function checkSlomo(){
if ((((sloMoSpell < 1)) && (!(resultsAreIn)))){
slomoNow = (slomoNow - (timeDiff / 2));
if (slomoNow <= 0){
slomoNow = 0;
sloMoSpell = 1;
};
};
}
public function doKong(_arg1:String, _arg2:int){
if (dad.kong){
dad.kongregate.stats.submit(_arg1, _arg2);
};
}
public function addEnemyBullet(_arg1:Bullet){
enemyBullets.push(_arg1);
sb.playRandom([5, 6]);
}
public function killEngine(){
beamSc.stop();
this.removeEventListener(Event.ENTER_FRAME, doFrame);
this.canvas.removeEventListener(MouseEvent.MOUSE_DOWN, doMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, doMouseUp);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, doKeyDown);
stage.removeEventListener(KeyboardEvent.KEY_UP, doKeyUp);
}
public function initBeamSound(){
var _local1:Sound;
beamSt.volume = 0;
_local1 = new beamSound03();
beamSc = _local1.play(0, 999999);
beamSc.soundTransform = beamSt;
}
public function doKeyUp(_arg1:KeyboardEvent){
switch (_arg1.keyCode){
case slomoKey:
endSlomo();
break;
};
}
public function doFrame(_arg1:Event){
var _local2:Number;
var _local3:Bullet;
var _local4:uint;
var _local5:enemy;
var _local6:money;
var _local7:boss;
var _local8:uint;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:Beam;
_local2 = 0;
taskDivider++;
taskDivider = (taskDivider % 2);
getTimeDiff();
doubleClick = (doubleClick + timeDiff);
if (isPaused){
return;
};
if (chargeTicker.tick(timeDiff)){
chargeAbilities();
};
if (secondTicker.tick(timeDiff)){
secondsPassed++;
if (secondsToEnd > 0){
secondsToEnd--;
updateCounter();
};
};
checkShield();
checkSlomo();
effectMan.tick(timeDiff);
hero.tick(timeDiff);
spawner.tick(timeDiff, hero.heroSprite.x, hero.heroSprite.y);
addClouds();
canvas.lockCanvas();
canvas.clear();
_local4 = 0;
_local8 = 0;
while (_local8 < clouds.length) {
clouds[_local8].doMove(timeDiff);
canvas.drawAnimable(clouds[_local8]);
if (clouds[_local8].dead){
clouds.splice(_local8, 1);
_local8--;
};
_local8++;
};
_local8 = 0;
while (_local8 < moneys.length) {
_local6 = moneys[_local8];
canvas.drawAnimable(_local6);
_local6.tick(timeDiff);
if (taskDivider == 1){
if (math.boxHitBox(_local6.x, _local6.y, hero.heroSprite.x, hero.heroSprite.y, _local6.hitWidth, _local6.hitHeight, hero.moneyHitWidth, hero.moneyHitHeight)){
myMoney = (myMoney + (_local6.VALUE * moneyMultiplier));
_local6.got = true;
_local6.dead = true;
gui.setMoney(myMoney);
sb.playRandom([3, 7]);
};
};
if (_local6.dead){
if (!_local6.got){
effectMan.addMoneyVanish(_local6.x, _local6.y);
};
moneys.splice(_local8, 1);
_local8--;
};
_local8++;
};
_local8 = 0;
while (_local8 < bosses.length) {
_local7 = bosses[_local8];
canvas.drawBoss(_local7);
_local7.tick(timeDiff, hero.heroSprite.x, hero.heroSprite.y);
_local9 = 0;
while (_local9 < playerBullets.length) {
_local3 = playerBullets[_local9];
if (!_local7.isCircleHit){
if (math.boxHitBox(_local7.x, _local7.y, _local3.x, _local3.y, _local7.hitWidth, _local7.hitHeight, _local3.hitWidth, _local3.hitHeight)){
_local7.takeDamage(_local3.damage);
effectMan.addImpact(_local3.x, _local3.y);
sb.playGameSound(8);
_local3.dead = true;
};
} else {
if (math.circleHit(_local7.x, _local7.y, _local3.x, _local3.y, _local7.hitWidth, _local3.hitWidth)){
_local7.takeDamage(_local3.damage);
effectMan.addImpact(_local3.x, _local3.y);
sb.playGameSound(8);
_local3.dead = true;
};
};
_local9++;
};
if (!_local7.isCircleHit){
if (math.boxHitBox(_local7.x, _local7.y, hero.heroSprite.x, hero.heroSprite.y, _local7.hitWidth, _local7.hitHeight, hero.hitWidth, hero.hitHeight)){
if (_local7.delay <= 0){
hero.takeDamage((_local7.collisionDamage * timeDiff));
};
_local7.takeDamage((COLLISION_DAMAGE * timeDiff));
};
} else {
if (math.circleHit(_local7.x, _local7.y, hero.heroSprite.x, hero.heroSprite.y, _local7.hitWidth, hero.hitWidth)){
if (_local7.delay <= 0){
hero.takeDamage((_local7.collisionDamage * timeDiff));
};
_local7.takeDamage((COLLISION_DAMAGE * timeDiff));
};
};
if (_local7.dead){
effectMan.addExplosionScript(_local7.x, _local7.y, _local7.explosionScript);
spawner.lowerHard(_local7.hardness);
displayedScore = (displayedScore + _local7.score);
score = v.addTo(score, _local7.score);
if (!haveAll){
_local10 = 0;
while (_local10 < _local7.moneyArray.length) {
_local6 = new (moneyTypes[_local7.moneyArray[_local10]]);
_local6.setPos(_local7.x, _local7.y, _local7.hitWidth, _local7.hitHeight);
moneys.push(_local6);
_local10++;
};
};
_local7.dad = null;
sloMoImpulse();
sb.playGameSound(9);
canvas.addGlow(_local7.x, _local7.y);
bosses.splice(_local8, 1);
_local8--;
};
_local8++;
};
_local8 = 0;
while (_local8 < enemies.length) {
_local5 = enemies[_local8];
_local5.animate(timeDiff);
_local5.tick(timeDiff, hero.heroSprite.x, hero.heroSprite.y);
canvas.drawAnimable(_local5);
if (taskDivider == 0){
_local11 = 0;
while (_local11 < playerBullets.length) {
_local3 = playerBullets[_local11];
if (!_local5.isCircleHit){
if (math.boxHitBox(_local5.x, _local5.y, _local3.x, _local3.y, _local5.hitWidth, _local5.hitHeight, _local3.hitWidth, _local3.hitHeight)){
_local5.takeDamage(_local3.damage);
effectMan.addImpact(_local3.x, _local3.y);
sb.playGameSound(8);
_local3.dead = true;
};
} else {
if (math.circleHit(_local5.x, _local5.y, _local3.x, _local3.y, _local5.hitWidth, _local3.hitWidth)){
_local5.takeDamage(_local3.damage);
effectMan.addImpact(_local3.x, _local3.y);
sb.playGameSound(8);
_local3.dead = true;
};
};
_local11++;
};
};
if (!_local5.isCircleHit){
if (math.boxHitBox(_local5.x, _local5.y, hero.heroSprite.x, hero.heroSprite.y, _local5.hitWidth, _local5.hitHeight, hero.hitWidth, hero.hitHeight)){
trace("collisionDamage");
hero.takeDamage((_local5.collisionDamage * timeDiff));
_local5.takeDamage((COLLISION_DAMAGE * timeDiff));
};
} else {
if (math.circleHit(_local5.x, _local5.y, hero.heroSprite.x, hero.heroSprite.y, _local5.hitWidth, hero.hitWidth)){
trace("collisionDamage");
hero.takeDamage((_local5.collisionDamage * timeDiff));
_local5.takeDamage((COLLISION_DAMAGE * timeDiff));
};
};
if (_local5.dead){
displayedScore = (displayedScore + _local5.score);
score = v.addTo(score, _local5.score);
gui.setPoints(displayedScore);
effectMan.addExplosion(_local5.x, _local5.y, math.randomGetFromArray(_local5.explosionType));
spawner.lowerHard(_local5.hardness);
if (!haveAll){
_local12 = 0;
while (_local12 < _local5.moneyArray.length) {
_local6 = new (moneyTypes[_local5.moneyArray[_local12]]);
_local6.setPos(_local5.x, _local5.y, _local5.hitWidth, _local5.hitHeight);
moneys.push(_local6);
_local12++;
};
};
_local5.dad = null;
enemies.splice(_local8, 1);
_local8--;
};
_local8++;
};
_local8 = 0;
while (_local8 < enemyBeams.length) {
_local13 = enemyBeams[_local8];
if (!_local13.isCharging){
_local2 = (_local2 + 0.1);
};
_local4 = _local13.tick(timeDiff, 0, 0, hero.heroSprite.x, hero.heroSprite.y);
if (_local4 > 0){
playBeamSfx(_local4);
};
if (_local13.testAgainstHero(hero.heroSprite.x, hero.heroSprite.y, hero.hitWidth)){
hero.takeDamage((_local13.damage * timeDiff));
};
canvas.drawBeam(_local13);
if (enemyBeams[_local8].dead){
playBeamSfx(3);
enemyBeams.splice(_local8, 1);
_local8--;
};
_local8++;
};
_local8 = 0;
while (_local8 < effects.length) {
effects[_local8].animate(timeDiff);
effects[_local8].moveEffect();
canvas.drawAnimable(effects[_local8]);
if (effects[_local8].dead){
effects.splice(_local8, 1);
_local8--;
};
_local8++;
};
_local8 = 0;
while (_local8 < playerBullets.length) {
playerBullets[_local8].animate(timeDiff);
playerBullets[_local8].doMove(timeDiff);
canvas.drawAnimable(playerBullets[_local8]);
if (playerBullets[_local8].dead){
playerBullets.splice(_local8, 1);
_local8--;
};
_local8++;
};
_local8 = 0;
while (_local8 < enemyBullets.length) {
_local3 = enemyBullets[_local8];
_local3.animate(timeDiff);
_local3.doMove(timeDiff);
canvas.drawAnimable(_local3);
if (taskDivider == 1){
if (math.boxHitBox(_local3.x, _local3.y, hero.heroSprite.x, hero.heroSprite.y, _local3.hitWidth, _local3.hitHeight, hero.hitWidth, hero.hitHeight)){
hero.takeDamage(_local3.damage);
_local3.dead = true;
effectMan.addImpact(_local3.x, _local3.y);
};
};
if (_local3.dead){
enemyBullets.splice(_local8, 1);
_local8--;
};
_local8++;
};
_local8 = 0;
while (_local8 < playerBeams.length) {
_local13 = playerBeams[_local8];
if (!_local13.isCharging){
_local2 = (_local2 + 0.1);
};
_local4 = _local13.tick(timeDiff, hero.heroSprite.x, hero.heroSprite.y, hero.targetX, hero.targetY);
if (_local4 > 0){
playBeamSfx(_local4);
};
_local5 = _local13.testAgainstEnemies(enemies);
_local7 = _local13.testAgainstBosses(bosses);
canvas.drawBeam(_local13);
if (_local5 != null){
_local5.takeDamage((_local13.damage * timeDiff));
};
if (_local7 != null){
_local7.takeDamage((_local13.damage * timeDiff));
};
if (playerBeams[_local8].dead){
playBeamSfx(3);
playerBeams.splice(_local8, 1);
_local8--;
};
_local8++;
};
if (_local2 > 0){
beamSoundOn(_local2);
} else {
beamSoundOff();
};
canvas.unlockCanvas();
checkWin();
}
public function checkWin(){
if (winTicker.tick(timeDiff)){
if (((((lastWave) && ((enemies.length == 0)))) && ((bosses.length == 0)))){
levelResult("complete");
};
};
}
public function updateBossHp(_arg1:int, _arg2:uint){
if (_arg1 < 0){
_arg1 = 0;
};
bossHp.line.scaleX = (_arg1 / _arg2);
}
public function doBomb(){
if (bombNow == 1000){
sb.playGameSound(12);
hero.doBomb();
bombNow = 0;
};
}
public function addEffectsArray(_arg1:Array){
effects = effects.concat(_arg1);
}
public function doShield(){
if (shieldNow == 1000){
shieldNow = 0;
hero.onShield();
sb.playGameSound(11);
};
}
public function checkResults(){
if (resultsAreIn){
killEngine();
dad.mb.stopGameMusic();
trace(resultString);
dad.so.data.money = (dad.so.data.money + myMoney);
Mouse.show();
switch (resultString){
case "dead":
trace("game over, health is zero, going to GameOver");
if (cLevel != 15){
dad.gotoAndStop(85);
} else {
dad.score = score;
doKong("HighScore", v.codeToNum(score));
dad.gotoAndStop(95);
};
return;
case "timeUp":
dad.gotoAndStop(80);
trace("game over, Time is up, going to TimeUp");
return;
case "complete":
trace("level Complete, going to LevelComplete");
if (dad.isChalenge){
dad.gotoAndStop(75);
} else {
if (cLevel == 14){
dad.gotoAndStop(90);
} else {
dad.gotoAndStop(70);
};
};
return;
case "quit":
dad.gotoAndStop(40);
};
};
}
public function getTimeDiff(){
timeDiff = (getTimer() - prevTime);
prevTime = getTimer();
if (timeDiff > 75){
timeDiff = 75;
};
timeDiff = (timeDiff * (sloMo * sloMoSpell));
}
}
}//package 08ng_fla
Section 13
//gameEndMc_89 (08ng_fla.gameEndMc_89)
package 08ng_fla {
import flash.display.*;
public dynamic class gameEndMc_89 extends MovieClip {
public function gameEndMc_89(){
addFrameScript(45, frame46);
}
function frame46(){
stop();
}
}
}//package 08ng_fla
Section 14
//gameEndMcChallenge_102 (08ng_fla.gameEndMcChallenge_102)
package 08ng_fla {
import flash.display.*;
public dynamic class gameEndMcChallenge_102 extends MovieClip {
public function gameEndMcChallenge_102(){
addFrameScript(45, frame46);
}
function frame46(){
stop();
}
}
}//package 08ng_fla
Section 15
//gameEndMcFinal_114 (08ng_fla.gameEndMcFinal_114)
package 08ng_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.geom.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class gameEndMcFinal_114 extends MovieClip {
public function gameEndMcFinal_114(){
addFrameScript(85, frame86, 0x0500, frame1281);
}
function frame86(){
MovieClip(parent).mb.playEnd();
}
function frame1281(){
stop();
}
}
}//package 08ng_fla
Section 16
//keySetupDialogue_40 (08ng_fla.keySetupDialogue_40)
package 08ng_fla {
import flash.display.*;
public dynamic class keySetupDialogue_40 extends MovieClip {
public function keySetupDialogue_40(){
addFrameScript(0, frame1, 9, frame10, 15, frame16, 22, frame23, 52, frame53);
}
function frame10(){
stop();
}
function frame16(){
stop();
}
function frame1(){
stop();
}
function frame23(){
stop();
}
function frame53(){
gotoAndStop(1);
}
}
}//package 08ng_fla
Section 17
//levelButton_50 (08ng_fla.levelButton_50)
package 08ng_fla {
import flash.display.*;
public dynamic class levelButton_50 extends MovieClip {
public var bg:MovieClip;
public var flag:MovieClip;
public var gfx:MovieClip;
public function levelButton_50(){
addFrameScript(0, frame1);
}
function frame1(){
flag.rotation = ((Math.random() * 50) - 25);
bg.rotation = ((Math.random() * 30) - 15);
}
}
}//package 08ng_fla
Section 18
//levelsGfx_52 (08ng_fla.levelsGfx_52)
package 08ng_fla {
import flash.display.*;
public dynamic class levelsGfx_52 extends MovieClip {
public function levelsGfx_52(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package 08ng_fla
Section 19
//MainTimeline (08ng_fla.MainTimeline)
package 08ng_fla {
import flash.utils.*;
import flash.display.*;
import com.newgrounds.*;
import flash.events.*;
import com.greensock.*;
import flash.net.*;
import dvmClasses.math.*;
import dvmClasses.data.*;
import flash.geom.*;
import com.greensock.easing.*;
import flash.media.*;
import CPMStar.*;
import flash.ui.*;
import com.newgrounds.components.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var isKeyInput:Boolean;
public var my_cMenu:ContextMenu;
public var textBubble:MovieClip;
public var ad:DisplayObject;
public var levelDesc:XML;
public var scoreBrowser:ScoreBrowser;
public var outButtons:Array;
public var a:Array;
public var b:campaignHelpBubble;
public var controlsIcon:MovieClip;
public var i:uint;
public var creditsButton:MovieClip;
public var v:Vault;
public var w:white;
public var level00:MovieClip;
public var level02:MovieClip;
public var level03:MovieClip;
public var level04:MovieClip;
public var level05:MovieClip;
public var level06:MovieClip;
public var level07:MovieClip;
public var level01:MovieClip;
public var sgb:MovieClip;
public var shopIcon:MovieClip;
public var level08:MovieClip;
public var level09:MovieClip;
public var level10:MovieClip;
public var level11:MovieClip;
public var level13:MovieClip;
public var level14:MovieClip;
public var level15:MovieClip;
public var CPMStarContentSpotID:String;
public var level12:MovieClip;
public var gameLogo:MovieClip;
public var shopShade:white;
public var beamButtons:Array;
public var cLevel:uint;
public var btimeUpgrade:uint;
public var gameHealth:uint;
public var box02:MovieClip;
public var box03:MovieClip;
public var box01:MovieClip;
public var menuButtons:Array;
public var paramObj:Object;
public var failmc:MovieClip;
public var dialog:MovieClip;
public var apiPath:String;
public var menuButton:MovieClip;
public var eraseButton:MovieClip;
public var healthButtons:Array;
public var controlsButton:MovieClip;
public var endConsol:MovieClip;
public var mb:MovieClip;
public var controlsBg:MovieClip;
public var gameCostume:uint;
public var logo:MovieClip;
public var shopButton:MovieClip;
public var upgrades;
public var kongregate;
public var isChalenge:Boolean;
public var wepButtons:Array;
public var mButton:MovieClip;
public var kong:Boolean;
public var chalButtons:Array;
public var weaponsTab:MovieClip;
public var sb:MovieClip;
public var cChal:uint;
public var cField:uint;
public var btimeButtons:Array;
public var isMuted:Boolean;
public var so:SharedObject;
public var tf:TextFormat;
public var shieldUpgrade:uint;
public var swaveUpgrade:uint;
public var score:String;
public var chalXML:XML;
public var adBox:MovieClip;
public var showScoreTimer:Timer;
public var moneyTab:MovieClip;
public var continueButton:MovieClip;
public var fakeCount:uint;
public var waitTimer:Timer;
public var chal0:MovieClip;
public var chal1:MovieClip;
public var chal2:MovieClip;
public var chal4:MovieClip;
public var chal5:MovieClip;
public var chal6:MovieClip;
public var chal7:MovieClip;
public var chal8:MovieClip;
public var chal3:MovieClip;
public var ww:MovieClip;
public var math:gMath;
public var percentText:TextField;
public var helpBubble:MovieClip;
public var levelButtons:Array;
public var beamUpgrade:uint;
public var upXML:upgradesXML;
public var playButton:MovieClip;
public var mapButton:MovieClip;
public var upgradeTab:MovieClip;
public var coolButton:MovieClip;
public var shieldButtons:Array;
public var text01:TextField;
public var text02:TextField;
public var text03:TextField;
public var game:MovieClip;
public var swaveButtons:Array;
public var cWep:uint;
public function MainTimeline(){
addFrameScript(1, frame2, 3, frame4, 9, frame10, 19, frame20, 29, frame30, 39, frame40, 49, frame50, 59, frame60, 60, frame61, 69, frame70, 74, frame75, 79, frame80, 84, frame85, 89, frame90, 94, frame95);
}
public function loadComplete(_arg1:Event):void{
if (kong){
kongregate = _arg1.target.content;
kongregate.services.connect();
};
}
public function buyWeapon(_arg1:MouseEvent){
var _local2:uint;
var _local3:uint;
_local2 = uint(_arg1.currentTarget.name.charAt(3));
_local3 = uint(upgrades.weapons.child(_local2).price);
if (so.data.weapons[_local2]){
so.data.cWeapon = _local2;
sb.playGameSound(21);
} else {
if (_local3 <= so.data.money){
sb.playGameSound(18);
sb.playGameSound(21);
so.data.weapons[_local2] = 1;
so.data.cWeapon = _local2;
so.data.money = (so.data.money - _local3);
doKong("gunBought", _local2);
};
};
textBubble.setText(getBubbleText(_arg1.currentTarget.name), mouseX, mouseY);
updateButtons();
}
function frame10(){
stop();
stage.stageFocusRect = false;
paramObj = LoaderInfo(root.loaderInfo).parameters;
apiPath = ((paramObj.kongregate_api_path) || ("http://www.kongregate.com/flash/API_AS3_Local.swf"));
math = new gMath();
isChalenge = false;
cLevel = 0;
cChal = 0;
score = "";
v = new Vault();
isMuted = false;
so = SharedObject.getLocal("dvm2_08");
initSo();
kong = false;
if (String(root.loaderInfo.loaderURL).indexOf("chat.kongregate.com") != -1){
kong = true;
initKong();
};
stage.frameRate = 30;
textBubble.visible = false;
upXML = new upgradesXML();
upgrades = upXML.getXML();
upXML = null;
levelDesc = new levelDescriptionsXML().getXML();
chalXML = new challengesXML().getXML();
buttonize(mButton, doMute);
stop();
mb.playMenu();
stage.frameRate = 30;
buttonize(eraseButton, delSo);
menuButtons = [playButton, controlsButton, coolButton, creditsButton];
TweenLite.from(gameLogo, 0.7, {y:-140, ease:Bounce.easeOut});
i = 0;
while (i < (menuButtons.length - 1)) {
TweenLite.from(menuButtons[i], 0.5, {y:"300", ease:Strong.easeOut, delay:(0.3 + (i * 0.1))});
i++;
};
TweenLite.from(menuButtons[i], 0.5, {y:"300", ease:Strong.easeOut, delay:(0.3 + (i * 0.1)), onComplete:buttonizeMenu});
sb.playRandom([13, 14, 15]);
}
public function goCool(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.coolbuddy.com/"), "_blank");
}
public function popWhite(){
w = new white();
this.addChild(w);
trace("poppin");
TweenLite.to(w, 2, {alpha:0, ease:Strong.easeOut, onComplete:eraseWhite});
}
function frame2(){
CPMStarContentSpotID = "7362Q4273FDD0";
if (String(root.loaderInfo.loaderURL).indexOf("chat.kongregate.com") == -1){
ad = new AdLoader(CPMStarContentSpotID);
adBox.addChild(ad);
};
my_cMenu = new ContextMenu();
my_cMenu.hideBuiltInItems();
contextMenu = my_cMenu;
continueButton.visible = false;
API.addEventListener(APIEvent.API_CONNECTED, onAPIConnected);
API.connect(root, "25909:35MEISwb", "90eOOovF1Muf9Vv3qviexDhvJh9nqa6o");
stop();
waitTimer = new Timer(500);
this.addEventListener(Event.ENTER_FRAME, doPreload);
waitTimer.addEventListener(TimerEvent.TIMER, proceed);
TweenLite.from(logo, 1, {y:-132, ease:Elastic.easeOut});
TweenLite.from(coolButton, 1, {y:"80", ease:Strong.easeOut});
TweenLite.from(percentText, 1, {y:"60", ease:Elastic.easeOut});
tf = new TextFormat();
tf.letterSpacing = -3;
fakeCount = 0;
coolButton.addEventListener(MouseEvent.CLICK, goCool, false, 0, true);
coolButton.buttonMode = true;
continueButton.addEventListener(MouseEvent.CLICK, doContinue, false, 0, true);
continueButton.buttonMode = true;
}
function frame20(){
stop();
TweenLite.from(controlsIcon, 0.5, {y:"-200", ease:Strong.easeOut});
TweenLite.from(controlsBg, 0.5, {scaleX:1.1, scaleY:1.1, ease:Strong.easeOut});
isKeyInput = false;
cField = 0;
buttonize(box01, addKey);
buttonize(box02, addKey);
buttonize(box03, addKey);
buttonize(menuButton, leaveKeySetup);
updateKeys();
stage.addEventListener(KeyboardEvent.KEY_DOWN, doKeyDown, false, 0, true);
}
public function hideBubble(_arg1:MouseEvent){
if (!textBubble){
return;
};
textBubble.visible = false;
}
public function handleSGClick(_arg1:MouseEvent){
if (a.length > 0){
showNextTip();
} else {
this.removeChild(sgb);
sgb = null;
game.isPaused = false;
game.canUnpause = true;
stage.focus = game.canvas;
Mouse.hide();
mb.playFromTrack(game.cMusic);
trace("game.cMusic", game.cMusic);
};
}
function frame4(){
stage.frameRate = 20;
}
function frame30(){
stop();
TweenLite.from(controlsIcon, 0.5, {y:"-200", ease:Strong.easeOut});
TweenLite.from(controlsBg, 0.5, {scaleX:1.1, scaleY:1.1, ease:Strong.easeOut});
buttonize(menuButton, navigate);
buttonize(controlsBg.gamereclaimButton, navigate);
buttonize(controlsBg.stratalesButton, navigate);
}
public function buyCostume(_arg1:MouseEvent){
var _local2:uint;
var _local3:uint;
_local2 = uint(_arg1.currentTarget.name.charAt(3));
_local3 = uint(upgrades.outfits.child(_local2).price);
if (so.data.costumes[_local2]){
so.data.costume = _local2;
sb.playGameSound(20);
} else {
if (_local3 <= so.data.money){
sb.playGameSound(18);
sb.playGameSound(20);
so.data.costumes[_local2] = 1;
so.data.costume = _local2;
doKong("outfitBought", (_local2 + 1));
so.data.money = (so.data.money - _local3);
};
};
textBubble.setText(getBubbleText(_arg1.currentTarget.name), mouseX, mouseY);
updateButtons();
}
public function doKeyDown(_arg1:KeyboardEvent){
var _local2:Array;
var _local3:String;
var _local4:String;
if (!isKeyInput){
return;
};
_local2 = [text01, text02, text03];
_local3 = String.fromCharCode(_arg1.charCode);
_local4 = checkArrows(_arg1.keyCode);
if (_local4 != ""){
_local3 = _local4;
};
if (checkBannedKeyCode(_arg1.keyCode)){
dialog.gotoAndPlay(11);
return;
};
if (checkSameKeys(_local3.toUpperCase(), cField)){
dialog.gotoAndPlay(17);
return;
};
_local2[cField].text = (so.data.keys[cField][1] = _local3.toUpperCase());
so.data.keys[cField][0] = _arg1.keyCode;
isKeyInput = false;
dialog.gotoAndPlay(35);
trace(_arg1.keyCode, String.fromCharCode(_arg1.charCode));
}
public function checkSameKeys(_arg1:String, _arg2:uint=0){
var _local3:Boolean;
var _local4:uint;
_local3 = false;
_local4 = 0;
while (_local4 < so.data.keys.length) {
if ((((so.data.keys[_local4][1] == _arg1)) && (!((_arg2 == _local4))))){
_local3 = true;
};
_local4++;
};
return (_local3);
}
public function proceed(_arg1:TimerEvent){
waitTimer.stop();
waitTimer.removeEventListener(TimerEvent.TIMER, proceed);
waitTimer = null;
this.removeEventListener(Event.ENTER_FRAME, doPreload);
coolButton.removeEventListener(MouseEvent.CLICK, goCool);
continueButton.visible = true;
percentText.visible = false;
}
public function playLevel(_arg1:MouseEvent){
ridHelp();
isChalenge = false;
cLevel = uint(deZero(_arg1.currentTarget.name.slice(5)));
gotoAndPlay(59);
}
public function checkArrows(_arg1:uint){
var _local2:String;
_local2 = "";
switch (_arg1){
case 37:
_local2 = "LEFT ARROW";
break;
case 38:
_local2 = "UP ARROW";
break;
case 39:
_local2 = "RIGHT ARROW";
break;
case 40:
_local2 = "DOWN ARROW";
break;
};
return (_local2);
}
function frame40(){
mButton.visible = true;
mb.playMenu();
buttonize(menuButton, navigate);
buttonize(coolButton, navigate);
TweenLite.from(shopButton, 0.3, {x:"200", ease:Strong.easeOut, onComplete:buttonize, onCompleteParams:[shopButton, navigate]});
levelButtons = [level00, level01, level02, level03, level04, level05, level06, level07, level08, level09, level10, level11, level12, level13, level14, level15];
chalButtons = [chal0, chal1, chal2, chal3, chal4, chal5, chal6, chal7, chal8];
updateLevels();
updateChallenges();
ww.mouseEnabled = false;
ww.mouseChildren = false;
}
public function buyUpgrade(_arg1:MouseEvent){
var _local2:String;
var _local3:uint;
var _local4:uint;
if (_arg1.currentTarget.locked){
return;
};
_local2 = _arg1.currentTarget.name;
trace(_local2);
if (_local2.indexOf("health") != -1){
_local3 = int(_local2.charAt(6));
_local4 = uint(upgrades.health.child((_local3 + 1)).price);
trace(_local3);
if (_local4 <= so.data.money){
sb.playGameSound(18);
so.data.healthUpgrade = (so.data.healthUpgrade + 1);
so.data.money = (so.data.money - _local4);
_arg1.currentTarget.buyPing.gotoAndPlay(2);
doKong("healthUpgradeBought", (_local3 + 1));
};
} else {
if (_local2.indexOf("beam") != -1){
_local3 = int(_local2.charAt(4));
_local4 = uint(upgrades.beam.child(_local3).price);
trace(_local3);
if (_local4 <= so.data.money){
sb.playGameSound(18);
so.data.beamUpgrade = (so.data.beamUpgrade + 1);
so.data.money = (so.data.money - _local4);
_arg1.currentTarget.buyPing.gotoAndPlay(2);
doKong("beamUpgradeBought", (_local3 + 1));
};
} else {
if (_local2.indexOf("shield") != -1){
_local3 = int(_local2.charAt(6));
_local4 = uint(upgrades.shield.child(_local3).price);
trace(_local3);
if (_local4 <= so.data.money){
sb.playGameSound(18);
so.data.shieldUpgrade = (so.data.shieldUpgrade + 1);
so.data.money = (so.data.money - _local4);
_arg1.currentTarget.buyPing.gotoAndPlay(2);
doKong("shieldUpgradeBought", (_local3 + 1));
};
} else {
if (_local2.indexOf("btime") != -1){
_local3 = int(_local2.charAt(5));
_local4 = uint(upgrades.btime.child(_local3).price);
trace(_local3);
if (_local4 <= so.data.money){
sb.playGameSound(18);
so.data.btimeUpgrade = (so.data.btimeUpgrade + 1);
so.data.money = (so.data.money - _local4);
_arg1.currentTarget.buyPing.gotoAndPlay(2);
doKong("bullettimeUpgradeBought", (_local3 + 1));
};
} else {
if (_local2.indexOf("swave") != -1){
_local3 = int(_local2.charAt(5));
_local4 = uint(upgrades.swave.child(_local3).price);
trace(_local3);
if (_local4 <= so.data.money){
sb.playGameSound(18);
so.data.swaveUpgrade = (so.data.swaveUpgrade + 1);
so.data.money = (so.data.money - _local4);
_arg1.currentTarget.buyPing.gotoAndPlay(2);
doKong("shockwaveUpgradeBought", (_local3 + 1));
};
};
};
};
};
};
updateButtons();
}
function frame50(){
mButton.visible = true;
mb.playMenu();
TweenLite.from(upgradeTab, 1, {x:-186, ease:Strong.easeOut});
TweenLite.from(weaponsTab, 1, {x:980, ease:Strong.easeOut});
TweenLite.from(moneyTab, 1, {y:220, ease:Strong.easeOut});
TweenLite.to(shopShade, 2, {alpha:0.4, ease:Strong.easeOut});
TweenLite.from(mapButton, 0.3, {x:"-200", ease:Strong.easeOut, onComplete:buttonize, onCompleteParams:[mapButton, navigate]});
TweenLite.from(shopIcon, 0.5, {y:"-200", ease:Strong.easeOut});
buttonize(upgradeTab.likeButton, navigate);
buttonize(upgradeTab.health0, buyUpgrade, true, [19]);
buttonize(upgradeTab.health1, buyUpgrade, true, [19]);
buttonize(upgradeTab.health2, buyUpgrade, true, [19]);
buttonize(upgradeTab.health3, buyUpgrade, true, [19]);
buttonize(upgradeTab.health4, buyUpgrade, true, [19]);
buttonize(upgradeTab.beam0, buyUpgrade, true, [19]);
buttonize(upgradeTab.beam1, buyUpgrade, true, [19]);
buttonize(upgradeTab.beam2, buyUpgrade, true, [19]);
buttonize(upgradeTab.beam3, buyUpgrade, true, [19]);
buttonize(upgradeTab.beam4, buyUpgrade, true, [19]);
buttonize(upgradeTab.shield0, buyUpgrade, true, [19]);
buttonize(upgradeTab.shield1, buyUpgrade, true, [19]);
buttonize(upgradeTab.shield2, buyUpgrade, true, [19]);
buttonize(upgradeTab.shield3, buyUpgrade, true, [19]);
buttonize(upgradeTab.shield4, buyUpgrade, true, [19]);
buttonize(upgradeTab.btime0, buyUpgrade, true, [19]);
buttonize(upgradeTab.btime1, buyUpgrade, true, [19]);
buttonize(upgradeTab.btime2, buyUpgrade, true, [19]);
buttonize(upgradeTab.swave0, buyUpgrade, true, [19]);
buttonize(upgradeTab.swave1, buyUpgrade, true, [19]);
buttonize(upgradeTab.swave2, buyUpgrade, true, [19]);
buttonize(upgradeTab.swave3, buyUpgrade, true, [19]);
buttonize(upgradeTab.swave4, buyUpgrade, true, [19]);
buttonize(weaponsTab.wep0, buyWeapon, true, [19]);
buttonize(weaponsTab.wep1, buyWeapon, true, [19]);
buttonize(weaponsTab.wep2, buyWeapon, true, [19]);
buttonize(weaponsTab.wep3, buyWeapon, true, [19]);
buttonize(weaponsTab.wep4, buyWeapon, true, [19]);
buttonize(weaponsTab.wep5, buyWeapon, true, [19]);
buttonize(weaponsTab.wep6, buyWeapon, true, [19]);
buttonize(weaponsTab.out0, buyCostume, true, [19]);
buttonize(weaponsTab.out1, buyCostume, true, [19]);
buttonize(weaponsTab.out2, buyCostume, true, [19]);
buttonize(weaponsTab.out3, buyCostume, true, [19]);
buttonize(weaponsTab.out4, buyCostume, true, [19]);
healthButtons = [upgradeTab.health0, upgradeTab.health1, upgradeTab.health2, upgradeTab.health3, upgradeTab.health4];
beamButtons = [upgradeTab.beam0, upgradeTab.beam1, upgradeTab.beam2, upgradeTab.beam3, upgradeTab.beam4];
shieldButtons = [upgradeTab.shield0, upgradeTab.shield1, upgradeTab.shield2, upgradeTab.shield3, upgradeTab.shield4];
btimeButtons = [upgradeTab.btime0, upgradeTab.btime1, upgradeTab.btime2];
swaveButtons = [upgradeTab.swave0, upgradeTab.swave1, upgradeTab.swave2, upgradeTab.swave3, upgradeTab.swave4];
wepButtons = [weaponsTab.wep0, weaponsTab.wep1, weaponsTab.wep2, weaponsTab.wep3, weaponsTab.wep4, weaponsTab.wep5, weaponsTab.wep6];
outButtons = [weaponsTab.out0, weaponsTab.out1, weaponsTab.out2, weaponsTab.out3, weaponsTab.out4];
updateButtons();
}
function frame60(){
trace("dsds");
mButton.visible = false;
}
function frame61(){
stop();
stage.frameRate = 60;
a = [];
game.sb = sb;
mb.stopMenu();
beamUpgrade = so.data.beamUpgrade;
shieldUpgrade = so.data.shieldUpgrade;
btimeUpgrade = so.data.btimeUpgrade;
swaveUpgrade = so.data.swaveUpgrade;
cWep = so.data.cWeapon;
gameHealth = uint(upgrades.health.child(so.data.healthUpgrade).max);
gameCostume = so.data.costume;
if (isChalenge){
if (int(chalXML.child(cChal).health) > 0){
gameHealth = uint(chalXML.child(cChal).health);
};
cLevel = uint(chalXML.child(cChal).level);
game.gameMode = uint(chalXML.child(cChal).gameMode);
game.secondsToEnd = uint(chalXML.child(cChal).time);
if (uint(chalXML.child(cChal).noGun) == 1){
game.noGun = true;
};
if (int(chalXML.child(cChal).weapon) >= 0){
cWep = uint(chalXML.child(cChal).weapon);
};
if (int(chalXML.child(cChal).costume) >= 0){
gameCostume = uint(chalXML.child(cChal).costume);
};
if (int(chalXML.child(cChal).shield) >= 0){
shieldUpgrade = uint(chalXML.child(cChal).shield);
};
if (int(chalXML.child(cChal).btime) >= 0){
btimeUpgrade = uint(chalXML.child(cChal).btime);
};
if (int(chalXML.child(cChal).beam) >= 0){
beamUpgrade = uint(chalXML.child(cChal).beam);
};
if (int(chalXML.child(cChal).swave) >= 0){
swaveUpgrade = uint(chalXML.child(cChal).swave);
};
};
game.shieldKey = so.data.keys[0][0];
game.slomoKey = so.data.keys[1][0];
game.beamKey = so.data.keys[2][0];
game.heroWeapon = cWep;
game.healthMax = gameHealth;
trace(gameHealth);
game.healthCharge = uint(upgrades.health.child(so.data.healthUpgrade).charge);
game.costume = gameCostume;
if (beamUpgrade == 0){
game.beamLock = true;
} else {
game.beamLock = false;
game.beamDamage = uint(upgrades.beam.child((beamUpgrade - 1)).damage);
game.beamCharge = uint(upgrades.beam.child((beamUpgrade - 1)).charge);
game.beamLife = uint(upgrades.beam.child((beamUpgrade - 1)).duration);
trace("beamlife", game.beamLife);
};
if (shieldUpgrade == 0){
game.shieldLock = true;
} else {
game.shieldLock = false;
game.shieldDuration = uint(upgrades.shield.child((shieldUpgrade - 1)).duration);
game.shieldCharge = uint(upgrades.shield.child((shieldUpgrade - 1)).charge);
};
if (btimeUpgrade == 0){
game.slomoLock = true;
} else {
game.slomoLock = false;
game.slomoCharge = uint(upgrades.btime.child((btimeUpgrade - 1)).charge);
};
if (swaveUpgrade == 0){
game.bombLock = true;
} else {
game.bombLock = false;
game.bombCharge = uint(upgrades.swave.child((swaveUpgrade - 1)).charge);
game.bombLength = uint(upgrades.swave.child((swaveUpgrade - 1)).power);
};
switch (gameCostume){
case 0:
break;
case 1:
game.moneyMultiplier = 2;
break;
case 2:
game.healthMax = (game.healthMax + 500);
break;
case 3:
if (beamUpgrade != 6){
game.beamLife = (game.beamLife * 2);
};
break;
case 4:
game.COLLISION_DAMAGE = (game.COLLISION_DAMAGE * 20);
break;
};
game.haveAll = checkHaveAll();
game.cLevel = cLevel;
popWhite();
popStartGameBubble();
game.initGame();
}
public function buttonize(_arg1:MovieClip, _arg2:Function, _arg3:Boolean=false, _arg4:Array=null){
_arg1.addEventListener(MouseEvent.CLICK, _arg2, false, 0, true);
if (!_arg1.fixScale){
_arg1.fixScale = _arg1.scaleX;
};
_arg1.buttonMode = true;
_arg1.addEventListener(MouseEvent.MOUSE_OVER, buttonScaleAnimIn, false, 0, true);
_arg1.addEventListener(MouseEvent.MOUSE_OUT, buttonScaleAnimOut, false, 0, true);
_arg1.addEventListener(MouseEvent.CLICK, buttonScaleClickAnim, false, 0, true);
if (_arg3){
_arg1.addEventListener(MouseEvent.MOUSE_OVER, showBubble, false, 0, true);
_arg1.addEventListener(MouseEvent.MOUSE_OUT, hideBubble, false, 0, true);
_arg1.addEventListener(MouseEvent.MOUSE_MOVE, moveBubble, false, 0, true);
};
if (_arg4 == null){
_arg4 = [13, 14, 15, 16, 17];
};
_arg1.sfxArray = _arg4;
}
public function checkHaveAll(){
var _local1:Boolean;
var _local2:uint;
_local1 = true;
if (so.data.healthUpgrade < 5){
_local1 = false;
};
if (so.data.beamUpgrade < 5){
_local1 = false;
};
if (so.data.shieldUpgrade < 5){
_local1 = false;
};
if (so.data.btimeUpgrade < 3){
_local1 = false;
};
if (so.data.swaveUpgrade < 5){
_local1 = false;
};
_local2 = 0;
while (_local2 < so.data.weapons.length) {
if (so.data.weapons[_local2] == 0){
_local1 = false;
};
_local2++;
};
_local2 = 0;
while (_local2 < so.data.costumes.length) {
if (so.data.costumes[_local2] == 0){
_local1 = false;
};
_local2++;
};
return (_local1);
}
function frame70(){
stage.frameRate = 30;
mButton.visible = true;
if (((((cLevel - 1) == so.data.level)) && ((cLevel < 15)))){
so.data.level++;
};
buttonize(endConsol.mapButton, navigate);
buttonize(endConsol.shopButton, navigate);
buttonize(endConsol.coolButton, navigate);
TweenLite.from(endConsol, 0.5, {y:"100", ease:Strong.easeOut});
}
function frame75(){
stage.frameRate = 30;
mButton.visible = true;
buttonize(endConsol.mapButton, navigate);
buttonize(endConsol.shopButton, navigate);
buttonize(endConsol.coolButton, navigate);
TweenLite.from(endConsol, 0.5, {y:"100", ease:Strong.easeOut});
if (so.data.chalenges[cChal] == 0){
so.data.chalenges[cChal] = 1;
so.data.money = (so.data.money + uint(chalXML.child(cChal).prize));
};
}
public function setVol(_arg1:Number):void{
SoundMixer.soundTransform = new SoundTransform(_arg1);
}
public function eraseWhite(){
if (this.contains(w)){
removeChild(w);
};
w = null;
}
function frame80(){
stage.frameRate = 30;
mButton.visible = true;
buttonize(endConsol.mapButton, navigate);
buttonize(endConsol.shopButton, navigate);
buttonize(endConsol.retryButton, navigate);
buttonize(endConsol.coolButton, navigate);
TweenLite.from(endConsol, 0.5, {y:"100", ease:Strong.easeOut});
}
function frame85(){
stage.frameRate = 30;
mButton.visible = true;
buttonize(endConsol.mapButton, navigate);
buttonize(endConsol.shopButton, navigate);
buttonize(endConsol.retryButton, navigate);
buttonize(endConsol.coolButton, navigate);
TweenLite.from(endConsol, 0.5, {y:"100", ease:Strong.easeOut});
}
public function doMute(_arg1:MouseEvent=null){
if (!mButton){
return;
};
if (isMuted){
mButton.gotoAndStop(1);
setVol(1);
isMuted = false;
} else {
mButton.gotoAndStop(2);
setVol(0);
isMuted = true;
};
}
function frame95(){
stage.frameRate = 30;
mButton.visible = true;
buttonize(endConsol.mapButton, navigate);
buttonize(endConsol.retryButton, navigate);
buttonize(endConsol.shopButton, navigate);
buttonize(endConsol.coolButton, navigate);
TweenLite.from(endConsol, 0.5, {y:"100", ease:Strong.easeOut});
showScoreTimer = new Timer(3000);
showScoreTimer.addEventListener(TimerEvent.TIMER, showScores, false, 0, true);
failmc.txt.text = (addComas(String(v.codeToNum(score))) + "\npoints");
if (!kong){
API.postScore("Death vs Monstars 2 highscores", v.codeToNum(score));
showScoreTimer.start();
};
TweenLite.to(failmc.txt, 0.5, {y:145, ease:Strong.easeOut, delay:1.5});
}
public function addComas(_arg1:String){
var _local2:Array;
_local2 = new Array();
while (3 < _arg1.length) {
_local2.push(_arg1.slice((_arg1.length - 3), _arg1.length));
_arg1 = _arg1.slice(0, (_arg1.length - 3));
};
while (_local2.length > 0) {
_arg1 = (_arg1 + ("," + _local2.pop()));
};
return (_arg1);
}
function frame90(){
stage.frameRate = 30;
mButton.visible = true;
buttonize(endConsol.mapButton, navigate);
buttonize(endConsol.shopButton, navigate);
buttonize(endConsol.coolButton, navigate);
TweenLite.from(endConsol, 0.5, {y:"100", ease:Strong.easeOut});
if (((((cLevel - 1) == so.data.level)) && ((cLevel < 15)))){
so.data.level++;
};
}
public function deButtonize(_arg1:MovieClip, _arg2:Function, _arg3:Boolean=false){
if (!_arg1){
return;
};
_arg1.removeEventListener(MouseEvent.CLICK, _arg2);
TweenLite.killTweensOf(_arg1);
_arg1.scaleX = _arg1.fixScale;
_arg1.scaleY = _arg1.fixScale;
_arg1.removeEventListener(MouseEvent.MOUSE_OVER, buttonScaleAnimIn);
_arg1.removeEventListener(MouseEvent.MOUSE_OUT, buttonScaleAnimOut);
_arg1.removeEventListener(MouseEvent.CLICK, buttonScaleClickAnim);
if (_arg3){
_arg1.removeEventListener(MouseEvent.MOUSE_OVER, showBubble);
_arg1.removeEventListener(MouseEvent.MOUSE_OUT, hideBubble);
_arg1.removeEventListener(MouseEvent.MOUSE_MOVE, moveBubble);
};
}
public function floatBack(_arg1:MovieClip){
if (!_arg1){
return;
};
TweenLite.to(_arg1, 1, {y:"+10", ease:Sine.easeInOut, onComplete:makeItFloat, onCompleteParams:[_arg1]});
}
public function buttonScaleClickAnim(_arg1:MouseEvent){
var _local2:MovieClip;
_local2 = MovieClip(_arg1.currentTarget);
if (_local2.locked){
return;
};
sb.playRandom(_arg1.currentTarget.sfxArray);
_local2.scaleX = (_local2.scaleY = (0.95 * _local2.fixScale));
TweenLite.to(_local2, 0.5, {scaleX:(_local2.fixScale * 1.1), scaleY:(1.1 * _local2.fixScale), ease:Strong.easeOut});
}
public function buttonizeMenu(){
buttonize(playButton, navigate);
buttonize(controlsButton, navigate);
buttonize(coolButton, navigate);
buttonize(creditsButton, navigate);
}
public function showScores(_arg1:TimerEvent){
showScoreTimer.stop();
showScoreTimer.removeEventListener(TimerEvent.TIMER, showScores);
if (currentFrame != 95){
return;
};
scoreBrowser = new ScoreBrowser();
scoreBrowser.scoreBoardName = "Death vs Monstars 2 highscores";
scoreBrowser.period = ScoreBoard.ALL_TIME;
scoreBrowser.loadScores();
failmc.addChild(scoreBrowser);
scoreBrowser.x = 240;
scoreBrowser.y = 85;
TweenLite.from(scoreBrowser, 0.5, {y:"-200", ease:Strong.easeOut});
}
public function doKong(_arg1:String, _arg2:int){
if (kong){
kongregate.stats.submit(_arg1, _arg2);
};
}
public function onAPIConnected(_arg1:APIEvent):void{
if (_arg1.success){
trace("The API is connected and ready to use!");
} else {
trace(("Error connecting to the API: " + _arg1.error));
};
}
public function navigate(_arg1:MouseEvent){
switch (_arg1.currentTarget.name){
case "mapButton":
case "playButton":
ridHelp();
gotoAndStop(40);
break;
case "menuButton":
ridHelp();
gotoAndStop(10);
break;
case "controlsButton":
gotoAndStop(20);
break;
case "creditsButton":
gotoAndStop(30);
break;
case "shopButton":
ridHelp();
gotoAndStop(50);
break;
case "coolButton":
case "coolButton2":
navigateToURL(new URLRequest("http://www.coolbuddy.com/"), "_blank");
break;
case "retryButton":
gotoAndPlay(59);
break;
case "gamereclaimButton":
navigateToURL(new URLRequest("http://www.gamereclaim.com/"), "_blank");
break;
case "stratalesButton":
navigateToURL(new URLRequest("http://stratales.newgrounds.com/"), "_blank");
break;
case "likeButton":
navigateToURL(new URLRequest("https://www.facebook.com/pages/Coolbuddy-Games/177306910591"), "_blank");
break;
};
}
public function showBubble(_arg1:MouseEvent){
var _local2:MovieClip;
_local2 = MovieClip(_arg1.currentTarget);
if (_local2.locked){
return;
};
textBubble.setText(getBubbleText(_arg1.currentTarget.name), mouseX, mouseY);
textBubble.visible = true;
textBubble.alpha = 0;
TweenLite.to(textBubble, 0.5, {alpha:1, ease:Strong.easeOut});
}
public function playChalenge(_arg1:MouseEvent){
isChalenge = true;
cChal = uint(_arg1.currentTarget.name.slice(4));
gotoAndPlay(59);
}
public function ridHelp(){
if (b){
this.removeChild(b);
b = null;
};
}
public function addKey(_arg1:MouseEvent=null){
var _local2:MovieClip;
if (isKeyInput){
dialog.gotoAndPlay(2);
return;
};
_local2 = MovieClip(_arg1.currentTarget);
dialog.y = _local2.y;
dialog.gotoAndPlay(2);
isKeyInput = true;
switch (_local2.name){
case "box01":
cField = 0;
text01.text = "";
break;
case "box02":
cField = 1;
text02.text = "";
break;
case "box03":
cField = 2;
text03.text = "";
break;
};
}
public function updateChallenges(){
var _local1:uint;
_local1 = 0;
while (_local1 < chalButtons.length) {
if (chalXML.child(_local1).minLevel <= so.data.level){
chalButtons[_local1].visible = true;
buttonize(chalButtons[_local1], playChalenge, true);
chalButtons[_local1].gfx.gotoAndStop(17);
if (so.data.chalenges[_local1] == 0){
chalButtons[_local1].flag.visible = false;
makeItFloat(chalButtons[_local1]);
} else {
chalButtons[_local1].gfx.scaleX = (chalButtons[_local1].gfx.scaleY = 0.5);
chalButtons[_local1].flag.y = (chalButtons[_local1].flag.y + 20);
};
} else {
chalButtons[_local1].visible = false;
};
chalButtons[_local1].mouseChildren = false;
_local1++;
};
}
public function getRandomTip():String{
var _local1:Array;
_local1 = ["Equip your shield, then ram through enemies to damage them and get out of corners.", "The Death Ray's handling takes a little practice. It's too much power!", "While shielded, go inside a boss and activate you Shockwave. Insane damage!", "Use strafing often to handle big groups coming from the same direction. (HOLD LEFT MOUSE BUTTON)", "Use Bullet Time in short bursts to get out of impossible situations.", "Enemy death rays work the same was as yours. While warming up they don't deal any damage. Use this to get away before the ray blasts for real.", "Stuck at a level? Revisit previous levels to stock up on gold and upgrades", "Can't beat a challenge? Max out upgrades that are allowed in it, then try again!"];
return (math.randomGetFromArray(_local1));
}
public function makeItFloat(_arg1:MovieClip){
if (!_arg1){
return;
};
TweenLite.to(_arg1, 1, {y:"-10", ease:Sine.easeInOut, onComplete:floatBack, onCompleteParams:[_arg1]});
}
public function doContinue(_arg1:MouseEvent){
continueButton.removeEventListener(MouseEvent.CLICK, doContinue);
this.removeChild(adBox);
gotoAndStop(4);
}
public function updateKeys(){
var _local1:String;
if (!so.data.keys){
trace(so.data.keys);
return;
};
text01.mouseEnabled = false;
_local1 = so.data.keys[0][1];
text01.text = _local1.toUpperCase();
text02.mouseEnabled = false;
_local1 = so.data.keys[1][1];
text02.text = _local1.toUpperCase();
text03.mouseEnabled = false;
_local1 = so.data.keys[2][1];
text03.text = _local1.toUpperCase();
}
public function buttonScaleAnimIn(_arg1:MouseEvent){
var _local2:MovieClip;
_local2 = MovieClip(_arg1.currentTarget);
if (_local2.locked){
_local2.buttonMode = false;
return;
};
_local2.scaleX = (_local2.scaleY = _local2.fixScale);
TweenLite.to(_local2, 0.4, {scaleX:(1.15 * _local2.fixScale), scaleY:(1.1 * _local2.fixScale), ease:Strong.easeOut});
}
public function updateButtons(){
var _local1:uint;
var _local2:MovieClip;
moneyTab.moneyText.text = (addComas(String(so.data.money)) + " coins");
_local1 = 0;
while (_local1 < healthButtons.length) {
_local2 = healthButtons[_local1];
if (so.data.healthUpgrade == _local1){
_local2.locked = false;
_local2.bg.gotoAndStop(3);
} else {
_local2.locked = true;
};
if (so.data.healthUpgrade > _local1){
_local2.bg.gotoAndStop(2);
} else {
if (so.data.healthUpgrade < _local1){
_local2.bg.gotoAndStop(1);
};
};
_local1++;
};
_local1 = 0;
while (_local1 < beamButtons.length) {
_local2 = beamButtons[_local1];
if (so.data.beamUpgrade == _local1){
_local2.locked = false;
_local2.bg.gotoAndStop(3);
} else {
_local2.locked = true;
};
if (so.data.beamUpgrade > _local1){
_local2.bg.gotoAndStop(2);
} else {
if (so.data.beamUpgrade < _local1){
_local2.bg.gotoAndStop(1);
};
};
_local1++;
};
_local1 = 0;
while (_local1 < shieldButtons.length) {
_local2 = shieldButtons[_local1];
if (so.data.shieldUpgrade == _local1){
_local2.locked = false;
_local2.bg.gotoAndStop(3);
} else {
_local2.locked = true;
};
if (so.data.shieldUpgrade > _local1){
_local2.bg.gotoAndStop(2);
} else {
if (so.data.shieldUpgrade < _local1){
_local2.bg.gotoAndStop(1);
};
};
_local1++;
};
_local1 = 0;
while (_local1 < btimeButtons.length) {
_local2 = btimeButtons[_local1];
if (so.data.btimeUpgrade == _local1){
_local2.locked = false;
_local2.bg.gotoAndStop(3);
} else {
_local2.locked = true;
};
if (so.data.btimeUpgrade > _local1){
_local2.bg.gotoAndStop(2);
} else {
if (so.data.btimeUpgrade < _local1){
_local2.bg.gotoAndStop(1);
};
};
_local1++;
};
_local1 = 0;
while (_local1 < swaveButtons.length) {
_local2 = swaveButtons[_local1];
if (so.data.swaveUpgrade == _local1){
_local2.locked = false;
_local2.bg.gotoAndStop(3);
} else {
_local2.locked = true;
};
if (so.data.swaveUpgrade > _local1){
_local2.bg.gotoAndStop(2);
} else {
if (so.data.swaveUpgrade < _local1){
_local2.bg.gotoAndStop(1);
};
};
_local1++;
};
_local1 = 0;
while (_local1 < wepButtons.length) {
_local2 = wepButtons[_local1];
_local2.wepIcons.gotoAndStop((_local1 + 1));
_local2.wepIcons.mouseEnabled = false;
if (so.data.cWeapon == _local1){
_local2.bg.gotoAndStop(3);
} else {
if (so.data.weapons[_local1]){
_local2.bg.gotoAndStop(2);
} else {
_local2.bg.gotoAndStop(1);
};
};
_local1++;
};
_local1 = 0;
while (_local1 < outButtons.length) {
_local2 = outButtons[_local1];
_local2.wepIcon.gotoAndStop((_local1 + 1));
_local2.wepIcon.mouseEnabled = false;
if (so.data.costume == _local1){
_local2.bg.gotoAndStop(3);
} else {
if (so.data.costumes[_local1]){
_local2.bg.gotoAndStop(2);
} else {
_local2.bg.gotoAndStop(1);
};
};
_local1++;
};
}
public function getTipTexts():Array{
var _local1:String;
var _local2:Array;
_local2 = [];
if (so.data.tips[0] == 0){
so.data.tips[0] = 1;
_local1 = "Hey there, welcome to the battlefield. Use your mouse to move around and HOLD LEFT MOUSE BUTTON to strafe. Don't collide with enemies or bullets. Collect money! \nPause with P.";
_local2.push(_local1);
};
if ((((so.data.tips[1] == 0)) && (!((shieldUpgrade == 0))))){
so.data.tips[1] = 1;
_local1 = ("You have unlocked your shield ability! Use it by pressing " + so.data.keys[0][1]);
_local2.push(_local1);
};
if ((((so.data.tips[2] == 0)) && (!((btimeUpgrade == 0))))){
so.data.tips[2] = 1;
_local1 = (("You have unlocked your Bullet Time ability! Press and hold " + so.data.keys[1][1]) + " to activate it. It has to be at least half charged to start.");
_local2.push(_local1);
};
if ((((so.data.tips[3] == 0)) && (!((beamUpgrade == 0))))){
so.data.tips[3] = 1;
_local1 = ("You have unlocked your Death Ray ability! Activate it by pressing " + so.data.keys[2][1]);
_local2.push(_local1);
};
if ((((so.data.tips[4] == 0)) && (!((swaveUpgrade == 0))))){
so.data.tips[4] = 1;
_local1 = "You have unlocked your Shockwave ability! DOUBLE CLICK to activate it when it's charged!";
_local2.push(_local1);
};
if (_local2.length == 0){
_local2.push(getRandomTip());
};
return (_local2);
}
public function popStartGameBubble(){
a = getTipTexts();
sgb = new startGameBubble();
this.addChild(sgb);
TweenLite.from(sgb, 1, {y:-200, ease:Elastic.easeOut});
buttonize(sgb.okButton, handleSGClick);
showNextTip();
}
public function addHelpBubble(){
b = new campaignHelpBubble();
this.addChildAt(b, (this.getChildIndex(ww) - 1));
}
public function deZero(_arg1:String){
while ((((_arg1.charAt(0) == "0")) && ((_arg1.length > 1)))) {
_arg1 = _arg1.slice(1);
};
return (_arg1);
}
public function showNextTip(){
sgb.tf.text = a[0];
sgb.tf.height = (sgb.tf.textHeight + 20);
sgb.tf.y = (70 + ((160 - sgb.tf.textHeight) / 2));
sgb.tf.alpha = 0;
TweenLite.to(sgb.tf, 0.5, {alpha:1, ease:Strong.easeOut});
a.splice(0, 1);
if (a.length == 0){
sgb.okButton.tf.text = "Let's go!";
};
}
public function doPreload(_arg1:Event){
var _local2:uint;
_local2 = ((stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal) * 100);
fakeCount = (fakeCount + 2);
if (fakeCount < _local2){
percentText.text = (String(fakeCount) + "%");
} else {
percentText.text = (String(_local2) + "%");
};
if ((((_local2 >= 100)) && ((fakeCount >= 100)))){
this.removeEventListener(Event.ENTER_FRAME, doPreload);
waitTimer.start();
};
}
public function buttonScaleAnimOut(_arg1:MouseEvent){
var _local2:MovieClip;
_local2 = MovieClip(_arg1.currentTarget);
TweenLite.to(_local2, 0.6, {scaleX:_local2.fixScale, scaleY:_local2.fixScale, ease:Strong.easeOut});
}
public function leaveKeySetup(_arg1:MouseEvent){
if (isKeyInput){
dialog.gotoAndPlay(2);
return;
};
stage.removeEventListener(KeyboardEvent.KEY_DOWN, doKeyDown);
gotoAndStop(10);
}
public function initKong(){
var _local1:URLRequest;
var _local2:Loader;
Security.allowDomain(apiPath);
_local1 = new URLRequest(apiPath);
_local2 = new Loader();
_local2.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
_local2.load(_local1);
this.addChild(_local2);
}
public function initSo(_arg1:Boolean=false){
if (((!(so.data.hello)) || (_arg1))){
trace("new shared object created");
so.data.hello = 1;
if (!_arg1){
so.data.keys = [[65, "A"], [83, "S"], [68, "D"]];
};
so.data.money = 0;
so.data.healthUpgrade = 0;
so.data.beamUpgrade = 0;
so.data.shieldUpgrade = 0;
so.data.btimeUpgrade = 0;
so.data.swaveUpgrade = 0;
so.data.cWeapon = 0;
so.data.weapons = [1, 0, 0, 0, 0, 0, 0];
so.data.costume = 0;
so.data.costumes = [1, 0, 0, 0, 0];
so.data.tips = [0, 0, 0, 0, 0];
so.data.level = -1;
so.data.chalenges = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
if (eraseButton){
eraseButton.visible = false;
};
} else {
trace("got shared object");
if (((eraseButton) && ((so.data.level < 0)))){
eraseButton.visible = false;
};
};
}
public function updateLevels(){
var _local1:uint;
if (so.data.level == -1){
addHelpBubble();
};
_local1 = 0;
while (_local1 < levelButtons.length) {
if (so.data.level == (_local1 - 1)){
buttonize(levelButtons[_local1], playLevel, true);
levelButtons[_local1].mouseChildren = false;
makeItFloat(levelButtons[_local1]);
levelButtons[_local1].flag.visible = false;
levelButtons[_local1].gfx.gotoAndStop((_local1 + 1));
} else {
if (so.data.level < (_local1 - 1)){
levelButtons[_local1].visible = false;
} else {
if (so.data.level > (_local1 - 1)){
levelButtons[_local1].gfx.scaleY = (levelButtons[_local1].gfx.scaleX = 0.6);
levelButtons[_local1].gfx.gotoAndStop((_local1 + 1));
buttonize(levelButtons[_local1], playLevel, true);
levelButtons[_local1].mouseChildren = false;
};
};
};
_local1++;
};
}
public function moveBubble(_arg1:MouseEvent){
textBubble.setPos(mouseX, mouseY);
}
public function delSo(_arg1:MouseEvent){
initSo(true);
if (eraseButton){
eraseButton.visible = false;
};
}
public function checkBannedKeyCode(_arg1:uint){
var _local2:Array;
var _local3:Boolean;
var _local4:uint;
_local2 = [9, 8, 20, 16, 17, 18, 13, 45, 46, 27, 112, 113, 114, 115, 116, 117, 118, 119, 120, 19, 36, 35, 144, 80];
_local3 = false;
_local4 = 0;
while (_local4 < _local2.length) {
if (_arg1 == _local2[_local4]){
_local3 = true;
};
_local4++;
};
return (_local3);
}
public function getBubbleText(_arg1:String){
var _local2:uint;
var _local3:String;
_local3 = "";
if (_arg1.indexOf("health") != -1){
_local2 = (uint(_arg1.charAt(6)) + 1);
_local3 = ((String(upgrades.health.child(_local2).desc) + "\n\nprice: ") + String(upgrades.health.child(_local2).price));
} else {
if (_arg1.indexOf("beam") != -1){
_local2 = uint(_arg1.charAt(4));
_local3 = ((String(upgrades.beam.child(_local2).desc) + "\n\nprice: ") + String(upgrades.beam.child(_local2).price));
} else {
if (_arg1.indexOf("shield") != -1){
_local2 = uint(_arg1.charAt(6));
_local3 = ((String(upgrades.shield.child(_local2).desc) + "\n\nprice: ") + String(upgrades.shield.child(_local2).price));
} else {
if (_arg1.indexOf("btime") != -1){
_local2 = uint(_arg1.charAt(5));
_local3 = ((String(upgrades.btime.child(_local2).desc) + "\n\nprice: ") + String(upgrades.btime.child(_local2).price));
} else {
if (_arg1.indexOf("swave") != -1){
_local2 = uint(_arg1.charAt(5));
_local3 = ((String(upgrades.swave.child(_local2).desc) + "\n\nprice: ") + String(upgrades.swave.child(_local2).price));
} else {
if (_arg1.indexOf("wep") != -1){
_local2 = uint(_arg1.charAt(3));
_local3 = String(upgrades.weapons.child(_local2).desc);
if (so.data.cWeapon == _local2){
_local3 = (_local3 + "\n\nThis gun is currently equipped");
} else {
if (so.data.weapons[_local2]){
_local3 = (_local3 + "\n\nYou own this. Click to equip");
} else {
_local3 = ((_local3 + "\n\nprice: ") + String(upgrades.weapons.child(_local2).price));
};
};
} else {
if (_arg1.indexOf("out") != -1){
_local2 = uint(_arg1.charAt(3));
_local3 = String(upgrades.outfits.child(_local2).desc);
if (so.data.costume == _local2){
_local3 = (_local3 + "\n\nThis outfit is currently equipped");
} else {
if (so.data.costumes[_local2]){
_local3 = (_local3 + "\n\nYou own this. Click to equip");
} else {
_local3 = ((_local3 + "\n\nprice: ") + String(upgrades.outfits.child(_local2).price));
};
};
} else {
if (_arg1.indexOf("level") != -1){
_local2 = uint(deZero(_arg1.slice(5)));
_local3 = levelDesc.child(_local2);
} else {
if (_arg1.indexOf("chal") != -1){
_local2 = uint(_arg1.slice(4));
_local3 = ("CHALLENGE:\n" + chalXML.child(_local2).desc);
if (so.data.chalenges[_local2]){
_local3 = (_local3 + "\n\nYou completed this challenge");
} else {
_local3 = ((_local3 + "\n\nPrize money: ") + addComas(String(chalXML.child(_local2).prize)));
};
};
};
};
};
};
};
};
};
};
return (_local3);
}
}
}//package 08ng_fla
Section 20
//MedalNameContainer_83 (08ng_fla.MedalNameContainer_83)
package 08ng_fla {
import flash.display.*;
import flash.text.*;
public dynamic class MedalNameContainer_83 extends MovieClip {
public var textField:TextField;
}
}//package 08ng_fla
Section 21
//moneyBg_59 (08ng_fla.moneyBg_59)
package 08ng_fla {
import flash.display.*;
import flash.text.*;
public dynamic class moneyBg_59 extends MovieClip {
public var moneyText:TextField;
}
}//package 08ng_fla
Section 22
//musicBox_28 (08ng_fla.musicBox_28)
package 08ng_fla {
import flash.display.*;
import flash.events.*;
import com.greensock.*;
import com.greensock.easing.*;
import flash.media.*;
public dynamic class musicBox_28 extends MovieClip {
public var FADE_LENGTH:uint;
public var menuMusic:Class;
public var menuSc:SoundChannel;
public var prevPos:Number;
public var fadeOut:Boolean;
public var sc:SoundChannel;
public var BUG:int;
public var st:SoundTransform;
public var timeDiff:uint;
public var gameEnd:Boolean;
public var posDiff:uint;
public var s:Sound;
public var tracks:Array;
public var muteRatio:uint;
public var MUSIC_VOL:Number;
public var cTrack:int;
public var repeat:uint;
public var prevTime:uint;
public var MENU_VOL:Number;
public var GAME_VOL:Number;
public function musicBox_28(){
addFrameScript(0, frame1);
}
public function playFromTrack(_arg1, _arg2:Boolean=true){
var _local3:Array;
if (_arg2){
MUSIC_VOL = GAME_VOL;
};
_local3 = [0, 2, 4, 7, 9];
cTrack = _local3[_arg1];
nextTrack();
gameEnd = false;
}
public function playEnd(){
MUSIC_VOL = 0.7;
playFromTrack(3, false);
}
public function doTrackEnd(_arg1:Event=null){
nextTrack();
}
public function nextTrack(){
if (gameEnd){
return;
};
if (menuSc){
menuSc.stop();
menuSc = null;
};
repeat = 1;
if (cTrack >= tracks.length){
cTrack = 0;
};
if (sc){
sc.stop();
sc.removeEventListener(Event.SOUND_COMPLETE, doTrackEnd);
};
trace("next track");
TweenLite.killTweensOf(st);
s = new (tracks[cTrack]);
st.volume = (MUSIC_VOL * muteRatio);
if (tracks[(cTrack + 1)] >= 1){
repeat = tracks[(cTrack + 1)];
cTrack++;
};
sc = s.play(0, repeat);
trace("st.volume", st.volume, MUSIC_VOL, muteRatio, (MUSIC_VOL * muteRatio));
trace("repeat: ", repeat);
sc.soundTransform = st;
sc.addEventListener(Event.SOUND_COMPLETE, doTrackEnd, false, 0, true);
cTrack++;
fadeOut = false;
if (tracks[cTrack] == 0){
cTrack++;
trace("fadeout will be");
fadeOut = true;
};
}
public function unmuteGameMusic(){
muteRatio = 1;
st.volume = MUSIC_VOL;
addTransform();
}
public function stopGameMusic(){
if (sc){
gameEnd = false;
sc.stop();
sc = null;
};
}
function frame1(){
cTrack = 0;
st = new SoundTransform();
prevPos = 0;
posDiff = 0;
MUSIC_VOL = 0.3;
GAME_VOL = 0.3;
MENU_VOL = 0.4;
FADE_LENGTH = 3000;
BUG = 0;
timeDiff = 0;
prevTime = 0;
fadeOut = false;
muteRatio = 1;
gameEnd = false;
repeat = 1;
this.addEventListener(Event.ENTER_FRAME, checkFade, false, 0, true);
menuMusic = menuM;
tracks = [green01, 0, music02, 0, chocoMusic01, 2, 0, cakeMusic01, 0, bossMusic01, 3, 0];
}
public function stopMenu(){
if (menuSc){
menuSc.stop();
menuSc = null;
};
}
public function muteGameMusic(){
muteRatio = 0;
st.volume = muteRatio;
addTransform();
}
public function addMenuTransform(){
if (menuSc){
menuSc.soundTransform = st;
};
}
public function playMenu(){
if (sc){
sc.stop();
sc.removeEventListener(Event.SOUND_COMPLETE, doTrackEnd);
sc = null;
};
if (menuSc){
return;
};
s = new menuMusic();
menuSc = s.play(0, 100);
st.volume = 0;
menuSc.soundTransform = st;
TweenLite.to(st, (FADE_LENGTH / 1000), {volume:MENU_VOL, ease:Linear.easeOut, onUpdate:addMenuTransform});
}
public function checkFade(_arg1:Event){
if (((fadeOut) && (sc))){
if (sc.position >= (((s.length * repeat) - FADE_LENGTH) - 150)){
trace("fading out");
TweenLite.to(st, (FADE_LENGTH / 1000), {volume:0, ease:Linear.easeOut, onUpdate:addTransform});
fadeOut = false;
};
};
}
public function addTransform(){
if (sc){
sc.soundTransform = st;
};
}
public function endFadeOut(){
TweenLite.to(st, (FADE_LENGTH / 1000), {volume:0, ease:Linear.easeOut, onUpdate:addTransform, onComplete:stopGameMusic});
}
}
}//package 08ng_fla
Section 23
//muteButton_37 (08ng_fla.muteButton_37)
package 08ng_fla {
import flash.display.*;
public dynamic class muteButton_37 extends MovieClip {
public function muteButton_37(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package 08ng_fla
Section 24
//outfitButton_72 (08ng_fla.outfitButton_72)
package 08ng_fla {
import flash.display.*;
import dvmClasses.elements.*;
public dynamic class outfitButton_72 extends MovieClip {
public var buyPing:MovieClip;
public var bg:MovieClip;
public var wepIcon:HeroSprite;
}
}//package 08ng_fla
Section 25
//soundBox_29 (08ng_fla.soundBox_29)
package 08ng_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
public dynamic class soundBox_29 extends MovieClip {
public var sounds:Array;
public var t:Timer;
public function soundBox_29(){
addFrameScript(0, frame1);
}
public function playRandom(_arg1:Array){
var _local2:uint;
_local2 = Math.floor((Math.random() * _arg1.length));
playGameSound(_arg1[_local2]);
}
public function doCoolDown(_arg1:TimerEvent){
var _local2:uint;
_local2 = 0;
while (_local2 < sounds.length) {
if (sounds[_local2][2] > 0){
var _local3 = sounds[_local2];
var _local4 = 2;
var _local5 = (_local3[_local4] - 1);
_local3[_local4] = _local5;
};
_local2++;
};
}
public function playGameSound(_arg1:uint){
var _local2:SoundTransform;
var _local3:Sound;
var _local4:SoundChannel;
if (sounds[_arg1][2] == 0){
_local2 = new SoundTransform(sounds[_arg1][1]);
_local3 = new (sounds[_arg1][0]);
_local4 = _local3.play();
if (_local4){
_local4.soundTransform = _local2;
};
sounds[_arg1][2] = sounds[_arg1][3];
};
}
function frame1(){
sounds = [];
sounds.push([beamSound01, 0.6, 0, 2]);
sounds.push([beamSound02, 0.8, 0, 2]);
sounds.push([beamSoundEnd, 1, 0, 1]);
sounds.push([coin1, 0.7, 0, 1]);
sounds.push([sndHero, 0.4, 0, 1]);
sounds.push([sndLaser1, 0.3, 0, 1]);
sounds.push([sndLaser2, 0.3, 0, 1]);
sounds.push([coin2, 0.5, 0, 1]);
sounds.push([snHit, 0.4, 0, 1]);
sounds.push([snLongExp, 0.8, 0, 1]);
sounds.push([snBulletHero, 0.6, 0, 1]);
sounds.push([snShieldup, 1, 0, 1]);
sounds.push([snSwave, 0.4, 0, 1]);
sounds.push([snExp1, 0.4, 0, 1]);
sounds.push([snExp2, 0.6, 0, 1]);
sounds.push([snExp3, 0.3, 0, 1]);
sounds.push([snExp4, 0.4, 0, 1]);
sounds.push([snExp5, 0.3, 0, 1]);
sounds.push([buySound, 0.8, 0, 1]);
sounds.push([lockSound, 0.6, 0, 1]);
sounds.push([costumeSound, 0.6, 0, 1]);
sounds.push([soundWeapon, 0.6, 0, 1]);
t = new Timer(100);
t.start();
t.addEventListener(TimerEvent.TIMER, doCoolDown, false, 0, true);
}
}
}//package 08ng_fla
Section 26
//textBubble_35 (08ng_fla.textBubble_35)
package 08ng_fla {
import flash.display.*;
import flash.text.*;
public dynamic class textBubble_35 extends MovieClip {
public var bg:MovieClip;
public var txt:TextField;
public function textBubble_35(){
addFrameScript(0, frame1);
}
function frame1(){
this.mouseEnabled = false;
this.mouseChildren = false;
}
public function setPos(_arg1:int, _arg2:int){
var _local3:int;
var _local4:int;
_local3 = (-(bg.height) - 20);
_local4 = 20;
if (_arg2 < (bg.height + 20)){
_local3 = 20;
};
if (_arg1 > (bg.width + 20)){
_local4 = (-(bg.width) - 20);
};
x = (_arg1 + _local4);
y = (_arg2 + _local3);
}
public function setText(_arg1:String, _arg2:int, _arg3:int){
var _local4:uint;
txt.text = _arg1;
_local4 = (txt.textHeight + 20);
txt.height = _local4;
bg.height = (_local4 + 10);
setPos(_arg2, _arg3);
}
}
}//package 08ng_fla
Section 27
//Timeline_15 (08ng_fla.Timeline_15)
package 08ng_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.geom.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Timeline_15 extends MovieClip {
public var itemClip:MovieClip;
public var currentItem:MovieClip;
public var _selectedItem:Object;
public var _listItems:Array;
public var listButton:SimpleButton;
public var item2:MovieClip;
public var item6:MovieClip;
public var item7:MovieClip;
public var item3:MovieClip;
public var item4:MovieClip;
public var item5:MovieClip;
public var item0:MovieClip;
public var i:uint;
public var item1:MovieClip;
public var _listDown:Boolean;
public function Timeline_15(){
addFrameScript(0, frame1, 9, frame10);
}
public function hideList():void{
_listDown = false;
gotoAndStop("sortUP");
}
function frame10(){
i = 0;
itemClip = item0;
while (itemClip) {
if (i < _listItems.length){
itemClip.item = _listItems[i];
itemClip.label.text = _listItems[i].label;
itemClip.addEventListener(MouseEvent.CLICK, _onItemClick);
} else {
itemClip.visible = false;
};
i++;
itemClip = this[("item" + i)];
};
}
public function _onItemClick(_arg1:MouseEvent):void{
var _local2:MovieClip;
_local2 = (_arg1.currentTarget as MovieClip);
if (_local2.item){
setSelectedItem(_local2.item.data);
};
if (((((((_local2) && (parent))) && ((parent is MovieClip)))) && (MovieClip(parent)._onListChange))){
MovieClip(parent)._onListChange(_local2.item);
};
}
function frame1(){
stop();
if (listButton){
listButton.addEventListener(MouseEvent.CLICK, _onListClick);
};
if (currentItem){
currentItem.addEventListener(MouseEvent.CLICK, _onListClick);
if (currentItem.label){
if (_selectedItem){
currentItem.label.text = _selectedItem.label;
} else {
currentItem.label.text = "";
};
};
};
if (!_listItems){
_listItems = [];
};
}
public function setListItems(_arg1:Array):void{
var _local2:uint;
if (!_arg1){
_listItems = [];
} else {
_listItems = _arg1.concat();
};
_local2 = 0;
while (_local2 < _listItems.length) {
if (typeof(_listItems[_local2]) == "string"){
_listItems[_local2] = {label:_listItems[_local2], data:_listItems[_local2]};
};
_local2++;
};
setSelectedIndex(0);
}
public function _onListClick(_arg1:MouseEvent):void{
_listDown = !(_listDown);
if (_listDown){
gotoAndStop("sortDOWN");
} else {
gotoAndStop("sortUP");
};
}
public function setSelectedIndex(_arg1:uint):void{
if (_arg1 < _listItems.length){
_selectedItem = _listItems[_arg1];
if (((currentItem) && (currentItem.label))){
currentItem.label.text = _selectedItem.label;
};
};
}
public function setSelectedItem(_arg1):void{
var _local2:uint;
_local2 = 0;
while (_local2 < _listItems.length) {
if (_listItems[_local2].data == _arg1){
setSelectedIndex(_local2);
return;
};
_local2++;
};
}
}
}//package 08ng_fla
Section 28
//Timeline_16 (08ng_fla.Timeline_16)
package 08ng_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Timeline_16 extends MovieClip {
public var label:TextField;
public function Timeline_16(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
buttonMode = true;
mouseChildren = false;
}
}
}//package 08ng_fla
Section 29
//Timeline_166 (08ng_fla.Timeline_166)
package 08ng_fla {
import flash.display.*;
public dynamic class Timeline_166 extends MovieClip {
public function Timeline_166(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
buttonMode = true;
}
}
}//package 08ng_fla
Section 30
//Timeline_175 (08ng_fla.Timeline_175)
package 08ng_fla {
import flash.display.*;
public dynamic class Timeline_175 extends MovieClip {
public function Timeline_175(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package 08ng_fla
Section 31
//Timeline_24 (08ng_fla.Timeline_24)
package 08ng_fla {
import flash.display.*;
public dynamic class Timeline_24 extends MovieClip {
public var score1:MovieClip;
public var score5:MovieClip;
public var score6:MovieClip;
public var score0:MovieClip;
public var score2:MovieClip;
public var score3:MovieClip;
public var score7:MovieClip;
public var score8:MovieClip;
public var score4:MovieClip;
public var score9:MovieClip;
}
}//package 08ng_fla
Section 32
//Timeline_25 (08ng_fla.Timeline_25)
package 08ng_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Timeline_25 extends MovieClip {
public var usernameText:TextField;
public var rankText:TextField;
public var scoreText:TextField;
public function Timeline_25(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
buttonMode = true;
mouseChildren = false;
}
}
}//package 08ng_fla
Section 33
//tipButton_45 (08ng_fla.tipButton_45)
package 08ng_fla {
import flash.display.*;
import flash.text.*;
public dynamic class tipButton_45 extends MovieClip {
public var tf:TextField;
public function tipButton_45(){
addFrameScript(0, frame1);
}
function frame1(){
tf.mouseEnabled = false;
}
}
}//package 08ng_fla
Section 34
//upgradeButton_62 (08ng_fla.upgradeButton_62)
package 08ng_fla {
import flash.display.*;
public dynamic class upgradeButton_62 extends MovieClip {
public var buyPing:MovieClip;
public var bg:MovieClip;
}
}//package 08ng_fla
Section 35
//upgradeButtonBg_63 (08ng_fla.upgradeButtonBg_63)
package 08ng_fla {
import flash.display.*;
public dynamic class upgradeButtonBg_63 extends MovieClip {
public function upgradeButtonBg_63(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package 08ng_fla
Section 36
//upgradePanel_61 (08ng_fla.upgradePanel_61)
package 08ng_fla {
import flash.display.*;
public dynamic class upgradePanel_61 extends MovieClip {
public var btime1:MovieClip;
public var btime2:MovieClip;
public var shield4:MovieClip;
public var health3:MovieClip;
public var health0:MovieClip;
public var health2:MovieClip;
public var health4:MovieClip;
public var beam2:MovieClip;
public var beam1:MovieClip;
public var beam3:MovieClip;
public var health1:MovieClip;
public var beam0:MovieClip;
public var beam4:MovieClip;
public var likeButton:MovieClip;
public var swave1:MovieClip;
public var swave3:MovieClip;
public var swave2:MovieClip;
public var swave4:MovieClip;
public var btime0:MovieClip;
public var swave0:MovieClip;
public var shield1:MovieClip;
public var shield2:MovieClip;
public var shield0:MovieClip;
public var shield3:MovieClip;
}
}//package 08ng_fla
Section 37
//weaponButton_69 (08ng_fla.weaponButton_69)
package 08ng_fla {
import flash.display.*;
public dynamic class weaponButton_69 extends MovieClip {
public var wepIcons:MovieClip;
public var buyPing:MovieClip;
public var bg:MovieClip;
}
}//package 08ng_fla
Section 38
//weaponButtonBg_70 (08ng_fla.weaponButtonBg_70)
package 08ng_fla {
import flash.display.*;
public dynamic class weaponButtonBg_70 extends MovieClip {
public function weaponButtonBg_70(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package 08ng_fla
Section 39
//weaponsPanel_68 (08ng_fla.weaponsPanel_68)
package 08ng_fla {
import flash.display.*;
public dynamic class weaponsPanel_68 extends MovieClip {
public var wep0:MovieClip;
public var wep2:MovieClip;
public var wep4:MovieClip;
public var wep5:MovieClip;
public var wep6:MovieClip;
public var wep1:MovieClip;
public var wep3:MovieClip;
public var out4:MovieClip;
public var out0:MovieClip;
public var out3:MovieClip;
public var out2:MovieClip;
public var out1:MovieClip;
}
}//package 08ng_fla
Section 40
//weponIcons_71 (08ng_fla.weponIcons_71)
package 08ng_fla {
import flash.display.*;
public dynamic class weponIcons_71 extends MovieClip {
public function weponIcons_71(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package 08ng_fla
Section 41
//whiteAnim_57 (08ng_fla.whiteAnim_57)
package 08ng_fla {
import flash.display.*;
public dynamic class whiteAnim_57 extends MovieClip {
public function whiteAnim_57(){
addFrameScript(15, frame16);
}
function frame16(){
stop();
}
}
}//package 08ng_fla
Section 42
//PropTween (com.greensock.core.PropTween)
package com.greensock.core {
public class PropTween {
public var start:Number;
public var name:String;
public var prevNode:PropTween;
public var change:Number;
public var target:Object;
public var priority:int;
public var property:String;
public var nextNode:PropTween;
public var isPlugin:Boolean;
public function PropTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean, _arg7:PropTween=null, _arg8:int=0){
this.target = _arg1;
this.property = _arg2;
this.start = _arg3;
this.change = _arg4;
this.name = _arg5;
this.isPlugin = _arg6;
if (_arg7){
_arg7.prevNode = this;
this.nextNode = _arg7;
};
this.priority = _arg8;
}
}
}//package com.greensock.core
Section 43
//SimpleTimeline (com.greensock.core.SimpleTimeline)
package com.greensock.core {
public class SimpleTimeline extends TweenCore {
public var autoRemoveChildren:Boolean;
protected var _lastChild:TweenCore;
protected var _firstChild:TweenCore;
public function SimpleTimeline(_arg1:Object=null){
super(0, _arg1);
}
override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local4:TweenCore;
var _local5:Number;
var _local6:TweenCore;
_local4 = _firstChild;
this.cachedTotalTime = _arg1;
this.cachedTime = _arg1;
while (_local4) {
_local6 = _local4.nextNode;
if (((_local4.active) || ((((((_arg1 >= _local4.cachedStartTime)) && (!(_local4.cachedPaused)))) && (!(_local4.gc)))))){
if (!_local4.cachedReversed){
_local4.renderTime(((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale), _arg2, false);
} else {
_local5 = (_local4.cacheIsDirty) ? _local4.totalDuration : _local4.cachedTotalDuration;
_local4.renderTime((_local5 - ((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale)), _arg2, false);
};
};
_local4 = _local6;
};
}
public function addChild(_arg1:TweenCore):void{
if (((!(_arg1.gc)) && (_arg1.timeline))){
_arg1.timeline.remove(_arg1, true);
};
_arg1.timeline = this;
if (_arg1.gc){
_arg1.setEnabled(true, true);
};
if (_firstChild){
_firstChild.prevNode = _arg1;
};
_arg1.nextNode = _firstChild;
_firstChild = _arg1;
_arg1.prevNode = null;
}
public function get rawTime():Number{
return (this.cachedTotalTime);
}
public function remove(_arg1:TweenCore, _arg2:Boolean=false):void{
if (((!(_arg1.gc)) && (!(_arg2)))){
_arg1.setEnabled(false, true);
};
if (_arg1.nextNode){
_arg1.nextNode.prevNode = _arg1.prevNode;
} else {
if (_lastChild == _arg1){
_lastChild = _arg1.prevNode;
};
};
if (_arg1.prevNode){
_arg1.prevNode.nextNode = _arg1.nextNode;
} else {
if (_firstChild == _arg1){
_firstChild = _arg1.nextNode;
};
};
}
}
}//package com.greensock.core
Section 44
//TweenCore (com.greensock.core.TweenCore)
package com.greensock.core {
import com.greensock.*;
public class TweenCore {
public var initted:Boolean;
protected var _hasUpdate:Boolean;
public var active:Boolean;
protected var _delay:Number;
public var cachedReversed:Boolean;
public var nextNode:TweenCore;
public var cachedTime:Number;
protected var _rawPrevTime:Number;// = -1
public var vars:Object;
public var cachedTotalTime:Number;
public var data;
public var timeline:SimpleTimeline;
public var cachedStartTime:Number;
public var prevNode:TweenCore;
public var cachedDuration:Number;
public var gc:Boolean;
protected var _pauseTime:Number;
public var cacheIsDirty:Boolean;
public var cachedPaused:Boolean;
public var cachedTimeScale:Number;
public var cachedTotalDuration:Number;
public static const version:Number = 1.13;
protected static var _classInitted:Boolean;
public function TweenCore(_arg1:Number=0, _arg2:Object=null){
var _local3:SimpleTimeline;
_rawPrevTime = -1;
super();
this.vars = ((_arg2) || ({}));
this.cachedDuration = (this.cachedTotalDuration = ((_arg1) || (0)));
_delay = ((this.vars.delay) || (0));
this.cachedTimeScale = ((this.vars.timeScale) || (1));
this.active = Boolean((((((_arg1 == 0)) && ((_delay == 0)))) && (!((this.vars.immediateRender == false)))));
this.cachedTotalTime = (this.cachedTime = 0);
this.data = this.vars.data;
if (!_classInitted){
if (isNaN(TweenLite.rootFrame)){
TweenLite.initClass();
_classInitted = true;
} else {
return;
};
};
_local3 = ((this.vars.timeline is SimpleTimeline)) ? this.vars.timeline : (this.vars.useFrames) ? TweenLite.rootFramesTimeline : TweenLite.rootTimeline;
this.cachedStartTime = (_local3.cachedTotalTime + _delay);
_local3.addChild(this);
if (this.vars.reversed){
this.cachedReversed = true;
};
if (this.vars.paused){
this.paused = true;
};
}
public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
}
public function get delay():Number{
return (_delay);
}
public function get duration():Number{
return (this.cachedDuration);
}
public function set reversed(_arg1:Boolean):void{
if (_arg1 != this.cachedReversed){
this.cachedReversed = _arg1;
setTotalTime(this.cachedTotalTime, true);
};
}
public function set startTime(_arg1:Number):void{
var _local2:Boolean;
_local2 = Boolean(((!((this.timeline == null))) && (((!((_arg1 == this.cachedStartTime))) || (this.gc)))));
this.cachedStartTime = _arg1;
if (_local2){
this.timeline.addChild(this);
};
}
public function set delay(_arg1:Number):void{
this.startTime = (this.startTime + (_arg1 - _delay));
_delay = _arg1;
}
public function resume():void{
this.paused = false;
}
public function get paused():Boolean{
return (this.cachedPaused);
}
public function play():void{
this.reversed = false;
this.paused = false;
}
public function set duration(_arg1:Number):void{
this.cachedDuration = (this.cachedTotalDuration = _arg1);
setDirtyCache(false);
}
public function invalidate():void{
}
public function restart(_arg1:Boolean=false, _arg2:Boolean=true):void{
this.reversed = false;
this.paused = false;
this.setTotalTime((_arg1) ? -(_delay) : 0, _arg2);
}
public function complete(_arg1:Boolean=false, _arg2:Boolean=false):void{
if (!_arg1){
renderTime(this.cachedTotalDuration, _arg2, false);
return;
};
if (this.timeline.autoRemoveChildren){
this.setEnabled(false, false);
} else {
this.active = false;
};
if (!_arg2){
if (((((this.vars.onComplete) && ((this.cachedTotalTime == this.cachedTotalDuration)))) && (!(this.cachedReversed)))){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
} else {
if (((((this.cachedReversed) && ((this.cachedTotalTime == 0)))) && (this.vars.onReverseComplete))){
this.vars.onReverseComplete.apply(null, this.vars.onReverseCompleteParams);
};
};
};
}
public function get reversed():Boolean{
return (this.cachedReversed);
}
public function get totalTime():Number{
return (this.cachedTotalTime);
}
public function get startTime():Number{
return (this.cachedStartTime);
}
public function set currentTime(_arg1:Number):void{
setTotalTime(_arg1, false);
}
protected function setDirtyCache(_arg1:Boolean=true):void{
var _local2:TweenCore;
_local2 = (_arg1) ? this : this.timeline;
while (_local2) {
_local2.cacheIsDirty = true;
_local2 = _local2.timeline;
};
}
public function reverse(_arg1:Boolean=true):void{
this.reversed = true;
if (_arg1){
this.paused = false;
} else {
if (this.gc){
this.setEnabled(true, false);
};
};
}
public function set paused(_arg1:Boolean):void{
if (((!((_arg1 == this.cachedPaused))) && (this.timeline))){
if (_arg1){
_pauseTime = this.timeline.rawTime;
} else {
this.cachedStartTime = (this.cachedStartTime + (this.timeline.rawTime - _pauseTime));
_pauseTime = NaN;
setDirtyCache(false);
};
this.cachedPaused = _arg1;
this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration))));
};
if (((!(_arg1)) && (this.gc))){
this.setTotalTime(this.cachedTotalTime, false);
this.setEnabled(true, false);
};
}
public function kill():void{
setEnabled(false, false);
}
public function set totalTime(_arg1:Number):void{
setTotalTime(_arg1, false);
}
public function get currentTime():Number{
return (this.cachedTime);
}
protected function setTotalTime(_arg1:Number, _arg2:Boolean=false):void{
var _local3:Number;
var _local4:Number;
if (this.timeline){
_local3 = (((_pauseTime) || ((_pauseTime == 0)))) ? _pauseTime : this.timeline.cachedTotalTime;
if (this.cachedReversed){
_local4 = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration;
this.cachedStartTime = (_local3 - ((_local4 - _arg1) / this.cachedTimeScale));
} else {
this.cachedStartTime = (_local3 - (_arg1 / this.cachedTimeScale));
};
if (!this.timeline.cacheIsDirty){
setDirtyCache(false);
};
if (this.cachedTotalTime != _arg1){
renderTime(_arg1, _arg2, false);
};
};
}
public function pause():void{
this.paused = true;
}
public function set totalDuration(_arg1:Number):void{
this.duration = _arg1;
}
public function get totalDuration():Number{
return (this.cachedTotalDuration);
}
public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{
if (_arg1){
this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration))));
if (((!(_arg2)) && (this.gc))){
this.timeline.addChild(this);
};
} else {
this.active = false;
if (!_arg2){
this.timeline.remove(this, true);
};
};
this.gc = !(_arg1);
return (false);
}
}
}//package com.greensock.core
Section 45
//Back (com.greensock.easing.Back)
package com.greensock.easing {
public class Back {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / (_arg4 * 0.5));
if (_arg1 < 1){
_arg5 = (_arg5 * 1.525);
return ((((_arg3 * 0.5) * ((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5))) + _arg2));
};
_arg1 = (_arg1 - 2);
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 2)) + _arg2));
}
}
}//package com.greensock.easing
Section 46
//Bounce (com.greensock.easing.Bounce)
package com.greensock.easing {
public class Bounce {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 - easeOut((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 * 0.5)){
return (((easeIn((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOut(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
}
}//package com.greensock.easing
Section 47
//Elastic (com.greensock.easing.Elastic)
package com.greensock.easing {
public class Elastic {
private static const _2PI:Number = (Math.PI * 2);
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((((!(_arg5)) || ((((_arg3 > 0)) && ((_arg5 < _arg3)))))) || ((((_arg3 < 0)) && ((_arg5 < -(_arg3))))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / _2PI) * Math.asin((_arg3 / _arg5)));
};
--_arg1;
return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6)))) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 * 0.5));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if (((((!(_arg5)) || ((((_arg3 > 0)) && ((_arg5 < _arg3)))))) || ((((_arg3 < 0)) && ((_arg5 < -(_arg3))))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / _2PI) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6)))) + _arg2));
};
--_arg1;
return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6))) * 0.5) + _arg3) + _arg2));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((((!(_arg5)) || ((((_arg3 > 0)) && ((_arg5 < _arg3)))))) || ((((_arg3 < 0)) && ((_arg5 < -(_arg3))))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / _2PI) * Math.asin((_arg3 / _arg5)));
};
return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6))) + _arg3) + _arg2));
}
}
}//package com.greensock.easing
Section 48
//Linear (com.greensock.easing.Linear)
package com.greensock.easing {
public class Linear {
public static const power:uint = 0;
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package com.greensock.easing
Section 49
//Sine (com.greensock.easing.Sine)
package com.greensock.easing {
public class Sine {
private static const _HALF_PI:Number = (Math.PI * 0.5);
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * _HALF_PI))) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * _HALF_PI))) + _arg3) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) * 0.5) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
}
}//package com.greensock.easing
Section 50
//Strong (com.greensock.easing.Strong)
package com.greensock.easing {
public class Strong {
public static const power:uint = 4;
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 * 0.5));
if (_arg1 < 1){
return ((((((((_arg3 * 0.5) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 * 0.5) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package com.greensock.easing
Section 51
//TweenLite (com.greensock.TweenLite)
package com.greensock {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import com.greensock.core.*;
import com.greensock.plugins.*;
public class TweenLite extends TweenCore {
public var target:Object;
protected var _overwrite:uint;
public var ratio:Number;// = 0
protected var _notifyPluginsOfEnabled:Boolean;
protected var _hasPlugins:Boolean;
public var cachedPT1:PropTween;
protected var _overwrittenProps:Object;
public var propTweenLookup:Object;
protected var _ease:Function;
public static const version:Number = 11.131;
public static var rootTimeline:SimpleTimeline;
public static var fastEaseLookup:Dictionary = new Dictionary(false);
public static var onPluginEvent:Function;
public static var rootFramesTimeline:SimpleTimeline;
public static var defaultEase:Function = TweenLite.easeOut;
public static var plugins:Object = {};
public static var masterList:Dictionary = new Dictionary(false);
public static var overwriteManager:Object;
public static var rootFrame:Number;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _shape:Shape = new Shape();
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, onReverseComplete:1, onReverseCompleteParams:1, onRepeat:1, onRepeatParams:1, proxiedEase:1, easeParams:1, yoyo:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, onReverseCompleteListener:1, onRepeatListener:1, orientToBezier:1, timeScale:1, immediateRender:1, repeat:1, repeatDelay:1, timeline:1, data:1, paused:1};
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
var _local4:Array;
var _local5:TweenLite;
ratio = 0;
super(_arg2, _arg3);
this.target = _arg1;
if ((((this.target is TweenCore)) && (("timeScale" in this.vars)))){
this.cachedTimeScale = 1;
};
propTweenLookup = {};
_ease = defaultEase;
_overwrite = (((!((Number(_arg3.overwrite) > -1))) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
_local4 = masterList[_arg1];
if (!_local4){
masterList[_arg1] = [this];
} else {
if (_overwrite == 1){
for each (_local5 in _local4) {
if (!_local5.gc){
_local5.setEnabled(false, false);
};
};
masterList[_arg1] = [this];
} else {
_local4[_local4.length] = this;
};
};
if (((this.active) || (this.vars.immediateRender))){
renderTime(0, false, true);
};
}
override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local4:Boolean;
var _local5:Number;
var _local6:PropTween;
_local5 = this.cachedTime;
if (_arg1 >= this.cachedDuration){
this.cachedTotalTime = (this.cachedTime = this.cachedDuration);
this.ratio = 1;
_local4 = true;
if (this.cachedDuration == 0){
if ((((((_arg1 == 0)) || ((_rawPrevTime < 0)))) && (!((_rawPrevTime == _arg1))))){
_arg3 = true;
};
_rawPrevTime = _arg1;
};
} else {
if (_arg1 <= 0){
this.cachedTotalTime = (this.cachedTime = (this.ratio = 0));
if (_arg1 < 0){
this.active = false;
if (this.cachedDuration == 0){
if (_rawPrevTime > 0){
_arg3 = true;
_local4 = true;
};
_rawPrevTime = _arg1;
};
};
if (((this.cachedReversed) && (!((_local5 == 0))))){
_local4 = true;
};
} else {
this.cachedTotalTime = (this.cachedTime = _arg1);
this.ratio = _ease(_arg1, 0, 1, this.cachedDuration);
};
};
if ((((this.cachedTime == _local5)) && (!(_arg3)))){
return;
};
if (!this.initted){
init();
if (((!(_local4)) && (this.cachedTime))){
this.ratio = _ease(this.cachedTime, 0, 1, this.cachedDuration);
};
};
if (((!(this.active)) && (!(this.cachedPaused)))){
this.active = true;
};
if ((((((((_local5 == 0)) && (this.vars.onStart))) && (!((this.cachedTime == 0))))) && (!(_arg2)))){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
_local6 = this.cachedPT1;
while (_local6) {
_local6.target[_local6.property] = (_local6.start + (this.ratio * _local6.change));
_local6 = _local6.nextNode;
};
if (((_hasUpdate) && (!(_arg2)))){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local4){
if (((_hasPlugins) && (this.cachedPT1))){
onPluginEvent("onComplete", this);
};
complete(true, _arg2);
};
}
protected function init():void{
var _local1:String;
var _local2:int;
var _local3:*;
var _local4:Boolean;
var _local5:Array;
var _local6:PropTween;
if (typeof(this.vars.ease) == "function"){
_ease = this.vars.ease;
};
if (this.vars.easeParams){
this.vars.proxiedEase = _ease;
_ease = easeProxy;
};
this.cachedPT1 = null;
this.propTweenLookup = {};
for (_local1 in this.vars) {
if ((((_local1 in _reservedProps)) && (!((((_local1 == "timeScale")) && ((this.target is TweenCore))))))){
} else {
if ((((_local1 in plugins)) && (new ((plugins[_local1] as Class)).onInitTween(this.target, this.vars[_local1], this)))){
this.cachedPT1 = new PropTween(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true, this.cachedPT1);
if (this.cachedPT1.name == "_MULTIPLE_"){
_local2 = _local3.overwriteProps.length;
while (_local2--) {
this.propTweenLookup[_local3.overwriteProps[_local2]] = this.cachedPT1;
};
} else {
this.propTweenLookup[this.cachedPT1.name] = this.cachedPT1;
};
if (_local3.priority){
this.cachedPT1.priority = _local3.priority;
_local4 = true;
};
if (((_local3.onDisable) || (_local3.onEnable))){
_notifyPluginsOfEnabled = true;
};
_hasPlugins = true;
} else {
this.cachedPT1 = new PropTween(this.target, _local1, Number(this.target[_local1]), ((typeof(this.vars[_local1]))=="number") ? (Number(this.vars[_local1]) - this.target[_local1]) : Number(this.vars[_local1]), _local1, false, this.cachedPT1);
this.propTweenLookup[_local1] = this.cachedPT1;
};
};
};
if (_local4){
onPluginEvent("onInit", this);
};
if (this.vars.runBackwards){
_local6 = this.cachedPT1;
while (_local6) {
_local6.start = (_local6.start + _local6.change);
_local6.change = -(_local6.change);
_local6 = _local6.nextNode;
};
};
_hasUpdate = Boolean(!((this.vars.onUpdate == null)));
if (_overwrittenProps){
killVars(_overwrittenProps);
if (this.cachedPT1 == null){
this.setEnabled(false, false);
};
};
if ((((((((_overwrite > 1)) && (this.cachedPT1))) && (masterList[this.target]))) && ((_local5.length > 1)))){
if (overwriteManager.manageOverwrites(this, this.propTweenLookup, _local5, _overwrite)){
init();
};
};
this.initted = true;
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
override public function invalidate():void{
if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){
onPluginEvent("onDisable", this);
};
this.cachedPT1 = null;
_overwrittenProps = null;
_hasUpdate = (this.initted = (this.active = (_notifyPluginsOfEnabled = false)));
this.propTweenLookup = {};
}
public function killVars(_arg1:Object, _arg2:Boolean=true):Boolean{
var _local3:String;
var _local4:PropTween;
var _local5:Boolean;
if (_overwrittenProps == null){
_overwrittenProps = {};
};
for (_local3 in _arg1) {
if ((_local3 in propTweenLookup)){
_local4 = propTweenLookup[_local3];
if (((_local4.isPlugin) && ((_local4.name == "_MULTIPLE_")))){
_local4.target.killProps(_arg1);
if (_local4.target.overwriteProps.length == 0){
_local4.name = "";
};
};
if (_local4.name != "_MULTIPLE_"){
if (_local4.nextNode){
_local4.nextNode.prevNode = _local4.prevNode;
};
if (_local4.prevNode){
_local4.prevNode.nextNode = _local4.nextNode;
} else {
if (this.cachedPT1 == _local4){
this.cachedPT1 = _local4.nextNode;
};
};
if (((_local4.isPlugin) && (_local4.target.onDisable))){
_local4.target.onDisable();
if (_local4.target.activeDisable){
_local5 = true;
};
};
delete propTweenLookup[_local3];
};
};
if (_arg2){
_overwrittenProps[_local3] = 1;
};
};
return (_local5);
}
override public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{
var _local3:Array;
if (_arg1){
_local3 = TweenLite.masterList[this.target];
if (!_local3){
TweenLite.masterList[this.target] = [this];
} else {
_local3[_local3.length] = this;
};
};
super.setEnabled(_arg1, _arg2);
if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){
return (onPluginEvent((_arg1) ? "onEnable" : "onDisable", this));
};
return (false);
}
public static function initClass():void{
rootFrame = 0;
rootTimeline = new SimpleTimeline(null);
rootFramesTimeline = new SimpleTimeline(null);
rootTimeline.cachedStartTime = (getTimer() * 0.001);
rootFramesTimeline.cachedStartTime = rootFrame;
rootTimeline.autoRemoveChildren = true;
rootFramesTimeline.autoRemoveChildren = true;
_shape.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
}
public static function killTweensOf(_arg1:Object, _arg2:Boolean=false):void{
var _local3:Array;
var _local4:int;
if ((_arg1 in masterList)){
_local3 = masterList[_arg1];
_local4 = _local3.length;
while (_local4--) {
if (!TweenLite(_local3[_local4]).gc){
if (_arg2){
TweenLite(_local3[_local4]).complete(false, false);
} else {
TweenLite(_local3[_local4]).setEnabled(false, false);
};
};
};
delete masterList[_arg1];
};
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
if (!("immediateRender" in _arg3)){
_arg3.immediateRender = true;
};
return (new TweenLite(_arg1, _arg2, _arg3));
}
protected static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (1 - (_arg1 / _arg4));
return ((1 - (_arg1 * _arg1)));
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, immediateRender:false, useFrames:_arg4, overwrite:0}));
}
protected static function updateAll(_arg1:Event=null):void{
var _local2:Dictionary;
var _local3:Object;
var _local4:Array;
var _local5:int;
rootTimeline.renderTime((((getTimer() * 0.001) - rootTimeline.cachedStartTime) * rootTimeline.cachedTimeScale), false, false);
rootFrame++;
rootFramesTimeline.renderTime(((rootFrame - rootFramesTimeline.cachedStartTime) * rootFramesTimeline.cachedTimeScale), false, false);
if (!(rootFrame % 60)){
_local2 = masterList;
for (_local3 in _local2) {
_local4 = _local2[_local3];
_local5 = _local4.length;
while (_local5--) {
if (TweenLite(_local4[_local5]).gc){
_local4.splice(_local5, 1);
};
};
if (_local4.length == 0){
delete _local2[_local3];
};
};
};
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package com.greensock
Section 52
//DefaultMedalIcon (com.newgrounds.assets.DefaultMedalIcon)
package com.newgrounds.assets {
import flash.display.*;
public dynamic class DefaultMedalIcon extends BitmapData {
public function DefaultMedalIcon(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package com.newgrounds.assets
Section 53
//DefaultSaveIcon (com.newgrounds.assets.DefaultSaveIcon)
package com.newgrounds.assets {
import flash.display.*;
public dynamic class DefaultSaveIcon extends BitmapData {
public function DefaultSaveIcon(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package com.newgrounds.assets
Section 54
//APIConnector (com.newgrounds.components.APIConnector)
package com.newgrounds.components {
import flash.utils.*;
import flash.display.*;
import com.newgrounds.*;
import flash.events.*;
import flash.net.*;
import flash.geom.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class APIConnector extends MovieClip {
public var encryptionKey:String;
public var loader:Preloader;
public var ad:FlashAd;
public var connectorType:String;
public var className:String;
public var _redirect:Boolean;
public var redirectOnHostBlocked:Boolean;
public var __setPropDict:Dictionary;
public var redirectOnNewVersion:Boolean;
public var movieVersion:String;
public var debugMode:String;
public var apiId:String;
public var adType:String;
public function APIConnector(){
__setPropDict = new Dictionary(true);
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);
}
public function _apiConnect():void{
var _local1:*;
_local1 = API;
if (((_local1) && (!(_local1.connected)))){
if (!apiId){
Logger.logError("No API ID entered in the API Connector component.", "You can create an API ID for this submission at http://newgrounds.com/account/flashapi", "Enter your API ID into the API Connector using the Component Inspector (Window -> Component Inspector).");
return;
};
switch (debugMode){
case "Off":
default:
_local1.debugMode = _local1.RELEASE_MODE;
break;
case "Simulate Logged-in User":
_local1.debugMode = _local1.DEBUG_MODE_LOGGED_IN;
break;
case "Simulate Logged-out User":
_local1.debugMode = _local1.DEBUG_MODE_LOGGED_OUT;
break;
case "Simulate New Version":
_local1.debugMode = _local1.DEBUG_MODE_NEW_VERSION;
break;
case "Simulate Host Blocked":
_local1.debugMode = _local1.DEBUG_MODE_HOST_BLOCKED;
break;
};
_local1.addEventListener(APIEvent.API_CONNECTED, _onConnected);
_local1.connect(root, apiId, encryptionKey, movieVersion);
};
}
public function _onConnected(_arg1:APIEvent):void{
if (((((redirectOnNewVersion) && (_arg1.success))) && (_arg1.data.newVersion))){
_redirect = true;
};
if (((((redirectOnHostBlocked) && (!(_arg1.success)))) && ((_arg1.error == APIEvent.ERROR_HOST_BLOCKED)))){
_redirect = true;
};
if (_redirect){
gotoAndStop("adPreloader");
forceAlwaysOnTop();
};
}
public function forceAlwaysOnTop():void{
var _local1:uint;
if (parent){
_local1 = (parent.numChildren - 1);
if (parent.getChildIndex(this) != _local1){
parent.setChildIndex(this, _local1);
};
};
if (stage){
x = ((stage.stageWidth - width) / 2);
y = ((stage.stageHeight - height) / 2);
visible = true;
};
if (((root) && ((root is MovieClip)))){
MovieClip(root).stop();
};
}
function __setProp_ad_APIConnector_AD_1(){
try {
ad["componentInspectorSetting"] = true;
} catch(e:Error) {
};
ad.apiId = "";
ad.showBorder = true;
ad.adType = "Video";
try {
ad["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
public function _onLoaded():void{
var mainClass:Class;
var main:*;
gotoAndStop("invisible");
if (_redirect){
API.loadOfficialVersion();
return;
};
if (className){
try {
mainClass = (getDefinitionByName(className) as Class);
if (((mainClass) && (parent))){
main = new (mainClass);
parent.addChild(main);
parent.removeChild(this);
};
} catch(error) {
Logger.logError(("Unable to create main class: " + className));
};
};
}
function frame10(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame14(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame18(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame3(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame6(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame7(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame19(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame12(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame13(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame17(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame5(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame9(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame1(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
stop();
if (((root) && ((root is MovieClip)))){
MovieClip(root).stop();
};
x = int(x);
y = int(y);
if (!debugMode){
debugMode = "Simulate Logged-in User";
};
if (!connectorType){
connectorType = "Flash Ad + Preloader";
};
if (!adType){
adType = "Video";
};
if (ad){
ad.adType = adType;
};
switch (connectorType){
case "Flash Ad + Preloader":
gotoAndStop("adPreloader");
break;
case "Flash Ad Only":
gotoAndStop("ad");
break;
case "Invisible":
gotoAndStop("invisible");
break;
};
_apiConnect();
}
function frame8(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame21(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame2(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame15(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame16(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame11(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame4(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame20(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
}
}//package com.newgrounds.components
Section 55
//FlashAd (com.newgrounds.components.FlashAd)
package com.newgrounds.components {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.geom.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class FlashAd extends FlashAdBase {
public function FlashAd(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
initPlayButton();
}
public function onPlayClick(_arg1:MouseEvent):void{
removeAd();
if (parent){
parent.removeChild(this);
};
}
public function initPlayButton(){
if (this["playButton"]){
this["playButton"].addEventListener(MouseEvent.CLICK, onPlayClick);
if (!this["showPlayButton"]){
this["playButton"].visible = false;
};
};
}
}
}//package com.newgrounds.components
Section 56
//FlashAdBase (com.newgrounds.components.FlashAdBase)
package com.newgrounds.components {
import flash.display.*;
import com.newgrounds.*;
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class FlashAdBase extends MovieClip {
private var _showBorder:Boolean;// = true
public var showPlayButton:Boolean;
private var _fullScreen:Boolean;
public var adType:String;
public var VIDEO_ADS:String;// = "Video"
public var SIMPLE_ADS:String;// = "Simple"
private var _adFeedLoader:URLLoader;
private var _ad:Loader;
public function FlashAdBase(){
this.adType = this.VIDEO_ADS;
super();
try {
Security.allowDomain("server.cpmstar.com");
Security.allowInsecureDomain("server.cpmstar.com");
} catch(error) {
};
gotoAndStop("idle");
x = int(x);
y = int(y);
stop();
if (this["newgroundsButton"]){
this["newgroundsButton"].addEventListener(MouseEvent.CLICK, this.onNGClick);
};
addEventListener(Event.REMOVED_FROM_STAGE, this.onRemovedFromStage);
addEventListener(Event.ENTER_FRAME, this.init);
}
public function get _adContainer():Sprite{
return (this["adContainer"]);
}
public function get _newgroundsButton():DisplayObject{
return (this["newgroundsButton"]);
}
public function get fullScreen():Boolean{
return (this._fullScreen);
}
public function set fullScreen(_arg1:Boolean):void{
this._fullScreen = _arg1;
if (_arg1){
if (stage){
this.drawFullScreenRect();
} else {
addEventListener(Event.ADDED_TO_STAGE, this.onAddedToStage);
};
} else {
graphics.clear();
};
}
public function get showBorder():Boolean{
return (this._showBorder);
}
public function set showBorder(_arg1:Boolean):void{
this._showBorder = _arg1;
if (this._showBorder){
if (this._ad){
if (this._ad.content){
gotoAndStop("loaded");
} else {
gotoAndStop("loading");
};
} else {
gotoAndStop("idle");
};
} else {
gotoAndStop("noBorder");
};
}
private function init(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, this.init);
if (API.adFeedURL){
this.loadAdFeed();
} else {
API.addEventListener(APIEvent.API_CONNECTED, this.loadAdFeed);
};
}
private function loadAdFeed(_arg1:APIEvent=null):void{
var event = _arg1;
if (!API.adFeedURL){
return;
};
if (this._showBorder){
gotoAndStop("loading");
};
this._adFeedLoader = new URLLoader();
this._adFeedLoader.addEventListener(Event.COMPLETE, this.onAdFeedLoaded);
this._adFeedLoader.addEventListener(IOErrorEvent.IO_ERROR, this.onAdError);
this._adFeedLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onAdError);
var adFeedRequest:URLRequest = new URLRequest(API.adFeedURL);
try {
this._adFeedLoader.load(adFeedRequest);
} catch(e:Error) {
onAdError();
};
}
private function onAdFeedLoaded(_arg1:Event):void{
if (((((this._adFeedLoader) && (this._adFeedLoader.data))) && (!((this._adFeedLoader.data == ""))))){
this.loadAd(this._adFeedLoader.data);
} else {
this.onAdError();
};
}
private function loadAd(_arg1:String):void{
var adURL = _arg1;
if (this._ad){
this.removeAd();
};
Logger.logMessage("Loading flash ad...");
this._ad = new Loader();
this._ad.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, this.onAdError);
try {
Object(this._ad.contentLoaderInfo).uncaughtErrorEvents.addEventListener("uncaughtError", function (_arg1:Event):void{
_arg1.preventDefault();
});
} catch(error:Error) {
};
try {
if (this.adType != this.VIDEO_ADS){
if (adURL.indexOf("?") >= 0){
adURL = (adURL + "&");
} else {
adURL = (adURL + "?");
};
adURL = (adURL + "blockoverlays=1");
};
this._ad.load(new URLRequest(adURL), new LoaderContext(false, new ApplicationDomain(null)));
if (this._adContainer){
this._adContainer.addChild(this._ad);
};
if (this._showBorder){
gotoAndStop("loaded");
};
} catch(error:Error) {
onAdError();
};
}
private function drawFullScreenRect():void{
if (stage){
x = ((stage.stageWidth - width) / 2);
y = ((stage.stageHeight - height) / 2);
graphics.beginFill(0);
graphics.drawRect(-(stage.stageWidth), -(stage.stageHeight), (stage.stageWidth * 2), (stage.stageHeight * 2));
graphics.endFill();
};
}
public function removeAd():void{
removeEventListener(Event.REMOVED_FROM_STAGE, this.onRemovedFromStage);
if (this._adFeedLoader){
try {
this._adFeedLoader.close();
} catch(e:Error) {
};
};
if (this._ad){
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;
};
Logger.logError("Ad destroyed.");
}
private function onAdError(_arg1:Event=null):void{
Logger.logError("Unable to load ad.");
this.removeAd();
}
private function onRemovedFromStage(_arg1:Event):void{
this.removeAd();
}
private function onAddedToStage(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, this.onAddedToStage);
if (this.fullScreen){
this.drawFullScreenRect();
};
}
private function onNGClick(_arg1:MouseEvent):void{
API.loadNewgrounds();
}
}
}//package com.newgrounds.components
Section 57
//MedalPopup (com.newgrounds.components.MedalPopup)
package com.newgrounds.components {
import flash.utils.*;
import flash.display.*;
import com.newgrounds.*;
import flash.events.*;
import flash.net.*;
import flash.geom.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class MedalPopup extends MovieClip {
public var medalPointsText:TextField;
public var medalIcon:MovieClip;
public var alwaysOnTop:String;
public var _medalScrollRect:Rectangle;
public var _alwaysOnTop:Boolean;
public var medalNameClip:MovieClip;
public var _unlockedMedal:Medal;
public var _medalQueue:Array;
public function MedalPopup(){
addFrameScript(0, frame1, 2, frame3, 14, frame15, 22, frame23, 83, frame84, 104, frame105);
}
function frame84(){
if (_medalScrollRect){
stop();
};
}
public function showNextUnlock():void{
if (_unlockedMedal){
return;
};
if (!_medalQueue.length){
gotoAndStop("hidden");
removeEventListener(Event.ENTER_FRAME, medalPopupEnterFrame);
return;
};
_unlockedMedal = Medal(_medalQueue.shift());
gotoAndPlay("medalUnlocked");
}
public function onMedalUnlocked(_arg1:APIEvent):void{
if (_arg1.success){
_medalQueue.push(_arg1.data);
showNextUnlock();
};
}
function frame3(){
stop();
}
function frame1(){
gotoAndStop(2);
API.addEventListener(APIEvent.MEDAL_UNLOCKED, onMedalUnlocked);
x = int(x);
y = int(y);
_medalQueue = [];
_alwaysOnTop = true;
if (alwaysOnTop){
_alwaysOnTop = (alwaysOnTop == "true");
};
}
function frame105(){
stop();
_unlockedMedal = null;
showNextUnlock();
}
function frame23(){
if (((_unlockedMedal) && (medalIcon))){
_unlockedMedal.attachIcon(medalIcon);
};
}
public function medalPopupEnterFrame(_arg1:Event):void{
var topIndex:uint;
var event = _arg1;
if (_alwaysOnTop){
try {
if (parent){
topIndex = (parent.numChildren - 1);
if (parent.getChildIndex(this) != topIndex){
parent.setChildIndex(this, topIndex);
};
};
} catch(error) {
removeEventListener(Event.ENTER_FRAME, medalPopupEnterFrame);
};
};
if (_medalScrollRect){
_medalScrollRect.offset(2, 0);
medalNameClip.scrollRect = _medalScrollRect;
if (_medalScrollRect.left >= (medalNameClip.textField.textWidth + 10)){
_medalScrollRect = null;
play();
};
};
}
function frame15(){
if (_unlockedMedal){
if (((medalNameClip) && (medalNameClip.textField))){
medalNameClip.textField.text = _unlockedMedal.name;
};
if (medalPointsText){
medalPointsText.text = _unlockedMedal.value.toString();
};
if (medalNameClip.textField.textWidth > medalNameClip.width){
_medalScrollRect = new Rectangle(-(medalNameClip.width), 0, medalNameClip.width, medalNameClip.height);
medalNameClip.textField.width = 1000;
medalNameClip.scrollRect = _medalScrollRect;
};
addEventListener(Event.ENTER_FRAME, medalPopupEnterFrame);
};
}
}
}//package com.newgrounds.components
Section 58
//Preloader (com.newgrounds.components.Preloader)
package com.newgrounds.components {
import flash.display.*;
import flash.events.*;
public dynamic class Preloader extends MovieClip {
public var className:String;
public var loadingBar:MovieClip;
public var autoPlay:Boolean;
public var playButton:MovieClip;
public function Preloader(){
addFrameScript(0, frame1, 9, frame10);
}
public function enterFrameHandler(_arg1:Event):void{
var _local2:Number;
_local2 = 0;
if (loaderInfo){
_local2 = (loaderInfo.bytesLoaded / loaderInfo.bytesTotal);
};
if (loadingBar){
loadingBar.gotoAndStop((int((_local2 * (loadingBar.totalFrames - 1))) + 1));
};
if (_local2 >= 1){
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
gotoAndStop("loaded");
};
}
function frame10(){
if (playButton){
playButton.addEventListener(MouseEvent.CLICK, _onPlayClick);
playButton.stop();
playButton.buttonMode = true;
};
if (autoPlay){
_onPlayClick(null);
};
}
function frame1(){
stop();
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
public function _onPlayClick(_arg1:MouseEvent):void{
var _local2:MovieClip;
var _local3:MovieClip;
_local2 = (root as MovieClip);
_local3 = (parent as MovieClip);
if (_local2){
_local2.play();
_local2.nextFrame();
};
if (((_local3) && (_local3["_onLoaded"]))){
var _local4 = _local3;
_local4["_onLoaded"]();
};
}
}
}//package com.newgrounds.components
Section 59
//ScoreBrowser (com.newgrounds.components.ScoreBrowser)
package com.newgrounds.components {
import flash.utils.*;
import flash.display.*;
import com.newgrounds.*;
import flash.events.*;
import flash.net.*;
import flash.geom.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class ScoreBrowser extends MovieClip {
public var nextButton:SimpleButton;
public var scoreClip:MovieClip;
public var _scoreBoard:ScoreBoard;
public var scoreContainer:MovieClip;
public var reloadButton:SimpleButton;
public var scoreBoardName:String;
public var _listItems:Array;
public var prevButton:SimpleButton;
public var title:String;
public var pageText:TextField;
public var i:uint;
public var score:Score;
public var listBox:MovieClip;
public var period:String;
public var _numScores:uint;
public var _loading:Boolean;
public function ScoreBrowser(){
addFrameScript(0, frame1, 1, frame2, 10, frame11, 20, frame21, 29, frame30);
}
public function onReloadClick(_arg1:MouseEvent):void{
loadScores();
}
public function _onListChange(_arg1:Object):void{
period = _arg1.data;
loadScores();
}
public function _onScoresLoaded(_arg1:APIEvent):void{
_loading = false;
if (listBox){
listBox.mouseChildren = true;
};
if (_arg1.success){
gotoAndStop("scores");
} else {
gotoAndPlay("error");
};
}
public function _onPageClick(_arg1:MouseEvent):void{
var _local2:*;
_local2 = _arg1.currentTarget;
if (((_scoreBoard) && (!(_loading)))){
if (_local2 == prevButton){
_scoreBoard.prevPage();
} else {
_scoreBoard.nextPage();
};
loadScores();
};
}
function frame1(){
listBox.mouseEnabled = false;
listBox.mouseChildren = false;
if (!title){
title = "High Scores";
};
if (!period){
period = ScoreBoard.ALL_TIME;
};
_numScores = 10;
_listItems = [ScoreBoard.TODAY, ScoreBoard.THIS_WEEK, ScoreBoard.THIS_MONTH, ScoreBoard.THIS_YEAR, ScoreBoard.ALL_TIME];
x = int(x);
y = int(y);
if (prevButton){
prevButton.addEventListener(MouseEvent.CLICK, _onPageClick);
};
if (nextButton){
nextButton.addEventListener(MouseEvent.CLICK, _onPageClick);
};
gotoAndPlay("error");
loadScores();
}
public function onScoreClick(_arg1:MouseEvent):void{
var _local2:MovieClip;
_local2 = (_arg1.currentTarget as MovieClip);
if (_local2.usernameText){
navigateToURL(new URLRequest((("http://" + _local2.usernameText.text) + ".newgrounds.com")), "_blank");
};
}
function frame21(){
if (reloadButton){
reloadButton.addEventListener(MouseEvent.CLICK, onReloadClick);
};
}
function frame2(){
if (listBox){
listBox.setListItems(_listItems);
listBox.setSelectedItem(period);
};
}
public function loadScores():void{
if (_scoreBoard){
_scoreBoard.removeEventListener(APIEvent.SCORES_LOADED, _onScoresLoaded);
};
_scoreBoard = API.getScoreBoard(scoreBoardName);
if (!_scoreBoard){
if (!API.scoreBoards[0]){
Logger.logError("No scoreboards created for this movie. You can create scoreboards on your API Settings page at http://www.newgrounds.com/account/flashapi");
gotoAndPlay("error");
return;
};
_scoreBoard = API.scoreBoards[0];
scoreBoardName = _scoreBoard.name;
Logger.logWarning((("No scoreboard name set in the Score Browser component. Defaulting to scoreboard \"" + _scoreBoard.name) + "\"."));
};
_scoreBoard.addEventListener(APIEvent.SCORES_LOADED, _onScoresLoaded);
_scoreBoard.numResults = _numScores;
_scoreBoard.period = period;
if (pageText){
pageText.text = ("Page " + _scoreBoard.page);
};
_loading = true;
if (listBox){
listBox.mouseChildren = false;
listBox.hideList();
};
gotoAndStop("loading");
_scoreBoard.loadScores();
}
function frame30(){
stop();
}
function frame11(){
i = 0;
scoreClip = scoreContainer.score0;
while (scoreClip) {
score = (_scoreBoard.scores[i] as Score);
if (score){
if (scoreClip.rankText){
scoreClip.rankText.text = score.rank.toString();
};
if (scoreClip.usernameText){
scoreClip.usernameText.text = score.username;
};
if (scoreClip.scoreText){
scoreClip.scoreText.text = score.score;
};
scoreClip.addEventListener(MouseEvent.CLICK, onScoreClick);
} else {
if (scoreClip.rankText){
scoreClip.rankText.text = "";
};
if (scoreClip.usernameText){
scoreClip.usernameText.text = "";
};
if (scoreClip.scoreText){
scoreClip.scoreText.text = "";
};
scoreClip.mouseEnabled = false;
};
i++;
scoreClip = scoreContainer[("score" + i)];
};
}
}
}//package com.newgrounds.components
Section 60
//MD5 (com.newgrounds.crypto.MD5)
package com.newgrounds.crypto {
import flash.utils.*;
public class MD5 {
public static var digest:ByteArray;
private static var hexChars:String = "0123456789abcdef";
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 ((((toHex(_local2) + toHex(_local3)) + toHex(_local4)) + 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 ((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);
}
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.newgrounds.crypto
Section 61
//RC4 (com.newgrounds.crypto.RC4)
package com.newgrounds.crypto {
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.crypto
Section 62
//decodeJson (com.newgrounds.encoders.json.decodeJson)
package com.newgrounds.encoders.json {
public const decodeJson:Function = initDecodeJson();
}//package com.newgrounds.encoders.json
import flash.utils.*;
private const initDecodeJson:Function = function ():Function{
var position:uint;
var byteInput:ByteArray;
var char:uint;
var charConvert:ByteArray;
var isNumberChar:ByteArray;
var stringHelper:ByteArray;
var isWhitespace:ByteArray;
var parseNumber:Function;
var parseWhitespace:Function;
var parse:Object;
charConvert = new ByteArray();
(charConvert.length = 0x0100);
(charConvert[34] = 34);
(charConvert[92] = 92);
(charConvert[47] = 47);
(charConvert[98] = 8);
(charConvert[102] = 12);
(charConvert[110] = 10);
(charConvert[114] = 13);
(charConvert[116] = 9);
isNumberChar = new ByteArray();
(isNumberChar.length = 0x0100);
(isNumberChar[43] = 1);
(isNumberChar[45] = 1);
(isNumberChar[46] = 1);
(isNumberChar[48] = 1);
(isNumberChar[49] = 1);
(isNumberChar[50] = 1);
(isNumberChar[51] = 1);
(isNumberChar[52] = 1);
(isNumberChar[53] = 1);
(isNumberChar[54] = 1);
(isNumberChar[55] = 1);
(isNumberChar[56] = 1);
(isNumberChar[57] = 1);
(isNumberChar[69] = 1);
(isNumberChar[101] = 1);
stringHelper = new ByteArray();
(stringHelper.length = 0x0100);
var i:int;
while (i < 0x0100) {
i = (i + 1);
var _local2 = i;
(stringHelper[_local2] = 1);
};
(stringHelper[34] = 0);
(stringHelper[92] = 0);
isWhitespace = new ByteArray();
(isWhitespace.length = 0x0100);
(isWhitespace[9] = 1);
(isWhitespace[10] = 1);
(isWhitespace[13] = 1);
(isWhitespace[32] = 1);
parseNumber = function ():Number{
if (position === 1){
(byteInput.position = 0);
return (parseFloat(byteInput.readUTFBytes(byteInput.length)));
};
(byteInput.position = (position - 1));
do {
} while (isNumberChar[byteInput[position++]]);
return (Number(byteInput.readUTFBytes(((position-- - byteInput.position) - 1))));
};
parseWhitespace = function ():Object{
while (isWhitespace[byteInput[position]]) {
position++;
};
return (parse[byteInput[position++]]());
};
var parseStringEscaped:Function = function (_arg1:String):String{
do {
if ((char = byteInput[position++]) === 117){
(byteInput.position = position);
(char = parseInt(byteInput.readUTFBytes(4), 16));
(position = (position + 4));
} else {
if (!(char = charConvert[char])){
throw (new Error(("Unknown escaped character encountered at position " + (position - 1))));
};
(byteInput.position = position);
};
_arg1 = (_arg1 + String.fromCharCode(char));
_arg1;
do {
} while (stringHelper[byteInput[position++]]);
if ((position - 1) > byteInput.position){
_arg1 = (_arg1 + byteInput.readUTFBytes(((position - 1) - byteInput.position)));
_arg1;
};
} while (byteInput[(position - 1)] === 92);
return (_arg1);
};
parse = {34:function ():String{
if (stringHelper[byteInput[position++]]){
(byteInput.position = (position - 1));
do {
} while (stringHelper[byteInput[position++]]);
if (byteInput[(position - 1)] === 92){
return (parseStringEscaped(byteInput.readUTFBytes(((position - 1) - byteInput.position))));
};
return (byteInput.readUTFBytes(((position - 1) - byteInput.position)));
//unresolved jump
};
if (byteInput[(position - 1)] === 92){
return (parseStringEscaped(""));
};
return ("");
}, 123:function ():Object{
var _local2:*;
while (isWhitespace[byteInput[position]]) {
position++;
};
if (byteInput[position] === 125){
position++;
return ({});
};
var _local1:* = {};
do {
do {
_local2 = parse[byteInput[position++]]();
_local2;
if (byteInput[position] !== 58){
while (isWhitespace[byteInput[position]]) {
position++;
};
if (byteInput[position++] !== 58){
throw (new Error(("Expected : at " + (position - 1))));
};
} else {
position++;
};
var _temp1 = _local2;
(_local1[_temp1] = parse[byteInput[position++]]());
} while (byteInput[position++] === 44);
if (byteInput[(position - 1)] === 125){
return (_local1);
};
while (isWhitespace[byteInput[position]]) {
position++;
};
} while (byteInput[position++] === 44);
if (byteInput[(position - 1)] !== 125){
throw (new Error(("Expected , or } at " + (position - 1))));
};
return (_local1);
}, 91:function ():Object{
while (isWhitespace[byteInput[position]]) {
position++;
};
if (byteInput[position] === 93){
position++;
return ([]);
};
var _local1:* = [];
do {
do {
(_local1[_local1.length] = parse[byteInput[position++]]());
} while (byteInput[position++] === 44);
if (byteInput[(position - 1)] === 93){
return (_local1);
};
position--;
while (isWhitespace[byteInput[position]]) {
position++;
};
} while (byteInput[position++] === 44);
if (byteInput[(position - 1)] !== 93){
throw (new Error(("Expected , or ] at " + (position - 1))));
};
return (_local1);
}, 116:function ():Boolean{
if ((((((byteInput[position] === 114)) && ((byteInput[(position + 1)] === 117)))) && ((byteInput[(position + 2)] === 101)))){
(position = (position + 3));
return (true);
};
throw (new Error(("Expected \"true\" at position " + position)));
}, 102:function ():Boolean{
if ((((((((byteInput[position] === 97)) && ((byteInput[(position + 1)] === 108)))) && ((byteInput[(position + 2)] === 115)))) && ((byteInput[(position + 3)] === 101)))){
(position = (position + 4));
return (false);
};
throw (new Error(("Expected \"false\" at position " + (position - 1))));
}, 110:function ():Object{
if ((((((byteInput[position] === 117)) && ((byteInput[(position + 1)] === 108)))) && ((byteInput[(position + 2)] === 108)))){
(position = (position + 3));
return (null);
};
throw (new Error(("Expected \"null\" at position " + position)));
}, 110:function ():void{
throw (new Error(("Unexpected end of array at " + position)));
}, 125:function ():void{
throw (new Error(("Unexpected end of object at " + position)));
}, 44:function ():void{
throw (new Error(("Unexpected comma at " + position)));
}, 45:parseNumber, 48:parseNumber, 49:parseNumber, 50:parseNumber, 51:parseNumber, 52:parseNumber, 53:parseNumber, 54:parseNumber, 55:parseNumber, 56:parseNumber, 57:parseNumber, 13:parseWhitespace, 10:parseWhitespace, 9:parseWhitespace, 32:parseWhitespace};
return (function (_arg1):Object{
var input = _arg1;
if ((input is String)){
(byteInput = new ByteArray());
byteInput.writeUTFBytes((input as String));
} else {
if ((input is ByteArray)){
(byteInput = (input as ByteArray));
} else {
throw (new Error((("Unexpected input <" + input) + ">")));
};
};
(position = 0);
try {
return (parse[byteInput[position++]]());
} catch(e:TypeError) {
if ((position - 1) < byteInput.length){
(e.message = ((((((((("Unexpected character " + String.fromCharCode(byteInput[(position - 1)])) + " (0x") + byteInput[(position - 1)].toString(16)) + ")") + " at position ") + (position - 1)) + " (") + e.message) + ")"));
};
throw (e);
};
return (null);
});
};
Section 63
//encodeJson (com.newgrounds.encoders.json.encodeJson)
package com.newgrounds.encoders.json {
public const encodeJson:Function = initDecodeJson();
}//package com.newgrounds.encoders.json
import flash.utils.*;
private const initDecodeJson:Function = function ():Function{
var result:IDataOutput;
var i:int;
var j:int;
var strLen:int;
var str:String;
var char:int;
var tempBytes:ByteArray;
var blockNonFiniteNumbers:Boolean;
var charConvert:Array;
var parseString:Function;
var parse:Object;
tempBytes = new ByteArray();
charConvert = new Array(0x0100);
j = 0;
while (j < 10) {
(charConvert[j] = ((j + 48) | 808464384));
j = (j + 1);
};
while (j < 16) {
(charConvert[j] = ((j + 55) | 808464384));
j = (j + 1);
};
while (j < 26) {
(charConvert[j] = ((j + 32) | 808464640));
j = (j + 1);
};
while (j < 32) {
(charConvert[j] = ((j + 39) | 808464640));
j = (j + 1);
};
while (j < 0x0100) {
(charConvert[j] = j);
j = (j + 1);
};
(charConvert[10] = 23662);
(charConvert[13] = 23666);
(charConvert[9] = 23668);
(charConvert[8] = 23650);
(charConvert[12] = 23654);
(charConvert[8] = 23650);
(charConvert[34] = 23586);
(charConvert[92] = 0x5C5C);
(charConvert[127] = 808466246);
var parseArray:Function = function (_arg1:Array):void{
result.writeByte(91);
var _local2:int;
var _local3:int = (_arg1.length - 1);
if (_local3 >= 0){
while (_local2 < _local3) {
parse[typeof(_arg1[_local2])](_arg1[_local2]);
result.writeByte(44);
var _temp1 = _local2;
_local2 = (_local2 + 1);
_temp1;
};
parse[typeof(_arg1[_local2])](_arg1[_local2]);
};
result.writeByte(93);
};
parseString = function (_arg1:String):void{
result.writeByte(34);
(tempBytes.position = 0);
(tempBytes.length = 0);
tempBytes.writeUTFBytes(_arg1);
(i = 0);
(j = 0);
(strLen = tempBytes.length);
while (j < strLen) {
(char = charConvert[tempBytes[j++]]);
if (char > 0x0100){
if ((j - 1) > i){
result.writeBytes(tempBytes, i, ((j - 1) - i));
};
if (char > 65536){
result.writeShort(23669);
result.writeUnsignedInt(char);
} else {
result.writeShort(char);
};
(i = j);
};
};
if (strLen > i){
result.writeBytes(tempBytes, i, (strLen - i));
};
result.writeByte(34);
};
parse = {object:function (_arg1:Object):void{
var _local2:*;
if (_arg1){
if ((_arg1 is Array)){
parseArray(_arg1);
} else {
result.writeByte(123);
_local2 = true;
for (str in _arg1) {
if (_local2){
_local2 = false;
_local2;
} else {
result.writeByte(44);
};
parseString(str);
result.writeByte(58);
parse[typeof(_arg1[str])](_arg1[str]);
};
result.writeByte(125);
};
} else {
result.writeUnsignedInt(1853189228);
};
}, string:parseString, number:function (_arg1:Number):void{
if (((blockNonFiniteNumbers) && (!(isFinite(_arg1))))){
throw (new Error((("Number " + _arg1) + " is not encodable")));
};
result.writeUTFBytes(String(_arg1));
}, boolean:function (_arg1:Boolean):void{
if (_arg1){
result.writeUnsignedInt(1953658213);
} else {
result.writeByte(102);
result.writeUnsignedInt(1634497381);
};
}, xml:function (_arg1:Object):void{
if ((((!(_arg1.toXMLString) is Function)) || ((_temp2 == null)))){
throw (new Error("unserializable XML object encountered"));
};
parseString(_arg1);
}, undefined:function (_arg1:Boolean):void{
result.writeUnsignedInt(1853189228);
}};
return (function (_arg1:Object, _arg2:IDataOutput=null, _arg3:Boolean=false):String{
var byteOutput:*;
var input = _arg1;
var writeTo = _arg2;
var strictNumberSupport = _arg3;
(blockNonFiniteNumbers = strictNumberSupport);
try {
if (writeTo){
(result = writeTo);
(result.endian = "bigEndian");
parse[typeof(input)](input);
(byteOutput.position = 0);
return (byteOutput.readUTFBytes(byteOutput.length));
} else {
switch (typeof(input)){
case "xml":
if ((((!(input.toXMLString) is Function)) || ((_local5 == null)))){
throw (new Error("unserializable XML object encountered"));
};
case "object":
case "string":
var _local5 = new ByteArray();
byteOutput = _local5;
(result = _local5);
(result.endian = "bigEndian");
parse[typeof(input)](input);
(byteOutput.position = 0);
return (byteOutput.readUTFBytes(byteOutput.length));
case "number":
if (((blockNonFiniteNumbers) && (!(isFinite((input as Number)))))){
throw (new Error((("Number " + input) + " is not encodable")));
};
return (String(input));
case "boolean":
return ((input) ? "true" : "false");
case "undefined":
return ("null");
default:
throw (new Error((("Unexpected type \"" + typeof(input)) + "\" encountered")));
};
};
} catch(e:TypeError) {
throw (new Error("Unexpected type encountered"));
};
return (null);
});
};
Section 64
//JSON (com.newgrounds.encoders.json.JSON)
package com.newgrounds.encoders.json {
public class JSON {
public static function encode(_arg1:Object):String{
return (encodeJson(_arg1));
}
public static function decode(_arg1:String):Object{
return (decodeJson(_arg1));
}
}
}//package com.newgrounds.encoders.json
Section 65
//BaseN (com.newgrounds.encoders.BaseN)
package com.newgrounds.encoders {
import flash.utils.*;
public class BaseN {
private var _hash:String;
private var _base:uint;
private var _reverseHash:Dictionary;
private static const DEFAULT_HASH:String = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/";
public function BaseN(_arg1:String){
if (_arg1){
this._hash = _arg1;
} else {
this._hash = DEFAULT_HASH;
};
this._base = this._hash.length;
this._reverseHash = new Dictionary();
var _local2:uint;
while (_local2 < this._hash.length) {
this._reverseHash[this._hash.charAt(_local2)] = _local2;
_local2++;
};
}
public function encodeUint(_arg1:uint, _arg2:uint=1):String{
var _local3 = "";
var _local4:uint = _arg1;
while (_local4 != 0) {
_local3 = (this._hash.charAt((_local4 % this._base)) + _local3);
_local4 = (_local4 / this._base);
};
while (_local3.length < _arg2) {
_local3 = (this._hash.charAt(0) + _local3);
};
return (_local3);
}
public function decodeUint(_arg1:String):uint{
var _local2:uint;
var _local3:uint;
while (_local3 < _arg1.length) {
_local2 = (_local2 * this._base);
_local2 = (_local2 + this._reverseHash[_arg1.charAt(_local3)]);
_local3++;
};
return (_local2);
}
}
}//package com.newgrounds.encoders
Section 66
//PNGEncoder (com.newgrounds.encoders.PNGEncoder)
package com.newgrounds.encoders {
import flash.utils.*;
import flash.display.*;
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.newgrounds.encoders
Section 67
//API (com.newgrounds.API)
package com.newgrounds {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import com.newgrounds.encoders.json.*;
import com.newgrounds.crypto.*;
import flash.system.*;
public class API {
public static const RELEASE_MODE:String = "releaseMode";
public static const DEBUG_MODE_LOGGED_IN:String = "debugModeLoggedIn";
public static const DEBUG_MODE_LOGGED_OUT:String = "debugModeLoggedOut";
public static const DEBUG_MODE_NEW_VERSION:String = "debugModeNewVersion";
public static const DEBUG_MODE_HOST_BLOCKED:String = "debugModeHostBlocked";
private static const TEST_AD_FEED_URL:String = "http://www.ngads.com/adtest.php";
public static const VERSION:String = "3.1.2 AS3";
private static var _bridge:Bridge;
private static var _dispatcher:APIEventDispatcher = new APIEventDispatcher();
private static var _movieName:String;
private static var _movieVersion:String;
private static var _root:DisplayObject;
private static var _connection:APIConnection = new APIConnection();
private static var _debugMode:String = "debugModeLoggedIn";
private static var _newVersion:Boolean;
private static var _adsApproved:Boolean = false;
private static var _adFeedURL:String;
private static var _medals:Object = new Object();
private static var _medalsArray:Array = [];
private static var _scoreBoards:Object = new Object();
private static var _scoreBoardsArray:Array = [];
private static var _saveGroups:Object = new Object();
private static var _saveGroupsArray:Array = [];
private static var _imageFilePath:String;
private static var _saveFilePath:String;
private static var _sharedObjects:Object = new Object();
private static var _requestedSaveFileId:uint;
private static var _requestedSaveGroupId:uint;
public static function get connected():Boolean{
return (_connection.connected);
}
public static function get isNetworkHost():Boolean{
return (_connection.isNetworkHost);
}
public static function get apiId():String{
_connection.assertInitialized();
return (_connection.apiId);
}
public static function get debugMode():String{
return (_debugMode);
}
public static function set debugMode(_arg1:String):void{
_debugMode = _arg1;
}
public static function get publisherId():uint{
_connection.assertInitialized();
return (_connection.publisherId);
}
public static function get sessionId():String{
_connection.assertInitialized();
return (_connection.sessionId);
}
public static function get hostDomain():String{
_connection.assertInitialized();
return (_connection.hostDomain);
}
public static function get hostURL():String{
_connection.assertInitialized();
return (_connection.hostURL);
}
public static function get isNewgrounds():Boolean{
return ((_connection.publisherId == 1));
}
public static function get hasUserSession():Boolean{
_connection.assertInitialized();
return (_connection.hasUserSession);
}
public static function get username():String{
_connection.assertInitialized();
return (_connection.username);
}
public static function get userId():uint{
_connection.assertInitialized();
return (_connection.userId);
}
private static function assertConnected(_arg1:String=null):Boolean{
if (_connection.assertConnected()){
return (true);
};
if (_arg1){
dispatchEvent(_arg1, null, APIEvent.ERROR_NOT_CONNECTED);
};
return (false);
}
public static function get adsApproved():Boolean{
return (_adsApproved);
}
public static function get adFeedURL():String{
return (_adFeedURL);
}
public static function get medals():Array{
return (_medalsArray);
}
public static function get scoreBoards():Array{
return (_scoreBoardsArray);
}
public static function get saveGroups():Array{
return (_saveGroupsArray);
}
public static function connect(_arg1:DisplayObject, _arg2:String, _arg3:String=null, _arg4:String=""):void{
var _local5:uint;
APIEventDispatcher.globalDispatcher = _dispatcher;
Security.loadPolicyFile("http://apifiles.ngfiles.com/crossdomain.xml");
if (_connection.initialized){
Logger.logError("Connection already in progress. Please call API.disconnect() before attempting another connection.");
dispatchEvent(APIEvent.API_CONNECTED, false, APIEvent.ERROR_NOT_CONNECTED);
return;
};
_arg2 = trimWhitespace(_arg2);
if (_arg3){
_arg3 = trimWhitespace(_arg3);
};
if (((!(_arg2)) || ((_arg2 == "")))){
Logger.logError("No apiId given. Please use the API ID from your API settings page.");
dispatchEvent(APIEvent.API_CONNECTED, false, APIEvent.ERROR_INVALID_ARGUMENT);
return;
};
Logger.logMessage((("====== Newgrounds API v" + VERSION) + " ======"));
_connection.connectionState = APIConnection.CONNECTING;
_root = _arg1;
_movieVersion = _arg4;
_connection.apiId = _arg2;
_local5 = _arg2.indexOf(":");
if (_local5 != -1){
_connection.trackerId = uint(_arg2.substring(0, _local5));
} else {
_connection.trackerId = uint(_arg2);
};
if (!_connection.trackerId){
Logger.logError(("Invalid API ID: " + _arg2));
dispatchEvent(APIEvent.API_CONNECTED, false, APIEvent.ERROR_INVALID_ARGUMENT);
return;
};
_connection.encryptionKey = _arg3;
_connection.initialized = true;
if (!_root.loaderInfo){
Logger.logWarning("The root DisplayObject is currently not on the stage. Connection will be completed once it is added to stage.");
};
_root.addEventListener(Event.ENTER_FRAME, checkRootLoaderInfo);
checkRootLoaderInfo(null);
}
private static function doConnect(_arg1:Object):void{
if (((isNetworkHost) && (!((_debugMode == RELEASE_MODE))))){
Logger.logMessage("Live file detected, turning off debug mode.");
_debugMode = RELEASE_MODE;
};
if (((_arg1) && (_arg1.NewgroundsAPI_SandboxID))){
_bridge = new Bridge(_arg1.NewgroundsAPI_SandboxID);
APICommand.bridge = _bridge;
};
if (_debugMode == RELEASE_MODE){
if (_arg1){
if (_arg1.NewgroundsAPI_UserName){
_connection.username = _arg1.NewgroundsAPI_UserName;
};
if (_arg1.NewgroundsAPI_UserID){
_connection.userId = _arg1.NewgroundsAPI_UserID;
};
if (_arg1.NewgroundsAPI_PublisherID){
_connection.publisherId = _arg1.NewgroundsAPI_PublisherID;
};
if (_arg1.NewgroundsAPI_UserpageFormat){
_connection.userpageFormat = _arg1.NewgroundsAPI_UserpageFormat;
};
if (_arg1.NewgroundsAPI_SessionID){
_connection.sessionId = _arg1.NewgroundsAPI_SessionID;
};
if (_arg1.NewgroundsAPI_SaveGroupID){
_requestedSaveGroupId = _arg1.NewgroundsAPI_SaveGroupID;
};
if (_arg1.NewgroundsAPI_SaveFileID){
_requestedSaveFileId = _arg1.NewgroundsAPI_SaveFileID;
};
};
} else {
_connection.debug = true;
if ((((_debugMode == DEBUG_MODE_LOGGED_IN)) || ((_debugMode == DEBUG_MODE_LOGGED_OUT)))){
_connection.publisherId = 1;
};
if (_debugMode == DEBUG_MODE_LOGGED_IN){
_connection.sessionId = "D3bu64p1U53R";
_connection.userId = 10;
_connection.username = "API-Debugger";
};
};
_connection.sendSimpleCommand("connectMovie", onConnect, {host:_connection.hostDomain, movie_version:_movieVersion, publisher_id:_connection.publisherId});
}
private static function onConnect(_arg1:APIEvent):void{
var _local2:Object = _arg1.data;
if (!_arg1.success){
Logger.logError("Unable to connect to the API.");
_connection.reset();
dispatchEvent(APIEvent.API_CONNECTED, _arg1.data, _arg1.error);
return;
};
if (debugMode != RELEASE_MODE){
_adFeedURL = TEST_AD_FEED_URL;
} else {
if (_local2.ad_url){
_adFeedURL = unescape(_local2.ad_url);
};
};
switch (_local2.ad_status){
case -1:
Logger.logWarning("Your movie is not approved to run Flash Ads.");
break;
case 0:
Logger.logWarning("Your movie is still awaiting approval to run Flash Ads.");
break;
case 1:
Logger.logMessage("Your movie is approved to run Flash Ads!");
break;
};
_adsApproved = (_local2.ad_status == 1);
if ((((_debugMode == DEBUG_MODE_HOST_BLOCKED)) || (_local2.deny_host))){
Logger.logWarning((_connection.hostDomain + " does not have permission to host this movie!"), "Update your API configuration to allow this host.");
dispatchEvent(APIEvent.API_CONNECTED, {officialURL:unescape(_local2.movie_url)}, APIEvent.ERROR_HOST_BLOCKED);
_connection.reset();
return;
};
_movieName = (_local2.movieName) ? _local2.movieName : "";
Logger.logMessage("Connecting to the Newgrounds API Gateway...", (("----- " + _local2.movie_name) + " -----"));
if (_debugMode == DEBUG_MODE_NEW_VERSION){
_local2.movie_version = "Debug Mode";
};
if (_local2.movie_version){
Logger.logMessage("A new version of this movie is available.", ("Current version:\t" + _movieVersion), ("Newest version:\t" + _local2.movie_version), "Use API.loadOfficialVersion() to link to the latest version.");
_newVersion = true;
} else {
_newVersion = false;
};
if (_local2.request_portal_url){
_connection.sendSimpleCommand("setPortalID", null, {portal_url:_connection.hostURL});
};
_connection.sendSimpleCommand("preloadSettings", onMetadataLoaded, {publisher_id:_connection.publisherId, user_id:_connection.userId});
}
private static function onMetadataLoaded(_arg1:APIEvent):void{
var _local3:uint;
var _local4:uint;
var _local6:Object;
var _local7:Object;
var _local8:Boolean;
var _local9:Boolean;
var _local10:Boolean;
var _local11:Medal;
var _local12:Object;
var _local13:ScoreBoard;
var _local14:Object;
var _local15:Array;
var _local16:Array;
var _local17:SaveGroup;
var _local18:Object;
var _local19:Object;
var _local2:Object = _arg1.data;
if (!_arg1.success){
Logger.logWarning("Unable to load movie metadata.");
disconnect();
dispatchEvent(APIEvent.API_CONNECTED, null, _arg1.error);
return;
};
var _local5:uint;
if (_local2.medals){
_local5 = _local2.medals.length;
if (hasUserSession){
_local6 = loadLocal(("medals_unlocked_" + username));
} else {
_local6 = loadLocal("medals_unlocked");
};
_local3 = 0;
while (_local3 < _local5) {
_local7 = _local2.medals[_local3];
_local8 = _local7.medal_unlocked;
_local9 = ((_local6) && (_local6[_local7.medal_id]));
_local10 = (hasUserSession) ? _local8 : _local9;
if (debugMode != RELEASE_MODE){
_local10 = false;
};
_local11 = new Medal(_connection, _local7.medal_id, _local7.medal_name, _local7.medal_description, Boolean(int(_local7.secret)), _local10, _local7.medal_value, _local7.medal_difficulty, _local7.medal_icon);
_local11.addEventListener(APIEvent.MEDAL_UNLOCKED, onMedalUnlocked, false, 0, true);
_local11.addEventListener(APIEvent.MEDAL_UNLOCK_CONFIRMED, onMedalUnlockConfirmed, false, 0, true);
_medals[_local11.name] = _local11;
_medalsArray.push(_local11);
Logger.logMessage(_local11);
if (((((hasUserSession) && (_local9))) && (!(_local8)))){
Logger.logMessage((("Server missed the \"" + _local11.name) + "\" unlock. Resending..."));
_local11.unlock();
};
_local3++;
};
};
Logger.logMessage((((_local5 + " medal") + ((_local5)!=1) ? "s" : "") + " initialized."));
_local5 = 0;
if (_local2.score_boards){
_local5 = _local2.score_boards.length;
_local3 = 0;
while (_local3 < _local5) {
_local12 = _local2.score_boards[_local3];
_local13 = new ScoreBoard(_connection, _local12.name, _local12.id);
_scoreBoards[_local13.name] = _local13;
_scoreBoardsArray.push(_local13);
Logger.logMessage(_local13);
_local3++;
};
};
Logger.logMessage((((_local5 + " scoreboard") + ((_local5)!=1) ? "s" : "") + " initialized."));
_local5 = 0;
if (_local2.save_groups){
_local5 = _local2.save_groups.length;
_local3 = 0;
while (_local3 < _local5) {
_local14 = _local2.save_groups[_local3];
_local15 = [];
if (_local14.keys){
_local4 = 0;
while (_local4 < _local14.keys.length) {
_local18 = _local14.keys[_local4];
_local15.push(new SaveKey(_local18.name, _local18.id, _local18.type));
_local4++;
};
};
_local16 = [];
if (_local14.ratings){
_local3 = 0;
while (_local3 < _local14.ratings.length) {
_local19 = _local14.ratings[_local3];
_local16.push(new SaveRating(_local19.name, _local19.id, _local19.float, _local19.min, _local19.max));
_local3++;
};
};
_local17 = new SaveGroup(_connection, _local14.group_name, _local14.group_id, _local14.group_type, _local15, _local16);
_saveGroups[_local17.name] = _local17;
_saveGroupsArray.push(_local17);
Logger.logMessage(_local17);
_local3++;
};
};
Logger.logMessage((((_local5 + " save group") + ((_local5)!=1) ? "s" : "") + " initialized."));
if (_local2.save_file_path){
_saveFilePath = (_local2.save_file_path + "/");
SaveFile._saveFilePath = _saveFilePath;
Logger.logInternal(("Save file path: " + _saveFilePath));
};
if (_local2.image_file_path){
_imageFilePath = (_local2.image_file_path + "/");
SaveFile._imageFilePath = _imageFilePath;
Logger.logInternal(("Image file path: " + _imageFilePath));
};
Logger.logMessage("Connection complete!");
_connection.connectionState = APIConnection.CONNECTED;
dispatchEvent(APIEvent.API_CONNECTED, {movieName:_movieName, newVersion:_newVersion});
if (((_requestedSaveFileId) && (_requestedSaveGroupId))){
API.addEventListener(APIEvent.FILE_LOADED, onRequestedFileLoaded);
API.loadSaveFile(_requestedSaveFileId, false);
};
}
public static function disconnect():void{
var _local1:Medal;
if (!_connection.connected){
Logger.logWarning("The Newgrounds API is already disconnected.");
return;
};
_connection.reset();
for each (_local1 in _medals) {
_local1.removeEventListener(APIEvent.MEDAL_UNLOCKED, onMedalUnlocked);
_local1.removeEventListener(APIEvent.MEDAL_UNLOCK_CONFIRMED, onMedalUnlockConfirmed);
};
_newVersion = false;
_medals = new Object();
_medalsArray = [];
_scoreBoards = new Object();
_scoreBoardsArray = [];
_saveGroups = new Object();
_saveGroupsArray = [];
_sharedObjects = new Object();
_imageFilePath = null;
_saveFilePath = null;
Logger.logMessage("Disconnected from the Newgrounds API.");
}
public static function loadNewgrounds():void{
_connection.loadInBrowser("loadNewgrounds");
}
public static function loadOfficialVersion():void{
if (_connection.assertInitialized()){
_connection.loadInBrowser("loadOfficialVersion", false);
};
}
public static function loadMySite():void{
if (_connection.assertInitialized()){
_connection.loadInBrowser("loadMySite");
};
}
public static function loadCustomLink(_arg1:String):void{
if (_connection.assertInitialized()){
_connection.loadInBrowser("loadCustomLink", true, {link:_arg1});
};
}
public static function getMedal(_arg1:String):Medal{
return (_medals[_arg1]);
}
public static function unlockMedal(_arg1:String):void{
if (!assertConnected()){
return;
};
var _local2:Medal = _medals[_arg1];
if (!_local2){
Logger.logError((("No medal named \"" + _arg1) + "\" was found."));
return;
};
_local2.unlock();
}
private static function onMedalUnlocked(_arg1:APIEvent):void{
var _local2:Medal;
var _local3:Object;
if (_arg1.success){
_local2 = Medal(_arg1.data);
if (hasUserSession){
_local3 = loadLocal(("medals_unlocked_" + username));
if (!_local3){
_local3 = new Object();
};
_local3[_local2.id] = true;
saveLocal(("medals_unlocked_" + username), _local3);
} else {
_local3 = loadLocal("medals_unlocked");
if (!_local3){
_local3 = new Object();
};
_local3[Medal(_arg1.data).id] = true;
saveLocal("medals_unlocked", _local3);
Logger.logMessage((("User is not logged in. Medal \"" + _local2.name) + "\" unlocked locally."));
};
};
}
private static function onMedalUnlockConfirmed(_arg1:APIEvent):void{
var _local2:Object;
if (hasUserSession){
_local2 = loadLocal(("medals_unlocked_" + username));
if (!_local2){
_local2 = new Object();
} else {
delete _local2[Medal(_arg1.data).id];
};
saveLocal(("medals_unlocked_" + username), _local2);
};
}
public static function clearLocalMedals():void{
var _local1:Medal;
for each (_local1 in _medals) {
_local1.setUnlocked(false);
};
if (!hasUserSession){
saveLocal("medals_unlocked", new Object());
};
}
public static function getScoreBoard(_arg1:String):ScoreBoard{
if (!assertConnected()){
return (null);
};
return (_scoreBoards[_arg1]);
}
public static function loadScores(_arg1:String, _arg2:String="All-Time", _arg3:uint=1, _arg4:uint=10, _arg5:String=null):ScoreBoard{
if (!assertConnected()){
return (null);
};
var _local6:ScoreBoard = _scoreBoards[_arg1];
if (!_local6){
Logger.logError((("No scoreboard named \"" + _arg1) + "\" was found."));
dispatchEvent(APIEvent.SCORES_LOADED, null, APIEvent.ERROR_INVALID_ARGUMENT);
return (null);
};
_local6.period = _arg2;
_local6.firstResult = _arg3;
_local6.numResults = _arg4;
_local6.tag = _arg5;
_local6.loadScores();
return (_local6);
}
public static function postScore(_arg1:String, _arg2:Number, _arg3:String=null):void{
if (!assertConnected()){
return;
};
if (!hasUserSession){
Logger.logError("The user must be logged-in to post a score.");
dispatchEvent(APIEvent.SCORE_POSTED, null, APIEvent.ERROR_NOT_LOGGED_IN);
return;
};
var _local4:ScoreBoard = _scoreBoards[_arg1];
if (!_local4){
Logger.logError((("No scoreboard named \"" + _arg1) + "\" was found."));
dispatchEvent(APIEvent.SCORE_POSTED, null, APIEvent.ERROR_INVALID_ARGUMENT);
return;
};
_local4.postScore(_arg2, _arg3);
}
public static function getSaveGroup(_arg1:String):SaveGroup{
if (!assertConnected()){
return (null);
};
return (_saveGroups[_arg1]);
}
private static function getSaveGroupById(_arg1:uint):SaveGroup{
var _local2:SaveGroup;
for each (_local2 in _saveGroups) {
if (_local2.id == _arg1){
return (_local2);
};
};
return (null);
}
public static function createSaveFile(_arg1:String):SaveFile{
if (!assertConnected()){
return (null);
};
var _local2:SaveGroup = getSaveGroup(_arg1);
if (!_local2){
Logger.logError((("The save group \"" + _arg1) + "\" was not found."));
return (null);
};
return (new SaveFile(_local2));
}
public static function loadSaveFile(_arg1:uint, _arg2:Boolean=true):void{
_connection.sendSimpleCommand("loadSaveFile", onFileLoaded, {save_id:_arg1, get_contents:_arg2});
}
private static function onFileLoaded(_arg1:APIEvent):void{
var _local2:SaveFile;
if (_arg1.success){
_local2 = SaveFile.fromObject(getSaveGroupById(_arg1.data.group_id), _arg1.data.file);
if (_arg1.data.get_contents){
_local2.load();
} else {
dispatchEvent(APIEvent.FILE_LOADED, _local2);
};
} else {
Logger.logError("Unable to load file:", _arg1.error);
dispatchEvent(APIEvent.FILE_LOADED, null, _arg1.error);
};
}
public static function createSaveQuery(_arg1:String):SaveQuery{
if (!assertConnected()){
return (null);
};
var _local2:SaveGroup = getSaveGroup(_arg1);
if (!_local2){
Logger.logError((("The save group \"" + _arg1) + "\" was not found."));
return (null);
};
var _local3:SaveQuery = new SaveQuery(_local2);
return (_local3);
}
public static function createSaveQueryByDate(_arg1:String, _arg2:Boolean=true):SaveQuery{
var _local3:SaveQuery = createSaveQuery(_arg1);
if (!_local3){
return (null);
};
_local3.sortOn(SaveQuery.CREATED_ON, _arg2);
return (_local3);
}
public static function createSaveQueryByName(_arg1:String, _arg2:String, _arg3:Boolean=false, _arg4:Boolean=false):SaveQuery{
var _local5:SaveQuery = createSaveQuery(_arg1);
_local5.addCondition(SaveQuery.FILE_NAME, (_arg3) ? SaveQuery.OPERATOR_EQUAL : SaveQuery.OPERATOR_CONTAINS, _arg2);
return (_local5);
}
public static function createSaveQueryByRating(_arg1:String, _arg2:String, _arg3:Boolean=true):SaveQuery{
var _local4:SaveQuery = createSaveQuery(_arg1);
_local4.sortOn(_arg2, _arg3);
return (_local4);
}
private static function onRequestedFileLoaded(_arg1:APIEvent):void{
var _local2:SaveFile;
API.removeEventListener(APIEvent.FILE_LOADED, onRequestedFileLoaded);
if (_arg1.success){
_local2 = (_arg1.data as SaveFile);
if (_local2){
dispatchEvent(APIEvent.FILE_REQUESTED, _local2);
};
};
}
public static function addEventListener(_arg1:String, _arg2:Function, _arg3:int=0, _arg4:Boolean=true):void{
_dispatcher.addEventListener(_arg1, _arg2, false, _arg3, _arg4);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
private static function dispatchEvent(_arg1:String, _arg2=null, _arg3:String=null):void{
_dispatcher.dispatchEvent(new APIEvent(_arg1, _arg2, _arg3));
}
public static function saveLocal(_arg1:String, _arg2:Object):Boolean{
var sharedObject:SharedObject;
var sharedObjectName:String;
var saveId = _arg1;
var saveData = _arg2;
try {
sharedObjectName = ((("ng_ap_secure_" + _connection.trackerId) + "_") + RC4.encrypt(saveId, _connection.encryptionKey));
if (!_sharedObjects[saveId]){
_sharedObjects[saveId] = SharedObject.getLocal(sharedObjectName);
};
sharedObject = _sharedObjects[saveId];
sharedObject.data.data = encodeData(saveData);
} catch(error:Error) {
Logger.logError("Unable to save local data.", error);
return (false);
};
return (true);
}
public static function loadLocal(_arg1:String):Object{
var sharedObject:SharedObject;
var sharedObjectName:String;
var saveId = _arg1;
try {
sharedObjectName = ((("ng_ap_secure_" + _connection.trackerId) + "_") + RC4.encrypt(saveId, _connection.encryptionKey));
if (!_sharedObjects[saveId]){
_sharedObjects[saveId] = SharedObject.getLocal(sharedObjectName);
};
sharedObject = _sharedObjects[saveId];
if (((((sharedObject) && (sharedObject.data))) && (sharedObject.data.data))){
return (decodeData(sharedObject.data.data));
};
return (null);
} catch(error:Error) {
Logger.logError("Unable to load local data.", error);
};
return (null);
}
public static function logCustomEvent(_arg1:String):void{
if (assertConnected()){
Logger.logMessage(("Logged event: " + _arg1));
_connection.sendSimpleCommand("logCustomEvent", null, {event:_arg1});
};
}
private static function encodeData(_arg1:Object):String{
if (!_connection.assertInitialized()){
return (null);
};
return (RC4.encrypt(JSON.encode(_arg1), _connection.encryptionKey));
}
private static function decodeData(_arg1:String):Object{
if (!_connection.assertInitialized()){
return (null);
};
try {
return ((JSON.decode(RC4.decrypt(_arg1, _connection.encryptionKey)) as Object));
} catch(error:Error) {
};
return (null);
}
public static function stopPendingCommands():void{
APICommand.stopPendingCommands();
Logger.logMessage("Pending commands stopped.");
}
private static function trimWhitespace(_arg1:String):String{
if (!_arg1){
return (null);
};
var _local2:int;
while (_arg1.charAt(_local2) == " ") {
_local2++;
};
var _local3:int = (_arg1.length - 1);
while ((((_arg1.charAt(_local3) == " ")) && ((_local3 >= 0)))) {
_local3--;
};
return (_arg1.slice(_local2, (_local3 + 1)));
}
private static function checkRootLoaderInfo(_arg1:Event):void{
var event = _arg1;
var loaderInfo:LoaderInfo = _root.loaderInfo;
if (loaderInfo){
try {
while (loaderInfo.loader) {
loaderInfo = loaderInfo.loader.loaderInfo;
};
} catch(error:Error) {
return;
};
_root.removeEventListener(Event.ENTER_FRAME, checkRootLoaderInfo);
_connection.hostURL = loaderInfo.url;
doConnect(loaderInfo.parameters);
};
}
}
}//package com.newgrounds
Section 68
//APICommand (com.newgrounds.APICommand)
package com.newgrounds {
import flash.utils.*;
import flash.events.*;
import flash.net.*;
import com.newgrounds.encoders.json.*;
import com.newgrounds.crypto.*;
import com.newgrounds.encoders.*;
public class APICommand extends APIEventDispatcher {
private var _command:String;
private var _parameters:Object;
private var _secureParameters:Object;
private var _files:Object;
private var _preventCache:Boolean;
private var _hasTimeout:Boolean;
private var _timeoutTimer:Timer;
private var _loader:URLLoader;
private static const TIMEOUT_INTERVAL:uint = 10000;
private static const THROTTLE_INTERVAL:uint = 10050;
private static const THROTTLE_TICK_INTERVAL:uint = 1000;
private static const THROTTLE_THRESHOLD:uint = 24;
private static const ENCRYPTOR_RADIX:String = "/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X";
private static const CRLF:String = "
";
public static var bridge:Bridge;
private static var _throttleTimestamp:uint;
private static var _throttleCount:int = 0;
private static var _commandQueue:Array = [];
private static var _encryptor:BaseN = new BaseN(ENCRYPTOR_RADIX);
private static var _pendingCommands:Array = [];
private static var _throttleTimer:Timer = function ():Timer{
var _local1:* = new Timer(THROTTLE_TICK_INTERVAL, 0);
_local1.addEventListener(TimerEvent.TIMER, onThrottleTimer);
_local1.start();
return (_local1);
}();
public function APICommand(_arg1:String){
this._command = _arg1;
this._parameters = new Object();
this._secureParameters = new Object();
this._timeoutTimer = new Timer(TIMEOUT_INTERVAL, 1);
this._timeoutTimer.addEventListener(TimerEvent.TIMER, this.onTimeout);
this._hasTimeout = true;
}
public function get command():String{
return (this._command);
}
public function set command(_arg1:String):void{
this._command = _arg1;
}
public function get hasTimeout():Boolean{
return (this._hasTimeout);
}
public function set hasTimeout(_arg1:Boolean):void{
this._hasTimeout = _arg1;
}
public function get parameters():Object{
return (this._parameters);
}
public function set parameters(_arg1:Object):void{
var _local2:String;
this._parameters = new Object();
if (_arg1){
for (_local2 in _arg1) {
this._parameters[_local2] = _arg1[_local2];
};
};
}
public function get preventCache():Boolean{
return (this._preventCache);
}
public function set preventCache(_arg1:Boolean):void{
this._preventCache = _arg1;
}
public function get secureParameters():Object{
return (this._secureParameters);
}
public function set secureParameters(_arg1:Object):void{
var _local2:String;
this._secureParameters = new Object();
if (_arg1){
for (_local2 in _arg1) {
this._secureParameters[_local2] = _arg1[_local2];
};
};
}
public function get hasSecureParameters():Boolean{
var _local1:String;
for (_local1 in this._secureParameters) {
return (true);
};
return (false);
}
public function addFile(_arg1:String, _arg2:ByteArray, _arg3:String, _arg4:String="application/octet-stream"):void{
if (!this._files){
this._files = new Object();
};
var _local5:Object = {filename:_arg1, data:_arg2, dataField:_arg3, contentType:_arg4};
this._files[_arg1] = _local5;
}
public function removeFile(_arg1:String):void{
if (this._files){
delete this._files[_arg1];
};
}
public function clearFiles():void{
this._files = null;
}
public function close():void{
var _local1:uint;
if (this._loader){
try {
this._loader.close();
} catch(error:Error) {
};
this._timeoutTimer.stop();
_local1 = 0;
while (_local1 < _pendingCommands.length) {
if (_pendingCommands[_local1] == this){
_pendingCommands.splice(_local1, 1);
break;
};
_local1++;
};
this._loader = null;
};
}
public function loadInBrowser(_arg1:APIConnection, _arg2:Boolean):void{
var _local4:String;
var _local5:String;
this._parameters.command_id = this._command;
this._parameters.tracker_id = (_arg1.apiId) ? _arg1.apiId : 1;
if (_arg1.debug){
this._parameters.debug = 1;
};
var _local3:String = ((_arg1.apiURL + "?host=") + escape(_arg1.hostDomain));
for (_local4 in this._parameters) {
_local3 = (_local3 + ((("&" + escape(_local4)) + "=") + escape(this._parameters[_local4])));
};
if (_arg2){
_local5 = "_blank";
} else {
_local5 = "_top";
};
navigateToURL(new URLRequest(_local3), _local5);
}
public function send(_arg1:APIConnection):void{
if (_throttleCount >= THROTTLE_THRESHOLD){
_commandQueue.push({connection:_arg1, command:this});
} else {
this.sendInternal(_arg1);
};
}
private function sendInternal(_arg1:APIConnection):void{
var _local2:Object;
var _local3:String;
var _local4:*;
var _local5:uint;
var _local6:String;
var _local7:Object;
var _local8:String;
var _local9:String;
var _local10:String;
var _local11:String;
_local2 = new URLVariables();
_local2.command_id = this._command;
_local2.tracker_id = _arg1.apiId;
if (_arg1.debug){
_local2.debug = 1;
};
if (this._preventCache){
_local2.seed = Math.random();
};
for (_local3 in this._parameters) {
_local4 = this._parameters[_local3];
if (_local4 != null){
if ((_local4 is Boolean)){
_local2[_local3] = int(_local4);
} else {
_local2[_local3] = _local4;
};
};
};
if (this.hasSecureParameters){
_local7 = new Object();
for (_local3 in this._secureParameters) {
_local4 = this._secureParameters[_local3];
if (_local4 != null){
if ((_local4 is Boolean)){
_local7[_local3] = int(_local4);
} else {
_local7[_local3] = _local4;
};
};
};
_local8 = "";
_local5 = 0;
while (_local5 < 16) {
_local8 = (_local8 + ENCRYPTOR_RADIX.charAt(uint((Math.random() * ENCRYPTOR_RADIX.length))));
_local5++;
};
_local2.command_id = "securePacket";
_local7.command_id = this._command;
_local7.as_version = 3;
_local7.session_id = _arg1.sessionId;
_local7.user_email = _arg1.userEmail;
_local7.publisher_id = _arg1.publisherId;
_local7.seed = _local8;
_local9 = MD5.hash(_local8);
_local10 = RC4.encrypt(JSON.encode(_local7), _arg1.encryptionKey);
_local2.secure = encryptHex((_local9 + _local10));
};
Logger.logInternal("Sending packet:", _local2);
if (this._files){
_local11 = "";
_local5 = 0;
while (_local5 < 32) {
_local11 = (_local11 + String.fromCharCode(uint((97 + (Math.random() * 25)))));
_local5++;
};
_local6 = (("multipart/form-data; boundary=\"" + _local11) + "\"");
_local2 = this.buildMultipartData(_local11, _local2, this._files);
} else {
for (_local3 in _local2) {
if (typeof(_local2[_local3]) == "object"){
_local2[_local3] = JSON.encode(_local2[_local3]);
};
};
_local6 = "application/x-www-form-urlencoded";
};
_pendingCommands.push(this);
_throttleCount++;
_throttleTimestamp = getTimer();
this.startLoader(_arg1.apiURL, _local2, _local6);
}
private function onTimeout(_arg1):void{
this.close();
Logger.logError("Command timed out.");
dispatchEvent(new APIEvent(APIEvent.COMMAND_COMPLETE, null, APIEvent.ERROR_TIMED_OUT));
}
private function onError(_arg1:String):void{
Logger.logError("Error when sending command:", _arg1);
dispatchEvent(new APIEvent(APIEvent.COMMAND_COMPLETE, null, APIEvent.ERROR_UNKNOWN));
this.close();
}
private function onComplete(_arg1:String):void{
var response:Object;
var data = _arg1;
try {
if (((!(data)) || ((data == "")))){
throw (new Error());
};
Logger.logInternal("Received packet:", data);
response = JSON.decode(data);
if (!response){
throw (new Error());
};
if (bridge){
bridge.sendEvent(response.command_id, response);
};
dispatchEvent(new APIEvent(APIEvent.COMMAND_COMPLETE, response, (((response) && (response.success))) ? APIEvent.ERROR_NONE : APIEvent.ERROR_COMMAND_FAILED));
} catch(e) {
Logger.logError(("Invalid response returned from server: " + data));
dispatchEvent(new APIEvent(APIEvent.COMMAND_COMPLETE, null, APIEvent.ERROR_BAD_RESPONSE));
};
this.close();
}
private function startLoader(_arg1:String, _arg2:Object, _arg3:String):void{
var url = _arg1;
var data = _arg2;
var contentType = _arg3;
var urlRequest:URLRequest = new URLRequest(url);
urlRequest.data = data;
urlRequest.method = URLRequestMethod.POST;
urlRequest.contentType = contentType;
this._loader = new URLLoader();
this._loader.addEventListener(Event.COMPLETE, this.as3CompleteHandler);
this._loader.addEventListener(Event.OPEN, this.as3UpdateHandler);
this._loader.addEventListener(ProgressEvent.PROGRESS, this.as3UpdateHandler);
this._loader.addEventListener(IOErrorEvent.IO_ERROR, this.as3ErrorHandler);
this._loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.as3ErrorHandler);
try {
this._loader.load(urlRequest);
if (this._hasTimeout){
this._timeoutTimer.start();
};
} catch(error) {
onError(error.toString());
};
}
private function as3CompleteHandler(_arg1:Event):void{
this.onComplete(this._loader.data);
}
private function as3UpdateHandler(_arg1:Event):void{
if (this._timeoutTimer.running){
this._timeoutTimer.reset();
this._timeoutTimer.start();
};
}
private function as3ErrorHandler(_arg1:Event):void{
this.onError(_arg1.toString());
}
private function buildMultipartData(_arg1:String, _arg2:Object, _arg3:Object):ByteArray{
var _local5:String;
var _local6:Object;
var _local4:ByteArray = new ByteArray();
_local4.endian = Endian.BIG_ENDIAN;
_arg1 = ("--" + _arg1);
for (_local5 in _arg2) {
_local4.writeUTFBytes((_arg1 + CRLF));
_local4.writeUTFBytes(((("Content-Disposition: form-data; name=\"" + _local5) + "\"") + CRLF));
_local4.writeUTFBytes(CRLF);
_local4.writeUTFBytes((_arg2[_local5].toString() + CRLF));
};
if (this._files){
for each (_local6 in _arg3) {
_local4.writeUTFBytes((_arg1 + CRLF));
_local4.writeUTFBytes(("Content-Disposition: form-data; name=\"Filename\"" + CRLF));
_local4.writeUTFBytes(CRLF);
_local4.writeUTFBytes((_local6.filename + CRLF));
_local4.writeUTFBytes((_arg1 + CRLF));
_local4.writeUTFBytes(((((("Content-Disposition: form-data; name=\"" + _local6.dataField) + "\"; filename=\"") + _local6.filename) + "\"") + CRLF));
_local4.writeUTFBytes((("Content-Type: " + _local6.contentType) + CRLF));
_local4.writeUTFBytes(CRLF);
_local4.writeBytes(_local6.data);
_local4.writeUTFBytes(CRLF);
};
_local4.writeUTFBytes((_arg1 + CRLF));
_local4.writeUTFBytes(("Content-Disposition: form-data; name=\"Upload\"" + CRLF));
_local4.writeUTFBytes(CRLF);
_local4.writeUTFBytes(("Submit Query" + CRLF));
};
_local4.writeUTFBytes((_arg1 + "--"));
_local4.position = 0;
return (_local4);
}
public static function stopPendingCommands():void{
var _local1:APICommand;
for each (_local1 in _pendingCommands) {
_local1.close();
};
_pendingCommands = [];
}
private static function onThrottleTimer(_arg1):void{
var _local2:Object;
if ((getTimer() - _throttleTimestamp) >= THROTTLE_INTERVAL){
_throttleCount = 0;
_throttleCount = 0;
while (((_commandQueue.length) && ((_throttleCount < THROTTLE_THRESHOLD)))) {
_local2 = _commandQueue.shift();
_local2.command.send(_local2.connection);
_throttleCount++;
};
};
}
private static function encryptHex(_arg1:String):String{
var _local2:uint = (_arg1.length % 6);
var _local3 = "";
var _local4:uint;
while (_local4 < _arg1.length) {
_local3 = (_local3 + _encryptor.encodeUint(uint(("0x" + _arg1.substr(_local4, 6))), 4));
_local4 = (_local4 + 6);
};
return ((_local2.toString() + _local3));
}
}
}//package com.newgrounds
Section 69
//APIConnection (com.newgrounds.APIConnection)
package com.newgrounds {
import flash.system.*;
public class APIConnection {
public var initialized:Boolean;
public var connectionState:String;// = "notConnected"
public var apiURL:String;// = "http://www.ngads.com/gateway_v2.php"
public var apiId:String;
public var debug:Boolean;
public var trackerId:uint;
public var publisherId:uint;
public var encryptionKey:String;
public var sessionId:String;
public var userEmail:String;
public var username:String;
public var userId:uint;
public var userpageFormat:uint;
private var _hostURL:String;
public var hostDomain:String;
public static const NOT_CONNECTED:String = "notConnected";
public static const CONNECTING:String = "connecting";
public static const CONNECTED:String = "connected";
public function APIConnection(){
this.reset();
}
public function get hostURL():String{
return (this._hostURL);
}
public function set hostURL(_arg1:String):void{
var _local2:Array;
this._hostURL = _arg1;
this.hostDomain = null;
if (this._hostURL){
_local2 = this._hostURL.split("/");
if (((!((_local2[0] == "file:"))) && (!((this._hostURL == "localhost"))))){
this.hostDomain = _local2[2];
};
};
if (!this.hostDomain){
this.hostDomain = "localhost";
};
}
public function get sandboxType():String{
return (Security.sandboxType);
}
public function get isNetworkHost():Boolean{
switch (this.sandboxType){
case "localWithFile":
case "localWithNetwork":
case "localTrusted":
case "application":
return (false);
case "remote":
default:
return (true);
};
}
public function get hasUserSession():Boolean{
return (((((!((this.sessionId == null))) && (!((this.sessionId == ""))))) && (!((this.publisherId == 0)))));
}
public function get connected():Boolean{
return ((this.connectionState == CONNECTED));
}
public function reset():void{
this.connectionState = NOT_CONNECTED;
this.encryptionKey = null;
this.sessionId = null;
this.userEmail = null;
this.username = null;
this.userId = 0;
this.userpageFormat = 0;
}
public function assertInitialized():Boolean{
if (!this.initialized){
Logger.logError("You must initialized the API using API.connect() before using this command.");
return (false);
};
return (true);
}
public function assertConnected():Boolean{
if (!(this.connectionState) == CONNECTED){
Logger.logError("You must establish a connection using API.connect() before using this command.");
return (false);
};
return (true);
}
public function sendSimpleCommand(_arg1:String, _arg2:Function, _arg3:Object=null, _arg4:Object=null):void{
var _local5:APICommand = new APICommand(_arg1);
_local5.parameters = _arg3;
_local5.secureParameters = _arg4;
if (_arg2 != null){
_local5.addEventListener(APIEvent.COMMAND_COMPLETE, _arg2);
};
_local5.send(this);
}
public function sendCommand(_arg1:APICommand):void{
_arg1.send(this);
}
public function loadInBrowser(_arg1:String, _arg2:Boolean=true, _arg3:Object=null):void{
var _local4:APICommand = new APICommand(_arg1);
_local4.parameters = _arg3;
_local4.loadInBrowser(this, _arg2);
}
}
}//package com.newgrounds
Section 70
//APIEvent (com.newgrounds.APIEvent)
package com.newgrounds {
import flash.events.*;
public class APIEvent extends Event {
private var _data;
private var _success:Boolean;
private var _error:String;
static const COMMAND_COMPLETE:String = "commandComplete";
static const MEDAL_UNLOCK_CONFIRMED:String = "medalUnlockConfirmed";
static const ICON_LOADED:String = "iconLoaded";
public static const API_CONNECTED:String = "movieConnected";
public static const LOG:String = "log";
public static const MEDAL_UNLOCKED:String = "medalUnlocked";
public static const SCORES_LOADED:String = "scoresLoaded";
public static const SCORE_POSTED:String = "scorePosted";
public static const QUERY_COMPLETE:String = "queryComplete";
public static const FILE_LOADED:String = "fileLoaded";
public static const FILE_SAVED:String = "fileSaved";
public static const FILE_REQUESTED:String = "fileRequested";
public static const VOTE_COMPLETE:String = "voteComplete";
public static const ERROR_NONE:String = "noError";
public static const ERROR_UNKNOWN:String = "unknownError";
public static const ERROR_COMMAND_FAILED:String = "commandFailed";
public static const ERROR_NOT_CONNECTED:String = "notConnected";
public static const ERROR_INVALID_ARGUMENT:String = "invalidArgument";
public static const ERROR_TIMED_OUT:String = "timedOut";
public static const ERROR_BAD_FILE:String = "badFile";
public static const ERROR_BAD_RESPONSE:String = "badResponse";
public static const ERROR_SENDING_COMMAND:String = "errorSendingCommand";
public static const ERROR_HOST_BLOCKED:String = "hostBlocked";
public static const ERROR_ALREADY_VOTED:String = "alreadyVoted";
public static const ERROR_NOT_LOGGED_IN:String = "notLoggedIn";
public static const ERROR_WRONG_ENCRYPTION_KEY:String = "wrongEncryptionKey";
public function APIEvent(_arg1:String, _arg2=null, _arg3:String=null){
super(_arg1);
if (((((!(_arg3)) || ((_arg3 == "")))) || ((_arg3 == ERROR_NONE)))){
this._error = ERROR_NONE;
this._success = true;
} else {
this._error = _arg3;
this._success = false;
};
if (_arg2){
this._data = _arg2;
} else {
this._data = {};
};
}
override public function clone():Event{
return (new APIEvent(type, this._data, this._error));
}
public function get success():Boolean{
return (this._success);
}
public function get data(){
return (this._data);
}
public function get error():String{
return (this._error);
}
}
}//package com.newgrounds
Section 71
//APIEventDispatcher (com.newgrounds.APIEventDispatcher)
package com.newgrounds {
import flash.display.*;
import com.newgrounds.*;
import flash.events.*;
class APIEventDispatcher extends EventDispatcher {
private static var _globalDispatcher:EventDispatcher;
private static var _eventQueue:Array = initEventQueue();
private static var _ticker:Sprite;
override public function dispatchEvent(_arg1:Event):Boolean{
_eventQueue.push({dispatcher:this, event:_arg1});
return (true);
}
private function actualDispatchEvent(_arg1:Event):void{
var _local2:Boolean = super.dispatchEvent(_arg1);
if (((_globalDispatcher) && (!((this == _globalDispatcher))))){
_globalDispatcher.dispatchEvent(_arg1);
};
}
public static function get globalDispatcher():EventDispatcher{
return (_globalDispatcher);
}
public static function set globalDispatcher(_arg1:EventDispatcher):void{
_globalDispatcher = _arg1;
}
private static function initEventQueue():Array{
_ticker = new Sprite();
_ticker.addEventListener(Event.ENTER_FRAME, runEventQueue);
return ([]);
}
private static function runEventQueue(_arg1):void{
var _local3:Array;
var _local4:uint;
var _local5:Object;
var _local2:uint = _eventQueue.length;
if (_local2){
_local3 = _eventQueue;
_eventQueue = [];
_local4 = 0;
while (_local4 < _local2) {
_local5 = _local3[_local4];
_local5.dispatcher.actualDispatchEvent(_local5.event);
_local4++;
};
};
}
}
}//package com.newgrounds
Section 72
//BitmapLoader (com.newgrounds.BitmapLoader)
package com.newgrounds {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class BitmapLoader extends APIEventDispatcher {
private var _url:String;
private var _bitmapData:BitmapData;
private var _loaded:Boolean;// = true
private var _loader:Loader;
private static const LOADER_CONTEXT:LoaderContext = new LoaderContext(true);
static var _cacheSeed:uint = 0;
public function BitmapLoader(_arg1:BitmapData, _arg2:String){
this._bitmapData = _arg1;
this._url = _arg2;
}
public function get url():String{
return (this._url);
}
public function set url(_arg1:String):void{
this._loaded = false;
this._url = _arg1;
}
public function get bitmapData():BitmapData{
return (this._bitmapData);
}
public function set bitmapData(_arg1:BitmapData):void{
this._bitmapData = _arg1;
this._loaded = true;
}
public function get loaded():Boolean{
return (this._loaded);
}
private function createLoader():Loader{
var _local1:Loader = new Loader();
var _local2:URLRequest = new URLRequest(this._url);
_local2.method = URLRequestMethod.GET;
_local2.data = _cacheSeed.toString();
_local1.load(_local2, LOADER_CONTEXT);
return (_local1);
}
private function disposeLoader():void{
if (this._loader){
try {
this._loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, this.onLoadComplete);
this._loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, this.onLoadComplete);
this._loader.unload();
} catch(error) {
};
this._loader = null;
};
}
public function load():void{
if (((!(this._url)) || ((this._url == "")))){
this.onLoadComplete(null);
return;
};
this.disposeLoader();
this._loader = this.createLoader();
this._loader.contentLoaderInfo.addEventListener(Event.COMPLETE, this.onLoadComplete);
this._loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, this.onLoadComplete);
}
public function attachBitmap(_arg1:DisplayObjectContainer):Sprite{
var _local2:Sprite = new Sprite();
if (((((!(this._loaded)) && (this._url))) && (!((this._url == ""))))){
if (!this._loader){
this.load();
};
_local2.addChild(this.createLoader());
} else {
_local2.addChild(new Bitmap(this._bitmapData));
};
if (_arg1){
_arg1.addChild(_local2);
};
return (_local2);
}
private function onLoadComplete(_arg1:Event):void{
var bitmapData:BitmapData;
var event = _arg1;
try {
if (((((((event) && ((event.type == Event.COMPLETE)))) && (this._loader))) && ((this._loader.content is Bitmap)))){
bitmapData = Bitmap(this._loader.content).bitmapData;
this._bitmapData = bitmapData;
this._loaded = true;
};
} catch(error:SecurityError) {
if (bitmapData){
bitmapData.dispose();
};
};
this.disposeLoader();
dispatchEvent(new APIEvent(APIEvent.ICON_LOADED, this, (this._loaded) ? null : APIEvent.ERROR_BAD_FILE));
}
}
}//package com.newgrounds
Section 73
//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;
try {
this._inConnection.connect(("rec_" + this._widgetId));
} catch(error) {
};
this._outConnection.addEventListener(StatusEvent.STATUS, this.onStatus);
Logger.addEventListener(APIEvent.LOG, this.onLogMessage);
}
private function onLogMessage(_arg1:APIEvent):void{
try {
this._outConnection.send(this._widgetId, "sendEvent", "trace", String(_arg1.data));
} catch(error) {
};
}
public function sendEvent(_arg1:String, _arg2:Object):void{
if (this._outConnection){
_arg2 = {data:_arg2};
this._outConnection.send(this._widgetId, "sendEvent", _arg1, _arg2);
};
}
public function receiveEvent(_arg1:String, _arg2:Object):void{
}
private function onStatus(_arg1:Event):void{
}
}
}//package com.newgrounds
Section 74
//Logger (com.newgrounds.Logger)
package com.newgrounds {
import flash.events.*;
public class Logger {
static const PRIORITY_INTERNAL:uint = 0;
public static const PRIORITY_MESSAGE:uint = 1;
public static const PRIORITY_WARNING:uint = 2;
public static const PRIORITY_ERROR:uint = 3;
public static const PRIORITY_MAX:uint = 4;
private static const HEADER:String = "[Newgrounds API] :: ";
private static var _eventDispatcher:EventDispatcher = new EventDispatcher();
private static var _messageLevel:uint = 1;
private static var _throwLevel:uint = 4;
static function logInternal(... _args):void{
log(PRIORITY_INTERNAL, _args);
}
public static function logMessage(... _args):void{
log(PRIORITY_MESSAGE, _args);
}
public static function logWarning(... _args):void{
log(PRIORITY_WARNING, _args);
}
public static function logError(... _args):void{
log(PRIORITY_ERROR, _args);
}
private static function log(_arg1:uint=1, _arg2:Array=null):void{
var _local3:uint;
if (_arg1 >= _messageLevel){
_local3 = 0;
while (_local3 < _arg2.length) {
trace((HEADER + _arg2[_local3]));
_eventDispatcher.dispatchEvent(new APIEvent(APIEvent.LOG, _arg2[_local3]));
_local3++;
};
};
if (_arg1 >= _throwLevel){
throw (new Error(_arg2.join("\n")));
};
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_eventDispatcher.addEventListener(_arg1, _arg2, false, 0, false);
}
}
}//package com.newgrounds
Section 75
//Medal (com.newgrounds.Medal)
package com.newgrounds {
import flash.display.*;
import com.newgrounds.assets.*;
public class Medal extends APIEventDispatcher {
private var _connection:APIConnection;
private var _name:String;
private var _id:uint;
private var _description:String;
private var _secret:Boolean;
private var _value:uint;
private var _unlocked:Boolean;
private var _difficulty:String;
private var _iconLoader:BitmapLoader;
public static const ICON_WIDTH:uint = 50;
public static const ICON_HEIGHT:uint = 50;
public static const DIFFICULTY_EASY:String = "Easy";
public static const DIFFICULTY_MODERATE:String = "Moderate";
public static const DIFFICULTY_CHALLENGING:String = "Challenging";
public static const DIFFICULTY_DIFFICULT:String = "Difficult";
public static const DIFFICULTY_BRUTAL:String = "Brutal";
private static const DIFFICULTIES:Array = ["Unknown", DIFFICULTY_EASY, DIFFICULTY_MODERATE, DIFFICULTY_CHALLENGING, DIFFICULTY_DIFFICULT, DIFFICULTY_BRUTAL];
public static const DEFAULT_ICON:BitmapData = new DefaultMedalIcon(ICON_WIDTH, ICON_HEIGHT);
public function Medal(_arg1:APIConnection, _arg2:uint, _arg3:String, _arg4:String, _arg5:Boolean, _arg6:Boolean, _arg7:uint, _arg8:uint, _arg9:String){
this._connection = _arg1;
this._id = _arg2;
this._name = _arg3;
this._description = _arg4;
this._secret = _arg5;
this._unlocked = _arg6;
this._value = _arg7;
this._difficulty = DIFFICULTIES[_arg8];
this._iconLoader = new BitmapLoader(DEFAULT_ICON, _arg9);
this._iconLoader.load();
}
public function get difficulty():String{
return (this._difficulty);
}
public function get icon():BitmapData{
return (this._iconLoader.bitmapData);
}
public function get id():uint{
return (this._id);
}
public function get name():String{
return (this._name);
}
public function get description():String{
return (this._description);
}
public function get secret():Boolean{
return (this._secret);
}
public function get unlocked():Boolean{
return (this._unlocked);
}
public function get value():uint{
return (this._value);
}
override public function toString():String{
return (((((((("Medal: " + this._name) + "\t\t(") + (this._unlocked) ? "unlocked, " : "locked, ") + this._value) + "pts, ") + this._difficulty) + ")"));
}
public function attachIcon(_arg1:DisplayObjectContainer):Sprite{
return (this._iconLoader.attachBitmap(_arg1));
}
public function unlock():void{
if (this._unlocked){
Logger.logWarning((("Medal \"" + this._name) + "\" is already unlocked."));
return;
};
Logger.logMessage((("Unlocking medal \"" + this.name) + "\"..."));
this._unlocked = true;
if (this._connection.hasUserSession){
this._connection.sendSimpleCommand("unlockMedal", this.onUnlockConfirmed, null, {medal_id:this.id});
};
dispatchEvent(new APIEvent(APIEvent.MEDAL_UNLOCKED, this));
}
function setUnlocked(_arg1:Boolean):void{
this._unlocked = _arg1;
}
private function onUnlockConfirmed(_arg1:APIEvent):void{
if (_arg1.success){
Logger.logMessage((("Medal \"" + this.name) + "\" unlocked."));
} else {
Logger.logError((("Failed to unlock \"" + this.name) + "\"!"));
};
dispatchEvent(new APIEvent(APIEvent.MEDAL_UNLOCK_CONFIRMED, this, _arg1.error));
}
}
}//package com.newgrounds
Section 76
//SaveFile (com.newgrounds.SaveFile)
package com.newgrounds {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.geom.*;
import com.newgrounds.encoders.*;
import com.newgrounds.assets.*;
public class SaveFile extends APIEventDispatcher {
private var _group:SaveGroup;
private var _name:String;
private var _id:uint;
private var _description:String;
private var _authorId:uint;
private var _authorName:String;
private var _createdDate:String;
private var _modifiedDate:String;
private var _views:uint;
private var _readOnly:Boolean;
private var _public:Boolean;
private var _approved:Boolean;
private var _draft:Boolean;
private var _iconLoader:BitmapLoader;
private var _keys:Object;
private var _ratings:Object;
private var _dataURL:String;
private var _data;
private var _dataLoaded:Boolean;
private var _encodedData;
private var _encoderQueue:Array;
private var _encoding:Boolean;
private var _encodingParent:Object;
private var _encodingProperty:String;
private var _fileSize:uint;
private var _dataLoader:URLLoader;
public static const ICON_WIDTH:uint = 90;
public static const ICON_HEIGHT:uint = 90;
private static const STATUS_PRIVATE:uint = 0;
private static const STATUS_SHARED:uint = 1;
private static const STATUS_UNAPPROVED:uint = 2;
private static const STATUS_APPROVED:uint = 3;
public static const DEFAULT_ICON:BitmapData = new DefaultSaveIcon(ICON_WIDTH, ICON_HEIGHT);
private static var _currentFile:SaveFile;
static var _imageFilePath:String = "";
static var _saveFilePath:String = "";
public function SaveFile(_arg1:SaveGroup){
this._iconLoader = new BitmapLoader(DEFAULT_ICON, null);
this._group = _arg1;
this._keys = {};
this._ratings = {};
}
public function get group():SaveGroup{
return (this._group);
}
public function get name():String{
return (this._name);
}
public function set name(_arg1:String):void{
this._name = _arg1;
}
public function get description():String{
return (this._description);
}
public function set description(_arg1:String):void{
this._description = _arg1;
}
public function get id():uint{
return (this._id);
}
public function get data():Object{
return (this._data);
}
public function set data(_arg1:Object):void{
this._data = _arg1;
}
public function get bytesLoaded():uint{
if (this._data){
return (this.bytesTotal);
};
if (!this._dataLoader){
return (0);
};
return (this._dataLoader.bytesLoaded);
}
public function get bytesTotal():uint{
return (this._fileSize);
}
public function get readOnly():Boolean{
return (this._readOnly);
}
public function get draft():Boolean{
return (this._draft);
}
public function set draft(_arg1:Boolean):void{
this._draft = _arg1;
}
public function get authorId():uint{
return (this._authorId);
}
public function get authorName():String{
return (this._authorName);
}
public function get keys():Object{
return (this._keys);
}
public function get ratings():Object{
return (this._ratings);
}
public function get views():uint{
return (this._views);
}
public function get createdDate():String{
return (this._createdDate);
}
public function get updatedDate():String{
return (this._modifiedDate);
}
override public function toString():String{
return (("Save File: " + this._name));
}
public function get icon():BitmapData{
return (this._iconLoader.bitmapData);
}
public function set icon(_arg1:BitmapData):void{
this.createIcon(_arg1);
}
public function get iconLoaded():Boolean{
return (this._iconLoader.loaded);
}
public function createIcon(_arg1:IBitmapDrawable):void{
var _local3:Number;
var _local4:Number;
var _local8:Number;
var _local9:Rectangle;
var _local2:BitmapData = new BitmapData(ICON_WIDTH, ICON_HEIGHT, false, 0);
var _local5:Number = 0;
var _local6:Number = 0;
_local3 = Object(_arg1).width;
_local4 = Object(_arg1).height;
if ((_arg1 is DisplayObject)){
_local9 = DisplayObject(_arg1).getBounds(null);
_local5 = _local9.left;
_local6 = _local9.top;
};
var _local7:Matrix = new Matrix();
_local8 = Math.min((ICON_WIDTH / _local3), (ICON_HEIGHT / _local4));
_local7.translate(-(_local5), -(_local6));
_local7.scale(_local8, _local8);
_local7.translate(((ICON_WIDTH - (_local3 * _local8)) / 2), ((ICON_HEIGHT - (_local4 * _local8)) / 2));
_local2.draw(_arg1, _local7);
this._iconLoader.bitmapData = _local2;
}
public function attachIcon(_arg1:DisplayObjectContainer):Sprite{
if (this._iconLoader){
return (this._iconLoader.attachBitmap(_arg1));
};
Logger.logError("No icon available for this sumbission.");
return (null);
}
public function save():void{
if (!this._group.connection.hasUserSession){
Logger.logError("The user must be logged-in to save a file.");
dispatchEvent(new APIEvent(APIEvent.FILE_SAVED, null, APIEvent.ERROR_NOT_LOGGED_IN));
return;
};
BitmapLoader._cacheSeed++;
_currentFile = this;
this.encodeData(true);
}
private function doSave():void{
var _local3:String;
var _local4:Array;
var _local5:String;
var _local6:SaveKey;
var _local7:SaveRating;
var _local8:ByteArray;
var _local1:APICommand = new APICommand("saveFile");
_local1.secureParameters.group = this._group.id;
_local1.secureParameters.user_name = this._group.connection.username;
_local1.secureParameters.filename = this._name;
_local1.secureParameters.description = this._description;
if (this._draft){
_local1.secureParameters.draft = true;
};
if (((this._id) && (!(this._readOnly)))){
_local1.secureParameters.overwrite = 1;
_local1.secureParameters.save_id = this._id;
};
var _local2:Array = [];
for (_local3 in this._keys) {
_local6 = this._group.getKey(_local3);
if (_local6){
_local2.push({id:_local6.id, value:_local6.validateValue(this._keys[_local3])});
} else {
Logger.logError((((("No key named \"" + _local3) + "\" in save group \"") + this._group.name) + "\"."));
};
};
_local1.secureParameters.keys = _local2;
_local4 = [];
for (_local5 in this._ratings) {
_local7 = this._group.getRating(_local5);
if (_local7){
_local4.push({id:_local7.id, value:_local7.validateValue(this._ratings[_local5])});
} else {
Logger.logError((((("No rating named \"" + _local5) + "\" in save group \"") + this._group.name) + "\"."));
};
};
_local1.secureParameters.ratings = _local4;
_local8 = new ByteArray();
_local8.writeObject(this._encodedData);
_local8.compress();
_local1.addFile("file", _local8, "file");
if (this.iconLoaded){
_local1.addFile("thumbnail", PNGEncoder.encode(this.icon), "thumbnail");
};
_local1.addEventListener(APIEvent.COMMAND_COMPLETE, this.onSaveComplete);
this._group.connection.sendCommand(_local1);
}
private function encodeData(_arg1:Boolean):void{
this._encoderQueue = [];
this._encoding = _arg1;
if (_arg1){
this._encodedData = this._data;
this.preEncodeObject(this, "_encodedData");
} else {
this.preEncodeObject(this, "_data");
};
this.encodeObject();
}
private function preEncodeObject(_arg1:Object, _arg2:String):void{
var _local4:Boolean;
var _local6:Boolean;
var _local7:String;
var _local3:Object = _arg1[_arg2];
try {
if (this._encoding){
_local4 = (_local3 is BitmapData);
} else {
_local4 = (_local3.type == "__bitmap");
};
} catch(error) {
};
var _local5:Object = _local3;
_local6 = (_local3 is ByteArray);
if (_local4){
this._encoderQueue.push({parent:_arg1, property:_arg2});
} else {
if ((((typeof(_local3) == "object")) && (!(_local6)))){
if (this._encoding){
if ((_local3 is Array)){
_local5 = [];
} else {
_local5 = {};
};
for (_local7 in _local3) {
_local5[_local7] = _local3[_local7];
};
_arg1[_arg2] = _local5;
};
for (_local7 in _local5) {
this.preEncodeObject(_local5, _local7);
};
};
};
}
private function encodeObject():void{
var _local5:Object;
if (!this._encoderQueue.length){
if (this._encoding){
this.doSave();
} else {
this._dataLoaded = true;
this.checkLoadComplete();
};
return;
};
var _local1:Object = this._encoderQueue.pop();
var _local2:Object = _local1.parent;
var _local3:String = _local1.property;
var _local4:Object = _local2[_local3];
if (this._encoding){
_local5 = {type:"__bitmap", width:_local4.width, height:_local4.height, transparent:_local4.transparent};
_local2[_local3] = _local5;
_local5.data = new ByteArray();
_local5.data.writeBytes(_local4.getPixels(_local4.rect));
_local5.data.position = 0;
} else {
_local5 = new BitmapData(_local4.width, _local4.height, _local4.transparent);
new BitmapData(_local4.width, _local4.height, _local4.transparent).setPixels(_local5.rect, _local4.data);
_local2[_local3] = _local5;
};
this.encodeObject();
}
private function onIconLoaded(_arg1:APIEvent):void{
if (((!(_arg1.success)) && (this._iconLoader.url))){
Logger.logWarning("Unable to load the icon for this save file.");
};
this._iconLoader.removeEventListener(APIEvent.ICON_LOADED, this.onIconLoaded);
this.checkLoadComplete();
}
private function checkLoadComplete():void{
if (((this._dataLoaded) && (this.iconLoaded))){
Logger.logMessage("Data loaded.");
dispatchEvent(new APIEvent(APIEvent.FILE_LOADED, this));
};
}
private function onDataLoaded(_arg1):void{
var byteArray:ByteArray;
var data = _arg1;
try {
if (data){
byteArray = data;
byteArray.uncompress();
this._data = byteArray.readObject();
this.encodeData(false);
};
} catch(error:Error) {
Logger.logError("Error while loading data:", error);
dispatchEvent(new APIEvent(APIEvent.FILE_LOADED, this, APIEvent.ERROR_BAD_FILE));
};
}
private function onDataError(_arg1:String):void{
Logger.logError("Unable to load data:", _arg1);
dispatchEvent(new APIEvent(APIEvent.FILE_LOADED, this, APIEvent.ERROR_BAD_FILE));
}
private function onSaveComplete(_arg1:APIEvent):void{
if (_arg1.success){
Logger.logMessage((("File \"" + this._name) + "\" saved!"));
if (_arg1.data){
this._id = _arg1.data.save_id;
this._dataURL = unescape(_arg1.data.file_url);
};
dispatchEvent(new APIEvent(APIEvent.FILE_SAVED, this));
} else {
Logger.logError((("Error saving file \"" + this._name) + "\":"), _arg1.error);
dispatchEvent(new APIEvent(APIEvent.FILE_SAVED, this, _arg1.error));
};
}
public function sendVote(_arg1:String, _arg2:Number):void{
var _local3:SaveRating = this._group.getRating(_arg1);
if (!_local3){
Logger.logError((("No save rating named \"" + _arg1) + "\" exists for this save group."));
dispatchEvent(new APIEvent(APIEvent.VOTE_COMPLETE, {}, APIEvent.ERROR_INVALID_ARGUMENT));
return;
};
_arg2 = _local3.validateValue(_arg2);
if (isNaN(_arg2)){
Logger.logError((((((((("Invalid vote (" + _arg2) + "). ") + _arg1) + " allows a range of ") + _local3.minimum) + "-") + _local3.maximum) + "."));
dispatchEvent(new APIEvent(APIEvent.VOTE_COMPLETE, {}, APIEvent.ERROR_INVALID_ARGUMENT));
return;
};
Logger.logMessage((((((("Voting " + _arg2) + " for ") + _arg1) + " on ") + this._name) + "..."));
this._group.connection.sendSimpleCommand("rateSaveFile", this.onVoteComplete, null, {group:this._group.id, save_id:this._id, rating_id:_local3.id, vote:_arg2});
}
private function onVoteComplete(_arg1:APIEvent):void{
var _local3:SaveRating;
var _local2:String = _arg1.error;
if (_arg1.data.already_voted){
Logger.logError("Vote failed. You've already voted on this rating today.");
_local2 = APIEvent.ERROR_ALREADY_VOTED;
};
if (_local2 == APIEvent.ERROR_NONE){
_local3 = this._group.getRatingById(_arg1.data.rating_id);
if (_local3){
this._ratings[_local3.name] = _local3.validateValue(_arg1.data.score);
};
Logger.logMessage("Vote complete!");
};
dispatchEvent(new APIEvent(APIEvent.VOTE_COMPLETE, this, _local2));
}
public function clone():SaveFile{
var _local2:String;
var _local1:SaveFile = new SaveFile(this._group);
_local1._data = this._data;
_local1._description = this._description;
_local1._draft = this._draft;
_local1._fileSize = this._fileSize;
_local1._iconLoader.bitmapData = this._iconLoader.bitmapData;
for (_local2 in this._keys) {
_local1._keys[_local2] = this._keys[_local2];
};
for (_local2 in this._ratings) {
_local1._ratings[_local2] = this._ratings[_local2];
};
_local1._name = this._name;
return (_local1);
}
public function load():void{
_currentFile = this;
this._dataLoaded = false;
this._data = null;
if (!this.iconLoaded){
this._iconLoader.addEventListener(APIEvent.ICON_LOADED, this.onIconLoaded);
this._iconLoader.load();
};
this._dataLoader = new URLLoader();
this._dataLoader.dataFormat = URLLoaderDataFormat.BINARY;
this._dataLoader.addEventListener(Event.COMPLETE, this.as3DataLoaded);
this._dataLoader.addEventListener(IOErrorEvent.IO_ERROR, this.as3DataError);
this._dataLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.as3DataError);
this._dataLoader.load(new URLRequest(this._dataURL));
}
private function as3DataLoaded(_arg1:Event):void{
this.onDataLoaded(this._dataLoader.data);
}
private function as3DataError(_arg1:Event):void{
this.onDataError(_arg1.toString());
}
private function decodeObject(_arg1:Object):Object{
var _local2:BitmapData;
var _local3:String;
if (getQualifiedClassName(_arg1) == "Object"){
if (_arg1.type == "__bitmap"){
_local2 = new BitmapData(_arg1.width, _arg1.height, _arg1.transparent);
_local2.setPixels(_local2.rect, _arg1.data);
_arg1 = _local2;
} else {
for (_local3 in _arg1) {
_arg1[_local3] = this.decodeObject(_arg1[_local3]);
};
};
};
return (_arg1);
}
public static function get currentFile():SaveFile{
return (_currentFile);
}
static function fromObject(_arg1:SaveGroup, _arg2:Object):SaveFile{
var _local4:Object;
var _local5:Object;
var _local6:SaveKey;
var _local7:SaveRating;
var _local3:SaveFile = new SaveFile(_arg1);
_local3._name = _arg2.filename;
_local3._description = _arg2.description;
_local3._id = _arg2.save_id;
_local3._authorId = _arg2.user_id;
_local3._authorName = _arg2.user_name;
_local3._createdDate = _arg2.created;
_local3._modifiedDate = _arg2.last_update;
_local3._views = _arg2.views;
if (((_arg2.thumb) && (!((_arg2.thumb == ""))))){
_local3._iconLoader.url = (_imageFilePath + _arg2.thumb);
};
_local3._dataURL = (_saveFilePath + _arg2.file);
_local3._fileSize = _arg2.file_size;
_local3._approved = !((_arg2.status == STATUS_UNAPPROVED));
_local3._readOnly = false;
_local3._public = ((!((_arg2.status == STATUS_PRIVATE))) && (!((_arg2.status == STATUS_UNAPPROVED))));
for each (_local4 in _arg2.keys) {
_local6 = _arg1.getKeyById(_local4.id);
if (_local6){
_local3._keys[_local6.name] = _local6.validateValue(_local4.value);
};
};
for each (_local5 in _arg2.ratings) {
_local7 = _arg1.getRatingById(_local5.id);
if (_local7){
_local3._ratings[_local7.name] = _local7.validateValue(_local5.score);
};
};
return (_local3);
}
}
}//package com.newgrounds
Section 77
//SaveGroup (com.newgrounds.SaveGroup)
package com.newgrounds {
public class SaveGroup {
private var _connection:APIConnection;
private var _name:String;
private var _id:uint;
private var _type:uint;
private var _keysArray:Array;
private var _ratingsArray:Array;
private var _keys:Object;
private var _ratings:Object;
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 function SaveGroup(_arg1:APIConnection, _arg2:String, _arg3:uint, _arg4:uint, _arg5:Array, _arg6:Array){
var _local7:uint;
var _local8:SaveKey;
var _local9:SaveRating;
super();
this._connection = _arg1;
this._id = _arg3;
this._name = _arg2;
this._type = _arg4;
this._keysArray = _arg5;
this._ratingsArray = _arg6;
this._keys = new Object();
this._ratings = new Object();
for each (_local8 in _arg5) {
this._keys[_local8.name] = _local8;
};
for each (_local9 in _arg6) {
this._ratings[_local9.name] = _local9;
};
}
public function get connection():APIConnection{
return (this._connection);
}
public function get name():String{
return (this._name);
}
public function get type():uint{
return (this._type);
}
public function get id():uint{
return (this._id);
}
public function get keys():Array{
return (this._keysArray);
}
public function get ratings():Array{
return (this._ratingsArray);
}
public function getKey(_arg1:String):SaveKey{
return (this._keys[_arg1]);
}
public function getRating(_arg1:String):SaveRating{
return (this._ratings[_arg1]);
}
public function getKeyById(_arg1:uint):SaveKey{
var _local2:SaveKey;
for each (_local2 in this._keys) {
if (_local2.id == _arg1){
return (_local2);
};
};
return (null);
}
public function getRatingById(_arg1:uint):SaveRating{
var _local2:SaveRating;
for each (_local2 in this._ratings) {
if (_local2.id == _arg1){
return (_local2);
};
};
return (null);
}
public function toString():String{
return (((((("SaveGroup: " + this.name) + " Keys: ") + this._keysArray) + " Ratings: ") + this._ratingsArray));
}
}
}//package com.newgrounds
Section 78
//SaveKey (com.newgrounds.SaveKey)
package com.newgrounds {
public class SaveKey {
private var _name:String;
private var _id:uint;
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:String, _arg2:uint, _arg3:uint){
this._name = _arg1;
this._id = _arg2;
this._type = _arg3;
}
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 validateValue(_arg1){
var _local2:int;
switch (this._type){
case TYPE_INTEGER:
_arg1 = Number(_arg1);
if (!isNaN(_arg1)){
_local2 = int(_arg1);
if (_local2 != _arg1){
Logger.logWarning((((((("Float value " + _arg1) + " given for integer key \"") + this._name) + "\". Clamping to ") + _local2) + "."));
};
return (_local2);
};
break;
case TYPE_FLOAT:
_arg1 = Number(_arg1);
if (!isNaN(_arg1)){
return (isNaN(Number(_arg1)));
};
break;
case TYPE_BOOLEAN:
return (Boolean(_arg1));
case TYPE_STRING:
return ((_arg1) ? _arg1.toString() : "");
};
return (null);
}
public function toString():String{
return (this._name);
}
}
}//package com.newgrounds
Section 79
//SaveQuery (com.newgrounds.SaveQuery)
package com.newgrounds {
public class SaveQuery extends APIEventDispatcher {
private var _connection:APIConnection;
private var _group:SaveGroup;
private var _page:uint;// = 1
private var _resultsPerPage:uint;// = 10
private var _isRandomized:Boolean;// = false
private var _files:Array;
private var _totalResults:uint;
private var _lookupKeys:Array;
private var _lookupRatings:Array;
private var _fileConditions:Array;
private var _keyConditions:Array;
private var _ratingConditions:Array;
private var _sortFields:Array;
public static const FILE_ID:String = "fileId";
public static const AUTHOR_ID:String = "authorId";
public static const AUTHOR_NAME:String = "authorName";
public static const FILE_NAME:String = "fileName";
public static const CREATED_ON:String = "createdOn";
public static const UPDATED_ON:String = "updatedOn";
public static const FILE_VIEWS:String = "fileViews";
public static const FILE_STATUS:String = "fileStatus";
private static const FILE_FIELDS:Array = [FILE_ID, AUTHOR_ID, AUTHOR_NAME, FILE_NAME, CREATED_ON, UPDATED_ON, FILE_VIEWS, FILE_STATUS];
public static const OPERATOR_EQUAL:String = "=";
public static const OPERATOR_LESS_THAN:String = "<";
public static const OPERATOR_GREATER_THAN:String = ">";
public static const OPERATOR_NOT_EQUAL:String = "!=";
public static const OPERATOR_LESS_OR_EQUAL:String = "<=";
public static const OPERATOR_GREATER_OR_EQUAL:String = ">=";
public static const OPERATOR_CONTAINS:String = "*";
public static const OPERATOR_NOT_CONTAINS:String = "!*";
public static const OPERATOR_NOT_BEGINS_WITH:String = "!*=";
public static const OPERATOR_NOT_ENDS_WITH:String = "!=*";
public static const OPERATOR_BEGINS_WITH:String = "*=";
public static const OPERATOR_ENDS_WITH:String = "=*";
private static const TABLE_FILES:uint = 1;
private static const TABLE_KEYS:uint = 2;
private static const TABLE_RATINGS:uint = 3;
public function SaveQuery(_arg1:SaveGroup){
this._group = _arg1;
this._connection = _arg1.connection;
this.reset();
}
public function get group():SaveGroup{
return (this._group);
}
public function get resultsPerPage():uint{
return (this._resultsPerPage);
}
public function set resultsPerPage(_arg1:uint):void{
this._resultsPerPage = Math.min(Math.max(_arg1, 1), 100);
}
public function get page():uint{
return (this._page);
}
public function set page(_arg1:uint):void{
this._page = Math.max(_arg1, 1);
}
public function prevPage():void{
this.page--;
}
public function nextPage():void{
this.page++;
}
public function get isRandomized():Boolean{
return (this._isRandomized);
}
public function set isRandomized(_arg1:Boolean):void{
this._isRandomized = _arg1;
}
public function get files():Array{
return (this._files);
}
public function reset():void{
this._page = 1;
this._resultsPerPage = 10;
this._isRandomized = false;
this._lookupKeys = [];
this._lookupRatings = [];
this._fileConditions = [];
this._keyConditions = [];
this._ratingConditions = [];
this._sortFields = [];
this._files = [];
this.includeAllFields();
}
public function clone():SaveQuery{
var _local1:SaveQuery = new SaveQuery(this._group);
_local1._page = this._page;
_local1._resultsPerPage = this._resultsPerPage;
_local1._isRandomized = this._isRandomized;
_local1._lookupKeys = this._lookupKeys.concat();
_local1._lookupRatings = this._lookupRatings.concat();
_local1._fileConditions = this._fileConditions.concat();
_local1._keyConditions = this._keyConditions.concat();
_local1._ratingConditions = this._ratingConditions.concat();
return (_local1);
}
private function includeAllFields():void{
var _local1:SaveKey;
var _local2:SaveRating;
for each (_local1 in this._group.keys) {
this._lookupKeys.push(_local1.id);
};
for each (_local2 in this._group.ratings) {
this._lookupRatings.push(_local2.id);
};
}
public function addCondition(_arg1:String, _arg2:String, _arg3):void{
var _local4:int;
var _local5:SaveKey;
var _local6:Array;
var _local7:SaveRating;
_local4 = FILE_FIELDS.indexOf(_arg1);
if (_local4 >= 0){
this._fileConditions.push({field:_local4, operator:_arg2, value:_arg3});
} else {
_local5 = this._group.getKey(_arg1);
if (_local5){
_arg3 = _local5.validateValue(_arg3);
this._keyConditions.push({key_id:_local5.id, operator:_arg2, value:_arg3});
return;
};
_local6 = _arg1.split(".");
_local7 = this._group.getRating(_local6[0]);
if (_local7){
_arg3 = _local7.validateValue(_arg3);
this._ratingConditions.push({rating_id:_local7.id, operator:_arg2, value:_arg3, column:(_local6[1]) ? _local6[1] : "score"});
return;
};
Logger.logError((((("The save group \"" + this._group.name) + "\" does not have a field named \"") + _arg1) + "\"."));
};
}
public function sortOn(_arg1:String, _arg2:Boolean=false):void{
var _local3:int;
var _local4:SaveKey;
var _local5:Array;
var _local6:SaveRating;
_local3 = FILE_FIELDS.indexOf(_arg1);
if (_local3 >= 0){
this._sortFields.push({table:TABLE_FILES, field:_local3, desc:_arg2});
} else {
_local4 = this._group.getKey(_arg1);
if (_local4){
this._sortFields.push({table:TABLE_KEYS, field:_local4.id, desc:_arg2});
return;
};
_local5 = _arg1.split(".");
_local6 = this._group.getRating(_local5[0]);
if (_local6){
this._sortFields.push({table:TABLE_RATINGS, field:_local6.id, desc:_arg2, extra:(_local5[1]) ? _local5[1] : "score"});
return;
};
Logger.logError((((("The save group \"" + this._group.name) + "\" does not have a field named \"") + _arg1) + "\"."));
};
}
public function execute():void{
var _local1:Object = {};
_local1.page = this._page;
_local1.num_results = this._resultsPerPage;
if (this._isRandomized){
_local1.randomize = 1;
};
if (((this._lookupKeys) && (this._lookupKeys.length))){
_local1.lookup_keys = this._lookupKeys;
};
if (((this._lookupRatings) && (this._lookupRatings.length))){
_local1.lookup_ratings = this._lookupRatings;
};
if (((this._fileConditions) && (this._fileConditions.length))){
_local1.file_conditions = this._fileConditions;
};
if (((this._keyConditions) && (this._keyConditions.length))){
_local1.key_conditions = this._keyConditions;
};
if (((this._ratingConditions) && (this._ratingConditions.length))){
_local1.rating_conditions = this._ratingConditions;
};
if (((this._sortFields) && (this._sortFields.length))){
_local1.sort_conditions = this._sortFields;
};
this._connection.sendSimpleCommand("lookupSaveFiles", this.onQueryComplete, {publisher_id:this._connection.publisherId, group_id:this._group.id, query:_local1});
}
private function onQueryComplete(_arg1:APIEvent):void{
var _local2:Object;
var _local3:uint;
var _local4:SaveFile;
if (_arg1.success){
_local2 = _arg1.data;
this._files = [];
if (_local2.files){
_local3 = 0;
while (_local3 < _local2.files.length) {
_local4 = SaveFile.fromObject(this._group, _local2.files[_local3]);
if (_local4){
this._files.push(_local4);
};
_local3++;
};
};
dispatchEvent(new APIEvent(APIEvent.QUERY_COMPLETE, this));
} else {
Logger.logError(("Query failed: " + _arg1.error));
dispatchEvent(new APIEvent(APIEvent.QUERY_COMPLETE, this, _arg1.error));
};
}
}
}//package com.newgrounds
Section 80
//SaveRating (com.newgrounds.SaveRating)
package com.newgrounds {
public class SaveRating {
private var _name:String;
private var _id:uint;
private var _isFloat:Boolean;
private var _minimum:Number;
private var _maximum:Number;
public function SaveRating(_arg1:String, _arg2:uint, _arg3:Boolean, _arg4:Number, _arg5:Number){
this._name = _arg1;
this._id = _arg2;
this._isFloat = _arg3;
this._minimum = _arg4;
this._maximum = _arg5;
}
public function get name():String{
return (this._name);
}
public function get id():uint{
return (this._id);
}
public function get isFloat():Boolean{
return (this._isFloat);
}
public function get minimum():Number{
return (this._minimum);
}
public function get maximum():Number{
return (this._maximum);
}
public function validateValue(_arg1):Number{
var _local3:int;
var _local2:Number = Number(_arg1);
if (isNaN(_local2)){
Logger.logError((("Invalid value for rating \"" + this._name) + "\"."));
return (NaN);
};
if (_local2 < this._minimum){
Logger.logWarning((((((_local2 + " is out of acceptable range for rating \"") + this._name) + "\". Clamping to ") + this._minimum) + "."));
return (this._minimum);
};
if (_local2 > this._maximum){
Logger.logWarning((((((_local2 + " is out of acceptable range for rating \"") + this._name) + "\". Clamping to ") + this._maximum) + "."));
return (this._maximum);
};
if (!this.isFloat){
_local3 = int(_local2);
if (_local3 != _local2){
Logger.logWarning((((((("Float value " + _local2) + " given for integer rating \"") + this._name) + "\". Clamping to ") + _local3) + "."));
};
return (_local3);
};
return (_local2);
}
public function toString():String{
return (this._name);
}
}
}//package com.newgrounds
Section 81
//Score (com.newgrounds.Score)
package com.newgrounds {
public class Score {
private var _numericValue:Number;
private var _rank:uint;
private var _username:String;
private var _score:String;
private var _tag:String;
public function Score(_arg1:uint, _arg2:String, _arg3:String, _arg4:Number, _arg5:String){
this._rank = _arg1;
this._username = _arg2;
this._score = _arg3;
this._numericValue = _arg4;
this._tag = _arg5;
}
public function get numericValue():Number{
return (this._numericValue);
}
public function get rank():uint{
return (this._rank);
}
public function get score():String{
return (this._score);
}
public function get tag():String{
return (this._tag);
}
public function get username():String{
return (this._username);
}
public function toString():String{
return (((((this._rank + ".\t") + this._username) + "\t") + this._score));
}
}
}//package com.newgrounds
Section 82
//ScoreBoard (com.newgrounds.ScoreBoard)
package com.newgrounds {
public class ScoreBoard extends APIEventDispatcher {
private var _connection:APIConnection;
private var _name:String;
private var _id:uint;
private var _period:String;// = "All-Time"
private var _firstResult:uint;// = 1
private var _numResults:uint;// = 10
private var _tag:String;
private var _scores:Array;
public static const TODAY:String = "Today";
public static const THIS_WEEK:String = "This Week";
public static const THIS_MONTH:String = "This Month";
public static const THIS_YEAR:String = "This Year";
public static const ALL_TIME:String = "All-Time";
public function ScoreBoard(_arg1:APIConnection, _arg2:String, _arg3:uint){
this._connection = _arg1;
this._name = _arg2;
this._id = _arg3;
}
public function get name():String{
return (this._name);
}
public function get scores():Array{
return (this._scores);
}
public function get period():String{
return (this._period);
}
public function set period(_arg1:String):void{
this._period = _arg1;
}
public function get firstResult():uint{
return (this._firstResult);
}
public function set firstResult(_arg1:uint):void{
this._firstResult = Math.max(1, _arg1);
}
public function get numResults():uint{
return (this._numResults);
}
public function set numResults(_arg1:uint):void{
this._numResults = _arg1;
}
public function get tag():String{
return (this._tag);
}
public function set tag(_arg1:String):void{
this._tag = _arg1;
}
public function get page():uint{
return ((Math.ceil(((this._firstResult - 1) / this._numResults)) + 1));
}
public function prevPage():void{
if (this.firstResult > this._numResults){
this.firstResult = (this.firstResult - this._numResults);
};
}
public function nextPage():void{
this.firstResult = (this.firstResult + this._numResults);
}
public function loadScores():void{
this._connection.sendSimpleCommand("loadScores", this.onScoresLoaded, {publisher_id:this._connection.publisherId, board:this._id, page:(((this._firstResult - 1) / this._numResults) + 1), num_results:this._numResults, period:this._period, tag:this._tag});
}
public function postScore(_arg1:Number, _arg2:String=null):void{
if (isNaN(_arg1)){
Logger.logError(("Cannot post invalid score: " + _arg1));
dispatchEvent(new APIEvent(APIEvent.SCORE_POSTED, null, APIEvent.ERROR_INVALID_ARGUMENT));
return;
};
Logger.logMessage((((((("Posting a score of " + _arg1) + " by ") + this._connection.username) + " to scoreboard \"") + this._name) + "\"..."));
this._connection.sendSimpleCommand("postScore", this.onScorePosted, null, {user_name:this._connection.username, board:this._id, value:_arg1, tag:_arg2});
}
private function onScoresLoaded(_arg1:APIEvent):void{
var _local3:uint;
var _local4:uint;
var _local5:Object;
var _local2:Object = _arg1.data;
this._scores = [];
if (_local2.first_result){
_local3 = _local2.first_result;
} else {
_local3 = this._firstResult;
};
if (_local2.scores){
_local4 = 0;
while (_local4 < _local2.scores.length) {
_local5 = _local2.scores[_local4];
if (_local5){
this._scores[_local4] = new Score(_local3, _local5.username, _local5.value, _local5.numeric_value, _local5.tag);
};
_local4++;
_local3++;
};
};
dispatchEvent(new APIEvent(APIEvent.SCORES_LOADED, this));
}
private function onScorePosted(_arg1:APIEvent):void{
var _local2:Object;
var _local3:Object;
if (_arg1.success){
Logger.logMessage("Score posted!");
_local2 = _arg1.data;
_local3 = {};
_local3.score = _local2.value;
_local3.scoreBoard = this;
} else {
Logger.logError(("Error posting score: " + _arg1.error));
};
dispatchEvent(new APIEvent(APIEvent.SCORE_POSTED, _local3, _arg1.error));
}
override public function toString():String{
return (("Scoreboard: " + this._name));
}
}
}//package com.newgrounds
Section 83
//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(_arg1:String){
this.contentspotid = _arg1;
addEventListener(Event.ADDED, addedHandler);
}
private function addedHandler(_arg1:Event):void{
var _local2:String;
var _local3:DisplayObjectContainer;
removeEventListener(Event.ADDED, addedHandler);
Security.allowDomain("server.cpmstar.com");
_local2 = "http://server.cpmstar.com/adviewas3.swf";
_local3 = parent;
cpmstarLoader = new Loader();
cpmstarLoader.contentLoaderInfo.addEventListener(Event.INIT, dispatchHandler);
cpmstarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dispatchHandler);
cpmstarLoader.load(new URLRequest(((_local2 + "?contentspotid=") + contentspotid)));
addChild(cpmstarLoader);
}
private function dispatchHandler(_arg1:Event):void{
dispatchEvent(_arg1);
}
}
}//package CPMStar
Section 84
//beam01 (dvmClasses.beamClasses.beam01)
package dvmClasses.beamClasses {
import flash.display.*;
public class beam01 extends Sprite {
}
}//package dvmClasses.beamClasses
Section 85
//beam02 (dvmClasses.beamClasses.beam02)
package dvmClasses.beamClasses {
import flash.display.*;
public class beam02 extends Sprite {
}
}//package dvmClasses.beamClasses
Section 86
//beam03 (dvmClasses.beamClasses.beam03)
package dvmClasses.beamClasses {
import flash.display.*;
public class beam03 extends Sprite {
}
}//package dvmClasses.beamClasses
Section 87
//challengesXML (dvmClasses.data.challengesXML)
package dvmClasses.data {
public class challengesXML {
private var challenges:XML;
public function challengesXML(){
challenges = <challenges>
<challenge>
<desc>Complete the first level with only a fully upgraded Death Ray and a Shield. You also get the shades for this challenge: double death ray duration!</desc>
<prize>30000</prize>
<level>0</level>
<minLevel>2</minLevel>
<gameMode>0</gameMode>
<time>10</time>
<noGun>1</noGun>
<weapon>2</weapon>
<costume>3</costume>
<health>-1</health>
<shield>5</shield>
<btime>0</btime>
<beam>5</beam>
<swave>0</swave>
</challenge>
<challenge>
<desc>Avoid getting hit on the third level without any weapon or upgrade for 20 seconds</desc>
<prize>30000</prize>
<level>2</level>
<minLevel>3</minLevel>
<gameMode>1</gameMode>
<time>20</time>
<noGun>1</noGun>
<weapon>-1</weapon>
<costume>0</costume>
<health>1</health>
<shield>0</shield>
<btime>0</btime>
<beam>0</beam>
<swave>0</swave>
</challenge>
<challenge name='3. challenge'>
<desc>Destroy the Grinning Colossus in 35 seconds! You use your own equipment on this one. Meteor gun, max shields, max shockwave, max Death Ray strongly recommended.</desc>
<prize>60000</prize>
<level>4</level>
<minLevel>6</minLevel>
<gameMode>2</gameMode>
<time>35</time>
<noGun>0</noGun>
<weapon>-1</weapon>
<costume>-1</costume>
<health>-1</health>
<shield>-1</shield>
<btime>-1</btime>
<beam>-1</beam>
<swave>-1</swave>
</challenge>
<challenge name='4. challenge'>
<desc>Complete level 7 without taking any damage! You can use your shield. Big prize, but really hard!</desc>
<prize>120000</prize>
<level>6</level>
<minLevel>6</minLevel>
<gameMode>0</gameMode>
<time>30</time>
<noGun>0</noGun>
<weapon>-1</weapon>
<costume>-1</costume>
<health>1</health>
<shield>-1</shield>
<btime>-1</btime>
<beam>-1</beam>
<swave>-1</swave>
</challenge>
<challenge name='5. challenge'>
<desc>Complete level 6 using only a Supercharged Death Ray. It shoots constantly!</desc>
<prize>50000</prize>
<level>5</level>
<minLevel>6</minLevel>
<gameMode>0</gameMode>
<time>30</time>
<noGun>1</noGun>
<weapon>-1</weapon>
<costume>-1</costume>
<health>-1</health>
<shield>0</shield>
<btime>0</btime>
<beam>6</beam>
<swave>0</swave>
</challenge>
<challenge name='6. challenge'>
<desc>Kill this boss in 60 seconds with your current equipment!</desc>
<prize>80000</prize>
<level>8</level>
<minLevel>8</minLevel>
<gameMode>2</gameMode>
<time>60</time>
<noGun>0</noGun>
<weapon>-1</weapon>
<costume>-1</costume>
<health>-1</health>
<shield>-1</shield>
<btime>-1</btime>
<beam>-1</beam>
<swave>-1</swave>
</challenge>
<challenge name='7. challenge'>
<desc>Defeat this boss with only the supercharged ray!</desc>
<prize>80000</prize>
<level>11</level>
<minLevel>12</minLevel>
<gameMode>0</gameMode>
<time>30</time>
<noGun>1</noGun>
<weapon>-1</weapon>
<costume>-1</costume>
<health>-1</health>
<shield>0</shield>
<btime>0</btime>
<beam>6</beam>
<swave>0</swave>
</challenge>
<challenge>
<desc>Complete this level with a very cheap equipment...</desc>
<prize>70000</prize>
<level>12</level>
<minLevel>13</minLevel>
<gameMode>0</gameMode>
<time>20</time>
<noGun>0</noGun>
<weapon>2</weapon>
<costume>0</costume>
<health>800</health>
<shield>2</shield>
<btime>1</btime>
<beam>1</beam>
<swave>1</swave>
</challenge>
<challenge name='last challenge'>
<desc>Defeat the Egg Of Doom without taking any damage! Shields are okay.</desc>
<prize>120000</prize>
<level>14</level>
<minLevel>14</minLevel>
<gameMode>0</gameMode>
<time>30</time>
<noGun>0</noGun>
<weapon>-1</weapon>
<costume>-1</costume>
<health>1</health>
<shield>-1</shield>
<btime>-1</btime>
<beam>-1</beam>
<swave>-1</swave>
</challenge>
</challenges>
;
super();
}
public function getXML():XML{
return (challenges);
}
}
}//package dvmClasses.data
Section 88
//levelDescriptionsXML (dvmClasses.data.levelDescriptionsXML)
package dvmClasses.data {
public class levelDescriptionsXML {
private var levelDescriptions:XML;
public function levelDescriptionsXML(){
levelDescriptions = <levels>
<level>Welcome to your first mission! Just a couple of easy monsters to deal with. That is all your pea shooter is good for anyway.</level>
<level>Some bigger waves and new foes. Nothing to worry about though</level>
<level>A bunch of tougher enemies including a really fat one...</level>
<level>A huge swarm of minions try to keep you from advancing to your first boss fight. Mow them down!</level>
<level>After 3 years in intensive care the Grinning Colossus is back to get beat up again. Give him what he wants!</level>
<level>Congrats on beating the Colossus, altough that was just the weakest of FOUR bosses. Meanwhile here are some more monsters for you to kill. Hope you have a shield upgrade by now :)</level>
<level>These guys do not give up. Shop all you can and use your abilities to survive this next wave!</level>
<level>Deadly hordes stand between you and the next boss. Make them suffer!</level>
<level>This Mecha-Fishhead will try everything to take you out. Use all your skills to disassemble it.</level>
<level>Even deadlier combinations of monster try to slow you down...</level>
<level>Only this level keeps you from facing the next boss! Piece of cake.</level>
<level>One of the minions accidentally ate some pleumolium crystals. The result is this abomination and it wants to kill you.</level>
<level>Only two levels to the final boss! With your superpowers it should be easy.</level>
<level>The last pathetic group of minions gather to protect their Boss. Clear them out!</level>
<level>Behold the Egg Of Doom! Defeat this last boss and be the Ultimate Champion of the Realm.</level>
<level>Survive as long as possible in this endless mode and rack up points to compete with others!</level>
</levels>
;
super();
}
public function getXML():XML{
return (levelDescriptions);
}
}
}//package dvmClasses.data
Section 89
//levelsXML (dvmClasses.data.levelsXML)
package dvmClasses.data {
public class levelsXML {
private var levels:XML;
public function levelsXML(){
levels = <levels>
<level id='level 00' backGround='0' bossLevel='0' music='0'>
<wave repeat='3' spawnSpeed='100' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='30' placeChance='5' minHard='0' maxHard='100'>
<monsterType type='1'></monsterType>
</wave>
<wave repeat='2' spawnSpeed='50' radius='300' timeoutTime='3000' timeoutDivider='4' typeChance='30' placeChance='5' minHard='0' maxHard='150'>
<monsterType type='0'></monsterType>
</wave>
<wave repeat='3' spawnSpeed='20' radius='300' timeoutTime='3000' timeoutDivider='4' typeChance='30' placeChance='5' minHard='50' maxHard='350'>
<monsterType type='0'></monsterType>
</wave>
<wave repeat='3' spawnSpeed='20' radius='300' timeoutTime='3000' timeoutDivider='4' typeChance='30' placeChance='5' minHard='50' maxHard='400'>
<monsterType type='0'></monsterType>
<monsterType type='1'></monsterType>
</wave>
<wave repeat='2' spawnSpeed='20' radius='300' timeoutTime='3000' timeoutDivider='4' typeChance='30' placeChance='5' minHard='50' maxHard='500'>
<monsterType type='0'></monsterType>
<monsterType type='1'></monsterType>
</wave>
<wave repeat='1' spawnSpeed='500' radius='300' timeoutTime='3000' timeoutDivider='4' typeChance='30' placeChance='5' minHard='50' maxHard='100'>
<monsterType type='7'></monsterType>
</wave>
</level>
<level id='level 01' backGround='0' bossLevel='0' music='1'>
<wave repeat='2' spawnSpeed='100' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='30' placeChance='10' minHard='100' maxHard='500'>
<monsterType type='7'></monsterType>
</wave>
<wave repeat='4' spawnSpeed='50' radius='300' timeoutTime='3000' timeoutDivider='4' typeChance='30' placeChance='5' minHard='250' maxHard='700'>
<monsterType type='0'></monsterType>
<monsterType type='1'></monsterType>
</wave>
<wave repeat='2' spawnSpeed='100' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='30' placeChance='10' minHard='100' maxHard='400'>
<monsterType type='7'></monsterType>
</wave>
<wave repeat='2' spawnSpeed='50' radius='300' timeoutTime='3000' timeoutDivider='4' typeChance='30' placeChance='5' minHard='500' maxHard='600'>
<monsterType type='0'></monsterType>
<monsterType type='1'></monsterType>
<monsterType type='7'></monsterType>
</wave>
<wave repeat='3' spawnSpeed='100' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='90' placeChance='50' minHard='0' maxHard='500'>
<monsterType type='2'></monsterType>
<monsterType type='1'></monsterType>
<monsterType type='1'></monsterType>
<monsterType type='1'></monsterType>
<monsterType type='1'></monsterType>
</wave>
</level>
<level id='level 02' backGround='0' bossLevel='0' music='2'>
<wave repeat='6' spawnSpeed='100' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='70' placeChance='10' minHard='400' maxHard='800'>
<monsterType type='2'></monsterType>
<monsterType type='0'></monsterType>
<monsterType type='0'></monsterType>
<monsterType type='1'></monsterType>
<monsterType type='1'></monsterType>
</wave>
<wave repeat='4' spawnSpeed='50' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='50' placeChance='30' minHard='300' maxHard='1000'>
<monsterType type='7'></monsterType>
<monsterType type='7'></monsterType>
<monsterType type='2'></monsterType>
</wave>
<wave repeat='6' spawnSpeed='100' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='50' placeChance='5' minHard='200' maxHard='800'>
<monsterType type='1'></monsterType>
<monsterType type='1'></monsterType>
<monsterType type='1'></monsterType>
<monsterType type='1'></monsterType>
<monsterType type='8'></monsterType>
</wave>
<wave repeat='1' spawnSpeed='300' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='30' placeChance='30' minHard='0' maxHard='500'>
<monsterType type='1'></monsterType>
</wave>
<wave repeat='1' spawnSpeed='800' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='30' placeChance='100' minHard='0' maxHard='1000'>
<monsterType type='5'></monsterType>
<monsterType type='2'></monsterType>
<monsterType type='1'></monsterType>
</wave>
</level>
<level id='level 03' backGround='3' bossLevel='0' music='3'>
<wave repeat='1' spawnSpeed='10' radius='150' timeoutTime='5000' timeoutDivider='3' typeChance='30' placeChance='5' minHard='600' maxHard='1500'>
<monsterType type='0'></monsterType>
<monsterType type='1'></monsterType>
</wave>
<wave repeat='1' spawnSpeed='100' radius='400' timeoutTime='5000' timeoutDivider='5' typeChance='30' placeChance='10' minHard='0' maxHard='800'>
<monsterType type='6'></monsterType>
</wave>
<wave repeat='1' spawnSpeed='10' radius='150' timeoutTime='5000' timeoutDivider='3' typeChance='30' placeChance='5' minHard='600' maxHard='1700'>
<monsterType type='0'></monsterType>
<monsterType type='1'></monsterType>
</wave>
<wave repeat='1' spawnSpeed='100' radius='400' timeoutTime='5000' timeoutDivider='5' typeChance='30' placeChance='10' minHard='0' maxHard='800'>
<monsterType type='6'></monsterType>
</wave>
<wave repeat='5' spawnSpeed='500' radius='300' timeoutTime='5000' timeoutDivider='4' typeChance='30' placeChance='50' minHard='300' maxHard='1000'>
<monsterType type='5'></monsterType>
<monsterType type='1'></monsterType>
</wave>
</level>
<level id='level 04' backGround='1' bossLevel='1' music='4'>
<wave repeat='1' spawnSpeed='100' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='30' placeChance='10' minHard='0' maxHard='600'>
<monsterType type='11' isBoss='1'></monsterType>
</wave>
</level>
<level id='level 05' backGround='0' bossLevel='0' music='2'>
<wave repeat='2' spawnSpeed='100' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='30' placeChance='10' minHard='0' maxHard='500'>
<monsterType type='8'></monsterType>
</wave>
<wave repeat='5' spawnSpeed='100' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='30' placeChance='10' minHard='300' maxHard='1000'>
<monsterType type='8'></monsterType>
</wave>
<wave repeat='6' spawnSpeed='200' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='30' placeChance='50' minHard='400' maxHard='1200'>
<monsterType type='0'></monsterType>
<monsterType type='1'></monsterType>
<monsterType type='0'></monsterType>
<monsterType type='1'></monsterType>
<monsterType type='3'></monsterType>
</wave>
<wave repeat='7' spawnSpeed='50' radius='100' timeoutTime='5000' timeoutDivider='5' typeChance='30' placeChance='50' minHard='400' maxHard='1400'>
<monsterType type='1'></monsterType>
<monsterType type='1'></monsterType>
<monsterType type='1'></monsterType>
<monsterType type='4'></monsterType>
</wave>
</level>
<level id='level 06' backGround='0' bossLevel='0' music='0'>
<wave repeat='2' spawnSpeed='300' radius='300' timeoutTime='5000' timeoutDivider='5' typeChance='70' placeChance='30' minHard='200' maxHard='1300'>
<monsterType type='5'></monsterType>
<monsterType type='6'></monsterType>
<monsterType type='6'></monsterType>
</wave>
<wave repeat='2' spawnSpeed='300' radius='300' timeoutTime='5000' timeoutDivider='5' typeChance='70' placeChance='30' minHard='300' maxHard='1000'>
<monsterType type='5'></monsterType>
<monsterType type='6'></monsterType>
<monsterType type='6'></monsterType>
</wave>
<wave repeat='4' spawnSpeed='100' radius='30' timeoutTime='5000' timeoutDivider='5' typeChance='30' placeChance='10' minHard='600' maxHard='1200'>
<monsterType type='4'></monsterType>
<monsterType type='2'></monsterType>
</wave>
<wave repeat='2' spawnSpeed='300' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='70' placeChance='10' minHard='500' maxHard='1200'>
<monsterType type='13'></monsterType>
<monsterType type='2'></monsterType>
<monsterType type='2'></monsterType>
<monsterType type='2'></monsterType>
</wave>
<wave repeat='4' spawnSpeed='100' radius='100' timeoutTime='5000' timeoutDivider='5' typeChance='30' placeChance='10' minHard='500' maxHard='1400'>
<monsterType type='2'></monsterType>
</wave>
<wave repeat='4' spawnSpeed='10' radius='100' timeoutTime='5000' timeoutDivider='5' typeChance='80' placeChance='3' minHard='500' maxHard='1400'>
<monsterType type='8'></monsterType>
<monsterType type='0'></monsterType>
<monsterType type='0'></monsterType>
</wave>
</level>
<level id='level 07' backGround='0' bossLevel='0' music='1'>
<wave repeat='2' spawnSpeed='300' radius='100' timeoutTime='5000' timeoutDivider='5' typeChance='70' placeChance='30' minHard='200' maxHard='800'>
<monsterType type='7'></monsterType>
<monsterType type='4'></monsterType>
</wave>
<wave repeat='4' spawnSpeed='100' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='70' placeChance='5' minHard='400' maxHard='1300'>
<monsterType type='7'></monsterType>
<monsterType type='4'></monsterType>
</wave>
<wave repeat='6' spawnSpeed='100' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='70' placeChance='5' minHard='700' maxHard='1800'>
<monsterType type='4'></monsterType>
</wave>
<wave repeat='6' spawnSpeed='100' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='20' placeChance='5' minHard='400' maxHard='1800'>
<monsterType type='2'></monsterType>
<monsterType type='7'></monsterType>
</wave>
</level>
<level id='level 08 boss' backGround='1' bossLevel='1' music='4'>
<wave repeat='1' spawnSpeed='300' radius='300' timeoutTime='5000' timeoutDivider='5' typeChance='70' placeChance='30' minHard='200' maxHard='1300'>
<monsterType type='9' isBoss='1'></monsterType>
</wave>
</level>
<level id='level 09' backGround='0' bossLevel='0' music='3'>
<wave repeat='2' spawnSpeed='300' radius='100' timeoutTime='5000' timeoutDivider='5' typeChance='70' placeChance='30' minHard='200' maxHard='1500'>
<monsterType type='6'></monsterType>
<monsterType type='3'></monsterType>
</wave>
<wave repeat='4' spawnSpeed='100' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='70' placeChance='5' minHard='400' maxHard='2300'>
<monsterType type='3'></monsterType>
<monsterType type='0'></monsterType>
<monsterType type='1'></monsterType>
<monsterType type='0'></monsterType>
<monsterType type='1'></monsterType>
</wave>
<wave repeat='6' spawnSpeed='100' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='70' placeChance='5' minHard='700' maxHard='2000'>
<monsterType type='5'></monsterType>
<monsterType type='7'></monsterType>
</wave>
<wave repeat='3' spawnSpeed='100' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='20' placeChance='5' minHard='400' maxHard='2000'>
<monsterType type='6'></monsterType>
</wave>
<wave repeat='3' spawnSpeed='100' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='20' placeChance='5' minHard='400' maxHard='2000'>
<monsterType type='4'></monsterType>
<monsterType type='6'></monsterType>
</wave>
</level>
<level id='level 10' backGround='0' bossLevel='0' music='2'>
<wave repeat='2' spawnSpeed='300' radius='300' timeoutTime='5000' timeoutDivider='5' typeChance='70' placeChance='30' minHard='200' maxHard='1400'>
<monsterType type='8'></monsterType>
<monsterType type='2'></monsterType>
<monsterType type='2'></monsterType>
</wave>
<wave repeat='2' spawnSpeed='100' radius='300' timeoutTime='5000' timeoutDivider='5' typeChance='70' placeChance='30' minHard='300' maxHard='1800'>
<monsterType type='4'></monsterType>
<monsterType type='0'></monsterType>
<monsterType type='0'></monsterType>
</wave>
<wave repeat='4' spawnSpeed='100' radius='100' timeoutTime='5000' timeoutDivider='5' typeChance='30' placeChance='10' minHard='600' maxHard='2200'>
<monsterType type='6'></monsterType>
<monsterType type='7'></monsterType>
</wave>
<wave repeat='2' spawnSpeed='300' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='95' placeChance='10' minHard='100' maxHard='1500'>
<monsterType type='13'></monsterType>
<monsterType type='1'></monsterType>
<monsterType type='1'></monsterType>
<monsterType type='1'></monsterType>
</wave>
<wave repeat='2' spawnSpeed='10' radius='100' timeoutTime='5000' timeoutDivider='5' typeChance='80' placeChance='3' minHard='500' maxHard='2000'>
<monsterType type='8'></monsterType>
<monsterType type='1'></monsterType>
<monsterType type='1'></monsterType>
</wave>
</level>
<level id='level 11 boss' backGround='2' bossLevel='1' music='4'>
<wave repeat='1' spawnSpeed='300' radius='300' timeoutTime='5000' timeoutDivider='5' typeChance='70' placeChance='30' minHard='200' maxHard='1300'>
<monsterType type='12' isBoss='1'></monsterType>
</wave>
</level>
<level id='level 12' backGround='0' bossLevel='0' music='3'>
<wave repeat='2' spawnSpeed='100' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='30' placeChance='10' minHard='500' maxHard='1800'>
<monsterType type='3'></monsterType>
</wave>
<wave repeat='5' spawnSpeed='400' radius='300' timeoutTime='5000' timeoutDivider='5' typeChance='30' placeChance='20' minHard='300' maxHard='2000'>
<monsterType type='6'></monsterType>
</wave>
<wave repeat='8' spawnSpeed='100' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='50' placeChance='50' minHard='400' maxHard='2200'>
<monsterType type='0'></monsterType>
<monsterType type='1'></monsterType>
<monsterType type='2'></monsterType>
<monsterType type='3'></monsterType>
<monsterType type='4'></monsterType>
</wave>
<wave repeat='7' spawnSpeed='50' radius='100' timeoutTime='5000' timeoutDivider='5' typeChance='50' placeChance='50' minHard='1000' maxHard='2000'>
<monsterType type='3'></monsterType>
<monsterType type='4'></monsterType>
<monsterType type='5'></monsterType>
<monsterType type='7'></monsterType>
</wave>
</level>
<level id='level 13' backGround='0' bossLevel='0' music='0'>
<wave repeat='2' spawnSpeed='600' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='30' placeChance='10' minHard='500' maxHard='1800'>
<monsterType type='13'></monsterType>
</wave>
<wave repeat='3' spawnSpeed='400' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='30' placeChance='10' minHard='300' maxHard='2300'>
<monsterType type='3'></monsterType>
</wave>
<wave repeat='6' spawnSpeed='100' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='50' placeChance='50' minHard='400' maxHard='2200'>
<monsterType type='5'></monsterType>
<monsterType type='6'></monsterType>
<monsterType type='4'></monsterType>
<monsterType type='3'></monsterType>
</wave>
<wave repeat='4' spawnSpeed='300' radius='100' timeoutTime='5000' timeoutDivider='5' typeChance='50' placeChance='50' minHard='1000' maxHard='2300'>
<monsterType type='3'></monsterType>
<monsterType type='2'></monsterType>
<monsterType type='5'></monsterType>
<monsterType type='7'></monsterType>
<monsterType type='6'></monsterType>
</wave>
</level>
<level id='level 14 boss' backGround='1' bossLevel='1' music='4'>
<wave repeat='1' spawnSpeed='300' radius='300' timeoutTime='5000' timeoutDivider='5' typeChance='70' placeChance='30' minHard='200' maxHard='1300'>
<monsterType type='10' isBoss='1'></monsterType>
</wave>
</level>
<level id='level 15' backGround='0' bossLevel='0' music='0'>
<wave repeat='3' spawnSpeed='100' radius='200' timeoutTime='5000' timeoutDivider='5' typeChance='30' placeChance='5' minHard='0' maxHard='100'>
<monsterType type='1'></monsterType>
</wave>
</level>
</levels>
;
super();
}
public function getLevelXML(_arg1:uint=0):XML{
return (levels.children()[_arg1]);
}
}
}//package dvmClasses.data
Section 90
//upgradesXML (dvmClasses.data.upgradesXML)
package dvmClasses.data {
public class upgradesXML {
private var upgrades:XML;
public function upgradesXML(){
upgrades = <upgrades>
<health>
<upgrade>
<max>500</max>
<charge>1</charge>
<price>0</price>
<desc>Health upgrade</desc>
</upgrade>
<upgrade>
<max>650</max>
<charge>1</charge>
<price>4000</price>
<desc>30% more health for a bargain price!
Health: 650, Healing: 10/sec</desc>
</upgrade>
<upgrade>
<max>800</max>
<charge>2</charge>
<price>10000</price>
<desc>50% faster healing and 800 maximum health. Avoid getting killed, I need customers.</desc>
</upgrade>
<upgrade>
<max>900</max>
<charge>2</charge>
<price>18000</price>
<desc>900 maximum health</desc>
</upgrade>
<upgrade>
<max>1000</max>
<charge>3</charge>
<price>30000</price>
<desc>Getting real buff. 1000 health, super-fast healing</desc>
</upgrade>
<upgrade>
<max>1200</max>
<charge>4</charge>
<price>45000</price>
<desc>This ultimate fitness package gives you 1200 max health and the fastest regeneration</desc>
</upgrade>
</health>
<beam>
<upgrade>
<charge>10</charge>
<damage>3</damage>
<duration>1500</duration>
<price>2000</price>
<desc>Unlock your Death Ray ability! Default key for this is D but you can change it in the controls menu.</desc>
</upgrade>
<upgrade>
<charge>12</charge>
<damage>5</damage>
<duration>1500</duration>
<price>7000</price>
<desc>Fry some more monsters with your upgraded Death Ray. 50% faster charging and 5000/sec damage</desc>
</upgrade>
<upgrade>
<charge>17</charge>
<damage>7</damage>
<duration>1500</duration>
<price>20000</price>
<desc>An even meaner upgrade: 7000/sec damage</desc>
</upgrade>
<upgrade>
<charge>20</charge>
<damage>9</damage>
<duration>1500</duration>
<price>45000</price>
<desc>Much faster charging and 9000/sec damage for your Death Ray.</desc>
</upgrade>
<upgrade>
<charge>23</charge>
<damage>12</damage>
<duration>1500</duration>
<price>60000</price>
<desc>The ultimate Death Ray upgrade with a mind blowing 12000/sec damage!</desc>
</upgrade>
<upgrade>
<charge>0</charge>
<damage>6</damage>
<duration>9999999999999</duration>
<price>60000</price>
<desc>Challenge Ray</desc>
</upgrade>
</beam>
<shield>
<upgrade>
<charge>15</charge>
<duration>1000</duration>
<price>1500</price>
<desc>Unlock your Shield ability and be invincible for 1 second. Default key for this ability is A but you can change it in the controls menu.</desc>
</upgrade>
<upgrade>
<charge>17</charge>
<duration>1300</duration>
<price>8000</price>
<desc>1.3 seconds duration for the shield and faster recharge.</desc>
</upgrade>
<upgrade>
<charge>19</charge>
<duration>1600</duration>
<price>15000</price>
<desc>Shield upgrade for 1.6 seconds duration and even faster recharge.</desc>
</upgrade>
<upgrade>
<charge>21</charge>
<duration>2000</duration>
<price>25000</price>
<desc>2 senonds duration! You can ram through group of enemies without a scratch</desc>
</upgrade>
<upgrade>
<charge>25</charge>
<duration>2300</duration>
<price>40000</price>
<desc>The best possible shield upgrade for the most intense battles. 2.3 seconds duration and recharges really fast!</desc>
</upgrade>
</shield>
<btime>
<upgrade>
<charge>9</charge>
<price>1000</price>
<desc>Unlock your Bullet Time ability with this purchase! Really cheap and useful. Use this ability by pressing S after it is charged. (Key can be customized)</desc>
</upgrade>
<upgrade>
<charge>12</charge>
<price>6000</price>
<desc>Faster recharge for the Bullet Time ability</desc>
</upgrade>
<upgrade>
<charge>16</charge>
<price>20000</price>
<desc>Even faster recharge for the Bullet Time ability</desc>
</upgrade>
</btime>
<swave>
<upgrade>
<power>3</power>
<charge>6</charge>
<price>3000</price>
<desc>Unlock this and use your Shockwave ability in-game by double clicking anywhere (after it is charged)</desc>
</upgrade>
<upgrade>
<power>4</power>
<charge>8</charge>
<price>10000</price>
<desc>Double power and faster recharge. Buy it now!</desc>
</upgrade>
<upgrade>
<power>5</power>
<charge>11</charge>
<price>20000</price>
<desc>50% more destructive power and even faster recharge</desc>
</upgrade>
<upgrade>
<power>6</power>
<charge>14</charge>
<price>30000</price>
<desc>4 waves of destruction. Not many things can survive this</desc>
</upgrade>
<upgrade>
<power>7</power>
<charge>17</charge>
<price>55000</price>
<desc>Insane power, super-fast recharge. You know you need it!</desc>
</upgrade>
</swave>
<weapons>
<weapon>
<price>0</price>
<desc>Your default pea shooter. Your enemies will feel sorry for you when they see you with this</desc>
</weapon>
<weapon>
<price>2000</price>
<desc>A nice spray gun with much better damage then the pea shooter. Reasonable price!</desc>
</weapon>
<weapon>
<price>15000</price>
<desc>Much like the previous gun but sronger and shoots sideways too to catch the smaller enemies that try to circle you. Very handy!</desc>
</weapon>
<weapon>
<price>40000</price>
<desc>A shotgun-like weapon with a medium spread and random pattern. Great damage!</desc>
</weapon>
<weapon>
<price>80000</price>
<desc>Great spread, great power. Mow down big groups with the plasma cutter</desc>
</weapon>
<weapon>
<price>150000</price>
<desc>The new Meteor Gun may persuade your enemies to give up...maybe not. But it will vaporize them.</desc>
</weapon>
<weapon>
<price>300000</price>
<desc>Melt your enemies by the hundreds with the UBER9000. It actually shoots small suns...no big deal</desc>
</weapon>
</weapons>
<outfits>
<outfit>
<price>0</price>
<desc>Your basic outfit. Hardcore.</desc>
</outfit>
<outfit>
<price>40000</price>
<desc>Double your income with this fancy gentleman outfit</desc>
</outfit>
<outfit>
<price>100000</price>
<desc>Get additional 500 maximum health with this medieval helmet</desc>
</outfit>
<outfit>
<price>100000</price>
<desc>Double your Death Ray duration with these cool protective shades</desc>
</outfit>
<outfit>
<price>250000</price>
<desc>20X collision damage to enemies. Problem? Power up your shield and ram those monsters!</desc>
</outfit>
</outfits>
</upgrades>
;
super();
}
public function getXML():XML{
return (upgrades);
}
}
}//package dvmClasses.data
Section 91
//Beam (dvmClasses.elements.beams.Beam)
package dvmClasses.elements.beams {
import flash.display.*;
import dvmClasses.elements.enemies.*;
import dvmClasses.math.*;
import dvmClasses.mechanics.*;
import dvmClasses.elements.effects.beamEffects.*;
import dvmClasses.beamClasses.*;
public class Beam {
public var beamGfxCapsule:Sprite;
private var math:gMath;
public var isHit:Boolean;// = false
private var timeDiff:uint;// = 0
public var endAnim:beamEffect;
private var angOffset:Number;// = 0
private var beamTypes:Array;
public var startAnim:beamEffect;
public var controller:Object;// = null
private var pulse:Number;// = 1
private var shootTicker:Ticker;
private var xOffset:int;// = 0
private var fixedAngleTarget:Number;// = 0
private var startAnimTypes:Array;
public var beamHeight:Number;// = 1
private var firstRun:Boolean;// = true
public var isCharging:Boolean;// = true
private var fixedAngle:Boolean;// = false
public var turnSpeed:Number;// = 0
private var endAnimTypes:Array;
public var defaultHeight:Number;// = 30
public var beamGfx:Sprite;
private var enemyAlreadyHit:Boolean;// = false
public var angle:Number;// = 0
private var frequency:Number;// = 1
public var endX:int;// = 0
public var dead:Boolean;// = false
public var endY:int;// = 0
public var targetX:int;// = 0
public var targetY:int;// = 0
public var shootTurnSpeed:Number;// = 0.002
private var yOffset:int;// = 0
private var chargeTicker:Ticker;
public var damage:Number;// = 1
public var beamLength:Number;// = 2000
public var x:int;// = 0
public var y:int;// = 0
public function Beam(_arg1:uint=0, _arg2:uint=0, _arg3:uint=0, _arg4:Number=1.3, _arg5:Number=0.07, _arg6:uint=500, _arg7:uint=2000, _arg8:Object=null, _arg9:Boolean=false, _arg10:Number=0, _arg11:Number=0){
x = 0;
y = 0;
xOffset = 0;
yOffset = 0;
targetX = 0;
targetY = 0;
endX = 0;
endY = 0;
angle = 0;
damage = 1;
turnSpeed = 0;
shootTurnSpeed = 0.002;
dead = false;
isHit = false;
controller = null;
beamHeight = 1;
defaultHeight = 30;
beamLength = 2000;
firstRun = true;
timeDiff = 0;
isCharging = true;
frequency = 1;
pulse = 1;
beamTypes = new Array();
startAnimTypes = new Array();
endAnimTypes = new Array();
fixedAngle = false;
fixedAngleTarget = 0;
angOffset = 0;
enemyAlreadyHit = false;
super();
angOffset = _arg11;
fixedAngle = _arg9;
fixedAngleTarget = _arg10;
math = new gMath();
defaultHeight = (defaultHeight * _arg4);
beamTypes.push(beam01);
beamTypes.push(beam02);
beamTypes.push(beam03);
startAnimTypes.push(beamStart01);
startAnimTypes.push(beamStart02);
startAnimTypes.push(beamStart03);
endAnimTypes.push(beamStart01);
endAnimTypes.push(beamStart02);
endAnimTypes.push(beamStart03);
beamGfx = new (beamTypes[_arg1]);
beamGfxCapsule = new Sprite();
beamGfxCapsule.addChild(beamGfx);
startAnim = new (startAnimTypes[_arg1]);
endAnim = new (endAnimTypes[_arg1]);
setPosition(_arg2, _arg3);
chargeTicker = new Ticker(_arg6);
shootTicker = new Ticker(_arg7);
beamHeight = _arg4;
frequency = _arg5;
controller = _arg8;
}
public function setLength(_arg1:int, _arg2:int, _arg3:uint=0){
beamLength = (Math.sqrt(math.pointDistanceSquare(x, y, _arg1, _arg2)) - (_arg3 / 3));
}
public function tick(_arg1:uint, _arg2:uint=0, _arg3:uint=0, _arg4:uint=0, _arg5:uint=0){
var _local6:uint;
_local6 = 0;
timeDiff = _arg1;
growBeam(_arg1);
setEndPoint(beamLength);
startAnim.x = x;
startAnim.y = y;
startAnim.animate(_arg1);
endAnim.animate(_arg1);
if (controller){
if (controller.dead){
this.die();
return;
};
setPosition(controller.x, controller.y);
} else {
setPosition(_arg2, _arg3);
};
setTarget(_arg4, _arg5);
if (firstRun){
_local6 = 1;
firstRun = false;
if (!fixedAngle){
angle = (math.pointAngle(x, y, targetX, targetY) + angOffset);
} else {
angle = fixedAngleTarget;
};
};
angle = math.rotateToAngle(angle, (math.pointAngle(x, y, targetX, targetY) + angOffset), (turnSpeed * _arg1));
beamGfx.rotation = math.radToDeg(angle);
beamGfx.scaleX = (beamLength / 10);
if (isCharging){
if (chargeTicker.tick(_arg1)){
_local6 = 2;
isCharging = false;
turnSpeed = shootTurnSpeed;
beamGfx.alpha = 1;
beamGfx.scaleY = 1;
startAnim.switchToShoot();
beamLength = 100;
} else {
beamGfx.alpha = (0.5 - ((chargeTicker.delayNow / chargeTicker.delay) / 3));
beamGfx.scaleY = (beamHeight * beamGfx.alpha);
};
} else {
pulse = (pulse + (frequency * _arg1));
beamGfx.scaleY = (beamHeight + (Math.sin(pulse) / 5));
if (shootTicker.tick(_arg1)){
this.die();
};
};
return (_local6);
}
public function testPoint(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:uint, _arg8:uint):Boolean{
var _local9:uint;
_local9 = ((_arg7 + _arg8) >> 1);
if (math.segmentDistanceSquare(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6) <= Math.pow(_local9, 2)){
return (true);
};
return (false);
}
public function testAgainstBosses(_arg1:Array):boss{
var _local2:Array;
var _local3:boss;
var _local4:uint;
_local2 = new Array();
_local4 = 0;
while (_local4 < _arg1.length) {
_local3 = _arg1[_local4];
if (testPoint(_local3.x, _local3.y, x, y, endX, endY, _local3.hitWidth, defaultHeight)){
_local2.push(_local3);
_local3.myDistance = math.pointDistanceSquare(x, y, _local3.x, _local3.y);
};
_local2.sortOn("myDistance", Array.NUMERIC);
_local4++;
};
if (_local2.length){
isHit = true;
setLength(_local2[0].x, _local2[0].y, _local2[0].hitWidth);
setEndPoint(beamLength);
endAnim.switchToHit();
if (isCharging){
isHit = false;
return (null);
};
return (_local2[0]);
//unresolved jump
};
if (!enemyAlreadyHit){
isHit = false;
endAnim.switchToShoot();
return (null);
};
return (null);
}
public function setOffset(_arg1:int, _arg2:int){
xOffset = _arg1;
yOffset = _arg2;
}
private function die(){
this.dead = true;
}
public function setTarget(_arg1:int, _arg2:int){
targetX = _arg1;
targetY = _arg2;
}
public function testAgainstEnemies(_arg1:Array):enemy{
var _local2:Array;
var _local3:enemy;
var _local4:uint;
enemyAlreadyHit = false;
_local2 = new Array();
_local4 = 0;
while (_local4 < _arg1.length) {
_local3 = _arg1[_local4];
if (testPoint(_local3.x, _local3.y, x, y, endX, endY, _local3.hitWidth, defaultHeight)){
_local2.push(_local3);
_local3.myDistance = math.pointDistanceSquare(x, y, _local3.x, _local3.y);
};
_local2.sortOn("myDistance", Array.NUMERIC);
_local4++;
};
if (_local2.length){
isHit = true;
setLength(_local2[0].x, _local2[0].y, _local2[0].hitWidth);
setEndPoint(beamLength);
endAnim.switchToHit();
if (isCharging){
isHit = false;
return (null);
};
enemyAlreadyHit = true;
return (_local2[0]);
} else {
isHit = false;
endAnim.switchToShoot();
};
return (!NULL!);
}
public function growBeam(_arg1:uint){
if (beamLength < 2000){
beamLength = (beamLength + (_arg1 * 3));
};
}
public function testAgainstHero(_arg1:int, _arg2:int, _arg3:int){
if (testPoint(_arg1, _arg2, x, y, endX, endY, _arg3, defaultHeight)){
isHit = true;
setLength(_arg1, _arg2, _arg3);
setEndPoint(beamLength);
endAnim.switchToHit();
if (isCharging){
isHit = false;
return (false);
};
endAnim.switchToHit();
return (true);
};
isHit = false;
return (false);
}
public function setPosition(_arg1:int, _arg2:int){
x = (_arg1 + xOffset);
y = (_arg2 + yOffset);
}
public function setEndPoint(_arg1:int){
var _local2:Array;
if (_arg1 < 0){
_arg1 = 0;
};
_local2 = math.speedFromAngle(_arg1, angle);
endAnim.x = (x + _local2[0]);
endAnim.y = (y + _local2[1]);
endX = endAnim.x;
endY = endAnim.y;
beamGfx.scaleX = (_arg1 / 10);
}
}
}//package dvmClasses.elements.beams
Section 92
//Bullet (dvmClasses.elements.bullets.Bullet)
package dvmClasses.elements.bullets {
import dvmClasses.elements.*;
public class Bullet extends Animable {
public var isRotating:Boolean;// = false
public var xSpeed:Number;
public var ySpeed:Number;
public var damage:uint;// = 10
public var isFollow:Boolean;// = true
public function Bullet(){
damage = 10;
isRotating = false;
isFollow = true;
super();
}
public function doMove(_arg1:uint){
x = (x + (xSpeed * _arg1));
y = (y + (ySpeed * _arg1));
checkBounds();
}
public function setSpeeds(_arg1:Number, _arg2:Number){
xSpeed = (_arg2 * Math.cos(_arg1));
ySpeed = (_arg2 * Math.sin(_arg1));
if (isRotating){
setFrame(_arg1);
};
}
public function setPos(_arg1:int, _arg2:int){
x = _arg1;
y = _arg2;
}
public function setFrame(_arg1:Number){
var _local2:int;
this.animate = doNothing;
_local2 = Math.round((((_arg1 * 180) / Math.PI) / 10));
while (_local2 < 0) {
_local2 = (_local2 + 36);
};
while (_local2 >= 36) {
_local2 = (_local2 - 36);
};
if (_local2 == 35){
_local2 = 0;
};
this.cFrame = _local2;
}
private function checkBounds(){
if ((((((((this.x < -80)) || ((this.x > 880)))) || ((this.y < -80)))) || ((this.y > 630)))){
this.dead = true;
};
}
}
}//package dvmClasses.elements.bullets
Section 93
//BulletFireball (dvmClasses.elements.bullets.BulletFireball)
package dvmClasses.elements.bullets {
public class BulletFireball extends Bullet {
public function BulletFireball(){
isRotating = false;
animate = loop;
animDelay = 50;
endFrame = 8;
damage = 120;
sheetID = 13;
hitWidth = 45;
hitHeight = 45;
xOffset = -24;
yOffset = -24;
}
}
}//package dvmClasses.elements.bullets
Section 94
//BulletGreen01 (dvmClasses.elements.bullets.BulletGreen01)
package dvmClasses.elements.bullets {
public class BulletGreen01 extends Bullet {
public function BulletGreen01(){
damage = 30;
isRotating = true;
sheetID = 8;
hitWidth = 22;
hitHeight = 22;
xOffset = -12;
yOffset = -12;
}
}
}//package dvmClasses.elements.bullets
Section 95
//BulletGreen02 (dvmClasses.elements.bullets.BulletGreen02)
package dvmClasses.elements.bullets {
public class BulletGreen02 extends Bullet {
public function BulletGreen02(){
damage = 50;
isRotating = true;
sheetID = 9;
hitWidth = 33;
hitHeight = 33;
xOffset = -17;
yOffset = -17;
}
}
}//package dvmClasses.elements.bullets
Section 96
//BulletGreen03 (dvmClasses.elements.bullets.BulletGreen03)
package dvmClasses.elements.bullets {
public class BulletGreen03 extends Bullet {
public function BulletGreen03(){
isRotating = false;
animate = pingPong;
endFrame = 3;
damage = 100;
sheetID = 10;
hitWidth = 45;
hitHeight = 45;
xOffset = -25;
yOffset = -25;
}
}
}//package dvmClasses.elements.bullets
Section 97
//BulletGreen04 (dvmClasses.elements.bullets.BulletGreen04)
package dvmClasses.elements.bullets {
public class BulletGreen04 extends Bullet {
public function BulletGreen04(){
isRotating = false;
animate = pingPong;
endFrame = 3;
damage = 75;
sheetID = 11;
hitWidth = 22;
hitHeight = 22;
xOffset = -12;
yOffset = -12;
}
}
}//package dvmClasses.elements.bullets
Section 98
//BulletGreen05 (dvmClasses.elements.bullets.BulletGreen05)
package dvmClasses.elements.bullets {
public class BulletGreen05 extends Bullet {
public function BulletGreen05(){
isRotating = false;
animate = pingPong;
endFrame = 3;
damage = 20;
sheetID = 12;
hitWidth = 10;
hitHeight = 10;
xOffset = -6;
yOffset = -6;
}
}
}//package dvmClasses.elements.bullets
Section 99
//BulletRed02 (dvmClasses.elements.bullets.BulletRed02)
package dvmClasses.elements.bullets {
public class BulletRed02 extends Bullet {
public function BulletRed02(){
isRotating = false;
animate = loop;
endFrame = 6;
damage = 100;
sheetID = 17;
hitWidth = 27;
hitHeight = 27;
xOffset = -15;
yOffset = -15;
}
}
}//package dvmClasses.elements.bullets
Section 100
//BulletRed03 (dvmClasses.elements.bullets.BulletRed03)
package dvmClasses.elements.bullets {
public class BulletRed03 extends Bullet {
public function BulletRed03(){
isRotating = false;
animate = pingPong;
endFrame = 3;
damage = 140;
sheetID = 16;
hitWidth = 45;
hitHeight = 45;
xOffset = -25;
yOffset = -25;
}
}
}//package dvmClasses.elements.bullets
Section 101
//BulletRed04 (dvmClasses.elements.bullets.BulletRed04)
package dvmClasses.elements.bullets {
public class BulletRed04 extends Bullet {
public function BulletRed04(){
isRotating = false;
animate = pingPong;
endFrame = 3;
damage = 80;
sheetID = 15;
hitWidth = 11;
hitHeight = 11;
xOffset = -7;
yOffset = -7;
}
}
}//package dvmClasses.elements.bullets
Section 102
//BulletRed05 (dvmClasses.elements.bullets.BulletRed05)
package dvmClasses.elements.bullets {
public class BulletRed05 extends Bullet {
public function BulletRed05(){
isRotating = false;
animate = pingPong;
endFrame = 3;
damage = 55;
sheetID = 14;
hitWidth = 10;
hitHeight = 10;
xOffset = -6;
yOffset = -6;
}
}
}//package dvmClasses.elements.bullets
Section 103
//beamEffect (dvmClasses.elements.effects.beamEffects.beamEffect)
package dvmClasses.elements.effects.beamEffects {
import dvmClasses.elements.*;
public class beamEffect extends Animable {
public var shootEndFrame:uint;// = 3
public var shootOffset:int;// = -25
public var chargeEndFrame:uint;// = 3
public var chargeID:uint;// = 25
public var chargeOffset:int;// = -37
public var shootID:uint;// = 21
public function beamEffect(){
chargeID = 25;
shootID = 21;
chargeEndFrame = 3;
shootEndFrame = 3;
chargeOffset = -37;
shootOffset = -25;
super();
this.endFrame = 3;
this.animate = loop;
this.animDelay = 75;
}
public function switchToShoot(){
this.animDelay = 30;
this.animate = pingPong;
this.sheetID = shootID;
this.endFrame = shootEndFrame;
this.xOffset = shootOffset;
this.yOffset = shootOffset;
}
public function switchToHit(){
this.animDelay = 40;
this.animate = reverseLoop;
this.sheetID = chargeID;
this.endFrame = chargeEndFrame;
this.xOffset = chargeOffset;
this.yOffset = chargeOffset;
}
public function switchToCharge(){
this.animDelay = 75;
this.animate = loop;
this.startFrame = 0;
this.sheetID = chargeID;
this.endFrame = chargeEndFrame;
this.xOffset = chargeOffset;
this.yOffset = chargeOffset;
}
}
}//package dvmClasses.elements.effects.beamEffects
Section 104
//beamStart01 (dvmClasses.elements.effects.beamEffects.beamStart01)
package dvmClasses.elements.effects.beamEffects {
public class beamStart01 extends beamEffect {
public function beamStart01(){
sheetID = 25;
xOffset = -37;
yOffset = -37;
}
}
}//package dvmClasses.elements.effects.beamEffects
Section 105
//beamStart02 (dvmClasses.elements.effects.beamEffects.beamStart02)
package dvmClasses.elements.effects.beamEffects {
public class beamStart02 extends beamEffect {
public function beamStart02(){
sheetID = 26;
xOffset = -37;
yOffset = -37;
shootID = 16;
chargeID = 26;
chargeOffset = -37;
}
}
}//package dvmClasses.elements.effects.beamEffects
Section 106
//beamStart03 (dvmClasses.elements.effects.beamEffects.beamStart03)
package dvmClasses.elements.effects.beamEffects {
public class beamStart03 extends beamEffect {
public function beamStart03(){
sheetID = 26;
xOffset = -37;
yOffset = -37;
shootID = 42;
chargeID = 43;
chargeOffset = -37;
}
}
}//package dvmClasses.elements.effects.beamEffects
Section 107
//cloud (dvmClasses.elements.effects.clouds.cloud)
package dvmClasses.elements.effects.clouds {
import dvmClasses.elements.*;
public class cloud extends Animable {
protected var speed:Number;
public function doMove(_arg1:uint){
x = (x - (speed * _arg1));
if (x < -300){
this.dead = true;
};
}
}
}//package dvmClasses.elements.effects.clouds
Section 108
//cloud1 (dvmClasses.elements.effects.clouds.cloud1)
package dvmClasses.elements.effects.clouds {
public class cloud1 extends cloud {
public function cloud1(){
speed = (0.1 + (Math.random() * 0.1));
xOffset = 0;
yOffset = 0;
sheetID = 22;
animate = playOnceAndStop;
animDelay = 30;
currentAnimDelay = 30;
endFrame = 0;
}
}
}//package dvmClasses.elements.effects.clouds
Section 109
//cloud2 (dvmClasses.elements.effects.clouds.cloud2)
package dvmClasses.elements.effects.clouds {
public class cloud2 extends cloud {
public function cloud2(){
speed = (0.1 + (Math.random() * 0.1));
xOffset = 0;
yOffset = 0;
sheetID = 23;
animate = playOnceAndStop;
animDelay = 30;
currentAnimDelay = 30;
endFrame = 0;
}
}
}//package dvmClasses.elements.effects.clouds
Section 110
//cloud3 (dvmClasses.elements.effects.clouds.cloud3)
package dvmClasses.elements.effects.clouds {
public class cloud3 extends cloud {
public function cloud3(){
speed = (0.1 + (Math.random() * 0.1));
xOffset = 0;
yOffset = 0;
sheetID = 24;
animate = playOnceAndStop;
animDelay = 30;
currentAnimDelay = 30;
endFrame = 0;
}
}
}//package dvmClasses.elements.effects.clouds
Section 111
//bigExplosion1 (dvmClasses.elements.effects.bigExplosion1)
package dvmClasses.elements.effects {
import dvmClasses.elements.*;
public class bigExplosion1 extends Animable {
public function bigExplosion1(){
xOffset = -75;
yOffset = -75;
sheetID = 0;
animate = playOnceAndDie;
animDelay = 50;
currentAnimDelay = 60;
endFrame = 16;
}
}
}//package dvmClasses.elements.effects
Section 112
//bigExplosion1fast (dvmClasses.elements.effects.bigExplosion1fast)
package dvmClasses.elements.effects {
import dvmClasses.elements.*;
public class bigExplosion1fast extends Animable {
public function bigExplosion1fast(){
xOffset = -75;
yOffset = -75;
sheetID = 0;
animate = playOnceAndDie;
animDelay = 25;
currentAnimDelay = 60;
endFrame = 16;
}
}
}//package dvmClasses.elements.effects
Section 113
//bigExplosion2 (dvmClasses.elements.effects.bigExplosion2)
package dvmClasses.elements.effects {
import dvmClasses.elements.*;
public class bigExplosion2 extends Animable {
public function bigExplosion2(){
xOffset = -62;
yOffset = -62;
sheetID = 1;
animate = playOnceAndDie;
animDelay = 45;
currentAnimDelay = 50;
endFrame = 15;
}
}
}//package dvmClasses.elements.effects
Section 114
//bigExplosion2fast (dvmClasses.elements.effects.bigExplosion2fast)
package dvmClasses.elements.effects {
import dvmClasses.elements.*;
public class bigExplosion2fast extends Animable {
public function bigExplosion2fast(){
xOffset = -62;
yOffset = -62;
sheetID = 1;
animate = playOnceAndDie;
animDelay = 25;
currentAnimDelay = 50;
endFrame = 15;
}
}
}//package dvmClasses.elements.effects
Section 115
//impact1 (dvmClasses.elements.effects.impact1)
package dvmClasses.elements.effects {
import dvmClasses.elements.*;
public class impact1 extends Animable {
public function impact1(){
xOffset = -22;
yOffset = -22;
sheetID = 4;
animate = playOnceAndDie;
animDelay = 30;
currentAnimDelay = 50;
endFrame = 5;
}
}
}//package dvmClasses.elements.effects
Section 116
//impact2 (dvmClasses.elements.effects.impact2)
package dvmClasses.elements.effects {
import dvmClasses.elements.*;
public class impact2 extends Animable {
public function impact2(){
xOffset = -22;
yOffset = -22;
sheetID = 5;
animate = playOnceAndDie;
animDelay = 30;
currentAnimDelay = 50;
endFrame = 5;
}
}
}//package dvmClasses.elements.effects
Section 117
//impact3 (dvmClasses.elements.effects.impact3)
package dvmClasses.elements.effects {
import dvmClasses.elements.*;
public class impact3 extends Animable {
public function impact3(){
xOffset = -22;
yOffset = -22;
sheetID = 6;
animate = playOnceAndDie;
animDelay = 30;
currentAnimDelay = 50;
endFrame = 5;
}
}
}//package dvmClasses.elements.effects
Section 118
//medExplosion1 (dvmClasses.elements.effects.medExplosion1)
package dvmClasses.elements.effects {
import dvmClasses.elements.*;
public class medExplosion1 extends Animable {
public function medExplosion1(){
xOffset = -50;
yOffset = -50;
sheetID = 2;
animate = playOnceAndDie;
animDelay = 50;
currentAnimDelay = 40;
endFrame = 13;
}
}
}//package dvmClasses.elements.effects
Section 119
//medExplosion2 (dvmClasses.elements.effects.medExplosion2)
package dvmClasses.elements.effects {
import dvmClasses.elements.*;
public class medExplosion2 extends Animable {
public function medExplosion2(){
xOffset = -50;
yOffset = -50;
sheetID = 3;
animate = playOnceAndDie;
animDelay = 35;
currentAnimDelay = 40;
endFrame = 13;
}
}
}//package dvmClasses.elements.effects
Section 120
//medExplosion3 (dvmClasses.elements.effects.medExplosion3)
package dvmClasses.elements.effects {
import dvmClasses.elements.*;
public class medExplosion3 extends Animable {
public function medExplosion3(){
xOffset = -57;
yOffset = -57;
sheetID = 7;
animate = playOnceAndDie;
animDelay = 50;
currentAnimDelay = 50;
endFrame = 12;
}
}
}//package dvmClasses.elements.effects
Section 121
//smoke (dvmClasses.elements.effects.smoke)
package dvmClasses.elements.effects {
import dvmClasses.elements.*;
public class smoke extends Animable {
public function smoke(){
xOffset = -35;
yOffset = -35;
sheetID = 40;
animate = playOnceAndDie;
animDelay = (200 + (Math.random() * 200));
currentAnimDelay = 300;
endFrame = 5;
}
}
}//package dvmClasses.elements.effects
Section 122
//vanish (dvmClasses.elements.effects.vanish)
package dvmClasses.elements.effects {
import dvmClasses.elements.*;
public class vanish extends Animable {
public function vanish(){
xOffset = -22;
yOffset = -22;
sheetID = 38;
animate = playOnceAndDie;
animDelay = 30;
currentAnimDelay = 50;
endFrame = 4;
}
}
}//package dvmClasses.elements.effects
Section 123
//bomb (dvmClasses.elements.enemies.bomb)
package dvmClasses.elements.enemies {
import dvmClasses.elements.bullets.*;
public class bomb extends enemy {
public function bomb(){
this.myMoveMode = followMove;
this.life = 30;
this.hardness = 100;
this.turnSpeed = ((Math.random() * 0.0003) + 0.0015);
this.speed = (0.15 + (Math.random() * 0.05));
this.deg = (((Math.random() * Math.PI) * 2) - Math.PI);
this.hitWidth = 21;
this.hitHeight = 21;
moneyArray = [1, 1, 0];
this.xOffset = -22;
this.yOffset = -22;
this.animate = playOnceAndStop;
this.sheetID = 39;
this.animDelay = 70;
this.endFrame = 3;
this.baseStartFrame = 3;
this.baseEndFrame = 6;
this.baseAnimate = pingPong;
this.baseAnimDelay = 90;
this.explosionType = new Array(3, 4);
}
function deadShoot(){
var _local1:Bullet;
var _local2:Number;
var _local3:Number;
var _local4:uint;
_local2 = ((Math.PI * 2) / 9);
_local3 = (Math.PI / 18);
_local4 = 0;
while (_local4 < 9) {
_local1 = new BulletRed04();
_local1.setSpeeds((_local3 + (_local2 * _local4)), 0.25);
_local1.setPos(x, y);
dad.enemyBullets.push(_local1);
_local4++;
};
}
override public function takeDamage(_arg1:uint){
life = (life - _arg1);
if (life <= 0){
deadShoot();
dead = true;
};
}
}
}//package dvmClasses.elements.enemies
Section 124
//boss (dvmClasses.elements.enemies.boss)
package dvmClasses.elements.enemies {
import flash.display.*;
import dvmClasses.elements.bullets.*;
import dvmClasses.math.*;
import dvmClasses.mechanics.*;
public class boss extends MovieClip {
public var deg:Number;// = 0
public var GAME_HEIGHT:uint;// = 550
public var shoot:Function;
public var explosionScript:Array;
public var degOffset:Number;// = 0
public var myShotDelay:int;// = 20
public var speed:Number;// = 0.05
public var totalLife:int;
public var dead:Boolean;// = false
public var animTicker:Ticker;
public var acc:Number;// = 0.0004
public var score:uint;// = 100000
public var timeDiff:Number;// = 0
public var isCircleHit:Boolean;// = true
public var hitHeight:uint;// = 100
public var nearDeathHealth:uint;// = 20000
public var myShootFunction:Function;
public var myMoveMode:Function;
public var targetX:int;// = 0
public var targetY:int;// = 0
public var speedX:Number;// = 0
public var myShotOffset:int;// = 0
public var life:int;// = 10000
public var speedY:Number;// = 0
public var doMove:Function;
private var math:gMath;
public var GAME_WIDTH:uint;// = 800
public var degOffsetTarget:Number;// = 0
private var nearDeath:Boolean;// = false
public var nearDeathFunction:Function;
public var zigzagTicker:Ticker;
public var myShotArray:Array;
public var collisionDamage:uint;// = 2
private var myBulletTypes:Array;
public var moneyArray:Array;
public var delay:int;// = 1300
public var dad:MovieClip;
public var myDistance:uint;// = 0
public var hardness:uint;// = 10000
public var targetAngle:Number;// = 0
public var turnSpeed:Number;// = 0.0002
public var hitWidth:uint;// = 100
public function boss(){
GAME_WIDTH = 800;
GAME_HEIGHT = 550;
isCircleHit = true;
myDistance = 0;
collisionDamage = 2;
math = new gMath();
life = 10000;
totalLife = life;
turnSpeed = 0.0002;
speed = 0.05;
speedX = 0;
speedY = 0;
deg = 0;
degOffset = 0;
degOffsetTarget = 0;
acc = 0.0004;
hitWidth = 100;
hitHeight = 100;
score = 100000;
nearDeath = false;
nearDeathHealth = 20000;
nearDeathFunction = nullMove;
explosionScript = [];
myBulletTypes = new Array();
timeDiff = 0;
doMove = startMove;
shoot = nullShoot;
myShootFunction = nullShoot;
hardness = 10000;
targetX = 0;
targetY = 0;
targetAngle = 0;
delay = 1300;
dead = false;
myShotOffset = 0;
myShotDelay = 20;
animTicker = new Ticker(80);
myShotArray = new Array();
moneyArray = [4, 5, 4, 5, 3, 3];
super();
myBulletTypes.push(BulletRed02);
myBulletTypes.push(BulletRed03);
myBulletTypes.push(BulletRed04);
myBulletTypes.push(BulletRed05);
myBulletTypes.push(BulletFireball);
}
public function nullMove(){
}
public function setSpeeds(_arg1:Number, _arg2:Number){
var _local3:Array;
_local3 = math.speedFromAngle(_arg1, _arg2);
speedX = _local3[0];
speedY = _local3[1];
}
public function stayBounds(){
if (this.x < (hitWidth / 2)){
this.x = (hitWidth / 2);
} else {
if (this.x > (GAME_WIDTH - (hitWidth / 2))){
this.x = (GAME_WIDTH - (hitWidth / 2));
};
};
if (this.y < (hitHeight / 2)){
this.y = (hitHeight / 2);
} else {
if (this.y > (GAME_HEIGHT - (hitHeight / 2))){
this.y = (GAME_HEIGHT - (hitHeight / 2));
};
};
}
public function doShoot(){
var _local1:Array;
var _local2:Number;
var _local3:Bullet;
if (myShotArray.length == 0){
return;
};
if (myShotOffset >= myShotArray.length){
myShotOffset = 0;
};
if (myShotDelay > 0){
myShotDelay = (myShotDelay - timeDiff);
return;
};
if (myShotOffset >= myShotArray.length){
myShotOffset = 0;
};
_local1 = myShotArray[myShotOffset];
while (myShotDelay <= 0) {
myShotDelay = _local1[0];
_local3 = new (myBulletTypes[_local1[2]]);
_local3.x = (this.x + _local1[5]);
_local3.y = (this.y + _local1[6]);
targetAngle = math.pointAngle((this.x + _local1[5]), (this.y + _local1[6]), targetX, targetY);
if (_local1[4]){
_local2 = targetAngle;
} else {
_local2 = 0;
};
_local3.setSpeeds((_local1[1] + _local2), _local1[3]);
dad.addEnemyBullet(_local3);
_local3 = null;
myShotOffset++;
if (myShotOffset >= myShotArray.length){
myShotOffset = 0;
};
_local1 = myShotArray[myShotOffset];
};
}
public function bounceMove(){
this.x = (this.x + (speedX * timeDiff));
this.y = (this.y + (speedY * timeDiff));
if (this.x < (hitWidth / 2)){
this.x = (hitWidth / 2);
speedX = -(speedX);
} else {
if (this.x > (GAME_WIDTH - (hitWidth / 2))){
this.x = (GAME_WIDTH - (hitWidth / 2));
speedX = -(speedX);
};
};
if (this.y < (hitHeight / 2)){
this.y = (hitHeight / 2);
speedY = -(speedY);
} else {
if (this.y > (GAME_HEIGHT - (hitHeight / 2))){
this.y = (GAME_HEIGHT - (hitHeight / 2));
speedY = -(speedY);
};
};
}
public function takeDamage(_arg1:uint){
life = (life - _arg1);
if ((((life < nearDeathHealth)) && (!(nearDeath)))){
nearDeathFunction();
nearDeath = true;
};
dad.updateBossHp(life, totalLife);
if (life <= 0){
dead = true;
};
}
public function nullShoot(){
}
public function followZigzag(){
if (zigzagTicker.tick(timeDiff)){
degOffset = -(degOffset);
};
followMove();
}
public function followMove(){
var _local1:Array;
this.deg = math.rotateToAngle(deg, (math.pointAngle(this.x, this.y, targetX, targetY) + degOffset), (turnSpeed * timeDiff));
_local1 = math.speedFromAngle(speed, deg);
speedX = (_local1[0] * timeDiff);
speedY = (_local1[1] * timeDiff);
this.x = (this.x + speedX);
this.y = (this.y + speedY);
stayBounds();
}
public function startMove(){
var _local1:Array;
delay = (delay - timeDiff);
if (delay < 0){
if (this.myMoveMode != bounceMove){
_local1 = math.speedFromAngle(speed, math.pointAngle(this.x, this.y, targetX, targetY));
} else {
_local1 = math.speedFromAngle(speed, deg);
};
speedX = _local1[0];
speedY = _local1[1];
this.doMove = myMoveMode;
this.shoot = this.myShootFunction;
};
}
public function tick(_arg1:uint, _arg2:int, _arg3:int){
if (animTicker.tick(_arg1)){
this.nextFrame();
};
timeDiff = _arg1;
targetX = _arg2;
targetY = _arg3;
targetAngle = math.pointAngle(this.x, this.y, targetX, targetY);
doMove();
}
public function swingMove(){
var _local1:Array;
_local1 = math.speedFromAngle(speed, math.pointAngle(this.x, this.y, targetX, targetY));
if (speedX < _local1[0]){
speedX = (speedX + (acc * timeDiff));
} else {
speedX = (speedX - (acc * timeDiff));
};
if (speedY < _local1[1]){
speedY = (speedY + (acc * timeDiff));
} else {
speedY = (speedY - (acc * timeDiff));
};
this.x = (this.x + (speedX * timeDiff));
this.y = (this.y + (speedY * timeDiff));
stayBounds();
}
}
}//package dvmClasses.elements.enemies
Section 125
//bossBigMask (dvmClasses.elements.enemies.bossBigMask)
package dvmClasses.elements.enemies {
import dvmClasses.elements.beams.*;
import dvmClasses.elements.bullets.*;
import dvmClasses.math.*;
import dvmClasses.mechanics.*;
import dvmClasses.elements.effects.*;
public class bossBigMask extends boss {
private var beams:Array;
private var pauseTicker:Ticker;
private var shotScripts:Array;
private var samePhase:Boolean;// = false
private var cBeam:Beam;
private var math:gMath;
private var smokeTicker:Ticker;
private var phase:uint;// = 0
private var hShot:hoseShot;
private var cShot:circleShot;
public function bossBigMask(){
phase = 0;
samePhase = false;
shotScripts = [];
pauseTicker = new Ticker(2000);
cBeam = new Beam();
beams = [];
math = new gMath();
smokeTicker = new Ticker(300);
super();
addFrameScript(23, frame24, 53, frame54, 69, frame70, 84, frame85, 99, frame100);
this.nearDeathFunction = getBeatUp;
this.myMoveMode = bossScript;
this.nearDeathHealth = 30000;
this.life = 170000;
totalLife = life;
this.hardness = 10000;
this.turnSpeed = ((Math.random() * 0.0003) + 0.0015);
this.speed = (0.15 + (Math.random() * 0.05));
this.deg = (((Math.random() * Math.PI) * 2) - Math.PI);
this.hitWidth = 220;
this.hitHeight = 220;
moneyArray = [3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 2, 1, 1, 0, 0];
this.explosionScript = [[0, 0, 10, 0], [-50, -100, 10, 200], [50, 50, 9, 320], [0, -150, 9, 450]];
}
private function advancePhase(){
phase++;
phase = (phase % 6);
samePhase = false;
}
function frame24(){
gotoAndStop(15);
}
private function bossScript(){
var _local1:uint;
var _local2:Array;
var _local3:Number;
var _local4:smoke;
_local2 = [];
if (phase == 0){
if (!samePhase){
shotScripts = [];
speed = 0.07;
degOffset = (Math.PI / 2);
hShot = new hoseShot();
hShot.setup((Math.PI / 8), BulletRed04, 0.3, true, -53, -60, (Math.PI / 3), 0.15, 7, 50, 300, true);
shotScripts.push(hShot);
hShot = new hoseShot();
hShot.setup((Math.PI / 8), BulletRed04, 0.3, true, 57, -60, (Math.PI / 3), 0.15, 7, 50, 300, true);
shotScripts.push(hShot);
myShotArray = [[0, 0.1, 4, 0.3, true, 0, 0], [0, -0.1, 4, 0.3, true, 0, 0], [1500, 0, 4, 0.3, true, 0, 0]];
samePhase = true;
};
_local1 = 0;
while (_local1 < shotScripts.length) {
hShot = shotScripts[_local1];
hShot.setPos(x, y, targetAngle);
_local2 = hShot.tick(timeDiff);
if (_local2){
dad.addEnemyBullets(_local2);
};
if (shotScripts[0].cycles >= 25){
hShot.dead = true;
};
_local1++;
};
if (shotScripts[0].dead){
advancePhase();
};
doShoot();
followMove();
} else {
if (phase == 1){
if (!samePhase){
gotoAndStop(26);
speed = 0.2;
setSpeeds(speed, (Math.PI / 4));
samePhase = true;
pauseTicker.setDelay(3000);
};
bounceMove();
if (pauseTicker.tick(timeDiff)){
advancePhase();
};
} else {
if (phase == 2){
if (!samePhase){
cShot = new circleShot();
cShot.setup(0, 0.02, BulletRed03, 0.35, false, 0, 0, 16, 10, 50, 2500, true);
samePhase = true;
};
cShot.setPos(x, y, targetAngle);
_local2 = cShot.tick(timeDiff);
if (_local2){
dad.addEnemyBullets(_local2);
};
bounceMove();
if (cShot.cycles >= 4){
advancePhase();
};
} else {
if (phase == 3){
if (!samePhase){
myShotArray = [[0, 0.1, 4, 0.4, true, 0, 0], [0, -0.1, 4, 0.4, true, 0, 0], [50, 0, 4, 0.5, true, 0, 0], [20, 0.2, 1, 0.5, true, 0, 0], [400, -0.2, 1, 0.5, true, 0, 0]];
speed = 0.2;
pauseTicker.setDelay(8000);
samePhase = true;
};
doShoot();
followMove();
if (pauseTicker.tick(timeDiff)){
advancePhase();
};
} else {
if (phase == 4){
if (!samePhase){
gotoAndStop(56);
pauseTicker.setDelay(14000);
speed = 0.01;
_local3 = (Math.PI / 2);
_local1 = 0;
while (_local1 < 4) {
cBeam = new Beam(1, this.x, this.y, 0.6, 0.07, 2000, 10000, this, true, (_local3 * _local1));
cBeam.damage = 5;
cBeam.turnSpeed = 0;
cBeam.shootTurnSpeed = 0;
dad.enemyBeams.push(cBeam);
beams.push(cBeam);
_local1++;
};
samePhase = true;
};
doShoot();
followMove();
if (pauseTicker.tick(timeDiff)){
advancePhase();
};
} else {
if (phase == 5){
if (!samePhase){
gotoAndStop(71);
speed = 0.2;
setSpeeds(speed, (Math.PI / 4));
samePhase = true;
pauseTicker.setDelay(2000);
};
bounceMove();
if (pauseTicker.tick(timeDiff)){
advancePhase();
};
} else {
if (phase == 10){
if (!samePhase){
gotoAndStop(86);
dad.effectMan.addExplosion(x, y, math.randomGetFromArray([9, 9]));
speed = 0.1;
setSpeeds(speed, (Math.PI / 4));
samePhase = true;
cShot = new circleShot();
killBeams();
cShot.setup(0, 0.02, BulletRed03, 0.35, false, 0, 0, 10, 10, 400, 2500, true);
};
if (math.chance(5)){
dad.effectMan.addExplosion(((x + (Math.random() * hitWidth)) - (hitWidth / 2)), ((y + (Math.random() * hitHeight)) - (hitHeight / 2)), math.randomGetFromArray([0, 1, 5, 6]));
};
cShot.setPos(x, y, targetAngle);
_local2 = cShot.tick(timeDiff);
if (_local2){
dad.addEnemyBullets(_local2);
};
if (smokeTicker.tick(timeDiff)){
_local4 = new smoke();
_local4.x = (x - 50);
_local4.y = (y - 50);
_local4.effectSpeedY = -1;
_local4.effectSpeedX = (Math.random() * -0.5);
dad.effects.push(_local4);
};
bounceMove();
};
};
};
};
};
};
};
}
function frame54(){
gotoAndStop(43);
}
function frame70(){
gotoAndStop(65);
}
function frame85(){
gotoAndStop(15);
}
function frame100(){
gotoAndStop(86);
}
private function getBeatUp(){
samePhase = false;
phase = 10;
}
private function killBeams(){
var _local1:uint;
_local1 = 0;
while (_local1 < beams.length) {
beams[_local1].dead = true;
_local1++;
};
}
}
}//package dvmClasses.elements.enemies
Section 126
//bossBlob (dvmClasses.elements.enemies.bossBlob)
package dvmClasses.elements.enemies {
import com.greensock.*;
import dvmClasses.elements.beams.*;
import dvmClasses.elements.bullets.*;
import dvmClasses.math.*;
import dvmClasses.mechanics.*;
import com.greensock.easing.*;
import dvmClasses.elements.effects.*;
public class bossBlob extends boss {
private var i:uint;
private var beams:Array;
private var pauseTicker:Ticker;
private var shotScripts:Array;
private var samePhase:Boolean;// = false
private var spawnCount:uint;// = 0
private var cBeam:Beam;
private var math:gMath;
private var smokeTicker:Ticker;
private var phase:uint;// = 0
private var hShot:hoseShot;
private var holes:Array;
private var cHole:Array;
private var cHunter:hunter;
private var ang:Number;
private var cShot:circleShot;
public function bossBlob(){
phase = 0;
samePhase = false;
shotScripts = [];
pauseTicker = new Ticker(2000);
smokeTicker = new Ticker(200);
cBeam = new Beam();
math = new gMath();
beams = [];
holes = [[-50, -20], [20, -92], [45, 22]];
spawnCount = 0;
super();
addFrameScript(29, frame30, 44, frame45, 59, frame60);
this.nearDeathFunction = getBeatUp;
this.myMoveMode = bossScript;
this.nearDeathHealth = 30000;
this.life = 220000;
totalLife = life;
this.hardness = 10000;
this.turnSpeed = ((Math.random() * 0.0003) + 0.0015);
this.speed = (0.15 + (Math.random() * 0.05));
this.deg = (((Math.random() * Math.PI) * 2) - Math.PI);
this.hitWidth = 250;
this.hitHeight = 250;
moneyArray = [3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 2, 1, 1, 0, 0];
this.explosionScript = [[0, 0, 10, 0], [-50, -100, 10, 200], [50, 50, 9, 320], [0, -150, 9, 450]];
}
private function advancePhase(){
phase++;
phase = (phase % 10);
samePhase = false;
}
private function bossScript(){
var _local1:uint;
var _local2:Array;
var _local3:smoke;
_local2 = [];
if (phase == 0){
if (!samePhase){
samePhase = true;
TweenLite.to(this, 2, {x:(GAME_WIDTH / 2), y:(GAME_HEIGHT / 2), ease:Sine.easeInOut, onComplete:advancePhase});
};
} else {
if (phase == 1){
if (!samePhase){
samePhase = true;
ang = (Math.PI / 10);
pauseTicker.setDelay(2500);
cHole = holes[0];
_local1 = 0;
while (_local1 < 20) {
cBeam = new Beam(1, this.x, this.y, 1.3, 0.07, 1000, 3000, this, true, (ang * _local1));
cBeam.setOffset(cHole[0], cHole[1]);
cBeam.damage = 5;
cBeam.turnSpeed = 0;
cBeam.shootTurnSpeed = 0;
dad.enemyBeams.push(cBeam);
beams.push(cBeam);
_local1++;
};
};
if (pauseTicker.tick(timeDiff)){
_local1 = 0;
while (_local1 < 20) {
cBeam = new Beam(1, this.x, this.y, 1.3, 0.07, 2000, 3000, this, true, ((ang * _local1) + (Math.PI / 20)));
cBeam.setOffset(cHole[0], cHole[1]);
cBeam.damage = 5;
cBeam.turnSpeed = 0;
cBeam.shootTurnSpeed = 0;
dad.enemyBeams.push(cBeam);
beams.push(cBeam);
_local1++;
};
advancePhase();
};
} else {
if (phase == 2){
if (!samePhase){
samePhase = true;
pauseTicker.setDelay(5000);
};
if (pauseTicker.tick(timeDiff)){
TweenLite.to(this, 1.5, {x:(hitWidth / 2), y:(hitHeight / 2), ease:Sine.easeInOut, onComplete:advancePhase()});
};
} else {
if (phase == 3){
if (!samePhase){
samePhase = true;
cHole = holes[1];
cBeam = new Beam(1, this.x, this.y, 1.3, 0.07, 1000, 4000, this, true, -0.05);
cBeam.setOffset(cHole[0], cHole[1]);
cBeam.damage = 30;
cBeam.turnSpeed = 0;
cBeam.shootTurnSpeed = 0.0004;
dad.enemyBeams.push(cBeam);
beams.push(cBeam);
pauseTicker.setDelay(5000);
};
if (pauseTicker.tick(timeDiff)){
advancePhase();
};
} else {
if (phase == 4){
if (!samePhase){
samePhase = true;
cBeam = new Beam(1, this.x, this.y, 1.3, 0.07, 0, 3000, this, true, (Math.PI / 2));
cBeam.shootTurnSpeed = 0;
cBeam.setOffset(-135, 0);
cBeam.damage = 30;
dad.enemyBeams.push(cBeam);
beams.push(cBeam);
cBeam = new Beam(1, this.x, this.y, 1.3, 0.07, 0, 3000, this, true, (Math.PI / 2));
cBeam.shootTurnSpeed = 0;
cBeam.setOffset(135, 0);
cBeam.damage = 30;
dad.enemyBeams.push(cBeam);
beams.push(cBeam);
TweenLite.to(this, 3, {x:(GAME_WIDTH - (hitWidth / 2)), delay:0, ease:Sine.easeInOut, onComplete:advancePhase});
};
} else {
if (phase == 5){
if (!samePhase){
samePhase = true;
speed = 0.04;
degOffset = (Math.PI / 3);
gotoAndStop(31);
shotScripts = [];
hShot = new hoseShot();
hShot.setup(0, BulletRed02, 0.2, true, 0, 0, (Math.PI / 2), 0.5, 20, 80, 500, true);
shotScripts.push(hShot);
hShot = new hoseShot();
hShot.setup(0, BulletRed02, 0.2, true, 0, 0, (Math.PI / 2), 0.5, 20, 120, 300, true);
shotScripts.push(hShot);
hShot = new hoseShot();
hShot.setup(0, BulletRed02, 0.2, true, 0, 0, (Math.PI / 2), 0.5, 20, 100, 400, true);
shotScripts.push(hShot);
};
_local1 = 0;
while (_local1 < shotScripts.length) {
cHole = holes[_local1];
hShot = shotScripts[_local1];
hShot.setPos((x + cHole[0]), (y + cHole[1]), targetAngle);
_local2 = hShot.tick(timeDiff);
if (_local2){
dad.addEnemyBullets(_local2);
};
if (shotScripts[0].cycles >= 3){
hShot.dead = true;
};
_local1++;
};
if (shotScripts[0].dead){
advancePhase();
};
followMove();
} else {
if (phase == 6){
if (!samePhase){
pauseTicker.setDelay(2000);
samePhase = true;
};
if (pauseTicker.tick(timeDiff)){
advancePhase();
};
followMove();
} else {
if (phase == 7){
if (!samePhase){
samePhase = true;
shotScripts = [];
speed = 0.08;
degOffset = (Math.PI / 3);
hShot = new hoseShot();
hShot.setup(0, BulletRed03, 0.3, true, 0, 0, (Math.PI / 5), (Math.PI / 5), 20, 150, 1000, true);
shotScripts.push(hShot);
hShot = new hoseShot();
hShot.setup(0, BulletRed03, 0.3, true, 0, 0, (Math.PI / 5), (Math.PI / 5), 20, 150, 1000, true);
shotScripts.push(hShot);
hShot = new hoseShot();
hShot.setup(0, BulletRed03, 0.3, true, 0, 0, (Math.PI / 5), (Math.PI / 5), 20, 150, 1000, true);
shotScripts.push(hShot);
};
_local1 = 0;
while (_local1 < shotScripts.length) {
cHole = holes[_local1];
hShot = shotScripts[_local1];
hShot.setPos((x + cHole[0]), (y + cHole[1]), targetAngle);
_local2 = hShot.tick(timeDiff);
if (_local2){
dad.addEnemyBullets(_local2);
};
if (shotScripts[0].cycles >= 4){
hShot.dead = true;
};
_local1++;
};
if (shotScripts[0].dead){
advancePhase();
};
followMove();
} else {
if (phase == 8){
if (!samePhase){
pauseTicker.setDelay(500);
spawnCount = 0;
samePhase = true;
};
if (pauseTicker.tick(timeDiff)){
spawnCount++;
cHole = math.randomGetFromArray(holes);
cHunter = new hunter();
cHunter.x = (x + cHole[0]);
cHunter.y = (y + cHole[1]);
cHunter.delay = 10;
cHunter.dad = dad;
dad.enemies.push(cHunter);
};
if (spawnCount >= 10){
advancePhase();
};
followMove();
} else {
if (phase == 9){
if (!samePhase){
samePhase = true;
pauseTicker.setDelay(4000);
};
if (pauseTicker.tick(timeDiff)){
advancePhase();
};
followMove();
} else {
if (phase == 10){
if (!samePhase){
gotoAndStop(46);
dad.effectMan.addExplosion(x, y, math.randomGetFromArray([9, 9]));
speed = 0.03;
setSpeeds(speed, (Math.PI / 4));
samePhase = true;
pauseTicker.setDelay(2000);
myShotArray = [];
};
if (math.chance(5)){
dad.effectMan.addExplosion(((x + (Math.random() * hitWidth)) - (hitWidth / 2)), ((y + (Math.random() * hitHeight)) - (hitHeight / 2)), math.randomGetFromArray([0, 1, 5, 6]));
};
if (pauseTicker.tick(timeDiff)){
myShotArray = [[300, 0, 4, 0.7, true, -35, 85]];
};
if (smokeTicker.tick(timeDiff)){
_local3 = new smoke();
_local3.x = (x - 80);
_local3.y = (y + 70);
_local3.effectSpeedY = -1;
_local3.effectSpeedX = (Math.random() * -0.5);
dad.effects.push(_local3);
_local3 = new smoke();
_local3.x = (x + 100);
_local3.y = (y + 50);
_local3.effectSpeedY = -1.3;
_local3.effectSpeedX = (Math.random() * -0.5);
dad.effects.push(_local3);
};
doShoot();
bounceMove();
};
};
};
};
};
};
};
};
};
};
};
cleanBeams(false);
}
function frame30(){
gotoAndStop(15);
}
function frame45(){
gotoAndStop(31);
}
function frame60(){
gotoAndStop(46);
}
private function cleanBeams(_arg1:Boolean=false){
if (_arg1){
i = 0;
while (i < beams.length) {
beams[i].dead = true;
i++;
};
} else {
i = 0;
while (i < beams.length) {
if (beams[i].dead){
beams.splice(i, 1);
i--;
};
i++;
};
};
}
private function getBeatUp(){
TweenLite.killTweensOf(this);
cleanBeams(true);
samePhase = false;
phase = 10;
}
}
}//package dvmClasses.elements.enemies
Section 127
//bossCrystal (dvmClasses.elements.enemies.bossCrystal)
package dvmClasses.elements.enemies {
import flash.display.*;
import com.greensock.*;
import dvmClasses.elements.beams.*;
import dvmClasses.elements.bullets.*;
import dvmClasses.math.*;
import dvmClasses.mechanics.*;
import com.greensock.easing.*;
import dvmClasses.elements.effects.*;
public class bossCrystal extends boss {
private var i:uint;
private var cDonut:donut;
private var beams:Array;
private var pauseTicker:Ticker;
public var bigFlare:MovieClip;
private var samePhase:Boolean;// = false
private var spawnCount:uint;// = 0
private var shotScripts:Array;
private var cBeam:Beam;
private var math:gMath;
private var smokeTicker:Ticker;
private var phase:uint;// = 0
private var hShot:hoseShot;
private var cBomb:bomb;
private var holes:Array;
private var cHole:Array;
private var ang:Number;
private var cShot:circleShot;
public function bossCrystal(){
phase = 0;
samePhase = false;
shotScripts = [];
pauseTicker = new Ticker(2000);
smokeTicker = new Ticker(200);
cBeam = new Beam();
math = new gMath();
beams = [];
holes = [[-22, 9], [22, 9], [0, 50]];
spawnCount = 0;
super();
addFrameScript(0, frame1, 34, frame35, 49, frame50);
this.nearDeathFunction = getBeatUp;
this.myMoveMode = bossScript;
this.nearDeathHealth = 26000;
this.life = 220000;
totalLife = life;
this.hardness = 20000;
this.turnSpeed = ((Math.random() * 0.0003) + 0.0015);
this.speed = (0.15 + (Math.random() * 0.05));
this.deg = (((Math.random() * Math.PI) * 2) - Math.PI);
this.hitWidth = 240;
this.hitHeight = 240;
moneyArray = [3, 4, 3, 4, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 2, 1, 1, 0, 0];
this.explosionScript = [[0, 0, 10, 0], [-50, -100, 10, 200], [50, 50, 9, 320], [0, -150, 9, 450]];
}
private function advancePhase(){
phase++;
phase = (phase % 8);
samePhase = false;
}
function frame1(){
stop();
}
function frame35(){
gotoAndStop(19);
}
private function bossScript(){
var _local1:uint;
var _local2:Array;
var _local3:smoke;
_local2 = [];
if (phase == 0){
if (!samePhase){
samePhase = true;
setSpeeds(0.3, ((Math.random() * Math.PI) * 2));
pauseTicker.setDelay(300);
spawnCount = 0;
setSpeeds(0.05, (Math.PI / 4));
myShotArray = [[0, 0, 1, 0.4, false, -30, 0], [0, (Math.PI / 2), 1, 0.4, false, -30, 0], [0, Math.PI, 1, 0.4, false, -30, 0], [400, (Math.PI * 1.5), 1, 0.4, false, -30, 0]];
};
if (pauseTicker.tick(timeDiff)){
cBomb = new bomb();
cBomb.x = (x - 30);
cBomb.y = y;
cBomb.dad = dad;
cBomb.delay = 150;
dad.enemies.push(cBomb);
spawnCount++;
};
if (spawnCount > 50){
advancePhase();
};
bounceMove();
doShoot();
} else {
if (phase == 1){
if (!samePhase){
samePhase = true;
TweenLite.to(this, 3, {x:(GAME_WIDTH / 2), y:(GAME_HEIGHT / 2), ease:Sine.easeInOut, onComplete:advancePhase});
};
} else {
if (phase == 2){
if (!samePhase){
samePhase = true;
cShot = new circleShot();
cShot.setup(0, (Math.PI / 70), BulletRed04, 0.4, false, -30, 0, 10, 100, 50, 2000, true);
};
cShot.setPos(x, y, targetAngle);
_local2 = cShot.tick(timeDiff);
if (_local2){
dad.addEnemyBullets(_local2);
};
if (cShot.cycles >= 3){
advancePhase();
};
} else {
if (phase == 3){
if (!samePhase){
samePhase = true;
TweenLite.to(this, 3, {x:(hitWidth / 2), y:(hitHeight / 2), ease:Sine.easeInOut, onComplete:advancePhase});
};
} else {
if (phase == 4){
if (!samePhase){
samePhase = true;
pauseTicker.setDelay(50);
spawnCount = 0;
setSpeeds(0.03, (Math.PI / 4));
myShotArray = [[300, 0, 1, 0.4, true, -30, 0]];
spawnCount = 0;
};
if (pauseTicker.tick(timeDiff)){
cDonut = new donut();
cDonut.dad = dad;
cDonut.x = (x - 30);
cDonut.y = y;
cDonut.delay = 100;
dad.enemies.push(cDonut);
spawnCount++;
};
if (spawnCount > 100){
advancePhase();
};
bounceMove();
doShoot();
} else {
if (phase == 5){
if (!samePhase){
samePhase = true;
pauseTicker.setDelay(3000);
};
bounceMove();
if (pauseTicker.tick(timeDiff)){
advancePhase();
};
} else {
if (phase == 6){
if (!samePhase){
samePhase = true;
TweenLite.to(this, 3, {x:(GAME_WIDTH / 2), y:(GAME_HEIGHT / 2), ease:Sine.easeInOut, onComplete:advancePhase});
};
} else {
if (phase == 7){
if (!samePhase){
samePhase = true;
cShot = new circleShot();
cShot.setup(0, (-(Math.PI) / 70), BulletRed03, 0.4, false, -30, 0, 10, 100, 50, 2000, true);
};
cShot.setPos(x, y, targetAngle);
_local2 = cShot.tick(timeDiff);
if (_local2){
dad.addEnemyBullets(_local2);
};
if (cShot.cycles >= 3){
advancePhase();
};
} else {
if (phase == 10){
if (!samePhase){
gotoAndStop(36);
hitWidth = 200;
dad.effectMan.addExplosion(x, y, math.randomGetFromArray([9, 9]));
speed = 0.03;
setSpeeds(speed, (Math.PI / 4));
samePhase = true;
pauseTicker.setDelay(2000);
myShotArray = [];
hShot = new hoseShot();
hShot.setup((Math.PI / 8), BulletRed04, 0.3, true, -30, 0, (Math.PI / 3), 0.2, 30, 50, 800, true);
};
hShot.setPos(x, y, targetAngle);
_local2 = hShot.tick(timeDiff);
if (_local2){
dad.addEnemyBullets(_local2);
};
if (math.chance(3)){
dad.effectMan.addExplosion(((x + (Math.random() * hitWidth)) - (hitWidth / 2)), ((y + (Math.random() * hitHeight)) - (hitHeight / 2)), math.randomGetFromArray([0, 1, 5, 6]));
};
if (smokeTicker.tick(timeDiff)){
_local3 = new smoke();
_local3.x = (x + 60);
_local3.y = (y + 40);
_local3.effectSpeedY = -1;
_local3.effectSpeedX = ((Math.random() * 3) - 0.5);
dad.effects.push(_local3);
};
bounceMove();
};
};
};
};
};
};
};
};
};
cleanBeams(false);
}
function frame50(){
gotoAndStop(36);
}
private function cleanBeams(_arg1:Boolean=false){
if (_arg1){
i = 0;
while (i < beams.length) {
beams[i].dead = true;
i++;
};
} else {
i = 0;
while (i < beams.length) {
if (beams[i].dead){
beams.splice(i, 1);
i--;
};
i++;
};
};
}
private function getBeatUp(){
TweenLite.killTweensOf(this);
cleanBeams(true);
samePhase = false;
phase = 10;
}
}
}//package dvmClasses.elements.enemies
Section 128
//bossRope (dvmClasses.elements.enemies.bossRope)
package dvmClasses.elements.enemies {
import com.greensock.*;
import dvmClasses.elements.beams.*;
import dvmClasses.elements.bullets.*;
import dvmClasses.math.*;
import dvmClasses.mechanics.*;
import com.greensock.easing.*;
import dvmClasses.elements.effects.*;
public class bossRope extends boss {
private var i:uint;
private var beams:Array;
private var pauseTicker:Ticker;
private var shotScripts:Array;
private var samePhase:Boolean;// = false
private var spawnCount:uint;// = 0
private var cBeam:Beam;
private var math:gMath;
private var smokeTicker:Ticker;
private var phase:uint;// = 0
private var hShot:hoseShot;
private var holes:Array;
private var cHole:Array;
private var cHunter:hunter;
private var ang:Number;
private var cShot:circleShot;
public function bossRope(){
phase = 0;
samePhase = false;
shotScripts = [];
pauseTicker = new Ticker(2000);
smokeTicker = new Ticker(200);
cBeam = new Beam();
math = new gMath();
beams = [];
holes = [[-22, 9], [22, 9], [0, 50]];
spawnCount = 0;
super();
addFrameScript(10, frame11, 15, frame16);
this.nearDeathFunction = getBeatUp;
this.myMoveMode = bossScript;
this.nearDeathHealth = 10000;
this.life = 95000;
totalLife = life;
this.hardness = 20000;
this.turnSpeed = ((Math.random() * 0.0003) + 0.0015);
this.speed = (0.15 + (Math.random() * 0.05));
this.deg = (((Math.random() * Math.PI) * 2) - Math.PI);
this.hitWidth = 170;
this.hitHeight = 170;
this.isCircleHit = false;
moneyArray = [3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 2, 1, 1, 0, 0];
this.explosionScript = [[0, 0, 10, 0], [-50, -100, 10, 200], [50, 50, 9, 320], [0, -150, 9, 450]];
}
private function advancePhase(){
phase++;
phase = (phase % 6);
samePhase = false;
}
function frame16(){
gotoAndStop(12);
}
function frame11(){
gotoAndStop(7);
}
private function bossScript(){
var _local1:uint;
var _local2:Array;
var _local3:smoke;
_local2 = [];
if (phase == 0){
if (!samePhase){
samePhase = true;
setSpeeds(0.3, ((Math.random() * Math.PI) * 2));
pauseTicker.setDelay(15000);
myShotArray = [[0, 0, 1, 0.15, false, 0, 50], [0, (Math.PI / 2), 1, 0.15, false, 0, 50], [0, Math.PI, 1, 0.15, false, 0, 50], [400, (Math.PI * 1.5), 1, 0.15, false, 0, 50]];
};
if (pauseTicker.tick(timeDiff)){
advancePhase();
};
bounceMove();
doShoot();
} else {
if (phase == 1){
if (!samePhase){
samePhase = true;
TweenLite.to(this, 1.5, {x:(GAME_WIDTH / 2), y:(GAME_HEIGHT / 2), ease:Sine.easeInOut, onComplete:advancePhase});
};
} else {
if (phase == 2){
if (!samePhase){
samePhase = true;
spawnCount = 0;
pauseTicker.setDelay(50);
ang = (Math.PI / 15);
};
if ((((spawnCount < 30)) && (pauseTicker.tick(timeDiff)))){
cBeam = new Beam(1, this.x, this.y, 1.3, 0.07, 1000, 1000, this, true, (spawnCount * ang));
cBeam.damage = 3;
cBeam.turnSpeed = 0;
cBeam.shootTurnSpeed = 0;
dad.enemyBeams.push(cBeam);
beams.push(cBeam);
spawnCount++;
};
if (spawnCount >= 30){
advancePhase();
};
} else {
if (phase == 3){
if (!samePhase){
samePhase = true;
pauseTicker.setDelay(3000);
};
if (pauseTicker.tick(timeDiff)){
advancePhase();
};
} else {
if (phase == 4){
if (!samePhase){
samePhase = true;
cShot = new circleShot();
cShot.setup(0, (Math.PI / 10), BulletRed02, 0.4, false, 0, 0, 10, 20, 400, 2000, true);
speed = 0.06;
degOffset = (Math.PI / 3);
};
cShot.setPos(x, y, targetAngle);
_local2 = cShot.tick(timeDiff);
if (_local2){
dad.addEnemyBullets(_local2);
};
if (cShot.cycles >= 2){
advancePhase();
};
followMove();
} else {
if (phase == 5){
if (!samePhase){
samePhase = true;
pauseTicker.setDelay(9000);
myShotArray = [[40, 0, 1, 0.5, false, 0, 50], [0, Math.PI, 1, 0.5, false, 0, 50], [40, 0, 1, 0.5, true, 0, 50], [0, 0.1, 0, 0.5, true, 0, 50], [40, -0.1, 0, 0.5, true, 0, 50], [0, 0.05, 2, 0.5, true, 0, 50], [400, -0.05, 2, 0.5, true, 0, 50]];
};
doShoot();
followMove();
if (pauseTicker.tick(timeDiff)){
advancePhase();
};
} else {
if (phase == 10){
if (!samePhase){
gotoAndStop(12);
dad.effectMan.addExplosion(x, y, math.randomGetFromArray([9, 9]));
speed = 0.03;
setSpeeds(speed, (Math.PI / 4));
samePhase = true;
pauseTicker.setDelay(2000);
myShotArray = [];
};
if (math.chance(3)){
dad.effectMan.addExplosion(((x + (Math.random() * hitWidth)) - (hitWidth / 2)), ((y + (Math.random() * hitHeight)) - (hitHeight / 2)), math.randomGetFromArray([0, 1, 5, 6]));
};
if (pauseTicker.tick(timeDiff)){
myShotArray = [[30, 0, 2, 0.5, true, -22, 9], [0, 0, 2, 0.5, true, 22, 9], [30, 0.05, 2, 0.5, true, -22, 9], [0, -0.05, 2, 0.5, true, 22, 9], [30, 0.1, 2, 0.5, true, -22, 9], [0, -0.1, 2, 0.5, true, 22, 9], [30, 0.15, 2, 0.5, true, -22, 9], [0, -0.15, 2, 0.5, true, 22, 9], [30, 0.1, 2, 0.5, true, -22, 9], [0, -0.1, 2, 0.5, true, 22, 9], [400, 0, 0, 0.5, true, 0, 50]];
};
if (smokeTicker.tick(timeDiff)){
_local3 = new smoke();
_local3.x = (x - 50);
_local3.y = (y + 70);
_local3.effectSpeedY = -1;
_local3.effectSpeedX = (Math.random() * -0.5);
dad.effects.push(_local3);
_local3 = new smoke();
_local3.x = (x + 70);
_local3.y = (y + 50);
_local3.effectSpeedY = -1.3;
_local3.effectSpeedX = (Math.random() * -0.5);
dad.effects.push(_local3);
};
doShoot();
bounceMove();
};
};
};
};
};
};
};
cleanBeams(false);
}
private function cleanBeams(_arg1:Boolean=false){
if (_arg1){
i = 0;
while (i < beams.length) {
beams[i].dead = true;
i++;
};
} else {
i = 0;
while (i < beams.length) {
if (beams[i].dead){
beams.splice(i, 1);
i--;
};
i++;
};
};
}
private function getBeatUp(){
TweenLite.killTweensOf(this);
cleanBeams(true);
samePhase = false;
phase = 10;
}
}
}//package dvmClasses.elements.enemies
Section 129
//bouncer (dvmClasses.elements.enemies.bouncer)
package dvmClasses.elements.enemies {
import dvmClasses.mechanics.*;
public class bouncer extends enemy {
private var spawnCount:int;// = 10
private var spawnTicker:Ticker;
public function bouncer(){
spawnTicker = new Ticker(500);
spawnCount = 10;
super();
this.myMoveMode = bounceMove;
this.myShootFunction = spawnBlobs;
this.life = 300;
this.score = 200;
this.hardness = 170;
this.speed = (0.22 + (Math.random() * 0.05));
this.deg = (((Math.random() * Math.PI) * 2) - Math.PI);
this.hitWidth = 48;
this.hitHeight = 48;
moneyArray = [1, 1];
this.xOffset = -27;
this.yOffset = -27;
this.animate = playOnceAndStop;
this.sheetID = 31;
this.animDelay = 80;
this.endFrame = 4;
this.baseStartFrame = 4;
this.baseEndFrame = 8;
this.baseAnimate = loop;
this.baseAnimDelay = 80;
this.explosionType = new Array(0, 1, 2);
}
private function spawnBlobs(){
var _local1:bouncerBlob;
if (spawnCount <= 0){
return;
};
if (spawnTicker.tick(timeDiff)){
_local1 = new bouncerBlob();
_local1.x = x;
_local1.y = (y - 20);
dad.enemies.push(_local1);
};
}
}
}//package dvmClasses.elements.enemies
Section 130
//bouncerBlob (dvmClasses.elements.enemies.bouncerBlob)
package dvmClasses.elements.enemies {
import dvmClasses.mechanics.*;
public class bouncerBlob extends enemy {
private var killTicker:Ticker;
public function bouncerBlob(){
killTicker = new Ticker(3000);
super();
this.myMoveMode = bounceMove;
this.myShootFunction = killMe;
this.score = 3;
this.life = 10;
this.hardness = 0;
this.speed = 0.02;
this.deg = (((Math.random() * Math.PI) * 2) - Math.PI);
this.hitWidth = 18;
this.hitHeight = 18;
this.delay = 20;
this.collisionDamage = 5;
this.xOffset = -12;
this.yOffset = -12;
this.animate = playOnceAndStop;
this.sheetID = 32;
this.animDelay = 30;
this.endFrame = 3;
this.baseStartFrame = 0;
this.baseEndFrame = 3;
this.baseAnimate = loop;
this.baseAnimDelay = 30;
this.explosionType = new Array(2, 2);
}
private function killMe(){
if (killTicker.tick(timeDiff)){
dead = true;
};
}
}
}//package dvmClasses.elements.enemies
Section 131
//donut (dvmClasses.elements.enemies.donut)
package dvmClasses.elements.enemies {
public class donut extends enemy {
public function donut(){
this.myMoveMode = followMove;
this.life = 50;
this.hardness = 30;
this.turnSpeed = ((Math.random() * 0.0003) + 0.0015);
this.speed = (0.18 + (Math.random() * 0.05));
this.deg = (((Math.random() * Math.PI) * 2) - Math.PI);
this.hitWidth = 24;
this.hitHeight = 24;
collisionDamage = 2;
score = 10;
moneyArray = [0];
this.xOffset = -16;
this.yOffset = -16;
this.animate = playOnceAndStop;
this.sheetID = 18;
this.animDelay = 70;
this.endFrame = 4;
this.baseStartFrame = 4;
this.baseEndFrame = 9;
this.baseAnimate = loop;
this.baseAnimDelay = 50;
this.explosionType = new Array(0, 1, 2);
}
}
}//package dvmClasses.elements.enemies
Section 132
//donutLord (dvmClasses.elements.enemies.donutLord)
package dvmClasses.elements.enemies {
import dvmClasses.math.*;
import dvmClasses.mechanics.*;
import flash.geom.*;
public class donutLord extends enemy {
private var math:gMath;
private var children:Array;
private var isSpawning:Boolean;// = true
private var spawnOffsets:Array;
private var spawnTicker;
private var minChildren:uint;// = 3
private var maxChildren:uint;// = 15
public function donutLord(){
spawnOffsets = new Array(new Point(-31, 34), new Point(0, 42), new Point(34, 34));
minChildren = 3;
maxChildren = 15;
children = new Array();
spawnTicker = new Ticker(500);
isSpawning = true;
math = new gMath();
super();
this.myMoveMode = followMove;
this.delay = 1000;
this.life = 1500;
this.hardness = 300;
this.score = 1000;
this.turnSpeed = ((Math.random() * 0.0003) + 0.002);
this.speed = (0.02 + (Math.random() * 0.03));
this.deg = (((Math.random() * Math.PI) * 2) - Math.PI);
this.hitWidth = 95;
this.hitHeight = 95;
this.isCircleHit = true;
moneyArray = [3];
this.xOffset = -62;
this.yOffset = -54;
this.animate = playOnceAndStop;
this.sheetID = 29;
this.animDelay = 80;
this.endFrame = 3;
this.baseStartFrame = 3;
this.baseEndFrame = 6;
this.baseAnimate = pingPong;
this.baseAnimDelay = 150;
this.explosionType = new Array(9, 9);
this.myShootFunction = spawnDonuts;
}
private function cleanDead(){
var _local1:uint;
_local1 = 0;
while (_local1 < children.length) {
if (children[_local1].dead){
children.splice(_local1, 1);
_local1--;
};
_local1++;
};
}
private function spawnDonuts(){
var _local1:donut;
var _local2:Point;
if (isSpawning){
if (spawnTicker.tick(timeDiff)){
_local1 = new donut();
_local2 = math.randomGetFromArray(spawnOffsets);
_local1.x = (x + _local2.x);
_local1.y = (y + _local2.y);
_local1.delay = 100;
_local1.hardness = 0;
_local1.animDelay = 20;
children.push(_local1);
dad.enemies.push(_local1);
if (children.length >= maxChildren){
isSpawning = false;
};
};
} else {
if (children.length <= minChildren){
isSpawning = true;
};
};
cleanDead();
}
}
}//package dvmClasses.elements.enemies
Section 133
//enemy (dvmClasses.elements.enemies.enemy)
package dvmClasses.elements.enemies {
import flash.display.*;
import dvmClasses.elements.*;
import dvmClasses.elements.bullets.*;
import dvmClasses.math.*;
import dvmClasses.mechanics.*;
public class enemy extends Animable {
public var myShotOffset:int;// = 0
public var speedY:Number;// = 0
public var doMove:Function;
public var deg:Number;// = 0
private var math:gMath;
private var GAME_HEIGHT:uint;// = 550
private var GAME_WIDTH:uint;// = 800
public var shoot:Function;
public var baseAnimDelay:uint;// = 50
public var degOffsetTarget:Number;// = 0
public var myShotArray:Array;
public var degOffset:Number;// = 0
public var zigzagTicker:Ticker;
public var baseEndFrame:uint;// = 5
public var speed:Number;
public var collisionDamage:uint;// = 1
private var myBulletTypes:Array;
public var timeDiff:Number;// = 0
public var myShotDelay:int;// = 20
public var delay:int;// = 500
public var dad:MovieClip;
public var acc:Number;// = 0.0004
public var moneyArray:Array;
public var score:uint;// = 10
public var isCircleHit:Boolean;// = false
public var myDistance:uint;// = 0
public var myShootFunction:Function;
public var baseAnimate:Function;
public var turnSpeed:Number;
public var hardness:uint;// = 10
public var baseStartFrame:uint;// = 5
public var myMoveMode:Function;
public var targetX:int;// = 0
public var targetY:int;// = 0
public var explosionType:Array;
public var speedX:Number;// = 0
public var life:int;// = 10
public function enemy(){
GAME_WIDTH = 800;
GAME_HEIGHT = 550;
isCircleHit = false;
baseAnimate = loop;
baseStartFrame = 5;
baseEndFrame = 5;
baseAnimDelay = 50;
myDistance = 0;
collisionDamage = 1;
math = new gMath();
life = 10;
score = 10;
speedX = 0;
speedY = 0;
deg = 0;
degOffset = 0;
degOffsetTarget = 0;
acc = 0.0004;
explosionType = new Array([0]);
myBulletTypes = new Array();
timeDiff = 0;
doMove = startMove;
shoot = nullShoot;
myShootFunction = nullShoot;
hardness = 10;
targetX = 0;
targetY = 0;
delay = 500;
myShotOffset = 0;
myShotDelay = 20;
myShotArray = new Array();
moneyArray = new Array();
super();
this.animate = playOnceAndStop;
myBulletTypes.push(BulletRed02);
myBulletTypes.push(BulletRed03);
myBulletTypes.push(BulletRed04);
myBulletTypes.push(BulletRed05);
myBulletTypes.push(BulletFireball);
}
public function nullMove(){
}
public function followZigzag(){
if (zigzagTicker.tick(timeDiff)){
degOffset = -(degOffset);
};
followMove();
}
public function followMove(){
var _local1:Array;
this.deg = math.rotateToAngle(deg, (math.pointAngle(this.x, this.y, targetX, targetY) + degOffset), (turnSpeed * timeDiff));
_local1 = math.speedFromAngle(speed, deg);
speedX = (_local1[0] * timeDiff);
speedY = (_local1[1] * timeDiff);
this.x = (this.x + speedX);
this.y = (this.y + speedY);
stayBounds();
}
public function startMove(){
var _local1:Array;
delay = (delay - timeDiff);
if (delay < 0){
if (this.myMoveMode != bounceMove){
_local1 = math.speedFromAngle(speed, math.pointAngle(this.x, this.y, targetX, targetY));
} else {
_local1 = math.speedFromAngle(speed, deg);
};
speedX = _local1[0];
speedY = _local1[1];
this.doMove = myMoveMode;
this.shoot = this.myShootFunction;
setAnim(baseAnimate, baseStartFrame, baseEndFrame, baseAnimDelay);
};
}
public function doShoot(){
var _local1:Array;
var _local2:Number;
var _local3:Number;
var _local4:Bullet;
if (myShotDelay > 0){
myShotDelay = (myShotDelay - timeDiff);
return;
};
if (myShotOffset >= myShotArray.length){
myShotOffset = 0;
};
_local1 = myShotArray[myShotOffset];
_local2 = math.pointAngle(this.x, this.y, targetX, targetY);
while (myShotDelay <= 0) {
myShotDelay = _local1[0];
_local4 = new (myBulletTypes[_local1[2]]);
_local4.x = (this.x + _local1[5]);
_local4.y = (this.y + _local1[6]);
if (_local1[4]){
_local3 = _local2;
} else {
_local3 = 0;
};
_local4.setSpeeds((_local1[1] + _local3), _local1[3]);
dad.addEnemyBullet(_local4);
_local4 = null;
myShotOffset++;
if (myShotOffset >= myShotArray.length){
myShotOffset = 0;
};
_local1 = myShotArray[myShotOffset];
};
}
private function stayBounds(){
if (this.x < 0){
this.x = 0;
} else {
if (this.x > GAME_WIDTH){
this.x = GAME_WIDTH;
};
};
if (this.y < 0){
this.y = 0;
} else {
if (this.y > GAME_HEIGHT){
this.y = GAME_HEIGHT;
};
};
}
public function tick(_arg1:uint, _arg2:int, _arg3:int){
timeDiff = _arg1;
targetX = _arg2;
targetY = _arg3;
doMove();
shoot();
}
public function bounceMove(){
if (this.x < 0){
this.x = 0;
speedX = -(speedX);
} else {
if (this.x > GAME_WIDTH){
this.x = GAME_WIDTH;
speedX = -(speedX);
};
};
if (this.y < 0){
this.y = 0;
speedY = -(speedY);
} else {
if (this.y > GAME_HEIGHT){
this.y = GAME_HEIGHT;
speedY = -(speedY);
};
};
this.x = (this.x + (speedX * timeDiff));
this.y = (this.y + (speedY * timeDiff));
}
public function takeDamage(_arg1:uint){
life = (life - _arg1);
if (life <= 0){
dead = true;
};
}
public function nullShoot(){
}
public function swingMove(){
var _local1:Array;
_local1 = math.speedFromAngle(speed, math.pointAngle(this.x, this.y, targetX, targetY));
if (speedX < _local1[0]){
speedX = (speedX + (acc * timeDiff));
} else {
speedX = (speedX - (acc * timeDiff));
};
if (speedY < _local1[1]){
speedY = (speedY + (acc * timeDiff));
} else {
speedY = (speedY - (acc * timeDiff));
};
this.x = (this.x + (speedX * timeDiff));
this.y = (this.y + (speedY * timeDiff));
stayBounds();
}
}
}//package dvmClasses.elements.enemies
Section 134
//eyeTower (dvmClasses.elements.enemies.eyeTower)
package dvmClasses.elements.enemies {
public class eyeTower extends enemy {
public function eyeTower(){
this.myMoveMode = nullMove;
this.delay = (500 + (Math.random() * 600));
this.life = 700;
this.hardness = 180;
this.score = 400;
this.hitWidth = 43;
this.hitHeight = 62;
moneyArray = [2, 2];
this.xOffset = -25;
this.yOffset = -37;
this.animate = playOnceAndStop;
this.sheetID = 30;
this.animDelay = 70;
this.endFrame = 4;
this.baseStartFrame = 4;
this.baseEndFrame = 7;
this.baseAnimate = pingPong;
this.baseAnimDelay = 80;
this.explosionType = new Array(7, 9);
this.myShootFunction = doShoot;
this.myShotArray.push([1500, ((Math.random() / 4) - 0.125), 1, 0.35, true, 0, -20]);
}
}
}//package dvmClasses.elements.enemies
Section 135
//hunter (dvmClasses.elements.enemies.hunter)
package dvmClasses.elements.enemies {
import dvmClasses.math.*;
public class hunter extends enemy {
private var math:gMath;
private var dir:int;// = 1
private var checkCount:uint;// = 0
public function hunter(){
checkCount = 0;
math = new gMath();
dir = 1;
super();
this.myMoveMode = hunterFollowMove;
this.delay = (400 + (Math.random() * 600));
this.life = 350;
this.hardness = 200;
this.score = 300;
this.turnSpeed = ((Math.random() * 0.001) + 0.002);
this.speed = (0.17 + (Math.random() * 0.05));
this.deg = (((Math.random() * Math.PI) * 2) - Math.PI);
this.hitWidth = 50;
this.hitHeight = 50;
if (math.chance(50)){
dir = -1;
};
moneyArray = [2];
this.xOffset = -27;
this.yOffset = -27;
this.animate = playOnceAndStop;
this.sheetID = 28;
this.animDelay = 80;
this.endFrame = 3;
this.baseStartFrame = 3;
this.baseEndFrame = 7;
this.baseAnimate = loop;
this.baseAnimDelay = 60;
this.explosionType = new Array(3, 8);
this.myShootFunction = doShoot;
this.myShotArray.push([50, 0, 2, 0.36, true, 0, 0]);
this.myShotArray.push([50, 0.03, 3, 0.37, true, 0, 0]);
this.myShotArray.push([50, -0.03, 3, 0.38, true, 0, 0]);
this.myShotArray.push([1500, 0.01, 3, 0.36, true, 0, 0]);
}
private function hunterFollowMove(){
checkCount++;
checkCount = (checkCount % 5);
if (!checkCount){
if (math.pointDistanceSquare(x, y, targetX, targetY) < 72500){
if (math.pointDistanceSquare(x, y, targetX, targetY) < 42500){
degOffset = ((Math.PI / 1.3) * dir);
speed = (0.26 + (Math.random() * 0.05));
} else {
degOffset = ((Math.PI / 2) * dir);
speed = (0.15 + (Math.random() * 0.05));
};
} else {
degOffset = ((Math.PI / 5) * dir);
speed = (0.15 + (Math.random() * 0.05));
};
};
followMove();
}
}
}//package dvmClasses.elements.enemies
Section 136
//orange (dvmClasses.elements.enemies.orange)
package dvmClasses.elements.enemies {
public class orange extends enemy {
public function orange(){
this.myMoveMode = followMove;
this.delay = (200 + (Math.random() * 600));
this.life = 200;
this.hardness = 120;
this.score = 100;
this.turnSpeed = ((Math.random() * 0.0003) + 0.002);
this.speed = (0.02 + (Math.random() * 0.03));
this.deg = (((Math.random() * Math.PI) * 2) - Math.PI);
this.hitWidth = 46;
this.hitHeight = 46;
moneyArray = [1, 1];
this.xOffset = -30;
this.yOffset = -30;
this.animate = playOnceAndStop;
this.sheetID = 19;
this.animDelay = 70;
this.endFrame = 4;
this.baseStartFrame = 4;
this.baseEndFrame = 10;
this.baseAnimate = pingPong;
this.baseAnimDelay = 50;
this.explosionType = new Array(1, 5, 6);
this.myShootFunction = doShoot;
this.myShotArray.push([0, ((Math.random() / 4) - 0.125), 3, 0.35, true, 0, 10]);
this.myShotArray.push([0, ((Math.random() / 4) - 0.125), 0, 0.37, true, 0, 10]);
this.myShotArray.push([0, ((Math.random() / 4) - 0.125), 3, 0.33, true, 0, 10]);
this.myShotArray.push([2000, ((Math.random() / 4) - 0.125), 3, 0.34, true, 0, 10]);
}
}
}//package dvmClasses.elements.enemies
Section 137
//shieldEye (dvmClasses.elements.enemies.shieldEye)
package dvmClasses.elements.enemies {
public class shieldEye extends enemy {
public function shieldEye(){
this.myMoveMode = followMove;
this.myShootFunction = doShoot;
this.doMove = buildShield;
this.life = 10;
this.hardness = 320;
this.turnSpeed = ((Math.random() * 0.0003) + 0.0008);
this.speed = (0.05 + (Math.random() * 0.05));
this.deg = (((Math.random() * Math.PI) * 2) - Math.PI);
this.hitWidth = 35;
this.hitHeight = 75;
this.score = 500;
moneyArray = [3, 0, 0];
this.xOffset = -22;
this.yOffset = -25;
this.delay = 200;
this.animate = playOnceAndStop;
this.sheetID = 41;
this.animDelay = 70;
this.endFrame = 6;
this.baseStartFrame = 6;
this.baseEndFrame = 9;
this.baseAnimate = pingPong;
this.baseAnimDelay = 100;
this.explosionType = new Array(9, 9);
myShotArray = [[1500, ((Math.random() / 4) - 0.125), 1, 0.35, true, 0, 0]];
}
private function buildShield(){
var _local1:Array;
var _local2:shieldWall;
var _local3:uint;
_local1 = [[-44, 0], [44, 0], [-23, -38], [22, -38], [-23, 38], [22, 38], [-60, 0], [60, 0], [0, -60], [0, 60]];
_local3 = 0;
while (_local3 < _local1.length) {
_local2 = new shieldWall();
_local2.setup(this, _local1[_local3][0], _local1[_local3][1]);
dad.enemies.push(_local2);
_local3++;
};
this.doMove = startMove;
}
override public function takeDamage(_arg1:uint){
if (delay > 0){
return;
};
life = (life - _arg1);
if (life <= 0){
dead = true;
};
}
}
}//package dvmClasses.elements.enemies
Section 138
//shieldWall (dvmClasses.elements.enemies.shieldWall)
package dvmClasses.elements.enemies {
public class shieldWall extends enemy {
public var yMoveOffset:int;// = 0
public var xMoveOffset:int;// = 0
public var controller:enemy;
public function shieldWall(){
xMoveOffset = 0;
yMoveOffset = 0;
super();
this.doMove = followEye;
this.life = 1500;
this.hardness = 0;
this.hitWidth = 35;
this.hitHeight = 75;
score = 5;
moneyArray = [0];
this.xOffset = -22;
this.yOffset = -25;
this.animate = playOnceAndStop;
this.sheetID = 41;
this.animDelay = 70;
this.endFrame = 3;
this.explosionType = new Array(0, 1, 2);
}
public function setup(_arg1:enemy, _arg2:int, _arg3:int){
controller = _arg1;
xMoveOffset = _arg2;
yMoveOffset = _arg3;
}
private function followEye(){
x = (controller.x + xMoveOffset);
y = (controller.y + yMoveOffset);
if (controller.dead){
dead = true;
};
}
}
}//package dvmClasses.elements.enemies
Section 139
//zapper (dvmClasses.elements.enemies.zapper)
package dvmClasses.elements.enemies {
import dvmClasses.elements.beams.*;
import dvmClasses.mechanics.*;
public class zapper extends enemy {
private var zapTicker:Ticker;
private var stayTicker:Ticker;
public function zapper(){
zapTicker = new Ticker((4000 + (Math.random() * 1000)));
stayTicker = new Ticker(2000);
super();
zapTicker.delayNow = (zapTicker.delayNow / (1 + (4 * Math.random())));
this.myMoveMode = followZigzag;
this.life = 400;
this.hardness = 200;
this.turnSpeed = ((Math.random() * 0.0003) + 0.003);
this.speed = (0.05 + (Math.random() * 0.05));
this.deg = (((Math.random() * Math.PI) * 2) - Math.PI);
this.degOffset = 1.3;
this.hitWidth = 26;
this.hitHeight = 26;
this.delay = 800;
zigzagTicker = new Ticker(2000);
this.myShootFunction = zap;
score = 340;
moneyArray = [3];
this.xOffset = -30;
this.yOffset = -30;
this.animate = playOnceAndStop;
this.sheetID = 27;
this.animDelay = 150;
this.endFrame = 4;
this.baseStartFrame = 4;
this.baseEndFrame = 7;
this.baseAnimate = pingPong;
this.baseAnimDelay = 120;
this.explosionType = new Array(7, 7);
}
private function zap(){
var _local1:Beam;
if (zapTicker.tick(timeDiff)){
_local1 = new Beam(1, this.x, this.y, 0.6, 0.07, 1000, 600, this);
_local1.damage = 1.7;
_local1.turnSpeed = 0.0002;
_local1.shootTurnSpeed = 0.0001;
_local1.setOffset(0, 20);
dad.enemyBeams.push(_local1);
doMove = nullMove;
stayTicker.reset();
};
if (stayTicker.tick(timeDiff)){
doMove = myMoveMode;
};
}
}
}//package dvmClasses.elements.enemies
Section 140
//zigzag (dvmClasses.elements.enemies.zigzag)
package dvmClasses.elements.enemies {
import dvmClasses.mechanics.*;
public class zigzag extends enemy {
public function zigzag(){
this.myMoveMode = followZigzag;
this.life = 100;
this.hardness = 55;
this.turnSpeed = ((Math.random() * 0.0003) + 0.003);
this.speed = (0.2 + (Math.random() * 0.05));
this.deg = (((Math.random() * Math.PI) * 2) - Math.PI);
this.degOffset = 1.3;
this.hitWidth = 33;
this.hitHeight = 33;
zigzagTicker = new Ticker(1000);
score = 25;
collisionDamage = 2;
moneyArray = [0, 0];
this.xOffset = -20;
this.yOffset = -20;
this.animate = playOnceAndStop;
this.sheetID = 20;
this.animDelay = 40;
this.endFrame = 7;
this.baseStartFrame = 7;
this.baseEndFrame = 12;
this.baseAnimate = pingPong;
this.baseAnimDelay = 60;
this.explosionType = new Array(0, 1, 2);
}
}
}//package dvmClasses.elements.enemies
Section 141
//money (dvmClasses.elements.money.money)
package dvmClasses.elements.money {
import dvmClasses.elements.*;
import dvmClasses.mechanics.*;
public class money extends Animable {
public var got:Boolean;// = false
private var shakeAnimTicker:Ticker;
private var dieTicker:Ticker;
private var shakeTicker:Ticker;
private var shakeOffset:int;// = 1
private var isShaking:Boolean;// = false
public var VALUE:uint;// = 50
private var speedY:Number;// = 0
private var speedX:Number;// = 0
public function money(){
VALUE = 50;
dieTicker = new Ticker(6000);
shakeTicker = new Ticker(4000);
shakeAnimTicker = new Ticker(50);
speedX = 0;
speedY = 0;
shakeOffset = 1;
isShaking = false;
got = false;
super();
speedX = ((Math.random() * 0.04) - 0.02);
speedY = ((Math.random() * 0.04) - 0.02);
}
public function setPos(_arg1:int, _arg2:int, _arg3:uint, _arg4:uint){
x = ((_arg1 + (Math.random() * _arg3)) - (_arg3 >> 1));
y = ((_arg2 + (Math.random() * _arg4)) - (_arg4 >> 1));
}
public function tick(_arg1:uint){
this.x = (this.x + (speedX * _arg1));
this.y = (this.y + (speedY * _arg1));
if (shakeTicker.tick(_arg1)){
isShaking = true;
};
if (isShaking){
if (shakeAnimTicker.tick(_arg1)){
x = (x + shakeOffset);
shakeOffset = (~(shakeOffset) + 1);
};
};
if (dieTicker.tick(_arg1)){
this.dead = true;
};
}
}
}//package dvmClasses.elements.money
Section 142
//money1000 (dvmClasses.elements.money.money1000)
package dvmClasses.elements.money {
public class money1000 extends money {
public function money1000(){
sheetID = 36;
hitWidth = (hitHeight = 35);
xOffset = (yOffset = -23);
VALUE = 1000;
}
}
}//package dvmClasses.elements.money
Section 143
//money200 (dvmClasses.elements.money.money200)
package dvmClasses.elements.money {
public class money200 extends money {
public function money200(){
sheetID = 34;
hitWidth = (hitHeight = 19);
xOffset = (yOffset = -11);
VALUE = 200;
}
}
}//package dvmClasses.elements.money
Section 144
//money2000 (dvmClasses.elements.money.money2000)
package dvmClasses.elements.money {
public class money2000 extends money {
public function money2000(){
sheetID = 37;
hitWidth = (hitHeight = 35);
xOffset = (yOffset = -23);
VALUE = 2000;
}
}
}//package dvmClasses.elements.money
Section 145
//money50 (dvmClasses.elements.money.money50)
package dvmClasses.elements.money {
public class money50 extends money {
public function money50(){
sheetID = 33;
hitWidth = (hitHeight = 15);
xOffset = (yOffset = -9);
VALUE = 50;
}
}
}//package dvmClasses.elements.money
Section 146
//money500 (dvmClasses.elements.money.money500)
package dvmClasses.elements.money {
public class money500 extends money {
public function money500(){
sheetID = 35;
hitWidth = (hitHeight = 30);
xOffset = (yOffset = -18);
VALUE = 500;
}
}
}//package dvmClasses.elements.money
Section 147
//Animable (dvmClasses.elements.Animable)
package dvmClasses.elements {
public class Animable {
public var currentAnimDelay:int;// = 50
public var startFrame:uint;// = 0
public var cFrame:uint;// = 0
public var dead:Boolean;// = false
public var endFrame:uint;// = 13
public var hitHeight:uint;// = 100
public var animDelay:uint;// = 50
public var animate:Function;
public var effectSpeedX:Number;// = 0
public var effectSpeedY:Number;// = 0
public var xOffset:int;// = -50
public var yOffset:int;// = -50
private var animSign:int;// = 1
public var hitWidth:uint;// = 100
public var x:Number;// = 200
public var y:Number;// = 200
public var sheetID:uint;// = 2
public function Animable(){
x = 200;
y = 200;
effectSpeedX = 0;
effectSpeedY = 0;
hitWidth = 100;
hitHeight = 100;
xOffset = -50;
yOffset = -50;
sheetID = 2;
cFrame = 0;
animSign = 1;
animate = doNothing;
animDelay = 50;
currentAnimDelay = 50;
startFrame = 0;
endFrame = 13;
dead = false;
super();
}
public function moveEffect(){
x = (x + effectSpeedX);
y = (y + effectSpeedY);
}
private function animTick(_arg1:uint):Boolean{
currentAnimDelay = (currentAnimDelay - _arg1);
if (currentAnimDelay <= 0){
currentAnimDelay = (currentAnimDelay + animDelay);
return (true);
};
return (false);
}
public function setAnim(_arg1:Function, _arg2:uint=0, _arg3:uint=1, _arg4:uint=50){
animate = _arg1;
startFrame = _arg2;
cFrame = startFrame;
endFrame = _arg3;
animDelay = _arg4;
}
public function loop(_arg1:uint):void{
if (animTick(_arg1)){
if (cFrame < endFrame){
cFrame++;
} else {
cFrame = startFrame;
};
};
}
public function pingPong(_arg1:uint):void{
if (animTick(_arg1)){
if (animSign > 0){
if (cFrame < endFrame){
cFrame++;
} else {
animSign = -1;
cFrame--;
};
} else {
if (cFrame > startFrame){
cFrame--;
} else {
animSign = 1;
cFrame++;
};
};
};
}
public function playOnceAndDie(_arg1:uint):void{
if (animTick(_arg1)){
if (cFrame < endFrame){
cFrame++;
} else {
this.dead = true;
};
};
}
public function playOnceAndStop(_arg1:uint):void{
if (animTick(_arg1)){
if (cFrame < endFrame){
cFrame++;
} else {
animate = doNothing;
};
};
}
public function reverseLoop(_arg1:uint):void{
if (animTick(_arg1)){
if (cFrame > 0){
cFrame--;
} else {
cFrame = endFrame;
};
};
}
public function doNothing(_arg1:uint):void{
}
}
}//package dvmClasses.elements
Section 148
//Hero (dvmClasses.elements.Hero)
package dvmClasses.elements {
import flash.display.*;
import com.greensock.*;
import dvmClasses.elements.bullets.*;
import dvmClasses.math.*;
import dvmClasses.mechanics.*;
import com.greensock.easing.*;
public class Hero extends Sprite {
private var normalHitWidth:uint;
public var isBomb:Boolean;// = false
private var myShotPattern:Array;
private var gameWidth:uint;// = 800
private var shieldHitHeight:uint;// = 100
public var isShield:Boolean;// = false
public var bombLength:uint;// = 1
private var thisSpeed:Number;// = 0.8
private var myBulletTypes:Array;
private var targetOffsetX:int;// = 0
private var cursor:MouseCursor;
public var heroSprite:HeroSprite;
public var health:int;// = 1000
private var shield:shieldSprite;
public var dead:Boolean;// = false
private var myShotDelay:int;// = 0
private var targetOffsetY:int;// = 0
private var shieldHitWidth:uint;// = 100
private var normalHitHeight:uint;
public var dad:MovieClip;
private var target:Target;
public var hitHeight:uint;// = 17
private var m:gMath;
private var gameHeight:uint;// = 600
public var moneyHitHeight:uint;// = 35
private var targetAngle:Number;// = 0
private var myShotPatterns:Array;
public var noGun:Boolean;// = false
public var moneyHitWidth:uint;// = 35
private var targetDist:Number;// = 35
public var targetX:int;// = 0
public var targetY:int;// = 0
public var mouseIsDown:Boolean;// = false
private var myShotOffset:int;// = 0
public var hitWidth:uint;// = 17
private var cShot:circleShot;
public function Hero(){
gameWidth = 800;
gameHeight = 600;
thisSpeed = 0.8;
shield = new shieldSprite();
target = new Target();
cursor = new MouseCursor();
heroSprite = new HeroSprite();
dead = false;
health = 1000;
mouseIsDown = false;
hitWidth = 17;
hitHeight = 17;
moneyHitWidth = 35;
moneyHitHeight = 35;
noGun = false;
normalHitWidth = hitWidth;
normalHitHeight = hitHeight;
shieldHitWidth = 100;
shieldHitHeight = 100;
isShield = false;
isBomb = false;
bombLength = 1;
m = new gMath();
targetDist = 35;
targetX = 0;
targetY = 0;
targetOffsetX = 0;
targetOffsetY = 0;
targetAngle = 0;
myShotDelay = 0;
myShotOffset = 0;
myBulletTypes = new Array();
myShotPatterns = new Array();
myShotPattern = new Array();
super();
this.mouseEnabled = false;
this.mouseChildren = false;
this.addChildAt(heroSprite, 0);
this.addChildAt(target, 0);
this.addChildAt(cursor, 0);
this.addChildAt(shield, 0);
myBulletTypes.push(BulletGreen01);
myBulletTypes.push(BulletGreen02);
myBulletTypes.push(BulletGreen03);
myBulletTypes.push(BulletGreen04);
myBulletTypes.push(BulletGreen05);
myBulletTypes.push(BulletFireball);
myShotPatterns.push([[30, 0, 4, 0.4], [0, 0.05, 4, 0.4], [100, -0.05, 4, 0.4]]);
myShotPatterns.push([[50, 0, 1, 0.5], [0, 0.05, 0, 0.5], [50, -0.05, 0, 0.5], [0, 0.1, 4, 0.5], [100, -0.1, 4, 0.5]]);
myShotPatterns.push([[50, 0, 3, 0.55], [0, 0.1, 1, 0.5], [50, -0.1, 1, 0.5], [0, 0.6, 4, 0.45], [100, -0.6, 4, 0.45]]);
myShotPatterns.push([[30, 0, 3, 0.5], [0, 0.07, 3, 0.5], [20, -0.05, 3, 0.5], [0, 0.05, 4, 0.45], [20, -0.08, 4, 0.45], [30, 0.12, 3, 0.45], [0, 0.07, 3, 0.4], [20, -0.13, 3, 0.4], [0, 0.08, 4, 0.4], [200, -0.1, 4, 0.4]]);
myShotPatterns.push([[0, -0.4, 4, 0.5], [0, 0.4, 4, 0.5], [0, -0.3, 4, 0.52], [0, 0.3, 4, 0.52], [0, -0.2, 1, 0.55], [0, 0.2, 1, 0.55], [0, -0.1, 1, 0.57], [0, 0.1, 1, 0.57], [0, -0.05, 3, 0.6], [0, 0.05, 3, 0.6], [300, 0, 3, 0.62]]);
myShotPatterns.push([[30, 0, 2, 0.6], [0, 0.2, 3, 0.5], [90, -0.2, 3, 0.5]]);
myShotPatterns.push([[10, 0, 5, 0.6], [0, 0.05, 5, 0.6], [30, -0.05, 5, 0.6], [0, 0.2, 2, 0.5], [30, -0.2, 2, 0.5], [0, 0.4, 0, 0.5], [100, -0.4, 0, 0.5]]);
myShotPattern = myShotPatterns[0];
}
public function init(_arg1:uint=800, _arg2:uint=550, _arg3:MovieClip=null, _arg4:uint=0):void{
shield.visible = false;
dad = _arg3;
gameWidth = _arg1;
gameHeight = _arg2;
cursor.x = (cursor.y = (target.x = (target.y = -50)));
heroSprite.x = (gameWidth / 2);
heroSprite.y = (gameHeight / 2);
heroSprite.gotoAndStop((_arg4 + 1));
}
public function onShield(){
if (isShield){
return;
};
isShield = true;
shield.visible = true;
hitWidth = shieldHitWidth;
hitHeight = shieldHitHeight;
shield.scaleX = 1.5;
shield.scaleY = 1.5;
TweenLite.to(shield, 0.7, {scaleX:1, scaleY:1, ease:Back.easeOut});
}
public function setShot(_arg1:uint=0){
myShotPattern = myShotPatterns[_arg1];
}
private function addShots(_arg1:uint){
var _local2:Array;
var _local3:Bullet;
var _local4:Bullet;
if (noGun){
return;
};
myShotDelay = (myShotDelay - _arg1);
if (myShotDelay <= 0){
dad.sb.playGameSound(4);
while (myShotDelay <= 0) {
_local2 = myShotPattern[myShotOffset];
myShotOffset++;
if (myShotOffset >= myShotPattern.length){
myShotOffset = 0;
};
myShotDelay = _local2[0];
_local4 = new (myBulletTypes[_local2[2]]);
_local4.x = heroSprite.x;
_local4.y = heroSprite.y;
_local4.setSpeeds((_local2[1] + targetAngle), _local2[3]);
dad.playerBullets.push(_local4);
_local4 = null;
};
};
}
public function hideShield(){
shield.visible = false;
}
public function tick(_arg1:uint){
var _local2:Number;
var _local3:Array;
var _local4:Number;
var _local5:Array;
cursor.x = mouseX;
cursor.y = mouseY;
cursor.rotation = (cursor.rotation + (_arg1 * 0.05));
target.rotation = (target.rotation + (_arg1 * 0.05));
shield.rotation = (shield.rotation + (_arg1 * 0.5));
if (m.pointDistanceSquare(heroSprite.x, heroSprite.y, mouseX, mouseY) < Math.pow((_arg1 * thisSpeed), 2)){
heroSprite.x = mouseX;
heroSprite.y = mouseY;
} else {
_local2 = m.pointAngle(heroSprite.x, heroSprite.y, mouseX, mouseY);
_local3 = m.speedFromAngle((thisSpeed * _arg1), _local2);
heroSprite.x = (heroSprite.x + _local3[0]);
heroSprite.y = (heroSprite.y + _local3[1]);
};
if (heroSprite.x > gameWidth){
heroSprite.x = gameWidth;
} else {
if (heroSprite.x < 0){
heroSprite.x = 0;
};
};
if (heroSprite.y > gameHeight){
heroSprite.y = gameHeight;
} else {
if (heroSprite.y < 0){
heroSprite.y = 0;
};
};
if (mouseIsDown){
targetX = (heroSprite.x + targetOffsetX);
targetY = (heroSprite.y + targetOffsetY);
} else {
if (m.pointDistanceSquare(targetX, targetY, heroSprite.x, heroSprite.y) > Math.pow((targetDist + 1), 2)){
_local4 = m.pointAngle(heroSprite.x, heroSprite.y, targetX, targetY);
_local5 = m.speedFromAngle(targetDist, _local4);
targetX = (heroSprite.x + _local5[0]);
targetY = (heroSprite.y + _local5[1]);
};
targetOffsetX = (targetX - heroSprite.x);
targetOffsetY = (targetY - heroSprite.y);
};
target.x = targetX;
target.y = targetY;
targetAngle = m.pointAngle(heroSprite.x, heroSprite.y, targetX, targetY);
shield.x = heroSprite.x;
shield.y = heroSprite.y;
addShots(_arg1);
if (isBomb){
addBombShots(_arg1);
};
}
private function addBombShots(_arg1:uint){
var _local2:Array;
cShot.setPos(heroSprite.x, heroSprite.y, targetAngle);
_local2 = cShot.tick(_arg1);
if (_local2 != null){
dad.playerBullets = dad.playerBullets.concat(_local2);
};
if (cShot.dead){
isBomb = false;
};
}
public function doBomb(){
cShot = new circleShot();
cShot.setup(0, (Math.PI / 20), BulletGreen04, 0.5, true, 0, 0, 20, bombLength, 50, 500, false);
isBomb = true;
}
public function takeDamage(_arg1:uint){
if (isShield){
if (shield.scaleX == 1){
shield.scaleX = (shield.scaleY = 0.9);
TweenLite.to(shield, 0.2, {scaleX:1, scaleY:1, ease:Back.easeOut});
};
if (shield.currentFrame != 2){
shield.gotoAndPlay(2);
};
dad.sb.playGameSound(8);
return;
};
dad.sb.playGameSound(10);
health = (health - _arg1);
if (health <= 0){
dad.levelResult("dead");
};
}
public function offShield(){
if (!isShield){
return;
};
isShield = false;
hitWidth = normalHitWidth;
hitHeight = normalHitHeight;
TweenLite.to(shield, 0.4, {scaleX:0.1, scaleY:0.1, ease:Strong.easeOut, onComplete:hideShield});
}
}
}//package dvmClasses.elements
Section 149
//HeroSprite (dvmClasses.elements.HeroSprite)
package dvmClasses.elements {
import flash.display.*;
public class HeroSprite extends MovieClip {
public var dead:Boolean;// = false
public function HeroSprite(){
dead = false;
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package dvmClasses.elements
Section 150
//MouseCursor (dvmClasses.elements.MouseCursor)
package dvmClasses.elements {
import flash.display.*;
public class MouseCursor extends Sprite {
public var dead:Boolean;// = false
public function MouseCursor(){
dead = false;
super();
}
}
}//package dvmClasses.elements
Section 151
//shieldSprite (dvmClasses.elements.shieldSprite)
package dvmClasses.elements {
import flash.display.*;
public class shieldSprite extends MovieClip {
public function shieldSprite(){
addFrameScript(0, frame1, 3, frame4);
}
function frame1(){
stop();
}
function frame4(){
gotoAndStop(1);
}
}
}//package dvmClasses.elements
Section 152
//Target (dvmClasses.elements.Target)
package dvmClasses.elements {
import flash.display.*;
public class Target extends Sprite {
public var dead:Boolean;// = false
public function Target(){
dead = false;
super();
}
}
}//package dvmClasses.elements
Section 153
//Canvas (dvmClasses.gfx.Canvas)
package dvmClasses.gfx {
import flash.display.*;
import com.greensock.*;
import dvmClasses.elements.*;
import dvmClasses.elements.beams.*;
import flash.geom.*;
import com.greensock.easing.*;
import dvmClasses.sheetBitmaps.*;
public class Canvas extends Sprite {
private var canvasGfx:MovieClip;
private var clearBmd:BitmapData;
private var sheets:Array;
private var bm:Bitmap;
private var canvasWidth:uint;// = 800
private var bmd:BitmapData;
private var canvasHeight:uint;// = 580
private var sheetBmps:Array;
public function Canvas(_arg1:uint, _arg2:uint, _arg3:uint=0){
canvasWidth = 800;
canvasHeight = 580;
sheets = sheetMaker.makeSheets();
sheetBmps = new Array();
super();
canvasWidth = _arg1;
canvasHeight = _arg2;
bmd = new BitmapData(canvasWidth, canvasHeight, false, 0xFFFFFF);
clearBmd = new BitmapData(canvasWidth, canvasHeight, false, 0xFFFFFF);
canvasGfx = new skyGradient01();
canvasGfx.gotoAndStop((_arg3 + 1));
clearBmd.draw(canvasGfx);
canvasGfx = null;
bm = new Bitmap(bmd, "always", true);
this.addChild(bm);
clear();
sheetBmps.push(new sheet01());
sheetBmps.push(new sheet02());
}
public function drawBeam(_arg1:Beam):void{
var _local2:Matrix;
_local2 = new Matrix();
_local2.translate(_arg1.x, _arg1.y);
bmd.draw(_arg1.beamGfxCapsule, _local2);
drawAnimable(_arg1.startAnim);
if (_arg1.isHit){
drawAnimable(_arg1.endAnim);
};
}
public function lockCanvas():void{
bmd.lock();
}
public function drawAnimable(_arg1:Animable):void{
var _local2:uint;
_local2 = sheets[_arg1.sheetID][0][0];
bmd.copyPixels(sheetBmps[_local2], sheets[_arg1.sheetID][_arg1.cFrame][1], new Point((_arg1.x + _arg1.xOffset), (_arg1.y + _arg1.yOffset)), null, null, true);
}
public function clear():void{
bmd.draw(clearBmd);
}
private function clearGlow(_arg1:Sprite){
this.removeChild(_arg1);
}
public function unlockCanvas():void{
bmd.unlock();
}
public function addGlow(_arg1:int, _arg2:int, _arg3:Number=2){
var _local4:BossGlow;
_local4 = new BossGlow();
_local4.x = _arg1;
_local4.y = _arg2;
this.addChild(_local4);
_local4.blendMode = "overlay";
TweenLite.to(_local4, _arg3, {alpha:0, ease:Sine.easeIn, onComplete:clearGlow, onCompleteParams:[_local4]});
}
public function drawBoss(_arg1:MovieClip){
var _local2:Matrix;
_local2 = new Matrix();
_local2.translate(_arg1.x, _arg1.y);
bmd.draw(_arg1, _local2);
}
}
}//package dvmClasses.gfx
Section 154
//EffectManager (dvmClasses.gfx.EffectManager)
package dvmClasses.gfx {
import flash.display.*;
import dvmClasses.elements.*;
import dvmClasses.math.*;
import dvmClasses.elements.effects.*;
public class EffectManager {
private var impactClasses:Array;
private var explosionArray:Array;
private var dad:MovieClip;
private var math:gMath;
private var scriptXML:XML;
private var explosionClasses:Array;
private var explosionScripts:Array;
public function EffectManager(_arg1:MovieClip){
explosionArray = new Array();
math = new gMath();
explosionClasses = new Array(Class(bigExplosion1), Class(bigExplosion2), Class(bigExplosion1fast), Class(bigExplosion2fast), Class(medExplosion1), Class(medExplosion2), Class(medExplosion3), Class(impact1), Class(impact2), Class(impact3));
impactClasses = new Array(Class(impact1), Class(impact2), Class(impact3));
scriptXML = <scripts>
<script name="00 simple med 01">
<exp type="4" xOff="0" yOff="0" delay="0"></exp>
</script>
<script name="01 simple med 02">
<exp type="5" xOff="0" yOff="0" delay="0"></exp>
</script>
<script name="02 simple med 03">
<exp type="6" xOff="0" yOff="0" delay="0"></exp>
</script>
<script name="03 simple big 01">
<exp type="0" xOff="0" yOff="0" delay="0"></exp>
</script>
<script name="04 simple big 02">
<exp type="1" xOff="0" yOff="0" delay="0"></exp>
</script>
<script name="05 simple big 01 fast">
<exp type="2" xOff="0" yOff="0" delay="0"></exp>
</script>
<script name="06 simple big 02 fast">
<exp type="3" xOff="0" yOff="0" delay="0"></exp>
</script>
<script name="07 zapper big">
<exp type="5" xOff="60" yOff="20" delay="0"></exp>
<exp type="4" xOff="-60" yOff="0" delay="40"></exp>
<exp type="4" xOff="-20" yOff="50" delay="60"></exp>
<exp type="5" xOff="30" yOff="-40" delay="75"></exp>
<exp type="3" xOff="20" yOff="0" delay="100"></exp>
<exp type="0" xOff="0" yOff="-50" delay="130"></exp>
</script>
<script name="08 hunter">
<exp type="2" xOff="0" yOff="0" delay="0"></exp>
<exp type="4" xOff="-60" yOff="0" delay="60"></exp>
<exp type="4" xOff="60" yOff="20" delay="150"></exp>
<exp type="5" xOff="30" yOff="-40" delay="120"></exp>
<exp type="5" xOff="-10" yOff="60" delay="90"></exp>
</script>
<script name="09 zapper big">
<exp type="1" xOff="0" yOff="00" delay="0"></exp>
<exp type="3" xOff="90" yOff="20" delay="0"></exp>
<exp type="2" xOff="-70" yOff="0" delay="80"></exp>
<exp type="3" xOff="-20" yOff="50" delay="100"></exp>
<exp type="2" xOff="60" yOff="-60" delay="130"></exp>
<exp type="2" xOff="50" yOff="0" delay="150"></exp>
<exp type="1" xOff="0" yOff="-90" delay="190"></exp>
<exp type="0" xOff="-40" yOff="-20" delay="190"></exp>
</script>
<script name="10 boss 01">
<exp type="1" xOff="-89" yOff="-13" delay="0"></exp>
<exp type="2" xOff="-75" yOff="77" delay="0"></exp>
<exp type="2" xOff="-128" yOff="-60" delay="0"></exp>
<exp type="0" xOff="-7" yOff="-6" delay="0"></exp>
<exp type="1" xOff="-53" yOff="-46" delay="0"></exp>
<exp type="0" xOff="8" yOff="-84" delay="0"></exp>
<exp type="1" xOff="89" yOff="-13" delay="0"></exp>
<exp type="2" xOff="3" yOff="77" delay="0"></exp>
<exp type="2" xOff="128" yOff="-60" delay="70"></exp>
<exp type="3" xOff="18" yOff="147" delay="70"></exp>
<exp type="3" xOff="112" yOff="106" delay="90"></exp>
<exp type="2" xOff="154" yOff="35" delay="120"></exp>
<exp type="4" xOff="-38" yOff="-155" delay="250"></exp>
<exp type="4" xOff="52" yOff="-165" delay="280"></exp>
<exp type="5" xOff="-127" yOff="-130" delay="300"></exp>
<exp type="5" xOff="-165" yOff="13" delay="320"></exp>
<exp type="4" xOff="-103" yOff="161" delay="270"></exp>
<exp type="4" xOff="-165" yOff="84" delay="340"></exp>
<exp type="5" xOff="-189" yOff="-92" delay="300"></exp>
<exp type="4" xOff="217" yOff="-46" delay="325"></exp>
<exp type="5" xOff="72" yOff="193" delay="350"></exp>
</script>
</scripts>
;
super();
dad = _arg1;
buildExplosions();
}
public function addImpact(_arg1:uint, _arg2:uint){
var _local3:Class;
var _local4:Animable;
_local3 = math.randomGetFromArray(impactClasses);
_local4 = new (_local3);
_local4.x = _arg1;
_local4.y = _arg2;
dad.effects.push(_local4);
}
public function addMoneyVanish(_arg1:uint, _arg2:uint){
var _local3:vanish;
_local3 = new vanish();
_local3.x = _arg1;
_local3.y = _arg2;
dad.effects.push(_local3);
}
public function addExplosion(_arg1:int, _arg2:int, _arg3:int, _arg4:uint=0):void{
var _local5:Array;
var _local6:uint;
var _local7:Animable;
_local5 = explosionScripts[_arg3];
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = new (explosionClasses[_local5[_local6][0]]);
_local7.x = (_arg1 + _local5[_local6][1]);
_local7.y = (_arg2 + _local5[_local6][2]);
_local7.effectSpeedX = (_local5[_local6][1] / 400);
_local7.effectSpeedY = (_local5[_local6][2] / 400);
explosionArray.push([_local7, (_local5[_local6][3] + _arg4)]);
_local6++;
};
}
public function addExplosionScript(_arg1:int, _arg2:int, _arg3:Array){
var _local4:uint;
_local4 = 0;
while (_local4 < _arg3.length) {
addExplosion((_arg1 + _arg3[_local4][0]), (_arg2 + _arg3[_local4][1]), _arg3[_local4][2], _arg3[_local4][3]);
_local4++;
};
}
private function buildExplosions(){
var _local1:XML;
var _local2:XML;
var _local3:uint;
var _local4:uint;
explosionScripts = new Array();
_local3 = 0;
while (_local3 < scriptXML.children().length()) {
_local1 = scriptXML.children()[_local3];
explosionScripts.push(new Array());
_local4 = 0;
while (_local4 < _local1.children().length()) {
_local2 = _local1.children()[_local4];
explosionScripts[_local3].push([int(_local2.@type), int(_local2.@xOff), int(_local2.@yOff), int(_local2.@delay)]);
_local4++;
};
_local3++;
};
}
public function tick(_arg1:uint){
var _local2:Array;
var _local3:uint;
_local2 = new Array();
_local3 = 0;
while (_local3 < explosionArray.length) {
explosionArray[_local3][1] = (explosionArray[_local3][1] - _arg1);
if (explosionArray[_local3][1] <= 0){
_local2.push(explosionArray.splice(_local3, 1)[0][0]);
_local3--;
};
_local3++;
};
if (_local2.length){
dad.addEffectsArray(_local2);
dad.sb.playRandom([13, 14, 15, 16, 17]);
};
}
}
}//package dvmClasses.gfx
Section 155
//sheetMaker (dvmClasses.gfx.sheetMaker)
package dvmClasses.gfx {
import flash.geom.*;
public class sheetMaker {
public static var sheetXML:XML = <sheets>
<sheet name="00_bigexplosion_01" page="0" xoffset="0" yoffset="0" width="150" height="150" frames="17" lineBreak="6" mode="block"></sheet>
<sheet name="01_bigexplosion_02" page="0" xoffset="0" yoffset="450" width="125" height="125" frames="16" lineBreak="8" mode="block"></sheet>
<sheet name="02_middle_explosion_01" page="0" xoffset="0" yoffset="700" width="100" height="100" frames="14" lineBreak="10" mode="block"></sheet>
<sheet name="03_middle_explosion_02" page="0" xoffset="400" yoffset="800" width="100" height="100" frames="14" lineBreak="6" mode="wrapToZero"></sheet>
<sheet name="04_impact_01" page="0" xoffset="750" yoffset="300" width="45" height="45" frames="6" lineBreak="6" mode="block"></sheet>
<sheet name="05_impact_02" page="0" xoffset="750" yoffset="345" width="45" height="45" frames="6" lineBreak="6" mode="block"></sheet>
<sheet name="06_impact_03" page="0" xoffset="750" yoffset="390" width="45" height="45" frames="6" lineBreak="6" mode="block"></sheet>
<sheet name="07_medExplosion_03" page="1" xoffset="0" yoffset="0" width="115" height="115" frames="13" lineBreak="8" mode="block"></sheet>
<sheet name="08_green_shot_01" page="1" xoffset="575" yoffset="115" width="25" height="25" frames="35" lineBreak="18" mode="block"></sheet>
<sheet name="09_green_shot_02" page="1" xoffset="575" yoffset="165" width="35" height="35" frames="35" lineBreak="12" mode="block"></sheet>
<sheet name="10_green_shot_03" page="1" xoffset="920" yoffset="0" width="50" height="50" frames="4" lineBreak="2" mode="block"></sheet>
<sheet name="11_green_shot_04" page="1" xoffset="475" yoffset="230" width="25" height="25" frames="4" lineBreak="4" mode="block"></sheet>
<sheet name="12_green_shot_05" page="1" xoffset="475" yoffset="255" width="12" height="12" frames="4" lineBreak="4" mode="block"></sheet>
<sheet name="13_fireBall" page="1" xoffset="0" yoffset="230" width="50" height="50" frames="9" lineBreak="9" mode="block"></sheet>
<sheet name="14_red_shot_05" page="1" xoffset="525" yoffset="255" width="12" height="12" frames="4" lineBreak="4" mode="block"></sheet>
<sheet name="15_red_shot_04" page="1" xoffset="995" yoffset="165" width="15" height="15" frames="4" lineBreak="1" mode="block"></sheet>
<sheet name="16_red_shot_03" page="1" xoffset="0" yoffset="280" width="50" height="50" frames="4" lineBreak="2" mode="block"></sheet>
<sheet name="17_red_shot_02" page="1" xoffset="100" yoffset="280" width="30" height="30" frames="7" lineBreak="7" mode="block"></sheet>
<sheet name="18_monster_donut" page="1" xoffset="310" yoffset="280" width="32" height="32" frames="10" lineBreak="10" mode="block"></sheet>
<sheet name="19_monster_orange" page="1" xoffset="630" yoffset="270" width="60" height="60" frames="11" lineBreak="6" mode="block"></sheet>
<sheet name="20_monster_zigzag" page="1" xoffset="100" yoffset="312" width="40" height="40" frames="13" lineBreak="13" mode="block"></sheet>
<sheet name="21_beamStart01" page="1" xoffset="0" yoffset="380" width="50" height="50" frames="4" lineBreak="2" mode="block"></sheet>
<sheet name="22_cloud01" page="1" xoffset="100" yoffset="352" width="253" height="89" frames="1" lineBreak="1" mode="block"></sheet>
<sheet name="23_cloud02" page="1" xoffset="353" yoffset="352" width="240" height="152" frames="1" lineBreak="1" mode="block"></sheet>
<sheet name="24_cloud03" page="1" xoffset="593" yoffset="390" width="202" height="114" frames="1" lineBreak="1" mode="block"></sheet>
<sheet name="25_beamCharge01" page="1" xoffset="795" yoffset="390" width="75" height="75" frames="4" lineBreak="3" mode="block"></sheet>
<sheet name="26_beamCharge02" page="1" xoffset="870" yoffset="465" width="75" height="75" frames="4" lineBreak="2" mode="block"></sheet>
<sheet name="27_monster_zapper" page="1" xoffset="100" yoffset="441" width="60" height="60" frames="8" lineBreak="4" mode="block"></sheet>
<sheet name="28_monster_hunter" page="1" xoffset="340" yoffset="504" width="55" height="55" frames="8" lineBreak="8" mode="block"></sheet>
<sheet name="29_monster_donutLord" page="1" xoffset="2" yoffset="561" width="124" height="111" frames="7" lineBreak="7" mode="block"></sheet>
<sheet name="30_monster_eyeTower" page="1" xoffset="870" yoffset="615" width="50" height="75" frames="8" lineBreak="3" mode="block"></sheet>
<sheet name="31_monster_bouncer" page="1" xoffset="0" yoffset="672" width="55" height="55" frames="9" lineBreak="9" mode="block"></sheet>
<sheet name="32_monster_bouncerBlob" page="1" xoffset="0" yoffset="480" width="25" height="25" frames="4" lineBreak="4" mode="block"></sheet>
<sheet name="33_money50" page="1" xoffset="930" yoffset="330" width="17" height="17" frames="1" lineBreak="1" mode="block"></sheet>
<sheet name="34_money200" page="1" xoffset="947" yoffset="330" width="23" height="23" frames="1" lineBreak="1" mode="block"></sheet>
<sheet name="35_money500" page="1" xoffset="990" yoffset="296" width="34" height="34" frames="1" lineBreak="1" mode="block"></sheet>
<sheet name="36_money1000" page="1" xoffset="970" yoffset="330" width="45" height="42" frames="1" lineBreak="1" mode="block"></sheet>
<sheet name="37_money2000" page="1" xoffset="49" yoffset="505" width="51" height="50" frames="1" lineBreak="1" mode="block"></sheet>
<sheet name="38_moneyvanish" page="1" xoffset="495" yoffset="672" width="50" height="50" frames="5" lineBreak="5" mode="block"></sheet>
<sheet name="39_monster_bomb" page="1" xoffset="0" yoffset="727" width="45" height="45" frames="7" lineBreak="7" mode="block"></sheet>
<sheet name="40_effect_smoke" page="1" xoffset="315" yoffset="727" width="70" height="70" frames="6" lineBreak="6" mode="block"></sheet>
<sheet name="41_monster_shieldHexa" page="1" xoffset="315" yoffset="797" width="45" height="50" frames="10" lineBreak="10" mode="block"></sheet>
<sheet name="42_beamstart_03" page="1" xoffset="745" yoffset="672" width="50" height="50" frames="4" lineBreak="2" mode="block"></sheet>
<sheet name="43_beamCharge03" page="1" xoffset="870" yoffset="840" width="75" height="75" frames="4" lineBreak="2" mode="block"></sheet>
</sheets>
;
public static function makeSheets():Array{
var _local1:Array;
var _local2:Array;
var _local3:uint;
var _local4:uint;
var _local5:int;
var _local6:uint;
var _local7:XML;
var _local8:Rectangle;
var _local9:uint;
var _local10:uint;
_local1 = new Array();
_local2 = new Array();
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local9 = 0;
while (_local9 < sheetXML.children().length()) {
_local7 = sheetXML.children()[_local9];
_local2 = new Array();
_local10 = 0;
while (_local10 < _local7.@frames) {
_local5 = 0;
_local3 = Math.floor((_local10 / uint(_local7.@lineBreak)));
if ((((_local3 > 0)) && ((_local7.@mode == "wrapToZero")))){
_local3 = 1;
_local5 = (_local5 - uint(_local7.@xoffset));
};
_local4 = (_local10 - (_local3 * uint(_local7.@lineBreak)));
_local5 = (_local5 + (uint(_local7.@xoffset) + (_local4 * uint(_local7.@width))));
_local6 = (uint(_local7.@yoffset) + (_local3 * uint(_local7.@height)));
_local2.push([uint(_local7.@page), new Rectangle(_local5, _local6, uint(_local7.@width), uint(_local7.@height))]);
_local10++;
};
_local1.push(_local2);
_local9++;
};
return (_local1);
}
}
}//package dvmClasses.gfx
Section 156
//gMath (dvmClasses.math.gMath)
package dvmClasses.math {
import flash.geom.*;
public class gMath {
public function pointDistanceSquare(_arg1:int, _arg2:int, _arg3:int, _arg4:int):Number{
return ((Math.pow((_arg3 - _arg1), 2) + Math.pow((_arg4 - _arg2), 2)));
}
public function pointAngle(_arg1:int, _arg2:int, _arg3:int, _arg4:int):Number{
return (Math.atan2((_arg4 - _arg2), (_arg3 - _arg1)));
}
public function percent(_arg1:int, _arg2:uint){
if (_arg1 < 0){
_arg1 = 0;
};
return (((_arg1 / _arg2) * 100));
}
public function speedFromAngle(_arg1:Number, _arg2:Number){
return ([(_arg1 * Math.cos(_arg2)), (_arg1 * Math.sin(_arg2))]);
}
public function boxHitBox(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:uint, _arg6:uint, _arg7:uint, _arg8:uint):Boolean{
var _local9:uint;
var _local10:uint;
var _local11:int;
var _local12:int;
var _local13:uint;
var _local14:uint;
_local9 = ((_arg5 + _arg7) >> 1);
_local10 = ((_arg6 + _arg8) >> 1);
_local11 = (_arg1 - _arg3);
_local12 = (_arg2 - _arg4);
_local13 = ((_local11 < 0)) ? -(_local11) : _local11;
_local14 = ((_local12 < 0)) ? -(_local12) : _local12;
if ((((_local13 < _local9)) && ((_local14 < _local10)))){
return (true);
};
return (false);
}
public function segmentDistanceSquare(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int):uint{
var _local7:Point;
_local7 = projectedPoint(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
if (isAbove(_local7.x, _local7.y, _arg3, _arg4, _arg5, _arg6)){
return (pointDistanceSquare(_arg1, _arg2, _local7.x, _local7.y));
};
return (Math.min(pointDistanceSquare(_arg3, _arg4, _arg1, _arg2), pointDistanceSquare(_arg5, _arg6, _arg1, _arg2)));
}
public function randomNumber(_arg1:uint, _arg2:uint){
return ((_arg1 + Math.floor((Math.random() * _arg2))));
}
public function circleHit(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:uint, _arg6:uint):Boolean{
if (pointDistanceSquare(_arg1, _arg2, _arg3, _arg4) <= Math.pow(((_arg5 + _arg6) >> 1), 2)){
return (true);
};
return (false);
}
public function chance(_arg1:uint):Boolean{
if ((Math.random() * 100) < _arg1){
return (true);
};
return (false);
}
public function radToDeg(_arg1:Number){
return (((_arg1 * 180) / Math.PI));
}
private function projectedPoint(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int){
var _local7:Point;
var _local8:Point;
var _local9:Point;
var _local10:Point;
var _local11:Number;
var _local12:Point;
var _local13:Number;
var _local14:Point;
_local7 = new Point(_arg1, _arg2);
_local8 = new Point(_arg3, _arg4);
_local9 = new Point(_arg5, _arg6);
_local10 = new Point((_local9.x - _local8.x), (_local9.y - _local8.y));
_local11 = Math.sqrt(((_local10.x * _local10.x) + (_local10.y * _local10.y)));
_local10.x = (_local10.x / _local11);
_local10.y = (_local10.y / _local11);
_local12 = new Point((_local7.x - _local8.x), (_local7.y - _local8.y));
_local13 = ((_local12.x * _local10.x) + (_local12.y * _local10.y));
_local14 = new Point(((_local10.x * _local13) + _local8.x), ((_local10.y * _local13) + _local8.y));
return (_local14);
}
private function isAbove(_arg1:Number, _arg2:Number, _arg3:int, _arg4:int, _arg5:int, _arg6:int):Boolean{
return (((pointDistanceSquare(_arg1, _arg2, _arg3, _arg4) + pointDistanceSquare(_arg1, _arg2, _arg5, _arg6)) <= pointDistanceSquare(_arg3, _arg4, _arg5, _arg6)));
}
public function randomGetFromArray(_arg1:Array){
return (_arg1[Math.floor((Math.random() * _arg1.length))]);
}
public function rotateToAngle(_arg1:Number, _arg2:Number, _arg3:Number):Number{
var _local4:Number;
var _local5:Number;
var _local6:Number;
_arg2 = fixAngle(_arg2);
_local5 = (_arg2 - _arg1);
_local6 = Math.abs(_local5);
if (_arg2 < _arg1){
_local4 = -(_arg3);
} else {
_local4 = _arg3;
};
if (_local6 > Math.PI){
_local4 = -(_local4);
};
if ((((_local6 < _arg3)) || ((_local6 > ((2 * Math.PI) - _arg3))))){
_local4 = _local5;
};
return (fixAngle((_arg1 + _local4)));
}
private function fixAngle(_arg1:Number):Number{
while (_arg1 > (2 * Math.PI)) {
_arg1 = (_arg1 - (2 * Math.PI));
};
while (_arg1 < 0) {
_arg1 = (_arg1 + (2 * Math.PI));
};
return (_arg1);
}
}
}//package dvmClasses.math
Section 157
//Vault (dvmClasses.math.Vault)
package dvmClasses.math {
public class Vault {
private var numSymbols:Array;
private var symbols:String;
public function Vault(){
numSymbols = new Array("§", "[", "\"", "+", "!", "%", "/", "=", "(", ")", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
symbols = "§[\"+!%/=()abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
}
public function addTo(_arg1:String, _arg2:uint):String{
_arg2 = (_arg2 + uint(codeToNum(_arg1)));
return (numToCode(_arg2));
}
public function codeToNum(_arg1:String):uint{
var _local2:uint;
var _local3:uint;
_local2 = 0;
_local3 = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + (symbols.indexOf(_arg1.charAt(_local3)) * Math.pow(60, ((_arg1.length - 1) - _local3))));
_local3++;
};
return (_local2);
}
private function numToCode(_arg1:int):String{
var _local2:Boolean;
var _local3:uint;
var _local4:Number;
var _local5:uint;
var _local6:String;
var _local7:int;
_arg1 = Math.abs(_arg1);
if (_arg1 == 0){
return ("0");
};
_local2 = false;
_local6 = "";
_local7 = 5;
while (_local7 >= 0) {
_local3 = Math.pow(60, _local7);
_local4 = (_arg1 / _local3);
_local5 = Math.floor(_local4);
if ((((_local5 > 0)) || (_local2))){
_local2 = true;
_local6 = (_local6 + numSymbols[_local5]);
_arg1 = (_arg1 - (_local5 * _local3));
};
_local7--;
};
return (_local6);
}
}
}//package dvmClasses.math
Section 158
//circleShot (dvmClasses.mechanics.circleShot)
package dvmClasses.mechanics {
import dvmClasses.elements.bullets.*;
public class circleShot {
private var y:int;// = 0
public var targetAngle:Number;// = 0
private var rotaNow:Number;// = 0
public var cycles:uint;// = 0
private var speed:Number;
private var delayNow:int;// = 0
private var numOfShorts:uint;
private var rotate:Number;
public var dead:Boolean;// = false
private var shortDelay:uint;
private var sliceAng:Number;
private var repeat:Boolean;
private var xOffset:int;
private var yOffset:int;
private var longDelay:uint;
private var follow:Boolean;
private var shortStep:uint;// = 0
private var x:int;// = 0
private var divide:uint;
private var type:Class;
public function circleShot(){
delayNow = 0;
x = 0;
y = 0;
rotaNow = 0;
dead = false;
shortStep = 0;
targetAngle = 0;
cycles = 0;
super();
}
public function setup(_arg1:Number, _arg2:Number, _arg3:Class, _arg4:Number, _arg5:Boolean, _arg6:int, _arg7:int, _arg8:uint, _arg9:uint, _arg10:uint, _arg11:uint, _arg12:Boolean){
rotate = _arg2;
type = _arg3;
speed = _arg4;
follow = _arg5;
xOffset = _arg6;
yOffset = _arg7;
divide = _arg8;
sliceAng = ((Math.PI * 2) / _arg8);
numOfShorts = _arg9;
shortDelay = _arg10;
longDelay = _arg11;
repeat = _arg12;
}
public function setPos(_arg1:int, _arg2:int, _arg3:Number=0){
x = (_arg1 + xOffset);
y = (_arg2 + yOffset);
targetAngle = _arg3;
}
public function tick(_arg1:uint){
var _local2:Array;
var _local3:Number;
var _local4:Bullet;
var _local5:Number;
var _local6:uint;
if (this.dead){
return;
};
delayNow = (delayNow - _arg1);
if (delayNow > 0){
return (null);
};
_local2 = new Array();
if (follow){
_local5 = targetAngle;
} else {
_local5 = 0;
};
_local6 = 0;
while (_local6 < divide) {
_local3 = ((_local6 * sliceAng) + rotaNow);
_local4 = new type();
_local4.setSpeeds((_local3 + _local5), speed);
_local4.x = x;
_local4.y = y;
_local2.push(_local4);
_local6++;
};
rotaNow = (rotaNow + rotate);
shortStep++;
if (shortStep >= numOfShorts){
if (repeat){
delayNow = longDelay;
shortStep = 0;
cycles++;
} else {
this.dead = true;
};
} else {
delayNow = shortDelay;
};
return (_local2);
}
}
}//package dvmClasses.mechanics
Section 159
//gameGui (dvmClasses.mechanics.gameGui)
package dvmClasses.mechanics {
import flash.display.*;
import com.greensock.*;
import flash.net.*;
import dvmClasses.math.*;
import com.greensock.easing.*;
import flash.text.*;
public class gameGui extends MovieClip {
public var shieldMask:MovieClip;
public var moneyText:TextField;
public var healthBar:MovieClip;
private var math:gMath;
public var bombPing:MovieClip;
public var shieldLock:MovieClip;
public var beamMask:MovieClip;
public var timeMask:MovieClip;
public var shieldPing:MovieClip;
public var keyText0:TextField;
public var keyText2:TextField;
public var timeLock:MovieClip;
public var keyText1:TextField;
public var beamLock:MovieClip;
public var pointsText:TextField;
public var bombMask:MovieClip;
public var beamPing:MovieClip;
public var timePing:MovieClip;
public var bombLock:MovieClip;
public function gameGui(){
math = new gMath();
super();
addFrameScript(0, frame1);
this.mouseEnabled = false;
this.mouseChildren = false;
bombPing.visible = false;
timePing.visible = false;
shieldPing.visible = false;
beamPing.visible = false;
setPoints(0);
setMoney(0);
}
public function setBomb(_arg1:uint, _arg2:uint){
setIco(_arg1, _arg2, bombMask);
}
public function setBeam(_arg1:uint, _arg2:uint){
setIco(_arg1, _arg2, beamMask);
}
public function setTooltip(_arg1:SharedObject){
var _local2:String;
var _local3:Array;
var _local4:uint;
_local3 = [keyText0, keyText1, keyText2];
_local4 = 0;
while (_local4 < 3) {
_local2 = _arg1.data.keys[_local4][1];
if (_local2.indexOf(" ") != -1){
_local2 = _local2.slice(0, _local2.indexOf(" "));
};
_local3[_local4].text = _local2;
_local4++;
};
}
public function pingBomb(){
doPing(bombPing);
}
public function pingBeam(){
doPing(beamPing);
}
public function pingTime(){
doPing(timePing);
}
public function setLocks(_arg1:Boolean=false, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Boolean=false){
if (!_arg1){
shieldLock.visible = false;
};
if (!_arg2){
timeLock.visible = false;
};
if (!_arg3){
beamLock.visible = false;
};
if (!_arg4){
bombLock.visible = false;
};
}
public function setShield(_arg1:uint, _arg2:uint){
setIco(_arg1, _arg2, shieldMask);
}
public function setHealth(_arg1:uint, _arg2:uint){
healthBar.scaleX = (math.percent(_arg1, _arg2) / 100);
}
public function setTime(_arg1:uint, _arg2:uint){
setIco(_arg1, _arg2, timeMask);
}
public function pingShield(){
doPing(shieldPing);
}
private function doPing(_arg1:MovieClip){
_arg1.visible = true;
_arg1.alpha = 1;
TweenLite.to(_arg1, 1.5, {alpha:0, ease:Linear.easeOut, onComplete:hidePing, onCompleteParams:[_arg1]});
}
public function setMoney(_arg1:uint){
moneyText.text = String(_arg1);
}
private function setIco(_arg1:uint, _arg2:uint, _arg3:MovieClip){
_arg3.myMask.y = -(math.percent(_arg1, _arg2));
}
private function hidePing(_arg1:MovieClip){
_arg1.visible = false;
}
function frame1(){
this.mouseChildren = false;
}
public function setPoints(_arg1:uint){
pointsText.text = String(_arg1);
}
}
}//package dvmClasses.mechanics
Section 160
//hoseShot (dvmClasses.mechanics.hoseShot)
package dvmClasses.mechanics {
import dvmClasses.elements.bullets.*;
public class hoseShot {
public var targetAngle:Number;// = 0
private var type:Class;
private var turnSpeed:Number;
public var cycles:uint;// = 0
private var speed:Number;
private var delayNow:int;// = 0
private var numOfShorts:uint;
private var clockWise:Boolean;// = true
private var repeat:Boolean;
private var rangeMin:Number;
public var dead:Boolean;// = false
private var rangeMax:Number;
private var xOffset:int;
private var yOffset:int;
private var shortDelay:uint;
private var shortStep:uint;// = 0
private var follow:Boolean;
private var longDelay:uint;
private var x:int;// = 0
private var y:int;// = 0
private var range:Number;
public function hoseShot(){
delayNow = 0;
x = 0;
y = 0;
dead = false;
clockWise = true;
shortStep = 0;
targetAngle = 0;
cycles = 0;
super();
}
public function setup(_arg1:Number, _arg2:Class, _arg3:Number, _arg4:Boolean, _arg5:int, _arg6:int, _arg7:Number, _arg8:Number, _arg9:uint, _arg10:uint, _arg11:uint, _arg12:Boolean){
type = _arg2;
speed = _arg3;
follow = _arg4;
xOffset = _arg5;
yOffset = _arg6;
rangeMin = (-(_arg7) / 2);
rangeMax = (_arg7 / 2);
range = rangeMin;
numOfShorts = _arg9;
shortDelay = _arg10;
longDelay = _arg11;
repeat = _arg12;
turnSpeed = _arg8;
}
public function setPos(_arg1:int, _arg2:int, _arg3:Number=0){
x = (_arg1 + xOffset);
y = (_arg2 + yOffset);
targetAngle = _arg3;
}
public function tick(_arg1:uint){
var _local2:Array;
var _local3:Number;
var _local4:Bullet;
var _local5:Number;
if (this.dead){
return;
};
delayNow = (delayNow - _arg1);
if (delayNow > 0){
return (null);
};
_local2 = new Array();
if (follow){
_local5 = targetAngle;
} else {
_local5 = 0;
};
if (clockWise){
range = (range + turnSpeed);
if (range > rangeMax){
clockWise = false;
};
} else {
range = (range - turnSpeed);
if (range < rangeMin){
clockWise = true;
};
};
_local4 = new type();
_local4.setSpeeds((range + _local5), speed);
_local4.x = x;
_local4.y = y;
_local2.push(_local4);
shortStep++;
if (shortStep >= numOfShorts){
if (repeat){
delayNow = longDelay;
shortStep = 0;
range = rangeMin;
cycles++;
} else {
this.dead = true;
};
} else {
delayNow = shortDelay;
};
return (_local2);
}
}
}//package dvmClasses.mechanics
Section 161
//Spawner (dvmClasses.mechanics.Spawner)
package dvmClasses.mechanics {
import flash.display.*;
import dvmClasses.elements.enemies.*;
import dvmClasses.math.*;
import dvmClasses.data.*;
import flash.geom.*;
public class Spawner {
private var currentHard:int;// = 0
private var math:gMath;
private var penalty:uint;// = 0
private var spawnSpeed:uint;// = 10
public var dad:MovieClip;
private var spawnSpeedupTicker:Ticker;
private var radius:uint;// = 10
private var wavesCount:int;// = 0
public var bossLevel:Boolean;// = false
private var spawnPaused:Boolean;// = false
private var placeChance:uint;// = 5
private var heroX:uint;// = 0
private var heroY:uint;// = 0
private var waveTimeout:Ticker;
private var bossIDs:Array;
private var spawnCenter:Point;
private var currentWave:int;// = -1
private var enemyIDs:Array;
private var gameHeight:uint;// = 550
private var repeatCount:uint;// = 0
private var cEnemyType:uint;// = 9999
private var startDelay:int;// = 1000
private var typeChance:uint;// = 30
private var timeoutTime:uint;// = 4000
private var enemyTypes:Array;
private var SAFE_ZONE_RADIUS:uint;// = 180
private var spawnPoint:Point;
private var setCurrentWave:Function;
private var lastWave:Boolean;// = false
private var minHard:uint;// = 0
private var spawnTicker:Ticker;
private var maxHard:uint;// = 300
private var timeDiff:uint;// = 10
private var levelXML:XML;
private var gameWidth:uint;// = 800
private var timeoutDivider:uint;// = 4
private var maxWave:uint;// = 1
public function Spawner(_arg1:MovieClip, _arg2:uint=0){
var _local3:levelsXML;
SAFE_ZONE_RADIUS = 180;
gameWidth = 800;
gameHeight = 550;
math = new gMath();
timeDiff = 10;
spawnTicker = new Ticker(100);
spawnSpeedupTicker = new Ticker(6000);
heroX = 0;
heroY = 0;
bossLevel = false;
spawnCenter = new Point(0, 0);
spawnPoint = new Point(0, 0);
radius = 10;
minHard = 0;
maxHard = 300;
currentHard = 0;
penalty = 0;
spawnPaused = false;
wavesCount = 0;
enemyTypes = new Array();
bossIDs = [];
cEnemyType = 9999;
currentWave = -1;
maxWave = 1;
repeatCount = 0;
spawnSpeed = 10;
timeoutDivider = 4;
timeoutTime = 4000;
typeChance = 30;
placeChance = 5;
startDelay = 1000;
setCurrentWave = setCurrentWaveNormal;
lastWave = false;
super();
dad = _arg1;
_local3 = new levelsXML();
levelXML = _local3.getLevelXML(_arg2);
if (levelXML.@bossLevel == 1){
bossLevel = true;
};
if (_arg2 == 15){
setCurrentWave = setCurrentWaveScore;
};
maxWave = (levelXML.children().length() - 1);
sendTotalWaves();
_local3 = null;
setCurrentWave();
getSpawnCenter(radius);
enemyTypes.push(donut);
enemyTypes.push(zigzag);
enemyTypes.push(orange);
enemyTypes.push(zapper);
enemyTypes.push(hunter);
enemyTypes.push(donutLord);
enemyTypes.push(eyeTower);
enemyTypes.push(bouncer);
enemyTypes.push(bomb);
enemyTypes.push(bossBigMask);
enemyTypes.push(bossBlob);
enemyTypes.push(bossRope);
enemyTypes.push(bossCrystal);
enemyTypes.push(shieldEye);
}
private function sendTotalWaves(){
var _local1:uint;
var _local2:uint;
var _local3:uint;
_local1 = 0;
_local2 = levelXML.children().length();
_local3 = 0;
while (_local3 < _local2) {
_local1 = (_local1 + uint(levelXML.child(_local3).@repeat));
_local3++;
};
wavesCount = _local1;
dad.updateCounter(wavesCount);
}
public function lowerHard(_arg1:uint){
currentHard = (currentHard - _arg1);
}
public function getBgID(){
var _local1:uint;
_local1 = uint(levelXML.@backGround);
if (_local1){
return (_local1);
};
return (0);
}
public function tick(_arg1:uint, _arg2:uint, _arg3:uint){
var _local4:enemy;
var _local5:uint;
var _local6:uint;
if (((lastWave) || ((startDelay > 0)))){
startDelay = (startDelay - _arg1);
return;
};
timeDiff = _arg1;
heroX = _arg2;
heroY = _arg3;
_local5 = 0;
_local6 = 0;
if (!spawnPaused){
spawnBosses();
if (((spawnTicker.tick(_arg1)) && ((cEnemyType < enemyTypes.length)))){
if (math.chance(typeChance)){
cEnemyType = math.randomGetFromArray(enemyIDs);
};
if (math.chance(placeChance)){
getSpawnCenter(radius);
};
getSpawnPoint();
_local4 = new (enemyTypes[cEnemyType]);
_local4.x = spawnPoint.x;
_local4.y = spawnPoint.y;
_local5 = (_local4.hitWidth >> 1);
_local6 = (_local4.hitHeight >> 1);
if (_local4.x < _local5){
_local4.x = _local5;
} else {
if (_local4.x > (gameWidth - _local5)){
_local4.x = (gameWidth - _local5);
};
};
if (_local4.y < _local6){
_local4.y = _local6;
} else {
if (_local4.y > (gameHeight - _local6)){
_local4.y = (gameHeight - _local6);
};
};
_local4.dad = dad;
currentHard = (currentHard + _local4.hardness);
dad.enemies.push(_local4);
if (currentHard >= (maxHard + penalty)){
currentHard = (currentHard + penalty);
penalty = 0;
spawnPaused = true;
waveTimeout = new Ticker(timeoutTime);
};
};
if (spawnSpeedupTicker.tick(_arg1)){
spawnTicker.setDelay(10);
};
} else {
if (currentHard <= minHard){
spawnPaused = false;
setCurrentWave();
} else {
if (currentHard < (minHard + ((maxHard - minHard) / timeoutDivider))){
if (waveTimeout.tick(_arg1)){
spawnPaused = false;
setCurrentWave();
penalty = currentHard;
currentHard = minHard;
};
};
};
};
}
public function spawnBosses(){
var _local1:boss;
var _local2:uint;
if (currentHard > maxHard){
spawnPaused = true;
return;
};
_local2 = 0;
while (_local2 < bossIDs.length) {
trace("adding Boss", bossIDs.length);
_local1 = new (enemyTypes[bossIDs[_local2]]);
getSpawnPoint();
_local1.x = spawnPoint.x;
_local1.y = spawnPoint.y;
_local1.dad = dad;
dad.initBossHp();
_local1.stayBounds();
dad.bosses.push(_local1);
this.currentHard = (this.currentHard + _local1.hardness);
_local2++;
};
}
private function getSpawnCenter(_arg1:uint){
var _local2:int;
var _local3:int;
radius = _arg1;
_local2 = (Math.random() * gameWidth);
_local3 = (Math.random() * gameHeight);
spawnCenter.x = _local2;
spawnCenter.y = _local3;
}
private function setCurrentWaveScore(){
var _local1:uint;
var _local2:uint;
var _local3:Array;
var _local4:uint;
var _local5:uint;
trace(("setting up wave no. " + String((currentWave + 1))));
_local1 = 200;
_local2 = 700;
_local3 = [0, 0, 0, 1, 1, 1, 2, 2, 3, 4, 4, 5, 6, 7, 7, 8, 13];
_local4 = 1;
if (repeatCount <= 0){
currentWave++;
_local1 = (_local1 + (25 * currentWave));
_local2 = (_local2 + (35 * currentWave));
trace("hard", _local1, _local2);
spawnTicker.reset();
timeoutDivider = 5;
timeoutTime = 5000;
repeatCount = 1;
radius = (50 + (Math.random() * 150));
getSpawnCenter(radius);
typeChance = (Math.random() * 40);
placeChance = (Math.random() * 30);
minHard = _local1;
maxHard = _local2;
enemyIDs = [];
_local4 = (1 + uint((Math.random() * (_local3.length - 1))));
_local5 = 0;
while (_local5 < _local4) {
enemyIDs.push(_local3.splice(uint((Math.random() * _local3.length)), 1));
_local5++;
};
cEnemyType = enemyIDs[0];
};
spawnTicker.setDelay((20 + (Math.random() * 200)));
repeatCount--;
wavesCount--;
dad.updateCounter(wavesCount);
}
private function getSpawnPoint(_arg1:uint=0){
var _local2:Number;
var _local3:int;
var _local4:int;
var _local5:Array;
_local2 = ((Math.random() * Math.PI) * 2);
_local5 = math.speedFromAngle((Math.random() * radius), _local2);
_local3 = (_local5[0] + spawnCenter.x);
_local4 = (_local5[1] + spawnCenter.y);
if (math.pointDistanceSquare(_local3, _local4, heroX, heroY) < Math.pow(SAFE_ZONE_RADIUS, 2)){
_local2 = math.pointAngle(heroX, heroY, _local3, _local4);
_local5 = math.speedFromAngle(SAFE_ZONE_RADIUS, _local2);
_local3 = _local5[0];
_local4 = _local5[1];
};
if (_local3 < 0){
_local3 = 0;
} else {
if (_local3 > gameWidth){
_local3 = gameWidth;
};
};
if (_local4 < 0){
_local4 = 0;
} else {
if (_local4 > gameHeight){
_local4 = gameHeight;
};
};
spawnPoint.x = _local3;
spawnPoint.y = _local4;
}
private function setCurrentWaveNormal(){
var _local1:XML;
var _local2:uint;
trace(("setting up wave no. " + String((currentWave + 1))));
if (repeatCount <= 0){
currentWave++;
if (currentWave > maxWave){
dad.lockLastWave();
this.lastWave = true;
return;
};
spawnTicker.reset();
timeoutDivider = uint(levelXML.children()[currentWave].@timeoutDivider);
timeoutTime = uint(levelXML.children()[currentWave].@timeoutTime);
repeatCount = uint(levelXML.children()[currentWave].@repeat);
radius = uint(levelXML.children()[currentWave].@radius);
getSpawnCenter(radius);
typeChance = uint(levelXML.children()[currentWave].@typeChance);
placeChance = uint(levelXML.children()[currentWave].@placeChance);
minHard = uint(levelXML.children()[currentWave].@minHard);
maxHard = uint(levelXML.children()[currentWave].@maxHard);
_local1 = levelXML.children()[currentWave];
enemyIDs = new Array();
bossIDs = new Array();
_local2 = 0;
while (_local2 < _local1.children().length()) {
if (uint(_local1.children()[_local2].@isBoss) != 1){
enemyIDs.push(uint(_local1.children()[_local2].@type));
} else {
bossIDs.push(uint(_local1.children()[_local2].@type));
};
_local2++;
};
if (enemyIDs.length){
cEnemyType = enemyIDs[0];
} else {
cEnemyType = 9999;
};
};
spawnTicker.setDelay(uint(levelXML.children()[currentWave].@spawnSpeed));
repeatCount--;
wavesCount--;
dad.updateCounter(wavesCount);
}
public function getMusic(){
var _local1:uint;
_local1 = uint(levelXML.@music);
if (_local1){
return (_local1);
};
return (0);
}
}
}//package dvmClasses.mechanics
Section 162
//Ticker (dvmClasses.mechanics.Ticker)
package dvmClasses.mechanics {
public class Ticker {
public var delay:uint;// = 100
public var delayNow:int;
public function Ticker(_arg1:uint){
delay = 100;
delayNow = delay;
super();
delay = _arg1;
delayNow = _arg1;
}
public function setDelay(_arg1:uint){
delay = _arg1;
reset();
}
public function setCurrentDelay(_arg1:uint){
delayNow = _arg1;
if (delayNow > delay){
delayNow = delay;
};
}
public function reset(){
delayNow = delay;
}
public function getCompletion():Number{
return ((delayNow / delay));
}
public function tick(_arg1:uint):Boolean{
delayNow = (delayNow - _arg1);
if (delayNow <= 0){
delayNow = delay;
return (true);
};
return (false);
}
}
}//package dvmClasses.mechanics
Section 163
//BossGlow (dvmClasses.sheetBitmaps.BossGlow)
package dvmClasses.sheetBitmaps {
import flash.display.*;
public class BossGlow extends Sprite {
}
}//package dvmClasses.sheetBitmaps
Section 164
//sheet01 (dvmClasses.sheetBitmaps.sheet01)
package dvmClasses.sheetBitmaps {
import flash.display.*;
public class sheet01 extends BitmapData {
public function sheet01(){
super(0x0400, 0x0400);
}
}
}//package dvmClasses.sheetBitmaps
Section 165
//sheet02 (dvmClasses.sheetBitmaps.sheet02)
package dvmClasses.sheetBitmaps {
import flash.display.*;
public class sheet02 extends BitmapData {
public function sheet02(){
super(0x0400, 0x0400);
}
}
}//package dvmClasses.sheetBitmaps
Section 166
//skyGradient01 (dvmClasses.sheetBitmaps.skyGradient01)
package dvmClasses.sheetBitmaps {
import flash.display.*;
public class skyGradient01 extends MovieClip {
public function skyGradient01(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package dvmClasses.sheetBitmaps
Section 167
//beamSound01 (beamSound01)
package {
import flash.media.*;
public dynamic class beamSound01 extends Sound {
}
}//package
Section 168
//beamSound02 (beamSound02)
package {
import flash.media.*;
public dynamic class beamSound02 extends Sound {
}
}//package
Section 169
//beamSound03 (beamSound03)
package {
import flash.media.*;
public dynamic class beamSound03 extends Sound {
}
}//package
Section 170
//beamSoundEnd (beamSoundEnd)
package {
import flash.media.*;
public dynamic class beamSoundEnd extends Sound {
}
}//package
Section 171
//BossHp (BossHp)
package {
import flash.display.*;
public dynamic class BossHp extends MovieClip {
public var line:MovieClip;
}
}//package
Section 172
//bossMusic01 (bossMusic01)
package {
import flash.media.*;
public dynamic class bossMusic01 extends Sound {
}
}//package
Section 173
//buySound (buySound)
package {
import flash.media.*;
public dynamic class buySound extends Sound {
}
}//package
Section 174
//cakeMusic01 (cakeMusic01)
package {
import flash.media.*;
public dynamic class cakeMusic01 extends Sound {
}
}//package
Section 175
//campaignHelpBubble (campaignHelpBubble)
package {
import flash.display.*;
public dynamic class campaignHelpBubble extends MovieClip {
}
}//package
Section 176
//chocoMusic01 (chocoMusic01)
package {
import flash.media.*;
public dynamic class chocoMusic01 extends Sound {
}
}//package
Section 177
//coin1 (coin1)
package {
import flash.media.*;
public dynamic class coin1 extends Sound {
}
}//package
Section 178
//coin2 (coin2)
package {
import flash.media.*;
public dynamic class coin2 extends Sound {
}
}//package
Section 179
//costumeSound (costumeSound)
package {
import flash.media.*;
public dynamic class costumeSound extends Sound {
}
}//package
Section 180
//Counter (Counter)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Counter extends MovieClip {
public var nam:TextField;
public var num:TextField;
public function Counter(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 181
//green01 (green01)
package {
import flash.media.*;
public dynamic class green01 extends Sound {
}
}//package
Section 182
//lockSound (lockSound)
package {
import flash.media.*;
public dynamic class lockSound extends Sound {
}
}//package
Section 183
//menuM (menuM)
package {
import flash.media.*;
public dynamic class menuM extends Sound {
}
}//package
Section 184
//music02 (music02)
package {
import flash.media.*;
public dynamic class music02 extends Sound {
}
}//package
Section 185
//PauseScreen (PauseScreen)
package {
import flash.display.*;
public dynamic class PauseScreen extends MovieClip {
public var mapButton:MovieClip;
public var resumeButton:MovieClip;
}
}//package
Section 186
//snBulletHero (snBulletHero)
package {
import flash.media.*;
public dynamic class snBulletHero extends Sound {
}
}//package
Section 187
//sndHero (sndHero)
package {
import flash.media.*;
public dynamic class sndHero extends Sound {
}
}//package
Section 188
//sndLaser1 (sndLaser1)
package {
import flash.media.*;
public dynamic class sndLaser1 extends Sound {
}
}//package
Section 189
//sndLaser2 (sndLaser2)
package {
import flash.media.*;
public dynamic class sndLaser2 extends Sound {
}
}//package
Section 190
//snExp1 (snExp1)
package {
import flash.media.*;
public dynamic class snExp1 extends Sound {
}
}//package
Section 191
//snExp2 (snExp2)
package {
import flash.media.*;
public dynamic class snExp2 extends Sound {
}
}//package
Section 192
//snExp3 (snExp3)
package {
import flash.media.*;
public dynamic class snExp3 extends Sound {
}
}//package
Section 193
//snExp4 (snExp4)
package {
import flash.media.*;
public dynamic class snExp4 extends Sound {
}
}//package
Section 194
//snExp5 (snExp5)
package {
import flash.media.*;
public dynamic class snExp5 extends Sound {
}
}//package
Section 195
//snHit (snHit)
package {
import flash.media.*;
public dynamic class snHit extends Sound {
}
}//package
Section 196
//snLongExp (snLongExp)
package {
import flash.media.*;
public dynamic class snLongExp extends Sound {
}
}//package
Section 197
//snShieldup (snShieldup)
package {
import flash.media.*;
public dynamic class snShieldup extends Sound {
}
}//package
Section 198
//snSwave (snSwave)
package {
import flash.media.*;
public dynamic class snSwave extends Sound {
}
}//package
Section 199
//soundWeapon (soundWeapon)
package {
import flash.media.*;
public dynamic class soundWeapon extends Sound {
}
}//package
Section 200
//startGameBubble (startGameBubble)
package {
import flash.display.*;
import flash.text.*;
public dynamic class startGameBubble extends MovieClip {
public var okButton:MovieClip;
public var tf:TextField;
}
}//package
Section 201
//white (white)
package {
import flash.display.*;
public dynamic class white extends MovieClip {
public function white(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package