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

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

Desolate Defense - prevent enemies from entering the base.swf

This is the info page for
Flash #91536

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


ActionScript [AS1/AS2]
Combined Code
frame 1 { function AddFrames(ftitle, frame) { framesArray.push([ftitle, frame]); } function rightClickLink1() { function __com_mochibot__(swfid, mc, lv, trk) { var x; var g; var s; var fv; var sb; var u; var res; var mb; var mbc; var pv; mb = '__mochibot__'; mbc = 'mochibot.com'; g = _global ? _global : _level0._root; if (g[mb + swfid]) { return g[mb + swfid]; } s = System.security; x = mc._root.getSWFVersion; fv = x ? mc.getSWFVersion() : (_global ? 6 : 5); if (!s) { s = {}; } sb = s.sandboxType; if (sb == 'localWithFile') { return null; } x = s.allowDomain; if (x) { s.allowDomain(mbc); } x = s.allowInsecureDomain; if (x) { s.allowInsecureDomain(mbc); } pv = (fv == 5) ? /:$version : System.capabilities.version; u = 'http://' + mbc + '/my/core.swf?mv=8&fv=' + fv + '&v=' + escape(pv) + '&swfid=' + escape(swfid) + '&l=' + lv + '&f=' + mc + (sb ? '&sb=' + sb : '') + (trk ? '&t=1' : ''); lv = fv > 6 ? mc.getNextHighestDepth() : (g[mb + 'level'] ? g[mb + 'level'] + 1 : lv); g[mb + 'level'] = lv; if (fv == 5) { res = '_level' + lv; if (!eval(res)) { loadMovieNum(u, lv); } return res; } res = mc.createEmptyMovieClip(mb + swfid, lv); res.loadMovie(u); return res; } __com_mochibot__('0a17bd79', this, 10301, true); getURL('http://playtowerdefencegames.com', '_blank'); } function rightClickLink2() { getURL('http://www.flak-games.com/', '_blank'); } function rightClickLink3() { getURL('http://www.chad-duncan.com/', '_blank'); } function playMusic(ID) { _root.music = new Sound(_root.music_mc); _root.music.attachSound(_root.SoundArray[ID][0]); _root.music.start(0, 10000); _root.songID = ID; _root.musicIsPlaying = true; } function stopMusic() { _root.musicIsPlaying = false; _root.musicOffset = 0; _root.music.stop(); } function pauseMusic(ID) { _root.musicIsPlaying = false; _root.musicOffset = _root.music.position; _root.music.stop(); } function unPauseMusic(ID) { _root.musicIsPlaying = true; _root.music = new Sound(_root.music_mc); _root.music.attachSound(_root.SoundArray[ID][0]); _root.music.start(_root.musicOffset / 1000, 10000); _root.musicOffset = 0; _root.songID = ID; } function playSFX(ID) { ++_root.numberofPlayedFX; _root['FX' + _root.numberofPlayedFX] = new Sound(_root.FX_mc); _root['FX' + _root.numberofPlayedFX].attachSound(_root.SoundFXArray[ID]); _root['FX' + _root.numberofPlayedFX].start(); _root['FX' + _root.numberofPlayedFX].setVolume(100); } stop(); framesArray = [['Loader', 1]]; AddFrames('Intro 1', 2); AddFrames('Intro 2', 3); AddFrames('The Music', 7); AddFrames('Main Menu', 10); AddFrames('BG 1', 11); AddFrames('BG 2', 12); AddFrames('BG 3', 13); AddFrames('Game Mechanics', 142); LoaderBar.onEnterFrame = function () { _root.bytesLoaded = _root.getBytesLoaded(); _root.bytesTotal = _root.getBytesTotal(); _root.percentLoaded2 = Math.round(100 * (_root.bytesLoaded / _root.bytesTotal)); _root.percentLoaded = Math.round(100 * (_root.bytesLoaded / _root.bytesTotal)); _root.percentLoadedText = _root.percentLoaded + '% Loaded'; i = 0; while (i < framesArray.length) { if (_root._framesloaded < framesArray[i][1]) { whatsLoading = framesArray[i][0]; break; } ++i; } if (_root.percentLoaded2 >= 100 && _root._currentframe == 1) { _root.play(); } LoadingText = 'Loading... ' + whatsLoading; this.gotoAndStop(percentLoaded2); }; MENU = new ContextMenu(); MENU.hideBuiltInItems(); Functioned = new ContextMenuItem('Play Tower Defence Games', rightClickLink1); Functioned2 = new ContextMenuItem('Flak-Games', rightClickLink2); Functioned3 = new ContextMenuItem('Chad Duncan', rightClickLink3); MENU.customItems.push(Functioned, Functioned2, Functioned3); _root.menu = MENU; _root.SoundArray = [[''], ['Radiance', 'Lashmush'], ['Dark Dreams', 'Waterflame'], ['Chaoz Fantasy', 'ParagonX9']]; _root.SoundFXArray = ['0', 'Bleep', 'machine gun 4', 'plasma', 'sniper', 'sniper2', 'tesla', 'explosion']; _root.numberofPlayedFX = 1; _root.thesetFXVolume = 100; } movieClip 10 { } movieClip 63 { } button 66 { on (release) { function __com_mochibot__(swfid, mc, lv, trk) { var x; var g; var s; var fv; var sb; var u; var res; var mb; var mbc; var pv; mb = '__mochibot__'; mbc = 'mochibot.com'; g = _global ? _global : _level0._root; if (g[mb + swfid]) { return g[mb + swfid]; } s = System.security; x = mc._root.getSWFVersion; fv = x ? mc.getSWFVersion() : (_global ? 6 : 5); if (!s) { s = {}; } sb = s.sandboxType; if (sb == 'localWithFile') { return null; } x = s.allowDomain; if (x) { s.allowDomain(mbc); } x = s.allowInsecureDomain; if (x) { s.allowInsecureDomain(mbc); } pv = (fv == 5) ? /:$version : System.capabilities.version; u = 'http://' + mbc + '/my/core.swf?mv=8&fv=' + fv + '&v=' + escape(pv) + '&swfid=' + escape(swfid) + '&l=' + lv + '&f=' + mc + (sb ? '&sb=' + sb : '') + (trk ? '&t=1' : ''); lv = fv > 6 ? mc.getNextHighestDepth() : (g[mb + 'level'] ? g[mb + 'level'] + 1 : lv); g[mb + 'level'] = lv; if (fv == 5) { res = '_level' + lv; if (!eval(res)) { loadMovieNum(u, lv); } return res; } res = mc.createEmptyMovieClip(mb + swfid, lv); res.loadMovie(u); return res; } getURL('http://playtowerdefensegames.com', '_blank'); __com_mochibot__('0a17bd79', this, 10301, true); } } // unknown tag 88 length 199 // unknown tag 88 length 199 movieClip 76 { frame 1 { stop(); } frame 3 { stop(); } frame 4 { stop(); } } instance cursor_mc of movieClip 76 { onClipEvent (load) { this.swapDepths(this.getNextHighestDepth() + 31302); frame = _root._currentframe; } onClipEvent (enterFrame) { if (_root._currentframe > frame || _root._currentframe < frame) { this.removeMovieClip(this); } } onClipEvent (enterFrame) { if (_root.cursor_mc._x > 0 && _root.cursor_mc._x < 650 && _root.cursor_mc._y > 0 && _root.cursor_mc._y < 500) { Mouse.hide(); } this._x = this._parent._xmouse; this._y = this._parent._ymouse; } } button 82 { on (release) { _root.rightClickLink2(); } } frame 2 { function __com_mochibot__(swfid, mc, lv, trk) { var x; var g; var s; var fv; var sb; var u; var res; var mb; var mbc; var pv; mb = '__mochibot__'; mbc = 'mochibot.com'; g = _global ? _global : _level0._root; if (g[mb + swfid]) { return g[mb + swfid]; } s = System.security; x = mc._root.getSWFVersion; fv = x ? mc.getSWFVersion() : (_global ? 6 : 5); if (!s) { s = {}; } sb = s.sandboxType; if (sb == 'localWithFile') { return null; } x = s.allowDomain; if (x) { s.allowDomain(mbc); } x = s.allowInsecureDomain; if (x) { s.allowInsecureDomain(mbc); } pv = (fv == 5) ? /:$version : System.capabilities.version; u = 'http://' + mbc + '/my/core.swf?mv=8&fv=' + fv + '&v=' + escape(pv) + '&swfid=' + escape(swfid) + '&l=' + lv + '&f=' + mc + (sb ? '&sb=' + sb : '') + (trk ? '&t=1' : ''); lv = fv > 6 ? mc.getNextHighestDepth() : (g[mb + 'level'] ? g[mb + 'level'] + 1 : lv); g[mb + 'level'] = lv; if (fv == 5) { res = '_level' + lv; if (!eval(res)) { loadMovieNum(u, lv); } return res; } res = mc.createEmptyMovieClip(mb + swfid, lv); res.loadMovie(u); return res; } stop(); __com_mochibot__('6430faa4', this, 10301, true); } movieClip 86 { } movieClip 88 { } movieClip 90 { frame 129 { _root.play(); } } instance of movieClip 90 { onClipEvent (release) { getURL('http://playtowerdefencegames.com', '_blank'); } } frame 3 { Mouse.show(); } frame 3 { stop(); } movieClip 95 { } movieClip 96 { } movieClip 97 { } movieClip 100 { } movieClip 103 { } button 105 { on (release) { getURL('http://www.flak-games.com', '_blank'); } } movieClip 112 { frame 158 { _root.play(); } } // unknown tag 88 length 68 button 116 { on (release) { gotoAndStop(9); } } movieClip 118 { } instance music_mc of movieClip 118 { onClipEvent (load) { this.swapDepths(this.getNextHighestDepth() + 1.0e+016); } } instance FX_mc of movieClip 118 { onClipEvent (load) { this.swapDepths(this.getNextHighestDepth() + 1.0e+016); } } movieClip 121 { frame 1 { stop(); } } movieClip 123 { frame 1 { stop(); } } movieClip 125 { frame 1 { stop(); } } frame 9 { playMusic(1); nextFrame(); } frame 10 { stop(); cursor_mc.removeMovieClip(cursor_mc); _root.tmessages = undefined; var game = SharedObject.getLocal('Desolate-Defense_Data'); if (game.data.saved === true) { var dataLoaded = 'Saved Data Found\r'; } else { var dataLoaded = 'No Previous Data Found\r'; } if (game.data.campaignWave == undefined) { dataLoaded += 'Campaign: Wave 1'; } else { dataLoaded += 'Campaign: Wave ' + game.data.campaignWave; } if (game.data.survivalWave == undefined) { dataLoaded += ' - Survival: Wave 1'; } else { dataLoaded += ' - Survival: Wave ' + game.data.survivalWave; } if (game.data.numberofMedals == undefined) { dataLoaded += ' - Achievements: 0 Acquired'; } else { dataLoaded += ' - Achievements: ' + game.data.numberofMedals + ' Acquired'; } _root.directControl = false; _root.directControlled = undefined; cursor_mc2.onMouseMove = function () { if (_root.cursor_mc2._x > 0 && _root.cursor_mc2._x < 650 && _root.cursor_mc2._y > 0 && _root.cursor_mc2._y < 500) { Mouse.hide(); } this._x = this._parent._xmouse; this._y = this._parent._ymouse; updateAfterEvent(); }; if (game.data.file[1] == undefined) { btnstxt.gotoAndStop(3); } if (!FileLoaded) { btnstxt.gotoAndStop(2); } if (!FileLoaded && game.data.file[1] == undefined) { btnstxt.gotoAndStop(4); } songNowPlaying = _root.SoundArray[_root.songID][0] + ' by: ' + _root.SoundArray[_root.songID][1]; } movieClip 128 { } movieClip 130 { } button 139 { on (release) { game = SharedObject.getLocal('Desolate-Defense_Data'); if (game.data.campaignWave == undefined) { _root.continueBox.gotoAndStop(2); } else { _root.continueBox.gotoAndStop(3); } playSFX(1); modeChosen = 'Campaign'; } } button 140 { on (release) { game = SharedObject.getLocal('Desolate-Defense_Data'); if (game.data.survivalWave == undefined) { _root.continueBox.gotoAndStop(2); } else { _root.continueBox.gotoAndStop(3); } _root.playSFX(1); modeChosen = 'Survival'; } } button 141 { on (release) { instructions.gotoAndStop(2); _root.playSFX(1); } } button 142 { on (release) { _root.continueBox.gotoAndStop(4); _root.playSFX(1); } } button 143 { on (release) { _root.continueBox.gotoAndStop(6); _root.playSFX(1); } } button 144 { on (release) { _root.continueBox.gotoAndStop(2); playSFX(1); modeChosen = 'Leaderboard'; } } button 145 { on (release) { _root.playSFX(1); credits.gotoAndStop(2); } } button 146 { on (release) { _root.playSFX(1); getURL('http://www.playtowerdefensegames.com/download-games.html', '_blank'); } } button 147 { on (release) { _root.playSFX(1); getURL('http://www.playtowerdefensegames.com/blog/2009/06/15/desolate-defense-walkthrough/', '_blank'); } } button 148 { on (release) { function __com_mochibot__(swfid, mc, lv, trk) { var x; var g; var s; var fv; var sb; var u; var res; var mb; var mbc; var pv; mb = '__mochibot__'; mbc = 'mochibot.com'; g = _global ? _global : _level0._root; if (g[mb + swfid]) { return g[mb + swfid]; } s = System.security; x = mc._root.getSWFVersion; fv = x ? mc.getSWFVersion() : (_global ? 6 : 5); if (!s) { s = {}; } sb = s.sandboxType; if (sb == 'localWithFile') { return null; } x = s.allowDomain; if (x) { s.allowDomain(mbc); } x = s.allowInsecureDomain; if (x) { s.allowInsecureDomain(mbc); } pv = (fv == 5) ? /:$version : System.capabilities.version; u = 'http://' + mbc + '/my/core.swf?mv=8&fv=' + fv + '&v=' + escape(pv) + '&swfid=' + escape(swfid) + '&l=' + lv + '&f=' + mc + (sb ? '&sb=' + sb : '') + (trk ? '&t=1' : ''); lv = fv > 6 ? mc.getNextHighestDepth() : (g[mb + 'level'] ? g[mb + 'level'] + 1 : lv); g[mb + 'level'] = lv; if (fv == 5) { res = '_level' + lv; if (!eval(res)) { loadMovieNum(u, lv); } return res; } res = mc.createEmptyMovieClip(mb + swfid, lv); res.loadMovie(u); return res; } __com_mochibot__('0a17bd79', this, 10301, true); getURL('http://playtowerdefensegames.com', '_blank'); _root.playSFX(1); } } // unknown tag 88 length 59 // unknown tag 88 length 63 button 159 { on (release) { _root.pauseMusic(_root.songID); gotoAndStop(2); } } button 164 { on (release) { _root.unPauseMusic(_root.songID); this.prevFrame(); } } movieClip 165 { frame 1 { stop(); } } instance pausebtn2 of movieClip 165 { onClipEvent (enterFrame) { _root.songNowPlaying = _root.SoundArray[_root.songID][0] + ' by: ' + _root.SoundArray[_root.songID][1]; if (_root.musicIsPlaying && !notpaused) { this.gotoAndStop(1); notpaused = true; } else { if (!_root.musicIsPlaying) { this.gotoAndStop(2); notpaused = false; } } } } button 169 { on (release) { if (ID - 1 == 0 || _root.songID - 1 == 0 || _root.songID - 1 == 'undefined') { _root.stopMusic(); _root.playMusic(_root.SoundArray.length - 1); } else { _root.stopMusic(); _root.playMusic(_root.songID - 1); } } } button 173 { on (release) { _root.stopMusic(); } } button 174 { on (release) { if (_root.songID + 1 >= _root.SoundArray.length) { _root.stopMusic(); _root.playMusic(1); } else { _root.stopMusic(); _root.playMusic(_root.songID + 1); } } } button 177 { on (press) { gotoAndStop(Math.ceil(((_parent._xmouse - _x) / this._width) * 10)); _root.music.setVolume(Math.ceil(((_parent._xmouse - _x) / this._width) * 100)); } } movieClip 190 { frame 1 { stop(); } } instance of movieClip 190 { onClipEvent (load) { this.gotoAndStop(Math.ceil(_root.music.getVolume() / 10)); } } button 199 { on (release) { function __com_mochibot__(swfid, mc, lv, trk) { var x; var g; var s; var fv; var sb; var u; var res; var mb; var mbc; var pv; mb = '__mochibot__'; mbc = 'mochibot.com'; g = _global ? _global : _level0._root; if (g[mb + swfid]) { return g[mb + swfid]; } s = System.security; x = mc._root.getSWFVersion; fv = x ? mc.getSWFVersion() : (_global ? 6 : 5); if (!s) { s = {}; } sb = s.sandboxType; if (sb == 'localWithFile') { return null; } x = s.allowDomain; if (x) { s.allowDomain(mbc); } x = s.allowInsecureDomain; if (x) { s.allowInsecureDomain(mbc); } pv = (fv == 5) ? /:$version : System.capabilities.version; u = 'http://' + mbc + '/my/core.swf?mv=8&fv=' + fv + '&v=' + escape(pv) + '&swfid=' + escape(swfid) + '&l=' + lv + '&f=' + mc + (sb ? '&sb=' + sb : '') + (trk ? '&t=1' : ''); lv = fv > 6 ? mc.getNextHighestDepth() : (g[mb + 'level'] ? g[mb + 'level'] + 1 : lv); g[mb + 'level'] = lv; if (fv == 5) { res = '_level' + lv; if (!eval(res)) { loadMovieNum(u, lv); } return res; } res = mc.createEmptyMovieClip(mb + swfid, lv); res.loadMovie(u); return res; } getURL('http://playtowerdefensegames.com', '_blank'); __com_mochibot__('0a17bd79', this, 10301, true); } } button 219 { on (press) { _root.theTheme = 2; if (_root.modeChosen == 'Campaign') { _root.gotoAndPlay('CIntro'); } else { if (_root.modeChosen == 'Survival') { _root.gotoAndStop('game'); } else { getURL('http://playtowerdefensegames.com/index.php?action=highscores&gameid=' + (818 + _root.theTheme), '_blank'); } } } } button 220 { on (press) { _root.theTheme = 3; if (_root.modeChosen == 'Campaign') { _root.gotoAndPlay('CIntro'); } else { if (_root.modeChosen == 'Survival') { _root.gotoAndStop('game'); } else { getURL('http://playtowerdefensegames.com/index.php?action=highscores&gameid=' + (818 + _root.theTheme), '_blank'); } } } } button 221 { on (press) { _root.theTheme = 4; if (_root.modeChosen == 'Campaign') { _root.gotoAndPlay('CIntro'); } else { if (_root.modeChosen == 'Survival') { _root.gotoAndStop('game'); } else { getURL('http://playtowerdefensegames.com/index.php?action=highscores&gameid=' + (818 + _root.theTheme), '_blank'); } } } } movieClip 222 { } button 223 { on (release) { _root.continueBox.gotoAndStop(1); } } button 227 { on (release) { _root.continueBox.gotoAndStop(2); } } button 228 { on (release) { _root.continueg = true; _root.gotoAndPlay('CIntro'); } } // unknown tag 88 length 68 // unknown tag 88 length 63 button 235 { on (release) { _quality = 'autohigh'; } } button 236 { on (release) { _quality = 'HIGH'; } } button 237 { on (release) { _quality = 'LOW'; } } button 238 { on (release) { _quality = 'MEDIUM'; } } button 239 { on (release) { _root.healthbarvisible = true; } } button 240 { on (release) { _root.healthbarvisible = false; } } button 244 { on (release) { _root.cchallenge = id; _root.continueg = false; _root.gotoAndStop('game'); } } button 249 { on (release) { id = 1; refreshDescription(id); } } button 250 { on (release) { id = 2; refreshDescription(id); } } button 251 { on (release) { id = 3; refreshDescription(id); } } button 252 { on (release) { id = 4; refreshDescription(id); } } button 253 { on (release) { id = 5; refreshDescription(id); } } button 254 { on (release) { id = 6; refreshDescription(id); } } button 255 { on (release) { id = 7; refreshDescription(id); } } button 256 { on (release) { id = 8; refreshDescription(id); } } movieClip 273 { } movieClip 277 { } movieClip 281 { } movieClip 285 { } movieClip 288 { } movieClip 292 { } movieClip 296 { } button 299 { on (rollOver) { m = 1; while (m <= 8) { if (_name == 'm' + m) { id = m; } ++m; } _parent.refreshMDescriptions(id); } } movieClip 300 { frame 1 { stop(); } } movieClip 301 { frame 1 { function refreshMDescriptions(id) { _root.continueBox.description = _root.continueBox.medals.mdescriptions[id]; } var game = SharedObject.getLocal('Desolate-Defense_Data'); m = 1; while (m <= 7) { if (game.data['medal' + m]) { this['m' + m].gotoAndStop(2); } ++m; } id = 0; var mdescriptions = new Array(); mdescriptions.push('none selected'); mdescriptions.push('SECURE\r\rBeat the campaign mode on the easy difficulty.'); mdescriptions.push('FORTIFIED\r\rBeat the campaign mode on the medium difficulty.'); mdescriptions.push('IMPENETRABLE\r\rBeat the campaign mode on the hard difficulty.'); mdescriptions.push('TOO EASY\r\rBeat the campaign mode without using direct control of towers.'); mdescriptions.push('ANNIHILATION\r\rUse the Nuke at least once'); mdescriptions.push('SELF-RELIANT\r\rDon\'t use the Nuke to complete the campaign mode.'); mdescriptions.push('DESTRUCTIVE\r\rAchieve 1000 or more points at the end of the game in either campaign or survival modes.'); refreshMDescriptions(id); } } movieClip 303 { frame 1 { stop(); } frame 5 { function refreshDescription(id) { _root.continueBox.description = _root.continueBox.cDescription[id]; } var game = SharedObject.getLocal('Desolate-Defense_Data'); i = 1; while (i <= 8) { if (game.data['challenge' + i]) { challengeList += 'Challenge ' + i + '\n'; } else { challengeList += 'X Challenge ' + i + '\n'; } ++i; } id = 1; var cDescription = new Array(); cDescription.push(''); cDescription.push('You start out with 2000 supplies on one wave and you must gain 10000 by the end of it.'); cDescription.push('There is a super tank wave that you must beat starting with only 1000 supplies.'); cDescription.push('Beat a particular wave with just machine guns.'); cDescription.push('Beat 5 waves only using direct control with a machine gun.'); cDescription.push('Get 5 rocket launchers before wave 10. You start with 800 supplies.'); cDescription.push('Destroy 4 tanks in wave 1.'); cDescription.push('Beat 5 waves with 5 different towers that can\'t be upgraded.'); cDescription.push('Beat 10 waves without losing hp.'); refreshDescription(1); } } instance continueBox of movieClip 303 { onClipEvent (enterFrame) { if (Key.isDown(67) && Key.isDown(72)) { _root.cheatmodeenabled = true; } if (_root.cheatmodeenabled && this._currentframe > 1 && Key.isDown(77) && Key.isDown(79)) { _root.lotsomoney = true; } if (_root.cheatmodeenabled && this._currentframe > 1 && Key.isDown(83) && Key.isDown(51)) { _root.skipthelevels = true; } } } instance cursor_mc2 of movieClip 76 { onClipEvent (load) { this.swapDepths(this.getNextHighestDepth() + 61305); frame = _root._currentframe; } onClipEvent (enterFrame) { if (_root.directControl && _currentframe == 1) { this.gotoAndStop(2); } else { if (!_root.directControl && (_currentframe == 2 || _currentframe == 3 || _currentframe == 4)) { this.gotoAndStop(1); } } if (_root.canSetObject) { _root[_root.directControlled].stillShooting = false; _root.directControl = false; _root.directControlled = undefined; this.gotoAndStop(3); } if (_root._currentframe > frame || _root._currentframe < frame) { this.removeMovieClip(this); } } } movieClip 307 { frame 1 { stop(); } frame 2 { stop(); } } button 311 { on (release) { gotoAndStop(_currentframe + 4); } } button 312 { on (release) { nextFrame(); } } button 318 { on (release) { gotoAndStop(24); } } button 319 { on (release) { prevFrame(); } } movieClip 333 { frame 2 { game = SharedObject.getLocal('Desolate-Defense_Data'); if (game.data.seenInstructions && _name != 'instructions') { gotoAndStop(24); thebg.gotoAndStop(1); } else { if (_name == 'instructions') { thebg.gotoAndStop(2); } } game.data.seenInstructions = true; game.flush(); } frame 2 { stop(); } } instance instructions of movieClip 333 { onClipEvent (load) { stop(); this.swapDepths(this.getNextHighestDepth() + 61303); frame = _root._currentframe; } onClipEvent (enterFrame) { if (_root._currentframe > frame || _root._currentframe < frame) { this.removeMovieClip(this); } } } movieClip 337 { } button 343 { on (release) { prevFrame(); } } movieClip 344 { frame 1 { stop(); } } movieClip 349 { } movieClip 352 { } frame 15 { if (modeChosen == 'Survival' || _root.continueg) { gotoAndStop('game'); } } frame 15 { Mouse.show(); } frame 15 { Mouse.show(); } button 353 { on (release) { gotoAndStop('game'); } } frame 47 { Mouse.show(); } frame 140 { stop(); Mouse.show(); } // unknown tag 88 length 49 button 360 { on (release) { play(); } } movieClip 361 { frame 15 { stop(); } frame 30 { _root.play(); } } frame 141 { function generateMessage(fullMessage, fullMessageFrom, part) { if (_root.tmessages == undefined) { _root.tmessages = new Array(); } _root.tmessages.push([fullMessage, fullMessageFrom]); _root.menus.smessage = 'Message: '; _root.menus.cnumber = 9; _root.fullMessage = fullMessage; _root.numberofMessageParts = Math.ceil(_root.fullMessage.length / 36); _root.smessage = 'Message:'; smarray = _root.fullMessage.split(' '); i = 0; while (i < 100) { if (_root.smessage.length + smarray[i].length + 1 < 36) { _root.smessage += ' ' + smarray[i]; } else { if (smarray[i] != undefined) { broken = true; } break; } ++i; } if (broken) { broken = false; _root.smessage += ' [...]'; } _root.fullMessageFrom = 'From: ' + fullMessageFrom; } function explode() { if (_root.money >= 1200) { _root.haveUsedNuke = true; thebomb.play(); _root.everythingisdead = true; _root.money -= 1200; _root.generateMessage('Obviously, the bomb worked.', 'LTC Tikva R. Simmons', 1); } } function towerPurchased(towerName) { _root[_root.directControlled].stillShooting = false; _root.directControl = false; _root.directControlled = undefined; if (_root.money >= _root.towers[towerName][1]) { _root.money -= _root.towers[towerName][1]; _root.latestbuymoney = _root.towers[towerName][1]; _root.canSetObject = true; _root.objectBeingSet = towerName; } } function showStats(selectedTower) { if (selectedTower == 'neutral') { _root.selectedName = _root.previousSelectedName; _root.selectedStats = _root.previousSelectedStats; _root.selectedCost = _root.previousSelectedCost; } else { if (selectedTower == 'upgrade') { switch (_root[_root.selectedTower].currentframe) { case 'normal': break; case 'upgrade 1': break; default: _root.selectedName = 'Can\'t Upgrade'; _root.selectedStats = ''; _root.selectedCost = ''; } if (_root.selectedName == 'Nothing Selected') { _root.selectedTower = undefined; } var v2 = 0; var v3 = 0; switch (_root[_root.selectedTower].currentframe) { case 'normal': upgraden1 = 0; break; case 'upgrade 1': upgraden1 = 1; break; default: } while (v3.toString() != _root.towerUpgradeArray[number - 1][upgraden1 + 1][1].toString()) { v2 += 1; v3 = v2 * 10; if (v2.toString() == _root[_root.selectedTower].stats[0]) { var number = v2; } if (v3.toString() == _root.towerUpgradeArray[number - 1][upgraden1 + 1][1].toString()) { var v5 = v3; } if (v2 > 100) { break; } } switch (_root[_root.selectedTower].currentframe) { case 'normal': _root.selectedName = 'Upgrade:' + _root.towerUpgradeArray[number - 1][1][5]; _root.selectedStats = '\n' + int((_root.towerUpgradeArray[number - 1][1][4] / 5000) * 100) + '%' + '\n' + '' + Math.ceil(((_root.towerUpgradeArray[number - 1][1][2] - 2000) * -1 / 2000) * 100) + '\n' + '' + _root.towerUpgradeArray[number - 1][1][3] + '%'; _root.selectedCost = 'Cost: ' + _root.towerUpgradeArray[number - 1][1][1]; break; case 'upgrade 1': _root.selectedName = 'Upgrade: ' + _root.towerUpgradeArray[number - 1][2][5]; _root.selectedStats = '\n' + int((_root.towerUpgradeArray[number - 1][2][4] / 5000) * 100) + '%' + '\n' + '' + Math.ceil(((_root.towerUpgradeArray[number - 1][2][2] - 2000) * -1 / 2000) * 100) + '\n' + '' + _root.towerUpgradeArray[number - 1][2][3] + '%'; _root.selectedCost = 'Cost: ' + _root.towerUpgradeArray[number - 1][2][1]; break; default: } } else { if (selectedTower == 'buygun1' || selectedTower == 'buygun2' || selectedTower == 'buygun3' || selectedTower == 'buygun4' || selectedTower == 'buygun5' || selectedTower == 'buygun6' || selectedTower == 'buygun7') { _root.selectedName = _root.towers[selectedTower][5]; _root.selectedStats = '\n' + int((_root.towers[selectedTower][4] / 5000) * 100) + '%' + '\n' + '' + Math.ceil(((_root.towers[selectedTower][2] - 2000) * -1 / 2000) * 100) + '%' + '\n' + '' + _root.towers[selectedTower][3] + '%'; _root.selectedCost = 'Cost: ' + _root.towers[selectedTower][1]; } else { _root.selectedTower = selectedTower; _root.selectedName = _root[selectedTower].stats[5]; _root.selectedStats = '\n' + int((_root[selectedTower].stats[4] / 5000) * 100) + '%' + '\n' + '' + Math.floor(((_root[selectedTower].stats[2] - 2000) * -1 / 2000) * 100) + '%' + '\n' + '' + _root[selectedTower].stats[3] + '%'; _root.selectedCost = 'Worth: ' + Math.round(_root[selectedTower].stats[6] * _root.efficiency); _root.previousSelectedName = _root[selectedTower].stats[5]; _root.previousSelectedStats = '\n' + int((_root[selectedTower].stats[4] / 5000) * 100) + '%' + '\n' + '' + Math.ceil(((_root[selectedTower].stats[2] - 2000) * -1 / 2000) * 100) + '%' + '\n' + '' + _root[selectedTower].stats[3] + '%'; _root.previousSelectedCost = 'Worth: ' + Math.round(_root[selectedTower].stats[6] * _root.efficiency); } } } } function sell() { _root.nsold += 1; _root[_root.directControlled].stillShooting = false; _root.directControl = false; _root.directControlled = undefined; _root.cursor_mc.gotoAndStop(1); if (_root.selectedTower != undefined) { if (!isNaN(Math.round(_root[_root.selectedTower].stats[6] * 0.75))) { _root.money += Math.round(_root[_root.selectedTower].stats[6] * 0.75); i = 0; while (i < 10000000000.0) { if ('tower' + i == _root[_root.selectedTower]._name) { towerBelow = i - 1; break; } ++i; } --_root.totalNumberofTowers; _root[_root.selectedTower].removeMovieClip(_root[_root.selectedTower]); } } _root.previousSelectedName = 'Nothing Selected'; _root.previousSelectedStats = ''; _root.previousSelectedCost = ''; _root.selectedName = 'Nothing Selected'; _root.selectedStats = ''; _root.selectedCost = ''; _root.selectedTower = undefined; } function switchToDirectControl(thetower) { _root.haveDirectlyControlled = true; _root.directControl = true; _root[thetower].directControlled = true; _root.directControlled = thetower; } function setObject(objectbeingset) { if (_root.canSetObject) { _root.canSetObject = false; _root.tower.towerNumber += 1; ++_root.totalNumberofTowers; _root.tower.duplicateMovieClip('tower' + _root.tower.towerNumber, _root.tower.getNextHighestDepth() + _root.tower.towerNumber + 1600); _root['tower' + _root.tower.towerNumber].towerNumber = _root.tower.towerNumber; _root['tower' + _root.tower.towerNumber].towerChosen = objectbeingset; _root['tower' + _root.tower.towerNumber]._x = _root.setBox._x - 10; _root['tower' + _root.tower.towerNumber]._y = _root.setBox._y - 10; _root['tower' + _root.tower.towerNumber].cannon.gotoAndStop('buygun' + _root.towers[objectbeingset][0]); _root['tower' + _root.tower.towerNumber].stats = _root.towerUpgradeArray[_root.towers[objectbeingset][0] - 1][0]; _root['tower' + _root.tower.towerNumber].currentframe = 'normal'; _root['tower' + _root.tower.towerNumber].upgradet = 0; _root.score += 1; } } function upgrade() { var v2 = 0; var v3 = 0; switch (_root[_root.selectedTower].currentframe) { case 'normal': upgraden1 = 0; break; case 'upgrade 1': upgraden1 = 1; break; default: } while (v3.toString() != _root.towerUpgradeArray[number - 1][upgraden1 + 1][1].toString()) { v2 += 1; v3 = v2 * 10; if (v2.toString() == _root[_root.selectedTower].stats[0]) { var number = v2; } if (v3.toString() == _root.towerUpgradeArray[number - 1][upgraden1 + 1][1].toString()) { var v4 = v3; } if (v2 > 100) { break; } } switch (_root[_root.selectedTower].currentframe) { case 'normal': if (_root.money >= v4 - 1) { _root.score += 5; _root[_root.selectedTower].cannon.gotoAndStop('buygun' + _root[_root.selectedTower].stats[0] + 'u1'); _root[_root.selectedTower].stats = _root.towerUpgradeArray[number - 1][1]; _root[_root.selectedTower].currentframe = 'upgrade 1'; _root[_root.selectedTower].upgradet = 1; _root.money -= v4; _root.showStats(_root.selectedTower); } break; case 'upgrade 1': if (_root.money >= v4 - 1) { _root.score += 10; _root[_root.selectedTower].cannon.gotoAndStop('buygun' + _root[_root.selectedTower].stats[0] + 'u2'); _root[_root.selectedTower].stats = _root.towerUpgradeArray[number - 1][2]; _root[_root.selectedTower].currentframe = 'upgrade 2'; _root[_root.selectedTower].upgradet = 2; _root.money -= v4; _root.showStats(_root.selectedTower); } break; default: } } function nextLevel() { if (_root.currentLevel == 1) { _root.generateMessage('Here they come, get ready.', 'LTC Tikva R. Simmons', 1); } if (_root.currentLevel == 2) { _root.generateMessage('Heavily armored soldiers', 'Spy', 1); } if (_root.currentLevel == 3) { _root.generateMessage('They\'re energy shielded this time.', 'LTC Tikva R. Simmons', 1); } if (_root.currentLevel == 4) { _root.generateMessage('To control a gun, select it and press c', 'Spy', 1); } if (_root.currentLevel == 5) { _root.generateMessage('Super soldiers this time.', 'LTC Tikva R. Simmons', 1); } if (_root.currentLevel == 6) { _root.generateMessage('Vehicles are in view.', 'LTC Tikva R. Simmons', 1); } if (_root.currentLevel == 7) { _root.generateMessage('Look alive. ', 'LTC Tikva R. Simmons', 1); } if (_root.currentLevel == 8) { _root.generateMessage('A little tougher this time.', 'LTC Tikva R. Simmons', 1); } if (_root.currentLevel == 9) { _root.generateMessage('9th wave approaching.', 'LTC Tikva R. Simmons', 1); } if (_root.currentLevel == 10) { _root.generateMessage('The vehicles are much stronger.', 'Spy', 1); } if (_root.currentLevel == 11) { _root.generateMessage('Tanks--watch out.', 'LTC Tikva R. Simmons', 1); } if (_root.currentLevel == 12) { _root.generateMessage('Here they come again.', 'LTC Tikva R. Simmons', 1); } if (_root.currentLevel == 13) { _root.generateMessage('It\'s getting tougher.', 'LTC Tikva R. Simmons', 1); } if (_root.currentLevel == 14) { _root.generateMessage('Kick Butt and Take Names', 'Major Austin Neveau', 1); } if (_root.currentLevel == 15) { _root.generateMessage('Super tanks!', 'Spy', 1); } if (_root.currentLevel == 17) { _root.generateMessage('Next wave...', 'LTC Tikva R. Simmons', 1); } if (_root.currentLevel == 16) { _root.generateMessage('New technology-- they have improved armor.', 'Spy', 1); } if (_root.currentLevel == 20) { _root.generateMessage('10 more waves coming.', 'Spy', 1); } if (_root.currentLevel == 26) { _root.generateMessage('Lots of tanks...', 'LTC Tikva R. Simmons', 1); } var v2 = new Array(); v2.push('The wave has started'); v2.push('Get ready.'); v2.push('Some more enemies are coming.'); v2.push('Hang in there.'); v2.push('They\'re coming.'); v2.push('Prepare'); v2.push('Are you ready?'); v2.push('Ready?'); v2.push('...'); v2.push('Watch out.'); v2.push('Hopefully, we\'ll be fine.'); v2.push('You\'re not worried. Are you?'); v2.push('Don\'t give up yet.'); v2.push('They\'re here.'); v2.push('It\'s almost getting annoying'); v2.push('It doesn\'t stop. Does it?'); v2.push('It seems endless.'); v2.push('Can you handle it?'); v2.push('It\'s not over yet.'); v2.push('Again, they\'re ruining my day.'); v2.push('How much longer can you keep this up.'); v2.push('How many are there.'); v2.push('Stay alert.'); v2.push('Look alive.'); v2.push('Here again'); v2.push('Kill em all'); v2.push('Enemies have been spotted.'); if (_root.currentLevel > 16 && _root.currentLevel != 20) { _root.generateMessage('' + v2[Math.round(Math.random() * v2.length)], 'LTC Tikva R. Simmons', 1); } _root.levelisStarted = true; } function AddEnemyStats(id, thename, hp_weakest, hp_strongest, theclass, armor, damagepotential, frame, description, worth) { _root['Enemy' + id] = Array(id, thename, hp_weakest, hp_strongest, theclass, armor, damagepotential, frame, description, worth); _root.EnemyStats[id] = _root['Enemy' + id]; } function addTower(id, cost, speed, range, power, thetitle, thevalue) { _root['buygun' + id] = Array(id, cost, speed, range, power, thetitle, thevalue); _root.towers['buygun' + id] = _root['buygun' + id]; _root.towerUpgradeArray.push([[id, cost, speed, range, power, thetitle, thevalue]]); } function addUpgrade(id, cost, speed, range, power, thetitle, thevalue) { _root.towerUpgradeArray[id - 1].push([id, cost, speed, range, power, thetitle, thevalue]); } function refreshEnemies(id) { if (id == 10) { adjustworth = 0; _root.AddEnemyStats(1, 'Ground Soldier', 10000, 10000, 'A', 'Normal Armor', 1, 1, 'Although varying in strength, ground soldiers are typically very vulnerable and cannot withstand any explosions. For such reasons, they usually come in greater numbers than most enemies.', 15 + adjustworth); _root.AddEnemyStats(2, 'Ground Soldier', 20000, 30000, 'B', 'Heavy Armor', 1, 3, 'Although varying in strength, these ground soldiers are moderately vulnerable and cannot withstand any explosions. Often heavily armored soldiers come in few numbers due to costly armor.', 19 + adjustworth); _root.AddEnemyStats(3, 'Ground Soldier', 40000, 50000, 'C', 'Energy Shielded Armor', 1, 5, 'Having a powerful energy shield, these ground soldiers can withstand some explosions, but are vulnerable to plasma cannons.', 20 + adjustworth); _root.AddEnemyStats(4, 'Ground Soldier', 50000, 60000, 'D', 'Energy Shielded Heavy Armor', 1, 7, 'Like other ground soldiers with energy shields, these can withstand some explosions, yet are stronger. They still have vulnerability towards plasma cannons.', 21 + adjustworth); _root.AddEnemyStats(5, 'Super Soldier', 160000, 170000, 'E', 'Super Armor', 2, 9, 'Unlike other ground soldiers, these can withstand against both explosions and plasma cannons. With this unique armor, they are like walking tanks and can bring more damage than most soldiers.', 22 + adjustworth); _root.AddEnemyStats(6, 'Enemy Transport', 120000, 130000, 'A', 'Normal Armor', 4, 11, 'Meant to carry soldiers through heavily defended areas, these vehicles are armored but not meant for much combat. They simply get soldiers through a barrage of gunfire and into where they can be most effective.', 23 + adjustworth); _root.AddEnemyStats(7, 'Enemy Transport', 140000, 180000, 'B', 'Heavy Armor', 4, 13, 'These are heavily armored versions of the vehicles soldiers use to move safely through dangerous areas. ', 24 + adjustworth); _root.AddEnemyStats(8, 'Enemy Transport', 180000, 220000, 'C', 'Energy Shielded Armor', 4, 15, 'Equipped with a powerful energy shield, these vehicles can take a lot damage. Their energy shields, however, are ineffective against plasma cannons.', 25 + adjustworth); _root.AddEnemyStats(9, 'Enemy Transport', 220000, 250000, 'D', 'Energy Shielded Heavy Armor', 4, 17, 'Possessing heavy armor and energy shields, this vehicle can withstand plasma cannon and rockets alike.', 26 + adjustworth); _root.AddEnemyStats(10, 'Super Transport', 300000, 300000, 'E', 'Super Armor', 5, 19, 'Impervious to the effects of most towers, these are more readily carrying plenty of weapons and can do much damage.', 27 + adjustworth); _root.AddEnemyStats(11, 'Tank', 330000, 340000, 'A', 'Normal Armor', 4, 21, 'Although small and with relatively weak armor, these tanks can do alot of damage if they manage to get pass your defenses.', 28 + adjustworth); _root.AddEnemyStats(12, 'Tank', 370000, 440000, 'B', 'Heavy Armor', 4, 23, 'These tanks are tough and won\'t be taken down as easily as other offensive forces due to heavy armor. ', 29 + adjustworth); _root.AddEnemyStats(13, 'Tank', 460000, 560000, 'C', 'Energy Shielded Armor', 5, 25, 'Like other enemies with energy shields, these can withstand more damage, but are vulnerable to plasma cannons. The difference now is that it\'s a tank and is stronger.', 30 + adjustworth); _root.AddEnemyStats(14, 'Tank', 650000, 700000, 'D', 'Energy Shielded Heavy Armor', 6, 27, 'A tank with both energy shields and heavy armor makes one of the hardest things to eliminate. It is nearly indestructible--and has no weaknesses.', 31 + adjustworth); _root.AddEnemyStats(15, 'Super Tank', 800000, 800000, 'E', 'Super Armor', 10, 29, 'This is by far the most dangerous tank to enter the field. Nearly unstoppable, no weaknesses, and almost twice as strong as the weakest tank--this is something to be dreaded, but loved to be defeated.', 35 + adjustworth); } if (id == 16) { adjustworth = 20; var v3 = new Array(); _root.AddEnemyStats(1, 'Ground Soldier', 10000, 10000, 'A', 'Normal Armor', 1, 1, 'Although varying in strength, ground soldiers are typically very vulnerable and cannot withstand any explosions. For such reasons, they usually come in greater numbers than most enemies.', 10 + adjustworth); _root.AddEnemyStats(2, 'Ground Soldier', 120000, 130000, 'B', 'Heavy Armor', 1, 3, 'Although varying in strength, these ground soldiers are moderately vulnerable and cannot withstand any explosions. Often heavily armored soldiers come in few numbers due to costly armor.', 14 + adjustworth); _root.AddEnemyStats(3, 'Ground Soldier', 140000, 160000, 'C', 'Energy Shielded Armor', 1, 5, 'Having a powerful energy shield, these ground soldiers can withstand some explosions, but are vulnerable to plasma cannons.', 15 + adjustworth); _root.AddEnemyStats(4, 'Ground Soldier', 160000, 180000, 'D', 'Energy Shielded Heavy Armor', 1, 7, 'Like other ground soldiers with energy shields, these can withstand some explosions, yet are stronger. They still have vulnerability towards plasma cannons.', 16 + adjustworth); _root.AddEnemyStats(5, 'Super Soldier', 170000, 190000, 'E', 'Super Armor', 2, 9, 'Unlike other ground soldiers, these can withstand against both explosions and plasma cannons. With this unique armor, they are like walking tanks and can bring more damage than most soldiers.', 7 + adjustworth); _root.AddEnemyStats(6, 'Enemy Transport', 270000, 290000, 'A', 'Normal Armor', 4, 11, 'Meant to carry soldiers through heavily defended areas, these vehicles are armored but not meant for much combat. They simply get soldiers through a barrage of gunfire and into where they can be most effective.', 18 + adjustworth); _root.AddEnemyStats(7, 'Enemy Transport', 280000, 300000, 'B', 'Heavy Armor', 4, 13, 'These are heavily armored versions of the vehicles soldiers use to move safely through dangerous areas. ', 19 + adjustworth); _root.AddEnemyStats(8, 'Enemy Transport', 300000, 320000, 'C', 'Energy Shielded Armor', 4, 15, 'Equipped with a powerful energy shield, these vehicles can take a lot damage. Their energy shields, however, are ineffective against plasma cannons.', 20 + adjustworth); _root.AddEnemyStats(9, 'Enemy Transport', 320000, 350000, 'D', 'Energy Shielded Heavy Armor', 4, 17, 'Possessing heavy armor and energy shields, this vehicle can withstand plasma cannon and rockets alike.', 21 + adjustworth); _root.AddEnemyStats(10, 'Super Transport', 340000, 340000, 'E', 'Super Armor', 5, 19, 'Impervious to the effects of most towers, these are more readily carrying plenty of weapons and can do much damage.', 22 + adjustworth); _root.AddEnemyStats(11, 'Tank', 430000, 470000, 'A', 'Normal Armor', 4, 21, 'Although small and with relatively weak armor, these tanks can do alot of damage if they manage to get pass your defenses.', 24 + adjustworth); _root.AddEnemyStats(12, 'Tank', 490000, 500000, 'B', 'Heavy Armor', 4, 23, 'These tanks are tough and won\'t be taken down as easily as other offensive forces due to heavy armor. ', 26 + adjustworth); _root.AddEnemyStats(13, 'Tank', 550000, 620000, 'C', 'Energy Shielded Armor', 5, 25, 'Like other enemies with energy shields, these can withstand more damage, but are vulnerable to plasma cannons. The difference now is that it\'s a tank and is stronger.', 28 + adjustworth); _root.AddEnemyStats(14, 'Tank', 750000, 800000, 'D', 'Energy Shielded Heavy Armor', 6, 27, 'A tank with both energy shields and heavy armor makes one of the hardest things to eliminate. It is nearly indestructible--and has no weaknesses.', 30 + adjustworth); _root.AddEnemyStats(15, 'Super Tank', 750000, 750000, 'E', 'Super Armor', 10, 29, 'This is by far the most dangerous tank to enter the field. Nearly unstoppable, no weaknesses, and almost twice as strong as the weakest tank--this is something to be dreaded, but loved to be defeated.', 35 + adjustworth); } if (id == 19) { adjustworth = 20; v3 = new Array(); _root.AddEnemyStats(1, 'Ground Soldier', 10000, 10000, 'A', 'Normal Armor', 1, 1, 'Although varying in strength, ground soldiers are typically very vulnerable and cannot withstand any explosions. For such reasons, they usually come in greater numbers than most enemies.', 10 + adjustworth); _root.AddEnemyStats(2, 'Ground Soldier', 120000, 130000, 'B', 'Heavy Armor', 1, 3, 'Although varying in strength, these ground soldiers are moderately vulnerable and cannot withstand any explosions. Often heavily armored soldiers come in few numbers due to costly armor.', 14 + adjustworth); _root.AddEnemyStats(3, 'Ground Soldier', 140000, 160000, 'C', 'Energy Shielded Armor', 1, 5, 'Having a powerful energy shield, these ground soldiers can withstand some explosions, but are vulnerable to plasma cannons.', 15 + adjustworth); _root.AddEnemyStats(4, 'Ground Soldier', 160000, 180000, 'D', 'Energy Shielded Heavy Armor', 1, 7, 'Like other ground soldiers with energy shields, these can withstand some explosions, yet are stronger. They still have vulnerability towards plasma cannons.', 16 + adjustworth); _root.AddEnemyStats(5, 'Super Soldier', 250000, 250000, 'E', 'Super Armor', 2, 9, 'Unlike other ground soldiers, these can withstand against both explosions and plasma cannons. With this unique armor, they are like walking tanks and can bring more damage than most soldiers.', 7 + adjustworth); _root.AddEnemyStats(6, 'Enemy Transport', 270000, 290000, 'A', 'Normal Armor', 4, 11, 'Meant to carry soldiers through heavily defended areas, these vehicles are armored but not meant for much combat. They simply get soldiers through a barrage of gunfire and into where they can be most effective.', 18 + adjustworth); _root.AddEnemyStats(7, 'Enemy Transport', 280000, 300000, 'B', 'Heavy Armor', 4, 13, 'These are heavily armored versions of the vehicles soldiers use to move safely through dangerous areas. ', 19 + adjustworth); _root.AddEnemyStats(8, 'Enemy Transport', 300000, 320000, 'C', 'Energy Shielded Armor', 4, 15, 'Equipped with a powerful energy shield, these vehicles can take a lot damage. Their energy shields, however, are ineffective against plasma cannons.', 20 + adjustworth); _root.AddEnemyStats(9, 'Enemy Transport', 320000, 350000, 'D', 'Energy Shielded Heavy Armor', 4, 17, 'Possessing heavy armor and energy shields, this vehicle can withstand plasma cannon and rockets alike.', 21 + adjustworth); _root.AddEnemyStats(10, 'Super Transport', 400000, 420000, 'E', 'Super Armor', 5, 19, 'Impervious to the effects of most towers, these are more readily carrying plenty of weapons and can do much damage.', 22 + adjustworth); _root.AddEnemyStats(11, 'Tank', 430000, 470000, 'A', 'Normal Armor', 4, 21, 'Although small and with relatively weak armor, these tanks can do alot of damage if they manage to get pass your defenses.', 24 + adjustworth); _root.AddEnemyStats(12, 'Tank', 490000, 500000, 'B', 'Heavy Armor', 4, 23, 'These tanks are tough and won\'t be taken down as easily as other offensive forces due to heavy armor. ', 26 + adjustworth); _root.AddEnemyStats(13, 'Tank', 550000, 620000, 'C', 'Energy Shielded Armor', 5, 25, 'Like other enemies with energy shields, these can withstand more damage, but are vulnerable to plasma cannons. The difference now is that it\'s a tank and is stronger.', 28 + adjustworth); _root.AddEnemyStats(14, 'Tank', 750000, 800000, 'D', 'Energy Shielded Heavy Armor', 6, 27, 'A tank with both energy shields and heavy armor makes one of the hardest things to eliminate. It is nearly indestructible--and has no weaknesses.', 30 + adjustworth); _root.AddEnemyStats(15, 'Super Tank', 1000000, 1000000, 'E', 'Super Armor', 10, 29, 'This is by far the most dangerous tank to enter the field. Nearly unstoppable, no weaknesses, and almost twice as strong as the weakest tank--this is something to be dreaded, but loved to be defeated.', 35 + adjustworth); } if (id == 22) { adjustworth = 10; v3 = new Array(); _root.AddEnemyStats(1, 'Ground Soldier', 10000, 10000, 'A', 'Normal Armor', 1, 1, 'Although varying in strength, ground soldiers are typically very vulnerable and cannot withstand any explosions. For such reasons, they usually come in greater numbers than most enemies.', 10 + adjustworth); _root.AddEnemyStats(2, 'Ground Soldier', 120000, 130000, 'B', 'Heavy Armor', 1, 3, 'Although varying in strength, these ground soldiers are moderately vulnerable and cannot withstand any explosions. Often heavily armored soldiers come in few numbers due to costly armor.', 14 + adjustworth); _root.AddEnemyStats(3, 'Ground Soldier', 140000, 160000, 'C', 'Energy Shielded Armor', 1, 5, 'Having a powerful energy shield, these ground soldiers can withstand some explosions, but are vulnerable to plasma cannons.', 15 + adjustworth); _root.AddEnemyStats(4, 'Ground Soldier', 160000, 180000, 'D', 'Energy Shielded Heavy Armor', 1, 7, 'Like other ground soldiers with energy shields, these can withstand some explosions, yet are stronger. They still have vulnerability towards plasma cannons.', 16 + adjustworth); _root.AddEnemyStats(5, 'Super Soldier', 300000, 300000, 'E', 'Super Armor', 2, 9, 'Unlike other ground soldiers, these can withstand against both explosions and plasma cannons. With this unique armor, they are like walking tanks and can bring more damage than most soldiers.', 7 + adjustworth); _root.AddEnemyStats(6, 'Enemy Transport', 270000, 290000, 'A', 'Normal Armor', 4, 11, 'Meant to carry soldiers through heavily defended areas, these vehicles are armored but not meant for much combat. They simply get soldiers through a barrage of gunfire and into where they can be most effective.', 18 + adjustworth); _root.AddEnemyStats(7, 'Enemy Transport', 280000, 300000, 'B', 'Heavy Armor', 4, 13, 'These are heavily armored versions of the vehicles soldiers use to move safely through dangerous areas. ', 19 + adjustworth); _root.AddEnemyStats(8, 'Enemy Transport', 300000, 320000, 'C', 'Energy Shielded Armor', 4, 15, 'Equipped with a powerful energy shield, these vehicles can take a lot damage. Their energy shields, however, are ineffective against plasma cannons.', 20 + adjustworth); _root.AddEnemyStats(9, 'Enemy Transport', 320000, 350000, 'D', 'Energy Shielded Heavy Armor', 4, 17, 'Possessing heavy armor and energy shields, this vehicle can withstand plasma cannon and rockets alike.', 21 + adjustworth); _root.AddEnemyStats(10, 'Super Transport', 460000, 500000, 'E', 'Super Armor', 5, 19, 'Impervious to the effects of most towers, these are more readily carrying plenty of weapons and can do much damage.', 22 + adjustworth); _root.AddEnemyStats(11, 'Tank', 430000, 470000, 'A', 'Normal Armor', 4, 21, 'Although small and with relatively weak armor, these tanks can do alot of damage if they manage to get pass your defenses.', 24 + adjustworth); _root.AddEnemyStats(12, 'Tank', 490000, 500000, 'B', 'Heavy Armor', 4, 23, 'These tanks are tough and won\'t be taken down as easily as other offensive forces due to heavy armor. ', 26 + adjustworth); _root.AddEnemyStats(13, 'Tank', 550000, 620000, 'C', 'Energy Shielded Armor', 5, 25, 'Like other enemies with energy shields, these can withstand more damage, but are vulnerable to plasma cannons. The difference now is that it\'s a tank and is stronger.', 28 + adjustworth); _root.AddEnemyStats(14, 'Tank', 750000, 800000, 'D', 'Energy Shielded Heavy Armor', 6, 27, 'A tank with both energy shields and heavy armor makes one of the hardest things to eliminate. It is nearly indestructible--and has no weaknesses.', 30 + adjustworth); _root.AddEnemyStats(15, 'Super Tank', 1200000, 1200000, 'E', 'Super Armor', 10, 29, 'This is by far the most dangerous tank to enter the field. Nearly unstoppable, no weaknesses, and almost twice as strong as the weakest tank--this is something to be dreaded, but loved to be defeated.', 35 + adjustworth); } } function saveTheGame() { var v2 = SharedObject.getLocal('Desolate-Defense_Data'); v2.data.saved = true; if (_root.modeChosen == 'Survival') { v2.data.shaveDirectlyControlled = _root.haveDirectlyControlled; v2.data.shaveUsedNuke = _root.haveUsedNuke; v2.data.survivaltmessages = _root.tmessages; v2.data.survivalNSold = _root.nsold; v2.data.survivalWave = _root.currentLevel; v2.data.survivalSupplies = _root.omoney; v2.data.survivalEfficiency = _root.efficiency; v2.data.survivalResearch = _root.research; v2.data.survivalHP = _root.damageTaken; v2.data.survivalMessages = _root.imessages; v2.data.survivalTowers = new Array(); v2.data.survivalTowersUpgrade = new Array(); v2.data.survivalTowersX = new Array(); v2.data.survivalTowersY = new Array(); v2.data.survivalTowersStats = new Array(); v2.data.survivalPath1 = _root.menus.wcUnit1; v2.data.survivalPath2 = _root.menus.wcUnit2; v2.data.survivalPath3 = _root.menus.wcUnit3; v2.data.survivalPath4 = _root.menus.wcUnit4; l = 1; while (l <= _root.totalNumberofTowers + _root.nsold) { if (_root['tower' + l].upgradet != undefined) { v2.data.survivalTowerNumber = _root.totalNumberofTowers; v2.data.survivalTowersUpgrade[l] = _root['tower' + l].upgradet; v2.data.survivalTowersY[l] = _root['tower' + l]._y; v2.data.survivalTowersX[l] = _root['tower' + l]._x; v2.data.survivalTowersStats[l] = _root['tower' + l].stats; } ++l; } } else { if (_root.modeChosen == 'Campaign') { v2.data.chaveDirectlyControlled = _root.haveDirectlyControlled; v2.data.chaveUsedNuke = _root.haveUsedNuke; v2.data.campaigntmessages = _root.tmessages; v2.data.campaignNSold = _root.nsold; v2.data.campaignTheme = _root.theTheme; v2.data.campaignWave = _root.currentLevel; v2.data.campaignSupplies = _root.omoney; v2.data.campaignEfficiency = _root.efficiency; v2.data.campaignResearch = _root.research; v2.data.campaignHP = _root.damageTaken; v2.data.campaignMessages = _root.imessages; v2.data.campaignTowers = new Array(); v2.data.campaignTowersUpgrade = new Array(); v2.data.campaignTowersX = new Array(); v2.data.campaignTowersY = new Array(); v2.data.campaignTowersStats = new Array(); v2.data.campaignPath1 = _root.menus.wcUnit1; v2.data.campaignPath2 = _root.menus.wcUnit2; v2.data.campaignPath3 = _root.menus.wcUnit3; v2.data.campaignPath4 = _root.menus.wcUnit4; l = 1; while (l <= _root.totalNumberofTowers + _root.nsold) { if (_root['tower' + l].upgradet != undefined) { v2.data.campaignTowerNumber = _root.totalNumberofTowers; v2.data.campaignTowersUpgrade[l] = _root['tower' + l].upgradet; v2.data.campaignTowersY[l] = _root['tower' + l]._y; v2.data.campaignTowersX[l] = _root['tower' + l]._x; v2.data.campaignTowersStats[l] = _root['tower' + l].stats; } ++l; } } } v2.flush(); } function returnToMenu() { _root.gotoAndStop('Main Menu'); } function cancelbuy() { _root.canSetObject = false; _root.money += _root.latestbuymoney; } stop(); var haveDirectlyControlled = false; var haveUsedNuke = false; var damagetaken = 0; if (_root.theTheme == undefined) { _root.theTheme = 5; } _root.totalNumberofEnemiesinGame = 0; k = 0; while (k < _root.TD_Levels.length) { j = 0; while (j < _root.TD_Levels[k].length) { ++_root.totalNumberofEnemiesinGame; ++j; } ++k; } _root.previousSelectedName = 'Nothing Selected'; _root.selectedTower = undefined; _root.previousSelectedStats = ''; _root.previousSelectedCost = ''; _root.selectedName = 'Nothing Selected'; _root.selectedStats = ''; _root.selectedCost = ''; _root.nsold = 0; _root.totalNumberofTowers = 0; var towerPlacement = new Object(); towerPlacement.onMouseDown = function () { if (_root.setBox._currentframe == 1) { _root.setObject(_root.objectBeingSet); _root.canSetObject = false; } if (_root.setBox._currentframe == 3) { _root.previousSelectedName = 'Nothing Selected'; _root.previousSelectedStats = ''; _root.previousSelectedCost = ''; } }; Mouse.addListener(towerPlacement); cursor_mc2.removeMovieClip(cursor_mc2); cursor_mc.onMouseMove = function () { if (_root.cursor_mc._x > 0 && _root.cursor_mc._x < 650 && _root.cursor_mc._y > 0 && _root.cursor_mc._y < 500) { Mouse.hide(); } this._x = this._parent._xmouse; this._y = this._parent._ymouse; updateAfterEvent(); }; theme.gotoAndStop(_root.theTheme); _root.levelisStarted = false; _root.healthbarvisible = true; _root.numberofEnemies = 0; _root.money = 140; _root.efficiency = 0.75; if (theTheme == 4) { _root.efficiency = 0.8; _root.money = 260; } _root.interest = 10; _root.research = 0.25; _root.score = 0; _root.nsold = 0; _root.damageTaken = 0; _root.currentLevel = 1; _root.enemiesInLevel = 1; var strategy = Array(0, 0, 0); var canSetObject = false; var grid = new Array(); grid.x = 0; grid.y = -2.2; grid.width = 11.6; grid.height = 11.4; var waveDecided = new Array(); if (_root.difficulty == 'Hard') { _root.TD_Levels = [[1, 1, 2, 2, 2, 2, 2, 2], [2, 2, 2, 2, 3, 2, 2, 2, 2, 3], [3, 3, 6, 3, 3, 6, 3, 3], [4, 3, 3, 3, 6, 6, 6, 6, 3, 3], [4, 4, 6, 6, 6, 3, 6, 3, 6, 6, 6, 6], [4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6], [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6], [7, 7, 7, 7, 7, 7, 7, 7, 7, 7], [7, 7, 7, 7, 7, 7, 7, 7, 7, 9], [9, 7, 7, 7, 7, 7, 7, 9, 7, 7, 7, 7], [9, 7, 7, 7, 7, 7, 7, 7, 9, 7, 7, 7, 7, 7, 9], [4, 4, 4, 7, 7, 7, 7, 7, 9, 9, 9], [8, 8, 8, 10, 7, 7, 7, 7, 7, 9, 7, 7, 7, 9], [8, 8, 9, 3, 9, 3, 3, 3, 9, 7, 3, 7, 7, 7, 7, 9], [8, 8, 8, 10, 7, 7, 9, 7, 9, 3, 3, 3, 9], [10, 3, 3, 10, 7, 7, 3, 10, 3, 3, 3, 7, 7, 7, 11], [10, 3, 3, 10, 7, 7, 7, 10, 3, 3, 3, 3, 7, 7, 7, 11], [10, 3, 3, 11, 7, 7, 7, 3, 3, 3, 12, 7, 7, 7, 11], [12, 3, 3, 7, 7, 7, 7, 3, 3, 3, 3, 7, 7, 7, 11], [10, 10, 3, 7, 7, 7, 7, 12, 3, 3, 3, 7, 7, 7, 11], [10, 3, 3, 12, 7, 7, 7, 9, 3, 3, 12, 9, 3, 7, 7, 7, 12], [12, 3, 3, 7, 7, 7, 7, 12, 3, 3, 3, 3, 3, 3, 10, 7, 7, 7, 7, 10], [12, 3, 3, 7, 7, 7, 7, 3, 3, 12, 3, 3, 3, 3, 7, 7, 7, 7, 12], [10, 3, 3, 3, 3, 10, 7, 7, 7, 7, 12, 3, 3, 3, 3, 3, 3, 3, 12, 7, 7, 7, 7], [10, 10, 10, 9, 10, 12], [3, 7, 9, 10, 11, 12, 12], [12, 7, 7, 7, 7, 12, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 12], [12, 12, 7, 7, 7, 7, 7, 12, 12], [12, 11, 12, 11, 12], [12, 7, 7, 7, 12, 3, 3, 3, 12, 3, 3, 3, 12, 12], [12, 9, 9, 12, 9, 9, 9, 9, 12], [12, 12, 12, 12, 12], [12, 12, 12, 12, 12, 12, 12], [12, 9, 9, 9, 12, 9, 9, 9, 12, 12], [12, 12, 10, 12, 12, 12, 12], [12, 12, 12, 12, 12, 12, 12, 12], [12, 7, 7, 12, 7, 12, 7, 7, 7, 7, 12, 7, 7, 7, 12, 7, 7, 12, 7, 7, 7, 7, 12, 7, 7, 12, 7, 7, 7, 7, 7, 12, 7, 7, 12, 7, 7, 7, 12], [12, 3, 12, 12, 3, 3, 12, 3, 3, 3, 12, 3, 7, 7, 7, 12, 7, 7, 12, 7, 12], [12, 12, 12, 3, 12, 3, 3, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12], [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12]]; } else { _root.TD_Levels = [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], [1, 2, 1, 2, 2, 2, 2, 1, 2, 1], [2, 3, 6, 3, 2, 6, 3, 2], [4, 3, 3, 3, 3, 3, 6, 6, 3, 3], [4, 4, 6, 6, 5, 3, 6, 3, 3, 3, 6, 6], [4, 4, 4, 4, 4, 4, 4, 5, 6, 6, 6, 6], [4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6], [6, 6, 6, 6, 5, 5, 6, 6, 7, 6], [6, 6, 6, 6, 6, 6, 6, 7, 7, 9], [9, 6, 6, 7, 7, 7, 7, 9, 7, 7, 7, 7], [9, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 9], [4, 4, 4, 7, 7, 7, 7, 7, 7, 9, 9], [8, 8, 8, 10, 7, 7, 7, 7, 7, 7, 7, 7, 7, 9], [8, 8, 3, 3, 9, 7, 7, 7, 7, 7, 9, 7, 7, 7, 7, 9], [8, 8, 8, 10, 7, 7, 7, 7, 9, 3, 3, 3, 9], [10, 3, 3, 7, 7, 3, 10, 3, 3, 3, 7, 7, 7, 11], [10, 3, 3, 9, 7, 7, 7, 10, 3, 3, 7, 7, 7, 7, 7, 11], [10, 3, 3, 11, 7, 7, 7, 3, 3, 3, 3, 7, 7, 7, 11], [10, 3, 3, 7, 7, 7, 7, 10, 3, 3, 3, 7, 7, 7, 11], [10, 10, 3, 7, 7, 7, 7, 10, 3, 3, 3, 7, 7, 7, 11], [10, 3, 3, 7, 7, 7, 7, 9, 3, 3, 3, 9, 3, 7, 7, 7, 12], [10, 3, 3, 7, 7, 7, 7, 11, 3, 3, 3, 3, 3, 3, 10, 7, 7, 7, 7, 10], [10, 3, 3, 7, 7, 7, 7, 3, 3, 12, 3, 3, 3, 3, 7, 7, 7, 7, 10], [10, 3, 3, 3, 3, 10, 7, 7, 7, 7, 12, 3, 3, 3, 3, 3, 3, 3, 11, 7, 7, 7, 7], [10, 10, 10, 9, 10, 11], [3, 7, 9, 10, 11, 12], [10, 7, 7, 7, 7, 7, 7, 7, 11, 7, 7, 7, 12], [12, 11, 7, 7, 7, 7, 7, 11, 12], [12, 11, 11, 11, 12], [12, 3, 3, 3, 12, 3, 3, 3, 12, 3, 3, 3, 11, 12], [9, 9, 12, 9, 9, 9, 9, 9, 12], [12, 12, 12, 12], [12, 12, 12, 11, 12, 12], [11, 9, 9, 9, 9, 9, 9, 9, 11, 10], [10, 12, 10, 12, 10, 12, 10], [11, 12, 11, 12, 12], [12, 7, 7, 7, 7, 7, 7, 7, 7, 7, 12, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 12, 7, 7, 7, 7, 7, 7, 7, 7, 7, 12, 7, 7, 7, 7, 7], [12, 3, 3, 3, 3, 3, 12, 3, 3, 3, 12, 3, 7, 7, 7, 7, 7, 7, 7, 7, 12], [12, 3, 3, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12], [12, 7, 12, 7, 12, 7, 12, 7, 12, 7, 12, 7, 12, 7, 12, 7, 12, 7, 7, 12, 7, 12, 7, 12, 12, 12, 12, 12, 12]]; } var EnemyStats = new Array(); _root.towerUpgradeArray = new Array(); _root.towers = Array(); adjustworth = 5; _root.AddEnemyStats(1, 'Ground Soldier', 10000, 10000, 'A', 'Normal Armor', 1, 1, 'Although varying in strength, ground soldiers are typically very vulnerable and cannot withstand any explosions. For such reasons, they usually come in greater numbers than most enemies.', 15 + adjustworth); _root.AddEnemyStats(2, 'Ground Soldier', 20000, 30000, 'B', 'Heavy Armor', 1, 3, 'Although varying in strength, these ground soldiers are moderately vulnerable and cannot withstand any explosions. Often heavily armored soldiers come in few numbers due to costly armor.', 19 + adjustworth); _root.AddEnemyStats(3, 'Ground Soldier', 40000, 50000, 'C', 'Energy Shielded Armor', 1, 5, 'Having a powerful energy shield, these ground soldiers can withstand some explosions, but are vulnerable to plasma cannons.', 20 + adjustworth); _root.AddEnemyStats(4, 'Ground Soldier', 50000, 60000, 'D', 'Energy Shielded Heavy Armor', 1, 7, 'Like other ground soldiers with energy shields, these can withstand some explosions, yet are stronger. They still have vulnerability towards plasma cannons.', 21 + adjustworth); _root.AddEnemyStats(5, 'Super Soldier', 70000, 80000, 'E', 'Super Armor', 2, 9, 'Unlike other ground soldiers, these can withstand against both explosions and plasma cannons. With this unique armor, they are like walking tanks and can bring more damage than most soldiers.', 22 + adjustworth); _root.AddEnemyStats(6, 'Enemy Transport', 120000, 130000, 'A', 'Normal Armor', 4, 11, 'Meant to carry soldiers through heavily defended areas, these vehicles are armored but not meant for much combat. They simply get soldiers through a barrage of gunfire and into where they can be most effective.', 23 + adjustworth); _root.AddEnemyStats(7, 'Enemy Transport', 140000, 180000, 'B', 'Heavy Armor', 4, 13, 'These are heavily armored versions of the vehicles soldiers use to move safely through dangerous areas. ', 24 + adjustworth); _root.AddEnemyStats(8, 'Enemy Transport', 180000, 220000, 'C', 'Energy Shielded Armor', 4, 15, 'Equipped with a powerful energy shield, these vehicles can take a lot damage. Their energy shields, however, are ineffective against plasma cannons.', 25 + adjustworth); _root.AddEnemyStats(9, 'Enemy Transport', 220000, 250000, 'D', 'Energy Shielded Heavy Armor', 4, 17, 'Possessing heavy armor and energy shields, this vehicle can withstand plasma cannon and rockets alike.', 26 + adjustworth); _root.AddEnemyStats(10, 'Super Transport', 300000, 300000, 'E', 'Super Armor', 5, 19, 'Impervious to the effects of most towers, these are more readily carrying plenty of weapons and can do much damage.', 27 + adjustworth); _root.AddEnemyStats(11, 'Tank', 330000, 340000, 'A', 'Normal Armor', 4, 21, 'Although small and with relatively weak armor, these tanks can do alot of damage if they manage to get pass your defenses.', 28 + adjustworth); _root.AddEnemyStats(12, 'Tank', 370000, 440000, 'B', 'Heavy Armor', 4, 23, 'These tanks are tough and won\'t be taken down as easily as other offensive forces due to heavy armor. ', 29 + adjustworth); _root.AddEnemyStats(13, 'Tank', 460000, 560000, 'C', 'Energy Shielded Armor', 5, 25, 'Like other enemies with energy shields, these can withstand more damage, but are vulnerable to plasma cannons. The difference now is that it\'s a tank and is stronger.', 30 + adjustworth); _root.AddEnemyStats(14, 'Tank', 650000, 700000, 'D', 'Energy Shielded Heavy Armor', 6, 27, 'A tank with both energy shields and heavy armor makes one of the hardest things to eliminate. It is nearly indestructible--and has no weaknesses.', 31 + adjustworth); _root.AddEnemyStats(15, 'Super Tank', 900000, 900000, 'E', 'Super Armor', 10, 29, 'This is by far the most dangerous tank to enter the field. Nearly unstoppable, no weaknesses, and almost twice as strong as the weakest tank--this is something to be dreaded, but loved to be defeated.', 35 + adjustworth); _root.addTower(1, 40, 10, 40, 110, 'Machine Gun', 40); _root.addUpgrade(1, 80, 0, 58, 160, 'Machine Gun v2', 120); _root.addUpgrade(1, 80, 0, 86, 310, 'Machine Gun v3', 200); _root.addTower(2, 60, 500, 48, 960, 'Plasma Cannon', 60); _root.addUpgrade(2, 120, 500, 66, 2710, 'Plasma Cannon v2', 180); _root.addUpgrade(2, 120, 400, 86, 6310, 'Plasma Cannon v3', 300); _root.addTower(3, 80, 500, 86, 970, 'Sniper [s]', 80); _root.addUpgrade(3, 150, 500, 93, 2810, 'Sniper [s] v2', 230); _root.addUpgrade(3, 200, 400, 100, 4510, 'Sniper [s] v3', 430); _root.addTower(4, 150, 1500, 86, 4760, 'Sniper [L]', 150); _root.addUpgrade(4, 150, 1000, 93, 8510, 'Sniper [L] v2', 300); _root.addUpgrade(4, 300, 500, 100, 12260, 'Sniper [L] v3', 600); _root.addTower(5, 150, 1999, 86, 6010, 'Tesla Coil', 150); _root.addUpgrade(5, 150, 1799, 86, 10010, 'Tesla Coil v2', 300); _root.addUpgrade(5, 300, 1500, 93, 18010, 'Tesla Coil v3', 600); _root.addTower(6, 400, 1999, 58, 12010, 'Rocket Launcher', 400); _root.addUpgrade(6, 800, 1000, 86, 20010, 'Rocket Launcher v2', 1200); _root.addUpgrade(6, 800, 600, 93, 20010, 'Rocket Launcher v3', 2000); _root.addTower(7, 1200, 0, 100, 100000000, 'Nuke', 1200); if (_root.continueg) { _root.continueg = false; var game = SharedObject.getLocal('Desolate-Defense_Data'); if (_root.modeChosen == 'Survival') { _root.haveDirectlyControlled = game.data.shaveDirectlyControlled; _root.haveUsedNuke = game.data.shaveUsedNuke; _root.tmessages = game.data.survivaltmessages; _root.nsold = game.data.survivalNSold; _root.menus.wcUnit1 = game.data.survivalPath1; _root.menus.wcUnit2 = game.data.survivalPath2; _root.menus.wcUnit3 = game.data.survivalPath3; _root.menus.wcUnit4 = game.data.survivalPath4; _root.currentLevel = game.data.survivalWave; _root.money = game.data.survivalSupplies; _root.efficiency = game.data.survivalEfficiency; _root.research = game.data.survivalResearch; _root.damageTaken = game.data.survivalHP; _root.imessages = game.data.survivalMessages; l = 1; while (l <= game.data.survivalTowerNumber + _root.nsold) { if (_root.tower.towerNumber == undefined) { _root.tower.towerNumber = 0; } if (game.data.survialTowersStats[l] != undefined) { _root.tower.towerNumber += 1; ++_root.totalNumberofTowers; _root.tower.duplicateMovieClip('tower' + _root.tower.towerNumber, _root.tower.getNextHighestDepth() + _root.tower.towerNumber + 1600); _root['tower' + _root.tower.towerNumber].towerNumber = _root.tower.towerNumber; _root['tower' + _root.tower.towerNumber]._x = game.data.survivalTowersX[l]; _root['tower' + _root.tower.towerNumber]._y = game.data.survivalTowersY[l]; _root['tower' + _root.tower.towerNumber].stats = game.data.survivalTowersStats[l]; _root['tower' + _root.tower.towerNumber].upgradet = game.data.survivalTowersUpgrade[l]; switch (game.data.survivalTowersUpgrade[l]) { case 0: _root['tower' + _root.tower.towerNumber].cannon.gotoAndStop('buygun' + game.data.survivalTowersStats[l][0]); _root['tower' + _root.tower.towerNumber].currentframe = 'normal'; break; case 1: _root['tower' + _root.tower.towerNumber].cannon.gotoAndStop('buygun' + game.data.survivalTowersStats[l][0] + 'u1'); _root['tower' + _root.tower.towerNumber].currentframe = 'upgrade 1'; break; case 2: _root['tower' + _root.tower.towerNumber].cannon.gotoAndStop('buygun' + game.data.survivalTowersStats[l][0] + 'u2'); _root['tower' + _root.tower.towerNumber].currentframe = 'upgrade 2'; } } ++l; } } else { if (_root.modeChosen == 'Campaign') { _root.haveDirectlyControlled = game.data.chaveDirectlyControlled; _root.haveUsedNuke = game.data.chaveUsedNuke; _root.tmessages = game.data.campaigntmessages; _root.nsold = game.data.campaignNSold; _root.menus.wcUnit1 = game.data.campaignPath1; _root.menus.wcUnit2 = game.data.campaignPath2; _root.menus.wcUnit3 = game.data.campaignPath3; _root.menus.wcUnit4 = game.data.campaignPath4; _root.theTheme = game.data.campaignTheme; _root.currentLevel = game.data.campaignWave; _root.money = game.data.campaignSupplies; _root.efficiency = game.data.campaignEfficiency; _root.research = game.data.campaignResearch; _root.damageTaken = game.data.campaignHP; _root.imessages = game.data.campaignMessages; l = 1; while (l <= game.data.campaignTowerNumber + _root.nsold) { if (_root.tower.towerNumber == undefined) { _root.tower.towerNumber = 0; } if (game.data.campaignTowersStats[l] != undefined) { _root.tower.towerNumber += 1; ++_root.totalNumberofTowers; _root.tower.duplicateMovieClip('tower' + _root.tower.towerNumber, _root.tower.getNextHighestDepth() + _root.tower.towerNumber + 1600); _root['tower' + _root.tower.towerNumber].towerNumber = _root.tower.towerNumber; _root['tower' + _root.tower.towerNumber]._x = game.data.campaignTowersX[l]; _root['tower' + _root.tower.towerNumber]._y = game.data.campaignTowersY[l]; _root['tower' + _root.tower.towerNumber].stats = game.data.campaignTowersStats[l]; _root['tower' + _root.tower.towerNumber].upgradet = game.data.campaignTowersUpgrade[l]; switch (game.data.campaignTowersUpgrade[l]) { case 0: _root['tower' + _root.tower.towerNumber].cannon.gotoAndStop('buygun' + game.data.campaignTowersStats[l][0]); _root['tower' + _root.tower.towerNumber].currentframe = 'normal'; break; case 1: _root['tower' + _root.tower.towerNumber].cannon.gotoAndStop('buygun' + game.data.campaignTowersStats[l][0] + 'u1'); _root['tower' + _root.tower.towerNumber].currentframe = 'upgrade 1'; break; case 2: _root['tower' + _root.tower.towerNumber].cannon.gotoAndStop('buygun' + game.data.campaignTowersStats[l][0] + 'u2'); _root['tower' + _root.tower.towerNumber].currentframe = 'upgrade 2'; } } ++l; } } } } if (_root.lotsomoney) { _root.money += 1200; } if (_root.skipthelevels) { _root.currentLevel = 30; } switch (theTheme) { case 2: var pathSeconds = new Array(); pathSeconds.push(0, 25, 25, 3, 2); break; case 3: var pathSeconds = new Array(); pathSeconds.push(0, 24, 24, 4, 2); break; case 4: var pathSeconds = new Array(); pathSeconds.push(0, 2, 0.5, 0.5, 0.3); break; default: var pathSeconds = new Array(); pathSeconds.push(0, 25, 25, 5, 3); } theme.gotoAndStop(_root.theTheme); _root.omoney = _root.money; _root.generateMessage('Welcome, Colonel, let\'s begin.', 'LTC Tikva R. Simmons', 1); } movieClip 368 { } movieClip 371 { } movieClip 372 { } movieClip 374 { } movieClip 377 { } movieClip 378 { } movieClip 380 { } button 381 { on (press) { _root.previousSelectedName = 'Nothing Selected'; _root.previousSelectedStats = ''; _root.previousSelectedCost = ''; _root.selectedName = 'Nothing Selected'; _root.selectedStats = ''; _root.selectedCost = ''; } } movieClip 384 { } instance range of movieClip 384 { onClipEvent (enterFrame) { if (_root.checkingRange) { this._alpha = 100; this._x = chkrangex + 10; this._y = chkrangey + 10; this._width = ttype * 6; this._height = _width; } } } button 392 { on (release) { _root.gamePaused = true; _root.pauseMenu.gotoAndStop(9); } } button 396 { on (release) { _root.gamePaused = true; _root.pauseMenu.gotoAndStop(6); } } button 401 { on (release) { _root.returnToMenu(); } } button 402 { on (release) { _root.gamePaused = true; _root.pauseMenu.gotoAndStop(3); } } button 403 { on (release) { _root.gamePaused = true; _root.pauseMenu.gotoAndStop(5); } } button 404 { on (release) { _root.gamePaused = true; _root.pauseMenu.gotoAndStop(4); } } movieClip 408 { } button 414 { on (release) { _root.upgrade(); } on (rollOver) { _root.showStats('upgrade'); } on (rollOut) { _root.showStats('neutral'); } } // unknown tag 88 length 59 button 421 { on (release) { _root.sell(); } } button 424 { on (release) { _root.towerPurchased('buygun1'); _root.showStats('buygun1'); } on (rollOver) { _root.showStats('buygun1'); } on (rollOut) { _root.showStats('neutral'); } } button 425 { on (release) { _root.towerPurchased('buygun2'); _root.showStats('buygun2'); } on (rollOver) { _root.showStats('buygun2'); } on (rollOut) { _root.showStats('neutral'); } } button 426 { on (release) { _root.towerPurchased('buygun3'); _root.showStats('buygun3'); } on (rollOver) { _root.showStats('buygun3'); } on (rollOut) { _root.showStats('neutral'); } } button 427 { on (release) { _root.towerPurchased('buygun4'); _root.showStats('buygun4'); } on (rollOver) { _root.showStats('buygun4'); } on (rollOut) { _root.showStats('neutral'); } } button 428 { on (release) { _root.towerPurchased('buygun5'); _root.showStats('buygun5'); } on (rollOver) { _root.showStats('buygun5'); } on (rollOut) { _root.showStats('neutral'); } } button 429 { on (release) { _root.towerPurchased('buygun6'); _root.showStats('buygun6'); } on (rollOver) { _root.showStats('buygun6'); } on (rollOut) { _root.showStats('neutral'); } } button 430 { on (release) { _root.explode(); } on (rollOver) { _root.showStats('buygun7'); } on (rollOut) { _root.showStats('neutral'); } } button 431 { on (release) { _root.explode(); } on (rollOver) { _root.showStats('buygun7'); } on (rollOut) { _root.showStats('neutral'); } } button 433 { on (release) { _root.towerPurchased('buygun6'); _root.showStats('buygun6'); } on (rollOver) { _root.showStats('buygun6'); } on (rollOut) { _root.showStats('neutral'); } } button 435 { on (release) { _root.towerPurchased('buygun5'); _root.showStats('buygun5'); } on (rollOver) { _root.showStats('buygun5'); } on (rollOut) { _root.showStats('neutral'); } } button 437 { on (release) { _root.towerPurchased('buygun4'); _root.showStats('buygun4'); } on (rollOver) { _root.showStats('buygun4'); } on (rollOut) { _root.showStats('neutral'); } } button 439 { on (release) { _root.towerPurchased('buygun3'); _root.showStats('buygun3'); } on (rollOver) { _root.showStats('buygun3'); } on (rollOut) { _root.showStats('neutral'); } } button 441 { on (release) { _root.towerPurchased('buygun2'); _root.showStats('buygun2'); } on (rollOver) { _root.showStats('buygun2'); } on (rollOut) { _root.showStats('neutral'); } } button 443 { on (release) { _root.towerPurchased('buygun1'); _root.showStats('buygun1'); } on (rollOver) { _root.showStats('buygun1'); } on (rollOut) { _root.showStats('neutral'); } } movieClip 445 { frame 1 { stop(); } frame 1 { stop(); } } movieClip 447 { instance of movieClip 445 { onClipEvent (enterFrame) { if (_root.canSetObject) { _parent.error_box1.text = 'ESC to Cancel'; gotoAndStop(8); } else { if (_root.totalNumberofTowers >= 10) { _parent.error_box1.text = 'Too Many Towers'; gotoAndStop(8); } else { _parent.error_box1.text = ''; assumedAffordibility = 1; i = 0; while (i < 7) { if (_root.money < _root.towers['buygun' + (i + 1)][1]) { assumedAffordibility = 9 - (i + 1); break; } ++i; } if (_root.modeChosen == 'Challenges' && assumedAffordibility == 1) { gotoAndStop(2); } else { gotoAndStop(assumedAffordibility); } } } } } } movieClip 463 { frame 1 { stop(); startBtn.onRelease = function () { _root.nextLevel(); _root.omoney = _root.money; _root.saveTheGame(); }; } frame 2 { stop(); nextLevelBtn.onRelease = function () { _root.nextLevel(); _root.omoney = _root.money; _root.saveTheGame(); }; } frame 3 { stop(); } } button 470 { on (release) { if (_root.money >= 20 && _root.research <= 0.6) { _root.money -= 20; _root.research += 0.02; } } } movieClip 473 { instance of movieClip 463 { onClipEvent (enterFrame) { if (!_root.levelisStarted) { if (_root.currentLevel == 1) { gotoAndStop(1); } else { gotoAndStop(2); } } else { gotoAndStop(3); } } } instance pausebtn2 of movieClip 165 { onClipEvent (enterFrame) { if (_root.musicIsPlaying && !notpaused) { this.gotoAndStop(1); notpaused = true; } else { if (!_root.musicIsPlaying) { this.gotoAndStop(2); notpaused = false; } } } } instance vba of movieClip 190 { onClipEvent (load) { gotoAndStop(Math.ceil(_root.music.getVolume() / 10)); } } } instance menus of movieClip 473 { onClipEvent (enterFrame) { if (!_root.levelisStarted) { if (!_root.waveDecided[_root.currentLevel]) { _quality = 'HIGH'; _quality = 'autohigh'; healthlost = _root.damageTaken - hplasttime; if (_root.currentLevel > 1) { _root.saveTheGame(); } if (_root.modeChosen == 'Campaign') { switch (_root.currentLevel) { case 5: _root.movie.gotoAndStop(5); break; case 15: _root.movie.gotoAndStop(6); break; case 20: _root.movie.gotoAndStop(7); } } if (_root.currentLevel == 2 && _root.damageTaken == 0) { _root.generateMessage('Very easy... so far.', 'LTC Tikva R. Simmons', 1); } else { if (_root.currentLevel == 2) { _root.generateMessage('Not so great a start... ', 'LTC Tikva R. Simmons', 1); } } var possibleMessages = new Array(); if (_root.currentLevel > 2) { switch (healthlost) { case 0: possibleMessages.push('Great job.'); possibleMessages.push('Keep up the good work.'); possibleMessages.push('Not Bad'); possibleMessages.push('You\'re doing great.'); possibleMessages.push('Not a single one made it through.'); possibleMessages.push('That was kinda easy.'); possibleMessages.push('I\'m impressed.'); possibleMessages.push('That wasn\'t so bad.'); possibleMessages.push('Almost too easy.'); possibleMessages.push('Don\'t get too self-confident.'); possibleMessages.push('Excellent.'); possibleMessages.push('It wasn\'t much of a challenge.'); possibleMessages.push('None made it.'); possibleMessages.push('Fatality Rate: 100%'); possibleMessages.push('Not hard at all.'); possibleMessages.push('Good work.'); possibleMessages.push('Keep it up.'); possibleMessages.push('Nice job.'); possibleMessages.push('Can\'t get easier.'); possibleMessages.push('Good job.'); possibleMessages.push('That was easy.'); break; case 1: possibleMessages.push('Only one made it through.'); possibleMessages.push('Not so bad'); possibleMessages.push('Not bad, but could be better.'); possibleMessages.push('That\'s kinda annoying.'); possibleMessages.push('Almost perfect'); possibleMessages.push('You\'re doing good.'); break; case 2: possibleMessages.push('Decent, but you can do better.'); possibleMessages.push('Satisfactory'); possibleMessages.push('Adequate work.'); possibleMessages.push('Fairly easy.'); possibleMessages.push('That wasn\'t too much of a challenge.'); possibleMessages.push('Almost perfect'); possibleMessages.push('You\'re doing good.'); break; case 3: possibleMessages.push('Not too bad.'); break; case 4: possibleMessages.push('Not so great.'); break; case 5: possibleMessages.push('Not very good.'); possibleMessages.push('Try better next time'); break; case 6: possibleMessages.push('You can do better.'); possibleMessages.push('That wasn\'t so good.'); break; case 7: possibleMessages.push('Not good.'); break; case 8: possibleMessages.push('You need to do better.'); break; case 9: possibleMessages.push('Hang in there.'); possibleMessages.push('There\'s a lot of damage.'); break; case 10: possibleMessages.push('Do better next time.'); possibleMessages.push('Not so good'); break; case 11: possibleMessages.push('Don\'t give up yet.'); break; case 12: possibleMessages.push('You need to come up with some sort of plan.'); break; case 13: possibleMessages.push('Does it get much worse?'); break; case 14: possibleMessages.push('That was a massacre.'); break; case 15: possibleMessages.push('Do you know what you\'re doing.'); break; case 16: possibleMessages.push('We\'re in trouble.'); break; case 17: possibleMessages.push('You need to do something.'); break; case 18: possibleMessages.push('We\'re getting slaughtered.'); break; default: possibleMessages.push('Wow, you suck... No offense.'); possibleMessages.push('What part of this don\'t you understand?'); possibleMessages.push('Why is it so hard for you?'); possibleMessages.push('That was horrible.'); possibleMessages.push('What\'s so hard about this?'); possibleMessages.push('If you don\'t start doing better, I\'m taking over.'); possibleMessages.push('It doesn\'t get any worse than that. I hope.'); } if (healthlost >= 19) { possibleMessages.push('Wow, you suck... No offense.'); possibleMessages.push('What part of this don\'t you understand?'); possibleMessages.push('Why is it so hard for you?'); possibleMessages.push('That was horrible.'); possibleMessages.push('What\'s so hard about this?'); possibleMessages.push('If you don\'t start doing better, I\'m taking over.'); possibleMessages.push('It doesn\'t get any worse than that. I hope.'); } messageChosen = '' + possibleMessages[Math.round(Math.random() * possibleMessages.length)]; if (hplasttime != undefined && messageChosen != undefined && messageChosen != 'undefined') { _root.generateMessage(messageChosen, 'LTC Tikva R. Simmons', 1); } } _root.refreshEnemies(_root.currentLevel); hplasttime = _root.damageTaken; _root.efficiency += _root.research / 100; if (_root.currentLevel < 41) { _root.skillLevel = (_root.damageTaken - _root.currentLevel) * -1 + 100; } _root.waveDecided[_root.currentLevel] = true; if (_root.currentLevel < 15) { if (_root.currentLevel < 13) { var enemyTypeRange = Math.floor(_root.currentLevel / 1); } else { if (_root.currentLevel < 20) { var enemyTypeRange = Math.floor(_root.currentLevel / 1); } else { var enemyTypeRange = 14; } } } else { if (_root.currentLevel > 15) { var enemyTypeRange = 15; } } if (_root.modeChosen == 'Challenges') { var enemyTypeRange = 15; switch (_root.cchallenge) { break; case 1: break; case 2: case 3: break; break; case 4: break; case 5: case 6: break; case 7: break; case 8: } } else { if (_root.currentLevel == 1) { var enemyTypeRange = 1; } } var availableTypes = Math.ceil(enemyTypeRange / 5); var waveArray = new Array(); i = 1; while (i <= 4) { if (this['wcUnit' + i] == undefined) { this['wcUnit' + i] = 1; } _root.totalTowerForce = 0; _root.worthofTowers = 0; k = 0; while (k < _root.totalNumberofTowers + _root.nsold) { if (_root['tower' + k].stats != undefined && _root['tower' + k].stats[4] >= 1000) { _root.worthofTowers += _root['tower' + k].stats[6]; } else { if (_root['tower' + k].stats != undefined) { _root.worthofTowers += _root['tower' + k].stats[6]; } } ++k; } if (_root.theTheme == 4) { if (_root.currentLevel >= 30) { difficultyCurve2 = (6 + Math.round(_root.currentLevel / 1.5)) * _root.skillLevel; } else { if (_root.currentLevel >= 16) { difficultyCurve2 = (5 + Math.round(_root.currentLevel / 2)) * (_root.skillLevel / 4); } else { if (_root.currentLevel >= 6) { difficultyCurve2 = (1.2 + Math.round(_root.currentLevel / 5)) * (_root.skillLevel / 8); } else { if (_root.currentLevel >= 4) { difficultyCurve2 = (1.4 + Math.round(_root.currentLevel / 5)) * (_root.skillLevel / 8); } else { difficultyCurve2 = (1 + Math.round(_root.currentLevel / 6)) * (_root.skillLevel / 10); } } } } } else { if (_root.currentLevel >= 20) { difficultyCurve2 = (15 + Math.round(_root.currentLevel / 1.1)) * (_root.skillLevel / 2); } else { if (_root.currentLevel >= 16) { difficultyCurve2 = (10 + Math.round(_root.currentLevel / 1.3)) * (_root.skillLevel / 2); } else { if (_root.currentLevel >= 12) { difficultyCurve2 = (17 + Math.round(_root.currentLevel / 1.1)) * (_root.skillLevel / 3); } else { if (_root.currentLevel >= 7) { difficultyCurve2 = (15 + Math.round(_root.currentLevel / 1.3)) * (_root.skillLevel / 2); } else { difficultyCurve2 = _root.skillLevel - _root.currentLevel * 2 + 50; } } } } } difficultyCurve = -100; _root.worthofTowers *= 30; _root.totalTowerForce += _root.money * 30 + _root.worthofTowers; if (Math.round((_root.totalTowerForce * _root.pathSeconds[i] + difficultyCurve2) / (_root.EnemyStats[enemyTypeRange][3] + difficultyCurve) * 4) > this['wcUnit' + i]) { this['wcUnit' + i] = Math.round(_root.totalTowerForce * _root.pathSeconds[i] / (_root.EnemyStats[enemyTypeRange][3] + difficultyCurve) * 4); } if (_root.theTheme == 4 && this['wcUnit' + i] < 3) { this['wcUnit' + i] = 3; } if (_root.theTheme != 4) { if (_root.currentLevel < 7 && (i == 4 || i == 3)) { this['wcUnit' + i] = 0; } } switch (availableTypes) { case 1: j = 0; while (j < this['wcUnit' + i]) { waveArray.push([i, enemyTypeRange, 2000]); ++j; } break; case 2: if (this['wcUnit' + i] > 1 && i == 1) { var wcuForTypes = new Array(); var wcuConversion = new Array(); wcuForTypes[1] = 1; wcuForTypes[2] = this['wcUnit' + i] - 1; wcuConversion[1] = Math.ceil(_root.EnemyStats[enemyTypeRange][3] * wcuForTypes[1] / _root.EnemyStats[5][3]); j = 0; while (j < wcuForTypes[2]) { waveArray.push([i, enemyTypeRange, 4000]); ++j; } j = 0; while (j < wcuConversion[1]) { waveArray.push([i, 5, 2000]); ++j; } } else { if (!(_root.currentLevel < 8 && (i == 4 || i == 3))) { var wcuForTypes = new Array(); var wcuConversion = new Array(); wcuForTypes[1] = 1; wcuConversion[1] = Math.ceil(_root.EnemyStats[enemyTypeRange][3] * wcuForTypes[1] / _root.EnemyStats[5][3]); j = 0; while (j < wcuConversion[1]) { waveArray.push([i, 5, 2000]); ++j; } } } break; case 3: if ((this['wcUnit' + i] > 2 || _root.modeChosen == 'Challenges' && _root.cchallenge == 1) && i == 1) { var wcuForTypes = new Array(); var wcuConversion = new Array(); wcuForTypes[1] = 1; wcuConversion[1] = Math.ceil(_root.EnemyStats[enemyTypeRange][3] * wcuForTypes[1] / _root.EnemyStats[5][3]); wcuForTypes[2] = 1; wcuConversion[2] = Math.ceil(_root.EnemyStats[enemyTypeRange][3] * wcuForTypes[2] / _root.EnemyStats[10][3]); wcuForTypes[3] = this['wcUnit' + i] - 2; j = 0; while (j < wcuForTypes[3]) { waveArray.push([i, enemyTypeRange, 4000]); ++j; } if (_root.currentLevel <= 20) { if (wcuConversion[1] < 16) { j = 0; while (j < wcuConversion[1]) { waveArray.push([i, 5, 2000]); ++j; } } else { j = 0; while (j < 16) { waveArray.push([i, 5, 2000]); ++j; } } } else { if (_root.currentLevel <= 25) { waveArray.push([i, 5, 2000]); waveArray.push([i, 5, 2000]); waveArray.push([i, 5, 2000]); waveArray.push([i, 5, 2000]); waveArray.push([i, 10, 4000]); waveArray.push([i, enemyTypeRange, 4000]); } else { waveArray.push([i, 5, 2000]); waveArray.push([i, 5, 2000]); waveArray.push([i, 5, 2000]); waveArray.push([i, 5, 2000]); waveArray.push([i, 10, 4000]); waveArray.push([i, 10, 4000]); waveArray.push([i, 10, 4000]); kl = 0; while (kl < (_root.currentLevel - 25) * 2) { waveArray.push([i, enemyTypeRange, 4000]); ++kl; } } } j = 0; while (j < wcuConversion[2]) { waveArray.push([i, 10, 4000]); ++j; } } else { if (this['wcUnit' + i] > 1 && i == 1) { var wcuForTypes = new Array(); var wcuConversion = new Array(); wcuForTypes[1] = 1; wcuConversion[1] = Math.ceil(_root.EnemyStats[enemyTypeRange][3] * wcuForTypes[1] / _root.EnemyStats[5][3]); wcuForTypes[2] = 1; wcuConversion[2] = Math.ceil(_root.EnemyStats[enemyTypeRange][3] * wcuForTypes[2] / _root.EnemyStats[10][3]); j = 0; while (j < wcuConversion[1]) { waveArray.push([i, 5, 2000]); ++j; } j = 0; while (j < wcuConversion[2]) { waveArray.push([i, 10, 4000]); ++j; } } else { if (!(_root.currentLevel < 8 && (i == 4 || i == 3))) { var wcuForTypes = new Array(); var wcuConversion = new Array(); wcuForTypes[1] = 1; wcuConversion[1] = Math.ceil(_root.EnemyStats[enemyTypeRange][3] * wcuForTypes[1] / _root.EnemyStats[5][3]); j = 0; while (j < wcuConversion[1]) { waveArray.push([i, 5, 2000]); ++j; } } } } } ++i; } ra = function () { return random(2) * 2 - 1; }; waveArray.sort(ra); if (_root.currentLevel == 15) { var waveArray = [[1, 15, 3000], [1, 15, 3000], [1, 15, 3000]]; } else { if (_root.currentLevel == 30) { var waveArray = [[1, 15, 3000], [1, 15, 3000], [1, 15, 3000], [1, 15, 3000], [1, 15, 3000], [1, 15, 3000], [1, 15, 3000]]; } } _root.TD_Levels[_root.currentLevel - 1] = waveArray; } } _root.songNowPlaying = _root.SoundArray[_root.songID][0]; if (_root.damageTaken >= 100) { _root.damageTaken = 100; _root.gotoAndStop('gameover'); } ID = _root.songID; if (smessage != _root.smessage) { smessage += _root.smessage.charAt(cnumber); cnumber += 1; } _root.wavenumber = 'Wave ' + _root.currentLevel; this.stat_box.text = '' + Math.round(_root.money) + '\n' + '' + Math.round(_root.efficiency * 100) + '%' + '\n' + '' + _root.research + '%' + '\n' + '' + (100 - _root.damageTaken) + '%'; } onClipEvent (load) { this.swapDepths(this.getNextHighestDepth() + 30302); frame = _root._currentframe; } onClipEvent (enterFrame) { if (_root._currentframe > frame || _root._currentframe < frame) { this.removeMovieClip(this); } } } movieClip 475 { } movieClip 478 { frame 2 { stop(); } } instance setBox of movieClip 478 { onClipEvent (load) { var x = this._x; var y = this._y; var leftSide = this._x - 5.8; var rightSide = this._x + 5.8; var top = this._y - 5.7; var bottom = this._y + 5.7; var overMouse = false; } onClipEvent (enterFrame) { if (_root.canSetObject) { if (Key.isDown(27)) { _root.cancelbuy(); } _parent.range._x = this._x; _parent.range._y = this._y; while (!overMouse) { _parent.range._alpha = 100; _parent.range._width = _root.towerUpgradeArray[_root.towers[_root.objectBeingSet][0] - 1][0][3] * 6; if (_root._xmouse < leftSide) { x -= 11.6; leftSide -= 11.6; rightSide -= 11.6; } if (_root._xmouse > rightSide) { x += 11.6; rightSide += 11.6; leftSide += 11.6; } if (_root._ymouse < top) { y -= 11.4; top -= 11.4; bottom -= 11.4; } if (_root._ymouse > bottom) { y += 11.4; bottom += 11.4; top += 11.4; } _parent.range._height = _parent.range._width; if (_root._xmouse > leftSide && _root._xmouse < rightSide && _root._ymouse > top && _root._ymouse < bottom) { var overMouse = true; } } this._x = x; this._y = y; var overMouse = false; if (_root.theme.other.hitTest(this._x, this._y, true)) { this.gotoAndStop(3); setBackTo = false; } else { if (_root.theme.path.hitTest(this._x, this._y, true)) { this.gotoAndStop(2); setBackTo = false; } else { if (!setBackTo) { setBackTo = true; this.gotoAndStop(1); } } } } else { if (!_root.checkingRange) { _parent.range._alpha = 0; } this.gotoAndStop(3); } } } movieClip 539 { frame 1 { stop(); } frame 2 { _root.playSFX(2); } frame 6 { _root.playSFX(2); } frame 8 { gotoAndStop(1); _root[_root.directControlled].shooting = false; } frame 10 { _root.playSFX(2); } frame 14 { _root.playSFX(2); } frame 16 { gotoAndStop(9); _root[_root.directControlled].shooting = false; } frame 18 { _root.playSFX(2); } frame 20 { _root.playSFX(2); } frame 22 { _root.playSFX(2); } frame 24 { gotoAndStop(17); _root[_root.directControlled].shooting = false; _root.playSFX(2); } frame 26 { _root.playSFX(3); } frame 32 { gotoAndStop(25); _root[_root.directControlled].shooting = false; } frame 34 { _root.playSFX(3); } frame 40 { gotoAndStop(33); _root[_root.directControlled].shooting = false; } frame 42 { _root.playSFX(3); } frame 48 { gotoAndStop(41); _root[_root.directControlled].shooting = false; } frame 49 { stop(); } frame 50 { _root.playSFX(4); } frame 56 { gotoAndStop(49); _root[_root.directControlled].shooting = false; } frame 58 { _root.playSFX(4); } frame 64 { gotoAndStop(57); _root[_root.directControlled].shooting = false; } frame 66 { _root.playSFX(4); } frame 72 { gotoAndStop(65); _root[_root.directControlled].shooting = false; } frame 73 { stop(); } frame 74 { _root.playSFX(4); } frame 80 { gotoAndStop(73); _root[_root.directControlled].shooting = false; } frame 82 { _root.playSFX(4); } frame 88 { gotoAndStop(81); _root[_root.directControlled].shooting = false; } frame 90 { _root.playSFX(4); } frame 96 { gotoAndStop(89); _root[_root.directControlled].shooting = false; } frame 97 { stop(); } frame 98 { _root.playSFX(6); } frame 101 { gotoAndStop(97); _root[_root.directControlled].shooting = false; } frame 103 { _root.playSFX(6); } frame 106 { gotoAndStop(102); _root[_root.directControlled].shooting = false; } frame 108 { _root.playSFX(6); } frame 111 { gotoAndStop(107); _root[_root.directControlled].shooting = false; } frame 112 { stop(); } frame 113 { _root.playSFX(7); } frame 121 { } frame 122 { gotoAndStop(112); _root[_root.directControlled].shooting = false; } frame 124 { _root.playSFX(7); } frame 132 { } frame 133 { gotoAndStop(123); _root[_root.directControlled].shooting = false; } frame 135 { _root.playSFX(7); } frame 143 { } frame 144 { gotoAndStop(134); _root[_root.directControlled].shooting = false; } frame 145 { stop(); } } button 540 { on (press) { if (_name == 'buygun1' || _name == 'buygun2' || _name == 'buygun3' || _name == 'buygun4' || _name == 'buygun5' || _name == 'buygun6') { } else { if (_name != 'buygun7') { pressed = getTimer(); } else {} } } on (release) { if (_name == 'buygun1' || _name == 'buygun2' || _name == 'buygun3' || _name == 'buygun4' || _name == 'buygun5' || _name == 'buygun6') { _root.towerPurchased(this._name); } else { if (_name != 'buygun7') { _root.selectTower(this._name); if (getTimer() - pressed > 500) { _root.switchToDirectControl(this._name); } } else { _root.explode(); } } _root.showStats(_name); } on (rollOver) { if (_name == 'buygun1' || _name == 'buygun2' || _name == 'buygun3' || _name == 'buygun4' || _name == 'buygun5' || _name == 'buygun6' || _name == 'buygun7') { _root.showStats(_name); } else { _root.range.chkrangex = _x; _root.range.chkrangey = _y; _root.checkingRange = true; _root.range.ttype = stats[3]; } } on (rollOut) { _root.checkingRange = false; _root.showStats('neutral'); } } movieClip 541 { frame 1 { stop(); } instance cannon of movieClip 539 { onClipEvent (load) { startTime = getTimer(); } onClipEvent (enterFrame) { if (getTimer() - startTime > 100 && (_parent.targeted == undefined || !_parent.target)) { this._rotation += 3; } } } } instance tower of movieClip 541 { onClipEvent (load) { } onClipEvent (load) { var startTime = 0; var delayDuplicate = 1000; framenumber = _root._currentframe; stop(); stillShooting = false; if (_name == 'tower') { if (towerNumber == undefined) { towerNumber = 0; } } } onClipEvent (enterFrame) { if (!_root.gamePaused) { if (_root.canSetObject) { this.gotoAndStop(2); if (_root.setBox.hitTest(this._x + 10.5, this._y + 10, true)) { _root.setBox.gotoAndStop(2); setBackTo = false; } else { if (!setBackTo) { _root.setBox.setBackTo = false; setBackTo = true; } } } else { this.gotoAndStop(1); } if (_root._currentframe != framenumber) { this.removeMovieClip(this); } if (this._name != 'tower') { if (!_root.levelisStarted) { target = false; } if (directControlled) { if (_root.directControlled != this._name) { Mouse.removeListener(shoot); Mouse.removeListener(shoot2); directControlled = false; stoplistening = false; } var angle_in_radians = Math.atan2(_root._ymouse - this._y - 10, _root._xmouse - this._x - 10); var angle_in_degrees = Math.round(angle_in_radians * 180 / Math.PI); this.cannon._rotation = angle_in_degrees + 90; var currentTime = Math.round(getTimer() - startTime); var delayDuplicate = stats[2]; if (currentTime >= delayDuplicate) { _root.cursor_mc.gotoAndStop(2); } if (_root[_root.directControlled].stillShooting && !_root[_root.directControlled].notautomatic) { _root[_root.directControlled].cannon.play(); } else { if (_root[_root.directControlled].stillShooting && currentTime >= delayDuplicate) { _root[_root.directControlled].cannon.play(); _root[_root.directControlled].shooting = true; startTime = getTimer(); } } if (!stoplistening) { stoplistening = true; var shoot = new Object(); var shoot2 = new Object(); shoot.onMouseDown = function () { if (!_root[_root.directControlled].shooting) { if (startTime == undefined) { startTime = _root[_root.directControlled].startTime; } var v3 = Math.round(getTimer() - startTime); var v2 = _root[_root.directControlled].stats[2]; if (v3 >= v2 || _root[_root.directControlled].stats[0] == 1) { if (directControlled) { _root[_root.directControlled].cannon.play(); _root[_root.directControlled].shooting = true; _root.cursor_mc.gotoAndStop(4); startTime = getTimer(); } } } if (_root[_root.directControlled].stats[2] < 20) { _root[_root.directControlled].stillShooting = true; _root[_root.directControlled].notautomatic = false; } if (_root[_root.directControlled].stats[2] < 501) { _root[_root.directControlled].stillShooting = true; _root[_root.directControlled].notautomatic = true; } }; shoot2.onMouseUp = function () { _root[_root.directControlled].stillShooting = false; }; Mouse.addListener(shoot2); Mouse.addListener(shoot); } } else { shooting = false; if (!target) { if (_root.enemy0.inLevel > 0) { enemySpotted = false; selectedEnemy = undefined; i = 1; while (i <= _root.enemy0.inLevelTotal) { distance = Math.round(Math.sqrt((_root['enemy' + (i + _root.enemy0.originalNumber)]._y - this._y) * (_root['enemy' + (i + _root.enemy0.originalNumber)]._y - this._y) + (_root['enemy' + (i + _root.enemy0.originalNumber)]._x - this._x) * (_root['enemy' + (i + _root.enemy0.originalNumber)]._x - this._x))); if (selectedEnemy == undefined) { if (distance <= stats[3] * 3.5 && !isNaN(distance)) { selectedEnemy = 'enemy' + (i + _root.enemy0.originalNumber); } } if (selectedEnemy != undefined) { enemySpotted = true; } inRange = 0; if (distance <= stats[3] * 3.5 && !isNaN(distance)) { ++inRange; } if (inRange >= 1) { switch (_root.strategy[0]) { case 1: if (distance <= Math.round(Math.sqrt((_root[selectedEnemy]._y - this._y) * (_root[selectedEnemy]._y - this._y) + (_root[selectedEnemy]._x - this._x) * (_root[selectedEnemy]._x - this._x)))) { if (_root.strategy[2] == 0 && _root['enemy' + (i + _root.enemy0.originalNumber)].health <= _root[selectedEnemy].health || _root.strategy[2] == 1 && _root['enemy' + (i + _root.enemy0.originalNumber)].health >= _root[selectedEnemy].health) { enemySpotted = true; selectedEnemy = 'enemy' + (i + _root.enemy0.originalNumber); } } break; case 0: if (distance >= Math.round(Math.sqrt((_root[selectedEnemy]._y - this._y) * (_root[selectedEnemy]._y - this._y) + (_root[selectedEnemy]._x - this._x) * (_root[selectedEnemy]._x - this._x)))) { if (_root.strategy[2] == 0 && _root['enemy' + (i + _root.enemy0.originalNumber)].health <= _root[selectedEnemy].health || _root.strategy[2] == 1 && _root['enemy' + (i + _root.enemy0.originalNumber)].health >= _root[selectedEnemy].health) { enemySpotted = true; selectedEnemy = 'enemy' + (i + _root.enemy0.originalNumber); } } } } else {} ++i; } distance = Math.round(Math.sqrt((_root[selectedEnemy]._y - this._y) * (_root[selectedEnemy]._y - this._y) + (_root[selectedEnemy]._x - this._x) * (_root[selectedEnemy]._x - this._x))); if (distance <= stats[3] * 3.25 && !isNaN(distance)) { } else { enemySpotted = false; } if (enemySpotted) { target = true; targeted = selectedEnemy; } if (target == true) { } } } else { distance = Math.round(Math.sqrt((_root[targeted]._y - this._y) * (_root[targeted]._y - this._y) + (_root[targeted]._x - this._x) * (_root[targeted]._x - this._x))); if (_root.strategy[0] == 0 && distance > stats[3] * 3) { inRange = 0; j = 1; while (j <= _root.enemy0.inLevelTotal) { distance = Math.round(Math.sqrt((_root['enemy' + (j + _root.enemy0.originalNumber)]._y - this._y) * (_root['enemy' + (j + _root.enemy0.originalNumber)]._y - this._y) + (_root['enemy' + (j + _root.enemy0.originalNumber)]._x - this._x) * (_root['enemy' + (j + _root.enemy0.originalNumber)]._x - this._x))); if (distance <= stats[3] * 3.25 && !isNaN(distance)) { ++inRange; } ++j; } if (inRange > 0) { target = false; } } var angle_in_radians = Math.atan2(_root[targeted]._y - this._y - 10, _root[targeted]._x - this._x - 10); var angle_in_degrees = Math.round(angle_in_radians * 180 / Math.PI); this.cannon._rotation = angle_in_degrees + 90; var currentTime = Math.round(getTimer() - startTime); var delayDuplicate = stats[2]; if (currentTime >= delayDuplicate && !isNaN(stats[4])) { var startTime = getTimer(); this.cannon.play(); if (distance <= stats[3] * 0.25) { if (stats[0] == 2 && (_root.EnemyStats[_root[targeted].enemyType][5] == 'Energy Shielded Armor' || _root.EnemyStats[_root[targeted].enemyType][5] == 'Energy Shielded Heavy Armor')) { _root[targeted].health -= Math.round(stats[4] / 2) * 1.2; } else { _root[targeted].health -= Math.round(stats[4] / 2); } if (stats[0] == 6 && (_root[targeted].enemyType <= 5 && _root[targeted].enemyType != 4 && _root[targeted].enemyType != 3)) { _root[targeted].health -= Math.round(stats[4] / 4); } } else { target = false; if (stats[0] == 2 && (_root.EnemyStats[_root[targeted].enemyType][5] == 'Energy Shielded Armor' || _root.EnemyStats[_root[targeted].enemyType][5] == 'Energy Shielded Heavy Armor')) { _root[targeted].health -= stats[4] * 1.2; } else { _root[targeted].health -= stats[4]; } if (stats[0] == 6 && (_root[targeted].enemyType <= 5 && _root[targeted].enemyType != 4 && _root[targeted].enemyType != 3)) { _root[targeted].health -= Math.round(stats[4] / 2); } } } if (_root[targeted].health == undefined) { target = false; } } } } } } } movieClip 559 { frame 1 { stop(); } } instance enemy0 of movieClip 559 { onClipEvent (load) { rotateonce = true; level1 = _root.currentLevel; speed = 1; health = 1000; this.gotoAndStop(_root.EnemyStats[enemyType][7]); health = Math.round(Math.random() * (_root.EnemyStats[enemyType][3] - _root.EnemyStats[enemyType][2]) + _root.EnemyStats[enemyType][2]); ohealth = health; inLevel = 0; duplicatedn = 0; originalNumber = 0; this._x = 309 + (this._width + this._height) / 4 + Math.round(Math.random() * (35 - (this._width + this._height) / 2)); middlepath = 325; startx = this._x; starty = this._y; changex = 0; changey = speed; checkPath = 'y'; checkPath2 = checkPath; currentPath = 0; switch (_root.theTheme) { case 2: switch (theSetPath) { case 1: difference1 = this._x - middlepath; difference2 = middlepath - this._x; if (enemyType > 5) { this._x = middlepath; } var paths = new Array([this._x, 'down'], [67.5, 'right'], [505.3, 'down'], [202.5, 'left'], [235.3, 'up'], [67.5, 'left'], [55.3, 'down'], [292.5, 'right'], [325.3, 'down'], [650, 'down']); break; case 2: changex = -speed; changey = 0; this._rotation = 90; checkPath = 'x'; this._x = 680; middlepath = 68; this._y = 49 + (this._width + this._height) / 4 + Math.round(Math.random() * (35 - (this._width + this._height) / 2)); if (enemyType > 5) { this._y = middlepath; } difference1 = this._y - middlepath; difference2 = middlepath - this._y; var paths = new Array([this._x, 'left'], [505.3, 'down'], [202.5, 'left'], [235.3, 'up'], [67.5, 'left'], [55.3, 'down'], [292.5, 'right'], [325.3, 'down'], [650, 'down']); break; case 3: changex = speed; changey = 0; this._rotation = -90; checkPath = 'x'; this._x = -30; middlepath = 158; this._y = 138 + (this._width + this._height) / 4 + Math.round(Math.random() * (35 - (this._width + this._height) / 2)); if (enemyType > 5) { this._y = middlepath; } difference2 = middlepath - this._y; difference1 = this._y - middlepath; var paths = new Array([this._y, 'right'], [55, 'down'], [292.5, 'right'], [325.3, 'down'], [650, 'down']); break; case 4: changex = -speed; changey = 0; this._rotation = 90; checkPath = 'x'; this._x = 680; middlepath = 293; this._y = 275 + (this._width + this._height) / 4 + Math.round(Math.random() * (35 - (this._width + this._height) / 2)); if (enemyType > 5) { this._y = middlepath; } difference1 = this._y - middlepath; difference2 = middlepath - this._y; var paths = new Array([this._x, 'left'], [325, 'down'], [650, 'down']); break; default: if (enemyType > 5) { this._x = middlepath; } difference1 = this._x - middlepath; difference2 = middlepath - this._x; var paths = new Array([this._x, 'down'], [67.5, 'right'], [505.3, 'down'], [202.5, 'left'], [235.3, 'up'], [67.5, 'left'], [55.3, 'down'], [292.5, 'right'], [325.3, 'down'], [650, 'down']); } break; case 3: switch (theSetPath) { case 1: if (enemyType > 5) { this._x = middlepath; } difference1 = this._x - middlepath; difference2 = middlepath - this._x; var paths = new Array([this._x, 'down'], [113, 'left'], [190, 'down'], [202.5, 'right'], [460, 'down'], [293, 'left'], [325, 'down'], [650, 'down']); break; case 2: this._x = 172 + (this._width + this._height) / 2 + Math.round(Math.random() * (41 - (this._width + this._height))); middlepath = 192; if (enemyType > 5) { this._x = middlepath; } difference1 = this._x - middlepath; difference2 = middlepath - this._x; var paths = new Array([this._x, 'down'], [202.5, 'right'], [460, 'down'], [293, 'left'], [325, 'down'], [650, 'down']); break; case 3: changex = speed; changey = 0; this._rotation = -90; checkPath = 'x'; this._x = -30; this._y = 139 + (this._width + this._height) / 2 + Math.round(Math.random() * (41 - (this._width + this._height))); middlepath = 159; if (enemyType > 5) { this._y = middlepath; } difference1 = this._y - middlepath; difference2 = middlepath - this._y; var paths = new Array([this._y, 'right'], [78, 'down'], [292.5, 'right'], [325, 'down'], [650, 'down']); break; case 4: changex = -speed; changey = 0; this._rotation = 90; checkPath = 'x'; this._x = 680; this._y = 272 + (this._width + this._height) / 2 + Math.round(Math.random() * (41 - (this._width + this._height))); middlepath = 292; if (enemyType > 5) { this._y = middlepath; } difference1 = this._y - middlepath; difference2 = middlepath - this._y; var paths = new Array([this._y, 'left'], [325, 'down'], [650, 'down']); } break; case 4: switch (theSetPath) { case 1: middlepath = 100; this._x = 84 + (this._width + this._height) / 4 + Math.round(Math.random() * (35 - (this._width + this._height) / 2)); if (enemyType > 5) { this._x = middlepath; } var paths = new Array([this._x, 'down'], [157, 'right'], [325, 'down'], [650, 'down']); difference1 = this._x - middlepath; difference2 = middlepath - this._x; break; case 2: if (enemyType > 5) { this._x = middlepath; } difference1 = this._x - middlepath; difference2 = middlepath - this._x; this._x = 309 + (this._width + this._height) / 4 + Math.round(Math.random() * (35 - (this._width + this._height) / 2)); var paths = new Array([this._x, 'down'], [650, 'down']); break; case 3: changex = -speed; changey = 0; this._rotation = 90; checkPath = 'x'; middlepath = 157; this._x = 680; this._y = 138 + (this._width + this._height) / 4 + Math.round(Math.random() * (35 - (this._width + this._height) / 2)); if (enemyType > 5) { this._y = middlepath; } difference1 = this._y - middlepath; difference2 = middlepath - this._y; var paths = new Array([this._y, 'left'], [325, 'down'], [650, 'down']); break; case 4: changex = -speed; changey = 0; this._rotation = 90; checkPath = 'x'; this._x = 680; middlepath = 293; this._y = 271 + (this._width + this._height) / 4 + Math.round(Math.random() * (35 - (this._width + this._height) / 2)); if (enemyType > 5) { this._y = middlepath; } difference1 = this._y - middlepath; difference2 = middlepath - this._y; var paths = new Array([this._y, 'left'], [325, 'down'], [650, 'down']); } break; case 5: switch (theSetPath) { case 1: if (enemyType > 5) { this._x = middlepath; } difference1 = this._x - middlepath; difference2 = middlepath - this._x; var paths = new Array([this._x, 'down'], [67.5, 'right'], [505.3, 'down'], [202.5, 'left'], [235.3, 'up'], [67.5, 'left'], [55.3, 'down'], [292.5, 'right'], [325.3, 'down'], [650, 'down']); break; case 2: changex = -speed; changey = 0; this._rotation = 90; checkPath = 'x'; this._x = 680; middlepath = 68; this._y = 49 + (this._width + this._height) / 4 + Math.round(Math.random() * (35 - (this._width + this._height) / 2)); if (enemyType > 5) { this._y = middlepath; } difference1 = this._y - middlepath; difference2 = middlepath - this._y; var paths = new Array([this._x, 'left'], [505.3, 'down'], [202.5, 'left'], [235.3, 'up'], [67.5, 'left'], [55.3, 'down'], [292.5, 'right'], [325.3, 'down'], [650, 'down']); break; case 3: changex = speed; changey = 0; this._rotation = -90; checkPath = 'x'; this._x = -30; middlepath = 158; this._y = 138 + (this._width + this._height) / 4 + Math.round(Math.random() * (35 - (this._width + this._height) / 2)); if (enemyType > 5) { this._y = middlepath; } difference2 = middlepath - this._y; difference1 = this._y - middlepath; var paths = new Array([this._y, 'right'], [55, 'down'], [292.5, 'right'], [325.3, 'down'], [650, 'down']); break; case 4: changex = -speed; changey = 0; this._rotation += 45; checkPath = 'x'; this._x = 680; middlepath = 293; this._y = 275 + (this._width + this._height) / 4 + Math.round(Math.random() * (35 - (this._width + this._height) / 2)); if (enemyType > 5) { this._y = middlepath; } difference1 = this._y - middlepath; difference2 = middlepath - this._y; var paths = new Array([this._x, 'left'], [325, 'down'], [650, 'down']); break; default: if (enemyType > 5) { this._x = middlepath; } difference1 = this._x - middlepath; difference2 = middlepath - this._x; var paths = new Array([this._x, 'down'], [67.5, 'right'], [505.3, 'down'], [202.5, 'left'], [235.3, 'up'], [67.5, 'left'], [55.3, 'down'], [292.5, 'right'], [325.3, 'down'], [650, 'down']); } } startx = this._x; starty = this._y; checkPath2 = checkPath; lengthofPathArray = paths.length; if (paths != undefined) { i = 0; while (i < lengthofPathArray) { if (checkPath2 == 'y') { checkPath2 = 'x'; if (paths[i + 1][1] == 'right') { paths[i][0] += difference1 * (-2 * (paths[i][1] == 'up') + 1); } else { paths[i][0] += difference1 * (-2 * (paths[i][1] == 'up') + 1); } } else { if (checkPath2 == 'x') { checkPath2 = 'y'; if (paths[i + 1][1] == 'down') { paths[i][0] += difference1 * (-2 * (paths[i][1] == 'right') + 1); } else { paths[i][0] += difference1 * (-2 * (paths[i][1] == 'right') + 1); } } } if (i > 100) { break; } ++i; } } else {} checkPath2 = 'y'; } onClipEvent (enterFrame) { if (!_root.gamePaused) { if (_root.levelisStarted) { if (this._name == 'enemy0') { level = _root.TD_Levels[_root.currentLevel - 1]; inLevelTotal = level.length; var currentTime = Math.round(getTimer() - startTime); var delayDuplicate = level[duplicatedn - 1][2]; if (currentTime >= delayDuplicate) { if (duplicatedn < inLevelTotal) { var startTime = getTimer(); ++_root.numberofEnemies; ++inLevel; ++duplicatedn; this.duplicateMovieClip('enemy' + _root.numberofEnemies, this.getNextHighestDepth() + 50 + _root.numberofEnemies * 2); duplicateMovieClip(_root.healthbar0, 'healthbar' + _root.numberofEnemies, this.getNextHighestDepth() + 50 + _root.numberofEnemies * 2 - 1); _root['enemy' + _root.numberofEnemies].enemyType = level[duplicatedn - 1][1]; _root['enemy' + _root.numberofEnemies].theSetPath = level[duplicatedn - 1][0]; _root['healthbar' + _root.numberofEnemies].follow = 'enemy' + _root.numberofEnemies; } } } else { if (_root.directControl) { if (!_root[_root.directControlled].shooting) { cantbehit = false; } if (_root.cursor_mc.hitTest(this._x, this._y, true) && (_root[_root.directControlled].stillShooting && !_root[_root.directControlled].notautomatic || _root[_root.directControlled].shooting)) { if (_root[_root.directControlled].stillShooting && !_root[_root.directControlled].notautomatic || !cantbehit) { if (_root[_root.directControlled].stats[0] == 2 && (_root.EnemyStats[enemyType][5] == 'Energy Shielded Armor' || _root.EnemyStats[enemyType][5] == 'Energy Shielded Heavy Armor')) { this.health -= Math.round(_root[_root.directControlled].stats[4] * 1.2); } else { this.health -= Math.round(_root[_root.directControlled].stats[4]); } if (_root[_root.directControlled].stats[0] == 6 && (enemyType <= 5 && enemyType != 4 && enemyType != 3)) { this.health -= Math.round(_root[_root.directControlled].stats[4] / 4); } cantbehit = true; } } } if (this._y > 450 + this._height) { if (!deleted) { deleted = 1; --_root.enemy0.inLevel; } if (_root.enemy0.inLevel <= 0 && _root.enemy0.duplicatedn == _root.enemy0.inLevelTotal) { _root.levelisStarted = false; originalNumber = _root.numberofEnemies; if (level1 == _root.currentLevel) { ++_root.currentLevel; } _root[_root.directControlled].stillShooting = false; _root.directControl = false; _root.directControlled = undefined; } _root.damageTaken += _root.EnemyStats[enemyType][6]; this.removeMovieClip(this); } if (this.health <= 0 || _root.everythingisdead) { if (_alpha == 0) { if (!deleted) { deleted = 1; --_root.enemy0.inLevel; } _root.money += _root.EnemyStats[enemyType][9] * _root.efficiency; _root.omoney = _root.money; if (_root.enemy0.inLevel <= 0 && _root.enemy0.duplicatedn == _root.enemy0.inLevelTotal || _root.everythingisdead) { _root.levelisStarted = false; originalNumber = _root.numberofEnemies; if (level1 == _root.currentLevel) { ++_root.currentLevel; _root.everythingisdead = false; } _root[_root.directControlled].stillShooting = false; _root.directControl = false; _root.directControlled = undefined; } this.removeMovieClip(this); } else { if (isdying) { this._alpha -= 10; if (this._alpha < 0) { this._alpha = 0; } } else { this.nextFrame(); hbworth = '+' + Math.round(_root.EnemyStats[enemyType][9] * _root.efficiency); isdying = true; } } } i = 0; while (i < _root.enemy0.inLevel) { if (this.enemyType < 6) { if (this.hitTest(_root['enemy' + (_root.numberofEnemies - _root.enemy0.inLevel + i)]) && this._name != 'enemy' + (_root.numberofEnemies - _root.enemy0.inLevel + i)) { if (this._x > _root['enemy' + (_root.numberofEnemies - _root.enemy0.inLevel + i)]._x) { bumpx = 0.05 + (_root['enemy' + (_root.numberofEnemies - _root.enemy0.inLevel + i)]._x - (_x + _width)) * 0.001; } else { bumpx = -0.05 - (_x + _width - _root['enemy' + (_root.numberofEnemies - _root.enemy0.inLevel + i)]._x) * 0.001; } if (this._y > _root['enemy' + (_root.numberofEnemies - _root.enemy0.inLevel + i)]._y) { bumpy = 0.05 + (_root['enemy' + (_root.numberofEnemies - _root.enemy0.inLevel + i)]._y - (_y + _width)) * 0.001; } else { bumpy = -0.05 + (_root['enemy' + (_root.numberofEnemies - _root.enemy0.inLevel + i)]._x - (_x + _width)) * 0.001; } this._y += bumpy * 8; this._x += bumpx * 8; } } ++i; } if (newRotation == 'counter') { if (!rotated) { if (enemyType > 5) { ochangey = changey / 2; ochangex = changex / 2; } newrotation = this._rotation - 90; rotateonce = false; rotated = true; } if (this._rotation > newrotation) { if (enemyType <= 5) { this._rotation -= 9; } else { this._rotation -= 2; if (rchangex != 0 && newrotation != this._rotation) { changey = ochangey - ochangey / (newrotation - this._rotation); this._x += rchangex + rchangex * ((newrotation - this._rotation) / 90); } if (rchangey != 0 && newrotation != this._rotation) { changex = (ochangex - ochangex * ((90 - (this._rotation - newrotation)) / 90)) * 2; this._y += rchangey * ((90 - (this._rotation - newrotation)) / 90); } } } else { if (!rotateonce) { rotateonce = true; if (enemyType > 5) { currentPath += 1; changex = rchangex; changey = rchangey; checkPath = rcheckPath; } } } } if (newRotation == 'clock') { if (!rotated) { if (enemyType > 5) { ochangey = changey / 2; ochangex = changex / 2; } rotated = true; rotateonce = false; newrotation = this._rotation + 90; } if (this._rotation < newrotation) { if (enemyType <= 5) { this._rotation += 9; } else { this._rotation += 2; if (rchangex != 0 && newrotation != this._rotation) { changey = ochangey - ochangey / (newrotation - this._rotation); this._x += rchangex + rchangex * ((this._rotation - newrotation) / 90); } if (rchangey != 0 && newrotation != this._rotation) { changex = (ochangex - ochangex * ((90 - (newrotation - this._rotation)) / 90)) * 2; this._y += rchangey * ((90 - (newrotation - this._rotation)) / 90); } } } else { if (!rotateonce) { rotateonce = true; if (enemyType > 5) { currentPath += 1; changex = rchangex; changey = rchangey; checkPath = rcheckPath; } } } } if (newRotation == 'counter') { if (!rotated) { newrotation = this._rotation - 90; } } i = 0; while (i < lengthofPathArray) { if (i == currentPath) { switch (paths[i][1]) { case 'up': if (this._y < paths[i + 1][0] || enemyType > 5 && this._y < paths[i + 1][0] + 22) { if (enemyType <= 5) { currentPath += 1; changex = speed * (-1 + (paths[i + 1][1] == 'right') * 2); changey = 0; checkPath = 'x'; } else { rchangex = speed * (-1 + (paths[i + 1][1] == 'right') * 2); rchangey = 0; rcheckPath = 'x'; } if (rotateonce || enemyType <= 5) { rotated = false; if (speed * (-1 + (paths[i + 1][1] == 'right') * 2) > 0) { newRotation = 'clock'; } else { newRotation = 'counter'; } } } break; case 'down': if (this._y > paths[i + 1][0] || enemyType > 5 && this._y > paths[i + 1][0] - 22) { if (enemyType <= 5) { currentPath += 1; changex = speed * (-1 + (paths[i + 1][1] == 'right') * 2); changey = 0; checkPath = 'x'; } else { rchangex = speed * (-1 + (paths[i + 1][1] == 'right') * 2); rchangey = 0; rcheckPath = 'x'; } if (rotateonce || enemyType <= 5) { rotated = false; if (speed * (-1 + (paths[i + 1][1] == 'right') * 2) > 0) { newRotation = 'counter'; } else { newRotation = 'clock'; } } } break; case 'right': if (this._x > paths[i + 1][0] || enemyType > 5 && this._x > paths[i + 1][0] - 22) { if (enemyType <= 5) { currentPath += 1; changex = 0; changey = speed * (-1 + (paths[i + 1][1] == 'down') * 2); checkPath = 'y'; } else { rchangex = 0; rchangey = speed * (-1 + (paths[i + 1][1] == 'down') * 2); rcheckPath = 'y'; } if (rotateonce || enemyType <= 5) { rotated = false; if (speed * (-1 + (paths[i + 1][1] == 'down') * 2) > 0) { newRotation = 'clock'; } else { newRotation = 'counter'; } } } break; case 'left': if (this._x < paths[i + 1][0] || enemyType > 5 && this._x < paths[i + 1][0] + 22) { if (enemyType <= 5) { currentPath += 1; changex = 0; changey = speed * (-1 + (paths[i + 1][1] == 'down') * 2); checkPath = 'y'; } else { rchangex = 0; rchangey = speed * (-1 + (paths[i + 1][1] == 'down') * 2); rcheckPath = 'y'; } if (rotateonce || enemyType <= 5) { rotated = false; if (speed * (-1 + (paths[i + 1][1] == 'down') * 2) > 0) { newRotation = 'counter'; } else { newRotation = 'clock'; } } } break; default: } } ++i; } if (!isdying) { this._x += changex; this._y += changey; } } } else { if (this._name != 'enemy0') { this.removeMovieClip(this); } originalNumber = _root.numberofEnemies; duplicatedn = 0; } } } onClipEvent (load) { frame = _root._currentframe; } onClipEvent (enterFrame) { if (_root._currentframe > frame || _root._currentframe < frame) { this.removeMovieClip(this); } } } movieClip 562 { } // unknown tag 88 length 68 movieClip 566 { } instance healthbar0 of movieClip 566 { onClipEvent (load) { above = (_root[follow]._height + _root[follow]._width) / 4; frame = _root._currentframe; stop(); } onClipEvent (enterFrame) { if (_root.healthbarvisible || decreasealpha) { if (decreasealpha) { this._alpha -= 4; } else { this._alpha = 100; } } else { this._alpha = 0; } if (_name != 'healthbar0') { this._x = _root[follow]._x; this._y = _root[follow]._y - above - 10; if (_root[follow].isdying) { this.gotoAndStop(101); this.worth = _root[follow].hbworth; if (!decreasealpha) { this._alpha = 100; } decreasealpha = true; } else { this.gotoAndStop(Math.round((_root[follow].health / _root[follow].ohealth) * 100)); } if (_root[follow]._y == undefined) { this.removeMovieClip(this); } } } onClipEvent (enterFrame) { if (_root._currentframe > frame || _root._currentframe < frame) { this.removeMovieClip(this); } } } movieClip 568 { } instance of movieClip 568 { onClipEvent (load) { this.swapDepths(this.getNextHighestDepth() + 30350); frame = _root._currentframe; } onClipEvent (enterFrame) { if (_root._currentframe > frame || _root._currentframe < frame) { this.removeMovieClip(this); } } } button 576 { on (release) { gotoAndStop(2); } } button 577 { on (release) { gotoAndStop(3); } } button 578 { on (release) { gotoAndStop(4); } } button 579 { on (release) { gotoAndStop(5); } } button 580 { on (release) { gotoAndStop(7); } } button 581 { on (release) { gotoAndStop(8); } } button 585 { on (release) { _root.gamePaused = false; _root.returnToMenu(); } } button 586 { on (release) { _root.gamePaused = false; gotoAndStop(1); } } button 595 { on (release) { gotoAndStop(2); } } button 596 { on (release) { _parent.gotoAndStop(5); } } button 597 { on (release) { gotoAndStop(3); } } button 598 { on (release) { gotoAndStop(4); } } button 600 { on (release) { gotoAndStop(1); } } button 601 { on (release) { _parent.gotoAndStop(6); } } movieClip 604 { frame 1 { stop(); } } button 607 { on (release) { _root.gamePaused = false; gotoAndStop(1); } } button 615 { on (release) { _root.strategy[id] = 0; gotoAndStop(1); } } button 616 { on (release) { _root.strategy[id] = 1; gotoAndStop(2); } } movieClip 618 { frame 1 { stop(); } } button 624 { on (release) { if (id < _root.EnemyStats.length - 1) { id += 1; refreshEnemyStats(id); } } } button 625 { on (release) { if (id > 1) { id -= 1; refreshEnemyStats(id); } } } button 633 { on (release) { if (id < 7) { id += 1; refreshEnemyStats(id); } } } button 643 { on (release) { if (fullTxt.scroll > 1) { fullTxt.scroll -= 1; fromTxt.scroll -= 1; } } } button 644 { on (release) { fullTxt.scroll += 1; fromTxt.scroll += 1; } } movieClip 650 { frame 1 { stop(); } instance of movieClip 618 { onClipEvent (load) { id = 0; if (_root.strategy[0]) { gotoAndStop(2); } else { gotoAndStop(1); } } } instance of movieClip 618 { onClipEvent (load) { id = 2; if (_root.strategy[2]) { gotoAndStop(2); } else { gotoAndStop(1); } } } frame 5 { function refreshEnemyStats(id) { _root.pauseMenu.basicStats = 'Type: ' + _root.EnemyStats[id][1] + '\n'; _root.pauseMenu.basicStats += 'Class: ' + _root.EnemyStats[id][4] + '\n'; _root.pauseMenu.basicStats += 'Armor: ' + _root.EnemyStats[id][5] + '\n'; _root.pauseMenu.basicStats += 'Damage Potential: ' + _root.EnemyStats[id][6] + '%' + '\n'; _root.pauseMenu.description = 'Description: ' + _root.EnemyStats[id][8]; _root.pauseMenu.enemies.gotoAndStop(_root.EnemyStats[id][7]); } id = 1; refreshEnemyStats(id); } frame 6 { function refreshEnemyStats(id) { _root.pauseMenu.basicStats = 'Title: ' + _root.towers['buygun' + id][5] + '\n'; _root.pauseMenu.basicStats += 'Power: ' + Math.round((_root.towers['buygun' + id][4] / 5000) * 100) + '%' + '\n'; _root.pauseMenu.basicStats += 'Speed: ' + Math.ceil(((_root.towers['buygun' + id][2] - 2000) * -1 / 2000) * 100) + '%' + '\n'; _root.pauseMenu.basicStats += 'Accuracy: ' + _root.towers['buygun' + id][3] + '%' + '\n'; _root.pauseMenu.basicStats += 'Cost: ' + _root.towers['buygun' + id][1] + '\n'; _root.pauseMenu.description = 'Description: '; switch (id) { case 1: thedescription = 'The machine gun is a cheap weapon that works well for ground soldiers. In the beginning of the game, it is useful for increasing numbers in a short amount of time. They shoot constantly, so they are still useful for picking off enemies with low hp before they make it in even towards the end of the game.'; break; case 2: thedescription = 'The plasma cannon is useful mostly for energy shielded enemies, and, when fully upgraded, becomes vital for taking on these enemies towards the end of the game.'; break; case 3: thedescription = 'These small snipers have long range, shoot quickly, and have moderate power. The main difference between these and the larger sniper, is that these are more constant.'; break; case 4: thedescription = 'Big snipers can take a huge amount of damage off an enemies\' hp, but they, as to be expected, are slow.'; break; case 5: thedescription = 'Tesla Coils send out electricity at the enemies. They are much like snipers but more powerful and are very slow.'; break; case 6: thedescription = 'Rocket launchers are the biggest weapons you will be able to get ahold of, but they are expensive. '; break; case 7: thedescription = 'The Nuke eliminates all enemies on screen. Don\'t use unless a wave has started.'; } _root.pauseMenu.description += thedescription; _root.pauseMenu.tower.cannon.gotoAndStop('buygun' + id); } id = 1; refreshEnemyStats(id); } instance tower of movieClip 541 { onClipEvent (load) { targeted = true; target = true; } } frame 7 { _root.totalTowerForce = 0; _root.worthofTowers = 0; k = 0; while (k < _root.totalNumberofTowers + _root.nsold) { if (_root['tower' + k].stats != undefined && _root['tower' + k].stats[4] >= 1000) { _root.worthofTowers += _root['tower' + k].stats[6]; } else { if (_root['tower' + k].stats != undefined) { _root.worthofTowers += _root['tower' + k].stats[6]; } } ++k; } var collectedData = _root.currentLevel - (_root.currentLevel == 41) + '\n'; collectedData += 100 - _root.damageTaken + '%' + '\n'; collectedData += Math.round(_root.money) + '\n'; collectedData += _root.worthofTowers + '\n'; var difficultiesPossible = new Array('supa easy', 'very easy', 'Easy', 'Medium', 'Hard'); collectedData += difficultiesPossible[_root.theTheme] + '\n'; collectedData += '' + Math.round(_root.skillLevel / 140) * 10 + '/10' + '\n'; var scoreConversion = Math.round((_root.currentLevel / 40) * 200) + '\n'; scoreConversion += 100 - _root.damageTaken + '\n'; scoreConversion += Math.round((_root.money / 2000) * 100) + '\n'; scoreConversion += Math.round((_root.worthofTowers / 10000) * 100) + '\n'; scoreConversion += Math.round((_root.theTheme / 4) * 100) + '\n'; scoreConversion += Math.round((_root.skillLevel / 140) * 100) + '\n' + '\n'; _root.totalScore = Math.round((_root.currentLevel / 40) * 200) + (100 - _root.damageTaken) + Math.round((_root.money / 2000) * 100) + Math.round((_root.worthofTowers / 10000) * 100) + Math.round((_root.theTheme / 4) * 100) + Math.round((_root.skillLevel / 140) * 100); scoreConversion += _root.totalScore; } frame 9 { fulltxt.text = ''; fromtxt.text = ''; var fullMessages = ''; i = 0; while (i < _root.tmessages.length) { if (_root.tmessages[i][0] != undefined) { fullMessages += _root.tmessages[i][0] + '\n'; } ++i; } var from = ''; i = 0; while (i < _root.tmessages.length) { if (_root.tmessages[i][1] != undefined) { from += _root.tmessages[i][1] + '\n'; } ++i; } } } instance pauseMenu of movieClip 650 { onClipEvent (load) { this.swapDepths(this.getNextHighestDepth() + 40310); frame = _root._currentframe; _root._quality = 'autohigh'; } onClipEvent (enterFrame) { if (_root.modeChosen == 'Campaign' && _root.currentLevel >= 31) { _root.gotoAndStop('gameover'); } if (_root.modeChosen == 'Campaign' && _root.damageTaken >= 100) { _root.gotoAndStop('gameover'); lose = true; } if (_root.modeChosen == 'Survival' && _root.damageTaken >= 100) { _root.gotoAndStop('gameover'); } if (this._currentframe == 1 && Key.isDown(80) && !_root.gamePaused && !Paused) { _root.gamePaused = true; this.gotoAndStop(2); Paused = true; } if (Key.isDown(67) && _root.directControl && !cpressed) { _root[_root.directControlled].stillShooting = false; _root.directControl = false; _root.directControlled = undefined; cpressed = true; } else { if (!Key.isDown(67)) { cpressed = false; } } if (!_root.canSetObject) { h = 0; while (h < 7) { if (Key.isDown(49 + h)) { _root.towerPurchased('buygun' + (h + 1)); _root.showStats('buygun' + (h + 1)); } ++h; } } if (Key.isDown(85)) { _root.upgrade(); } if (Key.isDown(77)) { _root.music.setVolume(0); _root.menus.vba.gotoAndStop(11); } if (Key.isDown(67) && !_root.directControl && !cpressed && _root.selectedTower != undefined && _root.selectedName != 'Nothing Selected') { _root[_root.directControlled].stillShooting = false; cpressed = true; _root.directControl = true; _root.directControlled = _root.selectedTower; _root[_root.selectedTower].directControlled = true; } if (Key.isDown(83) && !_root.directControl && _root.selectedTower != undefined && _root.selectedName != 'Nothing Selected') { _root[_root.selectedTower].target = false; } if (this._currentframe > 1 && Key.isDown(80) && _root.gamePaused == true && !Paused) { _root.gamePaused = false; this.gotoAndStop(1); Paused = true; } if (!Key.isDown(80)) { Paused = false; } if (Key.isDown(72) && !healthtoggled) { if (!_root.healthbarvisible) { _root.healthbarvisible = true; } else { _root.healthbarvisible = false; } healthtoggled = true; } else { if (!Key.isDown(72)) { healthtoggled = false; } } if (_root._currentframe > frame || _root._currentframe < frame) { this.removeMovieClip(this); this.removeMovieClip(this); } if (Key.isDown(81) && !qualityChanged) { switch (_root._quality) { case 'LOW': _root._quality = 'MEDIUM'; break; case 'MEDIUM': _root._quality = 'HIGH'; break; case 'HIGH': _root._quality = 'LOW'; break; default: } qualityChanged = true; } else { if (!Key.isDown(81)) { qualityChanged = false; } } } } instance cursor_mc of movieClip 76 { onClipEvent (load) { this.swapDepths(this.getNextHighestDepth() + 63305); frame = _root._currentframe; } onClipEvent (enterFrame) { if (_root.directControl && _currentframe == 1) { this.gotoAndStop(2); } else { if (!_root.directControl && (_currentframe == 2 || _currentframe == 3 || _currentframe == 4)) { this.gotoAndStop(1); } } if (_root.canSetObject) { _root[_root.directControlled].stillShooting = false; _root.directControl = false; _root.directControlled = undefined; this.gotoAndStop(3); } if (_root._currentframe > frame + 1 || _root._currentframe < frame) { this.removeMovieClip(this); } } } instance of movieClip 333 { onClipEvent (load) { this.swapDepths(this.getNextHighestDepth() + 61303); frame = _root._currentframe; } onClipEvent (enterFrame) { if (_root._currentframe > frame || _root._currentframe < frame) { this.removeMovieClip(this); } } } movieClip 653 { frame 1 { stop(); } } instance thebomb of movieClip 653 { onClipEvent (load) { this.swapDepths(this.getNextHighestDepth() + 61302); frame = _root._currentframe; } onClipEvent (enterFrame) { if (_root._currentframe > frame || _root._currentframe < frame) { this.removeMovieClip(this); } } } movieClip 657 { frame 15 { stop(); } frame 30 { _parent.gotoAndStop(4); } } movieClip 661 { frame 4 { stop(); } frame 5 { stop(); } } instance movie of movieClip 661 { onClipEvent (load) { this.swapDepths(this.getNextHighestDepth() + 62303); frame = _root._currentframe; } onClipEvent (enterFrame) { if (_root._currentframe != frame) { this.removeMovieClip(this); } } } frame 142 { if (_root.modeChosen == 'Campaign' && _root.currentLevel >= 31) { movie.gotoAndStop(8); } _root[_root.directControlled].stillShooting = false; _root.directControl = false; _root.directControlled = undefined; var game = SharedObject.getLocal('Desolate-Defense_Data'); if (_root.modeChosen == 'Campaign' && _root.currentLevel >= 31) { switch (theTheme) { case 2: game.data.medal1 = true; break; case 3: game.data.medal2 = true; break; case 4: game.data.medal3 = true; break; default: } if (!_root.haveDirectlyControlled) { game.data.medal4 = true; } if (_root.haveUsedNuke) { game.data.medal5 = true; } else { game.data.medal6 = true; } } game.data.saved = true; if (_root.modeChosen == 'Survival') { game.data.survivalWave = undefined; } else { if (_root.modeChosen == 'Campaign') { game.data.campaignWave = undefined; } } var collectedData = currentLevel - (currentLevel == 41) + '\n'; collectedData += 100 - damageTaken + '%' + '\n'; collectedData += Math.round(money) + '\n'; collectedData += worthofTowers + '\n'; var difficultiesPossible = new Array('supa easy', 'very easy', 'Easy', 'Medium', 'Hard'); collectedData += '' + difficultiesPossible[theTheme] + '\n'; collectedData += '' + Math.round((skillLevel / 140) * 10) + '/10' + '\n'; var scoreConversion = Math.round((_root.currentLevel / 40) * 200) + '\n'; scoreConversion += 100 - damageTaken + '\n'; scoreConversion += Math.round((money / 2000) * 100) + '\n'; scoreConversion += Math.round((worthofTowers / 10000) * 100) + '\n'; scoreConversion += Math.round((theTheme / 4) * 100) + '\n'; scoreConversion += Math.round((skillLevel / 140) * 100) + '\n' + '\n'; totalScore = Math.round((_root.currentLevel / 40) * 200) + (100 - damageTaken) + Math.round((money / 2000) * 100) + Math.round((worthofTowers / 10000) * 100) + Math.round((theTheme / 4) * 100) + Math.round((skillLevel / 140) * 100); scoreConversion += '' + totalScore; if (_root.currentLevel >= 41 && totalScore >= 1000) { game.data.medal7 = true; } totalM = 0; m = 1; while (m <= 7) { if (game.data['medal' + m]) { totalM += 1; } ++m; } game.data.numberofMedals = totalM; game.flush(); } button 665 { on (release) { _root.returnToMenu(); } } button 666 { on (release) { if (_root.totalScore < 10000) { submitPlay4AllScore = function (uname, gname, scores, game_mode) { var v1 = new LoadVars(); v1.game_id = gname; v1.user_id = uname; v1.score = scores; v1.game_mode = game_mode; var v2 = 'http://www.playtowerdefensegames.com/highscores/submit/play4scores.php'; v1.sendAndLoad(v2, v1, 'POST'); }; switch (theTheme) { case 2: gamename = 820; break; case 3: gamename = 821; break; case 4: gamename = 822; break; default: } submitPlay4AllScore(inputName, gamename, totalScore, _root.modeChosen); submitted.gotoAndStop(2); } else { submitted.gotoAndStop(3); } getURL('http://playtowerdefensegames.com/index.php?action=highscores&gameid=' + (818 + _root.theTheme), '_blank'); } } button 667 { on (release) { getURL('http://playtowerdefensegames.com/index.php?action=highscores&gameid=' + (818 + _root.theTheme), '_blank'); } } movieClip 681 { frame 1 { stop(); } } instance pauseMenu of movieClip 650 { onClipEvent (load) { this.swapDepths(this.getNextHighestDepth() + 40310); frame = _root._currentframe; } onClipEvent (enterFrame) { if (modeChosen == 'Campaign' && _root.currentLevel >= 41) { _root.gotoAndStop('gameover_win'); } if (modeChosen == 'Campaign' && _root.damageTaken >= 100) { _root.gotoAndStop('gameover_lose'); } if (modeChosen == 'Survival' && _root.damageTaken >= 100) { _root.gotoAndStop('gameover_win'); } if (this._currentframe == 1 && Key.isDown(80) && !_root.gamePaused && !Paused) { _root.gamePaused = true; this.gotoAndStop(2); Paused = true; } if (Key.isDown(67) && _root.directControl) { _root[_root.directControlled].stillShooting = false; _root.directControl = false; _root.directControlled = undefined; } if (this._currentframe > 1 && Key.isDown(80) && _root.gamePaused == true && !Paused) { _root.gamePaused = false; this.gotoAndStop(1); Paused = true; } if (!Key.isDown(80)) { Paused = false; } if (Key.isDown(72) && !healthtoggled) { if (!_root.healthbarvisible) { _root.healthbarvisible = true; } else { _root.healthbarvisible = false; } healthtoggled = true; } else { if (!Key.isDown(72)) { healthtoggled = false; } } if (_root._currentframe > frame || _root._currentframe < frame) { this.removeMovieClip(this); this.removeMovieClip(this); } if (Key.isDown(81) && !qualityChanged) { switch (_root._quality) { case 'LOW': _root._quality = 'MEDIUM'; break; case 'MEDIUM': _root._quality = 'HIGH'; break; case 'HIGH': _root._quality = 'LOW'; break; default: } qualityChanged = true; } else { if (!Key.isDown(81)) { qualityChanged = false; } } } } instance cursor_mc of movieClip 76 { onClipEvent (load) { this.swapDepths(this.getNextHighestDepth() + 61305); frame = _root._currentframe; } onClipEvent (enterFrame) { if (_root.directControl && _currentframe == 1) { this.gotoAndStop(2); } else { if (!_root.directControl && (_currentframe == 2 || _currentframe == 3)) { this.gotoAndStop(1); } } if (_root.canSetObject) { _root[_root.directControlled].stillShooting = false; _root.directControl = false; _root.directControlled = undefined; this.gotoAndStop(3); } if (_root._currentframe > frame || _root._currentframe < frame) { this.removeMovieClip(this); } } } instance movie of movieClip 661 { onClipEvent (load) { this.swapDepths(this.getNextHighestDepth() + 62303); frame = _root._currentframe; } onClipEvent (enterFrame) { if (_root._currentframe > frame || _root._currentframe < frame) { this.removeMovieClip(this); } } }




http://swfchan.com/19/91536/info.shtml
Created: 27/3 -2019 21:35:25 Last modified: 27/3 -2019 21:35:25 Server time: 02/05 -2024 09:36:07