Section 1
//assets_3 (HeavyWeapons_fla.assets_3)
package HeavyWeapons_fla {
import flash.display.*;
public dynamic class assets_3 extends MovieClip {
public function assets_3(){
addFrameScript(0, frame1);
}
function frame1(){
this.visible = false;
}
}
}//package HeavyWeapons_fla
Section 2
//blockerSemi_116 (HeavyWeapons_fla.blockerSemi_116)
package HeavyWeapons_fla {
import flash.display.*;
public dynamic class blockerSemi_116 extends MovieClip {
public function blockerSemi_116(){
addFrameScript(7, frame8);
}
function frame8(){
stop();
}
}
}//package HeavyWeapons_fla
Section 3
//btnRollOff_110 (HeavyWeapons_fla.btnRollOff_110)
package HeavyWeapons_fla {
import flash.display.*;
public dynamic class btnRollOff_110 extends MovieClip {
public function btnRollOff_110(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package HeavyWeapons_fla
Section 4
//btnRollOff_131 (HeavyWeapons_fla.btnRollOff_131)
package HeavyWeapons_fla {
import flash.display.*;
public dynamic class btnRollOff_131 extends MovieClip {
public function btnRollOff_131(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package HeavyWeapons_fla
Section 5
//btnRollOff_135 (HeavyWeapons_fla.btnRollOff_135)
package HeavyWeapons_fla {
import flash.display.*;
public dynamic class btnRollOff_135 extends MovieClip {
public function btnRollOff_135(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package HeavyWeapons_fla
Section 6
//btnRollOn_112 (HeavyWeapons_fla.btnRollOn_112)
package HeavyWeapons_fla {
import flash.display.*;
public dynamic class btnRollOn_112 extends MovieClip {
public function btnRollOn_112(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package HeavyWeapons_fla
Section 7
//btnRollOn_133 (HeavyWeapons_fla.btnRollOn_133)
package HeavyWeapons_fla {
import flash.display.*;
public dynamic class btnRollOn_133 extends MovieClip {
public function btnRollOn_133(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package HeavyWeapons_fla
Section 8
//btnRollOn_138 (HeavyWeapons_fla.btnRollOn_138)
package HeavyWeapons_fla {
import flash.display.*;
public dynamic class btnRollOn_138 extends MovieClip {
public function btnRollOn_138(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package HeavyWeapons_fla
Section 9
//closeGlowIn_119 (HeavyWeapons_fla.closeGlowIn_119)
package HeavyWeapons_fla {
import flash.display.*;
public dynamic class closeGlowIn_119 extends MovieClip {
public function closeGlowIn_119(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package HeavyWeapons_fla
Section 10
//closeGlowOut_121 (HeavyWeapons_fla.closeGlowOut_121)
package HeavyWeapons_fla {
import flash.display.*;
public dynamic class closeGlowOut_121 extends MovieClip {
public function closeGlowOut_121(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package HeavyWeapons_fla
Section 11
//flash_283 (HeavyWeapons_fla.flash_283)
package HeavyWeapons_fla {
import flash.display.*;
public dynamic class flash_283 extends MovieClip {
public function flash_283(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package HeavyWeapons_fla
Section 12
//Kongintro30fps_224 (HeavyWeapons_fla.Kongintro30fps_224)
package HeavyWeapons_fla {
import flash.events.*;
import flash.display.*;
public dynamic class Kongintro30fps_224 extends MovieClip {
public function Kongintro30fps_224(){
addFrameScript(0, frame1, 198, frame199);
}
function frame1(){
MovieClip(parent).stop();
addEventListener(MouseEvent.CLICK, TitleScreenState.buttonKongregatePressed);
}
function frame199(){
stop();
MovieClip(parent).play();
}
}
}//package HeavyWeapons_fla
Section 13
//largeSlot_107 (HeavyWeapons_fla.largeSlot_107)
package HeavyWeapons_fla {
import flash.display.*;
import flash.text.*;
public dynamic class largeSlot_107 extends MovieClip {
public var weapon:weaponAnims;
public var textName:TextField;
}
}//package HeavyWeapons_fla
Section 14
//MainTimeline (HeavyWeapons_fla.MainTimeline)
package HeavyWeapons_fla {
import flash.events.*;
import flash.display.*;
public dynamic class MainTimeline extends MovieClip {
public var urlEnd:Number;
public var kongaiAd:MovieClip;
public var urlStart:Number;
public var domEnd:Number;
public var url:String;
public var r:Number;
public var LastDot:Number;
public var domain:String;
public function MainTimeline(){
addFrameScript(0, frame1, 21, frame22);
}
function frame1(){
url = loaderInfo.url;
urlStart = (url.indexOf("://") + 3);
urlEnd = url.indexOf("/", urlStart);
domain = url.substring(urlStart, urlEnd);
LastDot = (domain.lastIndexOf(".") - 1);
domEnd = (domain.lastIndexOf(".", LastDot) + 1);
domain = domain.substring(domEnd, domain.length);
if (domain == "addictinggames.com"){
stop();
gotoAndPlay(10);
};
r = Math.random();
if (r < 0.333){
MochiAd.showPreGameAd({clip:root, id:"8abd8d549d02ba63", res:"640x520"});
} else {
if (r < 0.666){
MochiAd.showPreGameAd({clip:root, id:"a682695d6581288d", res:"640x520"});
} else {
stop();
kongaiAd = new KongregateKongAIAd();
addChild(kongaiAd);
kongaiAd.x = 174;
kongaiAd.y = 138;
kongaiAd.addEventListener("finished", KongAIAdFinished);
kongaiAd.addEventListener(MouseEvent.CLICK, TitleScreenState.KongAIAdClicked);
};
};
}
function frame22(){
stop();
}
public function KongAIAdFinished(_arg1:Event){
removeChild(kongaiAd);
kongaiAd = null;
trace("finished");
play();
}
}
}//package HeavyWeapons_fla
Section 15
//text1_277 (HeavyWeapons_fla.text1_277)
package HeavyWeapons_fla {
import flash.display.*;
public dynamic class text1_277 extends MovieClip {
public function text1_277(){
addFrameScript(74, frame75);
}
function frame75(){
stop();
}
}
}//package HeavyWeapons_fla
Section 16
//Text2_279 (HeavyWeapons_fla.Text2_279)
package HeavyWeapons_fla {
import flash.display.*;
public dynamic class Text2_279 extends MovieClip {
public function Text2_279(){
addFrameScript(99, frame100);
}
function frame100(){
stop();
}
}
}//package HeavyWeapons_fla
Section 17
//Text3_281 (HeavyWeapons_fla.Text3_281)
package HeavyWeapons_fla {
import flash.display.*;
public dynamic class Text3_281 extends MovieClip {
public function Text3_281(){
addFrameScript(129, frame130);
}
function frame130(){
stop();
}
}
}//package HeavyWeapons_fla
Section 18
//weaponButton_78 (HeavyWeapons_fla.weaponButton_78)
package HeavyWeapons_fla {
import flash.display.*;
import flash.text.*;
public dynamic class weaponButton_78 extends MovieClip {
public var weapon:weaponAnims;
public var buttonBack:MovieClip;
public var textName:TextField;
public var textCost:TextField;
}
}//package HeavyWeapons_fla
Section 19
//Achievements (Achievements)
package {
public class Achievements {
static var list:Array;
public static function TestAtLevelComplete(){
var _local1:Achievement;
var _local2:Boolean;
var _local3:AchievementItem;
var _local4:Boolean;
for each (_local1 in list) {
if (_local1.complete == false){
_local2 = true;
for each (_local3 in _local1.items) {
_local4 = _local3.Test();
if (_local4 == false){
_local2 = false;
};
};
if (_local2){
_local1.complete = true;
trace((("ACHIEVEMENT: " + _local1.name) + " COMPLETED"));
} else {
trace((("ACHIEVEMENT: " + _local1.name) + " FAILED"));
};
};
};
}
public static function InitOnce(){
var _local1:XML;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:XML;
var _local6:Achievement;
var _local7:int;
var _local8:XML;
var _local9:AchievementItem;
list = new Array();
_local1 = ExternalData.xml;
_local2 = _local1.achievement.length();
_local3 = 0;
_local4 = 0;
_local3 = 0;
while (_local3 < _local2) {
_local5 = _local1.achievement[_local3];
_local6 = new Achievement();
_local6.name = _local5.@name;
list.push(_local6);
_local7 = _local5.item.length();
_local4 = 0;
while (_local4 < _local7) {
_local8 = _local5.item[_local4];
_local9 = new AchievementItem();
_local9.id = int(_local8.@id);
_local9.levelName = _local8.@level;
_local9.variableName = _local8.@variable;
_local9.condition = _local8.@condition;
_local9.value = _local8.@value;
_local6.items.push(_local9);
_local4++;
};
_local3++;
};
}
}
}//package
class AchievementItem {
private var variableName:String;
private var id:int;
private var levelName:String;
private var value:String;
private var condition:String;
public static const CONDITION_EQUALS:String = "equals";
public static const CONDITION_GREATERTHANEQUAL:String = "greaterthanequal";
public static const CONDITION_LESSTHANEQUAL:String = "lessthanequal";
public static const CONDITION_GREATERTHAN:String = "greaterthan";
public static const CONDITION_LESSTHAN:String = "lessthan";
private function AchievementItem(){
}
public function Test():Boolean{
var _local1:int;
var _local2:int;
if (levelName != Game.level.name){
return (false);
};
_local1 = 0;
if (variableName == "kills"){
_local1 = Stats.levelNumKills;
};
if (variableName == "time"){
_local1 = Stats.levelTime;
};
if (variableName == "cash"){
_local1 = Stats.levelCash;
};
if (variableName == "damage"){
_local1 = Stats.levelDamage;
};
_local2 = int(value);
if (condition == CONDITION_EQUALS){
if (_local1 == _local2){
return (true);
};
} else {
if (condition == CONDITION_LESSTHAN){
if (_local1 < _local2){
return (true);
};
} else {
if (condition == CONDITION_LESSTHANEQUAL){
if (_local1 <= _local2){
return (true);
};
} else {
if (condition == CONDITION_GREATERTHAN){
if (_local1 > _local2){
return (true);
};
} else {
if (condition == CONDITION_GREATERTHANEQUAL){
if (_local1 >= _local2){
return (true);
};
};
};
};
};
};
return (false);
}
}
class Achievement {
private var items:Array;
private var complete:Boolean;
private var name:String;
private function Achievement(){
items = new Array();
name = "";
complete = false;
}
}
Section 20
//AllLevelsCompleteScreen (AllLevelsCompleteScreen)
package {
import flash.display.*;
public dynamic class AllLevelsCompleteScreen extends MovieClip {
public var buttonContinue:SimpleButton;
}
}//package
Section 21
//allocateWeapon (allocateWeapon)
package {
import flash.display.*;
public dynamic class allocateWeapon extends MovieClip {
public var buttonSlot3:SimpleButton;
public var buttonSlot1:SimpleButton;
public var buttonClose:SimpleButton;
public var buttonSlot2:SimpleButton;
}
}//package
Section 22
//ambient1 (ambient1)
package {
import flash.media.*;
public dynamic class ambient1 extends Sound {
}
}//package
Section 23
//ambient2 (ambient2)
package {
import flash.media.*;
public dynamic class ambient2 extends Sound {
}
}//package
Section 24
//ambient3 (ambient3)
package {
import flash.media.*;
public dynamic class ambient3 extends Sound {
}
}//package
Section 25
//BackgroundEater (BackgroundEater)
package {
import flash.display.*;
public dynamic class BackgroundEater extends MovieClip {
}
}//package
Section 26
//BackgroundScroll1 (BackgroundScroll1)
package {
import flash.display.*;
public dynamic class BackgroundScroll1 extends MovieClip {
}
}//package
Section 27
//BackgroundScroll10 (BackgroundScroll10)
package {
import flash.display.*;
public dynamic class BackgroundScroll10 extends MovieClip {
}
}//package
Section 28
//BackgroundScroll11 (BackgroundScroll11)
package {
import flash.display.*;
public dynamic class BackgroundScroll11 extends MovieClip {
}
}//package
Section 29
//BackgroundScroll12 (BackgroundScroll12)
package {
import flash.display.*;
public dynamic class BackgroundScroll12 extends MovieClip {
}
}//package
Section 30
//BackgroundScroll13 (BackgroundScroll13)
package {
import flash.display.*;
public dynamic class BackgroundScroll13 extends MovieClip {
}
}//package
Section 31
//BackgroundScroll14 (BackgroundScroll14)
package {
import flash.display.*;
public dynamic class BackgroundScroll14 extends MovieClip {
}
}//package
Section 32
//BackgroundScroll15 (BackgroundScroll15)
package {
import flash.display.*;
public dynamic class BackgroundScroll15 extends MovieClip {
}
}//package
Section 33
//BackgroundScroll16 (BackgroundScroll16)
package {
import flash.display.*;
public dynamic class BackgroundScroll16 extends MovieClip {
}
}//package
Section 34
//BackgroundScroll17 (BackgroundScroll17)
package {
import flash.display.*;
public dynamic class BackgroundScroll17 extends MovieClip {
}
}//package
Section 35
//BackgroundScroll2 (BackgroundScroll2)
package {
import flash.display.*;
public dynamic class BackgroundScroll2 extends MovieClip {
}
}//package
Section 36
//BackgroundScroll3 (BackgroundScroll3)
package {
import flash.display.*;
public dynamic class BackgroundScroll3 extends MovieClip {
}
}//package
Section 37
//BackgroundScroll4 (BackgroundScroll4)
package {
import flash.display.*;
public dynamic class BackgroundScroll4 extends MovieClip {
}
}//package
Section 38
//BackgroundScroll5 (BackgroundScroll5)
package {
import flash.display.*;
public dynamic class BackgroundScroll5 extends MovieClip {
}
}//package
Section 39
//BackgroundScroll6 (BackgroundScroll6)
package {
import flash.display.*;
public dynamic class BackgroundScroll6 extends MovieClip {
}
}//package
Section 40
//BackgroundScroll7 (BackgroundScroll7)
package {
import flash.display.*;
public dynamic class BackgroundScroll7 extends MovieClip {
}
}//package
Section 41
//BackgroundScroll8 (BackgroundScroll8)
package {
import flash.display.*;
public dynamic class BackgroundScroll8 extends MovieClip {
}
}//package
Section 42
//BackgroundScroll9 (BackgroundScroll9)
package {
import flash.display.*;
public dynamic class BackgroundScroll9 extends MovieClip {
}
}//package
Section 43
//BigChargeExplosion (BigChargeExplosion)
package {
import flash.media.*;
public dynamic class BigChargeExplosion extends Sound {
}
}//package
Section 44
//bigExplosion (bigExplosion)
package {
import flash.display.*;
public dynamic class bigExplosion extends MovieClip {
}
}//package
Section 45
//blockerIn (blockerIn)
package {
import flash.display.*;
public dynamic class blockerIn extends MovieClip {
public function blockerIn(){
addFrameScript(165, frame166);
}
function frame166(){
stop();
}
}
}//package
Section 46
//blockerIrisIn (blockerIrisIn)
package {
import flash.display.*;
public dynamic class blockerIrisIn extends MovieClip {
public function blockerIrisIn(){
addFrameScript(115, frame116);
}
function frame116(){
stop();
}
}
}//package
Section 47
//blockerIrisOut (blockerIrisOut)
package {
import flash.display.*;
public dynamic class blockerIrisOut extends MovieClip {
public function blockerIrisOut(){
addFrameScript(115, frame116);
}
function frame116(){
stop();
}
}
}//package
Section 48
//blockerOut (blockerOut)
package {
import flash.display.*;
public dynamic class blockerOut extends MovieClip {
public function blockerOut(){
addFrameScript(165, frame166);
}
function frame166(){
stop();
}
}
}//package
Section 49
//c1 (c1)
package {
public dynamic class c1 extends Card {
}
}//package
Section 50
//c2 (c2)
package {
public dynamic class c2 extends Card {
}
}//package
Section 51
//c3 (c3)
package {
public dynamic class c3 extends Card {
}
}//package
Section 52
//c4 (c4)
package {
public dynamic class c4 extends Card {
}
}//package
Section 53
//Card (Card)
package {
import flash.events.*;
import flash.display.*;
dynamic class Card extends MovieClip {
public var orot:Number;
public var oSpeed:Number;
public var yDir:String;
public var speed:Number;
public var r:Number;
public var firstTime:Boolean;// = true
public var dir:String;
public var time:Number;
public var ox:Number;
public var oy:Number;
public static var WIDTH = 300;
public static var ranNum:Array = [9, 7, 3, 1, 2, 4, 5, 8, 6, 10];
public static var ranNumIndex:Number = 0;
public static var HEIGHT = 250;
function Card(){
firstTime = true;
super();
addEventListener("enterFrame", onEnterFrame);
}
public function randomNumber(){
ranNumIndex++;
if (ranNumIndex == ranNum.length){
ranNumIndex = 0;
};
return (ranNum[ranNumIndex]);
}
public function Init(){
cacheAsBitmap = true;
this.forceSmoothing = true;
ox = this.x;
oy = this.y;
orot = this.rotation;
time = 1;
speed = (randomNumber() + 5);
oSpeed = speed;
if (randomNumber() < 3){
r = (randomNumber() + 5);
} else {
r = 0;
};
if (this.x < (WIDTH / 2)){
dir = "left";
} else {
dir = "right";
};
if (this.y < (HEIGHT / 2)){
yDir = "up";
} else {
yDir = "down";
};
}
public function resetCards(){
}
public function onEnterFrame(_arg1:Event){
if (firstTime == true){
firstTime = false;
Init();
return;
};
time = (time + 1);
if (time > 30){
if (dir == "left"){
this.x = (this.x - speed);
speed = (speed * 1.1);
if (r != 0){
this.rotation = (this.rotation + r);
};
if (this.x <= -50){
dir = "stop";
};
};
if (dir == "right"){
this.x = (this.x + speed);
speed = (speed * 1.1);
if (r != 0){
this.rotation = (this.rotation + r);
};
if (this.x >= (WIDTH + 50)){
dir = "stop";
};
};
if (yDir == "up"){
this.y = (this.y - 2);
};
if (yDir == "down"){
this.y = (this.y + 2);
};
if (time > 250){
time = 1;
resetCards();
if (x < (WIDTH / 2)){
dir = "left";
} else {
dir = "right";
};
};
};
}
}
}//package
Section 54
//chargeBar (chargeBar)
package {
import flash.display.*;
public dynamic class chargeBar extends MovieClip {
}
}//package
Section 55
//CodeBlockerIn (CodeBlockerIn)
package {
import flash.display.*;
public dynamic class CodeBlockerIn extends MovieClip {
public function CodeBlockerIn(){
addFrameScript(165, frame166);
}
function frame166(){
stop();
TitleScreenState.BlockerInComplete();
}
}
}//package
Section 56
//CodeBlockerIrisIn (CodeBlockerIrisIn)
package {
import flash.display.*;
public dynamic class CodeBlockerIrisIn extends MovieClip {
public function CodeBlockerIrisIn(){
addFrameScript(115, frame116);
}
function frame116(){
stop();
TitleScreenState.BlockerInComplete();
}
}
}//package
Section 57
//CodeBlockerIrisOut (CodeBlockerIrisOut)
package {
import flash.display.*;
public dynamic class CodeBlockerIrisOut extends MovieClip {
public function CodeBlockerIrisOut(){
addFrameScript(115, frame116);
}
function frame116(){
stop();
TitleScreenState.BlockerOutComplete();
}
}
}//package
Section 58
//CodeBlockerOut (CodeBlockerOut)
package {
import flash.display.*;
public dynamic class CodeBlockerOut extends MovieClip {
public function CodeBlockerOut(){
addFrameScript(165, frame166);
}
function frame166(){
stop();
TitleScreenState.BlockerOutComplete();
}
}
}//package
Section 59
//Collision (Collision)
package {
import flash.geom.*;
public class Collision {
public static var stats_numPolyCollisionTests:int;
public static var stats_numBBTests:int;
public static var closestX:Number = 0;
public static var closestY:Number = 0;
public static var main:Main;
public static var stats_numIntersections:int;
static var PolyCollision_LineHit:Line;
public static var IntersectionX:Number = 0;
public static var IntersectionY:Number = 0;
public static var closestInfiniteX:Number = 0;
public static var closestInfiniteY:Number = 0;
static function DotProduct(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
_local5 = ((_arg1 * _arg3) + (_arg2 * _arg4));
return (_local5);
}
static function PolyCollision(_arg1:GameObj, _arg2:Poly, _arg3:Number, _arg4:Number, _arg5:Number):Boolean{
var _local6:Array;
var _local7:Array;
var _local8:Line;
var _local9:Boolean;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Line;
var _local16:int;
var _local17:int;
var _local18:*;
var _local19:Number;
var _local20:Number;
var _local21:Line;
var _local22:Line;
stats_numPolyCollisionTests++;
_local6 = new Array();
_local7 = new Array();
_local11 = (_arg1.xpos + _arg3);
_local12 = (_arg1.ypos + _arg4);
_local13 = _arg5;
_local14 = (_arg5 * _local13);
for each (_local15 in _arg2.lineList) {
_local9 = SideOfLine(_local15.x0, _local15.y0, _local15.x1, _local15.y1, _local11, _local12);
if (_local9 == true){
_local10 = Dist2ToLine(_local15.x0, _local15.y0, _local15.x1, _local15.y1, _local11, _local12);
if (_local10 < _local14){
_local6.push(_local15);
_local7.push(_local10);
};
};
};
_local18 = _local6.length;
_local16 = 0;
while (_local16 < (_local18 - 1)) {
_local17 = _local16;
while (_local17 < _local18) {
_local19 = _local7[_local16];
_local20 = _local7[_local17];
_local21 = _local6[_local16];
_local22 = _local6[_local17];
if (_local20 < _local19){
_local7[_local16] = _local20;
_local7[_local17] = _local19;
_local6[_local16] = _local22;
_local6[_local17] = _local21;
};
_local17++;
};
_local16++;
};
_local16 = 0;
while (_local16 < _local18) {
_local8 = _local6[_local16];
_local9 = SideOfLine(_local8.x0, _local8.y0, _local8.x1, _local8.y1, _local11, _local12);
if (_local9 == true){
_local10 = Dist2ToLine(_local8.x0, _local8.y0, _local8.x1, _local8.y1, _local11, _local12);
if (_local10 < _local14){
stats_numIntersections++;
Intersected(_arg1, _local8, closestX, closestY, _arg3, _arg4, _arg5);
PolyCollision_LineHit = _local8;
return (true);
};
};
return (true);
_local16++;
};
return (false);
}
public static function ClosestPointOnLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):void{
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
_local7 = (_arg5 - _arg1);
_local8 = (_arg6 - _arg2);
_local9 = (_arg3 - _arg1);
_local10 = (_arg4 - _arg2);
_local11 = ((_local9 * _local9) + (_local10 * _local10));
_local12 = ((_local7 * _local9) + (_local8 * _local10));
_local13 = (_local12 / _local11);
closestInfiniteX = (_arg1 + (_local9 * _local13));
closestInfiniteY = (_arg2 + (_local10 * _local13));
if (_local13 < 0){
_local13 = 0;
};
if (_local13 > 1){
_local13 = 1;
};
closestX = (_arg1 + (_local9 * _local13));
closestY = (_arg2 + (_local10 * _local13));
}
public static function GetSwitchInRange(_arg1:GameObj):GameObj{
var _local2:GameObj;
return (null);
return (null);
}
static function SideOfLine1(_arg1:Line, _arg2:Number, _arg3:Number):Boolean{
var _local4:Number;
_local4 = DotProduct((_arg1.x1 - _arg1.x0), (_arg1.y1 - _arg1.y0), (_arg2 - _arg1.x0), (_arg3 - _arg1.y0));
if (_local4 < 0){
return (false);
};
return (true);
}
public static function PlayerDeathZoneCollision():void{
var _local1:GameObj;
var _local2:Poly;
if (Game.goPlayer.colFlag_playercanbekilled == false){
return;
};
_local1 = Game.goPlayer;
for each (_local2 in Game.polygonList) {
if (((((_local2.active) && ((_local2.type == Poly.polytype_ZONE)))) && ((_local2.subTypeName == "Death")))){
if (GameObjectInPolyBoundingBox(_local1, _local2)){
if (PointInConvexPoly(_local1.xpos, _local1.ypos, _local2.lineList)){
_local1.PlayerHitEnemy(null);
return;
};
};
};
};
}
public static function GetNearestEnemy(_arg1:Number, _arg2:Number):GameObj{
var _local3:GameObj;
var _local4:Number;
var _local5:GameObj;
var _local6:Number;
_local3 = null;
_local4 = 99999999;
for each (_local5 in GameObjects.objs) {
if (((_local5.active) && (_local5.colFlag_isEnemy))){
_local6 = Utils.Dist2BetweenPoints(_arg1, _arg2, _local5.xpos, _local5.ypos);
if (_local6 < _local4){
_local4 = _local6;
_local3 = _local5;
};
};
};
return (_local3);
}
static function Dist2Between(_arg1:GameObj, _arg2:GameObj):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg2.xpos - _arg1.xpos);
_local4 = (_arg2.ypos - _arg1.ypos);
return (((_local3 * _local3) + (_local4 * _local4)));
}
public static function FindPathByIndex(_arg1:int):Poly{
var _local2:int;
var _local3:Poly;
_local2 = 0;
for each (_local3 in Game.polygonList) {
if (((_local3.active) && ((_local3.type == Poly.polytype_PATH)))){
if (_local2 == _arg1){
return (_local3);
};
_local2++;
};
};
return (null);
}
static function Dist2BetweenPoints(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
var _local6:Number;
_local5 = (_arg3 - _arg1);
_local6 = (_arg4 - _arg2);
return (((_local5 * _local5) + (_local6 * _local6)));
}
public static function FindNearestPathStartPointToPos(_arg1:Number, _arg2:Number):Poly{
var _local3:Poly;
var _local4:Number;
var _local5:Poly;
var _local6:Point;
var _local7:*;
_local3 = null;
_local4 = 99999999;
for each (_local5 in Game.polygonList) {
if (((_local5.active) && ((_local5.type == Poly.polytype_PATH)))){
_local6 = _local5.GetPoint(0);
_local7 = Utils.Dist2BetweenPoints(_local6.x, _local6.y, _arg1, _arg2);
if (_local7 < _local4){
_local4 = _local7;
_local3 = _local5;
};
};
};
return (_local3);
}
static function SideOfLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Boolean{
var _local7:Number;
_local7 = DotProduct((_arg3 - _arg1), (_arg4 - _arg2), (_arg5 - _arg1), (_arg6 - _arg2));
if (_local7 < 0){
return (false);
};
return (true);
}
static function PlayerObjectRectangleCollision(_arg1:GameObj):Boolean{
var _local2:GameObj;
var _local3:ObjectDef;
var _local4:ObjectDef;
var _local5:Rectangle;
var _local6:Rectangle;
_local2 = Game.goPlayer;
_local3 = _local2.GetObjectDef();
_local4 = _arg1.GetObjectDef();
_local5 = _local3.colRects[0].clone();
_local6 = _local4.colRects[0].clone();
_local5.x = (_local5.x + _local2.xpos);
_local5.y = (_local5.y + _local2.ypos);
_local6.x = (_local6.x + _arg1.xpos);
_local6.y = (_local6.y + _arg1.ypos);
return (_local5.intersects(_local6));
}
static function GameObjectInPolyBoundingBox(_arg1:GameObj, _arg2:Poly):Boolean{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = (_arg1.radius + 50);
_local4 = _arg1.xpos;
_local5 = _arg1.ypos;
if (_arg2.boundingRectangle == null){
return (false);
};
stats_numBBTests++;
if (_local4 < (_arg2.boundingRectangle.left - _local3)){
return (false);
};
if (_local4 > (_arg2.boundingRectangle.right + _local3)){
return (false);
};
if (_local5 < (_arg2.boundingRectangle.top - _local3)){
return (false);
};
if (_local5 > (_arg2.boundingRectangle.bottom + _local3)){
return (false);
};
return (true);
}
public static function PlayerEnemyBulletCollision(){
var _local1:GameObj;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:GameObj;
var _local6:Number;
var _local7:Number;
var _local8:Rectangle;
_local1 = Game.goPlayer;
if (_local1.isDead){
return;
};
for each (_local5 in GameObjects.objs) {
if (((_local5.active) && (_local5.colFlag_isEnemyBullet))){
_local6 = _local5.xpos;
_local7 = _local5.ypos;
_local8 = _local1.GetObjectRectangle().clone();
_local1.GetObjectRectangle().clone().x = (_local8.x + _local1.xpos);
_local8.y = (_local8.y + _local1.ypos);
if (_local8.contains(_local6, _local7)){
_local1.PlayerHitEnemyBullet(_local5);
};
};
};
}
public static function BulletEnemyCollision(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Rectangle;
var _local5:Rectangle;
var _local6:GameObj;
var _local7:Number;
var _local8:Number;
var _local9:GameObj;
var _local10:ObjectDef;
for each (_local6 in GameObjects.objs) {
if (((_local6.active) && (_local6.colFlag_isBullet))){
_local7 = _local6.xpos;
_local8 = _local6.ypos;
for each (_local9 in GameObjects.objs) {
if (((_local9.active) && (_local9.colFlag_isEnemy))){
_local10 = _local9.GetObjectDef();
if (_local6.colFlag_UseRadius){
if (Utils.DistBetweenPoints(_local7, _local8, _local9.xpos, _local9.ypos) < _local6.radius){
_local9.EnemyHitByBullet(_local6);
};
} else {
for each (_local4 in _local10.colRects) {
_local5 = _local4.clone();
_local4.clone().x = (_local5.x + _local9.xpos);
_local5.y = (_local5.y + _local9.ypos);
if (_local5.contains(_local7, _local8)){
_local9.EnemyHitByBullet(_local6);
};
};
};
if (_local9.dodgeBullets){
_local9.DodgeBullet(_local6);
};
if (_local9.bulletTestCollisionExtraFunction != null){
if (_local9.bulletTestCollisionExtraFunction(_local6)){
};
};
};
};
};
};
}
public static function LineLineIntersection(_arg1:Line, _arg2:Line):Boolean{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
_local3 = _arg1.x0;
_local4 = _arg1.y0;
_local5 = _arg1.x1;
_local6 = _arg1.y1;
_local7 = _arg2.x0;
_local8 = _arg2.y0;
_local9 = _arg2.x1;
_local10 = _arg2.y1;
_local11 = (_local5 - _local3);
_local12 = (_local9 - _local7);
_local13 = ((_local6 - _local4) / _local11);
_local14 = ((_local10 - _local8) / _local12);
_local15 = (_local4 - (_local13 * _local3));
_local16 = (_local8 - (_local14 * _local7));
_local17 = ((_local15 - _local16) / (_local14 - _local13));
_local18 = (((_local13 * (_local16 - _local15)) / (_local13 - _local14)) + _local15);
if (_arg1.boundingRect.contains(_local17, _local18)){
if (_arg2.boundingRect.contains(_local17, _local18)){
IntersectionX = _local17;
IntersectionY = _local18;
return (true);
};
};
return (false);
}
public static function PlayerPowerupCollision(){
var _local1:GameObj;
if (Game.goPlayer.colFlag_playercanbekilled == false){
return;
};
for each (_local1 in GameObjects.objs) {
if (((_local1.active) && (_local1.colFlag_isPowerup))){
if (PlayerObjectRectangleCollision(_local1)){
};
};
};
}
public static function PlayerPickupCollision(){
var _local1:GameObj;
var _local2:Number;
var _local3:Number;
var _local4:GameObj;
var _local5:Number;
_local1 = Game.goPlayer;
if (_local1.isDead){
return;
};
_local2 = _local1.xpos;
_local3 = _local1.ypos;
for each (_local4 in GameObjects.objs) {
if (((_local4.active) && (_local4.colFlag_canBePickedUp))){
_local5 = Utils.Dist2BetweenPoints(_local4.xpos, _local4.ypos, _local2, _local3);
_local4.controlMode = 0;
if (_local5 < (50 * 50)){
_local4.controlMode = 1;
};
if (_local5 < (30 * 30)){
_local4.PickupPickedUp();
};
};
};
}
static function PlayerObjectPointCollision(_arg1:GameObj):Boolean{
var _local2:GameObj;
var _local3:ObjectDef;
var _local4:Rectangle;
_local2 = Game.goPlayer;
_local3 = _local2.GetObjectDef();
_local4 = _local3.colRects[0].clone();
_local3.colRects[0].clone().x = (_local4.x + _local2.xpos);
_local4.y = (_local4.y + _local2.ypos);
return (_local4.contains(_arg1.xpos, _arg1.ypos));
}
static function Dist2ToLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Number{
var _local7:Number;
var _local8:Number;
ClosestPointOnLine(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
_local7 = (closestX - _arg5);
_local8 = (closestY - _arg6);
return (((_local7 * _local7) + (_local8 * _local8)));
}
static function Intersected(_arg1:GameObj, _arg2:Line, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):void{
var _local8:int;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:int;
var _local15:Number;
_local8 = 50;
_local9 = ((_arg1.oldxpos + _arg5) - _arg3);
_local10 = ((_arg1.oldypos + _arg6) - _arg4);
_local9 = (_local9 / Number(_local8));
_local10 = (_local10 / Number(_local8));
_local11 = (_arg1.xpos + _arg5);
_local12 = (_arg1.ypos + _arg6);
_local13 = (_arg7 * _arg7);
_local14 = 0;
while (_local14 < _local8) {
_local11 = (_local11 + _local9);
_local12 = (_local12 + _local10);
_local15 = Dist2ToLine(_arg2.x0, _arg2.y0, _arg2.x1, _arg2.y1, _local11, _local12);
if (_local15 > _local13){
_arg1.xpos = (_local11 - _arg5);
_arg1.ypos = (_local12 - _arg6);
return;
};
_local14++;
};
}
public static function SingleObjectZoneCollision(_arg1:GameObj):Poly{
var _local2:Poly;
for each (_local2 in Game.polygonList) {
if (((_local2.active) && ((_local2.type == Poly.polytype_ZONE)))){
if (GameObjectInPolyBoundingBox(_arg1, _local2)){
if (PointInConvexPoly(_arg1.xpos, _arg1.ypos, _local2.lineList)){
return (_local2);
};
};
};
};
return (null);
}
static function DistBetween(_arg1:GameObj, _arg2:GameObj):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg2.xpos - _arg1.xpos);
_local4 = (_arg2.ypos - _arg1.ypos);
return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
}
static function DistBetweenPoints(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
var _local6:Number;
_local5 = (_arg3 - _arg1);
_local6 = (_arg4 - _arg2);
return (Math.sqrt(((_local5 * _local5) + (_local6 * _local6))));
}
public static function PointInConvexPoly(_arg1:Number, _arg2:Number, _arg3:Array):Boolean{
var _local4:int;
var _local5:int;
var _local6:Line;
var _local7:Number;
_local4 = _arg3.length;
_local5 = 0;
while (_local5 < _local4) {
_local6 = _arg3[_local5];
_local7 = DotProduct((_local6.x0 - _arg1), (_local6.y0 - _arg2), _local6.nx, _local6.ny);
if (_local7 < 0){
return (false);
};
_local5++;
};
return (true);
}
public static function Update(_arg1:Main){
(main = _arg1);
(stats_numIntersections = 0);
(stats_numBBTests = 0);
(stats_numPolyCollisionTests = 0);
if ((Debug.debugMode & 4) == 0){
PlayerEnemyCollision();
PlayerEnemyBulletCollision();
BulletEnemyCollision();
PlayerPickupCollision();
};
}
static function DistToLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Number{
var _local7:Number;
var _local8:Number;
var _local9:Number;
ClosestPointOnLine(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
_local7 = (closestX - _arg5);
_local8 = (closestY - _arg6);
_local9 = Math.sqrt(((_local7 * _local7) + (_local8 * _local8)));
return (_local9);
}
public static function SingleObjectPlatformCollision(_arg1:GameObj):GameObj{
var _local2:Number;
var _local3:Number;
var _local4:GameObj;
var _local5:Rectangle;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local2 = _arg1.xpos;
_local3 = _arg1.ypos;
for each (_local4 in GameObjects.objs) {
if (((_local4.active) && (_local4.colFlag_isPlatform))){
_local5 = _local4.GetObjectRectangle();
_local6 = (_local4.xpos + _local5.x);
_local7 = (_local6 + _local5.width);
_local8 = (_local4.ypos + _local5.y);
_local9 = (_local8 + 15);
if ((((((((((_local2 >= _local6)) && ((_local2 <= _local7)))) && ((_arg1.yvel >= 0)))) && ((_local3 >= _local8)))) && ((_local3 <= _local9)))){
return (_local4);
};
};
};
return (null);
}
public static function EnemyPointInPolyCollision(_arg1:Poly, _arg2:GameObj){
var _local3:GameObj;
for each (_local3 in GameObjects.objs) {
if (((_local3.active) && (_local3.colFlag_isEnemy))){
if (GameObjectInPolyBoundingBox(_local3, _arg1)){
if (PointInConvexPoly(_local3.xpos, _local3.ypos, _arg1.lineList)){
_local3.EnemyHitByBullet(_arg2, true);
};
};
};
};
}
public static function PlayerEnemyCollision(){
var _local1:GameObj;
var _local2:GameObj;
_local1 = Game.goPlayer;
if (_local1.isDead){
return;
};
for each (_local2 in GameObjects.objs) {
if (((_local2.active) && (_local2.colFlag_isEnemy))){
if (PlayerObjectRectangleCollision(_local2)){
_local1.PlayerHitEnemy(_local2);
};
};
};
}
}
}//package
Section 60
//Cursor (Cursor)
package {
import flash.display.*;
public dynamic class Cursor extends MovieClip {
}
}//package
Section 61
//Debug (Debug)
package {
public class Debug {
public static var debugMode:int = 0;
public static function RenderCollision(){
var _local1:Number;
var _local2:Number;
var _local3:int;
var _local4:uint;
var _local5:Line;
var _local6:Line;
var _local7:int;
var _local8:Poly;
return;
}
}
}//package
Section 62
//Defs (Defs)
package {
import flash.geom.*;
public class Defs {
public static const zpos_PICKUP = 1100;
public static const zpos_ENEMY = 1000;
public static const displayarea_w = 640;
public static const zpos_OVERLAY = 500;
public static const zpos_FAR = 10000;
public static const zpos_PLAYER = 1000;
public static const fps:Number = 50;
public static const platformW2 = 15;
public static const fps2:Number = 100;
public static const zpos_BACKGROUND = 10000;
public static const displayarea_h = 520;
public static var pointZero:Point = new Point(0, 0);
public static var screenRect:Rectangle = new Rectangle(0, 0, displayarea_w, displayarea_h);
}
}//package
Section 63
//DisplayObj (DisplayObj)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.text.*;
public dynamic class DisplayObj {
var currentSetupFrame:int;
var flags:int;
var mc:MovieClip;
var ready:Boolean;
var frames:Array;
public var frame:int;
public function DisplayObj(_arg1:MovieClip, _arg2:Number, _arg3:int, _arg4:Boolean=false):void{
frames = null;
flags = _arg3;
mc = _arg1;
ready = false;
frame = 0;
currentSetupFrame = 1;
if (_arg4){
if (mc != null){
GraphicObjects.totalFramesDone = (GraphicObjects.totalFramesDone + CreateBitmapsFromMovieClip(mc, flags));
ready = true;
};
};
}
public function GetBitmap():Bitmap{
return (frames[frame].bitmap);
}
public function CreateFont(_arg1:TextFormat):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Matrix;
var _local7:Rectangle;
var _local8:Bitmap;
var _local9:BitmapData;
var _local10:Array;
var _local11:TextField;
var _local12:*;
frames = new Array();
_local10 = CreateAsciiStringTable();
_local2 = 0;
while (_local2 < _local10.length) {
_local11 = new TextField();
_local11.textColor = 4294967295;
_local11.selectable = false;
_local11.embedFonts = true;
_local11.autoSize = TextFieldAutoSize.LEFT;
_local11.x = 0;
_local11.y = 0;
_local11.text = _local10[_local2];
_local11.setTextFormat(_arg1);
_local12 = new DisplayObjFrame();
_local12.bitmaps = new Array();
_local12.xoffsets = new Array();
_local12.yoffsets = new Array();
_local12.mat = new Matrix();
_local12.colTrans = new ColorTransform();
_local7 = _local11.getBounds(null);
_local6 = new Matrix();
_local12.xoffsets.push(0);
_local12.yoffsets.push(0);
_local8 = new Bitmap();
_local9 = new BitmapData(_local7.width, _local7.height, true, 0);
_local9.draw(_local11, _local6);
_local8.bitmapData = _local9;
_local12.bitmaps.push(_local8);
frames.push(_local12);
_local2++;
};
}
public function RenderAt(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Boolean=false):void{
frames[frame].RenderAt(_arg1, _arg2, _arg3, _arg4);
}
public function GetMaxFrames():int{
return (frames.length);
}
public function GetFrame():int{
return (frame);
}
public function SetFrame(_arg1:int){
frame = _arg1;
if (frame < 0){
frame = 0;
};
if (frame >= frames.length){
frame = (frames.length - 1);
};
}
public function GetXOffset():Number{
return (frames[frame].xoffset);
}
public function CreateBitmapsFromMovieClip(_arg1:MovieClip, _arg2:int):int{
var _local3:Boolean;
var _local4:Boolean;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Matrix;
var _local10:Rectangle;
var _local11:Bitmap;
var _local12:BitmapData;
var _local13:Bitmap;
var _local14:BitmapData;
var _local15:*;
var _local16:Bitmap;
var _local17:BitmapData;
_local3 = true;
_local4 = false;
if (_arg2 == 2){
_local4 = true;
_arg2 = 0;
};
if (_arg2 == 4){
_local3 = false;
};
if (frames == null){
};
frames = new Array();
_arg1.gotoAndStop(1);
_local5 = 0;
while (_local5 < _arg1.totalFrames) {
_local15 = new DisplayObjFrame();
_local15.bitmaps = new Array();
_local15.shadowBitmaps = new Array();
_local15.xoffsets = new Array();
_local15.yoffsets = new Array();
_local15.mat = new Matrix();
_local15.colTrans = new ColorTransform();
_local10 = _arg1.getBounds(null);
_local10.x = Math.floor(_local10.x);
_local10.y = Math.floor(_local10.y);
_local10.width = Math.floor((_local10.width + 1));
_local10.height = Math.floor((_local10.height + 1));
_local8 = Math.floor(_local8);
_local9 = new Matrix();
_local7 = _local10.left;
_local8 = _local10.top;
_local9.translate(-(_local7), -(_local8));
_local15.xoffsets.push(Number(_local7));
_local15.yoffsets.push(Number(_local8));
if (((!((_arg1.width == 0))) && (!((_arg1.height == 0))))){
_local11 = new Bitmap();
_local12 = new BitmapData(_local10.width, _local10.height, true, 0);
_local12.draw(_arg1, _local9);
_local11.bitmapData = _local12;
_local15.bitmaps.push(_local11);
if (_local3){
_local16 = new Bitmap();
_local17 = new BitmapData(_local10.width, _local10.height, true, 0);
_local17.draw(_arg1, _local9, new ColorTransform(0, 0, 0, 1, 0, 0, 0, 0));
_local16.bitmapData = _local17;
_local15.shadowBitmaps.push(_local16);
};
} else {
_local15.bitmaps.push(null);
_local15.shadowBitmaps.push(null);
};
frames.push(_local15);
_arg1.nextFrame();
_local5++;
};
return (_arg1.totalFrames);
}
public function GetYOffset():Number{
return (frames[frame].yoffset);
}
function CreateAsciiStringTable():Array{
var _local1:Array;
_local1 = new Array();
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push(" ");
_local1.push("!");
_local1.push("'");
_local1.push("#");
_local1.push("$");
_local1.push("%");
_local1.push("&");
_local1.push("'");
_local1.push("(");
_local1.push(")");
_local1.push("*");
_local1.push("+");
_local1.push(",");
_local1.push("-");
_local1.push(".");
_local1.push("/");
_local1.push("0");
_local1.push("1");
_local1.push("2");
_local1.push("3");
_local1.push("4");
_local1.push("5");
_local1.push("6");
_local1.push("7");
_local1.push("8");
_local1.push("9");
_local1.push(":");
_local1.push(";");
_local1.push("<");
_local1.push("=");
_local1.push(">");
_local1.push("?");
_local1.push("@");
_local1.push("A");
_local1.push("B");
_local1.push("C");
_local1.push("D");
_local1.push("E");
_local1.push("F");
_local1.push("G");
_local1.push("H");
_local1.push("I");
_local1.push("J");
_local1.push("K");
_local1.push("L");
_local1.push("M");
_local1.push("N");
_local1.push("O");
_local1.push("P");
_local1.push("Q");
_local1.push("R");
_local1.push("S");
_local1.push("T");
_local1.push("U");
_local1.push("V");
_local1.push("W");
_local1.push("X");
_local1.push("Y");
_local1.push("Z");
_local1.push("[");
_local1.push("\\");
_local1.push("]");
_local1.push("^");
_local1.push("_");
_local1.push("'");
_local1.push("a");
_local1.push("b");
_local1.push("c");
_local1.push("d");
_local1.push("e");
_local1.push("f");
_local1.push("g");
_local1.push("h");
_local1.push("i");
_local1.push("j");
_local1.push("k");
_local1.push("l");
_local1.push("m");
_local1.push("n");
_local1.push("o");
_local1.push("p");
_local1.push("q");
_local1.push("r");
_local1.push("s");
_local1.push("t");
_local1.push("u");
_local1.push("v");
_local1.push("w");
_local1.push("x");
_local1.push("y");
_local1.push("z");
_local1.push("{");
_local1.push("|");
_local1.push("}");
_local1.push("~");
return (_local1);
}
public function CreateBitmapsFromMovieClip1(_arg1:MovieClip, _arg2:int):int{
var _local3:Boolean;
var _local4:Boolean;
var _local5:Boolean;
var _local6:Boolean;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:Matrix;
var _local12:Rectangle;
var _local13:Bitmap;
var _local14:BitmapData;
var _local15:Bitmap;
var _local16:BitmapData;
var _local17:Matrix;
var _local18:ColorTransform;
var _local19:int;
var _local20:*;
var _local21:Bitmap;
var _local22:BitmapData;
_local3 = false;
_local4 = true;
_local5 = true;
if (_arg2 == 2){
_local3 = true;
_arg2 = 0;
};
if (_arg2 == 4){
_local4 = false;
};
if (_arg2 == 5){
_local4 = false;
_local5 = false;
};
if (_arg2 == 3){
};
if (frames == null){
currentSetupFrame = 1;
frames = new Array();
};
_local6 = false;
_local11 = new Matrix();
_local17 = new Matrix();
_local18 = new ColorTransform(0, 0, 0, 0.5, 0, 0, 0, 0);
_local19 = 0;
if (currentSetupFrame < (_arg1.totalFrames + 1)){
_arg1.gotoAndStop(currentSetupFrame);
_local20 = new DisplayObjFrame();
_local20.bitmaps = new Array();
_local20.shadowBitmaps = new Array();
_local20.xoffsets = new Array();
_local20.yoffsets = new Array();
_local20.mat = new Matrix();
_local20.colTrans = new ColorTransform();
_local12 = _arg1.getBounds(null);
_local12.x = Math.floor(_local12.x);
_local12.y = Math.floor(_local12.y);
_local12.width = Math.floor((_local12.width + 1));
_local12.height = Math.floor((_local12.height + 1));
_local10 = Math.floor(_local10);
_local11.identity();
_local9 = _local12.left;
_local10 = _local12.top;
_local11.translate(-(_local9), -(_local10));
_local20.xoffsets.push(Number(_local9));
_local20.yoffsets.push(Number(_local10));
if (((!((_arg1.width == 0))) && (!((_arg1.height == 0))))){
_local13 = new Bitmap();
_local14 = new BitmapData(_local12.width, _local12.height, _local5, 0);
_local14.draw(_arg1, _local11);
_local13.bitmapData = _local14;
_local20.bitmaps.push(_local13);
if (_local4){
_local21 = new Bitmap();
_local22 = new BitmapData(_local12.width, _local12.height, _local5, 0);
_local22.draw(_local14, null, _local18);
_local21.bitmapData = _local22;
_local20.shadowBitmaps.push(_local21);
};
} else {
_local20.bitmaps.push(null);
_local20.shadowBitmaps.push(null);
};
frames.push(_local20);
currentSetupFrame++;
_local19++;
};
_local11 = null;
_local18 = null;
return (_local19);
}
public function GetFrameWidth(_arg1:int):Number{
return (frames[_arg1].bitmap.width);
}
public function RenderAtRot(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean):void{
if (_arg5){
frames[frame].RenderAtRotBurned(_arg1, _arg2, _arg3, _arg4);
} else {
frames[frame].RenderAtRot(_arg1, _arg2, _arg3, _arg4);
};
}
public function RenderAtColTrans(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:ColorTransform, _arg5:Boolean=false):void{
frames[frame].RenderAtColTrans(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function GetWidth():Number{
return (frames[frame].bitmap.width);
}
public function GetHeight():Number{
return (frames[frame].bitmap.height);
}
public function GetScaledBitmap():Bitmap{
return (frames[frame].scaledBitmap);
}
}
}//package
import flash.display.*;
import flash.geom.*;
class DisplayObjFrame {
public var colTrans:ColorTransform;
public var mat:Matrix;
public var shadowBitmaps:Array;
public var yoffsets:Array;
public var xoffsets:Array;
public var bitmaps:Array;
private function DisplayObjFrame(){
}
public function RenderAtScaled(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Number=1):void{
var _local6:Bitmap;
var _local7:Number;
var _local8:Number;
_local6 = bitmaps[0];
_local7 = xoffsets[0];
_local8 = yoffsets[0];
if (_arg4){
_local6 = bitmaps[1];
_local7 = xoffsets[1];
_local8 = yoffsets[1];
};
mat.identity();
mat.scale(_arg5, _arg5);
mat.translate((_arg2 + (_local7 * _arg5)), (_arg3 + (_local8 * _arg5)));
if (_local6 != null){
if (_local6.bitmapData != null){
_arg1.draw(_local6.bitmapData, mat);
};
};
}
public function RenderAtShadow(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Boolean=false):void{
var _local5:Bitmap;
var _local6:Number;
var _local7:Number;
_local5 = shadowBitmaps[0];
_local6 = xoffsets[0];
_local7 = yoffsets[0];
if (_arg4){
_local5 = shadowBitmaps[1];
_local6 = xoffsets[1];
_local7 = yoffsets[1];
};
_arg1.copyPixels(_local5.bitmapData, new Rectangle(0, 0, _local5.width, _local5.height), new Point((_arg2 + _local6), (_arg3 + _local7)), null, null, true);
}
public function RenderAt(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Boolean=false):void{
var _local5:Bitmap;
var _local6:Number;
var _local7:Number;
_local5 = bitmaps[0];
_local6 = xoffsets[0];
_local7 = yoffsets[0];
if (_arg4){
_local5 = bitmaps[1];
_local6 = xoffsets[1];
_local7 = yoffsets[1];
};
_arg1.copyPixels(_local5.bitmapData, new Rectangle(0, 0, _local5.width, _local5.height), new Point((_arg2 + _local6), (_arg3 + _local7)), null, null, true);
}
public function RenderAtSplit(_arg1:BitmapData, _arg2:Number, _arg3:Number):void{
var _local4:int;
var _local5:Bitmap;
var _local6:Number;
var _local7:Number;
_local4 = 0;
while (_local4 < bitmaps.length) {
_local5 = bitmaps[_local4];
_local6 = xoffsets[_local4];
_local7 = yoffsets[_local4];
_arg1.copyPixels(_local5.bitmapData, new Rectangle(0, 0, _local5.width, _local5.height), new Point((_arg2 + _local6), (_arg3 + _local7)), null, null, true);
_local4++;
};
}
public function RenderAtAlpha(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Bitmap;
var _local6:Number;
var _local7:Number;
_local5 = bitmaps[0];
_local6 = xoffsets[0];
_local7 = yoffsets[0];
mat.identity();
mat.translate((_arg2 + _local6), (_arg3 + _local7));
colTrans.alphaMultiplier = _arg4;
if (_local5 != null){
if (_local5.bitmapData != null){
_arg1.draw(_local5.bitmapData, mat, colTrans);
};
};
}
public function RenderAtFunction(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:String):void{
var _local6:Bitmap;
var _local7:Number;
var _local8:Number;
_local6 = bitmaps[0];
_local7 = xoffsets[0];
_local8 = yoffsets[0];
mat.identity();
mat.translate((_arg2 + _local7), (_arg3 + _local8));
colTrans.alphaMultiplier = _arg4;
if (_local6 != null){
if (_local6.bitmapData != null){
_arg1.draw(_local6.bitmapData, mat, colTrans, _arg5);
};
};
}
public function RenderAtRotScaled(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Number=1, _arg6:Number=0):void{
var _local7:Bitmap;
var _local8:Number;
var _local9:Number;
_local7 = bitmaps[0];
_local8 = xoffsets[0];
_local9 = yoffsets[0];
if (_arg4){
_local7 = bitmaps[1];
_local8 = xoffsets[1];
_local9 = yoffsets[1];
};
mat.identity();
mat.translate(_local8, _local9);
mat.rotate(_arg6);
mat.translate(-(_local8), -(_local9));
mat.scale(_arg5, _arg5);
mat.translate((_arg2 + (_local8 * _arg5)), (_arg3 + (_local9 * _arg5)));
if (_local7 != null){
if (_local7.bitmapData != null){
_arg1.draw(_local7.bitmapData, mat);
};
};
}
public function RenderAtRot(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:int;
var _local6:int;
var _local7:Bitmap;
var _local8:Number;
var _local9:Number;
_arg4 = (_arg4 - 0.01);
_local5 = bitmaps.length;
_arg4 = ((Number(_local5) / (Math.PI * 2)) * _arg4);
_local6 = _arg4;
while (_local6 < 0) {
_local6 = (_local6 + _local5);
};
while (_local6 > (_local5 - 1)) {
_local6 = (_local6 - _local5);
};
_local6 = ((_local5 - 1) - _local6);
_local7 = bitmaps[_local6];
_local8 = xoffsets[_local6];
_local9 = yoffsets[_local6];
_arg1.copyPixels(_local7.bitmapData, new Rectangle(0, 0, _local7.width, _local7.height), new Point((_arg2 + _local8), (_arg3 + _local9)));
}
public function RenderAtRotScaledColTrans(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Number=1, _arg6:Number=0, _arg7:ColorTransform=null):void{
var _local8:Bitmap;
var _local9:Number;
var _local10:Number;
_local8 = bitmaps[0];
_local9 = xoffsets[0];
_local10 = yoffsets[0];
if (_arg4){
_local8 = bitmaps[1];
_local9 = xoffsets[1];
_local10 = yoffsets[1];
};
mat.identity();
mat.translate(_local9, _local10);
mat.rotate(_arg6);
mat.translate(-(_local9), -(_local10));
mat.scale(_arg5, _arg5);
mat.translate((_arg2 + (_local9 * _arg5)), (_arg3 + (_local10 * _arg5)));
if (_local8 != null){
if (_local8.bitmapData != null){
_arg1.draw(_local8.bitmapData, mat, _arg7);
};
};
}
public function RenderAtColTrans(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:ColorTransform=null, _arg6:String=null):void{
var _local7:Bitmap;
var _local8:Number;
var _local9:Number;
_local7 = bitmaps[0];
_local8 = xoffsets[0];
_local9 = yoffsets[0];
if (_arg4){
_local7 = bitmaps[1];
_local8 = xoffsets[1];
_local9 = yoffsets[1];
};
mat.identity();
mat.translate((_arg2 + _local8), (_arg3 + _local9));
if (_local7 != null){
if (_local7.bitmapData != null){
_arg1.draw(_local7.bitmapData, mat, _arg5, _arg6);
};
};
}
public function RenderAtAdditive(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Bitmap;
var _local6:Number;
var _local7:Number;
_local5 = bitmaps[0];
_local6 = xoffsets[0];
_local7 = yoffsets[0];
mat.identity();
mat.translate((_arg2 + _local6), (_arg3 + _local7));
colTrans.alphaMultiplier = _arg4;
if (_local5 != null){
if (_local5.bitmapData != null){
_arg1.draw(_local5.bitmapData, mat, colTrans, "add");
};
};
}
}
Section 64
//Domain (Domain)
package {
public class Domain {
public static function GetDomain():String{
var _local1:String;
var _local2:Number;
var _local3:Number;
var _local4:String;
var _local5:Number;
var _local6:Number;
_local1 = Main.theStage.loaderInfo.url;
_local2 = (_local1.indexOf("://") + 3);
_local3 = _local1.indexOf("/", _local2);
_local4 = _local1.substring(_local2, _local3);
_local5 = (_local4.lastIndexOf(".") - 1);
_local6 = (_local4.lastIndexOf(".", _local5) + 1);
_local4 = _local4.substring(_local6, _local4.length);
return (_local4);
}
public static function IsLockedOut():Boolean{
var _local1:String;
_local1 = GetDomain();
if (((!((_local1 == "flashgamelicense.com"))) && (!((_local1 == "longanimalsgames.com"))))){
return (true);
};
return (false);
}
}
}//package
Section 65
//Enemy1 (Enemy1)
package {
import flash.display.*;
public dynamic class Enemy1 extends MovieClip {
}
}//package
Section 66
//Enemy10 (Enemy10)
package {
import flash.display.*;
public dynamic class Enemy10 extends MovieClip {
}
}//package
Section 67
//Enemy11 (Enemy11)
package {
import flash.display.*;
public dynamic class Enemy11 extends MovieClip {
}
}//package
Section 68
//Enemy12 (Enemy12)
package {
import flash.display.*;
public dynamic class Enemy12 extends MovieClip {
}
}//package
Section 69
//Enemy13 (Enemy13)
package {
import flash.display.*;
public dynamic class Enemy13 extends MovieClip {
}
}//package
Section 70
//Enemy13a (Enemy13a)
package {
import flash.display.*;
public dynamic class Enemy13a extends MovieClip {
}
}//package
Section 71
//Enemy14 (Enemy14)
package {
import flash.display.*;
public dynamic class Enemy14 extends MovieClip {
}
}//package
Section 72
//Enemy15 (Enemy15)
package {
import flash.display.*;
public dynamic class Enemy15 extends MovieClip {
}
}//package
Section 73
//Enemy16 (Enemy16)
package {
import flash.display.*;
public dynamic class Enemy16 extends MovieClip {
}
}//package
Section 74
//Enemy17 (Enemy17)
package {
import flash.display.*;
public dynamic class Enemy17 extends MovieClip {
}
}//package
Section 75
//Enemy18 (Enemy18)
package {
import flash.display.*;
public dynamic class Enemy18 extends MovieClip {
}
}//package
Section 76
//Enemy19 (Enemy19)
package {
import flash.display.*;
public dynamic class Enemy19 extends MovieClip {
}
}//package
Section 77
//Enemy1Large (Enemy1Large)
package {
import flash.display.*;
public dynamic class Enemy1Large extends MovieClip {
}
}//package
Section 78
//Enemy2 (Enemy2)
package {
import flash.display.*;
public dynamic class Enemy2 extends MovieClip {
}
}//package
Section 79
//Enemy20 (Enemy20)
package {
import flash.display.*;
public dynamic class Enemy20 extends MovieClip {
}
}//package
Section 80
//Enemy21 (Enemy21)
package {
import flash.display.*;
public dynamic class Enemy21 extends MovieClip {
}
}//package
Section 81
//Enemy22 (Enemy22)
package {
import flash.display.*;
public dynamic class Enemy22 extends MovieClip {
}
}//package
Section 82
//Enemy23 (Enemy23)
package {
import flash.display.*;
public dynamic class Enemy23 extends MovieClip {
}
}//package
Section 83
//Enemy24 (Enemy24)
package {
import flash.display.*;
public dynamic class Enemy24 extends MovieClip {
}
}//package
Section 84
//Enemy24Large (Enemy24Large)
package {
import flash.display.*;
public dynamic class Enemy24Large extends MovieClip {
}
}//package
Section 85
//Enemy3 (Enemy3)
package {
import flash.display.*;
public dynamic class Enemy3 extends MovieClip {
}
}//package
Section 86
//Enemy4 (Enemy4)
package {
import flash.display.*;
public dynamic class Enemy4 extends MovieClip {
}
}//package
Section 87
//Enemy5 (Enemy5)
package {
import flash.display.*;
public dynamic class Enemy5 extends MovieClip {
}
}//package
Section 88
//Enemy6 (Enemy6)
package {
import flash.display.*;
public dynamic class Enemy6 extends MovieClip {
}
}//package
Section 89
//Enemy6a (Enemy6a)
package {
import flash.display.*;
public dynamic class Enemy6a extends MovieClip {
}
}//package
Section 90
//Enemy7 (Enemy7)
package {
import flash.display.*;
public dynamic class Enemy7 extends MovieClip {
}
}//package
Section 91
//Enemy7a (Enemy7a)
package {
import flash.display.*;
public dynamic class Enemy7a extends MovieClip {
}
}//package
Section 92
//Enemy7aTiny (Enemy7aTiny)
package {
import flash.display.*;
public dynamic class Enemy7aTiny extends MovieClip {
}
}//package
Section 93
//Enemy7Tiny (Enemy7Tiny)
package {
import flash.display.*;
public dynamic class Enemy7Tiny extends MovieClip {
}
}//package
Section 94
//Enemy8 (Enemy8)
package {
import flash.display.*;
public dynamic class Enemy8 extends MovieClip {
}
}//package
Section 95
//Enemy8a (Enemy8a)
package {
import flash.display.*;
public dynamic class Enemy8a extends MovieClip {
}
}//package
Section 96
//Enemy9 (Enemy9)
package {
import flash.display.*;
public dynamic class Enemy9 extends MovieClip {
}
}//package
Section 97
//EnemyBoss2 (EnemyBoss2)
package {
import flash.display.*;
public dynamic class EnemyBoss2 extends MovieClip {
}
}//package
Section 98
//EnemyBoss2Drone (EnemyBoss2Drone)
package {
import flash.display.*;
public dynamic class EnemyBoss2Drone extends MovieClip {
}
}//package
Section 99
//EnemyBoss3 (EnemyBoss3)
package {
import flash.display.*;
public dynamic class EnemyBoss3 extends MovieClip {
}
}//package
Section 100
//EnemyBoss3Drone (EnemyBoss3Drone)
package {
import flash.display.*;
public dynamic class EnemyBoss3Drone extends MovieClip {
}
}//package
Section 101
//EnemyBullet1 (EnemyBullet1)
package {
import flash.display.*;
public dynamic class EnemyBullet1 extends MovieClip {
}
}//package
Section 102
//EnemyBullet2 (EnemyBullet2)
package {
import flash.display.*;
public dynamic class EnemyBullet2 extends MovieClip {
}
}//package
Section 103
//EnemyBullet3 (EnemyBullet3)
package {
import flash.display.*;
public dynamic class EnemyBullet3 extends MovieClip {
}
}//package
Section 104
//EnemyBulletBigLaser (EnemyBulletBigLaser)
package {
import flash.display.*;
public dynamic class EnemyBulletBigLaser extends MovieClip {
}
}//package
Section 105
//ExplodeMark (ExplodeMark)
package {
import flash.display.*;
public dynamic class ExplodeMark extends MovieClip {
}
}//package
Section 106
//explosion1 (explosion1)
package {
import flash.media.*;
public dynamic class explosion1 extends Sound {
}
}//package
Section 107
//explosion2 (explosion2)
package {
import flash.media.*;
public dynamic class explosion2 extends Sound {
}
}//package
Section 108
//explosion3 (explosion3)
package {
import flash.media.*;
public dynamic class explosion3 extends Sound {
}
}//package
Section 109
//explosion4 (explosion4)
package {
import flash.media.*;
public dynamic class explosion4 extends Sound {
}
}//package
Section 110
//ExternalData (ExternalData)
package {
import flash.events.*;
import flash.net.*;
public class ExternalData {
static var f:Function;
static var xml:XML;
static var xxx:XML = <data>
<!-- ****************************************************************************************** -->
<!-- Unless otherwise stated, times are in seconds and angles are in degrees -->
<!-- ****************************************************************************************** -->
<!-- ****************************************************************************************** -->
<!-- Player Weapons -->
<!-- rate.shots = number of shots fired before reload is necessary -->
<!-- rate.shotdim = rate shots go down when not shooting (not yet implemented -->
<!-- rate.reload = time taken to recharge when all shots are fired -->
<!-- ****************************************************************************************** -->
<weapon weaponname="Shot" id="0" description="The most basic weapon money can buy, a simple 1 shot lazer cannon with a quick fire rate. Takes skill to target enemies.">
<info damage="1" firerate="0.1" speed="20"/>
<rate1 time="5"/>
<rate shots="50" shotdim="0.1" reload="1"/>
<shop frame="5" cost="1000"/>
<sound fire="lazer1"/>
</weapon>
<weapon weaponname="Diagonals" id="8" description="Cover all the angles, fires four shots from each diagonal of your ship, good for covering enemies which come at you from all angles.">
<info damage="2" firerate="0.25" speed="10"/>
<rate1 time="5"/>
<rate shots="10" shotdim="1" reload="1"/>
<shop frame="13" cost="2500"/>
<sound fire="lazer9"/>
</weapon>
<weapon weaponname="Boomeranger" id="14" description="An energy weapon which always comes back, if you miss the weapon will home back in on your position giving you 2 attempts to take out the enemy.">
<info damage="3" firerate="0.1" speed="6"/>
<rate1 time="5"/>
<rate shots="30" shotdim="1" reload="2"/>
<shop frame="19" cost="2500"/>
<sound fire="lazer1"/>
</weapon>
<weapon weaponname="Arc spread" id="4" description="Fires a field of 3 lazer arcs from the front of your ship. A great spread but not the most powerfull, a good all round weapon.">
<info damage="2" firerate="0.2" speed="20"/>
<rate1 time="5"/>
<rate shots="30" shotdim="1" reload="1"/>
<shop frame="9" cost="4000"/>
<sound fire="lazer5"/>
</weapon>
<weapon weaponname="Spiraller" id="10" description="The spiraller produces energy particles which circle your craft, very effective for big spreads of enemy and also can act as a shield againts close enemies.">
<info damage="2" firerate="0.2" speed="20"/>
<rate1 time="5"/>
<rate shots="30" shotdim="1" reload="1"/>
<shop frame="15" cost="5500"/>
<sound fire="lazer11"/>
</weapon>
<weapon weaponname="Ricochet" id="16" description="A particle weapon with reflective capabilities, will deflect off an emeny when hit to take out multiple ships, great for clustered enemies.">
<info damage="2" firerate="0.2" speed="25"/>
<rate1 time="5"/>
<rate shots="30" shotdim="1" reload="1"/>
<shop frame="21" cost="5500"/>
<sound fire="lazerbounce"/>
</weapon>
<weapon weaponname="Spliner" id="7" description="An energy beam which produces a spear of anti matter to your target, instant death to anything it touches, slow recharge time.">
<info damage="1" firerate="2" speed="7"/>
<rate1 time="5"/>
<rate shots="1" shotdim="1" reload="5"/>
<shop frame="12" cost="10000"/>
<sound fire="lazer8"/>
</weapon>
<weapon weaponname="4 homings" id="3" description="All sides are covered with this super weapon. Fires 4 small seekers from each side of your ship which will do reasonable damage to anything they touch.">
<info damage="3" firerate="0.5" speed="10"/>
<rate1 time="5"/>
<rate shots="10" shotdim="1" reload="3"/>
<shop frame="8" cost="15000"/>
<sound fire="rocket1"/>
</weapon>
<weapon weaponname="Reverse" id="12" description="A magnetic particle weapon, ones activated will charge particles in the atmosphere to the point you target, great range and damage.">
<info damage="2" firerate="0.25" speed="10"/>
<rate1 time="5"/>
<rate shots="30" shotdim="1" reload="5"/>
<shop frame="17" cost="20000"/>
<sound fire="lazer13"/>
</weapon>
<weapon weaponname="Bomb" id="6" description="The bomb is a useful weapon, especially in conjunction with the vortex. Has a short range and is slow to reload but when it goes off will take out multiple enemies.">
<info damage="3" firerate="0.6" speed="10"/>
<rate1 time="5"/>
<rate shots="10" shotdim="1" reload="5"/>
<shop frame="11" cost="30000"/>
<sound fire="lazer7"/>
</weapon>
<weapon weaponname="Slow Time" id="18" description="A weapon which once fired will freeze time for all your enemies, allowing you to out maneuver them and get multiple shots off without a response. ">
<info damage="1" firerate="3" speed="5"/>
<rate1 time="5"/>
<rate shots="1" shotdim="1" reload="10"/>
<shop frame="23" cost="40000"/>
<sound fire="lazer1"/>
</weapon>
<weapon weaponname="Energy Homers" id="5" description="Energy homers will seek out targets, slightly slower that the 4 homers but with much higher damage.">
<info damage="10" firerate="1" speed="5"/>
<rate1 time="5"/>
<rate shots="15" shotdim="1" reload="5"/>
<shop frame="10" cost="50000"/>
<sound fire="lazer6"/>
</weapon>
<weapon weaponname="Rail Gun" id="2" description="The rail gun send out 3 metal particles at super sonic speed, will do massive damage to anything in its path, has a slow reload and requires some accuracy to aim.">
<info damage="1" firerate="0.1" speed="10"/>
<rate1 time="5"/>
<rate shots="20" shotdim="1" reload="6"/>
<shop frame="7" cost="60000"/>
<sound fire="lazer3"/>
</weapon>
<weapon weaponname="Laser lock" id="9" description="The lazer lock is the weapon for no skill death, will pick up targets and deliver an energy beam at them, can only destroy 1 enemy at a time but great for small or quick enemies.">
<info damage="30" firerate="0.5" speed="7"/>
<rate1 time="5"/>
<rate shots="5" shotdim="1" reload="5"/>
<shop frame="14" cost="70000"/>
<sound fire="lazer10"/>
</weapon>
<weapon weaponname="Squarestep" id="11" description="The square stepper is an interesting weapon, fires out a low polgon beam of energy which will find a path across the terrain, does lots of damage but is hard to target.">
<info damage="5" firerate="0.1" speed="20"/>
<rate1 time="5"/>
<rate shots="30" shotdim="1" reload="2"/>
<shop frame="16" cost="80000"/>
<sound fire="lazer12"/>
</weapon>
<weapon weaponname="Lightning" id="13" description="A spinning lightning generator, no targeting on this weapon but will do damage to multiple enemies.">
<info damage="4" firerate="1" speed="1"/>
<rate1 time="5"/>
<rate shots="5" shotdim="1" reload="8"/>
<shop frame="18" cost="90000"/>
<sound fire="lazer1"/>
</weapon>
<weapon weaponname="BFG" id="20" description="The big field gun produces a sphere of energy with slowly moves across the battlefield, great for clustered enemies.">
<info damage="3" firerate="1" speed="5"/>
<rate1 time="5"/>
<rate shots="1" shotdim="30" reload="5"/>
<shop frame="25" cost="100000"/>
<sound fire="lazer1"/>
</weapon>
<weapon weaponname="Vortex" id="15" description="Send of a vortex of pure magnetic energy, it will suck in all the enemies to a single point on the battle field. In combination with a large energy weapon can be devastating.">
<info damage="1" firerate="3" speed="20"/>
<rate1 time="5"/>
<rate shots="1" shotdim="1" reload="10"/>
<shop frame="20" cost="120000"/>
<sound fire="vortex"/>
</weapon>
<weapon weaponname="ShortShield" id="19" description="A short energy field which will protect the ship at close in distances. Great for destroying multiple enemies.">
<info damage="10" firerate="0.1" speed="20"/>
<rate1 time="5"/>
<rate shots="30" shotdim="1" reload="4"/>
<shop frame="24" cost="150000"/>
<sound fire="lazer1"/>
</weapon>
<weapon weaponname="Big Laser" id="1" description="Awesome particle beam with a big spread, does massive damage to enemy crafts and can take out multiple enemies in one go.">
<info damage="2" firerate="0.4" speed="10"/>
<rate1 time="0.1"/>
<rate shots="5" shotdim="1" reload="5"/>
<shop frame="6" cost="200000"/>
<sound fire="lazer2"/>
</weapon>
<weapon weaponname="Duck Death" id="17" description="The Duck of Death is the most powerful weapon known to man, with almost legendary status, it creates a bullet with artificial intellegence which will seek out all enemies to devastating effect.">
<info damage="1" firerate="3" speed="20"/>
<rate1 time="5"/>
<rate shots="1" shotdim="1" reload="20"/>
<shop frame="22" cost="500000"/>
<sound fire="lazer1"/>
</weapon>
<!-- ******************************************************************************************
OBJECT DEFINITIONS
name = unique name of enemy, for use only in the XML
gen = generation type - "portal" or "wave"
description = just for our own use
collsionrect x0,y0,x1,y1 describing collision rectangle of the object
control.initfunc = name of function in code which initialises the object. Functions are in GameObj.as
control.a b c d e f g h = optional parameters passed to the initialisation function.
anim.id = name of animation. this is used in the object update, for example "idle" or "turret"
anim.graphic = Linkage name of movieclip in library.
data.health = starting health of object.
shotcontroller (optional)
shotcontroller.bullettype = type of bullet - not used yet as we only have one type.
shotcontroller.minfreq = minimum frequency of bullet shots
shotcontroller.maxfreq = maximum frequency of bullet shots
shotcontroller.speed = speed of bullet
Single or multiple shots inside shotcontroller:
shotcontroller.shot.type = "atplayer" or "absolute"
shotcontroller.shot.offset = the angle at which the bullet is fired, either absolute or relative
****************************************************************************************** -->
<!-- We should give these better descriptive names. otherwise it'll get confusing -->
<objdef name="EnemyBullet1" gen="bullet" description="bullet">
<control initfunc="InitEnemyBullet" particleid="1"/>
<anim id="idle" graphic="EnemyBullet1"/>
<data health="20"/>
</objdef>
<objdef name="EnemyBullet2" gen="bullet" description="bullet">
<control initfunc="InitEnemyBullet" particleid="1"/>
<anim id="idle" graphic="EnemyBullet2"/>
<data health="20"/>
</objdef>
<objdef name="EnemyBullet3" gen="bullet" description="bullet">
<control initfunc="InitEnemyBullet" particleid="1"/>
<anim id="idle" graphic="EnemyBullet3"/>
<data health="20"/>
</objdef>
<!-- Enemies in order of difficulty -->
<objdef name="EnemyTriangleFollowSmallEasy" gen="portal" description="Triangular, follows you">
<booty score="100" num="1" type="0"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_FollowPlayer" a="0.001" b="0.0" c="0.5" d="1"/>
<anim id="idle" graphic="Enemy1"/>
<data health="1"/>
</objdef>
<objdef name="EnemyTriangleFollowLargeEasy" gen="portal" description="Triangular, follows you">
<booty score="100" num="1" type="0"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_FollowPlayer" a="0.01" b="0.02" c="0.5" d="1"/>
<anim id="idle" graphic="Enemy1Large"/>
<data health="10"/>
</objdef>
<objdef name="EnemyTriangleFollowLargeHard" gen="portal" description="Triangular, follows you">
<booty score="200" num="1" type="2"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_FollowPlayer" a="0.01" b="0.02" c="0.5" d="1"/>
<anim id="idle" graphic="Enemy1Large"/>
<data health="50"/>
</objdef>
<objdef name="EnemyTriangleFollowSmall" gen="portal" description="Triangular, follows you">
<booty score="100" num="1" type="0"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_FollowPlayer" a="0.01" b="0.02" c="1" d="2"/>
<anim id="idle" graphic="Enemy1"/>
<data health="3"/>
</objdef>
<objdef name="EnemyTriangleFollowSmallHard" gen="portal" description="Triangular, follows you">
<booty score="100" num="1" type="0"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_FollowPlayer" a="0.01" b="0.02" c="1" d="2"/>
<anim id="idle" graphic="Enemy1"/>
<data health="6"/>
</objdef>
<objdef name="EnemyTriangleFollowSmallVeryHard" gen="portal" description="Triangular, follows you">
<booty score="200" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_FollowPlayer" a="0.01" b="0.02" c="1" d="2"/>
<anim id="idle" graphic="Enemy1"/>
<data health="30"/>
</objdef>
<objdef name="EnemyTriangleFollowBig" gen="portal" description="Triangular, follows you - bigger and slower">
<booty score="300" num="2" type="0"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_FollowPlayer" a="0.005" b="0.01" c="0.5" d="1"/>
<anim id="idle" graphic="Enemy18"/>
<data health="10"/>
</objdef>
<objdef name="EnemyTriangleFollowBigHard" gen="portal" description="Triangular, follows you - bigger and slower">
<booty score="300" num="2" type="0"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_FollowPlayer" a="0.005" b="0.01" c="0.5" d="1"/>
<anim id="idle" graphic="Enemy18"/>
<data health="20"/>
</objdef>
<objdef name="EnemyWorm_Easy" gen="wave" description="8 way worm">
<booty score="200" num="3" type="0"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_Edge8Way" a="0.5" b="1"/>
<anim id="idle" graphic="Enemy9"/>
<data health="20"/>
</objdef>
<objdef name="EnemyWorm_Hard" gen="wave" description="8 way worm">
<booty score="200" num="3" type="0"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_Edge8Way" a="0.5" b="1"/>
<anim id="idle" graphic="Enemy9"/>
<data health="40"/>
</objdef>
<objdef name="EnemyTieFighter_Easy" gen="portal" description="">
<booty score="100" num="1" type="0"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_RandomlyFlyRoundMap" a="0.01" b="0.04" c="1" d="2"/>
<anim id="idle" graphic="Enemy2"/>
<data health="3"/>
</objdef>
<objdef name="EnemyTieFighter_Hard" gen="portal" description="">
<booty score="100" num="1" type="0"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_RandomlyFlyRoundMap" a="0.01" b="0.5" c="2" d="4"/>
<anim id="idle" graphic="Enemy2"/>
<data health="3"/>
</objdef>
<objdef name="EnemyBug_Easy" gen="wave" description="8 way bug">
<booty score="200" num="1" type="2"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_Edge8Way" a="1" b="1.5"/>
<anim id="idle" graphic="Enemy5"/>
<data health="30"/>
</objdef>
<objdef name="EnemyCubeHead_Easy" gen="wave" description="8 way cube head">
<booty score="200" num="1" type="0"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_Edge8Way" a="0.4" b="0.8"/>
<anim id="idle" graphic="Enemy24"/>
<data health="3"/>
</objdef>
<objdef name="EnemyCubeHead_Hard" gen="wave" description="8 way cube head">
<booty score="200" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_Edge8Way" a="0.4" b="0.8"/>
<anim id="idle" graphic="Enemy24"/>
<data health="6"/>
</objdef>
<objdef name="EnemyCubeHead_Large" gen="wave" description="8 way cube head">
<booty score="300" num="1" type="2"/>
<collisionrect x0="-30" y0="-30" x1="30" y1="30"/>
<control initfunc="InitEnemy_Edge8Way" a="0.4" b="0.6"/>
<anim id="idle" graphic="Enemy24Large"/>
<data health="50"/>
</objdef>
<objdef name="EnemySpaceInvaderA_Alone" gen="portal" description="Moves on spline round player">
<booty score="300" num="1" type="0"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_SplineRoundPlayer_Stepper" a="200" b="400" c="0.001" d="0.002"/>
<anim id="idle" graphic="Enemy11"/>
<data health="6"/>
</objdef>
<objdef name="Installation1" gen="installation" description="">
<booty score="1000" num="1" type="2"/>
<collisionrect x0="-40" y0="-35" x1="40" y1="45"/>
<control initfunc="InitEnemy_Installation" a="0.01" b="0.03" c="2" d="3"/>
<anim id="idle" graphic="Installation1"/>
<shotcontroller bullettype="EnemyBullet2" minfreq="1" maxfreq="3" speed="1">
<shot type="atplayer" offset="0" delay="0.0"/>
</shotcontroller>
<data health="500"/>
</objdef>
<objdef name="Installation1_FewerShots" gen="installation" description="">
<booty score="1000" num="1" type="2"/>
<collisionrect x0="-40" y0="-35" x1="40" y1="45"/>
<control initfunc="InitEnemy_Installation" a="0.01" b="0.03" c="2" d="3"/>
<anim id="idle" graphic="Installation1"/>
<shotcontroller bullettype="EnemyBullet2" minfreq="3" maxfreq="5" speed="1">
<shot type="atplayer" offset="0" delay="0.0"/>
</shotcontroller>
<data health="500"/>
</objdef>
<objdef name="EnemyFollowSpeedy_Easy" gen="portal" description="follows you">
<booty score="300" num="3" type="0"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_FollowPlayer_AdjustRotvelByDist" a="0.004" b="0.006" c="3" d="4" e="0.02" f="0.03" g="100" h="200"/>
<anim id="idle" graphic="Enemy14"/>
<data health="5"/>
</objdef>
<objdef name="EnemyFollowSpeedy_Hard" gen="portal" description="follows you">
<booty score="300" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_FollowPlayer_AdjustRotvelByDist" a="0.004" b="0.006" c="3" d="4" e="0.02" f="0.03" g="100" h="200"/>
<anim id="idle" graphic="Enemy14"/>
<data health="20"/>
</objdef>
<objdef name="Installation2" gen="installation" description="shoots stream of bullets at player. Not too hard">
<booty score="1000" num="1" type="2"/>
<collisionrect x0="-40" y0="-35" x1="40" y1="45"/>
<control initfunc="InitEnemy_Installation" a="0.01" b="0.03" c="2" d="3"/>
<anim id="idle" graphic="Installation1"/>
<shotcontroller bullettype="EnemyBullet3" minfreq="0.5" maxfreq="0.5" speed="2">
<shot type="atplayer" offset="0" delay="0.0"/>
</shotcontroller>
<data health="500"/>
</objdef>
<objdef name="EnemyFlyingSaucer_Easy" gen="portal" description="">
<booty score="300" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_FollowPlayerVels" a="0.01" b="0.03" c="1" d="2"/>
<anim id="idle" graphic="Enemy17"/>
<data health="10"/>
</objdef>
<objdef name="EnemyFlyingSaucer_Easy_Dodge" gen="portal" description="">
<booty score="300" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<dodge dist="150" min="1" max="3"/>
<control initfunc="InitEnemy_FollowPlayerVels" a="0.01" b="0.03" c="1" d="2"/>
<anim id="idle" graphic="Enemy17"/>
<data health="10"/>
</objdef>
<objdef name="EnemyTank_Easy" gen="wave" description="tank">
<booty score="400" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_Tank" a="0.01" b="0.015" c="0.3" d="0.6"/>
<anim id="idle" graphic="Enemy7"/>
<anim id="turret" graphic="Enemy7a"/>
<shotcontroller bullettype="EnemyBullet3" minfreq="5" maxfreq="8" speed="1">
<offset x="0" y="30"/>
<shot type="atplayer" offset="0" delay="0.0"/>
</shotcontroller>
<data health="20"/>
</objdef>
<objdef name="EnemyTank_Medium" gen="wave" description="tank">
<booty score="400" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_Tank" a="0.01" b="0.015" c="0.3" d="0.6"/>
<anim id="idle" graphic="Enemy7"/>
<anim id="turret" graphic="Enemy7a"/>
<shotcontroller bullettype="EnemyBullet3" minfreq="5" maxfreq="8" speed="1">
<offset x="0" y="30"/>
<shot type="atplayer" offset="0" delay="0.0"/>
</shotcontroller>
<data health="30"/>
</objdef>
<objdef name="EnemyTank_Hard" gen="wave" description="tank">
<booty score="400" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_Tank" a="0.01" b="0.015" c="0.3" d="0.6"/>
<anim id="idle" graphic="Enemy7"/>
<anim id="turret" graphic="Enemy7a"/>
<shotcontroller bullettype="EnemyBullet3" minfreq="5" maxfreq="8" speed="1">
<offset x="0" y="30"/>
<shot type="atplayer" offset="0" delay="0.0"/>
</shotcontroller>
<data health="60"/>
</objdef>
<objdef name="EnemyTank_Tiny" gen="wave" description="tank">
<booty score="400" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_Tank" a="0.005" b="0.02" c="0.6" d="1.2"/>
<anim id="idle" graphic="Enemy7Tiny"/>
<anim id="turret" graphic="Enemy7aTiny"/>
<shotcontroller bullettype="EnemyBullet2" minfreq="10" maxfreq="15" speed="2">
<offset x="0" y="15"/>
<shot type="atplayer" offset="0" delay="0.0"/>
</shotcontroller>
<data health="30"/>
</objdef>
<objdef name="EnemyHelicopter_Easy" gen="portal" description="">
<booty score="400" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_Helicopter" a="300" b="400" c="0.001" d="0.002"/>
<shotcontroller bullettype="EnemyBullet2" minfreq="3" maxfreq="5" speed="2">
<shot type="atplayer" offset="0" delay="0.0"/>
</shotcontroller>
<anim id="idle" graphic="Enemy13"/>
<anim id="turret" graphic="Enemy13a"/>
<data health="10"/>
</objdef>
<objdef name="EnemyHelicopter_Dodge" gen="portal" description="">
<booty score="500" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_Helicopter" a="300" b="400" c="0.001" d="0.002"/>
<dodge dist="200" min="1" max="3"/>
<shotcontroller bullettype="EnemyBullet2" minfreq="3" maxfreq="5" speed="2">
<shot type="atplayer" offset="0" delay="0.0"/>
</shotcontroller>
<anim id="idle" graphic="Enemy13"/>
<anim id="turret" graphic="Enemy13a"/>
<data health="10"/>
</objdef>
<objdef name="EnemyAccelAtYou_Easy" gen="portal" description="straight atya">
<booty score="300" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_AccelStraight" a="0" b="1" c="0.03" d="0.03"/>
<anim id="idle" graphic="Enemy15"/>
<data health="10"/>
</objdef>
<objdef name="EnemyAccelAtYou_Hard" gen="portal" description="straight atya">
<booty score="300" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_AccelStraight" a="1" b="2" c="0.04" d="0.04"/>
<anim id="idle" graphic="Enemy15"/>
<data health="30"/>
</objdef>
<objdef name="EnemyShortBurstsToPlayer" gen="portal" description="xwing, turns on spot and moves">
<booty score="400" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_TurnAndMoveToPoint" a="0.05" b="0.05" c="1" d="4"/>
<anim id="idle" graphic="Enemy4"/>
<data health="15"/>
</objdef>
<objdef name="EnemyShortBurstsToPlayer_Hard" gen="portal" description="xwing, turns on spot and moves">
<booty score="400" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_TurnAndMoveToPoint" a="0.05" b="0.05" c="3" d="4"/>
<anim id="idle" graphic="Enemy4"/>
<data health="20"/>
</objdef>
<objdef name="EnemyShortBurstsToPlayer_VeryHard" gen="portal" description="xwing, turns on spot and moves">
<booty score="400" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_TurnAndMoveToPoint" a="0.05" b="0.05" c="5" d="8"/>
<anim id="idle" graphic="Enemy4"/>
<data health="30"/>
</objdef>
<!-- Randomly ordered enemies -->
<objdef name="EnemyGeomWarsSquare" gen="portal" description="">
<booty score="500" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<dodge dist="150" min="1" max="3"/>
<control initfunc="InitEnemy_FollowPlayer" a="0.005" b="0.01" c="0.5" d="1"/>
<anim id="idle" graphic="Enemy21"/>
<data health="3"/>
</objdef>
<objdef name="EnemyGeomWarsCircle" gen="portal" description="">
<booty score="500" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_FollowPlayerVels" a="0.01" b="0.03" c="2" d="3"/>
<anim id="idle" graphic="Enemy22"/>
<data health="3"/>
</objdef>
<objdef name="EnemyGeomWarsTriangle" gen="portal" description="">
<booty score="500" num="1" type="01"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_FollowPlayer" a="0.005" b="0.01" c="1" d="2"/>
<anim id="idle" graphic="Enemy23"/>
<data health="3"/>
</objdef>
<objdef name="EnemyB" gen="portal" description="xwing, turns on spot and moves">
<booty score="100" num="1" type="2"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_TurnAndMoveToPoint" a="0.05" b="0.05" c="3" d="4"/>
<anim id="idle" graphic="Enemy4"/>
<data health="3"/>
</objdef>
<objdef name="EnemySpaceInvaderA" gen="portal" description="Moves on spline round player">
<booty score="300" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_SplineRoundPlayer_Stepper" a="200" b="230" c="0.001" d="0.002"/>
<anim id="idle" graphic="Enemy11"/>
<data health="15"/>
</objdef>
<objdef name="EnemySpaceInvaderB" gen="portal" description="Moves on spline round player">
<booty score="400" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_SplineRoundPlayer_Stepper" a="300" b="330" c="0.001" d="0.0025"/>
<anim id="idle" graphic="Enemy19"/>
<data health="15"/>
</objdef>
<objdef name="EnemySpaceInvaderC" gen="portal" description="Moves on spline round player">
<booty score="500" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_SplineRoundPlayer_Stepper" a="400" b="440" c="0.001" d="0.003"/>
<anim id="idle" graphic="Enemy20"/>
<data health="15"/>
</objdef>
<objdef name="EnemyMeteorBalls_TL" gen="wave" description="Meteor ball from top right. ">
<booty score="100" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_BallsFromEdges" a="1" b="3" c="0"/>
<anim id="idle" graphic="Enemy6"/>
<data health="3"/>
</objdef>
<objdef name="EnemyMeteorBalls_TR" gen="wave" description="Meteor ball from top right. ">
<booty score="100" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_BallsFromEdges" a="1" b="3" c="1"/>
<anim id="idle" graphic="Enemy6"/>
<data health="3"/>
</objdef>
<objdef name="EnemyMeteorBalls_BL" gen="wave" description="Meteor ball from top right. ">
<booty score="100" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_BallsFromEdges" a="1" b="3" c="3"/>
<anim id="idle" graphic="Enemy6"/>
<data health="3"/>
</objdef>
<objdef name="EnemyMeteorBalls_BR" gen="wave" description="Meteor ball from top right. ">
<booty score="100" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_BallsFromEdges" a="1" b="3" c="2"/>
<anim id="idle" graphic="Enemy6"/>
<data health="3"/>
</objdef>
<objdef name="EnemyMeteorBallsFast_TL" gen="wave" description="ball from edges.">
<booty score="200" num="1" type="1"/>
<collisionrect x0="-10" y0="-10" x1="10" y1="10"/>
<control initfunc="InitEnemy_BallsFromEdges" a="1" b="3" c="0"/>
<anim id="idle" graphic="Enemy6a"/>
<data health="3"/>
</objdef>
<objdef name="EnemyMeteorBallsFast_TR" gen="wave" description="ball from edges.">
<booty score="200" num="1" type="1"/>
<collisionrect x0="-10" y0="-10" x1="10" y1="10"/>
<control initfunc="InitEnemy_BallsFromEdges" a="1" b="3" c="1"/>
<anim id="idle" graphic="Enemy6a"/>
<data health="3"/>
</objdef>
<objdef name="EnemyMeteorBallsFast_BL" gen="wave" description="ball from edges.">
<booty score="200" num="1" type="1"/>
<collisionrect x0="-10" y0="-10" x1="10" y1="10"/>
<control initfunc="InitEnemy_BallsFromEdges" a="1" b="3" c="3"/>
<anim id="idle" graphic="Enemy6a"/>
<data health="3"/>
</objdef>
<objdef name="EnemyMeteorBallsFast_BR" gen="wave" description="ball from edges.">
<booty score="200" num="1" type="1"/>
<collisionrect x0="-10" y0="-10" x1="10" y1="10"/>
<control initfunc="InitEnemy_BallsFromEdges" a="1" b="3" c="2"/>
<anim id="idle" graphic="Enemy6a"/>
<data health="3"/>
</objdef>
<objdef name="EnemySnake" gen="wave" description="snaky thing">
<booty score="1000" num="1" type="2"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_Snake" a="0.02" b="0.04" c="1" d="1.5" e="5" f="10" g="0.02" h="2.0"/>
<anim id="idle" graphic="Enemy8"/>
<anim id="tail" graphic="Enemy8a"/>
<data health="50"/>
</objdef>
<objdef name="EnemySnake_Wide" gen="wave" description="snaky thing">
<booty score="1000" num="1" type="2"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_Snake" a="0.01" b="0.03" c="3" d="3" e="7" f="7" g="0.02" h="1.5"/>
<anim id="idle" graphic="Enemy8"/>
<anim id="tail" graphic="Enemy8a"/>
<data health="50"/>
</objdef>
<objdef name="EnemySnake_Narrow" gen="wave" description="snaky thing">
<booty score="1000" num="1" type="2"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_Snake" a="0.01" b="0.03" c="3" d="3" e="3" f="3" g="0.1" h="1"/>
<anim id="idle" graphic="Enemy8"/>
<anim id="tail" graphic="Enemy8a"/>
<data health="50"/>
</objdef>
<objdef name="EnemyBoss1" gen="wave" description="boss1">
<booty score="1000" num="10" type="2"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_Boss1" a="0.01" b="0.01" c="1" d="1.5"/>
<anim id="idle" graphic="Enemy10"/>
<shotcontroller bullettype="EnemyBullet1" minfreq="2" maxfreq="2" speed="3">
<shot type="absolute" offset="0" delay="0"/>
<shot type="absolute" offset="30" delay="1"/>
<shot type="absolute" offset="60" delay="0"/>
<shot type="absolute" offset="90" delay="1"/>
<shot type="absolute" offset="120" delay="0"/>
<shot type="absolute" offset="150" delay="01"/>
<shot type="absolute" offset="180" delay="0"/>
<shot type="absolute" offset="210" delay="1"/>
<shot type="absolute" offset="240" delay="0"/>
<shot type="absolute" offset="270" delay="1"/>
<shot type="absolute" offset="300" delay="0"/>
<shot type="absolute" offset="330" delay="1"/>
</shotcontroller>
<shotcontroller bullettype="EnemyBullet2" minfreq="0.2" maxfreq="0.3" speed="3">
<shot type="atplayer" offset="0"/>
</shotcontroller>
<data health="2000"/>
</objdef>
<objdef name="EnemyBoss1Piece" gen="wave" description="boss1 piece">
<booty score="400" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_FollowPlayer" a="0.01" b="0.03" c="2" d="4"/>
<anim id="idle" graphic="Enemy16"/>
<data health="3"/>
</objdef>
<objdef name="EnemyBoss1PieceEasy" gen="wave" description="boss1 piece">
<booty score="400" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_FollowPlayer" a="0.01" b="0.03" c="0.5" d="1"/>
<anim id="idle" graphic="Enemy16"/>
<data health="20"/>
</objdef>
<objdef name="EnemyBoss2" gen="wave" description="boss1">
<booty score="1000" num="10" type="2"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_Boss2" a="0.01" b="0.01" c="1" d="1.5"/>
<anim id="idle" graphic="EnemyBoss2"/>
<shotcontroller bullettype="EnemyBullet1" minfreq="0.1" maxfreq="0.1" speed="3">
<shot type="atplayer" offset="0" delay="0"/>
<shot type="atplayer" offset="20" delay="0"/>
<shot type="atplayer" offset="-20" delay="0"/>
</shotcontroller>
<shotcontroller bullettype="EnemyBullet2" minfreq="0.5" maxfreq="0.5" speed="3">
<shot type="atplayer" offset="0" delay="0"/>
<shot type="atplayer" offset="120" delay="0"/>
<shot type="atplayer" offset="240" delay="0"/>
</shotcontroller>
<data health="500"/>
</objdef>
<objdef name="EnemyBoss2Drone" gen="wave" description="boss2 drone">
<booty score="400" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_Boss2Drone" a="0.01" b="0.03" c="2" d="4"/>
<anim id="idle" graphic="EnemyBoss2Drone"/>
<data health="3"/>
</objdef>
<objdef name="EnemyBoss2Drone_Standalone" gen="wave" description="boss2 drone">
<booty score="400" num="2" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_Boss2Drone_Standalone" a="0.01" b="0.03" c="2" d="4"/>
<anim id="idle" graphic="EnemyBoss2Drone"/>
<data health="12"/>
</objdef>
<objdef name="EnemyBoss3" gen="wave" description="boss3">
<booty score="1000" num="10" type="2"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_Boss3" a="0.01" b="0.01" c="1" d="1.5"/>
<anim id="idle" graphic="EnemyBoss3"/>
<shotcontroller bullettype="EnemyBullet3" minfreq="0.05" maxfreq="0.05" speed="3">
<shot type="dir" offset="0" delay="0"/>
<shot type="dir" offset="90" delay="0"/>
<shot type="dir" offset="180" delay="0"/>
<shot type="dir" offset="270" delay="0"/>
</shotcontroller>
<shotcontroller bullettype="EnemyBullet2" minfreq="0.2" maxfreq="0.2" speed="3">
<shot type="atplayer" offset="0" delay="0"/>
<shot type="atplayer" offset="40" delay="0"/>
<shot type="atplayer" offset="-40" delay="0"/>
</shotcontroller>
<data health="5000"/>
</objdef>
<objdef name="EnemyBoss3Drone" gen="wave" description="boss3 drone">
<booty score="400" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_Boss3Drone" a="0.01" b="0.03" c="2" d="4"/>
<anim id="idle" graphic="EnemyBoss3Drone"/>
<data health="3"/>
</objdef>
<objdef name="EnemyFly_Fast" gen="portal" description="Triangular, follows you">
<booty score="400" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_FollowPlayer_FlyLike" a="0.6" b="1" c="50" d="50" e="0.1" f="0.2"/>
<anim id="idle" graphic="Enemy12"/>
<data health="10"/>
</objdef>
<objdef name="EnemyFly_Medium" gen="portal" description="Triangular, follows you">
<booty score="400" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_FollowPlayer_FlyLike" a="0.3" b="0.5" c="50" d="50" e="0.4" f="0.6"/>
<anim id="idle" graphic="Enemy12"/>
<data health="10"/>
</objdef>
<objdef name="EnemyFly_Slow" gen="portal" description="Triangular, follows you">
<booty score="400" num="1" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_FollowPlayer_FlyLike" a="0.2" b="0.2" c="50" d="50" e="0.5" f="1"/>
<anim id="idle" graphic="Enemy12"/>
<data health="10"/>
</objdef>
<objdef name="EnemyFlyingSaucer_Hard" gen="portal" description="">
<booty score="400" num="1" type="2"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_FollowPlayerVels" a="0.01" b="0.03" c="2" d="3"/>
<anim id="idle" graphic="Enemy17"/>
<shotcontroller bullettype="EnemyBullet1" minfreq="3" maxfreq="3" speed="2">
<shot type="absolute" offset="0"/>
<shot type="absolute" offset="90"/>
<shot type="absolute" offset="180"/>
<shot type="absolute" offset="270"/>
</shotcontroller>
<data health="3"/>
</objdef>
<objdef name="Installation2" gen="installation" description="">
<booty score="1000" num="1" type="2"/>
<collisionrect x0="-40" y0="-35" x1="40" y1="45"/>
<control initfunc="InitEnemy_Installation" a="0.01" b="0.03" c="2" d="3"/>
<anim id="idle" graphic="Installation1"/>
<shotcontroller bullettype="EnemyBullet2" minfreq="3" maxfreq="6" speed="1">
<shot type="absolute" offset="0" delay="0.1"/>
<shot type="absolute" offset="30" delay="0.2"/>
<shot type="absolute" offset="60" delay="0.3"/>
<shot type="absolute" offset="90" delay="0.4"/>
<shot type="absolute" offset="120" delay="0.5"/>
<shot type="absolute" offset="150" delay="0.6"/>
<shot type="absolute" offset="180" delay="0.7"/>
<shot type="absolute" offset="210" delay="0.8"/>
<shot type="absolute" offset="240" delay="0.9"/>
<shot type="absolute" offset="270" delay="1.0"/>
<shot type="absolute" offset="300" delay="1.1"/>
<shot type="absolute" offset="330" delay="1.2"/>
</shotcontroller>
<data health="500"/>
</objdef>
<objdef name="Installation3" gen="installation" description="">
<booty score="1000" num="1" type="2"/>
<collisionrect x0="-40" y0="-35" x1="40" y1="45"/>
<control initfunc="InitEnemy_Installation" a="0.01" b="0.03" c="2" d="3"/>
<anim id="idle" graphic="Installation1"/>
<shotcontroller bullettype="EnemyBullet3" minfreq="3" maxfreq="6" speed="1">
<shot type="absolute" offset="0" delay="0.05"/>
<shot type="absolute" offset="30" delay="0.1"/>
<shot type="absolute" offset="60" delay="0.15"/>
<shot type="absolute" offset="90" delay="0.2"/>
<shot type="absolute" offset="120" delay="0.25"/>
<shot type="absolute" offset="150" delay="0.3"/>
<shot type="absolute" offset="180" delay="0.35"/>
<shot type="absolute" offset="210" delay="0.4"/>
<shot type="absolute" offset="240" delay="0.45"/>
<shot type="absolute" offset="270" delay="0.5"/>
<shot type="absolute" offset="300" delay="0.55"/>
<shot type="absolute" offset="330" delay="0.6"/>
</shotcontroller>
<data health="500"/>
</objdef>
<objdef name="Installation1_Hard" gen="installation" description="">
<booty score="1000" num="1" type="2"/>
<collisionrect x0="-40" y0="-35" x1="40" y1="45"/>
<control initfunc="InitEnemy_Installation" a="0.01" b="0.03" c="2" d="3"/>
<anim id="idle" graphic="Installation1"/>
<shotcontroller bullettype="EnemyBullet3" minfreq="3" maxfreq="5" speed="2">
<shot type="atplayer" offset="0" delay="0.0"/>
<shot type="atplayer" offset="1" delay="0.05"/>
<shot type="atplayer" offset="0" delay="0.1"/>
<shot type="atplayer" offset="-1" delay="0.15"/>
<shot type="atplayer" offset="0" delay="0.2"/>
</shotcontroller>
<data health="500"/>
</objdef>
<objdef name="GroundPortal" gen="installation" description="">
<booty score="1000" num="1" type="2"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_Portal" a="0.01" b="0.03" c="2" d="3"/>
<anim id="idle" graphic="Portal"/>
<data health="1000"/>
</objdef>
<objdef name="OffScreenPortal" gen="installation" description="">
<booty score="1000" num="10" type="1"/>
<collisionrect x0="-20" y0="-20" x1="20" y1="20"/>
<control initfunc="InitEnemy_Portal" a="0.01" b="0.03" c="2" d="3"/>
<anim id="idle" graphic="Portal"/>
<data health="99999999"/>
</objdef>
<!-- ******************************************************************************************
INIT FUNCTION PARAMETERS
"InitEnemy_FollowPlayerVels"
// Enemy Follow Player using velocity and acceleration
// a,b = min,max acceleration
// c,d = min,max top speed
"InitEnemy_FollowPlayer"
// Enemy Follow Player using forward movement and rotation
// a,b = rotvel min max
// c,d = speed min max
"InitEnemy_Edge8Way"
// Enemy Edge 8way
// a,b = min,max speed
"InitEnemy_TurnAndMoveToPoint"
// turns on spot then moves towards point near player
// a,b = rotvel min,max
// c,d = max speed
"InitEnemy_SplineRoundPlayer"
// creates spline around player then moves around it.
// faces towards player
// a,b = min and max radius from player
// c,d = min,max rotvel
"InitEnemy_RandomlyFlyRoundMap"
// Similar to InitEnemy_FollowPlayer, but chooses random points
// a,b = rotvel min max
// c,d = speed min max
"InitEnemy_Snake"
// snake following player
// a,b = min,max rotvel
// c,d = min,max speed
// e,f = min,max number of tail pieces
// g,h = oscillator frequency and wavelength
"InitEnemy_AccelStraight"
// a,b = initial speed min/max
// c,d = acceleration min/max
"InitEnemy_BallsFromEdges"
//a,b = min,max speed.
// c = starting pos. 0 = top left, 1 = top right, 2 = bottom right, 3 = bottom left
****************************************************************************************** -->
<!-- ******************************************************************************************LEVEL DEFINITIONS <leveldef>
info - general information about the level
info.numkills = amount of kills needed to finish the level.
installation = ground based immovable objects
installation.type = "portal" is a special case for bloack-hole type portals
installation.x = x position
installation.y = y position
portals - defines portals which appear and disappear.
portals.num = number of portals which are active. Set to 0 if inly installation portals are used
portals.mintime = minimum time regeneration of portal
portals.maxtime = maximum time regeneration of portal
portalgroup - defines the waves of enemies which appear from portals. Game chooses one at random each time a portal opens
portalgroup.type = "Enemy name" - object name defined in objdef above.
portalgroup.min = minimum amount of objects which appear in the wave
portalgroup.max = maximum amount of objects which appear in the wave
portalgroup.freq = time interval between objects appearing
portalgroup.timedelay = (optional) time before this group appears
portalgroup.mode = "random" or "atplayer"
wave = defines waves of objets which don't use portals - usually ground based things like tanks and worms
wave.type = "Enemy name" - object name defined in objdef above.
wave.initialdelay = time before this wave first appears
wave.frequency = time between generation of each obejct.
wave.length = length of the wave.
wave.max = unused
wave.repeatdelay = (optional) time between repeats of the wave after the wave has finished
wave.numrepeats = (optional) number of times the wave is repeated. 0 = no repeats, ie the wave only appears once.
****************************************************************************************** -->
<startlevel index="0"/>
<portalmode name="random"/>
<portalmode name="atplayer"/>
<!-- one set of easy followers -->
<leveldef>
<info bg="13" name="Break You In Easy" numkills="50" maxenemies="50"/>
<portalgroup type="EnemyTriangleFollowSmall" min="5" max="5" freq="0.5" timedelay="0" mode="atplayer"/>
<portalgroup type="EnemyTriangleFollowSmall" min="5" max="5" freq="0.5" timedelay="0" mode="atplayer"/>
<portalgroup type="EnemyTriangleFollowSmall" min="5" max="5" freq="0.5" timedelay="0" mode="random"/>
<portals num="2" mintime="2" maxtime="3"/>
</leveldef>
<!-- easy followers and slower heaveier followers-->
<leveldef>
<info bg="16" name="Something Heavier" numkills="50" maxenemies="50"/>
<portalgroup type="EnemyTriangleFollowBig" min="5" max="5" freq="0.5" timedelay="0" mode="random"/>
<portalgroup type="EnemyTriangleFollowSmall" min="5" max="5" freq="0.5" timedelay="0" mode="random"/>
<portalgroup type="EnemyTriangleFollowSmall" min="5" max="5" freq="0.5" timedelay="0" mode="random"/>
<portals num="2" mintime="1" maxtime="3"/>
</leveldef>
<!-- slow worm wave -->
<leveldef>
<info bg="15" name="Worms!" numkills="20" maxenemies="50"/>
<wave type="EnemyWorm_Easy" initialdelay="0" frequency="0.5" length="5" max="10" repeatdelay="5" numrepeats="99999"/>
<portalgroup type="EnemyTriangleFollowBig" min="3" max="3" freq="0.5" timedelay="0" mode="atplayer"/>
<portals num="1" mintime="2" maxtime="3"/>
</leveldef>
<!-- easy tie fighters moving randomly around map -->
<leveldef>
<info bg="-1" name="Tied up" numkills="100" maxenemies="50"/>
<portalgroup type="EnemyTieFighter_Easy" min="5" max="5" freq="0.5" timedelay="0" mode="random"/>
<portalgroup type="EnemyTieFighter_Easy" min="5" max="5" freq="0.5" timedelay="0" mode="atplayer"/>
<portals num="3" mintime="1" maxtime="3"/>
</leveldef>
<!--Introduce space invader1 -->
<leveldef>
<info bg="-1" name="Invaders" numkills="75" maxenemies="15"/>
<portalgroup type="EnemySpaceInvaderA_Alone" min="3" max="3" freq="0.1" timedelay="0" mode="random"/>
<portals num="3" mintime="2" maxtime="3"/>
</leveldef>
<!-- Introduce installations -->
<leveldef>
<info bg="-1" name="Installations" numkills="10" maxenemies="50"/>
<wave type="EnemyWorm_Easy" initialdelay="0" frequency="0.5" length="5" max="10" repeatdelay="5" numrepeats="99999"/>
<installation type="Installation1" x="300" y="300"/>
<installation type="Installation1" x="700" y="700"/>
<installation type="Installation1" x="700" y="300"/>
<installation type="Installation1" x="300" y="700"/>
</leveldef>
<!-- Loads but easy to kill -->
<leveldef>
<info bg="-1" name="Cannon Fodder" numkills="200" maxenemies="50"/>
<installation type="GroundPortal" x="50" y="50"/>
<installation type="GroundPortal" x="900" y="900"/>
<installation type="GroundPortal" x="900" y="50"/>
<installation type="GroundPortal" x="50" y="900"/>
<portalgroup type="EnemyTriangleFollowSmallEasy" min="5" max="10" freq="0.5" timedelay="0" mode="atplayer"/>
<portals num="0" mintime="2" maxtime="3"/>
</leveldef>
<!-- Speeder type -->
<leveldef>
<info bg="-1" name="Speeders" numkills="50" maxenemies="50"/>
<portalgroup type="EnemyFollowSpeedy_Easy" min="3" max="3" freq="0.5" timedelay="0" mode="random"/>
<portals num="2" mintime="2" maxtime="3"/>
</leveldef>
<!-- Cube heads 1-->
<leveldef>
<info bg="-1" name="Tintin Cube heads 1" numkills="300" maxenemies="200"/>
<wave type="EnemyCubeHead_Easy" initialdelay="0" frequency="0.01" length="5" max="10" repeatdelay="5" numrepeats="99999"/>
<portals num="0" mintime="2" maxtime="3"/>
</leveldef>
<!-- Flying saucer -->
<leveldef>
<info bg="-1" name="Flying Saucers" numkills="80" maxenemies="50"/>
<start x="300" y="300"/>
<installation type="Installation2" x="500" y="500"/>
<portalgroup type="EnemyFlyingSaucer_Easy" min="5" max="5" freq="0.5"/>
<portals num="2" mintime="2" maxtime="3"/>
</leveldef>
<!-- Combination of all enemies so far -->
<leveldef>
<info bg="-1" name="Combination 1" numkills="100" maxenemies="50"/>
<wave type="EnemyWorm_Easy" initialdelay="0" frequency="0.5" length="5" max="10" repeatdelay="5" numrepeats="99999"/>
<portalgroup type="EnemyTriangleFollowBig" min="1" max="2" freq="0.5" timedelay="0" mode="random"/>
<portalgroup type="EnemyTriangleFollowSmall" min="1" max="2" freq="0.5" timedelay="0" mode="random"/>
<portalgroup type="EnemySpaceInvaderA_Alone" min="1" max="2" freq="0.1" timedelay="0" mode="random"/>
<portalgroup type="EnemyFollowSpeedy_Easy" min="1" max="2" freq="0.5" timedelay="0" mode="random"/>
<portalgroup type="EnemyFlyingSaucer_Easy" min="1" max="2" freq="0.5"/>
<portals num="5" mintime="1" maxtime="3"/>
</leveldef>
<!-- Tank -->
<leveldef>
<info bg="-1" name="Tank attack" numkills="35" maxenemies="10"/>
<wave type="EnemyTank_Easy" initialdelay="0" frequency="0.5" length="5" max="10" repeatdelay="5" numrepeats="999999"/>
<portals num="0" mintime="2" maxtime="3"/>
</leveldef>
<!-- Helicopters and tanks -->
<leveldef>
<info bg="5" name="bring on the copters" numkills="50" maxenemies="20"/>
<installation type="GroundPortal" x="500" y="300"/>
<installation type="GroundPortal" x="500" y="700"/>
<installation type="GroundPortal" x="300" y="500"/>
<installation type="GroundPortal" x="700" y="500"/>
<portalgroup type="EnemyHelicopter_Easy" min="1" max="1" freq="0.5" timedelay="0" mode="random"/>
<portals num="0" mintime="3" maxtime="3"/>
<wave type="EnemyTank_Easy" initialdelay="0" frequency="0.1" length="1" max="10" repeatdelay="20" numrepeats="999999"/>
</leveldef>
<!-- Robotic Fish slow -->
<leveldef>
<info bg="-1" name="evolving 1" numkills="100" maxenemies="50"/>
<portalgroup type="EnemyFly_Slow" min="10" max="15" freq="0.1"/>
<portals num="2" mintime="1" maxtime="3"/>
</leveldef>
<!-- Big central base -->
<leveldef>
<info bg="-1" name="Central StrongHold" numkills="200" maxenemies="50"/>
<start x="200" y="500"/>
<installation type="Installation2" x="450" y="450"/>
<installation type="Installation2" x="550" y="550"/>
<installation type="GroundPortal" x="550" y="450"/>
<installation type="GroundPortal" x="450" y="550"/>
<portalgroup type="EnemyFollowSpeedy_Easy" min="3" max="3" freq="0.3" timedelay="0" mode="random"/>
<portalgroup type="EnemyTriangleFollowSmall" min="10" max="12" freq="0.2" timedelay="0" mode="random"/>
<portals num="1" mintime="1" maxtime="3"/>
</leveldef>
<!-- Borg babies -->
<leveldef>
<info bg="-1" name="Resistance is futile" numkills="80" maxenemies="50"/>
<portalgroup type="EnemyBoss1PieceEasy" min="1" max="2" freq="0.5"/>
<portals num="5" mintime="1" maxtime="3"/>
<wave type="EnemyWorm_Easy" initialdelay="0" frequency="0.5" length="5" max="10" repeatdelay="5" numrepeats="99999"/>
</leveldef>
<!-- triangle enemies-->
<leveldef>
<info bg="-1" name="Triangulation" numkills="150" maxenemies="50"/>
<installation type="GroundPortal" x="50" y="50"/>
<installation type="GroundPortal" x="900" y="900"/>
<installation type="GroundPortal" x="900" y="50"/>
<installation type="GroundPortal" x="50" y="900"/>
<portalgroup type="EnemyTriangleFollowSmall" min="5" max="5" freq="0.5" timedelay="0" mode="atplayer"/>
<portalgroup type="EnemyTriangleFollowLargeEasy" min="3" max="3" freq="0.5"/>
<portalgroup type="EnemyGeomWarsTriangle" min="5" max="5" freq="0.1" timedelay="0" mode="random"/>
<portalgroup type="EnemyTriangleFollowBig" min="5" max="5" freq="0.5" timedelay="0" mode="random"/>
<portals num="1" mintime="2" maxtime="5"/>
</leveldef>
<!-- bursts at player -->
<leveldef>
<info bg="-1" name="bursts" numkills="100" maxenemies="50"/>
<portalgroup type="EnemyShortBurstsToPlayer" min="5" max="5" freq="0.1" timedelay="0" mode="atplayer"/>
<portals num="3" mintime="1" maxtime="3"/>
</leveldef>
<!-- Lots of balls -->
<leveldef>
<info bg="-1" name="You are a number" numkills="100" maxenemies="50"/>
<wave type="EnemyMeteorBalls_TR" initialdelay="0" frequency="0.1" length="5" max="50" repeatdelay="2" numrepeats="99999"/>
<portals num="0" mintime="2" maxtime="3"/>
</leveldef>
<!-- Robotic Fish slow,medium -->
<leveldef>
<info bg="-1" name="evolving 2" numkills="200" maxenemies="50"/>
<portalgroup type="EnemyFly_Slow" min="10" max="10" freq="0.1"/>
<portalgroup type="EnemyFly_Medium" min="6" max="6" freq="0.1"/>
<portals num="5" mintime="1" maxtime="3"/>
</leveldef>
<!-- Crossfire -->
<leveldef>
<info bg="-1" name="Crossfire" numkills="50" maxenemies="10"/>
<installation type="GroundPortal" x="500" y="50"/>
<installation type="GroundPortal" x="500" y="900"/>
<installation type="GroundPortal" x="50" y="500"/>
<installation type="GroundPortal" x="900" y="500"/>
<portalgroup type="EnemySpaceInvaderA" min="2" max="2" freq="0.1" timedelay="0" mode="random"/>
<portalgroup type="EnemySpaceInvaderB" min="2" max="2" freq="0.1" timedelay="0" mode="random"/>
<portalgroup type="EnemySpaceInvaderC" min="2" max="2" freq="0.1" timedelay="0" mode="random"/>
<portals num="1" mintime="3" maxtime="4"/>
</leveldef>
<!-- lots of portals and small enemies -->
<leveldef>
<info bg="-1" name="city scrape" numkills="200" maxenemies="100"/>
<start x="200" y="500"/>
<installation type="GroundPortal" x="300" y="300"/>
<installation type="GroundPortal" x="500" y="300"/>
<installation type="GroundPortal" x="700" y="300"/>
<installation type="GroundPortal" x="300" y="500"/>
<installation type="GroundPortal" x="500" y="500"/>
<installation type="GroundPortal" x="700" y="500"/>
<installation type="GroundPortal" x="300" y="700"/>
<installation type="GroundPortal" x="500" y="700"/>
<installation type="GroundPortal" x="700" y="700"/>
<portalgroup type="EnemyTriangleFollowSmallHard" min="3" max="3" freq="0.1" timedelay="0" mode="random"/>
<portals num="0" mintime="2" maxtime="6"/>
</leveldef>
<!-- First Snakes Level -->
<leveldef>
<info bg="-1" name="The snake of Destiny" numkills="50" maxenemies="50"/>
<installation type="GroundPortal" x="500" y="500"/>
<start x="200" y="500"/>
<portalgroup type="EnemySnake" min="1" max="1" freq="1"/>
<portalgroup type="EnemyFly_Medium" min="3" max="6" freq="0.1"/>
<portalgroup type="EnemyFly_Medium" min="3" max="6" freq="0.1"/>
<portals num="2" mintime="3" maxtime="3"/>
</leveldef>
<!-- The driving Range of death -->
<leveldef>
<info bg="-1" name="The driving Range of death" numkills="250" maxenemies="50"/>
<wave type="EnemyMeteorBallsFast_TL" initialdelay="0" frequency="0.5" length="3" max="30" repeatdelay="1" numrepeats="99999"/>
<wave type="EnemyMeteorBallsFast_BR" initialdelay="0" frequency="0.5" length="3" max="30" repeatdelay="1" numrepeats="99999"/>
<portalgroup type="EnemyTriangleFollowSmall" min="6" max="10" freq="0.5" timedelay="0" mode="random"/>
<portals num="2" mintime="1" maxtime="3"/>
</leveldef>
<!-- Dougnut babies -->
<leveldef>
<info bg="-1" name="Tasty Crisp" numkills="80" maxenemies="50"/>
<portalgroup type="EnemyBoss2Drone_Standalone" min="5" max="5" freq="0.5" timedelay="0" mode="atplayer"/>
<portalgroup type="EnemyTriangleFollowSmall" min="5" max="5" freq="0.5" timedelay="0" mode="atplayer"/>
<portals num="4" mintime="2" maxtime="3"/>
</leveldef>
<!-- Borgs and Speeders -->
<leveldef>
<info bg="-1" name="Quick and Slow" numkills="100" maxenemies="50"/>
<portalgroup type="EnemyBoss1PieceEasy" min="3" max="6" freq="0.2"/>
<portalgroup type="EnemyFollowSpeedy_Easy" min="4" max="6" freq="0.5" timedelay="0" mode="random"/>
<portals num="3" mintime="1" maxtime="3"/>
</leveldef>
<!-- First Boss level -->
<leveldef>
<info bg="-1" name="Boss 1: The doughnut of death" numkills="9999999" maxenemies="50"/>
<installation type="EnemyBoss2" x="500" y="500"/>
<portals num="0" mintime="2" maxtime="3"/>
</leveldef>
<!-- Robotic Fish Fast -->
<leveldef>
<info bg="-1" name="evolved" numkills="100" maxenemies="50"/>
<installation type="GroundPortal" x="50" y="50"/>
<installation type="GroundPortal" x="900" y="900"/>
<portalgroup type="EnemyFly_Fast" min="3" max="3" freq="0.2"/>
<portals num="1" mintime="3" maxtime="3"/>
</leveldef>
<!-- surrounded by installations -->
<leveldef>
<info bg="-1" name="ring fenced" numkills="12" maxenemies="10"/>
<installation type="Installation1_FewerShots" x="100" y="100"/>
<installation type="Installation1_FewerShots" x="300" y="100"/>
<installation type="Installation1_FewerShots" x="500" y="100"/>
<installation type="Installation1_FewerShots" x="700" y="100"/>
<installation type="Installation1_FewerShots" x="900" y="100"/>
<installation type="Installation1_FewerShots" x="100" y="900"/>
<installation type="Installation1_FewerShots" x="300" y="900"/>
<installation type="Installation1_FewerShots" x="500" y="900"/>
<installation type="Installation1_FewerShots" x="700" y="900"/>
<installation type="Installation1_FewerShots" x="900" y="900"/>
<installation type="Installation1_FewerShots" x="100" y="300"/>
<installation type="Installation1_FewerShots" x="100" y="500"/>
<installation type="Installation1_FewerShots" x="100" y="700"/>
<installation type="Installation1_FewerShots" x="900" y="300"/>
<installation type="Installation1_FewerShots" x="900" y="500"/>
<installation type="Installation1_FewerShots" x="900" y="700"/>
<portals num="0" mintime="2" maxtime="3"/>
</leveldef>
<!-- Geometry wars level -->
<leveldef>
<info bg="12" name="here again?" numkills="200" maxenemies="30"/>
<installation type="OffScreenPortal" x="500" y="-50"/>
<installation type="OffScreenPortal" x="500" y="1050"/>
<installation type="OffScreenPortal" x="-50" y="500"/>
<installation type="OffScreenPortal" x="1050" y="500"/>
<portalgroup type="EnemyGeomWarsSquare" min="5" max="5" freq="0.1" timedelay="0" mode="atplayer"/>
<portalgroup type="EnemyGeomWarsCircle" min="5" max="5" freq="0.1" timedelay="0" mode="atplayer"/>
<portalgroup type="EnemyGeomWarsTriangle" min="5" max="5" freq="0.1" timedelay="0" mode="atplayer"/>
<portals num="0" mintime="3" maxtime="3"/>
</leveldef>
<!-- Balls from all sides -->
<leveldef>
<info bg="-1" name="balltastic" numkills="200" maxenemies="50"/>
<wave type="EnemyMeteorBalls_TR" initialdelay="0" frequency="0.2" length="2" max="30" repeatdelay="2" numrepeats="99999"/>
<wave type="EnemyMeteorBalls_TL" initialdelay="0" frequency="0.2" length="2" max="30" repeatdelay="2" numrepeats="99999"/>
<wave type="EnemyMeteorBalls_BR" initialdelay="0" frequency="0.2" length="2" max="30" repeatdelay="2" numrepeats="99999"/>
<wave type="EnemyMeteorBalls_BL" initialdelay="0" frequency="0.2" length="2" max="30" repeatdelay="2" numrepeats="99999"/>
<portals num="0" mintime="2" maxtime="3"/>
</leveldef>
<!-- the henchmen -->
<leveldef>
<info bg="1" name="the henchmen" numkills="80" maxenemies="30"/>
<portalgroup type="EnemyBoss1PieceEasy" min="1" max="2" freq="0.5"/>
<portalgroup type="EnemyBoss2Drone_Standalone" min="2" max="2" freq="0.5" timedelay="0" mode="atplayer"/>
<portalgroup type="EnemyBoss3Drone" min="1" max="2" freq="0.5" timedelay="0" mode="atplayer"/>
<portals num="4" mintime="2" maxtime="3"/>
</leveldef>
<!-- enemies which accelerate towards you but don't turn. -->
<leveldef>
<info bg="-1" name="dodgems" numkills="100" maxenemies="50"/>
<portalgroup type="EnemyAccelAtYou_Easy" min="9" max="9" freq="0.1" timedelay="0" mode="atplayer"/>
<portalgroup type="EnemyAccelAtYou_Easy" min="9" max="9" freq="0.1" timedelay="0" mode="random"/>
<portals num="5" mintime="1" maxtime="3"/>
</leveldef>
<!-- Speeders and hard enemies-->
<leveldef>
<info bg="-1" name="Speeders Defended" numkills="150" maxenemies="50"/>
<portalgroup type="EnemyFollowSpeedy_Hard" min="4" max="4" freq="0.5" timedelay="0" mode="random"/>
<portalgroup type="EnemyTriangleFollowBig" min="8" max="8" freq="0.5" timedelay="0" mode="atplayer"/>
<portals num="3" mintime="2" maxtime="3"/>
</leveldef>
<!-- Retro Action -->
<leveldef>
<info bg="-1" name="Retro Waves" numkills="250" maxenemies="50"/>
<installation type="OffScreenPortal" x="100" y="-50"/>
<installation type="OffScreenPortal" x="100" y="1200"/>
<installation type="OffScreenPortal" x="900" y="1200"/>
<installation type="OffScreenPortal" x="900" y="-50"/>
<portalgroup type="EnemyTieFighter_Hard" min="5" max="10" freq="0.1" timedelay="0" mode="atplayer"/>
<portals num="3" mintime="3" maxtime="3"/>
</leveldef>
<!-- Borg Boss -->
<leveldef>
<info bg="-1" name="BOSS 2 : THE MOTHER CUBE" numkills="9999999" maxenemies="50"/>
<start x="500" y="150"/>
<installation type="EnemyBoss1" x="500" y="500"/>
<portals num="0" mintime="2" maxtime="3"/>
</leveldef>
<!-- Loads of Bugs -->
<leveldef>
<info bg="-1" name="Buggers" numkills="125" maxenemies="50"/>
<wave type="EnemyBug_Easy" initialdelay="0" frequency="0.05" length="5" max="60" repeatdelay="5" numrepeats="99999"/>
<portalgroup type="EnemyFly_Medium" min="3" max="9" freq="0.1"/>
<portals num="3" mintime="2" maxtime="3"/>
</leveldef>
<!-- Tank babies-->
<leveldef>
<info bg="-1" name="Tank Babies" numkills="100" maxenemies="20"/>
<wave type="EnemyTank_Easy" initialdelay="0" frequency="0.4" length="5" max="10" repeatdelay="5" numrepeats="999999"/>
<wave type="EnemyTank_Tiny" initialdelay="5" frequency="0.4" length="5" max="10" repeatdelay="5" numrepeats="999999"/>
<portals num="0" mintime="2" maxtime="3"/>
</leveldef>
<!-- Combination of all enemies so far 2-->
<leveldef>
<info bg="-1" name="Combination 2" numkills="200" maxenemies="50"/>
<wave type="EnemyWorm_Easy" initialdelay="0" frequency="0.5" length="5" max="10" repeatdelay="5" numrepeats="99999"/>
<portalgroup type="EnemyTriangleFollowBig" min="2" max="4" freq="0.5" timedelay="0" mode="random"/>
<portalgroup type="EnemyTriangleFollowSmall" min="5" max="10" freq="0.5" timedelay="0" mode="random"/>
<portalgroup type="EnemySpaceInvaderA_Alone" min="5" max="10" freq="0.1" timedelay="0" mode="random"/>
<portalgroup type="EnemyFollowSpeedy_Easy" min="5" max="10" freq="0.5" timedelay="0" mode="random"/>
<portalgroup type="EnemyFlyingSaucer_Easy" min="5" max="10" freq="0.5"/>
<portalgroup type="EnemyTieFighter_Hard" min="5" max="10" freq="0.1" timedelay="0" mode="atplayer"/>
<portals num="5" mintime="1" maxtime="3"/>
</leveldef>
<!-- Space Invader-->
<leveldef>
<info bg="-1" name="Invaders Revenge" numkills="150" maxenemies="50"/>
<installation type="Installation1" x="100" y="100"/>
<installation type="Installation1" x="900" y="900"/>
<portalgroup type="EnemySpaceInvaderA" min="5" max="9" freq="0.1" timedelay="0" mode="random"/>
<portalgroup type="EnemySpaceInvaderB" min="5" max="9" freq="0.1" timedelay="0" mode="random"/>
<portalgroup type="EnemySpaceInvaderC" min="5" max="9" freq="0.1" timedelay="0" mode="random"/>
<portals num="3" mintime="2" maxtime="4"/>
</leveldef>
<!-- Baby tanks and Geometry Wars circles-->
<leveldef>
<info bg="-1" name="Tot Protection" numkills="150" maxenemies="50"/>
<wave type="EnemyTank_Tiny" initialdelay="0" frequency="0.5" length="5" max="10" repeatdelay="5" numrepeats="999999"/>
<portalgroup type="EnemyGeomWarsCircle" min="8" max="8" freq="0.1" timedelay="0" mode="random"/>
<portals num="2" mintime="2" maxtime="4"/>
</leveldef>
<!-- Cannon fodder 2-->
<leveldef>
<info bg="-1" name="Cannon Fodder 2" numkills="250" maxenemies="60"/>
<installation type="GroundPortal" x="50" y="50"/>
<installation type="GroundPortal" x="900" y="900"/>
<installation type="GroundPortal" x="900" y="50"/>
<installation type="GroundPortal" x="50" y="900"/>
<portalgroup type="EnemyTriangleFollowBig" min="15" max="15" freq="0.1" timedelay="0" mode="atplayer"/>
<portalgroup type="EnemyGeomWarsTriangle" min="15" max="15" freq="0.1" timedelay="0" mode="atplayer"/>
<portals num="1" mintime="1.5" maxtime="3"/>
</leveldef>
<!-- Lots of ground objects -->
<leveldef>
<info bg="-1" name="A Good Grounding" numkills="200" maxenemies="50"/>
<wave type="EnemyTank_Medium" initialdelay="0" frequency="0.5" length="1" max="10" repeatdelay="10" numrepeats="999999"/>
<wave type="EnemyWorm_Easy" initialdelay="0" frequency="0.1" length="2" max="10" repeatdelay="14" numrepeats="999999"/>
<wave type="EnemyBug_Easy" initialdelay="4" frequency="0.1" length="2" max="10" repeatdelay="14" numrepeats="999999"/>
<wave type="EnemyMeteorBalls_TL" initialdelay="8" frequency="0.1" length="4" max="10" repeatdelay="12" numrepeats="999999"/>
<wave type="EnemyMeteorBallsFast_BR" initialdelay="12" frequency="0.1" length="4" max="10" repeatdelay="12" numrepeats="999999"/>
<portals num="0" mintime="2" maxtime="3"/>
</leveldef>
<!-- Dodging helicopters -->
<leveldef>
<info bg="-1" name="Dodgy Copters" numkills="50" maxenemies="50"/>
<portalgroup type="EnemyHelicopter_Dodge" min="5" max="5" freq="0.5" timedelay="0" mode="atplayer"/>
<portals num="2" mintime="2" maxtime="3"/>
</leveldef>
<!-- X wings and planes -->
<leveldef>
<info bg="-1" name="Strange friends" numkills="160" maxenemies="50"/>
<portalgroup type="EnemyShortBurstsToPlayer_Hard" min="3" max="3" freq="0.5"/>
<wave type="EnemyTank_Medium" initialdelay="0" frequency="0.5" length="5" max="10" repeatdelay="5" numrepeats="999999"/>
<portals num="3" mintime="2" maxtime="3"/>
</leveldef>
<!-- Small Trianglar and big triangular-->
<leveldef>
<info bg="-1" name="Little And Large" numkills="300" maxenemies="50"/>
<portalgroup type="EnemyTriangleFollowLargeHard" min="1" max="1" freq="0.5"/>
<portalgroup type="EnemyTriangleFollowSmallVeryHard" min="10" max="10" freq="0.05"/>
<portalgroup type="EnemyTriangleFollowSmallVeryHard" min="10" max="10" freq="0.05"/>
<installation type="OffScreenPortal" x="500" y="-50"/>
<installation type="OffScreenPortal" x="500" y="1050"/>
<installation type="OffScreenPortal" x="-50" y="500"/>
<installation type="OffScreenPortal" x="1050" y="500"/>
<portals num="3" mintime="2" maxtime="3"/>
</leveldef>
<!-- Invaders and Geometry wars -->
<leveldef>
<info bg="-1" name="Old And New" numkills="300" maxenemies="50"/>
<portalgroup type="EnemySpaceInvaderC" min="3" max="6" freq="0.5"/>
<portalgroup type="EnemyGeomWarsTriangle" min="20" max="20" freq="0.05"/>
<portals num="3" mintime="2" maxtime="3"/>
<wave type="EnemyWorm_Easy" initialdelay="0" frequency="0.2" length="2" max="10" repeatdelay="5" numrepeats="999999"/>
</leveldef>
<!-- Loads of snakes -->
<leveldef>
<info bg="-1" name="Snakes Alive" numkills="50" maxenemies="8"/>
<portalgroup type="EnemySnake_Narrow" min="1" max="1" freq="0.5"/>
<portalgroup type="EnemySnake_Wide" min="1" max="1" freq="0.5"/>
<portals num="5" mintime="2" maxtime="3"/>
</leveldef>
<!-- Cube heads 2-->
<leveldef>
<info bg="-1" name="Tintin Cube heads 2" numkills="1000" maxenemies="200"/>
<wave type="EnemyCubeHead_Hard" initialdelay="0" frequency="0.01" length="5" max="10" repeatdelay="5" numrepeats="99999"/>
<portals num="0" mintime="2" maxtime="3"/>
</leveldef>
<!-- blobbers -->
<leveldef>
<info bg="-1" name="Blobbers" numkills="200" maxenemies="50"/>
<portalgroup type="EnemyBoss3Drone" min="5" max="5" freq="0.5" timedelay="0" mode="random"/>
<installation type="OffScreenPortal" x="500" y="-50"/>
<installation type="OffScreenPortal" x="500" y="1050"/>
<installation type="OffScreenPortal" x="-50" y="500"/>
<installation type="OffScreenPortal" x="1050" y="500"/>
<portalgroup type="EnemyGeomWarsSquare" min="5" max="5" freq="0.1" timedelay="0" mode="atplayer"/>
<portalgroup type="EnemyGeomWarsSquare" min="5" max="5" freq="0.1" timedelay="0" mode="atplayer"/>
<portals num="0" mintime="1" maxtime="3"/>
</leveldef>
<!-- Flying Saucers and bugs -->
<leveldef>
<info bg="-1" name="Aliens Must Die" numkills="200" maxenemies="50"/>
<portalgroup type="EnemyFlyingSaucer_Easy_Dodge" min="10" max="10" freq="0.5"/>
<wave type="EnemyBug_Easy" initialdelay="0" frequency="0.3" length="5" max="60" repeatdelay="5" numrepeats="99999"/>
<wave type="EnemyTank_Tiny" initialdelay="5" frequency="1" length="5" max="10" repeatdelay="5" numrepeats="999999"/>
<portals num="2" mintime="2" maxtime="3"/>
</leveldef>
<!-- All the fish at various levels -->
<leveldef>
<info bg="-1" name="darwinism" numkills="200" maxenemies="50"/>
<portalgroup type="EnemyFly_Medium" min="10" max="15" freq="0.1"/>
<portalgroup type="EnemyFly_Slow" min="10" max="15" freq="0.1"/>
<portalgroup type="EnemyFly_Fast" min="10" max="15" freq="0.1"/>
<portals num="4" mintime="2" maxtime="3"/>
</leveldef>
<!-- Balls from all sides -->
<leveldef>
<info bg="-1" name="Multiball!" numkills="400" maxenemies="200"/>
<wave type="EnemyMeteorBalls_TR" initialdelay="0" frequency="0.1" length="1" max="30" repeatdelay="2" numrepeats="99999"/>
<wave type="EnemyMeteorBalls_TL" initialdelay="0" frequency="0.1" length="1" max="30" repeatdelay="2" numrepeats="99999"/>
<wave type="EnemyMeteorBalls_BR" initialdelay="0" frequency="0.1" length="1" max="30" repeatdelay="2" numrepeats="99999"/>
<wave type="EnemyMeteorBalls_BL" initialdelay="0" frequency="0.1" length="1" max="30" repeatdelay="2" numrepeats="99999"/>
<wave type="EnemyMeteorBallsFast_TR" initialdelay="0" frequency="0.1" length="1" max="30" repeatdelay="2" numrepeats="99999"/>
<wave type="EnemyMeteorBallsFast_TL" initialdelay="0" frequency="0.1" length="1" max="30" repeatdelay="2" numrepeats="99999"/>
<wave type="EnemyMeteorBallsFast_BR" initialdelay="0" frequency="0.1" length="1" max="30" repeatdelay="2" numrepeats="99999"/>
<wave type="EnemyMeteorBallsFast_BL" initialdelay="0" frequency="0.1" length="1" max="30" repeatdelay="2" numrepeats="99999"/>
<portals num="0" mintime="2" maxtime="3"/>
</leveldef>
<!-- Difficult installations with fast bullets-->
<leveldef>
<info bg="-1" name="Fat City" numkills="100" maxenemies="10"/>
<installation type="Installation1_Hard" x="200" y="200"/>
<installation type="Installation1_Hard" x="800" y="400"/>
<installation type="Installation1_Hard" x="200" y="600"/>
<installation type="Installation1_Hard" x="800" y="800"/>
<portalgroup type="EnemyHelicopter_Dodge" min="2" max="2" freq="0.2" timedelay="0" mode="atplayer"/>
<portals num="3" mintime="1" maxtime="3"/>
</leveldef>
<!-- Cube heads 3 - giant-->
<leveldef>
<info bg="-1" name="Giant cube heads" numkills="300" maxenemies="150"/>
<wave type="EnemyCubeHead_Large" initialdelay="0" frequency="0.05" length="5" max="10" repeatdelay="5" numrepeats="99999"/>
<wave type="EnemyCubeHead_Hard" initialdelay="0" frequency="0.5" length="5" max="10" repeatdelay="4" numrepeats="99999"/>
<portals num="0" mintime="2" maxtime="3"/>
</leveldef>
<!-- Combination of all enemies so far 2-->
<leveldef>
<info bg="-1" name="Combination 3" numkills="350" maxenemies="50"/>
<wave type="EnemyWorm_Easy" initialdelay="0" frequency="0.5" length="5" max="10" repeatdelay="5" numrepeats="99999"/>
<portalgroup type="EnemyTriangleFollowBig" min="4" max="4" freq="0.5" timedelay="0" mode="random"/>
<portalgroup type="EnemyTriangleFollowSmall" min="8" max="8" freq="0.5" timedelay="0" mode="random"/>
<portalgroup type="EnemySpaceInvaderA_Alone" min="8" max="8" freq="0.1" timedelay="0" mode="random"/>
<portalgroup type="EnemyFollowSpeedy_Easy" min="8" max="8" freq="0.5" timedelay="0" mode="random"/>
<portalgroup type="EnemyFlyingSaucer_Easy" min="8" max="8" freq="0.5"/>
<portalgroup type="EnemyTieFighter_Hard" min="8" max="8" freq="0.1" timedelay="0" mode="atplayer"/>
<portals num="6" mintime="1" maxtime="2"/>
</leveldef>
<!-- Borg babies -->
<leveldef>
<info bg="-1" name="Resistance is insane" numkills="300" maxenemies="100"/>
<portalgroup type="EnemySnake_Narrow" min="2" max="2" freq="0.5"/>
<portalgroup type="EnemyBoss1PieceEasy" min="4" max="4" freq="0.5"/>
<portalgroup type="EnemyGeomWarsCircle" min="20" max="20" freq="0.1" timedelay="0" mode="atplayer"/>
<portalgroup type="EnemyBoss1PieceEasy" min="4" max="4" freq="0.5"/>
<portals num="5" mintime="2" maxtime="2"/>
<wave type="EnemyWorm_Easy" initialdelay="0" frequency="0.5" length="5" max="10" repeatdelay="5" numrepeats="99999"/>
</leveldef>
<!-- bursts at player -->
<leveldef>
<info bg="-1" name="Bursting" numkills="250" maxenemies="50"/>
<portalgroup type="EnemyShortBurstsToPlayer" min="3" max="3" freq="0.1" timedelay="0" mode="atplayer"/>
<portalgroup type="EnemyAccelAtYou_Hard" min="5" max="5" freq="0.1" timedelay="0" mode="atplayer"/>
<portalgroup type="EnemyShortBurstsToPlayer" min="3" max="3" freq="0.1" timedelay="0" mode="random"/>
<portalgroup type="EnemyAccelAtYou_Hard" min="5" max="5" freq="0.1" timedelay="0" mode="random"/>
<installation type="OffScreenPortal" x="500" y="-50"/>
<installation type="OffScreenPortal" x="500" y="1050"/>
<installation type="OffScreenPortal" x="-50" y="500"/>
<installation type="OffScreenPortal" x="1050" y="500"/>
<portals num="3" mintime="1" maxtime="3"/>
</leveldef>
<!-- massive ground attack -->
<leveldef>
<info bg="-1" name="Charlies Dimmocks" numkills="500" maxenemies="100"/>
<wave type="EnemyTank_Hard" initialdelay="0" frequency="0.5" length="1" max="10" repeatdelay="10" numrepeats="999999"/>
<wave type="EnemyWorm_Hard" initialdelay="0" frequency="0.1" length="2" max="10" repeatdelay="14" numrepeats="999999"/>
<wave type="EnemyBug_Easy" initialdelay="4" frequency="0.1" length="2" max="10" repeatdelay="14" numrepeats="999999"/>
<wave type="EnemyMeteorBalls_TL" initialdelay="8" frequency="0.1" length="4" max="10" repeatdelay="12" numrepeats="999999"/>
<wave type="EnemyMeteorBalls_TR" initialdelay="8" frequency="0.1" length="4" max="10" repeatdelay="12" numrepeats="999999"/>
<wave type="EnemyMeteorBallsFast_BR" initialdelay="12" frequency="0.1" length="4" max="10" repeatdelay="12" numrepeats="999999"/>
<wave type="EnemyMeteorBallsFast_BL" initialdelay="12" frequency="0.1" length="4" max="10" repeatdelay="12" numrepeats="999999"/>
<portals num="0" mintime="2" maxtime="3"/>
</leveldef>
<!-- Green Blobber boss -->
<leveldef>
<info bg="-1" name="BOSS 3 : BACTERIAZILLA" numkills="9999999" maxenemies="50"/>
<installation type="EnemyBoss3" x="500" y="500"/>
<portals num="0" mintime="2" maxtime="3"/>
</leveldef>
<achievementcondition name="equals"/>
<achievementcondition name="lessthan"/>
<achievementcondition name="lessthanequal"/>
<achievementcondition name="greaterthan"/>
<achievementcondition name="greaterthanequal"/>
<achievementvariable name="kills"/>
<achievementvariable name="time"/>
<achievementvariable name="damage"/>
<achievementvariable name="cash"/>
<achievement name="Achievement 1">
<item id="0" level="Break You In Easy" variable="kills" condition="greaterthanequal" value="50"/>
</achievement>
<achievement name="Achievement 2">
<item id="0" level="Break You In Easy" variable="damage" condition="equals" value="0"/>
</achievement>
<achievement name="Achievement 3">
<item id="0" level="Break You In Easy" variable="time" condition="lessthan" value="20"/>
</achievement>
</data>
;
static var xmlLoader:URLLoader;
public static function InitOnce(_arg1:Function){
f = _arg1;
XmlLoadedInternal();
}
public static function xmlLoaded(_arg1:Event){
XML.ignoreWhitespace = true;
xml = new XML(_arg1.target.data);
f();
}
public static function XmlLoadedInternal(){
XML.ignoreWhitespace = true;
xml = new XML(xxx);
f();
}
}
}//package
Section 111
//Font20 (Font20)
package {
import flash.text.*;
public dynamic class Font20 extends Font {
}
}//package
Section 112
//Game (Game)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.ui.*;
import flash.filters.*;
public class Game {
static const levelState_EndSequence = 3;
static const levelState_Dead = 4;
static const levelFinishedState_WON = 1;
static const levelFinishedState_NOT = 0;
static const levelFinishedState_LOST = 2;
static const levelState_Play = 1;
static const levelState_BonusTime = 2;
static const levelState_LevelStart = 0;
static var panelRect:Rectangle = new Rectangle(0, 0, 10, 10);
static var dibsSpeechTimer:int;
static var levelFinishedState:int;
static var levelTimer:int;
static var currentBackgroundFrame:int;
public static var currentPortalGroup:int;
static var offsett:Number = -40;
static var goBackground:GameObj;
public static var gravity;
public static var firstTime_Powerup3:Boolean;
public static var firstTime_Powerup1:Boolean;
public static var firstTime_Powerup2:Boolean;
public static var firstTime_Powerup4:Boolean;
public static var currentStartPointIndex:int;
static var invincibleTimer:int;
public static var levelstart_score:int;
public static var maxFallSpeed;
static var playerWeaponGroups:Array;
static var numLevels:int;
static var currentScore:int;
static var ed:ExternalData;
static var effectInited:Boolean = false;
public static var playerExtraJumpYvel = -4;
public static var LevelUpdateCallback:Object;
static var doSiteLock:Boolean = false;
public static var mouseMapX:Number;
public static var mouseMapY:Number;
static var effectRad:Number = 160;
static var showingOverlay:Boolean;
static var backgroundB:Bitmap;
static var version:Number = 1.01;
public static var numEnemiesActive:int;
public static var normalHeight = 100;
public static var bulletTime:int;
public static var polygonList:Array;
static var numCreds:int;
public static var bossGO:GameObj;
static var cheatMode:Boolean = false;
static var numWeenies:int;
public static var scrollH:Number;
static var invincibleTimerMax:int;
static var numLives:int;
static var showingOverlayID:int;
static var speedupTimerMax:int;
public static var scrollW:Number;
public static var scrollX:Number;
public static var scrollY:Number;
static var cash:int;
static var speedupTimer:int;
public static var levelstart_shotsfired:int;
static var map:BitmapData = null;
static var levelState:int;
public static var levelstart_cash:int;
public static var numKilledInWaveList:Array;
public static var level:Level;
static var currentLevel:int;
static var levelsCompleted:Boolean;
static var dibsSpeechFlag:Boolean;
static var waveDefs:Array;
static var main:Main;
static var multiplier:int;
public static var startPointX:Number;
public static var startPointY:Number;
static var genTimer:int;
static var levelStateTimer:int;
public static var startPointObjs:Array;
public static var playerJumpYvel = -6;
static var scrollMaxX;
static var scrollMaxY;
public static var startPoints:Array;
static var overlayMC:MovieClip;
static var goPlayer:GameObj;
static var backgroundBD:BitmapData;
static var pause:Boolean;
static var portalDef:PortalDef;
public static function HandleMouseWheel(_arg1:int){
if ((((((levelState == levelState_Play)) || ((levelState == levelState_BonusTime)))) || ((levelState == levelState_LevelStart)))){
if (_arg1 > 0){
goPlayer.PlayerCycleWeaponForwards();
} else {
goPlayer.PlayerCycleWeaponBackwards();
};
};
}
static function GetWeaponGroupById(_arg1):PlayerWeaponGroup{
var _local2:PlayerWeaponGroup;
for each (_local2 in playerWeaponGroups) {
if (_local2.id == _arg1){
return (_local2);
};
};
return (null);
}
public static function UpdateGameplay():void{
var _local1:int;
var _local2:int;
SoundPlayer.UpdateOncePerFrame();
mouseMapX = (MouseControl.mousePosX + Game.scrollX);
mouseMapY = (MouseControl.mousePosY + Game.scrollY);
if (pause){
return;
};
if (LevelUpdateCallback != null){
LevelUpdateCallback();
};
_local1 = 1;
if (cheatMode){
if (KeyReader.Pressed(KeyReader.KEY_7)){
currentLevel--;
ReloadDataAndRestartLevel();
};
if (KeyReader.Pressed(KeyReader.KEY_8)){
ReloadDataAndRestartLevel();
};
if (KeyReader.Pressed(KeyReader.KEY_9)){
currentLevel++;
ReloadDataAndRestartLevel();
};
};
if (levelState == levelState_LevelStart){
levelStateTimer--;
if (levelStateTimer <= 0){
InitLevelState(levelState_Play);
goPlayer.PlayerEndStartSequence();
};
};
if (levelState == levelState_BonusTime){
levelStateTimer--;
if (levelStateTimer <= 0){
InitLevelState(levelState_EndSequence);
};
};
if (levelState == levelState_EndSequence){
levelStateTimer--;
if (levelStateTimer <= 0){
TitleScreenState.InitLevelComplete();
Game.pause = true;
};
};
if (levelState == levelState_Dead){
levelStateTimer--;
if (levelStateTimer <= 0){
TitleScreenState.InitGameOver();
};
};
numEnemiesActive = CountActiveEnemies();
if (invincibleTimer > 0){
invincibleTimer--;
};
_local2 = 0;
while (_local2 < _local1) {
if (bulletTime > 0){
bulletTime--;
};
if ((((((levelState == levelState_Play)) || ((levelState == levelState_BonusTime)))) || ((levelState == levelState_LevelStart)))){
if (KeyReader.Pressed(KeyReader.KEY_P)){
PauseMenu.Pause();
};
if (KeyReader.Pressed(KeyReader.KEY_1)){
goPlayer.SetWeaponSlot(0);
};
if (KeyReader.Pressed(KeyReader.KEY_2)){
goPlayer.SetWeaponSlot(1);
};
if (KeyReader.Pressed(KeyReader.KEY_3)){
goPlayer.SetWeaponSlot(2);
};
levelTimer++;
TestPausePressed();
UpdatePortals();
GenerateEnemies();
UpdateScroll();
};
GameObjects.Update();
Collision.Update(main);
Particles.Update(1);
_local2++;
};
if (levelState == levelState_Play){
if (level.numKills >= level.numKillsNeeded){
InitLevelState(levelState_BonusTime);
};
};
if ((((((levelState == levelState_Play)) || ((levelState == levelState_BonusTime)))) || ((levelState == levelState_LevelStart)))){
if (goPlayer.health < 0){
goPlayer.health = 0;
goPlayer.InitPlayerDeath();
InitLevelState(levelState_Dead);
};
};
}
public static function InitPortals():void{
var _local1:int;
var _local2:GameObj;
var _local3:XML;
var _local4:XML;
var _local5:PortalGroup;
var _local6:WaveDef;
_local3 = GetLevelXml(currentLevel);
level = new Level();
level.numKillsNeeded = int(_local3.info.@numkills);
level.maxEnemiesActive = int(_local3.info.@maxenemies);
level.backgroundID = _local3.info.@bg;
level.name = _local3.info.@name;
if (level.numKillsNeeded == 0){
level.numKillsNeeded = 100;
};
trace(((level.name + ". Kills Needed =") + level.numKillsNeeded));
startPointX = 500;
startPointY = 500;
if (_local3.start.length() != 0){
startPointX = _local3.start.@x;
startPointY = _local3.start.@y;
};
portalDef = new PortalDef(int(_local3.portals.@num), Number(_local3.portals.@mintime), Number(_local3.portals.@maxtime));
_local1 = 0;
while (_local1 < _local3.portalgroup.length()) {
_local4 = _local3.portalgroup[_local1];
_local5 = new PortalGroup();
_local5.Init(_local4.@type, int(_local4.@min), int(_local4.@max), Number(_local4.@freq), Number(_local4.@timedelay), _local4.@mode);
portalDef.AddGroup(_local5);
_local1++;
};
_local1 = 0;
while (_local1 < _local3.installation.length()) {
_local4 = _local3.installation[_local1];
if (_local4.@type != "portal"){
_local2 = GameObjects.AddObj(Number(_local4.@x), Number(_local4.@y), 2000);
_local2.InitEnemy(_local4.@type);
} else {
_local2 = GameObjects.AddObj(Number(_local4.@x), Number(_local4.@y), 2000);
_local2.InitPortal(0);
};
_local1++;
};
_local1 = 0;
while (_local1 < portalDef.numPortals) {
_local2 = GameObjects.AddObj(0, 0, 2000);
_local2.InitPortal(1);
_local1++;
};
waveDefs = new Array();
_local1 = 0;
while (_local1 < _local3.wave.length()) {
_local4 = _local3.wave[_local1];
_local6 = new WaveDef();
_local6.InitFromXml(_local4);
waveDefs.push(_local6);
_local1++;
};
}
public static function InitLevel(){
pause = true;
TitleScreenState.InitPreLevelScreen();
}
public static function GetPolyByName(_arg1:String):Poly{
var _local2:Poly;
for each (_local2 in polygonList) {
if (((_local2.active) && ((_local2.name == _arg1)))){
return (_local2);
};
};
return (null);
}
public static function UpdatePortals():void{
var _local1:PortalGroup;
for each (_local1 in portalDef.portalGroups) {
_local1.Update();
};
}
public static function BossKilled():void{
InitLevelState(levelState_BonusTime);
}
static function InitPlayerWeapons(){
var _local1:PlayerWeaponGroup;
var _local2:XML;
var _local3:int;
var _local4:XML;
playerWeaponGroups = new Array();
_local2 = ExternalData.xml;
_local3 = 0;
while (_local3 < _local2.weapon.length()) {
_local4 = _local2.weapon[_local3];
_local1 = new PlayerWeaponGroup();
_local1.id = int(_local4.@id);
_local1.shotTime = (int(_local4.rate1.@time) * Defs.fps);
_local1.reloadTime = (int(_local4.rate.@reload) * Defs.fps);
_local1.maxShots = int(_local4.rate.@shots);
_local1.shotDim = (Number(_local4.rate.@shotdim) * Defs.fps);
_local1.shotDimRate = (Number(_local4.rate.@shots) / Number(_local4.rate.@shotdim));
_local1.fireSoundID = SoundPlayer.GetSoundIdFromString(_local4.sound.@fire);
_local1.name = _local4.@weaponname;
_local1.frame = int(_local4.shop.@frame);
_local1.damage = Number(_local4.info.@damage);
_local1.firerate = int((Number(_local4.info.@firerate) * Defs.fps));
_local1.speed = Number(_local4.info.@speed);
playerWeaponGroups.push(_local1);
_local3++;
};
}
public static function ShowSign(_arg1:int){
if (showingOverlay){
return;
};
showingOverlay = true;
showingOverlayID = _arg1;
}
public static function InitLevel1(){
var _local1:GameObj;
var _local2:Bitmap;
var _local3:BitmapData;
pause = true;
main.screenBD.fillRect(Defs.screenRect, 0);
Debug.debugMode = 0;
KeyReader.InitOnce(main.stage);
MusicPlayer.StartMusic(Utils.RandBetweenInt(1, 3));
ObjectDefs.Init();
Particles.Reset();
GameObjects.ClearAll();
levelFinishedState = levelFinishedState_NOT;
goPlayer = GameObjects.AddObj(400, 400, 1000);
goPlayer.InitPlayer();
scrollX = 0;
scrollY = 0;
LevelUpdateCallback = null;
scrollW = 1000;
scrollH = 1000;
scrollMaxX = (scrollW - Defs.displayarea_w);
scrollMaxY = (scrollH - Defs.displayarea_h);
gravity = 0.2;
maxFallSpeed = 6;
goPlayer.xpos = 100;
goPlayer.ypos = 400;
showingOverlay = false;
showingOverlayID = 0;
invincibleTimer = 0;
invincibleTimerMax = (Defs.fps * 2);
speedupTimer = 0;
speedupTimerMax = (Defs.fps * 10);
numWeenies = 0;
numCreds = 0;
dibsSpeechFlag = false;
dibsSpeechTimer = 0;
firstTime_Powerup1 = false;
firstTime_Powerup2 = false;
firstTime_Powerup3 = false;
firstTime_Powerup4 = false;
InitLevelState(levelState_LevelStart);
InitGenerateEnemies();
bossGO = null;
bulletTime = 0;
InitPortals();
InitPlayerWeapons();
if (level.backgroundID == -1){
currentBackgroundFrame = (currentLevel % 17);
} else {
currentBackgroundFrame = level.backgroundID;
};
trace(("starting bg " + currentBackgroundFrame));
_local2 = GraphicObjects.GetBitmap((GraphicObjects.gfx_backgroundscroll1 + currentBackgroundFrame), 0);
_local3 = _local2.bitmapData;
backgroundBD.copyPixels(_local3, new Rectangle(0, 0, 1000, 1000), new Point(0, 0), null, null, true);
trace("background inited");
goBackground = GameObjects.AddObj(400, 400, 10000);
goBackground.InitBackground(currentBackgroundFrame);
goPlayer.PlayerInitStartSequence();
ScrollToPlayer();
_local1 = GameObjects.AddObj(startPointX, startPointY, 500);
_local1.InitShipAppearTube();
numEnemiesActive = 0;
goPlayer.SetWeaponSlot(0);
goPlayer.PlayerCycleWeaponForwards();
goPlayer.PlayerCycleWeaponForwards();
goPlayer.PlayerCycleWeaponForwards();
levelstart_score = currentScore;
currentPortalGroup = 0;
levelTimer = 0;
Stats.StartLevel();
levelstart_cash = cash;
HideCursor();
pause = false;
}
public static function RemoveGO(_arg1:String){
var _local2:GameObj;
_local2 = GetGOByName(_arg1);
if (_local2){
_local2.active = false;
};
}
public static function RemovePoly(_arg1:String){
var _local2:Poly;
_local2 = GetPolyByName(_arg1);
if (_local2){
_local2.active = false;
};
}
public static function AddScore(_arg1:int):void{
multiplier = 1;
if (levelState == levelState_BonusTime){
multiplier = 2;
};
currentScore = (currentScore + (_arg1 * multiplier));
Stats.levelScore = (Stats.levelScore + (_arg1 * multiplier));
}
public static function ReloadDataAndRestartLevel(){
ExternalData.InitOnce(ReloadDataAndRestartLevel1);
}
public static function ReloadDataAndRestartLevel1(){
InitLevel();
}
static function DestroyBackground(){
var _local1:Number;
var _local2:Number;
var _local3:int;
var _local4:int;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:BitmapData;
var _local9:int;
_local1 = ((Defs.fps * 5) - levelStateTimer);
_local2 = Utils.ScaleTo(0, 750, 0, (Defs.fps * 5), _local1);
_local4 = Utils.ScaleTo(10, 100, 0, (Defs.fps * 5), _local1);
_local3 = 0;
while (_local3 < _local4) {
_local5 = Utils.RandCircle();
_local6 = (500 + (Math.cos(_local5) * _local2));
_local7 = (500 + (Math.sin(_local5) * _local2));
_local8 = backgroundBD;
_local9 = Utils.RandBetweenInt(0, 6);
GraphicObjects.RenderAt(GraphicObjects.gfx_backgroundeater, _local9, _local8, _local6, _local7, false);
_local3++;
};
}
static function RenderCursor(){
GraphicObjects.RenderAt(GraphicObjects.gfx_cursor, 0, main.screenBD, MouseControl.mousePosX, MouseControl.mousePosY);
}
public static function CountInstallations():int{
var _local1:int;
var _local2:GameObj;
_local1 = 0;
for each (_local2 in GameObjects.objs) {
if (((_local2.active) && (_local2.colFlag_isInstallation))){
_local1++;
};
};
return (_local1);
}
public static function GenerateEnemies():void{
UpdateWaveDefs();
}
public static function ShowCursor(){
Mouse.show();
}
public static function InitLevelState(_arg1:int){
var _local2:Particle;
var _local3:GameObj;
levelState = _arg1;
levelStateTimer = 0;
if (levelState == levelState_LevelStart){
levelStateTimer = (Defs.fps * 2);
};
if (levelState == levelState_Play){
};
if (levelState == levelState_BonusTime){
levelStateTimer = (Defs.fps * 5);
_local2 = Particles.Add(320, 100);
_local2.InitQuota();
_local2 = Particles.Add(320, 200);
_local2.InitLevelEnds();
};
if (levelState == levelState_EndSequence){
levelStateTimer = (Defs.fps * 2);
goPlayer.PlayerInitEndSequence();
_local3 = GameObjects.AddObj(goPlayer.xpos, goPlayer.ypos, 500);
_local3.InitShipAppearTube();
};
if (levelState == levelState_Dead){
levelStateTimer = (Defs.fps * 3);
_local3 = GameObjects.AddObj(goPlayer.xpos, goPlayer.ypos, 500);
_local3.InitPlayerExplosion();
if (Utils.RandBetweenInt(0, 100) < 10){
SoundPlayer.Play(SoundPlayer.gfx_wtfboom);
} else {
SoundPlayer.Play(SoundPlayer.gfx_bigexplosion);
};
};
}
static function InitEffect(){
var _local1:int;
var _local2:int;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:uint;
var _local16:uint;
var _local17:uint;
if (effectInited){
return;
};
effectInited = true;
map = new BitmapData(effectRad, effectRad, false, 0x7F7F7F);
_local3 = (map.width / 2);
_local4 = (map.height / 2);
map.lock();
_local1 = 0;
while (_local1 < map.width) {
_local2 = 0;
while (_local2 < map.height) {
_local5 = (map.width / 2);
_local6 = (_local3 - Number(_local1));
_local7 = (_local4 - Number(_local2));
_local8 = Number(_local1);
_local9 = Number(_local2);
_local10 = Utils.DistBetweenPoints(0, 0, _local6, _local7);
if (_local10 >= _local5){
map.setPixel(_local1, _local2, 0x7F7F7F);
} else {
_local11 = ((1 / _local5) * _local10);
if (_local11 > 1){
_local11 = 1;
};
if (_local11 < 0){
_local11 = 0;
};
_local11 = (_local11 * 64);
_local12 = Math.atan2(_local7, _local6);
_local13 = (Math.cos(_local12) * _local11);
_local14 = (Math.sin(_local12) * _local11);
_local13 = (_local13 + _local6);
_local14 = (_local14 + _local7);
_local13 = (_local13 + 127);
if (_local13 > 0xFF){
_local13 = 0xFF;
};
if (_local13 < 0){
_local13 = 0;
};
_local14 = (_local14 + 127);
if (_local14 > 0xFF){
_local14 = 0xFF;
};
if (_local14 < 0){
_local14 = 0;
};
_local15 = (uint(_local13) << 16);
_local16 = uint(_local14);
_local17 = (_local15 | _local16);
map.setPixel(_local1, _local2, _local17);
};
_local2++;
};
_local1++;
};
}
static function RenderEffect(){
var _local1:uint;
var _local2:uint;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Point;
var _local8:DisplacementMapFilter;
var _local9:Number;
var _local10:Rectangle;
if (KeyReader.Down(KeyReader.KEY_1)){
offsett--;
trace(offsett);
};
if (KeyReader.Down(KeyReader.KEY_2)){
offsett++;
trace(offsett);
};
InitEffect();
_local1 = (effectRad / 2);
_local2 = (_local1 * 2);
_local3 = (goPlayer.xpos - scrollX);
_local4 = (goPlayer.ypos - scrollY);
_local5 = (_local3 - _local1);
_local6 = (_local4 - _local1);
_local7 = new Point(_local5, _local6);
_local8 = new DisplacementMapFilter();
_local8.mapBitmap = map;
_local8.mapPoint = _local7;
_local8.componentX = BitmapDataChannel.RED;
_local8.componentY = BitmapDataChannel.BLUE;
_local8.scaleX = _local1;
_local8.scaleY = _local1;
_local8.mode = DisplacementMapFilterMode.IGNORE;
_local9 = offsett;
_local10 = new Rectangle((_local3 - _local1), (_local4 - _local1), _local2, _local2);
main.screenBD.applyFilter(main.screenBD, _local10, new Point((_local3 + _local9), (_local4 + _local9)), _local8);
}
public static function GetRandomEdge(_arg1:Number):Point{
var _local2:Point;
_local2 = new Point();
if (Utils.RandBool()){
_local2.x = RandWorldX();
if (Utils.RandBool()){
_local2.y = (0 - _arg1);
} else {
_local2.y = (1000 + _arg1);
};
} else {
_local2.y = RandWorldY();
if (Utils.RandBool()){
_local2.x = (0 - _arg1);
} else {
_local2.x = (1000 + _arg1);
};
};
return (_local2);
}
public static function buttonOverlayClosedPressed(_arg1:MouseEvent){
Overlay_Remove();
InitLevelState(levelState_Play);
}
static function RenderMiniMap(){
var _local1:BitmapData;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Rectangle;
var _local6:GameObj;
_local1 = main.screenBD;
_local2 = 0;
_local3 = 0;
_local4 = 0.05;
_local5 = new Rectangle(_local2, _local3, (1000 * _local4), (1000 * _local4));
_local1.fillRect(_local5, 4286611584);
for each (_local6 in GameObjects.objs) {
if (_local6.active){
if (_local6.colFlag_isEnemy){
_local1.setPixel32((_local6.xpos * _local4), (_local6.ypos * _local4), 4294901760);
};
};
};
_local6 = Game.goPlayer;
_local1.setPixel32((_local6.xpos * _local4), (_local6.ypos * _local4), 4294967295);
}
public static function TestPausePressed(){
if (MouseControl.buttonPressed){
if (MouseControl.mousePosX > (Defs.displayarea_w - 32)){
if (MouseControl.mousePosY > (Defs.displayarea_h - 32)){
if (PauseMenu.IsPaused() == false){
PauseMenu.Pause();
MouseControl.buttonPressed = false;
};
};
};
};
}
static function UpdateScroll(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local1 = 0;
_local2 = goPlayer.xpos;
_local3 = goPlayer.ypos;
_local2 = (_local2 - 320);
_local3 = (_local3 - 240);
scrollX = (scrollX + ((_local2 - scrollX) * 0.4));
scrollY = (scrollY + ((_local3 - scrollY) * 0.4));
if (scrollX < 0){
scrollX = 0;
};
if (scrollY < 0){
scrollY = 0;
};
if (scrollX > scrollMaxX){
scrollX = scrollMaxX;
};
if (scrollY > scrollMaxY){
scrollY = scrollMaxY;
};
}
public static function Init(_arg1:Main){
main = _arg1;
currentScore = 0;
multiplier = 1;
numLevels = 8;
currentLevel = 0;
}
static function Portal_SetAppearPos(_arg1:GameObj):Boolean{
_arg1.xpos = Utils.RandBetweenFloat((scrollX + 50), ((scrollX + Defs.displayarea_w) - 50));
_arg1.ypos = Utils.RandBetweenFloat((scrollY + 50), ((scrollY + Defs.displayarea_h) - 50));
if (Utils.Dist2BetweenPoints(_arg1.xpos, _arg1.ypos, goPlayer.xpos, goPlayer.ypos) < (100 * 100)){
return (false);
};
return (true);
}
public static function InitGame(_arg1:Boolean=false){
var _local2:int;
var _local3:ShopWeapon;
Debug.debugMode = 0;
numLives = 3;
Achievements.InitOnce();
Shop.InitOnce();
polygonList = new Array();
startPoints = new Array();
startPointObjs = new Array();
currentStartPointIndex = 0;
LevelDef1.Init(main);
WaveDefs.InitOnce();
currentLevel = 0;
backgroundBD = new BitmapData(1000, 1000, false, 0);
Stats.InitOnce();
currentScore = 0;
cash = 0;
if (_arg1){
SaveData.Load();
Kong.SubmitStat(Game.currentLevel, "NumLevelsComplete");
_local2 = 0;
for each (_local3 in Shop.weapons) {
if (_local3.owned){
_local2++;
};
};
Kong.SubmitStat(_local2, "NumWeapons");
};
}
public static function GetLevelXml(_arg1:int):XML{
var _local2:XML;
var _local3:int;
var _local4:XML;
_local2 = ExternalData.xml;
_local3 = int(_local2.leveldef.length());
_arg1 = (_arg1 % _local3);
_local4 = _local2.leveldef[_arg1];
return (_local4);
}
static function ScrollToPlayer(){
var _local1:int;
_local1 = 0;
while (_local1 < 100) {
UpdateScroll();
_local1++;
};
}
static function AddCash(_arg1:int){
multiplier = 1;
if (levelState == levelState_BonusTime){
multiplier = 2;
};
cash = (cash + (_arg1 * multiplier));
Stats.levelCash = (Stats.levelCash + (_arg1 * multiplier));
Stats.totalCash = (Stats.totalCash + (_arg1 * multiplier));
}
public static function HideCursor(){
Mouse.hide();
}
public static function InitDibsSpeech(_arg1:int){
}
public static function GetGOFrame(_arg1:String):int{
var _local2:GameObj;
_local2 = GetGOByName(_arg1);
if (_local2){
return (int(_local2.frame));
};
return (-1);
}
static function RenderBackground(){
var _local1:Number;
var _local2:Number;
_local1 = goBackground.xpos;
_local2 = goBackground.ypos;
main.screenBD.copyPixels(backgroundBD, new Rectangle(0, 0, 1000, 1000), new Point(_local1, _local2), null, null, true);
}
public static function CountActiveEnemies():int{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
while (_local2 < GameObjects.objs.length) {
if ((((GameObjects.objs[_local2].active == true)) && (GameObjects.objs[_local2].colFlag_isEnemy))){
_local1++;
};
_local2++;
};
return (_local1);
}
public static function Overlay_Remove(){
if (overlayMC != null){
main.removeChild(overlayMC);
overlayMC = null;
KeyReader.InitOnce(main.stage);
};
}
public static function InitGenerateEnemies():void{
var _local1:int;
genTimer = 0;
}
public static function RandWorldX():Number{
return (Utils.RandBetweenFloat(0, 1000));
}
public static function RandWorldY():Number{
return (Utils.RandBetweenFloat(0, 1000));
}
static function Render(){
if (pause){
return;
};
RenderBackground();
GameObjects.Render();
Particles.Render(main);
if (levelState == levelState_BonusTime){
DestroyBackground();
};
if (bulletTime != 0){
main.screenBD.applyFilter(main.screenBD, Defs.screenRect, Defs.pointZero, new BlurFilter(8, 8, 1));
goPlayer.Render();
};
RenderPanel();
RenderCursor();
}
public static function UpdateWaveDefs():void{
var _local1:GameObj;
var _local2:WaveDef;
if (Game.numEnemiesActive > Game.level.maxEnemiesActive){
return;
};
for each (_local2 in waveDefs) {
if (_local2.active){
if (_local2.state == 0){
_local2.timer++;
if (_local2.timer >= _local2.initialDelay){
_local2.timer = 0;
_local2.state = 1;
_local2.enemyTimer = 0;
};
} else {
if (_local2.state == 1){
_local2.enemyTimer++;
if (_local2.enemyTimer >= _local2.frequency){
_local2.enemyTimer = 0;
_local1 = GameObjects.AddObj(500, 500, 1000);
_local1.InitEnemy(_local2.enemyType);
};
_local2.timer++;
if (_local2.timer > _local2.length){
if (_local2.numRepeats == 0){
_local2.active = false;
} else {
if (_local2.repeatCount < _local2.numRepeats){
_local2.numRepeats++;
_local2.state = 2;
_local2.timer = 0;
} else {
_local2.active = false;
};
};
};
} else {
if (_local2.state == 2){
_local2.timer++;
if (_local2.timer >= _local2.repeatDelay){
_local2.timer = 0;
_local2.state = 1;
_local2.enemyTimer = 0;
};
};
};
};
};
};
}
public static function GetGOByName(_arg1:String):GameObj{
var _local2:GameObj;
for each (_local2 in GameObjects.objs) {
if (((_local2.active) && ((_local2.name == _arg1)))){
return (_local2);
};
};
return (null);
}
public static function Overlay_Show(_arg1:int){
}
static function RenderPanel(){
var _local1:int;
var _local2:int;
var _local3:*;
var _local4:*;
var _local5:String;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:PlayerWeaponGroup;
var _local10:Number;
var _local11:int;
var _local12:Number;
var _local13:int;
_local1 = GraphicObjects.gfx_powerbar;
_local2 = GraphicObjects.gfx_chargebar;
_local3 = 10;
_local4 = 10;
if (levelState == levelState_BonusTime){
};
_local5 = ((("Level: " + int((currentLevel + 1))) + " ") + level.name);
GraphicObjects.RenderStringAt(main.screenBD, GraphicObjects.gfx_font1, 3, 3, _local5, -4);
_local3 = 0;
_local4 = (Defs.displayarea_h - 44);
_local6 = (204 - 61);
GraphicObjects.RenderAt(GraphicObjects.gfx_weaponsoverlay, 0, main.screenBD, _local3, _local4);
_local7 = 0;
for each (_local8 in Shop.equippedWeaponList) {
if (_local8 != -1){
_local9 = playerWeaponGroups[_local8];
_local11 = 0;
_local12 = GraphicObjects.GetNumFrames(_local1);
if (_local9.mode == 0){
_local10 = ((_local12 / Number(_local9.maxShots)) * Number(_local9.shots));
} else {
_local10 = ((_local12 / Number(_local9.reloadTime)) * Number(_local9.timer));
_local10 = (_local12 - _local10);
};
_local13 = int(_local10);
if (_local13 < 0){
_local13 = 0;
};
if (_local13 >= _local12){
_local13 = (_local12 - 1);
};
if (_local9.mode == 0){
GraphicObjects.RenderAt(GraphicObjects.gfx_powerbar, _local13, main.screenBD, (_local3 + 59), (_local4 + 30));
} else {
GraphicObjects.RenderAt(GraphicObjects.gfx_chargebar, _local13, main.screenBD, (_local3 + 59), (_local4 + 30));
};
GraphicObjects.RenderAt(GraphicObjects.gfx_hudweapons, (_local9.frame - 1), main.screenBD, (_local3 + 15), (_local4 + 13));
_local5 = _local9.name;
GraphicObjects.RenderStringAt(main.screenBD, GraphicObjects.gfx_font1, (_local3 + 59), (_local4 + 13), _local5, -4);
if (_local7 == goPlayer.currentWeaponSlotID){
GraphicObjects.RenderAt(GraphicObjects.gfx_hudweaponselector, 0, main.screenBD, _local3, (_local4 + 20));
};
};
_local3 = (_local3 + _local6);
_local7++;
};
_local3 = 500;
if (level.numKillsNeeded < 9999){
_local5 = ((("KILLS: " + level.numKills) + "/") + level.numKillsNeeded);
} else {
_local5 = "BOSS";
};
GraphicObjects.RenderStringAt(main.screenBD, GraphicObjects.gfx_font1, (_local3 + 20), (_local4 + 10), _local5, -4);
_local5 = ("CASH: " + cash);
GraphicObjects.RenderStringAt(main.screenBD, GraphicObjects.gfx_font1, (_local3 + 20), (_local4 + 21), _local5, -4);
_local5 = ("SCORE: " + currentScore);
GraphicObjects.RenderStringAt(main.screenBD, GraphicObjects.gfx_font1, (_local3 + 20), (_local4 + 32), _local5, -4);
}
public static function ExitDibsSpeech(){
}
}
}//package
Section 113
//GameObj (GameObj)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class GameObj {
public var colFlag_isInstallation:Boolean;
public var xvel:Number;
var path:Poly;
public var todir:Number;
public var speed:Number;
public var colFlag_isEnemy:Boolean;
var objectDef:ObjectDef;
var startx:Number;
public var ypos2:Number;
var startz:Number;
var bobAdder:Number;
var hasShadow:Boolean;
public var colFlag_playercanbekilled:Boolean;
var starty:Number;
var doneAction:Boolean;
var currentPathNode:int;
var frame1:Number;
public var movementVec:Vec;
var squareBullet_offCentre:int;
public var visible:Boolean;
var enemyGenMode:int;
public var yvel:Number;
var acc:Number;
public var dir:Number;
public var radius:Number;
public var colFlag_isBullet:Boolean;
public var controlMode:int;
var oscillator:Number;
var isPlayer:Boolean;
var isDead:Boolean;
var EnemyHitByBulletFunctionCallback:Function;
var boss1_DistFromPlayer:Number;
public var shadowRenderFunction:Function;
var bobDistance:Number;
var objectIndex:int;
public var xpos2:Number;
public var colFlag_isPlatform:Boolean;
public var zvel:Number;
var xflip:Boolean;
var EnemyUpdateFunctionCallback:Function;
public var accel:Number;
var currentWeaponSlotID:int;
public var colFlag_killPlayer:Boolean;
var boss3_PathIndex:int;
var currentWeapon:int;
var currentPoly:Poly;
var shotControllers:Array;
public var xacc:Number;
public var count:int;
var minSpeed:Number;
var height:Number;
public var colFlag_isEnemyBullet:Boolean;
var flashTimer:int;
var rotVelMax:Number;
public var colFlag_jumpon:Boolean;
var maxSpeed:Number;
public var dir1:Number;
var scale:Number;
var fireOffsetDir:Number;
var alpha:Number;
public var colFlag_UseRadius:Boolean;
public var yacc:Number;
var beingTracked:Boolean;
var frame:Number;
var healthBarTimer:int;
var shootingFlag:Boolean;
var portal_genFreqency:int;
public var controlIndex:int;
public var subtype:int;
public var oldxpos:Number;
var timer1:Number;
var portal_mode:int;
public var toPosX:Number;
public var toPosY:Number;
var dist:Number;
public var driveVec:Vec;
var prevToPosX:Number;
var prevToPosY:Number;
var main:Main;
public var colFlag_isShop:Boolean;
var bobInitialHeight:Number;
var inFrontZone:Poly;
var currentMaxSpeed:Number;
var portal_genType:String;
public var oldypos:Number;
var instantBullet_TrackedObject:GameObj;
var boss1_AngFromPlayer:Number;
var graphicID:int;
var boss2_counter:int;
var collisionPoly:Poly;
var instantBullet_numObjects:int;
var minFrame:int;
var rotVel:Number;
var yoffset:Number;
public var colFlag_canBeShot:Boolean;
var health:Number;
public var colFlag_isPowerup:Boolean;
var maxFrame:int;
var bulletPlayerWeapon:PlayerWeapon;
public var name:String;
public var toSpeed:Number;
var graphicID1:int;
var bobTimer:Number;
var healthBarRect:Rectangle;
public var colFlag_canBePickedUp:Boolean;
public var colFlag_isCheckpoint:Boolean;
public var origspeed:Number;
var hitEnemyFunction:Function;
var actionTimer:int;
var boss3_numPaths:int;
public var xpos:Number;
public var frameVel:Number;
var xoffset:Number;
public var active:Boolean;
public var tempVec:Vec;
var pathSpeed:Number;
var toOffsetY:Number;
var toOffsetX:Number;
public var type:int;
public var ypos:Number;
var instantAngles:Array;
var timer:Number;
var boss1_RequiredDistFromPlayer:Number;
var bulletTimer:int;
var numWeapons:int;
var flashFlag:Boolean;
public var hitTimer:Number;
var toHeight:Number;
public var renderFunction:Function;
var instantPositions:Array;
public var zpos:Number;
var pickupNumCreds:int;
var allPlayerWeapons:Array;
public var colFlag_isBouncyPad:Boolean;
var heightVar1:Number;
var tailPieces:Array;
var heightVar0:Number;
var playerWeapons:Array;
public var updateFunction:Function;
var isBoss:Boolean;
public var externalVec:Vec;
public var bulletTestCollisionExtraFunction:Function;
var portal_genAmount:int;
public var zpos2:Number;
var usesBulletTime:Boolean;
var timerMax:Number;
var dodgeBullets:Boolean;
var parentObj:GameObj;
var flashTimerMax:int;
var actionList:Array;
var pathPos:Number;
public function GameObj(_arg1, _arg2, _arg3, _arg4:int){
xpos = _arg2;
ypos = _arg3;
zpos = 1;
starty = _arg2;
startx = _arg2;
active = false;
main = _arg1;
zpos = 0;
graphicID = 0;
frame = 0;
frameVel = 0;
controlIndex = 0;
timer = 0;
timer1 = 0;
radius = 14;
minFrame = 0;
maxFrame = 0;
movementVec = new Vec();
externalVec = new Vec();
tempVec = new Vec();
driveVec = new Vec();
objectIndex = _arg4;
healthBarRect = new Rectangle();
}
function RenderCollisionPoly():void{
var _local1:Number;
var _local2:Number;
var _local3:Line;
if ((Debug.debugMode & 4) == 0){
return;
};
if (collisionPoly == null){
return;
};
_local1 = Math.floor(Game.scrollX);
_local2 = Math.floor(Game.scrollY);
for each (_local3 in collisionPoly.lineList) {
Utils.RenderDotLine(main.screenBD, (_local3.x0 - _local1), (_local3.y0 - _local2), (_local3.x1 - _local1), (_local3.y1 - _local2), 100, 4294967295);
};
}
public function UpdateBob(){
var _local1:Number;
bobTimer = (bobTimer + bobAdder);
_local1 = (Math.sin(bobTimer) * bobDistance);
height = (bobInitialHeight + _local1);
}
public function UpdateEnemy_Helicopter(){
var _local1:Number;
var _local2:Poly;
var _local3:Point;
timer1 = (timer1 + xvel);
timer = (timer + yvel);
_local1 = Math.sin(timer);
_local1 = (_local1 + Math.sin(timer1));
_local1 = Utils.NormalizeUnit(_local1);
_local2 = currentPoly;
if (_local2 == null){
return;
};
_local3 = _local2.GetPointOnCatmullRom(_local1);
toPosX = (Game.goPlayer.xpos + _local3.x);
toPosY = (Game.goPlayer.ypos + _local3.y);
xpos = (xpos + ((toPosX - xpos) * 0.005));
ypos = (ypos + ((toPosY - ypos) * 0.005));
dir = Math.atan2((Game.goPlayer.ypos - ypos), (Game.goPlayer.xpos - xpos));
dir1 = (dir1 + 0.4);
}
public function InitEnemy_AccelStraight(){
EnemyUpdateFunctionCallback = UpdateEnemy_AccelStraight;
controlMode = 0;
UpdateEnemy_TurnAndMoveToPoint_GetPosNearPlayer();
SetToRequiredRot();
if (enemyGenMode == 0){
toPosX = Game.goPlayer.xpos;
toPosY = Game.goPlayer.ypos;
SetToRequiredRot();
} else {
movementVec.rot = Utils.RandCircle();
};
movementVec.speed = Utils.RandBetweenFloat(objectDef.NumParamA, objectDef.NumParamB);
accel = Utils.RandBetweenFloat(objectDef.NumParamC, objectDef.NumParamD);
}
function SetWeaponSlot(_arg1:int):void{
if (Shop.equippedWeaponList[_arg1] == -1){
return;
};
if (currentWeaponSlotID == _arg1){
return;
};
currentWeaponSlotID = _arg1;
currentWeapon = Shop.equippedWeaponList[currentWeaponSlotID];
if (currentWeapon >= numWeapons){
currentWeapon = (numWeapons - 1);
};
InitWeaponType(currentWeapon);
}
function UpdateEnemy(){
var _local1:ShotController;
if (EnemyUpdateFunctionCallback != null){
EnemyUpdateFunctionCallback();
};
if (shootingFlag){
for each (_local1 in shotControllers) {
if (_local1.active){
_local1.Update(this);
};
};
};
UpdateActions();
if (!isBoss){
if (IsInWorld(200) == false){
active = false;
};
};
if (flashTimer > 0){
flashTimer--;
};
if (healthBarTimer > 0){
healthBarTimer--;
};
}
function UpdateEnemy_TurnAndMoveToPoint_GetPosNearPlayer(){
var _local1:Point;
_local1 = Utils.RandPointInCircle(50);
toPosX = (Game.goPlayer.xpos + _local1.x);
toPosY = (Game.goPlayer.ypos + _local1.y);
}
public function InitEnemy_RandomlyFlyRoundMap(){
EnemyUpdateFunctionCallback = UpdateEnemy_RandomlyFlyRoundMap;
rotVel = Utils.RandBetweenFloat(objectDef.NumParamA, objectDef.NumParamB);
toSpeed = Utils.RandBetweenFloat(objectDef.NumParamC, objectDef.NumParamD);
speed = 0;
InitEnemyRot_TakeFromPortalDef();
InitBob();
}
function InitWeaponType1(_arg1:int){
var _local2:Number;
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:PlayerWeapon;
var _local7:PlayerWeaponGroup;
_local4 = ((Math.PI * 2) / 8);
_local5 = ((Math.PI * 2) / 6);
_arg1 = Shop.weapons[_arg1].id;
playerWeapons = new Array();
if (_arg1 == 0){
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon00);
_local6.Setup(InitBullet, 0, 5, 20, 1);
playerWeapons.push(_local6);
};
if (_arg1 == 1){
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon01);
_local6.Setup(InitInstantBullet, 0, 40, 10, 1);
_local6.AddCollisionPolyPoint(-60, 0);
_local6.AddCollisionPolyPoint(-60, -500);
_local6.AddCollisionPolyPoint(60, -500);
_local6.AddCollisionPolyPoint(60, 0);
playerWeapons.push(_local6);
};
if (_arg1 == 2){
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon02);
_local6.Setup(InitInstantBullet, 0, 20, 10, 1);
_local6.AddCollisionPolyPoint(-10, 0);
_local6.AddCollisionPolyPoint(-10, -500);
_local6.AddCollisionPolyPoint(10, -500);
_local6.AddCollisionPolyPoint(10, 0);
playerWeapons.push(_local6);
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon02);
_local6.Setup(InitInstantBullet, -0.1, 20, 10, 1);
_local6.AddCollisionPolyPoint(-10, 0);
_local6.AddCollisionPolyPoint(-10, -500);
_local6.AddCollisionPolyPoint(10, -500);
_local6.AddCollisionPolyPoint(10, 0);
playerWeapons.push(_local6);
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon02);
_local6.Setup(InitInstantBullet, 0.1, 20, 10, 1);
_local6.AddCollisionPolyPoint(-10, 0);
_local6.AddCollisionPolyPoint(-10, -500);
_local6.AddCollisionPolyPoint(10, -500);
_local6.AddCollisionPolyPoint(10, 0);
playerWeapons.push(_local6);
};
if (_arg1 == 3){
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_homingbullet);
_local6.Setup(InitHomingBullet, 0, 50, 10, 1);
playerWeapons.push(_local6);
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_homingbullet);
_local6.Setup(InitHomingBullet, (_local4 * 2), 50, 10, 1);
playerWeapons.push(_local6);
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_homingbullet);
_local6.Setup(InitHomingBullet, (_local4 * 4), 50, 10, 1);
playerWeapons.push(_local6);
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_homingbullet);
_local6.Setup(InitHomingBullet, (_local4 * 6), 50, 10, 1);
playerWeapons.push(_local6);
};
if (_arg1 == 4){
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon03);
_local6.Setup(InitBullet, 0, 20, 10, 1);
playerWeapons.push(_local6);
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon03);
_local6.Setup(InitBullet, -0.3, 20, 10, 1);
playerWeapons.push(_local6);
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon03);
_local6.Setup(InitBullet, 0.3, 20, 10, 1);
playerWeapons.push(_local6);
};
if (_arg1 == 5){
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon_fathomer);
_local6.Setup(InitFatHomingBullet, 0, 50, 5, 1);
playerWeapons.push(_local6);
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon_fathomer);
_local6.Setup(InitFatHomingBullet, 0.5, 50, 5, 1);
playerWeapons.push(_local6);
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon_fathomer);
_local6.Setup(InitFatHomingBullet, -0.5, 50, 5, 1);
playerWeapons.push(_local6);
};
if (_arg1 == 6){
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon04);
_local6.Setup(InitBullet_Shockwave, 0, 20, 7, 1);
playerWeapons.push(_local6);
};
if (_arg1 == 7){
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon05);
_local6.Setup(InitInstantBullet_Spline, 0, 100, 7, 1);
playerWeapons.push(_local6);
};
if (_arg1 == 8){
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon_diagonal);
_local6.Setup(InitBullet, (_local4 * 1), 20, 10, 1);
playerWeapons.push(_local6);
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon_diagonal);
_local6.Setup(InitBullet, (_local4 * 3), 20, 10, 1);
playerWeapons.push(_local6);
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon_diagonal);
_local6.Setup(InitBullet, (_local4 * 5), 20, 10, 1);
playerWeapons.push(_local6);
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon_diagonal);
_local6.Setup(InitBullet, (_local4 * 7), 20, 10, 1);
playerWeapons.push(_local6);
};
if (_arg1 == 9){
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon06);
_local6.Setup(InitInstantBullet_FixedTarget, 0, 20, 7, 10);
playerWeapons.push(_local6);
};
if (_arg1 == 10){
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon07);
_local6.Setup(InitBullet_Spiral, 0.1, 20, 7, 10);
playerWeapons.push(_local6);
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon07);
_local6.Setup(InitBullet_Spiral, -0.1, 20, 7, 10);
playerWeapons.push(_local6);
};
if (_arg1 == 11){
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon08);
_local6.Setup(InitBullet_SteppedSquare, 0, 10, 7, 10);
playerWeapons.push(_local6);
};
if (_arg1 == 12){
_local2 = (_local5 * 0.5);
_local3 = 0;
while (_local3 < 6) {
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon_reverse);
_local6.Setup(InitBullet_Reverse, _local2, 10, 7, 1);
playerWeapons.push(_local6);
_local2 = (_local2 + _local5);
_local3++;
};
};
if (_arg1 == 13){
_local3 = 0;
while (_local3 < 4) {
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon09);
_local6.Setup(InitInstantBullet_RandomFlicker, 0, 100, 10, 1);
_local6.AddCollisionPolyPoint(-10, 0);
_local6.AddCollisionPolyPoint(-10, -500);
_local6.AddCollisionPolyPoint(10, -500);
_local6.AddCollisionPolyPoint(10, 0);
playerWeapons.push(_local6);
_local3++;
};
};
if (_arg1 == 14){
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon10);
_local6.Setup(InitBullet_Boomerang, 0, 10, 7, 10);
playerWeapons.push(_local6);
};
if (_arg1 == 15){
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon11);
_local6.Setup(InitBullet_Vortex, 0, 300, 4, 10);
playerWeapons.push(_local6);
};
if (_arg1 == 16){
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon_ricochet);
_local6.Setup(InitBullet_Ricochet, 0, 10, 7, 10);
playerWeapons.push(_local6);
};
if (_arg1 == 17){
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweaponduck);
_local6.Setup(InitBullet_DuckOfDeath, 0, 10, 7, 50);
playerWeapons.push(_local6);
};
if (_arg1 == 18){
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweapon10);
_local6.Setup(InitBullet_BulletTime, 0, 10, 7, 10);
playerWeapons.push(_local6);
};
if (_arg1 == 19){
_local3 = 0;
while (_local3 < 10) {
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweaponshortspread);
_local6.Setup(InitBullet_ShortShield, 0, 10, 7, 10);
playerWeapons.push(_local6);
_local3++;
};
};
if (_arg1 == 20){
_local6 = new PlayerWeapon();
_local6.SetGraphicID(GraphicObjects.gfx_playerweaponBFG);
_local6.Setup(InitBullet_BFG, 0, 50, 4, 10);
playerWeapons.push(_local6);
};
if (Game.playerWeaponGroups != null){
_local7 = Game.playerWeaponGroups[currentWeapon];
if (_local7 != null){
for each (_local6 in playerWeapons) {
_local6.playerWeaponGroup = _local7;
};
};
};
}
function InitPlayer():void{
isDead = false;
height = 100;
isPlayer = true;
objectDef = ObjectDefs.GetObjectDefByExportName("Player");
hasShadow = true;
updateFunction = UpdatePlayer;
renderFunction = RenderPlayer;
frame = 0;
graphicID = GraphicObjects.gfx_player;
yvel = 0;
xvel = 0;
radius = 40;
frame = 0;
bulletTimer = 0;
currentWeapon = 0;
currentWeaponSlotID = 0;
numWeapons = 21;
controlMode = 0;
health = 100;
xpos = 500;
ypos = 500;
movementVec.Set(0, 0);
externalVec.Set(0, 0);
InitAllWeaponTypes();
InitWeaponType(currentWeapon);
}
function RenderPlayer(){
var _local1:Number;
_local1 = dir;
dir = (Math.PI - dir);
dir = (dir + (Math.PI * 0.5));
if (Game.invincibleTimer > 0){
if ((Game.invincibleTimer & 4)){
RenderPreRotated();
};
} else {
RenderPreRotated();
};
dir = _local1;
RenderHealthBar(true);
}
public function InitEnemy(_arg1:String, _arg2:int=0){
var _local3:ShotController;
var _local4:ShotController;
enemyGenMode = _arg2;
usesBulletTime = true;
height = Game.normalHeight;
hasShadow = true;
shotControllers = new Array();
updateFunction = UpdateEnemy;
renderFunction = RenderEnemy;
colFlag_killPlayer = true;
colFlag_canBeShot = true;
colFlag_isEnemy = true;
objectDef = ObjectDefs.GetObjectDefByExportName(_arg1);
graphicID = objectDef.GetAnimIDFromName("idle");
health = objectDef.maxHealth;
radius = 100;
actionTimer = 0;
actionList = new Array();
shootingFlag = true;
for each (_local3 in objectDef.shotControllers) {
_local4 = _local3.clone();
_local4.Reset();
shotControllers.push(_local4);
};
if (objectDef.initFuncName != ""){
var _local5 = this;
_local5[objectDef.initFuncName]();
};
dodgeBullets = objectDef.dodgeFlag;
}
function SetShotControllerActive(_arg1:int, _arg2:Boolean){
if (_arg1 < 0){
return;
};
if (_arg1 >= shotControllers.length){
return;
};
shotControllers[_arg1].active = _arg2;
}
function BulletCollision_SnakeTail(_arg1:GameObj):Boolean{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:int;
var _local6:TailPiece;
var _local7:int;
_local2 = _arg1.xpos;
_local3 = _arg1.ypos;
_local4 = (16 * 16);
_local5 = tailPieces.length;
_local7 = 0;
while (_local7 < _local5) {
_local6 = tailPieces[_local7];
if (Utils.Dist2BetweenPoints(_local6.xpos, _local6.ypos, _local2, _local3) < _local4){
_arg1.health--;
if (_arg1.health <= 0){
_arg1.active = false;
return (true);
};
return (false);
};
_local7++;
};
return (false);
}
function UpdateBullet_Vortex():void{
var _local1:*;
var _local2:GameObj;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
toPosX = Game.mouseMapX;
toPosY = Game.mouseMapY;
movementVec.Set(Math.atan2((toPosY - ypos), (toPosX - xpos)), bulletPlayerWeapon.GetSpeed());
if (controlMode == 0){
xvel = movementVec.GetXComponent();
yvel = movementVec.GetYComponent();
xpos = (xpos + xvel);
ypos = (ypos + yvel);
if (Utils.Dist2BetweenPoints(xpos, ypos, toPosX, toPosY) < (10 * 10)){
xpos = toPosX;
ypos = toPosY;
};
};
_local1 = 300;
for each (_local2 in GameObjects.objs) {
if (((((_local2.active) && (_local2.colFlag_isEnemy))) && (!(_local2.colFlag_isInstallation)))){
_local3 = (xpos + ((Math.cos((Number((timer + _local2.objectIndex)) * 0.2)) * 20) + (_local2.objectIndex & 31)));
_local4 = (ypos + ((Math.sin((Number((timer + _local2.objectIndex)) * 0.2)) * 20) + (_local2.objectIndex & 31)));
_local5 = Utils.DistBetweenPoints(_local3, _local4, _local2.xpos, _local2.ypos);
if (_local5 < _local1){
_local5 = (_local1 - _local5);
_local5 = (_local5 * 0.02);
_local6 = Math.atan2((_local4 - _local2.ypos), (_local3 - _local2.xpos));
_local2.xpos = (_local2.xpos + (Math.cos(_local6) * _local5));
_local2.ypos = (_local2.ypos + (Math.sin(_local6) * _local5));
};
};
};
timer--;
if (timer < 0){
active = false;
};
CycleAnimation();
}
function RenderInstantBullet_Spline():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Poly;
var _local5:Point;
_local1 = Math.floor(Game.scrollX);
_local2 = Math.floor(Game.scrollY);
_local4 = currentPoly;
if (_local4 == null){
return;
};
_local3 = 0;
while (_local3 < 1) {
_local5 = _local4.GetPointOnCatmullRom(_local3);
GraphicObjects.RenderAt(graphicID, frame, main.screenBD, (_local5.x - _local1), (_local5.y - _local2));
_local3 = (_local3 + 0.05);
};
}
function InitShop():void{
objectDef = ObjectDefs.GetObjectDefByExportName("Shop");
graphicID = objectDef.GetAnimIDFromName("idle");
updateFunction = UpdateShop;
graphicID;
colFlag_isShop = true;
yvel = 2;
xvel = 0;
}
function InitEnemyRot_TakeFromPortalDef(){
if (enemyGenMode == 0){
toPosX = Game.goPlayer.xpos;
toPosY = Game.goPlayer.ypos;
SetToRequiredRot();
} else {
movementVec.rot = Utils.RandCircle();
};
}
function InitBoss3Path():void{
var _local1:int;
var _local2:Array;
var _local3:int;
_local1 = boss3_PathIndex;
_local2 = new Array();
if (_local1 == 0){
_local2.push(new Point(400, 400));
_local2.push(new Point(600, 400));
_local2.push(new Point(600, 600));
_local2.push(new Point(400, 600));
};
if (_local1 == 1){
_local2.push(new Point(300, 300));
_local2.push(new Point(400, 700));
_local2.push(new Point(500, 300));
_local2.push(new Point(600, 700));
_local2.push(new Point(700, 300));
_local2.push(new Point(500, 700));
};
if (_local1 == 2){
_local2.push(new Point(500, 500));
_local2.push(new Point(800, 800));
_local2.push(new Point(500, 500));
_local2.push(new Point(200, 800));
_local2.push(new Point(500, 500));
_local2.push(new Point(800, 200));
_local2.push(new Point(500, 500));
_local2.push(new Point(200, 200));
};
currentPoly = new Poly("", 0, _local2[0].x, _local2[0].y);
_local3 = 1;
while (_local3 < _local2.length) {
currentPoly.AddLine(_local2[_local3].x, _local2[_local3].y, _local2[_local3].x, _local2[_local3].y);
_local3++;
};
currentPoly.AddLine(_local2[0].x, _local2[0].y, _local2[0].x, _local2[0].y);
currentPoly.Finish(false);
currentPoly.CalculateCatmullRomLength();
InitEnemy_Path();
}
function UpdateEnemy_Path(){
var _local1:Boolean;
_local1 = Path_GetToPos();
if (_local1){
pathPos = 0;
};
pathPos = (pathPos + pathSpeed);
xpos = toPosX;
ypos = toPosY;
}
public function EnemyHitByBullet(_arg1:GameObj, _arg2:Boolean=false){
var _local3:int;
var _local4:Particle;
var _local5:Number;
var _local6:GameObj;
if (_arg1.hitEnemyFunction != null){
_arg1.hitEnemyFunction(this);
};
_local5 = _arg1.bulletPlayerWeapon.GetDamage();
health = (health - _local5);
if (health > 0){
healthBarTimer = 50;
_arg1.movementVec.speed = (_arg1.movementVec.speed * 0.25);
externalVec.Add(_arg1.movementVec);
_arg1.movementVec.speed = (_arg1.movementVec.speed * 4);
if (externalVec.speed > 1){
externalVec.speed = 1;
};
if (_arg2 == false){
_local4 = Particles.Add((_arg1.xpos + Utils.RandBetweenFloat(-10, 10)), (_arg1.ypos + Utils.RandBetweenFloat(-10, 10)));
} else {
_local4 = Particles.Add((xpos + Utils.RandBetweenFloat(-10, 10)), (ypos + Utils.RandBetweenFloat(-10, 10)));
};
_local4.InitEnemyExplosionNoDie();
_local3 = 0;
while (_local3 < 3) {
_local4 = Particles.Add(xpos, ypos);
_local4.InitEnemyHitShield();
_local3++;
};
} else {
_local3 = 0;
while (_local3 < objectDef.booty_num) {
_local6 = GameObjects.AddObj(xpos, ypos, zpos);
_local6.InitPickup(objectDef.booty_type);
_local6.height = (height - 1);
_local3++;
};
active = false;
beingTracked = false;
RenderToBackground();
Game.AddScore(objectDef.score);
Game.level.numKills++;
Stats.numKills++;
Stats.levelNumKills++;
_local4 = Particles.Add(xpos, ypos);
_local4.InitScore(objectDef.score);
if (Game.levelState == Game.levelState_BonusTime){
_local4 = Particles.Add(xpos, (ypos + 10));
_local4.InitScore(objectDef.score);
};
_local4 = Particles.Add(xpos, ypos);
_local4.InitEnemyExplosion();
_local3 = 0;
while (_local3 < 5) {
_local4 = Particles.Add(xpos, ypos);
_local4.InitEnemyHitShield();
_local3++;
};
SoundPlayer.Play((SoundPlayer.sfx_explosion1 + Utils.RandBetweenInt(0, 2)));
if (isBoss){
Game.BossKilled();
};
};
_arg1.health--;
if (_arg1.health <= 0){
_arg1.active = false;
};
}
function RenderBlockCollision():void{
var _local1:Rectangle;
var _local2:Rectangle;
if ((Debug.debugMode & 4) == 0){
return;
};
if (objectDef == null){
return;
};
if (objectDef.colRects.length == 0){
return;
};
for each (_local2 in objectDef.colRects) {
_local1 = _local2.clone();
_local1.x = (_local1.x + xpos);
_local1.y = (_local1.y + ypos);
_local1.x = (_local1.x - Game.scrollX);
_local1.y = (_local1.y - Game.scrollY);
main.screenBD.fillRect(_local1, 1082163328);
};
for each (_local2 in objectDef.shieldColRects) {
_local1 = _local2.clone();
_local1.x = (_local1.x + xpos);
_local1.y = (_local1.y + ypos);
_local1.x = (_local1.x - Game.scrollX);
_local1.y = (_local1.y - Game.scrollY);
main.screenBD.fillRect(_local1, 1082163200);
};
}
function UpdateBullet_BulletTime():void{
Game.bulletTime = 100;
timer--;
if (timer < 0){
timer = 0;
Game.bulletTime = 0;
active = false;
};
}
function UpdateBullet_Shockwave():void{
var _local1:*;
var _local2:GameObj;
var _local3:Number;
xpos = (xpos + xvel);
ypos = (ypos + yvel);
if (Utils.Dist2BetweenPoints(xpos, ypos, toPosX, toPosY) < (32 * 32)){
_local1 = 0;
while (_local1 < 16) {
_local2 = GameObjects.AddObj(0, 0, (zpos - 10));
_local3 = (((Math.PI * 2) / 16) * _local1);
_local2.InitBullet_ShockwaveBit(this, _local3);
_local1++;
};
active = false;
};
if (IsInWorld(32) == false){
active = false;
};
CycleAnimation();
}
function RenderNormally(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = Math.floor(Game.scrollX);
_local2 = Math.floor(Game.scrollY);
_local3 = (Math.floor(xpos) - _local1);
_local4 = (Math.floor(ypos) - _local2);
GraphicObjects.RenderAt(graphicID, frame, main.screenBD, _local3, (_local4 - (height * 0.1)), false);
RenderHealthBar();
}
public function UpdateEnemy_Boss3Drone(){
var _local1:GameObj;
var _local2:Number;
var _local3:Number;
var _local4:Particle;
_local1 = Game.goPlayer;
if (controlMode == 0){
xpos = (xpos + movementVec.GetXComponent());
ypos = (ypos + movementVec.GetYComponent());
movementVec.Add(driveVec);
if (TimerIncrement(30)){
controlMode = 1;
timer = 0;
};
} else {
if (controlMode == 1){
xpos = (xpos + movementVec.GetXComponent());
ypos = (ypos + movementVec.GetYComponent());
xpos = (xpos + driveVec.GetXComponent());
ypos = (ypos + driveVec.GetYComponent());
movementVec.speed = (movementVec.speed - 0.1);
if (movementVec.speed <= 0){
_local2 = (_local1.xpos - xpos);
_local3 = (_local1.ypos - ypos);
movementVec.Set(Math.atan2(_local3, _local2), 5);
driveVec.Set(Utils.RandCircle(), 0.1);
timer = 0;
controlMode = 0;
};
};
};
if ((timer % 2) == 0){
_local4 = Particles.Add(xpos, ypos);
_local4.InitDuckTrail();
_local4.graphicID = GraphicObjects.gfx_enemyboss3drone;
_local4.xvel = 0;
_local4.yvel = 0;
};
}
function RenderPreRotated(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:int;
_local1 = Math.floor(Game.scrollX);
_local2 = Math.floor(Game.scrollY);
_local3 = (Math.floor(xpos) - _local1);
_local4 = (Math.floor(ypos) - _local2);
_local5 = GraphicObjects.GetNumFrames(graphicID);
_local6 = dir;
_local6 = (_local6 - (Math.PI / 2));
while (_local6 < 0) {
_local6 = (_local6 + (Math.PI * 2));
};
while (_local6 > (Math.PI * 2)) {
_local6 = (_local6 - (Math.PI * 2));
};
_local7 = ((_local5 / (Math.PI * 2)) * _local6);
GraphicObjects.RenderAt(graphicID, _local7, main.screenBD, _local3, (_local4 - (height * 0.1)), false);
}
public function InitEnemy_FollowPlayer2(){
var _local1:Point;
EnemyUpdateFunctionCallback = UpdateEnemy_RotateToPlayer2;
rotVel = Utils.RandBetweenFloat(objectDef.NumParamA, objectDef.NumParamB);
speed = Utils.RandBetweenFloat(objectDef.NumParamC, objectDef.NumParamD);
_local1 = Utils.RandPointInCircle(objectDef.NumParamG);
toOffsetX = _local1.x;
toOffsetY = _local1.y;
toPosX = (Game.goPlayer.xpos + toOffsetX);
toPosY = (Game.goPlayer.ypos + toOffsetY);
timer = (Utils.RandBetweenFloat(objectDef.NumParamE, objectDef.NumParamF) * Defs.fps2);
SetToRequiredRot();
InitBob();
}
public function InitEnemy_Tank(){
var _local1:Point;
EnemyUpdateFunctionCallback = UpdateEnemy_Tank;
movementVec.Set(Utils.RandCircle(), speed);
frame1 = (frame1 + 0.02);
graphicID1 = objectDef.GetAnimIDFromName("turret");
renderFunction = RenderEnemy_Tank;
height = 0;
rotVel = Utils.RandBetweenFloat(objectDef.NumParamA, objectDef.NumParamB);
speed = Utils.RandBetweenFloat(objectDef.NumParamC, objectDef.NumParamD);
_local1 = Game.GetRandomEdge(32);
xpos = _local1.x;
ypos = _local1.y;
toOffsetX = Utils.RandBetweenFloat(-100, 100);
toOffsetY = Utils.RandBetweenFloat(-100, 100);
toPosX = Game.goPlayer.xpos;
toPosY = Game.goPlayer.ypos;
SetToRequiredRot();
}
function InitAllWeaponTypes(){
var _local1:Number;
var _local2:int;
var _local3:Number;
var _local4:Number;
var _local5:PlayerWeapon;
_local3 = ((Math.PI * 2) / 8);
_local4 = ((Math.PI * 2) / 6);
allPlayerWeapons = new Array();
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon00);
_local5.Setup(InitBullet, 0, 5, 20, 1);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon01);
_local5.Setup(InitInstantBullet, 0, 40, 10, 1);
_local5.AddCollisionPolyPoint(-60, 0);
_local5.AddCollisionPolyPoint(-60, -500);
_local5.AddCollisionPolyPoint(60, -500);
_local5.AddCollisionPolyPoint(60, 0);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon02);
_local5.Setup(InitInstantBullet, 0, 20, 10, 1);
_local5.AddCollisionPolyPoint(-10, 0);
_local5.AddCollisionPolyPoint(-10, -500);
_local5.AddCollisionPolyPoint(10, -500);
_local5.AddCollisionPolyPoint(10, 0);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon02);
_local5.Setup(InitInstantBullet, -0.1, 20, 10, 1);
_local5.AddCollisionPolyPoint(-10, 0);
_local5.AddCollisionPolyPoint(-10, -500);
_local5.AddCollisionPolyPoint(10, -500);
_local5.AddCollisionPolyPoint(10, 0);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon02);
_local5.Setup(InitInstantBullet, 0.1, 20, 10, 1);
_local5.AddCollisionPolyPoint(-10, 0);
_local5.AddCollisionPolyPoint(-10, -500);
_local5.AddCollisionPolyPoint(10, -500);
_local5.AddCollisionPolyPoint(10, 0);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_homingbullet);
_local5.Setup(InitHomingBullet, 0, 50, 10, 1);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_homingbullet);
_local5.Setup(InitHomingBullet, (_local3 * 2), 50, 10, 1);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_homingbullet);
_local5.Setup(InitHomingBullet, (_local3 * 4), 50, 10, 1);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_homingbullet);
_local5.Setup(InitHomingBullet, (_local3 * 6), 50, 10, 1);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon03);
_local5.Setup(InitBullet, 0, 20, 10, 1);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon03);
_local5.Setup(InitBullet, -0.3, 20, 10, 1);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon03);
_local5.Setup(InitBullet, 0.3, 20, 10, 1);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon_fathomer);
_local5.Setup(InitFatHomingBullet, 0, 50, 5, 1);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon_fathomer);
_local5.Setup(InitFatHomingBullet, 0.5, 50, 5, 1);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon_fathomer);
_local5.Setup(InitFatHomingBullet, -0.5, 50, 5, 1);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon04);
_local5.Setup(InitBullet_Shockwave, 0, 20, 7, 1);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon05);
_local5.Setup(InitInstantBullet_Spline, 0, 100, 7, 1);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon_diagonal);
_local5.Setup(InitBullet, (_local3 * 1), 20, 10, 1);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon_diagonal);
_local5.Setup(InitBullet, (_local3 * 3), 20, 10, 1);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon_diagonal);
_local5.Setup(InitBullet, (_local3 * 5), 20, 10, 1);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon_diagonal);
_local5.Setup(InitBullet, (_local3 * 7), 20, 10, 1);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon06);
_local5.Setup(InitInstantBullet_FixedTarget, 0, 20, 7, 10);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon07);
_local5.Setup(InitBullet_Spiral, 0.1, 20, 7, 10);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon07);
_local5.Setup(InitBullet_Spiral, -0.1, 20, 7, 10);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon08);
_local5.Setup(InitBullet_SteppedSquare, 0, 10, 7, 10);
allPlayerWeapons.push(_local5);
_local1 = (_local4 * 0.5);
_local2 = 0;
while (_local2 < 6) {
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon_reverse);
_local5.Setup(InitBullet_Reverse, _local1, 10, 7, 1);
allPlayerWeapons.push(_local5);
_local1 = (_local1 + _local4);
_local2++;
};
_local2 = 0;
while (_local2 < 4) {
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon09);
_local5.Setup(InitInstantBullet_RandomFlicker, 0, 100, 10, 1);
_local5.AddCollisionPolyPoint(-10, 0);
_local5.AddCollisionPolyPoint(-10, -500);
_local5.AddCollisionPolyPoint(10, -500);
_local5.AddCollisionPolyPoint(10, 0);
allPlayerWeapons.push(_local5);
_local2++;
};
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon10);
_local5.Setup(InitBullet_Boomerang, 0, 10, 7, 10);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon11);
_local5.Setup(InitBullet_Vortex, 0, 300, 4, 10);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon_ricochet);
_local5.Setup(InitBullet_Ricochet, 0, 10, 7, 10);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweaponduck);
_local5.Setup(InitBullet_DuckOfDeath, 0, 10, 7, 50);
allPlayerWeapons.push(_local5);
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweapon10);
_local5.Setup(InitBullet_BulletTime, 0, 10, 7, 10);
allPlayerWeapons.push(_local5);
_local2 = 0;
while (_local2 < 10) {
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweaponshortspread);
_local5.Setup(InitBullet_ShortShield, 0, 10, 7, 10);
allPlayerWeapons.push(_local5);
_local2++;
};
_local5 = new PlayerWeapon();
_local5.SetGraphicID(GraphicObjects.gfx_playerweaponBFG);
_local5.Setup(InitBullet_BFG, 0, 50, 4, 10);
allPlayerWeapons.push(_local5);
}
public function UpdateEnemy_SplineRoundPlayer_Stepper(){
var _local1:Poly;
var _local2:Point;
timer = (timer + rotVel);
if (timer >= 1){
timer = 0;
};
_local1 = currentPoly;
if (_local1 == null){
return;
};
_local2 = _local1.GetPointOnCatmullRom(timer);
toPosX = (Game.goPlayer.xpos + _local2.x);
toPosY = (Game.goPlayer.ypos + _local2.y);
xpos2 = (xpos2 + ((toPosX - xpos) * 0.005));
ypos2 = (ypos2 + ((toPosY - ypos) * 0.005));
timer1--;
if (timer1 <= 0){
timer1 = 10;
xpos = xpos2;
ypos = ypos2;
dir = Math.atan2((Game.goPlayer.ypos - ypos), (Game.goPlayer.xpos - xpos));
};
}
function IsInWorld(_arg1:Number):Boolean{
if (xpos < (0 - _arg1)){
return (false);
};
if (ypos < (0 - _arg1)){
return (false);
};
if (xpos > (1000 + _arg1)){
return (false);
};
if (ypos > (1000 + _arg1)){
return (false);
};
return (true);
}
function UpdatePickup():void{
if (controlMode == 0){
zvel = (zvel - 1);
if (zvel < -10){
zvel = -10;
};
height = (height + zvel);
};
if (controlMode == 1){
zvel = (zvel + 1);
if (zvel > 10){
zvel = 10;
};
height = (height + zvel);
};
if (height < 0){
height = 0;
zvel = 0;
};
if (height > 99){
height = 99;
zvel = 0;
};
xpos = (xpos + movementVec.GetXComponent());
ypos = (ypos + movementVec.GetYComponent());
movementVec.speed = (movementVec.speed - 0.2);
if (movementVec.speed <= 0){
movementVec.speed = 0;
};
timer--;
if (timer < 0){
active = false;
};
visible = true;
if (timer < Defs.fps){
if ((timer & 2)){
visible = false;
};
};
}
function InitWeaponType(_arg1:int){
var _local2:Number;
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:PlayerWeapon;
var _local7:PlayerWeaponGroup;
_local4 = ((Math.PI * 2) / 8);
_local5 = ((Math.PI * 2) / 6);
_arg1 = Shop.weapons[_arg1].id;
playerWeapons = new Array();
if (_arg1 == 0){
playerWeapons.push(allPlayerWeapons[0]);
};
if (_arg1 == 1){
playerWeapons.push(allPlayerWeapons[1]);
};
if (_arg1 == 2){
playerWeapons.push(allPlayerWeapons[2]);
playerWeapons.push(allPlayerWeapons[3]);
playerWeapons.push(allPlayerWeapons[4]);
};
if (_arg1 == 3){
playerWeapons.push(allPlayerWeapons[5]);
playerWeapons.push(allPlayerWeapons[6]);
playerWeapons.push(allPlayerWeapons[7]);
playerWeapons.push(allPlayerWeapons[8]);
};
if (_arg1 == 4){
playerWeapons.push(allPlayerWeapons[9]);
playerWeapons.push(allPlayerWeapons[10]);
playerWeapons.push(allPlayerWeapons[11]);
};
if (_arg1 == 5){
playerWeapons.push(allPlayerWeapons[12]);
playerWeapons.push(allPlayerWeapons[13]);
playerWeapons.push(allPlayerWeapons[14]);
};
if (_arg1 == 6){
playerWeapons.push(allPlayerWeapons[15]);
};
if (_arg1 == 7){
playerWeapons.push(allPlayerWeapons[16]);
};
if (_arg1 == 8){
playerWeapons.push(allPlayerWeapons[17]);
playerWeapons.push(allPlayerWeapons[18]);
playerWeapons.push(allPlayerWeapons[19]);
playerWeapons.push(allPlayerWeapons[20]);
};
if (_arg1 == 9){
playerWeapons.push(allPlayerWeapons[21]);
};
if (_arg1 == 10){
playerWeapons.push(allPlayerWeapons[22]);
playerWeapons.push(allPlayerWeapons[23]);
};
if (_arg1 == 11){
playerWeapons.push(allPlayerWeapons[24]);
};
if (_arg1 == 12){
playerWeapons.push(allPlayerWeapons[25]);
playerWeapons.push(allPlayerWeapons[26]);
playerWeapons.push(allPlayerWeapons[27]);
playerWeapons.push(allPlayerWeapons[28]);
playerWeapons.push(allPlayerWeapons[29]);
playerWeapons.push(allPlayerWeapons[30]);
};
if (_arg1 == 13){
playerWeapons.push(allPlayerWeapons[31]);
playerWeapons.push(allPlayerWeapons[32]);
playerWeapons.push(allPlayerWeapons[33]);
playerWeapons.push(allPlayerWeapons[34]);
};
if (_arg1 == 14){
playerWeapons.push(allPlayerWeapons[35]);
};
if (_arg1 == 15){
playerWeapons.push(allPlayerWeapons[36]);
};
if (_arg1 == 16){
playerWeapons.push(allPlayerWeapons[37]);
};
if (_arg1 == 17){
playerWeapons.push(allPlayerWeapons[38]);
};
if (_arg1 == 18){
playerWeapons.push(allPlayerWeapons[39]);
};
if (_arg1 == 19){
playerWeapons.push(allPlayerWeapons[40]);
playerWeapons.push(allPlayerWeapons[41]);
playerWeapons.push(allPlayerWeapons[42]);
playerWeapons.push(allPlayerWeapons[43]);
playerWeapons.push(allPlayerWeapons[44]);
playerWeapons.push(allPlayerWeapons[45]);
playerWeapons.push(allPlayerWeapons[46]);
playerWeapons.push(allPlayerWeapons[47]);
playerWeapons.push(allPlayerWeapons[48]);
playerWeapons.push(allPlayerWeapons[49]);
};
if (_arg1 == 20){
playerWeapons.push(allPlayerWeapons[50]);
};
if (Game.playerWeaponGroups != null){
_local7 = Game.playerWeaponGroups[currentWeapon];
if (_local7 != null){
for each (_local6 in playerWeapons) {
_local6.playerWeaponGroup = _local7;
};
};
};
}
function UpdateBullet_DuckOfDeath():void{
var _local1:Number;
var _local2:Number;
var _local3:GameObj;
var _local4:Number;
_local1 = Game.mouseMapX;
_local2 = Game.mouseMapY;
_local3 = Collision.GetNearestEnemy(_local1, _local2);
if (_local3 != null){
toPosX = _local3.xpos;
toPosY = _local3.ypos;
} else {
active = false;
};
_local4 = 0.3;
xpos = (xpos + ((toPosX - xpos) * _local4));
ypos = (ypos + ((toPosY - ypos) * _local4));
DuckOfDeath_AddTailPiece();
timer--;
if (timer < 0){
active = false;
};
}
function InitPlayerDeath():void{
controlMode = 3;
isDead = true;
}
public function Update():void{
oldxpos = xpos;
oldypos = ypos;
if (updateFunction != null){
updateFunction();
};
zpos2 = (zpos - height);
}
public function PickupNearPlayer(_arg1:GameObj):void{
}
function RenderInstantBullet_FixedTarget():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:int;
var _local10:int;
_local1 = Math.floor(Game.scrollX);
_local2 = Math.floor(Game.scrollY);
_local3 = (Math.floor(xpos) - _local1);
_local4 = (Math.floor(ypos) - _local2);
_local5 = 64;
_local6 = Utils.DistBetweenPoints(xpos, ypos, toPosX, toPosY);
_local7 = (_local6 / _local5);
_local7++;
_local8 = (movementVec.rot + (Math.PI * 0.5));
_local9 = int(_local7);
_local10 = 0;
while (_local10 < _local9) {
GraphicObjects.RenderAtRotScaled(graphicID, frame, main.screenBD, _local3, _local4, false, 1, _local8);
_local3 = (_local3 + (movementVec.GetUnitXComponent() * _local5));
_local4 = (_local4 + (movementVec.GetUnitYComponent() * _local5));
_local10++;
};
}
public function Action_Shoot(_arg1:Number){
if (_arg1 == 0){
shootingFlag = false;
};
if (_arg1 == 1){
shootingFlag = true;
};
}
function FirePlayerWeapons(){
var _local1:PlayerWeaponGroup;
var _local2:Boolean;
var _local3:GameObj;
var _local4:PlayerWeapon;
var _local5:Particle;
_local1 = Game.playerWeaponGroups[currentWeapon];
if (_local1.mode != 0){
_local5 = Particles.Add(xpos, ypos);
_local5.InitPlayerNoWeapon(dir);
if (_local1.timer > 50){
SoundPlayer.Play(SoundPlayer.gfx_noshot);
};
return;
};
_local2 = false;
for each (_local4 in playerWeapons) {
_local4.playerWeaponGroup = _local1;
if (_local4.IsActive()){
_local4.fireTimer--;
if (_local4.fireTimer <= 0){
_local2 = true;
_local4.fireTimer = _local4.GetFireRate();
_local3 = GameObjects.AddObj(0, 0, (zpos - 10));
if (_local4.initFunc != null){
_local4.initFunc(_local3, this, _local4);
_local3.height = Game.goPlayer.height;
};
};
};
};
if (_local2){
SoundPlayer.Play(_local1.fireSoundID);
_local1.shots++;
if (_local1.shots >= _local1.maxShots){
_local1.mode = 1;
_local1.timer = 0;
_local1.shots = 0;
};
};
}
function InitTailPieces(_arg1:int, _arg2:int){
var _local3:int;
var _local4:TailPiece;
tailPieces = new Array();
_local3 = 0;
while (_local3 < _arg1) {
_local4 = new TailPiece();
_local4.xpos = (xpos + (_local3 * 10));
_local4.ypos = ypos;
_local4.dir = dir;
_local4.frame = 0;
_local4.graphicID = _arg2;
tailPieces.push(_local4);
_local3++;
};
}
public function UpdateEnemy_Snake(){
var _local1:Number;
movementVec.speed = speed;
toPosX = Game.goPlayer.xpos;
toPosY = Game.goPlayer.ypos;
RotateToRequiredRot(rotVel);
dir = movementVec.rot;
oscillator = (oscillator + objectDef.NumParamG);
_local1 = (Math.sin(oscillator) * objectDef.NumParamH);
tempVec.FromVec(movementVec);
tempVec.AddRot(_local1);
dir = tempVec.rot;
xpos = (xpos + tempVec.GetXComponent());
ypos = (ypos + tempVec.GetYComponent());
UpdateExternalVel();
UpdateTailPieces();
}
function UpdatePlayerExplosion():void{
scale = (scale + yvel);
timer++;
if (timer > Defs.fps){
alpha = (alpha - 0.01);
if (alpha <= 0){
alpha = 0;
active = false;
};
};
}
public function RenderEnemy_SnakeShadow(){
RenderShadowPreRotated();
RenderTailPiecesShadow();
}
public function InitEnemy_SplineRoundPlayer(){
var _local1:Array;
var _local2:Number;
var _local3:Number;
var _local4:int;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Point;
EnemyUpdateFunctionCallback = UpdateEnemy_SplineRoundPlayer;
rotVel = 0.025;
controlMode = 0;
_local1 = new Array();
_local2 = 50;
_local3 = 0;
while (_local3 < (Math.PI * 2)) {
_local5 = Utils.RandBetweenFloat(objectDef.NumParamA, objectDef.NumParamB);
_local6 = (Math.cos(_local3) * _local5);
_local7 = (Math.sin(_local3) * _local5);
_local6 = (_local6 + Utils.RandBetweenFloat(-(_local2), _local2));
_local7 = (_local7 + Utils.RandBetweenFloat(-(_local2), _local2));
_local8 = new Point(_local6, _local7);
_local1.push(_local8);
_local3 = (_local3 + 0.6);
};
_local4 = 0;
currentPoly = new Poly("", 0, _local1[_local4].x, _local1[_local4].y);
_local4 = 1;
while (_local4 < _local1.length) {
currentPoly.AddLine(_local1[_local4].x, _local1[_local4].y, _local1[_local4].x, _local1[_local4].y);
_local4++;
};
currentPoly.Finish(false);
timer = Utils.RandBetweenFloat(0, 1);
rotVel = Utils.RandBetweenFloat(objectDef.NumParamC, objectDef.NumParamD);
}
function PlayerCycleWeaponBackwards():void{
var _local1:int;
_local1 = 0;
while (_local1 < 3) {
currentWeaponSlotID--;
if (currentWeaponSlotID < 0){
currentWeaponSlotID = (3 - 1);
};
if (Shop.equippedWeaponList[currentWeaponSlotID] != -1){
currentWeapon = Shop.equippedWeaponList[currentWeaponSlotID];
if (currentWeapon >= numWeapons){
currentWeapon = (numWeapons - 1);
};
InitWeaponType(currentWeapon);
return;
};
_local1++;
};
}
public function UpdateEnemy_BallsFromEdges(){
dir = 0;
if (height == 0){
if (Utils.RandBetweenInt(0, 1000) < 50){
zvel = 7;
height = 0.1;
};
} else {
zvel = (zvel + -0.1);
height = (height + zvel);
if (height <= 0){
height = 0;
};
};
xpos = (xpos + movementVec.GetXComponent());
ypos = (ypos + movementVec.GetYComponent());
UpdateExternalVel();
if (IsInWorld(64) == false){
active = false;
};
CycleAnimation();
}
function UpdateInstantBullet_FixedTarget():void{
var _local1:GameObj;
xpos = parentObj.xpos;
ypos = parentObj.ypos;
_local1 = instantBullet_TrackedObject;
if ((((_local1.active == false)) || ((_local1.beingTracked == false)))){
active = false;
instantBullet_TrackedObject = null;
return;
};
toPosX = _local1.xpos;
toPosY = _local1.ypos;
movementVec.Set(Math.atan2((toPosY - ypos), (toPosX - xpos)), 1);
if (PlayAnimation()){
_local1.EnemyHitByBullet(this, true);
active = false;
};
}
function UpdateGravity(){
yvel = (yvel + Game.gravity);
if (yvel > 6){
yvel = Game.maxFallSpeed;
};
ypos = (ypos + yvel);
}
function UpdatePlayer():void{
var _local1:Number;
var _local2:Number;
var _local3:Boolean;
var _local4:Boolean;
var _local5:Boolean;
var _local6:Boolean;
var _local7:Boolean;
var _local8:Boolean;
var _local9:Boolean;
var _local10:Boolean;
var _local11:Boolean;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Boolean;
var _local17:int;
var _local18:int;
var _local19:Number;
var _local20:Particle;
oldxpos = xpos;
oldypos = ypos;
_local1 = (MouseControl.mousePosX + Game.scrollX);
_local2 = (MouseControl.mousePosY + Game.scrollY);
dir = (Math.atan2((_local2 - ypos), (_local1 - xpos)) + (Math.PI * 0.5));
if (controlMode == 1){
height = (height + ((100 - height) * 0.1));
return;
};
if (controlMode == 2){
zvel = (zvel + 0.5);
height = (height + zvel);
return;
};
if (controlMode == 3){
dir = (dir + 0.1);
return;
};
_local3 = false;
_local4 = false;
_local5 = false;
_local6 = false;
_local7 = false;
_local8 = false;
_local9 = false;
_local10 = false;
_local11 = false;
if (KeyReader.Down(KeyReader.KEY_LEFT)){
_local3 = true;
};
if (KeyReader.Down(KeyReader.KEY_RIGHT)){
_local4 = true;
};
if (KeyReader.Down(KeyReader.KEY_UP)){
_local5 = true;
};
if (KeyReader.Down(KeyReader.KEY_DOWN)){
_local6 = true;
};
if (KeyReader.Down(KeyReader.KEY_A)){
_local3 = true;
};
if (KeyReader.Down(KeyReader.KEY_D)){
_local4 = true;
};
if (KeyReader.Down(KeyReader.KEY_W)){
_local5 = true;
};
if (KeyReader.Down(KeyReader.KEY_S)){
_local6 = true;
};
if (KeyReader.Pressed(KeyReader.KEY_SPACE)){
_local9 = true;
};
if (KeyReader.Pressed(KeyReader.KEY_Q)){
_local10 = true;
};
if (KeyReader.Pressed(KeyReader.KEY_E)){
_local9 = true;
};
if (MouseControl.buttonPressed){
_local8 = true;
};
if (_local9){
PlayerCycleWeaponForwards();
};
if (_local10){
PlayerCycleWeaponBackwards();
};
tempVec.Set(0, 0);
_local12 = 1;
_local13 = 6;
_local14 = 1;
_local15 = ((Math.PI * 2) / 8);
_local16 = false;
_local17 = -1;
if (_local4){
_local17 = 0;
if (_local5){
_local17 = 7;
};
if (_local6){
_local17 = 1;
};
} else {
if (_local3){
_local17 = 4;
if (_local5){
_local17 = 5;
};
if (_local6){
_local17 = 3;
};
} else {
if (_local5){
_local17 = 6;
} else {
if (_local6){
_local17 = 2;
};
};
};
};
if (_local17 != -1){
tempVec.Set((_local15 * _local17), _local12);
movementVec.Add(tempVec);
if (movementVec.speed > _local13){
movementVec.speed = _local13;
};
} else {
movementVec.speed = (movementVec.speed - _local14);
if (movementVec.speed < 0){
movementVec.speed = 0;
};
};
if (movementVec.speed != 0){
_local19 = 3;
_local18 = 0;
while (_local18 < _local19) {
_local20 = Particles.Add(xpos, ypos);
_local20.InitPlayerThrust(movementVec);
_local18++;
};
};
xpos = (xpos + movementVec.GetXComponent());
ypos = (ypos + movementVec.GetYComponent());
if (xpos < 0){
xpos = 0;
};
if (xpos > 1000){
xpos = 1000;
};
if (ypos < 0){
ypos = 0;
};
if (ypos > (1000 - 50)){
ypos = (1000 - 50);
};
UpdatePlayerWeapons(_local8);
if (_local8){
FirePlayerWeapons();
};
frame = 31;
if (healthBarTimer > 0){
healthBarTimer--;
};
}
public function Init(_arg1:int):void{
var _local2:int;
var _local3:Number;
_local2 = 0;
_local3 = 0;
type = _arg1;
controlMode = _local2;
xvel = _local3;
yvel = _local3;
frame = _local3;
frameVel = _local3;
timer = _local3;
hitTimer = _local3;
flashTimer = _local2;
flashFlag = false;
dir = 0;
todir = 0;
health = 1;
zvel = 0;
name = "";
scale = 1;
objectDef = null;
xflip = false;
updateFunction = null;
renderFunction = null;
shadowRenderFunction = null;
visible = true;
ClearColFlags();
isBoss = false;
hasShadow = false;
beingTracked = false;
instantBullet_TrackedObject = null;
isPlayer = false;
height = 0;
usesBulletTime = false;
collisionPoly = null;
hitEnemyFunction = null;
healthBarTimer = 0;
fireOffsetDir = 0;
dodgeBullets = false;
isDead = false;
bulletTestCollisionExtraFunction = null;
}
public function UpdateEnemy_Tank(){
var _local1:GameObj;
movementVec.speed = speed;
toPosX = (Game.goPlayer.xpos + toOffsetX);
toPosY = (Game.goPlayer.ypos + toOffsetY);
RotateToRequiredRot(rotVel);
dir = movementVec.rot;
xpos = (xpos + movementVec.GetXComponent());
ypos = (ypos + movementVec.GetYComponent());
UpdateExternalVel();
_local1 = Game.goPlayer;
dir1 = Math.atan2((_local1.ypos - ypos), (_local1.xpos - xpos));
fireOffsetDir = (dir1 - (Math.PI * 0.5));
}
public function InitEnemy_FollowPlayer_AdjustRotvelByDist(){
EnemyUpdateFunctionCallback = FollowPlayer_AdjustRotvelByDist;
rotVel = Utils.RandBetweenFloat(objectDef.NumParamA, objectDef.NumParamB);
rotVelMax = Utils.RandBetweenFloat(objectDef.NumParamE, objectDef.NumParamF);
speed = Utils.RandBetweenFloat(objectDef.NumParamC, objectDef.NumParamD);
InitEnemyRot_TakeFromPortalDef();
InitBob();
}
function UpdateInstantBullet_Streaky():void{
var _local1:GameObj;
var _local2:int;
xpos = parentObj.xpos;
ypos = parentObj.ypos;
dir = parentObj.dir;
movementVec.Set(((parentObj.dir + bulletPlayerWeapon.GetFireAngle()) - (Math.PI * 0.5)), bulletPlayerWeapon.GetSpeed());
_local1 = instantBullet_TrackedObject;
if ((((_local1.active == false)) || ((_local1.beingTracked == false)))){
active = false;
instantBullet_TrackedObject = null;
};
instantBullet_numObjects = 0;
_local2 = 0;
do {
toPosX = _local1.xpos;
toPosY = _local1.ypos;
RotateToRequiredRot(0.1);
dir = movementVec.rot;
xpos = (xpos + movementVec.GetXComponent());
ypos = (ypos + movementVec.GetYComponent());
instantPositions[_local2] = new Point(xpos, ypos);
instantAngles[_local2] = dir;
_local2++;
instantBullet_numObjects++;
if (Utils.Dist2BetweenPoints(xpos, ypos, _local1.xpos, _local1.ypos) < (30 * 30)){
_local2 = 9999;
};
} while (_local2 < 100);
timer--;
if (timer <= 0){
active = false;
};
}
public function FollowPlayer_AdjustRotvelByDist(){
var _local1:GameObj;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local1 = Game.goPlayer;
movementVec.speed = speed;
toPosX = _local1.xpos;
toPosY = _local1.ypos;
_local2 = rotVel;
_local3 = rotVelMax;
_local4 = objectDef.NumParamG;
_local5 = objectDef.NumParamH;
_local6 = Utils.DistBetweenPoints(xpos, ypos, toPosX, toPosY);
_local6 = Utils.LimitNumber(_local4, _local5, _local6);
_local7 = Utils.ScaleTo(_local2, _local3, _local4, _local5, _local6);
RotateToRequiredRot(_local7);
dir = movementVec.rot;
xpos = (xpos + movementVec.GetXComponent());
ypos = (ypos + movementVec.GetYComponent());
UpdateExternalVel();
UpdateBob();
}
public function UpdateEnemy_SplineRoundPlayer(){
var _local1:Poly;
var _local2:Point;
timer = (timer + rotVel);
if (timer >= 1){
timer = 0;
};
_local1 = currentPoly;
if (_local1 == null){
return;
};
_local2 = _local1.GetPointOnCatmullRom(timer);
toPosX = (Game.goPlayer.xpos + _local2.x);
toPosY = (Game.goPlayer.ypos + _local2.y);
xpos = (xpos + ((toPosX - xpos) * 0.005));
ypos = (ypos + ((toPosY - ypos) * 0.005));
dir = Math.atan2((Game.goPlayer.ypos - ypos), (Game.goPlayer.xpos - xpos));
}
function PlayerInitEndSequence():void{
zvel = 0;
controlMode = 2;
isDead = true;
}
function UpdatePlayerWeapons(_arg1:Boolean){
var _local2:int;
var _local3:PlayerWeaponGroup;
var _local4:PlayerWeapon;
var _local5:Number;
_local2 = 0;
for each (_local3 in Game.playerWeaponGroups) {
if (_local3.mode == 0){
if (((!((_local2 == currentWeapon))) || ((_arg1 == false)))){
_local5 = (Number(_local3.maxShots) / Number(_local3.reloadTime));
_local5 = (_local5 * 0.5);
_local3.shots = (_local3.shots - _local5);
if (_local3.shots <= 0){
_local3.shots = 0;
};
};
};
if (_local3.mode == 1){
_local3.timer++;
if (_local3.timer >= _local3.reloadTime){
_local3.mode = 0;
_local3.timer = 0;
_local3.shots = 0;
};
};
_local2++;
};
for each (_local4 in playerWeapons) {
if (_local4.IsActive()){
if (_local4.fireTimer > 0){
_local4.fireTimer--;
};
};
};
}
function RenderShadowNormally(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:int;
_local1 = Math.floor(Game.scrollX);
_local2 = Math.floor(Game.scrollY);
_local3 = (Math.floor(xpos) - _local1);
_local4 = (Math.floor(ypos) - _local2);
_local5 = GraphicObjects.idList[graphicID];
GraphicObjects.graphicobjs[_local5].frames[int(frame)].RenderAtShadow(Game.main.screenBD, _local3, (_local4 + 3), false);
}
function SetStartEdgePosFrom8Way(_arg1:int){
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:Number;
var _local6:Number;
_local2 = new Array();
if (_arg1 == 0){
_local2.push(0);
};
if (_arg1 == 1){
_local2.push(0);
_local2.push(1);
};
if (_arg1 == 2){
_local2.push(1);
};
if (_arg1 == 3){
_local2.push(1);
_local2.push(2);
};
if (_arg1 == 4){
_local2.push(2);
};
if (_arg1 == 5){
_local2.push(2);
_local2.push(3);
};
if (_arg1 == 6){
_local2.push(3);
};
if (_arg1 == 7){
_local2.push(3);
_local2.push(0);
};
_local3 = Utils.RandBetweenInt(0, (_local2.length - 1));
_local4 = _local2[_local3];
_local5 = Utils.RandBetweenFloat(0, 1000);
_local6 = 32;
if (_local4 == 0){
xpos = _local5;
ypos = -(_local6);
};
if (_local4 == 1){
xpos = -(_local6);
ypos = _local5;
};
if (_local4 == 2){
xpos = _local5;
ypos = (1000 + _local6);
};
if (_local4 == 3){
xpos = (1000 + _local6);
ypos = _local5;
};
}
public function CycleAnimation():void{
var _local1:Number;
var _local2:int;
_local1 = frameVel;
_local2 = GraphicObjects.GetNumFrames(graphicID);
frame = (frame + _local1);
if (frame >= _local2){
frame = (frame - _local2);
};
if (frame < 0){
frame = (frame + _local2);
};
}
function RenderShadowPreRotated(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:int;
var _local8:int;
_local1 = Math.floor(Game.scrollX);
_local2 = Math.floor(Game.scrollY);
_local3 = (Math.floor(xpos) - _local1);
_local4 = (Math.floor(ypos) - _local2);
_local5 = GraphicObjects.GetNumFrames(graphicID);
_local6 = dir;
_local6 = (Math.PI - _local6);
if (isPlayer){
_local6 = (_local6 + (Math.PI * 0.5));
};
_local6 = (_local6 - (Math.PI / 2));
while (_local6 < 0) {
_local6 = (_local6 + (Math.PI * 2));
};
while (_local6 > (Math.PI * 2)) {
_local6 = (_local6 - (Math.PI * 2));
};
_local7 = ((_local5 / (Math.PI * 2)) * _local6);
_local8 = GraphicObjects.idList[graphicID];
GraphicObjects.graphicobjs[_local8].frames[_local7].RenderAtShadow(Game.main.screenBD, _local3, (_local4 + 3), false);
}
function SetAnim(_arg1:int){
var _local2:int;
graphicID = _arg1;
_local2 = (GraphicObjects.GetNumFrames(graphicID) - 1);
if (frame >= _local2){
frame = 0;
};
}
public function UpdateEnemy_FollowPlayer_FlyLike(){
var _local1:Number;
timer--;
if (timer <= 0){
UpdateEnemy_FollowPlayer_FlyLike_GetNewToPos();
};
_local1 = 0.1;
xpos = (xpos + ((toPosX - xpos) * _local1));
ypos = (ypos + ((toPosY - ypos) * _local1));
height = (height + ((toHeight - height) * 0.1));
dir = movementVec.rot;
UpdateExternalVel();
}
function UpdateTailPieces():void{
var _local1:Number;
var _local2:Number;
var _local3:int;
var _local4:TailPiece;
var _local5:int;
var _local6:Number;
var _local7:Number;
_local1 = xpos;
_local2 = ypos;
_local3 = tailPieces.length;
_local5 = 0;
while (_local5 < _local3) {
_local4 = tailPieces[_local5];
_local6 = Math.atan2((_local2 - _local4.ypos), (_local1 - _local4.xpos));
_local7 = 20;
_local4.xpos = (_local1 - (Math.cos(_local6) * _local7));
_local4.ypos = (_local2 - (Math.sin(_local6) * _local7));
_local6 = Math.atan2((_local2 - _local4.ypos), (_local1 - _local4.xpos));
_local4.dir = _local6;
_local1 = _local4.xpos;
_local2 = _local4.ypos;
_local5++;
};
}
function UpdateHomingBullet():void{
var _local1:Number;
var _local2:Number;
var _local3:GameObj;
_local1 = Game.mouseMapX;
_local2 = Game.mouseMapY;
_local3 = Collision.GetNearestEnemy(_local1, _local2);
if (_local3 != null){
if (timer1 <= 0){
toPosX = _local3.xpos;
toPosY = _local3.ypos;
RotateToRequiredRot(0.1);
} else {
timer1--;
};
};
dir = (movementVec.rot + (Math.PI * 0.5));
xpos = (xpos + movementVec.GetXComponent());
ypos = (ypos + movementVec.GetYComponent());
if (IsInWorld(64) == false){
active = false;
};
timer--;
if (timer <= 0){
active = false;
};
}
function UpdateBullet_BFG():void{
PlayAnimation();
xpos = (xpos + xvel);
ypos = (ypos + yvel);
if (IsInWorld(32) == false){
active = false;
};
}
function DuckOfDeath_AddTailPiece():void{
var _local1:Particle;
_local1 = Particles.Add(xpos, ypos);
_local1.InitDuckTrail();
}
public function GetObjectDef():ObjectDef{
return (objectDef);
}
function UpdateEnemy_FollowPlayer_FlyLike_GetNewToPos(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local1 = Math.atan2((Game.goPlayer.ypos - ypos), (Game.goPlayer.xpos - xpos));
_local2 = Utils.RandBetweenFloat(objectDef.NumParamA, objectDef.NumParamB);
if (Utils.RandBool()){
_local2 = -(_local2);
};
_local1 = (_local1 + _local2);
_local3 = Utils.RandBetweenFloat(objectDef.NumParamC, objectDef.NumParamD);
movementVec.Set(_local1, _local3);
toPosX = (xpos + movementVec.GetXComponent());
toPosY = (ypos + movementVec.GetYComponent());
timer = (Utils.RandBetweenFloat(objectDef.NumParamE, objectDef.NumParamF) * Defs.fps2);
toHeight = Utils.RandBetweenFloat(20, 170);
}
public function Render():void{
if (visible == false){
return;
};
if (renderFunction != null){
renderFunction();
} else {
RenderNormally();
};
RenderCollisionPoly();
}
public function RenderEnemy_Tank(){
var _local1:Number;
RenderEnemy();
_local1 = dir1;
dir1 = (Math.PI - dir1);
RenderPreRotated1();
dir1 = _local1;
}
public function InitPortal(_arg1:int){
subtype = _arg1;
usesBulletTime = false;
height = 0;
hasShadow = false;
shotControllers = new Array();
updateFunction = UpdatePortal;
renderFunction = RenderNormally;
if (subtype == 0){
objectDef = ObjectDefs.GetObjectDefByExportName("Portal");
colFlag_isEnemy = true;
colFlag_isInstallation = true;
health = objectDef.maxHealth;
};
if (subtype == 1){
objectDef = ObjectDefs.GetObjectDefByExportName("Portal1");
visible = false;
hasShadow = false;
};
graphicID = objectDef.GetAnimIDFromName("idle");
timer = Game.portalDef.GetRandomTime();
controlMode = 0;
frame = 0;
frameVel = 1;
}
public function UpdateInstallation(){
if (healthBarTimer > 0){
healthBarTimer--;
};
}
public function UpdateEnemy_FollowPlayerVels(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local1 = speed;
_local2 = -(acc);
if (xpos < Game.goPlayer.xpos){
_local2 = acc;
};
xvel = (xvel + _local2);
if (xvel >= _local1){
xvel = _local1;
};
if (xvel <= -(_local1)){
xvel = -(_local1);
};
_local3 = -(acc);
if (ypos < Game.goPlayer.ypos){
_local3 = acc;
};
yvel = (yvel + _local3);
if (yvel >= _local1){
yvel = _local1;
};
if (yvel <= -(_local1)){
yvel = -(_local1);
};
xpos = (xpos + xvel);
ypos = (ypos + yvel);
dir = (dir + 0.1);
dir = Utils.NormalizeRot(dir);
heightVar0 = (heightVar0 + heightVar1);
height = (Game.normalHeight + (Math.sin(heightVar0) * 30));
}
function UpdateBullet_Ricochet():void{
xvel = movementVec.GetXComponent();
yvel = movementVec.GetYComponent();
xpos = (xpos + xvel);
ypos = (ypos + yvel);
dir = (dir + rotVel);
dir = Utils.NormalizeRot(dir);
timer--;
if (timer < 0){
active = false;
};
}
function UpdateBullet_Reverse():void{
xpos = (xpos + movementVec.GetXComponent());
ypos = (ypos + movementVec.GetYComponent());
if (Utils.Dist2BetweenPoints(xpos, ypos, toPosX, toPosY) < (30 * 30)){
active = false;
};
}
public function InitEnemy_TurnAndMoveToPoint(){
var _local1:Point;
EnemyUpdateFunctionCallback = UpdateEnemy_TurnAndMoveToPoint;
rotVel = Utils.RandBetweenFloat(objectDef.NumParamA, objectDef.NumParamB);
accel = 0.1;
maxSpeed = Utils.RandBetweenFloat(objectDef.NumParamC, objectDef.NumParamD);
minSpeed = 1;
controlMode = 0;
UpdateEnemy_TurnAndMoveToPoint_GetPosNearPlayer();
if (enemyGenMode == 0){
UpdateEnemy_TurnAndMoveToPoint_GetPosNearPlayer();
SetToRequiredRot();
} else {
movementVec.rot = Utils.RandCircle();
_local1 = Utils.RandPointInCircle(200);
toPosX = (xpos + _local1.x);
toPosY = (ypos + _local1.y);
};
controlMode = 1;
speed = 0;
InitBob();
}
function TimerIncrement(_arg1:Number):Boolean{
timer++;
if (timer > _arg1){
return (true);
};
return (false);
}
public function PlayerHitEnemy(_arg1:GameObj){
var _local2:Number;
var _local3:Particle;
var _local4:int;
var _local5:*;
if (Game.invincibleTimer > 0){
return;
};
Game.invincibleTimer = Game.invincibleTimerMax;
healthBarTimer = 50;
_local2 = 20;
if (_local2 > 20){
_local2 = 20;
};
health = (health - _local2);
Stats.levelDamage++;
_local5 = 10;
_local4 = 0;
while (_local4 < _local5) {
_local3 = Particles.Add(xpos, ypos);
_local3.InitBulletHitPlayerNoDie();
_local4++;
};
_arg1.EnemyHitByPlayer(this);
}
function InitPlayerExplosion():void{
xpos = Game.goPlayer.xpos;
ypos = Game.goPlayer.ypos;
scale = 0.01;
yvel = 0.01;
updateFunction = UpdatePlayerExplosion;
renderFunction = RenderRotated;
timer = 0;
alpha = 1;
dir = 0;
frame = 0;
graphicID = GraphicObjects.gfx_bigexplosion;
}
function UpdateBullet_Boomerang():void{
xvel = movementVec.GetXComponent();
yvel = movementVec.GetYComponent();
xpos = (xpos + xvel);
ypos = (ypos + yvel);
timer--;
if (timer < 0){
toPosX = Game.goPlayer.xpos;
toPosY = Game.goPlayer.ypos;
tempVec.Set(Math.atan2((toPosY - ypos), (toPosX - xpos)), 0.1);
movementVec.Add(tempVec);
if (movementVec.speed > 10){
movementVec.speed = 10;
};
timer = 0;
};
timer1--;
if (timer1 < 0){
active = false;
};
if (IsInWorld(100) == false){
active = false;
};
dir = (dir + 0.05);
}
public function PickupPickedUp():void{
var _local1:Particle;
SoundPlayer.Play(SoundPlayer.gfx_pickup);
if (subtype == 0){
Game.AddCash(100);
};
if (subtype == 1){
Game.AddCash(500);
};
if (subtype == 2){
Game.AddCash(1000);
};
active = false;
_local1 = Particles.Add(xpos, ypos);
_local1.InitCollectedPickup();
_local1 = Particles.Add(xpos, ypos);
_local1.InitCash(subtype);
if (Game.levelState == Game.levelState_BonusTime){
_local1 = Particles.Add(xpos, (ypos + 10));
_local1.InitCash(subtype);
};
}
public function GetVelFromDir(_arg1:Number){
xvel = (Math.cos(dir) * _arg1);
yvel = (Math.sin(dir) * _arg1);
}
function UpdateEnemyBullet():void{
xpos = (xpos + xvel);
ypos = (ypos + yvel);
if (IsInWorld(32) == false){
active = false;
};
CycleAnimation();
timer++;
if (timer > 3){
timer = 0;
};
}
function RenderTailPieces():void{
var _local1:Number;
var _local2:Number;
var _local3:int;
var _local4:TailPiece;
var _local5:int;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:int;
_local1 = Math.floor(Game.scrollX);
_local2 = Math.floor(Game.scrollY);
_local3 = tailPieces.length;
_local5 = 0;
while (_local5 < _local3) {
_local4 = tailPieces[_local5];
_local6 = (Math.floor(_local4.xpos) - _local1);
_local7 = (Math.floor(_local4.ypos) - _local2);
_local8 = GraphicObjects.GetNumFrames(_local4.graphicID);
_local9 = _local4.dir;
_local9 = (_local9 + (Math.PI / 2));
_local9 = (Math.PI - _local9);
while (_local9 < 0) {
_local9 = (_local9 + (Math.PI * 2));
};
while (_local9 > (Math.PI * 2)) {
_local9 = (_local9 - (Math.PI * 2));
};
_local10 = ((_local8 / (Math.PI * 2)) * _local9);
GraphicObjects.RenderAt(_local4.graphicID, _local10, main.screenBD, _local6, (_local7 - (height * 0.1)), false);
_local5++;
};
}
public function UpdatePortal_Type1(){
var _local1:GameObj;
if (controlMode == 0){
timer--;
if (timer <= 0){
if (Game.numEnemiesActive > Game.level.maxEnemiesActive){
timer = Game.portalDef.GetRandomTime();
} else {
controlMode = 1;
visible = false;
SoundPlayer.Play(SoundPlayer.gfx_newenemy);
};
};
} else {
if (controlMode == 1){
if (Game.Portal_SetAppearPos(this)){
controlMode = 2;
frame = 0;
visible = true;
};
} else {
if (controlMode == 2){
PlayAnimation();
if (frame >= 30){
controlMode = 3;
timer1 = 0;
timer = 0;
Game.portalDef.GetNextIndex();
portal_mode = Game.portalDef.GetMode();
portal_genType = Game.portalDef.GetName();
portal_genAmount = Utils.RandBetweenInt(Game.portalDef.GetMin(), Game.portalDef.GetMax());
portal_genFreqency = Game.portalDef.GetFrequency();
};
} else {
if (controlMode == 3){
timer++;
if (timer > portal_genFreqency){
timer1++;
if (timer1 <= portal_genAmount){
timer = 0;
_local1 = GameObjects.AddObj(xpos, ypos, 1000);
_local1.InitEnemy(portal_genType, portal_mode);
} else {
controlMode = 4;
};
};
} else {
if (controlMode == 4){
if (PlayAnimation()){
timer = Game.portalDef.GetRandomTime();
controlMode = 0;
frame = 0;
visible = false;
};
};
};
};
};
};
}
public function RenderEnemy_Snake(){
var _local1:Number;
_local1 = dir;
dir = (Math.PI - dir);
RenderPreRotated();
dir = _local1;
RenderTailPieces();
}
function PlayerInitStartSequence():void{
xpos = Game.startPointX;
ypos = Game.startPointY;
height = 10000;
controlMode = 1;
Game.invincibleTimer = (Defs.fps * 3);
}
public function UpdatePortal_Type0(){
var _local1:GameObj;
if (controlMode == 0){
timer--;
if (timer <= 0){
if (Game.numEnemiesActive > Game.level.maxEnemiesActive){
timer = Game.portalDef.GetRandomTime();
} else {
controlMode = 1;
SoundPlayer.Play(SoundPlayer.gfx_portalDoors);
frame = 0;
};
};
} else {
if (controlMode == 1){
PlayAnimation();
if (frame > 65){
controlMode = 2;
timer1 = 0;
timer = 0;
Game.portalDef.GetNextIndex();
portal_mode = Game.portalDef.GetMode();
portal_genType = Game.portalDef.GetName();
portal_genAmount = Utils.RandBetweenInt(Game.portalDef.GetMin(), Game.portalDef.GetMax());
portal_genFreqency = Game.portalDef.GetFrequency();
};
} else {
if (controlMode == 2){
timer++;
if (timer > portal_genFreqency){
timer1++;
if (timer1 <= portal_genAmount){
timer = 0;
_local1 = GameObjects.AddObj(xpos, ypos, 1000);
_local1.InitEnemy(portal_genType, portal_mode);
} else {
controlMode = 3;
SoundPlayer.Play(SoundPlayer.gfx_portalDoors);
};
};
} else {
if (controlMode == 3){
if (PlayAnimation()){
timer = Game.portalDef.GetRandomTime();
controlMode = 0;
frame = 0;
};
};
};
};
};
}
public function UpdateEnemy_Boss1(){
var _local1:GameObj;
var _local2:Number;
var _local3:Number;
var _local4:Point;
var _local5:GameObj;
_local1 = Game.goPlayer;
if (controlMode == 0){
SetShotControllerActive(0, true);
SetShotControllerActive(1, false);
_local2 = (5 * Defs.fps2);
_local3 = Utils.ScaleBetween(0, 40, ((1 / _local2) * timer));
_local4 = Utils.RandPointInCircle(_local3);
xpos = (startx + _local4.x);
ypos = (starty + _local4.y);
timer++;
if (timer >= _local2){
timer = 0;
controlMode = 1;
boss1_DistFromPlayer = Utils.DistBetweenPoints(_local1.xpos, _local1.ypos, xpos, ypos);
boss1_AngFromPlayer = Math.atan2((ypos - _local1.ypos), (xpos - _local1.xpos));
boss1_RequiredDistFromPlayer = 200;
rotVel = 0;
};
} else {
if (controlMode == 1){
SetShotControllerActive(0, false);
SetShotControllerActive(1, true);
timer++;
if (timer < (6 * Defs.fps2)){
rotVel = (rotVel + 0.001);
if (rotVel > 0.05){
rotVel = 0.05;
};
} else {
rotVel = (rotVel - 0.0001);
if (rotVel <= 0){
rotVel = 0;
controlMode = 2;
timer = 0;
timer1 = 0;
};
};
if (timer > (3 * Defs.fps2)){
boss1_RequiredDistFromPlayer = (200 + (Math.sin((timer * 0.1)) * 50));
};
boss1_DistFromPlayer = (boss1_DistFromPlayer + ((boss1_RequiredDistFromPlayer - boss1_DistFromPlayer) * 0.1));
boss1_AngFromPlayer = (boss1_AngFromPlayer + rotVel);
xpos = (_local1.xpos + (Math.cos(boss1_AngFromPlayer) * boss1_DistFromPlayer));
ypos = (_local1.ypos + (Math.sin(boss1_AngFromPlayer) * boss1_DistFromPlayer));
} else {
if (controlMode == 2){
SetShotControllerActive(0, false);
SetShotControllerActive(1, false);
timer++;
if (timer > (8 * Defs.fps2)){
timer = 0;
controlMode = 0;
startx = xpos;
starty = ypos;
};
if (timer < (4 * Defs.fps2)){
timer1++;
if (timer1 > 50){
timer1 = 0;
_local5 = GameObjects.AddObj(xpos, ypos, 1000);
_local5.InitEnemy("EnemyBoss1Piece");
_local5.movementVec.rot = boss1_AngFromPlayer;
_local5 = GameObjects.AddObj(xpos, ypos, 1000);
_local5.InitEnemy("EnemyBoss1Piece");
_local5.movementVec.rot = -(boss1_AngFromPlayer);
boss1_AngFromPlayer = (boss1_AngFromPlayer + 0.4);
};
};
};
};
};
dir = Math.atan2((_local1.ypos - ypos), (_local1.xpos - xpos));
UpdateExternalVel();
}
public function UpdateEnemy_Boss3(){
var _local1:GameObj;
var _local2:int;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:GameObj;
_local1 = Game.goPlayer;
_local4 = (10 * Defs.fps2);
_local5 = (20 * Defs.fps2);
_local6 = (10 * Defs.fps2);
if (controlMode == 0){
SetShotControllerActive(0, true);
SetShotControllerActive(1, false);
pathPos = 0;
Path_GetToPos();
xpos = (xpos + ((toPosX - xpos) * 0.05));
ypos = (ypos + ((toPosY - ypos) * 0.05));
if (TimerIncrement(_local4)){
controlMode = 1;
timer = 0;
};
_local7 = (0.01 + (Math.cos((timer * 0.05)) * 0.015));
dir = (dir + _local7);
} else {
if (controlMode == 1){
SetShotControllerActive(0, false);
SetShotControllerActive(1, true);
UpdateEnemy_Path();
if (TimerIncrement(_local5)){
controlMode = 2;
timer1 = 0;
timer = 0;
};
dir = Math.atan2((_local1.ypos - ypos), (_local1.xpos - xpos));
} else {
if (controlMode == 2){
SetShotControllerActive(0, false);
SetShotControllerActive(1, false);
timer1++;
if (timer1 > 200){
timer1 = 0;
_local8 = GameObjects.AddObj(xpos, ypos, 1000);
_local8.InitEnemy("EnemyBoss3Drone");
};
if (TimerIncrement(_local6)){
boss3_PathIndex++;
boss3_PathIndex = (boss3_PathIndex % boss3_numPaths);
InitBoss3Path();
controlMode = 0;
timer = 0;
};
dir = Math.atan2((_local1.ypos - ypos), (_local1.xpos - xpos));
};
};
};
UpdateExternalVel();
}
public function UpdateEnemy_Boss2(){
var _local1:GameObj;
var _local2:int;
var _local3:Number;
var _local4:Point;
var _local5:GameObj;
_local1 = Game.goPlayer;
if (controlMode == 0){
SetShotControllerActive(0, false);
SetShotControllerActive(1, false);
_local3 = (2 * Defs.fps2);
_local2 = Utils.RandBetweenInt(0, _local3);
visible = false;
if (_local2 < timer){
visible = true;
};
timer++;
if (timer > _local3){
boss2_counter++;
if (boss2_counter > 4){
controlMode = 10;
timer = 0;
toPosX = _local1.xpos;
toPosY = _local1.ypos;
boss2_counter = 0;
} else {
controlMode = 1;
timer = 0;
};
};
} else {
if (controlMode == 1){
_local3 = (2 * Defs.fps2);
SetShotControllerActive(0, true);
SetShotControllerActive(1, false);
visible = true;
timer++;
if (timer > _local3){
controlMode = 2;
timer = 0;
};
} else {
if (controlMode == 2){
SetShotControllerActive(0, false);
SetShotControllerActive(1, false);
_local3 = (2 * Defs.fps2);
_local2 = Utils.RandBetweenInt(0, _local3);
visible = true;
if (_local2 < timer){
visible = false;
};
timer++;
if (timer > _local3){
visible = false;
Boss2_GetRandomPos();
controlMode = 0;
timer = 0;
};
} else {
if (controlMode == 10){
SetShotControllerActive(0, false);
SetShotControllerActive(1, true);
_local3 = 50;
xpos = (xpos + ((toPosX - xpos) * 0.01));
ypos = (ypos + ((toPosY - ypos) * 0.01));
timer++;
if (timer > _local3){
_local4 = Utils.RandPointInCircle(200);
toPosX = (_local1.xpos + _local4.x);
toPosY = (_local1.ypos + _local4.y);
timer = 0;
boss2_counter++;
if (boss2_counter > 10){
boss2_counter = 0;
controlMode = 11;
timer = 0;
timer1 = 0;
};
};
} else {
if (controlMode == 11){
SetShotControllerActive(0, false);
SetShotControllerActive(1, false);
_local3 = (6 * Defs.fps2);
if (timer < (3 * Defs.fps2)){
timer1++;
if (timer1 > 25){
timer1 = 0;
_local5 = GameObjects.AddObj(xpos, ypos, 1000);
_local5.InitEnemy("EnemyBoss2Drone");
};
};
timer++;
if (timer > _local3){
boss2_counter = 0;
controlMode = 2;
timer = 0;
timer1 = 0;
};
};
};
};
};
};
dir = Math.atan2((_local1.ypos - ypos), (_local1.xpos - xpos));
UpdateExternalVel();
}
function ClearColFlags(){
colFlag_jumpon = false;
colFlag_killPlayer = false;
colFlag_playercanbekilled = false;
colFlag_canBePickedUp = false;
colFlag_canBeShot = false;
colFlag_isBullet = false;
colFlag_isPlatform = false;
colFlag_isPowerup = false;
colFlag_isBouncyPad = false;
colFlag_isCheckpoint = false;
colFlag_isShop = false;
colFlag_isEnemyBullet = false;
colFlag_isEnemy = false;
colFlag_isInstallation = false;
colFlag_UseRadius = false;
}
public function InitEnemy_Boss2Drone(){
startx = xpos;
starty = ypos;
rotVel = -0.05;
yvel = 120;
xacc = 0;
EnemyUpdateFunctionCallback = UpdateEnemy_Boss2Drone;
timer = 0;
controlMode = 0;
}
public function EnemyHitByPlayer(_arg1:GameObj){
var _local2:int;
var _local3:Particle;
var _local4:Number;
var _local5:GameObj;
_local4 = 20;
health = (health - _local4);
if (health > 0){
healthBarTimer = 50;
_local2 = 0;
while (_local2 < 3) {
_local3 = Particles.Add(xpos, ypos);
_local3.InitEnemyHitShield();
_local2++;
};
} else {
_local2 = 0;
while (_local2 < objectDef.booty_num) {
_local5 = GameObjects.AddObj(xpos, ypos, zpos);
_local5.InitPickup(objectDef.booty_type);
_local5.height = (height - 1);
_local2++;
};
active = false;
beingTracked = false;
RenderToBackground();
Game.AddScore(objectDef.score);
Game.level.numKills++;
Stats.numKills++;
Stats.levelNumKills++;
_local3 = Particles.Add(xpos, ypos);
_local3.InitScore(objectDef.score);
if (Game.levelState == Game.levelState_BonusTime){
_local3 = Particles.Add(xpos, (ypos + 10));
_local3.InitScore(objectDef.score);
};
_local3 = Particles.Add(xpos, ypos);
_local3.InitEnemyExplosion();
_local2 = 0;
while (_local2 < 5) {
_local3 = Particles.Add(xpos, ypos);
_local3.InitEnemyHitShield();
_local2++;
};
SoundPlayer.Play((SoundPlayer.sfx_explosion1 + Utils.RandBetweenInt(0, 2)));
if (isBoss){
Game.BossKilled();
};
};
}
public function GetOffsetObjectRectangle():Rectangle{
var _local1:ObjectDef;
var _local2:Rectangle;
_local1 = GetObjectDef();
_local2 = _local1.colRects[0].clone();
_local2.x = (_local2.x + xpos);
_local2.y = (_local2.y + ypos);
return (_local2);
}
function PlayerEndStartSequence():void{
controlMode = 0;
}
function PlayerCycleWeaponForwards():void{
var _local1:int;
_local1 = 0;
while (_local1 < 3) {
currentWeaponSlotID++;
if (currentWeaponSlotID >= 3){
currentWeaponSlotID = 0;
};
if (Shop.equippedWeaponList[currentWeaponSlotID] != -1){
currentWeapon = Shop.equippedWeaponList[currentWeaponSlotID];
if (currentWeapon >= numWeapons){
currentWeapon = (numWeapons - 1);
};
InitWeaponType(currentWeapon);
return;
};
_local1++;
};
}
public function EnemyHitByBulletShielded(_arg1:GameObj){
var _local2:int;
var _local3:Particle;
_arg1.active = false;
_local2 = 0;
while (_local2 < 3) {
_local3 = Particles.Add(_arg1.xpos, _arg1.ypos);
_local3.InitEnemyHitShield();
_local2++;
};
}
function RenderBullet(){
var _local1:Number;
_local1 = dir;
dir = (Math.PI - dir);
dir = (dir - (Math.PI * 0.5));
RenderPreRotated();
dir = _local1;
}
public function InitEnemy_Snake(){
var _local1:int;
bulletTestCollisionExtraFunction = BulletCollision_SnakeTail;
EnemyUpdateFunctionCallback = UpdateEnemy_Snake;
rotVel = Utils.RandBetweenFloat(objectDef.NumParamA, objectDef.NumParamB);
speed = Utils.RandBetweenFloat(objectDef.NumParamC, objectDef.NumParamD);
toPosX = Game.goPlayer.xpos;
toPosY = Game.goPlayer.ypos;
SetToRequiredRot();
_local1 = Utils.RandBetweenInt(objectDef.NumParamE, objectDef.NumParamF);
InitTailPieces(_local1, objectDef.GetAnimIDFromName("tail"));
renderFunction = RenderEnemy_Snake;
shadowRenderFunction = RenderEnemy_SnakeShadow;
oscillator = 0;
}
function UpdateShipAppearTube(){
yvel = (yvel + yacc);
if (yvel < -0.01){
yvel = -0.01;
};
alpha = (alpha + yvel);
if (alpha < 0){
alpha = 0;
active = false;
};
CycleAnimation();
}
function InitShipAppearTube(){
graphicID = GraphicObjects.gfx_shipappeartube;
updateFunction = UpdateShipAppearTube;
frame = 0;
frameVel = 0.5;
height = 0;
renderFunction = RenderWithAlpha;
alpha = 0.1;
ypos = (ypos + 2);
yvel = 0.04;
yacc = -0.001;
}
public function InitBob(){
bobTimer = 0;
bobAdder = Utils.RandBetweenFloat(0.02, 0.05);
bobDistance = Utils.RandBetweenFloat(20, 40);
bobInitialHeight = height;
}
public function InitEnemy_Helicopter(){
InitEnemy_SplineRoundPlayer();
renderFunction = RenderEnemy_Helicopter;
EnemyUpdateFunctionCallback = UpdateEnemy_Helicopter;
dir1 = 0;
frame1 = 0;
graphicID1 = objectDef.GetAnimIDFromName("turret");
timer = Utils.RandCircle();
timer1 = Utils.RandCircle();
xvel = Utils.RandBetweenFloat(0.0005, 0.002);
yvel = Utils.RandBetweenFloat(0.0005, 0.002);
}
function RenderWallCollision():void{
var _local1:int;
var _local2:Number;
var _local3:Number;
var _local4:Number;
if ((Debug.debugMode & 8) == 0){
return;
};
if (objectDef == null){
return;
};
if (objectDef.collisionCircleOffsets.length == 0){
return;
};
_local1 = 0;
while (_local1 < objectDef.collisionCircleOffsets.length) {
_local2 = objectDef.collisionCircleOffsets[_local1].x;
_local3 = objectDef.collisionCircleOffsets[_local1].y;
_local4 = objectDef.collisionCircleRadii[_local1];
_local2 = (_local2 + xpos);
_local2 = (_local2 - Game.scrollX);
_local3 = (_local3 + ypos);
_local3 = (_local3 - Game.scrollY);
Utils.RenderCircle(main.screenBD, _local2, _local3, _local4, 4294967295);
_local1++;
};
}
public function InitEnemy_Portal(){
EnemyUpdateFunctionCallback = UpdatePortal_Type0;
renderFunction = RenderNormally;
controlMode = 0;
colFlag_isInstallation = true;
trace("InitEnemy_PORTAL");
graphicID = objectDef.GetAnimIDFromName("idle");
timer = Game.portalDef.GetRandomTime();
controlMode = 0;
frame = 0;
frameVel = 1;
height = 0;
}
public function PlayerHitEnemyBullet(_arg1:GameObj){
var _local2:Particle;
var _local3:int;
var _local4:*;
if (Game.invincibleTimer > 0){
return;
};
Game.invincibleTimer = Game.invincibleTimerMax;
healthBarTimer = 50;
_arg1.active = false;
health = (health - _arg1.objectDef.maxHealth);
Stats.levelDamage++;
_local4 = 10;
_local3 = 0;
while (_local3 < _local4) {
_local2 = Particles.Add(xpos, ypos);
_local2.InitBulletHitPlayerNoDie();
_local3++;
};
}
function RenderShadow(){
if (shadowRenderFunction != null){
shadowRenderFunction();
return;
};
RenderShadowPreRotated();
}
function InitBackground(_arg1:int):void{
graphicID = (GraphicObjects.gfx_backgroundscroll1 + _arg1);
updateFunction = UpdateBackground;
renderFunction = null;
visible = false;
}
function UpdateBullet_Spiral():void{
xpos = (startx + (Math.cos(xacc) * yacc));
ypos = (starty + (Math.sin(xacc) * yacc));
yacc = (yacc + speed);
timer--;
if (timer < 0){
timer = 0;
};
if (timer == 0){
xacc = (xacc + rotVel);
};
if (yacc > 500){
active = false;
};
}
function RenderInstantBullet_Streaky():void{
var _local1:Number;
var _local2:Number;
var _local3:int;
var _local4:Point;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local1 = Math.floor(Game.scrollX);
_local2 = Math.floor(Game.scrollY);
_local3 = 0;
while (_local3 < instantBullet_numObjects) {
_local4 = instantPositions[_local3];
_local5 = instantAngles[_local3];
_local6 = (Math.floor(_local4.x) - _local1);
_local7 = (Math.floor(_local4.y) - _local2);
GraphicObjects.RenderAt(graphicID, frame, main.screenBD, _local6, _local7, false);
_local3++;
};
}
public function PlayAnimation():Boolean{
var _local1:int;
_local1 = (GraphicObjects.GetNumFrames(graphicID) - 1);
frame = (frame + frameVel);
if (frame >= _local1){
frame = _local1;
return (true);
};
return (false);
}
public function UpdateEnemy_TurnAndMoveToPoint(){
var _local1:Number;
if (controlMode == 0){
if (RotateToRequiredRot(rotVel)){
controlMode = 1;
speed = 0;
};
} else {
if (controlMode == 1){
_local1 = Utils.Dist2BetweenPoints(xpos, ypos, toPosX, toPosY);
if (_local1 < (60 * 60)){
speed = (speed - accel);
if (speed < minSpeed){
speed = minSpeed;
};
} else {
speed = (speed + accel);
if (speed > maxSpeed){
speed = maxSpeed;
};
};
movementVec.speed = speed;
RotateToRequiredRot(rotVel);
xpos = (xpos + movementVec.GetXComponent());
ypos = (ypos + movementVec.GetYComponent());
if (_local1 < (20 * 20)){
UpdateEnemy_TurnAndMoveToPoint_GetPosNearPlayer();
controlMode = 0;
};
};
};
dir = movementVec.rot;
UpdateExternalVel();
UpdateBob();
}
public function GetDirBetween(_arg1, _arg2, _arg3, _arg4):Number{
var _local5:*;
_local5 = Math.atan2((_arg4 - _arg2), (_arg3 - _arg1));
return (_local5);
}
function RotateToRequiredRot(_arg1:Number):Boolean{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = Math.atan2((toPosY - ypos), (toPosX - xpos));
_local3 = (_local2 + (Math.PI / 2));
_local4 = Utils.DotProduct(Math.cos(movementVec.rot), Math.sin(movementVec.rot), Math.cos(_local3), Math.sin(_local3));
if (movementVec.NearRot(_local2, _arg1)){
movementVec.rot = _local2;
return (true);
};
if (_local4 < 0){
movementVec.AddRot(_arg1);
} else {
movementVec.AddRot(-(_arg1));
};
return (false);
}
public function UpdateEnemy_RandomlyFlyRoundMap(){
timer--;
if (timer <= 0){
timer = Utils.RandBetweenInt(50, 100);
toPosX = Utils.RandBetweenFloat(0, 1000);
toPosY = Utils.RandBetweenFloat(0, 1000);
toSpeed = Utils.RandBetweenFloat(objectDef.NumParamC, objectDef.NumParamD);
};
speed = (speed + ((toSpeed - speed) * 0.005));
movementVec.speed = speed;
RotateToRequiredRot(rotVel);
dir = movementVec.rot;
xpos = (xpos + movementVec.GetXComponent());
ypos = (ypos + movementVec.GetYComponent());
UpdateExternalVel();
if (Utils.Dist2BetweenPoints(xpos, ypos, toPosX, toPosY) <= (30 * 30)){
timer = 0;
};
UpdateBob();
}
function MakeCollisionPoly(){
var _local1:Array;
var _local2:Matrix;
var _local3:Point;
_local1 = new Array();
_local2 = new Matrix();
_local2.rotate(movementVec.rot);
_local2.translate(xpos, ypos);
for each (_local3 in bulletPlayerWeapon.collisionPoly) {
_local1.push(_local2.transformPoint(_local3));
};
collisionPoly = Poly.PolyFromPointList(_local1);
}
public function CycleAnimationEx():Boolean{
var _local1:Boolean;
var _local2:*;
_local1 = false;
frame = (frame + frameVel);
_local2 = (maxFrame - minFrame);
if (frame > maxFrame){
frame = minFrame;
_local1 = true;
};
if (frame < minFrame){
frame = maxFrame;
_local1 = true;
};
return (_local1);
}
public function Action_Pause(_arg1:Number){
timer = _arg1;
controlMode = 1;
}
public function UpdatePortal(){
if (subtype == 0){
UpdatePortal_Type0();
};
if (subtype == 1){
UpdatePortal_Type1();
};
if (healthBarTimer > 0){
healthBarTimer--;
};
}
function InitInstantBullet_FixedTarget(_arg1:GameObj, _arg2:GameObj, _arg3:PlayerWeapon):void{
_arg1.bulletPlayerWeapon = _arg3;
_arg1.health = 99999;
_arg1.updateFunction = _arg1.UpdateInstantBullet_FixedTarget;
_arg1.renderFunction = _arg1.RenderInstantBullet_FixedTarget;
_arg1.graphicID = _arg3.graphicID;
_arg1.parentObj = _arg2;
_arg1.frame = 0;
_arg1.frameVel = 1;
_arg1.xpos = _arg1.parentObj.xpos;
_arg1.ypos = _arg1.parentObj.ypos;
_arg1.movementVec.Set((_arg1.parentObj.dir + _arg3.GetFireAngle()), 0);
_arg1.dir = _arg1.movementVec.rot;
_arg1.instantBullet_TrackedObject = Collision.GetNearestEnemy(Game.mouseMapX, Game.mouseMapY);
if (_arg1.instantBullet_TrackedObject == null){
_arg1.active = false;
return;
};
_arg1.instantBullet_TrackedObject.beingTracked = true;
}
function InitInstantBullet_Spline(_arg1:GameObj, _arg2:GameObj, _arg3:PlayerWeapon):void{
_arg1.bulletPlayerWeapon = _arg3;
_arg1.health = 99999;
_arg1.updateFunction = _arg1.UpdateInstantBullet_Spline;
_arg1.renderFunction = _arg1.RenderInstantBullet_Spline;
_arg1.graphicID = _arg3.graphicID;
_arg1.parentObj = _arg2;
_arg1.frame = 0;
_arg1.frameVel = 1;
_arg1.xpos = _arg1.parentObj.xpos;
_arg1.ypos = _arg1.parentObj.ypos;
_arg1.movementVec.Set((_arg1.parentObj.dir + _arg3.GetFireAngle()), 0);
_arg1.dir = _arg1.movementVec.rot;
_arg1.timer = 80;
_arg1.instantPositions = new Array(100);
_arg1.instantAngles = new Array(100);
instantBullet_numObjects = 0;
}
public function InitEnemy_FollowPlayer(){
EnemyUpdateFunctionCallback = UpdateEnemy_RotateToPlayer;
rotVel = Utils.RandBetweenFloat(objectDef.NumParamA, objectDef.NumParamB);
speed = Utils.RandBetweenFloat(objectDef.NumParamC, objectDef.NumParamD);
InitEnemyRot_TakeFromPortalDef();
InitBob();
}
public function InitEnemy_FollowPlayerVels(){
EnemyUpdateFunctionCallback = UpdateEnemy_FollowPlayerVels;
acc = Utils.RandBetweenFloat(objectDef.NumParamA, objectDef.NumParamB);
speed = Utils.RandBetweenFloat(objectDef.NumParamC, objectDef.NumParamD);
heightVar0 = 0;
heightVar1 = Utils.RandBetweenFloat(0.02, 0.1);
}
public function InitEnemy_Boss3Drone(){
var _local1:GameObj;
var _local2:Number;
var _local3:Number;
startx = xpos;
starty = ypos;
rotVel = -0.05;
yvel = 120;
xacc = 0;
EnemyUpdateFunctionCallback = UpdateEnemy_Boss3Drone;
timer = 0;
controlMode = 0;
_local1 = Game.goPlayer;
_local2 = (_local1.xpos - xpos);
_local3 = (_local1.ypos - ypos);
movementVec.Set(Math.atan2(_local3, _local2), 5);
driveVec.Set(Utils.RandCircle(), 0.1);
timer = 0;
}
function RenderToBackground(){
var _local1:Number;
var _local2:Number;
var _local3:BitmapData;
var _local4:int;
_local1 = Math.floor(xpos);
_local2 = Math.floor(ypos);
_local3 = Game.backgroundBD;
_local4 = Utils.RandBetweenInt(0, (GraphicObjects.GetNumFrames(GraphicObjects.gfx_explodemark) - 1));
GraphicObjects.RenderAtColTrans(GraphicObjects.gfx_explodemark, _local4, _local3, _local1, _local2, false, null, "subtract");
}
public function GetObjectRectangle():Rectangle{
var _local1:ObjectDef;
_local1 = GetObjectDef();
return (_local1.colRects[0]);
}
public function RenderEnemy_Helicopter(){
var _local1:Number;
RenderEnemy();
_local1 = dir1;
dir1 = (Math.PI - dir1);
RenderPreRotated1();
dir1 = _local1;
}
function UpdateBackground():void{
xpos = -(Game.scrollX);
ypos = -(Game.scrollY);
}
function Path_GetToPos():Boolean{
var _local1:Boolean;
var _local2:Point;
var _local3:Point;
var _local4:Number;
var _local5:Number;
_local1 = false;
if (pathPos >= currentPoly.GetCatmullRomLength()){
_local1 = true;
};
_local4 = ((1 / currentPoly.GetCatmullRomLength()) * pathPos);
_local3 = currentPoly.GetPointOnCatmullRom(_local4);
_local5 = (_local4 - 0.01);
if (_local5 < 0){
_local5 = 0;
};
_local2 = currentPoly.GetPointOnCatmullRom(_local5);
toPosX = _local3.x;
toPosY = _local3.y;
prevToPosX = _local2.x;
prevToPosY = _local2.y;
return (_local1);
}
function RenderHealthBar(_arg1:Boolean=false){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:*;
if (_arg1 == false){
if (healthBarTimer <= 0){
return;
};
} else {
if (health > 20){
if (healthBarTimer <= 0){
return;
};
};
};
_local2 = Math.floor(Game.scrollX);
_local3 = Math.floor(Game.scrollY);
_local4 = (Math.floor(xpos) - _local2);
_local5 = (Math.floor(ypos) - _local3);
_local4 = (_local4 + 0);
_local5 = (_local5 + -30);
_local5 = (_local5 - (height * 0.1));
_local6 = 20;
_local7 = 3;
_local8 = (_local6 * 0.5);
_local4 = (_local4 - _local8);
healthBarRect.x = _local4;
healthBarRect.y = _local5;
healthBarRect.width = _local6;
healthBarRect.height = _local7;
if (_arg1){
main.screenBD.fillRect(healthBarRect, 4280295520);
} else {
main.screenBD.fillRect(healthBarRect, 4286578688);
};
healthBarRect.x = _local4;
healthBarRect.y = _local5;
healthBarRect.width = ((_local6 / objectDef.maxHealth) * health);
healthBarRect.height = _local7;
if (_arg1){
main.screenBD.fillRect(healthBarRect, 4282401023);
} else {
main.screenBD.fillRect(healthBarRect, 4294901760);
};
}
public function InitEnemy_Installation(){
height = 0;
hasShadow = true;
EnemyUpdateFunctionCallback = UpdateInstallation;
renderFunction = RenderNormally;
colFlag_isEnemy = true;
colFlag_isInstallation = true;
graphicID = objectDef.GetAnimIDFromName("idle");
}
public function InitEnemy9(){
var _local1:int;
var _local2:Number;
EnemyUpdateFunctionCallback = UpdateEnemy9;
speed = Utils.RandBetweenFloat(0.5, 1);
renderFunction = RenderNormally;
frameVel = 0.2;
height = 0;
_local1 = Utils.RandBetweenInt(0, 7);
_local2 = (-(((Math.PI / 4) * Number(_local1))) + (Math.PI / 2));
movementVec.Set(_local2, speed);
SetStartEdgePosFrom8Way(_local1);
minFrame = (frame = (_local1 * 10));
maxFrame = (minFrame + 9);
}
public function InitEnemy_FollowPlayer_FlyLike(){
EnemyUpdateFunctionCallback = UpdateEnemy_FollowPlayer_FlyLike;
UpdateEnemy_FollowPlayer_FlyLike_GetNewToPos();
}
function RenderEnemyBullet(){
RenderNormally();
}
function UpdateBullet_ShockwaveBit():void{
xpos = (xpos + xvel);
ypos = (ypos + yvel);
timer--;
if (timer < 0){
active = false;
};
CycleAnimation();
}
function RenderTailPiecesShadow():void{
var _local1:Number;
var _local2:Number;
var _local3:int;
var _local4:TailPiece;
var _local5:int;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:int;
var _local11:int;
_local1 = Math.floor(Game.scrollX);
_local2 = Math.floor(Game.scrollY);
_local3 = tailPieces.length;
_local5 = 0;
while (_local5 < _local3) {
_local4 = tailPieces[_local5];
_local6 = (Math.floor(_local4.xpos) - _local1);
_local7 = (Math.floor(_local4.ypos) - _local2);
_local8 = GraphicObjects.GetNumFrames(_local4.graphicID);
_local9 = _local4.dir;
_local9 = (_local9 + (Math.PI / 2));
_local9 = (Math.PI - _local9);
while (_local9 < 0) {
_local9 = (_local9 + (Math.PI * 2));
};
while (_local9 > (Math.PI * 2)) {
_local9 = (_local9 - (Math.PI * 2));
};
_local10 = ((_local8 / (Math.PI * 2)) * _local9);
_local11 = GraphicObjects.idList[_local4.graphicID];
GraphicObjects.graphicobjs[_local11].frames[_local10].RenderAtShadow(Game.main.screenBD, _local6, (_local7 + 3), false);
_local5++;
};
}
public function UpdateEnemy_RotateToPlayer2(){
var _local1:Point;
timer--;
if (timer <= 0){
_local1 = Utils.RandPointInCircle(objectDef.NumParamG);
toOffsetX = _local1.x;
toOffsetY = _local1.y;
timer = (Utils.RandBetweenFloat(objectDef.NumParamE, objectDef.NumParamF) * Defs.fps2);
};
movementVec.speed = speed;
toPosX = (Game.goPlayer.xpos + toOffsetX);
toPosY = (Game.goPlayer.ypos + toOffsetY);
RotateToRequiredRot(rotVel);
dir = movementVec.rot;
xpos = (xpos + movementVec.GetXComponent());
ypos = (ypos + movementVec.GetYComponent());
UpdateExternalVel();
UpdateBob();
}
function RenderWithAlpha(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = Math.floor(Game.scrollX);
_local2 = Math.floor(Game.scrollY);
_local3 = (Math.floor(xpos) - _local1);
_local4 = (Math.floor(ypos) - _local2);
GraphicObjects.RenderAtAlpha(graphicID, frame, main.screenBD, _local3, (_local4 - (height * 0.1)), alpha);
}
public function UpdateEnemy_Edge8Way(){
xpos = (xpos + movementVec.GetXComponent());
ypos = (ypos + movementVec.GetYComponent());
UpdateExternalVel();
if (IsInWorld(64) == false){
active = false;
};
CycleAnimationEx();
}
function RenderPreRotated1(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:int;
_local1 = Math.floor(Game.scrollX);
_local2 = Math.floor(Game.scrollY);
_local3 = (Math.floor(xpos) - _local1);
_local4 = (Math.floor(ypos) - _local2);
_local5 = GraphicObjects.GetNumFrames(graphicID1);
_local6 = dir1;
_local6 = (_local6 - (Math.PI / 2));
while (_local6 < 0) {
_local6 = (_local6 + (Math.PI * 2));
};
while (_local6 > (Math.PI * 2)) {
_local6 = (_local6 - (Math.PI * 2));
};
_local7 = ((_local5 / (Math.PI * 2)) * _local6);
GraphicObjects.RenderAt(graphicID1, _local7, main.screenBD, _local3, (_local4 - (height * 0.1)), false);
}
function UpdateExternalVel(){
xpos = (xpos + externalVec.GetXComponent());
ypos = (ypos + externalVec.GetYComponent());
externalVec.speed = (externalVec.speed - 0.25);
if (externalVec.speed <= 0){
externalVec.speed = 0;
};
}
public function InitEnemy_Edge8Way(){
var _local1:int;
var _local2:Number;
EnemyUpdateFunctionCallback = UpdateEnemy_Edge8Way;
speed = Utils.RandBetweenFloat(objectDef.NumParamA, objectDef.NumParamB);
renderFunction = RenderNormally;
shadowRenderFunction = RenderShadowNormally;
frameVel = 0.2;
height = 0;
_local1 = Utils.RandBetweenInt(0, 7);
_local2 = (-(((Math.PI / 4) * Number(_local1))) + (Math.PI / 2));
movementVec.Set(_local2, speed);
SetStartEdgePosFrom8Way(_local1);
minFrame = (frame = (_local1 * 10));
maxFrame = (minFrame + 9);
}
function SetToRequiredRot():void{
var _local1:Number;
_local1 = Math.atan2((toPosY - ypos), (toPosX - xpos));
movementVec.rot = _local1;
}
function UpdateBullet():void{
xpos = (xpos + xvel);
ypos = (ypos + yvel);
if (IsInWorld(32) == false){
active = false;
};
}
function InitInstantBullet_Streaky(_arg1:GameObj, _arg2:GameObj, _arg3:PlayerWeapon):void{
var _local4:Number;
var _local5:Number;
_arg1.bulletPlayerWeapon = _arg3;
_arg1.updateFunction = _arg1.UpdateInstantBullet_Streaky;
_arg1.renderFunction = _arg1.RenderInstantBullet_Streaky;
_arg1.graphicID = _arg3.graphicID;
_arg1.parentObj = _arg2;
_arg1.frame = 0;
_arg1.frameVel = 1;
_arg1.xpos = _arg1.parentObj.xpos;
_arg1.ypos = _arg1.parentObj.ypos;
_arg1.movementVec.Set((_arg1.parentObj.dir + _arg3.GetFireAngle()), 0);
_arg1.dir = _arg1.movementVec.rot;
_arg1.timer = 50;
_arg1.instantPositions = new Array(100);
_arg1.instantAngles = new Array(100);
instantBullet_numObjects = 0;
_local4 = Game.mouseMapX;
_local5 = Game.mouseMapY;
_arg1.instantBullet_TrackedObject = Collision.GetNearestEnemy(_local4, _local5);
if (_arg1.instantBullet_TrackedObject == null){
_arg1.active = false;
return;
};
_arg1.instantBullet_TrackedObject.beingTracked = true;
_arg1.UpdateInstantBullet_Streaky();
}
function InitEnemyBullet(_arg1:ShotController, _arg2:ShotControllerShot, _arg3:GameObj):void{
var _local4:GameObj;
var _local5:Number;
var _local6:Number;
var _local7:Number;
usesBulletTime = true;
objectDef = ObjectDefs.GetObjectDefByExportName(_arg1.type);
colFlag_isEnemyBullet = true;
updateFunction = UpdateEnemyBullet;
renderFunction = RenderEnemyBullet;
graphicID = objectDef.GetAnimIDFromName("idle");
if (_arg2.type == ShotControllerShot.type_atplayer){
_local4 = Game.goPlayer;
_local5 = (_local4.xpos - xpos);
_local6 = (_local4.ypos - ypos);
_local7 = Math.atan2(_local6, _local5);
_local7 = (_local7 + _arg2.offset);
movementVec.Set(_local7, _arg1.speed);
} else {
if (_arg2.type == ShotControllerShot.type_absolute){
_local7 = _arg2.offset;
movementVec.Set(_local7, _arg1.speed);
} else {
if (_arg2.type == ShotControllerShot.type_dir){
_local7 = _arg2.offset;
_local7 = (_local7 + _arg3.dir);
movementVec.Set(_local7, _arg1.speed);
};
};
};
frame = 0;
frameVel = 0.5;
timer = Utils.RandBetweenInt(0, 4);
xvel = movementVec.GetXComponent();
yvel = movementVec.GetYComponent();
}
function InitBullet_ShockwaveBit(_arg1:GameObj, _arg2:Number):void{
bulletPlayerWeapon = _arg1.bulletPlayerWeapon;
colFlag_isBullet = true;
updateFunction = UpdateBullet_ShockwaveBit;
graphicID = _arg1.graphicID;
frame = 0;
frameVel = 1;
xpos = _arg1.xpos;
ypos = _arg1.ypos;
movementVec.Set(_arg2, bulletPlayerWeapon.GetSpeed());
dir = movementVec.rot;
xvel = movementVec.GetXComponent();
yvel = movementVec.GetYComponent();
timer = 10;
}
public function PlayAnimationEx():Boolean{
var _local1:Boolean;
var _local2:*;
_local1 = false;
frame = (frame + frameVel);
_local2 = (maxFrame - minFrame);
if (frame > maxFrame){
if (frame > maxFrame){
frame = maxFrame;
_local1 = true;
};
};
if (frame < minFrame){
frame = minFrame;
_local1 = true;
};
return (_local1);
}
function Anim_FromVel():void{
var _local1:int;
var _local2:Number;
var _local3:Number;
var _local4:*;
_local1 = GraphicObjects.GetNumFrames(graphicID);
_local2 = xvel;
_local3 = yvel;
_local4 = Math.atan2(_local3, _local2);
frame = ((_local1 / (Math.PI * 2)) * -(_local4));
if (frame < 0){
frame = (frame + _local1);
};
if (frame > _local1){
frame = (frame - _local1);
};
frame = (frame + (_local1 / 2));
if (frame > _local1){
frame = (frame - _local1);
};
}
function RenderEnemy(){
var _local1:Number;
_local1 = dir;
dir = (Math.PI - dir);
RenderPreRotated();
dir = _local1;
RenderHealthBar();
}
public function InitEnemy_Boss1(){
isBoss = true;
EnemyUpdateFunctionCallback = UpdateEnemy_Boss1;
rotVel = Utils.RandBetweenFloat(0.05, 0.1);
speed = Utils.RandBetweenFloat(0.5, 1);
toPosX = Game.goPlayer.xpos;
toPosY = Game.goPlayer.ypos;
SetToRequiredRot();
timer = 0;
controlMode = 0;
SetShotControllerActive(0, false);
SetShotControllerActive(1, false);
startx = xpos;
starty = ypos;
}
public function InitEnemy_Boss2(){
isBoss = true;
EnemyUpdateFunctionCallback = UpdateEnemy_Boss2;
rotVel = Utils.RandBetweenFloat(0.05, 0.1);
speed = Utils.RandBetweenFloat(0.5, 1);
toPosX = Game.goPlayer.xpos;
toPosY = Game.goPlayer.ypos;
SetToRequiredRot();
timer = 0;
controlMode = 0;
visible = false;
Boss2_GetRandomPos();
boss2_counter = 0;
}
public function InitEnemy_Boss3(){
isBoss = true;
EnemyUpdateFunctionCallback = UpdateEnemy_Boss3;
rotVel = Utils.RandBetweenFloat(0.05, 0.1);
speed = Utils.RandBetweenFloat(0.5, 1);
toPosX = Game.goPlayer.xpos;
toPosY = Game.goPlayer.ypos;
SetToRequiredRot();
timer = 0;
controlMode = 0;
boss3_PathIndex = 0;
InitBoss3Path();
boss3_numPaths = 3;
}
function RenderBackground():void{
var _local1:Number;
var _local2:Number;
_local1 = Math.floor(xpos);
_local2 = Math.floor(ypos);
GraphicObjects.RenderAt(graphicID, 0, main.screenBD, _local1, _local2);
}
function UpdateShop():void{
ypos = (ypos + yvel);
xpos = (xpos + xvel);
if (ypos >= (Defs.displayarea_h + 32)){
active = false;
};
}
public function InitEnemy_Boss2Drone_Standalone(){
startx = xpos;
starty = ypos;
rotVel = -0.05;
yvel = 1;
xacc = 0;
EnemyUpdateFunctionCallback = UpdateEnemy_Boss2Drone;
timer = 0;
controlMode = 1;
}
function UpdateFatHomingBullet():void{
var _local1:Number;
var _local2:Number;
var _local3:GameObj;
_local1 = Game.mouseMapX;
_local2 = Game.mouseMapY;
_local3 = Collision.GetNearestEnemy(_local1, _local2);
if (_local3 != null){
if (timer1 <= 0){
toPosX = _local3.xpos;
toPosY = _local3.ypos;
RotateToRequiredRot(0.1);
} else {
timer1--;
};
};
dir = (movementVec.rot + (Math.PI * 0.5));
xpos = (xpos + movementVec.GetXComponent());
ypos = (ypos + movementVec.GetYComponent());
if (IsInWorld(64) == false){
active = false;
};
timer--;
if (timer <= 0){
active = false;
};
}
public function InitEnemy_SplineRoundPlayer_Stepper(){
var _local1:Array;
var _local2:Number;
var _local3:Number;
var _local4:int;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Point;
EnemyUpdateFunctionCallback = UpdateEnemy_SplineRoundPlayer_Stepper;
rotVel = 0.025;
controlMode = 0;
_local1 = new Array();
_local2 = 50;
_local3 = 0;
while (_local3 < (Math.PI * 2)) {
_local5 = Utils.RandBetweenFloat(objectDef.NumParamA, objectDef.NumParamB);
_local6 = (Math.cos(_local3) * _local5);
_local7 = (Math.sin(_local3) * _local5);
_local6 = (_local6 + Utils.RandBetweenFloat(-(_local2), _local2));
_local7 = (_local7 + Utils.RandBetweenFloat(-(_local2), _local2));
_local8 = new Point(_local6, _local7);
_local1.push(_local8);
_local3 = (_local3 + 0.6);
};
_local4 = 0;
currentPoly = new Poly("", 0, _local1[_local4].x, _local1[_local4].y);
_local4 = 1;
while (_local4 < _local1.length) {
currentPoly.AddLine(_local1[_local4].x, _local1[_local4].y, _local1[_local4].x, _local1[_local4].y);
_local4++;
};
currentPoly.Finish(false);
timer = Utils.RandBetweenFloat(0, 1);
rotVel = Utils.RandBetweenFloat(objectDef.NumParamC, objectDef.NumParamD);
timer1 = 0;
xpos2 = xpos;
ypos2 = ypos;
}
public function DodgeBullet(_arg1:GameObj){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = (_arg1.xpos - xpos);
_local3 = (_arg1.ypos - ypos);
_local4 = Utils.DistBetweenPoints(xpos, ypos, _arg1.xpos, _arg1.ypos);
if (_local4 < objectDef.dodgeDist){
_local5 = Utils.ScaleTo(objectDef.dodgeMax, objectDef.dodgeMin, 0, objectDef.dodgeDist, _local4);
tempVec.SetAngFromDxDy(_local2, _local3);
tempVec.speed = _local5;
xpos = (xpos - tempVec.GetXComponent());
ypos = (ypos - tempVec.GetYComponent());
};
}
function UpdateBullet_SteppedSquare():void{
var _local1:int;
var _local2:Number;
timer--;
if (timer <= 0){
xpos = (xpos + movementVec.GetXComponent());
ypos = (ypos + movementVec.GetYComponent());
timer = 3;
timer1++;
if (timer1 > 3){
_local1 = Utils.RandBetweenInt(0, 100);
_local2 = (Math.PI * 0.5);
if (squareBullet_offCentre == 0){
if (_local1 < 25){
squareBullet_offCentre = 1;
movementVec.AddRot(_local2);
} else {
if (_local1 < 50){
squareBullet_offCentre = -1;
movementVec.AddRot(-(_local2));
};
};
} else {
if (squareBullet_offCentre == 1){
if (_local1 < 50){
squareBullet_offCentre = 0;
movementVec.AddRot(-(_local2));
};
} else {
if (squareBullet_offCentre == -1){
if (_local1 < 50){
squareBullet_offCentre = 0;
movementVec.AddRot(_local2);
};
};
};
};
};
};
dir = (movementVec.rot + (Math.PI * 0.5));
if (IsInWorld(64) == false){
active = false;
};
}
function Boss2_GetRandomPos(){
xpos = Utils.RandBetweenFloat((Game.scrollX + 50), ((Game.scrollX + Defs.displayarea_w) - 50));
ypos = Utils.RandBetweenFloat((Game.scrollY + 50), ((Game.scrollY + Defs.displayarea_h) - 50));
}
public function UpdateEnemy_AccelStraight(){
movementVec.speed = (movementVec.speed + accel);
xpos = (xpos + movementVec.GetXComponent());
ypos = (ypos + movementVec.GetYComponent());
dir = movementVec.rot;
UpdateExternalVel();
}
function InitPickup(_arg1:int):void{
hasShadow = true;
updateFunction = UpdatePickup;
graphicID = (GraphicObjects.gfx_pickup1 + _arg1);
colFlag_canBePickedUp = true;
subtype = _arg1;
movementVec.Set(Utils.RandCircle(), Utils.RandBetweenFloat(2, 5));
timer = 400;
zvel = 0;
controlMode = 0;
}
function UpdateBullet_Ricochet_HitEnemy(_arg1:GameObj):void{
movementVec.Set(Utils.RandCircle(), bulletPlayerWeapon.GetSpeed());
rotVel = Utils.RandBetweenFloat(-0.2, 0.2);
}
function RenderRotated(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = Math.floor(Game.scrollX);
_local2 = Math.floor(Game.scrollY);
_local3 = (Math.floor(xpos) - _local1);
_local4 = (Math.floor(ypos) - _local2);
GraphicObjects.RenderAtRotScaled(graphicID, frame, main.screenBD, _local3, (_local4 - (height * 0.1)), false, scale, dir);
}
function UpdateActions(){
var _local1:ObjAction;
for each (_local1 in actionList) {
if ((((_local1.done == false)) && ((actionTimer == _local1.time)))){
trace("Action_Pause");
_local1.actionFunction(_local1.param0);
};
};
actionTimer++;
}
public function InitEnemy_BallsFromEdges(){
var _local1:Number;
var _local2:int;
EnemyUpdateFunctionCallback = UpdateEnemy_BallsFromEdges;
speed = Utils.RandBetweenFloat(objectDef.NumParamA, objectDef.NumParamB);
renderFunction = RenderNormally;
frame = 0;
frameVel = 1;
height = 0;
_local2 = int(objectDef.NumParamC);
if (_local2 == 0){
_local1 = Utils.RandBetweenFloat(0.2, 0.3);
if (Utils.RandBetweenInt(0, 1000) < 500){
xpos = -20;
ypos = Game.RandWorldY();
} else {
ypos = (0 - 20);
xpos = Game.RandWorldX();
};
} else {
if (_local2 == 1){
_local1 = Utils.RandBetweenFloat(0.6, 0.7);
if (Utils.RandBetweenInt(0, 1000) < 500){
xpos = (1000 + 20);
ypos = Game.RandWorldY();
} else {
ypos = (0 - 20);
xpos = Game.RandWorldX();
};
} else {
if (_local2 == 2){
frameVel = -1;
_local1 = Utils.RandBetweenFloat(1.3, 1.4);
if (Utils.RandBetweenInt(0, 1000) < 500){
xpos = (1000 + 20);
ypos = Game.RandWorldY();
} else {
ypos = (1000 + 20);
xpos = Game.RandWorldX();
};
} else {
if (_local2 == 3){
frameVel = -1;
_local1 = Utils.RandBetweenFloat(1.7, 1.8);
if (Utils.RandBetweenInt(0, 1000) < 500){
xpos = -20;
ypos = Game.RandWorldY();
} else {
ypos = (1000 + 20);
xpos = Game.RandWorldX();
};
};
};
};
};
movementVec.Set((Math.PI * _local1), speed);
}
public function InitEnemy_Path(){
pathSpeed = 5;
pathPos = 0;
}
function UpdateInstantBullet_RandomFlicker():void{
xpos = parentObj.xpos;
ypos = parentObj.ypos;
MakeCollisionPoly();
Collision.EnemyPointInPolyCollision(collisionPoly, this);
if (PlayAnimation()){
timer--;
if (timer < 0){
active = false;
} else {
movementVec.Set(Utils.RandCircle(), 0);
dir = movementVec.rot;
frame = 0;
};
};
}
function UpdateBullet_ShortShield():void{
xpos = (xpos + movementVec.GetXComponent());
ypos = (ypos + movementVec.GetYComponent());
timer--;
if (timer < 0){
active = false;
};
}
function UpdateInstantBullet():void{
xpos = parentObj.xpos;
ypos = parentObj.ypos;
MakeCollisionPoly();
Collision.EnemyPointInPolyCollision(collisionPoly, this);
if (PlayAnimation()){
active = false;
};
}
public function UpdateEnemy_Boss2Drone(){
xacc = (xacc + rotVel);
xpos = (startx + (Math.sin(xacc) * yvel));
ypos = (starty + (Math.cos(xacc) * yvel));
if (controlMode == 0){
timer++;
if (timer > (Defs.fps2 * 3)){
controlMode = 1;
timer = 0;
};
} else {
if (controlMode == 1){
timer++;
if (timer > (Defs.fps2 * 3)){
active = false;
};
yvel++;
};
};
}
function UpdateInstantBullet_Spline():void{
var _local1:Number;
var _local2:Number;
var _local3:Array;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:int;
var _local9:Number;
var _local10:Number;
var _local11:Array;
var _local12:Matrix;
xpos = parentObj.xpos;
ypos = parentObj.ypos;
_local1 = (MouseControl.mousePosX + Game.scrollX);
_local2 = (MouseControl.mousePosY + Game.scrollY);
toPosX = _local1;
toPosY = _local2;
movementVec.Set((Math.atan2((toPosY - ypos), (toPosX - xpos)) + (Math.PI * 0.5)), 1);
_local3 = new Array();
_local4 = ((toPosX - xpos) / 3);
_local5 = ((toPosY - ypos) / 3);
_local6 = xpos;
_local7 = ypos;
_local3.push(new Point(_local6, _local7));
_local8 = 0;
while (_local8 < 3) {
_local6 = (_local6 + _local4);
_local7 = (_local7 + _local5);
_local3.push(new Point(_local6, _local7));
_local8++;
};
_local9 = Utils.DistBetweenPoints(xpos, ypos, toPosX, toPosY);
_local10 = (_local9 * 0.1);
_local3[1].x = (_local3[1].x + Utils.RandBetweenFloat(-(_local10), _local10));
_local3[1].y = (_local3[1].y + Utils.RandBetweenFloat(-(_local10), _local10));
_local3[2].x = (_local3[2].x + Utils.RandBetweenFloat(-(_local10), _local10));
_local3[2].y = (_local3[2].y + Utils.RandBetweenFloat(-(_local10), _local10));
_local8 = 0;
currentPoly = new Poly("", 0, _local3[_local8].x, _local3[_local8].y);
_local8++;
currentPoly.AddLine(_local3[_local8].x, _local3[_local8].y, _local3[_local8].x, _local3[_local8].y);
_local8++;
currentPoly.AddLine(_local3[_local8].x, _local3[_local8].y, _local3[_local8].x, _local3[_local8].y);
_local8++;
currentPoly.AddLine(_local3[_local8].x, _local3[_local8].y, _local3[_local8].x, _local3[_local8].y);
currentPoly.Finish(false);
_local11 = new Array();
_local12 = new Matrix();
_local12.rotate(movementVec.rot);
_local12.translate(xpos, ypos);
_local11.push(_local12.transformPoint(new Point(-30, 0)));
_local11.push(_local12.transformPoint(new Point(-30, -(_local9))));
_local11.push(_local12.transformPoint(new Point(30, -(_local9))));
_local11.push(_local12.transformPoint(new Point(30, 0)));
collisionPoly = Poly.PolyFromPointList(_local11);
Collision.EnemyPointInPolyCollision(collisionPoly, this);
timer--;
if (timer <= 0){
active = false;
};
}
public function UpdateEnemy_RotateToPlayer(){
movementVec.speed = speed;
toPosX = Game.goPlayer.xpos;
toPosY = Game.goPlayer.ypos;
RotateToRequiredRot(rotVel);
dir = movementVec.rot;
xpos = (xpos + movementVec.GetXComponent());
ypos = (ypos + movementVec.GetYComponent());
UpdateExternalVel();
UpdateBob();
}
public function UpdateEnemy9(){
xpos = (xpos + movementVec.GetXComponent());
ypos = (ypos + movementVec.GetYComponent());
UpdateExternalVel();
if (IsInWorld(64) == false){
active = false;
};
CycleAnimationEx();
}
static function InitBullet_Ricochet(_arg1:GameObj, _arg2:GameObj, _arg3:PlayerWeapon):void{
_arg1.bulletPlayerWeapon = _arg3;
_arg1.health = 5;
_arg1.colFlag_isBullet = true;
_arg1.updateFunction = _arg1.UpdateBullet_Ricochet;
_arg1.renderFunction = _arg1.RenderBullet;
_arg1.graphicID = _arg3.graphicID;
_arg1.parentObj = _arg2;
_arg1.frame = 0;
_arg1.frameVel = 1;
_arg1.xpos = _arg1.parentObj.xpos;
_arg1.ypos = _arg1.parentObj.ypos;
_arg1.toPosX = Game.mouseMapX;
_arg1.toPosY = Game.mouseMapY;
_arg1.movementVec.Set(Math.atan2((_arg1.toPosY - _arg1.ypos), (_arg1.toPosX - _arg1.xpos)), _arg3.GetSpeed());
_arg1.dir = 0;
_arg1.timer = 300;
_arg1.hitEnemyFunction = _arg1.UpdateBullet_Ricochet_HitEnemy;
_arg1.rotVel = Utils.RandBetweenFloat(-0.2, 0.2);
}
static function InitFatHomingBullet(_arg1:GameObj, _arg2:GameObj, _arg3:PlayerWeapon):void{
_arg1.bulletPlayerWeapon = _arg3;
_arg1.graphicID = _arg3.graphicID;
_arg1.colFlag_isBullet = true;
_arg1.updateFunction = _arg1.UpdateFatHomingBullet;
_arg1.renderFunction = _arg1.RenderBullet;
_arg1.parentObj = _arg2;
_arg1.frame = 0;
_arg1.scale = 1;
_arg1.xpos = _arg1.parentObj.xpos;
_arg1.ypos = _arg1.parentObj.ypos;
_arg1.timer = 300;
_arg1.timer1 = 10;
_arg1.movementVec.Set(((_arg1.parentObj.dir + _arg3.GetFireAngle()) - (Math.PI * 0.5)), _arg3.GetSpeed());
}
static function InitInstantBullet_RandomFlicker(_arg1:GameObj, _arg2:GameObj, _arg3:PlayerWeapon):void{
_arg1.bulletPlayerWeapon = _arg3;
_arg1.renderFunction = _arg1.RenderRotated;
_arg1.updateFunction = _arg1.UpdateInstantBullet_RandomFlicker;
_arg1.graphicID = _arg3.graphicID;
_arg1.parentObj = _arg2;
_arg1.frame = 0;
_arg1.frameVel = 1;
_arg1.health = 999999;
_arg1.xpos = _arg1.parentObj.xpos;
_arg1.ypos = _arg1.parentObj.ypos;
_arg1.movementVec.Set(Utils.RandCircle(), 0);
_arg1.dir = _arg1.movementVec.rot;
_arg1.timer = 5;
}
static function InitBullet_Reverse(_arg1:GameObj, _arg2:GameObj, _arg3:PlayerWeapon):void{
_arg1.bulletPlayerWeapon = _arg3;
_arg1.colFlag_isBullet = true;
_arg1.updateFunction = _arg1.UpdateBullet_Reverse;
_arg1.renderFunction = _arg1.RenderBullet;
_arg1.graphicID = _arg3.graphicID;
_arg1.parentObj = _arg2;
_arg1.frame = 0;
_arg1.xpos = Game.mouseMapX;
_arg1.ypos = Game.mouseMapY;
_arg1.toPosX = _arg1.xpos;
_arg1.toPosY = _arg1.ypos;
_arg1.movementVec.Set(((_arg1.parentObj.dir + _arg3.GetFireAngle()) - (Math.PI * 0.5)), -(_arg3.GetSpeed()));
_arg1.dir = _arg1.parentObj.dir;
_arg1.xpos = (_arg1.xpos + (_arg1.movementVec.GetUnitXComponent() * 400));
_arg1.ypos = (_arg1.ypos + (_arg1.movementVec.GetUnitYComponent() * 400));
}
static function InitBullet_Shockwave(_arg1:GameObj, _arg2:GameObj, _arg3:PlayerWeapon):void{
var _local4:Number;
var _local5:Number;
_arg1.bulletPlayerWeapon = _arg3;
_arg1.updateFunction = _arg1.UpdateBullet_Shockwave;
_arg1.graphicID = _arg3.graphicID;
_arg1.parentObj = _arg2;
_arg1.frame = 0;
_arg1.frameVel = 1;
_local4 = Game.mouseMapX;
_local5 = Game.mouseMapY;
_arg1.toPosX = _local4;
_arg1.toPosY = _local5;
_arg1.xpos = _arg1.parentObj.xpos;
_arg1.ypos = _arg1.parentObj.ypos;
_arg1.movementVec.Set(((_arg1.parentObj.dir + _arg3.GetFireAngle()) - (Math.PI * 0.5)), _arg3.GetSpeed());
_arg1.dir = _arg1.parentObj.dir;
_arg1.xvel = _arg1.movementVec.GetXComponent();
_arg1.yvel = _arg1.movementVec.GetYComponent();
}
static function InitBullet(_arg1:GameObj, _arg2:GameObj, _arg3:PlayerWeapon):void{
_arg1.bulletPlayerWeapon = _arg3;
_arg1.renderFunction = _arg1.RenderBullet;
_arg1.colFlag_isBullet = true;
_arg1.updateFunction = _arg1.UpdateBullet;
_arg1.graphicID = _arg3.graphicID;
_arg1.parentObj = _arg2;
_arg1.frame = 0;
_arg1.xpos = _arg1.parentObj.xpos;
_arg1.ypos = _arg1.parentObj.ypos;
_arg1.movementVec.Set(((_arg1.parentObj.dir + _arg3.GetFireAngle()) - (Math.PI * 0.5)), _arg3.GetSpeed());
_arg1.dir = (_arg1.movementVec.rot + (Math.PI * 0.5));
_arg1.xvel = _arg1.movementVec.GetXComponent();
_arg1.yvel = _arg1.movementVec.GetYComponent();
}
static function InitBullet_SteppedSquare(_arg1:GameObj, _arg2:GameObj, _arg3:PlayerWeapon):void{
_arg1.bulletPlayerWeapon = _arg3;
_arg1.colFlag_isBullet = true;
_arg1.updateFunction = _arg1.UpdateBullet_SteppedSquare;
_arg1.renderFunction = _arg1.RenderBullet;
_arg1.graphicID = _arg3.graphicID;
_arg1.parentObj = _arg2;
_arg1.frame = 0;
_arg1.xpos = _arg1.parentObj.xpos;
_arg1.ypos = _arg1.parentObj.ypos;
_arg1.movementVec.Set((_arg1.parentObj.dir - (Math.PI * 0.5)), 40);
_arg1.dir = _arg1.parentObj.dir;
_arg1.timer = 3;
_arg1.timer1 = 0;
_arg1.squareBullet_offCentre = 0;
}
static function InitBullet_Boomerang(_arg1:GameObj, _arg2:GameObj, _arg3:PlayerWeapon):void{
_arg1.bulletPlayerWeapon = _arg3;
_arg1.colFlag_isBullet = true;
_arg1.updateFunction = _arg1.UpdateBullet_Boomerang;
_arg1.renderFunction = _arg1.RenderBullet;
_arg1.graphicID = _arg3.graphicID;
_arg1.parentObj = _arg2;
_arg1.frame = 0;
_arg1.xpos = _arg1.parentObj.xpos;
_arg1.ypos = _arg1.parentObj.ypos;
_arg1.movementVec.Set(((_arg1.parentObj.dir + _arg3.GetFireAngle()) - (Math.PI * 0.5)), _arg3.GetSpeed());
_arg1.dir = _arg1.parentObj.dir;
_arg1.timer = 30;
_arg1.timer1 = 200;
}
static function InitBullet_BFG(_arg1:GameObj, _arg2:GameObj, _arg3:PlayerWeapon):void{
_arg1.bulletPlayerWeapon = _arg3;
_arg1.colFlag_UseRadius = true;
_arg1.radius = 100;
_arg1.colFlag_isBullet = true;
_arg1.updateFunction = _arg1.UpdateBullet_BFG;
_arg1.graphicID = _arg3.graphicID;
_arg1.parentObj = _arg2;
_arg1.frame = 0;
_arg1.health = 1000;
_arg1.timer = 200;
_arg1.frameVel = 0.5;
_arg1.renderFunction = _arg1.RenderNormally;
_arg1.xpos = _arg1.parentObj.xpos;
_arg1.ypos = _arg1.parentObj.ypos;
_arg1.movementVec.Set(((_arg1.parentObj.dir + _arg3.GetFireAngle()) - (Math.PI * 0.5)), _arg3.GetSpeed());
_arg1.dir = 0;
_arg1.xvel = _arg1.movementVec.GetXComponent();
_arg1.yvel = _arg1.movementVec.GetYComponent();
}
static function InitBullet_DuckOfDeath(_arg1:GameObj, _arg2:GameObj, _arg3:PlayerWeapon):void{
_arg1.bulletPlayerWeapon = _arg3;
_arg1.health = 200;
_arg1.colFlag_isBullet = true;
_arg1.updateFunction = _arg1.UpdateBullet_DuckOfDeath;
_arg1.graphicID = _arg3.graphicID;
_arg1.parentObj = _arg2;
_arg1.frame = 0;
_arg1.frameVel = 1;
_arg1.xpos = _arg1.parentObj.xpos;
_arg1.ypos = _arg1.parentObj.ypos;
_arg1.toPosX = Game.mouseMapX;
_arg1.toPosY = Game.mouseMapY;
_arg1.movementVec.Set(Math.atan2((_arg1.toPosY - _arg1.ypos), (_arg1.toPosX - _arg1.xpos)), _arg3.GetSpeed());
_arg1.dir = 0;
_arg1.timer = 300;
}
static function InitBullet_ShortShield(_arg1:GameObj, _arg2:GameObj, _arg3:PlayerWeapon):void{
var _local4:Number;
_arg1.bulletPlayerWeapon = _arg3;
_arg1.colFlag_isBullet = true;
_arg1.graphicID = _arg3.graphicID;
_arg1.parentObj = _arg2;
_arg1.frame = 0;
_arg1.xpos = _arg1.parentObj.xpos;
_arg1.ypos = _arg1.parentObj.ypos;
_arg1.updateFunction = _arg1.UpdateBullet_ShortShield;
_arg1.renderFunction = _arg1.RenderBullet;
_arg1.timer = Utils.RandBetweenInt(6, 6);
_local4 = Utils.RandCircle();
_arg1.movementVec.Set(_local4, Utils.RandBetweenFloat(20, 20));
_arg1.dir = (_arg1.movementVec.rot + (Math.PI * 0.5));
}
static function InitInstantBullet(_arg1:GameObj, _arg2:GameObj, _arg3:PlayerWeapon):void{
_arg1.bulletPlayerWeapon = _arg3;
_arg1.renderFunction = _arg1.RenderRotated;
_arg1.updateFunction = _arg1.UpdateInstantBullet;
_arg1.graphicID = _arg3.graphicID;
_arg1.parentObj = _arg2;
_arg1.frame = 0;
_arg1.frameVel = 1;
_arg1.health = 999999;
_arg1.xpos = _arg1.parentObj.xpos;
_arg1.ypos = _arg1.parentObj.ypos;
_arg1.movementVec.Set((_arg1.parentObj.dir + _arg3.GetFireAngle()), 0);
_arg1.dir = _arg1.movementVec.rot;
}
static function InitBullet_Vortex(_arg1:GameObj, _arg2:GameObj, _arg3:PlayerWeapon):void{
_arg1.bulletPlayerWeapon = _arg3;
_arg1.colFlag_isBullet = false;
_arg1.updateFunction = _arg1.UpdateBullet_Vortex;
_arg1.graphicID = _arg3.graphicID;
_arg1.parentObj = _arg2;
_arg1.frame = 0;
_arg1.frameVel = 5;
_arg1.xpos = _arg1.parentObj.xpos;
_arg1.ypos = _arg1.parentObj.ypos;
_arg1.toPosX = Game.mouseMapX;
_arg1.toPosY = Game.mouseMapY;
_arg1.movementVec.Set(Math.atan2((_arg1.toPosY - _arg1.ypos), (_arg1.toPosX - _arg1.xpos)), _arg3.GetSpeed());
_arg1.dir = 0;
_arg1.timer = 300;
_arg1.controlMode = 0;
}
static function InitBullet_BulletTime(_arg1:GameObj, _arg2:GameObj, _arg3:PlayerWeapon):void{
_arg1.visible = false;
_arg1.bulletPlayerWeapon = _arg3;
_arg1.colFlag_isBullet = true;
_arg1.updateFunction = _arg1.UpdateBullet_BulletTime;
_arg1.timer = 200;
Game.bulletTime = 150;
}
static function InitHomingBullet(_arg1:GameObj, _arg2:GameObj, _arg3:PlayerWeapon):void{
_arg1.bulletPlayerWeapon = _arg3;
_arg1.graphicID = _arg3.graphicID;
_arg1.colFlag_isBullet = true;
_arg1.updateFunction = _arg1.UpdateHomingBullet;
_arg1.renderFunction = _arg1.RenderBullet;
_arg1.parentObj = _arg2;
_arg1.frame = 0;
_arg1.scale = 1;
_arg1.xpos = _arg1.parentObj.xpos;
_arg1.ypos = _arg1.parentObj.ypos;
_arg1.timer = 300;
_arg1.timer1 = 10;
_arg1.movementVec.Set(((_arg1.parentObj.dir + _arg3.GetFireAngle()) - (Math.PI * 0.5)), _arg3.GetSpeed());
}
static function InitBullet_Spiral(_arg1:GameObj, _arg2:GameObj, _arg3:PlayerWeapon):void{
_arg1.bulletPlayerWeapon = _arg3;
_arg1.colFlag_isBullet = true;
_arg1.updateFunction = _arg1.UpdateBullet_Spiral;
_arg1.renderFunction = _arg1.RenderBullet;
_arg1.graphicID = _arg3.graphicID;
_arg1.parentObj = _arg2;
_arg1.frame = 0;
_arg1.xpos = _arg1.parentObj.xpos;
_arg1.ypos = _arg1.parentObj.ypos;
_arg1.dir = _arg1.parentObj.dir;
_arg1.xvel = _arg1.movementVec.GetXComponent();
_arg1.yvel = _arg1.movementVec.GetYComponent();
_arg1.rotVel = _arg3.angle;
_arg1.speed = 4;
_arg1.yacc = 0;
_arg1.xacc = (_arg1.parentObj.dir - (Math.PI * 0.5));
_arg1.startx = _arg1.xpos;
_arg1.starty = _arg1.ypos;
_arg1.timer = 10;
}
}
}//package
Section 114
//GameObjects (GameObjects)
package {
import flash.events.*;
class GameObjects {
public static var numobjs;
static var m:Main;
public static var dummyObj:GameObj;
public static var objs1:Array;
public static var objs2:Array;
public static var objs:Array;
public function GameObjGroup(){
}
public static function Update():void{
var _local1:Boolean;
var _local2:int;
var _local3:GameObj;
_local1 = !((Game.bulletTime == 0));
_local2 = 0;
while (_local2 < objs.length) {
_local3 = objs[_local2];
if (_local3.active){
_local3.Update();
if (!_local1){
if (((_local3.active) && (_local3.usesBulletTime))){
_local3.Update();
};
};
};
_local2++;
};
}
public static function Render():void{
var _local1:GameObj;
var _local2:Array;
_local2 = new Array();
for each (_local1 in objs) {
if (((_local1.active) && (_local1.visible))){
_local2.push(_local1);
};
};
_local2.sortOn("zpos2", (Array.NUMERIC | Array.DESCENDING));
for each (_local1 in _local2) {
if (_local1.hasShadow){
_local1.RenderShadow();
};
};
for each (_local1 in _local2) {
_local1.Render();
};
}
public static function ForEachActive(_arg1:Function):void{
var _local2:GameObj;
var _local3:Array;
_local3 = new Array();
for each (_local2 in objs) {
if (_local2.active){
_arg1(_local2);
};
};
}
public static function InitOnce(_arg1:Main, _arg2:int){
var _local3:*;
numobjs = _arg2;
m = _arg1;
objs = new Array();
_local3 = 0;
while (_local3 < numobjs) {
objs.push(new GameObj(m, 0, 0, _local3));
_local3++;
};
dummyObj = new GameObj(m, 0, 0, 0);
}
public static function ClearAll(){
var _local1:int;
_local1 = 0;
while (_local1 < numobjs) {
objs[_local1].active = false;
_local1++;
};
}
public static function AddObj(_arg1:Number, _arg2:Number, _arg3:Number):GameObj{
var _local4:int;
var _local5:GameObj;
_local4 = 0;
while (_local4 < numobjs) {
if (objs[_local4].active == false){
_local5 = objs[_local4];
_local5.active = true;
_local5.zpos = _arg3;
_local5.xpos = _arg1;
_local5.ypos = _arg2;
_local5.startx = _arg1;
_local5.starty = _arg2;
_local5.startz = _arg3;
_local5.Init(0);
return (objs[_local4]);
};
_local4++;
};
trace("ERROR! NO FREE OBJECTS");
return (dummyObj);
}
public static function CountActiveObjects():int{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
while (_local2 < objs.length) {
if (objs[_local2].active == true){
_local1++;
};
_local2++;
};
return (_local1);
}
}
}//package
Section 115
//GameOverScreen (GameOverScreen)
package {
import flash.display.*;
public dynamic class GameOverScreen extends MovieClip {
public var buttonMoreGames:SimpleButton;
public var buttonKong:SimpleButton;
public var buttonQuit:SimpleButton;
public var buttonGuide:SimpleButton;
public var buttonContinue:SimpleButton;
}
}//package
Section 116
//GraphicObjects (GraphicObjects)
package {
import flash.display.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
public class GraphicObjects {
public static const gfx_particlepickup = 131;
public static const gfx_particleenemyshotfired1 = 136;
public static const gfx_weaponsoverlay = 121;
public static const gfx_particlequotadestroyed = 138;
public static const gfx_shipappeartube = 125;
public static const gfx_enemyboss2 = 47;
public static const gfx_player = 10;
public static const gfx_enemyboss3 = 49;
public static const gfx_pickup1 = 155;
public static const gfx_pickup2 = 156;
public static const gfx_pickup3 = 157;
public static const gfx_playerweaponBFG = 92;
public static const gfx_playerweaponduck = 90;
public static const gfx_portal1 = 151;
public static const gfx_playerweapon00 = 70;
public static const gfx_playerweapon01 = 71;
public static const gfx_playerweapon02 = 72;
public static const gfx_playerweapon03 = 73;
public static const gfx_playerweapon04 = 74;
public static const gfx_playerweapon05 = 75;
public static const gfx_playerweapon06 = 76;
public static const gfx_playerweapon07 = 77;
public static const gfx_playerweapon08 = 78;
public static const gfx_playerweapon09 = 79;
public static const gfx_enemyboss2drone = 48;
public static const gfx_playerweapon10 = 80;
public static const gfx_playerweapon11 = 81;
public static const gfx_playerweapon12 = 82;
public static const gfx_playerweapon13 = 83;
public static const gfx_playerweapon14 = 84;
public static const gfx_playerweapon15 = 85;
public static const gfx_playerweapon16 = 86;
public static const gfx_playerweapon17 = 87;
public static const gfx_playerweapon18 = 88;
public static const gfx_playerweapon19 = 89;
public static const gfx_playerweapon_ricochet = 95;
public static const gfx_enemy24large = 56;
public static const gfx_backgroundeater = 128;
public static const gfx_backgroundscroll3 = 102;
public static const gfx_backgroundscroll4 = 103;
public static const gfx_backgroundscroll5 = 104;
public static const gfx_backgroundscroll7 = 106;
public static const gfx_backgroundscroll8 = 107;
public static const gfx_backgroundscroll9 = 108;
public static const gfx_enemy7atiny = 54;
public static const gfx_cursor = 129;
public static const gfx_backgroundscroll2 = 101;
public static const gfx_enemy10 = 32;
public static const gfx_enemy11 = 33;
public static const gfx_enemy12 = 34;
public static const gfx_homingbullet = 62;
public static const gfx_enemy14 = 37;
public static const gfx_enemy15 = 38;
public static const gfx_backgroundscroll1 = 100;
public static const gfx_enemy19 = 42;
public static const gfx_enemy13 = 35;
public static const gfx_backgroundscroll6 = 105;
public static const gfx_enemy16 = 39;
public static const gfx_enemy18 = 41;
public static const gfx_installation1 = 140;
public static const gfx_powerbar = 122;
public static const gfx_enemy17 = 40;
public static const gfx_particleenemyexplode = 133;
public static const gfx_enemy20 = 43;
public static const gfx_enemy21 = 44;
public static const gfx_enemy22 = 45;
public static const gfx_enemy23 = 46;
public static const gfx_enemy24 = 55;
public static const gfx_particleplayerthrust = 135;
public static const gfx_bigexplosion = 126;
public static const gfx_particle1 = 180;
public static const gfx_particle2 = 181;
public static const gfx_particle3 = 182;
public static const gfx_particlehitplayer = 132;
public static const gfx_enemy1 = 21;
public static const gfx_enemy2 = 22;
public static const gfx_enemy3 = 23;
public static const gfx_enemy4 = 24;
public static const gfx_enemy5 = 25;
public static const gfx_enemy6 = 26;
public static const gfx_enemy7 = 27;
public static const gfx_enemy8 = 29;
public static const gfx_enemy9 = 31;
public static const gfx_enemyboss3drone = 50;
public static const gfx_particle4 = 183;
public static const gfx_backgroundscroll10 = 109;
public static const gfx_backgroundscroll11 = 110;
public static const gfx_backgroundscroll13 = 112;
public static const gfx_backgroundscroll14 = 113;
public static const gfx_backgroundscroll15 = 114;
public static const gfx_backgroundscroll17 = 116;
public static const gfx_explodemark = 120;
public static const gfx_backgroundscroll12 = 111;
public static const gfx_enemy1large = 52;
public static const gfx_backgroundscroll16 = 115;
public static const gfx_hudweaponselector = 124;
public static const gfx_playerweapon_fathomer = 96;
public static const gfx_font1 = 190;
public static const gfx_font2 = 191;
public static const gfx_font3 = 192;
public static const gfx_hudweapons = 123;
public static const gfx_streambullet = 61;
public static const gfx_particlescore = 137;
public static const gfx_particleenemyhit = 134;
public static const gfx_chargebar = 127;
public static const gfx_enemy6a = 51;
public static const gfx_particlehitshield = 130;
public static const gfx_playerweapon_diagonal = 93;
public static const gfx_enemy7tiny = 53;
public static const gfx_enemy7a = 28;
public static const gfx_fontblack = 193;
public static const gfx_playerweapon_reverse = 94;
public static const gfx_enemy8a = 30;
public static const gfx_enemybullet1 = 63;
public static const gfx_enemybullet2 = 64;
public static const gfx_enemybullet3 = 65;
public static const gfx_portal = 150;
public static const gfx_playerweaponshortspread = 91;
public static const gfx_enemy13a = 36;
public static var stringCharX:Number;
public static var stringCharY:Number;
static var idList:Array;
static var totalFramesToDo:int = 1000;
static var count:int;
public static var stringCharBitmap:Bitmap;
static var everythingDone:Boolean = false;
static var graphicobjs:Array;
static var totalFramesDone:int = 0;
static var main:Main;
static var nameList:Array;
public static function GetBitmap(_arg1:int, _arg2:int):Bitmap{
var _local3:int;
_local3 = idList[_arg1];
return (graphicobjs[_local3].frames[_arg2].bitmaps[0]);
}
public static function RenderStringAt(_arg1:BitmapData, _arg2:int, _arg3:Number, _arg4:Number, _arg5:String, _arg6:int=0){
var _local7:int;
var _local8:int;
stringCharX = _arg3;
stringCharY = _arg4;
_local7 = 0;
while (_local7 < _arg5.length) {
_local8 = int(_arg5.charCodeAt(_local7));
if (_local8 < 0){
_local8 = 0;
};
if (_local8 > 127){
_local8 = 127;
};
RenderAt(_arg2, _local8, _arg1, stringCharX, stringCharY);
stringCharBitmap = GetBitmap(_arg2, _local8);
stringCharX = (stringCharX + stringCharBitmap.width);
stringCharX = (stringCharX + _arg6);
_local7++;
};
}
public static function RenderAtSplit(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number){
var _local6:int;
_local6 = idList[_arg1];
graphicobjs[_local6].frames[_arg2].RenderAtSplit(_arg3, _arg4, _arg5);
}
public static function GetWidth(_arg1:int, _arg2:int):int{
var _local3:int;
_local3 = idList[_arg1];
return (graphicobjs[_local3].frames[_arg2].bitmaps[0].width);
}
public static function RenderAtScaled(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number, _arg6:Boolean=false, _arg7:Number=1){
var _local8:int;
_local8 = idList[_arg1];
graphicobjs[_local8].frames[_arg2].RenderAtScaled(_arg3, _arg4, _arg5, _arg6, _arg7);
}
public static function RenderAtAlpha(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number, _arg6:Number){
var _local7:int;
_local7 = idList[_arg1];
graphicobjs[_local7].frames[_arg2].RenderAtAlpha(_arg3, _arg4, _arg5, _arg6);
}
public static function GetHeught(_arg1:int, _arg2:int):int{
var _local3:int;
_local3 = idList[_arg1];
return (graphicobjs[_local3].frames[_arg2].bitmaps[0].height);
}
public static function Add(_arg1:int, _arg2:DisplayObj, _arg3:String=""):void{
idList[_arg1] = count;
nameList[_arg1] = _arg3;
graphicobjs.push(_arg2);
count++;
}
public static function RenderAtRot(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean){
var _local8:int;
_local8 = idList[_arg1];
if (_arg7){
graphicobjs[_local8].frames[_arg2].RenderAtRotBurned(_arg3, _arg4, _arg5, _arg6);
} else {
graphicobjs[_local8].frames[_arg2].RenderAtRot(_arg3, _arg4, _arg5, _arg6);
};
}
public static function AddFont(_arg1:int, _arg2:TextFormat):void{
var _local3:DisplayObj;
_local3 = new DisplayObj(null, 0, 0);
_local3.CreateFont(_arg2);
idList[_arg1] = count;
graphicobjs.push(_local3);
count++;
}
public static function RenderAtRotScaled(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number, _arg6:Boolean=false, _arg7:Number=1, _arg8:Number=0){
var _local9:int;
_local9 = idList[_arg1];
graphicobjs[_local9].frames[_arg2].RenderAtRotScaled(_arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public static function RenderAt(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number, _arg6:Boolean=false){
var _local7:int;
_local7 = idList[_arg1];
graphicobjs[_local7].frames[_arg2].RenderAt(_arg3, _arg4, _arg5, _arg6);
}
public static function RenderAtColTrans(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number, _arg6:Boolean=false, _arg7:ColorTransform=null, _arg8:String=null){
var _local9:int;
_local9 = idList[_arg1];
graphicobjs[_local9].frames[_arg2].RenderAtColTrans(_arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public static function CaclulateTotalFrames(){
var _local1:int;
var _local2:DisplayObj;
_local1 = 0;
for each (_local2 in graphicobjs) {
if (_local2.mc != null){
_local1 = (_local1 + _local2.mc.totalFrames);
};
};
totalFramesToDo = _local1;
}
public static function CompleteBitmapCreation(){
var _local1:DisplayObj;
if (everythingDone){
return (true);
};
for each (_local1 in graphicobjs) {
if (_local1.ready == false){
if (_local1.mc != null){
_local1.CreateBitmapsFromMovieClip(_local1.mc, _local1.flags);
_local1.mc = null;
_local1.ready = true;
};
};
};
everythingDone = true;
}
public static function GetNumFrames(_arg1:int):int{
var _local2:int;
_local2 = idList[_arg1];
return (graphicobjs[_local2].frames.length);
}
public static function RenderNumberAt(_arg1:BitmapData, _arg2:int, _arg3:Number, _arg4:Number, _arg5:int){
var _local6:Array;
var _local7:int;
var _local8:int;
var _local9:Boolean;
var _local10:int;
var _local11:int;
var _local12:Bitmap;
_local6 = new Array();
_local7 = _arg5;
_local8 = 0;
while (_local8 < 11) {
_local10 = (_local7 % 10);
_local6.push(_local10);
_local7 = (_local7 / 10);
_local8++;
};
_local9 = false;
_local8 = (_local6.length - 1);
while (_local8--) {
_local11 = _local6[_local8];
if ((((_local9 == false)) && (!((_local11 == 0))))){
_local9 = true;
};
if (_local9){
RenderAt(_arg2, (_local11 + 48), _arg1, _arg3, _arg4);
_local12 = GetBitmap(_arg2, (_local11 + 48));
_arg3 = (_arg3 + _local12.width);
};
(_local8 >= 0);
};
return (_arg3);
}
public static function GetPixelAt(_arg1:int, _arg2:int, _arg3:int, _arg4:int):uint{
var _local5:int;
var _local6:Bitmap;
var _local7:uint;
_local5 = idList[_arg1];
_local6 = graphicobjs[_local5].frames[_arg2].bitmaps[0];
_local7 = _local6.bitmapData.getPixel32(_arg3, _arg4);
return (_local7);
}
public static function GetIdFromName(_arg1:String):int{
var _local2:int;
var _local3:String;
_local2 = 0;
while (_local2 < nameList.length) {
_local3 = nameList[_local2];
if (_local3 == _arg1){
return (_local2);
};
_local2++;
};
return (-1);
}
public static function UpdateOncePerFrame():Boolean{
var _local1:DisplayObj;
var _local2:int;
var _local3:int;
if (everythingDone){
return (true);
};
for each (_local1 in graphicobjs) {
if (_local1.ready == false){
if (_local1.mc != null){
_local2 = 0;
while (_local2 < 20) {
_local3 = _local1.CreateBitmapsFromMovieClip1(_local1.mc, _local1.flags);
totalFramesDone = (totalFramesDone + _local3);
if (_local3 == 0){
_local1.mc = null;
_local1.ready = true;
_local2 = 99999;
};
_local2++;
};
TitleScreenState.SetFrameUpdateText(totalFramesDone, totalFramesToDo);
return (false);
};
};
};
everythingDone = true;
return (true);
}
public static function RenderAtFunction(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:String){
var _local8:int;
_local8 = idList[_arg1];
graphicobjs[_local8].frames[_arg2].RenderAtFunction(_arg3, _arg4, _arg5, _arg6, _arg7);
}
public static function RenderAtAdditive(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number, _arg6:Number){
var _local7:int;
_local7 = idList[_arg1];
graphicobjs[_local7].frames[_arg2].RenderAtAdditive(_arg3, _arg4, _arg5, _arg6);
}
public static function RenderAtRotScaledColTrans(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number, _arg6:Boolean=false, _arg7:Number=1, _arg8:Number=0, _arg9:ColorTransform=null){
var _local10:int;
_local10 = idList[_arg1];
graphicobjs[_local10].frames[_arg2].RenderAtRotScaledColTrans(_arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9);
}
public static function InitOnce(_arg1:Main):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
main = _arg1;
graphicobjs = new Array();
idList = new Array(200);
nameList = new Array(200);
count = 0;
totalFramesDone = 0;
_local2 = getTimer();
_local3 = System.totalMemory;
trace(_local3);
AddFont(gfx_font1, main.tf_scorespr);
AddFont(gfx_font2, main.tf_scorespr1);
AddFont(gfx_font3, main.tf_scorespr2);
AddFont(gfx_fontblack, main.tf_scoresprblack);
Add(gfx_backgroundscroll1, new DisplayObj(new BackgroundScroll1(), 1, 5, true));
Add(gfx_backgroundscroll2, new DisplayObj(new BackgroundScroll2(), 1, 5, true));
Add(gfx_backgroundscroll3, new DisplayObj(new BackgroundScroll3(), 1, 5, true));
Add(gfx_backgroundscroll4, new DisplayObj(new BackgroundScroll4(), 1, 5, true));
Add(gfx_backgroundscroll5, new DisplayObj(new BackgroundScroll5(), 1, 5, true));
Add(gfx_backgroundscroll6, new DisplayObj(new BackgroundScroll6(), 1, 5, true));
Add(gfx_backgroundscroll7, new DisplayObj(new BackgroundScroll7(), 1, 5, true));
Add(gfx_backgroundscroll8, new DisplayObj(new BackgroundScroll8(), 1, 5, true));
Add(gfx_backgroundscroll9, new DisplayObj(new BackgroundScroll9(), 1, 5, true));
Add(gfx_backgroundscroll10, new DisplayObj(new BackgroundScroll10(), 1, 5, true));
Add(gfx_backgroundscroll11, new DisplayObj(new BackgroundScroll11(), 1, 5, true));
Add(gfx_backgroundscroll12, new DisplayObj(new BackgroundScroll12(), 1, 5, true));
Add(gfx_backgroundscroll13, new DisplayObj(new BackgroundScroll13(), 1, 5, true));
Add(gfx_backgroundscroll14, new DisplayObj(new BackgroundScroll14(), 1, 5, true));
Add(gfx_backgroundscroll15, new DisplayObj(new BackgroundScroll15(), 1, 5, true));
Add(gfx_backgroundscroll16, new DisplayObj(new BackgroundScroll16(), 1, 5, true));
Add(gfx_backgroundscroll17, new DisplayObj(new BackgroundScroll17(), 1, 5, true));
Add(gfx_player, new DisplayObj(new Player(), 1, 0));
Add(gfx_particle1, new DisplayObj(new Particle1(), 1, 4));
Add(gfx_particle2, new DisplayObj(new Particle2(), 1, 4));
Add(gfx_particle3, new DisplayObj(new Particle3(), 1, 4));
Add(gfx_particle4, new DisplayObj(new Particle4(), 1, 4));
Add(gfx_particleenemyexplode, new DisplayObj(new ParticleEnemyDie1(), 1, 4));
Add(gfx_particleenemyhit, new DisplayObj(new ParticleEnemyHitNoDie(), 1, 4));
Add(gfx_particleplayerthrust, new DisplayObj(new ParticlePlayerThrust1(), 1, 4));
Add(gfx_particlehitshield, new DisplayObj(new ParticleHitShield(), 1, 4));
Add(gfx_particlescore, new DisplayObj(new ScoreParticles(), 1, 4));
Add(gfx_particlepickup, new DisplayObj(new ParticlePickup(), 1, 4));
Add(gfx_particlehitplayer, new DisplayObj(new ParticleHitPlayer(), 1, 4));
Add(gfx_particleenemyshotfired1, new DisplayObj(new ParticleEnemyShotFired1(), 1, 4));
Add(gfx_particlequotadestroyed, new DisplayObj(new ParticleQuotaDestroyed(), 1, 4));
Add(gfx_playerweapon00, new DisplayObj(new PlayerWeapon00(), 1, 4));
Add(gfx_playerweapon01, new DisplayObj(new PlayerWeapon01(), 1, 4));
Add(gfx_playerweapon02, new DisplayObj(new PlayerWeapon02(), 1, 4));
Add(gfx_playerweapon03, new DisplayObj(new PlayerWeapon03(), 1, 4));
Add(gfx_playerweapon04, new DisplayObj(new PlayerWeapon04(), 1, 4));
Add(gfx_playerweapon05, new DisplayObj(new PlayerWeapon05(), 1, 4));
Add(gfx_playerweapon06, new DisplayObj(new PlayerWeapon06(), 1, 4));
Add(gfx_playerweapon07, new DisplayObj(new PlayerWeapon07(), 1, 4));
Add(gfx_playerweapon08, new DisplayObj(new PlayerWeapon08(), 1, 4));
Add(gfx_playerweapon09, new DisplayObj(new PlayerWeapon09(), 1, 4));
Add(gfx_playerweapon10, new DisplayObj(new PlayerWeapon10(), 1, 4));
Add(gfx_playerweapon11, new DisplayObj(new PlayerWeapon11(), 1, 4));
Add(gfx_playerweapon_diagonal, new DisplayObj(new PlayerWeaponDiagonals(), 1, 4));
Add(gfx_playerweapon_reverse, new DisplayObj(new PlayerWeaponReverse(), 1, 4));
Add(gfx_playerweapon_ricochet, new DisplayObj(new PlayerWeaponRicochet(), 1, 4));
Add(gfx_playerweapon_fathomer, new DisplayObj(new PlayerWeaponFatHomer(), 1, 4));
Add(gfx_playerweaponduck, new DisplayObj(new PlayerWeaponDuck(), 1, 4));
Add(gfx_playerweaponshortspread, new DisplayObj(new PlayerWeaponShortSpread(), 1, 4));
Add(gfx_playerweaponBFG, new DisplayObj(new PlayerWeaponBFG(), 1, 4));
Add(gfx_streambullet, new DisplayObj(new StreamBullet(), 1, 0));
Add(gfx_homingbullet, new DisplayObj(new HomingBullet(), 1, 0));
Add(gfx_enemy1, new DisplayObj(new Enemy1(), 1, 0), "Enemy1");
Add(gfx_enemy1large, new DisplayObj(new Enemy1Large(), 1, 0), "Enemy1Large");
Add(gfx_enemy2, new DisplayObj(new Enemy2(), 1, 0), "Enemy2");
Add(gfx_enemy3, new DisplayObj(new Enemy3(), 1, 0), "Enemy3");
Add(gfx_enemy4, new DisplayObj(new Enemy4(), 1, 0), "Enemy4");
Add(gfx_enemy5, new DisplayObj(new Enemy5(), 1, 0), "Enemy5");
Add(gfx_enemy6, new DisplayObj(new Enemy6(), 1, 2), "Enemy6");
Add(gfx_enemy7tiny, new DisplayObj(new Enemy7Tiny(), 1, 0), "Enemy7Tiny");
Add(gfx_enemy7atiny, new DisplayObj(new Enemy7aTiny(), 1, 0), "Enemy7aTiny");
Add(gfx_enemy24, new DisplayObj(new Enemy24(), 1, 0), "Enemy24");
Add(gfx_enemy7, new DisplayObj(new Enemy7(), 1, 0), "Enemy7");
Add(gfx_enemy7a, new DisplayObj(new Enemy7a(), 1, 0), "Enemy7a");
Add(gfx_enemy8, new DisplayObj(new Enemy8(), 1, 0), "Enemy8");
Add(gfx_enemy8a, new DisplayObj(new Enemy8a(), 1, 0), "Enemy8a");
Add(gfx_enemy9, new DisplayObj(new Enemy9(), 1, 0), "Enemy9");
Add(gfx_enemy10, new DisplayObj(new Enemy10(), 1, 0), "Enemy10");
Add(gfx_enemy11, new DisplayObj(new Enemy11(), 1, 0), "Enemy11");
Add(gfx_enemy12, new DisplayObj(new Enemy12(), 1, 0), "Enemy12");
Add(gfx_enemy13, new DisplayObj(new Enemy13(), 1, 0), "Enemy13");
Add(gfx_enemy13a, new DisplayObj(new Enemy13a(), 1, 0), "Enemy13a");
Add(gfx_enemy14, new DisplayObj(new Enemy14(), 1, 0), "Enemy14");
Add(gfx_enemy15, new DisplayObj(new Enemy15(), 1, 0), "Enemy15");
Add(gfx_enemy16, new DisplayObj(new Enemy16(), 1, 0), "Enemy16");
Add(gfx_enemy17, new DisplayObj(new Enemy17(), 1, 0), "Enemy17");
Add(gfx_enemy18, new DisplayObj(new Enemy18(), 1, 0), "Enemy18");
Add(gfx_enemy19, new DisplayObj(new Enemy19(), 1, 0), "Enemy19");
Add(gfx_enemy20, new DisplayObj(new Enemy20(), 1, 0), "Enemy20");
Add(gfx_enemy21, new DisplayObj(new Enemy21(), 1, 0), "Enemy21");
Add(gfx_enemy22, new DisplayObj(new Enemy22(), 1, 0), "Enemy22");
Add(gfx_enemy23, new DisplayObj(new Enemy23(), 1, 0), "Enemy23");
Add(gfx_enemyboss2, new DisplayObj(new EnemyBoss2(), 1, 0), "EnemyBoss2");
Add(gfx_enemyboss2drone, new DisplayObj(new EnemyBoss2Drone(), 1, 0), "EnemyBoss2Drone");
Add(gfx_enemyboss3, new DisplayObj(new EnemyBoss3(), 1, 0), "EnemyBoss3");
Add(gfx_enemyboss3drone, new DisplayObj(new EnemyBoss3Drone(), 1, 0), "EnemyBoss3Drone");
Add(gfx_enemy6a, new DisplayObj(new Enemy6a(), 1, 0), "Enemy6a");
Add(gfx_portal, new DisplayObj(new Portal(), 1, 0), "Portal");
Add(gfx_portal1, new DisplayObj(new Portal1(), 1, 0));
Add(gfx_installation1, new DisplayObj(new Installation1(), 1, 0), "Installation1");
Add(gfx_enemybullet1, new DisplayObj(new EnemyBullet1(), 1, 0), "EnemyBullet1");
Add(gfx_enemybullet2, new DisplayObj(new EnemyBullet2(), 1, 0), "EnemyBullet2");
Add(gfx_enemybullet3, new DisplayObj(new EnemyBullet3(), 1, 0), "EnemyBullet3");
Add(gfx_pickup1, new DisplayObj(new Pickup1(), 1, 0));
Add(gfx_pickup2, new DisplayObj(new Pickup2(), 1, 0));
Add(gfx_pickup3, new DisplayObj(new Pickup3(), 1, 0));
Add(gfx_explodemark, new DisplayObj(new ExplodeMark(), 1, 4));
Add(gfx_weaponsoverlay, new DisplayObj(new weaponsOverlay1(), 1, 4));
Add(gfx_powerbar, new DisplayObj(new powerBar(), 1, 4));
Add(gfx_chargebar, new DisplayObj(new chargeBar(), 1, 4));
Add(gfx_backgroundeater, new DisplayObj(new BackgroundEater(), 1, 4));
Add(gfx_cursor, new DisplayObj(new Cursor(), 1, 4));
Add(gfx_hudweapons, new DisplayObj(new hudWeaponAnims(), 1, 4));
Add(gfx_hudweaponselector, new DisplayObj(new HudWeaponSelector(), 1, 4));
Add(gfx_shipappeartube, new DisplayObj(new ShipAppearTube(), 1, 4));
Add(gfx_bigexplosion, new DisplayObj(new bigExplosion(), 1, 4));
Add(gfx_enemy24large, new DisplayObj(new Enemy24Large(), 1, 0), "Enemy24Large");
_local4 = getTimer();
_local5 = (_local4 - _local2);
trace(("time taken to create grpahic obejcts: " + _local5));
_local6 = System.totalMemory;
_local7 = (_local6 - _local3);
trace(("memory used: " + _local7));
CaclulateTotalFrames();
}
}
}//package
Section 117
//helptext1 (helptext1)
package {
import flash.display.*;
public dynamic class helptext1 extends MovieClip {
public var buttonClose:SimpleButton;
}
}//package
Section 118
//helptext2 (helptext2)
package {
import flash.display.*;
public dynamic class helptext2 extends MovieClip {
public var buttonClose:SimpleButton;
}
}//package
Section 119
//HighScore (HighScore)
package {
import flash.events.*;
import flash.display.*;
public class HighScore {
public static const hiscoretype_NONE = 0;
public static const hiscoretype_MOCHI = 1;
public static const hiscoretype_GAMEZHERO = 4;
public static const hiscoretype_MINDJOLT_VIRAL = 3;
public static const hiscoretype_CANDYSTAND = 6;
public static const hiscoretype_SHOCKWAVE = 5;
public static const hiscoretype_MINDJOLT = 2;
static var difficulty:int;
static var callback:Object;
static var shockwave_HighscoreObject:Object;
static var newButton;
static var mochiConnectIDs:Array;
static var mochiBoardIDs:Array;
static var main:Main;
static var s:int;
static var SubmitScore_mc:MovieClip;
static var mochiMovieClip:MovieClip;
static function buttonShockwaveBackPressed(_arg1:MouseEvent){
Game.main.removeChild(SubmitScore_mc);
SubmitScore_mc = null;
if (callback != null){
callback();
};
}
public static function ViewScores_Shockwave():void{
difficulty = 0;
if (Licensors.GetHighScoreType() == hiscoretype_SHOCKWAVE){
Shockwave_createHSobj();
shockwave_HighscoreObject.openHub("view", 0);
};
}
public static function InitOnce(_arg1:Main){
main = _arg1;
}
public static function SubmitScore(_arg1:int, _arg2:int, _arg3=null):void{
s = _arg1;
difficulty = _arg2;
callback = _arg3;
}
static function Shockwave_createHSobj():void{
var _local1:Object;
_local1 = new Object();
_local1.gameTitle = "Drift Runners";
_local1.gameId = "driftrunners";
_local1.screenWidth = 640;
_local1.screenHeight = 480;
_local1.scoreDescriptor = "Points";
}
static function buttonShockwaveSubmitPressed(_arg1:MouseEvent){
SubmitScore_mc.buttonSubmit.visible = false;
Shockwave_createHSobj();
trace("jsopening hub");
shockwave_HighscoreObject.openHub("submit", s);
trace("jsopened hub");
}
public static function PlayAgain():void{
trace("shockwave play again");
main.SetGameState(Main.gameState_TITLE);
}
}
}//package
Section 120
//HomingBullet (HomingBullet)
package {
import flash.display.*;
public dynamic class HomingBullet extends MovieClip {
}
}//package
Section 121
//hudWeaponAnims (hudWeaponAnims)
package {
import flash.display.*;
public dynamic class hudWeaponAnims extends MovieClip {
}
}//package
Section 122
//HudWeaponSelector (HudWeaponSelector)
package {
import flash.display.*;
public dynamic class HudWeaponSelector extends MovieClip {
}
}//package
Section 123
//Installation1 (Installation1)
package {
import flash.display.*;
public dynamic class Installation1 extends MovieClip {
}
}//package
Section 124
//instructions (instructions)
package {
import flash.display.*;
public dynamic class instructions extends MovieClip {
public var buttonMoreGames:SimpleButton;
public var buttonKong:SimpleButton;
public var buttonGuide:SimpleButton;
public var buttonContinue:SimpleButton;
}
}//package
Section 125
//instructions0 (instructions0)
package {
import flash.display.*;
public dynamic class instructions0 extends MovieClip {
public var buttonMoreGames:SimpleButton;
public var buttonKong:SimpleButton;
public var buttonGuide:SimpleButton;
public var buttonContinue:SimpleButton;
}
}//package
Section 126
//instructions1 (instructions1)
package {
import flash.display.*;
public dynamic class instructions1 extends MovieClip {
public var buttonMoreGames:SimpleButton;
public var buttonKong:SimpleButton;
public var buttonGuide:SimpleButton;
public var buttonContinue:SimpleButton;
}
}//package
Section 127
//KeyReader (KeyReader)
package {
import flash.events.*;
import flash.display.*;
public class KeyReader {
static const KEY_LEFT = 37;
static const KEY_UP = 38;
static const KEY_DOWN = 40;
static const KEY_3 = 51;
static const KEY_5 = 53;
static const KEY_7 = 55;
static const KEY_1 = 49;
static const KEY_2 = 50;
static const KEY_4 = 52;
static const KEY_6 = 54;
static const KEY_8 = 56;
static const KEY_9 = 57;
static const KEY_A = 65;
static const KEY_B = 66;
static const KEY_C = 67;
static const KEY_E = 69;
static const KEY_F = 70;
static const KEY_G = 71;
static const KEY_H = 72;
static const KEY_I = 73;
static const KEY_J = 74;
static const KEY_D = 68;
static const KEY_M = 77;
static const KEY_N = 78;
static const KEY_O = 79;
static const KEY_P = 80;
static const KEY_Q = 81;
static const KEY_R = 82;
static const KEY_L = 76;
static const KEY_T = 84;
static const KEY_U = 85;
static const KEY_V = 86;
static const KEY_W = 87;
static const KEY_X = 88;
static const KEY_Y = 89;
static const KEY_K = 75;
static const KEY_0 = 58;
static const KEY_Z = 90;
static const KEY_S = 83;
static const KEY_SPACE = 32;
static const KEY_RIGHT = 39;
static var keysPressed:Array;
static var keysDown:Array;
public static function Pressed(_arg1:int):Boolean{
return (keysPressed[_arg1]);
}
public static function Reset(){
var _local1:int;
_local1 = 0;
while (_local1 < 0x0100) {
keysDown[_local1] = int(0);
keysPressed[_local1] = Boolean(false);
_local1++;
};
}
static function keyUpListener(_arg1:KeyboardEvent):void{
var _local2:int;
_local2 = _arg1.keyCode;
keysDown[_local2] = 0;
}
public static function Down(_arg1:int):Boolean{
return (!((keysDown[_arg1] == 0)));
}
static function keyDownListener(_arg1:KeyboardEvent):void{
var _local2:int;
_local2 = _arg1.keyCode;
var _local3 = keysDown;
var _local4 = _local2;
var _local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
}
public static function UpdateOncePerFrame():void{
var _local1:int;
_local1 = 0;
while (_local1 < 0x0100) {
if (keysDown[_local1] == 1){
keysPressed[_local1] = true;
var _local2 = keysDown;
var _local3 = _local1;
var _local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
} else {
keysPressed[_local1] = false;
};
_local1++;
};
}
public static function InitOnce(_arg1:Stage){
var _local2:int;
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyDownListener);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyUpListener);
_arg1.focus = _arg1;
keysDown = new Array(0x0100);
keysPressed = new Array(0x0100);
_local2 = 0;
while (_local2 < 0x0100) {
keysDown[_local2] = int(0);
keysPressed[_local2] = Boolean(false);
_local2++;
};
}
}
}//package
Section 128
//Kong (Kong)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class Kong {
static var root:Object;
static var kongregate;
public static function InitOnce(_arg1:Object){
var _local2:Object;
var _local3:Object;
var _local4:String;
var _local5:URLRequest;
var _local6:Loader;
if (Licensors.IsAtKongregate() == false){
return;
};
root = _arg1;
_local2 = root.loaderInfo.loader;
_local3 = LoaderInfo(root.loaderInfo).parameters;
_local4 = ((_local3.api_path) || ("http://www.kongregate.com/flash/API_AS3_Local.swf"));
trace(("API path: " + _local4));
_local5 = new URLRequest(_local4);
_local6 = new Loader();
_local6.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
_local6.load(_local5);
root.addChild(_local6);
}
public static function SubmitScore(_arg1:Number, _arg2:String){
trace(((("Kong Score: " + _arg2) + " ") + _arg1));
if (Licensors.IsAtKongregate() == false){
return;
};
kongregate.scores.submit(_arg1, _arg2);
}
public static function SubmitStat(_arg1:Number, _arg2:String){
trace(((("Kong Stat: " + _arg2) + " ") + _arg1));
if (Licensors.IsAtKongregate() == false){
return;
};
kongregate.stats.submit(_arg2, _arg1);
}
static function loadComplete(_arg1:Event):void{
kongregate = _arg1.target.content;
kongregate.services.connect();
trace(("\n" + kongregate.services));
trace(("\n" + kongregate.user));
trace(("\n" + kongregate.scores));
trace(("\n" + kongregate.stats));
}
}
}//package
Section 129
//KongregateKongAIAd (KongregateKongAIAd)
package {
import flash.events.*;
import flash.display.*;
public dynamic class KongregateKongAIAd extends MovieClip {
public var flash:MovieClip;
public function KongregateKongAIAd(){
addFrameScript(0, frame1, 219, frame220);
}
function frame220(){
stop();
dispatchEvent(new Event("finished"));
}
function frame1(){
this.stage.frameRate = 30;
}
}
}//package
Section 130
//lasercanon1 (lasercanon1)
package {
import flash.media.*;
public dynamic class lasercanon1 extends Sound {
}
}//package
Section 131
//lazer1 (lazer1)
package {
import flash.media.*;
public dynamic class lazer1 extends Sound {
}
}//package
Section 132
//lazer10 (lazer10)
package {
import flash.media.*;
public dynamic class lazer10 extends Sound {
}
}//package
Section 133
//lazer11 (lazer11)
package {
import flash.media.*;
public dynamic class lazer11 extends Sound {
}
}//package
Section 134
//lazer12 (lazer12)
package {
import flash.media.*;
public dynamic class lazer12 extends Sound {
}
}//package
Section 135
//lazer13 (lazer13)
package {
import flash.media.*;
public dynamic class lazer13 extends Sound {
}
}//package
Section 136
//lazer2 (lazer2)
package {
import flash.media.*;
public dynamic class lazer2 extends Sound {
}
}//package
Section 137
//lazer3 (lazer3)
package {
import flash.media.*;
public dynamic class lazer3 extends Sound {
}
}//package
Section 138
//lazer4 (lazer4)
package {
import flash.media.*;
public dynamic class lazer4 extends Sound {
}
}//package
Section 139
//lazer5 (lazer5)
package {
import flash.media.*;
public dynamic class lazer5 extends Sound {
}
}//package
Section 140
//lazer6 (lazer6)
package {
import flash.media.*;
public dynamic class lazer6 extends Sound {
}
}//package
Section 141
//lazer7 (lazer7)
package {
import flash.media.*;
public dynamic class lazer7 extends Sound {
}
}//package
Section 142
//lazer8 (lazer8)
package {
import flash.media.*;
public dynamic class lazer8 extends Sound {
}
}//package
Section 143
//lazer9 (lazer9)
package {
import flash.media.*;
public dynamic class lazer9 extends Sound {
}
}//package
Section 144
//lazerbounce (lazerbounce)
package {
import flash.media.*;
public dynamic class lazerbounce extends Sound {
}
}//package
Section 145
//Level (Level)
package {
public class Level {
public var numKillsNeeded:int;
public var backgroundID:int;
public var name:String;
public var numKills:int;
public var maxEnemiesActive:int;
public function Level(){
numKillsNeeded = 100;
numKills = 0;
name = "";
maxEnemiesActive = 50;
backgroundID = -1;
}
}
}//package
Section 146
//LevelBox (LevelBox)
package {
import flash.display.*;
import flash.text.*;
public dynamic class LevelBox extends MovieClip {
public var textNumber:TextField;
}
}//package
Section 147
//LevelCompleteScreen (LevelCompleteScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class LevelCompleteScreen extends MovieClip {
public var buttonMoreGames:SimpleButton;
public var buttonKong:SimpleButton;
public var textScore:TextField;
public var textStats:TextField;
public var textLevelComplete:TextField;
public var buttonGuide:SimpleButton;
public var buttonContinue:SimpleButton;
}
}//package
Section 148
//LevelDef_Level1 (LevelDef_Level1)
package {
public class LevelDef_Level1 {
public static function Init(){
SetupScript.LineStart("l_loop", 1, 15, 0, "Path", "", "", "");
SetupScript.LineAdd(136, 72, 0);
SetupScript.LineAdd(244, 112, 0);
SetupScript.LineAdd(299, 106, 0);
SetupScript.LineAdd(350, 87, 0);
SetupScript.LineAdd(357, 44, 0);
SetupScript.LineAdd(339, 8, 0);
SetupScript.LineAdd(0x0101, 2, 0);
SetupScript.LineAdd(213, 23, 0);
SetupScript.LineAdd(150, 61, 0);
SetupScript.LineAdd(77, 113, 0);
SetupScript.LineAdd(-57, 148, 0);
SetupScript.LineEnd(false);
SetupScript.LineStart("l_j", 7, 281, 0, "Path", "", "", "");
SetupScript.LineAdd(43, 287, 0);
SetupScript.LineAdd(94, 322, 0);
SetupScript.LineAdd(152, 346, 0);
SetupScript.LineAdd(208, 337, 0);
SetupScript.LineAdd(224, 313, 0);
SetupScript.LineAdd(226, 259, 0);
SetupScript.LineAdd(226, 175, 0);
SetupScript.LineAdd(220, -228, 0);
SetupScript.LineEnd(false);
SetupScript.LineStart("t_straight", 15, 413, 0, "Path", "", "", "");
SetupScript.LineAdd(15, 581, 0);
SetupScript.LineAdd(15, 815, 0);
SetupScript.LineAdd(15, 1147, 0);
SetupScript.LineEnd(false);
SetupScript.LineStart("t_zigzag0", 117, 409, 0, "Path", "", "", "");
SetupScript.LineAdd(197, 500, 0);
SetupScript.LineAdd(67, 577, 0);
SetupScript.LineAdd(192, 670, 0);
SetupScript.LineAdd(81, 793, 0);
SetupScript.LineAdd(193, 887, 0);
SetupScript.LineAdd(94, 1001, 0);
SetupScript.LineAdd(184, 1147, 0);
SetupScript.LineEnd(false);
SetupScript.LineStart("t_tooth0", 304, 409, 0, "Path", "", "", "");
SetupScript.LineAdd(340, 524, 0);
SetupScript.LineAdd(283, 490, 0);
SetupScript.LineAdd(285, 659, 0);
SetupScript.LineAdd(344, 598, 0);
SetupScript.LineAdd(346, 781, 0);
SetupScript.LineAdd(285, 744, 0);
SetupScript.LineAdd(272, 912, 0);
SetupScript.LineAdd(330, 868, 0);
SetupScript.LineAdd(327, 1033, 0);
SetupScript.LineAdd(267, 1000, 0);
SetupScript.LineAdd(262, 1151, 0);
SetupScript.LineEnd(false);
SetupScript.LineStart("t_zigzag1", 444, 408, 0, "Path", "", "", "");
SetupScript.LineAdd(598, 476, 0);
SetupScript.LineAdd(417, 566, 0);
SetupScript.LineAdd(622, 641, 0);
SetupScript.LineAdd(405, 690, 0);
SetupScript.LineAdd(610, 754, 0);
SetupScript.LineAdd(384, 846, 0);
SetupScript.LineAdd(618, 910, 0);
SetupScript.LineAdd(391, 997, 0);
SetupScript.LineAdd(599, 1075, 0);
SetupScript.LineAdd(401, 1156, 0);
SetupScript.LineEnd(false);
SetupScript.LineStart("t_loops0", 755, 405, 0, "Path", "", "", "");
SetupScript.LineAdd(753, 562, 0);
SetupScript.LineAdd(759, 609, 0);
SetupScript.LineAdd(783, 610, 0);
SetupScript.LineAdd(824, 572, 0);
SetupScript.LineAdd(806, 543, 0);
SetupScript.LineAdd(739, 578, 0);
SetupScript.LineAdd(742, 697, 0);
SetupScript.LineAdd(0x0303, 765, 0);
SetupScript.LineAdd(812, 752, 0);
SetupScript.LineAdd(812, 710, 0);
SetupScript.LineAdd(777, 702, 0);
SetupScript.LineAdd(747, 774, 0);
SetupScript.LineAdd(750, 880, 0);
SetupScript.LineAdd(798, 889, 0);
SetupScript.LineAdd(807, 858, 0);
SetupScript.LineAdd(770, 845, 0);
SetupScript.LineAdd(752, 892, 0);
SetupScript.LineAdd(749, 957, 0);
SetupScript.LineAdd(762, 1005, 0);
SetupScript.LineAdd(801, 1010, 0);
SetupScript.LineAdd(816, 977, 0);
SetupScript.LineAdd(785, 953, 0);
SetupScript.LineAdd(744, 988, 0);
SetupScript.LineAdd(744, 1060, 0);
SetupScript.LineAdd(745, 1168, 0);
SetupScript.LineAdd(750, 1204, 0);
SetupScript.LineEnd(false);
SetupScript.LineStart("l_across1", 341, -63, 0, "Path", "", "", "");
SetupScript.LineAdd(422, -50, 0);
SetupScript.LineAdd(492, -61, 0);
SetupScript.LineAdd(561, -52, 0);
SetupScript.LineAdd(632, -62, 0);
SetupScript.LineAdd(693, -53, 0);
SetupScript.LineAdd(765, -66, 0);
SetupScript.LineAdd(819, -52, 0);
SetupScript.LineAdd(883, -71, 0);
SetupScript.LineEnd(false);
SetupScript.LineStart("l_across0", 329, -168, 0, "Path", "", "", "");
SetupScript.LineAdd(497, -172, 0);
SetupScript.LineAdd(698, -173, 0);
SetupScript.LineAdd(917, -176, 0);
SetupScript.LineEnd(false);
SetupScript.LineStart("l_across2", 399, 30, 0, "Path", "", "", "");
SetupScript.LineAdd(475, 13, 0);
SetupScript.LineAdd(497, 56, 0);
SetupScript.LineAdd(607, 8, 0);
SetupScript.LineAdd(633, 47, 0);
SetupScript.LineAdd(682, 26, 0);
SetupScript.LineAdd(744, 48, 0);
SetupScript.LineAdd(817, -7, 0);
SetupScript.LineAdd(891, 56, 0);
SetupScript.LineAdd(925, 42, 0);
SetupScript.LineEnd(false);
SetupScript.LineStart("l_across_d0", 403, 165, 0, "Path", "", "", "");
SetupScript.LineAdd(520, 191, 0);
SetupScript.LineAdd(684, 229, 0);
SetupScript.LineAdd(845, 266, 0);
SetupScript.LineAdd(953, 287, 0);
SetupScript.LineEnd(false);
SetupScript.LineStart("l_across_d1", 1004, -176, 0, "Path", "", "", "");
SetupScript.LineAdd(1160, -110, 0);
SetupScript.LineAdd(1271, -54, 0);
SetupScript.LineAdd(1397, 1, 0);
SetupScript.LineAdd(1507, 51, 0);
SetupScript.LineEnd(false);
SetupScript.LineStart("l_across_u0", 1026, 235, 0, "Path", "", "", "");
SetupScript.LineAdd(1192, 218, 0);
SetupScript.LineAdd(1354, 188, 0);
SetupScript.LineAdd(1496, 161, 0);
SetupScript.LineAdd(1594, 133, 0);
SetupScript.LineEnd(false);
SetupScript.LineStart("l_across_u1", 1038, 432, 0, "Path", "", "", "");
SetupScript.LineAdd(1189, 361, 0);
SetupScript.LineAdd(1338, 282, 0);
SetupScript.LineAdd(1474, 204, 0);
SetupScript.LineAdd(1614, 119, 0);
SetupScript.LineEnd(false);
SetupScript.LineStart("l_u0", 1748, -121, 0, "Path", "", "", "");
SetupScript.LineAdd(1778.947, -123.5445, 0);
SetupScript.LineAdd(1800, -115, 0);
SetupScript.LineAdd(1821, -52, 0);
SetupScript.LineAdd(1823.765, 100.9681, 0);
SetupScript.LineAdd(1827, 280, 0);
SetupScript.LineAdd(1928, 349, 0);
SetupScript.LineAdd(2020, 352, 0);
SetupScript.LineAdd(2097, 299, 0);
SetupScript.LineAdd(2124, 194, 0);
SetupScript.LineAdd(2124, 42, 0);
SetupScript.LineAdd(2128, -38, 0);
SetupScript.LineAdd(2167, -97, 0);
SetupScript.LineAdd(2456, -112, 0);
SetupScript.LineEnd(false);
SetupScript.LineStart("l_u1", 1750, -28, 0, "Path", "", "", "");
SetupScript.LineAdd(1782, -30, 0);
SetupScript.LineAdd(1809, 1, 0);
SetupScript.LineAdd(1836, 105, 0);
SetupScript.LineAdd(1889, 242, 0);
SetupScript.LineAdd(1976, 277, 0);
SetupScript.LineAdd(2054, 246, 0);
SetupScript.LineAdd(2096, 151, 0);
SetupScript.LineAdd(2135, 12, 0);
SetupScript.LineAdd(2169, -42, 0);
SetupScript.LineAdd(2219, -56, 0);
SetupScript.LineAdd(2295, -60, 0);
SetupScript.LineEnd(false);
SetupScript.LineStart("b_up0", 1031, 1245, 0, "Path", "", "", "");
SetupScript.LineAdd(0x0400, 880, 0);
SetupScript.LineAdd(1025, 559, 0);
SetupScript.LineAdd(1027, 516, 0);
SetupScript.LineAdd(0x0404, 481, 0);
SetupScript.LineEnd(false);
SetupScript.LineStart("b_up1", 1144, 1245, 0, "Path", "", "", "");
SetupScript.LineAdd(1144.986, 1102, 0);
SetupScript.LineAdd(1146, 955, 0);
SetupScript.LineAdd(1234, 887, 0);
SetupScript.LineAdd(1339, 887, 0);
SetupScript.LineAdd(1421, 825, 0);
SetupScript.LineAdd(1424.163, 680.0254, 0);
SetupScript.LineAdd(1427, 550, 0);
SetupScript.LineEnd(false);
SetupScript.LineStart("b_up_n0", 0x0600, 1240, 0, "Path", "", "", "");
SetupScript.LineAdd(1539.785, 1134.028, 0);
SetupScript.LineAdd(1545.748, 967.0624, 0);
SetupScript.LineAdd(1551, 820, 0);
SetupScript.LineAdd(1639, 752, 0);
SetupScript.LineAdd(1745, 751, 0);
SetupScript.LineAdd(1819, 805, 0);
SetupScript.LineAdd(1826.831, 970.1029, 0);
SetupScript.LineAdd(1836.167, 1166.945, 0);
SetupScript.LineAdd(1843, 1311, 0);
SetupScript.LineEnd(false);
}
}
}//package
Section 149
//LevelDef1 (LevelDef1)
package {
public class LevelDef1 {
static var main:Main;
public static function Init(_arg1:Main){
var _local2:GameObj;
main = _arg1;
LevelDef_Level1.Init();
}
}
}//package
Section 150
//Licensors (Licensors)
package {
public class Licensors {
public static const LICENSOR_BIGFISH = 6;
public static const LICENSOR_SHOCKWAVE = 11;
public static const LICENSOR_ANDKON = 5;
public static const LICENSOR_NOBRANDING = 12;
public static const LICENSOR_KING = 10;
public static const LICENSOR_KONGREGATE = 1;
public static const LICENSOR_MINDJOLT = 4;
public static const LICENSOR_ARMORGAMES = 8;
public static const LICENSOR_MINICLIP = 2;
public static const LICENSOR_DOOF = 3;
public static const LICENSOR_BUBBLEBOX = 7;
public static const LICENSOR_GAMEZHERO = 9;
public static const LICENSOR_NONE = 0;
static var licensor:int = 1;
public static function InitOnce():void{
if ((((licensor == LICENSOR_KONGREGATE)) && ((Domain.GetDomain() == "addictinggames.com")))){
licensor = LICENSOR_NOBRANDING;
};
if (licensor == LICENSOR_MINDJOLT){
};
}
public static function IsAtKongregate():Boolean{
if (licensor != LICENSOR_KONGREGATE){
return (false);
};
if (SiteLock.GetDomain() == "kongregate.com"){
return (true);
};
return (false);
}
public static function GetHighScoreType():int{
if (licensor == LICENSOR_SHOCKWAVE){
return (HighScore.hiscoretype_SHOCKWAVE);
};
return (HighScore.hiscoretype_NONE);
}
public static function GetLicensor():int{
return (licensor);
}
public static function CanUseMochiAds():Boolean{
if (licensor == LICENSOR_NONE){
return (true);
};
if (licensor == LICENSOR_KONGREGATE){
return (true);
};
if (licensor == LICENSOR_MINICLIP){
return (false);
};
if (licensor == LICENSOR_DOOF){
return (false);
};
if (licensor == LICENSOR_MINDJOLT){
return (true);
};
if (licensor == LICENSOR_ANDKON){
return (false);
};
if (licensor == LICENSOR_BIGFISH){
return (false);
};
if (licensor == LICENSOR_ARMORGAMES){
return (false);
};
if (licensor == LICENSOR_GAMEZHERO){
return (false);
};
if (licensor == LICENSOR_KING){
return (false);
};
if (licensor == LICENSOR_SHOCKWAVE){
return (false);
};
return (true);
}
public static function IsHosted():Boolean{
if (licensor == LICENSOR_NONE){
return (false);
};
if (licensor == LICENSOR_ANDKON){
return (true);
};
if (licensor == LICENSOR_BIGFISH){
return (true);
};
if (licensor == LICENSOR_KONGREGATE){
if (SiteLock.GetDomain() == "kongregate.com"){
return (true);
};
return (false);
};
if (licensor == LICENSOR_MINICLIP){
if (SiteLock.GetDomain() == "miniclip.com"){
return (true);
};
return (false);
};
if (licensor == LICENSOR_DOOF){
if (SiteLock.GetDomain() == "doof.com"){
return (true);
};
return (false);
};
if (licensor == LICENSOR_MINDJOLT){
return (false);
};
return (false);
}
public static function SetLicensor(_arg1:int):void{
licensor = _arg1;
}
public static function CanUseMochiBot():Boolean{
if (licensor == LICENSOR_ARMORGAMES){
return (false);
};
if (licensor == LICENSOR_SHOCKWAVE){
return (false);
};
return (true);
}
}
}//package
Section 151
//Line (Line)
package {
import flash.geom.*;
public class Line {
public var udx:Number;
public var nx:Number;
public var ny:Number;
public var dir:Number;
public var udy:Number;
public var dy:Number;
public var y0:Number;
public var y1:Number;
public var dx:Number;
public var normalDir:Number;
public var length:Number;
public var boundingRect:Rectangle;
public var x0:Number;
public var x1:Number;
public function Line(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
x0 = _arg1;
y0 = _arg2;
x1 = _arg3;
y1 = _arg4;
CalcNormal();
CalcBoundingRect();
}
function CalcNormal():void{
dir = Math.atan2((y1 - y0), (x1 - x0));
normalDir = (dir - (Math.PI * 0.5));
nx = Math.cos(normalDir);
ny = Math.sin(normalDir);
dx = (x1 - x0);
dy = (y1 - y0);
length = Math.sqrt(((dx * dx) + (dy * dy)));
udx = Math.cos(dir);
udy = Math.sin(dir);
}
function CalcBoundingRect():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = x0;
_local2 = x1;
if (_local1 > _local2){
_local1 = x1;
_local2 = x0;
};
_local3 = y0;
_local4 = y1;
if (_local3 > _local4){
_local3 = y1;
_local4 = y0;
};
boundingRect = new Rectangle(_local1, _local3, ((_local2 - _local1) + 1), ((_local4 - _local3) + 1));
}
}
}//package
Section 152
//Main (Main)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.ui.*;
public class Main extends MovieClip {
public var tf_scorespr:TextFormat;
public var tf_scorespr2:TextFormat;
var cheatMode:Boolean;
var levelTimer:Number;
var ftime:Number;
var framecounter:int;// = 0
var scrollY:Number;// = 0
public var tf_scorespr1:TextFormat;
private var screenB:Bitmap;
public var backgroundMC:MovieClip;
var levelTimerMax:Number;
public var mochiScores;
public var screenBD:BitmapData;
var gameState:int;// = 0
var currentTime:Number;// = 0
var secondCounter:Number;// = 0
public var fps:Number;
public var tf_scoresprblack:TextFormat;
static const gameState_HIGHSCORES = 5;
static const gameState_TITLE = 0;
static const gameState_LEVEL_PLAY = 2;
public static var theStage:Stage;
static var theRoot:MovieClip;
public function Main(){
currentTime = 0;
gameState = gameState_TITLE;
scrollY = 0;
framecounter = 0;
secondCounter = 0;
super();
theRoot = this;
theStage = this.root.stage;
SetEverythingUpOnce();
}
function calcFrameTime(){
var _local1:Number;
_local1 = currentTime;
currentTime = getTimer();
if (currentTime < _local1){
_local1 = (currentTime - 100);
};
if (currentTime > (_local1 + (100 * 10))){
_local1 = (100 * 10);
};
ftime = ((1 / (1000 / Defs.fps)) * (currentTime - _local1));
framecounter++;
secondCounter = (secondCounter + (currentTime - _local1));
if (secondCounter > 1000){
fps = ((Number(framecounter) / secondCounter) * 1000);
framecounter = 0;
secondCounter = 0;
};
ftime = 1;
}
function appDeactivateHandler(_arg1:Event):void{
KeyReader.Reset();
}
private function CreateTextField(_arg1:TextFormat, _arg2:Number, _arg3:Number, _arg4:String):TextField{
var _local5:TextField;
_local5 = new TextField();
_local5.selectable = false;
_local5.embedFonts = true;
_local5.autoSize = TextFieldAutoSize.CENTER;
_local5.x = _arg2;
_local5.y = _arg3;
_local5.text = _arg4;
_local5.setTextFormat(_arg1);
addChild(_local5);
return (_local5);
}
function AddMovieClip(_arg1:Number, _arg2:Number, _arg3:MovieClip):MovieClip{
_arg3.x = _arg1;
_arg3.y = _arg2;
addChild(_arg3);
return (_arg3);
}
function InitLevel(){
InitStageForGame();
Particles.Reset();
MouseControl.Reset();
Particles.Reset();
GameObjects.ClearAll();
Game.InitLevel();
}
public function DoMochiBot(_arg1:int){
if (_arg1 == 0){
MochiBot.track(this, "607b05a8");
};
}
function run(_arg1:Event):void{
KeyReader.UpdateOncePerFrame();
GraphicObjects.UpdateOncePerFrame();
if (Game.doSiteLock){
if (SiteLock.IsLocked()){
return;
};
};
calcFrameTime();
switch (gameState){
case gameState_TITLE:
TitleScreenState.Update(this);
break;
case gameState_HIGHSCORES:
break;
case gameState_LEVEL_PLAY:
RunLevel();
break;
};
}
function InitStageNoBackground(){
var _local1:int;
_local1 = (this.numChildren - 1);
while (_local1 >= 0) {
removeChildAt(_local1);
_local1--;
};
}
function SetEverythingUpOnce1():void{
theRoot = this;
theStage = this.root.stage;
Licensors.InitOnce();
Kong.InitOnce(this.root);
MusicPlayer.InitOnce();
KeyReader.InitOnce(theStage);
MouseControl.InitOnce(theStage);
theStage.addEventListener(Event.DEACTIVATE, appDeactivateHandler);
SoundPlayer.InitOnce(this);
PauseMenu.InitOnce(this);
Particles.InitOnce(this, 1000);
GameObjects.InitOnce(this, 500);
InitDrawScreen();
InitFonts();
GraphicObjects.InitOnce(this);
DoMochiBot(0);
theStage.frameRate = Defs.fps;
addEventListener(Event.ENTER_FRAME, run);
InitStage();
Game.Init(this);
SetGameState(gameState_TITLE);
}
function RunTitle(){
}
function SetEverythingUpOnce():void{
ExternalData.InitOnce(SetEverythingUpOnce1);
}
function InitFonts():void{
var _local1:Font;
_local1 = new Font20();
tf_scorespr = new TextFormat();
tf_scorespr1 = new TextFormat();
tf_scorespr2 = new TextFormat();
tf_scoresprblack = new TextFormat();
tf_scorespr.font = _local1.fontName;
tf_scorespr.size = 13;
tf_scorespr.color = 4294967295;
tf_scorespr1.font = _local1.fontName;
tf_scorespr1.size = 10;
tf_scorespr1.color = 4294967295;
tf_scorespr2.font = _local1.fontName;
tf_scorespr2.size = 10;
tf_scorespr2.color = 4294967295;
tf_scoresprblack.font = _local1.fontName;
tf_scoresprblack.size = 13;
tf_scoresprblack.color = 0;
}
function InitStage(){
var _local1:int;
_local1 = (this.numChildren - 1);
while (_local1 >= 0) {
removeChildAt(_local1);
_local1--;
};
addChild(screenB);
screenB.x = 0;
screenB.y = 0;
}
function Render(){
var _local1:Number;
var _local2:Number;
this.x = 0;
this.y = 0;
_local1 = 4;
_local2 = 4;
Game.Render();
}
function InitDrawScreen():void{
screenBD = new BitmapData(Defs.displayarea_w, Defs.displayarea_h, true, 0);
screenB = new Bitmap(screenBD);
}
function SetGameState(_arg1:int):void{
gameState = _arg1;
Mouse.show();
switch (gameState){
case gameState_TITLE:
TitleScreenState.Init(this);
break;
case gameState_HIGHSCORES:
break;
case gameState_LEVEL_PLAY:
InitLevel();
break;
};
}
function InitStageForGame(){
var _local1:int;
_local1 = (this.numChildren - 1);
while (_local1 >= 0) {
removeChildAt(_local1);
_local1--;
};
addChild(screenB);
screenB.x = 0;
screenB.y = 0;
}
function RunLevel(){
if (PauseMenu.IsPaused() == false){
Game.UpdateGameplay();
};
Render();
}
}
}//package
Section 153
//MochiAd (MochiAd)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return ("2.3");
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var f:Function;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
f = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
mc._mochiad_ctr_failed = true;
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["sendHighScore", _arg1], _arg2, _arg3);
return (true);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _cleanup(_arg1:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
idx = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = _local1.loaderInfo.bytesTotal;
if ((((_local4 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.parent._mochiad_ctr_failed){
options.ad_failed();
_local3 = true;
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _loadCommunicator(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var clipname:String;
var server:String;
var depth:Number;
var mc:MovieClip;
var lv:URLVariables;
var k:String;
var lc:LocalConnection;
var name:String;
var req:URLRequest;
var loader:Loader;
var options = _arg1;
DEFAULTS = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
clipname = ("_mochiad_com_" + options.id);
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip[clipname]){
return (clip[clipname]);
};
server = (options.com_server + options.id);
MochiAd._allowDomains(server);
delete options.id;
delete options.com_server;
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, clipname, depth);
lv = new URLVariables();
for (k in options) {
lv[k] = options[k];
};
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.name = name;
mc.lc = lc;
lv.lc = name;
mc._id = 0;
mc._queue = [];
mc.rpcResult = function (_arg1:Object):void{
var _local3:Array;
var _local4:Array;
var _local5:Number;
var _local6:Object;
var _local7:Object;
_arg1 = parseInt(_arg1.toString());
_local3 = mc._callbacks[_arg1];
if (typeof(_local3) == "undefined"){
return;
};
delete mc._callbacks[_arg1];
_local4 = [];
_local5 = 2;
while (_local5 < _local3.length) {
_local4.push(_local3[_local5]);
_local5++;
};
_local5 = 1;
while (_local5 < arguments.length) {
_local4.push(arguments[_local5]);
_local5++;
};
_local6 = _local3[1];
_local7 = _local3[0];
if (((_local7) && ((typeof(_local6) == "string")))){
_local6 = _local7[_local6];
};
if (typeof(_local6) == "function"){
_local6.apply(_local7, _local4);
};
};
mc._didConnect = function (_arg1:String):void{
var _local2:Array;
var _local3:Function;
var _local4:Number;
var _local5:Array;
mc._endpoint = _arg1;
_local2 = mc._queue;
delete mc._queue;
_local3 = mc.doSend;
_local4 = 0;
while (_local4 < _local2.length) {
_local5 = _local2[_local4];
_local3.apply(this, _local5);
_local4++;
};
};
mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{
var _local5:Number;
var _local6:LocalConnection;
var _local7:Array;
var _local8:Number;
if (mc._endpoint == null){
_local7 = [];
_local8 = 0;
while (_local8 < arguments.length) {
_local7.push(arguments[_local8]);
_local8++;
};
mc._queue.push(_local7);
return;
};
mc._id = (mc._id + 1);
_local5 = mc._id;
mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))];
_local6 = new LocalConnection();
_local6.send(mc._endpoint, "rpc", _local5, _arg1);
};
mc._callbacks = {};
mc._callbacks[0] = [mc, "_didConnect"];
lv.st = getTimer();
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
loader.load(req);
mc.addChild(loader);
mc._mochiad_com = loader;
return (mc);
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("5cc6f7dfb67f2f08341c831480f7c2a7".length == 0){
options.ad_started();
options.ad_finished();
return;
};
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
MochiAd._cleanup(mc);
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
bar.x = 10;
bar.y = (h - 20);
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
if (!chk.showing){
_local11 = _local2.loaderInfo.bytesTotal;
if ((((_local11 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local3 > chk.ad_timeout){
options.ad_failed();
_local4 = true;
};
};
};
if (this.parent._mochiad_ctr_failed){
options.ad_failed();
_local4 = true;
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(_arg1);
}
public static function fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3);
return (true);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 154
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 155
//MouseControl (MouseControl)
package {
import flash.events.*;
import flash.display.*;
public class MouseControl {
public static var mouseVelX:Number = 0;
public static var mouseVelY:Number = 0;
public static var mouseOldPosX:Number = 0;
public static var mouseOldPosY:Number = 0;
public static var mousePosX:Number = 0;
public static var mousePosY:Number = 0;
public static var buttonPressed:Boolean = false;
public static var buttonReleased:Boolean = false;
public static function MouseHandler(_arg1:MouseEvent):void{
mousePosX = _arg1.stageX;
mousePosY = _arg1.stageY;
mouseVelX = (mousePosX - mouseOldPosX);
mouseVelY = (mousePosY - mouseOldPosY);
mouseOldPosX = mousePosX;
mouseOldPosY = mousePosY;
}
public static function InitOnce(_arg1:Stage):void{
_arg1.addEventListener(MouseEvent.MOUSE_MOVE, MouseHandler);
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, MouseClickHandler);
_arg1.addEventListener(MouseEvent.MOUSE_UP, MouseUpHandler);
_arg1.addEventListener(MouseEvent.MOUSE_WHEEL, MouseWheelHandler);
}
public static function MouseUpHandler(_arg1:MouseEvent):void{
buttonPressed = false;
buttonReleased = true;
}
public static function MouseWheelHandler(_arg1:MouseEvent):void{
Game.HandleMouseWheel(_arg1.delta);
_arg1.preventDefault();
_arg1.stopPropagation();
}
public static function Reset():void{
buttonPressed = false;
buttonReleased = false;
}
public static function MouseClickHandler(_arg1:MouseEvent):void{
buttonPressed = true;
buttonReleased = false;
}
}
}//package
Section 156
//MusicPlayer (MusicPlayer)
package {
import flash.media.*;
public class MusicPlayer {
static var musicChannel:SoundChannel = null;
static var musicSound1:Sound;
static var musicSoundTransform:SoundTransform;
static var musicSound:Sound;
static var musicSoundTransform1:SoundTransform;
static var lastMusicID = -1;
static var musicChannel1:SoundChannel = null;
static var currentMusicID:int = -1;
static var doMusic:Boolean = true;
public static function PauseMusic(){
musicChannel.stop();
}
public static function StartMusic(_arg1:int){
if (doMusic == false){
return;
};
if (musicChannel != null){
musicChannel.stop();
};
if (musicChannel1 != null){
musicChannel1.stop();
};
if (_arg1 == 0){
musicSoundTransform = new SoundTransform(0.75, 0);
musicSound = new titleMusic();
musicChannel = musicSound.play(0, 999999, musicSoundTransform);
};
if (_arg1 == 1){
musicSoundTransform = new SoundTransform(0.75, 0);
musicSound = new ambient1();
musicChannel = musicSound.play(0, 999999, musicSoundTransform);
};
if (_arg1 == 2){
musicSoundTransform = new SoundTransform(0.75, 0);
musicSound = new ambient2();
musicChannel = musicSound.play(0, 999999, musicSoundTransform);
};
if (_arg1 == 3){
musicSoundTransform = new SoundTransform(0.75, 0);
musicSound = new ambient3();
musicChannel = musicSound.play(0, 999999, musicSoundTransform);
};
lastMusicID = _arg1;
}
public static function InitOnce():void{
doMusic = true;
lastMusicID = -1;
currentMusicID = -1;
}
public static function ResumeMusic(){
currentMusicID = (lastMusicID - 1);
StartMusic(lastMusicID);
}
}
}//package
Section 157
//newenemy (newenemy)
package {
import flash.media.*;
public dynamic class newenemy extends Sound {
}
}//package
Section 158
//noshot (noshot)
package {
import flash.media.*;
public dynamic class noshot extends Sound {
}
}//package
Section 159
//ObjAction (ObjAction)
package {
public class ObjAction {
var done:Boolean;
var param0:Number;
var time:int;
var actionFunction:Function;
public function ObjAction(_arg1:int, _arg2:Function, _arg3:Number){
time = _arg1;
actionFunction = _arg2;
done = false;
param0 = _arg3;
}
}
}//package
Section 160
//ObjectDef (ObjectDef)
package {
import flash.geom.*;
public class ObjectDef {
var dodgeMax:Number;
var animIDs:Array;
var score:int;
var booty_num:int;
var initFuncName:String;
var pathAnimType:int;
var booty_type:int;
var dodgeDist:Number;
var animNames:Array;
var type:int;
var collisionCircleOffsets:Array;
var particleExplodeID:int;
var NumParamA:Number;
var NumParamB:Number;
var NumParamC:Number;
var NumParamD:Number;
var exportName:String;
var NumParamG:Number;
var NumParamH:Number;
var dodgeFlag:Boolean;
var NumParamE:Number;
var NumParamF:Number;
var maxHealth:Number;
var collisionCircleRadii:Array;
var colRects:Array;
var shieldColRects:Array;
var dodgeMin:Number;
var shotControllers:Array;
public function ObjectDef(_arg1:String, _arg2:int, _arg3:Rectangle){
animNames = new Array();
animIDs = new Array();
colRects = new Array();
shieldColRects = new Array();
collisionCircleOffsets = new Array();
collisionCircleRadii = new Array();
exportName = _arg1;
type = _arg2;
colRects.push(_arg3.clone());
maxHealth = 1;
initFuncName = "";
shotControllers = new Array();
particleExplodeID = 0;
NumParamA = 0;
NumParamB = 0;
NumParamC = 0;
NumParamD = 0;
NumParamE = 0;
NumParamF = 0;
NumParamG = 0;
NumParamH = 0;
booty_num = 0;
booty_type = 0;
score = 0;
dodgeFlag = false;
}
public function SetInitFunc(_arg1:String){
initFuncName = _arg1;
}
public function AddShotController(_arg1:String, _arg2:int, _arg3:int, _arg4:Number, _arg5:Number, _arg6:Number):ShotController{
var _local7:ShotController;
_local7 = new ShotController();
_local7.Set(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
shotControllers.push(_local7);
return (_local7);
}
public function SetInitParams(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number){
NumParamA = _arg1;
NumParamB = _arg2;
NumParamC = _arg3;
NumParamD = _arg4;
NumParamE = _arg5;
NumParamF = _arg6;
NumParamG = _arg7;
NumParamH = _arg8;
}
public function SetPathAnimType(_arg1:int){
pathAnimType = _arg1;
}
public function DoesAnimIDExist(_arg1:String):Boolean{
var _local2:int;
var _local3:int;
_local2 = animNames.length;
_local3 = 0;
while (_local3 < _local2) {
if (animNames[_local3] == _arg1){
return (true);
};
_local3++;
};
return (false);
}
public function SetBooty(_arg1:int, _arg2:int, _arg3:int){
booty_num = _arg1;
booty_type = _arg2;
score = _arg3;
}
public function AddAnim(_arg1:String, _arg2:int){
animNames.push(_arg1);
animIDs.push(_arg2);
}
public function AddColRect(_arg1:Rectangle){
colRects.push(_arg1.clone());
}
public function SetDodge(_arg1:Number, _arg2:Number, _arg3:Number){
dodgeFlag = true;
dodgeDist = _arg1;
dodgeMin = _arg2;
dodgeMax = _arg3;
}
public function GetAnimIDFromName(_arg1:String):int{
var _local2:int;
var _local3:int;
_local2 = animNames.length;
_local3 = 0;
while (_local3 < _local2) {
if (animNames[_local3] == _arg1){
return (animIDs[_local3]);
};
_local3++;
};
trace(((("ERROR: Can't find anim name " + _arg1) + " on object ") + exportName));
return (40);
}
public function SetParticle(_arg1:int){
particleExplodeID = _arg1;
}
public function AddShieldColRect(_arg1:Rectangle){
shieldColRects.push(_arg1.clone());
}
public function SetHealth(_arg1:Number){
maxHealth = _arg1;
}
public function AddCollisionCircle(_arg1:Number, _arg2:Number, _arg3:Number){
collisionCircleOffsets.push(new Point(_arg1, _arg2));
collisionCircleRadii.push(_arg3);
}
}
}//package
Section 161
//ObjectDefs (ObjectDefs)
package {
import flash.geom.*;
public class ObjectDefs {
static var list:Array;
public static function Init(){
var _local1:ObjectDef;
list = new Array();
AddFromXml();
_local1 = new ObjectDef("Player", 0, new Rectangle(-10, -30, 20, 40));
_local1.SetHealth(100);
_local1.AddCollisionCircle(0, -17, 15);
_local1.AddCollisionCircle(0, -31, 15);
_local1.AddCollisionCircle(0, -45, 15);
list.push(_local1);
_local1 = new ObjectDef("Portal1", 0, new Rectangle(-20, -20, 40, 40));
_local1.AddAnim("idle", GraphicObjects.gfx_portal1);
_local1.SetHealth(200);
_local1.SetParticle(GraphicObjects.gfx_particle1);
list.push(_local1);
}
public static function AddFromXml(){
var _local1:XML;
var _local2:XML;
var _local3:ObjectDef;
var _local4:Rectangle;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:XML;
var _local13:XML;
var _local14:XML;
var _local15:ShotController;
var _local16:XML;
_local1 = ExternalData.xml;
_local5 = 0;
while (_local5 < _local1.objdef.length()) {
_local2 = _local1.objdef[_local5];
_local8 = Number(_local2.collisionrect.@x0);
_local9 = Number(_local2.collisionrect.@y0);
_local10 = (Number(_local2.collisionrect.@x1) - _local8);
_local11 = Number((_local2.collisionrect.@y1 - _local9));
_local4 = new Rectangle(_local8, _local9, _local10, _local11);
_local3 = new ObjectDef(_local2.@name, 0, _local4);
_local3.SetInitFunc(_local2.control.@initfunc);
_local3.SetParticle(int(_local2.control.@particleid));
_local3.SetInitParams(Number(_local2.control.@a), Number(_local2.control.@b), Number(_local2.control.@c), Number(_local2.control.@d), Number(_local2.control.@e), Number(_local2.control.@f), Number(_local2.control.@g), Number(_local2.control.@h));
_local3.SetHealth(Number(_local2.data.@health));
_local6 = 0;
while (_local6 < _local2.anim.length()) {
_local12 = _local2.anim[_local6];
_local3.AddAnim(_local12.@id, GraphicObjects.GetIdFromName(_local12.@graphic));
_local6++;
};
if (_local2.dodge.length() != 0){
_local3.SetDodge(Number(_local2.dodge.@dist), Number(_local2.dodge.@min), Number(_local2.dodge.@max));
};
_local6 = 0;
while (_local6 < _local2.booty.length()) {
_local13 = _local2.booty[_local6];
_local3.SetBooty(int(_local13.@num), int(_local13.@type), int(_local13.@score));
_local6++;
};
_local6 = 0;
while (_local6 < _local2.shotcontroller.length()) {
_local14 = _local2.shotcontroller[_local6];
_local15 = _local3.AddShotController(_local14.@bullettype, (Number(_local14.@minfreq) * Defs.fps2), (Number(_local14.@maxfreq) * Defs.fps2), Number(_local14.@speed), 0, 0);
_local7 = 0;
while (_local7 < _local14.shot.length()) {
_local16 = _local14.shot[_local7];
_local15.AddShot(_local16.@type, Number(_local16.@offset), Number(_local16.@delay));
_local7++;
};
if (_local14.offset.length() != 0){
_local15.SetFireOffset(Number(_local14.offset.@x), Number(_local14.offset.@y));
};
_local6++;
};
list.push(_local3);
_local5++;
};
}
public static function GetObjectDefByExportName(_arg1:String){
var _local2:ObjectDef;
var _local3:int;
var _local4:int;
_local4 = list.length;
_local3 = 0;
while (_local3 < _local4) {
_local2 = list[_local3];
if (_local2.exportName == _arg1){
return (_local2);
};
_local3++;
};
trace(("ERROR: ObjectDefs can't find object exportname " + _arg1));
return (null);
}
}
}//package
Section 162
//Particle (Particle)
package {
class Particle {
var graphicID:int;
public var yvel:Number;
var active:Boolean;
var maxframe:int;
var dir:Number;
public var xvel:Number;
var ypos:Number;
var updateFunction:Function;
var timer:Number;
var speed:Number;
var scale:Number;
var startx:Number;
var starty:Number;
var xpos:Number;
var alpha:Number;
var alphaAdd:Number;
var frame:Number;
var frameVel:Number;
var visible:Boolean;
var counter:int;
public function InitEnemyHitShield(){
var _local1:Number;
var _local2:int;
updateFunction = UpdateEnemyHitShield;
dir = Utils.RandCircle();
_local1 = dir;
_local1 = ((Math.PI * 2) - _local1);
_local1 = (_local1 + (Math.PI / 2));
while (_local1 > (Math.PI * 2)) {
_local1 = (_local1 - (Math.PI * 2));
};
speed = Utils.RandBetweenFloat(2, 4);
graphicID = GraphicObjects.gfx_particlehitshield;
maxframe = (GraphicObjects.GetNumFrames(graphicID) - 1);
frame = Utils.RandBetweenInt(0, maxframe);
_local2 = ((maxframe / (Math.PI * 2)) * _local1);
frame = _local2;
}
function PlayAnimation():Boolean{
frame = (frame + frameVel);
if (frame >= maxframe){
frame = maxframe;
return (true);
};
return (false);
}
public function InitExplode(_arg1:int){
updateFunction = UpdateExplode;
dir = Utils.RandCircle();
speed = Utils.RandBetweenFloat(6, 18);
graphicID = _arg1;
maxframe = (GraphicObjects.GetNumFrames(graphicID) - 1);
alpha = 1;
frame = 0;
frameVel = 1;
alphaAdd = Utils.RandBetweenFloat(-0.01, -0.03);
}
function UpdateVelsTimer(){
xpos = (xpos + xvel);
ypos = (ypos + yvel);
timer--;
if (timer <= 0){
active = false;
};
}
public function InitPlayerThrust(_arg1:Vec){
var _local2:Number;
var _local3:int;
updateFunction = UpdatePlayerThrust;
dir = (_arg1.rot + Math.PI);
dir = (dir + Utils.RandBetweenFloat(-0.5, 0.5));
speed = Utils.RandBetweenFloat(0.5, 1);
speed = (speed * _arg1.speed);
graphicID = GraphicObjects.gfx_particleplayerthrust;
maxframe = GraphicObjects.GetNumFrames(graphicID);
xpos = (xpos + (Math.cos(dir) * 20));
ypos = (ypos + (Math.sin(dir) * 20));
_local2 = dir;
_local2 = ((Math.PI * 2) - _local2);
_local2 = (_local2 + (Math.PI / 2));
while (_local2 > (Math.PI * 2)) {
_local2 = (_local2 - (Math.PI * 2));
};
_local3 = ((maxframe / (Math.PI * 2)) * _local2);
frame = _local3;
}
public function InitPlayerNoWeapon(_arg1:Number){
var _local2:int;
updateFunction = UpdatePlayerNoWeapon;
dir = _arg1;
dir = (dir - (Math.PI * 0.5));
dir = (dir + (Math.PI * 2));
dir = (dir + Utils.RandBetweenFloat(-0.2, 0.2));
speed = Utils.RandBetweenFloat(1, 2);
graphicID = GraphicObjects.gfx_particlehitshield;
maxframe = GraphicObjects.GetNumFrames(graphicID);
xpos = (xpos + (Math.cos(dir) * 20));
ypos = (ypos + (Math.sin(dir) * 20));
_local2 = Utils.RandBetweenInt(0, (maxframe - 1));
frame = _local2;
}
function UpdateQuota(){
xpos = (Game.scrollX + startx);
ypos = (Game.scrollY + starty);
scale = (scale + 0.001);
if (Game.levelState != Game.levelState_BonusTime){
active = false;
};
}
function UpdateEnemyHitShield(){
xvel = (Math.cos(dir) * speed);
yvel = (Math.sin(dir) * speed);
xpos = (xpos + xvel);
ypos = (ypos + yvel);
speed = (speed - 0.1);
if (speed <= 0){
speed = 0;
active = false;
};
}
function UpdatePlayerThrust(){
xvel = (Math.cos(dir) * speed);
yvel = (Math.sin(dir) * speed);
xpos = (xpos + xvel);
ypos = (ypos + yvel);
speed = (speed - 0.3);
if (speed <= 0){
speed = 0;
active = false;
};
}
public function InitQuota(){
startx = xpos;
starty = ypos;
updateFunction = UpdateQuota;
graphicID = GraphicObjects.gfx_particlequotadestroyed;
frame = 0;
scale = 1;
}
function UpdatePlayerNoWeapon(){
xvel = (Math.cos(dir) * speed);
yvel = (Math.sin(dir) * speed);
xpos = (xpos + xvel);
ypos = (ypos + yvel);
speed = (speed - 0.1);
if (speed <= 0){
speed = 0;
active = false;
};
}
public function InitDuckTrail(){
updateFunction = UpdateDuckTrail;
graphicID = GraphicObjects.gfx_playerweaponduck;
frame = 0;
xvel = Utils.RandBetweenFloat(-0.5, 0.5);
yvel = Utils.RandBetweenFloat(-0.5, 0.5);
}
public function InitCash(_arg1:int){
updateFunction = UpdateScore;
graphicID = GraphicObjects.gfx_particlescore;
frame = _arg1;
timer = 20;
}
function UpdateLevelEnds(){
var _local1:int;
xpos = (Game.scrollX + startx);
ypos = (Game.scrollY + starty);
_local1 = (Game.levelStateTimer / Defs.fps);
if (_local1 < 0){
_local1 = 0;
};
if (_local1 > 4){
_local1 = 4;
};
_local1 = (4 - _local1);
frame = (_local1 + 1);
if (Game.levelState != Game.levelState_BonusTime){
active = false;
};
}
function UpdateEnemyShotFired(){
if (PlayAnimation()){
active = false;
};
}
function UpdateBulletHitPlayerNoDie(){
if (PlayAnimation()){
active = false;
};
}
function UpdateExplode(){
xvel = (Math.cos(dir) * speed);
yvel = (Math.sin(dir) * speed);
xpos = (xpos + xvel);
ypos = (ypos + yvel);
frame = (frame + frameVel);
if (frame >= maxframe){
frame = maxframe;
};
speed = (speed - 0.3);
if (speed <= 0){
speed = 0;
active = false;
};
}
public function InitEnemyExplosion(){
updateFunction = UpdateEnemyExplosion;
graphicID = GraphicObjects.gfx_particleenemyexplode;
maxframe = (GraphicObjects.GetNumFrames(graphicID) - 1);
frame = 0;
frameVel = 1;
}
public function InitEnemyExplosionNoDie(){
updateFunction = UpdateEnemyExplosionNoDie;
graphicID = GraphicObjects.gfx_particleenemyhit;
maxframe = (GraphicObjects.GetNumFrames(graphicID) - 1);
frame = 0;
frameVel = 1;
}
public function InitEnemyShotFired(_arg1:int){
updateFunction = UpdateEnemyShotFired;
graphicID = GraphicObjects.gfx_particleenemyshotfired1;
maxframe = (GraphicObjects.GetNumFrames(graphicID) - 1);
frame = 0;
frameVel = 1;
}
public function InitEnemyHitNotDie(_arg1:int){
updateFunction = UpdateEnemyHitNotDie;
dir = Utils.RandCircle();
speed = Utils.RandBetweenFloat(3, 6);
graphicID = _arg1;
maxframe = (GraphicObjects.GetNumFrames(graphicID) - 1);
frameVel = 0.5;
frame = (maxframe - 5);
}
public function InitScore(_arg1:int){
updateFunction = UpdateScore;
graphicID = GraphicObjects.gfx_particlescore;
_arg1 = (_arg1 / 100);
_arg1--;
if (_arg1 < 0){
_arg1 = 0;
};
if (_arg1 > 9){
_arg1 = 9;
};
frame = (3 + _arg1);
timer = 60;
}
function UpdateScore(){
timer--;
if (timer < 0){
active = false;
};
}
public function InitLevelEnds(){
startx = xpos;
starty = ypos;
updateFunction = UpdateLevelEnds;
graphicID = GraphicObjects.gfx_particlequotadestroyed;
frame = 1;
}
function UpdateEnemyExplosion(){
if (PlayAnimation()){
active = false;
};
}
function UpdateEnemyHitNotDie(){
xvel = (Math.cos(dir) * speed);
yvel = (Math.sin(dir) * speed);
xpos = (xpos + xvel);
ypos = (ypos + yvel);
frame = (frame + frameVel);
if (frame >= maxframe){
frame = maxframe;
};
speed = (speed - 0.5);
if (speed <= 0){
speed = 0;
active = false;
};
}
public function InitCollectedPickup(){
updateFunction = UpdateAnimAndStop;
graphicID = GraphicObjects.gfx_particlepickup;
maxframe = (GraphicObjects.GetNumFrames(graphicID) - 1);
frame = 0;
frameVel = 1;
xvel = 0;
yvel = 0;
}
public function InitEnem1yBulletTrail(){
updateFunction = UpdateVelsTimer;
dir = Utils.RandCircle();
speed = Utils.RandBetweenFloat(3, 6);
xvel = (Math.cos(dir) * speed);
yvel = (Math.sin(dir) * speed);
graphicID = GraphicObjects.gfx_particle1;
maxframe = (GraphicObjects.GetNumFrames(graphicID) - 1);
frame = maxframe;
timer = 5;
}
function CycleAnimation():Boolean{
frame = (frame + frameVel);
if (frame >= maxframe){
frame = 0;
return (true);
};
return (false);
}
function UpdateEnemyExplosionNoDie(){
if (PlayAnimation()){
active = false;
};
}
function UpdateDuckTrail(){
xpos = (xpos + xvel);
ypos = (ypos + yvel);
scale = (scale - 0.05);
if (scale <= 0.1){
scale = 0.1;
active = false;
};
}
public function InitBulletHitPlayerNoDie(){
updateFunction = UpdateBulletHitPlayerNoDie;
graphicID = GraphicObjects.gfx_particlehitplayer;
maxframe = (GraphicObjects.GetNumFrames(graphicID) - 1);
frame = 0;
frameVel = 1;
}
function UpdateAnimAndStop(){
xpos = (xpos + xvel);
ypos = (ypos + yvel);
if (PlayAnimation()){
active = false;
};
}
}
}//package
Section 163
//Particle1 (Particle1)
package {
import flash.display.*;
public dynamic class Particle1 extends MovieClip {
}
}//package
Section 164
//Particle2 (Particle2)
package {
import flash.display.*;
public dynamic class Particle2 extends MovieClip {
}
}//package
Section 165
//Particle3 (Particle3)
package {
import flash.display.*;
public dynamic class Particle3 extends MovieClip {
}
}//package
Section 166
//Particle4 (Particle4)
package {
import flash.display.*;
public dynamic class Particle4 extends MovieClip {
}
}//package
Section 167
//ParticleEnemyDie1 (ParticleEnemyDie1)
package {
import flash.display.*;
public dynamic class ParticleEnemyDie1 extends MovieClip {
}
}//package
Section 168
//ParticleEnemyHitNoDie (ParticleEnemyHitNoDie)
package {
import flash.display.*;
public dynamic class ParticleEnemyHitNoDie extends MovieClip {
}
}//package
Section 169
//ParticleEnemyShotFired1 (ParticleEnemyShotFired1)
package {
import flash.display.*;
public dynamic class ParticleEnemyShotFired1 extends MovieClip {
}
}//package
Section 170
//ParticleHitPlayer (ParticleHitPlayer)
package {
import flash.display.*;
public dynamic class ParticleHitPlayer extends MovieClip {
}
}//package
Section 171
//ParticleHitShield (ParticleHitShield)
package {
import flash.display.*;
public dynamic class ParticleHitShield extends MovieClip {
}
}//package
Section 172
//ParticleHitShield1 (ParticleHitShield1)
package {
import flash.display.*;
public dynamic class ParticleHitShield1 extends MovieClip {
}
}//package
Section 173
//ParticlePickup (ParticlePickup)
package {
import flash.display.*;
public dynamic class ParticlePickup extends MovieClip {
}
}//package
Section 174
//ParticlePlayerThrust (ParticlePlayerThrust)
package {
import flash.display.*;
public dynamic class ParticlePlayerThrust extends MovieClip {
}
}//package
Section 175
//ParticlePlayerThrust1 (ParticlePlayerThrust1)
package {
import flash.display.*;
public dynamic class ParticlePlayerThrust1 extends MovieClip {
}
}//package
Section 176
//ParticleQuotaDestroyed (ParticleQuotaDestroyed)
package {
import flash.display.*;
public dynamic class ParticleQuotaDestroyed extends MovieClip {
}
}//package
Section 177
//Particles (Particles)
package {
import flash.display.*;
import flash.geom.*;
public class Particles {
public static const type_dust = 0;
static var max:int;
static var list:Array;
static var main:Main;
static var nextIndex:int;
public function Particles():void{
}
public static function Add(_arg1:Number, _arg2:Number):Particle{
var _local3:Number;
var _local4:Number;
var _local5:Particle;
_local5 = list[nextIndex];
nextIndex++;
if (nextIndex >= max){
nextIndex = 0;
};
_local5.active = true;
_local5.timer = 0;
_local5.alpha = 1;
_local5.alphaAdd = 0;
_local5.visible = true;
_local5.xpos = _arg1;
_local5.ypos = _arg2;
_local5.scale = 1;
return (_local5);
}
public static function GetNextIndex():int{
return (nextIndex);
}
public static function Reset(){
var _local1:int;
nextIndex = 0;
_local1 = 0;
while (_local1 < max) {
list[_local1].active = false;
_local1++;
};
}
public static function Update(_arg1:Number){
var _local2:int;
var _local3:Particle;
_local2 = 0;
while (_local2 < max) {
_local3 = list[_local2];
if (_local3.active == true){
_local3.updateFunction();
};
_local2++;
};
}
public static function InitOnce(_arg1:Main, _arg2:int):void{
var _local3:int;
main = _arg1;
max = _arg2;
nextIndex = 0;
list = new Array(max);
_local3 = 0;
while (_local3 < max) {
list[_local3] = new Particle();
list[_local3].active = false;
_local3++;
};
}
public static function CountActive():int{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
while (_local2 < max) {
if (list[_local2].active){
_local1++;
};
_local2++;
};
return (_local1);
}
public static function Render(_arg1:Main){
var _local2:Number;
var _local3:Number;
var _local4:BitmapData;
var _local5:int;
var _local6:Particle;
var _local7:Number;
var _local8:Number;
_local2 = Game.scrollX;
_local3 = Game.scrollY;
_local4 = _arg1.screenBD;
_local5 = 0;
while (_local5 < max) {
_local6 = list[_local5];
if (((_local6.active) && (_local6.visible))){
_local7 = (_local6.xpos - _local2);
_local8 = (_local6.ypos - _local3);
if (_local6.scale != 1){
GraphicObjects.RenderAtRotScaled(_local6.graphicID, int(_local6.frame), _local4, _local7, _local8, false, _local6.scale, 0);
} else {
GraphicObjects.RenderAt(_local6.graphicID, int(_local6.frame), _local4, _local7, _local8);
};
};
_local5++;
};
}
}
}//package
Section 178
//PauseMenu (PauseMenu)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
public class PauseMenu {
static var active:Boolean;
static var pauseMC:MovieClip;
static var main:Main;
public function PauseMenu():void{
}
public static function buttonQuitPressed(_arg1:MouseEvent){
Unpause();
Game.main.SetGameState(Main.gameState_TITLE);
}
public static function buttonSoundPressed(_arg1:MouseEvent){
var _local2:Boolean;
_local2 = MusicPlayer.doMusic;
if (_local2 == true){
MusicPlayer.PauseMusic();
MusicPlayer.doMusic = false;
} else {
MusicPlayer.doMusic = true;
MusicPlayer.ResumeMusic();
};
_local2 = SoundPlayer.doSFX;
SoundPlayer.doSFX = (_local2 == false);
if (MusicPlayer.doMusic){
pauseMC.selectedSound.gotoAndStop(2);
} else {
pauseMC.selectedSound.gotoAndStop(1);
};
}
public static function buttonContinuePressed(_arg1:MouseEvent){
Unpause();
}
public static function buttonHelpPressed(_arg1:MouseEvent){
TitleScreenState.InitHelpText1();
}
public static function InitOnce(_arg1:Main):void{
main = _arg1;
active = false;
}
public static function Pause():void{
Game.pause = true;
Mouse.show();
pauseMC = TitleScreenState.mc_PauseScreen;
main.addChild(pauseMC);
pauseMC.buttonSound.addEventListener(MouseEvent.CLICK, buttonSoundPressed, false, 0, true);
pauseMC.buttonQuit.addEventListener(MouseEvent.CLICK, buttonQuitPressed, false, 0, true);
pauseMC.buttonContinue.addEventListener(MouseEvent.CLICK, buttonContinuePressed, false, 0, true);
pauseMC.buttonHelp.addEventListener(MouseEvent.CLICK, buttonHelpPressed, false, 0, true);
active = true;
pauseMC.selectedSound.textNumber.text = "";
TitleScreenState.KongButton(pauseMC);
TitleScreenState.MoreGamesButton(pauseMC);
TitleScreenState.GuideButton(pauseMC);
if (MusicPlayer.doMusic){
pauseMC.selectedSound.gotoAndStop(2);
} else {
pauseMC.selectedSound.gotoAndStop(1);
};
}
public static function Unpause():void{
Mouse.hide();
active = false;
Game.main.removeChild(pauseMC);
pauseMC = null;
KeyReader.InitOnce(Game.main.stage);
Game.pause = false;
}
public static function IsPaused():Boolean{
return (active);
}
}
}//package
Section 179
//PauseScreen (PauseScreen)
package {
import flash.display.*;
public dynamic class PauseScreen extends MovieClip {
public var selectedSound:LevelBox;
public var buttonMoreGames:SimpleButton;
public var buttonKong:SimpleButton;
public var buttonHelp:SimpleButton;
public var buttonQuit:SimpleButton;
public var buttonGuide:SimpleButton;
public var buttonContinue:SimpleButton;
public var buttonSound:SimpleButton;
}
}//package
Section 180
//pickup (pickup)
package {
import flash.media.*;
public dynamic class pickup extends Sound {
}
}//package
Section 181
//Pickup1 (Pickup1)
package {
import flash.display.*;
public dynamic class Pickup1 extends MovieClip {
}
}//package
Section 182
//Pickup2 (Pickup2)
package {
import flash.display.*;
public dynamic class Pickup2 extends MovieClip {
}
}//package
Section 183
//Pickup3 (Pickup3)
package {
import flash.display.*;
public dynamic class Pickup3 extends MovieClip {
}
}//package
Section 184
//Player (Player)
package {
import flash.display.*;
public dynamic class Player extends MovieClip {
}
}//package
Section 185
//PlayerWeapon (PlayerWeapon)
package {
import flash.geom.*;
public class PlayerWeapon {
var graphicID:int;
var bulletDamage:Array;
var homingRates:Array;
var powerCharge:Number;
var homingTurnRates:Array;
var collisionPoly:Array;
var playerWeaponGroup:PlayerWeaponGroup;
var fireTimer:int;
var bulletRates:Array;
var fireRate:int;
var type:int;
var speed:Number;
var homingSpeed:Array;
var angle:Number;
var homingDamage:Array;
var bulletSpeed:Array;
var levels:Array;
var damage:Number;
var powerChargeRates:Array;
var initFunc:Function;
var turnRate:Number;
static const lev_rate = 0;
static const lev_speed = 1;
static const lev_damage = 2;
static const lev_charge = 4;
static const lev_max = 5;
static const lev_turnRate = 3;
public function PlayerWeapon(){
speed = 1;
damage = 1;
fireRate = 1;
graphicID = GraphicObjects.gfx_playerweapon00;
initFunc = null;
collisionPoly = null;
playerWeaponGroup = null;
}
public function GetFireRate():int{
if (playerWeaponGroup == null){
return (1);
};
return (playerWeaponGroup.firerate);
}
public function GetFireAngle():Number{
return (angle);
}
public function GetSpeed():Number{
return (playerWeaponGroup.speed);
}
public function Reset(){
fireTimer = 1;
}
public function IncreaseLevel(_arg1:int, _arg2:int){
levels[_arg1] = (levels[_arg1] + _arg2);
if (levels[_arg1] >= 4){
levels[_arg1] = 4;
};
}
public function GetDamage():Number{
return (playerWeaponGroup.damage);
}
public function Setup(_arg1:Function, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number){
Reset();
initFunc = _arg1;
angle = _arg2;
fireRate = _arg3;
speed = _arg4;
damage = _arg5;
}
public function SetGraphicID(_arg1:int){
graphicID = _arg1;
}
public function SetLevel(_arg1:int, _arg2:int){
levels[_arg1] = _arg2;
}
public function IsActive():Boolean{
return (true);
}
public function AddCollisionPolyPoint(_arg1:Number, _arg2:Number){
if (collisionPoly == null){
collisionPoly = new Array();
};
collisionPoly.push(new Point(_arg1, _arg2));
}
}
}//package
Section 186
//PlayerWeapon00 (PlayerWeapon00)
package {
import flash.display.*;
public dynamic class PlayerWeapon00 extends MovieClip {
}
}//package
Section 187
//PlayerWeapon01 (PlayerWeapon01)
package {
import flash.display.*;
public dynamic class PlayerWeapon01 extends MovieClip {
}
}//package
Section 188
//PlayerWeapon02 (PlayerWeapon02)
package {
import flash.display.*;
public dynamic class PlayerWeapon02 extends MovieClip {
}
}//package
Section 189
//PlayerWeapon03 (PlayerWeapon03)
package {
import flash.display.*;
public dynamic class PlayerWeapon03 extends MovieClip {
}
}//package
Section 190
//PlayerWeapon04 (PlayerWeapon04)
package {
import flash.display.*;
public dynamic class PlayerWeapon04 extends MovieClip {
}
}//package
Section 191
//PlayerWeapon05 (PlayerWeapon05)
package {
import flash.display.*;
public dynamic class PlayerWeapon05 extends MovieClip {
}
}//package
Section 192
//PlayerWeapon06 (PlayerWeapon06)
package {
import flash.display.*;
public dynamic class PlayerWeapon06 extends MovieClip {
}
}//package
Section 193
//PlayerWeapon07 (PlayerWeapon07)
package {
import flash.display.*;
public dynamic class PlayerWeapon07 extends MovieClip {
}
}//package
Section 194
//PlayerWeapon08 (PlayerWeapon08)
package {
import flash.display.*;
public dynamic class PlayerWeapon08 extends MovieClip {
}
}//package
Section 195
//PlayerWeapon09 (PlayerWeapon09)
package {
import flash.display.*;
public dynamic class PlayerWeapon09 extends MovieClip {
}
}//package
Section 196
//PlayerWeapon10 (PlayerWeapon10)
package {
import flash.display.*;
public dynamic class PlayerWeapon10 extends MovieClip {
}
}//package
Section 197
//PlayerWeapon11 (PlayerWeapon11)
package {
import flash.display.*;
public dynamic class PlayerWeapon11 extends MovieClip {
}
}//package
Section 198
//PlayerWeaponBFG (PlayerWeaponBFG)
package {
import flash.display.*;
public dynamic class PlayerWeaponBFG extends MovieClip {
}
}//package
Section 199
//PlayerWeaponDiagonals (PlayerWeaponDiagonals)
package {
import flash.display.*;
public dynamic class PlayerWeaponDiagonals extends MovieClip {
}
}//package
Section 200
//PlayerWeaponDuck (PlayerWeaponDuck)
package {
import flash.display.*;
public dynamic class PlayerWeaponDuck extends MovieClip {
}
}//package
Section 201
//PlayerWeaponFatHomer (PlayerWeaponFatHomer)
package {
import flash.display.*;
public dynamic class PlayerWeaponFatHomer extends MovieClip {
}
}//package
Section 202
//PlayerWeaponGroup (PlayerWeaponGroup)
package {
public class PlayerWeaponGroup {
var timer:int;
var reloadTime:int;
var name:String;
var fireSoundID:int;
var weapons:Array;
var id:int;
var firerate:int;
var speed:Number;
var mode:int;
var shotTime:int;
var frame:int;
var damage:Number;
var shotDim:int;
var shots:Number;
var maxShots:int;
var shotDimRate:Number;
public function PlayerWeaponGroup(){
id = 0;
mode = 0;
timer = 0;
weapons = new Array();
shots = 0;
maxShots = 0;
reloadTime = 0;
shotDim = 0;
fireSoundID = 0;
frame = 0;
name = "";
damage = 0;
firerate = 0;
speed = 0;
shotTime = 0;
}
}
}//package
Section 203
//PlayerWeaponReverse (PlayerWeaponReverse)
package {
import flash.display.*;
public dynamic class PlayerWeaponReverse extends MovieClip {
}
}//package
Section 204
//PlayerWeaponRicochet (PlayerWeaponRicochet)
package {
import flash.display.*;
public dynamic class PlayerWeaponRicochet extends MovieClip {
}
}//package
Section 205
//PlayerWeaponShortSpread (PlayerWeaponShortSpread)
package {
import flash.display.*;
public dynamic class PlayerWeaponShortSpread extends MovieClip {
}
}//package
Section 206
//Poly (Poly)
package {
import flash.display.*;
import flash.geom.*;
public class Poly {
var param0:String;
var param1:String;
var subTypeName:String;
var active:Boolean;
var name:String;
var pointList:Array;
var typeName:String;
var boundingRectangle:Rectangle;
var iparam0:int;
var lineList:Array;
var closed:Boolean;
var hitCallback:Object;
var type:int;
var catmullRomLength:Number;
public static const polytype_WALL = 1;
public static const polytype_CEILING = 6;
public static const polytype_ZONE = 3;
public static const polytype_PATH = 0;
public static const polytype_FLOOR = 5;
public static const polytype_OVERLAY = 4;
public static const polytype_TRIGGER = 2;
public function Poly(_arg1:String, _arg2:int, _arg3:Number, _arg4:Number):void{
lineList = new Array();
active = true;
type = _arg2;
name = _arg1;
boundingRectangle = null;
hitCallback = null;
closed = false;
pointList = new Array();
pointList.push(new Point(_arg3, _arg4));
}
function PointOnCurve(_arg1:Number, _arg2:Point, _arg3:Point, _arg4:Point, _arg5:Point):Point{
var _local6:Point;
var _local7:Number;
var _local8:Number;
_local6 = new Point();
_local7 = (_arg1 * _arg1);
_local8 = (_local7 * _arg1);
_local6.x = (0.5 * ((((2 * _arg3.x) + ((-(_arg2.x) + _arg4.x) * _arg1)) + (((((2 * _arg2.x) - (5 * _arg3.x)) + (4 * _arg4.x)) - _arg5.x) * _local7)) + ((((-(_arg2.x) + (3 * _arg3.x)) - (3 * _arg4.x)) + _arg5.x) * _local8)));
_local6.y = (0.5 * ((((2 * _arg3.y) + ((-(_arg2.y) + _arg4.y) * _arg1)) + (((((2 * _arg2.y) - (5 * _arg3.y)) + (4 * _arg4.y)) - _arg5.y) * _local7)) + ((((-(_arg2.y) + (3 * _arg3.y)) - (3 * _arg4.y)) + _arg5.y) * _local8)));
return (_local6);
}
public function GetPoint(_arg1:int):Point{
return (new Point(pointList[_arg1].x, pointList[_arg1].y));
}
public function GetPointNormal(_arg1:int):Point{
return (new Point(lineList[_arg1].nx, lineList[_arg1].ny));
}
public function GetPointOnCatmullRom(_arg1:Number):Point{
var _local2:int;
var _local3:int;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Point;
var _local8:Number;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Point;
_local2 = GetNumPoints();
if (_local2 < 4){
return (new Point(0, 0));
};
_local3 = (_local2 - 1);
_local8 = (Number(_local3) * _arg1);
_local9 = _local8;
_local10 = (_local9 - 1);
_local11 = _local9;
_local12 = (_local9 + 1);
_local13 = (_local9 + 2);
if (_local10 < 0){
_local10 = 0;
};
if (_local12 > (_local2 - 1)){
_local12 = (_local2 - 1);
};
if (_local13 > (_local2 - 1)){
_local13 = (_local2 - 1);
};
_local4 = pointList[_local10];
_local5 = pointList[_local11];
_local6 = pointList[_local12];
_local7 = pointList[_local13];
_local14 = (_local9 + 1);
_local15 = ((1 / Number(_local3)) * _local9);
_local16 = ((1 / Number(_local3)) * _local14);
_local17 = ((1 / (_local16 - _local15)) * (_arg1 - _local15));
_local18 = PointOnCurve(_local17, _local4, _local5, _local6, _local7);
return (_local18);
}
public function AddLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Line;
var _local6:Rectangle;
_local5 = new Line(_arg1, _arg2, _arg3, _arg4);
lineList.push(_local5);
pointList.push(new Point(_arg3, _arg4));
if (boundingRectangle == null){
boundingRectangle = _local5.boundingRect;
} else {
_local6 = boundingRectangle.clone();
boundingRectangle = _local6.union(_local5.boundingRect);
};
}
public function GetLine(_arg1:int):Line{
return (lineList[_arg1]);
}
public function CalculateCatmullRomLength(){
var _local1:Array;
var _local2:int;
var _local3:int;
var _local4:Number;
var _local5:Point;
var _local6:Point;
var _local7:Point;
_local1 = new Array();
_local3 = GetNumPoints();
if (_local3 < 4){
catmullRomLength = 0;
} else {
_local4 = 0;
while (_local4 < 1) {
_local5 = GetPointOnCatmullRom(_local4);
_local1.push(_local5);
_local4 = (_local4 + 0.025);
};
};
catmullRomLength = 0;
_local2 = 0;
while (_local2 < (_local1.length - 2)) {
_local6 = _local1[_local2];
_local7 = _local1[(_local2 + 1)];
catmullRomLength = (catmullRomLength + Utils.DistBetweenPoints(_local6.x, _local6.y, _local7.x, _local7.y));
_local2++;
};
_local1 = null;
}
public function Finish(_arg1:Boolean){
var _local2:Line;
var _local3:Line;
var _local4:Line;
var _local5:Rectangle;
if (_arg1){
_local2 = lineList[0];
_local3 = lineList[(lineList.length - 1)];
_local4 = new Line(_local3.x1, _local3.y1, _local2.x0, _local2.y0);
lineList.push(_local4);
_local5 = boundingRectangle.clone();
boundingRectangle = _local5.union(_local4.boundingRect);
};
closed = _arg1;
}
public function GetCatmullRomLength():Number{
return (catmullRomLength);
}
public function GetNumLines():int{
return (lineList.length);
}
public function OffsetFromStartPoint(){
var _local1:*;
var _local2:*;
var _local3:int;
var _local4:Line;
_local1 = -(pointList[0].x);
_local2 = -(pointList[0].y);
_local3 = 0;
while (_local3 < pointList.length) {
pointList[_local3].x = (pointList[_local3].x + _local1);
pointList[_local3].y = (pointList[_local3].y + _local2);
_local3++;
};
_local3 = 0;
while (_local3 < lineList.length) {
_local4 = lineList[_local3];
lineList[_local3].x0 = (_local4.x0 + _local1);
_local4.x1 = (_local4.x1 + _local1);
_local4.y0 = (_local4.y0 + _local2);
_local4.y1 = (_local4.y1 + _local2);
_local3++;
};
}
public function DrawCatmullRom(_arg1:BitmapData, _arg2:uint, _arg3:Number, _arg4:Number){
var _local5:int;
var _local6:Number;
var _local7:Point;
_local5 = GetNumPoints();
if (_local5 < 4){
return;
};
_local6 = 0;
while (_local6 < 1) {
_local7 = GetPointOnCatmullRom(_local6);
_arg1.setPixel32((_local7.x + _arg3), (_local7.y + _arg4), _arg2);
_local6 = (_local6 + 0.001);
};
}
public function GetNumPoints():int{
return (pointList.length);
}
public static function PolyFromPointList(_arg1:Array):Poly{
var _local2:Point;
var _local3:Point;
var _local4:Poly;
var _local5:int;
var _local6:int;
_local2 = _arg1[0];
_local4 = new Poly("", 0, _local2.x, _local2.y);
_local5 = _arg1.length;
_local6 = 0;
while (_local6 < (_local5 - 1)) {
_local2 = _arg1[_local6];
_local3 = _arg1[(_local6 + 1)];
_local4.AddLine(_local2.x, _local2.y, _local3.x, _local3.y);
_local6++;
};
_local4.Finish(true);
return (_local4);
}
public static function FindAllByType(_arg1:int, _arg2:Array):Array{
var _local3:Array;
var _local4:Poly;
_local3 = new Array();
for each (_local4 in _arg2) {
if (_local4.type == _arg1){
_local3.push(_local4);
};
};
return (_local3);
}
public static function FindByName(_arg1:String, _arg2:Array):Poly{
var _local3:Poly;
for each (_local3 in _arg2) {
if (_local3.name == _arg1){
return (_local3);
};
};
return (null);
}
public static function FindIndexByName(_arg1:String, _arg2:Array):int{
var _local3:int;
var _local4:Poly;
_local3 = 0;
for each (_local4 in _arg2) {
if (_local4.name == _arg1){
return (_local3);
};
_local3++;
};
return (-1);
}
}
}//package
Section 207
//Portal (Portal)
package {
import flash.display.*;
public dynamic class Portal extends MovieClip {
}
}//package
Section 208
//Portal1 (Portal1)
package {
import flash.display.*;
public dynamic class Portal1 extends MovieClip {
}
}//package
Section 209
//PortalDef (PortalDef)
package {
public class PortalDef {
var portalGroups:Array;
var numPortals:int;
var maxtime:int;
var index:int;
var type:int;
var mintime:int;
public function PortalDef(_arg1:int, _arg2:Number, _arg3:Number){
type = 0;
portalGroups = new Array();
numPortals = _arg1;
mintime = (_arg2 * Defs.fps2);
maxtime = (_arg3 * Defs.fps2);
}
public function GetName():String{
return (portalGroups[index].enemyName);
}
public function AddGroup(_arg1:PortalGroup){
portalGroups.push(_arg1);
}
public function GetRandomTime():int{
return (Utils.RandBetweenInt(mintime, maxtime));
}
public function GetFrequency():int{
return (portalGroups[index].frequency);
}
public function GetMax():int{
return (portalGroups[index].maxGen);
}
public function GetNextIndex(){
var _local1:Array;
var _local2:int;
var _local3:PortalGroup;
_local1 = new Array();
_local2 = 0;
for each (_local3 in portalGroups) {
if (_local3.timer <= 0){
_local1.push(_local2);
};
_local2++;
};
if (_local1.length == 0){
index = 0;
} else {
Game.currentPortalGroup++;
if (Game.currentPortalGroup >= _local1.length){
Game.currentPortalGroup = 0;
};
index = _local1[Game.currentPortalGroup];
};
}
public function Randomise(){
var _local1:Array;
var _local2:int;
var _local3:PortalGroup;
var _local4:int;
_local1 = new Array();
_local2 = 0;
for each (_local3 in portalGroups) {
if (_local3.timer <= 0){
_local1.push(_local2);
};
_local2++;
};
_local4 = Utils.RandBetweenInt(0, (_local1.length - 1));
index = _local1[_local4];
}
public function GetMode():int{
return (portalGroups[index].mode);
}
public function GetMin():int{
return (portalGroups[index].minGen);
}
}
}//package
Section 210
//portalDoors (portalDoors)
package {
import flash.media.*;
public dynamic class portalDoors extends Sound {
}
}//package
Section 211
//PortalGroup (PortalGroup)
package {
public class PortalGroup {
var maxGen:int;
var mode:int;
var enemyName:String;
var timer:int;
var frequency:int;
var minGen:int;
var initialDelay:int;
public static const mode_atplayer = 0;
public static const mode_random = 1;
public function PortalGroup(){
timer = 0;
}
public function Update(){
if (timer > 0){
timer--;
};
}
public function Init(_arg1:String, _arg2:int, _arg3:int, _arg4:Number, _arg5:Number, _arg6:String){
enemyName = _arg1;
minGen = _arg2;
maxGen = _arg3;
frequency = (_arg4 * Defs.fps);
initialDelay = (_arg5 * Defs.fps);
timer = initialDelay;
mode = mode_atplayer;
if (_arg6 == "atplayer"){
mode = mode_atplayer;
};
if (_arg6 == "random"){
mode = mode_random;
};
}
}
}//package
Section 212
//powerBar (powerBar)
package {
import flash.display.*;
public dynamic class powerBar extends MovieClip {
}
}//package
Section 213
//PreLevelScreen (PreLevelScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class PreLevelScreen extends MovieClip {
public var textUnlocked:TextField;
public var textLevelCash:TextField;
public var buttonShop:SimpleButton;
public var textCurrentLevel:TextField;
public var buttonMoreGames:SimpleButton;
public var buttonKong:SimpleButton;
public var textLevelScore:TextField;
public var textLevelInfo:TextField;
public var textLevelTime:TextField;
public var textCurrentLevel1:TextField;
public var buttonGuide:SimpleButton;
public var buttonContinue:SimpleButton;
}
}//package
Section 214
//rocket1 (rocket1)
package {
import flash.media.*;
public dynamic class rocket1 extends Sound {
}
}//package
Section 215
//rocket2 (rocket2)
package {
import flash.media.*;
public dynamic class rocket2 extends Sound {
}
}//package
Section 216
//SaveData (SaveData)
package {
import flash.net.*;
public class SaveData {
static var id:String = "HeavyWeapons";
public static function Clear():void{
var _local1:SharedObject;
_local1 = SharedObject.getLocal(id);
_local1.clear();
_local1.close();
_local1.flush();
trace("SaveData Data Cleared");
trace(("len: " + _local1.size));
}
public static function Save():void{
var _local1:int;
var _local2:SharedObject;
var _local3:ShopWeapon;
var _local4:Object;
_local2 = SharedObject.getLocal(id);
if (_local2 == null){
trace("SO null");
return;
};
if (_local2.size == 0){
trace("SO size 0");
};
_local2.clear();
_local2.data.cash = Game.cash;
_local2.data.currentLevel = Game.currentLevel;
_local2.data.levelsCompleted = Game.levelsCompleted;
_local2.data.weaponsOwned = new Array();
for each (_local3 in Shop.weapons) {
_local2.data.weaponsOwned.push(_local3.owned);
};
trace(("weapons " + Shop.weapons.length));
_local2.data.weaponsEquipped = new Array();
for each (_local3 in Shop.weapons) {
_local2.data.weaponsEquipped.push(_local3.equipped);
};
_local2.data.equippedWeaponList = new Array();
for each (_local1 in Shop.equippedWeaponList) {
_local2.data.equippedWeaponList.push(_local1);
};
trace(("equippedWeaponList " + Shop.equippedWeaponList.length));
_local4 = new Object();
_local4.topScore = Stats.topScore;
_local4.numKills = Stats.numKills;
_local4.highestLevel = Stats.highestLevel;
_local4.totalCash = Stats.totalCash;
_local4.topScore = Stats.topScore;
_local4.levels_bestScore = new Array(100);
_local4.levels_mostCash = new Array(100);
_local4.levels_bestTime = new Array(100);
_local1 = 0;
while (_local1 < 100) {
_local4.levels_bestScore[_local1] = Stats.levels_bestScore[_local1];
_local4.levels_mostCash[_local1] = Stats.levels_mostCash[_local1];
_local4.levels_bestTime[_local1] = Stats.levels_bestTime[_local1];
_local1++;
};
_local2.data.stats = _local4;
_local2.close();
}
public static function Load():void{
var _local1:SharedObject;
var _local2:int;
var _local3:ShopWeapon;
var _local4:Object;
_local1 = SharedObject.getLocal(id);
if (_local1 == null){
trace((("Shared Object: " + id) + " is null"));
return;
};
if (_local1.size == 0){
trace((("Shared Object: " + id) + " size=0"));
_local1.close();
return;
};
Game.cash = _local1.data.cash;
Game.currentLevel = _local1.data.currentLevel;
Game.levelsCompleted = _local1.data.levelsCompleted;
trace(("loading weapons " + Shop.weapons.length));
_local2 = 0;
for each (_local3 in Shop.weapons) {
_local3.owned = _local1.data.weaponsOwned[_local2];
_local2++;
};
_local2 = 0;
for each (_local3 in Shop.weapons) {
_local3.equipped = _local1.data.weaponsEquipped[_local2];
_local2++;
};
_local2 = 0;
while (_local2 < Shop.equippedWeaponList.length) {
Shop.equippedWeaponList[_local2] = _local1.data.equippedWeaponList[_local2];
_local2++;
};
_local4 = _local1.data.stats;
Stats.topScore = _local4.topScore;
Stats.numKills = _local4.numKills;
Stats.highestLevel = _local4.highestLevel;
Stats.totalCash = _local4.totalCash;
Stats.topScore = _local4.topScore;
_local2 = 0;
while (_local2 < 100) {
Stats.levels_bestScore[_local2] = _local4.levels_bestScore[_local2];
Stats.levels_mostCash[_local2] = _local4.levels_mostCash[_local2];
Stats.levels_bestTime[_local2] = _local4.levels_bestTime[_local2];
_local2++;
};
_local1.close();
trace("Loaded data OK");
}
public static function DontLoad():void{
}
public static function Exists():Boolean{
var _local1:SharedObject;
_local1 = SharedObject.getLocal(id);
if (_local1 == null){
trace((("Shared Object: " + id) + " null"));
return (false);
};
if (_local1.size == 0){
trace((("Shared Object: " + id) + " size 0"));
_local1.close();
return (false);
};
_local1.close();
return (true);
}
public static function DontSave():void{
}
}
}//package
Section 217
//ScoreParticles (ScoreParticles)
package {
import flash.display.*;
public dynamic class ScoreParticles extends MovieClip {
}
}//package
Section 218
//SetupScript (SetupScript)
package {
import flash.geom.*;
public class SetupScript {
static const outputMessages:Boolean = false;
static var main:Main;
static var lastGOGeneratedX;
static var lastGOGeneratedY;
static var lineStartX:int;
static var lineStartY:int;
static var lineType:int;
static var lineRectangle:Rectangle;
static var currentPoly:Poly;
static var lastGOGenerated;
static var lineList:Array;
public static function InitOnce(_arg1:Main){
main = _arg1;
}
static function AddPickup(_arg1:int, _arg2:int):void{
}
static function AddEnemy(_arg1:String, _arg2:int, _arg3:int, _arg4:int):void{
}
static function AddObject(_arg1:String, _arg2:int, _arg3:int, _arg4:String, _arg5:String, _arg6:String, _arg7:int=0, _arg8:int=0, _arg9:Number=0, _arg10:Number=0):void{
var _local11:GameObj;
}
static function LineEnd(_arg1:Boolean){
if (outputMessages){
trace((("SetupScript.LineEnd(" + _arg1) + ");"));
};
currentPoly.Finish(_arg1);
currentPoly.OffsetFromStartPoint();
currentPoly.CalculateCatmullRomLength();
Game.polygonList.push(currentPoly);
}
static function LineStart(_arg1:String, _arg2:int, _arg3:int, _arg4:int, _arg5:String="", _arg6:String="", _arg7:String="", _arg8:String=""){
if (outputMessages){
trace((((((("SetupScript.LineStart(" + _arg2) + ", ") + _arg3) + ", ") + _arg4) + ");"));
};
lineStartX = _arg2;
lineStartY = _arg3;
lineType = _arg4;
currentPoly = new Poly(_arg1, _arg4, _arg2, _arg3);
currentPoly.typeName = _arg5;
currentPoly.subTypeName = _arg6;
currentPoly.iparam0 = int(_arg7);
}
static function LineAdd(_arg1:int, _arg2:int, _arg3:int){
if (outputMessages){
trace((((((("SetupScript.LineAdd(" + _arg1) + ", ") + _arg2) + ", ") + _arg3) + ");"));
};
currentPoly.AddLine(lineStartX, lineStartY, _arg1, _arg2);
lineStartX = _arg1;
lineStartY = _arg2;
}
static function AddExit(_arg1:int, _arg2:int):void{
}
}
}//package
Section 219
//ShipAppearTube (ShipAppearTube)
package {
import flash.display.*;
public dynamic class ShipAppearTube extends MovieClip {
}
}//package
Section 220
//Shop (Shop)
package {
import flash.events.*;
import flash.display.*;
public class Shop {
static var currentBuyWeapon:ShopWeapon;
static var dragObjName:String;
static var endOfLevel:Boolean;
static var weapons:Array;
public static var equippedWeaponList:Array;
public static var equippedWeaponObjList:Array;
public static var equippedHealth:int;
static var mode:int = 0;
static var overlayMC:MovieClip;
static var weaponScreen:MovieClip;
public static var equippedExtra:int;
static var equipWeaponSlotName:String;
static function CanBuyWeapon(_arg1:ShopWeapon):Boolean{
if (Game.cash >= _arg1.price){
return (true);
};
return (false);
}
public static function EquipItem(_arg1:int, _arg2:int){
var _local3:int;
if (equippedWeaponList[_arg1] == -1){
equippedWeaponList[_arg1] = _arg2;
weapons[_arg2].equipped = true;
} else {
_local3 = equippedWeaponList[_arg1];
weapons[_local3].equipped = false;
equippedWeaponList[_arg1] = _arg2;
weapons[_arg2].equipped = true;
};
}
static function OpenBuyWeaponScreen(_arg1:String){
var _local2:ShopWeapon;
_local2 = GetShopWeaponFromName(_arg1);
currentBuyWeapon = _local2;
overlayMC = TitleScreenState.mc_weaponDetails;
Game.main.addChild(overlayMC);
overlayMC.textWeaponCost.text = _local2.price.toString();
if (CanBuyWeapon(currentBuyWeapon)){
overlayMC.textWeaponName.text = _local2.name;
overlayMC.textWeaponDescription.text = _local2.description;
overlayMC.weaponFrame.gotoAndStop(_local2.frameNumber);
} else {
overlayMC.textWeaponName.text = "?????";
overlayMC.textWeaponDescription.text = "?????";
overlayMC.weaponFrame.gotoAndStop(1);
};
overlayMC.buttonBuy.addEventListener(MouseEvent.CLICK, Pressed_BuyWeapon, false, 0, true);
overlayMC.buttonClose.addEventListener(MouseEvent.CLICK, Pressed_CloseBuyWeapon, false, 0, true);
overlayMC.buttonBuy.visible = true;
if (CanBuyWeapon(currentBuyWeapon) == false){
overlayMC.buttonBuy.visible = false;
};
}
static function UpdateStuff():void{
var _local1:XML;
var _local2:int;
var _local3:ShopWeapon;
var _local4:MovieClip;
var _local5:*;
_local1 = Game.GetLevelXml(Game.currentLevel);
weaponScreen.levelText.text = int((Game.currentLevel + 1)).toString();
weaponScreen.levelText1.text = _local1.info.@name;
weaponScreen.cashText.text = Game.cash;
weaponScreen.scoreText.text = Game.currentScore;
if (weapons == null){
return;
};
_local2 = 0;
while (_local2 < weapons.length) {
_local3 = weapons[_local2];
_local4 = weaponScreen[("item" + (_local2 + 1).toString())];
if (_local3.owned){
if (_local3.equipped){
_local4.buttonBack.gotoAndStop(3);
} else {
_local4.buttonBack.gotoAndStop(2);
};
_local4.textName.text = _local3.name;
_local4.textCost.text = "";
_local4.weapon.gotoAndStop(_local3.frameNumber);
} else {
_local4.buttonBack.gotoAndStop(1);
if (CanBuyWeapon(_local3)){
_local4.weapon.gotoAndStop(_local3.frameNumber);
_local4.textName.text = "BUY";
_local4.textCost.text = _local3.price.toString();
} else {
_local4.weapon.gotoAndStop(1);
_local4.textName.text = "Cant Afford It";
_local4.textCost.text = _local3.price.toString();
};
};
if (_local3.equipped){
_local4.weapon.visible = false;
} else {
_local4.weapon.visible = true;
};
_local2++;
};
_local2 = 0;
while (_local2 < 3) {
_local4 = weaponScreen[("weapon" + _local2.toString())];
_local5 = equippedWeaponList[_local2];
if (_local5 == -1){
_local4.textName.text = "Empty";
_local4.weapon.visible = false;
} else {
_local3 = weapons[_local5];
_local4.weapon.gotoAndStop(_local3.frameNumber);
_local4.textName.text = _local3.name;
_local4.weapon.visible = true;
};
_local2++;
};
}
static function weaponClicked(_arg1:MouseEvent):void{
var _local2:ShopWeapon;
dragObjName = _arg1.currentTarget.name;
_local2 = GetShopWeaponFromName(dragObjName);
if (_local2.owned == false){
OpenBuyWeaponScreen(dragObjName);
} else {
if (_local2.equipped == false){
OpenEquipWeaponScreen(dragObjName);
};
};
}
public static function buttonHelpPressed(_arg1:MouseEvent){
TitleScreenState.InitHelpText1();
}
public static function InitOnce(){
weapons = null;
equippedWeaponObjList = new Array();
equippedWeaponObjList.push(new PlayerWeaponGroup());
equippedWeaponObjList.push(new PlayerWeaponGroup());
equippedWeaponObjList.push(new PlayerWeaponGroup());
equippedWeaponList = new Array(3);
equippedWeaponList[0] = -1;
equippedWeaponList[1] = -1;
equippedWeaponList[2] = -1;
equippedHealth = -1;
equippedExtra = -1;
xmlLoaded();
}
static function GetShopWeaponFromName(_arg1:String):ShopWeapon{
var _local2:int;
var _local3:ShopWeapon;
_local2 = int(_arg1.substr(4));
_local2--;
_local3 = weapons[_local2];
return (_local3);
}
static function ExitStuff(){
var _local1:int;
var _local2:ShopWeapon;
var _local3:MovieClip;
_local1 = 0;
while (_local1 < weapons.length) {
_local2 = weapons[_local1];
_local3 = weaponScreen[("item" + (_local1 + 1).toString())];
_local3.removeEventListener(MouseEvent.CLICK, weaponClicked);
_local3.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverWeapon);
_local3.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutWeapon);
_local1++;
};
weaponScreen.buttonPlay.removeEventListener(MouseEvent.CLICK, buttonExitPressed);
weaponScreen.buttonHelp.removeEventListener(MouseEvent.CLICK, buttonHelpPressed);
weaponScreen.buttonBuyAll.removeEventListener(MouseEvent.CLICK, buttonBuyAllPressed);
}
static function CloseOverlay(){
if (overlayMC != null){
Game.main.removeChild(overlayMC);
overlayMC = null;
};
}
static function stopDrag(_arg1:MouseEvent):void{
var _local2:int;
var _local3:int;
if (mode != 1){
return;
};
mode = 0;
_local2 = int(_arg1.currentTarget.name.substr(6));
_local3 = int(dragObjName.substr(4));
trace(_local2);
trace(_local3);
EquipItem(_local2, (_local3 - 1));
UpdateStuff();
Game.goPlayer.SetWeaponSlot(_local2);
}
static function Pressed_CloseEquipWeapon(_arg1:MouseEvent):void{
CloseOverlay();
}
static function Pressed_BuyWeapon(_arg1:MouseEvent):void{
var _local2:int;
var _local3:ShopWeapon;
if (CanBuyWeapon(currentBuyWeapon) == false){
return;
};
Game.cash = (Game.cash - currentBuyWeapon.price);
currentBuyWeapon.owned = true;
CloseOverlay();
UpdateStuff();
OpenEquipWeaponScreen(dragObjName);
_local2 = 0;
for each (_local3 in weapons) {
if (_local3.owned){
_local2++;
};
};
Kong.SubmitStat(_local2, "NumWeapons");
}
static function Pressed_CloseBuyWeapon(_arg1:MouseEvent):void{
CloseOverlay();
}
static function InitStuff():void{
var _local1:int;
var _local2:MovieClip;
var _local3:ShopWeapon;
var _local4:MovieClip;
_local1 = 0;
while (_local1 < weapons.length) {
_local3 = weapons[_local1];
_local4 = weaponScreen[("item" + (_local1 + 1).toString())];
_local4.addEventListener(MouseEvent.CLICK, weaponClicked, false, 0, true);
_local4.addEventListener(MouseEvent.MOUSE_OVER, mouseOverWeapon, false, 0, true);
_local4.addEventListener(MouseEvent.MOUSE_OUT, mouseOutWeapon, false, 0, true);
_local1++;
};
}
static function mouseOutWeapon(_arg1:MouseEvent):void{
var _local2:ShopWeapon;
_local2 = GetShopWeaponFromName(_arg1.currentTarget.name);
weaponScreen.weaponDescriptionText.text = "";
}
static function mouseOverWeapon(_arg1:MouseEvent):void{
var _local2:ShopWeapon;
_local2 = GetShopWeaponFromName(_arg1.currentTarget.name);
if (_local2.owned){
weaponScreen.weaponDescriptionText.text = _local2.description;
} else {
weaponScreen.weaponDescriptionText.text = "";
};
}
public static function GetNumEquipped():int{
var _local1:int;
var _local2:int;
_local1 = 0;
for each (_local2 in equippedWeaponList) {
if (_local2 != -1){
_local1++;
};
};
return (_local1);
}
public static function Init(_arg1:Boolean){
var _local2:*;
if (Game.cheatMode){
Game.cash = 10000000;
};
endOfLevel = _arg1;
Game.pause = true;
if (TitleScreenState.mc_WeaponScreen == null){
TitleScreenState.mc_WeaponScreen = new WeaponScreen();
};
weaponScreen = Game.main.AddMovieClip(0, 0, TitleScreenState.mc_WeaponScreen);
_local2 = 1;
while (_local2 <= 21) {
weaponScreen[("item" + _local2.toString())].weapon.gotoAndStop(_local2);
_local2++;
};
weaponScreen.buttonPlay.addEventListener(MouseEvent.CLICK, buttonExitPressed, false, 0, true);
weaponScreen.buttonHelp.addEventListener(MouseEvent.CLICK, buttonHelpPressed, false, 0, true);
weaponScreen.weaponDescriptionText.text = "";
weaponScreen.buttonBuyAll.addEventListener(MouseEvent.CLICK, buttonBuyAllPressed, false, 0, true);
weaponScreen.buttonBuyAll.visible = false;
InitStuff();
mode = 0;
dragObjName = "";
UpdateStuff();
}
public static function buttonBuyAllPressed(_arg1:MouseEvent){
var _local2:ShopWeapon;
for each (_local2 in weapons) {
_local2.owned = true;
};
UpdateStuff();
}
static function Pressed_equippedWeapon1(_arg1:MouseEvent):void{
var _local2:int;
_local2 = int(equipWeaponSlotName.substr(4));
trace(equipWeaponSlotName);
trace(_local2);
EquipItem(0, (_local2 - 1));
UpdateStuff();
CloseOverlay();
}
static function Pressed_equippedWeapon2(_arg1:MouseEvent):void{
var _local2:int;
_local2 = int(equipWeaponSlotName.substr(4));
EquipItem(1, (_local2 - 1));
UpdateStuff();
CloseOverlay();
}
static function Pressed_equippedWeapon3(_arg1:MouseEvent):void{
var _local2:int;
_local2 = int(equipWeaponSlotName.substr(4));
EquipItem(2, (_local2 - 1));
UpdateStuff();
CloseOverlay();
}
public static function xmlLoaded(){
var _local1:XML;
var _local2:int;
var _local3:ShopWeapon;
_local1 = ExternalData.xml;
overlayMC = null;
weapons = new Array();
_local2 = 0;
while (_local2 < _local1.weapon.length()) {
weapons.push(new ShopWeapon(_local1.weapon[_local2].@weaponname, int(_local1.weapon[_local2].@id), int(_local1.weapon[_local2].shop.@cost), int(_local1.weapon[_local2].shop.@frame), _local1.weapon[_local2].@description));
_local2++;
};
for each (_local3 in weapons) {
_local3.owned = false;
};
weapons[0].owned = true;
EquipItem(0, 0);
}
static function OpenEquipWeaponScreen(_arg1:String){
var _local2:ShopWeapon;
var _local3:MovieClip;
equipWeaponSlotName = _arg1;
_local2 = GetShopWeaponFromName(_arg1);
currentBuyWeapon = _local2;
overlayMC = TitleScreenState.mc_allocateWeapon;
Game.main.addChild(overlayMC);
overlayMC.buttonSlot1.addEventListener(MouseEvent.CLICK, Pressed_equippedWeapon1, false, 0, true);
overlayMC.buttonSlot2.addEventListener(MouseEvent.CLICK, Pressed_equippedWeapon2, false, 0, true);
overlayMC.buttonSlot3.addEventListener(MouseEvent.CLICK, Pressed_equippedWeapon3, false, 0, true);
overlayMC.buttonClose.addEventListener(MouseEvent.CLICK, Pressed_CloseEquipWeapon, false, 0, true);
_local3 = weaponScreen[_arg1];
overlayMC.x = _local3.x;
if (_local3.x > 320){
overlayMC.x = (_local3.x - 100);
};
overlayMC.y = _local3.y;
}
public static function buttonExitPressed(_arg1:MouseEvent){
Game.levelstart_cash = Game.cash;
SaveData.Save();
ExitStuff();
Game.main.removeChild(weaponScreen);
weaponScreen = null;
if (!endOfLevel){
Game.pause = false;
};
TitleScreenState.InitPreLevelScreen();
}
}
}//package
Section 221
//ShopWeapon (ShopWeapon)
package {
public class ShopWeapon {
public var owned:Boolean;
public var price:int;
public var name:String;
public var id:int;
public var description:String;
public var frameNumber:int;
public var equipped:Boolean;
public function ShopWeapon(_arg1:String, _arg2:int, _arg3:int, _arg4:int, _arg5:String){
name = _arg1;
id = _arg2;
price = _arg3;
frameNumber = _arg4;
owned = false;
equipped = false;
description = _arg5;
}
public function Init(){
}
}
}//package
Section 222
//ShotController (ShotController)
package {
import flash.geom.*;
public class ShotController {
public var timer:int;
public var active:Boolean;
public var speed:Number;
public var yoff:Number;
var numShotsFired:int;
public var controlMode:int;
public var fireOffset:Point;
public var minFreq:int;
public var xoff:Number;
public var shots:Array;
public var type:String;
public var maxFreq:int;
public var freq:int;
public function Set(_arg1:String, _arg2:int, _arg3:int, _arg4:Number, _arg5:Number, _arg6:Number){
timer = 0;
type = _arg1;
minFreq = _arg2;
maxFreq = _arg3;
xoff = _arg5;
yoff = _arg6;
speed = _arg4;
freq = 0;
controlMode = 0;
shots = new Array();
numShotsFired = 0;
active = true;
fireOffset = new Point(0, 0);
}
public function SetFireOffset(_arg1:Number, _arg2:Number){
trace(((("set fire offset " + _arg1) + " ") + _arg2));
fireOffset.x = _arg1;
fireOffset.y = _arg2;
}
public function clone():ShotController{
var _local1:ShotController;
var _local2:ShotControllerShot;
_local1 = new ShotController();
_local1.timer = timer;
_local1.xoff = xoff;
_local1.yoff = yoff;
_local1.minFreq = minFreq;
_local1.maxFreq = maxFreq;
_local1.type = type;
_local1.freq = freq;
_local1.speed = speed;
_local1.controlMode = controlMode;
_local1.numShotsFired = numShotsFired;
_local1.active = active;
_local1.shots = new Array();
_local1.fireOffset = fireOffset.clone();
for each (_local2 in shots) {
_local1.shots.push(_local2.clone());
};
return (_local1);
}
public function AddShot(_arg1:String, _arg2:Number, _arg3:Number){
var _local4:ShotControllerShot;
_local4 = new ShotControllerShot();
_local4.offset = (((Math.PI * 2) / 360) * _arg2);
_local4.delay = (_arg3 * Defs.fps2);
if (_arg1 == "atplayer"){
_local4.type = ShotControllerShot.type_atplayer;
};
if (_arg1 == "absolute"){
_local4.type = ShotControllerShot.type_absolute;
};
if (_arg1 == "dir"){
_local4.type = ShotControllerShot.type_dir;
};
shots.push(_local4);
}
public function Reset(){
var _local1:ShotControllerShot;
timer = Utils.RandBetweenInt(0, minFreq);
for each (_local1 in shots) {
_local1.timer = timer;
};
controlMode = 0;
}
public function Update(_arg1:GameObj){
var _local2:Number;
var _local3:Number;
var _local4:ShotControllerShot;
var _local5:GameObj;
var _local6:Matrix;
var _local7:Point;
var _local8:Particle;
_local2 = 0;
_local3 = 0;
if (controlMode == 0){
timer++;
if (timer >= freq){
timer = 0;
freq = Utils.RandBetweenInt(minFreq, maxFreq);
numShotsFired = 0;
controlMode = 1;
for each (_local4 in shots) {
_local4.fired = false;
_local4.timer = 0;
};
};
} else {
if (controlMode == 1){
for each (_local4 in shots) {
if (_local4.fired == false){
_local4.timer++;
if (_local4.timer >= _local4.delay){
_local4.fired = true;
_local4.timer = 0;
if (((!((fireOffset.x == 0))) || (!((fireOffset.y == 0))))){
_local6 = new Matrix();
_local6.rotate(_arg1.fireOffsetDir);
_local7 = _local6.transformPoint(fireOffset);
_local2 = _local7.x;
_local3 = _local7.y;
};
_local5 = GameObjects.AddObj(((_arg1.xpos + xoff) + _local2), ((_arg1.ypos + yoff) + _local3), (_arg1.zpos - 10));
_local5.InitEnemyBullet(this, _local4, _arg1);
if (_local5.objectDef.particleExplodeID != 0){
_local8 = Particles.Add(((_arg1.xpos + xoff) + _local2), ((_arg1.ypos + yoff) + _local3));
_local8.InitEnemyShotFired(_local5.objectDef.particleExplodeID);
};
numShotsFired++;
};
};
};
if (numShotsFired >= shots.length){
controlMode = 0;
};
};
};
}
}
}//package
Section 223
//ShotControllerShot (ShotControllerShot)
package {
public class ShotControllerShot {
var delay:int;
var timer:int;
var fired:Boolean;
var offset:Number;
var type:int;
static const type_atplayer = 0;
static const type_absolute = 1;
static const type_dir = 2;
public function ShotControllerShot(){
type = 0;
offset = 0;
delay = 0;
timer = 0;
fired = false;
}
public function clone():ShotControllerShot{
var _local1:ShotControllerShot;
_local1 = new ShotControllerShot();
_local1.type = type;
_local1.offset = offset;
_local1.delay = delay;
_local1.timer = timer;
_local1.fired = fired;
return (_local1);
}
}
}//package
Section 224
//ShotDef (ShotDef)
package {
public class ShotDef {
var spreadRange:Number;
var name:String;
var spreadAng:Number;
var intervalTicks:Number;
var numShots:int;
var type:int;
public function ShotDef(_arg1:String){
name = _arg1;
type = 0;
intervalTicks = 0;
}
public function SetSpreadPulse(_arg1:Number, _arg2:int, _arg3:Number, _arg4=-1){
intervalTicks = (Defs.fps * _arg1);
type = 1;
numShots = _arg2;
spreadRange = Utils.DegToRad(_arg3);
spreadAng = -1;
if (_arg4 != -1){
spreadAng = Utils.DegToRad(_arg4);
};
}
public function SetNormal(_arg1:Number){
intervalTicks = (Defs.fps * _arg1);
type = 0;
}
}
}//package
Section 225
//SiteLock (SiteLock)
package {
import flash.events.*;
public class SiteLock {
static var miniclip_locked:Boolean = false;
static var sitelockActive:Boolean = false;
public static function InitOnce():void{
}
static function onValidDomain(_arg1:Event):void{
trace("Miniclip sitelock OK");
miniclip_locked = false;
}
public static function IsLocked():Boolean{
var _local1:String;
_local1 = GetDomain();
if (Licensors.GetLicensor() == Licensors.LICENSOR_KONGREGATE){
if (_local1 != "kongregate.com"){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_SHOCKWAVE){
if (_local1 != "shockwave.com"){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_KING){
if (((!((_local1 == "king.com"))) && (!((_local1 == "midasplayer.com"))))){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_GAMEZHERO){
if (_local1 != "gamezhero.com"){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_ARMORGAMES){
if (_local1 != "armorgames.com"){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_BUBBLEBOX){
if (_local1 != "bubblebox.com"){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_ANDKON){
if (_local1 != "andkon.com"){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_BIGFISH){
if (((((((((((!((_local1 == "bigfishgames.com"))) && (!((_local1 == "bigfishgames.de"))))) && (!((_local1 == "bigfishgames.fr"))))) && (!((_local1 == "bigfishgames.es"))))) && (!((_local1 == "bigfishgames.mx"))))) && (!((_local1 == "bigfishgames.jp"))))){
return (true);
};
return (false);
};
return (false);
}
public static function GetDomain():String{
var _local1:String;
var _local2:Number;
var _local3:Number;
var _local4:String;
var _local5:Number;
var _local6:Number;
_local1 = Main.theStage.loaderInfo.url;
_local2 = (_local1.indexOf("://") + 3);
_local3 = _local1.indexOf("/", _local2);
_local4 = _local1.substring(_local2, _local3);
_local5 = (_local4.lastIndexOf(".") - 1);
_local6 = (_local4.lastIndexOf(".", _local5) + 1);
_local4 = _local4.substring(_local6, _local4.length);
return (_local4);
}
public static function GetDomainFromUrl(_arg1:String):String{
var _local2:Number;
var _local3:Number;
var _local4:String;
var _local5:Number;
var _local6:Number;
_local2 = (_arg1.indexOf("://") + 3);
_local3 = _arg1.indexOf("/", _local2);
_local4 = _arg1.substring(_local2, _local3);
_local5 = (_local4.lastIndexOf(".") - 1);
_local6 = (_local4.lastIndexOf(".", _local5) + 1);
_local4 = _local4.substring(_local6, _local4.length);
return (_local4);
}
static function onInvalidDomain(_arg1:Event):void{
trace("Miniclip sitelock INVALID");
miniclip_locked = true;
}
}
}//package
Section 226
//SoundPlayer (SoundPlayer)
package {
import flash.media.*;
import flash.utils.*;
public class SoundPlayer {
public static const gfx_pickup = 20;
public static const gfx_rocket1 = 22;
public static const gfx_rocket2 = 23;
public static const gfx_lazer11 = 16;
public static const gfx_bigexplosion = 26;
public static const gfx_lazer7 = 12;
public static const gfx_lasercanon1 = 4;
public static const gfx_lazer10 = 15;
public static const gfx_vortex = 24;
public static const gfx_lazerbounce = 5;
public static const minPlayTime = 3;
public static const gfx_portalDoors = 21;
public static const sfx_explosion1 = 0;
public static const sfx_explosion2 = 1;
public static const sfx_explosion3 = 2;
public static const sfx_explosion4 = 3;
public static const gfx_noshot = 27;
static const maxSounds = 6;
public static const gfx_wtfboom = 25;
public static const gfx_lazer2 = 7;
public static const gfx_lazer3 = 8;
public static const gfx_lazer4 = 9;
public static const gfx_lazer5 = 10;
public static const gfx_lazer6 = 11;
public static const gfx_lazer9 = 14;
public static const gfx_lazer13 = 18;
public static const gfx_lazer8 = 13;
public static const SOUND_MAX = 6;
public static const gfx_newenemy = 19;
public static const gfx_lazer12 = 17;
public static const gfx_lazer1 = 6;
static var channel:SoundChannel;
static var active = false;
public static var startTimes:Array;
public static var sound:Sound;
public static var soundTransform:SoundTransform;
public static var sounds:Array;
static var timer:Timer;
public static var lengths:Array;
static var Instances:Array;
public static var soundNames:Array;
public static var volumes:Array;
static var playingFlag:Boolean;
static var main:Main;
static var timers:Array;
public static var soundTransforms:Array;
static var doSFX:Boolean;
public static var soundChannels:Array;
static function AddSound(_arg1:Number, _arg2:Number){
startTimes.push((_arg1 * 1000));
lengths.push((_arg2 * 1000));
sounds.push(null);
}
public static function Play(_arg1:int):void{
var _local2:SoundTransform;
var _local3:Sound;
var _local4:int;
var _local5:SoundPlay;
if (_local4 == -1){
trace("ERROR - SOUNDID");
return;
};
if (doSFX == false){
return;
};
if (timers[_arg1] != 0){
return;
};
timers[_arg1] = 10;
if (sounds[_arg1] != null){
_local3 = sounds[_arg1];
_local2 = new SoundTransform();
_local2.volume = volumes[_arg1];
_local2.pan = Utils.RandBetweenFloat(-0.5, 0.5);
_local3.play(0, 0, _local2);
} else {
_local4 = 0;
while (_local4 < maxSounds) {
_local5 = Instances[_local4];
if (_local5.Active() == false){
_local5.Play(_arg1);
return;
};
_local4++;
};
};
}
public static function UpdateOncePerFrame():void{
var _local1:int;
var _local2:int;
var _local3:int;
_local2 = timers.length;
_local1 = 0;
while (_local1 < _local2) {
_local3 = timers[_local1];
if (_local3 > 0){
_local3--;
timers[_local1] = _local3;
};
_local1++;
};
}
public static function InitOnce(_arg1:Main):void{
var _local2:int;
var _local3:SoundPlay;
doSFX = true;
main = _arg1;
Instances = new Array(maxSounds);
_local2 = 0;
while (_local2 < maxSounds) {
_local3 = new SoundPlay();
_local3.Clear();
Instances[_local2] = _local3;
_local2++;
};
volumes = new Array();
startTimes = new Array();
lengths = new Array();
sounds = new Array();
soundChannels = new Array();
soundTransforms = new Array();
soundNames = new Array();
timers = new Array();
AddSound1(new explosion1(), "explosion1");
AddSound1(new explosion2(), "explosion1");
AddSound1(new explosion3(), "explosion1");
AddSound1(new explosion4(), "explosion4");
AddSound1(new lasercanon1(), "lasercanon1");
AddSound1(new lazerbounce(), "lazerbounce");
AddSound1(new lazer1(), "lazer1");
AddSound1(new lazer2(), "lazer2");
AddSound1(new lazer3(), "lazer3");
AddSound1(new lazer4(), "lazer4");
AddSound1(new lazer5(), "lazer5");
AddSound1(new lazer6(), "lazer6");
AddSound1(new lazer7(), "lazer7");
AddSound1(new lazer8(), "lazer8");
AddSound1(new lazer9(), "lazer9");
AddSound1(new lazer10(), "lazer10");
AddSound1(new lazer11(), "lazer11");
AddSound1(new lazer12(), "lazer12");
AddSound1(new lazer13(), "lazer13");
AddSound1(new newenemy(), "newenemy");
AddSound1(new pickup(), "pickup");
AddSound1(new portalDoors(), "portalDoors");
AddSound1(new rocket1(), "rocket1");
AddSound1(new rocket2(), "rocket2");
AddSound1(new vortex(), "vortex");
AddSound1(new wtfBoom(), "wtfBoom");
AddSound1(new BigChargeExplosion(), "BigChargeExplosion");
AddSound1(new noshot(), "noshot");
soundTransform = new SoundTransform(1, 0);
active = true;
playingFlag = false;
}
static function AddSound1(_arg1:Sound, _arg2:String, _arg3:Number=1){
sounds.push(_arg1);
startTimes.push(0);
lengths.push(0);
soundNames.push(_arg2);
timers.push(0);
volumes.push(_arg3);
}
public static function GetSoundIdFromString(_arg1:String):int{
var _local2:int;
_local2 = 0;
while (_local2 < soundNames.length) {
if (_arg1 == soundNames[_local2]){
return (_local2);
};
_local2++;
};
return (-1);
}
}
}//package
import flash.events.*;
import flash.media.*;
import flash.utils.*;
class SoundPlay {
private var channel:SoundChannel;
private var timer:Timer;
private var playingFlag;
private function SoundPlay(){
}
private function timerHandler(_arg1:TimerEvent):void{
timer.stop();
channel.stop();
playingFlag = false;
}
public function Clear():void{
playingFlag = false;
timer = null;
}
public function Active():Boolean{
return (playingFlag);
}
public function Play(_arg1:int):void{
channel = SoundPlayer.sound.play(SoundPlayer.startTimes[_arg1], 1, SoundPlayer.soundTransform);
timer = new Timer(SoundPlayer.lengths[_arg1]);
timer.addEventListener(TimerEvent.TIMER, timerHandler);
timer.start();
playingFlag = true;
}
}
Section 227
//StartOrContinueScreen (StartOrContinueScreen)
package {
import flash.display.*;
public dynamic class StartOrContinueScreen extends MovieClip {
public var buttonNewGame:SimpleButton;
public var buttonContinue:SimpleButton;
}
}//package
Section 228
//Stats (Stats)
package {
public class Stats {
static var highestLevel:int;
static var topScore:int;
public static var levelNumKills:int;
static var totalCash:int;
public static var levelDamage:int;
static var levels_bestTime:Array;
static var numLevel:int;
static var levels_mostCash:Array;
static var numKills:int;
public static var levelTime:int;
static var numWeaponsOwned:int;
public static var levelCash:int;
public static var levelScore:int;
static var levels_bestScore:Array;
public static function EndLevel(){
var _local1:int;
_local1 = Game.currentLevel;
levelTime = Game.levelTimer;
if (levelCash > levels_mostCash[_local1]){
levels_mostCash[_local1] = levelCash;
};
if (levelScore > levels_bestScore[_local1]){
levels_bestScore[_local1] = levelScore;
};
if (levelTime < levels_bestTime[_local1]){
levels_bestTime[_local1] = levelTime;
};
if ((Game.currentLevel + 1) > highestLevel){
highestLevel = (Game.currentLevel + 1);
};
if (Game.currentScore > topScore){
topScore = Game.currentScore;
};
}
public static function StartLevel(){
levelNumKills = 0;
levelScore = 0;
levelTime = 0;
levelCash = 0;
levelDamage = 0;
}
public static function InitOnce(){
var _local1:int;
levels_mostCash = new Array();
levels_bestScore = new Array();
levels_bestTime = new Array();
_local1 = 0;
while (_local1 < 100) {
levels_bestScore.push(int(0));
levels_mostCash.push(int(0));
levels_bestTime.push(int(99999999));
_local1++;
};
topScore = 0;
numKills = 0;
numWeaponsOwned = 0;
highestLevel = 0;
totalCash = 0;
levelNumKills = 0;
levelScore = 0;
levelTime = 0;
levelCash = 0;
}
}
}//package
Section 229
//StreamBullet (StreamBullet)
package {
import flash.display.*;
public dynamic class StreamBullet extends MovieClip {
}
}//package
Section 230
//Symbol8 (Symbol8)
package {
import flash.display.*;
public dynamic class Symbol8 extends MovieClip {
}
}//package
Section 231
//TailPiece (TailPiece)
package {
public class TailPiece {
var graphicID:int;
var frame:int;
var dir:Number;
var ypos:Number;
var xpos:Number;
}
}//package
Section 232
//titleMusic (titleMusic)
package {
import flash.media.*;
public dynamic class titleMusic extends Sound {
}
}//package
Section 233
//TitlePage (TitlePage)
package {
import flash.display.*;
import flash.text.*;
public dynamic class TitlePage extends MovieClip {
public var textFrameUpdate:TextField;
public var buttonHighScores:SimpleButton;
public var buttonStart:SimpleButton;
public var buttonMoreGames:SimpleButton;
public var buttonKong:SimpleButton;
}
}//package
Section 234
//TitleScreenState (TitleScreenState)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class TitleScreenState {
static var mc_allocateWeapon:MovieClip;
static var mc_TitlePage:MovieClip;
static var veryFirstTime:Boolean = true;
static var mc_weaponDetails:MovieClip;
static var mc_instructions:MovieClip;
static var mc_StartOrContinueScreen:MovieClip;
static var creditsMC:MovieClip;
static var main:Main;
static var mc_PauseScreen:MovieClip;
static var mc_instructions0:MovieClip;
static var mc_instructions1:MovieClip;
static var helpTextFristTime:Boolean;
public static var mc_WeaponScreen:MovieClip;
static var mc_AllLevelsCompleteScreen:MovieClip;
static var mc_PreLevelScreen:MovieClip;
static var mc_GameOverScreen:MovieClip;
static var overlayMC:MovieClip;
static var mc_LevelCompleteScreen:MovieClip;
static var titleMC:MovieClip;
static var blockerOverlay:MovieClip;
static var blockerFunction:Function;
static function buttonLonganimalsPressed(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.longanimalsgames.com"), "_blank");
}
public static function buttonCreditsPressed(_arg1:MouseEvent){
Game.main.addChild(creditsMC);
creditsMC.buttonBack.addEventListener(MouseEvent.CLICK, buttonCreditsBackPressed);
}
public static function InitPreLevelScreen_SetText(){
var _local1:XML;
var _local2:int;
var _local3:String;
_local1 = Game.GetLevelXml(Game.currentLevel);
titleMC.textCurrentLevel.text = ((("Entering level " + int((Game.currentLevel + 1)).toString()) + ": ") + _local1.info.@name);
titleMC.textLevelInfo.text = "";
titleMC.textUnlocked.text = "";
if (Game.levelsCompleted){
titleMC.textUnlocked.text = "Levels Complete. Choose a level to play";
};
_local2 = int(_local1.info.@numkills);
if (_local2 < 9999){
_local3 = (("Kill " + int(_local1.info.@numkills)) + " enemies");
} else {
_local3 = "Kill the BOSS";
};
titleMC.textCurrentLevel1.text = _local3;
}
public static function buttonCreditsBackPressed(_arg1:MouseEvent){
Game.main.removeChild(creditsMC);
creditsMC = null;
}
static function InitHelpText2(){
overlayMC = main.AddMovieClip(0, 0, mc_instructions);
overlayMC.buttonContinue.addEventListener(MouseEvent.CLICK, InitHelpText2_buttonContinuePressed, false, 0, true);
KongButton(overlayMC);
MoreGamesButton(overlayMC);
GuideButton(overlayMC);
}
static function InitHelpText3(){
overlayMC = main.AddMovieClip(0, 0, mc_instructions1);
overlayMC.buttonContinue.addEventListener(MouseEvent.CLICK, InitHelpText3_buttonContinuePressed, false, 0, true);
KongButton(overlayMC);
MoreGamesButton(overlayMC);
GuideButton(overlayMC);
}
static function InitHelpText1(_arg1:Boolean=false){
helpTextFristTime = _arg1;
overlayMC = main.AddMovieClip(0, 0, mc_instructions0);
overlayMC.buttonContinue.addEventListener(MouseEvent.CLICK, InitHelpText1_buttonContinuePressed, false, 0, true);
KongButton(overlayMC);
MoreGamesButton(overlayMC);
GuideButton(overlayMC);
}
static function mouseOutLevel(_arg1:MouseEvent):void{
titleMC.textLevelInfo.text = "";
titleMC.textLevelTime.text = "";
titleMC.textLevelScore.text = "";
titleMC.textLevelCash.text = "";
}
public static function InitLevelComplete(){
var _local1:XML;
var _local2:int;
Game.ShowCursor();
Stats.EndLevel();
Achievements.TestAtLevelComplete();
MusicPlayer.StartMusic(0);
titleMC = main.AddMovieClip(0, 0, mc_LevelCompleteScreen);
titleMC.buttonContinue.addEventListener(MouseEvent.CLICK, InitLevelComplete_buttonContinuePressed);
titleMC.textLevelComplete.text = (("Level " + int((Game.currentLevel + 1)).toString()) + " complete!");
titleMC.textStats.text = ((("You scored " + Stats.levelScore) + " points and earned $") + Stats.levelCash);
titleMC.textScore.text = ((("Score: " + Game.currentScore) + " Cash: ") + Game.cash);
KongButton(titleMC);
MoreGamesButton(titleMC);
GuideButton(titleMC);
Game.currentLevel++;
Kong.SubmitStat(Game.currentLevel, "NumLevelsComplete");
_local1 = ExternalData.xml;
_local2 = int(_local1.leveldef.length());
if ((((Game.levelsCompleted == false)) && ((Game.currentLevel >= _local2)))){
Game.levelsCompleted = true;
Game.currentLevel = 0;
InitAllLevelsCompleteScreen();
};
SaveData.Save();
}
static function MoreGamesButton(_arg1:MovieClip){
if (Licensors.GetLicensor() == Licensors.LICENSOR_NOBRANDING){
_arg1.buttonMoreGames.addEventListener(MouseEvent.CLICK, buttonKongregatePressed, false, 0, true);
_arg1.buttonMoreGames.visible = true;
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_KONGREGATE){
_arg1.buttonMoreGames.addEventListener(MouseEvent.CLICK, buttonKongregatePressed, false, 0, true);
if (Licensors.IsAtKongregate()){
_arg1.buttonMoreGames.visible = true;
} else {
_arg1.buttonMoreGames.visible = true;
};
};
};
}
public static function AllLevelsCompleteScreen_buttonContinuePressed(_arg1:MouseEvent){
Game.main.removeChild(overlayMC);
overlayMC = null;
}
static function buttonGameOverContinuePressed(_arg1:MouseEvent){
main.removeChild(titleMC);
titleMC = null;
Game.currentScore = 0;
Game.InitLevel();
}
public static function MovieFinished(){
Game.InitGame();
main.SetGameState(Main.gameState_LEVEL_PLAY);
}
static function buttonStartPressed_Complete1(){
}
public static function buttonStartPressed(_arg1:MouseEvent){
if (SaveData.Exists()){
overlayMC.visible = true;
} else {
Game.InitGame(false);
InitHelpText1(true);
};
}
static function KongTitlePageButton(_arg1:MovieClip, _arg2:Boolean=false){
if (Licensors.GetLicensor() == Licensors.LICENSOR_NOBRANDING){
_arg1.buttonKong.visible = false;
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_KONGREGATE){
if (((Licensors.IsAtKongregate()) && ((_arg2 == false)))){
_arg1.buttonKong.visible = true;
_arg1.buttonKong.addEventListener(MouseEvent.CLICK, buttonKongregatePressed, false, 0, true);
} else {
_arg1.buttonKong.visible = true;
_arg1.buttonKong.addEventListener(MouseEvent.CLICK, buttonKongregatePressed, false, 0, true);
};
} else {
_arg1.buttonKong.visible = false;
};
};
}
static function GuideButton(_arg1:MovieClip){
if (Licensors.GetLicensor() == Licensors.LICENSOR_NOBRANDING){
_arg1.buttonGuide.addEventListener(MouseEvent.CLICK, buttonGuidePressed, false, 0, true);
_arg1.buttonGuide.visible = true;
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_KONGREGATE){
_arg1.buttonGuide.addEventListener(MouseEvent.CLICK, buttonGuidePressed, false, 0, true);
if (Licensors.IsAtKongregate()){
_arg1.buttonGuide.visible = true;
} else {
_arg1.buttonGuide.visible = true;
};
};
};
}
public static function InitGameOver(){
Kong.SubmitScore(Game.currentScore, "HighScore");
Game.ShowCursor();
Game.cash = Game.levelstart_cash;
blockerFunction = null;
Game.pause = true;
titleMC = main.AddMovieClip(0, 0, mc_GameOverScreen);
titleMC.buttonContinue.addEventListener(MouseEvent.CLICK, buttonGameOverContinuePressed);
titleMC.buttonQuit.addEventListener(MouseEvent.CLICK, buttonGameOverQuitPressed);
KongButton(titleMC);
MoreGamesButton(titleMC);
GuideButton(titleMC);
}
static function InitLevelComplete_buttonContinuePressed(_arg1:MouseEvent){
main.removeChild(titleMC);
titleMC = null;
Game.ReloadDataAndRestartLevel();
KeyReader.InitOnce(Game.main.stage);
}
static function buttonShopPressed(_arg1:MouseEvent){
ExitPreLevelScreen();
main.removeChild(titleMC);
titleMC = null;
Shop.Init(true);
}
public static function buttonKongregatePressed(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.kongregate.com/?gamereferral=heavyweapons"), "_blank");
}
public static function InitPreLevelScreen(){
var _local1:String;
var _local2:XML;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:MovieClip;
var _local9:*;
Game.ShowCursor();
titleMC = main.AddMovieClip(0, 0, mc_PreLevelScreen);
titleMC.buttonContinue.addEventListener(MouseEvent.CLICK, PreLevelScreen_buttonContinuePressed);
titleMC.buttonShop.addEventListener(MouseEvent.CLICK, buttonShopPressed);
KongButton(titleMC);
MoreGamesButton(titleMC);
GuideButton(titleMC);
titleMC.textLevelInfo.text = "";
titleMC.textLevelTime.text = "";
titleMC.textLevelScore.text = "";
titleMC.textLevelCash.text = "";
InitPreLevelScreen_SetText();
_local2 = ExternalData.xml;
_local3 = int(_local2.leveldef.length());
_local4 = 30;
_local5 = 300;
_local6 = ((640 - 40) / 40);
_local7 = 0;
while (_local7 < _local3) {
_local8 = (titleMC.getChildByName(_local7.toString()) as MovieClip);
_local9 = 1;
if (_local7 < Stats.highestLevel){
_local9 = 2;
};
if (_local7 == Game.currentLevel){
_local9 = (_local9 + 2);
};
_local8.gotoAndStop(_local9);
_local7++;
};
}
static function PreLevelScreen_buttonContinuePressed(_arg1:MouseEvent){
ExitPreLevelScreen();
main.removeChild(titleMC);
titleMC = null;
KeyReader.InitOnce(Game.main.stage);
Game.HideCursor();
Game.InitLevel1();
}
public static function Init(_arg1:Main){
InitAll();
blockerFunction = null;
main = _arg1;
MusicPlayer.StartMusic(0);
main.InitStage();
titleMC = main.AddMovieClip(0, 0, mc_TitlePage);
titleMC.buttonStart.addEventListener(MouseEvent.CLICK, buttonStartPressed);
KongTitlePageButton(titleMC);
MoreGamesButton(titleMC);
titleMC.buttonHighScores.visible = false;
InitStartOrContinueScreen();
overlayMC.visible = false;
}
public static function SetFrameUpdateText(_arg1:int, _arg2:int){
if (titleMC == null){
return;
};
titleMC.textFrameUpdate.text = ("V: " + Game.version.toString());
if (_arg1 != _arg2){
titleMC.textFrameUpdate.text = (titleMC.textFrameUpdate.text + (((" Unpacking animation: " + _arg1) + " / ") + _arg2));
};
}
public static function StartOrContinue_buttonStartPressed(_arg1:MouseEvent){
Game.main.removeChild(overlayMC);
overlayMC = null;
Game.InitGame(false);
InitHelpText1(true);
}
static function buttonStartPressed_Complete(){
Game.InitGame(false);
main.SetGameState(Main.gameState_LEVEL_PLAY);
}
public static function PreLevelScreen_InitBits(_arg1:MovieClip){
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:XML;
var _local6:int;
var _local7:int;
var _local8:MovieClip;
var _local9:int;
_local2 = 30;
_local3 = 300;
_local4 = ((640 - 40) / 40);
_local5 = ExternalData.xml;
_local6 = int(_local5.leveldef.length());
_local7 = 0;
while (_local7 < _local6) {
_local8 = new LevelBox();
_local8.name = _local7.toString();
_local8.addEventListener(MouseEvent.MOUSE_OVER, mouseOverLevel, false, 0, true);
_local8.addEventListener(MouseEvent.MOUSE_OUT, mouseOutLevel, false, 0, true);
_local8.addEventListener(MouseEvent.CLICK, mouseClickLevel, false, 0, true);
_local8.textNumber.text = int((_local7 + 1)).toString();
_local8.x = (_local2 + int(((_local7 % _local4) * 40)));
_local9 = (_local7 / _local4);
_local9 = (_local9 * 35);
_local8.y = (_local3 + _local9);
_arg1.addChild(_local8);
_local7++;
};
}
static function PlayBlockerIn(_arg1:Function){
blockerFunction = _arg1;
blockerOverlay = new CodeBlockerIn();
Game.main.addChild(blockerOverlay);
}
public static function InitHelpText3_buttonContinuePressed(_arg1:MouseEvent){
Game.main.removeChild(overlayMC);
overlayMC = null;
if (helpTextFristTime == true){
GraphicObjects.CompleteBitmapCreation();
Game.main.removeChild(titleMC);
titleMC = null;
main.SetGameState(Main.gameState_LEVEL_PLAY);
};
}
static function KongButton(_arg1:MovieClip, _arg2:Boolean=false){
if (Licensors.GetLicensor() == Licensors.LICENSOR_NOBRANDING){
_arg1.buttonKong.visible = false;
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_KONGREGATE){
if (((Licensors.IsAtKongregate()) && ((_arg2 == false)))){
_arg1.buttonKong.visible = false;
} else {
_arg1.buttonKong.visible = true;
_arg1.buttonKong.addEventListener(MouseEvent.CLICK, buttonKongregateGamePressed, false, 0, true);
};
} else {
_arg1.buttonKong.visible = false;
};
};
}
public static function ExitPreLevelScreen(){
}
static function InitAllLevelsCompleteScreen(){
overlayMC = main.AddMovieClip(0, 0, mc_AllLevelsCompleteScreen);
overlayMC.buttonContinue.addEventListener(MouseEvent.CLICK, AllLevelsCompleteScreen_buttonContinuePressed, false, 0, true);
}
public static function InitHelpText1_buttonContinuePressed(_arg1:MouseEvent){
Game.main.removeChild(overlayMC);
overlayMC = null;
InitHelpText2();
}
public static function buttonGuidePressed(_arg1:MouseEvent){
navigateToURL(new URLRequest(" http://www.kongregate.com/games/LongAnimals/heavy-weapons-guide?gamereferral=heavyweapons"), "_blank");
}
static function mouseClickLevel(_arg1:MouseEvent):void{
var _local2:String;
var _local3:int;
if (Game.levelsCompleted == false){
return;
};
_local2 = _arg1.currentTarget.name;
_local3 = int(_local2);
Game.currentLevel = _local3;
InitPreLevelScreen_SetText();
}
static function InitStartOrContinueScreen(){
overlayMC = main.AddMovieClip(0, 0, mc_StartOrContinueScreen);
overlayMC.buttonNewGame.addEventListener(MouseEvent.CLICK, StartOrContinue_buttonStartPressed, false, 0, true);
overlayMC.buttonContinue.addEventListener(MouseEvent.CLICK, StartOrContinue_buttonContinuePressed, false, 0, true);
}
public static function Update(_arg1:Main){
}
public static function buttonKongregateGamePressed(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.kongregate.com/games/LongAnimals/heavy-weapons?gamereferral=heavyweapons"), "_blank");
}
static function mouseOverLevel(_arg1:MouseEvent):void{
var _local2:XML;
var _local3:int;
var _local4:String;
var _local5:int;
var _local6:String;
var _local7:int;
_local2 = ExternalData.xml;
_local3 = int(_local2.leveldef.length());
_local4 = _arg1.currentTarget.name;
_local5 = int(_local4);
_local6 = _local2.leveldef[_local5].info.@name;
titleMC.textLevelInfo.text = _local6;
_local7 = Stats.levels_bestTime[_local5];
if (_local7 >= 999999){
titleMC.textLevelTime.text = "----";
} else {
titleMC.textLevelTime.text = _local7;
};
titleMC.textLevelScore.text = Stats.levels_bestScore[_local5];
titleMC.textLevelCash.text = Stats.levels_mostCash[_local5];
}
public static function BlockerOutComplete(){
if (blockerFunction != null){
blockerOverlay.stop();
Game.main.removeChild(blockerOverlay);
blockerOverlay = null;
blockerFunction();
blockerFunction = null;
};
}
static function PlayBlockerOut(_arg1:Function){
blockerFunction = _arg1;
blockerOverlay = new CodeBlockerOut();
Game.main.addChild(blockerOverlay);
}
public static function InitAll(){
if (veryFirstTime == false){
return;
};
veryFirstTime = true;
mc_instructions = new instructions();
mc_instructions0 = new instructions0();
mc_instructions1 = new instructions1();
mc_PauseScreen = new PauseScreen();
mc_allocateWeapon = new allocateWeapon();
mc_weaponDetails = new weaponDetails();
mc_WeaponScreen = null;
mc_StartOrContinueScreen = new StartOrContinueScreen();
mc_GameOverScreen = new GameOverScreen();
mc_TitlePage = new TitlePage();
mc_PreLevelScreen = new PreLevelScreen();
mc_LevelCompleteScreen = new LevelCompleteScreen();
mc_AllLevelsCompleteScreen = new AllLevelsCompleteScreen();
PreLevelScreen_InitBits(mc_PreLevelScreen);
}
public static function KongAIAdClicked(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.kongregate.com/games/Kongregate/Kongai?gamereferral=heavyweapons"), "_blank");
}
public static function BlockerInComplete(){
if (blockerFunction != null){
blockerOverlay.stop();
Game.main.removeChild(blockerOverlay);
blockerOverlay = null;
blockerFunction();
blockerFunction = null;
};
}
static function buttonGameOverQuitPressed(_arg1:MouseEvent){
main.removeChild(titleMC);
titleMC = null;
main.SetGameState(Main.gameState_TITLE);
}
public static function StartOrContinue_buttonContinuePressed(_arg1:MouseEvent){
Game.main.removeChild(overlayMC);
overlayMC = null;
Game.InitGame(true);
InitHelpText1(true);
}
public static function InitHelpText2_buttonContinuePressed(_arg1:MouseEvent){
Game.main.removeChild(overlayMC);
overlayMC = null;
InitHelpText3();
}
}
}//package
Section 235
//Utils (Utils)
package {
import flash.display.*;
import flash.geom.*;
public class Utils {
public static function RandPointInCircle(_arg1:Number):Point{
var _local2:Point;
var _local3:Number;
var _local4:Number;
_local2 = new Point();
_local3 = RandBetweenFloat(0, _arg1);
_local4 = (Math.random() * (Math.PI * 2));
_local2.x = (Math.cos(_local4) * _local3);
_local2.y = (Math.sin(_local4) * _local3);
return (_local2);
}
public static function DegToRad(_arg1:Number):Number{
return ((((Math.PI * 2) / 360) * _arg1));
}
public static function LimitNumber(_arg1:Number, _arg2:Number, _arg3:Number):Number{
if (_arg3 < _arg1){
_arg3 = _arg1;
};
if (_arg3 > _arg2){
_arg3 = _arg2;
};
return (_arg3);
}
public static function ScaleTo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Number{
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local6 = (_arg4 - _arg3);
_local7 = (_arg2 - _arg1);
_local8 = ((1 / _local6) * (_arg5 - _arg3));
_local8 = ((_local7 * _local8) + _arg1);
return (_local8);
}
public static function DP2(_arg1:Number):Number{
var _local2:Number;
_local2 = (Math.ceil((_arg1 * 100)) / 100);
return (_local2);
}
static function RenderDotLine(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:int, _arg7:uint):void{
var _local8:int;
var _local9:int;
var _local10:Number;
var _local11:Number;
_local9 = _arg6;
_local10 = ((_arg4 - _arg2) / Number(_local9));
_local11 = ((_arg5 - _arg3) / Number(_local9));
_local8 = 0;
while (_local8 < _local9) {
_arg2 = (_arg2 + _local10);
_arg3 = (_arg3 + _local11);
_arg1.setPixel32(int(_arg2), int(_arg3), _arg7);
_local8++;
};
}
static function RenderRectangle(_arg1:BitmapData, _arg2:Rectangle, _arg3:uint):void{
RenderDotLine(_arg1, _arg2.left, _arg2.top, _arg2.right, _arg2.top, 100, _arg3);
RenderDotLine(_arg1, _arg2.left, _arg2.bottom, _arg2.right, _arg2.bottom, 100, _arg3);
RenderDotLine(_arg1, _arg2.left, _arg2.top, _arg2.left, _arg2.bottom, 100, _arg3);
RenderDotLine(_arg1, _arg2.right, _arg2.top, _arg2.right, _arg2.bottom, 100, _arg3);
}
public static function NumberToString2DP(_arg1:Number):String{
var _local2:String;
var _local3:int;
var _local4:int;
_local2 = DP2(_arg1).toString();
_local3 = _local2.lastIndexOf(".");
if (_local3 == -1){
_local2.concat(".00");
} else {
_local4 = _local2.length;
if (_local3 == (_local4 - 1)){
_local2.concat("0");
};
};
return (_local2);
}
public static function NormalizeRot(_arg1:Number):Number{
while (_arg1 < 0) {
_arg1 = (_arg1 + (Math.PI * 2));
};
while (_arg1 > (Math.PI * 2)) {
_arg1 = (_arg1 - (Math.PI * 2));
};
return (_arg1);
}
static function RandBetweenInt(_arg1:int, _arg2:int):int{
var _local3:int;
_local3 = (Math.random() * ((_arg2 - _arg1) + 1));
_local3 = (_local3 + _arg1);
return (_local3);
}
static function DotProduct(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
_local5 = ((_arg1 * _arg3) + (_arg2 * _arg4));
return (_local5);
}
static function RandBool():Boolean{
if (Math.random() < 0.5){
return (true);
};
return (false);
}
static function SideOfLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Boolean{
var _local7:Number;
_local7 = DotProduct((_arg3 - _arg1), (_arg4 - _arg2), (_arg5 - _arg1), (_arg6 - _arg2));
if (_local7 < 0){
return (false);
};
return (true);
}
static function RenderCircle(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:uint):void{
var _local6:int;
var _local7:Number;
var _local8:int;
var _local9:Number;
var _local10:Number;
var _local11:Number;
_local6 = 100;
_local7 = ((Math.PI * 2) / _local6);
_local9 = 0;
_local8 = 0;
while (_local8 < _local6) {
_local10 = (_arg2 + (Math.cos(_local9) * _arg4));
_local11 = (_arg3 + (Math.sin(_local9) * _arg4));
_local9 = (_local9 + _local7);
_arg1.setPixel32(int(_local10), int(_local11), _arg5);
_local8++;
};
}
public static function DP1(_arg1:Number):Number{
var _local2:Number;
_local2 = (Math.ceil((_arg1 * 10)) / 10);
return (_local2);
}
public static function RandCircle():Number{
return ((Math.random() * (Math.PI * 2)));
}
public static function RadToDeg(_arg1:Number):Number{
return (((360 / (Math.PI * 2)) * _arg1));
}
public static function NormalizeUnit(_arg1:Number):Number{
while (_arg1 < 0) {
_arg1 = (_arg1 + 1);
};
while (_arg1 > 1) {
_arg1--;
};
return (_arg1);
}
static function RandBetweenFloat(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
_local3 = (Math.random() * (_arg2 - _arg1));
_local3 = (_local3 + _arg1);
return (_local3);
}
public static function LineLength(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
var _local6:Number;
_local5 = (_arg3 - _arg1);
_local6 = (_arg4 - _arg2);
return (Math.sqrt(((_local5 * _local5) + (_local6 * _local6))));
}
static function DotProductAng(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local3 = Math.cos(_arg1);
_local4 = Math.sin(_arg1);
_local5 = Math.cos(_arg2);
_local6 = Math.sin(_arg2);
_local7 = ((_local3 * _local5) + (_local4 * _local6));
return (_local7);
}
static function DistBetweenPoints(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
var _local6:Number;
_local5 = (_arg3 - _arg1);
_local6 = (_arg4 - _arg2);
return (Math.sqrt(((_local5 * _local5) + (_local6 * _local6))));
}
public static function ScaleBetween(_arg1:Number, _arg2:Number, _arg3:Number):Number{
var _local4:Number;
_local4 = ((_arg2 - _arg1) * _arg3);
_local4 = (_arg1 + _local4);
return (_local4);
}
static function Dist2BetweenPoints(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
var _local6:Number;
_local5 = (_arg3 - _arg1);
_local6 = (_arg4 - _arg2);
return (((_local5 * _local5) + (_local6 * _local6)));
}
}
}//package
Section 236
//WaveDef (WaveDef)
package {
public class WaveDef {
public var timer:int;
public var active:Boolean;
public var state:int;
public var numRepeats:int;
public var maxAtOnce:int;
public var frequency:int;
public var enemyTimer:int;
public var initialDelay:int;
public var enemyType:String;
public var length:int;
public var repeatDelay:int;
public var repeatCount:int;
function Reset(){
active = true;
timer = 0;
enemyTimer = 0;
state = 0;
repeatCount = 0;
}
function InitFromXml(_arg1:XML){
initialDelay = (Number(_arg1.@initialdelay) * Defs.fps);
frequency = (Number(_arg1.@frequency) * Defs.fps);
length = (Number(_arg1.@length) * Defs.fps);
enemyType = _arg1.@type;
maxAtOnce = int(_arg1.@max);
numRepeats = int(_arg1.@numrepeats);
repeatDelay = (Number(_arg1.@repeatdelay) * Defs.fps);
Reset();
}
}
}//package
Section 237
//WaveDefs (WaveDefs)
package {
public class WaveDefs {
static const s_bxf = 4;
static const p_sm = 1;
static const s_b = 3;
static const s_txf = 5;
static const s_l = 0;
static const s_r = 1;
static const p_sp = 2;
static const s_t = 2;
static const p_ln = 0;
static var startTime:int;
static var startPos:int;
static var waveID:int;
public static var currentPos:int;
static var list:Array;
static var currentTime:int;
static var shotDefList:Array;
public static var nextWaveDef:WaveDef;
public static function GetCurrentDef():WaveDef{
return (nextWaveDef);
}
public static function InitOnce(){
var _local1:ShotDef;
shotDefList = new Array();
_local1 = new ShotDef("atplayer_5");
_local1.SetNormal(0.1);
shotDefList.push(_local1);
_local1 = new ShotDef("atplayer_4");
_local1.SetNormal(0.25);
shotDefList.push(_local1);
_local1 = new ShotDef("atplayer_3");
_local1.SetNormal(0.5);
shotDefList.push(_local1);
_local1 = new ShotDef("atplayer_2");
_local1.SetNormal(1);
shotDefList.push(_local1);
_local1 = new ShotDef("atplayer_1");
_local1.SetNormal(1.5);
shotDefList.push(_local1);
_local1 = new ShotDef("atplayer_0");
_local1.SetNormal(5);
shotDefList.push(_local1);
_local1 = new ShotDef("atplayer_multi_3");
_local1.SetSpreadPulse(0.25, 5, 90);
shotDefList.push(_local1);
_local1 = new ShotDef("atplayer_multi_2");
_local1.SetSpreadPulse(0.5, 5, 90);
shotDefList.push(_local1);
_local1 = new ShotDef("atplayer_multi_1");
_local1.SetSpreadPulse(1, 5, 90);
shotDefList.push(_local1);
_local1 = new ShotDef("atplayer_multi_0");
_local1.SetSpreadPulse(2, 5, 90);
shotDefList.push(_local1);
_local1 = new ShotDef("down_multi_3");
_local1.SetSpreadPulse(25, 10, 140, 90);
shotDefList.push(_local1);
_local1 = new ShotDef("down_multi_2");
_local1.SetSpreadPulse(0.5, 10, 140, 90);
shotDefList.push(_local1);
_local1 = new ShotDef("down_multi_1");
_local1.SetSpreadPulse(1, 10, 140, 90);
shotDefList.push(_local1);
_local1 = new ShotDef("down_multi_0");
_local1.SetSpreadPulse(2, 10, 140, 90);
shotDefList.push(_local1);
_local1 = new ShotDef("down_3");
_local1.SetSpreadPulse(25, 1, 0, 90);
shotDefList.push(_local1);
_local1 = new ShotDef("down_2");
_local1.SetSpreadPulse(0.5, 1, 0, 90);
shotDefList.push(_local1);
_local1 = new ShotDef("down_1");
_local1.SetSpreadPulse(1, 1, 0, 90);
shotDefList.push(_local1);
_local1 = new ShotDef("down_0");
_local1.SetSpreadPulse(2, 1, 0, 90);
shotDefList.push(_local1);
_local1 = new ShotDef("biglaser_0");
_local1.SetNormal(3);
shotDefList.push(_local1);
}
public static function GetShotDefIndexByName(_arg1:String):int{
var _local2:int;
var _local3:int;
var _local4:ShotDef;
_local3 = shotDefList.length;
_local2 = 0;
while (_local2 < _local3) {
_local4 = shotDefList[_local2];
if (_local4.name == _arg1){
return (_local2);
};
_local2++;
};
return (0);
}
public static function AdvanceWave(){
currentPos++;
if (currentPos >= list.length){
nextWaveDef = null;
};
nextWaveDef = list[currentPos];
}
public static function Reset(){
currentPos = startPos;
nextWaveDef = list[currentPos];
}
}
}//package
Section 238
//weaponAnims (weaponAnims)
package {
import flash.display.*;
public dynamic class weaponAnims extends MovieClip {
}
}//package
Section 239
//weaponDetails (weaponDetails)
package {
import flash.display.*;
import flash.text.*;
public dynamic class weaponDetails extends MovieClip {
public var textWeaponCost:TextField;
public var buttonBuy:SimpleButton;
public var textWeaponDescription:TextField;
public var weaponFrame:weaponAnims;
public var textWeaponName:TextField;
public var buttonClose:SimpleButton;
}
}//package
Section 240
//WeaponScreen (WeaponScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class WeaponScreen extends MovieClip {
public var scoreText:TextField;
public var buttonBuyAll:SimpleButton;
public var cashText:TextField;
public var item13:MovieClip;
public var item14:MovieClip;
public var item15:MovieClip;
public var item12:MovieClip;
public var item16:MovieClip;
public var item6:MovieClip;
public var item7:MovieClip;
public var levelText1:TextField;
public var item10:MovieClip;
public var item4:MovieClip;
public var item5:MovieClip;
public var item11:MovieClip;
public var item2:MovieClip;
public var item20:MovieClip;
public var item21:MovieClip;
public var buttonHelp:SimpleButton;
public var item8:MovieClip;
public var item17:MovieClip;
public var item18:MovieClip;
public var item9:MovieClip;
public var weapon0:MovieClip;
public var weapon1:MovieClip;
public var weaponDescriptionText:TextField;
public var buttonPlay:SimpleButton;
public var item1:MovieClip;
public var item3:MovieClip;
public var item19:MovieClip;
public var weapon2:MovieClip;
public var levelText:TextField;
}
}//package
Section 241
//weaponsOverlay1 (weaponsOverlay1)
package {
import flash.display.*;
public dynamic class weaponsOverlay1 extends MovieClip {
}
}//package
Section 242
//Vec (Vec)
package {
import flash.geom.*;
public class Vec {
public var speed:Number;
public var rot:Number;
public function Vec(){
rot = 0;
speed = 0;
}
public function Set(_arg1:Number, _arg2:Number){
rot = _arg1;
speed = _arg2;
}
public function GetUnitYComponent():Number{
return (Math.sin(rot));
}
public function dotRot(_arg1:Number):Number{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local2 = Math.cos(rot);
_local3 = Math.sin(rot);
_local4 = Math.cos(_arg1);
_local5 = Math.sin(_arg1);
_local6 = ((_local2 * _local4) + (_local3 * _local5));
return (_local6);
}
public function Add(_arg1:Vec){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local2 = (Math.cos(rot) * speed);
_local3 = (Math.sin(rot) * speed);
_local4 = (Math.cos(_arg1.rot) * _arg1.speed);
_local5 = (Math.sin(_arg1.rot) * _arg1.speed);
_local6 = (_local2 + _local4);
_local7 = (_local3 + _local5);
rot = Math.atan2(_local7, _local6);
speed = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
}
public function FromVec(_arg1:Vec){
rot = _arg1.rot;
speed = _arg1.speed;
}
public function SetAngFromDxDy(_arg1:Number, _arg2:Number){
rot = Math.atan2(_arg2, _arg1);
}
function NormalizeRot():void{
while (rot < 0) {
rot = (rot + (Math.PI * 2));
};
while (rot > (Math.PI * 2)) {
rot = (rot - (Math.PI * 2));
};
}
public function GetUnitTangent():Point{
var _local1:Number;
var _local2:Point;
_local1 = (rot + (Math.PI * 0.5));
_local2 = new Point(Math.cos(_local1), Math.sin(_local1));
return (_local2);
}
public function SetAng(_arg1:Number){
rot = _arg1;
}
public function GetYComponent():Number{
return ((Math.sin(rot) * speed));
}
public function GetXComponent():Number{
return ((Math.cos(rot) * speed));
}
public function AddRot(_arg1:Number):void{
rot = (rot + _arg1);
NormalizeRot();
}
public function NearRot(_arg1:Number, _arg2:Number):Boolean{
var _local3:Number;
var _local4:Number;
_local3 = (rot - _arg1);
_local4 = Math.abs(_local3);
if (_local3 > Math.PI){
if (_arg1 < rot){
_arg1 = (_arg1 + (Math.PI * 2));
} else {
_arg1 = (_arg1 - (Math.PI * 2));
};
_local3 = (rot - _arg1);
};
if (Math.abs(_local3) <= _arg2){
return (true);
};
return (false);
}
public function GetUnitXComponent():Number{
return (Math.cos(rot));
}
}
}//package
Section 243
//vortex (vortex)
package {
import flash.media.*;
public dynamic class vortex extends Sound {
}
}//package
Section 244
//wtfBoom (wtfBoom)
package {
import flash.media.*;
public dynamic class wtfBoom extends Sound {
}
}//package