Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package bloons
- {
- import *.*;
- import __AS3__.vec.*;
- import assets.sound.*;
- import assets.sounds.*;
- import display.*;
- import effects.*;
- import events.*;
- import flash.display.*;
- import flash.events.*;
- import framework.*;
- import levels.*;
- import levels.tiles.*;
- import math.*;
- import profile.*;
- import projectiles.*;
- import projectiles.def.*;
- import sound.*;
- import towers.*;
- import utils.*;
- public class Bloon extends Entity
- {
- public var sabotaged:Boolean = false;
- public var spawnTime:Number = 0;
- private var _tile:Tile;
- public var tileProgress:Number = 0;
- public var progressStep:Number;
- public var overallProgress:Number = 0;
- public var clip:BloonClip;
- public var type:int = -1;
- public var maxHealth:int;
- public var health:int;
- public var rbe:int;
- public var immunity:int = 0;
- public var isMoving:Boolean = true;
- public var isCamo:Boolean = false;
- public var isRegen:Boolean = false;
- public var regenCeiling:int = 0;
- private var regenCountDown:Number = 0;
- private var regenInterval:Number = 3;
- public var radius:Number = 0;
- public var collisionCellIndex:int = -1;
- public var %b:Boolean = false;
- public var squareDistanceFromTestTower:Number = 0;
- public var targetAddon:Number = 0;
- public var iced:Boolean = false;
- private var iceCountdown:Number = 0;
- private var permaFrostSpeedScale:Number = 1;
- private var viralIce:Boolean = false;
- public var viralDepth:int = 0;
- private var iceShards:Boolean = false;
- private var freezeLayers:int = 1;
- private var arcticWind:Number = 1;
- private var arcticWindCountdown:int = 0;
- public var icedBy:Tower = null;
- public var glueTower:Tower = null;
- private var glued:Boolean = false;
- private var glueCountdown:Number = 0;
- private var glueCorrosionInterval:Number = 0;
- private var glueCorrosionCountDown:Number = 0;
- private var glueSpeedScale:Number = 1;
- private var glueSoak:Boolean = false;
- private var glueCash:Number = 1;
- public var glueEffectDef:GlueEffectDef = null;
- private var stunned:Boolean = false;
- private var stunInherited:Boolean = false;
- private var stunCountDown:Number = 0;
- private var burnTower:Tower = null;
- private var burning:Boolean = false;
- private var burnCountDown:Number = 0;
- private var burnInterval:Number = 0;
- private var burnLifeSpan:Number = 0;
- private var burnCash:Number = 0;
- private var cashAwarded:Vector.;
- private var wasWhite:Boolean = false;
- public var id:uint = 4.29497e+009;
- public var lifetimeID:uint = 4.29497e+009;
- public var parentIDs:Vector.;
- public var 9F:Boolean = false;
- private var @!3:Boolean = false;
- public var 4!,:Boolean = false;
- public var 9V:int = 0;
- private var lastPosition:Vector2;
- public static const INVALID:int = -1;
- public static const RED:int = 0;
- public static const BLUE:int = 1;
- public static const GREEN:int = 2;
- public static const YELLOW:int = 3;
- public static const PINK:int = 4;
- public static const BLACK:int = 5;
- public static const WHITE:int = 6;
- public static const LEAD:int = 7;
- public static const ZEBRA:int = 8;
- public static const RAINBOW:int = 9;
- public static const CERAMIC:int = 10;
- public static const MOAB:int = 11;
- public static const BFB:int = 12;
- public static const BOSS:int = 13;
- public static const BLOON_COUNT:int = 14;
- public static var burstsThisProcess:int = 0;
- public static const allBloonTypes:Vector. = Bloon.Vector.([RED, BLUE, GREEN, YELLOW, PINK, BLACK, WHITE, LEAD, ZEBRA, RAINBOW, CERAMIC, MOAB, BFB, BOSS]);
- public static var eventDispatcher:EventDispatcher = new EventDispatcher();
- public static var sabotage:Boolean = false;
- public static var weakMoabs:Boolean = false;
- public static const baseSpeed:Number = 70;
- public static var difficultySpeedModifier:Number = 0;
- private static const maxDeltaRotation:Number = 0.12;
- public static const IMMUNITY_NONE:int = 0;
- public static const IMMUNITY_NO_DETECTION:int = 1;
- public static const IMMUNITY_ICE:int = 2;
- public static const IMMUNITY_GLUE:int = 4;
- public static const IMMUNITY_SPLOSION:int = 8;
- public static const IMMUNITY_WIND:int = 16;
- public static const IMMUNITY_LEAD:int = 32;
- public static const IMMUNITY_MOAB:int = 64;
- public static const IMMUNITY_BFB:int = 128;
- public static const IMMUNITY_ZOMG:int = 256;
- public static const IMMUNITY_ALL:int = 65535;
- private static const maxHealthByType:Vector. = Bloon.Vector.([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 200, 700, 4000]);
- public static const speedMultiplierByType:Vector. = Bloon.Vector.([1, 1.4, 1.8, 3.2, 3.5, 1.8, 2, 1, 1.8, 2.2, 2.5, 1, 0.25, 0.18]);
- private static const baseImmunitiesByType:Vector.;
- public static const rbeByType:Vector. = Bloon.Vector.([1, 2, 3, 4, 5, 11, 11, 23, 23, 47, 104, 616, 3164, 16656]);
- private static const childTypeByType:Vector. = Bloon.Vector.([null, null, null, null, null, PINK, PINK, BLACK, BLACK, ZEBRA, RAINBOW, CERAMIC, MOAB, BFB]);
- private static const childCountByType:Vector. = Bloon.Vector.([1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 4, 4, 4]);
- public static const targetRangeAddonsByType:Vector. = Bloon.Vector.([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 110, 140]);
- public static const popSounds:Vector. = Bloon.Vector.([new MaxSound(Pop1), new MaxSound(Pop2), new MaxSound(Pop3), new MaxSound(Pop4)]);
- private static const windLayer:int = 3;
- private static const moabLayer:int = 1200;
- private static var zomgDestroySound:MaxSound = new MaxSound(MoabDestroyedBig);
- private static var bfbDestroySound:MaxSound = new MaxSound(MoabDestroyedMed);
- private static var moabDestroySound:MaxSound = new MaxSound(MoabDestroyedShort);
- private static var ceramicHitSound:MaxSound = new MaxSound(CeramicBloonHit);
- private static var frozenHitSound:MaxSound = new MaxSound(FrozenBloonHit);
- private static var leadHitSound:MaxSound = new MaxSound(MetalBloonHit);
- private static var moabHitSounds:Vector. = Bloon.Vector.([new MaxSound(MoabDamage1), new MaxSound(MoabDamage2), new MaxSound(MoabDamage3)]);
- public static var counter:uint = 0;
- public static var '4:Number = 1;
- public static const -m:Vector. = Bloon.Vector.([1, 1, 1, 1, 1, 2, 2, 4, 4, 8, 16, 64, 256, 1024]);
- public static var 0;
- public function Bloon()
- {
- ;
- do
- {
- return;
- }while (true)
- ;
- (new Vector2() >> _loc_1).lastPosition = false;
- do
- {
- this.parentIDs = new Vector.;
- continue;
- this.cashAwarded = Bloon.defaultBoolVector();
- }while (true)
- this.clip = Pool.get(BloonClip);
- return;
- }// end function
- public function initialise(param1:int, param2:Tile, param3:Number, param4:Boolean = false, param5:Boolean = false, param6:Number = 0) : void
- {
- ;
- param6--;
- (null % this - 1).id = counter + 1;
- do
- {
- this.parentIDs.splice(0, this.parentIDs.length);
- if (!true)
- {
- this.collisionCellIndex = Main.instance.level.collisionGrid.getCellIndex(x, y);
- }while (true)
- this.tileProgress = param3;
- do
- {
- this.tile = param2;
- do
- {
- this.wasWhite = false;
- }while (true)
- this.@!3 = false;
- }while (true)
- this.sabotaged = sabotage;
- do
- {
- this.overallProgress = 0;
- do
- {
- this.spawnTime = param6;
- }while (true)
- this.4!, = false;
- }while (true)
- this.lifetimeID = this.id;
- ;
- }// end if
- if (param5)
- {
- ;
- param6++;
- var _loc_8:String = this;
- }// end if
- var _loc_10:* = param1 < MOAB;
- null.isCamo = param1 < MOAB;
- null.camoVisible = _loc_10;
- var _loc_10:* = param4 && param1 < MOAB;
- this.isRegen = param4 && param1 < MOAB;
- this.clip.regenVisible = _loc_10;
- do
- {
- param2.updateBloonPosition(this);
- if (!true)
- {
- this.setType(param1);
- }while (true)
- this.regenCeiling = param1;
- ;
- this.resetStatusEffects();
- ;
- }// end if
- var _loc_7:* = param2.wayPoints[0];
- _loc_8 = param2.wayPoints[1];
- rotation = Math.atan2(_loc_8.y - _loc_7.y, _loc_8.x - _loc_7.x);
- var _loc_9:int = 0;
- ;
- param4++;
- do
- {
- if (_loc_9 > BOSS)
- {
- return;
- _loc_9++;
- }while (true)
- ;
- }// end if
- this.cashAwarded[_loc_9] = false;
- ;
- return;
- }// end function
- public function setType(param1:int) : void
- {
- ;
- _loc_2++;
- var _loc_2:* = _loc_2 in 0;
- if (this.isRegen)
- {
- if (this.type == this.regenCeiling)
- {
- this.regenCountDown = this.regenInterval;
- }// end if
- }// end if
- this.type = param1;
- var _loc_3:* = maxHealthByType[param1];
- this.maxHealth = maxHealthByType[param1];
- this.health = _loc_3;
- do
- {
- if (param1 >= MOAB)
- {
- _loc_2 = Main.instance.level.waveIndex.value - 85;
- if (!true)
- {
- }while (param1 != CERAMIC)
- this.health = 38;
- do
- {
- continue;
- this.progressStep = baseSpeed * (speedMultiplierByType[param1] + difficultySpeedModifier);
- }while (true)
- }// end if
- if (_loc_2 >= 0)
- {
- if (_loc_2 > 30)
- {
- var _loc_3:* = this.health * (1.5 + (_loc_2 - 30) * 0.05 + 30 * 0.02);
- this.maxHealth = this.health * (1.5 + (_loc_2 - 30) * 0.05 + 30 * 0.02);
- ;
- this.health = _loc_3 >>> _loc_2;
- }
- else
- {
- var _loc_3:* = this.health * (1.5 + _loc_2 * 0.02);
- this.maxHealth = this.health * (1.5 + _loc_2 * 0.02);
- this.health = _loc_3;
- do
- {
- return;
- }while (true)
- z = this.zOffset;
- do
- {
- do
- {
- if (!this.tile) goto 267;
- z = this.tile.layer + this.zOffset;
- do
- {
- }while (param1 < Bloon.MOAB)
- z = moabLayer + this.zOffset;
- }while (true)
- this.calculateImmunity();
- }while (true)
- if (!(param1 == WHITE)) goto 347;
- this.wasWhite = true;
- do
- {
- this.targetAddon = targetRangeAddonsByType[param1];
- do
- {
- this.radius = this.clip.radius;
- }while (true)
- this.clip.setFrame(param1, this.health / this.maxHealth);
- }while (true)
- this.rbe = rbeByType[param1];
- ;
- ;
- _loc_2 = Main.instance.level.waveIndex.value >= 85;
- _loc_2--;
- if (!weakMoabs) goto 428;
- this.health = this.health / 2;
- ;
- }// end if
- }// end if
- }// end else if
- ;
- return;
- }// end function
- public function get zOffset() : Number
- {
- ;
- return ((null + this < null) + 1).id * -1e-006 - 0.001;
- return;
- }// end function
- private function calculateImmunity() : void
- {
- ;
- ;
- _loc_2 = -null;
- return;
- if (!true)
- {
- if (this.glueCountdown == 0) goto 13;
- this.immunity = this.immunity | IMMUNITY_GLUE;
- ;
- with (_loc_1)
- {
- do
- {
- if (!this.isCamo) goto 20;
- ;
- null.immunity = true is this - this.immunity | IMMUNITY_NO_DETECTION;
- do
- {
- this.immunity = baseImmunitiesByType[this.type];
- }while (true)
- }while (this.type != -1)
- return;
- ;
- }// end if
- return;
- }// end function
- public function resetStatusEffects() : void
- {
- ;
- do
- {
- return;
- if (!true)
- {
- this.stunCountDown = 0;
- }while (true)
- this.clip.burnyStuffVisible = false;
- ;
- do
- {
- this.burning = false;
- do
- {
- this.clip.stunVisible = false;
- }while (true)
- this.stunned = false;
- }while (true)
- this.resetGlue();
- do
- {
- this.permaFrostSpeedScale = 1;
- continue;
- this.resetIce();
- }while (true)
- }// end if
- return;
- }// end function
- public function resetIce() : void
- {
- ;
- do
- {
- return;
- if (!true)
- {
- this.viralDepth = 0;
- }while (true)
- this.freezeLayers = 1;
- ;
- do
- {
- this.iceShards = false;
- do
- {
- this.viralIce = false;
- }while (true)
- this.iceCountdown = 0;
- }while (true)
- this.clip.iceVisible = false;
- ;
- this.iced = false;
- ;
- }// end if
- return;
- }// end function
- public function resetGlue() : void
- {
- ;
- ;
- _loc_2 = null;
- return;
- this.glueSoak = false;
- do
- {
- this.glueSpeedScale = 1;
- do
- {
- ;
- null.glueCorrosionCountDown = null is (null instanceof null ^ this as 0);
- }while (true)
- this.glueCorrosionInterval = 0;
- }while (true)
- this.glueCountdown = 0;
- do
- {
- this.clip.glueState = 0;
- continue;
- this.glueEffectDef = null;
- }while (true)
- this.glued = false;
- return;
- }// end function
- public function completePath() : void
- {
- ;
- do
- {
- return;
- if (!true)
- {
- eventDispatcher.dispatchEvent(new BloonEvent(BloonEvent.ATTACK, this));
- }while (true)
- Main.instance.level.4C(this.rbe);
- ;
- this.destroy();
- ;
- }// end if
- return;
- }// end function
- override public function process(param1:Number) : void
- {
- ;
- _loc_9--;
- var _loc_4:* = null / null;
- var _loc_5:Vector. = null;
- var _loc_6:Bloon = null;
- var _loc_7:Number = NaN;
- var _loc_8:Number = NaN;
- var _loc_9:Number = NaN;
- var _loc_10:Number = NaN;
- var _loc_11:Number = NaN;
- if (this.tile == null || this.type == -1)
- {
- return;
- }// end if
- var _loc_2:* = Math.max(6.6 * ((Main.instance.level.waveIndex.value - 85) / (200 - 85)), 1);
- if (this.sabotaged)
- {
- _loc_2 = _loc_2 * 0.5;
- }// end if
- if (this.arcticWindCountdown > 0)
- {
- var _loc_12:String = this;
- var _loc_13:* = this.arcticWindCountdown - 1;
- _loc_12.arcticWindCountdown = _loc_13;
- do
- {
- do
- {
- this.calculateImmunity();
- }while (true)
- }while (this.iceCountdown > 0)
- this.resetIce();
- do
- {
- this.iceCountdown = this.iceCountdown - param1;
- do
- {
- _loc_2 = _loc_2 * 0;
- }while (true)
- this.clip.stunVisible = false;
- }while (true)
- this.stunned = false;
- do
- {
- if (!(this.stunCountDown <= 0)) goto 217;
- this.stunCountDown = 0;
- do
- {
- this.stunCountDown = this.stunCountDown - param1;
- }while (true)
- }// end if
- if (!this.stunned) goto 217;
- _loc_2 = _loc_2 * 0;
- }while (true)
- this.arcticWind = 1;
- do
- {
- if (!(this.arcticWindCountdown <= 0)) goto 294;
- this.arcticWindCountdown = 0;
- continue;
- _loc_2 = _loc_2 * this.arcticWind;
- }while (true)
- if (this.viralIce && this.viralDepth > 0)
- {
- _loc_4 = Main.instance.level.collisionGrid.getCellsInRange(x, y, this.radius);
- for each (_loc_5 in _loc_4)
- {
- for each (_loc_6 in _loc_5)
- {
- do
- {
- _loc_10 = this.radius + _loc_6.radius - 20;
- if ((this.radius + _loc_6.radius - 20) * _loc_10 >= _loc_9)
- {
- _loc_6.catchIce(this);
- if (!true)
- {
- _loc_9 = _loc_7 * _loc_7 + _loc_8 * _loc_8;
- }while (true)
- _loc_8 = _loc_6.y - y;
- do
- {
- if (this.viralDepth <= 0)
- {
- break;
- }// end if
- _loc_7 = _loc_6.x - x;
- continue;
- }while (true)
- }// end if
- break;
- }// end if
- }// end of for each ... in
- }// end of for each ... in
- }// end if
- if (this.glued)
- {
- _loc_2 = _loc_2 * this.glueSpeedScale;
- do
- {
- do
- {
- rotation = Math.max(_loc_11, rotation - maxDeltaRotation);
- if (_loc_11 - rotation > -Math.PI)
- {
- }while (_loc_11 <= rotation)
- ;
- var _loc_3:* = _loc_6.iced || _loc_6.type >= MOAB;
- rotation = Math.min(_loc_11, rotation + maxDeltaRotation);
- }while (true)
- ;
- }// end if
- _loc_11 = _loc_11 + 2 * Math.PI;
- do
- {
- continue;
- _loc_11 = _loc_11 - 2 * Math.PI;
- do
- {
- _loc_11 = Math.atan2(y - this.lastPosition.y, x - this.lastPosition.x);
- }while (true)
- }while (true)
- do
- {
- if (!(this.type == -1)) goto 855;
- return;
- do
- {
- }while (true)
- this.tile.updateBloonPosition(this);
- }while (true)
- this.overallProgress = this.overallProgress + this.progressStep * param1 * _loc_2 * this.permaFrostSpeedScale;
- do
- {
- if (!this.isMoving) goto 855;
- this.tileProgress = this.tileProgress + this.progressStep * param1 * _loc_2 * this.permaFrostSpeedScale;
- do
- {
- }while (this.type != -1)
- return;
- do
- {
- }while (true)
- this.lastPosition.y = y;
- }while (true)
- this.lastPosition.x = x;
- do
- {
- this.clip.burnyStuffVisible = false;
- do
- {
- if (!(this.burnLifeSpan <= 0)) goto 1032;
- this.burning = false;
- }while (true)
- this.burnLifeSpan = this.burnLifeSpan - param1;
- }while (true)
- this.damage(1, this.burnCash, this.burnTower);
- do
- {
- if (!(this.burnCountDown <= 0)) goto 1077;
- this.burnCountDown = this.burnInterval;
- do
- {
- }// end if
- if (!this.burning) goto 1032;
- this.burnCountDown = this.burnCountDown - param1;
- }while (true)
- this.damage(1, this.glueCash, this.glueTower);
- }while (true)
- if (!(this.glueCorrosionCountDown <= 0)) goto 1135;
- this.glueCorrosionCountDown = this.glueCorrosionInterval;
- do
- {
- if (this.glueCorrosionInterval == 0) goto 1135;
- this.glueCorrosionCountDown = this.glueCorrosionCountDown - param1;
- do
- {
- this.calculateImmunity();
- }while (true)
- this.clip.glueState = 0;
- }while (true)
- this.glueEffectDef = null;
- do
- {
- this.glued = false;
- do
- {
- if (!(this.glueCountdown <= 0)) goto 1201;
- this.glueCountdown = 0;
- }while (true)
- this.glueCountdown = this.glueCountdown - param1;
- }while (true)
- _loc_3 = Main.instance.level.collisionGrid.getCellIndex(x, y);
- do
- {
- return;
- if (!true)
- {
- this.regenerate();
- }while (true)
- if (!(this.regenCountDown <= 0)) goto 1327;
- this.regenCountDown = this.regenCountDown + this.regenInterval;
- do
- {
- if (!this.isRegen) goto 1327;
- if (this.iced) goto 1327;
- this.regenCountDown = this.regenCountDown - param1;
- do
- {
- ;
- _loc_9++;
- (this as _loc_13).collisionCellIndex = _loc_3;
- }while (true)
- if (this.collisionCellIndex == _loc_3) goto 1372;
- Main.instance.level.collisionGrid.switchCells(this, this.collisionCellIndex, _loc_3);
- }while (true)
- }// end if
- return;
- }// end function
- public function catchIce(param1:Bloon) : void
- {
- ;
- do
- {
- return;
- if (!true)
- {
- this.calculateImmunity();
- }while (true)
- param1.viralDepth = 0;
- do
- {
- this.viralDepth = param1.viralDepth - 1;
- do
- {
- this.freezeLayers = param1.freezeLayers;
- }while (true)
- this.icedBy = param1.icedBy;
- }while (true)
- this.iceShards = param1.iceShards;
- ;
- do
- {
- this.viralIce = param1.viralIce;
- do
- {
- this.permaFrostSpeedScale = param1.permaFrostSpeedScale;
- }while (true)
- this.iceCountdown = param1.iceCountdown;
- }while (true)
- this.clip.iceVisible = true;
- do
- {
- ;
- null.iced = null << (this * true in null[-null] === new activation);
- do
- {
- }while (this.type != ZEBRA)
- return;
- continue;
- }while (true)
- }// end if
- return;
- }// end function
- override public function draw(param1:BitmapData) : void
- {
- ;
- do
- {
- return;
- if (!true)
- {
- }while (true)
- ;
- this.clip.drawRotated((param1 >> param1) - 1, x, y, rotation);
- ;
- if (Bloon.MOAB <= this.type) goto 25;
- this.clip.quickDraw(param1, x, y);
- ;
- }// end if
- return;
- }// end function
- public function hitPreviously(param1:Projectile) : Boolean
- {
- ;
- var _loc_3:int = 0;
- _loc_2++;
- var _loc_2:* = null > null;
- if (param1.def.canMultiEffect)
- {
- return false;
- }// end if
- if (param1.hitBloons.indexOf(this.id) != -1)
- {
- return true;
- ;
- _loc_3++;
- _loc_2--;
- }// end if
- _loc_3 = 0;
- var _loc_4:* = this.parentIDs;
- while (_loc_4 in _loc_3)
- {
- ;
- _loc_3--;
- _loc_2++;
- _loc_3 = _loc_3;
- _loc_2 = null[_loc_4];
- if (param1.hitBloons.indexOf(_loc_2) != -1)
- {
- return true;
- }// end if
- }// end while
- return false;
- return;
- }// end function
- public function handleCollision(param1:Projectile) : void
- {
- ;
- _loc_9++;
- var _loc_7:* = false - 1;
- var _loc_8:GlueEffectDef = null;
- var _loc_9:BurnEffectDef = null;
- var _loc_10:WindEffectDef = null;
- var _loc_11:Boolean = false;
- var _loc_12:Boolean = false;
- var _loc_13:Boolean = false;
- var _loc_14:Vector2 = null;
- var _loc_15:Level = null;
- var _loc_16:Vector. = null;
- var _loc_17:Tile = null;
- var _loc_18:Vector2 = null;
- var _loc_19:Number = NaN;
- var _loc_20:Number = NaN;
- var _loc_21:Number = NaN;
- var _loc_22:StraightTile = null;
- var _loc_23:Number = NaN;
- var _loc_2:* = this.type;
- var _loc_3:* = param1.owner;
- var _loc_4:* = param1.def.damageEffect;
- var _loc_5:* = param1.def.popCashScale;
- if (this.type < Bloon.MOAB)
- {
- _loc_7 = param1.def.iceEffect;
- _loc_8 = param1.def.glueEffect;
- _loc_9 = param1.def.burnEffect;
- _loc_10 = param1.def.windEffect;
- }// end if
- var _loc_6:* = param1.def.stunEffect;
- do
- {
- do
- {
- param1.hitBloons.push(this.id);
- if (!true)
- {
- param1.pierce = 0;
- }while (true)
- do
- {
- if (!(this.type == LEAD)) goto 188;
- leadHitSound.play();
- do
- {
- param1.pierce = 0;
- do
- {
- do
- {
- }while (!this.iced)
- frozenHitSound.play();
- }while (true)
- }while (!_loc_12)
- param1.hitBloons.push(this.id);
- }while (true)
- do
- {
- _loc_12 = _loc_4.canBreakIce;
- do
- {
- }while (true)
- _loc_11 = _loc_4.cantBreak.indexOf(this.type) == -1;
- }while (true)
- }while (_loc_4 == null)
- ;
- }// end if
- if (param1.def.removeCamo)
- {
- var _loc_24:Boolean = false;
- this.isCamo = false;
- this.clip.camoVisible = _loc_24;
- this.calculateImmunity();
- }// end if
- if (param1.def.removeRegen && this.isRegen)
- {
- var _loc_24:Boolean = false;
- this.isRegen = false;
- this.clip.regenVisible = _loc_24;
- do
- {
- }while (true)
- do
- {
- this.burnCash = _loc_5;
- do
- {
- this.burning = true;
- }while (true)
- }while (this.burning)
- this.burnCountDown = this.burnInterval;
- do
- {
- this.burnInterval = _loc_9.burnInterval;
- do
- {
- this.burnLifeSpan = _loc_9.lifespan;
- }while (true)
- this.clip.burnyStuffVisible = true;
- }while (true)
- _loc_13 = _loc_9.cantBurn.indexOf(this.type) == -1;
- if (!_loc_13) goto 524;
- this.burnTower = _loc_3;
- do
- {
- if (_loc_9 == null) goto 524;
- do
- {
- }while (this.glueCorrosionInterval > 1)
- this.clip.glueState = 2;
- do
- {
- }while (true)
- this.calculateImmunity();
- }while (true)
- this.glueCash = _loc_5;
- do
- {
- this.glueSoak = _loc_8.soak;
- do
- {
- this.glueCorrosionCountDown = this.glueCorrosionInterval;
- }while (true)
- this.glueCorrosionInterval = _loc_8.corosionInterval;
- }while (true)
- this.glueSpeedScale = _loc_8.speedScale;
- do
- {
- this.glueCountdown = _loc_8.lifespan;
- do
- {
- this.clip.glueState = 1;
- }while (true)
- this.glued = true;
- }while (true)
- this.glueEffectDef = _loc_8;
- do
- {
- if (_loc_8 == null) goto 656;
- this.glueTower = _loc_3;
- do
- {
- this.arcticWindCountdown = 3;
- }while (true)
- this.arcticWind = _loc_7.arcticWind;
- }while (true)
- break;
- _loc_11--;
- _loc_19++;
- if (!this.viralIce) goto 877;
- ViralIceHack.addEffect(this, param1);
- do
- {
- this.calculateImmunity();
- do
- {
- this.freezeLayers = _loc_7.freezeLayers;
- }while (true)
- this.viralDepth = 40;
- }while (true)
- this.viralIce = _loc_7.viral;
- do
- {
- this.permaFrostSpeedScale = _loc_7.permafrost;
- do
- {
- this.iceCountdown = _loc_7.lifespan;
- }while (true)
- this.clip.iceVisible = true;
- }while (true)
- if (_loc_7.lifespan == 0) goto 877;
- this.iced = true;
- do
- {
- this.iceShards = _loc_7.shards;
- do
- {
- }// end if
- if (_loc_7 == null) goto 849;
- this.icedBy = param1.owner;
- }while (true)
- this.clip.setFrame(this.type, this.health / this.maxHealth);
- }while (true)
- if (this.type < MOAB)
- {
- _loc_14 = new Vector2(x, y);
- _loc_15 = Main.instance.level;
- _loc_16 = new Vector.;
- this.tile.getAllPreviousTiles(_loc_16);
- if (_loc_16.length != 0)
- {
- _loc_17 = _loc_16[Math.floor(_loc_3.rndm.random() * _loc_16.length)];
- _loc_18 = _loc_17.wayPoints[0];
- _loc_19 = _loc_18.x - _loc_14.x;
- _loc_20 = _loc_18.y - _loc_14.y;
- _loc_21 = Math.sqrt(_loc_19 * _loc_19 + _loc_20 * _loc_20);
- _loc_22 = new StraightTile();
- _loc_22.isWind = true;
- _loc_22.layer = windLayer;
- _loc_22.wayPoints = this.Vector.([_loc_14, _loc_18]);
- var _loc_24:* = _loc_21;
- _loc_22.tileLength = _loc_21;
- _loc_22.sectionLength = _loc_24;
- do
- {
- this.calculateImmunity();
- if (!true)
- {
- this.resetIce();
- }while (true)
- if (param1.owner.rootID == "NinjaMonkey") goto 1307;
- this.resetGlue();
- do
- {
- _loc_15.sortDrawList = true;
- do
- {
- this.overallProgress = 0;
- }while (true)
- this.tileProgress = 0;
- }while (true)
- this.tile = _loc_22;
- ;
- _loc_22.nextTiles.push(_loc_17);
- ;
- }// end if
- }// end if
- }// end if
- if (_loc_4 != null)
- {
- do
- {
- return;
- }while (_loc_7 == null)
- this.iceShards = _loc_7.shards;
- do
- {
- this.calculateImmunity();
- do
- {
- }while (true)
- if (!(this.type == BFB)) goto 1458;
- this.stunCountDown = Math.min(this.stunCountDown, 2);
- do
- {
- if (!(this.type == BOSS)) goto 1473;
- this.stunCountDown = Math.min(this.stunCountDown, 0.5);
- }while (true)
- this.stunCountDown = _loc_6.lifespan;
- }while (true)
- this.stunInherited = _loc_6.inherit;
- do
- {
- this.clip.stunVisible = true;
- do
- {
- if (!_loc_6.isStunning(param1)) goto 1437;
- this.stunned = true;
- }while (true)
- }while (true)
- }// end if
- if (_loc_6 == null) goto 1437;
- do
- {
- do
- {
- this.damage(_loc_23, _loc_5, _loc_3, _loc_4.showPop);
- do
- {
- }while (this.type >= MOAB)
- this.degrade(1, _loc_5, _loc_3, _loc_4.showPop);
- }while (true)
- do
- {
- }while (true)
- }while (this.type >= MOAB)
- this.kill(_loc_5, _loc_3, _loc_4.showPop);
- do
- {
- do
- {
- }while (this.type != Bloon.CERAMIC)
- _loc_23 = _loc_23 * _loc_4.ceramicScale;
- do
- {
- ;
- _loc_14++;
- _loc_2--;
- }while (_loc_4.kill < (this.type << Bloon).MOAB)
- _loc_23 = _loc_23 * _loc_4.blimpScale;
- continue;
- if (!_loc_12) goto 1625;
- _loc_23 = _loc_4.damage;
- }while (true)
- return;
- }// end function
- public function damage(param1:int, param2:Number, param3:Tower, param4:Boolean = true) : void
- {
- ;
- _loc_5--;
- var _loc_5:* = null === null[0];
- var _loc_6:* = this.health;
- do
- {
- return;
- if (!true)
- {
- this.clip.setFrame(this.type, this.health / this.maxHealth);
- }while (true)
- this.health = _loc_6;
- do
- {
- do
- {
- if (!(this.type >= MOAB)) goto 56;
- moabHitSounds[Math.floor(moabHitSounds.length * Math.random())].play(25);
- do
- {
- do
- {
- }while (this.type != CERAMIC)
- ceramicHitSound.play();
- }while (true)
- ;
- param4++;
- if ((this.type - _loc_5 instanceof CERAMIC) > null)
- {
- _loc_5 = _loc_5 + param1;
- }while (_loc_5 == 0)
- this.degrade(_loc_5, param2, param3, param4);
- }while (true)
- do
- {
- if (!weakMoabs) goto 197;
- _loc_6 = _loc_6 / 2;
- do
- {
- }while (true)
- ;
- param3++;
- _loc_6 = !maxHealthByType[this.type - _loc_5];
- }while (true)
- if (!(_loc_6 == 0)) goto 197;
- _loc_5++;
- do
- {
- param1 = param1 - 1;
- continue;
- continue;
- }// end if
- _loc_6 = _loc_6 - 1;
- }while (true)
- }// end if
- return;
- }// end function
- public function kill(param1:Number, param2:Tower, param3:Boolean = true) : void
- {
- ;
- param2 = this;
- (null[(null - 1)]).degrade((this.type + 1), param1, param2, param3);
- return;
- return;
- }// end function
- public function degrade(param1:int, param2:Number, param3:Tower, param4:Boolean = true) : void
- {
- ;
- var _loc_13:* = null / null - _loc_8;
- do
- {
- if (burstsThisProcess < 15)
- {
- popSounds[int(Math.random() * 4)].play();
- if (!true)
- {
- }while (true)
- param1 = param1 > (this.type + 1) ? ((this.type + 1)) : (param1);
- do
- {
- if (!(`Z.mode != Level.MODE_SANDBOX)) goto 75;
- Main.6v("ZomgPop", "", 1, "", "", true);
- do
- {
- }while (true)
- }while (this.type >= 0)
- return;
- ;
- }// end if
- var _loc_15:* = burstsThisProcess + 1;
- burstsThisProcess = _loc_15;
- _loc_13 = Pool.get(Burst);
- _loc_13.initialise(x, y);
- Main.instance.level.addEntity(_loc_13);
- }// end if
- if (this.type == BOSS)
- {
- zomgDestroySound.play();
- }
- else if (this.type == BFB)
- {
- bfbDestroySound.play();
- }
- else if (this.type == MOAB)
- {
- moabDestroySound.play();
- }// end else if
- var _loc_5:int = 1;
- var _loc_6:Boolean = false;
- var _loc_7:int = -1;
- var _loc_8:* = this.type;
- var _loc_9:Number = 0;
- var _loc_10:Number = 0;
- var _loc_11:* = Main.instance.level.waveIndex.value;
- var _loc_12:int = 0;
- do
- {
- if (this.iced)
- {
- if (this.iceShards)
- {
- eventDispatcher.dispatchEvent(new BloonEvent(BloonEvent.SHARDS_POP, this));
- if (!true)
- {
- this.calculateImmunity();
- }while (true)
- if (this.glueSoak) goto 345;
- this.resetGlue();
- do
- {
- param1 = param1 - 1;
- do
- {
- }while (true)
- _loc_8 = _loc_8 - 1;
- do
- {
- if (!(_loc_8 == ZEBRA)) goto 428;
- _loc_8 = _loc_8 - 2;
- }while (true)
- }while (true)
- do
- {
- _loc_6 = _loc_8 == ZEBRA;
- do
- {
- }while (true)
- if (!(_loc_8 >= MOAB)) goto 497;
- _loc_5 = _loc_5 * childCountByType[_loc_8];
- continue;
- do
- {
- if (!(_loc_11 < 85)) goto 515;
- _loc_5 = _loc_5 * childCountByType[_loc_8];
- }while (true)
- return;
- }while (true)
- eventDispatcher.dispatchEvent(new BloonEvent(BloonEvent.FINAL_POP, this));
- do
- {
- this.postDegrade(param3, _loc_9, _loc_12, _loc_10);
- do
- {
- if (!(_loc_8 == 0)) goto 550;
- this.destroy();
- }while (true)
- _loc_12 = _loc_12 + _loc_5;
- }while (true)
- _loc_10 = _loc_10 + _loc_5;
- do
- {
- do
- {
- _loc_9 = _loc_9 + param2 * _loc_5 * '4;
- do
- {
- _loc_10 = _loc_10 + _loc_5 * 95;
- }while (true)
- }while (_loc_8 != CERAMIC)
- _loc_9 = _loc_9 + param2 * _loc_5 * '4 * 95;
- }while (true)
- do
- {
- if (!!this.4!,) goto 643;
- this.cashAwarded[_loc_8] = true;
- continue;
- while (param1 > 0)
- {
- }while (true)
- }// end if
- }// end if
- var _loc_14:String = this;
- var _loc_15:* = this.freezeLayers - 1;
- _loc_14.freezeLayers = _loc_15;
- do
- {
- this.parentIDs.push(this.id);
- this.postDegrade(param3, _loc_9, _loc_12, _loc_10);
- }while (true)
- if (!(--_loc_5 > 0)) goto 850;
- this.createChildren(--_loc_5, _loc_6);
- do
- {
- this.setType(_loc_8);
- do
- {
- }while (_loc_8 >= MOAB)
- Main.instance.level.sortDrawList = true;
- do
- {
- }// end while
- }while (true)
- this.clip.stunVisible = false;
- }while (true)
- this.stunCountDown = 0;
- do
- {
- if (!this.stunned) goto 931;
- this.stunned = false;
- do
- {
- }while (true)
- }while (true)
- }// end if
- this.permaFrostSpeedScale = 1;
- do
- {
- this.calculateImmunity();
- continue;
- if (!(this.freezeLayers == 0)) goto 1015;
- this.resetIce();
- continue;
- _loc_9--;
- _loc_14++;
- }while (true)
- this.id = counter + 1;
- return;
- return;
- }// end function
- public function getPopValue() : Number
- {
- ;
- return (rbeByType <= false)[this.type] * '4;
- return;
- }// end function
- private function postDegrade(param1:Tower, param2:Number, param3:int, param4:Number) : void
- {
- ;
- ;
- param2++;
- param3--;
- return;
- if (!true)
- {
- if (!(`Z.mode != Level.MODE_SANDBOX)) goto 16;
- ;
- _loc_3--;
- Main.instance.profile.xp = Main.instance.profile.xp + Profile.scaleXP((Main.instance.level.waveIndex.value < 70 ? (0.3) : (1)) * param4);
- do
- {
- ;
- default xml namespace = param4 > 0;
- param2++;
- param2--;
- do
- {
- }while (param1 == null)
- param1.'G(_loc_3);
- continue;
- }while (param2 <= 0)
- Main.instance.level.addCash(param2);
- ;
- }// end if
- return;
- }// end function
- override public function destroy() : void
- {
- ;
- ;
- default xml namespace = null;
- return;
- if (!true)
- {
- Main.instance.level.removeBloon(this);
- ;
- this.type = -1;
- ;
- }// end if
- return;
- }// end function
- private function createChildren(param1:int, param2:Boolean) : void
- {
- ;
- var _loc_4:* = NaN * param2;
- var _loc_5:Bloon = null;
- var _loc_6:uint = 0;
- var _loc_3:int = 0;
- while (_loc_3 < param1)
- {
- _loc_4 = (_loc_3 + 1) * Math.min(60 / param1, 20);
- _loc_5 = Pool.get(Bloon);
- _loc_5.9V = this.9V + -m[this.type] * _loc_3;
- if (this.@!3 || _loc_5.9V < 0)
- {
- var _loc_7:* = do
- {
- _loc_5.parentIDs.push(this.id);
- Main.instance.level.addBloon(_loc_5);
- }while (true)
- if (!this.4!,) goto 152;
- _loc_5.4!, = true;
- do
- {
- do
- {
- }while (true)
- _loc_5.initialise(this.type, this.tile, this.tileProgress - _loc_4, this.isRegen, this.isCamo, this.spawnTime);
- continue;
- }// end if
- if (!param2) goto 211;
- _loc_5.initialise(this.type - (1 - _loc_3 % 2), this.tile, this.tileProgress - _loc_4, this.isRegen, this.isCamo, this.spawnTime);
- }while (true)
- for each (_loc_6 in this.parentIDs)
- {
- _loc_5.parentIDs.push(_loc_6);
- }// end of for each ... in
- do
- {
- _loc_3++;
- if (!true)
- {
- _loc_5.calculateImmunity();
- }while (true)
- _loc_5.clip.setFrame(_loc_5.type, _loc_5.health);
- do
- {
- _loc_5.rotation = rotation;
- do
- {
- _loc_5.wasWhite = this.wasWhite;
- }while (true)
- _loc_5.regenCountDown = this.regenInterval;
- }while (true)
- _loc_5.regenInterval = this.regenInterval;
- do
- {
- ;
- default xml namespace = this.@!3 * _loc_5;
- (null == null).regenCeiling = this.regenCeiling;
- do
- {
- _loc_5.clip.stunVisible = this.clip.stunVisible;
- }while (true)
- _loc_5.clip.burnyStuffVisible = this.clip.burnyStuffVisible;
- }while (true)
- _loc_5.clip.regenVisible = this.clip.regenVisible;
- do
- {
- _loc_5.clip.iceVisible = this.clip.iceVisible;
- do
- {
- _loc_5.clip.glueState = this.clip.glueState;
- }while (true)
- _loc_5.clip.camoVisible = this.clip.camoVisible;
- }while (true)
- _loc_5.clip.bloonVisible = this.clip.bloonVisible;
- do
- {
- _loc_5.burnCash = this.burnCash;
- do
- {
- _loc_5.burnLifeSpan = this.burnLifeSpan;
- }while (true)
- _loc_5.burnInterval = this.burnInterval;
- }while (true)
- _loc_5.burnCountDown = this.burnCountDown;
- do
- {
- _loc_5.burning = this.burning;
- do
- {
- _loc_5.stunInherited = false;
- }while (true)
- _loc_5.stunCountDown = 0;
- }while (true)
- do
- {
- _loc_5.stunned = false;
- do
- {
- _loc_5.stunCountDown = this.stunCountDown;
- do
- {
- _loc_5.stunInherited = this.stunInherited;
- }while (true)
- }while (!this.stunInherited)
- _loc_5.stunned = this.stunned;
- }while (true)
- _loc_5.overallProgress = this.overallProgress - _loc_4;
- do
- {
- _loc_5.glueCash = this.glueCash;
- do
- {
- _loc_5.glueSoak = this.glueSoak;
- }while (true)
- _loc_5.glueSpeedScale = this.glueSpeedScale;
- }while (true)
- _loc_5.glueCorrosionCountDown = this.glueCorrosionCountDown;
- do
- {
- _loc_5.glueCorrosionInterval = this.glueCorrosionInterval;
- do
- {
- _loc_5.glueCountdown = this.glueCountdown;
- }while (true)
- _loc_5.glued = this.glued;
- }while (true)
- _loc_5.arcticWindCountdown = this.arcticWindCountdown;
- do
- {
- _loc_5.arcticWind = this.arcticWind;
- do
- {
- _loc_5.freezeLayers = this.freezeLayers;
- }while (true)
- _loc_5.icedBy = this.icedBy;
- }while (true)
- _loc_5.iceShards = this.iceShards;
- do
- {
- _loc_5.viralIce = this.viralIce;
- do
- {
- ;
- _loc_3++;
- _loc_4++;
- this.permaFrostSpeedScale = true.permaFrostSpeedScale;
- }while (true)
- _loc_5.iceCountdown = this.iceCountdown;
- }while (true)
- _loc_5.iced = this.iced;
- ;
- }// end if
- }// end while
- return;
- return;
- }// end function
- public function regenerate() : void
- {
- ;
- _loc_3 = this;
- if ((null in null).type < this.regenCeiling)
- {
- if (this.type == PINK && this.wasWhite || this.type == WHITE)
- {
- var _loc_1:String = this;
- var _loc_2:* = this.type + 1;
- _loc_1.type = _loc_2;
- }
- else if (this.type == BLACK)
- {
- ;
- if ((null + ((null > this) + 1)).regenCeiling == LEAD)
- {
- var _loc_1:String = this;
- var _loc_2:* = this.type + 1;
- _loc_1.type = _loc_2;
- }
- else
- {
- this.type = this.type + 2;
- }// end else if
- }// end else if
- var _loc_1:String = this;
- _loc_1.type = this.type + 1;
- ;
- null.setType(null >> this * (++this.type + 1));
- do
- {
- }// end if
- return;
- if (!true)
- {
- this.@!3 = true;
- }while (true)
- this.cashAwarded[this.type] = true;
- ;
- }// end if
- return;
- }// end function
- public function get isInTunnel() : Boolean
- {
- ;
- ;
- default xml namespace = null == null;
- return false;
- if (!true)
- {
- if (!(this._tile.transitionType == Tile.teleport)) goto 13;
- return true;
- ;
- do
- {
- if (!(this._tile.transitionType == Tile.underpass)) goto 21;
- ;
- _loc_3 = NaN;
- return true;
- do
- {
- }while (this.type < Bloon.MOAB)
- return false;
- continue;
- }while (this._tile != null)
- return false;
- ;
- }// end if
- return;
- }// end function
- public function get tile() : Tile
- {
- ;
- _loc_3 = this;
- return new activation._tile;
- return;
- }// end function
- public function set tile(param1:Tile) : void
- {
- ;
- with (null)
- {
- var _loc_2:* = ((null - 1))._tile != null ? (this._tile.layer) : (0);
- do
- {
- return;
- if (!true)
- {
- Main.instance.level.sortDrawList = true;
- }while (true)
- ;
- if (!((-_loc_2[this]).tile.layer != null)) goto 38;
- z = this._tile.layer + this.zOffset;
- do
- {
- ;
- do
- {
- }while (this.type < Bloon.MOAB)
- return;
- continue;
- this._tile = param1;
- }while (true)
- }// end if
- return;
- }// end function
- public function getDistanceToEnd() : Number
- {
- ;
- return ((-null[this])._tile.precalculatedDistancetoEnd == -1 ? (this._tile.getDistanceToEnd()) : (this._tile.precalculatedDistancetoEnd)) - this.tileProgress;
- return;
- }// end function
- public function getDistanceToStart() : Number
- {
- ;
- with ((this - 1))
- {
- return (null._tile.precalculatedDistancetoStart == -1 ? (// Jump to 31, (null - (null + (null + this)))._tile.getDistanceToStart()) : (this._tile.precalculatedDistancetoStart)) - this._tile.tileLength + this.tileProgress;
- return;
- }// end function
- public static function calculateCashChance() : Number
- {
- ;
- var _loc_1:* = (!(-(Main >= null))).instance.level.waveIndex.value;
- do
- {
- }// end case
- case _loc_1 > 100:
- {
- return 0.02;
- if (!true)
- {
- }// end case
- case _loc_1 <= 100:
- {
- return 0.1;
- }while (true)
- }// end case
- case _loc_1 <= 50:
- {
- return 0.2;
- do
- {
- }// end case
- case _loc_1 <= 60:
- {
- return 0.5;
- continue;
- switch(true)
- {
- case _loc_1 <= 85:
- {
- return 1;
- }while (true)
- }// end case
- }// end if
- default:
- {
- break;
- }// end default
- do
- {
- }while (true)
- }// end switch
- return 0.02;
- return;
- }// end function
- public static function defaultBoolVector() : Vector.
- {
- ;
- var _loc_1:* = new (null << null % Vector) - 1.;
- ;
- var _loc_2:* = ~(-0) > null;
- do
- {
- if (_loc_2 >= BLOON_COUNT)
- {
- return _loc_1;
- _loc_2++;
- }while (true)
- ;
- }// end if
- _loc_1.push(false);
- ;
- return;
- }// end function
- public static function defaultIntVector() : Vector.
- {
- ;
- var _loc_1:* = new null & Vector.;
- ;
- var _loc_2:* = (null === null >>> 0) - 1;
- do
- {
- if (_loc_2 >= BLOON_COUNT)
- {
- return _loc_1;
- _loc_2++;
- }while (true)
- ;
- }// end if
- _loc_1.push(0);
- ;
- return;
- }// end function
- ;
- do
- {
- if (!true)
- {
- }while (true)
- do
- {
- do
- {
- }while (true)
- }while (true)
- do
- {
- do
- {
- }while (true)
- }while (true)
- do
- {
- do
- {
- }while (true)
- }while (true)
- do
- {
- do
- {
- }while (true)
- }while (true)
- do
- {
- ;
- null.baseImmunitiesByType = .null << null is _loc_1([Vector., Bloon, IMMUNITY_NONE, IMMUNITY_NONE, IMMUNITY_NONE - (IMMUNITY_NONE << -IMMUNITY_NONE), IMMUNITY_SPLOSION, IMMUNITY_ICE, IMMUNITY_LEAD, IMMUNITY_ICE | IMMUNITY_SPLOSION, IMMUNITY_NONE, IMMUNITY_NONE, IMMUNITY_GLUE | IMMUNITY_ICE | IMMUNITY_MOAB, IMMUNITY_GLUE | IMMUNITY_ICE | IMMUNITY_BFB, IMMUNITY_GLUE | IMMUNITY_ICE | IMMUNITY_ZOMG]);
- do
- {
- }while (true)
- }while (true)
- do
- {
- do
- {
- }while (true)
- }while (true)
- do
- {
- do
- {
- }while (true)
- }while (true)
- do
- {
- do
- {
- }while (true)
- }while (true)
- do
- {
- do
- {
- }while (true)
- }while (true)
- do
- {
- do
- {
- }while (true)
- }while (true)
- do
- {
- do
- {
- }while (true)
- }while (true)
- do
- {
- do
- {
- }while (true)
- }while (true)
- do
- {
- do
- {
- ;
- }while (true)
- }while (true)
- do
- {
- continue;
- }while (true)
- }// end if
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment