Section 1
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class AdLoader extends Sprite {
private var cpmstarLoader:Loader;
private var contentspotid:String;
public function AdLoader(_arg1:String){
this.contentspotid = _arg1;
addEventListener(Event.ADDED, addedHandler);
}
private function dispatchHandler(_arg1:Event):void{
dispatchEvent(_arg1);
}
private function addedHandler(_arg1:Event):void{
removeEventListener(Event.ADDED, addedHandler);
Security.allowDomain("server.cpmstar.com");
var _local2 = "http://server.cpmstar.com/adviewas3.swf";
var _local3:DisplayObjectContainer = parent;
cpmstarLoader = new Loader();
cpmstarLoader.contentLoaderInfo.addEventListener(Event.INIT, dispatchHandler);
cpmstarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dispatchHandler);
cpmstarLoader.load(new URLRequest(((_local2 + "?contentspotid=") + contentspotid)));
addChild(cpmstarLoader);
}
}
}//package CPMStar
Section 2
//actorObject (main.actorObject)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.ui.*;
import com.oaxoa.fx.*;
public class actorObject extends dynObject {
public var lLeg:MovieClip;
var noArmsShoot:Boolean;// = false
public var anim:MovieClip;
public var elSpawn:MovieClip;
public var light:MovieClip;
public var firstAttack:Boolean;// = false
var psyProtect:Number;// = 1
var psyCurLevel:Number;// = 0
public var timerBulletDelay:Timer;
var shoot;// = false
var oldX;// = 0
public var alwaysSeeEnemy:Boolean;// = false
var electroProtect:Number;// = 1
var jump;// = false
var upgradesAbilities:Array;
var vChildPos:int;// = 0
var vChildTime:int;// = 0
public var rLeg:MovieClip;
var vChild;
var distToEnemy:Number;// = 999999
public var LEngFire:MovieClip;
var damageType:uint;// = 0
var bioCurLevel:Number;// = 0
public var goodGuy:Boolean;// = false
public var arm1:MovieClip;
public var arm2:MovieClip;
var rageRadius:Number;// = 335
public var diffAttackCount:uint;// = 2
public var dead:Boolean;// = false
var useSelfWepPsy:Boolean;// = false
var fsmAI:FSM;
var curWeaponNum:int;// = 1
public var pointShoot:MovieClip;
var upgradesLife:Array;
var psyMaxLevel:Number;// = 0
public var timerBloodFXDelay:Timer;
var electroCurLevel:Number;// = 0
public var die:MovieClip;
public var REngFire:MovieClip;
public var curTargetChanged:int;// = 0
public var totalScores:int;// = 0
var bioReduce:Number;// = 0.3
public var cursorReload:Boolean;// = false
var damagePerHit:Number;// = 1
public var timerBulletDelay2:Timer;
var bioDamage:Number;// = 0.1
var electroReduce:Number;// = 0.3
var electroDamage:Number;// = 0.1
public var damageArea:MovieClip;
public var moneyCnt:Number;// = 0
public var body:MovieClip;
var rightArmToShoot;// = false
public var blaster:MovieClip;
var bioProtect:Number;// = 1
var bioMaxLevel:Number;// = 0
public var diffAttack:Boolean;// = false
public var beam:MovieClip;
var vChild2;
var jumpSpeed;// = -16
var electroMaxLevel:Number;// = 0
var wepAcc:Number;// = 0.1
public var p1:MovieClip;
public var p2:MovieClip;
public var p3:MovieClip;
public var p4:MovieClip;
var sitting;// = false
var actorType:String;// = ""
public var noStatEnemy:Boolean;// = false
var weapons:Array;
var isReloadLittleDelay:Boolean;// = false
var upgradesBullets:Array;
var itemsInBag:Array;
var seeRadius:Number;// = 335
public var BEngFire1:MovieClip;
public var head:MovieClip;
public var sound3D:Boolean;// = true
var psyReduce:Number;// = 0.3
public var maxTargetChanged:int;// = 5
public var BEngFire2:MovieClip;
public var alreadySeed:Boolean;// = false
var isRage:Boolean;// = false
public var live:MovieClip;
public var waitTimeBegin:uint;// = 0
var useSelfWep:Boolean;// = false
var noArmsShootCnt:int;// = 1
public var timerReloadDelay:Timer;
var upgradesParam:Array;
var attackRadius:Number;// = 35
var psyDamage:Number;// = 0.1
public function actorObject(){
timerBulletDelay = new Timer(200, 1);
timerBulletDelay2 = new Timer(200, 1);
timerReloadDelay = new Timer(200);
itemsInBag = new Array();
weapons = new Array();
timerBloodFXDelay = new Timer(300, 1);
upgradesLife = new Array();
upgradesParam = new Array();
upgradesBullets = new Array();
upgradesAbilities = new Array();
super();
timerReloadDelay.addEventListener(TimerEvent.TIMER, timerReloadDelay_Timer, false, 0, true);
addEventListener(FSMEvent.ONPOSTED, onFSMPosted, false, 0, true);
}
public function addBioDamage(_arg1:Number){
bioMaxLevel = (bioCurLevel + _arg1);
bioCurLevel = bioMaxLevel;
}
public function loadParams(){
var _local1:int;
if (!mainGlobal.myCookie.isKeyExist("moneyCnt")){
return;
};
moneyCnt = Number(mainGlobal.myCookie.get("moneyCnt"));
totalScores = int(mainGlobal.myCookie.get("totalScores"));
curWeaponNum = int(mainGlobal.myCookie.get("curWeaponNum"));
life = Number(mainGlobal.myCookie.get("life"));
lifeMax = Number(mainGlobal.myCookie.get("lifeMax"));
bioProtect = Number(mainGlobal.myCookie.get("bioProtect"));
psyProtect = Number(mainGlobal.myCookie.get("psyProtect"));
electroProtect = Number(mainGlobal.myCookie.get("electroProtect"));
_local1 = 0;
while (_local1 < weapons.length) {
weapons[_local1].loadParams(("weapons" + _local1.toString()));
_local1++;
};
_local1 = 0;
while (_local1 < upgradesLife.length) {
upgradesLife[_local1].loadParams(("upgradesLife" + _local1.toString()));
_local1++;
};
_local1 = 0;
while (_local1 < upgradesParam.length) {
upgradesParam[_local1].loadParams(("upgradesParam" + _local1.toString()));
_local1++;
};
_local1 = 0;
while (_local1 < upgradesBullets.length) {
upgradesBullets[_local1].loadParams(("upgradesBullets" + _local1.toString()));
_local1++;
};
_local1 = 0;
while (_local1 < upgradesAbilities.length) {
upgradesAbilities[_local1].loadParams(("upgradesAbilities" + _local1.toString()));
_local1++;
};
}
public function testIsActorDead(){
if (life <= 0){
fsmAI.postEvent("killed");
gotoAndStop("die");
dead = true;
stayTime = (6000 + ageMath.RandomInt(1, 2000));
timerStayDelay.start();
if (((((head) && (arm1))) && (arm2))){
head.visible = false;
arm1.visible = false;
arm2.visible = false;
};
};
}
public function updateRunJumpState(_arg1:Boolean){
if (jump){
if (currentLabel != "jump"){
gotoAndStop("jump");
};
} else {
if (sitting){
if (currentLabel != "sitting"){
gotoAndStop("sitting");
};
} else {
if (oldX != x){
if (!_arg1){
if (currentLabel != "run"){
gotoAndStop("run");
};
} else {
if (currentLabel != "runBack"){
gotoAndStop("runBack");
};
};
} else {
if (currentLabel != "stand"){
gotoAndStop("stand");
};
};
};
};
}
public function clearActorObject(){
timerReloadDelay.stop();
timerReloadDelay.removeEventListener(TimerEvent.TIMER, timerReloadDelay_Timer);
timerBulletDelay.stop();
timerBloodFXDelay.stop();
this.removeEventListener(FSMEvent.ONPOSTED, onFSMPosted);
if (((lLeg) && (rLeg))){
lLeg.stop();
rLeg.stop();
};
vChild = null;
vChild2 = null;
fsmAI.actor = null;
clearDynObject();
}
public function updateActorEnemy(){
var _local1:ageVector = new ageVector(curLevel.hero.x, curLevel.hero.y);
var _local2:Point = curLevel.globalToLocal(MovieClip(parent).localToGlobal(new Point(this.x, this.y)));
_local1.sub(new ageVector(_local2.x, _local2.y));
distToEnemy = _local1.len();
fsmAI.postEvent("timer");
}
public function addPsyDamage(_arg1:Number){
psyMaxLevel = (psyCurLevel + _arg1);
psyCurLevel = psyMaxLevel;
}
public function timerReloadDelay_Timer(_arg1:TimerEvent):void{
var _local2:int;
if (isReloadLittleDelay){
if (((cursorReload) && (!(mainGlobal.paused)))){
Game(root).cursor.gotoAndStop("cross");
};
timerReloadDelay.stop();
isReloadLittleDelay = false;
_local2 = (weapons[(curWeaponNum - 1)].bulletsInCatrigeMax - weapons[(curWeaponNum - 1)].bulletsInCatrige);
if (weapons[(curWeaponNum - 1)].bulletsNum >= _local2){
weapons[(curWeaponNum - 1)].bulletsInCatrige = (weapons[(curWeaponNum - 1)].bulletsInCatrige + _local2);
if (!weapons[(curWeaponNum - 1)].infAmmo){
weapons[(curWeaponNum - 1)].bulletsNum = (weapons[(curWeaponNum - 1)].bulletsNum - _local2);
};
} else {
weapons[(curWeaponNum - 1)].bulletsInCatrige = (weapons[(curWeaponNum - 1)].bulletsInCatrige + weapons[(curWeaponNum - 1)].bulletsNum);
weapons[(curWeaponNum - 1)].bulletsNum = 0;
};
} else {
timerReloadDelay.delay = sounds.snd[(weapons[(curWeaponNum - 1)].type + "Reloaded")].length;
timerReloadDelay.start();
isReloadLittleDelay = true;
if (sound3D){
sounds.PlaySnd((weapons[(curWeaponNum - 1)].type + "Reloaded"), 0.6, this, stage);
} else {
sounds.PlaySnd((weapons[(curWeaponNum - 1)].type + "Reloaded"));
};
};
}
public function hitTestLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):ageVector{
var _local5:Boolean;
if (this.scaleX < 0){
_local5 = true;
this.scaleX = 1;
};
var _local6:Point = curLevel.globalToLocal(this.localToGlobal(new Point(damageArea.x, damageArea.y)));
if (_local5){
this.scaleX = -1;
};
return (ageMath.getLineCrossRect(_arg1, _arg2, _arg3, _arg4, _local6.x, _local6.y, (_local6.x + damageArea.width), (_local6.y + damageArea.height)));
}
public function transmitDamage(_arg1:projObject){
var _local2:*;
if (!timerBloodFXDelay.running){
if (damageType == 0){
if (mainGlobal.configVfxOn){
curLevel.addFX_Splatters((_arg1.x + (_arg1.Velocity.x * 0.5)), (_arg1.y + ageMath.RandomInt(-5, 5)));
};
sounds.PlaySnd(("bodyBlood" + ageMath.RandomInt(1, 3).toString()), 1, this, stage);
if (fsmAI.curAIClass == "Zombie"){
if (((!(ageMath.RandomInt(0, 1))) || ((life <= _arg1.damage)))){
sounds.PlaySnd(("ZombieVoice" + ageMath.RandomInt(1, 4).toString()), 0.8, this, stage);
};
} else {
if (fsmAI.curAIClass == "Ted"){
sounds.PlaySnd(("TedPain" + ageMath.RandomInt(1, 3).toString()), 0.8);
} else {
if (fsmAI.curAIClass == "AlienSolder"){
if (((!(ageMath.RandomInt(0, 1))) || ((life <= _arg1.damage)))){
sounds.PlaySnd(("alienPain" + ageMath.RandomInt(1, 4).toString()), 1);
};
};
};
};
if (((!((bottomLimiter == null))) && (mainGlobal.configVfxOn))){
if (bottomLimiter.wideGround){
_local2 = curLevel.addFX_BloodOnGround((x + Velocity.x), y);
curLevel.alignObjXToAnother(_local2, bottomLimiter);
} else {
_local2 = curLevel.addFX_BloodLeak(x, y);
curLevel.alignObjXToAnother(_local2, bottomLimiter);
};
};
timerBloodFXDelay.start();
} else {
if (damageType == 1){
if (mainGlobal.configVfxOn){
curLevel.addFX_MetalSparks((_arg1.x + (_arg1.Velocity.x * 0.5)), (_arg1.y + (_arg1.Velocity.y * 0.5)));
};
if ((((((((fsmAI.curAIClass == "AlienSaw")) || ((fsmAI.curAIClass == "AlienHunter")))) || ((fsmAI.curAIClass == "AlienElectro")))) || ((fsmAI.curAIClass == "AlienElectro")))){
if (((!(ageMath.RandomInt(0, 1))) || ((life <= _arg1.damage)))){
sounds.PlaySnd(("AlienVoice" + ageMath.RandomInt(1, 7).toString()), 1);
};
} else {
if (fsmAI.curAIClass == "AlienBomber"){
if (((!(ageMath.RandomInt(0, 1))) || ((life <= _arg1.damage)))){
sounds.PlaySnd(("alienPain" + ageMath.RandomInt(1, 4).toString()), 1);
};
};
};
sounds.PlaySnd(("Ricochet" + ageMath.RandomInt(1, 4).toString()), 1, this, stage);
timerBloodFXDelay.start();
};
};
};
_arg1.visible = false;
life = (life - _arg1.damage);
if (live != null){
live.gotoAndStop(Math.round(ageMath.RemapVal(life, 0, lifeMax, 1, 100)));
live.startFadeOut();
};
if (((!(_arg1.fromGoodGuy)) && (_arg1.useBioDamage))){
addBioDamage(_arg1.bioDamageVal);
};
if (((!(_arg1.fromGoodGuy)) && (_arg1.usePsyDamage))){
addPsyDamage(_arg1.psyDamageVal);
};
if (((!(_arg1.fromGoodGuy)) && (_arg1.useElectroDamage))){
addElectroDamage(_arg1.electroDamageVal);
};
if (life <= 0){
if (((_arg1.fromGoodGuy) && (!(noStatEnemy)))){
mainGlobal.enemiesKilled++;
};
};
testIsActorDead();
}
public function removeItemFromBag(_arg1:String):void{
var _local2:int;
_local2 = 0;
while (_local2 < itemsInBag.length) {
if (itemsInBag[_local2] == _arg1){
itemsInBag.splice(_local2, 1);
return;
};
_local2++;
};
}
public function addElectroDamage(_arg1:Number){
electroMaxLevel = (electroCurLevel + _arg1);
electroCurLevel = electroMaxLevel;
}
public function saveParams(){
var _local1:int;
mainGlobal.myCookie.putNoFlush("moneyCnt", moneyCnt);
mainGlobal.myCookie.putNoFlush("totalScores", totalScores);
mainGlobal.myCookie.putNoFlush("curWeaponNum", curWeaponNum);
mainGlobal.myCookie.putNoFlush("life", life);
mainGlobal.myCookie.putNoFlush("lifeMax", lifeMax);
mainGlobal.myCookie.putNoFlush("bioProtect", bioProtect);
mainGlobal.myCookie.putNoFlush("psyProtect", psyProtect);
mainGlobal.myCookie.putNoFlush("electroProtect", electroProtect);
_local1 = 0;
while (_local1 < weapons.length) {
weapons[_local1].saveParams(("weapons" + _local1.toString()));
_local1++;
};
_local1 = 0;
while (_local1 < upgradesLife.length) {
upgradesLife[_local1].saveParams(("upgradesLife" + _local1.toString()));
_local1++;
};
_local1 = 0;
while (_local1 < upgradesParam.length) {
upgradesParam[_local1].saveParams(("upgradesParam" + _local1.toString()));
_local1++;
};
_local1 = 0;
while (_local1 < upgradesBullets.length) {
upgradesBullets[_local1].saveParams(("upgradesBullets" + _local1.toString()));
_local1++;
};
_local1 = 0;
while (_local1 < upgradesAbilities.length) {
upgradesAbilities[_local1].saveParams(("upgradesAbilities" + _local1.toString()));
_local1++;
};
mainGlobal.myCookie.flushData();
}
public function setTarget(_arg1:ageVector):void{
isTargeting = true;
target.copy(_arg1);
}
public function isItemExist(_arg1:String):Boolean{
var _local2:int;
_local2 = 0;
while (_local2 < itemsInBag.length) {
if (itemsInBag[_local2] == _arg1){
return (true);
};
_local2++;
};
return (false);
}
public function applyDamages(){
if (bioCurLevel > 0){
bioCurLevel = (bioCurLevel - (bioReduce * bioProtect));
life = (life - bioDamage);
if (bioCurLevel < 0){
bioCurLevel = 0;
};
} else {
bioCurLevel = (bioMaxLevel = 0);
};
if (psyCurLevel > 0){
psyCurLevel = (psyCurLevel - (psyReduce * psyProtect));
if (psyCurLevel < 0){
psyCurLevel = 0;
};
} else {
psyCurLevel = (psyMaxLevel = 0);
};
if (electroCurLevel > 0){
if (!elSpawn.visible){
elSpawn.visible = true;
sounds.PlaySnd("ElectroWave");
};
electroCurLevel = (electroCurLevel - (electroReduce * electroProtect));
if (electroCurLevel < 0){
electroCurLevel = 0;
};
} else {
if (elSpawn.visible){
elSpawn.visible = false;
};
electroCurLevel = (electroMaxLevel = 0);
};
}
public function moveFlyLike():void{
var _local3:ageVector;
var _local4:Number;
x = (x + speed.x);
y = (y + speed.y);
var _local1:Point = curLevel.globalToLocal(MovieClip(parent).localToGlobal(new Point(x, y)));
if (target.isEqual(new ageVector(_local1.x, _local1.y), 30)){
speed.mulScalar(0.9);
if (isTargeting){
fsmAI.postEvent("targetReached");
};
};
var _local2:* = new ageVector((target.x - _local1.x), (target.y - _local1.y)).len();
speed.trimLen(((_local2 > (maxSpeed.x * 10))) ? maxSpeed.x : ageMath.RemapVal(_local2, 0, (maxSpeed.x * 10), 0, maxSpeed.x));
if (isTargeting){
_local3 = new ageVector((target.x - _local1.x), (target.y - _local1.y));
_local3.normThis();
_local3.mulScalar(0.2);
speed.add(_local3);
_local4 = speed.len();
speed.normThis();
_local3.normThis();
speed.lerpThis(_local3, 0.1);
speed.normThis();
speed.mulScalar(_local4);
};
}
public function initParams(_arg1:String){
var _local2:uint;
var _local3:GlowFilter;
actorType = _arg1;
if (_arg1 == "Ted"){
head.gm.visible = false;
life = (lifeMax = 80);
fsmAI = new FSM(this, "Ted");
damageType = 0;
goodGuy = true;
jumpSpeed = -13;
sound3D = false;
cursorReload = true;
speed.x = 8;
weapons.push(new weaponParam("Pistol", curLevel));
weapons.push(new weaponParam("Shotgun", curLevel));
weapons.push(new weaponParam("AK", curLevel));
weapons.push(new weaponParam("Minigun", curLevel));
weapons.push(new weaponParam("Blaster", curLevel));
weapons.push(new weaponParam("RPG", curLevel));
weapons.push(new weaponParam("Lasergun", curLevel));
weapons.push(new weaponParam("DDD", curLevel));
weapons[0].active = true;
upgradesLife.push(new upgItem("Life +25%", 1, -1, 250, "life", 125, 2));
upgradesLife.push(new upgItem("Life +50%", 1, 0, 350, "life", 150, 2));
upgradesLife.push(new upgItem("Life +75%", 1, 1, 450, "life", 175, 2));
upgradesLife.push(new upgItem("Life +100%", 1, 2, 550, "life", 200, 2));
upgradesLife.push(new upgItem("Life +150%", 1, 3, 700, "life", 250, 2));
upgradesLife.push(new upgItem("Life +200%", 1, 4, 850, "life", 300, 2));
upgradesParam.push(new upgItem("bio-protection -25%", 1, -1, 150, "bioProtect", 1.25, 2));
upgradesParam.push(new upgItem("bio-protection -50%", 1, 0, 200, "bioProtect", 1.5, 2));
upgradesParam.push(new upgItem("electro-protection -25%", 1, -1, 200, "electroProtect", 1.25, 2));
upgradesParam.push(new upgItem("electro-protection -50%", 1, 2, 300, "electroProtect", 1.5, 2));
upgradesParam.push(new upgItem("psy-protection -25%", 1, -1, 200, "psyProtect", 1.25, 2));
upgradesParam.push(new upgItem("psy-protection -50%", 1, 4, 300, "psyProtect", 1.5, 2));
upgradesBullets.push(new upgItem("Shotgun", 1, -1, 35, "spam", 0.25, 1));
upgradesBullets.push(new upgItem("Assault Rifle", 1, -1, 45, "spam", 0.25, 1));
upgradesBullets.push(new upgItem("Minigun", 1, -1, 65, "spam", 0.25, 1));
upgradesBullets.push(new upgItem("Blaster", 1, -1, 70, "spam", 0.25, 1));
upgradesBullets.push(new upgItem("Launcher", 1, -1, 150, "spam", 0.25, 1));
upgradesAbilities.push(new upgItem("necroeater 50%", 1, -1, 150, "spam", 0.25, 1));
upgradesAbilities.push(new upgItem("necroeater 100%", 1, -1, 150, "spam", 0.25, 1));
upgradesAbilities.push(new upgItem("Freeze 1sec", 1, -1, 150, "spam", 0.25, 1));
upgradesAbilities.push(new upgItem("Freeze 2sec", 1, -1, 150, "spam", 0.25, 1));
if (!mainGlobal.dontLoadHeroParam){
Game(root).curLev.hero.loadParams();
mainGlobal.dontLoadHeroParam = true;
};
} else {
if (_arg1 == "AlienSolder"){
life = (lifeMax = 15);
speed.x = 1.5;
jumpSpeed = -10;
fsmAI = new FSM(this, "AlienSolder");
damageType = 0;
seeRadius = 640;
attackRadius = 150;
weapons.push(new weaponParam("Blaster", curLevel));
} else {
if (_arg1 == "Spider"){
speed.x = 5;
life = (lifeMax = 2);
damagePerHit = 2;
fsmAI = new FSM(this, "Zombie");
} else {
if (_arg1 == "SpiderBig"){
speed.x = 3;
life = (lifeMax = 4);
damagePerHit = 4;
fsmAI = new FSM(this, "Zombie");
} else {
if (_arg1 == "Zomb01"){
speed.x = 0.5;
life = (lifeMax = 3);
damagePerHit = 2;
fsmAI = new FSM(this, "Zombie");
} else {
if (_arg1 == "Zomb01Run"){
speed.x = 6;
life = (lifeMax = 4);
damagePerHit = 2;
fsmAI = new FSM(this, "Zombie");
} else {
if (_arg1 == "Zomb01Vomit"){
speed.x = 0.5;
life = (lifeMax = 6);
damagePerHit = 2;
fsmAI = new FSM(this, "Zombie");
useSelfWep = true;
noArmsShoot = true;
weapons.push(new weaponParam("Vomit", curLevel));
} else {
if (_arg1 == "Zomb02"){
speed.x = 0.5;
life = (lifeMax = 3);
damagePerHit = 2;
fsmAI = new FSM(this, "Zombie");
} else {
if (_arg1 == "Zomb02Run"){
speed.x = 2;
life = (lifeMax = 4);
damagePerHit = 2;
fsmAI = new FSM(this, "Zombie");
} else {
if (_arg1 == "Zomb02Vomit"){
speed.x = 0.5;
life = (lifeMax = 6);
damagePerHit = 2;
fsmAI = new FSM(this, "Zombie");
useSelfWep = true;
noArmsShoot = true;
weapons.push(new weaponParam("Vomit", curLevel));
} else {
if (_arg1 == "Zomb03"){
speed.x = 0.5;
life = (lifeMax = 3);
damagePerHit = 2;
fsmAI = new FSM(this, "Zombie");
} else {
if (_arg1 == "Zomb03Run"){
speed.x = 7;
life = (lifeMax = 4);
damagePerHit = 2;
fsmAI = new FSM(this, "Zombie");
} else {
if (_arg1 == "Zomb03Vomit"){
speed.x = 0.5;
life = (lifeMax = 6);
damagePerHit = 2;
fsmAI = new FSM(this, "Zombie");
useSelfWep = true;
noArmsShoot = true;
weapons.push(new weaponParam("Vomit", curLevel));
} else {
if (_arg1 == "Zomb04"){
speed.x = 0.5;
life = (lifeMax = 3);
damagePerHit = 2;
fsmAI = new FSM(this, "Zombie");
} else {
if (_arg1 == "Zomb04Run"){
speed.x = 7;
life = (lifeMax = 4);
damagePerHit = 2;
fsmAI = new FSM(this, "Zombie");
} else {
if (_arg1 == "Zomb04Vomit"){
speed.x = 0.5;
life = (lifeMax = 6);
damagePerHit = 2;
fsmAI = new FSM(this, "Zombie");
useSelfWep = true;
noArmsShoot = true;
weapons.push(new weaponParam("Vomit", curLevel));
} else {
if (_arg1 == "Zomb05"){
speed.x = 0.5;
life = (lifeMax = 3);
damagePerHit = 2;
fsmAI = new FSM(this, "Zombie");
} else {
if (_arg1 == "Zomb05Run"){
speed.x = 7;
life = (lifeMax = 4);
damagePerHit = 2;
fsmAI = new FSM(this, "Zombie");
} else {
if (_arg1 == "Zomb05Vomit"){
speed.x = 0.5;
life = (lifeMax = 6);
damagePerHit = 2;
fsmAI = new FSM(this, "Zombie");
useSelfWep = true;
noArmsShoot = true;
weapons.push(new weaponParam("Vomit", curLevel));
} else {
if (_arg1 == "ZombPsy"){
speed.x = 1;
life = (lifeMax = 6);
damagePerHit = 2;
attackRadius = 300;
seeRadius = 550;
fsmAI = new FSM(this, "Zombie");
useSelfWepPsy = true;
noArmsShoot = true;
weapons.push(new weaponParam("psyProj", curLevel));
} else {
if (_arg1 == "ZombTank"){
speed.x = 1;
life = (lifeMax = 40);
damagePerHit = 15;
attackRadius = 90;
seeRadius = 550;
diffAttack = true;
diffAttackCount = 2;
fsmAI = new FSM(this, "Zombie");
useSelfWep = true;
noArmsShoot = true;
noArmsShootCnt = 3;
weapons.push(new weaponParam("Vomit", curLevel));
} else {
if (_arg1 == "ZombTankRun"){
speed.x = 10;
life = (lifeMax = 40);
damagePerHit = 15;
attackRadius = 90;
seeRadius = 550;
diffAttack = true;
diffAttackCount = 2;
fsmAI = new FSM(this, "Zombie");
} else {
if (_arg1 == "AlienSaw"){
life = (lifeMax = 8);
gravityEnable = false;
collisionEnable = false;
isFlyMoveType = true;
maxSpeed.x = 10;
seeRadius = 600;
attackRadius = 50;
damagePerHit = 0.4;
damageType = 1;
fsmAI = new FSM(this, "AlienSaw");
} else {
if (_arg1 == "AlienHunter"){
life = (lifeMax = 35);
gravityEnable = false;
collisionEnable = false;
isFlyMoveType = true;
maxSpeed.x = 5;
seeRadius = 600;
damageType = 1;
this.LEngFire.fadeSpeed = 0.2;
this.REngFire.fadeSpeed = 0.2;
this.BEngFire1.fadeSpeed = 0.2;
this.BEngFire2.fadeSpeed = 0.2;
fsmAI = new FSM(this, "AlienHunter");
} else {
if (_arg1 == "AlienPredator"){
life = (lifeMax = 250);
gravityEnable = false;
collisionEnable = false;
maxSpeed.x = 5;
seeRadius = 600;
damageType = 1;
timerBulletDelay.delay = 1000;
timerBulletDelay2.delay = 6000;
weapons.push(new weaponParam("Blaster", curLevel));
weapons.push(new weaponParam("BombWep", curLevel));
fsmAI = new FSM(this, "AlienPredator");
} else {
if (_arg1 == "AlienElectro"){
life = (lifeMax = 35);
gravityEnable = false;
collisionEnable = false;
isFlyMoveType = true;
maxSpeed.x = 5;
seeRadius = 600;
damageType = 1;
this.LEngFire.fadeSpeed = 0.2;
this.REngFire.fadeSpeed = 0.2;
this.BEngFire2.fadeSpeed = 0.2;
fsmAI = new FSM(this, "AlienElectro");
_local2 = 14544639;
if (mainGlobal.configVfxOn){
_local3 = new GlowFilter();
_local3.color = _local2;
_local3.strength = 1.5;
_local3.quality = BitmapFilterQuality.LOW;
_local3.blurX = (_local3.blurY = 10);
light.filters = [_local3];
};
vChild = light;
} else {
if (_arg1 == "AlienSeeder"){
life = (lifeMax = 140);
gravityEnable = false;
collisionEnable = false;
isFlyMoveType = true;
maxSpeed.x = 3;
seeRadius = 600;
damageType = 1;
this.LEngFire.fadeSpeed = 0.2;
this.REngFire.fadeSpeed = 0.2;
this.BEngFire1.fadeSpeed = 0.2;
this.BEngFire2.fadeSpeed = 0.2;
maxTargetChanged = 350;
fsmAI = new FSM(this, "AlienSeeder");
} else {
if (_arg1 == "AlienBigBoss"){
life = (lifeMax = 550);
gravityEnable = false;
collisionEnable = false;
isFlyMoveType = true;
maxSpeed.x = 3;
seeRadius = 600;
damageType = 1;
maxTargetChanged = 4;
fsmAI = new FSM(this, "AlienBigBoss");
_local2 = 14544639;
if (mainGlobal.configVfxOn){
_local3 = new GlowFilter();
_local3.color = _local2;
_local3.strength = 1.5;
_local3.quality = BitmapFilterQuality.LOW;
_local3.blurX = (_local3.blurY = 10);
light.filters = [_local3];
};
vChild = light;
vChild2 = beam;
vChild.visible = false;
timerBulletDelay.delay = 1000;
timerBulletDelay2.delay = 7000;
weapons.push(new weaponParam("Blaster", curLevel));
weapons.push(new weaponParam("BombWep", curLevel));
} else {
if (_arg1 == "AlienHunterBlaster"){
speed.x = 0;
speed.y = 0;
life = (lifeMax = 25);
gravityEnable = false;
collisionEnable = false;
seeRadius = 500;
attackRadius = 500;
damageType = 1;
timerBulletDelay.delay = 1000;
fsmAI = new FSM(this, "Turrel");
noStatEnemy = true;
weapons.push(new weaponParam("Blaster", curLevel));
} else {
if (_arg1 == "AlienBomber"){
life = (lifeMax = 180);
gravityEnable = false;
collisionEnable = false;
isFlyMoveType = true;
maxSpeed.x = 5;
seeRadius = 600;
damageType = 1;
timerBulletDelay.delay = 1200;
this.LEngFire.fadeSpeed = 0.2;
this.REngFire.fadeSpeed = 0.2;
this.BEngFire1.fadeSpeed = 0.2;
this.BEngFire2.fadeSpeed = 0.2;
fsmAI = new FSM(this, "AlienBomber");
weapons.push(new weaponParam("BombWep", curLevel));
} else {
if (_arg1 == "AlienBombWep"){
speed.x = 0;
speed.y = 0;
life = (lifeMax = 25);
gravityEnable = false;
collisionEnable = false;
seeRadius = 500;
attackRadius = 500;
damageType = 1;
timerBulletDelay.delay = 1000;
fsmAI = new FSM(this, "TurrelBomb");
noStatEnemy = true;
weapons.push(new weaponParam("Blaster", curLevel));
} else {
if (_arg1 == "AlienBomb"){
speed.x = 0;
speed.y = 0;
life = (lifeMax = 2);
gravityEnable = false;
seeRadius = 100;
attackRadius = 100;
damagePerHit = 35;
damageType = 1;
fsmAI = new FSM(this, "Bomb");
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
}
private function onFSMPosted(_arg1:FSMEvent):void{
if (((((mainGlobal.paused) || ((curLevel == null)))) || (!(curLevel.visible)))){
return;
};
fsmAI.postEvent(_arg1.data);
}
public function hitTestProj(_arg1:projObject):Boolean{
var _local2:Point = new Point(_arg1.x, _arg1.y);
var _local3:Point = this.globalToLocal(curLevel.localToGlobal(_local2));
return (Boolean(((ageMath.inRange(_local3.x, damageArea.x, (damageArea.x + damageArea.width))) && (ageMath.inRange(_local3.y, damageArea.y, (damageArea.y + damageArea.height))))));
}
public function updateActorParts(_arg1:ageVector){
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Point;
var _local8:Number;
if (((!(body)) || (!(arm1)))){
return;
};
if (arm1.currentLabel != ("R" + weapons[(curWeaponNum - 1)].type)){
arm1.gotoAndStop(("R" + weapons[(curWeaponNum - 1)].type));
return;
};
if (arm2.currentLabel != ("L" + weapons[(curWeaponNum - 1)].type)){
arm2.gotoAndStop(("L" + weapons[(curWeaponNum - 1)].type));
return;
};
arm1.x = (body.arm1.x + body.x);
arm1.y = (body.arm1.y + body.y);
arm2.x = (body.arm2.x + body.x);
arm2.y = (body.arm2.y + body.y);
head.x = (body.head.x + body.x);
head.y = (body.head.y + body.y);
var _local2:ageVector = new ageVector((_arg1.x - ((body.arm1.x + body.x) + x)), (_arg1.y - ((body.arm1.y + body.y) + y))).norm();
if (_arg1.x > x){
scaleX = 1;
} else {
scaleX = -1;
};
if (scaleX < 0){
_local2.x = -(_local2.x);
};
var _local3:* = _local2.getAngleDeg();
if (_local3 > 180){
_local3 = (_local3 - 90);
} else {
if (_local3 < -180){
_local3 = (_local3 + 90);
};
};
arm1.rotation = _local3;
head.rotation = (_local3 * 0.5);
if (arm1.anim.pointHand != null){
_local4 = arm1.anim.localToGlobal(new Point(arm1.anim.pointHand.x, arm1.anim.pointHand.y));
_local5 = this.globalToLocal(_local4);
_local6 = body.localToGlobal(new Point(body.arm2.x, body.arm2.y));
_local7 = this.globalToLocal(_local6);
_local8 = ageMath.Distance(_local5.x, _local5.y, _local7.x, _local7.y);
arm2.rotation = 0;
arm2.width = _local8;
arm2.rotation = ((Math.atan2((_local5.y - _local7.y), (_local5.x - _local7.x)) / Math.PI) * 180);
} else {
arm2.rotation = 0;
arm2.width = 37;
arm2.rotation = _local3;
};
}
public function startReload(){
if (cursorReload){
Game(root).cursor.gotoAndStop("wait");
waitTimeBegin = getTimer();
};
timerReloadDelay.delay = weapons[(curWeaponNum - 1)].reloadDelay;
timerReloadDelay.start();
if (sound3D){
sounds.PlaySnd((weapons[(curWeaponNum - 1)].type + "Reload"), 0.6, this, stage);
} else {
sounds.PlaySnd((weapons[(curWeaponNum - 1)].type + "Reload"));
};
}
public function startShoot(_arg1:ageVector){
var _local2:Point;
var _local3:Point;
var _local7:*;
var _local8:Number;
var _local9:int;
if (!noArmsShoot){
if (((((!(body)) || (!(arm1)))) || (!(arm1.pointShoot)))){
return;
};
};
if ((((weapons[(curWeaponNum - 1)].bulletsNum == 0)) && ((weapons[(curWeaponNum - 1)].bulletsInCatrige == 0)))){
if (sound3D){
sounds.PlaySnd("cocking", 0.6, this, stage);
} else {
sounds.PlaySnd("cocking");
};
timerBulletDelay.delay = 500;
timerBulletDelay.start();
return;
};
if (weapons[(curWeaponNum - 1)].bulletsInCatrige == 0){
if (weapons[(curWeaponNum - 1)].bulletsNum == 0){
} else {
startReload();
};
return;
};
if (wepAcc < weapons[(curWeaponNum - 1)].accHi){
wepAcc = (wepAcc + weapons[(curWeaponNum - 1)].accShootInc);
if (wepAcc > weapons[(curWeaponNum - 1)].accHi){
wepAcc = weapons[(curWeaponNum - 1)].accHi;
};
};
if (!noArmsShoot){
_local2 = new Point(arm1.pointShoot.x, arm1.pointShoot.y);
_local2 = curLevel.globalToLocal(arm1.localToGlobal(_local2));
if (weapons[(curWeaponNum - 1)].useDiffArms){
_local3 = new Point(arm2.pointShoot.x, arm2.pointShoot.y);
_local3 = curLevel.globalToLocal(arm2.localToGlobal(_local3));
};
} else {
_local2 = new Point(this["pointShoot"].x, this["pointShoot"].y);
_local2 = curLevel.globalToLocal(this.localToGlobal(_local2));
};
var _local4:Point = _local2;
if (!noArmsShoot){
if (((weapons[(curWeaponNum - 1)].useDiffArms) && (!(rightArmToShoot)))){
_local4 = _local3;
};
};
var _local5:Number = ageMath.Distance(x, y, (Controls.mousePosX - curLevel.x), (Controls.mousePosY - curLevel.y));
var _local6:Number = (((14 * wepAcc) * _local5) / weapons[(curWeaponNum - 1)].accDistScale);
_local7 = weapons[(curWeaponNum - 1)].shootFunc(_local4.x, _local4.y, (_arg1.x + ageMath.Random(-(_local6), _local6)), (_arg1.y + ageMath.Random(-(_local6), _local6)), weapons[(curWeaponNum - 1)]);
if (((_local7.gravityEnable) && (_local7.gravityComp))){
_local8 = _local7.Velocity.len();
_local7.Velocity.add(new ageVector(0, -13));
_local7.Velocity.setLen(_local8);
};
if (goodGuy){
_local7.fromGoodGuy = true;
mainGlobal.shootingAll++;
} else {
_local7.fromGoodGuy = false;
};
if (weapons[(curWeaponNum - 1)].bulletsShotCnt > 1){
_local9 = 0;
_local9 = 0;
while (_local9 < (weapons[(curWeaponNum - 1)].bulletsShotCnt - 1)) {
_local7 = weapons[(curWeaponNum - 1)].shootFunc(_local4.x, _local4.y, (_arg1.x + ageMath.Random(-(_local6), _local6)), (_arg1.y + ageMath.Random(-(_local6), _local6)), weapons[(curWeaponNum - 1)]);
if (goodGuy){
_local7.fromGoodGuy = true;
mainGlobal.shootingAll++;
} else {
_local7.fromGoodGuy = false;
};
if (((_local7.gravityEnable) && (_local7.gravityComp))){
_local8 = _local7.Velocity.len();
_local7.Velocity.add(new ageVector(0, -13));
_local7.Velocity.setLen(_local8);
};
_local9++;
};
};
weapons[(curWeaponNum - 1)].bulletsInCatrige = (weapons[(curWeaponNum - 1)].bulletsInCatrige - weapons[(curWeaponNum - 1)].bulletsDecr);
if (weapons[(curWeaponNum - 1)].bulletsInCatrige < 0){
weapons[(curWeaponNum - 1)].bulletsInCatrige = 0;
};
if (weapons[(curWeaponNum - 1)].bulletsInCatrige == 0){
if (weapons[(curWeaponNum - 1)].bulletsNum == 0){
} else {
if (cursorReload){
Game(root).cursor.gotoAndStop("wait");
waitTimeBegin = getTimer();
};
timerReloadDelay.delay = weapons[(curWeaponNum - 1)].reloadDelay;
timerReloadDelay.start();
if (sound3D){
sounds.PlaySnd((weapons[(curWeaponNum - 1)].type + "Reload"), 0.6, this, stage);
} else {
sounds.PlaySnd((weapons[(curWeaponNum - 1)].type + "Reload"));
};
};
};
if (timerBulletDelay.delay != weapons[(curWeaponNum - 1)].bulletDelay){
timerBulletDelay.delay = weapons[(curWeaponNum - 1)].bulletDelay;
};
timerBulletDelay.start();
if (!noArmsShoot){
if (!weapons[(curWeaponNum - 1)].useDiffArms){
arm1.anim.gotoAndPlay(2);
} else {
if (rightArmToShoot){
arm1.anim.gotoAndPlay(2);
rightArmToShoot = false;
} else {
arm2.anim.gotoAndPlay(2);
rightArmToShoot = true;
};
};
};
}
public function applyUpgrade(_arg1:int, _arg2:int){
var _local3:Array;
if (_arg1 == 1){
_local3 = upgradesLife;
} else {
if (_arg1 == 2){
_local3 = upgradesParam;
} else {
if (_arg1 == 4){
_local3 = upgradesAbilities;
} else {
return;
};
};
};
if (_local3[_arg2].typeOp == 0){
this[_local3[_arg2].paramName] = (this[_local3[_arg2].paramName] + _local3[_arg2].param);
} else {
if (_local3[_arg2].typeOp == 1){
this[_local3[_arg2].paramName] = (this[_local3[_arg2].paramName] * _local3[_arg2].param);
} else {
if (_local3[_arg2].typeOp == 2){
this[_local3[_arg2].paramName] = _local3[_arg2].param;
};
};
};
if (this[(_local3[_arg2].paramName + "Max")]){
this[(_local3[_arg2].paramName + "Max")] = this[_local3[_arg2].paramName];
};
}
public function updateActor(){
var _local2:Boolean;
var _local3:Boolean;
var _local4:Boolean;
var _local5:Boolean;
var _local6:Boolean;
var _local7:Number;
if (dead){
return;
};
if (wepAcc > weapons[(curWeaponNum - 1)].accLo){
wepAcc = (wepAcc - weapons[(curWeaponNum - 1)].accDecSpeed);
if (wepAcc < weapons[(curWeaponNum - 1)].accLo){
wepAcc = weapons[(curWeaponNum - 1)].accLo;
};
};
if (Game(root).cursor.currentLabel == "wait"){
Game(root).cursor.pic.gotoAndStop(Math.round(((100 * (getTimer() - waitTimeBegin)) / (weapons[(curWeaponNum - 1)].reloadDelay + sounds.snd[(weapons[(curWeaponNum - 1)].type + "Reloaded")].length))));
};
var _local1:Point = curLevel.globalToLocal(new Point(Controls.mousePosX, Controls.mousePosY));
updateActorParts(new ageVector(_local1.x, _local1.y));
if ((((((((((((electroCurLevel == 0)) && (Controls.mouseKey))) && (!(timerBulletDelay.running)))) && (!(timerReloadDelay.running)))) && (!((((Controls.mousePosX > 483)) && ((Controls.mousePosY > 459))))))) && (!((((Controls.mousePosX > 619)) && ((Controls.mousePosY < 22))))))){
startShoot(new ageVector(_local1.x, _local1.y));
};
if (((((((Controls.key[82]) && (!(timerReloadDelay.running)))) && ((weapons[(curWeaponNum - 1)].bulletsInCatrige < weapons[(curWeaponNum - 1)].bulletsInCatrigeMax)))) && ((weapons[(curWeaponNum - 1)].bulletsNum > 0)))){
startReload();
};
_local2 = ((Controls.key[Keyboard.DOWN]) || (Controls.key[83]));
if (psyCurLevel != 0){
_local2 = ((Controls.key[Keyboard.UP]) || (Controls.key[87]));
};
_local3 = ((Controls.key[Keyboard.UP]) || (Controls.key[87]));
if (psyCurLevel != 0){
_local3 = ((Controls.key[Keyboard.DOWN]) || (Controls.key[83]));
};
_local4 = ((Controls.key[Keyboard.LEFT]) || (Controls.key[65]));
if (psyCurLevel != 0){
_local4 = ((Controls.key[Keyboard.RIGHT]) || (Controls.key[68]));
};
_local5 = ((Controls.key[Keyboard.RIGHT]) || (Controls.key[68]));
if (psyCurLevel != 0){
_local5 = ((Controls.key[Keyboard.LEFT]) || (Controls.key[65]));
};
if ((((((electroCurLevel == 0)) && (_local2))) && (!(jump)))){
jump = false;
sitting = true;
} else {
sitting = false;
if ((((((electroCurLevel == 0)) && (_local3))) && (!(jump)))){
jump = true;
speed.y = jumpSpeed;
};
_local6 = false;
if ((((electroCurLevel == 0)) && (_local4))){
if (scaleX < 0){
_local6 = false;
} else {
_local6 = true;
};
_local7 = (jump) ? ((speed.x * speedFactor) * 0.8) : (speed.x * speedFactor);
if (((_local6) && (!(jump)))){
_local7 = (_local7 * 0.5);
};
x = (x - _local7);
} else {
if ((((electroCurLevel == 0)) && (_local5))){
if (scaleX > 0){
_local6 = false;
} else {
_local6 = true;
};
_local7 = (jump) ? ((speed.x * speedFactor) * 0.8) : (speed.x * speedFactor);
if (((_local6) && (!(jump)))){
_local7 = (_local7 * 0.5);
};
x = (x + _local7);
};
};
};
updateRunJumpState(_local6);
oldX = x;
}
}
}//package main
Section 3
//adBoxClass (main.adBoxClass)
package main {
import flash.display.*;
public dynamic class adBoxClass extends MovieClip {
}
}//package main
Section 4
//addActorStruct (main.addActorStruct)
package main {
public class addActorStruct {
var posx:Number;
var posy:Number;
var strClass:String;
var orderZ:int;
public function addActorStruct(_arg1:Number, _arg2:Number, _arg3:String, _arg4:int){
posx = _arg1;
posy = _arg2;
strClass = _arg3;
orderZ = _arg4;
}
}
}//package main
Section 5
//ageMath (main.ageMath)
package main {
public dynamic class ageMath {
public static function trimToRange(_arg1:Number, _arg2:Number, _arg3:Number):Number{
return (((_arg1)>_arg3) ? _arg3 : ((_arg1)<_arg2) ? _arg2 : _arg1);
}
public static function getClosest(_arg1:Number, _arg2:Number, _arg3:Number):Number{
if (Math.abs((_arg1 - _arg2)) < Math.abs((_arg1 - _arg3))){
return (_arg2);
};
return (_arg3);
}
public static function inRange(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
return ((((_arg1 > _arg2)) && ((_arg1 < _arg3))));
}
public static function aproxEqual(_arg1:Number, _arg2:Number, _arg3:Number=1E-5):Boolean{
return ((Math.abs((_arg2 - _arg1)) <= _arg3));
}
public static function Random(_arg1:Number, _arg2:Number):Number{
return ((Math.round((Math.random() * (_arg2 - _arg1))) + _arg1));
}
public static function IsLinesCross(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number):Boolean{
var _local9:Number = (((_arg3 - _arg1) * (_arg6 - _arg8)) - ((_arg5 - _arg7) * (_arg4 - _arg2)));
if (_local9 == 0){
return (false);
};
var _local10:Number = (((_arg5 - _arg1) * (_arg6 - _arg8)) - ((_arg5 - _arg7) * (_arg6 - _arg2)));
var _local11:Number = (((_arg3 - _arg1) * (_arg6 - _arg2)) - ((_arg5 - _arg1) * (_arg4 - _arg2)));
var _local12:Number = (_local10 / _local9);
var _local13:Number = (_local11 / _local9);
if ((((((((_local12 >= 0)) && ((_local12 <= 1)))) && ((_local13 >= 0)))) && ((_local13 <= 1)))){
return (true);
};
return (false);
}
public static function RandomInt(_arg1:int, _arg2:int):int{
return (Math.round(Random(_arg1, _arg2)));
}
public static function Distance(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (Math.sqrt((((_arg1 - _arg3) * (_arg1 - _arg3)) + ((_arg2 - _arg4) * (_arg2 - _arg4)))));
}
public static function Lerp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
return ((_arg1 + (_arg3 * (_arg2 - _arg1))));
}
public static function RemapVal(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Number{
return ((_arg4 + (((_arg5 - _arg4) * (_arg1 - _arg2)) / (_arg3 - _arg2))));
}
public static function getLineCrossRect(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number):ageVector{
var _local9:Number;
var _local10:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:ageVector;
var _local11:Number = 0;
var _local12:Number = 1;
_local9 = (_arg3 - _arg1);
_local10 = (_arg4 - _arg2);
_local13 = -(_local9);
_local14 = _local9;
_local15 = -(_local10);
_local16 = _local10;
_local17 = (_arg1 - _arg5);
_local18 = (_arg7 - _arg1);
_local19 = (_arg2 - _arg6);
_local20 = (_arg8 - _arg2);
if ((((((((((_local13 == 0)) && ((_local17 < 0)))) || ((((_local14 == 0)) && ((_local18 < 0)))))) || ((((_local15 == 0)) && ((_local19 < 0)))))) || ((((_local16 == 0)) && ((_local20 < 0)))))){
return (null);
};
if (_local13 < 0){
_local21 = (_local17 / _local13);
_local11 = Math.max(_local11, _local21);
};
if (_local14 < 0){
_local22 = (_local18 / _local14);
_local11 = Math.max(_local11, _local22);
};
if (_local15 < 0){
_local23 = (_local19 / _local15);
_local11 = Math.max(_local11, _local23);
};
if (_local16 < 0){
_local24 = (_local20 / _local16);
_local11 = Math.max(_local11, _local24);
};
if (_local13 > 0){
_local21 = (_local17 / _local13);
_local12 = Math.min(_local12, _local21);
};
if (_local14 > 0){
_local22 = (_local18 / _local14);
_local12 = Math.min(_local12, _local22);
};
if (_local15 > 0){
_local23 = (_local19 / _local15);
_local12 = Math.min(_local12, _local23);
};
if (_local16 > 0){
_local24 = (_local20 / _local16);
_local12 = Math.min(_local12, _local24);
};
if (_local11 > _local12){
return (null);
};
if ((((_local11 == 0)) && ((_local12 == 1)))){
return (null);
};
if ((((((_local11 < _local12)) && (!((_local11 == 0))))) && (!((_local12 == 1))))){
_local25 = (_arg1 + (_local9 * _local11));
_local26 = (_arg2 + (_local10 * _local11));
_local27 = (_arg1 + (_local9 * _local12));
_local28 = (_arg2 + (_local10 * _local12));
_local29 = new ageVector();
if (Distance(_local25, _local26, _arg1, _arg2) < Distance(_local27, _local28, _arg1, _arg2)){
_local29.set(_local25, _local26);
return (_local29);
};
_local29.set(_local27, _local28);
return (_local29);
};
return (null);
}
public static function getLinesCross(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number):ageVector{
var _local14:ageVector;
var _local9:Number = (((_arg3 - _arg1) * (_arg6 - _arg8)) - ((_arg5 - _arg7) * (_arg4 - _arg2)));
if (_local9 == 0){
return (null);
};
var _local10:Number = (((_arg5 - _arg1) * (_arg6 - _arg8)) - ((_arg5 - _arg7) * (_arg6 - _arg2)));
var _local11:Number = (((_arg3 - _arg1) * (_arg6 - _arg2)) - ((_arg5 - _arg1) * (_arg4 - _arg2)));
var _local12:Number = (_local10 / _local9);
var _local13:Number = (_local11 / _local9);
if ((((((((_local12 >= 0)) && ((_local12 <= 1)))) && ((_local13 >= 0)))) && ((_local13 <= 1)))){
_local14 = new ageVector();
_local14.set(((_local12 * _arg3) + ((1 - _local12) * _arg1)), ((_local12 * _arg4) + ((1 - _local12) * _arg2)));
return (_local14);
};
return (null);
}
public static function DistanceVec(_arg1:ageVector, _arg2:ageVector):Number{
return (Distance(_arg1.x, _arg1.y, _arg2.x, _arg2.y));
}
}
}//package main
Section 6
//ageVector (main.ageVector)
package main {
public class ageVector {
var x:Number;
var y:Number;
public function ageVector(_arg1:Number=0, _arg2:Number=0){
x = _arg1;
y = _arg2;
}
function sub(_arg1:ageVector):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
}
function copy(_arg1:ageVector):void{
x = _arg1.x;
y = _arg1.y;
}
function getAngleDegNorm():Number{
var _local1:Number = ((Math.atan2(y, x) / Math.PI) * 180);
if (_local1 < 0){
_local1 = (360 + _local1);
} else {
if (_local1 >= 360){
_local1 = (_local1 - 360);
};
};
return (_local1);
}
function ProjOnScalar(_arg1:ageVector):Number{
return ((dot(_arg1) / _arg1.len()));
}
function dot(_arg1:ageVector):Number{
return (((x * _arg1.x) + (y * _arg1.y)));
}
function mulScalar(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
}
function getAngleNorm():Number{
var _local1:Number = Math.atan2(y, x);
if (_local1 < 0){
_local1 = ((Math.PI * 2) + _local1);
} else {
if (_local1 >= (Math.PI * 2)){
_local1 = (_local1 - (Math.PI * 2));
};
};
return (_local1);
}
function trimLen(_arg1:Number):void{
if (len2() > (_arg1 * _arg1)){
normThis();
mulScalar(_arg1);
};
}
function len():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
function rot(_arg1:Number):void{
var _local2:Number = x;
x = ((_local2 * Math.cos(_arg1)) - (y * Math.sin(_arg1)));
y = ((y * Math.cos(_arg1)) + (_local2 * Math.sin(_arg1)));
}
function setLen(_arg1:Number):void{
normThis();
mulScalar(_arg1);
}
function getAngle():Number{
return (Math.atan2(y, x));
}
function add(_arg1:ageVector):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
}
function set(_arg1:Number, _arg2:Number):void{
x = _arg1;
y = _arg2;
}
function getAngleDeg():Number{
return (((Math.atan2(y, x) / Math.PI) * 180));
}
function isEqual(_arg1:ageVector, _arg2:Number=1E-5):Boolean{
return (((ageMath.aproxEqual(x, _arg1.x, _arg2)) && (ageMath.aproxEqual(y, _arg1.y, _arg2))));
}
function rotDeg(_arg1:Number):void{
var _local2:Number = x;
var _local3:Number = ((_arg1 * Math.PI) / 180);
x = ((_local2 * Math.cos(_local3)) - (y * Math.sin(_local3)));
y = ((y * Math.cos(_local3)) + (_local2 * Math.sin(_local3)));
}
function lerpThis(_arg1:ageVector, _arg2:Number):void{
var _local3:ageVector = new ageVector();
_local3.copy(_arg1);
_local3.sub(this);
_local3.mulScalar(_arg2);
add(_local3);
}
function normThis():void{
var _local1:Number = len();
if (_local1){
x = (x / _local1);
y = (y / _local1);
};
}
function norm():ageVector{
var _local1:Number = len();
var _local2:ageVector = new ageVector(x, y);
if (_local1){
_local2.x = (_local2.x / _local1);
_local2.y = (_local2.y / _local1);
};
return (_local2);
}
function len2():Number{
return (((x * x) + (y * y)));
}
function ProjOnVec(_arg1:ageVector):ageVector{
var _local2:ageVector = _arg1.norm();
_local2.mulScalar(ProjOnScalar(_arg1));
return (_local2);
}
}
}//package main
Section 7
//AKShoot1 (main.AKShoot1)
package main {
import flash.media.*;
public dynamic class AKShoot1 extends Sound {
}
}//package main
Section 8
//AKShoot2 (main.AKShoot2)
package main {
import flash.media.*;
public dynamic class AKShoot2 extends Sound {
}
}//package main
Section 9
//AlienBigBoss (main.AlienBigBoss)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class AlienBigBoss extends actorObject {
public function AlienBigBoss(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("AlienBigBoss");
};
}
}
}//package main
Section 10
//alienBlasterShoot1 (main.alienBlasterShoot1)
package main {
import flash.media.*;
public dynamic class alienBlasterShoot1 extends Sound {
}
}//package main
Section 11
//alienBlasterShoot2 (main.alienBlasterShoot2)
package main {
import flash.media.*;
public dynamic class alienBlasterShoot2 extends Sound {
}
}//package main
Section 12
//AlienBomb (main.AlienBomb)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class AlienBomb extends actorObject {
public function AlienBomb(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.enemies.push(this);
initParams("AlienBomb");
};
}
}
}//package main
Section 13
//AlienBomber (main.AlienBomber)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class AlienBomber extends actorObject {
public function AlienBomber(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("AlienBomber");
};
}
}
}//package main
Section 14
//AlienElectro (main.AlienElectro)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class AlienElectro extends actorObject {
public function AlienElectro(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("AlienElectro");
};
}
}
}//package main
Section 15
//AlienHunter (main.AlienHunter)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class AlienHunter extends actorObject {
public function AlienHunter(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("AlienHunter");
};
}
}
}//package main
Section 16
//AlienHunterBlaster (main.AlienHunterBlaster)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class AlienHunterBlaster extends actorObject {
public function AlienHunterBlaster(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
if ((parent.parent as Level)){
curLevel = Level(parent.parent);
} else {
curLevel = Level(parent);
};
curLevel.enemies.push(this);
initParams("AlienHunterBlaster");
};
}
}
}//package main
Section 17
//AlienPredator (main.AlienPredator)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class AlienPredator extends actorObject {
public function AlienPredator(){
addFrameScript(0, frame1);
}
function frame1(){
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("AlienPredator");
};
}
}
}//package main
Section 18
//AlienSaw (main.AlienSaw)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class AlienSaw extends actorObject {
public function AlienSaw(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("AlienSaw");
};
}
}
}//package main
Section 19
//AlienSeeder (main.AlienSeeder)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class AlienSeeder extends actorObject {
public function AlienSeeder(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("AlienSeeder");
};
}
}
}//package main
Section 20
//AlienSolder (main.AlienSolder)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class AlienSolder extends actorObject {
public function AlienSolder(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("AlienSolder");
};
}
}
}//package main
Section 21
//alphaFader (main.alphaFader)
package main {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class alphaFader extends MovieClip {
var use_force_restart:Boolean;// = false
public var gamButWT:SimpleButton;
public var wep1:guiWepNum;
public var wep2:guiWepNum;
public var wep3:guiWepNum;
public var wep4:guiWepNum;
public var wep5:guiWepNum;
public var wep7:guiWepNum;
public var wep6:guiWepNum;
public var wep8:guiWepNum;
public var butYes:SimpleButton;
public var hazBio:MovieClip;
public var hazElectro:MovieClip;
public var fxblink2:fxblink;
public var txtMoney:TextField;
public var butNo:SimpleButton;
public var fadeSpeed:Number;// = 0.1
public var gamButMenu:SimpleButton;
public var dlgIco:dialogIco;
public var painFrame:PainFrame;
public var fadeMinLimit:Number;// = 0
public var wepInfo:MovieClip;
public var fxblink:fxblink;
public var itm1:MovieClip;
public var itm3:MovieClip;
public var itm4:MovieClip;
public var itm5:MovieClip;
public var itm0:MovieClip;
public var itm2:MovieClip;
public var hlpControl:hlpCtrl;
public var dlg:dialog;
public var fadeMaxLimit:Number;// = 1
public var hazPsy:MovieClip;
public var lifeBar:MovieClip;
public var fadingout:Boolean;// = false
public function alphaFader(){
fadingout = false;
addEventListener(Event.ENTER_FRAME, update, false, 0, true);
}
public function startFadeIn():void{
if (((!(ageMath.aproxEqual(alpha, fadeMinLimit))) && (!(use_force_restart)))){
return;
};
alpha = fadeMinLimit;
visible = true;
fadingout = false;
}
public function update(_arg1:Event):void{
if (visible){
if (fadingout){
if (alpha <= fadeMinLimit){
alpha = fadeMinLimit;
visible = false;
fadingout = false;
} else {
alpha = (alpha - fadeSpeed);
};
} else {
if (alpha >= fadeMaxLimit){
alpha = fadeMaxLimit;
} else {
alpha = (alpha + fadeSpeed);
};
};
};
}
public function clearAlphaFader(){
removeEventListener(Event.ENTER_FRAME, update);
}
public function startFadeOut():void{
if (((!(ageMath.aproxEqual(alpha, fadeMaxLimit))) && (!(use_force_restart)))){
return;
};
alpha = fadeMaxLimit;
visible = true;
fadingout = true;
}
}
}//package main
Section 22
//baseObject (main.baseObject)
package main {
public class baseObject extends alphaFader {
var life:Number;// = 0
var lifeMax:Number;// = 0
var paralaxX:Number;// = 0
var initIDE:Boolean;// = false
var saveX:Number;// = 0
var saveY:Number;// = 0
var paralaxY:Number;// = 0
}
}//package main
Section 23
//bg (main.bg)
package main {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.utils.*;
public class bg extends MovieClip {
var outputBitmapData:BitmapData;
var bgArray:Array;
public function bg(){
bgArray = new Array();
super();
outputBitmapData = new BitmapData(stage.stageWidth, stage.stageHeight, false, 0);
bgArray.push(new EarthRow01(424, 424));
var _local1:Bitmap = new Bitmap(outputBitmapData);
addChild(_local1);
}
public function changeBG(_arg1:Number, _arg2:Number):void{
outputBitmapData.lock();
var _local3:Number = 0;
var _local4:Number = 0;
var _local5:Number = ((_arg1 / 1) - (int(((_arg1 / 1) / 424)) * 424));
var _local6:Number = ((_arg2 / 1) - (int(((_arg2 / 1) / 424)) * 424));
_local3 = (_local5 - 424);
while (_local3 <= stage.stageWidth) {
_local4 = (_local6 - 424);
while (_local4 <= stage.stageHeight) {
outputBitmapData.copyPixels(bgArray[0], new Rectangle(0, 0, 424, 424), new Point(_local3, _local4));
_local4 = (_local4 + 424);
};
_local3 = (_local3 + 424);
};
outputBitmapData.unlock();
}
}
}//package main
Section 24
//bigExp (main.bigExp)
package main {
import flash.media.*;
public dynamic class bigExp extends Sound {
}
}//package main
Section 25
//blasterProj (main.blasterProj)
package main {
public dynamic class blasterProj extends projObject {
}
}//package main
Section 26
//bloodLeak (main.bloodLeak)
package main {
public dynamic class bloodLeak extends fxObject {
public function bloodLeak(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package main
Section 27
//bloodOnGround (main.bloodOnGround)
package main {
public dynamic class bloodOnGround extends fxObject {
public function bloodOnGround(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main
Section 28
//bodyBlood1 (main.bodyBlood1)
package main {
import flash.media.*;
public dynamic class bodyBlood1 extends Sound {
}
}//package main
Section 29
//bodyBlood2 (main.bodyBlood2)
package main {
import flash.media.*;
public dynamic class bodyBlood2 extends Sound {
}
}//package main
Section 30
//bodyBlood3 (main.bodyBlood3)
package main {
import flash.media.*;
public dynamic class bodyBlood3 extends Sound {
}
}//package main
Section 31
//bodyFall1 (main.bodyFall1)
package main {
import flash.media.*;
public dynamic class bodyFall1 extends Sound {
}
}//package main
Section 32
//bodyFall2 (main.bodyFall2)
package main {
import flash.media.*;
public dynamic class bodyFall2 extends Sound {
}
}//package main
Section 33
//bodyFall3 (main.bodyFall3)
package main {
import flash.media.*;
public dynamic class bodyFall3 extends Sound {
}
}//package main
Section 34
//bodyFall4 (main.bodyFall4)
package main {
import flash.media.*;
public dynamic class bodyFall4 extends Sound {
}
}//package main
Section 35
//bomb2 (main.bomb2)
package main {
import flash.media.*;
public dynamic class bomb2 extends Sound {
}
}//package main
Section 36
//bombExp (main.bombExp)
package main {
import flash.media.*;
public dynamic class bombExp extends Sound {
}
}//package main
Section 37
//brickWall3x_paralax (main.brickWall3x_paralax)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class brickWall3x_paralax extends baseObject {
public function brickWall3x_paralax(){
addFrameScript(0, frame1);
}
function frame1(){
if (!initIDE){
paralaxX = 180;
paralaxY = 40;
saveX = x;
saveY = y;
Level(parent).paralaxObjects.push(this);
};
}
}
}//package main
Section 38
//cocking (main.cocking)
package main {
import flash.media.*;
public dynamic class cocking extends Sound {
}
}//package main
Section 39
//Coin1 (main.Coin1)
package main {
import flash.media.*;
public dynamic class Coin1 extends Sound {
}
}//package main
Section 40
//Coin2 (main.Coin2)
package main {
import flash.media.*;
public dynamic class Coin2 extends Sound {
}
}//package main
Section 41
//ColorMatrix (main.ColorMatrix)
package main {
import flash.filters.*;
public class ColorMatrix {
public var matrix:Array;
private var preHue:ColorMatrix;
private var postHue:ColorMatrix;
private var hueInitialized:Boolean;
private static const ONETHIRD:Number = 0.333333333333333;
private static const LUMA_G:Number = 0.71516;
private static const LUMA_B:Number = 0.072169;
private static const LUMA_R2:Number = 0.3086;
private static const LUMA_G2:Number = 0.6094;
private static const LUMA_R:Number = 0.212671;
private static const LUMA_B2:Number = 0.082;
private static const RAD:Number = (Math.PI / 180);
private static const IDENTITY:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
public static const COLOR_DEFICIENCY_TYPES:Array = ["Protanopia", "Protanomaly", "Deuteranopia", "Deuteranomaly", "Tritanopia", "Tritanomaly", "Achromatopsia", "Achromatomaly"];
public function ColorMatrix(_arg1:Object=null){
if ((_arg1 is ColorMatrix)){
matrix = _arg1.matrix.concat();
} else {
if ((_arg1 is Array)){
matrix = _arg1.concat();
} else {
reset();
};
};
}
public function adjustBrightness(_arg1:Number, _arg2:Number=NaN, _arg3:Number=NaN):void{
if (isNaN(_arg2)){
_arg2 = _arg1;
};
if (isNaN(_arg3)){
_arg3 = _arg1;
};
concat([1, 0, 0, 0, _arg1, 0, 1, 0, 0, _arg2, 0, 0, 1, 0, _arg3, 0, 0, 0, 1, 0]);
}
public function averageRGB2Alpha():void{
concat([0, 0, 0, 0, 0xFF, 0, 0, 0, 0, 0xFF, 0, 0, 0, 0, 0xFF, ONETHIRD, ONETHIRD, ONETHIRD, 0, 0]);
}
public function luminance2Alpha():void{
concat([0, 0, 0, 0, 0xFF, 0, 0, 0, 0, 0xFF, 0, 0, 0, 0, 0xFF, LUMA_R, LUMA_G, LUMA_B, 0, 0]);
}
public function rotateRed(_arg1:Number):void{
rotateColor(_arg1, 2, 1);
}
public function get filter():ColorMatrixFilter{
return (new ColorMatrixFilter(matrix));
}
public function adjustSaturation(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = (1 - _arg1);
_local3 = (_local2 * LUMA_R);
_local4 = (_local2 * LUMA_G);
_local5 = (_local2 * LUMA_B);
concat([(_local3 + _arg1), _local4, _local5, 0, 0, _local3, (_local4 + _arg1), _local5, 0, 0, _local3, _local4, (_local5 + _arg1), 0, 0, 0, 0, 0, 1, 0]);
}
public function adjustAlphaContrast(_arg1:Number):void{
_arg1 = (_arg1 + 1);
concat([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, _arg1, (128 * (1 - _arg1))]);
}
public function reset():void{
matrix = IDENTITY.concat();
}
public function blend(_arg1:ColorMatrix, _arg2:Number):void{
var _local3:Number = (1 - _arg2);
var _local4:int;
while (_local4 < 20) {
matrix[_local4] = ((_local3 * Number(matrix[_local4])) + (_arg2 * Number(_arg1.matrix[_local4])));
_local4++;
};
}
public function setChannels(_arg1:int=1, _arg2:int=2, _arg3:int=4, _arg4:int=8):void{
var _local5:Number = (((((((_arg1 & 1) == 1)) ? 1 : ((0 + ((_arg1 & 2) == 2))) ? 1 : 0 + ((_arg1 & 4) == 4))) ? 1 : 0 + ((_arg1 & 8) == 8))) ? 1 : 0;
if (_local5 > 0){
_local5 = (1 / _local5);
};
var _local6:Number = (((((((_arg2 & 1) == 1)) ? 1 : ((0 + ((_arg2 & 2) == 2))) ? 1 : 0 + ((_arg2 & 4) == 4))) ? 1 : 0 + ((_arg2 & 8) == 8))) ? 1 : 0;
if (_local6 > 0){
_local6 = (1 / _local6);
};
var _local7:Number = (((((((_arg3 & 1) == 1)) ? 1 : ((0 + ((_arg3 & 2) == 2))) ? 1 : 0 + ((_arg3 & 4) == 4))) ? 1 : 0 + ((_arg3 & 8) == 8))) ? 1 : 0;
if (_local7 > 0){
_local7 = (1 / _local7);
};
var _local8:Number = (((((((_arg4 & 1) == 1)) ? 1 : ((0 + ((_arg4 & 2) == 2))) ? 1 : 0 + ((_arg4 & 4) == 4))) ? 1 : 0 + ((_arg4 & 8) == 8))) ? 1 : 0;
if (_local8 > 0){
_local8 = (1 / _local8);
};
concat([(((_arg1 & 1) == 1)) ? _local5 : 0, (((_arg1 & 2) == 2)) ? _local5 : 0, (((_arg1 & 4) == 4)) ? _local5 : 0, (((_arg1 & 8) == 8)) ? _local5 : 0, 0, (((_arg2 & 1) == 1)) ? _local6 : 0, (((_arg2 & 2) == 2)) ? _local6 : 0, (((_arg2 & 4) == 4)) ? _local6 : 0, (((_arg2 & 8) == 8)) ? _local6 : 0, 0, (((_arg3 & 1) == 1)) ? _local7 : 0, (((_arg3 & 2) == 2)) ? _local7 : 0, (((_arg3 & 4) == 4)) ? _local7 : 0, (((_arg3 & 8) == 8)) ? _local7 : 0, 0, (((_arg4 & 1) == 1)) ? _local8 : 0, (((_arg4 & 2) == 2)) ? _local8 : 0, (((_arg4 & 4) == 4)) ? _local8 : 0, (((_arg4 & 8) == 8)) ? _local8 : 0, 0]);
}
public function randomize(_arg1:Number=1):void{
var _local2:Number = (1 - _arg1);
var _local3:Number = (_local2 + (_arg1 * (Math.random() - Math.random())));
var _local4:Number = (_arg1 * (Math.random() - Math.random()));
var _local5:Number = (_arg1 * (Math.random() - Math.random()));
var _local6:Number = ((_arg1 * 0xFF) * (Math.random() - Math.random()));
var _local7:Number = (_arg1 * (Math.random() - Math.random()));
var _local8:Number = (_local2 + (_arg1 * (Math.random() - Math.random())));
var _local9:Number = (_arg1 * (Math.random() - Math.random()));
var _local10:Number = ((_arg1 * 0xFF) * (Math.random() - Math.random()));
var _local11:Number = (_arg1 * (Math.random() - Math.random()));
var _local12:Number = (_arg1 * (Math.random() - Math.random()));
var _local13:Number = (_local2 + (_arg1 * (Math.random() - Math.random())));
var _local14:Number = ((_arg1 * 0xFF) * (Math.random() - Math.random()));
concat([_local3, _local4, _local5, 0, _local6, _local7, _local8, _local9, 0, _local10, _local11, _local12, _local13, 0, _local14, 0, 0, 0, 1, 0]);
}
public function concat(_arg1:Array):void{
var _local4:int;
var _local5:int;
var _local2:Array = [];
var _local3:int;
_local5 = 0;
while (_local5 < 4) {
_local4 = 0;
while (_local4 < 5) {
_local2[int((_local3 + _local4))] = (((((Number(_arg1[_local3]) * Number(matrix[_local4])) + (Number(_arg1[int((_local3 + 1))]) * Number(matrix[int((_local4 + 5))]))) + (Number(_arg1[int((_local3 + 2))]) * Number(matrix[int((_local4 + 10))]))) + (Number(_arg1[int((_local3 + 3))]) * Number(matrix[int((_local4 + 15))]))) + ((_local4 == 4)) ? Number(_arg1[int((_local3 + 4))]) : 0);
_local4++;
};
_local3 = (_local3 + 5);
_local5++;
};
matrix = _local2;
}
public function invert():void{
concat([-1, 0, 0, 0, 0xFF, 0, -1, 0, 0, 0xFF, 0, 0, -1, 0, 0xFF, 0, 0, 0, 1, 0]);
}
private function rotateColor(_arg1:Number, _arg2:int, _arg3:int):void{
_arg1 = (_arg1 * RAD);
var _local4:Array = IDENTITY.concat();
_local4[(_arg2 + (_arg2 * 5))] = (_local4[(_arg3 + (_arg3 * 5))] = Math.cos(_arg1));
_local4[(_arg3 + (_arg2 * 5))] = Math.sin(_arg1);
_local4[(_arg2 + (_arg3 * 5))] = -(Math.sin(_arg1));
concat(_local4);
}
public function colorize(_arg1:int, _arg2:Number=1):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = (((_arg1 >> 16) & 0xFF) / 0xFF);
_local4 = (((_arg1 >> 8) & 0xFF) / 0xFF);
_local5 = ((_arg1 & 0xFF) / 0xFF);
_local6 = (1 - _arg2);
concat([(_local6 + ((_arg2 * _local3) * LUMA_R)), ((_arg2 * _local3) * LUMA_G), ((_arg2 * _local3) * LUMA_B), 0, 0, ((_arg2 * _local4) * LUMA_R), (_local6 + ((_arg2 * _local4) * LUMA_G)), ((_arg2 * _local4) * LUMA_B), 0, 0, ((_arg2 * _local5) * LUMA_R), ((_arg2 * _local5) * LUMA_G), (_local6 + ((_arg2 * _local5) * LUMA_B)), 0, 0, 0, 0, 0, 1, 0]);
}
public function rgb2Alpha(_arg1:Number, _arg2:Number, _arg3:Number):void{
concat([0, 0, 0, 0, 0xFF, 0, 0, 0, 0, 0xFF, 0, 0, 0, 0, 0xFF, _arg1, _arg2, _arg3, 0, 0]);
}
private function shearColor(_arg1:int, _arg2:int, _arg3:Number, _arg4:int, _arg5:Number):void{
var _local6:Array = IDENTITY.concat();
_local6[(_arg2 + (_arg1 * 5))] = _arg3;
_local6[(_arg4 + (_arg1 * 5))] = _arg5;
concat(_local6);
}
public function shearBlue(_arg1:Number, _arg2:Number):void{
shearColor(2, 0, _arg1, 1, _arg2);
}
public function setAlpha(_arg1:Number):void{
concat([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, _arg1, 0]);
}
public function rotateHue(_arg1:Number):void{
initHue();
concat(preHue.matrix);
rotateBlue(_arg1);
concat(postHue.matrix);
}
public function applyMatrix(_arg1:uint):uint{
var _local2:Number = ((_arg1 >>> 24) & 0xFF);
var _local3:Number = ((_arg1 >>> 16) & 0xFF);
var _local4:Number = ((_arg1 >>> 8) & 0xFF);
var _local5:Number = (_arg1 & 0xFF);
var _local6:int = (((((0.5 + (_local3 * matrix[0])) + (_local4 * matrix[1])) + (_local5 * matrix[2])) + (_local2 * matrix[3])) + matrix[4]);
var _local7:int = (((((0.5 + (_local3 * matrix[5])) + (_local4 * matrix[6])) + (_local5 * matrix[7])) + (_local2 * matrix[8])) + matrix[9]);
var _local8:int = (((((0.5 + (_local3 * matrix[10])) + (_local4 * matrix[11])) + (_local5 * matrix[12])) + (_local2 * matrix[13])) + matrix[14]);
var _local9:int = (((((0.5 + (_local3 * matrix[15])) + (_local4 * matrix[16])) + (_local5 * matrix[17])) + (_local2 * matrix[18])) + matrix[19]);
if (_local9 < 0){
_local9 = 0;
};
if (_local9 > 0xFF){
_local9 = 0xFF;
};
if (_local6 < 0){
_local6 = 0;
};
if (_local6 > 0xFF){
_local6 = 0xFF;
};
if (_local7 < 0){
_local7 = 0;
};
if (_local7 > 0xFF){
_local7 = 0xFF;
};
if (_local8 < 0){
_local8 = 0;
};
if (_local8 > 0xFF){
_local8 = 0xFF;
};
return (((((_local9 << 24) | (_local6 << 16)) | (_local7 << 8)) | _local8));
}
private function initHue():void{
var _local2:Array;
var _local3:Number;
var _local4:Number;
var _local1:Number = 39.182655;
if (!hueInitialized){
hueInitialized = true;
preHue = new ColorMatrix();
preHue.rotateRed(45);
preHue.rotateGreen(-(_local1));
_local2 = [LUMA_R2, LUMA_G2, LUMA_B2, 1];
preHue.transformVector(_local2);
_local3 = (_local2[0] / _local2[2]);
_local4 = (_local2[1] / _local2[2]);
preHue.shearBlue(_local3, _local4);
postHue = new ColorMatrix();
postHue.shearBlue(-(_local3), -(_local4));
postHue.rotateGreen(_local1);
postHue.rotateRed(-45);
};
}
public function shearGreen(_arg1:Number, _arg2:Number):void{
shearColor(1, 0, _arg1, 2, _arg2);
}
public function shearRed(_arg1:Number, _arg2:Number):void{
shearColor(0, 1, _arg1, 2, _arg2);
}
public function average(_arg1:Number=0.333333333333333, _arg2:Number=0.333333333333333, _arg3:Number=0.333333333333333):void{
concat([_arg1, _arg2, _arg3, 0, 0, _arg1, _arg2, _arg3, 0, 0, _arg1, _arg2, _arg3, 0, 0, 0, 0, 0, 1, 0]);
}
public function transformVector(_arg1:Array):void{
if (_arg1.length != 4){
return;
};
var _local2:Number = (((((_arg1[0] * matrix[0]) + (_arg1[1] * matrix[1])) + (_arg1[2] * matrix[2])) + (_arg1[3] * matrix[3])) + matrix[4]);
var _local3:Number = (((((_arg1[0] * matrix[5]) + (_arg1[1] * matrix[6])) + (_arg1[2] * matrix[7])) + (_arg1[3] * matrix[8])) + matrix[9]);
var _local4:Number = (((((_arg1[0] * matrix[10]) + (_arg1[1] * matrix[11])) + (_arg1[2] * matrix[12])) + (_arg1[3] * matrix[13])) + matrix[14]);
var _local5:Number = (((((_arg1[0] * matrix[15]) + (_arg1[1] * matrix[16])) + (_arg1[2] * matrix[17])) + (_arg1[3] * matrix[18])) + matrix[19]);
_arg1[0] = _local2;
_arg1[1] = _local3;
_arg1[2] = _local4;
_arg1[3] = _local5;
}
public function invertAlpha():void{
concat([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, -1, 0xFF]);
}
public function adjustHue(_arg1:Number):void{
_arg1 = (_arg1 * RAD);
var _local2:Number = Math.cos(_arg1);
var _local3:Number = Math.sin(_arg1);
concat([((LUMA_R + (_local2 * (1 - LUMA_R))) + (_local3 * -(LUMA_R))), ((LUMA_G + (_local2 * -(LUMA_G))) + (_local3 * -(LUMA_G))), ((LUMA_B + (_local2 * -(LUMA_B))) + (_local3 * (1 - LUMA_B))), 0, 0, ((LUMA_R + (_local2 * -(LUMA_R))) + (_local3 * 0.143)), ((LUMA_G + (_local2 * (1 - LUMA_G))) + (_local3 * 0.14)), ((LUMA_B + (_local2 * -(LUMA_B))) + (_local3 * -0.283)), 0, 0, ((LUMA_R + (_local2 * -(LUMA_R))) + (_local3 * -((1 - LUMA_R)))), ((LUMA_G + (_local2 * -(LUMA_G))) + (_local3 * LUMA_G)), ((LUMA_B + (_local2 * (1 - LUMA_B))) + (_local3 * LUMA_B)), 0, 0, 0, 0, 0, 1, 0]);
}
public function threshold(_arg1:Number, _arg2:Number=0x0100):void{
concat([(LUMA_R * _arg2), (LUMA_G * _arg2), (LUMA_B * _arg2), 0, (-(_arg2) * _arg1), (LUMA_R * _arg2), (LUMA_G * _arg2), (LUMA_B * _arg2), 0, (-(_arg2) * _arg1), (LUMA_R * _arg2), (LUMA_G * _arg2), (LUMA_B * _arg2), 0, (-(_arg2) * _arg1), 0, 0, 0, 1, 0]);
}
public function clone():ColorMatrix{
return (new ColorMatrix(matrix));
}
public function rotateBlue(_arg1:Number):void{
rotateColor(_arg1, 1, 0);
}
public function rotateGreen(_arg1:Number):void{
rotateColor(_arg1, 0, 2);
}
public function desaturate():void{
concat([LUMA_R, LUMA_G, LUMA_B, 0, 0, LUMA_R, LUMA_G, LUMA_B, 0, 0, LUMA_R, LUMA_G, LUMA_B, 0, 0, 0, 0, 0, 1, 0]);
}
public function adjustContrast(_arg1:Number, _arg2:Number=NaN, _arg3:Number=NaN):void{
if (isNaN(_arg2)){
_arg2 = _arg1;
};
if (isNaN(_arg3)){
_arg3 = _arg1;
};
_arg1 = (_arg1 + 1);
_arg2 = (_arg2 + 1);
_arg3 = (_arg3 + 1);
concat([_arg1, 0, 0, 0, (128 * (1 - _arg1)), 0, _arg2, 0, 0, (128 * (1 - _arg2)), 0, 0, _arg3, 0, (128 * (1 - _arg3)), 0, 0, 0, 1, 0]);
}
public function setMultiplicators(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1):void{
var _local5:Array = new Array(_arg1, 0, 0, 0, 0, 0, _arg2, 0, 0, 0, 0, 0, _arg3, 0, 0, 0, 0, 0, _arg4, 0);
concat(_local5);
}
public function thresholdAlpha(_arg1:Number, _arg2:Number=0x0100):void{
concat([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, _arg2, (-(_arg2) * _arg1)]);
}
public function clearChannels(_arg1:Boolean=false, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Boolean=false):void{
if (_arg1){
matrix[0] = (matrix[1] = (matrix[2] = (matrix[3] = (matrix[4] = 0))));
};
if (_arg2){
matrix[5] = (matrix[6] = (matrix[7] = (matrix[8] = (matrix[9] = 0))));
};
if (_arg3){
matrix[10] = (matrix[11] = (matrix[12] = (matrix[13] = (matrix[14] = 0))));
};
if (_arg4){
matrix[15] = (matrix[16] = (matrix[17] = (matrix[18] = (matrix[19] = 0))));
};
}
public function applyColorDeficiency(_arg1:String):void{
switch (_arg1){
case "Protanopia":
concat([0.567, 0.433, 0, 0, 0, 0.558, 0.442, 0, 0, 0, 0, 0.242, 0.758, 0, 0, 0, 0, 0, 1, 0]);
break;
case "Protanomaly":
concat([0.817, 0.183, 0, 0, 0, 0.333, 0.667, 0, 0, 0, 0, 0.125, 0.875, 0, 0, 0, 0, 0, 1, 0]);
break;
case "Deuteranopia":
concat([0.625, 0.375, 0, 0, 0, 0.7, 0.3, 0, 0, 0, 0, 0.3, 0.7, 0, 0, 0, 0, 0, 1, 0]);
break;
case "Deuteranomaly":
concat([0.8, 0.2, 0, 0, 0, 0.258, 0.742, 0, 0, 0, 0, 0.142, 0.858, 0, 0, 0, 0, 0, 1, 0]);
break;
case "Tritanopia":
concat([0.95, 0.05, 0, 0, 0, 0, 0.433, 0.567, 0, 0, 0, 0.475, 0.525, 0, 0, 0, 0, 0, 1, 0]);
break;
case "Tritanomaly":
concat([0.967, 0.033, 0, 0, 0, 0, 0.733, 0.267, 0, 0, 0, 0.183, 0.817, 0, 0, 0, 0, 0, 1, 0]);
break;
case "Achromatopsia":
concat([0.299, 0.587, 0.114, 0, 0, 0.299, 0.587, 0.114, 0, 0, 0.299, 0.587, 0.114, 0, 0, 0, 0, 0, 1, 0]);
break;
case "Achromatomaly":
concat([0.618, 0.32, 0.062, 0, 0, 0.163, 0.775, 0.062, 0, 0, 0.163, 0.32, 0.516, 0, 0, 0, 0, 0, 1, 0]);
break;
};
}
}
}//package main
Section 42
//Controls (main.Controls)
package main {
import flash.events.*;
import flash.ui.*;
public dynamic class Controls {
public static var keyNew:Array = new Array(0x0100);
public static var curReg;
public static var mousePosX:Number;
public static var mousePosY:Number;
public static var mouseGlobalPosX:Number;
public static var mouseGlobalPosY:Number;
public static var mouseKey:Boolean;
public static var key:Array = new Array(0x0100);
public static function unregMC(){
curReg.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMove);
curReg.removeEventListener(MouseEvent.MOUSE_UP, mouseUp);
curReg.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
curReg.removeEventListener(KeyboardEvent.KEY_UP, keyUp);
curReg.removeEventListener(KeyboardEvent.KEY_DOWN, keyDown);
curReg = null;
}
public static function keyUp(_arg1:KeyboardEvent){
key[_arg1.keyCode] = false;
}
public static function mouseDown(_arg1:MouseEvent):void{
mouseKey = true;
}
public static function mouseUp(_arg1:MouseEvent):void{
mouseKey = false;
}
public static function keyDown(_arg1:KeyboardEvent){
key[_arg1.keyCode] = true;
keyNew[_arg1.keyCode] = true;
}
public static function mouseMove(_arg1:MouseEvent):void{
mousePosX = _arg1.stageX;
mousePosY = _arg1.stageY;
mouseGlobalPosX = (mousePosX - curReg.x);
mouseGlobalPosY = (mousePosY - curReg.y);
}
public static function updateKeyNew(){
var _local1:int;
_local1 = 0;
while (_local1 < 0x0100) {
keyNew[_local1] = false;
_local1++;
};
}
public static function regMC(_arg1){
curReg = _arg1;
_arg1.addEventListener(MouseEvent.MOUSE_MOVE, mouseMove);
_arg1.addEventListener(MouseEvent.MOUSE_UP, mouseUp);
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyUp);
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);
}
}
}//package main
Section 43
//Cookie (main.Cookie)
package main {
import flash.net.*;
public class Cookie {
private var _name:String;
private var _so:SharedObject;
public function Cookie(_arg1:String="tempCookie"){
_name = _arg1;
_so = SharedObject.getLocal(_arg1, "/");
}
public function getName():String{
return (_name);
}
public function isKeyExist(_arg1:String):Boolean{
_arg1 = ("key_" + _arg1);
return (((!((_so.data.cookie == undefined))) && (!((_so.data.cookie[_arg1] == undefined)))));
}
public function putNoFlush(_arg1:String, _arg2):void{
var _local3:Object;
_arg1 = ("key_" + _arg1);
if (_so.data.cookie == undefined){
_local3 = {};
_local3[_arg1] = _arg2;
_so.data.cookie = _local3;
} else {
_so.data.cookie[_arg1] = _arg2;
};
}
public function remove(_arg1:String):void{
if (isKeyExist(_arg1)){
delete _so.data.cookie[("key_" + _arg1)];
_so.flush();
};
}
public function clear():void{
_so.clear();
}
public function flushData():void{
_so.flush();
}
public function put(_arg1:String, _arg2):void{
var _local3:Object;
_arg1 = ("key_" + _arg1);
if (_so.data.cookie == undefined){
_local3 = {};
_local3[_arg1] = _arg2;
_so.data.cookie = _local3;
} else {
_so.data.cookie[_arg1] = _arg2;
};
_so.flush();
}
public function get(_arg1:String):Object{
return ((isKeyExist(_arg1)) ? _so.data.cookie[("key_" + _arg1)] : null);
}
public function getSize():uint{
return (_so.size);
}
public function isExist():Boolean{
return (!((getSize() == 0)));
}
}
}//package main
Section 44
//damageMarker (main.damageMarker)
package main {
import flash.display.*;
public dynamic class damageMarker extends MovieClip {
public function damageMarker(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package main
Section 45
//dialog (main.dialog)
package main {
import flash.display.*;
import flash.text.*;
public dynamic class dialog extends alphaFader {
public var txtSpeech:TextField;
public var pic:MovieClip;
public var txtName:TextField;
public function dialog(){
visible = false;
fadeSpeed = 0.03;
use_force_restart = true;
}
public function setTo(_arg1:String):int{
if (_arg1 == "lev1_Ted01"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "Hey, you look like a bloody steak.";
} else {
if (_arg1 == "lev1_InjMan01"){
pic.gotoAndStop("injMan");
txtName.text = "Injured Man:";
txtSpeech.text = "My game is over...\nTake this shotgun. I hope you are luckier than me...";
} else {
if (_arg1 == "lev1_TedBrain"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "I think they want to eat my brains.";
} else {
if (_arg1 == "lev1_TedMus"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "Music in my head has changed... Now I guess is something gonna happen.";
} else {
if (_arg1 == "lev1_TedDiff"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "I thought it'll be more difficult.";
};
};
};
};
};
if (_arg1 == "lev2_OldManTed01"){
pic.gotoAndStop("oldMan");
txtName.text = "Old Man:";
txtSpeech.text = "Help me! Please! ";
} else {
if (_arg1 == "lev2_OldManTed02"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "What's the matter? ";
} else {
if (_arg1 == "lev2_OldManTed03"){
pic.gotoAndStop("oldMan");
txtName.text = "Old Man:";
txtSpeech.text = "Alien robots! They are coming! ";
} else {
if (_arg1 == "lev2_OldManTed04"){
pic.gotoAndStop("oldMan");
txtName.text = "Old Man:";
txtSpeech.text = "Thanks, brave man!.. I'm so hungry... can you find some food for me?";
} else {
if (_arg1 == "lev2_OldManTed05"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "Do I look like a delivery service?";
} else {
if (_arg1 == "lev2_OldManTed06"){
pic.gotoAndStop("oldMan");
txtName.text = "Old Man:";
txtSpeech.text = "I'll give you something useful!";
} else {
if (_arg1 == "lev2_OldManTed07"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "Your fear for example?";
} else {
if (_arg1 == "lev2_OldManTed08"){
pic.gotoAndStop("oldMan");
txtName.text = "Old Man:";
txtSpeech.text = "Thanks for food! Now I won't die from hunger.";
} else {
if (_arg1 == "lev2_OldManTed09"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "You said that you'll give me something useful.";
} else {
if (_arg1 == "lev2_OldManTed10"){
pic.gotoAndStop("oldMan");
txtName.text = "Old Man:";
txtSpeech.text = "Of course! Take this dynamite. I found it in the basement.";
} else {
if (_arg1 == "lev2_TedScrap"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "I can sell all this scrap metal and make a few bucks.";
} else {
if (_arg1 == "lev2_TedObst"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "The obstacle... how to overcome it?";
} else {
if (_arg1 == "lev2_TedAK"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "Serious gun for the serious guy.";
};
};
};
};
};
};
};
};
};
};
};
};
};
if (_arg1 == "lev3_TedALienKilled"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "Good alien is a dead alien!";
} else {
if (_arg1 == "lev3_TedDate"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "This zombie girl looks cute. Maybe I should date her?";
} else {
if (_arg1 == "lev3_TedPreBoss"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "Damn, what is this?";
} else {
if (_arg1 == "lev3_TedPreBoss"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "Damn, what is this?";
} else {
if (_arg1 == "lev3_TedPostBoss"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "Yeah, great fireworks. Very impressive.";
};
};
};
};
};
if (_arg1 == "lev4_TedElevatorEnd"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "I no longer need this gas mask.";
} else {
if (_arg1 == "lev4_TedBio"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "This gas smells like a shit. I need to find some protection.";
};
};
if (_arg1 == "lev5_TedValve"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "My childhood mania: when I see a valve - I turn it.";
} else {
if (_arg1 == "lev5_TedBio"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "Oh, not this shit again....";
} else {
if (_arg1 == "lev5_BunkerManTed01"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "Hey! Can you open this door?";
} else {
if (_arg1 == "lev5_BunkerManTed02"){
pic.gotoAndStop("bunkerManNude");
txtName.text = "Technician:";
txtSpeech.text = "C-c-cold... v-v-ver-y-y c-c-cold...";
};
};
};
};
if (_arg1 == "lev5_BunkerManTed03"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "Hm, nice... ";
} else {
if (_arg1 == "lev5_BunkerManTed04"){
pic.gotoAndStop("bunkerManCloth");
txtName.text = "Technician:";
txtSpeech.text = "Thanks! ";
};
};
if (_arg1 == "lev5_BunkerManTed05"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "Now open the door.";
} else {
if (_arg1 == "lev5_BunkerManTed06"){
pic.gotoAndStop("bunkerManCloth");
txtName.text = "Technician:";
txtSpeech.text = "So... the password... A-N-E-G-M-E-T-E-X... done!";
} else {
if (_arg1 == "lev5_BunkerManTed07"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "Better late than never.";
} else {
if (_arg1 == "lev5_TedRock"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "Let's ROCK!";
};
};
};
};
if (_arg1 == "lev6_TedBigAss"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "Get out, Big Ass!";
} else {
if (_arg1 == "lev6_TedBarney01"){
pic.gotoAndStop("Barny");
txtName.text = "Barney:";
txtSpeech.text = "Holy shit, this is a human!";
} else {
if (_arg1 == "lev6_TedBarney02"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "Yeah, my name is Ted. Now, can we get out of here?";
} else {
if (_arg1 == "lev6_TedBarney03"){
pic.gotoAndStop("Barny");
txtName.text = "Barney:";
txtSpeech.text = "I'm Barney. We can, but if you find a little bit of fuel. Also take this blaster. It's damn good!";
} else {
if (_arg1 == "lev6_TedBarney04"){
pic.gotoAndStop("Barny");
txtName.text = "Barney:";
txtSpeech.text = "You got a fuel. OK, now we can go.";
};
};
};
};
};
if (_arg1 == "lev7_TedBarney01"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "Ammo is falling from the heaven!";
} else {
if (_arg1 == "lev7_TedBarney02"){
pic.gotoAndStop("Barny");
txtName.text = "Barney:";
txtSpeech.text = "God bless us, Ted!";
} else {
if (_arg1 == "lev7_TedBarney03"){
pic.gotoAndStop("Barny");
txtName.text = "Barney:";
txtSpeech.text = "What's the hell is that?!";
} else {
if (_arg1 == "lev7_TedBarney04"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "Die! Die! Die! ";
} else {
if (_arg1 == "lev7_TedBarney05"){
pic.gotoAndStop("Barny");
txtName.text = "Barney:";
txtSpeech.text = "You saved our asses! ";
};
};
};
};
};
if (_arg1 == "lev8_TedCool"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "Damn, I rule! ";
} else {
if (_arg1 == "lev8_BarneyLuck"){
pic.gotoAndStop("Barny");
txtName.text = "Barney:";
txtSpeech.text = "Good luck, Ted. ";
};
};
if (_arg1 == "lev10_TedEvil"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "Alien Boss is very close. I feel it.";
} else {
if (_arg1 == "lev10_TedVoc"){
pic.gotoAndStop("Ted");
txtName.text = "Ted:";
txtSpeech.text = "It’s over. And I need a vacation right now...";
};
};
return (txtSpeech.text.length);
}
}
}//package main
Section 46
//dialogIco (main.dialogIco)
package main {
import flash.display.*;
import flash.geom.*;
public dynamic class dialogIco extends MovieClip {
public var bg:MovieClip;
public var Excl:MovieClip;
public function dialogIco(){
addFrameScript(0, frame1);
}
public function targetingObject(_arg1:MovieClip){
var _local2:Number = 2;
var _local3:Point = _arg1.parent.localToGlobal(new Point((_arg1.x + (_arg1.width * 0.5)), _arg1.y));
var _local4:Rectangle = new Rectangle(_local3.x, _local3.y, _arg1.width, _arg1.height);
var _local5:Rectangle = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
if (_local5.intersects(_local4)){
x = (_local3.x - (width * 0.5));
y = (_local3.y - height);
if (bg){
bg.scaleX = 1;
bg.scaleY = 1;
};
Excl.y = 3.6;
} else {
if (_local3.y < (_local5.y + _local2)){
toTop();
y = (_local5.y + _local2);
} else {
if (_local3.y > ((_local5.y + stage.stageHeight) - _local2)){
toBottom();
y = (((_local5.y + stage.stageHeight) - _local2) - height);
} else {
y = (_local3.y - height);
};
};
if (_local3.x < (_local5.x + _local2)){
toLeft();
x = (_local5.x + _local2);
} else {
if (_local3.x > ((_local5.x + stage.stageWidth) - _local2)){
toRight();
x = (((_local5.x + stage.stageWidth) - _local2) - width);
} else {
x = (_local3.x - (width * 0.5));
};
};
};
}
public function toRight(){
if (bg){
bg.scaleX = -1;
bg.scaleY = 1;
};
Excl.y = 3.6;
}
public function toLeft(){
if (bg){
bg.scaleX = 1;
bg.scaleY = 1;
};
Excl.y = 3.6;
}
function frame1(){
stop();
}
public function toBottom(){
if (bg){
bg.scaleX = 1;
bg.scaleY = 1;
};
Excl.y = 3.6;
}
public function toTop(){
if (bg){
bg.scaleX = 1;
bg.scaleY = -1;
};
Excl.y = 10.4;
}
}
}//package main
Section 47
//DistortImage (main.DistortImage)
package main {
import flash.display.*;
import flash.geom.*;
public class DistortImage extends Sprite {
private var _points:Array;
private var _hseg:int;
private var _texture:BitmapData;
private var _iH:Number;
private var _triangles:Array;
private var _iW:Number;
private var _smoothing:Boolean;// = false
private var _vseg:int;
public function DistortImage(_arg1:BitmapData, _arg2:int=0, _arg3:int=0, _arg4:Boolean=false){
_points = [];
_triangles = [];
super();
_texture = _arg1;
_vseg = _arg3;
_hseg = _arg2;
_smoothing = _arg4;
init();
}
private function addTriangle(_arg1:GridPoint, _arg2:GridPoint, _arg3:GridPoint):void{
var _local4:Matrix = new Matrix();
_local4.tx = (-(_arg1.y) * (_texture.width / (_arg2.y - _arg1.y)));
_local4.ty = (-(_arg1.x) * (_texture.height / (_arg3.x - _arg1.x)));
_local4.b = (_texture.height / (_arg3.x - _arg1.x));
_local4.c = (_texture.width / (_arg2.y - _arg1.y));
_triangles.push(new GridTriangle(_arg1, _arg2, _arg3, _local4));
}
private function init():void{
var _local1:int;
var _local2:int;
_iW = (1 / _texture.width);
_iH = (1 / _texture.height);
_points = [];
_triangles = [];
var _local3:Number = (_texture.width / (_hseg + 1));
var _local4:Number = (_texture.height / (_vseg + 1));
var _local5:int = (_hseg + 2);
var _local6:int = (_vseg + 2);
_local1 = 0;
while (_local1 < _local5) {
_local2 = 0;
while (_local2 < _local6) {
_points.push(new GridPoint((_local1 * _local3), (_local2 * _local4)));
_local2++;
};
_local1++;
};
_local1 = 0;
while (_local1 < (_local5 - 1)) {
_local2 = 0;
while (_local2 < (_local6 - 1)) {
addTriangle(_points[(_local2 + (_local1 * _local6))], _points[((_local2 + (_local1 * _local6)) + 1)], _points[(_local2 + ((_local1 + 1) * _local6))]);
addTriangle(_points[((_local2 + ((_local1 + 1) * _local6)) + 1)], _points[(_local2 + ((_local1 + 1) * _local6))], _points[((_local2 + (_local1 * _local6)) + 1)]);
_local2++;
};
_local1++;
};
render();
}
private function concat(_arg1:Matrix, _arg2:Matrix):Matrix{
var _local3:Matrix = new Matrix();
_local3.a = (_arg1.c * _arg2.b);
_local3.b = (_arg1.d * _arg2.b);
_local3.c = (_arg1.a * _arg2.c);
_local3.d = (_arg1.b * _arg2.c);
_local3.tx = (((_arg1.a * _arg2.tx) + (_arg1.c * _arg2.ty)) + _arg1.tx);
_local3.ty = (((_arg1.b * _arg2.tx) + (_arg1.d * _arg2.ty)) + _arg1.ty);
return (_local3);
}
private function render():void{
var _local3:GridTriangle;
var _local4:GridPoint;
var _local5:GridPoint;
var _local6:GridPoint;
var _local7:Number;
var _local8:Number;
var _local1:Matrix = new Matrix();
var _local2:Number = _triangles.length;
graphics.clear();
while (--_local2 > -1) {
_local3 = _triangles[_local2];
_local4 = _local3.p0;
_local5 = _local3.p1;
_local6 = _local3.p2;
_local7 = _local4.sx;
_local8 = _local4.sy;
_local1.a = ((_local5.sx - _local7) * _iW);
_local1.b = ((_local5.sy - _local8) * _iW);
_local1.c = ((_local6.sx - _local7) * _iH);
_local1.d = ((_local6.sy - _local8) * _iH);
_local1.tx = _local7;
_local1.ty = _local8;
graphics.beginBitmapFill(_texture, concat(_local1, _local3.matrix), false, _smoothing);
graphics.moveTo(_local7, _local8);
graphics.lineTo(_local5.sx, _local5.sy);
graphics.lineTo(_local6.sx, _local6.sy);
graphics.endFill();
};
}
public function get texture():BitmapData{
return (_texture);
}
public function set smoothing(_arg1:Boolean):void{
_smoothing = _arg1;
}
public function setTransform(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number):void{
var _local14:GridPoint;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local9:Number = (_arg7 - _arg1);
var _local10:Number = (_arg8 - _arg2);
var _local11:Number = (_arg5 - _arg3);
var _local12:Number = (_arg6 - _arg4);
var _local13:int = _points.length;
while (--_local13 > -1) {
_local14 = _points[_local13];
_local15 = (_iW * _local14.x);
_local16 = (_iH * _local14.y);
_local17 = (_arg1 + (_local16 * _local9));
_local18 = (_arg2 + (_local16 * _local10));
_local14.sx = (_local17 + (_local15 * ((_arg3 + (_local16 * _local11)) - _local17)));
_local14.sy = (_local18 + (_local15 * ((_arg4 + (_local16 * _local12)) - _local18)));
};
render();
}
public function get smoothing():Boolean{
return (_smoothing);
}
public function set texture(_arg1:BitmapData):void{
_texture = _arg1;
init();
}
public function setTransformByArray(_arg1:Array):void{
setTransform(_arg1[0].x, _arg1[0].y, _arg1[1].x, _arg1[1].y, _arg1[2].x, _arg1[2].y, _arg1[3].x, _arg1[3].y);
}
}
}//package main
import flash.geom.*;
class GridTriangle {
public var p0:GridPoint;
public var p1:GridPoint;
public var matrix:Matrix;
public var p2:GridPoint;
private function GridTriangle(_arg1:GridPoint, _arg2:GridPoint, _arg3:GridPoint, _arg4:Matrix){
this.p0 = _arg1;
this.p1 = _arg2;
this.p2 = _arg3;
this.matrix = _arg4;
}
}
class GridPoint {
public var sx:Number;
public var sy:Number;
public var x:Number;
public var y:Number;
private function GridPoint(_arg1:Number=0, _arg2:Number=0){
this.x = _arg1;
this.y = _arg2;
this.sx = _arg1;
this.sy = _arg2;
}
}
Section 48
//dropMedKit (main.dropMedKit)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class dropMedKit extends propObject {
public function dropMedKit(){
addFrameScript(0, frame1);
}
function frame1(){
if ((parent as Level)){
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
} else {
if ((parent.parent as Level)){
curLevel = Level(parent.parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
};
};
this.propType = "Med";
this.moneyAmount = 40;
}
}
}//package main
Section 49
//dynObject (main.dynObject)
package main {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.utils.*;
public class dynObject extends baseObject {
public var isRubber:Boolean;// = false
public var gravityComp:Boolean;// = true
var target:ageVector;
public var Velocity:ageVector;
public var rubberFactor:Number;// = 0.5
var curLevel:Level;
public var useRotateSpeed:Boolean;// = false
var isTargeting:Boolean;// = false
public var RotTarget:ageVector;
public var rotateSpeed:Number;// = 5
var isFlyMoveType:Boolean;// = false
var fxFunc:Function;
public var gravityFactor:Number;// = 1
public var notTargetRotate:Boolean;// = false
var maxSpeed:ageVector;
var stayTime:Number;// = 0
var speed:ageVector;
public var CurPoint:ageVector;
public var timerFXAdd:Timer;
public var collisionEnable:Boolean;// = true
public var rot:Number;// = 0
public var timerStayDelay:Timer;
public var rotTargeted:Boolean;// = false
public var VelocitySpd:Number;// = 3
public var gravityEnable:Boolean;// = true
var speedFactor:Number;// = 1
var bottomLimiter:MovieClip;// = null
public function dynObject(){
speed = new ageVector(0, 0);
maxSpeed = new ageVector(14, 14);
target = new ageVector(0, 0);
Velocity = new ageVector();
RotTarget = new ageVector();
CurPoint = new ageVector();
timerStayDelay = new Timer(20);
timerFXAdd = new Timer(20);
super();
timerStayDelay.stop();
timerStayDelay.addEventListener(TimerEvent.TIMER, timerStayDelay_Timer, false, 0, true);
timerFXAdd.stop();
timerFXAdd.addEventListener(TimerEvent.TIMER, timerFXAdd_Timer, false, 0, true);
}
public function setRotTarget(_arg1:Number, _arg2:Number):void{
RotTarget.x = _arg1;
RotTarget.y = _arg2;
}
public function mulVelocity(_arg1:Number){
Velocity.mulScalar(_arg1);
}
public function clearDynObject(){
timerStayDelay.stop();
timerStayDelay.removeEventListener(TimerEvent.TIMER, timerStayDelay_Timer);
timerFXAdd.stop();
timerFXAdd.removeEventListener(TimerEvent.TIMER, timerFXAdd_Timer);
curLevel = null;
bottomLimiter = null;
fxFunc = null;
clearAlphaFader();
}
public function timerStayDelay_Timer(_arg1:TimerEvent):void{
if (((!(curLevel)) || (curLevel.paused))){
return;
};
if (!visible){
timerStayDelay.stop();
timerStayDelay.removeEventListener(TimerEvent.TIMER, timerStayDelay_Timer);
return;
};
stayTime = (stayTime - 20);
if (stayTime <= 0){
startFadeOut();
timerStayDelay.stop();
timerStayDelay.removeEventListener(TimerEvent.TIMER, timerStayDelay_Timer);
};
}
public function rotate():void{
var _local1:ageVector;
var _local2:Number;
var _local3:Point;
var _local4:Number;
rotation = (rotation + rot);
if (!notTargetRotate){
_local3 = curLevel.globalToLocal(MovieClip(parent).localToGlobal(new Point(x, y)));
_local1 = new ageVector((RotTarget.x - _local3.x), (RotTarget.y - _local3.y));
if ((parent as actorObject)){
if (actorObject(parent).scaleX < 0){
_local1.x = -(_local1.x);
};
};
_local2 = ((_local1.getAngleDeg() - rotation) - 180);
if (_local2 > 180){
_local2 = (_local2 - 360);
} else {
if (_local2 < -180){
_local2 = (_local2 + 360);
};
};
rotTargeted = Boolean((Math.abs(_local2) <= rotateSpeed));
if (Math.abs(_local2) > 0){
_local4 = rotateSpeed;
rotation = (rotation + ((Math.abs(_local2) > _local4)) ? ((_local2 > 0)) ? _local4 : -(_local4) : _local2);
};
};
}
public function setVelocity(_arg1:Number, _arg2:Number, _arg3:Number){
Velocity.set(_arg1, _arg2);
Velocity.mulScalar((_arg3 / Velocity.len()));
}
public function move():void{
x = (x + Velocity.x);
y = (y + Velocity.y);
}
public function calcGlobalPos(){
}
public function setRotToVelocity():void{
setRotTarget(((Velocity.x * 6) + x), ((Velocity.y * 6) + y));
}
public function updateDynObj():void{
if (!isFlyMoveType){
move();
} else {
actorObject(this).moveFlyLike();
};
}
public function timerFXAdd_Timer(_arg1:TimerEvent):void{
if (mainGlobal.configVfxOn){
fxFunc(x, y);
};
}
}
}//package main
Section 50
//ElectroWave (main.ElectroWave)
package main {
import flash.media.*;
public dynamic class ElectroWave extends Sound {
}
}//package main
Section 51
//enginesFire (main.enginesFire)
package main {
public dynamic class enginesFire extends alphaFader {
}
}//package main
Section 52
//fader50perc (main.fader50perc)
package main {
public dynamic class fader50perc extends alphaFader {
public function fader50perc(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package main
Section 53
//fader50percVis (main.fader50percVis)
package main {
public dynamic class fader50percVis extends alphaFader {
}
}//package main
Section 54
//FatalDamage (main.FatalDamage)
package main {
import flash.media.*;
public dynamic class FatalDamage extends Sound {
}
}//package main
Section 55
//FSM (main.FSM)
package main {
public dynamic class FSM extends FSM_Actions {
var curAIClass:String;// = ""
var curState:String;// = "idle"
var transTable:Array;
public function FSM(_arg1:actorObject, _arg2:String){
transTable = new Array();
super();
actor = _arg1;
curAIClass = _arg2;
if (_arg2 == "Zombie"){
transTable.push(new FSMTrans("die", "timer", "die", Zomb_procDie));
transTable.push(new FSMTrans("idle", "timer", "idle", Zomb_procIdle));
transTable.push(new FSMTrans("idle", "killed", "die", Zomb_beginDie));
transTable.push(new FSMTrans("idle", "findEnemy", "moveToEnemy", Zomb_beginMoveToEnemy));
transTable.push(new FSMTrans("moveToEnemy", "timer", "moveToEnemy", Zomb_procMoveToEnemy));
transTable.push(new FSMTrans("moveToEnemy", "killed", "die", Zomb_beginDie));
transTable.push(new FSMTrans("moveToEnemy", "canAttack", "attack", Zomb_beginAttack));
transTable.push(new FSMTrans("moveToEnemy", "lostEnemy", "idle", Zomb_beginIdle));
transTable.push(new FSMTrans("attack", "timer", "attack", Zomb_procAttack));
transTable.push(new FSMTrans("attack", "attackHit", "attack", Zomb_attackHit));
transTable.push(new FSMTrans("attack", "firstAttackEnd", "attack", Zomb_firstAttackEnd));
transTable.push(new FSMTrans("attack", "killed", "die", Zomb_beginDie));
transTable.push(new FSMTrans("attack", "farToAttack", "moveToEnemy", Zomb_beginMoveToEnemy));
transTable.push(new FSMTrans("attack", "lostEnemy", "idle", Zomb_beginIdle));
} else {
if (_arg2 == "AlienSaw"){
transTable.push(new FSMTrans("die", "timer", "die", AlienSaw_procDie));
transTable.push(new FSMTrans("idle", "timer", "idle", AlienSaw_procIdle));
transTable.push(new FSMTrans("idle", "killed", "die", AlienSaw_beginDie));
transTable.push(new FSMTrans("idle", "findEnemy", "moveToEnemy", AlienSaw_beginMoveToEnemy));
transTable.push(new FSMTrans("moveToEnemy", "timer", "moveToEnemy", AlienSaw_procMoveToEnemy));
transTable.push(new FSMTrans("moveToEnemy", "attackHit", "moveToEnemy", AlienSaw_attackHit));
transTable.push(new FSMTrans("moveToEnemy", "lostEnemy", "idle", AlienSaw_beginIdle));
transTable.push(new FSMTrans("moveToEnemy", "targetReached", "moveToEnemy", AlienSaw_changeTarget));
transTable.push(new FSMTrans("moveToEnemy", "killed", "die", AlienSaw_beginDie));
} else {
if (_arg2 == "AlienHunter"){
transTable.push(new FSMTrans("die", "timer", "die", AlienHunter_procDie));
transTable.push(new FSMTrans("idle", "timer", "idle", AlienHunter_procIdle));
transTable.push(new FSMTrans("idle", "killed", "die", AlienHunter_beginDie));
transTable.push(new FSMTrans("idle", "findEnemy", "moveToEnemy", AlienHunter_beginMoveToEnemy));
transTable.push(new FSMTrans("moveToEnemy", "timer", "moveToEnemy", AlienHunter_procMoveToEnemy));
transTable.push(new FSMTrans("moveToEnemy", "killed", "die", AlienHunter_beginDie));
transTable.push(new FSMTrans("moveToEnemy", "lostEnemy", "idle", AlienHunter_beginIdle));
transTable.push(new FSMTrans("moveToEnemy", "targetReached", "moveToEnemy", AlienHunter_changeTarget));
} else {
if (_arg2 == "AlienBigBoss"){
transTable.push(new FSMTrans("die", "timer", "die", AlienBigBoss_procDie));
transTable.push(new FSMTrans("idle", "timer", "idle", AlienBigBoss_procIdle));
transTable.push(new FSMTrans("idle", "killed", "die", AlienBigBoss_beginDie));
transTable.push(new FSMTrans("idle", "findEnemy", "moveToEnemy", AlienBigBoss_beginMoveToEnemy));
transTable.push(new FSMTrans("moveToEnemy", "timer", "moveToEnemy", AlienBigBoss_procMoveToEnemy));
transTable.push(new FSMTrans("moveToEnemy", "killed", "die", AlienBigBoss_beginDie));
transTable.push(new FSMTrans("moveToEnemy", "lostEnemy", "idle", AlienBigBoss_beginIdle));
transTable.push(new FSMTrans("moveToEnemy", "targetReached", "moveToEnemy", AlienBigBoss_changeTarget));
} else {
if (_arg2 == "AlienPredator"){
transTable.push(new FSMTrans("die", "timer", "die", AlienPredator_procDie));
transTable.push(new FSMTrans("idle", "timer", "idle", AlienPredator_procIdle));
transTable.push(new FSMTrans("idle", "killed", "die", AlienPredator_beginDie));
transTable.push(new FSMTrans("idle", "findEnemy", "moveToEnemy", AlienPredator_beginMoveToEnemy));
transTable.push(new FSMTrans("moveToEnemy", "timer", "moveToEnemy", AlienPredator_procMoveToEnemy));
transTable.push(new FSMTrans("moveToEnemy", "killed", "die", AlienPredator_beginDie));
transTable.push(new FSMTrans("moveToEnemy", "lostEnemy", "idle", AlienPredator_beginIdle));
transTable.push(new FSMTrans("moveToEnemy", "targetReached", "moveToEnemy", AlienPredator_changeTarget));
} else {
if (_arg2 == "AlienElectro"){
transTable.push(new FSMTrans("die", "timer", "die", AlienElectro_procDie));
transTable.push(new FSMTrans("idle", "timer", "idle", AlienElectro_procIdle));
transTable.push(new FSMTrans("idle", "killed", "die", AlienElectro_beginDie));
transTable.push(new FSMTrans("idle", "findEnemy", "moveToEnemy", AlienElectro_beginMoveToEnemy));
transTable.push(new FSMTrans("moveToEnemy", "timer", "moveToEnemy", AlienElectro_procMoveToEnemy));
transTable.push(new FSMTrans("moveToEnemy", "killed", "die", AlienElectro_beginDie));
transTable.push(new FSMTrans("moveToEnemy", "lostEnemy", "idle", AlienElectro_beginIdle));
transTable.push(new FSMTrans("moveToEnemy", "targetReached", "moveToEnemy", AlienElectro_changeTarget));
} else {
if (_arg2 == "AlienSeeder"){
transTable.push(new FSMTrans("die", "timer", "die", AlienSeeder_procDie));
transTable.push(new FSMTrans("idle", "timer", "idle", AlienSeeder_procIdle));
transTable.push(new FSMTrans("idle", "killed", "die", AlienSeeder_beginDie));
transTable.push(new FSMTrans("idle", "findEnemy", "moveToEnemy", AlienSeeder_beginMoveToEnemy));
transTable.push(new FSMTrans("moveToEnemy", "timer", "moveToEnemy", AlienSeeder_procMoveToEnemy));
transTable.push(new FSMTrans("moveToEnemy", "killed", "die", AlienSeeder_beginDie));
transTable.push(new FSMTrans("moveToEnemy", "startSeed", "seed", AlienSeeder_beginSeed));
transTable.push(new FSMTrans("moveToEnemy", "lostEnemy", "idle", AlienSeeder_beginIdle));
transTable.push(new FSMTrans("moveToEnemy", "targetReached", "moveToEnemy", AlienSeeder_changeTarget));
transTable.push(new FSMTrans("moveToEnemy", "killed", "die", AlienSeeder_beginDie));
transTable.push(new FSMTrans("seed", "timer", "seed", AlienSeeder_procSeed));
transTable.push(new FSMTrans("seed", "killed", "die", AlienSeeder_beginDie));
transTable.push(new FSMTrans("seed", "endSeed", "moveToEnemy", AlienSeeder_beginMoveToEnemy));
} else {
if (_arg2 == "Turrel"){
transTable.push(new FSMTrans("die", "timer", "die", Turrel_procDie));
transTable.push(new FSMTrans("idle", "timer", "idle", Turrel_procIdle));
transTable.push(new FSMTrans("idle", "killed", "die", Turrel_beginDie));
transTable.push(new FSMTrans("idle", "findEnemy", "attack", Turrel_beginAttack));
transTable.push(new FSMTrans("attack", "timer", "attack", Turrel_procAttack));
transTable.push(new FSMTrans("attack", "killed", "die", Turrel_beginDie));
} else {
if (_arg2 == "Bomb"){
transTable.push(new FSMTrans("die", "timer", "die", Bomb_procDie));
transTable.push(new FSMTrans("idle", "timer", "idle", Bomb_procIdle));
transTable.push(new FSMTrans("idle", "killed", "die", Bomb_beginDie));
transTable.push(new FSMTrans("idle", "findEnemy", "attack", Bomb_beginAttack));
transTable.push(new FSMTrans("attack", "timer", "attack", Bomb_procAttack));
transTable.push(new FSMTrans("attack", "killed", "die", Bomb_beginDie));
} else {
if (_arg2 == "AlienSolder"){
transTable.push(new FSMTrans("die", "timer", "die", AlienSolder_procDie));
transTable.push(new FSMTrans("idle", "timer", "idle", AlienSolder_procIdle));
transTable.push(new FSMTrans("idle", "killed", "die", AlienSolder_beginDie));
transTable.push(new FSMTrans("idle", "findEnemy", "moveToEnemy", AlienSolder_beginMoveToEnemy));
transTable.push(new FSMTrans("moveToEnemy", "timer", "moveToEnemy", AlienSolder_procMoveToEnemy));
transTable.push(new FSMTrans("moveToEnemy", "killed", "die", AlienSolder_beginDie));
transTable.push(new FSMTrans("moveToEnemy", "canAttack", "attack", AlienSolder_beginAttack));
transTable.push(new FSMTrans("moveToEnemy", "lostEnemy", "idle", AlienSolder_beginIdle));
transTable.push(new FSMTrans("moveToEnemy", "targetReached", "moveToEnemy", AlienSolder_changeTarget));
transTable.push(new FSMTrans("attack", "timer", "attack", AlienSolder_procAttack));
transTable.push(new FSMTrans("attack", "killed", "die", AlienSolder_beginDie));
transTable.push(new FSMTrans("attack", "farToAttack", "moveToEnemy", AlienSolder_beginMoveToEnemy));
transTable.push(new FSMTrans("attack", "lostEnemy", "idle", AlienSolder_beginIdle));
} else {
if (_arg2 == "AlienBomber"){
transTable.push(new FSMTrans("die", "timer", "die", AlienBomber_procDie));
transTable.push(new FSMTrans("idle", "timer", "idle", AlienBomber_procIdle));
transTable.push(new FSMTrans("idle", "killed", "die", AlienBomber_beginDie));
transTable.push(new FSMTrans("idle", "findEnemy", "moveToEnemy", AlienBomber_beginMoveToEnemy));
transTable.push(new FSMTrans("moveToEnemy", "timer", "moveToEnemy", AlienBomber_procMoveToEnemy));
transTable.push(new FSMTrans("moveToEnemy", "killed", "die", AlienBomber_beginDie));
transTable.push(new FSMTrans("moveToEnemy", "lostEnemy", "idle", AlienBomber_beginIdle));
transTable.push(new FSMTrans("moveToEnemy", "targetReached", "moveToEnemy", AlienBomber_changeTarget));
} else {
if (_arg2 == "TurrelBomb"){
transTable.push(new FSMTrans("die", "timer", "die", TurrelBomb_procDie));
transTable.push(new FSMTrans("idle", "timer", "idle", TurrelBomb_procIdle));
transTable.push(new FSMTrans("idle", "killed", "die", TurrelBomb_beginDie));
transTable.push(new FSMTrans("idle", "findEnemy", "attack", TurrelBomb_beginAttack));
transTable.push(new FSMTrans("attack", "timer", "attack", TurrelBomb_procAttack));
transTable.push(new FSMTrans("attack", "killed", "die", TurrelBomb_beginDie));
};
};
};
};
};
};
};
};
};
};
};
};
}
public function postEvent(_arg1:String, _arg2:Array=null):void{
var _local3:int;
_local3 = 0;
while (_local3 < transTable.length) {
if ((((curState == transTable[_local3].stateFrom)) && ((_arg1 == transTable[_local3].curEvent)))){
curState = transTable[_local3].stateTo;
transTable[_local3].execFunc(_arg2);
break;
};
_local3++;
};
}
}
}//package main
Section 56
//FSM_Actions (main.FSM_Actions)
package main {
import flash.display.*;
import flash.geom.*;
public dynamic class FSM_Actions {
var actor:actorObject;
public function AlienBigBoss_procDie(_arg1:Array=null){
}
public function AlienSeeder_endMoveToEnemy(_arg1:Array=null){
}
public function AlienSaw_beginDie(_arg1:Array=null){
var _local2:uint;
actor.dead = true;
actor.curLevel.addFX_littleBlast(actor.x, (actor.y - 15), 1.8);
actor.curLevel.addFX_littleSmoke(actor.x, (actor.y - 25), 2);
sounds.PlaySnd("bombExp", 1.5, actor, actor.stage);
actor.visible = false;
if (mainGlobal.configDebrisOn){
_local2 = 0;
_local2 = 0;
while (_local2 < 3) {
actor.curLevel.addProp_Debris(actor.x, actor.y);
_local2++;
};
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienSawDebris1");
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienSawDebris2");
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienSawDebris3");
};
actor.curLevel.addProp_Money1(actor.x, actor.y);
}
public function AlienBigBoss_beginIdle(_arg1:Array=null){
}
public function AlienPredator_procMoveToEnemy(_arg1:Array=null){
var _local2:Point;
var _local3:projObject;
if ((((actor.x > actor.curLevel["levelLeftSeed"].x)) || (!((actor.rLeg.currentFrame == 36))))){
actor.x = (actor.x - actor.maxSpeed.x);
} else {
actor.rLeg.stop();
actor.lLeg.stop();
};
if (!actor.timerBulletDelay.running){
_local2 = actor.curLevel.globalToLocal(actor.localToGlobal(new Point(actor.pointShoot.x, actor.pointShoot.y)));
actor.curLevel.addBlasterProj(_local2.x, _local2.y, (actor.curLevel.hero.x - 800), actor.curLevel.hero.y, actor.weapons[0]);
actor.curLevel.addBlasterProj(_local2.x, _local2.y, (actor.curLevel.hero.x - 200), actor.curLevel.hero.y, actor.weapons[0]);
actor.curLevel.addBlasterProj(_local2.x, _local2.y, actor.curLevel.hero.x, actor.curLevel.hero.y, actor.weapons[0]);
actor.timerBulletDelay.start();
};
if (!actor.timerBulletDelay2.running){
_local2 = actor.curLevel.globalToLocal(actor.localToGlobal(new Point(actor.pointShoot.x, actor.pointShoot.y)));
actor.curLevel.addProj_BombWep(_local2.x, _local2.y, (actor.curLevel.hero.x - ageMath.Random(100, 800)), actor.curLevel.hero.y, actor.weapons[1]);
actor.timerBulletDelay2.start();
};
if (actor.damageArea.hitTestObject(actor.curLevel.hero)){
actor.curLevel.hero.x = (actor.x - (actor.width / 2));
_local3 = new projObject();
_local3.damage = 5;
_local3.x = actor.curLevel.hero.x;
_local3.y = (actor.curLevel.hero.y - (actor.curLevel.hero.height / 2));
actor.curLevel.hero.transmitDamage(_local3);
Game(actor.curLevel.parent).gameGUI.painFrame.startFadeOut();
};
}
public function AlienSaw_procMoveToEnemy(_arg1:Array=null){
if (actor.distToEnemy <= actor.attackRadius){
actor.fsmAI.postEvent("canAttack");
};
if ((((actor.distToEnemy > actor.seeRadius)) && (!(actor.alwaysSeeEnemy)))){
actor.fsmAI.postEvent("lostEnemy");
};
actor.updateDynObj();
}
public function AlienElectro_changeTarget(_arg1:Array=null){
actor.setTarget(new ageVector(ageMath.Random((actor.curLevel.hero.x - 200), (actor.curLevel.hero.x + 200)), ageMath.Random((actor.curLevel.hero.y - 300), (actor.curLevel.hero.y - 200))));
}
public function Zomb_beginDie(_arg1:Array=null){
actor.gotoAndStop("die");
actor.dead = true;
if (actor.noArmsShootCnt == 3){
actor.curLevel.addProp_Money2(actor.x, actor.y);
} else {
actor.curLevel.addProp_Coin(actor.x, actor.y);
};
}
public function AlienHunter_procDie(_arg1:Array=null){
}
public function Turrel_procDie(_arg1:Array=null){
}
public function Zomb_endMoveToEnemy(_arg1:Array=null){
}
public function AlienHunter_endIdle(_arg1:Array=null){
}
public function Turrel_endIdle(_arg1:Array=null){
}
public function AlienHunter_endMoveToEnemy(_arg1:Array=null){
}
public function AlienSolder_procDie(_arg1:Array=null){
}
public function AlienBomber_beginMoveToEnemy(_arg1:Array=null){
}
public function AlienElectro_endMoveToEnemy(_arg1:Array=null){
}
public function AlienBigBoss_endDie(_arg1:Array=null){
}
public function AlienSolder_endIdle(_arg1:Array=null){
}
public function AlienSeeder_endSeed(_arg1:Array=null){
}
public function AlienBomber_procIdle(_arg1:Array=null){
if ((((actor.distToEnemy <= actor.seeRadius)) || (actor.alwaysSeeEnemy))){
actor.fsmAI.postEvent("findEnemy");
actor.setTarget(new ageVector(ageMath.Random((actor.curLevel.hero.x - 200), (actor.curLevel.hero.x + 200)), ageMath.Random((actor.curLevel.hero.y - 300), (actor.curLevel.hero.y - 200))));
};
}
public function TurrelBomb_procIdle(_arg1:Array=null){
if (actor.distToEnemy <= actor.seeRadius){
};
}
public function Bomb_procIdle(_arg1:Array=null){
if (actor.distToEnemy <= actor.seeRadius){
actor.fsmAI.postEvent("findEnemy");
};
}
public function AlienBigBoss_changeTarget(_arg1:Array=null){
actor.setTarget(new ageVector(ageMath.Random((actor.curLevel.hero.x - 200), (actor.curLevel.hero.x + 200)), ageMath.Random((actor.curLevel.hero.y - 300), (actor.curLevel.hero.y - 200))));
}
public function Bomb_beginDie(_arg1:Array=null){
actor.dead = true;
var _local2:projObject = new projObject();
_local2.x = actor.x;
_local2.y = actor.y;
_local2.attackRadius = actor.attackRadius;
_local2.damage = actor.damagePerHit;
actor.curLevel.addExplotion(_local2, actor);
actor.curLevel.addFX_littleBlast(actor.x, (actor.y - 15));
actor.curLevel.addFX_littleSmoke(actor.x, (actor.y - 25));
if (mainGlobal.configDebrisOn){
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienBombDebris1");
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienBombDebris2");
};
sounds.PlaySnd("bombExp", 1.5, actor, actor.stage);
actor.visible = false;
actor.anim.stop();
}
public function AlienSaw_procIdle(_arg1:Array=null){
if ((((actor.distToEnemy <= actor.seeRadius)) || (actor.alwaysSeeEnemy))){
actor.fsmAI.postEvent("findEnemy");
actor.setTarget(new ageVector((actor.curLevel.hero.x + ageMath.Random(-10, 10)), ((actor.curLevel.hero.y - (actor.curLevel.hero.height / 2)) + ageMath.Random(-10, 10))));
};
}
public function AlienSaw_beginMoveToEnemy(_arg1:Array=null){
}
public function AlienBigBoss_procMoveToEnemy(_arg1:Array=null){
var _local5:Number;
var _local6:int;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:ageVector;
var _local13:projObject;
var _local14:ageVector;
var _local15:Point;
var _local2:Point = new Point(actor.x, actor.y);
var _local3:ageVector = new ageVector((actor.curLevel.hero.x - _local2.x), (actor.curLevel.hero.y - _local2.y));
var _local4:Number = (_local3.getAngleDeg() - actor.anim.rotation);
if (_local4 > 180){
_local4 = (_local4 - 360);
} else {
if (_local4 < -180){
_local4 = (_local4 + 360);
};
};
if (Math.abs(_local4) > 0){
_local5 = 0.6;
actor.anim.rotation = (actor.anim.rotation + ((Math.abs(_local4) > _local5)) ? ((_local4 > 0)) ? _local5 : -(_local5) : _local4);
};
if ((((actor.anim.currentFrame == 1)) && ((actor.life < (actor.lifeMax / 3))))){
actor.vChild.visible = true;
actor.vChild2.visible = false;
actor.anim.gotoAndStop(2);
actor.curLevel["seeder1"].alwaysSeeEnemy = true;
actor.curLevel.addFX_littleBlast(actor.x, actor.y, 3);
actor.curLevel.addFX_littleSmoke(actor.x, actor.y, 4);
sounds.PlaySnd("bombExp", 1.5, actor, actor.stage);
musicEnv.fadeTo("roboAttack");
sounds.PlaySnd("bigExp", 10, actor, actor.stage);
sounds.PlaySnd("midExp", 10, actor, actor.stage);
sounds.PlaySnd("bombExp", 10, actor, actor.stage);
if (mainGlobal.configDebrisOn){
_local6 = 0;
_local6 = 0;
while (_local6 < 35) {
actor.curLevel.addProp_Debris(actor.x, actor.y);
_local6++;
};
};
};
if (actor.anim.currentFrame == 2){
actor.vChildTime++;
if (actor.vChildTime > 35){
actor.vChildTime = 0;
actor.vChildPos++;
if (actor.vChildPos > 7){
actor.vChildPos = 0;
};
};
_local7 = 400;
_local8 = 0;
_local9 = (Math.PI / 4);
_local10 = ((_local7 * Math.cos((_local9 * actor.vChildPos))) - (_local8 * Math.sin((_local9 * actor.vChildPos))));
_local11 = ((_local8 * Math.cos((_local9 * actor.vChildPos))) + (_local7 * Math.sin((_local9 * actor.vChildPos))));
actor.vChild.rotation = 90;
actor.vChild.width = _local7;
actor.vChild.rotation = (90 + (actor.vChildPos * 45));
_local12 = ageMath.getLineCrossRect(actor.x, actor.y, (actor.x + _local10), (actor.y + _local11), (actor.curLevel.hero.x - (actor.curLevel.hero.width / 2)), (actor.curLevel.hero.y - actor.curLevel.hero.height), (actor.curLevel.hero.x + (actor.curLevel.hero.width / 2)), actor.curLevel.hero.y);
if (((_local12) && ((actor.curLevel.hero.electroCurLevel < 25)))){
actor.curLevel.hero.addElectroDamage(0.8);
};
} else {
actor.vChildTime++;
if (actor.vChildTime > 35){
actor.vChildTime = 0;
actor.vChildPos++;
if (actor.vChildPos == 1){
sounds.PlaySnd("LasergunShoot1", 10, actor, actor.stage);
};
if (actor.vChildPos > 2){
actor.vChildPos = 0;
};
if (actor.vChildPos == 0){
actor.vChild2.visible = false;
} else {
actor.vChild2.visible = true;
};
};
_local7 = 700;
_local8 = 0;
_local9 = ((actor.anim.rotation * Math.PI) / 180);
_local10 = ((_local7 * Math.cos((_local9 * actor.vChildPos))) - (_local8 * Math.sin((_local9 * actor.vChildPos))));
_local11 = ((_local8 * Math.cos((_local9 * actor.vChildPos))) + (_local7 * Math.sin((_local9 * actor.vChildPos))));
actor.vChild2.rotation = 90;
actor.vChild2.width = _local7;
actor.vChild2.rotation = (actor.anim.rotation + 90);
_local12 = ageMath.getLineCrossRect(actor.x, actor.y, (actor.x + _local10), (actor.y + _local11), (actor.curLevel.hero.x - (actor.curLevel.hero.width / 2)), (actor.curLevel.hero.y - actor.curLevel.hero.height), (actor.curLevel.hero.x + (actor.curLevel.hero.width / 2)), actor.curLevel.hero.y);
if (((_local12) && ((actor.vChild2.visible == true)))){
_local13 = new projObject();
_local13.damage = 0.8;
_local13.x = actor.curLevel.hero.x;
_local13.y = (actor.curLevel.hero.y - (actor.curLevel.hero.height / 2));
actor.curLevel.hero.transmitDamage(_local13);
Game(actor.curLevel.parent).gameGUI.painFrame.startFadeOut();
};
};
if (!actor.timerBulletDelay.running){
_local14 = new ageVector(30, 0);
_local14.rotDeg(actor.anim.rotation);
_local15 = actor.curLevel.globalToLocal(actor.anim.localToGlobal(new Point(actor.anim.pointShoot.x, actor.anim.pointShoot.y)));
actor.curLevel.addBlasterProj(_local15.x, _local15.y, (_local14.x + _local15.x), (_local14.y + _local15.y), actor.weapons[0]);
sounds.PlaySnd("BlasterShoot1", 10, actor, actor.stage);
_local14.x = 30;
_local14.y = 0;
_local14.rotDeg((actor.anim.rotation - 30));
actor.curLevel.addBlasterProj(_local15.x, _local15.y, (_local14.x + _local15.x), (_local14.y + _local15.y), actor.weapons[0]);
_local14.x = 30;
_local14.y = 0;
_local14.rotDeg((actor.anim.rotation + 30));
actor.curLevel.addBlasterProj(_local15.x, _local15.y, (_local14.x + _local15.x), (_local14.y + _local15.y), actor.weapons[0]);
_local14.x = 30;
_local14.y = 0;
_local14.rotDeg((actor.anim.rotation - 45));
actor.curLevel.addBlasterProj(_local15.x, _local15.y, (_local14.x + _local15.x), (_local14.y + _local15.y), actor.weapons[0]);
_local14.x = 30;
_local14.y = 0;
_local14.rotDeg((actor.anim.rotation + 45));
actor.curLevel.addBlasterProj(_local15.x, _local15.y, (_local14.x + _local15.x), (_local14.y + _local15.y), actor.weapons[0]);
actor.timerBulletDelay.start();
};
if (!actor.timerBulletDelay2.running){
_local14 = new ageVector(30, 0);
_local14.rotDeg(actor.anim.rotation);
_local15 = actor.curLevel.globalToLocal(actor.anim.localToGlobal(new Point(actor.anim.pointShoot.x, actor.anim.pointShoot.y)));
actor.curLevel.addProj_Psy(_local15.x, _local15.y, (_local14.x + _local15.x), (_local14.y + _local15.y), actor.weapons[0]);
_local14.x = 30;
_local14.y = 0;
_local14.rotDeg((actor.anim.rotation + 45));
actor.curLevel.addProj_Psy(_local15.x, _local15.y, (_local14.x + _local15.x), (_local14.y + _local15.y), actor.weapons[0]);
_local14.x = 30;
_local14.y = 0;
_local14.rotDeg((actor.anim.rotation + 90));
actor.curLevel.addProj_Psy(_local15.x, _local15.y, (_local14.x + _local15.x), (_local14.y + _local15.y), actor.weapons[0]);
_local14.x = 30;
_local14.y = 0;
_local14.rotDeg((actor.anim.rotation + 135));
actor.curLevel.addProj_Psy(_local15.x, _local15.y, (_local14.x + _local15.x), (_local14.y + _local15.y), actor.weapons[0]);
_local14.x = 30;
_local14.y = 0;
_local14.rotDeg((actor.anim.rotation + 180));
actor.curLevel.addProj_Psy(_local15.x, _local15.y, (_local14.x + _local15.x), (_local14.y + _local15.y), actor.weapons[0]);
_local14.x = 30;
_local14.y = 0;
_local14.rotDeg((actor.anim.rotation + 225));
actor.curLevel.addProj_Psy(_local15.x, _local15.y, (_local14.x + _local15.x), (_local14.y + _local15.y), actor.weapons[0]);
_local14.x = 30;
_local14.y = 0;
_local14.rotDeg((actor.anim.rotation + 270));
actor.curLevel.addProj_Psy(_local15.x, _local15.y, (_local14.x + _local15.x), (_local14.y + _local15.y), actor.weapons[0]);
_local14.x = 30;
_local14.y = 0;
_local14.rotDeg((actor.anim.rotation + 315));
actor.curLevel.addProj_Psy(_local15.x, _local15.y, (_local14.x + _local15.x), (_local14.y + _local15.y), actor.weapons[0]);
actor.timerBulletDelay2.start();
};
actor.updateDynObj();
}
public function AlienSolder_changeTarget(_arg1:Array=null){
}
public function Zomb_beginAttack(_arg1:Array=null){
if (!actor.diffAttack){
actor.gotoAndStop("attack");
} else {
actor.gotoAndStop(("attack" + ageMath.RandomInt(1, actor.diffAttackCount)));
};
actor.firstAttack = true;
}
public function Zomb_procIdle(_arg1:Array=null){
if (actor.currentLabel != "stand"){
actor.gotoAndStop("stand");
};
if (actor.distToEnemy <= actor.seeRadius){
actor.fsmAI.postEvent("findEnemy");
};
}
public function AlienPredator_changeTarget(_arg1:Array=null){
}
public function AlienPredator_endDie(_arg1:Array=null){
}
public function Zomb_beginMoveToEnemy(_arg1:Array=null){
actor.gotoAndStop("walk");
}
public function AlienHunter_procMoveToEnemy(_arg1:Array=null){
if (actor.distToEnemy <= actor.attackRadius){
actor.fsmAI.postEvent("canAttack");
};
if ((((actor.distToEnemy > actor.seeRadius)) && (!(actor.alwaysSeeEnemy)))){
actor.fsmAI.postEvent("lostEnemy");
};
if (actor.speed.x > 0){
actor.LEngFire.startFadeIn();
actor.REngFire.startFadeOut();
} else {
actor.LEngFire.startFadeOut();
actor.REngFire.startFadeIn();
};
if (actor.speed.y < 2){
actor.BEngFire1.startFadeIn();
actor.BEngFire2.startFadeIn();
} else {
actor.BEngFire1.startFadeOut();
actor.BEngFire2.startFadeOut();
};
actor.updateDynObj();
}
public function AlienHunter_beginDie(_arg1:Array=null){
var _local2:int;
actor.dead = true;
actor.curLevel.addFX_littleBlast(actor.x, (actor.y - 15), 1.8);
actor.curLevel.addFX_littleSmoke(actor.x, (actor.y - 25), 2);
sounds.PlaySnd("midExp", 10, actor, actor.stage);
sounds.PlaySnd("bombExp", 10, actor, actor.stage);
if (MovieClip(actor).blaster){
if (MovieClip(actor).blaster.visible == true){
MovieClip(actor).blaster.fsmAI.postEvent("killed");
};
};
actor.visible = false;
if (mainGlobal.configDebrisOn){
_local2 = 0;
_local2 = 0;
while (_local2 < 15) {
actor.curLevel.addProp_Debris(actor.x, actor.y);
_local2++;
};
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienHunterDebris1");
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienHunterDebris2");
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienHunterDebris3");
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienHunterDebris4");
};
actor.curLevel.addProp_Money1(actor.x, actor.y);
actor.curLevel.addProp_Money1(actor.x, actor.y);
actor.curLevel.addProp_Money1(actor.x, actor.y);
}
public function AlienBigBoss_beginDie(_arg1:Array=null){
var _local2:int;
actor.dead = true;
actor.curLevel.addFX_littleBlast(actor.x, (actor.y - 15), 1.8);
actor.curLevel.addFX_littleSmoke(actor.x, (actor.y - 25), 2);
sounds.PlaySnd("bombExp", 10, actor, actor.stage);
sounds.PlaySnd("bigExp", 10, actor, actor.stage);
sounds.PlaySnd("midExp", 10, actor, actor.stage);
actor.visible = false;
if (mainGlobal.configDebrisOn){
_local2 = 0;
_local2 = 0;
while (_local2 < 35) {
actor.curLevel.addProp_Debris(actor.x, actor.y);
_local2++;
};
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienBigBossDebris1");
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienBigBossDebris2");
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienBigBossDebris3");
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienBigBossDebris4");
};
}
public function Bomb_beginAttack(_arg1:Array=null){
actor.anim.play();
}
public function AlienSolder_procMoveToEnemy(_arg1:Array=null){
var _local3:Number;
if (((!(actor.jump)) && ((actor.distToEnemy <= actor.attackRadius)))){
actor.fsmAI.postEvent("canAttack");
return;
};
if (actor.distToEnemy > actor.seeRadius){
actor.fsmAI.postEvent("lostEnemy");
return;
};
var _local2:ageVector = new ageVector(actor.curLevel.hero.x, (actor.curLevel.hero.y - (actor.curLevel.hero.height / 2)));
if (_local2.x > actor.x){
actor.scaleX = 1;
} else {
actor.scaleX = -1;
};
if (_local2.x < actor.x){
_local3 = (actor.jump) ? (actor.speed.x * 0.8) : actor.speed.x;
actor.x = (actor.x - _local3);
} else {
if (_local2.x > actor.x){
_local3 = (actor.jump) ? (actor.speed.x * 0.8) : actor.speed.x;
actor.x = (actor.x + _local3);
};
};
actor.updateActorParts(new ageVector(actor.curLevel.hero.x, (actor.curLevel.hero.y - (actor.curLevel.hero.height / 2))));
if (((!(actor.timerBulletDelay.running)) && (!(actor.timerReloadDelay.running)))){
actor.startShoot(new ageVector(actor.curLevel.hero.x, (actor.curLevel.hero.y - (actor.curLevel.hero.height / 2))));
};
actor.updateDynObj();
if (((ageMath.aproxEqual(actor.oldX, actor.x, (actor.speed.x / 4))) && (!(actor.jump)))){
actor.jump = true;
actor.speed.y = actor.jumpSpeed;
};
actor.updateRunJumpState(false);
actor.oldX = actor.x;
}
public function AlienBigBoss_endMoveToEnemy(_arg1:Array=null){
}
public function TurrelBomb_beginAttack(_arg1:Array=null){
}
public function AlienSeeder_beginSeed(_arg1:Array=null){
actor.body.gotoAndPlay(2);
}
public function AlienBomber_procDie(_arg1:Array=null){
}
public function AlienBomber_endIdle(_arg1:Array=null){
}
public function AlienSolder_beginDie(_arg1:Array=null){
actor.dead = true;
actor.head.visible = false;
actor.arm1.visible = false;
actor.arm2.visible = false;
actor.curLevel.addProp_Money2(actor.x, actor.y);
}
public function AlienSeeder_procDie(_arg1:Array=null){
}
public function AlienBomber_beginIdle(_arg1:Array=null){
}
public function AlienSeeder_endIdle(_arg1:Array=null){
}
public function AlienElectro_procDie(_arg1:Array=null){
}
public function AlienPredator_beginDie(_arg1:Array=null){
var _local2:int;
actor.dead = true;
actor.visible = false;
actor.rLeg.stop();
actor.lLeg.stop();
actor.curLevel.addFX_littleBlast(actor.x, (actor.y - 15), 1.8);
actor.curLevel.addFX_littleSmoke(actor.x, (actor.y - 25), 2);
sounds.PlaySnd("bombExp", 10, actor, actor.stage);
if (mainGlobal.configDebrisOn){
_local2 = 0;
_local2 = 0;
while (_local2 < 35) {
actor.curLevel.addProp_Debris(actor.x, actor.y);
_local2++;
};
};
actor.curLevel.addProp_Money2(actor.x, actor.y);
actor.curLevel.addProp_Money2(actor.x, actor.y);
actor.curLevel.addProp_Money2(actor.x, actor.y);
actor.curLevel.addProp_Money2(actor.x, actor.y);
}
public function AlienElectro_endIdle(_arg1:Array=null){
}
public function Turrel_beginDie(_arg1:Array=null){
var _local2:uint;
var _local3:Point = actor.curLevel.globalToLocal(MovieClip(actor.parent).localToGlobal(new Point(actor.x, actor.y)));
if (mainGlobal.configDebrisOn){
_local2 = 0;
while (_local2 < 10) {
actor.curLevel.addProp_Debris(_local3.x, _local3.y);
_local2++;
};
if (actor.actorType == "AlienHunterBlaster"){
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienBlasterDebris1");
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienBlasterDebris2");
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienBlasterDebris3");
};
};
actor.dead = true;
actor.curLevel.addFX_littleBlast((actor.x + MovieClip(actor.parent).x), ((actor.y - 15) + MovieClip(actor.parent).y));
actor.curLevel.addFX_littleSmoke((actor.x + MovieClip(actor.parent).x), ((actor.y - 25) + MovieClip(actor.parent).y));
sounds.PlaySnd("bombExp", 1.5, actor, actor.stage);
actor.visible = false;
actor.anim.stop();
}
public function AlienSeeder_procSeed(_arg1:Array=null){
var _local2:Point;
var _local3:String;
actor.speed.mulScalar(0.9);
if ((((actor.body.currentFrame == 100)) && (!(actor.alreadySeed)))){
actor.alreadySeed = true;
_local2 = actor.curLevel.globalToLocal(actor.body.hatch.localToGlobal(new Point((actor.body.hatch.h1.x + (actor.body.hatch.h1.width * 0.5)), actor.body.hatch.h1.y)));
_local3 = ("Zomb0" + ageMath.RandomInt(1, 5));
if (!ageMath.RandomInt(0, 1)){
_local3 = (_local3 + "Run");
} else {
if (!ageMath.RandomInt(0, 1)){
_local3 = (_local3 + "Vomit");
};
};
actor.curLevel.addActorsArr.push(new addActorStruct(_local2.x, _local2.y, _local3, actor.curLevel.getChildIndex(actor)));
_local2 = actor.curLevel.globalToLocal(actor.body.hatch.localToGlobal(new Point((actor.body.hatch.h2.x + (actor.body.hatch.h2.width * 0.5)), actor.body.hatch.h2.y)));
_local3 = ("Zomb0" + ageMath.RandomInt(1, 5));
if (!ageMath.RandomInt(0, 1)){
_local3 = (_local3 + "Run");
} else {
if (!ageMath.RandomInt(0, 1)){
_local3 = (_local3 + "Vomit");
};
};
actor.curLevel.addActorsArr.push(new addActorStruct(_local2.x, _local2.y, _local3, actor.curLevel.getChildIndex(actor)));
_local2 = actor.curLevel.globalToLocal(actor.body.hatch.localToGlobal(new Point((actor.body.hatch.h3.x + (actor.body.hatch.h3.width * 0.5)), actor.body.hatch.h3.y)));
_local3 = ("Zomb0" + ageMath.RandomInt(1, 5));
if (!ageMath.RandomInt(0, 1)){
_local3 = (_local3 + "Run");
} else {
if (!ageMath.RandomInt(0, 1)){
_local3 = (_local3 + "Vomit");
};
};
actor.curLevel.addActorsArr.push(new addActorStruct(_local2.x, _local2.y, _local3, actor.curLevel.getChildIndex(actor)));
_local2 = actor.curLevel.globalToLocal(actor.body.hatch.localToGlobal(new Point((actor.body.hatch.h4.x + (actor.body.hatch.h4.width * 0.5)), actor.body.hatch.h4.y)));
_local3 = ("Zomb0" + ageMath.RandomInt(1, 5));
if (!ageMath.RandomInt(0, 1)){
_local3 = (_local3 + "Run");
} else {
if (!ageMath.RandomInt(0, 1)){
_local3 = (_local3 + "Vomit");
};
};
actor.curLevel.addActorsArr.push(new addActorStruct(_local2.x, _local2.y, _local3, actor.curLevel.getChildIndex(actor)));
actor.body.gotoAndPlay(101);
} else {
if (actor.body.currentFrame == 150){
actor.fsmAI.postEvent("endSeed");
actor.alreadySeed = false;
actor.body.gotoAndStop(1);
};
};
}
public function AlienHunter_procIdle(_arg1:Array=null){
if ((((actor.distToEnemy <= actor.seeRadius)) || (actor.alwaysSeeEnemy))){
actor.fsmAI.postEvent("findEnemy");
actor.setTarget(new ageVector(ageMath.Random((actor.curLevel.hero.x - 200), (actor.curLevel.hero.x + 200)), ageMath.Random((actor.curLevel.hero.y - 300), (actor.curLevel.hero.y - 200))));
};
}
public function AlienBigBoss_procIdle(_arg1:Array=null){
if ((((actor.distToEnemy <= actor.seeRadius)) || (actor.alwaysSeeEnemy))){
actor.fsmAI.postEvent("findEnemy");
actor.setTarget(new ageVector(ageMath.Random((actor.curLevel.hero.x - 200), (actor.curLevel.hero.x + 200)), ageMath.Random((actor.curLevel.hero.y - 200), (actor.curLevel.hero.y + 200))));
};
}
public function AlienPredator_endMoveToEnemy(_arg1:Array=null){
}
public function AlienHunter_beginMoveToEnemy(_arg1:Array=null){
}
public function Turrel_endAttack(_arg1:Array=null){
}
public function AlienSolder_endAttack(_arg1:Array=null){
}
public function AlienHunter_changeTarget(_arg1:Array=null){
actor.setTarget(new ageVector(ageMath.Random((actor.curLevel.hero.x - 200), (actor.curLevel.hero.x + 200)), ageMath.Random((actor.curLevel.hero.y - 300), (actor.curLevel.hero.y - 200))));
}
public function Turrel_beginAttack(_arg1:Array=null){
}
public function AlienBigBoss_beginMoveToEnemy(_arg1:Array=null){
}
public function AlienBomber_procMoveToEnemy(_arg1:Array=null){
var _local2:Point;
if (actor.distToEnemy <= actor.attackRadius){
actor.fsmAI.postEvent("canAttack");
};
if ((((actor.distToEnemy > actor.seeRadius)) && (!(actor.alwaysSeeEnemy)))){
actor.fsmAI.postEvent("lostEnemy");
};
if (!actor.timerBulletDelay.running){
_local2 = actor.curLevel.globalToLocal(actor.localToGlobal(new Point(actor.pointShoot.x, actor.pointShoot.y)));
actor.curLevel.addProj_BombWep(_local2.x, _local2.y, _local2.x, (_local2.y + 25), actor.weapons[0]);
actor.timerBulletDelay.start();
};
if (actor.speed.x > 0){
actor.LEngFire.startFadeIn();
actor.REngFire.startFadeOut();
} else {
actor.LEngFire.startFadeOut();
actor.REngFire.startFadeIn();
};
if (actor.speed.y < 2){
actor.BEngFire1.startFadeIn();
actor.BEngFire2.startFadeIn();
} else {
actor.BEngFire1.startFadeOut();
actor.BEngFire2.startFadeOut();
};
actor.updateDynObj();
}
public function Turrel_procIdle(_arg1:Array=null){
if (actor.distToEnemy <= actor.seeRadius){
actor.fsmAI.postEvent("findEnemy");
};
}
public function Turrel_beginIdle(_arg1:Array=null){
}
public function AlienSolder_procIdle(_arg1:Array=null){
if (actor.distToEnemy <= actor.seeRadius){
actor.fsmAI.postEvent("findEnemy");
};
}
public function AlienSolder_beginAttack(_arg1:Array=null){
actor.gotoAndStop("stand");
}
public function AlienSolder_beginMoveToEnemy(_arg1:Array=null){
actor.gotoAndStop("run");
}
public function AlienPredator_procIdle(_arg1:Array=null){
actor.rLeg.gotoAndPlay(36);
actor.lLeg.gotoAndPlay(1);
actor.fsmAI.postEvent("findEnemy");
}
public function AlienSeeder_procMoveToEnemy(_arg1:Array=null){
actor.curTargetChanged++;
if (actor.curTargetChanged == actor.maxTargetChanged){
actor.fsmAI.postEvent("startSeed");
actor.curTargetChanged = 0;
return;
};
if (actor.distToEnemy <= actor.attackRadius){
actor.fsmAI.postEvent("canAttack");
};
if ((((actor.distToEnemy > actor.seeRadius)) && (!(actor.alwaysSeeEnemy)))){
actor.fsmAI.postEvent("lostEnemy");
};
if (actor.speed.x > 0){
actor.LEngFire.startFadeIn();
actor.REngFire.startFadeOut();
} else {
actor.LEngFire.startFadeOut();
actor.REngFire.startFadeIn();
};
if (actor.speed.y < 2){
actor.BEngFire1.startFadeIn();
actor.BEngFire2.startFadeIn();
} else {
actor.BEngFire1.startFadeOut();
actor.BEngFire2.startFadeOut();
};
actor.updateDynObj();
}
public function AlienSolder_beginIdle(_arg1:Array=null){
}
public function Zomb_endAttack(_arg1:Array=null){
}
public function AlienSeeder_beginDie(_arg1:Array=null){
var _local2:int;
actor.dead = true;
actor.curLevel.addFX_littleBlast(actor.x, (actor.y - 15), 1.8);
actor.curLevel.addFX_littleSmoke(actor.x, (actor.y - 25), 2);
sounds.PlaySnd("bigExp", 10, actor, actor.stage);
sounds.PlaySnd("midExp", 10, actor, actor.stage);
sounds.PlaySnd("bombExp", 10, actor, actor.stage);
if (MovieClip(actor).blaster){
if (MovieClip(actor).blaster.visible == true){
MovieClip(actor).blaster.fsmAI.postEvent("killed");
};
};
actor.visible = false;
if (mainGlobal.configDebrisOn){
_local2 = 0;
_local2 = 0;
while (_local2 < 15) {
actor.curLevel.addProp_Debris(actor.x, actor.y);
_local2++;
};
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienHunterDebris1");
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienHunterDebris2");
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienHunterDebris3");
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienHunterDebris4");
};
actor.curLevel.addProp_Money2(actor.x, actor.y);
actor.curLevel.addProp_Money2(actor.x, actor.y);
actor.curLevel.addProp_Money1(actor.x, actor.y);
actor.curLevel.addProp_Money1(actor.x, actor.y);
}
public function AlienElectro_procMoveToEnemy(_arg1:Array=null){
actor.vChildTime++;
if (actor.vChildTime > 35){
actor.vChildTime = 0;
actor.vChildPos++;
if (actor.vChildPos > 4){
actor.vChildPos = 0;
};
};
var _local2:Number = 350;
var _local3:Number = 0;
var _local4:Number = (Math.PI / 4);
var _local5:Number = ((_local2 * Math.cos((_local4 * actor.vChildPos))) - (_local3 * Math.sin((_local4 * actor.vChildPos))));
var _local6:Number = ((_local3 * Math.cos((_local4 * actor.vChildPos))) + (_local2 * Math.sin((_local4 * actor.vChildPos))));
actor.vChild.rotation = 90;
actor.vChild.width = _local2;
actor.vChild.rotation = (90 + (actor.vChildPos * 45));
var _local7:ageVector = ageMath.getLineCrossRect(actor.x, actor.y, (actor.x + _local5), (actor.y + _local6), (actor.curLevel.hero.x - (actor.curLevel.hero.width / 2)), (actor.curLevel.hero.y - actor.curLevel.hero.height), (actor.curLevel.hero.x + (actor.curLevel.hero.width / 2)), actor.curLevel.hero.y);
if (((_local7) && ((actor.curLevel.hero.electroCurLevel < 25)))){
actor.curLevel.hero.addElectroDamage(0.8);
};
if (actor.distToEnemy <= actor.attackRadius){
};
if ((((actor.distToEnemy > actor.seeRadius)) && (!(actor.alwaysSeeEnemy)))){
actor.fsmAI.postEvent("lostEnemy");
};
if (actor.speed.x > 0){
actor.LEngFire.startFadeIn();
actor.REngFire.startFadeOut();
} else {
actor.LEngFire.startFadeOut();
actor.REngFire.startFadeIn();
};
if (actor.speed.y < 2){
actor.BEngFire2.startFadeIn();
} else {
actor.BEngFire2.startFadeOut();
};
actor.updateDynObj();
}
public function AlienPredator_beginMoveToEnemy(_arg1:Array=null){
}
public function Zomb_procDie(_arg1:Array=null){
}
public function AlienElectro_beginDie(_arg1:Array=null){
var _local2:int;
actor.dead = true;
actor.curLevel.addFX_littleBlast(actor.x, (actor.y - 15), 1.8);
actor.curLevel.addFX_littleSmoke(actor.x, (actor.y - 25), 2);
sounds.PlaySnd("midExp", 10, actor, actor.stage);
sounds.PlaySnd("bombExp", 10, actor, actor.stage);
if (MovieClip(actor).blaster){
if (MovieClip(actor).blaster.visible == true){
MovieClip(actor).blaster.fsmAI.postEvent("killed");
};
};
actor.visible = false;
if (mainGlobal.configDebrisOn){
_local2 = 0;
_local2 = 0;
while (_local2 < 15) {
actor.curLevel.addProp_Debris(actor.x, actor.y);
_local2++;
};
};
actor.curLevel.addProp_Money1(actor.x, actor.y);
actor.curLevel.addProp_Money1(actor.x, actor.y);
actor.curLevel.addProp_Money1(actor.x, actor.y);
}
public function AlienBomber_changeTarget(_arg1:Array=null){
actor.setTarget(new ageVector(ageMath.Random((actor.curLevel.hero.x - 200), (actor.curLevel.hero.x + 200)), ageMath.Random((actor.curLevel.hero.y - 300), (actor.curLevel.hero.y - 200))));
}
public function Zomb_endIdle(_arg1:Array=null){
}
public function Turrel_endDie(_arg1:Array=null){
}
public function AlienBomber_endDie(_arg1:Array=null){
}
public function AlienSaw_changeTarget(_arg1:Array=null){
if (actor.curTargetChanged == actor.maxTargetChanged){
actor.curTargetChanged = 0;
actor.setTarget(new ageVector(ageMath.Random((actor.curLevel.hero.x - 200), (actor.curLevel.hero.x + 200)), ageMath.Random((actor.curLevel.hero.y - 300), (actor.curLevel.hero.y - 200))));
} else {
actor.curTargetChanged++;
actor.setTarget(new ageVector((actor.curLevel.hero.x + ageMath.Random(-10, 10)), ((actor.curLevel.hero.y - (actor.curLevel.hero.height / 2)) + ageMath.Random(-10, 10))));
};
}
public function AlienSeeder_endDie(_arg1:Array=null){
}
public function TurrelBomb_endDie(_arg1:Array=null){
}
public function AlienSaw_endDie(_arg1:Array=null){
}
public function AlienElectro_beginIdle(_arg1:Array=null){
}
public function Bomb_endAttack(_arg1:Array=null){
}
public function Zomb_beginIdle(_arg1:Array=null){
}
public function Bomb_endDie(_arg1:Array=null){
}
public function AlienSeeder_beginIdle(_arg1:Array=null){
}
public function AlienSolder_endDie(_arg1:Array=null){
}
public function AlienSaw_procDie(_arg1:Array=null){
}
public function AlienElectro_endDie(_arg1:Array=null){
}
public function AlienPredator_procDie(_arg1:Array=null){
}
public function AlienSaw_endIdle(_arg1:Array=null){
}
public function TurrelBomb_procAttack(_arg1:Array=null){
var _local2:Point;
actor.calcGlobalPos();
actor.setRotTarget(actor.curLevel.hero.x, actor.curLevel.hero.y);
actor.updateDynObj();
actor.rotate();
if (((!(actor.timerBulletDelay.running)) && (actor.rotTargeted))){
_local2 = actor.curLevel.globalToLocal(actor.localToGlobal(new Point(actor.anim.pointShoot.x, actor.anim.pointShoot.y)));
actor.curLevel.addBlasterProj(_local2.x, _local2.y, actor.curLevel.hero.x, actor.curLevel.hero.y, actor.weapons[0]);
actor.timerBulletDelay.start();
actor.anim.gotoAndPlay(2);
};
}
public function Bomb_procDie(_arg1:Array=null){
}
public function Turrel_procAttack(_arg1:Array=null){
var _local3:Point;
actor.calcGlobalPos();
actor.setRotTarget(actor.curLevel.hero.x, actor.curLevel.hero.y);
actor.updateDynObj();
actor.rotate();
actor.live.rotation = -(actor.rotation);
var _local2:ageVector = new ageVector(-51, -23);
_local2.rotDeg(actor.live.rotation);
actor.live.x = _local2.x;
actor.live.y = _local2.y;
if (((!(actor.timerBulletDelay.running)) && (actor.rotTargeted))){
_local3 = actor.curLevel.globalToLocal(actor.localToGlobal(new Point(actor.anim.pointShoot.x, actor.anim.pointShoot.y)));
actor.curLevel.addBlasterProj(_local3.x, _local3.y, actor.curLevel.hero.x, actor.curLevel.hero.y, actor.weapons[0]);
actor.timerBulletDelay.start();
actor.anim.gotoAndPlay(2);
};
}
public function Zomb_attackHit(_arg1:Array=null){
var _local2:projObject;
if (actor.distToEnemy <= actor.attackRadius){
_local2 = new projObject();
_local2.damage = actor.damagePerHit;
_local2.x = actor.curLevel.hero.x;
_local2.y = (actor.curLevel.hero.y - (actor.curLevel.hero.height / 2));
actor.curLevel.hero.transmitDamage(_local2);
Game(actor.curLevel.parent).gameGUI.painFrame.startFadeOut();
};
}
public function Zomb_firstAttackEnd(_arg1:Array=null){
actor.firstAttack = false;
}
public function Bomb_endIdle(_arg1:Array=null){
}
public function Zomb_endDie(_arg1:Array=null){
}
public function Bomb_procAttack(_arg1:Array=null){
if (actor.anim.currentFrame == 60){
actor.fsmAI.postEvent("killed");
};
}
public function AlienSolder_procAttack(_arg1:Array=null){
if (actor.distToEnemy > actor.seeRadius){
actor.fsmAI.postEvent("lostEnemy");
};
if (actor.distToEnemy > actor.attackRadius){
actor.fsmAI.postEvent("farToAttack");
};
actor.updateActorParts(new ageVector(actor.curLevel.hero.x, actor.curLevel.hero.y));
if (((!(actor.timerBulletDelay.running)) && (!(actor.timerReloadDelay.running)))){
actor.startShoot(new ageVector(actor.curLevel.hero.x, (actor.curLevel.hero.y - (actor.curLevel.hero.height / 2))));
};
}
public function AlienHunter_endDie(_arg1:Array=null){
}
public function AlienBomber_beginDie(_arg1:Array=null){
var _local2:int;
actor.dead = true;
actor.curLevel.addFX_littleBlast(actor.x, (actor.y - 15), 1.8);
actor.curLevel.addFX_littleSmoke(actor.x, (actor.y - 25), 2);
sounds.PlaySnd("midExp", 1.5, actor, actor.stage);
sounds.PlaySnd("bigExp", 1.5, actor, actor.stage);
actor.visible = false;
if (mainGlobal.configDebrisOn){
_local2 = 0;
_local2 = 0;
while (_local2 < 15) {
actor.curLevel.addProp_Debris(actor.x, actor.y);
_local2++;
};
};
actor.curLevel.addProp_Money1(actor.x, actor.y);
actor.curLevel.addProp_Money2(actor.x, actor.y);
actor.curLevel.addProp_Money1(actor.x, actor.y);
}
public function TurrelBomb_endIdle(_arg1:Array=null){
}
public function AlienPredator_beginIdle(_arg1:Array=null){
}
public function AlienElectro_procIdle(_arg1:Array=null){
if ((((actor.distToEnemy <= actor.seeRadius)) || (actor.alwaysSeeEnemy))){
actor.fsmAI.postEvent("findEnemy");
actor.setTarget(new ageVector(ageMath.Random((actor.curLevel.hero.x - 200), (actor.curLevel.hero.x + 200)), ageMath.Random((actor.curLevel.hero.y - 300), (actor.curLevel.hero.y - 200))));
};
}
public function AlienHunter_beginIdle(_arg1:Array=null){
}
public function TurrelBomb_endAttack(_arg1:Array=null){
}
public function AlienSaw_beginIdle(_arg1:Array=null){
}
public function TurrelBomb_beginIdle(_arg1:Array=null){
}
public function AlienSeeder_procIdle(_arg1:Array=null){
if ((((actor.distToEnemy <= actor.seeRadius)) || (actor.alwaysSeeEnemy))){
actor.fsmAI.postEvent("findEnemy");
actor.setTarget(new ageVector(ageMath.Random((actor.curLevel.hero.x - 200), (actor.curLevel.hero.x + 200)), ageMath.Random((actor.curLevel.hero.y - 300), (actor.curLevel.hero.y - 200))));
};
}
public function TurrelBomb_beginDie(_arg1:Array=null){
var _local2:uint;
var _local3:Point = actor.curLevel.globalToLocal(MovieClip(actor.parent).localToGlobal(new Point(actor.x, actor.y)));
if (mainGlobal.configDebrisOn){
_local2 = 0;
while (_local2 < 10) {
actor.curLevel.addProp_Debris(_local3.x, _local3.y);
_local2++;
};
if (actor.actorType == "AlienHunterBlaster"){
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienBlasterDebris1");
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienBlasterDebris2");
actor.curLevel.addProp_Debris(actor.x, actor.y, 1, "AlienBlasterDebris3");
};
};
actor.dead = true;
actor.curLevel.addFX_littleBlast((actor.x + MovieClip(actor.parent).x), ((actor.y - 15) + MovieClip(actor.parent).y));
actor.curLevel.addFX_littleSmoke((actor.x + MovieClip(actor.parent).x), ((actor.y - 25) + MovieClip(actor.parent).y));
sounds.PlaySnd("bombExp", 1.5, actor, actor.stage);
actor.visible = false;
actor.anim.stop();
}
public function AlienElectro_beginMoveToEnemy(_arg1:Array=null){
}
public function AlienSaw_attackHit(_arg1:Array=null){
var _local2:projObject;
if (actor.distToEnemy <= actor.attackRadius){
if (!actor.curLevel.hero.timerBloodFXDelay.running){
sounds.PlaySnd(("sawAttack" + ageMath.RandomInt(1, 3)), 1.5, actor, actor.stage);
};
_local2 = new projObject();
_local2.damage = actor.damagePerHit;
_local2.x = actor.curLevel.hero.x;
_local2.y = (actor.curLevel.hero.y - (actor.curLevel.hero.height / 2));
actor.curLevel.hero.transmitDamage(_local2);
Game(actor.curLevel.parent).gameGUI.painFrame.startFadeOut();
};
}
public function Bomb_beginIdle(_arg1:Array=null){
}
public function AlienPredator_endIdle(_arg1:Array=null){
}
public function Zomb_procMoveToEnemy(_arg1:Array=null){
var _local4:Number;
if (actor.distToEnemy <= actor.attackRadius){
actor.fsmAI.postEvent("canAttack");
};
if (actor.distToEnemy > actor.seeRadius){
actor.fsmAI.postEvent("lostEnemy");
} else {
if (actor.useSelfWep){
if (((!(actor.timerBulletDelay.running)) && (!(actor.timerReloadDelay.running)))){
actor.startShoot(new ageVector(actor.curLevel.hero.x, (actor.curLevel.hero.y - (actor.curLevel.hero.height / 2))));
if (sounds){
sounds.PlaySnd(("VomitShoot" + ageMath.RandomInt(1, 2).toString()), 1, actor, actor.stage);
};
if (actor.noArmsShootCnt == 3){
actor.startShoot(new ageVector(actor.curLevel.hero.x, (actor.curLevel.hero.y - (actor.curLevel.hero.height * 1.5))));
actor.startShoot(new ageVector(actor.curLevel.hero.x, (actor.curLevel.hero.y - (actor.curLevel.hero.height * 2))));
};
};
};
};
if (actor.useSelfWepPsy){
if (((!(actor.timerBulletDelay.running)) && (!(actor.timerReloadDelay.running)))){
actor.startShoot(new ageVector(actor.curLevel.hero.x, (actor.curLevel.hero.y - (actor.curLevel.hero.height / 2))));
if (sounds){
sounds.PlaySnd(("VomitShoot" + ageMath.RandomInt(1, 2).toString()), 1, actor, actor.stage);
};
};
};
var _local2:ageVector = new ageVector(actor.curLevel.hero.x, actor.curLevel.hero.y);
var _local3:ageVector = new ageVector((_local2.x - actor.x), (_local2.y - (actor.y - 35))).norm();
if (_local2.x > actor.x){
actor.scaleX = 1;
} else {
actor.scaleX = -1;
};
if (_local2.x < actor.x){
_local4 = (actor.jump) ? (actor.speed.x * 0.8) : actor.speed.x;
actor.x = (actor.x - _local4);
} else {
if (_local2.x > actor.x){
_local4 = (actor.jump) ? (actor.speed.x * 0.8) : actor.speed.x;
actor.x = (actor.x + _local4);
};
};
}
public function Zomb_procAttack(_arg1:Array=null){
if ((((actor.distToEnemy > actor.seeRadius)) && (!(actor.firstAttack)))){
actor.fsmAI.postEvent("lostEnemy");
};
if ((((actor.distToEnemy > actor.attackRadius)) && (!(actor.firstAttack)))){
actor.fsmAI.postEvent("farToAttack");
};
if (actor.useSelfWepPsy){
if (((!(actor.timerBulletDelay.running)) && (!(actor.timerReloadDelay.running)))){
actor.startShoot(new ageVector(actor.curLevel.hero.x, (actor.curLevel.hero.y - (actor.curLevel.hero.height / 2))));
if (sounds){
sounds.PlaySnd(("VomitShoot" + ageMath.RandomInt(1, 2).toString()), 1, actor, actor.stage);
};
};
};
}
public function AlienSeeder_beginMoveToEnemy(_arg1:Array=null){
}
public function AlienBigBoss_endIdle(_arg1:Array=null){
}
public function TurrelBomb_procDie(_arg1:Array=null){
}
public function AlienSolder_endMoveToEnemy(_arg1:Array=null){
}
public function AlienBomber_endMoveToEnemy(_arg1:Array=null){
}
public function AlienSeeder_changeTarget(_arg1:Array=null){
actor.setTarget(new ageVector(ageMath.Random((actor.curLevel.hero.x - 200), (actor.curLevel.hero.x + 200)), ageMath.Random((actor.curLevel.hero.y - 300), (actor.curLevel.hero.y - 200))));
}
public function AlienSaw_endMoveToEnemy(_arg1:Array=null){
}
}
}//package main
Section 57
//FSMEvent (main.FSMEvent)
package main {
import flash.events.*;
public dynamic class FSMEvent extends Event {
public var data;
public static const ONPOSTED:String = "OnPosted";
public function FSMEvent(_arg1:String, _arg2){
this.data = _arg2;
super(_arg1);
}
}
}//package main
Section 58
//FSMTrans (main.FSMTrans)
package main {
public dynamic class FSMTrans {
var paramFunc:Array;
var execFunc:Function;
var curEvent:String;
var stateFrom:String;
var stateTo:String;
public function FSMTrans(_arg1:String, _arg2:String, _arg3:String, _arg4:Function, _arg5:Array=null){
stateFrom = _arg1;
curEvent = _arg2;
stateTo = _arg3;
execFunc = _arg4;
paramFunc = _arg5;
}
}
}//package main
Section 59
//fxBlast (main.fxBlast)
package main {
public dynamic class fxBlast extends fxObject {
}
}//package main
Section 60
//fxBlastWave (main.fxBlastWave)
package main {
public dynamic class fxBlastWave extends fxObject {
public function fxBlastWave(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
this.visible = false;
}
}
}//package main
Section 61
//fxblink (main.fxblink)
package main {
public dynamic class fxblink extends alphaFader {
public function fxblink(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package main
Section 62
//fxBloodSpatters (main.fxBloodSpatters)
package main {
public dynamic class fxBloodSpatters extends fxObject {
public function fxBloodSpatters(){
addFrameScript(19, frame20);
}
function frame20(){
visible = false;
}
}
}//package main
Section 63
//fxHeadshot (main.fxHeadshot)
package main {
public dynamic class fxHeadshot extends fxObject {
public function fxHeadshot(){
addFrameScript(29, frame30);
}
function frame30(){
visible = false;
}
}
}//package main
Section 64
//fxLittleSmoke (main.fxLittleSmoke)
package main {
public dynamic class fxLittleSmoke extends fxObject {
}
}//package main
Section 65
//fxMetalSparks (main.fxMetalSparks)
package main {
public dynamic class fxMetalSparks extends fxObject {
public function fxMetalSparks(){
addFrameScript(29, frame30);
}
function frame30(){
this.visible = false;
stop();
}
}
}//package main
Section 66
//fxObject (main.fxObject)
package main {
public class fxObject extends baseObject {
}
}//package main
Section 67
//fxVomitSpatters (main.fxVomitSpatters)
package main {
public dynamic class fxVomitSpatters extends fxObject {
public function fxVomitSpatters(){
addFrameScript(19, frame20);
}
function frame20(){
visible = false;
}
}
}//package main
Section 68
//Game (main.Game)
package main {
import flash.display.*;
import flash.events.*;
import mochi.as3.*;
import flash.utils.*;
import flash.net.*;
import CPMStar.*;
import flash.ui.*;
public dynamic class Game extends MovieClip {
public var splashOG:MovieClip;
var tmp_prog:preloader;// = null
public var groundBG:bg;
public var menuWinGame:menuWinGame;
public var my_cMenu:ContextMenu;
public var sky:MovieClip;
public var timerLogo2:Timer;
public var ad:DisplayObject;
public var CPMStarContentSpotID:String;
public var adBox:adBoxClass;
var cursorBlockCh:Boolean;// = false
var tmp_Cursor:Cursor;// = null
public var menuWinLose:menuWinLose;
public var bPlay:buttonPlay;
public var menuMain:menuMain;
var curLev:Level;// = null
public var cacheRem:MovieClip;
public var fadeBG:fader50percVis;
public var preloaderOG:MovieClip;
public var menuUpgradeShop:menuUpgradeShop;
public var cursor:Cursor;
var tmp_but:buttonPlay;// = null
public var gamButSnd:MovieClip;
var tmp_CursorReload:ReloadCurType;// = null
public var gameGUI:gameGui;
public var menuInGame:menuInGame;
public var ld:preloader;
public function Game(){
addFrameScript(0, frame1, 1, frame2, 10, frame11, 11, frame12);
}
public function gamButSnd_Click(_arg1:Event):void{
if (gamButSnd.currentFrame == 1){
sounds.PlaySnd("menuClick");
mainGlobal.configMusicOn = false;
mainGlobal.configSoundOn = false;
mainGlobal.applyConfig();
mainGlobal.saveConfig();
gamButSnd.gotoAndStop(2);
} else {
sounds.PlaySnd("menuClick");
mainGlobal.configMusicOn = true;
mainGlobal.configSoundOn = true;
mainGlobal.applyConfig();
mainGlobal.saveConfig();
gamButSnd.gotoAndStop(1);
};
}
public function mouseLeave(_arg1:Event):void{
if (!cursorBlockCh){
cursor.visible = false;
stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseBack);
};
}
public function bPlay_Click(_arg1:Event):void{
this.removeChild(this["adBox"]);
this.gotoAndPlay(2);
}
public function mouseBack(_arg1:Event):void{
if (!cursorBlockCh){
cursor.visible = true;
stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseBack);
};
}
public function loadLevel(_arg1:String){
if (curLev != null){
delLevel();
};
if (_arg1 == "Level1"){
curLev = new Level1();
} else {
if (_arg1 == "Level2"){
curLev = new Level2();
} else {
if (_arg1 == "Level3"){
curLev = new Level3();
} else {
if (_arg1 == "Level4"){
curLev = new Level4();
} else {
if (_arg1 == "Level5"){
curLev = new Level5();
} else {
if (_arg1 == "Level6"){
curLev = new Level6();
} else {
if (_arg1 == "Level7"){
curLev = new Level7();
} else {
if (_arg1 == "Level8"){
curLev = new Level8();
} else {
if (_arg1 == "Level9"){
curLev = new Level9();
} else {
if (_arg1 == "Level10"){
curLev = new Level10();
};
};
};
};
};
};
};
};
};
};
curLev.visible = true;
gameGUI.visible = true;
mainGlobal.paused = false;
Game(root).cursor.gotoAndStop("cross");
var _local2:int = getChildIndex(sky);
addChildAt(curLev, (_local2 + 1));
stage.focus = this;
}
public function delLevel(){
curLev.term();
removeChild(curLev);
curLev = null;
}
function frame11(){
cursor.visible = true;
cursor.gotoAndStop("arrow");
stop();
timerLogo2 = new Timer(8000, 1);
timerLogo2.start();
timerLogo2.addEventListener(TimerEvent.TIMER, timerLogo2_Timer);
splashOG.addEventListener(MouseEvent.CLICK, splashOG_click);
splashOG.buttonMode = true;
}
public function timerLogo2_Timer(_arg1:TimerEvent):void{
play();
}
function frame12(){
if (((!(mainGlobal.configMusicOn)) && (!(mainGlobal.configSoundOn)))){
gamButSnd.gotoAndStop(2);
} else {
gamButSnd.gotoAndStop(1);
};
gamButSnd.buttonMode = true;
gamButSnd.addEventListener(MouseEvent.CLICK, gamButSnd_Click, false, 0, true);
menuInGame.visible = false;
stop();
gameGUI.painFrame.use_force_restart = true;
menuWinLose.use_force_restart = true;
menuWinLose.fadeSpeed = 0.03;
menuWinGame.use_force_restart = true;
menuWinGame.fadeSpeed = 0.03;
fadeBG.fadeSpeed = 0.03;
fadeBG.use_force_restart = true;
fadeBG.startFadeOut();
musicEnv.fadeTo("musMenu");
}
public function preloaderOG_click(_arg1:Event):void{
navigateToURL(new URLRequest("http://www.onlinegamer.cc?utm_source=Ted&utm_medium=preloader"), "_blank");
}
public function splashOG_click(_arg1:Event):void{
navigateToURL(new URLRequest("http://www.onlinegamer.cc?utm_source=Ted&utm_medium=splash"), "_blank");
}
public function mouseClick(_arg1:Event):void{
if (!cursorBlockCh){
cursor.visible = true;
Mouse.hide();
};
}
function frame2(){
sounds.init(stage.stageWidth, stage.stageHeight);
musicEnv.init();
cursor.visible = false;
gotoAndStop(11);
}
function frame1(){
stop();
if (!mainGlobal.isCookieExist()){
mainGlobal.initCookie();
} else {
mainGlobal.loadConfig();
mainGlobal.applyConfig();
};
stage.quality = (mainGlobal.configQuaHigh) ? StageQuality.MEDIUM : StageQuality.LOW;
Controls.regMC(stage);
Mouse.hide();
cursor.startDrag(true);
cursor.mouseEnabled = false;
cursor.mouseChildren = false;
stage.addEventListener(MouseEvent.CLICK, mouseClick);
stage.addEventListener(Event.MOUSE_LEAVE, mouseLeave);
my_cMenu = new ContextMenu();
my_cMenu.hideBuiltInItems();
contextMenu = my_cMenu;
MochiServices.connect("ab8a8afba7348126", root);
MochiBot.track(this, "b77f1844");
mainGlobal.noAds = ((ld.isUrl(["kongregate.com", "www.kongregate.com"])) || (ld.isUrl(["flashgamelicense.com", "www.flashgamelicense.com"])));
if (!mainGlobal.noAds){
CPMStarContentSpotID = "3988Q4DB4755D";
ad = new AdLoader(CPMStarContentSpotID);
adBox.addChild(ad);
} else {
adBox.addChild(new adMY());
};
bPlay.addEventListener(MouseEvent.CLICK, bPlay_Click);
bPlay.visible = false;
preloaderOG.addEventListener(MouseEvent.CLICK, preloaderOG_click);
preloaderOG.buttonMode = true;
}
}
}//package main
Section 69
//gameGui (main.gameGui)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class gameGui extends alphaFader {
public var i:uint;
public function gameGui(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
gamButMenu.addEventListener(MouseEvent.CLICK, gamButMenu_Click, false, 0, true);
gamButWT.addEventListener(MouseEvent.CLICK, gamButWT_Click, false, 0, true);
i = 1;
while (i < 9) {
guiWepNum(getChildByName(("wep" + i))).txt.text = i.toString();
i++;
};
}
public function gamButMenu_Click(_arg1:Event):void{
Game(root).curLev.showGameMenu();
}
public function gamButWT_Click(_arg1:Event):void{
Game(root).curLev.showGameMenu();
navigateToURL(new URLRequest("http://onlinegamer.cc/index.php?task=view_page&id=2"), "_blank");
}
}
}//package main
Section 70
//GameVictory (main.GameVictory)
package main {
import flash.media.*;
public dynamic class GameVictory extends Sound {
}
}//package main
Section 71
//guiWepNum (main.guiWepNum)
package main {
import flash.display.*;
import flash.text.*;
public dynamic class guiWepNum extends MovieClip {
public var txt:TextField;
public var flagState:int;// = 1
}
}//package main
Section 72
//helpIco (main.helpIco)
package main {
import flash.media.*;
public dynamic class helpIco extends Sound {
}
}//package main
Section 73
//hlpCtrl (main.hlpCtrl)
package main {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.text.*;
public dynamic class hlpCtrl extends alphaFader {
public var txt2:TextField;
public var timerStayDelay:Timer;
public var pic2:MovieClip;
public var txt:TextField;
public var minDelay:int;// = 2500
public var maxDelay:int;// = 6000
public function hlpCtrl(){
timerStayDelay = new Timer(6000, 1);
super();
addFrameScript(0, frame1);
fadeSpeed = 0.1;
use_force_restart = true;
timerStayDelay.stop();
timerStayDelay.addEventListener(TimerEvent.TIMER, timerStayDelay_Timer, false, 0, true);
}
public function hideHelp(){
startFadeOut();
timerStayDelay.stop();
}
public function timerStayDelay_Timer(_arg1:TimerEvent):void{
hideHelp();
}
public function showHelp(_arg1:int){
if (_arg1 != 8){
txt.visible = false;
} else {
txt.visible = true;
};
if (_arg1 != 9){
txt2.visible = false;
pic2.visible = false;
} else {
txt2.visible = true;
pic2.visible = true;
};
startFadeIn();
timerStayDelay.stop();
timerStayDelay.delay = maxDelay;
timerStayDelay.start();
gotoAndStop(_arg1);
}
function frame1(){
visible = false;
stop();
}
}
}//package main
Section 74
//itemTake (main.itemTake)
package main {
import flash.media.*;
public dynamic class itemTake extends Sound {
}
}//package main
Section 75
//LasergunShoot1 (main.LasergunShoot1)
package main {
import flash.media.*;
public dynamic class LasergunShoot1 extends Sound {
}
}//package main
Section 76
//Level (main.Level)
package main {
import flash.display.*;
public dynamic class Level extends MovieClip {
}
}//package main
Section 77
//Level1 (main.Level1)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.ui.*;
public dynamic class Level1 extends Level {
public var triggerInjManCall:MovieClip;
public var triggerInjMan:MovieClip;
var levRightLim:Number;// = 999999
var dlgSpeedFactor:Number;// = 4
var lastMSFrame:int;// = 9999
public var limEndLevel:MovieClip;
public var enemies:Array;
var levLeftLim:Number;// = -999999
public var propObjects:Array;
public var minLimX:Number;// = 2147483647
public var maxLimX:Number;// = -2147483648
var curBlastShake:Number;// = 0
var isWin:Boolean;// = false
public var dynObjects:Array;
var isLose:Boolean;// = false
var grav:Number;// = 1
public var boss:MovieClip;
public var shotgunMan:MovieClip;
public var limitersCache:Array;
public var triggerCrunchInformer:MovieClip;
var initFirst:Boolean;// = false
var curLevNum:int;// = 1
public var triggerTedMus:MovieClip;
public var FXLayer:MovieClip;
var levelMus:String;// = ""
public var triggerAimShootInformer:MovieClip;
public var triggerSecret1:MovieClip;
public var propLayer:MovieClip;
var sVar:Object;
public var limitersOnScr:Array;
public var triggerTedEatBrains:MovieClip;
public var addActorsArr:Array;
public var limiters:Array;
public var paralaxObjects:Array;
var curLevScore:int;// = 3000
public var fxObjects:Array;
var curBlastShakeDec:Number;// = 0.3
public var goodNPC:Array;
public var chunkObjects:Array;
public var limitersCacheStep:int;// = 640
var curScale:Number;// = 1
public var projObjects:Array;
public var hero:MovieClip;
public var projLayer:MovieClip;
public var triggerJumpInformer:MovieClip;
public function Level1(){
sVar = new Object();
limiters = new Array();
limitersCache = new Array();
limitersOnScr = new Array();
dynObjects = new Array();
enemies = new Array();
goodNPC = new Array();
paralaxObjects = new Array();
projObjects = new Array();
chunkObjects = new Array();
fxObjects = new Array();
propObjects = new Array();
addActorsArr = new Array();
super();
addFrameScript(0, frame1);
init();
}
public function addFX_VomitSplatters(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxVomitSpatters();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function initLimCache(){
var _local1:*;
var _local2:int;
var _local3:int;
var _local4:int;
maxLimX = int.MIN_VALUE;
minLimX = int.MAX_VALUE;
_local1 = 0;
while (_local1 < limiters.length) {
if (limiters[_local1].x < minLimX){
minLimX = limiters[_local1].x;
};
if ((limiters[_local1].x + limiters[_local1].width) > maxLimX){
maxLimX = limiters[_local1].x;
};
_local1++;
};
limitersCache = [];
_local1 = 0;
while (_local1 < (((maxLimX - minLimX) / limitersCacheStep) + 1)) {
limitersCache.push(new Array());
_local1++;
};
_local1 = 0;
while (_local1 < limiters.length) {
_local3 = int(((limiters[_local1].x - minLimX) / limitersCacheStep));
_local4 = int((((limiters[_local1].x + limiters[_local1].width) - minLimX) / limitersCacheStep));
_local2 = _local3;
while (_local2 <= _local4) {
if (!limitersCache[_local2]){
limitersCache[_local2] = new Array();
};
limitersCache[_local2].push(limiters[_local1]);
_local2++;
};
_local1++;
};
}
public function addLineDamage(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Boolean{
var _local6:Number;
var _local8:int;
var _local9:ageVector;
var _local7:Boolean;
_local8 = 0;
while (_local8 < enemies.length) {
if (enemies[_local8].dead){
} else {
_local9 = enemies[_local8].hitTestLine(_arg1, _arg2, _arg3, _arg4);
if (_local9 != null){
addLineDamageToEnemy(_local9, _arg5, enemies[_local8], true);
_local7 = true;
};
};
_local8++;
};
return (_local7);
}
public function checkHitPlatform(_arg1, _arg2:Array){
var _local3:int;
_arg1.bottomLimiter = null;
_local3 = 0;
while (_local3 < _arg2.length) {
if (((_arg2[_local3].slimMode) && ((_arg1.speed.y < 0)))){
} else {
if (_arg2[_local3].hitTestObject(_arg1.p2)){
_arg1.jump = false;
if (_arg1.isRubber){
_arg1.speed.y = (_arg1.speed.y * -(_arg1.rubberFactor));
_arg1.speed.x = (_arg1.speed.x * _arg1.rubberFactor);
if (_arg1.useRotateSpeed){
_arg1.rotateSpeed = 0;
};
} else {
_arg1.speed.y = 0;
};
_arg1.y = ((_arg2[_local3].y - _arg1.p2.y) - _arg1.p2.height);
_arg1.bottomLimiter = _arg2[_local3];
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p1)) && (!(_arg2[_local3].slimMode)))){
if (_arg1.scaleX > 0){
_arg1.x = (_arg2[_local3].x - (_arg1.p1.x + _arg1.p1.width));
} else {
_arg1.x = ((_arg2[_local3].x + _arg2[_local3].width) + (_arg1.p1.x + _arg1.p1.width));
};
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p3)) && (!(_arg2[_local3].slimMode)))){
if (_arg1.scaleX > 0){
_arg1.x = ((_arg2[_local3].x + _arg2[_local3].width) - _arg1.p3.x);
} else {
_arg1.x = (_arg2[_local3].x - (-(_arg1.p3.x) + _arg1.p3.width));
};
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p4)) && (!(_arg2[_local3].slimMode)))){
_arg1.speed.y = 0;
_arg1.y = ((_arg2[_local3].y + _arg2[_local3].height) - _arg1.p4.y);
};
};
};
};
};
_local3++;
};
}
public function addFX_MetalSparks(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxMetalSparks();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.blendMode = BlendMode.ADD;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function init(){
addEventListener(Event.ENTER_FRAME, Update, false, 0, true);
}
public function openUpgradeMenu():void{
mainGlobal.paused = true;
this.visible = false;
Game(root).cursor.gotoAndStop("arrow");
Game(parent).menuUpgradeShop.showShop();
musicEnv.fadeTo("musUpgrade");
}
public function addFX_littleSmoke(_arg1:Number, _arg2:Number, _arg3:Number=1.5){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
_local4 = new fxLittleSmoke();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function addBlinkFX_OverLight():void{
Game(parent).gameGUI.fxblink.fadeMaxLimit = 1;
Game(parent).gameGUI.fxblink.fadeSpeed = 0.03;
Game(parent).gameGUI.fxblink.use_force_restart = true;
Game(parent).gameGUI.fxblink.startFadeOut();
curBlastShake = 15;
}
function mouseLeave(_arg1:Event):void{
showGameMenu();
}
public function UpdateDynObjects():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = 0;
while (_local1 < dynObjects.length) {
if (dynObjects[_local1].visible == false){
} else {
if (ageMath.Distance(dynObjects[_local1].x, dynObjects[_local1].y, hero.x, hero.y) < (stage.stageWidth * 1.6)){
if (dynObjects[_local1].gravityEnable){
dynObjects[_local1].speed.y = (dynObjects[_local1].speed.y + (grav * dynObjects[_local1].gravityFactor));
};
dynObjects[_local1].speed.y = ((dynObjects[_local1].speed.y)>dynObjects[_local1].maxSpeed.y) ? dynObjects[_local1].maxSpeed.y : dynObjects[_local1].speed.y;
dynObjects[_local1].y = (dynObjects[_local1].y + dynObjects[_local1].speed.y);
if (dynObjects[_local1].collisionEnable){
_local2 = int((((dynObjects[_local1].x - dynObjects[_local1].width) - minLimX) / limitersCacheStep));
_local3 = int((((dynObjects[_local1].x + dynObjects[_local1].width) - minLimX) / limitersCacheStep));
_local4 = _local2;
while (_local4 <= _local3) {
if (((limitersCache[_local4]) && (limitersCache[_local4].length))){
checkHitPlatform(dynObjects[_local1], limitersCache[_local4]);
};
_local4++;
};
};
};
};
_local1++;
};
}
public function cleenUP():void{
cleenUP_FX();
cleenUP_Proj();
cleenUP_Prop();
cleenUP_Actors();
}
public function addLineDamageToEnemy(_arg1:ageVector, _arg2:Number, _arg3:actorObject, _arg4:Boolean){
var _local5:projObject = new projObject();
_local5.damage = _arg2;
_local5.x = _arg1.x;
_local5.y = _arg1.y;
_local5.fromGoodGuy = _arg4;
_arg3.transmitDamage(_local5);
_local5.clearDynObject();
}
public function addFX_BloodOnGround(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new bloodOnGround();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.gotoAndStop(ageMath.RandomInt(1, 5));
_local3.scaleY = 0.5;
_local3.fadeSpeed = 0.005;
_local3.startFadeOut();
projLayer.addChild(_local3);
_local3.curDispContainer = projLayer;
fxObjects.push(_local3);
return (_local3);
}
public function UpdateParalaxObjects():void{
var _local1:int;
_local1 = 0;
while (_local1 < paralaxObjects.length) {
paralaxObjects[_local1].x = (paralaxObjects[_local1].saveX - ageMath.RemapVal((paralaxObjects[_local1].saveX + x), 0, stage.stageWidth, 0, paralaxObjects[_local1].paralaxX));
paralaxObjects[_local1].y = (paralaxObjects[_local1].saveY - ageMath.RemapVal((paralaxObjects[_local1].saveY + y), 0, stage.stageHeight, 0, paralaxObjects[_local1].paralaxY));
_local1++;
};
}
public function cleenUP_Actors():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < enemies.length) {
if (((((enemies[_local1]) && ((enemies[_local1].visible == false)))) && (enemies[_local1].dead))){
_local2 = 0;
while (_local2 < dynObjects.length) {
if (dynObjects[_local2] == enemies[_local1]){
dynObjects[_local2].clearDynObject();
dynObjects.splice(_local2, 1);
break;
};
_local2++;
};
enemies[_local1].clearActorObject();
if (enemies[_local1]){
if (enemies[_local1].parent){
enemies[_local1].parent.removeChild(enemies[_local1]);
};
};
enemies.splice(_local1, 1);
break;
};
_local1++;
};
}
public function addBlasterProj(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new blasterProj();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function cleenUP_Prop():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < propObjects.length) {
if (((propObjects[_local1]) && ((propObjects[_local1].visible == false)))){
_local2 = 0;
while (_local2 < dynObjects.length) {
if (dynObjects[_local2] == propObjects[_local1]){
dynObjects[_local2].clearDynObject();
dynObjects.splice(_local2, 1);
break;
};
_local2++;
};
if (propObjects[_local1]){
if (propObjects[_local1].parent){
propObjects[_local1].parent.removeChild(propObjects[_local1]);
};
};
propObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function cleenUP_Proj():void{
var _local1:int;
_local1 = 0;
while (_local1 < projObjects.length) {
if (((projObjects[_local1]) && ((projObjects[_local1].visible == false)))){
projObjects[_local1].clearDynObject();
if (projObjects[_local1]){
if (projObjects[_local1].parent){
projObjects[_local1].parent.removeChild(projObjects[_local1]);
};
};
projObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function addBlinkFX_OverLight2():void{
Game(parent).gameGUI.fxblink2.fadeMaxLimit = 1;
Game(parent).gameGUI.fxblink2.fadeSpeed = 0.03;
Game(parent).gameGUI.fxblink2.use_force_restart = true;
Game(parent).gameGUI.fxblink2.startFadeOut();
}
public function testIntersectLimiterOnScr(_arg1:dynObject):Boolean{
var _local2:int;
_local2 = 0;
while (_local2 < limitersOnScr.length) {
if (((!(limitersOnScr[_local2].slimMode)) && (limitersOnScr[_local2].hitTestObject(_arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public function addProp_Shotgun(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propShotgun();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function UpdateLimitersOnScr():void{
var _local1:int;
var _local2:int;
var _local3:*;
var _local4:int;
var _local5:Point;
var _local6:Rectangle;
var _local7:Rectangle;
limitersOnScr = [];
_local1 = int(((-(x) - minLimX) / limitersCacheStep));
_local2 = int((((-(x) + stage.stageWidth) - minLimX) / limitersCacheStep));
_local4 = _local1;
while (_local4 <= _local2) {
if (limitersCache[_local4]){
_local3 = 0;
while (_local3 < limitersCache[_local4].length) {
_local5 = this.localToGlobal(new Point(limitersCache[_local4][_local3].x, limitersCache[_local4][_local3].y));
_local6 = new Rectangle(_local5.x, _local5.y, limitersCache[_local4][_local3].width, limitersCache[_local4][_local3].height);
_local7 = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
if (_local7.intersects(_local6)){
limitersOnScr.push(limitersCache[_local4][_local3]);
};
_local3++;
};
};
_local4++;
};
}
public function addFX_BloodLeak(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new bloodLeak();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.fadeSpeed = 0.005;
_local3.startFadeOut();
projLayer.addChild(_local3);
_local3.curDispContainer = projLayer;
fxObjects.push(_local3);
return (_local3);
}
public function levScript(){
var _local1:int;
if (((Game(parent).gameGUI.hlpControl.visible) && (!(Game(parent).gameGUI.hlpControl.fadingout)))){
if (curLevNum == 1){
if (Game(parent).gameGUI.hlpControl.currentFrame == 1){
if (((((((Controls.key[Keyboard.LEFT]) || (Controls.key[65]))) || (Controls.key[Keyboard.RIGHT]))) || (Controls.key[68]))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
} else {
if (Game(parent).gameGUI.hlpControl.currentFrame == 2){
if (((Controls.key[Keyboard.UP]) || (Controls.key[87]))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
} else {
if (Game(parent).gameGUI.hlpControl.currentFrame == 3){
if (Controls.mouseKey){
Game(parent).gameGUI.hlpControl.hideHelp();
};
} else {
if (Game(parent).gameGUI.hlpControl.currentFrame == 4){
if (((Controls.key[Keyboard.DOWN]) || (Controls.key[83]))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
} else {
if (Game(parent).gameGUI.hlpControl.currentFrame == 6){
if (((Controls.key[49]) || (Controls.key[50]))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
};
};
};
};
};
if (!sVar["triggerSecret1"]){
if (triggerSecret1.hitTestObject(hero)){
sVar["triggerSecret1"] = true;
Game(parent).gameGUI.hlpControl.showHelp(7);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
mainGlobal.secretsFound++;
};
};
if (!sVar["jumpInfoShow"]){
if (triggerJumpInformer.hitTestObject(hero)){
sVar["jumpInfoShow"] = true;
Game(parent).gameGUI.hlpControl.showHelp(2);
};
};
if (!sVar["aimShootInfoShow"]){
if (triggerAimShootInformer.hitTestObject(hero)){
sVar["aimShootInfoShow"] = true;
Game(parent).gameGUI.hlpControl.showHelp(3);
};
};
if (!sVar["crunchInfoShow"]){
if (triggerCrunchInformer.hitTestObject(hero)){
sVar["crunchInfoShow"] = true;
Game(parent).gameGUI.hlpControl.showHelp(4);
};
};
if (!sVar["triggerTedEatBrains"]){
if (triggerTedEatBrains.hitTestObject(hero)){
sVar["triggerTedEatBrains"] = true;
_local1 = Game(parent).gameGUI.dlg.setTo("lev1_TedBrain");
sVar["DlgTedBrainTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
};
} else {
if (!sVar["DlgTedBrainEnd"]){
if (sVar["DlgTedBrainTimer"] == 0){
sVar["DlgTedBrainEnd"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
} else {
var _local2 = sVar;
var _local3 = "DlgTedBrainTimer";
var _local4 = (_local2[_local3] - 1);
_local2[_local3] = _local4;
if (Controls.keyNew[69]){
sVar["DlgTedBrainTimer"] = 0;
};
};
};
};
if (!sVar["triggerTedMus"]){
if (triggerTedMus.hitTestObject(hero)){
sVar["triggerTedMus"] = true;
_local1 = Game(parent).gameGUI.dlg.setTo("lev1_TedMus");
sVar["DlgTedMusTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
levLeftLim = (triggerInjManCall.x + triggerInjManCall.width);
levRightLim = limEndLevel.x;
musicEnv.fadeTo("FatalDamage");
};
} else {
if (!sVar["DlgTedMusEnd"]){
if ((((sVar["DlgTedMusTimer"] == 0)) || (sVar["crunchInfoShow"]))){
sVar["DlgTedMusEnd"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
} else {
_local2 = sVar;
_local3 = "DlgTedMusTimer";
_local4 = (_local2[_local3] - 1);
_local2[_local3] = _local4;
if (Controls.keyNew[69]){
sVar["DlgTedMusTimer"] = 0;
};
};
};
};
if (!sVar["triggerInjManCall"]){
if (triggerInjManCall.hitTestObject(hero)){
sVar["triggerInjManCall"] = true;
sounds.PlaySnd("helpIco");
};
} else {
if (!sVar["triggerInjMan"]){
Game(parent).gameGUI.dlgIco.targetingObject(shotgunMan);
} else {
Game(parent).gameGUI.dlgIco.x = -500;
};
};
if (!sVar["triggerInjMan"]){
if (triggerInjMan.hitTestObject(hero)){
sVar["triggerInjMan"] = true;
levLeftLim = triggerInjManCall.x;
levRightLim = (triggerInjManCall.x + triggerInjManCall.width);
};
} else {
if (!sVar["DlgInjManEnd"]){
if (sVar["DlgInjManTimer"] == 0){
if (sVar["DlgInjManState"] == 0){
_local1 = Game(parent).gameGUI.dlg.setTo("lev1_Ted01");
_local2 = sVar;
_local3 = "DlgInjManState";
_local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
sVar["DlgInjManTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
} else {
if (sVar["DlgInjManState"] == 1){
_local1 = Game(parent).gameGUI.dlg.setTo("lev1_InjMan01");
_local2 = sVar;
_local3 = "DlgInjManState";
_local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
sVar["DlgInjManTimer"] = int((_local1 * dlgSpeedFactor));
} else {
sVar["DlgInjManEnd"] = true;
shotgunMan.play();
Game(parent).gameGUI.dlg.startFadeOut();
addProp_Shotgun((shotgunMan.x + (shotgunMan.width * 0.5)), (shotgunMan.y + (shotgunMan.height * 0.5)));
};
};
} else {
_local2 = sVar;
_local3 = "DlgInjManTimer";
_local4 = (_local2[_local3] - 1);
_local2[_local3] = _local4;
if (Controls.keyNew[69]){
sVar["DlgInjManTimer"] = 0;
};
};
};
};
if (!sVar["wepShotgunTaked"]){
if (hero.weapons[1].active){
sVar["wepShotgunTaked"] = true;
levLeftLim = -999999;
levRightLim = 999999;
Game(parent).gameGUI.hlpControl.showHelp(6);
};
};
if (((!(sVar["DlgTedKilledBoss"])) && ((((boss == null)) || ((boss.visible == false)))))){
sVar["DlgTedKilledBoss"] = true;
_local1 = Game(parent).gameGUI.dlg.setTo("lev1_TedDiff");
sVar["DlgTedDiffTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
} else {
if (sVar["DlgTedKilledBoss"]){
if (!sVar["DlgTedDiffEnd"]){
if (sVar["DlgTedDiffTimer"] == 0){
sVar["DlgTedDiffEnd"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
} else {
_local2 = sVar;
_local3 = "DlgTedDiffTimer";
_local4 = (_local2[_local3] - 1);
_local2[_local3] = _local4;
if (Controls.keyNew[69]){
sVar["DlgTedDiffTimer"] = 0;
};
};
};
};
};
if (((sVar["DlgTedDiffEnd"]) && (!(Game(parent).gameGUI.dlg.visible)))){
if (!isWin){
isWin = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuWinLose.startFadeIn();
Game(root).menuWinLose.setToWin();
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
musicEnv.fadeTo("musWin");
return;
};
};
}
public function UpdateProjObjects():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < projObjects.length) {
if (projObjects[_local1].visible == false){
} else {
if (projObjects[_local1].gravityEnable){
projObjects[_local1].Velocity.y = (projObjects[_local1].Velocity.y + (grav * projObjects[_local1].gravityFactor));
projObjects[_local1].Velocity.y = ((projObjects[_local1].Velocity.y)>projObjects[_local1].maxSpeed.y) ? projObjects[_local1].maxSpeed.y : projObjects[_local1].Velocity.y;
};
projObjects[_local1].updateDynObj();
if (!projObjects[_local1].fromGoodGuy){
if (((!(hero.dead)) && (hero.hitTestProj(projObjects[_local1])))){
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
} else {
hero.transmitDamage(projObjects[_local1]);
Game(parent).gameGUI.painFrame.startFadeOut();
};
};
} else {
_local2 = 0;
while (_local2 < enemies.length) {
if (((!(enemies[_local2].dead)) && (enemies[_local2].hitTestProj(projObjects[_local1])))){
mainGlobal.shootingInEnemies++;
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
} else {
enemies[_local2].transmitDamage(projObjects[_local1]);
};
};
_local2++;
};
};
if (ageMath.Distance(projObjects[_local1].x, projObjects[_local1].y, hero.x, hero.y) > 670){
projObjects[_local1].visible = false;
};
if (testIntersectLimiterOnScr(projObjects[_local1])){
projObjects[_local1].visible = false;
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
};
};
};
_local1++;
};
}
function frame1(){
initFirst = true;
}
public function cleenUP_FX():void{
var _local1:int;
_local1 = 0;
while (_local1 < fxObjects.length) {
if (((fxObjects[_local1]) && ((fxObjects[_local1].visible == false)))){
if (fxObjects[_local1]){
if (fxObjects[_local1].parent){
fxObjects[_local1].parent.removeChild(fxObjects[_local1]);
};
};
fxObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function term(){
var _local1:int;
removeEventListener(Event.ENTER_FRAME, Update);
_local1 = 0;
while (_local1 < enemies.length) {
enemies[_local1].clearActorObject();
_local1++;
};
_local1 = 0;
while (_local1 < dynObjects.length) {
dynObjects[_local1].clearDynObject();
_local1++;
};
dynObjects = [];
enemies = [];
goodNPC = [];
projObjects = [];
paralaxObjects = [];
chunkObjects = [];
fxObjects = [];
propObjects = [];
addActorsArr = [];
limitersCache = [];
limitersOnScr = [];
limiters = [];
}
public function testRayToLimiterOnScr(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean=false, _arg6:Object=null):ageVector{
var _local10:int;
var _local11:ageVector;
var _local12:Number;
var _local13:ageVector;
var _local14:Number;
var _local7:ageVector;
var _local8:ageVector = new ageVector(_arg1, _arg3);
var _local9:Number = Number.MAX_VALUE;
_local10 = 0;
while (_local10 < limitersOnScr.length) {
if (!limitersOnScr[_local10].slimMode){
_local11 = ageMath.getLineCrossRect(_arg1, _arg2, _arg3, _arg4, limitersOnScr[_local10].x, limitersOnScr[_local10].y, (limitersOnScr[_local10].x + limitersOnScr[_local10].width), (limitersOnScr[_local10].y + limitersOnScr[_local10].height));
if (_local11 != null){
if (_local7 == null){
_local7 = new ageVector();
_local7.copy(_local11);
_local9 = ageMath.DistanceVec(_local8, _local7);
} else {
_local12 = ageMath.DistanceVec(_local8, _local11);
if (_local12 < _local9){
_local9 = _local12;
_local7.copy(_local11);
};
};
};
};
_local10++;
};
if (!_arg5){
return (_local7);
};
_arg6.id = -1;
_local10 = 0;
while (_local10 < enemies.length) {
if (enemies[_local10].dead){
} else {
_local13 = enemies[_local10].hitTestLine(_arg1, _arg2, _arg3, _arg4);
if (_local13 != null){
if (_local7 == null){
_local7 = new ageVector();
_local7.copy(_local13);
_arg6.id = _local10;
_local9 = ageMath.DistanceVec(_local8, _local7);
} else {
_local14 = ageMath.DistanceVec(_local8, _local13);
if (_local14 < _local9){
_local9 = _local14;
_arg6.id = _local10;
_local7.copy(_local13);
};
};
};
};
_local10++;
};
return (_local7);
}
public function addFX_Splatters(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxBloodSpatters();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function addProp_Coin(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propCoin();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_Dynamite(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propDynamite();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_MedKit(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new dropMedKit();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addFX_Headshot(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxHeadshot();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function UpdatePropObjects():void{
var _local1:int;
_local1 = 0;
while (_local1 < propObjects.length) {
if (propObjects[_local1].visible == false){
} else {
if (ageMath.Distance(propObjects[_local1].x, propObjects[_local1].y, hero.x, hero.y) >= (stage.stageWidth * 1.6)){
} else {
propObjects[_local1].x = (propObjects[_local1].x + propObjects[_local1].speed.x);
if (propObjects[_local1].useRotateSpeed){
propObjects[_local1].body.rotation = (propObjects[_local1].body.rotation + propObjects[_local1].rotateSpeed);
};
if ((((((((((((propObjects[_local1].propType == "Med")) || ((propObjects[_local1].propType == "Coin")))) || ((propObjects[_local1].propType == "Money")))) || ((propObjects[_local1].propType == "Weapon")))) || ((propObjects[_local1].propType == "Item")))) || ((propObjects[_local1].propType == "Ammo")))){
if (hero.hitTestObject(propObjects[_local1])){
if (propObjects[_local1].propType == "Ammo"){
if (hero.weapons[propObjects[_local1].wepNum].active){
if (hero.weapons[propObjects[_local1].wepNum].bulletsNum < hero.weapons[propObjects[_local1].wepNum].bulletsNumMax){
propObjects[_local1].visible = false;
hero.weapons[propObjects[_local1].wepNum].bulletsNum = (hero.weapons[propObjects[_local1].wepNum].bulletsNum + (hero.weapons[propObjects[_local1].wepNum].bulletsInCatrigeMax * propObjects[_local1].moneyAmount));
if (hero.weapons[propObjects[_local1].wepNum].bulletsNum > hero.weapons[propObjects[_local1].wepNum].bulletsNumMax){
hero.weapons[propObjects[_local1].wepNum].bulletsNum = hero.weapons[propObjects[_local1].wepNum].bulletsNumMax;
};
sounds.PlaySnd((hero.weapons[propObjects[_local1].wepNum].type + "Reloaded"));
};
};
} else {
if (propObjects[_local1].propType == "Med"){
if (hero.life < hero.lifeMax){
propObjects[_local1].visible = false;
hero.life = (hero.life + propObjects[_local1].moneyAmount);
if (hero.life > hero.lifeMax){
hero.life = hero.lifeMax;
};
sounds.PlaySnd("Med");
};
} else {
if (propObjects[_local1].propType == "Item"){
propObjects[_local1].visible = false;
hero.itemsInBag.push(propObjects[_local1].itemName);
sounds.PlaySnd("itemTake");
} else {
if (propObjects[_local1].propType == "Weapon"){
propObjects[_local1].visible = false;
hero.weapons[propObjects[_local1].wepNum].active = true;
hero.curWeaponNum = (propObjects[_local1].wepNum + 1);
sounds.PlaySnd((hero.weapons[(hero.curWeaponNum - 1)].type + "Reloaded"));
} else {
propObjects[_local1].visible = false;
sounds.PlaySnd((propObjects[_local1].propType + "1"));
hero.moneyCnt = (hero.moneyCnt + propObjects[_local1].moneyAmount);
mainGlobal.moneyCollected = (mainGlobal.moneyCollected + propObjects[_local1].moneyAmount);
};
};
};
};
};
};
};
};
_local1++;
};
}
public function addProp_Money2(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMoney2();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
function showGameMenu():void{
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
Game(root).menuInGame.visible = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuInGame.startFadeIn();
}
public function addProp_Money1(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMoney1();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
public function addProj_Psy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new psyProj();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
_local6.gravityComp = false;
_local6.infAmmo = true;
_local6.usePsyDamage = true;
_local6.psyDamageVal = 16;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProj_MinigunBeam(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
var _local10:ageVector = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local10.normThis();
_local10.mulScalar(600);
_arg3 = (_local10.x + _arg1);
_arg4 = (_local10.y + _arg2);
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projMinigunBeam();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.gravityEnable = false;
var _local11:Object = {id:-1};
var _local12:ageVector = testRayToLimiterOnScr(_arg1, _arg2, _arg3, _arg4, true, _local11);
if (_local12 != null){
_arg3 = _local12.x;
_arg4 = _local12.y;
if (_local11.id != -1){
mainGlobal.shootingInEnemies++;
addLineDamageToEnemy(_local12, _arg5.damage, enemies[_local11.id], true);
};
};
_local6.scaleX = (ageMath.Distance(_arg1, _arg2, _arg3, _arg4) / 34);
_local6.rotation = _local8;
var _local13:Array = new Array();
_local13.push(new GlowFilter(0xFFFF00, 1, 15, 15, 4, BitmapFilterQuality.MEDIUM));
_local6.filters = _local13;
if (_arg5 != null){
};
this["FXLayer"].addChild(_local6);
fxObjects.push(_local6);
return (_local6);
}
public function addProj_LaserBeam(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
var _local10:ageVector = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local10.normThis();
_local10.mulScalar(600);
_arg3 = (_local10.x + _arg1);
_arg4 = (_local10.y + _arg2);
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projLaserBeam();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.gravityEnable = false;
var _local11:ageVector = testRayToLimiterOnScr(_arg1, _arg2, _arg3, _arg4);
if (_local11 != null){
_arg3 = _local11.x;
_arg4 = _local11.y;
};
if (addLineDamage(_arg1, _arg2, _arg3, _arg4, _arg5.damage)){
mainGlobal.shootingInEnemies++;
};
_local6.scaleX = (ageMath.Distance(_arg1, _arg2, _arg3, _arg4) / 34);
_local6.rotation = _local8;
_local6.use_force_restart = true;
_local6.fadeSpeed = 0.1;
_local6.startFadeOut();
_local6.gravityEnable = false;
var _local12:Array = new Array();
_local12.push(new GlowFilter(0xFF0000, 1, 15, 15, 1.7, BitmapFilterQuality.MEDIUM));
_local6.filters = _local12;
if (_arg5 != null){
};
this["FXLayer"].addChild(_local6);
fxObjects.push(_local6);
return (_local6);
}
public function addFX_littleBlast(_arg1:Number, _arg2:Number, _arg3:Number=1.5){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
addBlinkFX_OverLight();
_local4 = new fxBlast();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.blendMode = BlendMode.SCREEN;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function addProj(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projBullet();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, 24);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = true;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProp_Debris(_arg1:Number, _arg2:Number, _arg3:Number=1, _arg4:String=""):propObject{
var _local5:propObject;
_local5 = new propDebris();
_local5.x = _arg1;
_local5.y = _arg2;
_local5.speed.y = (ageMath.Random(-6, -18) * _arg3);
_local5.speed.x = (ageMath.Random(-10, 10) * _arg3);
if (_arg4.length){
_local5.gotoAndStop(_arg4);
} else {
_local5.gotoAndStop(ageMath.RandomInt(1, 20));
};
_local5.curLevel = this;
dynObjects.push(_local5);
propObjects.push(_local5);
_local5.isRubber = true;
_local5.stayTime = (3000 + ageMath.RandomInt(1, 2000));
_local5.timerStayDelay.start();
_local5.useRotateSpeed = true;
_local5.rotateSpeed = ageMath.RandomInt(-15, 15);
propLayer.addChild(_local5);
return (_local5);
}
public function addProj_BombWep(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projBombWep();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
_local6.blastStyle = _arg5.blastStyle;
_local6.attackRadius = _arg5.damageRadius;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProj_Rocket(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projRocket();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = true;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
_local6.blastStyle = _arg5.blastStyle;
_local6.attackRadius = _arg5.damageRadius;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function ifMCOnScreen(_arg1:MovieClip):Boolean{
var _local2:Point = this.localToGlobal(new Point(_arg1.x, _arg1.y));
var _local3:Rectangle = _arg1.getBounds(root);
var _local4:Rectangle = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
if (_local4.intersects(_local3)){
return (true);
};
return (false);
}
public function addLimiter(_arg1){
limiters.push(_arg1);
}
public function alignObjXToAnother(_arg1, _arg2):void{
if ((_arg1.x - (_arg1.width * 0.5)) < _arg2.x){
_arg1.x = (_arg1.x + (_arg2.x - (_arg1.x - (_arg1.width * 0.5))));
};
if ((_arg1.x + (_arg1.width * 0.5)) > (_arg2.x + _arg2.width)){
_arg1.x = (_arg1.x - ((_arg1.x + (_arg1.width * 0.5)) - (_arg2.x + _arg2.width)));
};
}
public function levInit(){
mainGlobal.secretsAll = 1;
curLevNum = 1;
curLevScore = 2500;
levelMus = "musGlory";
musicEnv.fadeTo(levelMus);
Game(parent).gameGUI.hlpControl.showHelp(1);
sVar["jumpInfoShow"] = false;
sVar["aimShootInfoShow"] = false;
sVar["crunchInfoShow"] = false;
sVar["triggerInjManCall"] = false;
sVar["triggerInjMan"] = false;
sVar["DlgInjManState"] = 0;
sVar["DlgInjManTimer"] = 0;
sVar["DlgInjManEnd"] = false;
sVar["DlgTedMusTimer"] = 0;
sVar["DlgTedMusEnd"] = false;
sVar["triggerTedEatBrains"] = false;
sVar["DlgTedBrainTimer"] = 0;
sVar["DlgTedBrainEnd"] = false;
sVar["triggerTedMus"] = false;
sVar["DlgTedDiffTimer"] = 0;
sVar["DlgTedDiffEnd"] = false;
sVar["DlgTedKilledBoss"] = false;
sVar["wepShotgunTaked"] = false;
sVar["triggerSecret1"] = false;
levRightLim = ((triggerInjManCall.x + triggerInjManCall.width) + 200);
}
public function addExplotion(_arg1:projObject, _arg2:actorObject=null):void{
var _local3:Number;
var _local5:int;
_local3 = ageMath.Distance(_arg1.x, _arg1.y, hero.x, hero.y);
var _local4:projObject = new projObject();
if (_local3 < _arg1.attackRadius){
_local4.damage = ageMath.RemapVal(_local3, 0, _arg1.attackRadius, _arg1.damage, 0);
_local4.x = hero.x;
_local4.y = (hero.y - (hero.height / 2));
_local4.fromGoodGuy = false;
hero.transmitDamage(_local4);
Game(parent).gameGUI.painFrame.startFadeOut();
_local4.clearDynObject();
};
_local5 = 0;
while (_local5 < enemies.length) {
if (((((enemies[_local5].dead) && (!((_arg2 == null))))) && (!((_arg2 == enemies[_local5]))))){
} else {
_local3 = ageMath.Distance(_arg1.x, _arg1.y, enemies[_local5].x, enemies[_local5].y);
if (_local3 < _arg1.attackRadius){
_local4.damage = ageMath.RemapVal(_local3, 0, _arg1.attackRadius, _arg1.damage, 0);
_local4.x = enemies[_local5].x;
_local4.y = (enemies[_local5].y - (enemies[_local5].height / 2));
_local4.fromGoodGuy = true;
enemies[_local5].transmitDamage(_local4);
_local4.clearDynObject();
};
};
_local5++;
};
}
public function addActor(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:int=-1):actorObject{
var _local6:actorObject;
if (_arg1 == "AlienSaw"){
_local6 = new AlienSaw();
} else {
if (_arg1 == "AlienHunter"){
_local6 = new AlienHunter();
} else {
if (_arg1 == "AlienElectro"){
_local6 = new AlienElectro();
} else {
if (_arg1 == "Zomb01"){
_local6 = new Zomb01();
} else {
if (_arg1 == "Zomb02"){
_local6 = new Zomb02();
} else {
if (_arg1 == "Zomb03"){
_local6 = new Zomb03();
} else {
if (_arg1 == "Zomb04"){
_local6 = new Zomb04();
} else {
if (_arg1 == "Zomb05"){
_local6 = new Zomb05();
} else {
if (_arg1 == "Zomb01Run"){
_local6 = new Zomb01Run();
} else {
if (_arg1 == "Zomb02Run"){
_local6 = new Zomb02Run();
} else {
if (_arg1 == "Zomb03Run"){
_local6 = new Zomb03Run();
} else {
if (_arg1 == "Zomb04Run"){
_local6 = new Zomb04Run();
} else {
if (_arg1 == "Zomb05Run"){
_local6 = new Zomb05Run();
} else {
if (_arg1 == "Zomb01Vomit"){
_local6 = new Zomb01Vomit();
} else {
if (_arg1 == "Zomb02Vomit"){
_local6 = new Zomb02Vomit();
} else {
if (_arg1 == "Zomb03Vomit"){
_local6 = new Zomb03Vomit();
} else {
if (_arg1 == "Zomb04Vomit"){
_local6 = new Zomb04Vomit();
} else {
if (_arg1 == "Zomb05Vomit"){
_local6 = new Zomb05Vomit();
} else {
if (_arg1 == "Spider"){
_local6 = new Spider();
} else {
if (_arg1 == "AlienBomber"){
_local6 = new AlienBomber();
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
_local6.x = _arg3;
_local6.y = _arg4;
_local6.name = _arg2;
if (!_local6.noStatEnemy){
mainGlobal.enemiesAll++;
};
if (_arg5 < 0){
addChild(_local6);
} else {
addChildAt(_local6, _arg5);
};
return (_local6);
}
public function addProp_minigunAmmo(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMinigunAmmo();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addFX_BlastWave(_arg1:Number, _arg2:Number, _arg3:Number=1){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
_local4 = new fxBlastWave();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function Update(_arg1:Event):void{
var _local5:int;
var _local6:*;
var _local7:*;
var _local11:int;
var _local12:addActorStruct;
var _local13:int;
var _local14:Number;
var _local15:Array;
var _local16:ColorMatrix;
if (isWin){
hero.body.stop();
return;
};
if (((((mainGlobal.paused) || (!(visible)))) || (!((parent as Game))))){
return;
};
if ((((hero.life <= 0)) && (!(isLose)))){
isLose = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuWinLose.startFadeIn();
Game(root).menuWinLose.setToLose();
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
musicEnv.fadeTo("musLose");
sounds.PlaySnd(("TedDie" + ageMath.RandomInt(1, 2).toString()), 0.8);
return;
};
if (initFirst){
if (((!(mainGlobal.configMusicOn)) && (!(mainGlobal.configSoundOn)))){
Game(parent).gamButSnd.gotoAndStop(2);
} else {
Game(parent).gamButSnd.gotoAndStop(1);
};
initFirst = false;
initLimCache();
Game(parent).fadeBG.fadeSpeed = 0.03;
Game(parent).fadeBG.use_force_restart = true;
Game(parent).fadeBG.startFadeOut();
Game(parent).gameGUI.hlpControl.visible = false;
Game(parent).gameGUI.dlg.visible = false;
Game(parent).gameGUI.dlgIco.x = -500;
_local6 = (hero.x * this.scaleX);
_local7 = ((hero.y - 95) * this.scaleY);
x = -((_local6 - (stage.stageWidth * 0.5)));
y = -((_local7 - (stage.stageHeight * 0.5)));
mainGlobal.initStat();
_local11 = 0;
_local11 = 0;
while (_local11 < enemies.length) {
if (!enemies[_local11].noStatEnemy){
mainGlobal.enemiesAll++;
};
_local11++;
};
Game(parent).sky.visible = true;
levInit();
if (mainGlobal.isSingleEp){
if (curLevNum == 1){
_local5 = 0;
while (_local5 < 1) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 0;
} else {
if (curLevNum == 2){
_local5 = 0;
while (_local5 < 2) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 200;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
} else {
if (curLevNum == 3){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
} else {
if (curLevNum == 4){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1300;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
} else {
if (curLevNum == 5){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1500;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
} else {
if (curLevNum == 6){
_local5 = 0;
while (_local5 < 4) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 2000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
} else {
if (curLevNum == 7){
_local5 = 0;
while (_local5 < 5) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 3000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
} else {
if (curLevNum == 8){
_local5 = 0;
while (_local5 < 5) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 3500;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
} else {
if (curLevNum == 9){
_local5 = 0;
while (_local5 < 6) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = 5;
hero.moneyCnt = 4000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
hero.applyUpgrade(1, 4);
hero.upgradesLife[4].active = true;
} else {
if (curLevNum == 10){
_local5 = 0;
while (_local5 < 6) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = 5;
hero.moneyCnt = 4000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
hero.applyUpgrade(1, 4);
hero.upgradesLife[4].active = true;
};
};
};
};
};
};
};
};
};
};
};
Game(parent).gameGUI.dlgIco.gotoAndStop(1);
};
var _local2:int = getTimer();
cleenUP();
UpdateLimitersOnScr();
UpdateParalaxObjects();
UpdateDynObjects();
UpdatePropObjects();
UpdateEnemies();
UpdateProjObjects();
hero.updateActor();
hero.applyDamages();
hero.testIsActorDead();
if (addActorsArr.length){
while (addActorsArr.length) {
_local12 = addActorsArr.pop();
addActor(_local12.strClass, "", _local12.posx, _local12.posy, _local12.orderZ);
};
};
var _local3:int;
_local3 = 0;
while (_local3 < chunkObjects.length) {
if (ifMCOnScreen(chunkObjects[_local3])){
chunkObjects[_local3].visible = true;
} else {
chunkObjects[_local3].visible = false;
};
_local3++;
};
levScript();
var _local4:Boolean;
if (Controls.key[Keyboard.F2]){
hero.life = 1;
};
if (Controls.key[Keyboard.ESCAPE]){
showGameMenu();
};
if (!hero.timerReloadDelay.running){
_local13 = 0;
while (_local13 < 8) {
if (((((Controls.key[(49 + _local13)]) && (!((hero.curWeaponNum == (_local13 + 1)))))) && (hero.weapons[_local13].active))){
hero.curWeaponNum = (_local13 + 1);
sounds.PlaySnd((hero.weapons[(hero.curWeaponNum - 1)].type + "Reloaded"));
};
_local13++;
};
};
if (Game(root).cursor.currentLabel == "cross"){
_local14 = ageMath.Distance(hero.x, hero.y, (Controls.mousePosX - x), (Controls.mousePosY - y));
Game(root).cursor.shootAcc.scaleX = (Game(root).cursor.shootAcc.scaleY = ((hero.wepAcc * _local14) / hero.weapons[(hero.curWeaponNum - 1)].accDistScale));
};
_local5 = 0;
_local5 = 0;
while (_local5 < 8) {
if (((hero.weapons[_local5]) && (hero.weapons[_local5].active))){
if ((((hero.weapons[_local5].bulletsInCatrige == 0)) && ((hero.weapons[_local5].bulletsNum == 0)))){
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 2){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 2;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(-124);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
} else {
if (hero.curWeaponNum != (_local5 + 1)){
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 1){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 1;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(0);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
} else {
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 3){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 3;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(87);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
};
};
} else {
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 4){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 4;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 0.5;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(0);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
};
_local5++;
};
Game(parent).gameGUI.wepInfo.catTxt.text = ((hero.weapons[(hero.curWeaponNum - 1)].bulletsInCatrige + "/") + hero.weapons[(hero.curWeaponNum - 1)].bulletsInCatrigeMax);
if (!hero.weapons[(hero.curWeaponNum - 1)].infAmmo){
Game(parent).gameGUI.wepInfo.allTxt.text = hero.weapons[(hero.curWeaponNum - 1)].bulletsNum;
} else {
Game(parent).gameGUI.wepInfo.allTxt.text = "INF";
};
Game(parent).gameGUI.wepInfo.pic.gotoAndStop((hero.curWeaponNum + 4));
if ((hero.x - (hero.width * 0.5)) < levLeftLim){
hero.x = (levLeftLim + (hero.width * 0.5));
} else {
if ((hero.x + (hero.width * 0.5)) > levRightLim){
hero.x = (levRightLim - (hero.width * 0.5));
};
};
_local6 = ageMath.Lerp((Controls.mousePosX - x), (hero.x * scaleX), 0.6);
_local7 = ageMath.Lerp((Controls.mousePosY - y), ((hero.y - 95) * scaleY), 0.6);
if (!_local4){
x = Math.round(ageMath.Lerp(x, -((_local6 - (stage.stageWidth * 0.5))), 0.15));
y = Math.round(ageMath.Lerp(y, -((_local7 - (stage.stageHeight * 0.5))), 0.15));
} else {
x = -((_local6 - (stage.stageWidth * 0.5)));
y = -((_local7 - (stage.stageHeight * 0.5)));
};
if (this["blackScr"]){
this["blackScr"].x = -(x);
this["blackScr"].y = -(y);
};
var _local8:Point = this.localToGlobal(new Point(levLeftLim, 0));
var _local9:Point = this.localToGlobal(new Point(levRightLim, 0));
if (_local8.x > 0){
x = (x - _local8.x);
} else {
if (_local9.x < stage.stageWidth){
x = (x + (stage.stageWidth - _local9.x));
};
};
if (curBlastShake > 0){
x = (x + ageMath.Random(-(curBlastShake), curBlastShake));
y = (y + ageMath.Random(-(curBlastShake), curBlastShake));
curBlastShake = (curBlastShake - curBlastShakeDec);
if (curBlastShake < 0){
curBlastShake = 0;
};
};
Game(parent).gameGUI.lifeBar.gotoAndStop(Math.round(ageMath.RemapVal(Math.round(hero.life), 1, hero.lifeMax, 1, 100)));
Game(parent).gameGUI.lifeBar.width = ageMath.RemapVal(Math.round(hero.lifeMax), 100, 300, 108, 227);
Game(parent).gameGUI.txtMoney.text = ("$" + hero.moneyCnt);
var _local10:int;
_local10 = 0;
while (_local10 < 6) {
if (hero.itemsInBag[_local10]){
Game(parent).gameGUI[("itm" + _local10)].gotoAndStop(hero.itemsInBag[_local10]);
} else {
Game(parent).gameGUI[("itm" + _local10)].gotoAndStop(1);
};
_local10++;
};
if (hero.bioMaxLevel > 0){
Game(parent).gameGUI.hazBio.visible = true;
Game(parent).gameGUI.hazBio.gotoAndStop((100 - int(ageMath.RemapVal(hero.bioCurLevel, 0, hero.bioMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazBio.visible = false;
};
if (hero.psyMaxLevel > 0){
Game(parent).gameGUI.hazPsy.visible = true;
Game(parent).gameGUI.hazPsy.gotoAndStop((100 - int(ageMath.RemapVal(hero.psyCurLevel, 0, hero.psyMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazPsy.visible = false;
};
if (hero.electroMaxLevel > 0){
Game(parent).gameGUI.hazElectro.visible = true;
Game(parent).gameGUI.hazElectro.gotoAndStop((100 - int(ageMath.RemapVal(hero.electroCurLevel, 0, hero.electroMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazElectro.visible = false;
};
Controls.updateKeyNew();
if (Game(parent).groundBG){
Game(parent).groundBG.changeBG(x, y);
};
}
public function addProp_Blaster(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propBlaster();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function UpdateEnemies():void{
var _local1:int;
_local1 = 0;
while (_local1 < enemies.length) {
if (((enemies[_local1].dead) || ((enemies[_local1].life <= 0)))){
} else {
if (((((!((enemies[_local1].parent as Level))) || (enemies[_local1].alwaysSeeEnemy))) || ((ageMath.Distance(enemies[_local1].x, enemies[_local1].y, hero.x, hero.y) < (stage.stageWidth * 1.6))))){
enemies[_local1].updateActorEnemy();
};
};
_local1++;
};
}
public function addProj_Vomit(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projVomit();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.timerFXAdd.delay = 80;
_local6.timerFXAdd.start();
_local6.fxFunc = addFX_VomitSplatters;
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = true;
_local6.gravityComp = true;
_local6.infAmmo = true;
_local6.useBioDamage = true;
_local6.bioDamageVal = 10;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProp_blasterAmmo(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propBlasterAmmo();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
}
}//package main
Section 78
//Level10 (main.Level10)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.ui.*;
public dynamic class Level10 extends Level {
public var triggerBottomBorder:MovieClip;
var levRightLim:Number;// = 999999
public var seeder1:MovieClip;
var dlgSpeedFactor:Number;// = 4
var lastMSFrame:int;// = 9999
public var leveler1:MovieClip;
var levLeftLim:Number;// = -999999
public var enemies:Array;
public var propObjects:Array;
public var minLimX:Number;// = 2147483647
public var maxLimX:Number;// = -2147483648
var curBlastShake:Number;// = 0
var isWin:Boolean;// = false
public var dynObjects:Array;
var isLose:Boolean;// = false
var grav:Number;// = 1
public var boss:AlienBigBoss;
public var limitersCache:Array;
public var leveler1Trigger:MovieClip;
public var triggerUpgrade1:MovieClip;
var initFirst:Boolean;// = false
var curLevNum:int;// = 1
public var triggerRightBorder:MovieClip;
public var FXLayer:MovieClip;
var levelMus:String;// = ""
public var triggerSecret1:MovieClip;
public var propLayer:MovieClip;
var sVar:Object;
public var limitersOnScr:Array;
public var addActorsArr:Array;
public var limiters:Array;
public var triggerBossBorder:MovieClip;
var curLevScore:int;// = 3000
public var paralaxObjects:Array;
var curBlastShakeDec:Number;// = 0.3
public var hatch1Lim:MovieClip;
public var fxObjects:Array;
public var limitersCacheStep:int;// = 640
public var goodNPC:Array;
public var chunkObjects:Array;
var curScale:Number;// = 1
public var triggerLeftBorder:MovieClip;
public var hatch1:MovieClip;
public var projObjects:Array;
public var hero:MovieClip;
public var projLayer:MovieClip;
public function Level10(){
sVar = new Object();
limiters = new Array();
limitersCache = new Array();
limitersOnScr = new Array();
dynObjects = new Array();
enemies = new Array();
goodNPC = new Array();
paralaxObjects = new Array();
projObjects = new Array();
chunkObjects = new Array();
fxObjects = new Array();
propObjects = new Array();
addActorsArr = new Array();
super();
addFrameScript(0, frame1);
init();
}
public function addFX_VomitSplatters(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxVomitSpatters();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function initLimCache(){
var _local1:*;
var _local2:int;
var _local3:int;
var _local4:int;
maxLimX = int.MIN_VALUE;
minLimX = int.MAX_VALUE;
_local1 = 0;
while (_local1 < limiters.length) {
if (limiters[_local1].x < minLimX){
minLimX = limiters[_local1].x;
};
if ((limiters[_local1].x + limiters[_local1].width) > maxLimX){
maxLimX = limiters[_local1].x;
};
_local1++;
};
limitersCache = [];
_local1 = 0;
while (_local1 < (((maxLimX - minLimX) / limitersCacheStep) + 1)) {
limitersCache.push(new Array());
_local1++;
};
_local1 = 0;
while (_local1 < limiters.length) {
_local3 = int(((limiters[_local1].x - minLimX) / limitersCacheStep));
_local4 = int((((limiters[_local1].x + limiters[_local1].width) - minLimX) / limitersCacheStep));
_local2 = _local3;
while (_local2 <= _local4) {
if (!limitersCache[_local2]){
limitersCache[_local2] = new Array();
};
limitersCache[_local2].push(limiters[_local1]);
_local2++;
};
_local1++;
};
}
public function addLineDamage(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Boolean{
var _local6:Number;
var _local8:int;
var _local9:ageVector;
var _local7:Boolean;
_local8 = 0;
while (_local8 < enemies.length) {
if (enemies[_local8].dead){
} else {
_local9 = enemies[_local8].hitTestLine(_arg1, _arg2, _arg3, _arg4);
if (_local9 != null){
addLineDamageToEnemy(_local9, _arg5, enemies[_local8], true);
_local7 = true;
};
};
_local8++;
};
return (_local7);
}
public function checkHitPlatform(_arg1, _arg2:Array){
var _local3:int;
_arg1.bottomLimiter = null;
_local3 = 0;
while (_local3 < _arg2.length) {
if (((_arg2[_local3].slimMode) && ((_arg1.speed.y < 0)))){
} else {
if (_arg2[_local3].hitTestObject(_arg1.p2)){
_arg1.jump = false;
if (_arg1.isRubber){
_arg1.speed.y = (_arg1.speed.y * -(_arg1.rubberFactor));
_arg1.speed.x = (_arg1.speed.x * _arg1.rubberFactor);
if (_arg1.useRotateSpeed){
_arg1.rotateSpeed = 0;
};
} else {
_arg1.speed.y = 0;
};
_arg1.y = ((_arg2[_local3].y - _arg1.p2.y) - _arg1.p2.height);
_arg1.bottomLimiter = _arg2[_local3];
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p1)) && (!(_arg2[_local3].slimMode)))){
if (_arg1.scaleX > 0){
_arg1.x = (_arg2[_local3].x - (_arg1.p1.x + _arg1.p1.width));
} else {
_arg1.x = ((_arg2[_local3].x + _arg2[_local3].width) + (_arg1.p1.x + _arg1.p1.width));
};
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p3)) && (!(_arg2[_local3].slimMode)))){
if (_arg1.scaleX > 0){
_arg1.x = ((_arg2[_local3].x + _arg2[_local3].width) - _arg1.p3.x);
} else {
_arg1.x = (_arg2[_local3].x - (-(_arg1.p3.x) + _arg1.p3.width));
};
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p4)) && (!(_arg2[_local3].slimMode)))){
_arg1.speed.y = 0;
_arg1.y = ((_arg2[_local3].y + _arg2[_local3].height) - _arg1.p4.y);
};
};
};
};
};
_local3++;
};
}
public function openUpgradeMenu():void{
mainGlobal.paused = true;
this.visible = false;
Game(root).cursor.gotoAndStop("arrow");
Game(parent).menuUpgradeShop.showShop();
musicEnv.fadeTo("musUpgrade");
}
public function Update(_arg1:Event):void{
var _local5:int;
var _local6:*;
var _local7:*;
var _local11:int;
var _local12:addActorStruct;
var _local13:int;
var _local14:Number;
var _local15:Array;
var _local16:ColorMatrix;
if (isWin){
hero.body.stop();
return;
};
if (((((mainGlobal.paused) || (!(visible)))) || (!((parent as Game))))){
return;
};
if ((((hero.life <= 0)) && (!(isLose)))){
isLose = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuWinLose.startFadeIn();
Game(root).menuWinLose.setToLose();
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
musicEnv.fadeTo("musLose");
sounds.PlaySnd(("TedDie" + ageMath.RandomInt(1, 2).toString()), 0.8);
return;
};
if (initFirst){
if (((!(mainGlobal.configMusicOn)) && (!(mainGlobal.configSoundOn)))){
Game(parent).gamButSnd.gotoAndStop(2);
} else {
Game(parent).gamButSnd.gotoAndStop(1);
};
initFirst = false;
initLimCache();
Game(parent).fadeBG.fadeSpeed = 0.03;
Game(parent).fadeBG.use_force_restart = true;
Game(parent).fadeBG.startFadeOut();
Game(parent).gameGUI.hlpControl.visible = false;
Game(parent).gameGUI.dlg.visible = false;
Game(parent).gameGUI.dlgIco.x = -500;
_local6 = (hero.x * this.scaleX);
_local7 = ((hero.y - 95) * this.scaleY);
x = -((_local6 - (stage.stageWidth * 0.5)));
y = -((_local7 - (stage.stageHeight * 0.5)));
mainGlobal.initStat();
_local11 = 0;
_local11 = 0;
while (_local11 < enemies.length) {
if (!enemies[_local11].noStatEnemy){
mainGlobal.enemiesAll++;
};
_local11++;
};
Game(parent).sky.visible = true;
levInit();
if (mainGlobal.isSingleEp){
if (curLevNum == 1){
_local5 = 0;
while (_local5 < 1) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 0;
} else {
if (curLevNum == 2){
_local5 = 0;
while (_local5 < 2) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 200;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
} else {
if (curLevNum == 3){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
} else {
if (curLevNum == 4){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1300;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
} else {
if (curLevNum == 5){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1500;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
} else {
if (curLevNum == 6){
_local5 = 0;
while (_local5 < 4) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 2000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
} else {
if (curLevNum == 7){
_local5 = 0;
while (_local5 < 5) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 3000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
} else {
if (curLevNum == 8){
_local5 = 0;
while (_local5 < 5) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 3500;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
} else {
if (curLevNum == 9){
_local5 = 0;
while (_local5 < 6) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = 5;
hero.moneyCnt = 4000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
hero.applyUpgrade(1, 4);
hero.upgradesLife[4].active = true;
} else {
if (curLevNum == 10){
_local5 = 0;
while (_local5 < 6) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = 5;
hero.moneyCnt = 4000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
hero.applyUpgrade(1, 4);
hero.upgradesLife[4].active = true;
};
};
};
};
};
};
};
};
};
};
};
Game(parent).gameGUI.dlgIco.gotoAndStop(1);
};
var _local2:int = getTimer();
cleenUP();
UpdateLimitersOnScr();
UpdateParalaxObjects();
UpdateDynObjects();
UpdatePropObjects();
UpdateEnemies();
UpdateProjObjects();
hero.updateActor();
hero.applyDamages();
hero.testIsActorDead();
if (addActorsArr.length){
while (addActorsArr.length) {
_local12 = addActorsArr.pop();
addActor(_local12.strClass, "", _local12.posx, _local12.posy, _local12.orderZ);
};
};
var _local3:int;
_local3 = 0;
while (_local3 < chunkObjects.length) {
if (ifMCOnScreen(chunkObjects[_local3])){
chunkObjects[_local3].visible = true;
} else {
chunkObjects[_local3].visible = false;
};
_local3++;
};
levScript();
var _local4:Boolean;
if (Controls.key[Keyboard.F2]){
hero.life = 1;
};
if (Controls.key[Keyboard.ESCAPE]){
showGameMenu();
};
if (!hero.timerReloadDelay.running){
_local13 = 0;
while (_local13 < 8) {
if (((((Controls.key[(49 + _local13)]) && (!((hero.curWeaponNum == (_local13 + 1)))))) && (hero.weapons[_local13].active))){
hero.curWeaponNum = (_local13 + 1);
sounds.PlaySnd((hero.weapons[(hero.curWeaponNum - 1)].type + "Reloaded"));
};
_local13++;
};
};
if (Game(root).cursor.currentLabel == "cross"){
_local14 = ageMath.Distance(hero.x, hero.y, (Controls.mousePosX - x), (Controls.mousePosY - y));
Game(root).cursor.shootAcc.scaleX = (Game(root).cursor.shootAcc.scaleY = ((hero.wepAcc * _local14) / hero.weapons[(hero.curWeaponNum - 1)].accDistScale));
};
_local5 = 0;
_local5 = 0;
while (_local5 < 8) {
if (((hero.weapons[_local5]) && (hero.weapons[_local5].active))){
if ((((hero.weapons[_local5].bulletsInCatrige == 0)) && ((hero.weapons[_local5].bulletsNum == 0)))){
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 2){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 2;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(-124);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
} else {
if (hero.curWeaponNum != (_local5 + 1)){
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 1){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 1;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(0);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
} else {
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 3){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 3;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(87);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
};
};
} else {
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 4){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 4;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 0.5;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(0);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
};
_local5++;
};
Game(parent).gameGUI.wepInfo.catTxt.text = ((hero.weapons[(hero.curWeaponNum - 1)].bulletsInCatrige + "/") + hero.weapons[(hero.curWeaponNum - 1)].bulletsInCatrigeMax);
if (!hero.weapons[(hero.curWeaponNum - 1)].infAmmo){
Game(parent).gameGUI.wepInfo.allTxt.text = hero.weapons[(hero.curWeaponNum - 1)].bulletsNum;
} else {
Game(parent).gameGUI.wepInfo.allTxt.text = "INF";
};
Game(parent).gameGUI.wepInfo.pic.gotoAndStop((hero.curWeaponNum + 4));
if ((hero.x - (hero.width * 0.5)) < levLeftLim){
hero.x = (levLeftLim + (hero.width * 0.5));
} else {
if ((hero.x + (hero.width * 0.5)) > levRightLim){
hero.x = (levRightLim - (hero.width * 0.5));
};
};
_local6 = ageMath.Lerp((Controls.mousePosX - x), (hero.x * scaleX), 0.6);
_local7 = ageMath.Lerp((Controls.mousePosY - y), ((hero.y - 95) * scaleY), 0.6);
if (!_local4){
x = Math.round(ageMath.Lerp(x, -((_local6 - (stage.stageWidth * 0.5))), 0.15));
y = Math.round(ageMath.Lerp(y, -((_local7 - (stage.stageHeight * 0.5))), 0.15));
} else {
x = -((_local6 - (stage.stageWidth * 0.5)));
y = -((_local7 - (stage.stageHeight * 0.5)));
};
if (this["blackScr"]){
this["blackScr"].x = -(x);
this["blackScr"].y = -(y);
};
var _local8:Point = this.localToGlobal(new Point(levLeftLim, 0));
var _local9:Point = this.localToGlobal(new Point(levRightLim, 0));
if (_local8.x > 0){
x = (x - _local8.x);
} else {
if (_local9.x < stage.stageWidth){
x = (x + (stage.stageWidth - _local9.x));
};
};
if (curBlastShake > 0){
x = (x + ageMath.Random(-(curBlastShake), curBlastShake));
y = (y + ageMath.Random(-(curBlastShake), curBlastShake));
curBlastShake = (curBlastShake - curBlastShakeDec);
if (curBlastShake < 0){
curBlastShake = 0;
};
};
Game(parent).gameGUI.lifeBar.gotoAndStop(Math.round(ageMath.RemapVal(Math.round(hero.life), 1, hero.lifeMax, 1, 100)));
Game(parent).gameGUI.lifeBar.width = ageMath.RemapVal(Math.round(hero.lifeMax), 100, 300, 108, 227);
Game(parent).gameGUI.txtMoney.text = ("$" + hero.moneyCnt);
var _local10:int;
_local10 = 0;
while (_local10 < 6) {
if (hero.itemsInBag[_local10]){
Game(parent).gameGUI[("itm" + _local10)].gotoAndStop(hero.itemsInBag[_local10]);
} else {
Game(parent).gameGUI[("itm" + _local10)].gotoAndStop(1);
};
_local10++;
};
if (hero.bioMaxLevel > 0){
Game(parent).gameGUI.hazBio.visible = true;
Game(parent).gameGUI.hazBio.gotoAndStop((100 - int(ageMath.RemapVal(hero.bioCurLevel, 0, hero.bioMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazBio.visible = false;
};
if (hero.psyMaxLevel > 0){
Game(parent).gameGUI.hazPsy.visible = true;
Game(parent).gameGUI.hazPsy.gotoAndStop((100 - int(ageMath.RemapVal(hero.psyCurLevel, 0, hero.psyMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazPsy.visible = false;
};
if (hero.electroMaxLevel > 0){
Game(parent).gameGUI.hazElectro.visible = true;
Game(parent).gameGUI.hazElectro.gotoAndStop((100 - int(ageMath.RemapVal(hero.electroCurLevel, 0, hero.electroMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazElectro.visible = false;
};
Controls.updateKeyNew();
if (Game(parent).groundBG){
Game(parent).groundBG.changeBG(x, y);
};
}
public function addFX_littleSmoke(_arg1:Number, _arg2:Number, _arg3:Number=1.5){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
_local4 = new fxLittleSmoke();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function init(){
addEventListener(Event.ENTER_FRAME, Update, false, 0, true);
}
function mouseLeave(_arg1:Event):void{
showGameMenu();
}
public function UpdateParalaxObjects():void{
var _local1:int;
_local1 = 0;
while (_local1 < paralaxObjects.length) {
paralaxObjects[_local1].x = (paralaxObjects[_local1].saveX - ageMath.RemapVal((paralaxObjects[_local1].saveX + x), 0, stage.stageWidth, 0, paralaxObjects[_local1].paralaxX));
paralaxObjects[_local1].y = (paralaxObjects[_local1].saveY - ageMath.RemapVal((paralaxObjects[_local1].saveY + y), 0, stage.stageHeight, 0, paralaxObjects[_local1].paralaxY));
_local1++;
};
}
public function addBlinkFX_OverLight():void{
Game(parent).gameGUI.fxblink.fadeMaxLimit = 1;
Game(parent).gameGUI.fxblink.fadeSpeed = 0.03;
Game(parent).gameGUI.fxblink.use_force_restart = true;
Game(parent).gameGUI.fxblink.startFadeOut();
curBlastShake = 15;
}
public function UpdateDynObjects():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = 0;
while (_local1 < dynObjects.length) {
if (dynObjects[_local1].visible == false){
} else {
if (ageMath.Distance(dynObjects[_local1].x, dynObjects[_local1].y, hero.x, hero.y) < (stage.stageWidth * 1.6)){
if (dynObjects[_local1].gravityEnable){
dynObjects[_local1].speed.y = (dynObjects[_local1].speed.y + (grav * dynObjects[_local1].gravityFactor));
};
dynObjects[_local1].speed.y = ((dynObjects[_local1].speed.y)>dynObjects[_local1].maxSpeed.y) ? dynObjects[_local1].maxSpeed.y : dynObjects[_local1].speed.y;
dynObjects[_local1].y = (dynObjects[_local1].y + dynObjects[_local1].speed.y);
if (dynObjects[_local1].collisionEnable){
_local2 = int((((dynObjects[_local1].x - dynObjects[_local1].width) - minLimX) / limitersCacheStep));
_local3 = int((((dynObjects[_local1].x + dynObjects[_local1].width) - minLimX) / limitersCacheStep));
_local4 = _local2;
while (_local4 <= _local3) {
if (((limitersCache[_local4]) && (limitersCache[_local4].length))){
checkHitPlatform(dynObjects[_local1], limitersCache[_local4]);
};
_local4++;
};
};
};
};
_local1++;
};
}
public function cleenUP():void{
cleenUP_FX();
cleenUP_Proj();
cleenUP_Prop();
cleenUP_Actors();
}
public function addLineDamageToEnemy(_arg1:ageVector, _arg2:Number, _arg3:actorObject, _arg4:Boolean){
var _local5:projObject = new projObject();
_local5.damage = _arg2;
_local5.x = _arg1.x;
_local5.y = _arg1.y;
_local5.fromGoodGuy = _arg4;
_arg3.transmitDamage(_local5);
_local5.clearDynObject();
}
public function addFX_BloodOnGround(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new bloodOnGround();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.gotoAndStop(ageMath.RandomInt(1, 5));
_local3.scaleY = 0.5;
_local3.fadeSpeed = 0.005;
_local3.startFadeOut();
projLayer.addChild(_local3);
_local3.curDispContainer = projLayer;
fxObjects.push(_local3);
return (_local3);
}
public function cleenUP_Proj():void{
var _local1:int;
_local1 = 0;
while (_local1 < projObjects.length) {
if (((projObjects[_local1]) && ((projObjects[_local1].visible == false)))){
projObjects[_local1].clearDynObject();
if (projObjects[_local1]){
if (projObjects[_local1].parent){
projObjects[_local1].parent.removeChild(projObjects[_local1]);
};
};
projObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function cleenUP_Actors():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < enemies.length) {
if (((((enemies[_local1]) && ((enemies[_local1].visible == false)))) && (enemies[_local1].dead))){
_local2 = 0;
while (_local2 < dynObjects.length) {
if (dynObjects[_local2] == enemies[_local1]){
dynObjects[_local2].clearDynObject();
dynObjects.splice(_local2, 1);
break;
};
_local2++;
};
enemies[_local1].clearActorObject();
if (enemies[_local1]){
if (enemies[_local1].parent){
enemies[_local1].parent.removeChild(enemies[_local1]);
};
};
enemies.splice(_local1, 1);
break;
};
_local1++;
};
}
public function addBlasterProj(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new blasterProj();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function cleenUP_Prop():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < propObjects.length) {
if (((propObjects[_local1]) && ((propObjects[_local1].visible == false)))){
_local2 = 0;
while (_local2 < dynObjects.length) {
if (dynObjects[_local2] == propObjects[_local1]){
dynObjects[_local2].clearDynObject();
dynObjects.splice(_local2, 1);
break;
};
_local2++;
};
if (propObjects[_local1]){
if (propObjects[_local1].parent){
propObjects[_local1].parent.removeChild(propObjects[_local1]);
};
};
propObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function addBlinkFX_OverLight2():void{
Game(parent).gameGUI.fxblink2.fadeMaxLimit = 1;
Game(parent).gameGUI.fxblink2.fadeSpeed = 0.03;
Game(parent).gameGUI.fxblink2.use_force_restart = true;
Game(parent).gameGUI.fxblink2.startFadeOut();
}
public function testIntersectLimiterOnScr(_arg1:dynObject):Boolean{
var _local2:int;
_local2 = 0;
while (_local2 < limitersOnScr.length) {
if (((!(limitersOnScr[_local2].slimMode)) && (limitersOnScr[_local2].hitTestObject(_arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public function addProp_Shotgun(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propShotgun();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function UpdateLimitersOnScr():void{
var _local1:int;
var _local2:int;
var _local3:*;
var _local4:int;
var _local5:Point;
var _local6:Rectangle;
var _local7:Rectangle;
limitersOnScr = [];
_local1 = int(((-(x) - minLimX) / limitersCacheStep));
_local2 = int((((-(x) + stage.stageWidth) - minLimX) / limitersCacheStep));
_local4 = _local1;
while (_local4 <= _local2) {
if (limitersCache[_local4]){
_local3 = 0;
while (_local3 < limitersCache[_local4].length) {
_local5 = this.localToGlobal(new Point(limitersCache[_local4][_local3].x, limitersCache[_local4][_local3].y));
_local6 = new Rectangle(_local5.x, _local5.y, limitersCache[_local4][_local3].width, limitersCache[_local4][_local3].height);
_local7 = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
if (_local7.intersects(_local6)){
limitersOnScr.push(limitersCache[_local4][_local3]);
};
_local3++;
};
};
_local4++;
};
}
public function addFX_BloodLeak(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new bloodLeak();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.fadeSpeed = 0.005;
_local3.startFadeOut();
projLayer.addChild(_local3);
_local3.curDispContainer = projLayer;
fxObjects.push(_local3);
return (_local3);
}
public function levScript(){
var _local1:int;
var _local2:Point;
if (!sVar["triggerUpgrade1"]){
if (triggerUpgrade1.hitTestObject(hero)){
if (((Controls.keyNew[Keyboard.ENTER]) || (Controls.keyNew[69]))){
openUpgradeMenu();
};
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(5);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
} else {
if (!leveler1Trigger.hitTestObject(hero)){
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 5)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
};
if (!sVar["triggerSecret1"]){
if (triggerSecret1.hitTestObject(hero)){
sVar["triggerSecret1"] = true;
Game(parent).gameGUI.hlpControl.showHelp(7);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
mainGlobal.secretsFound++;
};
};
if (!sVar["leveler1Trigger"]){
if (leveler1Trigger.hitTestObject(hero)){
if (hero.isItemExist("lever")){
sVar["leveler1Trigger"] = true;
hero.removeItemFromBag("lever");
leveler1.play();
hatch1.play();
sounds.PlaySnd("sewerDoorOpen");
} else {
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(9);
Game(parent).gameGUI.hlpControl.pic2.gotoAndStop("lever");
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
};
} else {
if (!triggerUpgrade1.hitTestObject(hero)){
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 9)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
} else {
_local2 = this.globalToLocal(MovieClip(hatch1).localToGlobal(new Point(hatch1.anmPoint.x, hatch1.anmPoint.y)));
hatch1Lim.y = _local2.y;
};
if (!sVar["startBoss"]){
if ((((hero.x > (triggerBossBorder.x + triggerBossBorder.width))) && ((hero.x < triggerRightBorder.x)))){
sVar["startBoss"] = true;
levLeftLim = triggerBossBorder.x;
levRightLim = triggerRightBorder.x;
musicEnv.fadeTo("musTrasher");
boss.alwaysSeeEnemy = true;
};
} else {
if ((boss.x - (boss.anim.width / 2)) < triggerBossBorder.x){
boss.x = (triggerBossBorder.x + (boss.anim.width / 2));
boss.fsmAI.AlienBomber_changeTarget();
} else {
if ((boss.x + (boss.anim.width / 2)) > triggerRightBorder.x){
boss.x = (triggerRightBorder.x - (boss.anim.width / 2));
boss.fsmAI.AlienBigBoss_changeTarget();
};
if ((boss.y + (boss.anim.height / 2)) > triggerBottomBorder.y){
boss.y = (triggerBottomBorder.y - (boss.anim.height / 2));
boss.fsmAI.AlienBigBoss_changeTarget();
};
};
if ((seeder1.x - (seeder1.width / 2)) < triggerBossBorder.x){
seeder1.x = (triggerBossBorder.x + (seeder1.width / 2));
seeder1.fsmAI.AlienSeeder_changeTarget();
} else {
if ((seeder1.x + (seeder1.width / 2)) > triggerRightBorder.x){
seeder1.x = (triggerRightBorder.x - (seeder1.width / 2));
seeder1.fsmAI.AlienSeeder_changeTarget();
};
if ((seeder1.y + (seeder1.height / 2)) > triggerBottomBorder.y){
seeder1.y = (triggerBottomBorder.y - (seeder1.height / 2));
seeder1.fsmAI.AlienSeeder_changeTarget();
};
};
};
if (((((!(sVar["DlgTedKilledBoss"])) && ((((boss == null)) || ((boss.visible == false)))))) && ((((seeder1 == null)) || ((seeder1.visible == false)))))){
sVar["DlgTedKilledBoss"] = true;
_local1 = Game(parent).gameGUI.dlg.setTo("lev10_TedVoc");
sVar["DlgTedDiffTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
} else {
if (sVar["DlgTedKilledBoss"]){
if (!sVar["DlgTedDiffEnd"]){
if (sVar["DlgTedDiffTimer"] == 0){
sVar["DlgTedDiffEnd"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
} else {
var _local3 = sVar;
var _local4 = "DlgTedDiffTimer";
var _local5 = (_local3[_local4] - 1);
_local3[_local4] = _local5;
if (Controls.keyNew[69]){
sVar["DlgTedDiffTimer"] = 0;
};
};
};
};
};
if (!sVar["DlgBarneyLuck"]){
sVar["DlgBarneyLuck"] = true;
_local1 = Game(parent).gameGUI.dlg.setTo("lev10_TedEvil");
sVar["DlgBarneyTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
} else {
if (sVar["DlgBarneyLuck"]){
if (!sVar["DlgBarneyLuckEnd"]){
if (sVar["DlgBarneyTimer"] == 0){
sVar["DlgBarneyLuckEnd"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
} else {
_local3 = sVar;
_local4 = "DlgBarneyTimer";
_local5 = (_local3[_local4] - 1);
_local3[_local4] = _local5;
if (Controls.keyNew[69]){
sVar["DlgBarneyTimer"] = 0;
};
};
};
};
};
if (((sVar["DlgTedDiffEnd"]) && (!(Game(parent).gameGUI.dlg.visible)))){
if (!isWin){
isWin = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuWinLose.startFadeIn();
Game(root).menuWinLose.setToWin();
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
musicEnv.fadeTo("musWin");
return;
};
};
}
public function UpdateProjObjects():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < projObjects.length) {
if (projObjects[_local1].visible == false){
} else {
if (projObjects[_local1].gravityEnable){
projObjects[_local1].Velocity.y = (projObjects[_local1].Velocity.y + (grav * projObjects[_local1].gravityFactor));
projObjects[_local1].Velocity.y = ((projObjects[_local1].Velocity.y)>projObjects[_local1].maxSpeed.y) ? projObjects[_local1].maxSpeed.y : projObjects[_local1].Velocity.y;
};
projObjects[_local1].updateDynObj();
if (!projObjects[_local1].fromGoodGuy){
if (((!(hero.dead)) && (hero.hitTestProj(projObjects[_local1])))){
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
} else {
hero.transmitDamage(projObjects[_local1]);
Game(parent).gameGUI.painFrame.startFadeOut();
};
};
} else {
_local2 = 0;
while (_local2 < enemies.length) {
if (((!(enemies[_local2].dead)) && (enemies[_local2].hitTestProj(projObjects[_local1])))){
mainGlobal.shootingInEnemies++;
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
} else {
enemies[_local2].transmitDamage(projObjects[_local1]);
};
};
_local2++;
};
};
if (ageMath.Distance(projObjects[_local1].x, projObjects[_local1].y, hero.x, hero.y) > 670){
projObjects[_local1].visible = false;
};
if (testIntersectLimiterOnScr(projObjects[_local1])){
projObjects[_local1].visible = false;
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
};
};
};
_local1++;
};
}
function frame1(){
initFirst = true;
}
public function cleenUP_FX():void{
var _local1:int;
_local1 = 0;
while (_local1 < fxObjects.length) {
if (((fxObjects[_local1]) && ((fxObjects[_local1].visible == false)))){
if (fxObjects[_local1]){
if (fxObjects[_local1].parent){
fxObjects[_local1].parent.removeChild(fxObjects[_local1]);
};
};
fxObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function term(){
var _local1:int;
removeEventListener(Event.ENTER_FRAME, Update);
_local1 = 0;
while (_local1 < enemies.length) {
enemies[_local1].clearActorObject();
_local1++;
};
_local1 = 0;
while (_local1 < dynObjects.length) {
dynObjects[_local1].clearDynObject();
_local1++;
};
dynObjects = [];
enemies = [];
goodNPC = [];
projObjects = [];
paralaxObjects = [];
chunkObjects = [];
fxObjects = [];
propObjects = [];
addActorsArr = [];
limitersCache = [];
limitersOnScr = [];
limiters = [];
}
public function testRayToLimiterOnScr(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean=false, _arg6:Object=null):ageVector{
var _local10:int;
var _local11:ageVector;
var _local12:Number;
var _local13:ageVector;
var _local14:Number;
var _local7:ageVector;
var _local8:ageVector = new ageVector(_arg1, _arg3);
var _local9:Number = Number.MAX_VALUE;
_local10 = 0;
while (_local10 < limitersOnScr.length) {
if (!limitersOnScr[_local10].slimMode){
_local11 = ageMath.getLineCrossRect(_arg1, _arg2, _arg3, _arg4, limitersOnScr[_local10].x, limitersOnScr[_local10].y, (limitersOnScr[_local10].x + limitersOnScr[_local10].width), (limitersOnScr[_local10].y + limitersOnScr[_local10].height));
if (_local11 != null){
if (_local7 == null){
_local7 = new ageVector();
_local7.copy(_local11);
_local9 = ageMath.DistanceVec(_local8, _local7);
} else {
_local12 = ageMath.DistanceVec(_local8, _local11);
if (_local12 < _local9){
_local9 = _local12;
_local7.copy(_local11);
};
};
};
};
_local10++;
};
if (!_arg5){
return (_local7);
};
_arg6.id = -1;
_local10 = 0;
while (_local10 < enemies.length) {
if (enemies[_local10].dead){
} else {
_local13 = enemies[_local10].hitTestLine(_arg1, _arg2, _arg3, _arg4);
if (_local13 != null){
if (_local7 == null){
_local7 = new ageVector();
_local7.copy(_local13);
_arg6.id = _local10;
_local9 = ageMath.DistanceVec(_local8, _local7);
} else {
_local14 = ageMath.DistanceVec(_local8, _local13);
if (_local14 < _local9){
_local9 = _local14;
_arg6.id = _local10;
_local7.copy(_local13);
};
};
};
};
_local10++;
};
return (_local7);
}
public function addFX_Splatters(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxBloodSpatters();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function addProp_Coin(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propCoin();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_Dynamite(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propDynamite();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_MedKit(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new dropMedKit();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addFX_Headshot(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxHeadshot();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function UpdatePropObjects():void{
var _local1:int;
_local1 = 0;
while (_local1 < propObjects.length) {
if (propObjects[_local1].visible == false){
} else {
if (ageMath.Distance(propObjects[_local1].x, propObjects[_local1].y, hero.x, hero.y) >= (stage.stageWidth * 1.6)){
} else {
propObjects[_local1].x = (propObjects[_local1].x + propObjects[_local1].speed.x);
if (propObjects[_local1].useRotateSpeed){
propObjects[_local1].body.rotation = (propObjects[_local1].body.rotation + propObjects[_local1].rotateSpeed);
};
if ((((((((((((propObjects[_local1].propType == "Med")) || ((propObjects[_local1].propType == "Coin")))) || ((propObjects[_local1].propType == "Money")))) || ((propObjects[_local1].propType == "Weapon")))) || ((propObjects[_local1].propType == "Item")))) || ((propObjects[_local1].propType == "Ammo")))){
if (hero.hitTestObject(propObjects[_local1])){
if (propObjects[_local1].propType == "Ammo"){
if (hero.weapons[propObjects[_local1].wepNum].active){
if (hero.weapons[propObjects[_local1].wepNum].bulletsNum < hero.weapons[propObjects[_local1].wepNum].bulletsNumMax){
propObjects[_local1].visible = false;
hero.weapons[propObjects[_local1].wepNum].bulletsNum = (hero.weapons[propObjects[_local1].wepNum].bulletsNum + (hero.weapons[propObjects[_local1].wepNum].bulletsInCatrigeMax * propObjects[_local1].moneyAmount));
if (hero.weapons[propObjects[_local1].wepNum].bulletsNum > hero.weapons[propObjects[_local1].wepNum].bulletsNumMax){
hero.weapons[propObjects[_local1].wepNum].bulletsNum = hero.weapons[propObjects[_local1].wepNum].bulletsNumMax;
};
sounds.PlaySnd((hero.weapons[propObjects[_local1].wepNum].type + "Reloaded"));
};
};
} else {
if (propObjects[_local1].propType == "Med"){
if (hero.life < hero.lifeMax){
propObjects[_local1].visible = false;
hero.life = (hero.life + propObjects[_local1].moneyAmount);
if (hero.life > hero.lifeMax){
hero.life = hero.lifeMax;
};
sounds.PlaySnd("Med");
};
} else {
if (propObjects[_local1].propType == "Item"){
propObjects[_local1].visible = false;
hero.itemsInBag.push(propObjects[_local1].itemName);
sounds.PlaySnd("itemTake");
} else {
if (propObjects[_local1].propType == "Weapon"){
propObjects[_local1].visible = false;
hero.weapons[propObjects[_local1].wepNum].active = true;
hero.curWeaponNum = (propObjects[_local1].wepNum + 1);
sounds.PlaySnd((hero.weapons[(hero.curWeaponNum - 1)].type + "Reloaded"));
} else {
propObjects[_local1].visible = false;
sounds.PlaySnd((propObjects[_local1].propType + "1"));
hero.moneyCnt = (hero.moneyCnt + propObjects[_local1].moneyAmount);
mainGlobal.moneyCollected = (mainGlobal.moneyCollected + propObjects[_local1].moneyAmount);
};
};
};
};
};
};
};
};
_local1++;
};
}
public function addProp_Money1(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMoney1();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_Money2(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMoney2();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
function showGameMenu():void{
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
Game(root).menuInGame.visible = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuInGame.startFadeIn();
}
public function addProj_Psy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new psyProj();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
_local6.gravityComp = false;
_local6.infAmmo = true;
_local6.usePsyDamage = true;
_local6.psyDamageVal = 16;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProj_MinigunBeam(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
var _local10:ageVector = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local10.normThis();
_local10.mulScalar(600);
_arg3 = (_local10.x + _arg1);
_arg4 = (_local10.y + _arg2);
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projMinigunBeam();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.gravityEnable = false;
var _local11:Object = {id:-1};
var _local12:ageVector = testRayToLimiterOnScr(_arg1, _arg2, _arg3, _arg4, true, _local11);
if (_local12 != null){
_arg3 = _local12.x;
_arg4 = _local12.y;
if (_local11.id != -1){
mainGlobal.shootingInEnemies++;
addLineDamageToEnemy(_local12, _arg5.damage, enemies[_local11.id], true);
};
};
_local6.scaleX = (ageMath.Distance(_arg1, _arg2, _arg3, _arg4) / 34);
_local6.rotation = _local8;
var _local13:Array = new Array();
_local13.push(new GlowFilter(0xFFFF00, 1, 15, 15, 4, BitmapFilterQuality.MEDIUM));
_local6.filters = _local13;
if (_arg5 != null){
};
this["FXLayer"].addChild(_local6);
fxObjects.push(_local6);
return (_local6);
}
public function addProj_LaserBeam(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
var _local10:ageVector = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local10.normThis();
_local10.mulScalar(600);
_arg3 = (_local10.x + _arg1);
_arg4 = (_local10.y + _arg2);
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projLaserBeam();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.gravityEnable = false;
var _local11:ageVector = testRayToLimiterOnScr(_arg1, _arg2, _arg3, _arg4);
if (_local11 != null){
_arg3 = _local11.x;
_arg4 = _local11.y;
};
if (addLineDamage(_arg1, _arg2, _arg3, _arg4, _arg5.damage)){
mainGlobal.shootingInEnemies++;
};
_local6.scaleX = (ageMath.Distance(_arg1, _arg2, _arg3, _arg4) / 34);
_local6.rotation = _local8;
_local6.use_force_restart = true;
_local6.fadeSpeed = 0.1;
_local6.startFadeOut();
_local6.gravityEnable = false;
var _local12:Array = new Array();
_local12.push(new GlowFilter(0xFF0000, 1, 15, 15, 1.7, BitmapFilterQuality.MEDIUM));
_local6.filters = _local12;
if (_arg5 != null){
};
this["FXLayer"].addChild(_local6);
fxObjects.push(_local6);
return (_local6);
}
public function addFX_littleBlast(_arg1:Number, _arg2:Number, _arg3:Number=1.5){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
addBlinkFX_OverLight();
_local4 = new fxBlast();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.blendMode = BlendMode.SCREEN;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function addProj(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projBullet();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, 24);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = true;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProp_Debris(_arg1:Number, _arg2:Number, _arg3:Number=1, _arg4:String=""):propObject{
var _local5:propObject;
_local5 = new propDebris();
_local5.x = _arg1;
_local5.y = _arg2;
_local5.speed.y = (ageMath.Random(-6, -18) * _arg3);
_local5.speed.x = (ageMath.Random(-10, 10) * _arg3);
if (_arg4.length){
_local5.gotoAndStop(_arg4);
} else {
_local5.gotoAndStop(ageMath.RandomInt(1, 20));
};
_local5.curLevel = this;
dynObjects.push(_local5);
propObjects.push(_local5);
_local5.isRubber = true;
_local5.stayTime = (3000 + ageMath.RandomInt(1, 2000));
_local5.timerStayDelay.start();
_local5.useRotateSpeed = true;
_local5.rotateSpeed = ageMath.RandomInt(-15, 15);
propLayer.addChild(_local5);
return (_local5);
}
public function addProj_BombWep(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projBombWep();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
_local6.blastStyle = _arg5.blastStyle;
_local6.attackRadius = _arg5.damageRadius;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProj_Rocket(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projRocket();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = true;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
_local6.blastStyle = _arg5.blastStyle;
_local6.attackRadius = _arg5.damageRadius;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addLimiter(_arg1){
limiters.push(_arg1);
}
public function alignObjXToAnother(_arg1, _arg2):void{
if ((_arg1.x - (_arg1.width * 0.5)) < _arg2.x){
_arg1.x = (_arg1.x + (_arg2.x - (_arg1.x - (_arg1.width * 0.5))));
};
if ((_arg1.x + (_arg1.width * 0.5)) > (_arg2.x + _arg2.width)){
_arg1.x = (_arg1.x - ((_arg1.x + (_arg1.width * 0.5)) - (_arg2.x + _arg2.width)));
};
}
public function ifMCOnScreen(_arg1:MovieClip):Boolean{
var _local2:Point = this.localToGlobal(new Point(_arg1.x, _arg1.y));
var _local3:Rectangle = _arg1.getBounds(root);
var _local4:Rectangle = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
if (_local4.intersects(_local3)){
return (true);
};
return (false);
}
public function addExplotion(_arg1:projObject, _arg2:actorObject=null):void{
var _local3:Number;
var _local5:int;
_local3 = ageMath.Distance(_arg1.x, _arg1.y, hero.x, hero.y);
var _local4:projObject = new projObject();
if (_local3 < _arg1.attackRadius){
_local4.damage = ageMath.RemapVal(_local3, 0, _arg1.attackRadius, _arg1.damage, 0);
_local4.x = hero.x;
_local4.y = (hero.y - (hero.height / 2));
_local4.fromGoodGuy = false;
hero.transmitDamage(_local4);
Game(parent).gameGUI.painFrame.startFadeOut();
_local4.clearDynObject();
};
_local5 = 0;
while (_local5 < enemies.length) {
if (((((enemies[_local5].dead) && (!((_arg2 == null))))) && (!((_arg2 == enemies[_local5]))))){
} else {
_local3 = ageMath.Distance(_arg1.x, _arg1.y, enemies[_local5].x, enemies[_local5].y);
if (_local3 < _arg1.attackRadius){
_local4.damage = ageMath.RemapVal(_local3, 0, _arg1.attackRadius, _arg1.damage, 0);
_local4.x = enemies[_local5].x;
_local4.y = (enemies[_local5].y - (enemies[_local5].height / 2));
_local4.fromGoodGuy = true;
enemies[_local5].transmitDamage(_local4);
_local4.clearDynObject();
};
};
_local5++;
};
}
public function addProp_minigunAmmo(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMinigunAmmo();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addFX_BlastWave(_arg1:Number, _arg2:Number, _arg3:Number=1){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
_local4 = new fxBlastWave();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function addActor(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:int=-1):actorObject{
var _local6:actorObject;
if (_arg1 == "AlienSaw"){
_local6 = new AlienSaw();
} else {
if (_arg1 == "AlienHunter"){
_local6 = new AlienHunter();
} else {
if (_arg1 == "AlienElectro"){
_local6 = new AlienElectro();
} else {
if (_arg1 == "Zomb01"){
_local6 = new Zomb01();
} else {
if (_arg1 == "Zomb02"){
_local6 = new Zomb02();
} else {
if (_arg1 == "Zomb03"){
_local6 = new Zomb03();
} else {
if (_arg1 == "Zomb04"){
_local6 = new Zomb04();
} else {
if (_arg1 == "Zomb05"){
_local6 = new Zomb05();
} else {
if (_arg1 == "Zomb01Run"){
_local6 = new Zomb01Run();
} else {
if (_arg1 == "Zomb02Run"){
_local6 = new Zomb02Run();
} else {
if (_arg1 == "Zomb03Run"){
_local6 = new Zomb03Run();
} else {
if (_arg1 == "Zomb04Run"){
_local6 = new Zomb04Run();
} else {
if (_arg1 == "Zomb05Run"){
_local6 = new Zomb05Run();
} else {
if (_arg1 == "Zomb01Vomit"){
_local6 = new Zomb01Vomit();
} else {
if (_arg1 == "Zomb02Vomit"){
_local6 = new Zomb02Vomit();
} else {
if (_arg1 == "Zomb03Vomit"){
_local6 = new Zomb03Vomit();
} else {
if (_arg1 == "Zomb04Vomit"){
_local6 = new Zomb04Vomit();
} else {
if (_arg1 == "Zomb05Vomit"){
_local6 = new Zomb05Vomit();
} else {
if (_arg1 == "Spider"){
_local6 = new Spider();
} else {
if (_arg1 == "AlienBomber"){
_local6 = new AlienBomber();
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
_local6.x = _arg3;
_local6.y = _arg4;
_local6.name = _arg2;
if (!_local6.noStatEnemy){
mainGlobal.enemiesAll++;
};
if (_arg5 < 0){
addChild(_local6);
} else {
addChildAt(_local6, _arg5);
};
return (_local6);
}
public function levInit(){
var _local1:int;
mainGlobal.secretsAll = 1;
curLevNum = 10;
curLevScore = 3500;
levelMus = "musDarkAmb";
musicEnv.fadeTo(levelMus);
Game(parent).sky.visible = true;
levLeftLim = triggerLeftBorder.x;
levRightLim = triggerRightBorder.x;
sVar["DlgTedDiffTimer"] = 0;
sVar["DlgTedDiffEnd"] = false;
sVar["DlgTedKilledBoss"] = false;
sVar["DlgBarneyTimer"] = 0;
sVar["DlgBarneyLuckEnd"] = false;
sVar["DlgBarneyLuck"] = false;
}
public function addFX_MetalSparks(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxMetalSparks();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.blendMode = BlendMode.ADD;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function addProp_Blaster(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propBlaster();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function UpdateEnemies():void{
var _local1:int;
_local1 = 0;
while (_local1 < enemies.length) {
if (((enemies[_local1].dead) || ((enemies[_local1].life <= 0)))){
} else {
if (((((!((enemies[_local1].parent as Level))) || (enemies[_local1].alwaysSeeEnemy))) || ((ageMath.Distance(enemies[_local1].x, enemies[_local1].y, hero.x, hero.y) < (stage.stageWidth * 1.6))))){
enemies[_local1].updateActorEnemy();
};
};
_local1++;
};
}
public function addProj_Vomit(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projVomit();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.timerFXAdd.delay = 80;
_local6.timerFXAdd.start();
_local6.fxFunc = addFX_VomitSplatters;
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = true;
_local6.gravityComp = true;
_local6.infAmmo = true;
_local6.useBioDamage = true;
_local6.bioDamageVal = 10;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProp_blasterAmmo(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propBlasterAmmo();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
}
}//package main
Section 79
//Level2 (main.Level2)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.ui.*;
public dynamic class Level2 extends Level {
var levRightLim:Number;// = 999999
var dlgSpeedFactor:Number;// = 4
var lastMSFrame:int;// = 9999
public var enemies:Array;
public var dynAnim:MovieClip;
var levLeftLim:Number;// = -999999
public var propObjects:Array;
public var minLimX:Number;// = 2147483647
public var triggerEndLevel:MovieClip;
public var triggerUpgrade:MovieClip;
public var maxLimX:Number;// = -2147483648
var curBlastShake:Number;// = 0
var isLose:Boolean;// = false
var grav:Number;// = 1
var isWin:Boolean;// = false
public var dynObjects:Array;
public var limitersCache:Array;
public var triggerBomb:MovieClip;
var initFirst:Boolean;// = false
public var obstacleLim:MovieClip;
public var triggerOldManCall:MovieClip;
public var triggerOldMan:MovieClip;
public var obstacle:MovieClip;
var curLevNum:int;// = 1
public var FXLayer:MovieClip;
var levelMus:String;// = ""
public var pointWave1:MovieClip;
public var triggerSecret1:MovieClip;
public var propLayer:MovieClip;
public var pointWave2:MovieClip;
public var pointWave3:MovieClip;
public var oldMan:MovieClip;
var sVar:Object;
public var limitersOnScr:Array;
public var triggerSecret2:MovieClip;
public var addActorsArr:Array;
public var limiters:Array;
public var paralaxObjects:Array;
var curLevScore:int;// = 3000
var curBlastShakeDec:Number;// = 0.3
public var fxObjects:Array;
public var limitersCacheStep:int;// = 640
public var goodNPC:Array;
public var chunkObjects:Array;
var curScale:Number;// = 1
public var triggerLeftBorder:MovieClip;
public var projObjects:Array;
public var hero:MovieClip;
public var projLayer:MovieClip;
public function Level2(){
sVar = new Object();
limiters = new Array();
limitersCache = new Array();
limitersOnScr = new Array();
dynObjects = new Array();
enemies = new Array();
goodNPC = new Array();
paralaxObjects = new Array();
projObjects = new Array();
chunkObjects = new Array();
fxObjects = new Array();
propObjects = new Array();
addActorsArr = new Array();
super();
addFrameScript(0, frame1);
init();
}
public function addFX_VomitSplatters(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxVomitSpatters();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function addLineDamage(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Boolean{
var _local6:Number;
var _local8:int;
var _local9:ageVector;
var _local7:Boolean;
_local8 = 0;
while (_local8 < enemies.length) {
if (enemies[_local8].dead){
} else {
_local9 = enemies[_local8].hitTestLine(_arg1, _arg2, _arg3, _arg4);
if (_local9 != null){
addLineDamageToEnemy(_local9, _arg5, enemies[_local8], true);
_local7 = true;
};
};
_local8++;
};
return (_local7);
}
public function checkHitPlatform(_arg1, _arg2:Array){
var _local3:int;
_arg1.bottomLimiter = null;
_local3 = 0;
while (_local3 < _arg2.length) {
if (((_arg2[_local3].slimMode) && ((_arg1.speed.y < 0)))){
} else {
if (_arg2[_local3].hitTestObject(_arg1.p2)){
_arg1.jump = false;
if (_arg1.isRubber){
_arg1.speed.y = (_arg1.speed.y * -(_arg1.rubberFactor));
_arg1.speed.x = (_arg1.speed.x * _arg1.rubberFactor);
if (_arg1.useRotateSpeed){
_arg1.rotateSpeed = 0;
};
} else {
_arg1.speed.y = 0;
};
_arg1.y = ((_arg2[_local3].y - _arg1.p2.y) - _arg1.p2.height);
_arg1.bottomLimiter = _arg2[_local3];
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p1)) && (!(_arg2[_local3].slimMode)))){
if (_arg1.scaleX > 0){
_arg1.x = (_arg2[_local3].x - (_arg1.p1.x + _arg1.p1.width));
} else {
_arg1.x = ((_arg2[_local3].x + _arg2[_local3].width) + (_arg1.p1.x + _arg1.p1.width));
};
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p3)) && (!(_arg2[_local3].slimMode)))){
if (_arg1.scaleX > 0){
_arg1.x = ((_arg2[_local3].x + _arg2[_local3].width) - _arg1.p3.x);
} else {
_arg1.x = (_arg2[_local3].x - (-(_arg1.p3.x) + _arg1.p3.width));
};
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p4)) && (!(_arg2[_local3].slimMode)))){
_arg1.speed.y = 0;
_arg1.y = ((_arg2[_local3].y + _arg2[_local3].height) - _arg1.p4.y);
};
};
};
};
};
_local3++;
};
}
public function initLimCache(){
var _local1:*;
var _local2:int;
var _local3:int;
var _local4:int;
maxLimX = int.MIN_VALUE;
minLimX = int.MAX_VALUE;
_local1 = 0;
while (_local1 < limiters.length) {
if (limiters[_local1].x < minLimX){
minLimX = limiters[_local1].x;
};
if ((limiters[_local1].x + limiters[_local1].width) > maxLimX){
maxLimX = limiters[_local1].x;
};
_local1++;
};
limitersCache = [];
_local1 = 0;
while (_local1 < (((maxLimX - minLimX) / limitersCacheStep) + 1)) {
limitersCache.push(new Array());
_local1++;
};
_local1 = 0;
while (_local1 < limiters.length) {
_local3 = int(((limiters[_local1].x - minLimX) / limitersCacheStep));
_local4 = int((((limiters[_local1].x + limiters[_local1].width) - minLimX) / limitersCacheStep));
_local2 = _local3;
while (_local2 <= _local4) {
if (!limitersCache[_local2]){
limitersCache[_local2] = new Array();
};
limitersCache[_local2].push(limiters[_local1]);
_local2++;
};
_local1++;
};
}
public function addFX_littleSmoke(_arg1:Number, _arg2:Number, _arg3:Number=1.5){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
_local4 = new fxLittleSmoke();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function init(){
addEventListener(Event.ENTER_FRAME, Update, false, 0, true);
}
public function openUpgradeMenu():void{
mainGlobal.paused = true;
this.visible = false;
Game(root).cursor.gotoAndStop("arrow");
Game(parent).menuUpgradeShop.showShop();
musicEnv.fadeTo("musUpgrade");
}
public function UpdateParalaxObjects():void{
var _local1:int;
_local1 = 0;
while (_local1 < paralaxObjects.length) {
paralaxObjects[_local1].x = (paralaxObjects[_local1].saveX - ageMath.RemapVal((paralaxObjects[_local1].saveX + x), 0, stage.stageWidth, 0, paralaxObjects[_local1].paralaxX));
paralaxObjects[_local1].y = (paralaxObjects[_local1].saveY - ageMath.RemapVal((paralaxObjects[_local1].saveY + y), 0, stage.stageHeight, 0, paralaxObjects[_local1].paralaxY));
_local1++;
};
}
public function addBlinkFX_OverLight():void{
Game(parent).gameGUI.fxblink.fadeMaxLimit = 1;
Game(parent).gameGUI.fxblink.fadeSpeed = 0.03;
Game(parent).gameGUI.fxblink.use_force_restart = true;
Game(parent).gameGUI.fxblink.startFadeOut();
curBlastShake = 15;
}
public function cleenUP():void{
cleenUP_FX();
cleenUP_Proj();
cleenUP_Prop();
cleenUP_Actors();
}
function mouseLeave(_arg1:Event):void{
showGameMenu();
}
public function UpdateDynObjects():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = 0;
while (_local1 < dynObjects.length) {
if (dynObjects[_local1].visible == false){
} else {
if (ageMath.Distance(dynObjects[_local1].x, dynObjects[_local1].y, hero.x, hero.y) < (stage.stageWidth * 1.6)){
if (dynObjects[_local1].gravityEnable){
dynObjects[_local1].speed.y = (dynObjects[_local1].speed.y + (grav * dynObjects[_local1].gravityFactor));
};
dynObjects[_local1].speed.y = ((dynObjects[_local1].speed.y)>dynObjects[_local1].maxSpeed.y) ? dynObjects[_local1].maxSpeed.y : dynObjects[_local1].speed.y;
dynObjects[_local1].y = (dynObjects[_local1].y + dynObjects[_local1].speed.y);
if (dynObjects[_local1].collisionEnable){
_local2 = int((((dynObjects[_local1].x - dynObjects[_local1].width) - minLimX) / limitersCacheStep));
_local3 = int((((dynObjects[_local1].x + dynObjects[_local1].width) - minLimX) / limitersCacheStep));
_local4 = _local2;
while (_local4 <= _local3) {
if (((limitersCache[_local4]) && (limitersCache[_local4].length))){
checkHitPlatform(dynObjects[_local1], limitersCache[_local4]);
};
_local4++;
};
};
};
};
_local1++;
};
}
public function addLineDamageToEnemy(_arg1:ageVector, _arg2:Number, _arg3:actorObject, _arg4:Boolean){
var _local5:projObject = new projObject();
_local5.damage = _arg2;
_local5.x = _arg1.x;
_local5.y = _arg1.y;
_local5.fromGoodGuy = _arg4;
_arg3.transmitDamage(_local5);
_local5.clearDynObject();
}
public function addFX_BloodOnGround(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new bloodOnGround();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.gotoAndStop(ageMath.RandomInt(1, 5));
_local3.scaleY = 0.5;
_local3.fadeSpeed = 0.005;
_local3.startFadeOut();
projLayer.addChild(_local3);
_local3.curDispContainer = projLayer;
fxObjects.push(_local3);
return (_local3);
}
public function cleenUP_Proj():void{
var _local1:int;
_local1 = 0;
while (_local1 < projObjects.length) {
if (((projObjects[_local1]) && ((projObjects[_local1].visible == false)))){
projObjects[_local1].clearDynObject();
if (projObjects[_local1]){
if (projObjects[_local1].parent){
projObjects[_local1].parent.removeChild(projObjects[_local1]);
};
};
projObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function cleenUP_Actors():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < enemies.length) {
if (((((enemies[_local1]) && ((enemies[_local1].visible == false)))) && (enemies[_local1].dead))){
_local2 = 0;
while (_local2 < dynObjects.length) {
if (dynObjects[_local2] == enemies[_local1]){
dynObjects[_local2].clearDynObject();
dynObjects.splice(_local2, 1);
break;
};
_local2++;
};
enemies[_local1].clearActorObject();
if (enemies[_local1]){
if (enemies[_local1].parent){
enemies[_local1].parent.removeChild(enemies[_local1]);
};
};
enemies.splice(_local1, 1);
break;
};
_local1++;
};
}
public function cleenUP_Prop():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < propObjects.length) {
if (((propObjects[_local1]) && ((propObjects[_local1].visible == false)))){
_local2 = 0;
while (_local2 < dynObjects.length) {
if (dynObjects[_local2] == propObjects[_local1]){
dynObjects[_local2].clearDynObject();
dynObjects.splice(_local2, 1);
break;
};
_local2++;
};
if (propObjects[_local1]){
if (propObjects[_local1].parent){
propObjects[_local1].parent.removeChild(propObjects[_local1]);
};
};
propObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function addBlasterProj(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new blasterProj();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProp_Shotgun(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propShotgun();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addBlinkFX_OverLight2():void{
Game(parent).gameGUI.fxblink2.fadeMaxLimit = 1;
Game(parent).gameGUI.fxblink2.fadeSpeed = 0.03;
Game(parent).gameGUI.fxblink2.use_force_restart = true;
Game(parent).gameGUI.fxblink2.startFadeOut();
}
public function addFX_BloodLeak(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new bloodLeak();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.fadeSpeed = 0.005;
_local3.startFadeOut();
projLayer.addChild(_local3);
_local3.curDispContainer = projLayer;
fxObjects.push(_local3);
return (_local3);
}
public function UpdateLimitersOnScr():void{
var _local1:int;
var _local2:int;
var _local3:*;
var _local4:int;
var _local5:Point;
var _local6:Rectangle;
var _local7:Rectangle;
limitersOnScr = [];
_local1 = int(((-(x) - minLimX) / limitersCacheStep));
_local2 = int((((-(x) + stage.stageWidth) - minLimX) / limitersCacheStep));
_local4 = _local1;
while (_local4 <= _local2) {
if (limitersCache[_local4]){
_local3 = 0;
while (_local3 < limitersCache[_local4].length) {
_local5 = this.localToGlobal(new Point(limitersCache[_local4][_local3].x, limitersCache[_local4][_local3].y));
_local6 = new Rectangle(_local5.x, _local5.y, limitersCache[_local4][_local3].width, limitersCache[_local4][_local3].height);
_local7 = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
if (_local7.intersects(_local6)){
limitersOnScr.push(limitersCache[_local4][_local3]);
};
_local3++;
};
};
_local4++;
};
}
public function testIntersectLimiterOnScr(_arg1:dynObject):Boolean{
var _local2:int;
_local2 = 0;
while (_local2 < limitersOnScr.length) {
if (((!(limitersOnScr[_local2].slimMode)) && (limitersOnScr[_local2].hitTestObject(_arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public function UpdateProjObjects():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < projObjects.length) {
if (projObjects[_local1].visible == false){
} else {
if (projObjects[_local1].gravityEnable){
projObjects[_local1].Velocity.y = (projObjects[_local1].Velocity.y + (grav * projObjects[_local1].gravityFactor));
projObjects[_local1].Velocity.y = ((projObjects[_local1].Velocity.y)>projObjects[_local1].maxSpeed.y) ? projObjects[_local1].maxSpeed.y : projObjects[_local1].Velocity.y;
};
projObjects[_local1].updateDynObj();
if (!projObjects[_local1].fromGoodGuy){
if (((!(hero.dead)) && (hero.hitTestProj(projObjects[_local1])))){
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
} else {
hero.transmitDamage(projObjects[_local1]);
Game(parent).gameGUI.painFrame.startFadeOut();
};
};
} else {
_local2 = 0;
while (_local2 < enemies.length) {
if (((!(enemies[_local2].dead)) && (enemies[_local2].hitTestProj(projObjects[_local1])))){
mainGlobal.shootingInEnemies++;
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
} else {
enemies[_local2].transmitDamage(projObjects[_local1]);
};
};
_local2++;
};
};
if (ageMath.Distance(projObjects[_local1].x, projObjects[_local1].y, hero.x, hero.y) > 670){
projObjects[_local1].visible = false;
};
if (testIntersectLimiterOnScr(projObjects[_local1])){
projObjects[_local1].visible = false;
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
};
};
};
_local1++;
};
}
function frame1(){
initFirst = true;
}
public function cleenUP_FX():void{
var _local1:int;
_local1 = 0;
while (_local1 < fxObjects.length) {
if (((fxObjects[_local1]) && ((fxObjects[_local1].visible == false)))){
if (fxObjects[_local1]){
if (fxObjects[_local1].parent){
fxObjects[_local1].parent.removeChild(fxObjects[_local1]);
};
};
fxObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function term(){
var _local1:int;
removeEventListener(Event.ENTER_FRAME, Update);
_local1 = 0;
while (_local1 < enemies.length) {
enemies[_local1].clearActorObject();
_local1++;
};
_local1 = 0;
while (_local1 < dynObjects.length) {
dynObjects[_local1].clearDynObject();
_local1++;
};
dynObjects = [];
enemies = [];
goodNPC = [];
projObjects = [];
paralaxObjects = [];
chunkObjects = [];
fxObjects = [];
propObjects = [];
addActorsArr = [];
limitersCache = [];
limitersOnScr = [];
limiters = [];
}
public function testRayToLimiterOnScr(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean=false, _arg6:Object=null):ageVector{
var _local10:int;
var _local11:ageVector;
var _local12:Number;
var _local13:ageVector;
var _local14:Number;
var _local7:ageVector;
var _local8:ageVector = new ageVector(_arg1, _arg3);
var _local9:Number = Number.MAX_VALUE;
_local10 = 0;
while (_local10 < limitersOnScr.length) {
if (!limitersOnScr[_local10].slimMode){
_local11 = ageMath.getLineCrossRect(_arg1, _arg2, _arg3, _arg4, limitersOnScr[_local10].x, limitersOnScr[_local10].y, (limitersOnScr[_local10].x + limitersOnScr[_local10].width), (limitersOnScr[_local10].y + limitersOnScr[_local10].height));
if (_local11 != null){
if (_local7 == null){
_local7 = new ageVector();
_local7.copy(_local11);
_local9 = ageMath.DistanceVec(_local8, _local7);
} else {
_local12 = ageMath.DistanceVec(_local8, _local11);
if (_local12 < _local9){
_local9 = _local12;
_local7.copy(_local11);
};
};
};
};
_local10++;
};
if (!_arg5){
return (_local7);
};
_arg6.id = -1;
_local10 = 0;
while (_local10 < enemies.length) {
if (enemies[_local10].dead){
} else {
_local13 = enemies[_local10].hitTestLine(_arg1, _arg2, _arg3, _arg4);
if (_local13 != null){
if (_local7 == null){
_local7 = new ageVector();
_local7.copy(_local13);
_arg6.id = _local10;
_local9 = ageMath.DistanceVec(_local8, _local7);
} else {
_local14 = ageMath.DistanceVec(_local8, _local13);
if (_local14 < _local9){
_local9 = _local14;
_arg6.id = _local10;
_local7.copy(_local13);
};
};
};
};
_local10++;
};
return (_local7);
}
public function addFX_Splatters(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxBloodSpatters();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function addProp_Coin(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propCoin();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
public function levScript(){
var _local1:int;
var _local2:int;
var _local3:Boolean;
var _local4:int;
var _local5:int;
if (!sVar["triggerUpgrade"]){
if (triggerUpgrade.hitTestObject(hero)){
if (((Controls.keyNew[Keyboard.ENTER]) || (Controls.keyNew[69]))){
openUpgradeMenu();
};
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(5);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
} else {
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 5)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
if (!sVar["triggerSecret1"]){
if (triggerSecret1.hitTestObject(hero)){
sVar["triggerSecret1"] = true;
Game(parent).gameGUI.hlpControl.showHelp(7);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
mainGlobal.secretsFound++;
};
};
if (!sVar["triggerSecret2"]){
if (triggerSecret2.hitTestObject(hero)){
sVar["triggerSecret2"] = true;
Game(parent).gameGUI.hlpControl.showHelp(7);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
mainGlobal.secretsFound++;
};
};
if (!sVar["triggerOldManCall"]){
if (triggerOldManCall.hitTestObject(hero)){
sVar["triggerOldManCall"] = true;
sounds.PlaySnd("helpIco");
};
} else {
if (!sVar["triggerOldMan"]){
Game(parent).gameGUI.dlgIco.targetingObject(oldMan);
} else {
Game(parent).gameGUI.dlgIco.x = -500;
};
};
if (!sVar["triggerOldMan"]){
if (triggerOldMan.hitTestObject(hero)){
sVar["triggerOldMan"] = true;
oldMan.play();
levLeftLim = triggerOldManCall.x;
levRightLim = (triggerOldManCall.x + triggerOldManCall.width);
};
} else {
if (!sVar["DlgOldManEnd"]){
if (sVar["DlgOldManTimer"] == 0){
if (sVar["DlgOldManState"] == 0){
_local1 = Game(parent).gameGUI.dlg.setTo("lev2_OldManTed01");
var _local6 = sVar;
var _local7 = "DlgOldManState";
var _local8 = (_local6[_local7] + 1);
_local6[_local7] = _local8;
sVar["DlgOldManTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
} else {
if (sVar["DlgOldManState"] == 1){
_local1 = Game(parent).gameGUI.dlg.setTo("lev2_OldManTed02");
_local6 = sVar;
_local7 = "DlgOldManState";
_local8 = (_local6[_local7] + 1);
_local6[_local7] = _local8;
sVar["DlgOldManTimer"] = int((_local1 * dlgSpeedFactor));
} else {
if (sVar["DlgOldManState"] == 2){
_local1 = Game(parent).gameGUI.dlg.setTo("lev2_OldManTed03");
_local6 = sVar;
_local7 = "DlgOldManState";
_local8 = (_local6[_local7] + 1);
_local6[_local7] = _local8;
sVar["DlgOldManTimer"] = int((_local1 * dlgSpeedFactor));
} else {
sVar["DlgOldManEnd"] = true;
oldMan.play();
Game(parent).gameGUI.dlg.startFadeOut();
musicEnv.fadeTo("roboAttack");
_local6 = sVar;
_local7 = "WaveNum";
_local8 = (_local6[_local7] + 1);
_local6[_local7] = _local8;
Game(parent).gameGUI.hlpControl.showHelp(8);
Game(parent).gameGUI.hlpControl.txt.text = ("Wave " + sVar["WaveNum"]);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
sVar["WaveCnt"] = 4;
_local2 = 0;
while (_local2 < 4) {
addActor("AlienSaw", ("unit" + _local2), (pointWave1.x + ageMath.RandomInt(-200, 200)), (pointWave1.y - ageMath.RandomInt(200, 200))).alwaysSeeEnemy = true;
_local2++;
};
};
};
};
} else {
_local6 = sVar;
_local7 = "DlgOldManTimer";
_local8 = (_local6[_local7] - 1);
_local6[_local7] = _local8;
if (Controls.keyNew[69]){
sVar["DlgOldManTimer"] = 0;
};
};
} else {
if (!sVar["isWaveEnd"]){
_local3 = true;
_local2 = 0;
while (_local2 < sVar["WaveCnt"]) {
if (((!((getChildByName(("unit" + _local2)) == null))) && (!((getChildByName(("unit" + _local2)).visible == false))))){
_local3 = false;
break;
};
_local2++;
};
if (_local3){
if (sVar["WaveNum"] == 1){
_local6 = sVar;
_local7 = "WaveNum";
_local8 = (_local6[_local7] + 1);
_local6[_local7] = _local8;
Game(parent).gameGUI.hlpControl.showHelp(8);
Game(parent).gameGUI.hlpControl.txt.text = ("Wave " + sVar["WaveNum"]);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
sVar["WaveCnt"] = 6;
_local2 = 0;
while (_local2 < 3) {
addActor("AlienSaw", ("unit" + _local2), (pointWave1.x + ageMath.RandomInt(-200, 200)), (pointWave1.y - ageMath.RandomInt(200, 200))).alwaysSeeEnemy = true;
_local2++;
};
_local2 = 3;
while (_local2 < 6) {
addActor("AlienSaw", ("unit" + _local2), (pointWave2.x + ageMath.RandomInt(-200, 200)), (pointWave2.y - ageMath.RandomInt(200, 200))).alwaysSeeEnemy = true;
_local2++;
};
} else {
if (sVar["WaveNum"] == 2){
_local6 = sVar;
_local7 = "WaveNum";
_local8 = (_local6[_local7] + 1);
_local6[_local7] = _local8;
Game(parent).gameGUI.hlpControl.showHelp(8);
Game(parent).gameGUI.hlpControl.txt.text = ("Wave " + sVar["WaveNum"]);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
sVar["WaveCnt"] = 6;
_local2 = 0;
while (_local2 < 2) {
addActor("AlienSaw", ("unit" + _local2), (pointWave1.x + ageMath.RandomInt(-200, 200)), (pointWave1.y - ageMath.RandomInt(200, 200))).alwaysSeeEnemy = true;
_local2++;
};
_local2 = 2;
while (_local2 < 4) {
addActor("AlienSaw", ("unit" + _local2), (pointWave2.x + ageMath.RandomInt(-200, 200)), (pointWave2.y - ageMath.RandomInt(200, 200))).alwaysSeeEnemy = true;
_local2++;
};
addActor("AlienHunter", ("unit" + 5), (pointWave3.x + ageMath.RandomInt(-200, 200)), (pointWave3.y - ageMath.RandomInt(200, 200))).alwaysSeeEnemy = true;
} else {
if (sVar["WaveNum"] == 3){
sVar["isWaveEnd"] = true;
musicEnv.fadeTo("musGlory");
_local1 = Game(parent).gameGUI.dlg.setTo("lev2_TedScrap");
sVar["DlgTedScrapTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
sVar["triggerOldManCall2"] = true;
sounds.PlaySnd("helpIco");
};
};
};
};
};
};
};
if (((((sVar["isWaveEnd"]) && (!(sVar["DlgTedScrapEnd"])))) && (!(sVar["triggerOldMan2"])))){
if (sVar["DlgTedScrapTimer"] == 0){
sVar["DlgTedScrapEnd"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
} else {
_local6 = sVar;
_local7 = "DlgTedScrapTimer";
_local8 = (_local6[_local7] - 1);
_local6[_local7] = _local8;
if (Controls.keyNew[69]){
sVar["DlgTedScrapTimer"] = 0;
};
};
};
if (sVar["triggerOldManCall2"]){
if (!sVar["triggerOldMan2"]){
Game(parent).gameGUI.dlgIco.targetingObject(oldMan);
} else {
Game(parent).gameGUI.dlgIco.x = -500;
};
};
if (sVar["triggerOldManCall2"]){
if (!sVar["triggerOldMan2"]){
if (triggerOldMan.hitTestObject(hero)){
sVar["triggerOldMan2"] = true;
oldMan.play();
};
} else {
if (!sVar["DlgOldManEnd2"]){
if (sVar["DlgOldManTimer2"] == 0){
if (sVar["DlgOldManState2"] == 0){
_local1 = Game(parent).gameGUI.dlg.setTo("lev2_OldManTed04");
_local6 = sVar;
_local7 = "DlgOldManState2";
_local8 = (_local6[_local7] + 1);
_local6[_local7] = _local8;
sVar["DlgOldManTimer2"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
} else {
if (sVar["DlgOldManState2"] == 1){
_local1 = Game(parent).gameGUI.dlg.setTo("lev2_OldManTed05");
_local6 = sVar;
_local7 = "DlgOldManState2";
_local8 = (_local6[_local7] + 1);
_local6[_local7] = _local8;
sVar["DlgOldManTimer2"] = int((_local1 * dlgSpeedFactor));
} else {
if (sVar["DlgOldManState2"] == 2){
_local1 = Game(parent).gameGUI.dlg.setTo("lev2_OldManTed06");
_local6 = sVar;
_local7 = "DlgOldManState2";
_local8 = (_local6[_local7] + 1);
_local6[_local7] = _local8;
sVar["DlgOldManTimer2"] = int((_local1 * dlgSpeedFactor));
} else {
if (sVar["DlgOldManState2"] == 3){
_local1 = Game(parent).gameGUI.dlg.setTo("lev2_OldManTed07");
_local6 = sVar;
_local7 = "DlgOldManState2";
_local8 = (_local6[_local7] + 1);
_local6[_local7] = _local8;
sVar["DlgOldManTimer2"] = int((_local1 * dlgSpeedFactor));
} else {
sVar["DlgOldManEnd2"] = true;
oldMan.play();
Game(parent).gameGUI.dlg.startFadeOut();
levLeftLim = triggerLeftBorder.x;
levRightLim = triggerEndLevel.x;
};
};
};
};
} else {
_local6 = sVar;
_local7 = "DlgOldManTimer2";
_local8 = (_local6[_local7] - 1);
_local6[_local7] = _local8;
if (Controls.keyNew[69]){
sVar["DlgOldManTimer2"] = 0;
};
};
};
};
};
if (!sVar["propDynamiteTaked"]){
if (!sVar["triggerTedBomb"]){
if (triggerBomb.hitTestObject(hero)){
sVar["triggerTedBomb"] = true;
_local1 = Game(parent).gameGUI.dlg.setTo("lev2_TedObst");
sVar["DlgTedBombTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
};
} else {
if (!sVar["DlgTedBombEnd"]){
if (sVar["DlgTedBombTimer"] == 0){
sVar["DlgTedBombEnd"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
} else {
_local6 = sVar;
_local7 = "DlgTedBombTimer";
_local8 = (_local6[_local7] - 1);
_local6[_local7] = _local8;
if (Controls.keyNew[69]){
sVar["DlgTedBombTimer"] = 0;
};
};
};
};
} else {
if (!sVar["propDynamiteStart"]){
if (triggerBomb.hitTestObject(hero)){
sVar["propDynamiteStart"] = true;
dynAnim.visible = true;
dynAnim.play();
hero.removeItemFromBag("dynamite");
};
} else {
if (((!(sVar["propDynamiteBlast"])) && ((dynAnim.currentFrame == 64)))){
sVar["propDynamiteBlast"] = true;
_local5 = 0;
_local5 = 0;
while (_local5 < 35) {
addProp_Debris(((obstacle.x + (obstacle.width * 0.5)) + ageMath.RandomInt(-100, 100)), (obstacle.y + ageMath.RandomInt(-50, 50)), 1.4);
_local5++;
};
obstacle.visible = false;
obstacleLim.y = -99999;
dynAnim.visible = false;
sounds.PlaySnd("bombExp", 4, obstacle, obstacle.stage);
addFX_littleBlast((dynAnim.x + (dynAnim.width * 0.5)), ((dynAnim.y + (dynAnim.height * 0.5)) - 15), 6);
addFX_littleSmoke((dynAnim.x + (dynAnim.width * 0.5)), ((dynAnim.y + (dynAnim.height * 0.5)) - 25), 7);
addBlinkFX_OverLight2();
};
};
};
if (sVar["DlgOldManEnd2"]){
if (!sVar["triggerOldMan3"]){
if (((hero.isItemExist("food")) && (triggerOldMan.hitTestObject(hero)))){
sVar["triggerOldMan3"] = true;
oldMan.play();
hero.removeItemFromBag("food");
sounds.PlaySnd("itemTake");
levLeftLim = triggerOldManCall.x;
levRightLim = (triggerOldManCall.x + triggerOldManCall.width);
};
} else {
if (!sVar["DlgOldManEnd3"]){
if (sVar["DlgOldManTimer3"] == 0){
if (sVar["DlgOldManState3"] == 0){
_local1 = Game(parent).gameGUI.dlg.setTo("lev2_OldManTed08");
_local6 = sVar;
_local7 = "DlgOldManState3";
_local8 = (_local6[_local7] + 1);
_local6[_local7] = _local8;
sVar["DlgOldManTimer3"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
} else {
if (sVar["DlgOldManState3"] == 1){
_local1 = Game(parent).gameGUI.dlg.setTo("lev2_OldManTed09");
_local6 = sVar;
_local7 = "DlgOldManState3";
_local8 = (_local6[_local7] + 1);
_local6[_local7] = _local8;
sVar["DlgOldManTimer3"] = int((_local1 * dlgSpeedFactor));
} else {
if (sVar["DlgOldManState3"] == 2){
_local1 = Game(parent).gameGUI.dlg.setTo("lev2_OldManTed10");
_local6 = sVar;
_local7 = "DlgOldManState3";
_local8 = (_local6[_local7] + 1);
_local6[_local7] = _local8;
sVar["DlgOldManTimer3"] = int((_local1 * dlgSpeedFactor));
} else {
sVar["DlgOldManEnd3"] = true;
oldMan.play();
Game(parent).gameGUI.dlg.startFadeOut();
addProp_Dynamite((oldMan.x + (oldMan.width * 0.5)), (oldMan.y + (oldMan.height * 0.5)));
};
};
};
} else {
_local6 = sVar;
_local7 = "DlgOldManTimer3";
_local8 = (_local6[_local7] - 1);
_local6[_local7] = _local8;
if (Controls.keyNew[69]){
sVar["DlgOldManTimer3"] = 0;
};
};
};
};
};
if (!sVar["propDynamiteTaked"]){
if (hero.isItemExist("dynamite")){
sVar["propDynamiteTaked"] = true;
levLeftLim = triggerLeftBorder.x;
levRightLim = triggerEndLevel.x;
};
};
if (((!(sVar["DlgTedAK"])) && (hero.weapons[2].active))){
sVar["DlgTedAK"] = true;
_local1 = Game(parent).gameGUI.dlg.setTo("lev2_TedAK");
sVar["DlgTedAKTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
} else {
if (sVar["DlgTedAK"]){
if (!sVar["DlgTedAKEnd"]){
if (sVar["DlgTedAKTimer"] == 0){
sVar["DlgTedAKEnd"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
} else {
_local6 = sVar;
_local7 = "DlgTedAKTimer";
_local8 = (_local6[_local7] - 1);
_local6[_local7] = _local8;
if (Controls.keyNew[69]){
sVar["DlgTedAKTimer"] = 0;
};
};
};
};
};
if (((sVar["DlgTedAKEnd"]) && (!(Game(parent).gameGUI.dlg.visible)))){
if (!isWin){
isWin = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuWinLose.startFadeIn();
Game(root).menuWinLose.setToWin();
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
musicEnv.fadeTo("musWin");
return;
};
};
}
public function addProp_Dynamite(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propDynamite();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_MedKit(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new dropMedKit();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addFX_Headshot(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxHeadshot();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function addProp_Money1(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMoney1();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_Money2(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMoney2();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
function showGameMenu():void{
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
Game(root).menuInGame.visible = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuInGame.startFadeIn();
}
public function addProj_Psy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new psyProj();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
_local6.gravityComp = false;
_local6.infAmmo = true;
_local6.usePsyDamage = true;
_local6.psyDamageVal = 16;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProj_MinigunBeam(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
var _local10:ageVector = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local10.normThis();
_local10.mulScalar(600);
_arg3 = (_local10.x + _arg1);
_arg4 = (_local10.y + _arg2);
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projMinigunBeam();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.gravityEnable = false;
var _local11:Object = {id:-1};
var _local12:ageVector = testRayToLimiterOnScr(_arg1, _arg2, _arg3, _arg4, true, _local11);
if (_local12 != null){
_arg3 = _local12.x;
_arg4 = _local12.y;
if (_local11.id != -1){
mainGlobal.shootingInEnemies++;
addLineDamageToEnemy(_local12, _arg5.damage, enemies[_local11.id], true);
};
};
_local6.scaleX = (ageMath.Distance(_arg1, _arg2, _arg3, _arg4) / 34);
_local6.rotation = _local8;
var _local13:Array = new Array();
_local13.push(new GlowFilter(0xFFFF00, 1, 15, 15, 4, BitmapFilterQuality.MEDIUM));
_local6.filters = _local13;
if (_arg5 != null){
};
this["FXLayer"].addChild(_local6);
fxObjects.push(_local6);
return (_local6);
}
public function addProj_LaserBeam(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
var _local10:ageVector = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local10.normThis();
_local10.mulScalar(600);
_arg3 = (_local10.x + _arg1);
_arg4 = (_local10.y + _arg2);
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projLaserBeam();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.gravityEnable = false;
var _local11:ageVector = testRayToLimiterOnScr(_arg1, _arg2, _arg3, _arg4);
if (_local11 != null){
_arg3 = _local11.x;
_arg4 = _local11.y;
};
if (addLineDamage(_arg1, _arg2, _arg3, _arg4, _arg5.damage)){
mainGlobal.shootingInEnemies++;
};
_local6.scaleX = (ageMath.Distance(_arg1, _arg2, _arg3, _arg4) / 34);
_local6.rotation = _local8;
_local6.use_force_restart = true;
_local6.fadeSpeed = 0.1;
_local6.startFadeOut();
_local6.gravityEnable = false;
var _local12:Array = new Array();
_local12.push(new GlowFilter(0xFF0000, 1, 15, 15, 1.7, BitmapFilterQuality.MEDIUM));
_local6.filters = _local12;
if (_arg5 != null){
};
this["FXLayer"].addChild(_local6);
fxObjects.push(_local6);
return (_local6);
}
public function addFX_littleBlast(_arg1:Number, _arg2:Number, _arg3:Number=1.5){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
addBlinkFX_OverLight();
_local4 = new fxBlast();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.blendMode = BlendMode.SCREEN;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function addProj(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projBullet();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, 24);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = true;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function UpdatePropObjects():void{
var _local1:int;
_local1 = 0;
while (_local1 < propObjects.length) {
if (propObjects[_local1].visible == false){
} else {
if (ageMath.Distance(propObjects[_local1].x, propObjects[_local1].y, hero.x, hero.y) >= (stage.stageWidth * 1.6)){
} else {
propObjects[_local1].x = (propObjects[_local1].x + propObjects[_local1].speed.x);
if (propObjects[_local1].useRotateSpeed){
propObjects[_local1].body.rotation = (propObjects[_local1].body.rotation + propObjects[_local1].rotateSpeed);
};
if ((((((((((((propObjects[_local1].propType == "Med")) || ((propObjects[_local1].propType == "Coin")))) || ((propObjects[_local1].propType == "Money")))) || ((propObjects[_local1].propType == "Weapon")))) || ((propObjects[_local1].propType == "Item")))) || ((propObjects[_local1].propType == "Ammo")))){
if (hero.hitTestObject(propObjects[_local1])){
if (propObjects[_local1].propType == "Ammo"){
if (hero.weapons[propObjects[_local1].wepNum].active){
if (hero.weapons[propObjects[_local1].wepNum].bulletsNum < hero.weapons[propObjects[_local1].wepNum].bulletsNumMax){
propObjects[_local1].visible = false;
hero.weapons[propObjects[_local1].wepNum].bulletsNum = (hero.weapons[propObjects[_local1].wepNum].bulletsNum + (hero.weapons[propObjects[_local1].wepNum].bulletsInCatrigeMax * propObjects[_local1].moneyAmount));
if (hero.weapons[propObjects[_local1].wepNum].bulletsNum > hero.weapons[propObjects[_local1].wepNum].bulletsNumMax){
hero.weapons[propObjects[_local1].wepNum].bulletsNum = hero.weapons[propObjects[_local1].wepNum].bulletsNumMax;
};
sounds.PlaySnd((hero.weapons[propObjects[_local1].wepNum].type + "Reloaded"));
};
};
} else {
if (propObjects[_local1].propType == "Med"){
if (hero.life < hero.lifeMax){
propObjects[_local1].visible = false;
hero.life = (hero.life + propObjects[_local1].moneyAmount);
if (hero.life > hero.lifeMax){
hero.life = hero.lifeMax;
};
sounds.PlaySnd("Med");
};
} else {
if (propObjects[_local1].propType == "Item"){
propObjects[_local1].visible = false;
hero.itemsInBag.push(propObjects[_local1].itemName);
sounds.PlaySnd("itemTake");
} else {
if (propObjects[_local1].propType == "Weapon"){
propObjects[_local1].visible = false;
hero.weapons[propObjects[_local1].wepNum].active = true;
hero.curWeaponNum = (propObjects[_local1].wepNum + 1);
sounds.PlaySnd((hero.weapons[(hero.curWeaponNum - 1)].type + "Reloaded"));
} else {
propObjects[_local1].visible = false;
sounds.PlaySnd((propObjects[_local1].propType + "1"));
hero.moneyCnt = (hero.moneyCnt + propObjects[_local1].moneyAmount);
mainGlobal.moneyCollected = (mainGlobal.moneyCollected + propObjects[_local1].moneyAmount);
};
};
};
};
};
};
};
};
_local1++;
};
}
public function addProp_Debris(_arg1:Number, _arg2:Number, _arg3:Number=1, _arg4:String=""):propObject{
var _local5:propObject;
_local5 = new propDebris();
_local5.x = _arg1;
_local5.y = _arg2;
_local5.speed.y = (ageMath.Random(-6, -18) * _arg3);
_local5.speed.x = (ageMath.Random(-10, 10) * _arg3);
if (_arg4.length){
_local5.gotoAndStop(_arg4);
} else {
_local5.gotoAndStop(ageMath.RandomInt(1, 20));
};
_local5.curLevel = this;
dynObjects.push(_local5);
propObjects.push(_local5);
_local5.isRubber = true;
_local5.stayTime = (3000 + ageMath.RandomInt(1, 2000));
_local5.timerStayDelay.start();
_local5.useRotateSpeed = true;
_local5.rotateSpeed = ageMath.RandomInt(-15, 15);
propLayer.addChild(_local5);
return (_local5);
}
public function addProj_BombWep(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projBombWep();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
_local6.blastStyle = _arg5.blastStyle;
_local6.attackRadius = _arg5.damageRadius;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProj_Rocket(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projRocket();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = true;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
_local6.blastStyle = _arg5.blastStyle;
_local6.attackRadius = _arg5.damageRadius;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function ifMCOnScreen(_arg1:MovieClip):Boolean{
var _local2:Point = this.localToGlobal(new Point(_arg1.x, _arg1.y));
var _local3:Rectangle = _arg1.getBounds(root);
var _local4:Rectangle = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
if (_local4.intersects(_local3)){
return (true);
};
return (false);
}
public function addLimiter(_arg1){
limiters.push(_arg1);
}
public function alignObjXToAnother(_arg1, _arg2):void{
if ((_arg1.x - (_arg1.width * 0.5)) < _arg2.x){
_arg1.x = (_arg1.x + (_arg2.x - (_arg1.x - (_arg1.width * 0.5))));
};
if ((_arg1.x + (_arg1.width * 0.5)) > (_arg2.x + _arg2.width)){
_arg1.x = (_arg1.x - ((_arg1.x + (_arg1.width * 0.5)) - (_arg2.x + _arg2.width)));
};
}
public function levInit(){
mainGlobal.secretsAll = 2;
curLevNum = 2;
curLevScore = 3200;
levelMus = "musGlory";
musicEnv.fadeTo(levelMus);
oldMan.gotoAndStop(1);
sVar["triggerUpgrade"] = false;
sVar["triggerSecret1"] = false;
sVar["triggerSecret2"] = false;
levLeftLim = triggerLeftBorder.x;
sVar["triggerOldManCall"] = false;
sVar["triggerOldMan"] = false;
sVar["DlgOldManState"] = 0;
sVar["DlgOldManTimer"] = 0;
sVar["DlgOldManEnd"] = false;
sVar["isWaveEnd"] = false;
sVar["WaveNum"] = 0;
sVar["WaveCnt"] = 0;
sVar["DlgTedScrapTimer"] = 0;
sVar["DlgTedScrapEnd"] = false;
sVar["triggerOldManCall2"] = false;
sVar["triggerOldMan2"] = false;
sVar["DlgOldManState2"] = 0;
sVar["DlgOldManTimer2"] = 0;
sVar["DlgOldManEnd2"] = false;
sVar["triggerOldMan3"] = false;
sVar["DlgOldManState3"] = 0;
sVar["DlgOldManTimer3"] = 0;
sVar["DlgOldManEnd3"] = false;
sVar["triggerTedBomb"] = 0;
sVar["DlgTedBombTimer"] = 0;
sVar["DlgTedBombEnd"] = false;
sVar["propDynamiteTaked"] = false;
sVar["propDynamiteStart"] = false;
sVar["propDynamiteBlast"] = false;
dynAnim.visible = false;
sVar["DlgTedAK"] = false;
sVar["DlgTedAKEnd"] = false;
sVar["DlgTedAKTimer"] = 0;
}
public function addExplotion(_arg1:projObject, _arg2:actorObject=null):void{
var _local3:Number;
var _local5:int;
_local3 = ageMath.Distance(_arg1.x, _arg1.y, hero.x, hero.y);
var _local4:projObject = new projObject();
if (_local3 < _arg1.attackRadius){
_local4.damage = ageMath.RemapVal(_local3, 0, _arg1.attackRadius, _arg1.damage, 0);
_local4.x = hero.x;
_local4.y = (hero.y - (hero.height / 2));
_local4.fromGoodGuy = false;
hero.transmitDamage(_local4);
Game(parent).gameGUI.painFrame.startFadeOut();
_local4.clearDynObject();
};
_local5 = 0;
while (_local5 < enemies.length) {
if (((((enemies[_local5].dead) && (!((_arg2 == null))))) && (!((_arg2 == enemies[_local5]))))){
} else {
_local3 = ageMath.Distance(_arg1.x, _arg1.y, enemies[_local5].x, enemies[_local5].y);
if (_local3 < _arg1.attackRadius){
_local4.damage = ageMath.RemapVal(_local3, 0, _arg1.attackRadius, _arg1.damage, 0);
_local4.x = enemies[_local5].x;
_local4.y = (enemies[_local5].y - (enemies[_local5].height / 2));
_local4.fromGoodGuy = true;
enemies[_local5].transmitDamage(_local4);
_local4.clearDynObject();
};
};
_local5++;
};
}
public function addProp_minigunAmmo(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMinigunAmmo();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addFX_BlastWave(_arg1:Number, _arg2:Number, _arg3:Number=1){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
_local4 = new fxBlastWave();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function Update(_arg1:Event):void{
var _local5:int;
var _local6:*;
var _local7:*;
var _local11:int;
var _local12:addActorStruct;
var _local13:int;
var _local14:Number;
var _local15:Array;
var _local16:ColorMatrix;
if (isWin){
hero.body.stop();
return;
};
if (((((mainGlobal.paused) || (!(visible)))) || (!((parent as Game))))){
return;
};
if ((((hero.life <= 0)) && (!(isLose)))){
isLose = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuWinLose.startFadeIn();
Game(root).menuWinLose.setToLose();
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
musicEnv.fadeTo("musLose");
sounds.PlaySnd(("TedDie" + ageMath.RandomInt(1, 2).toString()), 0.8);
return;
};
if (initFirst){
if (((!(mainGlobal.configMusicOn)) && (!(mainGlobal.configSoundOn)))){
Game(parent).gamButSnd.gotoAndStop(2);
} else {
Game(parent).gamButSnd.gotoAndStop(1);
};
initFirst = false;
initLimCache();
Game(parent).fadeBG.fadeSpeed = 0.03;
Game(parent).fadeBG.use_force_restart = true;
Game(parent).fadeBG.startFadeOut();
Game(parent).gameGUI.hlpControl.visible = false;
Game(parent).gameGUI.dlg.visible = false;
Game(parent).gameGUI.dlgIco.x = -500;
_local6 = (hero.x * this.scaleX);
_local7 = ((hero.y - 95) * this.scaleY);
x = -((_local6 - (stage.stageWidth * 0.5)));
y = -((_local7 - (stage.stageHeight * 0.5)));
mainGlobal.initStat();
_local11 = 0;
_local11 = 0;
while (_local11 < enemies.length) {
if (!enemies[_local11].noStatEnemy){
mainGlobal.enemiesAll++;
};
_local11++;
};
Game(parent).sky.visible = true;
levInit();
if (mainGlobal.isSingleEp){
if (curLevNum == 1){
_local5 = 0;
while (_local5 < 1) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 0;
} else {
if (curLevNum == 2){
_local5 = 0;
while (_local5 < 2) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 200;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
} else {
if (curLevNum == 3){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
} else {
if (curLevNum == 4){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1300;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
} else {
if (curLevNum == 5){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1500;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
} else {
if (curLevNum == 6){
_local5 = 0;
while (_local5 < 4) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 2000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
} else {
if (curLevNum == 7){
_local5 = 0;
while (_local5 < 5) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 3000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
} else {
if (curLevNum == 8){
_local5 = 0;
while (_local5 < 5) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 3500;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
} else {
if (curLevNum == 9){
_local5 = 0;
while (_local5 < 6) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = 5;
hero.moneyCnt = 4000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
hero.applyUpgrade(1, 4);
hero.upgradesLife[4].active = true;
} else {
if (curLevNum == 10){
_local5 = 0;
while (_local5 < 6) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = 5;
hero.moneyCnt = 4000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
hero.applyUpgrade(1, 4);
hero.upgradesLife[4].active = true;
};
};
};
};
};
};
};
};
};
};
};
Game(parent).gameGUI.dlgIco.gotoAndStop(1);
};
var _local2:int = getTimer();
cleenUP();
UpdateLimitersOnScr();
UpdateParalaxObjects();
UpdateDynObjects();
UpdatePropObjects();
UpdateEnemies();
UpdateProjObjects();
hero.updateActor();
hero.applyDamages();
hero.testIsActorDead();
if (addActorsArr.length){
while (addActorsArr.length) {
_local12 = addActorsArr.pop();
addActor(_local12.strClass, "", _local12.posx, _local12.posy, _local12.orderZ);
};
};
var _local3:int;
_local3 = 0;
while (_local3 < chunkObjects.length) {
if (ifMCOnScreen(chunkObjects[_local3])){
chunkObjects[_local3].visible = true;
} else {
chunkObjects[_local3].visible = false;
};
_local3++;
};
levScript();
var _local4:Boolean;
if (Controls.key[Keyboard.F2]){
hero.life = 1;
};
if (Controls.key[Keyboard.ESCAPE]){
showGameMenu();
};
if (!hero.timerReloadDelay.running){
_local13 = 0;
while (_local13 < 8) {
if (((((Controls.key[(49 + _local13)]) && (!((hero.curWeaponNum == (_local13 + 1)))))) && (hero.weapons[_local13].active))){
hero.curWeaponNum = (_local13 + 1);
sounds.PlaySnd((hero.weapons[(hero.curWeaponNum - 1)].type + "Reloaded"));
};
_local13++;
};
};
if (Game(root).cursor.currentLabel == "cross"){
_local14 = ageMath.Distance(hero.x, hero.y, (Controls.mousePosX - x), (Controls.mousePosY - y));
Game(root).cursor.shootAcc.scaleX = (Game(root).cursor.shootAcc.scaleY = ((hero.wepAcc * _local14) / hero.weapons[(hero.curWeaponNum - 1)].accDistScale));
};
_local5 = 0;
_local5 = 0;
while (_local5 < 8) {
if (((hero.weapons[_local5]) && (hero.weapons[_local5].active))){
if ((((hero.weapons[_local5].bulletsInCatrige == 0)) && ((hero.weapons[_local5].bulletsNum == 0)))){
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 2){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 2;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(-124);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
} else {
if (hero.curWeaponNum != (_local5 + 1)){
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 1){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 1;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(0);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
} else {
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 3){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 3;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(87);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
};
};
} else {
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 4){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 4;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 0.5;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(0);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
};
_local5++;
};
Game(parent).gameGUI.wepInfo.catTxt.text = ((hero.weapons[(hero.curWeaponNum - 1)].bulletsInCatrige + "/") + hero.weapons[(hero.curWeaponNum - 1)].bulletsInCatrigeMax);
if (!hero.weapons[(hero.curWeaponNum - 1)].infAmmo){
Game(parent).gameGUI.wepInfo.allTxt.text = hero.weapons[(hero.curWeaponNum - 1)].bulletsNum;
} else {
Game(parent).gameGUI.wepInfo.allTxt.text = "INF";
};
Game(parent).gameGUI.wepInfo.pic.gotoAndStop((hero.curWeaponNum + 4));
if ((hero.x - (hero.width * 0.5)) < levLeftLim){
hero.x = (levLeftLim + (hero.width * 0.5));
} else {
if ((hero.x + (hero.width * 0.5)) > levRightLim){
hero.x = (levRightLim - (hero.width * 0.5));
};
};
_local6 = ageMath.Lerp((Controls.mousePosX - x), (hero.x * scaleX), 0.6);
_local7 = ageMath.Lerp((Controls.mousePosY - y), ((hero.y - 95) * scaleY), 0.6);
if (!_local4){
x = Math.round(ageMath.Lerp(x, -((_local6 - (stage.stageWidth * 0.5))), 0.15));
y = Math.round(ageMath.Lerp(y, -((_local7 - (stage.stageHeight * 0.5))), 0.15));
} else {
x = -((_local6 - (stage.stageWidth * 0.5)));
y = -((_local7 - (stage.stageHeight * 0.5)));
};
if (this["blackScr"]){
this["blackScr"].x = -(x);
this["blackScr"].y = -(y);
};
var _local8:Point = this.localToGlobal(new Point(levLeftLim, 0));
var _local9:Point = this.localToGlobal(new Point(levRightLim, 0));
if (_local8.x > 0){
x = (x - _local8.x);
} else {
if (_local9.x < stage.stageWidth){
x = (x + (stage.stageWidth - _local9.x));
};
};
if (curBlastShake > 0){
x = (x + ageMath.Random(-(curBlastShake), curBlastShake));
y = (y + ageMath.Random(-(curBlastShake), curBlastShake));
curBlastShake = (curBlastShake - curBlastShakeDec);
if (curBlastShake < 0){
curBlastShake = 0;
};
};
Game(parent).gameGUI.lifeBar.gotoAndStop(Math.round(ageMath.RemapVal(Math.round(hero.life), 1, hero.lifeMax, 1, 100)));
Game(parent).gameGUI.lifeBar.width = ageMath.RemapVal(Math.round(hero.lifeMax), 100, 300, 108, 227);
Game(parent).gameGUI.txtMoney.text = ("$" + hero.moneyCnt);
var _local10:int;
_local10 = 0;
while (_local10 < 6) {
if (hero.itemsInBag[_local10]){
Game(parent).gameGUI[("itm" + _local10)].gotoAndStop(hero.itemsInBag[_local10]);
} else {
Game(parent).gameGUI[("itm" + _local10)].gotoAndStop(1);
};
_local10++;
};
if (hero.bioMaxLevel > 0){
Game(parent).gameGUI.hazBio.visible = true;
Game(parent).gameGUI.hazBio.gotoAndStop((100 - int(ageMath.RemapVal(hero.bioCurLevel, 0, hero.bioMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazBio.visible = false;
};
if (hero.psyMaxLevel > 0){
Game(parent).gameGUI.hazPsy.visible = true;
Game(parent).gameGUI.hazPsy.gotoAndStop((100 - int(ageMath.RemapVal(hero.psyCurLevel, 0, hero.psyMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazPsy.visible = false;
};
if (hero.electroMaxLevel > 0){
Game(parent).gameGUI.hazElectro.visible = true;
Game(parent).gameGUI.hazElectro.gotoAndStop((100 - int(ageMath.RemapVal(hero.electroCurLevel, 0, hero.electroMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazElectro.visible = false;
};
Controls.updateKeyNew();
if (Game(parent).groundBG){
Game(parent).groundBG.changeBG(x, y);
};
}
public function addActor(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:int=-1):actorObject{
var _local6:actorObject;
if (_arg1 == "AlienSaw"){
_local6 = new AlienSaw();
} else {
if (_arg1 == "AlienHunter"){
_local6 = new AlienHunter();
} else {
if (_arg1 == "AlienElectro"){
_local6 = new AlienElectro();
} else {
if (_arg1 == "Zomb01"){
_local6 = new Zomb01();
} else {
if (_arg1 == "Zomb02"){
_local6 = new Zomb02();
} else {
if (_arg1 == "Zomb03"){
_local6 = new Zomb03();
} else {
if (_arg1 == "Zomb04"){
_local6 = new Zomb04();
} else {
if (_arg1 == "Zomb05"){
_local6 = new Zomb05();
} else {
if (_arg1 == "Zomb01Run"){
_local6 = new Zomb01Run();
} else {
if (_arg1 == "Zomb02Run"){
_local6 = new Zomb02Run();
} else {
if (_arg1 == "Zomb03Run"){
_local6 = new Zomb03Run();
} else {
if (_arg1 == "Zomb04Run"){
_local6 = new Zomb04Run();
} else {
if (_arg1 == "Zomb05Run"){
_local6 = new Zomb05Run();
} else {
if (_arg1 == "Zomb01Vomit"){
_local6 = new Zomb01Vomit();
} else {
if (_arg1 == "Zomb02Vomit"){
_local6 = new Zomb02Vomit();
} else {
if (_arg1 == "Zomb03Vomit"){
_local6 = new Zomb03Vomit();
} else {
if (_arg1 == "Zomb04Vomit"){
_local6 = new Zomb04Vomit();
} else {
if (_arg1 == "Zomb05Vomit"){
_local6 = new Zomb05Vomit();
} else {
if (_arg1 == "Spider"){
_local6 = new Spider();
} else {
if (_arg1 == "AlienBomber"){
_local6 = new AlienBomber();
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
_local6.x = _arg3;
_local6.y = _arg4;
_local6.name = _arg2;
if (!_local6.noStatEnemy){
mainGlobal.enemiesAll++;
};
if (_arg5 < 0){
addChild(_local6);
} else {
addChildAt(_local6, _arg5);
};
return (_local6);
}
public function addFX_MetalSparks(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxMetalSparks();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.blendMode = BlendMode.ADD;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function addProp_blasterAmmo(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propBlasterAmmo();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_Blaster(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propBlaster();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function UpdateEnemies():void{
var _local1:int;
_local1 = 0;
while (_local1 < enemies.length) {
if (((enemies[_local1].dead) || ((enemies[_local1].life <= 0)))){
} else {
if (((((!((enemies[_local1].parent as Level))) || (enemies[_local1].alwaysSeeEnemy))) || ((ageMath.Distance(enemies[_local1].x, enemies[_local1].y, hero.x, hero.y) < (stage.stageWidth * 1.6))))){
enemies[_local1].updateActorEnemy();
};
};
_local1++;
};
}
public function addProj_Vomit(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projVomit();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.timerFXAdd.delay = 80;
_local6.timerFXAdd.start();
_local6.fxFunc = addFX_VomitSplatters;
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = true;
_local6.gravityComp = true;
_local6.infAmmo = true;
_local6.useBioDamage = true;
_local6.bioDamageVal = 10;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
}
}//package main
Section 80
//Level3 (main.Level3)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.ui.*;
public dynamic class Level3 extends Level {
public var goArrow:MovieClip;
var levRightLim:Number;// = 999999
var dlgSpeedFactor:Number;// = 4
var lastMSFrame:int;// = 9999
public var enemies:Array;
public var alienFirst:MovieClip;
var levLeftLim:Number;// = -999999
public var propObjects:Array;
public var minLimX:Number;// = 2147483647
public var maxLimX:Number;// = -2147483648
var curBlastShake:Number;// = 0
public var dynObjects:Array;
var isLose:Boolean;// = false
public var leftBossBorder:MovieClip;
var isWin:Boolean;// = false
public var triggerTube:MovieClip;
var grav:Number;// = 1
public var leftLevBorder:MovieClip;
public var triggerUpgrade1:MovieClip;
public var triggerUpgrade2:MovieClip;
public var limitersCache:Array;
public var boss:MovieClip;
var initFirst:Boolean;// = false
var curLevNum:int;// = 1
public var FXLayer:MovieClip;
public var preboss1:MovieClip;
public var preboss2:MovieClip;
var levelMus:String;// = ""
public var triggerSecret1:MovieClip;
public var triggerSecret2:MovieClip;
public var triggerSecret3:MovieClip;
public var propLayer:MovieClip;
var sVar:Object;
public var triggerZombieGirl:MovieClip;
public var limitersOnScr:Array;
public var addActorsArr:Array;
public var paralaxObjects:Array;
public var limiters:Array;
var curLevScore:int;// = 3000
var curBlastShakeDec:Number;// = 0.3
public var fxObjects:Array;
public var limitersCacheStep:int;// = 640
public var goodNPC:Array;
public var chunkObjects:Array;
var curScale:Number;// = 1
public var rightLevBorder:MovieClip;
public var projObjects:Array;
public var hero:MovieClip;
public var projLayer:MovieClip;
public function Level3(){
sVar = new Object();
limiters = new Array();
limitersCache = new Array();
limitersOnScr = new Array();
dynObjects = new Array();
enemies = new Array();
goodNPC = new Array();
paralaxObjects = new Array();
projObjects = new Array();
chunkObjects = new Array();
fxObjects = new Array();
propObjects = new Array();
addActorsArr = new Array();
super();
addFrameScript(0, frame1);
init();
}
public function addLineDamage(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Boolean{
var _local6:Number;
var _local8:int;
var _local9:ageVector;
var _local7:Boolean;
_local8 = 0;
while (_local8 < enemies.length) {
if (enemies[_local8].dead){
} else {
_local9 = enemies[_local8].hitTestLine(_arg1, _arg2, _arg3, _arg4);
if (_local9 != null){
addLineDamageToEnemy(_local9, _arg5, enemies[_local8], true);
_local7 = true;
};
};
_local8++;
};
return (_local7);
}
public function checkHitPlatform(_arg1, _arg2:Array){
var _local3:int;
_arg1.bottomLimiter = null;
_local3 = 0;
while (_local3 < _arg2.length) {
if (((_arg2[_local3].slimMode) && ((_arg1.speed.y < 0)))){
} else {
if (_arg2[_local3].hitTestObject(_arg1.p2)){
_arg1.jump = false;
if (_arg1.isRubber){
_arg1.speed.y = (_arg1.speed.y * -(_arg1.rubberFactor));
_arg1.speed.x = (_arg1.speed.x * _arg1.rubberFactor);
if (_arg1.useRotateSpeed){
_arg1.rotateSpeed = 0;
};
} else {
_arg1.speed.y = 0;
};
_arg1.y = ((_arg2[_local3].y - _arg1.p2.y) - _arg1.p2.height);
_arg1.bottomLimiter = _arg2[_local3];
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p1)) && (!(_arg2[_local3].slimMode)))){
if (_arg1.scaleX > 0){
_arg1.x = (_arg2[_local3].x - (_arg1.p1.x + _arg1.p1.width));
} else {
_arg1.x = ((_arg2[_local3].x + _arg2[_local3].width) + (_arg1.p1.x + _arg1.p1.width));
};
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p3)) && (!(_arg2[_local3].slimMode)))){
if (_arg1.scaleX > 0){
_arg1.x = ((_arg2[_local3].x + _arg2[_local3].width) - _arg1.p3.x);
} else {
_arg1.x = (_arg2[_local3].x - (-(_arg1.p3.x) + _arg1.p3.width));
};
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p4)) && (!(_arg2[_local3].slimMode)))){
_arg1.speed.y = 0;
_arg1.y = ((_arg2[_local3].y + _arg2[_local3].height) - _arg1.p4.y);
};
};
};
};
};
_local3++;
};
}
public function addFX_VomitSplatters(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxVomitSpatters();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function initLimCache(){
var _local1:*;
var _local2:int;
var _local3:int;
var _local4:int;
maxLimX = int.MIN_VALUE;
minLimX = int.MAX_VALUE;
_local1 = 0;
while (_local1 < limiters.length) {
if (limiters[_local1].x < minLimX){
minLimX = limiters[_local1].x;
};
if ((limiters[_local1].x + limiters[_local1].width) > maxLimX){
maxLimX = limiters[_local1].x;
};
_local1++;
};
limitersCache = [];
_local1 = 0;
while (_local1 < (((maxLimX - minLimX) / limitersCacheStep) + 1)) {
limitersCache.push(new Array());
_local1++;
};
_local1 = 0;
while (_local1 < limiters.length) {
_local3 = int(((limiters[_local1].x - minLimX) / limitersCacheStep));
_local4 = int((((limiters[_local1].x + limiters[_local1].width) - minLimX) / limitersCacheStep));
_local2 = _local3;
while (_local2 <= _local4) {
if (!limitersCache[_local2]){
limitersCache[_local2] = new Array();
};
limitersCache[_local2].push(limiters[_local1]);
_local2++;
};
_local1++;
};
}
public function addFX_littleSmoke(_arg1:Number, _arg2:Number, _arg3:Number=1.5){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
_local4 = new fxLittleSmoke();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function init(){
addEventListener(Event.ENTER_FRAME, Update, false, 0, true);
}
public function openUpgradeMenu():void{
mainGlobal.paused = true;
this.visible = false;
Game(root).cursor.gotoAndStop("arrow");
Game(parent).menuUpgradeShop.showShop();
musicEnv.fadeTo("musUpgrade");
}
function mouseLeave(_arg1:Event):void{
showGameMenu();
}
public function UpdateParalaxObjects():void{
var _local1:int;
_local1 = 0;
while (_local1 < paralaxObjects.length) {
paralaxObjects[_local1].x = (paralaxObjects[_local1].saveX - ageMath.RemapVal((paralaxObjects[_local1].saveX + x), 0, stage.stageWidth, 0, paralaxObjects[_local1].paralaxX));
paralaxObjects[_local1].y = (paralaxObjects[_local1].saveY - ageMath.RemapVal((paralaxObjects[_local1].saveY + y), 0, stage.stageHeight, 0, paralaxObjects[_local1].paralaxY));
_local1++;
};
}
public function addBlinkFX_OverLight():void{
Game(parent).gameGUI.fxblink.fadeMaxLimit = 1;
Game(parent).gameGUI.fxblink.fadeSpeed = 0.03;
Game(parent).gameGUI.fxblink.use_force_restart = true;
Game(parent).gameGUI.fxblink.startFadeOut();
curBlastShake = 15;
}
public function cleenUP():void{
cleenUP_FX();
cleenUP_Proj();
cleenUP_Prop();
cleenUP_Actors();
}
public function UpdateDynObjects():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = 0;
while (_local1 < dynObjects.length) {
if (dynObjects[_local1].visible == false){
} else {
if (ageMath.Distance(dynObjects[_local1].x, dynObjects[_local1].y, hero.x, hero.y) < (stage.stageWidth * 1.6)){
if (dynObjects[_local1].gravityEnable){
dynObjects[_local1].speed.y = (dynObjects[_local1].speed.y + (grav * dynObjects[_local1].gravityFactor));
};
dynObjects[_local1].speed.y = ((dynObjects[_local1].speed.y)>dynObjects[_local1].maxSpeed.y) ? dynObjects[_local1].maxSpeed.y : dynObjects[_local1].speed.y;
dynObjects[_local1].y = (dynObjects[_local1].y + dynObjects[_local1].speed.y);
if (dynObjects[_local1].collisionEnable){
_local2 = int((((dynObjects[_local1].x - dynObjects[_local1].width) - minLimX) / limitersCacheStep));
_local3 = int((((dynObjects[_local1].x + dynObjects[_local1].width) - minLimX) / limitersCacheStep));
_local4 = _local2;
while (_local4 <= _local3) {
if (((limitersCache[_local4]) && (limitersCache[_local4].length))){
checkHitPlatform(dynObjects[_local1], limitersCache[_local4]);
};
_local4++;
};
};
};
};
_local1++;
};
}
public function addLineDamageToEnemy(_arg1:ageVector, _arg2:Number, _arg3:actorObject, _arg4:Boolean){
var _local5:projObject = new projObject();
_local5.damage = _arg2;
_local5.x = _arg1.x;
_local5.y = _arg1.y;
_local5.fromGoodGuy = _arg4;
_arg3.transmitDamage(_local5);
_local5.clearDynObject();
}
public function addFX_BloodOnGround(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new bloodOnGround();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.gotoAndStop(ageMath.RandomInt(1, 5));
_local3.scaleY = 0.5;
_local3.fadeSpeed = 0.005;
_local3.startFadeOut();
projLayer.addChild(_local3);
_local3.curDispContainer = projLayer;
fxObjects.push(_local3);
return (_local3);
}
public function cleenUP_Proj():void{
var _local1:int;
_local1 = 0;
while (_local1 < projObjects.length) {
if (((projObjects[_local1]) && ((projObjects[_local1].visible == false)))){
projObjects[_local1].clearDynObject();
if (projObjects[_local1]){
if (projObjects[_local1].parent){
projObjects[_local1].parent.removeChild(projObjects[_local1]);
};
};
projObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function cleenUP_Actors():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < enemies.length) {
if (((((enemies[_local1]) && ((enemies[_local1].visible == false)))) && (enemies[_local1].dead))){
_local2 = 0;
while (_local2 < dynObjects.length) {
if (dynObjects[_local2] == enemies[_local1]){
dynObjects[_local2].clearDynObject();
dynObjects.splice(_local2, 1);
break;
};
_local2++;
};
enemies[_local1].clearActorObject();
if (enemies[_local1]){
if (enemies[_local1].parent){
enemies[_local1].parent.removeChild(enemies[_local1]);
};
};
enemies.splice(_local1, 1);
break;
};
_local1++;
};
}
public function addBlasterProj(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new blasterProj();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function testIntersectLimiterOnScr(_arg1:dynObject):Boolean{
var _local2:int;
_local2 = 0;
while (_local2 < limitersOnScr.length) {
if (((!(limitersOnScr[_local2].slimMode)) && (limitersOnScr[_local2].hitTestObject(_arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public function cleenUP_Prop():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < propObjects.length) {
if (((propObjects[_local1]) && ((propObjects[_local1].visible == false)))){
_local2 = 0;
while (_local2 < dynObjects.length) {
if (dynObjects[_local2] == propObjects[_local1]){
dynObjects[_local2].clearDynObject();
dynObjects.splice(_local2, 1);
break;
};
_local2++;
};
if (propObjects[_local1]){
if (propObjects[_local1].parent){
propObjects[_local1].parent.removeChild(propObjects[_local1]);
};
};
propObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function addProp_Shotgun(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propShotgun();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addFX_BloodLeak(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new bloodLeak();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.fadeSpeed = 0.005;
_local3.startFadeOut();
projLayer.addChild(_local3);
_local3.curDispContainer = projLayer;
fxObjects.push(_local3);
return (_local3);
}
public function levScript(){
var _local1:int;
if (!sVar["triggerUpgrade1"]){
if (triggerUpgrade1.hitTestObject(hero)){
if (((Controls.keyNew[Keyboard.ENTER]) || (Controls.keyNew[69]))){
openUpgradeMenu();
};
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(5);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
} else {
if (!triggerUpgrade2.hitTestObject(hero)){
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 5)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
};
if (!sVar["triggerUpgrade2"]){
if (triggerUpgrade2.hitTestObject(hero)){
if (((Controls.keyNew[Keyboard.ENTER]) || (Controls.keyNew[69]))){
openUpgradeMenu();
};
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(5);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
} else {
if (!triggerUpgrade1.hitTestObject(hero)){
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 5)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
};
if (!sVar["triggerSecret1"]){
if (triggerSecret1.hitTestObject(hero)){
sVar["triggerSecret1"] = true;
Game(parent).gameGUI.hlpControl.showHelp(7);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
mainGlobal.secretsFound++;
};
};
if (!sVar["triggerSecret2"]){
if (triggerSecret2.hitTestObject(hero)){
sVar["triggerSecret2"] = true;
Game(parent).gameGUI.hlpControl.showHelp(7);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
mainGlobal.secretsFound++;
};
};
if (!sVar["triggerSecret3"]){
if (triggerSecret3.hitTestObject(hero)){
sVar["triggerSecret3"] = true;
Game(parent).gameGUI.hlpControl.showHelp(7);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
mainGlobal.secretsFound++;
};
};
if (((!(sVar["DlgTedKilledAlien"])) && ((((((alienFirst == null)) || ((((alienFirst.visible == false)) && (alienFirst.dead))))) || ((alienFirst.life <= 0)))))){
sVar["DlgTedKilledAlien"] = true;
_local1 = Game(parent).gameGUI.dlg.setTo("lev3_TedALienKilled");
sVar["DlgTedKilledAlienTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
} else {
if (sVar["DlgTedKilledAlien"]){
if (!sVar["DlgTedKilledAlienEnd"]){
if (sVar["DlgTedKilledAlienTimer"] == 0){
sVar["DlgTedKilledAlienEnd"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
} else {
var _local2 = sVar;
var _local3 = "DlgTedKilledAlienTimer";
var _local4 = (_local2[_local3] - 1);
_local2[_local3] = _local4;
if (Controls.keyNew[69]){
sVar["DlgTedKilledAlienTimer"] = 0;
};
};
};
};
};
if (!sVar["triggerZombieGirl"]){
if (triggerZombieGirl.hitTestObject(hero)){
sVar["triggerZombieGirl"] = true;
_local1 = Game(parent).gameGUI.dlg.setTo("lev3_TedDate");
sVar["triggerZombieGirlTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
};
} else {
if (!sVar["triggerZombieGirlEnd"]){
if (sVar["triggerZombieGirlTimer"] == 0){
sVar["triggerZombieGirlEnd"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
} else {
_local2 = sVar;
_local3 = "triggerZombieGirlTimer";
_local4 = (_local2[_local3] - 1);
_local2[_local3] = _local4;
if (Controls.keyNew[69]){
sVar["triggerZombieGirlTimer"] = 0;
};
};
};
};
if (((((!(sVar["prebossEnemies"])) && ((((((preboss1 == null)) || ((((preboss1.visible == false)) && (preboss1.dead))))) || ((preboss1.life <= 0)))))) && ((((((preboss2 == null)) || ((((preboss2.visible == false)) && (preboss2.dead))))) || ((preboss2.life <= 0)))))){
sVar["prebossEnemies"] = true;
_local1 = Game(parent).gameGUI.dlg.setTo("lev3_TedPreBoss");
sVar["prebossEnemiesTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
boss.alwaysSeeEnemy = true;
musicEnv.fadeTo("musTrasher");
} else {
if (sVar["prebossEnemies"]){
if (!sVar["prebossEnemiesEnd"]){
if (sVar["prebossEnemiesTimer"] == 0){
sVar["prebossEnemiesEnd"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
} else {
_local2 = sVar;
_local3 = "prebossEnemiesTimer";
_local4 = (_local2[_local3] - 1);
_local2[_local3] = _local4;
if (Controls.keyNew[69]){
sVar["prebossEnemiesTimer"] = 0;
};
};
};
};
};
if (((!(sVar["DlgTedKilledBoss"])) && ((((((boss == null)) || ((((boss.visible == false)) && (boss.dead))))) || ((boss.life <= 0)))))){
sVar["DlgTedKilledBoss"] = true;
musicEnv.fadeTo(levelMus);
goArrow.visible = true;
_local1 = Game(parent).gameGUI.dlg.setTo("lev3_TedPostBoss");
sVar["DlgTedKilledBossTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
} else {
if (sVar["DlgTedKilledBoss"]){
if (!sVar["DlgTedKilledBossEnd"]){
if (sVar["DlgTedKilledBossTimer"] == 0){
sVar["DlgTedKilledBossEnd"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
} else {
_local2 = sVar;
_local3 = "DlgTedKilledBossTimer";
_local4 = (_local2[_local3] - 1);
_local2[_local3] = _local4;
if (Controls.keyNew[69]){
sVar["DlgTedKilledBossTimer"] = 0;
};
};
};
};
};
if (((sVar["DlgTedKilledBossEnd"]) && (!(isWin)))){
if (triggerTube.hitTestObject(hero)){
isWin = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuWinLose.startFadeIn();
Game(root).menuWinLose.setToWin();
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
musicEnv.fadeTo("musWin");
return;
};
};
}
public function UpdateProjObjects():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < projObjects.length) {
if (projObjects[_local1].visible == false){
} else {
if (projObjects[_local1].gravityEnable){
projObjects[_local1].Velocity.y = (projObjects[_local1].Velocity.y + (grav * projObjects[_local1].gravityFactor));
projObjects[_local1].Velocity.y = ((projObjects[_local1].Velocity.y)>projObjects[_local1].maxSpeed.y) ? projObjects[_local1].maxSpeed.y : projObjects[_local1].Velocity.y;
};
projObjects[_local1].updateDynObj();
if (!projObjects[_local1].fromGoodGuy){
if (((!(hero.dead)) && (hero.hitTestProj(projObjects[_local1])))){
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
} else {
hero.transmitDamage(projObjects[_local1]);
Game(parent).gameGUI.painFrame.startFadeOut();
};
};
} else {
_local2 = 0;
while (_local2 < enemies.length) {
if (((!(enemies[_local2].dead)) && (enemies[_local2].hitTestProj(projObjects[_local1])))){
mainGlobal.shootingInEnemies++;
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
} else {
enemies[_local2].transmitDamage(projObjects[_local1]);
};
};
_local2++;
};
};
if (ageMath.Distance(projObjects[_local1].x, projObjects[_local1].y, hero.x, hero.y) > 670){
projObjects[_local1].visible = false;
};
if (testIntersectLimiterOnScr(projObjects[_local1])){
projObjects[_local1].visible = false;
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
};
};
};
_local1++;
};
}
public function UpdateLimitersOnScr():void{
var _local1:int;
var _local2:int;
var _local3:*;
var _local4:int;
var _local5:Point;
var _local6:Rectangle;
var _local7:Rectangle;
limitersOnScr = [];
_local1 = int(((-(x) - minLimX) / limitersCacheStep));
_local2 = int((((-(x) + stage.stageWidth) - minLimX) / limitersCacheStep));
_local4 = _local1;
while (_local4 <= _local2) {
if (limitersCache[_local4]){
_local3 = 0;
while (_local3 < limitersCache[_local4].length) {
_local5 = this.localToGlobal(new Point(limitersCache[_local4][_local3].x, limitersCache[_local4][_local3].y));
_local6 = new Rectangle(_local5.x, _local5.y, limitersCache[_local4][_local3].width, limitersCache[_local4][_local3].height);
_local7 = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
if (_local7.intersects(_local6)){
limitersOnScr.push(limitersCache[_local4][_local3]);
};
_local3++;
};
};
_local4++;
};
}
function frame1(){
initFirst = true;
}
public function term(){
var _local1:int;
removeEventListener(Event.ENTER_FRAME, Update);
_local1 = 0;
while (_local1 < enemies.length) {
enemies[_local1].clearActorObject();
_local1++;
};
_local1 = 0;
while (_local1 < dynObjects.length) {
dynObjects[_local1].clearDynObject();
_local1++;
};
dynObjects = [];
enemies = [];
goodNPC = [];
projObjects = [];
paralaxObjects = [];
chunkObjects = [];
fxObjects = [];
propObjects = [];
addActorsArr = [];
limitersCache = [];
limitersOnScr = [];
limiters = [];
}
public function addFX_Splatters(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxBloodSpatters();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function addProp_Coin(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propCoin();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
public function testRayToLimiterOnScr(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean=false, _arg6:Object=null):ageVector{
var _local10:int;
var _local11:ageVector;
var _local12:Number;
var _local13:ageVector;
var _local14:Number;
var _local7:ageVector;
var _local8:ageVector = new ageVector(_arg1, _arg3);
var _local9:Number = Number.MAX_VALUE;
_local10 = 0;
while (_local10 < limitersOnScr.length) {
if (!limitersOnScr[_local10].slimMode){
_local11 = ageMath.getLineCrossRect(_arg1, _arg2, _arg3, _arg4, limitersOnScr[_local10].x, limitersOnScr[_local10].y, (limitersOnScr[_local10].x + limitersOnScr[_local10].width), (limitersOnScr[_local10].y + limitersOnScr[_local10].height));
if (_local11 != null){
if (_local7 == null){
_local7 = new ageVector();
_local7.copy(_local11);
_local9 = ageMath.DistanceVec(_local8, _local7);
} else {
_local12 = ageMath.DistanceVec(_local8, _local11);
if (_local12 < _local9){
_local9 = _local12;
_local7.copy(_local11);
};
};
};
};
_local10++;
};
if (!_arg5){
return (_local7);
};
_arg6.id = -1;
_local10 = 0;
while (_local10 < enemies.length) {
if (enemies[_local10].dead){
} else {
_local13 = enemies[_local10].hitTestLine(_arg1, _arg2, _arg3, _arg4);
if (_local13 != null){
if (_local7 == null){
_local7 = new ageVector();
_local7.copy(_local13);
_arg6.id = _local10;
_local9 = ageMath.DistanceVec(_local8, _local7);
} else {
_local14 = ageMath.DistanceVec(_local8, _local13);
if (_local14 < _local9){
_local9 = _local14;
_arg6.id = _local10;
_local7.copy(_local13);
};
};
};
};
_local10++;
};
return (_local7);
}
public function addBlinkFX_OverLight2():void{
Game(parent).gameGUI.fxblink2.fadeMaxLimit = 1;
Game(parent).gameGUI.fxblink2.fadeSpeed = 0.03;
Game(parent).gameGUI.fxblink2.use_force_restart = true;
Game(parent).gameGUI.fxblink2.startFadeOut();
}
public function cleenUP_FX():void{
var _local1:int;
_local1 = 0;
while (_local1 < fxObjects.length) {
if (((fxObjects[_local1]) && ((fxObjects[_local1].visible == false)))){
if (fxObjects[_local1]){
if (fxObjects[_local1].parent){
fxObjects[_local1].parent.removeChild(fxObjects[_local1]);
};
};
fxObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function addProp_Dynamite(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propDynamite();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_MedKit(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new dropMedKit();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addFX_Headshot(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxHeadshot();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function UpdatePropObjects():void{
var _local1:int;
_local1 = 0;
while (_local1 < propObjects.length) {
if (propObjects[_local1].visible == false){
} else {
if (ageMath.Distance(propObjects[_local1].x, propObjects[_local1].y, hero.x, hero.y) >= (stage.stageWidth * 1.6)){
} else {
propObjects[_local1].x = (propObjects[_local1].x + propObjects[_local1].speed.x);
if (propObjects[_local1].useRotateSpeed){
propObjects[_local1].body.rotation = (propObjects[_local1].body.rotation + propObjects[_local1].rotateSpeed);
};
if ((((((((((((propObjects[_local1].propType == "Med")) || ((propObjects[_local1].propType == "Coin")))) || ((propObjects[_local1].propType == "Money")))) || ((propObjects[_local1].propType == "Weapon")))) || ((propObjects[_local1].propType == "Item")))) || ((propObjects[_local1].propType == "Ammo")))){
if (hero.hitTestObject(propObjects[_local1])){
if (propObjects[_local1].propType == "Ammo"){
if (hero.weapons[propObjects[_local1].wepNum].active){
if (hero.weapons[propObjects[_local1].wepNum].bulletsNum < hero.weapons[propObjects[_local1].wepNum].bulletsNumMax){
propObjects[_local1].visible = false;
hero.weapons[propObjects[_local1].wepNum].bulletsNum = (hero.weapons[propObjects[_local1].wepNum].bulletsNum + (hero.weapons[propObjects[_local1].wepNum].bulletsInCatrigeMax * propObjects[_local1].moneyAmount));
if (hero.weapons[propObjects[_local1].wepNum].bulletsNum > hero.weapons[propObjects[_local1].wepNum].bulletsNumMax){
hero.weapons[propObjects[_local1].wepNum].bulletsNum = hero.weapons[propObjects[_local1].wepNum].bulletsNumMax;
};
sounds.PlaySnd((hero.weapons[propObjects[_local1].wepNum].type + "Reloaded"));
};
};
} else {
if (propObjects[_local1].propType == "Med"){
if (hero.life < hero.lifeMax){
propObjects[_local1].visible = false;
hero.life = (hero.life + propObjects[_local1].moneyAmount);
if (hero.life > hero.lifeMax){
hero.life = hero.lifeMax;
};
sounds.PlaySnd("Med");
};
} else {
if (propObjects[_local1].propType == "Item"){
propObjects[_local1].visible = false;
hero.itemsInBag.push(propObjects[_local1].itemName);
sounds.PlaySnd("itemTake");
} else {
if (propObjects[_local1].propType == "Weapon"){
propObjects[_local1].visible = false;
hero.weapons[propObjects[_local1].wepNum].active = true;
hero.curWeaponNum = (propObjects[_local1].wepNum + 1);
sounds.PlaySnd((hero.weapons[(hero.curWeaponNum - 1)].type + "Reloaded"));
} else {
propObjects[_local1].visible = false;
sounds.PlaySnd((propObjects[_local1].propType + "1"));
hero.moneyCnt = (hero.moneyCnt + propObjects[_local1].moneyAmount);
mainGlobal.moneyCollected = (mainGlobal.moneyCollected + propObjects[_local1].moneyAmount);
};
};
};
};
};
};
};
};
_local1++;
};
}
public function addProp_Money1(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMoney1();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_Money2(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMoney2();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
function showGameMenu():void{
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
Game(root).menuInGame.visible = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuInGame.startFadeIn();
}
public function addProj_Psy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new psyProj();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
_local6.gravityComp = false;
_local6.infAmmo = true;
_local6.usePsyDamage = true;
_local6.psyDamageVal = 16;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProj_MinigunBeam(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
var _local10:ageVector = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local10.normThis();
_local10.mulScalar(600);
_arg3 = (_local10.x + _arg1);
_arg4 = (_local10.y + _arg2);
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projMinigunBeam();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.gravityEnable = false;
var _local11:Object = {id:-1};
var _local12:ageVector = testRayToLimiterOnScr(_arg1, _arg2, _arg3, _arg4, true, _local11);
if (_local12 != null){
_arg3 = _local12.x;
_arg4 = _local12.y;
if (_local11.id != -1){
mainGlobal.shootingInEnemies++;
addLineDamageToEnemy(_local12, _arg5.damage, enemies[_local11.id], true);
};
};
_local6.scaleX = (ageMath.Distance(_arg1, _arg2, _arg3, _arg4) / 34);
_local6.rotation = _local8;
var _local13:Array = new Array();
_local13.push(new GlowFilter(0xFFFF00, 1, 15, 15, 4, BitmapFilterQuality.MEDIUM));
_local6.filters = _local13;
if (_arg5 != null){
};
this["FXLayer"].addChild(_local6);
fxObjects.push(_local6);
return (_local6);
}
public function addProj_LaserBeam(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
var _local10:ageVector = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local10.normThis();
_local10.mulScalar(600);
_arg3 = (_local10.x + _arg1);
_arg4 = (_local10.y + _arg2);
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projLaserBeam();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.gravityEnable = false;
var _local11:ageVector = testRayToLimiterOnScr(_arg1, _arg2, _arg3, _arg4);
if (_local11 != null){
_arg3 = _local11.x;
_arg4 = _local11.y;
};
if (addLineDamage(_arg1, _arg2, _arg3, _arg4, _arg5.damage)){
mainGlobal.shootingInEnemies++;
};
_local6.scaleX = (ageMath.Distance(_arg1, _arg2, _arg3, _arg4) / 34);
_local6.rotation = _local8;
_local6.use_force_restart = true;
_local6.fadeSpeed = 0.1;
_local6.startFadeOut();
_local6.gravityEnable = false;
var _local12:Array = new Array();
_local12.push(new GlowFilter(0xFF0000, 1, 15, 15, 1.7, BitmapFilterQuality.MEDIUM));
_local6.filters = _local12;
if (_arg5 != null){
};
this["FXLayer"].addChild(_local6);
fxObjects.push(_local6);
return (_local6);
}
public function addFX_littleBlast(_arg1:Number, _arg2:Number, _arg3:Number=1.5){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
addBlinkFX_OverLight();
_local4 = new fxBlast();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.blendMode = BlendMode.SCREEN;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function addProj(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projBullet();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, 24);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = true;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProp_Debris(_arg1:Number, _arg2:Number, _arg3:Number=1, _arg4:String=""):propObject{
var _local5:propObject;
_local5 = new propDebris();
_local5.x = _arg1;
_local5.y = _arg2;
_local5.speed.y = (ageMath.Random(-6, -18) * _arg3);
_local5.speed.x = (ageMath.Random(-10, 10) * _arg3);
if (_arg4.length){
_local5.gotoAndStop(_arg4);
} else {
_local5.gotoAndStop(ageMath.RandomInt(1, 20));
};
_local5.curLevel = this;
dynObjects.push(_local5);
propObjects.push(_local5);
_local5.isRubber = true;
_local5.stayTime = (3000 + ageMath.RandomInt(1, 2000));
_local5.timerStayDelay.start();
_local5.useRotateSpeed = true;
_local5.rotateSpeed = ageMath.RandomInt(-15, 15);
propLayer.addChild(_local5);
return (_local5);
}
public function addProj_BombWep(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projBombWep();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
_local6.blastStyle = _arg5.blastStyle;
_local6.attackRadius = _arg5.damageRadius;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProj_Rocket(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projRocket();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = true;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
_local6.blastStyle = _arg5.blastStyle;
_local6.attackRadius = _arg5.damageRadius;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function ifMCOnScreen(_arg1:MovieClip):Boolean{
var _local2:Point = this.localToGlobal(new Point(_arg1.x, _arg1.y));
var _local3:Rectangle = _arg1.getBounds(root);
var _local4:Rectangle = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
if (_local4.intersects(_local3)){
return (true);
};
return (false);
}
public function alignObjXToAnother(_arg1, _arg2):void{
if ((_arg1.x - (_arg1.width * 0.5)) < _arg2.x){
_arg1.x = (_arg1.x + (_arg2.x - (_arg1.x - (_arg1.width * 0.5))));
};
if ((_arg1.x + (_arg1.width * 0.5)) > (_arg2.x + _arg2.width)){
_arg1.x = (_arg1.x - ((_arg1.x + (_arg1.width * 0.5)) - (_arg2.x + _arg2.width)));
};
}
public function levInit(){
mainGlobal.secretsAll = 3;
curLevNum = 3;
curLevScore = 3600;
levelMus = "musGlory";
musicEnv.fadeTo(levelMus);
goArrow.visible = false;
sVar["triggerUpgrade1"] = false;
sVar["triggerUpgrade2"] = false;
levLeftLim = leftLevBorder.x;
levRightLim = rightLevBorder.x;
sVar["triggerSecret1"] = false;
sVar["triggerSecret2"] = false;
sVar["triggerSecret3"] = false;
sVar["DlgTedKilledAlien"] = false;
sVar["DlgTedKilledAlienEnd"] = false;
sVar["DlgTedKilledAlienTimer"] = 0;
sVar["triggerZombieGirl"] = false;
sVar["triggerZombieGirlEnd"] = false;
sVar["triggerZombieGirlTimer"] = 0;
sVar["prebossEnemies"] = false;
sVar["prebossEnemiesEnd"] = false;
sVar["prebossEnemiesTimer"] = 0;
sVar["DlgTedKilledBoss"] = false;
sVar["DlgTedKilledBossEnd"] = false;
sVar["DlgTedKilledBossTimer"] = 0;
}
public function addExplotion(_arg1:projObject, _arg2:actorObject=null):void{
var _local3:Number;
var _local5:int;
_local3 = ageMath.Distance(_arg1.x, _arg1.y, hero.x, hero.y);
var _local4:projObject = new projObject();
if (_local3 < _arg1.attackRadius){
_local4.damage = ageMath.RemapVal(_local3, 0, _arg1.attackRadius, _arg1.damage, 0);
_local4.x = hero.x;
_local4.y = (hero.y - (hero.height / 2));
_local4.fromGoodGuy = false;
hero.transmitDamage(_local4);
Game(parent).gameGUI.painFrame.startFadeOut();
_local4.clearDynObject();
};
_local5 = 0;
while (_local5 < enemies.length) {
if (((((enemies[_local5].dead) && (!((_arg2 == null))))) && (!((_arg2 == enemies[_local5]))))){
} else {
_local3 = ageMath.Distance(_arg1.x, _arg1.y, enemies[_local5].x, enemies[_local5].y);
if (_local3 < _arg1.attackRadius){
_local4.damage = ageMath.RemapVal(_local3, 0, _arg1.attackRadius, _arg1.damage, 0);
_local4.x = enemies[_local5].x;
_local4.y = (enemies[_local5].y - (enemies[_local5].height / 2));
_local4.fromGoodGuy = true;
enemies[_local5].transmitDamage(_local4);
_local4.clearDynObject();
};
};
_local5++;
};
}
public function addLimiter(_arg1){
limiters.push(_arg1);
}
public function addFX_BlastWave(_arg1:Number, _arg2:Number, _arg3:Number=1){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
_local4 = new fxBlastWave();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function addProp_minigunAmmo(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMinigunAmmo();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addActor(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:int=-1):actorObject{
var _local6:actorObject;
if (_arg1 == "AlienSaw"){
_local6 = new AlienSaw();
} else {
if (_arg1 == "AlienHunter"){
_local6 = new AlienHunter();
} else {
if (_arg1 == "AlienElectro"){
_local6 = new AlienElectro();
} else {
if (_arg1 == "Zomb01"){
_local6 = new Zomb01();
} else {
if (_arg1 == "Zomb02"){
_local6 = new Zomb02();
} else {
if (_arg1 == "Zomb03"){
_local6 = new Zomb03();
} else {
if (_arg1 == "Zomb04"){
_local6 = new Zomb04();
} else {
if (_arg1 == "Zomb05"){
_local6 = new Zomb05();
} else {
if (_arg1 == "Zomb01Run"){
_local6 = new Zomb01Run();
} else {
if (_arg1 == "Zomb02Run"){
_local6 = new Zomb02Run();
} else {
if (_arg1 == "Zomb03Run"){
_local6 = new Zomb03Run();
} else {
if (_arg1 == "Zomb04Run"){
_local6 = new Zomb04Run();
} else {
if (_arg1 == "Zomb05Run"){
_local6 = new Zomb05Run();
} else {
if (_arg1 == "Zomb01Vomit"){
_local6 = new Zomb01Vomit();
} else {
if (_arg1 == "Zomb02Vomit"){
_local6 = new Zomb02Vomit();
} else {
if (_arg1 == "Zomb03Vomit"){
_local6 = new Zomb03Vomit();
} else {
if (_arg1 == "Zomb04Vomit"){
_local6 = new Zomb04Vomit();
} else {
if (_arg1 == "Zomb05Vomit"){
_local6 = new Zomb05Vomit();
} else {
if (_arg1 == "Spider"){
_local6 = new Spider();
} else {
if (_arg1 == "AlienBomber"){
_local6 = new AlienBomber();
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
_local6.x = _arg3;
_local6.y = _arg4;
_local6.name = _arg2;
if (!_local6.noStatEnemy){
mainGlobal.enemiesAll++;
};
if (_arg5 < 0){
addChild(_local6);
} else {
addChildAt(_local6, _arg5);
};
return (_local6);
}
public function Update(_arg1:Event):void{
var _local5:int;
var _local6:*;
var _local7:*;
var _local11:int;
var _local12:addActorStruct;
var _local13:int;
var _local14:Number;
var _local15:Array;
var _local16:ColorMatrix;
if (isWin){
hero.body.stop();
return;
};
if (((((mainGlobal.paused) || (!(visible)))) || (!((parent as Game))))){
return;
};
if ((((hero.life <= 0)) && (!(isLose)))){
isLose = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuWinLose.startFadeIn();
Game(root).menuWinLose.setToLose();
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
musicEnv.fadeTo("musLose");
sounds.PlaySnd(("TedDie" + ageMath.RandomInt(1, 2).toString()), 0.8);
return;
};
if (initFirst){
if (((!(mainGlobal.configMusicOn)) && (!(mainGlobal.configSoundOn)))){
Game(parent).gamButSnd.gotoAndStop(2);
} else {
Game(parent).gamButSnd.gotoAndStop(1);
};
initFirst = false;
initLimCache();
Game(parent).fadeBG.fadeSpeed = 0.03;
Game(parent).fadeBG.use_force_restart = true;
Game(parent).fadeBG.startFadeOut();
Game(parent).gameGUI.hlpControl.visible = false;
Game(parent).gameGUI.dlg.visible = false;
Game(parent).gameGUI.dlgIco.x = -500;
_local6 = (hero.x * this.scaleX);
_local7 = ((hero.y - 95) * this.scaleY);
x = -((_local6 - (stage.stageWidth * 0.5)));
y = -((_local7 - (stage.stageHeight * 0.5)));
mainGlobal.initStat();
_local11 = 0;
_local11 = 0;
while (_local11 < enemies.length) {
if (!enemies[_local11].noStatEnemy){
mainGlobal.enemiesAll++;
};
_local11++;
};
Game(parent).sky.visible = true;
levInit();
if (mainGlobal.isSingleEp){
if (curLevNum == 1){
_local5 = 0;
while (_local5 < 1) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 0;
} else {
if (curLevNum == 2){
_local5 = 0;
while (_local5 < 2) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 200;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
} else {
if (curLevNum == 3){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
} else {
if (curLevNum == 4){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1300;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
} else {
if (curLevNum == 5){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1500;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
} else {
if (curLevNum == 6){
_local5 = 0;
while (_local5 < 4) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 2000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
} else {
if (curLevNum == 7){
_local5 = 0;
while (_local5 < 5) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 3000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
} else {
if (curLevNum == 8){
_local5 = 0;
while (_local5 < 5) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 3500;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
} else {
if (curLevNum == 9){
_local5 = 0;
while (_local5 < 6) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = 5;
hero.moneyCnt = 4000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
hero.applyUpgrade(1, 4);
hero.upgradesLife[4].active = true;
} else {
if (curLevNum == 10){
_local5 = 0;
while (_local5 < 6) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = 5;
hero.moneyCnt = 4000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
hero.applyUpgrade(1, 4);
hero.upgradesLife[4].active = true;
};
};
};
};
};
};
};
};
};
};
};
Game(parent).gameGUI.dlgIco.gotoAndStop(1);
};
var _local2:int = getTimer();
cleenUP();
UpdateLimitersOnScr();
UpdateParalaxObjects();
UpdateDynObjects();
UpdatePropObjects();
UpdateEnemies();
UpdateProjObjects();
hero.updateActor();
hero.applyDamages();
hero.testIsActorDead();
if (addActorsArr.length){
while (addActorsArr.length) {
_local12 = addActorsArr.pop();
addActor(_local12.strClass, "", _local12.posx, _local12.posy, _local12.orderZ);
};
};
var _local3:int;
_local3 = 0;
while (_local3 < chunkObjects.length) {
if (ifMCOnScreen(chunkObjects[_local3])){
chunkObjects[_local3].visible = true;
} else {
chunkObjects[_local3].visible = false;
};
_local3++;
};
levScript();
var _local4:Boolean;
if (Controls.key[Keyboard.F2]){
hero.life = 1;
};
if (Controls.key[Keyboard.ESCAPE]){
showGameMenu();
};
if (!hero.timerReloadDelay.running){
_local13 = 0;
while (_local13 < 8) {
if (((((Controls.key[(49 + _local13)]) && (!((hero.curWeaponNum == (_local13 + 1)))))) && (hero.weapons[_local13].active))){
hero.curWeaponNum = (_local13 + 1);
sounds.PlaySnd((hero.weapons[(hero.curWeaponNum - 1)].type + "Reloaded"));
};
_local13++;
};
};
if (Game(root).cursor.currentLabel == "cross"){
_local14 = ageMath.Distance(hero.x, hero.y, (Controls.mousePosX - x), (Controls.mousePosY - y));
Game(root).cursor.shootAcc.scaleX = (Game(root).cursor.shootAcc.scaleY = ((hero.wepAcc * _local14) / hero.weapons[(hero.curWeaponNum - 1)].accDistScale));
};
_local5 = 0;
_local5 = 0;
while (_local5 < 8) {
if (((hero.weapons[_local5]) && (hero.weapons[_local5].active))){
if ((((hero.weapons[_local5].bulletsInCatrige == 0)) && ((hero.weapons[_local5].bulletsNum == 0)))){
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 2){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 2;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(-124);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
} else {
if (hero.curWeaponNum != (_local5 + 1)){
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 1){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 1;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(0);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
} else {
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 3){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 3;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(87);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
};
};
} else {
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 4){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 4;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 0.5;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(0);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
};
_local5++;
};
Game(parent).gameGUI.wepInfo.catTxt.text = ((hero.weapons[(hero.curWeaponNum - 1)].bulletsInCatrige + "/") + hero.weapons[(hero.curWeaponNum - 1)].bulletsInCatrigeMax);
if (!hero.weapons[(hero.curWeaponNum - 1)].infAmmo){
Game(parent).gameGUI.wepInfo.allTxt.text = hero.weapons[(hero.curWeaponNum - 1)].bulletsNum;
} else {
Game(parent).gameGUI.wepInfo.allTxt.text = "INF";
};
Game(parent).gameGUI.wepInfo.pic.gotoAndStop((hero.curWeaponNum + 4));
if ((hero.x - (hero.width * 0.5)) < levLeftLim){
hero.x = (levLeftLim + (hero.width * 0.5));
} else {
if ((hero.x + (hero.width * 0.5)) > levRightLim){
hero.x = (levRightLim - (hero.width * 0.5));
};
};
_local6 = ageMath.Lerp((Controls.mousePosX - x), (hero.x * scaleX), 0.6);
_local7 = ageMath.Lerp((Controls.mousePosY - y), ((hero.y - 95) * scaleY), 0.6);
if (!_local4){
x = Math.round(ageMath.Lerp(x, -((_local6 - (stage.stageWidth * 0.5))), 0.15));
y = Math.round(ageMath.Lerp(y, -((_local7 - (stage.stageHeight * 0.5))), 0.15));
} else {
x = -((_local6 - (stage.stageWidth * 0.5)));
y = -((_local7 - (stage.stageHeight * 0.5)));
};
if (this["blackScr"]){
this["blackScr"].x = -(x);
this["blackScr"].y = -(y);
};
var _local8:Point = this.localToGlobal(new Point(levLeftLim, 0));
var _local9:Point = this.localToGlobal(new Point(levRightLim, 0));
if (_local8.x > 0){
x = (x - _local8.x);
} else {
if (_local9.x < stage.stageWidth){
x = (x + (stage.stageWidth - _local9.x));
};
};
if (curBlastShake > 0){
x = (x + ageMath.Random(-(curBlastShake), curBlastShake));
y = (y + ageMath.Random(-(curBlastShake), curBlastShake));
curBlastShake = (curBlastShake - curBlastShakeDec);
if (curBlastShake < 0){
curBlastShake = 0;
};
};
Game(parent).gameGUI.lifeBar.gotoAndStop(Math.round(ageMath.RemapVal(Math.round(hero.life), 1, hero.lifeMax, 1, 100)));
Game(parent).gameGUI.lifeBar.width = ageMath.RemapVal(Math.round(hero.lifeMax), 100, 300, 108, 227);
Game(parent).gameGUI.txtMoney.text = ("$" + hero.moneyCnt);
var _local10:int;
_local10 = 0;
while (_local10 < 6) {
if (hero.itemsInBag[_local10]){
Game(parent).gameGUI[("itm" + _local10)].gotoAndStop(hero.itemsInBag[_local10]);
} else {
Game(parent).gameGUI[("itm" + _local10)].gotoAndStop(1);
};
_local10++;
};
if (hero.bioMaxLevel > 0){
Game(parent).gameGUI.hazBio.visible = true;
Game(parent).gameGUI.hazBio.gotoAndStop((100 - int(ageMath.RemapVal(hero.bioCurLevel, 0, hero.bioMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazBio.visible = false;
};
if (hero.psyMaxLevel > 0){
Game(parent).gameGUI.hazPsy.visible = true;
Game(parent).gameGUI.hazPsy.gotoAndStop((100 - int(ageMath.RemapVal(hero.psyCurLevel, 0, hero.psyMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazPsy.visible = false;
};
if (hero.electroMaxLevel > 0){
Game(parent).gameGUI.hazElectro.visible = true;
Game(parent).gameGUI.hazElectro.gotoAndStop((100 - int(ageMath.RemapVal(hero.electroCurLevel, 0, hero.electroMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazElectro.visible = false;
};
Controls.updateKeyNew();
if (Game(parent).groundBG){
Game(parent).groundBG.changeBG(x, y);
};
}
public function addFX_MetalSparks(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxMetalSparks();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.blendMode = BlendMode.ADD;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function addProp_blasterAmmo(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propBlasterAmmo();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_Blaster(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propBlaster();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function UpdateEnemies():void{
var _local1:int;
_local1 = 0;
while (_local1 < enemies.length) {
if (((enemies[_local1].dead) || ((enemies[_local1].life <= 0)))){
} else {
if (((((!((enemies[_local1].parent as Level))) || (enemies[_local1].alwaysSeeEnemy))) || ((ageMath.Distance(enemies[_local1].x, enemies[_local1].y, hero.x, hero.y) < (stage.stageWidth * 1.6))))){
enemies[_local1].updateActorEnemy();
};
};
_local1++;
};
}
public function addProj_Vomit(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projVomit();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.timerFXAdd.delay = 80;
_local6.timerFXAdd.start();
_local6.fxFunc = addFX_VomitSplatters;
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = true;
_local6.gravityComp = true;
_local6.infAmmo = true;
_local6.useBioDamage = true;
_local6.bioDamageVal = 10;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
}
}//package main
Section 81
//Level4 (main.Level4)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.ui.*;
public dynamic class Level4 extends Level {
public var goArrow:MovieClip;
public var upWallY:MovieClip;
public var upWall:MovieClip;
public var tubeSpiders:MovieClip;
var dlgSpeedFactor:Number;// = 4
public var triggerLeverGM:MovieClip;
var levRightLim:Number;// = 999999
public var enemies:Array;
var lastMSFrame:int;// = 9999
var levLeftLim:Number;// = -999999
public var butLeverGM:MovieClip;
public var propObjects:Array;
public var triggerTubeSpiders:MovieClip;
public var triggerLeverCell:MovieClip;
public var minLimX:Number;// = 2147483647
public var limLeverGM:MovieClip;
public var limLeverCellDoor1:MovieClip;
public var limLeverCellDoor2:MovieClip;
public var maxLimX:Number;// = -2147483648
var curBlastShake:Number;// = 0
var isWin:Boolean;// = false
public var dynObjects:Array;
var isLose:Boolean;// = false
public var limLeverElevDoor:MovieClip;
var grav:Number;// = 1
public var triggerLeverElev:MovieClip;
public var triggerUpgrade1:MovieClip;
public var limitersCache:Array;
public var triggerBioGasLevel:MovieClip;
var initFirst:Boolean;// = false
var curLevNum:int;// = 1
public var butLeverCell:MovieClip;
public var triggerLevelEnd:MovieClip;
public var FXLayer:MovieClip;
public var blackScr:MovieClip;
var levelMus:String;// = ""
public var triggerSecret1:MovieClip;
public var triggerSecret2:MovieClip;
public var propLayer:MovieClip;
var sVar:Object;
public var LeverCellDoor1:MovieClip;
public var LeverCellDoor2:MovieClip;
public var limitersOnScr:Array;
public var butLeverElev:MovieClip;
public var addActorsArr:Array;
public var triggerLeverElevLIM:MovieClip;
public var limiters:Array;
public var LeverGM:MovieClip;
public var paralaxObjects:Array;
var curLevScore:int;// = 3000
public var fxObjects:Array;
var curBlastShakeDec:Number;// = 0.3
public var goodNPC:Array;
public var chunkObjects:Array;
var curScale:Number;// = 1
public var LeverElevDoor:MovieClip;
public var limitersCacheStep:int;// = 640
public var projObjects:Array;
public var hero:MovieClip;
public var projLayer:MovieClip;
public function Level4(){
sVar = new Object();
limiters = new Array();
limitersCache = new Array();
limitersOnScr = new Array();
dynObjects = new Array();
enemies = new Array();
goodNPC = new Array();
paralaxObjects = new Array();
projObjects = new Array();
chunkObjects = new Array();
fxObjects = new Array();
propObjects = new Array();
addActorsArr = new Array();
super();
addFrameScript(0, frame1);
init();
}
public function addLineDamage(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Boolean{
var _local6:Number;
var _local8:int;
var _local9:ageVector;
var _local7:Boolean;
_local8 = 0;
while (_local8 < enemies.length) {
if (enemies[_local8].dead){
} else {
_local9 = enemies[_local8].hitTestLine(_arg1, _arg2, _arg3, _arg4);
if (_local9 != null){
addLineDamageToEnemy(_local9, _arg5, enemies[_local8], true);
_local7 = true;
};
};
_local8++;
};
return (_local7);
}
public function levInit(){
mainGlobal.secretsAll = 2;
curLevNum = 4;
curLevScore = 3000;
levelMus = "musDarkAmb";
musicEnv.fadeTo(levelMus);
Game(parent).sky.visible = false;
levRightLim = (triggerLevelEnd.x + triggerLevelEnd.width);
sVar["triggerUpgrade1"] = false;
sVar["triggerLeverCell"] = false;
sVar["triggerLeverGM"] = false;
sVar["triggerLeverElev"] = false;
sVar["GMTaked"] = false;
sVar["triggerTedElevatorEnd"] = false;
sVar["DlgTedElevatorEndTimer"] = 0;
sVar["DlgTedElevatorEnd"] = false;
sVar["triggerTedBioEnd"] = false;
sVar["DlgTedBioTimer"] = 0;
sVar["DlgTedBioEnd"] = false;
sVar["triggerTubeSpiders"] = false;
}
public function addFX_VomitSplatters(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxVomitSpatters();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function initLimCache(){
var _local1:*;
var _local2:int;
var _local3:int;
var _local4:int;
maxLimX = int.MIN_VALUE;
minLimX = int.MAX_VALUE;
_local1 = 0;
while (_local1 < limiters.length) {
if (limiters[_local1].x < minLimX){
minLimX = limiters[_local1].x;
};
if ((limiters[_local1].x + limiters[_local1].width) > maxLimX){
maxLimX = limiters[_local1].x;
};
_local1++;
};
limitersCache = [];
_local1 = 0;
while (_local1 < (((maxLimX - minLimX) / limitersCacheStep) + 1)) {
limitersCache.push(new Array());
_local1++;
};
_local1 = 0;
while (_local1 < limiters.length) {
_local3 = int(((limiters[_local1].x - minLimX) / limitersCacheStep));
_local4 = int((((limiters[_local1].x + limiters[_local1].width) - minLimX) / limitersCacheStep));
_local2 = _local3;
while (_local2 <= _local4) {
if (!limitersCache[_local2]){
limitersCache[_local2] = new Array();
};
limitersCache[_local2].push(limiters[_local1]);
_local2++;
};
_local1++;
};
}
public function addFX_littleSmoke(_arg1:Number, _arg2:Number, _arg3:Number=1.5){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
_local4 = new fxLittleSmoke();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function init(){
addEventListener(Event.ENTER_FRAME, Update, false, 0, true);
}
public function openUpgradeMenu():void{
mainGlobal.paused = true;
this.visible = false;
Game(root).cursor.gotoAndStop("arrow");
Game(parent).menuUpgradeShop.showShop();
musicEnv.fadeTo("musUpgrade");
}
function mouseLeave(_arg1:Event):void{
showGameMenu();
}
public function UpdateParalaxObjects():void{
var _local1:int;
_local1 = 0;
while (_local1 < paralaxObjects.length) {
paralaxObjects[_local1].x = (paralaxObjects[_local1].saveX - ageMath.RemapVal((paralaxObjects[_local1].saveX + x), 0, stage.stageWidth, 0, paralaxObjects[_local1].paralaxX));
paralaxObjects[_local1].y = (paralaxObjects[_local1].saveY - ageMath.RemapVal((paralaxObjects[_local1].saveY + y), 0, stage.stageHeight, 0, paralaxObjects[_local1].paralaxY));
_local1++;
};
}
public function addBlinkFX_OverLight():void{
Game(parent).gameGUI.fxblink.fadeMaxLimit = 1;
Game(parent).gameGUI.fxblink.fadeSpeed = 0.03;
Game(parent).gameGUI.fxblink.use_force_restart = true;
Game(parent).gameGUI.fxblink.startFadeOut();
curBlastShake = 15;
}
public function UpdateDynObjects():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = 0;
while (_local1 < dynObjects.length) {
if (dynObjects[_local1].visible == false){
} else {
if (ageMath.Distance(dynObjects[_local1].x, dynObjects[_local1].y, hero.x, hero.y) < (stage.stageWidth * 1.6)){
if (dynObjects[_local1].gravityEnable){
dynObjects[_local1].speed.y = (dynObjects[_local1].speed.y + (grav * dynObjects[_local1].gravityFactor));
};
dynObjects[_local1].speed.y = ((dynObjects[_local1].speed.y)>dynObjects[_local1].maxSpeed.y) ? dynObjects[_local1].maxSpeed.y : dynObjects[_local1].speed.y;
dynObjects[_local1].y = (dynObjects[_local1].y + dynObjects[_local1].speed.y);
if (dynObjects[_local1].collisionEnable){
_local2 = int((((dynObjects[_local1].x - dynObjects[_local1].width) - minLimX) / limitersCacheStep));
_local3 = int((((dynObjects[_local1].x + dynObjects[_local1].width) - minLimX) / limitersCacheStep));
_local4 = _local2;
while (_local4 <= _local3) {
if (((limitersCache[_local4]) && (limitersCache[_local4].length))){
checkHitPlatform(dynObjects[_local1], limitersCache[_local4]);
};
_local4++;
};
};
};
};
_local1++;
};
}
public function cleenUP():void{
cleenUP_FX();
cleenUP_Proj();
cleenUP_Prop();
cleenUP_Actors();
}
public function checkHitPlatform(_arg1, _arg2:Array){
var _local3:int;
_arg1.bottomLimiter = null;
_local3 = 0;
while (_local3 < _arg2.length) {
if (((_arg2[_local3].slimMode) && ((_arg1.speed.y < 0)))){
} else {
if (_arg2[_local3].hitTestObject(_arg1.p2)){
_arg1.jump = false;
if (_arg1.isRubber){
_arg1.speed.y = (_arg1.speed.y * -(_arg1.rubberFactor));
_arg1.speed.x = (_arg1.speed.x * _arg1.rubberFactor);
if (_arg1.useRotateSpeed){
_arg1.rotateSpeed = 0;
};
} else {
_arg1.speed.y = 0;
};
_arg1.y = ((_arg2[_local3].y - _arg1.p2.y) - _arg1.p2.height);
_arg1.bottomLimiter = _arg2[_local3];
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p1)) && (!(_arg2[_local3].slimMode)))){
if (_arg1.scaleX > 0){
_arg1.x = (_arg2[_local3].x - (_arg1.p1.x + _arg1.p1.width));
} else {
_arg1.x = ((_arg2[_local3].x + _arg2[_local3].width) + (_arg1.p1.x + _arg1.p1.width));
};
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p3)) && (!(_arg2[_local3].slimMode)))){
if (_arg1.scaleX > 0){
_arg1.x = ((_arg2[_local3].x + _arg2[_local3].width) - _arg1.p3.x);
} else {
_arg1.x = (_arg2[_local3].x - (-(_arg1.p3.x) + _arg1.p3.width));
};
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p4)) && (!(_arg2[_local3].slimMode)))){
_arg1.speed.y = 0;
_arg1.y = ((_arg2[_local3].y + _arg2[_local3].height) - _arg1.p4.y);
};
};
};
};
};
_local3++;
};
}
public function addLineDamageToEnemy(_arg1:ageVector, _arg2:Number, _arg3:actorObject, _arg4:Boolean){
var _local5:projObject = new projObject();
_local5.damage = _arg2;
_local5.x = _arg1.x;
_local5.y = _arg1.y;
_local5.fromGoodGuy = _arg4;
_arg3.transmitDamage(_local5);
_local5.clearDynObject();
}
public function addFX_BloodOnGround(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new bloodOnGround();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.gotoAndStop(ageMath.RandomInt(1, 5));
_local3.scaleY = 0.5;
_local3.fadeSpeed = 0.005;
_local3.startFadeOut();
projLayer.addChild(_local3);
_local3.curDispContainer = projLayer;
fxObjects.push(_local3);
return (_local3);
}
public function cleenUP_Proj():void{
var _local1:int;
_local1 = 0;
while (_local1 < projObjects.length) {
if (((projObjects[_local1]) && ((projObjects[_local1].visible == false)))){
projObjects[_local1].clearDynObject();
if (projObjects[_local1]){
if (projObjects[_local1].parent){
projObjects[_local1].parent.removeChild(projObjects[_local1]);
};
};
projObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function cleenUP_Actors():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < enemies.length) {
if (((((enemies[_local1]) && ((enemies[_local1].visible == false)))) && (enemies[_local1].dead))){
_local2 = 0;
while (_local2 < dynObjects.length) {
if (dynObjects[_local2] == enemies[_local1]){
dynObjects[_local2].clearDynObject();
dynObjects.splice(_local2, 1);
break;
};
_local2++;
};
enemies[_local1].clearActorObject();
if (enemies[_local1]){
if (enemies[_local1].parent){
enemies[_local1].parent.removeChild(enemies[_local1]);
};
};
enemies.splice(_local1, 1);
break;
};
_local1++;
};
}
public function addBlasterProj(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new blasterProj();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function cleenUP_Prop():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < propObjects.length) {
if (((propObjects[_local1]) && ((propObjects[_local1].visible == false)))){
_local2 = 0;
while (_local2 < dynObjects.length) {
if (dynObjects[_local2] == propObjects[_local1]){
dynObjects[_local2].clearDynObject();
dynObjects.splice(_local2, 1);
break;
};
_local2++;
};
if (propObjects[_local1]){
if (propObjects[_local1].parent){
propObjects[_local1].parent.removeChild(propObjects[_local1]);
};
};
propObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function addProp_Shotgun(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propShotgun();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addBlinkFX_OverLight2():void{
Game(parent).gameGUI.fxblink2.fadeMaxLimit = 1;
Game(parent).gameGUI.fxblink2.fadeSpeed = 0.03;
Game(parent).gameGUI.fxblink2.use_force_restart = true;
Game(parent).gameGUI.fxblink2.startFadeOut();
}
public function addFX_BloodLeak(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new bloodLeak();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.fadeSpeed = 0.005;
_local3.startFadeOut();
projLayer.addChild(_local3);
_local3.curDispContainer = projLayer;
fxObjects.push(_local3);
return (_local3);
}
public function UpdateLimitersOnScr():void{
var _local1:int;
var _local2:int;
var _local3:*;
var _local4:int;
var _local5:Point;
var _local6:Rectangle;
var _local7:Rectangle;
limitersOnScr = [];
_local1 = int(((-(x) - minLimX) / limitersCacheStep));
_local2 = int((((-(x) + stage.stageWidth) - minLimX) / limitersCacheStep));
_local4 = _local1;
while (_local4 <= _local2) {
if (limitersCache[_local4]){
_local3 = 0;
while (_local3 < limitersCache[_local4].length) {
_local5 = this.localToGlobal(new Point(limitersCache[_local4][_local3].x, limitersCache[_local4][_local3].y));
_local6 = new Rectangle(_local5.x, _local5.y, limitersCache[_local4][_local3].width, limitersCache[_local4][_local3].height);
_local7 = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
if (_local7.intersects(_local6)){
limitersOnScr.push(limitersCache[_local4][_local3]);
};
_local3++;
};
};
_local4++;
};
}
public function testIntersectLimiterOnScr(_arg1:dynObject):Boolean{
var _local2:int;
_local2 = 0;
while (_local2 < limitersOnScr.length) {
if (((!(limitersOnScr[_local2].slimMode)) && (limitersOnScr[_local2].hitTestObject(_arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public function UpdateProjObjects():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < projObjects.length) {
if (projObjects[_local1].visible == false){
} else {
if (projObjects[_local1].gravityEnable){
projObjects[_local1].Velocity.y = (projObjects[_local1].Velocity.y + (grav * projObjects[_local1].gravityFactor));
projObjects[_local1].Velocity.y = ((projObjects[_local1].Velocity.y)>projObjects[_local1].maxSpeed.y) ? projObjects[_local1].maxSpeed.y : projObjects[_local1].Velocity.y;
};
projObjects[_local1].updateDynObj();
if (!projObjects[_local1].fromGoodGuy){
if (((!(hero.dead)) && (hero.hitTestProj(projObjects[_local1])))){
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
} else {
hero.transmitDamage(projObjects[_local1]);
Game(parent).gameGUI.painFrame.startFadeOut();
};
};
} else {
_local2 = 0;
while (_local2 < enemies.length) {
if (((!(enemies[_local2].dead)) && (enemies[_local2].hitTestProj(projObjects[_local1])))){
mainGlobal.shootingInEnemies++;
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
} else {
enemies[_local2].transmitDamage(projObjects[_local1]);
};
};
_local2++;
};
};
if (ageMath.Distance(projObjects[_local1].x, projObjects[_local1].y, hero.x, hero.y) > 670){
projObjects[_local1].visible = false;
};
if (testIntersectLimiterOnScr(projObjects[_local1])){
projObjects[_local1].visible = false;
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
};
};
};
_local1++;
};
}
public function cleenUP_FX():void{
var _local1:int;
_local1 = 0;
while (_local1 < fxObjects.length) {
if (((fxObjects[_local1]) && ((fxObjects[_local1].visible == false)))){
if (fxObjects[_local1]){
if (fxObjects[_local1].parent){
fxObjects[_local1].parent.removeChild(fxObjects[_local1]);
};
};
fxObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
function frame1(){
initFirst = true;
}
public function term(){
var _local1:int;
removeEventListener(Event.ENTER_FRAME, Update);
_local1 = 0;
while (_local1 < enemies.length) {
enemies[_local1].clearActorObject();
_local1++;
};
_local1 = 0;
while (_local1 < dynObjects.length) {
dynObjects[_local1].clearDynObject();
_local1++;
};
dynObjects = [];
enemies = [];
goodNPC = [];
projObjects = [];
paralaxObjects = [];
chunkObjects = [];
fxObjects = [];
propObjects = [];
addActorsArr = [];
limitersCache = [];
limitersOnScr = [];
limiters = [];
}
public function addProp_Coin(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propCoin();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
public function testRayToLimiterOnScr(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean=false, _arg6:Object=null):ageVector{
var _local10:int;
var _local11:ageVector;
var _local12:Number;
var _local13:ageVector;
var _local14:Number;
var _local7:ageVector;
var _local8:ageVector = new ageVector(_arg1, _arg3);
var _local9:Number = Number.MAX_VALUE;
_local10 = 0;
while (_local10 < limitersOnScr.length) {
if (!limitersOnScr[_local10].slimMode){
_local11 = ageMath.getLineCrossRect(_arg1, _arg2, _arg3, _arg4, limitersOnScr[_local10].x, limitersOnScr[_local10].y, (limitersOnScr[_local10].x + limitersOnScr[_local10].width), (limitersOnScr[_local10].y + limitersOnScr[_local10].height));
if (_local11 != null){
if (_local7 == null){
_local7 = new ageVector();
_local7.copy(_local11);
_local9 = ageMath.DistanceVec(_local8, _local7);
} else {
_local12 = ageMath.DistanceVec(_local8, _local11);
if (_local12 < _local9){
_local9 = _local12;
_local7.copy(_local11);
};
};
};
};
_local10++;
};
if (!_arg5){
return (_local7);
};
_arg6.id = -1;
_local10 = 0;
while (_local10 < enemies.length) {
if (enemies[_local10].dead){
} else {
_local13 = enemies[_local10].hitTestLine(_arg1, _arg2, _arg3, _arg4);
if (_local13 != null){
if (_local7 == null){
_local7 = new ageVector();
_local7.copy(_local13);
_arg6.id = _local10;
_local9 = ageMath.DistanceVec(_local8, _local7);
} else {
_local14 = ageMath.DistanceVec(_local8, _local13);
if (_local14 < _local9){
_local9 = _local14;
_arg6.id = _local10;
_local7.copy(_local13);
};
};
};
};
_local10++;
};
return (_local7);
}
public function levScript(){
var _local1:int;
var _local2:Point;
var _local3:int;
if (!sVar["triggerSecret1"]){
if (triggerSecret1.hitTestObject(hero)){
sVar["triggerSecret1"] = true;
Game(parent).gameGUI.hlpControl.showHelp(7);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
mainGlobal.secretsFound++;
};
};
if (!sVar["triggerSecret2"]){
if (triggerSecret2.hitTestObject(hero)){
sVar["triggerSecret2"] = true;
Game(parent).gameGUI.hlpControl.showHelp(7);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
mainGlobal.secretsFound++;
};
};
if (((!(hero.head.gm.visible)) && ((hero.y > triggerBioGasLevel.y)))){
hero.addBioDamage(0.6);
if (!sVar["triggerTedBioEnd"]){
sVar["triggerTedBioEnd"] = true;
_local1 = Game(parent).gameGUI.dlg.setTo("lev4_TedBio");
sVar["DlgTedBioTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
};
};
if (sVar["triggerTedBioEnd"]){
if (!sVar["DlgTedBioEnd"]){
if (sVar["DlgTedBioTimer"] == 0){
sVar["DlgTedBioEnd"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
} else {
var _local4 = sVar;
var _local5 = "DlgTedBioTimer";
var _local6 = (_local4[_local5] - 1);
_local4[_local5] = _local6;
if (Controls.keyNew[69]){
sVar["DlgTedBioTimer"] = 0;
};
};
};
};
if (!sVar["GMTaked"]){
if (hero.isItemExist("gasmask")){
hero.head.gm.visible = true;
};
};
if (!sVar["triggerUpgrade1"]){
if (triggerUpgrade1.hitTestObject(hero)){
if (((Controls.keyNew[Keyboard.ENTER]) || (Controls.keyNew[69]))){
openUpgradeMenu();
};
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(5);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
} else {
if (!triggerLeverGM.hitTestObject(hero)){
if (!triggerLeverCell.hitTestObject(hero)){
if (!triggerLeverElev.hitTestObject(hero)){
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 5)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
};
};
};
if (!sVar["triggerLeverCell"]){
if (triggerLeverCell.hitTestObject(hero)){
if (hero.isItemExist("lever")){
sVar["triggerLeverCell"] = true;
hero.removeItemFromBag("lever");
butLeverCell.play();
LeverCellDoor1.play();
LeverCellDoor2.play();
sounds.PlaySnd("sewerDoorOpen");
} else {
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(9);
Game(parent).gameGUI.hlpControl.pic2.gotoAndStop("lever");
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
};
} else {
if (!triggerLeverGM.hitTestObject(hero)){
if (!triggerUpgrade1.hitTestObject(hero)){
if (!triggerLeverElev.hitTestObject(hero)){
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 9)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
};
};
} else {
_local2 = this.globalToLocal(MovieClip(LeverCellDoor1).localToGlobal(new Point(LeverCellDoor1.anmPoint.x, LeverCellDoor1.anmPoint.y)));
limLeverCellDoor1.x = (_local2.x - limLeverCellDoor1.width);
_local2 = this.globalToLocal(MovieClip(LeverCellDoor2).localToGlobal(new Point(LeverCellDoor2.anmPoint.x, LeverCellDoor2.anmPoint.y)));
limLeverCellDoor2.x = _local2.x;
};
if (!sVar["triggerLeverGM"]){
if (triggerLeverGM.hitTestObject(hero)){
if (hero.isItemExist("lever")){
sVar["triggerLeverGM"] = true;
hero.removeItemFromBag("lever");
butLeverGM.play();
LeverGM.play();
sounds.PlaySnd("sewerDoorOpen");
} else {
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(9);
Game(parent).gameGUI.hlpControl.pic2.gotoAndStop("lever");
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
};
} else {
if (!triggerLeverCell.hitTestObject(hero)){
if (!triggerUpgrade1.hitTestObject(hero)){
if (!triggerLeverElev.hitTestObject(hero)){
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 9)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
};
};
} else {
_local2 = this.globalToLocal(MovieClip(LeverGM).localToGlobal(new Point(LeverGM.anmPoint.x, LeverGM.anmPoint.y)));
limLeverGM.y = _local2.y;
};
if (!sVar["triggerTubeSpiders"]){
if (triggerTubeSpiders.hitTestObject(hero)){
_local3 = 150;
sVar["triggerTubeSpiders"] = true;
addActor("Spider", "", tubeSpiders.x, (tubeSpiders.y - (_local3 * 1)), getChildIndex(tubeSpiders));
addActor("Spider", "", tubeSpiders.x, (tubeSpiders.y - (_local3 * 2)), getChildIndex(tubeSpiders));
addActor("Spider", "", tubeSpiders.x, (tubeSpiders.y - (_local3 * 3)), getChildIndex(tubeSpiders));
addActor("Spider", "", tubeSpiders.x, (tubeSpiders.y - (_local3 * 4)), getChildIndex(tubeSpiders));
addActor("Spider", "", tubeSpiders.x, (tubeSpiders.y - (_local3 * 5)), getChildIndex(tubeSpiders));
};
};
if (!sVar["triggerLeverElev"]){
if (triggerLeverElev.hitTestObject(hero)){
if (hero.isItemExist("valve")){
sVar["triggerLeverElev"] = true;
hero.removeItemFromBag("valve");
butLeverElev.play();
upWall.y = upWallY.y;
} else {
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(9);
Game(parent).gameGUI.hlpControl.pic2.gotoAndStop("valve");
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
};
} else {
if (!triggerLeverCell.hitTestObject(hero)){
if (!triggerUpgrade1.hitTestObject(hero)){
if (!triggerLeverGM.hitTestObject(hero)){
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 9)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
};
};
} else {
if (limLeverElevDoor.y > triggerLeverElevLIM.y){
limLeverElevDoor.y = (limLeverElevDoor.y - 2);
LeverElevDoor.y = (LeverElevDoor.y - 2);
} else {
if (!sVar["triggerTedElevatorEnd"]){
sVar["triggerTedElevatorEnd"] = true;
hero.head.gm.visible = false;
hero.removeItemFromBag("gasmask");
_local1 = Game(parent).gameGUI.dlg.setTo("lev4_TedElevatorEnd");
sVar["DlgTedElevatorEndTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
} else {
if (!sVar["DlgTedElevatorEnd"]){
if (sVar["DlgTedElevatorEndTimer"] == 0){
sVar["DlgTedElevatorEnd"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
} else {
_local4 = sVar;
_local5 = "DlgTedElevatorEndTimer";
_local6 = (_local4[_local5] - 1);
_local4[_local5] = _local6;
if (Controls.keyNew[69]){
sVar["DlgTedElevatorEndTimer"] = 0;
};
};
};
};
};
};
if (!isWin){
if (triggerLevelEnd.hitTestObject(hero)){
isWin = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuWinLose.startFadeIn();
Game(root).menuWinLose.setToWin();
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
musicEnv.fadeTo("musWin");
return;
};
};
}
public function addProp_MedKit(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new dropMedKit();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addFX_Headshot(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxHeadshot();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function addProp_Dynamite(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propDynamite();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addFX_Splatters(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxBloodSpatters();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function addProp_Money2(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMoney2();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_Money1(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMoney1();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
function showGameMenu():void{
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
Game(root).menuInGame.visible = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuInGame.startFadeIn();
}
public function addProj_MinigunBeam(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
var _local10:ageVector = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local10.normThis();
_local10.mulScalar(600);
_arg3 = (_local10.x + _arg1);
_arg4 = (_local10.y + _arg2);
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projMinigunBeam();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.gravityEnable = false;
var _local11:Object = {id:-1};
var _local12:ageVector = testRayToLimiterOnScr(_arg1, _arg2, _arg3, _arg4, true, _local11);
if (_local12 != null){
_arg3 = _local12.x;
_arg4 = _local12.y;
if (_local11.id != -1){
mainGlobal.shootingInEnemies++;
addLineDamageToEnemy(_local12, _arg5.damage, enemies[_local11.id], true);
};
};
_local6.scaleX = (ageMath.Distance(_arg1, _arg2, _arg3, _arg4) / 34);
_local6.rotation = _local8;
var _local13:Array = new Array();
_local13.push(new GlowFilter(0xFFFF00, 1, 15, 15, 4, BitmapFilterQuality.MEDIUM));
_local6.filters = _local13;
if (_arg5 != null){
};
this["FXLayer"].addChild(_local6);
fxObjects.push(_local6);
return (_local6);
}
public function addProj_LaserBeam(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
var _local10:ageVector = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local10.normThis();
_local10.mulScalar(600);
_arg3 = (_local10.x + _arg1);
_arg4 = (_local10.y + _arg2);
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projLaserBeam();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.gravityEnable = false;
var _local11:ageVector = testRayToLimiterOnScr(_arg1, _arg2, _arg3, _arg4);
if (_local11 != null){
_arg3 = _local11.x;
_arg4 = _local11.y;
};
if (addLineDamage(_arg1, _arg2, _arg3, _arg4, _arg5.damage)){
mainGlobal.shootingInEnemies++;
};
_local6.scaleX = (ageMath.Distance(_arg1, _arg2, _arg3, _arg4) / 34);
_local6.rotation = _local8;
_local6.use_force_restart = true;
_local6.fadeSpeed = 0.1;
_local6.startFadeOut();
_local6.gravityEnable = false;
var _local12:Array = new Array();
_local12.push(new GlowFilter(0xFF0000, 1, 15, 15, 1.7, BitmapFilterQuality.MEDIUM));
_local6.filters = _local12;
if (_arg5 != null){
};
this["FXLayer"].addChild(_local6);
fxObjects.push(_local6);
return (_local6);
}
public function addFX_littleBlast(_arg1:Number, _arg2:Number, _arg3:Number=1.5){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
addBlinkFX_OverLight();
_local4 = new fxBlast();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.blendMode = BlendMode.SCREEN;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function addProj(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projBullet();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, 24);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = true;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProp_Debris(_arg1:Number, _arg2:Number, _arg3:Number=1, _arg4:String=""):propObject{
var _local5:propObject;
_local5 = new propDebris();
_local5.x = _arg1;
_local5.y = _arg2;
_local5.speed.y = (ageMath.Random(-6, -18) * _arg3);
_local5.speed.x = (ageMath.Random(-10, 10) * _arg3);
if (_arg4.length){
_local5.gotoAndStop(_arg4);
} else {
_local5.gotoAndStop(ageMath.RandomInt(1, 20));
};
_local5.curLevel = this;
dynObjects.push(_local5);
propObjects.push(_local5);
_local5.isRubber = true;
_local5.stayTime = (3000 + ageMath.RandomInt(1, 2000));
_local5.timerStayDelay.start();
_local5.useRotateSpeed = true;
_local5.rotateSpeed = ageMath.RandomInt(-15, 15);
propLayer.addChild(_local5);
return (_local5);
}
public function addProj_BombWep(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projBombWep();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
_local6.blastStyle = _arg5.blastStyle;
_local6.attackRadius = _arg5.damageRadius;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProj_Psy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new psyProj();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
_local6.gravityComp = false;
_local6.infAmmo = true;
_local6.usePsyDamage = true;
_local6.psyDamageVal = 16;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProj_Rocket(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projRocket();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = true;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
_local6.blastStyle = _arg5.blastStyle;
_local6.attackRadius = _arg5.damageRadius;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function ifMCOnScreen(_arg1:MovieClip):Boolean{
var _local2:Point = this.localToGlobal(new Point(_arg1.x, _arg1.y));
var _local3:Rectangle = _arg1.getBounds(root);
var _local4:Rectangle = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
if (_local4.intersects(_local3)){
return (true);
};
return (false);
}
public function alignObjXToAnother(_arg1, _arg2):void{
if ((_arg1.x - (_arg1.width * 0.5)) < _arg2.x){
_arg1.x = (_arg1.x + (_arg2.x - (_arg1.x - (_arg1.width * 0.5))));
};
if ((_arg1.x + (_arg1.width * 0.5)) > (_arg2.x + _arg2.width)){
_arg1.x = (_arg1.x - ((_arg1.x + (_arg1.width * 0.5)) - (_arg2.x + _arg2.width)));
};
}
public function addExplotion(_arg1:projObject, _arg2:actorObject=null):void{
var _local3:Number;
var _local5:int;
_local3 = ageMath.Distance(_arg1.x, _arg1.y, hero.x, hero.y);
var _local4:projObject = new projObject();
if (_local3 < _arg1.attackRadius){
_local4.damage = ageMath.RemapVal(_local3, 0, _arg1.attackRadius, _arg1.damage, 0);
_local4.x = hero.x;
_local4.y = (hero.y - (hero.height / 2));
_local4.fromGoodGuy = false;
hero.transmitDamage(_local4);
Game(parent).gameGUI.painFrame.startFadeOut();
_local4.clearDynObject();
};
_local5 = 0;
while (_local5 < enemies.length) {
if (((((enemies[_local5].dead) && (!((_arg2 == null))))) && (!((_arg2 == enemies[_local5]))))){
} else {
_local3 = ageMath.Distance(_arg1.x, _arg1.y, enemies[_local5].x, enemies[_local5].y);
if (_local3 < _arg1.attackRadius){
_local4.damage = ageMath.RemapVal(_local3, 0, _arg1.attackRadius, _arg1.damage, 0);
_local4.x = enemies[_local5].x;
_local4.y = (enemies[_local5].y - (enemies[_local5].height / 2));
_local4.fromGoodGuy = true;
enemies[_local5].transmitDamage(_local4);
_local4.clearDynObject();
};
};
_local5++;
};
}
public function addLimiter(_arg1){
limiters.push(_arg1);
}
public function addProp_minigunAmmo(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMinigunAmmo();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addFX_BlastWave(_arg1:Number, _arg2:Number, _arg3:Number=1){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
_local4 = new fxBlastWave();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function Update(_arg1:Event):void{
var _local5:int;
var _local6:*;
var _local7:*;
var _local11:int;
var _local12:addActorStruct;
var _local13:int;
var _local14:Number;
var _local15:Array;
var _local16:ColorMatrix;
if (isWin){
hero.body.stop();
return;
};
if (((((mainGlobal.paused) || (!(visible)))) || (!((parent as Game))))){
return;
};
if ((((hero.life <= 0)) && (!(isLose)))){
isLose = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuWinLose.startFadeIn();
Game(root).menuWinLose.setToLose();
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
musicEnv.fadeTo("musLose");
sounds.PlaySnd(("TedDie" + ageMath.RandomInt(1, 2).toString()), 0.8);
return;
};
if (initFirst){
if (((!(mainGlobal.configMusicOn)) && (!(mainGlobal.configSoundOn)))){
Game(parent).gamButSnd.gotoAndStop(2);
} else {
Game(parent).gamButSnd.gotoAndStop(1);
};
initFirst = false;
initLimCache();
Game(parent).fadeBG.fadeSpeed = 0.03;
Game(parent).fadeBG.use_force_restart = true;
Game(parent).fadeBG.startFadeOut();
Game(parent).gameGUI.hlpControl.visible = false;
Game(parent).gameGUI.dlg.visible = false;
Game(parent).gameGUI.dlgIco.x = -500;
_local6 = (hero.x * this.scaleX);
_local7 = ((hero.y - 95) * this.scaleY);
x = -((_local6 - (stage.stageWidth * 0.5)));
y = -((_local7 - (stage.stageHeight * 0.5)));
mainGlobal.initStat();
_local11 = 0;
_local11 = 0;
while (_local11 < enemies.length) {
if (!enemies[_local11].noStatEnemy){
mainGlobal.enemiesAll++;
};
_local11++;
};
Game(parent).sky.visible = true;
levInit();
if (mainGlobal.isSingleEp){
if (curLevNum == 1){
_local5 = 0;
while (_local5 < 1) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 0;
} else {
if (curLevNum == 2){
_local5 = 0;
while (_local5 < 2) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 200;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
} else {
if (curLevNum == 3){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
} else {
if (curLevNum == 4){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1300;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
} else {
if (curLevNum == 5){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1500;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
} else {
if (curLevNum == 6){
_local5 = 0;
while (_local5 < 4) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 2000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
} else {
if (curLevNum == 7){
_local5 = 0;
while (_local5 < 5) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 3000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
} else {
if (curLevNum == 8){
_local5 = 0;
while (_local5 < 5) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 3500;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
} else {
if (curLevNum == 9){
_local5 = 0;
while (_local5 < 6) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = 5;
hero.moneyCnt = 4000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
hero.applyUpgrade(1, 4);
hero.upgradesLife[4].active = true;
} else {
if (curLevNum == 10){
_local5 = 0;
while (_local5 < 6) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = 5;
hero.moneyCnt = 4000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
hero.applyUpgrade(1, 4);
hero.upgradesLife[4].active = true;
};
};
};
};
};
};
};
};
};
};
};
Game(parent).gameGUI.dlgIco.gotoAndStop(1);
};
var _local2:int = getTimer();
cleenUP();
UpdateLimitersOnScr();
UpdateParalaxObjects();
UpdateDynObjects();
UpdatePropObjects();
UpdateEnemies();
UpdateProjObjects();
hero.updateActor();
hero.applyDamages();
hero.testIsActorDead();
if (addActorsArr.length){
while (addActorsArr.length) {
_local12 = addActorsArr.pop();
addActor(_local12.strClass, "", _local12.posx, _local12.posy, _local12.orderZ);
};
};
var _local3:int;
_local3 = 0;
while (_local3 < chunkObjects.length) {
if (ifMCOnScreen(chunkObjects[_local3])){
chunkObjects[_local3].visible = true;
} else {
chunkObjects[_local3].visible = false;
};
_local3++;
};
levScript();
var _local4:Boolean;
if (Controls.key[Keyboard.F2]){
hero.life = 1;
};
if (Controls.key[Keyboard.ESCAPE]){
showGameMenu();
};
if (!hero.timerReloadDelay.running){
_local13 = 0;
while (_local13 < 8) {
if (((((Controls.key[(49 + _local13)]) && (!((hero.curWeaponNum == (_local13 + 1)))))) && (hero.weapons[_local13].active))){
hero.curWeaponNum = (_local13 + 1);
sounds.PlaySnd((hero.weapons[(hero.curWeaponNum - 1)].type + "Reloaded"));
};
_local13++;
};
};
if (Game(root).cursor.currentLabel == "cross"){
_local14 = ageMath.Distance(hero.x, hero.y, (Controls.mousePosX - x), (Controls.mousePosY - y));
Game(root).cursor.shootAcc.scaleX = (Game(root).cursor.shootAcc.scaleY = ((hero.wepAcc * _local14) / hero.weapons[(hero.curWeaponNum - 1)].accDistScale));
};
_local5 = 0;
_local5 = 0;
while (_local5 < 8) {
if (((hero.weapons[_local5]) && (hero.weapons[_local5].active))){
if ((((hero.weapons[_local5].bulletsInCatrige == 0)) && ((hero.weapons[_local5].bulletsNum == 0)))){
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 2){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 2;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(-124);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
} else {
if (hero.curWeaponNum != (_local5 + 1)){
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 1){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 1;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(0);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
} else {
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 3){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 3;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(87);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
};
};
} else {
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 4){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 4;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 0.5;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(0);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
};
_local5++;
};
Game(parent).gameGUI.wepInfo.catTxt.text = ((hero.weapons[(hero.curWeaponNum - 1)].bulletsInCatrige + "/") + hero.weapons[(hero.curWeaponNum - 1)].bulletsInCatrigeMax);
if (!hero.weapons[(hero.curWeaponNum - 1)].infAmmo){
Game(parent).gameGUI.wepInfo.allTxt.text = hero.weapons[(hero.curWeaponNum - 1)].bulletsNum;
} else {
Game(parent).gameGUI.wepInfo.allTxt.text = "INF";
};
Game(parent).gameGUI.wepInfo.pic.gotoAndStop((hero.curWeaponNum + 4));
if ((hero.x - (hero.width * 0.5)) < levLeftLim){
hero.x = (levLeftLim + (hero.width * 0.5));
} else {
if ((hero.x + (hero.width * 0.5)) > levRightLim){
hero.x = (levRightLim - (hero.width * 0.5));
};
};
_local6 = ageMath.Lerp((Controls.mousePosX - x), (hero.x * scaleX), 0.6);
_local7 = ageMath.Lerp((Controls.mousePosY - y), ((hero.y - 95) * scaleY), 0.6);
if (!_local4){
x = Math.round(ageMath.Lerp(x, -((_local6 - (stage.stageWidth * 0.5))), 0.15));
y = Math.round(ageMath.Lerp(y, -((_local7 - (stage.stageHeight * 0.5))), 0.15));
} else {
x = -((_local6 - (stage.stageWidth * 0.5)));
y = -((_local7 - (stage.stageHeight * 0.5)));
};
if (this["blackScr"]){
this["blackScr"].x = -(x);
this["blackScr"].y = -(y);
};
var _local8:Point = this.localToGlobal(new Point(levLeftLim, 0));
var _local9:Point = this.localToGlobal(new Point(levRightLim, 0));
if (_local8.x > 0){
x = (x - _local8.x);
} else {
if (_local9.x < stage.stageWidth){
x = (x + (stage.stageWidth - _local9.x));
};
};
if (curBlastShake > 0){
x = (x + ageMath.Random(-(curBlastShake), curBlastShake));
y = (y + ageMath.Random(-(curBlastShake), curBlastShake));
curBlastShake = (curBlastShake - curBlastShakeDec);
if (curBlastShake < 0){
curBlastShake = 0;
};
};
Game(parent).gameGUI.lifeBar.gotoAndStop(Math.round(ageMath.RemapVal(Math.round(hero.life), 1, hero.lifeMax, 1, 100)));
Game(parent).gameGUI.lifeBar.width = ageMath.RemapVal(Math.round(hero.lifeMax), 100, 300, 108, 227);
Game(parent).gameGUI.txtMoney.text = ("$" + hero.moneyCnt);
var _local10:int;
_local10 = 0;
while (_local10 < 6) {
if (hero.itemsInBag[_local10]){
Game(parent).gameGUI[("itm" + _local10)].gotoAndStop(hero.itemsInBag[_local10]);
} else {
Game(parent).gameGUI[("itm" + _local10)].gotoAndStop(1);
};
_local10++;
};
if (hero.bioMaxLevel > 0){
Game(parent).gameGUI.hazBio.visible = true;
Game(parent).gameGUI.hazBio.gotoAndStop((100 - int(ageMath.RemapVal(hero.bioCurLevel, 0, hero.bioMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazBio.visible = false;
};
if (hero.psyMaxLevel > 0){
Game(parent).gameGUI.hazPsy.visible = true;
Game(parent).gameGUI.hazPsy.gotoAndStop((100 - int(ageMath.RemapVal(hero.psyCurLevel, 0, hero.psyMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazPsy.visible = false;
};
if (hero.electroMaxLevel > 0){
Game(parent).gameGUI.hazElectro.visible = true;
Game(parent).gameGUI.hazElectro.gotoAndStop((100 - int(ageMath.RemapVal(hero.electroCurLevel, 0, hero.electroMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazElectro.visible = false;
};
Controls.updateKeyNew();
if (Game(parent).groundBG){
Game(parent).groundBG.changeBG(x, y);
};
}
public function UpdatePropObjects():void{
var _local1:int;
_local1 = 0;
while (_local1 < propObjects.length) {
if (propObjects[_local1].visible == false){
} else {
if (ageMath.Distance(propObjects[_local1].x, propObjects[_local1].y, hero.x, hero.y) >= (stage.stageWidth * 1.6)){
} else {
propObjects[_local1].x = (propObjects[_local1].x + propObjects[_local1].speed.x);
if (propObjects[_local1].useRotateSpeed){
propObjects[_local1].body.rotation = (propObjects[_local1].body.rotation + propObjects[_local1].rotateSpeed);
};
if ((((((((((((propObjects[_local1].propType == "Med")) || ((propObjects[_local1].propType == "Coin")))) || ((propObjects[_local1].propType == "Money")))) || ((propObjects[_local1].propType == "Weapon")))) || ((propObjects[_local1].propType == "Item")))) || ((propObjects[_local1].propType == "Ammo")))){
if (hero.hitTestObject(propObjects[_local1])){
if (propObjects[_local1].propType == "Ammo"){
if (hero.weapons[propObjects[_local1].wepNum].active){
if (hero.weapons[propObjects[_local1].wepNum].bulletsNum < hero.weapons[propObjects[_local1].wepNum].bulletsNumMax){
propObjects[_local1].visible = false;
hero.weapons[propObjects[_local1].wepNum].bulletsNum = (hero.weapons[propObjects[_local1].wepNum].bulletsNum + (hero.weapons[propObjects[_local1].wepNum].bulletsInCatrigeMax * propObjects[_local1].moneyAmount));
if (hero.weapons[propObjects[_local1].wepNum].bulletsNum > hero.weapons[propObjects[_local1].wepNum].bulletsNumMax){
hero.weapons[propObjects[_local1].wepNum].bulletsNum = hero.weapons[propObjects[_local1].wepNum].bulletsNumMax;
};
sounds.PlaySnd((hero.weapons[propObjects[_local1].wepNum].type + "Reloaded"));
};
};
} else {
if (propObjects[_local1].propType == "Med"){
if (hero.life < hero.lifeMax){
propObjects[_local1].visible = false;
hero.life = (hero.life + propObjects[_local1].moneyAmount);
if (hero.life > hero.lifeMax){
hero.life = hero.lifeMax;
};
sounds.PlaySnd("Med");
};
} else {
if (propObjects[_local1].propType == "Item"){
propObjects[_local1].visible = false;
hero.itemsInBag.push(propObjects[_local1].itemName);
sounds.PlaySnd("itemTake");
} else {
if (propObjects[_local1].propType == "Weapon"){
propObjects[_local1].visible = false;
hero.weapons[propObjects[_local1].wepNum].active = true;
hero.curWeaponNum = (propObjects[_local1].wepNum + 1);
sounds.PlaySnd((hero.weapons[(hero.curWeaponNum - 1)].type + "Reloaded"));
} else {
propObjects[_local1].visible = false;
sounds.PlaySnd((propObjects[_local1].propType + "1"));
hero.moneyCnt = (hero.moneyCnt + propObjects[_local1].moneyAmount);
mainGlobal.moneyCollected = (mainGlobal.moneyCollected + propObjects[_local1].moneyAmount);
};
};
};
};
};
};
};
};
_local1++;
};
}
public function addActor(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:int=-1):actorObject{
var _local6:actorObject;
if (_arg1 == "AlienSaw"){
_local6 = new AlienSaw();
} else {
if (_arg1 == "AlienHunter"){
_local6 = new AlienHunter();
} else {
if (_arg1 == "AlienElectro"){
_local6 = new AlienElectro();
} else {
if (_arg1 == "Zomb01"){
_local6 = new Zomb01();
} else {
if (_arg1 == "Zomb02"){
_local6 = new Zomb02();
} else {
if (_arg1 == "Zomb03"){
_local6 = new Zomb03();
} else {
if (_arg1 == "Zomb04"){
_local6 = new Zomb04();
} else {
if (_arg1 == "Zomb05"){
_local6 = new Zomb05();
} else {
if (_arg1 == "Zomb01Run"){
_local6 = new Zomb01Run();
} else {
if (_arg1 == "Zomb02Run"){
_local6 = new Zomb02Run();
} else {
if (_arg1 == "Zomb03Run"){
_local6 = new Zomb03Run();
} else {
if (_arg1 == "Zomb04Run"){
_local6 = new Zomb04Run();
} else {
if (_arg1 == "Zomb05Run"){
_local6 = new Zomb05Run();
} else {
if (_arg1 == "Zomb01Vomit"){
_local6 = new Zomb01Vomit();
} else {
if (_arg1 == "Zomb02Vomit"){
_local6 = new Zomb02Vomit();
} else {
if (_arg1 == "Zomb03Vomit"){
_local6 = new Zomb03Vomit();
} else {
if (_arg1 == "Zomb04Vomit"){
_local6 = new Zomb04Vomit();
} else {
if (_arg1 == "Zomb05Vomit"){
_local6 = new Zomb05Vomit();
} else {
if (_arg1 == "Spider"){
_local6 = new Spider();
} else {
if (_arg1 == "AlienBomber"){
_local6 = new AlienBomber();
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
_local6.x = _arg3;
_local6.y = _arg4;
_local6.name = _arg2;
if (!_local6.noStatEnemy){
mainGlobal.enemiesAll++;
};
if (_arg5 < 0){
addChild(_local6);
} else {
addChildAt(_local6, _arg5);
};
return (_local6);
}
public function addFX_MetalSparks(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxMetalSparks();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.blendMode = BlendMode.ADD;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function addProp_blasterAmmo(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propBlasterAmmo();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_Blaster(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propBlaster();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function UpdateEnemies():void{
var _local1:int;
_local1 = 0;
while (_local1 < enemies.length) {
if (((enemies[_local1].dead) || ((enemies[_local1].life <= 0)))){
} else {
if (((((!((enemies[_local1].parent as Level))) || (enemies[_local1].alwaysSeeEnemy))) || ((ageMath.Distance(enemies[_local1].x, enemies[_local1].y, hero.x, hero.y) < (stage.stageWidth * 1.6))))){
enemies[_local1].updateActorEnemy();
};
};
_local1++;
};
}
public function addProj_Vomit(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projVomit();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.timerFXAdd.delay = 80;
_local6.timerFXAdd.start();
_local6.fxFunc = addFX_VomitSplatters;
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = true;
_local6.gravityComp = true;
_local6.infAmmo = true;
_local6.useBioDamage = true;
_local6.bioDamageVal = 10;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
}
}//package main
Section 82
//Level5 (main.Level5)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.ui.*;
public dynamic class Level5 extends Level {
public var triggerValveGas:MovieClip;
public var goArrow:MovieClip;
public var projLayer:MovieClip;
var levRightLim:Number;// = 999999
var dlgSpeedFactor:Number;// = 4
public var bunkerMinigunBorder:MovieClip;
public var triggerLevelRightBorder:MovieClip;
public var bunkerMan:MovieClip;
var lastMSFrame:int;// = 9999
public var leverSecretRoomHatchLim:MovieClip;
public var enemies:Array;
public var hero:MovieClip;
public var valveGas:MovieClip;
var levLeftLim:Number;// = -999999
public var propObjects:Array;
public var triggerEndLevel:MovieClip;
public var triggerBunkerManCall:MovieClip;
public var triggerSoundBoss:MovieClip;
public var triggerBunkerMan:MovieClip;
public var codeLockBoss:MovieClip;
public var leverHangar:MovieClip;
public var maxLimX:Number;// = -2147483648
var curBlastShake:Number;// = 0
public var dynObjects:Array;
var isLose:Boolean;// = false
var grav:Number;// = 1
public var minLimX:Number;// = 2147483647
var isWin:Boolean;// = false
public var leverSecretRoomHatch:MovieClip;
public var triggerUpgrade1:MovieClip;
public var triggerUpgrade2:MovieClip;
public var triggerLeverHangar:MovieClip;
public var limitersCache:Array;
public var gas1:MovieClip;
public var gas2:MovieClip;
public var gas3:MovieClip;
var initFirst:Boolean;// = false
var curLevNum:int;// = 1
public var codeLockBossHatchLim:MovieClip;
public var leverHangarHatchLim:MovieClip;
public var FXLayer:MovieClip;
public var blackScr:MovieClip;
var levelMus:String;// = ""
public var triggerSecret1:MovieClip;
public var propLayer:MovieClip;
public var bunkerManBorder:MovieClip;
public var triggerSecret2:MovieClip;
var sVar:Object;
public var limitersOnScr:Array;
public var addActorsArr:Array;
public var limiters:Array;
public var paralaxObjects:Array;
var curBlastShakeDec:Number;// = 0.3
public var leverSecretRoom:MovieClip;
public var triggerLevelLeftBorder:MovieClip;
public var fxObjects:Array;
public var limitersCacheStep:int;// = 640
var curLevScore:int;// = 3000
public var markerZombGen1:MovieClip;
public var markerZombGen2:MovieClip;
public var chunkObjects:Array;
public var goodNPC:Array;
var curScale:Number;// = 1
public var leverHangarHatch:MovieClip;
public var projObjects:Array;
public var codeLockBossHatch:MovieClip;
public var triggerLeverSecretRoom:MovieClip;
public function Level5(){
sVar = new Object();
limiters = new Array();
limitersCache = new Array();
limitersOnScr = new Array();
dynObjects = new Array();
enemies = new Array();
goodNPC = new Array();
paralaxObjects = new Array();
projObjects = new Array();
chunkObjects = new Array();
fxObjects = new Array();
propObjects = new Array();
addActorsArr = new Array();
super();
addFrameScript(0, frame1);
init();
}
public function UpdateEnemies():void{
var _local1:int;
_local1 = 0;
while (_local1 < enemies.length) {
if (((enemies[_local1].dead) || ((enemies[_local1].life <= 0)))){
} else {
if (((((!((enemies[_local1].parent as Level))) || (enemies[_local1].alwaysSeeEnemy))) || ((ageMath.Distance(enemies[_local1].x, enemies[_local1].y, hero.x, hero.y) < (stage.stageWidth * 1.6))))){
enemies[_local1].updateActorEnemy();
};
};
_local1++;
};
}
public function checkHitPlatform(_arg1, _arg2:Array){
var _local3:int;
_arg1.bottomLimiter = null;
_local3 = 0;
while (_local3 < _arg2.length) {
if (((_arg2[_local3].slimMode) && ((_arg1.speed.y < 0)))){
} else {
if (_arg2[_local3].hitTestObject(_arg1.p2)){
_arg1.jump = false;
if (_arg1.isRubber){
_arg1.speed.y = (_arg1.speed.y * -(_arg1.rubberFactor));
_arg1.speed.x = (_arg1.speed.x * _arg1.rubberFactor);
if (_arg1.useRotateSpeed){
_arg1.rotateSpeed = 0;
};
} else {
_arg1.speed.y = 0;
};
_arg1.y = ((_arg2[_local3].y - _arg1.p2.y) - _arg1.p2.height);
_arg1.bottomLimiter = _arg2[_local3];
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p1)) && (!(_arg2[_local3].slimMode)))){
if (_arg1.scaleX > 0){
_arg1.x = (_arg2[_local3].x - (_arg1.p1.x + _arg1.p1.width));
} else {
_arg1.x = ((_arg2[_local3].x + _arg2[_local3].width) + (_arg1.p1.x + _arg1.p1.width));
};
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p3)) && (!(_arg2[_local3].slimMode)))){
if (_arg1.scaleX > 0){
_arg1.x = ((_arg2[_local3].x + _arg2[_local3].width) - _arg1.p3.x);
} else {
_arg1.x = (_arg2[_local3].x - (-(_arg1.p3.x) + _arg1.p3.width));
};
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p4)) && (!(_arg2[_local3].slimMode)))){
_arg1.speed.y = 0;
_arg1.y = ((_arg2[_local3].y + _arg2[_local3].height) - _arg1.p4.y);
};
};
};
};
};
_local3++;
};
}
public function addFX_BlastWave(_arg1:Number, _arg2:Number, _arg3:Number=1){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
_local4 = new fxBlastWave();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function addLineDamage(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Boolean{
var _local6:Number;
var _local8:int;
var _local9:ageVector;
var _local7:Boolean;
_local8 = 0;
while (_local8 < enemies.length) {
if (enemies[_local8].dead){
} else {
_local9 = enemies[_local8].hitTestLine(_arg1, _arg2, _arg3, _arg4);
if (_local9 != null){
addLineDamageToEnemy(_local9, _arg5, enemies[_local8], true);
_local7 = true;
};
};
_local8++;
};
return (_local7);
}
public function addFX_littleSmoke(_arg1:Number, _arg2:Number, _arg3:Number=1.5){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
_local4 = new fxLittleSmoke();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function init(){
addEventListener(Event.ENTER_FRAME, Update, false, 0, true);
}
public function openUpgradeMenu():void{
mainGlobal.paused = true;
this.visible = false;
Game(root).cursor.gotoAndStop("arrow");
Game(parent).menuUpgradeShop.showShop();
musicEnv.fadeTo("musUpgrade");
}
public function addProp_minigunAmmo(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMinigunAmmo();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
function mouseLeave(_arg1:Event):void{
showGameMenu();
}
public function initLimCache(){
var _local1:*;
var _local2:int;
var _local3:int;
var _local4:int;
maxLimX = int.MIN_VALUE;
minLimX = int.MAX_VALUE;
_local1 = 0;
while (_local1 < limiters.length) {
if (limiters[_local1].x < minLimX){
minLimX = limiters[_local1].x;
};
if ((limiters[_local1].x + limiters[_local1].width) > maxLimX){
maxLimX = limiters[_local1].x;
};
_local1++;
};
limitersCache = [];
_local1 = 0;
while (_local1 < (((maxLimX - minLimX) / limitersCacheStep) + 1)) {
limitersCache.push(new Array());
_local1++;
};
_local1 = 0;
while (_local1 < limiters.length) {
_local3 = int(((limiters[_local1].x - minLimX) / limitersCacheStep));
_local4 = int((((limiters[_local1].x + limiters[_local1].width) - minLimX) / limitersCacheStep));
_local2 = _local3;
while (_local2 <= _local4) {
if (!limitersCache[_local2]){
limitersCache[_local2] = new Array();
};
limitersCache[_local2].push(limiters[_local1]);
_local2++;
};
_local1++;
};
}
public function addBlinkFX_OverLight():void{
Game(parent).gameGUI.fxblink.fadeMaxLimit = 1;
Game(parent).gameGUI.fxblink.fadeSpeed = 0.03;
Game(parent).gameGUI.fxblink.use_force_restart = true;
Game(parent).gameGUI.fxblink.startFadeOut();
curBlastShake = 15;
}
public function UpdateParalaxObjects():void{
var _local1:int;
_local1 = 0;
while (_local1 < paralaxObjects.length) {
paralaxObjects[_local1].x = (paralaxObjects[_local1].saveX - ageMath.RemapVal((paralaxObjects[_local1].saveX + x), 0, stage.stageWidth, 0, paralaxObjects[_local1].paralaxX));
paralaxObjects[_local1].y = (paralaxObjects[_local1].saveY - ageMath.RemapVal((paralaxObjects[_local1].saveY + y), 0, stage.stageHeight, 0, paralaxObjects[_local1].paralaxY));
_local1++;
};
}
public function addFX_VomitSplatters(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxVomitSpatters();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function UpdateDynObjects():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = 0;
while (_local1 < dynObjects.length) {
if (dynObjects[_local1].visible == false){
} else {
if (ageMath.Distance(dynObjects[_local1].x, dynObjects[_local1].y, hero.x, hero.y) < (stage.stageWidth * 1.6)){
if (dynObjects[_local1].gravityEnable){
dynObjects[_local1].speed.y = (dynObjects[_local1].speed.y + (grav * dynObjects[_local1].gravityFactor));
};
dynObjects[_local1].speed.y = ((dynObjects[_local1].speed.y)>dynObjects[_local1].maxSpeed.y) ? dynObjects[_local1].maxSpeed.y : dynObjects[_local1].speed.y;
dynObjects[_local1].y = (dynObjects[_local1].y + dynObjects[_local1].speed.y);
if (dynObjects[_local1].collisionEnable){
_local2 = int((((dynObjects[_local1].x - dynObjects[_local1].width) - minLimX) / limitersCacheStep));
_local3 = int((((dynObjects[_local1].x + dynObjects[_local1].width) - minLimX) / limitersCacheStep));
_local4 = _local2;
while (_local4 <= _local3) {
if (((limitersCache[_local4]) && (limitersCache[_local4].length))){
checkHitPlatform(dynObjects[_local1], limitersCache[_local4]);
};
_local4++;
};
};
};
};
_local1++;
};
}
public function cleenUP():void{
cleenUP_FX();
cleenUP_Proj();
cleenUP_Prop();
cleenUP_Actors();
}
public function addFX_BloodOnGround(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new bloodOnGround();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.gotoAndStop(ageMath.RandomInt(1, 5));
_local3.scaleY = 0.5;
_local3.fadeSpeed = 0.005;
_local3.startFadeOut();
projLayer.addChild(_local3);
_local3.curDispContainer = projLayer;
fxObjects.push(_local3);
return (_local3);
}
public function cleenUP_Proj():void{
var _local1:int;
_local1 = 0;
while (_local1 < projObjects.length) {
if (((projObjects[_local1]) && ((projObjects[_local1].visible == false)))){
projObjects[_local1].clearDynObject();
if (projObjects[_local1]){
if (projObjects[_local1].parent){
projObjects[_local1].parent.removeChild(projObjects[_local1]);
};
};
projObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function cleenUP_Actors():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < enemies.length) {
if (((((enemies[_local1]) && ((enemies[_local1].visible == false)))) && (enemies[_local1].dead))){
_local2 = 0;
while (_local2 < dynObjects.length) {
if (dynObjects[_local2] == enemies[_local1]){
dynObjects[_local2].clearDynObject();
dynObjects.splice(_local2, 1);
break;
};
_local2++;
};
enemies[_local1].clearActorObject();
if (enemies[_local1]){
if (enemies[_local1].parent){
enemies[_local1].parent.removeChild(enemies[_local1]);
};
};
enemies.splice(_local1, 1);
break;
};
_local1++;
};
}
public function cleenUP_Prop():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < propObjects.length) {
if (((propObjects[_local1]) && ((propObjects[_local1].visible == false)))){
_local2 = 0;
while (_local2 < dynObjects.length) {
if (dynObjects[_local2] == propObjects[_local1]){
dynObjects[_local2].clearDynObject();
dynObjects.splice(_local2, 1);
break;
};
_local2++;
};
if (propObjects[_local1]){
if (propObjects[_local1].parent){
propObjects[_local1].parent.removeChild(propObjects[_local1]);
};
};
propObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function addBlasterProj(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new blasterProj();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProp_Shotgun(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propShotgun();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addFX_BloodLeak(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new bloodLeak();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.fadeSpeed = 0.005;
_local3.startFadeOut();
projLayer.addChild(_local3);
_local3.curDispContainer = projLayer;
fxObjects.push(_local3);
return (_local3);
}
public function addLineDamageToEnemy(_arg1:ageVector, _arg2:Number, _arg3:actorObject, _arg4:Boolean){
var _local5:projObject = new projObject();
_local5.damage = _arg2;
_local5.x = _arg1.x;
_local5.y = _arg1.y;
_local5.fromGoodGuy = _arg4;
_arg3.transmitDamage(_local5);
_local5.clearDynObject();
}
public function testIntersectLimiterOnScr(_arg1:dynObject):Boolean{
var _local2:int;
_local2 = 0;
while (_local2 < limitersOnScr.length) {
if (((!(limitersOnScr[_local2].slimMode)) && (limitersOnScr[_local2].hitTestObject(_arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public function UpdateProjObjects():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < projObjects.length) {
if (projObjects[_local1].visible == false){
} else {
if (projObjects[_local1].gravityEnable){
projObjects[_local1].Velocity.y = (projObjects[_local1].Velocity.y + (grav * projObjects[_local1].gravityFactor));
projObjects[_local1].Velocity.y = ((projObjects[_local1].Velocity.y)>projObjects[_local1].maxSpeed.y) ? projObjects[_local1].maxSpeed.y : projObjects[_local1].Velocity.y;
};
projObjects[_local1].updateDynObj();
if (!projObjects[_local1].fromGoodGuy){
if (((!(hero.dead)) && (hero.hitTestProj(projObjects[_local1])))){
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
} else {
hero.transmitDamage(projObjects[_local1]);
Game(parent).gameGUI.painFrame.startFadeOut();
};
};
} else {
_local2 = 0;
while (_local2 < enemies.length) {
if (((!(enemies[_local2].dead)) && (enemies[_local2].hitTestProj(projObjects[_local1])))){
mainGlobal.shootingInEnemies++;
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
} else {
enemies[_local2].transmitDamage(projObjects[_local1]);
};
};
_local2++;
};
};
if (ageMath.Distance(projObjects[_local1].x, projObjects[_local1].y, hero.x, hero.y) > 670){
projObjects[_local1].visible = false;
};
if (testIntersectLimiterOnScr(projObjects[_local1])){
projObjects[_local1].visible = false;
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
};
};
};
_local1++;
};
}
public function UpdateLimitersOnScr():void{
var _local1:int;
var _local2:int;
var _local3:*;
var _local4:int;
var _local5:Point;
var _local6:Rectangle;
var _local7:Rectangle;
limitersOnScr = [];
_local1 = int(((-(x) - minLimX) / limitersCacheStep));
_local2 = int((((-(x) + stage.stageWidth) - minLimX) / limitersCacheStep));
_local4 = _local1;
while (_local4 <= _local2) {
if (limitersCache[_local4]){
_local3 = 0;
while (_local3 < limitersCache[_local4].length) {
_local5 = this.localToGlobal(new Point(limitersCache[_local4][_local3].x, limitersCache[_local4][_local3].y));
_local6 = new Rectangle(_local5.x, _local5.y, limitersCache[_local4][_local3].width, limitersCache[_local4][_local3].height);
_local7 = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
if (_local7.intersects(_local6)){
limitersOnScr.push(limitersCache[_local4][_local3]);
};
_local3++;
};
};
_local4++;
};
}
public function cleenUP_FX():void{
var _local1:int;
_local1 = 0;
while (_local1 < fxObjects.length) {
if (((fxObjects[_local1]) && ((fxObjects[_local1].visible == false)))){
if (fxObjects[_local1]){
if (fxObjects[_local1].parent){
fxObjects[_local1].parent.removeChild(fxObjects[_local1]);
};
};
fxObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function term(){
var _local1:int;
removeEventListener(Event.ENTER_FRAME, Update);
_local1 = 0;
while (_local1 < enemies.length) {
enemies[_local1].clearActorObject();
_local1++;
};
_local1 = 0;
while (_local1 < dynObjects.length) {
dynObjects[_local1].clearDynObject();
_local1++;
};
dynObjects = [];
enemies = [];
goodNPC = [];
projObjects = [];
paralaxObjects = [];
chunkObjects = [];
fxObjects = [];
propObjects = [];
addActorsArr = [];
limitersCache = [];
limitersOnScr = [];
limiters = [];
}
public function addFX_Splatters(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxBloodSpatters();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function addProp_Coin(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propCoin();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
public function addBlinkFX_OverLight2():void{
Game(parent).gameGUI.fxblink2.fadeMaxLimit = 1;
Game(parent).gameGUI.fxblink2.fadeSpeed = 0.03;
Game(parent).gameGUI.fxblink2.use_force_restart = true;
Game(parent).gameGUI.fxblink2.startFadeOut();
}
function frame1(){
initFirst = true;
}
public function testRayToLimiterOnScr(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean=false, _arg6:Object=null):ageVector{
var _local10:int;
var _local11:ageVector;
var _local12:Number;
var _local13:ageVector;
var _local14:Number;
var _local7:ageVector;
var _local8:ageVector = new ageVector(_arg1, _arg3);
var _local9:Number = Number.MAX_VALUE;
_local10 = 0;
while (_local10 < limitersOnScr.length) {
if (!limitersOnScr[_local10].slimMode){
_local11 = ageMath.getLineCrossRect(_arg1, _arg2, _arg3, _arg4, limitersOnScr[_local10].x, limitersOnScr[_local10].y, (limitersOnScr[_local10].x + limitersOnScr[_local10].width), (limitersOnScr[_local10].y + limitersOnScr[_local10].height));
if (_local11 != null){
if (_local7 == null){
_local7 = new ageVector();
_local7.copy(_local11);
_local9 = ageMath.DistanceVec(_local8, _local7);
} else {
_local12 = ageMath.DistanceVec(_local8, _local11);
if (_local12 < _local9){
_local9 = _local12;
_local7.copy(_local11);
};
};
};
};
_local10++;
};
if (!_arg5){
return (_local7);
};
_arg6.id = -1;
_local10 = 0;
while (_local10 < enemies.length) {
if (enemies[_local10].dead){
} else {
_local13 = enemies[_local10].hitTestLine(_arg1, _arg2, _arg3, _arg4);
if (_local13 != null){
if (_local7 == null){
_local7 = new ageVector();
_local7.copy(_local13);
_arg6.id = _local10;
_local9 = ageMath.DistanceVec(_local8, _local7);
} else {
_local14 = ageMath.DistanceVec(_local8, _local13);
if (_local14 < _local9){
_local9 = _local14;
_arg6.id = _local10;
_local7.copy(_local13);
};
};
};
};
_local10++;
};
return (_local7);
}
public function addProp_Dynamite(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propDynamite();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function levScript(){
var _local1:int;
var _local2:Point;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
if (((((((gas1.visible) && (gas1.hitTestObject(hero)))) || (((gas2.visible) && (gas2.hitTestObject(hero)))))) || (((gas3.visible) && (gas3.hitTestObject(hero)))))){
hero.addBioDamage(0.6);
if (!sVar["triggerTedBioEnd"]){
sVar["triggerTedBioEnd"] = true;
_local1 = Game(parent).gameGUI.dlg.setTo("lev5_TedBio");
sVar["DlgTedBioTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
};
};
if (sVar["triggerTedBioEnd"]){
if (!sVar["DlgTedBioEnd"]){
if (sVar["DlgTedBioTimer"] == 0){
sVar["DlgTedBioEnd"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
} else {
var _local8 = sVar;
var _local9 = "DlgTedBioTimer";
var _local10 = (_local8[_local9] - 1);
_local8[_local9] = _local10;
if (Controls.keyNew[69]){
sVar["DlgTedBioTimer"] = 0;
};
};
};
};
if (!sVar["triggerUpgrade1"]){
if (triggerUpgrade1.hitTestObject(hero)){
if (((Controls.keyNew[Keyboard.ENTER]) || (Controls.keyNew[69]))){
openUpgradeMenu();
};
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(5);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
} else {
if (!triggerLeverHangar.hitTestObject(hero)){
if (!triggerLeverSecretRoom.hitTestObject(hero)){
if (!triggerValveGas.hitTestObject(hero)){
if (!triggerUpgrade2.hitTestObject(hero)){
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 5)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
};
};
};
};
if (!sVar["triggerUpgrade2"]){
if (triggerUpgrade2.hitTestObject(hero)){
if (((Controls.keyNew[Keyboard.ENTER]) || (Controls.keyNew[69]))){
openUpgradeMenu();
};
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(5);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
} else {
if (!triggerLeverHangar.hitTestObject(hero)){
if (!triggerLeverSecretRoom.hitTestObject(hero)){
if (!triggerValveGas.hitTestObject(hero)){
if (!triggerUpgrade1.hitTestObject(hero)){
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 5)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
};
};
};
};
if (!sVar["triggerSecret1"]){
if (triggerSecret1.hitTestObject(hero)){
sVar["triggerSecret1"] = true;
Game(parent).gameGUI.hlpControl.showHelp(7);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
mainGlobal.secretsFound++;
};
};
if (!sVar["triggerSecret2"]){
if (triggerSecret2.hitTestObject(hero)){
sVar["triggerSecret2"] = true;
Game(parent).gameGUI.hlpControl.showHelp(7);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
mainGlobal.secretsFound++;
};
};
if (!sVar["triggerLeverHangar"]){
if (triggerLeverHangar.hitTestObject(hero)){
if (hero.isItemExist("lever")){
sVar["triggerLeverHangar"] = true;
hero.removeItemFromBag("lever");
leverHangar.play();
leverHangarHatch.play();
sounds.PlaySnd("sewerDoorOpen");
} else {
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(9);
Game(parent).gameGUI.hlpControl.pic2.gotoAndStop("lever");
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
};
} else {
if (!triggerLeverSecretRoom.hitTestObject(hero)){
if (!triggerValveGas.hitTestObject(hero)){
if (!triggerUpgrade1.hitTestObject(hero)){
if (!triggerUpgrade2.hitTestObject(hero)){
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 9)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
};
};
};
} else {
_local2 = this.globalToLocal(MovieClip(leverHangarHatch).localToGlobal(new Point(leverHangarHatch.anmPoint.x, leverHangarHatch.anmPoint.y)));
leverHangarHatchLim.y = _local2.y;
};
if (!sVar["triggerLeverSecretRoom"]){
if (triggerLeverSecretRoom.hitTestObject(hero)){
if (hero.isItemExist("lever")){
sVar["triggerLeverSecretRoom"] = true;
hero.removeItemFromBag("lever");
leverSecretRoom.play();
leverSecretRoomHatch.play();
sounds.PlaySnd("sewerDoorOpen");
} else {
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(9);
Game(parent).gameGUI.hlpControl.pic2.gotoAndStop("lever");
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
};
} else {
if (!triggerLeverHangar.hitTestObject(hero)){
if (!triggerValveGas.hitTestObject(hero)){
if (!triggerUpgrade1.hitTestObject(hero)){
if (!triggerUpgrade2.hitTestObject(hero)){
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 9)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
};
};
};
} else {
_local2 = this.globalToLocal(MovieClip(leverSecretRoomHatch).localToGlobal(new Point(leverSecretRoomHatch.anmPoint.x, leverSecretRoomHatch.anmPoint.y)));
leverSecretRoomHatchLim.y = _local2.y;
};
if (!sVar["triggerValveGas"]){
if (triggerValveGas.hitTestObject(hero)){
if (hero.isItemExist("valve")){
sVar["triggerValveGas"] = true;
hero.removeItemFromBag("valve");
valveGas.play();
gas1.visible = false;
gas2.visible = false;
gas3.visible = false;
_local1 = Game(parent).gameGUI.dlg.setTo("lev5_TedValve");
sVar["DlgTedValveTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
} else {
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(9);
Game(parent).gameGUI.hlpControl.pic2.gotoAndStop("valve");
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
};
} else {
if (!triggerLeverHangar.hitTestObject(hero)){
if (!triggerLeverSecretRoom.hitTestObject(hero)){
if (!triggerUpgrade1.hitTestObject(hero)){
if (!triggerUpgrade2.hitTestObject(hero)){
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 9)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
};
};
};
} else {
if (!sVar["DlgTedValveEnd"]){
if (sVar["DlgTedValveTimer"] == 0){
sVar["DlgTedValveEnd"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
} else {
_local8 = sVar;
_local9 = "DlgTedValveTimer";
_local10 = (_local8[_local9] - 1);
_local8[_local9] = _local10;
if (Controls.keyNew[69]){
sVar["DlgTedValveTimer"] = 0;
};
};
};
};
if (!sVar["triggerBunkerManCall"]){
if (triggerBunkerManCall.hitTestObject(hero)){
sVar["triggerBunkerManCall"] = true;
sounds.PlaySnd("helpIco");
};
} else {
if (!sVar["triggerBunkerMan"]){
Game(parent).gameGUI.dlgIco.targetingObject(bunkerMan);
} else {
Game(parent).gameGUI.dlgIco.x = -500;
};
};
if (!sVar["triggerBunkerMan"]){
if (((triggerBunkerMan.hitTestObject(hero)) && (!(hero.isItemExist("cloth"))))){
sVar["triggerBunkerMan"] = true;
};
} else {
if (!sVar["DlgBunkerManEnd"]){
if (sVar["DlgBunkerManTimer"] == 0){
if (sVar["DlgBunkerManState"] == 0){
_local1 = Game(parent).gameGUI.dlg.setTo("lev5_BunkerManTed01");
_local8 = sVar;
_local9 = "DlgBunkerManState";
_local10 = (_local8[_local9] + 1);
_local8[_local9] = _local10;
sVar["DlgBunkerManTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
} else {
if (sVar["DlgBunkerManState"] == 1){
_local1 = Game(parent).gameGUI.dlg.setTo("lev5_BunkerManTed02");
_local8 = sVar;
_local9 = "DlgBunkerManState";
_local10 = (_local8[_local9] + 1);
_local8[_local9] = _local10;
sVar["DlgBunkerManTimer"] = int((_local1 * dlgSpeedFactor));
} else {
if (sVar["DlgBunkerManState"] == 2){
_local1 = Game(parent).gameGUI.dlg.setTo("lev5_BunkerManTed03");
_local8 = sVar;
_local9 = "DlgBunkerManState";
_local10 = (_local8[_local9] + 1);
_local8[_local9] = _local10;
sVar["DlgBunkerManTimer"] = int((_local1 * dlgSpeedFactor));
} else {
sVar["DlgBunkerManEnd"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
};
};
};
} else {
_local8 = sVar;
_local9 = "DlgBunkerManTimer";
_local10 = (_local8[_local9] - 1);
_local8[_local9] = _local10;
if (Controls.keyNew[69]){
sVar["DlgBunkerManTimer"] = 0;
};
};
};
};
if (!sVar["triggerBunkerMan2"]){
if (((triggerBunkerMan.hitTestObject(hero)) && (hero.isItemExist("cloth")))){
sVar["triggerBunkerMan2"] = true;
hero.removeItemFromBag("cloth");
bunkerMan.gotoAndStop(2);
sVar["triggerBunkerMan"] = true;
sVar["DlgBunkerManEnd"] = true;
};
} else {
if (!sVar["DlgBunkerManEnd2"]){
if (sVar["DlgBunkerManTimer2"] == 0){
if (sVar["DlgBunkerManState2"] == 0){
_local1 = Game(parent).gameGUI.dlg.setTo("lev5_BunkerManTed04");
_local8 = sVar;
_local9 = "DlgBunkerManState2";
_local10 = (_local8[_local9] + 1);
_local8[_local9] = _local10;
sVar["DlgBunkerManTimer2"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
} else {
if (sVar["DlgBunkerManState2"] == 1){
_local1 = Game(parent).gameGUI.dlg.setTo("lev5_BunkerManTed05");
_local8 = sVar;
_local9 = "DlgBunkerManState2";
_local10 = (_local8[_local9] + 1);
_local8[_local9] = _local10;
sVar["DlgBunkerManTimer2"] = int((_local1 * dlgSpeedFactor));
} else {
if (sVar["DlgBunkerManState2"] == 2){
_local1 = Game(parent).gameGUI.dlg.setTo("lev5_BunkerManTed06");
_local8 = sVar;
_local9 = "DlgBunkerManState2";
_local10 = (_local8[_local9] + 1);
_local8[_local9] = _local10;
sVar["DlgBunkerManTimer2"] = int((_local1 * dlgSpeedFactor));
} else {
if (sVar["DlgBunkerManState2"] == 3){
_local1 = Game(parent).gameGUI.dlg.setTo("lev5_BunkerManTed07");
_local8 = sVar;
_local9 = "DlgBunkerManState2";
_local10 = (_local8[_local9] + 1);
_local8[_local9] = _local10;
sVar["DlgBunkerManTimer2"] = int((_local1 * dlgSpeedFactor));
codeLockBoss.gotoAndStop(2);
codeLockBossHatch.play();
sounds.PlaySnd("sewerDoorOpen");
} else {
sVar["DlgBunkerManEnd2"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
};
};
};
};
} else {
_local8 = sVar;
_local9 = "DlgBunkerManTimer2";
_local10 = (_local8[_local9] - 1);
_local8[_local9] = _local10;
if (Controls.keyNew[69]){
sVar["DlgBunkerManTimer2"] = 0;
};
};
};
};
if (sVar["DlgBunkerManState2"] >= 3){
_local2 = this.globalToLocal(MovieClip(codeLockBossHatch).localToGlobal(new Point(codeLockBossHatch.anmPoint.x, codeLockBossHatch.anmPoint.y)));
codeLockBossHatchLim.y = _local2.y;
};
if (((!(sVar["DlgTedMinigun"])) && (hero.weapons[3].active))){
sVar["DlgTedMinigun"] = true;
levRightLim = triggerLevelRightBorder.x;
_local3 = 80;
_local4 = int((_local3 * 0.3));
_local5 = int((_local3 * 0.3));
_local6 = int((_local3 * 0.4));
_local7 = 0;
_local7 = 0;
while (_local7 < _local4) {
addActor((("Zomb0" + ageMath.RandomInt(1, 5)) + "Run"), "", ageMath.Random(markerZombGen1.x, markerZombGen2.x), markerZombGen1.y, getChildIndex(markerZombGen1));
_local7++;
};
_local7 = 0;
while (_local7 < _local5) {
addActor((("Zomb0" + ageMath.RandomInt(1, 5)) + "Vomit"), "", ageMath.Random(markerZombGen1.x, markerZombGen2.x), markerZombGen1.y, getChildIndex(markerZombGen1));
_local7++;
};
_local7 = 0;
while (_local7 < _local6) {
addActor(("Zomb0" + ageMath.RandomInt(1, 5)), "", ageMath.Random(markerZombGen1.x, markerZombGen2.x), markerZombGen1.y, getChildIndex(markerZombGen1));
_local7++;
};
};
if (!sVar["triggerSoundBoss"]){
if (triggerSoundBoss.hitTestObject(hero)){
sVar["triggerSoundBoss"] = true;
_local1 = Game(parent).gameGUI.dlg.setTo("lev5_TedRock");
sVar["DlgSoundBossTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
musicEnv.fadeTo("roboAttack");
};
} else {
if (!sVar["DlgSoundBossEnd"]){
if (sVar["DlgSoundBossTimer"] == 0){
sVar["DlgSoundBossEnd"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
} else {
_local8 = sVar;
_local9 = "DlgSoundBossTimer";
_local10 = (_local8[_local9] - 1);
_local8[_local9] = _local10;
if (Controls.keyNew[69]){
sVar["DlgSoundBossTimer"] = 0;
};
};
};
};
if (!isWin){
if (triggerEndLevel.hitTestObject(hero)){
isWin = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuWinLose.startFadeIn();
Game(root).menuWinLose.setToWin();
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
musicEnv.fadeTo("musWin");
return;
};
};
}
public function addProp_MedKit(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new dropMedKit();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_Money1(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMoney1();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
public function addFX_Headshot(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxHeadshot();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
function showGameMenu():void{
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
Game(root).menuInGame.visible = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuInGame.startFadeIn();
}
public function UpdatePropObjects():void{
var _local1:int;
_local1 = 0;
while (_local1 < propObjects.length) {
if (propObjects[_local1].visible == false){
} else {
if (ageMath.Distance(propObjects[_local1].x, propObjects[_local1].y, hero.x, hero.y) >= (stage.stageWidth * 1.6)){
} else {
propObjects[_local1].x = (propObjects[_local1].x + propObjects[_local1].speed.x);
if (propObjects[_local1].useRotateSpeed){
propObjects[_local1].body.rotation = (propObjects[_local1].body.rotation + propObjects[_local1].rotateSpeed);
};
if ((((((((((((propObjects[_local1].propType == "Med")) || ((propObjects[_local1].propType == "Coin")))) || ((propObjects[_local1].propType == "Money")))) || ((propObjects[_local1].propType == "Weapon")))) || ((propObjects[_local1].propType == "Item")))) || ((propObjects[_local1].propType == "Ammo")))){
if (hero.hitTestObject(propObjects[_local1])){
if (propObjects[_local1].propType == "Ammo"){
if (hero.weapons[propObjects[_local1].wepNum].active){
if (hero.weapons[propObjects[_local1].wepNum].bulletsNum < hero.weapons[propObjects[_local1].wepNum].bulletsNumMax){
propObjects[_local1].visible = false;
hero.weapons[propObjects[_local1].wepNum].bulletsNum = (hero.weapons[propObjects[_local1].wepNum].bulletsNum + (hero.weapons[propObjects[_local1].wepNum].bulletsInCatrigeMax * propObjects[_local1].moneyAmount));
if (hero.weapons[propObjects[_local1].wepNum].bulletsNum > hero.weapons[propObjects[_local1].wepNum].bulletsNumMax){
hero.weapons[propObjects[_local1].wepNum].bulletsNum = hero.weapons[propObjects[_local1].wepNum].bulletsNumMax;
};
sounds.PlaySnd((hero.weapons[propObjects[_local1].wepNum].type + "Reloaded"));
};
};
} else {
if (propObjects[_local1].propType == "Med"){
if (hero.life < hero.lifeMax){
propObjects[_local1].visible = false;
hero.life = (hero.life + propObjects[_local1].moneyAmount);
if (hero.life > hero.lifeMax){
hero.life = hero.lifeMax;
};
sounds.PlaySnd("Med");
};
} else {
if (propObjects[_local1].propType == "Item"){
propObjects[_local1].visible = false;
hero.itemsInBag.push(propObjects[_local1].itemName);
sounds.PlaySnd("itemTake");
} else {
if (propObjects[_local1].propType == "Weapon"){
propObjects[_local1].visible = false;
hero.weapons[propObjects[_local1].wepNum].active = true;
hero.curWeaponNum = (propObjects[_local1].wepNum + 1);
sounds.PlaySnd((hero.weapons[(hero.curWeaponNum - 1)].type + "Reloaded"));
} else {
propObjects[_local1].visible = false;
sounds.PlaySnd((propObjects[_local1].propType + "1"));
hero.moneyCnt = (hero.moneyCnt + propObjects[_local1].moneyAmount);
mainGlobal.moneyCollected = (mainGlobal.moneyCollected + propObjects[_local1].moneyAmount);
};
};
};
};
};
};
};
};
_local1++;
};
}
public function addProp_Money2(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMoney2();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
public function addProj_MinigunBeam(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
var _local10:ageVector = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local10.normThis();
_local10.mulScalar(600);
_arg3 = (_local10.x + _arg1);
_arg4 = (_local10.y + _arg2);
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projMinigunBeam();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.gravityEnable = false;
var _local11:Object = {id:-1};
var _local12:ageVector = testRayToLimiterOnScr(_arg1, _arg2, _arg3, _arg4, true, _local11);
if (_local12 != null){
_arg3 = _local12.x;
_arg4 = _local12.y;
if (_local11.id != -1){
mainGlobal.shootingInEnemies++;
addLineDamageToEnemy(_local12, _arg5.damage, enemies[_local11.id], true);
};
};
_local6.scaleX = (ageMath.Distance(_arg1, _arg2, _arg3, _arg4) / 34);
_local6.rotation = _local8;
var _local13:Array = new Array();
_local13.push(new GlowFilter(0xFFFF00, 1, 15, 15, 4, BitmapFilterQuality.MEDIUM));
_local6.filters = _local13;
if (_arg5 != null){
};
this["FXLayer"].addChild(_local6);
fxObjects.push(_local6);
return (_local6);
}
public function addProj_LaserBeam(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
var _local10:ageVector = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local10.normThis();
_local10.mulScalar(600);
_arg3 = (_local10.x + _arg1);
_arg4 = (_local10.y + _arg2);
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projLaserBeam();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.gravityEnable = false;
var _local11:ageVector = testRayToLimiterOnScr(_arg1, _arg2, _arg3, _arg4);
if (_local11 != null){
_arg3 = _local11.x;
_arg4 = _local11.y;
};
if (addLineDamage(_arg1, _arg2, _arg3, _arg4, _arg5.damage)){
mainGlobal.shootingInEnemies++;
};
_local6.scaleX = (ageMath.Distance(_arg1, _arg2, _arg3, _arg4) / 34);
_local6.rotation = _local8;
_local6.use_force_restart = true;
_local6.fadeSpeed = 0.1;
_local6.startFadeOut();
_local6.gravityEnable = false;
var _local12:Array = new Array();
_local12.push(new GlowFilter(0xFF0000, 1, 15, 15, 1.7, BitmapFilterQuality.MEDIUM));
_local6.filters = _local12;
if (_arg5 != null){
};
this["FXLayer"].addChild(_local6);
fxObjects.push(_local6);
return (_local6);
}
public function addProj(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projBullet();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, 24);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = true;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addFX_littleBlast(_arg1:Number, _arg2:Number, _arg3:Number=1.5){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
addBlinkFX_OverLight();
_local4 = new fxBlast();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.blendMode = BlendMode.SCREEN;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function addProj_BombWep(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projBombWep();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
_local6.blastStyle = _arg5.blastStyle;
_local6.attackRadius = _arg5.damageRadius;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProj_Psy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new psyProj();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
_local6.gravityComp = false;
_local6.infAmmo = true;
_local6.usePsyDamage = true;
_local6.psyDamageVal = 16;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProj_Rocket(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projRocket();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = true;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
_local6.blastStyle = _arg5.blastStyle;
_local6.attackRadius = _arg5.damageRadius;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProp_Debris(_arg1:Number, _arg2:Number, _arg3:Number=1, _arg4:String=""):propObject{
var _local5:propObject;
_local5 = new propDebris();
_local5.x = _arg1;
_local5.y = _arg2;
_local5.speed.y = (ageMath.Random(-6, -18) * _arg3);
_local5.speed.x = (ageMath.Random(-10, 10) * _arg3);
if (_arg4.length){
_local5.gotoAndStop(_arg4);
} else {
_local5.gotoAndStop(ageMath.RandomInt(1, 20));
};
_local5.curLevel = this;
dynObjects.push(_local5);
propObjects.push(_local5);
_local5.isRubber = true;
_local5.stayTime = (3000 + ageMath.RandomInt(1, 2000));
_local5.timerStayDelay.start();
_local5.useRotateSpeed = true;
_local5.rotateSpeed = ageMath.RandomInt(-15, 15);
propLayer.addChild(_local5);
return (_local5);
}
public function addLimiter(_arg1){
limiters.push(_arg1);
}
public function alignObjXToAnother(_arg1, _arg2):void{
if ((_arg1.x - (_arg1.width * 0.5)) < _arg2.x){
_arg1.x = (_arg1.x + (_arg2.x - (_arg1.x - (_arg1.width * 0.5))));
};
if ((_arg1.x + (_arg1.width * 0.5)) > (_arg2.x + _arg2.width)){
_arg1.x = (_arg1.x - ((_arg1.x + (_arg1.width * 0.5)) - (_arg2.x + _arg2.width)));
};
}
public function ifMCOnScreen(_arg1:MovieClip):Boolean{
var _local2:Point = this.localToGlobal(new Point(_arg1.x, _arg1.y));
var _local3:Rectangle = _arg1.getBounds(root);
var _local4:Rectangle = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
if (_local4.intersects(_local3)){
return (true);
};
return (false);
}
public function addExplotion(_arg1:projObject, _arg2:actorObject=null):void{
var _local3:Number;
var _local5:int;
_local3 = ageMath.Distance(_arg1.x, _arg1.y, hero.x, hero.y);
var _local4:projObject = new projObject();
if (_local3 < _arg1.attackRadius){
_local4.damage = ageMath.RemapVal(_local3, 0, _arg1.attackRadius, _arg1.damage, 0);
_local4.x = hero.x;
_local4.y = (hero.y - (hero.height / 2));
_local4.fromGoodGuy = false;
hero.transmitDamage(_local4);
Game(parent).gameGUI.painFrame.startFadeOut();
_local4.clearDynObject();
};
_local5 = 0;
while (_local5 < enemies.length) {
if (((((enemies[_local5].dead) && (!((_arg2 == null))))) && (!((_arg2 == enemies[_local5]))))){
} else {
_local3 = ageMath.Distance(_arg1.x, _arg1.y, enemies[_local5].x, enemies[_local5].y);
if (_local3 < _arg1.attackRadius){
_local4.damage = ageMath.RemapVal(_local3, 0, _arg1.attackRadius, _arg1.damage, 0);
_local4.x = enemies[_local5].x;
_local4.y = (enemies[_local5].y - (enemies[_local5].height / 2));
_local4.fromGoodGuy = true;
enemies[_local5].transmitDamage(_local4);
_local4.clearDynObject();
};
};
_local5++;
};
}
public function Update(_arg1:Event):void{
var _local5:int;
var _local6:*;
var _local7:*;
var _local11:int;
var _local12:addActorStruct;
var _local13:int;
var _local14:Number;
var _local15:Array;
var _local16:ColorMatrix;
if (isWin){
hero.body.stop();
return;
};
if (((((mainGlobal.paused) || (!(visible)))) || (!((parent as Game))))){
return;
};
if ((((hero.life <= 0)) && (!(isLose)))){
isLose = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuWinLose.startFadeIn();
Game(root).menuWinLose.setToLose();
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
musicEnv.fadeTo("musLose");
sounds.PlaySnd(("TedDie" + ageMath.RandomInt(1, 2).toString()), 0.8);
return;
};
if (initFirst){
if (((!(mainGlobal.configMusicOn)) && (!(mainGlobal.configSoundOn)))){
Game(parent).gamButSnd.gotoAndStop(2);
} else {
Game(parent).gamButSnd.gotoAndStop(1);
};
initFirst = false;
initLimCache();
Game(parent).fadeBG.fadeSpeed = 0.03;
Game(parent).fadeBG.use_force_restart = true;
Game(parent).fadeBG.startFadeOut();
Game(parent).gameGUI.hlpControl.visible = false;
Game(parent).gameGUI.dlg.visible = false;
Game(parent).gameGUI.dlgIco.x = -500;
_local6 = (hero.x * this.scaleX);
_local7 = ((hero.y - 95) * this.scaleY);
x = -((_local6 - (stage.stageWidth * 0.5)));
y = -((_local7 - (stage.stageHeight * 0.5)));
mainGlobal.initStat();
_local11 = 0;
_local11 = 0;
while (_local11 < enemies.length) {
if (!enemies[_local11].noStatEnemy){
mainGlobal.enemiesAll++;
};
_local11++;
};
Game(parent).sky.visible = true;
levInit();
if (mainGlobal.isSingleEp){
if (curLevNum == 1){
_local5 = 0;
while (_local5 < 1) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 0;
} else {
if (curLevNum == 2){
_local5 = 0;
while (_local5 < 2) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 200;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
} else {
if (curLevNum == 3){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
} else {
if (curLevNum == 4){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1300;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
} else {
if (curLevNum == 5){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1500;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
} else {
if (curLevNum == 6){
_local5 = 0;
while (_local5 < 4) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 2000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
} else {
if (curLevNum == 7){
_local5 = 0;
while (_local5 < 5) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 3000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
} else {
if (curLevNum == 8){
_local5 = 0;
while (_local5 < 5) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 3500;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
} else {
if (curLevNum == 9){
_local5 = 0;
while (_local5 < 6) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = 5;
hero.moneyCnt = 4000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
hero.applyUpgrade(1, 4);
hero.upgradesLife[4].active = true;
} else {
if (curLevNum == 10){
_local5 = 0;
while (_local5 < 6) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = 5;
hero.moneyCnt = 4000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
hero.applyUpgrade(1, 4);
hero.upgradesLife[4].active = true;
};
};
};
};
};
};
};
};
};
};
};
Game(parent).gameGUI.dlgIco.gotoAndStop(1);
};
var _local2:int = getTimer();
cleenUP();
UpdateLimitersOnScr();
UpdateParalaxObjects();
UpdateDynObjects();
UpdatePropObjects();
UpdateEnemies();
UpdateProjObjects();
hero.updateActor();
hero.applyDamages();
hero.testIsActorDead();
if (addActorsArr.length){
while (addActorsArr.length) {
_local12 = addActorsArr.pop();
addActor(_local12.strClass, "", _local12.posx, _local12.posy, _local12.orderZ);
};
};
var _local3:int;
_local3 = 0;
while (_local3 < chunkObjects.length) {
if (ifMCOnScreen(chunkObjects[_local3])){
chunkObjects[_local3].visible = true;
} else {
chunkObjects[_local3].visible = false;
};
_local3++;
};
levScript();
var _local4:Boolean;
if (Controls.key[Keyboard.F2]){
hero.life = 1;
};
if (Controls.key[Keyboard.ESCAPE]){
showGameMenu();
};
if (!hero.timerReloadDelay.running){
_local13 = 0;
while (_local13 < 8) {
if (((((Controls.key[(49 + _local13)]) && (!((hero.curWeaponNum == (_local13 + 1)))))) && (hero.weapons[_local13].active))){
hero.curWeaponNum = (_local13 + 1);
sounds.PlaySnd((hero.weapons[(hero.curWeaponNum - 1)].type + "Reloaded"));
};
_local13++;
};
};
if (Game(root).cursor.currentLabel == "cross"){
_local14 = ageMath.Distance(hero.x, hero.y, (Controls.mousePosX - x), (Controls.mousePosY - y));
Game(root).cursor.shootAcc.scaleX = (Game(root).cursor.shootAcc.scaleY = ((hero.wepAcc * _local14) / hero.weapons[(hero.curWeaponNum - 1)].accDistScale));
};
_local5 = 0;
_local5 = 0;
while (_local5 < 8) {
if (((hero.weapons[_local5]) && (hero.weapons[_local5].active))){
if ((((hero.weapons[_local5].bulletsInCatrige == 0)) && ((hero.weapons[_local5].bulletsNum == 0)))){
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 2){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 2;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(-124);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
} else {
if (hero.curWeaponNum != (_local5 + 1)){
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 1){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 1;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(0);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
} else {
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 3){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 3;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(87);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
};
};
} else {
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 4){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 4;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 0.5;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(0);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
};
_local5++;
};
Game(parent).gameGUI.wepInfo.catTxt.text = ((hero.weapons[(hero.curWeaponNum - 1)].bulletsInCatrige + "/") + hero.weapons[(hero.curWeaponNum - 1)].bulletsInCatrigeMax);
if (!hero.weapons[(hero.curWeaponNum - 1)].infAmmo){
Game(parent).gameGUI.wepInfo.allTxt.text = hero.weapons[(hero.curWeaponNum - 1)].bulletsNum;
} else {
Game(parent).gameGUI.wepInfo.allTxt.text = "INF";
};
Game(parent).gameGUI.wepInfo.pic.gotoAndStop((hero.curWeaponNum + 4));
if ((hero.x - (hero.width * 0.5)) < levLeftLim){
hero.x = (levLeftLim + (hero.width * 0.5));
} else {
if ((hero.x + (hero.width * 0.5)) > levRightLim){
hero.x = (levRightLim - (hero.width * 0.5));
};
};
_local6 = ageMath.Lerp((Controls.mousePosX - x), (hero.x * scaleX), 0.6);
_local7 = ageMath.Lerp((Controls.mousePosY - y), ((hero.y - 95) * scaleY), 0.6);
if (!_local4){
x = Math.round(ageMath.Lerp(x, -((_local6 - (stage.stageWidth * 0.5))), 0.15));
y = Math.round(ageMath.Lerp(y, -((_local7 - (stage.stageHeight * 0.5))), 0.15));
} else {
x = -((_local6 - (stage.stageWidth * 0.5)));
y = -((_local7 - (stage.stageHeight * 0.5)));
};
if (this["blackScr"]){
this["blackScr"].x = -(x);
this["blackScr"].y = -(y);
};
var _local8:Point = this.localToGlobal(new Point(levLeftLim, 0));
var _local9:Point = this.localToGlobal(new Point(levRightLim, 0));
if (_local8.x > 0){
x = (x - _local8.x);
} else {
if (_local9.x < stage.stageWidth){
x = (x + (stage.stageWidth - _local9.x));
};
};
if (curBlastShake > 0){
x = (x + ageMath.Random(-(curBlastShake), curBlastShake));
y = (y + ageMath.Random(-(curBlastShake), curBlastShake));
curBlastShake = (curBlastShake - curBlastShakeDec);
if (curBlastShake < 0){
curBlastShake = 0;
};
};
Game(parent).gameGUI.lifeBar.gotoAndStop(Math.round(ageMath.RemapVal(Math.round(hero.life), 1, hero.lifeMax, 1, 100)));
Game(parent).gameGUI.lifeBar.width = ageMath.RemapVal(Math.round(hero.lifeMax), 100, 300, 108, 227);
Game(parent).gameGUI.txtMoney.text = ("$" + hero.moneyCnt);
var _local10:int;
_local10 = 0;
while (_local10 < 6) {
if (hero.itemsInBag[_local10]){
Game(parent).gameGUI[("itm" + _local10)].gotoAndStop(hero.itemsInBag[_local10]);
} else {
Game(parent).gameGUI[("itm" + _local10)].gotoAndStop(1);
};
_local10++;
};
if (hero.bioMaxLevel > 0){
Game(parent).gameGUI.hazBio.visible = true;
Game(parent).gameGUI.hazBio.gotoAndStop((100 - int(ageMath.RemapVal(hero.bioCurLevel, 0, hero.bioMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazBio.visible = false;
};
if (hero.psyMaxLevel > 0){
Game(parent).gameGUI.hazPsy.visible = true;
Game(parent).gameGUI.hazPsy.gotoAndStop((100 - int(ageMath.RemapVal(hero.psyCurLevel, 0, hero.psyMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazPsy.visible = false;
};
if (hero.electroMaxLevel > 0){
Game(parent).gameGUI.hazElectro.visible = true;
Game(parent).gameGUI.hazElectro.gotoAndStop((100 - int(ageMath.RemapVal(hero.electroCurLevel, 0, hero.electroMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazElectro.visible = false;
};
Controls.updateKeyNew();
if (Game(parent).groundBG){
Game(parent).groundBG.changeBG(x, y);
};
}
public function addActor(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:int=-1):actorObject{
var _local6:actorObject;
if (_arg1 == "AlienSaw"){
_local6 = new AlienSaw();
} else {
if (_arg1 == "AlienHunter"){
_local6 = new AlienHunter();
} else {
if (_arg1 == "AlienElectro"){
_local6 = new AlienElectro();
} else {
if (_arg1 == "Zomb01"){
_local6 = new Zomb01();
} else {
if (_arg1 == "Zomb02"){
_local6 = new Zomb02();
} else {
if (_arg1 == "Zomb03"){
_local6 = new Zomb03();
} else {
if (_arg1 == "Zomb04"){
_local6 = new Zomb04();
} else {
if (_arg1 == "Zomb05"){
_local6 = new Zomb05();
} else {
if (_arg1 == "Zomb01Run"){
_local6 = new Zomb01Run();
} else {
if (_arg1 == "Zomb02Run"){
_local6 = new Zomb02Run();
} else {
if (_arg1 == "Zomb03Run"){
_local6 = new Zomb03Run();
} else {
if (_arg1 == "Zomb04Run"){
_local6 = new Zomb04Run();
} else {
if (_arg1 == "Zomb05Run"){
_local6 = new Zomb05Run();
} else {
if (_arg1 == "Zomb01Vomit"){
_local6 = new Zomb01Vomit();
} else {
if (_arg1 == "Zomb02Vomit"){
_local6 = new Zomb02Vomit();
} else {
if (_arg1 == "Zomb03Vomit"){
_local6 = new Zomb03Vomit();
} else {
if (_arg1 == "Zomb04Vomit"){
_local6 = new Zomb04Vomit();
} else {
if (_arg1 == "Zomb05Vomit"){
_local6 = new Zomb05Vomit();
} else {
if (_arg1 == "Spider"){
_local6 = new Spider();
} else {
if (_arg1 == "AlienBomber"){
_local6 = new AlienBomber();
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
_local6.x = _arg3;
_local6.y = _arg4;
_local6.name = _arg2;
if (!_local6.noStatEnemy){
mainGlobal.enemiesAll++;
};
if (_arg5 < 0){
addChild(_local6);
} else {
addChildAt(_local6, _arg5);
};
return (_local6);
}
public function levInit(){
mainGlobal.secretsAll = 2;
curLevNum = 5;
curLevScore = 3000;
levelMus = "musDarkAmb";
musicEnv.fadeTo(levelMus);
Game(parent).sky.visible = false;
levLeftLim = triggerLevelLeftBorder.x;
levRightLim = bunkerMinigunBorder.x;
sVar["triggerSecret1"] = false;
sVar["triggerSecret2"] = false;
sVar["triggerLeverHangar"] = false;
sVar["triggerLeverSecretRoom"] = false;
sVar["triggerTedBioEnd"] = false;
sVar["DlgTedBioTimer"] = 0;
sVar["DlgTedBioEnd"] = false;
sVar["triggerTedButtonEnd"] = false;
sVar["DlgTedButtonTimer"] = 0;
sVar["DlgTedButtonEnd"] = false;
sVar["triggerBunkerManCall"] = false;
sVar["triggerBunkerMan"] = false;
sVar["DlgBunkerManState"] = 0;
sVar["DlgBunkerManTimer"] = 0;
sVar["DlgBunkerManEnd"] = false;
sVar["triggerBunkerMan2"] = false;
sVar["DlgBunkerManState2"] = 0;
sVar["DlgBunkerManTimer2"] = 0;
sVar["DlgBunkerManEnd2"] = false;
sVar["DlgTedMinigun"] = false;
sVar["triggerSoundBoss"] = false;
sVar["DlgSoundBossTimer"] = 0;
sVar["DlgSoundBossEnd"] = false;
}
public function addFX_MetalSparks(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxMetalSparks();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.blendMode = BlendMode.ADD;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function addProp_Blaster(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propBlaster();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addProj_Vomit(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projVomit();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.timerFXAdd.delay = 80;
_local6.timerFXAdd.start();
_local6.fxFunc = addFX_VomitSplatters;
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = true;
_local6.gravityComp = true;
_local6.infAmmo = true;
_local6.useBioDamage = true;
_local6.bioDamageVal = 10;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProp_blasterAmmo(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propBlasterAmmo();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
}
}//package main
Section 83
//Level6 (main.Level6)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.ui.*;
public dynamic class Level6 extends Level {
var levRightLim:Number;// = 999999
var dlgSpeedFactor:Number;// = 4
var lastMSFrame:int;// = 9999
public var enemies:Array;
var levLeftLim:Number;// = -999999
public var propObjects:Array;
public var triggerBigAss:MovieClip;
public var minLimX:Number;// = 2147483647
public var levelRightBorder:MovieClip;
public var maxLimX:Number;// = -2147483648
var curBlastShake:Number;// = 0
var isWin:Boolean;// = false
public var dynObjects:Array;
var isLose:Boolean;// = false
var grav:Number;// = 1
public var triggerFuel1:MovieClip;
public var triggerFuel2:MovieClip;
public var triggerUpgrade1:MovieClip;
public var triggerUpgrade2:MovieClip;
public var limitersCache:Array;
var initFirst:Boolean;// = false
public var triggerBarneyCall:MovieClip;
public var triggerBarney:MovieClip;
var curLevNum:int;// = 1
public var FXLayer:MovieClip;
var levelMus:String;// = ""
public var triggerSecret1:MovieClip;
public var propLayer:MovieClip;
public var barney:MovieClip;
var sVar:Object;
public var fuelBarrel1:MovieClip;
public var fuelBarrel2:MovieClip;
public var levelLeftBorder:MovieClip;
public var limitersOnScr:Array;
public var addActorsArr:Array;
public var limiters:Array;
public var paralaxObjects:Array;
var curLevScore:int;// = 3000
var curBlastShakeDec:Number;// = 0.3
public var triggerFuelBarrel1:MovieClip;
public var triggerFuelBarrel2:MovieClip;
public var fxObjects:Array;
public var limitersCacheStep:int;// = 640
public var goodNPC:Array;
public var chunkObjects:Array;
var curScale:Number;// = 1
public var projObjects:Array;
public var hero:MovieClip;
public var projLayer:MovieClip;
public function Level6(){
sVar = new Object();
limiters = new Array();
limitersCache = new Array();
limitersOnScr = new Array();
dynObjects = new Array();
enemies = new Array();
goodNPC = new Array();
paralaxObjects = new Array();
projObjects = new Array();
chunkObjects = new Array();
fxObjects = new Array();
propObjects = new Array();
addActorsArr = new Array();
super();
addFrameScript(0, frame1);
init();
}
public function addFX_VomitSplatters(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxVomitSpatters();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function initLimCache(){
var _local1:*;
var _local2:int;
var _local3:int;
var _local4:int;
maxLimX = int.MIN_VALUE;
minLimX = int.MAX_VALUE;
_local1 = 0;
while (_local1 < limiters.length) {
if (limiters[_local1].x < minLimX){
minLimX = limiters[_local1].x;
};
if ((limiters[_local1].x + limiters[_local1].width) > maxLimX){
maxLimX = limiters[_local1].x;
};
_local1++;
};
limitersCache = [];
_local1 = 0;
while (_local1 < (((maxLimX - minLimX) / limitersCacheStep) + 1)) {
limitersCache.push(new Array());
_local1++;
};
_local1 = 0;
while (_local1 < limiters.length) {
_local3 = int(((limiters[_local1].x - minLimX) / limitersCacheStep));
_local4 = int((((limiters[_local1].x + limiters[_local1].width) - minLimX) / limitersCacheStep));
_local2 = _local3;
while (_local2 <= _local4) {
if (!limitersCache[_local2]){
limitersCache[_local2] = new Array();
};
limitersCache[_local2].push(limiters[_local1]);
_local2++;
};
_local1++;
};
}
public function addLineDamage(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Boolean{
var _local6:Number;
var _local8:int;
var _local9:ageVector;
var _local7:Boolean;
_local8 = 0;
while (_local8 < enemies.length) {
if (enemies[_local8].dead){
} else {
_local9 = enemies[_local8].hitTestLine(_arg1, _arg2, _arg3, _arg4);
if (_local9 != null){
addLineDamageToEnemy(_local9, _arg5, enemies[_local8], true);
_local7 = true;
};
};
_local8++;
};
return (_local7);
}
public function checkHitPlatform(_arg1, _arg2:Array){
var _local3:int;
_arg1.bottomLimiter = null;
_local3 = 0;
while (_local3 < _arg2.length) {
if (((_arg2[_local3].slimMode) && ((_arg1.speed.y < 0)))){
} else {
if (_arg2[_local3].hitTestObject(_arg1.p2)){
_arg1.jump = false;
if (_arg1.isRubber){
_arg1.speed.y = (_arg1.speed.y * -(_arg1.rubberFactor));
_arg1.speed.x = (_arg1.speed.x * _arg1.rubberFactor);
if (_arg1.useRotateSpeed){
_arg1.rotateSpeed = 0;
};
} else {
_arg1.speed.y = 0;
};
_arg1.y = ((_arg2[_local3].y - _arg1.p2.y) - _arg1.p2.height);
_arg1.bottomLimiter = _arg2[_local3];
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p1)) && (!(_arg2[_local3].slimMode)))){
if (_arg1.scaleX > 0){
_arg1.x = (_arg2[_local3].x - (_arg1.p1.x + _arg1.p1.width));
} else {
_arg1.x = ((_arg2[_local3].x + _arg2[_local3].width) + (_arg1.p1.x + _arg1.p1.width));
};
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p3)) && (!(_arg2[_local3].slimMode)))){
if (_arg1.scaleX > 0){
_arg1.x = ((_arg2[_local3].x + _arg2[_local3].width) - _arg1.p3.x);
} else {
_arg1.x = (_arg2[_local3].x - (-(_arg1.p3.x) + _arg1.p3.width));
};
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p4)) && (!(_arg2[_local3].slimMode)))){
_arg1.speed.y = 0;
_arg1.y = ((_arg2[_local3].y + _arg2[_local3].height) - _arg1.p4.y);
};
};
};
};
};
_local3++;
};
}
public function openUpgradeMenu():void{
mainGlobal.paused = true;
this.visible = false;
Game(root).cursor.gotoAndStop("arrow");
Game(parent).menuUpgradeShop.showShop();
musicEnv.fadeTo("musUpgrade");
}
public function addFX_littleSmoke(_arg1:Number, _arg2:Number, _arg3:Number=1.5){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
_local4 = new fxLittleSmoke();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function init(){
addEventListener(Event.ENTER_FRAME, Update, false, 0, true);
}
function mouseLeave(_arg1:Event):void{
showGameMenu();
}
public function UpdateParalaxObjects():void{
var _local1:int;
_local1 = 0;
while (_local1 < paralaxObjects.length) {
paralaxObjects[_local1].x = (paralaxObjects[_local1].saveX - ageMath.RemapVal((paralaxObjects[_local1].saveX + x), 0, stage.stageWidth, 0, paralaxObjects[_local1].paralaxX));
paralaxObjects[_local1].y = (paralaxObjects[_local1].saveY - ageMath.RemapVal((paralaxObjects[_local1].saveY + y), 0, stage.stageHeight, 0, paralaxObjects[_local1].paralaxY));
_local1++;
};
}
public function addBlinkFX_OverLight():void{
Game(parent).gameGUI.fxblink.fadeMaxLimit = 1;
Game(parent).gameGUI.fxblink.fadeSpeed = 0.03;
Game(parent).gameGUI.fxblink.use_force_restart = true;
Game(parent).gameGUI.fxblink.startFadeOut();
curBlastShake = 15;
}
public function cleenUP():void{
cleenUP_FX();
cleenUP_Proj();
cleenUP_Prop();
cleenUP_Actors();
}
public function UpdateDynObjects():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = 0;
while (_local1 < dynObjects.length) {
if (dynObjects[_local1].visible == false){
} else {
if (ageMath.Distance(dynObjects[_local1].x, dynObjects[_local1].y, hero.x, hero.y) < (stage.stageWidth * 1.6)){
if (dynObjects[_local1].gravityEnable){
dynObjects[_local1].speed.y = (dynObjects[_local1].speed.y + (grav * dynObjects[_local1].gravityFactor));
};
dynObjects[_local1].speed.y = ((dynObjects[_local1].speed.y)>dynObjects[_local1].maxSpeed.y) ? dynObjects[_local1].maxSpeed.y : dynObjects[_local1].speed.y;
dynObjects[_local1].y = (dynObjects[_local1].y + dynObjects[_local1].speed.y);
if (dynObjects[_local1].collisionEnable){
_local2 = int((((dynObjects[_local1].x - dynObjects[_local1].width) - minLimX) / limitersCacheStep));
_local3 = int((((dynObjects[_local1].x + dynObjects[_local1].width) - minLimX) / limitersCacheStep));
_local4 = _local2;
while (_local4 <= _local3) {
if (((limitersCache[_local4]) && (limitersCache[_local4].length))){
checkHitPlatform(dynObjects[_local1], limitersCache[_local4]);
};
_local4++;
};
};
};
};
_local1++;
};
}
public function addLineDamageToEnemy(_arg1:ageVector, _arg2:Number, _arg3:actorObject, _arg4:Boolean){
var _local5:projObject = new projObject();
_local5.damage = _arg2;
_local5.x = _arg1.x;
_local5.y = _arg1.y;
_local5.fromGoodGuy = _arg4;
_arg3.transmitDamage(_local5);
_local5.clearDynObject();
}
public function addFX_BloodOnGround(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new bloodOnGround();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.gotoAndStop(ageMath.RandomInt(1, 5));
_local3.scaleY = 0.5;
_local3.fadeSpeed = 0.005;
_local3.startFadeOut();
projLayer.addChild(_local3);
_local3.curDispContainer = projLayer;
fxObjects.push(_local3);
return (_local3);
}
public function cleenUP_Proj():void{
var _local1:int;
_local1 = 0;
while (_local1 < projObjects.length) {
if (((projObjects[_local1]) && ((projObjects[_local1].visible == false)))){
projObjects[_local1].clearDynObject();
if (projObjects[_local1]){
if (projObjects[_local1].parent){
projObjects[_local1].parent.removeChild(projObjects[_local1]);
};
};
projObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function cleenUP_Actors():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < enemies.length) {
if (((((enemies[_local1]) && ((enemies[_local1].visible == false)))) && (enemies[_local1].dead))){
_local2 = 0;
while (_local2 < dynObjects.length) {
if (dynObjects[_local2] == enemies[_local1]){
dynObjects[_local2].clearDynObject();
dynObjects.splice(_local2, 1);
break;
};
_local2++;
};
enemies[_local1].clearActorObject();
if (enemies[_local1]){
if (enemies[_local1].parent){
enemies[_local1].parent.removeChild(enemies[_local1]);
};
};
enemies.splice(_local1, 1);
break;
};
_local1++;
};
}
public function addBlasterProj(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new blasterProj();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function cleenUP_Prop():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < propObjects.length) {
if (((propObjects[_local1]) && ((propObjects[_local1].visible == false)))){
_local2 = 0;
while (_local2 < dynObjects.length) {
if (dynObjects[_local2] == propObjects[_local1]){
dynObjects[_local2].clearDynObject();
dynObjects.splice(_local2, 1);
break;
};
_local2++;
};
if (propObjects[_local1]){
if (propObjects[_local1].parent){
propObjects[_local1].parent.removeChild(propObjects[_local1]);
};
};
propObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function testIntersectLimiterOnScr(_arg1:dynObject):Boolean{
var _local2:int;
_local2 = 0;
while (_local2 < limitersOnScr.length) {
if (((!(limitersOnScr[_local2].slimMode)) && (limitersOnScr[_local2].hitTestObject(_arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public function addProp_Shotgun(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propShotgun();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addBlinkFX_OverLight2():void{
Game(parent).gameGUI.fxblink2.fadeMaxLimit = 1;
Game(parent).gameGUI.fxblink2.fadeSpeed = 0.03;
Game(parent).gameGUI.fxblink2.use_force_restart = true;
Game(parent).gameGUI.fxblink2.startFadeOut();
}
public function addFX_BloodLeak(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new bloodLeak();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.fadeSpeed = 0.005;
_local3.startFadeOut();
projLayer.addChild(_local3);
_local3.curDispContainer = projLayer;
fxObjects.push(_local3);
return (_local3);
}
public function UpdateLimitersOnScr():void{
var _local1:int;
var _local2:int;
var _local3:*;
var _local4:int;
var _local5:Point;
var _local6:Rectangle;
var _local7:Rectangle;
limitersOnScr = [];
_local1 = int(((-(x) - minLimX) / limitersCacheStep));
_local2 = int((((-(x) + stage.stageWidth) - minLimX) / limitersCacheStep));
_local4 = _local1;
while (_local4 <= _local2) {
if (limitersCache[_local4]){
_local3 = 0;
while (_local3 < limitersCache[_local4].length) {
_local5 = this.localToGlobal(new Point(limitersCache[_local4][_local3].x, limitersCache[_local4][_local3].y));
_local6 = new Rectangle(_local5.x, _local5.y, limitersCache[_local4][_local3].width, limitersCache[_local4][_local3].height);
_local7 = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
if (_local7.intersects(_local6)){
limitersOnScr.push(limitersCache[_local4][_local3]);
};
_local3++;
};
};
_local4++;
};
}
public function levScript(){
var _local1:int;
var _local2:int;
var _local3:Boolean;
var _local4:int;
if (!sVar["triggerUpgrade1"]){
if (triggerUpgrade1.hitTestObject(hero)){
if (((Controls.keyNew[Keyboard.ENTER]) || (Controls.keyNew[69]))){
openUpgradeMenu();
};
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(5);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
} else {
if (!triggerUpgrade2.hitTestObject(hero)){
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 5)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
};
if (!sVar["triggerUpgrade2"]){
if (triggerUpgrade2.hitTestObject(hero)){
if (((Controls.keyNew[Keyboard.ENTER]) || (Controls.keyNew[69]))){
openUpgradeMenu();
};
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(5);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
} else {
if (!triggerUpgrade1.hitTestObject(hero)){
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 5)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
};
if (!sVar["triggerSecret1"]){
if (triggerSecret1.hitTestObject(hero)){
sVar["triggerSecret1"] = true;
Game(parent).gameGUI.hlpControl.showHelp(7);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
mainGlobal.secretsFound++;
};
};
if (!sVar["triggerTedBigAss"]){
if (triggerBigAss.hitTestObject(hero)){
sVar["triggerTedBigAss"] = true;
_local1 = Game(parent).gameGUI.dlg.setTo("lev6_TedBigAss");
sVar["DlgTedBigAssTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
};
} else {
if (!sVar["DlgTedBigAssEnd"]){
if (sVar["DlgTedBigAssTimer"] == 0){
sVar["DlgTedBigAssEnd"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
} else {
var _local5 = sVar;
var _local6 = "DlgTedBigAssTimer";
var _local7 = (_local5[_local6] - 1);
_local5[_local6] = _local7;
if (Controls.keyNew[69]){
sVar["DlgTedBigAssTimer"] = 0;
};
};
};
};
if (!sVar["triggerBarneyCall"]){
if (triggerBarneyCall.hitTestObject(hero)){
sVar["triggerBarneyCall"] = true;
sounds.PlaySnd("helpIco");
};
} else {
if (!sVar["triggerBarney"]){
Game(parent).gameGUI.dlgIco.targetingObject(barney);
} else {
Game(parent).gameGUI.dlgIco.x = -500;
};
};
if (!sVar["triggerBarney"]){
if (triggerBarney.hitTestObject(hero)){
sVar["triggerBarney"] = true;
levLeftLim = triggerBarneyCall.x;
};
} else {
if (!sVar["DlgBarneyEnd"]){
if (sVar["DlgBarneyTimer"] == 0){
if (sVar["DlgBarneyState"] == 0){
_local1 = Game(parent).gameGUI.dlg.setTo("lev6_TedBarney01");
_local5 = sVar;
_local6 = "DlgBarneyState";
_local7 = (_local5[_local6] + 1);
_local5[_local6] = _local7;
sVar["DlgBarneyTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
} else {
if (sVar["DlgBarneyState"] == 1){
_local1 = Game(parent).gameGUI.dlg.setTo("lev6_TedBarney02");
_local5 = sVar;
_local6 = "DlgBarneyState";
_local7 = (_local5[_local6] + 1);
_local5[_local6] = _local7;
sVar["DlgBarneyTimer"] = int((_local1 * dlgSpeedFactor));
} else {
if (sVar["DlgBarneyState"] == 2){
_local1 = Game(parent).gameGUI.dlg.setTo("lev6_TedBarney03");
_local5 = sVar;
_local6 = "DlgBarneyState";
_local7 = (_local5[_local6] + 1);
_local5[_local6] = _local7;
sVar["DlgBarneyTimer"] = int((_local1 * dlgSpeedFactor));
} else {
sVar["DlgBarneyEnd"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
addProp_Blaster((barney.x + (barney.width * 0.5)), (barney.y + (barney.height * 0.5)));
};
};
};
} else {
_local5 = sVar;
_local6 = "DlgBarneyTimer";
_local7 = (_local5[_local6] - 1);
_local5[_local6] = _local7;
if (Controls.keyNew[69]){
sVar["DlgBarneyTimer"] = 0;
};
};
};
};
if (!sVar["wepBlasterTaked"]){
if (hero.weapons[4].active){
sVar["wepBlasterTaked"] = true;
levLeftLim = levelLeftBorder.x;
Game(parent).gameGUI.dlgIco.gotoAndStop(2);
sounds.PlaySnd("helpIco");
};
} else {
if (!sVar["fueled1"]){
if (!sVar["fuel1Trigger"]){
Game(parent).gameGUI.dlgIco.targetingObject(fuelBarrel1);
if (triggerFuelBarrel1.hitTestObject(hero)){
sVar["fuel1Trigger"] = true;
Game(parent).gameGUI.dlgIco.x = -500;
fuelBarrel1.visible = true;
levLeftLim = triggerFuel1.x;
levRightLim = (triggerFuel1.x + triggerFuel1.width);
musicEnv.fadeTo("FatalDamage");
sVar["WaveCnt"] = 8;
_local2 = 0;
while (_local2 < 6) {
addActor("AlienSaw", ("unit" + _local2), (triggerFuel1.x + ageMath.RandomInt(-200, 200)), (triggerFuel1.y - ageMath.RandomInt(100, 300))).alwaysSeeEnemy = true;
_local2++;
};
addActor("AlienHunter", ("unit" + _local2), (triggerFuel1.x + ageMath.RandomInt(-200, 200)), (triggerFuel1.y - ageMath.RandomInt(100, 300))).alwaysSeeEnemy = true;
_local2++;
addActor("AlienElectro", ("unit" + _local2), (triggerFuel1.x + ageMath.RandomInt(-200, 200)), (triggerFuel1.y - ageMath.RandomInt(100, 300))).alwaysSeeEnemy = true;
};
} else {
if (!sVar["fuel1TriggerEnemies"]){
_local3 = true;
_local2 = 0;
while (_local2 < sVar["WaveCnt"]) {
if (((!((getChildByName(("unit" + _local2)) == null))) && (!((getChildByName(("unit" + _local2)).visible == false))))){
_local3 = false;
break;
};
_local2++;
};
if (_local3){
fuelBarrel1.gotoAndStop(2);
sVar["fuel1TriggerEnemies"] = true;
musicEnv.fadeTo(levelMus);
};
} else {
if (triggerFuelBarrel1.hitTestObject(hero)){
sVar["fueled1"] = true;
fuelBarrel1.visible = false;
Game(parent).gameGUI.dlgIco.gotoAndStop(2);
sounds.PlaySnd("helpIco");
levLeftLim = levelLeftBorder.x;
levRightLim = levelRightBorder.x;
};
};
};
};
if (((sVar["fueled1"]) && (!(sVar["fueled2"])))){
if (!sVar["fuel2Trigger"]){
Game(parent).gameGUI.dlgIco.targetingObject(fuelBarrel2);
if (triggerFuelBarrel2.hitTestObject(hero)){
sVar["fuel2Trigger"] = true;
Game(parent).gameGUI.dlgIco.x = -500;
fuelBarrel2.visible = true;
levLeftLim = triggerFuel2.x;
levRightLim = (triggerFuel2.x + triggerFuel2.width);
musicEnv.fadeTo("FatalDamage");
sVar["WaveCnt"] = 8;
_local2 = 0;
while (_local2 < 6) {
addActor("AlienSaw", ("unit" + _local2), (triggerFuel2.x + ageMath.RandomInt(-200, 200)), (triggerFuel2.y - ageMath.RandomInt(100, 300))).alwaysSeeEnemy = true;
_local2++;
};
addActor("AlienHunter", ("unit" + _local2), (triggerFuel2.x + ageMath.RandomInt(-200, 200)), (triggerFuel2.y - ageMath.RandomInt(100, 300))).alwaysSeeEnemy = true;
_local2++;
addActor("AlienHunter", ("unit" + _local2), (triggerFuel2.x + ageMath.RandomInt(-200, 200)), (triggerFuel2.y - ageMath.RandomInt(100, 300))).alwaysSeeEnemy = true;
};
} else {
if (!sVar["fuel2TriggerEnemies"]){
_local3 = true;
_local2 = 0;
while (_local2 < sVar["WaveCnt"]) {
if (((!((getChildByName(("unit" + _local2)) == null))) && (!((getChildByName(("unit" + _local2)).visible == false))))){
_local3 = false;
break;
};
_local2++;
};
if (_local3){
fuelBarrel2.gotoAndStop(2);
sVar["fuel2TriggerEnemies"] = true;
};
} else {
if (triggerFuelBarrel2.hitTestObject(hero)){
sVar["fueled2"] = true;
fuelBarrel2.visible = false;
sounds.PlaySnd("helpIco");
Game(parent).gameGUI.dlgIco.gotoAndStop(1);
musicEnv.fadeTo(levelMus);
levLeftLim = levelLeftBorder.x;
levRightLim = levelRightBorder.x;
};
};
};
};
};
if (sVar["fueled2"]){
if (!sVar["triggerBarney2"]){
Game(parent).gameGUI.dlgIco.targetingObject(barney);
} else {
Game(parent).gameGUI.dlgIco.x = -500;
};
if (!sVar["triggerBarney2"]){
if (triggerBarney.hitTestObject(hero)){
sVar["triggerBarney2"] = true;
levLeftLim = triggerBarneyCall.x;
};
} else {
if (!sVar["DlgBarney2End"]){
if (sVar["DlgBarney2Timer"] == 0){
if (sVar["DlgBarney2State"] == 0){
_local1 = Game(parent).gameGUI.dlg.setTo("lev6_TedBarney04");
_local5 = sVar;
_local6 = "DlgBarney2State";
_local7 = (_local5[_local6] + 1);
_local5[_local6] = _local7;
sVar["DlgBarney2Timer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
} else {
sVar["DlgBarney2End"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
};
} else {
_local5 = sVar;
_local6 = "DlgBarney2Timer";
_local7 = (_local5[_local6] - 1);
_local5[_local6] = _local7;
if (Controls.keyNew[69]){
sVar["DlgBarney2Timer"] = 0;
};
};
};
};
if (((sVar["DlgBarney2End"]) && (!(Game(parent).gameGUI.dlg.visible)))){
if (!isWin){
isWin = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuWinLose.startFadeIn();
Game(root).menuWinLose.setToWin();
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
musicEnv.fadeTo("musWin");
return;
};
};
};
}
public function UpdateProjObjects():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < projObjects.length) {
if (projObjects[_local1].visible == false){
} else {
if (projObjects[_local1].gravityEnable){
projObjects[_local1].Velocity.y = (projObjects[_local1].Velocity.y + (grav * projObjects[_local1].gravityFactor));
projObjects[_local1].Velocity.y = ((projObjects[_local1].Velocity.y)>projObjects[_local1].maxSpeed.y) ? projObjects[_local1].maxSpeed.y : projObjects[_local1].Velocity.y;
};
projObjects[_local1].updateDynObj();
if (!projObjects[_local1].fromGoodGuy){
if (((!(hero.dead)) && (hero.hitTestProj(projObjects[_local1])))){
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
} else {
hero.transmitDamage(projObjects[_local1]);
Game(parent).gameGUI.painFrame.startFadeOut();
};
};
} else {
_local2 = 0;
while (_local2 < enemies.length) {
if (((!(enemies[_local2].dead)) && (enemies[_local2].hitTestProj(projObjects[_local1])))){
mainGlobal.shootingInEnemies++;
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
} else {
enemies[_local2].transmitDamage(projObjects[_local1]);
};
};
_local2++;
};
};
if (ageMath.Distance(projObjects[_local1].x, projObjects[_local1].y, hero.x, hero.y) > 670){
projObjects[_local1].visible = false;
};
if (testIntersectLimiterOnScr(projObjects[_local1])){
projObjects[_local1].visible = false;
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
};
};
};
_local1++;
};
}
public function cleenUP_FX():void{
var _local1:int;
_local1 = 0;
while (_local1 < fxObjects.length) {
if (((fxObjects[_local1]) && ((fxObjects[_local1].visible == false)))){
if (fxObjects[_local1]){
if (fxObjects[_local1].parent){
fxObjects[_local1].parent.removeChild(fxObjects[_local1]);
};
};
fxObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
function frame1(){
initFirst = true;
}
public function addFX_Splatters(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxBloodSpatters();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function term(){
var _local1:int;
removeEventListener(Event.ENTER_FRAME, Update);
_local1 = 0;
while (_local1 < enemies.length) {
enemies[_local1].clearActorObject();
_local1++;
};
_local1 = 0;
while (_local1 < dynObjects.length) {
dynObjects[_local1].clearDynObject();
_local1++;
};
dynObjects = [];
enemies = [];
goodNPC = [];
projObjects = [];
paralaxObjects = [];
chunkObjects = [];
fxObjects = [];
propObjects = [];
addActorsArr = [];
limitersCache = [];
limitersOnScr = [];
limiters = [];
}
public function addProp_Coin(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propCoin();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
public function testRayToLimiterOnScr(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean=false, _arg6:Object=null):ageVector{
var _local10:int;
var _local11:ageVector;
var _local12:Number;
var _local13:ageVector;
var _local14:Number;
var _local7:ageVector;
var _local8:ageVector = new ageVector(_arg1, _arg3);
var _local9:Number = Number.MAX_VALUE;
_local10 = 0;
while (_local10 < limitersOnScr.length) {
if (!limitersOnScr[_local10].slimMode){
_local11 = ageMath.getLineCrossRect(_arg1, _arg2, _arg3, _arg4, limitersOnScr[_local10].x, limitersOnScr[_local10].y, (limitersOnScr[_local10].x + limitersOnScr[_local10].width), (limitersOnScr[_local10].y + limitersOnScr[_local10].height));
if (_local11 != null){
if (_local7 == null){
_local7 = new ageVector();
_local7.copy(_local11);
_local9 = ageMath.DistanceVec(_local8, _local7);
} else {
_local12 = ageMath.DistanceVec(_local8, _local11);
if (_local12 < _local9){
_local9 = _local12;
_local7.copy(_local11);
};
};
};
};
_local10++;
};
if (!_arg5){
return (_local7);
};
_arg6.id = -1;
_local10 = 0;
while (_local10 < enemies.length) {
if (enemies[_local10].dead){
} else {
_local13 = enemies[_local10].hitTestLine(_arg1, _arg2, _arg3, _arg4);
if (_local13 != null){
if (_local7 == null){
_local7 = new ageVector();
_local7.copy(_local13);
_arg6.id = _local10;
_local9 = ageMath.DistanceVec(_local8, _local7);
} else {
_local14 = ageMath.DistanceVec(_local8, _local13);
if (_local14 < _local9){
_local9 = _local14;
_arg6.id = _local10;
_local7.copy(_local13);
};
};
};
};
_local10++;
};
return (_local7);
}
public function addProp_Dynamite(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propDynamite();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addFX_Headshot(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxHeadshot();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function addProp_Money1(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMoney1();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_Money2(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMoney2();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
function showGameMenu():void{
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
Game(root).menuInGame.visible = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuInGame.startFadeIn();
}
public function UpdatePropObjects():void{
var _local1:int;
_local1 = 0;
while (_local1 < propObjects.length) {
if (propObjects[_local1].visible == false){
} else {
if (ageMath.Distance(propObjects[_local1].x, propObjects[_local1].y, hero.x, hero.y) >= (stage.stageWidth * 1.6)){
} else {
propObjects[_local1].x = (propObjects[_local1].x + propObjects[_local1].speed.x);
if (propObjects[_local1].useRotateSpeed){
propObjects[_local1].body.rotation = (propObjects[_local1].body.rotation + propObjects[_local1].rotateSpeed);
};
if ((((((((((((propObjects[_local1].propType == "Med")) || ((propObjects[_local1].propType == "Coin")))) || ((propObjects[_local1].propType == "Money")))) || ((propObjects[_local1].propType == "Weapon")))) || ((propObjects[_local1].propType == "Item")))) || ((propObjects[_local1].propType == "Ammo")))){
if (hero.hitTestObject(propObjects[_local1])){
if (propObjects[_local1].propType == "Ammo"){
if (hero.weapons[propObjects[_local1].wepNum].active){
if (hero.weapons[propObjects[_local1].wepNum].bulletsNum < hero.weapons[propObjects[_local1].wepNum].bulletsNumMax){
propObjects[_local1].visible = false;
hero.weapons[propObjects[_local1].wepNum].bulletsNum = (hero.weapons[propObjects[_local1].wepNum].bulletsNum + (hero.weapons[propObjects[_local1].wepNum].bulletsInCatrigeMax * propObjects[_local1].moneyAmount));
if (hero.weapons[propObjects[_local1].wepNum].bulletsNum > hero.weapons[propObjects[_local1].wepNum].bulletsNumMax){
hero.weapons[propObjects[_local1].wepNum].bulletsNum = hero.weapons[propObjects[_local1].wepNum].bulletsNumMax;
};
sounds.PlaySnd((hero.weapons[propObjects[_local1].wepNum].type + "Reloaded"));
};
};
} else {
if (propObjects[_local1].propType == "Med"){
if (hero.life < hero.lifeMax){
propObjects[_local1].visible = false;
hero.life = (hero.life + propObjects[_local1].moneyAmount);
if (hero.life > hero.lifeMax){
hero.life = hero.lifeMax;
};
sounds.PlaySnd("Med");
};
} else {
if (propObjects[_local1].propType == "Item"){
propObjects[_local1].visible = false;
hero.itemsInBag.push(propObjects[_local1].itemName);
sounds.PlaySnd("itemTake");
} else {
if (propObjects[_local1].propType == "Weapon"){
propObjects[_local1].visible = false;
hero.weapons[propObjects[_local1].wepNum].active = true;
hero.curWeaponNum = (propObjects[_local1].wepNum + 1);
sounds.PlaySnd((hero.weapons[(hero.curWeaponNum - 1)].type + "Reloaded"));
} else {
propObjects[_local1].visible = false;
sounds.PlaySnd((propObjects[_local1].propType + "1"));
hero.moneyCnt = (hero.moneyCnt + propObjects[_local1].moneyAmount);
mainGlobal.moneyCollected = (mainGlobal.moneyCollected + propObjects[_local1].moneyAmount);
};
};
};
};
};
};
};
};
_local1++;
};
}
public function addProp_MedKit(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new dropMedKit();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addProj_Psy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new psyProj();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
_local6.gravityComp = false;
_local6.infAmmo = true;
_local6.usePsyDamage = true;
_local6.psyDamageVal = 16;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProj_MinigunBeam(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
var _local10:ageVector = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local10.normThis();
_local10.mulScalar(600);
_arg3 = (_local10.x + _arg1);
_arg4 = (_local10.y + _arg2);
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projMinigunBeam();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.gravityEnable = false;
var _local11:Object = {id:-1};
var _local12:ageVector = testRayToLimiterOnScr(_arg1, _arg2, _arg3, _arg4, true, _local11);
if (_local12 != null){
_arg3 = _local12.x;
_arg4 = _local12.y;
if (_local11.id != -1){
mainGlobal.shootingInEnemies++;
addLineDamageToEnemy(_local12, _arg5.damage, enemies[_local11.id], true);
};
};
_local6.scaleX = (ageMath.Distance(_arg1, _arg2, _arg3, _arg4) / 34);
_local6.rotation = _local8;
var _local13:Array = new Array();
_local13.push(new GlowFilter(0xFFFF00, 1, 15, 15, 4, BitmapFilterQuality.MEDIUM));
_local6.filters = _local13;
if (_arg5 != null){
};
this["FXLayer"].addChild(_local6);
fxObjects.push(_local6);
return (_local6);
}
public function addProj_LaserBeam(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
var _local10:ageVector = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local10.normThis();
_local10.mulScalar(600);
_arg3 = (_local10.x + _arg1);
_arg4 = (_local10.y + _arg2);
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projLaserBeam();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.gravityEnable = false;
var _local11:ageVector = testRayToLimiterOnScr(_arg1, _arg2, _arg3, _arg4);
if (_local11 != null){
_arg3 = _local11.x;
_arg4 = _local11.y;
};
if (addLineDamage(_arg1, _arg2, _arg3, _arg4, _arg5.damage)){
mainGlobal.shootingInEnemies++;
};
_local6.scaleX = (ageMath.Distance(_arg1, _arg2, _arg3, _arg4) / 34);
_local6.rotation = _local8;
_local6.use_force_restart = true;
_local6.fadeSpeed = 0.1;
_local6.startFadeOut();
_local6.gravityEnable = false;
var _local12:Array = new Array();
_local12.push(new GlowFilter(0xFF0000, 1, 15, 15, 1.7, BitmapFilterQuality.MEDIUM));
_local6.filters = _local12;
if (_arg5 != null){
};
this["FXLayer"].addChild(_local6);
fxObjects.push(_local6);
return (_local6);
}
public function addFX_littleBlast(_arg1:Number, _arg2:Number, _arg3:Number=1.5){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
addBlinkFX_OverLight();
_local4 = new fxBlast();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.blendMode = BlendMode.SCREEN;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function addProj(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projBullet();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, 24);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = true;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProp_Debris(_arg1:Number, _arg2:Number, _arg3:Number=1, _arg4:String=""):propObject{
var _local5:propObject;
_local5 = new propDebris();
_local5.x = _arg1;
_local5.y = _arg2;
_local5.speed.y = (ageMath.Random(-6, -18) * _arg3);
_local5.speed.x = (ageMath.Random(-10, 10) * _arg3);
if (_arg4.length){
_local5.gotoAndStop(_arg4);
} else {
_local5.gotoAndStop(ageMath.RandomInt(1, 20));
};
_local5.curLevel = this;
dynObjects.push(_local5);
propObjects.push(_local5);
_local5.isRubber = true;
_local5.stayTime = (3000 + ageMath.RandomInt(1, 2000));
_local5.timerStayDelay.start();
_local5.useRotateSpeed = true;
_local5.rotateSpeed = ageMath.RandomInt(-15, 15);
propLayer.addChild(_local5);
return (_local5);
}
public function addProj_BombWep(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projBombWep();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
_local6.blastStyle = _arg5.blastStyle;
_local6.attackRadius = _arg5.damageRadius;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function ifMCOnScreen(_arg1:MovieClip):Boolean{
var _local2:Point = this.localToGlobal(new Point(_arg1.x, _arg1.y));
var _local3:Rectangle = _arg1.getBounds(root);
var _local4:Rectangle = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
if (_local4.intersects(_local3)){
return (true);
};
return (false);
}
public function addLimiter(_arg1){
limiters.push(_arg1);
}
public function alignObjXToAnother(_arg1, _arg2):void{
if ((_arg1.x - (_arg1.width * 0.5)) < _arg2.x){
_arg1.x = (_arg1.x + (_arg2.x - (_arg1.x - (_arg1.width * 0.5))));
};
if ((_arg1.x + (_arg1.width * 0.5)) > (_arg2.x + _arg2.width)){
_arg1.x = (_arg1.x - ((_arg1.x + (_arg1.width * 0.5)) - (_arg2.x + _arg2.width)));
};
}
public function addExplotion(_arg1:projObject, _arg2:actorObject=null):void{
var _local3:Number;
var _local5:int;
_local3 = ageMath.Distance(_arg1.x, _arg1.y, hero.x, hero.y);
var _local4:projObject = new projObject();
if (_local3 < _arg1.attackRadius){
_local4.damage = ageMath.RemapVal(_local3, 0, _arg1.attackRadius, _arg1.damage, 0);
_local4.x = hero.x;
_local4.y = (hero.y - (hero.height / 2));
_local4.fromGoodGuy = false;
hero.transmitDamage(_local4);
Game(parent).gameGUI.painFrame.startFadeOut();
_local4.clearDynObject();
};
_local5 = 0;
while (_local5 < enemies.length) {
if (((((enemies[_local5].dead) && (!((_arg2 == null))))) && (!((_arg2 == enemies[_local5]))))){
} else {
_local3 = ageMath.Distance(_arg1.x, _arg1.y, enemies[_local5].x, enemies[_local5].y);
if (_local3 < _arg1.attackRadius){
_local4.damage = ageMath.RemapVal(_local3, 0, _arg1.attackRadius, _arg1.damage, 0);
_local4.x = enemies[_local5].x;
_local4.y = (enemies[_local5].y - (enemies[_local5].height / 2));
_local4.fromGoodGuy = true;
enemies[_local5].transmitDamage(_local4);
_local4.clearDynObject();
};
};
_local5++;
};
}
public function addProj_Rocket(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projRocket();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = true;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
_local6.blastStyle = _arg5.blastStyle;
_local6.attackRadius = _arg5.damageRadius;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addFX_BlastWave(_arg1:Number, _arg2:Number, _arg3:Number=1){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
_local4 = new fxBlastWave();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function Update(_arg1:Event):void{
var _local5:int;
var _local6:*;
var _local7:*;
var _local11:int;
var _local12:addActorStruct;
var _local13:int;
var _local14:Number;
var _local15:Array;
var _local16:ColorMatrix;
if (isWin){
hero.body.stop();
return;
};
if (((((mainGlobal.paused) || (!(visible)))) || (!((parent as Game))))){
return;
};
if ((((hero.life <= 0)) && (!(isLose)))){
isLose = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuWinLose.startFadeIn();
Game(root).menuWinLose.setToLose();
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
musicEnv.fadeTo("musLose");
sounds.PlaySnd(("TedDie" + ageMath.RandomInt(1, 2).toString()), 0.8);
return;
};
if (initFirst){
if (((!(mainGlobal.configMusicOn)) && (!(mainGlobal.configSoundOn)))){
Game(parent).gamButSnd.gotoAndStop(2);
} else {
Game(parent).gamButSnd.gotoAndStop(1);
};
initFirst = false;
initLimCache();
Game(parent).fadeBG.fadeSpeed = 0.03;
Game(parent).fadeBG.use_force_restart = true;
Game(parent).fadeBG.startFadeOut();
Game(parent).gameGUI.hlpControl.visible = false;
Game(parent).gameGUI.dlg.visible = false;
Game(parent).gameGUI.dlgIco.x = -500;
_local6 = (hero.x * this.scaleX);
_local7 = ((hero.y - 95) * this.scaleY);
x = -((_local6 - (stage.stageWidth * 0.5)));
y = -((_local7 - (stage.stageHeight * 0.5)));
mainGlobal.initStat();
_local11 = 0;
_local11 = 0;
while (_local11 < enemies.length) {
if (!enemies[_local11].noStatEnemy){
mainGlobal.enemiesAll++;
};
_local11++;
};
Game(parent).sky.visible = true;
levInit();
if (mainGlobal.isSingleEp){
if (curLevNum == 1){
_local5 = 0;
while (_local5 < 1) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 0;
} else {
if (curLevNum == 2){
_local5 = 0;
while (_local5 < 2) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 200;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
} else {
if (curLevNum == 3){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
} else {
if (curLevNum == 4){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1300;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
} else {
if (curLevNum == 5){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1500;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
} else {
if (curLevNum == 6){
_local5 = 0;
while (_local5 < 4) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 2000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
} else {
if (curLevNum == 7){
_local5 = 0;
while (_local5 < 5) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 3000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
} else {
if (curLevNum == 8){
_local5 = 0;
while (_local5 < 5) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 3500;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
} else {
if (curLevNum == 9){
_local5 = 0;
while (_local5 < 6) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = 5;
hero.moneyCnt = 4000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
hero.applyUpgrade(1, 4);
hero.upgradesLife[4].active = true;
} else {
if (curLevNum == 10){
_local5 = 0;
while (_local5 < 6) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = 5;
hero.moneyCnt = 4000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
hero.applyUpgrade(1, 4);
hero.upgradesLife[4].active = true;
};
};
};
};
};
};
};
};
};
};
};
Game(parent).gameGUI.dlgIco.gotoAndStop(1);
};
var _local2:int = getTimer();
cleenUP();
UpdateLimitersOnScr();
UpdateParalaxObjects();
UpdateDynObjects();
UpdatePropObjects();
UpdateEnemies();
UpdateProjObjects();
hero.updateActor();
hero.applyDamages();
hero.testIsActorDead();
if (addActorsArr.length){
while (addActorsArr.length) {
_local12 = addActorsArr.pop();
addActor(_local12.strClass, "", _local12.posx, _local12.posy, _local12.orderZ);
};
};
var _local3:int;
_local3 = 0;
while (_local3 < chunkObjects.length) {
if (ifMCOnScreen(chunkObjects[_local3])){
chunkObjects[_local3].visible = true;
} else {
chunkObjects[_local3].visible = false;
};
_local3++;
};
levScript();
var _local4:Boolean;
if (Controls.key[Keyboard.F2]){
hero.life = 1;
};
if (Controls.key[Keyboard.ESCAPE]){
showGameMenu();
};
if (!hero.timerReloadDelay.running){
_local13 = 0;
while (_local13 < 8) {
if (((((Controls.key[(49 + _local13)]) && (!((hero.curWeaponNum == (_local13 + 1)))))) && (hero.weapons[_local13].active))){
hero.curWeaponNum = (_local13 + 1);
sounds.PlaySnd((hero.weapons[(hero.curWeaponNum - 1)].type + "Reloaded"));
};
_local13++;
};
};
if (Game(root).cursor.currentLabel == "cross"){
_local14 = ageMath.Distance(hero.x, hero.y, (Controls.mousePosX - x), (Controls.mousePosY - y));
Game(root).cursor.shootAcc.scaleX = (Game(root).cursor.shootAcc.scaleY = ((hero.wepAcc * _local14) / hero.weapons[(hero.curWeaponNum - 1)].accDistScale));
};
_local5 = 0;
_local5 = 0;
while (_local5 < 8) {
if (((hero.weapons[_local5]) && (hero.weapons[_local5].active))){
if ((((hero.weapons[_local5].bulletsInCatrige == 0)) && ((hero.weapons[_local5].bulletsNum == 0)))){
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 2){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 2;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(-124);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
} else {
if (hero.curWeaponNum != (_local5 + 1)){
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 1){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 1;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(0);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
} else {
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 3){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 3;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(87);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
};
};
} else {
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 4){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 4;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 0.5;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(0);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
};
_local5++;
};
Game(parent).gameGUI.wepInfo.catTxt.text = ((hero.weapons[(hero.curWeaponNum - 1)].bulletsInCatrige + "/") + hero.weapons[(hero.curWeaponNum - 1)].bulletsInCatrigeMax);
if (!hero.weapons[(hero.curWeaponNum - 1)].infAmmo){
Game(parent).gameGUI.wepInfo.allTxt.text = hero.weapons[(hero.curWeaponNum - 1)].bulletsNum;
} else {
Game(parent).gameGUI.wepInfo.allTxt.text = "INF";
};
Game(parent).gameGUI.wepInfo.pic.gotoAndStop((hero.curWeaponNum + 4));
if ((hero.x - (hero.width * 0.5)) < levLeftLim){
hero.x = (levLeftLim + (hero.width * 0.5));
} else {
if ((hero.x + (hero.width * 0.5)) > levRightLim){
hero.x = (levRightLim - (hero.width * 0.5));
};
};
_local6 = ageMath.Lerp((Controls.mousePosX - x), (hero.x * scaleX), 0.6);
_local7 = ageMath.Lerp((Controls.mousePosY - y), ((hero.y - 95) * scaleY), 0.6);
if (!_local4){
x = Math.round(ageMath.Lerp(x, -((_local6 - (stage.stageWidth * 0.5))), 0.15));
y = Math.round(ageMath.Lerp(y, -((_local7 - (stage.stageHeight * 0.5))), 0.15));
} else {
x = -((_local6 - (stage.stageWidth * 0.5)));
y = -((_local7 - (stage.stageHeight * 0.5)));
};
if (this["blackScr"]){
this["blackScr"].x = -(x);
this["blackScr"].y = -(y);
};
var _local8:Point = this.localToGlobal(new Point(levLeftLim, 0));
var _local9:Point = this.localToGlobal(new Point(levRightLim, 0));
if (_local8.x > 0){
x = (x - _local8.x);
} else {
if (_local9.x < stage.stageWidth){
x = (x + (stage.stageWidth - _local9.x));
};
};
if (curBlastShake > 0){
x = (x + ageMath.Random(-(curBlastShake), curBlastShake));
y = (y + ageMath.Random(-(curBlastShake), curBlastShake));
curBlastShake = (curBlastShake - curBlastShakeDec);
if (curBlastShake < 0){
curBlastShake = 0;
};
};
Game(parent).gameGUI.lifeBar.gotoAndStop(Math.round(ageMath.RemapVal(Math.round(hero.life), 1, hero.lifeMax, 1, 100)));
Game(parent).gameGUI.lifeBar.width = ageMath.RemapVal(Math.round(hero.lifeMax), 100, 300, 108, 227);
Game(parent).gameGUI.txtMoney.text = ("$" + hero.moneyCnt);
var _local10:int;
_local10 = 0;
while (_local10 < 6) {
if (hero.itemsInBag[_local10]){
Game(parent).gameGUI[("itm" + _local10)].gotoAndStop(hero.itemsInBag[_local10]);
} else {
Game(parent).gameGUI[("itm" + _local10)].gotoAndStop(1);
};
_local10++;
};
if (hero.bioMaxLevel > 0){
Game(parent).gameGUI.hazBio.visible = true;
Game(parent).gameGUI.hazBio.gotoAndStop((100 - int(ageMath.RemapVal(hero.bioCurLevel, 0, hero.bioMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazBio.visible = false;
};
if (hero.psyMaxLevel > 0){
Game(parent).gameGUI.hazPsy.visible = true;
Game(parent).gameGUI.hazPsy.gotoAndStop((100 - int(ageMath.RemapVal(hero.psyCurLevel, 0, hero.psyMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazPsy.visible = false;
};
if (hero.electroMaxLevel > 0){
Game(parent).gameGUI.hazElectro.visible = true;
Game(parent).gameGUI.hazElectro.gotoAndStop((100 - int(ageMath.RemapVal(hero.electroCurLevel, 0, hero.electroMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazElectro.visible = false;
};
Controls.updateKeyNew();
if (Game(parent).groundBG){
Game(parent).groundBG.changeBG(x, y);
};
}
public function addProp_minigunAmmo(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMinigunAmmo();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addActor(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:int=-1):actorObject{
var _local6:actorObject;
if (_arg1 == "AlienSaw"){
_local6 = new AlienSaw();
} else {
if (_arg1 == "AlienHunter"){
_local6 = new AlienHunter();
} else {
if (_arg1 == "AlienElectro"){
_local6 = new AlienElectro();
} else {
if (_arg1 == "Zomb01"){
_local6 = new Zomb01();
} else {
if (_arg1 == "Zomb02"){
_local6 = new Zomb02();
} else {
if (_arg1 == "Zomb03"){
_local6 = new Zomb03();
} else {
if (_arg1 == "Zomb04"){
_local6 = new Zomb04();
} else {
if (_arg1 == "Zomb05"){
_local6 = new Zomb05();
} else {
if (_arg1 == "Zomb01Run"){
_local6 = new Zomb01Run();
} else {
if (_arg1 == "Zomb02Run"){
_local6 = new Zomb02Run();
} else {
if (_arg1 == "Zomb03Run"){
_local6 = new Zomb03Run();
} else {
if (_arg1 == "Zomb04Run"){
_local6 = new Zomb04Run();
} else {
if (_arg1 == "Zomb05Run"){
_local6 = new Zomb05Run();
} else {
if (_arg1 == "Zomb01Vomit"){
_local6 = new Zomb01Vomit();
} else {
if (_arg1 == "Zomb02Vomit"){
_local6 = new Zomb02Vomit();
} else {
if (_arg1 == "Zomb03Vomit"){
_local6 = new Zomb03Vomit();
} else {
if (_arg1 == "Zomb04Vomit"){
_local6 = new Zomb04Vomit();
} else {
if (_arg1 == "Zomb05Vomit"){
_local6 = new Zomb05Vomit();
} else {
if (_arg1 == "Spider"){
_local6 = new Spider();
} else {
if (_arg1 == "AlienBomber"){
_local6 = new AlienBomber();
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
_local6.x = _arg3;
_local6.y = _arg4;
_local6.name = _arg2;
if (!_local6.noStatEnemy){
mainGlobal.enemiesAll++;
};
if (_arg5 < 0){
addChild(_local6);
} else {
addChildAt(_local6, _arg5);
};
return (_local6);
}
public function levInit(){
var _local1:int;
mainGlobal.secretsAll = 1;
curLevNum = 6;
curLevScore = 3000;
levelMus = "musGlory";
musicEnv.fadeTo(levelMus);
Game(parent).sky.visible = true;
levLeftLim = levelLeftBorder.x;
levRightLim = levelRightBorder.x;
sVar["triggerTedBigAss"] = false;
sVar["DlgTedBigAssTimer"] = 0;
sVar["DlgTedBigAssEnd"] = false;
sVar["triggerBarneyCall"] = false;
sVar["triggerBarney"] = false;
sVar["DlgBarneyState"] = 0;
sVar["DlgBarneyTimer"] = 0;
sVar["DlgBarneyEnd"] = false;
sVar["triggerBarney2"] = false;
sVar["DlgBarney2State"] = 0;
sVar["DlgBarney2Timer"] = 0;
sVar["DlgBarney2End"] = false;
fuelBarrel1.visible = false;
fuelBarrel2.visible = false;
}
public function addFX_MetalSparks(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxMetalSparks();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.blendMode = BlendMode.ADD;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function addProp_blasterAmmo(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propBlasterAmmo();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_Blaster(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propBlaster();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function UpdateEnemies():void{
var _local1:int;
_local1 = 0;
while (_local1 < enemies.length) {
if (((enemies[_local1].dead) || ((enemies[_local1].life <= 0)))){
} else {
if (((((!((enemies[_local1].parent as Level))) || (enemies[_local1].alwaysSeeEnemy))) || ((ageMath.Distance(enemies[_local1].x, enemies[_local1].y, hero.x, hero.y) < (stage.stageWidth * 1.6))))){
enemies[_local1].updateActorEnemy();
};
};
_local1++;
};
}
public function addProj_Vomit(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projVomit();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.timerFXAdd.delay = 80;
_local6.timerFXAdd.start();
_local6.fxFunc = addFX_VomitSplatters;
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = true;
_local6.gravityComp = true;
_local6.infAmmo = true;
_local6.useBioDamage = true;
_local6.bioDamageVal = 10;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
}
}//package main
Section 84
//Level7 (main.Level7)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.ui.*;
public dynamic class Level7 extends Level {
var levRightLim:Number;// = 999999
var dlgSpeedFactor:Number;// = 4
var lastMSFrame:int;// = 9999
public var enemies:Array;
var levLeftLim:Number;// = -999999
public var propObjects:Array;
public var minLimX:Number;// = 2147483647
public var maxLimX:Number;// = -2147483648
var curBlastShake:Number;// = 0
var isWin:Boolean;// = false
public var dynObjects:Array;
var isLose:Boolean;// = false
var grav:Number;// = 1
public var limitersCache:Array;
var initFirst:Boolean;// = false
var curLevNum:int;// = 1
public var FXLayer:MovieClip;
public var triggerY:MovieClip;
var levelMus:String;// = ""
public var pointWave2:MovieClip;
public var pointWave3:MovieClip;
public var propLayer:MovieClip;
public var pointWave1:MovieClip;
var sVar:Object;
public var limitersOnScr:Array;
public var addActorsArr:Array;
public var limiters:Array;
public var paralaxObjects:Array;
public var triggerRightBarrier:MovieClip;
var curLevScore:int;// = 3000
public var triggerLeftBarrier:MovieClip;
public var fxObjects:Array;
var curBlastShakeDec:Number;// = 0.3
public var goodNPC:Array;
public var chunkObjects:Array;
var curScale:Number;// = 1
public var limitersCacheStep:int;// = 640
public var projObjects:Array;
public var hero:MovieClip;
public var projLayer:MovieClip;
public function Level7(){
sVar = new Object();
limiters = new Array();
limitersCache = new Array();
limitersOnScr = new Array();
dynObjects = new Array();
enemies = new Array();
goodNPC = new Array();
paralaxObjects = new Array();
projObjects = new Array();
chunkObjects = new Array();
fxObjects = new Array();
propObjects = new Array();
addActorsArr = new Array();
super();
addFrameScript(0, frame1);
init();
}
public function addFX_VomitSplatters(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxVomitSpatters();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function initLimCache(){
var _local1:*;
var _local2:int;
var _local3:int;
var _local4:int;
maxLimX = int.MIN_VALUE;
minLimX = int.MAX_VALUE;
_local1 = 0;
while (_local1 < limiters.length) {
if (limiters[_local1].x < minLimX){
minLimX = limiters[_local1].x;
};
if ((limiters[_local1].x + limiters[_local1].width) > maxLimX){
maxLimX = limiters[_local1].x;
};
_local1++;
};
limitersCache = [];
_local1 = 0;
while (_local1 < (((maxLimX - minLimX) / limitersCacheStep) + 1)) {
limitersCache.push(new Array());
_local1++;
};
_local1 = 0;
while (_local1 < limiters.length) {
_local3 = int(((limiters[_local1].x - minLimX) / limitersCacheStep));
_local4 = int((((limiters[_local1].x + limiters[_local1].width) - minLimX) / limitersCacheStep));
_local2 = _local3;
while (_local2 <= _local4) {
if (!limitersCache[_local2]){
limitersCache[_local2] = new Array();
};
limitersCache[_local2].push(limiters[_local1]);
_local2++;
};
_local1++;
};
}
public function addLineDamage(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Boolean{
var _local6:Number;
var _local8:int;
var _local9:ageVector;
var _local7:Boolean;
_local8 = 0;
while (_local8 < enemies.length) {
if (enemies[_local8].dead){
} else {
_local9 = enemies[_local8].hitTestLine(_arg1, _arg2, _arg3, _arg4);
if (_local9 != null){
addLineDamageToEnemy(_local9, _arg5, enemies[_local8], true);
_local7 = true;
};
};
_local8++;
};
return (_local7);
}
public function checkHitPlatform(_arg1, _arg2:Array){
var _local3:int;
_arg1.bottomLimiter = null;
_local3 = 0;
while (_local3 < _arg2.length) {
if (((_arg2[_local3].slimMode) && ((_arg1.speed.y < 0)))){
} else {
if (_arg2[_local3].hitTestObject(_arg1.p2)){
_arg1.jump = false;
if (_arg1.isRubber){
_arg1.speed.y = (_arg1.speed.y * -(_arg1.rubberFactor));
_arg1.speed.x = (_arg1.speed.x * _arg1.rubberFactor);
if (_arg1.useRotateSpeed){
_arg1.rotateSpeed = 0;
};
} else {
_arg1.speed.y = 0;
};
_arg1.y = ((_arg2[_local3].y - _arg1.p2.y) - _arg1.p2.height);
_arg1.bottomLimiter = _arg2[_local3];
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p1)) && (!(_arg2[_local3].slimMode)))){
if (_arg1.scaleX > 0){
_arg1.x = (_arg2[_local3].x - (_arg1.p1.x + _arg1.p1.width));
} else {
_arg1.x = ((_arg2[_local3].x + _arg2[_local3].width) + (_arg1.p1.x + _arg1.p1.width));
};
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p3)) && (!(_arg2[_local3].slimMode)))){
if (_arg1.scaleX > 0){
_arg1.x = ((_arg2[_local3].x + _arg2[_local3].width) - _arg1.p3.x);
} else {
_arg1.x = (_arg2[_local3].x - (-(_arg1.p3.x) + _arg1.p3.width));
};
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p4)) && (!(_arg2[_local3].slimMode)))){
_arg1.speed.y = 0;
_arg1.y = ((_arg2[_local3].y + _arg2[_local3].height) - _arg1.p4.y);
};
};
};
};
};
_local3++;
};
}
public function openUpgradeMenu():void{
mainGlobal.paused = true;
this.visible = false;
Game(root).cursor.gotoAndStop("arrow");
Game(parent).menuUpgradeShop.showShop();
musicEnv.fadeTo("musUpgrade");
}
public function addFX_littleSmoke(_arg1:Number, _arg2:Number, _arg3:Number=1.5){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
_local4 = new fxLittleSmoke();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function init(){
addEventListener(Event.ENTER_FRAME, Update, false, 0, true);
}
function mouseLeave(_arg1:Event):void{
showGameMenu();
}
public function UpdateParalaxObjects():void{
var _local1:int;
_local1 = 0;
while (_local1 < paralaxObjects.length) {
paralaxObjects[_local1].x = (paralaxObjects[_local1].saveX - ageMath.RemapVal((paralaxObjects[_local1].saveX + x), 0, stage.stageWidth, 0, paralaxObjects[_local1].paralaxX));
paralaxObjects[_local1].y = (paralaxObjects[_local1].saveY - ageMath.RemapVal((paralaxObjects[_local1].saveY + y), 0, stage.stageHeight, 0, paralaxObjects[_local1].paralaxY));
_local1++;
};
}
public function addBlinkFX_OverLight():void{
Game(parent).gameGUI.fxblink.fadeMaxLimit = 1;
Game(parent).gameGUI.fxblink.fadeSpeed = 0.03;
Game(parent).gameGUI.fxblink.use_force_restart = true;
Game(parent).gameGUI.fxblink.startFadeOut();
curBlastShake = 15;
}
public function cleenUP():void{
cleenUP_FX();
cleenUP_Proj();
cleenUP_Prop();
cleenUP_Actors();
}
public function UpdateDynObjects():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = 0;
while (_local1 < dynObjects.length) {
if (dynObjects[_local1].visible == false){
} else {
if (ageMath.Distance(dynObjects[_local1].x, dynObjects[_local1].y, hero.x, hero.y) < (stage.stageWidth * 1.6)){
if (dynObjects[_local1].gravityEnable){
dynObjects[_local1].speed.y = (dynObjects[_local1].speed.y + (grav * dynObjects[_local1].gravityFactor));
};
dynObjects[_local1].speed.y = ((dynObjects[_local1].speed.y)>dynObjects[_local1].maxSpeed.y) ? dynObjects[_local1].maxSpeed.y : dynObjects[_local1].speed.y;
dynObjects[_local1].y = (dynObjects[_local1].y + dynObjects[_local1].speed.y);
if (dynObjects[_local1].collisionEnable){
_local2 = int((((dynObjects[_local1].x - dynObjects[_local1].width) - minLimX) / limitersCacheStep));
_local3 = int((((dynObjects[_local1].x + dynObjects[_local1].width) - minLimX) / limitersCacheStep));
_local4 = _local2;
while (_local4 <= _local3) {
if (((limitersCache[_local4]) && (limitersCache[_local4].length))){
checkHitPlatform(dynObjects[_local1], limitersCache[_local4]);
};
_local4++;
};
};
};
};
_local1++;
};
}
public function addLineDamageToEnemy(_arg1:ageVector, _arg2:Number, _arg3:actorObject, _arg4:Boolean){
var _local5:projObject = new projObject();
_local5.damage = _arg2;
_local5.x = _arg1.x;
_local5.y = _arg1.y;
_local5.fromGoodGuy = _arg4;
_arg3.transmitDamage(_local5);
_local5.clearDynObject();
}
public function addFX_BloodOnGround(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new bloodOnGround();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.gotoAndStop(ageMath.RandomInt(1, 5));
_local3.scaleY = 0.5;
_local3.fadeSpeed = 0.005;
_local3.startFadeOut();
projLayer.addChild(_local3);
_local3.curDispContainer = projLayer;
fxObjects.push(_local3);
return (_local3);
}
public function cleenUP_Proj():void{
var _local1:int;
_local1 = 0;
while (_local1 < projObjects.length) {
if (((projObjects[_local1]) && ((projObjects[_local1].visible == false)))){
projObjects[_local1].clearDynObject();
if (projObjects[_local1]){
if (projObjects[_local1].parent){
projObjects[_local1].parent.removeChild(projObjects[_local1]);
};
};
projObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function cleenUP_Actors():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < enemies.length) {
if (((((enemies[_local1]) && ((enemies[_local1].visible == false)))) && (enemies[_local1].dead))){
_local2 = 0;
while (_local2 < dynObjects.length) {
if (dynObjects[_local2] == enemies[_local1]){
dynObjects[_local2].clearDynObject();
dynObjects.splice(_local2, 1);
break;
};
_local2++;
};
enemies[_local1].clearActorObject();
if (enemies[_local1]){
if (enemies[_local1].parent){
enemies[_local1].parent.removeChild(enemies[_local1]);
};
};
enemies.splice(_local1, 1);
break;
};
_local1++;
};
}
public function addBlasterProj(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new blasterProj();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addBlinkFX_OverLight2():void{
Game(parent).gameGUI.fxblink2.fadeMaxLimit = 1;
Game(parent).gameGUI.fxblink2.fadeSpeed = 0.03;
Game(parent).gameGUI.fxblink2.use_force_restart = true;
Game(parent).gameGUI.fxblink2.startFadeOut();
}
public function testIntersectLimiterOnScr(_arg1:dynObject):Boolean{
var _local2:int;
_local2 = 0;
while (_local2 < limitersOnScr.length) {
if (((!(limitersOnScr[_local2].slimMode)) && (limitersOnScr[_local2].hitTestObject(_arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public function cleenUP_Prop():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < propObjects.length) {
if (((propObjects[_local1]) && ((propObjects[_local1].visible == false)))){
_local2 = 0;
while (_local2 < dynObjects.length) {
if (dynObjects[_local2] == propObjects[_local1]){
dynObjects[_local2].clearDynObject();
dynObjects.splice(_local2, 1);
break;
};
_local2++;
};
if (propObjects[_local1]){
if (propObjects[_local1].parent){
propObjects[_local1].parent.removeChild(propObjects[_local1]);
};
};
propObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function addProp_Shotgun(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propShotgun();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function UpdateLimitersOnScr():void{
var _local1:int;
var _local2:int;
var _local3:*;
var _local4:int;
var _local5:Point;
var _local6:Rectangle;
var _local7:Rectangle;
limitersOnScr = [];
_local1 = int(((-(x) - minLimX) / limitersCacheStep));
_local2 = int((((-(x) + stage.stageWidth) - minLimX) / limitersCacheStep));
_local4 = _local1;
while (_local4 <= _local2) {
if (limitersCache[_local4]){
_local3 = 0;
while (_local3 < limitersCache[_local4].length) {
_local5 = this.localToGlobal(new Point(limitersCache[_local4][_local3].x, limitersCache[_local4][_local3].y));
_local6 = new Rectangle(_local5.x, _local5.y, limitersCache[_local4][_local3].width, limitersCache[_local4][_local3].height);
_local7 = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
if (_local7.intersects(_local6)){
limitersOnScr.push(limitersCache[_local4][_local3]);
};
_local3++;
};
};
_local4++;
};
}
public function addFX_BloodLeak(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new bloodLeak();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.fadeSpeed = 0.005;
_local3.startFadeOut();
projLayer.addChild(_local3);
_local3.curDispContainer = projLayer;
fxObjects.push(_local3);
return (_local3);
}
public function levScript(){
var _local1:int;
var _local2:int;
var _local3:Boolean;
var _local4:int;
if (hero.x < triggerLeftBarrier.x){
hero.x = triggerLeftBarrier.x;
};
if (hero.x > triggerRightBarrier.x){
hero.x = triggerRightBarrier.x;
};
_local2 = 0;
while (_local2 < propObjects.length) {
if (propObjects[_local2].y > triggerY.y){
propObjects[_local2].x = (propObjects[_local2].x - 35);
};
_local2++;
};
if (!sVar["isWaveEnd"]){
_local3 = true;
_local4 = 0;
while (_local4 < sVar["WaveCnt"]) {
if (((!((getChildByName(("unit" + _local4)) == null))) && (!((getChildByName(("unit" + _local4)).visible == false))))){
_local3 = false;
break;
};
_local4++;
};
if (_local3){
if (sVar["WaveNum"] == 0){
var _local5 = sVar;
var _local6 = "WaveNum";
var _local7 = (_local5[_local6] + 1);
_local5[_local6] = _local7;
Game(parent).gameGUI.hlpControl.showHelp(8);
Game(parent).gameGUI.hlpControl.txt.text = ("Wave " + sVar["WaveNum"]);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
sVar["WaveCnt"] = 6;
_local4 = 0;
while (_local4 < 3) {
addActor("AlienSaw", ("unit" + _local4), (pointWave1.x + ageMath.RandomInt(-200, 200)), (pointWave1.y - ageMath.RandomInt(200, 200))).alwaysSeeEnemy = true;
_local4++;
};
_local4 = 3;
while (_local4 < 6) {
addActor("AlienSaw", ("unit" + _local4), (pointWave2.x + ageMath.RandomInt(-200, 200)), (pointWave2.y - ageMath.RandomInt(200, 200))).alwaysSeeEnemy = true;
_local4++;
};
} else {
if (sVar["WaveNum"] == 1){
_local5 = sVar;
_local6 = "WaveNum";
_local7 = (_local5[_local6] + 1);
_local5[_local6] = _local7;
Game(parent).gameGUI.hlpControl.showHelp(8);
Game(parent).gameGUI.hlpControl.txt.text = ("Wave " + sVar["WaveNum"]);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
sVar["WaveCnt"] = 6;
_local4 = 0;
while (_local4 < 3) {
addActor("AlienSaw", ("unit" + _local4), (pointWave1.x + ageMath.RandomInt(-200, 200)), (pointWave1.y - ageMath.RandomInt(200, 200))).alwaysSeeEnemy = true;
_local4++;
};
_local4 = 3;
while (_local4 < 6) {
addActor("AlienSaw", ("unit" + _local4), (pointWave2.x + ageMath.RandomInt(-200, 200)), (pointWave2.y - ageMath.RandomInt(200, 200))).alwaysSeeEnemy = true;
_local4++;
};
} else {
if (sVar["WaveNum"] == 2){
_local5 = sVar;
_local6 = "WaveNum";
_local7 = (_local5[_local6] + 1);
_local5[_local6] = _local7;
Game(parent).gameGUI.hlpControl.showHelp(8);
Game(parent).gameGUI.hlpControl.txt.text = ("Wave " + sVar["WaveNum"]);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
sVar["WaveCnt"] = 6;
_local4 = 0;
while (_local4 < 2) {
addActor("AlienSaw", ("unit" + _local4), (pointWave1.x + ageMath.RandomInt(-200, 200)), (pointWave1.y - ageMath.RandomInt(200, 200))).alwaysSeeEnemy = true;
_local4++;
};
_local4 = 2;
while (_local4 < 4) {
addActor("AlienSaw", ("unit" + _local4), (pointWave2.x + ageMath.RandomInt(-200, 200)), (pointWave2.y - ageMath.RandomInt(200, 200))).alwaysSeeEnemy = true;
_local4++;
};
addActor("AlienHunter", ("unit" + 5), (pointWave3.x + ageMath.RandomInt(-200, 200)), (pointWave3.y - ageMath.RandomInt(200, 200))).alwaysSeeEnemy = true;
} else {
if (sVar["WaveNum"] == 3){
if (!sVar["DlgBarneyEnd"]){
if (sVar["DlgBarneyTimer"] == 0){
if (sVar["DlgBarneyState"] == 0){
_local1 = Game(parent).gameGUI.dlg.setTo("lev7_TedBarney01");
_local5 = sVar;
_local6 = "DlgBarneyState";
_local7 = (_local5[_local6] + 1);
_local5[_local6] = _local7;
sVar["DlgBarneyTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
addProp_MedKit(ageMath.RandomInt((triggerLeftBarrier.x + 10), (triggerRightBarrier.x - 10)), pointWave3.y);
addProp_MedKit(ageMath.RandomInt((triggerLeftBarrier.x + 10), (triggerRightBarrier.x - 10)), pointWave3.y);
addProp_minigunAmmo(ageMath.RandomInt((triggerLeftBarrier.x + 10), (triggerRightBarrier.x - 10)), pointWave3.y);
addProp_minigunAmmo(ageMath.RandomInt((triggerLeftBarrier.x + 10), (triggerRightBarrier.x - 10)), pointWave3.y);
addProp_blasterAmmo(ageMath.RandomInt((triggerLeftBarrier.x + 10), (triggerRightBarrier.x - 10)), pointWave3.y);
addProp_blasterAmmo(ageMath.RandomInt((triggerLeftBarrier.x + 10), (triggerRightBarrier.x - 10)), pointWave3.y);
addProp_blasterAmmo(ageMath.RandomInt((triggerLeftBarrier.x + 10), (triggerRightBarrier.x - 10)), pointWave3.y);
} else {
if (sVar["DlgBarneyState"] == 1){
_local1 = Game(parent).gameGUI.dlg.setTo("lev7_TedBarney02");
_local5 = sVar;
_local6 = "DlgBarneyState";
_local7 = (_local5[_local6] + 1);
_local5[_local6] = _local7;
sVar["DlgBarneyTimer"] = int((_local1 * dlgSpeedFactor));
} else {
sVar["DlgBarneyEnd"] = true;
musicEnv.fadeTo("FatalDamage");
Game(parent).gameGUI.dlg.startFadeOut();
_local5 = sVar;
_local6 = "WaveNum";
_local7 = (_local5[_local6] + 1);
_local5[_local6] = _local7;
Game(parent).gameGUI.hlpControl.showHelp(8);
Game(parent).gameGUI.hlpControl.txt.text = ("Wave " + sVar["WaveNum"]);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
sVar["WaveCnt"] = 3;
addActor("AlienHunter", ("unit" + 0), (pointWave1.x + ageMath.RandomInt(-200, 200)), (pointWave1.y - ageMath.RandomInt(200, 200))).alwaysSeeEnemy = true;
addActor("AlienHunter", ("unit" + 1), (pointWave2.x + ageMath.RandomInt(-200, 200)), (pointWave2.y - ageMath.RandomInt(200, 200))).alwaysSeeEnemy = true;
addActor("AlienElectro", ("unit" + 2), (pointWave3.x + ageMath.RandomInt(-200, 200)), (pointWave3.y - ageMath.RandomInt(200, 200))).alwaysSeeEnemy = true;
};
};
} else {
_local5 = sVar;
_local6 = "DlgBarneyTimer";
_local7 = (_local5[_local6] - 1);
_local5[_local6] = _local7;
if (Controls.keyNew[69]){
sVar["DlgBarneyTimer"] = 0;
};
};
};
} else {
if (sVar["WaveNum"] == 4){
_local5 = sVar;
_local6 = "WaveNum";
_local7 = (_local5[_local6] + 1);
_local5[_local6] = _local7;
Game(parent).gameGUI.hlpControl.showHelp(8);
Game(parent).gameGUI.hlpControl.txt.text = ("Wave " + sVar["WaveNum"]);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
sVar["WaveCnt"] = 6;
_local4 = 0;
while (_local4 < 2) {
addActor("AlienSaw", ("unit" + _local4), (pointWave1.x + ageMath.RandomInt(-200, 200)), (pointWave1.y - ageMath.RandomInt(200, 200))).alwaysSeeEnemy = true;
_local4++;
};
_local4 = 2;
while (_local4 < 4) {
addActor("AlienSaw", ("unit" + _local4), (pointWave2.x + ageMath.RandomInt(-200, 200)), (pointWave2.y - ageMath.RandomInt(200, 200))).alwaysSeeEnemy = true;
_local4++;
};
addActor("AlienElectro", ("unit" + 5), (pointWave3.x + ageMath.RandomInt(-200, 200)), (pointWave3.y - ageMath.RandomInt(200, 200))).alwaysSeeEnemy = true;
} else {
if (sVar["WaveNum"] == 5){
if (!sVar["DlgBarney2End"]){
if (sVar["DlgBarney2Timer"] == 0){
if (sVar["DlgBarney2State"] == 0){
_local1 = Game(parent).gameGUI.dlg.setTo("lev7_TedBarney03");
_local5 = sVar;
_local6 = "DlgBarney2State";
_local7 = (_local5[_local6] + 1);
_local5[_local6] = _local7;
sVar["DlgBarney2Timer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
addProp_MedKit(ageMath.RandomInt((triggerLeftBarrier.x + 10), (triggerRightBarrier.x - 10)), pointWave3.y);
addProp_MedKit(ageMath.RandomInt((triggerLeftBarrier.x + 10), (triggerRightBarrier.x - 10)), pointWave3.y);
addProp_minigunAmmo(ageMath.RandomInt((triggerLeftBarrier.x + 10), (triggerRightBarrier.x - 10)), pointWave3.y);
addProp_minigunAmmo(ageMath.RandomInt((triggerLeftBarrier.x + 10), (triggerRightBarrier.x - 10)), pointWave3.y);
addProp_blasterAmmo(ageMath.RandomInt((triggerLeftBarrier.x + 10), (triggerRightBarrier.x - 10)), pointWave3.y);
addProp_blasterAmmo(ageMath.RandomInt((triggerLeftBarrier.x + 10), (triggerRightBarrier.x - 10)), pointWave3.y);
} else {
sVar["DlgBarney2End"] = true;
musicEnv.fadeTo("roboAttack");
Game(parent).gameGUI.dlg.startFadeOut();
_local5 = sVar;
_local6 = "WaveNum";
_local7 = (_local5[_local6] + 1);
_local5[_local6] = _local7;
Game(parent).gameGUI.hlpControl.showHelp(8);
Game(parent).gameGUI.hlpControl.txt.text = ("Wave " + sVar["WaveNum"]);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
sVar["WaveCnt"] = 1;
addActor("AlienBomber", ("unit" + 0), (pointWave3.x + ageMath.RandomInt(-200, 200)), (pointWave3.y - ageMath.RandomInt(200, 200))).alwaysSeeEnemy = true;
};
} else {
_local5 = sVar;
_local6 = "DlgBarney2Timer";
_local7 = (_local5[_local6] - 1);
_local5[_local6] = _local7;
if (Controls.keyNew[69]){
sVar["DlgBarney2Timer"] = 0;
};
};
};
} else {
if (sVar["WaveNum"] == 6){
if (!sVar["DlgBarney3End"]){
if (sVar["DlgBarney3Timer"] == 0){
if (sVar["DlgBarney3State"] == 0){
_local1 = Game(parent).gameGUI.dlg.setTo("lev7_TedBarney04");
_local5 = sVar;
_local6 = "DlgBarney3State";
_local7 = (_local5[_local6] + 1);
_local5[_local6] = _local7;
sVar["DlgBarney3Timer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
} else {
if (sVar["DlgBarney3State"] == 1){
_local1 = Game(parent).gameGUI.dlg.setTo("lev7_TedBarney05");
_local5 = sVar;
_local6 = "DlgBarney3State";
_local7 = (_local5[_local6] + 1);
_local5[_local6] = _local7;
sVar["DlgBarney3Timer"] = int((_local1 * dlgSpeedFactor));
} else {
sVar["DlgBarney3End"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
_local5 = sVar;
_local6 = "WaveNum";
_local7 = (_local5[_local6] + 1);
_local5[_local6] = _local7;
};
};
} else {
_local5 = sVar;
_local6 = "DlgBarney3Timer";
_local7 = (_local5[_local6] - 1);
_local5[_local6] = _local7;
if (Controls.keyNew[69]){
sVar["DlgBarney3Timer"] = 0;
};
};
};
};
};
};
};
};
};
};
if (sVar["WaveNum"] == 7){
if (!Game(parent).gameGUI.dlg.visible){
sVar["isWaveEnd"] = true;
isWin = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuWinLose.startFadeIn();
Game(root).menuWinLose.setToWin();
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
musicEnv.fadeTo("musWin");
return;
};
};
};
};
}
public function UpdateProjObjects():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < projObjects.length) {
if (projObjects[_local1].visible == false){
} else {
if (projObjects[_local1].gravityEnable){
projObjects[_local1].Velocity.y = (projObjects[_local1].Velocity.y + (grav * projObjects[_local1].gravityFactor));
projObjects[_local1].Velocity.y = ((projObjects[_local1].Velocity.y)>projObjects[_local1].maxSpeed.y) ? projObjects[_local1].maxSpeed.y : projObjects[_local1].Velocity.y;
};
projObjects[_local1].updateDynObj();
if (!projObjects[_local1].fromGoodGuy){
if (((!(hero.dead)) && (hero.hitTestProj(projObjects[_local1])))){
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
} else {
hero.transmitDamage(projObjects[_local1]);
Game(parent).gameGUI.painFrame.startFadeOut();
};
};
} else {
_local2 = 0;
while (_local2 < enemies.length) {
if (((!(enemies[_local2].dead)) && (enemies[_local2].hitTestProj(projObjects[_local1])))){
mainGlobal.shootingInEnemies++;
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
} else {
enemies[_local2].transmitDamage(projObjects[_local1]);
};
};
_local2++;
};
};
if (ageMath.Distance(projObjects[_local1].x, projObjects[_local1].y, hero.x, hero.y) > 670){
projObjects[_local1].visible = false;
};
if (testIntersectLimiterOnScr(projObjects[_local1])){
projObjects[_local1].visible = false;
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
};
};
};
_local1++;
};
}
function frame1(){
initFirst = true;
}
public function addFX_Splatters(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxBloodSpatters();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function cleenUP_FX():void{
var _local1:int;
_local1 = 0;
while (_local1 < fxObjects.length) {
if (((fxObjects[_local1]) && ((fxObjects[_local1].visible == false)))){
if (fxObjects[_local1]){
if (fxObjects[_local1].parent){
fxObjects[_local1].parent.removeChild(fxObjects[_local1]);
};
};
fxObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function term(){
var _local1:int;
removeEventListener(Event.ENTER_FRAME, Update);
_local1 = 0;
while (_local1 < enemies.length) {
enemies[_local1].clearActorObject();
_local1++;
};
_local1 = 0;
while (_local1 < dynObjects.length) {
dynObjects[_local1].clearDynObject();
_local1++;
};
dynObjects = [];
enemies = [];
goodNPC = [];
projObjects = [];
paralaxObjects = [];
chunkObjects = [];
fxObjects = [];
propObjects = [];
addActorsArr = [];
limitersCache = [];
limitersOnScr = [];
limiters = [];
}
public function testRayToLimiterOnScr(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean=false, _arg6:Object=null):ageVector{
var _local10:int;
var _local11:ageVector;
var _local12:Number;
var _local13:ageVector;
var _local14:Number;
var _local7:ageVector;
var _local8:ageVector = new ageVector(_arg1, _arg3);
var _local9:Number = Number.MAX_VALUE;
_local10 = 0;
while (_local10 < limitersOnScr.length) {
if (!limitersOnScr[_local10].slimMode){
_local11 = ageMath.getLineCrossRect(_arg1, _arg2, _arg3, _arg4, limitersOnScr[_local10].x, limitersOnScr[_local10].y, (limitersOnScr[_local10].x + limitersOnScr[_local10].width), (limitersOnScr[_local10].y + limitersOnScr[_local10].height));
if (_local11 != null){
if (_local7 == null){
_local7 = new ageVector();
_local7.copy(_local11);
_local9 = ageMath.DistanceVec(_local8, _local7);
} else {
_local12 = ageMath.DistanceVec(_local8, _local11);
if (_local12 < _local9){
_local9 = _local12;
_local7.copy(_local11);
};
};
};
};
_local10++;
};
if (!_arg5){
return (_local7);
};
_arg6.id = -1;
_local10 = 0;
while (_local10 < enemies.length) {
if (enemies[_local10].dead){
} else {
_local13 = enemies[_local10].hitTestLine(_arg1, _arg2, _arg3, _arg4);
if (_local13 != null){
if (_local7 == null){
_local7 = new ageVector();
_local7.copy(_local13);
_arg6.id = _local10;
_local9 = ageMath.DistanceVec(_local8, _local7);
} else {
_local14 = ageMath.DistanceVec(_local8, _local13);
if (_local14 < _local9){
_local9 = _local14;
_arg6.id = _local10;
_local7.copy(_local13);
};
};
};
};
_local10++;
};
return (_local7);
}
public function addProp_Coin(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propCoin();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_Dynamite(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propDynamite();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_MedKit(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new dropMedKit();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addFX_Headshot(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxHeadshot();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function UpdatePropObjects():void{
var _local1:int;
_local1 = 0;
while (_local1 < propObjects.length) {
if (propObjects[_local1].visible == false){
} else {
if (ageMath.Distance(propObjects[_local1].x, propObjects[_local1].y, hero.x, hero.y) >= (stage.stageWidth * 1.6)){
} else {
propObjects[_local1].x = (propObjects[_local1].x + propObjects[_local1].speed.x);
if (propObjects[_local1].useRotateSpeed){
propObjects[_local1].body.rotation = (propObjects[_local1].body.rotation + propObjects[_local1].rotateSpeed);
};
if ((((((((((((propObjects[_local1].propType == "Med")) || ((propObjects[_local1].propType == "Coin")))) || ((propObjects[_local1].propType == "Money")))) || ((propObjects[_local1].propType == "Weapon")))) || ((propObjects[_local1].propType == "Item")))) || ((propObjects[_local1].propType == "Ammo")))){
if (hero.hitTestObject(propObjects[_local1])){
if (propObjects[_local1].propType == "Ammo"){
if (hero.weapons[propObjects[_local1].wepNum].active){
if (hero.weapons[propObjects[_local1].wepNum].bulletsNum < hero.weapons[propObjects[_local1].wepNum].bulletsNumMax){
propObjects[_local1].visible = false;
hero.weapons[propObjects[_local1].wepNum].bulletsNum = (hero.weapons[propObjects[_local1].wepNum].bulletsNum + (hero.weapons[propObjects[_local1].wepNum].bulletsInCatrigeMax * propObjects[_local1].moneyAmount));
if (hero.weapons[propObjects[_local1].wepNum].bulletsNum > hero.weapons[propObjects[_local1].wepNum].bulletsNumMax){
hero.weapons[propObjects[_local1].wepNum].bulletsNum = hero.weapons[propObjects[_local1].wepNum].bulletsNumMax;
};
sounds.PlaySnd((hero.weapons[propObjects[_local1].wepNum].type + "Reloaded"));
};
};
} else {
if (propObjects[_local1].propType == "Med"){
if (hero.life < hero.lifeMax){
propObjects[_local1].visible = false;
hero.life = (hero.life + propObjects[_local1].moneyAmount);
if (hero.life > hero.lifeMax){
hero.life = hero.lifeMax;
};
sounds.PlaySnd("Med");
};
} else {
if (propObjects[_local1].propType == "Item"){
propObjects[_local1].visible = false;
hero.itemsInBag.push(propObjects[_local1].itemName);
sounds.PlaySnd("itemTake");
} else {
if (propObjects[_local1].propType == "Weapon"){
propObjects[_local1].visible = false;
hero.weapons[propObjects[_local1].wepNum].active = true;
hero.curWeaponNum = (propObjects[_local1].wepNum + 1);
sounds.PlaySnd((hero.weapons[(hero.curWeaponNum - 1)].type + "Reloaded"));
} else {
propObjects[_local1].visible = false;
sounds.PlaySnd((propObjects[_local1].propType + "1"));
hero.moneyCnt = (hero.moneyCnt + propObjects[_local1].moneyAmount);
mainGlobal.moneyCollected = (mainGlobal.moneyCollected + propObjects[_local1].moneyAmount);
};
};
};
};
};
};
};
};
_local1++;
};
}
public function addProp_Money1(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMoney1();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_Money2(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMoney2();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
function showGameMenu():void{
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
Game(root).menuInGame.visible = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuInGame.startFadeIn();
}
public function addProj_Psy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new psyProj();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
_local6.gravityComp = false;
_local6.infAmmo = true;
_local6.usePsyDamage = true;
_local6.psyDamageVal = 16;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProj_MinigunBeam(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
var _local10:ageVector = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local10.normThis();
_local10.mulScalar(600);
_arg3 = (_local10.x + _arg1);
_arg4 = (_local10.y + _arg2);
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projMinigunBeam();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.gravityEnable = false;
var _local11:Object = {id:-1};
var _local12:ageVector = testRayToLimiterOnScr(_arg1, _arg2, _arg3, _arg4, true, _local11);
if (_local12 != null){
_arg3 = _local12.x;
_arg4 = _local12.y;
if (_local11.id != -1){
mainGlobal.shootingInEnemies++;
addLineDamageToEnemy(_local12, _arg5.damage, enemies[_local11.id], true);
};
};
_local6.scaleX = (ageMath.Distance(_arg1, _arg2, _arg3, _arg4) / 34);
_local6.rotation = _local8;
var _local13:Array = new Array();
_local13.push(new GlowFilter(0xFFFF00, 1, 15, 15, 4, BitmapFilterQuality.MEDIUM));
_local6.filters = _local13;
if (_arg5 != null){
};
this["FXLayer"].addChild(_local6);
fxObjects.push(_local6);
return (_local6);
}
public function addProj_LaserBeam(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
var _local10:ageVector = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local10.normThis();
_local10.mulScalar(600);
_arg3 = (_local10.x + _arg1);
_arg4 = (_local10.y + _arg2);
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projLaserBeam();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.gravityEnable = false;
var _local11:ageVector = testRayToLimiterOnScr(_arg1, _arg2, _arg3, _arg4);
if (_local11 != null){
_arg3 = _local11.x;
_arg4 = _local11.y;
};
if (addLineDamage(_arg1, _arg2, _arg3, _arg4, _arg5.damage)){
mainGlobal.shootingInEnemies++;
};
_local6.scaleX = (ageMath.Distance(_arg1, _arg2, _arg3, _arg4) / 34);
_local6.rotation = _local8;
_local6.use_force_restart = true;
_local6.fadeSpeed = 0.1;
_local6.startFadeOut();
_local6.gravityEnable = false;
var _local12:Array = new Array();
_local12.push(new GlowFilter(0xFF0000, 1, 15, 15, 1.7, BitmapFilterQuality.MEDIUM));
_local6.filters = _local12;
if (_arg5 != null){
};
this["FXLayer"].addChild(_local6);
fxObjects.push(_local6);
return (_local6);
}
public function addFX_littleBlast(_arg1:Number, _arg2:Number, _arg3:Number=1.5){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
addBlinkFX_OverLight();
_local4 = new fxBlast();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.blendMode = BlendMode.SCREEN;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function addProj(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projBullet();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, 24);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = true;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProp_Debris(_arg1:Number, _arg2:Number, _arg3:Number=1, _arg4:String=""):propObject{
var _local5:propObject;
_local5 = new propDebris();
_local5.x = _arg1;
_local5.y = _arg2;
_local5.speed.y = (ageMath.Random(-6, -18) * _arg3);
_local5.speed.x = (ageMath.Random(-10, 10) * _arg3);
if (_arg4.length){
_local5.gotoAndStop(_arg4);
} else {
_local5.gotoAndStop(ageMath.RandomInt(1, 20));
};
_local5.curLevel = this;
dynObjects.push(_local5);
propObjects.push(_local5);
_local5.isRubber = true;
_local5.stayTime = (3000 + ageMath.RandomInt(1, 2000));
_local5.timerStayDelay.start();
_local5.useRotateSpeed = true;
_local5.rotateSpeed = ageMath.RandomInt(-15, 15);
propLayer.addChild(_local5);
return (_local5);
}
public function addProj_Rocket(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projRocket();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = true;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
_local6.blastStyle = _arg5.blastStyle;
_local6.attackRadius = _arg5.damageRadius;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProj_BombWep(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projBombWep();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
_local6.blastStyle = _arg5.blastStyle;
_local6.attackRadius = _arg5.damageRadius;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function ifMCOnScreen(_arg1:MovieClip):Boolean{
var _local2:Point = this.localToGlobal(new Point(_arg1.x, _arg1.y));
var _local3:Rectangle = _arg1.getBounds(root);
var _local4:Rectangle = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
if (_local4.intersects(_local3)){
return (true);
};
return (false);
}
public function addLimiter(_arg1){
limiters.push(_arg1);
}
public function alignObjXToAnother(_arg1, _arg2):void{
if ((_arg1.x - (_arg1.width * 0.5)) < _arg2.x){
_arg1.x = (_arg1.x + (_arg2.x - (_arg1.x - (_arg1.width * 0.5))));
};
if ((_arg1.x + (_arg1.width * 0.5)) > (_arg2.x + _arg2.width)){
_arg1.x = (_arg1.x - ((_arg1.x + (_arg1.width * 0.5)) - (_arg2.x + _arg2.width)));
};
}
public function levInit(){
mainGlobal.secretsAll = 0;
curLevNum = 7;
curLevScore = 3000;
levelMus = "musTrasher";
musicEnv.fadeTo(levelMus);
Game(parent).sky.visible = true;
sVar["isWaveEnd"] = false;
sVar["WaveNum"] = 0;
sVar["WaveCnt"] = 0;
sVar["DlgBarneyState"] = 0;
sVar["DlgBarneyTimer"] = 0;
sVar["DlgBarneyEnd"] = false;
sVar["DlgBarney2State"] = 0;
sVar["DlgBarney2Timer"] = 0;
sVar["DlgBarney2End"] = false;
sVar["DlgBarney3State"] = 0;
sVar["DlgBarney3Timer"] = 0;
sVar["DlgBarney3End"] = false;
}
public function addActor(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:int=-1):actorObject{
var _local6:actorObject;
if (_arg1 == "AlienSaw"){
_local6 = new AlienSaw();
} else {
if (_arg1 == "AlienHunter"){
_local6 = new AlienHunter();
} else {
if (_arg1 == "AlienElectro"){
_local6 = new AlienElectro();
} else {
if (_arg1 == "Zomb01"){
_local6 = new Zomb01();
} else {
if (_arg1 == "Zomb02"){
_local6 = new Zomb02();
} else {
if (_arg1 == "Zomb03"){
_local6 = new Zomb03();
} else {
if (_arg1 == "Zomb04"){
_local6 = new Zomb04();
} else {
if (_arg1 == "Zomb05"){
_local6 = new Zomb05();
} else {
if (_arg1 == "Zomb01Run"){
_local6 = new Zomb01Run();
} else {
if (_arg1 == "Zomb02Run"){
_local6 = new Zomb02Run();
} else {
if (_arg1 == "Zomb03Run"){
_local6 = new Zomb03Run();
} else {
if (_arg1 == "Zomb04Run"){
_local6 = new Zomb04Run();
} else {
if (_arg1 == "Zomb05Run"){
_local6 = new Zomb05Run();
} else {
if (_arg1 == "Zomb01Vomit"){
_local6 = new Zomb01Vomit();
} else {
if (_arg1 == "Zomb02Vomit"){
_local6 = new Zomb02Vomit();
} else {
if (_arg1 == "Zomb03Vomit"){
_local6 = new Zomb03Vomit();
} else {
if (_arg1 == "Zomb04Vomit"){
_local6 = new Zomb04Vomit();
} else {
if (_arg1 == "Zomb05Vomit"){
_local6 = new Zomb05Vomit();
} else {
if (_arg1 == "Spider"){
_local6 = new Spider();
} else {
if (_arg1 == "AlienBomber"){
_local6 = new AlienBomber();
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
_local6.x = _arg3;
_local6.y = _arg4;
_local6.name = _arg2;
if (!_local6.noStatEnemy){
mainGlobal.enemiesAll++;
};
if (_arg5 < 0){
addChild(_local6);
} else {
addChildAt(_local6, _arg5);
};
return (_local6);
}
public function addExplotion(_arg1:projObject, _arg2:actorObject=null):void{
var _local3:Number;
var _local5:int;
_local3 = ageMath.Distance(_arg1.x, _arg1.y, hero.x, hero.y);
var _local4:projObject = new projObject();
if (_local3 < _arg1.attackRadius){
_local4.damage = ageMath.RemapVal(_local3, 0, _arg1.attackRadius, _arg1.damage, 0);
_local4.x = hero.x;
_local4.y = (hero.y - (hero.height / 2));
_local4.fromGoodGuy = false;
hero.transmitDamage(_local4);
Game(parent).gameGUI.painFrame.startFadeOut();
_local4.clearDynObject();
};
_local5 = 0;
while (_local5 < enemies.length) {
if (((((enemies[_local5].dead) && (!((_arg2 == null))))) && (!((_arg2 == enemies[_local5]))))){
} else {
_local3 = ageMath.Distance(_arg1.x, _arg1.y, enemies[_local5].x, enemies[_local5].y);
if (_local3 < _arg1.attackRadius){
_local4.damage = ageMath.RemapVal(_local3, 0, _arg1.attackRadius, _arg1.damage, 0);
_local4.x = enemies[_local5].x;
_local4.y = (enemies[_local5].y - (enemies[_local5].height / 2));
_local4.fromGoodGuy = true;
enemies[_local5].transmitDamage(_local4);
_local4.clearDynObject();
};
};
_local5++;
};
}
public function addProp_minigunAmmo(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMinigunAmmo();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addFX_BlastWave(_arg1:Number, _arg2:Number, _arg3:Number=1){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
_local4 = new fxBlastWave();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function Update(_arg1:Event):void{
var _local5:int;
var _local6:*;
var _local7:*;
var _local11:int;
var _local12:addActorStruct;
var _local13:int;
var _local14:Number;
var _local15:Array;
var _local16:ColorMatrix;
if (isWin){
hero.body.stop();
return;
};
if (((((mainGlobal.paused) || (!(visible)))) || (!((parent as Game))))){
return;
};
if ((((hero.life <= 0)) && (!(isLose)))){
isLose = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuWinLose.startFadeIn();
Game(root).menuWinLose.setToLose();
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
musicEnv.fadeTo("musLose");
sounds.PlaySnd(("TedDie" + ageMath.RandomInt(1, 2).toString()), 0.8);
return;
};
if (initFirst){
if (((!(mainGlobal.configMusicOn)) && (!(mainGlobal.configSoundOn)))){
Game(parent).gamButSnd.gotoAndStop(2);
} else {
Game(parent).gamButSnd.gotoAndStop(1);
};
initFirst = false;
initLimCache();
Game(parent).fadeBG.fadeSpeed = 0.03;
Game(parent).fadeBG.use_force_restart = true;
Game(parent).fadeBG.startFadeOut();
Game(parent).gameGUI.hlpControl.visible = false;
Game(parent).gameGUI.dlg.visible = false;
Game(parent).gameGUI.dlgIco.x = -500;
_local6 = (hero.x * this.scaleX);
_local7 = ((hero.y - 95) * this.scaleY);
x = -((_local6 - (stage.stageWidth * 0.5)));
y = -((_local7 - (stage.stageHeight * 0.5)));
mainGlobal.initStat();
_local11 = 0;
_local11 = 0;
while (_local11 < enemies.length) {
if (!enemies[_local11].noStatEnemy){
mainGlobal.enemiesAll++;
};
_local11++;
};
Game(parent).sky.visible = true;
levInit();
if (mainGlobal.isSingleEp){
if (curLevNum == 1){
_local5 = 0;
while (_local5 < 1) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 0;
} else {
if (curLevNum == 2){
_local5 = 0;
while (_local5 < 2) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 200;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
} else {
if (curLevNum == 3){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
} else {
if (curLevNum == 4){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1300;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
} else {
if (curLevNum == 5){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1500;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
} else {
if (curLevNum == 6){
_local5 = 0;
while (_local5 < 4) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 2000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
} else {
if (curLevNum == 7){
_local5 = 0;
while (_local5 < 5) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 3000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
} else {
if (curLevNum == 8){
_local5 = 0;
while (_local5 < 5) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 3500;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
} else {
if (curLevNum == 9){
_local5 = 0;
while (_local5 < 6) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = 5;
hero.moneyCnt = 4000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
hero.applyUpgrade(1, 4);
hero.upgradesLife[4].active = true;
} else {
if (curLevNum == 10){
_local5 = 0;
while (_local5 < 6) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = 5;
hero.moneyCnt = 4000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
hero.applyUpgrade(1, 4);
hero.upgradesLife[4].active = true;
};
};
};
};
};
};
};
};
};
};
};
Game(parent).gameGUI.dlgIco.gotoAndStop(1);
};
var _local2:int = getTimer();
cleenUP();
UpdateLimitersOnScr();
UpdateParalaxObjects();
UpdateDynObjects();
UpdatePropObjects();
UpdateEnemies();
UpdateProjObjects();
hero.updateActor();
hero.applyDamages();
hero.testIsActorDead();
if (addActorsArr.length){
while (addActorsArr.length) {
_local12 = addActorsArr.pop();
addActor(_local12.strClass, "", _local12.posx, _local12.posy, _local12.orderZ);
};
};
var _local3:int;
_local3 = 0;
while (_local3 < chunkObjects.length) {
if (ifMCOnScreen(chunkObjects[_local3])){
chunkObjects[_local3].visible = true;
} else {
chunkObjects[_local3].visible = false;
};
_local3++;
};
levScript();
var _local4:Boolean;
if (Controls.key[Keyboard.F2]){
hero.life = 1;
};
if (Controls.key[Keyboard.ESCAPE]){
showGameMenu();
};
if (!hero.timerReloadDelay.running){
_local13 = 0;
while (_local13 < 8) {
if (((((Controls.key[(49 + _local13)]) && (!((hero.curWeaponNum == (_local13 + 1)))))) && (hero.weapons[_local13].active))){
hero.curWeaponNum = (_local13 + 1);
sounds.PlaySnd((hero.weapons[(hero.curWeaponNum - 1)].type + "Reloaded"));
};
_local13++;
};
};
if (Game(root).cursor.currentLabel == "cross"){
_local14 = ageMath.Distance(hero.x, hero.y, (Controls.mousePosX - x), (Controls.mousePosY - y));
Game(root).cursor.shootAcc.scaleX = (Game(root).cursor.shootAcc.scaleY = ((hero.wepAcc * _local14) / hero.weapons[(hero.curWeaponNum - 1)].accDistScale));
};
_local5 = 0;
_local5 = 0;
while (_local5 < 8) {
if (((hero.weapons[_local5]) && (hero.weapons[_local5].active))){
if ((((hero.weapons[_local5].bulletsInCatrige == 0)) && ((hero.weapons[_local5].bulletsNum == 0)))){
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 2){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 2;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(-124);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
} else {
if (hero.curWeaponNum != (_local5 + 1)){
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 1){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 1;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(0);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
} else {
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 3){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 3;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(87);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
};
};
} else {
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 4){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 4;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 0.5;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(0);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
};
_local5++;
};
Game(parent).gameGUI.wepInfo.catTxt.text = ((hero.weapons[(hero.curWeaponNum - 1)].bulletsInCatrige + "/") + hero.weapons[(hero.curWeaponNum - 1)].bulletsInCatrigeMax);
if (!hero.weapons[(hero.curWeaponNum - 1)].infAmmo){
Game(parent).gameGUI.wepInfo.allTxt.text = hero.weapons[(hero.curWeaponNum - 1)].bulletsNum;
} else {
Game(parent).gameGUI.wepInfo.allTxt.text = "INF";
};
Game(parent).gameGUI.wepInfo.pic.gotoAndStop((hero.curWeaponNum + 4));
if ((hero.x - (hero.width * 0.5)) < levLeftLim){
hero.x = (levLeftLim + (hero.width * 0.5));
} else {
if ((hero.x + (hero.width * 0.5)) > levRightLim){
hero.x = (levRightLim - (hero.width * 0.5));
};
};
_local6 = ageMath.Lerp((Controls.mousePosX - x), (hero.x * scaleX), 0.6);
_local7 = ageMath.Lerp((Controls.mousePosY - y), ((hero.y - 95) * scaleY), 0.6);
if (!_local4){
x = Math.round(ageMath.Lerp(x, -((_local6 - (stage.stageWidth * 0.5))), 0.15));
y = Math.round(ageMath.Lerp(y, -((_local7 - (stage.stageHeight * 0.5))), 0.15));
} else {
x = -((_local6 - (stage.stageWidth * 0.5)));
y = -((_local7 - (stage.stageHeight * 0.5)));
};
if (this["blackScr"]){
this["blackScr"].x = -(x);
this["blackScr"].y = -(y);
};
var _local8:Point = this.localToGlobal(new Point(levLeftLim, 0));
var _local9:Point = this.localToGlobal(new Point(levRightLim, 0));
if (_local8.x > 0){
x = (x - _local8.x);
} else {
if (_local9.x < stage.stageWidth){
x = (x + (stage.stageWidth - _local9.x));
};
};
if (curBlastShake > 0){
x = (x + ageMath.Random(-(curBlastShake), curBlastShake));
y = (y + ageMath.Random(-(curBlastShake), curBlastShake));
curBlastShake = (curBlastShake - curBlastShakeDec);
if (curBlastShake < 0){
curBlastShake = 0;
};
};
Game(parent).gameGUI.lifeBar.gotoAndStop(Math.round(ageMath.RemapVal(Math.round(hero.life), 1, hero.lifeMax, 1, 100)));
Game(parent).gameGUI.lifeBar.width = ageMath.RemapVal(Math.round(hero.lifeMax), 100, 300, 108, 227);
Game(parent).gameGUI.txtMoney.text = ("$" + hero.moneyCnt);
var _local10:int;
_local10 = 0;
while (_local10 < 6) {
if (hero.itemsInBag[_local10]){
Game(parent).gameGUI[("itm" + _local10)].gotoAndStop(hero.itemsInBag[_local10]);
} else {
Game(parent).gameGUI[("itm" + _local10)].gotoAndStop(1);
};
_local10++;
};
if (hero.bioMaxLevel > 0){
Game(parent).gameGUI.hazBio.visible = true;
Game(parent).gameGUI.hazBio.gotoAndStop((100 - int(ageMath.RemapVal(hero.bioCurLevel, 0, hero.bioMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazBio.visible = false;
};
if (hero.psyMaxLevel > 0){
Game(parent).gameGUI.hazPsy.visible = true;
Game(parent).gameGUI.hazPsy.gotoAndStop((100 - int(ageMath.RemapVal(hero.psyCurLevel, 0, hero.psyMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazPsy.visible = false;
};
if (hero.electroMaxLevel > 0){
Game(parent).gameGUI.hazElectro.visible = true;
Game(parent).gameGUI.hazElectro.gotoAndStop((100 - int(ageMath.RemapVal(hero.electroCurLevel, 0, hero.electroMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazElectro.visible = false;
};
Controls.updateKeyNew();
if (Game(parent).groundBG){
Game(parent).groundBG.changeBG(x, y);
};
}
public function addFX_MetalSparks(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxMetalSparks();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.blendMode = BlendMode.ADD;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function addProp_blasterAmmo(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propBlasterAmmo();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_Blaster(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propBlaster();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function UpdateEnemies():void{
var _local1:int;
_local1 = 0;
while (_local1 < enemies.length) {
if (((enemies[_local1].dead) || ((enemies[_local1].life <= 0)))){
} else {
if (((((!((enemies[_local1].parent as Level))) || (enemies[_local1].alwaysSeeEnemy))) || ((ageMath.Distance(enemies[_local1].x, enemies[_local1].y, hero.x, hero.y) < (stage.stageWidth * 1.6))))){
enemies[_local1].updateActorEnemy();
};
};
_local1++;
};
}
public function addProj_Vomit(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projVomit();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.timerFXAdd.delay = 80;
_local6.timerFXAdd.start();
_local6.fxFunc = addFX_VomitSplatters;
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = true;
_local6.gravityComp = true;
_local6.infAmmo = true;
_local6.useBioDamage = true;
_local6.bioDamageVal = 10;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
}
}//package main
Section 85
//Level8 (main.Level8)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.ui.*;
public dynamic class Level8 extends Level {
var levRightLim:Number;// = 999999
var dlgSpeedFactor:Number;// = 4
var lastMSFrame:int;// = 9999
public var enemies:Array;
var levLeftLim:Number;// = -999999
public var unit1:MovieClip;
public var unit2:MovieClip;
public var unit3:MovieClip;
public var propObjects:Array;
public var minLimX:Number;// = 2147483647
public var levelRightBorder:MovieClip;
public var triggerBoss:MovieClip;
public var maxLimX:Number;// = -2147483648
var curBlastShake:Number;// = 0
var isWin:Boolean;// = false
public var dynObjects:Array;
var isLose:Boolean;// = false
var grav:Number;// = 1
public var triggerUpgrade1:MovieClip;
public var triggerUpgrade2:MovieClip;
public var limitersCache:Array;
public var boss:MovieClip;
var initFirst:Boolean;// = false
public var levelRightSeed:MovieClip;
var curLevNum:int;// = 1
public var FXLayer:MovieClip;
var levelMus:String;// = ""
public var triggerSecret1:MovieClip;
public var triggerSecret2:MovieClip;
public var propLayer:MovieClip;
var sVar:Object;
public var levelLeftBorder:MovieClip;
public var limitersOnScr:Array;
public var levelLeftSeed:MovieClip;
public var addActorsArr:Array;
public var limiters:Array;
public var paralaxObjects:Array;
var curLevScore:int;// = 3000
public var fxObjects:Array;
var curBlastShakeDec:Number;// = 0.3
public var goodNPC:Array;
public var chunkObjects:Array;
var curScale:Number;// = 1
public var limitersCacheStep:int;// = 640
public var projLayer:MovieClip;
public var projObjects:Array;
public var hero:MovieClip;
public function Level8(){
sVar = new Object();
limiters = new Array();
limitersCache = new Array();
limitersOnScr = new Array();
dynObjects = new Array();
enemies = new Array();
goodNPC = new Array();
paralaxObjects = new Array();
projObjects = new Array();
chunkObjects = new Array();
fxObjects = new Array();
propObjects = new Array();
addActorsArr = new Array();
super();
addFrameScript(0, frame1);
init();
}
public function addFX_VomitSplatters(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxVomitSpatters();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function initLimCache(){
var _local1:*;
var _local2:int;
var _local3:int;
var _local4:int;
maxLimX = int.MIN_VALUE;
minLimX = int.MAX_VALUE;
_local1 = 0;
while (_local1 < limiters.length) {
if (limiters[_local1].x < minLimX){
minLimX = limiters[_local1].x;
};
if ((limiters[_local1].x + limiters[_local1].width) > maxLimX){
maxLimX = limiters[_local1].x;
};
_local1++;
};
limitersCache = [];
_local1 = 0;
while (_local1 < (((maxLimX - minLimX) / limitersCacheStep) + 1)) {
limitersCache.push(new Array());
_local1++;
};
_local1 = 0;
while (_local1 < limiters.length) {
_local3 = int(((limiters[_local1].x - minLimX) / limitersCacheStep));
_local4 = int((((limiters[_local1].x + limiters[_local1].width) - minLimX) / limitersCacheStep));
_local2 = _local3;
while (_local2 <= _local4) {
if (!limitersCache[_local2]){
limitersCache[_local2] = new Array();
};
limitersCache[_local2].push(limiters[_local1]);
_local2++;
};
_local1++;
};
}
public function addLineDamage(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Boolean{
var _local6:Number;
var _local8:int;
var _local9:ageVector;
var _local7:Boolean;
_local8 = 0;
while (_local8 < enemies.length) {
if (enemies[_local8].dead){
} else {
_local9 = enemies[_local8].hitTestLine(_arg1, _arg2, _arg3, _arg4);
if (_local9 != null){
addLineDamageToEnemy(_local9, _arg5, enemies[_local8], true);
_local7 = true;
};
};
_local8++;
};
return (_local7);
}
public function checkHitPlatform(_arg1, _arg2:Array){
var _local3:int;
_arg1.bottomLimiter = null;
_local3 = 0;
while (_local3 < _arg2.length) {
if (((_arg2[_local3].slimMode) && ((_arg1.speed.y < 0)))){
} else {
if (_arg2[_local3].hitTestObject(_arg1.p2)){
_arg1.jump = false;
if (_arg1.isRubber){
_arg1.speed.y = (_arg1.speed.y * -(_arg1.rubberFactor));
_arg1.speed.x = (_arg1.speed.x * _arg1.rubberFactor);
if (_arg1.useRotateSpeed){
_arg1.rotateSpeed = 0;
};
} else {
_arg1.speed.y = 0;
};
_arg1.y = ((_arg2[_local3].y - _arg1.p2.y) - _arg1.p2.height);
_arg1.bottomLimiter = _arg2[_local3];
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p1)) && (!(_arg2[_local3].slimMode)))){
if (_arg1.scaleX > 0){
_arg1.x = (_arg2[_local3].x - (_arg1.p1.x + _arg1.p1.width));
} else {
_arg1.x = ((_arg2[_local3].x + _arg2[_local3].width) + (_arg1.p1.x + _arg1.p1.width));
};
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p3)) && (!(_arg2[_local3].slimMode)))){
if (_arg1.scaleX > 0){
_arg1.x = ((_arg2[_local3].x + _arg2[_local3].width) - _arg1.p3.x);
} else {
_arg1.x = (_arg2[_local3].x - (-(_arg1.p3.x) + _arg1.p3.width));
};
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p4)) && (!(_arg2[_local3].slimMode)))){
_arg1.speed.y = 0;
_arg1.y = ((_arg2[_local3].y + _arg2[_local3].height) - _arg1.p4.y);
};
};
};
};
};
_local3++;
};
}
public function openUpgradeMenu():void{
mainGlobal.paused = true;
this.visible = false;
Game(root).cursor.gotoAndStop("arrow");
Game(parent).menuUpgradeShop.showShop();
musicEnv.fadeTo("musUpgrade");
}
public function addFX_littleSmoke(_arg1:Number, _arg2:Number, _arg3:Number=1.5){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
_local4 = new fxLittleSmoke();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function init(){
addEventListener(Event.ENTER_FRAME, Update, false, 0, true);
}
public function UpdateParalaxObjects():void{
var _local1:int;
_local1 = 0;
while (_local1 < paralaxObjects.length) {
paralaxObjects[_local1].x = (paralaxObjects[_local1].saveX - ageMath.RemapVal((paralaxObjects[_local1].saveX + x), 0, stage.stageWidth, 0, paralaxObjects[_local1].paralaxX));
paralaxObjects[_local1].y = (paralaxObjects[_local1].saveY - ageMath.RemapVal((paralaxObjects[_local1].saveY + y), 0, stage.stageHeight, 0, paralaxObjects[_local1].paralaxY));
_local1++;
};
}
public function addBlinkFX_OverLight():void{
Game(parent).gameGUI.fxblink.fadeMaxLimit = 1;
Game(parent).gameGUI.fxblink.fadeSpeed = 0.03;
Game(parent).gameGUI.fxblink.use_force_restart = true;
Game(parent).gameGUI.fxblink.startFadeOut();
curBlastShake = 15;
}
public function cleenUP():void{
cleenUP_FX();
cleenUP_Proj();
cleenUP_Prop();
cleenUP_Actors();
}
function mouseLeave(_arg1:Event):void{
showGameMenu();
}
public function UpdateDynObjects():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = 0;
while (_local1 < dynObjects.length) {
if (dynObjects[_local1].visible == false){
} else {
if (ageMath.Distance(dynObjects[_local1].x, dynObjects[_local1].y, hero.x, hero.y) < (stage.stageWidth * 1.6)){
if (dynObjects[_local1].gravityEnable){
dynObjects[_local1].speed.y = (dynObjects[_local1].speed.y + (grav * dynObjects[_local1].gravityFactor));
};
dynObjects[_local1].speed.y = ((dynObjects[_local1].speed.y)>dynObjects[_local1].maxSpeed.y) ? dynObjects[_local1].maxSpeed.y : dynObjects[_local1].speed.y;
dynObjects[_local1].y = (dynObjects[_local1].y + dynObjects[_local1].speed.y);
if (dynObjects[_local1].collisionEnable){
_local2 = int((((dynObjects[_local1].x - dynObjects[_local1].width) - minLimX) / limitersCacheStep));
_local3 = int((((dynObjects[_local1].x + dynObjects[_local1].width) - minLimX) / limitersCacheStep));
_local4 = _local2;
while (_local4 <= _local3) {
if (((limitersCache[_local4]) && (limitersCache[_local4].length))){
checkHitPlatform(dynObjects[_local1], limitersCache[_local4]);
};
_local4++;
};
};
};
};
_local1++;
};
}
public function addLineDamageToEnemy(_arg1:ageVector, _arg2:Number, _arg3:actorObject, _arg4:Boolean){
var _local5:projObject = new projObject();
_local5.damage = _arg2;
_local5.x = _arg1.x;
_local5.y = _arg1.y;
_local5.fromGoodGuy = _arg4;
_arg3.transmitDamage(_local5);
_local5.clearDynObject();
}
public function addFX_BloodOnGround(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new bloodOnGround();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.gotoAndStop(ageMath.RandomInt(1, 5));
_local3.scaleY = 0.5;
_local3.fadeSpeed = 0.005;
_local3.startFadeOut();
projLayer.addChild(_local3);
_local3.curDispContainer = projLayer;
fxObjects.push(_local3);
return (_local3);
}
public function cleenUP_Proj():void{
var _local1:int;
_local1 = 0;
while (_local1 < projObjects.length) {
if (((projObjects[_local1]) && ((projObjects[_local1].visible == false)))){
projObjects[_local1].clearDynObject();
if (projObjects[_local1]){
if (projObjects[_local1].parent){
projObjects[_local1].parent.removeChild(projObjects[_local1]);
};
};
projObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function cleenUP_Actors():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < enemies.length) {
if (((((enemies[_local1]) && ((enemies[_local1].visible == false)))) && (enemies[_local1].dead))){
_local2 = 0;
while (_local2 < dynObjects.length) {
if (dynObjects[_local2] == enemies[_local1]){
dynObjects[_local2].clearDynObject();
dynObjects.splice(_local2, 1);
break;
};
_local2++;
};
enemies[_local1].clearActorObject();
if (enemies[_local1]){
if (enemies[_local1].parent){
enemies[_local1].parent.removeChild(enemies[_local1]);
};
};
enemies.splice(_local1, 1);
break;
};
_local1++;
};
}
public function addBlasterProj(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new blasterProj();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function cleenUP_Prop():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < propObjects.length) {
if (((propObjects[_local1]) && ((propObjects[_local1].visible == false)))){
_local2 = 0;
while (_local2 < dynObjects.length) {
if (dynObjects[_local2] == propObjects[_local1]){
dynObjects[_local2].clearDynObject();
dynObjects.splice(_local2, 1);
break;
};
_local2++;
};
if (propObjects[_local1]){
if (propObjects[_local1].parent){
propObjects[_local1].parent.removeChild(propObjects[_local1]);
};
};
propObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function testIntersectLimiterOnScr(_arg1:dynObject):Boolean{
var _local2:int;
_local2 = 0;
while (_local2 < limitersOnScr.length) {
if (((!(limitersOnScr[_local2].slimMode)) && (limitersOnScr[_local2].hitTestObject(_arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public function addProp_Shotgun(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propShotgun();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addBlinkFX_OverLight2():void{
Game(parent).gameGUI.fxblink2.fadeMaxLimit = 1;
Game(parent).gameGUI.fxblink2.fadeSpeed = 0.03;
Game(parent).gameGUI.fxblink2.use_force_restart = true;
Game(parent).gameGUI.fxblink2.startFadeOut();
}
public function addFX_BloodLeak(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new bloodLeak();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.fadeSpeed = 0.005;
_local3.startFadeOut();
projLayer.addChild(_local3);
_local3.curDispContainer = projLayer;
fxObjects.push(_local3);
return (_local3);
}
public function UpdateLimitersOnScr():void{
var _local1:int;
var _local2:int;
var _local3:*;
var _local4:int;
var _local5:Point;
var _local6:Rectangle;
var _local7:Rectangle;
limitersOnScr = [];
_local1 = int(((-(x) - minLimX) / limitersCacheStep));
_local2 = int((((-(x) + stage.stageWidth) - minLimX) / limitersCacheStep));
_local4 = _local1;
while (_local4 <= _local2) {
if (limitersCache[_local4]){
_local3 = 0;
while (_local3 < limitersCache[_local4].length) {
_local5 = this.localToGlobal(new Point(limitersCache[_local4][_local3].x, limitersCache[_local4][_local3].y));
_local6 = new Rectangle(_local5.x, _local5.y, limitersCache[_local4][_local3].width, limitersCache[_local4][_local3].height);
_local7 = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
if (_local7.intersects(_local6)){
limitersOnScr.push(limitersCache[_local4][_local3]);
};
_local3++;
};
};
_local4++;
};
}
public function levScript(){
var _local1:int;
if (!sVar["triggerUpgrade1"]){
if (!sVar["startBoss"]){
if (triggerUpgrade1.hitTestObject(hero)){
if (((Controls.keyNew[Keyboard.ENTER]) || (Controls.keyNew[69]))){
openUpgradeMenu();
};
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(5);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
} else {
if (!triggerUpgrade2.hitTestObject(hero)){
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 5)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
};
};
if (!sVar["triggerUpgrade2"]){
if (!sVar["startBoss"]){
if (triggerUpgrade2.hitTestObject(hero)){
if (((Controls.keyNew[Keyboard.ENTER]) || (Controls.keyNew[69]))){
openUpgradeMenu();
};
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(5);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
} else {
if (!triggerUpgrade1.hitTestObject(hero)){
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 5)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
};
};
if (!sVar["triggerSecret1"]){
if (triggerSecret1.hitTestObject(hero)){
sVar["triggerSecret1"] = true;
Game(parent).gameGUI.hlpControl.showHelp(7);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
mainGlobal.secretsFound++;
};
};
if (!sVar["triggerSecret2"]){
if (triggerSecret2.hitTestObject(hero)){
sVar["triggerSecret2"] = true;
Game(parent).gameGUI.hlpControl.showHelp(7);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
mainGlobal.secretsFound++;
};
};
if (!sVar["wepLuncherTaked"]){
if (hero.weapons[5].active){
sVar["wepLuncherTaked"] = true;
levRightLim = levelRightBorder.x;
};
};
if (!sVar["startSeed"]){
if ((((hero.x > (levelLeftSeed.x + levelLeftSeed.width))) && ((hero.x < levelRightSeed.x)))){
sVar["startSeed"] = true;
levLeftLim = levelLeftSeed.x;
levRightLim = levelRightSeed.x;
musicEnv.fadeTo("roboAttack");
unit1.alwaysSeeEnemy = true;
unit2.alwaysSeeEnemy = true;
unit3.alwaysSeeEnemy = true;
};
} else {
if (!sVar["SeedDead"]){
if ((((((((unit1 == null)) || ((((unit1.visible == false)) && (unit1.dead))))) && ((((unit2 == null)) || ((((unit2.visible == false)) && (unit2.dead))))))) && ((((unit3 == null)) || ((((unit3.visible == false)) && (unit3.dead))))))){
sVar["SeedDead"] = true;
levLeftLim = levelLeftBorder.x;
levRightLim = levelRightBorder.x;
musicEnv.fadeTo(levelMus);
};
};
};
if (!sVar["startBoss"]){
if (triggerBoss.hitTestObject(hero)){
sVar["startBoss"] = true;
levLeftLim = levelLeftBorder.x;
levRightLim = levelRightBorder.x;
musicEnv.fadeTo("FatalDamage");
boss.lLeg.play();
boss.rLeg.play();
};
};
if (!sVar["DlgBarneyLuck"]){
sVar["DlgBarneyLuck"] = true;
_local1 = Game(parent).gameGUI.dlg.setTo("lev8_BarneyLuck");
sVar["DlgBarneyTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
} else {
if (sVar["DlgBarneyLuck"]){
if (!sVar["DlgBarneyLuckEnd"]){
if (sVar["DlgBarneyTimer"] == 0){
sVar["DlgBarneyLuckEnd"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
} else {
var _local2 = sVar;
var _local3 = "DlgBarneyTimer";
var _local4 = (_local2[_local3] - 1);
_local2[_local3] = _local4;
if (Controls.keyNew[69]){
sVar["DlgBarneyTimer"] = 0;
};
};
};
};
};
if (((!(sVar["DlgTedKilledBoss"])) && ((((boss == null)) || ((boss.visible == false)))))){
sVar["DlgTedKilledBoss"] = true;
_local1 = Game(parent).gameGUI.dlg.setTo("lev8_TedCool");
sVar["DlgTedDiffTimer"] = int((_local1 * dlgSpeedFactor));
Game(parent).gameGUI.dlg.startFadeIn();
} else {
if (sVar["DlgTedKilledBoss"]){
if (!sVar["DlgTedDiffEnd"]){
if (sVar["DlgTedDiffTimer"] == 0){
sVar["DlgTedDiffEnd"] = true;
Game(parent).gameGUI.dlg.startFadeOut();
} else {
_local2 = sVar;
_local3 = "DlgTedDiffTimer";
_local4 = (_local2[_local3] - 1);
_local2[_local3] = _local4;
if (Controls.keyNew[69]){
sVar["DlgTedDiffTimer"] = 0;
};
};
};
};
};
if (((sVar["DlgTedDiffEnd"]) && (!(Game(parent).gameGUI.dlg.visible)))){
if (!isWin){
isWin = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuWinLose.startFadeIn();
Game(root).menuWinLose.setToWin();
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
musicEnv.fadeTo("musWin");
return;
};
};
}
public function UpdateProjObjects():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < projObjects.length) {
if (projObjects[_local1].visible == false){
} else {
if (projObjects[_local1].gravityEnable){
projObjects[_local1].Velocity.y = (projObjects[_local1].Velocity.y + (grav * projObjects[_local1].gravityFactor));
projObjects[_local1].Velocity.y = ((projObjects[_local1].Velocity.y)>projObjects[_local1].maxSpeed.y) ? projObjects[_local1].maxSpeed.y : projObjects[_local1].Velocity.y;
};
projObjects[_local1].updateDynObj();
if (!projObjects[_local1].fromGoodGuy){
if (((!(hero.dead)) && (hero.hitTestProj(projObjects[_local1])))){
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
} else {
hero.transmitDamage(projObjects[_local1]);
Game(parent).gameGUI.painFrame.startFadeOut();
};
};
} else {
_local2 = 0;
while (_local2 < enemies.length) {
if (((!(enemies[_local2].dead)) && (enemies[_local2].hitTestProj(projObjects[_local1])))){
mainGlobal.shootingInEnemies++;
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
} else {
enemies[_local2].transmitDamage(projObjects[_local1]);
};
};
_local2++;
};
};
if (ageMath.Distance(projObjects[_local1].x, projObjects[_local1].y, hero.x, hero.y) > 670){
projObjects[_local1].visible = false;
};
if (testIntersectLimiterOnScr(projObjects[_local1])){
projObjects[_local1].visible = false;
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
};
};
};
_local1++;
};
}
function frame1(){
initFirst = true;
}
public function cleenUP_FX():void{
var _local1:int;
_local1 = 0;
while (_local1 < fxObjects.length) {
if (((fxObjects[_local1]) && ((fxObjects[_local1].visible == false)))){
if (fxObjects[_local1]){
if (fxObjects[_local1].parent){
fxObjects[_local1].parent.removeChild(fxObjects[_local1]);
};
};
fxObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function term(){
var _local1:int;
removeEventListener(Event.ENTER_FRAME, Update);
_local1 = 0;
while (_local1 < enemies.length) {
enemies[_local1].clearActorObject();
_local1++;
};
_local1 = 0;
while (_local1 < dynObjects.length) {
dynObjects[_local1].clearDynObject();
_local1++;
};
dynObjects = [];
enemies = [];
goodNPC = [];
projObjects = [];
paralaxObjects = [];
chunkObjects = [];
fxObjects = [];
propObjects = [];
addActorsArr = [];
limitersCache = [];
limitersOnScr = [];
limiters = [];
}
public function addFX_Splatters(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxBloodSpatters();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function addProp_Coin(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propCoin();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
public function testRayToLimiterOnScr(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean=false, _arg6:Object=null):ageVector{
var _local10:int;
var _local11:ageVector;
var _local12:Number;
var _local13:ageVector;
var _local14:Number;
var _local7:ageVector;
var _local8:ageVector = new ageVector(_arg1, _arg3);
var _local9:Number = Number.MAX_VALUE;
_local10 = 0;
while (_local10 < limitersOnScr.length) {
if (!limitersOnScr[_local10].slimMode){
_local11 = ageMath.getLineCrossRect(_arg1, _arg2, _arg3, _arg4, limitersOnScr[_local10].x, limitersOnScr[_local10].y, (limitersOnScr[_local10].x + limitersOnScr[_local10].width), (limitersOnScr[_local10].y + limitersOnScr[_local10].height));
if (_local11 != null){
if (_local7 == null){
_local7 = new ageVector();
_local7.copy(_local11);
_local9 = ageMath.DistanceVec(_local8, _local7);
} else {
_local12 = ageMath.DistanceVec(_local8, _local11);
if (_local12 < _local9){
_local9 = _local12;
_local7.copy(_local11);
};
};
};
};
_local10++;
};
if (!_arg5){
return (_local7);
};
_arg6.id = -1;
_local10 = 0;
while (_local10 < enemies.length) {
if (enemies[_local10].dead){
} else {
_local13 = enemies[_local10].hitTestLine(_arg1, _arg2, _arg3, _arg4);
if (_local13 != null){
if (_local7 == null){
_local7 = new ageVector();
_local7.copy(_local13);
_arg6.id = _local10;
_local9 = ageMath.DistanceVec(_local8, _local7);
} else {
_local14 = ageMath.DistanceVec(_local8, _local13);
if (_local14 < _local9){
_local9 = _local14;
_arg6.id = _local10;
_local7.copy(_local13);
};
};
};
};
_local10++;
};
return (_local7);
}
public function addProp_Dynamite(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propDynamite();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_MedKit(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new dropMedKit();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addFX_Headshot(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxHeadshot();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function addProp_Money1(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMoney1();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_Money2(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMoney2();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
function showGameMenu():void{
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
Game(root).menuInGame.visible = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuInGame.startFadeIn();
}
public function UpdatePropObjects():void{
var _local1:int;
_local1 = 0;
while (_local1 < propObjects.length) {
if (propObjects[_local1].visible == false){
} else {
if (ageMath.Distance(propObjects[_local1].x, propObjects[_local1].y, hero.x, hero.y) >= (stage.stageWidth * 1.6)){
} else {
propObjects[_local1].x = (propObjects[_local1].x + propObjects[_local1].speed.x);
if (propObjects[_local1].useRotateSpeed){
propObjects[_local1].body.rotation = (propObjects[_local1].body.rotation + propObjects[_local1].rotateSpeed);
};
if ((((((((((((propObjects[_local1].propType == "Med")) || ((propObjects[_local1].propType == "Coin")))) || ((propObjects[_local1].propType == "Money")))) || ((propObjects[_local1].propType == "Weapon")))) || ((propObjects[_local1].propType == "Item")))) || ((propObjects[_local1].propType == "Ammo")))){
if (hero.hitTestObject(propObjects[_local1])){
if (propObjects[_local1].propType == "Ammo"){
if (hero.weapons[propObjects[_local1].wepNum].active){
if (hero.weapons[propObjects[_local1].wepNum].bulletsNum < hero.weapons[propObjects[_local1].wepNum].bulletsNumMax){
propObjects[_local1].visible = false;
hero.weapons[propObjects[_local1].wepNum].bulletsNum = (hero.weapons[propObjects[_local1].wepNum].bulletsNum + (hero.weapons[propObjects[_local1].wepNum].bulletsInCatrigeMax * propObjects[_local1].moneyAmount));
if (hero.weapons[propObjects[_local1].wepNum].bulletsNum > hero.weapons[propObjects[_local1].wepNum].bulletsNumMax){
hero.weapons[propObjects[_local1].wepNum].bulletsNum = hero.weapons[propObjects[_local1].wepNum].bulletsNumMax;
};
sounds.PlaySnd((hero.weapons[propObjects[_local1].wepNum].type + "Reloaded"));
};
};
} else {
if (propObjects[_local1].propType == "Med"){
if (hero.life < hero.lifeMax){
propObjects[_local1].visible = false;
hero.life = (hero.life + propObjects[_local1].moneyAmount);
if (hero.life > hero.lifeMax){
hero.life = hero.lifeMax;
};
sounds.PlaySnd("Med");
};
} else {
if (propObjects[_local1].propType == "Item"){
propObjects[_local1].visible = false;
hero.itemsInBag.push(propObjects[_local1].itemName);
sounds.PlaySnd("itemTake");
} else {
if (propObjects[_local1].propType == "Weapon"){
propObjects[_local1].visible = false;
hero.weapons[propObjects[_local1].wepNum].active = true;
hero.curWeaponNum = (propObjects[_local1].wepNum + 1);
sounds.PlaySnd((hero.weapons[(hero.curWeaponNum - 1)].type + "Reloaded"));
} else {
propObjects[_local1].visible = false;
sounds.PlaySnd((propObjects[_local1].propType + "1"));
hero.moneyCnt = (hero.moneyCnt + propObjects[_local1].moneyAmount);
mainGlobal.moneyCollected = (mainGlobal.moneyCollected + propObjects[_local1].moneyAmount);
};
};
};
};
};
};
};
};
_local1++;
};
}
public function addProj_Psy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new psyProj();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
_local6.gravityComp = false;
_local6.infAmmo = true;
_local6.usePsyDamage = true;
_local6.psyDamageVal = 16;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProj_MinigunBeam(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
var _local10:ageVector = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local10.normThis();
_local10.mulScalar(600);
_arg3 = (_local10.x + _arg1);
_arg4 = (_local10.y + _arg2);
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projMinigunBeam();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.gravityEnable = false;
var _local11:Object = {id:-1};
var _local12:ageVector = testRayToLimiterOnScr(_arg1, _arg2, _arg3, _arg4, true, _local11);
if (_local12 != null){
_arg3 = _local12.x;
_arg4 = _local12.y;
if (_local11.id != -1){
mainGlobal.shootingInEnemies++;
addLineDamageToEnemy(_local12, _arg5.damage, enemies[_local11.id], true);
};
};
_local6.scaleX = (ageMath.Distance(_arg1, _arg2, _arg3, _arg4) / 34);
_local6.rotation = _local8;
var _local13:Array = new Array();
_local13.push(new GlowFilter(0xFFFF00, 1, 15, 15, 4, BitmapFilterQuality.MEDIUM));
_local6.filters = _local13;
if (_arg5 != null){
};
this["FXLayer"].addChild(_local6);
fxObjects.push(_local6);
return (_local6);
}
public function addProj_LaserBeam(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
var _local10:ageVector = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local10.normThis();
_local10.mulScalar(600);
_arg3 = (_local10.x + _arg1);
_arg4 = (_local10.y + _arg2);
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projLaserBeam();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.gravityEnable = false;
var _local11:ageVector = testRayToLimiterOnScr(_arg1, _arg2, _arg3, _arg4);
if (_local11 != null){
_arg3 = _local11.x;
_arg4 = _local11.y;
};
if (addLineDamage(_arg1, _arg2, _arg3, _arg4, _arg5.damage)){
mainGlobal.shootingInEnemies++;
};
_local6.scaleX = (ageMath.Distance(_arg1, _arg2, _arg3, _arg4) / 34);
_local6.rotation = _local8;
_local6.use_force_restart = true;
_local6.fadeSpeed = 0.1;
_local6.startFadeOut();
_local6.gravityEnable = false;
var _local12:Array = new Array();
_local12.push(new GlowFilter(0xFF0000, 1, 15, 15, 1.7, BitmapFilterQuality.MEDIUM));
_local6.filters = _local12;
if (_arg5 != null){
};
this["FXLayer"].addChild(_local6);
fxObjects.push(_local6);
return (_local6);
}
public function addFX_littleBlast(_arg1:Number, _arg2:Number, _arg3:Number=1.5){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
addBlinkFX_OverLight();
_local4 = new fxBlast();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.blendMode = BlendMode.SCREEN;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function addProj(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projBullet();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, 24);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = true;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProp_Debris(_arg1:Number, _arg2:Number, _arg3:Number=1, _arg4:String=""):propObject{
var _local5:propObject;
_local5 = new propDebris();
_local5.x = _arg1;
_local5.y = _arg2;
_local5.speed.y = (ageMath.Random(-6, -18) * _arg3);
_local5.speed.x = (ageMath.Random(-10, 10) * _arg3);
if (_arg4.length){
_local5.gotoAndStop(_arg4);
} else {
_local5.gotoAndStop(ageMath.RandomInt(1, 20));
};
_local5.curLevel = this;
dynObjects.push(_local5);
propObjects.push(_local5);
_local5.isRubber = true;
_local5.stayTime = (3000 + ageMath.RandomInt(1, 2000));
_local5.timerStayDelay.start();
_local5.useRotateSpeed = true;
_local5.rotateSpeed = ageMath.RandomInt(-15, 15);
propLayer.addChild(_local5);
return (_local5);
}
public function addProj_BombWep(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projBombWep();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
_local6.blastStyle = _arg5.blastStyle;
_local6.attackRadius = _arg5.damageRadius;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProj_Rocket(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projRocket();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = true;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
_local6.blastStyle = _arg5.blastStyle;
_local6.attackRadius = _arg5.damageRadius;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function ifMCOnScreen(_arg1:MovieClip):Boolean{
var _local2:Point = this.localToGlobal(new Point(_arg1.x, _arg1.y));
var _local3:Rectangle = _arg1.getBounds(root);
var _local4:Rectangle = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
if (_local4.intersects(_local3)){
return (true);
};
return (false);
}
public function addLimiter(_arg1){
limiters.push(_arg1);
}
public function alignObjXToAnother(_arg1, _arg2):void{
if ((_arg1.x - (_arg1.width * 0.5)) < _arg2.x){
_arg1.x = (_arg1.x + (_arg2.x - (_arg1.x - (_arg1.width * 0.5))));
};
if ((_arg1.x + (_arg1.width * 0.5)) > (_arg2.x + _arg2.width)){
_arg1.x = (_arg1.x - ((_arg1.x + (_arg1.width * 0.5)) - (_arg2.x + _arg2.width)));
};
}
public function levInit(){
mainGlobal.secretsAll = 2;
curLevNum = 8;
curLevScore = 3500;
levelMus = "musGlory";
musicEnv.fadeTo(levelMus);
Game(parent).sky.visible = true;
levLeftLim = levelLeftBorder.x;
boss.rLeg.stop();
boss.lLeg.stop();
sVar["DlgTedDiffTimer"] = 0;
sVar["DlgTedDiffEnd"] = false;
sVar["DlgTedKilledBoss"] = false;
sVar["DlgBarneyTimer"] = 0;
sVar["DlgBarneyLuckEnd"] = false;
sVar["DlgBarneyLuck"] = false;
}
public function addExplotion(_arg1:projObject, _arg2:actorObject=null):void{
var _local3:Number;
var _local5:int;
_local3 = ageMath.Distance(_arg1.x, _arg1.y, hero.x, hero.y);
var _local4:projObject = new projObject();
if (_local3 < _arg1.attackRadius){
_local4.damage = ageMath.RemapVal(_local3, 0, _arg1.attackRadius, _arg1.damage, 0);
_local4.x = hero.x;
_local4.y = (hero.y - (hero.height / 2));
_local4.fromGoodGuy = false;
hero.transmitDamage(_local4);
Game(parent).gameGUI.painFrame.startFadeOut();
_local4.clearDynObject();
};
_local5 = 0;
while (_local5 < enemies.length) {
if (((((enemies[_local5].dead) && (!((_arg2 == null))))) && (!((_arg2 == enemies[_local5]))))){
} else {
_local3 = ageMath.Distance(_arg1.x, _arg1.y, enemies[_local5].x, enemies[_local5].y);
if (_local3 < _arg1.attackRadius){
_local4.damage = ageMath.RemapVal(_local3, 0, _arg1.attackRadius, _arg1.damage, 0);
_local4.x = enemies[_local5].x;
_local4.y = (enemies[_local5].y - (enemies[_local5].height / 2));
_local4.fromGoodGuy = true;
enemies[_local5].transmitDamage(_local4);
_local4.clearDynObject();
};
};
_local5++;
};
}
public function addActor(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:int=-1):actorObject{
var _local6:actorObject;
if (_arg1 == "AlienSaw"){
_local6 = new AlienSaw();
} else {
if (_arg1 == "AlienHunter"){
_local6 = new AlienHunter();
} else {
if (_arg1 == "AlienElectro"){
_local6 = new AlienElectro();
} else {
if (_arg1 == "Zomb01"){
_local6 = new Zomb01();
} else {
if (_arg1 == "Zomb02"){
_local6 = new Zomb02();
} else {
if (_arg1 == "Zomb03"){
_local6 = new Zomb03();
} else {
if (_arg1 == "Zomb04"){
_local6 = new Zomb04();
} else {
if (_arg1 == "Zomb05"){
_local6 = new Zomb05();
} else {
if (_arg1 == "Zomb01Run"){
_local6 = new Zomb01Run();
} else {
if (_arg1 == "Zomb02Run"){
_local6 = new Zomb02Run();
} else {
if (_arg1 == "Zomb03Run"){
_local6 = new Zomb03Run();
} else {
if (_arg1 == "Zomb04Run"){
_local6 = new Zomb04Run();
} else {
if (_arg1 == "Zomb05Run"){
_local6 = new Zomb05Run();
} else {
if (_arg1 == "Zomb01Vomit"){
_local6 = new Zomb01Vomit();
} else {
if (_arg1 == "Zomb02Vomit"){
_local6 = new Zomb02Vomit();
} else {
if (_arg1 == "Zomb03Vomit"){
_local6 = new Zomb03Vomit();
} else {
if (_arg1 == "Zomb04Vomit"){
_local6 = new Zomb04Vomit();
} else {
if (_arg1 == "Zomb05Vomit"){
_local6 = new Zomb05Vomit();
} else {
if (_arg1 == "Spider"){
_local6 = new Spider();
} else {
if (_arg1 == "AlienBomber"){
_local6 = new AlienBomber();
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
_local6.x = _arg3;
_local6.y = _arg4;
_local6.name = _arg2;
if (!_local6.noStatEnemy){
mainGlobal.enemiesAll++;
};
if (_arg5 < 0){
addChild(_local6);
} else {
addChildAt(_local6, _arg5);
};
return (_local6);
}
public function addFX_BlastWave(_arg1:Number, _arg2:Number, _arg3:Number=1){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
_local4 = new fxBlastWave();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function Update(_arg1:Event):void{
var _local5:int;
var _local6:*;
var _local7:*;
var _local11:int;
var _local12:addActorStruct;
var _local13:int;
var _local14:Number;
var _local15:Array;
var _local16:ColorMatrix;
if (isWin){
hero.body.stop();
return;
};
if (((((mainGlobal.paused) || (!(visible)))) || (!((parent as Game))))){
return;
};
if ((((hero.life <= 0)) && (!(isLose)))){
isLose = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuWinLose.startFadeIn();
Game(root).menuWinLose.setToLose();
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
musicEnv.fadeTo("musLose");
sounds.PlaySnd(("TedDie" + ageMath.RandomInt(1, 2).toString()), 0.8);
return;
};
if (initFirst){
if (((!(mainGlobal.configMusicOn)) && (!(mainGlobal.configSoundOn)))){
Game(parent).gamButSnd.gotoAndStop(2);
} else {
Game(parent).gamButSnd.gotoAndStop(1);
};
initFirst = false;
initLimCache();
Game(parent).fadeBG.fadeSpeed = 0.03;
Game(parent).fadeBG.use_force_restart = true;
Game(parent).fadeBG.startFadeOut();
Game(parent).gameGUI.hlpControl.visible = false;
Game(parent).gameGUI.dlg.visible = false;
Game(parent).gameGUI.dlgIco.x = -500;
_local6 = (hero.x * this.scaleX);
_local7 = ((hero.y - 95) * this.scaleY);
x = -((_local6 - (stage.stageWidth * 0.5)));
y = -((_local7 - (stage.stageHeight * 0.5)));
mainGlobal.initStat();
_local11 = 0;
_local11 = 0;
while (_local11 < enemies.length) {
if (!enemies[_local11].noStatEnemy){
mainGlobal.enemiesAll++;
};
_local11++;
};
Game(parent).sky.visible = true;
levInit();
if (mainGlobal.isSingleEp){
if (curLevNum == 1){
_local5 = 0;
while (_local5 < 1) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 0;
} else {
if (curLevNum == 2){
_local5 = 0;
while (_local5 < 2) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 200;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
} else {
if (curLevNum == 3){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
} else {
if (curLevNum == 4){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1300;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
} else {
if (curLevNum == 5){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1500;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
} else {
if (curLevNum == 6){
_local5 = 0;
while (_local5 < 4) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 2000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
} else {
if (curLevNum == 7){
_local5 = 0;
while (_local5 < 5) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 3000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
} else {
if (curLevNum == 8){
_local5 = 0;
while (_local5 < 5) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 3500;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
} else {
if (curLevNum == 9){
_local5 = 0;
while (_local5 < 6) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = 5;
hero.moneyCnt = 4000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
hero.applyUpgrade(1, 4);
hero.upgradesLife[4].active = true;
} else {
if (curLevNum == 10){
_local5 = 0;
while (_local5 < 6) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = 5;
hero.moneyCnt = 4000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
hero.applyUpgrade(1, 4);
hero.upgradesLife[4].active = true;
};
};
};
};
};
};
};
};
};
};
};
Game(parent).gameGUI.dlgIco.gotoAndStop(1);
};
var _local2:int = getTimer();
cleenUP();
UpdateLimitersOnScr();
UpdateParalaxObjects();
UpdateDynObjects();
UpdatePropObjects();
UpdateEnemies();
UpdateProjObjects();
hero.updateActor();
hero.applyDamages();
hero.testIsActorDead();
if (addActorsArr.length){
while (addActorsArr.length) {
_local12 = addActorsArr.pop();
addActor(_local12.strClass, "", _local12.posx, _local12.posy, _local12.orderZ);
};
};
var _local3:int;
_local3 = 0;
while (_local3 < chunkObjects.length) {
if (ifMCOnScreen(chunkObjects[_local3])){
chunkObjects[_local3].visible = true;
} else {
chunkObjects[_local3].visible = false;
};
_local3++;
};
levScript();
var _local4:Boolean;
if (Controls.key[Keyboard.F2]){
hero.life = 1;
};
if (Controls.key[Keyboard.ESCAPE]){
showGameMenu();
};
if (!hero.timerReloadDelay.running){
_local13 = 0;
while (_local13 < 8) {
if (((((Controls.key[(49 + _local13)]) && (!((hero.curWeaponNum == (_local13 + 1)))))) && (hero.weapons[_local13].active))){
hero.curWeaponNum = (_local13 + 1);
sounds.PlaySnd((hero.weapons[(hero.curWeaponNum - 1)].type + "Reloaded"));
};
_local13++;
};
};
if (Game(root).cursor.currentLabel == "cross"){
_local14 = ageMath.Distance(hero.x, hero.y, (Controls.mousePosX - x), (Controls.mousePosY - y));
Game(root).cursor.shootAcc.scaleX = (Game(root).cursor.shootAcc.scaleY = ((hero.wepAcc * _local14) / hero.weapons[(hero.curWeaponNum - 1)].accDistScale));
};
_local5 = 0;
_local5 = 0;
while (_local5 < 8) {
if (((hero.weapons[_local5]) && (hero.weapons[_local5].active))){
if ((((hero.weapons[_local5].bulletsInCatrige == 0)) && ((hero.weapons[_local5].bulletsNum == 0)))){
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 2){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 2;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(-124);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
} else {
if (hero.curWeaponNum != (_local5 + 1)){
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 1){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 1;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(0);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
} else {
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 3){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 3;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(87);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
};
};
} else {
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 4){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 4;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 0.5;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(0);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
};
_local5++;
};
Game(parent).gameGUI.wepInfo.catTxt.text = ((hero.weapons[(hero.curWeaponNum - 1)].bulletsInCatrige + "/") + hero.weapons[(hero.curWeaponNum - 1)].bulletsInCatrigeMax);
if (!hero.weapons[(hero.curWeaponNum - 1)].infAmmo){
Game(parent).gameGUI.wepInfo.allTxt.text = hero.weapons[(hero.curWeaponNum - 1)].bulletsNum;
} else {
Game(parent).gameGUI.wepInfo.allTxt.text = "INF";
};
Game(parent).gameGUI.wepInfo.pic.gotoAndStop((hero.curWeaponNum + 4));
if ((hero.x - (hero.width * 0.5)) < levLeftLim){
hero.x = (levLeftLim + (hero.width * 0.5));
} else {
if ((hero.x + (hero.width * 0.5)) > levRightLim){
hero.x = (levRightLim - (hero.width * 0.5));
};
};
_local6 = ageMath.Lerp((Controls.mousePosX - x), (hero.x * scaleX), 0.6);
_local7 = ageMath.Lerp((Controls.mousePosY - y), ((hero.y - 95) * scaleY), 0.6);
if (!_local4){
x = Math.round(ageMath.Lerp(x, -((_local6 - (stage.stageWidth * 0.5))), 0.15));
y = Math.round(ageMath.Lerp(y, -((_local7 - (stage.stageHeight * 0.5))), 0.15));
} else {
x = -((_local6 - (stage.stageWidth * 0.5)));
y = -((_local7 - (stage.stageHeight * 0.5)));
};
if (this["blackScr"]){
this["blackScr"].x = -(x);
this["blackScr"].y = -(y);
};
var _local8:Point = this.localToGlobal(new Point(levLeftLim, 0));
var _local9:Point = this.localToGlobal(new Point(levRightLim, 0));
if (_local8.x > 0){
x = (x - _local8.x);
} else {
if (_local9.x < stage.stageWidth){
x = (x + (stage.stageWidth - _local9.x));
};
};
if (curBlastShake > 0){
x = (x + ageMath.Random(-(curBlastShake), curBlastShake));
y = (y + ageMath.Random(-(curBlastShake), curBlastShake));
curBlastShake = (curBlastShake - curBlastShakeDec);
if (curBlastShake < 0){
curBlastShake = 0;
};
};
Game(parent).gameGUI.lifeBar.gotoAndStop(Math.round(ageMath.RemapVal(Math.round(hero.life), 1, hero.lifeMax, 1, 100)));
Game(parent).gameGUI.lifeBar.width = ageMath.RemapVal(Math.round(hero.lifeMax), 100, 300, 108, 227);
Game(parent).gameGUI.txtMoney.text = ("$" + hero.moneyCnt);
var _local10:int;
_local10 = 0;
while (_local10 < 6) {
if (hero.itemsInBag[_local10]){
Game(parent).gameGUI[("itm" + _local10)].gotoAndStop(hero.itemsInBag[_local10]);
} else {
Game(parent).gameGUI[("itm" + _local10)].gotoAndStop(1);
};
_local10++;
};
if (hero.bioMaxLevel > 0){
Game(parent).gameGUI.hazBio.visible = true;
Game(parent).gameGUI.hazBio.gotoAndStop((100 - int(ageMath.RemapVal(hero.bioCurLevel, 0, hero.bioMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazBio.visible = false;
};
if (hero.psyMaxLevel > 0){
Game(parent).gameGUI.hazPsy.visible = true;
Game(parent).gameGUI.hazPsy.gotoAndStop((100 - int(ageMath.RemapVal(hero.psyCurLevel, 0, hero.psyMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazPsy.visible = false;
};
if (hero.electroMaxLevel > 0){
Game(parent).gameGUI.hazElectro.visible = true;
Game(parent).gameGUI.hazElectro.gotoAndStop((100 - int(ageMath.RemapVal(hero.electroCurLevel, 0, hero.electroMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazElectro.visible = false;
};
Controls.updateKeyNew();
if (Game(parent).groundBG){
Game(parent).groundBG.changeBG(x, y);
};
}
public function addProp_minigunAmmo(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMinigunAmmo();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addFX_MetalSparks(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxMetalSparks();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.blendMode = BlendMode.ADD;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function addProp_blasterAmmo(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propBlasterAmmo();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_Blaster(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propBlaster();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function UpdateEnemies():void{
var _local1:int;
_local1 = 0;
while (_local1 < enemies.length) {
if (((enemies[_local1].dead) || ((enemies[_local1].life <= 0)))){
} else {
if (((((!((enemies[_local1].parent as Level))) || (enemies[_local1].alwaysSeeEnemy))) || ((ageMath.Distance(enemies[_local1].x, enemies[_local1].y, hero.x, hero.y) < (stage.stageWidth * 1.6))))){
enemies[_local1].updateActorEnemy();
};
};
_local1++;
};
}
public function addProj_Vomit(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projVomit();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.timerFXAdd.delay = 80;
_local6.timerFXAdd.start();
_local6.fxFunc = addFX_VomitSplatters;
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = true;
_local6.gravityComp = true;
_local6.infAmmo = true;
_local6.useBioDamage = true;
_local6.bioDamageVal = 10;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
}
}//package main
Section 86
//Level9 (main.Level9)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.ui.*;
public dynamic class Level9 extends Level {
public var goArrow:MovieClip;
public var triggerBossMusBegin:MovieClip;
var levRightLim:Number;// = 999999
var dlgSpeedFactor:Number;// = 4
var lastMSFrame:int;// = 9999
public var bomberRightBorder:MovieClip;
public var leveler1:MovieClip;
public var leveler2:MovieClip;
public var leveler3:MovieClip;
public var enemies:Array;
var levLeftLim:Number;// = -999999
public var propObjects:Array;
public var leveler3Trigger:MovieClip;
public var minLimX:Number;// = 2147483647
public var bomberLeftBorder:MovieClip;
public var levelRightBorder:MovieClip;
public var hatch2Lim:MovieClip;
public var maxLimX:Number;// = -2147483648
public var bomber1:MovieClip;
var curBlastShake:Number;// = 0
public var leveler2Trigger:MovieClip;
var isWin:Boolean;// = false
public var dynObjects:Array;
var isLose:Boolean;// = false
var grav:Number;// = 1
public var triggerUpgrade1:MovieClip;
public var triggerUpgrade2:MovieClip;
public var limitersCache:Array;
public var leveler1Trigger:MovieClip;
var initFirst:Boolean;// = false
var curLevNum:int;// = 1
public var hatch3Lim:MovieClip;
public var FXLayer:MovieClip;
var levelMus:String;// = ""
public var triggerSecret1:MovieClip;
public var triggerSecret2:MovieClip;
public var triggerSecret3:MovieClip;
public var propLayer:MovieClip;
var sVar:Object;
public var triggerBossMusEnd:MovieClip;
public var levelLeftBorder:MovieClip;
public var limitersOnScr:Array;
public var addActorsArr:Array;
public var levelEnd:MovieClip;
public var limiters:Array;
public var paralaxObjects:Array;
var curLevScore:int;// = 3000
var curBlastShakeDec:Number;// = 0.3
public var hatch1Lim:MovieClip;
public var limitersCacheStep:int;// = 640
public var chunkObjects:Array;
public var fxObjects:Array;
var curScale:Number;// = 1
public var goodNPC:Array;
public var hatch1:MovieClip;
public var hatch2:MovieClip;
public var hatch3:MovieClip;
public var projObjects:Array;
public var hero:MovieClip;
public var projLayer:MovieClip;
public function Level9(){
sVar = new Object();
limiters = new Array();
limitersCache = new Array();
limitersOnScr = new Array();
dynObjects = new Array();
enemies = new Array();
goodNPC = new Array();
paralaxObjects = new Array();
projObjects = new Array();
chunkObjects = new Array();
fxObjects = new Array();
propObjects = new Array();
addActorsArr = new Array();
super();
addFrameScript(0, frame1);
init();
}
public function addLineDamage(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Boolean{
var _local6:Number;
var _local8:int;
var _local9:ageVector;
var _local7:Boolean;
_local8 = 0;
while (_local8 < enemies.length) {
if (enemies[_local8].dead){
} else {
_local9 = enemies[_local8].hitTestLine(_arg1, _arg2, _arg3, _arg4);
if (_local9 != null){
addLineDamageToEnemy(_local9, _arg5, enemies[_local8], true);
_local7 = true;
};
};
_local8++;
};
return (_local7);
}
public function checkHitPlatform(_arg1, _arg2:Array){
var _local3:int;
_arg1.bottomLimiter = null;
_local3 = 0;
while (_local3 < _arg2.length) {
if (((_arg2[_local3].slimMode) && ((_arg1.speed.y < 0)))){
} else {
if (_arg2[_local3].hitTestObject(_arg1.p2)){
_arg1.jump = false;
if (_arg1.isRubber){
_arg1.speed.y = (_arg1.speed.y * -(_arg1.rubberFactor));
_arg1.speed.x = (_arg1.speed.x * _arg1.rubberFactor);
if (_arg1.useRotateSpeed){
_arg1.rotateSpeed = 0;
};
} else {
_arg1.speed.y = 0;
};
_arg1.y = ((_arg2[_local3].y - _arg1.p2.y) - _arg1.p2.height);
_arg1.bottomLimiter = _arg2[_local3];
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p1)) && (!(_arg2[_local3].slimMode)))){
if (_arg1.scaleX > 0){
_arg1.x = (_arg2[_local3].x - (_arg1.p1.x + _arg1.p1.width));
} else {
_arg1.x = ((_arg2[_local3].x + _arg2[_local3].width) + (_arg1.p1.x + _arg1.p1.width));
};
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p3)) && (!(_arg2[_local3].slimMode)))){
if (_arg1.scaleX > 0){
_arg1.x = ((_arg2[_local3].x + _arg2[_local3].width) - _arg1.p3.x);
} else {
_arg1.x = (_arg2[_local3].x - (-(_arg1.p3.x) + _arg1.p3.width));
};
} else {
if (((_arg2[_local3].hitTestObject(_arg1.p4)) && (!(_arg2[_local3].slimMode)))){
_arg1.speed.y = 0;
_arg1.y = ((_arg2[_local3].y + _arg2[_local3].height) - _arg1.p4.y);
};
};
};
};
};
_local3++;
};
}
public function addFX_VomitSplatters(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxVomitSpatters();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function initLimCache(){
var _local1:*;
var _local2:int;
var _local3:int;
var _local4:int;
maxLimX = int.MIN_VALUE;
minLimX = int.MAX_VALUE;
_local1 = 0;
while (_local1 < limiters.length) {
if (limiters[_local1].x < minLimX){
minLimX = limiters[_local1].x;
};
if ((limiters[_local1].x + limiters[_local1].width) > maxLimX){
maxLimX = limiters[_local1].x;
};
_local1++;
};
limitersCache = [];
_local1 = 0;
while (_local1 < (((maxLimX - minLimX) / limitersCacheStep) + 1)) {
limitersCache.push(new Array());
_local1++;
};
_local1 = 0;
while (_local1 < limiters.length) {
_local3 = int(((limiters[_local1].x - minLimX) / limitersCacheStep));
_local4 = int((((limiters[_local1].x + limiters[_local1].width) - minLimX) / limitersCacheStep));
_local2 = _local3;
while (_local2 <= _local4) {
if (!limitersCache[_local2]){
limitersCache[_local2] = new Array();
};
limitersCache[_local2].push(limiters[_local1]);
_local2++;
};
_local1++;
};
}
public function Update(_arg1:Event):void{
var _local5:int;
var _local6:*;
var _local7:*;
var _local11:int;
var _local12:addActorStruct;
var _local13:int;
var _local14:Number;
var _local15:Array;
var _local16:ColorMatrix;
if (isWin){
hero.body.stop();
return;
};
if (((((mainGlobal.paused) || (!(visible)))) || (!((parent as Game))))){
return;
};
if ((((hero.life <= 0)) && (!(isLose)))){
isLose = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuWinLose.startFadeIn();
Game(root).menuWinLose.setToLose();
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
musicEnv.fadeTo("musLose");
sounds.PlaySnd(("TedDie" + ageMath.RandomInt(1, 2).toString()), 0.8);
return;
};
if (initFirst){
if (((!(mainGlobal.configMusicOn)) && (!(mainGlobal.configSoundOn)))){
Game(parent).gamButSnd.gotoAndStop(2);
} else {
Game(parent).gamButSnd.gotoAndStop(1);
};
initFirst = false;
initLimCache();
Game(parent).fadeBG.fadeSpeed = 0.03;
Game(parent).fadeBG.use_force_restart = true;
Game(parent).fadeBG.startFadeOut();
Game(parent).gameGUI.hlpControl.visible = false;
Game(parent).gameGUI.dlg.visible = false;
Game(parent).gameGUI.dlgIco.x = -500;
_local6 = (hero.x * this.scaleX);
_local7 = ((hero.y - 95) * this.scaleY);
x = -((_local6 - (stage.stageWidth * 0.5)));
y = -((_local7 - (stage.stageHeight * 0.5)));
mainGlobal.initStat();
_local11 = 0;
_local11 = 0;
while (_local11 < enemies.length) {
if (!enemies[_local11].noStatEnemy){
mainGlobal.enemiesAll++;
};
_local11++;
};
Game(parent).sky.visible = true;
levInit();
if (mainGlobal.isSingleEp){
if (curLevNum == 1){
_local5 = 0;
while (_local5 < 1) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 0;
} else {
if (curLevNum == 2){
_local5 = 0;
while (_local5 < 2) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 200;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
} else {
if (curLevNum == 3){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
} else {
if (curLevNum == 4){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1300;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
} else {
if (curLevNum == 5){
_local5 = 0;
while (_local5 < 3) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 1500;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
} else {
if (curLevNum == 6){
_local5 = 0;
while (_local5 < 4) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 2000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
} else {
if (curLevNum == 7){
_local5 = 0;
while (_local5 < 5) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 3000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
} else {
if (curLevNum == 8){
_local5 = 0;
while (_local5 < 5) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = _local5;
hero.moneyCnt = 3500;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
} else {
if (curLevNum == 9){
_local5 = 0;
while (_local5 < 6) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = 5;
hero.moneyCnt = 4000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
hero.applyUpgrade(1, 4);
hero.upgradesLife[4].active = true;
} else {
if (curLevNum == 10){
_local5 = 0;
while (_local5 < 6) {
hero.weapons[_local5].active = true;
_local5++;
};
hero.curWeaponNum = 5;
hero.moneyCnt = 4000;
hero.applyUpgrade(1, 0);
hero.upgradesLife[0].active = true;
hero.applyUpgrade(1, 1);
hero.upgradesLife[1].active = true;
hero.applyUpgrade(1, 2);
hero.upgradesLife[2].active = true;
hero.applyUpgrade(1, 3);
hero.upgradesLife[3].active = true;
hero.applyUpgrade(1, 4);
hero.upgradesLife[4].active = true;
};
};
};
};
};
};
};
};
};
};
};
Game(parent).gameGUI.dlgIco.gotoAndStop(1);
};
var _local2:int = getTimer();
cleenUP();
UpdateLimitersOnScr();
UpdateParalaxObjects();
UpdateDynObjects();
UpdatePropObjects();
UpdateEnemies();
UpdateProjObjects();
hero.updateActor();
hero.applyDamages();
hero.testIsActorDead();
if (addActorsArr.length){
while (addActorsArr.length) {
_local12 = addActorsArr.pop();
addActor(_local12.strClass, "", _local12.posx, _local12.posy, _local12.orderZ);
};
};
var _local3:int;
_local3 = 0;
while (_local3 < chunkObjects.length) {
if (ifMCOnScreen(chunkObjects[_local3])){
chunkObjects[_local3].visible = true;
} else {
chunkObjects[_local3].visible = false;
};
_local3++;
};
levScript();
var _local4:Boolean;
if (Controls.key[Keyboard.F2]){
hero.life = 1;
};
if (Controls.key[Keyboard.ESCAPE]){
showGameMenu();
};
if (!hero.timerReloadDelay.running){
_local13 = 0;
while (_local13 < 8) {
if (((((Controls.key[(49 + _local13)]) && (!((hero.curWeaponNum == (_local13 + 1)))))) && (hero.weapons[_local13].active))){
hero.curWeaponNum = (_local13 + 1);
sounds.PlaySnd((hero.weapons[(hero.curWeaponNum - 1)].type + "Reloaded"));
};
_local13++;
};
};
if (Game(root).cursor.currentLabel == "cross"){
_local14 = ageMath.Distance(hero.x, hero.y, (Controls.mousePosX - x), (Controls.mousePosY - y));
Game(root).cursor.shootAcc.scaleX = (Game(root).cursor.shootAcc.scaleY = ((hero.wepAcc * _local14) / hero.weapons[(hero.curWeaponNum - 1)].accDistScale));
};
_local5 = 0;
_local5 = 0;
while (_local5 < 8) {
if (((hero.weapons[_local5]) && (hero.weapons[_local5].active))){
if ((((hero.weapons[_local5].bulletsInCatrige == 0)) && ((hero.weapons[_local5].bulletsNum == 0)))){
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 2){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 2;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(-124);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
} else {
if (hero.curWeaponNum != (_local5 + 1)){
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 1){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 1;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(0);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
} else {
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 3){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 3;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 1;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(1);
_local16.adjustHue(87);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
};
};
} else {
if (guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState != 4){
guiWepNum(Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1)))).flagState = 4;
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).alpha = 0.5;
_local15 = Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters;
_local16 = new ColorMatrix();
_local16.adjustSaturation(0);
_local15[1] = new ColorMatrixFilter(_local16.matrix);
Game(parent).gameGUI.getChildByName(("wep" + (_local5 + 1))).filters = _local15;
};
};
_local5++;
};
Game(parent).gameGUI.wepInfo.catTxt.text = ((hero.weapons[(hero.curWeaponNum - 1)].bulletsInCatrige + "/") + hero.weapons[(hero.curWeaponNum - 1)].bulletsInCatrigeMax);
if (!hero.weapons[(hero.curWeaponNum - 1)].infAmmo){
Game(parent).gameGUI.wepInfo.allTxt.text = hero.weapons[(hero.curWeaponNum - 1)].bulletsNum;
} else {
Game(parent).gameGUI.wepInfo.allTxt.text = "INF";
};
Game(parent).gameGUI.wepInfo.pic.gotoAndStop((hero.curWeaponNum + 4));
if ((hero.x - (hero.width * 0.5)) < levLeftLim){
hero.x = (levLeftLim + (hero.width * 0.5));
} else {
if ((hero.x + (hero.width * 0.5)) > levRightLim){
hero.x = (levRightLim - (hero.width * 0.5));
};
};
_local6 = ageMath.Lerp((Controls.mousePosX - x), (hero.x * scaleX), 0.6);
_local7 = ageMath.Lerp((Controls.mousePosY - y), ((hero.y - 95) * scaleY), 0.6);
if (!_local4){
x = Math.round(ageMath.Lerp(x, -((_local6 - (stage.stageWidth * 0.5))), 0.15));
y = Math.round(ageMath.Lerp(y, -((_local7 - (stage.stageHeight * 0.5))), 0.15));
} else {
x = -((_local6 - (stage.stageWidth * 0.5)));
y = -((_local7 - (stage.stageHeight * 0.5)));
};
if (this["blackScr"]){
this["blackScr"].x = -(x);
this["blackScr"].y = -(y);
};
var _local8:Point = this.localToGlobal(new Point(levLeftLim, 0));
var _local9:Point = this.localToGlobal(new Point(levRightLim, 0));
if (_local8.x > 0){
x = (x - _local8.x);
} else {
if (_local9.x < stage.stageWidth){
x = (x + (stage.stageWidth - _local9.x));
};
};
if (curBlastShake > 0){
x = (x + ageMath.Random(-(curBlastShake), curBlastShake));
y = (y + ageMath.Random(-(curBlastShake), curBlastShake));
curBlastShake = (curBlastShake - curBlastShakeDec);
if (curBlastShake < 0){
curBlastShake = 0;
};
};
Game(parent).gameGUI.lifeBar.gotoAndStop(Math.round(ageMath.RemapVal(Math.round(hero.life), 1, hero.lifeMax, 1, 100)));
Game(parent).gameGUI.lifeBar.width = ageMath.RemapVal(Math.round(hero.lifeMax), 100, 300, 108, 227);
Game(parent).gameGUI.txtMoney.text = ("$" + hero.moneyCnt);
var _local10:int;
_local10 = 0;
while (_local10 < 6) {
if (hero.itemsInBag[_local10]){
Game(parent).gameGUI[("itm" + _local10)].gotoAndStop(hero.itemsInBag[_local10]);
} else {
Game(parent).gameGUI[("itm" + _local10)].gotoAndStop(1);
};
_local10++;
};
if (hero.bioMaxLevel > 0){
Game(parent).gameGUI.hazBio.visible = true;
Game(parent).gameGUI.hazBio.gotoAndStop((100 - int(ageMath.RemapVal(hero.bioCurLevel, 0, hero.bioMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazBio.visible = false;
};
if (hero.psyMaxLevel > 0){
Game(parent).gameGUI.hazPsy.visible = true;
Game(parent).gameGUI.hazPsy.gotoAndStop((100 - int(ageMath.RemapVal(hero.psyCurLevel, 0, hero.psyMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazPsy.visible = false;
};
if (hero.electroMaxLevel > 0){
Game(parent).gameGUI.hazElectro.visible = true;
Game(parent).gameGUI.hazElectro.gotoAndStop((100 - int(ageMath.RemapVal(hero.electroCurLevel, 0, hero.electroMaxLevel, 1, 100))));
} else {
Game(parent).gameGUI.hazElectro.visible = false;
};
Controls.updateKeyNew();
if (Game(parent).groundBG){
Game(parent).groundBG.changeBG(x, y);
};
}
public function addFX_littleSmoke(_arg1:Number, _arg2:Number, _arg3:Number=1.5){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
_local4 = new fxLittleSmoke();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function init(){
addEventListener(Event.ENTER_FRAME, Update, false, 0, true);
}
public function openUpgradeMenu():void{
mainGlobal.paused = true;
this.visible = false;
Game(root).cursor.gotoAndStop("arrow");
Game(parent).menuUpgradeShop.showShop();
musicEnv.fadeTo("musUpgrade");
}
public function addProp_minigunAmmo(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMinigunAmmo();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function UpdateParalaxObjects():void{
var _local1:int;
_local1 = 0;
while (_local1 < paralaxObjects.length) {
paralaxObjects[_local1].x = (paralaxObjects[_local1].saveX - ageMath.RemapVal((paralaxObjects[_local1].saveX + x), 0, stage.stageWidth, 0, paralaxObjects[_local1].paralaxX));
paralaxObjects[_local1].y = (paralaxObjects[_local1].saveY - ageMath.RemapVal((paralaxObjects[_local1].saveY + y), 0, stage.stageHeight, 0, paralaxObjects[_local1].paralaxY));
_local1++;
};
}
public function addBlinkFX_OverLight():void{
Game(parent).gameGUI.fxblink.fadeMaxLimit = 1;
Game(parent).gameGUI.fxblink.fadeSpeed = 0.03;
Game(parent).gameGUI.fxblink.use_force_restart = true;
Game(parent).gameGUI.fxblink.startFadeOut();
curBlastShake = 15;
}
public function UpdateDynObjects():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = 0;
while (_local1 < dynObjects.length) {
if (dynObjects[_local1].visible == false){
} else {
if (ageMath.Distance(dynObjects[_local1].x, dynObjects[_local1].y, hero.x, hero.y) < (stage.stageWidth * 1.6)){
if (dynObjects[_local1].gravityEnable){
dynObjects[_local1].speed.y = (dynObjects[_local1].speed.y + (grav * dynObjects[_local1].gravityFactor));
};
dynObjects[_local1].speed.y = ((dynObjects[_local1].speed.y)>dynObjects[_local1].maxSpeed.y) ? dynObjects[_local1].maxSpeed.y : dynObjects[_local1].speed.y;
dynObjects[_local1].y = (dynObjects[_local1].y + dynObjects[_local1].speed.y);
if (dynObjects[_local1].collisionEnable){
_local2 = int((((dynObjects[_local1].x - dynObjects[_local1].width) - minLimX) / limitersCacheStep));
_local3 = int((((dynObjects[_local1].x + dynObjects[_local1].width) - minLimX) / limitersCacheStep));
_local4 = _local2;
while (_local4 <= _local3) {
if (((limitersCache[_local4]) && (limitersCache[_local4].length))){
checkHitPlatform(dynObjects[_local1], limitersCache[_local4]);
};
_local4++;
};
};
};
};
_local1++;
};
}
public function cleenUP():void{
cleenUP_FX();
cleenUP_Proj();
cleenUP_Prop();
cleenUP_Actors();
}
function mouseLeave(_arg1:Event):void{
showGameMenu();
}
public function addLineDamageToEnemy(_arg1:ageVector, _arg2:Number, _arg3:actorObject, _arg4:Boolean){
var _local5:projObject = new projObject();
_local5.damage = _arg2;
_local5.x = _arg1.x;
_local5.y = _arg1.y;
_local5.fromGoodGuy = _arg4;
_arg3.transmitDamage(_local5);
_local5.clearDynObject();
}
public function addFX_BloodOnGround(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new bloodOnGround();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.gotoAndStop(ageMath.RandomInt(1, 5));
_local3.scaleY = 0.5;
_local3.fadeSpeed = 0.005;
_local3.startFadeOut();
projLayer.addChild(_local3);
_local3.curDispContainer = projLayer;
fxObjects.push(_local3);
return (_local3);
}
public function cleenUP_Proj():void{
var _local1:int;
_local1 = 0;
while (_local1 < projObjects.length) {
if (((projObjects[_local1]) && ((projObjects[_local1].visible == false)))){
projObjects[_local1].clearDynObject();
if (projObjects[_local1]){
if (projObjects[_local1].parent){
projObjects[_local1].parent.removeChild(projObjects[_local1]);
};
};
projObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function cleenUP_Actors():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < enemies.length) {
if (((((enemies[_local1]) && ((enemies[_local1].visible == false)))) && (enemies[_local1].dead))){
_local2 = 0;
while (_local2 < dynObjects.length) {
if (dynObjects[_local2] == enemies[_local1]){
dynObjects[_local2].clearDynObject();
dynObjects.splice(_local2, 1);
break;
};
_local2++;
};
enemies[_local1].clearActorObject();
if (enemies[_local1]){
if (enemies[_local1].parent){
enemies[_local1].parent.removeChild(enemies[_local1]);
};
};
enemies.splice(_local1, 1);
break;
};
_local1++;
};
}
public function addBlasterProj(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new blasterProj();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProp_Shotgun(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propShotgun();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function UpdateProjObjects():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < projObjects.length) {
if (projObjects[_local1].visible == false){
} else {
if (projObjects[_local1].gravityEnable){
projObjects[_local1].Velocity.y = (projObjects[_local1].Velocity.y + (grav * projObjects[_local1].gravityFactor));
projObjects[_local1].Velocity.y = ((projObjects[_local1].Velocity.y)>projObjects[_local1].maxSpeed.y) ? projObjects[_local1].maxSpeed.y : projObjects[_local1].Velocity.y;
};
projObjects[_local1].updateDynObj();
if (!projObjects[_local1].fromGoodGuy){
if (((!(hero.dead)) && (hero.hitTestProj(projObjects[_local1])))){
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
} else {
hero.transmitDamage(projObjects[_local1]);
Game(parent).gameGUI.painFrame.startFadeOut();
};
};
} else {
_local2 = 0;
while (_local2 < enemies.length) {
if (((!(enemies[_local2].dead)) && (enemies[_local2].hitTestProj(projObjects[_local1])))){
mainGlobal.shootingInEnemies++;
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
} else {
enemies[_local2].transmitDamage(projObjects[_local1]);
};
};
_local2++;
};
};
if (ageMath.Distance(projObjects[_local1].x, projObjects[_local1].y, hero.x, hero.y) > 670){
projObjects[_local1].visible = false;
};
if (testIntersectLimiterOnScr(projObjects[_local1])){
projObjects[_local1].visible = false;
if (projObjects[_local1].blastStyle){
addExplotion(projObjects[_local1]);
addFX_littleBlast(projObjects[_local1].x, projObjects[_local1].y);
addFX_littleSmoke(projObjects[_local1].x, projObjects[_local1].y);
sounds.PlaySnd("bombExp", 1.5, projObjects[_local1], projObjects[_local1].stage);
projObjects[_local1].visible = false;
};
};
};
_local1++;
};
}
public function UpdateLimitersOnScr():void{
var _local1:int;
var _local2:int;
var _local3:*;
var _local4:int;
var _local5:Point;
var _local6:Rectangle;
var _local7:Rectangle;
limitersOnScr = [];
_local1 = int(((-(x) - minLimX) / limitersCacheStep));
_local2 = int((((-(x) + stage.stageWidth) - minLimX) / limitersCacheStep));
_local4 = _local1;
while (_local4 <= _local2) {
if (limitersCache[_local4]){
_local3 = 0;
while (_local3 < limitersCache[_local4].length) {
_local5 = this.localToGlobal(new Point(limitersCache[_local4][_local3].x, limitersCache[_local4][_local3].y));
_local6 = new Rectangle(_local5.x, _local5.y, limitersCache[_local4][_local3].width, limitersCache[_local4][_local3].height);
_local7 = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
if (_local7.intersects(_local6)){
limitersOnScr.push(limitersCache[_local4][_local3]);
};
_local3++;
};
};
_local4++;
};
}
public function cleenUP_Prop():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < propObjects.length) {
if (((propObjects[_local1]) && ((propObjects[_local1].visible == false)))){
_local2 = 0;
while (_local2 < dynObjects.length) {
if (dynObjects[_local2] == propObjects[_local1]){
dynObjects[_local2].clearDynObject();
dynObjects.splice(_local2, 1);
break;
};
_local2++;
};
if (propObjects[_local1]){
if (propObjects[_local1].parent){
propObjects[_local1].parent.removeChild(propObjects[_local1]);
};
};
propObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function addFX_BloodLeak(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new bloodLeak();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.fadeSpeed = 0.005;
_local3.startFadeOut();
projLayer.addChild(_local3);
_local3.curDispContainer = projLayer;
fxObjects.push(_local3);
return (_local3);
}
function frame1(){
initFirst = true;
}
public function addFX_Splatters(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxBloodSpatters();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function term(){
var _local1:int;
removeEventListener(Event.ENTER_FRAME, Update);
_local1 = 0;
while (_local1 < enemies.length) {
enemies[_local1].clearActorObject();
_local1++;
};
_local1 = 0;
while (_local1 < dynObjects.length) {
dynObjects[_local1].clearDynObject();
_local1++;
};
dynObjects = [];
enemies = [];
goodNPC = [];
projObjects = [];
paralaxObjects = [];
chunkObjects = [];
fxObjects = [];
propObjects = [];
addActorsArr = [];
limitersCache = [];
limitersOnScr = [];
limiters = [];
}
public function addBlinkFX_OverLight2():void{
Game(parent).gameGUI.fxblink2.fadeMaxLimit = 1;
Game(parent).gameGUI.fxblink2.fadeSpeed = 0.03;
Game(parent).gameGUI.fxblink2.use_force_restart = true;
Game(parent).gameGUI.fxblink2.startFadeOut();
}
public function addProp_Coin(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propCoin();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
public function cleenUP_FX():void{
var _local1:int;
_local1 = 0;
while (_local1 < fxObjects.length) {
if (((fxObjects[_local1]) && ((fxObjects[_local1].visible == false)))){
if (fxObjects[_local1]){
if (fxObjects[_local1].parent){
fxObjects[_local1].parent.removeChild(fxObjects[_local1]);
};
};
fxObjects.splice(_local1, 1);
break;
};
_local1++;
};
}
public function addProp_Dynamite(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propDynamite();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function testIntersectLimiterOnScr(_arg1:dynObject):Boolean{
var _local2:int;
_local2 = 0;
while (_local2 < limitersOnScr.length) {
if (((!(limitersOnScr[_local2].slimMode)) && (limitersOnScr[_local2].hitTestObject(_arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public function addProp_MedKit(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new dropMedKit();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function addFX_Headshot(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxHeadshot();
_local3.x = _arg1;
_local3.y = _arg2;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function addProp_Money1(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMoney1();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
public function addProp_Money2(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propMoney2();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.speed.y = -18;
_local3.speed.x = ageMath.Random(-2, 2);
_local3.stayTime = 4000;
_local3.timerStayDelay.start();
propLayer.addChild(_local3);
return (_local3);
}
function showGameMenu():void{
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
Game(root).menuInGame.visible = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuInGame.startFadeIn();
}
public function UpdatePropObjects():void{
var _local1:int;
_local1 = 0;
while (_local1 < propObjects.length) {
if (propObjects[_local1].visible == false){
} else {
if (ageMath.Distance(propObjects[_local1].x, propObjects[_local1].y, hero.x, hero.y) >= (stage.stageWidth * 1.6)){
} else {
propObjects[_local1].x = (propObjects[_local1].x + propObjects[_local1].speed.x);
if (propObjects[_local1].useRotateSpeed){
propObjects[_local1].body.rotation = (propObjects[_local1].body.rotation + propObjects[_local1].rotateSpeed);
};
if ((((((((((((propObjects[_local1].propType == "Med")) || ((propObjects[_local1].propType == "Coin")))) || ((propObjects[_local1].propType == "Money")))) || ((propObjects[_local1].propType == "Weapon")))) || ((propObjects[_local1].propType == "Item")))) || ((propObjects[_local1].propType == "Ammo")))){
if (hero.hitTestObject(propObjects[_local1])){
if (propObjects[_local1].propType == "Ammo"){
if (hero.weapons[propObjects[_local1].wepNum].active){
if (hero.weapons[propObjects[_local1].wepNum].bulletsNum < hero.weapons[propObjects[_local1].wepNum].bulletsNumMax){
propObjects[_local1].visible = false;
hero.weapons[propObjects[_local1].wepNum].bulletsNum = (hero.weapons[propObjects[_local1].wepNum].bulletsNum + (hero.weapons[propObjects[_local1].wepNum].bulletsInCatrigeMax * propObjects[_local1].moneyAmount));
if (hero.weapons[propObjects[_local1].wepNum].bulletsNum > hero.weapons[propObjects[_local1].wepNum].bulletsNumMax){
hero.weapons[propObjects[_local1].wepNum].bulletsNum = hero.weapons[propObjects[_local1].wepNum].bulletsNumMax;
};
sounds.PlaySnd((hero.weapons[propObjects[_local1].wepNum].type + "Reloaded"));
};
};
} else {
if (propObjects[_local1].propType == "Med"){
if (hero.life < hero.lifeMax){
propObjects[_local1].visible = false;
hero.life = (hero.life + propObjects[_local1].moneyAmount);
if (hero.life > hero.lifeMax){
hero.life = hero.lifeMax;
};
sounds.PlaySnd("Med");
};
} else {
if (propObjects[_local1].propType == "Item"){
propObjects[_local1].visible = false;
hero.itemsInBag.push(propObjects[_local1].itemName);
sounds.PlaySnd("itemTake");
} else {
if (propObjects[_local1].propType == "Weapon"){
propObjects[_local1].visible = false;
hero.weapons[propObjects[_local1].wepNum].active = true;
hero.curWeaponNum = (propObjects[_local1].wepNum + 1);
sounds.PlaySnd((hero.weapons[(hero.curWeaponNum - 1)].type + "Reloaded"));
} else {
propObjects[_local1].visible = false;
sounds.PlaySnd((propObjects[_local1].propType + "1"));
hero.moneyCnt = (hero.moneyCnt + propObjects[_local1].moneyAmount);
mainGlobal.moneyCollected = (mainGlobal.moneyCollected + propObjects[_local1].moneyAmount);
};
};
};
};
};
};
};
};
_local1++;
};
}
public function testRayToLimiterOnScr(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean=false, _arg6:Object=null):ageVector{
var _local10:int;
var _local11:ageVector;
var _local12:Number;
var _local13:ageVector;
var _local14:Number;
var _local7:ageVector;
var _local8:ageVector = new ageVector(_arg1, _arg3);
var _local9:Number = Number.MAX_VALUE;
_local10 = 0;
while (_local10 < limitersOnScr.length) {
if (!limitersOnScr[_local10].slimMode){
_local11 = ageMath.getLineCrossRect(_arg1, _arg2, _arg3, _arg4, limitersOnScr[_local10].x, limitersOnScr[_local10].y, (limitersOnScr[_local10].x + limitersOnScr[_local10].width), (limitersOnScr[_local10].y + limitersOnScr[_local10].height));
if (_local11 != null){
if (_local7 == null){
_local7 = new ageVector();
_local7.copy(_local11);
_local9 = ageMath.DistanceVec(_local8, _local7);
} else {
_local12 = ageMath.DistanceVec(_local8, _local11);
if (_local12 < _local9){
_local9 = _local12;
_local7.copy(_local11);
};
};
};
};
_local10++;
};
if (!_arg5){
return (_local7);
};
_arg6.id = -1;
_local10 = 0;
while (_local10 < enemies.length) {
if (enemies[_local10].dead){
} else {
_local13 = enemies[_local10].hitTestLine(_arg1, _arg2, _arg3, _arg4);
if (_local13 != null){
if (_local7 == null){
_local7 = new ageVector();
_local7.copy(_local13);
_arg6.id = _local10;
_local9 = ageMath.DistanceVec(_local8, _local7);
} else {
_local14 = ageMath.DistanceVec(_local8, _local13);
if (_local14 < _local9){
_local9 = _local14;
_arg6.id = _local10;
_local7.copy(_local13);
};
};
};
};
_local10++;
};
return (_local7);
}
public function addProj_Psy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new psyProj();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
_local6.gravityComp = false;
_local6.infAmmo = true;
_local6.usePsyDamage = true;
_local6.psyDamageVal = 16;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProj_MinigunBeam(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
var _local10:ageVector = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local10.normThis();
_local10.mulScalar(600);
_arg3 = (_local10.x + _arg1);
_arg4 = (_local10.y + _arg2);
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projMinigunBeam();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.gravityEnable = false;
var _local11:Object = {id:-1};
var _local12:ageVector = testRayToLimiterOnScr(_arg1, _arg2, _arg3, _arg4, true, _local11);
if (_local12 != null){
_arg3 = _local12.x;
_arg4 = _local12.y;
if (_local11.id != -1){
mainGlobal.shootingInEnemies++;
addLineDamageToEnemy(_local12, _arg5.damage, enemies[_local11.id], true);
};
};
_local6.scaleX = (ageMath.Distance(_arg1, _arg2, _arg3, _arg4) / 34);
_local6.rotation = _local8;
var _local13:Array = new Array();
_local13.push(new GlowFilter(0xFFFF00, 1, 15, 15, 4, BitmapFilterQuality.MEDIUM));
_local6.filters = _local13;
if (_arg5 != null){
};
this["FXLayer"].addChild(_local6);
fxObjects.push(_local6);
return (_local6);
}
public function addProj_LaserBeam(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
var _local10:ageVector = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local10.normThis();
_local10.mulScalar(600);
_arg3 = (_local10.x + _arg1);
_arg4 = (_local10.y + _arg2);
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projLaserBeam();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.gravityEnable = false;
var _local11:ageVector = testRayToLimiterOnScr(_arg1, _arg2, _arg3, _arg4);
if (_local11 != null){
_arg3 = _local11.x;
_arg4 = _local11.y;
};
if (addLineDamage(_arg1, _arg2, _arg3, _arg4, _arg5.damage)){
mainGlobal.shootingInEnemies++;
};
_local6.scaleX = (ageMath.Distance(_arg1, _arg2, _arg3, _arg4) / 34);
_local6.rotation = _local8;
_local6.use_force_restart = true;
_local6.fadeSpeed = 0.1;
_local6.startFadeOut();
_local6.gravityEnable = false;
var _local12:Array = new Array();
_local12.push(new GlowFilter(0xFF0000, 1, 15, 15, 1.7, BitmapFilterQuality.MEDIUM));
_local6.filters = _local12;
if (_arg5 != null){
};
this["FXLayer"].addChild(_local6);
fxObjects.push(_local6);
return (_local6);
}
public function addProj(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projBullet();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, 24);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = true;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addFX_littleBlast(_arg1:Number, _arg2:Number, _arg3:Number=1.5){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
addBlinkFX_OverLight();
_local4 = new fxBlast();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.blendMode = BlendMode.SCREEN;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function addProj_BombWep(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projBombWep();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
_local6.blastStyle = _arg5.blastStyle;
_local6.attackRadius = _arg5.damageRadius;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function levScript(){
var _local1:int;
var _local2:Point;
if (!sVar["triggerUpgrade1"]){
if (triggerUpgrade1.hitTestObject(hero)){
if (((Controls.keyNew[Keyboard.ENTER]) || (Controls.keyNew[69]))){
openUpgradeMenu();
};
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(5);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
} else {
if (!triggerUpgrade2.hitTestObject(hero)){
if (!leveler1Trigger.hitTestObject(hero)){
if (!leveler2Trigger.hitTestObject(hero)){
if (!leveler3Trigger.hitTestObject(hero)){
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 5)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
};
};
};
};
if (!sVar["triggerUpgrade2"]){
if (triggerUpgrade2.hitTestObject(hero)){
if (((Controls.keyNew[Keyboard.ENTER]) || (Controls.keyNew[69]))){
openUpgradeMenu();
};
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(5);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
} else {
if (!triggerUpgrade1.hitTestObject(hero)){
if (!leveler1Trigger.hitTestObject(hero)){
if (!leveler2Trigger.hitTestObject(hero)){
if (!leveler3Trigger.hitTestObject(hero)){
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 5)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
};
};
};
};
if (!sVar["leveler1Trigger"]){
if (leveler1Trigger.hitTestObject(hero)){
if (hero.isItemExist("lever")){
sVar["leveler1Trigger"] = true;
hero.removeItemFromBag("lever");
leveler1.play();
hatch1.play();
sounds.PlaySnd("sewerDoorOpen");
} else {
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(9);
Game(parent).gameGUI.hlpControl.pic2.gotoAndStop("lever");
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
};
} else {
if (!triggerUpgrade1.hitTestObject(hero)){
if (!triggerUpgrade2.hitTestObject(hero)){
if (!leveler2Trigger.hitTestObject(hero)){
if (!leveler3Trigger.hitTestObject(hero)){
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 9)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
};
};
};
} else {
_local2 = this.globalToLocal(MovieClip(hatch1).localToGlobal(new Point(hatch1.anmPoint.x, hatch1.anmPoint.y)));
hatch1Lim.y = _local2.y;
};
if (!sVar["leveler2Trigger"]){
if (leveler2Trigger.hitTestObject(hero)){
if (hero.isItemExist("lever")){
sVar["leveler2Trigger"] = true;
hero.removeItemFromBag("lever");
leveler2.play();
hatch2.play();
sounds.PlaySnd("sewerDoorOpen");
} else {
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(9);
Game(parent).gameGUI.hlpControl.pic2.gotoAndStop("lever");
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
};
} else {
if (!triggerUpgrade1.hitTestObject(hero)){
if (!triggerUpgrade2.hitTestObject(hero)){
if (!leveler1Trigger.hitTestObject(hero)){
if (!leveler3Trigger.hitTestObject(hero)){
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 9)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
};
};
};
} else {
_local2 = this.globalToLocal(MovieClip(hatch2).localToGlobal(new Point(hatch2.anmPoint.x, hatch2.anmPoint.y)));
hatch2Lim.y = _local2.y;
};
if (!sVar["leveler3Trigger"]){
if (leveler3Trigger.hitTestObject(hero)){
if (hero.isItemExist("lever")){
sVar["leveler3Trigger"] = true;
hero.removeItemFromBag("lever");
leveler3.play();
hatch3.play();
sounds.PlaySnd("sewerDoorOpen");
} else {
if (!Game(parent).gameGUI.hlpControl.visible){
Game(parent).gameGUI.hlpControl.showHelp(9);
Game(parent).gameGUI.hlpControl.pic2.gotoAndStop("lever");
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
};
};
} else {
if (!triggerUpgrade1.hitTestObject(hero)){
if (!triggerUpgrade2.hitTestObject(hero)){
if (!leveler1Trigger.hitTestObject(hero)){
if (!leveler2Trigger.hitTestObject(hero)){
if ((((Game(parent).gameGUI.hlpControl.currentFrame == 9)) && ((Game(parent).gameGUI.hlpControl.alpha > 0.9999)))){
Game(parent).gameGUI.hlpControl.hideHelp();
};
};
};
};
};
};
} else {
_local2 = this.globalToLocal(MovieClip(hatch3).localToGlobal(new Point(hatch3.anmPoint.x, hatch3.anmPoint.y)));
hatch3Lim.y = _local2.y;
};
if (!sVar["triggerSecret1"]){
if (triggerSecret1.hitTestObject(hero)){
sVar["triggerSecret1"] = true;
Game(parent).gameGUI.hlpControl.showHelp(7);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
mainGlobal.secretsFound++;
};
};
if (!sVar["triggerSecret2"]){
if (triggerSecret2.hitTestObject(hero)){
sVar["triggerSecret2"] = true;
Game(parent).gameGUI.hlpControl.showHelp(7);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
mainGlobal.secretsFound++;
};
};
if (!sVar["triggerSecret3"]){
if (triggerSecret3.hitTestObject(hero)){
sVar["triggerSecret3"] = true;
Game(parent).gameGUI.hlpControl.showHelp(7);
Game(parent).gameGUI.hlpControl.timerStayDelay.stop();
Game(parent).gameGUI.hlpControl.timerStayDelay.delay = Game(parent).gameGUI.hlpControl.minDelay;
Game(parent).gameGUI.hlpControl.timerStayDelay.start();
mainGlobal.secretsFound++;
};
};
if (!sVar["startBomb"]){
if ((((hero.x > (bomberLeftBorder.x + bomberLeftBorder.width))) && ((hero.x < bomberRightBorder.x)))){
sVar["startBomb"] = true;
levLeftLim = bomberLeftBorder.x;
levRightLim = bomberRightBorder.x;
musicEnv.fadeTo("roboAttack");
bomber1.alwaysSeeEnemy = true;
};
} else {
if (!sVar["BombDead"]){
if ((bomber1.x - (bomber1.width / 2)) < bomberLeftBorder.x){
bomber1.x = (bomberLeftBorder.x + (bomber1.width / 2));
bomber1.fsmAI.AlienBomber_changeTarget();
} else {
if ((bomber1.x + (bomber1.width / 2)) > bomberRightBorder.x){
bomber1.x = (bomberRightBorder.x - (bomber1.width / 2));
bomber1.fsmAI.AlienBomber_changeTarget();
};
};
if ((((bomber1 == null)) || ((((bomber1.visible == false)) && (bomber1.dead))))){
sVar["BombDead"] = true;
levLeftLim = levelLeftBorder.x;
levRightLim = levelRightBorder.x;
musicEnv.fadeTo(levelMus);
};
};
};
if (!sVar["triggerBossMusBegin"]){
if (triggerBossMusBegin.hitTestObject(hero)){
sVar["triggerBossMusBegin"] = true;
musicEnv.fadeTo("musTrasher");
};
} else {
if (!sVar["triggerBossMusEnd"]){
if (triggerBossMusEnd.hitTestObject(hero)){
sVar["triggerBossMusEnd"] = true;
musicEnv.fadeTo(levelMus);
};
};
};
if (!isWin){
if (levelEnd.hitTestObject(hero)){
isWin = true;
Game(root).gameGUI.startFadeOut();
Game(root).menuWinLose.startFadeIn();
Game(root).menuWinLose.setToWin();
mainGlobal.paused = true;
Game(root).cursor.gotoAndStop("arrow");
musicEnv.fadeTo("musWin");
return;
};
};
}
public function addProj_Rocket(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projRocket();
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.x = (_local6.x - _local6.Velocity.x);
_local6.y = (_local6.y - _local6.Velocity.y);
_local6.rotation = _local8;
_local6.fromGoodGuy = true;
_local6.gravityEnable = false;
if (_arg5 != null){
_local6.damage = _arg5.damage;
_local6.blastStyle = _arg5.blastStyle;
_local6.attackRadius = _arg5.damageRadius;
};
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProp_Debris(_arg1:Number, _arg2:Number, _arg3:Number=1, _arg4:String=""):propObject{
var _local5:propObject;
_local5 = new propDebris();
_local5.x = _arg1;
_local5.y = _arg2;
_local5.speed.y = (ageMath.Random(-6, -18) * _arg3);
_local5.speed.x = (ageMath.Random(-10, 10) * _arg3);
if (_arg4.length){
_local5.gotoAndStop(_arg4);
} else {
_local5.gotoAndStop(ageMath.RandomInt(1, 20));
};
_local5.curLevel = this;
dynObjects.push(_local5);
propObjects.push(_local5);
_local5.isRubber = true;
_local5.stayTime = (3000 + ageMath.RandomInt(1, 2000));
_local5.timerStayDelay.start();
_local5.useRotateSpeed = true;
_local5.rotateSpeed = ageMath.RandomInt(-15, 15);
propLayer.addChild(_local5);
return (_local5);
}
public function addLimiter(_arg1){
limiters.push(_arg1);
}
public function alignObjXToAnother(_arg1, _arg2):void{
if ((_arg1.x - (_arg1.width * 0.5)) < _arg2.x){
_arg1.x = (_arg1.x + (_arg2.x - (_arg1.x - (_arg1.width * 0.5))));
};
if ((_arg1.x + (_arg1.width * 0.5)) > (_arg2.x + _arg2.width)){
_arg1.x = (_arg1.x - ((_arg1.x + (_arg1.width * 0.5)) - (_arg2.x + _arg2.width)));
};
}
public function addExplotion(_arg1:projObject, _arg2:actorObject=null):void{
var _local3:Number;
var _local5:int;
_local3 = ageMath.Distance(_arg1.x, _arg1.y, hero.x, hero.y);
var _local4:projObject = new projObject();
if (_local3 < _arg1.attackRadius){
_local4.damage = ageMath.RemapVal(_local3, 0, _arg1.attackRadius, _arg1.damage, 0);
_local4.x = hero.x;
_local4.y = (hero.y - (hero.height / 2));
_local4.fromGoodGuy = false;
hero.transmitDamage(_local4);
Game(parent).gameGUI.painFrame.startFadeOut();
_local4.clearDynObject();
};
_local5 = 0;
while (_local5 < enemies.length) {
if (((((enemies[_local5].dead) && (!((_arg2 == null))))) && (!((_arg2 == enemies[_local5]))))){
} else {
_local3 = ageMath.Distance(_arg1.x, _arg1.y, enemies[_local5].x, enemies[_local5].y);
if (_local3 < _arg1.attackRadius){
_local4.damage = ageMath.RemapVal(_local3, 0, _arg1.attackRadius, _arg1.damage, 0);
_local4.x = enemies[_local5].x;
_local4.y = (enemies[_local5].y - (enemies[_local5].height / 2));
_local4.fromGoodGuy = true;
enemies[_local5].transmitDamage(_local4);
_local4.clearDynObject();
};
};
_local5++;
};
}
public function ifMCOnScreen(_arg1:MovieClip):Boolean{
var _local2:Point = this.localToGlobal(new Point(_arg1.x, _arg1.y));
var _local3:Rectangle = _arg1.getBounds(root);
var _local4:Rectangle = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
if (_local4.intersects(_local3)){
return (true);
};
return (false);
}
public function addFX_BlastWave(_arg1:Number, _arg2:Number, _arg3:Number=1){
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:ageVector;
_local4 = new fxBlastWave();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.scaleX = (_local4.scaleY = _arg3);
FXLayer.addChild(_local4);
_local4.curDispContainer = FXLayer;
fxObjects.push(_local4);
}
public function addActor(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:int=-1):actorObject{
var _local6:actorObject;
if (_arg1 == "AlienSaw"){
_local6 = new AlienSaw();
} else {
if (_arg1 == "AlienHunter"){
_local6 = new AlienHunter();
} else {
if (_arg1 == "AlienElectro"){
_local6 = new AlienElectro();
} else {
if (_arg1 == "Zomb01"){
_local6 = new Zomb01();
} else {
if (_arg1 == "Zomb02"){
_local6 = new Zomb02();
} else {
if (_arg1 == "Zomb03"){
_local6 = new Zomb03();
} else {
if (_arg1 == "Zomb04"){
_local6 = new Zomb04();
} else {
if (_arg1 == "Zomb05"){
_local6 = new Zomb05();
} else {
if (_arg1 == "Zomb01Run"){
_local6 = new Zomb01Run();
} else {
if (_arg1 == "Zomb02Run"){
_local6 = new Zomb02Run();
} else {
if (_arg1 == "Zomb03Run"){
_local6 = new Zomb03Run();
} else {
if (_arg1 == "Zomb04Run"){
_local6 = new Zomb04Run();
} else {
if (_arg1 == "Zomb05Run"){
_local6 = new Zomb05Run();
} else {
if (_arg1 == "Zomb01Vomit"){
_local6 = new Zomb01Vomit();
} else {
if (_arg1 == "Zomb02Vomit"){
_local6 = new Zomb02Vomit();
} else {
if (_arg1 == "Zomb03Vomit"){
_local6 = new Zomb03Vomit();
} else {
if (_arg1 == "Zomb04Vomit"){
_local6 = new Zomb04Vomit();
} else {
if (_arg1 == "Zomb05Vomit"){
_local6 = new Zomb05Vomit();
} else {
if (_arg1 == "Spider"){
_local6 = new Spider();
} else {
if (_arg1 == "AlienBomber"){
_local6 = new AlienBomber();
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
_local6.x = _arg3;
_local6.y = _arg4;
_local6.name = _arg2;
if (!_local6.noStatEnemy){
mainGlobal.enemiesAll++;
};
if (_arg5 < 0){
addChild(_local6);
} else {
addChildAt(_local6, _arg5);
};
return (_local6);
}
public function levInit(){
var _local1:int;
mainGlobal.secretsAll = 3;
curLevNum = 9;
curLevScore = 3500;
levelMus = "musGlory";
musicEnv.fadeTo(levelMus);
Game(parent).sky.visible = true;
levLeftLim = levelLeftBorder.x;
levRightLim = levelRightBorder.x;
}
public function addFX_MetalSparks(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:ageVector;
_local3 = new fxMetalSparks();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.blendMode = BlendMode.ADD;
FXLayer.addChild(_local3);
_local3.curDispContainer = FXLayer;
fxObjects.push(_local3);
}
public function addProp_Blaster(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propBlaster();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
public function UpdateEnemies():void{
var _local1:int;
_local1 = 0;
while (_local1 < enemies.length) {
if (((enemies[_local1].dead) || ((enemies[_local1].life <= 0)))){
} else {
if (((((!((enemies[_local1].parent as Level))) || (enemies[_local1].alwaysSeeEnemy))) || ((ageMath.Distance(enemies[_local1].x, enemies[_local1].y, hero.x, hero.y) < (stage.stageWidth * 1.6))))){
enemies[_local1].updateActorEnemy();
};
};
_local1++;
};
}
public function addProj_Vomit(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:weaponParam=null){
var _local6:projObject;
var _local7:Number;
var _local8:Number;
var _local9:ageVector;
_local9 = new ageVector((_arg3 - _arg1), (_arg4 - _arg2));
_local8 = _local9.getAngleDeg();
if (_local8 > 180){
_local8 = (_local8 - 360);
} else {
if (_local8 < -180){
_local8 = (_local8 + 360);
};
};
_local6 = new projVomit();
if (_arg5 != null){
_local6.damage = _arg5.damage;
};
_local6.timerFXAdd.delay = 80;
_local6.timerFXAdd.start();
_local6.fxFunc = addFX_VomitSplatters;
_local6.x = _arg1;
_local6.y = _arg2;
_local6.setVelocity(_local9.x, _local9.y, _arg5.bulletSpeed);
_local6.rotation = _local8;
_local6.fromGoodGuy = false;
_local6.gravityEnable = true;
_local6.gravityComp = true;
_local6.infAmmo = true;
_local6.useBioDamage = true;
_local6.bioDamageVal = 10;
this["projLayer"].addChild(_local6);
projObjects.push(_local6);
return (_local6);
}
public function addProp_blasterAmmo(_arg1:Number, _arg2:Number):propObject{
var _local3:propObject;
_local3 = new propBlasterAmmo();
_local3.x = _arg1;
_local3.y = _arg2;
propLayer.addChild(_local3);
return (_local3);
}
}
}//package main
Section 87
//lifeBar (main.lifeBar)
package main {
public dynamic class lifeBar extends alphaFader {
public function lifeBar(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
visible = false;
fadeSpeed = 0.05;
use_force_restart = true;
}
}
}//package main
Section 88
//limiter (main.limiter)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class limiter extends MovieClip {
public function limiter(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
this.wideGround = false;
this.slimMode = false;
Level(parent).addLimiter(this);
}
}
}//package main
Section 89
//LuncherAmmo (main.LuncherAmmo)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class LuncherAmmo extends propObject {
public function LuncherAmmo(){
addFrameScript(0, frame1);
}
function frame1(){
if ((parent as Level)){
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
} else {
if ((parent.parent as Level)){
curLevel = Level(parent.parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
};
};
this.propType = "Ammo";
this.wepNum = 5;
this.moneyAmount = 1;
}
}
}//package main
Section 90
//mainGlobal (main.mainGlobal)
package main {
import flash.display.*;
import flash.geom.*;
public dynamic class mainGlobal {
public static var secretsAll:uint = 0;
public static var configMusicOn:Boolean = true;
public static var enemiesKilled:uint = 0;
public static var enemiesAll:uint = 0;
public static var configDebrisOn:Boolean = true;
public static var configQuaHigh:Boolean = true;
public static var shootingInEnemies:uint = 0;
public static var lastLevelReached:uint = 0;
public static var configVfxOn:Boolean = true;
public static var moneyCollected:uint = 0;
public static var dontLoadHeroParam:Boolean = true;
public static var configSoundOn:Boolean = true;
public static var paused:Boolean = false;
public static var noAds:Boolean = false;
public static var myCookie:Cookie = new Cookie("StarkRavingTed_Save");
public static var isSingleEp:Boolean = false;
public static var shootingAll:uint = 0;
public static var secretsFound:uint = 0;
public static function initCookie(){
configMusicOn = true;
configSoundOn = true;
configQuaHigh = true;
configVfxOn = true;
configDebrisOn = true;
saveConfig();
lastLevelReached = 1;
myCookie.put("lastLevelReached", lastLevelReached);
}
public static function RasterizeClip(_arg1:Sprite):void{
var _local2:Rectangle = _arg1.getBounds(_arg1);
var _local3:BitmapData = new BitmapData(_local2.width, _local2.height, true, 0);
var _local4:Matrix = new Matrix();
_local4.translate(-(_local2.x), -(_local2.y));
_local3.draw(_arg1, _local4);
while (_arg1.numChildren > 0) {
_arg1.removeChildAt(0);
};
_arg1.graphics.clear();
var _local5:Bitmap = new Bitmap(_local3);
_local5.x = _local2.x;
_local5.y = _local2.y;
_arg1.addChild(_local5);
}
public static function loadConfig(){
configMusicOn = Boolean(myCookie.get("configMusicOn"));
configSoundOn = Boolean(myCookie.get("configSoundOn"));
configQuaHigh = Boolean(myCookie.get("configQuaHigh"));
configVfxOn = Boolean(myCookie.get("configVfxOn"));
configDebrisOn = Boolean(myCookie.get("configDebrisOn"));
}
public static function clearLevelData(){
myCookie.clear();
myCookie.putNoFlush("lastLevelReached", lastLevelReached);
saveConfig();
}
public static function loadStatParam(){
lastLevelReached = uint(myCookie.get("lastLevelReached"));
if (lastLevelReached == 0){
lastLevelReached = 1;
myCookie.put("lastLevelReached", lastLevelReached);
};
}
public static function isCookieExist():Boolean{
return (myCookie.isExist());
}
public static function applyConfig(){
sounds.sndEnable = configSoundOn;
musicEnv.musEnable = configMusicOn;
musicEnv.played(configMusicOn);
}
public static function saveConfig(){
myCookie.putNoFlush("configMusicOn", configMusicOn);
myCookie.putNoFlush("configSoundOn", configSoundOn);
myCookie.putNoFlush("configQuaHigh", configQuaHigh);
myCookie.putNoFlush("configVfxOn", configVfxOn);
myCookie.putNoFlush("configDebrisOn", configDebrisOn);
myCookie.flushData();
}
public static function initStat(){
enemiesAll = 0;
enemiesKilled = 0;
shootingAll = 0;
shootingInEnemies = 0;
moneyCollected = 0;
secretsFound = 0;
secretsAll = 0;
}
}
}//package main
Section 91
//MCButton (main.MCButton)
package main {
import flash.display.*;
import flash.events.*;
public dynamic class MCButton extends MovieClip {
public function MCButton(){
addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
addEventListener(MouseEvent.ROLL_OVER, onMouseOver, false, 0, true);
stop();
}
private function onMouseDown(_arg1:MouseEvent):void{
gotoAndStop(3);
}
private function onMouseUp(_arg1:MouseEvent):void{
gotoAndStop(2);
}
private function onMouseOver(_arg1:MouseEvent):void{
removeEventListener(MouseEvent.ROLL_OVER, onMouseOver);
addEventListener(MouseEvent.ROLL_OUT, onMouseOut, false, 0, true);
gotoAndStop(2);
}
private function onMouseOut(_arg1:MouseEvent):void{
removeEventListener(MouseEvent.ROLL_OUT, onMouseOut);
addEventListener(MouseEvent.ROLL_OVER, onMouseOver, false, 0, true);
gotoAndStop(1);
}
}
}//package main
Section 92
//menuClick (main.menuClick)
package main {
import flash.media.*;
public dynamic class menuClick extends Sound {
}
}//package main
Section 93
//menuHide2 (main.menuHide2)
package main {
import flash.media.*;
public dynamic class menuHide2 extends Sound {
}
}//package main
Section 94
//menuInGame (main.menuInGame)
package main {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class menuInGame extends alphaFader {
public var logoOG:MovieClip;
public var butContinue:SimpleButton;
public var butWalk:SimpleButton;
public var butOptions:SimpleButton;
public var butExit:SimpleButton;
public function menuInGame(){
addFrameScript(0, frame1);
butContinue.addEventListener(MouseEvent.CLICK, butContinue_Click);
butOptions.addEventListener(MouseEvent.CLICK, butOptions_Click);
butExit.addEventListener(MouseEvent.CLICK, butExit_Click);
butWalk.addEventListener(MouseEvent.CLICK, butWalk_Click);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keydwn);
}
function butWalk_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
navigateToURL(new URLRequest("http://onlinegamer.cc/index.php?task=view_page&id=2"), "_blank");
}
function frame1(){
logoOG.addEventListener(MouseEvent.CLICK, logoOG_click);
logoOG.buttonMode = true;
}
public function logoOG_click(_arg1:Event):void{
navigateToURL(new URLRequest("http://www.onlinegamer.cc?utm_source=Ted&utm_medium=menuInGame"), "_blank");
}
function butOptions_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
}
function butExit_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
musicEnv.fadeTo("musMenu");
Game(root).delLevel();
this.visible = false;
Game(root).cursor.gotoAndStop("arrow");
Game(root).fadeBG.startFadeOut();
Game(root).menuMain.visible = true;
}
function butContinue_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
this.startFadeOut();
Game(root).gameGUI.startFadeIn();
mainGlobal.paused = false;
Game(root).cursor.gotoAndStop("cross");
}
public function keydwn(_arg1:KeyboardEvent){
}
}
}//package main
Section 95
//menuMain (main.menuMain)
package main {
import flash.display.*;
import flash.events.*;
import mochi.as3.*;
import flash.net.*;
import flash.ui.*;
public dynamic class menuMain extends MovieClip {
public var menuWarl:lostMenu;
var menuEpUp:Boolean;// = false
var transitTo:String;// = ""
var menuCreditsUp:Boolean;// = false
var disGradUp:Boolean;// = false
var menuOptionsUp:Boolean;// = false
public var menuOptions:MovieClip;
public var bgGrad:MovieClip;
public var logoOG:menuLogoOG;
public var menuCredits:MovieClip;
public var butPlay:buttonPlay;
public var butCredits:SimpleButton;
public var logoAneg:menuLogoAneg;
public var butOptions:SimpleButton;
public var menuEp:MovieClip;
var menuGameUp:Boolean;// = false
public var menuGame:MovieClip;
public var butMore:SimpleButton;
public var disGrad:MovieClip;
public function menuMain(){
butPlay.addEventListener(MouseEvent.CLICK, butPlay_Click);
butOptions.addEventListener(MouseEvent.CLICK, butOptions_Click);
butCredits.addEventListener(MouseEvent.CLICK, butCredits_Click);
butMore.addEventListener(MouseEvent.CLICK, butMore_Click);
menuGame.butBack.addEventListener(MouseEvent.CLICK, butBackGame_Click);
menuOptions.butBack.addEventListener(MouseEvent.CLICK, butBackOptions_Click);
menuCredits.butBack.addEventListener(MouseEvent.CLICK, butBackCredits_Click);
addEventListener(Event.ENTER_FRAME, Update);
menuWarl.visible = false;
menuWarl.use_force_restart = true;
menuWarl.butYes.addEventListener(MouseEvent.CLICK, butYesWarl_Click);
menuWarl.butNo.addEventListener(MouseEvent.CLICK, butNoWarl_Click);
menuOptions.butMusOn.addEventListener(MouseEvent.CLICK, butMusOn_Click);
menuOptions.butSndOn.addEventListener(MouseEvent.CLICK, butSndOn_Click);
menuOptions.butQuaHi.addEventListener(MouseEvent.CLICK, butQuaHi_Click);
menuOptions.butFXOn.addEventListener(MouseEvent.CLICK, butFXOn_Click);
menuOptions.butDebOn.addEventListener(MouseEvent.CLICK, butDebOn_Click);
menuOptions.butMusOff.addEventListener(MouseEvent.CLICK, butMusOff_Click);
menuOptions.butSndOff.addEventListener(MouseEvent.CLICK, butSndOff_Click);
menuOptions.butQuaLo.addEventListener(MouseEvent.CLICK, butQuaLo_Click);
menuOptions.butFXOff.addEventListener(MouseEvent.CLICK, butFXOff_Click);
menuOptions.butDebOff.addEventListener(MouseEvent.CLICK, butDebOff_Click);
menuGame.butContinue.addEventListener(MouseEvent.CLICK, butContinue_Click);
menuGame.butNew.addEventListener(MouseEvent.CLICK, butNew_Click);
menuGame.butEpisodes.addEventListener(MouseEvent.CLICK, butEpisodes_Click);
menuEp.butEpBack.addEventListener(MouseEvent.CLICK, butEpBack_Click);
menuEp.addEventListener(Event.ENTER_FRAME, menuEpUpdate);
menuEp.addEventListener(MouseEvent.CLICK, menuEpMouseClick);
menuGame.butWalk.addEventListener(MouseEvent.CLICK, butWalk_Click);
menuGame.butLeader.addEventListener(MouseEvent.CLICK, butLeader_Click);
menuGame.butStat.addEventListener(MouseEvent.CLICK, butStat_Click);
logoOG.addEventListener(MouseEvent.CLICK, logoOG_click);
logoOG.buttonMode = true;
logoOG.use_force_restart = true;
logoAneg.addEventListener(MouseEvent.CLICK, logoAneg_click);
logoAneg.buttonMode = true;
logoAneg.use_force_restart = true;
}
public function menuEpUpdate(_arg1:Event):void{
var _local2:int;
var _local3:MovieClip;
var _local4:Array;
if (y > stage.stageHeight){
return;
};
_local2 = 1;
while (_local2 < 16) {
_local3 = MovieClip(menuEp.getChildByName(("ep" + _local2)));
_local4 = _local3.filters;
if ((((((_local3.currentFrame > 1)) && (ageMath.inRange((Controls.mousePosX - menuEp.x), _local3.x, (_local3.x + _local3.width))))) && (ageMath.inRange((Controls.mousePosY - menuEp.y), _local3.y, (_local3.y + _local3.height))))){
_local4[0].strength = 2;
} else {
_local4[0].strength = 0;
};
_local3.filters = _local4;
_local2++;
};
}
function butNewFuncStart():void{
mainGlobal.clearLevelData();
transitTo = "Level1";
mainGlobal.isSingleEp = false;
}
function butCredits_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
disGradUp = true;
menuCreditsUp = true;
sounds.PlaySnd("menuShow");
logoOG.startFadeOut();
logoAneg.startFadeOut();
}
function butPlay_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
disGradUp = true;
menuGameUp = true;
sounds.PlaySnd("menuShow");
if (mainGlobal.myCookie.isKeyExist("moneyCnt")){
menuGame.butContinue.enabled = true;
menuGame.butContinue.alpha = 1;
} else {
menuGame.butContinue.enabled = false;
menuGame.butContinue.alpha = 0.5;
};
}
function loadMenuOptionsFromCookie():void{
menuOptions.butMusOff.visible = (menuOptions.butMusOn.visible = false);
menuOptions.butSndOff.visible = (menuOptions.butSndOn.visible = false);
menuOptions.butQuaLo.visible = (menuOptions.butQuaHi.visible = false);
menuOptions.butFXOff.visible = (menuOptions.butFXOn.visible = false);
menuOptions.butDebOff.visible = (menuOptions.butDebOn.visible = false);
if (mainGlobal.configMusicOn){
menuOptions.butMusOn.visible = true;
} else {
menuOptions.butMusOff.visible = true;
};
if (mainGlobal.configSoundOn){
menuOptions.butSndOn.visible = true;
} else {
menuOptions.butSndOff.visible = true;
};
if (mainGlobal.configQuaHigh){
menuOptions.butQuaHi.visible = true;
} else {
menuOptions.butQuaLo.visible = true;
};
if (mainGlobal.configVfxOn){
menuOptions.butFXOn.visible = true;
} else {
menuOptions.butFXOff.visible = true;
};
if (mainGlobal.configDebrisOn){
menuOptions.butDebOn.visible = true;
} else {
menuOptions.butDebOff.visible = true;
};
}
function butNew_Click(_arg1:MouseEvent):void{
if (menuGame.butContinue.alpha > 0.8){
sounds.PlaySnd("menuClick");
menuWarl.startFadeIn();
} else {
butNewFunc();
};
}
function butBackGame_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
disGradUp = false;
menuGameUp = false;
sounds.PlaySnd("menuHide");
restoreSubMenus();
restoreButtons();
}
function logoOG_click(_arg1:Event):void{
navigateToURL(new URLRequest("http://www.onlinegamer.cc?utm_source=Ted&utm_medium=menuMainLogoOG"), "_blank");
}
function restoreButtons():void{
menuGame.butEpisodes.enabled = true;
menuGame.butEpisodes.alpha = 1;
}
function butOptions_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
disGradUp = true;
menuOptionsUp = true;
mainGlobal.loadConfig();
loadMenuOptionsFromCookie();
sounds.PlaySnd("menuShow");
logoOG.startFadeOut();
logoAneg.startFadeOut();
}
function butStat_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
}
function butEpisodes_Click(_arg1:MouseEvent):void{
var _local2:int;
var _local3:MovieClip;
if (!menuGame.butEpisodes.enabled){
return;
};
sounds.PlaySnd("menuClick");
menuEpUp = true;
menuGame.butEpisodes.enabled = false;
menuGame.butEpisodes.alpha = 0.5;
mainGlobal.loadStatParam();
_local2 = 1;
while (_local2 <= 15) {
_local3 = MovieClip(menuEp.getChildByName(("ep" + _local2)));
_local3.epNum.text = "";
_local3.gotoAndStop(1);
_local2++;
};
_local2 = 1;
while (_local2 <= mainGlobal.lastLevelReached) {
_local3 = MovieClip(menuEp.getChildByName(("ep" + _local2)));
_local3.epNum.text = _local2.toString();
_local3.gotoAndStop((_local2 + 1));
_local2++;
};
}
function butMusOff_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
mainGlobal.configMusicOn = true;
mainGlobal.applyConfig();
loadMenuOptionsFromCookie();
}
function butNoWarl_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
menuWarl.startFadeOut();
}
function butContinue_Click(_arg1:MouseEvent):void{
if (!menuGame.butContinue.enabled){
return;
};
sounds.PlaySnd("menuClick");
Game(parent).fadeBG.startFadeIn();
menuGameUp = false;
disGradUp = false;
sounds.PlaySnd("menuHide");
transitTo = "continueLevel";
mainGlobal.isSingleEp = false;
restoreSubMenus();
restoreButtons();
}
function butMusOn_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
mainGlobal.configMusicOn = false;
mainGlobal.applyConfig();
loadMenuOptionsFromCookie();
}
function butDebOff_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
mainGlobal.configDebrisOn = true;
mainGlobal.applyConfig();
loadMenuOptionsFromCookie();
}
function butFXOn_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
mainGlobal.configVfxOn = false;
mainGlobal.applyConfig();
loadMenuOptionsFromCookie();
}
function butEpBack_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
sounds.PlaySnd("menuHide");
restoreSubMenus();
restoreButtons();
}
function butFXOff_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
mainGlobal.configVfxOn = true;
mainGlobal.applyConfig();
loadMenuOptionsFromCookie();
}
function butQuaHi_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
mainGlobal.configQuaHigh = false;
mainGlobal.applyConfig();
stage.quality = (mainGlobal.configQuaHigh) ? StageQuality.MEDIUM : StageQuality.LOW;
loadMenuOptionsFromCookie();
}
function butQuaLo_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
mainGlobal.configQuaHigh = true;
mainGlobal.applyConfig();
stage.quality = (mainGlobal.configQuaHigh) ? StageQuality.MEDIUM : StageQuality.LOW;
loadMenuOptionsFromCookie();
}
function restoreSubMenus():void{
menuEpUp = false;
}
function butYesWarl_Click(_arg1:MouseEvent):void{
butNewFunc();
menuWarl.startFadeOut();
}
function butSndOn_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
mainGlobal.configSoundOn = false;
mainGlobal.applyConfig();
loadMenuOptionsFromCookie();
}
function showScoreBoard():void{
var o:Object = {n:[2, 9, 1, 1, 11, 14, 7, 1, 4, 8, 14, 12, 9, 6, 7, 0], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
var boardID:String = o.f(0, "");
MochiScores.showLeaderboard({boardID:boardID, onDisplay:function (){
Game(root).fadeBG.startFadeIn();
Game(root).cursor.visible = false;
Mouse.show();
Game(root).cursorBlockCh = true;
}, onClose:function (){
Game(root).fadeBG.startFadeOut();
sounds.PlaySnd("menuClick");
Game(root).cursor.visible = true;
Game(root).cursorBlockCh = false;
Mouse.hide();
}});
}
function butNewFunc():void{
sounds.PlaySnd("menuClick");
Game(parent).fadeBG.startFadeIn();
menuGameUp = false;
disGradUp = false;
sounds.PlaySnd("menuHide");
restoreSubMenus();
restoreButtons();
var _local1:int = Game(parent).getChildIndex(Game(parent).cursor);
var _local2:storyMult = new storyMult();
Game(parent).addChildAt(_local2, _local1);
_local2.x = 320;
_local2.y = 240;
musicEnv.fadeTo("musDarkAmb");
}
function butSndOff_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
mainGlobal.configSoundOn = true;
mainGlobal.applyConfig();
loadMenuOptionsFromCookie();
}
function butBackCredits_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
disGradUp = false;
menuCreditsUp = false;
sounds.PlaySnd("menuHide");
logoOG.startFadeIn();
logoAneg.startFadeIn();
}
function butBackOptions_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
disGradUp = false;
menuOptionsUp = false;
mainGlobal.saveConfig();
sounds.PlaySnd("menuHide");
logoOG.startFadeIn();
logoAneg.startFadeIn();
}
function logoAneg_click(_arg1:Event):void{
navigateToURL(new URLRequest("http://www.onlinegamer.cc?utm_source=Ted&utm_medium=menuMainLogoAneg"), "_blank");
}
function butDebOn_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
mainGlobal.configDebrisOn = false;
mainGlobal.applyConfig();
loadMenuOptionsFromCookie();
}
public function Update(_arg1:Event):void{
if (!visible){
return;
};
if (disGradUp){
disGrad.y = ageMath.Lerp(disGrad.y, bgGrad.y, 0.3);
} else {
disGrad.y = ageMath.Lerp(disGrad.y, (stage.stageHeight + 5), 0.3);
};
if (menuGameUp){
menuGame.y = ageMath.Lerp(menuGame.y, 112, 0.3);
} else {
menuGame.y = ageMath.Lerp(menuGame.y, (stage.stageHeight + 5), 0.3);
};
if (menuEpUp){
menuEp.y = ageMath.Lerp(menuEp.y, 95, 0.3);
} else {
menuEp.y = ageMath.Lerp(menuEp.y, (stage.stageHeight + 5), 0.3);
};
if (menuOptionsUp){
menuOptions.y = ageMath.Lerp(menuOptions.y, 120, 0.3);
} else {
menuOptions.y = ageMath.Lerp(menuOptions.y, (stage.stageHeight + 5), 0.3);
};
if (menuCreditsUp){
menuCredits.y = ageMath.Lerp(menuCredits.y, 124, 0.3);
} else {
menuCredits.y = ageMath.Lerp(menuCredits.y, (stage.stageHeight + 5), 0.3);
};
if (Game(parent).fadeBG.alpha > 0.99999){
if (transitTo == "continueLevel"){
visible = false;
mainGlobal.dontLoadHeroParam = false;
mainGlobal.isSingleEp = false;
Game(parent).loadLevel(("Level" + int(mainGlobal.myCookie.get("curLevNum"))));
transitTo = "";
return;
};
if (transitTo != ""){
visible = false;
Game(parent).loadLevel(transitTo);
transitTo = "";
return;
};
};
}
function butWalk_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
menuGame.butEpisodes.enabled = true;
menuGame.butEpisodes.alpha = 1;
navigateToURL(new URLRequest("http://onlinegamer.cc/index.php?task=view_page&id=2"), "_blank");
}
public function menuEpMouseClick(_arg1:MouseEvent):void{
var _local2:int;
var _local3:MovieClip;
_local2 = 1;
while (_local2 < 16) {
_local3 = MovieClip(menuEp.getChildByName(("ep" + _local2)));
if ((((((_local3.currentFrame > 1)) && (ageMath.inRange((Controls.mousePosX - menuEp.x), _local3.x, (_local3.x + _local3.width))))) && (ageMath.inRange((Controls.mousePosY - menuEp.y), _local3.y, (_local3.y + _local3.height))))){
sounds.PlaySnd("menuClick");
Game(parent).fadeBG.startFadeIn();
menuGameUp = false;
disGradUp = false;
sounds.PlaySnd("menuHide");
mainGlobal.dontLoadHeroParam = true;
transitTo = ("Level" + (_local3.currentFrame - 1));
mainGlobal.isSingleEp = true;
restoreSubMenus();
restoreButtons();
break;
};
_local2++;
};
}
function butLeader_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
menuGame.butEpisodes.enabled = true;
menuGame.butEpisodes.alpha = 1;
showScoreBoard();
}
function butMore_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
navigateToURL(new URLRequest("http://www.onlinegamer.cc?utm_source=Ted&utm_medium=menuMainMore"), "_blank");
}
}
}//package main
Section 96
//menuShow2 (main.menuShow2)
package main {
import flash.media.*;
public dynamic class menuShow2 extends Sound {
}
}//package main
Section 97
//menuUpgradeShop (main.menuUpgradeShop)
package main {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public dynamic class menuUpgradeShop extends alphaFader {
public var upgPaper:upgPaper;
public var logoOG:MovieClip;
public var upg1:upgCrate;
public var upg2:upgCrate;
public var upg3:upgCrate;
public var upg4:upgCrate;
public var upg5:upgCrate;
public var upg10:upgCrate;
public var upg11:upgCrate;
public var upg12:upgCrate;
public var upg6:upgCrate;
public var bar:MovieClip;
public var upg9:upgCrate;
var showPaper:Boolean;// = false
public var buttBack:SimpleButton;
public var upg7:upgCrate;
public var upg8:upgCrate;
public var fader50perc:fader50perc;
public function menuUpgradeShop(){
var _local1:int;
super();
addFrameScript(0, frame1);
visible = false;
use_force_restart = true;
fader50perc.use_force_restart = true;
fader50perc.visible = false;
fader50perc.fadeMaxLimit = 0.5;
fader50perc.fadeSpeed = 0.08;
addEventListener(Event.ENTER_FRAME, Update);
addEventListener(MouseEvent.CLICK, MouseClick);
buttBack.addEventListener(MouseEvent.CLICK, buttBackClick);
}
public function showShop(){
var _local1:int;
var _local2:int;
var _local3:upgCrate;
var _local4:int;
visible = true;
_local1 = 1;
while (_local1 < 13) {
_local3 = upgCrate(getChildByName(("upg" + _local1)));
_local3.info.pic.gotoAndStop(_local1);
if (_local1 == 1){
_local3.info.txt.text = "Health";
} else {
if (_local1 == 2){
_local3.info.txt.text = "Protection";
} else {
if (_local1 == 3){
_local3.info.txt.text = "Ammunition";
} else {
if (_local1 == 4){
_local3.info.txt.text = "Abilities";
} else {
if (_local1 == 5){
_local3.info.txt.text = "Pistols";
} else {
if (_local1 == 6){
_local3.info.txt.text = "Shotgun";
} else {
if (_local1 == 7){
_local3.info.txt.text = "Assault Rifle";
} else {
if (_local1 == 8){
_local3.info.txt.text = "Minigun";
} else {
if (_local1 == 9){
_local3.info.txt.text = "Blaster";
} else {
if (_local1 == 10){
_local3.info.txt.text = "Launcher";
} else {
if (_local1 == 11){
_local3.info.txt.text = "Laser gun";
} else {
if (_local1 == 12){
_local3.info.txt.text = "DDD";
};
};
};
};
};
};
};
};
};
};
};
};
_local3.UpdateInfo();
_local1++;
};
_local1 = 1;
while (_local1 < 5) {
_local3 = upgCrate(getChildByName(("upg" + _local1)));
_local3.info.soldout.visible = false;
_local3.UpdateInfo();
_local1++;
};
_local1 = 5;
while (_local1 < 13) {
_local3 = upgCrate(getChildByName(("upg" + _local1)));
if (Game(parent).curLev.hero.weapons[(_local1 - 5)].active){
_local3.info.soldout.visible = false;
_local3.info.upgStars.visible = true;
_local4 = 0;
_local2 = 0;
while (_local2 < Game(parent).curLev.hero.weapons[(_local1 - 5)].upgrades.length) {
if (Game(parent).curLev.hero.weapons[(_local1 - 5)].upgrades[_local2].active){
_local4++;
};
_local2++;
};
_local3.info.upgStars.upgStarsMask.width = Math.round(((_local4 / Game(parent).curLev.hero.weapons[(_local1 - 5)].upgrades.length) * 100));
} else {
_local3.info.soldout.visible = true;
_local3.info.txt.text = "";
_local3.info.pic.gotoAndStop(13);
_local3.info.upgStars.visible = false;
};
_local3.UpdateInfo();
_local1++;
};
}
function frame1(){
logoOG.addEventListener(MouseEvent.CLICK, logoOG_click);
logoOG.buttonMode = true;
this.visible = false;
}
public function buttBackClick(_arg1:MouseEvent):void{
this.visible = false;
mainGlobal.paused = false;
Game(parent).curLev.visible = true;
Game(root).cursor.gotoAndStop("cross");
musicEnv.fadeTo(Game(parent).curLev.levelMus);
bar.y = 46;
sounds.PlaySnd("menuClick", 1);
}
public function Update(_arg1:Event):void{
var _local2:int;
var _local3:Array;
var _local4:DisplayObject;
if (!visible){
return;
};
if (bar.y > -273){
bar.y = (bar.y - 10);
};
if (showPaper){
upgPaper.x = ageMath.Lerp(432, upgPaper.x, 0.8);
} else {
upgPaper.x = ageMath.Lerp(880, upgPaper.x, 0.8);
};
if (!fader50perc.visible){
_local2 = 1;
while (_local2 < 13) {
_local4 = DisplayObject(getChildByName(("upg" + _local2)));
_local3 = _local4.filters;
if (((((!(upgCrate(_local4).info.soldout.visible)) && (ageMath.inRange(Controls.mousePosX, _local4.x, (_local4.x + _local4.width))))) && (ageMath.inRange(Controls.mousePosY, _local4.y, (_local4.y + _local4.height))))){
_local3[0].strength = 2;
} else {
_local3[0].strength = 0;
};
_local4.filters = _local3;
_local2++;
};
};
}
public function logoOG_click(_arg1:Event):void{
navigateToURL(new URLRequest("http://www.onlinegamer.cc?utm_source=Ted&utm_medium=menuUpgrade"), "_blank");
}
public function MouseClick(_arg1:MouseEvent):void{
var _local2:*;
var _local3:int;
var _local4:DisplayObject;
if (((!(fader50perc.visible)) && (!(showPaper)))){
_local2 = 1;
while (_local2 < 13) {
_local4 = DisplayObject(getChildByName(("upg" + _local2)));
if (((((!(upgCrate(_local4).info.soldout.visible)) && (ageMath.inRange(Controls.mousePosX, _local4.x, (_local4.x + _local4.width))))) && (ageMath.inRange(Controls.mousePosY, _local4.y, (_local4.y + _local4.height))))){
fader50perc.startFadeIn();
showPaper = true;
sounds.PlaySnd("paper1", 1);
if (_local2 == 1){
upgPaper.curUpgrades = Game(parent).curLev.hero.upgradesLife;
upgPaper.txtWepName.text = "Health";
upgPaper.typeUpg = 1;
} else {
if (_local2 == 2){
upgPaper.curUpgrades = Game(parent).curLev.hero.upgradesParam;
upgPaper.txtWepName.text = "Protection";
upgPaper.typeUpg = 2;
} else {
if (_local2 == 3){
upgPaper.curUpgrades = Game(parent).curLev.hero.upgradesBullets;
upgPaper.txtWepName.text = "Ammunition";
upgPaper.typeUpg = 3;
} else {
if (_local2 == 4){
upgPaper.curUpgrades = Game(parent).curLev.hero.upgradesAbilities;
upgPaper.txtWepName.text = "Abilities";
upgPaper.typeUpg = 4;
} else {
if (Game(parent).curLev.hero.weapons[(_local2 - 5)]){
upgPaper.curUpgrades = Game(parent).curLev.hero.weapons[(_local2 - 5)].upgrades;
upgPaper.txtWepName.text = this[("upg" + _local2)].info.txt.text;
upgPaper.typeUpg = 5;
upgPaper.curWepNum = (_local2 - 5);
} else {
upgPaper.curUpgrades = null;
upgPaper.txtWepName.text = "Not available";
upgPaper.typeUpg = 0;
};
};
};
};
};
upgPaper.heroMoney = Game(parent).curLev.hero.moneyCnt;
upgPaper.weaponsAmmo = [];
upgPaper.weaponsAmmoMax = [];
if (upgPaper.typeUpg == 3){
_local3 = 1;
while (_local3 < 6) {
upgPaper.weaponsAmmo.push(Game(parent).curLev.hero.weapons[_local3].bulletsNum);
upgPaper.weaponsAmmoMax.push(Game(parent).curLev.hero.weapons[_local3].bulletsNumMax);
if (upgPaper.weaponsAmmo[(_local3 - 1)] >= upgPaper.weaponsAmmoMax[(_local3 - 1)]){
upgPaper.weaponsAmmo[(_local3 - 1)] = upgPaper.weaponsAmmoMax[(_local3 - 1)];
upgPaper.curUpgrades[(_local3 - 1)].sold = true;
};
_local3++;
};
};
upgPaper.updateMenu();
break;
};
_local2++;
};
};
}
}
}//package main
Section 98
//menuWinGame (main.menuWinGame)
package main {
import flash.display.*;
import flash.events.*;
import mochi.as3.*;
import flash.utils.*;
import flash.ui.*;
import flash.text.*;
public dynamic class menuWinGame extends alphaFader {
var transitTo:String;// = ""
public var titVic:MovieClip;
public var txtTotal:TextField;
public var txtTotal_cur:int;// = -1
public var lTotal:TextField;
public var butSubmit:SimpleButton;
public var butExit:SimpleButton;
public function menuWinGame(){
addFrameScript(0, frame1);
addEventListener(Event.ENTER_FRAME, Update);
butExit.addEventListener(MouseEvent.CLICK, butExit_Click);
butSubmit.addEventListener(MouseEvent.CLICK, butSubmit_Click);
}
function showScoreBoard():void{
var o:Object = {n:[2, 9, 1, 1, 11, 14, 7, 1, 4, 8, 14, 12, 9, 6, 7, 0], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
var boardID:String = o.f(0, "");
MochiScores.showLeaderboard({boardID:boardID, score:Game(root).curLev.hero.totalScores, onDisplay:function (){
Game(root).fadeBG.startFadeIn();
Game(root).cursor.visible = false;
Mouse.show();
Game(root).cursorBlockCh = true;
}, onClose:function (){
Game(root).fadeBG.startFadeOut();
sounds.PlaySnd("menuClick");
Game(root).cursor.visible = true;
Game(root).cursorBlockCh = false;
Mouse.hide();
}});
}
public function Update(_arg1:Event):void{
if ((((alpha < 0.9)) || (!(visible)))){
return;
};
var _local2:uint = Game(root).menuWinLose.txtTotal_cur;
if (txtTotal_cur < _local2){
if (txtTotal_cur == -1){
lTotal.visible = (txtTotal.visible = true);
txtTotal_cur = 0;
};
txtTotal_cur = (txtTotal_cur + getOff(_local2));
if (txtTotal_cur > _local2){
txtTotal_cur = _local2;
};
txtTotal.text = (txtTotal_cur + "");
} else {
butSubmit.visible = true;
butExit.visible = true;
};
if (Game(root).fadeBG.alpha > 0.99999){
if (transitTo == "ExitLevel"){
musicEnv.fadeTo("musMenu");
Game(root).delLevel();
this.visible = false;
Game(root).cursor.gotoAndStop("arrow");
Game(root).fadeBG.startFadeOut();
Game(root).menuMain.visible = true;
return;
};
};
}
function frame1(){
visible = false;
}
public function setToWin(){
titVic.visible = true;
updateInfo();
}
function butSubmit_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
showScoreBoard();
}
function butExit_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
Game(root).fadeBG.startFadeIn();
transitTo = "ExitLevel";
}
public function updateInfo(){
txtTotal_cur = -1;
lTotal.visible = (txtTotal.visible = false);
butSubmit.visible = false;
butExit.visible = false;
}
public function getOff(_arg1:int):int{
return (int((_arg1 * 0.01)));
}
}
}//package main
Section 99
//menuWinLose (main.menuWinLose)
package main {
import flash.display.*;
import flash.events.*;
import mochi.as3.*;
import flash.utils.*;
import flash.net.*;
import CPMStar.*;
import flash.ui.*;
public dynamic class menuWinLose extends alphaFader {
public var butSubmit:SimpleButton;
public var txtScore_cur:int;// = -1
public var titWin:MovieClip;
public var txtSecret_cur:int;// = -1
public var bgRed:MovieClip;
var adBoxMC:MovieClip;
public var titLose:MovieClip;
public var butNext:SimpleButton;
public var epStat:MovieClip;
public var butWalkthrough:SimpleButton;
public var butRetry:SimpleButton;
var transitTo:String;// = ""
public var txtMoney_cur:int;// = -1
public var txtAcc_cur:int;// = -1
public var txtTotal_cur:int;// = -1
public var txtKill_cur:int;// = -1
public var bgBlack:MovieClip;
public var butExit:SimpleButton;
public function menuWinLose(){
addFrameScript(0, frame1);
addEventListener(Event.ENTER_FRAME, Update);
butNext.addEventListener(MouseEvent.CLICK, butNext_Click);
butRetry.addEventListener(MouseEvent.CLICK, butRetry_Click);
butExit.addEventListener(MouseEvent.CLICK, butExit_Click);
butSubmit.addEventListener(MouseEvent.CLICK, butSubmit_Click);
butWalkthrough.addEventListener(MouseEvent.CLICK, butWalk_Click);
}
public function setToLose(){
titLose.visible = true;
titWin.visible = false;
bgBlack.visible = false;
bgRed.visible = true;
updateInfo();
}
function butSubmit_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
showScoreBoard();
}
function butRetry_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
Game(root).fadeBG.startFadeIn();
transitTo = "RestartLevel";
}
function showScoreBoard():void{
var o:Object = {n:[2, 9, 1, 1, 11, 14, 7, 1, 4, 8, 14, 12, 9, 6, 7, 0], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
var boardID:String = o.f(0, "");
MochiScores.showLeaderboard({boardID:boardID, score:Game(root).curLev.hero.totalScores, onDisplay:function (){
Game(root).fadeBG.startFadeIn();
Game(root).cursor.visible = false;
Mouse.show();
Game(root).cursorBlockCh = true;
}, onClose:function (){
Game(root).fadeBG.startFadeOut();
sounds.PlaySnd("menuClick");
Game(root).cursor.visible = true;
Game(root).cursorBlockCh = false;
Mouse.hide();
}});
}
function butWalk_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
navigateToURL(new URLRequest("http://onlinegamer.cc/index.php?task=view_page&id=2"), "_blank");
}
function ExitFunc():void{
sounds.PlaySnd("menuClick");
Game(root).fadeBG.startFadeIn();
transitTo = "ExitLevel";
}
public function updateInfo(){
var _local1:String;
var _local2:DisplayObject;
var _local3:MovieClip;
txtAcc_cur = -1;
txtKill_cur = -1;
txtMoney_cur = -1;
txtSecret_cur = -1;
txtScore_cur = -1;
txtTotal_cur = -1;
epStat.lAcc.visible = (epStat.txtAcc.visible = false);
epStat.lKill.visible = (epStat.txtKill.visible = false);
epStat.lMoney.visible = (epStat.txtMoney.visible = false);
epStat.lSecret.visible = (epStat.txtSecret.visible = false);
epStat.lScore.visible = (epStat.txtScore.visible = false);
epStat.lTotal.visible = (epStat.txtTotal.visible = false);
epStat.sep.visible = false;
butNext.visible = false;
butRetry.visible = false;
butSubmit.visible = false;
butExit.visible = false;
butWalkthrough.visible = false;
adBoxMC = new adBoxClass();
adBoxMC.x = 21;
adBoxMC.y = 123;
if (!mainGlobal.noAds){
_local1 = "3989QA7E15F5A";
_local2 = new AdLoader(_local1);
adBoxMC.addChild(_local2);
} else {
_local3 = new adMY();
adBoxMC.addChild(_local3);
};
this.addChild(adBoxMC);
}
function butNext_Click(_arg1:MouseEvent):void{
sounds.PlaySnd("menuClick");
if (Game(root).curLev.curLevNum == 10){
Game(root).menuWinGame.startFadeIn();
Game(root).menuWinGame.setToWin();
startFadeOut();
musicEnv.fadeTo("GameVictory");
return;
};
Game(root).fadeBG.startFadeIn();
transitTo = "NextLevel";
}
public function setToWin(){
titLose.visible = false;
titWin.visible = true;
bgBlack.visible = true;
bgRed.visible = false;
updateInfo();
}
function frame1(){
visible = false;
}
public function getOff(_arg1:int):int{
if (_arg1 <= 10){
return (1);
};
if ((((_arg1 > 10)) && ((_arg1 <= 100)))){
return (5);
};
return (int((_arg1 * 0.05)));
}
public function Update(_arg1:Event):void{
if ((((alpha < 0.9)) || (!(visible)))){
return;
};
var _local2:uint = int(((mainGlobal.shootingInEnemies / mainGlobal.shootingAll) * 100));
if (_local2 > 100){
_local2 = 100;
};
var _local3:uint = int(((mainGlobal.enemiesKilled / mainGlobal.enemiesAll) * 100));
if (_local3 > 100){
_local3 = 100;
};
var _local4:uint = mainGlobal.moneyCollected;
var _local5:uint = mainGlobal.secretsFound;
var _local6:uint = int(((((Game(root).curLev.curLevScore * (_local2 / 100)) * (_local3 / 100)) + mainGlobal.moneyCollected) + (mainGlobal.secretsFound * 500)));
var _local7:uint = (Game(root).curLev.hero.totalScores + _local6);
if (butExit.visible == false){
if (txtAcc_cur < _local2){
if (txtAcc_cur == -1){
epStat.lAcc.visible = (epStat.txtAcc.visible = true);
txtAcc_cur = 0;
};
txtAcc_cur = (txtAcc_cur + getOff(_local2));
if (txtAcc_cur > _local2){
txtAcc_cur = _local2;
};
epStat.txtAcc.text = (txtAcc_cur + "%");
} else {
if (txtKill_cur < _local3){
if (txtKill_cur == -1){
epStat.lKill.visible = (epStat.txtKill.visible = true);
txtKill_cur = 0;
};
txtKill_cur = (txtKill_cur + getOff(_local3));
if (txtKill_cur > _local3){
txtKill_cur = _local3;
};
epStat.txtKill.text = (txtKill_cur + "%");
} else {
if (txtMoney_cur < _local4){
if (txtMoney_cur == -1){
epStat.lMoney.visible = (epStat.txtMoney.visible = true);
txtMoney_cur = 0;
};
txtMoney_cur = (txtMoney_cur + getOff(_local4));
if (txtMoney_cur > _local4){
txtMoney_cur = _local4;
};
epStat.txtMoney.text = (txtMoney_cur + "$");
} else {
if (txtSecret_cur < _local5){
if (txtSecret_cur == -1){
epStat.lSecret.visible = (epStat.txtSecret.visible = true);
txtSecret_cur = 0;
};
txtSecret_cur = (txtSecret_cur + getOff(_local5));
if (txtSecret_cur > _local5){
txtSecret_cur = _local5;
};
epStat.txtSecret.text = ((txtSecret_cur + "/") + mainGlobal.secretsAll);
} else {
if (txtScore_cur < _local6){
if (txtScore_cur == -1){
epStat.lScore.visible = (epStat.txtScore.visible = true);
txtScore_cur = 0;
};
txtScore_cur = (txtScore_cur + getOff(_local6));
if (txtScore_cur > _local6){
txtScore_cur = _local6;
};
epStat.txtScore.text = (txtScore_cur + "");
} else {
if (txtTotal_cur < _local7){
if (txtTotal_cur == -1){
epStat.lTotal.visible = (epStat.txtTotal.visible = (epStat.sep.visible = true));
txtTotal_cur = Game(root).curLev.hero.totalScores;
};
txtTotal_cur = (txtTotal_cur + getOff(_local7));
if (txtTotal_cur > _local7){
txtTotal_cur = _local7;
};
epStat.txtTotal.text = (txtTotal_cur + "");
} else {
if (titWin.visible == true){
if (((!(mainGlobal.isSingleEp)) && ((butExit.visible == false)))){
if (Game(root).curLev.curLevNum != 10){
if (mainGlobal.lastLevelReached < (Game(root).curLev.curLevNum + 1)){
mainGlobal.lastLevelReached = (Game(root).curLev.curLevNum + 1);
mainGlobal.myCookie.putNoFlush("lastLevelReached", mainGlobal.lastLevelReached);
};
mainGlobal.myCookie.putNoFlush("curLevNum", (Game(root).curLev.curLevNum + 1));
Game(root).curLev.hero.totalScores = txtTotal_cur;
Game(root).curLev.hero.saveParams();
};
};
if (!mainGlobal.isSingleEp){
butNext.visible = true;
butSubmit.visible = true;
};
butRetry.visible = false;
butWalkthrough.visible = false;
butExit.visible = true;
} else {
butNext.visible = false;
butRetry.visible = true;
butSubmit.visible = false;
butExit.visible = true;
butWalkthrough.visible = true;
};
};
};
};
};
};
};
};
if (Game(root).fadeBG.alpha > 0.99999){
if (transitTo == "NextLevel"){
Game(parent).gameGUI.startFadeIn();
visible = false;
transitTo = "";
mainGlobal.paused = false;
mainGlobal.dontLoadHeroParam = false;
Game(parent).loadLevel(("Level" + (Game(root).curLev.curLevNum + 1)));
removeChild(adBoxMC);
return;
};
if (transitTo == "RestartLevel"){
Game(parent).gameGUI.startFadeIn();
visible = false;
transitTo = "";
mainGlobal.paused = false;
mainGlobal.dontLoadHeroParam = false;
Game(parent).loadLevel(("Level" + Game(root).curLev.curLevNum));
removeChild(adBoxMC);
return;
};
if (transitTo == "ExitLevel"){
musicEnv.fadeTo("musMenu");
Game(root).delLevel();
this.visible = false;
Game(root).cursor.gotoAndStop("arrow");
Game(root).fadeBG.startFadeOut();
Game(root).menuMain.visible = true;
removeChild(adBoxMC);
return;
};
};
}
function butExit_Click(_arg1:MouseEvent):void{
ExitFunc();
}
}
}//package main
Section 100
//midExp (main.midExp)
package main {
import flash.media.*;
public dynamic class midExp extends Sound {
}
}//package main
Section 101
//MinigunReload (main.MinigunReload)
package main {
import flash.media.*;
public dynamic class MinigunReload extends Sound {
}
}//package main
Section 102
//MinigunReloaded (main.MinigunReloaded)
package main {
import flash.media.*;
public dynamic class MinigunReloaded extends Sound {
}
}//package main
Section 103
//MinigunShoot1 (main.MinigunShoot1)
package main {
import flash.media.*;
public dynamic class MinigunShoot1 extends Sound {
}
}//package main
Section 104
//musDarkAmb (main.musDarkAmb)
package main {
import flash.media.*;
public dynamic class musDarkAmb extends Sound {
}
}//package main
Section 105
//musGlory (main.musGlory)
package main {
import flash.media.*;
public dynamic class musGlory extends Sound {
}
}//package main
Section 106
//musicEnv (main.musicEnv)
package main {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
public dynamic class musicEnv {
static var t1:SoundTransform = new SoundTransform();
public static var curCh:SoundChannel;
public static var timerVolFader:Timer = new Timer(10);
static var mus:Object;
public static var vol:Number = 0.9;
public static var volFadeSpeed:Number = 0.01;
public static var curMusName:String = "";
public static var offVol:Number = 0;
public static var musEnable:Boolean = true;
public static var curVol:Number = 0;
public static var offCh:SoundChannel;
public static var curPos:Number = 0;
public static var isplayed:Boolean = false;
static var t2:SoundTransform = new SoundTransform();
public static function init(){
timerVolFader.stop();
mus = new Object();
mus["musMenu"] = new musMenu();
mus["musGlory"] = new musGlory();
mus["musStory"] = new musStory();
mus["FatalDamage"] = new FatalDamage();
mus["musLose"] = new musLose();
mus["musWin"] = new musWin();
mus["musUpgrade"] = new musUpgrade();
mus["roboAttack"] = new roboAttack();
mus["musTrasher"] = new musTrasher();
mus["musDarkAmb"] = new musDarkAmb();
mus["GameVictory"] = new GameVictory();
}
public static function played(_arg1:Boolean):void{
if (_arg1 == isplayed){
return;
};
if (_arg1){
if (curMusName != ""){
fadeTo(curMusName);
};
} else {
isplayed = false;
if (curCh){
curCh.stop();
curPos = curCh.position;
};
if (offCh){
offCh.stop();
};
offVol = 0;
curVol = vol;
if (timerVolFader.running){
timerVolFader.stop();
timerVolFader.removeEventListener(TimerEvent.TIMER, timerVolFader_Timer);
};
};
}
public static function fadeTo(_arg1:String){
var _local2:SoundTransform;
curMusName = _arg1;
if (!musEnable){
return;
};
isplayed = true;
_local2 = new SoundTransform();
_local2.volume = 0;
if (offCh){
offCh.stop();
};
offCh = curCh;
if ((((curMusName == "musLose")) || ((curMusName == "musWin")))){
curCh = mus[_arg1].play(0, 1, _local2);
} else {
curCh = mus[_arg1].play(0, int.MAX_VALUE, _local2);
};
curVol = 0;
offVol = vol;
if (!timerVolFader.running){
timerVolFader.addEventListener(TimerEvent.TIMER, timerVolFader_Timer, false, 0, true);
timerVolFader.start();
};
}
public static function timerVolFader_Timer(_arg1:TimerEvent):void{
if (offCh != null){
if (offVol > 0){
offVol = (offVol - volFadeSpeed);
} else {
offVol = 0;
};
t1.volume = offVol;
offCh.soundTransform = t1;
};
if (((!((curCh == null))) && ((((offVol < (vol / 2))) || ((offCh == null)))))){
if (curVol < vol){
curVol = (curVol + volFadeSpeed);
} else {
curVol = vol;
};
t2.volume = curVol;
curCh.soundTransform = t2;
};
if (curVol > (vol - 0.0001)){
if (offCh != null){
offCh.stop();
};
timerVolFader.stop();
timerVolFader.removeEventListener(TimerEvent.TIMER, timerVolFader_Timer);
};
}
}
}//package main
Section 107
//musLose (main.musLose)
package main {
import flash.media.*;
public dynamic class musLose extends Sound {
}
}//package main
Section 108
//musMenu (main.musMenu)
package main {
import flash.media.*;
public dynamic class musMenu extends Sound {
}
}//package main
Section 109
//musStory (main.musStory)
package main {
import flash.media.*;
public dynamic class musStory extends Sound {
}
}//package main
Section 110
//musTrasher (main.musTrasher)
package main {
import flash.media.*;
public dynamic class musTrasher extends Sound {
}
}//package main
Section 111
//musUpgrade (main.musUpgrade)
package main {
import flash.media.*;
public dynamic class musUpgrade extends Sound {
}
}//package main
Section 112
//musWin (main.musWin)
package main {
import flash.media.*;
public dynamic class musWin extends Sound {
}
}//package main
Section 113
//PanoramaFactory1 (main.PanoramaFactory1)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class PanoramaFactory1 extends baseObject {
public function PanoramaFactory1(){
addFrameScript(0, frame1);
}
function frame1(){
if (!initIDE){
paralaxX = 250;
paralaxY = 125;
saveX = x;
saveY = y;
Level(parent).paralaxObjects.push(this);
};
}
}
}//package main
Section 114
//PanoramaForest1 (main.PanoramaForest1)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class PanoramaForest1 extends baseObject {
public function PanoramaForest1(){
addFrameScript(0, frame1);
}
function frame1(){
if (!initIDE){
paralaxX = 250;
paralaxY = 125;
saveX = x;
saveY = y;
Level(parent).paralaxObjects.push(this);
};
}
}
}//package main
Section 115
//PanoramaTown1 (main.PanoramaTown1)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class PanoramaTown1 extends baseObject {
public function PanoramaTown1(){
addFrameScript(0, frame1);
}
function frame1(){
if (!initIDE){
paralaxX = 250;
paralaxY = 125;
saveX = x;
saveY = y;
Level(parent).paralaxObjects.push(this);
};
}
}
}//package main
Section 116
//PistolReloaded (main.PistolReloaded)
package main {
import flash.media.*;
public dynamic class PistolReloaded extends Sound {
}
}//package main
Section 117
//pistolShoot1 (main.pistolShoot1)
package main {
import flash.media.*;
public dynamic class pistolShoot1 extends Sound {
}
}//package main
Section 118
//pistolShoot2 (main.pistolShoot2)
package main {
import flash.media.*;
public dynamic class pistolShoot2 extends Sound {
}
}//package main
Section 119
//preloader (main.preloader)
package main {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.text.*;
public dynamic class preloader extends MovieClip {
public var txt:TextField;
var timerLoadAds:Timer;
public function preloader(){
timerLoadAds = new Timer(4000, 1);
super();
addFrameScript(0, frame1);
if (0){
} else {
addEventListener(Event.ENTER_FRAME, Update);
timerLoadAds.start();
};
}
function frame1(){
stop();
}
public function isUrl(_arg1:Array):Boolean{
var _local2:String = stage.loaderInfo.loaderURL;
var _local3:Number = (_local2.indexOf("://") + 3);
var _local4:Number = _local2.indexOf("/", _local3);
var _local5:String = _local2.substring(_local3, _local4);
var _local6:Number = (_local5.lastIndexOf(".") - 1);
var _local7:Number = (_local5.lastIndexOf(".", _local6) + 1);
_local5 = _local5.substring(_local7, _local5.length);
var _local8:int;
while (_local8 < _arg1.length) {
if (_local5 == _arg1[_local8]){
return (true);
};
_local8++;
};
return (false);
}
public function Update(_arg1:Event):void{
var _local2:Number = stage.loaderInfo.bytesLoaded;
var _local3:Number = stage.loaderInfo.bytesTotal;
var _local4 = "";
var _local5:Number = 0;
if (_local3 > 0){
_local5 = Math.floor(((_local2 / _local3) * 100));
};
this.gotoAndStop((ageMath.RandomInt(-3, 3) + Math.round(ageMath.RemapVal((_local5 + 1), 1, 100, 1, 500))));
if ((((((_local2 == _local3)) || ((_local3 == 0)))) && (!(timerLoadAds.running)))){
y = ageMath.Lerp(y, (stage.stageHeight + 5), 0.3);
} else {
y = ageMath.Lerp(y, 285, 0.3);
};
if (_local5 >= 100){
txt.text = "WAIT...";
};
if ((((_local2 == _local3)) || ((_local3 == 0)))){
if (!timerLoadAds.running){
if (y > stage.stageHeight){
if ((parent is MovieClip)){
(parent as MovieClip).bPlay.visible = true;
visible = false;
removeEventListener(Event.ENTER_FRAME, Update);
};
};
};
};
}
}
}//package main
Section 120
//projBombWep (main.projBombWep)
package main {
public dynamic class projBombWep extends projObject {
}
}//package main
Section 121
//projBullet (main.projBullet)
package main {
public dynamic class projBullet extends projObject {
}
}//package main
Section 122
//projLaserBeam (main.projLaserBeam)
package main {
public dynamic class projLaserBeam extends fxObject {
}
}//package main
Section 123
//projMinigunBeam (main.projMinigunBeam)
package main {
public dynamic class projMinigunBeam extends fxObject {
public function projMinigunBeam(){
addFrameScript(8, frame9);
}
function frame9(){
visible = false;
stop();
}
}
}//package main
Section 124
//projObject (main.projObject)
package main {
public class projObject extends dynObject {
var fromGoodGuy:Boolean;// = false
var electroDamageVal:Number;// = 0
var bioDamageVal:Number;// = 0
var infAmmo:Boolean;// = false
var useBioDamage:Boolean;// = false
var useElectroDamage:Boolean;// = false
var blastStyle:Boolean;// = false
var usePsyDamage:Boolean;// = false
var laserStyle:Boolean;// = false
var damage:Number;// = 1
var attackRadius:Number;// = 1
var psyDamageVal:Number;// = 0
}
}//package main
Section 125
//projRocket (main.projRocket)
package main {
public dynamic class projRocket extends projObject {
}
}//package main
Section 126
//projVomit (main.projVomit)
package main {
public dynamic class projVomit extends projObject {
}
}//package main
Section 127
//propAK (main.propAK)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class propAK extends propObject {
public function propAK(){
addFrameScript(0, frame1);
}
function frame1(){
if ((parent as Level)){
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
} else {
if ((parent.parent as Level)){
curLevel = Level(parent.parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
};
};
this.wepNum = 2;
this.propType = "Weapon";
}
}
}//package main
Section 128
//propAKAmmo (main.propAKAmmo)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class propAKAmmo extends propObject {
public function propAKAmmo(){
addFrameScript(0, frame1);
}
function frame1(){
if ((parent as Level)){
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
} else {
if ((parent.parent as Level)){
curLevel = Level(parent.parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
};
};
this.propType = "Ammo";
this.wepNum = 2;
this.moneyAmount = 1;
}
}
}//package main
Section 129
//propBlaster (main.propBlaster)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class propBlaster extends propObject {
public function propBlaster(){
addFrameScript(0, frame1);
}
function frame1(){
if ((parent as Level)){
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
} else {
if ((parent.parent as Level)){
curLevel = Level(parent.parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
};
};
this.wepNum = 4;
this.propType = "Weapon";
}
}
}//package main
Section 130
//propBlasterAmmo (main.propBlasterAmmo)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class propBlasterAmmo extends propObject {
public function propBlasterAmmo(){
addFrameScript(0, frame1);
}
function frame1(){
if ((parent as Level)){
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
} else {
if ((parent.parent as Level)){
curLevel = Level(parent.parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
};
};
this.propType = "Ammo";
this.wepNum = 4;
this.moneyAmount = 1;
}
}
}//package main
Section 131
//propCloth (main.propCloth)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class propCloth extends propObject {
public function propCloth(){
addFrameScript(0, frame1);
}
function frame1(){
if ((parent as Level)){
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
} else {
if ((parent.parent as Level)){
curLevel = Level(parent.parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
};
};
this.propType = "Item";
this.itemName = "cloth";
}
}
}//package main
Section 132
//propCoin (main.propCoin)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class propCoin extends propObject {
public function propCoin(){
addFrameScript(0, frame1);
}
function frame1(){
if ((parent as Level)){
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
} else {
if ((parent.parent as Level)){
curLevel = Level(parent.parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
};
};
this.moneyAmount = 5;
this.propType = "Coin";
}
}
}//package main
Section 133
//propDebris (main.propDebris)
package main {
public dynamic class propDebris extends propObject {
public function propDebris(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main
Section 134
//propDynamite (main.propDynamite)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class propDynamite extends propObject {
public function propDynamite(){
addFrameScript(0, frame1);
}
function frame1(){
if ((parent as Level)){
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
} else {
if ((parent.parent as Level)){
curLevel = Level(parent.parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
};
};
this.propType = "Item";
this.itemName = "dynamite";
}
}
}//package main
Section 135
//propFood (main.propFood)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class propFood extends propObject {
public function propFood(){
addFrameScript(0, frame1);
}
function frame1(){
if ((parent as Level)){
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
} else {
if ((parent.parent as Level)){
curLevel = Level(parent.parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
};
};
this.propType = "Item";
this.itemName = "food";
}
}
}//package main
Section 136
//propGasmask (main.propGasmask)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class propGasmask extends propObject {
public function propGasmask(){
addFrameScript(0, frame1);
}
function frame1(){
if ((parent as Level)){
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
} else {
if ((parent.parent as Level)){
curLevel = Level(parent.parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
};
};
this.propType = "Item";
this.itemName = "gasmask";
}
}
}//package main
Section 137
//propLever (main.propLever)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class propLever extends propObject {
public function propLever(){
addFrameScript(0, frame1);
}
function frame1(){
if ((parent as Level)){
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
} else {
if ((parent.parent as Level)){
curLevel = Level(parent.parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
};
};
this.propType = "Item";
this.itemName = "lever";
}
}
}//package main
Section 138
//propMinigun (main.propMinigun)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class propMinigun extends propObject {
public function propMinigun(){
addFrameScript(0, frame1);
}
function frame1(){
if ((parent as Level)){
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
} else {
if ((parent.parent as Level)){
curLevel = Level(parent.parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
};
};
this.wepNum = 3;
this.propType = "Weapon";
}
}
}//package main
Section 139
//propMinigunAmmo (main.propMinigunAmmo)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class propMinigunAmmo extends propObject {
public function propMinigunAmmo(){
addFrameScript(0, frame1);
}
function frame1(){
if ((parent as Level)){
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
} else {
if ((parent.parent as Level)){
curLevel = Level(parent.parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
};
};
this.propType = "Ammo";
this.wepNum = 3;
this.moneyAmount = 1;
}
}
}//package main
Section 140
//propMoney1 (main.propMoney1)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class propMoney1 extends propObject {
public function propMoney1(){
addFrameScript(0, frame1);
}
function frame1(){
if ((parent as Level)){
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
} else {
if ((parent.parent as Level)){
curLevel = Level(parent.parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
};
};
this.moneyAmount = 15;
this.propType = "Money";
}
}
}//package main
Section 141
//propMoney2 (main.propMoney2)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class propMoney2 extends propObject {
public function propMoney2(){
addFrameScript(0, frame1);
}
function frame1(){
if ((parent as Level)){
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
} else {
if ((parent.parent as Level)){
curLevel = Level(parent.parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
};
};
this.moneyAmount = 35;
this.propType = "Money";
}
}
}//package main
Section 142
//propObject (main.propObject)
package main {
import flash.display.*;
public class propObject extends dynObject {
public var p1:MovieClip;
public var body:MovieClip;
public var p3:MovieClip;
public var p2:MovieClip;
public var p4:MovieClip;
var moneyAmount:Number;// = 5
var wepNum:int;// = 1
var propType:String;// = "none"
var itemName:String;// = "none"
}
}//package main
Section 143
//propShotgun (main.propShotgun)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class propShotgun extends propObject {
public function propShotgun(){
addFrameScript(0, frame1);
}
function frame1(){
if ((parent as Level)){
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
} else {
if ((parent.parent as Level)){
curLevel = Level(parent.parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
};
};
this.wepNum = 1;
this.propType = "Weapon";
}
}
}//package main
Section 144
//propShotgunAmmo (main.propShotgunAmmo)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class propShotgunAmmo extends propObject {
public function propShotgunAmmo(){
addFrameScript(0, frame1);
}
function frame1(){
if ((parent as Level)){
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
} else {
if ((parent.parent as Level)){
curLevel = Level(parent.parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
};
};
this.propType = "Ammo";
this.wepNum = 1;
this.moneyAmount = 2;
}
}
}//package main
Section 145
//propValve (main.propValve)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class propValve extends propObject {
public function propValve(){
addFrameScript(0, frame1);
}
function frame1(){
if ((parent as Level)){
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
} else {
if ((parent.parent as Level)){
curLevel = Level(parent.parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
};
};
this.propType = "Item";
this.itemName = "valve";
}
}
}//package main
Section 146
//psyProj (main.psyProj)
package main {
public dynamic class psyProj extends projObject {
}
}//package main
Section 147
//RedHouse02_paralax (main.RedHouse02_paralax)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class RedHouse02_paralax extends baseObject {
public function RedHouse02_paralax(){
addFrameScript(0, frame1);
}
function frame1(){
if (!initIDE){
paralaxX = 150;
paralaxY = 40;
saveX = x;
saveY = y;
Level(parent).paralaxObjects.push(this);
};
}
}
}//package main
Section 148
//redHouseWithCellApp_paralax (main.redHouseWithCellApp_paralax)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class redHouseWithCellApp_paralax extends baseObject {
public function redHouseWithCellApp_paralax(){
addFrameScript(0, frame1);
}
function frame1(){
if (!initIDE){
paralaxX = 150;
paralaxY = 40;
saveX = x;
saveY = y;
Level(parent).paralaxObjects.push(this);
};
}
}
}//package main
Section 149
//reload1 (main.reload1)
package main {
import flash.media.*;
public dynamic class reload1 extends Sound {
}
}//package main
Section 150
//ReloadCurType (main.ReloadCurType)
package main {
import flash.display.*;
public dynamic class ReloadCurType extends MovieClip {
public function ReloadCurType(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main
Section 151
//reloaded (main.reloaded)
package main {
import flash.media.*;
public dynamic class reloaded extends Sound {
}
}//package main
Section 152
//Ricochet1 (main.Ricochet1)
package main {
import flash.media.*;
public dynamic class Ricochet1 extends Sound {
}
}//package main
Section 153
//Ricochet2 (main.Ricochet2)
package main {
import flash.media.*;
public dynamic class Ricochet2 extends Sound {
}
}//package main
Section 154
//Ricochet3 (main.Ricochet3)
package main {
import flash.media.*;
public dynamic class Ricochet3 extends Sound {
}
}//package main
Section 155
//Ricochet4 (main.Ricochet4)
package main {
import flash.media.*;
public dynamic class Ricochet4 extends Sound {
}
}//package main
Section 156
//roadHouses (main.roadHouses)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class roadHouses extends baseObject {
public function roadHouses(){
addFrameScript(0, frame1);
}
function frame1(){
if (!initIDE){
paralaxX = 120;
paralaxY = 90;
saveX = x;
saveY = y;
Level(parent).paralaxObjects.push(this);
};
}
}
}//package main
Section 157
//roadHouses2 (main.roadHouses2)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class roadHouses2 extends baseObject {
public function roadHouses2(){
addFrameScript(0, frame1);
}
function frame1(){
if (!initIDE){
paralaxX = 120;
paralaxY = 90;
saveX = x;
saveY = y;
Level(parent).paralaxObjects.push(this);
};
}
}
}//package main
Section 158
//roadHouses3 (main.roadHouses3)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class roadHouses3 extends baseObject {
public function roadHouses3(){
addFrameScript(0, frame1);
}
function frame1(){
if (!initIDE){
paralaxX = 120;
paralaxY = 90;
saveX = x;
saveY = y;
Level(parent).paralaxObjects.push(this);
};
}
}
}//package main
Section 159
//roboAttack (main.roboAttack)
package main {
import flash.media.*;
public dynamic class roboAttack extends Sound {
}
}//package main
Section 160
//robotStep1 (main.robotStep1)
package main {
import flash.media.*;
public dynamic class robotStep1 extends Sound {
}
}//package main
Section 161
//robotStep2 (main.robotStep2)
package main {
import flash.media.*;
public dynamic class robotStep2 extends Sound {
}
}//package main
Section 162
//RPGShoot1 (main.RPGShoot1)
package main {
import flash.media.*;
public dynamic class RPGShoot1 extends Sound {
}
}//package main
Section 163
//sawAttack1 (main.sawAttack1)
package main {
import flash.media.*;
public dynamic class sawAttack1 extends Sound {
}
}//package main
Section 164
//sawAttack2 (main.sawAttack2)
package main {
import flash.media.*;
public dynamic class sawAttack2 extends Sound {
}
}//package main
Section 165
//sawAttack3 (main.sawAttack3)
package main {
import flash.media.*;
public dynamic class sawAttack3 extends Sound {
}
}//package main
Section 166
//ShotgunReload (main.ShotgunReload)
package main {
import flash.media.*;
public dynamic class ShotgunReload extends Sound {
}
}//package main
Section 167
//ShotgunReloaded (main.ShotgunReloaded)
package main {
import flash.media.*;
public dynamic class ShotgunReloaded extends Sound {
}
}//package main
Section 168
//ShotgunShoot1 (main.ShotgunShoot1)
package main {
import flash.media.*;
public dynamic class ShotgunShoot1 extends Sound {
}
}//package main
Section 169
//ShotgunShoot2 (main.ShotgunShoot2)
package main {
import flash.media.*;
public dynamic class ShotgunShoot2 extends Sound {
}
}//package main
Section 170
//sndMed (main.sndMed)
package main {
import flash.media.*;
public dynamic class sndMed extends Sound {
}
}//package main
Section 171
//sndMoney1 (main.sndMoney1)
package main {
import flash.media.*;
public dynamic class sndMoney1 extends Sound {
}
}//package main
Section 172
//sounds (main.sounds)
package main {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
public dynamic class sounds {
static var stageRadius:Number;
public static var vol:Number = 0.9;
static var snd:Object;
public static var sndEnable:Boolean = true;
public static function PlaySnd(_arg1:String, _arg2:Number=NaN, _arg3:MovieClip=null, _arg4:Stage=null):void{
var _local5:SoundTransform;
var _local6:Number;
var _local7:Number;
var _local8:Point;
var _local9:ageVector;
if (!sndEnable){
return;
};
if (_arg3 == null){
_local5 = new SoundTransform();
_local5.volume = vol;
snd[_arg1].play(0, 0, _local5);
} else {
if (((!(vol)) || ((_arg4 == null)))){
return;
};
_local5 = new SoundTransform();
_local8 = _arg3.localToGlobal(new Point((_arg3.width / 2), (_arg3.height / 2)));
_local6 = (_local8.x - (_arg4.stageWidth / 2));
_local7 = (_local8.y - (_arg4.stageHeight / 2));
_local9 = new ageVector();
_local9.set(_local6, _local7);
_local5.volume = ageMath.trimToRange((vol * ageMath.RemapVal(_local9.len(), 0, (_arg2 * stageRadius), 1, 0)), 0, 1);
_local5.pan = ageMath.trimToRange(ageMath.RemapVal(_local9.x, (-(stageRadius) / 2), (stageRadius / 2), -1, 1), -1, 1);
snd[_arg1].play(0, 0, _local5);
};
}
public static function init(_arg1:Number, _arg2:Number){
snd = new Object();
snd["TedPain1"] = new TedPain1();
snd["TedPain2"] = new TedPain2();
snd["TedPain3"] = new TedPain3();
snd["TedDie1"] = new TedDie1();
snd["TedDie2"] = new TedDie2();
snd["ZombieVoice1"] = new ZombieVoice1();
snd["ZombieVoice2"] = new ZombieVoice2();
snd["ZombieVoice3"] = new ZombieVoice3();
snd["ZombieVoice4"] = new ZombieVoice4();
snd["AlienVoice1"] = new alienVox1();
snd["AlienVoice2"] = new alienVox2();
snd["AlienVoice3"] = new alienVox3();
snd["AlienVoice4"] = new alienVox4();
snd["AlienVoice5"] = new alienVox5();
snd["AlienVoice6"] = new alienVox6();
snd["AlienVoice7"] = new alienVox7();
snd["alienPain1"] = new alienPain1();
snd["alienPain2"] = new alienPain2();
snd["alienPain3"] = new alienPain3();
snd["alienPain4"] = new alienPain4();
snd["PistolShoot1"] = new pistolShoot1();
snd["PistolShoot2"] = new pistolShoot2();
snd["PistolReloaded"] = new PistolReloaded();
snd["PistolReload"] = new reload1();
snd["AKShoot1"] = new AKShoot1();
snd["AKShoot2"] = new AKShoot2();
snd["AKReloaded"] = new reloaded();
snd["AKReload"] = new reload1();
snd["ShotgunShoot1"] = new ShotgunShoot1();
snd["ShotgunShoot2"] = new ShotgunShoot2();
snd["ShotgunReload"] = new ShotgunReload();
snd["ShotgunReloaded"] = new ShotgunReloaded();
snd["alienBlasterShoot1"] = new alienBlasterShoot1();
snd["alienBlasterShoot2"] = new alienBlasterShoot2();
snd["BlasterShoot1"] = new alienBlasterShoot1();
snd["BlasterShoot2"] = new alienBlasterShoot2();
snd["BlasterReloaded"] = new reloaded();
snd["BlasterReload"] = new reload1();
snd["MinigunShoot1"] = new MinigunShoot1();
snd["MinigunShoot2"] = new MinigunShoot1();
snd["MinigunReload"] = new MinigunReload();
snd["MinigunReloaded"] = new MinigunReloaded();
snd["RPGShoot1"] = new RPGShoot1();
snd["RPGShoot2"] = new RPGShoot1();
snd["RPGReload"] = new ShotgunReload();
snd["RPGReloaded"] = new ShotgunReloaded();
snd["LasergunShoot1"] = new LasergunShoot1();
snd["LasergunShoot2"] = new LasergunShoot1();
snd["LasergunReload"] = new ShotgunReload();
snd["LasergunReloaded"] = new ShotgunReloaded();
snd["DDDShoot1"] = new AKShoot1();
snd["DDDShoot2"] = new AKShoot2();
snd["DDDReload"] = new ShotgunReload();
snd["DDDReloaded"] = new ShotgunReloaded();
snd["bomb2"] = new bomb2();
snd["bombExp"] = new bombExp();
snd["midExp"] = new midExp();
snd["bigExp"] = new bigExp();
snd["cocking"] = new cocking();
snd["VomitShoot1"] = new bodyBlood1();
snd["VomitShoot2"] = new bodyBlood2();
snd["VomitReloaded"] = new bodyBlood3();
snd["VomitReload"] = new bodyBlood2();
snd["sawAttack1"] = new sawAttack1();
snd["sawAttack2"] = new sawAttack2();
snd["sawAttack3"] = new sawAttack3();
snd["ElectroWave"] = new ElectroWave();
snd["bodyFall1"] = new bodyFall1();
snd["bodyFall2"] = new bodyFall2();
snd["bodyFall3"] = new bodyFall3();
snd["bodyFall4"] = new bodyFall4();
snd["bodyBlood1"] = new bodyBlood1();
snd["bodyBlood2"] = new bodyBlood2();
snd["bodyBlood3"] = new bodyBlood3();
snd["Ricochet1"] = new Ricochet1();
snd["Ricochet2"] = new Ricochet2();
snd["Ricochet3"] = new Ricochet3();
snd["Ricochet4"] = new Ricochet4();
snd["Coin1"] = new Coin1();
snd["Coin2"] = new Coin2();
snd["Money1"] = new sndMoney1();
snd["itemTake"] = new itemTake();
snd["Med"] = new sndMed();
snd["robotStep1"] = new robotStep1();
snd["robotStep2"] = new robotStep2();
snd["cashReg"] = new cashReg();
snd["menuClick"] = new menuClick();
snd["paper1"] = new paper1();
snd["buy"] = new buy();
snd["menuShow"] = new menuShow2();
snd["menuHide"] = new menuHide2();
snd["helpIco"] = new helpIco();
snd["sewerDoorOpen"] = new menuShow2();
stageRadius = (_arg1 / 2);
}
}
}//package main
Section 173
//Spider (main.Spider)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Spider extends actorObject {
public function Spider(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("Spider");
};
}
}
}//package main
Section 174
//SpiderBig (main.SpiderBig)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class SpiderBig extends actorObject {
public function SpiderBig(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("SpiderBig");
};
}
}
}//package main
Section 175
//storyMult (main.storyMult)
package main {
import flash.display.*;
import flash.events.*;
public dynamic class storyMult extends MovieClip {
public var butSkip:SimpleButton;
public function storyMult(){
addFrameScript(0, frame1, 1689, frame1690);
}
function frame1(){
butSkip.addEventListener(MouseEvent.CLICK, butSkip_Click);
}
function frame1690(){
stop();
Game(parent).menuMain.butNewFuncStart();
Game(parent).removeChild(this);
}
public function butSkip_Click(_arg1:Event):void{
sounds.PlaySnd("menuClick");
this.gotoAndStop(1690);
}
}
}//package main
Section 176
//Ted (main.Ted)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Ted extends actorObject {
public function Ted(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
initParams("Ted");
};
}
}
}//package main
Section 177
//trees01 (main.trees01)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class trees01 extends baseObject {
public function trees01(){
addFrameScript(0, frame1);
}
function frame1(){
if (!initIDE){
paralaxX = 80;
paralaxY = 40;
saveX = x;
saveY = y;
Level(parent).paralaxObjects.push(this);
};
}
}
}//package main
Section 178
//trees01_1 (main.trees01_1)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class trees01_1 extends baseObject {
public function trees01_1(){
addFrameScript(0, frame1);
}
function frame1(){
if (!initIDE){
paralaxX = 80;
paralaxY = 40;
saveX = x;
saveY = y;
Level(parent).paralaxObjects.push(this);
};
}
}
}//package main
Section 179
//trees02 (main.trees02)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class trees02 extends baseObject {
public function trees02(){
addFrameScript(0, frame1);
}
function frame1(){
if (!initIDE){
paralaxX = 100;
paralaxY = 40;
saveX = x;
saveY = y;
Level(parent).paralaxObjects.push(this);
};
}
}
}//package main
Section 180
//trees03 (main.trees03)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class trees03 extends baseObject {
public function trees03(){
addFrameScript(0, frame1);
}
function frame1(){
if (!initIDE){
paralaxX = 80;
paralaxY = 40;
saveX = x;
saveY = y;
Level(parent).paralaxObjects.push(this);
};
}
}
}//package main
Section 181
//trees04 (main.trees04)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class trees04 extends baseObject {
public function trees04(){
addFrameScript(0, frame1);
}
function frame1(){
if (!initIDE){
paralaxX = 90;
paralaxY = 40;
saveX = x;
saveY = y;
Level(parent).paralaxObjects.push(this);
};
}
}
}//package main
Section 182
//triggerMarker (main.triggerMarker)
package main {
import flash.display.*;
public dynamic class triggerMarker extends MovieClip {
public function triggerMarker(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package main
Section 183
//upgCrate (main.upgCrate)
package main {
import flash.display.*;
public dynamic class upgCrate extends MovieClip {
public var p0:MovieClip;
public var p1:MovieClip;
public var p3:MovieClip;
public var p2:MovieClip;
var diskImageRectangleBitmapData:BitmapData;
public var info:MovieClip;
public function upgCrate(){
var _local1:DistortImage;
super();
addFrameScript(0, frame1);
diskImageRectangleBitmapData = new BitmapData(info.width, info.height, true, 0);
diskImageRectangleBitmapData.draw(info);
_local1 = new DistortImage(diskImageRectangleBitmapData, 2, 2, true);
addChild(_local1);
_local1.setTransform(p0.x, p0.y, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y);
}
function frame1(){
}
public function UpdateInfo():void{
diskImageRectangleBitmapData.draw(info);
}
}
}//package main
Section 184
//upgItem (main.upgItem)
package main {
public dynamic class upgItem {
var sold:Boolean;// = false
var active:Boolean;// = false
var levAvailable:int;// = 1
var param:Number;// = 1
var info:String;
var cost:int;// = 120
var typeOp:int;// = 1
var upgAvailable:int;// = 1
var paramName:String;// = ""
public function upgItem(_arg1:String, _arg2:int, _arg3:int, _arg4:int, _arg5:String, _arg6:Number, _arg7:int){
info = _arg1;
levAvailable = _arg2;
upgAvailable = _arg3;
cost = _arg4;
param = _arg6;
paramName = _arg5;
typeOp = _arg7;
sold = false;
active = false;
}
public function loadParams(_arg1:String){
active = Boolean(mainGlobal.myCookie.get((_arg1 + "active")));
sold = Boolean(mainGlobal.myCookie.get((_arg1 + "sold")));
}
public function saveParams(_arg1:String){
mainGlobal.myCookie.putNoFlush((_arg1 + "active"), active);
mainGlobal.myCookie.putNoFlush((_arg1 + "sold"), sold);
}
}
}//package main
Section 185
//upgPaper (main.upgPaper)
package main {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public dynamic class upgPaper extends MovieClip {
public var upgItem8:upgPaperParam;
public var upgItem9:upgPaperParam;
public var buttAccept:SimpleButton;
var lastMC:DisplayObject;
var curUpgrades:Array;
var heroMoney:int;// = 1800
var weaponsAmmo:Array;
var curWepNum:int;// = 0
var typeUpg:int;// = 0
public var sel:upgPaperFrame;
var weaponsAmmoMax:Array;
public var buttCancel:upgButtCancel;
public var txtMoney:TextField;
public var upgItem1:upgPaperParam;
public var upgItem2:upgPaperParam;
public var upgItem3:upgPaperParam;
public var upgItem4:upgPaperParam;
public var upgItem5:upgPaperParam;
public var upgItem6:upgPaperParam;
public var upgItem7:upgPaperParam;
public var txtWepName:TextField;
public var upgItem10:upgPaperParam;
public function upgPaper(){
weaponsAmmo = new Array();
weaponsAmmoMax = new Array();
super();
buttCancel.addEventListener(MouseEvent.CLICK, buttCancelClick);
buttAccept.addEventListener(MouseEvent.CLICK, buttAcceptClick);
this.addEventListener(Event.ENTER_FRAME, Update);
this.addEventListener(MouseEvent.CLICK, MouseClick);
lastMC = DisplayObject(getChildByName("upgItem1"));
}
function buttAcceptClick(_arg1:MouseEvent):void{
var _local2:*;
var _local3:int;
var _local4:DisplayObject;
MovieClip(parent).fader50perc.startFadeOut();
MovieClip(parent).showPaper = false;
sounds.PlaySnd("cashReg", 1);
Game(parent.parent).curLev.hero.moneyCnt = heroMoney;
if (typeUpg == 3){
_local3 = 1;
while (_local3 < 6) {
Game(parent.parent).curLev.hero.weapons[_local3].bulletsNum = weaponsAmmo[(_local3 - 1)];
curUpgrades[(_local3 - 1)].sold = false;
_local3++;
};
};
if (typeUpg != 3){
_local2 = 1;
while (_local2 < 11) {
_local4 = DisplayObject(getChildByName(("upgItem" + _local2)));
if (((_local4.visible) && ((_local4.alpha > 0.98)))){
if (curUpgrades[(_local2 - 1)].sold){
if (typeUpg < 5){
curUpgrades[(_local2 - 1)].active = true;
curUpgrades[(_local2 - 1)].sold = false;
Game(parent.parent).curLev.hero.applyUpgrade(typeUpg, (_local2 - 1));
} else {
curUpgrades[(_local2 - 1)].active = true;
curUpgrades[(_local2 - 1)].sold = false;
Game(parent.parent).curLev.hero.weapons[curWepNum].applyUpgrade((_local2 - 1));
};
};
};
_local2++;
};
};
MovieClip(parent).showShop();
}
function updateMenu():void{
var _local2:Array;
var _local3:upgPaperParam;
txtMoney.text = (("You have " + heroMoney) + "$");
var _local1 = 1;
while (_local1 < 11) {
_local3 = upgPaperParam(getChildByName(("upgItem" + _local1)));
_local2 = _local3.filters;
if (((curUpgrades) && ((_local1 <= curUpgrades.length)))){
_local3.visible = true;
_local3.txt.text = ((("(" + curUpgrades[(_local1 - 1)].cost) + "$) ") + curUpgrades[(_local1 - 1)].info);
if ((((((Game(parent.parent).curLev.curLevNum >= curUpgrades[(_local1 - 1)].levAvailable)) && ((((((curUpgrades[(_local1 - 1)].upgAvailable == -1)) || (curUpgrades[curUpgrades[(_local1 - 1)].upgAvailable].sold))) || (curUpgrades[curUpgrades[(_local1 - 1)].upgAvailable].active))))) && (((!((typeUpg == 3))) || (Game(parent.parent).curLev.hero.weapons[_local1].active))))){
if (typeUpg == 3){
_local3.txt.text = (((((_local3.txt.text + " [") + weaponsAmmo[(_local1 - 1)]) + "/") + weaponsAmmoMax[(_local1 - 1)]) + "]");
};
if (((curUpgrades[(_local1 - 1)].sold) || (curUpgrades[(_local1 - 1)].active))){
_local2[0].strength = 1.2;
_local2[0].color = 0xFF00;
_local3.alpha = 1;
} else {
if (heroMoney >= curUpgrades[(_local1 - 1)].cost){
_local2[0].strength = 0;
_local3.alpha = 1;
} else {
_local2[0].strength = 1.2;
_local2[0].color = 0xFF0000;
_local3.alpha = 1;
};
};
} else {
_local2[0].strength = 0;
_local3.alpha = 0.3;
};
} else {
_local3.visible = false;
};
_local3.filters = _local2;
_local1++;
};
}
function buttCancelClick(_arg1:MouseEvent):void{
var _local2:int;
var _local3:DisplayObject;
MovieClip(parent).fader50perc.startFadeOut();
MovieClip(parent).showPaper = false;
sounds.PlaySnd("paper1", 1);
_local2 = 1;
while (_local2 < 11) {
_local3 = DisplayObject(getChildByName(("upgItem" + _local2)));
if (((_local3.visible) && ((_local3.alpha > 0.98)))){
if (curUpgrades[(_local2 - 1)].sold){
curUpgrades[(_local2 - 1)].sold = false;
};
};
_local2++;
};
MovieClip(parent).showShop();
}
function MouseClick(_arg1:MouseEvent):void{
var _local2:int;
var _local3:DisplayObject;
_local2 = 1;
while (_local2 < 11) {
_local3 = DisplayObject(getChildByName(("upgItem" + _local2)));
if (((((((_local3.visible) && ((_local3.alpha > 0.98)))) && (ageMath.inRange((Controls.mousePosX - x), _local3.x, (_local3.x + _local3.width))))) && (ageMath.inRange((Controls.mousePosY - y), _local3.y, (_local3.y + _local3.height))))){
if (((((!(curUpgrades[(_local2 - 1)].sold)) && (!(curUpgrades[(_local2 - 1)].active)))) && ((heroMoney >= curUpgrades[(_local2 - 1)].cost)))){
heroMoney = (heroMoney - curUpgrades[(_local2 - 1)].cost);
sounds.PlaySnd("buy", 1);
if (typeUpg == 3){
weaponsAmmo[(_local2 - 1)] = (weaponsAmmo[(_local2 - 1)] + Game(parent.parent).curLev.hero.weapons[_local2].bulletsInCatrigeMax);
sounds.PlaySnd((Game(parent.parent).curLev.hero.weapons[_local2].type + "Reloaded"));
if (weaponsAmmo[(_local2 - 1)] >= weaponsAmmoMax[(_local2 - 1)]){
weaponsAmmo[(_local2 - 1)] = weaponsAmmoMax[(_local2 - 1)];
curUpgrades[(_local2 - 1)].sold = true;
};
updateMenu();
} else {
curUpgrades[(_local2 - 1)].sold = true;
};
};
break;
};
_local2++;
};
updateMenu();
}
public function Update(_arg1:Event):void{
var _local2:int;
var _local4:DisplayObject;
if (((!(visible)) || (!(MovieClip(parent).visible)))){
return;
};
var _local3:Boolean;
_local2 = 1;
while (_local2 < 11) {
_local4 = DisplayObject(getChildByName(("upgItem" + _local2)));
if (((((((_local4.visible) && ((_local4.alpha > 0.98)))) && (ageMath.inRange((Controls.mousePosX - x), _local4.x, (_local4.x + _local4.width))))) && (ageMath.inRange((Controls.mousePosY - y), _local4.y, (_local4.y + _local4.height))))){
sel.startFadeIn();
sel.y = ageMath.Lerp(_local4.y, sel.y, 0.4);
lastMC = _local4;
_local3 = false;
break;
};
_local2++;
};
if (_local3){
sel.y = ageMath.Lerp(lastMC.y, sel.y, 0.4);
sel.startFadeOut();
};
}
}
}//package main
Section 186
//upgPaperFrame (main.upgPaperFrame)
package main {
public dynamic class upgPaperFrame extends alphaFader {
}
}//package main
Section 187
//upgPaperParam (main.upgPaperParam)
package main {
import flash.display.*;
import flash.text.*;
public dynamic class upgPaperParam extends MovieClip {
public var txt:TextField;
}
}//package main
Section 188
//weaponParam (main.weaponParam)
package main {
public dynamic class weaponParam {
var bulletsDecr:int;// = 1
var shootFunc:Function;
var active:Boolean;// = false
var bulletsInCatrigeMax:int;// = 7
var bulletsInCatrige:int;// = 7
var bulletsNumMax:int;// = 120
var blastStyle:Boolean;// = false
var bulletsNum:int;// = 120
var bulletDelay:int;// = 500
var curLevel:Level;
var accDecSpeed:Number;// = 0.1
var bulletsShotCnt:int;// = 1
var type:String;
var accDistScale:Number;// = 300
var infAmmo:Boolean;// = false
var upgrades:Array;
var accShootInc:Number;// = 1
var damageRadius:Number;// = 1
var accHi:Number;// = 4
var useDiffArms:Boolean;// = false
var accLo:Number;// = 0.1
var bulletSpeed:Number;// = 24
var reloadDelay:int;// = 2000
var damage:Number;// = 1
public function weaponParam(_arg1:String, _arg2:Level){
upgrades = new Array();
super();
curLevel = _arg2;
type = _arg1;
var _local3 = 2;
if (_arg1 == "Pistol"){
useDiffArms = true;
bulletDelay = 400;
reloadDelay = 1200;
accShootInc = 1.5;
bulletsInCatrige = (bulletsInCatrigeMax = 10);
bulletsNum = (bulletsNumMax = 500);
damage = 1;
active = false;
infAmmo = true;
shootFunc = (curLevel.addProj as Function);
upgrades.push(new upgItem("Accuracy 1.5x", 1, -1, 150, "accShootInc", 1, 2));
upgrades.push(new upgItem("Accuracy 2.0x", 1, 0, 250, "accShootInc", 0.8, 2));
upgrades.push(new upgItem("Accuracy 2.5x", 1, 1, 320, "accShootInc", 0.5, 2));
upgrades.push(new upgItem("Rate of fire +25%", 1, -1, 150, "bulletDelay", 375, 2));
upgrades.push(new upgItem("Rate of fire +50%", 1, 3, 280, "bulletDelay", 250, 2));
upgrades.push(new upgItem("Magazine +5", 1, -1, 200, "bulletsInCatrige", 15, 2));
upgrades.push(new upgItem("Magazine +10", 1, 5, 300, "bulletsInCatrige", 20, 2));
upgrades.push(new upgItem("Reload +25%", 1, -1, 150, "reloadDelay", 900, 2));
upgrades.push(new upgItem("Reload +50%", 1, 7, 200, "reloadDelay", 750, 2));
} else {
if (_arg1 == "Shotgun"){
useDiffArms = false;
bulletDelay = 950;
reloadDelay = 2500;
accShootInc = 2.5;
bulletsInCatrige = (bulletsInCatrigeMax = 8);
bulletsNumMax = 128;
bulletsNum = (bulletsInCatrigeMax * _local3);
damage = 0.8;
bulletsShotCnt = 4;
active = false;
shootFunc = (curLevel.addProj as Function);
upgrades.push(new upgItem("Accuracy 1.5x", 1, -1, 150, "accShootInc", 2, 2));
upgrades.push(new upgItem("Accuracy 2.0x", 1, 0, 250, "accShootInc", 1.5, 2));
upgrades.push(new upgItem("Accuracy 2.5x", 1, 1, 350, "accShootInc", 1, 2));
upgrades.push(new upgItem("Rate of fire +25%", 1, -1, 250, "bulletDelay", 800, 2));
upgrades.push(new upgItem("Rate of fire +50%", 1, 3, 380, "bulletDelay", 550, 2));
upgrades.push(new upgItem("Number of shots +1", 1, -1, 250, "bulletsShotCnt", 5, 2));
upgrades.push(new upgItem("Number of shots +2", 1, 5, 400, "bulletsShotCnt", 6, 2));
upgrades.push(new upgItem("Number of shots +3", 1, 6, 550, "bulletsShotCnt", 7, 2));
upgrades.push(new upgItem("Reload +30%", 1, -1, 350, "reloadDelay", 1750, 2));
upgrades.push(new upgItem("Damage +20%", 1, -1, 450, "damage", 1, 2));
} else {
if (_arg1 == "AK"){
useDiffArms = false;
bulletDelay = 200;
reloadDelay = 2000;
accShootInc = 0.8;
accHi = 3;
bulletsInCatrige = (bulletsInCatrigeMax = 30);
bulletsNumMax = 600;
bulletsNum = (bulletsInCatrigeMax * _local3);
damage = 1;
active = false;
shootFunc = (curLevel.addProj as Function);
upgrades.push(new upgItem("Accuracy 1.5x", 1, -1, 200, "accShootInc", 0.8, 2));
upgrades.push(new upgItem("Accuracy 2.0x", 1, 0, 400, "accShootInc", 0.53, 2));
upgrades.push(new upgItem("Rate of fire +40%", 1, -1, 450, "bulletDelay", 120, 2));
upgrades.push(new upgItem("Magazine +5", 1, -1, 200, "bulletsInCatrige", 35, 2));
upgrades.push(new upgItem("Magazine +12", 1, 3, 250, "bulletsInCatrige", 42, 2));
upgrades.push(new upgItem("Magazine +18", 1, 4, 350, "bulletsInCatrige", 48, 2));
upgrades.push(new upgItem("Reload +30%", 1, -1, 350, "reloadDelay", 1400, 2));
upgrades.push(new upgItem("Damage +20%", 1, -1, 350, "damage", 1.2, 2));
upgrades.push(new upgItem("Damage +50%", 1, 7, 550, "damage", 1.4, 2));
} else {
if (_arg1 == "Minigun"){
useDiffArms = false;
bulletDelay = 100;
reloadDelay = 3500;
accShootInc = 1;
accHi = 2.5;
bulletsInCatrige = (bulletsInCatrigeMax = 200);
bulletsNumMax = 1200;
bulletsNum = (bulletsInCatrigeMax * 6);
damage = 1;
active = false;
bulletsDecr = 3;
shootFunc = (curLevel.addProj_MinigunBeam as Function);
upgrades.push(new upgItem("Accuracy 1.5x", 1, -1, 350, "accShootInc", 0.8, 2));
upgrades.push(new upgItem("Accuracy 2.0x", 1, 0, 550, "accShootInc", 0.4, 2));
upgrades.push(new upgItem("Rate of fire +20%", 1, -1, 350, "bulletDelay", 80, 2));
upgrades.push(new upgItem("Rate of fire +40%", 1, 2, 550, "bulletDelay", 60, 2));
upgrades.push(new upgItem("Magazine +50", 1, -1, 250, "bulletsInCatrige", 250, 2));
upgrades.push(new upgItem("Magazine +100", 1, 4, 350, "bulletsInCatrige", 300, 2));
upgrades.push(new upgItem("Reload +50%", 1, -1, 580, "reloadDelay", 1400, 2));
upgrades.push(new upgItem("Damage +30%", 1, -1, 350, "damage", 1.2, 2));
upgrades.push(new upgItem("Damage +60%", 1, 7, 600, "damage", 1.5, 2));
} else {
if (_arg1 == "Blaster"){
useDiffArms = false;
bulletDelay = 500;
reloadDelay = 2000;
accShootInc = 1;
accHi = 3;
bulletsInCatrige = (bulletsInCatrigeMax = 15);
bulletsNumMax = 60;
bulletsNum = (bulletsInCatrigeMax * _local3);
damage = 5;
active = false;
bulletSpeed = 14;
shootFunc = (curLevel.addBlasterProj as Function);
upgrades.push(new upgItem("Plasma speed 1.5x", 1, -1, 450, "bulletSpeed", 17, 2));
upgrades.push(new upgItem("Plasma speed 2.0x", 1, 0, 650, "bulletSpeed", 25, 2));
upgrades.push(new upgItem("Rate of fire +30%", 1, -1, 350, "bulletDelay", 350, 2));
upgrades.push(new upgItem("Rate of fire +50%", 1, 2, 550, "bulletDelay", 250, 2));
upgrades.push(new upgItem("Magazine +5", 1, -1, 350, "bulletsInCatrige", 20, 2));
upgrades.push(new upgItem("Magazine +15", 1, 4, 550, "bulletsInCatrige", 30, 2));
upgrades.push(new upgItem("Reload +50%", 1, -1, 450, "reloadDelay", 1200, 2));
} else {
if (_arg1 == "RPG"){
useDiffArms = false;
bulletDelay = 1;
reloadDelay = 2000;
accShootInc = 1;
accHi = 3;
bulletsInCatrige = (bulletsInCatrigeMax = 1);
bulletsNumMax = 5;
bulletsNum = (bulletsInCatrigeMax * _local3);
damage = 35;
active = false;
blastStyle = true;
damageRadius = 160;
bulletSpeed = 20;
shootFunc = (curLevel.addProj_Rocket as Function);
upgrades.push(new upgItem("Rocket speed +15%", 1, -1, 350, "bulletSpeed", 22.5, 2));
upgrades.push(new upgItem("Rocket speed +35%", 1, 0, 500, "bulletSpeed", 24, 2));
upgrades.push(new upgItem("Reload +30%", 1, -1, 350, "reloadDelay", 1400, 2));
upgrades.push(new upgItem("Ammo +5", 1, -1, 350, "bulletsNum", 10, 2));
upgrades.push(new upgItem("Ammo +10", 1, 3, 550, "bulletsNum", 15, 2));
upgrades.push(new upgItem("Ammo +15", 1, 4, 750, "bulletsNum", 20, 2));
upgrades.push(new upgItem("Damage +30%", 1, -1, 350, "damage", 46, 2));
upgrades.push(new upgItem("Damage +50%", 1, 6, 550, "damage", 53, 2));
upgrades.push(new upgItem("Damage radius +10%", 1, -1, 350, "damageRadius", 176, 2));
upgrades.push(new upgItem("Damage radius +20%", 1, 8, 500, "damageRadius", 190, 2));
} else {
if (_arg1 == "Lasergun"){
useDiffArms = false;
bulletDelay = 800;
reloadDelay = 3000;
accShootInc = 1;
accHi = 2;
bulletsInCatrige = (bulletsInCatrigeMax = 10);
bulletsNumMax = 50;
bulletsNum = (bulletsInCatrigeMax * _local3);
damage = 4;
active = false;
upgrades.push(new upgItem("Reload +30%", 1, -1, 300, "reloadDelay", 2100, 2));
upgrades.push(new upgItem("Reload +50%", 1, 0, 300, "reloadDelay", 1500, 2));
upgrades.push(new upgItem("Magazine +5", 1, -1, 250, "bulletsInCatrige", 15, 2));
upgrades.push(new upgItem("Magazine +10", 1, 2, 350, "bulletsInCatrige", 20, 2));
upgrades.push(new upgItem("Damage +50%", 1, -1, 350, "damage", 6, 2));
upgrades.push(new upgItem("Damage +100%", 1, 4, 500, "damage", 8, 2));
upgrades.push(new upgItem("Ammo +20", 1, -1, 250, "bulletsNum", 70, 2));
shootFunc = (curLevel.addProj_LaserBeam as Function);
} else {
if (_arg1 == "DDD"){
useDiffArms = false;
bulletDelay = 200;
reloadDelay = 4000;
accShootInc = 1;
accHi = 3;
bulletsInCatrige = (bulletsInCatrigeMax = 1);
bulletsNumMax = 2;
bulletsNum = (bulletsInCatrigeMax * _local3);
damage = 1;
active = false;
upgrades.push(new upgItem("Reload +30%", 1, -1, 300, "reloadDelay", 1400, 2));
upgrades.push(new upgItem("Reload +50%", 1, 0, 300, "reloadDelay", 1000, 2));
upgrades.push(new upgItem("Magazine +5", 1, -1, 250, "bulletsInCatrige", 15, 2));
upgrades.push(new upgItem("Magazine +10", 1, 2, 350, "bulletsInCatrige", 20, 2));
upgrades.push(new upgItem("Damage +50%", 1, -1, 350, "damage", 6, 2));
upgrades.push(new upgItem("Damage +100%", 1, 4, 500, "damage", 8, 2));
upgrades.push(new upgItem("Ammo +20", 1, -1, 250, "bulletsNum", 70, 2));
shootFunc = (curLevel.addProj as Function);
} else {
if (_arg1 == "Vomit"){
useDiffArms = true;
bulletDelay = 2500;
reloadDelay = 1500;
accShootInc = 1.5;
bulletsInCatrige = (bulletsInCatrigeMax = 30);
bulletsNum = (bulletsNumMax = 500);
damage = 1;
active = false;
bulletSpeed = 13;
infAmmo = true;
shootFunc = (curLevel.addProj_Vomit as Function);
} else {
if (_arg1 == "psyProj"){
useDiffArms = true;
bulletDelay = 2500;
reloadDelay = 1500;
accShootInc = 1.5;
bulletsInCatrige = (bulletsInCatrigeMax = 30);
bulletsNum = (bulletsNumMax = 500);
damage = 3;
active = false;
bulletSpeed = 13;
infAmmo = true;
shootFunc = (curLevel.addProj_Psy as Function);
} else {
if (_arg1 == "BombWep"){
useDiffArms = false;
bulletDelay = 1;
reloadDelay = 2000;
accShootInc = 1;
accHi = 3;
bulletsInCatrige = (bulletsInCatrigeMax = 1);
bulletsNumMax = 5;
bulletsNum = (bulletsInCatrigeMax * _local3);
damage = 35;
active = false;
blastStyle = true;
damageRadius = 95;
bulletSpeed = 8;
infAmmo = true;
shootFunc = (curLevel.addProj_BombWep as Function);
};
};
};
};
};
};
};
};
};
};
};
}
public function loadParams(_arg1:String){
var _local2:int;
active = Boolean(mainGlobal.myCookie.get((_arg1 + "active")));
bulletDelay = int(mainGlobal.myCookie.get((_arg1 + "bulletDelay")));
reloadDelay = int(mainGlobal.myCookie.get((_arg1 + "reloadDelay")));
bulletsInCatrige = int(mainGlobal.myCookie.get((_arg1 + "bulletsInCatrige")));
bulletsInCatrigeMax = int(mainGlobal.myCookie.get((_arg1 + "bulletsInCatrigeMax")));
bulletsShotCnt = int(mainGlobal.myCookie.get((_arg1 + "bulletsShotCnt")));
bulletsNum = int(mainGlobal.myCookie.get((_arg1 + "bulletsNum")));
bulletsDecr = int(mainGlobal.myCookie.get((_arg1 + "bulletsDecr")));
bulletsNumMax = int(mainGlobal.myCookie.get((_arg1 + "bulletsNumMax")));
damage = Number(mainGlobal.myCookie.get((_arg1 + "damage")));
bulletSpeed = Number(mainGlobal.myCookie.get((_arg1 + "bulletSpeed")));
damageRadius = Number(mainGlobal.myCookie.get((_arg1 + "damageRadius")));
accLo = Number(mainGlobal.myCookie.get((_arg1 + "accLo")));
accHi = Number(mainGlobal.myCookie.get((_arg1 + "accHi")));
accDecSpeed = Number(mainGlobal.myCookie.get((_arg1 + "accDecSpeed")));
accShootInc = Number(mainGlobal.myCookie.get((_arg1 + "accShootInc")));
accDistScale = Number(mainGlobal.myCookie.get((_arg1 + "accDistScale")));
_local2 = 0;
while (_local2 < upgrades.length) {
upgrades[_local2].loadParams(((_arg1 + type) + _local2.toString()));
_local2++;
};
}
public function applyUpgrade(_arg1:int){
if (upgrades[_arg1].typeOp == 0){
this[upgrades[_arg1].paramName] = (this[upgrades[_arg1].paramName] + upgrades[_arg1].param);
} else {
if (upgrades[_arg1].typeOp == 1){
this[upgrades[_arg1].paramName] = (this[upgrades[_arg1].paramName] * upgrades[_arg1].param);
} else {
if (upgrades[_arg1].typeOp == 2){
this[upgrades[_arg1].paramName] = upgrades[_arg1].param;
};
};
};
if (this[(upgrades[_arg1].paramName + "Max")]){
this[(upgrades[_arg1].paramName + "Max")] = this[upgrades[_arg1].paramName];
};
}
public function saveParams(_arg1:String){
var _local2:int;
mainGlobal.myCookie.putNoFlush((_arg1 + "active"), active);
mainGlobal.myCookie.putNoFlush((_arg1 + "bulletDelay"), bulletDelay);
mainGlobal.myCookie.putNoFlush((_arg1 + "reloadDelay"), reloadDelay);
mainGlobal.myCookie.putNoFlush((_arg1 + "bulletsInCatrige"), bulletsInCatrige);
mainGlobal.myCookie.putNoFlush((_arg1 + "bulletsInCatrigeMax"), bulletsInCatrigeMax);
mainGlobal.myCookie.putNoFlush((_arg1 + "bulletsShotCnt"), bulletsShotCnt);
mainGlobal.myCookie.putNoFlush((_arg1 + "bulletsNum"), bulletsNum);
mainGlobal.myCookie.putNoFlush((_arg1 + "bulletsDecr"), bulletsDecr);
mainGlobal.myCookie.putNoFlush((_arg1 + "bulletsNumMax"), bulletsNumMax);
mainGlobal.myCookie.putNoFlush((_arg1 + "damage"), damage);
mainGlobal.myCookie.putNoFlush((_arg1 + "bulletSpeed"), bulletSpeed);
mainGlobal.myCookie.putNoFlush((_arg1 + "damageRadius"), damageRadius);
mainGlobal.myCookie.putNoFlush((_arg1 + "accLo"), accLo);
mainGlobal.myCookie.putNoFlush((_arg1 + "accHi"), accHi);
mainGlobal.myCookie.putNoFlush((_arg1 + "accDecSpeed"), accDecSpeed);
mainGlobal.myCookie.putNoFlush((_arg1 + "accShootInc"), accShootInc);
mainGlobal.myCookie.putNoFlush((_arg1 + "accDistScale"), accDistScale);
_local2 = 0;
while (_local2 < upgrades.length) {
upgrades[_local2].saveParams(((_arg1 + type) + _local2.toString()));
_local2++;
};
}
}
}//package main
Section 189
//wepLuncherProp (main.wepLuncherProp)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class wepLuncherProp extends propObject {
public function wepLuncherProp(){
addFrameScript(0, frame1);
}
function frame1(){
if ((parent as Level)){
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
} else {
if ((parent.parent as Level)){
curLevel = Level(parent.parent);
curLevel.dynObjects.push(this);
curLevel.propObjects.push(this);
isRubber = true;
};
};
this.wepNum = 5;
this.propType = "Weapon";
}
}
}//package main
Section 190
//Zomb01 (main.Zomb01)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Zomb01 extends actorObject {
public function Zomb01(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("Zomb01");
};
}
}
}//package main
Section 191
//Zomb01Run (main.Zomb01Run)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Zomb01Run extends actorObject {
public function Zomb01Run(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("Zomb01Run");
};
}
}
}//package main
Section 192
//Zomb01Vomit (main.Zomb01Vomit)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Zomb01Vomit extends actorObject {
public function Zomb01Vomit(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("Zomb01Vomit");
};
}
}
}//package main
Section 193
//Zomb02 (main.Zomb02)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Zomb02 extends actorObject {
public function Zomb02(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("Zomb02");
};
}
}
}//package main
Section 194
//Zomb02Run (main.Zomb02Run)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Zomb02Run extends actorObject {
public function Zomb02Run(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("Zomb02Run");
};
}
}
}//package main
Section 195
//Zomb02Vomit (main.Zomb02Vomit)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Zomb02Vomit extends actorObject {
public function Zomb02Vomit(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("Zomb02Vomit");
};
}
}
}//package main
Section 196
//Zomb03 (main.Zomb03)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Zomb03 extends actorObject {
public function Zomb03(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("Zomb03");
};
}
}
}//package main
Section 197
//Zomb03Run (main.Zomb03Run)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Zomb03Run extends actorObject {
public function Zomb03Run(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("Zomb03Run");
};
}
}
}//package main
Section 198
//Zomb03Vomit (main.Zomb03Vomit)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Zomb03Vomit extends actorObject {
public function Zomb03Vomit(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("Zomb03Vomit");
};
}
}
}//package main
Section 199
//Zomb04 (main.Zomb04)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Zomb04 extends actorObject {
public function Zomb04(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("Zomb04");
};
}
}
}//package main
Section 200
//Zomb04Run (main.Zomb04Run)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Zomb04Run extends actorObject {
public function Zomb04Run(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("Zomb04Run");
};
}
}
}//package main
Section 201
//Zomb04Vomit (main.Zomb04Vomit)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Zomb04Vomit extends actorObject {
public function Zomb04Vomit(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("Zomb04Vomit");
};
}
}
}//package main
Section 202
//Zomb05 (main.Zomb05)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Zomb05 extends actorObject {
public function Zomb05(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("Zomb05");
};
}
}
}//package main
Section 203
//Zomb05Run (main.Zomb05Run)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Zomb05Run extends actorObject {
public function Zomb05Run(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("Zomb05Run");
};
}
}
}//package main
Section 204
//Zomb05Vomit (main.Zomb05Vomit)
package main {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Zomb05Vomit extends actorObject {
public function Zomb05Vomit(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("Zomb05Vomit");
};
}
}
}//package main
Section 205
//ZombPsy (main.ZombPsy)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class ZombPsy extends actorObject {
public function ZombPsy(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("ZombPsy");
};
}
}
}//package main
Section 206
//ZombTank (main.ZombTank)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class ZombTank extends actorObject {
public function ZombTank(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("ZombTank");
};
}
}
}//package main
Section 207
//ZombTankRun (main.ZombTankRun)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class ZombTankRun extends actorObject {
public function ZombTankRun(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!initIDE){
initIDE = true;
curLevel = Level(parent);
curLevel.dynObjects.push(this);
curLevel.enemies.push(this);
initParams("ZombTankRun");
};
}
}
}//package main
Section 208
//MochiBot (mochi.as3.MochiBot)
package mochi.as3 {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
if (Security.sandboxType == "localWithFile"){
return (null);
};
var _local3:MochiBot = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
var _local4 = "http://core.mochibot.com/my/core.swf";
var _local5:URLVariables = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
var _local6:String = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
var _local7:URLRequest = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
var _local8:Loader = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package mochi.as3
Section 209
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const NO_USER:String = "NoUser";
public static const IO_ERROR:String = "IOError";
public static const ITEM_NEW:String = "ItemNew";
public static const ITEM_OWNED:String = "ItemOwned";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const STORE_SHOW:String = "StoreShow";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _inventory:MochiInventory;
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function showStore(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function requestFunding(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestFunding", _arg1);
}
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_inventory = new MochiInventory();
});
addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 210
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function reencode():void{
var _local1:uint = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function toString():String{
var _local1:String = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function get value():Number{
return (Number(this.toString()));
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi.as3
Section 211
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
eventTable = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
return;
};
for (_local3 in eventTable[_arg1]) {
var _local6 = eventTable[_arg1];
_local6[_local3](_arg2);
};
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
eventTable[_arg1] = [];
return;
};
for (_local3 in eventTable[_arg1]) {
if (eventTable[_arg1][_local3] != _arg2){
} else {
eventTable[_arg1].splice(Number(_local3), 1);
};
};
}
public function addEventListener(_arg1:String, _arg2:Function):void{
removeEventListener(_arg1, _arg2);
eventTable[_arg1].push(_arg2);
}
}
}//package mochi.as3
Section 212
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public static function endPlay():void{
MochiServices.send("events_clearRoundID", null, null, null);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function trackEvent(_arg1:String, _arg2=null):void{
MochiServices.send("events_trackEvent", {tag:_arg1, value:_arg2}, null, null);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function startSession(_arg1:String):void{
MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function setNotifications(_arg1:MovieClip, _arg2:Object):void{
var _local4:Object;
var _local3:Object = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
_local3.clip = _arg1;
MochiServices.send("events_setNotifications", _local3, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startPlay(_arg1:String="gameplay"):void{
MochiServices.send("events_setRoundID", {tag:String(_arg1)}, null, null);
}
}
}//package mochi.as3
Section 213
//MochiInventory (mochi.as3.MochiInventory)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
public dynamic class MochiInventory extends Proxy {
private var _timer:Timer;
private var _names:Array;
private var _syncID:Number;
private var _consumableProperties:Object;
private var _storeSync:Object;
private var _outstandingID:Number;
private var _syncPending:Boolean;
public static const READY:String = "InvReady";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
private static const KEY_SALT:String = " syncMaint";
public static const WRITTEN:String = "InvWritten";
public static const NOT_READY:String = "InvNotReady";
public static const VALUE_ERROR:String = "InvValueError";
private static const CONSUMER_KEY:String = "MochiConsumables";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut);
_storeSync = new Object();
_syncPending = false;
_outstandingID = 0;
_syncID = 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
loggedOut();
};
}
private function newItems(_arg1:Object):void{
if (!this[(_arg1.id + KEY_SALT)]){
this[(_arg1.id + KEY_SALT)] = 0;
};
if (!this[_arg1.id]){
this[_arg1.id] = 0;
};
this[(_arg1.id + KEY_SALT)] = (this[(_arg1.id + KEY_SALT)] + _arg1.count);
this[_arg1.id] = (this[_arg1.id] + _arg1.count);
if (((_arg1.privateProperties) && (_arg1.privateProperties.consumable))){
if (!this[_arg1.privateProperties.tag]){
this[_arg1.privateProperties.tag] = 0;
};
this[_arg1.privateProperties.tag] = (this[_arg1.privateProperties.tag] + (_arg1.privateProperties.inc * _arg1.count));
};
}
public function release():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if (_consumableProperties[_arg1]){
return (MochiDigits(_consumableProperties[_arg1]).value);
};
return (undefined);
}
private function loggedIn(_arg1:Object=null):void{
MochiUserData.get(CONSUMER_KEY, getConsumableBag);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(_arg1):Boolean{
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if (_consumableProperties[_arg1] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(_arg1:int):int{
return (((_arg1)>=_names.length) ? 0 : (_arg1 + 1));
}
private function putConsumableBag(_arg1:MochiUserData):void{
_syncPending = false;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
_outstandingID = -1;
};
triggerEvent(WRITTEN, {});
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:MochiDigits;
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!(_arg2 is Number)){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:_arg2});
return;
};
if (_consumableProperties[_arg1]){
_local3 = MochiDigits(_consumableProperties[_arg1]);
if (_local3.value == _arg2){
return;
};
_local3.value = _arg2;
} else {
_names.push(_arg1);
_consumableProperties[_arg1] = new MochiDigits(_arg2);
};
_syncID++;
}
private function itemOwned(_arg1:Object):void{
_storeSync[_arg1.id] = {properties:_arg1.properties, count:_arg1.count};
}
private function sync(_arg1:Event=null):void{
var _local3:String;
if (((_syncPending) || ((_syncID == _outstandingID)))){
return;
};
_outstandingID = _syncID;
var _local2:Object = {};
for (_local3 in _consumableProperties) {
_local2[_local3] = MochiDigits(_consumableProperties[_local3]).value;
};
MochiUserData.put(CONSUMER_KEY, _local2, putConsumableBag);
_syncPending = true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(_arg1:int):String{
return (_names[(_arg1 - 1)]);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(_arg1):Boolean{
if (!_consumableProperties[_arg1]){
return (false);
};
_names.splice(_names.indexOf(_arg1), 1);
delete _consumableProperties[_arg1];
return (true);
}
private function getConsumableBag(_arg1:MochiUserData):void{
var _local2:String;
var _local3:Number;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
return;
};
_consumableProperties = {};
_names = new Array();
if (_arg1.data){
for (_local2 in _arg1.data) {
_names.push(_local2);
_consumableProperties[_local2] = new MochiDigits(_arg1.data[_local2]);
};
};
for (_local2 in _storeSync) {
_local3 = _storeSync[_local2].count;
if (_consumableProperties[(_local2 + KEY_SALT)]){
_local3 = (_local3 - _consumableProperties[(_local2 + KEY_SALT)].value);
};
if (_local3 == 0){
} else {
newItems({id:_local2, count:_local3, properties:_storeSync[_local2].properties});
};
};
triggerEvent(READY, {});
}
private function loggedOut(_arg1:Object=null):void{
_consumableProperties = null;
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
}
}//package mochi.as3
Section 214
//MochiScores (mochi.as3.MochiScores)
package mochi.as3 {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(_arg1:Object=null):void{
var n:Number;
var options = _arg1;
if (options != null){
delete options.clip;
MochiServices.setContainer();
MochiServices.bringToTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
var _local2:Object = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
_arg1 = Number(_arg1);
if (isNaN(_arg1)){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(_arg1) != _arg1){
trace((("WARNING: Submitted score '" + String(_arg1)) + "' will be truncated"));
};
_arg1 = Number(_arg1);
};
};
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (((((_arg1) && ((_arg1.error == true)))) && (onErrorHandler))){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiServices.warnID(_arg1, true);
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi.as3
Section 215
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
public static const CONNECTED:String = "onConnected";
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _queue:Array;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
private static var _nextCallbackID:Number;
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var _callbacks:Object;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(_arg1:Object):void{
var methodName:String;
var pkg = _arg1;
var cb:String = pkg.callbackID;
var cblst:Object = _callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
methodName = "";
var obj:Object = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete _callbacks[cb];
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1));
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_queue.push({methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
};
if (_clip != null){
if (_callbacks != null){
_callbacks[_nextCallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_nextCallbackID++;
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local4:int;
var _local14:Loader;
var _local3:Array = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
var _local5:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
var _local6:Array = [0, 64, 0, 0, 0];
var _local7:MovieClip = new MovieClip();
var _local8:LocalConnection = new LocalConnection();
var _local9:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
var _local10:ByteArray = new ByteArray();
var _local11:ByteArray = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
var _local12:uint = ((_local3.length + _local11.length) + 4);
var _local13:uint = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
private static function detach(_arg1:Event):void{
var _local2:LoaderInfo = LoaderInfo(_arg1.target);
_local2.removeEventListener(Event.COMPLETE, detach);
_local2.removeEventListener(IOErrorEvent.IO_ERROR, detach);
_local2.removeEventListener(Event.COMPLETE, loadLCBridgeComplete);
_local2.removeEventListener(IOErrorEvent.IO_ERROR, loadError);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
private static function loadLCBridgeComplete(_arg1:Event):void{
var _local2:Loader = LoaderInfo(_arg1.target).loader;
_mochiLocalConnection = MovieClip(_local2.content);
listen();
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_mochiLocalConnection.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, connectWait);
_timer = null;
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function getVersion():String{
return ("3.9.1 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
var _local3:Number = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + _arg1));
return;
};
_local3++;
};
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_queue))){
while (_queue.length > 0) {
_local2 = _queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _callbacks[_local2.callbackID];
};
delete _callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(_arg1:Object):void{
var _local2:String = _arg1.target;
var _local3:String = _arg1.event;
switch (_local2){
case "services":
MochiServices.triggerEvent(_arg1.event, _arg1.args);
break;
case "events":
MochiEvents.triggerEvent(_arg1.event, _arg1.args);
break;
case "coins":
MochiCoins.triggerEvent(_arg1.event, _arg1.args);
break;
case "social":
MochiSocial.triggerEvent(_arg1.event, _arg1.args);
break;
};
}
private static function urlOptions(_arg1:Object):Object{
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
var _local2:Object = {};
if (_arg1.stage){
_local3 = _arg1.stage.loaderInfo.parameters.mochiad_options;
} else {
_local3 = _arg1.loaderInfo.parameters.mochiad_options;
};
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var avm1Click:DisplayObject;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
var vars:Object = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
var s = "?";
var i:Number = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://link.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
var _local2:Rectangle = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_clip.parent){
_clip.parent.removeChild(_clip);
};
if (_arg1 != null){
if ((_arg1 is DisplayObjectContainer)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is DisplayObjectContainer)){
DisplayObjectContainer(_container).addChild(_clip);
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
private static function loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
public static function get childClip():Object{
return (_clip);
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _queue.shift());
};
};
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
private static function loadLCBridge(_arg1:Object):void{
var _local2:Loader = new Loader();
var _local3:String = (_servURL + _mochiLC);
var _local4:URLRequest = new URLRequest(_local3);
_local2.contentLoaderInfo.addEventListener(Event.COMPLETE, detach);
_local2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach);
_local2.contentLoaderInfo.addEventListener(Event.COMPLETE, loadLCBridgeComplete);
_local2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
_local2.load(_local4);
_arg1.addChild(_local2);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(_arg2).servURL){
_servURL = urlOptions(_arg2).servURL;
};
var _local3:String = (_servURL + _services);
if (urlOptions(_arg2).servicesURL){
_local3 = urlOptions(_arg2).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(_local3);
_clip = new MovieClip();
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, detach);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
var _local4:URLRequest = new URLRequest(_local3);
var _local5:URLVariables = new URLVariables();
_local5.listenLC = _listenChannelName;
_local5.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options;
_local5.api_version = getVersion();
if (widget){
_local5.widget = true;
};
_local4.data = _local5;
_loader.load(_local4);
_clip.addChild(_loader);
_sendChannel = new LocalConnection();
_queue = [];
_nextCallbackID = 0;
_callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function get clip():Object{
return (_container);
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if ((clip is DisplayObject)){
if (clip.stage == null){
trace("MochiServices connect requires the containing clip be attached to the stage");
};
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
} else {
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, connectWait);
_timer = null;
};
}
}
}//package mochi.as3
Section 216
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const ACTION_CANCELED:String = "onCancel";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const IO_ERROR:String = "IOError";
public static const NO_USER:String = "NoUser";
public static const FRIEND_LIST:String = "FriendsList";
public static const PROFILE_DATA:String = "ProfileData";
public static const GAMEPLAY_DATA:String = "GameplayData";
public static const ACTION_COMPLETE:String = "onComplete";
public static const LOGIN_SHOW:String = "LoginShow";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const USER_INFO:String = "UserInfo";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const ERROR:String = "Error";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_HIDE:String = "LoginHide";
public static const LOGIN_SHOWN:String = "LoginShown";
public static var _user_info:Object = null;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static function requestFan(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestFan", _arg1);
}
public static function postToStream(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_postToStream", _arg1);
}
public static function getFriendsList(_arg1:Object=null):void{
MochiServices.send("social_getFriendsList", _arg1);
}
public static function requestLogin(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestLogin", _arg1);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("social_saveUserProperties", _arg1);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function inviteFriends(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_inviteFriends", _arg1);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_showLoginWidget", {options:_arg1});
}
public static function getAPIURL():String{
if (!_user_info){
return (null);
};
return (_user_info.api_url);
}
public static function hideLoginWidget():void{
MochiServices.send("social_hideLoginWidget");
}
public static function getAPIToken():String{
if (!_user_info){
return (null);
};
return (_user_info.api_token);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_user_info = _arg1;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 217
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class MochiUserData extends EventDispatcher {
public var callback:Function;// = null
public var operation:String;// = null
public var error:Event;// = null
public var data;// = null
public var _loader:URLLoader;
public var key:String;// = null
public function MochiUserData(_arg1:String="", _arg2:Function=null){
this.key = _arg1;
this.callback = _arg2;
}
public function serialize(_arg1):ByteArray{
var _local2:ByteArray = new ByteArray();
_local2.objectEncoding = ObjectEncoding.AMF3;
_local2.writeObject(_arg1);
_local2.compress();
return (_local2);
}
public function errorHandler(_arg1:IOErrorEvent):void{
data = null;
error = _arg1;
if (callback != null){
performCallback();
} else {
dispatchEvent(_arg1);
};
close();
}
public function putEvent(_arg1):void{
request("put", serialize(_arg1));
}
public function deserialize(_arg1:ByteArray){
_arg1.objectEncoding = ObjectEncoding.AMF3;
_arg1.uncompress();
return (_arg1.readObject());
}
public function securityErrorHandler(_arg1:SecurityErrorEvent):void{
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _arg1.toString())));
}
public function getEvent():void{
request("get", serialize(null));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public function performCallback():void{
try {
callback(this);
} catch(e:Error) {
trace(("[MochiUserData] exception during callback: " + e));
};
}
public function request(_arg1:String, _arg2:ByteArray):void{
var _operation = _arg1;
var _data = _arg2;
operation = _operation;
var api_url:String = MochiSocial.getAPIURL();
var api_token:String = MochiSocial.getAPIToken();
if ((((api_url == null)) || ((api_token == null)))){
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in"));
return;
};
_loader = new URLLoader();
var args:URLVariables = new URLVariables();
args.op = _operation;
args.key = key;
var req:URLRequest = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString()));
req.method = URLRequestMethod.POST;
req.contentType = "application/x-mochi-userdata";
req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)];
req.data = _data;
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
try {
_loader.load(req);
} catch(e:SecurityError) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + e.toString())));
};
}
public function completeHandler(_arg1:Event):void{
var event = _arg1;
try {
if (_loader.data.length){
data = deserialize(_loader.data);
} else {
data = null;
};
} catch(e:Error) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + e.toString())));
return;
};
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function close():void{
if (_loader){
_loader.removeEventListener(Event.COMPLETE, completeHandler);
_loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.close();
_loader = null;
};
error = null;
callback = null;
}
public static function get(_arg1:String, _arg2:Function):void{
var _local3:MochiUserData = new MochiUserData(_arg1, _arg2);
_local3.getEvent();
}
public static function put(_arg1:String, _arg2, _arg3:Function):void{
var _local4:MochiUserData = new MochiUserData(_arg1, _arg3);
_local4.putEvent(_arg2);
}
}
}//package mochi.as3
Section 218
//AlienBigBossBody_247 (TedViral_fla.AlienBigBossBody_247)
package TedViral_fla {
import flash.display.*;
public dynamic class AlienBigBossBody_247 extends MovieClip {
public var pointShoot:MovieClip;
public function AlienBigBossBody_247(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TedViral_fla
Section 219
//AlienBombDetanatorAnim_361 (TedViral_fla.AlienBombDetanatorAnim_361)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class AlienBombDetanatorAnim_361 extends MovieClip {
public function AlienBombDetanatorAnim_361(){
addFrameScript(0, frame1, 4, frame5, 9, frame10, 14, frame15, 19, frame20, 24, frame25, 29, frame30, 34, frame35, 39, frame40, 42, frame43, 45, frame46, 48, frame49, 51, frame52, 54, frame55, 57, frame58, 59, frame60);
}
function frame1(){
stop();
}
function frame60(){
stop();
}
function frame5(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame40(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame30(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame20(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame43(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame55(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame46(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame25(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame15(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame49(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame10(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame35(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame58(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame52(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
}
}//package TedViral_fla
Section 220
//AlienHunterBlasterAnim_372 (TedViral_fla.AlienHunterBlasterAnim_372)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class AlienHunterBlasterAnim_372 extends MovieClip {
public var pointShoot:MovieClip;
public function AlienHunterBlasterAnim_372(){
addFrameScript(0, frame1, 1, frame2, 9, frame10);
}
function frame1(){
stop();
}
function frame2(){
if (sounds){
sounds.PlaySnd(("alienBlasterShoot" + ageMath.RandomInt(1, 2).toString()), 1.5, this, stage);
};
}
function frame10(){
gotoAndStop(1);
}
}
}//package TedViral_fla
Section 221
//AlienPredatorLeg_554 (TedViral_fla.AlienPredatorLeg_554)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class AlienPredatorLeg_554 extends MovieClip {
public function AlienPredatorLeg_554(){
addFrameScript(68, frame69);
}
function frame69(){
if (((sounds) && (MovieClip(parent).visible))){
sounds.PlaySnd("robotStep1");
};
}
}
}//package TedViral_fla
Section 222
//AlienPredatorLeg2_553 (TedViral_fla.AlienPredatorLeg2_553)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class AlienPredatorLeg2_553 extends MovieClip {
public function AlienPredatorLeg2_553(){
addFrameScript(68, frame69);
}
function frame69(){
if (((sounds) && (MovieClip(parent).visible))){
sounds.PlaySnd("robotStep2");
};
}
}
}//package TedViral_fla
Section 223
//alienSawAnim_368 (TedViral_fla.alienSawAnim_368)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class alienSawAnim_368 extends MovieClip {
public function alienSawAnim_368(){
addFrameScript(0, frame1, 2, frame3, 4, frame5, 6, frame7, 7, frame8);
}
function frame1(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
}
function frame3(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
}
function frame5(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
}
function frame7(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
}
function frame8(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
}
}
}//package TedViral_fla
Section 224
//alienSeederBody_471 (TedViral_fla.alienSeederBody_471)
package TedViral_fla {
import flash.display.*;
public dynamic class alienSeederBody_471 extends MovieClip {
public var hatch:MovieClip;
public function alienSeederBody_471(){
addFrameScript(0, frame1, 99, frame100, 149, frame150);
}
function frame100(){
stop();
}
function frame1(){
stop();
}
function frame150(){
stop();
}
}
}//package TedViral_fla
Section 225
//AlienSolderArmBlaster_460 (TedViral_fla.AlienSolderArmBlaster_460)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class AlienSolderArmBlaster_460 extends MovieClip {
public var pointHand:MovieClip;
public function AlienSolderArmBlaster_460(){
addFrameScript(0, frame1, 1, frame2, 9, frame10);
}
function frame1(){
stop();
}
function frame2(){
sounds.PlaySnd(("alienBlasterShoot" + ageMath.RandomInt(1, 2).toString()), 1, this, stage);
}
function frame10(){
gotoAndStop(1);
}
}
}//package TedViral_fla
Section 226
//AlienSolderArms_459 (TedViral_fla.AlienSolderArms_459)
package TedViral_fla {
import flash.display.*;
public dynamic class AlienSolderArms_459 extends MovieClip {
public var anim:MovieClip;
public var pointShells:MovieClip;
public var pointShoot:MovieClip;
public function AlienSolderArms_459(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TedViral_fla
Section 227
//AlienSolderDie_466 (TedViral_fla.AlienSolderDie_466)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class AlienSolderDie_466 extends MovieClip {
public var head:MovieClip;
public var arm1:MovieClip;
public var arm2:MovieClip;
public function AlienSolderDie_466(){
addFrameScript(26, frame27, 46, frame47, 50, frame51);
}
function frame27(){
sounds.PlaySnd("bodyFall3", 1, this, stage);
}
function frame51(){
stop();
}
function frame47(){
sounds.PlaySnd("bodyFall2", 1, this, stage);
}
}
}//package TedViral_fla
Section 228
//animMarker_211 (TedViral_fla.animMarker_211)
package TedViral_fla {
import flash.display.*;
public dynamic class animMarker_211 extends MovieClip {
public function animMarker_211(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package TedViral_fla
Section 229
//BlastFX_29 (TedViral_fla.BlastFX_29)
package TedViral_fla {
import flash.display.*;
public dynamic class BlastFX_29 extends MovieClip {
public function BlastFX_29(){
addFrameScript(16, frame17);
}
function frame17(){
stop();
}
}
}//package TedViral_fla
Section 230
//bunkerMan_632 (TedViral_fla.bunkerMan_632)
package TedViral_fla {
import flash.display.*;
public dynamic class bunkerMan_632 extends MovieClip {
public function bunkerMan_632(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TedViral_fla
Section 231
//cacheSound_83 (TedViral_fla.cacheSound_83)
package TedViral_fla {
import flash.display.*;
public dynamic class cacheSound_83 extends MovieClip {
public var s3:MovieClip;
public var s4:MovieClip;
public var s1:MovieClip;
public var s2:MovieClip;
public function cacheSound_83(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package TedViral_fla
Section 232
//cacheSoundsImpact_85 (TedViral_fla.cacheSoundsImpact_85)
package TedViral_fla {
import flash.display.*;
public dynamic class cacheSoundsImpact_85 extends MovieClip {
public function cacheSoundsImpact_85(){
addFrameScript(0, frame1, 7, frame8);
}
function frame8(){
stop();
}
function frame1(){
stop();
}
}
}//package TedViral_fla
Section 233
//cacheSoundsMusic_86 (TedViral_fla.cacheSoundsMusic_86)
package TedViral_fla {
import flash.display.*;
public dynamic class cacheSoundsMusic_86 extends MovieClip {
public function cacheSoundsMusic_86(){
addFrameScript(0, frame1, 4, frame5);
}
function frame5(){
stop();
}
function frame1(){
stop();
}
}
}//package TedViral_fla
Section 234
//cacheSoundsOther_87 (TedViral_fla.cacheSoundsOther_87)
package TedViral_fla {
import flash.display.*;
public dynamic class cacheSoundsOther_87 extends MovieClip {
public function cacheSoundsOther_87(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
}
}//package TedViral_fla
Section 235
//cacheSoundsWeapons_84 (TedViral_fla.cacheSoundsWeapons_84)
package TedViral_fla {
import flash.display.*;
public dynamic class cacheSoundsWeapons_84 extends MovieClip {
public function cacheSoundsWeapons_84(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TedViral_fla
Section 236
//codeLock_635 (TedViral_fla.codeLock_635)
package TedViral_fla {
import flash.display.*;
public dynamic class codeLock_635 extends MovieClip {
public function codeLock_635(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TedViral_fla
Section 237
//credAneg_160 (TedViral_fla.credAneg_160)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public dynamic class credAneg_160 extends MovieClip {
public function credAneg_160(){
addFrameScript(0, frame1);
}
public function clickHandler(_arg1:Event):void{
navigateToURL(new URLRequest("http://www.anegmetex.com"), "_blank");
}
function frame1(){
addEventListener(MouseEvent.CLICK, clickHandler);
this.buttonMode = true;
}
}
}//package TedViral_fla
Section 238
//dialogPics_194 (TedViral_fla.dialogPics_194)
package TedViral_fla {
import flash.display.*;
public dynamic class dialogPics_194 extends MovieClip {
public function dialogPics_194(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TedViral_fla
Section 239
//dynamiteAnim_322 (TedViral_fla.dynamiteAnim_322)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class dynamiteAnim_322 extends MovieClip {
public function dynamiteAnim_322(){
addFrameScript(0, frame1, 4, frame5, 9, frame10, 14, frame15, 19, frame20, 24, frame25, 29, frame30, 34, frame35, 39, frame40, 44, frame45, 49, frame50, 54, frame55, 59, frame60, 63, frame64);
}
function frame1(){
stop();
}
function frame60(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame50(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame40(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame30(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame20(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame10(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame55(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame45(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame5(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame25(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame15(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
function frame64(){
stop();
}
function frame35(){
sounds.PlaySnd("bomb2", 1, this, stage);
}
}
}//package TedViral_fla
Section 240
//EarthRow01Big_421 (TedViral_fla.EarthRow01Big_421)
package TedViral_fla {
import flash.display.*;
public dynamic class EarthRow01Big_421 extends MovieClip {
public function EarthRow01Big_421(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package TedViral_fla
Section 241
//EarthRow01BigRightMasked_442 (TedViral_fla.EarthRow01BigRightMasked_442)
package TedViral_fla {
import flash.display.*;
public dynamic class EarthRow01BigRightMasked_442 extends MovieClip {
public var maskMC:MovieClip;
public var bgMC:MovieClip;
public function EarthRow01BigRightMasked_442(){
addFrameScript(0, frame1);
}
function frame1(){
bgMC.cacheAsBitmap = true;
maskMC.cacheAsBitmap = true;
bgMC.mask = maskMC;
}
}
}//package TedViral_fla
Section 242
//EarthRow01BigTopMasked_420 (TedViral_fla.EarthRow01BigTopMasked_420)
package TedViral_fla {
import flash.display.*;
public dynamic class EarthRow01BigTopMasked_420 extends MovieClip {
public var maskMC:MovieClip;
public var bgMC:MovieClip;
public function EarthRow01BigTopMasked_420(){
addFrameScript(0, frame1);
}
function frame1(){
bgMC.cacheAsBitmap = true;
maskMC.cacheAsBitmap = true;
bgMC.mask = maskMC;
}
}
}//package TedViral_fla
Section 243
//fuelBarrel_510 (TedViral_fla.fuelBarrel_510)
package TedViral_fla {
import flash.display.*;
public dynamic class fuelBarrel_510 extends MovieClip {
public function fuelBarrel_510(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TedViral_fla
Section 244
//FXLayerTitle_403 (TedViral_fla.FXLayerTitle_403)
package TedViral_fla {
import flash.display.*;
public dynamic class FXLayerTitle_403 extends MovieClip {
public function FXLayerTitle_403(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package TedViral_fla
Section 245
//gamButtSound_245 (TedViral_fla.gamButtSound_245)
package TedViral_fla {
import flash.display.*;
public dynamic class gamButtSound_245 extends MovieClip {
public function gamButtSound_245(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TedViral_fla
Section 246
//hazardBio_177 (TedViral_fla.hazardBio_177)
package TedViral_fla {
import flash.display.*;
public dynamic class hazardBio_177 extends MovieClip {
public function hazardBio_177(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
visible = false;
}
}
}//package TedViral_fla
Section 247
//hazardElectro_175 (TedViral_fla.hazardElectro_175)
package TedViral_fla {
import flash.display.*;
public dynamic class hazardElectro_175 extends MovieClip {
public function hazardElectro_175(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
visible = false;
}
}
}//package TedViral_fla
Section 248
//hazardPsy_179 (TedViral_fla.hazardPsy_179)
package TedViral_fla {
import flash.display.*;
public dynamic class hazardPsy_179 extends MovieClip {
public function hazardPsy_179(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
visible = false;
}
}
}//package TedViral_fla
Section 249
//items_184 (TedViral_fla.items_184)
package TedViral_fla {
import flash.display.*;
import flash.text.*;
public dynamic class items_184 extends MovieClip {
public var txtMoney:TextField;
public function items_184(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TedViral_fla
Section 250
//Level1_Chunk1_653 (TedViral_fla.Level1_Chunk1_653)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level1_Chunk1_653 extends MovieClip {
public function Level1_Chunk1_653(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 251
//Level1_Chunk2_648 (TedViral_fla.Level1_Chunk2_648)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level1_Chunk2_648 extends MovieClip {
public function Level1_Chunk2_648(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 252
//Level1_Chunk3_660 (TedViral_fla.Level1_Chunk3_660)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level1_Chunk3_660 extends MovieClip {
public function Level1_Chunk3_660(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 253
//Level2_Chunk1_278 (TedViral_fla.Level2_Chunk1_278)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level2_Chunk1_278 extends MovieClip {
public function Level2_Chunk1_278(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 254
//Level2_Chunk2_297 (TedViral_fla.Level2_Chunk2_297)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level2_Chunk2_297 extends MovieClip {
public function Level2_Chunk2_297(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 255
//Level2_Chunk3_262 (TedViral_fla.Level2_Chunk3_262)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level2_Chunk3_262 extends MovieClip {
public function Level2_Chunk3_262(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 256
//Level2_Chunk4_289 (TedViral_fla.Level2_Chunk4_289)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level2_Chunk4_289 extends MovieClip {
public function Level2_Chunk4_289(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 257
//Level3_Chunk1_435 (TedViral_fla.Level3_Chunk1_435)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level3_Chunk1_435 extends MovieClip {
public function Level3_Chunk1_435(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 258
//Level3_Chunk2_411 (TedViral_fla.Level3_Chunk2_411)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level3_Chunk2_411 extends MovieClip {
public function Level3_Chunk2_411(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 259
//Level3_Chunk3_454 (TedViral_fla.Level3_Chunk3_454)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level3_Chunk3_454 extends MovieClip {
public function Level3_Chunk3_454(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 260
//Level3_Chunk4_449 (TedViral_fla.Level3_Chunk4_449)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level3_Chunk4_449 extends MovieClip {
public function Level3_Chunk4_449(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 261
//Level3_Chunk5_443 (TedViral_fla.Level3_Chunk5_443)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level3_Chunk5_443 extends MovieClip {
public function Level3_Chunk5_443(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 262
//Level4_Chunk1_592 (TedViral_fla.Level4_Chunk1_592)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level4_Chunk1_592 extends MovieClip {
public function Level4_Chunk1_592(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 263
//Level4_Chunk2_598 (TedViral_fla.Level4_Chunk2_598)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level4_Chunk2_598 extends MovieClip {
public function Level4_Chunk2_598(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 264
//Level4_Chunk3_595 (TedViral_fla.Level4_Chunk3_595)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level4_Chunk3_595 extends MovieClip {
public function Level4_Chunk3_595(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 265
//Level4_Chunk4_590 (TedViral_fla.Level4_Chunk4_590)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level4_Chunk4_590 extends MovieClip {
public function Level4_Chunk4_590(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 266
//Level4_Chunk5_586 (TedViral_fla.Level4_Chunk5_586)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level4_Chunk5_586 extends MovieClip {
public function Level4_Chunk5_586(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 267
//Level4_ChunkG1_614 (TedViral_fla.Level4_ChunkG1_614)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level4_ChunkG1_614 extends MovieClip {
public function Level4_ChunkG1_614(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 268
//Level4_ChunkG2_616 (TedViral_fla.Level4_ChunkG2_616)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level4_ChunkG2_616 extends MovieClip {
public function Level4_ChunkG2_616(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 269
//Level4_ChunkG3_617 (TedViral_fla.Level4_ChunkG3_617)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level4_ChunkG3_617 extends MovieClip {
public function Level4_ChunkG3_617(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 270
//Level4_ChunkL1_604 (TedViral_fla.Level4_ChunkL1_604)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level4_ChunkL1_604 extends MovieClip {
public function Level4_ChunkL1_604(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 271
//Level4_ChunkL2_609 (TedViral_fla.Level4_ChunkL2_609)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level4_ChunkL2_609 extends MovieClip {
public function Level4_ChunkL2_609(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 272
//Level4_ChunkL3_610 (TedViral_fla.Level4_ChunkL3_610)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level4_ChunkL3_610 extends MovieClip {
public function Level4_ChunkL3_610(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 273
//Level4_ChunkL4_611 (TedViral_fla.Level4_ChunkL4_611)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level4_ChunkL4_611 extends MovieClip {
public function Level4_ChunkL4_611(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 274
//Level4_ChunkL5_612 (TedViral_fla.Level4_ChunkL5_612)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level4_ChunkL5_612 extends MovieClip {
public function Level4_ChunkL5_612(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 275
//Level4_ChunkL6_613 (TedViral_fla.Level4_ChunkL6_613)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level4_ChunkL6_613 extends MovieClip {
public function Level4_ChunkL6_613(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 276
//Level5_Chunk1_622 (TedViral_fla.Level5_Chunk1_622)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level5_Chunk1_622 extends MovieClip {
public function Level5_Chunk1_622(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 277
//Level5_Chunk2_624 (TedViral_fla.Level5_Chunk2_624)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level5_Chunk2_624 extends MovieClip {
public function Level5_Chunk2_624(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 278
//Level5_Chunk3_627 (TedViral_fla.Level5_Chunk3_627)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level5_Chunk3_627 extends MovieClip {
public function Level5_Chunk3_627(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 279
//Level5_Chunk4_625 (TedViral_fla.Level5_Chunk4_625)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level5_Chunk4_625 extends MovieClip {
public function Level5_Chunk4_625(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 280
//Level5_Chunk5_621 (TedViral_fla.Level5_Chunk5_621)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level5_Chunk5_621 extends MovieClip {
public function Level5_Chunk5_621(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 281
//Level5_Chunk6_619 (TedViral_fla.Level5_Chunk6_619)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level5_Chunk6_619 extends MovieClip {
public function Level5_Chunk6_619(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 282
//Level5_LChunk1_638 (TedViral_fla.Level5_LChunk1_638)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level5_LChunk1_638 extends MovieClip {
public function Level5_LChunk1_638(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 283
//Level5_LChunk2_639 (TedViral_fla.Level5_LChunk2_639)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level5_LChunk2_639 extends MovieClip {
public function Level5_LChunk2_639(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 284
//Level5_LChunk3_640 (TedViral_fla.Level5_LChunk3_640)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level5_LChunk3_640 extends MovieClip {
public function Level5_LChunk3_640(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 285
//Level5_LChunk4_641 (TedViral_fla.Level5_LChunk4_641)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level5_LChunk4_641 extends MovieClip {
public function Level5_LChunk4_641(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 286
//Level6_Chunk1_507 (TedViral_fla.Level6_Chunk1_507)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level6_Chunk1_507 extends MovieClip {
public function Level6_Chunk1_507(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 287
//Level6_Chunk2_503 (TedViral_fla.Level6_Chunk2_503)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level6_Chunk2_503 extends MovieClip {
public function Level6_Chunk2_503(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 288
//Level6_Chunk3_500 (TedViral_fla.Level6_Chunk3_500)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level6_Chunk3_500 extends MovieClip {
public function Level6_Chunk3_500(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 289
//Level6_Chunk4_493 (TedViral_fla.Level6_Chunk4_493)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Level6_Chunk4_493 extends MovieClip {
public function Level6_Chunk4_493(){
addFrameScript(0, frame1);
}
function frame1(){
Level(parent).chunkObjects.push(this);
}
}
}//package TedViral_fla
Section 290
//leverWall_569 (TedViral_fla.leverWall_569)
package TedViral_fla {
import flash.display.*;
public dynamic class leverWall_569 extends MovieClip {
public function leverWall_569(){
addFrameScript(0, frame1, 19, frame20);
}
function frame20(){
stop();
}
function frame1(){
stop();
}
}
}//package TedViral_fla
Section 291
//lifeBarGui_174 (TedViral_fla.lifeBarGui_174)
package TedViral_fla {
import flash.display.*;
public dynamic class lifeBarGui_174 extends MovieClip {
public function lifeBarGui_174(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TedViral_fla
Section 292
//limiterSlim_406 (TedViral_fla.limiterSlim_406)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class limiterSlim_406 extends MovieClip {
public function limiterSlim_406(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
this.wideGround = false;
this.slimMode = true;
Level(parent).addLimiter(this);
}
}
}//package TedViral_fla
Section 293
//limiterWide_405 (TedViral_fla.limiterWide_405)
package TedViral_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import main.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class limiterWide_405 extends MovieClip {
public function limiterWide_405(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
this.wideGround = true;
this.slimMode = false;
Level(parent).addLimiter(this);
}
}
}//package TedViral_fla
Section 294
//LittleSmokeFX1_31 (TedViral_fla.LittleSmokeFX1_31)
package TedViral_fla {
import flash.display.*;
public dynamic class LittleSmokeFX1_31 extends MovieClip {
public function LittleSmokeFX1_31(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package TedViral_fla
Section 295
//LittleSmokeFX2_33 (TedViral_fla.LittleSmokeFX2_33)
package TedViral_fla {
import flash.display.*;
public dynamic class LittleSmokeFX2_33 extends MovieClip {
public function LittleSmokeFX2_33(){
addFrameScript(49, frame50);
}
function frame50(){
stop();
}
}
}//package TedViral_fla
Section 296
//LittleSmokeFX3_34 (TedViral_fla.LittleSmokeFX3_34)
package TedViral_fla {
import flash.display.*;
public dynamic class LittleSmokeFX3_34 extends MovieClip {
public function LittleSmokeFX3_34(){
addFrameScript(54, frame55);
}
function frame55(){
stop();
}
}
}//package TedViral_fla
Section 297
//menuEpPic_157 (TedViral_fla.menuEpPic_157)
package TedViral_fla {
import flash.display.*;
import flash.text.*;
public dynamic class menuEpPic_157 extends MovieClip {
public var epNum:TextField;
public function menuEpPic_157(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TedViral_fla
Section 298
//metalSparksFX_23 (TedViral_fla.metalSparksFX_23)
package TedViral_fla {
import flash.display.*;
public dynamic class metalSparksFX_23 extends MovieClip {
public function metalSparksFX_23(){
addFrameScript(12, frame13);
}
function frame13(){
stop();
}
}
}//package TedViral_fla
Section 299
//og_logo_122 (TedViral_fla.og_logo_122)
package TedViral_fla {
import flash.display.*;
public dynamic class og_logo_122 extends MovieClip {
public function og_logo_122(){
addFrameScript(84, frame85);
}
function frame85(){
stop();
}
}
}//package TedViral_fla
Section 300
//og_logo_text_123 (TedViral_fla.og_logo_text_123)
package TedViral_fla {
import flash.display.*;
public dynamic class og_logo_text_123 extends MovieClip {
public function og_logo_text_123(){
addFrameScript(42, frame43);
}
function frame43(){
stop();
}
}
}//package TedViral_fla
Section 301
//oldMan_318 (TedViral_fla.oldMan_318)
package TedViral_fla {
import flash.display.*;
public dynamic class oldMan_318 extends MovieClip {
public function oldMan_318(){
addFrameScript(9, frame10, 19, frame20);
}
function frame20(){
stop();
}
function frame10(){
stop();
}
}
}//package TedViral_fla
Section 302
//onlinegamercc_logo_121 (TedViral_fla.onlinegamercc_logo_121)
package TedViral_fla {
import flash.display.*;
public dynamic class onlinegamercc_logo_121 extends MovieClip {
public function onlinegamercc_logo_121(){
addFrameScript(237, frame238);
}
function frame238(){
stop();
}
}
}//package TedViral_fla
Section 303
//physMarker_42 (TedViral_fla.physMarker_42)
package TedViral_fla {
import flash.display.*;
public dynamic class physMarker_42 extends MovieClip {
public function physMarker_42(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package TedViral_fla
Section 304
//projLayerTitle_325 (TedViral_fla.projLayerTitle_325)
package TedViral_fla {
import flash.display.*;
public dynamic class projLayerTitle_325 extends MovieClip {
public function projLayerTitle_325(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package TedViral_fla
Section 305
//propLayerTitle_401 (TedViral_fla.propLayerTitle_401)
package TedViral_fla {
import flash.display.*;
public dynamic class propLayerTitle_401 extends MovieClip {
public function propLayerTitle_401(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package TedViral_fla
Section 306
//sewerHatch_583 (TedViral_fla.sewerHatch_583)
package TedViral_fla {
import flash.display.*;
public dynamic class sewerHatch_583 extends MovieClip {
public var anmPoint:MovieClip;
public function sewerHatch_583(){
addFrameScript(0, frame1, 59, frame60);
}
function frame1(){
stop();
}
function frame60(){
stop();
}
}
}//package TedViral_fla
Section 307
//sewerHatch2_596 (TedViral_fla.sewerHatch2_596)
package TedViral_fla {
import flash.display.*;
public dynamic class sewerHatch2_596 extends MovieClip {
public var anmPoint:MovieClip;
public function sewerHatch2_596(){
addFrameScript(0, frame1, 59, frame60);
}
function frame1(){
stop();
}
function frame60(){
stop();
}
}
}//package TedViral_fla
Section 308
//shotgunMan_658 (TedViral_fla.shotgunMan_658)
package TedViral_fla {
import flash.display.*;
public dynamic class shotgunMan_658 extends MovieClip {
public function shotgunMan_658(){
addFrameScript(0, frame1, 23, frame24);
}
function frame1(){
stop();
}
function frame24(){
stop();
}
}
}//package TedViral_fla
Section 309
//single_spark_24 (TedViral_fla.single_spark_24)
package TedViral_fla {
import flash.display.*;
public dynamic class single_spark_24 extends MovieClip {
public function single_spark_24(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
MovieClip(parent).visible = false;
}
}
}//package TedViral_fla
Section 310
//single_spark2_25 (TedViral_fla.single_spark2_25)
package TedViral_fla {
import flash.display.*;
public dynamic class single_spark2_25 extends MovieClip {
public function single_spark2_25(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package TedViral_fla
Section 311
//single_spark3_26 (TedViral_fla.single_spark3_26)
package TedViral_fla {
import flash.display.*;
public dynamic class single_spark3_26 extends MovieClip {
public function single_spark3_26(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package TedViral_fla
Section 312
//single_spark4_27 (TedViral_fla.single_spark4_27)
package TedViral_fla {
import flash.display.*;
public dynamic class single_spark4_27 extends MovieClip {
public function single_spark4_27(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package TedViral_fla
Section 313
//spiderAttack_578 (TedViral_fla.spiderAttack_578)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class spiderAttack_578 extends MovieClip {
public function spiderAttack_578(){
addFrameScript(5, frame6, 16, frame17);
}
function frame6(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
}
function frame17(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "firstAttackEnd"));
}
}
}//package TedViral_fla
Section 314
//spiderDie_577 (TedViral_fla.spiderDie_577)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class spiderDie_577 extends MovieClip {
public function spiderDie_577(){
addFrameScript(6, frame7, 30, frame31);
}
function frame7(){
sounds.PlaySnd(("bodyFall" + ageMath.RandomInt(1, 4).toString()), 1, this, stage);
}
function frame31(){
stop();
}
}
}//package TedViral_fla
Section 315
//TedArms_378 (TedViral_fla.TedArms_378)
package TedViral_fla {
import flash.display.*;
public dynamic class TedArms_378 extends MovieClip {
public var anim:MovieClip;
public var pointShells:MovieClip;
public var pointShoot:MovieClip;
public function TedArms_378(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TedViral_fla
Section 316
//TedArmsL_AK_381 (TedViral_fla.TedArmsL_AK_381)
package TedViral_fla {
import flash.display.*;
public dynamic class TedArmsL_AK_381 extends MovieClip {
public function TedArmsL_AK_381(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TedViral_fla
Section 317
//TedArmsL_Shotgun_383 (TedViral_fla.TedArmsL_Shotgun_383)
package TedViral_fla {
import flash.display.*;
public dynamic class TedArmsL_Shotgun_383 extends MovieClip {
public function TedArmsL_Shotgun_383(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TedViral_fla
Section 318
//TedArmsPistol_379 (TedViral_fla.TedArmsPistol_379)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class TedArmsPistol_379 extends MovieClip {
public function TedArmsPistol_379(){
addFrameScript(0, frame1, 1, frame2, 9, frame10);
}
function frame10(){
gotoAndStop(1);
}
function frame1(){
stop();
}
function frame2(){
if (sounds){
sounds.PlaySnd(("PistolShoot" + ageMath.RandomInt(1, 2).toString()));
};
}
}
}//package TedViral_fla
Section 319
//TedArmsR_AK_380 (TedViral_fla.TedArmsR_AK_380)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class TedArmsR_AK_380 extends MovieClip {
public var pointHand:MovieClip;
public function TedArmsR_AK_380(){
addFrameScript(0, frame1, 1, frame2, 4, frame5);
}
function frame1(){
stop();
}
function frame2(){
if (sounds){
sounds.PlaySnd(("AKShoot" + ageMath.RandomInt(1, 2).toString()));
};
}
function frame5(){
gotoAndStop(1);
}
}
}//package TedViral_fla
Section 320
//TedArmsR_Blaster_385 (TedViral_fla.TedArmsR_Blaster_385)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class TedArmsR_Blaster_385 extends MovieClip {
public var pointHand:MovieClip;
public function TedArmsR_Blaster_385(){
addFrameScript(0, frame1, 1, frame2, 4, frame5);
}
function frame1(){
stop();
}
function frame2(){
if (sounds){
sounds.PlaySnd(("BlasterShoot" + ageMath.RandomInt(1, 2).toString()));
};
}
function frame5(){
gotoAndStop(1);
}
}
}//package TedViral_fla
Section 321
//TedArmsR_DDD_388 (TedViral_fla.TedArmsR_DDD_388)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class TedArmsR_DDD_388 extends MovieClip {
public var pointHand:MovieClip;
public function TedArmsR_DDD_388(){
addFrameScript(0, frame1, 1, frame2, 4, frame5);
}
function frame1(){
stop();
}
function frame2(){
if (sounds){
sounds.PlaySnd(("ShotgunShoot" + ageMath.RandomInt(1, 2).toString()));
};
}
function frame5(){
gotoAndStop(1);
}
}
}//package TedViral_fla
Section 322
//TedArmsR_Lasergun_387 (TedViral_fla.TedArmsR_Lasergun_387)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class TedArmsR_Lasergun_387 extends MovieClip {
public var pointHand:MovieClip;
public function TedArmsR_Lasergun_387(){
addFrameScript(0, frame1, 1, frame2, 4, frame5);
}
function frame1(){
stop();
}
function frame2(){
if (sounds){
sounds.PlaySnd(("LasergunShoot" + ageMath.RandomInt(1, 2).toString()));
};
}
function frame5(){
gotoAndStop(1);
}
}
}//package TedViral_fla
Section 323
//TedArmsR_Minigun_384 (TedViral_fla.TedArmsR_Minigun_384)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class TedArmsR_Minigun_384 extends MovieClip {
public var pointHand:MovieClip;
public function TedArmsR_Minigun_384(){
addFrameScript(0, frame1, 1, frame2, 4, frame5);
}
function frame1(){
stop();
}
function frame2(){
if (sounds){
sounds.PlaySnd(("MinigunShoot" + ageMath.RandomInt(1, 2).toString()));
};
}
function frame5(){
gotoAndStop(1);
}
}
}//package TedViral_fla
Section 324
//TedArmsR_RPG_386 (TedViral_fla.TedArmsR_RPG_386)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class TedArmsR_RPG_386 extends MovieClip {
public var pointHand:MovieClip;
public function TedArmsR_RPG_386(){
addFrameScript(0, frame1, 1, frame2, 4, frame5);
}
function frame1(){
stop();
}
function frame2(){
if (sounds){
sounds.PlaySnd(("RPGShoot" + ageMath.RandomInt(1, 2).toString()));
};
}
function frame5(){
gotoAndStop(1);
}
}
}//package TedViral_fla
Section 325
//TedArmsR_Shotgun_382 (TedViral_fla.TedArmsR_Shotgun_382)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class TedArmsR_Shotgun_382 extends MovieClip {
public var pointHand:MovieClip;
public function TedArmsR_Shotgun_382(){
addFrameScript(0, frame1, 1, frame2, 4, frame5);
}
function frame1(){
stop();
}
function frame2(){
if (sounds){
sounds.PlaySnd(("ShotgunShoot" + ageMath.RandomInt(1, 2).toString()));
};
}
function frame5(){
gotoAndStop(1);
}
}
}//package TedViral_fla
Section 326
//TedDie_396 (TedViral_fla.TedDie_396)
package TedViral_fla {
import flash.display.*;
public dynamic class TedDie_396 extends MovieClip {
public var head:MovieClip;
public var arm1:MovieClip;
public var arm2:MovieClip;
public function TedDie_396(){
addFrameScript(34, frame35);
}
function frame35(){
stop();
}
}
}//package TedViral_fla
Section 327
//TedHead_391 (TedViral_fla.TedHead_391)
package TedViral_fla {
import flash.display.*;
public dynamic class TedHead_391 extends MovieClip {
public var gm:MovieClip;
public function TedHead_391(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TedViral_fla
Section 328
//upgCrateInfo_204 (TedViral_fla.upgCrateInfo_204)
package TedViral_fla {
import flash.display.*;
import flash.text.*;
public dynamic class upgCrateInfo_204 extends MovieClip {
public var txt:TextField;
public var pic:MovieClip;
public var upgStars:MovieClip;
public var soldout:MovieClip;
public function upgCrateInfo_204(){
addFrameScript(0, frame1);
}
function frame1(){
this.visible = false;
}
}
}//package TedViral_fla
Section 329
//upgCratePic_171 (TedViral_fla.upgCratePic_171)
package TedViral_fla {
import flash.display.*;
public dynamic class upgCratePic_171 extends MovieClip {
public function upgCratePic_171(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TedViral_fla
Section 330
//valveWall_594 (TedViral_fla.valveWall_594)
package TedViral_fla {
import flash.display.*;
public dynamic class valveWall_594 extends MovieClip {
public function valveWall_594(){
addFrameScript(0, frame1, 20, frame21);
}
function frame21(){
stop();
}
function frame1(){
stop();
}
}
}//package TedViral_fla
Section 331
//Zomb01Attack_359 (TedViral_fla.Zomb01Attack_359)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class Zomb01Attack_359 extends MovieClip {
public function Zomb01Attack_359(){
addFrameScript(6, frame7, 10, frame11, 14, frame15, 24, frame25, 52, frame53);
}
function frame25(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
}
function frame15(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
}
function frame7(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
}
function frame53(){
}
function frame11(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "firstAttackEnd"));
}
}
}//package TedViral_fla
Section 332
//Zomb01Die_357 (TedViral_fla.Zomb01Die_357)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class Zomb01Die_357 extends MovieClip {
public function Zomb01Die_357(){
addFrameScript(10, frame11, 22, frame23);
}
function frame11(){
sounds.PlaySnd(("bodyFall" + ageMath.RandomInt(1, 4).toString()), 1, this, stage);
}
function frame23(){
stop();
}
}
}//package TedViral_fla
Section 333
//Zomb02Attack_331 (TedViral_fla.Zomb02Attack_331)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class Zomb02Attack_331 extends MovieClip {
public function Zomb02Attack_331(){
addFrameScript(6, frame7, 16, frame17, 30, frame31);
}
function frame7(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "firstAttackEnd"));
}
function frame17(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
}
function frame31(){
}
}
}//package TedViral_fla
Section 334
//Zomb02Die_329 (TedViral_fla.Zomb02Die_329)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class Zomb02Die_329 extends MovieClip {
public function Zomb02Die_329(){
addFrameScript(20, frame21, 42, frame43, 48, frame49);
}
function frame49(){
stop();
}
function frame43(){
sounds.PlaySnd("bodyFall2", 1, this, stage);
}
function frame21(){
sounds.PlaySnd("bodyFall3", 1, this, stage);
}
}
}//package TedViral_fla
Section 335
//Zomb03Attack_337 (TedViral_fla.Zomb03Attack_337)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class Zomb03Attack_337 extends MovieClip {
public function Zomb03Attack_337(){
addFrameScript(14, frame15, 24, frame25, 36, frame37);
}
function frame25(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
}
function frame15(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "firstAttackEnd"));
}
function frame37(){
}
}
}//package TedViral_fla
Section 336
//Zomb03Die_335 (TedViral_fla.Zomb03Die_335)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class Zomb03Die_335 extends MovieClip {
public function Zomb03Die_335(){
addFrameScript(24, frame25, 34, frame35);
}
function frame25(){
sounds.PlaySnd(("bodyFall" + ageMath.RandomInt(1, 4).toString()), 1, this, stage);
}
function frame35(){
stop();
}
}
}//package TedViral_fla
Section 337
//Zomb04Attack_343 (TedViral_fla.Zomb04Attack_343)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class Zomb04Attack_343 extends MovieClip {
public function Zomb04Attack_343(){
addFrameScript(16, frame17, 20, frame21, 26, frame27, 28, frame29, 32, frame33, 44, frame45);
}
function frame27(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
}
function frame17(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "firstAttackEnd"));
}
function frame29(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
}
function frame21(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
}
function frame33(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
}
function frame45(){
}
}
}//package TedViral_fla
Section 338
//Zomb04Die_341 (TedViral_fla.Zomb04Die_341)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class Zomb04Die_341 extends MovieClip {
public function Zomb04Die_341(){
addFrameScript(22, frame23, 34, frame35);
}
function frame23(){
sounds.PlaySnd(("bodyFall" + ageMath.RandomInt(1, 4).toString()), 1, this, stage);
}
function frame35(){
stop();
}
}
}//package TedViral_fla
Section 339
//Zomb05Attack_352 (TedViral_fla.Zomb05Attack_352)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class Zomb05Attack_352 extends MovieClip {
public function Zomb05Attack_352(){
addFrameScript(8, frame9, 24, frame25, 34, frame35, 48, frame49, 68, frame69);
}
function frame25(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
}
function frame49(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
}
function frame69(){
}
function frame9(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "firstAttackEnd"));
}
function frame35(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
}
}
}//package TedViral_fla
Section 340
//Zomb05Die_350 (TedViral_fla.Zomb05Die_350)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class Zomb05Die_350 extends MovieClip {
public function Zomb05Die_350(){
addFrameScript(22, frame23, 42, frame43);
}
function frame43(){
stop();
}
function frame23(){
sounds.PlaySnd(("bodyFall" + ageMath.RandomInt(1, 4).toString()), 1, this, stage);
}
}
}//package TedViral_fla
Section 341
//ZombPsyAttack_545 (TedViral_fla.ZombPsyAttack_545)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class ZombPsyAttack_545 extends MovieClip {
public function ZombPsyAttack_545(){
addFrameScript(52, frame53);
}
function frame53(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "firstAttackEnd"));
}
}
}//package TedViral_fla
Section 342
//ZombPsyDie_544 (TedViral_fla.ZombPsyDie_544)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class ZombPsyDie_544 extends MovieClip {
public function ZombPsyDie_544(){
addFrameScript(22, frame23, 48, frame49, 52, frame53);
}
function frame49(){
sounds.PlaySnd(("bodyFall" + ageMath.RandomInt(1, 4).toString()), 1, this, stage);
}
function frame53(){
stop();
}
function frame23(){
sounds.PlaySnd(("bodyFall" + ageMath.RandomInt(1, 4).toString()), 1, this, stage);
}
}
}//package TedViral_fla
Section 343
//ZombTankAttack1_516 (TedViral_fla.ZombTankAttack1_516)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class ZombTankAttack1_516 extends MovieClip {
public function ZombTankAttack1_516(){
addFrameScript(13, frame14);
}
function frame14(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "firstAttackEnd"));
}
}
}//package TedViral_fla
Section 344
//ZombTankAttack2_517 (TedViral_fla.ZombTankAttack2_517)
package TedViral_fla {
import flash.display.*;
import main.*;
public dynamic class ZombTankAttack2_517 extends MovieClip {
public function ZombTankAttack2_517(){
addFrameScript(15, frame16);
}
function frame16(){
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "attackHit"));
actorObject(parent).dispatchEvent(new FSMEvent(FSMEvent.ONPOSTED, "firstAttackEnd"));
}
}
}//package TedViral_fla
Section 345
//ZombTankDie_515 (TedViral_fla.ZombTankDie_515)
package TedViral_fla {
import flash.display.*;
public dynamic class ZombTankDie_515 extends MovieClip {
public function ZombTankDie_515(){
addFrameScript(84, frame85);
}
function frame85(){
stop();
}
}
}//package TedViral_fla
Section 346
//adMY (adMY)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class adMY extends MovieClip {
public function adMY(){
addFrameScript(0, frame1);
}
public function clickHandler(_arg1:Event):void{
navigateToURL(new URLRequest("http://www.onlinegamer.cc?utm_source=Ted&utm_medium=myAds"), "_blank");
}
function frame1(){
addEventListener(MouseEvent.CLICK, clickHandler);
this.buttonMode = true;
}
}
}//package
Section 347
//alienPain1 (alienPain1)
package {
import flash.media.*;
public dynamic class alienPain1 extends Sound {
}
}//package
Section 348
//alienPain2 (alienPain2)
package {
import flash.media.*;
public dynamic class alienPain2 extends Sound {
}
}//package
Section 349
//alienPain3 (alienPain3)
package {
import flash.media.*;
public dynamic class alienPain3 extends Sound {
}
}//package
Section 350
//alienPain4 (alienPain4)
package {
import flash.media.*;
public dynamic class alienPain4 extends Sound {
}
}//package
Section 351
//alienVox1 (alienVox1)
package {
import flash.media.*;
public dynamic class alienVox1 extends Sound {
}
}//package
Section 352
//alienVox2 (alienVox2)
package {
import flash.media.*;
public dynamic class alienVox2 extends Sound {
}
}//package
Section 353
//alienVox3 (alienVox3)
package {
import flash.media.*;
public dynamic class alienVox3 extends Sound {
}
}//package
Section 354
//alienVox4 (alienVox4)
package {
import flash.media.*;
public dynamic class alienVox4 extends Sound {
}
}//package
Section 355
//alienVox5 (alienVox5)
package {
import flash.media.*;
public dynamic class alienVox5 extends Sound {
}
}//package
Section 356
//alienVox6 (alienVox6)
package {
import flash.media.*;
public dynamic class alienVox6 extends Sound {
}
}//package
Section 357
//alienVox7 (alienVox7)
package {
import flash.media.*;
public dynamic class alienVox7 extends Sound {
}
}//package
Section 358
//buttonPlay (buttonPlay)
package {
import flash.display.*;
public dynamic class buttonPlay extends SimpleButton {
}
}//package
Section 359
//buy (buy)
package {
import flash.media.*;
public dynamic class buy extends Sound {
}
}//package
Section 360
//cashReg (cashReg)
package {
import flash.media.*;
public dynamic class cashReg extends Sound {
}
}//package
Section 361
//Cursor (Cursor)
package {
import flash.display.*;
public dynamic class Cursor extends MovieClip {
public var shootAcc:MovieClip;
public var pic:MovieClip;
public function Cursor(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 362
//EarthRow01 (EarthRow01)
package {
import flash.display.*;
public dynamic class EarthRow01 extends BitmapData {
public function EarthRow01(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 363
//lostMenu (lostMenu)
package {
import main.*;
public dynamic class lostMenu extends alphaFader {
}
}//package
Section 364
//menuLogoAneg (menuLogoAneg)
package {
import main.*;
public dynamic class menuLogoAneg extends alphaFader {
}
}//package
Section 365
//menuLogoOG (menuLogoOG)
package {
import main.*;
public dynamic class menuLogoOG extends alphaFader {
}
}//package
Section 366
//PainFrame (PainFrame)
package {
import main.*;
public dynamic class PainFrame extends alphaFader {
public function PainFrame(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package
Section 367
//paper1 (paper1)
package {
import flash.media.*;
public dynamic class paper1 extends Sound {
}
}//package
Section 368
//TedDie1 (TedDie1)
package {
import flash.media.*;
public dynamic class TedDie1 extends Sound {
}
}//package
Section 369
//TedDie2 (TedDie2)
package {
import flash.media.*;
public dynamic class TedDie2 extends Sound {
}
}//package
Section 370
//TedPain1 (TedPain1)
package {
import flash.media.*;
public dynamic class TedPain1 extends Sound {
}
}//package
Section 371
//TedPain2 (TedPain2)
package {
import flash.media.*;
public dynamic class TedPain2 extends Sound {
}
}//package
Section 372
//TedPain3 (TedPain3)
package {
import flash.media.*;
public dynamic class TedPain3 extends Sound {
}
}//package
Section 373
//upgButtCancel (upgButtCancel)
package {
import main.*;
public dynamic class upgButtCancel extends MCButton {
}
}//package
Section 374
//ZombieVoice1 (ZombieVoice1)
package {
import flash.media.*;
public dynamic class ZombieVoice1 extends Sound {
}
}//package
Section 375
//ZombieVoice2 (ZombieVoice2)
package {
import flash.media.*;
public dynamic class ZombieVoice2 extends Sound {
}
}//package
Section 376
//ZombieVoice3 (ZombieVoice3)
package {
import flash.media.*;
public dynamic class ZombieVoice3 extends Sound {
}
}//package
Section 377
//ZombieVoice4 (ZombieVoice4)
package {
import flash.media.*;
public dynamic class ZombieVoice4 extends Sound {
}
}//package