home *** CD-ROM | disk | FTP | other *** search
Text File | 2008-09-02 | 143.0 KB | 4,264 lines |
- class BubbleTanksGame
- {
- var kongEnemiesKilledThisGame;
- var kongBigEnemiesKilledThisGame;
- var kongDestroyerKilledThisGame;
- var kongTriGuardianKilledThisGame;
- var kongSpawnCarrierKilledThisGame;
- var kongBFTKilledThisGame;
- var kongBlnRefresh;
- var mySharedObject;
- var upgradePath;
- var blnWorldCreated;
- var worldCreateRow;
- var worldCreateColumn;
- var prevOutside;
- var secondBulletCounter;
- var numJumps;
- var intTutorialState;
- var avatarLife;
- var maxAvatarLife;
- var intStoreDepth_openMask;
- var intStoreDepth_overlay;
- var intStoreDepth_avatar;
- var intStoreDepth_bg;
- var intStoreDepth_bubbleSplit;
- var intStoreDepth_effects_mc;
- var intStoreDepth_miniBubblesLayer_mc;
- var intStoreDepth_bubbleMask;
- var intStoreDepth_effectMask_mc;
- var intStoreDepth_pause_mc;
- var intStoreDepth_life;
- var intStoreDepth_fireRate_mc;
- var intStoreDepth_flash_mc;
- var runOnce;
- var transitionState;
- var mouseListener;
- var intPrimaryCounter;
- var intSecondaryCounter;
- var intAutoCounter;
- var blnPrimaryActive;
- var vecMomentum;
- var numAvatarMaxVelocity;
- var numSensitivity;
- var numResistence;
- var stickyCounter;
- var arrBullets;
- var arrBulletBusters;
- var arrFloatingBubbles;
- var arrDebris;
- var arrCleanup;
- var arrEffects;
- var arrUnderEffects;
- var arrMap;
- var arrAllySeekers;
- var arrAllies;
- var deltaList;
- var numBulletDepth;
- var numMineDepth;
- var numAllyDepth;
- var spawnedEnemyDepth;
- var arrFloatingBubblesDepth;
- var effectDepth;
- var underEffectDepth;
- var blnEnemiesCleared;
- var blnFlushList;
- var intWinFlag;
- var intLifeState;
- var intMaxHigh;
- var intMaxLow;
- var blnLifeFlag;
- var intLifeCounter;
- var intFireRateState;
- var intFireRateMaxHigh;
- var intFireRateMaxLow;
- var blnFireRateFlag;
- var intFireRateCounter;
- var intKeyLock;
- var intAssembledState;
- var intAssembledFrame;
- var blnSpaceDown;
- var world;
- var blnUpgradeFlag;
- var backgroundDepth;
- var arrBackgrounds;
- var numEnemiesCreated;
- var strCurrentScreen;
- var blnWaitingToUpgrade;
- var arrUpgradePath;
- var mapLocX;
- var mapLocY;
- var intJumpsAsMax;
- var blnBoss;
- var intBossState;
- var intBossX;
- var intBossY;
- var intShieldCounter;
- var intShieldWidth;
- var intBubblesCollected;
- var intEnemiesKilled;
- var intShakeDuration;
- var intShakeCounter;
- var intShakeStart;
- var vecScreenCoords;
- var _enemySet;
- var arenaTimer;
- var _enemySet2;
- var intUpgradeDelay;
- var gotoAndStop;
- var intTotalFrames;
- var easeFrames;
- var dblDestX;
- var dblDestY;
- var deltaX;
- var deltaY;
- function BubbleTanksGame()
- {
- this.kongEnemiesKilledThisGame = new DataObject();
- this.kongEnemiesKilledThisGame.Set(0);
- this.kongBigEnemiesKilledThisGame = new DataObject();
- this.kongBigEnemiesKilledThisGame.Set(0);
- this.kongDestroyerKilledThisGame = new DataObject();
- this.kongDestroyerKilledThisGame.Set(0);
- this.kongTriGuardianKilledThisGame = new DataObject();
- this.kongTriGuardianKilledThisGame.Set(0);
- this.kongSpawnCarrierKilledThisGame = new DataObject();
- this.kongSpawnCarrierKilledThisGame.Set(0);
- this.kongBFTKilledThisGame = new DataObject();
- this.kongBlnRefresh = false;
- this.mySharedObject = SharedObject.getLocal("settings");
- this.upgradePath = new UpgradeTree();
- this.blnWorldCreated = false;
- this.worldCreateRow = 0;
- this.worldCreateColumn = 0;
- this.prevOutside = false;
- this.secondBulletCounter = 0;
- this.numJumps = 0;
- this.intTutorialState = 1;
- this.avatarLife = new DataObject();
- this.avatarLife.Set(1);
- this.maxAvatarLife = 1;
- this.intStoreDepth_openMask = _root.openMask.getDepth();
- this.intStoreDepth_overlay = _root.overlay.getDepth();
- this.intStoreDepth_avatar = _root.avatar.getDepth();
- this.intStoreDepth_bg = _root.bg.getDepth();
- this.intStoreDepth_bubbleSplit = _root.bubbleSplit.getDepth();
- this.intStoreDepth_effects_mc = _root.effects_mc.getDepth();
- this.intStoreDepth_miniBubblesLayer_mc = _root.miniBubblesLayer_mc.getDepth();
- this.intStoreDepth_bubbleMask = _root.bubbleMask.getDepth();
- this.intStoreDepth_effectMask_mc = _root.effectMask_mc.getDepth();
- this.intStoreDepth_pause_mc = _root.pause_mc.getDepth();
- this.intStoreDepth_life = _root.life.getDepth();
- this.intStoreDepth_fireRate_mc = _root.fireRate_mc.getDepth();
- this.intStoreDepth_flash_mc = _root.flash_mc.getDepth();
- _root.openMask.stop();
- _root.openMask.swapDepths(1000001);
- _root.overlay.swapDepths(1000000);
- _root.avatar.swapDepths(510);
- _root.bg.swapDepths(500);
- _root.bubbleSplit.swapDepths(505);
- _root.effects_mc.swapDepths(507);
- _root.miniBubblesLayer_mc.swapDepths(508);
- _root.bubbleMask.swapDepths(509);
- _root.effectMask_mc.swapDepths(511);
- _root.effects_mc.setMask("effectMask_mc");
- _root.miniBubblesLayer_mc.setMask("bubbleMask");
- this.runOnce = false;
- this.transitionState = 0;
- var thisRef = this;
- this.mouseListener = new Object();
- this.mouseListener.onMouseDown = function()
- {
- thisRef.MouseDown();
- };
- this.mouseListener.onMouseUp = function()
- {
- thisRef.MouseUp();
- };
- Mouse.addListener(this.mouseListener);
- this.intPrimaryCounter = 0;
- this.intSecondaryCounter = 0;
- this.intAutoCounter = 0;
- this.blnPrimaryActive = false;
- this.vecMomentum = new Vector();
- this.numAvatarMaxVelocity = 7;
- this.numSensitivity = 0.4;
- this.numResistence = 0.08;
- this.stickyCounter = 0;
- this.arrBullets = new Array();
- this.arrBulletBusters = new Array();
- this.arrFloatingBubbles = new Array();
- this.arrDebris = new Array();
- this.arrCleanup = new Array();
- this.arrEffects = new Array();
- this.arrUnderEffects = new Array();
- this.arrMap = new Array();
- this.arrAllySeekers = new Array();
- this.arrAllies = new Array();
- this.deltaList = new Array();
- this.numBulletDepth = 100000;
- this.numMineDepth = 100;
- this.numAllyDepth = 560;
- this.spawnedEnemyDepth = 20001;
- this.arrFloatingBubblesDepth = 700;
- this.effectDepth = 50000;
- this.underEffectDepth = 10;
- this.blnEnemiesCleared = false;
- this.blnFlushList = false;
- this.intWinFlag = -1;
- this.intLifeState = 3;
- this.intMaxHigh = 352;
- this.intMaxLow = 412;
- this.blnLifeFlag = false;
- this.intLifeCounter = 0;
- this.intFireRateState = 3;
- this.intFireRateMaxHigh = -50;
- this.intFireRateMaxLow = 5;
- this.blnFireRateFlag = false;
- this.intFireRateCounter = 0;
- this.intKeyLock = 0;
- this.intAssembledState = 0;
- this.intAssembledFrame = 1;
- this.blnSpaceDown = false;
- this.world = new BubbleTanksWorld();
- if(_global.gameMode == 1)
- {
- }
- this.arrMap.push({xloc:this.world.x,yloc:this.world.y,blnCreate:true,blnBoss:false});
- _root.pause_mc._visible = false;
- this.blnUpgradeFlag = false;
- this.backgroundDepth = 100;
- this.arrBackgrounds = new Array();
- this.arrBackgrounds.push("bg_bubbles_301");
- this.numEnemiesCreated = 0;
- this.strCurrentScreen = "stats_mc";
- this.blnWaitingToUpgrade = false;
- this.arrUpgradePath = Array();
- this.arrUpgradePath.push({min:1,max:76,name:"Starting Tank"});
- this.arrUpgradePath.push({min:76,max:201,name:"Machine Gun Tank"});
- this.arrUpgradePath.push({min:201,max:371,name:"3-Shot Tank"});
- this.arrUpgradePath.push({min:371,max:999999,name:"Super Tank"});
- this.mapLocX = undefined;
- this.mapLocY = undefined;
- this.intJumpsAsMax = 0;
- this.blnBoss = false;
- this.intBossState = 0;
- this.intBossX = 0;
- this.intBossY = 0;
- this.intShieldCounter = 0;
- this.intShieldWidth = 65;
- this.intBubblesCollected = 0;
- this.intEnemiesKilled = 0;
- this.intShakeDuration = 0;
- this.intShakeCounter = 0;
- this.intShakeStart = 0;
- this.vecScreenCoords = new Vector();
- this.vecScreenCoords._x = _root.avatar._x;
- this.vecScreenCoords._y = _root.avatar._y;
- }
- function QuitGame()
- {
- Mouse.removeListener(this.mouseListener);
- this.world.current.HideAllUnits();
- this.CleanPickupBubbles();
- this.CleanupBullets();
- this.RemoveAllAllySeekers();
- this.CleanEffects();
- this.CleanAllies();
- _root.openMask.swapDepths(this.intStoreDepth_openMask);
- _root.overlay.swapDepths(this.intStoreDepth_overlay);
- _root.avatar.swapDepths(this.intStoreDepth_avatar);
- _root.bg.swapDepths(this.intStoreDepth_bg);
- _root.bubbleSplit.swapDepths(this.intStoreDepth_bubbleSplit);
- _root.effects_mc.swapDepths(this.intStoreDepth_effects_mc);
- _root.miniBubblesLayer_mc.swapDepths(this.intStoreDepth_miniBubblesLayer_mc);
- _root.bubbleMask.swapDepths(this.intStoreDepth_bubbleMask);
- _root.effectMask_mc.swapDepths(this.intStoreDepth_effectMask_mc);
- _root.pause_mc.swapDepths(this.intStoreDepth_pause_mc);
- _root.life.swapDepths(this.intStoreDepth_life);
- _root.fireRate_mc.swapDepths(this.intStoreDepth_fireRate_mc);
- _root.flash_mc.swapDepths(this.intStoreDepth_flash_mc);
- _root.effects_mc.setMask("");
- _root.miniBubblesLayer_mc.setMask("");
- _global.gamePaused = false;
- _global.arena = new Bubblefield();
- _global.arenaAvatar = 1;
- _root.ExitGame();
- }
- function CreateNewUnit(enemyType, startPos, CreatedFrom)
- {
- if(enemyType == "Enemy_2")
- {
- if(this._enemySet == 1)
- {
- enemyType = "Enemy_2";
- }
- else if(this._enemySet == 2)
- {
- enemyType = "Enemy_93";
- }
- else if(this._enemySet == 3)
- {
- enemyType = "Enemy_94";
- }
- }
- var _loc4_ = "enemy_" + this.spawnedEnemyDepth;
- var _loc6_ = Math.round(Math.random() * 360) - 180;
- this.world.current.AddSpawnedUnit(_loc4_,enemyType,startPos,this.spawnedEnemyDepth);
- _root.attachMovie(enemyType,_loc4_,this.spawnedEnemyDepth);
- this.spawnedEnemyDepth = this.spawnedEnemyDepth + 1;
- if(this.spawnedEnemyDepth > 40000)
- {
- this.spawnedEnemyDepth = 20001;
- }
- _root[_loc4_]._x = startPos._x;
- _root[_loc4_]._y = startPos._y;
- _root[_loc4_]._rotation = _loc6_;
- if(enemyType == "Enemy_Orbital_Seeker" || enemyType == "Enemy_Sapper" || enemyType == "Enemy_Leecher")
- {
- _root[_loc4_].SetCreatedFrom(CreatedFrom);
- }
- return _loc4_;
- }
- function SafeToFire()
- {
- if(this.transitionState == 0)
- {
- return true;
- }
- return false;
- }
- function StartGame()
- {
- _root.pause_mc.swapDepths(1000010);
- _root.life.swapDepths(1000005);
- _root.fireRate_mc.swapDepths(1000006);
- _root.flash_mc.swapDepths(1000008);
- _root.flash_mc._visible = false;
- _root.bg.boss_mc._visible = false;
- _root.bg.bossUp_mc._visible = false;
- _root.bg.bossRight_mc._visible = false;
- _root.bg.bossDown_mc._visible = false;
- _root.bg.bossLeft_mc._visible = false;
- if(_global.gameMode == 2)
- {
- var _loc7_ = new Vector();
- this.world.current.ShowAllUnits(_loc7_);
- _root.bg.tutShell_mc.tutorial.gotoAndStop(7);
- this.avatarLife.Set(this.upgradePath.GetNodeWithID(_global.arenaAvatar).nodeData._minPoints + 50);
- this.upgradePath.SetNodeWithID(_global.arenaAvatar);
- _root.avatar.gotoAndStop(_global.arenaAvatar);
- if(this.upgradePath.currentNode.nodeData._id < 21)
- {
- _root.avatar.gun.gotoAndStop(50);
- }
- this.arenaTimer = new Timer();
- this.arenaTimer.Start();
- }
- else
- {
- this._enemySet = 0;
- this._enemySet2 = 0;
- var _loc6_ = 1;
- var _loc4_ = new Array(1,2,3);
- var _loc5_ = 0;
- while(_loc5_ < _loc4_.length)
- {
- if(_loc4_[_loc5_] == _global.set1)
- {
- _loc4_.splice(_loc5_,1);
- _loc5_ = _loc5_ - 1;
- }
- else if(_loc4_[_loc5_] == _global.set2)
- {
- _loc4_.splice(_loc5_,1);
- _loc5_ = _loc5_ - 1;
- }
- _loc5_ = _loc5_ + 1;
- }
- _loc6_ = _loc4_[this.RandNum(0,_loc4_.length - 1)];
- _global.set2 = _global.set1;
- _global.set1 = this._enemySet = _loc6_;
- _loc6_ = 1;
- _loc4_ = new Array(1,2);
- _loc5_ = 0;
- while(_loc5_ < _loc4_.length)
- {
- if(_loc4_[_loc5_] == _global.set3)
- {
- _loc4_.splice(_loc5_,1);
- _loc5_ = _loc5_ - 1;
- }
- _loc5_ = _loc5_ + 1;
- }
- _loc6_ = _loc4_[this.RandNum(0,_loc4_.length - 1)];
- _global.set3 = this._enemySet2 = _loc6_;
- if(this.mySharedObject.data.firstTime != undefined)
- {
- this.mySharedObject.data.set1 = _global.set1;
- this.mySharedObject.data.set2 = _global.set2;
- this.mySharedObject.data.set3 = _global.set3;
- this.mySharedObject.flush();
- }
- }
- }
- function RunGame()
- {
- _root.stop();
- var _loc4_ = undefined;
- var _loc5_ = undefined;
- if(_global.gamePaused == false)
- {
- if(this.transitionState == 0)
- {
- _loc5_ = this.MoveAvatar();
- }
- else if(this.deltaList.length != 0)
- {
- _loc5_ = new Vector();
- var _loc7_ = this.deltaList[0];
- this.deltaList.shift();
- _loc5_._x = _loc7_._x * -1;
- _loc5_._y = _loc7_._y * -1;
- if(this.transitionState == 1)
- {
- _loc4_ = this.world.GetLeft(false);
- _loc4_.MoveAllBubblefieldUnits(_loc5_);
- }
- else if(this.transitionState == 2)
- {
- _loc4_ = this.world.GetUp(false);
- _loc4_.MoveAllBubblefieldUnits(_loc5_);
- }
- else if(this.transitionState == 3)
- {
- _loc4_ = this.world.GetRight(false);
- _loc4_.MoveAllBubblefieldUnits(_loc5_);
- }
- else if(this.transitionState == 4)
- {
- _loc4_ = this.world.GetDown(false);
- _loc4_.MoveAllBubblefieldUnits(_loc5_);
- }
- }
- else
- {
- var _loc6_ = new Vector();
- if(this.transitionState == 1)
- {
- _loc4_ = this.world.GetLeft(false);
- if(_loc4_ == undefined)
- {
- this.world.PrintBubblefieldCoordsList();
- }
- _loc4_.HideAllUnits();
- if(_loc4_.blnBoss == true)
- {
- this.HideBoss();
- }
- _loc6_._x = 1147.6;
- }
- else if(this.transitionState == 2)
- {
- _loc4_ = this.world.GetUp(false);
- if(_loc4_ == undefined)
- {
- this.world.PrintBubblefieldCoordsList();
- }
- _loc4_.HideAllUnits();
- if(_loc4_.blnBoss == true)
- {
- this.HideBoss();
- }
- _loc6_._y = 1147.6;
- }
- else if(this.transitionState == 3)
- {
- _loc4_ = this.world.GetRight(false);
- if(_loc4_ == undefined)
- {
- this.world.PrintBubblefieldCoordsList();
- }
- _loc4_.HideAllUnits();
- if(_loc4_.blnBoss == true)
- {
- this.HideBoss();
- }
- _loc6_._x = -1147.6;
- }
- else if(this.transitionState == 4)
- {
- _loc4_ = this.world.GetDown(false);
- if(_loc4_ == undefined)
- {
- this.world.PrintBubblefieldCoordsList();
- }
- _loc4_.HideAllUnits();
- if(_loc4_.blnBoss == true)
- {
- this.HideBoss();
- }
- _loc6_._y = -1147.6;
- }
- this.blnEnemiesCleared = false;
- this.FlushEncounteredList();
- this.BackgroundShift(_loc6_);
- if(this.world.current.blnBoss == true)
- {
- this.ShiftBoss();
- }
- this.CleanPickupBubbles();
- this.CleanupBullets();
- this.RemoveAllySeekers();
- this.CleanEffects();
- this.ManageTutorial();
- if(this.kongBlnRefresh == true)
- {
- _root.kongregateStats.submit("MaxKillsInAGame",this.kongEnemiesKilledThisGame.Get());
- this.kongBlnRefresh = false;
- }
- this.transitionState = 0;
- if(this.GetDistance() <= _root.bg.inside._width / 2)
- {
- this.runOnce = false;
- }
- _loc5_ = this.MoveAvatar();
- if(this.intBossState == 1)
- {
- this.intBossState = 2;
- this.blnWaitingToUpgrade = true;
- this.PauseGame();
- _root.pause_mc.gotoAndStop(1);
- _root.pause_mc._visible = false;
- this.blnUpgradeFlag = true;
- _root.bg.boss_mc._visible = true;
- _root.bg.boss_mc.gotoAndPlay(2);
- }
- }
- this.MoveWorld(_loc5_);
- this.RotateGun();
- this.ManageDisassembly();
- this.OperateAvatarWeapons();
- this.CheckPickupBubbleCollection();
- if(this.transitionState == 0)
- {
- this.CheckBulletCollision();
- this.CheckTankExit();
- }
- this.ControlInterface();
- this.ControlFireRateInterface();
- this.ManageShaking();
- this.ManageWinGame();
- }
- if(_global.gamePaused == true && this.intBossState == 2)
- {
- this.ManageShaking();
- }
- if(_global.gameMode == 2)
- {
- this.arenaTimer.Run();
- }
- this.CheckKeyPress();
- this.DoCleanup();
- }
- function ManageWinGame()
- {
- if(this.intWinFlag == 0)
- {
- _root.kongregateStats.submit("GameCompleted",1);
- this.blnUpgradeFlag = true;
- this.PauseGame();
- if(_global.doUnlockEC.Get() != -1)
- {
- _root.pause_mc.gotoAndPlay("winScreen");
- }
- else
- {
- _root.pause_mc.gotoAndPlay("winScreenLocked");
- }
- _root.bg.boss_mc.gotoAndStop(1);
- _root.bg.boss_mc._visible = false;
- this.intWinFlag = -1;
- }
- else if(this.intWinFlag > 0)
- {
- this.intWinFlag = this.intWinFlag - 1;
- }
- }
- function ResumeBossFight()
- {
- this.BossSpawnBody();
- this.intBossState = 3;
- this.blnWaitingToUpgrade = false;
- this.blnUpgradeFlag = false;
- this.UnPauseGame();
- }
- function HideBoss()
- {
- _root.bg.boss_mc.gotoAndStop(1);
- _root.bg.boss_mc._visible = false;
- }
- function ShowBoss(vecShift)
- {
- if(this.intBossState == 3)
- {
- if(vecShift._x == 0 && vecShift._y < 0)
- {
- _root.bg.bossUp_mc._visible = true;
- _root.bg.bossUp_mc.gotoAndStop("resumeBoss");
- }
- else if(vecShift._x > 0 && vecShift._y == 0)
- {
- _root.bg.bossRight_mc._visible = true;
- _root.bg.bossRight_mc.gotoAndStop("resumeBoss");
- }
- else if(vecShift._x == 0 && vecShift._y > 0)
- {
- _root.bg.bossDown_mc._visible = true;
- _root.bg.bossDown_mc.gotoAndStop("resumeBoss");
- }
- else if(vecShift._x < 0 && vecShift._y == 0)
- {
- _root.bg.bossLeft_mc._visible = true;
- _root.bg.bossLeft_mc.gotoAndStop("resumeBoss");
- }
- }
- }
- function ShiftBoss()
- {
- if(this.intBossState == 3)
- {
- _root.bg.boss_mc._visible = true;
- _root.bg.boss_mc.gotoAndStop("resumeBoss");
- _root.bg.bossUp_mc.gotoAndStop(1);
- _root.bg.bossUp_mc._visible = false;
- _root.bg.bossRight_mc.gotoAndStop(1);
- _root.bg.bossRight_mc._visible = false;
- _root.bg.bossDown_mc.gotoAndStop(1);
- _root.bg.bossDown_mc._visible = false;
- _root.bg.bossLeft_mc.gotoAndStop(1);
- _root.bg.bossLeft_mc._visible = false;
- }
- }
- function BossSpawnBody()
- {
- var _loc4_ = new Vector();
- var _loc3_ = {x:_root.bg.boss_mc.handLeft_mc._x,y:_root.bg.boss_mc.handLeft_mc._y};
- _root.bg.boss_mc.localToGlobal(_loc3_);
- _loc4_._x = _loc3_.x;
- _loc4_._y = _loc3_.y;
- var _loc7_ = this.CreateNewUnit("Enemy_B2",_loc4_,"");
- _root[_loc7_]._rotation = _root.bg.boss_mc.handLeft_mc._rotation;
- _root.bg.boss_mc.handLeft_mc._visible = false;
- _loc4_ = new Vector();
- _loc3_ = {x:_root.bg.boss_mc.handRight_mc._x,y:_root.bg.boss_mc.handRight_mc._y};
- _root.bg.boss_mc.localToGlobal(_loc3_);
- _loc4_._x = _loc3_.x;
- _loc4_._y = _loc3_.y;
- var _loc10_ = this.CreateNewUnit("Enemy_B2",_loc4_,"");
- _root[_loc10_]._rotation = _root.bg.boss_mc.handRight_mc._rotation;
- _root.bg.boss_mc.handRight_mc._visible = false;
- var _loc6_ = new Vector();
- _loc3_ = {x:_root.bg.boss_mc.head_mc._x,y:_root.bg.boss_mc.head_mc._y};
- _root.bg.boss_mc.localToGlobal(_loc3_);
- _loc6_._x = _loc3_.x;
- _loc6_._y = _loc3_.y;
- var _loc8_ = this.CreateNewUnit("Enemy_B1",_loc6_,"");
- _root[_loc8_]._rotation = _root.bg.boss_mc.head_mc._rotation;
- _root.bg.boss_mc.head_mc._visible = false;
- var _loc5_ = new Vector();
- _loc3_ = {x:_root.bg.boss_mc.tail_mc._x,y:_root.bg.boss_mc.tail_mc._y};
- _root.bg.boss_mc.localToGlobal(_loc3_);
- _loc5_._x = _loc3_.x;
- _loc5_._y = _loc3_.y;
- var _loc9_ = this.CreateNewUnit("Enemy_B3",_loc5_,"");
- _root[_loc9_]._rotation = _root.bg.boss_mc.tail_mc._rotation;
- _root.bg.boss_mc.tail_mc._visible = false;
- }
- function ManageTutorial()
- {
- if(this.upgradePath.currentNode.nodeData._id >= 21)
- {
- this.intJumpsAsMax = this.intJumpsAsMax + 1;
- }
- this.numJumps = this.numJumps + 1;
- if(_global.gameMode != 2)
- {
- if(this.intTutorialState == 2)
- {
- this.intTutorialState = 3;
- _root.bg.tutShell_mc.gotoAndStop(1);
- _root.bg.tutShell_mc.tutorial.gotoAndStop(6);
- }
- else if(this.world.current.blnBoss == true)
- {
- _root.bg.tutShell_mc.gotoAndStop(1);
- _root.bg.tutShell_mc.tutorial.gotoAndStop(7);
- }
- else if(this.numJumps == 1)
- {
- _root.bg.tutShell_mc.gotoAndStop(1);
- _root.bg.tutShell_mc.tutorial.gotoAndStop(2);
- }
- else if(this.numJumps == 2)
- {
- _root.bg.tutShell_mc.gotoAndStop(1);
- _root.bg.tutShell_mc.tutorial.gotoAndStop(3);
- }
- else if(this.numJumps == 3)
- {
- _root.bg.tutShell_mc.gotoAndStop(1);
- _root.bg.tutShell_mc.tutorial.gotoAndStop(4);
- }
- else if(this.numJumps == 4)
- {
- _root.bg.tutShell_mc.gotoAndStop(1);
- _root.bg.tutShell_mc.tutorial.gotoAndStop(5);
- }
- else if(this.numJumps > 4)
- {
- _root.bg.tutShell_mc.gotoAndStop(2);
- }
- }
- else
- {
- _root.bg.tutShell_mc.gotoAndStop(2);
- }
- }
- function CheckKeyPress()
- {
- if(this.intKeyLock == 0)
- {
- var _loc3_ = -1;
- if(Key.isDown(_global.pauseHotkey))
- {
- if(this.blnUpgradeFlag == false)
- {
- if(_global.gamePaused == true)
- {
- this.ClosePauseScreen();
- this.intKeyLock = 20;
- }
- else
- {
- this.PauseGame();
- this.intKeyLock = 20;
- }
- }
- }
- if(Key.isDown(17) && Key.isDown(107))
- {
- if(_global.doUnlockEC.Get() != -1)
- {
- if(_global.doUnLockCheats.Get() != -1)
- {
- this.avatarLife.Set(this.avatarLife.Get() + 100);
- this.intKeyLock = 20;
- this.CheckUpgradeState();
- }
- }
- }
- }
- else
- {
- this.intKeyLock = this.intKeyLock - 1;
- }
- if(_global.gamePaused == false)
- {
- if(Key.isDown(_global.fireHotkey))
- {
- if(this.upgradePath.currentNode.nodeData._arrSecondaryWeapons[0].type == 24)
- {
- if(this.blnSpaceDown == false)
- {
- this.intAssembledState = 1;
- this.blnSpaceDown = true;
- }
- }
- else
- {
- this.OperateAvatarSecondaryWeapons();
- }
- }
- else if(this.blnSpaceDown == true)
- {
- this.intAssembledState = 3;
- this.blnSpaceDown = false;
- }
- }
- }
- function SetupPauseScreen()
- {
- _root.pause_mc.inside_mc.buttonText_txt.text = "";
- this.SelectPauseScreen(this.strCurrentScreen);
- }
- function SelectPauseScreen(openScreen)
- {
- var _loc3_ = _root.pause_mc.inside_mc;
- _loc3_.content_mc.gotoAndStop(openScreen);
- if(openScreen == "stats_mc")
- {
- _loc3_.stats_mc.gotoAndStop(2);
- }
- else
- {
- _loc3_.stats_mc.gotoAndStop(1);
- }
- if(openScreen == "map_mc")
- {
- _loc3_.map_mc.gotoAndStop(2);
- this.DrawMap();
- }
- else
- {
- _loc3_.map_mc.gotoAndStop(1);
- }
- if(openScreen == "options_mc")
- {
- _loc3_.options_mc.gotoAndStop(2);
- }
- else
- {
- _loc3_.options_mc.gotoAndStop(1);
- }
- if(openScreen == "stats_mc")
- {
- this.SetupStats();
- }
- if(openScreen != "quit_mc" && openScreen != "controls_mc")
- {
- this.strCurrentScreen = openScreen;
- }
- }
- function SetupArenaScreen()
- {
- _root.pause_mc.inside_mc.enemiesKilled_txt.text = this.intEnemiesKilled;
- _root.pause_mc.inside_mc.bubblesCollected_txt.text = this.intBubblesCollected;
- _root.pause_mc.inside_mc.timeCompleted_txt.text = this.arenaTimer.GetTimeString();
- }
- function CompleteArena()
- {
- this.arenaTimer.Pause();
- this.blnUpgradeFlag = true;
- this.PauseGame();
- _root.pause_mc.gotoAndPlay("arenaComplete");
- }
- function PauseGame()
- {
- _global.gamePaused = true;
- if(_global.gameMode == 2)
- {
- this.arenaTimer.Pause();
- }
- if(this.transitionState != 0)
- {
- this.world.previous.HaltUnits();
- }
- this.world.current.HaltUnits();
- this.PauseAllies();
- var _loc4_ = 0;
- while(_loc4_ < this.arrBullets.length)
- {
- _root[this.arrBullets[_loc4_]]._holdMovement = true;
- if(_root[this.arrBullets[_loc4_]]._type == 8)
- {
- _root[this.arrBullets[_loc4_]].PauseUnPauseBusted(true);
- }
- _loc4_ = _loc4_ + 1;
- }
- _loc4_ = 0;
- while(_loc4_ < this.arrAllySeekers.length)
- {
- _root[this.arrAllySeekers[_loc4_].name].TurnOff();
- _loc4_ = _loc4_ + 1;
- }
- _root.pause_mc._visible = true;
- _root.pause_mc.gotoAndPlay(2);
- }
- function UpgradePause()
- {
- this.PauseGame();
- this.blnUpgradeFlag = true;
- if(this.upgradePath.currentNode.GetNumChildren() == 3)
- {
- _root.pause_mc.gotoAndPlay("upgradeThree");
- }
- else if(this.upgradePath.currentNode.GetNumChildren() == 2)
- {
- _root.pause_mc.gotoAndPlay("upgradeTwo");
- }
- }
- function UpgradePauseComplete()
- {
- this.UnPauseGame();
- this.blnUpgradeFlag = false;
- }
- function ClosePauseScreen()
- {
- _root.pause_mc.gotoAndPlay(16);
- this.blnUpgradeFlag = false;
- }
- function CloseWinScreen()
- {
- _global.invincible = true;
- if(_global.doUnlockEC.Get() != -1)
- {
- _root.pause_mc.gotoAndPlay(77);
- }
- else
- {
- _root.pause_mc.gotoAndPlay(107);
- }
- this.blnUpgradeFlag = false;
- }
- function UnPauseGame()
- {
- _root.pause_mc._visible = false;
- if(_global.gameMode == 2)
- {
- this.arenaTimer.UnPause();
- }
- _global.gamePaused = false;
- if(this.transitionState != 0)
- {
- this.world.previous.ResumeUnits();
- }
- this.world.current.ResumeUnits();
- this.UnPauseAllies();
- var _loc4_ = 0;
- while(_loc4_ < this.arrBullets.length)
- {
- _root[this.arrBullets[_loc4_]]._holdMovement = false;
- if(_root[this.arrBullets[_loc4_]]._type == 8)
- {
- _root[this.arrBullets[_loc4_]].PauseUnPauseBusted(false);
- }
- _loc4_ = _loc4_ + 1;
- }
- _loc4_ = 0;
- while(_loc4_ < this.arrAllySeekers.length)
- {
- _root[this.arrAllySeekers[_loc4_].name].TurnOn();
- _loc4_ = _loc4_ + 1;
- }
- }
- function DrawMap()
- {
- this.ClearMap();
- var _loc23_ = _root.pause_mc.inside_mc;
- var _loc4_ = _root.pause_mc.inside_mc.content_mc.contentInside_mc.mapInside_mc;
- if(this.mapLocX == undefined)
- {
- this.mapLocX = _loc4_._x;
- this.mapLocY = _loc4_._y;
- }
- _loc4_.map_mc._visible = false;
- var _loc15_ = 999999;
- var _loc13_ = -999999;
- var _loc14_ = 999999;
- var _loc12_ = -999999;
- var _loc3_ = 0;
- while(_loc3_ < this.arrMap.length)
- {
- if(this.arrMap[_loc3_].xloc < _loc15_)
- {
- _loc15_ = this.arrMap[_loc3_].xloc;
- }
- if(this.arrMap[_loc3_].xloc > _loc13_)
- {
- _loc13_ = this.arrMap[_loc3_].xloc;
- }
- if(this.arrMap[_loc3_].yloc < _loc14_)
- {
- _loc14_ = this.arrMap[_loc3_].yloc;
- }
- if(this.arrMap[_loc3_].yloc > _loc12_)
- {
- _loc12_ = this.arrMap[_loc3_].yloc;
- }
- _loc3_ = _loc3_ + 1;
- }
- var _loc10_ = 1;
- var _loc11_ = 15;
- var _loc9_ = _loc4_.map_mc._x + _loc4_.map_mc._width / 2;
- var _loc8_ = _loc4_.map_mc._y + _loc4_.map_mc._height / 2;
- var _loc7_ = 0;
- var _loc6_ = 0;
- var _loc21_ = this.world.startX;
- var _loc20_ = this.world.startY;
- var _loc18_ = this.world.current.x;
- var _loc19_ = this.world.current.y;
- var _loc25_ = 5;
- var _loc5_ = this.arrMap[0].xloc + "_" + this.arrMap[0].yloc;
- var _loc27_ = undefined;
- var _loc26_ = undefined;
- var _loc17_ = undefined;
- _loc17_ = _loc18_ - _loc21_;
- _loc9_ -= _loc17_ * _loc11_;
- _loc17_ = _loc19_ - _loc20_;
- _loc8_ += _loc17_ * _loc11_;
- _loc4_.attachMovie("token",_loc5_,_loc10_);
- _loc10_ = _loc10_ + 1;
- _loc4_[_loc5_]._x = _loc9_;
- _loc4_[_loc5_]._y = _loc8_;
- _loc4_.lineStyle(0,16777215,100);
- var _loc22_ = new Object();
- var _loc24_ = new Object();
- _loc4_.moveTo(_loc9_,_loc8_);
- _loc3_ = 1;
- while(_loc3_ < this.arrMap.length)
- {
- _loc7_ = _loc9_ + (this.arrMap[_loc3_].xloc - this.arrMap[_loc3_ - 1].xloc) * _loc11_;
- _loc6_ = _loc8_ + (this.arrMap[_loc3_].yloc - this.arrMap[_loc3_ - 1].yloc) * (- _loc11_);
- _loc5_ = this.arrMap[_loc3_].xloc + "_" + this.arrMap[_loc3_].yloc;
- if(this.arrMap[_loc3_].blnCreate == true)
- {
- _loc4_.attachMovie("token",_loc5_,_loc10_);
- _loc10_ = _loc10_ + 1;
- _loc4_[_loc5_]._x = _loc7_;
- _loc4_[_loc5_]._y = _loc6_;
- }
- _loc4_.lineTo(_loc7_,_loc6_);
- _loc9_ = _loc7_;
- _loc8_ = _loc6_;
- _loc3_ = _loc3_ + 1;
- }
- var _loc16_ = undefined;
- _loc16_ = this.arrMap[0].xloc + "_" + this.arrMap[0].yloc;
- _loc4_[_loc16_].gotoAndStop(2);
- if(this.blnBoss == true)
- {
- _loc16_ = this.intBossX + "_" + this.intBossY;
- _loc4_[_loc16_].gotoAndStop(4);
- }
- _loc16_ = _loc18_ + "_" + _loc19_;
- _loc4_[_loc16_].gotoAndStop(3);
- }
- function ClearMap()
- {
- var _loc2_ = _root.pause_mc.inside_mc.content_mc.contentInside_mc.mapInside_mc;
- _loc2_.clear();
- for(var _loc3_ in _loc2_)
- {
- if(_loc2_[_loc3_]._name != "map_mc")
- {
- _loc2_[_loc3_].removeMovieClip();
- }
- }
- }
- function SetupStats()
- {
- var _loc4_ = _root.pause_mc.inside_mc.content_mc.contentInside_mc;
- _loc4_.stateName_txt.text = this.upgradePath.currentNode.nodeData._name;
- _loc4_.stateDescription_txt.text = this.upgradePath.currentNode.nodeData._description;
- _loc4_.primary_txt.text = this.upgradePath.currentNode.nodeData._primary;
- _loc4_.primaryDescription_txt.text = this.upgradePath.currentNode.nodeData._primaryDescription;
- _loc4_.secondary_txt.text = this.upgradePath.currentNode.nodeData._secondary;
- _loc4_.secondaryDescription_txt.text = this.upgradePath.currentNode.nodeData._secondaryDescription;
- _loc4_.enemiesKilled_txt.text = this.intEnemiesKilled;
- _loc4_.bubblesCollected_txt.text = this.intBubblesCollected;
- _loc4_.icon_mc.enemyImage.attachMovie("avatar","currentShownEnemy",200);
- var _loc3_ = _loc4_.icon_mc.enemyImage.currentShownEnemy;
- _loc3_.gotoAndStop(this.upgradePath.currentNode.nodeData._id);
- if(this.upgradePath.currentNode.nodeData._id != 1 && this.upgradePath.currentNode.nodeData._id != 21)
- {
- _loc3_.gun.gotoAndStop(50);
- }
- var _loc5_ = undefined;
- if(_loc3_._width > 105 || _loc3_._height > 105)
- {
- if(_loc3_._width > _loc3_._height)
- {
- _loc5_ = 105 / _loc3_._width;
- }
- else if(_loc3_._width == _loc3_._height)
- {
- _loc5_ = 105 / _loc3_._width;
- }
- else
- {
- _loc5_ = 105 / _loc3_._height;
- }
- _loc3_._width *= _loc5_;
- _loc3_._height *= _loc5_;
- }
- _loc3_.TurnOff();
- _loc3_._x = 38;
- _loc3_._y = 34;
- }
- function ControlInterface()
- {
- if(this.upgradePath.currentNode.nodeData._maxPoints == 999999)
- {
- _root.life.inside._xscale = 100;
- _root.life.left_txt.text = "Max Tank Size";
- _root.life.state_txt.text = this.upgradePath.currentNode.nodeData._name;
- }
- else
- {
- var _loc4_ = undefined;
- var _loc3_ = undefined;
- if(this.upgradePath.currentNode.nodeData._maxPoints - this.upgradePath.currentNode.nodeData._minPoints != 0)
- {
- _loc4_ = (this.avatarLife.Get() - this.upgradePath.currentNode.nodeData._minPoints) / (this.upgradePath.currentNode.nodeData._maxPoints - this.upgradePath.currentNode.nodeData._minPoints);
- _loc3_ = this.upgradePath.currentNode.nodeData._maxPoints - this.avatarLife.Get();
- }
- else
- {
- _loc4_ = 1;
- _loc3_ = 0;
- }
- _loc3_ = _loc3_ + 1;
- _root.life.inside._xscale = Math.round(_loc4_ * 100);
- _root.life.left_txt.text = _loc3_ + " Bubbles Left";
- _root.life.state_txt.text = this.upgradePath.currentNode.nodeData._name;
- }
- if((this.intLifeState == 3 || this.intLifeState == 1) && this.blnLifeFlag == true)
- {
- this.intLifeState = 2;
- }
- else if(this.intLifeState == 4)
- {
- if(this.intLifeCounter == 1)
- {
- this.intLifeState = 1;
- }
- if(this.intLifeCounter > 0)
- {
- this.intLifeCounter = this.intLifeCounter - 1;
- }
- if(this.blnLifeFlag == true)
- {
- this.intLifeCounter = 75;
- if(this.intFireRateCounter > 1)
- {
- this.intFireRateCounter = 75;
- }
- }
- }
- switch(this.intLifeState)
- {
- case 1:
- var _loc5_ = this.intMaxLow - _root.life._y;
- if(_loc5_ < 2)
- {
- _root.life._y = this.intMaxLow;
- this.intLifeState = 3;
- }
- else
- {
- _root.life._y += 0.2 * _loc5_;
- }
- break;
- case 2:
- _loc5_ = _root.life._y - this.intMaxHigh;
- if(_loc5_ < 2)
- {
- _root.life._y = this.intMaxHigh;
- this.intLifeState = 4;
- this.intLifeCounter = 75;
- if(this.intFireRateCounter > 1)
- {
- this.intFireRateCounter = 75;
- }
- }
- else
- {
- _root.life._y -= 0.2 * _loc5_;
- }
- }
- this.blnLifeFlag = false;
- }
- function ControlFireRateInterface()
- {
- var _loc3_ = 1;
- _loc3_ = this.upgradePath.currentNode.nodeData._arrPrimaryWeapons[0].delay;
- var _loc5_ = Math.round((1 - this.intPrimaryCounter / _loc3_) * 100);
- _root.fireRate_mc.insidePrimary_mc._xscale = _loc5_;
- if(this.upgradePath.currentNode.nodeData._arrSecondaryWeapons.length == 0)
- {
- _root.fireRate_mc.insideSecondary_mc._xscale = 0.1;
- }
- else
- {
- _loc3_ = this.upgradePath.currentNode.nodeData._arrSecondaryWeapons[0].delay;
- var _loc6_ = Math.round((1 - this.intSecondaryCounter / _loc3_) * 100);
- _root.fireRate_mc.insideSecondary_mc._xscale = _loc6_;
- }
- if((this.intFireRateState == 3 || this.intFireRateState == 1) && this.blnFireRateFlag == true)
- {
- this.intFireRateState = 2;
- }
- else if(this.intFireRateState == 4)
- {
- if(this.intFireRateCounter == 1)
- {
- this.intFireRateState = 1;
- }
- if(this.intFireRateCounter > 0)
- {
- this.intFireRateCounter = this.intFireRateCounter - 1;
- }
- if(this.blnFireRateFlag == true)
- {
- this.intFireRateCounter = 75;
- if(this.intLifeCounter > 1)
- {
- this.intLifeCounter = 75;
- }
- }
- }
- switch(this.intFireRateState)
- {
- case 1:
- var _loc4_ = _root.fireRate_mc._y - this.intFireRateMaxHigh;
- if(_loc4_ < 2)
- {
- _root.fireRate_mc._y = this.intFireRateMaxHigh;
- this.intFireRateState = 3;
- }
- else
- {
- _root.fireRate_mc._y -= 0.2 * _loc4_;
- }
- break;
- case 2:
- _loc4_ = this.intFireRateMaxLow - _root.fireRate_mc._y;
- if(_loc4_ < 2)
- {
- _root.fireRate_mc._y = this.intFireRateMaxLow;
- this.intFireRateState = 4;
- this.intFireRateCounter = 75;
- if(this.intLifeCounter > 1)
- {
- this.intLifeCounter = 75;
- }
- }
- else
- {
- _root.fireRate_mc._y += 0.2 * _loc4_;
- }
- }
- this.blnFireRateFlag = false;
- }
- function CheckUpgradeState()
- {
- if(this.avatarLife.Get() > this.upgradePath.currentNode.nodeData._maxPoints)
- {
- if(this.upgradePath.UpgradeAlreadySelected() == false)
- {
- this.blnWaitingToUpgrade = true;
- this.UpgradePause();
- }
- else
- {
- this.intPrimaryCounter = 0;
- this.intSecondaryCounter = 0;
- this.intAutoCounter = 0;
- _root.avatar.gotoAndStop(this.upgradePath.currentNode.nodeData._id);
- }
- }
- else if(this.avatarLife.Get() < this.upgradePath.currentNode.nodeData._minPoints)
- {
- if(this.upgradePath.currentNode.nodeData._id != 1)
- {
- if(this.upgradePath.currentNode.nodeData._id == 26)
- {
- this.DowngradeRemoveFighters();
- }
- this.intPrimaryCounter = 0;
- this.intSecondaryCounter = 0;
- this.upgradePath.DownGrade();
- _root.avatar.gotoAndStop(this.upgradePath.currentNode.nodeData._id);
- this.intJumpsAsMax = 0;
- }
- }
- var _loc3_ = this.avatarLife.Get() - this.upgradePath.currentNode.nodeData._minPoints;
- if(this.upgradePath.currentNode.nodeData._id < 21)
- {
- _root.avatar.gun.gotoAndStop(_loc3_);
- }
- this.ScaleMiniBubble();
- }
- function DowngradeRemoveFighters()
- {
- var _loc4_ = this.arrAllies.slice();
- var _loc3_ = 0;
- while(_loc3_ < _loc4_.length)
- {
- this.Effect_PierceExplosion(_root[_loc4_[_loc3_]]._x,_root[_loc4_[_loc3_]]._y);
- _root[_loc4_[_loc3_]].Dock();
- _loc3_ = _loc3_ + 1;
- }
- }
- function UpgradeChosen(buttonName)
- {
- if(this.blnWaitingToUpgrade == true)
- {
- if(getTimer() - this.intUpgradeDelay > 1200)
- {
- var _loc4_ = this.upgradePath.currentNode.GetNumChildren();
- this.upgradePath.Upgrade(buttonName);
- this.blnWaitingToUpgrade = false;
- this.intPrimaryCounter = 0;
- this.intSecondaryCounter = 0;
- if(this.intTutorialState == 1)
- {
- if(this.upgradePath.currentNode.nodeData._id >= 5)
- {
- this.intTutorialState = 2;
- }
- }
- if(_global.gameMode == 1)
- {
- if(this.IsAvatarLocked(this.upgradePath.currentNode.nodeData._id) == true)
- {
- _global.encounteredStates.push(this.upgradePath.currentNode.nodeData._id);
- this.mySharedObject.data.statesList = _global.encounteredStates;
- this.mySharedObject.flush();
- }
- }
- if(_loc4_ == 3)
- {
- _root.pause_mc.gotoAndPlay("upgradeThreeComplete");
- }
- else if(_loc4_ == 2)
- {
- _root.pause_mc.gotoAndPlay("upgradeTwoComplete");
- }
- this.upgradePath.currentNode.nodeData._selected = true;
- _root.avatar.gotoAndStop(this.upgradePath.currentNode.nodeData._id);
- this.CheckUpgradeState();
- }
- }
- }
- function SetupUpgradeButtons(screenRef, numButtons)
- {
- var _loc4_ = undefined;
- var _loc5_ = undefined;
- var _loc7_ = undefined;
- var _loc9_ = undefined;
- var _loc8_ = undefined;
- this.upgradePath.currentNode.Reset();
- _loc5_ = this.upgradePath.currentNode.GetChild();
- _loc4_ = screenRef.first_mc;
- _loc4_.title_txt.text = _loc5_.nodeData._name;
- _loc4_.primary_txt.text = _loc5_.nodeData._primary;
- _loc4_.secondary_txt.text = _loc5_.nodeData._secondary;
- _loc7_ = _loc5_.nodeData._locked;
- if(_global.doUnlockEC.Get() != -1 || _loc5_.nodeData._locked == false)
- {
- _loc4_.description_txt.text = _loc5_.nodeData._description;
- _loc4_.locked_mc.gotoAndStop(1);
- _loc4_.lockedText_mc.gotoAndStop(1);
- }
- else
- {
- _loc4_.description_txt.text = "Only available on ArmorGames.com. Click to play the Extra Content version!";
- _loc4_.locked_mc.gotoAndStop(2);
- _loc4_.lockedText_mc.gotoAndStop(2);
- }
- this.upgradePath.currentNode.NextChild();
- _loc5_ = this.upgradePath.currentNode.GetChild();
- _loc4_ = screenRef.second_mc;
- _loc4_.title_txt.text = _loc5_.nodeData._name;
- _loc4_.primary_txt.text = _loc5_.nodeData._primary;
- _loc4_.secondary_txt.text = _loc5_.nodeData._secondary;
- _loc9_ = _loc5_.nodeData._locked;
- if(_global.doUnlockEC.Get() != -1 || _loc5_.nodeData._locked == false)
- {
- _loc4_.description_txt.text = _loc5_.nodeData._description;
- _loc4_.locked_mc.gotoAndStop(1);
- _loc4_.lockedText_mc.gotoAndStop(1);
- }
- else
- {
- _loc4_.description_txt.text = "Only available on ArmorGames.com. Click to play the Extra Content version!";
- _loc4_.locked_mc.gotoAndStop(2);
- _loc4_.lockedText_mc.gotoAndStop(2);
- }
- if(numButtons == 3)
- {
- this.upgradePath.currentNode.NextChild();
- _loc5_ = this.upgradePath.currentNode.GetChild();
- _loc4_ = screenRef.third_mc;
- _loc4_.title_txt.text = _loc5_.nodeData._name;
- _loc4_.primary_txt.text = _loc5_.nodeData._primary;
- _loc4_.secondary_txt.text = _loc5_.nodeData._secondary;
- _loc8_ = _loc5_.nodeData._locked;
- if(_global.doUnlockEC.Get() != -1 || _loc5_.nodeData._locked == false)
- {
- _loc4_.description_txt.text = _loc5_.nodeData._description;
- _loc4_.locked_mc.gotoAndStop(1);
- _loc4_.lockedText_mc.gotoAndStop(1);
- }
- else
- {
- _loc4_.description_txt.text = "Only available on ArmorGames.com. Click to play the Extra Content version!";
- _loc4_.locked_mc.gotoAndStop(2);
- _loc4_.lockedText_mc.gotoAndStop(2);
- }
- }
- _loc4_ = screenRef.first_mc;
- _loc4_.onRollOver = function()
- {
- this.gotoAndStop(2);
- };
- _loc4_.onRollOut = function()
- {
- this.gotoAndStop(1);
- };
- if(_global.doUnlockEC.Get() != -1 || _loc7_ == false)
- {
- _loc4_.onRelease = function()
- {
- _root.game.UpgradeChosen("first_mc");
- };
- }
- else
- {
- _loc4_.onRelease = function()
- {
- getUrl("http://www.herointeractive.com/BT2_Transfer.php?intID=3", "_blank");
- };
- }
- _loc4_ = screenRef.second_mc;
- _loc4_.onRollOver = function()
- {
- this.gotoAndStop(2);
- };
- _loc4_.onRollOut = function()
- {
- this.gotoAndStop(1);
- };
- if(_global.doUnlockEC.Get() != -1 || _loc9_ == false)
- {
- _loc4_.onRelease = function()
- {
- _root.game.UpgradeChosen("second_mc");
- };
- }
- else
- {
- _loc4_.onRelease = function()
- {
- getUrl("http://www.herointeractive.com/BT2_Transfer.php?intID=3", "_blank");
- };
- }
- if(numButtons == 3)
- {
- _loc4_ = screenRef.third_mc;
- _loc4_.onRollOver = function()
- {
- this.gotoAndStop(2);
- };
- _loc4_.onRollOut = function()
- {
- this.gotoAndStop(1);
- };
- if(_global.doUnlockEC.Get() != -1 || _loc8_ == false)
- {
- _loc4_.onRelease = function()
- {
- _root.game.UpgradeChosen("third_mc");
- };
- }
- else
- {
- _loc4_.onRelease = function()
- {
- getUrl("http://www.herointeractive.com/BT2_Transfer.php?intID=3", "_blank");
- };
- }
- }
- this.intUpgradeDelay = getTimer();
- }
- function RemoveBullet(strName)
- {
- var _loc4_ = 0;
- while(_loc4_ < this.arrBullets.length)
- {
- if(strName == this.arrBullets[_loc4_])
- {
- if(_root[this.arrBullets[_loc4_]]._type == 8)
- {
- var _loc3_ = 0;
- while(_loc3_ < this.arrBulletBusters.length)
- {
- if(this.arrBulletBusters[_loc3_] == strName)
- {
- this.arrBulletBusters.splice(_loc3_,1);
- break;
- }
- _loc3_ = _loc3_ + 1;
- }
- }
- this.arrBullets.splice(_loc4_,1);
- break;
- }
- _loc4_ = _loc4_ + 1;
- }
- }
- function CleanupBullets()
- {
- var _loc3_ = 0;
- while(_loc3_ < this.arrBullets.length)
- {
- if(_root[this.arrBullets[_loc3_]]._type == 8)
- {
- _root[this.arrBullets[_loc3_]].CleanupBusted();
- }
- _root[this.arrBullets[_loc3_]].removeMovieClip();
- _loc3_ = _loc3_ + 1;
- }
- delete this.arrBullets;
- this.arrBullets = new Array();
- }
- function DropPickupBubbles(num2Drop, origin, myPower, myType)
- {
- var _loc4_ = 0;
- while(_loc4_ < num2Drop)
- {
- var _loc3_ = "pickup_bubbles_" + this.arrFloatingBubblesDepth;
- this.arrFloatingBubbles.push(_loc3_);
- if(myType == 3)
- {
- _root.attachMovie("pickup_bubble_ultra",_loc3_,this.arrFloatingBubblesDepth);
- }
- else if(myType == 2)
- {
- _root.attachMovie("pickup_bubble_large",_loc3_,this.arrFloatingBubblesDepth);
- }
- else
- {
- _root.attachMovie("pickup_bubble",_loc3_,this.arrFloatingBubblesDepth);
- }
- _root[_loc3_]._x = origin._x;
- _root[_loc3_]._y = origin._y;
- _root[_loc3_].DetermineRandomMovement(myPower);
- this.arrFloatingBubblesDepth = this.arrFloatingBubblesDepth + 1;
- if(this.arrFloatingBubblesDepth == 899)
- {
- this.arrFloatingBubblesDepth = 700;
- }
- _loc4_ = _loc4_ + 1;
- }
- }
- function LeachPickupBubbles(origin)
- {
- var _loc3_ = "pickup_bubbles_" + this.arrFloatingBubblesDepth;
- this.arrFloatingBubbles.push(_loc3_);
- _root.attachMovie("pickup_bubble",_loc3_,this.arrFloatingBubblesDepth);
- _root[_loc3_]._x = origin._x;
- _root[_loc3_]._y = origin._y;
- _root[_loc3_]._type = 2;
- this.arrFloatingBubblesDepth = this.arrFloatingBubblesDepth + 1;
- if(this.arrFloatingBubblesDepth == 899)
- {
- this.arrFloatingBubblesDepth = 700;
- }
- }
- function MovePickupBubbles(dirVector)
- {
- var _loc3_ = 0;
- while(_loc3_ < this.arrFloatingBubbles.length)
- {
- _root[this.arrFloatingBubbles[_loc3_]]._x += dirVector._x;
- _root[this.arrFloatingBubbles[_loc3_]]._y += dirVector._y;
- _loc3_ = _loc3_ + 1;
- }
- }
- function CleanPickupBubbles()
- {
- var _loc3_ = 0;
- while(_loc3_ < this.arrFloatingBubbles.length)
- {
- _root[this.arrFloatingBubbles[_loc3_]].removeMovieClip();
- _loc3_ = _loc3_ + 1;
- }
- delete this.arrFloatingBubbles;
- this.arrFloatingBubbles = new Array();
- }
- function GetBubbleDistance(myName)
- {
- var _loc3_ = _root[myName]._x - _root.avatar._x;
- var _loc2_ = _root[myName]._y - _root.avatar._y;
- return Math.sqrt(_loc3_ * _loc3_ + _loc2_ * _loc2_);
- }
- function CheckPickupBubbleCollection()
- {
- var _loc10_ = 6;
- var _loc6_ = 0;
- while(_loc6_ < this.arrFloatingBubbles.length)
- {
- var _loc5_ = this.GetBubbleDistance(this.arrFloatingBubbles[_loc6_]);
- var _loc4_ = _root.avatar._width + 30;
- if(this.blnEnemiesCleared == true)
- {
- _loc4_ = _root.bg.inside._width + 25;
- _loc10_ = 10;
- }
- if(_root[this.arrFloatingBubbles[_loc6_]]._type == 2)
- {
- _loc4_ = _root.bg.inside._width;
- }
- if(_loc5_ <= _loc4_)
- {
- var _loc9_ = (_loc4_ - _loc5_) / _loc4_ * _loc10_;
- var _loc7_ = new Vector();
- _loc7_._x = (_root[this.arrFloatingBubbles[_loc6_]]._x - _root.avatar._x) / _loc5_ * _loc9_;
- _loc7_._y = (_root[this.arrFloatingBubbles[_loc6_]]._y - _root.avatar._y) / _loc5_ * _loc9_;
- _root[this.arrFloatingBubbles[_loc6_]]._x -= _loc7_._x;
- _root[this.arrFloatingBubbles[_loc6_]]._y -= _loc7_._y;
- }
- _loc6_ = _loc6_ + 1;
- }
- var _loc8_ = new Array();
- var _loc11_ = false;
- _loc6_ = 0;
- while(_loc6_ < this.arrFloatingBubbles.length)
- {
- if(_root.avatar.hitTest(_root[this.arrFloatingBubbles[_loc6_]]._x,_root[this.arrFloatingBubbles[_loc6_]]._y,true))
- {
- this.avatarLife.Set(this.avatarLife.Get() + _root[this.arrFloatingBubbles[_loc6_]]._amount);
- if(this.avatarLife.Get() > this.maxAvatarLife)
- {
- this.maxAvatarLife = this.avatarLife.Get();
- }
- _loc8_.push(this.arrFloatingBubbles[_loc6_]);
- _loc11_ = true;
- this.blnLifeFlag = true;
- this.intBubblesCollected = this.intBubblesCollected + 1;
- _global.SoundManager.PlayBubbleSound("collect_2");
- }
- _loc6_ = _loc6_ + 1;
- }
- if(_loc11_ == true)
- {
- this.CheckUpgradeState();
- }
- _loc6_ = 0;
- while(_loc6_ < _loc8_.length)
- {
- this.RemovePickupBubble(_loc8_[_loc6_]);
- _root[_loc8_[_loc6_]].removeMovieClip();
- _loc6_ = _loc6_ + 1;
- }
- }
- function RemovePickupBubble(strName)
- {
- var _loc2_ = 0;
- while(_loc2_ < this.arrFloatingBubbles.length)
- {
- if(strName == this.arrFloatingBubbles[_loc2_])
- {
- this.arrFloatingBubbles.splice(_loc2_,1);
- break;
- }
- _loc2_ = _loc2_ + 1;
- }
- }
- function AvatarHit(numDamage)
- {
- if(this.transitionState == 0)
- {
- if(_global.invincible == false)
- {
- this.avatarLife.Set(this.avatarLife.Get() - Math.round(numDamage * 3));
- if(this.avatarLife.Get() > 0)
- {
- this.CheckUpgradeState();
- }
- if(this.avatarLife.Get() <= 0)
- {
- this.avatarLife.Set(1);
- this.CheckUpgradeState();
- _global.SoundManager.PlaySound("dead");
- this.EjectFromBubblefield();
- }
- }
- }
- }
- function CheckBulletCollision()
- {
- var _loc4_ = new Array();
- var _loc7_ = new Array();
- var _loc6_ = 0;
- while(_loc6_ < this.arrBullets.length)
- {
- if(_root[this.arrBullets[_loc6_]]._enemy == false)
- {
- if(_root[this.arrBullets[_loc6_]]._type != 8)
- {
- if(this.world.current.CheckForHits(this.arrBullets[_loc6_]))
- {
- _global.SoundManager.PlaySound("hit");
- _loc4_.push(this.arrBullets[_loc6_]);
- }
- }
- }
- else
- {
- if(this.transitionState == 0)
- {
- if(this.intAssembledState == 0)
- {
- var _loc9_ = true;
- if(this.intShieldCounter > 0)
- {
- var _loc8_ = new Vector();
- _loc8_._x = _root[this.arrBullets[_loc6_]]._x - _root.avatar._x;
- _loc8_._y = _root[this.arrBullets[_loc6_]]._y - _root.avatar._y;
- var _loc12_ = _loc8_.GetLength();
- if(_loc12_ <= this.intShieldWidth)
- {
- var _loc13_ = _loc8_.GetAngle();
- var _loc10_ = new Vector();
- _loc10_._x = 250;
- _loc10_._y = 200;
- _root[this.CreateEffect("shieldHit",_loc10_,true,"avatar")]._rotation = _loc13_;
- _loc4_.push(this.arrBullets[_loc6_]);
- _loc9_ = false;
- }
- }
- if(_loc9_ == true)
- {
- if(_root.avatar.hitTest(_root[this.arrBullets[_loc6_]]._x,_root[this.arrBullets[_loc6_]]._y,true))
- {
- if(this.arrBullets[_loc6_].substr(1,11) == "enemySticky")
- {
- this.stickyCounter = 160;
- _root.avatar.gun.effects.gotoAndStop("sticky");
- }
- if(_global.invincible == false)
- {
- var _loc11_ = _root[this.arrBullets[_loc6_]]._damage;
- if(this.upgradePath.currentNode.nodeData._turnMode == 2)
- {
- _loc11_ = Math.round(_loc11_ * 0.3);
- }
- this.avatarLife.Set(this.avatarLife.Get() - _loc11_);
- }
- if(this.avatarLife.Get() > 0)
- {
- this.CheckUpgradeState();
- }
- if(this.avatarLife.Get() <= 0)
- {
- this.avatarLife.Set(1);
- this.CheckUpgradeState();
- _global.SoundManager.PlaySound("dead");
- this.EjectFromBubblefield();
- _loc4_.push(this.arrBullets[_loc6_]);
- break;
- }
- _global.SoundManager.PlaySound("avatar_hit");
- _loc4_.push(this.arrBullets[_loc6_]);
- }
- }
- }
- }
- if(_loc9_ == true)
- {
- var _loc5_ = 0;
- while(_loc5_ < this.arrAllySeekers.length)
- {
- if(_root[this.arrAllySeekers[_loc5_].name].hitTest(_root[this.arrBullets[_loc6_]]._x,_root[this.arrBullets[_loc6_]]._y,true))
- {
- _root[this.arrAllySeekers[_loc5_].name].removeMovieClip();
- this.arrAllySeekers.splice(_loc5_,1);
- _loc5_ = _loc5_ - 1;
- _loc4_.push(this.arrBullets[_loc6_]);
- }
- _loc5_ = _loc5_ + 1;
- }
- if(_root[this.arrBullets[_loc6_]]._type != 8)
- {
- _loc5_ = 0;
- while(_loc5_ < this.arrBulletBusters.length)
- {
- if(_root[this.arrBulletBusters[_loc5_]].hitTest(_root[this.arrBullets[_loc6_]]._x,_root[this.arrBullets[_loc6_]]._y,true))
- {
- _root[this.arrBulletBusters[_loc5_]].AddBusted(this.arrBullets[_loc6_]);
- _loc7_.push(this.arrBullets[_loc6_]);
- }
- else if(_root[this.arrBulletBusters[_loc5_]].hitTest(_root[this.arrBullets[_loc6_]].halfX,_root[this.arrBullets[_loc6_]].halfY,true))
- {
- _root[this.arrBulletBusters[_loc5_]].AddBusted(this.arrBullets[_loc6_]);
- _loc7_.push(this.arrBullets[_loc6_]);
- }
- _loc5_ = _loc5_ + 1;
- }
- }
- }
- }
- _loc6_ = _loc6_ + 1;
- }
- _loc6_ = 0;
- while(_loc6_ < _loc7_.length)
- {
- this.RemoveBullet(_loc7_[_loc6_]);
- _loc6_ = _loc6_ + 1;
- }
- _loc6_ = 0;
- while(_loc6_ < _loc4_.length)
- {
- if(_root[_loc4_[_loc6_]]._type != 2 && _root[_loc4_[_loc6_]]._type != 6 && _root[_loc4_[_loc6_]]._type != 7)
- {
- _root[_loc4_[_loc6_]]._holdMovement = true;
- _root[_loc4_[_loc6_]].gotoAndPlay("hit");
- this.AddToCleanup(_loc4_[_loc6_]);
- this.RemoveBullet(_loc4_[_loc6_]);
- }
- else
- {
- this.Effect_PierceExplosion(_root[_loc4_[_loc6_]]._x,_root[_loc4_[_loc6_]]._y);
- _root[_loc4_[_loc6_]]._damage -= 1;
- if(_root[_loc4_[_loc6_]]._damage < 1)
- {
- _root[_loc4_[_loc6_]]._damage = 1;
- }
- }
- _loc6_ = _loc6_ + 1;
- }
- }
- function EjectFromBubblefield()
- {
- var _loc5_ = 4;
- var _loc6_ = undefined;
- var _loc3_ = undefined;
- var _loc10_ = this.world.GetUp(false);
- var _loc9_ = this.world.GetLeft(false);
- var _loc7_ = this.world.GetDown(false);
- var _loc8_ = this.world.GetRight(false);
- _loc3_ = this.world.GetUp(true);
- _loc6_ = _loc3_.EstimateDifficulty();
- _loc3_ = this.world.GetLeft(true);
- if(_loc3_.EstimateDifficulty() < _loc6_)
- {
- _loc6_ = _loc3_.EstimateDifficulty();
- _loc5_ = 3;
- }
- _loc3_ = this.world.GetDown(true);
- if(_loc3_.EstimateDifficulty() < _loc6_)
- {
- _loc6_ = _loc3_.EstimateDifficulty();
- _loc5_ = 2;
- }
- _loc3_ = this.world.GetRight(true);
- if(_loc3_.EstimateDifficulty() < _loc6_)
- {
- _loc6_ = _loc3_.EstimateDifficulty();
- _loc5_ = 1;
- }
- var _loc2_ = new Vector();
- var _loc4_ = undefined;
- if(_loc5_ == 4)
- {
- if(_loc10_ == undefined)
- {
- _loc4_ = true;
- }
- else
- {
- _loc4_ = false;
- }
- this.world.MoveUp();
- _loc2_._y = -1147.6;
- this.world.current.ShowAllUnits(_loc2_);
- if(this.world.current.blnBoss == true)
- {
- this.ShowBoss(_loc2_);
- }
- this.MoveAvatarToBubble("destTop");
- this.transitionState = 4;
- }
- else if(_loc5_ == 3)
- {
- if(_loc9_ == undefined)
- {
- _loc4_ = true;
- }
- else
- {
- _loc4_ = false;
- }
- this.world.MoveLeft();
- _loc2_._x = -1147.6;
- this.world.current.ShowAllUnits(_loc2_);
- if(this.world.current.blnBoss == true)
- {
- this.ShowBoss(_loc2_);
- }
- this.MoveAvatarToBubble("destLeft");
- this.transitionState = 3;
- }
- else if(_loc5_ == 2)
- {
- if(_loc7_ == undefined)
- {
- _loc4_ = true;
- }
- else
- {
- _loc4_ = false;
- }
- this.world.MoveDown();
- _loc2_._y = 1147.6;
- this.world.current.ShowAllUnits(_loc2_);
- if(this.world.current.blnBoss == true)
- {
- this.ShowBoss(_loc2_);
- }
- this.MoveAvatarToBubble("destBottom");
- this.transitionState = 2;
- }
- else if(_loc5_ == 1)
- {
- if(_loc8_ == undefined)
- {
- _loc4_ = true;
- }
- else
- {
- _loc4_ = false;
- }
- this.world.MoveRight();
- _loc2_._x = 1147.6;
- this.world.current.ShowAllUnits(_loc2_);
- if(this.world.current.blnBoss == true)
- {
- this.ShowBoss(_loc2_);
- }
- this.MoveAvatarToBubble("destRight");
- this.transitionState = 1;
- }
- this.arrMap.push({xloc:this.world.x,yloc:this.world.y,blnCreate:_loc4_,blnBoss:false});
- }
- function AddToCleanup(myName)
- {
- this.arrCleanup.push({name:myName,counter:6});
- }
- function DoCleanup()
- {
- var _loc4_ = new Array();
- var _loc3_ = 0;
- while(_loc3_ < this.arrCleanup.length)
- {
- this.arrCleanup[_loc3_].counter--;
- if(this.arrCleanup[_loc3_].counter == 0)
- {
- _loc4_.push(this.arrCleanup[_loc3_].name);
- }
- _loc3_ = _loc3_ + 1;
- }
- _loc3_ = 0;
- while(_loc3_ < _loc4_.length)
- {
- _root[_loc4_[_loc3_]].removeMovieClip();
- this.RemoveCleanupItem(_loc4_[_loc3_]);
- _loc3_ = _loc3_ + 1;
- }
- }
- function RemoveCleanupItem(strName)
- {
- var _loc2_ = 0;
- while(_loc2_ < this.arrCleanup.length)
- {
- if(strName == this.arrCleanup[_loc2_].name)
- {
- this.arrCleanup.splice(_loc2_,1);
- break;
- }
- _loc2_ = _loc2_ + 1;
- }
- }
- function MoveWorld(vecMove)
- {
- vecMove._x = Math.round(vecMove._x);
- vecMove._y = Math.round(vecMove._y);
- _root.bg._x += vecMove._x;
- _root.bg._y += vecMove._y;
- _root.bubbleSplit._x += vecMove._x;
- _root.bubbleSplit._y += vecMove._y;
- _root.bubbleMask._x += vecMove._x;
- _root.bubbleMask._y += vecMove._y;
- _root.effectMask_mc._x += vecMove._x;
- _root.effectMask_mc._y += vecMove._y;
- _root.overlay._x += vecMove._x;
- _root.overlay._y += vecMove._y;
- this.world.current.MoveAllBubblefieldUnits(vecMove);
- var _loc4_ = 0;
- while(_loc4_ < this.arrBullets.length)
- {
- _root[this.arrBullets[_loc4_]]._x += vecMove._x;
- _root[this.arrBullets[_loc4_]]._y += vecMove._y;
- if(_root[this.arrBullets[_loc4_]]._type == 8)
- {
- _root[this.arrBullets[_loc4_]].MoveBusted(vecMove);
- }
- _loc4_ = _loc4_ + 1;
- }
- _loc4_ = 0;
- while(_loc4_ < this.arrAllySeekers.length)
- {
- if(_root[this.arrAllySeekers[_loc4_].name]._type != 2)
- {
- _root[this.arrAllySeekers[_loc4_].name]._x += vecMove._x;
- _root[this.arrAllySeekers[_loc4_].name]._y += vecMove._y;
- }
- else if(_root[this.arrAllySeekers[_loc4_].name].intState != 2)
- {
- _root[this.arrAllySeekers[_loc4_].name]._x += vecMove._x;
- _root[this.arrAllySeekers[_loc4_].name]._y += vecMove._y;
- }
- _loc4_ = _loc4_ + 1;
- }
- if(this.intAssembledState == 2)
- {
- _loc4_ = 1;
- while(_loc4_ < 20)
- {
- if(_loc4_ != 6)
- {
- var _loc5_ = _loc4_ + "_mc";
- _root[_loc5_]._x += vecMove._x;
- _root[_loc5_]._y += vecMove._y;
- }
- _loc4_ = _loc4_ + 1;
- }
- }
- this.MovePickupBubbles(vecMove);
- this.MoveEffects(vecMove);
- }
- function BackgroundShift(vecMove)
- {
- vecMove._x = Math.round(vecMove._x);
- vecMove._y = Math.round(vecMove._y);
- _root.bg._x += vecMove._x;
- _root.bg._y += vecMove._y;
- _root.bubbleSplit._x += vecMove._x;
- _root.bubbleSplit._y += vecMove._y;
- _root.bubbleMask._x += vecMove._x;
- _root.bubbleMask._y += vecMove._y;
- _root.effectMask_mc._x += vecMove._x;
- _root.effectMask_mc._y += vecMove._y;
- _root.overlay._x += vecMove._x;
- _root.overlay._y += vecMove._y;
- }
- function PrintVector(myName, vecMe)
- {
- }
- function EnemyDead(myName)
- {
- var _loc4_ = this.world.current.GetUnitType(myName);
- if(_root[myName]._type == 1)
- {
- this.intEnemiesKilled = this.intEnemiesKilled + 1;
- }
- if(_root[myName]._type == 1)
- {
- this.kongEnemiesKilledThisGame.Set(this.kongEnemiesKilledThisGame.Get() + 1);
- if(_global.gameMode == 1)
- {
- if(_loc4_ == "Enemy_97")
- {
- this.kongDestroyerKilledThisGame.Set(this.kongDestroyerKilledThisGame.Get() + 1);
- _root.kongregateStats.submit("MaxDestroyerKillsInAGame",this.kongDestroyerKilledThisGame.Get());
- }
- else if(_loc4_ == "Enemy_90")
- {
- this.kongTriGuardianKilledThisGame.Set(this.kongTriGuardianKilledThisGame.Get() + 1);
- _root.kongregateStats.submit("MaxTriGuardianKillsInAGame",this.kongTriGuardianKilledThisGame.Get());
- }
- else if(_loc4_ == "Enemy_86")
- {
- this.kongSpawnCarrierKilledThisGame.Set(this.kongSpawnCarrierKilledThisGame.Get() + 1);
- _root.kongregateStats.submit("MaxSpawnCarrierKillsInAGame",this.kongSpawnCarrierKilledThisGame.Get());
- }
- else if(_loc4_ == "Enemy_14")
- {
- this.kongBFTKilledThisGame.Set(this.kongBFTKilledThisGame.Get() + 1);
- _root.kongregateStats.submit("MaxBFTKillsInAGame",this.kongBFTKilledThisGame.Get());
- }
- if(_loc4_ == "Enemy_97" || _loc4_ == "Enemy_90" || _loc4_ == "Enemy_86" || _loc4_ == "Enemy_14")
- {
- this.kongBigEnemiesKilledThisGame.Set(this.kongBigEnemiesKilledThisGame.Get() + 1);
- _root.kongregateStats.submit("MaxBigKillsInAGame",this.kongBigEnemiesKilledThisGame.Get());
- }
- this.kongBlnRefresh = true;
- }
- }
- _global.SoundManager.PlaySound("small_death");
- this.CheckListAndAdd(_loc4_);
- this.world.current.RemoveUnit(myName);
- if(_global.gameMode == 2)
- {
- if(this.world.current.GetNumUnits() == 0)
- {
- this.CompleteArena();
- }
- }
- else if(this.world.current.GetNumUnits() == 0)
- {
- this.blnEnemiesCleared = true;
- if(this.world.current.blnBoss == true)
- {
- this.intWinFlag = 74;
- this.intBossState = 4;
- _root.bg.boss_mc.gotoAndPlay("deathAnim");
- }
- }
- }
- function CheckTankExit()
- {
- var _loc4_ = 0;
- if(this.GetDistance() > _root.bg.inside._width / 2)
- {
- _loc4_ = this.GetAngle();
- _root.bubbleSplit.gotoAndPlay("show");
- _root.bubbleSplit._rotation = _loc4_;
- var _loc3_ = new Vector();
- var _loc6_ = undefined;
- var _loc5_ = undefined;
- if(_loc4_ < -45 && _loc4_ > -135)
- {
- _loc6_ = this.world.GetUp(false);
- if(_loc6_ == undefined)
- {
- _loc5_ = true;
- }
- else
- {
- _loc5_ = false;
- }
- this.world.MoveUp();
- _loc3_._y = -1147.6;
- this.world.current.ShowAllUnits(_loc3_);
- if(this.world.current.blnBoss == true)
- {
- this.ShowBoss(_loc3_);
- }
- this.MoveAvatarToBubble("destTop");
- this.transitionState = 4;
- }
- else if(_loc4_ <= -135 && _loc4_ >= -180 || _loc4_ >= 135 && _loc4_ <= 180)
- {
- _loc6_ = this.world.GetLeft(false);
- if(_loc6_ == undefined)
- {
- _loc5_ = true;
- }
- else
- {
- _loc5_ = false;
- }
- this.world.MoveLeft();
- _loc3_._x = -1147.6;
- this.world.current.ShowAllUnits(_loc3_);
- if(this.world.current.blnBoss == true)
- {
- this.ShowBoss(_loc3_);
- }
- this.MoveAvatarToBubble("destLeft");
- this.transitionState = 3;
- }
- else if(_loc4_ < 135 && _loc4_ > 45)
- {
- _loc6_ = this.world.GetDown(false);
- if(_loc6_ == undefined)
- {
- _loc5_ = true;
- }
- else
- {
- _loc5_ = false;
- }
- this.world.MoveDown();
- _loc3_._y = 1147.6;
- this.world.current.ShowAllUnits(_loc3_);
- if(this.world.current.blnBoss == true)
- {
- this.ShowBoss(_loc3_);
- }
- this.MoveAvatarToBubble("destBottom");
- this.transitionState = 2;
- }
- else
- {
- _loc6_ = this.world.GetRight(false);
- if(_loc6_ == undefined)
- {
- _loc5_ = true;
- }
- else
- {
- _loc5_ = false;
- }
- this.world.MoveRight();
- _loc3_._x = 1147.6;
- this.world.current.ShowAllUnits(_loc3_);
- if(this.world.current.blnBoss == true)
- {
- this.ShowBoss(_loc3_);
- }
- this.MoveAvatarToBubble("destRight");
- this.transitionState = 1;
- }
- this.arrMap.push({xloc:this.world.x,yloc:this.world.y,blnCreate:_loc5_,blnBoss:false});
- }
- }
- function GetDistance()
- {
- var _loc3_ = _root.avatar._x - _root.bg._x;
- var _loc2_ = _root.avatar._y - _root.bg._y;
- return Math.sqrt(_loc3_ * _loc3_ + _loc2_ * _loc2_);
- }
- function GetAngle()
- {
- var _loc2_ = new Vector();
- _loc2_._x = _root.avatar._x - _root.bg._x;
- _loc2_._y = _root.avatar._y - _root.bg._y;
- var _loc3_ = Math.atan2(_loc2_._y,_loc2_._x);
- var _loc4_ = 360 * _loc3_ / 6.283185307179586;
- return _loc4_;
- }
- function MoveAvatarToBubble(bubbleDest)
- {
- if(this.runOnce == false)
- {
- this.intTotalFrames = 35;
- this.easeFrames = 35;
- var ref = eval("_root.bg." + bubbleDest);
- var myPoint = {x:ref._x,y:ref._y};
- _root.bg.localToGlobal(myPoint);
- this.dblDestX = myPoint.x;
- this.dblDestY = myPoint.y;
- this.BuildPointList();
- this.vecMomentum._x = 0;
- this.vecMomentum._y = 0;
- this.runOnce = true;
- }
- }
- function MoveAvatar()
- {
- var _loc6_ = new Vector();
- var _loc4_ = this.upgradePath.currentNode.nodeData._speed;
- if(this.stickyCounter > 0)
- {
- _loc4_ = 1;
- }
- var _loc5_ = _loc4_;
- if(_loc5_ < 1)
- {
- _loc5_ == 1;
- }
- if(Key.isDown(_global.avatarRight) && !Key.isDown(_global.avatarLeft))
- {
- this.vecMomentum._x += this.numSensitivity * _loc5_;
- if(this.vecMomentum._x > this.numAvatarMaxVelocity * _loc4_)
- {
- this.vecMomentum._x = this.numAvatarMaxVelocity * _loc4_;
- }
- }
- if(Key.isDown(_global.avatarLeft) && !Key.isDown(_global.avatarRight))
- {
- this.vecMomentum._x -= this.numSensitivity * _loc5_;
- if(this.vecMomentum._x < this.numAvatarMaxVelocity * _loc4_ * -1)
- {
- this.vecMomentum._x = this.numAvatarMaxVelocity * _loc4_ * -1;
- }
- }
- if(Key.isDown(_global.avatarDown) && !Key.isDown(_global.avatarUp))
- {
- this.vecMomentum._y += this.numSensitivity * _loc5_;
- if(this.vecMomentum._y > this.numAvatarMaxVelocity * _loc4_)
- {
- this.vecMomentum._y = this.numAvatarMaxVelocity * _loc4_;
- }
- }
- if(Key.isDown(_global.avatarUp) && !Key.isDown(_global.avatarDown))
- {
- this.vecMomentum._y -= this.numSensitivity * _loc5_;
- if(this.vecMomentum._y < this.numAvatarMaxVelocity * _loc4_ * -1)
- {
- this.vecMomentum._y = this.numAvatarMaxVelocity * _loc4_ * -1;
- }
- }
- if(!Key.isDown(_global.avatarLeft) && !Key.isDown(_global.avatarRight))
- {
- if(this.vecMomentum._x > 0)
- {
- this.vecMomentum._x -= this.numResistence * _loc5_;
- }
- if(this.vecMomentum._x < 0)
- {
- this.vecMomentum._x += this.numResistence * _loc5_;
- }
- if(this.vecMomentum._x >= -0.3 && this.vecMomentum._x <= 0.3)
- {
- this.vecMomentum._x = 0;
- }
- }
- if(!Key.isDown(_global.avatarUp) && !Key.isDown(_global.avatarDown))
- {
- if(this.vecMomentum._y > 0)
- {
- this.vecMomentum._y -= this.numResistence * _loc5_;
- }
- if(this.vecMomentum._y < 0)
- {
- this.vecMomentum._y += this.numResistence * _loc5_;
- }
- if(this.vecMomentum._y >= -0.3 && this.vecMomentum._y <= 0.3)
- {
- this.vecMomentum._y = 0;
- }
- }
- this.RotateTank();
- _loc6_._x = this.vecMomentum._x * -1;
- _loc6_._y = this.vecMomentum._y * -1;
- if(this.stickyCounter > 0)
- {
- this.stickyCounter = this.stickyCounter - 1;
- if(this.stickyCounter == 0)
- {
- _root.avatar.gun.effects.gotoAndStop(1);
- this.vecMomentum._x = _loc6_._x * 0.1 * -1;
- this.vecMomentum._y = _loc6_._y * 0.1 * -1;
- }
- else
- {
- _loc6_._x *= 0.1;
- _loc6_._y *= 0.1;
- }
- }
- return _loc6_;
- }
- function RotateTank()
- {
- if(this.vecMomentum._x != 0 || this.vecMomentum._y != 0)
- {
- var _loc3_ = Math.atan2(this.vecMomentum._y,this.vecMomentum._x);
- var _loc4_ = 360 * _loc3_ / 6.283185307179586;
- _root.avatar.bottom._rotation = _loc4_;
- }
- }
- function RotateGun()
- {
- if(this.upgradePath.currentNode.nodeData._turnMode == 2)
- {
- var _loc13_ = this.vecMomentum.AngleToAlign(_root.avatar.gun._rotation,this.vecMomentum.GetLength() / 2,0.5);
- if(this.stickyCounter > 0)
- {
- _loc13_ *= 0.1;
- }
- _root.avatar.gun._rotation += _loc13_;
- }
- else
- {
- var _loc3_ = new Vector();
- _loc3_._x = _xmouse - _root.avatar._x;
- _loc3_._y = _ymouse - _root.avatar._y;
- var _loc8_ = Math.atan2(_loc3_._y,_loc3_._x);
- var _loc9_ = 360 * _loc8_ / 6.283185307179586;
- _root.avatar.gun._rotation = _loc9_;
- }
- if(this.upgradePath.currentNode.nodeData._turnMode == 2)
- {
- var _loc4_ = 0;
- while(_loc4_ < this.upgradePath.currentNode.nodeData._arrPrimaryWeapons.length)
- {
- var _loc10_ = this.upgradePath.currentNode.nodeData._arrPrimaryWeapons[_loc4_].type;
- var _loc6_ = this.upgradePath.currentNode.nodeData._arrPrimaryWeapons[_loc4_].name;
- var _loc7_ = false;
- switch(_loc10_)
- {
- case 3:
- case 16:
- case 28:
- _loc7_ = true;
- break;
- default:
- _loc7_ = false;
- break;
- }
- if(_loc7_ == true)
- {
- var _loc5_ = {x:_root.avatar.gun[_loc6_]._x,y:_root.avatar.gun[_loc6_]._y};
- _root.avatar.gun.localToGlobal(_loc5_);
- _loc3_ = new Vector();
- _loc3_._x = _root._xmouse - _loc5_.x;
- _loc3_._y = _root._ymouse - _loc5_.y;
- _loc8_ = Math.atan2(_loc3_._y,_loc3_._x);
- _loc9_ = 360 * _loc8_ / 6.283185307179586;
- _root.avatar.gun[_loc6_]._rotation = _loc9_ - _root.avatar.gun._rotation;
- }
- _loc4_ = _loc4_ + 1;
- }
- _loc4_ = 0;
- while(_loc4_ < this.upgradePath.currentNode.nodeData._arrSecondaryWeapons.length)
- {
- _loc10_ = this.upgradePath.currentNode.nodeData._arrSecondaryWeapons[_loc4_].type;
- _loc6_ = this.upgradePath.currentNode.nodeData._arrSecondaryWeapons[_loc4_].name;
- _loc7_ = false;
- switch(_loc10_)
- {
- case 3:
- case 16:
- _loc7_ = true;
- break;
- default:
- _loc7_ = false;
- break;
- }
- if(_loc7_ == true)
- {
- _loc5_ = {x:_root.avatar.gun[_loc6_]._x,y:_root.avatar.gun[_loc6_]._y};
- _root.avatar.gun.localToGlobal(_loc5_);
- _loc3_ = new Vector();
- _loc3_._x = _root._xmouse - _loc5_.x;
- _loc3_._y = _root._ymouse - _loc5_.y;
- _loc8_ = Math.atan2(_loc3_._y,_loc3_._x);
- _loc9_ = 360 * _loc8_ / 6.283185307179586;
- _root.avatar.gun[_loc6_]._rotation = _loc9_ - _root.avatar.gun._rotation;
- }
- _loc4_ = _loc4_ + 1;
- }
- }
- }
- function ShootGun()
- {
- if(_global.gamePaused == false)
- {
- if(this.avatarLife.Get() >= 76 && this.avatarLife.Get() <= 200 && this.secondBulletCounter != 1)
- {
- this.secondBulletCounter = 3;
- }
- var thisRef = this;
- var _loc4_ = "avatarBullet_" + this.numBulletDepth;
- var _loc6_ = new Vector();
- _loc6_._x = Math.cos(3.141592653589793 * _root.avatar.gun._rotation / 180) * 10;
- _loc6_._y = Math.sin(3.141592653589793 * _root.avatar.gun._rotation / 180) * 10;
- var _loc5_ = {x:_root.avatar.gun.emitter._x,y:_root.avatar.gun.emitter._y};
- if(this.avatarLife.Get() >= 201 && this.avatarLife.Get() <= 370 || this.avatarLife.Get() >= 371)
- {
- _loc5_.x = _root.avatar.gun.emitter1._x;
- _loc5_.y = _root.avatar.gun.emitter1._y;
- }
- _root.avatar.gun.localToGlobal(_loc5_);
- _root.attachMovie("component_bubble_red",_loc4_,this.numBulletDepth);
- _root[_loc4_]._x = _loc5_.x;
- _root[_loc4_]._y = _loc5_.y;
- _root[_loc4_].SetMovement(_loc6_._x,_loc6_._y);
- _root[_loc4_]._enemy = false;
- this.numBulletDepth = this.numBulletDepth + 1;
- this.arrBullets.push(_loc4_);
- _global.SoundManager.PlaySound("shoot");
- _root[_loc4_].removeCallback = function(myName)
- {
- thisRef.RemoveBullet(myName);
- };
- if(this.avatarLife.Get() >= 201 && this.avatarLife.Get() <= 370)
- {
- _loc4_ = "avatarBullet_" + this.numBulletDepth;
- _loc5_.x = _root.avatar.gun.emitter2._x;
- _loc5_.y = _root.avatar.gun.emitter2._y;
- _root.avatar.gun.localToGlobal(_loc5_);
- _root.attachMovie("component_bubble_red",_loc4_,this.numBulletDepth);
- _root[_loc4_]._x = _loc5_.x;
- _root[_loc4_]._y = _loc5_.y;
- _root[_loc4_].SetMovement(_loc6_._x,_loc6_._y);
- _root[_loc4_]._enemy = false;
- this.numBulletDepth = this.numBulletDepth + 1;
- this.arrBullets.push(_loc4_);
- _root[_loc4_].removeCallback = function(myName)
- {
- thisRef.RemoveBullet(myName);
- };
- _loc4_ = "avatarBullet_" + this.numBulletDepth;
- _loc5_.x = _root.avatar.gun.emitter3._x;
- _loc5_.y = _root.avatar.gun.emitter3._y;
- _root.avatar.gun.localToGlobal(_loc5_);
- _root.attachMovie("component_bubble_red",_loc4_,this.numBulletDepth);
- _root[_loc4_]._x = _loc5_.x;
- _root[_loc4_]._y = _loc5_.y;
- _root[_loc4_].SetMovement(_loc6_._x,_loc6_._y);
- _root[_loc4_]._enemy = false;
- this.numBulletDepth = this.numBulletDepth + 1;
- this.arrBullets.push(_loc4_);
- _root[_loc4_].removeCallback = function(myName)
- {
- thisRef.RemoveBullet(myName);
- };
- }
- else if(this.avatarLife.Get() >= 371)
- {
- _loc4_ = "avatarBullet_" + this.numBulletDepth;
- _loc5_.x = _root.avatar.gun.emitter2._x;
- _loc5_.y = _root.avatar.gun.emitter2._y;
- _root.avatar.gun.localToGlobal(_loc5_);
- _root.attachMovie("component_bubble_red",_loc4_,this.numBulletDepth);
- _root[_loc4_]._x = _loc5_.x;
- _root[_loc4_]._y = _loc5_.y;
- _root[_loc4_]._xscale = 300;
- _root[_loc4_]._yscale = 300;
- _root[_loc4_]._damage = 8;
- _loc6_._x *= 0.5;
- _loc6_._y *= 0.5;
- _root[_loc4_].SetMovement(_loc6_._x,_loc6_._y);
- _root[_loc4_]._enemy = false;
- this.numBulletDepth = this.numBulletDepth + 1;
- this.arrBullets.push(_loc4_);
- _root[_loc4_].removeCallback = function(myName)
- {
- thisRef.RemoveBullet(myName);
- };
- }
- }
- }
- function MouseDown()
- {
- this.blnPrimaryActive = true;
- }
- function MouseUp()
- {
- this.blnPrimaryActive = false;
- }
- function OperateAvatarSecondaryWeapons()
- {
- if(this.intSecondaryCounter == 0)
- {
- var _loc3_ = 0;
- while(_loc3_ < this.upgradePath.currentNode.nodeData._arrSecondaryWeapons.length)
- {
- var _loc4_ = this.upgradePath.currentNode.nodeData._arrSecondaryWeapons[_loc3_].type;
- var _loc2_ = this.upgradePath.currentNode.nodeData._arrSecondaryWeapons[_loc3_].name;
- var _loc5_ = this.upgradePath.currentNode.nodeData._arrSecondaryWeapons[_loc3_].delay;
- switch(_loc4_)
- {
- case 6:
- this.Gun_Mines(_loc2_);
- break;
- case 8:
- this.Gun_Shield();
- break;
- case 10:
- this.Gun_Teleport();
- break;
- case 12:
- this.Gun_Seekers(_loc2_);
- break;
- case 14:
- this.Gun_ShortStun(_loc2_);
- break;
- case 15:
- this.Gun_DamageBurst(_loc2_);
- break;
- case 16:
- this.Gun_Sticky(_loc2_);
- break;
- case 19:
- this.Gun_StarBurst(_loc2_);
- break;
- case 21:
- this.Gun_AreaBurstCannon(_loc2_);
- break;
- case 22:
- this.Gun_StickyBurst(_loc2_);
- break;
- case 23:
- this.Gun_LargeStun(_loc2_);
- break;
- case 27:
- this.Gun_MassiveCannon(_loc2_);
- break;
- case 30:
- this.Gun_Infector(_loc2_);
- break;
- case 32:
- this.Gun_Convert(_loc2_);
- break;
- case 33:
- this.Gun_FighterBay(_loc2_);
- }
- this.intSecondaryCounter = _loc5_;
- _loc3_ = _loc3_ + 1;
- }
- this.blnFireRateFlag = true;
- }
- }
- function OperateAvatarWeapons()
- {
- if(this.intPrimaryCounter == 0)
- {
- if(this.intAssembledState == 0)
- {
- if(this.blnPrimaryActive == true)
- {
- var _loc2_ = 0;
- while(_loc2_ < this.upgradePath.currentNode.nodeData._arrPrimaryWeapons.length)
- {
- var _loc3_ = this.upgradePath.currentNode.nodeData._arrPrimaryWeapons[_loc2_].type;
- var _loc4_ = this.upgradePath.currentNode.nodeData._arrPrimaryWeapons[_loc2_].name;
- var _loc5_ = this.upgradePath.currentNode.nodeData._arrPrimaryWeapons[_loc2_].delay;
- switch(_loc3_)
- {
- case 1:
- this.Gun_BasicCannon(_loc4_);
- break;
- case 2:
- this.Gun_2Parallel(_loc4_);
- break;
- case 3:
- this.Gun_HeavyCannon(_loc4_);
- break;
- case 4:
- this.Gun_3Spread(_loc4_);
- break;
- case 5:
- this.Gun_3Parallel(_loc4_);
- break;
- case 7:
- this.Gun_5Parallel(_loc4_);
- break;
- case 9:
- this.Gun_PierceShot(_loc4_,1);
- break;
- case 11:
- this.Gun_UpgradedMachineGun(_loc4_);
- break;
- case 13:
- this.Gun_5Spread(_loc4_);
- break;
- case 18:
- this.Gun_PierceShot(_loc4_,2);
- break;
- case 20:
- this.Gun_2ParallelLargeMG(_loc4_);
- break;
- case 25:
- this.Gun_ExplosivePierceShot(_loc4_);
- break;
- case 28:
- this.Gun_BulletBuster(_loc4_);
- break;
- case 29:
- this.Gun_Leecher(_loc4_);
- break;
- case 31:
- this.Gun_Mitosis(_loc4_);
- }
- this.intPrimaryCounter = _loc5_;
- _loc2_ = _loc2_ + 1;
- }
- this.blnFireRateFlag = true;
- }
- }
- }
- else if(this.intPrimaryCounter > 0)
- {
- this.intPrimaryCounter = this.intPrimaryCounter - 1;
- }
- if(this.intSecondaryCounter > 0)
- {
- this.intSecondaryCounter = this.intSecondaryCounter - 1;
- }
- if(this.upgradePath.currentNode.nodeData._hasAutoGuns == true)
- {
- this.AimAvatarAutoWeapons();
- if(this.intAutoCounter > 0)
- {
- this.intAutoCounter = this.intAutoCounter - 1;
- }
- else if(this.intAutoCounter == 0)
- {
- this.FireAvatarAutoWeapons();
- }
- }
- _loc2_ = 0;
- while(_loc2_ < this.upgradePath.currentNode.nodeData._arrSecondaryWeapons.length)
- {
- _loc3_ = this.upgradePath.currentNode.nodeData._arrSecondaryWeapons[_loc2_].type;
- _loc4_ = this.upgradePath.currentNode.nodeData._arrSecondaryWeapons[_loc2_].name;
- _loc5_ = this.upgradePath.currentNode.nodeData._arrSecondaryWeapons[_loc2_].delay;
- if(_loc3_ === 26)
- {
- this.Manage_OrbitalSeekers(_loc2_);
- }
- _loc2_ = _loc2_ + 1;
- }
- if(this.intShieldCounter > 0)
- {
- this.intShieldCounter = this.intShieldCounter - 1;
- }
- }
- function AimAvatarAutoWeapons()
- {
- if(this.transitionState == 0)
- {
- var i = 0;
- while(i < this.upgradePath.currentNode.nodeData._arrPrimaryWeapons.length)
- {
- var gunType = this.upgradePath.currentNode.nodeData._arrPrimaryWeapons[i].type;
- var gunName = this.upgradePath.currentNode.nodeData._arrPrimaryWeapons[i].name;
- var gunDelay = this.upgradePath.currentNode.nodeData._arrPrimaryWeapons[i].delay;
- var blnIsAutoFire = false;
- if(gunType === 17)
- {
- blnIsAutoFire = true;
- }
- if(blnIsAutoFire == true)
- {
- var gunTarget = this.upgradePath.currentNode.nodeData._arrPrimaryWeapons[i].target;
- if(gunTarget != "")
- {
- var gunRef = eval("_root.avatar.gun." + gunName);
- var point = {x:gunRef._x,y:gunRef._y};
- _root.avatar.gun.localToGlobal(point);
- var bulletSpeed = 0;
- var _loc0_ = null;
- if((_loc0_ = gunType) !== 17)
- {
- bulletSpeed = 10;
- }
- else
- {
- bulletSpeed = 10;
- }
- var aimVector = new Vector();
- aimVector._x = _root[gunTarget]._x - point.x;
- aimVector._y = _root[gunTarget]._y - point.y;
- var aimPoint = _root[gunTarget].PredictTargetLocation(aimVector.GetLength(),bulletSpeed);
- aimVector._x = aimPoint.x - point.x;
- aimVector._y = aimPoint.y - point.y;
- _root.avatar.gun[gunName]._rotation = aimVector.GetAngle() - _root.avatar.gun._rotation;
- }
- }
- i++;
- }
- }
- }
- function FireAvatarAutoWeapons()
- {
- if(this.transitionState == 0)
- {
- var i = 0;
- while(i < this.upgradePath.currentNode.nodeData._arrPrimaryWeapons.length)
- {
- var gunType = this.upgradePath.currentNode.nodeData._arrPrimaryWeapons[i].type;
- var gunName = this.upgradePath.currentNode.nodeData._arrPrimaryWeapons[i].name;
- var gunDelay = this.upgradePath.currentNode.nodeData._arrPrimaryWeapons[i].delay;
- var blnIsAutoFire = false;
- if(gunType === 17)
- {
- blnIsAutoFire = true;
- }
- if(blnIsAutoFire == true)
- {
- var gunTarget = this.upgradePath.currentNode.nodeData._arrPrimaryWeapons[i].target;
- if(gunTarget != "")
- {
- if(gunType === 17)
- {
- this.Gun_SmallAutoCannon(gunName);
- }
- }
- var gunRef = eval("_root.avatar.gun." + gunName);
- var point = {x:gunRef._x,y:gunRef._y};
- gunRef._parent.localToGlobal(point);
- this.upgradePath.currentNode.nodeData._arrPrimaryWeapons[i].target = this.world.current.GetClosestUnit(point.x,point.y);
- this.intAutoCounter = gunDelay;
- }
- i++;
- }
- }
- }
- function Manage_OrbitalSeekers(gunIndex)
- {
- var gunType = this.upgradePath.currentNode.nodeData._arrSecondaryWeapons[gunIndex].type;
- var gunName = this.upgradePath.currentNode.nodeData._arrSecondaryWeapons[gunIndex].name;
- var gunDelay = this.upgradePath.currentNode.nodeData._arrSecondaryWeapons[gunIndex].delay;
- if(this.arrAllySeekers.length < 5)
- {
- if(this.intSecondaryCounter == 0)
- {
- var gunRef = eval("_root.avatar.gun." + gunName);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- var spawnedName = "avatarSeeker_" + this.numBulletDepth;
- _root.attachMovie("Ally_Orbital_Seeker",spawnedName,this.numBulletDepth);
- _root[spawnedName]._x = point.x;
- _root[spawnedName]._y = point.y;
- _root[spawnedName]._damage = 5;
- this.arrAllySeekers.push({name:spawnedName,from:gunName});
- this.numBulletDepth = this.numBulletDepth + 1;
- if(this.numBulletDepth > 105000)
- {
- this.numBulletDepth = 100000;
- }
- this.intSecondaryCounter = gunDelay;
- }
- }
- }
- function Gun_Shield()
- {
- var _loc2_ = new Vector();
- _loc2_._x = 250;
- _loc2_._y = 200;
- this.CreateEffect("shield_avatar",_loc2_,true,"avatar");
- this.intShieldCounter = 25;
- }
- function Gun_BasicCannon(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation,10,100,1);
- _global.SoundManager.PlaySound("shoot");
- }
- function Gun_SmallAutoCannon(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- var useRotation = _root.avatar.gun._rotation;
- useRotation += gunRef._rotation;
- this.AvatarFireBullet(vecStart,useRotation,10,100,1);
- }
- function Gun_UpgradedMachineGun(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation,11,100,2);
- _global.SoundManager.PlaySound("shoot");
- }
- function Gun_HeavyCannon(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- var useRotation = _root.avatar.gun._rotation;
- if(this.upgradePath.currentNode.nodeData._turnMode == 2)
- {
- useRotation += gunRef._rotation;
- }
- this.AvatarFireBullet(vecStart,useRotation,7.5,300,5);
- _global.SoundManager.PlaySound("shoot");
- }
- function Gun_MassiveCannon(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- gunRef.bullet_mc._visible = true;
- gunRef.bullet_mc.gotoAndPlay(2);
- }
- function Fire_MassiveCannon(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- this.FlashScreen();
- this.ShakeScreen(80);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- var bulletName = this.AvatarFireSpecialBullet(vecStart,_root.avatar.gun._rotation,10,100,90,"massive_bullet");
- _root[bulletName]._type = 7;
- _root[bulletName]._rotation = _root.avatar.gun._rotation;
- }
- function Gun_Sticky(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- var useRotation = _root.avatar.gun._rotation;
- if(this.upgradePath.currentNode.nodeData._turnMode == 2)
- {
- useRotation += gunRef._rotation;
- }
- var bulletName = this.AvatarFireSpecialBullet(vecStart,useRotation,7.5,100,0,"sticky");
- _root[bulletName]._type = 3;
- _global.SoundManager.PlaySound("shoot");
- }
- function Gun_StickyBurst(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- var useRotation = 0;
- while(useRotation < 360)
- {
- var bulletName = this.AvatarFireSpecialBullet(vecStart,useRotation,7.5,100,0,"sticky");
- _root[bulletName]._type = 3;
- useRotation += 10;
- }
- _global.SoundManager.PlaySound("shoot");
- }
- function Gun_AreaBurstCannon(myGunName, subType)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- var bulletName = this.AvatarFireSpecialBullet(vecStart,_root.avatar.gun._rotation,7,300,20,"component_bubble_orange_flashing");
- _root[bulletName]._type = 5;
- _global.SoundManager.PlaySound("shoot");
- }
- function Gun_StarBurst(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- var bulletName = this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation,7.5,200,15);
- _root[bulletName]._type = 4;
- _global.SoundManager.PlaySound("shoot");
- }
- function Gun_BulletBuster(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- var useRotation = _root.avatar.gun._rotation;
- if(this.upgradePath.currentNode.nodeData._turnMode == 2)
- {
- useRotation += gunRef._rotation;
- }
- var bulletName = this.AvatarFireSpecialBullet(vecStart,useRotation,10,100,0,"bullet_buster");
- _root[bulletName]._type = 8;
- this.arrBulletBusters.push(bulletName);
- _global.SoundManager.PlaySound("shoot");
- }
- function SpawnStartBurstShard(xLoc, yLoc, intRotation)
- {
- var _loc3_ = new Vector();
- _loc3_._x = xLoc;
- _loc3_._y = yLoc;
- var _loc4_ = this.AvatarFireSpecialBullet(_loc3_,intRotation,14,100,5,"sniper_bullet");
- _root[_loc4_]._rotation = intRotation;
- _root[_loc4_]._type = 2;
- }
- function Gun_Leecher(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- var bulletName = this.AvatarFireSpecialBullet(vecStart,_root.avatar.gun._rotation,10,100,8,"leecher_bullet");
- _root[bulletName]._rotation = _root.avatar.gun._rotation;
- _root[bulletName]._type = 9;
- _global.SoundManager.PlaySound("shoot");
- }
- function Gun_PierceShot(myGunName, subType)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- var intDamage = 0;
- if(subType == 1)
- {
- intDamage = 8;
- }
- else if(subType == 2)
- {
- intDamage = 14;
- }
- var bulletName = this.AvatarFireSpecialBullet(vecStart,_root.avatar.gun._rotation,14,100,intDamage,"sniper_bullet");
- _root[bulletName]._rotation = _root.avatar.gun._rotation;
- _root[bulletName]._type = 2;
- _global.SoundManager.PlaySound("shoot");
- }
- function Gun_ExplosivePierceShot(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- var bulletName = this.AvatarFireSpecialBullet(vecStart,_root.avatar.gun._rotation,14,100,25,"sniper_bullet");
- _root[bulletName]._rotation = _root.avatar.gun._rotation;
- _root[bulletName]._type = 6;
- _global.SoundManager.PlaySound("shoot");
- }
- function Gun_2Parallel(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter1._x,y:gunRef.emitter1._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation,10,100,1);
- point = {x:gunRef.emitter2._x,y:gunRef.emitter2._y};
- gunRef.localToGlobal(point);
- vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation,10,100,1);
- _global.SoundManager.PlaySound("shoot");
- }
- function Gun_2ParallelLargeMG(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter1._x,y:gunRef.emitter1._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation,9,200,2);
- point = {x:gunRef.emitter2._x,y:gunRef.emitter2._y};
- gunRef.localToGlobal(point);
- vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation,9,200,2);
- _global.SoundManager.PlaySound("shoot");
- }
- function Gun_3Spread(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter1._x,y:gunRef.emitter1._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation,10,100,1);
- var point = {x:gunRef.emitter2._x,y:gunRef.emitter2._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation - 30,10,100,1);
- var point = {x:gunRef.emitter3._x,y:gunRef.emitter3._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation + 30,10,100,1);
- _global.SoundManager.PlaySound("shoot");
- }
- function Gun_5Spread(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter1._x,y:gunRef.emitter1._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation - 20,10,100,1);
- var point = {x:gunRef.emitter2._x,y:gunRef.emitter2._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation - 10,10,100,1);
- var point = {x:gunRef.emitter3._x,y:gunRef.emitter3._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation,10,100,1);
- var point = {x:gunRef.emitter4._x,y:gunRef.emitter4._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation + 10,10,100,1);
- var point = {x:gunRef.emitter5._x,y:gunRef.emitter5._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation + 20,10,100,1);
- _global.SoundManager.PlaySound("shoot");
- }
- function Gun_3Parallel(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter1._x,y:gunRef.emitter1._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation,10,100,1);
- point = {x:gunRef.emitter2._x,y:gunRef.emitter2._y};
- gunRef.localToGlobal(point);
- vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation,10,100,1);
- point = {x:gunRef.emitter3._x,y:gunRef.emitter3._y};
- gunRef.localToGlobal(point);
- vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation,10,100,1);
- _global.SoundManager.PlaySound("shoot");
- }
- function Gun_5Parallel(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter1._x,y:gunRef.emitter1._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation,10,100,1);
- point = {x:gunRef.emitter2._x,y:gunRef.emitter2._y};
- gunRef.localToGlobal(point);
- vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation,10,100,1);
- point = {x:gunRef.emitter3._x,y:gunRef.emitter3._y};
- gunRef.localToGlobal(point);
- vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation,10,100,1);
- point = {x:gunRef.emitter4._x,y:gunRef.emitter4._y};
- gunRef.localToGlobal(point);
- vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation,10,100,1);
- point = {x:gunRef.emitter5._x,y:gunRef.emitter5._y};
- gunRef.localToGlobal(point);
- vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireBullet(vecStart,_root.avatar.gun._rotation,10,100,1);
- _global.SoundManager.PlaySound("shoot");
- }
- function Gun_Mines(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- var vecStart = new Vector();
- vecStart._x = point.x;
- vecStart._y = point.y;
- this.AvatarFireSpecialBullet(vecStart,_root.avatar.gun._rotation,0,100,8,"mine_2");
- _global.SoundManager.PlaySound("shoot");
- }
- function Gun_Teleport()
- {
- if(this.transitionState == 0)
- {
- var _loc3_ = new Vector();
- _loc3_._x = -1 * (_root._xmouse - _root.avatar._x);
- _loc3_._y = -1 * (_root._ymouse - _root.avatar._y);
- this.Effect_Teleport(_root.avatar._x,_root.avatar._y);
- this.FlashScreen();
- this.MoveWorld(_loc3_);
- }
- }
- function Gun_ShortStun(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- this.Effect_ShortStun(point.x,point.y);
- this.FlashScreen();
- this.ShakeScreen(20);
- var arrStunned = this.world.current.GetUnitsWithinDistance(point.x,point.y,125);
- var i = 0;
- while(i < arrStunned.length)
- {
- this.Effect_Stunned(_root[arrStunned[i]]._x,_root[arrStunned[i]]._y);
- _root[arrStunned[i]].Stun(120);
- i++;
- }
- }
- function Gun_LargeStun(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- this.Effect_LargeStun(point.x,point.y);
- this.FlashScreen();
- this.ShakeScreen(35);
- var arrStunned = this.world.current.GetUnitsWithinDistance(point.x,point.y,200);
- var i = 0;
- while(i < arrStunned.length)
- {
- this.Effect_Stunned(_root[arrStunned[i]]._x,_root[arrStunned[i]]._y);
- _root[arrStunned[i]].Stun(180);
- i++;
- }
- }
- function Gun_DamageBurst(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- this.DamageBurst(point.x,point.y,8);
- }
- function Gun_Convert(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- this.Effect_Convert(point.x,point.y);
- this.FlashScreen();
- this.ShakeScreen(60);
- this.world.current.ConvertDrones();
- }
- function SpawnSeeker(xloc, yloc, intDamage, intType)
- {
- var _loc3_ = "avatarSeeker_" + this.numBulletDepth;
- if(intType == 3)
- {
- _root.attachMovie("Ally_Orbital_Seeker",_loc3_,this.numBulletDepth);
- }
- else
- {
- _root.attachMovie("Ally_Seeker",_loc3_,this.numBulletDepth);
- }
- _root[_loc3_]._x = xloc;
- _root[_loc3_]._y = yloc;
- _root[_loc3_]._damage = intDamage;
- this.arrAllySeekers.push({name:_loc3_,from:""});
- this.numBulletDepth = this.numBulletDepth + 1;
- if(this.numBulletDepth > 105000)
- {
- this.numBulletDepth = 100000;
- }
- }
- function Gun_Seekers(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- var spawnedName = "avatarSeeker_" + this.numBulletDepth;
- _root.attachMovie("Ally_Seeker",spawnedName,this.numBulletDepth);
- _root[spawnedName]._x = point.x;
- _root[spawnedName]._y = point.y;
- _root[spawnedName]._damage = 10;
- this.arrAllySeekers.push({name:spawnedName,from:myGunName});
- this.numBulletDepth = this.numBulletDepth + 1;
- if(this.numBulletDepth > 105000)
- {
- this.numBulletDepth = 100000;
- }
- }
- function Gun_FighterBay(myGunName)
- {
- var blnFound = false;
- var i = 0;
- while(i < this.arrAllies.length)
- {
- if(_root[this.arrAllies[i]]._strCreatedBy == myGunName)
- {
- blnFound = true;
- break;
- }
- i++;
- }
- if(blnFound == false)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- this.SpawnFighter(point.x,point.y,gunRef._rotation,myGunName);
- }
- }
- function SpawnFighter(xloc, yloc, intRotation, myGunName)
- {
- var _loc3_ = "ally_" + this.numAllyDepth;
- _root.attachMovie("Ally_Fighter",_loc3_,this.numAllyDepth);
- _root[_loc3_]._x = xloc;
- _root[_loc3_]._y = yloc;
- _root[_loc3_]._rotation = intRotation;
- _root[_loc3_]._strCreatedBy = myGunName;
- this.arrAllies.push(_loc3_);
- this.numAllyDepth = this.numAllyDepth + 1;
- if(this.numAllyDepth > 600)
- {
- this.numAllyDepth = 560;
- }
- }
- function CleanAllies()
- {
- var _loc4_ = this.arrAllies.slice();
- var _loc3_ = 0;
- while(_loc3_ < _loc4_.length)
- {
- _root[_loc4_[_loc3_]].Dock();
- _loc3_ = _loc3_ + 1;
- }
- }
- function PauseAllies()
- {
- var _loc3_ = 0;
- while(_loc3_ < this.arrAllies.length)
- {
- _root[this.arrAllies[_loc3_]].TurnOff();
- _loc3_ = _loc3_ + 1;
- }
- }
- function UnPauseAllies()
- {
- var _loc3_ = 0;
- while(_loc3_ < this.arrAllies.length)
- {
- _root[this.arrAllies[_loc3_]].TurnOn();
- _loc3_ = _loc3_ + 1;
- }
- }
- function Gun_Mitosis(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- this.SpawnMitosis(point.x,point.y,3);
- _global.SoundManager.PlaySound("shoot");
- }
- function SpawnMitosis(xloc, yloc, round)
- {
- var _loc3_ = "avatarSeeker_" + this.numBulletDepth;
- _root.attachMovie("Ally_Mitosis",_loc3_,this.numBulletDepth);
- _root[_loc3_]._x = xloc;
- _root[_loc3_]._y = yloc;
- _root[_loc3_]._damage = 12;
- _root[_loc3_].intRound = round;
- var _loc4_ = 100;
- switch(round)
- {
- case 3:
- _loc4_ = 125;
- break;
- case 2:
- _loc4_ = 100;
- break;
- case 1:
- _loc4_ = 80;
- break;
- case 0:
- _loc4_ = 60;
- }
- _root[_loc3_]._yscale = _loc0_ = _loc4_;
- _root[_loc3_]._xscale = _loc0_;
- this.arrAllySeekers.push({name:_loc3_,from:""});
- this.numBulletDepth = this.numBulletDepth + 1;
- if(this.numBulletDepth > 105000)
- {
- this.numBulletDepth = 100000;
- }
- return _loc3_;
- }
- function Gun_Infector(myGunName)
- {
- var gunRef = eval("_root.avatar.gun." + myGunName);
- var point = {x:gunRef.emitter._x,y:gunRef.emitter._y};
- gunRef.localToGlobal(point);
- var spawnedName = "avatarSeeker_" + this.numBulletDepth;
- _root.attachMovie("Ally_Infector",spawnedName,this.numBulletDepth);
- _root[spawnedName]._x = point.x;
- _root[spawnedName]._y = point.y;
- _root[spawnedName]._damage = 0;
- _root[spawnedName]._type = 3;
- _root[spawnedName].intState = 3;
- this.arrAllySeekers.push({name:spawnedName,from:myGunName});
- this.numBulletDepth = this.numBulletDepth + 1;
- if(this.numBulletDepth > 105000)
- {
- this.numBulletDepth = 100000;
- }
- }
- function Gun_SpawnInfectors(xloc, yloc, num2Spawn)
- {
- var _loc4_ = 0;
- while(_loc4_ < num2Spawn)
- {
- var _loc3_ = "avatarSeeker_" + this.numBulletDepth;
- _root.attachMovie("Ally_Infector",_loc3_,this.numBulletDepth);
- _root[_loc3_]._x = xloc;
- _root[_loc3_]._y = yloc;
- _root[_loc3_]._damage = 0;
- _root[_loc3_]._type = 3;
- _root[_loc3_].intState = 2;
- this.arrAllySeekers.push({name:_loc3_,from:""});
- this.numBulletDepth = this.numBulletDepth + 1;
- if(this.numBulletDepth > 105000)
- {
- this.numBulletDepth = 100000;
- }
- _loc4_ = _loc4_ + 1;
- }
- }
- function AvatarFireBullet(emitterPos, direction, speed, size, damage)
- {
- var thisRef = this;
- var _loc3_ = "avatarBullet_" + this.numBulletDepth;
- var _loc4_ = new Vector();
- _loc4_._x = Math.cos(3.141592653589793 * direction / 180) * speed;
- _loc4_._y = Math.sin(3.141592653589793 * direction / 180) * speed;
- if(size == 100)
- {
- _root.attachMovie("component_bubble_orange_opt",_loc3_,this.numBulletDepth);
- }
- else
- {
- _root.attachMovie("component_bubble_orange",_loc3_,this.numBulletDepth);
- }
- _root[_loc3_]._x = emitterPos._x;
- _root[_loc3_]._y = emitterPos._y;
- _root[_loc3_]._xscale = size;
- _root[_loc3_]._yscale = size;
- _root[_loc3_]._damage = damage;
- _root[_loc3_].SetMovement(_loc4_._x,_loc4_._y);
- _root[_loc3_]._enemy = false;
- this.numBulletDepth = this.numBulletDepth + 1;
- if(this.numBulletDepth > 105000)
- {
- this.numBulletDepth = 100000;
- }
- this.arrBullets.push(_loc3_);
- _root[_loc3_].removeCallback = function(myName)
- {
- thisRef.RemoveBullet(myName);
- };
- return _loc3_;
- }
- function AvatarFireSpecialBullet(emitterPos, direction, speed, size, damage, type)
- {
- var thisRef = this;
- if(type == "mine_2")
- {
- var _loc3_ = "avatarBullet_" + this.numMineDepth;
- }
- else
- {
- _loc3_ = "avatarBullet_" + this.numBulletDepth;
- }
- var _loc4_ = new Vector();
- _loc4_._x = Math.cos(3.141592653589793 * direction / 180) * speed;
- _loc4_._y = Math.sin(3.141592653589793 * direction / 180) * speed;
- if(type == "mine_2")
- {
- _root.attachMovie(type,_loc3_,this.numMineDepth);
- }
- else
- {
- _root.attachMovie(type,_loc3_,this.numBulletDepth);
- }
- _root[_loc3_]._x = emitterPos._x;
- _root[_loc3_]._y = emitterPos._y;
- _root[_loc3_]._xscale = size;
- _root[_loc3_]._yscale = size;
- _root[_loc3_]._damage = damage;
- _root[_loc3_].SetMovement(_loc4_._x,_loc4_._y);
- _root[_loc3_]._enemy = false;
- if(type == "mine_2")
- {
- this.numMineDepth = this.numMineDepth + 1;
- if(this.numMineDepth > 199)
- {
- this.numMineDepth = 100;
- }
- }
- else
- {
- this.numBulletDepth = this.numBulletDepth + 1;
- if(this.numBulletDepth > 105000)
- {
- this.numBulletDepth = 100000;
- }
- }
- this.arrBullets.push(_loc3_);
- _root[_loc3_].removeCallback = function(myName)
- {
- thisRef.RemoveBullet(myName);
- };
- return _loc3_;
- }
- function DamageBurst(xLoc, yLoc, numDamage)
- {
- this.Effect_DamageBurst(xLoc,yLoc);
- this.FlashScreen();
- this.ShakeScreen(20);
- var _loc4_ = this.world.current.GetUnitsWithinDistance(xLoc,yLoc,150);
- var _loc3_ = 0;
- while(_loc3_ < _loc4_.length)
- {
- this.Effect_PierceExplosion(_root[_loc4_[_loc3_]]._x,_root[_loc4_[_loc3_]]._y);
- _root[_loc4_[_loc3_]].ReceiveDamage(numDamage,"");
- _loc3_ = _loc3_ + 1;
- }
- }
- function SmallDamageBurst(xLoc, yLoc)
- {
- this.Effect_SmallDamageBurst(xLoc,yLoc);
- this.FlashScreen();
- this.ShakeScreen(10);
- var _loc4_ = this.world.current.GetUnitsWithinDistance(xLoc,yLoc,75);
- var _loc3_ = 0;
- while(_loc3_ < _loc4_.length)
- {
- this.Effect_PierceExplosion(_root[_loc4_[_loc3_]]._x,_root[_loc4_[_loc3_]]._y);
- _root[_loc4_[_loc3_]].ReceiveDamage(10,"");
- _loc3_ = _loc3_ + 1;
- }
- }
- function EnemyFire(emitterPos, direction, speed, size, damage)
- {
- damage *= 3;
- var thisRef = this;
- var _loc3_ = "enemyBullet_" + this.numBulletDepth;
- var _loc4_ = new Vector();
- _loc4_._x = Math.cos(3.141592653589793 * direction / 180) * speed;
- _loc4_._y = Math.sin(3.141592653589793 * direction / 180) * speed;
- if(size == 100)
- {
- _root.attachMovie("component_bubble_red_opt",_loc3_,this.numBulletDepth);
- }
- else
- {
- _root.attachMovie("component_bubble_red",_loc3_,this.numBulletDepth);
- }
- _root[_loc3_]._x = emitterPos._x;
- _root[_loc3_]._y = emitterPos._y;
- _root[_loc3_]._xscale = size;
- _root[_loc3_]._yscale = size;
- _root[_loc3_]._damage = damage;
- _root[_loc3_].SetMovement(_loc4_._x,_loc4_._y);
- _root[_loc3_]._enemy = true;
- this.numBulletDepth = this.numBulletDepth + 1;
- if(this.numBulletDepth > 105000)
- {
- this.numBulletDepth = 100000;
- }
- this.arrBullets.push(_loc3_);
- _root[_loc3_].removeCallback = function(myName)
- {
- thisRef.RemoveBullet(myName);
- };
- }
- function EnemyFireSpecial(myType, emitterPos, direction, speed, size, damage)
- {
- if(myType == "mine")
- {
- damage *= 3;
- var thisRef = this;
- var _loc3_ = "enemyBullet_" + this.numBulletDepth;
- var _loc5_ = new Vector();
- _loc5_._x = 0;
- _loc5_._y = 0;
- _root.attachMovie("mine_1",_loc3_,this.numBulletDepth);
- _root[_loc3_]._x = emitterPos._x;
- _root[_loc3_]._y = emitterPos._y;
- _root[_loc3_]._xscale = size;
- _root[_loc3_]._yscale = size;
- _root[_loc3_]._damage = damage;
- _root[_loc3_].SetMovement(_loc5_._x,_loc5_._y);
- _root[_loc3_]._enemy = true;
- this.numBulletDepth = this.numBulletDepth + 1;
- this.arrBullets.push(_loc3_);
- _root[_loc3_].removeCallback = function(myName)
- {
- thisRef.RemoveBullet(myName);
- };
- }
- else if(myType == "sticky")
- {
- damage *= 3;
- var thisRef = this;
- _loc3_ = "enemySticky_" + this.numBulletDepth;
- _loc5_ = new Vector();
- _loc5_._x = Math.cos(3.141592653589793 * direction / 180) * speed;
- _loc5_._y = Math.sin(3.141592653589793 * direction / 180) * speed;
- _root.attachMovie("sticky",_loc3_,this.numBulletDepth);
- _root[_loc3_]._x = emitterPos._x;
- _root[_loc3_]._y = emitterPos._y;
- _root[_loc3_]._xscale = size;
- _root[_loc3_]._yscale = size;
- _root[_loc3_]._damage = damage;
- _root[_loc3_].SetMovement(_loc5_._x,_loc5_._y);
- _root[_loc3_]._enemy = true;
- this.numBulletDepth = this.numBulletDepth + 1;
- this.arrBullets.push(_loc3_);
- _root[_loc3_].removeCallback = function(myName)
- {
- thisRef.RemoveBullet(myName);
- };
- }
- }
- function outputPoints()
- {
- var _loc4_ = this.deltaList.length;
- var _loc2_ = 0;
- while(_loc2_ < _loc4_)
- {
- var _loc3_ = this.deltaList[_loc2_];
- _loc2_ = _loc2_ + 1;
- }
- }
- function BuildPointList()
- {
- this.deltaX = this.dblDestX - _root.avatar._x;
- this.deltaY = this.dblDestY - _root.avatar._y;
- var _loc12_ = this.easeFrames * this.checkFactor(this.easeFrames);
- var _loc10_ = this.deltaX / _loc12_;
- var _loc9_ = this.deltaY / _loc12_;
- if(this.easeFrames > 0)
- {
- var _loc8_ = undefined;
- _loc8_ = this.EaseIn();
- var _loc11_ = _loc8_.length;
- var _loc3_ = 0;
- while(_loc3_ < _loc11_)
- {
- var _loc4_ = _loc8_[_loc3_];
- var _loc5_ = _loc10_ * _loc4_;
- var _loc7_ = _loc9_ * _loc4_;
- var _loc6_ = new Point(_loc5_,_loc7_);
- this.deltaList.push(_loc6_);
- _loc3_ = _loc3_ + 1;
- }
- }
- }
- function EaseIn()
- {
- var _loc4_ = new Array();
- var _loc5_ = 1.5707963267948966 / this.easeFrames;
- var _loc2_ = 1;
- while(_loc2_ <= this.easeFrames)
- {
- var _loc3_ = _loc2_ * _loc5_;
- _loc4_.push(Math.sin(_loc3_));
- _loc2_ = _loc2_ + 1;
- }
- return _loc4_;
- }
- function EaseOut()
- {
- var _loc4_ = new Array();
- var _loc5_ = 1.5707963267948966 / this.easeFrames;
- var _loc2_ = 1;
- while(_loc2_ <= this.easeFrames)
- {
- var _loc3_ = _loc2_ * _loc5_;
- _loc4_.push(Math.sin(_loc3_ + 1.5707963267948966));
- _loc2_ = _loc2_ + 1;
- }
- return _loc4_;
- }
- function checkFactor(howMany)
- {
- var _loc4_ = undefined;
- if(howMany == this.easeFrames)
- {
- _loc4_ = this.EaseOut();
- }
- var _loc5_ = _loc4_.length;
- var _loc3_ = 0;
- var _loc2_ = 0;
- while(_loc2_ < _loc5_)
- {
- _loc3_ += _loc4_[_loc2_];
- _loc2_ = _loc2_ + 1;
- }
- return _loc3_ / howMany;
- }
- function CreateEffect(effectName, effectLocation, lockLocation, lockTarget)
- {
- var _loc3_ = "effect_" + this.effectDepth;
- _root.attachMovie(effectName,_loc3_,this.effectDepth);
- _root[_loc3_].gotoAndStop(effectName);
- _root[_loc3_]._x = effectLocation._x;
- _root[_loc3_]._y = effectLocation._y;
- this.arrEffects.push({name:_loc3_,locked:lockLocation,target:lockTarget});
- this.effectDepth = this.effectDepth + 1;
- if(this.effectDepth > 60000)
- {
- this.effectDepth = 50000;
- }
- return _loc3_;
- }
- function CreateUnderEffect(effectName, effectLocation, lockLocation, lockTarget)
- {
- var tempName = "effect_" + this.underEffectDepth;
- _root.effects_mc.attachMovie(effectName,tempName,this.underEffectDepth);
- var point = {x:effectLocation._x,y:effectLocation._y};
- _root.effects_mc.globalToLocal(point);
- var myEffect = eval("_root.effects_mc." + tempName);
- myEffect._x = point.x;
- myEffect._y = point.y;
- this.arrUnderEffects.push({name:tempName,locked:lockLocation,target:lockTarget});
- this.underEffectDepth = this.underEffectDepth + 1;
- if(this.underEffectDepth > 60000)
- {
- this.underEffectDepth = 10;
- }
- return tempName;
- }
- function CleanEffects()
- {
- var _loc3_ = 0;
- while(_loc3_ < this.arrEffects.length)
- {
- _root[this.arrEffects[_loc3_].name].removeMovieClip();
- _loc3_ = _loc3_ + 1;
- }
- delete this.arrEffects;
- this.arrEffects = new Array();
- _loc3_ = 0;
- while(_loc3_ < this.arrUnderEffects.length)
- {
- _root.effects_mc[this.arrUnderEffects[_loc3_].name].removeMovieClip();
- _loc3_ = _loc3_ + 1;
- }
- delete this.arrUnderEffects;
- this.arrUnderEffects = new Array();
- }
- function RemoveEffect(strName)
- {
- var _loc3_ = 0;
- while(_loc3_ < this.arrEffects.length)
- {
- if(strName == this.arrEffects[_loc3_].name)
- {
- _root[this.arrEffects[_loc3_].name].removeMovieClip();
- this.arrEffects.splice(_loc3_,1);
- break;
- }
- _loc3_ = _loc3_ + 1;
- }
- }
- function RemoveUnderEffect(strName)
- {
- var _loc3_ = 0;
- while(_loc3_ < this.arrUnderEffects.length)
- {
- if(strName == this.arrUnderEffects[_loc3_].name)
- {
- _root.effects_mc[this.arrUnderEffects[_loc3_].name].removeMovieClip();
- this.arrUnderEffects.splice(_loc3_,1);
- break;
- }
- _loc3_ = _loc3_ + 1;
- }
- }
- function MoveEffects(moveVector)
- {
- var _loc3_ = 0;
- while(_loc3_ < this.arrEffects.length)
- {
- if(this.arrEffects[_loc3_].locked == false)
- {
- _root[this.arrEffects[_loc3_].name]._x += moveVector._x;
- _root[this.arrEffects[_loc3_].name]._y += moveVector._y;
- }
- else
- {
- _root[this.arrEffects[_loc3_].name]._x = _root[this.arrEffects[_loc3_].target]._x;
- _root[this.arrEffects[_loc3_].name]._y = _root[this.arrEffects[_loc3_].target]._y;
- }
- _loc3_ = _loc3_ + 1;
- }
- _loc3_ = 0;
- while(_loc3_ < this.arrUnderEffects.length)
- {
- if(this.arrUnderEffects[_loc3_].locked == false)
- {
- _root.effects_mc[this.arrUnderEffects[_loc3_].name]._x += moveVector._x;
- _root.effects_mc[this.arrUnderEffects[_loc3_].name]._y += moveVector._y;
- }
- else
- {
- var _loc4_ = {x:_root[this.arrUnderEffects[_loc3_].target]._x,y:_root[this.arrUnderEffects[_loc3_].target]._y};
- _root.effects_mc.globalToLocal(_loc4_);
- _root.effects_mc[this.arrUnderEffects[_loc3_].name]._x = _loc4_.x;
- _root.effects_mc[this.arrUnderEffects[_loc3_].name]._y = _loc4_.y;
- }
- _loc3_ = _loc3_ + 1;
- }
- }
- function ScaleMiniBubble()
- {
- var _loc3_ = _root.avatar._width;
- var _loc4_ = _root.avatar._height;
- var _loc2_ = Math.round(Math.sqrt(_loc3_ * _loc3_ + _loc4_ * _loc4_)) - 5;
- _loc2_ /= 2;
- if(_loc2_ < 59.5)
- {
- _loc2_ = 59.5;
- }
- _root.miniBubblesLayer_mc.miniBubble._width = _root.miniBubblesLayer_mc.miniBubble._height = _loc2_ * 2;
- _root.miniBubblesLayer_mc.miniBubble._x = - _loc2_;
- _root.miniBubblesLayer_mc.miniBubble._y = - _loc2_;
- }
- function FlashScreen()
- {
- _root.flash_mc._visible = true;
- _root.flash_mc.gotoAndStop(2);
- _root.flash_mc.inside.gotoAndPlay(1);
- }
- function ShakeScreen(newDuration)
- {
- if(this.intShakeDuration == 0)
- {
- this.intShakeDuration = newDuration;
- this.intShakeStart = newDuration;
- this.intShakeCounter = 3;
- this.vecScreenCoords._x = _root.avatar._x;
- this.vecScreenCoords._y = _root.avatar._y;
- }
- }
- function HaltShaking()
- {
- if(this.vecScreenCoords._x != _root.avatar._x || this.vecScreenCoords._y != _root.avatar._y)
- {
- this.intShakeDuration = 0;
- var _loc5_ = this.vecScreenCoords._x - _root.avatar._x;
- var _loc4_ = this.vecScreenCoords._y - _root.avatar._y;
- _root.avatar._x = this.vecScreenCoords._x;
- _root.avatar._y = this.vecScreenCoords._y;
- var _loc3_ = new Vector();
- _loc3_._x = _loc5_;
- _loc3_._y = _loc4_;
- this.MoveWorld(_loc3_);
- }
- }
- function ManageShaking()
- {
- if(_global.gamePaused == false || _global.gamePaused == true && this.intBossState == 2)
- {
- if(this.intShakeDuration > 0)
- {
- this.intShakeDuration = this.intShakeDuration - 1;
- if(this.intShakeDuration == 0)
- {
- this.HaltShaking();
- }
- else
- {
- this.intShakeCounter = this.intShakeCounter - 1;
- if(this.intShakeCounter == 0)
- {
- this.intShakeCounter = 3;
- var _loc6_ = this.intShakeDuration / this.intShakeStart;
- var _loc4_ = 4;
- if(this.intShakeStart > 45)
- {
- _loc4_ = 6;
- }
- var _loc8_ = this.vecScreenCoords._x + this.RandNum(-1 * _loc4_,_loc4_) * _loc6_;
- var _loc7_ = this.vecScreenCoords._y + this.RandNum(-1 * _loc4_,_loc4_) * _loc6_;
- var _loc10_ = _loc8_ - _root.avatar._x;
- var _loc9_ = _loc7_ - _root.avatar._y;
- _root.avatar._x = _loc8_;
- _root.avatar._y = _loc7_;
- var _loc5_ = new Vector();
- _loc5_._x = _loc10_;
- _loc5_._y = _loc9_;
- this.MoveWorld(_loc5_);
- }
- }
- }
- }
- }
- function RemoveAllySeekers()
- {
- var _loc3_ = 0;
- while(_loc3_ < this.arrAllySeekers.length)
- {
- if(_root[this.arrAllySeekers[_loc3_].name]._type != 2)
- {
- _root[this.arrAllySeekers[_loc3_].name].removeMovieClip();
- this.arrAllySeekers.splice(_loc3_,1);
- _loc3_ = _loc3_ - 1;
- }
- else if(_root[this.arrAllySeekers[_loc3_].name].intState != 2)
- {
- _root[this.arrAllySeekers[_loc3_].name].removeMovieClip();
- this.arrAllySeekers.splice(_loc3_,1);
- _loc3_ = _loc3_ - 1;
- }
- _loc3_ = _loc3_ + 1;
- }
- }
- function RemoveAllAllySeekers()
- {
- var _loc3_ = 0;
- while(_loc3_ < this.arrAllySeekers.length)
- {
- _root[this.arrAllySeekers[_loc3_].name].removeMovieClip();
- _loc3_ = _loc3_ + 1;
- }
- delete this.arrAllySeekers;
- this.arrAllySeekers = new Array();
- }
- function RemoveAlly(strName)
- {
- var _loc2_ = 0;
- while(_loc2_ < this.arrAllies.length)
- {
- if(strName == this.arrAllies[_loc2_])
- {
- this.arrAllies.splice(_loc2_,1);
- break;
- }
- _loc2_ = _loc2_ + 1;
- }
- }
- function ReportSeekerDead(strName)
- {
- var _loc2_ = 0;
- while(_loc2_ < this.arrAllySeekers.length)
- {
- if(this.arrAllySeekers[_loc2_].name == strName)
- {
- this.arrAllySeekers.splice(_loc2_,1);
- break;
- }
- _loc2_ = _loc2_ + 1;
- }
- }
- function GetNearestEnemy(testX, testY)
- {
- return this.world.current.GetClosestUnit(testX,testY);
- }
- function RandNum(minVal, maxVal)
- {
- return Math.round(Math.random() * (maxVal - minVal)) + minVal;
- }
- function ManageDisassembly()
- {
- if(this.upgradePath.currentNode.nodeData._arrSecondaryWeapons[0].type == 24)
- {
- if(this.intAssembledState == 1)
- {
- this.intAssembledFrame = this.intAssembledFrame + 1;
- _root.avatar.gun.gotoAndStop(this.intAssembledFrame);
- if(this.intAssembledFrame == 16)
- {
- this.intAssembledState = 2;
- this.AvatarBreakApart();
- }
- }
- else if(this.intAssembledState != 2)
- {
- if(this.intAssembledState == 3)
- {
- if(this.intAssembledFrame == 16)
- {
- if(this.AvatarCheckIfAssembled() == true)
- {
- this.AvatarComeTogether();
- this.intAssembledFrame = 15;
- _root.avatar.gun.gotoAndStop(this.intAssembledFrame);
- }
- }
- else
- {
- this.intAssembledFrame = this.intAssembledFrame - 1;
- _root.avatar.gun.gotoAndStop(this.intAssembledFrame);
- if(this.intAssembledFrame == 1)
- {
- this.intAssembledState = 0;
- }
- }
- }
- }
- }
- }
- function AvatarBreakApart()
- {
- var i = 1;
- while(i < 20)
- {
- if(i != 6)
- {
- var bubbleName = i + "_mc";
- var spawnName = i + "_reg";
- if(i < 5)
- {
- _root.attachMovie("component_bubble_yellow_disassembled",bubbleName,530 + i);
- }
- else
- {
- _root.attachMovie("component_bubble_disassembled",bubbleName,530 + i);
- }
- var scaleThis = 100;
- switch(i)
- {
- case 1:
- scaleThis = 60;
- break;
- case 2:
- scaleThis = 130;
- break;
- case 3:
- scaleThis = 61.5;
- break;
- case 4:
- scaleThis = 61.5;
- break;
- case 5:
- scaleThis = 100;
- break;
- case 7:
- scaleThis = 100;
- break;
- case 8:
- scaleThis = 68.5;
- break;
- case 9:
- scaleThis = 68.5;
- break;
- case 10:
- scaleThis = 60;
- break;
- case 11:
- scaleThis = 60;
- break;
- case 12:
- scaleThis = 100;
- break;
- case 13:
- scaleThis = 56.6;
- break;
- case 14:
- scaleThis = 56.6;
- break;
- case 15:
- scaleThis = 60;
- break;
- case 16:
- scaleThis = 100;
- break;
- case 17:
- scaleThis = 60;
- break;
- case 18:
- scaleThis = 56.6;
- break;
- case 19:
- scaleThis = 56.6;
- }
- _root[bubbleName]._yscale = _loc0_ = scaleThis;
- _root[bubbleName]._xscale = _loc0_;
- var targetClip = eval("_root.avatar.gun." + spawnName);
- var point = {x:targetClip._x,y:targetClip._y};
- _root.avatar.gun.localToGlobal(point);
- _root[bubbleName]._x = point.x;
- _root[bubbleName]._y = point.y;
- _root[bubbleName].SetCounter(this.RandNum(2,18));
- }
- i++;
- }
- }
- function AvatarComeTogether()
- {
- var _loc2_ = 1;
- while(_loc2_ <= 19)
- {
- var _loc3_ = _loc2_ + "_mc";
- _root[_loc3_].removeMovieClip();
- _loc2_ = _loc2_ + 1;
- }
- }
- function AvatarCheckIfAssembled()
- {
- var _loc2_ = 1;
- while(_loc2_ <= 19)
- {
- var _loc3_ = _loc2_ + "_mc";
- if(_root[_loc3_]._isReady == false)
- {
- return false;
- }
- _loc2_ = _loc2_ + 1;
- }
- return true;
- }
- function Effect_PierceExplosion(xLoc, yLoc)
- {
- var _loc3_ = new Vector();
- _loc3_._x = xLoc;
- _loc3_._y = yLoc;
- _root[this.CreateEffect("pierce_shot_hit",_loc3_,false,"")]._rotation = this.RandNum(0,360);
- }
- function Effect_SeekerExplosion(xLoc, yLoc)
- {
- var _loc2_ = new Vector();
- _loc2_._x = xLoc;
- _loc2_._y = yLoc;
- this.CreateEffect("seeker_explosion",_loc2_,false,"");
- }
- function Effect_Stunned(xLoc, yLoc)
- {
- var _loc2_ = new Vector();
- _loc2_._x = xLoc;
- _loc2_._y = yLoc;
- this.CreateEffect("stunned",_loc2_,false,"");
- }
- function Effect_Teleport(xLoc, yLoc)
- {
- var _loc2_ = new Vector();
- _loc2_._x = xLoc;
- _loc2_._y = yLoc;
- this.CreateEffect("teleport_anim",_loc2_,false,"");
- }
- function Effect_ShortStun(xLoc, yLoc)
- {
- var _loc2_ = new Vector();
- _loc2_._x = xLoc;
- _loc2_._y = yLoc;
- this.CreateUnderEffect("stun_burst",_loc2_,false,"");
- }
- function Effect_LargeStun(xLoc, yLoc)
- {
- var _loc2_ = new Vector();
- _loc2_._x = xLoc;
- _loc2_._y = yLoc;
- this.CreateUnderEffect("stun_burst_large",_loc2_,false,"");
- }
- function Effect_DamageBurst(xLoc, yLoc)
- {
- var _loc2_ = new Vector();
- _loc2_._x = xLoc;
- _loc2_._y = yLoc;
- this.CreateUnderEffect("damage_burst",_loc2_,false,"");
- }
- function Effect_SmallDamageBurst(xLoc, yLoc)
- {
- var _loc2_ = new Vector();
- _loc2_._x = xLoc;
- _loc2_._y = yLoc;
- this.CreateUnderEffect("damage_burst_small",_loc2_,false,"");
- }
- function Effect_Sticky(xLoc, yLoc)
- {
- var _loc3_ = new Vector();
- _loc3_._x = xLoc;
- _loc3_._y = yLoc;
- var _loc4_ = this.CreateEffect("sticky_effect",_loc3_,false,"");
- _root[_loc4_]._rotation = this.RandNum(0,360);
- return _loc4_;
- }
- function Effect_Leech(xLoc, yLoc)
- {
- var _loc2_ = new Vector();
- _loc2_._x = xLoc;
- _loc2_._y = yLoc;
- this.CreateEffect("leech_effect",_loc2_,false,"");
- }
- function Effect_Infect(xLoc, yLoc, targetName)
- {
- var _loc2_ = new Vector();
- _loc2_._x = xLoc;
- _loc2_._y = yLoc;
- return this.CreateEffect("effect_infected",_loc2_,true,targetName);
- }
- function Effect_Convert(xLoc, yLoc)
- {
- var _loc2_ = new Vector();
- _loc2_._x = xLoc;
- _loc2_._y = yLoc;
- this.CreateUnderEffect("effect_convert",_loc2_,false,"");
- }
- function IsHelpNeeded()
- {
- if(this.avatarLife.Get() < this.maxAvatarLife * 0.8)
- {
- return true;
- }
- return false;
- }
- function IsBossNeeded(xloc, yloc)
- {
- if(this.blnBoss == false && this.intJumpsAsMax > 2)
- {
- this.blnBoss = true;
- this.intBossState = 1;
- this.intBossX = xloc;
- this.intBossY = yloc;
- return true;
- }
- return false;
- }
- function GetMaxLife()
- {
- return this.maxAvatarLife;
- }
- function CheckListAndAdd(myType)
- {
- var _loc4_ = false;
- var _loc3_ = 0;
- while(_loc3_ < _global.encountered.length)
- {
- if(_global.encountered[_loc3_] == myType)
- {
- _loc4_ = true;
- break;
- }
- _loc3_ = _loc3_ + 1;
- }
- if(_loc4_ == false)
- {
- _global.encountered.push(myType);
- this.blnFlushList = true;
- }
- }
- function FlushEncounteredList()
- {
- if(this.blnFlushList == true)
- {
- this.blnFlushList = false;
- if(this.mySharedObject.data.firstTime != undefined)
- {
- this.mySharedObject.data.enemyList = _global.encountered;
- this.mySharedObject.flush();
- }
- }
- }
- function IsAvatarLocked(myId)
- {
- var _loc2_ = 0;
- while(_loc2_ < _global.encounteredStates.length)
- {
- if(_global.encounteredStates[_loc2_] == myId)
- {
- return false;
- }
- _loc2_ = _loc2_ + 1;
- }
- return true;
- }
- }
-