STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
228050
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2560 · P5120

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/19453155?noj=FRM19453155-24DC" width="1" height="1"></div>

382321_xenotactic944a.swf

This is the info page for
Flash #207936

(Click the ID number above for more basic data on this flash file.)


ActionScript [AS1/AS2]
Combined Code
movieClip 6 TowerPip { } movieClip 8 RocketTurret { frame 1 { stop(); } } // unknown tag 88 length 63 // unknown tag 88 length 63 movieClip 16 { } movieClip 19 { } movieClip 29 { } movieClip 30 { frame 1 { stop(); } frame 5 { stop(); } } movieClip 33 { frame 1 { stop(); } frame 5 { stop(); } } movieClip 34 Top { instance btnStart of movieClip 30 { onClipEvent (load) { msg.text = 'START'; } onClipEvent (press) { if (_root.game.gameState > 2) { return undefined; } if (_root.game.gameState == -1) { return undefined; } if (msg.text == 'START') { _root.game.Start(); } else { if (msg.text == 'PAUSE') { _root.game.Pause(); } else { if (msg.text == 'RESUME') { _root.game.Resume(); } } } _root.game.PlayButtonSound(); } onClipEvent (rollOver) { gotoAndPlay(2); } onClipEvent (rollOut) { gotoAndPlay(6); } } instance btnReset of movieClip 33 { onClipEvent (load) { msg.text = 'QUIT'; } onClipEvent (press) { if (_root.game.gameState == -1) { return undefined; } _root.resetpanel._visible = true; _root.game.Pause2(); } onClipEvent (rollOver) { gotoAndPlay(2); } onClipEvent (rollOut) { gotoAndPlay(6); } } } movieClip 38 { } movieClip 39 { frame 1 { function SetPercentage(p) { this.innerBar._width = 67 * p; } } } movieClip 44 { } movieClip 47 { } movieClip 49 UpgradePanel { #initclip Object.registerClass('UpgradePanel', UpgradePanel); #endinitclip instance upgradeButton of movieClip 47 { onClipEvent (press) { if (_root.game.gameState == 1) { this._parent.Upgrade(); } else { if (_root.game.gameState < 2) { _root.game.UpgradeSelectedTower(true); _root.game.SelectCell(this._parent.tower.topLeftCell.row, this._parent.tower.topLeftCell.col); } } } } } movieClip 50 LevelBar { #initclip Object.registerClass('LevelBar', LevelBar); #endinitclip } movieClip 51 { } movieClip 52 PauseOverlay { frame 1 { function Show() { fade = 0; this.cacheAsBitmap = true; this._visible = true; this._alpha = fade; this.onEnterFrame = function () { fade += 20; this._alpha = fade; if (fade >= 100) { this.cacheAsBitmap = false; this._alpha = 100; this.onEnterFrame = ''; } }; } function Hide() { fade = 100; this.cacheAsBitmap = true; this.onEnterFrame = function () { fade -= 10; this._alpha = fade; if (fade <= 0) { this.cacheAsBitmap = false; this._visible = false; this._alpha = 0; this.onEnterFrame = ''; } }; } var fade; } } movieClip 59 { } movieClip 64 { } movieClip 69 { } movieClip 71 { } movieClip 72 InfoPanel { #initclip Object.registerClass('InfoPanel', InfoPanel); #endinitclip instance sell of movieClip 69 { onClipEvent (press) { _root.game.SellSelectedTower(); } } instance close of movieClip 71 { onClipEvent (press) { _root.game.CancelSelect(); } } } movieClip 73 WaterLauncher { } movieClip 74 BashChassis { } movieClip 75 { } movieClip 76 SparkChassis { } movieClip 77 WaterBase { } movieClip 80 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } } movieClip 81 FrostTurret { frame 1 { stop(); } } movieClip 82 FrostChassis { } movieClip 85 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } } movieClip 86 { } movieClip 87 RocketChassis { } movieClip 90 { } movieClip 93 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } } movieClip 96 { frame 1 { stop(); } } movieClip 97 { } movieClip 99 { } movieClip 103 { frame 1 { function SetPips(num) { _parent.chassis.turret.grade.gotoAndStop(num + 1); gotoAndStop(num + 1); } stop(); } } movieClip 106 { frame 1 { stop(); } frame 8 { stop(); this.removeMovieClip(this); } frame 16 { _parent._parent.removeMovieClip(); } } movieClip 109 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } } movieClip 110 { } movieClip 111 { } movieClip 114 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } } movieClip 115 { } movieClip 116 { } movieClip 119 { } movieClip 120 Tower { #initclip Object.registerClass('Tower', Tower); #endinitclip } movieClip 122 ShotSpray { #initclip Object.registerClass('ShotSpray', ShotSpray); #endinitclip } movieClip 124 { } movieClip 131 { } movieClip 132 { frame 306 { removeMovieClip(this); } } movieClip 139 { } movieClip 188 { } movieClip 189 Shot { #initclip Object.registerClass('Shot', Shot); #endinitclip } movieClip 191 hTower { } movieClip 194 { } movieClip 195 hRange { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } } movieClip 197 { } movieClip 199 { } movieClip 200 hCell { } movieClip 225 { } movieClip 246 { } movieClip 247 Fragment { #initclip Object.registerClass('Fragment', Fragment); #endinitclip instance of movieClip 225 { onClipEvent (load) { } } } movieClip 250 { frame 1 { if (_root.game.gameState != 0) { play(); } else { stop(); } } } movieClip 251 { } movieClip 252 { } movieClip 253 { } movieClip 254 { } movieClip 255 { } movieClip 256 { } movieClip 257 { } movieClip 258 { } movieClip 259 { } movieClip 260 { } movieClip 261 { } movieClip 262 { } movieClip 263 { } movieClip 264 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } frame 7 { stop(); } frame 8 { stop(); } frame 9 { stop(); } frame 10 { stop(); } frame 11 { stop(); } frame 12 { stop(); } frame 13 { stop(); } frame 14 { stop(); } frame 15 { stop(); } frame 16 { stop(); } frame 17 { stop(); } frame 18 { stop(); } frame 19 { stop(); } frame 20 { stop(); } frame 21 { stop(); } frame 22 { stop(); } frame 23 { stop(); } frame 24 { stop(); } frame 25 { stop(); } frame 26 { stop(); } frame 27 { stop(); } frame 28 { stop(); } frame 29 { stop(); } frame 30 { stop(); } frame 31 { stop(); } frame 32 { stop(); } frame 33 { stop(); } frame 34 { stop(); } frame 35 { stop(); } frame 36 { stop(); } frame 37 { stop(); } frame 38 { stop(); } frame 39 { stop(); } frame 40 { stop(); } frame 41 { stop(); } frame 42 { stop(); } frame 43 { stop(); } frame 44 { stop(); } frame 45 { stop(); } frame 46 { stop(); } frame 47 { stop(); } frame 48 { stop(); } frame 49 { stop(); } frame 50 { stop(); } frame 51 { stop(); } frame 52 { stop(); } frame 53 { stop(); } frame 54 { stop(); } frame 55 { stop(); } frame 56 { stop(); } frame 57 { stop(); } frame 58 { stop(); } frame 59 { stop(); } frame 60 { stop(); } frame 61 { stop(); } frame 62 { stop(); } frame 63 { stop(); } frame 64 { stop(); } frame 65 { stop(); } frame 66 { stop(); } frame 67 { stop(); } frame 68 { stop(); } frame 69 { stop(); } frame 70 { stop(); } frame 71 { stop(); } frame 72 { stop(); } frame 73 { stop(); } frame 74 { stop(); } frame 75 { stop(); } frame 76 { stop(); } frame 77 { stop(); } frame 78 { stop(); } frame 79 { stop(); } frame 80 { stop(); } frame 81 { stop(); } frame 82 { stop(); } frame 83 { stop(); } frame 84 { stop(); } frame 85 { stop(); } frame 86 { stop(); } frame 87 { stop(); } frame 88 { stop(); } frame 89 { stop(); } frame 90 { stop(); } frame 91 { stop(); } frame 92 { stop(); } frame 93 { stop(); } frame 94 { stop(); } frame 95 { stop(); } frame 96 { stop(); } frame 97 { stop(); } frame 98 { stop(); } frame 99 { stop(); } frame 100 { stop(); } } movieClip 265 { frame 1 { if (_root.game.gameState != 0) { play(); } else { stop(); } } } movieClip 266 { frame 1 { stop(); } } movieClip 267 { instance mob of movieClip 264 { onClipEvent (load) { this.gotoAndStop(_root.game.level); } } instance mob of movieClip 266 { onClipEvent (load) { this.gotoAndStop(_root.game.level); } } instance mob of movieClip 264 { onClipEvent (load) { this.gotoAndStop(1); } } instance mob of movieClip 264 { onClipEvent (load) { this.gotoAndStop(6); } } } movieClip 269 { } movieClip 271 { } movieClip 274 { frame 6 { stop(); _parent.removeMovieClip(); } } movieClip 275 Creep { #initclip Object.registerClass('Creep', Creep); #endinitclip frame 1 { stop(); } instance bash of movieClip 269 { onClipEvent (load) { this._visible = false; } } frame 2 { stop(); } } movieClip 278 Bounty { frame 1 { function SetBounty() { this.cacheAsBitmap = true; if (num > 0) { bounty.text = '+' + num + ' $'; } else { bounty.text = num; var v2 = new Color(bounty); v2.setRGB(0); } } var num; SetBounty(); } instance of movieClip 225 { onClipEvent (load) { } } frame 13 { removeMovieClip(this); } } movieClip 279 Grid { #initclip Object.registerClass('Grid', Grid); #endinitclip } frame 1 { Stage.scaleMode = 'noScale'; Stage.showMenu = false; fscommand('trapallkeys', 'true'); _quality = 'low'; _root.biscuit = SharedObject.getLocal('xenotactic'); stop(); } movieClip 283 { } movieClip 286 { } movieClip 287 { frame 20 { stop(); } } movieClip 289 { } movieClip 290 { frame 60 { stop(); } instance of movieClip 289 { onClipEvent (enterFrame) { gotoAndPlay(random(100)); } } } movieClip 291 { } movieClip 294 { } // unknown tag 88 length 62 movieClip 297 { } movieClip 298 { } instance of movieClip 298 { onClipEvent (load) { total = _root.getBytesTotal(); } onClipEvent (enterFrame) { loaded = _root.getBytesLoaded(); percent = int((loaded / total) * 100); text = percent + '%'; gotoAndStop(percent); if (loaded == total) { _root.gotoAndPlay(2); } } } button 299 { on (press) { getURL('http://www.onlinegamesquad.com', ''); } } movieClip 503 __Packages.LevelBar { #initclip if (!_global.LevelBar) { var v1 = function () { super(); }; _global.LevelBar = v1; _global.LevelBar extends MovieClip; var v2 = v1.prototype; v2.CreateLevels = function (levels) { this.Clear(); this.setMask(); var v5 = 1; while (v5 < levels.length) { var v3 = levels[v5]; var v4; var v6 = v3.color; var v9 = this.HEXtoRGB(v6); if (v3.immune) { v4 = 'IMMUNE'; } else { if (v3.flying) { v4 = 'FLYING'; } else { if (v3.speed > 1) { v4 = 'FAST'; } else { if (v3.delay < 14) { v4 = 'GROUP'; } else { if (v3.spawn > 1) { v4 = 'SPAWN'; } else { v4 = 'NORMAL'; } } } } } if (v3.count < 4) { v4 = 'BOSS'; } this.attachMovie('LevelBarItem', 'levelBarItem' + (v5 - 1), v5 - 1, {'_x': (v5 - 1) * 60, '_y': 0, 'txt': v4, 'fc': v6, 'lvl': v3.level}); ++v5; } this.Reset(); this.setMask(_root.Interface.levelMaskBar); }; v2.Clear = function () { var v2 = 0; while (v2 < this.getNextHighestDepth()) { var v3 = this['levelBarItem' + v2]; v3.removeMovieClip(); ++v2; } }; v2.HEXtoRGB = function (hex) { if (!isNaN(hex)) { var v2 = hex; var v1 = v2 >> 16; var v3 = (v2 ^ v1 << 16) >> 8; var v5 = v2 ^ v1 << 16 ^ v3 << 8; return {'r': v1, 'g': v3, 'b': v5}; } var v2 = parseInt(hex, 16); var v1 = v2 >> 16; var v3 = (v2 ^ v1 << 16) >> 8; var v5 = v2 ^ v1 << 16 ^ v3 << 8; return {'r': v1, 'g': v3, 'b': v5}; }; v2.SetLevel = function (level, timeToLevel, lastLevel) { if (!lastLevel) { this.increment = 60 / timeToLevel * 24; this.posX = 230 + -level * 60; } else { this.increment = 0; this.posX = 230 + -level * 60; } this._x = this.posX; }; v2.onEnterFrame = function () { if (_root.game.gameState == 1) { this.posX -= this.increment; this._x = int(this.posX); } }; v2.Reset = function () { this._x = 230; }; ASSetPropFlags(_global.LevelBar.prototype, null, 1); } #endinitclip } movieClip 504 __Packages.InfoPanel { #initclip if (!_global.InfoPanel) { var v1 = function () { super(); this._visible = false; }; _global.InfoPanel = v1; _global.InfoPanel extends MovieClip; var v2 = v1.prototype; v2.GetSpeed = function (hr) { if (hr == 0) { return ''; } if (hr < 7) { return 'very fast'; } else { if (hr < 13) { return 'fast'; } else { if (hr < 37) { return 'average'; } else { if (hr < 61) { return 'slow'; } else { return 'very slow'; } } } } }; v2.CheckGold = function () {}; v2.SetCreep = function (c) { this.tower = undefined; this.towerObj = undefined; this.towerBtn = undefined; this.creep = c; with (this.creepPanelDetails) { _visible = true; flying.text = c.flying ? 'Yes' : 'No'; immune.text = c.immune ? 'Yes' : 'No'; health.text = c.health; speed.text = c.speed; } this.towerName.text = ((c.size == 150) ? 'Queen' : 'Alien') + ' Level ' + c.level; this.desc.text = ''; this.panelDetails._visible = false; this._visible = true; this.sell._visible = false; this.close._visible = true; }; v2.onEnterFrame = function () { if (this.creep) { this.creepPanelDetails.health.text = this.creep.health; } }; v2.SetTowerInfo = function (to, btn) { if (!this.tower && !this.creep) { with (this.panelDetails) { cost.text = to.cost; damage.text = to.damage; range.text = to.range; speed.text = this.GetSpeed(to.hitRate); } this.towerName.text = to.towerName; this.desc.text = to.desc; this._visible = true; this.sell._visible = false; this.close._visible = false; this.creepPanelDetails._visible = false; this.towerObj = to; this.towerBtn = btn; } }; v2.CancelInfo = function () { if (!this.tower && !this.creep) { this._visible = false; } }; v2.SetTower = function (t) { this.towerObj = undefined; this.towerBtn = undefined; this.creep = undefined; this.tower = t; with (this.panelDetails) { _visible = true; cost.text = t.cost; damage.text = t.damage; range.text = t.range; speed.text = this.GetSpeed(t.hitRate); } this.towerName.text = t.towerName; this.desc.text = t.desc; this.creepPanelDetails._visible = false; this._visible = true; this.close._visible = true; if (t.topLeftCell) { this.sell._visible = true; this.sell.msg.text = int(t.cost * 0.75) + ' $'; } else { this.sell._visible = false; } }; v2.Cancel = function () { this._visible = false; this.tower = undefined; this.creep = undefined; this.towerObj = undefined; this.towerBtn = undefined; }; ASSetPropFlags(_global.InfoPanel.prototype, null, 1); } #endinitclip } movieClip 505 __Packages.Tower { #initclip if (!_global.Tower) { var v1 = function () { super(); this.shotField = _root.shotField; this.groundField = _root.groundField; this.hTower = _root.game.gridField.hTower; this._visible = false; this._height = _root.game.gridSize * this.size; this._width = this._height; this.upgradeBar._visible = false; this.gotoAndStop(this.towerType); this.shotTick = 0; var v4; switch (this.towerType) { case 1: v4 = 2; break; case 2: v4 = 2; break; case 3: v4 = 2; break; case 4: v4 = 2; break; case 5: v4 = 2; break; case 6: v4 = 2; break; case 7: v4 = 2; break; case 8: v4 = 2; } this.size = v4; this.targetAngle = 0; this.targetTick = 0; this.scanTick = 6; this.upTicks = 0; this.upTickTotal = 0; this.targets = []; this.targetNum = -1; this.selling = false; this.override = false; this.SetSelected(false); }; _global.Tower = v1; _global.Tower extends MovieClip; var v2 = v1.prototype; v2.Sell = function (_arg3) { var v2 = 12 + (_arg3 / 3) * 24; if (v2 > 240) { v2 = 240; } this.sellTickTotal = v2; this.sellTicks = this.sellTickTotal; this.upgradeBar._visible = true; this.upgradeBar._width = 20; this.chassis._visible = false; this.selling = true; }; v2.DoSell = function () { _root.game.CancelSelect(); _root.game.gridField.CancelSelect(); _root.game.SellTower(this); this.removeMovieClip(); }; v2.Upgrade = function (_arg2) { this.upObject = _arg2; this.upTickTotal = (2 + (this.level - 1) * 4) * 24; this.upTicks = this.upTickTotal; this.upgradeBar._visible = true; this.upgradeBar._width = 0; this.chassis._visible = false; }; v2.ApplyUpgrade = function () { var v3 = this.upObject.range != this.range; if (v3) { _root.game.ModifyTowerRangeBox(this, false); } this.towerName = this.upObject.towerName; this.damage = this.upObject.damage; this.range = this.upObject.range; this.hitRate = this.upObject.hitRate; this.splash = this.upObject.splash; this.slow = this.upObject.slow; this.cost = this.upObject.cost; this.level = this.upObject.level; this.bash = this.upObject.bash; if (v3) { _root.game.ModifyTowerRangeBox(this, true); } this.pips.SetPips(this.level - 1); this.SetRotation(); this.upObject = undefined; this.upTicks = 0; this.upTickTotal = 0; this.upgradeBar._visible = false; this.chassis._visible = true; }; v2.SetRotation = function () { if (this.rotating) { this.targetAngle = Math.random() * 360; this.chassis.turret._rotation = this.targetAngle; } }; v2.SetSelected = function (_arg2) { this.hTower._visible = _arg2; this.select = _arg2; if (_arg2) { this.hTower._x = this.topLeftCell.left + 1; this.hTower._y = this.topLeftCell.top + 1; this.selectNum = 50; } }; v2.TargetValid = function (_arg2) { if (_arg2) { if (_arg2.flying) { if (this.towerType == 4) { this.ok = !_arg2.forcedFly; } else { this.ok = this.towerType != 2 && this.towerType != 6 && this.towerType != 8; } } else { if (_arg2.immune) { this.ok = this.towerType != 4 && this.towerType != 5; } else { this.ok = this.towerType != 4; } } if (this.ok) { this.ok = _arg2.shotHealth > 0; } } return this.ok; }; v2.AcquireTarget = function (_arg8) { var v7 = []; var v3; var v5 = 0; var v6 = this.creeps.length; var v4 = this.targetNum; this.targetTick = 0; while (v5 < v6) { ++v5; ++v4; if (v4 > v6) { v4 = 0; } var v2 = this.creeps[v4]; v3 = false; if (v2) { if (v2.flying) { if (this.towerType == 4) { v3 = !v2.forcedFly; } else { v3 = this.towerType != 2; } } else { if (v2.immune) { v3 = this.towerType != 5 && this.towerType != 4; } else { v3 = this.towerType != 4; } } if (v3) { if (v2.shotHealth > 0 && this.InRange(v2)) { if (v7.push(v2) == _arg8) { break; } } } } } if (v7.length > 0) { this.targetNum = v7[0].id; return v7; } this.targetNum = -1; return v7; }; v2.onEnterFrame = function () { if (this.dragged or this.towerType == 7 or _root.build == true) { return undefined; } if (_root.game.gameState != 1) { return undefined; } if (this.upTicks > 0) { if (--this.upTicks == 0) { this.ApplyUpgrade(); } else { this.upgradeBar._width = (1 - this.upTicks / this.upTickTotal) * 20; } return undefined; } if (this.sellTicks > 0) { if (--this.sellTicks == 0) { this.DoSell(); } else { this.upgradeBar._width = (this.sellTicks / this.sellTickTotal) * 20; } return undefined; } --this.shotTick; if (this.towerType == 4) { if (_root.game.flyingCreeps) { if (this.shotTick < 0) { var v3 = 0; while (v3 < this.targets.length) { if (!this.InRange(this.targets[v3])) { this.targets.splice(v3, 1); } else { ++v3; } } if (this.targets.length < 4) { this.targets = this.targets.concat(this.AcquireTarget(4 - this.targets.length)); } var v4 = []; v4.push([this._x - 7, this._y]); v4.push([this._x + 7, this._y]); v4.push([this._x, this._y + 7]); v4.push([this._x, this._y - 7]); v3 = 0; while (v3 < this.targets.length) { this.Fire(this.targets[v3], v4[v3][0], v4[v3][1], v3 == 0); ++v3; } this.shotTick = this.hitRate; } } } else { if ('' + this.target == '') { this.target = undefined; this.targetTick = this.shotTick < this.scanTick ? this.shotTick : this.scanTick; } --this.targetTick; if (this.target && this.shotTick < 0) { if ((this.target.shotHealth > 0 || this.override) && this.InRange(this.target)) { this.shotTick = this.hitRate; this.Fire(this.target, this._x, this._y, true); } else { this.target = undefined; this.targetTick = this.scanTick; } } if (this.rotating) { if (this.target) { var v6 = this.target._x - this._x; var v7 = this.target._y - this._y; var v5 = Math.round(Math.atan2(v7, v6) * 180 / Math.PI); this.targetAngle = v5; } this.chassis.turret._rotation = this.targetAngle; } } }; v2.Fire = function (_arg10, _arg6, _arg5, _arg18) { if (this.towerType != 8) { if (this.towerType != 6) { this.chassis.turret.gotoAndPlay(2); var v5 = this.shotField.getNextHighestDepth(); this.shotField.attachMovie('Shot', 'shot' + v5, v5, {'creeps': this.creeps, '_x': _arg6, '_y': _arg5, 'target': _arg10, 'damage': this.damage, 'splash': this.splash, 'shotType': this.towerType, 'slow': this.slow, 'bash': this.bash, 'hitAir': this.towerType != 2, 'hitGround': this.towerType != 4}); _arg10.shotHealth -= this.damage; } else { var v5 = this.groundField.getNextHighestDepth(); this.groundField.attachMovie('Shot', 'shot' + v5, v5, {'creeps': this.creeps, '_x': _arg6, '_y': _arg5, 'target': _arg10, 'damage': this.damage, 'splash': this.splash, 'shotType': this.towerType, 'slow': this.slow, 'bash': this.bash, 'hitAir': this.towerType != 2, 'hitGround': this.towerType != 4}); } } else { var v5 = this.groundField.getNextHighestDepth(); this.groundField.attachMovie('Shot', 'shot' + v5, v5, {'creeps': this.creeps, '_x': _arg6, '_y': _arg5, 'target': _arg10, 'damage': this.damage, 'splash': this.splash, 'shotType': this.towerType, 'slow': this.slow, 'bash': this.bash, 'hitAir': this.towerType != 2, 'hitGround': this.towerType != 4}); this.DoSell(); } if (_arg18) { var v3; switch (this.towerType) { case 1: v3 = 'eep.wav'; break; case 2: v3 = 'kow.wav'; break; case 3: v3 = 'pop.wav'; break; case 4: v3 = 'zip.wav'; break; case 5: v3 = 'frost.wav'; break; case 6: v3 = 'THUD.WAV'; case 7: v3 = 'THUD.WAV'; break; case 8: v3 = 'THUD.WAV'; } _root.game.PlaySound(v3); } }; v2.InRange = function (_arg5) { var v2 = this._x - _arg5._x; var v3 = this._y - _arg5._y; var v4 = Math.sqrt(v2 * v2 + v3 * v3); if (v4 < this.range) { return true; } return false; }; ASSetPropFlags(_global.Tower.prototype, null, 1); } #endinitclip } movieClip 506 __Packages.ShotSpray { #initclip if (!_global.ShotSpray) { var v1 = function () { super(); this.tick = this.timeToSpawn; }; _global.ShotSpray = v1; _global.ShotSpray extends MovieClip; var v2 = v1.prototype; v2.SetTarget = function (c, t) { this._x = t._x; this._y = t._y; this.shotNum = this.shotCount; this.dx = c._x - t._x; this.dy = c._y - t._y; var v4 = Math.sqrt(this.dx * this.dx + this.dy * this.dy); var v3 = 10 / v4; this.dx *= v3; this.dy *= v3; }; v2.onEnterFrame = function () { --this.tick; if (this.tick == 0 && this.shotNum > 0) { var v3 = _root.game.shotField.getNextHighestDepth(); _root.game.shotField.attachMovie('ShotSpray', 'shot' + v3, v3, {'_x': this._x + this.dx, '_y': this._y + this.dy, 'dx': this.dx, 'dy': this.dy, 'shotCount': this.shotCount, 'shotNum': this.shotNum - 1, 'timeToSpawn': this.timeToSpawn, 'timeToLive': this.timeToLive, 'damage': this.damage}); } if (this.tick <= -this.timeToLive) { } }; ASSetPropFlags(_global.ShotSpray.prototype, null, 1); } #endinitclip } movieClip 507 __Packages.Shot { #initclip if (!_global.Shot) { var v1 = function () { super(); this.gotoAndStop(this.shotType); this.pointAtTarget(); this._visible = false; switch (this.shotType) { return undefined; case 1: this.tick = 2; this.speed = 5; break; case 2: this.tick = 2; this.speed = 1; this.accel = 0.1; break; case 3: this.tick = 4; break; case 4: this.speed = 1; this.accel = 0.2; this.tick = 1; break; case 5: this.tick = 1; break; case 6: this._yscale = (this.splash / 35) * 100; this._xscale = this._yscale; this.tick = 1; this.bashed = false; break; case 7: case 8: this._yscale = (this.splash / 35) * 100; this._xscale = this._yscale; this.tick = 1; this.bashed = false; break; default: return undefined; } }; _global.Shot = v1; _global.Shot extends MovieClip; var v2 = v1.prototype; v2.LaserTarget = function () { this.lineStyle(1, 0, 100); this.moveTo(0, 0); this.lineTo(this.target._x - this._x, this.target._y - this._y); this._visible = true; _root.game.AddExplosion(this.shotType, this.target._x, this.target._y, this.target.dx, this.target.dy); }; v2.pointAtTarget = function () { switch (this.shotType) { return undefined; break; case 1: case 2: var v2 = this.lastX - this._x; var v3 = this.lastY - this._y; this._rotation = Math.round(Math.atan2(v3, v2) * 180 / Math.PI); break; case 3: this._rotation += 40; break; case 4: var v2 = this.lastX - this._x; var v3 = this.lastY - this._y; this._rotation = Math.round(Math.atan2(v3, v2) * 180 / Math.PI); break; case 5: this._rotation += 20; break; default: return undefined; } }; v2.BashTargets = function () { var v6; var v4 = 0; var v5 = this.creeps.length; while (v4 < v5) { var v3 = this.creeps[v4]; if (v3) { if (!v3.flying) { if (this.InRange(v3)) { v3.shotHealth -= this.damage; v3.health -= this.damage; if (this.bash > 0) { if (this.bash > Math.random() * 100) { v3.SetBash(64); _root.game.StopBash(v3); v3.bash._visible = true; } } } } } ++v4; } this.bashed = true; }; v2.onEnterFrame = function () { if (_root.game.gameState != 1) { return undefined; } if ('' + this.target == '') { this.target = undefined; } if (--this.tick == 0) { this._visible = true; } if (this.shotType == 6 or this.shotType == 8) { if (!this.bashed) { this.BashTargets(); } if (this.tick < -24) { this.removeMovieClip(); } else {} } else { if (this.target) { this.lastX = this.target._x; this.lastY = this.target._y; this.pointAtTarget(); } if (this.accel > 0) { this.speed += this.accel; } var v6 = this.lastX - this._x; var v7 = this.lastY - this._y; var v9 = Math.sqrt(v6 * v6 + v7 * v7); var v8 = this.speed / v9; this._x += v6 * v8; this._y += v7 * v8; if (Math.abs(v6) < this.speed && Math.abs(v7) < this.speed) { if (this.target) { _root.game.AddExplosion(this.shotType, this._x, this._y, this.target.dx, this.target.dy); } else { _root.game.AddExplosion(this.shotType, this._x, this._y, 0, 0); } if (this.splash == 0) { if (this.target) { this.target.health -= this.damage; if (this.slow > 0 && !this.target.immune) { this.target.SetSlow(this.slow, 100); } } } else { var v4; var v5 = 0; while (v5 < this.creeps.length) { var v3 = this.creeps[v5]; if (v3) { if (v3.flying) { v4 = this.hitAir; } else { v4 = this.hitGround; } if (v4) { v4 = v3.immune ? !this.slow : true; } if (v4) { if (this.InRange(v3)) { if (v3 != this.target) { v3.shotHealth -= this.damage; v3.health -= this.damage; } else { v3.health -= this.damage; } if (this.slow > 0) { v3.SetSlow(this.slow, 100); } } } } ++v5; } } this.removeMovieClip(); } } }; v2.InRange = function (_arg5) { var v2 = this._x - _arg5._x; var v3 = this._y - _arg5._y; var v4 = Math.sqrt(v2 * v2 + v3 * v3); if (v4 <= this.splash) { return true; } return false; }; v2.speed = 4; v2.accel = 0; ASSetPropFlags(_global.Shot.prototype, null, 1); } #endinitclip } movieClip 508 __Packages.Fragment { #initclip if (!_global.Fragment) { var v1 = function () { super(); this.gotoAndStop(this.frame); }; _global.Fragment = v1; _global.Fragment extends MovieClip; var v2 = v1.prototype; v2.onEnterFrame = function () { if (_root.game.gameState != 1) { return undefined; } if (this.ticks-- <= 0) { this.removeMovieClip(); } else { this.xVel -= this.xVel / (this.ticks + 1); this.yVel -= this.yVel / (this.ticks + 1); this.dx -= this.dx / (this.ticks + 1); this.dy -= this.dy / (this.ticks + 1); this._x += this.xVel; this._y += this.yVel; if (this.rotate > 0) { this._rotation += this.rotate; } } }; ASSetPropFlags(_global.Fragment.prototype, null, 1); } #endinitclip } movieClip 509 __Packages.Creep { #initclip if (!_global.Creep) { var v1 = function () { super(); this.gridSize = _root.game.gridSize; this.offSet = this.gridSize / 2; this.startHealth = this.health; this.lastHealth = this.startHealth; this.hCreepSlow._visible = false; this.dead = false; this.entering = true; this.forcedFly = false; this.slowRatio = 1; this.bashed = false; var v4 = 1; if (this.flying) { v4 = 2; } if (this.speed > 1) { v4 = 3; } if (this.spawnMax > 1 && this.spawnLevel == 1) { v4 = 4; } this.creep.gotoAndStop(v4); this._visible = false; this.onEnterFrame = this.FrameTick; }; _global.Creep = v1; _global.Creep extends MovieClip; var v2 = v1.prototype; v2.Init = function () { this.jitterX = int(Math.random() * this.gridSize / 2 - this.gridSize / 4); this.jitterY = int(Math.random() * this.gridSize / 2 - this.gridSize / 4); this.creep._xscale = this.size; this.creep._yscale = this.size; this.hCreepSlow._xscale = this.size / 2; this.hCreepSlow._yscale = this.size / 2; var v2 = this.HEXtoRGB(this.color); this.cacheAsBitmap = true; }; v2.onPress = function () { _root.game.SelectCreep(this); _root.game.AssignTargetCreep(this); }; v2.SetTint = function (_arg7, _arg8, _arg6, _arg5) { var v2 = new Object(); v2.ba = 100 - _arg5; v2.ga = v2.ba; v2.ra = v2.ba; var v3 = _arg5 / 100; v2.rb = _arg7 * v3; v2.gb = _arg8 * v3; v2.bb = _arg6 * v3; var v4 = new Color(this.creep); v4.setTransform(v2); return v4; }; v2.HEXtoRGB = function (_arg2) { if (!isNaN(_arg2)) { var v2 = _arg2; var v1 = v2 >> 16; var v3 = (v2 ^ v1 << 16) >> 8; var v4 = v2 ^ v1 << 16 ^ v3 << 8; return {'r': v1, 'g': v3, 'b': v4}; } var v2 = parseInt(_arg2, 16); var v1 = v2 >> 16; var v3 = (v2 ^ v1 << 16) >> 8; var v4 = v2 ^ v1 << 16 ^ v3 << 8; return {'r': v1, 'g': v3, 'b': v4}; }; v2.SetSlow = function (_arg3, _arg2) { this.slowRatio = (100 - _arg3) / 100; this.slowTicks = _arg2; this.hCreepSlow._visible = true; this.creep._color = this.SetTint(0, 0, 255, 35); }; v2.StopSlow = function () { this.hCreepSlow._visible = false; this.creep._color = this.SetTint(0, 0, 0, 35); this.slowRatio = 1; }; v2.SetBash = function (_arg2) { this.bashTicks = _arg2; }; v2.StopBash = function (_local2) { _local2.bash._visible = false; }; v2.DoExplode = function (_arg5, _arg4) { this._x = _arg5; this._y = _arg4; this.expTicks = 0; this.onEnterFrame = function () { if (++this.expTicks > 50) { } if (!this._visible) { this._visible = true; this.Init(); var v2 = this.startCell.left + this.offSet - this._x; var v3 = this.startCell.top + this.offSet - this._y; this.creep._rotation = Math.round(Math.atan2(v3, v2) * 180 / Math.PI); } else { var v2 = this.startCell.left + this.offSet + this.jitterX - this._x; var v3 = this.startCell.top + this.offSet + this.jitterY - this._y; if (Math.abs(v2) > 1 || Math.abs(v3) > 1) { this._x += v2 / 5; this._y += v3 / 5; } else { this._x = int(this._x); this._y = int(this._y); this.onEnterFrame = this.FrameTick; } } }; }; v2.SetDirection = function (_arg3, _arg2) { var v4 = this.creep._rotation > 0 ? 180 : -180; if (_arg2.left == _arg3.left) { this.angle = _arg2.top > _arg3.top ? 90 : -90; } else { if (_arg2.top == _arg3.top) { this.angle = _arg2.left > _arg3.left ? 0 : v4; } else { this.angle = _arg2.left > _arg3.left ? 0 : v4; if (this.angle == 0) { this.angle = _arg2.top > _arg3.top ? 45 : -45; } else { this.angle = _arg2.top > _arg3.top ? 135 : -135; } } } }; v2.SetSpeed = function () { this.dx = 0; this.dy = 0; if (this.nextX == this.nowX) { this.dy = this.nextY > this.nowY ? this.speed : -this.speed; } else { if (this.nextY == this.nowY) { this.dx = this.nextX > this.nowX ? this.speed : -this.speed; } else { this.dx = this.nextX > this.nowX ? this.speed / 1.4 : -this.speed / 1.4; this.dy = this.nextY > this.nowY ? this.speed / 1.4 : -this.speed / 1.4; } } }; v2.FrameTick = function () { var v6; if (_root.game.gameState != 1) { return undefined; } if (this.startDelay >= 0) { if (this.startDelay == 0) { this.Init(); } --this.startDelay; } else { if (this.cCell == undefined) { this._visible = true; if (this.flying) { this.cCell = this.endCell; this.nextX = this.endCell.left + this.offSet; this.nextY = this.endCell.top + this.offSet; if (this.LR) { this.nowX = -14; this.nowY = this.nextY; this.angle = 0; } else { this.nowX = this.nextX; this.nowY = -14; this.angle = 90; } } else { this.cCell = this.startCell; ++this.cCell.creepCount; this.nextX = this.cCell.left + this.offSet; this.nextY = this.cCell.top + this.offSet; if (this.spawnLevel < 2) { if (this.LR) { this.nowX = -14; this.nowY = this.nextY; this.angle = 0; } else { this.nowX = this.nextX; this.nowY = -14; this.angle = 90; } } else { if (this.LR) { this.nowX = this.nextX - 1; this.nowY = this.nextY; this.angle = 0; } else { this.nowX = this.nextX; this.nowY = this.nextY - 1; this.angle = 90; } this.creep._rotation = int(this.creep._rotation / 15) * 15; } } this.SetSpeed(); this.entering = false; } if (this.bashTicks > 0) { if (--this.bashTicks == 0) { this.StopBash(); this._x = this.nowX + this.jitterX; this._y = this.nowY + this.jitterY; } else { this._x = this.nowX + this.jitterX + int(Math.random() * 2) - 1; this._y = this.nowY + this.jitterY + int(Math.random() * 2) - 1; } } else { if (this.slowTicks > 0) { if (--this.slowTicks == 0) { this.StopSlow(); } } this.nowX += this.dx * this.slowRatio; this.nowY += this.dy * this.slowRatio; var v3 = this.creep._rotation; if (this.angle == v3) { } else { if (this.angle > v3) { v3 += 15; this.creep._rotation = v3; this.hCreepSlow._rotation = v3; } else { if (this.angle < v3) { v3 -= 15; this.creep._rotation = v3; this.hCreepSlow._rotation = v3; } } } this._x = this.nowX + this.jitterX; this._y = this.nowY + this.jitterY; if (Math.abs(this.nowX - this.nextX) < this.speed && Math.abs(this.nowY - this.nextY) < this.speed) { if (this.dead) { _root.game.LoseALife(this); this.removeMovieClip(); return undefined; } var v4; var v5; if (this.LR) { if (this.cCell.bestChildrenLR == undefined) { FloodPath.CreateBestChildren(_root.game.cells, this.cCell, this.LR); } if (this.cCell.bestChildrenLR.length) { v4 = this.cCell.bestChildrenLR[int(Math.random() * this.cCell.bestChildrenLR.length)]; } } else { if (this.cCell.bestChildrenUD == undefined) { FloodPath.CreateBestChildren(_root.game.cells, this.cCell, this.LR); } if (this.cCell.bestChildrenUD.length) { v4 = this.cCell.bestChildrenUD[int(Math.random() * this.cCell.bestChildrenUD.length)]; } } --this.cCell.creepCount; if (v4 != undefined) { this.SetDirection(this.cCell, v4); ++v4.creepCount; this.nextX = v4.left + this.offSet; this.nextY = v4.top + this.offSet; this.nowX = this.cCell.left + this.offSet; this.nowY = this.cCell.top + this.offSet; this.cCell = v4; this.SetSpeed(); } else { this.dead = true; if (this.LR) { this.nextX += 48; this.nextY = this.nowY; this.angle = 0; } else { this.nextY += 48; this.nextX = this.nowX; this.angle = 90; } this.SetSpeed(); } } } if (this.health <= 0) { _root.game.AddKill(this); if (this.spawnMax > 0) { _root.game.AddSpawnCreeps(this); } if (this.cCell) { --this.cCell.creepCount; } this.removeMovieClip(); } else { if (this.health != this.lastHealth) { this.healthBar._width = (this.health / this.startHealth) * 15; this.lastHealth = this.health; } } } }; ASSetPropFlags(_global.Creep.prototype, null, 1); } #endinitclip } movieClip 510 __Packages.FloodPath { #initclip if (!_global.FloodPath) { var v1 = function () {}; _global.FloodPath = v1; var v2 = v1.prototype; v2.Go = function (cells, startCell, endCells, LR) { this.ClearMoveCosts(cells, LR); this.FloodCells(cells, endCells, LR); if (startCell.tmpMoveCost == 0) { return false; } with (_root.game) { var i = 0; while (i < creeps.length) { var cr = creeps[i]; if (!cr.entering && !cr.dead) { var c = cells[int((cr.nextY - startY) / gridSize)][int((cr.nextX - startX) / gridSize)]; if (c && c.tmpMoveCost == 0) { return false; } } ++i; } } this.UpdateMoveCosts(cells, endCells, LR); return true; }; v1.CreateBestChildren = function (cells, c, LR) { var v11 = cells.length; var v13 = cells[0].length; var v8; var v3 = LR ? c.moveCostLR : c.moveCostUD; if (v3 == -1) { return undefined; } var v10 = v3; var v4 = c.row - 1; while (v4 < c.row + 2) { var v1 = c.col - 1; while (v1 < c.col + 2) { if (v4 < 0 || v4 >= v11 || v1 < 0 || v1 >= v13 || v4 == c.row && v1 == c.col) { } else { var v6 = true; var v7 = 1; if (v4 != c.row && v1 != c.col) { v7 = 0.7; if (cells[v4][c.col].cost == 0) { v6 = false; } else { if (cells[c.row][v1].cost == 0) { v6 = false; } } } if (v6) { var v5 = cells[v4][v1]; v3 = LR ? v5.moveCostLR : v5.moveCostUD; if (v3 == 0) { } else { if (v3 == -1) { return []; } else { v3 -= v7; if (v3 == v10) { v8.push(v5); } else { if (v3 < v10) { v8 = []; v8.push(v5); v10 = v3; } } } } } } ++v1; } ++v4; } if (LR) { c.bestChildrenLR = v8; } else { c.bestChildrenUD = v8; } }; v2.FloodCells = function (cells, endCells, LR) { var v12; var v11 = new Array(); var v13 = cells.length; var v14 = cells[0].length; v11 = endCells.concat(); v11.reverse(); var v5 = 0; while (v5 < endCells.length) { if (LR) { endCells[v5].moveCostLR = -1; } else { endCells[v5].moveCostUD = -1; } endCells[v5].tmpMoveCost = -1; ++v5; } while (v11.length > 0) { v12 = v11; v11 = new Array(); while (v12.length) { var v1 = v12.pop(); var v8 = v1.tmpMoveCost; if (v8 == -1) { v8 = 0; } v1.pathVisited = true; v5 = 0; var v3 = v1.row - 1; while (v3 < v1.row + 2) { var v2 = v1.col - 1; while (v2 < v1.col + 2) { ++v5; if (v3 < 0 || v3 >= v13 || v2 < 0 || v2 >= v14 || v3 == v1.row && v2 == v1.col) { } else { var v4 = cells[v3][v2]; if (!v4.pathVisited && v4.cost == 1 && v4.tmpMoveCost != -1) { var v6 = true; if (v3 != v1.row && v2 != v1.col) { if (cells[v3][v1.col].cost == 0) { v6 = false; } else { if (cells[v1.row][v2].cost == 0) { v6 = false; } } } if (v6) { var v9 = v4.tmpMoveCost; var v7 = (v5 == 1 || v5 == 3 || v5 == 7 || v5 == 9) ? 1.4 : 1; if (v9 == 0 || v8 + v7 < v9) { v4.tmpMoveCost = v8 + v7; v11.push(v4); } } } } ++v2; } ++v3; } } v11.sortOn('tmpMoveCost', Array.NUMERIC | Array.DESCENDING); } }; v2.OpenCell = function (openCells, cell, LR) { var v1 = 0; while (v1 < openCells.length) { var v2 = openCells[v1]; if (v2.tmpMoveCost > cell.tmpMoveCost) { } ++v1; } }; v2.UpdateMoveCosts = function (cells, endCells, LR) { var v3 = 0; while (v3 < cells.length) { var v2 = 0; while (v2 < cells[v3].length) { var v1 = cells[v3][v2]; if (LR) { v1.moveCostLR = v1.tmpMoveCost; v1.bestChildrenLR = undefined; } else { v1.moveCostUD = v1.tmpMoveCost; v1.bestChildrenUD = undefined; } ++v2; } ++v3; } }; v2.ClearMoveCosts = function (cells, LR) { var v2 = 0; while (v2 < cells.length) { var v1 = 0; while (v1 < cells[v2].length) { var v3 = cells[v2][v1]; v3.tmpMoveCost = 0; v3.pathVisited = false; ++v1; } ++v2; } }; ASSetPropFlags(_global.FloodPath.prototype, null, 1); } #endinitclip } movieClip 511 __Packages.Grid { #initclip if (!_global.Grid) { var v1 = function () { super(); this.active = false; this.hCell = _root.attachMovie('hCell', 'hCell', 21); this.hCell._visible = false; this.showCell = false; this.hRange = _root.attachMovie('hRange', 'hRange', 20); this.hRange._visible = false; this.hTower = _root.attachMovie('hTower', 'hTower', 30); this.hTower._visible = false; this.hCell.goldChar._visible = false; }; _global.Grid = v1; _global.Grid extends MovieClip; var v2 = v1.prototype; v2.Init = function () { this.rows = _root.game.cellRows; this.cols = _root.game.cellCols; this.startX = _root.game.startX; this.startY = _root.game.startY; this.gridSize = _root.game.gridSize; }; v2.CheckGold = function () { if (this.active) { } }; v2.CancelSelect = function () { this.hRange._visible = false; }; v2.SelectTower = function (_arg2) { this.hRange._height = _arg2.range * 2; this.hRange._width = this.hRange._height; this.hRange._x = _arg2.topLeftCell.left + this.gridSize; this.hRange._y = _arg2.topLeftCell.top + this.gridSize; this.hRange._visible = true; }; v2.ToggleGrid = function () { if (!_root.game.gridOn) { this.gotoAlpha = 0; } if (_root.game.gridOn) { this.gotoAlpha = 50; } this.active = true; }; v2.FollowTower = function (_arg3) { if (!_root.game.gridOn) { this.gotoAlpha = 50; this.active = true; } this.showCell = true; this.dragTower = _arg3; this.hCell._width = this.gridSize * _arg3.size - 2; this.hCell._height = this.hCell._width; this.hRange._height = _arg3.range * 2; this.hRange._width = this.hRange._height; this.rangeOffset = _arg3._width / 2; this.HighlightCell(); this.CheckGold(); }; v2.StopFollowTower = function () { if (!_root.game.gridOn) { this.gotoAlpha = 0; this.active = true; } this.showCell = false; this.hCell._visible = false; this.hRange._visible = false; this.cRow = -1; this.cCol = -1; this.hitTest = 4; this.dragTower.dragged = false; this.dragTower = undefined; }; v2.onMouseMove = function () { if (this.showCell && this._alpha > 0) { this.HighlightCell(); } }; v2.onMouseDown = function () { if (this.hitTest == 0) { _root.game.DropTower(this.dragTower, this.cCell); } else { var v5 = _root._xmouse; var v6 = _root._ymouse; var v3 = int((v5 - this.startX) / this.gridSize); var v4 = int((v6 - this.startY) / this.gridSize); if (this.dragTower) { if (v3 >= 0 && v3 < this.cols && v4 >= 0 && v4 < this.rows && this.hitTest != 3) { _root.game.CancelSelect(); } } else { _root.game.SelectCell(v4, v3); } } }; v2.DrawGrid = function () {}; v2.DrawMoveCosts = function () { var v6; var v5 = 0; while (v5 < this.rows) { var v4 = 0; while (v4 < this.cols) { var v2 = this.cells[v5][v4]; if (v2.moveCostLR > 0) { var v3 = v2.moveCostLR * 6; if (v3 > 254) { v3 = 254; } this.beginFill(255 - v3, 80); this.moveTo(v2.left, v2.top); this.lineTo(v2.left + this.gridSize, v2.top); this.lineTo(v2.left + this.gridSize, v2.top + this.gridSize); this.lineTo(v2.left, v2.top + this.gridSize); this.lineTo(v2.left, v2.top); this.endFill(); } ++v4; } ++v5; } }; v2.DrawRanges = function () { var v3; var v5 = 0; while (v5 < this.rows) { var v4 = 0; while (v4 < this.cols) { var v2 = this.cells[v5][v4]; if (v2.rangeTowers.length > 0) { this.beginFill(16715792, 80); this.moveTo(v2.left, v2.top); this.lineTo(v2.left + this.gridSize, v2.top); this.lineTo(v2.left + this.gridSize, v2.top + this.gridSize); this.lineTo(v2.left, v2.top + this.gridSize); this.lineTo(v2.left, v2.top); this.endFill(); v3 = this['tf:' + v5 + ':' + v4]; if (v3) { v3.text = '' + v2.rangeTowers.length; } else { v3 = this.createTextField('tf:' + v5 + ':' + v4, this.getNextHighestDepth(), v2.left, v2.top, this.gridSize, this.gridSize); v3.text = '' + v2.rangeTowers.length; } } else { v3 = this['tf:' + v5 + ':' + v4]; if (v3) { v3.removeTextField(); } } ++v4; } ++v5; } }; v2.HighlightCell = function (_arg3) { var v5; var v6 = _root._xmouse; var v7 = _root._ymouse; var v3 = int((v6 - this.startX) / this.gridSize); var v4 = int((v7 - this.startY) / this.gridSize); if (v3 < 0 || v3 >= this.cols || v4 < 0 || v4 >= this.rows) { this.hCell._visible = false; this.hRange._visible = false; this.cRow = -1; this.cCol = -1; this.cCell = undefined; this.hitTest = 4; } else { v5 = _root.game.cells[v4][v3]; if (v7 < v5.top + this.gridSize / 2) { this.cRow = v4 - 1; } else { this.cRow = v4; } if (v6 < v5.left + this.gridSize / 2) { this.cCol = v3 - 1; } else { this.cCol = v3; } if (this.cCol < 0) { this.cCol = 0; } if (this.cRow < 0) { this.cRow = 0; } if (this.cCol >= this.cols - 1) { this.cCol = this.cols - 2; } if (this.cRow >= this.rows - 1) { this.cRow = this.rows - 2; } this.cCell = _root.game.cells[this.cRow][this.cCol]; if (this.showCell) { this.hCell._x = this.cCell.left; this.hCell._y = this.cCell.top; this.hCell._visible = true; } this.hRange._visible = true; this.hRange._x = this.cCell.left + this.gridSize; this.hRange._y = this.cCell.top + this.gridSize; this.hitTest = _root.game.CellHitTest(this.cRow, this.cCol, this.dragTower); } if (this.hitTest == 0) { this.hCell.gotoAndStop(1); } else { this.hCell.gotoAndStop(2); } }; ASSetPropFlags(_global.Grid.prototype, null, 1); } #endinitclip } movieClip 512 __Packages.UpgradePanel { #initclip if (!_global.UpgradePanel) { var v1 = function () { super(); this._visible = false; this.upgradePanel._visible = false; this.active = false; }; _global.UpgradePanel = v1; _global.UpgradePanel extends MovieClip; var v2 = v1.prototype; v2.onEnterFrame = function () { if (this.upgradeBar._visible && this.tower) { this.ShowUpgrade(); } }; v2.Upgrade = function () { _root.game.UpgradeSelectedTower(false); this.panelDetails._visible = false; this.upgradeBar._visible = true; this.upgradeButton._visible = false; this.ShowUpgrade(); }; v2.CheckGold = function () { if (this._visible) { if (this.tower && this.tower.upTicks > 0) { this.upgradeButton._visible = false; } else { if (_root.game.gold >= int(this.towerObject.cost) - this.tower.cost) { this.upgradeButton._visible = true; } else { this.upgradeButton._visible = false; } } } }; v2.ShowUpgrade = function () { if (this.tower && this.tower.upTicks > 0) { this.upgradeBar.SetPercentage(1 - this.tower.upTicks / this.tower.upTickTotal); } else { this.panelDetails._visible = true; this.upgradeBar._visible = false; this.upgradeButton._visible = true; _root.game.SelectCell(this.tower.topLeftCell.row, this.tower.topLeftCell.col); } }; v2.GetSpeed = function (hr) { if (hr < 7) { return 'very fast'; } else { if (hr < 13) { return 'fast'; } else { if (hr < 37) { return 'average'; } else { if (hr < 61) { return 'slow'; } else { return 'very slow'; } } } } }; v2.SetTower = function (oldTower, newTower) { this.tower = oldTower; this.towerObject = newTower; this.upgradeName.text = newTower.towerName; this.desc.text = newTower.desc; with (this.panelDetails) { cost.text = newTower.cost - oldTower.cost; damage.text = newTower.damage; range.text = newTower.range; speed.text = this.GetSpeed(newTower.hitRate); } this._visible = true; if (oldTower.upTicks > 0) { this.panelDetails._visible = false; this.upgradeBar._visible = true; this.ShowUpgrade(); } else { this.panelDetails._visible = true; this.upgradeBar._visible = false; } this.CheckGold(); }; v2.Cancel = function () { this._visible = false; this.panelDetails._visible = true; this.upgradeBar._visible = false; this.upgradeButton._visible = true; this.tower = undefined; this.towerObject = undefined; }; ASSetPropFlags(_global.UpgradePanel.prototype, null, 1); } #endinitclip } movieClip 513 __Packages.Game { #initclip if (!_global.Game) { var v1 = function () { this.topMenu = _root.Interface.topMenu; this.infoPanel = _root.Interface.infoPanel; this.upgradePanel = _root.Interface.upgradePanel; this.btnNextLevel = _root.Interface.btnNextLevel; this.creeps = []; this.creepCount = 0; this.pathFinder = new PathFinder(); this.pathID = 1; this.floodPath = new FloodPath(); this.groundField = _root.createEmptyMovieClip('groundField', 1); this.towerField = _root.createEmptyMovieClip('towerField', 2); this.creepField = _root.createEmptyMovieClip('creepField', 3); this.shotField = _root.createEmptyMovieClip('shotField', 4); this.effectsField = _root.createEmptyMovieClip('effectsField', 6); this.bountyField = _root.createEmptyMovieClip('bountyField', 7); this.gridField = _root.attachMovie('Grid', 'gridField', 10); this.pauseField = _root.Interface.attachMovie('PauseOverlay', 'pauseField', 100); this.gameState = 0; this.expLevel = 0; this.muted = false; this.inited = false; this.difficulty = 0; this.gridOn = false; this.speedChal = false; this.gameSent = false; this.mapMode = 0; }; _global.Game = v1; var v2 = v1.prototype; v2.ShowStart = function () { if (this.inited) { this.endTime = this.GetTime(); this.Reset(); } this.gameState = -1; this.pauseField._visible = false; _root.resetpanel._visible = false; _root.scoreBoard._visible = false; _root.Interface.blockingPopup._visible = false; if (this.muted == false) { _root.zik2.son.stop(); _root.zik1.son.start(0, 999); } _root.startPanel.Fadein(); this.ResetChallengeMode(); this.SetChallengeMode(); this.ToggleGrid(false); }; v2.Init = function () { var v3; this.InitMap(); this.InitWaves(); this.InitTowers(); switch (this.difficulty) { case 1: v3 = 'Easy Mode'; break; case 2: v3 = 'Normal Mode'; break; case 3: v3 = 'Hard Mode'; break; case 4: v3 = 'Challenge Mode'; break; case 5: v3 = 'Fun Mode'; } _root.Interface.difficulty.diff.text = v3; this.SetChallengeMode(); this.Reset(); this.ToggleGrid(false); this.inited = true; this.sellNum = 0; this.gameState = 0; _root.startPanel.mission = ''; _root.Interface.bouton.bouton.gotoAndStop(random(3) + 1); if (this.muted == false) { _root.zik1.son.stop(); _root.zik2.son.start(0, 999); } if (this.speedChal) { this.Start(); } }; v2.ResetChallengeMode = function () { this.NoPellet = false; this.NoSquirt = false; this.NoDart = false; this.NoSwarm = false; this.NoFrost = false; this.NoBash = false; this.speedChal = false; this.infChal = false; this.mapMode = 0; this.onlySpawn = false; }; v2.SetChallengeMode = function () { _root.Interface.btnPellet._visible = !this.NoPellet; _root.Interface.btnSquirt._visible = !this.NoSquirt; _root.Interface.btnDart._visible = !this.NoDart; _root.Interface.btnSwarm._visible = !this.NoSwarm; _root.Interface.btnFrost._visible = !this.NoFrost; _root.Interface.btnBash._visible = !this.NoBash; }; v2.Reset = function () { this.tick = 0; this.tTick = 0; this.fcount = 0; this.gold = 80; if (this.gold != 80) { this.gold = 80; } this.levelBonus = 0; this.level = 0; this.lives = 20; this.creepKills = 0; this.timeToLevel = 1; this.currentLevelTime = this.timeToLevel; if (this.difficulty == 1) { this.levelTime = 35; } else { this.levelTime = 25; } this.btnNextLevel._visible = true; this.score = 0; this.topMenu.score.text = 0; _root.scoreBoard._visible = false; this.CancelSelect(); this.ClearShots(); this.ClearCreeps(); this.ClearEffects(); this.ClearTowers(); if (this.cells.length > 0) { this.CreateCellArray(); if (this.floodPath != undefined) { var v3 = this.GetTime(); this.MakeFloodPath(true); this.MakeFloodPath(false); } } this.topMenu.lives.text = this.lives; this.topMenu.vie.gotoAndStop(this.lives); this.topMenu.kills.text = 0; this.topMenu.timeleft.text = this.timeToLevel; this.topMenu.gold.text = this.gold; this.finished = false; this.gameState = 0; _root.Interface.topMenu.btnStart.msg.text = 'START'; this.pauseField._visible = false; }; v2.MakeFloodPath = function (LR) { return this.floodPath.Go(this.cells, LR ? this.startCellLR : this.startCellUD, LR ? this.endCellsLR : this.endCellsUD, LR); this.gridField.DrawGrid(); }; v2.GetTime = function () { var v1 = new Date(); return v1.getTime(); }; v2.Start = function () { this.startTime = this.GetTime(); this.gameState = 1; if (this.infoPanel.tower) { this.SelectCell(this.infoPanel.tower.topLeftCell.row, this.infoPanel.tower.topLeftCell.col); } _root.Interface.topMenu.btnStart.msg.text = 'PAUSE'; this.gameSent = false; }; v2.Pause = function () { this.gameState = 2; _root.Interface.topMenu.btnStart.msg.text = 'RESUME'; this.pauseField.Show(); this.pauseTime = this.GetTime(); }; v2.Pause2 = function () { this.gameState = 2; if (2) { this.pauseField.Hide(); _root.Interface.topMenu.btnStart.msg.text = 'PAUSE'; } this.gameState = 2; this.oldmsg = _root.Interface.topMenu.btnStart.msg.text; _root.Interface.topMenu.btnStart.msg.text = ''; this.pauseTime = this.GetTime(); }; v2.Resume = function () { this.gameState = 2; if (2) { this.gameState = 1; } _root.Interface.topMenu.btnStart.msg.text = 'PAUSE'; this.pauseField.Hide(); this.startTime += this.GetTime() - this.pauseTime; }; v2.Resume2 = function () { this.gameState = 2; if (2) { this.gameState = 1; } _root.Interface.topMenu.btnStart.msg.text = this.oldmsg; this.startTime += this.GetTime() - this.pauseTime; }; v2.GetLowestCreepLevel = function () { var v4 = 100; var v2 = 0; while (v2 < this.creeps.length) { var v3 = this.creeps[v2]; if (v3.level < v4) { v4 = v3.level; } ++v2; } return v4; }; v2.ShowFinish = function () { this.endTime = this.GetTime(); this.CancelSelect(); this.gameState = 3; this.FilterCreeps(); if (this.level > 50 && this.infChal) { this.level = this.GetLowestCreepLevel(); this.finished = true; } else { this.finished = this.finished && this.creeps.length == 0; if (this.finished) { this.score += this.lives * 25; this.score += this.levelBonus; } this.finished = this.finished && this.lives > 0; } _root.scoreBoard.SetScore(this.score, this.difficulty, this.finished); _root.scor = this.score; this.ToggleGrid(false); if (this.lives < 1) { _root.transition.zone = 'gameover'; _root.transition.gotoAndPlay(2); stopAllSounds(); this.PlaySound('lost'); } else { if (this.mission < 6) { _root.startPanel.mission = 'mission ' + this.mission + ' complete'; } else { _root.startPanel.mission = 'ALL MISSIONS DONE! CONGRATULATION !'; } _root.biscuit.data['mission' + this.mission] = true; _root.startPanel['mission' + this.mission]._visible = false; _root.zik2.son.stop(); _root.zik1.son.start(0, 999); this.PlaySound('win'); _root.startPanel['mission' + this.mission]._visible = false; } _root.game.ShowStart(); if (this.score > 5000 && this.difficulty > 1) { this.PlaySound(''); } }; v2.ToggleGrid = function (tf) { this.CancelSelect(); if (tf != undefined) { this.gridOn = tf; } else { this.gridOn = !this.gridOn; } this.gridField.ToggleGrid(); if (this.gridOn) { _root.Interface.btnGrid.msg.text = 'NO GRID'; } else { _root.Interface.btnGrid.msg.text = 'GRID'; } }; v2.FrameTick = function () { if (this.gameState == 1) { if (++this.tick > 24) { this.tick = 1; this.Tick(); } if (++this.tTick == 6) { this.tTick = 1; this.AssignTowerTargets(); } if (this.newLevelTick > 0) { --this.newLevelTick; this.PlaySound('LETSGO.WAV'); } } }; v2.Tick = function () { if (this.creepDied) { this.FilterCreeps(); } this.creepDied = false; if (this.finished && this.creeps.length == 0) { this.ShowFinish(); } else { if (!this.finished) { --this.timeToLevel; if (this.timeToLevel == 0) { this.NextLevel(); } this.topMenu.timeleft.text = this.timeToLevel; } } }; v2.AssignTowerTargets = function () { this.flyingCreeps = false; var v10 = 0; while (v10 < this.creeps.length) { var v2 = this.creeps[v10]; if (v2._x >= this.startX && v2._x <= this.endX && v2._y >= this.startY && v2._y <= this.endY) { var v6 = v2.cCell; if (v2.flying) { v6 = this.cells[int((v2._y - this.startY) / this.gridSize)][int((v2._x - this.startX) / this.gridSize)]; this.flyingCreeps = true; } if (v6) { var v5 = 0; while (v5 < v6.rangeTowers.length) { var v4 = v6.rangeTowers[v5]; var v3 = v4.tower; if (!v3.target) { if (v3.TargetValid(v2)) { if (!v4.partial) { v3.target = v2; } else { var v7 = v4.tower._x - v2._x; var v8 = v4.tower._y - v2._y; var v9 = Math.sqrt(v7 * v7 + v8 * v8); if (v9 <= v3.range) { v3.target = v2; } } } } ++v5; } } } ++v10; } }; v2.AssignTargetCreep = function (cr) { var v8 = []; var v3 = 0; while (v3 < this.towerField.getNextHighestDepth()) { var v2 = this.towerField['tower' + v3]; if (v2 && v2.towerType == 1 && v2.level == 6) { var v4 = v2._x - cr._x; var v5 = v2._y - cr._y; var v6 = Math.sqrt(v4 * v4 + v5 * v5); if (v6 <= v2.range) { v2.target = cr; v2.override = true; } } ++v3; } }; v2.ModifyTowerRangeBox = function (t, addtower) { var v20 = int(t.range / this.gridSize) + 1; var v18 = t.topLeftCell; var v12 = v18.left + this.gridSize; var v13 = v18.top + this.gridSize; var v17 = v18.row - v20; var v19 = v18.row + v20 + 1; var v15 = v18.col - v20; var v14 = v18.col + v20 + 1; var v9 = v17; while (v9 < v19) { var v3 = v15; while (v3 < v14) { var v2 = this.cells[v9][v3]; var v8 = v2.left + this.gridSize / 2; var v10 = v2.top + this.gridSize / 2; var v6 = v12 - v8; var v7 = v13 - v10; var v5 = Math.sqrt(v6 * v6 + v7 * v7); if (v5 <= t.range) { if (addtower) { var v11 = v5 > t.range - this.gridSize; v2.AddRangeTower(t, v11); } else { v2.RemoveRangeTower(t); } } ++v3; } ++v9; } this.gridField.DrawGrid(); }; v2.TowerButtonRollover = function (type, btn) { if (this.gameState == -1) { return undefined; } this.infoPanel.SetTowerInfo(this.towers[type][1], btn); }; v2.SelectCreep = function (c) { if (this.gameState > 1) { return undefined; } if (c) { this.CancelSelect(); this.infoPanel.SetCreep(c); } else { this.CancelSelect(); } }; v2.SelectCell = function (cellRow, cellCol) { var v2 = this.cells[cellRow][cellCol]; if (this.gameState > 1) { return undefined; } if (v2.tower && !v2.tower.selling) { this.CancelSelect(); this.gridField.SelectTower(v2.tower); this.infoPanel.SetTower(v2.tower); if (v2.tower.level < 6) { if (v2.tower.towerType != 7) { var v4 = this.towers[v2.tower.towerType][v2.tower.level + 1]; this.upgradePanel.SetTower(v2.tower, v4); this.gridField.SelectTower(v2.tower); } v2.tower.SetSelected(true); } else { v2.tower.SetSelected(true); } } else { if (cellCol >= 0 && cellCol < this.cellCols && cellRow >= 0 && cellRow < this.cellRows) { this.CancelSelect(); } } }; v2.CancelSelect = function () { var v3; if (this.gridField.dragTower) { v3 = this.gridField.dragTower; this.gridField.StopFollowTower(); removeMovieClip(v3); this.infoPanel.Cancel(); } else { if (this.infoPanel.tower) { v3 = this.infoPanel.tower; this.infoPanel.Cancel(); this.upgradePanel.Cancel(); this.gridField.CancelSelect(); } else { if (this.infoPanel.creep) { this.infoPanel.Cancel(); } } } if (v3) { v3.SetSelected(false); } if (_root.Interface.blockingPopup._visible) { _root.Interface.blockingPopup.Hide(); } }; v2.UpgradeSelectedTower = function (quick) { var v2 = this.upgradePanel.tower; var v3 = this.upgradePanel.towerObject; if (v2 && v3) { this.AdjustGold(-(int(v3.cost) - v2.cost)); v2.Upgrade(v3); this.PlaySound('upgrading.wav'); if (quick) { v2.ApplyUpgrade(); this.PlaySound('upgrading.wav'); } } }; v2.SellTower = function (t) { if (this.gameState == 0) { this.AdjustGold(int(t.cost)); } else { this.AdjustGold(int(t.cost * 0.75)); } var v5 = 0; while (v5 < t.size) { var v2 = 0; while (v2 < t.size) { var v3 = this.cells[t.topLeftCell.row + v5][t.topLeftCell.col + v2]; v3.tower = undefined; v3.cost = 1; ++v2; } ++v5; } this.ModifyTowerRangeBox(t, false); t.topLeftCell = undefined; this.PlaySound('Kaching.wav'); this.FilterCreeps(); this.MakeFloodPath(true); if (this.difficulty > 1) { this.MakeFloodPath(false); } }; v2.SellSelectedTower = function () { var v3 = this.infoPanel.tower; var v4; this.AdjustGold(int(v3.cost * 0.75)); var v5 = 0; while (v5 < v3.size) { var v2 = 0; while (v2 < v3.size) { v4 = this.cells[v3.topLeftCell.row + v5][v3.topLeftCell.col + v2]; v4.tower = undefined; v4.cost = 1; ++v2; } ++v5; } v3.SetSelected(false); this.ModifyTowerRangeBox(v3, false); v3.topLeftCell = undefined; this.infoPanel.Cancel(); this.upgradePanel.Cancel(); this.gridField.CancelSelect(); removeMovieClip(v3); this.PlaySound('Kaching.wav'); this.BuildCreepPaths(true); this.BuildCreepPaths(false); this.FilterCreeps(); var v6 = this.GetTime(); var v7 = this.MakeFloodPath(true); }; v2.CellHitTest = function (cellRow, cellCol, t) { var v3; var v4 = 0; if (this.gold >= t.cost) { var v5 = 0; while (v5 < t.size) { var v2 = 0; while (v2 < t.size) { v3 = this.cells[cellRow + v5][cellCol + v2]; if (v3.cost == 0) { v4 = 2; break; } else { if (v3.creepCount > 0) { v4 = 3; break; } else { if (v3.barrier) { v4 = 4; break; } } } ++v2; } if (v4 > 0) { break; } ++v5; } return v4; } v4 = 1; return v4; }; v2.DropTower = function (t, c) { if (this.gridField.hitTest == 0 && this.gameState < 2 && this.gridField.dragTower) { this.PlaceTower(t, c); } else { this.gridField.StopFollowTower(); } }; v2.PlaceTower = function (t, c) { var v8 = []; var v4; var v11 = false; var v12 = false; var v14; var v7 = 0; while (v7 < t.size) { var v3 = 0; while (v3 < t.size) { v4 = this.cells[c.row + v7][c.col + v3]; v8.push(v4); v4.tower = t; v4.cost = 0; ++v3; } ++v7; } this.FilterCreeps(); var v13 = this.GetTime(); var v10 = this.MakeFloodPath(true); if (this.difficulty > 1) { v10 = v10 && this.MakeFloodPath(false); } if (!v10) { var v6 = 0; while (v6 < v8.length) { v8[v6].cost = 1; v8[v6].tower = undefined; ++v6; } this.PlaySound('X.wav'); _root.Interface.blockingPopup.Show(); return undefined; } this.gridField.StopFollowTower(); t.topLeftCell = c; t._x = c.left + this.gridSize; t._y = c.top + this.gridSize; t._visible = true; t.SetRotation(); this.ModifyTowerRangeBox(t, true); this.AdjustGold(-t.cost); t.build.gotoAndPlay(2); this.PlaySound('scratch.wav'); this.infoPanel.Cancel(); }; v2.BuildCreepPaths = function (LR) { var v2; var v3; ++this.pathID; this.ClearPath(LR); this.MakePath(LR); var v4 = 0; while (v4 < this.creepField.getNextHighestDepth()) { v2 = this.creepField['Alien' + v4]; if (v2 && !v2.flying && !v2.dead) { if (v2.entering) { v3 = v2.startCell; } else { v3 = v2.cCell; } if (v3) { if (LR && v2.LR && v3.nextCellLR == undefined || !LR && !v2.LR && v3.nextCellUD == undefined) { if (!this.MakePathFromCell(v3, v2.LR)) { if (v2.entering) { v2.flying = true; v2.forcedFly = true; } else { v2.SetFlying(); v2.forcedFly = true; } } } } } ++v4; } }; v2.ClearPath = function (LR) { var v3 = 0; while (v3 < this.cellRows) { var v2 = 0; while (v2 < this.cellCols) { var v4 = this.cells[v3][v2]; v4.ClearPath(LR); ++v2; } ++v3; } }; v2.PlayButtonSound = function () { this.PlaySound('CHANGEOP.WAV'); }; v2.transitSound = function () { this.PlaySound('transit'); }; v2.PlaySound = function (wav) { if (!this.muted) { var v2 = new Sound(); v2.attachSound(wav); v2.start(); } }; v2.AdjustGold = function (byVal) { this.gold = int(this.gold) + int(byVal); this.topMenu.gold.text = int(this.gold); this.infoPanel.CheckGold(); this.upgradePanel.CheckGold(); this.gridField.CheckGold(); this.cg -= byVal; if (isNaN(this.gold) || this.gold == undefined || this.cg < 0) { this.gold = 0; } }; v2.AdjustScore = function (byVal) { this.score += byVal; if (this.levelBonus > 0) { this.topMenu.score.text = this.score; } else { this.topMenu.score.text = this.score; } }; v2.AddTower = function (type, drag) { var v3 = this.towerField.getNextHighestDepth(); var v4; var v2 = this.towers[type][1]; this.CancelSelect(); if (v3 == 0) { v3 = 1; } this.towerField.attachMovie('Tower', 'tower' + v3, v3, {'id': v3, 'creeps': this.creeps, 'level': v2.level, 'towerName': v2.towerName, 'desc': v2.desc, 'cost': int(v2.cost), 'towerType': v2.towerType, 'hitRate': v2.hitRate, 'range': v2.range, 'damage': v2.damage, 'splash': v2.splash, 'slow': v2.slow, 'bash': v2.bash, 'rotating': v2.rotating, 'dragged': drag}); v4 = this.towerField['tower' + v3]; if (drag) { this.gridField.FollowTower(v4); } this.infoPanel.SetTower(v4); }; v2.MakePathFromCell = function (c, LR) { var v2; if (LR) { v2 = this.pathFinder.FindPath(this.cells, c.row, c.col, this.midRow, this.cellCols - 1); if (v2 == undefined) { return false; } else { this.StorePath(v2, true, false); return true; } } else { v2 = this.pathFinder.FindPath(this.cells, c.row, c.col, this.cellRows - 1, this.midCol); if (v2 == undefined) { return false; } else { this.StorePath(v2, false, false); return true; } } }; v2.CheckPath = function (LR) { var v2; if (LR) { v2 = this.pathFinder.FindPath(this.cells, this.midRow, 0, this.midRow, this.cellCols - 1); return v2 != undefined; } v2 = this.pathFinder.FindPath(this.cells, 0, this.midCol, this.cellRows - 1, this.midCol); return v2 != undefined; }; v2.MakePath = function (LR, force) { var v2; ++this.pathID; if (LR) { v2 = this.pathFinder.FindPath(this.cells, this.midRow, 0, this.midRow, this.cellCols - 1); } else { v2 = this.pathFinder.FindPath(this.cells, 0, this.midCol, this.cellRows - 1, this.midCol); } if (v2 != undefined) { this.StorePath(v2, LR, force); return true; } else { return false; } }; v2.GetURLArgs = function (map, pn) { var v5 = this.endTime - this.startTime; var v3; if (this.speedChal) { v3 = '210000'; } else { if (this.infChal) { v3 = '310000'; } else { if (this.mapMode == 1) { v3 = '410000'; } else { if (this.mapMode == 2) { v3 = '420000'; } else { if (this.onlySpawn) { v3 = '440000'; } else { v3 = '1' + int(this.NoPellet) + int(this.NoSquirt) + int(this.NoDart) + int(this.NoSwarm) + int(this.NoFrost); } } } } } var v2 = 'v=2&t=' + v5 + '&d=' + this.difficulty + '&s=' + this.score + '&l=' + this.lives + '&c=' + v3 + '&cr=' + this.creepKills + '&lv=' + this.level; if (pn.length > 0) { v2 = v2 + '&n=' + escape(pn); } v2 = v2 + '&m=' + map; var v6 = new md5(); var v4 = v6.hash(v2 + 'p' + 's' + 'p' + '2007'); v2 = v2 + '&md5=' + v4; return v2; }; v2.AddExplosion = function (type, posX, posY, dx, dy) { var v2 = 2; var v8 = 0; var v7 = 5; var v5 = 8; var v16; switch (type) { break; case 1: case 2: this.PlaySound('bop.wav'); v2 = 5; v7 = 8; break; case 3: dx = -dx * 2; dy = -dy * 2; v2 = 4; break; case 4: this.PlaySound('bop.wav'); dx = -dx * 2; dy = -dy * 2; v2 = 4; break; default: return undefined; } var v6 = {'frame': type, 'ticks': v5, '_x': posX, '_y': posY}; this.effectsField.attachMovie('Fragment', 'fragment' + this.expLevel, this.expLevel, v6); this.expLevel += v2; if (this.expLevel > 100) { this.expLevel = 0; } }; v2.GetMapString = function () { var v9 = 'v1:' + this.cellRows + ':' + this.cellCols + ':'; var v4 = []; var v8 = 0; while (v8 < this.cellRows) { var v5 = 0; while (v5 < this.cellCols) { var v3 = this.cells[v8][v5]; if (v3.tower) { var v6 = true; var v2 = 0; while (v2 < v4.length) { if (v4[v2].topLeftCell.row == v3.tower.topLeftCell.row && v4[v2].topLeftCell.col == v3.tower.topLeftCell.col) { v6 = false; break; } ++v2; } if (v6) { v4.push(v3.tower); } } ++v5; } ++v8; } v8 = 0; while (v8 < v4.length) { var v7 = v4[v8]; v9 = v9.concat(this.PadNumber(v7.topLeftCell.row, 2), this.PadNumber(v7.topLeftCell.col, 2), v7.towerType, v7.level); ++v8; } return v9; }; v2.PadNumber = function (num, chars) { var v2 = '' + num; var v1 = 0; while (v1 < chars - v2.length) { v2 = '0' + v2; ++v1; } return v2; }; v2.TraceCells = function () { var v3 = 0; while (v3 < this.cellRows) { var v5 = ''; var v2 = 0; while (v2 < this.cellCols) { var v4 = this.cells[v3][v2]; v5 = v5.concat(v4.cost); ++v2; } ++v3; } }; v2.StorePath = function (path, LR, force) { var v8; var v9; var v6; var v7; var v12; var v2; var v4; var v3 = path.length - 1; while (v3 > 0) { v9 = path[v3][0]; v8 = path[v3][1]; v7 = path[v3 - 1][0]; v6 = path[v3 - 1][1]; v2 = this.cells[v9][v8]; v4 = this.cells[v7][v6]; v2.pathID = this.pathID; if (LR) { if (v2.nextCellLR == undefined) { v2.nextCellLR = v4; v4.parentCellsLR.push(v2); } else { if (!force) { break; } } } else { if (v2.nextCellUD == undefined) { v2.nextCellUD = v4; v4.parentCellsUD.push(v2); } else { if (!force) { break; } } } --v3; } }; v2.AddKill = function (c) { var v3 = this.bountyField.getNextHighestDepth(); if (this.infoPanel.creep == c) { this.CancelSelect(); } this.AdjustGold(c.bounty); this.AdjustScore(c.bounty); if (c.bounty > 0) { this.bountyField.attachMovie('Bounty', 'bounty' + v3, v3, {'_x': c._x, '_y': c._y - 10, 'num': c.bounty}); } this.PlaySound('SPLAT.WAV'); this.creepDied = true; ++this.creepKills; }; v2.LoseALife = function (c) { --this.lives; this.topMenu.lives.text = this.lives; this.topMenu.vie.gotoAndStop(this.lives); if (this.infoPanel.creep == c) { this.CancelSelect(); } this.PlaySound('YIPPEE.WAV'); if (this.lives == 0) { this.ShowFinish(); } this.creepDied = true; }; v2.SendNextLevel = function () { if (this.gameState == 1) { this.NextLevel(true); } else { if (this.gameState == 0) { this.Start(); } } }; v2.NextLevel = function (early) { if (this.finished && this.creeps.length == 0) { this.ShowFinish(); return undefined; } if (early && !this.infChal) { this.levelBonus += this.timeToLevel * 2; this.AdjustScore(0); } if (this.speedChal) { this.currentLevelTime = 15; this.timeToLevel = this.currentLevelTime; } else { this.currentLevelTime = this.levelTime + int(this.level / 5); this.timeToLevel = this.currentLevelTime; } if (this.timeToLevel > 50) { this.timeToLevel = 50; } ++this.level; this.currentWave = this.waves[this.level]; this.topMenu.level.text = this.level; this.AddWave(this.currentWave); if (this.level == this.waves.length - 1) { this.btnNextLevel._visible = false; this.finished = true; this.topMenu.timeleft.text = ''; this.timeToLevel = 0; } }; v2.InitWaves = function () { var v3; var v4; var v18; var v20 = false; var v7 = 0; var v6 = 0; var v8 = 0; var v2; switch (this.difficulty) { case 1: v3 = 1; v4 = 20; v18 = 2.2; break; case 2: case 5: v3 = 1; v4 = 20; v18 = 2.2; break; case 3: v3 = 1; v4 = 30; v18 = 2.2; break; case 4: v3 = 1; v4 = 30; v18 = 2.1; } this.waves = new Array(); this.waves[0] = 1; var v19 = this.infChal ? 100 : this.lvlmax; var v5 = 0; while (v5 < v19) { if (v5 == 48) { v2 = {'count': 1, 'bounty': v3 * 20, 'size': 200, 'health': v4 * 12, 'speed': 1, 'flying': true, 'immune': false, 'spawn': 1, 'delay': 20}; if (this.difficulty == 2) { v2.immune = false; } v2.color = 11184640; v2.level = v5 + 1; this.waves.push(v2); } else { if (v5 == 49) { v2 = {'count': 30, 'bounty': v3, 'size': 100, 'health': int(v4 / 1.3), 'speed': 1, 'flying': false, 'immune': true, 'spawn': 1, 'delay': 30}; if (this.difficulty == 2) { v2.immune = false; } v2.color = 11141290; v2.level = v5 + 1; this.waves.push(v2); } else { ++v6; ++v7; if (this.onlySpawn) { v2 = {'count': 4, 'bounty': v3 * 20, 'size': 130, 'health': v4 * 3, 'speed': 1, 'flying': false, 'immune': false, 'spawn': 3, 'delay': 20}; if (v5 < 20) { v2.spawn = 2; } } else { switch (v6) { case 1: v2 = {'count': 10, 'bounty': v3, 'size': 100, 'health': v4, 'speed': 1, 'flying': false, 'immune': false, 'spawn': 1, 'delay': 20}; break; case 2: v2 = {'count': 10, 'bounty': v3, 'size': 100, 'health': v4 * 1.33, 'speed': 1, 'flying': false, 'spawn': 1, 'delay': 20}; break; case 3: v2 = {'count': 10, 'bounty': v3, 'size': 110, 'health': v4 * 1.5, 'speed': 1, 'flying': false, 'immune': false, 'spawn': 1, 'delay': 1}; break; case 4: v2 = {'count': 10, 'bounty': v3, 'size': 120, 'health': v4 * 1.66, 'speed': 1, 'flying': false, 'immune': true, 'spawn': 1, 'delay': 20}; break; case 5: v2 = {'count': 10, 'bounty': v3, 'size': 110, 'health': v4 * 1.8, 'speed': (this.difficulty < 3 && v5 == 3) ? 1.25 : 1.5, 'flying': false, 'immune': false, 'spawn': 1, 'delay': 20}; break; case 6: v2 = {'count': 4, 'bounty': int(v3 * 2.5), 'size': 130, 'health': v4 * 3, 'speed': 1, 'flying': false, 'immune': false, 'spawn': this.difficulty < 3 ? 2 : 3, 'delay': 20}; break; case 7: v2 = {'count': 10, 'bounty': v3, 'size': 120, 'health': v4 * 2, 'speed': 1, 'flying': true, 'immune': false, 'spawn': 1, 'delay': 20}; } } v2.level = v5 + 1; if (this.difficulty == 1 && v5 < 8) { v2.flying = false; v2.immune = false; v2.speed = 1; v2.delay = 25; v2.spawn = 1; v2.count = 10; } if (this.difficulty == 1) { v2.bounty = int(v2.bounty * 1.5); if (v2.flying) { v2.health /= 2; } if (v2.spawn > 1) { v2.spawn = 2; } } if (v5 > 49) { v4 *= 1.09; v2.health = v4; } if (v6 == 7) { if (v5 < 50) { v4 *= v18; } v6 = 0; v3 += 1; } v2.color = 2236962; if (v2.immune) { v2.color = 11141290; } if (v2.flying) { v2.color = 11184640; } if (v2.speed > 1) { v2.color = 11141120; } if (v2.delay < 15) { v2.color = 21930; } if (v2.spawn > 1) { v2.color = 21760; if (v5 == 6) { v2.spawn = 2; } } if (v7 == 8) { if (!this.onlySpawn) { if (v2.speed > 1.25) { v2.speed = 1.25; } else { v2.speed = 0.8; } if (v2.delay < 15) { v2.count = 3; v2.bounty = v3 * 6; v2.health *= 5; v2.speed = 1; } else { if (v2.spawn == 1) { v2.count = 1; v2.bounty = v3 * 20; v2.health *= 12; } else { v2.count = 1; v2.bounty = v3 * 20; v2.health *= 12; } } v2.size = 150; } v7 = 0; } v2.health = int(v2.health); v8 += v2.count * v2.bounty; this.waves.push(v2); } } ++v5; } this.cg = v8 * 2; }; v2.InitTowers = function () { this.towers = []; this.towers[1] = []; this.towers[1][1] = {'level': 1, 'towerName': 'Vulcan Turret', 'towerType': 1, 'cost': 5, 'hitRate': 48, 'range': 60, 'damage': 10, 'splash': 0, 'slow': 0, 'bash': 0, 'rotating': true, 'desc': 'Basic gun turret.'}; this.towers[1][2] = {'level': 2, 'towerName': 'Vulcan Turret 2', 'towerType': 1, 'cost': 10, 'hitRate': 48, 'range': 60, 'damage': 20, 'splash': 0, 'slow': 0, 'bash': 0, 'rotating': true, 'desc': 'Adds more damage.'}; this.towers[1][3] = {'level': 3, 'towerName': 'Vulcan Turret 3', 'towerType': 1, 'cost': 20, 'hitRate': 48, 'range': 60, 'damage': 40, 'splash': 0, 'slow': 0, 'bash': 0, 'rotating': true, 'desc': 'Adds more damage.'}; this.towers[1][4] = {'level': 4, 'towerName': 'Vulcan Turret 4', 'towerType': 1, 'cost': 40, 'hitRate': 48, 'range': 60, 'damage': 80, 'splash': 0, 'slow': 0, 'bash': 0, 'rotating': true, 'desc': 'Adds more damage.'}; this.towers[1][5] = {'level': 5, 'towerName': 'Vulcan Turret 5', 'towerType': 1, 'cost': 80, 'hitRate': 48, 'range': 60, 'damage': 160, 'splash': 0, 'slow': 0, 'bash': 0, 'rotating': true, 'desc': 'Adds more damage.'}; this.towers[1][6] = {'level': 6, 'towerName': 'Vulcan Tower', 'towerType': 1, 'cost': 200, 'hitRate': 64, 'range': 180, 'damage': 400, 'splash': 0, 'slow': 0, 'bash': 0, 'rotating': true, 'desc': 'Turns into a sniper tower. Final upgrade.'}; this.towers[2] = []; this.towers[2][1] = {'level': 1, 'towerName': 'Missile Turret', 'towerType': 2, 'cost': 20, 'hitRate': 72, 'range': 90, 'damage': 8, 'splash': 35, 'slow': 0, 'bash': 0, 'rotating': true, 'desc': 'Slow firing. Damages an area on the ground.'}; this.towers[2][2] = {'level': 2, 'towerName': 'Missile Turret 2', 'towerType': 2, 'cost': 35, 'hitRate': 72, 'range': 100, 'damage': 16, 'splash': 40, 'slow': 0, 'bash': 0, 'rotating': true, 'desc': 'Increases damage, splash and range.'}; this.towers[2][3] = {'level': 3, 'towerName': 'Missile Turret 3', 'towerType': 2, 'cost': 70, 'hitRate': 72, 'range': 110, 'damage': 32, 'splash': 45, 'slow': 0, 'bash': 0, 'rotating': true, 'desc': 'Increases damage, splash and range.'}; this.towers[2][4] = {'level': 4, 'towerName': 'Missile Turret 4', 'towerType': 2, 'cost': 130, 'hitRate': 72, 'range': 120, 'damage': 64, 'splash': 55, 'slow': 0, 'bash': 0, 'rotating': true, 'desc': 'Increases damage, splash and range.'}; this.towers[2][5] = {'level': 5, 'towerName': 'Missile Turret 5', 'towerType': 2, 'cost': 240, 'hitRate': 72, 'range': 130, 'damage': 128, 'splash': 60, 'slow': 0, 'bash': 0, 'rotating': true, 'desc': 'Increases damage, splash and range.'}; this.towers[2][6] = {'level': 6, 'towerName': 'Missile Tower', 'towerType': 2, 'cost': 400, 'hitRate': 72, 'range': 140, 'damage': 256, 'splash': 65, 'slow': 0, 'bash': 0, 'rotating': true, 'desc': 'Increases damage, splash and range. Final upgrade.'}; this.towers[3] = []; this.towers[3][1] = {'level': 1, 'towerName': 'Plasma Turret', 'towerType': 3, 'cost': 15, 'hitRate': 12, 'range': 70, 'damage': 5, 'splash': 0, 'slow': 0, 'bash': 0, 'rotating': true, 'desc': 'Quick firing.'}; this.towers[3][2] = {'level': 2, 'towerName': 'Plasma Turret 2', 'towerType': 3, 'cost': 30, 'hitRate': 12, 'range': 70, 'damage': 10, 'splash': 0, 'slow': 0, 'bash': 0, 'rotating': true, 'desc': 'Increases damage by +90%.'}; this.towers[3][3] = {'level': 3, 'towerName': 'Plasma Turret 3', 'towerType': 3, 'cost': 50, 'hitRate': 12, 'range': 70, 'damage': 18, 'splash': 0, 'slow': 0, 'bash': 0, 'rotating': true, 'desc': 'Increases damage by +90%.'}; this.towers[3][4] = {'level': 4, 'towerName': 'Plasma Turret 4', 'towerType': 3, 'cost': 90, 'hitRate': 12, 'range': 70, 'damage': 34, 'splash': 0, 'slow': 0, 'bash': 0, 'rotating': true, 'desc': 'Increases damage by +90%.'}; this.towers[3][5] = {'level': 5, 'towerName': 'Plasma Turret 5', 'towerType': 3, 'cost': 160, 'hitRate': 12, 'range': 70, 'damage': 65, 'splash': 0, 'slow': 0, 'bash': 0, 'rotating': true, 'desc': 'Increases damage by +90%.'}; this.towers[3][6] = {'level': 6, 'towerName': 'BFG Tower', 'towerType': 3, 'cost': 450, 'hitRate': 8, 'range': 90, 'damage': 320, 'splash': 0, 'slow': 0, 'bash': 0, 'rotating': true, 'desc': 'Increases range and damage by +400%. Final upgrade.'}; this.towers[4] = []; this.towers[4][1] = {'level': 1, 'towerName': 'DCA ', 'towerType': 4, 'cost': 50, 'hitRate': 18, 'range': 60, 'damage': 20, 'splash': 0, 'slow': 0, 'bash': 0, 'rotating': false, 'desc': 'DCA tower that fires 4 missiles at a time.'}; this.towers[4][2] = {'level': 2, 'towerName': 'DCA 2', 'towerType': 4, 'cost': 80, 'hitRate': 18, 'range': 60, 'damage': 40, 'splash': 0, 'slow': 0, 'bash': 0, 'rotating': false, 'desc': 'Increases damage.'}; this.towers[4][3] = {'level': 3, 'towerName': 'DCA 3', 'towerType': 4, 'cost': 130, 'hitRate': 18, 'range': 65, 'damage': 80, 'splash': 5, 'slow': 0, 'bash': 0, 'rotating': false, 'desc': 'Increases damage, range and adds splash.'}; this.towers[4][4] = {'level': 4, 'towerName': 'DCA 4', 'towerType': 4, 'cost': 205, 'hitRate': 18, 'range': 65, 'damage': 160, 'splash': 10, 'slow': 0, 'bash': 0, 'rotating': false, 'desc': 'Increases damage and splash.'}; this.towers[4][5] = {'level': 5, 'towerName': 'DCA 5', 'towerType': 4, 'cost': 330, 'hitRate': 18, 'range': 70, 'damage': 320, 'splash': 15, 'slow': 0, 'bash': 0, 'rotating': false, 'desc': 'Increases damage, splash and range.'}; this.towers[4][6] = {'level': 6, 'towerName': 'ThW Tower', 'towerType': 4, 'cost': 640, 'hitRate': 12, 'range': 75, 'damage': 480, 'splash': 20, 'slow': 0, 'bash': 0, 'rotating': false, 'desc': 'Increases damage, splash and range. Final upgrade.'}; this.towers[5] = []; this.towers[5][1] = {'level': 1, 'towerName': 'Freeze Turret', 'towerType': 5, 'cost': 50, 'hitRate': 48, 'range': 50, 'damage': 10, 'splash': 35, 'slow': 15, 'bash': 0, 'rotating': true, 'desc': 'Damage and freezes aliens to slow them down.'}; this.towers[5][2] = {'level': 2, 'towerName': 'Freeze Turret 2', 'towerType': 5, 'cost': 75, 'hitRate': 48, 'range': 50, 'damage': 15, 'splash': 35, 'slow': 20, 'bash': 0, 'rotating': true, 'desc': 'Increases splash and slow.'}; this.towers[5][3] = {'level': 3, 'towerName': 'Freeze Turret 3', 'towerType': 5, 'cost': 100, 'hitRate': 48, 'range': 50, 'damage': 20, 'splash': 40, 'slow': 25, 'bash': 0, 'rotating': true, 'desc': 'Increases splash and slow.'}; this.towers[5][4] = {'level': 4, 'towerName': 'Freeze Turret 4', 'towerType': 5, 'cost': 125, 'hitRate': 48, 'range': 50, 'damage': 25, 'splash': 45, 'slow': 30, 'bash': 0, 'rotating': true, 'desc': 'Increases splash and slow.'}; this.towers[5][5] = {'level': 5, 'towerName': 'Freeze Turret 5', 'towerType': 5, 'cost': 150, 'hitRate': 48, 'range': 50, 'damage': 30, 'splash': 50, 'slow': 35, 'bash': 0, 'rotating': true, 'desc': 'Increases splash and slow.'}; this.towers[5][6] = {'level': 6, 'towerName': 'Zero Tower', 'towerType': 5, 'cost': 200, 'hitRate': 48, 'range': 75, 'damage': 40, 'splash': 50, 'slow': 40, 'bash': 0, 'rotating': true, 'desc': 'Increases splash, slow and range. Final upgrade.'}; this.towers[6] = []; this.towers[6][1] = {'level': 1, 'towerName': 'Sonic Turret', 'towerType': 6, 'cost': 30, 'hitRate': 52, 'range': 40, 'damage': 10, 'splash': 40, 'slow': 0, 'bash': 4, 'rotating': false, 'desc': 'Damages the ground around it, plus a chance to paralyze.'}; this.towers[6][2] = {'level': 2, 'towerName': 'Sonic Turret 2', 'towerType': 6, 'cost': 55, 'hitRate': 52, 'range': 40, 'damage': 20, 'splash': 40, 'slow': 0, 'bash': 7, 'rotating': false, 'desc': '7% paralyze, increases damage.'}; this.towers[6][3] = {'level': 3, 'towerName': 'Sonic Turret 3', 'towerType': 6, 'cost': 105, 'hitRate': 52, 'range': 40, 'damage': 40, 'splash': 40, 'slow': 0, 'bash': 10, 'rotating': false, 'desc': '10% paralyze, increases damage.'}; this.towers[6][4] = {'level': 4, 'towerName': 'Sonic Turret 4', 'towerType': 6, 'cost': 205, 'hitRate': 52, 'range': 40, 'damage': 80, 'splash': 40, 'slow': 0, 'bash': 13, 'rotating': false, 'desc': '13% paralyze, increases damage.'}; this.towers[6][5] = {'level': 5, 'towerName': 'Sonic Turret 5', 'towerType': 6, 'cost': 390, 'hitRate': 52, 'range': 40, 'damage': 160, 'splash': 40, 'slow': 0, 'bash': 15, 'rotating': false, 'desc': '15% paralyze, increases damage.'}; this.towers[6][6] = {'level': 6, 'towerName': 'HyperSonic Tower', 'towerType': 6, 'cost': 745, 'hitRate': 44, 'range': 40, 'damage': 320, 'splash': 40, 'slow': 0, 'bash': 20, 'rotating': false, 'desc': '20% paralyze, increases damage. Final upgrade.'}; this.towers[7] = []; this.towers[7][1] = {'level': 1, 'towerName': 'wall', 'towerType': 7, 'cost': 2, 'hitRate': 0, 'range': 0, 'damage': 0, 'splash': 0, 'slow': 0, 'bash': 0, 'rotating': false, 'desc': 'Wall.'}; this.towers[7][2] = {'level': 2, 'towerName': 'wall', 'towerType': 7, 'cost': 2, 'hitRate': 0, 'range': 0, 'damage': 0, 'splash': 0, 'slow': 0, 'bash': 0, 'rotating': false, 'desc': 'Wall to block aliens.'}; this.towers[7][3] = {'level': 3, 'towerName': 'wall', 'towerType': 7, 'cost': 2, 'hitRate': 0, 'range': 0, 'damage': 0, 'splash': 0, 'slow': 0, 'bash': 0, 'rotating': false, 'desc': 'Wall to block aliens.'}; this.towers[7][4] = {'level': 4, 'towerName': 'wall', 'towerType': 7, 'cost': 2, 'hitRate': 0, 'range': 0, 'damage': 0, 'splash': 0, 'slow': 0, 'bash': 0, 'rotating': false, 'desc': 'Wall to block aliens.'}; this.towers[7][5] = {'level': 5, 'towerName': 'wall', 'towerType': 7, 'cost': 2, 'hitRate': 0, 'range': 0, 'damage': 0, 'splash': 0, 'slow': 0, 'bash': 0, 'rotating': false, 'desc': 'Wall to block aliens.'}; this.towers[7][6] = {'level': 6, 'towerName': 'wall', 'towerType': 7, 'cost': 2, 'hitRate': 0, 'range': 0, 'damage': 0, 'splash': 0, 'slow': 0, 'bash': 0, 'rotating': false, 'desc': 'Wall to block aliens.'}; this.towers[8] = []; this.towers[8][1] = {'level': 1, 'towerName': 'Mines', 'towerType': 8, 'cost': 1, 'hitRate': 52, 'range': 30, 'damage': 10, 'splash': 100, 'slow': 0, 'bash': 4, 'rotating': false, 'desc': 'Damages the area around it.'}; this.towers[8][2] = {'level': 2, 'towerName': 'Sonic Turret 2', 'towerType': 8, 'cost': 55, 'hitRate': 52, 'range': 35, 'damage': 20, 'splash': 40, 'slow': 0, 'bash': 6, 'rotating': false, 'desc': '6% paralyze, increases damage and splash'}; this.towers[8][3] = {'level': 3, 'towerName': 'Sonic Turret 3', 'towerType': 8, 'cost': 105, 'hitRate': 52, 'range': 40, 'damage': 40, 'splash': 50, 'slow': 0, 'bash': 10, 'rotating': false, 'desc': '10% paralyze, increases damage and splash'}; this.towers[8][4] = {'level': 4, 'towerName': 'Sonic Turret 4', 'towerType': 8, 'cost': 205, 'hitRate': 52, 'range': 45, 'damage': 80, 'splash': 50, 'slow': 0, 'bash': 13, 'rotating': false, 'desc': '13% paralyze, increases damage.'}; this.towers[8][5] = {'level': 5, 'towerName': 'Sonic Turret 5', 'towerType': 8, 'cost': 390, 'hitRate': 52, 'range': 50, 'damage': 160, 'splash': 50, 'slow': 0, 'bash': 15, 'rotating': false, 'desc': '15% paralyze, increases damage and splash'}; this.towers[8][6] = {'level': 6, 'towerName': 'HyperSonic Tower', 'towerType': 8, 'cost': 745, 'hitRate': 44, 'range': 55, 'damage': 320, 'splash': 60, 'slow': 0, 'bash': 20, 'rotating': false, 'desc': '20% paralyze, increases damage. Final upgrade.'}; }; v2.FilterCreeps = function () { var v2 = 0; while (v2 < this.creeps.length) { if ('' + this.creeps[v2] == '') { this.creeps.splice(v2, 1); } else { ++v2; } } }; v2.AddSpawnCreeps = function (cr) { if (cr.spawnLevel == cr.spawnMax) { return undefined; } var v6 = this.creepField.getNextHighestDepth(); var v13 = cr.LR; var v30 = 2; var v8 = this.cells[int((cr.nextY - this.startY) / this.gridSize)][int((cr.nextX - this.startX) / this.gridSize)]; var v9 = int(cr.startHealth / v30); var v7 = []; var v5 = v8.row - 2; while (v5 < v8.row + 3) { var v3 = v8.col - 2; while (v3 < v8.col + 3) { if (v5 > 0 && v5 < this.cellRows && v3 > 0 && v3 < this.cellCols) { var v4 = this.cells[v5][v3]; if (v13) { if (v4.moveCostLR > 0) { v7.push(v4); } } else { if (v4.moveCostUD > 0) { v7.push(v4); } } } ++v3; } ++v5; } if (v7.length == 0) { v7.push(cr.cCell); } var v10 = 0; while (v10 < v30) { var v11 = v7[int(Math.random() * v7.length)]; var v12 = cr.endCell; if (v13) { this.creeps.push(this.creepField.attachMovie('Creep', 'creep' + v6, v6, {'id': v6, 'spawnMax': cr.spawnMax, 'spawnLevel': cr.spawnLevel + 1, 'startDelay': 0, 'startCell': v11, 'endCell': v12, 'bounty': 0, 'size': cr.size - 10, 'health': v9, 'shotHealth': v9, 'speed': cr.speed, 'immune': cr.immune, 'flying': cr.flying, 'color': cr.color, 'level': cr.level, 'LR': true})); ++v6; } else { this.creeps.push(this.creepField.attachMovie('Creep', 'creep' + v6, v6, {'id': v6, 'spawnMax': cr.spawnMax, 'spawnLevel': cr.spawnLevel + 1, 'startDelay': 0, 'startCell': v11, 'endCell': v12, 'bounty': 0, 'size': cr.size - 10, 'health': v9, 'shotHealth': v9, 'speed': cr.speed, 'immune': cr.immune, 'flying': cr.flying, 'color': cr.color, 'level': cr.level, 'LR': false})); ++v6; } this.creeps[this.creeps.length - 1].DoExplode(cr._x, cr._y); ++v10; } }; v2.AddWave = function (lvl) { var v3 = this.creepField.getNextHighestDepth(); this.creepCountLR = lvl.count; if (this.difficulty > 1) { this.creepCountUD = lvl.count; } else { this.creepCountUD = 0; } v3 = v3 + this.creepCountLR + this.creepCountUD; this.FilterCreeps(); var v4 = 0; while (v4 < lvl.count) { var v5; var v6; var v8 = this.openingStartRow + int(Math.random() * (this.openingEndRow - this.openingStartRow + 1)); v5 = this.cells[v8][0]; v6 = this.cells[v8][this.cellCols - 1]; this.creeps.push(this.creepField.attachMovie('Creep', 'creep' + v3, v3, {'id': this.creepCount, 'startDelay': v4 * lvl.delay, 'startCell': v5, 'endCell': v6, 'bounty': lvl.bounty, 'size': lvl.size, 'health': lvl.health, 'shotHealth': lvl.health, 'speed': lvl.speed, 'immune': lvl.immune, 'flying': lvl.flying, 'color': lvl.color, 'level': lvl.level, 'spawnMax': lvl.spawn, 'spawnLevel': 1, 'LR': true})); --v3; ++this.creepCount; if (this.difficulty > 1) { var v7 = this.openingStartCol + int(Math.random() * (this.openingEndCol - this.openingStartCol + 1)); v5 = this.cells[0][v7]; v6 = this.cells[this.cellRows - 1][v7]; this.creeps.push(this.creepField.attachMovie('Creep', 'creep' + v3, v3, {'id': this.creepCount, 'startDelay': v4 * lvl.delay, 'startCell': v5, 'endCell': v6, 'bounty': lvl.bounty, 'size': lvl.size, 'health': lvl.health, 'shotHealth': lvl.health, 'speed': lvl.speed, 'immune': lvl.immune, 'flying': lvl.flying, 'color': lvl.color, 'level': lvl.level, 'spawnMax': lvl.spawn, 'spawnLevel': 1, 'LR': false})); --v3; ++this.creepCount; } ++v4; } this.newLevelTick = lvl.count < 3 ? 2 : 5; }; v2.InitMap = function () { this.CreateCellArray(); }; v2.SetMap = function (numAcross, numHigh, posX, posY, gridPixels, openingSR, openingER, openingSC, openingEC) { this.startX = posX; this.endX = this.startX + numAcross * gridPixels; this.startY = posY; this.endY = this.startY + numHigh * gridPixels; this.gridSize = gridPixels; this.cellCols = numAcross; this.cellRows = numHigh; this.openingStartRow = openingSR; this.openingStartCol = openingSC; this.openingEndRow = openingER; this.openingEndCol = openingEC; this.midRow = int(this.cellRows / 2); this.midCol = int(this.cellCols / 2); this.gridField.Init(); }; v2.CreateCellArray = function () { this.cells = new Array(this.cellRows - 1); var v3 = 0; while (v3 < this.cellRows) { this.cells[v3] = new Array(this.cellCols - 1); var v2 = 0; while (v2 < this.cellCols) { var v4 = new Cell(); v4.row = v3; v4.col = v2; v4.top = v3 * this.gridSize + this.startY; v4.left = v2 * this.gridSize + this.startX; if (v3 == 0 || v3 == this.cellRows - 1 || v2 == 0 || v2 == this.cellCols - 1) { v4.cost = 0; v4.barrier = true; } else { v4.cost = 1; } this.cells[v3][v2] = v4; ++v2; } ++v3; } this.endCellsLR = []; this.endCellsUD = []; v3 = this.openingStartRow; while (v3 <= this.openingEndRow) { this.cells[v3][0].cost = 1; this.cells[v3][this.cellCols - 1].cost = 1; this.endCellsLR.push(this.cells[v3][this.cellCols - 1]); ++v3; } if (this.difficulty > 1) { v3 = this.openingStartCol; while (v3 <= this.openingEndCol) { this.cells[0][v3].cost = 1; this.cells[this.cellRows - 1][v3].cost = 1; this.endCellsUD.push(this.cells[this.cellRows - 1][v3]); ++v3; } } this.startCellLR = this.cells[this.midRow][0]; this.endCellLR = this.cells[this.midRow][this.cellCols - 1]; this.startCellUD = this.cells[0][this.midCol]; this.endCellUD = this.cells[this.cellRows - 1][this.midCol]; switch (this.mapMode) { break; case 0: case 1: v3 = 4; while (v3 < this.cellRows - 4) { this.cells[v3][this.midCol].cost = 0; this.cells[v3][this.midCol].barrier = true; this.cells[v3][this.midCol - 1].cost = 0; this.cells[v3][this.midCol - 1].barrier = true; this.cells[v3][this.midCol + 1].cost = 0; this.cells[v3][this.midCol + 1].barrier = true; ++v3; } v3 = 4; while (v3 < this.cellCols - 4) { this.cells[this.midRow][v3].cost = 0; this.cells[this.midRow][v3].barrier = true; this.cells[this.midRow - 1][v3].cost = 0; this.cells[this.midRow - 1][v3].barrier = true; this.cells[this.midRow + 1][v3].cost = 0; this.cells[this.midRow + 1][v3].barrier = true; ++v3; } break; case 2: var v6 = 4; while (v6 < this.cellCols - 5) { var v5 = 4; while (v5 < this.cellCols) { v3 = 0; while (v3 < 5) { v2 = 0; while (v2 < 5) { this.cells[v6 + v3][v5 + v2].barrier = true; this.cells[v6 + v3][v5 + v2].cost = 0; ++v2; } ++v3; } v5 += 16; } v6 += 11; } } this.gridField.DrawGrid(); }; v2.ClearTowers = function () { var v3; var v4 = 0; while (v4 < this.cellRows) { var v2 = 0; while (v2 < this.cellCols) { v3 = this.cells[v4][v2]; if (v3.tower) { removeMovieClip(v3.tower); } v3.rangeTowers = []; ++v2; } ++v4; } }; v2.ClearCreeps = function () { var v2 = 0; while (v2 < this.creepField.getNextHighestDepth()) { removeMovieClip(this.creepField['creep' + v2]); ++v2; } this.creeps = []; }; v2.ClearEffects = function () { var v2 = 0; while (v2 < this.effectsField.getNextHighestDepth()) { removeMovieClip(this.effectsField['bounty' + v2]); removeMovieClip(this.effectsField['fragment' + v2]); ++v2; } }; v2.ClearShots = function () { var v2 = 0; while (v2 < this.shotField.getNextHighestDepth()) { removeMovieClip(this.shotField['shot' + v2]); ++v2; } v2 = 0; while (v2 < this.groundField.getNextHighestDepth()) { removeMovieClip(this.groundField['shot' + v2]); ++v2; } }; v2.Chk = function () { return false; }; ASSetPropFlags(_global.Game.prototype, null, 1); } #endinitclip } movieClip 514 __Packages.PathFinder { #initclip if (!_global.PathFinder) { var v1 = function () {}; _global.PathFinder = v1; var v2 = v1.prototype; v2.FindPath = function (map, startY, startX, endY, endX) { var v15 = 10; var v14 = 14; var v16 = true; var v17 = false; this.mapH = map.length; this.mapW = map[0].length; this.mapStatus = new Array(); var v10 = 0; while (v10 < this.mapH) { this.mapStatus[v10] = new Array(); ++v10; } if (startY == undefined) { return 'ERROR: No starting point'; } if (endY == undefined) { return 'ERROR: No ending point'; } this.openList = new Array(); this.openSquare(startY, startX, undefined, 0); for (;;) { if (!(this.openList.length > 0 && !this.isClosed(endY, endX))) break; v10 = this.nearerSquare(); var v4 = this.openList[v10][0]; var v11 = this.openList[v10][1]; this.closeSquare(v4, v11); var v3 = v4 + 1; while (v3 >= v4 - 1) { var v2 = v11 - 1; while (v2 <= v11 + 1) { if (v3 >= 0 && v3 < this.mapH && v2 >= 0 && v2 < this.mapW && !(v3 == v4 && v2 == v11) && (v16 || v3 == v4 || v2 == v11)) { var v6 = true; if (!v17 && v3 != v4 && v2 != v11) { if (map[v3][v11].cost == 0) { v6 = false; } else { if (map[v4][v2].cost == 0) { v6 = false; } } } if (v6 && map[v3][v2].cost != 0) { if (!this.isClosed(v3, v2)) { var v8; if (this.mapStatus[v4][v11].movementCost == undefined) { v8 = 0; } else { v8 = this.mapStatus[v4][v11].movementCost; } var v5 = v8 + ((v3 == v4 || v2 == v11) ? v15 : v14) * map[v3][v2].cost; if (this.isOpen(v3, v2)) { if (v5 < this.mapStatus[v3][v2].movementCost) { this.openSquare(v3, v2, [v4, v11], v5, undefined, true); } } else { var v9 = (Math.abs(v3 - endY) + Math.abs(v2 - endX)) * 10; this.openSquare(v3, v2, [v4, v11], v5, v9, false); } } } else {} } ++v2; } --v3; } } var v22 = this.isClosed(endY, endX); if (v22) { var v19 = new Array(); v4 = endY; v11 = endX; for (;;) { if (!(v4 != startY || v11 != startX)) break; v19.push([v4, v11, this.mapStatus[v4][v11].movementCost]); var v18 = this.mapStatus[v4][v11].parent[0]; var _loc19 = this.mapStatus[v4][v11].parent[1]; v4 = v18; v11 = _loc19; } v19.push([startY, startX]); return v19; } else { return undefined; } }; v2.isOpen = function (y, x) { return this.mapStatus[y][x].open; }; v2.isClosed = function (y, x) { return this.mapStatus[y][x].closed; }; v2.nearerSquare = function () { var v5 = 9999; var v6 = 0; var v4; var v3; var v2 = this.openList.length; while (v2-- > 0) { v3 = this.mapStatus[this.openList[v2][0]][this.openList[v2][1]]; v4 = v3.heuristic + v3.movementCost; if (v4 <= v5) { v5 = v4; v6 = v2; } } return v6; }; v2.closeSquare = function (y, x) { var v3 = this.openList.length; var v2 = 0; while (v2 < v3) { if (this.openList[v2][0] == y) { if (this.openList[v2][1] == x) { this.openList.splice(v2, 1); break; } } ++v2; } this.mapStatus[y][x].open = false; this.mapStatus[y][x].closed = true; }; v2.openSquare = function (y, x, parent, movementCost, heuristic, replacing) { if (!replacing) { this.openList.push([y, x]); this.mapStatus[y][x] = {'heuristic': heuristic, 'open': true, 'closed': false}; } this.mapStatus[y][x].parent = parent; this.mapStatus[y][x].movementCost = movementCost; }; ASSetPropFlags(_global.PathFinder.prototype, null, 1); } #endinitclip } movieClip 515 __Packages.md5 { #initclip if (!_global.md5) { var v1 = function (b64pad, chrsz) { if (b64pad != undefined) { this.b64pad = b64pad; } if (chrsz != undefined && chrsz == 8 || chrsz == 16) { this.chrsz = chrsz; } }; _global.md5 = v1; var v2 = v1.prototype; v2.hash = function (s) { return this.hex_md5(s); }; v2.hex_md5 = function (s) { return this.binl2hex(this.core_md5(this.str2binl(s), s.length * this.chrsz)); }; v2.b64_md5 = function (s) { return this.binl2b64(this.core_md5(this.str2binl(s), s.length * this.chrsz)); }; v2.str_md5 = function (s) { return this.binl2str(this.core_md5(this.str2binl(s), s.length * this.chrsz)); }; v2.hex_hmac_md5 = function (key, data) { return this.binl2hex(this.core_hmac_md5(key, data)); }; v2.b64_hmac_md5 = function (key, data) { return this.binl2b64(this.core_hmac_md5(key, data)); }; v2.str_hmac_md5 = function (key, data) { return this.binl2str(this.core_hmac_md5(key, data)); }; v2.md5_cmn = function (q, a, b, x, s, t) { return this.safe_add(this.bit_rol(this.safe_add(this.safe_add(a, q), this.safe_add(x, t)), s), b); }; v2.md5_ff = function (a, b, c, d, x, s, t) { return this.md5_cmn(b & c | (b ^ 4294967000.0) & d, a, b, x, s, t); }; v2.md5_gg = function (a, b, c, d, x, s, t) { return this.md5_cmn(b & d | c & (d ^ 4294967000.0), a, b, x, s, t); }; v2.md5_hh = function (a, b, c, d, x, s, t) { return this.md5_cmn(b ^ c ^ d, a, b, x, s, t); }; v2.md5_ii = function (a, b, c, d, x, s, t) { return this.md5_cmn(c ^ (b | d ^ 4294967000.0), a, b, x, s, t); }; v2.core_md5 = function (x, len) { x[len >> 5] |= 128 << len % 32; x[(len + 64 >>> 9 << 4) + 14] = len; var v2 = 1732584193; var v3 = -271733879; var v4 = -1732584194; var v5 = 271733878; var v6 = 0; while (v6 < x.length) { var v8 = v2; var v9 = v3; var v10 = v4; var v11 = v5; v2 = this.md5_ff(v2, v3, v4, v5, x[v6 + 0], 7, -680876936); v5 = this.md5_ff(v5, v2, v3, v4, x[v6 + 1], 12, -389564586); v4 = this.md5_ff(v4, v5, v2, v3, x[v6 + 2], 17, 606105819); v3 = this.md5_ff(v3, v4, v5, v2, x[v6 + 3], 22, -1044525330); v2 = this.md5_ff(v2, v3, v4, v5, x[v6 + 4], 7, -176418897); v5 = this.md5_ff(v5, v2, v3, v4, x[v6 + 5], 12, 1200080426); v4 = this.md5_ff(v4, v5, v2, v3, x[v6 + 6], 17, -1473231341); v3 = this.md5_ff(v3, v4, v5, v2, x[v6 + 7], 22, -45705983); v2 = this.md5_ff(v2, v3, v4, v5, x[v6 + 8], 7, 1770035416); v5 = this.md5_ff(v5, v2, v3, v4, x[v6 + 9], 12, -1958414417); v4 = this.md5_ff(v4, v5, v2, v3, x[v6 + 10], 17, -42063); v3 = this.md5_ff(v3, v4, v5, v2, x[v6 + 11], 22, -1990404162); v2 = this.md5_ff(v2, v3, v4, v5, x[v6 + 12], 7, 1804603682); v5 = this.md5_ff(v5, v2, v3, v4, x[v6 + 13], 12, -40341101); v4 = this.md5_ff(v4, v5, v2, v3, x[v6 + 14], 17, -1502002290); v3 = this.md5_ff(v3, v4, v5, v2, x[v6 + 15], 22, 1236535329); v2 = this.md5_gg(v2, v3, v4, v5, x[v6 + 1], 5, -165796510); v5 = this.md5_gg(v5, v2, v3, v4, x[v6 + 6], 9, -1069501632); v4 = this.md5_gg(v4, v5, v2, v3, x[v6 + 11], 14, 643717713); v3 = this.md5_gg(v3, v4, v5, v2, x[v6 + 0], 20, -373897302); v2 = this.md5_gg(v2, v3, v4, v5, x[v6 + 5], 5, -701558691); v5 = this.md5_gg(v5, v2, v3, v4, x[v6 + 10], 9, 38016083); v4 = this.md5_gg(v4, v5, v2, v3, x[v6 + 15], 14, -660478335); v3 = this.md5_gg(v3, v4, v5, v2, x[v6 + 4], 20, -405537848); v2 = this.md5_gg(v2, v3, v4, v5, x[v6 + 9], 5, 568446438); v5 = this.md5_gg(v5, v2, v3, v4, x[v6 + 14], 9, -1019803690); v4 = this.md5_gg(v4, v5, v2, v3, x[v6 + 3], 14, -187363961); v3 = this.md5_gg(v3, v4, v5, v2, x[v6 + 8], 20, 1163531501); v2 = this.md5_gg(v2, v3, v4, v5, x[v6 + 13], 5, -1444681467); v5 = this.md5_gg(v5, v2, v3, v4, x[v6 + 2], 9, -51403784); v4 = this.md5_gg(v4, v5, v2, v3, x[v6 + 7], 14, 1735328473); v3 = this.md5_gg(v3, v4, v5, v2, x[v6 + 12], 20, -1926607734); v2 = this.md5_hh(v2, v3, v4, v5, x[v6 + 5], 4, -378558); v5 = this.md5_hh(v5, v2, v3, v4, x[v6 + 8], 11, -2022574463); v4 = this.md5_hh(v4, v5, v2, v3, x[v6 + 11], 16, 1839030562); v3 = this.md5_hh(v3, v4, v5, v2, x[v6 + 14], 23, -35309556); v2 = this.md5_hh(v2, v3, v4, v5, x[v6 + 1], 4, -1530992060); v5 = this.md5_hh(v5, v2, v3, v4, x[v6 + 4], 11, 1272893353); v4 = this.md5_hh(v4, v5, v2, v3, x[v6 + 7], 16, -155497632); v3 = this.md5_hh(v3, v4, v5, v2, x[v6 + 10], 23, -1094730640); v2 = this.md5_hh(v2, v3, v4, v5, x[v6 + 13], 4, 681279174); v5 = this.md5_hh(v5, v2, v3, v4, x[v6 + 0], 11, -358537222); v4 = this.md5_hh(v4, v5, v2, v3, x[v6 + 3], 16, -722521979); v3 = this.md5_hh(v3, v4, v5, v2, x[v6 + 6], 23, 76029189); v2 = this.md5_hh(v2, v3, v4, v5, x[v6 + 9], 4, -640364487); v5 = this.md5_hh(v5, v2, v3, v4, x[v6 + 12], 11, -421815835); v4 = this.md5_hh(v4, v5, v2, v3, x[v6 + 15], 16, 530742520); v3 = this.md5_hh(v3, v4, v5, v2, x[v6 + 2], 23, -995338651); v2 = this.md5_ii(v2, v3, v4, v5, x[v6 + 0], 6, -198630844); v5 = this.md5_ii(v5, v2, v3, v4, x[v6 + 7], 10, 1126891415); v4 = this.md5_ii(v4, v5, v2, v3, x[v6 + 14], 15, -1416354905); v3 = this.md5_ii(v3, v4, v5, v2, x[v6 + 5], 21, -57434055); v2 = this.md5_ii(v2, v3, v4, v5, x[v6 + 12], 6, 1700485571); v5 = this.md5_ii(v5, v2, v3, v4, x[v6 + 3], 10, -1894986606); v4 = this.md5_ii(v4, v5, v2, v3, x[v6 + 10], 15, -1051523); v3 = this.md5_ii(v3, v4, v5, v2, x[v6 + 1], 21, -2054922799); v2 = this.md5_ii(v2, v3, v4, v5, x[v6 + 8], 6, 1873313359); v5 = this.md5_ii(v5, v2, v3, v4, x[v6 + 15], 10, -30611744); v4 = this.md5_ii(v4, v5, v2, v3, x[v6 + 6], 15, -1560198380); v3 = this.md5_ii(v3, v4, v5, v2, x[v6 + 13], 21, 1309151649); v2 = this.md5_ii(v2, v3, v4, v5, x[v6 + 4], 6, -145523070); v5 = this.md5_ii(v5, v2, v3, v4, x[v6 + 11], 10, -1120210379); v4 = this.md5_ii(v4, v5, v2, v3, x[v6 + 2], 15, 718787259); v3 = this.md5_ii(v3, v4, v5, v2, x[v6 + 9], 21, -343485551); v2 = this.safe_add(v2, v8); v3 = this.safe_add(v3, v9); v4 = this.safe_add(v4, v10); v5 = this.safe_add(v5, v11); v6 += 16; } return Array(v2, v3, v4, v5); }; v2.core_hmac_md5 = function (key, data) { var v3 = new Array(this.str2binl(key)); if (v3.length > 16) { v3 = this.core_md5(v3, key.length * this.chrsz); } var v5 = new Array(16); var v4 = new Array(16); var v2 = 0; while (v2 < 16) { v5[v2] = v3[v2] ^ 909522486; v4[v2] = v3[v2] ^ 1549556828; ++v2; } var v6 = new Array(this.core_md5(v5.concat(this.str2binl(data)), 512 + data.length * this.chrsz)); return this.core_md5(v4.concat(v6), 640); }; v2.safe_add = function (x, y) { var v1 = new Number((x & 65535) + (y & 65535)); var v2 = new Number((x >> 16) + (y >> 16) + (v1 >> 16)); return v2 << 16 | v1 & 65535; }; v2.bit_rol = function (num, cnt) { return num << cnt | num >>> 32 - cnt; }; v2.str2binl = function (str) { var v3 = new Array(); var v5 = (1 << this.chrsz) - 1; var v2 = 0; while (v2 < str.length * this.chrsz) { v3[v2 >> 5] |= (str.charCodeAt(v2 / this.chrsz) & v5) << v2 % 32; v2 += this.chrsz; } return v3; }; v2.binl2str = function (bin) { var v3 = new String(''); var v5 = (1 << this.chrsz) - 1; var v2 = 0; while (v2 < bin.length * 32) { v3 += String.fromCharCode(bin[v2 >> 5] >>> v2 % 32 & v5); v2 += this.chrsz; } return v3; }; v2.binl2hex = function (binarray) { var v4 = '0123456789abcdef'; var v3 = new String(''); var v1 = 0; while (v1 < binarray.length * 4) { v3 += v4.charAt(binarray[v1 >> 2] >> (v1 % 4) * 8 + 4 & 15) + v4.charAt(binarray[v1 >> 2] >> (v1 % 4) * 8 & 15); ++v1; } return v3; }; v2.binl2b64 = function (binarray) { var v7 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; var v4 = new String(''); var v2 = 0; while (v2 < binarray.length * 4) { var v6 = (binarray[v2 >> 2] >> 8 * (v2 % 4) & 255) << 16 | (binarray[v2 + 1 >> 2] >> 8 * ((v2 + 1) % 4) & 255) << 8 | binarray[v2 + 2 >> 2] >> 8 * ((v2 + 2) % 4) & 255; var v3 = 0; while (v3 < 4) { if (v2 * 8 + v3 * 6 > binarray.length * 32) { v4 += this.b64pad; } else { v4 += v7.charAt(v6 >> 6 * (3 - v3) & 63); } ++v3; } v2 += 3; } return v4; }; v2.b64pad = new String(''); v2.chrsz = new Number(8); ASSetPropFlags(_global.md5.prototype, null, 1); } #endinitclip } movieClip 516 __Packages.Cell { #initclip if (!_global.Cell) { var v1 = function () { this.ClearPath(true); this.ClearPath(false); this.creepCount = 0; this.rangeTowers = []; }; _global.Cell = v1; var v2 = v1.prototype; v2.AddRangeTower = function (t, partial) { this.rangeTowers.push({'id': t.id, 'tower': t, 'partial': partial}); }; v2.RemoveRangeTower = function (t) { var v2 = 0; while (v2 < this.rangeTowers.length) { if (this.rangeTowers[v2].id == t.id) { this.rangeTowers.splice(v2, 1); break; } ++v2; } }; v2.ClearPath = function (LR) { if (LR) { this.parentCellsLR = []; this.nextCellLR = undefined; } else { this.parentCellsUD = []; this.nextCellUD = undefined; } this.pathID = 0; }; ASSetPropFlags(_global.Cell.prototype, null, 1); } #endinitclip } frame 2 { } frame 3 { stop(); var scor; var game = new Game(); } movieClip 305 { } movieClip 308 { } movieClip 309 { frame 20 { stop(); } } movieClip 313 { } movieClip 314 { } movieClip 315 { } movieClip 317 { } movieClip 318 { } button 319 { on (rollOver) { gotoAndPlay(2); } on (rollOut) { gotoAndPlay(6); } on (press) { _root.zik.Sound.stop; _root.transition.zone = 'game'; _root.transition.gotoAndPlay(2); } } movieClip 320 { frame 1 { stop(); } frame 5 { stop(); } } button 321 { on (rollOver) { gotoAndPlay(2); } on (rollOut) { gotoAndPlay(6); } on (press) { stopAllSounds(); _root.transition.zone = 'help'; _root.transition.gotoAndPlay(2); } } movieClip 322 { frame 1 { stop(); } frame 5 { stop(); } } button 323 { on (rollOver) { gotoAndPlay(2); } on (rollOut) { gotoAndPlay(6); } on (release) { stopAllSounds(); getURL('http://www.maddwarf.com', '_blank'); } } movieClip 324 { frame 1 { stop(); } frame 5 { stop(); } } movieClip 327 { frame 1 { stop(); } frame 2 { removeMovieClip(_root.Interface); removeMovieClip(_root.startPanel); } frame 3 { _root.gotoAndStop(zone); } } instance transition of movieClip 327 { onClipEvent (load) { swapDepths(4999); zone = 'menu'; } } frame 4 { stop(); var game = new Game(); } // unknown tag 88 length 63 movieClip 330 { frame 1 { _root.Interface.difficulty.difficulty; } } movieClip 331 { } movieClip 332 { } movieClip 333 { } movieClip 338 { frame 1 { stop(); } frame 5 { stop(); } } movieClip 340 { } movieClip 342 { } movieClip 345 { } button 349 { on (release) { getURL('http://www.maddwarf.com', '_blank'); } } button 352 { on (release) { getURL('http://www.maddwarf.com', '_blank'); } } button 355 { on (release) { getURL('http://www.free-online-games-directory.com', '_blank'); } } movieClip 356 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } } movieClip 357 { instance of movieClip 345 { onClipEvent (load) { this.cacheAsBitmap = true; } } instance bouton of movieClip 356 { onClipEvent (load) { gotoAndStop(random(3) + 1); } } } movieClip 361 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 362 { } movieClip 363 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 364 { } movieClip 365 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 366 { } movieClip 367 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 368 { } movieClip 369 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 370 { } movieClip 371 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 372 { } movieClip 375 { } movieClip 376 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 377 { } movieClip 379 { frame 1 { function Show() { fade = 0; this.cacheAsBitmap = true; this._visible = true; this._alpha = fade; this.onEnterFrame = function () { fade += 20; this._alpha = fade; if (fade >= 80) { this.cacheAsBitmap = false; this._alpha = 80; clearInterval(intervalID); intervalId = setInterval(this, 'executeCallback', 1000); this.onEnterFrame = ''; } }; } function Hide() { fade = 80; this.cacheAsBitmap = true; this.onEnterFrame = function () { fade -= 10; this._alpha = fade; if (fade <= 0) { this.cacheAsBitmap = false; this._visible = false; this._alpha = 0; this.onEnterFrame = ''; } }; } function executeCallback() { clearInterval(intervalId); Hide(); } var intervalId = 0; var fade; } } movieClip 380 { instance btnPellet of movieClip 362 { onClipEvent (enterFrame) { if (_root.game.gold < 5) { fx.gotoAndStop(2); } else { fx.gotoAndStop(1); } } onClipEvent (press) { if (_root.game.gameState == -1) { return undefined; } if (_root.game.gameState < 2) { _root.game.AddTower(1, true); } } onClipEvent (release, releaseOutside, rollOut) { _root.game.infoPanel.CancelInfo(); this.filters = []; } } instance btnSquirt of movieClip 364 { onClipEvent (enterFrame) { if (_root.game.gold < 25) { fx.gotoAndStop(2); } else { fx.gotoAndStop(1); } } onClipEvent (press) { if (_root.game.gameState == -1) { return undefined; } if (_root.game.gameState < 2) { _root.game.AddTower(3, true); } } onClipEvent (rollOut) { _root.game.infoPanel.CancelInfo(); this.filters = []; } } instance btnDart of movieClip 366 { onClipEvent (enterFrame) { if (_root.game.gold < 20) { fx.gotoAndStop(2); } else { fx.gotoAndStop(1); } } onClipEvent (press) { if (_root.game.gameState == -1) { return undefined; } if (_root.game.gameState < 2) { _root.game.AddTower(2, true); } } onClipEvent (rollOut) { _root.game.infoPanel.CancelInfo(); this.filters = []; } } instance btnNextLevel of movieClip 338 { onClipEvent (enterFrame) { if (_root.game.creeps.length == 0) { this._visible = true; } else { this._visible = false; } } onClipEvent (press) { _root.game.SendNextLevel(); } onClipEvent (rollOver) { gotoAndPlay(2); } onClipEvent (rollOut) { gotoAndPlay(6); } } instance btnSwarm of movieClip 368 { onClipEvent (enterFrame) { if (_root.game.gold < 50) { fx.gotoAndStop(2); } else { fx.gotoAndStop(1); } } onClipEvent (press) { if (_root.game.gameState == -1) { return undefined; } if (_root.game.gameState < 2) { _root.game.AddTower(4, true); } } onClipEvent (rollOut) { _root.game.infoPanel.CancelInfo(); this.filters = []; } } instance btnFrost of movieClip 370 { onClipEvent (enterFrame) { if (_root.game.gold < 50) { fx.gotoAndStop(2); } else { fx.gotoAndStop(1); } } onClipEvent (press) { if (_root.game.gameState == -1) { return undefined; } if (_root.game.gameState < 2) { _root.game.AddTower(5, true); } } onClipEvent (rollOut) { _root.game.infoPanel.CancelInfo(); this.filters = []; } } instance btnBash of movieClip 372 { onClipEvent (enterFrame) { if (_root.game.gold < 30) { fx.gotoAndStop(2); } else { fx.gotoAndStop(1); } } onClipEvent (press) { if (_root.game.gameState == -1) { return undefined; } if (_root.game.gameState < 2) { _root.game.AddTower(6, true); } } onClipEvent (rollOut) { _root.game.infoPanel.CancelInfo(); this.filters = []; } } instance btnWall of movieClip 377 { onClipEvent (enterFrame) { if (_root.game.gold < 2) { fx.gotoAndStop(2); } else { fx.gotoAndStop(1); } } onClipEvent (press) { if (_root.game.gameState == -1) { return undefined; } if (_root.game.gameState < 2) { _root.game.AddTower(7, true); } } onClipEvent (rollOut) { _root.game.infoPanel.CancelInfo(); this.filters = []; } } instance btnMine of movieClip 372 { onClipEvent (enterFrame) { if (_root.game.gold < 1) { fx.gotoAndStop(2); } else { fx.gotoAndStop(1); } } onClipEvent (press) { if (_root.game.gameState == -1) { return undefined; } if (_root.game.gameState < 2) { _root.game.AddTower(8, true); } } onClipEvent (rollOut) { _root.game.infoPanel.CancelInfo(); this.filters = []; } } instance of movieClip 30 { onClipEvent (load) { msg.text = 'MUTE'; } onClipEvent (press) { if (msg.text == 'MUTE') { stopAllSounds(); _root.zik.gotoAndStop(3); _root.game.muted = true; msg.text = 'UNMUTE'; } else { _root.zik.gotoAndStop(1); _root.game.muted = false; msg.text = 'MUTE'; } } onClipEvent (rollOver) { gotoAndPlay(2); } onClipEvent (rollOut) { gotoAndPlay(6); } } } movieClip 384 { } movieClip 387 { instance btnCancel of movieClip 30 { onClipEvent (load) { msg.text = 'CLOSE'; } onClipEvent (press) { _root.scoreBoard._visible = false; _root.game.PlayButtonSound(); } } } button 397 { on (rollOver) { gotoAndPlay(2); } on (rollOut) { gotoAndPlay(6); } on (press) { if (_root.startPanel.fade > 0) { return undefined; } with (_root.game) { _root.game.SetMap(29, 24, 0, 64, 16, 8, 15, 10, 18); _root.game.lvlmax = 100; _root.back.gotoAndStop('final'); _root.game.mission = 6; difficulty = 4; infChal = true; Init(); _root.startPanel.Fade(); PlayButtonSound(); } } } movieClip 399 { frame 1 { stop(); } frame 5 { stop(); } } button 403 { on (rollOver) { gotoAndPlay(2); } on (rollOut) { gotoAndPlay(6); } on (press) { if (_root.startPanel.fade > 0) { return undefined; } with (_root.game) { _root.game.SetMap(29, 24, 0, 64, 16, 8, 15, 10, 18); _root.game.lvlmax = 50; _root.back.gotoAndStop('mission5'); _root.game.mission = 5; _root.game.difficulty = 2; _root.game.Init(); _root.startPanel.Fade(); _root.game.PlayButtonSound(); } } } movieClip 404 { frame 1 { stop(); } frame 5 { stop(); } } movieClip 407 { } button 410 { on (rollOver) { gotoAndPlay(2); } on (rollOut) { gotoAndPlay(6); } on (press) { if (_root.startPanel.fade > 0) { return undefined; } _root.game.SetMap(29, 14, 0, 144, 16, 3, 10, 10, 17); _root.game.lvlmax = 20; _root.game.mission = 1; _root.back.gotoAndStop('easy'); _root.game.difficulty = 1; _root.game.Init(); _root.startPanel.Fade(); _root.game.PlayButtonSound(); } } movieClip 411 { frame 1 { stop(); } frame 5 { stop(); } } button 414 { on (rollOver) { gotoAndPlay(2); } on (rollOut) { gotoAndPlay(6); } on (press) { if (_root.startPanel.fade > 0) { return undefined; } _root.game.SetMap(29, 24, 0, 64, 16, 8, 15, 10, 18); _root.game.lvlmax = 20; _root.game.mission = 2; _root.back.gotoAndStop('normal'); _root.game.difficulty = 2; _root.game.Init(); _root.startPanel.Fade(); _root.game.PlayButtonSound(); } } movieClip 415 { frame 1 { stop(); } frame 5 { stop(); } } button 418 { on (rollOver) { gotoAndPlay(2); } on (rollOut) { gotoAndPlay(6); } on (press) { if (_root.startPanel.fade > 0) { return undefined; } with (_root.game) { _root.game.SetMap(29, 24, 0, 64, 16, 8, 15, 10, 18); _root.game.lvlmax = 30; _root.back.gotoAndStop('cross'); _root.game.mission = 3; _root.game.difficulty = 2; mapMode = 1; Init(); _root.startPanel.Fade(); PlayButtonSound(); } } } movieClip 419 { frame 1 { stop(); } frame 5 { stop(); } } button 422 { on (rollOver) { gotoAndPlay(2); } on (rollOut) { gotoAndPlay(6); } on (press) { if (_root.startPanel.fade > 0) { return undefined; } with (_root.game) { _root.game.SetMap(29, 24, 0, 64, 16, 8, 15, 10, 18); _root.game.lvlmax = 40; _root.back.gotoAndStop('check'); _root.game.mission = 4; _root.game.difficulty = 5; mapMode = 2; Init(); _root.startPanel.Fade(); PlayButtonSound(); } } } movieClip 423 { frame 1 { stop(); } frame 5 { stop(); } } movieClip 424 { } movieClip 427 { frame 1 { stop(); } frame 5 { stop(); } } movieClip 431 { } movieClip 433 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 435 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 437 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 439 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 441 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 442 { frame 1 { function Show() { _visible = true; challengeSelect._visible = false; funSelect._visible = false; levelSelect._visible = true; } function Fade() { _root.game.transitSound(); fade = 100; this.cacheAsBitmap = true; this.onEnterFrame = function () { fade -= 10; this._alpha = fade; if (fade <= 0) { this.cacheAsBitmap = false; this._visible = false; this._alpha = 100; this.onEnterFrame = ''; } }; } function Fadein() { _root.game.transitSound(); this._alpha = 0; _visible = true; challengeSelect._visible = false; funSelect._visible = false; levelSelect._visible = true; fad = 0; this.cacheAsBitmap = true; this.onEnterFrame = function () { fad += 10; this._alpha = fad; if (fad >= 99) { this._alpha = 100; } }; } var fade; challengeSelect._visible = false; funSelect._visible = false; } instance of movieClip 427 { onClipEvent (load) { msg.text = '<< BACK TO MAIN'; } onClipEvent (press) { _root.transition.zone = 'menu'; _root.transition.gotoAndPlay(2); _root.game.PlayButtonSound(); stopAllSounds(); } onClipEvent (rollOver) { gotoAndPlay(2); } onClipEvent (rollOut) { gotoAndPlay(6); } } instance mission1 of movieClip 433 { onClipEvent (load) { if (_root.biscuit.data.mission1 != true) { _visible = true; } else { _visible = false; } } } instance mission2 of movieClip 435 { onClipEvent (load) { if (_root.biscuit.data.mission2 != true) { _visible = true; } else { _visible = false; } } } instance mission3 of movieClip 437 { onClipEvent (load) { if (_root.biscuit.data.mission3 != true) { _visible = true; } else { _visible = false; } } } instance mission4 of movieClip 439 { onClipEvent (load) { if (_root.biscuit.data.mission4 != true) { _visible = true; } else { _visible = false; } } } instance mission5 of movieClip 441 { onClipEvent (load) { if (_root.biscuit.data.mission5 != true) { _visible = true; } else { _visible = false; } } } } movieClip 463 { frame 1 { stop(); } } frame 6 { function onEnterFrame() { game.FrameTick(); game.CommTick(); } var game = new Game(); game.ShowStart(); score.text = _root.game.score; zik.gotoAndStop(2); stop(); } movieClip 473 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } } instance back of movieClip 473 { onClipEvent (load) { this.cacheAsBitmap = true; } } instance Interface of movieClip 380 { onClipEvent (load) { swapDepths(4997); } } movieClip 475 { } instance of movieClip 475 { onClipEvent (load) { fr = 32; time = 1000; time_count = 0; old_timer = getTimer(); fps = fr + '/' + fr; } onClipEvent (enterFrame) { time_count += 1; if (getTimer() - old_timer >= time) { fps = Math.floor(time_count * 1000 / (getTimer() - old_timer)) + '/' + fr; old_timer = getTimer(); time_count = 0; } } } instance startPanel of movieClip 442 { onClipEvent (load) { swapDepths(4998); } } button 476 { on (press) { _root.game.ShowStart(); _root.game.PlayButtonSound(); this._visible = false; } } button 477 { on (press) { this._visible = false; _root.game.Resume2(); } } movieClip 479 { } movieClip 480 { } instance resetpanel of movieClip 480 { onClipEvent (load) { swapDepths(10000000000.0); } } movieClip 483 { frame 1 { stop(); } } instance zik1 of movieClip 483 { onClipEvent (load) { son = new Sound(); son.attachSound('zik1'); if (_root.game.muted == false) { son.start(0, 999); } } } movieClip 486 { frame 1 { stop(); } } instance zik2 of movieClip 486 { onClipEvent (load) { son = new Sound(); son.attachSound('zik2'); } } frame 7 { stop(); var game = new Game(); removeMovieClip(Interface); } movieClip 493 { } movieClip 495 { frame 1 { scor = _root.scor; } } button 498 { on (press) { _root.transition.zone = 'menu'; _root.transition.gotoAndPlay(2); } } movieClip 499 { frame 90 { scor.score = _root.scor; } frame 105 { stop(); } } movieClip 500 { frame 31 { stop(); } } frame 8 { stop(); } instance of movieClip 427 { onClipEvent (load) { msg.text = '<< BACK TO MAIN'; } onClipEvent (press) { _root.transition.zone = 'menu'; _root.transition.gotoAndPlay(2); _root.game.PlayButtonSound(); stopAllSounds(); } onClipEvent (rollOver) { gotoAndPlay(3); } onClipEvent (rollOut) { gotoAndPlay(7); } }




http://swfchan.com/42/207936/info.shtml
Created: 23/7 -2019 02:55:30 Last modified: 23/7 -2019 02:55:30 Server time: 24/04 -2024 22:04:18