Section 1
//MainTimeline (GauntletOfArgos_fla.MainTimeline)
package GauntletOfArgos_fla {
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var pcent;
public var MusicLastBoss;
public var i;
public var Engine:Object;
public var MusicForest;
public var Particles:Array;
public var TemporaryUnitChild;
public var ColorMatrix:Array;
public var UnitInformation:Array;
public var PlayerFrame;
public var Player:UnitPlayer;
public var SoundBulletHit;
public var MusicBoss;
public var ProgressText:TextField;
public var musicChannel:SoundChannel;
public var PlayerGoingLeft;
public var MusicCave;
public var timer:Timer;
public var Units:Array;
public var MusicTitle;
public var MusicCastle;
public var Level;
public var SoundMeleeHit;
public var Input:Object;
public var SoundFire;
public var SoundSpawn;
public var RedColorMatrix;
public var SoundClick;
public var RegularColorMatrix;
public function MainTimeline(){
addFrameScript(0, frame1, 2, frame3);
}
public function UpdateUnits(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:*;
var _local15:*;
var _local16:*;
var _local17:*;
var _local18:*;
var _local19:*;
var _local20:*;
var _local21:*;
var _local22:*;
var _local23:*;
var _local24:*;
var _local25:*;
var _local26:*;
var _local27:*;
var _local28:*;
var _local29:*;
var _local30:*;
var _local31:*;
var _local32:*;
var _local33:*;
var _local34:*;
var _local35:*;
var _local36:*;
var _local37:*;
var _local38:*;
var _local39:*;
var _local40:*;
var _local41:*;
var _local42:*;
var _local43:*;
var _local44:*;
Engine.EnemyCount = 0;
_local1 = 0;
while (_local1 < Units.length) {
_local2 = Units[_local1].Type;
_local3 = false;
if (UnitInformation[_local2].SkillLeap == undefined){
_local12 = false;
} else {
_local12 = true;
};
_local4 = false;
_local5 = false;
_local6 = false;
_local7 = false;
_local8 = false;
_local9 = false;
_local10 = false;
switch (UnitInformation[_local2].AIType){
case 0:
if (Input.Left == true){
_local5 = true;
};
if (Input.Right == true){
_local6 = true;
};
if (Input.Down == true){
_local7 = true;
};
if (Input.Up == true){
_local8 = true;
};
if (Input.Melee == true){
_local10 = true;
};
if (Input.Fire == true){
_local9 = true;
};
if ((((Units[_local1].Health < 40)) && (((((Engine.Cycle % 5) == 0)) || ((((Engine.Cycle + 1) % 5) == 0)))))){
Units[_local1].UnitChild.filters = [RedColorMatrix];
} else {
Units[_local1].UnitChild.filters = [RegularColorMatrix];
};
Engine.PlayerPosition.x = Units[_local1].UnitChild.x;
Engine.PlayerPosition.y = (Units[_local1].Position.y + UnitInformation[_local2].Size.y);
if ((((UnitInformation[_local2].SkillSense > 0)) && ((Units[_local1].Health < 40)))){
_local11 = 0;
while (_local11 < Units.length) {
_local40 = Math.abs(((Units[_local1].Position.y + UnitInformation[_local2].Size.y) - (Units[_local11].Position.y + UnitInformation[Units[_local11].Type].Size.y)));
if (((!((Units[_local1].Friendly == Units[_local11].Friendly))) && (!((_local11 == _local1))))){
if (Math.abs((Units[_local1].UnitChild.x - Units[_local11].UnitChild.x)) < ((UnitInformation[_local2].Size.x * 6) + (UnitInformation[Units[_local11].Type].Size.x * 6))){
if ((((_local40 < ((UnitInformation[_local2].Size.y * 2) + (UnitInformation[Units[_local11].Type].Size.y * 2)))) && ((Units[_local11].Friendly == false)))){
if (Units[_local11].CurrentFrame == 10){
if ((((Units[_local11].FacingLeft == true)) && ((Units[_local11].Position.x > Units[_local1].Position.x)))){
Engine.SlowMotionTime = 50;
} else {
if ((((Units[_local11].FacingLeft == false)) && ((Units[_local11].Position.x < Units[_local1].Position.x)))){
Engine.SlowMotionTime = 50;
};
};
} else {
if (UnitInformation[Units[_local11].Type].ProjectileDamage != undefined){
Engine.SlowMotionTime = 50;
};
};
};
};
};
_local11++;
};
};
break;
case 1:
if (Units[_local1].AIStatus != 0){
Units[_local1].AIStatus = (Units[_local1].AIStatus + 10);
Units[_local1].Position.y = (Units[_local1].Position.y + (-2 * Math.cos(((Units[_local1].AIStatus * Math.PI) / 180))));
};
break;
case 3:
_local11 = 0;
while (_local11 < Units.length) {
if (Units[_local11].Type == 0){
_local41 = (((Math.atan2(((Units[_local11].Position.y + UnitInformation[Units[_local11].Type].Size.y) - (Units[_local1].Position.y + UnitInformation[_local2].Size.y)), (Units[_local11].UnitChild.x - Units[_local1].UnitChild.x)) / Math.PI) * 180) - 90);
Units[_local1].Velocity.x = (-2.5 * Math.sin(((_local41 * Math.PI) / 180)));
Units[_local1].Velocity.y = (2.5 * Math.cos(((_local41 * Math.PI) / 180)));
};
_local11++;
};
break;
case 4:
_local4 = true;
_local13 = true;
_local14 = true;
_local15 = true;
_local16 = true;
_local17 = false;
_local18 = false;
_local19 = false;
break;
case 5:
_local4 = true;
_local13 = false;
_local14 = false;
_local15 = true;
_local16 = true;
_local17 = false;
_local18 = false;
_local19 = true;
break;
case 6:
_local4 = true;
_local13 = true;
_local14 = true;
_local15 = true;
_local16 = false;
_local17 = true;
_local18 = false;
_local19 = false;
break;
case 9:
_local4 = true;
_local13 = false;
_local14 = true;
_local15 = true;
_local16 = false;
_local17 = true;
_local18 = false;
_local19 = false;
break;
case 7:
_local4 = true;
_local13 = false;
_local14 = false;
_local15 = true;
_local16 = false;
_local17 = true;
_local18 = false;
_local19 = false;
break;
case 9:
_local4 = true;
_local13 = true;
_local14 = true;
_local15 = true;
_local16 = false;
_local17 = false;
_local18 = true;
_local19 = false;
break;
case 10:
_local4 = true;
_local13 = false;
_local14 = true;
_local15 = true;
_local16 = false;
_local17 = false;
_local18 = true;
_local19 = false;
break;
case 8:
_local4 = true;
_local13 = false;
_local14 = true;
_local15 = true;
_local16 = true;
_local17 = false;
_local18 = false;
_local19 = false;
break;
case 11:
_local4 = true;
break;
case 12:
_local4 = false;
if ((((Engine.ReinforcementLeft == 0)) && ((Engine.LastEnemyCount == 1)))){
_local4 = true;
_local13 = false;
_local14 = true;
_local15 = true;
_local16 = true;
_local17 = false;
_local18 = false;
_local19 = false;
};
Units[_local1].Alerted = 10;
Engine.EnemyCount++;
if (Units[_local1].Health <= 0){
Level.Victory.visible = true;
Level.Victory.alpha = (Level.Victory.alpha - 0.1);
if (Level.Victory.alpha < 0){
Level.Victory.tag--;
if (Level.Victory.tag > 0){
Level.Victory.alpha = 1;
SoundMeleeHit.play();
Level.Victory.x = (Math.random() * 200);
Level.Victory.y = (Math.random() * 150);
Units[_local1].AIStatus = 0;
} else {
Units[_local1].AIStatus++;
if (Units[_local1].AIStatus < 100){
Level.Training.visible = true;
Level.Training.gotoAndStop(11);
Level.Training.alpha = 1;
} else {
if (Units[_local1].AIStatus < 200){
Level.Training.gotoAndStop(12);
} else {
if (Units[_local1].AIStatus < 300){
Level.Training.gotoAndStop(13);
} else {
if (Units[_local1].AIStatus < 400){
Level.Training.gotoAndStop(14);
} else {
if (Units[_local1].AIStatus < 500){
Level.Training.gotoAndStop(15);
} else {
if (Units[_local1].AIStatus < 600){
Level.Training.gotoAndStop(16);
} else {
if (Units[_local1].AIStatus < 700){
Level.Training.gotoAndStop(17);
} else {
if (Units[_local1].AIStatus < 800){
Level.Victory.visible = false;
_local3 = true;
};
};
};
};
};
};
};
};
};
};
};
break;
case 13:
Engine.EnemyCount++;
if (Units[_local1].Health > 0){
if (Units[_local1].ActionCharge == 0){
SoundFire.play();
CreateUnit(20, Units[_local1].Friendly, new Point(Units[_local1].UnitChild.x, Units[_local1].UnitChild.y), new Point(0, 0));
Units[_local1].ActionCharge = 300;
};
Units[_local1].ActionCharge--;
if (Units[_local1].AIStatus > 0){
Units[_local1].Position.y++;
if (Units[_local1].Position.y > 250){
Units[_local1].AIStatus = -3000;
};
} else {
if (Units[_local1].AIStatus < 0){
Units[_local1].Position.y--;
if (Units[_local1].Position.y < 20){
Units[_local1].AIStatus = 3000;
};
};
};
if ((Units[_local1].ActionCharge % 5) == 0){
Units[_local1].UnitChild.gotoAndStop((Units[_local1].UnitChild.currentFrame + 1));
if (Units[_local1].UnitChild.currentFrame == 5){
Units[_local1].UnitChild.gotoAndStop(1);
};
};
} else {
Engine.ReinforcementLeft = 0;
Units[_local1].ActionCharge--;
if (Units[_local1].UnitChild.currentFrame < 8){
if ((Units[_local1].ActionCharge % 8) == 0){
Units[_local1].UnitChild.gotoAndStop((Units[_local1].UnitChild.currentFrame + 1));
};
} else {
if (Units[_local1].Position.y < 280){
Units[_local1].Position.y = (Units[_local1].Position.y + 2);
} else {
Units[_local1].UnitChild.alpha = 0;
Level.Victory.visible = true;
Level.Victory.alpha = (Level.Victory.alpha - 0.1);
if (Level.Victory.alpha < 0){
Level.Victory.tag--;
if (Level.Victory.tag > 0){
Level.Victory.alpha = 1;
Level.Victory.x = (Math.random() * 200);
Level.Victory.y = (Math.random() * 150);
SoundMeleeHit.play();
} else {
Level.Victory.visible = false;
_local3 = true;
};
};
};
};
};
break;
case 14:
Engine.EnemyCount++;
if (Units[_local1].Health > 0){
if (Units[_local1].ActionCharge == 0){
SoundFire.play();
if (Math.random() < 0.5){
CreateUnit(19, Units[_local1].Friendly, new Point(Units[_local1].UnitChild.x, Units[_local1].UnitChild.y), new Point(-7, (-2 - (Math.random() * 5))));
CreateParticle(3, new Point(Units[_local1].UnitChild.x, Units[_local1].UnitChild.y), new Point(-0.1, 0));
} else {
CreateUnit(19, Units[_local1].Friendly, new Point(Units[_local1].UnitChild.x, Units[_local1].UnitChild.y), new Point(7, (-2 - (Math.random() * 5))));
CreateParticle(3, new Point(Units[_local1].UnitChild.x, Units[_local1].UnitChild.y), new Point(0.1, 0));
};
Units[_local1].ActionCharge = 200;
};
Units[_local1].ActionCharge--;
Units[_local1].AIStatus = (Units[_local1].AIStatus + 1);
Units[_local1].StunnedTime = (Units[_local1].StunnedTime + 3);
if (Units[_local1].Alerted > 0){
Units[_local1].Alerted--;
};
Units[_local1].Position.x = ((0x0100 - 25) + ((Units[_local1].Alerted * 0.75) * Math.sin(((Units[_local1].AIStatus * Math.PI) / 180))));
Units[_local1].Position.y = ((192 - 20) + ((Units[_local1].Alerted * 0.5) * Math.cos(((Units[_local1].StunnedTime * Math.PI) / 180))));
if ((Units[_local1].ActionCharge % 5) == 0){
Units[_local1].UnitChild.gotoAndStop((Units[_local1].UnitChild.currentFrame + 1));
if (Units[_local1].UnitChild.currentFrame == 5){
Units[_local1].UnitChild.gotoAndStop(1);
};
};
} else {
Units[_local1].ActionCharge--;
if (Units[_local1].UnitChild.currentFrame < 7){
if ((Units[_local1].ActionCharge % 10) == 0){
Units[_local1].UnitChild.gotoAndStop((Units[_local1].UnitChild.currentFrame + 1));
};
} else {
if (Units[_local1].Alerted > 0){
Units[_local1].Alerted--;
Units[_local1].AIStatus = (Units[_local1].AIStatus + 1);
Units[_local1].StunnedTime = (Units[_local1].StunnedTime + 3);
Units[_local1].Position.x = ((0x0100 - 25) + ((Units[_local1].Alerted * 0.75) * Math.sin(((Units[_local1].AIStatus * Math.PI) / 180))));
Units[_local1].Position.y = ((192 - 20) + ((Units[_local1].Alerted * 0.5) * Math.cos(((Units[_local1].StunnedTime * Math.PI) / 180))));
} else {
Units[_local1].UnitChild.alpha = 0;
Level.Victory.visible = true;
Level.Victory.alpha = (Level.Victory.alpha - 0.1);
if (Level.Victory.alpha < 0){
Level.Victory.tag--;
if (Level.Victory.tag > 0){
Level.Victory.alpha = 1;
Level.Victory.x = (Math.random() * 200);
Level.Victory.y = (Math.random() * 150);
SoundMeleeHit.play();
} else {
Level.Victory.visible = false;
_local3 = true;
};
};
};
};
};
break;
case 15:
Engine.EnemyCount++;
if (Units[_local1].Health > 0){
if ((((Engine.ReinforcementLeft == 0)) && ((Engine.LastEnemyCount == 1)))){
if ((Units[_local1].ActionCharge % 5) == 0){
Units[_local1].UnitChild.gotoAndStop((Units[_local1].UnitChild.currentFrame + 1));
if (Units[_local1].UnitChild.currentFrame >= 2){
Units[_local1].UnitChild.gotoAndStop(1);
};
};
if (Units[_local1].ActionCharge > 0){
if (Math.random() < 0.5){
SoundFire.play();
_local27 = new Point((2 * Math.sin((((Units[_local1].AIStatus * 2) * Math.PI) / 180))), (-2 * Math.cos((((Units[_local1].AIStatus * 2) * Math.PI) / 180))));
CreateUnit(18, Units[_local1].Friendly, new Point(Units[_local1].UnitChild.x, Units[_local1].UnitChild.y), _local27);
};
if (Math.random() < 0.3){
Units[_local1].UnitChild.gotoAndStop(3);
};
};
if (Units[_local1].ActionCharge < -400){
Units[_local1].ActionCharge = 36;
};
Units[_local1].ActionCharge--;
Units[_local1].AIStatus = (Units[_local1].AIStatus + 5);
Units[_local1].StunnedTime = (Units[_local1].StunnedTime + 3);
Units[_local1].Position.x = ((0x0100 - 25) + (150 * Math.sin(((Units[_local1].AIStatus * Math.PI) / 180))));
Units[_local1].Position.y = ((162 - 20) + (100 * Math.cos(((Units[_local1].StunnedTime * Math.PI) / 180))));
if (Units[_local1].Alerted > 0){
Engine.ReinforcementLeft = 2;
};
if (Units[_local1].UnitChild.alpha < 5){
Units[_local1].UnitChild.alpha = (Units[_local1].UnitChild.alpha + 0.05);
};
} else {
Units[_local1].ActionCharge = 36;
Units[_local1].Alerted = 0;
Units[_local1].UnitChild.alpha = 0;
Units[_local1].Position.y = 5;
Units[_local1].Position.x = Math.floor((Math.random() * 340));
};
} else {
Units[_local1].UnitChild.alpha = 1;
Engine.ReinforcementLeft = 0;
Units[_local1].ActionCharge--;
if (Units[_local1].UnitChild.currentFrame < 5){
if ((Units[_local1].ActionCharge % 15) == 0){
Units[_local1].UnitChild.gotoAndStop((Units[_local1].UnitChild.currentFrame + 1));
};
Units[_local1].Alerted = 200;
} else {
if (Units[_local1].Alerted > 0){
Units[_local1].Alerted--;
Units[_local1].AIStatus = (Units[_local1].AIStatus + (0.5 * (200 - Units[_local1].Alerted)));
Units[_local1].StunnedTime = (Units[_local1].StunnedTime + (0.5 * (200 - Units[_local1].Alerted)));
Units[_local1].Position.x = ((0x0100 - 25) + ((Units[_local1].Alerted * 0.75) * Math.sin(((Units[_local1].AIStatus * Math.PI) / 180))));
Units[_local1].Position.y = ((192 - 20) + ((Units[_local1].Alerted * 0.5) * Math.cos(((Units[_local1].StunnedTime * Math.PI) / 180))));
Level.Victory.tag = 50;
} else {
Units[_local1].UnitChild.alpha = 0;
Level.Victory.visible = true;
Level.Victory.alpha = (Level.Victory.alpha - 0.1);
if (Level.Victory.alpha < 0){
Level.Victory.tag--;
if (Level.Victory.tag > 0){
Level.Victory.alpha = 1;
Level.Victory.x = (Math.random() * 200);
Level.Victory.y = (Math.random() * 150);
SoundMeleeHit.play();
} else {
Level.Victory.visible = false;
_local3 = true;
};
};
};
};
};
break;
case 16:
Engine.EnemyCount++;
if (Units[_local1].AIStatus < 0){
Units[_local1].UnitChild.alpha = 0;
Level.Training.visible = true;
Level.Training.alpha = 1;
Level.Training.gotoAndStop(20);
Units[_local1].AIStatus = 0;
Units[_local1].FacingLeft = true;
Level.BackgroundImageChild.Sky1.alpha = 0;
Level.BackgroundImageChild.Sky2.alpha = 0;
} else {
if (Units[_local1].AIStatus < 100){
Units[_local1].AIStatus = (Units[_local1].AIStatus + 0.5);
if (Units[_local1].AIStatus == 99){
Level.Training.alpha = 1;
};
} else {
if (Units[_local1].AIStatus == 100){
Level.Training.gotoAndStop(2);
Level.Training.alpha = (Level.Training.alpha + 0.025);
if (Level.Training.alpha > 5){
Level.Training.gotoAndStop(3);
};
if (Level.Training.alpha > 10){
Units[_local1].AIStatus = 101;
Level.Training.alpha = 1;
};
} else {
if (Units[_local1].AIStatus == 101){
Level.Training.alpha = (Level.Training.alpha - 0.025);
if (Level.Training.alpha <= 0){
Units[_local1].AIStatus = 102;
};
} else {
if (Units[_local1].AIStatus < 200){
Units[_local1].AIStatus++;
} else {
if (Units[_local1].AIStatus == 200){
Units[_local1].AIStatus++;
CreateUnit(23, true, new Point(1, 300), new Point(0, 0));
} else {
if (Units[_local1].AIStatus < 220){
Units[_local1].AIStatus++;
} else {
if (Units[_local1].AIStatus == 220){
CreateUnit(25, true, new Point(1, 300), new Point(0, 0));
Units[_local1].AIStatus++;
} else {
if (Units[_local1].AIStatus < 370){
Units[_local1].AIStatus++;
} else {
if (Units[_local1].AIStatus == 370){
if (Units[_local1].UnitChild.alpha < 1.5){
Units[_local1].UnitChild.alpha = (Units[_local1].UnitChild.alpha + 0.01);
Units[_local1].Position.y = (Units[_local1].Position.y + 1.5);
} else {
Units[_local1].AIStatus = (Units[_local1].AIStatus + 1);
};
Level.BackgroundImageChild.Sky1.alpha = Units[_local1].UnitChild.alpha;
Level.BackgroundImageChild.Sky2.alpha = Units[_local1].UnitChild.alpha;
} else {
if (Units[_local1].AIStatus < 450){
Units[_local1].AIStatus = 450;
} else {
if (Units[_local1].AIStatus == 450){
Level.Training.gotoAndStop(4);
Level.Training.alpha = 1;
Units[_local1].AIStatus = (Units[_local1].AIStatus + 75);
} else {
if (Units[_local1].AIStatus < 650){
Units[_local1].AIStatus++;
} else {
if (Units[_local1].AIStatus == 650){
Level.Training.gotoAndStop(5);
Units[_local1].AIStatus++;
} else {
if (Units[_local1].AIStatus < 850){
Units[_local1].AIStatus++;
} else {
if (Units[_local1].AIStatus == 850){
Level.Training.gotoAndStop(6);
Units[_local1].AIStatus++;
} else {
if (Units[_local1].AIStatus < 1050){
Units[_local1].AIStatus++;
Units[1].Position.y = (Units[1].Position.y - 1);
Units[1].Velocity.y = 0;
} else {
if (Units[_local1].AIStatus == 1050){
Level.Training.gotoAndStop(7);
Units[_local1].AIStatus++;
} else {
if (Units[_local1].AIStatus < 1250){
Units[_local1].AIStatus++;
Units[1].Position.y = (Units[1].Position.y - 1.75);
Units[1].Velocity.y = 0;
Units[1].Velocity.x = ((Units[_local1].AIStatus - 1050) * 0.04);
if (Units[1].Position.y < 2){
DestroyUnit(1);
Units[_local1].AIStatus = 1250;
};
} else {
if (Units[_local1].AIStatus == 1250){
Level.Training.gotoAndStop(8);
Units[_local1].AIStatus++;
} else {
if (Units[_local1].AIStatus < 1450){
Units[_local1].AIStatus++;
} else {
if (Units[_local1].AIStatus == 1450){
Level.Training.gotoAndStop(9);
Units[_local1].AIStatus++;
} else {
if (Units[_local1].AIStatus < 1550){
Units[_local1].AIStatus++;
} else {
if (Units[_local1].AIStatus == 1550){
Level.Training.gotoAndStop(10);
Units[_local1].AIStatus++;
} else {
if (Units[_local1].AIStatus < 1650){
Units[_local1].AIStatus++;
Units[_local1].UnitChild.alpha = (Units[_local1].UnitChild.alpha - 0.025);
Level.BackgroundImageChild.Sky1.alpha = Units[_local1].UnitChild.alpha;
Level.BackgroundImageChild.Sky2.alpha = Units[_local1].UnitChild.alpha;
Units[_local1].Position.y = (Units[_local1].Position.y - 2);
} else {
if (Units[_local1].AIStatus == 1650){
Level.Training.alpha = 0;
Units[_local1].AIStatus++;
} else {
if (Units[_local1].AIStatus < 1800){
Units[_local1].AIStatus++;
} else {
if (Units[_local1].AIStatus == 1800){
Level.Training.gotoAndStop(18);
if (Level.Training.alpha < 1){
Level.Training.alpha = (Level.Training.alpha + 0.05);
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
if ((((Input.Fire == true)) || ((Input.Melee == true)))){
SoundClick.play();
Input.Fire = true;
Engine.ContinuePossible = true;
Level.LevelCompleted = true;
Level.SelectedLevel.x = -1;
Engine.SkipSkill = true;
Engine.EnemyCount = 0;
};
break;
case 17:
if (Units[_local1].Position.x < 200){
_local6 = true;
};
break;
case 18:
if (Units[_local1].Position.x < 250){
_local6 = true;
};
break;
};
if ((((_local4 == true)) && ((Units[_local1].Health > 0)))){
if (Units[_local1].Health > 0){
Engine.EnemyCount++;
};
if (Engine.PlayerAlive == false){
_local8 = true;
} else {
_local20 = new Point(Math.abs((Engine.PlayerPosition.x - Units[_local1].UnitChild.x)), Math.abs((Engine.PlayerPosition.y - (Units[_local1].Position.y + UnitInformation[_local2].Size.y))));
if ((((((_local20.y < 100)) && (Units[_local1].Position.y))) && ((((((Units[_local1].UnitChild.x < (Engine.PlayerPosition.x + 20))) && ((Units[_local1].FacingLeft == false)))) || ((((Units[_local1].UnitChild.x > (Engine.PlayerPosition.x - 20))) && ((Units[_local1].FacingLeft == true)))))))){
Units[_local1].Alerted = 200;
};
Units[_local1].AIStatus--;
Units[_local1].Alerted--;
if (Units[_local1].Alerted > 0){
if (_local16 == true){
_local21 = 20;
} else {
if (_local17 == true){
_local21 = 250;
} else {
if (_local18 == true){
_local21 = 1000;
};
};
};
if ((((Units[_local1].FacingLeft == false)) && ((Units[_local1].Position.x > Engine.PlayerPosition.x)))){
Units[_local1].FacingLeft = true;
} else {
if ((((Units[_local1].FacingLeft == true)) && ((Units[_local1].Position.x < Engine.PlayerPosition.x)))){
Units[_local1].FacingLeft = false;
};
};
if (_local20.x > _local21){
_local22 = new Point(Math.floor((Units[_local1].UnitChild.x / 32)), Math.floor((((Units[_local1].Position.y + 5) + (UnitInformation[_local2].Size.y * 2)) / 32)));
new Point(Math.floor((Units[_local1].UnitChild.x / 32)), Math.floor((((Units[_local1].Position.y + 5) + (UnitInformation[_local2].Size.y * 2)) / 32))).y = (_local22.y - 1);
if (Units[_local1].Position.x < Engine.PlayerPosition.x){
_local6 = true;
if (_local13 == true){
_local22.x = (_local22.x + 1);
if ((((((((((_local22.x < 0)) || ((_local22.x > 15)))) || ((_local22.y < 0)))) || ((_local22.y > 11)))) || ((Level.BlockCollisionTypes[_local22.x][_local22.y] == 0)))){
_local8 = true;
};
};
} else {
_local5 = true;
if (_local13 == true){
_local22.x = (_local22.x - 1);
if ((((((((((_local22.x < 0)) || ((_local22.x > 15)))) || ((_local22.y < 0)))) || ((_local22.y > 11)))) || ((Level.BlockCollisionTypes[_local22.x][_local22.y] == 0)))){
_local8 = true;
};
};
};
};
if (_local13 == true){
if ((((_local20.x < 200)) && ((Units[_local1].Position.y < (Engine.PlayerPosition.y - 50))))){
_local7 = true;
};
if ((((_local20.x < 200)) && ((Units[_local1].Position.y > (Engine.PlayerPosition.y + 30))))){
_local8 = true;
if (Units[_local1].Position.x < Engine.PlayerPosition.x){
_local6 = true;
} else {
_local5 = true;
};
};
_local22 = new Point(Math.floor((Units[_local1].UnitChild.x / 32)), Math.floor((((Units[_local1].Position.y + 5) + (UnitInformation[_local2].Size.y * 2)) / 32)));
if (_local5 == true){
_local22.x = (_local22.x - 1);
if ((((((((((_local22.x < 0)) || ((_local22.x > 15)))) || ((_local22.y < 0)))) || ((_local22.y > 11)))) || ((Level.BlockCollisionTypes[_local22.x][_local22.y] == -1)))){
_local8 = true;
};
} else {
_local22.x = (_local22.x + 1);
if ((((((((((_local22.x < 0)) || ((_local22.x > 15)))) || ((_local22.y < 0)))) || ((_local22.y > 11)))) || ((Level.BlockCollisionTypes[_local22.x][_local22.y] == -1)))){
_local8 = true;
};
};
if (Units[_local1].CurrentFrame == 13){
_local8 = false;
};
};
if ((((_local20.y < 30)) && ((((_local17 == true)) || ((_local18 == true)))))){
_local9 = true;
};
if ((((((_local20.x < 100)) && ((_local20.y < 50)))) && ((_local16 == true)))){
_local10 = true;
};
if ((((((_local20.x > 100)) || ((_local20.y > 100)))) && ((UnitInformation[_local2].SkillTeleport > 0)))){
_local10 = true;
_local7 = true;
};
} else {
_local22 = new Point(Math.floor((Units[_local1].UnitChild.x / 32)), Math.floor((((Units[_local1].Position.y + 5) + (UnitInformation[_local2].Size.y * 2)) / 32)));
if ((((_local15 == true)) && ((Units[_local1].StandingOnGround == true)))){
if (Units[_local1].AIStatus < -200){
_local22.x = (_local22.x - 1);
_local5 = true;
if ((((((((((_local22.x < 0)) || ((_local22.x > 15)))) || ((_local22.y < 0)))) || ((_local22.y > 11)))) || ((((Level.BlockCollisionTypes[_local22.x][_local22.y] == -1)) && ((_local19 == false)))))){
Units[_local1].AIStatus = 99999;
};
_local22.y = (_local22.y - 1);
if ((((((((((_local22.x < 0)) || ((_local22.x > 15)))) || ((_local22.y < 0)))) || ((_local22.y > 11)))) || ((Level.BlockCollisionTypes[_local22.x][_local22.y] > -1)))){
Units[_local1].AIStatus = 99999;
};
} else {
if (Units[_local1].AIStatus > 200){
_local22.x = (_local22.x + 1);
_local6 = true;
if ((((((((((_local22.x < 0)) || ((_local22.x > 15)))) || ((_local22.y < 0)))) || ((_local22.y > 11)))) || ((((Level.BlockCollisionTypes[_local22.x][_local22.y] == -1)) && ((_local19 == false)))))){
Units[_local1].AIStatus = -201;
};
_local22.y = (_local22.y - 1);
if ((((((((((_local22.x < 0)) || ((_local22.x > 15)))) || ((_local22.y < 0)))) || ((_local22.y > 11)))) || ((Level.BlockCollisionTypes[_local22.x][_local22.y] > -1)))){
Units[_local1].AIStatus = -201;
};
};
};
};
if (_local14 == true){
if (Math.random() < 0.005){
Units[_local1].AIStatus = (-200 + (Math.random() * 400));
};
};
if ((((((_local13 == true)) && ((Units[_local1].AIStatus > -200)))) && ((Units[_local1].AIStatus < 200)))){
_local22 = new Point(Math.floor((Units[_local1].UnitChild.x / 32)), Math.floor(((Units[_local1].Position.y + (UnitInformation[_local2].Size.y * 2)) / 32)));
i = 0;
while ((((i < 4)) && ((_local22.y > 0)))) {
_local22.y--;
i++;
if ((((((((_local22.x < 0)) || ((_local22.x > 15)))) || ((_local22.y > 11)))) || ((((((Level.BlockCollisionTypes[_local22.x][_local22.y] == 0)) && ((UnitInformation[_local2].SkillLeap < 3)))) || ((((Level.BlockCollisionTypes[_local22.x][_local22.y] > -1)) && ((UnitInformation[_local2].SkillLeap == 3)))))))){
_local8 = true;
};
};
};
};
};
};
if (_local12 == true){
if ((((Units[_local1].Health <= 0)) && ((Units[_local1].StunnedTime > -1)))){
Units[_local1].CurrentFrame = 5;
Units[_local1].StunnedTime = -1;
if (_local2 == 0){
Engine.PlayerAlive = false;
};
};
if (Units[_local1].StunnedTime == 0){
_local23 = true;
_local24 = (3 + UnitInformation[_local2].SkillCharge);
if (_local5 == true){
Units[_local1].FacingLeft = true;
Units[_local1].Velocity.x = ((Units[_local1].Velocity.x - _local24) / 2);
} else {
if (_local6 == true){
Units[_local1].FacingLeft = false;
Units[_local1].Velocity.x = ((Units[_local1].Velocity.x + _local24) / 2);
} else {
Units[_local1].Velocity.x = (Units[_local1].Velocity.x / 2);
_local23 = false;
if (Units[_local1].CurrentFrame != 11){
Units[_local1].CurrentFrame = 1;
};
};
};
Units[_local1].Health = (Units[_local1].Health + (UnitInformation[_local2].SkillRegenerate * 0.075));
if (Units[_local1].Health > 100){
Units[_local1].Health = 100;
};
if ((((((((_local7 == true)) && ((_local10 == true)))) && ((Units[_local1].ActionCharge == 0)))) && ((UnitInformation[_local2].SkillTeleport > 0)))){
Units[_local1].ActionCharge = (110 - (UnitInformation[_local2].SkillTeleport * 30));
CreateParticle(8, new Point(Units[_local1].UnitChild.x, (Units[_local1].Position.y + UnitInformation[_local2].Size.y)), new Point(0, 0));
_local25 = new Point(Math.floor((Math.random() * 15.9)), Math.floor((Math.random() * 10.9)));
while (Level.BlockCollisionTypes[_local25.x][_local25.y] > -1) {
_local25 = new Point(Math.floor((Math.random() * 15.9)), Math.floor((Math.random() * 10.9)));
};
SoundSpawn.play();
Units[_local1].Position.x = (_local25.x * 32);
Units[_local1].Position.y = (_local25.y * 32);
CreateParticle(8, new Point((Units[_local1].Position.x + UnitInformation[_local2].Size.x), (Units[_local1].Position.y + UnitInformation[_local2].Size.y)), new Point(0, 0));
};
if ((((_local8 == true)) && ((UnitInformation[_local2].SkillLeap > 0)))){
if (Units[_local1].StandingOnGround == true){
Units[_local1].JumpCharge = 10;
Units[_local1].Velocity.y = (-5 - (UnitInformation[_local2].SkillLeap * 2));
Units[_local1].StandingOnGround = false;
} else {
if (Units[_local1].JumpCharge > 0){
Units[_local1].JumpCharge--;
Units[_local1].Velocity.y = (-5 - (UnitInformation[_local2].SkillLeap * 2));
Units[_local1].StandingOnGround = false;
};
};
};
if (Units[_local1].StandingOnGround == false){
if (_local8 == false){
Units[_local1].JumpCharge = 0;
};
if (UnitInformation[_local2].SkillLeap > 0){
Units[_local1].CurrentFrame = 8;
};
} else {
if (_local23 == true){
Units[_local1].CurrentFrame = (Units[_local1].CurrentFrame + 0.25);
if (Units[_local1].CurrentFrame > 4){
Units[_local1].CurrentFrame = 1;
};
};
};
if ((((((_local10 == true)) && ((Units[_local1].ActionCharge == 0)))) && ((UnitInformation[_local2].SkillMelee > 0)))){
Units[_local1].ActionCharge = (23 - (UnitInformation[_local2].SkillMelee * 3));
if (_local2 > 0){
Units[_local1].ActionCharge = (Units[_local1].ActionCharge + 5);
};
Units[_local1].StunnedTime = 10;
Units[_local1].CurrentFrame = 10;
Units[_local1].Velocity.y = -3;
Units[_local1].Velocity.x = (3 + UnitInformation[_local2].SkillMelee);
if (Units[_local1].FacingLeft == true){
Units[_local1].Velocity.x = (Units[_local1].Velocity.x * -1);
};
if (UnitInformation[_local2].SkillMelee > 1){
CreateParticle((7 + UnitInformation[_local2].SkillMelee), new Point(Units[_local1].UnitChild.x, (Units[_local1].Position.y + UnitInformation[_local2].Size.y)), new Point(Units[_local1].Velocity.x, 0));
};
};
if ((((_local9 == true)) && ((Units[_local1].ActionCharge == 0)))){
if (Units[_local1].FacingLeft == false){
_local26 = new Point((Units[_local1].UnitChild.x + 20), (Units[_local1].Position.y + (UnitInformation[_local2].Size.y * 0.4)));
_local27 = new Point(1, 0);
} else {
_local26 = new Point((Units[_local1].UnitChild.x - 20), (Units[_local1].Position.y + (UnitInformation[_local2].Size.y * 0.4)));
_local27 = new Point(-1, 0);
};
SoundFire.play();
switch (UnitInformation[_local2].ProjectileType){
case 0:
_local26.y = (_local26.y + 7);
if (UnitInformation[_local2].SkillFirepower == 1){
_local27 = new Point((_local27.x * 8), (-0.5 + (Math.random() * 1)));
CreateUnit(17, Units[_local1].Friendly, _local26, _local27);
Units[_local1].ActionCharge = 20;
Units[(Units.length - 1)].AIStatus = 0;
} else {
if (UnitInformation[_local2].SkillFirepower == 2){
_local27 = new Point((_local27.x * 10), 0);
CreateUnit(17, Units[_local1].Friendly, _local26, _local27);
Units[_local1].ActionCharge = 15;
Units[(Units.length - 1)].AIStatus = 0;
} else {
_local27 = new Point((_local27.x * 8), 0);
CreateUnit(17, Units[_local1].Friendly, _local26, _local27);
Units[(Units.length - 1)].AIStatus = 1;
CreateUnit(17, Units[_local1].Friendly, _local26, _local27);
Units[(Units.length - 1)].AIStatus = 180;
Units[_local1].ActionCharge = 20;
};
};
CreateParticle(2, new Point(_local26.x, (_local26.y - 2)), new Point((_local27.x * 0.1), 0));
Units[_local1].StunnedTime = 5;
break;
case 1:
_local27 = new Point((_local27.x * 8), (-0.5 + (Math.random() * 1)));
_local26.y = (_local26.y + 5);
CreateUnit(18, Units[_local1].Friendly, _local26, _local27);
CreateParticle(1, _local26, new Point((_local27.x * 0.1), 0));
Units[_local1].ActionCharge = 40;
Units[_local1].StunnedTime = 5;
break;
case 2:
_local27 = new Point((_local27.x * 14), 0);
_local26.y = (_local26.y + 14);
CreateUnit(21, Units[_local1].Friendly, _local26, _local27);
CreateParticle(1, new Point(_local26.x, (_local26.y - 3)), new Point((_local27.x * 0.1), 0));
Units[_local1].ActionCharge = 15;
Units[_local1].StunnedTime = 5;
break;
case 3:
_local27 = new Point((_local27.x * 7), (-4 - (Math.random() * 3)));
CreateUnit(19, Units[_local1].Friendly, _local26, _local27);
CreateParticle(3, new Point(_local26.x, (_local26.y + 12)), new Point((_local27.x * 0.1), 0));
Units[_local1].ActionCharge = 70;
Units[_local1].StunnedTime = 30;
break;
case 4:
_local28 = _local27.x;
_local26.y = (_local26.y + 15);
_local27 = new Point((_local28 * 8), 0);
CreateUnit(21, Units[_local1].Friendly, _local26, _local27);
_local27 = new Point((_local28 * 7), 0);
CreateUnit(21, Units[_local1].Friendly, _local26, _local27);
_local27 = new Point((_local28 * 6), 0);
CreateUnit(21, Units[_local1].Friendly, _local26, _local27);
CreateParticle(3, _local26, new Point((_local27.x * 0.1), 0));
Units[_local1].ActionCharge = 50;
Units[_local1].StunnedTime = 20;
break;
case 5:
_local27 = new Point(0, 0);
CreateUnit(20, Units[_local1].Friendly, _local26, _local27);
Units[_local1].ActionCharge = 200;
Units[_local1].StunnedTime = 200;
break;
case 6:
_local27 = new Point((_local27.x * 8), 1);
CreateUnit(18, Units[_local1].Friendly, _local26, _local27);
_local27 = new Point(_local27.x, 0);
CreateUnit(18, Units[_local1].Friendly, _local26, _local27);
_local27 = new Point(_local27.x, -1);
CreateUnit(18, Units[_local1].Friendly, _local26, _local27);
CreateParticle(3, new Point(_local26.x, (_local26.y + 4)), new Point((_local27.x * 0.1), 0));
Units[_local1].ActionCharge = 50;
Units[_local1].StunnedTime = 20;
break;
};
Units[_local1].CurrentFrame = 12;
if (Units[_local1].StandingOnGround == true){
Units[_local1].Velocity.x = 0;
} else {
Units[_local1].StunnedTime = 0;
};
};
} else {
Units[_local1].StunnedTime--;
Units[_local1].JumpCharge = 0;
if ((((((Units[_local1].StandingOnGround == true)) && ((Units[_local1].Velocity.y >= 0)))) && (!((Units[_local1].CurrentFrame == 10))))){
Units[_local1].Velocity.x = (Units[_local1].Velocity.x / 3);
};
if (Units[_local1].StunnedTime == 0){
if (Units[_local1].CurrentFrame == 12){
Units[_local1].CurrentFrame = 11;
} else {
Units[_local1].CurrentFrame = 1;
};
};
if ((((Units[_local1].Health <= 0)) && ((Units[_local1].CurrentFrame < 7)))){
Units[_local1].CurrentFrame = (Units[_local1].CurrentFrame + 0.25);
Units[_local1].Velocity.x = (Units[_local1].Velocity.x / 5);
};
};
};
if (Units[_local1].ActionCharge > 0){
Units[_local1].ActionCharge--;
};
if ((((UnitInformation[_local2].EffectedByGravity == true)) && ((Units[_local1].StandingOnGround == false)))){
Units[_local1].Velocity.y = (Units[_local1].Velocity.y + Engine.GravityPower);
};
Units[_local1].StandingOnGround = false;
Units[_local1].Position.x = (Units[_local1].Position.x + Units[_local1].Velocity.x);
Units[_local1].Position.y = (Units[_local1].Position.y + Units[_local1].Velocity.y);
if (UnitInformation[_local2].LevelCollision == true){
_local29 = false;
_local30 = false;
_local31 = false;
_local32 = false;
_local33 = false;
_local34 = false;
_local35 = false;
_local36 = false;
_local37 = new Point(Math.floor((Units[_local1].Position.x / 32)), Math.floor((Units[_local1].Position.y / 32)));
if ((((((((((_local37.x > -1)) && ((_local37.y > -1)))) && ((_local37.x < 16)))) && ((_local37.y < 13)))) && ((Level.BlockCollisionTypes[_local37.x][_local37.y] == 0)))){
_local29 = true;
};
_local37 = new Point(Math.floor(((Units[_local1].Position.x + (UnitInformation[_local2].Size.x * 2)) / 32)), Math.floor((Units[_local1].Position.y / 32)));
if ((((((((((_local37.x > -1)) && ((_local37.y > -1)))) && ((_local37.x < 16)))) && ((_local37.y < 13)))) && ((Level.BlockCollisionTypes[_local37.x][_local37.y] == 0)))){
_local30 = true;
};
_local37 = new Point(Math.floor(((Units[_local1].Position.x + (UnitInformation[_local2].Size.x * 2)) / 32)), Math.floor(((Units[_local1].Position.y + (UnitInformation[_local2].Size.y * 2)) / 32)));
if ((((((((((_local37.x > -1)) && ((_local37.y > -1)))) && ((_local37.x < 16)))) && ((_local37.y < 13)))) && ((((Level.BlockCollisionTypes[_local37.x][_local37.y] == 0)) || ((((((((Level.BlockCollisionTypes[_local37.x][_local37.y] == 1)) && ((Math.abs(((Units[_local1].Position.y + (UnitInformation[_local2].Size.y * 2)) - (_local37.y * 32))) < 12)))) && ((Units[_local1].Velocity.y >= 0)))) && ((_local7 == false)))))))){
_local32 = true;
};
_local37 = new Point(Math.floor((Units[_local1].Position.x / 32)), Math.floor(((Units[_local1].Position.y + (UnitInformation[_local2].Size.y * 2)) / 32)));
if ((((((((((_local37.x > -1)) && ((_local37.y > -1)))) && ((_local37.x < 16)))) && ((_local37.y < 13)))) && ((((Level.BlockCollisionTypes[_local37.x][_local37.y] == 0)) || ((((((((Level.BlockCollisionTypes[_local37.x][_local37.y] == 1)) && ((Math.abs(((Units[_local1].Position.y + (UnitInformation[_local2].Size.y * 2)) - (_local37.y * 32))) < 12)))) && ((Units[_local1].Velocity.y >= 0)))) && ((_local7 == false)))))))){
_local31 = true;
};
if (UnitInformation[_local2].Size.x > 16){
_local37 = new Point(Math.floor(((Units[_local1].Position.x + UnitInformation[_local2].Size.x) / 32)), Math.floor((Units[_local1].Position.y / 32)));
if ((((((((((_local37.x > -1)) && ((_local37.y > -1)))) && ((_local37.x < 16)))) && ((_local37.y < 13)))) && ((Level.BlockCollisionTypes[_local37.x][_local37.y] == 0)))){
_local29 = true;
_local30 = true;
};
_local37.y = Math.floor(((Units[_local1].Position.y + (UnitInformation[_local2].Size.y * 2)) / 32));
if ((((((((((_local37.x > -1)) && ((_local37.y > -1)))) && ((_local37.x < 16)))) && ((_local37.y < 13)))) && ((((Level.BlockCollisionTypes[_local37.x][_local37.y] == 0)) || ((((((((Level.BlockCollisionTypes[_local37.x][_local37.y] == 1)) && ((Math.abs(((Units[_local1].Position.y + (UnitInformation[_local2].Size.y * 2)) - (_local37.y * 32))) < 12)))) && ((Units[_local1].Velocity.y >= 0)))) && ((_local7 == false)))))))){
_local31 = true;
_local32 = true;
};
};
if (UnitInformation[_local2].Size.y > 16){
_local37 = new Point(Math.floor((Units[_local1].Position.x / 32)), Math.floor(((Units[_local1].Position.y + UnitInformation[_local2].Size.y) / 32)));
if ((((((((((_local37.x > -1)) && ((_local37.y > -1)))) && ((_local37.x < 16)))) && ((_local37.y < 13)))) && ((Level.BlockCollisionTypes[_local37.x][_local37.y] == 0)))){
_local29 = true;
_local31 = true;
};
_local37.x = Math.floor(((Units[_local1].Position.x + (UnitInformation[_local2].Size.x * 2)) / 32));
if ((((((((((_local37.x > -1)) && ((_local37.y > -1)))) && ((_local37.x < 16)))) && ((_local37.y < 13)))) && ((Level.BlockCollisionTypes[_local37.x][_local37.y] == 0)))){
_local30 = true;
_local32 = true;
};
};
if (Units[_local1].Position.x < 0){
_local35 = true;
} else {
if (Units[_local1].Position.x > (0x0200 - (UnitInformation[_local2].Size.x * 2))){
_local36 = true;
};
};
if (Units[_local1].Position.y < 0){
_local33 = true;
} else {
if (Units[_local1].Position.y > (384 - (UnitInformation[_local2].Size.y * 2))){
_local3 = true;
};
};
_local38 = false;
if ((((_local29 == true)) && ((_local30 == true)))){
_local33 = true;
_local38 = true;
};
if ((((_local31 == true)) && ((_local32 == true)))){
_local34 = true;
_local38 = true;
};
if ((((_local29 == true)) && ((_local31 == true)))){
_local35 = true;
_local38 = true;
};
if ((((_local32 == true)) && ((_local30 == true)))){
_local36 = true;
_local38 = true;
};
if (_local38 == false){
if (_local29 == true){
_local39 = new Point((((Math.floor((Units[_local1].Position.x / 32)) + 1) * 32) - Units[_local1].Position.x), (((Math.floor((Units[_local1].Position.y / 32)) + 1) * 32) - Units[_local1].Position.y));
if (_local39.x > _local39.y){
_local33 = true;
} else {
_local35 = true;
};
} else {
if (_local30 == true){
_local39 = new Point(((Units[_local1].Position.x + (UnitInformation[_local2].Size.x * 2)) - (Math.floor(((Units[_local1].Position.x + (UnitInformation[_local2].Size.x * 2)) / 32)) * 32)), (((Math.floor((Units[_local1].Position.y / 32)) + 1) * 32) - Units[_local1].Position.y));
if (_local39.x > _local39.y){
_local33 = true;
} else {
_local36 = true;
};
} else {
if (_local32 == true){
_local39 = new Point(((Units[_local1].Position.x + (UnitInformation[_local2].Size.x * 2)) - (Math.floor(((Units[_local1].Position.x + (UnitInformation[_local2].Size.x * 2)) / 32)) * 32)), ((Units[_local1].Position.y + (UnitInformation[_local2].Size.y * 2)) - (Math.floor(((Units[_local1].Position.y + (UnitInformation[_local2].Size.y * 2)) / 32)) * 32)));
if (_local39.x > _local39.y){
_local34 = true;
} else {
_local36 = true;
};
} else {
if (_local31 == true){
_local39 = new Point((((Math.floor((Units[_local1].Position.x / 32)) + 1) * 32) - Units[_local1].Position.x), ((Units[_local1].Position.y + (UnitInformation[_local2].Size.y * 2)) - (Math.floor(((Units[_local1].Position.y + (UnitInformation[_local2].Size.y * 2)) / 32)) * 32)));
if (_local39.x > _local39.y){
_local34 = true;
} else {
_local35 = true;
};
};
};
};
};
};
if (_local33 == true){
Units[_local1].Position.y = ((Math.floor((Units[_local1].Position.y / 32)) + 1) * 32);
if ((((((UnitInformation[_local2].SkillLeap > 1)) && ((_local8 == true)))) && ((Units[_local1].StunnedTime == 0)))){
Units[_local1].Velocity.x = 0;
Units[_local1].Velocity.y = -1;
Units[_local1].StunnedTime = 1;
Units[_local1].CurrentFrame = 13;
} else {
if (Units[_local1].Velocity.y < 0){
Units[_local1].Velocity.y = (Units[_local1].Velocity.y * -0.25);
};
};
if (UnitInformation[_local2].ProjectileDamage != undefined){
_local3 = true;
};
};
if (_local34 == true){
Units[_local1].Position.y = ((Math.floor(((Units[_local1].Position.y + (UnitInformation[_local2].Size.y * 2)) / 32)) * 32) - (UnitInformation[_local2].Size.y * 2));
if (Units[_local1].Velocity.y >= 0){
Units[_local1].Velocity.y = 0;
Units[_local1].StandingOnGround = true;
};
if (UnitInformation[_local2].ProjectileDamage != undefined){
_local3 = true;
};
};
if (_local35 == true){
Units[_local1].Position.x = ((Math.floor((Units[_local1].Position.x / 32)) + 1) * 32);
Units[_local1].Velocity.x = 0;
if (UnitInformation[_local2].ProjectileDamage != undefined){
_local3 = true;
};
};
if (_local36 == true){
Units[_local1].Position.x = ((Math.floor(((Units[_local1].Position.x + (UnitInformation[_local2].Size.x * 2)) / 32)) * 32) - (UnitInformation[_local2].Size.x * 2));
Units[_local1].Velocity.x = 0;
if (UnitInformation[_local2].ProjectileDamage != undefined){
_local3 = true;
};
};
};
_local11 = 0;
while (_local11 < Units.length) {
_local40 = Math.abs(((Units[_local1].Position.y + UnitInformation[_local2].Size.y) - (Units[_local11].Position.y + UnitInformation[Units[_local11].Type].Size.y)));
if (((!((Units[_local1].Friendly == Units[_local11].Friendly))) && (!((_local11 == _local1))))){
if (Math.abs((Units[_local1].UnitChild.x - Units[_local11].UnitChild.x)) <= (UnitInformation[_local2].Size.x + UnitInformation[Units[_local11].Type].Size.x)){
if (_local40 <= (UnitInformation[_local2].Size.y + UnitInformation[Units[_local11].Type].Size.y)){
if (((((!((UnitInformation[_local2].ProjectileDamage == undefined))) && ((UnitInformation[Units[_local11].Type].ProjectileDamage == undefined)))) && ((Units[_local11].Health > 0)))){
Units[_local11].Alerted = 200;
if ((Math.random() * 4) < UnitInformation[Units[_local11].Type].SkillDeflector){
CreateParticle(7, new Point(Units[_local11].UnitChild.x, (Units[_local11].Position.y + UnitInformation[Units[_local11].Type].Size.y)), new Point(Units[_local11].Velocity.x, Units[_local11].Velocity.y));
_local41 = (((Math.atan2(((Units[_local11].Position.y + UnitInformation[Units[_local11].Type].Size.y) - (Units[_local1].Position.y + UnitInformation[_local2].Size.y)), (Units[_local11].UnitChild.x - Units[_local1].UnitChild.x)) / Math.PI) * 180) - 90);
Units[_local1].Velocity.x = (5 * Math.sin(((_local41 * Math.PI) / 180)));
Units[_local1].Velocity.y = (-5 * Math.cos(((_local41 * Math.PI) / 180)));
Units[_local1].Friendly = Units[_local11].Friendly;
if (_local2 == 20){
_local3 = true;
};
} else {
Units[_local11].Health = (Units[_local11].Health - (UnitInformation[_local2].ProjectileDamage / ((UnitInformation[Units[_local11].Type].SkillArmor * 0.3) + 1)));
_local3 = true;
if (Units[_local11].Health <= 0){
CreateParticle(4, new Point(Units[_local11].UnitChild.x, (Units[_local11].Position.y + UnitInformation[Units[_local11].Type].Size.y)), new Point(0, 0));
} else {
CreateParticle(0, new Point(Units[_local11].UnitChild.x, (Units[_local11].Position.y + UnitInformation[Units[_local11].Type].Size.y)), new Point((-1 + (Math.random() * 2)), (-1 + (Math.random() * 2))));
};
};
} else {
if ((((((UnitInformation[Units[_local11].Type].ProjectileDamage == undefined)) && ((Units[_local1].CurrentFrame == 10)))) && ((Units[_local11].Health > 0)))){
Units[_local11].Alerted = 200;
if ((Math.random() * UnitInformation[_local2].SkillMelee) < ((Math.random() * UnitInformation[Units[_local11].Type].SkillCounter) * 0.5)){
if (Units[_local11].Type == 0){
Engine.SlowMotionTime = 40;
};
CreateParticle(6, new Point(Units[_local11].UnitChild.x, (Units[_local11].Position.y - 5)), new Point(0, -0.75));
Units[_local11].StunnedTime = 10;
Units[_local11].CurrentFrame = 9;
Units[_local1].Velocity.x = (Units[_local1].Velocity.x * -0.5);
Units[_local1].Velocity.y = -2;
Units[_local1].StunnedTime = 15;
Units[_local1].CurrentFrame = 5;
if (Units[_local1].Position.x > Units[_local11].Position.x){
Units[_local11].FacingLeft = false;
} else {
Units[_local11].FacingLeft = true;
};
} else {
Units[_local1].Velocity.x = (Units[_local1].Velocity.x * -0.3);
Units[_local1].CurrentFrame = 9;
SoundMeleeHit.play();
if (Units[_local11].CurrentFrame != 10){
Units[_local11].Health = (Units[_local11].Health - ((15 * UnitInformation[_local2].SkillMelee) / ((UnitInformation[Units[_local11].Type].SkillArmor * 0.3) + 1)));
};
if ((((UnitInformation[Units[_local11].Type].SkillShield > 0)) || ((Units[_local11].CurrentFrame == 10)))){
CreateParticle(12, new Point(Units[_local11].UnitChild.x, (Units[_local11].Position.y - 5)), new Point(0, 0));
Units[_local1].StunnedTime = 40;
Units[_local1].CurrentFrame = 5;
_local41 = (((Math.atan2(((Units[_local11].Position.y + UnitInformation[Units[_local11].Type].Size.y) - (Units[_local1].Position.y + UnitInformation[_local2].Size.y)), (Units[_local11].UnitChild.x - Units[_local1].UnitChild.x)) / Math.PI) * 180) - 90);
Units[_local1].Velocity.x = (10 * Math.sin(((_local41 * Math.PI) / 180)));
Units[_local1].Velocity.y = (-10 * Math.cos(((_local41 * Math.PI) / 180)));
};
if (UnitInformation[Units[_local11].Type].SkillUnstoppable == 0){
Units[_local11].StunnedTime = 25;
Units[_local11].CurrentFrame = 5;
Units[_local11].Velocity.y = -4;
if (Units[_local1].Velocity.x < 0){
Units[_local11].Velocity.x = 8;
} else {
Units[_local11].Velocity.x = -8;
};
};
if (Units[_local11].Health <= 0){
CreateParticle(4, new Point(Units[_local11].UnitChild.x, (Units[_local11].Position.y + UnitInformation[Units[_local11].Type].Size.y)), new Point(0, 0));
} else {
CreateParticle(0, new Point(Units[_local11].UnitChild.x, (Units[_local11].Position.y + UnitInformation[Units[_local11].Type].Size.y)), new Point((-1 + (Math.random() * 2)), (-1 + (Math.random() * 2))));
};
};
};
};
};
};
};
_local11++;
};
if (_local12 == true){
Units[_local1].UnitChild.gotoAndStop(Math.floor(Units[_local1].CurrentFrame));
};
if (Units[_local1].FacingLeft == true){
Units[_local1].UnitChild.scaleX = -2;
} else {
Units[_local1].UnitChild.scaleX = 2;
};
Units[_local1].UnitChild.x = (Math.round(((Units[_local1].Position.x + UnitInformation[_local2].Size.x) / 2)) * 2);
Units[_local1].UnitChild.y = (Math.round((Units[_local1].Position.y / 2)) * 2);
if ((((((((Units[_local1].Position.x < -50)) || ((Units[_local1].Position.y < -50)))) || ((Units[_local1].Position.x > 562)))) || ((Units[_local1].Position.y > 434)))){
_local3 = true;
};
if (_local3 == true){
if (UnitInformation[_local2].AIType == 2){
i = 0;
while (i < 6) {
CreateUnit(18, Units[_local1].Friendly, new Point(Units[_local1].Position.x, Units[_local1].Position.y), new Point((5 * Math.sin((((i * 60) * Math.PI) / 180))), (-5 * Math.cos((((i * 60) * Math.PI) / 180)))));
i++;
};
};
if (_local2 == 0){
Engine.PlayerAlive = false;
};
if (UnitInformation[_local2].ProjectileDamage != undefined){
SoundBulletHit.play();
if (Units[_local1].Type == 17){
CreateParticle(5, new Point(Units[_local1].UnitChild.x, (Units[_local1].Position.y + UnitInformation[Units[_local1].Type].Size.y)), new Point((-0.5 + (Math.random() * 1)), (-0.5 + (Math.random() * 1))));
} else {
CreateParticle(11, new Point(Units[_local1].UnitChild.x, (Units[_local1].Position.y + UnitInformation[Units[_local1].Type].Size.y)), new Point((-0.5 + (Math.random() * 1)), (-0.5 + (Math.random() * 1))));
};
};
DestroyUnit(_local1);
_local1--;
};
_local1++;
};
Engine.LastEnemyCount = Engine.EnemyCount;
Level.ForegroundChild.visible = true;
Level.BackgroundChild.visible = true;
Level.UnitHolderChild.visible = true;
Level.BackgroundImageChild.visible = true;
if ((((Engine.PlayerAlive == false)) && ((Level.LevelCompleted == false)))){
if (Engine.ContinuePossible == false){
Level.Training.visible = true;
Level.Training.gotoAndStop(1);
Level.Training.alpha = 0;
};
Engine.SlowMotionTime = 0;
Level.SignPosition = (Level.SignPosition + Level.SignVelocity);
if (Level.SignPosition > (384 - 82)){
Level.SignPosition = (Level.SignPosition - Level.SignVelocity);
Level.SignVelocity = (Level.SignVelocity * -0.8);
Engine.ContinuePossible = true;
Level.Training.StartNewGame.addEventListener(MouseEvent.MOUSE_UP, StartNewGameClick);
};
if (Level.Training.alpha < 1){
Level.Training.alpha = (Level.Training.alpha + 0.05);
};
Level.SignVelocity = (Level.SignVelocity + 0.2);
Level.LevelSigns.gotoAndStop(2);
_local42 = new Matrix(2, 0, 0, 2, 0, Level.SignPosition);
Level.ForegroundBD.draw(Level.LevelSigns, _local42, null, null, null, false);
if (Level.ForegroundChild.alpha < 1){
Level.ForegroundChild.alpha = (Level.ForegroundChild.alpha - 0.05);
if (Level.ForegroundChild.alpha < 0){
Level.BackgroundChild.alpha = 1;
Level.BackgroundImageChild.alpha = 1;
Level.ForegroundChild.alpha = 1;
CreateLevel();
};
};
if ((((((Input.Fire == true)) || ((Input.Melee == true)))) && ((Engine.ContinuePossible == true)))){
if (Level.ForegroundChild.alpha == 1){
Level.Training.StartNewGame.removeEventListener(MouseEvent.MOUSE_UP, StartNewGameClick);
Level.Training.visible = false;
DestroyLevel();
Input.Fire = false;
Input.Melee = false;
Level.BackgroundImageChild.alpha = 0;
Level.BackgroundChild.alpha = 0;
Level.ForegroundChild.alpha = 0.99;
};
};
} else {
if ((((Engine.EnemyCount < Engine.MaxEnemyCount)) && ((Engine.ReinforcementLeft > 0)))){
_local43 = false;
_local1 = 0;
while (_local1 < Units.length) {
if ((((Units[_local1].CurrentFrame == 7)) && ((Units[_local1].Type > 0)))){
CreateParticle(8, new Point(Units[_local1].UnitChild.x, (Units[_local1].Position.y + UnitInformation[Units[_local1].Type].Size.y)), new Point(0, 0));
DestroyUnit(_local1);
break;
};
_local1++;
};
Level.LastSpawnLocation.y;
while (Level.LastSpawnLocation.y < Level.LevelStringsSplitted.length) {
Level.LastSpawnLocation.x;
while (Level.LastSpawnLocation.x < Level.LevelStringsSplitted[0].length) {
if ((((Level.LevelStringsSplitted[Level.LastSpawnLocation.y][Level.LastSpawnLocation.x].charCodeAt(0) > 96)) && ((Level.LevelStringsSplitted[Level.LastSpawnLocation.y][Level.LastSpawnLocation.x].charCodeAt(0) < 122)))){
_local44 = (Level.LevelStringsSplitted[Level.LastSpawnLocation.y][Level.LastSpawnLocation.x].charCodeAt(0) - 97);
if ((((((_local44 > 0)) && (!((UnitInformation[_local44].SkillLeap == undefined))))) && (!((_local44 == 10))))){
_local43 = true;
SoundSpawn.play();
Level.LastSpawnLocation.x++;
Engine.ReinforcementLeft--;
CreateUnit(_local44, false, new Point(((Level.LastSpawnLocation.x * 32) + ((32 - UnitInformation[_local44].Size.x) / 2)), (((Level.LastSpawnLocation.y + 1) * 32) - (UnitInformation[_local44].Size.y * 2))), new Point(0, 0));
CreateParticle(8, new Point(Units[(Units.length - 1)].UnitChild.x, (Units[(Units.length - 1)].Position.y + UnitInformation[Units[(Units.length - 1)].Type].Size.y)), new Point(0, 0));
};
};
if (_local43 == true){
break;
};
Level.LastSpawnLocation.x++;
};
if (_local43 == true){
break;
};
Level.LastSpawnLocation.x = 0;
if (Level.LastSpawnLocation.y == (Level.LevelStringsSplitted.length - 1)){
Level.LastSpawnLocation.y = 0;
};
Level.LastSpawnLocation.y++;
};
} else {
if (Engine.EnemyCount == 0){
Engine.SlowMotionTime = 0;
Level.LevelCompleted = true;
Level.Training.visible = false;
Level.SignPosition = (Level.SignPosition + Level.SignVelocity);
if (Level.SignPosition > (384 - 82)){
Level.SignPosition = (Level.SignPosition - Level.SignVelocity);
Level.SignVelocity = (Level.SignVelocity * -0.8);
Engine.ContinuePossible = true;
};
Level.SignVelocity = (Level.SignVelocity + 0.2);
Level.LevelSigns.gotoAndStop(1);
_local42 = new Matrix(2, 0, 0, 2, 0, Level.SignPosition);
Level.ForegroundBD.draw(Level.LevelSigns, _local42, null, null, null, false);
if (Level.ForegroundChild.alpha < 1){
Level.ForegroundChild.alpha = (Level.ForegroundChild.alpha - 0.05);
if (Level.ForegroundChild.alpha < 0){
Level.BackgroundChild.alpha = 1;
Level.BackgroundImageChild.alpha = 1;
Level.ForegroundChild.alpha = 1;
Level.ForegroundChild.visible = false;
Level.BackgroundChild.visible = false;
Level.UnitHolderChild.visible = false;
Level.BackgroundImageChild.visible = false;
Level.SelectedLevel.x++;
if (Engine.CurrentLevel == 31){
Engine.GameStatus = 14;
} else {
if (Engine.SkipSkill == true){
Engine.GameStatus = 11;
} else {
Engine.GameStatus = 12;
};
};
};
};
if ((((((Input.Fire == true)) || ((Input.Melee == true)))) && ((Engine.ContinuePossible == true)))){
if (Level.ForegroundChild.alpha == 1){
DestroyLevel();
Input.Fire = false;
Input.Melee = false;
Level.BackgroundImageChild.alpha = 0;
Level.BackgroundChild.alpha = 0;
Level.ForegroundChild.alpha = 0.99;
};
};
};
};
};
}
public function StartNewGameClick(_arg1:MouseEvent):void{
UnitInformation[0].SkillLeap = 1;
UnitInformation[0].SkillCharge = 0;
UnitInformation[0].SkillCounter = 0;
UnitInformation[0].SkillSense = 0;
UnitInformation[0].SkillFirepower = 1;
UnitInformation[0].SkillMelee = 1;
UnitInformation[0].SkillArmor = 0;
UnitInformation[0].SkillUnstoppable = 0;
UnitInformation[0].SkillTeleport = 0;
UnitInformation[0].SkillRegenerate = 0;
UnitInformation[0].SkillDeflector = 0;
UnitInformation[0].SkillShield = 0;
Level.SelectedLevel = new Point(0, 0);
Level.LevelStatus = new Array(13);
Level.LevelStatus[0] = 0;
Level.LevelStatus[1] = new Array(0, 0, 0);
Level.LevelStatus[2] = new Array(0, 0, 0);
Level.LevelStatus[3] = new Array(0, 0, 0);
Level.LevelStatus[4] = 0;
Level.LevelStatus[5] = new Array(0, 0, 0);
Level.LevelStatus[6] = new Array(0, 0, 0);
Level.LevelStatus[7] = new Array(0, 0, 0);
Level.LevelStatus[8] = 0;
Level.LevelStatus[9] = new Array(0, 0, 0);
Level.LevelStatus[10] = new Array(0, 0, 0);
Level.LevelStatus[11] = new Array(0, 0, 0);
Level.LevelStatus[13] = 0;
Engine.ContinuePossible = true;
Level.LevelCompleted = true;
Level.SelectedLevel.x = -1;
Engine.SkipSkill = true;
Engine.EnemyCount = 0;
DestroyLevel();
Engine.ReinforcementLeft = 0;
Input.Fire = true;
musicChannel.stop();
musicChannel = MusicTitle.play(0, 999);
Level.Training.StartNewGame.removeEventListener(MouseEvent.MOUSE_UP, StartNewGameClick);
Level.Training.visible = false;
}
function frame3(){
UnitInformation = new Array();
i = 0;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Player";
UnitInformation[i].AIType = 0;
UnitInformation[i].EffectedByGravity = true;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].MovieClipClass = UnitPlayer;
UnitInformation[i].Size = new Point(8, 16);
UnitInformation[i].ProjectileType = 0;
UnitInformation[i].SkillLeap = 1;
UnitInformation[i].SkillCharge = 0;
UnitInformation[i].SkillCounter = 0;
UnitInformation[i].SkillSense = 0;
UnitInformation[i].SkillFirepower = 1;
UnitInformation[i].SkillMelee = 1;
UnitInformation[i].SkillArmor = 0;
UnitInformation[i].SkillUnstoppable = 0;
UnitInformation[i].SkillTeleport = 0;
UnitInformation[i].SkillRegenerate = 0;
UnitInformation[i].SkillDeflector = 0;
UnitInformation[i].SkillShield = 0;
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Scout";
UnitInformation[i].AIType = 6;
UnitInformation[i].EffectedByGravity = true;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].MovieClipClass = UnitScout;
UnitInformation[i].Size = new Point(8, 16);
UnitInformation[i].ProjectileType = 6;
UnitInformation[i].SkillLeap = 1;
UnitInformation[i].SkillCharge = 3;
UnitInformation[i].SkillCounter = 0;
UnitInformation[i].SkillSense = 0;
UnitInformation[i].SkillFirepower = 2;
UnitInformation[i].SkillMelee = 0;
UnitInformation[i].SkillArmor = 0;
UnitInformation[i].SkillUnstoppable = 0;
UnitInformation[i].SkillTeleport = 0;
UnitInformation[i].SkillRegenerate = 0;
UnitInformation[i].SkillDeflector = 0;
UnitInformation[i].SkillShield = 0;
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Ninja";
UnitInformation[i].AIType = 4;
UnitInformation[i].EffectedByGravity = true;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].MovieClipClass = UnitNinja;
UnitInformation[i].Size = new Point(8, 16);
UnitInformation[i].ProjectileType = -1;
UnitInformation[i].SkillLeap = 3;
UnitInformation[i].SkillCharge = 0;
UnitInformation[i].SkillCounter = 1;
UnitInformation[i].SkillSense = 0;
UnitInformation[i].SkillFirepower = 0;
UnitInformation[i].SkillMelee = 2;
UnitInformation[i].SkillArmor = 0;
UnitInformation[i].SkillUnstoppable = 0;
UnitInformation[i].SkillTeleport = 0;
UnitInformation[i].SkillRegenerate = 0;
UnitInformation[i].SkillDeflector = 0;
UnitInformation[i].SkillShield = 0;
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Mutant";
UnitInformation[i].AIType = 7;
UnitInformation[i].EffectedByGravity = true;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].MovieClipClass = UnitMutant;
UnitInformation[i].Size = new Point(8, 16);
UnitInformation[i].ProjectileType = 5;
UnitInformation[i].SkillLeap = 0;
UnitInformation[i].SkillCharge = 0;
UnitInformation[i].SkillCounter = 3;
UnitInformation[i].SkillSense = 0;
UnitInformation[i].SkillFirepower = 1;
UnitInformation[i].SkillMelee = 0;
UnitInformation[i].SkillArmor = 0;
UnitInformation[i].SkillUnstoppable = 0;
UnitInformation[i].SkillTeleport = 0;
UnitInformation[i].SkillRegenerate = 0;
UnitInformation[i].SkillDeflector = 2;
UnitInformation[i].SkillShield = 0;
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Fighter";
UnitInformation[i].AIType = 9;
UnitInformation[i].EffectedByGravity = true;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].MovieClipClass = UnitFighter;
UnitInformation[i].Size = new Point(8, 24);
UnitInformation[i].ProjectileType = 2;
UnitInformation[i].SkillLeap = 1;
UnitInformation[i].SkillCharge = 0;
UnitInformation[i].SkillCounter = 0;
UnitInformation[i].SkillSense = 0;
UnitInformation[i].SkillFirepower = 2;
UnitInformation[i].SkillMelee = 0;
UnitInformation[i].SkillArmor = 3;
UnitInformation[i].SkillUnstoppable = 0;
UnitInformation[i].SkillTeleport = 0;
UnitInformation[i].SkillRegenerate = 0;
UnitInformation[i].SkillDeflector = 0;
UnitInformation[i].SkillShield = 0;
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Defender";
UnitInformation[i].AIType = 9;
UnitInformation[i].EffectedByGravity = true;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].MovieClipClass = UnitDefender;
UnitInformation[i].Size = new Point(8, 16);
UnitInformation[i].ProjectileType = 1;
UnitInformation[i].SkillLeap = 0;
UnitInformation[i].SkillCharge = 0;
UnitInformation[i].SkillCounter = 0;
UnitInformation[i].SkillSense = 0;
UnitInformation[i].SkillFirepower = 3;
UnitInformation[i].SkillMelee = 0;
UnitInformation[i].SkillArmor = 1;
UnitInformation[i].SkillUnstoppable = 0;
UnitInformation[i].SkillTeleport = 0;
UnitInformation[i].SkillRegenerate = 0;
UnitInformation[i].SkillDeflector = 2;
UnitInformation[i].SkillShield = 0;
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Mauler";
UnitInformation[i].AIType = 8;
UnitInformation[i].EffectedByGravity = true;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].MovieClipClass = UnitMauler;
UnitInformation[i].Size = new Point(12, 24);
UnitInformation[i].ProjectileType = -1;
UnitInformation[i].SkillLeap = 0;
UnitInformation[i].SkillCharge = 0;
UnitInformation[i].SkillCounter = 2;
UnitInformation[i].SkillSense = 0;
UnitInformation[i].SkillFirepower = 0;
UnitInformation[i].SkillMelee = 3;
UnitInformation[i].SkillArmor = 0;
UnitInformation[i].SkillUnstoppable = 0;
UnitInformation[i].SkillTeleport = 0;
UnitInformation[i].SkillRegenerate = 0;
UnitInformation[i].SkillDeflector = 1;
UnitInformation[i].SkillShield = 0;
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Blinker";
UnitInformation[i].AIType = 5;
UnitInformation[i].EffectedByGravity = true;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].MovieClipClass = UnitBlinker;
UnitInformation[i].Size = new Point(8, 16);
UnitInformation[i].ProjectileType = -1;
UnitInformation[i].SkillLeap = 0;
UnitInformation[i].SkillCharge = 0;
UnitInformation[i].SkillCounter = 1;
UnitInformation[i].SkillSense = 0;
UnitInformation[i].SkillFirepower = 0;
UnitInformation[i].SkillMelee = 2;
UnitInformation[i].SkillArmor = 0;
UnitInformation[i].SkillUnstoppable = 0;
UnitInformation[i].SkillTeleport = 3;
UnitInformation[i].SkillRegenerate = 0;
UnitInformation[i].SkillDeflector = 0;
UnitInformation[i].SkillShield = 0;
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Lizard";
UnitInformation[i].AIType = 10;
UnitInformation[i].EffectedByGravity = true;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].MovieClipClass = UnitLizard;
UnitInformation[i].Size = new Point(12, 24);
UnitInformation[i].ProjectileType = 4;
UnitInformation[i].SkillLeap = 0;
UnitInformation[i].SkillCharge = 0;
UnitInformation[i].SkillCounter = 0;
UnitInformation[i].SkillSense = 0;
UnitInformation[i].SkillFirepower = 2;
UnitInformation[i].SkillMelee = 0;
UnitInformation[i].SkillArmor = 1;
UnitInformation[i].SkillUnstoppable = 0;
UnitInformation[i].SkillTeleport = 0;
UnitInformation[i].SkillRegenerate = 3;
UnitInformation[i].SkillDeflector = 0;
UnitInformation[i].SkillShield = 0;
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Lurker";
UnitInformation[i].AIType = 4;
UnitInformation[i].EffectedByGravity = true;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].MovieClipClass = UnitLurker;
UnitInformation[i].Size = new Point(8, 16);
UnitInformation[i].ProjectileType = -1;
UnitInformation[i].SkillLeap = 2;
UnitInformation[i].SkillCharge = 0;
UnitInformation[i].SkillCounter = 3;
UnitInformation[i].SkillSense = 0;
UnitInformation[i].SkillFirepower = 0;
UnitInformation[i].SkillMelee = 1;
UnitInformation[i].SkillArmor = 0;
UnitInformation[i].SkillUnstoppable = 0;
UnitInformation[i].SkillTeleport = 0;
UnitInformation[i].SkillRegenerate = 0;
UnitInformation[i].SkillDeflector = 0;
UnitInformation[i].SkillShield = 0;
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Argos";
UnitInformation[i].AIType = 12;
UnitInformation[i].EffectedByGravity = true;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].MovieClipClass = UnitGeek;
UnitInformation[i].Size = new Point(8, 16);
UnitInformation[i].ProjectileType = -1;
UnitInformation[i].SkillLeap = 3;
UnitInformation[i].SkillCharge = 2;
UnitInformation[i].SkillCounter = 1;
UnitInformation[i].SkillSense = 0;
UnitInformation[i].SkillFirepower = 0;
UnitInformation[i].SkillMelee = 3;
UnitInformation[i].SkillArmor = 4;
UnitInformation[i].SkillUnstoppable = 0;
UnitInformation[i].SkillTeleport = 0;
UnitInformation[i].SkillRegenerate = 0;
UnitInformation[i].SkillDeflector = 3;
UnitInformation[i].SkillShield = 1;
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Hamster";
UnitInformation[i].AIType = 7;
UnitInformation[i].EffectedByGravity = true;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].MovieClipClass = UnitHamster;
UnitInformation[i].Size = new Point(8, 16);
UnitInformation[i].ProjectileType = 3;
UnitInformation[i].SkillLeap = 0;
UnitInformation[i].SkillCharge = 0;
UnitInformation[i].SkillCounter = 0;
UnitInformation[i].SkillSense = 0;
UnitInformation[i].SkillFirepower = 3;
UnitInformation[i].SkillMelee = 0;
UnitInformation[i].SkillArmor = 2;
UnitInformation[i].SkillUnstoppable = 0;
UnitInformation[i].SkillTeleport = 1;
UnitInformation[i].SkillRegenerate = 0;
UnitInformation[i].SkillDeflector = 0;
UnitInformation[i].SkillShield = 0;
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Ant";
UnitInformation[i].AIType = 5;
UnitInformation[i].EffectedByGravity = true;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].MovieClipClass = UnitAnt;
UnitInformation[i].Size = new Point(8, 16);
UnitInformation[i].ProjectileType = -1;
UnitInformation[i].SkillLeap = 0;
UnitInformation[i].SkillCharge = 0;
UnitInformation[i].SkillCounter = 3;
UnitInformation[i].SkillSense = 0;
UnitInformation[i].SkillFirepower = 0;
UnitInformation[i].SkillMelee = 1;
UnitInformation[i].SkillArmor = 0;
UnitInformation[i].SkillUnstoppable = 0;
UnitInformation[i].SkillTeleport = 0;
UnitInformation[i].SkillRegenerate = 0;
UnitInformation[i].SkillDeflector = 0;
UnitInformation[i].SkillShield = 2;
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Armor";
UnitInformation[i].AIType = 5;
UnitInformation[i].EffectedByGravity = true;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].MovieClipClass = UnitArmor;
UnitInformation[i].Size = new Point(12, 24);
UnitInformation[i].ProjectileType = -1;
UnitInformation[i].SkillLeap = 0;
UnitInformation[i].SkillCharge = -2;
UnitInformation[i].SkillCounter = 0;
UnitInformation[i].SkillSense = 0;
UnitInformation[i].SkillFirepower = 0;
UnitInformation[i].SkillMelee = 1;
UnitInformation[i].SkillArmor = 0;
UnitInformation[i].SkillUnstoppable = 0;
UnitInformation[i].SkillTeleport = 0;
UnitInformation[i].SkillRegenerate = 0;
UnitInformation[i].SkillDeflector = 0;
UnitInformation[i].SkillShield = 0;
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Queen";
UnitInformation[i].AIType = 13;
UnitInformation[i].EffectedByGravity = false;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].MovieClipClass = UnitQueen;
UnitInformation[i].Size = new Point(30, 48);
UnitInformation[i].SkillCounter = 0;
UnitInformation[i].SkillArmor = 14;
UnitInformation[i].SkillDeflector = 0;
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Gargoyle";
UnitInformation[i].AIType = 14;
UnitInformation[i].EffectedByGravity = false;
UnitInformation[i].LevelCollision = false;
UnitInformation[i].MovieClipClass = UnitGargoyle;
UnitInformation[i].Size = new Point(30, 32);
UnitInformation[i].SkillCounter = 0;
UnitInformation[i].SkillArmor = 14;
UnitInformation[i].SkillDeflector = 3;
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Zapper";
UnitInformation[i].AIType = 15;
UnitInformation[i].EffectedByGravity = false;
UnitInformation[i].LevelCollision = false;
UnitInformation[i].MovieClipClass = UnitZapper;
UnitInformation[i].Size = new Point(30, 45);
UnitInformation[i].SkillCounter = 2;
UnitInformation[i].SkillArmor = 5;
UnitInformation[i].SkillDeflector = 3;
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Red oscillating Bullet";
UnitInformation[i].AIType = 1;
UnitInformation[i].StartFrame = 1;
UnitInformation[i].EffectedByGravity = false;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].ProjectileDamage = 20;
UnitInformation[i].MovieClipClass = UnitProjectile;
UnitInformation[i].Size = new Point(3, 5);
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Yellow Bullet";
UnitInformation[i].AIType = -1;
UnitInformation[i].StartFrame = 11;
UnitInformation[i].EffectedByGravity = false;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].ProjectileDamage = 15;
UnitInformation[i].MovieClipClass = UnitProjectile;
UnitInformation[i].Size = new Point(3, 5);
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Exploding Yellow Bullet";
UnitInformation[i].AIType = 2;
UnitInformation[i].StartFrame = 21;
UnitInformation[i].EffectedByGravity = true;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].ProjectileDamage = 50;
UnitInformation[i].MovieClipClass = UnitProjectile;
UnitInformation[i].Size = new Point(6, 9);
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Green Homing Bullet";
UnitInformation[i].AIType = 3;
UnitInformation[i].StartFrame = 31;
UnitInformation[i].EffectedByGravity = false;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].ProjectileDamage = 30;
UnitInformation[i].MovieClipClass = UnitProjectile;
UnitInformation[i].Size = new Point(6, 9);
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Yellow Speedy Bullet";
UnitInformation[i].AIType = -1;
UnitInformation[i].StartFrame = 41;
UnitInformation[i].EffectedByGravity = false;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].ProjectileDamage = 10;
UnitInformation[i].MovieClipClass = UnitProjectile;
UnitInformation[i].Size = new Point(6, 5);
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Dummy";
UnitInformation[i].AIType = 11;
UnitInformation[i].EffectedByGravity = true;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].MovieClipClass = UnitArmor;
UnitInformation[i].Size = new Point(12, 24);
UnitInformation[i].ProjectileType = -1;
UnitInformation[i].SkillLeap = 0;
UnitInformation[i].SkillCharge = 0;
UnitInformation[i].SkillCounter = 0;
UnitInformation[i].SkillSense = 0;
UnitInformation[i].SkillFirepower = 0;
UnitInformation[i].SkillMelee = 0;
UnitInformation[i].SkillArmor = 0;
UnitInformation[i].SkillUnstoppable = 0;
UnitInformation[i].SkillTeleport = 0;
UnitInformation[i].SkillRegenerate = 0;
UnitInformation[i].SkillDeflector = 0;
UnitInformation[i].SkillShield = 0;
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Tez INTRO";
UnitInformation[i].AIType = 18;
UnitInformation[i].EffectedByGravity = true;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].MovieClipClass = UnitTez;
UnitInformation[i].Size = new Point(12, 18);
UnitInformation[i].ProjectileType = -1;
UnitInformation[i].SkillLeap = 1;
UnitInformation[i].SkillCharge = 0;
UnitInformation[i].SkillCounter = 0;
UnitInformation[i].SkillSense = 0;
UnitInformation[i].SkillFirepower = 0;
UnitInformation[i].SkillMelee = 0;
UnitInformation[i].SkillArmor = 0;
UnitInformation[i].SkillUnstoppable = 0;
UnitInformation[i].SkillTeleport = 0;
UnitInformation[i].SkillRegenerate = 0;
UnitInformation[i].SkillDeflector = 0;
UnitInformation[i].SkillShield = 0;
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Argos INTRO";
UnitInformation[i].AIType = 16;
UnitInformation[i].EffectedByGravity = false;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].MovieClipClass = UnitGeek;
UnitInformation[i].Size = new Point(12, 18);
UnitInformation[i].ProjectileType = -1;
UnitInformation[i].SkillLeap = 1;
UnitInformation[i].SkillCharge = -1;
UnitInformation[i].SkillCounter = 0;
UnitInformation[i].SkillSense = 0;
UnitInformation[i].SkillFirepower = 0;
UnitInformation[i].SkillMelee = 0;
UnitInformation[i].SkillArmor = 0;
UnitInformation[i].SkillUnstoppable = 0;
UnitInformation[i].SkillTeleport = 0;
UnitInformation[i].SkillRegenerate = 0;
UnitInformation[i].SkillDeflector = 1;
UnitInformation[i].SkillShield = 0;
i++;
UnitInformation[i] = new Object();
UnitInformation[i].Name = "Player INTRO";
UnitInformation[i].AIType = 17;
UnitInformation[i].EffectedByGravity = true;
UnitInformation[i].LevelCollision = true;
UnitInformation[i].MovieClipClass = UnitPlayer;
UnitInformation[i].Size = new Point(8, 16);
UnitInformation[i].ProjectileType = 0;
UnitInformation[i].SkillLeap = 1;
UnitInformation[i].SkillCharge = -1;
UnitInformation[i].SkillCounter = 0;
UnitInformation[i].SkillSense = 0;
UnitInformation[i].SkillFirepower = 1;
UnitInformation[i].SkillMelee = 3;
UnitInformation[i].SkillArmor = 0;
UnitInformation[i].SkillUnstoppable = 0;
UnitInformation[i].SkillTeleport = 0;
UnitInformation[i].SkillRegenerate = 0;
UnitInformation[i].SkillDeflector = 0;
UnitInformation[i].SkillShield = 0;
i = 0;
while (i < UnitInformation.length) {
TemporaryUnitChild = new UnitInformation[i].MovieClipClass();
UnitInformation[i].UnitBitmapData = new BitmapData(UnitInformation[i].Size.x, UnitInformation[i].Size.y, true, 4278190080);
UnitInformation[i].UnitBitmapData.draw(TemporaryUnitChild);
i++;
};
Units = new Array();
Particles = new Array();
Input = new Object();
Input.Left = false;
Input.Right = false;
Input.Up = false;
Input.Down = false;
Input.Melee = false;
Input.Fire = false;
Engine = new Object();
Engine.GravityPower = 0.5;
Engine.CurrentLevel = -1;
Engine.SlowMotionTime = 0;
Engine.Cycle = 0;
Engine.PlayerPosition = new Point(0, 0);
Engine.PlayerAlive = true;
Engine.MaxEnemyCount = 0;
Engine.EnemyCount = 0;
Engine.LastEnemyCount = 0;
Engine.ReinforcementLeft = 0;
Engine.BackgroundAnimation = 0;
Engine.ContinuePossible = false;
Engine.GameStatus = 13;
Engine.SelectedSkill = 0;
Engine.GoingUp = false;
Engine.SkipSkill = false;
ColorMatrix = [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
RedColorMatrix = new ColorMatrixFilter(ColorMatrix);
ColorMatrix = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
RegularColorMatrix = new ColorMatrixFilter(ColorMatrix);
Level = new Object();
Level.LevelCompleted = false;
Level.CurrentTheme = 0;
Level.SignPosition = 0;
Level.SignVelocity = 0;
Level.SelectedLevel = new Point(0, 0);
Level.LevelStatus = new Array(13);
Level.LevelStatus[0] = 0;
Level.LevelStatus[1] = new Array(0, 0, 0);
Level.LevelStatus[2] = new Array(0, 0, 0);
Level.LevelStatus[3] = new Array(0, 0, 0);
Level.LevelStatus[4] = 0;
Level.LevelStatus[5] = new Array(0, 0, 0);
Level.LevelStatus[6] = new Array(0, 0, 0);
Level.LevelStatus[7] = new Array(0, 0, 0);
Level.LevelStatus[8] = 0;
Level.LevelStatus[9] = new Array(0, 0, 0);
Level.LevelStatus[10] = new Array(0, 0, 0);
Level.LevelStatus[11] = new Array(0, 0, 0);
Level.LevelStatus[13] = 0;
Level.LevelSigns = new LevelEndSign();
Level.LastSpawnLocation = new Point(0, 0);
Level.LevelStringsSplitted = new Array();
Level.BlockCollisionTypes = new Array();
Level.BackgroundImageChild = this.addChild(new Background());
Level.BackgroundImageChild.scaleX = 2;
Level.BackgroundImageChild.scaleY = 2;
Level.BackgroundBD = new BitmapData(0x0200, 384, true, 4278190080);
Level.BackgroundBitmap = new Bitmap(Level.BackgroundBD);
Level.BackgroundChild = this.addChild(Level.BackgroundBitmap);
Level.UnitHolderChild = this.addChild(new MovieClip());
Level.ForegroundBD = new BitmapData(0x0200, 384, true, 4278190080);
Level.ForegroundBitmap = new Bitmap(Level.ForegroundBD);
Level.ForegroundChild = this.addChild(Level.ForegroundBitmap);
Level.Skills = this.addChild(new Skills());
Level.Skills.x = 0;
Level.Skills.y = 44;
Level.Skills.scaleX = 2;
Level.Skills.scaleY = 2;
Level.Skills.alpha = 0;
Level.Skills.visible = false;
Level.LevelProgress = this.addChild(new LevelProgress());
Level.LevelProgress.x = 5;
Level.LevelProgress.y = 132;
Level.LevelProgress.scaleX = 2;
Level.LevelProgress.scaleY = 2;
Level.LevelProgress.alpha = 0;
Level.LevelProgress.visible = false;
Level.Victory = this.addChild(new Victory());
Level.Victory.visible = false;
Level.Victory.scaleX = 2;
Level.Victory.scaleY = 2;
Level.Training = this.addChild(new Training());
Level.Training.visible = false;
Level.Training.scaleX = 2;
Level.Training.scaleY = 2;
musicChannel = new SoundChannel();
MusicLastBoss = new LastBoss();
MusicTitle = new Title();
MusicBoss = new Boss();
MusicCastle = new Castle();
MusicForest = new Forest();
MusicCave = new Cave();
musicChannel = MusicTitle.play(0, 9999);
SoundBulletHit = new BulletHit();
SoundClick = new Click();
SoundFire = new Fire();
SoundMeleeHit = new MeleeHit();
SoundSpawn = new Spawn();
CreateLevel();
timer = new Timer(20);
timer.addEventListener(TimerEvent.TIMER, onTimer);
timer.start();
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
}
public function UpdateLevelScreen(){
Level.LevelProgress.visible = true;
if (Level.LevelProgress.alpha < 1){
Level.LevelProgress.alpha = (Level.LevelProgress.alpha + 0.05);
};
if (Level.Skills.alpha > 0){
Level.Skills.alpha = (Level.Skills.alpha - 0.05);
} else {
Level.Skills.visible = false;
};
Level.LevelProgress.ArrowUp.visible = true;
Level.LevelProgress.ArrowDown.visible = true;
Level.LevelProgress.ArrowUp.gotoAndStop(5);
Level.LevelProgress.ArrowUp.scaleY = -1;
Level.LevelProgress.ArrowDown.gotoAndStop(5);
i = 0;
while (i < 13) {
if ((i % 4) == 0){
Level.LevelProgress[("Level" + Number((i + 1)))].gotoAndStop((Level.LevelStatus[i] + 1));
if (Level.SelectedLevel.x == i){
Level.SelectedLevel.y = 0;
Level.LevelProgress[("Level" + Number((i + 1)))].gotoAndStop(4);
Level.LevelProgress.ArrowUp.visible = false;
Level.LevelProgress.ArrowDown.visible = false;
};
} else {
Level.LevelProgress[(("Level" + Number((i + 1))) + "a")].gotoAndStop((Level.LevelStatus[i][0] + 1));
Level.LevelProgress[(("Level" + Number((i + 1))) + "b")].gotoAndStop((Level.LevelStatus[i][1] + 1));
Level.LevelProgress[(("Level" + Number((i + 1))) + "c")].gotoAndStop((Level.LevelStatus[i][2] + 1));
if (Level.SelectedLevel.x == i){
Level.LevelProgress.ArrowUp.x = (11 + (i * 19));
Level.LevelProgress.ArrowDown.x = Level.LevelProgress.ArrowUp.x;
if (Input.Up == true){
SoundClick.play();
Input.Up = false;
Level.SelectedLevel.y--;
if (Level.SelectedLevel.y < 0){
Level.SelectedLevel.y = 2;
};
} else {
if (Input.Down == true){
SoundClick.play();
Input.Down = false;
Level.SelectedLevel.y++;
if (Level.SelectedLevel.y > 2){
Level.SelectedLevel.y = 0;
};
};
};
if (Level.SelectedLevel.y == 0){
Level.LevelProgress[(("Level" + Number((i + 1))) + "a")].gotoAndStop(4);
} else {
if (Level.SelectedLevel.y == 1){
Level.LevelProgress[(("Level" + Number((i + 1))) + "b")].gotoAndStop(4);
} else {
Level.LevelProgress[(("Level" + Number((i + 1))) + "c")].gotoAndStop(4);
};
};
};
};
i++;
};
if ((((((Input.Fire == true)) || ((Input.Melee == true)))) && ((Level.Skills.visible == false)))){
SoundClick.play();
Input.Fire = false;
Input.Melee = false;
if (Level.SelectedLevel.x < 13){
if ((Level.SelectedLevel.x % 4) == 0){
Level.LevelStatus[Level.SelectedLevel.x] = 2;
} else {
i = 0;
while (i < 3) {
if (Level.SelectedLevel.y == i){
Level.LevelStatus[Level.SelectedLevel.x][i] = 2;
} else {
Level.LevelStatus[Level.SelectedLevel.x][i] = 1;
};
i++;
};
};
Engine.CurrentLevel = (Level.SelectedLevel.x * 3);
if (Level.SelectedLevel.x > 0){
Engine.CurrentLevel = (Engine.CurrentLevel - 2);
};
if (Level.SelectedLevel.x > 4){
Engine.CurrentLevel = (Engine.CurrentLevel - 2);
};
if (Level.SelectedLevel.x > 8){
Engine.CurrentLevel = (Engine.CurrentLevel - 2);
};
Engine.CurrentLevel = (Engine.CurrentLevel + Level.SelectedLevel.y);
} else {
Engine.CurrentLevel = 31;
};
if (Level.SelectedLevel.x == 1){
musicChannel.stop();
musicChannel = MusicForest.play(0, 9999);
} else {
if (Level.SelectedLevel.x == 4){
musicChannel.stop();
musicChannel = MusicBoss.play(0, 9999);
} else {
if (Level.SelectedLevel.x == 5){
musicChannel.stop();
musicChannel = MusicCave.play(0, 9999);
} else {
if (Level.SelectedLevel.x == 8){
musicChannel.stop();
musicChannel = MusicBoss.play(0, 9999);
} else {
if (Level.SelectedLevel.x == 9){
musicChannel.stop();
musicChannel = MusicCastle.play(0, 9999);
} else {
if (Level.SelectedLevel.x == 12){
musicChannel.stop();
musicChannel = MusicBoss.play(0, 9999);
} else {
if (Level.SelectedLevel.x == 13){
musicChannel.stop();
musicChannel = MusicLastBoss.play(0, 9999);
};
};
};
};
};
};
};
Engine.GameStatus = 13;
CreateLevel();
};
}
public function keyDownHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.LEFT){
Input.Left = true;
} else {
if (_arg1.keyCode == Keyboard.RIGHT){
Input.Right = true;
} else {
if (_arg1.keyCode == Keyboard.UP){
Input.Up = true;
} else {
if (_arg1.keyCode == Keyboard.DOWN){
Input.Down = true;
} else {
if (_arg1.keyCode == 88){
Input.Fire = true;
} else {
if (_arg1.keyCode == 90){
Input.Melee = true;
};
};
};
};
};
};
}
function frame1(){
stop();
PlayerGoingLeft = false;
PlayerFrame = 1;
pcent = ((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 100);
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, PL_LOADING);
addEventListener(Event.ENTER_FRAME, UpdatePreLoader);
}
public function DestroyUnit(_arg1:int){
Level.UnitHolderChild.removeChild(Units[_arg1].UnitChild);
Units.splice(_arg1, 1);
}
public function DestroyParticle(_arg1:int){
Level.UnitHolderChild.removeChild(Particles[_arg1].ParticleChild);
Particles.splice(_arg1, 1);
}
public function keyUpHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.LEFT){
Input.Left = false;
} else {
if (_arg1.keyCode == Keyboard.RIGHT){
Input.Right = false;
} else {
if (_arg1.keyCode == Keyboard.UP){
Input.Up = false;
} else {
if (_arg1.keyCode == Keyboard.DOWN){
Input.Down = false;
} else {
if (_arg1.keyCode == 88){
Input.Fire = false;
} else {
if (_arg1.keyCode == 90){
Input.Melee = false;
};
};
};
};
};
};
}
public function onTimer(_arg1:TimerEvent){
Engine.Cycle++;
if (Engine.GameStatus == 13){
if (Level.LevelProgress.visible == true){
Level.LevelProgress.alpha = (Level.LevelProgress.alpha - 0.05);
musicChannel.soundTransform = new SoundTransform((0.9 - (Level.LevelProgress.alpha * 0.5)), 0);
if (Level.LevelProgress.alpha < 0){
Level.LevelProgress.visible = false;
};
} else {
if ((((Engine.SlowMotionTime <= 0)) || ((((Engine.SlowMotionTime > 0)) && (((Engine.Cycle % 5) == 0)))))){
UpdateUnits();
UpdateParticles();
UpdateBackground();
} else {
Engine.SlowMotionTime--;
};
};
} else {
if (Engine.GameStatus == 11){
UpdateLevelScreen();
} else {
if (Engine.GameStatus == 12){
UpdateSkillScreen();
} else {
if (Engine.GameStatus == 14){
if (Level.Credits == undefined){
Level.Credits = this.addChild(new Credits());
Level.Credits.scaleX = 2;
Level.Credits.scaleY = 2;
Level.Credits.alpha = 0;
Level.ForegroundChild.visible = false;
Level.BackgroundChild.visible = false;
Level.UnitHolderChild.visible = false;
musicChannel.stop();
musicChannel = MusicTitle.play(0, 999);
Level.Credits.a.gotoAndStop(1);
Level.Credits.b.gotoAndStop(1);
Level.Credits.c.gotoAndStop(1);
Level.Credits.d.gotoAndStop(1);
Level.Credits.e.gotoAndStop(1);
Level.Credits.f.gotoAndStop(1);
Level.Credits.g.gotoAndStop(1);
Level.Credits.h.gotoAndStop(1);
Level.Credits.i.gotoAndStop(1);
Level.Credits.j.gotoAndStop(1);
Level.Credits.k.gotoAndStop(1);
Level.Credits.l.gotoAndStop(1);
Level.Credits.m.gotoAndStop(1);
Level.Credits.n.gotoAndStop(1);
Level.Credits.o.gotoAndStop(1);
Level.Credits.p.gotoAndStop(1);
Level.Credits.q.gotoAndStop(1);
Level.Credits.r.gotoAndStop(1);
} else {
Level.BackgroundImageChild.visible = true;
Level.BackgroundImageChild.alpha = 1;
Level.BackgroundImageChild.gotoAndStop(2);
UpdateBackground();
if (Level.Credits.alpha > 19){
if ((Engine.Cycle % 2) == 0){
if (Level.Credits.y > -3200){
Level.Credits.y = (Level.Credits.y - 2);
};
};
} else {
Level.Credits.alpha = (Level.Credits.alpha + 0.05);
};
};
};
};
};
};
}
public function CreateUnit(_arg1:int, _arg2:Boolean, _arg3:Point, _arg4:Point){
var _local5:*;
_local5 = Units.length;
Units[_local5] = new Object();
Units[_local5].Type = _arg1;
Units[_local5].CurrentFrame = 1;
Units[_local5].FacingLeft = false;
Units[_local5].StunnedTime = 0;
Units[_local5].ActionCharge = 0;
Units[_local5].JumpCharge = 0;
Units[_local5].Friendly = _arg2;
Units[_local5].StandingOnGround = false;
Units[_local5].Position = new Point(_arg3.x, (_arg3.y - 5));
Units[_local5].Velocity = new Point(_arg4.x, _arg4.y);
Units[_local5].Health = 100;
Units[_local5].AIStatus = -500;
Units[_local5].Alerted = 0;
Units[_local5].UnitChild = Level.UnitHolderChild.addChild(new UnitInformation[_arg1].MovieClipClass());
Units[_local5].UnitChild.scaleX = 2;
Units[_local5].UnitChild.scaleY = 2;
Units[_local5].UnitChild.x = (Math.round((_arg3.x / 2)) * 2);
Units[_local5].UnitChild.y = (Math.round((_arg3.y / 2)) * 2);
if (UnitInformation[_arg1].StartFrame != undefined){
Units[_local5].UnitChild.gotoAndPlay(UnitInformation[_arg1].StartFrame);
} else {
Units[_local5].UnitChild.gotoAndStop(1);
};
}
public function UpdateBackground(){
switch ((Level.BackgroundImageChild.currentFrame - 1)){
case 1:
Engine.BackgroundAnimation = (Engine.BackgroundAnimation + 10);
Level.BackgroundImageChild.Forest.x = Math.floor((-2 * Math.sin(((Engine.BackgroundAnimation * Math.PI) / 180))));
Level.BackgroundImageChild.Forest.y = Math.floor((0 * Math.cos(((Engine.BackgroundAnimation * Math.PI) / 180))));
break;
case 2:
break;
case 3:
Level.BackgroundImageChild.Castle1.x = (Level.BackgroundImageChild.Castle1.x + 5);
Level.BackgroundImageChild.Castle2.x = (Level.BackgroundImageChild.Castle2.x + 5);
if (Level.BackgroundImageChild.Castle1.x > 0x0100){
Level.BackgroundImageChild.Castle1.x = (Level.BackgroundImageChild.Castle1.x - 0x0200);
};
if (Level.BackgroundImageChild.Castle2.x > 0x0100){
Level.BackgroundImageChild.Castle2.x = (Level.BackgroundImageChild.Castle2.x - 0x0200);
};
break;
case 4:
Level.BackgroundImageChild.Lava1.x = (Level.BackgroundImageChild.Lava1.x + 5);
Level.BackgroundImageChild.Lava2.x = (Level.BackgroundImageChild.Lava2.x + 5);
if (Level.BackgroundImageChild.Lava1.x > 0x0100){
Level.BackgroundImageChild.Lava1.x = (Level.BackgroundImageChild.Lava1.x - 0x0200);
};
if (Level.BackgroundImageChild.Lava2.x > 0x0100){
Level.BackgroundImageChild.Lava2.x = (Level.BackgroundImageChild.Lava2.x - 0x0200);
};
break;
case 5:
Level.BackgroundImageChild.Sky1.x = (Level.BackgroundImageChild.Sky1.x + 5);
Level.BackgroundImageChild.Sky2.x = (Level.BackgroundImageChild.Sky2.x + 5);
if (Level.BackgroundImageChild.Sky1.x > 0x0100){
Level.BackgroundImageChild.Sky1.x = (Level.BackgroundImageChild.Sky1.x - 0x0200);
};
if (Level.BackgroundImageChild.Sky2.x > 0x0100){
Level.BackgroundImageChild.Sky2.x = (Level.BackgroundImageChild.Sky2.x - 0x0200);
};
break;
};
}
public function UpdateSkillScreen(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
Level.Skills.visible = true;
if (Level.Skills.alpha < 1){
Level.Skills.alpha = (Level.Skills.alpha + 0.05);
musicChannel.soundTransform = new SoundTransform((0.9 - (Level.Skills.alpha * 0.5)), 0);
};
_local1 = false;
_local2 = false;
_local3 = false;
if (((UnitInformation[0].SkillLeap + UnitInformation[0].SkillCharge) + UnitInformation[0].SkillCounter) == 9){
_local1 = true;
};
if (((UnitInformation[0].SkillFirepower + UnitInformation[0].SkillMelee) + UnitInformation[0].SkillArmor) == 9){
_local2 = true;
};
if (((UnitInformation[0].SkillDeflector + UnitInformation[0].SkillRegenerate) + UnitInformation[0].SkillTeleport) == 9){
_local3 = true;
};
_local4 = false;
_local5 = false;
if ((((Input.Melee == true)) || ((Input.Fire == true)))){
SoundClick.play();
Input.Melee = false;
Input.Fire = false;
if (!(((((((Engine.SelectedSkill == 3)) && ((_local1 == false)))) || ((((Engine.SelectedSkill == 7)) && ((_local2 == false)))))) || ((((Engine.SelectedSkill == 11)) && ((_local3 == false)))))){
_local5 = true;
_local4 = true;
};
} else {
if (Input.Up == true){
SoundClick.play();
Input.Up = false;
Engine.GoingUp = true;
Engine.SelectedSkill--;
if (Engine.SelectedSkill < 0){
Engine.SelectedSkill = 11;
};
};
if (Input.Down == true){
SoundClick.play();
Input.Down = false;
Engine.GoingUp = false;
Engine.SelectedSkill++;
if (Engine.SelectedSkill > 11){
Engine.SelectedSkill = 0;
};
};
};
i = 0;
while (i < 12) {
_local6 = 0;
switch (i){
case 0:
if (Engine.SelectedSkill == i){
if (_local5 == true){
_local5 = false;
UnitInformation[0].SkillLeap++;
};
Level.Skills.SkillInfo.text = "Leap: Increases the jump height. Level two or higher allows for roof grab.";
};
_local6 = UnitInformation[0].SkillLeap;
break;
case 1:
if (Engine.SelectedSkill == i){
if (_local5 == true){
_local5 = false;
UnitInformation[0].SkillCharge++;
};
Level.Skills.SkillInfo.text = "Speed: Increases the movement speed.";
};
_local6 = UnitInformation[0].SkillCharge;
break;
case 2:
if (Engine.SelectedSkill == i){
if (_local5 == true){
_local5 = false;
UnitInformation[0].SkillCounter++;
};
Level.Skills.SkillInfo.text = "Counter: Adds a random chance to counter a melee attack.";
};
_local6 = UnitInformation[0].SkillCounter;
break;
case 3:
if (Engine.SelectedSkill == i){
if (_local5 == true){
_local5 = false;
UnitInformation[0].SkillSense++;
};
Level.Skills.SkillInfo.text = "Reflex: Slows down time when close to death.";
};
_local6 = UnitInformation[0].SkillSense;
break;
case 4:
if (Engine.SelectedSkill == i){
if (_local5 == true){
_local5 = false;
UnitInformation[0].SkillFirepower++;
};
Level.Skills.SkillInfo.text = "Firepower: Increases firepower and rate.";
};
_local6 = UnitInformation[0].SkillFirepower;
break;
case 5:
if (Engine.SelectedSkill == i){
if (_local5 == true){
_local5 = false;
UnitInformation[0].SkillMelee++;
};
Level.Skills.SkillInfo.text = "Melee: Increases melee damage and speed.";
};
_local6 = UnitInformation[0].SkillMelee;
break;
case 6:
if (Engine.SelectedSkill == i){
if (_local5 == true){
_local5 = false;
UnitInformation[0].SkillArmor++;
};
Level.Skills.SkillInfo.text = "Armor: Decreases the amount of damage taken.";
};
_local6 = UnitInformation[0].SkillArmor;
break;
case 7:
if (Engine.SelectedSkill == i){
if (_local5 == true){
_local5 = false;
UnitInformation[0].SkillUnstoppable++;
};
Level.Skills.SkillInfo.text = "Unstoppable: Removes the knockback when hit.";
};
_local6 = UnitInformation[0].SkillUnstoppable;
break;
case 8:
if (Engine.SelectedSkill == i){
if (_local5 == true){
_local5 = false;
UnitInformation[0].SkillDeflector++;
};
Level.Skills.SkillInfo.text = "Shield: Adds a random chance to deflect a projectile when hit.";
};
_local6 = UnitInformation[0].SkillDeflector;
break;
case 9:
if (Engine.SelectedSkill == i){
if (_local5 == true){
_local5 = false;
UnitInformation[0].SkillRegenerate++;
};
Level.Skills.SkillInfo.text = "Regenerate: Slowly regenerates health over time.";
};
_local6 = UnitInformation[0].SkillRegenerate;
break;
case 10:
if (Engine.SelectedSkill == i){
if (_local5 == true){
_local5 = false;
UnitInformation[0].SkillTeleport++;
};
Level.Skills.SkillInfo.text = "Teleport: Adds the teleport ability. Press down plus melee to activate.";
};
_local6 = UnitInformation[0].SkillTeleport;
break;
case 11:
if (Engine.SelectedSkill == i){
if (_local5 == true){
_local5 = false;
UnitInformation[0].SkillShield++;
};
Level.Skills.SkillInfo.text = "Deflector: Deflects and stuns enemy when hit.";
};
_local6 = UnitInformation[0].SkillShield;
break;
};
if ((((((((((i + 1) % 4) == 0)) && ((_local6 == 1)))) || ((_local6 == 3)))) && ((Engine.SelectedSkill == i)))){
if (Engine.GoingUp == true){
Engine.SelectedSkill--;
} else {
Engine.SelectedSkill++;
};
if (Engine.SelectedSkill < 0){
Engine.SelectedSkill = 11;
} else {
if (Engine.SelectedSkill > 11){
Engine.SelectedSkill = 0;
};
};
};
_local7 = Math.floor((i / 4));
if (((i + 1) % 4) == 0){
if (_local6 > 0){
if (Engine.SelectedSkill == i){
Level.Skills[("Skill" + Number((i + 1)))].gotoAndStop(11);
} else {
Level.Skills[("Skill" + Number((i + 1)))].gotoAndStop((2 + (_local7 * 3)));
};
} else {
if (Engine.SelectedSkill == i){
Level.Skills[("Skill" + Number((i + 1)))].gotoAndStop(10);
} else {
if ((((((((_local1 == false)) && ((i == 3)))) || ((((_local2 == false)) && ((i == 7)))))) || ((((_local3 == false)) && ((i == 11)))))){
Level.Skills[("Skill" + Number((i + 1)))].gotoAndStop((3 + (_local7 * 3)));
} else {
Level.Skills[("Skill" + Number((i + 1)))].gotoAndStop((1 + (_local7 * 3)));
};
};
};
} else {
if (_local6 > 0){
if (Engine.SelectedSkill == i){
Level.Skills[(("Skill" + Number((i + 1))) + "a")].gotoAndStop(11);
} else {
Level.Skills[(("Skill" + Number((i + 1))) + "a")].gotoAndStop((2 + (_local7 * 3)));
};
} else {
if (Engine.SelectedSkill == i){
Level.Skills[(("Skill" + Number((i + 1))) + "a")].gotoAndStop(10);
} else {
Level.Skills[(("Skill" + Number((i + 1))) + "a")].gotoAndStop((1 + (_local7 * 3)));
};
};
if (_local6 > 1){
if (Engine.SelectedSkill == i){
Level.Skills[(("Skill" + Number((i + 1))) + "b")].gotoAndStop(11);
} else {
Level.Skills[(("Skill" + Number((i + 1))) + "b")].gotoAndStop((2 + (_local7 * 3)));
};
} else {
if (Engine.SelectedSkill == i){
Level.Skills[(("Skill" + Number((i + 1))) + "b")].gotoAndStop(10);
} else {
Level.Skills[(("Skill" + Number((i + 1))) + "b")].gotoAndStop((1 + (_local7 * 3)));
};
};
if (_local6 > 2){
if (Engine.SelectedSkill == i){
Level.Skills[(("Skill" + Number((i + 1))) + "c")].gotoAndStop(11);
} else {
Level.Skills[(("Skill" + Number((i + 1))) + "c")].gotoAndStop((2 + (_local7 * 3)));
};
} else {
if (Engine.SelectedSkill == i){
Level.Skills[(("Skill" + Number((i + 1))) + "c")].gotoAndStop(10);
} else {
Level.Skills[(("Skill" + Number((i + 1))) + "c")].gotoAndStop((1 + (_local7 * 3)));
};
};
};
i++;
};
if (_local4 == true){
Engine.GameStatus = 11;
};
}
public function UpdatePreLoader(_arg1:Event){
if (PlayerGoingLeft == false){
Player.x = (Player.x + 2);
if (Player.x > 496){
PlayerGoingLeft = true;
};
Player.scaleX = 2;
} else {
Player.x = (Player.x - 2);
if (Player.x < 12){
PlayerGoingLeft = false;
};
Player.scaleX = -2;
};
PlayerFrame = (PlayerFrame + 0.25);
if (PlayerFrame > 4){
PlayerFrame = 1;
};
Player.gotoAndStop(Math.floor(PlayerFrame));
ProgressText.text = (Math.floor(pcent) + "% LOADED");
if (pcent >= 100){
removeEventListener(Event.ENTER_FRAME, UpdatePreLoader);
gotoAndStop(3);
};
}
public function CreateParticle(_arg1:int, _arg2:Point, _arg3:Point){
var _local4:*;
var _local5:*;
_local4 = Particles.length;
Particles[_local4] = new Object();
switch (_arg1){
case 0:
Particles[_local4].Fading = 0.025;
Particles[_local4].TimeUntilDestruction = 20;
Particles[_local4].ParticleChild = Level.UnitHolderChild.addChild(new Particle());
_local5 = Math.floor((Math.random() * 2.9));
if (_local5 == 0){
Particles[_local4].ParticleChild.gotoAndStop(2);
} else {
if (_local5 == 1){
Particles[_local4].ParticleChild.gotoAndStop(4);
} else {
Particles[_local4].ParticleChild.gotoAndStop(5);
};
};
break;
case 1:
Particles[_local4].Fading = 0.1;
Particles[_local4].TimeUntilDestruction = 20;
Particles[_local4].ParticleChild = Level.UnitHolderChild.addChild(new Particle());
Particles[_local4].ParticleChild.gotoAndStop(7);
if (_arg3.x < 0){
Particles[_local4].ParticleChild.scaleX = -1;
};
break;
case 2:
Particles[_local4].Fading = 0.1;
Particles[_local4].TimeUntilDestruction = 20;
Particles[_local4].ParticleChild = Level.UnitHolderChild.addChild(new Particle());
Particles[_local4].ParticleChild.gotoAndStop(8);
if (_arg3.x < 0){
Particles[_local4].ParticleChild.gotoAndStop(30);
};
break;
case 3:
Particles[_local4].Fading = 0.1;
Particles[_local4].TimeUntilDestruction = 20;
Particles[_local4].ParticleChild = Level.UnitHolderChild.addChild(new Particle());
Particles[_local4].ParticleChild.gotoAndStop(9);
if (_arg3.x < 0){
Particles[_local4].ParticleChild.gotoAndStop(31);
};
break;
case 4:
Particles[_local4].Fading = 0.01;
Particles[_local4].TimeUntilDestruction = 100;
Particles[_local4].ParticleChild = Level.UnitHolderChild.addChild(new Particle());
Particles[_local4].ParticleChild.gotoAndStop(3);
break;
case 5:
Particles[_local4].Fading = 0.05;
Particles[_local4].TimeUntilDestruction = 20;
Particles[_local4].ParticleChild = Level.UnitHolderChild.addChild(new Particle());
Particles[_local4].ParticleChild.gotoAndStop(6);
break;
case 6:
Particles[_local4].Fading = 0.02;
Particles[_local4].TimeUntilDestruction = 150;
Particles[_local4].ParticleChild = Level.UnitHolderChild.addChild(new Particle());
Particles[_local4].ParticleChild.gotoAndStop(10);
Particles[_local4].alpha = 1.5;
break;
case 7:
Particles[_local4].Fading = 0.05;
Particles[_local4].TimeUntilDestruction = 20;
Particles[_local4].ParticleChild = Level.UnitHolderChild.addChild(new Particle());
Particles[_local4].ParticleChild.gotoAndPlay(11);
break;
case 8:
Particles[_local4].Fading = 0;
Particles[_local4].TimeUntilDestruction = 20;
Particles[_local4].ParticleChild = Level.UnitHolderChild.addChild(new Particle());
Particles[_local4].ParticleChild.gotoAndPlay(18);
break;
case 9:
Particles[_local4].Fading = 0.1;
Particles[_local4].TimeUntilDestruction = 10;
Particles[_local4].ParticleChild = Level.UnitHolderChild.addChild(new Particle());
Particles[_local4].ParticleChild.gotoAndPlay(27);
if (_arg3.x < 0){
Particles[_local4].ParticleChild.scaleX = -1;
};
break;
case 10:
Particles[_local4].Fading = 0.05;
Particles[_local4].TimeUntilDestruction = 20;
Particles[_local4].ParticleChild = Level.UnitHolderChild.addChild(new Particle());
Particles[_local4].ParticleChild.gotoAndPlay(27);
if (_arg3.x < 0){
Particles[_local4].ParticleChild.scaleX = -1;
};
break;
case 11:
Particles[_local4].Fading = 0.05;
Particles[_local4].TimeUntilDestruction = 20;
Particles[_local4].ParticleChild = Level.UnitHolderChild.addChild(new Particle());
Particles[_local4].ParticleChild.gotoAndStop(1);
break;
case 12:
Particles[_local4].Fading = 0.1;
Particles[_local4].TimeUntilDestruction = 10;
Particles[_local4].ParticleChild = Level.UnitHolderChild.addChild(new Particle());
Particles[_local4].ParticleChild.gotoAndPlay(32);
break;
};
Particles[_local4].Position = new Point(_arg2.x, _arg2.y);
Particles[_local4].Velocity = new Point(_arg3.x, _arg3.y);
Particles[_local4].ParticleChild.scaleX = (Particles[_local4].ParticleChild.scaleX * 2);
Particles[_local4].ParticleChild.scaleY = (Particles[_local4].ParticleChild.scaleY * 2);
Particles[_local4].ParticleChild.x = (Math.round((_arg2.x / 2)) * 2);
Particles[_local4].ParticleChild.y = (Math.round((_arg2.y / 2)) * 2);
}
public function CreateLevel(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
Level.LastSpawnLocation = new Point(Math.floor((Math.random() * 15.9)), Math.floor((Math.random() * 11.9)));
Engine.PlayerAlive = true;
Engine.ContinuePossible = false;
Engine.PlayerPosition = new Point(10000, 10000);
Level.SignPosition = -200;
Level.SignVelocity = 0;
Level.LevelCompleted = false;
Level.Victory.visible = false;
Level.Victory.alpha = 0;
Level.Victory.tag = 10;
Engine.SkipSkill = false;
Level.BackgroundChild.alpha = 1;
Level.BackgroundImageChild.alpha = 1;
Level.ForegroundChild.alpha = 1;
Level.BackgroundBD.colorTransform(new Rectangle(0, 0, 0x0200, 384), new ColorTransform(1, 1, 1, 0, 0, 0, 0));
Level.ForegroundBD.colorTransform(new Rectangle(0, 0, 0x0200, 384), new ColorTransform(1, 1, 1, 0, 0, 0, 0));
_local1 = 0;
while (_local1 < 16) {
Level.BlockCollisionTypes[_local1] = new Array();
_local7 = 0;
while (_local7 < 12) {
Level.BlockCollisionTypes[_local1][_local7] = -1;
_local7++;
};
_local1++;
};
_local2 = -1;
_local3 = new Array();
switch (Engine.CurrentLevel){
case -1:
Engine.MaxEnemyCount = 0;
Engine.ReinforcementLeft = 0;
Level.CurrentTheme = 1;
_local2 = 6;
_local3[0] = " ";
_local3[1] = " ";
_local3[2] = " ";
_local3[3] = " ";
_local3[4] = " ";
_local3[5] = " ";
_local3[6] = " y ";
_local3[7] = " ";
_local3[8] = " ";
_local3[9] = " ";
_local3[10] = "################";
_local3[11] = "¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤";
break;
case 0:
Engine.MaxEnemyCount = 0;
Engine.ReinforcementLeft = 0;
Level.CurrentTheme = 0;
Level.Training.visible = true;
Level.Training.gotoAndStop(19);
_local3[0] = "¤--------------¤";
_local3[1] = "¤ w ¤";
_local3[2] = "¤ ### ¤";
_local3[3] = "¤ ¤¤¤¤¤+¤¤¤";
_local3[4] = "¤ w ¤¤¤";
_local3[5] = "¤== w ¤+¤";
_local3[6] = "¤ # ¤¤¤¤¤¤";
_local3[7] = "¤==== ¤";
_local3[8] = "¤ ¤";
_local3[9] = "¤ ## # ¤";
_local3[10] = "¤ #### # a ¤";
_local3[11] = "¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤";
break;
case 1:
Engine.MaxEnemyCount = 1;
Engine.ReinforcementLeft = 0;
Level.CurrentTheme = 1;
_local3[0] = " ";
_local3[1] = " ";
_local3[2] = " ";
_local3[3] = " - ";
_local3[4] = " -= ";
_local3[5] = " f - ";
_local3[6] = " ===- ";
_local3[7] = " - ";
_local3[8] = " - -== ";
_local3[9] = " =- - ";
_local3[10] = " a - - ";
_local3[11] = "################";
break;
case 2:
Engine.MaxEnemyCount = 1;
Engine.ReinforcementLeft = 0;
Level.CurrentTheme = 1;
_local3[0] = "- -";
_local3[1] = "- a =====-";
_local3[2] = "-=== -";
_local3[3] = "- ====-";
_local3[4] = "-===== -";
_local3[5] = "- -";
_local3[6] = "-==============-";
_local3[7] = "- -";
_local3[8] = "-=== -";
_local3[9] = "- ====-";
_local3[10] = "-++ +++ b +++-";
_local3[11] = "################";
break;
case 3:
Engine.MaxEnemyCount = 1;
Engine.ReinforcementLeft = 0;
Level.CurrentTheme = 1;
_local3[0] = " - ¤¤";
_local3[1] = " - b ¤¤";
_local3[2] = " -==== ¤¤";
_local3[3] = " - ¤¤";
_local3[4] = " - i ¤¤";
_local3[5] = " ==- ####¤¤";
_local3[6] = " - ¤¤¤¤¤¤";
_local3[7] = " - ¤¤¤¤¤¤";
_local3[8] = " -== ¤¤¤¤¤¤";
_local3[9] = " - ¤¤¤¤¤¤";
_local3[10] = " a - ¤¤¤¤¤¤";
_local3[11] = "##########¤¤¤¤¤¤";
break;
case 4:
Engine.MaxEnemyCount = 2;
Engine.ReinforcementLeft = 1;
Level.CurrentTheme = 1;
_local3[0] = " - - ";
_local3[1] = " - ==- ";
_local3[2] = " - - ";
_local3[3] = " - f - ";
_local3[4] = "#######==#######";
_local3[5] = "¤¤¤¤¤¤¤ +¤¤¤¤¤";
_local3[6] = " a ¤¤/= ¤¤¤¤¤¤";
_local3[7] = "###+¤¤+ ¤¤¤¤¤¤";
_local3[8] = "¤¤¤+¤¤¤ ++++¤¤";
_local3[9] = "¤¤+++++ ==/¤¤++¤";
_local3[10] = "¤¤ ++¤¤ f ++++¤¤";
_local3[11] = "¤¤###¤¤###¤¤¤¤¤¤";
break;
case 5:
Engine.MaxEnemyCount = 1;
Engine.ReinforcementLeft = 1;
Level.CurrentTheme = 1;
_local3[0] = "- ";
_local3[1] = "-======= ";
_local3[2] = "- - ";
_local3[3] = "- c -=== ";
_local3[4] = "-=========- -";
_local3[5] = "- - -";
_local3[6] = "- -====-";
_local3[7] = "- - - -";
_local3[8] = "-====- ==- -";
_local3[9] = "- - - -";
_local3[10] = "- a -====- -";
_local3[11] = "-====- -====-";
break;
case 6:
Engine.MaxEnemyCount = 1;
Engine.ReinforcementLeft = 1;
Level.CurrentTheme = 1;
_local3[0] = " - ";
_local3[1] = " -== ";
_local3[2] = " - a ";
_local3[3] = " -############";
_local3[4] = " -=¤¤¤¤¤¤¤¤¤¤¤";
_local3[5] = "===- ¤¤¤¤¤¤¤¤";
_local3[6] = " -=====//¤¤¤¤¤";
_local3[7] = " - +¤¤¤";
_local3[8] = " ==-=====- ++¤¤";
_local3[9] = " - -====¤¤";
_local3[10] = " - c - +¤¤";
_local3[11] = "##############¤¤";
break;
case 7:
Engine.MaxEnemyCount = 1;
Engine.ReinforcementLeft = 1;
Level.CurrentTheme = 1;
_local3[0] = "¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤";
_local3[1] = "¤¤¤+++ ¤¤¤¤¤+ ¤¤";
_local3[2] = "¤¤++++++¤¤¤++++¤";
_local3[3] = "¤¤++ ++ ++ ++¤";
_local3[4] = "¤¤ +++++ ++++a+¤";
_local3[5] = "¤¤#///#########¤";
_local3[6] = "¤¤¤+++¤¤¤¤¤¤¤¤¤¤";
_local3[7] = "¤¤ ¤¤";
_local3[8] = "¤==== ¤";
_local3[9] = "¤ =====¤";
_local3[10] = "¤ g ¤";
_local3[11] = "¤##############¤";
break;
case 8:
Engine.MaxEnemyCount = 2;
Engine.ReinforcementLeft = 1;
Level.CurrentTheme = 1;
_local3[0] = " - ";
_local3[1] = " ====- ";
_local3[2] = " - ";
_local3[3] = " b -= - f ";
_local3[4] = " ====- -===";
_local3[5] = " - - ";
_local3[6] = " - ===- ";
_local3[7] = " -== - +* ";
_local3[8] = " - a *+ ###===";
_local3[9] = " - #### ++¤¤¤+++";
_local3[10] = " *+¤¤¤¤###¤¤¤###";
_local3[11] = "###¤¤¤¤¤¤¤¤¤¤¤¤¤";
break;
case 9:
Engine.MaxEnemyCount = 1;
Engine.ReinforcementLeft = 2;
Level.CurrentTheme = 1;
_local3[0] = "¤¤¤+ a +¤¤¤";
_local3[1] = "¤¤¤/==== ==/¤¤¤";
_local3[2] = "¤¤¤# ¤¤¤";
_local3[3] = "¤¤¤¤ =====¤¤";
_local3[4] = "¤¤¤====== ¤¤";
_local3[5] = "¤¤+ c +¤";
_local3[6] = "¤¤/=== ======/¤";
_local3[7] = "¤¤#+ +#¤";
_local3[8] = "¤¤¤#====== #¤¤";
_local3[9] = "¤¤¤¤ ===¤¤¤";
_local3[10] = "¤¤¤/==== ¤¤¤";
_local3[11] = "¤¤¤+ ===/¤¤";
break;
case 10:
Engine.MaxEnemyCount = 2;
Engine.ReinforcementLeft = 999;
Level.CurrentTheme = 1;
_local2 = 5;
_local3[0] = "- -++++++++++- -";
_local3[1] = "- - m ++++ m - -";
_local3[2] = "-=*====o ====*=-";
_local3[3] = "- - - -";
_local3[4] = "* -== ==- *";
_local3[5] = "*+* *+*";
_local3[6] = "### ###";
_local3[7] = "¤¤¤ +¤¤¤";
_local3[8] = "¤¤¤=== ==/¤¤¤";
_local3[9] = "¤¤¤+ +¤¤¤";
_local3[10] = "¤¤¤++ a ++¤¤¤";
_local3[11] = "¤¤¤####++####¤¤¤";
break;
case 11:
Engine.MaxEnemyCount = 3;
Engine.ReinforcementLeft = 0;
Level.CurrentTheme = 2;
_local3[0] = "¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤";
_local3[1] = "¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤";
_local3[2] = "¤¤¤¤¤+ +¤¤¤¤¤";
_local3[3] = "¤¤+ + + ¤¤";
_local3[4] = " + + d+ + ";
_local3[5] = " + + #### + ";
_local3[6] = " +### + + ";
_local3[7] = " a+ + + + ";
_local3[8] = "##+ + + d##";
_local3[9] = "¤¤+ + g +###¤¤";
_local3[10] = "¤¤#########¤¤¤¤¤";
_local3[11] = "¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤";
break;
case 12:
Engine.MaxEnemyCount = 2;
Engine.ReinforcementLeft = 1;
Level.CurrentTheme = 2;
_local3[0] = " ";
_local3[1] = " ";
_local3[2] = " a + +";
_local3[3] = "##=/==========##";
_local3[4] = "¤¤ + ¤¤";
_local3[5] = "¤¤ + d ¤¤";
_local3[6] = "¤¤## + ##¤¤";
_local3[7] = "¤¤¤¤ d+ ¤¤¤¤";
_local3[8] = "¤¤¤¤##=/==##¤¤¤¤";
_local3[9] = "¤¤¤¤¤¤ + ¤¤¤¤¤¤";
_local3[10] = "¤¤¤¤¤¤ + ¤¤¤¤¤¤";
_local3[11] = "¤¤¤¤¤¤####¤¤¤¤¤¤";
break;
case 13:
Engine.MaxEnemyCount = 2;
Engine.ReinforcementLeft = 1;
Level.CurrentTheme = 2;
_local3[0] = "¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤";
_local3[1] = "¤¤ + ¤¤¤¤";
_local3[2] = "¤ j + ¤¤";
_local3[3] = "¤ #####=/ + ";
_local3[4] = "¤ + + #####";
_local3[5] = "¤# + ###¤¤¤¤¤";
_local3[6] = "¤¤## + ¤¤¤¤";
_local3[7] = "¤¤¤¤##j + ¤¤¤";
_local3[8] = "¤¤¤¤¤¤#####===¤¤";
_local3[9] = " a ¤¤ + ¤¤";
_local3[10] = "## + ####¤¤";
_local3[11] = "¤¤########¤¤¤¤¤¤";
break;
case 14:
Engine.MaxEnemyCount = 3;
Engine.ReinforcementLeft = 2;
Level.CurrentTheme = 2;
_local3[0] = "¤¤ a - ¤";
_local3[1] = "¤¤==== -=#¤";
_local3[2] = "¤+ -#¤¤";
_local3[3] = "¤# ====¤¤¤¤";
_local3[4] = "¤¤ ¤¤¤¤";
_local3[5] = "¤+ c ¤¤¤";
_local3[6] = "¤/============¤¤";
_local3[7] = "¤# #¤¤";
_local3[8] = "¤¤#==== ¤¤¤";
_local3[9] = "¤¤¤## b - ¤";
_local3[10] = "¤¤¤¤¤#### d- ";
_local3[11] = "¤¤¤¤¤¤¤¤¤####¤##";
break;
case 15:
Engine.MaxEnemyCount = 1;
Engine.ReinforcementLeft = 3;
Level.CurrentTheme = 2;
_local3[0] = " a ";
_local3[1] = "===== ";
_local3[2] = " ";
_local3[3] = "======== + =====";
_local3[4] = " c + ";
_local3[5] = "=========/======";
_local3[6] = " + c";
_local3[7] = " + ==/===/==";
_local3[8] = " + + + ";
_local3[9] = "==/===== + + ";
_local3[10] = " + ====/===/==";
_local3[11] = "==/=== /===/==";
break;
case 16:
Engine.MaxEnemyCount = 2;
Engine.ReinforcementLeft = 3;
Level.CurrentTheme = 2;
_local3[0] = " - - ";
_local3[1] = " - - ";
_local3[2] = " - j - ";
_local3[3] = " .==========. ";
_local3[4] = " - - ";
_local3[5] = " - j - ";
_local3[6] = " .======/===. ";
_local3[7] = " -+ + - ";
_local3[8] = " a#+ + # +";
_local3[9] = " #¤# ## #¤#+";
_local3[10] = "#¤¤¤# #¤¤##¤¤¤#";
_local3[11] = "¤¤¤¤¤##¤¤¤¤¤¤¤¤¤";
break;
case 17:
Engine.MaxEnemyCount = 3;
Engine.ReinforcementLeft = 2;
Level.CurrentTheme = 2;
_local3[0] = " a ";
_local3[1] = " ## ";
_local3[2] = " g #¤¤# ";
_local3[3] = " .=##======¤¤=. ";
_local3[4] = " -#¤¤# - - ";
_local3[5] = " - ¤¤ - - ";
_local3[6] = " - - ¤#- ";
_local3[7] = " - - d e #¤¤¤ ";
_local3[8] = " -#¤========¤¤ ";
_local3[9] = " ¤¤¤# - ";
_local3[10] = " ¤¤ - ";
_local3[11] = " - - ";
break;
case 18:
Engine.MaxEnemyCount = 4;
Engine.ReinforcementLeft = 0;
Level.CurrentTheme = 2;
_local3[0] = " ";
_local3[1] = " d ";
_local3[2] = " a .==. ";
_local3[3] = " .==. - - ";
_local3[4] = " - - .==. ";
_local3[5] = " .==. .===. - ";
_local3[6] = " - - b- - +- ";
_local3[7] = " -+ .==. .=/. ";
_local3[8] = " -+ - j- + - j- ";
_local3[9] = "################";
_local3[10] = "¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤";
_local3[11] = "¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤";
break;
case 19:
Engine.MaxEnemyCount = 3;
Engine.ReinforcementLeft = 2;
Level.CurrentTheme = 2;
_local3[0] = " ";
_local3[1] = " + ";
_local3[2] = " + + + ";
_local3[3] = " + a+ + + ";
_local3[4] = "######====######";
_local3[5] = "¤¤¤¤¤¤ ¤¤¤¤¤¤";
_local3[6] = "¤¤¤¤=.== - ¤¤¤¤";
_local3[7] = "¤¤ j - =.===¤¤";
_local3[8] = "¤====.= - ¤";
_local3[9] = "¤ - - ===¤";
_local3[10] = "¤== - - j ¤";
_local3[11] = "¤##############¤";
break;
case 20:
Engine.MaxEnemyCount = 0;
Engine.ReinforcementLeft = 0;
Level.CurrentTheme = 2;
_local2 = 5;
_local3[0] = " ";
_local3[1] = " ";
_local3[2] = " - - ";
_local3[3] = " - - ";
_local3[4] = " =.=== ===.= ";
_local3[5] = " - p - ";
_local3[6] = " - - ";
_local3[7] = " =.== ==.= ";
_local3[8] = " - - ";
_local3[9] = " - a - ";
_local3[10] = " =.=== ===.= ";
_local3[11] = " - - ";
break;
case 21:
Engine.MaxEnemyCount = 2;
Engine.ReinforcementLeft = 2;
Level.CurrentTheme = 3;
_local3[0] = "################";
_local3[1] = "#++++++++++++++#";
_local3[2] = "#+++-++++++-+++#";
_local3[3] = "#++++++++++++++#";
_local3[4] = "#+++++++h++++++#";
_local3[5] = "##¤++######++¤##";
_local3[6] = "#+++-++++++-+++#";
_local3[7] = "#+++++++g++++++#";
_local3[8] = "##¤##++##++##¤##";
_local3[9] = "#++++++##++++++#";
_local3[10] = "+a++-++##++-++++";
_local3[11] = "################";
break;
case 22:
Engine.MaxEnemyCount = 2;
Engine.ReinforcementLeft = 3;
Level.CurrentTheme = 3;
_local3[0] = "################";
_local3[1] = "#++++++++++++++#";
_local3[2] = "#+++-++h+++-+++#";
_local3[3] = "##¤//////////¤##";
_local3[4] = "#++++++++++++++#";
_local3[5] = "#+f+-++++++-+f+#";
_local3[6] = "##¤##//++//##¤##";
_local3[7] = "#++++++++++++++#";
_local3[8] = "#+++-++++++-+++#";
_local3[9] = "#++++######+g++#";
_local3[10] = "+a+##########+++";
_local3[11] = "################";
break;
case 23:
Engine.MaxEnemyCount = 2;
Engine.ReinforcementLeft = 3;
Level.CurrentTheme = 3;
_local3[0] = "################";
_local3[1] = "#++++++++++++++#";
_local3[2] = "#+++-++++++-+++#";
_local3[3] = "##¤++++##++++¤##";
_local3[4] = "#++++++++++++++#";
_local3[5] = "#+++-+++h++-+++#";
_local3[6] = "##¤////##////¤##";
_local3[7] = "#++++++++++++++#";
_local3[8] = "#+++-++++++-+e+#";
_local3[9] = "##¤////##////¤##";
_local3[10] = "+a++++++++++++++";
_local3[11] = "################";
break;
case 24:
Engine.MaxEnemyCount = 3;
Engine.ReinforcementLeft = 6;
Level.CurrentTheme = 3;
_local3[0] = " h ";
_local3[1] = " ## ## ";
_local3[2] = "### ###";
_local3[3] = "#*#= =#*#";
_local3[4] = "### h ###";
_local3[5] = "++#== ==#++";
_local3[6] = "-+# #+-";
_local3[7] = "+a+ j+++";
_local3[8] = "#####=====######";
_local3[9] = "#*## ###*#";
_local3[10] = "#### #####";
_local3[11] = "#### #####";
break;
case 25:
Engine.MaxEnemyCount = 4;
Engine.ReinforcementLeft = 5;
Level.CurrentTheme = 3;
_local3[0] = " c c ";
_local3[1] = " ##========## ";
_local3[2] = " ++ ++ ";
_local3[3] = " ++ e++ ";
_local3[4] = " ##===##===## ";
_local3[5] = " ++ ++ ++ ";
_local3[6] = " ++g+++++++++ ";
_local3[7] = "####///##///####";
_local3[8] = "##¤#+++##+++#¤##";
_local3[9] = "####+-++a+-+####";
_local3[10] = "#######//#######";
_local3[11] = "#######++#######";
break;
case 26:
Engine.MaxEnemyCount = 4;
Engine.ReinforcementLeft = 5;
Level.CurrentTheme = 3;
_local3[0] = "# #";
_local3[1] = "# #";
_local3[2] = "## g e ##";
_local3[3] = "#¤#==========#¤#";
_local3[4] = "#++ ++#";
_local3[5] = "+-+ e g +-+";
_local3[6] = "#####======#####";
_local3[7] = "#¤#++ ++#¤#";
_local3[8] = "+a+-+ +-+++";
_local3[9] = "#####======#####";
_local3[10] = "##### #####";
_local3[11] = "##### #####";
break;
case 27:
Engine.MaxEnemyCount = 5;
Engine.ReinforcementLeft = 2;
Level.CurrentTheme = 3;
_local3[0] = "################";
_local3[1] = "#++++++++#+++++#";
_local3[2] = "#++-+-++++-+-++#";
_local3[3] = "#++j++++i++++j++";
_local3[4] = "##¤#///#¤#/////#";
_local3[5] = "#++-+-+++#+++++#";
_local3[6] = "#++++++++#//+++#";
_local3[7] = "####///###+++++#";
_local3[8] = "+a+++++++#//+++#";
_local3[9] = "####//++++-+-++#";
_local3[10] = "##¤#+++++++++h+#";
_local3[11] = "################";
break;
case 28:
Engine.MaxEnemyCount = 3;
Engine.ReinforcementLeft = 3;
Level.CurrentTheme = 3;
_local3[0] = "################";
_local3[1] = "+a++++++++++++f+";
_local3[2] = "###++-++++-++###";
_local3[3] = "#####++++++#####";
_local3[4] = "######++++######";
_local3[5] = "#####¤#++#¤#####";
_local3[6] = "#######//#######";
_local3[7] = "###+++-++-+++###";
_local3[8] = "##++++++g+++++##";
_local3[9] = "#+++++#//#+++++#";
_local3[10] = "#+-+d+#++#++f-+#";
_local3[11] = "#/#/#/#//#/#/#/#";
break;
case 29:
Engine.MaxEnemyCount = 5;
Engine.ReinforcementLeft = 4;
Level.CurrentTheme = 3;
_local3[0] = "################";
_local3[1] = "+a++-++++++-+++#";
_local3[2] = "######+++++++++#";
_local3[3] = "#++#¤#++++++f++#";
_local3[4] = "#//######//////#";
_local3[5] = "#+++++++#++++++#";
_local3[6] = "#+++-+e+#++-+g+#";
_local3[7] = "#//######//////#";
_local3[8] = "#+++++++#+++++++";
_local3[9] = "##++++++#+++++##";
_local3[10] = "#¤#+-+++f++-+#¤#";
_local3[11] = "################";
break;
case 30:
Engine.MaxEnemyCount = 3;
Engine.ReinforcementLeft = 4;
Level.CurrentTheme = 3;
_local2 = 5;
_local3[0] = " # # ## ";
_local3[1] = " n + + k+++ n ";
_local3[2] = " ++++=== + + ";
_local3[3] = " ++++ ++ ++++ ";
_local3[4] = " ++ ++++++ ++++#";
_local3[5] = " ++++++ +++++ +#";
_local3[6] = "#+ ++++++ +++#";
_local3[7] = "#++++++++++++++#";
_local3[8] = "¤+++++++ +++++#";
_local3[9] = "+++-++++++++-++¤";
_local3[10] = "+++++++a+++++++#";
_local3[11] = "################";
break;
case 31:
Engine.MaxEnemyCount = 3;
Engine.ReinforcementLeft = 0;
Level.CurrentTheme = 4;
_local3[0] = "+*++++++++++++*+";
_local3[1] = "+*++++ q ++++*+";
_local3[2] = "+* icf jlg *+";
_local3[3] = " - elh cel - ";
_local3[4] = " - bm nl - ";
_local3[5] = " - - ";
_local3[6] = " - - ";
_local3[7] = " - - ";
_local3[8] = " - - ";
_local3[9] = " - a - ";
_local3[10] = "=¤============¤=";
_local3[11] = " # # ";
break;
};
if (_local2 > -1){
Level.BackgroundImageChild.gotoAndStop(_local2);
} else {
Level.BackgroundImageChild.gotoAndStop((Level.CurrentTheme + 1));
};
Level.LevelStringsSplitted = new Array();
_local4 = 0;
while (_local4 < _local3.length) {
Level.LevelStringsSplitted[_local4] = _local3[_local4].split("");
_local4++;
};
_local5 = -1;
_local6 = new BlockTiles();
_local7 = 0;
while (_local7 < Level.LevelStringsSplitted.length) {
_local1 = 0;
while (_local1 < Level.LevelStringsSplitted[_local7].length) {
_local8 = false;
if ((((Level.LevelStringsSplitted[_local7][_local1].charCodeAt(0) > 96)) && ((Level.LevelStringsSplitted[_local7][_local1].charCodeAt(0) < 122)))){
_local10 = (Level.LevelStringsSplitted[_local7][_local1].charCodeAt(0) - 97);
if (_local10 == 0){
CreateUnit(_local10, true, new Point(((_local1 * 32) + ((32 - UnitInformation[_local10].Size.x) / 2)), (((_local7 + 1) * 32) - (UnitInformation[_local10].Size.y * 2))), new Point(0, 0));
} else {
if (!(((Engine.CurrentLevel == 31)) && ((Units.length == 1)))){
CreateUnit(_local10, false, new Point(((_local1 * 32) + ((32 - UnitInformation[_local10].Size.x) / 2)), (((_local7 + 1) * 32) - (UnitInformation[_local10].Size.y * 2))), new Point(0, 0));
};
};
_local8 = true;
};
_local9 = new Matrix(2, 0, 0, 2, (_local1 * 32), (_local7 * 32));
if (Level.LevelStringsSplitted[_local7][_local1] == "#"){
_local5 = -1;
Level.BlockCollisionTypes[_local1][_local7] = 0;
_local6.gotoAndStop((1 + (Level.CurrentTheme * 5)));
Level.BackgroundBD.draw(_local6, _local9, null, null, null, false);
} else {
if (Level.LevelStringsSplitted[_local7][_local1] == "¤"){
_local5 = -1;
Level.BlockCollisionTypes[_local1][_local7] = 0;
_local6.gotoAndStop(((1 + (Level.CurrentTheme * 5)) + 1));
Level.BackgroundBD.draw(_local6, _local9, null, null, null, false);
} else {
if ((((Level.LevelStringsSplitted[_local7][_local1] == "+")) || ((((_local5 == 1)) && ((_local8 == true)))))){
_local5 = 1;
_local6.gotoAndStop(((1 + (Level.CurrentTheme * 5)) + 2));
if (Level.CurrentTheme == 3){
Level.BackgroundBD.draw(_local6, _local9, null, null, null, false);
} else {
Level.ForegroundBD.draw(_local6, _local9, null, null, null, false);
};
} else {
if ((((Level.LevelStringsSplitted[_local7][_local1] == "-")) || ((((_local5 == 2)) && ((_local8 == true)))))){
_local5 = 2;
_local6.gotoAndStop(((1 + (Level.CurrentTheme * 5)) + 3));
Level.BackgroundBD.draw(_local6, _local9, null, null, null, false);
} else {
if (Level.LevelStringsSplitted[_local7][_local1] == "="){
_local5 = -1;
Level.BlockCollisionTypes[_local1][_local7] = 1;
_local6.gotoAndStop(((1 + (Level.CurrentTheme * 5)) + 4));
Level.BackgroundBD.draw(_local6, _local9, null, null, null, false);
} else {
if ((((Level.LevelStringsSplitted[_local7][_local1] == "*")) || ((((_local5 == 3)) && ((_local8 == true)))))){
_local5 = 3;
_local6.gotoAndStop(((1 + (Level.CurrentTheme * 5)) + 2));
if (Level.CurrentTheme == 3){
Level.BackgroundBD.draw(_local6, _local9, null, null, null, false);
} else {
Level.ForegroundBD.draw(_local6, _local9, null, null, null, false);
};
_local6.gotoAndStop(((1 + (Level.CurrentTheme * 5)) + 3));
Level.BackgroundBD.draw(_local6, _local9, null, null, null, false);
} else {
if ((((Level.LevelStringsSplitted[_local7][_local1] == "/")) || ((((_local5 == 4)) && ((_local8 == true)))))){
_local5 = 4;
_local6.gotoAndStop(((1 + (Level.CurrentTheme * 5)) + 2));
if (Level.CurrentTheme == 3){
Level.BackgroundBD.draw(_local6, _local9, null, null, null, false);
} else {
Level.ForegroundBD.draw(_local6, _local9, null, null, null, false);
};
Level.BlockCollisionTypes[_local1][_local7] = 1;
_local6.gotoAndStop(((1 + (Level.CurrentTheme * 5)) + 4));
Level.BackgroundBD.draw(_local6, _local9, null, null, null, false);
} else {
if ((((Level.LevelStringsSplitted[_local7][_local1] == ".")) || ((((_local5 == 5)) && ((_local8 == true)))))){
_local5 = 5;
_local6.gotoAndStop(((1 + (Level.CurrentTheme * 5)) + 3));
Level.BackgroundBD.draw(_local6, _local9, null, null, null, false);
Level.BlockCollisionTypes[_local1][_local7] = 1;
_local6.gotoAndStop(((1 + (Level.CurrentTheme * 5)) + 4));
Level.BackgroundBD.draw(_local6, _local9, null, null, null, false);
} else {
_local5 = -1;
};
};
};
};
};
};
};
};
_local1++;
};
_local7++;
};
}
public function DestroyLevel(){
while (Units.length > 0) {
DestroyUnit(0);
};
}
public function PL_LOADING(_arg1:ProgressEvent):void{
pcent = ((_arg1.bytesLoaded / _arg1.bytesTotal) * 100);
}
public function UpdateParticles(){
var _local1:*;
_local1 = 0;
while (_local1 < Particles.length) {
Particles[_local1].Position.x = (Particles[_local1].Position.x + Particles[_local1].Velocity.x);
Particles[_local1].Position.y = (Particles[_local1].Position.y + Particles[_local1].Velocity.y);
Particles[_local1].ParticleChild.x = (Math.round((Particles[_local1].Position.x / 2)) * 2);
Particles[_local1].ParticleChild.y = (Math.round((Particles[_local1].Position.y / 2)) * 2);
Particles[_local1].ParticleChild.alpha = (Particles[_local1].ParticleChild.alpha - Particles[_local1].Fading);
Particles[_local1].TimeUntilDestruction--;
if (Particles[_local1].TimeUntilDestruction <= 0){
DestroyParticle(_local1);
_local1--;
};
_local1++;
};
}
}
}//package GauntletOfArgos_fla
Section 2
//Music_2 (GauntletOfArgos_fla.Music_2)
package GauntletOfArgos_fla {
import flash.display.*;
public dynamic class Music_2 extends MovieClip {
public function Music_2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package GauntletOfArgos_fla
Section 3
//Background (Background)
package {
import flash.display.*;
public dynamic class Background extends MovieClip {
public var Castle2:MovieClip;
public var Castle1:MovieClip;
public var Lava2:MovieClip;
public var Lava1:MovieClip;
public var Forest:MovieClip;
public var Sky1:MovieClip;
public var Sky2:MovieClip;
}
}//package
Section 4
//BlockTiles (BlockTiles)
package {
import flash.display.*;
public dynamic class BlockTiles extends MovieClip {
}
}//package
Section 5
//Boss (Boss)
package {
import flash.media.*;
public dynamic class Boss extends Sound {
}
}//package
Section 6
//BulletHit (BulletHit)
package {
import flash.media.*;
public dynamic class BulletHit extends Sound {
}
}//package
Section 7
//Castle (Castle)
package {
import flash.media.*;
public dynamic class Castle extends Sound {
}
}//package
Section 8
//Cave (Cave)
package {
import flash.media.*;
public dynamic class Cave extends Sound {
}
}//package
Section 9
//Click (Click)
package {
import flash.media.*;
public dynamic class Click extends Sound {
}
}//package
Section 10
//Credits (Credits)
package {
import flash.display.*;
public dynamic class Credits extends MovieClip {
public var c:UnitGeek;
public var f:UnitMutant;
public var i:UnitBlinker;
public var j:UnitMauler;
public var k:UnitHamster;
public var m:UnitLizard;
public var p:UnitQueen;
public var q:UnitGargoyle;
public var n:UnitAnt;
public var g:UnitLurker;
public var h:UnitDefender;
public var l:UnitFighter;
public var d:UnitScout;
public var a:UnitPlayer;
public var b:UnitTez;
public var o:UnitArmor;
public var r:UnitZapper;
public var e:UnitNinja;
}
}//package
Section 11
//Fire (Fire)
package {
import flash.media.*;
public dynamic class Fire extends Sound {
}
}//package
Section 12
//Forest (Forest)
package {
import flash.media.*;
public dynamic class Forest extends Sound {
}
}//package
Section 13
//LastBoss (LastBoss)
package {
import flash.media.*;
public dynamic class LastBoss extends Sound {
}
}//package
Section 14
//LevelEndSign (LevelEndSign)
package {
import flash.display.*;
public dynamic class LevelEndSign extends MovieClip {
}
}//package
Section 15
//LevelProgress (LevelProgress)
package {
import flash.display.*;
public dynamic class LevelProgress extends MovieClip {
public var Level4b:MovieClip;
public var Level4c:MovieClip;
public var ArrowDown:MovieClip;
public var Level3b:MovieClip;
public var Level4a:MovieClip;
public var Level10a:MovieClip;
public var Level10b:MovieClip;
public var Level3c:MovieClip;
public var Level6b:MovieClip;
public var Level11c:MovieClip;
public var Level6c:MovieClip;
public var ArrowUp:MovieClip;
public var Level10c:MovieClip;
public var Level7c:MovieClip;
public var Level6a:MovieClip;
public var Level11a:MovieClip;
public var Level7b:MovieClip;
public var Level9:MovieClip;
public var Level12a:MovieClip;
public var Level12b:MovieClip;
public var Level5:MovieClip;
public var Level7a:MovieClip;
public var Level13:MovieClip;
public var Level11b:MovieClip;
public var Level8b:MovieClip;
public var Level1:MovieClip;
public var Level8a:MovieClip;
public var Level8c:MovieClip;
public var Level12c:MovieClip;
public var Level2a:MovieClip;
public var Level2b:MovieClip;
public var Level2c:MovieClip;
public var Level3a:MovieClip;
}
}//package
Section 16
//MeleeHit (MeleeHit)
package {
import flash.media.*;
public dynamic class MeleeHit extends Sound {
}
}//package
Section 17
//Particle (Particle)
package {
import flash.display.*;
public dynamic class Particle extends MovieClip {
public function Particle(){
addFrameScript(16, frame17, 25, frame26, 28, frame29, 37, frame38);
}
function frame17(){
stop();
}
function frame26(){
stop();
}
function frame29(){
gotoAndPlay(27);
}
function frame38(){
stop();
}
}
}//package
Section 18
//Skills (Skills)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Skills extends MovieClip {
public var Skill7c:MovieClip;
public var Skill7b:MovieClip;
public var Skill12:MovieClip;
public var Skill6a:MovieClip;
public var Skill4:MovieClip;
public var Skill8:MovieClip;
public var Skill9c:MovieClip;
public var Skill1c:MovieClip;
public var Skill1a:MovieClip;
public var Skill9a:MovieClip;
public var Skill10a:MovieClip;
public var Skill10b:MovieClip;
public var Skill10c:MovieClip;
public var Skill11a:MovieClip;
public var Skill2c:MovieClip;
public var Skill1b:MovieClip;
public var Skill3a:MovieClip;
public var Skill2b:MovieClip;
public var Skill3b:MovieClip;
public var Skill11c:MovieClip;
public var Skill3c:MovieClip;
public var SkillInfo:TextField;
public var Skill2a:MovieClip;
public var Skill9b:MovieClip;
public var Skill11b:MovieClip;
public var Skill5a:MovieClip;
public var Skill5b:MovieClip;
public var Skill7a:MovieClip;
public var Skill5c:MovieClip;
public var Skill6b:MovieClip;
public var Skill6c:MovieClip;
}
}//package
Section 19
//Spawn (Spawn)
package {
import flash.media.*;
public dynamic class Spawn extends Sound {
}
}//package
Section 20
//Title (Title)
package {
import flash.media.*;
public dynamic class Title extends Sound {
}
}//package
Section 21
//Training (Training)
package {
import flash.display.*;
public dynamic class Training extends MovieClip {
public var StartNewGame:SimpleButton;
}
}//package
Section 22
//UnitAnt (UnitAnt)
package {
import flash.display.*;
public dynamic class UnitAnt extends MovieClip {
}
}//package
Section 23
//UnitArmor (UnitArmor)
package {
import flash.display.*;
public dynamic class UnitArmor extends MovieClip {
}
}//package
Section 24
//UnitBlinker (UnitBlinker)
package {
import flash.display.*;
public dynamic class UnitBlinker extends MovieClip {
}
}//package
Section 25
//UnitDefender (UnitDefender)
package {
import flash.display.*;
public dynamic class UnitDefender extends MovieClip {
}
}//package
Section 26
//UnitFighter (UnitFighter)
package {
import flash.display.*;
public dynamic class UnitFighter extends MovieClip {
}
}//package
Section 27
//UnitGargoyle (UnitGargoyle)
package {
import flash.display.*;
public dynamic class UnitGargoyle extends MovieClip {
}
}//package
Section 28
//UnitGeek (UnitGeek)
package {
import flash.display.*;
public dynamic class UnitGeek extends MovieClip {
}
}//package
Section 29
//UnitHamster (UnitHamster)
package {
import flash.display.*;
public dynamic class UnitHamster extends MovieClip {
}
}//package
Section 30
//UnitLizard (UnitLizard)
package {
import flash.display.*;
public dynamic class UnitLizard extends MovieClip {
}
}//package
Section 31
//UnitLurker (UnitLurker)
package {
import flash.display.*;
public dynamic class UnitLurker extends MovieClip {
}
}//package
Section 32
//UnitMauler (UnitMauler)
package {
import flash.display.*;
public dynamic class UnitMauler extends MovieClip {
}
}//package
Section 33
//UnitMutant (UnitMutant)
package {
import flash.display.*;
public dynamic class UnitMutant extends MovieClip {
}
}//package
Section 34
//UnitNinja (UnitNinja)
package {
import flash.display.*;
public dynamic class UnitNinja extends MovieClip {
}
}//package
Section 35
//UnitPlayer (UnitPlayer)
package {
import flash.display.*;
public dynamic class UnitPlayer extends MovieClip {
}
}//package
Section 36
//UnitProjectile (UnitProjectile)
package {
import flash.display.*;
public dynamic class UnitProjectile extends MovieClip {
public function UnitProjectile(){
addFrameScript(9, frame10, 19, frame20, 29, frame30, 39, frame40, 49, frame50);
}
function frame10(){
gotoAndPlay(1);
}
function frame20(){
gotoAndPlay(11);
}
function frame30(){
gotoAndPlay(21);
}
function frame40(){
gotoAndPlay(31);
}
function frame50(){
gotoAndPlay(41);
}
}
}//package
Section 37
//UnitQueen (UnitQueen)
package {
import flash.display.*;
public dynamic class UnitQueen extends MovieClip {
}
}//package
Section 38
//UnitScout (UnitScout)
package {
import flash.display.*;
public dynamic class UnitScout extends MovieClip {
}
}//package
Section 39
//UnitTez (UnitTez)
package {
import flash.display.*;
public dynamic class UnitTez extends MovieClip {
}
}//package
Section 40
//UnitZapper (UnitZapper)
package {
import flash.display.*;
public dynamic class UnitZapper extends MovieClip {
}
}//package
Section 41
//Victory (Victory)
package {
import flash.display.*;
public dynamic class Victory extends MovieClip {
}
}//package