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

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

BO - The Secret of Steel.swf

This is the info page for
Flash #54316

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


ActionScript [AS1/AS2]
Combined Code
movieClip 32 death_01 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 29 { gotoAndStop('prevFram'); } } frame 1 { function dead_click() {} function HE() { if (interfaceLayer.Encyclopedia.EncyclopediaCanShow and !game.levelFinished and !player.fallDeath) { MD.forcePointer = true; if (!game.inWorldmap) { unpauseGame(); MD.forcePointer = true; showCursor(); game.isPaused = true; key.spacePressed = false; key.spaceTabbed = false; key.rightPressed = false; key.leftPressed = false; key.upPressed = false; key.spacePower = 0; } showEncyclopedia = true; interfaceLayer.Encyclopedia.showEncyclopedia(); not3.enabled = false; not4.enabled = false; } } function PA() { pauseGame(); } function TB() { if (options.blurEffects) { options.blurEffects = false; } else { options.blurEffects = true; } optionsChanged(); } function TZ() { if (options.zoomEffects) { options.zoomEffects = false; } else { options.zoomEffects = true; } optionsChanged(); } function TR() { if (options.rotationEffects) { options.rotationEffects = false; } else { options.rotationEffects = true; } optionsChanged(); } NewgroundsAPI.connectMovie(6012); fscommand('allowscale', 'true'); Stage.scaleMode = 'showAll'; var my_customized_menu = new ContextMenu(); my_customized_menu.hideBuiltInItems(); my_customized_menu.builtInItems.quality = true; my_customized_menu.builtInItems.showRedrawRegions = false; showRedrawRegions(false, 1); var not4 = new ContextMenuItem('Encyclopedia', HE); not4.enabled = false; my_customized_menu.customItems.push(not4); var not3 = new ContextMenuItem('Pause', PA); not3.enabled = false; my_customized_menu.customItems.push(not3); var not0 = new ContextMenuItem('Toggle Blur', TB); not0.enabled = false; not0.separatorBefore = true; my_customized_menu.customItems.push(not0); var not1 = new ContextMenuItem('Toggle Zoom', TZ); not1.enabled = false; my_customized_menu.customItems.push(not1); var not2 = new ContextMenuItem('Toggle Rotation', TR); not2.enabled = false; my_customized_menu.customItems.push(not2); _root.menu = my_customized_menu; not0.visible = false; not1.visible = false; not2.visible = false; not3.visible = false; not4.visible = false; play(); } movieClip 3706 __Packages.NewgroundsAPI { #initclip if (!_global.NewgroundsAPI) { var v1 = function () {}; _global.NewgroundsAPI = v1; var v2 = v1.prototype; v1.connectMovie = function (id) { if (!id) { NewgroundsAPI.SendError('Missing required \'id\' parameter in NewgroundsAPI.connectMovie(id:Number)'); } else { if (!NewgroundsAPI.tracker_id) { NewgroundsAPI.SendMessage('Connecting to API gateway...'); NewgroundsAPI.tracker_id = id; NewgroundsAPI.host = (_url.split('/'))[2].toLowerCase(); if (NewgroundsAPI.host.length < 1) { NewgroundsAPI.host = 'localhost'; } var v2 = new Object(); NewgroundsAPI.SendEvent(NewgroundsAPI.MOVIE_VIEWS); } } }; v1.setMovieVersion = function (movie_version) { if (!movie_version) { NewgroundsAPI.SendError('Missing required \'version\' in NewgroundsAPI.setMovieVersion(version:String)'); } else { NewgroundsAPI.version = movie_version; } }; v1.debugMode = function () { NewgroundsAPI.debug = true; }; v1.addCustomEvent = function (stat_id, stat_name) { if (!stat_id) { NewgroundsAPI.SendError('Missing required \'id\' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)'); } else { if (!stat_name) { NewgroundsAPI.SendError('Missing required \'event_name\' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)'); } else { NewgroundsAPI.custom_events[stat_name] = NewgroundsAPI.CUSTOM_STATS + stat_id; NewgroundsAPI.SendMessage('Created custom event: ' + stat_name); } } }; v1.addCustomLink = function (stat_id, stat_name) { if (!stat_id) { NewgroundsAPI.SendError('Missing required \'id\' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)'); } else { if (!stat_name) { NewgroundsAPI.SendError('Missing required \'link_name\' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)'); } else { NewgroundsAPI.custom_links[stat_name] = NewgroundsAPI.CUSTOM_STATS + stat_id; NewgroundsAPI.SendMessage('Created custom link ' + stat_id + ': ' + stat_name); } } }; v1.loadMySite = function () { NewgroundsAPI.SendLink(NewgroundsAPI.AUTHOR_SITE); }; v1.loadNewgrounds = function (special) { if (special) { var v1 = {'page': special}; } NewgroundsAPI.SendLink(NewgroundsAPI.NEWGROUNDS, v1); }; v1.logCustomEvent = function (event_name) { if (!event_name) { NewgroundsAPI.SendError('Missing required \'event_name\' parameter in NewgroundsAPI.logCustomEvent(event_name:String)'); } else { if (!NewgroundsAPI.custom_events[event_name]) { NewgroundsAPI.SendError('Attempted to log undefined custom event: ' + event_name); } else { NewgroundsAPI.SendEvent(NewgroundsAPI.custom_events[event_name]); } } }; v1.loadCustomLink = function (link_name) { if (!link_name) { NewgroundsAPI.SendError('Missing required \'link_name\' parameter in NewgroundsAPI.loadCustomLink(link_name:String)'); } else { if (!NewgroundsAPI.custom_links[link_name]) { NewgroundsAPI.SendError('Attempted to open undefined custom link: ' + link_name); } else { NewgroundsAPI.SendLink(NewgroundsAPI.custom_links[link_name]); } } }; v1.getAdURL = function () { return NewgroundsAPI.movie_options.ad_url; }; v1.getMovieURL = function () { if (NewgroundsAPI.movie_options.movie_url) { return NewgroundsAPI.movie_options.movie_url; } else { return 'Newgrounds.com'; } }; v1.getNewVersionURL = function () { return NewgroundsAPI.GATEWAY_URL + '?&id=' + NewgroundsAPI.tracker_id + '&host=' + escape(NewgroundsAPI.host) + '&stat=' + NewgroundsAPI.NEW_VERSION; }; v1.SendEvent = function (id) { NewgroundsAPI.SendStat(id, false); }; v1.SendLink = function (id, extra) { NewgroundsAPI.SendStat(id, true, extra); }; v1.ReadGatewayData = function (params) { for (var v2 in params) { params[v2] = unescape(params[v2]); NewgroundsAPI.movie_options[v2] = params[v2]; } if (params.settings_loaded) { NewgroundsAPI.SendMessage('You have successfully connected to the Newgrounds API gateway!'); NewgroundsAPI.SendMessage('Movie Identified as \'' + NewgroundsAPI.movie_options.movie_name + '\''); if (NewgroundsAPI.movie_options.message) { NewgroundsAPI.SendMessage(NewgroundsAPI.movie_options.message); } if (NewgroundsAPI.movie_options.ad_url) { NewgroundsAPI.SendMessage('Your movie has been approved to run Flash Ads'); NewgroundsAPI.onAdsApproved(NewgroundsAPI.movie_options.ad_url); } if (NewgroundsAPI.movie_options.movie_version and NewgroundsAPI.movie_options.movie_version.toString() != NewgroundsAPI.version.toString()) { NewgroundsAPI.SendMessage('WARNING: The movie version configured in your API settings does not match this movie\'s version!'); NewgroundsAPI.onNewVersionAvailable(NewgroundsAPI.movie_options.movie_version, NewgroundsAPI.getMovieURL(), NewgroundsAPI.getNewVersionURL()); } if (NewgroundsAPI.movie_options.deny_host) { NewgroundsAPI.SendMessage('You have blocked \'localHost\' in your API settings.'); NewgroundsAPI.SendMessage('If you wish to test your movie you will need to remove this block.'); NewgroundsAPI.onDenyHost(NewgroundsAPI.host, NewgroundsAPI.getMovieURL(), NewgroundsAPI.getNewVersionURL()); } if (NewgroundsAPI.movie_options.request_portal_url == 1) { var v4 = NewgroundsAPI.GATEWAY_URL + '?&id=' + NewgroundsAPI.tracker_id + '&portal_url=' + escape(_url); var v3 = new XML(); v3.ignoreWhite = true; v3.load(v4); } } else { if (!NewgroundsAPI.movie_options.settings_loaded) { NewgroundsAPI.SendError('Could not establish connection to the API gateway.'); } } }; v1.SendStat = function (stat_id, open_in_browser, extra) { if (!NewgroundsAPI.tracker_id) { NewgroundsAPI.SendError('API calls cannot be made without a valid movie id.'); NewgroundsAPI.SendError('Did you remember to add the "NewgroundsAPI.connectMovie()" code?'); } else { var v7 = NewgroundsAPI.GATEWAY_URL + '?&id=' + NewgroundsAPI.tracker_id + '&host=' + escape(NewgroundsAPI.host) + '&stat=' + stat_id; for (var v9 in extra) { v7 += '&' + escape(v9) + '=' + escape(extra[v9]); } trace(v7); if (NewgroundsAPI.debug) { v7 += '&debug=1'; } if (open_in_browser) { getURL(v7, '_blank'); } else { var v10 = new XML(); v10.ignoreWhite = true; v10.onLoad = function (success) { var v6 = new Object(); var v3 = 0; while (v3 < this.firstChild.childNodes.length) { var v4 = this.firstChild.childNodes[v3]; var v5 = v4.nodeName; var v2 = v4.attributes.value; if (v2 == Number(v2)) { v2 = Number(v2); } v6[v5] = v2; ++v3; } NewgroundsAPI.ReadGatewayData(v6); }; v10.load(v7); } } }; v1.SendError = function (msg) { trace('[NEWGROUNDS API ERROR] :: ' + msg); }; v1.SendMessage = function (msg) { trace('[NEWGROUNDS API] :: ' + msg); }; v1.InitTextFormats = function () { if (!NewgroundsAPI.error_format) { NewgroundsAPI.error_format = new TextFormat(); NewgroundsAPI.error_format.font = 'Arial Black'; NewgroundsAPI.error_format.size = 48; NewgroundsAPI.error_format.color = 16711680; } if (!NewgroundsAPI.header_format) { NewgroundsAPI.header_format = new TextFormat(); NewgroundsAPI.header_format.font = 'Arial Black'; NewgroundsAPI.header_format.size = 24; NewgroundsAPI.header_format.color = 16777215; } if (!NewgroundsAPI.normal_format) { NewgroundsAPI.normal_format = new TextFormat(); NewgroundsAPI.normal_format.font = 'Arial'; NewgroundsAPI.normal_format.bold = true; NewgroundsAPI.normal_format.size = 12; NewgroundsAPI.normal_format.color = 16777215; } if (!NewgroundsAPI.link_format) { NewgroundsAPI.link_format = new TextFormat(); NewgroundsAPI.link_format.color = 16776960; NewgroundsAPI.link_format.underline = true; } }; v1.onNewVersionAvailable = function (version, movie_url, redirect_url) { NewgroundsAPI.InitTextFormats(); var v2 = new Object(); v2.x = Stage.width / 2; v2.y = Stage.height / 2; _root.createEmptyMovieClip('NGAPI_new_version_overlay', _root.getNextHighestDepth()); _root.NGAPI_new_version_overlay.lineStyle(1, 0, 100); _root.NGAPI_new_version_overlay.beginFill(0, 70); _root.NGAPI_new_version_overlay.moveTo(-10, -10); _root.NGAPI_new_version_overlay.lineTo(-10, 1000); _root.NGAPI_new_version_overlay.lineTo(1000, 1000); _root.NGAPI_new_version_overlay.lineTo(1000, -10); _root.NGAPI_new_version_overlay.lineTo(-10, -10); _root.NGAPI_new_version_overlay.endFill(); _root.NGAPI_new_version_overlay.lineStyle(10, 0, 100); _root.NGAPI_new_version_overlay.beginFill(51); _root.NGAPI_new_version_overlay.moveTo(v2.x - 240, v2.y - 120); _root.NGAPI_new_version_overlay.lineTo(v2.x + 240, v2.y - 120); _root.NGAPI_new_version_overlay.lineTo(v2.x + 240, v2.y + 80); _root.NGAPI_new_version_overlay.lineTo(v2.x - 240, v2.y + 80); _root.NGAPI_new_version_overlay.lineTo(v2.x - 240, v2.y - 120); _root.NGAPI_new_version_overlay.endFill(); _root.NGAPI_new_version_overlay.createEmptyMovieClip('exit', 1000); _root.NGAPI_new_version_overlay.exit.lineStyle(2, 39423, 100); _root.NGAPI_new_version_overlay.exit.beginFill(0, 50); _root.NGAPI_new_version_overlay.exit.moveTo(v2.x + 210, v2.y - 110); _root.NGAPI_new_version_overlay.exit.lineTo(v2.x + 230, v2.y - 110); _root.NGAPI_new_version_overlay.exit.lineTo(v2.x + 230, v2.y - 90); _root.NGAPI_new_version_overlay.exit.lineTo(v2.x + 210, v2.y - 90); _root.NGAPI_new_version_overlay.exit.lineTo(v2.x + 210, v2.y - 110); _root.NGAPI_new_version_overlay.exit.endFill(); _root.NGAPI_new_version_overlay.exit.moveTo(v2.x + 214, v2.y - 106); _root.NGAPI_new_version_overlay.exit.lineTo(v2.x + 226, v2.y - 94); _root.NGAPI_new_version_overlay.exit.moveTo(v2.x + 226, v2.y - 106); _root.NGAPI_new_version_overlay.exit.lineTo(v2.x + 214, v2.y - 94); _root.NGAPI_new_version_overlay.exit.onMouseUp = function () { if (_root.NGAPI_new_version_overlay.exit.hitTest(_root._xmouse, _root._ymouse)) { _root.NGAPI_new_version_overlay.removeMovieClip(); } }; var v3 = 'Version ' + version + ' is now available at:' + '\n'; var v5 = v3.length; v3 += movie_url; var v4 = v3.length; _root.NGAPI_new_version_overlay.createTextField('mouseblocker', 99, -10, -10, 1000, 1000); _root.NGAPI_new_version_overlay.createTextField('newversion', 100, v2.x - 210, v2.y - 90, 400, 80); _root.NGAPI_new_version_overlay.newversion.text = 'New Version Available!'; _root.NGAPI_new_version_overlay.newversion.setTextFormat(NewgroundsAPI.header_format); _root.NGAPI_new_version_overlay.createTextField('message', 101, (Stage.width - 400) / 2, Stage.height / 2, 400, 40); _root.NGAPI_new_version_overlay.message.text = v3; _root.NGAPI_new_version_overlay.message.multiline = true; _root.NGAPI_new_version_overlay.message.wordWrap = true; _root.NGAPI_new_version_overlay.message.html = true; _root.NGAPI_new_version_overlay.message.setTextFormat(NewgroundsAPI.normal_format); NewgroundsAPI.link_format.url = redirect_url; _root.NGAPI_new_version_overlay.message.setTextFormat(v5, v4, NewgroundsAPI.link_format); }; v1.onDenyHost = function (hostname, movie_url, redirect_url) { NewgroundsAPI.InitTextFormats(); _root.createEmptyMovieClip('NGAPI_deny_host_overlay', _root.getNextHighestDepth()); _root.NGAPI_deny_host_overlay.lineStyle(20, 0, 100); _root.NGAPI_deny_host_overlay.beginFill(6684672); _root.NGAPI_deny_host_overlay.moveTo(0, 0); _root.NGAPI_deny_host_overlay.lineTo(Stage.width, 0); _root.NGAPI_deny_host_overlay.lineTo(Stage.width, Stage.height); _root.NGAPI_deny_host_overlay.lineTo(0, Stage.height); _root.NGAPI_deny_host_overlay.lineTo(0, 0); _root.NGAPI_deny_host_overlay.endFill(); var v2 = 'This movie has not been approved for use on ' + hostname + '.'; v2 += '\r\rFor an aproved copy, please visit:\r'; var v4 = v2.length; v2 += movie_url; var v3 = v2.length; _root.NGAPI_deny_host_overlay.createTextField('mousekill', 100, 0, 0, Stage.width, Stage.height); _root.NGAPI_deny_host_overlay.createTextField('error', 101, (Stage.width - 400) / 2, Stage.height / 2 - 100, 400, 200); _root.NGAPI_deny_host_overlay.error.text = 'ERROR!'; _root.NGAPI_deny_host_overlay.error.setTextFormat(NewgroundsAPI.error_format); _root.NGAPI_deny_host_overlay.createTextField('message', 102, (Stage.width - 400) / 2, Stage.height / 2, 400, 200); _root.NGAPI_deny_host_overlay.message.text = v2; _root.NGAPI_deny_host_overlay.message.multiline = true; _root.NGAPI_deny_host_overlay.message.wordWrap = true; _root.NGAPI_deny_host_overlay.message.html = true; _root.NGAPI_deny_host_overlay.message.setTextFormat(NewgroundsAPI.normal_format); NewgroundsAPI.link_format.url = redirect_url; _root.NGAPI_deny_host_overlay.message.setTextFormat(v4, v3, NewgroundsAPI.link_format); }; v1.isInstalled = function () { return true; }; v1.onAdsApproved = function (ad_url) {}; v1.movie_options = new Object(); v1.custom_events = new Object(); v1.custom_links = new Object(); v1.MOVIE_VIEWS = 1; v1.AUTHOR_SITE = 2; v1.NEWGROUNDS = 3; v1.NEW_VERSION = 4; v1.CUSTOM_STATS = 50; v1.GATEWAY_URL = 'http://www.ngads.com/gateway.php'; ASSetPropFlags(_global.NewgroundsAPI.prototype, null, 1); } #endinitclip } // unknown tag 88 length 66 frame 3 { var antiSpeedProgress = 96; var nextAddTimer = 600; var phase = false; loadMeter._alpha = 0; loading_txt._alpha = 100; this.onEnterFrame = function () { if (!phase) { loadMeter._alpha += 2; loading_txt._alpha -= 2; if (loading_txt._alpha <= 0 and loadMeter._alpha >= 100) { phase = true; } } else { loadMeter._alpha -= 2; loading_txt._alpha += 2; if (loading_txt._alpha >= 100 and loadMeter._alpha <= 0) { phase = false; } } antiSpeedProgress -= 1; loadMeter.text = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100) + ' %'; if (_root.getBytesLoaded() >= _root.getBytesTotal()) { if (antiSpeedProgress <= 0) { gotoAndStop(4); } else { loadMeter.text = Math.floor(antiSpeedProgress / 24 + 1) + ' seconds remaining'; } } else { nextAddTimer -= 1; if (nextAddTimer <= 0) { nextAddTimer = 600; gotoAndPlay(2); } } }; stop(); } button 43 { on (release) { NewgroundsAPI.loadNewgrounds(); } } button 49 { on (release) { NewgroundsAPI.loadNewgrounds(); } } movieClip 50 { } movieClip 51 { frame 1 { function startAd(ngad_url) { trace('opening ' + ngad_url); System.security.allowDomain('70.87.128.99'); System.security.allowInsecureDomain('70.87.128.99'); System.security.allowDomain('ads.shizmoo.com'); System.security.allowInsecureDomain('ads.shizmoo.com'); System.security.allowDomain('www.cpmstar.com'); System.security.allowInsecureDomain('www.cpmstar.com'); System.security.allowDomain('server.cpmstar.com'); System.security.allowInsecureDomain('server.cpmstar.com'); var ngads_redirect = new XML(); ngads_redirect.ignoreWhite = true; ngads_redirect.onLoad = function (success) { trace('[NEWGROUNDS FLASH ADS] :: You may get a \'Security Sandbox Violation\' ... this is normal, do not freak out!'); if (success) { ng_ad.loadMovie(ngads_redirect.toString(), 'GET'); } else {} }; ngads_redirect.load(ngad_url); } if (NewgroundsAPI.getAdURL()) { startAd(NewgroundsAPI.getAdURL()); } NewgroundsAPI.onAdsApproved = function (ad_url) { startAd(ad_url); }; stop(); } } frame 4 { cnt_btn.onRelease = function () { gotoAndStop(6); }; } // unknown tag 88 length 66 frame 5 { gotoAndStop(4); } movieClip 62 { } movieClip 67 { } movieClip 71 { } movieClip 77 { } movieClip 80 { } movieClip 82 { } movieClip 85 { } movieClip 87 { } movieClip 89 { } movieClip 91 { } movieClip 93 { } movieClip 96 { } movieClip 100 { } movieClip 104 { } movieClip 113 { } movieClip 115 { } movieClip 116 { frame 1 { stop(); } } movieClip 117 { } movieClip 119 { } movieClip 126 { } movieClip 129 { } movieClip 137 { } movieClip 139 { } movieClip 147 { } movieClip 149 { } movieClip 156 { } movieClip 159 { } movieClip 161 { } movieClip 163 { } movieClip 185 { } movieClip 190 { } movieClip 192 { } movieClip 198 { } movieClip 199 { } movieClip 200 { } movieClip 206 { } movieClip 215 { frame 14 { stop(); } } movieClip 218 { } movieClip 231 { } movieClip 250 { } movieClip 252 { } movieClip 256 movie_intro { frame 830 { _root.endMovie(); } } movieClip 270 { } movieClip 278 { } movieClip 286 { } movieClip 297 { frame 20 { _parent.gotoAndStop('idle'); } } movieClip 302 { } movieClip 311 { } movieClip 320 { } movieClip 327 { } movieClip 356 { } movieClip 400 { } movieClip 407 { } movieClip 408 movie_outro { frame 641 { _root.endOutroMovie(); } } movieClip 423 { } movieClip 435 { } movieClip 436 weather { frame 1 { stop(); } } movieClip 438 { } movieClip 439 { frame 1 { stop(); } frame 2 { if (Math.random() * 100 < 40) { _root.addSound('thunder_' + Math.floor(Math.random() * 4 + 1) + '.wav', 50 + Math.random() * 50, -50 + Math.random() * 100, 0); _root.thunderValues.firstSoundDone = true; } else { _root.thunderValues.firstSoundDone = false; } } frame 3 { function randomizeMark(mc) { if (Math.random() * 100 < 80 or _root.thunderValues.firstSoundDone) { mc._alpha = 40 + Math.random() * 60; } else { mc._alpha = 0; } if (Math.random() * 100 < 50) { gotoAndPlay(_currentframe + 1); } } randomizeMark(mark1); } frame 6 { if (Math.random() * 100 < 70 or !_root.thunderValues.firstSoundDone) { if (Math.random() * 100 < 50) { gotoAndPlay(_currentframe + 1); } if (!_root.thunderValues.firstSoundDone) { _root.addSound('thunder_' + Math.floor(Math.random() * 4 + 1) + '.wav', 60 + Math.random() * 50, -50 + Math.random() * 100, 0); _root.thunderValues.firstSoundDone = true; } } else { if (!_root.thunderValues.firstSoundDone) { _root.addSound('thunder_' + Math.floor(Math.random() * 4 + 1) + '.wav', 60 + Math.random() * 50, -100 + Math.random() * 200, 0); _root.thunderValues.firstSoundDone = true; } gotoAndStop(1); } } frame 8 { function randomizeMark(mc) { if (Math.random() * 100 < 80 or _root.thunderValues.firstSoundDone) { mc._alpha = 40 + Math.random() * 60; } else { mc._alpha = 0; } if (Math.random() * 100 < 50) { gotoAndPlay(_currentframe + 1); } } randomizeMark(mark1); } frame 11 { if (Math.random() * 100 < 50) { _root.addSound('thunder_' + Math.floor(Math.random() * 4 + 1) + '.wav', 70 + Math.random() * 50, -60 + Math.random() * 120, 0); if (Math.random() * 100 < 15) { _root.addSound('crow_01.wav', 50, 0, 0); } } else { if (Math.random() * 100 < 20) { gotoAndPlay(2); } } } } movieClip 441 { } movieClip 443 { } movieClip 450 { frame 1 { stop(); } frame 13 { gotoAndPlay(2); } } movieClip 452 { frame 1 { stop(); } frame 11 { gotoAndPlay(2); } } movieClip 453 { } movieClip 456 { } // unknown tag 88 length 75 movieClip 466 { frame 1 { stop(); } } movieClip 467 { } movieClip 469 { } movieClip 488 { frame 1 { _root.fadeMusic(); } frame 143 { _root.stageCleared(); } } movieClip 504 { } movieClip 518 { } movieClip 521 { frame 1 { gotoAndStop(2); } frame 2 { stop(); } } movieClip 524 { } movieClip 526 { } movieClip 528 xmarker { frame 1 { gotoAndStop(2); } frame 2 { stop(); } } movieClip 532 { } // unknown tag 88 length 61 movieClip 545 { frame 2 { gotoAndStop('g'); } frame 2 { back_btn.onRelease = function () { _root.addBtnSound(); _parent.optShow = false; gotoAndStop(1); }; y_btn.onRelease = function () { _root.addBtnSound(); gotoAndStop(3); }; n_btn.onRelease = function () { _root.addBtnSound(); gotoAndStop(4); }; } frame 3 { function playBlood() { _root.addSound('finishing_06.wav', 70, 0, 0); } function setQuality() { var v3 = (slider_end._x - slider._x) / 2; if (_root._quality == 'LOW') { head._x = slider._x; } else { if (_root._quality == 'MEDIUM') { head._x = slider._x + v3; } else { head._x = slider_end._x; } } this.LMH.gotoAndStop(_root._quality); qualitySet = true; } function changeQuality() { if (qualitySet) { var v4 = (slider_end._x - slider._x) / 3; var v3 = head._x - slider._x; if (Math.sqrt((oldHeadXPos - v3) * (oldHeadXPos - v3)) >= 20) { _root.addSound('finishing_06.wav', 70, 0, 0); } if (v4 > v3) { if (_root._quality != 'LOW') { playBlood(); } _root._quality = 'LOW'; } else { if (v4 * 2 > v3) { if (_root._quality != 'MEDIUM') { playBlood(); } _root._quality = 'MEDIUM'; } else { if (_root._quality != 'HIGH') { playBlood(); } _root._quality = 'HIGH'; } } this.LMH.gotoAndStop(_root._quality); oldHeadXPos = v3; } } head._x = slider._x; head._y = slider._y; slider_end._y = slider._y; var draggingHead = false; var qualitySet = false; setQuality(); this.onEnterFrame = function () { if (_currentframe == 3) { if (draggingHead) { changeQuality(); } } }; var oldHeadXPos = head._x - slider._x; head.onPress = function () { draggingHead = true; startDrag(head, false, slider._x, slider._y, slider_end._x, slider._y); }; head.onRelease = function () { draggingHead = false; head.stopDrag(); changeQuality(); }; head.onReleaseOutside = function () { draggingHead = false; head.stopDrag(); changeQuality(); }; if (Stage.displayState == 'fullScreen') { indicator_fs.gotoAndStop('ON'); } else { indicator_fs.gotoAndStop('OFF'); } if (_root.options.blurEffects) { indicator_be.gotoAndStop('ON'); } else { indicator_be.gotoAndStop('OFF'); } if (_root.options.rotationEffects) { indicator_cr.gotoAndStop('ON'); } else { indicator_cr.gotoAndStop('OFF'); } if (_root.options.zoomEffects) { indicator_ze.gotoAndStop('ON'); } else { indicator_ze.gotoAndStop('OFF'); } btn_be.onRelease = function () { _root.addBtnSound(); if (!_root.options.blurEffects) { _root.options.blurEffects = true; indicator_be.gotoAndStop('ON'); } else { _root.options.blurEffects = false; indicator_be.gotoAndStop('OFF'); } _root.optionsChanged(); }; btn_cr.onRelease = function () { _root.addBtnSound(); if (!_root.options.rotationEffects) { _root.options.rotationEffects = true; indicator_cr.gotoAndStop('ON'); } else { _root.options.rotationEffects = false; indicator_cr.gotoAndStop('OFF'); } _root.optionsChanged(); }; btn_ze.onRelease = function () { _root.addBtnSound(); if (!_root.options.zoomEffects) { _root.options.zoomEffects = true; indicator_ze.gotoAndStop('ON'); } else { _root.options.zoomEffects = false; indicator_ze.gotoAndStop('OFF'); } _root.optionsChanged(); }; btn_fs.onRelease = function () { _root.addBtnSound(); _root.toggleFullscreenMode(); if (Stage.displayState == 'fullScreen') { indicator_fs.gotoAndStop('ON'); } else { indicator_fs.gotoAndStop('OFF'); } setQuality(); }; } frame 4 { function setVolume() { var v2 = slider_end_v._x - slider_v._x; head_v._y = slider_v._y; head_v._x = slider_v._x + v2 * (_root.globalSoundVolume / 100); v2 = slider_end_m._x - slider_m._x; head_m._y = slider_m._y; head_m._x = slider_m._x + v2 * (_root.globalMusicVolume / 100); } function changeVolume() { var v3 = slider_end_v._x - slider_v._x; var v2 = slider_end_v._x - head_v._x; _root.globalSoundVolume = Math.round(100 - (v2 / v3) * 100); if (_root.globalSoundVolume < 1) { _root.globalSoundVolume = 1; } _root.globalSound.setVolume(_root.globalSoundVolume); _root.globalMusicVolumeChanged(); } function changeMusic() { var v3 = slider_end_m._x - slider_m._x; var v2 = slider_end_m._x - head_m._x; _root.globalMusicVolume = Math.round(100 - (v2 / v3) * 100); _root.globalMusicVolumeChanged(); } slider_end._y = slider._y; var draggingHead_v = false; var draggingHead_m = false; setVolume(); this.onEnterFrame = function () { if (_currentframe == 4) { if (draggingHead_v) { changeVolume(); } if (draggingHead_m) { changeMusic(); } } }; head_v.onPress = function () { draggingHead_v = true; startDrag(head_v, false, slider_v._x, slider_v._y, slider_end_v._x, slider_v._y); }; head_v.onRelease = function () { draggingHead_v = false; head_v.stopDrag(); changeVolume(); }; head_v.onReleaseOutside = function () { draggingHead_v = false; head_v.stopDrag(); changeVolume(); }; head_m.onPress = function () { draggingHead_m = true; startDrag(head_m, false, slider_m._x, slider_m._y, slider_end_m._x, slider_m._y); }; head_m.onRelease = function () { draggingHead_m = false; head_m.stopDrag(); changeMusic(); }; head_m.onReleaseOutside = function () { draggingHead_m = false; head_m.stopDrag(); changeMusic(); }; } } movieClip 559 { frame 1 { _root.fadeMusic(); } frame 36 { _root.addSound('game_over.mp3', 140, 0); } frame 55 { if (_root.player.fallDeath) { _root.addEffect_knockdownSmoke(_root.player); _root.setCameraShake(5, 5); _root.updateHPRage(-100, -100); } } frame 72 { _root.forceThunder(); } frame 128 { _root.gameOver(); } } movieClip 561 RatioFix { frame 3 { btn_exit.onRelease = function () { _root.addBtnSound(); _root.exitLevelNow(); }; btn_resumeGame.onRelease = function () { _root.addBtnSound(); _root.unpauseGame(); }; var optShow = false; this.opt.gotoAndStop('hide'); btn_options.onRelease = function () { _root.addBtnSound(); if (optShow) { optShow = false; opt.gotoAndStop('hide'); } else { optShow = true; opt.gotoAndStop('show'); } }; } } movieClip 571 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 592 { } movieClip 620 { frame 2 { hyp1_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('finishing'); }; hyp2_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('barrels'); }; } frame 4 { hyp1_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('stun'); }; hyp2_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('knockdown'); }; } frame 5 { hyp1_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('stun'); }; hyp2_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('knockdown'); }; hyp3_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('knockdown'); }; } frame 6 { hyp1_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('stun'); }; hyp2_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('stagger'); }; } frame 9 { hyp1_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('stun'); }; hyp2_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('knockdown'); }; } frame 10 { hyp1_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('stagger'); }; hyp2_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('stun'); }; hyp3_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('knockdown'); }; } frame 11 { hyp1_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('strongatt'); }; hyp2_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('strongatt'); }; hyp3_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('stagger'); }; } frame 12 { hyp1_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('fastatt'); }; hyp2_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('stagger'); }; hyp3_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('stun'); }; hyp4_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('knockdown'); }; } frame 13 { hyp1_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('pickup'); }; } frame 14 { hyp1_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('kick'); }; hyp2_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('pickup'); }; hyp3_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('finishing'); }; hyp4_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('finishing'); }; } frame 15 { hyp1_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('kick'); }; hyp2_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('finishing'); }; hyp3_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('finishing'); }; } frame 16 { hyp1_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('strongatt'); }; hyp2_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('stagger'); }; hyp3_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('rage'); }; hyp4_btn.onRelease = function () { _root.interfaceLayer.Encyclopedia.hyperlinkTo('stun'); }; } } movieClip 622 { } movieClip 648 { } movieClip 652 Encyclopedia { frame 1 { function getTopicPosition(topic) { var v1 = 0; while (v1 < EncyclopediaTopics.length) { if (EncyclopediaTopics[v1][0] == topic) { return v1; } ++v1; } return 0; } function hyperlinkTo(topic) { var v1 = getTopicPosition(topic); changeEntryBy(v1 - EncyclopediaCurrentEntry); } function setReadTopic(nrOfMyTopics) { var v1 = 0; while (v1 < EncyclopediaTopics.length) { if (EncyclopediaMyTopics[nrOfMyTopics][0] == EncyclopediaTopics[v1][0]) { if (!EncyclopediaUnlockedTopics[v1][1]) { EncyclopediaMoveToNextUnread = false; } EncyclopediaUnlockedTopics[v1][1] = true; } ++v1; } } function mouseTouchingTextField(tf_txt) { var v6 = tf_txt._x; var v4 = tf_txt._x + tf_txt._width; var v3 = tf_txt._y; var v5 = tf_txt._y + tf_txt._height; if (_root._xmouse >= v6 and _root._xmouse <= v4 and _root._ymouse >= v3 and _root._ymouse <= v5) { return true; } return false; } function initScroller() { var v1 = scr_bck._height; EncyclopediaScrollerYScale = v1 / EncyclopediaMyTopics.length; scroller._yscale = EncyclopediaScrollerYScale; scroller._y = scr_bck._y; } function updateScroller() { if (!EncyclopediaScrollerDragging) { scroller._y = scr_bck._y + EncyclopediaCurrentEntry * EncyclopediaScrollerYScale; } } function getEntryPosition() { this['ent_' + (EncyclopediaCurrentEntry + 1 - EncyclopediaScrollListPosition)].textColor = '0xF3F3C2'; this['ent_' + (EncyclopediaCurrentEntry + 1 - EncyclopediaScrollListPosition)]._x += 3; EncyclopediaLastEntry = EncyclopediaCurrentEntry + 1 - EncyclopediaScrollListPosition; description.gotoAndStop(EncyclopediaMyTopics[EncyclopediaCurrentEntry][0]); } function getUnreadTopics() { var v2 = 0; var v1 = 0; while (v1 < EncyclopediaUnlockedTopics.length) { if (!EncyclopediaUnlockedTopics[v1][1] and EncyclopediaUnlockedTopics[v1][0]) { v2 += 1; } ++v1; } return v2; } function addEntry(id) { var v2 = 0; while (v2 < EncyclopediaTopics.length) { if (EncyclopediaTopics[v2][0] == id) { EncyclopediaCanShow = true; if (!EncyclopediaUnlockedTopics[v2][0]) { EncyclopediaUnlockedTopics[v2][0] = true; _root.showTopicIndicator(EncyclopediaTopics[v2][1]); } } ++v2; } } function createMyTopics() { EncyclopediaMyTopics = new Array(); var v1 = 0; while (v1 < EncyclopediaTopics.length) { if (EncyclopediaUnlockedTopics[v1][0] == true) { EncyclopediaMyTopics.push(EncyclopediaTopics[v1]); } ++v1; } } function writeEntryList() { var v3 = new TextFormat(); v3.letterSpacing = -0.5; v3.size = 11; v3.bold = true; v3.font = 'Tahoma'; var v4 = EncyclopediaMyTopics.length; if (v4 > 15) { v4 = 15; } var v2 = 0; while (v2 < v4) { this['ent_' + (v2 + 1)].text = EncyclopediaMyTopics[v2 + EncyclopediaScrollListPosition][1]; this['ent_' + (v2 + 1)].setTextFormat(v3); if (topicRead(EncyclopediaMyTopics[v2 + EncyclopediaScrollListPosition][0])) { this['mak_' + (v2 + 1)].gotoAndStop(2); } else { this['mak_' + (v2 + 1)].gotoAndStop(1); } ++v2; } } function topicRead(topicID) { var v1 = 0; while (v1 < EncyclopediaTopics.length) { if (EncyclopediaTopics[v1][0] == topicID and EncyclopediaUnlockedTopics[v1][1]) { return true; } ++v1; } return false; } function whitenTopicList() { var v2 = 1; while (v2 <= 15) { this['ent_' + v2].textColor = '0xFFFFFF'; ++v2; } } function keyEncyclopediaLEFT() { changeEntry(-1); } function keyEncyclopediaRIGHT() { changeEntry(1); } function changeEntryBy(steps) { var v3 = steps / Math.sqrt(steps * steps); var v1 = 1; while (v1 <= Math.sqrt(steps * steps)) { if (v1 == Math.sqrt(steps * steps) and !EncyclopediaScrollerDragging) { EncyclopediaClearTopics = true; } changeEntry(v3); ++v1; } } function changeEntry(dir) { this['ent_' + EncyclopediaLastEntry]._x -= 3; whitenTopicList(); if (EncyclopediaMyTopics.length > EncyclopediaCurrentEntry + dir and EncyclopediaCurrentEntry + dir >= 0) { EncyclopediaCurrentEntry += dir; if (dir > 0 and EncyclopediaCurrentEntry > 7 and EncyclopediaMyTopics.length > EncyclopediaCurrentEntry + 7) { EncyclopediaScrollListPosition += 1; } else { if (dir < 0 and EncyclopediaScrollListPosition > 0 and EncyclopediaMyTopics.length > EncyclopediaCurrentEntry + 8) { EncyclopediaScrollListPosition -= 1; } } } if (EncyclopediaClearTopics) { setReadTopic(EncyclopediaCurrentEntry); } writeEntryList(); getEntryPosition(); updateScroller(); } function hideEncyclopedia() { _y = 480; _alpha = 0; resetEncyclopedia(); } function showEncyclopedia() { if (EncyclopediaCanShow) { resetEncyclopedia(); _root.hideAllTopicIndicators(); _y = 0; _alpha = 100; var v3 = 1; while (v3 <= 15) { this['mak_' + v3].gotoAndStop(2); ++v3; } createMyTopics(); writeEntryList(); getEntryPosition(); initScroller(); moveToUnreadTopic(); if (_root.game.inWorldmap) { hyperlinkTo('worldmap'); } else { hyperlinkTo('running'); } } } function isUnknownTopic(topicID) { var v1 = 0; while (v1 < EncyclopediaTopics.length) { if (EncyclopediaTopics[v1][0] == topicID and !EncyclopediaUnlockedTopics[v1][0]) { return true; } ++v1; } return false; } function moveToUnreadTopic() { EncyclopediaMoveToNextUnread = true; changeEntry(-1); if (EncyclopediaMoveToNextUnread) { var v1 = 0; while (v1 < EncyclopediaMyTopics.length) { if (EncyclopediaMoveToNextUnread) { changeEntry(1); } ++v1; } } if (EncyclopediaMoveToNextUnread) { changeEntryBy(-EncyclopediaMyTopics.length); } EncyclopediaMoveToNextUnread = false; } function resetEncyclopedia() { this['ent_' + EncyclopediaLastEntry]._x -= 3; whitenTopicList(); EncyclopediaCurrentEntry = 0; EncyclopediaScrollListPosition = 0; var v2 = 1; while (v2 <= 15) { this['ent_' + v2].text = ''; this['ent_' + v2]._x = this.ent_0._x; ++v2; } } var EncyclopediaUnlockedTopics = new Array([true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true], [true, true]); var EncyclopediaMyTopics = new Array(); var EncyclopediaCanShow = false; var EncyclopediaCurrentEntry = 0; var EncyclopediaLastEntry = 0; var EncyclopediaScrollListPosition = 0; var EncyclopediaScrollerYScale = 0; var EncyclopediaScrollerDragging = false; var EncyclopediaClearTopics = true; var EncyclopediaMoveToNextUnread = false; var EncyclopediaTopics = new Array(['barrels', 'BARRELS'], ['block', 'BLOCKING'], ['contest', 'CONTEST'], ['fastatt', 'FAST ATTACKS'], ['finishing', 'FINISHING MOVES'], ['food', 'FOOD'], ['health', 'HEALTH'], ['jumpatt', 'JUMP ATTACK'], ['kick', 'KICK'], ['knockdown', 'KNOCKDOWN'], ['rage', 'RAGE'], ['running', 'RUNNING AND JUMPING'], ['pickup', 'PICKUP'], ['stagger', 'STAGGER'], ['strongatt', 'STRONG ATTACKS'], ['stun', 'STUN'], ['worldmap', 'WORLD MAP']); this.onMouseUp = function () { if (EncyclopediaScrollerDragging) { EncyclopediaScrollerDragging = false; EncyclopediaClearTopics = true; setReadTopic(EncyclopediaCurrentEntry); writeEntryList(); stopDrag(); } else { var v2 = 1; while (v2 <= 15) { if (mouseTouchingTextField(this['ent_' + v2]) and v2 + EncyclopediaScrollListPosition <= EncyclopediaMyTopics.length) { if (v2 + EncyclopediaScrollListPosition - EncyclopediaCurrentEntry - 1 != 0) { EncyclopediaClearTopics = false; } changeEntryBy(v2 + EncyclopediaScrollListPosition - EncyclopediaCurrentEntry - 1); } ++v2; } } }; this.onMouseDown = function () { if (scroller.hitTest(_root._xmouse, _root._ymouse, true)) { EncyclopediaScrollerDragging = true; EncyclopediaClearTopics = false; startDrag(scroller, false, scr_bck._x, scr_bck._y, scr_bck._x, scr_bck._y + scr_bck._height - EncyclopediaScrollerYScale); } }; this.onMouseMove = function () { if (EncyclopediaScrollerDragging) { var v2 = scroller._y - scr_bck._y; var v1 = Math.round(v2 / EncyclopediaScrollerYScale) + 1; changeEntryBy(v1 - EncyclopediaCurrentEntry - 1); } }; prev_btn.onRelease = function () { changeEntry(-1); }; next_btn.onRelease = function () { changeEntry(1); }; close_btn.onRelease = function () { _root.closeEncyclopediaFromIt(); }; hideEncyclopedia(); description.gotoAndStop(1); stop(); } } movieClip 656 new_topic_indicator { } movieClip 657 screenSize { } movieClip 664 arrow { frame 1 { stop(); } frame 2 { play(); } frame 10 { stop(); } } movieClip 666 arrow_head_01 { } movieClip 668 arrow_part_01 { } movieClip 671 { } movieClip 672 barrel { frame 1 { stop(); } } movieClip 674 barrel_part_01 { } movieClip 676 barrel_part_02 { } movieClip 678 barrel_part_03 { } movieClip 680 barrel_part_04 { } movieClip 682 barrel_part_05 { } movieClip 684 { } movieClip 686 { } movieClip 687 food { } movieClip 698 food_crate { frame 1 { stop(); } frame 10 { stop(); } } movieClip 700 gib_part_human_01 { } movieClip 701 gib_part_chaosknight_01 { frame 1 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 6 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 10 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 15 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 19 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 24 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 28 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 33 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 37 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 42 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 46 { stop(); } } movieClip 703 gib_part_human_02 { } movieClip 704 gib_part_chaosknight_02 { frame 1 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 6 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 10 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 15 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 19 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 24 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 28 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 33 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 37 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 42 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 46 { stop(); } } movieClip 720 gib_part_human_03 { } movieClip 721 gib_part_chaosknight_03 { frame 1 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 6 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 10 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 15 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 19 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 24 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 28 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 33 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 37 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 42 { _root.addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), this._x, this._y, 0, 2, 1); } frame 46 { stop(); } } movieClip 723 gib_part_skel_01 { } movieClip 725 gib_part_skel_02 { } movieClip 727 gib_part_skel_03 { } movieClip 730 { frame 1 { stop(); } } movieClip 731 gameCursor { frame 1 { stop(); } } movieClip 733 { } movieClip 735 arm_chaosKnight01 { } movieClip 737 arm_swordorc01 { } movieClip 739 head_boworc01 { } movieClip 741 head_spearorc01 { } movieClip 743 head_swordorc01 { } movieClip 749 arrow_hedgehog { frame 1 { stop(); } frame 2 { play(); } frame 18 { stop(); } } movieClip 750 arrow_launch { frame 11 { stop(); } } movieClip 751 { } movieClip 765 { } movieClip 766 miniboss_sign { } movieClip 774 boss_princess_wave { frame 9 { stop(); } } movieClip 787 princess_head01 { frame 23 { stop(); } } movieClip 789 boss_witch_molotov { } movieClip 790 arrow2 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } } movieClip 794 { } movieClip 795 { } movieClip 822 { frame 1 { stop(); } frame 45 { stop(); } } movieClip 838 { } movieClip 867 { frame 1 { stop(); } frame 74 { stop(); } } movieClip 875 { } movieClip 884 { } movieClip 888 { } movieClip 894 { } movieClip 895 { frame 138 { stop(); } } movieClip 902 { frame 1 { stop(); } frame 29 { stop(); } } movieClip 909 { } movieClip 915 { } movieClip 925 fire_01 { frame 9 { stop(); } } movieClip 934 fire_02 { frame 9 { stop(); } } movieClip 941 fire_03 { frame 9 { stop(); } } movieClip 949 fire_04 { frame 8 { stop(); } } movieClip 956 { frame 1 { stop(); } frame 88 { stop(); } } movieClip 960 { frame 1 { stop(); } frame 91 { stop(); } frame 213 { stop(); } } movieClip 966 { } movieClip 972 { frame 1 { stop(); } } movieClip 976 { frame 44 { gotoAndPlay(1); } } movieClip 982 { } movieClip 983 { } movieClip 984 { frame 1 { var i = 1; while (i <= _root.player.levelsCompletedTotal) { this['crow' + i].gotoAndPlay(Math.round(Math.random() * 80 + 1)); ++i; } var i = _root.player.levelsCompletedTotal + 1; while (i <= 20) { this['crow' + i]._alpha = 0; ++i; } } } movieClip 987 { frame 1 { gotoAndStop(3); } frame 2 { gotoAndStop(3); } } movieClip 989 { frame 1 { stop(); } frame 2 { _root.hideMaps(); _parent.bridge.gotoAndStop(1); this.play(); } frame 24 { _parent.bridge.gotoAndPlay(2); } frame 138 { _root.showMaps(); } } movieClip 991 { frame 1 { stop(); } frame 2 { _root.hideMaps(); _parent.mtDam.gotoAndStop(1); _parent.sunbeams.gotoAndStop(1); this.play(); } frame 12 { _parent.mtDam.gotoAndPlay(2); } frame 36 { _parent.sunbeams.gotoAndPlay(2); } frame 131 { _root.showMaps(); } } movieClip 993 { frame 1 { var moffing = false; this.onEnterFrame = function () { if (moffing) { _parent._x += 3; } }; } frame 1 { stop(); } frame 2 { moffing = true; _root.hideMaps(); _parent.pass.gotoAndStop(1); _parent.dragons.play(); this.play(); } frame 31 { _parent.pass.gotoAndPlay(2); } frame 139 { moffing = false; _root.showMaps(); } } movieClip 995 { frame 1 { stop(); } frame 2 { _root.menuLayer.worldMap_fixed.worldMap._x = -_root.menuLayer.worldMap_fixed.worldMap.mapPosUAW._x; _root.menuLayer.worldMap_fixed.worldMap._y = -_root.menuLayer.worldMap_fixed.worldMap.mapPosUAW._y; _root.hideMaps(); _parent.undeadArmyWalk.gotoAndPlay(2); this.play(); } frame 116 { _root.showMaps(); } } movieClip 997 { frame 1 { stop(); } frame 2 { _root.hideMaps(); _parent.undeadArmyWalk.gotoAndPlay('end_middle'); this.play(); } frame 138 { _root.showMaps(); } } movieClip 998 { } movieClip 1001 { } movieClip 1012 { frame 1 { stop(); } frame 2 { btn_start.onRelease = function () { _root.reset_second(); }; back_btn.onRelease = function () { _root.hideBossySign(); }; } frame 3 { btn_start.onRelease = function () { _root.reset_second(); }; btn_boss.onRelease = function () { _root.player.startFromCheckpoint = true; _root.reset_second(); }; back_btn.onRelease = function () { _root.hideBossySign(); }; } } movieClip 1016 { frame 27 { stop(); } } movieClip 1017 worldMap_fixed { frame 1 { _root.startMusic(11); } } movieClip 1019 { } movieClip 1020 { } movieClip 1023 { } movieClip 1025 { } movieClip 1027 { } movieClip 1029 { } movieClip 1031 { } movieClip 1033 { } movieClip 1035 { } movieClip 1037 { } movieClip 1047 { } movieClip 1065 { frame 1 { stop(); } frame 2 { back_btn.onRelease = function () { _root.addBtnSound(); gotoAndStop('hide'); }; hzlancer_btn.onRelease = function () { getURL('http://hzlancer.newgrounds.com/', '_blank'); }; gurt_btn.onRelease = function () { getURL('http://gurt.newgrounds.com/', '_blank'); }; } } movieClip 1074 { frame 1 { function hideThisMSG() { this._x -= 1000; } btnBack.onRelease = function () { _root.addBtnSound(); _parent.showingWarning = false; hideThisMSG(); }; newGame.onRelease = function () { _root.startNewGame(); _parent.showingWarning = false; hideThisMSG(); }; } } movieClip 1075 { frame 1 { function changeWarningMSG() { warningMsg._x += 1000; } function hideWarningMSG() { warningMsg._x -= 1000; } var showingWarning = false; var optShow = false; this.warningMsg._x -= 1000; this.opt.gotoAndStop('hide'); btn_credits.onRelease = function () { _root.addBtnSound(); if (optShow) { optShow = false; opt.gotoAndStop('hide'); } if (showingWarning) { hideWarningMSG(); showingWarning = false; } if (cred._currentFrame == 1) { cred.gotoAndStop('show'); } else { cred.gotoAndStop('hide'); } }; btn_options.onRelease = function () { _root.addBtnSound(); cred.gotoAndStop('hide'); if (optShow) { optShow = false; opt.gotoAndStop('hide'); } else { optShow = true; opt.gotoAndStop('show'); if (showingWarning) { hideWarningMSG(); showingWarning = false; } } }; btn_cheat.onRelease = function () {}; btn_continue.onRelease = function () { _root.addBtnSound(); _root.showMap(); }; btn_newGame.onRelease = function () { _root.addBtnSound(); cred.gotoAndStop('hide'); optShow = false; opt.gotoAndStop('hide'); if (!_root.oldSavedGameExist) { _root.startNewGame(); } else { if (!showingWarning) { changeWarningMSG(); showingWarning = true; } else { if (showingWarning) { hideWarningMSG(); showingWarning = false; } } } }; if (!_root.oldSavedGameExist) { continue_fade._x += 200; btn_continue._x -= 200; } } } movieClip 1076 menu_fixed { frame 1 { _root.startMusic(10); } } movieClip 1082 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 4 { _root.addStepSound(); } } movieClip 1091 { frame 3 { _root.startPlayerJump(); } frame 5 { stop(); } frame 8 { stop(); } } movieClip 1096 { frame 5 { _root.pickupBarrel(); } frame 6 { stop(); } } movieClip 1100 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 1 { _root.pickupBarrel(); } frame 2 { _root.player.immortal = true; } frame 3 { _root.pickupBarrel(); _root.barrelAway(); } frame 12 { _root.player.immortal = false; _root.barrelThrowFinished(); } } movieClip 1106 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 1 { _root.addSound('swing_f_01.wav', 70, 0, 0); } frame 2 { _root.player.velX = _root.player.dirX; _root.playerAttack('att_f_1'); } frame 3 { _root.player.velX = 0; _root.player.nextAttackPossible = true; } frame 9 { _root.endAttack(); } } movieClip 1113 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 1 { _root.addSound('swing_f_02.wav', 140, 0, 0); } frame 3 { _root.player.velX = _root.player.dirX; _root.playerAttack('att_f_2'); } frame 4 { _root.player.velX = 0; _root.player.nextAttackPossible = true; } frame 9 { _root.endAttack(); } } movieClip 1120 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 1 { _root.addSound('swing_f_03.wav', 120, 0, 0); } frame 3 { _root.player.velX = _root.player.dirX; _root.playerAttack('att_f_3'); } frame 5 { _root.player.velX = 0; } frame 9 { _root.endAttack(); } } movieClip 1124 { frame 1 { _root.playerAttack('attack_jump'); } frame 4 { stop(); } } movieClip 1129 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 5 { _root.addSound('swing_s_01.wav', 90, 0, 0); } frame 7 { _root.player.velX = _root.player.dirX * 4; _root.playerAttack('att_s'); } frame 8 { _root.player.velX = 0; } frame 13 { _root.endAttack(); } } movieClip 1137 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 3 { _root.addSound('swing_s_02.wav', 80, 0, 0); } frame 5 { _root.player.velX = _root.player.dirX * 4; _root.playerAttack('att_s_run'); } frame 6 { _root.player.velX = 0; } frame 13 { _root.endAttack(); } } movieClip 1145 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 5 { _root.addStepSound(); } frame 8 { _root.addStepSound(); } } movieClip 1151 { frame 1 { stop(); } frame 5 { stop(); } } movieClip 1155 { frame 3 { stop(); } } movieClip 1159 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1161 { } movieClip 1166 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 5 { stop(); } } movieClip 1170 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 5 { stop(); } } movieClip 1172 { } movieClip 1180 { frame 5 { _root.addSound('kick_0' + Math.round(Math.random() * 1 + 1) + '.wav', 70, 0, 0); } frame 6 { _root.attack_pickup(); } frame 12 { _root.attack_pickup_done(); } } movieClip 1186 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 2 { _root.addSound('kick_0' + Math.round(Math.random() * 1 + 1) + '.wav', 70, 0, 0); } frame 4 { _root.kick(); } } movieClip 1190 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1191 { frame 3 { stop(); } } movieClip 1196 { frame 10 { _root.contest_win(); } } movieClip 1207 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 5 { _root.addSound('finishing_01.wav', 75, 0, 0); _root.setCameraShake(5, 4); } frame 18 { _root.addSound('hitFlesh_01.wav', 100, 0, 0); } frame 39 { _root.finishingKnock(); } frame 42 { _root.finishing_end(); } } movieClip 1218 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 8 { _root.addSound('finishing_04.wav', 100, 0, 0); } frame 9 { _root.setCameraShake(5, 4); } frame 11 { _root.finishingKnock(); } frame 23 { _root.finishing_end(); } } movieClip 1230 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 8 { _root.finishingJumpyRage(); _root.finishingKnock(); } frame 15 { _root.finishing_end(); } } movieClip 1237 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 5 { _root.addSound('swing_s_03.wav', 65, 0, 0); } frame 6 { _root.setCameraShake(5, 4); } frame 7 { _root.finishingJumpy(); _root.finishingKnock(); } frame 13 { _root.finishing_end(); } } movieClip 1244 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 5 { _root.addSound('swing_s_03.wav', 65, 0, 0); } frame 6 { _root.setCameraShake(5, 4); } frame 7 { _root.finishingJumpyRage(); _root.finishingKnock(); } frame 13 { _root.finishing_end(); } } movieClip 1254 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 7 { _root.setCameraShake(5, 5); _root.decap(); _root.finishingKnock(); } frame 13 { _root.finishing_end(); } } movieClip 1255 Actor_PC { } movieClip 1282 { frame 62 { stop(); } } movieClip 1283 Actor_PC_Death { } movieClip 1285 actor_shadow { } movieClip 1316 { frame 34 { stop(); } } movieClip 1323 { } movieClip 1331 { frame 9 { stop(); } } movieClip 1337 { } movieClip 1343 { frame 1 { stop(); } frame 2 { play(); } frame 5 { stop(); } } movieClip 1348 { } movieClip 1350 { } movieClip 1352 { } movieClip 1360 { frame 17 { stop(); } } movieClip 1362 { } movieClip 1366 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1367 { frame 3 { stop(); } } movieClip 1370 { } movieClip 1378 { frame 7 { stop(); } } movieClip 1379 Actor_SkeletonSwordsman { frame 1 { var _paused = false; this.onEnterFrame = function () { if (_root.game.isPaused) { mc.stop(); _paused = true; } else { if (_paused) { _paused = false; mc.play(); } } }; } } movieClip 1384 skel_blood { frame 8 { stop(); } } movieClip 1385 Actor_SkeletonSwordsman_Death { } movieClip 1388 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1397 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 5 { _root.addSound('swing_02.wav', 100, 0, 0); } } movieClip 1408 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1411 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1415 { frame 2 { stop(); } frame 5 { stop(); } } movieClip 1417 { } movieClip 1419 { } movieClip 1421 { } movieClip 1424 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1435 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1449 blood_squirt { frame 1 { _root.addSound('blood_squirt_01.wav', 80, 0, 0); } frame 13 { stop(); } } movieClip 1464 { frame 1 { this.onEnterFrame = function () { if (_currentframe >= 34) { stop(); } else { if (_root.game.isPaused) { stop(); } else { play(); } } }; } frame 10 { _root.addBloodstain(_root.player.posX + 30, _root.player.posY - 10); _root.addBloodstain(_root.player.posX - 30, _root.player.posY - 10); } } movieClip 1478 blood_s_02 { frame 8 { stop(); } } movieClip 1486 blood_s_01 { frame 9 { stop(); } } movieClip 1498 blood_s_03 { frame 9 { stop(); } } movieClip 1506 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 6 { _root.addBloodstain(_root.player.posX + 40 * _root.player.dirX, _root.player.posY - 10); _root.addBloodstain(_root.player.posX + 10 * _root.player.dirX, _root.player.posY - 10); } } movieClip 1519 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1524 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1529 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1530 Actor_OrcSpearman { } movieClip 1559 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 29 { gotoAndStop('prevFram'); } } movieClip 1578 { frame 15 { stop(); } } movieClip 1603 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 34 { gotoAndStop('prevFram'); } } movieClip 1604 Actor_OrcSpearman_Death { } movieClip 1607 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1612 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1616 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 3 { _root.addSound('swing_02.wav', 100, 0, 0); } } movieClip 1623 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 4 { _root.addSound('swing_01.wav', 100, 0, 0); } } movieClip 1632 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1635 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1639 { frame 2 { stop(); } frame 5 { stop(); } } movieClip 1644 { frame 4 { stop(); } } movieClip 1648 { frame 3 { stop(); } } movieClip 1650 { } movieClip 1654 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 3 { _root.addSound('swing_02.wav', 100, 0, 0); } } movieClip 1659 { frame 1 { stop(); } } movieClip 1667 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 7 { _root.addSound('swing_s_03.wav', 70, 0, 0); } } movieClip 1671 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1672 { frame 3 { stop(); } } movieClip 1684 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 7 { _root.addBloodstain(_root.player.posX + 40 * _root.player.dirX, _root.player.posY - 10); _root.addBloodstain(_root.player.posX + 10 * _root.player.dirX, _root.player.posY - 10); } } movieClip 1687 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1696 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1715 { frame 1 { this.onEnterFrame = function () { if (_currentframe >= 34) { stop(); } else { if (_root.game.isPaused) { stop(); } else { play(); } } }; } frame 10 { _root.addBloodstain(_root.player.posX + 30, _root.player.posY - 10); _root.addBloodstain(_root.player.posX - 30, _root.player.posY - 10); } } movieClip 1718 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1727 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1728 Actor_OrcSwordsman { } movieClip 1739 { frame 12 { stop(); } } movieClip 1749 { frame 12 { stop(); } } movieClip 1779 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 49 { gotoAndStop('prevFram'); } } movieClip 1780 Actor_OrcSwordsman_Death { } movieClip 1781 Actor_Crow { frame 1 { var _paused = false; this.onEnterFrame = function () { if (_root.game.isPaused) { mc.stop(); _paused = true; } else { if (_paused) { _paused = false; mc.play(); } } }; } } movieClip 1792 { frame 18 { stop(); } } movieClip 1793 Actor_Crow_Death { } movieClip 1796 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1801 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1812 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1821 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1824 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1828 { frame 2 { stop(); } frame 5 { stop(); } } movieClip 1830 { } movieClip 1835 { frame 1 { stop(); } } movieClip 1837 { } movieClip 1840 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1849 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1872 { frame 1 { this.onEnterFrame = function () { if (_currentframe >= 34) { stop(); } else { if (_root.game.isPaused) { stop(); } else { play(); } } }; } frame 11 { _root.addBloodstain(_root.player.posX + 30, _root.player.posY - 10); _root.addBloodstain(_root.player.posX - 30, _root.player.posY - 10); } } movieClip 1882 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 6 { _root.addBloodstain(_root.player.posX + 40 * _root.player.dirX, _root.player.posY - 10); _root.addBloodstain(_root.player.posX + 10 * _root.player.dirX, _root.player.posY - 10); } } movieClip 1889 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1890 Actor_OrcArcher { } movieClip 1911 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 20 { gotoAndStop('prevFram'); } } movieClip 1925 { frame 11 { stop(); } } movieClip 1944 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 34 { gotoAndStop('prevFram'); } } movieClip 1945 Actor_OrcArcher_Death { } movieClip 1948 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1952 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1963 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1971 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 1976 { frame 1 { stop(); } frame 4 { stop(); } } movieClip 1978 { } movieClip 1980 { } movieClip 1984 { frame 4 { gotoAndPlay(2); } } movieClip 1985 { frame 3 { stop(); } } movieClip 1999 blood_fire_02 { frame 14 { stop(); } } movieClip 2010 blood_fire_01 { frame 13 { stop(); } } movieClip 2017 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 2033 { frame 1 { this.onEnterFrame = function () { if (_currentframe >= 34) { stop(); } else { if (_root.game.isPaused) { stop(); } else { play(); } } }; } } movieClip 2037 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 4 { stop(); } } movieClip 2048 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 7 { _root.setCameraShake(3, 3); } } movieClip 2059 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 2064 { frame 1 { stop(); } frame 4 { stop(); } } movieClip 2065 Actor_ChaosKnight_Mace { } movieClip 2078 { frame 13 { stop(); } } movieClip 2100 { frame 40 { stop(); } } movieClip 2101 Actor_ChaosKnight_Mace_Death { } movieClip 2104 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 2108 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 2117 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 2125 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 2130 { frame 1 { stop(); } frame 4 { stop(); } } movieClip 2132 { } movieClip 2134 { } movieClip 2138 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 2139 { frame 3 { stop(); } } movieClip 2153 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 2165 { frame 1 { this.onEnterFrame = function () { if (_currentframe >= 34) { stop(); } else { if (_root.game.isPaused) { stop(); } else { play(); } } }; } } movieClip 2174 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 2178 { frame 4 { stop(); } } movieClip 2189 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 2194 { frame 2 { stop(); } frame 5 { stop(); } frame 5 { stop(); } } movieClip 2195 Actor_ChaosKnight_Sword { } movieClip 2219 { frame 40 { stop(); } } movieClip 2220 Actor_ChaosKnight_Sword_Death { } movieClip 2234 { frame 14 { stop(); } } movieClip 2239 { } movieClip 2250 { } movieClip 2265 { } movieClip 2276 { frame 13 { stop(); } } movieClip 2277 Actor_SwampMonster_Arm { frame 1 { var _paused = false; this.onEnterFrame = function () { if (_root.game.isPaused) { mc.stop(); _paused = true; } else { if (_paused) { _paused = false; mc.play(); } } }; } } movieClip 2283 land_water { frame 7 { stop(); } } movieClip 2296 { frame 19 { stop(); } } movieClip 2297 Actor_SwampMonster_Arm_Death { } movieClip 2300 { } movieClip 2306 { } movieClip 2317 { } movieClip 2322 { } movieClip 2342 { } movieClip 2351 { } movieClip 2362 { } movieClip 2363 Actor_Boss_Hedgehog { frame 1 { var _paused = false; this.onEnterFrame = function () { if (_root.game.isPaused) { mc.stop(); _paused = true; } else { if (_paused) { _paused = false; mc.play(); } } }; } } movieClip 2366 { } movieClip 2371 { } movieClip 2377 { } movieClip 2383 { } movieClip 2394 { } movieClip 2395 Actor_Boss_Princess { frame 1 { var _paused = false; this.onEnterFrame = function () { if (_root.game.isPaused) { mc.stop(); _paused = true; } else { if (_paused) { _paused = false; mc.play(); } } }; } } movieClip 2430 { frame 65 { stop(); } } movieClip 2431 Actor_Boss_Princess_Death { } movieClip 2435 { } movieClip 2448 { } movieClip 2449 Actor_Boss_SwampMonster { frame 1 { var _paused = false; this.onEnterFrame = function () { if (_root.game.isPaused) { mc.stop(); _paused = true; } else { if (_paused) { _paused = false; mc.play(); } } }; } } movieClip 2495 { frame 1 { _root.changeBossPlateHP(0, 1); } frame 15 { _root.addPart('gib_part_human_', 3, _parent._x, _parent._y - 50, 10, -10, true, false, 10, 5); _root.addPart('gib_part_human_', 3, _parent._x, _parent._y - 50, -10, -10, true, false, 10, 5); _root.addPart('gib_part_human_', 3, _parent._x, _parent._y - 50, 0, -10, true, false, 20, 5); _root.addPart('gib_part_human_', 3, _parent._x, _parent._y - 50, 0, -10, true, false, 20, 5); _root.addPart('gib_part_human_', 3, _parent._x, _parent._y - 50, -20, -10, true, false, 10, 5); _root.addPart('gib_part_human_', 3, _parent._x, _parent._y - 50, -10, -10, true, false, 10, 5); _root.addPart('gib_part_human_', 3, _parent._x, _parent._y - 50, -5, -10, true, false, 20, 5); _root.addPart('gib_part_human_', 3, _parent._x, _parent._y - 50, 0, -10, true, false, 20, 5); } frame 39 { gotoAndPlay('loop'); } } movieClip 2496 Actor_Boss_SwampMonster_Death { } movieClip 2499 { } movieClip 2515 land_dirt { frame 10 { stop(); } } movieClip 2521 jump_dirt { frame 10 { stop(); } } movieClip 2529 { frame 30 { _root.setCameraShake(6, 6); } } movieClip 2541 { frame 2 { _root.BOSS_TROLL_pickup(); } frame 3 { _root.BOSS_TROLL_pickup(); } frame 4 { _root.BOSS_TROLL_pickup(); } frame 15 { _root.BOSS_TROLL_pickup(); } frame 16 { _root.BOSS_TROLL_pickup(); } frame 27 { stop(); } } movieClip 2556 { } movieClip 2600 { frame 1 { _root.changeBossPlateHP(0, 1); } frame 49 { _root.BOSS_TROLL_DEAD_HIT_MTDAM(); } frame 66 { stop(); } } movieClip 2623 { frame 1 { _root.setCameraShake(6, 6); } frame 27 { _root.setCameraShake(6, 6); } frame 34 { stop(); } } movieClip 2624 Actor_Boss_Troll { frame 1 { var _paused = false; this.onEnterFrame = function () { if (_root.game.isPaused) { mc.stop(); _paused = true; } else { if (_paused) { _paused = false; mc.play(); } } }; } } movieClip 2625 Actor_Boss_Troll_Death { } movieClip 2628 { } movieClip 2633 { } movieClip 2639 { frame 11 { _parent.gotoAndStop('idle'); } } movieClip 2643 { frame 6 { _parent.gotoAndStop('idle'); } } movieClip 2644 Actor_Boss_Witch { frame 1 { var _paused = false; this.onEnterFrame = function () { if (_root.game.isPaused) { mc.stop(); _paused = true; } else { if (_paused) { _paused = false; mc.play(); } } }; } } movieClip 2684 { frame 13 { stop(); } } movieClip 2718 { frame 110 { _root.levelFinished(); } frame 133 { stop(); } } movieClip 2719 Actor_Boss_DemonOMG_Death { } movieClip 2722 { } movieClip 2729 { } movieClip 2733 { } movieClip 2737 { frame 13 { _root.demonOMGSummon(); _parent.gotoAndStop('idle'); } } movieClip 2745 { } movieClip 2757 { } movieClip 2780 { frame 17 { _root.demonOMGChain(); } } movieClip 2789 { } movieClip 2823 { } movieClip 2824 Actor_Boss_DemonOMG { frame 1 { var _paused = false; this.onEnterFrame = function () { if (_root.game.isPaused) { mc.stop(); _paused = true; } else { if (_paused) { _paused = false; mc.play(); } } }; } } movieClip 2831 { frame 5 { stop(); } } movieClip 2832 boss_troll_stone_01 { frame 26 { _root.BOSS_TROLL_stoneImpact(); } frame 27 { stop(); } } movieClip 2835 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } } movieClip 2841 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 2 { _root.addSound('swing_f_01.wav', 70, 0, 0); } } movieClip 2848 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 2 { _root.addSound('swing_f_02.wav', 140, 0, 0); } } movieClip 2855 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 2 { _root.addSound('swing_f_03.wav', 120, 0, 0); } } movieClip 2860 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 5 { _root.addSound('swing_s_01.wav', 90, 0, 0); } } movieClip 2868 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 3 { _root.addSound('swing_s_02.wav', 80, 0, 0); } } movieClip 2872 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 4 { _root.addStepSound(); } } movieClip 2881 { frame 5 { stop(); } frame 8 { stop(); } } movieClip 2883 { } movieClip 2889 { frame 1 { stop(); } frame 5 { stop(); } } movieClip 2897 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 5 { _root.addStepSound(); } frame 8 { _root.addStepSound(); } } movieClip 2901 { frame 5 { _root.addEffect_sparks(_root.player); gotoAndPlay('loop'); } } movieClip 2906 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 6 { stop(); } } movieClip 2910 { frame 1 { this.onEnterFrame = function () { if (_root.game.isPaused) { stop(); } else { play(); } }; } frame 5 { stop(); } } movieClip 2914 { frame 4 { stop(); } } movieClip 2916 { } movieClip 2924 { frame 5 { _root.addSound('kick_0' + Math.round(Math.random() * 1 + 1) + '.wav', 70, 0, 0); } frame 12 { stop(); } } movieClip 2928 { } movieClip 2929 Actor_Boss_DarkCopy { } movieClip 2941 barrel_explosion { frame 26 { stop(); } } movieClip 2947 barrel_part_trail_01 { frame 11 { stop(); } } movieClip 2953 barrel_part_trail_02 { frame 11 { stop(); } } movieClip 2959 barrel_part_trail_03 { frame 11 { stop(); } } movieClip 2964 bash_effect { frame 8 { stop(); } } movieClip 2971 blood_gib_01 { frame 8 { stop(); } } movieClip 2974 bloodstain_01 { frame 2 { stop(); } } movieClip 2977 bloodstain_02 { frame 2 { stop(); } } movieClip 2980 bloodstain_03 { frame 2 { stop(); } } movieClip 3000 bloodstain_water_01 { frame 31 { stop(); } } movieClip 3016 bloodstain_water_02 { frame 28 { stop(); } } movieClip 3033 bloodstain_water_03 { frame 28 { stop(); } } movieClip 3039 impact_smoke { frame 10 { stop(); } } movieClip 3046 jump_snow { frame 10 { stop(); } } movieClip 3050 jump_water { frame 10 { stop(); } } movieClip 3058 knockdown_dirt { frame 11 { stop(); } } movieClip 3063 knockdown_water { frame 7 { stop(); } } movieClip 3069 land_snow { frame 7 { stop(); } } movieClip 3075 matchwood { frame 10 { stop(); } } movieClip 3081 matchwood_l { frame 10 { stop(); } } movieClip 3089 sparks_01 { frame 9 { stop(); } } movieClip 3097 sparks_02 { frame 9 { stop(); } } movieClip 3105 sparks_03 { frame 9 { stop(); } } movieClip 3110 knockdown_snow { frame 6 { stop(); } } movieClip 3119 blood_slime_01 { frame 9 { stop(); } } movieClip 3127 blood_slime_02 { frame 8 { stop(); } } movieClip 3135 blood_slime_03 { frame 9 { stop(); } } movieClip 3140 chaos_deathblood_link { frame 13 { stop(); } } movieClip 3151 boss_witch_molo_explosion { frame 21 { stop(); } } movieClip 3158 boss_witch_molotov_trace { frame 8 { stop(); } } movieClip 3162 { } movieClip 3164 { } movieClip 3166 { } movieClip 3168 { } movieClip 3170 { } movieClip 3172 { } movieClip 3174 { } movieClip 3176 { } movieClip 3177 { } movieClip 3178 { } movieClip 3180 { } movieClip 3182 { } movieClip 3184 { } movieClip 3186 { } movieClip 3188 { } movieClip 3190 { } movieClip 3192 { } movieClip 3194 { } movieClip 3196 { } movieClip 3198 { } movieClip 3200 { } movieClip 3202 { } movieClip 3204 { } movieClip 3205 { } movieClip 3207 { } movieClip 3208 level_01_foreground { } movieClip 3210 { } movieClip 3215 { } movieClip 3217 { } movieClip 3219 { frame 2 { stop(); } } movieClip 3221 { frame 2 { stop(); } } movieClip 3223 { frame 2 { stop(); } } movieClip 3225 { frame 2 { stop(); } } movieClip 3227 { frame 2 { stop(); } } movieClip 3228 level_01 { frame 1 { function lvl01_zoneCave_wave01dead() { _root.tutorialRage(); _root.setMinCamPos(this.region_border_min_1); _root.setMaxCamPos(this.region_border_max_1); _root.spawnEnemy(this.archer_after_first_cave, 'ARCHER_1_S', -1, 'nothing'); } function lvl01_zoneEnd_wave01dead() { this.end_enemy_3._x += 40; _root.addEntryInEncyclopedia('t_uni'); _root.spawnEnemy(this.end_enemy_3, 'SWORDSMAN_1', -1, '/waveID-w2/onDeathRunScript-w2Death/'); this.end_enemy_3._x += 40; _root.spawnEnemy(this.end_enemy_3, 'SWORDSMAN_1', -1, '/waveID-w2/onDeathRunScript-w2Death/'); this.end_enemy_3._x -= 80; _root.spawnEnemy(this.end_enemy_3, 'UNI_LVL_1', -1, '/waveID-w2/onDeathRunScript-w2Death/'); } function w2Death() { _root.levelFinished(); } function lvl01_enemy01dead() { this.jumpacross._y += 300; _root.setMaxCamPos(this.region_border_max_1); } _root.startMusic(5); _root.spawnPlayer(this.playerSpawnPoint); _root.setMinCamPos(this.region_border_min_1); _root.setMaxCamPos(this.region_border_max_first); this.groundCollision._alpha = 0; this.deathgaps._alpha = 0; _root.setThunder(0, 0); } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1_TUTORIAL', 1, '/waveID-lvl01_enemy01/onDeathRunScript-lvl01_enemy01dead/'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 540 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_2); _root.setMaxCamPos(_parent.region_border_max_2); _root.spawnEnemy(_parent.first_skeleton, 'SKELETON_1', -1, '/waveID-lvl01_zoneCave_wave01/onDeathRunScript-lvl01_zoneCave_wave01dead/'); this._x -= 5000; } } } instance first_skeleton of movieClip 3227 { } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { this._x -= 5000; _root.spawnEnemy(_parent.end_enemy_1, 'SWORDSMAN_1', -1, '/waveID-lvl01_zoneEnd_wave01/onDeathRunScript-lvl01_zoneEnd_wave01dead/'); _root.spawnEnemy(_parent.end_enemy_2, 'SWORDSMAN_1', -1, '/waveID-lvl01_zoneEnd_wave01/onDeathRunScript-lvl01_zoneEnd_wave01dead/'); _root.spawnEnemy(_parent.end_enemy_3, 'SWORDSMAN_1', -1, '/waveID-lvl01_zoneEnd_wave01/onDeathRunScript-lvl01_zoneEnd_wave01dead/'); } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 200 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-70/explosive-0/mustCheckExplosive-1/'); this._y -= 5000; this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.addEntryInEncyclopedia('t_ba2'); _root.addEntryInEncyclopedia('t_ba1'); this._x -= 5000; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 200 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { this._y -= 500; _root.showTutorialGuide(2); } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { this._y -= 500; _root.showTutorialGuide(3); } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { this._y -= 500; _root.fadeTutorialGuide(); } } } instance jumpacross of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { this._y -= 500; _root.showTutorialGuide(4); } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { this._y -= 500; _root.showTutorialGuide(5); } } } } movieClip 3232 { } movieClip 3235 { } movieClip 3237 { } movieClip 3239 { } movieClip 3241 { } movieClip 3243 { } movieClip 3244 { } movieClip 3246 { } movieClip 3248 { } movieClip 3250 { } movieClip 3252 { } movieClip 3255 { } movieClip 3257 { } movieClip 3258 level_02_foreground { } movieClip 3261 { } movieClip 3263 { } movieClip 3280 { } movieClip 3282 { } movieClip 3283 Level_02 { frame 1 { function lvl02_zoneWaterEnd_wave01dead() { _root.spawnEnemy(this.marker_right, 'SWORDSMAN_1', 1, '/waveID-lvl02_zoneWaterEnd_wave02/onDeathRunScript-lvl02_zoneWaterEnd_wave02dead/'); _root.spawnEnemy(this.marker_left, 'SPEARMAN_1', -1, '/waveID-lvl02_zoneWaterEnd_wave02/onDeathRunScript-lvl02_zoneWaterEnd_wave02dead/'); } function lvl02_zoneWaterEnd_wave02dead() { _root.setMaxCamPos(this.region_border_max_1); _root.spawnEnemy(this.marker_right, 'SWORDSMAN_1', 1, '/waveID-lvl02_zoneEnd_wave01/onDeathRunScript-lvl02_zoneEnd_wave01dead/'); _root.spawnEnemy(this.marker_last_enemies, 'SWORDSMAN_1', 1, '/waveID-lvl02_zoneEnd_wave01/onDeathRunScript-lvl02_zoneEnd_wave01dead/'); this.marker_last_enemies._x += 40; _root.spawnEnemy(this.marker_last_enemies, 'SWORDSMAN_1', 1, '/waveID-lvl02_zoneEnd_wave01/onDeathRunScript-lvl02_zoneEnd_wave01dead/'); this.marker_last_enemies._x += 40; _root.spawnEnemy(this.marker_last_enemies, 'ARCHER_1', -1, '/waveID-lvl02_zoneEnd_wave01/onDeathRunScript-lvl02_zoneEnd_wave01dead/'); } function lvl02_zoneEnd_wave01dead() { _root.levelFinished(); } function lvl02_zoneBurningHouse_wave01dead() { _root.spawnEnemy(this.burning_house_right, 'SWORDSMAN_1', 1, '/waveID-lvl02_zoneBurningHouse_wave02/onDeathRunScript-lvl02_zoneBurningHouse_wave02dead/'); _root.spawnEnemy(this.burning_house_left, 'SWORDSMAN_1', 1, '/waveID-lvl02_zoneBurningHouse_wave02/onDeathRunScript-lvl02_zoneBurningHouse_wave02dead/'); this.burning_house_right._x += 40; _root.spawnEnemy(this.burning_house_right, 'SWORDSMAN_1', 1, '/waveID-lvl02_zoneBurningHouse_wave02/onDeathRunScript-lvl02_zoneBurningHouse_wave02dead/'); this.burning_house_right._x -= 40; } function lvl02_zoneBurningHouse_wave02dead() { _root.spawnEnemy(this.burning_house_right, 'SWORDSMAN_1', 1, 'nothing'); _root.setMaxCamPos(this.region_border_max_1); } function lvl02_zoneBurningHouse_wave03dead() { _root.setMaxCamPos(this.region_border_max_1); } function changeSound(point, maxDist, maxVol) { var v2 = _root.player.posX - point; if (Math.sqrt(v2 * v2) < maxDist * 1) { sound_fire_1.setVolume(((maxDist - Math.sqrt(v2 * v2)) / maxDist) * maxVol * 1.4); sound_fire_1.setPan(-(v2 / (maxDist / 100))); } } _root.startMusic(6); _root.spawnPlayer(this.playerSpawnPoint); _root.setMinCamPos(this.region_border_min_1); _root.setMaxCamPos(this.region_border_max_1); this.groundCollision._alpha = 0; this.water._alpha = 0; this.deathgaps._alpha = 0; _root.setThunder(0, 0); _root.createEmptyMovieClip('myFireSound_1', 12303); var sound_fire_1 = new Sound(_root.myFireSound_1); sound_fire_1.attachSound('firebig1.wav'); sound_fire_1.setVolume(0); sound_fire_1.start(); sound_fire_1.onSoundComplete = function () { sound_fire_1.start(); }; this.onEnterFrame = function () { if (_root.player.movingInXAxis) { changeSound(this.fire_1._x, 350, 100); changeSound(this.fire_2._x, 250, 75); } }; } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_3); _root.setMaxCamPos(_parent.region_border_max_3); _root.spawnEnemy(_parent.burning_house_left, 'SWORDSMAN_1', 1, '/waveID-lvl02_zoneBurningHouse_wave01/onDeathRunScript-lvl02_zoneBurningHouse_wave01dead/'); _root.spawnEnemy(_parent.burning_house_right, 'SWORDSMAN_1', 1, '/waveID-lvl02_zoneBurningHouse_wave01/onDeathRunScript-lvl02_zoneBurningHouse_wave01dead/'); _root.gameEvent.nrLeftInWave -= 1; this._x -= 5000; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-70/explosive-0/'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1_S', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 302 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_2); _root.setMaxCamPos(_parent.region_border_max_2); _root.spawnEnemy(_parent.marker_left, 'SWORDSMAN_1', 1, '/waveID-lvl02_zoneWaterEnd_wave01/onDeathRunScript-lvl02_zoneWaterEnd_wave01dead/'); _root.spawnEnemy(_parent.marker_right, 'SWORDSMAN_1', 1, '/waveID-lvl02_zoneWaterEnd_wave01/onDeathRunScript-lvl02_zoneWaterEnd_wave01dead/'); this._x -= 5000; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 302 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 302 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } } movieClip 3287 { } movieClip 3290 { } movieClip 3291 { } movieClip 3293 { } movieClip 3294 level_03_foreground { } movieClip 3296 { } movieClip 3297 Level_03 { frame 1 { function lvl03_zoneBurningHouse_wave01dead() { _root.spawnEnemy(this.marker_left_1_0, 'SWORDSMAN_1', 1, '/waveID-lvl03_zoneBurningHouse_wave02/onDeathRunScript-lvl03_zoneBurningHouse_wave02dead/'); _root.spawnEnemy(this.marker_right_1_1, 'SWORDSMAN_1', 1, '/waveID-lvl03_zoneBurningHouse_wave02/onDeathRunScript-lvl03_zoneBurningHouse_wave02dead/'); _root.spawnEnemy(this.marker_right_1_0, 'SWORDSMAN_1', 1, '/waveID-lvl03_zoneBurningHouse_wave02/onDeathRunScript-lvl03_zoneBurningHouse_wave02dead/'); } function lvl03_zoneBurningHouse_wave02dead() { _root.setMaxCamPos(this.region_border_max_1); _root.spawnEnemy(this.burning_house_enemy2, 'ARCHER_1', -1, 'nothing'); _root.spawnEnemy(this.burning_house_enemy1, 'ARCHER_1', -1, 'nothing'); } function wSpecialDeath() { _root.setMaxCamPos(this.region_border_max_1); } function lvl03_zoneEnd_wave01dead() { _root.spawnEnemy(this.marker_left_2_0, 'SWORDSMAN_1', 1, '/waveID-lvl03_zoneEnd_wave02/onDeathRunScript-lvl03_zoneEnd_wave02dead/'); _root.spawnEnemy(this.marker_right_2_0, 'SWORDSMAN_1', -1, '/waveID-lvl03_zoneEnd_wave02/onDeathRunScript-lvl03_zoneEnd_wave02dead/'); _root.gameEvent.nrLeftInWave -= 1; } function lvl03_zoneEnd_wave02dead() { _root.spawnEnemy(this.marker_left_2_0, 'SWORDSMAN_1', 1, '/waveID-lvl03_zoneEnd_wave03/onDeathRunScript-lvl03_zoneEnd_wave03dead/'); _root.spawnEnemy(this.marker_right_2_0, 'SWORDSMAN_1', -1, '/waveID-lvl03_zoneEnd_wave03/onDeathRunScript-lvl03_zoneEnd_wave03dead/'); } function lvl03_zoneEnd_wave03dead() { _root.spawnEnemy(this.marker_right_2_0, 'UNI_CHAOSKNIGHT', -1, '/waveID-w14/onDeathRunScript-wlastdeath/'); } function wlastdeath() { _root.levelFinished(); } function changeSound(point, maxDist, maxVol) { var v2 = _root.player.posX - point; if (Math.sqrt(v2 * v2) < maxDist * 1) { sound_fire_1.setVolume(((maxDist - Math.sqrt(v2 * v2)) / maxDist) * maxVol * 1.4); sound_fire_1.setPan(-(v2 / (maxDist / 100))); } } _root.startMusic(5); _root.spawnPlayer(this.playerSpawnPoint); _root.setMinCamPos(this.region_border_min_1); _root.setMaxCamPos(this.region_border_max_1); this.groundCollision._alpha = 0; _root.setThunder(15, 5); _root.createEmptyMovieClip('myFireSound_1', 12303); var sound_fire_1 = new Sound(_root.myFireSound_1); sound_fire_1.attachSound('firebig1.wav'); sound_fire_1.setVolume(0); sound_fire_1.start(); sound_fire_1.onSoundComplete = function () { sound_fire_1.start(); }; this.onEnterFrame = function () { changeSound(this.fire_1._x, 350, 100); }; } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.addEntryInEncyclopedia('c_kik'); this._x -= 5000; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_2); _root.setMaxCamPos(_parent.region_border_max_2); _root.spawnEnemy(_parent.marker_left_1_0, 'SWORDSMAN_1', 1, '/waveID-lvl03_zoneBurningHouse_wave01/onDeathRunScript-lvl03_zoneBurningHouse_wave01dead/'); _root.spawnEnemy(_parent.marker_right_1_0, 'SWORDSMAN_1', 1, '/waveID-lvl03_zoneBurningHouse_wave01/onDeathRunScript-lvl03_zoneBurningHouse_wave01dead/'); _root.gameEvent.nrLeftInWave -= 1; this._x -= 5000; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_3); _root.spawnEnemy(_parent.marker_left_2_1, 'SWORDSMAN_1', 1, '/waveID-lvl03_zoneEnd_wave01/onDeathRunScript-lvl03_zoneEnd_wave01dead/'); _root.spawnEnemy(_parent.marker_right_2_0, 'SWORDSMAN_1', 1, '/waveID-lvl03_zoneEnd_wave01/onDeathRunScript-lvl03_zoneEnd_wave01dead/'); _root.gameEvent.nrLeftInWave -= 1; _root.startRain(20, 2); this._x -= 5000; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-100/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-100/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-100/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-100/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-100/explosive-1/'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-100/explosive-0/'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-100/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-100/explosive-0/'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 340 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.addEntryInEncyclopedia('c_jat'); this._x -= 5000; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_C); _root.setMaxCamPos(_parent.region_border_min_3); _root.spawnEnemy(_parent.skel_1, 'SKELETON_1', 1, '/waveID-wSpecial/onDeathRunScript-wSpecialDeath/'); _root.spawnEnemy(_parent.skel_2, 'SKELETON_1', 1, '/waveID-wSpecial/onDeathRunScript-wSpecialDeath/'); this._x -= 5000; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-5/explosive-0/'); this._alpha = 0; } } } } movieClip 3299 { } movieClip 3302 { } movieClip 3304 { } movieClip 3306 { } movieClip 3308 { } movieClip 3310 { } movieClip 3312 { } movieClip 3314 { } movieClip 3317 { } movieClip 3320 level_04_foreground { } movieClip 3322 { } movieClip 3324 { } movieClip 3326 { frame 2 { stop(); } } movieClip 3327 Level_04 { frame 1 { function lvl04_zoneFirst_wave01dead() { _root.spawnEnemy(this.marker_right_1_0, 'SWORDSMAN_1', -1, '/waveID-lvl04_zoneFirst_wave02/onDeathRunScript-lvl04_zoneFirst_wave02dead/'); _root.spawnEnemy(this.marker_left_1_0, 'SWORDSMAN_1', -1, '/waveID-lvl04_zoneFirst_wave02/onDeathRunScript-lvl04_zoneFirst_wave02dead/'); _root.gameEvent.nrLeftInWave -= 1; } function lvl04_zoneFirst_wave02dead() { _root.spawnEnemy(this.marker_right_1_0, 'SPEARMAN_1', -1, '/waveID-lvl04_zoneFirst_wave03/onDeathRunScript-lvl04_zoneFirst_wave03dead/'); _root.spawnEnemy(this.marker_right_1_0, 'SWORDSMAN_1', -1, '/waveID-lvl04_zoneFirst_wave03/onDeathRunScript-lvl04_zoneFirst_wave03dead/'); } function lvl04_zoneFirst_wave03dead() { _root.setMinCamPos(this.region_border_min_1); _root.setMaxCamPos(this.region_border_max_1); _root.spawnEnemy(this.marker_archer_spawn_1, 'ARCHER_1', -1, 'nothing'); _root.spawnEnemy(this.marker_archer_spawn_1, 'SPEARMAN_1', -1, 'nothing'); } function lvl04_zoneLast_wave01dead() { this.archer_end_trigger._y += 500; } function lvl04_zoneLast_wave02dead() { _root.spawnEnemy(this.marker_left_2_0, 'SKELETON_1', 1, '/waveID-lvl04_zoneLast_wave03/onDeathRunScript-lvl04_zoneLast_wave03dead/'); _root.spawnEnemy(this.archer_2, 'UNI_LVL_4', 1, '/waveID-lvl04_zoneLast_wave03/onDeathRunScript-lvl04_zoneLast_wave03dead/'); } function lvl04_zoneLast_wave03dead() { _root.levelFinished(); } function changeSound(point, maxDist, maxVol) { var v2 = _root.player.posX - point; if (Math.sqrt(v2 * v2) < maxDist * 1) { sound_fire_1.setVolume(((maxDist - Math.sqrt(v2 * v2)) / maxDist) * maxVol * 1.4); sound_fire_1.setPan(-(v2 / (maxDist / 100))); } } _root.startMusic(6); _root.spawnPlayer(this.playerSpawnPoint); _root.setMinCamPos(this.region_border_min_1); _root.setMaxCamPos(this.region_border_max_1); this.groundCollision._alpha = 0; this.deathpits._alpha = 0; _root.createEmptyMovieClip('myFireSound_1', 12303); var sound_fire_1 = new Sound(_root.myFireSound_1); sound_fire_1.attachSound('firebig1.wav'); sound_fire_1.setVolume(0); sound_fire_1.start(); sound_fire_1.onSoundComplete = function () { sound_fire_1.start(); }; this.onEnterFrame = function () { if (_root.player.movingInXAxis) { changeSound(this.fire_1._x, 350, 100); } }; } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 200 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, '/waveID-lvl01_zoneCave_wave01/onDeathRunScript-lvl01_zoneCave_wave01dead/'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_2); _root.setMaxCamPos(_parent.region_border_max_2); _root.spawnEnemy(_parent.marker_right_1_0, 'SWORDSMAN_1', -1, '/waveID-lvl04_zoneFirst_wave01/onDeathRunScript-lvl04_zoneFirst_wave01dead/'); _root.spawnEnemy(_parent.marker_left_1_0, 'SWORDSMAN_1', -1, '/waveID-lvl04_zoneFirst_wave01/onDeathRunScript-lvl04_zoneFirst_wave01dead/'); _root.setNextWaveIDTimer(3); this._x -= 5000; } } } instance of movieClip 3326 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 370 and this._alpha == 100) { _root.spawnEnemy(this, 'SPEARMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3326 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 360 and this._alpha == 100) { _root.spawnEnemy(this, 'SPEARMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.spawnEnemy(_parent.archer_2, 'ARCHER_1_S', -1, '/waveID-lvl04_zoneLast_wave01/onDeathRunScript-lvl04_zoneLast_wave01dead/'); _root.spawnEnemy(_parent.archer_3, 'ARCHER_1_S', -1, '/waveID-lvl04_zoneLast_wave01/onDeathRunScript-lvl04_zoneLast_wave01dead/'); this._x -= 5000; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-100/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-100/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-60/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-70/explosive-1/'); this._alpha = 0; } } } instance archer_end_trigger of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_3); _root.spawnEnemy(_parent.marker_right_2_0, 'SWORDSMAN_1', -1, '/waveID-lvl04_zoneLast_wave02/onDeathRunScript-lvl04_zoneLast_wave02dead/'); _root.spawnEnemy(_parent.marker_left_2_0, 'SPEARMAN_1', -1, '/waveID-lvl04_zoneLast_wave02/onDeathRunScript-lvl04_zoneLast_wave02dead/'); _root.spawnEnemy(_parent.marker_right_2_0, 'SPEARMAN_1', -1, '/waveID-lvl04_zoneLast_wave02/onDeathRunScript-lvl04_zoneLast_wave02dead/'); this._x -= 5000; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-100/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-70/explosive-0/'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-4/explosive-1/'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 430 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } } movieClip 3336 { } movieClip 3339 { } movieClip 3340 level_05_foreground { } movieClip 3341 { } movieClip 3345 { } movieClip 3347 { } movieClip 3348 { } movieClip 3349 Level_05 { frame 1 { function lvl05_wave1dead() { _root.spawnEnemy(this.mark_1_right, 'SWORDSMAN_1', 1, '/waveID-lvl05_wave2/onDeathRunScript-lvl05_wave2dead/'); _root.spawnEnemy(this.mark_1_right, 'SPEARMAN_1', 1, '/waveID-lvl05_wave2/onDeathRunScript-lvl05_wave2dead/'); _root.spawnEnemy(this.mark_1_left, 'SWORDSMAN_1', -1, '/waveID-lvl05_wave2/onDeathRunScript-lvl05_wave2dead/'); _root.setNextWaveIDTimer(8); } function lvl05_wave2dead() { lvl05_wave3dead(); } function lvl05_wave3dead() { _root.spawnEnemy(this.mark_1_right, 'SWORDSMAN_1', -1, '/waveID-lvl05_wave4/onDeathRunScript-lvl05_wave4dead/'); _root.spawnEnemy(this.mark_1_left, 'SWORDSMAN_1', 1, '/waveID-lvl05_wave4/onDeathRunScript-lvl05_wave4dead/'); _root.setNextWaveIDTimer(8); } function lvl05_wave4dead() { _root.spawnEnemy(this.mark_1_right, 'SPEARMAN_1', -1, '/waveID-lvl05_wave5/onDeathRunScript-lvl05_wave5dead/'); _root.spawnEnemy(this.mark_1_left, 'SPEARMAN_1', 1, '/waveID-lvl05_wave5/onDeathRunScript-lvl05_wave5dead/'); } function lvl05_wave5dead() { this.mark_1_right._x += 40; _root.spawnEnemy(this.mark_1_right, 'SPEARMAN_1', -1, 'nothing'); _root.setMaxCamPos(this.region_border_max_1); } function lvl05_wave10dead() { _root.spawnEnemy(this.skel_1, 'SKELETON_1', 1, '/waveID-lvl05_wave11/onDeathRunScript-lvl05_wave11dead/'); _root.spawnEnemy(this.mark_2_left, 'SKELETON_1', -1, '/waveID-lvl05_wave11/onDeathRunScript-lvl05_wave11dead/'); _root.spawnEnemy(this.mark_2_right, 'SKELETON_1', 1, '/waveID-lvl05_wave11/onDeathRunScript-lvl05_wave11dead/'); } function lvl05_wave11dead() { _root.levelFinished(); } function changeSound(point, maxDist, maxVol) { var v2 = _root.player.posX - point; if (Math.sqrt(v2 * v2) < maxDist * 1) { sound_fire_1.setVolume(((maxDist - Math.sqrt(v2 * v2)) / maxDist) * maxVol * 1.4); sound_fire_1.setPan(-(v2 / (maxDist / 100))); } } _root.startMusic(5); _root.spawnPlayer(this.playerSpawnPoint); _root.setMinCamPos(this.region_border_min_1); _root.setMaxCamPos(this.region_border_max_1); this.groundCollision._alpha = 0; this.deathgaps._alpha = 0; this.deathpits._alpha = 0; _root.createEmptyMovieClip('myFireSound_1', 12303); var sound_fire_1 = new Sound(_root.myFireSound_1); sound_fire_1.attachSound('firebig1.wav'); sound_fire_1.setVolume(0); sound_fire_1.start(); sound_fire_1.onSoundComplete = function () { sound_fire_1.start(); }; this.onEnterFrame = function () { if (_root.player.movingInXAxis) { changeSound(this.fire_1._x, 250, 75); } }; } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_2); _root.setMaxCamPos(_parent.region_border_max_2); _root.spawnEnemy(_parent.mark_1_right, 'SPEARMAN_1', 1, '/waveID-lvl05_wave1/onDeathRunScript-lvl05_wave1dead/'); _root.spawnEnemy(_parent.mark_1_left, 'SPEARMAN_1', -1, '/waveID-lvl05_wave1/onDeathRunScript-lvl05_wave1dead/'); _root.setNextWaveIDTimer(8); this._x -= 5000; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.spawnEnemy(_parent.first_skeleton_2, 'SKELETON_1', 1, 'nothing'); _root.spawnEnemy(_parent.second_skeleton_2, 'SKELETON_1', -1, 'nothing'); this._x -= 5000; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 650 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3326 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'SPEARMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.spawnEnemy(_parent.archer_1, 'SPEARMAN_1', 1, 'nothing'); _root.spawnEnemy(_parent.archer_3, 'SWORDSMAN_1', 1, 'nothing'); this._x -= 5000; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 10 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_3); _root.spawnEnemy(_parent.mark_2_right, 'SWORDSMAN_1', 1, '/waveID-lvl05_wave10/onDeathRunScript-lvl05_wave10dead/'); _root.spawnEnemy(_parent.mark_2_left, 'SPEARMAN_1', -1, '/waveID-lvl05_wave10/onDeathRunScript-lvl05_wave10dead/'); _parent.mark_2_left._x -= 40; _root.spawnEnemy(_parent.mark_2_left, 'SWORDSMAN_1', -1, '/waveID-lvl05_wave10/onDeathRunScript-lvl05_wave10dead/'); this._x -= 5000; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/mustCheckExplosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 50 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } } movieClip 3354 { } movieClip 3359 { } movieClip 3361 { } movieClip 3364 { } movieClip 3366 { } movieClip 3374 { } movieClip 3390 { } movieClip 3391 { frame 1 { stop(); } frame 2 { _root.setCameraShake(200, 8); } frame 23 { stop(); } } movieClip 3392 level_06_foreground { } movieClip 3399 { frame 10 { gotoAndPlay(1); } frame 11 { stop(); } frame 12 { stop(); } } movieClip 3400 { } movieClip 3403 { } movieClip 3404 { } movieClip 3406 { } movieClip 3407 Level_06 { frame 1 { function w1Death() { _root.spawnEnemy(this.mark_1_0, 'SWORDSMAN_1', 1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.spawnEnemy(this.mark_2_0, 'SPEARMAN_1', 1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.spawnEnemy(this.mark_2_1, 'SWORDSMAN_1', 1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.gameEvent.nrLeftInWave -= 1; } function w2Death() { _root.spawnEnemy(this.mark_up_2, 'SWORDSMAN_1', -1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.spawnEnemy(this.mark_2_1, 'ARCHER_1', -1, '/waveID-w3/onDeathRunScript-w3Death/'); } function w3Death() { _root.spawnEnemy(this.mark_1_0, 'SKELETON_1', -1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.mark_2_1, 'SKELETON_1', -1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.mark_S_1, 'SKELETON_1', -1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.mark_S_0, 'SKELETON_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); } function w4Death() { _root.setMaxCamPos(this.region_border_max_1); } _root.startMusic(7); if (!_root.player.startFromCheckpoint) { _root.spawnPlayer(this.playerSpawnPoint); _root.setMinCamPos(this.region_border_min_1); } else { _root.spawnPlayer(this.playerSpawnPointCP); _root.setMinCamPos(this.region_border_min_CP); } _root.setMaxCamPos(this.region_border_max_1); this.groundCollision._alpha = 0; this.water._alpha = 0; this.deathgaps._alpha = 0; } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_bossF); _root.startMusic(1); _root.showBossPlate('troll'); _root.addEntryInEncyclopedia('t_bos'); _root.rollCameraYAxis = -30; this._x -= 5000; } } } instance of movieClip 2499 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'BOSS_TROLL', 1, 'nothing'); this._y -= 1000; this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_3); _root.setMaxCamPos(_parent.region_border_max_3); _root.spawnEnemy(_parent.burning_house_left, 'SWORDSMAN_1', 1, '/waveID-lvl02_zoneBurningHouse_wave01/onDeathRunScript-lvl02_zoneBurningHouse_wave01dead/'); _root.spawnEnemy(_parent.burning_house_right, 'SWORDSMAN_1', 1, '/waveID-lvl02_zoneBurningHouse_wave01/onDeathRunScript-lvl02_zoneBurningHouse_wave01dead/'); this._x -= 5000; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.spawnEnemy(_parent.spawn_up_1, 'SWORDSMAN_1', 1, 'nothing'); _root.spawnEnemy(_parent.spawn_up_1, 'SPEARMAN_1', 1, 'nothing'); this._x -= 5000; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 470 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'UNI_LVL_6', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3326 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SPEARMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-10/explosive-1/'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 2); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_2); _root.setMaxCamPos(_parent.region_border_max_2); _root.spawnEnemy(_parent.mark_2_0, 'SWORDSMAN_1', 1, '/waveID-w1/onDeathRunScript-w1Death/'); _root.spawnEnemy(_parent.mark_2_1, 'SWORDSMAN_1', 1, '/waveID-w1/onDeathRunScript-w1Death/'); this._x -= 5000; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 650 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-5/explosive-0/'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 550 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_SPECIAL', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.player.startFromCheckpoint = false; this._x -= 5000; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 10) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 470 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 470 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } } movieClip 3410 { } movieClip 3413 { } movieClip 3415 { } movieClip 3417 { } movieClip 3418 level_07_foreground { } movieClip 3420 { } movieClip 3421 Level_07 { frame 1 { function wave01Dead() { _root.spawnEnemy(this.mark_2_1, 'SWORDSMAN_1', 1, '/waveID-w2/onDeathRunScript-wave02Dead/'); _root.spawnEnemy(this.mark_2_0, 'SWORDSMAN_1', 1, '/waveID-w2/onDeathRunScript-wave02Dead/'); _root.gameEvent.nrLeftInWave -= 1; } function wave02Dead() { _root.spawnEnemy(this.mark_1_1, 'SPEARMAN_1', -1, '/waveID-w35/onDeathRunScript-wave035Dead/'); this.mark_1_1._x += 40; _root.spawnEnemy(this.mark_1_1, 'SPEARMAN_1', -1, '/waveID-w35/onDeathRunScript-wave035Dead/'); } function wave035Dead() { _root.spawnEnemy(this.mark_2_0, 'SPEARMAN_1', 1, 'nothing'); _root.spawnEnemy(this.mark_1_0, 'SPEARMAN_1', -1, 'nothing'); _root.spawnEnemy(this.mark_1_1, 'UNI_LVL_7', -1, 'nothing'); _root.setMaxCamPos(this.region_border_max_2); } function wave04Dead() { _root.spawnEnemy(this.mark_4_0, 'SPEARMAN_1', 1, '/waveID-w5/onDeathRunScript-wave05Dead/'); _root.spawnEnemy(this.mark_4_1, 'SPEARMAN_1', 1, '/waveID-w5/onDeathRunScript-wave05Dead/'); _root.gameEvent.nrLeftInWave -= 1; } function wave05Dead() { _root.spawnEnemy(this.mark_4_0, 'SWORDSMAN_1', 1, '/waveID-w6/onDeathRunScript-wave06Dead/'); _root.spawnEnemy(this.mark_4_1, 'SWORDSMAN_1', 1, '/waveID-w6/onDeathRunScript-wave06Dead/'); } function wave06Dead() { _root.setMaxCamPos(this.region_border_max_3); } function waveStartFinale() { _root.spawnEnemy(this.mark_fr_0, 'SWORDSMAN_1', -1, '/waveID-wf1/onDeathRunScript-wave01finaleDead/'); _root.spawnEnemy(this.mark_fr_1, 'SWORDSMAN_1', -1, '/waveID-wf1/onDeathRunScript-wave01finaleDead/'); _root.spawnEnemy(this.mark_fl_1, 'SWORDSMAN_1', 1, '/waveID-wf1/onDeathRunScript-wave01finaleDead/'); _root.gameEvent.nrLeftInWave -= 1; } function wave01finaleDead() { _root.spawnEnemy(this.mark_fl_1, 'SPEARMAN_1', 1, '/waveID-wf2/onDeathRunScript-wave02finaleDead/'); _root.spawnEnemy(this.mark_fr_1, 'SWORDSMAN_1', -1, '/waveID-wf2/onDeathRunScript-wave02finaleDead/'); _root.spawnEnemy(this.mark_fl_1, 'SWORDSMAN_1', 1, '/waveID-wf2/onDeathRunScript-wave02finaleDead/'); } function wave02finaleDead() { _root.levelFinished(); } function changeSound(point, maxDist, maxVol) { var v2 = _root.player.posX - point; if (Math.sqrt(v2 * v2) < maxDist * 1) { sound_fire_1.setVolume(((maxDist - Math.sqrt(v2 * v2)) / maxDist) * maxVol * 1.4); sound_fire_1.setPan(-(v2 / (maxDist / 100))); } } _root.startMusic(6); _root.spawnPlayer(this.playerSpawnPoint); _root.setMinCamPos(this.region_border_min_1); _root.setMaxCamPos(this.region_border_max_1); this.groundCollision._alpha = 0; _root.startAmbientMusic(1); _root.game.weatherType = 'rain'; _root.setThunder(20, 3); _root.createEmptyMovieClip('myFireSound_1', 12303); var sound_fire_1 = new Sound(_root.myFireSound_1); sound_fire_1.attachSound('firebig1.wav'); sound_fire_1.setVolume(0); sound_fire_1.start(); sound_fire_1.onSoundComplete = function () { sound_fire_1.start(); }; this.onEnterFrame = function () { if (_root.player.movingInXAxis) { changeSound(this.fire_1._x, 200, 100); changeSound(this.fire_2._x, 200, 100); changeSound(this.fire_3._x, 200, 100); } }; } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_2); _root.spawnEnemy(_parent.mark_1_1, 'SPEARMAN_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _root.spawnEnemy(_parent.mark_2_0, 'SPEARMAN_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _root.gameEvent.nrLeftInWave -= 1; this._x -= 5000; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_4); this._x -= 5000; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_3); _root.spawnEnemy(_parent.mark_3_0, 'SPEARMAN_1', 1, '/waveID-w4/onDeathRunScript-wave04Dead/'); _root.spawnEnemy(_parent.mark_3_1, 'SWORDSMAN_1', 1, '/waveID-w4/onDeathRunScript-wave04Dead/'); _root.spawnEnemy(_parent.mark_4_0, 'SWORDSMAN_1', 1, '/waveID-w4/onDeathRunScript-wave04Dead/'); _root.gameEvent.nrLeftInWave -= 1; this._x -= 5000; } } } instance of movieClip 3326 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 800 and this._alpha == 100) { _root.spawnEnemy(this, 'SPEARMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-70/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-70/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-40/explosive-0/'); this._alpha = 0; } } } instance of movieClip 3326 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SPEARMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-70/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-70/explosive-0/'); this._alpha = 0; } } } instance of movieClip 3326 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 370 and this._alpha == 100) { _root.spawnEnemy(this, 'SPEARMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3326 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SPEARMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3326 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SPEARMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3326 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SPEARMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3326 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SPEARMAN_1', 1, '/waveID-wStartFinale/onDeathRunScript-waveStartFinale/'); _root.gameEvent.nrLeftInWave -= 1; this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 650 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 650 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-40/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-70/explosive-0/'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-40/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-40/explosive-0/'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_SPECIAL', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-70/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-70/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-70/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-70/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-70/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-40/explosive-0/'); this._alpha = 0; } } } instance of movieClip 302 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 302 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 650 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } } movieClip 3425 { } movieClip 3428 level_08_foreground { } movieClip 3430 { } movieClip 3432 { } movieClip 3433 Level_08 { frame 1 { function wave01Dead() { _root.spawnEnemy(this.mark_1_r0, 'SWORDSMAN_1', -1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.spawnEnemy(this.mark_1_l0, 'SWORDSMAN_1', 1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.setNextWaveIDTimer(4); } function w2Death() { _root.spawnEnemy(this.mark_1_r1, 'SPEARMAN_1', -1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.spawnEnemy(this.mark_1_l0, 'SWORDSMAN_1', 1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.spawnEnemy(this.mark_1_l1, 'SWORDSMAN_1', 1, '/waveID-w3/onDeathRunScript-w3Death/'); } function w3Death() { _root.spawnEnemy(this.mark_1_r0, 'ARCHER_1', -1, 'nothing'); _root.spawnEnemy(this.mark_1_r1, 'ARCHER_1', -1, 'nothing'); _root.setMaxCamPos(this.region_border_max_u); } function wave05Dead() { _root.spawnEnemy(this.mark_2_r0, 'SWORDSMAN_1', -1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_2_l0, 'SWORDSMAN_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.gameEvent.nrLeftInWave -= 1; } function w6Death() { _root.spawnEnemy(this.mark_2_r0, 'SPEARMAN_1', -1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_2_r0, 'ARCHER_1', -1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_2_l1, 'SPEARMAN_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); } function w7Death() { this.mark_skel1._x += 80; _root.spawnEnemy(this.mark_skel1, 'SKELETON_1', 1, '/waveID-w8/onDeathRunScript-w8Death/'); this.mark_skel1._x -= 80; _root.spawnEnemy(this.mark_skel1, 'SKELETON_1', 1, '/waveID-w8/onDeathRunScript-w8Death/'); this.mark_skel1._x -= 80; _root.spawnEnemy(this.mark_skel1, 'SKELETON_1', 1, '/waveID-w8/onDeathRunScript-w8Death/'); } function w8Death() { _root.spawnBarrel(this.b1, '/HP-50/explosive-1/mustCheckExplosive-1/'); _root.spawnBarrel(this.b2, '/HP-7/explosive-1/mustCheckExplosive-1/'); _root.spawnBarrel(this.b3, '/HP-7/explosive-1/mustCheckExplosive-1/'); _root.spawnBarrel(this.b4, '/HP-7/explosive-1/mustCheckExplosive-1/'); _root.spawnEnemy(this.mark_a1, 'ARCHER_1_S', -1, '/waveID-warch/onDeathRunScript-warchDeath/'); _root.spawnEnemy(this.mark_a2, 'ARCHER_1_S', -1, '/waveID-warch/onDeathRunScript-warchDeath/'); _root.spawnEnemy(this.mark_a3, 'ARCHER_1_S', -1, '/waveID-warch/onDeathRunScript-warchDeath/'); _root.spawnEnemy(this.mark_a4, 'ARCHER_1_S', -1, '/waveID-warch/onDeathRunScript-warchDeath/'); _root.setMaxCamPos(this.region_border_max_4); } function warchDeath() { _root.setMaxCamPos(this.region_border_max_boss); } _root.startMusic(7); if (!_root.player.startFromCheckpoint) { _root.spawnPlayer(this.playerSpawnPoint); _root.setMinCamPos(this.region_border_min_1); _root.setMaxCamPos(this.region_border_max_1); } else { _root.spawnPlayer(this.playerSpawnPointCP); _root.setMinCamPos(this.region_border_min_CP); _root.setMaxCamPos(this.region_border_max_boss); } this.groundCollision._alpha = 0; this.water._alpha = 0; _root.startAmbientMusic(1); _root.game.weatherType = 'rain'; _root.setThunder(15, 3); } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_3); _root.spawnEnemy(_parent.mark_2_l0, 'SWORDSMAN_1', 1, '/waveID-w5/onDeathRunScript-wave05Dead/'); _root.spawnEnemy(_parent.mark_2_l0, 'SPEARMAN_1', 1, '/waveID-w5/onDeathRunScript-wave05Dead/'); _root.spawnEnemy(_parent.mark_2_r0, 'ARCHER_1', 1, '/waveID-w5/onDeathRunScript-wave05Dead/'); _root.spawnEnemy(_parent.mark_2_l1, 'SWORDSMAN_1', 1, '/waveID-w5/onDeathRunScript-wave05Dead/'); _root.gameEvent.nrLeftInWave -= 2; this._x -= 5000; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 2435 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 230 and this._alpha == 100) { _root.setMinCamPos(_parent.region_border_min_boss); _root.spawnEnemy(this, 'BOSS_SWAMPMONSTER', -1, 'nothing'); _root.startMusic(1); _root.showBossPlate('zoggot'); this._x += 1000; this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_2); _root.spawnEnemy(_parent.mark_1_r0, 'SPEARMAN_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _root.spawnEnemy(_parent.mark_1_r0, 'SWORDSMAN_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _root.spawnEnemy(_parent.mark_1_l0, 'SPEARMAN_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _root.gameEvent.nrLeftInWave -= 1; this._x -= 5000; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-60/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-60/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-60/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-60/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-60/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-60/explosive-0/'); this._alpha = 0; } } } instance of movieClip 302 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 302 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 302 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 302 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-60/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-60/explosive-0/'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 2); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-60/explosive-0/'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.player.startFromCheckpoint = false; this._x -= 5000; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-10/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-60/explosive-0/'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 302 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } } movieClip 3437 { } movieClip 3440 level_09_foreground { } movieClip 3442 { } movieClip 3444 { } movieClip 3445 Level_09 { frame 1 { function wave01Dead() { _root.spawnEnemy(this.mark_1_r0, 'SPEARMAN_1', -1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.spawnEnemy(this.mark_1_l0, 'SWORDSMAN_1', 1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.gameEvent.nrLeftInWave -= 1; } function w2Death() { _root.spawnEnemy(this.mark_1_l0, 'SPEARMAN_1', 1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.spawnEnemy(this.mark_1_r0, 'ARCHER_1', 1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.spawnEnemy(this.mark_1_r1, 'SWORDSMAN_1', -1, '/waveID-w3/onDeathRunScript-w3Death/'); } function w3Death() { _root.spawnEnemy(this.mark_1_r1, 'SWORDSMAN_1', -1, 'nothing'); _root.setMaxCamPos(this.region_border_max_2); } function wave05Dead() { _root.spawnEnemy(this.mark_2_r1, 'SWORDSMAN_1', -1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_2_l1, 'SWORDSMAN_1', -1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.gameEvent.nrLeftInWave -= 1; } function w6Death() { w7Death(); } function w7Death() { _root.spawnEnemy(this.mark_2_l0, 'SWORDSMAN_1', 1, '/waveID-w8/onDeathRunScript-w8Death/'); _root.spawnEnemy(this.mark_2_l1, 'SPEARMAN_1', 1, '/waveID-w8/onDeathRunScript-w8Death/'); _root.spawnEnemy(this.mark_2_r1, 'SPEARMAN_1', -1, '/waveID-w8/onDeathRunScript-w8Death/'); } function w8Death() { _root.spawnEnemy(this.mark_2_r1, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w9/onDeathRunScript-w9Death/'); _root.spawnEnemy(this.mark_2_l0, 'CHAOSKNIGHT_MACE_1', 1, '/waveID-w9/onDeathRunScript-w9Death/'); } function w9Death() { _root.setMaxCamPos(this.region_border_max_3); } function wave10Dead() { _root.spawnEnemy(this.mark_3_l0, 'SWORDSMAN_1', 1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.spawnEnemy(this.mark_3_l1, 'SWORDSMAN_1', 1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.spawnEnemy(this.mark_3_l2, 'SWORDSMAN_1', 1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.spawnEnemy(this.mark_3_r0, 'SWORDSMAN_1', -1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.spawnEnemy(this.mark_3_r1, 'SWORDSMAN_1', -1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.spawnEnemy(this.mark_3_r2, 'SWORDSMAN_1', -1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.gameEvent.nrLeftInWave -= 1; } function w11Death() { _root.spawnEnemy(this.mark_3_l0, 'SWORDSMAN_1', 1, '/waveID-w12/onDeathRunScript-w12Death/'); _root.spawnEnemy(this.mark_3_l1, 'SPEARMAN_1', 1, '/waveID-w12/onDeathRunScript-w12Death/'); _root.spawnEnemy(this.mark_3_l2, 'SWORDSMAN_1', 1, '/waveID-w12/onDeathRunScript-w12Death/'); _root.spawnEnemy(this.mark_3_r0, 'SPEARMAN_1', -1, '/waveID-w12/onDeathRunScript-w12Death/'); _root.spawnEnemy(this.mark_3_r1, 'SWORDSMAN_1', -1, '/waveID-w12/onDeathRunScript-w12Death/'); _root.spawnEnemy(this.mark_3_r2, 'SPEARMAN_1', -1, '/waveID-w12/onDeathRunScript-w12Death/'); } function w12Death() { _root.spawnEnemy(this.mark_3_r1, 'ARCHER_1', -1, 'nothing'); _root.spawnEnemy(this.mark_3_r3, 'SPEARMAN_1', -1, 'nothing'); _root.setMaxCamPos(this.region_border_max_end); } function wave15Dead() { _root.spawnEnemy(this.mark_4_l0, 'ARCHER_1', 1, '/waveID-w16/onDeathRunScript-w16Death/'); _root.spawnEnemy(this.mark_4_l1, 'SPEARMAN_1', 1, '/waveID-w16/onDeathRunScript-w16Death/'); _root.spawnEnemy(this.mark_4_r1, 'SWORDSMAN_1', -1, '/waveID-w16/onDeathRunScript-w16Death/'); _root.gameEvent.nrLeftInWave -= 1; } function w16Death() { _root.spawnEnemy(this.mark_4_l0, 'SWORDSMAN_1', 1, '/waveID-w17/onDeathRunScript-w17Death/'); _root.spawnEnemy(this.mark_4_l1, 'SWORDSMAN_1', 1, '/waveID-w17/onDeathRunScript-w17Death/'); _root.spawnEnemy(this.mark_4_r0, 'SWORDSMAN_1', 1, '/waveID-w17/onDeathRunScript-w17Death/'); _root.spawnEnemy(this.mark_4_r1, 'SWORDSMAN_1', 1, '/waveID-w17/onDeathRunScript-w17Death/'); } function w17Death() { _root.levelFinished(); } _root.startMusic(5); _root.spawnPlayer(this.playerSpawnPoint); _root.setMinCamPos(this.region_border_min_1); _root.setMaxCamPos(this.region_border_max_1); this.groundCollision._alpha = 0; this.deathgaps._alpha = 0; _root.setThunder(10, 5); } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_4); _root.spawnEnemy(_parent.mark_3_r0, 'SWORDSMAN_1', -1, '/waveID-w10/onDeathRunScript-wave10Dead/'); _root.spawnEnemy(_parent.mark_3_r1, 'SWORDSMAN_1', -1, '/waveID-w10/onDeathRunScript-wave10Dead/'); _root.spawnEnemy(_parent.mark_3_r2, 'SWORDSMAN_1', -1, '/waveID-w10/onDeathRunScript-wave10Dead/'); _root.spawnEnemy(_parent.mark_3_r3, 'SWORDSMAN_1', -1, '/waveID-w10/onDeathRunScript-wave10Dead/'); _root.spawnEnemy(_parent.mark_3_r4, 'SWORDSMAN_1', -1, '/waveID-w10/onDeathRunScript-wave10Dead/'); _root.gameEvent.nrLeftInWave -= 2; _root.startRain(30, 1); _root.changeColour(_root.theWorld, 87, 89, 92, -3, -2, -1); this._x -= 5000; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_2); _root.spawnEnemy(_parent.mark_1_r0, 'SPEARMAN_1', -1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _root.spawnEnemy(_parent.mark_1_l0, 'SPEARMAN_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _root.setNextWaveIDTimer(8); this._x -= 5000; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_3); _root.spawnEnemy(_parent.mark_2_r0, 'ARCHER_1', -1, '/waveID-w5/onDeathRunScript-wave05Dead/'); _root.spawnEnemy(_parent.mark_2_l0, 'SPEARMAN_1', 1, '/waveID-w5/onDeathRunScript-wave05Dead/'); _root.spawnEnemy(_parent.mark_2_l1, 'SPEARMAN_1', 1, '/waveID-w5/onDeathRunScript-wave05Dead/'); _root.setNextWaveIDTimer(5); _root.setThunder(25, 3); _root.forceThunder(); this._x -= 5000; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_end); _root.spawnEnemy(_parent.mark_4_r1, 'SPEARMAN_1', -1, '/waveID-w15/onDeathRunScript-wave15Dead/'); _root.spawnEnemy(_parent.mark_4_l1, 'SPEARMAN_1', 1, '/waveID-w15/onDeathRunScript-wave15Dead/'); _root.setNextWaveIDTimer(5); this._x -= 5000; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1_S', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3326 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SPEARMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 300 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1_S', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1_S', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 3326 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 430 and this._alpha == 100) { _root.spawnEnemy(this, 'SPEARMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 360 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 350 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 350 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 460 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 460 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 240 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/mustCheckExplosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 240 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/mustCheckExplosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } } movieClip 3449 { } movieClip 3471 { frame 1 { stop(); } frame 26 { gotoAndPlay('loop'); } frame 35 { stop(); } } movieClip 3472 level_10_foreground { } movieClip 3475 { } movieClip 3477 { } movieClip 3478 Level_10 { frame 1 { function wave01Dead() { _root.spawnEnemy(this.mark_1_l0, 'ARCHER_1', 1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.spawnEnemy(this.mark_1_l1, 'SWORDSMAN_1', 1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.setNextWaveIDTimer(4); _root.gameEvent.nrLeftInWave -= 1; } function w2Death() { _root.spawnEnemy(this.mark_1_r0, 'ARCHER_1', -1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.spawnEnemy(this.mark_1_l0, 'SWORDSMAN_1', 1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.spawnEnemy(this.mark_1_l1, 'SWORDSMAN_1', 1, '/waveID-w3/onDeathRunScript-w3Death/'); } function w3Death() { _root.spawnEnemy(this.mark_1_r0, 'SPEARMAN_1', -1, 'nothing'); _root.spawnEnemy(this.mark_1_r0, 'ARCHER_1', -1, 'nothing'); _root.setMaxCamPos(this.region_border_max_2); } function wave05Dead() { _root.spawnEnemy(this.mark_2_r0, 'SWORDSMAN_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_2_l1, 'SWORDSMAN_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_2_l0, 'UNI_LVL_10', 1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_2_l2, 'SWORDSMAN_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); } function w6Death() { _root.spawnEnemy(this.mark_2_r1, 'ARCHER_1', -1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_2_r1, 'SWORDSMAN_1', -1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_2_r0, 'SWORDSMAN_1', -1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_2_l1, 'SWORDSMAN_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_2_l2, 'SPEARMAN_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); } function w7Death() { _root.stopRain('windAmbient.wav', 60); _root.setThunder(20, 4); w8Death(); } function w8Death() { _root.spawnEnemy(this.mark_2_r0, 'SWORDSMAN_1', -1, 'nothing'); _root.spawnEnemy(this.mark_2_r0, 'ARCHER_1', -1, 'nothing'); _root.setMaxCamPos(this.region_border_max_end); } function wave10Dead() { w13Death(); } function w11Death() { w13Death(); } function w13Death() { _root.spawnEnemy(this.skel_1, 'SKELETON_1', 1, '/waveID-w14/onDeathRunScript-w14Death/'); _root.spawnEnemy(this.skel_2, 'SKELETON_1', 1, '/waveID-w14/onDeathRunScript-w14Death/'); _root.spawnEnemy(this.skel_4, 'SKELETON_1', -1, '/waveID-w14/onDeathRunScript-w14Death/'); _root.gameEvent.nrLeftInWave -= 1; } function w14Death() { w15Death(); } function w15Death() { _root.spawnEnemy(this.skel_1, 'SKELETON_1', 1, '/waveID-w16/onDeathRunScript-w16Death/'); _root.spawnEnemy(this.skel_2, 'SKELETON_1', -1, '/waveID-w16/onDeathRunScript-w16Death/'); _root.spawnEnemy(this.mark_2_r0, 'SKELETON_1', 1, '/waveID-w16/onDeathRunScript-w16Death/'); _root.spawnEnemy(this.skel_4, 'SKELETON_1', -1, '/waveID-w16/onDeathRunScript-w16Death/'); } function w16Death() { _root.setThunder(0, 0); _root.setMaxCamPos(this.region_border_max_boss); } function changeSound(point, maxDist, maxVol) { var v2 = _root.player.posX - point; if (Math.sqrt(v2 * v2) < maxDist * 1) { sound_fire_1.setVolume(((maxDist - Math.sqrt(v2 * v2)) / maxDist) * maxVol * 1.4); sound_fire_1.setPan(-(v2 / (maxDist / 100))); } } _root.startMusic(7); if (!_root.player.startFromCheckpoint) { _root.spawnPlayer(this.playerSpawnPoint); _root.setMinCamPos(this.region_border_min_1); _root.setMaxCamPos(this.region_border_max_1); _root.startAmbientMusic(1); _root.game.weatherType = 'rain'; _root.setThunder(17, 2); } else { _root.spawnPlayer(this.playerSpawnPointCP); _root.setMinCamPos(this.region_border_max_end); _root.setMaxCamPos(this.region_border_max_boss); } this.groundCollision._alpha = 0; this.deathgaps._alpha = 0; _root.createEmptyMovieClip('myFireSound_1', 12303); var sound_fire_1 = new Sound(_root.myFireSound_1); sound_fire_1.attachSound('firebig1.wav'); sound_fire_1.setVolume(0); sound_fire_1.start(); sound_fire_1.onSoundComplete = function () { sound_fire_1.start(); }; this.onEnterFrame = function () { if (_root.player.movingInXAxis) { changeSound(this.fire_1._x, 350, 100); } }; } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_2); _root.spawnEnemy(_parent.mark_1_r0, 'SWORDSMAN_1', -1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _root.spawnEnemy(_parent.mark_1_l0, 'ARCHER_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _root.gameEvent.nrLeftInWave -= 1; this._x -= 5000; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_3); _root.spawnEnemy(_parent.mark_2_l0, 'SWORDSMAN_1', 1, '/waveID-w5/onDeathRunScript-wave05Dead/'); _root.spawnEnemy(_parent.mark_2_l1, 'SWORDSMAN_1', 1, '/waveID-w5/onDeathRunScript-wave05Dead/'); _root.spawnEnemy(_parent.mark_2_l2, 'SWORDSMAN_1', 1, '/waveID-w5/onDeathRunScript-wave05Dead/'); _root.spawnEnemy(_parent.mark_2_r0, 'ARCHER_1', -1, '/waveID-w5/onDeathRunScript-wave05Dead/'); _root.gameEvent.nrLeftInWave -= 1; this._x -= 5000; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_end); _root.spawnEnemy(_parent.skel_1, 'SKELETON_1', 1, '/waveID-w10/onDeathRunScript-wave10Dead/'); _root.spawnEnemy(_parent.skel_4, 'SKELETON_1', -1, '/waveID-w10/onDeathRunScript-wave10Dead/'); _root.gameEvent.nrLeftInWave -= 1; this._x -= 5000; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 350 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 350 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 350 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 2628 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'BOSS_WITCH', -1, 'nothing'); this._y -= 1000; this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_boss); _root.showBossPlate('witch'); _root.startMusic(1); _root.myObject['enemy' + _root.game.fightingBoss].currAttack = 'startFight'; _root.rollCameraYAxis = -56; this._x -= 5000; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 2); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.player.startFromCheckpoint = false; this._x -= 5000; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 350 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1_S', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } } movieClip 3482 { } movieClip 3485 { } movieClip 3486 level_11_foreground { } movieClip 3489 { } movieClip 3490 Level_11 { frame 1 { function wave01Dead() { _root.spawnEnemy(this.mark_1_r0, 'ARCHER_1', 1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.spawnEnemy(this.mark_1_l1, 'SWORDSMAN_1', 1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.spawnEnemy(this.mark_1_r1, 'SWORDSMAN_1', -1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.gameEvent.nrLeftInWave -= 2; } function w2Death() { _root.spawnEnemy(this.mark_1_r0, 'SWORDSMAN_1', -1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.spawnEnemy(this.mark_1_r0, 'ARCHER_1', 1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.spawnEnemy(this.mark_1_l1, 'SPEARMAN_1', 1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.spawnEnemy(this.mark_1_r1, 'SWORDSMAN_1', -1, '/waveID-w3/onDeathRunScript-w3Death/'); } function w3Death() { w4Death(); } function w4Death() { _root.spawnEnemy(this.mark_1_r1, 'SWORDSMAN_1', -1, 'nothing'); _root.spawnEnemy(this.mark_1_r0, 'ARCHER_1', -1, 'nothing'); _root.spawnEnemy(this.mark_1_r1, 'ARCHER_1', -1, 'nothing'); _root.setMaxCamPos(this.region_border_max_2); } function wave05Dead() { _root.spawnEnemy(this.mark_2_l0, 'SWORDSMAN_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_2_r0, 'ARCHER_1', -1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.setNextWaveIDTimer(3); } function w6Death() { _root.spawnEnemy(this.mark_2_l0, 'SWORDSMAN_1', -1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_2_r0, 'SWORDSMAN_1', -1, '/waveID-w7/onDeathRunScript-w7Death/'); } function w7Death() { _root.spawnEnemy(this.skel_1, 'SKELETON_1', 1, '/waveID-w8/onDeathRunScript-w8Death/'); _root.spawnEnemy(this.skel_2, 'SKELETON_1', -1, '/waveID-w8/onDeathRunScript-w8Death/'); _root.spawnEnemy(this.mark_2_r0, 'SKELETON_1', -1, '/waveID-w8/onDeathRunScript-w8Death/'); } function w8Death() { _root.spawnEnemy(this.mark_2_r0, 'ARCHER_1', -1, 'nothing'); _root.spawnEnemy(this.mark_2_r1, 'ARCHER_1', -1, 'nothing'); _root.setMaxCamPos(this.region_border_max_end); } function wave10Dead() { _root.spawnEnemy(this.mark_3_r1, 'SPEARMAN_1', -1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.spawnEnemy(this.mark_3_r2, 'SPEARMAN_1', -1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.spawnEnemy(this.mark_3_l1, 'SPEARMAN_1', 1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.spawnEnemy(this.mark_3_l2, 'SPEARMAN_1', 1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.gameEvent.nrLeftInWave -= 1; } function w11Death() { _root.spawnEnemy(this.mark_3_r0, 'SWORDSMAN_1', -1, '/waveID-w12/onDeathRunScript-w12Death/'); _root.spawnEnemy(this.mark_3_r1, 'SWORDSMAN_1', -1, '/waveID-w12/onDeathRunScript-w12Death/'); _root.spawnEnemy(this.mark_3_l0, 'SWORDSMAN_1', 1, '/waveID-w12/onDeathRunScript-w12Death/'); _root.spawnEnemy(this.mark_3_l1, 'SPEARMAN_1', 1, '/waveID-w12/onDeathRunScript-w12Death/'); _root.spawnEnemy(this.mark_3_l2, 'SPEARMAN_1', 1, '/waveID-w12/onDeathRunScript-w12Death/'); } function w12Death() { _root.levelFinished(); } _root.startMusic(6); _root.spawnPlayer(this.playerSpawnPoint); _root.setMinCamPos(this.region_border_min_1); _root.setMaxCamPos(this.region_border_max_1); this.groundCollision._alpha = 0; this.deathpits._alpha = 0; this.water._alpha = 0; _root.setThunder(13, 1); } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_2); _root.spawnEnemy(_parent.mark_1_l0, 'SWORDSMAN_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _root.spawnEnemy(_parent.mark_1_l1, 'SWORDSMAN_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _root.setNextWaveIDTimer(5); this._x -= 5000; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_3); _root.spawnBarrel(_parent.mark_2_l0, '/HP-50/explosive-1/'); _root.spawnEnemy(_parent.mark_2_l1, 'SWORDSMAN_1', 1, '/waveID-w5/onDeathRunScript-wave05Dead/'); _root.setNextWaveIDTimer(3); this._x -= 5000; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_end); _root.spawnEnemy(_parent.mark_3_l0, 'SWORDSMAN_1', 1, '/waveID-w10/onDeathRunScript-wave10Dead/'); _root.spawnEnemy(_parent.mark_3_l1, 'SWORDSMAN_1', 1, '/waveID-w10/onDeathRunScript-wave10Dead/'); _root.spawnEnemy(_parent.mark_3_l2, 'SWORDSMAN_1', 1, '/waveID-w10/onDeathRunScript-wave10Dead/'); _root.spawnEnemy(_parent.mark_3_r0, 'SWORDSMAN_1', -1, '/waveID-w10/onDeathRunScript-wave10Dead/'); _root.spawnEnemy(_parent.mark_3_r1, 'SWORDSMAN_1', -1, '/waveID-w10/onDeathRunScript-wave10Dead/'); _root.spawnEnemy(_parent.mark_3_r2, 'SWORDSMAN_1', -1, '/waveID-w10/onDeathRunScript-wave10Dead/'); _root.gameEvent.nrLeftInWave -= 2; this._x -= 5000; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 700 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 700 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 700 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3326 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 350 and this._alpha == 100) { _root.spawnEnemy(this, 'SPEARMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 540 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1_S', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 150 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } } movieClip 3493 { } movieClip 3497 { } movieClip 3499 { } movieClip 3500 Level_12 { frame 1 { function wave01Dead() { _root.spawnEnemy(this.mark_1_r0, 'ARCHER_1', -1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.spawnEnemy(this.mark_1_r0, 'SWORDSMAN_1', -1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.spawnEnemy(this.mark_1_l0, 'SPEARMAN_1', -1, '/waveID-w2/onDeathRunScript-w2Death/'); } function w2Death() { var v3 = 1; while (v3 <= 3) { if (v3 <= 2) { _root.spawnEnemy(this.mark_fun_1, 'SPEARMAN_1', -1, 'nothing'); } else { _root.spawnEnemy(this.mark_fun_1, 'SWORDSMAN_1', -1, 'nothing'); } this.mark_fun_1._x += 50; ++v3; } _root.setMaxCamPos(this.region_border_max_2); } function wave05Dead() { var v3 = 1; while (v3 <= 4) { _root.spawnEnemy(this.mark_fun_2, 'SKELETON_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); this.mark_fun_2._x += 90; ++v3; } } function w6Death() { _root.setThunder(15, 3); _root.forceThunder(); _root.spawnEnemy(this.mark_2_r0, 'ARCHER_1', -1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_2_l0, 'SPEARMAN_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_2_l1, 'SPEARMAN_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.gameEvent.nrLeftInWave -= 2; } function w7Death() { _root.spawnEnemy(this.mark_2_r0, 'ARCHER_1', -1, '/waveID-w8/onDeathRunScript-w8Death/'); _root.spawnEnemy(this.mark_2_r0, 'SWORDSMAN_1', -1, '/waveID-w8/onDeathRunScript-w8Death/'); _root.spawnEnemy(this.mark_2_r1, 'ARCHER_1', -1, '/waveID-w8/onDeathRunScript-w8Death/'); _root.spawnEnemy(this.mark_2_r1, 'SWORDSMAN_1', -1, '/waveID-w8/onDeathRunScript-w8Death/'); _root.setMaxCamPos(this.region_border_max_3); } function w8Death() { var v3 = 1; while (v3 <= 4) { _root.spawnEnemy(this.mark_fun_3, 'SKELETON_1', -1, '/waveID-w11/onDeathRunScript-w11Death/'); this.mark_fun_3._x -= 90; ++v3; } } function w11Death() { _root.setMaxCamPos(this.region_border_max_end); } _root.startMusic(7); if (!_root.player.startFromCheckpoint) { _root.spawnPlayer(this.playerSpawnPoint); _root.setMinCamPos(this.region_border_min_1); _root.setMaxCamPos(this.region_border_max_1); } else { _root.spawnPlayer(this.playerSpawnPointCP); _root.setMinCamPos(this.region_border_min_CP); _root.setMaxCamPos(this.region_border_max_end); } this.groundCollision._alpha = 0; this.deathgaps._alpha = 0; } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.player.startFromCheckpoint = false; this._x -= 5000; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_2); var l = 1; while (l <= 6) { _parent.mark_1_l0._x -= 30 + Math.random() * 20; if (l <= 5) { _root.spawnEnemy(_parent.mark_1_l0, 'SWORDSMAN_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); } else { _root.spawnEnemy(_parent.mark_1_l0, 'SPEARMAN_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); } ++l; } _root.gameEvent.nrLeftInWave -= 2; this._x -= 5000; } } } instance of movieClip 2366 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'BOSS_PRINCESS', -1, 'nothing'); this._y -= 1000; this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 440 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 700 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 700 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_3); _root.spawnEnemy(_parent.mark_2_l0, 'SPEARMAN_1', 1, '/waveID-w5/onDeathRunScript-wave05Dead/'); _root.spawnEnemy(_parent.mark_2_l1, 'SPEARMAN_1', 1, '/waveID-w5/onDeathRunScript-wave05Dead/'); this._x -= 5000; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'UNI_MULTIARCHER', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 2); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_boss); _root.showBossPlate('prin'); _root.startMusic(1); _root.myObject['enemy' + _root.game.fightingBoss].currAttack = 'startFight'; _root.rollCameraYAxis = -10; this._x -= 5000; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } } movieClip 3504 { } movieClip 3507 { } movieClip 3508 { frame 1 { stop(); } frame 2 { if (Math.random() * 100 < 40) { _root.addSound('thunder_' + Math.floor(Math.random() * 4 + 1) + '.wav', 90, -70 + Math.random() * 140, 0); _root.thunderValues.firstSoundDone = true; } else { _root.thunderValues.firstSoundDone = false; } } frame 3 { function randomizeMark(mc) { if (Math.random() * 100 < 80 or _root.thunderValues.firstSoundDone) { mc._alpha = 40 + Math.random() * 60; } else { mc._alpha = 0; } if (Math.random() * 100 < 50) { gotoAndPlay(_currentframe + 1); } } randomizeMark(mark1); } frame 6 { if (Math.random() * 100 < 60 or !_root.thunderValues.firstSoundDone) { if (Math.random() * 100 < 50) { gotoAndPlay(_currentframe + 1); } if (!_root.thunderValues.firstSoundDone) { _root.addSound('thunder_' + Math.floor(Math.random() * 4 + 1) + '.wav', 90, -70 + Math.random() * 140, 0); _root.thunderValues.firstSoundDone = true; } } else { if (!_root.thunderValues.firstSoundDone) { _root.addSound('thunder_' + Math.floor(Math.random() * 4 + 1) + '.wav', 90, -70 + Math.random() * 140, 0); _root.thunderValues.firstSoundDone = true; } gotoAndStop(1); } } frame 8 { function randomizeMark(mc) { if (Math.random() * 100 < 80 or _root.thunderValues.firstSoundDone) { mc._alpha = 40 + Math.random() * 60; } else { mc._alpha = 0; } if (Math.random() * 100 < 50) { gotoAndPlay(_currentframe + 1); } } randomizeMark(mark1); } frame 13 { if (Math.random() * 100 < 50) { _root.addSound('thunder_' + Math.floor(Math.random() * 4 + 1) + '.wav', 90, -70 + Math.random() * 140, 0); } } } movieClip 3511 { } movieClip 3513 { } movieClip 3516 { } movieClip 3518 { } movieClip 3520 { } movieClip 3522 level_13_foreground { } movieClip 3525 { } movieClip 3527 { } movieClip 3528 Level_13 { frame 1 { function wave01Dead() { _root.setMaxCamPos(this.region_border_max_2); _root.spawnEnemy(this.mark_1_r, 'SWORDSMAN_1', -1, 'nothing'); _root.spawnEnemy(this.mark_1_r, 'SPEARMAN_1', -1, 'nothing'); this.mark_1_r._x += 70; _root.spawnEnemy(this.mark_1_r, 'SPEARMAN_1', -1, 'nothing'); _root.spawnEnemy(this.mark_1_r, 'SWORDSMAN_1', -1, 'nothing'); } function wave04Dead() { _root.spawnEnemy(this.mark_2_r, 'SWORDSMAN_1', -1, '/waveID-w5/onDeathRunScript-w5Death/'); this.mark_2_r._x += 40; _root.spawnEnemy(this.mark_2_r, 'SWORDSMAN_1', -1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(this.mark_2_l0, 'SWORDSMAN_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(this.mark_2_l1, 'SWORDSMAN_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.gameEvent.nrLeftInWave -= 1; _root.setNextWaveIDTimer(7); } function w5Death() { this.mark_2_r._x -= 40; _root.spawnEnemy(this.mark_2_r, 'SWORDSMAN_1', -1, '/waveID-w6/onDeathRunScript-w6Death/'); this.mark_2_r._x += 40; _root.spawnEnemy(this.mark_2_r, 'SPEARMAN_1', -1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_2_l0, 'SWORDSMAN_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_2_l1, 'SPEARMAN_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); } function w6Death() { _root.setMaxCamPos(this.region_border_max_end); this.mark_2_r._x -= 40; _root.spawnEnemy(this.mark_2_r, 'SWORDSMAN_1', -1, 'nothing'); this.mark_2_r._x += 40; _root.spawnEnemy(this.mark_2_r, 'ARCHER_1', -1, 'nothing'); _root.spawnEnemy(this.mark_2_r, 'SPEARMAN_1', -1, 'nothing'); } function wave10Dead() { this.skel_1._x += 70; _root.spawnEnemy(this.skel_1, 'SKELETON_1', -1, '/waveID-w11/onDeathRunScript-w11Death/'); this.skel_1._x += 70; _root.spawnEnemy(this.skel_1, 'SKELETON_1', 1, '/waveID-w11/onDeathRunScript-w11Death/'); this.skel_1._x += 70; _root.spawnEnemy(this.skel_1, 'SKELETON_1', -1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.gameEvent.nrLeftInWave -= 1; _root.setNextWaveIDTimer(7); } function w11Death() { _root.spawnEnemy(this.skel_2, 'SKELETON_1', -1, '/waveID-w12/onDeathRunScript-w12Death/'); this.skel_2._x += 70; _root.spawnEnemy(this.skel_2, 'SKELETON_1', 1, '/waveID-w12/onDeathRunScript-w12Death/'); this.skel_2._x += 70; _root.spawnEnemy(this.skel_2, 'SKELETON_1', -1, '/waveID-w12/onDeathRunScript-w12Death/'); this.skel_2._x += 70; _root.spawnEnemy(this.skel_2, 'SKELETON_1', 1, '/waveID-w12/onDeathRunScript-w12Death/'); } function w12Death() { _root.spawnEnemy(this.mark_3_l, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w13/onDeathRunScript-w13Death/'); this.mark_3_l._x -= 40; _root.spawnEnemy(this.mark_3_l, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w13/onDeathRunScript-w13Death/'); this.mark_3_l._x -= 40; _root.spawnEnemy(this.mark_3_l, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w13/onDeathRunScript-w13Death/'); } function w13Death() { _root.levelFinished(); } _root.startMusic(5); _root.spawnPlayer(this.playerSpawnPoint); _root.setMinCamPos(this.region_border_min_1); _root.setMaxCamPos(this.region_border_max_1); this.groundCollision._alpha = 0; this.deathgaps._alpha = 0; this.snow._alpha = 0; _root.setThunder(15, 3); } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { var l = 1; while (l <= 4) { _parent.mark_1_l._x -= 50; _root.spawnEnemy(_parent.mark_1_l, 'SPEARMAN_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); ++l; } this._x -= 5000; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_end); _root.startSnow(15, 2); var l = 1; while (l <= 2) { _parent.mark_3_r._x += 60; _root.spawnEnemy(_parent.mark_3_r, 'SWORDSMAN_1', -1, '/waveID-w10/onDeathRunScript-wave10Dead/'); _parent.mark_3_l._x -= 60; _root.spawnEnemy(_parent.mark_3_l, 'SWORDSMAN_1', 1, '/waveID-w10/onDeathRunScript-wave10Dead/'); ++l; } _root.thunderValues.backgroundThunder = true; this._x -= 5000; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 500 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 200 and this._alpha == 100) { _root.setMinCamPos(_parent.region_border_min_2); _root.spawnEnemy(this, 'SWORDSMAN_1', 1, '/waveID-w4/onDeathRunScript-wave04Dead/'); _root.setNextWaveIDTimer(2); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 300 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3326 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 430 and this._alpha == 100) { _root.spawnEnemy(this, 'SPEARMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 20 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 3326 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 430 and this._alpha == 100) { _root.spawnEnemy(this, 'UNI_CHARGER', 1, 'nothing'); this._alpha = 0; } } } } movieClip 3532 { } movieClip 3535 { } movieClip 3537 { } movieClip 3539 { } movieClip 3541 { } movieClip 3542 { } movieClip 3543 level_14_foreground { } movieClip 3546 { } movieClip 3548 { } movieClip 3549 Level_14 { frame 1 { function wave01Dead() { _root.spawnEnemy(this.mark_1_l0, 'SPEARMAN_1', 1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.spawnEnemy(this.mark_1_l0, 'SWORDSMAN_1', 1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.spawnEnemy(this.mark_1_l1, 'SPEARMAN_1', 1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.setNextWaveIDTimer(8); } function w2Death() { _root.spawnEnemy(this.mark_1_l1, 'SPEARMAN_1', 1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.spawnEnemy(this.mark_1_l0, 'SPEARMAN_1', 1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.spawnEnemy(this.mark_1_r0, 'SWORDSMAN_1', -1, '/waveID-w3/onDeathRunScript-w3Death/'); } function w3Death() { _root.spawnEnemy(this.mark_1_r0, 'SKELETON_1', -1, 'nothing'); _root.setMaxCamPos(this.region_border_max_2); } function w4Death() { _root.spawnEnemy(this.skel_2, 'SKELETON_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(this.skel_4, 'SKELETON_1', -1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(this.skel_5, 'SKELETON_1', -1, '/waveID-w5/onDeathRunScript-w5Death/'); } function w5Death() { _root.spawnEnemy(this.mark_2_l0, 'SWORDSMAN_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); this.mark_2_l0._x -= 40; _root.spawnEnemy(this.mark_2_l0, 'SPEARMAN_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_2_r0, 'SWORDSMAN_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); this.mark_2_r0._x += 40; _root.spawnEnemy(this.mark_2_r0, 'SPEARMAN_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); } function w6Death() { _root.spawnEnemy(this.mark_fire_r, 'SWORDSMAN_1_TUTORIAL', -1, '/waveID-w10/onDeathRunScript-w10Death/'); _root.spawnEnemy(this.mark_fire_l, 'SWORDSMAN_1_TUTORIAL', 1, '/waveID-w10/onDeathRunScript-w10Death/'); _root.spawnEnemy(this.mark_fire_e, 'ARCHER_1_S', -1, '/waveID-w10/onDeathRunScript-w10Death/'); this.mark_fire_e._x += 40; _root.spawnEnemy(this.mark_fire_e, 'ARCHER_1_S', -1, '/waveID-w10/onDeathRunScript-w10Death/'); _root.setMaxCamPos(this.region_border_max_3); } function w10Death() { _root.setMaxCamPos(this.region_border_max_end); } function w11Death() { var v3 = 1; while (v3 <= 6) { _root.spawnEnemy(this.mark_fun_2, 'SKELETON_1', 1, '/waveID-w14/onDeathRunScript-w14Death/'); this.mark_fun_2._x += 60; ++v3; } } function w14Death() { _root.levelFinished(); } function changeSound(point, maxDist, maxVol) { var v2 = _root.player.posX - point; if (Math.sqrt(v2 * v2) < maxDist * 1) { sound_fire_1.setVolume(((maxDist - Math.sqrt(v2 * v2)) / maxDist) * maxVol * 1.4); sound_fire_1.setPan(-(v2 / (maxDist / 100))); } } _root.startMusic(6); _root.spawnPlayer(this.playerSpawnPoint); _root.setMinCamPos(this.region_border_min_1); _root.setMaxCamPos(this.region_border_max_1); this.groundCollision._alpha = 0; this.deathgaps._alpha = 0; this.snow._alpha = 0; _root.startAmbientMusic(2); _root.game.weatherType = 'snow'; _root.setThunder(20, 2); _root.thunderValues.backgroundThunder = true; _root.createEmptyMovieClip('myFireSound_1', 12303); var sound_fire_1 = new Sound(_root.myFireSound_1); sound_fire_1.attachSound('firebig1.wav'); sound_fire_1.setVolume(0); sound_fire_1.start(); sound_fire_1.onSoundComplete = function () { sound_fire_1.start(); }; this.onEnterFrame = function () { if (_root.player.movingInXAxis) { changeSound(this.fire_1._x, 300, 100); } }; } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.spawnEnemy(_parent.skel_1, 'SKELETON_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _parent.skel_1._x += 70; _root.spawnEnemy(_parent.skel_1, 'SKELETON_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _parent.skel_1._x += 70; _root.spawnEnemy(_parent.skel_1, 'SKELETON_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); this._x -= 5000; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.spawnEnemy(_parent.skel_2, 'SKELETON_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(_parent.skel_3, 'SKELETON_1', -1, '/waveID-w4/onDeathRunScript-w4Death/'); this._x -= 5000; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_end); _root.spawnEnemy(_parent.mark_tree, 'SWORDSMAN_1', 1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.spawnEnemy(_parent.mark_fun_4, 'SWORDSMAN_1', -1, '/waveID-w11/onDeathRunScript-w11Death/'); _parent.mark_fun_4._x += 50; _root.spawnEnemy(_parent.mark_fun_4, 'SWORDSMAN_1', -1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.spawnEnemy(_parent.mark_fun_2, 'SWORDSMAN_1', 1, '/waveID-w11/onDeathRunScript-w11Death/'); this._x -= 5000; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 440 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 440 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 440 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } } movieClip 3552 { } movieClip 3555 { } movieClip 3557 level_15_foreground { } movieClip 3559 { } movieClip 3561 { } movieClip 3563 { } movieClip 3564 Level_15 { frame 1 { function wave01Dead() { if (w1counter < 3) { _root.spawnEnemy(this.mark_1_l0, 'SWORDSMAN_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); if (w1counter == 3) { _root.spawnEnemy(this.mark_1_r0, 'ARCHER_1', -1, '/waveID-w1/onDeathRunScript-wave01Dead/'); } else { _root.spawnEnemy(this.mark_1_r0, 'SWORDSMAN_1', -1, '/waveID-w1/onDeathRunScript-wave01Dead/'); } w1counter += 1; _root.setNextWaveIDTimer(3); } else { _root.spawnEnemy(this.mark_1_l0, 'SPEARMAN_1', 1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.spawnEnemy(this.mark_1_r0, 'SPEARMAN_1', -1, '/waveID-w2/onDeathRunScript-w2Death/'); } } function w2Death() { _root.setMaxCamPos(this.region_border_max_2); } function wave05Dead() { _root.spawnEnemy(this.mark_2_r0, 'SPEARMAN_1', -1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_2_l0, 'SPEARMAN_1', -1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.gameEvent.nrLeftInWave -= 2; } function w6Death() { _root.spawnEnemy(this.mark_2_r0, 'SPEARMAN_1', -1, '/waveID-w7/onDeathRunScript-w7Death/'); this.mark_2_r0._x += 40; _root.spawnEnemy(this.mark_2_l0, 'SPEARMAN_1', -1, '/waveID-w7/onDeathRunScript-w7Death/'); this.mark_2_l0._x -= 40; _root.spawnEnemy(this.mark_2_l1, 'SPEARMAN_1', -1, '/waveID-w7/onDeathRunScript-w7Death/'); } function w7Death() { this.mark_2_r0._x -= 50; var v3 = 1; while (v3 <= 5) { _root.spawnEnemy(this.mark_2_r0, 'SWORDSMAN_1', -1, 'nothing'); this.mark_2_r0._x += 40; ++v3; } _root.setMaxCamPos(this.region_border_max_end); } function wave10Dead() { _root.spawnEnemy(this.mark_3_r0, 'SKELETON_1', -1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.spawnEnemy(this.mark_3_l0, 'SKELETON_1', 1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.gameEvent.nrLeftInWave -= 1; } function w11Death() { _root.spawnEnemy(this.mark_3_r0, 'SKELETON_1', -1, '/waveID-w12/onDeathRunScript-w12Death/'); this.mark_3_r0._x += 50; _root.spawnEnemy(this.mark_3_l0, 'SKELETON_1', 1, '/waveID-w12/onDeathRunScript-w12Death/'); this.mark_3_l0._x += 50; _root.spawnEnemy(this.mark_3_r0, 'SKELETON_1', -1, '/waveID-w12/onDeathRunScript-w12Death/'); _root.spawnEnemy(this.mark_3_l0, 'SKELETON_1', 1, '/waveID-w12/onDeathRunScript-w12Death/'); _root.setNextWaveIDTimer(6); _root.gameEvent.nrLeftInWave -= 2; } function w12Death() { _root.spawnEnemy(this.mark_3_r0, 'SKELETON_1', -1, '/waveID-w13/onDeathRunScript-w13Death/'); _root.spawnEnemy(this.mark_3_l0, 'SKELETON_1', -1, '/waveID-w13/onDeathRunScript-w13Death/'); this.mark_3_l0._x -= 40; _root.spawnEnemy(this.mark_3_l0, 'SKELETON_1', -1, '/waveID-w13/onDeathRunScript-w13Death/'); this.mark_3_l0._x -= 40; _root.spawnEnemy(this.mark_3_l0, 'SKELETON_1', -1, '/waveID-w13/onDeathRunScript-w13Death/'); } function w13Death() { _root.spawnEnemy(this.mark_3_cr, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w15/onDeathRunScript-w15Death/'); _root.spawnEnemy(this.mark_3_cl, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w15/onDeathRunScript-w15Death/'); this.mark_3_cr._x += 40; this.mark_3_cl._x -= 40; _root.spawnEnemy(this.mark_3_cr, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w15/onDeathRunScript-w15Death/'); _root.spawnEnemy(this.mark_3_cl, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w15/onDeathRunScript-w15Death/'); } function w15Death() { _root.levelFinished(); } _root.startMusic(5); _root.spawnPlayer(this.playerSpawnPoint); _root.setMinCamPos(this.region_border_min_1); _root.setMaxCamPos(this.region_border_max_1); this.groundCollision._alpha = 0; this.deathgaps._alpha = 0; this.snow._alpha = 0; _root.startAmbientMusic(2); _root.game.weatherType = 'snow'; _root.setThunder(20, 2); _root.thunderValues.backgroundThunder = true; var w1counter = 0; } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_2); _root.spawnEnemy(_parent.mark_1_l0, 'SWORDSMAN_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _root.spawnEnemy(_parent.mark_1_r0, 'SWORDSMAN_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _root.setNextWaveIDTimer(4); this._x -= 5000; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_max_1); _root.spawnEnemy(_parent.mark_2_l0, 'SPEARMAN_1', 1, '/waveID-w5/onDeathRunScript-wave05Dead/'); _root.spawnEnemy(_parent.mark_2_r0, 'SPEARMAN_1', 1, '/waveID-w5/onDeathRunScript-wave05Dead/'); _root.gameEvent.nrLeftInWave -= 1; this._x -= 5000; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 700 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1_S', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 700 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1_S', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 700 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1_S', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 3326 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 430 and this._alpha == 100) { _root.spawnEnemy(this, 'SPEARMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3326 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 430 and this._alpha == 100) { _root.spawnEnemy(this, 'SPEARMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_end); _root.spawnEnemy(_parent.mark_3_l0, 'SKELETON_1', 1, '/waveID-w10/onDeathRunScript-wave10Dead/'); _root.spawnEnemy(_parent.mark_3_r0, 'SKELETON_1', -1, '/waveID-w10/onDeathRunScript-wave10Dead/'); _root.setNextWaveIDTimer(5); this._x -= 5000; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { var m = 1; while (m <= 5) { _root.spawnEnemy(_parent.mark_fun_1, 'SKELETON_1', 1, 'nothing'); _parent.mark_fun_1._x -= 50; ++m; } _root.spawnEnemy(_parent.mark_fun_1, 'UNI_MOLOSKEL', 1, 'nothing'); this._x -= 5000; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3326 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 430 and this._alpha == 100) { _root.spawnEnemy(this, 'SPEARMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3223 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 700 and this._alpha == 100) { _root.spawnEnemy(this, 'ARCHER_1_S', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3221 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 420 and this._alpha == 100) { _root.spawnEnemy(this, 'SWORDSMAN_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } } movieClip 3567 { } movieClip 3570 { } movieClip 3572 { } movieClip 3574 { } movieClip 3576 { frame 2 { stop(); } } movieClip 3577 Level_16 { frame 1 { function wave01Dead() { _root.spawnEnemy(this.skel_2, 'SKELETON_1', -1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.spawnEnemy(this.skel_3, 'SKELETON_1', -1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.setNextWaveIDTimer(5); } function w2Death() { this.skel_4._x -= 50; this.skel_1._x += 40; _root.spawnEnemy(this.skel_4, 'SKELETON_1', 1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.spawnEnemy(this.skel_1, 'SKELETON_1', -1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.setNextWaveIDTimer(5); } function w3Death() { this.skel_2._x -= 50; this.skel_1._x += 50; this.skel_4._x -= 40; _root.spawnEnemy(this.skel_2, 'SKELETON_1', -1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.skel_4, 'SKELETON_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.skel_1, 'SKELETON_1', -1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.gameEvent.nrLeftInWave -= 2; } function w4Death() { _root.spawnEnemy(this.skel_2, 'SKELETON_1', -1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(this.skel_4, 'SKELETON_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(this.skel_3, 'SKELETON_1', -1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(this.skel_1, 'SKELETON_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); } function w5Death() { _root.spawnEnemy(this.mark_surprise, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this.mark_surprise._x += 40; _root.spawnEnemy(this.mark_surprise, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); _root.setMaxCamPos(this.region_border_max_2); } function w8Death() { _root.spawnEnemy(this.mark_2_r0, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w9/onDeathRunScript-w9Death/'); _root.spawnEnemy(this.mark_2_l0, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w9/onDeathRunScript-w9Death/'); _root.spawnEnemy(this.mark_2_r0, 'SKELETON_1', -1, '/waveID-w9/onDeathRunScript-w9Death/'); _root.spawnEnemy(this.mark_2_l0, 'SKELETON_1', 1, '/waveID-w9/onDeathRunScript-w9Death/'); _root.gameEvent.nrLeftInWave -= 2; } function w9Death() { _root.spawnEnemy(this.mark_2_r0, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w10/onDeathRunScript-w10Death/'); this.mark_2_r0._x += 80; _root.spawnEnemy(this.mark_2_r0, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w10/onDeathRunScript-w10Death/'); _root.spawnEnemy(this.mark_2_r0, 'SKELETON_1', -1, '/waveID-w10/onDeathRunScript-w10Death/'); _root.spawnEnemy(this.mark_2_l0, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w10/onDeathRunScript-w10Death/'); this.mark_2_l0._x -= 80; _root.spawnEnemy(this.mark_2_l0, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w10/onDeathRunScript-w10Death/'); _root.spawnEnemy(this.mark_2_l0, 'SKELETON_1', 1, '/waveID-w10/onDeathRunScript-w10Death/'); } function w10Death() { _root.spawnEnemy(this.mark_2_r0, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this.mark_2_r0._x -= 50; _root.spawnEnemy(this.mark_2_r0, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); _root.spawnEnemy(this.mark_2_r0, 'SKELETON_1', -1, 'nothing'); _root.setMaxCamPos(this.region_border_max_3); } function w15Death() { var v3 = 1; while (v3 <= 4) { _root.spawnEnemy(this.mark_fun_2, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w16/onDeathRunScript-w16Death/'); this.mark_fun_2._x -= 40; ++v3; } var v4 = 1; while (v4 <= 4) { _root.spawnEnemy(this.mark_fun_1, 'SKELETON_1', 1, '/waveID-w16/onDeathRunScript-w16Death/'); this.mark_fun_1._x += 60; ++v4; } } function w16Death() { _root.setMaxCamPos(this.region_border_max_4); } function w18Death() { counter_u_1 += 1; if (counter_u_1 < 4) { _root.spawnEnemy(this.mark_4_r0, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w18/onDeathRunScript-w18Death/'); _root.spawnEnemy(this.mark_4_l0, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w18/onDeathRunScript-w18Death/'); _root.gameEvent.nrLeftInWave -= 1; } else { _root.spawnEnemy(this.mark_4_r0, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w19/onDeathRunScript-w19Death/'); _root.spawnEnemy(this.mark_4_l0, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w19/onDeathRunScript-w19Death/'); } } function w19Death() { _root.setMaxCamPos(this.region_border_max_end); } function bossDeath() { counter_u_1 = 0; _root.spawnEnemy(this.boss_sr, 'SKELETON_1', -1, '/waveID-w20/onDeathRunScript-w20Death/'); _root.spawnEnemy(this.boss_sl, 'SKELETON_1', 1, '/waveID-w20/onDeathRunScript-w20Death/'); _root.setNextWaveIDTimer(1); } function w20Death() { counter_u_1 += 1; if (counter_u_1 < 8) { _root.spawnEnemy(this.boss_sr, 'SKELETON_1', -1, '/waveID-w20/onDeathRunScript-w20Death/'); _root.spawnEnemy(this.boss_sl, 'SKELETON_1', 1, '/waveID-w20/onDeathRunScript-w20Death/'); _root.setNextWaveIDTimer(1); } else { _root.spawnEnemy(this.boss_sr, 'SKELETON_1', -1, '/waveID-w21/onDeathRunScript-w21Death/'); _root.spawnEnemy(this.boss_sl, 'SKELETON_1', 1, '/waveID-w21/onDeathRunScript-w21Death/'); } } function w21Death() { _root.levelFinished(); } function changeSound(point, maxDist, maxVol) { var v2 = _root.player.posX - point; if (Math.sqrt(v2 * v2) < maxDist * 1) { sound_fire_1.setVolume(((maxDist - Math.sqrt(v2 * v2)) / maxDist) * maxVol * 1.4); sound_fire_1.setPan(-(v2 / (maxDist / 100))); } } _root.startMusic(7); if (!_root.player.startFromCheckpoint) { _root.spawnPlayer(this.playerSpawnPoint); _root.setMinCamPos(this.region_border_min_1); _root.setMaxCamPos(this.region_border_max_1); } else { _root.spawnPlayer(this.playerSpawnPointCP); _root.setMinCamPos(this.region_border_min_CP); _root.setMaxCamPos(this.region_border_max_end); } this.groundCollision._alpha = 0; this.deathpits._alpha = 0; this.deathgaps._alpha = 0; this.snow._alpha = 0; _root.startAmbientMusic(2); _root.game.weatherType = 'snow'; _root.setThunder(20, 2); _root.thunderValues.backgroundThunder = true; var counter_u_1 = 0; _root.createEmptyMovieClip('myFireSound_1', 12303); var sound_fire_1 = new Sound(_root.myFireSound_1); sound_fire_1.attachSound('firebig1.wav'); sound_fire_1.setVolume(0); sound_fire_1.start(); sound_fire_1.onSoundComplete = function () { sound_fire_1.start(); }; this.onEnterFrame = function () { if (_root.player.movingInXAxis) { changeSound(this.fire_1._x, 350, 100); changeSound(this.fire_2._x, 250, 75); } }; } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.player.startFromCheckpoint = false; this._x -= 5000; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.spawnEnemy(_parent.skel_1, 'SKELETON_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _root.spawnEnemy(_parent.skel_4, 'SKELETON_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _root.gameEvent.nrLeftInWave -= 1; this._x -= 5000; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 450 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_max_1); _root.spawnEnemy(_parent.mark_2_l0, 'SKELETON_1', 1, '/waveID-w8/onDeathRunScript-w8Death/'); _root.spawnEnemy(_parent.mark_2_r0, 'SKELETON_1', 1, '/waveID-w8/onDeathRunScript-w8Death/'); _root.setNextWaveIDTimer(5); _root.gameEvent.nrLeftInWave -= 1; this._x -= 5000; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { if (!_root.player.startFromCheckpoint) { _root.setMinCamPos(_parent.region_border_min_3); } _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w15/onDeathRunScript-w15Death/'); _root.gameEvent.nrLeftInWave -= 1; this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_max_3); _root.spawnEnemy(_parent.mark_4_l0, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w18/onDeathRunScript-w18Death/'); _root.spawnEnemy(_parent.mark_4_r0, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w18/onDeathRunScript-w18Death/'); _root.setNextWaveIDTimer(3); this._x -= 5000; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 2); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_boss); _root.showBossPlate('darkcopy'); _root.rollCameraYAxis = -20; _root.startMusic(1); _root.myObject['enemy' + _root.game.fightingBoss].currAttack = 'startFight'; this._x -= 5000; } } } instance of movieClip 2835 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 440 and this._alpha == 100) { _root.spawnEnemy(this, 'BOSS_DARKCOPY', -1, '/waveID-wboss/onDeathRunScript-bossDeath/'); this._y -= 1000; this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } } movieClip 3598 { frame 1 { stop(); } } movieClip 3601 { } movieClip 3603 { } movieClip 3605 { frame 2 { stop(); } } movieClip 3606 Level_17 { frame 1 { function wave01Dead() { _root.spawnEnemy(this.mark_1_r0, 'SKELETON_1', -1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.spawnEnemy(this.mark_1_l0, 'SKELETON_1', 1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.setNextWaveIDTimer(3); } function w2Death() { _root.spawnEnemy(this.mark_1_r0, 'SKELETON_1', -1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.spawnEnemy(this.mark_1_l0, 'SKELETON_1', 1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.spawnEnemy(this.mark_1_r0, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.spawnEnemy(this.mark_1_l0, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w3/onDeathRunScript-w3Death/'); } function w3Death() { _root.setMaxCamPos(this.region_border_max_2); } function w5Death() { if (counter_u_mace < 6) { counter_u_mace += 1; _root.spawnEnemy(this.mark_2_l0, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.setNextWaveIDTimer(1); } else { _root.spawnEnemy(this.mark_2_l0, 'CHAOSKNIGHT_MACE_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); } } function w6Death() { counter_u_mace = 0; _root.spawnEnemy(this.mark_2_r0, 'CHAOSKNIGHT_MACE_1', -1, 'nothing'); this.mark_2_r0._x += 40; _root.spawnEnemy(this.mark_2_r0, 'CHAOSKNIGHT_MACE_1', -1, 'nothing'); _root.setMaxCamPos(this.region_border_max_end); } function w10Death() { if (counter_u_mace < 8) { counter_u_mace += 1; _root.spawnEnemy(this.mark_f_l0, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w10/onDeathRunScript-w10Death/'); if (counter_u_mace <= 4) { _root.setNextWaveIDTimer(3); } else { if (counter_u_mace < 8) { _root.setNextWaveIDTimer(1); } } if (counter_u_mace == 3 or counter_u_mace == 5 or counter_u_mace == 7) { _root.spawnEnemy(this.skel_f, 'SKELETON_1', -1, '/waveID-w10/onDeathRunScript-w10Death/'); _root.gameEvent.nrLeftInWave -= 1; } } else { _root.spawnEnemy(this.mark_f_l0, 'CHAOSKNIGHT_MACE_1', 1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.spawnEnemy(this.mark_f_l0, 'UNI_STRONGORC', 1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.spawnEnemy(this.skel_f, 'SKELETON_1', -1, '/waveID-w11/onDeathRunScript-w11Death/'); } } function w11Death() { _root.levelFinished(); } _root.startMusic(6); _root.spawnPlayer(this.playerSpawnPoint); _root.setMinCamPos(this.region_border_min_1); _root.setMaxCamPos(this.region_border_max_1); this.groundCollision._alpha = 0; this.deathpits._alpha = 0; this.deathgaps._alpha = 0; _root.setThunder(20, 2); _root.thunderValues.backgroundThunder = true; var counter_u_mace = 0; } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_2); _root.spawnEnemy(_parent.mark_1_l0, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _root.spawnEnemy(_parent.mark_1_r0, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _root.gameEvent.nrLeftInWave -= 1; this._x -= 5000; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_end); var p = 1; while (p <= 7) { _root.spawnEnemy(_parent.mark_fun_1, 'SKELETON_1', 1, '/waveID-w10/onDeathRunScript-w10Death/'); _parent.mark_fun_1._x -= 55; ++p; } _root.gameEvent.nrLeftInWave -= 1; this._x -= 5000; } } } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_3); _root.spawnEnemy(_parent.mark_1_l0, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(_parent.mark_1_r0, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.gameEvent.nrLeftInWave -= 1; this._x -= 5000; } } } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3605 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_MACE_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3605 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_MACE_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3605 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_MACE_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3605 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_MACE_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3605 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_MACE_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3605 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_MACE_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3605 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_MACE_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } } movieClip 3610 { } movieClip 3614 { } movieClip 3616 { } movieClip 3618 { } movieClip 3619 Level_18 { frame 1 { function wave01Dead() { _root.spawnEnemy(this.mark_1_r0, 'SKELETON_1', -1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.spawnEnemy(this.mark_1_l0, 'SKELETON_1', 1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.gameEvent.nrLeftInWave -= 1; } function w2Death() { _root.spawnEnemy(this.mark_1_r0, 'CHAOSKNIGHT_MACE_1', -1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.spawnEnemy(this.mark_1_r1, 'CHAOSKNIGHT_MACE_1', -1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.spawnEnemy(this.mark_1_l0, 'CHAOSKNIGHT_MACE_1', 1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.gameEvent.nrLeftInWave -= 2; } function w3Death() { _root.spawnEnemy(this.mark_1_r0, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.mark_1_l0, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.mark_1_r1, 'CHAOSKNIGHT_MACE_1', -1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.mark_1_l1, 'CHAOSKNIGHT_MACE_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.gameEvent.nrLeftInWave -= 3; } function w4Death() { _root.spawnEnemy(this.mark_1_l0, 'SKELETON_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(this.mark_1_l1, 'SKELETON_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(this.mark_1_r0, 'SKELETON_1', -1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(this.mark_1_r1, 'SKELETON_1', -1, '/waveID-w5/onDeathRunScript-w5Death/'); } function w5Death() { _root.setMaxCamPos(this.region_border_max_2); } function w10Death() { if (skel_cont < 8) { _root.spawnEnemy(this['skel_' + skel_cont], 'SKELETON_1', -1, '/waveID-w10/onDeathRunScript-w10Death/'); skel_cont += 1; if (skel_cont < 8) { _root.setNextWaveIDTimer(1); } else { _root.gameEvent.nrLeftInWave -= 2; _root.setNextWaveIDTimer(10); } } else { _root.spawnEnemy(this.skel_1, 'SKELETON_1', -1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.spawnEnemy(this.skel_4, 'SKELETON_1', 1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.spawnEnemy(this.skel_5, 'SKELETON_1', -1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.gameEvent.nrLeftInWave -= 2; skel_cont = 0; } } function w11Death() { if (skel_cont < 5) { skel_cont += 1; if (skel_count < 3) { _root.spawnEnemy(this.mark_2_r0, 'CHAOSKNIGHT_MACE_1', -1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.spawnEnemy(this.mark_2_l0, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w11/onDeathRunScript-w11Death/'); } else { _root.spawnEnemy(this.mark_2_l0, 'CHAOSKNIGHT_MACE_1', 1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.spawnEnemy(this.mark_2_r0, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w11/onDeathRunScript-w11Death/'); } _root.gameEvent.nrLeftInWave -= 1; _root.setNextWaveIDTimer(4); } else { _root.spawnEnemy(this.mark_2_l0, 'CHAOSKNIGHT_MACE_1', 1, '/waveID-w12/onDeathRunScript-w12Death/'); _root.spawnEnemy(this.mark_2_r0, 'CHAOSKNIGHT_MACE_1', -1, '/waveID-w12/onDeathRunScript-w12Death/'); } } function w12Death() { _root.spawnEnemy(this.mark_2_l0, 'UNI_CHAOSKNIGHT2', 1, '/waveID-w13/onDeathRunScript-w13Death/'); _root.spawnEnemy(this.mark_2_r0, 'CHAOSKNIGHT_MACE_1', -1, '/waveID-w13/onDeathRunScript-w13Death/'); this.mark_2_r0._x += 40; _root.spawnEnemy(this.mark_2_r0, 'CHAOSKNIGHT_MACE_1', -1, '/waveID-w13/onDeathRunScript-w13Death/'); } function w13Death() { _root.setMaxCamPos(this.region_border_max_end); } _root.startMusic(7); if (!_root.player.startFromCheckpoint) { _root.spawnPlayer(this.playerSpawnPoint); _root.setMinCamPos(this.region_border_min_1); _root.setMaxCamPos(this.region_border_max_1); } else { _root.spawnPlayer(this.playerSpawnPointCP); _root.setMinCamPos(this.region_border_min_CP); _root.setMaxCamPos(this.region_border_max_end); } this.groundCollision._alpha = 0; this.deathgaps._alpha = 0; _root.setThunder(25, 1); _root.thunderValues.backgroundThunder = true; var skel_cont = 2; } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this._alpha = 0; } } } instance cam1 of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.game.rootZoom = _root.countToNumber(_root.game.rootZoom, 85, 1.3); } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.player.startFromCheckpoint = false; this._x -= 5000; } } } instance of movieClip 2300 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 440 and this._alpha == 100) { _root.spawnEnemy(this, 'BOSS_HEDGEHOG', -1, 'nothing'); this._y -= 1000; this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { var n = 1; while (n <= 5) { _root.spawnEnemy(_parent.mark_fun_1, 'SKELETON_1', 1, 'nothing'); _parent.mark_fun_1._x += 50; ++n; } _root.spawnEnemy(_parent.mark_0_l0, 'CHAOSKNIGHT_SWORD_1', 1, 'nothing'); _parent.mark_0_l0._x -= 40; _root.spawnEnemy(_parent.mark_0_l0, 'CHAOSKNIGHT_MACE_1', 1, 'nothing'); _root.spawnEnemy(_parent.mark_0_r0, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this._x -= 5000; } } } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3605 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_MACE_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { if (!_root.player.startFromCheckpoint) { _root.setMinCamPos(_parent.region_border_min_2); } _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w1/onDeathRunScript-wave01Dead/'); this._alpha = 0; } } } instance of movieClip 3605 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_MACE_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_3); _root.spawnEnemy(_parent.skel_1, 'SKELETON_1', -1, '/waveID-w10/onDeathRunScript-w10Death/'); _root.setNextWaveIDTimer(1); this._x -= 5000; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 2); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_boss); _root.showBossPlate('hedgehog'); _root.startMusic(1); _root.myObject['enemy' + _root.game.fightingBoss].currAttack = 'startFight'; _root.rollCameraYAxis = 0; this._x -= 5000; } } } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3576 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_SWORD_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.startRain(20, 1); _root.thunderValues.backgroundThunder = true; this._x -= 5000; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 3605 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_MACE_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3605 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_MACE_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3605 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_MACE_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 200 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } } movieClip 3623 { } movieClip 3627 { } movieClip 3629 { } movieClip 3641 { frame 1 { stop(); } } movieClip 3643 { } movieClip 3646 { } movieClip 3649 { } movieClip 3650 { frame 1 { stop(); } frame 3 { stop(); } } movieClip 3651 Level_19 { frame 1 { function wave01Dead() { _root.spawnEnemy(this.mark_1_l0, 'CHAOSKNIGHT_MACE_1', 1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.spawnEnemy(this.mark_1_l1, 'CHAOSKNIGHT_MACE_1', 1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.spawnEnemy(this.mark_1_lu, 'CHAOSKNIGHT_MACE_1', 1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.spawnEnemy(this.mark_1_r0, 'CHAOSKNIGHT_MACE_1', -1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.spawnEnemy(this.mark_1_r1, 'CHAOSKNIGHT_MACE_1', -1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.spawnEnemy(this.skel_1, 'SKELETON_1', -1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.spawnEnemy(this.skel_2, 'SKELETON_1', 1, '/waveID-w2/onDeathRunScript-w2Death/'); } function w2Death() { _root.setMaxCamPos(this.region_border_max_2); } function w4Death() { _root.spawnEnemy(this.mark_2_l0, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(this.mark_2_r0, 'CHAOSKNIGHT_MACE_1', -1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.setNextWaveIDTimer(4); } function w5Death() { _root.spawnEnemy(this.mark_2_l0, 'CHAOSKNIGHT_MACE_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_2_r0, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.setNextWaveIDTimer(4); } function w6Death() { _root.spawnEnemy(this.mark_2_l0, 'CHAOSKNIGHT_MACE_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_2_r0, 'CHAOSKNIGHT_MACE_1', -1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.gameEvent.nrLeftInWave -= 1; _root.setNextWaveIDTimer(12); } function w7Death() { var v4 = 1; while (v4 <= 4) { _root.spawnEnemy(this.mark_fun_1, 'SKELETON_1', 1, '/waveID-w8/onDeathRunScript-w8Death/'); this.mark_fun_1._x += 50; ++v4; } var v3 = 1; while (v3 <= 6) { _root.spawnEnemy(this.mark_fun_2, 'SKELETON_1', 1, '/waveID-w8/onDeathRunScript-w8Death/'); this.mark_fun_2._x += 50; ++v3; } } function w8Death() { _root.setMaxCamPos(this.region_border_max_3); } function w10Death() { _root.spawnEnemy(this.skel_3, 'SKELETON_1', -1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.spawnEnemy(this.skel_4, 'SKELETON_1', -1, '/waveID-w11/onDeathRunScript-w11Death/'); _root.gameEvent.nrLeftInWave -= 2; } function w11Death() { _root.spawnEnemy(this.mark_3_l0, 'CHAOSKNIGHT_MACE_1', 1, '/waveID-w12/onDeathRunScript-w12Death/'); _root.spawnEnemy(this.mark_3_r0, 'CHAOSKNIGHT_MACE_1', -1, '/waveID-w12/onDeathRunScript-w12Death/'); _root.spawnEnemy(this.mark_3_l1, 'CHAOSKNIGHT_MACE_1', 1, '/waveID-w12/onDeathRunScript-w12Death/'); _root.spawnEnemy(this.mark_3_r1, 'CHAOSKNIGHT_MACE_1', -1, '/waveID-w12/onDeathRunScript-w12Death/'); _root.spawnEnemy(this.mark_3_l1, 'SKELETON_1', 1, '/waveID-w12/onDeathRunScript-w12Death/'); _root.spawnEnemy(this.mark_3_r1, 'SKELETON_1', -1, '/waveID-w12/onDeathRunScript-w12Death/'); _root.spawnEnemy(this.skel_3, 'SKELETON_1', -1, '/waveID-w12/onDeathRunScript-w12Death/'); _root.spawnEnemy(this.skel_4, 'SKELETON_1', -1, '/waveID-w12/onDeathRunScript-w12Death/'); } function w12Death() { _root.setMaxCamPos(this.region_border_max_boss); } function bossWaveDeath() { _root.myObject['enemy' + _root.game.fightingBoss].currAttack = 'lowerShield'; } _root.startMusic(7); if (!_root.player.startFromCheckpoint) { _root.spawnPlayer(this.playerSpawnPoint); _root.setMinCamPos(this.region_border_min_1); _root.setMaxCamPos(this.region_border_max_1); } else { _root.spawnPlayer(this.playerSpawnPointCP); _root.setMinCamPos(this.region_border_min_CP); _root.setMaxCamPos(this.region_border_max_boss); } this.groundCollision._alpha = 0; this.deathpits._alpha = 0; _root.setThunder(30, 1); _root.thunderValues.backgroundThunder = true; } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_2); _root.spawnEnemy(_parent.mark_2_l0, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(_parent.mark_2_r0, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.gameEvent.nrLeftInWave -= 1; this._x -= 5000; } } } instance cam1 of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.game.rootZoom = _root.countToNumber(_root.game.rootZoom, 75, 1.5); } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.player.startFromCheckpoint = false; this._x -= 5000; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.spawnEnemy(_parent.mark_1_l0, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _root.spawnEnemy(_parent.mark_1_l1, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _root.spawnEnemy(_parent.mark_1_lu, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _root.spawnEnemy(_parent.mark_1_r0, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _root.spawnEnemy(_parent.mark_1_r1, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w1/onDeathRunScript-wave01Dead/'); _root.gameEvent.nrLeftInWave -= 2; this._x -= 5000; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 3605 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_MACE_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3605 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_MACE_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 2); this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_3); _root.spawnEnemy(_parent.mark_3_l0, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w10/onDeathRunScript-w10Death/'); _root.spawnEnemy(_parent.mark_3_r0, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w10/onDeathRunScript-w10Death/'); _root.spawnEnemy(_parent.mark_3_l1, 'CHAOSKNIGHT_MACE_1', 1, '/waveID-w10/onDeathRunScript-w10Death/'); _root.spawnEnemy(_parent.mark_3_r1, 'CHAOSKNIGHT_MACE_1', -1, '/waveID-w10/onDeathRunScript-w10Death/'); _root.spawnEnemy(_parent.mark_3_r1, 'UNI_NECROMANCER', -1, '/waveID-w10/onDeathRunScript-w10Death/'); this._x -= 5000; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { if (Math.random() * 100 <= 50) { _root.spawnBarrel(this, '/HP-50/explosive-0/'); } this._alpha = 0; } } } instance of movieClip 3605 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_MACE_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3605 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_MACE_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3605 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 600 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_MACE_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3605 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 650 and this._alpha == 100) { _root.spawnEnemy(this, 'CHAOSKNIGHT_MACE_1', -1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 3227 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 100 and this._alpha == 100) { _root.spawnEnemy(this, 'SKELETON_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 2722 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 700 and this._alpha == 100) { _root.spawnEnemy(this, 'BOSS_DEMONOMG', -1, 'nothing'); this._y -= 1000; this._alpha = 0; } } } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.setMinCamPos(_parent.region_border_min_boss); _root.showBossPlate('omg'); _root.startMusic(2); _root.myObject['enemy' + _root.game.fightingBoss].currAttack = 'startFight'; _root.rollCameraYAxis = -20; this._x -= 5000; } } } instance cam2 of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.game.rootZoom = _root.countToNumber(_root.game.rootZoom, 90, 1.5); } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x + 400 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } } movieClip 3654 { } movieClip 3659 { } movieClip 3661 { } movieClip 3662 Level_20 { frame 1 { function w1Death() { _root.spawnEnemy(this.mark_r0, 'SWORDSMAN_1', 1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.spawnEnemy(this.mark_l0, 'SWORDSMAN_1', 1, '/waveID-w2/onDeathRunScript-w2Death/'); _root.gameEvent.nrLeftInWave -= 2; } function w2Death() { _root.spawnEnemy(this.mark_r0, 'SWORDSMAN_1', 1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.spawnEnemy(this.mark_l0, 'SWORDSMAN_1', 1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.setNextWaveIDTimer(3); } function spawnBarrelsHere() { _root.spawnBarrel(this.mark_bl, '/HP-50/explosive-0/'); _root.spawnBarrel(this.mark_br, '/HP-50/explosive-0/'); } function w3Death() { if (wave_counter < 2) { wave_counter += 1; _root.spawnEnemy(this.mark_r0, 'SWORDSMAN_1', 1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.spawnEnemy(this.mark_l0, 'SWORDSMAN_1', 1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.spawnEnemy(this.mark_r1, 'SWORDSMAN_1', 1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.spawnEnemy(this.mark_l1, 'SWORDSMAN_1', 1, '/waveID-w3/onDeathRunScript-w3Death/'); _root.gameEvent.nrLeftInWave -= 2; } else { spawnBarrelsHere(); _root.spawnEnemy(this.mark_r0, 'SWORDSMAN_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.mark_l0, 'SWORDSMAN_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.mark_r0, 'SPEARMAN_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.mark_l0, 'SPEARMAN_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.mark_r1, 'SWORDSMAN_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.mark_l1, 'SWORDSMAN_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); wave_counter = 0; _root.gameEvent.nrLeftInWave -= 2; } } function w4Death() { if (wave_counter < 2) { wave_counter += 1; _root.spawnEnemy(this.mark_r0, 'SWORDSMAN_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.mark_l0, 'SWORDSMAN_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.mark_r0, 'SPEARMAN_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.mark_l0, 'SPEARMAN_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.mark_r1, 'SWORDSMAN_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.mark_l1, 'SWORDSMAN_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.gameEvent.nrLeftInWave -= 3; } else { if (wave_counter < 4) { wave_counter += 1; spawnBarrelsHere(); _root.spawnEnemy(this.mark_r0, 'SWORDSMAN_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.mark_l0, 'SWORDSMAN_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.mark_r0, 'ARCHER_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.mark_l0, 'ARCHER_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.mark_r1, 'SPEARMAN_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.spawnEnemy(this.mark_l1, 'SPEARMAN_1', 1, '/waveID-w4/onDeathRunScript-w4Death/'); _root.gameEvent.nrLeftInWave -= 3; } else { _root.startMusic(6); spawnBarrelsHere(); _root.spawnEnemy(this.mark_r0, 'SWORDSMAN_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(this.mark_l0, 'SWORDSMAN_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(this.mark_r0, 'ARCHER_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(this.mark_l0, 'ARCHER_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(this.mark_r1, 'ARCHER_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(this.mark_l1, 'ARCHER_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(this.mark_r0, 'SPEARMAN_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(this.mark_l0, 'SPEARMAN_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(this.mark_r1, 'SPEARMAN_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(this.mark_l1, 'SPEARMAN_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(this.mark_r1, 'SWORDSMAN_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.spawnEnemy(this.mark_l1, 'SWORDSMAN_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); wave_counter = 0; } } } function randomSkelPlace() { this.mark_skel._x = this.mark_skel_l._x + Math.random() * (this.mark_skel_r._x - this.mark_skel_l._x); } function w5Death() { if (wave_counter < 8) { randomSkelPlace(); wave_counter += 1; _root.spawnEnemy(this.mark_skel, 'SKELETON_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); _root.setNextWaveIDTimer(2); } else { if (wave_counter < 16) { randomSkelPlace(); wave_counter += 1; _root.spawnEnemy(this.mark_skel, 'SKELETON_1', 1, '/waveID-w5/onDeathRunScript-w5Death/'); if (wave_counter < 13) { _root.setNextWaveIDTimer(1); } else { _root.gameEvent.nrLeftInWave -= 2; } } else { _root.startMusic(7); var v3 = 1; while (v3 <= 6) { randomSkelPlace(); _root.spawnEnemy(this.mark_skel, 'SKELETON_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); ++v3; } _root.spawnEnemy(this.mark_r0, 'SKELETON_1', -1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_r1, 'SKELETON_1', -1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_l0, 'SKELETON_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_l1, 'SKELETON_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); wave_counter = 0; } } } function w6Death() { if (wave_counter < 2) { wave_counter += 1; spawnBarrelsHere(); _root.spawnEnemy(this.mark_r0, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_r1, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_l0, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_l1, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.gameEvent.nrLeftInWave -= 2; } else { if (wave_counter < 4) { wave_counter += 1; _root.spawnEnemy(this.mark_r0, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_r1, 'CHAOSKNIGHT_MACE_1', -1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_l0, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_l1, 'CHAOSKNIGHT_MACE_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); randomSkelPlace(); _root.spawnEnemy(this.mark_skel, 'SKELETON_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.gameEvent.nrLeftInWave -= 3; } else { if (wave_counter < 6) { wave_counter += 1; _root.spawnEnemy(this.mark_r0, 'CHAOSKNIGHT_MACE_1', -1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_r1, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_l0, 'CHAOSKNIGHT_MACE_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_l1, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_l0, 'SKELETON_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.spawnEnemy(this.mark_l1, 'SKELETON_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); randomSkelPlace(); _root.spawnEnemy(this.mark_skel, 'SKELETON_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); randomSkelPlace(); _root.spawnEnemy(this.mark_skel, 'SKELETON_1', 1, '/waveID-w6/onDeathRunScript-w6Death/'); _root.gameEvent.nrLeftInWave -= 4; } else { _root.startMusic(1); wave_counter = 0; _root.spawnEnemy(this.mark_r0, 'CHAOSKNIGHT_MACE_1', -1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_r1, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_l0, 'CHAOSKNIGHT_MACE_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_l1, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_l0, 'SKELETON_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_l1, 'SKELETON_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); randomSkelPlace(); _root.spawnEnemy(this.mark_skel, 'SKELETON_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); randomSkelPlace(); _root.spawnEnemy(this.mark_skel, 'SKELETON_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.gameEvent.nrLeftInWave -= 4; } } } } function w7Death() { if (wave_counter == 0) { wave_counter = 1; _root.spawnEnemy(this.mark_r0, 'SWORDSMAN_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_l0, 'SWORDSMAN_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_r0, 'ARCHER_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_l0, 'ARCHER_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_r1, 'SPEARMAN_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_l1, 'SPEARMAN_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); randomSkelPlace(); _root.spawnEnemy(this.mark_skel, 'SKELETON_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); randomSkelPlace(); _root.spawnEnemy(this.mark_skel, 'SKELETON_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.gameEvent.nrLeftInWave -= 9; wave_counter2 += 1; } else { wave_counter = 0; _root.spawnEnemy(this.mark_r0, 'CHAOSKNIGHT_MACE_1', -1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_r1, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_l0, 'CHAOSKNIGHT_MACE_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.spawnEnemy(this.mark_l1, 'CHAOSKNIGHT_SWORD_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); randomSkelPlace(); _root.spawnEnemy(this.mark_skel, 'SKELETON_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); randomSkelPlace(); _root.spawnEnemy(this.mark_skel, 'SKELETON_1', 1, '/waveID-w7/onDeathRunScript-w7Death/'); _root.gameEvent.nrLeftInWave -= 4; _root.setNextWaveIDTimer(5); } } _root.startMusic(5); _root.spawnPlayer(this.playerSpawnPoint); _root.setMinCamPos(this.region_border_min_1); _root.setMaxCamPos(this.region_border_max_1); this.groundCollision._alpha = 0; this.deathpits._alpha = 0; var wave_counter = 0; var wave_counter2 = 0; var deathMessageShown = false; var recordMessageShown = false; var initMapBP = false; var list_fmt = new TextFormat(); list_fmt.letterSpacing = -0.5; list_fmt.size = 11; list_fmt.bold = true; list_fmt.font = 'Tahoma'; this.onEnterFrame = function () { if (_root.BSRecord > 0 and _root.player.nrOfKills > _root.BSRecord and !_root.player.deathInitiated) { _root.BSRecord = _root.player.nrOfKills; if (!recordMessageShown) { _root.showTopicInformation('NEW PERSONAL RECORD'); recordMessageShown = true; } } if (_root.player.deathInitiated) { if (!deathMessageShown) { if (_root.BSRecord < _root.player.nrOfKills) { _root.BSRecord = _root.player.nrOfKills; } _root.showTopicInformation('TOTAL KILLS: ' + _root.player.nrOfKills); deathMessageShown = true; } } if (!initMapBP) { if (_root.player.nrOfKills >= 125) { initMapBP = true; if (!_root.MapsCleared[21]) { _root.MapsCleared[21] = true; _root.showTopicInformation('NEW LEVEL UNLOCKED'); } } } if (_root.BSRecord > 0 and !recordMessageShown) { _root.interfaceLayer.ratioFix.cheat_txt.htmlText = 'PERSONAL BEST: ' + _root.BSRecord + '<br>KILLS: ' + _root.player.nrOfKills; } else { _root.interfaceLayer.ratioFix.cheat_txt.htmlText = 'KILLS: ' + _root.player.nrOfKills; } _root.interfaceLayer.ratioFix.cheat_txt.setTextFormat(list_fmt); }; } instance of movieClip 521 { onClipEvent (enterFrame) { if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) { _root.spawnEnemy(_parent.mark_r0, 'SWORDSMAN_1', 1, '/waveID-w1/onDeathRunScript-w1Death/'); _root.spawnEnemy(_parent.mark_l0, 'SWORDSMAN_1', 1, '/waveID-w1/onDeathRunScript-w1Death/'); _root.setNextWaveIDTimer(3); this._x -= 5000; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 1); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 672 barrel { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 640 and this._alpha == 100) { _root.spawnBarrel(this, '/HP-50/explosive-1/'); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 2); this._alpha = 0; } } } instance of movieClip 698 food_crate { onClipEvent (enterFrame) { if (this._alpha == 100) { _root.spawnFoodCrate(this._x, this._y, 2); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } instance of movieClip 327 { onClipEvent (enterFrame) { if (_root.player.clip._x > this._x - 140 and this._alpha == 100) { _root.spawnEnemy(this, 'CROW_1', 1, 'nothing'); this._alpha = 0; } } } } movieClip 3665 { } movieClip 3668 { } movieClip 3672 { } movieClip 3673 { } movieClip 3674 { } movieClip 3675 { } movieClip 3678 { } movieClip 3680 { } movieClip 3682 Level_21 { frame 1 { _root.startMusic(5); _root.spawnPlayer(this.playerSpawnPoint); _root.setMinCamPos(this.region_border_min_1); _root.setMaxCamPos(this.region_border_max_1); this.groundCollision._alpha = 0; this.deathpits._alpha = 0; this.deathgaps._alpha = 0; _root.level21Started(); _root.BOSoS_CHEATS = true; this.onEnterFrame = function () { _root.level21Started(); }; } } movieClip 3705 { frame 1 { stop(); } frame 2 { gotoAndStop(1); } } frame 6 { function getLevelColour() { switch (game.currentLevel) { case 2: changeColour(theWorld, 100, 96, 97, 0, 0, 0); break; case 3: changeColour(theWorld, 80, 81, 85, -5, -4, -3); break; case 4: changeColour(theWorld, 91, 91, 91, -5, -5, -5); break; case 5: changeColour(theWorld, 85, 86, 90, -4, -3, -2); break; case 6: changeColour(theWorld, 90, 91, 94, -2, -1, 0); break; case 7: changeColour(theWorld, 94, 97, 100, 0, 0, 2); break; case 8: changeColour(theWorld, 95, 100, 95, 0, 1, 0); break; case 10: changeColour(theWorld, 100, 100, 95, 0, 0, 0); break; case 12: changeColour(theWorld, 100, 97, 96, 0, 1, 1); break; case 13: changeColour(theWorld, 96, 98, 100, 0, 1, 1); break; case 14: changeColour(theWorld, 93, 92, 100, 0, 0, 1); break; case 15: changeColour(theWorld, 92, 92, 100, 0, 0, 2); break; case 16: changeColour(theWorld, 90, 90, 100, 0, 0, 3); break; case 17: changeColour(theWorld, 100, 92, 92, 2, -1, 0); break; case 18: changeColour(theWorld, 100, 90, 90, 3, -1, 0); break; case 19: changeColour(theWorld, 100, 88, 88, 4, -2, 0); break; default: } } function getAI(enemyAI) { switch (enemyAI) { case 'SWORDSMAN_1': return '/uni-0/type-Actor_OrcSwordsman/AI-SWORDSMAN/HP-65/CanDropHead-1/CanDropArm-1/speed-3/runDist-45/canBlock-1/canParry-1/attRange1-55/attRange2-70/attDmg1-2/attDmg2-3/att_strongDmg-5/attChance-10/contestPushbacks-9/reactDist-2000/bloodType-blood_s_/bloodStain-1/groundSpawn-1/gibPart-gib_part_human_/barrelImmune-0/'; case 'SWORDSMAN_1_TUTORIAL': return '/uni-0/type-Actor_OrcSwordsman/AI-SWORDSMAN/HP-65/CanDropHead-1/CanDropArm-1/speed-3/runDist-45/canBlock-1/canParry-1/attRange1-55/attRange2-70/attDmg1-2/attDmg2-4/att_strongDmg-6/attChance-10/contestPushbacks-9/reactDist-200/bloodType-blood_s_/bloodStain-1/groundSpawn-1/gibPart-gib_part_human_/barrelImmune-0/'; case 'ARCHER_1': return '/uni-0/type-Actor_OrcArcher/AI-ARCHER/HP-45/CanDropHead-1/CanDropArm-0/speed-2/attRange-550/canBlock-0/canParry-0/bloodType-blood_s_/bloodStain-1/groundSpawn-1/gibPart-gib_part_human_/barrelImmune-0/'; case 'ARCHER_1_S': return '/uni-0/type-Actor_OrcArcher/AI-ARCHER/HP-45/CanDropHead-1/CanDropArm-0/speed-2/static-1/attRange-650/canBlock-0/canParry-0/bloodType-blood_s_/bloodStain-1/groundSpawn-1/gibPart-gib_part_human_/barrelImmune-0/'; case 'ARCHER_SPECIAL': return '/uni-0/type-Actor_OrcArcher/AI-ARCHER/HP-20/CanDropHead-1/CanDropArm-0/speed-2/attRange-600/canBlock-0/canParry-0/bloodType-blood_s_/bloodStain-1/groundSpawn-0/gibPart-gib_part_human_/barrelImmune-0/'; case 'SPEARMAN_1': return '/uni-0/type-Actor_OrcSpearman/AI-SPEARMAN/HP-50/CanDropHead-1/CanDropArm-0/speed-3/chargeSpeed-7/SpearDmg-3/runDist-42/canBlock-0/canParry-0/bloodType-blood_s_/bloodStain-1/att_strongDmg-3/attChance-20/reactDist-2000/groundSpawn-1/gibPart-gib_part_human_/barrelImmune-0/'; case 'SKELETON_1': return '/uni-0/type-Actor_SkeletonSwordsman/AI-SKELETON/HP-90/CanDropHead-0/CanDropArm-0/speed-2/runDist-45/canBlock-1/canParry-1/attRange1-65/attDmg1-3/attRange2-60/attDmg2-4/att_strongDmg-6/attChance-12/contestPushbacks-9/reactDist-2000/bloodType-skel_blood/bloodStain-2/groundSpawn-1/gibPart-gib_part_skel_/barrelImmune-1/'; case 'CHAOSKNIGHT_SWORD_1': return '/uni-0/type-Actor_ChaosKnight_Sword/AI-CHAOSKNIGHTSWORD/HP-120/CanDropHead-0/CanDropArm-1/speed-3/runDist-50/canBlock-1/canParry-1/attRange1-65/attDmg1-3/attRange2-65/att_strongDmg-7/attDmg2-5/attChance-12/contestPushbacks-14/reactDist-2000/bloodType-blood_fire_/bloodStain-3/groundSpawn-1/gibPart-gib_part_chaosknight_/barrelImmune-0/'; case 'CHAOSKNIGHT_MACE_1': return '/uni-0/type-Actor_ChaosKnight_Mace/AI-CHAOSKNIGHTMACE/HP-150/CanDropHead-0/CanDropArm-1/speed-3/runDist-50/canBlock-1/canParry-1/attRange1-65/attDmg1-5/attChance-15/att_strongDmg-8/contestPushbacks-14/reactDist-2000/bloodType-blood_fire_/bloodStain-3/groundSpawn-1/gibPart-gib_part_chaosknight_/barrelImmune-0/'; case 'SKELETON_WITCH': return '/uni-WITCHSKEL/type-Actor_SkeletonSwordsman/AI-SKELETON/HP-75/CanDropHead-0/CanDropArm-0/speed-2/runDist-45/canBlock-1/canParry-1/attRange1-65/attDmg1-3/attRange2-60/attDmg2-4/att_strongDmg-6/attChance-12/contestPushbacks-9/reactDist-2000/bloodType-skel_blood/bloodStain-2/groundSpawn-1/gibPart-gib_part_skel_/barrelImmune-1/instaJump-1/'; case 'SKELETON_BARREL': return '/uni-BARRELSKEL/type-Actor_SkeletonSwordsman/AI-SKELETON/HP-50/CanDropHead-0/CanDropArm-0/speed-2/runDist-45/canBlock-1/canParry-1/attRange1-65/attDmg1-3/attRange2-60/attDmg2-4/att_strongDmg-6/attChance-12/contestPushbacks-9/reactDist-2000/bloodType-skel_blood/bloodStain-2/groundSpawn-0/gibPart-gib_part_skel_/barrelImmune-1/instaJump-2/'; case 'UNI_LVL_1': return '/uni-LEVEL1/type-Actor_OrcSwordsman/AI-SWORDSMAN/HP-160/CanDropHead-1/CanDropArm-1/speed-2.5/runDist-55/canBlock-1/canParry-1/attRange1-65/attRange2-75/attDmg1-3/attDmg2-4/att_strongDmg-7/attChance-10/contestPushbacks-14/reactDist-2000/bloodType-blood_s_/bloodStain-1/groundSpawn-1/gibPart-gib_part_human_/barrelImmune-0/'; case 'UNI_LVL_4': return '/uni-LEVEL4/type-Actor_SkeletonSwordsman/AI-SKELETON/HP-160/CanDropHead-0/CanDropArm-0/speed-4/runDist-60/canBlock-1/canParry-1/attRange1-65/attDmg1-3/attRange2-70/attDmg2-4/att_strongDmg-6/attChance-20/contestPushbacks-15/reactDist-2000/bloodType-skel_blood/bloodStain-2/groundSpawn-1/gibPart-gib_part_skel_/barrelImmune-1/'; case 'UNI_LVL_6': return '/uni-LEVEL6/type-Actor_OrcArcher/AI-ARCHER/HP-160/CanDropHead-1/CanDropArm-0/speed-2/attRange-690/canBlock-0/canParry-0/bloodType-blood_s_/bloodStain-1/groundSpawn-1/gibPart-gib_part_human_/barrelImmune-0/static-1/'; case 'UNI_LVL_7': return '/uni-LEVEL7/type-Actor_OrcSpearman/AI-SPEARMAN/HP-170/CanDropHead-1/CanDropArm-0/speed-5/chargeSpeed-16/SpearDmg-5/runDist-50/canBlock-0/canParry-0/bloodType-blood_s_/bloodStain-1/att_strongDmg-5/attChance-20/reactDist-2000/groundSpawn-1/gibPart-gib_part_human_/barrelImmune-0/'; case 'UNI_LVL_10': return '/uni-LEVEL10/type-Actor_OrcSwordsman/AI-SWORDSMAN/HP-255/CanDropHead-1/CanDropArm-1/speed-3/runDist-65/canBlock-1/canParry-1/attRange1-75/attRange2-85/attDmg1-3/attDmg2-4/att_strongDmg-7/attChance-15/contestPushbacks-17/reactDist-2000/bloodType-blood_s_/bloodStain-1/groundSpawn-1/gibPart-gib_part_human_/barrelImmune-0/'; case 'UNI_STRONGORC': return '/uni-STRONGORC/type-Actor_OrcSwordsman/AI-SWORDSMAN/HP-250/CanDropHead-1/CanDropArm-1/speed-3/runDist-65/canBlock-1/canParry-1/attRange1-60/attRange2-65/attDmg1-3/attDmg2-4/att_strongDmg-7/attChance-15/contestPushbacks-17/reactDist-2000/bloodType-blood_s_/bloodStain-1/groundSpawn-1/gibPart-gib_part_human_/barrelImmune-0/'; case 'UNI_MOLOSKEL': return '/uni-MOLOSKEL/type-Actor_SkeletonSwordsman/AI-SKELETON/HP-250/CanDropHead-0/CanDropArm-0/speed-3/runDist-60/canBlock-1/canParry-1/attRange1-65/attDmg1-3/attRange2-70/attDmg2-4/att_strongDmg-6/attChance-15/contestPushbacks-18/reactDist-2000/bloodType-skel_blood/bloodStain-2/groundSpawn-1/gibPart-gib_part_skel_/barrelImmune-1/'; case 'UNI_MULTIARCHER': return '/uni-MULTIARCHER/type-Actor_OrcArcher/AI-ARCHER/HP-180/CanDropHead-1/CanDropArm-0/speed-2/attRange-690/canBlock-0/canParry-0/bloodType-blood_s_/bloodStain-1/groundSpawn-1/gibPart-gib_part_human_/barrelImmune-0/static-1/'; case 'UNI_CHAOSKNIGHT': return '/uni-CHAOSKNIGHT/type-Actor_ChaosKnight_Sword/AI-CHAOSKNIGHTSWORD/HP-120/CanDropHead-0/CanDropArm-1/speed-3/runDist-50/canBlock-1/canParry-1/attRange1-65/attDmg1-3/attRange2-65/att_strongDmg-7/attDmg2-5/attChance-12/contestPushbacks-14/reactDist-2000/bloodType-blood_fire_/bloodStain-3/groundSpawn-1/gibPart-gib_part_chaosknight_/barrelImmune-0/'; case 'UNI_NECROMANCER': return '/uni-NECROMANCER/type-Actor_ChaosKnight_Mace/AI-CHAOSKNIGHTMACE/HP-200/CanDropHead-0/CanDropArm-1/speed-2/runDist-50/canBlock-1/canParry-1/attRange1-65/attDmg1-5/attChance-15/att_strongDmg-8/contestPushbacks-14/reactDist-2000/bloodType-blood_fire_/bloodStain-3/groundSpawn-1/gibPart-gib_part_chaosknight_/barrelImmune-0/'; case 'UNI_CHARGER': return '/uni-CHARGER/type-Actor_OrcSpearman/AI-SPEARMAN/HP-200/CanDropHead-1/CanDropArm-0/speed-5/chargeSpeed-15/SpearDmg-4/runDist-50/canBlock-0/canParry-0/bloodType-blood_s_/bloodStain-1/att_strongDmg-5/attChance-20/reactDist-2000/groundSpawn-1/gibPart-gib_part_human_/barrelImmune-0/'; case 'UNI_CHAOSKNIGHT2': return '/uni-CHAOSKNIGHT2/type-Actor_ChaosKnight_Sword/AI-CHAOSKNIGHTSWORD/HP-230/CanDropHead-0/CanDropArm-1/speed-3/runDist-50/canBlock-1/canParry-1/attRange1-65/attDmg1-5/attRange2-65/att_strongDmg-7/attDmg2-6/attChance-20/contestPushbacks-20/reactDist-2000/bloodType-blood_fire_/bloodStain-3/groundSpawn-1/gibPart-gib_part_chaosknight_/barrelImmune-0/'; case 'BOSS_TROLL': return '/uni-0/type-Actor_Boss_Troll/AI-BOSSTROLL/HP-120/bloodType-blood_s_/bloodStain-1/canBlock-0/groundSpawn-1/canParry-0/barrelImmune-1/dontCheckWaveID-1/'; case 'BOSS_SWAMPMONSTER': return '/uni-0/type-Actor_Boss_SwampMonster/AI-BOSSSWAMPMONSTER/HP-888/bloodType-blood_slime_/bloodStain-3/canBlock-0/groundSpawn-1/canParry-0/barrelImmune-1/dontCheckWaveID-1/'; case 'SWAMPMONSTER_ARM': return '/uni-0/type-Actor_SwampMonster_Arm/AI-SWAMPMONSTERARM/HP-888/bloodType-blood_slime_/bloodStain-3/canBlock-0/groundSpawn-1/canParry-0/barrelImmune-1/dontCheckWaveID-1/'; case 'BOSS_WITCH': return '/uni-0/type-Actor_Boss_Witch/AI-BOSSWITCH/HP-888/bloodType-blood_s_/bloodStain-1/canBlock-0/groundSpawn-0/canParry-0/barrelImmune-1/dontCheckWaveID-1/'; case 'BOSS_PRINCESS': return '/uni-0/type-Actor_Boss_Princess/AI-BOSSPRINCESS/HP-888/bloodType-blood_s_/bloodStain-1/canBlock-0/groundSpawn-0/canParry-0/barrelImmune-1/dontCheckWaveID-1/'; case 'BOSS_HEDGEHOG': return '/uni-0/type-Actor_Boss_Hedgehog/AI-BOSSHEDGEHOG/HP-888/bloodType-blood_s_/bloodStain-1/canBlock-0/groundSpawn-0/canParry-0/barrelImmune-1/dontCheckWaveID-1/'; case 'BOSS_DARKCOPY': return '/uni-0/type-Actor_Boss_DarkCopy/AI-BOSSDARKCOPY/HP-450/bloodType-blood_fire_/bloodStain-1/canBlock-0/groundSpawn-0/canParry-0/barrelImmune-1/contestPushbacks-19/gibPart-gib_part_chaosknight_/barrelImmune-1/dontCheckWaveID-1/'; case 'BOSS_DEMONOMG': return '/uni-0/type-Actor_Boss_DemonOMG/AI-BOSSDEMONOMG/HP-888/bloodType-blood_s_/bloodStain-1/canBlock-1/groundSpawn-0/canParry-0/barrelImmune-1/dontCheckWaveID-1/'; case 'CROW_1': return '/type-Actor_Crow/AI-CROW/HP-1/bloodType-blood_s_/bloodStain-1/canBlock-0/canParry-0/groundSpawn-0/speed-4/gibPart-none/barrelImmune-0/dontCheckWaveID-1/'; } } function getUni(ob, ID) { ob.RGB_R2 = 0; ob.RGB_G2 = 0; ob.RGB_B2 = 0; ob.stunChance = 0; ob.knockdownChance = 0; switch (ID) { case 'LEVEL1': ob.isUNI = true; ob.nameID = 'UNI_LVL_1'; ob.UNI_stunR = 20; ob.UNI_staggerR = 20; ob.UNI_knockdownR = 20; ob.UNI_scale = 115; ob.clip._yscale = ob.UNI_scale; ob.stunChance = 15; ob.UNI_AI = '0'; ob.RGB_R1 = 50; ob.RGB_G1 = 50; ob.RGB_B1 = 50; changeColour(ob.clip, ob.RGB_R1, ob.RGB_G1, ob.RGB_B1, ob.RGB_R2, ob.RGB_G2, ob.RGB_B2); break; case 'CHAOSKNIGHT': ob.isUNI = true; ob.nameID = 'UNI_CHAOSKNIGHT'; ob.UNI_stunR = 0; ob.UNI_staggerR = 0; ob.UNI_knockdownR = 0; ob.UNI_scale = 100; ob.clip._yscale = ob.UNI_scale; ob.UNI_AI = '0'; ob.RGB_R1 = 100; ob.RGB_G1 = 100; ob.RGB_B1 = 100; changeColour(ob.clip, ob.RGB_R1, ob.RGB_G1, ob.RGB_B1, ob.RGB_R2, ob.RGB_G2, ob.RGB_B2); break; case 'CHAOSKNIGHT2': ob.isUNI = true; ob.nameID = 'UNI_CHAOSKNIGHT2'; ob.UNI_stunR = 70; ob.UNI_staggerR = 70; ob.UNI_knockdownR = 70; ob.UNI_scale = 110; ob.clip._yscale = ob.UNI_scale; ob.stunChance = 7; ob.knockdownChance = 7; ob.UNI_AI = '0'; ob.RGB_R1 = 40; ob.RGB_G1 = 40; ob.RGB_B1 = 100; changeColour(ob.clip, ob.RGB_R1, ob.RGB_G1, ob.RGB_B1, ob.RGB_R2, ob.RGB_G2, ob.RGB_B2); break; case 'LEVEL4': ob.isUNI = true; ob.nameID = 'UNI_LVL_4'; ob.UNI_stunR = 30; ob.UNI_staggerR = 50; ob.UNI_knockdownR = 30; ob.UNI_scale = 115; ob.clip._yscale = ob.UNI_scale; ob.knockdownChance = 15; ob.UNI_AI = '0'; ob.RGB_R1 = 100; ob.RGB_G1 = 100; ob.RGB_B1 = 0; changeColour(ob.clip, ob.RGB_R1, ob.RGB_G1, ob.RGB_B1, ob.RGB_R2, ob.RGB_G2, ob.RGB_B2); break; case 'LEVEL6': ob.isUNI = true; ob.nameID = 'UNI_LVL_6'; ob.UNI_stunR = 20; ob.UNI_staggerR = 50; ob.UNI_knockdownR = 50; ob.UNI_scale = 105; ob.clip._yscale = ob.UNI_scale; ob.UNI_AI = 'RAPIDFIRE'; ob.RGB_R1 = 0; ob.RGB_G1 = 50; ob.RGB_B1 = 100; changeColour(ob.clip, ob.RGB_R1, ob.RGB_G1, ob.RGB_B1, ob.RGB_R2, ob.RGB_G2, ob.RGB_B2); break; case 'LEVEL7': ob.isUNI = true; ob.nameID = 'UNI_LVL_7'; ob.UNI_stunR = 20; ob.UNI_staggerR = 60; ob.UNI_knockdownR = 70; ob.UNI_scale = 100; ob.clip._yscale = ob.UNI_scale; ob.UNI_AI = '0'; ob.RGB_R1 = 0; ob.RGB_G1 = 100; ob.RGB_B1 = 0; changeColour(ob.clip, ob.RGB_R1, ob.RGB_G1, ob.RGB_B1, ob.RGB_R2, ob.RGB_G2, ob.RGB_B2); break; case 'CHARGER': ob.isUNI = true; ob.nameID = 'UNI_CHARGER'; ob.UNI_stunR = 40; ob.UNI_staggerR = 60; ob.UNI_knockdownR = 60; ob.UNI_scale = 100; ob.clip._yscale = ob.UNI_scale; ob.knockdownChance = 10; ob.UNI_AI = 'CHARGE'; ob.RGB_R1 = 75; ob.RGB_G1 = 50; ob.RGB_B1 = 25; changeColour(ob.clip, ob.RGB_R1, ob.RGB_G1, ob.RGB_B1, ob.RGB_R2, ob.RGB_G2, ob.RGB_B2); break; case 'LEVEL10': ob.isUNI = true; ob.nameID = 'UNI_LVL_10'; ob.UNI_stunR = 30; ob.UNI_staggerR = 60; ob.UNI_knockdownR = 80; ob.UNI_scale = 125; ob.clip._yscale = ob.UNI_scale; ob.stunChance = 20; ob.UNI_AI = '0'; ob.RGB_R1 = 100; ob.RGB_G1 = 0; ob.RGB_B1 = 0; changeColour(ob.clip, ob.RGB_R1, ob.RGB_G1, ob.RGB_B1, ob.RGB_R2, ob.RGB_G2, ob.RGB_B2); break; case 'STRONGORC': ob.isUNI = true; ob.nameID = 'UNI_STRONGORC'; ob.UNI_stunR = 30; ob.UNI_staggerR = 70; ob.UNI_knockdownR = 30; ob.UNI_scale = 95; ob.clip._yscale = ob.UNI_scale; ob.stunChance = 10; ob.knockdownChance = 10; ob.UNI_AI = 'STRONGATTACKS'; ob.RGB_R1 = 100; ob.RGB_G1 = 0; ob.RGB_B1 = 50; changeColour(ob.clip, ob.RGB_R1, ob.RGB_G1, ob.RGB_B1, ob.RGB_R2, ob.RGB_G2, ob.RGB_B2); break; case 'MOLOSKEL': ob.isUNI = true; ob.nameID = 'UNI_MOLOSKEL'; ob.UNI_stunR = 0; ob.UNI_staggerR = 60; ob.UNI_knockdownR = 40; ob.UNI_scale = 105; ob.clip._yscale = ob.UNI_scale; ob.UNI_AI = 'MOLOSKEL'; ob.nextMoloIn = 72; ob.RGB_R1 = 0; ob.RGB_G1 = 100; ob.RGB_B1 = 0; changeColour(ob.clip, ob.RGB_R1, ob.RGB_G1, ob.RGB_B1, ob.RGB_R2, ob.RGB_G2, ob.RGB_B2); break; case 'NECROMANCER': ob.isUNI = true; ob.nameID = 'UNI_NECROMANCER'; ob.UNI_stunR = 50; ob.UNI_staggerR = 50; ob.UNI_knockdownR = 50; ob.UNI_scale = 110; ob.clip._yscale = ob.UNI_scale; ob.UNI_AI = 'NECROMANCER'; ob.nextSummonIn = 24; ob.RGB_R1 = 40; ob.RGB_G1 = 40; ob.RGB_B1 = 40; changeColour(ob.clip, ob.RGB_R1, ob.RGB_G1, ob.RGB_B1, ob.RGB_R2, ob.RGB_G2, ob.RGB_B2); break; case 'MULTIARCHER': ob.isUNI = true; ob.nameID = 'UNI_MULTIARCHER'; ob.UNI_stunR = 20; ob.UNI_staggerR = 80; ob.UNI_knockdownR = 20; ob.UNI_scale = 105; ob.clip._yscale = ob.UNI_scale; ob.UNI_AI = 'MULTIFIRE'; ob.RGB_R1 = 100; ob.RGB_G1 = 50; ob.RGB_B1 = 0; changeColour(ob.clip, ob.RGB_R1, ob.RGB_G1, ob.RGB_B1, ob.RGB_R2, ob.RGB_G2, ob.RGB_B2); break; case 'WITCHSKEL': ob.isUNI = false; ob.nameID = 'none'; ob.UNI_stunR = 0; ob.UNI_staggerR = 0; ob.UNI_knockdownR = 0; ob.UNI_scale = 95; ob.clip._yscale = ob.UNI_scale; ob.UNI_AI = '0'; ob.RGB_R1 = 75; ob.RGB_G1 = 0; ob.RGB_B1 = 100; changeColour(ob.clip, ob.RGB_R1, ob.RGB_G1, ob.RGB_B1, ob.RGB_R2, ob.RGB_G2, ob.RGB_B2); break; case 'BARRELSKEL': ob.isUNI = false; ob.nameID = 'none'; ob.UNI_stunR = 0; ob.UNI_staggerR = 0; ob.UNI_knockdownR = 0; ob.UNI_scale = 90; ob.clip._yscale = ob.UNI_scale; ob.UNI_AI = '0'; ob.RGB_R1 = 100; ob.RGB_G1 = 100; ob.RGB_B1 = 100; changeColour(ob.clip, ob.RGB_R1, ob.RGB_G1, ob.RGB_B1, ob.RGB_R2, ob.RGB_G2, ob.RGB_B2); break; default: ob.isUNI = false; ob.nameID = 'none'; ob.UNI_stunR = 0; ob.UNI_staggerR = 0; ob.UNI_knockdownR = 0; ob.UNI_scale = 100; ob.UNI_AI = '0'; ob.RGB_R1 = 100; ob.RGB_G1 = 100; ob.RGB_B1 = 100; changeColour(ob.clip, ob.RGB_R1, ob.RGB_G1, ob.RGB_B1, ob.RGB_R2, ob.RGB_G2, ob.RGB_B2); } } function optionsChanged() { if (options.blurEffects) { not0.caption = 'Toggle Blur'; } else { not0.caption = 'Toggle Blur (OFF)'; } if (options.zoomEffects) { not1.caption = 'Toggle Zoom'; } else { not1.caption = 'Toggle Zoom (OFF)'; } if (options.rotationEffects) { not2.caption = 'Toggle Rotation'; } else { not2.caption = 'Toggle Rotation (OFF)'; } } function getAttack(attackID) { switch (attackID) { return '/dmg-1/blockable-0/minStaggerTime-1/maxStaggerTime-1/showBashEffect-0/pushbackEffect-0/stunEffect-0/cutArmChance-0/cutHeadChance-0/'; case 'att_f_1': return '/dmg-9/blockable-1/parryable-0/deathAnimationType-death_01/minStaggerTime-8/maxStaggerTime-11/showBashEffect-0/pushbackEffect-0/stunEffect-0/cutArmChance-10/cutHeadChance-0/'; case 'att_f_2': return '/dmg-11/blockable-1/parryable-0/deathAnimationType-death_01/minStaggerTime-8/maxStaggerTime-13/showBashEffect-0/pushbackEffect-0/stunEffect-5/cutArmChance-20/cutHeadChance-15/'; case 'att_f_3': return '/dmg-14/blockable-1/parryable-0/deathAnimationType-death_01/minStaggerTime-9/maxStaggerTime-15/showBashEffect-0/pushbackEffect-5/stunEffect-9/cutArmChance-30/cutHeadChance-22/'; case 'att_s': return '/dmg-21/blockable-0/parryable-1/deathAnimationType-death_01/minStaggerTime-12/maxStaggerTime-19/showBashEffect-1/pushbackEffect-9/stunEffect-12/cutArmChance-30/cutHeadChance-10/'; case 'att_s_run': return '/dmg-20/blockable-0/parryable-1/deathAnimationType-death_01/minStaggerTime-15/maxStaggerTime-21/showBashEffect-1/pushbackEffect-15/stunEffect-10/cutArmChance-15/cutHeadChance-35/'; case 'attack_jump': return '/dmg-25/blockable-0/parryable-0/deathAnimationType-death_01/minStaggerTime-15/maxStaggerTime-25/showBashEffect-1/pushbackEffect-25/stunEffect-25/cutArmChance-50/cutHeadChance-10/'; } return '/dmg-1/blockable-0/minStaggerTime-1/maxStaggerTime-1/showBashEffect-0/pushbackEffect-0/stunEffect-0/cutArmChance-0/cutHeadChance-0/'; } function resetRoot() { _root._xscale = 100; _root._yscale = 100; _root._x = 0; _root._y = 0; _root._rotation = 0; interfaceLayer._x = 0; interfaceLayer._y = 0; interfaceLayer._xscale = 100; interfaceLayer._yscale = 100; interfaceLayer._rotation = 0; removeMovieClip(theWorld); game.rootZoom = 100; game.rootRotation = 0; player.fallDeath = false; hideTutorialGuide(); } function startNewGame() { addBtnSound(); clearBOSoSData(); stopAllSounds(); _root.stopAllSounds(); hideCursor(); Mouse.hide(); menuLayer.menu_fixed.removeMovieClip(); menuLayer.attachMovie('movie_intro', 'movie_intro', 1); } function endMovie() { stopAllSounds(); _root.stopAllSounds(); showCursor(); menuLayer.movie_intro.removeMovieClip(); showMap(); } function exitGame() { hideTutorialGuide(); resetRoot(); _root.stopAllSounds(); game.currentLevel += 1; openMenu(); } function openMenu() { interfaceLayer.Encyclopedia.EncyclopediaCanShow = false; hideAllTopicIndicators(); stopAllSounds(); _root.stopAllSounds(); game.levelFinished = false; showCursor(); game.inMenu = true; game.isPaused = true; game.inWorldmap = false; resetRoot(); _root.createEmptyMovieClip('menuLayer', 20); menuLayer.attachMovie('menu_fixed', 'menu_fixed', 1); menuLayer.setMask(interfaceLayer.screenSize); interfaceLayer.ratioFix.gotoAndStop('empty'); interfaceLayer.gameCursor.gotoAndStop('idle'); MD.inWorldMap = false; } function updateUniqueSign(ob) { if (ob.life >= 0) { interfaceLayer.miniboss_sign.hp_bar._xscale = (ob.life / ob.maxLife) * 100; } else { interfaceLayer.miniboss_sign.hp_bar._xscale = 0; } } function hideUniqueSign() { interfaceLayer.miniboss_sign.removeMovieClip(); } function showUniqueSign(ob) { interfaceLayer.attachMovie('miniboss_sign', 'miniboss_sign', 39); interfaceLayer.miniboss_sign.attachMovie(findString('/type-', ob.enemyValues, '/'), 'animation', 5); interfaceLayer.miniboss_sign.animation.gotoAndStop('idle'); interfaceLayer.miniboss_sign.animation._x = interfaceLayer.miniboss_sign.anim_spot._x; interfaceLayer.miniboss_sign.animation._y = interfaceLayer.miniboss_sign.anim_spot._y; interfaceLayer.miniboss_sign.animation._xscale = -75; interfaceLayer.miniboss_sign.animation._yscale = 75; changeColour(interfaceLayer.miniboss_sign.animation, ob.RGB_R1, ob.RGB_G1, ob.RGB_B1, ob.RGB_R2, ob.RGB_G2, ob.RGB_B2); interfaceLayer.miniboss_sign.name_sign.gotoAndStop(ob.nameID); } function getFreeTopicSpot() { var v1 = 0; while (v1 < timersEncy.length) { if (timersEncy[v1] == 0) { return v1; } ++v1; } return -1; } function showHelpTopic() { hideAllTopicIndicators(); var v1 = getFreeTopicSpot(); interfaceLayer.attachMovie('new_topic_indicator', 'new_topic_indicator' + v1, 28 + v1); interfaceLayer['new_topic_indicator' + v1].gotoAndStop(1); interfaceLayer['new_topic_indicator' + v1]._y -= 25 * v1; timersEncy[v1] = setInterval(hideTopicIndicator, 3000, v1); } function showTopicInformation(topicString) { var v2 = new TextFormat(); v2.letterSpacing = -0.5; v2.size = 11; v2.bold = true; v2.font = 'Tahoma'; var v1 = getFreeTopicSpot(); interfaceLayer.attachMovie('new_topic_indicator', 'new_topic_indicator' + v1, 28 + v1); interfaceLayer['new_topic_indicator' + v1].gotoAndStop(2); interfaceLayer['new_topic_indicator' + v1].info_txt.text = topicString; interfaceLayer['new_topic_indicator' + v1].info_txt.setTextFormat(v2); interfaceLayer['new_topic_indicator' + v1]._y -= 25 * v1; timersEncy[v1] = setInterval(hideTopicIndicator, 3000, v1); } function showTopicIndicator(topicString) { var v1 = getFreeTopicSpot(); interfaceLayer.attachMovie('new_topic_indicator', 'new_topic_indicator' + v1, 28 + v1); interfaceLayer['new_topic_indicator' + v1].gotoAndStop(1); interfaceLayer['new_topic_indicator' + v1].info_txt.text = 'New Topic \'' + topicString + '\''; interfaceLayer['new_topic_indicator' + v1]._y -= 25 * v1; timersEncy[v1] = setInterval(hideTopicIndicator, 3000, v1); } function hideAllTopicIndicators() { var v1 = 0; while (v1 < timersEncy.length) { if (timersEncy[v1] != 0) { clearInterval(timersEncy[v1]); timersEncy[v1] = 0; interfaceLayer['new_topic_indicator' + v1]._alpha = 100; interfaceLayer['new_topic_indicator' + v1].removeMovieClip(); } ++v1; } } function hideTopicIndicator(nr) { clearInterval(timersEncy[nr]); timersEncy[nr] = setInterval(fadeTopicIndicator, 20, nr); } function fadeTopicIndicator(nr) { interfaceLayer['new_topic_indicator' + nr]._alpha -= 1; if (interfaceLayer['new_topic_indicator' + nr]._alpha <= 0) { clearInterval(timersEncy[nr]); timersEncy[nr] = 0; interfaceLayer['new_topic_indicator' + nr]._alpha = 100; interfaceLayer['new_topic_indicator' + nr].removeMovieClip(); } } function hideTutorialGuide() { TG.traceAction = 'none'; TG.prio = 0; clearInterval(TG.forceFadeTimer); clearInterval(TG.fadeTimer); clearInterval(TG.stopTimer); interfaceLayer.ratioFix.TG._alpha = 100; interfaceLayer.ratioFix.TG.gotoAndStop(1); } function fadeTutorialGuide() { clearInterval(TG.forceFadeTimer); clearInterval(TG.stopTimer); clearInterval(TG.fadeTimer); TG.forceFadeTimer = 0; TG.traceAction = 'none'; TG.prio = 0; TG.fadeTimer = setInterval(fadeStepTutorialGuide, 135); } function fadeStepTutorialGuide() { interfaceLayer.ratioFix.TG._alpha -= 4; if (interfaceLayer.ratioFix.TG._alpha <= 0) { interfaceLayer.ratioFix.TG._alpha = 0; interfaceLayer.ratioFix.TG.gotoAndStop(1); clearInterval(TG.fadeTimer); } } function checkForKickTutorial() { if (TutorialGuide[10] >= 2) { TG.checkForKick = false; } else { if (canKick()) { showTutorialGuide(10); } } } function checkForFinTutorial() { if (TutorialGuide[12] >= 3) { TG.checkForFin = false; } else { if (player.rage >= 100) { var v4 = false; var v1 = 1; while (v1 <= enemyCounter) { if (myObject['enemy' + v1].currAttack != 'jump' and !myObject['enemy' + v1].finishingDone and !myObject['enemy' + v1].isFalling and myObject['enemy' + v1].enemyType != 'BOSS' and myObject['enemy' + v1].enemyType != 'Crow' and myObject['enemy' + v1].life > 0 and facingOb(player, myObject['enemy' + v1]) and myObject['enemy' + v1].inGame and (myObject['enemy' + v1].stunTimer > 1 or myObject['enemy' + v1].knockdownTimer > 1 or player.rage >= 100)) { var v3 = Math.sqrt((myObject['enemy' + v1].posX - player.posX) * (myObject['enemy' + v1].posX - player.posX)); if (v3 <= finishingXRange - 4) { var v2 = Math.sqrt((myObject['enemy' + v1].posY - player.posY) * (myObject['enemy' + v1].posY - player.posY)); if (v2 < 30) { v4 = true; } } } ++v1; } if (v4) { showTutorialGuide(12); } } } } function TGBoo() { clearInterval(TG.fadeTimer); TG.fadeTimer = 0; clearInterval(TG.forceFadeTimer); TG.forceFadeTimer = 0; interfaceLayer.ratioFix.TG._alpha = 100; } function showTutorialGuide(nr) { if (nr == 16) { if (TutorialGuide[nr] < 1) { TGBoo(); interfaceLayer.ratioFix.TG.gotoAndStop(nr + 1); TG.traceAction = 'level2E'; TG.prio = 1; clearInterval(TG.stopTimer); TG.stopTimer = setInterval(fadeTutorialGuide, 5000); } } else { if (nr == 15) { if (TutorialGuide[nr] < 1) { menuLayer.worldMap_fixed.t_all.gotoAndStop(nr + 1); TG.traceAction = 'worldmapE'; } } else { if (nr == 17) { if (TutorialGuide[nr] < 2) { menuLayer.worldMap_fixed.t_all.gotoAndStop(nr + 1); TG.traceAction = 'worldmapD'; } } else { if (nr == 1) { if (TutorialGuide[nr] < 1) { TGBoo(); interfaceLayer.ratioFix.TG.gotoAndStop(nr + 1); TG.prio = 1; TG.traceAction = 'move'; TutorialGuide[nr] += 1; } } else { if (nr == 2) { if (TutorialGuide[nr] < 1) { TGBoo(); interfaceLayer.ratioFix.TG.gotoAndStop(nr + 1); TG.prio = 1; TG.traceAction = 'jump'; TutorialGuide[nr] += 1; } } else { if (nr == 3) { if (TutorialGuide[nr] < 1) { TGBoo(); interfaceLayer.ratioFix.TG.gotoAndStop(nr + 1); TG.prio = 1; TG.traceAction = 'fastatt'; TutorialGuide[nr] += 1; } } else { if (nr == 4) { if (TutorialGuide[nr] < 1) { TGBoo(); interfaceLayer.ratioFix.TG.gotoAndStop(nr + 1); TG.prio = 1; TutorialGuide[nr] += 1; } } else { if (nr == 5) { if (TutorialGuide[nr] < 1) { TGBoo(); interfaceLayer.ratioFix.TG.gotoAndStop(nr + 1); TG.prio = 1; TG.traceAction = 'strongatt'; TutorialGuide[nr] += 1; TutorialGuide[0] = 1; } } else { if (TutorialGuide[0] == 1) { if (nr == 6) { if (TG.prio != 2 and TG.prio != 3) { if (TutorialGuide[7] < 3) { TGBoo(); interfaceLayer.ratioFix.TG.gotoAndStop(nr + 1); TG.prio = 3; TG.traceAction = 'barrelNear'; clearInterval(TG.stopTimer); } } } else { if (nr == 7) { if (TG.prio != 2 or TG.traceAction == 'barrelNear') { if (TutorialGuide[nr] < 3) { TGBoo(); interfaceLayer.ratioFix.TG.gotoAndStop(nr + 1); TG.prio = 2; TG.traceAction = 'barrelThrow'; TutorialGuide[nr] += 1; clearInterval(TG.stopTimer); } } } else { if (nr == 8) { if (TutorialGuide[nr] < 3) { TGBoo(); interfaceLayer.ratioFix.TG.gotoAndStop(nr + 1); TG.prio = 2; TG.traceAction = 'contest'; TutorialGuide[nr] += 1; clearInterval(TG.stopTimer); } } else { if (nr == 9) { if (TG.prio != 2) { if (TutorialGuide[nr] < 3) { TGBoo(); interfaceLayer.ratioFix.TG.gotoAndStop(nr + 1); TG.prio = 2; TG.traceAction = 'fin_kick'; clearInterval(TG.stopTimer); TG.stopTimer = setInterval(checkTGAimID, 300); } } } else { if (nr == 10) { if (TG.prio != 2 and TG.prio != 3) { if (TutorialGuide[nr] < 2) { TGBoo(); interfaceLayer.ratioFix.TG.gotoAndStop(nr + 1); TG.prio = 3; TG.traceAction = 'kick'; clearInterval(TG.stopTimer); TG.stopTimer = setInterval(checkTGAimID, 300); } } } else { if (nr == 11) { if (TG.prio != 2) { if (TutorialGuide[nr] < 3) { TGBoo(); interfaceLayer.ratioFix.TG.gotoAndStop(nr + 1); TG.prio = 2; TutorialGuide[nr] += 1; TG.traceAction = 'grab'; clearInterval(TG.stopTimer); } } } else { if (nr == 12) { if (TG.prio != 2) { if (TutorialGuide[nr] < 3) { TGBoo(); interfaceLayer.ratioFix.TG.gotoAndStop(nr + 1); TG.prio = 2; TG.traceAction = 'fin'; clearInterval(TG.stopTimer); TG.stopTimer = setInterval(checkTGAimID, 300); } } } else { if (nr == 13) { if (TG.prio != 2) { if (TutorialGuide[nr] < 3) { TGBoo(); interfaceLayer.ratioFix.TG.gotoAndStop(nr + 1); TG.prio = 2; TG.traceAction = 'stun'; clearInterval(TG.stopTimer); TG.stopTimer = setInterval(checkTGAimID, 300); checkTGAimID(); } } } } } } } } } } } } } } } } } } } } function checkTGAimID() { if (TG.traceAction == 'fin_kick') { if (myObject['enemy' + TG.traceAimID].knockdownTimer <= 0) { fadeTutorialGuide(); } else { var v1 = Math.sqrt((myObject['enemy' + TG.traceAimID].posX - player.posX) * (myObject['enemy' + TG.traceAimID].posX - player.posX)); if (v1 > 65 or !facingOb(player, myObject['enemy' + TG.traceAimID])) { fadeTutorialGuide(); } } } else { if (TG.traceAction == 'kick') { if (!canKick()) { fadeTutorialGuide(); } } else { if (TG.traceAction == 'fin') { if (!theWorld.actorsLayer.hitTest(player.posX + camPos.difX + player.dirX * 45, player.posY + camPos.difY - 20, true) and !theWorld.actorsLayer.hitTest(player.posX + camPos.difX + player.dirX * 55, player.posY + camPos.difY - 30, true)) { fadeTutorialGuide(); } } else { if (TG.traceAction == 'stun') { var v1 = Math.sqrt((myObject['enemy' + TG.traceAimID].posX - player.posX) * (myObject['enemy' + TG.traceAimID].posX - player.posX)); if (myObject['enemy' + TG.traceAimID].stunTimer <= 0 or v1 > 65) { fadeTutorialGuide(); } else { if (myObject['enemy' + TG.traceAimID].posX > player.posX) { interfaceLayer.ratioFix.TG.gotoAndStop(14); } else { interfaceLayer.ratioFix.TG.gotoAndStop(15); } } } else { if (TG.traceAction == 'none') { clearInterval(TG.stopTimer); TG.stopTimer = setInterval(fadeTutorialGuide, 2000); } } } } } } function checkStunTutorial(ob) { var v2 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); if (v2 < 60) { TG.traceAimID = ob.ID; showTutorialGuide(13); } } function checkKnockdownTutorial(ob) { var v2 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); if (v2 < 60 and facingOb(player, ob)) { TG.traceAimID = ob.ID; showTutorialGuide(9); } } function initTimering() { clearInterval(timerEncyclopedia); loadBOSoS(); openMenu(); } function reset_second() { reset(); } function reset() { hideTutorialGuide(); BOSoS_CHEATS = false; stopAllSounds(); _root.stopAllSounds(); removeMovieClip(menuLayer); _root.stopAllSounds(); if (_root._quality == 'HIGH') { _root._quality = 'MEDIUM'; } sound_ambience3.setVolume(0); sound_ambience2.setVolume(0); fadingMusicing3 = 0; fadingMusicing2 = 0; musicTrack2Steps = 0; musicTrack3Steps = 0; musicTrack2Target = 0; musicTrack3Target = 0; setThunder(0, 0); resetRoot(); canToggleFullscreen = true; game.allSoundsStopped = true; game.inWorldmap = false; game.initSat = 0; game.levelFinished = false; game.fightingBoss = 0; camPos.difX = 0; camPos.difY = 0; camPos.virDifX = 0; camPos.virDifY = 0; camPos.minX = -9999; camPos.maxX = 9999; player.nrOfKills = 0; player.deathInitiated = false; player.gibbed = false; player.posX = 0; player.posY = 0; player.dirX = 1; player.velX = 0; player.velY = 0; player.isPreparingJump = false; player.isJumping = false; player.isFalling = false; player.shadowScale = 100; player.isCarringBarrel = 0; player.isHoldingBarrel = false; player.isThrowingBarrel = false; player.currentAttack = 0; player.performNextAttack = false; player.jumpAttackPerformed = false; player.staggerTimer = 0; player.uncontrollable = false; player.arrowCounter = 0; player.isKnockdowned = false; player.knockdownTimer = 0; player.blurTimer = 0; player.isStunned = false; player.contesting = 0; player.immortal = false; player.uncontrollable = false; player.finishingEnemy = 0; player.life = 100; player.rage = 0; player.fallDeath = false; player.resetDone = false; game.gravity = 0.6; game.physicAccuracy = 6; game.rootRotation = 0; game.rootZoom = 100; game.shadows = 0; game.stopCam = 0; game.isPaused = false; game.inMenu = false; game.camShakeTime = 0; game.camShakePower = 0; game.lockCam = false; game.weatherType = 'nothing'; gameEvent.waveID = 'none_0'; bgFar.posX = 0; bgFar.posY = 0; foodCounter = 0; foodCrateCounter = 0; circleCounter = 0; arrowCounter = 0; enemyCounter = 0; minArrowCounter = 0; effectCounter = 0; partCounter = 0; staticEffectsCounter = 0; bloodstainCounter = 0; deathObjects = 0; resetRoot(); _root.createEmptyMovieClip('theWorld', 6); getLevelColour(); theWorld.createEmptyMovieClip('backgroundNearLayer', 2); theWorld.createEmptyMovieClip('staticEffectsLayer', 3); theWorld.createEmptyMovieClip('staticEffectsLayerParts', 4); theWorld.createEmptyMovieClip('deadEnemiesLayer', 5); theWorld.createEmptyMovieClip('shadowLayer', 6); theWorld.createEmptyMovieClip('crowLayer', 7); theWorld.createEmptyMovieClip('actorsLayer', 8); theWorld.createEmptyMovieClip('objectsLayerBarrels', 9); theWorld.createEmptyMovieClip('partFlyingLayer', 10); theWorld.createEmptyMovieClip('effectsLayer', 12); theWorld.createEmptyMovieClip('objectsLayerArrows', 16); theWorld.createEmptyMovieClip('foodLayer', 17); theWorld.createEmptyMovieClip('foodLayer2', 18); theWorld.createEmptyMovieClip('foregroundLayer', 20); _root.attachMovie('xmarker', 'xmarker', 1); theWorld.setMask(interfaceLayer.screenSize); interfaceLayer.ratioFix.gotoAndStop('loading'); var v2 = 1; while (v2 <= 100) { _root.createEmptyMovieClip('mySound_' + v2, 1001 + v2); ++v2; } spawnMapTimer = 5; hideCursor(); } function globalMusicVolumeChanged() { var v1 = globalMusicVolume / globalSoundVolume; sound_ambience2.setVolume(musicTrack2BTarget * v1); sound_ambience3.setVolume(musicTrack3BTarget * v1); } function startAmbientMusic(nr) { if (nr == 0) { sound_ambience.stop(); } else { if (nr == 1) { sound_ambience.stop(); sound_ambience.attachSound('al_wt_rainhard1.wav'); sound_ambience.start(); sound_ambience.setVolume(60); sound_ambience.onSoundComplete = function () { sound_ambience.start(); }; } else { if (nr == 2) { } } } } function fadeMusic() { fadingMusicing2Step = sound_ambience2.getVolume() / 20; fadingMusicing3Step = sound_ambience3.getVolume() / 20; fadingMusicing2 = setInterval(lowerMusicVolume2Step, 50); fadingMusicing3 = setInterval(lowerMusicVolume3Step, 50); } function lowerMusicVolume2Step() { sound_ambience2.setVolume(sound_ambience2.getVolume() - fadingMusicing2Step); if (sound_ambience2.getVolume() <= 0) { sound_ambience2.stop(); clearInterval(fadingMusicing2); fadingMusicing2 = 0; } } function lowerMusicVolume3Step() { sound_ambience3.setVolume(sound_ambience3.getVolume() - fadingMusicing3Step); if (sound_ambience3.getVolume() <= 0) { sound_ambience3.stop(); clearInterval(fadingMusicing3); fadingMusicing3 = 0; } } function musicTrack2Fade() { sound_ambience2.setVolume(sound_ambience2.getVolume() + musicTrack2Steps); if (musicTrack2Steps <= 0 and sound_ambience2.getVolume() <= 0 or sound_ambience2.getVolume() >= musicTrack2Target and musicTrack2Steps > 0) { sound_ambience2.setVolume(musicTrack2Target); clearInterval(musicTrack2Transition); musicTrack2Transition = 0; if (musicTrack2Target <= 0) { musicTrack2BTarget = 0; sound_ambience2.stop(); } else { if (!globalMusicStartEnabled) { sound_ambience2.start(); } sound_ambience3.stop(); } } } function musicTrack3Fade() { sound_ambience3.setVolume(sound_ambience3.getVolume() + musicTrack3Steps); if (musicTrack3Steps <= 0 and sound_ambience3.getVolume() <= 0 or sound_ambience3.getVolume() >= musicTrack3Target and musicTrack3Steps > 0) { sound_ambience3.setVolume(musicTrack3Target); clearInterval(musicTrack3Transition); musicTrack3Transition = 0; if (musicTrack3Target <= 0) { musicTrack3BTarget = 0; sound_ambience3.stop(); } else { if (!globalMusicStartEnabled) { sound_ambience3.start(); } sound_ambience2.stop(); } } } function startMusic(nr) { globalMusicStartEnabled = false; if (!game.allSoundsStopped) { _root['musicTrack' + currMusicTrack + 'Target'] = 0; _root['musicTrack' + currMusicTrack + 'BTarget'] = 0; _root['musicTrack' + currMusicTrack + 'Steps'] = -_root['sound_ambience' + currMusicTrack].getVolume() / 20; clearInterval(_root['musicTrack' + currMusicTrack + 'Transition']); _root['musicTrack' + currMusicTrack + 'Transition'] = setInterval(_root['musicTrack' + currMusicTrack + 'Fade'], 50); } if (currMusicTrack == 3) { currMusicTrack = 2; } else { currMusicTrack = 3; } var v2 = 0; var v4 = globalMusicVolume / globalSoundVolume; if (nr == 1) { _root['sound_ambience' + currMusicTrack].stop(); _root['sound_ambience' + currMusicTrack].attachSound('boss.mp3'); _root['sound_ambience' + currMusicTrack].setVolume(0); v2 = 75; _root['sound_ambience' + currMusicTrack].onSoundComplete = function () { _root['sound_ambience' + currMusicTrack].start(); }; } else { if (nr == 2) { _root['sound_ambience' + currMusicTrack].stop(); _root['sound_ambience' + currMusicTrack].attachSound('boss_final.mp3'); _root['sound_ambience' + currMusicTrack].setVolume(0); v2 = 75; _root['sound_ambience' + currMusicTrack].onSoundComplete = function () { _root['sound_ambience' + currMusicTrack].start(); }; } else { if (nr == 5) { _root['sound_ambience' + currMusicTrack].stop(); _root['sound_ambience' + currMusicTrack].attachSound('battle_1.mp3'); _root['sound_ambience' + currMusicTrack].start(); globalMusicStartEnabled = true; _root['sound_ambience' + currMusicTrack].setVolume(0); v2 = 100; _root['sound_ambience' + currMusicTrack].onSoundComplete = function () { _root['sound_ambience' + currMusicTrack].start(); }; } else { if (nr == 6) { _root['sound_ambience' + currMusicTrack].stop(); _root['sound_ambience' + currMusicTrack].attachSound('battle_2.mp3'); _root['sound_ambience' + currMusicTrack].start(); globalMusicStartEnabled = true; _root['sound_ambience' + currMusicTrack].setVolume(0); v2 = 95; _root['sound_ambience' + currMusicTrack].onSoundComplete = function () { _root['sound_ambience' + currMusicTrack].start(); }; } else { if (nr == 7) { _root['sound_ambience' + currMusicTrack].stop(); _root['sound_ambience' + currMusicTrack].attachSound('battle_3.mp3'); _root['sound_ambience' + currMusicTrack].start(); globalMusicStartEnabled = true; _root['sound_ambience' + currMusicTrack].setVolume(0); v2 = 95; _root['sound_ambience' + currMusicTrack].onSoundComplete = function () { _root['sound_ambience' + currMusicTrack].start(); }; } else { if (nr == 10) { _root['sound_ambience' + currMusicTrack].stop(); _root['sound_ambience' + currMusicTrack].attachSound('168072_2008.08.25_Epic_Conan_Orch.mp3'); _root['sound_ambience' + currMusicTrack].start(); globalMusicStartEnabled = true; _root['sound_ambience' + currMusicTrack].setVolume(70 * v4); v2 = 70; _root['sound_ambience' + currMusicTrack].onSoundComplete = function () { _root['sound_ambience' + currMusicTrack].stop(); }; } else { if (nr == 11) { _root['sound_ambience' + currMusicTrack].stop(); _root['sound_ambience' + currMusicTrack].attachSound('map_loop.mp3'); _root['sound_ambience' + currMusicTrack].start(); globalMusicStartEnabled = true; _root['sound_ambience' + currMusicTrack].setVolume(160 * v4); v2 = 160; _root['sound_ambience' + currMusicTrack].onSoundComplete = function () { _root['sound_ambience' + currMusicTrack].start(); }; } } } } } } } _root['musicTrack' + currMusicTrack + 'BTarget'] = v2; _root['musicTrack' + currMusicTrack + 'Target'] = v2 * v4; _root['musicTrack' + currMusicTrack + 'Steps'] = v2 * v4 / 20; clearInterval(_root['musicTrack' + currMusicTrack + 'Transition']); if (!game.allSoundsStopped) { _root['musicTrack' + currMusicTrack + 'Transition'] = setInterval(_root['musicTrack' + currMusicTrack + 'Fade'], 50); } else { _root['sound_ambience' + currMusicTrack].setVolume(v2 * v4); game.allSoundsStopped = false; } } function gameOver() { hideUniqueSign(); resetRoot(); saveBOSoS(); openMenu(); game.currentLevel += 1; showMap(); } function levelFinished() { game.levelFinished = true; interfaceLayer.ratioFix.gotoAndStop('stage_cleared'); } function stageCleared() { var v2 = false; if (!MapsCleared[game.currentLevel]) { if (game.currentLevel == 19) { v2 = true; } MapScriptForThisLevelAble = true; } MapsCleared[game.currentLevel] = true; game.maxLevelCleared += 1; game.currentLevel += 1; saveBOSoS(); openMenu(); if (v2) { interfaceLayer.Encyclopedia.EncyclopediaCanShow = false; stopAllSounds(); _root.stopAllSounds(); hideCursor(); Mouse.hide(); menuLayer.menu_fixed.removeMovieClip(); menuLayer.attachMovie('movie_outro', 'movie_outro', 1); } else { showMap(); } } function endOutroMovie() { stopAllSounds(); _root.stopAllSounds(); showCursor(); menuLayer.movie_intro.removeMovieClip(); showMap(); } function showCursor() { MD.showMouse = true; Mouse.hide(); interfaceLayer.gameCursor._alpha = 100; } function hideCursor() { MD.forcePointer = false; MD.showMouse = false; Mouse.show(); interfaceLayer.gameCursor._alpha = 0; } function fieldAreaClose() { if (menuLayer.worldMap_fixed.worldMap.barb_home.hitTest(_root._xmouse, _root._ymouse, true)) { menuLayer.worldMap_fixed.world_sign.name_txt.text = 'BARBARIAN STRONGHOLD'; menuLayer.worldMap_fixed.world_sign.name_txt._alpha = 100; return true; return false; } if (menuLayer.worldMap_fixed.worldMap.dead_mines.hitTest(_root._xmouse, _root._ymouse, true)) { menuLayer.worldMap_fixed.world_sign.name_txt.text = MapsName[4]; menuLayer.worldMap_fixed.world_sign.name_txt._alpha = 100; return true; return false; } if (menuLayer.worldMap_fixed.worldMap.mt_dam.hitTest(_root._xmouse, _root._ymouse, true)) { menuLayer.worldMap_fixed.world_sign.name_txt.text = MapsName[6]; menuLayer.worldMap_fixed.world_sign.name_txt._alpha = 100; return true; return false; } if (menuLayer.worldMap_fixed.worldMap.woods.hitTest(_root._xmouse, _root._ymouse, true)) { menuLayer.worldMap_fixed.world_sign.name_txt.text = MapsName[3]; menuLayer.worldMap_fixed.world_sign.name_txt._alpha = 100; return true; return false; } if (menuLayer.worldMap_fixed.worldMap.village.hitTest(_root._xmouse, _root._ymouse, true)) { menuLayer.worldMap_fixed.world_sign.name_txt.text = MapsName[7]; menuLayer.worldMap_fixed.world_sign.name_txt._alpha = 100; return true; return false; } if (menuLayer.worldMap_fixed.worldMap.pl_shire.hitTest(_root._xmouse, _root._ymouse, true)) { if (!MapsCleared[6]) { menuLayer.worldMap_fixed.world_sign.name_txt.text = 'PLEASANTSHIRE'; } else { menuLayer.worldMap_fixed.world_sign.name_txt.text = 'A MISERABLE SLOUGH'; } menuLayer.worldMap_fixed.world_sign.name_txt._alpha = 100; return true; return false; } if (menuLayer.worldMap_fixed.worldMap.lake.hitTest(_root._xmouse, _root._ymouse, true)) { if (!MapsCleared[6]) { menuLayer.worldMap_fixed.world_sign.name_txt.text = 'MARCHING LAKE'; } else { menuLayer.worldMap_fixed.world_sign.name_txt.text = MapsName[8]; } menuLayer.worldMap_fixed.world_sign.name_txt._alpha = 100; return true; return false; } if (menuLayer.worldMap_fixed.worldMap.thepass.hitTest(_root._xmouse, _root._ymouse, true)) { menuLayer.worldMap_fixed.world_sign.name_txt.text = MapsName[13]; menuLayer.worldMap_fixed.world_sign.name_txt._alpha = 100; return true; return false; } if (menuLayer.worldMap_fixed.worldMap.dragonmountain.hitTest(_root._xmouse, _root._ymouse, true)) { menuLayer.worldMap_fixed.world_sign.name_txt.text = MapsName[12]; menuLayer.worldMap_fixed.world_sign.name_txt._alpha = 100; return true; return false; } if (menuLayer.worldMap_fixed.worldMap.maw.hitTest(_root._xmouse, _root._ymouse, true)) { menuLayer.worldMap_fixed.world_sign.name_txt.text = MapsName[16]; menuLayer.worldMap_fixed.world_sign.name_txt._alpha = 100; return true; return false; } if (menuLayer.worldMap_fixed.worldMap.stair.hitTest(_root._xmouse, _root._ymouse, true)) { menuLayer.worldMap_fixed.world_sign.name_txt.text = MapsName[17]; menuLayer.worldMap_fixed.world_sign.name_txt._alpha = 100; return true; return false; } if (menuLayer.worldMap_fixed.worldMap.castle.hitTest(_root._xmouse, _root._ymouse, true)) { menuLayer.worldMap_fixed.world_sign.name_txt.text = MapsName[18]; menuLayer.worldMap_fixed.world_sign.name_txt._alpha = 100; return true; } return false; } function updateCursor() { if (MD.showMouse) { interfaceLayer.gameCursor._x = _root._xmouse * (game.rootZoom / 100) + (640 - 640 * (game.rootZoom / 100)) / 2; interfaceLayer.gameCursor._y = _root._ymouse * (game.rootZoom / 100) + (480 - 480 * (game.rootZoom / 100)) / 2; if (MD.forcePointer) { interfaceLayer.gameCursor.gotoAndStop('idle'); } else { if (MD.inWorldMap) { var v3 = false; var v2 = 1; while (v2 <= 21) { if (mapPointClose(v2)) { v3 = true; interfaceLayer.gameCursor.gotoAndStop('idle'); menuLayer.worldMap_fixed.world_sign.name_txt.text = MapsName[v2]; menuLayer.worldMap_fixed.world_sign.name_txt._alpha = 100; } ++v2; } if (!v3) { if (menuLayer.worldMap_fixed.world_sign.name_txt._alpha > 0) { menuLayer.worldMap_fixed.world_sign.name_txt._alpha -= 4; } if (!fieldAreaClose() or MD.dragging) { interfaceLayer.gameCursor.gotoAndStop('grab'); if (!MD.dragging) { interfaceLayer.gameCursor.mc.gotoAndStop('open'); } else { interfaceLayer.gameCursor.mc.gotoAndStop('closed'); if (TG.traceAction == 'worldmapD') { menuLayer.worldMap_fixed.t_all.gotoAndStop(1); TutorialGuide[17] = 2; } } } else { interfaceLayer.gameCursor.gotoAndStop('idle'); } } } } } } function updateMousePos() { MD.mPosX = _root._xmouse; MD.mPosY = _root._ymouse; } function GetRandom(MinValue, MaxValue, Rounded) { if (MinValue > MaxValue) { } if (Rounded) { return Math.round(Math.random() * (MaxValue - MinValue)) + MinValue; } else { return Math.random() * (MaxValue - MinValue) + MinValue; } } function findNumberTakenInArray(Arry, Nr) { if (Nr == undefined) { return true; } var v1 = 0; while (v1 < Arry.length) { if (Arry[v1] == Nr) { return true; } ++v1; } return false; } function findPathTo(currentLevel, targetLevel) { var v4 = 0; var v2 = 0; var v1 = new Array(); var v5 = 1; while (v5 <= 80) { v1 = new Array(); v1.push(currentLevel); var v3 = 1; while (v3 <= 80) { v2 = v1.length - 1; v4 = GetRandom(0, MapsConnected[v1[v2]].length - 1, true); if (!findNumberTakenInArray(v1, MapsConnected[v1[v2]][v4])) { v1.push(MapsConnected[v1[v2]][v4]); if (v1[v2 + 1] == targetLevel) { return v1; } } ++v3; } ++v5; } var v8 = new Array(); return v8; } function prepareMap(nr) { if (!WorldMapPlayerMoving) { if (game.currentLevel - 1 != nr) { WorldMapPlayerPath = findPathTo(game.currentLevel - 1, nr); if (WorldMapPlayerPath.length > 0) { StartMovePlayer(); } else { game.currentLevel = 2; menuLayer.worldMap_fixed.worldMap.playerWorldmap._x = menuLayer.worldMap_fixed.worldMap['L' + (game.currentLevel - 1)]._x; menuLayer.worldMap_fixed.worldMap.playerWorldmap._y = menuLayer.worldMap_fixed.worldMap['L' + (game.currentLevel - 1)]._y; } } else { player.startFromCheckpoint = false; if (isBossMap(nr)) { MD.forcePointer = true; game.currentLevel = nr; if (MapsCheckpointsReached[nr]) { menuLayer.worldMap_fixed.bossy.gotoAndStop(3); } else { menuLayer.worldMap_fixed.bossy.gotoAndStop(2); } } else { hideAllTopicIndicators(); game.currentLevel = nr; game.inWorldmap = false; reset(); } } } } function hideBossySign() { game.currentLevel += 1; MD.forcePointer = false; menuLayer.worldMap_fixed.bossy.gotoAndStop(1); } function isBossMap(nr) { var v1 = 0; while (v1 < MapsBoss.length) { if (MapsBoss[v1] == nr) { return true; } ++v1; } return false; } function updateMapSpecials() { if (MapsCleared[16]) { menuLayer.worldMap_fixed.worldMap.edges.gotoAndStop(4); } else { if (MapsCleared[12]) { menuLayer.worldMap_fixed.worldMap.edges.gotoAndStop(3); } else { if (MapsCleared[8]) { menuLayer.worldMap_fixed.worldMap.edges.gotoAndStop(2); } else { menuLayer.worldMap_fixed.worldMap.edges.gotoAndStop(1); } } } if (MapsCleared[1]) { menuLayer.worldMap_fixed.worldMap.tutorial._alpha = 0; } if (MapsCleared[6]) { menuLayer.worldMap_fixed.worldMap.mtDam.gotoAndStop('end'); menuLayer.worldMap_fixed.worldMap.sunbeams.gotoAndStop('end'); } if (MapsCleared[3]) { menuLayer.worldMap_fixed.worldMap.bridge.gotoAndStop('end'); } if (MapsCleared[12]) { menuLayer.worldMap_fixed.worldMap.pass.gotoAndStop('end'); } if (!MapsCleared[8]) { MD.ableToDrag = false; } if (!MapsCleared[12] or !MapsCleared[13]) { menuLayer.worldMap_fixed.worldMap.undeadArmyWalk._alpha = 0; } else { if (MapsCleared[15]) { menuLayer.worldMap_fixed.worldMap.undeadArmyWalk.gotoAndStop('end_last'); } else { if (MapsCleared[14]) { menuLayer.worldMap_fixed.worldMap.undeadArmyWalk.gotoAndStop('end_middle'); } } } menuLayer.worldMap_fixed.worldMap.dragons.gotoAndStop('end'); if (game.currentLevel <= 1) { game.currentLevel = 2; } menuLayer.worldMap_fixed.worldMap.playerWorldmap._x = menuLayer.worldMap_fixed.worldMap['L' + (game.currentLevel - 1)]._x; menuLayer.worldMap_fixed.worldMap.playerWorldmap._y = menuLayer.worldMap_fixed.worldMap['L' + (game.currentLevel - 1)]._y; if (game.currentLevel > 6 and game.currentLevel < 21) { if (game.currentLevel > 17) { menuLayer.worldMap_fixed.worldMap._x = -menuLayer.worldMap_fixed.worldMap.mapPos4._x; menuLayer.worldMap_fixed.worldMap._y = -menuLayer.worldMap_fixed.worldMap.mapPos4._y; } else { if (game.currentLevel == 17) { menuLayer.worldMap_fixed.worldMap._x = -menuLayer.worldMap_fixed.worldMap.mapPos16._x; menuLayer.worldMap_fixed.worldMap._y = -menuLayer.worldMap_fixed.worldMap.mapPos16._y; } else { if (game.currentLevel > 14) { menuLayer.worldMap_fixed.worldMap._x = -menuLayer.worldMap_fixed.worldMap.mapPos3._x; menuLayer.worldMap_fixed.worldMap._y = -menuLayer.worldMap_fixed.worldMap.mapPos3._y; } else { if (game.currentLevel == 13) { menuLayer.worldMap_fixed.worldMap._x = -menuLayer.worldMap_fixed.worldMap.mapPos12._x; menuLayer.worldMap_fixed.worldMap._y = -menuLayer.worldMap_fixed.worldMap.mapPos12._y; } else { if (game.currentLevel > 9) { menuLayer.worldMap_fixed.worldMap._x = -menuLayer.worldMap_fixed.worldMap.mapPos2._x; menuLayer.worldMap_fixed.worldMap._y = -menuLayer.worldMap_fixed.worldMap.mapPos2._y; } else { menuLayer.worldMap_fixed.worldMap._x = -menuLayer.worldMap_fixed.worldMap.mapPos1._x; menuLayer.worldMap_fixed.worldMap._y = -menuLayer.worldMap_fixed.worldMap.mapPos1._y; } } } } } updateWorldmap(); } var v2 = 1; while (v2 <= 21) { menuLayer.worldMap_fixed.worldMap['L' + v2]._alpha = 0; ++v2; } MapsToFadeIn = new Array(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); var v4 = 0; if (MapsCleared[19]) { MapsCleared[20] = true; } v2 = 0; while (v2 <= 21) { if (MapsCleared[v2]) { menuLayer.worldMap_fixed.worldMap['L' + v2]._alpha = 100; var v1 = 0; while (v1 < MapsConnected[v2].length) { if (MapsCleared[MapsConnected[v2][v1]]) { menuLayer.worldMap_fixed.worldMap['L' + MapsConnected[v2][v1]]._alpha = 100; } else { MapsToFadeIn[MapsConnected[v2][v1]] = true; } ++v1; } } ++v2; } if (!MapsCleared[6]) { MapsToFadeIn[8] = false; } if (!MapsCleared[12]) { MapsToFadeIn[14] = false; } if (!MapsCleared[19]) { MapsToFadeIn[20] = false; } if (!MapsCleared[21]) { MapsToFadeIn[21] = false; } var v3 = 1; while (v3 <= 21) { if (MapsToFadeIn[v3]) { v4 += 1; menuLayer.worldMap_fixed.worldMap['marker' + v4]._x = menuLayer.worldMap_fixed.worldMap['L' + v3]._x; menuLayer.worldMap_fixed.worldMap['marker' + v4]._y = menuLayer.worldMap_fixed.worldMap['L' + v3]._y; } ++v3; } if (MapScriptForThisLevelAble) { player.levelsCompletedTotal += 1; menuLayer.worldMap_fixed.worldMap.playerWorldmap['crow' + player.levelsCompletedTotal]._alpha = 100; if (menuLayer.worldMap_fixed.worldMap['script_' + (game.currentLevel - 1)]._x == undefined) { MD.showSign = true; } else { menuLayer.worldMap_fixed.worldMap['script_' + (game.currentLevel - 1)].gotoAndPlay(2); } MapScriptForThisLevelAble = false; } else { MD.showSign = true; } } function hideMaps() { if (showingAllMaps) { MD.fadeInMaps = false; var v1 = 1; while (v1 <= 21) { menuLayer.worldMap_fixed.worldMap['L' + v1]._x += 1000; menuLayer.worldMap_fixed.worldMap['L' + v1]._y += 1000; ++v1; } menuLayer.worldMap_fixed.worldMap.marker1._x += 1000; menuLayer.worldMap_fixed.worldMap.marker1._y += 1000; menuLayer.worldMap_fixed.worldMap.marker2._x += 1000; menuLayer.worldMap_fixed.worldMap.marker2._y += 1000; MD.ableToDrag = false; hideMapsFromScript = true; showingAllMaps = false; } } function showMaps() { if (!showingAllMaps) { MD.fadeInMaps = true; MD.showSign = true; var v1 = 1; while (v1 <= 21) { menuLayer.worldMap_fixed.worldMap['L' + v1]._x -= 1000; menuLayer.worldMap_fixed.worldMap['L' + v1]._y -= 1000; ++v1; } menuLayer.worldMap_fixed.worldMap.marker1._x -= 1000; menuLayer.worldMap_fixed.worldMap.marker1._y -= 1000; menuLayer.worldMap_fixed.worldMap.marker2._x -= 1000; menuLayer.worldMap_fixed.worldMap.marker2._y -= 1000; MD.ableToDrag = true; if (!MapsCleared[8]) { MD.ableToDrag = false; } showingAllMaps = true; } } function mapPointClose(point) { var v4 = Math.sqrt((_root._xmouse - (menuLayer.worldMap_fixed.worldMap['L' + point]._x + menuLayer.worldMap_fixed.worldMap._x)) * (_root._xmouse - (menuLayer.worldMap_fixed.worldMap['L' + point]._x + menuLayer.worldMap_fixed.worldMap._x))); var v3 = Math.sqrt((_root._ymouse - (menuLayer.worldMap_fixed.worldMap['L' + point]._y + menuLayer.worldMap_fixed.worldMap._y)) * (_root._ymouse - (menuLayer.worldMap_fixed.worldMap['L' + point]._y + menuLayer.worldMap_fixed.worldMap._y))); if (menuLayer.worldMap_fixed.worldMap['L' + point]._alpha >= 100 and v4 < menuLayer.worldMap_fixed.worldMap['L' + point]._width / 2 and v3 < menuLayer.worldMap_fixed.worldMap['L' + point]._height / 2) { return true; } return false; } function difMapDrag(xDif, yDif) { if (Math.sqrt(xDif * xDif) > 100 or Math.sqrt(yDif * yDif) > 100) { MD.dragging = false; return true; } return false; } function checkCorner(cX, cY) { if (menuLayer.worldMap_fixed.worldMap.edges.hitTest(cX + MD.moveX, cY + MD.moveY, true)) { return true; } return false; } function showMap() { canToggleFullscreen = true; not3.enabled = false; not4.enabled = true; game.inWorldmap = true; player.deathInitiated = false; MD.showSign = false; MD.dragging = false; MD.moved = false; MD.canDrag = true; MD.ableToDrag = true; MD.fadeInMaps = true; WorldMapPlayerMoving = false; stopAllSounds(); _root.stopAllSounds(); MD.ableToDrag = true; MD.inWorldMap = true; menuLayer.menu_fixed.removeMovieClip(); menuLayer.attachMovie('worldMap_fixed', 'worldMap_fixed', 1); menuLayer.worldMap_fixed.worldMap.onRelease = function () { MD.dragging = false; if (!hideMapsFromScript) { showMaps(); } if (!MD.moved) { var v1 = 1; while (v1 <= 21) { if (mapPointClose(v1)) { prepareMap(v1); } ++v1; } } }; menuLayer.worldMap_fixed.worldMap.onReleaseOutside = function () { if (!hideMapsFromScript) { showMaps(); } MD.dragging = false; }; menuLayer.worldMap_fixed.worldMap.onPress = function () { if (MD.ableToDrag) { MD.dragging = true; interfaceLayer.gameCursor.mc.gotoAndStop('closed'); MD.moved = false; updateMousePos(); } }; updateMapSpecials(); menuLayer.worldMap_fixed.world_sign.name_txt._alpha = 0; showHelpTopic(); interfaceLayer.Encyclopedia.EncyclopediaCanShow = true; menuLayer.worldMap_fixed.t_all.gotoAndStop(1); if (MapsCleared[1]) { showTutorialGuide(15); } if (MapsCleared[8]) { showTutorialGuide(17); } } function StartMovePlayer() { if (MD.ableToDrag) { if (game.currentLevel > 6 and game.currentLevel < 21) { if (game.currentLevel > 17) { menuLayer.worldMap_fixed.worldMap._x = -menuLayer.worldMap_fixed.worldMap.mapPos4._x; menuLayer.worldMap_fixed.worldMap._y = -menuLayer.worldMap_fixed.worldMap.mapPos4._y; } else { if (game.currentLevel == 17) { menuLayer.worldMap_fixed.worldMap._x = -menuLayer.worldMap_fixed.worldMap.mapPos16._x; menuLayer.worldMap_fixed.worldMap._y = -menuLayer.worldMap_fixed.worldMap.mapPos16._y; } else { if (game.currentLevel > 14) { menuLayer.worldMap_fixed.worldMap._x = -menuLayer.worldMap_fixed.worldMap.mapPos3._x; menuLayer.worldMap_fixed.worldMap._y = -menuLayer.worldMap_fixed.worldMap.mapPos3._y; } else { if (game.currentLevel == 13) { menuLayer.worldMap_fixed.worldMap._x = -menuLayer.worldMap_fixed.worldMap.mapPos12._x; menuLayer.worldMap_fixed.worldMap._y = -menuLayer.worldMap_fixed.worldMap.mapPos12._y; } else { if (game.currentLevel > 9) { menuLayer.worldMap_fixed.worldMap._x = -menuLayer.worldMap_fixed.worldMap.mapPos2._x; menuLayer.worldMap_fixed.worldMap._y = -menuLayer.worldMap_fixed.worldMap.mapPos2._y; } else { menuLayer.worldMap_fixed.worldMap._x = -menuLayer.worldMap_fixed.worldMap.mapPos1._x; menuLayer.worldMap_fixed.worldMap._y = -menuLayer.worldMap_fixed.worldMap.mapPos1._y; } } } } } } else { menuLayer.worldMap_fixed.worldMap._x = 0; menuLayer.worldMap_fixed.worldMap._y = 0; } updateWorldmap(); } WorldMapPlayerMoving = true; } function mapDrag() { if (MD.showSign) { if (menuLayer.worldMap_fixed.world_sign._y < 0) { menuLayer.worldMap_fixed.world_sign._y += 1; } if (menuLayer.worldMap_fixed.world_sign._y < -10) { menuLayer.worldMap_fixed.world_sign._y += 1; menuLayer.worldMap_fixed.world_sign.name_txt.text = MapsName[game.currentLevel - 1]; menuLayer.worldMap_fixed.world_sign.name_txt._alpha = 100; } if (menuLayer.worldMap_fixed.world_sign._y < -30) { menuLayer.worldMap_fixed.world_sign._y += 1; } } if (WorldMapPlayerMoving) { var v4 = menuLayer.worldMap_fixed.worldMap['L' + WorldMapPlayerPath[0]]._x - menuLayer.worldMap_fixed.worldMap.playerWorldmap._x; var v3 = menuLayer.worldMap_fixed.worldMap['L' + WorldMapPlayerPath[0]]._y - menuLayer.worldMap_fixed.worldMap.playerWorldmap._y; var v6 = (v4 / Math.sqrt(v4 * v4 + v3 * v3)) * 5; var v5 = (v3 / Math.sqrt(v4 * v4 + v3 * v3)) * 5; menuLayer.worldMap_fixed.worldMap.playerWorldmap._x += v6; menuLayer.worldMap_fixed.worldMap.playerWorldmap._y += v5; if (MD.ableToDrag) { var v11 = menuLayer.worldMap_fixed.worldMap._x + (menuLayer.worldMap_fixed.worldMap.playerWorldmap._x - 320); var v12 = menuLayer.worldMap_fixed.worldMap._y + (menuLayer.worldMap_fixed.worldMap.playerWorldmap._y - 240); var v8 = Math.sqrt(v11 * v11); var v7 = Math.sqrt(v12 * v12); if (Math.sqrt(v8 * v8) <= 50) { menuLayer.worldMap_fixed.worldMap._x -= v6; } else { if (v8 > 50 and v6 > 0 or v4 < -50 and v6 < 0) { menuLayer.worldMap_fixed.worldMap._x -= v6 * 0.4; } else { if (v8 > 50 and v6 < 0 or v4 < -50 and v6 > 0) { menuLayer.worldMap_fixed.worldMap._x -= v6 * 2; } } } if (Math.sqrt(v7 * v7) <= 50) { menuLayer.worldMap_fixed.worldMap._y -= v5; } else { if (v7 > 50 and v5 > 0 or v3 < -50 and v5 < 0) { menuLayer.worldMap_fixed.worldMap._y -= v5 * 0.4; } else { if (v7 > 50 and v5 < 0 or v3 < -50 and v5 > 0) { menuLayer.worldMap_fixed.worldMap._y -= v5 * 2; } } } } if (Math.sqrt(v4 * v4 + v3 * v3) < 5) { if (MapsCleared[1] and !MapsCleared[2]) { menuLayer.worldMap_fixed.worldMap.tutorial._alpha = 100; menuLayer.worldMap_fixed.worldMap.tutorial.gotoAndStop(2); } game.currentLevel = WorldMapPlayerPath[0] + 1; if (WorldMapPlayerPath.length > 1) { WorldMapPlayerPath.shift(); } else { WorldMapPlayerMoving = false; } } } else { if (MD.fadeInMaps) { var v2 = 0; while (v2 <= 20) { if (MapsToFadeIn[v2]) { if (menuLayer.worldMap_fixed.worldMap['L' + v2]._alpha < 100) { menuLayer.worldMap_fixed.worldMap['L' + v2]._alpha += 4; } } ++v2; } } if (MD.dragging and MD.ableToDrag) { var v10 = (_root._xmouse - MD.mPosX) * -1; var v9 = (_root._ymouse - MD.mPosY) * -1; if (v10 != 0 or v9 != 0) { MD.moved = true; hideMaps(); hideMapsFromScript = false; MD.ableToDrag = true; } if (!difMapDrag(v10, v9)) { updateMousePos(); MD.moveX = v10; MD.moveY = v9; while (checkCorner(0, 0) or checkCorner(640, 0) or checkCorner(0, 480) or checkCorner(640, 480)) { if (checkCorner(-10, 0)) { MD.moveX += 1; } if (checkCorner(-10, 480)) { MD.moveX += 1; } if (checkCorner(650, 0)) { MD.moveX -= 1; } if (checkCorner(650, 480)) { MD.moveX -= 1; } if (checkCorner(0, -10)) { MD.moveY += 1; } if (checkCorner(640, -10)) { MD.moveY += 1; } if (checkCorner(0, 490)) { MD.moveY -= 1; } if (checkCorner(640, 490)) { MD.moveY -= 1; } } menuLayer.worldMap_fixed.worldMap._y -= MD.moveY; menuLayer.worldMap_fixed.worldMap._x -= MD.moveX; } } } updateWorldmap(); } function updateWorldmap() { MD.moveX = 0; MD.moveY = 0; while (checkCorner(0, 0) or checkCorner(640, 0) or checkCorner(0, 480) or checkCorner(640, 480)) { if (checkCorner(-10, 0)) { MD.moveX += 1; } if (checkCorner(-10, 480)) { MD.moveX += 1; } if (checkCorner(650, 0)) { MD.moveX -= 1; } if (checkCorner(650, 480)) { MD.moveX -= 1; } if (checkCorner(0, -10)) { MD.moveY += 1; } if (checkCorner(640, -10)) { MD.moveY += 1; } if (checkCorner(0, 490)) { MD.moveY -= 1; } if (checkCorner(640, 490)) { MD.moveY -= 1; } } menuLayer.worldMap_fixed.worldMap._y -= MD.moveY; menuLayer.worldMap_fixed.worldMap._x -= MD.moveX; } function arrowPhysic() { if (arrowCounter > 0) { var v1 = 1; while (v1 <= arrowCounter) { if (myObject['arrow' + v1].inGame) { arrowMovement(myObject['arrow' + v1]); if (myObject['arrow' + v1].velY > 80) { checkObInGame(myObject['arrow' + v1]); } } else { if (v1 == arrowCounter) { arrowCounter -= 1; } } ++v1; } } } function barrelPhysic() { if (circleCounter > 0) { var v1 = 1; while (v1 <= circleCounter) { if (myObject['circle' + v1].inGame) { if (myObject['circle' + v1].inGame and myObject['circle' + v1].inMove) { circleMovement(myObject['circle' + v1]); moveShadow(myObject['circle' + v1]); } if (myObject['circle' + v1].inMove) { if (Math.sqrt(myObject['circle' + v1].velY * myObject['circle' + v1].velY + myObject['circle' + v1].velX * myObject['circle' + v1].velX) > 4) { barrelImpact(myObject['circle' + v1]); } } if (myObject['circle' + v1].inMove) { checkObInGame(myObject['circle' + v1]); checkBarrelDeathPit(myObject['circle' + v1]); } else { if (!player.isHoldingBarrel and !theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(myObject['circle' + v1].posX + camPos.difX, myObject['circle' + v1].posY + camPos.difY + myObject['circle' + v1].radius * 1.3, true)) { if (TG.traceAction == 'barrelThrow') { fadeTutorialGuide(); } myObject['circle' + v1].velY = 0; myObject['circle' + v1].velX = 0; myObject['circle' + v1].inMove = true; } } } else { if (v1 == circleCounter) { myObject['circle' + v1].posX = -9999; myObject['circle' + v1].posY = -9999; myObject['circle' + v1].inGame = false; myObject['circle' + v1].inMove = false; myObject['circle' + v1].clip.removeMovieClip(); myObject['circle' + v1].shadowClip.removeMovieClip(); circleCounter -= 1; } else { myObject['circle' + v1].posX = -9999; myObject['circle' + v1].posY = -9999; myObject['circle' + v1].inMove = false; } } ++v1; } } } function showExplosiveBarrels() { if (circleCounter > 0) { var v1 = 1; while (v1 <= circleCounter) { if (myObject['circle' + v1].inGame and myObject['circle' + v1].explosive == 1) { changeColour(myObject['circle' + v1].clip, 100, 80, 80, 0, 0, 0); } ++v1; } } } function hideExplosiveBarrels() { if (circleCounter > 0) { var v1 = 1; while (v1 <= circleCounter) { if (myObject['circle' + v1].inGame) { changeColour(myObject['circle' + v1].clip, 100, 100, 100, 0, 0, 0); } ++v1; } } } function checkBarrelDeathPit(ob) { if (theWorld.backgroundNearLayer.currentLevel.deathpits.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) { ob.life = 0; damageOb(ob, 10); } } function checkObInGame(ob) { if (ob.velY > 40) { if (ob.isEnemy) { checkGameEventOnDeath(ob); } ob.posX = -9999; ob.posY = -9999; ob.inGame = false; ob.explosive = 0; ob.ID = 0; ob.clip._x = ob.posX; ob.clip._y = ob.posY; removeMovieClip(ob.clip); removeMovieClip(ob.shadowClip); } } function damageOb(ob, damage) { ob.life -= damage; if (ob.life <= 0 and ob.inGame) { var v3 = player.posX - ob.posX; var v2 = Math.sqrt(v3 * v3); if (v2 < 700) { var v8 = v3 / v2; var v7 = 100 - (v2 / 700) * 100; addSound('bustwood.wav', v7 * 0.4, -v8 * (v2 / 700) * 100, 0); addEffect('matchwood_l', ob.posX, ob.posY - 20, 0, 1, 1); addPart('barrel_part_', 5, ob.posX, ob.posY - 20, ob.velX, ob.velY - 4, false, true, 8, 5); } var v6 = false; var v5 = ob.posX; var v4 = ob.posY; if (ob.explosive == 1) { v6 = true; } else { if (v2 < 700 and ob.canSpawnSkeleton == true) { spawnBarrelSkeletonAt(v5, v4); } } ob.inGame = false; if (!myObject['circle' + player.isCarringBarrel].inGame and player.isCarringBarrel > 0) { dropBarrel(); } if (v6) { explosionAt(v5, v4); } ob.posX = -9999; ob.posY = -9999; ob.ID = 0; ob.clip._x = ob.posX; ob.clip._y = ob.posY; removeMovieClip(ob.shadowClip); removeMovieClip(ob.clip); } } function arrowMovement(ob) { var v7 = ob.posX; var v6 = ob.posY; ob.velY += game.gravity; var v4 = Math.sqrt(ob.velX * ob.velX + ob.velY * ob.velY); var v9 = false; if (ob.spec == 'molo') { ob.traceTimer -= 1; ob.clip.mc._rotation += ob.velX; if (ob.traceTimer <= 0) { ob.traceTimer = 3; addEffect('boss_witch_molotov_trace', ob.posX, ob.posY, 0, 2, 1); } } var v3 = 0; while (v3 <= v4) { ob.posX += (ob.velX / v4) * game.physicAccuracy; ob.posY += (ob.velY / v4) * game.physicAccuracy; if (theWorld.objectsLayerBarrels.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true) and ob.spec != 'molo') { ob.clip._rotation = Math.atan2(ob.posY - v6, ob.posX - v7) * 180 / Math.PI; v3 = v4; ob.inGame = false; var v2 = 1; while (v2 <= circleCounter) { if (myObject['circle' + v2].clip.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) { if (player.isCarringBarrel != v2) { myObject['circle' + v2].inMove = true; } myObject['circle' + v2].velX += ob.velX * 0.05; myObject['circle' + v2].velY += ob.velY * 0.05; myObject['circle' + v2].arrowCounter += 1; myObject['circle' + v2].clip.attachMovie('arrow', 'myArrow' + myObject['circle' + v2].arrowCounter, myObject['circle' + v2].arrowCounter); myObject['circle' + v2].clip['myArrow' + myObject['circle' + v2].arrowCounter]._rotation = ob.clip._rotation - myObject['circle' + v2].clip._rotation; myObject['circle' + v2].clip['myArrow' + myObject['circle' + v2].arrowCounter]._x -= Math.sin((myObject['circle' + v2].clip['myArrow' + myObject['circle' + v2].arrowCounter]._rotation + 90) * 0.0174532925199433) * 15; myObject['circle' + v2].clip['myArrow' + myObject['circle' + v2].arrowCounter]._y -= Math.cos((myObject['circle' + v2].clip['myArrow' + myObject['circle' + v2].arrowCounter]._rotation + 90) * 0.0174532925199433) * -15; myObject['circle' + v2].clip['myArrow' + myObject['circle' + v2].arrowCounter].gotoAndPlay(2); addEffect('matchwood', myObject['circle' + v2].posX, myObject['circle' + v2].posY - 20, 0, 1, 1); damageOb(myObject['circle' + v2], Math.sqrt(ob.velX * ob.velX + ob.velY * ob.velY) / 2); } ++v2; } ob.inGame = false; v3 = v4; removeMovieClip(ob.clip); } else { if (ob.spec != 'molo' and !player.isThrowingEnemy and player.holdingEnemy > 0 and myObject['enemy' + player.holdingEnemy].clip.hitBox.hitTest(ob.posX + camPos.difX, ob.posY - 30 + camPos.difY, true)) { addSound('hitFlesh_0' + Math.floor(Math.random() * 2 + 1) + '.wav', 40, 0, 0); if (!myObject['enemy' + player.holdingEnemy].isUNI) { myObject['enemy' + player.holdingEnemy].life = 0; } else { myObject['enemy' + player.holdingEnemy].life -= 5; } myObject['enemy' + player.holdingEnemy].clip.attachMovie('arrow', 'arrow_stuck', 2); myObject['enemy' + player.holdingEnemy].clip.arrow_stuck._rotation = ob.clip._rotation; myObject['enemy' + player.holdingEnemy].clip.arrow_stuck.gotoAndPlay(2); addEffect_Blood(myObject['enemy' + player.holdingEnemy].bloodType, myObject['enemy' + player.holdingEnemy].posX, myObject['enemy' + player.holdingEnemy].posY); myObject['enemy' + player.holdingEnemy].velX = 0; myObject['enemy' + player.holdingEnemy].velY = 0; dropEnemy(0, 0); ob.inGame = false; v3 = v4; removeMovieClip(ob.clip); } else { if (ob.spec != 'molo' and !player.immortal and theWorld.actorsLayer.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true) and ob.posY > player.posY - 50 and ob.posY < player.posY and Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)) < player.normalWidth / 2) { var v5 = false; myObject['circle' + player.isCarringBarrel].inMove = true; addSound('hitFlesh_0' + Math.floor(Math.random() * 2 + 1) + '.wav', 40, 0, 0); if (player.isJumping and Math.random() * 100 < 50) { if (ob.velX < 0) { player.dirX = 1; } else { player.dirX = -1; } startStaggerPlayer(Math.floor(Math.random() * 3 + 3)); } else { if (!player.isJumping) { startStaggerPlayer(Math.floor(Math.random() * 3 + 3)); } } if (player.staggerTimer > 0) { v5 = true; } updateHPRage(-ob.damage, 2); player.arrowCounter += 1; if (player.arrowCounter > 5) { player.arrowCounter = 1; } if (v5) { if (player.isFalling or !player.isKnockdowned) { if (ob.velX < 0) { player.dirX = 1; } else { player.dirX = -1; } player.velX = -player.dirX; } if (player.isFalling) { player.velX += ob.velX / 20; player.velY += ob.velY / 20; } player.clip._xscale = 100 * player.dirX; } if (ob.spec == 'molo') { setCameraShake(6, 6); if (Math.random() * 100 <= 50) { addEffect('boss_witch_molo_explosion', ob.posX, ob.posY, 0, 2, 1); } else { addEffect('boss_witch_molo_explosion', ob.posX, ob.posY, 0, 2, -1); } molotovExplo(ob); } else { player.clip.attachMovie('arrow', 'myArrow' + player.arrowCounter, player.arrowCounter); player.clip['myArrow' + player.arrowCounter]._rotation = ob.clip._rotation - player.clip._rotation; player.clip['myArrow' + player.arrowCounter]._x += 3; if (!player.isKnockdowned) { player.clip['myArrow' + player.arrowCounter]._y -= 30; } else { if (player.knockdownTimer > 0 and player.isKnockdowned and !player.isFalling) { player.clip['myArrow' + player.arrowCounter]._y -= 16; player.clip['myArrow' + player.arrowCounter]._x -= 7; } } player.clip['myArrow' + player.arrowCounter].gotoAndPlay(2); addEffect_Blood(player.bloodType, player.posX + player.clip['myArrow' + player.arrowCounter]._x, player.posY + player.clip['myArrow' + player.arrowCounter]._y); if (player.dirX == -1) { player.clip['myArrow' + player.arrowCounter]._rotation = 180 - player.clip['myArrow' + player.arrowCounter]._rotation; } } ob.inGame = false; v3 = v4; removeMovieClip(ob.clip); } } } if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) { if (ob.spec == 'molo') { setCameraShake(6, 6); if (Math.random() * 100 <= 50) { addEffect('boss_witch_molo_explosion', ob.posX, ob.posY, 0, 2, 1); } else { addEffect('boss_witch_molo_explosion', ob.posX, ob.posY, 0, 2, -1); } molotovExplo(ob); } ob.clip._rotation = Math.atan2(ob.posY - v6, ob.posX - v7) * 180 / Math.PI; v3 = v4; ob.inGame = false; ob.clip.gotoAndPlay(2); v9 = true; } v3 += 1 * game.physicAccuracy; } ob.clip._x = ob.posX; ob.clip._y = ob.posY; ob.clip._rotation = Math.atan2(ob.posY - v6, ob.posX - v7) * 180 / Math.PI; if (v9) { var v8 = 0; while (v8 <= 200 and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) { ob.posX -= ob.velX / Math.sqrt(ob.velX * ob.velX); ob.posY -= ob.velY / Math.sqrt(ob.velY * ob.velY); v8 += 1; } } if (ob.posX + 120 < camPos.minX or ob.posX - 120 > camPos.maxX) { ob.inGame = false; removeMovieClip(ob.clip); } if (ob.inGame) { moveShadow(ob); } else { removeMovieClip(ob.shadowClip); } } function getVel(ob) { var v2 = Math.sqrt(ob.velX * ob.velX + ob.velY * ob.velY); return v2; } function barrelImpact(ob) { var v3 = -23; if (player.isKnockdowned) { v3 = -5; } if (Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX) + (ob.posY - (player.posY + v3)) * (ob.posY - (player.posY + v3))) < 25) { var v4 = getVel(ob) * 8; ob.life -= v4; if (!player.immortal) { if (ob.velX < 0) { player.dirX = 1; } else { player.dirX = -1; } } if (ob.velY > 6) { if (!player.immortal) { if (player.isJumping) { startStaggerPlayer(getVel(ob) * 3); } else { startStunPlayer(getVel(ob) * 3); } } ob.life -= ob.life + 1; } else { if (getVel(ob) > 12 and !player.immortal) { startKnockdownPlayer(getVel(ob) * 2); } else { if (!player.immortal) { startStaggerPlayer(getVel(ob) * 2); } } } ob.velY = -2; ob.posX -= ob.velX * 0.5; ob.velX = -0.5; addEffect_impactSmoke(ob, player, -30); if (ob.life <= 0) { damageOb(ob, 10); } else { ob.velX *= -1; ob.velX += player.dirX; } } var v1 = 1; while (v1 <= enemyCounter) { if (!myObject['enemy' + v1].immortal and myObject['enemy' + v1].barrelImmune != 1 and myObject['enemy' + v1].life > 0 and myObject['enemy' + v1].inGame and myObject['enemy' + v1].currAttack != 'finishing') { if (player.holdingEnemy == myObject['enemy' + v1].ID) { v3 = 0; } else { if (myObject['enemy' + v1].knockdownTimer > 0 or myObject['enemy' + v1].pickedup) { v3 = -5; } else { v3 = myObject['enemy' + v1].HB_posY; } } if (Math.sqrt((ob.posX - myObject['enemy' + v1].posX) * (ob.posX - myObject['enemy' + v1].posX) + (ob.posY - (myObject['enemy' + v1].posY + v3)) * (ob.posY - (myObject['enemy' + v1].posY + v3))) < 35) { checkEnemiesEffectedByBarrelImpact(ob, myObject['enemy' + v1]); ob.posX -= ob.velX * 0.5; ob.velX *= 0.5; ob.velY = -2; addEffect_impactSmoke(ob, myObject['enemy' + v1], -30); if (ob.life <= 1) { damageOb(ob, 10); } else { ob.velX *= -1; ob.velX += myObject['enemy' + v1].dirX; } if (myObject['enemy' + v1].pickedup) { dropEnemy(0, 0); } } } ++v1; } } function checkEnemiesEffectedByBarrelImpact(ob, enemy) { if (enemyCounter > 0) { var v1 = 1; while (v1 <= enemyCounter) { if (myObject['enemy' + v1].inGame and myObject['enemy' + v1].barrelImmune != 1) { if (Math.sqrt((myObject['enemy' + v1].posX - enemy.posX) * (myObject['enemy' + v1].posX - enemy.posX) + (myObject['enemy' + v1].posY - enemy.posY) * (myObject['enemy' + v1].posY - enemy.posY)) < 30) { if (ob.velX < 0 and ob.posX > myObject['enemy' + v1].posX) { myObject['enemy' + v1].dirX = 1; } else { if (ob.velX > 0 and ob.posX < myObject['enemy' + v1].posX) { myObject['enemy' + v1].dirX = -1; } } myObject['enemy' + v1].life -= getVel(ob) * 2; myObject['enemy' + v1].attackTimer = 0; if (myObject['enemy' + v1].life <= 0) { ob.life = 1; } if (myObject['enemy' + v1].currAttack == 'jump') { startFlyingEnemy(myObject['enemy' + v1], ob.velX / 10, 0); ob.life = 1; } else { if (getVel(ob) > 5 and myObject['enemy' + v1].life > 0) { if (myObject['enemy' + v1].stunTimer <= 0) { myObject['enemy' + v1].stunTimer += 40 + getVel(ob) * 4; myObject['enemy' + v1].stunTimer *= (101 - myObject['enemy' + v1].UNI_stunR) / 100; myObject['enemy' + v1].velX = 0; ob.life = 1; } else { myObject['enemy' + v1].velY = 0; myObject['enemy' + v1].velX = 0; startFlyingEnemy(myObject['enemy' + v1], ob.velX / 5, -4); ob.life = 1; } } else { if (getVel(ob) > 12 or myObject['enemy' + v1].life <= 0) { if (myObject['enemy' + v1].isFalling) { startFlyingEnemy(myObject['enemy' + v1], ob.velX / 5, 0); } else { myObject['enemy' + v1].velY = 0; myObject['enemy' + v1].velX = 0; startFlyingEnemy(myObject['enemy' + v1], ob.velX / 5, -4); } addEffect_Blood(myObject['enemy' + v1].bloodType, myObject['enemy' + v1].posX, myObject['enemy' + v1].posY); ob.life = 1; if (ob.explosive == 1 and myObject['enemy' + v1].life <= 0) { gibEnemyYey(myObject['enemy' + v1]); } } else { myObject['enemy' + v1].staggerTimer += getVel(ob) * 2; myObject['enemy' + v1].staggerTimer *= (101 - myObject['enemy' + v1].UNI_staggerR) / 100; } } } myObject['enemy' + v1].clip._xscale = myObject['enemy' + v1].UNI_scale * myObject['enemy' + v1].dirX; } } ++v1; } } } function circleMovement(ob) { ob.oldX = ob.posX; ob.oldY = ob.posY; ob.velY += game.gravity; var v8 = 0; if (ob.velY > 0) { v8 = 0.1; } else { if (ob.velY < 0) { v8 = -0.1; } } ob.clip.filters = null; var v3 = game.physicAccuracy; var v12 = Math.sqrt(ob.velY * ob.velY); var v9 = 0; while (v9 <= v12) { ob.posY += v8 * v3; if (ob.velY < 0 and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY - ob.radius * 1.5, true)) { ob.velY *= -1; v8 *= -1; ob.posY -= v8 * v3; } if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) { var v2 = {'rSide': 0, 'lSide': 0}; var v4 = 0; while (v4 <= 500 and !theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX + 4, ob.posY + camPos.difY + v2.rSide, true)) { v2.rSide += 0.1 * v3; v4 += 1; } v4 = 0; while (v4 <= 500 and !theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX - 4, ob.posY + camPos.difY + v2.lSide, true)) { v2.lSide += 0.1 * v3; v4 += 1; } v4 = 0; while (v4 <= 500 and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + 4 + camPos.difX, ob.posY + camPos.difY + v2.rSide, true)) { v2.rSide -= 0.1 * v3; v4 += 1; } v4 = 0; while (v4 <= 500 and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX - 4 + camPos.difX, ob.posY + camPos.difY + v2.lSide, true)) { v2.lSide -= 0.1 * v3; v4 += 1; } v8 *= -1; if (Math.sqrt(ob.velY * ob.velY) >= 4) { ob.velX *= 0.5; addEffect_landSmoke(ob); damageOb(ob, Math.sqrt(ob.velY * ob.velY)); } if ((ob.clip._rotation > 45 or ob.clip._rotation < -45 or Math.sqrt(ob.velX * ob.velX + ob.velY * ob.velY) > 6) and ob.clip._currentFrame == 1) { ob.clip.gotoAndStop(2); addBlur(ob.clip, Math.sqrt(ob.velX * ob.velX) * 3, Math.sqrt(ob.velY * ob.velY) * 3); } ob.velY *= -ob.bounceForce; ob.tiltDiff = v2.rSide - v2.lSide; var v11 = Math.sqrt((v2.rSide - v2.lSide) * (v2.rSide - v2.lSide)); if (Math.sqrt(ob.velY * ob.velY) <= game.gravity) { ob.velY = 0; var v6 = (v2.rSide - v2.lSide) * 0.1; if (v11 < tiltDifForce) { ob.velX += v6 * (1.6 - ob.frictionForce / 4); if (v6 < 0 and ob.velX < 0 or v6 > 0 and ob.velX > 0) { ob.velX += v6 * (0.3 + ob.frictionForce / 3); } } } else { if (v11 < tiltDifForce) { ob.velX += (v2.rSide - v2.lSide) * 0.5; } } ob.posY += ob.velY; while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) { ob.posY -= 0.1; } } v9 += 0.1 * v3; } var v10 = 0; if (ob.velX > 0) { v10 = 0.1; } else { if (ob.velX < 0) { v10 = -0.1; } } ob.clip._rotation += ob.velX * 4; v12 = Math.sqrt(ob.velX * ob.velX); v9 = 0; while (v9 <= v12) { ob.posX += v10 * v3; if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX + ob.radius, ob.posY + camPos.difY - ob.radius * 1.5, true) or theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX - ob.radius, ob.posY + camPos.difY - ob.radius * 1.5, true)) { while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX + ob.radius, ob.posY + camPos.difY - ob.radius * 1.5, true)) { ob.posX -= 1; } while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX - ob.radius, ob.posY + camPos.difY - ob.radius * 1.5, true)) { ob.posX += 1; } addEffect('impact_smoke', ob.posX + v10 * ob.radius, ob.posY - ob.radius, 0, 2, 1); v10 *= -1; ob.velX *= -0.2; damageOb(ob, Math.sqrt(ob.velX * ob.velX)); if (ob.velY == 0) { ob.velY = -Math.sqrt(ob.velX * ob.velX) / 2; } } else { if (ob.velY == 0) { v2 = {'rSide': 0, 'lSide': 0}; v4 = 0; while (v4 <= 500 and !theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX + 4, ob.posY + camPos.difY + v2.rSide, true)) { v2.rSide += 0.1 * v3; v4 += 1; } v4 = 0; while (v4 <= 500 and !theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX - 4, ob.posY + camPos.difY + v2.lSide, true)) { v2.lSide += 0.1 * v3; v4 += 1; } v4 = 0; while (v4 <= 500 and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX + 4, ob.posY + camPos.difY + v2.rSide, true)) { v2.rSide -= 0.1 * v3; v4 += 1; } v4 = 0; while (v4 <= 500 and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX - 4, ob.posY + camPos.difY + v2.lSide, true)) { v2.lSide -= 0.1 * v3; v4 += 1; } ob.tiltDiff = v2.rSide - v2.lSide; v11 = Math.sqrt((v2.rSide - v2.lSide) * (v2.rSide - v2.lSide)); if (v11 < tiltDifForce) { var v7 = ob.posY; while (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) { ob.posY += 0.1; } while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) { ob.posY -= 0.1; } if (Math.sqrt((ob.posY - v7) * (ob.posY - v7)) > 20) { ob.posY = v7; } else { if (v2.rSide == v2.lSide and ob.velX == 0 and ob.velY == 0) { ob.inMove = false; ob.velY = 0; ob.velX = 0; if (ob.clip._currentFrame == 1) { ob.clip._rotation = 0; } } } } else { if (ob.velX == 0) { ob.velX = Math.random() * 2 - 1; } ob.velY -= 1; } } } v9 += 0.1 * v3; } if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY + 0.2, true)) { if (ob.velX > 0) { ob.velX -= ob.frictionForce; } else { if (ob.velX < 0) { ob.velX += ob.frictionForce; } } if (Math.sqrt(ob.velX * ob.velX) <= ob.frictionForce) { ob.velX = 0; } } while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX + (ob.radius + 4), ob.posY + camPos.difY - ob.radius, true)) { ob.posX -= 1; if (ob.velX > 0) { ob.velX = 0; } } while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX - (ob.radius + 4), ob.posY + camPos.difY - ob.radius, true)) { ob.posX += 1; if (ob.velX < 0) { ob.velX = 0; } } groundCollision(ob); var v5 = 1; while (v5 <= circleCounter) { if (Math.sqrt((myObject['circle' + v5].posX - ob.posX) * (myObject['circle' + v5].posX - ob.posX) + (myObject['circle' + v5].posY - ob.posY) * (myObject['circle' + v5].posY - ob.posY)) < ob.radius + myObject['circle' + v5].radius and myObject['circle' + v5].ID != ob.ID) { if (v5 == player.isCarringBarrel) { if (!player.barrelThrowed) { dropBarrel(); } else { barrelThrowFinished(); } } circleCollision(ob, myObject['circle' + v5]); } ++v5; } ob.clip._x = ob.posX; ob.clip._y = ob.posY - ob.radius; if ((ob.clip._rotation > 45 or ob.clip._rotation < -45) and ob.clip._currentFrame == 1) { ob.clip.gotoAndStop(2); addBlur(ob.clip, Math.sqrt(ob.velX * ob.velX) * 3, Math.sqrt(ob.velY * ob.velY) * 3); } } function circleCollision(ob, obCol) { var v7 = Math.sqrt(ob.velX * ob.velX + ob.velY * ob.velY) + Math.sqrt(obCol.velX * obCol.velX + obCol.velY * obCol.velY); var v14 = Math.atan2(ob.posY - obCol.posY, ob.posX - obCol.posX) * 180 / Math.PI; var v6 = Math.cos(v14 * Math.PI / 180); var v5 = Math.sin(v14 * Math.PI / 180); while (Math.sqrt((ob.posX - obCol.posX) * (ob.posX - obCol.posX) + (ob.posY - obCol.posY) * (ob.posY - obCol.posY)) <= ob.radius * 2) { ob.posX += v6; ob.posY += v5; } ob.posX += v6; ob.posY += v5; var v10 = ob.posX - obCol.posX; var v9 = ob.posY - obCol.posY; var v13 = Math.sqrt(v10 * v10 + v9 * v9); var v4 = v10 / v13; var v3 = v9 / v13; var v12 = ob.velX * v4 + ob.velY * v3; var v16 = -ob.velX * v3 + ob.velY * v4; var v11 = obCol.velX * v4 + obCol.velY * v3; var v15 = -obCol.velX * v3 + obCol.velY * v4; var v8 = 1; var v19 = 1; var v18 = v12 + (1 + v19) * (v11 - v12) / (1 + v8 / v8); var v17 = v11 + (1 + v19) * (v12 - v11) / (1 + v8 / v8); ob.velX = v18 * v4 - v16 * v3; ob.velY = v18 * v3 + v16 * v4 - game.gravity; obCol.velX = v17 * v4 - v15 * v3; obCol.velY = v17 * v3 + v15 * v4 - game.gravity; ob.inMove = true; obCol.inMove = true; obCol.clip._rotation += obCol.velX * 4; ob.clip._rotation += ob.velX * 4; while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) { ob.posY -= 1; if (ob.velY > 0) { ob.velY = 0; } } if (v7 > 5) { addEffect_impactSmoke(ob, obCol, -20); } if (v7 > 0) { damageOb(ob, v7 / 2); damageOb(obCol, v7 / 2); } } function groundCollision(ob) { var v5 = 0; var v4 = 0; var v3 = 0; var v2 = 0; var v7 = 0; while (v7 <= 360) { v3 = Math.sin(v7 * 0.0174532925199433); v2 = Math.cos(v7 * 0.0174532925199433) * -1; v5 = ob.posX; v4 = ob.posY; v5 += v3 * ob.radius * 0.8; v4 += v2 * ob.radius * 0.8 - ob.radius; if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(v5 + camPos.difX, v4 + camPos.difY, true)) { var v6 = 0; while (v6 <= 30 and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(v5 + camPos.difX, v4 + camPos.difY, true)) { v5 -= v3; v4 -= v2; ob.clip._rotation += ob.velX * 4; ob.velX -= v3; ob.velY -= v2; ob.posX -= v3; ob.posY -= v2; v6 += 1; } if (v6 >= 30) { textMessage('Error:Physics:groundCollision failed'); } } v7 += game.physicAccuracy * 4; } } function addEffect_knockdownSmoke(ob) { var v2 = getGroundType(ob.posX, ob.posY); if (v2 == 'water') { var v3 = 'knockdown_water'; } else { if (v2 == 'snow') { var v3 = 'knockdown_snow'; addSound('snow_01.wav', 250, 0, 0); } else { var v3 = 'knockdown_dirt'; } } addEffect(v3, ob.posX, ob.posY, 0, 2, 1); } function addEffect_landSmoke(ob) { var v2 = getGroundType(ob.posX, ob.posY); if (v2 == 'water') { var v3 = 'land_water'; } else { if (v2 == 'snow') { var v3 = 'land_snow'; } else { var v3 = 'land_dirt'; } } addEffect(v3, ob.posX, ob.posY, 0, 2, 1); } function addEffect_jumpSmoke(ob) { var v2 = getGroundType(ob.posX, ob.posY); if (v2 == 'water') { var v3 = 'jump_water'; } else { if (v2 == 'snow') { var v3 = 'jump_snow'; } else { var v3 = 'jump_dirt'; } } addEffect(v3, ob.posX, ob.posY, 0, 2, ob.dirX); } function addEffect_Blood(effectType, posX, posY) { addEffect(effectType + '0' + Math.floor(Math.random() * 3 + 1), posX, posY, 0, 2, 1); if (effectType == 'blood_s_') { addBloodstain(posX, posY); } } function addEffect_impactSmoke(ob1, ob2, diffY) { var v3 = ob2.posX + (ob1.posX - ob2.posX) / 2; var v2 = ob2.posY + diffY + (ob1.posY - ob2.posY) / 2; addEffect('impact_smoke', v3, v2, 0, 2, 1); } function addEffect_sparks(ob) { addEffect(['sparks_0' + Math.floor(Math.random() * 3 + 1)], ob.posX + 15 * ob.dirX, ob.posY - 35, 0, 3, 1); } function addFlyingHead(ob, power) { addBloodstain(ob.posX, ob.posY - 20); setScaleObTo(ob); if (power == 2) { addPart(ob.headDropType, 1, ob.posX, ob.posY - 35, player.dirX * 4, -7, true, false, 1, 2); } else { addPart(ob.headDropType, 1, ob.posX, ob.posY - 35, player.dirX * 3, -5.5, true, false, 1, 2); } } function addFlyingArm(ob) { addBloodstain(ob.posX, ob.posY - 20); setScaleObTo(ob); addPart(ob.armDropType, 1, ob.posX, ob.posY - 28, player.dirX * 3, -5.5, true, false, 1, 2); } function setScaleObTo(ob) { scaleOb.R1 = ob.RGB_R1; scaleOb.G1 = ob.RGB_G1; scaleOb.B1 = ob.RGB_B1; scaleOb.uni_scale = ob.UNI_scale; } function resetScaleOb() { scaleOb.R1 = 100; scaleOb.G1 = 100; scaleOb.B1 = 100; scaleOb.uni_scale = 100; } function addPart(type, counts, posX, posY, xForce, yForce, bloodstain, airTrail, power, blurTimer) { var v3 = 1; while (v3 <= counts) { var v1 = findEmptyObject('part', 'partCounter'); myObject['part' + v1] = new myObject.emptyPart(); if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(posX, posY, true)) { posY -= 5; } myObject['part' + v1].posX = posX; myObject['part' + v1].posY = posY; var v4 = Math.random() * (power - 1) + 1; var v5 = Math.random() * 360; myObject['part' + v1].velX = Math.sin(v5 * 0.0174532925199433) * v4 + xForce; myObject['part' + v1].velY = Math.cos(v5 * 0.0174532925199433) * v4 * -1 + yForce; staticEffectsCounterParts += 1; if (staticEffectsCounterParts > options.partParticles and options.partParticles > 0) { staticEffectsCounterParts = 1; } if (type == 'head_swordorc' or type == 'head_spearorc' or type == 'head_boworc' or type == 'arm_swordorc' or type == 'arm_chaosKnight' or type == 'princess_head') { theWorld.partFlyingLayer.attachMovie(type + '0' + v3, 'part_' + staticEffectsCounterParts, staticEffectsCounterParts); myObject['part' + v1].clip = theWorld.partFlyingLayer['part_' + staticEffectsCounterParts]; } else { theWorld.staticEffectsLayerParts.attachMovie(type + '0' + v3, 'part_' + staticEffectsCounterParts, staticEffectsCounterParts); myObject['part' + v1].clip = theWorld.staticEffectsLayerParts['part_' + staticEffectsCounterParts]; } changeColour(myObject['part' + v1].clip, scaleOb.R1, scaleOb.G1, scaleOb.B1, 0, 0, 0); myObject['part' + v1].clip._x = myObject['part' + v1].posX; myObject['part' + v1].clip._y = myObject['part' + v1].posY; myObject['part' + v1].clip._alpha = 100; myObject['part' + v1].clip._xscale = scaleOb.uni_scale; myObject['part' + v1].clip._yscale = scaleOb.uni_scale; myObject['part' + v1].bloodstain = bloodstain; myObject['part' + v1].airTrail = airTrail; myObject['part' + v1].blurTimer = blurTimer; myObject['part' + v1].clip._rotation = Math.random() * 360; if (myObject['part' + v1].blurTimer > 0) { addBlur(myObject['part' + v1].clip, 5, 5); } ++v3; } resetScaleOb(); } function trackParts() { if (partCounter > 0) { var v1 = 1; while (v1 <= partCounter) { if (myObject['part' + v1].inGame) { if (myObject['part' + v1].airTrail) { myObject['part' + v1].airTrailTimer -= 1; if (myObject['part' + v1].airTrailTimer <= 0) { addEffect(['barrel_part_trail_0' + Math.floor(Math.random() * 3 + 1)], myObject['part' + v1].posX, myObject['part' + v1].posY, Math.random() * 360, 2, 1); myObject['part' + v1].airTrailTimer = 8; } } if (myObject['part' + v1].blurTimer > 0) { myObject['part' + v1].blurTimer -= 1; if (myObject['part' + v1].blurTimer <= 0) { myObject['part' + v1].clip.filters = null; } } myObject['part' + v1].velY += game.gravity; myObject['part' + v1].posX += myObject['part' + v1].velX; myObject['part' + v1].clip._rotation += myObject['part' + v1].velX * 4; if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(myObject['part' + v1].posX + camPos.difX, myObject['part' + v1].posY + camPos.difY, true)) { myObject['part' + v1].posX -= myObject['part' + v1].velX * 1.1; myObject['part' + v1].velX *= -0.8; } if (myObject['part' + v1].velY < 0 and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(myObject['part' + v1].posX + camPos.difX, myObject['part' + v1].posY + camPos.difY + myObject['part' + v1].velY, true)) { myObject['part' + v1].velY = 0; } else { myObject['part' + v1].posY += myObject['part' + v1].velY; if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(myObject['part' + v1].posX + camPos.difX, myObject['part' + v1].posY + camPos.difY, true)) { while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(myObject['part' + v1].posX + camPos.difX, myObject['part' + v1].posY + camPos.difY, true)) { myObject['part' + v1].posY -= 2; } myObject['part' + v1].velY *= -0.4; myObject['part' + v1].velX *= 0.5; myObject['part' + v1].clip._rotation += myObject['part' + v1].velX * 3; if (Math.sqrt(myObject['part' + v1].velY * myObject['part' + v1].velY) + Math.sqrt(myObject['part' + v1].velX * myObject['part' + v1].velX) < 2) { myObject['part' + v1].inGame = false; myObject['part' + v1].clip.filters = null; } else { if (myObject['part' + v1].bloodstain and myObject['part' + v1].velY < 0) { addBloodstain(myObject['part' + v1].posX, myObject['part' + v1].posY - 6); } } } myObject['part' + v1].clip._x = myObject['part' + v1].posX; myObject['part' + v1].clip._y = myObject['part' + v1].posY; } checkObInGame(myObject['part' + v1]); } else { if (v1 == partCounter) { partCounter -= 1; } } ++v1; } } } function addBloodstain(posX, posY) { var v3 = Math.floor(Math.random() * 3 + 4); var v2 = 1; while (v2 <= v3) { var v1 = findEmptyObject('blood', 'bloodstainCounter'); myObject['blood' + v1] = new myObject.emptyBlood(); myObject['blood' + v1].posX = posX; myObject['blood' + v1].posY = posY; myObject['blood' + v1].velX = Math.sin(Math.random() * 360 * 0.0174532925199433) * 2; myObject['blood' + v1].velY = Math.cos(Math.random() * 360 * 0.0174532925199433) * 2 * -1; myObject['blood' + v1].velY += 1; ++v2; } } function trackBloodstain() { var v1 = 1; while (v1 <= bloodstainCounter) { if (myObject['blood' + v1].inGame) { if (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(myObject['blood' + v1].posX + myObject['blood' + v1].velX + camPos.difX, myObject['blood' + v1].posY + camPos.difY, true)) { myObject['blood' + v1].posX += myObject['blood' + v1].velX; } else { myObject['blood' + v1].velX *= -1; myObject['blood' + v1].posX += myObject['blood' + v1].velX; } myObject['blood' + v1].velY += game.gravity; if (myObject['blood' + v1].velY < 0) { if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(myObject['blood' + v1].posX + camPos.difX, myObject['blood' + v1].posY + myObject['blood' + v1].velY + camPos.difY, true)) { myObject['blood' + v1].velY *= -1; } } else { myObject['blood' + v1].posY += myObject['blood' + v1].velY; if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(myObject['blood' + v1].posX + camPos.difX, myObject['blood' + v1].posY + camPos.difY, true)) { while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(myObject['blood' + v1].posX + camPos.difX, myObject['blood' + v1].posY + camPos.difY, true)) { myObject['blood' + v1].posY -= 3; } myObject['blood' + v1].posY += Math.random() * 6; myObject['blood' + v1].inGame = false; staticEffectsCounter += 1; if (staticEffectsCounter > options.bloodParticles and options.bloodParticles > 0) { staticEffectsCounter = 1; } var v2 = getGroundType(myObject['blood' + v1].posX, myObject['blood' + v1].posY); if (v2 == 'water') { var v3 = 'bloodstain_water_0'; } else { var v3 = 'bloodstain_0'; } theWorld.staticEffectsLayer.attachMovie(v3 + '' + Math.floor(Math.random() * 3 + 1), ['bloodstain_' + staticEffectsCounter], staticEffectsCounter); theWorld.staticEffectsLayer['bloodstain_' + staticEffectsCounter]._x = myObject['blood' + v1].posX; theWorld.staticEffectsLayer['bloodstain_' + staticEffectsCounter]._y = myObject['blood' + v1].posY; } } checkObInGame(myObject['blood' + v1]); } else { if (v1 == bloodstainCounter) { bloodstainCounter -= 1; } } ++v1; } } function getGroundType(posX, posY) { if (theWorld.backgroundNearLayer.currentLevel.water.hitTest(posX + camPos.difX, posY + camPos.difY, true)) { return 'water'; } if (theWorld.backgroundNearLayer.currentLevel.snow.hitTest(posX + camPos.difX, posY + camPos.difY, true)) { return 'snow'; } return 'default'; } function addEffect(effectType, posX, posY, effectRotation, effectBlur, dirX) { effectCounter += 1; if (effectCounter > 125) { effectCounter = 1; } theWorld.effectsLayer.attachMovie(effectType, ['effect_nr' + effectCounter], effectCounter); theWorld.effectsLayer['effect_nr' + effectCounter]._x = posX; theWorld.effectsLayer['effect_nr' + effectCounter]._y = posY; theWorld.effectsLayer['effect_nr' + effectCounter]._rotation = effectRotation; theWorld.effectsLayer['effect_nr' + effectCounter]._xscale = dirX * 100; if (effectBlur > 0) { addBlur(theWorld.effectsLayer['effect_nr' + effectCounter], effectBlur, effectBlur); } } function fixShadow(ob) { ob.shadowClip._x = ob.posX; ob.shadowClip._y = ob.posY; } function scaleShadow(ob) { ob.shadowClip._xscale = (100 - ((ob.shadowClip._y - ob.clip._y) / 3) * 2) * (ob.shadowScale / 100); if (ob.shadowClip._xscale < 0) { ob.shadowClip._xscale = 0; } ob.shadowClip._yscale = ob.shadowClip._xscale; ob.shadowClip._alpha = 100 - ((ob.shadowClip._y - ob.clip._y) / 3) * 2; } function moveShadow(ob) { ob.shadowClip._x = ob.posX; var v2 = 0; ob.shadowClip._y = ob.posY - 4; while (v2 <= 150 and !theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.shadowClip._y + camPos.difY, true)) { ob.shadowClip._y += 10; v2 += 10; } v2 = 0; while (v2 <= 20 and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.shadowClip._y + camPos.difY, true)) { ob.shadowClip._y -= 1; v2 += 1; } v2 = 0; while (v2 <= 10 and !theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.shadowClip._y + camPos.difY, true)) { ob.shadowClip._y += 0.1; v2 += 1; } scaleShadow(ob); } function addShadow(ob) { game.shadows += 1; theWorld.shadowLayer.attachMovie('actor_shadow', ['shadow_' + game.shadows], game.shadows); ob.shadowClip = theWorld.shadowLayer['shadow_' + game.shadows]; ob.shadowClip._x = ob.posX; ob.shadowClip._y = ob.posY; ob.shadowClip._xscale = ob.shadowScale; ob.shadowClip._yscale = ob.shadowScale; } function addStepSound() { step += 1; if (step > 2) { step = 1; } var v1 = getGroundType(player.posX, player.posY); if (v1 == 'water') { var v2 = 'mud_0' + step + '.wav'; var v3 = 175; } else { if (v1 == 'snow') { var v2 = 'snow_0' + step + '.wav'; var v3 = 60; } else { var v2 = 'dirt_0' + step + '.wav'; var v3 = 15; } } addSound(v2, v3, 0, 0); } function addBtnSound() { addSound('a_menu_click.wav', 100, 0, 0); } function addSound(soundID, volumeID, panID, offsetID) { soundCounter += 1; if (soundCounter > 100) { soundCounter = 1; } var v1 = new Sound('mySound_' + soundCounter); v1.setVolume(volumeID); v1.setPan(panID); v1.attachSound(soundID); v1.start(offsetID); } function addBlur(ob, xValue, yValue) { if (options.blurEffects) { var v2 = new flash.filters.BlurFilter(xValue, yValue, 1); var v1 = ob.filters; v1.push(v2); ob.filters = v1; } } function changeColour(ob, rm, gm, bm, ro, go, bo) { var v2 = new flash.geom.Transform(ob); var v1 = v2.colorTransform; v1.redMultiplier = rm / 100; v1.greenMultiplier = gm / 100; v1.blueMultiplier = bm / 100; v1.redOffset = ro; v1.greenOffset = go; v1.blueOffset = bo; v2.colorTransform = v1; } function setSaturation(object, amount) { var v3 = new flash.filters.ColorMatrixFilter(); var v6 = [1, 0, 0, 0, 0]; var v7 = [0, 1, 0, 0, 0]; var v5 = [0, 0, 1, 0, 0]; var v4 = [0, 0, 0, 1, 0]; var v2 = [0.3, 0.59, 0.11, 0, 0]; var v1 = new Array(); v1 = v1.concat(interpolateArrays(v2, v6, amount)); v1 = v1.concat(interpolateArrays(v2, v7, amount)); v1 = v1.concat(interpolateArrays(v2, v5, amount)); v1 = v1.concat(v4); v3.matrix = v1; object.filters = [v3]; } function interpolateArrays(ary1, ary2, t) { var v3 = ary1.length >= ary2.length ? ary1.slice() : ary2.slice(); var v1 = v3.length; while (v1--) { v3[v1] = ary1[v1] + (ary2[v1] - ary1[v1]) * t; } return v3; } function setMinCamPos(myPoint) { if (myPoint._x == undefined) { trace('Error:Camera:MinValue is undefined, _parent/this problem'); } else { camPos.minX = myPoint._x; if (camPos.maxX - camPos.minX < 640) { trace('Error:Camera:MaxValue and MinValue are too near! Autofixing this problem'); camPos.minX = camPos.maxX - 640; } } } function setMaxCamPos(myPoint) { if (myPoint._x == undefined) { trace('Error:Camera:MaxValue is undefined, _parent/this problem'); } else { camPos.maxX = myPoint._x; if (camPos.maxX - camPos.minX < 640) { trace('Error:Camera:MaxValue and MinValue are too near! Autofixing this problem'); camPos.maxX = camPos.minX + 640; } } } function cameraStatic() { if (!game.lockCam) { if (player.posX + 320 < camPos.maxX and player.posX - 320 > camPos.minX) { game.stopCam = 0; var v1 = camPos.virDifX - camPos.difX; var v2 = camPos.virDifY - camPos.difY; if (Math.sqrt(v1 * v1) > 10) { camPos.difX += (v1 / Math.sqrt(v1 * v1)) * 10; } else { camPos.difX = camPos.virDifX; } camPos.difY = camPos.virDifY; } } } function setCameraShake(time, power) { if (game.camShakeTimer > 0) { if (game.camShakeTimer < time) { game.camShakeTimer = time; } if (game.camShakePower < power) { game.camShakePower = power; } } else { game.camShakePower = power; game.camShakeTimer = time; } } function cameraShake() { if (game.camShakeTimer > 0) { game.camShakeTimer = countToNumber(game.camShakeTimer, 0, 1); game.rootRotation = countToNumber(game.rootRotation, game.camShakePower - Math.random() * (game.camShakePower * 2), Math.random() * game.camShakePower); } } function cameraMovement(zoom) { if (!game.lockCam) { if (!options.zoomEffects) { zoom = 100; game.rootZoom = 100; } _root._xscale = zoom; _root._yscale = zoom; var v4 = 1 / (zoom / 100); interfaceLayer._xscale = v4 * 100; interfaceLayer._yscale = v4 * 100; var v10 = +(320 - 320 * (zoom / 100)); var v9 = +(240 - 240 * (zoom / 100)); _root._x = v10; _root._y = v9; interfaceLayer._x = -v10 * v4; interfaceLayer._y = -v9 * v4; game.rootRotation = countToNumber(game.rootRotation, 0, 0.1); cameraShake(); if (game.rootRotation != 0 and options.rotationEffects) { var v8 = -143.130102354156; var v5 = v8 + game.rootRotation + 90; var v2 = 400 * (zoom / 100); var v7 = Math.sin(v5 * 0.0174532925199433) * v2; var v6 = Math.cos(v5 * 0.0174532925199433) * v2 * -1; _root._x = 320 + v7; _root._y = 240 + v6; _root._rotation = game.rootRotation; v5 = v8 - game.rootRotation - 90; v2 = 400 * v4; v7 = Math.sin(v5 * 0.0174532925199433) * v2; v6 = Math.cos(v5 * 0.0174532925199433) * v2 * -1; interfaceLayer._x = 320 - v7; interfaceLayer._y = 240 - v6; interfaceLayer._rotation = -_root._rotation; screenSizeRoot._x = interfaceLayer._x; screenSizeRoot._y = interfaceLayer._y; screenSizeRoot._rotation = interfaceLayer._rotation; } else { if (_root._rotation != 0) { _root._rotation = 0; interfaceLayer._rotation = 0; screenSizeRoot._rotation = 0; } } cameraCollision(); if (Math.sqrt((theWorld._x - camPos.difX) * (theWorld._x - camPos.difX)) >= 1) { theWorld._x = camPos.difX; } theWorld.backgroundNearLayer.currentLevel.bg_far._x = bgFar.posX + (camPos.difX * -1 + 320 - bgFar.posX) / 2; if (Math.sqrt((theWorld._y - camPos.difY) * (theWorld._y - camPos.difY)) >= 1) { theWorld._y = camPos.difY; } theWorld.backgroundNearLayer.currentLevel.bg_far._y = bgFar.posY + (camPos.difY * -1 + 240 - bgFar.posY); } } function cameraCollision() { if (camPos.difX * -1 < camPos.minX) { game.stopCam = -1; camPos.difX = camPos.minX * -1; } else { if ((camPos.difX - 640) * -1 > camPos.maxX) { game.stopCam = 1; camPos.difX = camPos.maxX * -1 + 640; } } if (game.rootZoom > 100 and game.stopCam != 0) { var v1 = (1 / (game.rootZoom / 100)) * 640; var v3 = 640 - v1; if (game.stopCam < 0) { var v2 = player.posX * -1 - camPos.difX; } else { var v2 = camPos.difX - player.posX * -1 - 640; } camPos.difX -= (v3 / 2) * game.stopCam; if (game.stopCam < 0 and v1 / 2 < v2 * -1) { camPos.difX += (v2 * -1 - v1 / 2) * -1; } else { if (v1 / 2 < v2 * -1) { camPos.difX += v2 * -1 - v1 / 2; } } } } function traceKeys() { if (player.holdingEnemy == 0 and !player.isPreparingJump and player.currentAttack == 0 and !player.uncontrollable) { if (key.rightPressed and !key.leftPressed) { if (player.velX < 0) { player.velX = 0; } player.velX = countToNumber(player.velX, 5, 2); } else { if (!key.rightPressed and key.leftPressed) { if (player.velX > 0) { player.velX = 0; } player.velX = countToNumber(player.velX, -5, 2); } else { player.velX = 0; if (player.isCarringBarrel == 0) { player.clip.gotoAndStop('idle'); } } } } if (key.spacePressed) { key.spacePower += 1; } if (player.contesting == 0 and player.staggerTimer <= 0 and !player.isKnockdowned) { if (!player.isThrowingEnemy and !traceKeysPressed.spacePressed and player.holdingEnemy > 0 and !player.doingHeadKnock) { if (checkRightPress()) { player.dirX = 1; player.clip._xscale = 100 * player.dirX; turnEnemy(); } else { if (checkLeftPress()) { player.dirX = -1; player.clip._xscale = 100 * player.dirX; turnEnemy(); } } } else { if (checkIdlePlayer()) { if (checkRightPress()) { key.rightPressed = true; } else { if (checkLeftPress()) { key.leftPressed = true; } } } else { if (player.isHoldingBarrel and !player.isThrowingBarrel and !player.isThrowingEnemy) { if (checkRightPress()) { player.dirX = 1; player.clip._xscale = 100 * player.dirX; pickupBarrel(); } else { if (checkLeftPress()) { player.dirX = -1; player.clip._xscale = 100 * player.dirX; pickupBarrel(); } } } else { if (!player.nextAttackPossible and player.performNextAttack) { if (checkRightPress()) { player.dirX = 1; } else { if (checkLeftPress()) { player.dirX = -1; } } player.clip._xscale = 100 * player.dirX; } } } } } } function startPlayerJump() { if (enemyCounter > 0) { var v3 = new Array(); var v1 = 1; while (v1 <= enemyCounter) { if (myObject['enemy' + v1].inGame and myObject['enemy' + v1].immortal != true and myObject['enemy' + v1].knockdownTimer <= 0 and myObject['enemy' + v1].staggerTimer <= 0 and myObject['enemy' + v1].stunTimer <= 0 and myObject['enemy' + v1].enemyType != 'Crow' and myObject['enemy' + v1].enemyType != 'BOSS') { var v5 = player.posX - myObject['enemy' + v1].posX; var v7 = Math.sqrt(v5 * v5); if (v7 < 40) { var v4 = player.posY - myObject['enemy' + v1].posY; var v6 = Math.sqrt(v4 * v4); if (v6 < 20) { v3.push(v1); } } } ++v1; } if (v3.length >= 1) { var v2 = 0; while (v2 < v3.length) { facePlayer(myObject['enemy' + v3[v2]]); myObject['enemy' + v3[v2]].staggerTimer = 12; ++v2; } } } if (checkRightPress() and player.dirX == 1) { player.velX = 3.5; } else { if (checkLeftPress() and player.dirX == -1) { player.velX = -3.5; } else { player.velX = player.dirX * 1.2; } } player.isJumping = true; } function activateCheat(cht) { xmarker._x = _root._xmouse - theWorld._x; xmarker._y = _root._ymouse - theWorld._y; switch (cht) { case 'Full Health': if (player.isKnockdowned or player.staggerTimer > 0 or player.stunTimer > 0 or player.knockdownTimer > 0) { player.knockdownTimer = 0; player.isKnockdowned = false; player.stunTimer = 0; player.isStunned = false; player.staggerTimer = 0; startStunPlayer(1); } updateHPRage(100, 0); break; case 'Full Rage': updateHPRage(0, 100); break; case 'Destroy All Barrels and Arrows': var v2 = 1; while (v2 <= circleCounter) { if (myObject['circle' + v2].inGame) { myObject['circle' + v2].life -= myObject['circle' + v2].life; damageOb(myObject['circle' + v2], 40); } ++v2; } v2 = 1; while (v2 <= arrowCounter) { if (myObject['arrow' + v2].inGame) { addEffect('matchwood', myObject['arrow' + v2].posX, myObject['arrow' + v2].posY, 0, 0, 1); addPart('arrow_part_', 1, myObject['arrow' + v2].posX, myObject['arrow' + v2].posY, player.dirX * 6, -2, false, false, 5, 5); addPart('arrow_head_', 1, myObject['arrow' + v2].posX, myObject['arrow' + v2].posY, myObject['arrow' + v2].velX, -2, false, false, 2, 5); myObject['arrow' + v2].inGame = false; removeMovieClip(myObject['arrow' + v2].shadowClip); removeMovieClip(myObject['arrow' + v2].clip); } ++v2; } break; case 'Stun All Enemies': dropEnemy(0, 0); var v2 = 1; while (v2 <= enemyCounter) { if (myObject['enemy' + v2].inGame and myObject['enemy' + v2].life > 0) { myObject['enemy' + v2].attackTimer = 0; myObject['enemy' + v2].stunTimer = 99; } ++v2; } break; case 'Kill All Enemies': dropEnemy(0, 0); var v2 = 1; while (v2 <= enemyCounter) { if (myObject['enemy' + v2].inGame) { myObject['enemy' + v2].staggerTimer = 1; myObject['enemy' + v2].stunTimer = 0; myObject['enemy' + v2].knockdownTimer = 0; if (Math.random() * 100 <= 50) { damageEnemy(myObject['enemy' + v2], 1000, 'death_01'); } else { gibEnemyYey(myObject['enemy' + v2]); } } ++v2; } break; case 'Finish Level': game.levelFinished = true; interfaceLayer.ratioFix.gotoAndStop('stage_cleared'); if (gameEvent.nextWaveTimer > 0) { showTopicInformation('Bad Time To Finish Level'); gameEvent.nextWaveTimer = 0; } break; case 'Track1': startMusic(5); break; case 'Track2': startMusic(6); break; case 'Track3': startMusic(7); break; case 'TrackBoss': startMusic(1); break; case 'TrackBossFinal': startMusic(2); break; case 'TrackWorldmap': startMusic(11); break; case 'TrackMenu': startMusic(10); break; case 'Spawn Barrel': spawnBarrel(xmarker, '/HP-50/explosive-0/mustCheckExplosive-1/'); break; case 'Spawn Explosive Barrel': spawnBarrel(xmarker, '/HP-50/explosive-1/mustCheckExplosive-1/'); break; case 'Spawn Barrel Random': spawnBarrel(xmarker, '/HP-50/explosive-0/'); break; case 'Spawn Swordsman': spawnEnemy(xmarker, 'SWORDSMAN_1', 1, 'nothing'); break; case 'Spawn Crow': spawnEnemy(xmarker, 'CROW_1', 1, 'nothing'); break; case 'Spawn Archer': spawnEnemy(xmarker, 'ARCHER_1', 1, 'nothing'); break; case 'Spawn Spearman': spawnEnemy(xmarker, 'SPEARMAN_1', 1, 'nothing'); break; case 'Spawn Skeleton': spawnEnemy(xmarker, 'SKELETON_1', 1, 'nothing'); break; case 'Spawn Chaos Knight (Sword)': spawnEnemy(xmarker, 'CHAOSKNIGHT_SWORD_1', 1, 'nothing'); break; case 'Spawn Chaos Knight (Mace)': spawnEnemy(xmarker, 'CHAOSKNIGHT_MACE_1', 1, 'nothing'); break; case 'Spawn Unique (Random)': var v3 = Math.random() * 120; if (v3 < 10) { spawnEnemy(xmarker, 'UNI_LVL_1', 1, 'nothing'); } else { if (v3 < 20) { spawnEnemy(xmarker, 'UNI_LVL_4', 1, 'nothing'); } else { if (v3 < 30) { spawnEnemy(xmarker, 'UNI_LVL_6', 1, 'nothing'); } else { if (v3 < 40) { spawnEnemy(xmarker, 'UNI_LVL_7', 1, 'nothing'); } else { if (v3 < 50) { spawnEnemy(xmarker, 'UNI_LVL_10', 1, 'nothing'); } else { if (v3 < 60) { spawnEnemy(xmarker, 'UNI_STRONGORC', 1, 'nothing'); } else { if (v3 < 70) { spawnEnemy(xmarker, 'UNI_MOLOSKEL', 1, 'nothing'); } else { if (v3 < 80) { spawnEnemy(xmarker, 'UNI_MULTIARCHER', 1, 'nothing'); } else { if (v3 < 90) { spawnEnemy(xmarker, 'UNI_CHAOSKNIGHT', 1, 'nothing'); } else { if (v3 < 100) { spawnEnemy(xmarker, 'UNI_NECROMANCER', 1, 'nothing'); } else { if (v3 < 110) { spawnEnemy(xmarker, 'UNI_CHARGER', 1, 'nothing'); } else { if (v3 < 120) { spawnEnemy(xmarker, 'UNI_CHAOSKNIGHT2', 1, 'nothing'); } } } } } } } } } } } } } } function closeEncyclopediaFromIt() { closeEncyclopediaNow(); } function closeEncyclopediaNow() { if (showEncyclopedia) { showEncyclopedia = false; interfaceLayer.Encyclopedia.hideEncyclopedia(); if (!game.inWorldmap) { unpauseGame(); } else { MD.forcePointer = false; } } not4.enabled = true; } function toggleFullscreenMode() { if (canToggleFullscreen) { var v2 = Stage.displayState; Stage.displayState = (Stage.displayState == 'normal') ? 'fullScreen' : 'normal'; if (Stage.displayState == 'fullScreen') { _root._quality = 'LOW'; } else { if (Stage.displayState == v2) { showTopicInformation('Can\'t on this site'); } else { _root._quality = 'MEDIUM'; } } } } function level21Started() { if (Stage.displayState == 'fullScreen') { theWorld.backgroundNearLayer.currentLevel.sign_fullscreen._alpha = 100; } else { theWorld.backgroundNearLayer.currentLevel.sign_fullscreen._alpha = 0; } } function pauseGame() { MD.forcePointer = true; showCursor(); game.isPaused = true; key.spacePressed = false; key.spaceTabbed = false; key.rightPressed = false; key.leftPressed = false; key.upPressed = false; key.spacePower = 0; interfaceLayer.ratioFix.gotoAndStop('paused'); not3.enabled = false; not4.enabled = true; } function unpauseGame() { MD.forcePointer = false; hideCursor(); game.isPaused = false; interfaceLayer.ratioFix.gotoAndStop('running'); not3.enabled = true; not4.enabled = true; } function kick() { if (player.finishingEnemy <= 0) { var v5 = 0; var v1 = 1; while (v1 <= enemyCounter) { if (myObject['enemy' + v1].enemyType != 'Crow' and !myObject['enemy' + v1].finishingDone and myObject['enemy' + v1].inGame and facingOb(player, myObject['enemy' + v1]) and v5 == 0) { var v4 = Math.sqrt((player.posX - myObject['enemy' + v1].posX) * (player.posX - myObject['enemy' + v1].posX)); var v2 = Math.sqrt((player.posY - myObject['enemy' + v1].posY) * (player.posY - myObject['enemy' + v1].posY)); if (Math.random() * 100 >= myObject['enemy' + v1].UNI_knockdownR and v4 <= 65 and v2 <= 55 and myObject['enemy' + v1].posY + 3 > player.posY) { if (TG.traceAction == 'kick') { TutorialGuide[10] += 1; fadeTutorialGuide(); } myObject['enemy' + v1].dirX = -player.dirX; myObject['enemy' + v1].clip._xscale = myObject['enemy' + v1].dirX * 100; myObject['enemy' + v1].velX = 0; myObject['enemy' + v1].velY = 0; var v3 = myObject['enemy' + v1].UNI_knockdownR; myObject['enemy' + v1].UNI_knockdownR = 0; startFlyingEnemy(myObject['enemy' + v1], player.dirX * 5, -2); myObject['enemy' + v1].UNI_knockdownR = v3; myObject['enemy' + v1].knockdownTimer = 0; myObject['enemy' + v1].staggerTimer = 0; myObject['enemy' + v1].stunTimer = 0; v5 = v1; } } ++v1; } if (v5 > 0) { addEffect_Blood(myObject['enemy' + v5].bloodType, player.posX + player.dirX * 35, player.posY); setCameraShake(3, 3); } } } function canKick() { if (checkIdlePlayer()) { var v4 = 0; var v1 = 1; while (v1 <= enemyCounter) { if (!myObject['enemy' + v1].finishingDone and myObject['enemy' + v1].enemyType != 'Crow' and myObject['enemy' + v1].inGame and facingOb(player, myObject['enemy' + v1])) { var v3 = Math.sqrt((player.posX - myObject['enemy' + v1].posX) * (player.posX - myObject['enemy' + v1].posX)); var v2 = Math.sqrt((player.posY - myObject['enemy' + v1].posY) * (player.posY - myObject['enemy' + v1].posY)); if (myObject['enemy' + v1].posY + 3 > player.posY and (v4 != 2 and v3 <= 60 and v2 <= 50) and (myObject['enemy' + v1].staggerTimer > 0 and myObject['enemy' + v1].life <= 0 or myObject['enemy' + v1].stunTimer > 0 or myObject['enemy' + v1].knockdownTimer > 0 or myObject['enemy' + v1].posY - 3 > player.posY)) { v4 = 1; } else { if (v3 <= 50 and v2 <= 15 and myObject['enemy' + v1].knockdownTimer <= 0) { v4 = 2; } } } ++v1; } if (v4 == 1) { return true; return false; } return false; } return false; } function turnGrip(dirX) { player.dirX = dirX; player.clip._xscale = 100 * player.dirX; myObject['enemy' + player.holdingEnemy].posX = player.posX + player.clip.mc.grip._x * player.dirX; myObject['enemy' + player.holdingEnemy].posY = player.posY + player.clip.mc.grip._y; myObject['enemy' + player.holdingEnemy].dirX = -player.dirX; myObject['enemy' + player.holdingEnemy].clip._xscale = myObject['enemy' + player.holdingEnemy].dirX * 100; myObject['enemy' + player.holdingEnemy].clip._x = myObject['enemy' + player.holdingEnemy].posX; myObject['enemy' + player.holdingEnemy].clip._y = myObject['enemy' + player.holdingEnemy].posY; moveShadow(myObject['enemy' + player.holdingEnemy]); } function performFinishing() { if (player.velX == 0) { var v1 = 1; while (v1 <= enemyCounter) { if (myObject['enemy' + v1].currAttack != 'jump' and !myObject['enemy' + v1].finishingDone and !myObject['enemy' + v1].isFalling and myObject['enemy' + v1].enemyType != 'BOSS' and myObject['enemy' + v1].enemyType != 'Crow' and myObject['enemy' + v1].life > 0 and facingOb(player, myObject['enemy' + v1]) and myObject['enemy' + v1].inGame and (myObject['enemy' + v1].stunTimer > 1 or myObject['enemy' + v1].knockdownTimer > 1 or player.rage >= 100)) { var v5 = Math.sqrt((myObject['enemy' + v1].posX - player.posX) * (myObject['enemy' + v1].posX - player.posX)); if (v5 <= finishingXRange - 4) { var v4 = Math.sqrt((myObject['enemy' + v1].posY - player.posY) * (myObject['enemy' + v1].posY - player.posY)); if (v4 < 30) { if (TG.traceAction == 'stun') { TutorialGuide[13] += 1; fadeTutorialGuide(); } var v3 = false; if (!(myObject['enemy' + v1].stunTimer > 0 or myObject['enemy' + v1].knockdownTimer > 0)) { v3 = true; } var v2 = Math.random() * 100; if (v3) { player.clip.filters = [myRageGlowAttacking]; if (v2 < 34) { finishHim(v1, 'finishing_1', true, 6); } else { if (v2 < 67) { finishHim(v1, 'finishing_2', false, 10); } else { finishHim(v1, 'finishing_0_rage', false, 30); } } setCameraShake(3, 5); updateHPRage(0, -100); return true; } else { player.clip.filters = [myRageGlow]; if (myObject['enemy' + v1].stunTimer > 0 and myObject['enemy' + v1].knockdownTimer <= 0) { if (v2 <= 50) { finishHim(v1, 'finishing_1', true, 6); } else { finishHim(v1, 'finishing_2', false, 10); } return true; } else { if (myObject['enemy' + v1].knockdownTimer > 0) { if (TG.traceAction == 'fin_kick') { TutorialGuide[9] += 1; } if (v2 <= 10) { finishHim(v1, 'finishing_kd_2', false, 10); } else { finishHim(v1, 'finishing_kd_1', false, 10); } return true; } } } } } } ++v1; } } return false; } function finishHim(nr, type, facePC, maxDistY) { if (TG.traceAction == 'fin') { TutorialGuide[12] += 1; fadeTutorialGuide(); } var v3 = false; if (type == 'finishing_2' and checkForLedge(myObject['enemy' + nr], 50)) { v3 = true; } player.velX = 0; if (facePC) { facePlayer(myObject['enemy' + nr]); } myObject['enemy' + nr].barrelImmune = 1; myObject['enemy' + nr].velX = 0; myObject['enemy' + nr].velY = 0; myObject['enemy' + nr].stunTimer = 0; myObject['enemy' + nr].knockdownTimer = 0; myObject['enemy' + nr].staggerTimer = 0; myObject['enemy' + nr].forceDownALedge = false; myObject['enemy' + nr].currAttack = 'finishing'; myObject['enemy' + nr].oldDepth = myObject['enemy' + nr].clip.getDepth(); if (type == 'finishing_2' or type == 'finishing_0_rage') { myObject['enemy' + nr].clip.gotoAndStop('idle'); myObject['enemy' + nr].frameTimer = 24; } else { if (type == 'finishing_kd_2') { myObject['enemy' + nr].frameTimer = 24; } else { if (!myObject['enemy' + nr].isUNI or myObject['enemy' + nr].isUNI and myObject['enemy' + nr].life < rageUniDamage) { myObject['enemy' + nr].clip.gotoAndStop(type); myObject['enemy' + nr].clip.swapDepths(1000); myObject['enemy' + nr].frameTimer = myObject['enemy' + nr].clip.mc._totalFrames; } } } if (myObject['enemy' + nr].isUNI and myObject['enemy' + nr].knockdownTimer > 0) { myObject['enemy' + nr].knockdownTimer = 1; } else { if (type == 'finishing_kd_1') { myObject['enemy' + nr].knockdownTimer += 10; } } player.finishingEnemy = nr; setuncontrollable(); player.immortal = true; player.clip.gotoAndStop(type); if (type != 'finishing_2' and (!myObject['enemy' + nr].isUNI or myObject['enemy' + nr].isUNI and myObject['enemy' + nr].life <= rageUniDamage)) { setEnemyPlayerPos(myObject['enemy' + nr]); myObject['enemy' + nr].isFalling = false; myObject['enemy' + nr].stunTimer = 0; myObject['enemy' + nr].knockdownTimer = 0; myObject['enemy' + nr].staggerTimer = 0; myObject['enemy' + nr].currAttack = 'finishing'; myObject['enemy' + nr].clip.gotoAndStop(type); } myObject['enemy' + nr].velX = 0; myObject['enemy' + nr].velY = 0; var v4 = Math.sqrt((myObject['enemy' + nr].posY - player.posY) * (myObject['enemy' + nr].posY - player.posY)); if (myObject['enemy' + nr].isUNI and myObject['enemy' + nr].life > rageUniDamage or v3 or v4 >= maxDistY) { myObject['enemy' + nr].currAttack = 'finishing_locked'; if (!myObject['enemy' + nr].isUNI) { myObject['enemy' + nr].life = 0.1; } else { facePlayer(myObject['enemy' + nr]); } myObject['enemy' + nr].clip.gotoAndStop('idle'); player.clip.gotoAndStop('finishing_0'); } if (!myObject['enemy' + nr].isUNI or myObject['enemy' + nr].life <= rageUniDamage) { if (myObject['enemy' + nr].enemyType == 'DARKCOPY') { myObject['enemy' + nr].currAttack = 'finishing_locked'; myObject['enemy' + nr].clip.gotoAndStop('idle'); player.clip.gotoAndStop('finishing_0'); } myObject['enemy' + nr].finishingDone = true; myObject['enemy' + nr].finishingType = type; if (!myObject['enemy' + nr].isUNI) { myObject['enemy' + nr].clip.filters = [myRageGlow]; } checkGameEventOnDeath(myObject['enemy' + nr]); } updateHPRage(0, 15); } function decap() { if (myObject['enemy' + player.finishingEnemy].canDropHead) { addSound('finishing_01.WAV', 70, 0, 0); decapitateEnemy(myObject['enemy' + player.finishingEnemy], 2); } else { addSound('hitFlesh_0' + Math.floor(Math.random() * 2 + 1) + '.wav', 40, 0, 0); damageEnemy(myObject['enemy' + player.finishingEnemy], 9999, 'death_01'); } } function finishingJumpy() { addSound('hitFlesh_0' + Math.floor(Math.random() * 2 + 1) + '.wav', 40, 0, 0); if (myObject['enemy' + player.finishingEnemy].life < 1) { addSound('flesh_squishy_impact_hard' + Math.floor(Math.random() * 3 + 2), 100, 0); if (myObject['enemy' + player.finishingEnemy].canDropArm) { cutArmEnemy(myObject['enemy' + player.finishingEnemy]); } else { damageEnemy(myObject['enemy' + player.finishingEnemy], 9999, 'death_01'); } } else { var v1 = -35; addEffect('bash_effect', myObject['enemy' + player.finishingEnemy].posX, myObject['enemy' + player.finishingEnemy].posY + v1, 0, 4, 1); if (myObject['enemy' + player.finishingEnemy].bloodStain == 1) { addEffect_Blood(myObject['enemy' + player.finishingEnemy].bloodType, myObject['enemy' + player.finishingEnemy].posX, myObject['enemy' + player.finishingEnemy].posY + v1); } else { if (myObject['enemy' + player.finishingEnemy].bloodStain == 2) { addEffect(myObject['enemy' + player.finishingEnemy].bloodType, myObject['enemy' + player.finishingEnemy].posX, myObject['enemy' + player.finishingEnemy].posY + v1, 0, 3, 1); } else { if (myObject['enemy' + player.finishingEnemy].bloodStain == 3) { addEffect(myObject['enemy' + player.finishingEnemy].bloodType + '0' + Math.round(Math.random() * 1 + 1), myObject['enemy' + player.finishingEnemy].posX, myObject['enemy' + player.finishingEnemy].posY + v1, 0, 3, 1); } } } myObject['enemy' + player.finishingEnemy].staggerTimer = 40; myObject['enemy' + player.finishingEnemy].knockdownTimer = 0; myObject['enemy' + player.finishingEnemy].stunTimer = 0; damageEnemy(myObject['enemy' + player.finishingEnemy], rageUniDamage, 'death_01'); } } function finishingJumpyRage() { gibVelXAxis = player.dirX * 8; myObject['enemy' + player.finishingEnemy].posY -= 20; gibEnemyYey(myObject['enemy' + player.finishingEnemy]); setCameraShake(3, 3); gibVelXAxis = 0; } function checkRightPress() { if (traceKeysPressed.rightPressed or traceKeysPressed.rightSecondPressed) { return true; } return false; } function checkLeftPress() { if (traceKeysPressed.leftPressed or traceKeysPressed.leftSecondPressed) { return true; } return false; } function checkStrongSpace() { if (key.spacePower == 4) { if (TG.traceAction == 'strongatt') { fadeTutorialGuide(); } if (player.holdingEnemy > 0) { if (!player.doingHeadKnock) { if (checkRightPress()) { turnGrip(1); } else { if (checkLeftPress()) { turnGrip(-1); } } player.isThrowingEnemy = true; player.clip.gotoAndStop('throw'); } } else { if (player.isHoldingBarrel) { if (checkRightPress()) { player.dirX = 1; player.clip._xscale = 100 * player.dirX; pickupBarrel(); } else { if (checkLeftPress()) { player.dirX = -1; player.clip._xscale = 100 * player.dirX; pickupBarrel(); } } player.isThrowingBarrel = true; player.clip.gotoAndStop('throw'); } else { if (performFinishing()) { } else { if (player.currentAttack == 0 and !player.isPreparingJump) { player.currentAttack = 10; if (Math.sqrt(player.velX * player.velX) >= 5 and player.canPerformStrongRun) { player.clip.gotoAndStop('att_s_run'); } else { player.clip.gotoAndStop('att_s'); player.velX = 0; } } } } } } } function endOfDemo() {} function stopRain(newBckSound, vlm) { thunderValues.backgroundThunder = false; game.weatherType = 'nothing'; setThunder(0, 0); forceThunderOverride(); interfaceLayer.ratioFix.weather.gotoAndStop(game.weatherType); startAmbientMusic(0); } function startSnow(thn1, thn2) { forceThunderOverride(); startAmbientMusic(2); game.weatherType = 'snow'; setThunder(thn1, thn2); interfaceLayer.ratioFix.weather.gotoAndStop(game.weatherType); thunderValues.backgroundThunder = true; } function startRain(thn1, thn2) { thunderValues.backgroundThunder = false; forceThunderOverride(); startAmbientMusic(1); game.weatherType = 'rain'; setThunder(thn1, thn2); interfaceLayer.ratioFix.weather.gotoAndStop(game.weatherType); } function setThunder(thundersEachMinute, CDBetweenThunders) { thunderValues.backgroundThunder = false; thunderValues.thunderChance = (thundersEachMinute / 60) * 100; thunderValues.thunderCD = CDBetweenThunders * 24; thunderValues.nextCheck = thunderValues.thunderCD; } function checkThunder() { thunderValues.nextCheck -= 1; if (thunderValues.nextCheck <= 0) { if (Math.random() * 100 <= thunderValues.thunderChance) { playThunder(); } thunderValues.nextCheck = thunderValues.thunderCD; } } function playThunder() { if (!thunderValues.backgroundThunder) { interfaceLayer.ratioFix.thunder.play(); } else { theWorld.backgroundNearLayer.currentLevel.thunder.play(); } } function forceThunderOverride() { playThunder(); } function forceThunder() { if (thunderValues.thunderCD > 0) { interfaceLayer.ratioFix.thunder.play(); thunderValues.nextCheck = thunderValues.thunderCD; } } function addEntryInEncyclopedia(entryID) {} function tutorialRage() { if (interfaceLayer.Encyclopedia.isUnknownTopic('t_rge')) { updateHPRage(0, 100); } } function showTutorial(TutorialID) {} function showBossPlate(str) { var v1 = 1; while (v1 <= circleCounter) { myObject['circle' + v1].explosive = 0; myObject['circle' + v1].canSpawnSkeleton = false; ++v1; } activateCheat('Destroy All Barrels and Arrows'); interfaceLayer.ratioFix.boss_plate._alpha = 100; interfaceLayer.ratioFix.boss_plate._y += 100; interfaceLayer.ratioFix.boss_plate.boss_txt.gotoAndStop(str); } function changeBossPlateHP(curr_hits_left, max_hit) { var v1 = (curr_hits_left / max_hit) * 100; if (v1 < 0) { v1 = 0; } interfaceLayer.ratioFix.boss_plate.hp_bar._xscale = v1; } function exitLevelNow() { unpauseGame(); gameOver(); } function updateRage() { if (player.rageTimer > 0) { player.rageTimer -= 1; } else { if (player.rage > 0) { player.rage -= 0.05; interfaceLayer.ratioFix.hp_rage.rageBar._yscale = player.rage; if (player.rageInit) { interfaceLayer.ratioFix.hp_rage.rage_indicator.gotoAndStop(1); player.clip.filters = null; changeColour(player.clip, 100, 100, 100, 0, 0, 0); hideExplosiveBarrels(); player.rageInit = false; } if (player.rage < 0) { player.rage = 0; } } } } function updateHPRage(HPChange, RageChange) { player.rage += RageChange; player.life += HPChange; if (player.rage > 100) { player.rage = 100; if (player.rageTimer > 0) { player.rageTimer = 240; } } if (player.life > 100) { player.life = 100; } if (player.life < 0) { player.life = 0; } if (player.rage < 0) { player.rage = 0; } if (player.isFalling and player.life == 0) { player.life = 0.1; } if (!player.deathInitiated) { interfaceLayer.ratioFix.hp_rage.rageBar._yscale = player.rage; interfaceLayer.ratioFix.hp_rage.hpBar._yscale = player.life; if (player.life < 100) { } if (player.life <= 10) { interfaceLayer.ratioFix.hp_rage.hp_indicator.play(); } else { interfaceLayer.ratioFix.hp_rage.hp_indicator.gotoAndStop(1); } if (player.rage >= 100 and player.rageTimer == 0) { player.rageTimer = 240; player.clip.filters = [myRageGlow]; changeColour(player.clip, 100, 60, 60, 0, 0, 0); showExplosiveBarrels(); interfaceLayer.ratioFix.hp_rage.rage_indicator.play(); player.rageInit = true; } else { if (player.rageTimer > 0 and player.rage < 100) { player.rageTimer = 0; if (player.rageInit) { interfaceLayer.ratioFix.hp_rage.rage_indicator.gotoAndStop(1); if (player.finishingEnemy <= 0) { player.clip.filters = null; } changeColour(player.clip, 100, 100, 100, 0, 0, 0); hideExplosiveBarrels(); player.rageInit = false; } } } if (player.life <= 0 and !player.gibbed) { setuncontrollable(); player.velX = 0; player.velY = 0; player.immortal = true; interfaceLayer.ratioFix.hp_rage.hpBar._yscale = 0; player.clip.removeMovieClip(); theWorld.actorsLayer.attachMovie('Actor_PC_Death', 'Actor_PC_Death', 999); player.clip = theWorld.actorsLayer.Actor_PC_Death; player.clip._x = player.posX; player.clip._y = player.posY; player.clip._alpha = 100; player.clip._xscale = player.dirX * 100; player.uncontrollable = true; if (!game.levelFinished) { interfaceLayer.ratioFix.gotoAndStop('game_over'); forceThunder(); } player.deathInitiated = true; game.initSat = 100; var v1 = 1; while (v1 <= 14) { xmarker._x = player.posX + Math.random() * 300 - 150; xmarker._y = player.posY - 245 - Math.random() * 200; spawnEnemy(xmarker, 'CROW_1', 1, 'nothing'); ++v1; } addSound('crow_01.wav', 60, 0, 0); } } } function cleaveArrows() { if (arrowCounter > 0) { var v6 = Math.sqrt(player.clip.mc.attackRange._x * player.clip.mc.attackRange._x); var v4 = player.clip.mc.minY_attackRange._y + 35; var v5 = player.clip.mc.maxY_attackRange._y; var v1 = minArrowCounter; while (v1 <= arrowCounter) { if (myObject['arrow' + v1].inGame and myObject['arrow' + v1].spec != 'molo' and facingOb(player, myObject['arrow' + v1])) { var v3 = Math.sqrt((myObject['arrow' + v1].posX - player.posX) * (myObject['arrow' + v1].posX - player.posX)); var v2 = myObject['arrow' + v1].posY - player.posY; if (v2 >= v5 and v2 <= v4 and v3 <= v6) { addEffect('matchwood', myObject['arrow' + v1].posX, myObject['arrow' + v1].posY, 0, 0, 1); addPart('arrow_part_', 1, myObject['arrow' + v1].posX, myObject['arrow' + v1].posY, player.dirX * 6, -2, false, false, 5, 5); addPart('arrow_head_', 1, myObject['arrow' + v1].posX, myObject['arrow' + v1].posY, myObject['arrow' + v1].velX, -2, false, false, 2, 5); myObject['arrow' + v1].inGame = false; removeMovieClip(myObject['arrow' + v1].shadowClip); removeMovieClip(myObject['arrow' + v1].clip); } } ++v1; } } } function cleaveBarrels(damage) { if (circleCounter > 0) { var v7 = Math.sqrt(player.clip.mc.attackRange._x * player.clip.mc.attackRange._x); var v5 = player.clip.mc.minY_attackRange._y + 35; var v6 = player.clip.mc.maxY_attackRange._y; var v1 = 1; while (v1 <= circleCounter) { if (myObject['circle' + v1].inGame and facingOb(player, myObject['circle' + v1])) { var v3 = Math.sqrt((myObject['circle' + v1].posX - player.posX) * (myObject['circle' + v1].posX - player.posX)); var v2 = myObject['circle' + v1].posY - player.posY; if (v2 >= v6 and v2 <= v5 and v3 <= v7) { myObject['circle' + v1].inMove = true; myObject['circle' + v1].velX += player.dirX * damage / 6; addSound('wood_crate_impact_hard2.wav', 30, 0, 0); addEffect('matchwood', myObject['circle' + v1].posX, myObject['circle' + v1].posY - 20, 0, 0, 1); damageOb(myObject['circle' + v1], damage); } } ++v1; } } } function cleaveEnemies(damage, attackValues) { var v6 = player.posX + Math.sqrt(player.clip.mc.attackRange._x * player.clip.mc.attackRange._x) * player.dirX; var v22 = player.posY + player.clip.mc.maxY_attackRange._y; var v21 = player.posY + player.clip.mc.minY_attackRange._y; var v24 = false; var v1 = 1; while (v1 <= enemyCounter) { if (myObject['enemy' + v1].inGame and facingOb(player, myObject['enemy' + v1]) and facingOb(myObject['enemy' + v1], player) and !myObject['enemy' + v1].immortal) { var v17 = myObject['enemy' + v1].posY + myObject['enemy' + v1].HB_posY - myObject['enemy' + v1].HB_height; var v13 = myObject['enemy' + v1].posY + myObject['enemy' + v1].HB_posY + myObject['enemy' + v1].HB_height; var v10 = myObject['enemy' + v1].posX + myObject['enemy' + v1].HB_width * -player.dirX; var v14 = Math.sqrt((myObject['enemy' + v1].posY - player.posY) * (myObject['enemy' + v1].posY - player.posY)); if (v14 <= 8 and (v22 < v13 and v21 > v17 and (v6 > v10 and player.dirX == 1 or v6 < v10 and player.dirX == -1))) { var v12 = parseInt(findString('/parryable-', attackValues, '/')); if (v12 == 1 and myObject['enemy' + v1].canParry == 1 and player.contesting == 0 and myObject['enemy' + v1].attackTimer > 0 and myObject['enemy' + v1].attackTimer <= 3 and myObject['enemy' + v1].currAttack != 'throw_barrel' and myObject['enemy' + v1].currAttack != 'uncontrollable') { showTutorialGuide(8); contest_sound.start(0.2); addSound('contest_begin.wav', 100, 0, 0); setCameraShake(3, 5); v24 = true; setuncontrollable(); player.contestingTimer = 75; player.velX = 0; player.contestingPower = 0; player.contestingPower -= parseInt(findString('/contestPushbacks-', myObject['enemy' + v1].enemyValues, '/')); player.contesting = v1; player.clip.gotoAndStop('contest'); player.immortal = true; myObject['enemy' + v1].currAttack = 'contesting'; myObject['enemy' + v1].clip.gotoAndStop('contest'); myObject['enemy' + v1].attackTimer = 0; myObject['enemy' + v1].oldDepth = myObject['enemy' + v1].clip.getDepth(); myObject['enemy' + v1].clip.swapDepths(1000); addEffect_sparks(player); addEffect_sparks(myObject['enemy' + v1]); forceThunder(); } } } ++v1; } var v19 = false; var v18 = false; var v11 = false; var v20 = parseInt(findString('/stunEffect-', attackValues, '/')); var v23 = parseInt(findString('/pushbackEffect-', attackValues, '/')); if (!v24) { v1 = 1; while (v1 <= enemyCounter) { if (!(myObject['enemy' + v1].staggerTimer > 0 and myObject['enemy' + v1].life <= 0) and myObject['enemy' + v1].currAttack != 'finishing' and myObject['enemy' + v1].inGame and facingOb(player, myObject['enemy' + v1]) and !myObject['enemy' + v1].immortal) { v17 = myObject['enemy' + v1].posY + myObject['enemy' + v1].HB_posY - myObject['enemy' + v1].HB_height; v13 = myObject['enemy' + v1].posY + myObject['enemy' + v1].HB_posY + myObject['enemy' + v1].HB_height; v10 = myObject['enemy' + v1].posX + myObject['enemy' + v1].HB_width * -player.dirX; if (v22 < v13 and v21 > v17 and (v6 > v10 and player.dirX == 1 or v6 < v10 and player.dirX == -1)) { var v16 = myObject['enemy' + v1].dirX; if (myObject['enemy' + v1].knockdownTimer <= 0) { myObject['enemy' + v1].dirX = player.dirX * -1; } myObject['enemy' + v1].clip._xscale = myObject['enemy' + v1].UNI_scale * myObject['enemy' + v1].dirX; var v5 = parseInt(findString('/blockable-', attackValues, '/')); var v8 = false; if (checkSkipBlock(myObject['enemy' + v1])) { myObject['enemy' + v1].blocksPerformed = 0; v8 = true; } if (myObject['enemy' + v1].isPrincessBoss == true) { myObject['enemy' + v1].dirX = v16; myObject['enemy' + v1].clip._xscale = myObject['enemy' + v1].UNI_scale * myObject['enemy' + v1].dirX; if (facingOb(myObject['enemy' + v1], player)) { myObject['enemy' + v1].currAttack = 'initInstaKnockback_longKnockdown'; } else { v19 = true; addEffect_Blood(myObject['enemy' + v1].bloodType, myObject['enemy' + v1].posX, myObject['enemy' + v1].posY - 20); myObject['enemy' + v1].hurtTimer = 5; myObject['enemy' + v1].clip.gotoAndStop('hurt'); myObject['enemy' + v1].life -= damage; changeBossPlateHP(myObject['enemy' + v1].life, myObject['enemy' + v1].maxLife); if (myObject['enemy' + v1].life <= 0) { myObject['enemy' + v1].immortal = true; myObject['enemy' + v1].currAttack = 'InitDeath'; } } } else { if (myObject['enemy' + v1].enemyType == 'DARKCOPY' and v5 == 1 and (myObject['enemy' + v1].currAttack == 'run' or myObject['enemy' + v1].currAttack == 'idle' or myObject['enemy' + v1].currAttack == 'att_1' or myObject['enemy' + v1].currAttack == 'att_2' or myObject['enemy' + v1].currAttack == 'att_3' or myObject['enemy' + v1].currAttack == 'att_s')) { startBlocking(myObject['enemy' + v1]); v18 = true; v11 = true; } else { if (myObject['enemy' + v1].isOMGBoss == true) { if (!myObject['enemy' + v1].canNowHitHead) { if (myObject['enemy' + v1].attackPhase == 0) { if (v5 == 0) { if (myObject['enemy' + v1].canContest and !player.isJumping) { myObject['enemy' + v1].canContest = false; myObject['enemy' + v1].currAttack = 'initContest'; } } else { if (myObject['enemy' + v1].canContest) { myObject['enemy' + v1].currAttack = 'initKick'; } } v11 = true; } } else { if (player.isJumping) { myObject['enemy' + v1].currAttack = 'hit'; } } } else { if (!v8 and v5 == 1 and (myObject['enemy' + v1].currAttack == 'idle' or myObject['enemy' + v1].currAttack == 'run') and myObject['enemy' + v1].canBlock == 1) { startBlocking(myObject['enemy' + v1]); v18 = true; if (myObject['enemy' + v1].enemyType == 'ChaosKnight') { v11 = true; } } else { if (myObject['enemy' + v1].enemyType != 'Crow') { updateHPRage(0, damage * 4 / 9); } var v7 = parseInt(findString('/cutArmChance-', attackValues, '/')); var v9 = parseInt(findString('/cutHeadChance-', attackValues, '/')); v19 = true; if (myObject['enemy' + v1].knockdownTimer > 0) { var v4 = -10; } else { var v4 = myObject['enemy' + v1].HB_posY; } var v15 = parseInt(findString('/showBashEffect-', attackValues, '/')); if (v15 == 1) { addEffect('bash_effect', myObject['enemy' + v1].posX, myObject['enemy' + v1].posY + v4, 0, 4, 1); } if (myObject['enemy' + v1].bloodStain == 1) { addEffect_Blood(myObject['enemy' + v1].bloodType, myObject['enemy' + v1].posX, myObject['enemy' + v1].posY + v4); } else { if (myObject['enemy' + v1].bloodStain == 2) { addEffect(myObject['enemy' + v1].bloodType, myObject['enemy' + v1].posX, myObject['enemy' + v1].posY + v4, 0, 3, 1); } else { if (myObject['enemy' + v1].bloodStain == 3) { addEffect(myObject['enemy' + v1].bloodType + '0' + Math.round(Math.random() * 1 + 1), myObject['enemy' + v1].posX, myObject['enemy' + v1].posY + v4, 0, 3, 1); } } } if (myObject['enemy' + v1].enemyType == 'BOSS') { v9 = -1; v7 = -1; v20 = -1; v23 = -1; } if (damage >= myObject['enemy' + v1].life and checkForLedge(myObject['enemy' + v1], 50)) { myObject['enemy' + v1].forceDownALedge = true; myObject['enemy' + v1].staggerTimer += 2; myObject['enemy' + v1].stunTimer = 0; } else { myObject['enemy' + v1].forceDownALedge = false; } if (!myObject['enemy' + v1].forceDownALedge and damage > myObject['enemy' + v1].life and Math.random() * 100 <= v9 and myObject['enemy' + v1].knockdownTimer <= 0 and myObject['enemy' + v1].canDropHead and !myObject['enemy' + v1].isFalling and myObject['enemy' + v1].currAttack != 'jump') { myObject['enemy' + v1].staggerTimer = 0; decapitateEnemy(myObject['enemy' + v1], 1); } else { if (!myObject['enemy' + v1].forceDownALedge and damage > myObject['enemy' + v1].life and Math.random() * 100 <= v7 and myObject['enemy' + v1].knockdownTimer <= 0 and myObject['enemy' + v1].canDropArm) { cutArmEnemy(myObject['enemy' + v1]); } else { if (myObject['enemy' + v1].knockdownTimer <= 0) { if (myObject['enemy' + v1].staggerTimer > 0) { myObject['enemy' + v1].stunTimer = 0; } myObject['enemy' + v1].staggerTimer += Math.floor((parseInt(findString('/minStaggerTime-', attackValues, '/')) + Math.random() * (parseInt(findString('/maxStaggerTime-', attackValues, '/')) - parseInt(findString('/minStaggerTime-', attackValues, '/')))) * ((101 - myObject['enemy' + v1].UNI_staggerR) / 100)); if (myObject['enemy' + v1].staggerTimer > 0) { myObject['enemy' + v1].clip.gotoAndStop('idle'); myObject['enemy' + v1].clip.gotoAndStop('eff_stagger'); } } else { myObject['enemy' + v1].knockdownTimer += Math.floor(parseInt(findString('/minStaggerTime-', attackValues, '/'))); } damageEnemy(myObject['enemy' + v1], damage, findString('/deathAnimationType-', attackValues, '/')); player.clip.mc.stop(); if (player.attackPause < 1) { player.attackPause = 1; } player.attackPause += 1; if (myObject['enemy' + v1].knockdownTimer <= 0 and Math.random() * 100 < v20 * ((101 - myObject['enemy' + v1].UNI_stunR) / 100) and myObject['enemy' + v1].life > 0) { myObject['enemy' + v1].stunTimer = Math.random() * 35 + 35; myObject['enemy' + v1].staggerTimer = 0; addEnemyBlurry(myObject['enemy' + v1], 4, 5, 5); setCameraShake(5, 5); } else { if (Math.random() * 100 < v23 * ((101 - myObject['enemy' + v1].UNI_knockdownR) / 100) and myObject['enemy' + v1].life > 0) { myObject['enemy' + v1].stunTimer = 0; myObject['enemy' + v1].staggerTimer = 0; myObject['enemy' + v1].velX = 0; myObject['enemy' + v1].velY = 0; myObject['enemy' + v1].dirX = player.dirX * -1; startFlyingEnemy(myObject['enemy' + v1], player.dirX * 2, -3); } else {} } } } } } } } } } ++v1; } } if (v19) { addSound('hitFlesh_0' + Math.floor(Math.random() * 2 + 1) + '.wav', 40, 0, 0); } if (v18) { if (v11) { addSound('parry_01.wav', 90, 0, 0); addEffect_sparks(player); } else { addSound('shield.wav', 55, 0, 0); } } } function checkSkipBlock(ob) { var v2 = Math.random() * 100; if (ob.enemyType == 'orc_sword') { if (ob.blocksPerformed == 2 and v2 <= 50) { return true; } else { if (ob.blocksPerformed == 1 and v2 <= 28) { return true; } else { if (ob.blocksPerformed == 0 and v2 <= 11) { return true; } } } return false; } if (ob.enemyType == 'Skeleton') { if (ob.blocksPerformed == 2 and v2 <= 35) { return true; return false; } if (ob.blocksPerformed == 1 and v2 <= 22) { return true; return false; } if (ob.blocksPerformed == 0 and v2 <= 7) { return true; } } return false; } function cutArmEnemy(ob) { ob.dirX = -player.dirX; ob.clip._xscale = ob.dirX * ob.UNI_scale; addFlyingArm(ob); ob.stunTimer = 0; ob.knockdownTimer = 0; ob.armDropped = true; ob.staggerTimer = 2; damageEnemy(ob, 99999, 'death_land_armless'); } function decapitateEnemy(ob, power) { addFlyingHead(ob, power); ob.stunTimer = 0; ob.knockdownTimer = 0; damageEnemy(ob, 99999, 'death_02'); } function facingOb(ob1, ob2) { if (ob1.dirX == (ob2.posX - ob1.posX) / Math.sqrt((ob2.posX - ob1.posX) * (ob2.posX - ob1.posX))) { return true; } return false; } function finishing_end() { if (player.rage < 100) { player.clip.filters = null; } player.finishingEnemy = 0; player.immortal = false; player.uncontrollable = false; player.clip.gotoAndStop('idle'); } function contest_win() { player.contesting = 0; player.immortal = false; player.uncontrollable = false; player.clip.gotoAndStop('idle'); } function checkForLedge(ob, dist) { var v2 = 1; while (v2 <= dist) { if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX - ob.dirX * v2, ob.posY + camPos.difY + 4, true) and !theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX - ob.dirX * (v2 + 4), ob.posY + camPos.difY + (yCheckAxis - 4), true)) { return true; } else { if (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX - ob.dirX * v2, ob.posY + camPos.difY + 4, true) and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX - ob.dirX * (v2 + 4), ob.posY + camPos.difY + (yCheckAxis - 4), true)) { return false; } } v2 += 2; } return false; } function damageEnemy(ob, damage, deathAnimationType) { ob.life -= damage; ob.attackTimer = 0; if (ob.nameID != 'none') { updateUniqueSign(ob); } if (player.attackLevel == 2) { setCameraShake(5, 8); } if (ob.enemyType == 'DARKCOPY' and ob.life <= 0) { checkGameEventOnDeath(ob); changeBossPlateHP(0, 2); gibEnemyYey(ob); } else { if (ob.currAttack == 'jump' or ob.isFalling) { startFlyingEnemy(ob, 0, 0); } else { if (ob.life <= 0) { if (ob.enemyType != 'BOSS' and (player.attackLevel == 2 and Math.random() * 100 <= 10) or player.attackLevel == 3) { gibEnemyYey(ob); if (player.attackLevel == 3) { setCameraShake(6, 12); } } else { if (ob.knockdownTimer > 0) { ob.knockdownTimer = 1; } if (ob.stunTimer > 0) { ob.stunTimer = 1; } if (ob.currAttack == 'jump' or ob.isFalling) { startFlyingEnemy(ob, 0, 0); } if (checkForLedge(ob, 130) and ob.staggerTimer > 0 and ob.knockdownTimer <= 0 or ob.forceDownALedge == true) { checkGameEventOnDeath(ob); ob.bloodTimer_stagger_death = 4; ob.staggerTimer = 999; ob.currAttack = 'stagger_down_a_cliff'; } else { if (ob.armDropped) { checkGameEventOnDeath(ob); ob.bloodTimer_stagger_death = 4; ob.staggerTimer = 40; ob.currAttack = 'death_stagger'; } else { checkGameEventOnDeath(ob); addDeadEnemy(ob, deathAnimationType); } } } player.attackLevel = 1; } } } } function attack_pickup() { player.headKnocksDone += 1; player.holdingEnemyTimer = 0; myObject['enemy' + player.holdingEnemy].clip.mc.play(); myObject['enemy' + player.holdingEnemy].life -= 8 + player.headKnocksDone * 3; updateHPRage(0, 4); if (myObject['enemy' + player.holdingEnemy].bloodStain == 1) { addEffect_Blood(myObject['enemy' + player.holdingEnemy].bloodType, player.posX + player.dirX * 25, player.posY - 45, 0, 3, 1); } else { if (myObject['enemy' + player.holdingEnemy].bloodStain == 2) { addEffect(myObject['enemy' + player.holdingEnemy].bloodType, player.posX + player.dirX * 25, player.posY - 45, 0, 3, 1); } else { if (myObject['enemy' + player.holdingEnemy].bloodStain == 3) { addEffect(myObject['enemy' + player.holdingEnemy].bloodType + '0' + Math.round(Math.random() * 1 + 1), player.posX + player.dirX * 25, player.posY - 45, 0, 3, 1); } } } setCameraShake(6, 4); if (myObject['enemy' + player.holdingEnemy].life <= 0 or player.headKnocksDone >= 3) { myObject['enemy' + player.holdingEnemy].velX = 0; myObject['enemy' + player.holdingEnemy].velY = 0; dropEnemy(player.dirX * 4, -1.6); } } function attack_pickup_done() { player.doingHeadKnock = false; player.clip.gotoAndStop('pickup'); player.uncontrollable = false; } function playerAttack(attackID) { if (attackID != 'attack_jump') { player.attackLevel = 1; } var v2 = getAttack(attackID); var v1 = parseInt(findString('/dmg-', v2, '/')); if (player.attackLevel == 2) { v1 = 55; } else { if (player.attackLevel == 3) { v1 = 150; } } var v3 = parseInt(findString('/pushbackEffect-', v2, '/')); cleaveArrows(); cleaveBarrels(v1); cleaveEnemies(v1, v2); cleaveFoodCrates(); } function cleaveFoodCrates() { if (foodCrateCounter > 0) { var v1 = 1; while (v1 <= foodCrateCounter) { if (myObject['foodCrate' + v1].inGame and facingOb(player, myObject['foodCrate' + v1])) { var v2 = Math.sqrt((myObject['foodCrate' + v1].posX - player.posX) * (myObject['foodCrate' + v1].posX - player.posX) + (myObject['foodCrate' + v1].posY - player.posY) * (myObject['foodCrate' + v1].posY - player.posY)); if (v2 < 80) { spawnFood(myObject['foodCrate' + v1].posX, myObject['foodCrate' + v1].posY, myObject['foodCrate' + v1].FoodType); myObject['foodCrate' + v1].clip.play(); myObject['foodCrate' + v1].inGame = false; } } ++v1; } } } function dropEnemy(velX, velY) { if (TG.traceAction == 'grab') { fadeTutorialGuide(); } if (player.holdingEnemy > 0) { myObject['enemy' + player.holdingEnemy].pickedup = false; myObject['enemy' + player.holdingEnemy].clip.swapDepths(myObject['enemy' + player.holdingEnemy].oldDepth); player.isThrowingEnemy = false; player.doingHeadKnock = false; startFlyingEnemy(myObject['enemy' + player.holdingEnemy], velX, velY); player.holdingEnemy = 0; } } function turnEnemy() { player.velX = 0; player.clip.gotoAndStop('pickup'); myObject['enemy' + player.holdingEnemy].clip.gotoAndStop('eff_pickup'); myObject['enemy' + player.holdingEnemy].posX = player.posX + player.clip.mc.grip._x * player.dirX; myObject['enemy' + player.holdingEnemy].posY = player.posY + player.clip.mc.grip._y; myObject['enemy' + player.holdingEnemy].dirX = -player.dirX; myObject['enemy' + player.holdingEnemy].clip._xscale = myObject['enemy' + player.holdingEnemy].dirX * myObject['enemy' + player.holdingEnemy].UNI_scale; myObject['enemy' + player.holdingEnemy].clip._x = myObject['enemy' + player.holdingEnemy].posX; myObject['enemy' + player.holdingEnemy].clip._y = myObject['enemy' + player.holdingEnemy].posY; moveShadow(myObject['enemy' + player.holdingEnemy]); } function checkPickupEnemies() { if (!player.uncontrollable) { var v1 = 1; while (v1 <= enemyCounter) { if (myObject['enemy' + v1].inGame and player.holdingEnemy <= 0 and facingOb(player, myObject['enemy' + v1])) { var v3 = Math.sqrt((myObject['enemy' + v1].posX - player.posX) * (myObject['enemy' + v1].posX - player.posX)); var v2 = Math.sqrt((myObject['enemy' + v1].posY - player.posY) * (myObject['enemy' + v1].posY - player.posY)); if (myObject['enemy' + v1].life > 0 and !myObject['enemy' + v1].isFalling and myObject['enemy' + v1].knockdownTimer <= 0 and checkIdlePlayer() and myObject['enemy' + v1].currAttack == 'uncontrollable' and v2 <= 40 and v3 <= 20) { if (TG.traceAction == 'stun') { TutorialGuide[13] += 1; } fadeTutorialGuide(); showTutorialGuide(11); addEnemyBlurry(myObject['enemy' + v1], 2, 5, 5); addSound('boss_playerPickup', 80, 0, 0); myObject['enemy' + v1].oldDepth = myObject['enemy' + v1].clip.getDepth(); myObject['enemy' + v1].clip.swapDepths(1000); myObject['enemy' + v1].currAttack = 'uncontrollable'; myObject['enemy' + v1].staggerTimer = 0; myObject['enemy' + v1].stunTimer = 0; myObject['enemy' + v1].knockdownTimer = 0; myObject['enemy' + v1].pickedup = true; myObject['enemy' + v1].isFalling = false; player.holdingEnemy = v1; player.headKnocksDone = 0; player.holdingEnemyTimer = 0; player.velX = 0; player.clip.gotoAndStop('pickup'); myObject['enemy' + v1].clip.gotoAndStop('eff_pickup'); myObject['enemy' + v1].posX = player.posX + player.clip.mc.grip._x * player.dirX; myObject['enemy' + v1].posY = player.posY + player.clip.mc.grip._y; myObject['enemy' + v1].dirX = -player.dirX; myObject['enemy' + v1].clip._xscale = myObject['enemy' + v1].dirX * myObject['enemy' + v1].UNI_scale; myObject['enemy' + v1].clip._x = myObject['enemy' + v1].posX; myObject['enemy' + v1].clip._y = myObject['enemy' + v1].posY; moveShadow(myObject['enemy' + v1]); grabingKnock(); } } ++v1; } } } function checkBarrelPush(ob) { var v4 = true; var v1 = 1; while (v1 <= circleCounter) { if (myObject['circle' + v1].inGame) { if (Math.sqrt((myObject['circle' + v1].posX - ob.posX) * (myObject['circle' + v1].posX - ob.posX) + (myObject['circle' + v1].posY - ob.posY) * (myObject['circle' + v1].posY - ob.posY)) < 30) { if (ob.posX < myObject['circle' + v1].posX and ob.velX > 0 or ob.posX > myObject['circle' + v1].posX and ob.velX < 0) { var v3 = (ob.velX / Math.sqrt(ob.velX * ob.velX)) * 2.5; if (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(myObject['circle' + v1].posX + camPos.difX + v3, myObject['circle' + v1].posY + camPos.difY - myObject['circle' + v1].radius, true)) { myObject['circle' + v1].posX += v3; } myObject['circle' + v1].velX = 0; if (myObject['circle' + v1].clip._currentFrame == 2) { myObject['circle' + v1].clip._rotation += (ob.velX / Math.sqrt(ob.velX * ob.velX)) * 2; if (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(myObject['circle' + v1].posX + camPos.difX - ob.dirX, myObject['circle' + v1].posY + camPos.difY - myObject['circle' + v1].radius, true)) { myObject['circle' + v1].posX -= ob.dirX; } myObject['circle' + v1].velX = ob.dirX; } myObject['circle' + v1].inMove = true; return true; } } else { if (TutorialGuide[7] <= 3) { if (facingOb(player, myObject['circle' + v1]) and !myObject['circle' + v1].inMove and Math.sqrt((myObject['circle' + v1].posX - player.posX) * (myObject['circle' + v1].posX - player.posX) + (myObject['circle' + v1].posY - player.posY) * (myObject['circle' + v1].posY - player.posY)) < 50) { v4 = false; showTutorialGuide(6); } } } } ++v1; } if (TG.traceAction == 'barrelNear' and v4) { fadeTutorialGuide(); } return false; } function dropBarrel() { if (TG.traceAction == 'barrelThrow') { fadeTutorialGuide(); } var v1 = player.isCarringBarrel; myObject['circle' + v1].posX = player.posX + player.dirX * 30; myObject['circle' + v1].posY = player.posY - 25; myObject['circle' + v1].velY = -1; myObject['circle' + v1].velX = 0; myObject['circle' + v1].inMove = true; player.isHoldingBarrel = false; player.isThrowingBarrel = false; player.clip.gotoAndStop('idle'); myObject['circle' + v1].clip.gotoAndStop(1); myObject['circle' + v1].clip._rotation = 0; myObject['circle' + v1].clip._x = myObject['circle' + v1].posX; myObject['circle' + v1].clip._y = myObject['circle' + v1].posY - myObject['circle' + v1].radius; player.isCarringBarrel = 0; } function barrelAway() { if (TG.traceAction == 'barrelThrow') { fadeTutorialGuide(); } if (TG.traceAction == 'grab') { fadeTutorialGuide(); } if (player.holdingEnemy > 0) { myObject['enemy' + player.holdingEnemy].clip.swapDepths(myObject['enemy' + player.holdingEnemy].oldDepth); myObject['enemy' + player.holdingEnemy].velX = 0; myObject['enemy' + player.holdingEnemy].velY = 0; myObject['enemy' + player.holdingEnemy].posY += 15; myObject['enemy' + player.holdingEnemy].pickedup = true; if (myObject['enemy' + player.holdingEnemy].life <= 0) { myObject['enemy' + player.holdingEnemy].life = 1; } myObject['enemy' + player.holdingEnemy].inGame = true; player.isThrowingEnemy = true; startFlyingEnemy(myObject['enemy' + player.holdingEnemy], player.dirX * 9, -3); myObject['enemy' + player.holdingEnemy].pickedup = false; } else { player.barrelThrowed = true; myObject['circle' + player.isCarringBarrel].velY = -2; myObject['circle' + player.isCarringBarrel].velX = player.dirX * 14; myObject['circle' + player.isCarringBarrel].inMove = true; } } function barrelThrowFinished() { if (TG.traceAction == 'barrelThrow') { fadeTutorialGuide(); } if (TG.traceAction == 'grab') { fadeTutorialGuide(); } player.holdingEnemy = 0; player.isThrowingEnemy = false; player.barrelThrowed = false; player.isHoldingBarrel = false; player.isThrowingBarrel = false; player.isCarringBarrel = 0; player.clip.gotoAndStop('idle'); } function pickupBarrel() { if (player.isThrowingEnemy) { myObject['enemy' + player.holdingEnemy].posX = player.posX + player.clip.mc.barrel_marker._x * player.dirX; myObject['enemy' + player.holdingEnemy].posY = player.posY + player.clip.mc.barrel_marker._y; myObject['enemy' + player.holdingEnemy].clip._x = myObject['enemy' + player.holdingEnemy].posX; myObject['enemy' + player.holdingEnemy].clip._y = myObject['enemy' + player.holdingEnemy].posY; myObject['enemy' + player.holdingEnemy].clip.gotoAndStop('eff_knockdown'); myObject['enemy' + player.holdingEnemy].clip.mc.gotoAndStop('knockdowned'); } else { if (player.stunTimer <= 0 and player.staggerTimer <= 0) { showTutorialGuide(7); if (checkRightPress()) { player.dirX = 1; player.clip._xscale = 100 * player.dirX; } else { if (checkLeftPress()) { player.dirX = -1; player.clip._xscale = 100 * player.dirX; } } player.isHoldingBarrel = true; myObject['circle' + player.isCarringBarrel].posX = player.posX + player.clip.mc.barrel_marker._x * player.dirX; myObject['circle' + player.isCarringBarrel].posY = player.posY + player.clip.mc.barrel_marker._y; myObject['circle' + player.isCarringBarrel].velX = 0; myObject['circle' + player.isCarringBarrel].velY = 0; myObject['circle' + player.isCarringBarrel].clip.gotoAndStop(2); myObject['circle' + player.isCarringBarrel].clip._x = myObject['circle' + player.isCarringBarrel].posX; myObject['circle' + player.isCarringBarrel].clip._y = myObject['circle' + player.isCarringBarrel].posY - myObject['circle' + player.isCarringBarrel].radius; myObject['circle' + player.isCarringBarrel].inMove = false; moveShadow(myObject['circle' + player.isCarringBarrel]); } else { dropBarrel(); } } } function checkBarrelPickup(ob) { var v1 = 1; while (v1 <= enemyCounter) { if (!myObject['enemy' + v1].finishingDone and facingOb(player, myObject['enemy' + v1]) and myObject['enemy' + v1].knockdownTimer <= 0 and !myObject['enemy' + v1].isFalling and myObject['enemy' + v1].inGame) { var v3 = -30; if (Math.sqrt((myObject['enemy' + v1].posX - ob.posX) * (myObject['enemy' + v1].posX - ob.posX) + (myObject['enemy' + v1].posY + v3 - ob.posY) * (myObject['enemy' + v1].posY + v3 - ob.posY)) < 55) { return false; } } ++v1; } v1 = 1; while (v1 <= circleCounter) { if (Math.sqrt((myObject['circle' + v1].posX - ob.posX) * (myObject['circle' + v1].posX - ob.posX)) <= 45 and Math.sqrt((myObject['circle' + v1].posY - 15 - ob.posY) * (myObject['circle' + v1].posY - 15 - ob.posY)) <= 25) { if (myObject['circle' + v1].clip._x != undefined and (ob.posX < myObject['circle' + v1].posX and ob.dirX > 0) or ob.posX > myObject['circle' + v1].posX and ob.dirX < 0) { myObject['circle' + v1].velX = 0; myObject['circle' + v1].velY = 0; if (myObject['circle' + v1].life < 5) { myObject['circle' + v1].life = 5; } player.isCarringBarrel = v1; return true; } } ++v1; } return false; } function movePlayerXAxis() { var v5 = player.posX; var v1 = 0; var v4 = false; player.canPerformStrongRun = true; v1 = player.velX / Math.sqrt(player.velX * player.velX); if (v1 == 0) { textMessage('Error:GameFlow:xMovement:invalid for player (' + v1 + ')'); v1 = player.dirX; if (v1 == 0) { textMessage('Error:GameFlow:xMovement_secondLayer:invalid for player (' + v1 + ')'); v1 = 1; player.dirX = 1; } } if (player.staggerTimer <= 0 and !player.isKnockdowned) { player.dirX = v1; } if (checkBarrelPush(player)) { player.velX /= Math.sqrt(player.velX * player.velX); } var v3 = Math.sqrt(player.velX * player.velX); if (!player.isKnockdowned) { if (checkRightPress() and player.dirX == -1) { v3 *= 0.75; } else { if (checkLeftPress() and player.dirX == 1) { v3 *= 0.75; } else { if (player.isJumping) { if (checkRightPress() and player.dirX == 1) { v3 *= 1.2; } else { if (checkLeftPress() and player.dirX == -1) { v3 *= 1.2; } } } } } } var v2 = 0; while (v2 <= v3) { if (player.posX - 30 + v1 * 15 < camPos.minX or player.posX + 30 + v1 * 15 > camPos.maxX or theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX + v1 * 15, player.posY + camPos.difY - yCheckAxis, true) or theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX + v1 * 15, player.posY + camPos.difY, true) and player.isJumping or theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX + v1 * 15, player.posY + camPos.difY - 50, true)) { while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX + v1 * 15, player.posY + camPos.difY - yCheckAxis, true) or theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX + v1 * 15, player.posY + camPos.difY - 50, true)) { player.posX -= v1; } v4 = true; player.canPerformStrongRun = false; } else { if (!player.isJumping and player.isPreparingJump) { } else { player.posX += v1; } } ++v2; } if (!v4 or player.isJumping) { if (player.isJumping) { game.rootRotation = countToNumber(game.rootRotation, 1.5 * v1, 0.5); } else { game.rootZoom = countToNumber(game.rootZoom, 95, 0.6); if (player.staggerTimer > 0 or player.isKnockdowned) { game.rootRotation = countToNumber(game.rootRotation, player.dirX * -1.5, 0.5); } else { game.rootRotation = countToNumber(game.rootRotation, 0.5 * v1, 1); } } } if (!player.uncontrollable and !player.isPreparingJump and player.currentAttack == 0) { if (!v4) { player.clip.gotoAndStop('run'); } else { player.clip.gotoAndStop('idle'); } } player.clip._x = player.posX; player.clip._xscale = 100 * player.dirX; if (!game.lockCam) { if (game.stopCam == 0) { camPos.difX -= player.posX - v5; } camPos.virDifX -= player.posX - v5; } eatFood(); } function eatFood() { if (foodCounter > 0 and player.life < 100) { var v1 = 1; while (v1 <= foodCounter) { if (myObject['food' + v1].inGame) { var v3 = Math.sqrt((myObject['food' + v1].posX - player.posX) * (myObject['food' + v1].posX - player.posX)); var v2 = Math.sqrt((myObject['food' + v1].posY - player.posY) * (myObject['food' + v1].posY - player.posY)); if (v3 <= 10 and v2 <= 30) { myObject['food' + v1].clip.removeMovieClip(); myObject['food' + v1].inGame = false; updateHPRage(myObject['food' + v1].Healing, 0); addEffect('blood_s_02', player.posX, player.posY, 0, 0, 1); addSound('flesh_squishy_impact_hard1', 100, 0, 0); } } ++v1; } } } function movePlayerYAxis() { var v2 = player.posY; if (!player.isJumping) { game.rootZoom = countToNumber(game.rootZoom, 100, 0.4); } if (player.isJumping) { player.velY += game.gravity; player.posY += player.velY; if (player.velY < 0) { if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX + player.velX * player.dirX, player.posY - 50 + camPos.difY, true) or theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX - player.velX * player.dirX, player.posY - 50 + camPos.difY, true)) { while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX + player.velX * player.dirX, player.posY - 51 + camPos.difY, true) and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX - player.velX * player.dirX, player.posY - 51 + camPos.difY, true)) { player.posY += 0.1; } player.velY = 0; } } if (player.velY >= 0) { player.velY += (100 - player.velY) / 100; game.rootZoom = countToNumber(game.rootZoom, 100, 0.4); } else { game.rootZoom = countToNumber(game.rootZoom, 90, 0.4); } if (player.velY >= -4 and !player.isFalling) { player.isFalling = true; player.currentAttack = 0; if (key.spacePressed) { key.spacePower = 6; } if (Math.sqrt(player.velX * player.velX) < 1.5) { player.velX = player.dirX * 1.5; } if (player.staggerTimer > 0 or player.stunTimer > 0 or player.knockdownTimer > 0) { player.staggerTimer = 0; player.stunTimer = 0; startKnockdownPlayer(5); player.velX *= -1; } else { player.clip.mc.gotoAndPlay('fall'); } } if (player.isKnockdowned) { checkBarrelsToDestroy(player); player.clip.mc.gotoAndStop(1); } if (player.velY >= 0) { if (theWorld.backgroundNearLayer.currentLevel.deathpits.hitTest(player.posX + camPos.difX, player.posY + camPos.difY, true)) { gibPlayer(); } else { if (theWorld.backgroundNearLayer.currentLevel.deathgaps.hitTest(player.posX + camPos.difX, player.posY + camPos.difY, true)) { game.lockCam = true; game.initSat = 100; player.fallDeath = true; player.velX = 0; if (!game.levelFinished) { interfaceLayer.ratioFix.gotoAndStop('game_over'); } } else { if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX, player.posY + camPos.difY, true)) { if (enemiesToJumpKnock()) { setCameraShake(6, 9); } player.isJumping = false; player.isPreparingJump = false; player.isFalling = false; player.jumpAttackPerformed = false; while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX, player.posY + camPos.difY, true)) { player.posY -= 1; } player.posY += 1; while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX, player.posY + camPos.difY, true)) { player.posY -= 0.1; } setCameraShake(5, Math.sqrt(player.velY * player.velY) / 10); if (player.isKnockdowned) { addEffect_knockdownSmoke(player); player.knockdownTimer += 4; if (player.knockdownTimer <= 0) { player.knockdownTimer = 1; } if (game.fightingBoss <= 0) { if (player.velY > 3) { updateHPRage(-player.velY / 3, 0); } else { updateHPRage(-1, 0); } } player.velX = 0; player.velY = 0; player.clip.mc.play(); } else { addEffect_landSmoke(player); } } } } } player.clip._y = player.posY; if (!player.isPreparingJump and !player.isKnockdowned) { player.clip.gotoAndStop('idle'); } } else { if ((!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX - 5, player.posY + camPos.difY + 0.1, true) or theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX - 5, player.posY + camPos.difY, true)) and (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX + 5, player.posY + camPos.difY + 0.1, true) or theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX + 5, player.posY + camPos.difY, true))) { var v1 = 0; while (v1 <= yCheckAxis * 10 and (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX + 3, player.posY + camPos.difY, true) and !theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX - 3, player.posY + camPos.difY, true))) { player.posY += 0.1; v1 += 1; } if (v1 >= yCheckAxis * 10) { player.posY -= yCheckAxis; player.clip.gotoAndStop('jump'); player.clip.mc.gotoAndPlay('fall'); player.velY = 0; player.isPreparingJump = true; player.isJumping = true; player.velX /= 2; } v1 = 0; while (v1 <= yCheckAxis * 10 and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX, player.posY + camPos.difY, true)) { player.posY -= 0.1; v1 += 1; } if (v1 >= yCheckAxis * 10) { player.posY += yCheckAxis; } } } if (!game.lockCam) { if (Math.sqrt((player.posY - v2) * (player.posY - v2)) >= 1) { player.clip._y = player.posY; camPos.difY -= player.posY - v2; camPos.virDifY -= player.posY - v2; } else { player.posY = v2; } } } function finishingKnock() { var v1 = 1; while (v1 <= enemyCounter) { if (!myObject['enemy' + v1].isFalling and myObject['enemy' + v1].currAttack != 'jump' and !myObject['enemy' + v1].pickedup and myObject['enemy' + v1].inGame and myObject['enemy' + v1].immortal != true and myObject['enemy' + v1].knockdownTimer <= 0 and myObject['enemy' + v1].enemyType != 'Crow' and myObject['enemy' + v1].enemyType != 'BOSS') { var v3 = player.posX - myObject['enemy' + v1].posX; var v5 = Math.sqrt(v3 * v3); var v2 = player.posY - myObject['enemy' + v1].posY; var v4 = Math.sqrt(v2 * v2); if (v5 <= 51 and v4 <= 50) { myObject['enemy' + v1].staggerTimer += 5 + Math.floor(Math.random() * 4); } } ++v1; } } function grabingKnock() { var v1 = 1; while (v1 <= enemyCounter) { if (!myObject['enemy' + v1].isFalling and myObject['enemy' + v1].currAttack != 'jump' and !myObject['enemy' + v1].pickedup and myObject['enemy' + v1].inGame and myObject['enemy' + v1].immortal != true and myObject['enemy' + v1].knockdownTimer <= 0 and myObject['enemy' + v1].enemyType != 'Crow' and myObject['enemy' + v1].enemyType != 'BOSS') { var v3 = player.posX - myObject['enemy' + v1].posX; var v5 = Math.sqrt(v3 * v3); var v2 = player.posY - myObject['enemy' + v1].posY; var v4 = Math.sqrt(v2 * v2); if (v5 <= 51 and v4 <= 50) { myObject['enemy' + v1].staggerTimer += 7 + Math.floor(Math.random() * 3); } } ++v1; } } function enemiesToJumpKnock() { if (enemyCounter > 0 and player.velY >= 5) { var v9 = false; var v3 = new Array(); var v1 = 1; while (v1 <= enemyCounter) { if (myObject['enemy' + v1].inGame and myObject['enemy' + v1].immortal != true and myObject['enemy' + v1].knockdownTimer <= 0 and myObject['enemy' + v1].enemyType != 'Crow' and myObject['enemy' + v1].enemyType != 'BOSS') { var v5 = player.posX - myObject['enemy' + v1].posX; var v8 = Math.sqrt(v5 * v5); if (v8 <= 40) { var v4 = player.posY - myObject['enemy' + v1].posY; var v6 = Math.sqrt(v4 * v4); if (v6 < 25) { v3.push(v1); if (facingOb(player, myObject['enemy' + v1])) { v9 = true; } } } } ++v1; } if (v3.length >= 2 and v9 or v3.length >= 1 and player.isKnockdowned) { v8 = 0; var v7 = 0; var v2 = 0; while (v2 < v3.length) { addEnemyBlurry(myObject['enemy' + v3[v2]], 4, 5, 5); facePlayer(myObject['enemy' + v3[v2]]); v8 = Math.sqrt((myObject['enemy' + v3[v2]].posX - player.posX) * (myObject['enemy' + v3[v2]].posX - player.posX)); myObject['enemy' + v3[v2]].velX = 0; myObject['enemy' + v3[v2]].velY = 0; v7 = (v8 / 40) * 80; if (Math.random() * 100 <= v7) { myObject['enemy' + v3[v2]].staggerTimer = 12; } else { startFlyingEnemy(myObject['enemy' + v3[v2]], myObject['enemy' + v3[v2]].dirX * -4, -5); } ++v2; } addSound('bodyfall.wav', 80, 0, 0); return true; } } return false; } function addEnemyBlurry(ob, t1, xb, yb) { if (options.blurEffects) { ob.blurTimer = t1; addBlur(ob.clip, xb, yb); } } function gibPlayer() { if (!player.gibbed) { player.gibbed = true; player.immortal = true; updateHPRage(-999, -999); player.velY = 1; player.velX = 0; player.uncontrollable = true; if (!game.levelFinished) { interfaceLayer.ratioFix.gotoAndStop('game_over'); } if (player.clip._alpha != 0) { player.clip.gotoAndStop('idle'); player.clip._alpha = 0; player.shadowClip.removeMovieClip(); addSound('gib_0' + Math.round(Math.random() * 1 + 1) + '.wav', 100, 0, 0); addBloodstain(player.posX, player.posY - 30); addEffect('blood_gib_01', player.posX, player.posY - 25, 0, 3, 1); addPart('gib_part_human_', 3, player.posX, player.posY - 25, playerGibVelX, -5, true, false, 8, 5); } player.isJumping = false; player.deathInitiated = true; game.initSat = 100; } } function checkBarrelsToDestroy(ob) { if (ob.velY > 0) { var v1 = 1; while (v1 <= circleCounter) { if (Math.sqrt((myObject['circle' + v1].posX - ob.posX) * (myObject['circle' + v1].posX - ob.posX) + (myObject['circle' + v1].posY - myObject['circle' + v1].radius - (ob.posY - 0)) * (myObject['circle' + v1].posY - myObject['circle' + v1].radius - (ob.posY - 0))) < 30) { myObject['circle' + v1].life = 0; damageOb(myObject['circle' + v1], 10); } ++v1; } } } function endAttack() { if (player.performNextAttack) { player.currentAttack += 1; if (player.currentAttack > 3) { player.currentAttack = 0; } else { if (checkRightPress()) { player.dirX = 1; } else { if (checkLeftPress()) { player.dirX = -1; } } player.clip._xscale = 100 * player.dirX; player.clip.gotoAndStop(['att_f_' + player.currentAttack]); } } else { player.currentAttack = 0; } player.performNextAttack = false; } function setuncontrollable() { player.contesting = 0; player.doingHeadKnock = false; player.uncontrollable = true; player.currentAttack = 0; key.rightPressed = false; key.leftPressed = false; key.spacePressed = false; key.spaceTabbed = false; key.spacePower = 0; } function startParryPlayer() { addSound('parry_01.wav', 90, 0, 0); player.clip.gotoAndStop(['parry_' + Math.floor(Math.random() * 2 + 1)]); addEffect_sparks(player); player.parryTimer = player.clip.mc._totalFrames; setuncontrollable(); } function dropDaBarrelNow() { if (player.isCarringBarrel > 0 or player.isHoldingBarrel) { if (!player.barrelThrowed) { dropBarrel(); } else { barrelThrowFinished(); } if (TG.traceAction == 'barrelThrow') { fadeTutorialGuide(); } } } function startStunPlayer(time) { dropDaBarrelNow(); if (!player.deathInitiated) { dropEnemy(0, 0); player.contesting = 0; player.immortal = false; if (!player.isStunned) { player.velX = 0; player.stunTimer = time + player.staggerTimer; player.staggerTimer = 0; player.parryTimer = 0; player.isStunned = true; setuncontrollable(); if (player.isJumping) { startStaggerPlayer(10); } else { player.clip.gotoAndStop('eff_stun'); player.isPreparingJump = false; } } else { player.stunTimer += 2; if (player.stunTimer <= 0) { player.stunTimer = 1; } } } } function startStaggerPlayer(time) { if (player.skipNextStagger <= 0 and player.staggerTimer <= 0 or (player.isCarringBarrel > 0 or player.isHoldingBarrel)) { dropDaBarrelNow(); if (!player.deathInitiated and !player.immortal) { dropEnemy(0, 0); player.contesting = 0; if (!player.isKnockdowned) { if (player.staggerTimer <= 0) { player.staggerTimer = time + player.stunTimer; } else { player.staggerTimer += Math.round(time / 2); } player.skipNextStagger = 20; player.stunTimer = 0; player.parryTimer = 0; player.isStunned = false; player.velX = player.dirX * -1; setuncontrollable(); if (player.isJumping) { startKnockdownPlayer(5); } else { player.clip.gotoAndStop('eff_stagger'); player.isPreparingJump = false; } } else { player.knockdownTimer += 1; if (player.knockdownTimer <= 0) { player.knockdownTimer = 1; } } } } else { player.skipNextStagger -= 4; } } function startKnockdownPlayer(time) { dropDaBarrelNow(); player.attackLevel = 1; if (!player.deathInitiated) { dropEnemy(0, 0); player.contesting = 0; player.immortal = false; if (!player.isKnockdowned) { player.clip.gotoAndStop('eff_knockdown'); player.knockdownTimer = time + player.stunTimer + player.staggerTimer; player.stunTimer = 0; player.staggerTimer = 0; player.parryTimer = 0; player.isJumping = true; player.staggerTimer = 0; player.isKnockdowned = true; player.isFalling = true; setuncontrollable(); } else { player.knockdownTimer -= 1; if (player.knockdownTimer <= 0) { player.knockdownTimer = 1; } } } } function checkTimerEffects() { if (rollCameraYAxis != 0) { if (rollCameraYAxis > 0) { rollCameraYAxis -= 2; camPos.difY -= 2; camPos.virDifY -= 2; } else { if (rollCameraYAxis < 0) { rollCameraYAxis += 2; camPos.difY += 2; camPos.virDifY += 2; } } } if (game.initSat > 0) { game.initSat -= 4; setSaturation(theWorld, game.initSat / 100); } if (player.holdingEnemy > 0) { game.rootZoom = countToNumber(game.rootZoom, 135, 2); player.holdingEnemyTimer += 1; if (player.holdingEnemyTimer > 70) { myObject['enemy' + player.holdingEnemy].velX = 0; myObject['enemy' + player.holdingEnemy].velY = 0; dropEnemy(player.dirX * 3, -0.5); } } if (player.deathInitiated) { game.rootZoom = countToNumber(game.rootZoom, 130, 0.6); } if (player.finishingEnemy > 0) { game.rootZoom = countToNumber(game.rootZoom, 108, 1.2); } if (player.contesting > 0) { game.rootZoom = countToNumber(game.rootZoom, 140, 1.4); setCameraShake(2, 2); player.contestingTimer -= 1; if (myObject['enemy' + player.contesting].staggerTimer > 0 or myObject['enemy' + player.contesting].stunTimer > 0 or myObject['enemy' + player.contesting].knockdownTimer > 0 or myObject['enemy' + player.contesting].isFalling) { player.contestingTimer = 0; player.contestingPower = 1; } if (player.contestingTimer == 0 or player.contestingPower > 0) { if (TG.traceAction == 'contest') { fadeTutorialGuide(); } if (myObject['enemy' + player.contesting].currAttack == 'BOSS_waitForContestToEnd') { contest_sound.stop(); addSound('contest_end.wav', 45, 0, 0); if (player.contestingPower > 0) { myObject['enemy' + player.contesting].currAttack = 'initContestLoss'; player.clip.gotoAndStop('contest_win'); player.contestingTimer = -1; } else { myObject['enemy' + player.contesting].currAttack = 'initInstaGib'; setCameraShake(5, 10); game.rootZoom += 10; setuncontrollable(); player.knockdownTimer = 0; player.isKnockdowned = false; player.stunTimer = 0; player.isStunned = false; player.staggerTimer = 0; startStunPlayer(60); setuncontrollable(); } player.contesting = 0; } else { contest_sound.stop(); addSound('contest_end.wav', 45, 0, 0); myObject['enemy' + player.contesting].clip.swapDepths(myObject['enemy' + player.contesting].oldDepth); if (player.contestingPower > 0) { player.clip.gotoAndStop('contest_win'); player.contestingTimer = -1; updateHPRage(0, 100); myObject['enemy' + player.contesting].currAttack = 'eff_stagger'; myObject['enemy' + player.contesting].staggerTimer = 40 * ((101 - myObject['enemy' + player.contesting].UNI_staggerR) / 100); finishingKnock(); } else { if (player.contestingPower < 0) { setCameraShake(5, 10); game.rootZoom += 10; startStunPlayer(40); setuncontrollable(); } else { game.rootZoom += 10; player.immortal = false; myObject['enemy' + player.contesting].currAttack = 'eff_stagger'; myObject['enemy' + player.contesting].staggerTimer = 24 * ((101 - myObject['enemy' + player.contesting].UNI_staggerR) / 100); startStaggerPlayer(30); setuncontrollable(); } } player.contesting = 0; } } } if (player.parryTimer > 0) { player.parryTimer -= 1; if (player.parryTimer <= 0) { player.uncontrollable = false; player.clip.gotoAndStop('idle'); } } else { if (player.knockdownTimer > 0 and player.isKnockdowned and !player.isFalling) { player.knockdownTimer -= 1; if (player.knockdownTimer <= 0) { player.isKnockdowned = false; player.uncontrollable = false; player.clip.gotoAndStop('idle'); } if (player.clip.mc._currentFrame == 1) { player.clip.mc.play(); } } else { if (player.stunTimer > 0) { player.stunTimer -= 1; game.rootZoom = countToNumber(game.rootZoom, 110, 0.5); if (player.stunTimer <= 0) { player.isStunned = false; player.uncontrollable = false; player.clip.gotoAndStop('idle'); } } else { if (player.staggerTimer > 0) { player.staggerTimer -= 1; game.rootZoom = countToNumber(game.rootZoom, 103, 1.5); if (player.staggerTimer <= 0) { player.uncontrollable = false; player.velX = 0; } } } } } if (player.skipNextStagger > 0) { player.skipNextStagger -= 1; } } function startLevel(myLevel) { if (myLevel < 10) { theWorld.backgroundNearLayer.attachMovie(['level_0' + myLevel], 'currentLevel', 2); theWorld.foregroundLayer.attachMovie(['level_0' + myLevel + '_foreground'], 'currentLevel_foreground', 2); } else { theWorld.backgroundNearLayer.attachMovie(['level_' + myLevel], 'currentLevel', 2); theWorld.foregroundLayer.attachMovie(['level_' + myLevel + '_foreground'], 'currentLevel_foreground', 2); } bgFar.posX = theWorld.backgroundNearLayer.currentLevel.bg_far._x; bgFar.posY = theWorld.backgroundNearLayer.currentLevel.bg_far._y; } function spawnPlayer(myPoint) { theWorld.actorsLayer.attachMovie('Actor_PC', 'Actor_PC', 999); player.clip = theWorld.actorsLayer.Actor_PC; player.posX = 320; player.posY = 275; camFollow = player.clip; var v2 = player.posX; var v3 = player.posY; player.posX = myPoint._x; player.posY = myPoint._y; var v1 = 0; while (v1 <= 5000 and !theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX, player.posY + camPos.difY, true)) { player.posY += 0.1; v1 += 1; } if (v1 >= 5000) { textMessage('Error:GameFlow:No spawn for player on map ' + game.currentLevel); } player.clip._x = player.posX; player.clip._y = player.posY; player.clip.gotoAndStop('idle'); player.clip._xscale = 100 * player.dirX; camPos.difX -= player.posX - v2; camPos.difY -= player.posY - v3; camPos.virDifX = camPos.difX; camPos.virDifY = camPos.difY; player.clip._alpha = 100; addShadow(player); cameraMovement(game.rootZoom); player.knockdownTimer = 0; player.isKnockdowned = false; player.stunTimer = 0; player.isStunned = false; player.staggerTimer = 0; } function findEmptyObject(type, myCounter) { var v3 = 0; var v2 = 1; while (v2 <= _root[myCounter]) { if (!myObject[type + '' + v2].inGame and v3 == 0) { v3 = v2; } ++v2; } var v6 = 0; if (v3 == 0) { _root[myCounter] += 1; v6 = _root[myCounter]; return v6; } v6 = v3; delete myObject[type + '' + v6]; return v6; } function findString(startString, inString, endString) { var v1 = inString.indexOf(startString, 0); var v4 = inString.indexOf(endString, v1 + startString.length); var v3 = '0'; if (v1 >= 0 and v4 >= 0) { v3 = inString.substr(v1 + startString.length, v4 - v1 - startString.length); return v3; } if (startString != '/waveID-') { } return v3; } function spawnBarrelSkeletonAt(cordX, cordY) { xmarker._x = cordX; xmarker._y = cordY - 16; if (Math.random() * 100 <= 5) { var v1 = (player.posX - cordX) / Math.sqrt((player.posX - cordX) * (player.posX - cordX)); if (v1 == 0) { v1 = 1; } spawnEnemy(xmarker, 'SKELETON_BARREL', v1, 'nothing'); } } function spawnEnemy(myPoint, enemyAI, dirX, scriptEvent) { if (!player.startFromCheckpoint) { var v2 = getAI(enemyAI); var v1 = findEmptyObject('enemy', 'enemyCounter'); delete myObject['enemy' + v1]; if (v1 < 60) { myObject['enemy' + v1] = new myObject.emptyEnemy(); if (enemyAI == 'CROW_1') { theWorld.crowLayer.attachMovie(findString('/type-', v2, '/'), ['enemy' + v1], v1); myObject['enemy' + v1].clip = theWorld.crowLayer['enemy' + v1]; } else { theWorld.actorsLayer.attachMovie(findString('/type-', v2, '/'), ['enemy' + v1], v1); myObject['enemy' + v1].clip = theWorld.actorsLayer['enemy' + v1]; } myObject['enemy' + v1].clip._x = myPoint._x; myObject['enemy' + v1].clip._y = myPoint._y; myObject['enemy' + v1].dirX = dirX; myObject['enemy' + v1].posX = myPoint._x; myObject['enemy' + v1].posY = myPoint._y; myObject['enemy' + v1].clip._xscale = 100 * myObject['enemy' + v1].dirX; myObject['enemy' + v1].clip.gotoAndStop(1); myObject['enemy' + v1].AIType = findString('/AI-', v2, '/'); myObject['enemy' + v1].life = parseInt(findString('/HP-', v2, '/')); myObject['enemy' + v1].maxLife = myObject['enemy' + v1].life; myObject['enemy' + v1].barrelImmune = parseInt(findString('/barrelImmune-', v2, '/')); myObject['enemy' + v1].bloodType = findString('/bloodType-', v2, '/'); myObject['enemy' + v1].bloodStain = parseInt(findString('/bloodStain-', v2, '/')); myObject['enemy' + v1].instaJumpAtSpawn = parseInt(findString('/instaJump-', v2, '/')); if (findString('/type-', v2, '/') == 'Actor_SkeletonSwordsman') { if (myObject['enemy' + v1].instaJumpAtSpawn == 0) { myObject['enemy' + v1].immortal = true; myObject['enemy' + v1].barrelImmune = true; } } myObject['enemy' + v1].enemyValues = v2; getUni(myObject['enemy' + v1], findString('/uni-', v2, '/')); myObject['enemy' + v1].ID = v1; addShadow(myObject['enemy' + v1]); moveShadow(myObject['enemy' + v1]); if (parseInt(findString('/groundSpawn-', v2, '/')) == 1) { myObject['enemy' + v1].posY = myObject['enemy' + v1].shadowClip._y; } else { myObject['enemy' + v1].posY = myPoint._y; } myObject['enemy' + v1].clip._y = myObject['enemy' + v1].posY; myObject['enemy' + v1].HB_width = myObject['enemy' + v1].clip.hitBox._width / 2; myObject['enemy' + v1].HB_height = myObject['enemy' + v1].clip.hitBox._height / 2; myObject['enemy' + v1].HB_posY = myObject['enemy' + v1].clip.hitBox._y; var v3 = findString('/waveID-', scriptEvent, '/'); myObject['enemy' + v1].waveID = v3; if (v3 != '0' and v3 != gameEvent.waveID) { gameEvent.nextWaveTimer = 0; gameEvent.waveID = v3; gameEvent.nrLeftInWave = 1; gameEvent.onDeathRunScript = findString('/onDeathRunScript-', scriptEvent, '/'); convertEnemiesWaveID(); } else { if (v3 == gameEvent.waveID) { gameEvent.nrLeftInWave += 1; } else { if (gameEvent.waveID != 'none_0' and parseInt(findString('/dontCheckWaveID-', v2, '/')) != 1) { myObject['enemy' + v1].waveID = gameEvent.waveID; gameEvent.nrLeftInWave += 1; } } } if (myObject['enemy' + v1].nameID != 'none') { showUniqueSign(myObject['enemy' + v1]); } } else { textMessage('Caution: Enemy limit of 60 reached. Can\'t spawn more enemies.'); } } } function setNextWaveIDTimer(seconds) { convertEnemiesWaveID(); gameEvent.nextWaveTimer = seconds * 24; } function checkNextWaveIDTimer() { if (gameEvent.nextWaveTimer > 0) { gameEvent.nextWaveTimer -= 1; if (gameEvent.nextWaveTimer <= 0) { gameEvent.waveID = 'none_0'; theWorld.backgroundNearLayer.currentLevel[gameEvent.onDeathRunScript](); } } } function convertEnemiesWaveID() { if (gameEvent.waveID != 'none_0') { gameEvent.nrLeftInWave = 0; var v1 = 1; while (v1 <= enemyCounter) { if (myObject['enemy' + v1].inGame and myObject['enemy' + v1].deathScriptRun != true and myObject['enemy' + v1].enemyType != 'BOSS' and myObject['enemy' + v1].enemyType != 'Crow') { myObject['enemy' + v1].waveID = gameEvent.waveID; gameEvent.nrLeftInWave += 1; } ++v1; } } } function spawnFoodCrate(PosX, PosY, FoodType) { if (!player.startFromCheckpoint) { foodCrateCounter += 1; myObject['foodCrate' + foodCrateCounter] = new myObject.emptyFoodCrate(); theWorld.foodLayer.attachMovie('food_crate', 'food_crate_' + foodCrateCounter, foodCrateCounter); myObject['foodCrate' + foodCrateCounter].clip = theWorld.foodLayer['food_crate_' + foodCrateCounter]; myObject['foodCrate' + foodCrateCounter].posX = PosX; myObject['foodCrate' + foodCrateCounter].posY = PosY; myObject['foodCrate' + foodCrateCounter].clip._x = PosX; myObject['foodCrate' + foodCrateCounter].clip._y = PosY; myObject['foodCrate' + foodCrateCounter].FoodType = FoodType; } } function spawnFood(PosX, PosY, FoodType) { foodCounter += 1; myObject['food' + foodCounter] = new myObject.emptyFood(); theWorld.foodLayer2.attachMovie('food', 'food_' + foodCounter, foodCounter); myObject['food' + foodCounter].clip = theWorld.foodLayer2['food_' + foodCounter]; myObject['food' + foodCounter].posX = PosX; myObject['food' + foodCounter].posY = PosY; myObject['food' + foodCounter].clip._x = PosX; myObject['food' + foodCounter].clip._y = PosY; myObject['food' + foodCounter].FoodType = FoodType; myObject['food' + foodCounter].clip.gotoAndStop(FoodType); myObject['food' + foodCounter].Healing = 25; if (FoodType > 1) { myObject['food' + foodCounter].Healing = 100; } } function explosionAt(PosX, PosY) { addEffect('barrel_explosion', PosX, PosY - 20, 0, 2, 1); var v2 = 0; var v3 = 0; var v1 = 1; while (v1 <= enemyCounter) { if (myObject['enemy' + v1].inGame and (myObject['enemy' + v1].barrelImmune != 1 or myObject['enemy' + v1].enemyType == 'Crow')) { v2 = myObject['enemy' + v1].posX - PosX; var v6 = Math.sqrt(v2 * v2); var v7 = -30; if (myObject['enemy' + v1].knockdownTimer > 0) { v7 = -10; } if (myObject['enemy' + v1].enemyType == 'Crow') { v7 = -5; } v3 = myObject['enemy' + v1].posY + v7 - PosY; var v13 = Math.sqrt(v3 * v3); if (v13 <= 100) { if (v6 <= 110 and player.holdingEnemy == v1) { myObject['enemy' + player.holdingEnemy].knockdownTimer += 1; myObject['enemy' + player.holdingEnemy].pickedup = false; myObject['enemy' + player.holdingEnemy].clip.swapDepths(myObject['enemy' + player.holdingEnemy].oldDepth); player.isThrowingEnemy = false; player.doingHeadKnock = false; player.holdingEnemy = 0; if (TG.traceAction == 'grab') { fadeTutorialGuide(); } } if (myObject['enemy' + v1].enemyType == 'Crow') { myObject['enemy' + v1].life = 0; } else { if (v6 <= 60 and !myObject['enemy' + v1].isUNI) { gibEnemyYey(myObject['enemy' + v1]); } else { if (!myObject['enemy' + v1].isUNI and v6 <= 80 and myObject['enemy' + v1].knockdownTimer <= 0 and (myObject['enemy' + v1].canDropHead or myObject['enemy' + v1].canDropArm)) { if (myObject['enemy' + v1].canDropHead) { myObject['enemy' + v1].staggerTimer = 0; decapitateEnemy(myObject['enemy' + v1], 1); } else { cutArmEnemy(myObject['enemy' + i]); } } else { if (v6 <= 80 and !myObject['enemy' + v1].isUNI) { gibEnemyYey(myObject['enemy' + v1]); } else { if (v6 <= 120) { myObject['enemy' + v1].velX = 0; myObject['enemy' + v1].velY = 0; var v8 = ((myObject['enemy' + v1].posX - PosX) / Math.sqrt((myObject['enemy' + v1].posX - PosX) * (myObject['enemy' + v1].posX - PosX))) * 3; if (v8 == 0) { v8 = 1; } var v11 = myObject['enemy' + v1].UNI_knockdownR; myObject['enemy' + v1].UNI_knockdownR = 0; startFlyingEnemy(myObject['enemy' + v1], v8, -7); myObject['enemy' + v1].UNI_knockdownR = v11; myObject['enemy' + v1].life -= 40; if (myObject['enemy' + v1].nameID != 'none') { updateUniqueSign(myObject['enemy' + v1]); } } } } } } } } ++v1; } var i = 1; while (i <= arrowCounter) { if (myObject['arrow' + i].inGame) { v2 = myObject['arrow' + i].posX - PosX; v3 = myObject['arrow' + i].posY - PosY; var v10 = Math.sqrt(v2 * v2 + v3 * v3); if (v10 <= 150) { addEffect('matchwood', myObject['arrow' + i].posX, myObject['arrow' + i].posY, 0, 0, 1); addPart('arrow_part_', 1, myObject['arrow' + i].posX, myObject['arrow' + i].posY, player.dirX * 6, -2, false, false, 5, 5); addPart('arrow_head_', 1, myObject['arrow' + i].posX, myObject['arrow' + i].posY, myObject['arrow' + i].velX, -2, false, false, 2, 5); myObject['arrow' + i].inGame = false; removeMovieClip(myObject['arrow' + i].shadowClip); removeMovieClip(myObject['arrow' + i].clip); } } ++i; } var i = 1; while (i <= circleCounter) { if (myObject['circle' + i].inGame) { v2 = myObject['circle' + i].posX - PosX; v3 = myObject['circle' + i].posY - PosY; v10 = Math.sqrt(v2 * v2 + v3 * v3); if (v10 <= 80 and i == player.isCarringBarrel) { player.isHoldingBarrel = false; player.isThrowingBarrel = false; player.isCarringBarrel = 0; player.clip.gotoAndStop('idle'); } if (v10 <= 40) { damageOb(myObject['circle' + i], 9999); } else { if (v10 <= 80) { myObject['circle' + i].velX = 0; myObject['circle' + i].velY = 0; myObject['circle' + i].inMove = true; myObject['circle' + i].velY = -8; myObject['circle' + i].velX = (myObject['circle' + i].posX - PosX) * 0.1; } } } ++i; } var v4 = 1; while (v4 <= partCounter) { if (myObject['part' + v4].inGame) { v2 = myObject['part' + v4].posX - PosX; v3 = myObject['part' + v4].posY - PosY; v10 = Math.sqrt(v2 * v2 + v3 * v3); if (v10 <= 100) { var v12 = 1 - v10 / 100; myObject['part' + v4].velX += v2 * 0.1; myObject['part' + v4].velY -= 6 * v12 - 5; } } ++v4; } v2 = player.posX - PosX; if (v2 == 0) { v2 = 1; } v3 = player.posY - 25 - PosY; if (v3 == 0) { v3 = 1; } var v14 = Math.sqrt(v2 * v2 + v3 * v3); if (v14 <= 80) { player.attackLevel = 1; if (player.finishingEnemy > 0) { gibEnemyYey(myObject['enemy' + player.finishingEnemy]); } player.dirX = -v2 / Math.sqrt(v2 * v2); player.clip._xscale = player.dirX * 100; player.movementDisabled = false; player.knockdownTimer = 0; player.isKnockdowned = false; player.stunTimer = 0; player.isStunned = false; player.staggerTimer = 0; startStunPlayer(1); startKnockdownPlayer(5); player.velY = -6 - 6 * ((101 - v14) / 100); player.velX = -player.dirX * 6 * ((101 - v14) / 100); player.immortal = false; updateHPRage(-17 * ((101 - v14) / 100), 0); if (player.life <= 1) { gibPlayer(); } if (player.rage < 100) { player.clip.filters = null; } } if (v14 <= 690) { var v16 = v2 / Math.sqrt(v2 * v2); var v15 = 100 - (v14 / 700) * 100; addSound('barrel_explode.wav', v15, -v16 * (v14 / 700) * 100, 0); setCameraShake(0.08 * v15, 0.09 * v15); } } function checkGameEventOnDeath(ob) { if (ob.deathScriptRun != true) { ob.deathScriptRun = true; if (!player.deathInitiated and ob.enemyType != 'Crow') { player.nrOfKills += 1; } if (ob.enemyType == 'DARKCOPY') { changeBossPlateHP(0, 3); } if (ob.nameID != 'none') { hideUniqueSign(); } if (ob.waveID == gameEvent.waveID) { gameEvent.nrLeftInWave -= 1; if (gameEvent.nrLeftInWave <= 0) { gameEvent.waveID = 'none_0'; theWorld.backgroundNearLayer.currentLevel[gameEvent.onDeathRunScript](); } } } } function addDeadEnemy(ob, deathType) { ob.clip.filters = null; if (ob.deathBody) { deathObjects += 1; if (deathObjects > options.bodies and options.bodies > 0) { deathObjects = 1; } theWorld.deadEnemiesLayer.attachMovie([findString('/type-', ob.enemyValues, '/') + '_Death'], ['deathObject_' + deathObjects], deathObjects); if (theWorld.deadEnemiesLayer['deathObject_' + deathObjects] != undefined) { theWorld.deadEnemiesLayer['deathObject_' + deathObjects].gotoAndStop(deathType); theWorld.deadEnemiesLayer['deathObject_' + deathObjects]._x = ob.posX; theWorld.deadEnemiesLayer['deathObject_' + deathObjects]._y = ob.posY; theWorld.deadEnemiesLayer['deathObject_' + deathObjects]._xscale = ob.clip._xscale; theWorld.deadEnemiesLayer['deathObject_' + deathObjects]._yscale = ob.clip._yscale; changeColour(theWorld.deadEnemiesLayer['deathObject_' + deathObjects], ob.RGB_R1, ob.RGB_G1, ob.RGB_B1, ob.RGB_R2, ob.RGB_G2, ob.RGB_B2); } deleteEnemy(ob); } else { if (ob.enemyType != 'Crow') { if (ob.bloodStain == 1) { addBloodstain(ob.posX, ob.posY); } else { if (ob.bloodStain == 2) { addEffect(ob.bloodType, ob.posX, ob.posY + ob.HB_posY, 0, 3, 1); } else { if (ob.bloodStain == 3) { addEffect(ob.bloodType + '0' + Math.round(Math.random() * 1 + 1), ob.posX, ob.posY + ob.HB_posY, 0, 3, 1); } } } addEffect([findString('/type-', ob.enemyValues, '/') + '_Death'], ob.posX, ob.posY, 0, 0, ob.dirX); } } } function spawnBarrel(myPoint, barrelValues) { if (!player.startFromCheckpoint) { var v1 = findEmptyObject('circle', 'circleCounter'); if (v1 < 40) { myObject['circle' + v1] = new myObject.emptyCircle(); theWorld.objectsLayerBarrels.attachMovie('barrel', ['barrel' + v1], v1); myObject['circle' + v1].clip = theWorld.objectsLayerBarrels['barrel' + v1]; myObject['circle' + v1].clip._x = myPoint._x; myObject['circle' + v1].clip._y = myPoint._y - myObject['circle' + v1].radius; myObject['circle' + v1].posX = myPoint._x; myObject['circle' + v1].posY = myPoint._y; myObject['circle' + v1].ID = v1; myObject['circle' + v1].life = parseInt(findString('/HP-', barrelValues, '/')); if (myObject['circle' + v1].life > 50) { myObject['circle' + v1].life = 50; } if (parseInt(findString('/mustCheckExplosive-', barrelValues, '/')) == 1) { myObject['circle' + v1].explosive = parseInt(findString('/explosive-', barrelValues, '/')); } else { myObject['circle' + v1].explosive = 0; if (Math.random() * 100 <= 35) { myObject['circle' + v1].explosive = 1; } } addShadow(myObject['circle' + v1]); moveShadow(myObject['circle' + v1]); myObject['circle' + v1].clip._y = myObject['circle' + v1].posY - myObject['circle' + v1].radius; } else { textMessage('Caution: Barrel limit of 40 reached. Can\'t spawn more barrels.'); } if (player.rage >= 100 and myObject['circle' + v1].explosive == 1) { changeColour(myObject['circle' + v1].clip, 100, 80, 80, 0, 0, 0); } } } function countToNumber(myNumber, toNumber, countNumber) { if (myNumber > toNumber) { myNumber -= countNumber; if (myNumber < toNumber) { myNumber = toNumber; } } if (myNumber < toNumber) { myNumber += countNumber; if (myNumber > toNumber) { myNumber = toNumber; } } return myNumber; } function textMessage(myMessage) { if (myMessage != ' ' or myMessage != '') { if (cheatingActivated) { interfaceLayer.ratioFix.cheat_txt.htmlText = myMessage + '<br>'; } } } function groundAI(ob) { if (ob.currAttack == 'finishing') { ob.frameTimer -= 1; if (ob.frameTimer <= 0 or ob.frameTimer == undefined) { ob.clip.swapDepths(ob.oldDepth); ob.life = -1; if (ob.finishingType == 'finishing_1') { if (checkForLedge(ob, 130)) { ob.staggerTimer = 200; } else { ob.staggerTimer = 40; } ob.velX = player.dirX * 3; moveEnemyXAxis(ob); enemyUncontrollable(ob); } else { addDeadEnemy(ob, 'finishing_kd_1'); ob.inGame = false; enemyUncontrollable(ob); removeMovieClip(ob.shadowClip); ob.clip.filters = null; } } return true; return false; } if (ob.isFalling) { enemyUncontrollable(ob); enemyFalling(ob); return true; return false; } if (ob.knockdownTimer > 0) { addEntryInEncyclopedia('c_fmo'); enemyUncontrollable(ob); enemyKnockdowned(ob); return true; return false; } if (ob.stunTimer > 0) { enemyUncontrollable(ob); enemyStun(ob); return true; return false; } if (ob.staggerTimer > 0) { enemyUncontrollable(ob); enemyStagger(ob); return true; return false; } if (ob.currAttack == 'waitForPlayerToJump') { ob.waitTimer -= 1; if (ob.waitTimer <= 0) { ob.waitTimer = 8 + Math.floor(Math.random() * 5); var v2 = Math.sqrt((player.posY - ob.posY) * (player.posY - ob.posY)); if (v2 <= 90) { ob.currAttack = 'idle'; } } return true; } return false; } function aiSPEARMAN(ob) { if (groundAI(ob)) { } else { if (ob.currAttack == 'none') { ob.headDropType = 'head_spearorc'; ob.canDropHead = parseInt(findString('/CanDropHead-', ob.enemyValues, '/')); ob.canDropArm = parseInt(findString('/CanDropArm-', ob.enemyValues, '/')); ob.canBlock = parseInt(findString('/canBlock-', ob.enemyValues, '/')); ob.canParry = parseInt(findString('/canParry-', ob.enemyValues, '/')); ob.spearDmg = parseInt(findString('/SpearDmg-', ob.enemyValues, '/')); ob.currAttack = 'idle'; } else { if (ob.currAttack == 'throw_barrel') { ob.frameTimer -= 1; ob.attackTimer -= 1; if (ob.attackTimer == 0) { knockbackBarrels(ob); } if (ob.frameTimer <= 0) { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } else { if (ob.currAttack == 'jump') { enemyJumping(ob); } else { if (ob.currAttack == 'charge_loop') { var v3 = ob.dirX * parseInt(findString('/chargeSpeed-', ob.enemyValues, '/')); ob.velX = countToNumber(ob.velX, v3, 1); moveEnemyXAxis(ob); var v5 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); var v4 = Math.sqrt((ob.posY - player.posY) * (ob.posY - player.posY)); if (!ob.hurtPlayer and v5 < 50 and facingOb(ob, player) and v4 < 30 and !player.immortal) { ob.hurtPlayer = true; cleavePlayer(ob, 60, ob.spearDmg, false); player.dirX = -ob.dirX; } if (!facingOb(ob, player) and v5 > 150) { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } else { if (ob.currAttack == 'charge_start') { ob.hurtPlayer = false; ob.frameTimer -= 1; if (ob.frameTimer > 0) { if (!facingOb(ob, player)) { ob.velX = -ob.dirX; ob.dirX = -ob.dirX; } } else { ob.velX = 0; ob.currAttack = 'charge_loop'; ob.clip.gotoAndStop('charge_loop'); } } else { if (ob.currAttack == 'run') { facePlayer(ob); var v3 = ob.dirX * parseInt(findString('/speed-', ob.enemyValues, '/')); if (ob.velX < ob.dirX and ob.dirX == 1 or ob.velX > ob.dirX and ob.dirX == -1) { ob.velX = 0; } ob.velX = countToNumber(ob.velX, v3, 1); moveEnemyXAxis(ob); var v2 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); if (v2 < parseInt(findString('/runDist-', ob.enemyValues, '/'))) { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); ob.velX = 0; } else { if (ob.UNI_AI == 'CHARGE' or !player.isKnockdowned and Math.random() * 100 <= 8 and v2 < 270 and v2 > 80 and !player.immortal) { ob.currAttack = 'charge_start'; ob.clip.gotoAndStop('charge_start'); ob.frameTimer = ob.clip.mc._totalFrames; } } } else { if (ob.currAttack == 'attack') { ob.frameTimer -= 1; ob.attackTimer -= 1; if (ob.attackTimer == 0) { if (facingOb(ob, player) and !player.immorta) { var v5 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); var v4 = Math.sqrt((ob.posY - player.posY) * (ob.posY - player.posY)); if (v5 - 2 <= parseInt(findString('/runDist-', ob.enemyValues, '/')) and v4 <= 20) { addSound('kick_01.wav', 40, 0, 0); player.dirX = -ob.dirX; startStaggerPlayer(12 + Math.random() * 12); ob.currAttack = 'charge_start'; ob.clip.gotoAndStop('charge_start'); ob.frameTimer = ob.clip.mc._totalFrames; } } else { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } if (ob.frameTimer <= 0) { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } else { if (ob.currAttack == 'idle') { var v2 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); if (ob.seenPlayer or v2 <= parseInt(findString('/reactDist-', ob.enemyValues, '/'))) { ob.seenPlayer = true; facePlayer(ob); if (ob.UNI_AI == 'CHARGE') { ob.currAttack = 'charge_start'; ob.clip.gotoAndStop('charge_start'); ob.frameTimer = ob.clip.mc._totalFrames; } else { if (v2 > parseInt(findString('/runDist-', ob.enemyValues, '/'))) { ob.currAttack = 'run'; ob.clip.gotoAndStop('run'); } else { if (Math.random() * 100 <= parseInt(findString('/attChance-', ob.enemyValues, '/')) and !player.immortal) { var v4 = Math.sqrt((ob.posY - player.posY) * (ob.posY - player.posY)); if (v4 < 50) { startAttack(ob, 'attack'); } else { if (!player.isJumping) { if (player.posY - ob.posY > 0) { enemyJumps(ob, ob.dirX * 3, -5); } else { enemyJumps(ob, ob.dirX * 3, -11); } } } } } } } } } } } } } } } } } function aiSKELETON(ob) { if (ob.UNI_AI == 'MOLOSKEL') { ob.nextMoloIn -= 1; } if (ob.currAttack == 'waitForPlayerToJump') { ob.waitTimer -= 1; if (ob.waitTimer <= 0) { ob.waitTimer = 8 + Math.floor(Math.random() * 5); var v4 = Math.sqrt((player.posY - ob.posY) * (player.posY - ob.posY)); if (v4 <= 90) { ob.currAttack = 'idle'; } } } else { if (ob.currAttack != 'spawning') { ob.immortal = false; ob.barrelImmune = false; } } if (ob.isFalling) { enemyUncontrollable(ob); enemyFalling(ob); } else { if (ob.life <= 0) { ob.delayFinishingTimer -= 1; if (ob.delayFinishingTimer <= 0) { setScaleObTo(ob); addSound('skeleton_break_apart_0' + Math.round(Math.random() * 1 + 1) + '.wav', 70, 0, 0); addPart('gib_part_skel_', 3, ob.posX, ob.posY - 30, player.dirX * 4, -3, false, false, 12, 5); addDeadEnemy(ob, 'death_01'); setCameraShake(6, 4); deleteEnemy(ob); } } else { if (ob.currAttack == 'finishing') { ob.life = 0; if (ob.finishingType != 'finishing_kd_2') { ob.delayFinishingTimer = 7; player.clip.gotoAndStop('finishing_0'); } else { ob.delayFinishingTimer = 70; } } else { if (ob.knockdownTimer > 0) { enemyUncontrollable(ob); enemyKnockdowned(ob); } else { if (ob.stunTimer > 0) { enemyUncontrollable(ob); enemyStun(ob); } else { if (ob.staggerTimer > 0) { enemyUncontrollable(ob); enemyStagger(ob); } else { if (ob.currAttack == 'throw_barrel') { ob.frameTimer -= 1; ob.attackTimer -= 1; if (ob.attackTimer == 0) { knockbackBarrels(ob); } if (ob.frameTimer <= 0) { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } else { if (ob.currAttack == 'none') { ob.checkIfGoIntoIdle = 4 + Math.round(Math.random() * 23); ob.idleWaitTimer = 0; ob.enemyType = 'Skeleton'; ob.canDropHead = parseInt(findString('/CanDropHead-', ob.enemyValues, '/')); ob.canDropArm = parseInt(findString('/CanDropArm-', ob.enemyValues, '/')); ob.canBlock = parseInt(findString('/canBlock-', ob.enemyValues, '/')); ob.canParry = parseInt(findString('/canParry-', ob.enemyValues, '/')); ob.runDistToPlayer = parseInt(findString('/runDist-', ob.enemyValues, '/')); ob.delayFinishingTimer = 0; ob.deathBody = false; ob.immortal = true; ob.barrelImmune = true; ob.currAttack = 'spawning'; ob.clip.gotoAndStop('spawn'); ob.frameTimer = ob.clip.mc._totalFrames; addEffect_landSmoke(ob); if (ob.instaJumpAtSpawn == 1) { ob.immortal = false; ob.barrelImmune = false; enemyJumps(ob, ob.dirX * 5, -7); } if (ob.instaJumpAtSpawn == 2) { ob.immortal = false; ob.barrelImmune = false; enemyJumps(ob, ob.dirX * 1, -2); } } else { if (ob.currAttack == 'spawning') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { ob.immortal = false; ob.barrelImmune = false; ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; } } else { if (ob.currAttack == 'throwingMolo') { ob.attackTimer -= 1; if (ob.attackTimer == 0) { throwMoloAtPlayer(ob); } ob.frameTimer -= 1; if (ob.frameTimer <= 0) { ob.immortal = false; ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; } } else { if (ob.currAttack == 'idle') { if (ob.nextMoloIn <= 0 and ob.UNI_AI == 'MOLOSKEL') { ob.nextMoloIn = 72; ob.immortal = true; ob.clip.gotoAndStop('attack_1'); getAttackFrame(ob); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'throwingMolo'; } else { if (ob.idleWaitTimer > 0) { ob.idleWaitTimer -= 1; } else { var v2 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); if (ob.seenPlayer or v2 <= parseInt(findString('/reactDist-', ob.enemyValues, '/'))) { ob.seenPlayer = true; facePlayer(ob); if (v2 > ob.runDistToPlayer) { ob.currAttack = 'run'; ob.clip.gotoAndStop('run'); } else { if (Math.random() * 100 <= parseInt(findString('/attChance-', ob.enemyValues, '/')) and !player.immortal) { var v4 = Math.sqrt((ob.posY - player.posY) * (ob.posY - player.posY)); if (v4 < 50) { startAttack(ob, 'attack_1'); } else { if (!player.isJumping) { if (player.posY - ob.posY > 0) { enemyJumps(ob, ob.dirX * 3, -5); } else { enemyJumps(ob, ob.dirX * 3, -11); } } } } } } } } } else { if (ob.currAttack == 'run') { facePlayer(ob); var v3 = ob.dirX * parseInt(findString('/speed-', ob.enemyValues, '/')); if (ob.velX < ob.dirX and ob.dirX == 1 or ob.velX > ob.dirX and ob.dirX == -1) { ob.velX = 0; } ob.velX = countToNumber(ob.velX, v3, 1); moveEnemyXAxis(ob); var v2 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); if (v2 < ob.runDistToPlayer) { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); ob.velX = 0; } else { if (ob.checkIfGoIntoIdle <= 0) { if (Math.random() * 100 <= 15 and v2 > ob.runDistToPlayer * 2) { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); ob.idleWaitTimer = Math.random() * 24 + 24; ob.checkIfGoIntoIdle = 120; } else { ob.checkIfGoIntoIdle = 24; } } else { ob.checkIfGoIntoIdle -= 1; if (ob.nextMoloIn <= 0 and ob.UNI_AI == 'MOLOSKEL') { ob.nextMoloIn = 72; ob.immortal = true; ob.clip.gotoAndStop('attack_1'); getAttackFrame(ob); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'throwingMolo'; } } } } else { if (ob.currAttack == 'attack_1') { ob.frameTimer -= 1; checkAttack(ob, parseInt(findString('/attRange1-', ob.enemyValues, '/')), parseInt(findString('/attDmg1-', ob.enemyValues, '/')), true); if (ob.frameTimer <= 0) { facePlayer(ob); startAttack(ob, 'attack_2'); } } else { if (ob.currAttack == 'attack_2') { ob.frameTimer -= 1; checkAttack(ob, parseInt(findString('/attRange2-', ob.enemyValues, '/')), parseInt(findString('/attDmg2-', ob.enemyValues, '/')), true); if (ob.frameTimer <= 0) { if (ob.attacksPlayerParried >= 3) { ob.attacksPlayerParried = 0; startAttack(ob, 'attack_strong'); } else { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } } else { if (ob.currAttack == 'attack_strong') { ob.frameTimer -= 1; checkAttack(ob, parseInt(findString('/attRange1-', ob.enemyValues, '/')), parseInt(findString('/att_strongDmg-', ob.enemyValues, '/')), false); if (ob.frameTimer <= 0) { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } else { if (ob.currAttack == 'blocking') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { if (ob.blocksPerformed >= 3) { ob.blocksPerformed = 0; startAttack(ob, 'attack_1'); } else { ob.frameTimer = 0; ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } } else { if (ob.currAttack == 'contesting') { if (!player.immortal) { startAttack(ob, 'attack_1'); } else { setEnemyPlayerPos(ob); } } else { if (ob.currAttack == 'jump') { enemyJumping(ob); } } } } } } } } } } } } } } } } } } } function aiCHAOSKNIGHTSWORD(ob) { if (ob.currAttack == 'waitForPlayerToJump') { ob.waitTimer -= 1; if (ob.waitTimer <= 0) { ob.waitTimer = 8 + Math.floor(Math.random() * 5); var v3 = Math.sqrt((player.posY - ob.posY) * (player.posY - ob.posY)); if (v3 <= 90) { ob.currAttack = 'idle'; } } } else { if (ob.currAttack == 'stagger_down_a_cliff') { ob.velX = -ob.dirX; ob.velY = 0; if (ob.armDropped) { ob.clip.gotoAndStop('death_stagger_armless'); } else { ob.clip.gotoAndStop('death_stagger'); } ob.bloodTimer_stagger_death -= 1; if (ob.bloodTimer_stagger_death <= 0) { if (ob.armDropped) { addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), ob.posX + ob.clip.blood._x * ob.dirX, ob.posY + ob.clip.blood._y, 0, 3, ob.dirX); } else { addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), ob.posX, ob.posY - 20, 0, 3, ob.dirX); } ob.bloodTimer_stagger_death = 8; } ob.velX = countToNumber(ob.velX, -ob.dirX * 1.5, 1); moveEnemyXAxis(ob); } else { if (ob.currAttack == 'knockdown_from_edge') { if (ob.armDropped) { ob.clip.gotoAndStop('death_knockdown_armless'); } else { ob.clip.gotoAndStop('eff_knockdown'); } ob.dirX = -ob.dirX; ob.isFalling = true; ob.velX = ob.dirX * 3; ob.velY = 0; ob.rotationSpeed = -ob.dirX; ob.posY -= 20; ob.clip._y = ob.posY; ob.currAttack = 'WaitForFalling'; } else { if (ob.currAttack == 'start_falling') { if (!ob.isFalling) { startFlyingEnemy(ob, ob.velX * 0.5, 0); } ob.clip.gotoAndStop('eff_knockdown'); ob.isFalling = true; ob.currAttack = 'WaitForFalling'; } else { if (ob.isFalling) { enemyUncontrollable(ob); enemyFalling(ob); } else { if (ob.currAttack == 'death_landed') { setScaleObTo(ob); addPart('gib_part_chaosknight_', 3, ob.posX, ob.posY + ob.HB_posY, 0, -6, false, false, 10, 5); addSound('fireburst.wav', 100, 0, 0); deleteEnemy(ob); } else { if (ob.currAttack == 'death_stagger') { ob.staggerTimer -= 1; ob.velX = -ob.dirX; ob.velY = 0; if (ob.armDropped) { ob.clip.gotoAndStop('death_stagger_armless'); } else { ob.clip.gotoAndStop('death_stagger'); } ob.bloodTimer_stagger_death -= 1; if (ob.bloodTimer_stagger_death <= 0) { addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), ob.posX, ob.posY - 20, 0, 3, ob.dirX); ob.bloodTimer_stagger_death = 8; } ob.velX = countToNumber(ob.velX, -ob.dirX * 1.5, 1); moveEnemyXAxis(ob); if (ob.staggerTimer <= 0) { ob.velY = 0; ob.velX = -ob.dirX; startFlyingEnemy(ob, 0, 0); ob.currAttack = 'doNothing_JustWait'; } } else { if (ob.currAttack == 'none') { ob.enemyType = 'ChaosKnight'; ob.armDropType = 'arm_chaosKnight'; ob.canDropHead = parseInt(findString('/CanDropHead-', ob.enemyValues, '/')); ob.canDropArm = parseInt(findString('/CanDropArm-', ob.enemyValues, '/')); ob.canBlock = parseInt(findString('/canBlock-', ob.enemyValues, '/')); ob.canParry = parseInt(findString('/canParry-', ob.enemyValues, '/')); ob.currAttack = 'idle'; } else { if (ob.life <= 0) { ob.delayFinishingTimer -= 1; if (ob.delayFinishingTimer <= 0) { if (ob.finishingType == 'finishing_1') { ob.currAttack = 'death_stagger'; } else { setScaleObTo(ob); addPart('gib_part_chaosknight_', 3, ob.posX, ob.posY + ob.HB_posY, player.dirX * 4, -6, false, false, 10, 5); addSound('fireburst.wav', 100, 0, 0); deleteEnemy(ob); } } } else { if (ob.currAttack == 'finishing') { ob.life = 0; ob.delayFinishingTimer = 7; if (ob.finishingType == 'finishing_1') { ob.delayFinishingTimer = 37; if (checkForLedge(ob, 130)) { ob.staggerTimer = 999; } else { ob.staggerTimer = 40; } ob.velX = player.dirX * 3; moveEnemyXAxis(ob); ob.currAttack = 'waitForLife'; } else { if (ob.finishingType == 'finishing_kd_1') { ob.delayFinishingTimer = 23; } } } else { if (ob.staggerTimer > 0) { enemyUncontrollable(ob); enemyStagger(ob); } else { if (ob.knockdownTimer > 0) { enemyUncontrollable(ob); enemyKnockdowned(ob); } else { if (ob.stunTimer > 0) { enemyUncontrollable(ob); enemyStun(ob); } else { if (ob.currAttack == 'blocking') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { if (ob.blocksPerformed >= 3) { ob.blocksPerformed = 0; startAttack(ob, 'attack_1'); } else { ob.frameTimer = 0; ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } } else { if (ob.currAttack == 'idle') { var v4 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); if (ob.seenPlayer or v4 <= parseInt(findString('/reactDist-', ob.enemyValues, '/'))) { ob.seenPlayer = true; facePlayer(ob); if (v4 > parseInt(findString('/runDist-', ob.enemyValues, '/'))) { ob.currAttack = 'run'; ob.clip.gotoAndStop('run'); } else { if (Math.random() * 100 <= parseInt(findString('/attChance-', ob.enemyValues, '/')) and !player.immortal) { var v3 = Math.sqrt((ob.posY - player.posY) * (ob.posY - player.posY)); if (v3 < 50) { startAttack(ob, 'attack_1'); } else { if (!player.isJumping) { if (player.posY - ob.posY > 0) { enemyJumps(ob, ob.dirX * 3, -5); } else { enemyJumps(ob, ob.dirX * 3, -11); } } } } } } } else { if (ob.currAttack == 'run') { facePlayer(ob); var v2 = ob.dirX * parseInt(findString('/speed-', ob.enemyValues, '/')); if (ob.velX < ob.dirX and ob.dirX == 1 or ob.velX > ob.dirX and ob.dirX == -1) { ob.velX = 0; } ob.velX = countToNumber(ob.velX, v2, 1); moveEnemyXAxis(ob); var v4 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); if (v4 < parseInt(findString('/runDist-', ob.enemyValues, '/'))) { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); ob.velX = 0; } } else { if (ob.currAttack == 'jump') { enemyJumping(ob); } else { if (ob.currAttack == 'throw_barrel') { ob.frameTimer -= 1; ob.attackTimer -= 1; if (ob.attackTimer == 0) { knockbackBarrels(ob); } if (ob.frameTimer <= 0) { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } else { if (ob.currAttack == 'attack_1') { ob.frameTimer -= 1; checkAttack(ob, parseInt(findString('/attRange1-', ob.enemyValues, '/')), parseInt(findString('/attDmg1-', ob.enemyValues, '/')), true); if (ob.frameTimer <= 0) { facePlayer(ob); startAttack(ob, 'attack_2'); } } else { if (ob.currAttack == 'attack_2') { ob.frameTimer -= 1; checkAttack(ob, parseInt(findString('/attRange2-', ob.enemyValues, '/')), parseInt(findString('/attDmg2-', ob.enemyValues, '/')), true); if (ob.frameTimer <= 0) { if (ob.attacksPlayerParried >= 3) { ob.attacksPlayerParried = 0; startAttack(ob, 'attack_strong'); } else { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } } else { if (ob.currAttack == 'attack_strong') { ob.frameTimer -= 1; checkAttack(ob, parseInt(findString('/attRange2-', ob.enemyValues, '/')), parseInt(findString('/att_strongDmg-', ob.enemyValues, '/')), false); if (ob.frameTimer <= 0) { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } else { if (ob.currAttack == 'contesting') { if (!player.immortal) { startAttack(ob, 'attack_1'); } else { setEnemyPlayerPos(ob); } } } } } } } } } } } } } } } } } } } } } } } } function aiCHAOSKNIGHTMACE(ob) { if (ob.UNI_AI == 'NECROMANCER') { ob.nextSummonIn -= 1; if (ob.nextSummonIn <= 0) { if (ob.currAttack == 'run') { ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; } } } if (ob.currAttack == 'waitForPlayerToJump') { ob.waitTimer -= 1; if (ob.waitTimer <= 0) { ob.waitTimer = 8 + Math.floor(Math.random() * 5); var v3 = Math.sqrt((player.posY - ob.posY) * (player.posY - ob.posY)); if (v3 <= 90) { ob.currAttack = 'idle'; } } } else { if (ob.currAttack == 'stagger_down_a_cliff') { ob.velX = -ob.dirX; ob.velY = 0; if (ob.armDropped) { ob.clip.gotoAndStop('death_stagger_armless'); } else { ob.clip.gotoAndStop('death_stagger'); } ob.bloodTimer_stagger_death -= 1; if (ob.bloodTimer_stagger_death <= 0) { if (ob.armDropped) { addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), ob.posX + ob.clip.blood._x * ob.dirX, ob.posY + ob.clip.blood._y, 0, 3, ob.dirX); } else { addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), ob.posX, ob.posY - 20, 0, 3, ob.dirX); } ob.bloodTimer_stagger_death = 8; } ob.velX = countToNumber(ob.velX, -ob.dirX * 1.5, 1); moveEnemyXAxis(ob); } else { if (ob.currAttack == 'knockdown_from_edge') { if (ob.armDropped) { ob.clip.gotoAndStop('death_knockdown_armless'); } else { ob.clip.gotoAndStop('eff_knockdown'); } ob.dirX = -ob.dirX; ob.isFalling = true; ob.velX = ob.dirX * 3; ob.velY = 0; ob.rotationSpeed = -ob.dirX; ob.posY -= 20; ob.clip._y = ob.posY; ob.currAttack = 'WaitForFalling'; } else { if (ob.currAttack == 'start_falling') { if (!ob.isFalling) { startFlyingEnemy(ob, ob.velX * 0.5, 0); } ob.isFalling = true; ob.currAttack = 'WaitForFalling'; } else { if (ob.isFalling) { enemyUncontrollable(ob); enemyFalling(ob); } else { if (ob.currAttack == 'death_landed') { setScaleObTo(ob); addPart('gib_part_chaosknight_', 3, ob.posX, ob.posY + ob.HB_posY, 0, -6, false, false, 10, 5); addSound('fireburst.wav', 100, 0, 0); deleteEnemy(ob); } else { if (ob.currAttack == 'death_stagger') { ob.staggerTimer -= 1; ob.velX = -ob.dirX; ob.velY = 0; if (ob.armDropped) { ob.clip.gotoAndStop('death_stagger_armless'); } else { ob.clip.gotoAndStop('death_stagger'); } ob.bloodTimer_stagger_death -= 1; if (ob.bloodTimer_stagger_death <= 0) { addEffect('blood_fire_0' + Math.round(Math.random() * 1 + 1), ob.posX, ob.posY - 20, 0, 3, ob.dirX); ob.bloodTimer_stagger_death = 8; } ob.velX = countToNumber(ob.velX, -ob.dirX * 1.5, 1); moveEnemyXAxis(ob); if (ob.staggerTimer <= 0) { ob.velY = 0; ob.velX = -ob.dirX; startFlyingEnemy(ob, 0, 0); ob.currAttack = 'WaitForFalling'; } } else { if (ob.currAttack == 'none') { ob.enemyType = 'ChaosKnight2'; ob.armDropType = 'arm_chaosKnight'; ob.canDropHead = parseInt(findString('/CanDropHead-', ob.enemyValues, '/')); ob.canDropArm = parseInt(findString('/CanDropArm-', ob.enemyValues, '/')); ob.canBlock = parseInt(findString('/canBlock-', ob.enemyValues, '/')); ob.canParry = parseInt(findString('/canParry-', ob.enemyValues, '/')); ob.currAttack = 'idle'; } else { if (ob.life <= 0) { ob.delayFinishingTimer -= 1; if (ob.delayFinishingTimer <= 0) { if (ob.finishingType == 'finishing_1') { ob.currAttack = 'death_stagger'; } else { setScaleObTo(ob); addPart('gib_part_chaosknight_', 3, ob.posX, ob.posY + ob.HB_posY, player.dirX * 4, -6, false, false, 10, 5); addSound('fireburst.wav', 100, 0, 0); deleteEnemy(ob); } } } else { if (ob.currAttack == 'finishing') { ob.life = 0; ob.delayFinishingTimer = 7; if (ob.finishingType == 'finishing_1') { ob.delayFinishingTimer = 37; if (checkForLedge(ob, 130)) { ob.staggerTimer = 999; } else { ob.staggerTimer = 40; } ob.velX = player.dirX * 3; moveEnemyXAxis(ob); ob.currAttack = 'waitForLife'; } else { if (ob.finishingType == 'finishing_kd_1') { ob.delayFinishingTimer = 23; } } } else { if (ob.staggerTimer > 0) { enemyUncontrollable(ob); enemyStagger(ob); } else { if (ob.knockdownTimer > 0) { enemyUncontrollable(ob); enemyKnockdowned(ob); } else { if (ob.stunTimer > 0) { enemyUncontrollable(ob); enemyStun(ob); } else { if (ob.currAttack == 'blocking') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { if (ob.blocksPerformed >= 3) { ob.blocksPerformed = 0; startAttack(ob, 'attack_1'); } else { ob.frameTimer = 0; ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } } else { if (ob.currAttack == 'summonSkel') { ob.frameTimer -= 1; ob.attackTimer -= 1; if (ob.attackTimer == 0) { xmarker._x = ob.posX + ob.dirX * 25; xmarker._y = ob.posY - 15; spawnEnemy(xmarker, 'SKELETON_BARREL', ob.dirX, 'nothing'); } if (ob.frameTimer <= 0) { ob.immortal = false; ob.clip.filters = null; ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; } } else { if (ob.currAttack == 'idle') { if (ob.nextSummonIn <= 0 and ob.UNI_AI == 'NECROMANCER') { ob.nextSummonIn = 72; ob.immortal = true; ob.clip.filters = [myRageGlow]; ob.clip.gotoAndStop('attack_1'); getAttackFrame(ob); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'summonSkel'; } else { var v4 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); if (ob.seenPlayer or v4 <= parseInt(findString('/reactDist-', ob.enemyValues, '/'))) { ob.seenPlayer = true; facePlayer(ob); if (v4 > parseInt(findString('/runDist-', ob.enemyValues, '/'))) { ob.currAttack = 'run'; ob.clip.gotoAndStop('run'); } else { if (Math.random() * 100 <= parseInt(findString('/attChance-', ob.enemyValues, '/')) and !player.immortal) { var v3 = Math.sqrt((ob.posY - player.posY) * (ob.posY - player.posY)); if (v3 < 50) { startAttack(ob, 'attack_1'); } else { if (!player.isJumping) { if (player.posY - ob.posY > 0) { enemyJumps(ob, ob.dirX * 3, -5); } else { enemyJumps(ob, ob.dirX * 3, -11); } } } } } } } } else { if (ob.currAttack == 'run') { facePlayer(ob); var v2 = ob.dirX * parseInt(findString('/speed-', ob.enemyValues, '/')); if (ob.velX < ob.dirX and ob.dirX == 1 or ob.velX > ob.dirX and ob.dirX == -1) { ob.velX = 0; } ob.velX = countToNumber(ob.velX, v2, 1); moveEnemyXAxis(ob); var v4 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); if (v4 < parseInt(findString('/runDist-', ob.enemyValues, '/'))) { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); ob.velX = 0; } } else { if (ob.currAttack == 'jump') { enemyJumping(ob); } else { if (ob.currAttack == 'throw_barrel') { ob.frameTimer -= 1; ob.attackTimer -= 1; if (ob.attackTimer == 0) { knockbackBarrels(ob); } if (ob.frameTimer <= 0) { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } else { if (ob.currAttack == 'attack_1') { ob.frameTimer -= 1; checkAttack(ob, parseInt(findString('/attRange1-', ob.enemyValues, '/')), parseInt(findString('/attDmg1-', ob.enemyValues, '/')), true); if (ob.frameTimer <= 0) { if (ob.attacksPlayerParried >= 2) { ob.attacksPlayerParried = 0; startAttack(ob, 'attack_strong'); } else { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } } else { if (ob.currAttack == 'attack_strong') { ob.frameTimer -= 1; checkAttack(ob, parseInt(findString('/attRange1-', ob.enemyValues, '/')), parseInt(findString('/att_strongDmg-', ob.enemyValues, '/')), false); if (ob.frameTimer <= 0) { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } else { if (ob.currAttack == 'contesting') { if (!player.immortal) { startAttack(ob, 'attack_1'); } else { setEnemyPlayerPos(ob); } } } } } } } } } } } } } } } } } } } } } } } } function aiSWORDSMAN(ob) { if (groundAI(ob)) { } else { if (ob.currAttack == 'throw_barrel') { ob.frameTimer -= 1; ob.attackTimer -= 1; if (ob.attackTimer == 0) { knockbackBarrels(ob); } if (ob.frameTimer <= 0) { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } else { if (ob.currAttack == 'jump') { enemyJumping(ob); } else { if (ob.currAttack == 'blocking') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { if (ob.blocksPerformed >= 3) { ob.blocksPerformed = 0; startAttack(ob, 'attack_1'); } else { ob.frameTimer = 0; ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } } else { if (ob.currAttack == 'run') { facePlayer(ob); var v3 = ob.dirX * parseInt(findString('/speed-', ob.enemyValues, '/')); if (ob.velX < ob.dirX and ob.dirX == 1 or ob.velX > ob.dirX and ob.dirX == -1) { ob.velX = 0; } ob.velX = countToNumber(ob.velX, v3, 1); moveEnemyXAxis(ob); var v2 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); if (v2 < ob.runDistToPlayer) { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); ob.velX = 0; } else { if (ob.checkIfGoIntoIdle <= 0) { if (Math.random() * 100 <= 15 and v2 > ob.runDistToPlayer * 2) { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); ob.idleWaitTimer = Math.random() * 24 + 24; ob.checkIfGoIntoIdle = 120; } else { ob.checkIfGoIntoIdle = 24; } } else { ob.checkIfGoIntoIdle -= 1; } } } else { if (ob.currAttack == 'attack_1') { ob.frameTimer -= 1; checkAttack(ob, parseInt(findString('/attRange1-', ob.enemyValues, '/')), parseInt(findString('/attDmg1-', ob.enemyValues, '/')), true); if (ob.frameTimer <= 0) { facePlayer(ob); startAttack(ob, 'attack_2'); } } else { if (ob.currAttack == 'attack_2') { ob.frameTimer -= 1; checkAttack(ob, parseInt(findString('/attRange2-', ob.enemyValues, '/')), parseInt(findString('/attDmg2-', ob.enemyValues, '/')), true); if (ob.frameTimer <= 0) { if (ob.attacksPlayerParried >= 3) { ob.attacksPlayerParried = 0; startAttack(ob, 'attack_strong'); } else { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } } else { if (ob.currAttack == 'attack_strong') { ob.frameTimer -= 1; checkAttack(ob, parseInt(findString('/attRange2-', ob.enemyValues, '/')), parseInt(findString('/att_strongDmg-', ob.enemyValues, '/')), false); if (ob.frameTimer <= 0) { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } else { if (ob.currAttack == 'contesting') { if (!player.immortal) { startAttack(ob, 'attack_1'); } else { setEnemyPlayerPos(ob); } } else { if (ob.currAttack == 'idle') { if (ob.idleWaitTimer > 0) { ob.idleWaitTimer -= 1; } else { var v2 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); if (ob.seenPlayer or v2 <= parseInt(findString('/reactDist-', ob.enemyValues, '/'))) { ob.seenPlayer = true; facePlayer(ob); if (v2 > ob.runDistToPlayer) { ob.currAttack = 'run'; ob.clip.gotoAndStop('run'); } else { if (Math.random() * 100 <= parseInt(findString('/attChance-', ob.enemyValues, '/')) and !player.immortal) { var v4 = Math.sqrt((ob.posY - player.posY) * (ob.posY - player.posY)); if (v4 < 50) { if (ob.UNI_AI == 'STRONGATTACKS') { startAttack(ob, 'attack_strong'); } else { startAttack(ob, 'attack_1'); } } else { if (!player.isJumping) { if (player.posY - ob.posY > 0) { enemyJumps(ob, ob.dirX * 3, -5); } else { enemyJumps(ob, ob.dirX * 3, -11); } } } } } } } } else { if (ob.currAttack == 'none') { ob.checkIfGoIntoIdle = 4 + Math.round(Math.random() * 24); ob.idleWaitTimer = 0; ob.enemyType = 'orc_sword'; ob.headDropType = 'head_swordorc'; ob.armDropType = 'arm_swordorc'; ob.canDropHead = parseInt(findString('/CanDropHead-', ob.enemyValues, '/')); ob.canDropArm = parseInt(findString('/CanDropArm-', ob.enemyValues, '/')); ob.canBlock = parseInt(findString('/canBlock-', ob.enemyValues, '/')); ob.canParry = parseInt(findString('/canParry-', ob.enemyValues, '/')); ob.runDistToPlayer = parseInt(findString('/runDist-', ob.enemyValues, '/')); ob.currAttack = 'idle'; } } } } } } } } } } } } function aiARCHER(ob) { if (groundAI(ob)) { } else { if (ob.currAttack == 'none') { ob.headDropType = 'head_boworc'; ob.canDropHead = parseInt(findString('/CanDropHead-', ob.enemyValues, '/')); ob.canDropArm = parseInt(findString('/CanDropArm-', ob.enemyValues, '/')); ob.canBlock = parseInt(findString('/canBlock-', ob.enemyValues, '/')); ob.canParry = parseInt(findString('/canParry-', ob.enemyValues, '/')); ob.currAttack = 'idle'; } else { if (ob.currAttack == 'idle') { if (ob.posX + 30 > camPos.maxX or ob.posX - 30 < camPos.minX) { ob.currAttack = 'moveInsideScreen'; } else { if (!player.deathInitiated) { facePlayer(ob); var v10 = Math.sqrt((player.posX - ob.posX) * (player.posX - ob.posX)); if (v10 < parseInt(findString('/attRange-', ob.enemyValues, '/'))) { if (Math.random() * 100 <= 6 or v10 < 80 or ob.UNI_AI == 'RAPIDFIRE' or ob.UNI_AI == 'MULTIFIRE') { v10 = Math.sqrt((player.posX - ob.posX) * (player.posX - ob.posX)); var v6 = 700 - v10; var v11 = ((ob.posX - player.posX) / 700) * 100; addSound('bow_drawBack.wav', (v6 / 700) * 80, v11, 0); ob.clip.gotoAndStop('attack'); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'att_1'; if (ob.UNI_AI == 'RAPIDFIRE') { ob.frameTimer -= 8; } } } else { if (parseInt(findString('/static-', ob.enemyValues, '/')) == 0) { ob.currAttack = 'moveInsideScreen'; } } } } } else { if (ob.currAttack == 'throw_barrel') { knockbackBarrels(ob); ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } else { if (ob.currAttack == 'att_1') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { var v9 = Math.sqrt((player.posY - ob.posY) * (player.posY - ob.posY)); var v10 = Math.sqrt((player.posX - ob.posX) * (player.posX - ob.posX)); var v3 = v10 - v9; var v5 = (ob.posX - player.posX) / Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); var v2 = 0; var v7 = 1; if (ob.UNI_AI == 'MULTIFIRE') { v7 = 3; } var v4 = 1; while (v4 <= v7) { v2 = (v3 - v5 * player.velX * 5) / 31; if (v3 < 150) { v2 = (v3 - v5 * player.velX * (5 + v4) + 10) / 19; } else { if (v3 < 250) { v2 = ((v3 - v5 * player.velX * 10 + 10) / 21) * 0.9; } else { if (v3 < 400) { v2 = (v3 - v5 * player.velX * 10 - 50) / 20; } } } v2 += (Math.random() * v2 - v2 / 2) * 0.4; if (v2 < 4) { v2 = 4; } var v6 = 800 - v10; if (ob.UNI_AI == 'RAPIDFIRE') { releaseArrow(ob.posX, ob.posY - 30, 55 * ob.dirX, v2, 6, 'nothing'); } else { releaseArrow(ob.posX, ob.posY - 30, 55 * ob.dirX, v2, 2, 'nothing'); } ++v4; } ob.clip.gotoAndStop('attack_release'); var v11 = ((ob.posX - player.posX) / 700) * 100; addSound('swing_s_03.wav', (v6 / 800) * 50, v11, 0); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'att_2'; } } else { if (ob.currAttack == 'att_2') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; } } else { if (ob.currAttack == 'moveInsideScreen') { facePlayer(ob); ob.clip.gotoAndStop('run'); var v8 = parseInt(findString('/speed-', ob.enemyValues, '/')); ob.velX = ob.dirX * v8; moveEnemyXAxis(ob); if (ob.posX + 60 < camPos.maxX and ob.posX - 60 > camPos.minX) { var v10 = Math.sqrt((player.posX - ob.posX) * (player.posX - ob.posX)); if (v10 < parseInt(findString('/attRange-', ob.enemyValues, '/')) or parseInt(findString('/static-', ob.enemyValues, '/')) == 1) { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); ob.velX = 0; } } } else { if (ob.currAttack == 'jump') { enemyJumping(ob); } } } } } } } } } function throwMoloAtPlayer(ob) { var v5 = Math.sqrt((player.posY - ob.posY) * (player.posY - ob.posY)); var v6 = Math.sqrt((player.posX - ob.posX) * (player.posX - ob.posX)); var v3 = v6 - v5; var v4 = (ob.posX - player.posX) / Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); var v1 = 0; v1 = (v3 - v4 * player.velX * 5) / 31; if (v3 < 150) { v1 = (v3 - v4 * player.velX * (5 + i) + 10) / 19; } else { if (v3 < 250) { v1 = ((v3 - v4 * player.velX * 10 + 10) / 21) * 0.9; } else { if (v3 < 400) { v1 = (v3 - v4 * player.velX * 10 - 50) / 20; } } } v1 += (Math.random() * v1 - v1 / 2) * 0.4; if (v1 < 4) { v1 = 4; } releaseArrow(ob.posX, ob.posY - 30, 55 * ob.dirX, v1, 6, 'molo'); } function aiCROW(ob) { if (ob.knockdownTimer > 0) { ob.knockdownTimer = 0; ob.currAttack = 'liftoff_init'; } if (ob.stunTimer > 0) { ob.stunTimer = 0; ob.currAttack = 'liftoff_init'; } if (ob.staggerTimer > 0) { ob.staggerTimer = 0; ob.currAttack = 'liftoff_init'; } if (ob.life <= 0) { _root.attachMovie('xmarker', 'xmarker', 1); xmarker._x = player.posX; xmarker._y = player.posY - 280 - Math.random() * 50; spawnEnemy(xmarker, 'CROW_1', 1, 'nothing'); addBloodstain(ob.posX, ob.posY); addEffect('Actor_Crow_Death', ob.posX, ob.posY, 0, 0, 1); deleteEnemy(ob); } else { if (ob.isFalling) { ob.life = 0; } else { if (ob.currAttack == 'none') { ob.enemyType = 'Crow'; ob.deathScriptRun = true; ob.barrelImmune = 1; ob.canDropHead = 0; ob.canDropArm = 0; ob.flyingToPlayer = false; ob.peakOnCorpse = false; ob.canBlock = parseInt(findString('/canBlock-', ob.enemyValues, '/')); ob.canParry = parseInt(findString('/canParry-', ob.enemyValues, '/')); ob.deathBody = false; ob.shadowClip.removeMovieClip(); ob.speed = parseInt(findString('/speed-', ob.enemyValues, '/')); ob.speed_constant = ob.speed; ob.CS_max = 0; ob.CS = 0; var v7 = 1; while (theWorld.backgroundNearLayer.currentLevel['CS_' + v7]._x != undefined) { v7 += 1; } ob.CS_max = v7 - 1; ob.clip.gotoAndStop('soar'); ob.currAttack = 'followPlayer_init'; } else { if (!player.gibbed and player.deathInitiated and !ob.flyingToPlayer) { ob.CS_posX = player.posX + Math.random() * 20 - 10; ob.CS_posY = player.posY; ob.currAttack = 'flyToCS_init'; ob.peakOnCorpse = true; ob.flyingToPlayer = true; ob.speed += 5; } else { if (ob.currAttack == 'followPlayer_init') { ob.speed = ob.speed_constant; ob.dirX = (player.posX - ob.posX) / Math.sqrt((player.posX - ob.posX) * (player.posX - ob.posX)); ob.dirY = (player.posY - 230 - ob.posY) / Math.sqrt((player.posY - 230 - ob.posY) * (player.posY - 230 - ob.posY)); if (ob.dirY < 0) { ob.clip.gotoAndStop('flap'); } else { ob.clip.gotoAndStop('soar'); } ob.clip._rotation = ob.dirX * 10; ob.flyTimer = 12 + Math.round(Math.random() * 16 + 1); ob.currAttack = 'followPlayer'; } else { if (ob.currAttack == 'followPlayer') { var v9 = ob.dirX * ob.speed; if (ob.velX < v9) { ob.velX += 0.5; } else { if (ob.velX > v9) { ob.velX -= 0.5; } } var v11 = ob.dirY * ob.speed; if (ob.velY < v11) { ob.velY += 0.2; } else { if (ob.velY > v11) { ob.velY -= 0.5; } } ob.posX += ob.velX; ob.posY += ob.velY; while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) { ob.posY -= 1; } ob.clip._x = ob.posX; ob.clip._y = ob.posY; ob.flyTimer -= 1; if (ob.flyTimer <= 0) { ob.currAttack = 'followPlayer_init'; if (Math.sqrt((player.posX - ob.posX) * (player.posX - ob.posX)) < 40) { if (Math.random() * 100 <= 40) { var v6 = false; var v3 = 0; var v4 = 0; if (deathObjects > 0) { var v5 = 1; while (v5 <= 50) { if (!v6) { ob.CS = Math.round(Math.random() * (deathObjects - 1) + 1); v3 = theWorld.deadEnemiesLayer['deathObject_' + ob.CS]._x; v4 = Math.sqrt((player.posX - v3) * (player.posX - v3)); if (v4 <= 400 and v4 > 60) { ob.CS_posX = theWorld.deadEnemiesLayer['deathObject_' + ob.CS]._x + (Math.random() * 10 - 5); ob.CS_posY = theWorld.deadEnemiesLayer['deathObject_' + ob.CS]._y - 5; ob.currAttack = 'flyToCS_init'; ob.peakOnCorpse = true; v6 = true; v5 = 50; } } ++v5; } } if (!v6) { v5 = 1; while (v5 <= 30) { if (!v6) { ob.CS = Math.round(Math.random() * (ob.CS_max - 1) + 1); v3 = theWorld.backgroundNearLayer.currentLevel['CS_' + ob.CS]._x; v4 = Math.sqrt((player.posX - v3) * (player.posX - v3)); if (v4 <= 340 and v4 > 30) { ob.CS_posX = theWorld.backgroundNearLayer.currentLevel['CS_' + ob.CS]._x; ob.CS_posY = theWorld.backgroundNearLayer.currentLevel['CS_' + ob.CS]._y; ob.currAttack = 'flyToCS_init'; ob.peakOnCorpse = false; v6 = true; v5 = 30; } } ++v5; } } } } } } else { if (ob.currAttack == 'flyToCS_init') { ob.speed = ob.speed_constant; ob.dirX = (ob.CS_posX - ob.posX) / Math.sqrt((ob.CS_posX - ob.posX) * (ob.CS_posX - ob.posX)); ob.dirY = (ob.CS_posY - ob.posY) / Math.sqrt((ob.CS_posY - ob.posY) * (ob.CS_posY - ob.posY)); ob.flyTimer = 6 + Math.round(Math.random() * 8 + 1); ob.currAttack = 'flyToCS'; if (ob.dirY < 0) { ob.clip.gotoAndStop('flap'); ob.flyTimer = ob.clip.mc._totalFrames; } else { if (Math.random() * 100 <= 25) { ob.clip.gotoAndStop('flap'); ob.flyTimer = ob.clip.mc._totalFrames; } else { ob.clip.gotoAndStop('soar'); } } } else { if (ob.currAttack == 'flyToCS') { ob.clip._rotation = ob.dirX * ob.speed * 2; var v9 = ob.dirX * ob.speed; if (ob.velX < v9) { ob.velX += 0.2; } else { if (ob.velX > v9) { ob.velX -= 0.2; } } var v11 = ob.dirY * ob.speed; if (ob.velY < v11) { ob.velY += 0.2; } else { if (ob.velY > v11) { ob.velY -= 0.5; } } if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) { ob.velY = -0.2; } ob.posX += ob.velX; ob.posY += ob.velY; ob.clip._x = ob.posX; ob.clip._y = ob.posY; var v12 = Math.sqrt((ob.CS_posX - ob.posX) * (ob.CS_posX - ob.posX)); var v8 = Math.sqrt((ob.CS_posY - ob.posY) * (ob.CS_posY - ob.posY)); if (Math.sqrt(v12 * v12 + v8 * v8) <= 100) { ob.speed = Math.sqrt(v12 * v12 + v8 * v8) / 20; if (ob.speed < 1) { ob.speed = 1; } } ob.flyTimer -= 1; if (ob.flyTimer <= 0) { ob.currAttack = 'flyToCS_init'; } if (v12 <= 7 + Math.random() * 30 / 10 and v8 <= 3) { ob.velY = -3; ob.clip._rotation = 0; ob.clip.gotoAndStop('flap'); ob.currAttack = 'landing'; } v12 = Math.sqrt((player.posX - ob.posX) * (player.posX - ob.posX)); if (v12 > 340) { ob.currAttack = 'followPlayer_init'; } } else { if (ob.currAttack == 'landing') { ob.velY += game.gravity; ob.posY += ob.velY; ob.clip._y = ob.posY; moveShadow(ob); if (ob.velY >= 3) { ob.clip.gotoAndStop('idle'); ob.currAttack = 'landed'; ob.flyTimer = 0; } } else { if (ob.currAttack == 'landed') { if (Math.random() * 100 <= 10 and ob.peakOnCorpse) { ob.clip.gotoAndStop('peak'); } ob.flyTimer += 1; var v10 = Math.sqrt((player.posX - ob.posX) * (player.posX - ob.posX) + (player.posY - ob.posY) * (player.posY - ob.posY)); if (ob.flyTimer > 24 and v10 <= 80 and !ob.flyingToPlayer) { ob.clip.gotoAndStop('flap'); ob.dirY = -1; ob.velY = -3; ob.flyTimer = 24; ob.currAttack = 'liftoff'; ob.dirX = ((ob.CS_posX - ob.posX) / Math.sqrt((ob.CS_posX - ob.posX) * (ob.CS_posX - ob.posX))) * -1; ob.velX = ob.dirX * ob.speed * 1.2; } else { if (v10 > 420) { ob.currAttack = 'followPlayer_init'; } else { if (ob.flyTimer > 48) { if (Math.random() * 100 <= 15) { ob.currAttack = 'followPlayer_init'; } ob.flyTimer = 24; } } } } else { if (ob.currAttack == 'liftoff') { if (ob.velY > -6) { ob.velY -= 0.3; } ob.posX += ob.velX; ob.posY += ob.velY; ob.clip._x = ob.posX; ob.clip._y = ob.posY; ob.clip._rotation = ob.dirX * 14; ob.flyTimer -= 1; if (ob.flyTimer <= 0) { ob.currAttack = 'followPlayer_init'; } } else { if (ob.currAttack == 'liftoff_init') { ob.clip.gotoAndStop('flap'); ob.dirY = -1; ob.velY = -3; ob.flyTimer = 24; ob.currAttack = 'liftoff'; } } } } } } } } } } } } } function enemyAI() { player.hitSound = false; if (enemyCounter > 0) { var v2 = 1; while (v2 <= enemyCounter) { if (myObject['enemy' + v2].inGame) { if (myObject['enemy' + v2].blurTimer > 0) { myObject['enemy' + v2].blurTimer -= 1; if (myObject['enemy' + v2].blurTimer <= 0) { myObject['enemy' + v2].clip.filters = null; } } if (TutorialGuide[9] < 3) { if (myObject['enemy' + v2].knockdownTimer > 0) { checkKnockdownTutorial(myObject['enemy' + v2]); } } if (TutorialGuide[13] < 3) { if (myObject['enemy' + v2].stunTimer > 0) { checkStunTutorial(myObject['enemy' + v2]); } } _root['ai' + myObject['enemy' + v2].AIType](myObject['enemy' + v2]); checkObInGame(myObject['enemy' + v2]); if (myObject['enemy' + v2].posX == undefined or myObject['enemy' + v2].posY == undefined) { gibEnemyYey(myObject['enemy' + v2]); } } else { if (v2 == enemyCounter) { enemyCounter -= 1; } } ++v2; } } if (player.hitSound) { addSound('hitFlesh_0' + Math.floor(Math.random() * 2 + 1) + '.wav', 40, 0, 0); } } function setEnemyPlayerPos(ob) { var v2 = player.posX + player.clip.enemy._x * player.dirX * (ob.UNI_scale / 100) - ob.posX; ob.velX = v2; if (v2 != 0) { moveEnemyXAxis(ob); ob.clip._y = ob.posY; } } function startAttack(ob, attack) { ob.currAttack = attack; ob.clip.gotoAndStop(attack); getAttackFrame(ob); ob.frameTimer = ob.clip.mc._totalFrames; } function facePlayer(ob) { ob.dirX = (player.posX - ob.posX) / Math.sqrt((player.posX - ob.posX) * (player.posX - ob.posX)); if (ob.dirX != 1 and ob.dirX != -1) { ob.dirX = 1; } ob.clip._xscale = ob.UNI_scale * ob.dirX; } function aiCleaveBarrels(ob, range, damage) { if (circleCounter > 0) { var v1 = 1; while (v1 <= circleCounter) { if (myObject['circle' + v1].inGame) { var v4 = Math.sqrt((myObject['circle' + v1].posX - ob.posX) * (myObject['circle' + v1].posX - ob.posX)); var v3 = Math.sqrt((myObject['circle' + v1].posY - (ob.posY - ob.attackRangeY / 2)) * (myObject['circle' + v1].posY - (ob.posY - ob.attackRangeY / 2))); if (v3 <= 15 and v4 <= 60 and facingOb(ob, myObject['circle' + v1])) { myObject['circle' + v1].inMove = true; myObject['circle' + v1].velX += ob.dirX * damage / 10; addEffect('matchwood', myObject['circle' + v1].posX, myObject['circle' + v1].posY - 20, 0, 0, 1); damageOb(myObject['circle' + v1], damage); } } ++v1; } } } function checkIdlePlayer() { if (player.uncontrollable or player.currentAttack > 0 or player.isThrowingBarrel or player.isCarringBarrel > 0 or player.isPreparingJump or player.staggerTimer > 0 or player.stunTimer > 0 or player.knockdownTimer > 0 or player.finishingEnemy > 0) { return false; } else { return true; } } function knockbackBarrels(ob) { ob.barrelsKnocked += 1; var v1 = 1; while (v1 <= circleCounter) { if (Math.sqrt((myObject['circle' + v1].posX - ob.posX) * (myObject['circle' + v1].posX - ob.posX) + (myObject['circle' + v1].posY - ob.posY) * (myObject['circle' + v1].posY - ob.posY)) < 55) { if (facingOb(ob, myObject['circle' + v1])) { if (Math.sqrt((myObject['circle' + v1].posX - ob.posX) * (myObject['circle' + v1].posX - ob.posX)) > 15) { myObject['circle' + v1].posX = ob.posX + ob.dirX * 36; } myObject['circle' + v1].posY -= 2; myObject['circle' + v1].velY = -6; myObject['circle' + v1].velX = ob.dirX * 7; myObject['circle' + v1].inMove = true; damageOb(myObject['circle' + v1], 5); addSound('wood_crate_impact_hard2.wav', 30, 0, 0); } } ++v1; } } function cleavePlayer(ob, range, damage, blockable) { if (damage == undefined) { damage = 1; } else { if (damage >= 25) { damage = 3; } } if (!player.immortal) { var v3 = player.posY - ob.posY; var v4 = Math.sqrt((player.posX - ob.posX) * (player.posX - ob.posX)); var v5 = Math.sqrt(v3 * v3); if (v5 <= ob.attackRangeY and v4 <= range and facingOb(ob, player)) { ob.attacksMissedInRow = 0; if (player.holdingEnemy > 0 and facingOb(player, ob)) { if (myObject['enemy' + player.holdingEnemy].nameID == 'none') { myObject['enemy' + player.holdingEnemy].life = 0; } else { myObject['enemy' + player.holdingEnemy].life -= 5; } addEffect_Blood(myObject['enemy' + player.holdingEnemy].bloodType, myObject['enemy' + player.holdingEnemy].posX, myObject['enemy' + player.holdingEnemy].posY); player.hitSound = true; dropEnemy(player.dirX, 0); } else { if (v3 > -5 and blockable and checkIdlePlayer() and facingOb(player, ob)) { player.velX = 0; startParryPlayer(); ob.attacksPlayerParried += 1; } else { cleavingPlayer(ob, damage); } } } else { if (v4 > 100) { ob.attacksMissedInRow += 1; if (ob.attacksMissedInRow >= 5) { gibEnemyYey(ob); } } } } } function cleavingPlayer(ob, damage) { if (!player.immortal) { player.hitSound = true; dropEnemy(0, 0); if (!player.isKnockdowned) { player.dirX = -ob.dirX; player.clip._xscale = 100 * player.dirX; } addEffect_Blood(player.bloodType, player.posX, player.posY - 25); if (player.isJumping and Math.random() * 100 <= 50) { startStaggerPlayer(damage); } else { if (!player.isJumping) { if (ob.nameID != 'none') { startStaggerPlayer(damage + 6 + Math.floor(Math.random() * 6)); } else { startStaggerPlayer(damage); } } } if (Math.random() * 100 <= ob.stunChance) { startStunPlayer(24); } if (Math.random() * 100 <= ob.knockdownChance) { startKnockdownPlayer(24); } if (facingOb(ob, player)) { updateHPRage(-damage, damage); } else { updateHPRage(-damage, damage * 2); } } } function startFlyingEnemy(ob, velX, velY) { if (!ob.isFalling and !player.deathInitiated and ob.enemyType != 'BOSS' and ob.enemyType != 'Crow') { if (Math.random() * 100 >= ob.UNI_knockdownR and ob.currAttack != 'finishing' or ob.deathScriptRun or player.holdingEnemy == ob.ID) { ob.velX += velX; ob.velY += velY; ob.isFalling = true; ob.rotationSpeed = ob.dirX; if (ob.armDropped) { ob.clip.gotoAndStop('death_knockdown_armless'); } else { ob.clip.gotoAndStop('eff_knockdown'); } ob.clip.mc.gotoAndPlay(1); ob.posY -= 20; ob.clip._y = ob.posY; if (ob.enemyType == 'ChaosKnight2' or ob.enemyType == 'ChaosKnight') { ob.currAttack = 'start_falling'; } if (ob.deathScriptRun) { ob.life = 0.1; } } else { ob.staggerTimer = 0; ob.knockdownTimer = 0; ob.stunTimer = 0; ob.clip.gotoAndStop('jump'); } } } function checkAttack(ob, range, damage, blockable) { ob.attackTimer -= 1; if (ob.attackTimer == 0) { aiCleaveBarrels(ob, range, damage); cleavePlayer(ob, range, damage, blockable); } } function getAttackFrame(ob) { ob.clip.mc.gotoAndStop('attack'); ob.attackTimer = ob.clip.mc._currentFrame; ob.clip.mc.gotoAndPlay(1); } function startBlocking(ob) { ob.blocksPerformed += 1; addEffect_sparks(ob); if (ob.enemyType == 'DARKCOPY') { if (Math.random() * 100 <= 50) { ob.clip.gotoAndStop('block'); } else { ob.clip.gotoAndStop('block2'); } } else { ob.clip.gotoAndStop('block'); } ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'blocking'; ob.velX = player.dirX * 4; ob.velY = 0; moveEnemyXAxis(ob); } function enemyStun(ob) { ob.clip.gotoAndStop('eff_stun'); ob.stunTimer -= 1; if (ob.velX > 2) { ob.velX -= 2; moveEnemyXAxis(ob); } else { if (ob.velX < -2) { ob.velX += 2; moveEnemyXAxis(ob); } else { ob.velX = 0; } } if (ob.stunTimer <= 0) { ob.staggerTimer = 0; ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } function enemyStagger(ob) { ob.staggerTimer -= 1; ob.velX = -ob.dirX; ob.velY = 0; if (ob.life > 0) { ob.clip.gotoAndStop('eff_stagger'); } else { if (ob.armDropped) { ob.clip.gotoAndStop('death_stagger_armless'); ob.bloodTimer_stagger_death -= 1; if (ob.bloodTimer_stagger_death <= 0) { addEffect('blood_squirt', ob.posX + ob.clip.blood._x * ob.dirX, ob.posY + ob.clip.blood._y, 0, 0, ob.dirX * -1); addBloodstain(ob.posX, ob.posY - 15); ob.bloodTimer_stagger_death = 15; } } else { ob.clip.gotoAndStop('death_stagger'); ob.bloodTimer_stagger_death -= 1; if (ob.bloodTimer_stagger_death <= 0) { addEffect('blood_squirt', ob.posX, ob.posY - 20, 0, 0, ob.dirX); addBloodstain(ob.posX, ob.posY - 15); ob.bloodTimer_stagger_death = 15; } } } ob.velX = countToNumber(ob.velX, -ob.dirX * 1.5, 1); moveEnemyXAxis(ob); if (ob.staggerTimer <= 0) { if (ob.life <= 0) { ob.velY = 0; ob.velX = -ob.dirX; startFlyingEnemy(ob, 0, 0); } else { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } } function enemyKnockdowned(ob) { ob.knockdownTimer -= 1; if (ob.knockdownTimer <= 0) { ob.stunTimer = 0; ob.staggerTimer = 0; ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } function enemyUncontrollable(ob) { ob.attackTimer = 0; ob.currAttack = 'uncontrollable'; } function enemyJumping(ob) { ob.velY += game.gravity; ob.posX += ob.velX; if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX + ob.dirX * 15, ob.posY + camPos.difY - yCheckAxis, true)) { while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX + ob.dirX * 15, ob.posY + camPos.difY - yCheckAxis, true)) { ob.posX -= ob.dirX; } } ob.posY += ob.velY; if (ob.velY < 0) { if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY - 50 + camPos.difY, true)) { while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY - 50 + camPos.difY, true)) { ob.posY += 1; } ob.velY = 0; } } else { if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) { while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) { ob.posY -= 0.1; } ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); addEffect_landSmoke(ob); } } ob.clip._x = ob.posX; ob.clip._y = ob.posY; moveShadow(ob); checkDeathPit(ob); } function enemyJumps(ob, xPow, yPow) { if (ob.currAttack == 'charge_loop') { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } else { addEffect_jumpSmoke(ob); ob.currAttack = 'jump'; ob.clip.gotoAndStop('jump'); ob.velX = xPow; ob.velY = yPow; } } function checkJump(ob) { if (ob.currAttack != 'uncontrollable') { var v2 = Math.sqrt((player.posY - ob.posY) * (player.posY - ob.posY)); if (player.posX < ob.posX and v2 >= 100 and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX + ob.dirX * (60 + Math.random() * 35), ob.posY + camPos.difY - (yCheckAxis + 100), true)) { ob.waitTimer = 12; ob.clip.gotoAndStop('idle'); ob.currAttack = 'waitForPlayerToJump'; } else { if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX + ob.dirX * 25, ob.posY + camPos.difY - yCheckAxis, true)) { if (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX + ob.dirX * 25, ob.posY + camPos.difY - (yCheckAxis + 10), true)) { enemyJumps(ob, ob.dirX * 3, -6); } else { enemyJumps(ob, ob.dirX * 3, -11); } } else { if (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX + ob.dirX * 15, ob.posY + camPos.difY + yCheckAxis, true)) { if (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX + ob.dirX * 50, ob.posY + camPos.difY + 50, true)) { if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX + ob.dirX * 200, ob.posY + camPos.difY - 30, true)) { enemyJumps(ob, ob.dirX * 5, -11); } else { if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX + ob.dirX * 200, ob.posY + camPos.difY - 10, true)) { enemyJumps(ob, ob.dirX * 5, -10); } else { enemyJumps(ob, ob.dirX * 5, -8); } } } else { enemyJumps(ob, ob.dirX * 3, -5); } } } } } } function checkEnemiesToKnockdown(ob) { if ((getVel(ob) > 14 or Math.sqrt(ob.velX * ob.velX) > 3) and ob.velY > 0) { var v1 = 1; while (v1 <= enemyCounter) { if (!myObject['enemy' + v1].finishingDone and myObject['enemy' + v1].knockdownTimer <= 0 and !myObject['enemy' + v1].isFalling and myObject['enemy' + v1].inGame and ob.ID != v1 and !myObject['enemy' + v1].pickedup) { var v3 = -30; if (Math.sqrt((myObject['enemy' + v1].posX - ob.posX) * (myObject['enemy' + v1].posX - ob.posX) + (myObject['enemy' + v1].posY + v3 - ob.posY) * (myObject['enemy' + v1].posY + v3 - ob.posY)) < 30) { myObject['enemy' + v1].velY = 0; myObject['enemy' + v1].velX = 0; startFlyingEnemy(myObject['enemy' + v1], 0, 0); } } ++v1; } } } function enemyFalling(ob) { if (ob.life > 0) { ob.clip.gotoAndStop('eff_knockdown'); } else { if (ob.armDropped) { ob.clip.gotoAndStop('death_knockdown_armless'); ob.bloodTimer_stagger_death -= 1; if (ob.bloodTimer_stagger_death <= 0) { addEffect_Blood(ob.bloodType, ob.posX, ob.posY); if (Math.sqrt(ob.velX * ob.velX) > Math.sqrt(ob.dirX * ob.dirX)) { ob.velX -= ob.dirX; } ob.bloodTimer_stagger_death = 7; } } else { ob.clip.gotoAndStop('death_knockdown'); ob.bloodTimer_stagger_death -= 1; if (ob.bloodTimer_stagger_death <= 0) { addEffect_Blood(ob.bloodType, ob.posX, ob.posY); if (Math.sqrt(ob.velX * ob.velX) > Math.sqrt(ob.dirX * ob.dirX)) { ob.velX -= ob.dirX; } ob.bloodTimer_stagger_death = 7; } } } if (ob.enemyType == 'ChaosKnight' or ob.enemyType == 'ChaosKnight2') { ob.clip._rotation -= ob.rotationSpeed * 20; } else { ob.clip._rotation -= ob.dirX * 20; } ob.velY += game.gravity; if (ob.velY >= 0) { ob.velY += (100 - ob.velY) / 100; } checkBarrelsToDestroy(ob); checkEnemiesToKnockdown(ob); ob.posY += ob.velY; if (theWorld.backgroundNearLayer.currentLevel.deathgaps.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) { checkGameEventOnDeath(ob); } else { if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) { while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) { ob.posY -= 0.1; } ob.posY -= 0.5; ob.isFalling = false; ob.clip._rotation = 0; ob.knockdownTimer += 24; ob.knockdownTimer += ob.staggerTimer + ob.stunTimer; ob.knockdownTimer *= (101 - ob.UNI_knockdownR) / 100; ob.staggerTimer = 0; ob.stunTimer = 0; ob.velX = 0; if (!ob.armDropped) { ob.clip.gotoAndStop('eff_knockdown'); ob.clip.mc.gotoAndPlay('land'); } addEffect_knockdownSmoke(ob); if ((ob.enemyType == 'ChaosKnight' or ob.enemyType == 'ChaosKnight2') and ob.life <= 1) { ob.currAttack = 'death_landed'; ob.life = 0; } else { ob.life -= ob.velY; if (ob.life <= 1) { if (ob.enemyType == 'DARKCOPY') { checkGameEventOnDeath(ob); changeBossPlateHP(0, 2); gibEnemyYey(ob); } else { if (ob.armDropped) { addDeadEnemy(ob, 'death_land_armless'); } else { addDeadEnemy(ob, 'death_land'); } } } } } else { ob.posX += ob.velX; var v2 = ob.velX / Math.sqrt(ob.velX * ob.velX); if (v2 == 0) { textMessage('Error:GameFlow:xMovement:invalid for enemy (' + v2 + ')'); v2 = ob.dirX; if (v2 == 0) { textMessage('Error:GameFlow:xMovement_secondLayer:invalid for enemy (' + v2 + ')'); v2 = 1; ob.dirX = 1; } } if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX + v2 * 10, ob.posY - 5 + camPos.difY, true)) { ob.posX -= ob.velX; ob.velX *= -0.2; } } } ob.clip._y = ob.posY; ob.clip._x = ob.posX; moveShadow(ob); checkDeathPit(ob); } function gibEnemyYey(ob) { setScaleObTo(ob); if (ob.enemyType != 'BOSS') { if (findString('/gibPart-', ob.enemyValues, '/') == 'gib_part_skel_') { addSound('skeleton_break_apart_0' + Math.round(Math.random() * 1 + 1) + '.wav', 100, 0, 0); addPart(findString('/gibPart-', ob.enemyValues, '/'), 3, ob.posX, ob.posY - 20, gibVelXAxis, -6, false, false, 6, 5); addEffect('skel_blood', ob.posX, ob.posY - 10, 0, 3, 1); } else { if (findString('/gibPart-', ob.enemyValues, '/') == 'gib_part_chaosknight_') { addSound('gib_0' + Math.round(Math.random() * 1 + 1) + '.wav', 100, 0, 0); addPart(findString('/gibPart-', ob.enemyValues, '/'), 3, ob.posX, ob.posY - 20, gibVelXAxis, -6, false, false, 6, 5); addEffect('chaos_deathblood_link', ob.posX, ob.posY, 0, 3, 1); } else { if (ob.enemyType == 'Crow') { ob.life = 0; } else { addSound('gib_0' + Math.round(Math.random() * 1 + 1) + '.wav', 100, 0, 0); addPart(findString('/gibPart-', ob.enemyValues, '/'), 3, ob.posX, ob.posY - 20, gibVelXAxis, -6, true, false, 6, 5); addBloodstain(ob.posX, ob.posY - 20); addEffect('blood_gib_01', ob.posX, ob.posY - 10, 0, 3, 1); } } } if (ob.enemyType != 'Crow') { deleteEnemy(ob); } } } function checkDeathPit(ob) { if (theWorld.backgroundNearLayer.currentLevel.deathpits.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) { gibEnemyYey(ob); } } function deleteEnemy(ob) { checkGameEventOnDeath(ob); ob.posY = -9999; ob.posX = -9999; ob.inGame = false; removeMovieClip(ob.clip); removeMovieClip(ob.shadowClip); } function moveEnemyYAxis(ob) { var v2 = 0; var v3 = ob.posY; if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) { while (v2 <= yCheckAxis and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) { v2 += 1; ob.posY -= 1; } } else { while (v2 <= yCheckAxis and !theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) { v2 += 1; ob.posY += 1; } ob.posY -= 1; } if (v2 <= yCheckAxis) { ob.posY -= 0.5; while (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) { ob.posY += 0.1; } } else { if (ob.currAttack != 'finishing') { ob.posY = v3; if (ob.currAttack == 'contesting') { ob.velX = player.dirX; } if (ob.currAttack == 'blocking') { ob.staggerTimer = 10; } else { if (ob.enemyType == 'ChaosKnight' or ob.enemyType == 'ChaosKnight2') { if (!ob.isFalling) { ob.currAttack = 'knockdown_from_edge'; } else { ob.currAttack = 'start_falling'; } } else { startFlyingEnemy(ob, ob.velX, 0); } } } } ob.clip._y = ob.posY; fixShadow(ob); } function moveEnemyXAxis(ob) { if (ob.velX == 0) { textMessage('Error:AI:XAxisMovement:invalid value:velX=0'); } else { if (checkBarrelPush(ob) and ob.currAttack != 'finishing' and ob.barrelsKnocked < 10) { ob.velX /= Math.sqrt(ob.velX * ob.velX); if (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX + ob.dirX * 100, ob.posY + camPos.difY - 30, true) and ob.staggerTimer <= 0 and ob.life > 0) { ob.currAttack = 'throw_barrel'; ob.clip.gotoAndStop('throw_barrel'); getAttackFrame(ob); ob.frameTimer = ob.clip.mc._totalFrames; } } ob.posX += ob.velX; var v2 = ob.velX / Math.sqrt(ob.velX * ob.velX); if (v2 == 0) { textMessage('Error:GameFlow:xMovement:invalid for enemy (' + v2 + ')'); v2 = ob.dirX; ob.velX = 1; if (v2 == 0) { textMessage('Error:GameFlow:xMovement_secondLayer:invalid for enemy (' + v2 + ')'); v2 = 1; ob.dirX = 1; } } if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX + v2 * 15, ob.posY + camPos.difY - 30, true)) { while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX + v2 * 15, ob.posY + camPos.difY - 30, true)) { ob.posX -= v2; } } ob.clip._x = ob.posX; moveEnemyYAxis(ob); } checkJump(ob); } function releaseArrow(posX, posY, angle, power, damage, spec) { var v1 = findEmptyObject('arrow', 'arrowCounter'); myObject['arrow' + v1] = new myObject.emptyArrow(); if (spec == 'molo') { theWorld.objectsLayerArrows.attachMovie('arrow2', 'arrow' + v1, v1); } else { theWorld.objectsLayerArrows.attachMovie('arrow', 'arrow' + v1, v1); } myObject['arrow' + v1].clip = theWorld.objectsLayerArrows['arrow' + v1]; myObject['arrow' + v1].posX = posX; myObject['arrow' + v1].posY = posY; myObject['arrow' + v1].speed = power; myObject['arrow' + v1].spec = spec; myObject['arrow' + v1].damage = damage; myObject['arrow' + v1].traceTimer = 0; myObject['arrow' + v1].velX = Math.sin(angle * 0.0174532925199433) * power; myObject['arrow' + v1].velY = Math.cos(angle * 0.0174532925199433) * power * -1; addShadow(myObject['arrow' + v1]); myObject['arrow' + v1].posX += myObject['arrow' + v1].velX * 3; myObject['arrow' + v1].posY += myObject['arrow' + v1].velY * 3; myObject['arrow' + v1].clip._rotation = Math.atan2(myObject['arrow' + v1].posY + myObject['arrow' + v1].velY - myObject['arrow' + v1].posY, myObject['arrow' + v1].posX + myObject['arrow' + v1].velX - myObject['arrow' + v1].posX) * 180 / Math.PI; myObject['arrow' + v1].clip._x = myObject['arrow' + v1].posX; myObject['arrow' + v1].clip._y = myObject['arrow' + v1].posY; } function aiBOSSSWAMPMONSTER(ob) { if (ob.clip.hitTest(player.clip) and ob.armsInFight > 0) { var v3 = 1; while (v3 <= enemyCounter) { if (myObject['enemy' + v3].inGame and myObject['enemy' + v3].enemyType == 'monster_arm') { facePlayer(myObject['enemy' + v3]); myObject['enemy' + v3].currAttack = 'grab'; myObject['enemy' + v3].clip.gotoAndStop('grab'); myObject['enemy' + v3].currAttack = 'grab'; myObject['enemy' + v3].frameTimer = myObject['enemy' + v3].clip.mc._totalFrames; } ++v3; } } if (ob.staggerTimer > 0 or ob.stunTimer > 0 or ob.knockdownTimer > 0) { ob.immortal = true; if (ob.armsInFight <= 0) { ob.currWave = 0; ob.forceGrabInit = true; ob.dirX = -1; ob.clip._xscale = 100 * ob.dirX; ob.knockdownTimer = 0; ob.stunTimer = 0; ob.staggerTimer = 0; ob.currAttack = 'hurt'; ob.clip.gotoAndStop('hurt'); ob.frameTimer = ob.clip.mc._totalFrames; ob.hitsLeft -= 1; changeBossPlateHP(ob.hitsLeft, ob.maxHits); ob.currRun += 1; ob.bossInitDone = false; ob.nextDespawnTimer = 0; ob.spawnNextArmTimer = 0; if (ob.hitsLeft <= 0) { v3 = 1; while (v3 <= enemyCounter) { if (myObject['enemy' + v3].inGame) { myObject['enemy' + v3].staggerTimer = 0; myObject['enemy' + v3].stunTimer = 0; myObject['enemy' + v3].knockdownTimer = 0; damageEnemy(myObject['enemy' + v3], 8888, 'death_01'); } ++v3; } _root.levelFinished(); } else { v3 = 1; while (v3 <= enemyCounter) { if (myObject['enemy' + v3].inGame and myObject['enemy' + v3].enemyType == 'monster_arm') { myObject['enemy' + v3].currAttack = 'despawn_init'; } ++v3; } xmarker._x = player.posX - 220; xmarker._y = ob.posY - 10; spawnEnemy(xmarker, 'SWAMPMONSTER_ARM', 1, 'nothing'); } } else { ob.knockdownTimer = 0; ob.stunTimer = 0; ob.staggerTimer = 0; ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; ob.waitTimer = 1; v3 = 1; while (v3 <= enemyCounter) { if (myObject['enemy' + v3].inGame and myObject['enemy' + v3].enemyType == 'monster_arm') { facePlayer(myObject['enemy' + v3]); myObject['enemy' + v3].currAttack = 'grab'; myObject['enemy' + v3].clip.gotoAndStop('grab'); myObject['enemy' + v3].currAttack = 'grab'; myObject['enemy' + v3].frameTimer = myObject['enemy' + v3].clip.mc._totalFrames; } ++v3; } } } if (ob.despawnArm and ob.nextDespawnTimer <= 0) { v3 = 1; while (v3 <= enemyCounter) { if (myObject['enemy' + v3].inGame and myObject['enemy' + v3].enemyType == 'monster_arm') { myObject['enemy' + v3].currAttack = 'despawn_init'; } ++v3; } ob.nextDespawnTimer = 50; ob.spawnNextArmTimer = 0; ob.currWave = 0; ob.currArm = 0; ob.hurrySpawnTimer = 0; ob.lastSpawnDir = 1; ob.despawnArm = false; ob.armsInFight = 0; ob.bossInitDone = true; } else { if (ob.nextDespawnTimer > 0) { ob.nextDespawnTimer -= 1; } } if (ob.spawnNextArmTimer <= 0 and ob.armsInFight <= 0) { if (ob.bossInitDone and ob.currArm < ob.armsInEachWave[ob.currRun][ob.currWave]) { ob.spawnNextArmTimer = 1; ob.hurrySpawnTimer = 0; } else { if (ob.currWave == 2) { ob.immortal = false; } ob.currArm = 0; ob.hurrySpawnTimer = 0; ob.lastSpawnDir = 1; if (ob.hitsLeft > 2) { ob.spawnNextArmTimer = 55; } else { if (ob.hitsLeft > 1) { ob.spawnNextArmTimer = 50; } else { ob.spawnNextArmTimer = 45; } } } } if (ob.hurrySpawnTimer > 0) { ob.hurrySpawnTimer -= 1; if (ob.hurrySpawnTimer <= 0) { ob.spawnNextArmTimer = 1; } } if (!player.isFalling and ob.bossInitDone) { if (ob.armsInFight <= 0 and ob.currWave == 1 and theWorld.backgroundNearLayer.currentLevel.s_3t.hitTest(player.clip)) { ob.spawnNextArmTimer = 1; ob.currWave = 2; ob.currArm = 0; ob.hurrySpawnTimer = 0; } if (ob.armsInFight <= 0 and ob.currWave == 0 and theWorld.backgroundNearLayer.currentLevel.s_2t.hitTest(player.clip)) { ob.spawnNextArmTimer = 1; ob.currWave = 1; ob.currArm = 0; ob.hurrySpawnTimer = 0; } } if (ob.spawnNextArmTimer > 0 and !player.isFalling) { ob.spawnNextArmTimer -= 1; if (ob.spawnNextArmTimer <= 0) { ob.immortal = true; var v5 = ''; xmarker._y = ob.posY - 10; var v6 = 0; var v4 = ob.currArm; while (v4 <= ob.armsInEachWave[ob.currRun][ob.currWave] - 1) { if (v6 < 2) { if (ob.lastSpawnDir == 1) { v5 = 's_' + (ob.currWave + 1) + '_r'; } else { v5 = 's_' + (ob.currWave + 1) + '_l'; } ob.lastSpawnDir *= -1; ob.armsInFight += 1; v6 += 1; ob.currArm += 1; xmarker._x = theWorld.backgroundNearLayer.currentLevel[v5]._x + Math.random() * 16 - 8; spawnEnemy(xmarker, 'SWAMPMONSTER_ARM', ob.lastSpawnDir, 'nothing'); } ++v4; } ob.hurrySpawnTimer = 125; } } if (ob.currAttack == 'none') { MapsCheckpointsReached[8] = true; setThunder(30, 2); ob.hitsLeft = 3; ob.maxHits = 3; ob.canDropHead = 0; ob.canDropArm = 0; ob.canBlock = 0; ob.canParry = 0; ob.forceGrabInit = true; ob.armsInEachWave = [[1, 2, 3], [4, 5, 6], [6, 8, 10]]; ob.armsInFight = 0; ob.nextDespawnTimer = 25; ob.despawnArm = false; ob.hurrySpawnTimer = 0; ob.currArm = 0; ob.currWave = 0; ob.currRun = 0; ob.bossInitDone = false; ob.lastSpawnDir = 1; ob.spawnNextArmTimer = 0; game.fightingBoss = ob.ID; ob.currAttack = 'initDone'; ob.enemyType = 'BOSS'; ob.armSideSpawn = 1; ob.shadowClip.removeMovieClip(); v3 = 1; while (v3 <= enemyCounter) { if (myObject['enemy' + v3].inGame and myObject['enemy' + v3].enemyType != 'monster_arm' and myObject['enemy' + v3].enemyType != 'BOSS') { deleteEnemy(myObject['enemy' + v3]); } ++v3; } xmarker._x = player.posX - 190; xmarker._y = ob.posY - 10; spawnEnemy(xmarker, 'SWAMPMONSTER_ARM', 1, 'nothing'); } else { if (ob.currAttack == 'hurt') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; ob.waitTimer = 1; } } else { if (ob.currAttack == 'idle') { ob.waitTimer -= 1; if (ob.waitTimer <= 0) { ob.currAttack = 'waiting'; } } } } } function aiSWAMPMONSTERARM(ob) { if (ob.isFalling) { ob.posY += 20; ob.clip._y = ob.posY; ob.isFalling = false; } if (ob.staggerTimer > 0 or ob.stunTimer > 0 or ob.knockdownTimer > 0) { ob.hitsTaken += 1; if (ob.lastLife - ob.life > 18) { ob.hitsTaken += 1; } ob.lastLife = ob.life; facePlayer(ob); ob.clip._xscale = 100 * ob.dirX; ob.knockdownTimer = 0; ob.stunTimer = 0; ob.staggerTimer = 0; ob.clip.gotoAndStop('idle'); ob.waitTimer += 12 + Math.random() * 5; if (ob.hitsTaken >= 3) { myObject['enemy' + game.fightingBoss].armsInFight -= 1; damageEnemy(ob, 888, 'death_01'); } } if (ob.currAttack == 'despawn_init') { ob.clip.gotoAndStop('despawn'); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'despawn'; } else { if (ob.currAttack == 'despawn') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { ob.posX = -9999; ob.posY = -9999; ob.clip._x = ob.posX; ob.clip._y = ob.posY; ob.shadowClip.removeMovieClip(); ob.clip.removeMovieClip(); ob.inGame = false; } } else { if (ob.currAttack == 'finishing') { if (!ob.initFinish) { myObject['enemy' + game.fightingBoss].armsInFight -= 1; player.clip.gotoAndStop('finishing_2'); ob.life = 0; ob.initFinish = true; } } else { if (ob.currAttack == 'none') { ob.frameTimer = ob.clip.mc._totalFrames; ob.initFinish = false; ob.parriesDone = 0; ob.lastLife = ob.life; ob.hitsTaken = 0; ob.canDropHead = 0; ob.canDropArm = 0; ob.canBlock = 0; ob.canParry = 0; ob.enemyType = 'monster_arm'; ob.currAttack = 'spawning'; ob.clip.gotoAndStop('spawn'); } else { if (ob.currAttack == 'spawning') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; ob.waitTimer = 22 + Math.random() * 4; if (myObject['enemy' + game.fightingBoss].forceGrabInit == true) { facePlayer(ob); ob.currAttack = 'grab'; ob.clip.gotoAndStop('grab'); ob.currAttack = 'grab'; ob.frameTimer = ob.clip.mc._totalFrames; myObject['enemy' + game.fightingBoss].forceGrabInit = false; } } } else { if (ob.currAttack == 'idle') { ob.waitTimer -= 1; if (ob.waitTimer <= 0) { var v3 = Math.sqrt((player.posX - ob.posX) * (player.posX - ob.posX)); if (v3 <= 120) { facePlayer(ob); ob.clip.gotoAndStop('attack'); getAttackFrame(ob); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'attack'; } else { if (player.posX > ob.posX) { var v2 = Math.sqrt((player.posY - ob.posY) * (player.posY - ob.posY)); if (v2 < 55) { facePlayer(ob); ob.clip.gotoAndStop('grab'); ob.currAttack = 'grab'; ob.frameTimer = ob.clip.mc._totalFrames; } } else { myObject['enemy' + game.fightingBoss].despawnArm = true; facePlayer(ob); ob.waitTimer = 12; } } } } else { if (ob.currAttack == 'attack') { ob.attackTimer -= 1; ob.frameTimer -= 1; if (ob.attackTimer == 2 and ob.parriesDone >= 2) { addBlur(ob.clip, 5, 3); ob.blurTimer = ob.frameTimer - 3; } if (ob.attackTimer == 0 and !player.immortal) { var v2 = Math.sqrt((player.posY - ob.posY) * (player.posY - ob.posY)); if (v2 < 55) { if (ob.parriesDone < 2 and player.velX == 0 and checkIdlePlayer() and facingOb(player, ob)) { ob.parriesDone += 1; startParryPlayer(); } else { addSound('hitFlesh_0' + Math.floor(Math.random() * 2 + 1) + '.wav', 40, 0, 0); addEffect_Blood('blood_s_', player.posX, player.posY - 30); player.dirX = -ob.dirX; player.clip._xscale = player.dirX * 100; startStaggerPlayer(3); if (ob.parriesDone < 2) { updateHPRage(-4, 0); } else { ob.parriesDone = 0; setCameraShake(5, 5); updateHPRage(-12, 0); } } } } if (ob.frameTimer <= 0) { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); ob.waitTimer = 24; } } else { if (ob.currAttack == 'grab') { ob.frameTimer -= 1; player.dirX = 1; player.clip._xscale = player.dirX * 100; player.movementDisabled = false; player.knockdownTimer = 0; player.isKnockdowned = false; player.stunTimer = 0; player.isStunned = false; player.staggerTimer = 0; startStunPlayer(1); startKnockdownPlayer(5); player.posY -= 5; camPos.difY += 5; camPos.virDifY += 5; player.clip._y = player.posY; player.velY = -14; player.velX = -player.dirX * 12; ob.currAttack = 'grab_done'; } else { if (ob.currAttack == 'grab_done') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { myObject['enemy' + game.fightingBoss].despawnArm = true; ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; ob.waitTimer = 12; } } } } } } } } } } } function aiBOSSWITCH(ob) { if (ob.traceFireSound == true) { if (player.posX < theWorld.backgroundNearLayer.currentLevel.mark_w_a._x) { theWorld.backgroundNearLayer.currentLevel.fire_1._x = theWorld.backgroundNearLayer.currentLevel.mark_w_skel_l._x; } else { theWorld.backgroundNearLayer.currentLevel.fire_1._x = theWorld.backgroundNearLayer.currentLevel.mark_w_skel_r._x; } } if (ob.staggerTimer > 0 or ob.stunTimer > 0 or ob.knockdownTimer > 0) { ob.staggerTimer = 0; ob.stunTimer = 0; ob.knockdownTimer = 0; ob.divesDone = 3; ob.speed = 7; ob.clip.gotoAndStop('hurt'); ob.immortal = true; ob.hitsLeft -= 1; changeBossPlateHP(ob.hitsLeft, 3); if (ob.dirX == 1) { ob.targetMC = 'mark_w_r'; ob.currAttack = 'returnToRight'; } else { ob.targetMC = 'mark_w_l'; ob.currAttack = 'returnToLeft'; } if (ob.hitsLeft <= 0) { ob.fireActivated = false; ob.currAttack = 'hit'; theWorld.foregroundLayer.currentLevel_foreground.wf_r.gotoAndPlay('end'); theWorld.foregroundLayer.currentLevel_foreground.wf_l.gotoAndPlay('end'); theWorld.backgroundNearLayer.currentLevel.sound_fire_1.stop(); var v2 = 1; while (v2 <= enemyCounter) { if (myObject['enemy' + v2].ID != ob.ID and myObject['enemy' + v2].inGame and myObject['enemy' + v2].enemyType != 'Crow') { myObject['enemy' + v2].staggerTimer = 0; myObject['enemy' + v2].stunTimer = 0; myObject['enemy' + v2].knockdownTimer = 0; damageEnemy(myObject['enemy' + v2], 8888, 'death_01'); } ++v2; } } } if (ob.fireActivated == true) { if (theWorld.backgroundNearLayer.currentLevel.wf_l_hitbox._x > player.posX or theWorld.backgroundNearLayer.currentLevel.wf_r_hitbox._x < player.posX) { if (player.life > 1) { updateHPRage(-1, 0); addEffect('fire_0' + (Math.floor(Math.random() * 4) + 1), player.posX - 15 + Math.random() * 30, player.posY - 10 - Math.random() * 40, 0, 2, player.dirX); } else { gibPlayer(); } } } witchTraceMolotovs(); theWorld.backgroundNearLayer.currentLevel.mark_w_b._x = player.posX; theWorld.backgroundNearLayer.currentLevel.mark_w_b._y = player.posY - 30; if (ob.currAttack == 'none') { MapsCheckpointsReached[10] = true; ob.dieAfterAWhile = 78; ob.traceFireSound = false; ob.molotovsInAir = 0; ob.speed = 10; ob.targetRotation = 0; ob.targetMC = 'mark_w_b'; ob.waitTimer = 0; ob.divesDone = 0; ob.skelTimer = 0; ob.skelWave = 0; ob.currBomb = 0; ob.maxBombs = 0; ob.bombZone = 0; ob.bombDist = 0; ob.hitsLeft = 3; ob.immortal = true; ob.shadowScale = 70; ob.enemyType = 'BOSS'; ob.canDropHead = 0; ob.canDropArm = 0; ob.canBlock = 0; ob.canParry = 0; ob.fireActivated = false; addShadow(ob); game.fightingBoss = ob.ID; ob.currAttack = 'initDone'; ob.posY = theWorld.backgroundNearLayer.currentLevel.mark_w_r._y; ob.clip._y = ob.posY; ob.clip.gotoAndStop('idle'); } else { if (ob.currAttack == 'startFight') { ob.traceFireSound = true; ob.dirX = -1; ob.posY = theWorld.backgroundNearLayer.currentLevel.mark_w_a._y; ob.currAttack = 'peakSneakOnce'; theWorld.foregroundLayer.currentLevel_foreground.wf_r.gotoAndPlay(2); theWorld.foregroundLayer.currentLevel_foreground.wf_l.gotoAndPlay(2); ob.fireActivated = true; } else { if (ob.currAttack == 'peakSneakOnce') { ob.targetRotation = 0; witchChangeRot(ob); witchMove(ob); if (ob.posX < theWorld.backgroundNearLayer.currentLevel.mark_w_l._x - 25) { ob.dirX = 1; ob.clip._xscale = 100 * ob.dirX; ob.currAttack = 'goIntoMarkLeft'; } } else { if (ob.currAttack == 'hit') { ob.dieAfterAWhile -= 1; ob.clip.gotoAndStop('hurt'); if (ob.speed < 25) { ob.speed += 1; } if (ob.dirX == 1) { ob.clip._rotation -= ob.speed; } else { if (ob.dirX == -1) { ob.clip._rotation += ob.speed; } } if (ob.posY > theWorld.backgroundNearLayer.currentLevel.mark_w_a._y) { ob.posY -= 3; } witchMove(ob); if (ob.dieAfterAWhile <= 0) { ob.inGame = false; addEffect('barrel_explosion', ob.posX, ob.posY, 0, 2, 1); addSound('barrel_explode.wav', 70, 0); addPart('gib_part_human_', 3, ob.posX, ob.posY - 15, 0, 0, true, false, 8, 5); addSound('gib_0' + Math.round(Math.random() * 1 + 1) + '.wav', 100, 0, 0); addBloodstain(ob.posX, ob.posY - 20); addEffect('blood_gib_01', ob.posX, ob.posY - 15, 0, 3, 1); setCameraShake(6, 6); removeMovieClip(ob.clip); removeMovieClip(ob.shadowClip); levelFinished(); theWorld.backgroundNearLayer.currentLevel.fire_1._x -= 1000; } } else { if (ob.currAttack == 'goIntoMarkLeft') { ob.posX += ob.speed; ob.clip._x = ob.posX; var v5 = ob.posX - theWorld.backgroundNearLayer.currentLevel.mark_w_l._x; if (Math.sqrt(v5 * v5) < ob.speed - ob.speed / 2) { ob.clip.gotoAndStop('dive'); ob.posX = theWorld.backgroundNearLayer.currentLevel.mark_w_l._x; ob.clip._x = ob.posX; ob.currAttack = 'diveFromLeft'; ob.immortal = false; ob.speed = 6; } } else { if (ob.currAttack == 'diveFromRight') { ob.targetRotation = witchRot(ob, theWorld.backgroundNearLayer.currentLevel[ob.targetMC]); witchChangeRot(ob); witchMove(ob); ob.speed += 0.7; if (ob.hitsLeft < 3) { ob.speed += 0.5; } if (ob.hitsLeft < 2) { ob.speed += 0.4; } if (ob.posX <= player.posX) { ob.targetMC = 'mark_w_l'; ob.currAttack = 'returnToLeft'; var v4 = Math.sqrt((player.posY - ob.posY) * (player.posY - ob.posY)); if (v4 <= 50) { witchHitPlayer(ob); } } } else { if (ob.currAttack == 'returnToLeft') { ob.targetRotation = witchRot(ob, theWorld.backgroundNearLayer.currentLevel[ob.targetMC]); witchChangeRot(ob); witchMove(ob); if (ob.posX < theWorld.backgroundNearLayer.currentLevel[ob.targetMC]._x) { ob.divesDone += 1; if (ob.divesDone < 3) { ob.dirX = 1; ob.clip._xscale = 100 * ob.dirX; ob.targetMC = 'mark_w_b'; ob.currAttack = 'diveFromLeft'; ob.immortal = false; ob.speed = 6; } else { ob.clip.gotoAndStop('idle'); ob.currAttack = 'flyOutsideScreen'; } } } else { if (ob.currAttack == 'diveFromLeft') { ob.targetRotation = witchRot(ob, theWorld.backgroundNearLayer.currentLevel[ob.targetMC]); witchChangeRot(ob); witchMove(ob); ob.speed += 0.7; if (ob.hitsLeft < 3) { ob.speed += 0.5; } if (ob.hitsLeft < 2) { ob.speed += 0.4; } if (ob.posX >= player.posX) { ob.targetMC = 'mark_w_r'; ob.currAttack = 'returnToRight'; var v4 = Math.sqrt((player.posY - ob.posY) * (player.posY - ob.posY)); if (v4 <= 50) { witchHitPlayer(ob); } } } else { if (ob.currAttack == 'returnToRight') { ob.targetRotation = witchRot(ob, theWorld.backgroundNearLayer.currentLevel[ob.targetMC]); witchChangeRot(ob); witchMove(ob); if (ob.posX > theWorld.backgroundNearLayer.currentLevel[ob.targetMC]._x) { ob.divesDone += 1; if (ob.divesDone < 3) { ob.dirX = -1; ob.clip._xscale = 100 * ob.dirX; ob.targetMC = 'mark_w_b'; ob.currAttack = 'diveFromRight'; } else { ob.clip.gotoAndStop('idle'); ob.currAttack = 'flyOutsideScreen'; } } } else { if (ob.currAttack == 'flyOutsideScreen') { ob.targetRotation = 0; witchChangeRot(ob); witchMove(ob); if (theWorld.backgroundNearLayer.currentLevel.region_border_min_boss._x - 100 > ob.posX or theWorld.backgroundNearLayer.currentLevel.region_border_max_boss._x + 100 < ob.posX) { ob.skelTimer = 0; if (ob.hitsLeft < 2) { ob.skelWave = 0; } else { if (ob.hitsLeft < 3) { ob.skelWave = 1; } else { ob.skelWave = 1; } } ob.currAttack = 'spawnSkeletons'; } } else { if (ob.currAttack == 'spawnSkeletons') { if (ob.skelTimer <= 0) { ob.skelWave += 1; spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_w_skel_l, 'SKELETON_WITCH', 1, 'nothing'); spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_w_skel_r, 'SKELETON_WITCH', -1, 'nothing'); theWorld.foregroundLayer.currentLevel_foreground.wf_r.gotoAndPlay(2); theWorld.foregroundLayer.currentLevel_foreground.wf_l.gotoAndPlay(2); if (ob.skelWave < 3) { ob.skelTimer = 96; } else { ob.divesDone = 0; ob.skelWave = 0; ob.posY = theWorld.backgroundNearLayer.currentLevel.mark_w_a._y; ob.clip._y = ob.posY; ob.dirX *= -1; ob.clip._xscale = 100 * ob.dirX; ob.speed = 8; if (ob.hitsLeft < 2) { ob.waitTimer = 220; } else { if (ob.hitsLeft < 3) { ob.waitTimer = 220; } else { ob.waitTimer = 220; } } ob.divesDone = 0; ob.currAttack = 'initAirBomb'; } } else { ob.skelTimer -= 1; } } else { if (ob.currAttack == 'initAirBomb') { ob.waitTimer -= 1; if (ob.waitTimer <= 0) { ob.bombZone = theWorld.backgroundNearLayer.currentLevel.mark_w_r._x - theWorld.backgroundNearLayer.currentLevel.mark_w_l._x; ob.currBomb = 1; if (ob.hitsLeft < 2) { ob.maxBombs = 4; ob.bombDist = ob.bombZone / 5; } else { if (ob.hitsLeft < 3) { ob.maxBombs = 2; ob.bombDist = ob.bombZone / 3; } else { ob.maxBombs = 1; ob.bombDist = ob.bombZone / 2; } } ob.currAttack = 'airBomb'; } } else { if (ob.currAttack == 'airBomb') { ob.targetRotation = 0; witchChangeRot(ob); witchMove(ob); if (ob.currBomb <= ob.maxBombs) { var v3 = 0; if (ob.dirX == 1) { v3 = theWorld.backgroundNearLayer.currentLevel.mark_w_l._x + ob.currBomb * ob.bombDist; } else { v3 = theWorld.backgroundNearLayer.currentLevel.mark_w_l._x + ob.bombZone - ob.currBomb * ob.bombDist; } var v5 = Math.sqrt((ob.posX - v3) * (ob.posX - v3)); if (v5 < ob.speed) { ob.currBomb += 1; ob.clip.gotoAndStop('throw_molo'); witchAddMolotov(ob); } } if (ob.dirX == -1 and theWorld.backgroundNearLayer.currentLevel.region_border_min_boss._x - 100 > ob.posX or ob.dirX == 1 and theWorld.backgroundNearLayer.currentLevel.region_border_max_boss._x + 100 < ob.posX) { ob.currBomb = 1; ob.divesDone += 1; ob.dirX *= -1; ob.clip._xscale = 100 * ob.dirX; if (ob.divesDone >= 3) { ob.divesDone = 0; ob.currAttack = 'initDive'; } } } else { if (ob.currAttack == 'initDive') { ob.targetRotation = 0; witchChangeRot(ob); witchMove(ob); ob.immortal = false; if (ob.posX < theWorld.backgroundNearLayer.currentLevel.mark_w_r._x and ob.dirX == -1) { ob.targetMC = 'mark_w_b'; ob.currAttack = 'diveFromRight'; 1; ob.clip.gotoAndStop('dive'); } else { if (ob.posX > theWorld.backgroundNearLayer.currentLevel.mark_w_l._x and ob.dirX == 1) { ob.targetMC = 'mark_w_b'; ob.currAttack = 'diveFromLeft'; ob.clip.gotoAndStop('dive'); } } } } } } } } } } } } } } } } } function witchHitPlayer(ob) { ob.immortal = true; addSound('hitFlesh_0' + Math.floor(Math.random() * 2 + 1) + '.wav', 40, 0, 0); if (player.life > 8) { player.dirX = ob.dirX * -1; ob.clip._rotation = 0; ob.speed = 10; player.clip._xscale = player.dirX * 100; player.movementDisabled = false; player.knockdownTimer = 0; player.isKnockdowned = false; player.stunTimer = 0; player.isStunned = false; player.staggerTimer = 0; startStunPlayer(1); startKnockdownPlayer(5); player.velY = -5; player.velX = ob.dirX * 6; } updateHPRage(-8, 0); } function witchAddMolotov(ob) { myObject['enemy' + game.fightingBoss].molotovsInAir += 1; if (myObject['enemy' + game.fightingBoss].molotovsInAir > 5) { myObject['enemy' + game.fightingBoss].molotovsInAir = 1; } var v1 = myObject['enemy' + game.fightingBoss].molotovsInAir; myObject['molotov' + v1] = new myObject.emptyMolotov(); theWorld.objectsLayerBarrels.attachMovie('boss_witch_molotov', ['molotov' + v1], 100 + v1); myObject['molotov' + v1].clip = theWorld.objectsLayerBarrels['molotov' + v1]; myObject['molotov' + v1].clip._x = ob.posX; myObject['molotov' + v1].clip._y = ob.posY - 15; myObject['molotov' + v1].posX = ob.posX; myObject['molotov' + v1].posY = ob.posY - 15; myObject['molotov' + v1].velX = (player.posX + player.velX * 3 - ob.posX) / 33; myObject['molotov' + v1].velY = -2; myObject['molotov' + v1].velRotation = 20 * ob.dirX; myObject['molotov' + v1].inGame = true; addShadow(myObject['molotov' + v1]); myObject['molotov' + v1].shadowClip._xscale = 60; myObject['molotov' + v1].shadowClip._yscale = 60; } function witchTraceMolotovs() { var v1 = 1; while (v1 <= 5) { if (myObject['molotov' + v1].inGame == true) { myObject['molotov' + v1].posY += myObject['molotov' + v1].velY; myObject['molotov' + v1].velY += game.gravity; myObject['molotov' + v1].posX += myObject['molotov' + v1].velX; myObject['molotov' + v1].clip._rotation += myObject['molotov' + v1].velRotation; myObject['molotov' + v1].clip._y = myObject['molotov' + v1].posY; myObject['molotov' + v1].clip._x = myObject['molotov' + v1].posX; if (myObject['molotov' + v1].traceTimer <= 0) { addEffect('boss_witch_molotov_trace', myObject['molotov' + v1].posX, myObject['molotov' + v1].posY, 0, 2, 1); myObject['molotov' + v1].traceTimer = 4; } else { myObject['molotov' + v1].traceTimer -= 1; } moveShadow(myObject['molotov' + v1]); if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(myObject['molotov' + v1].posX + camPos.difX, myObject['molotov' + v1].posY + camPos.difY, true)) { setCameraShake(6, 6); if (Math.random() * 100 <= 50) { addEffect('boss_witch_molo_explosion', myObject['molotov' + v1].posX, theWorld.backgroundNearLayer.currentLevel.mark_w_skel_l._y, 0, 2, 1); } else { addEffect('boss_witch_molo_explosion', myObject['molotov' + v1].posX, theWorld.backgroundNearLayer.currentLevel.mark_w_skel_l._y, 0, 2, -1); } molotovExplo(myObject['molotov' + v1]); myObject['molotov' + v1].inGame = false; removeMovieClip(myObject['molotov' + v1].shadowClip); removeMovieClip(myObject['molotov' + v1].clip); } } ++v1; } } function molotovExplo(ob) { var v3 = player.posX - ob.posX; var v2 = player.posY - ob.posY; var v4 = Math.sqrt(v3 * v3 + v2 * v2); if (v4 <= 75) { if (player.posX > ob.posX) { player.dirX = -1; } else { if (player.posX < ob.posX) { player.dirX = 1; } } player.clip._xscale = player.dirX * 100; player.movementDisabled = false; player.knockdownTimer = 0; player.isKnockdowned = false; player.stunTimer = 0; player.isStunned = false; player.staggerTimer = 0; startStunPlayer(1); startKnockdownPlayer(5); player.velY = -5; player.velX = -player.dirX * 4; updateHPRage(-6, 0); } } function witchChangeRot(ob) { if (ob.clip._rotation > ob.targetRotation) { ob.clip._rotation -= ob.speed / 2; if (ob.clip._rotation < ob.targetRotation) { ob.clip._rotation = ob.targetRotation; } } if (ob.clip._rotation < ob.targetRotation) { ob.clip._rotation += ob.speed / 2; if (ob.clip._rotation > ob.targetRotation) { ob.clip._rotation = ob.targetRotation; } } } function witchMove(ob) { var v3 = Math.cos(ob.clip._rotation / 57.29577951308232); var v2 = Math.sin(ob.clip._rotation / 57.29577951308232); ob.posX += v3 * ob.speed * ob.dirX; ob.posY += v2 * ob.speed * ob.dirX; ob.clip._x = ob.posX; ob.clip._y = ob.posY; moveShadow(ob); } function witchRot(ob, targetMC) { var v2 = ob.posX - targetMC._x; var v1 = ob.posY - targetMC._y; return Math.atan(v1 / v2) * 57.29577951308232; } function aiBOSSPRINCESS(ob) { if (ob.hurtTimer > 0) { ob.hurtTimer -= 1; if (ob.hurtTimer <= 0) { ob.clip.gotoAndStop('idle'); } } princessTraceShockwave(); if (ob.currAttack == 'InitDeath') { ob.dirX = -ob.dirX; ob.clip._xscale = ob.dirX * 100; addBloodstain(ob.posX, ob.posY - 20); addPart('princess_head', 1, ob.posX, ob.posY - 35, player.dirX * 4, -7, true, false, 1, 2); damageEnemy(ob, 9999, 'death_01'); levelFinished(); } else { if (ob.currAttack == 'initInstaKnockback_longKnockdown') { facePlayer(ob); ob.clip.gotoAndStop('attack_1'); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'knockbackAnimation'; ob.sendShockwave = true; player.dirX = -ob.dirX; princessKnockbackPlayer(500); } else { if (ob.currAttack == 'knockbackAnimation') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { if (ob.sendShockwave) { ob.sendShockwave = false; ob.waitTimer = 24; ob.clip.gotoAndStop('idle'); ob.currAttack = 'waitToSendShockwave'; } else { ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; } } } else { if (ob.currAttack == 'none') { ob.life = 230; ob.maxLife = 230; ob.forceNextShockwave = 48; ob.immortal = false; ob.enemyType = 'BOSS'; ob.isPrincessBoss = true; ob.canDropHead = 0; ob.canDropArm = 0; ob.canBlock = 0; ob.canParry = 0; game.fightingBoss = ob.ID; ob.currAttack = 'initDone'; ob.speed = 2; ob.runDistToPlayer = 70; ob.waitTimer = 0; ob.hurtTimer = 0; ob.sendShockwave = false; ob.haveHitPlayer = false; ob.oldDirX = ob.dirX; ob.checkWalkError = false; } else { if (ob.currAttack == 'startFight') { ob.waitTimer = 12; MapsCheckpointsReached[12] = true; ob.currAttack = 'idle'; } else { if (ob.currAttack == 'idle') { ob.waitTimer -= 1; if (player.deathInitiated) { } else { if (ob.waitTimer <= 0) { ob.checkWalkError = false; var v3 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); if (v3 > ob.runDistToPlayer) { facePlayer(ob); if (ob.life > 100) { ob.forceNextShockwave = 48; } else { ob.forceNextShockwave = 24; } ob.clip.filters = null; ob.currAttack = 'run'; ob.clip.gotoAndStop('run'); } else { ob.hurtTimer = 0; facePlayer(ob); ob.clip.gotoAndStop('attack_1'); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'knockbackAnimation'; ob.sendShockwave = true; player.dirX = -ob.dirX; princessKnockbackPlayer(12); ob.clip.filters = [myRageGlow]; } } else { if (ob.checkWalkError) { var v2 = Math.sqrt((ob.posY - player.posY) * (ob.posY - player.posY)); var v3 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); if (facingOb(ob, player) and v2 <= 15 and v3 <= 15) { facePlayer(ob); ob.clip.gotoAndStop('attack_1'); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'knockbackAnimation'; ob.sendShockwave = true; player.dirX = -ob.dirX; princessKnockbackPlayer(500); ob.clip.filters = [myRageGlow]; } } } } } else { if (ob.currAttack == 'run') { ob.forceNextShockwave -= 1; var v5 = Math.sqrt((player.posX - ob.posX) * (player.posX - ob.posX)); if (ob.forceNextShockwave <= 0 and v5 > 150) { if (ob.life > 100) { ob.forceNextShockwave = 48; ob.waitTimer = 8; } else { ob.forceNextShockwave = 24; ob.waitTimer = 4; } ob.clip.filters = [myRageGlow]; ob.sendShockwave = false; ob.clip.gotoAndStop('idle'); ob.currAttack = 'waitToSendShockwave'; } else { facePlayer(ob); var v4 = ob.dirX * ob.speed; if (ob.velX < ob.dirX and ob.dirX == 1 or ob.velX > ob.dirX and ob.dirX == -1) { ob.velX = 0; } ob.velX = countToNumber(ob.velX, v4, 1); moveEnemyXAxis(ob); var v3 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); if (v3 < ob.runDistToPlayer and !player.isJumping) { startAttack(ob, 'attack_2'); ob.velX = 0; } } } else { if (ob.currAttack == 'attack_2') { ob.frameTimer -= 1; ob.attackTimer -= 1; var v2 = Math.sqrt((ob.posY - player.posY) * (ob.posY - player.posY)); var v3 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); if (facingOb(ob, player) and v2 <= 15 and v3 <= 15) { facePlayer(ob); ob.clip.gotoAndStop('attack_1'); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'knockbackAnimation'; ob.sendShockwave = true; player.dirX = -ob.dirX; princessKnockbackPlayer(500); ob.clip.filters = [myRageGlow]; } if (ob.attackTimer == 0) { setCameraShake(5, 6); if (v3 <= 85 and facingOb(ob, player) and v2 <= 40) { if (player.life > 25) { addSound('hitFlesh_0' + Math.floor(Math.random() * 2 + 1) + '.wav', 40, 0, 0); addEffect_Blood(player.bloodType, player.posX, player.posY - 25); updateHPRage(-25, 0); } else { playerGibVelX = ob.dirX * 10; gibPlayer(); playerGibVelX = 0; } princessKnockbackPlayer(50); player.velY = -1; player.velX = 0; ob.haveHitPlayer = true; } } if (ob.frameTimer <= 0) { ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; if (!ob.haveHitPlayer) { ob.waitTimer = 40 + ob.life / 10; } else { ob.waitTimer = 13; ob.haveHitPlayer = false; } ob.checkWalkError = true; } } else { if (ob.currAttack == 'waitToSendShockwave') { ob.waitTimer -= 1; if (ob.waitTimer <= 0) { startAttack(ob, 'attack_2'); ob.currAttack = 'sendShockwave'; } } else { if (ob.currAttack == 'sendShockwave') { ob.frameTimer -= 1; ob.attackTimer -= 1; if (ob.attackTimer == 0) { addSound('concrete_break3', 100, 0); princessAddShockwave(ob); setCameraShake(5, 8); } if (ob.frameTimer <= 0) { ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; ob.waitTimer = 20; } } } } } } } } } } } } function princessTraceShockwave() { var v1 = 1; if (myObject['shockwave' + v1].inGame) { setCameraShake(3, 8); myObject['shockwave' + v1].posX += myObject['shockwave' + v1].velX; if (myObject['shockwave' + v1].playerHits < 5) { if (myObject['shockwave' + v1].playerHitCD > 0) { myObject['shockwave' + v1].playerHitCD -= 1; } else { var v3 = Math.sqrt((player.posX - myObject['shockwave' + v1].posX) * (player.posX - myObject['shockwave' + v1].posX)); var v2 = Math.sqrt((player.posY - myObject['shockwave' + v1].posY) * (player.posY - myObject['shockwave' + v1].posY)); if (v2 < 40 and v3 < 80) { myObject['shockwave' + v1].playerHits += 1; myObject['shockwave' + v1].playerHitCD = 3; player.dirX = -myObject['shockwave' + v1].dirX; player.knockdownTimer = 1; princessKnockbackPlayer(6); player.velY = -2.5; player.velX = 6 * -player.dirX; if (player.life > 5) { addSound('hitFlesh_0' + Math.floor(Math.random() * 2 + 1) + '.wav', 40, 0, 0); addEffect_Blood(player.bloodType, player.posX, player.posY - 25); updateHPRage(-5, 0); } else { playerGibVelX = player.velX * 1.6; gibPlayer(); playerGibVelX = 0; } } } } myObject['shockwave' + v1].traceTimer -= 1; if (myObject['shockwave' + v1].traceTimer <= 0) { addEffect('boss_princess_wave', myObject['shockwave' + v1].posX + myObject['shockwave' + v1].dirX * 40, myObject['shockwave' + v1].posY, 0, 0, -1 * myObject['shockwave' + v1].dirX); theWorld.effectsLayer['effect_nr' + effectCounter]._xscale = (100 + Math.random() * 50) * (-1 * myObject['shockwave' + v1].dirX); theWorld.effectsLayer['effect_nr' + effectCounter]._yscale = 100 + Math.random() * 50; myObject['shockwave' + v1].traceTimer = 3; } if (myObject['shockwave' + v1].posX > theWorld.backgroundNearLayer.currentLevel.region_border_max_end._x or myObject['shockwave' + v1].posX < theWorld.backgroundNearLayer.currentLevel.region_border_min_boss._x) { myObject['shockwave' + v1].inGame = false; } } } function princessAddShockwave(ob) { var v1 = 1; myObject['shockwave' + v1] = new myObject.emptyShockwave(); myObject['shockwave' + v1].posX = ob.posX + ob.dirX * 30; myObject['shockwave' + v1].posY = ob.posY; myObject['shockwave' + v1].velX = ob.dirX * 15; myObject['shockwave' + v1].dirX = ob.dirX; myObject['shockwave' + v1].inGame = true; } function princessKnockbackPlayer(kbTime) { addSound('kick_0' + Math.round(Math.random() * 1 + 1) + '.wav', 70, 0, 0); player.movementDisabled = false; player.knockdownTimer = 0; player.isKnockdowned = false; player.stunTimer = 0; player.isStunned = false; player.staggerTimer = 0; startStunPlayer(1); startKnockdownPlayer(kbTime); player.velY = -8; player.velX = 8 * -player.dirX; } function aiBOSSHEDGEHOG(ob) { if (ob.staggerTimer > 0 or ob.stunTimer > 0 or ob.knockdownTimer > 0) { ob.knockdownTimer = 0; ob.stunTimer = 0; ob.staggerTimer = 0; ob.immortal = true; ob.dirX = ob.lastDirX; if (ob.currAttack == 'rollend') { if (ob.dirX == 1) { ob.posX = theWorld.backgroundNearLayer.currentLevel.platform_r._x; } else { ob.posX = theWorld.backgroundNearLayer.currentLevel.platform_l._x; } ob.clip._x = ob.posX; } ob.clip._xscale = ob.dirX * 100; ob.clip.gotoAndStop('hurt'); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'hurt'; ob.waitTimer = 0; ob.hurted = true; ob.hitsTaken += 1; if (ob.hitsTaken == 5) { ob.frameTimer *= 4; } changeBossPlateHP(5 - ob.hitsTaken, 5); } hedgehogTraceMissiles(); if (ob.currAttack == 'hurt') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { if (ob.hitsTaken < 5) { ob.clip.gotoAndStop('turn_lethal'); getAttackFrame(ob); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'turnlethal'; } else { ob.currAttack = 'initRollDown'; } } } else { if (ob.currAttack == 'none') { ob.lastDirX = ob.dirX; ob.velY = 1; ob.waitTimer = 12; ob.hurted = false; ob.immortal = true; ob.enemyType = 'BOSS'; ob.canDropHead = 0; ob.canDropArm = 0; ob.canBlock = 0; ob.canParry = 0; game.fightingBoss = ob.ID; ob.currAttack = 'initDone'; ob.missilesInAir = 0; ob.runOverPlayerDone = false; ob.hitsTaken = 0; ob.shadowClip.removeMovieClip(); } else { if (ob.currAttack == 'startFight') { MapsCheckpointsReached[18] = true; ob.currAttack = 'idle'; } else { if (ob.currAttack == 'shoot') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { hedgehogAddMissiles(); ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; ob.waitTimer = 12; } } else { if (ob.currAttack == 'idle') { ob.waitTimer -= 1; if (player.deathInitiated) { } else { if (ob.waitTimer <= 0) { if (ob.hurted) { ob.hurted = false; ob.clip.gotoAndStop('shoot'); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'shoot'; addEffect('arrow_launch', ob.posX, ob.posY, 0, 2, -ob.dirX); } else { ob.clip.gotoAndStop('roll_start'); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'rollstart'; } } } } else { if (ob.currAttack == 'rollstart') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { setCameraShake(5, 5); ob.runOverPlayerDone = false; ob.clip.gotoAndStop('roll_loop'); ob.currAttack = 'rollloop'; if (player.posX < ob.posX and ob.dirX == 1 or player.posX > ob.posX and ob.dirX == -1) { addSound('kick_0' + Math.round(Math.random() * 1 + 1) + '.wav', 70, 0, 0); player.dirX = -ob.dirX; player.clip._xscale = player.dirX * 100; player.movementDisabled = false; player.knockdownTimer = 0; player.isKnockdowned = false; player.stunTimer = 0; player.isStunned = false; player.staggerTimer = 0; startStunPlayer(1); startKnockdownPlayer(5); player.velY = -10; player.velX = 10 * player.dirX; } } } else { if (ob.currAttack == 'rollloop') { ob.posX += ob.dirX * (20 + 3 * ob.hitsTaken); addEffect('jump_dirt', ob.posX, ob.posY, 0, 2, -ob.dirX); setCameraShake(4, 4); if (ob.runOverPlayerDone != true) { var v2 = Math.sqrt((player.posX - ob.posX) * (player.posX - ob.posX)); var v3 = Math.sqrt((player.posY - ob.posY) * (player.posY - ob.posY)); var v4 = Math.sqrt(v2 * v2 + v3 * v3); if (v4 <= 50) { player.knockdownTimer = 1; startKnockdownPlayer(30); if (player.life > 25) { addSound('hitFlesh_0' + Math.floor(Math.random() * 2 + 1) + '.wav', 40, 0, 0); updateHPRage(-25, 0); } else { gibPlayer(); } addEffect_Blood(player.bloodType, player.posX, player.posY - 25); ob.runOverPlayerDone = true; } } if (ob.posX <= theWorld.backgroundNearLayer.currentLevel.platform_start._x and ob.dirX == -1) { ob.posX = theWorld.backgroundNearLayer.currentLevel.platform_start._x; ob.clip.gotoAndStop('roll_end'); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'rollend'; } if (ob.posX >= theWorld.backgroundNearLayer.currentLevel.platform_end._x and ob.dirX == 1) { ob.posX = theWorld.backgroundNearLayer.currentLevel.platform_end._x; ob.clip.gotoAndStop('roll_end'); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'rollend'; } if (ob.currAttack == 'rollend') { ob.immortal = false; v3 = Math.sqrt((player.posY - ob.posY) * (player.posY - ob.posY)); if (v3 < 70 and (player.posX < ob.posX and ob.dirX == -1 or player.posX > ob.posX and ob.dirX == 1)) { addSound('kick_0' + Math.round(Math.random() * 1 + 1) + '.wav', 70, 0, 0); player.dirX = ob.dirX; player.clip._xscale = player.dirX * 100; player.movementDisabled = false; player.knockdownTimer = 0; player.isKnockdowned = false; player.stunTimer = 0; player.isStunned = false; player.staggerTimer = 0; startStunPlayer(1); startKnockdownPlayer(5); player.velY = -10; player.velX = 10 * player.dirX; } } ob.clip._x = ob.posX; } else { if (ob.currAttack == 'rollend') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { if (ob.dirX == 1) { ob.posX = theWorld.backgroundNearLayer.currentLevel.platform_r._x; } else { ob.posX = theWorld.backgroundNearLayer.currentLevel.platform_l._x; } ob.clip._x = ob.posX; ob.clip.gotoAndStop('idle'); if (ob.runOverPlayerDone) { ob.waitTimer = 5; } else { ob.waitTimer = 24 - ob.hitsTaken * 4; } ob.currAttack = 'readyToTurnAround'; } } else { if (ob.currAttack == 'readyToTurnAround') { ob.waitTimer -= 1; if (ob.waitTimer <= 0) { ob.immortal = true; ob.clip.gotoAndStop('turn_lethal'); getAttackFrame(ob); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'turnlethal'; } } else { if (ob.currAttack == 'turnlethal') { ob.frameTimer -= 1; ob.attackTimer -= 1; if (ob.attackTimer == 0) { var v2 = Math.sqrt((player.posX - ob.posX) * (player.posX - ob.posX)); var v3 = Math.sqrt((player.posY - ob.posY) * (player.posY - ob.posY)); var v4 = Math.sqrt(v2 * v2 + v3 * v3); if (v4 <= 105) { addSound('kick_0' + Math.round(Math.random() * 1 + 1) + '.wav', 70, 0, 0); player.dirX = (player.posX - ob.posX) / v2; if (player.dirX == 0) { player.dirX = -ob.dirX; } player.clip._xscale = player.dirX * 100; player.movementDisabled = false; player.knockdownTimer = 0; player.isKnockdowned = false; player.stunTimer = 0; player.isStunned = false; player.staggerTimer = 0; startStunPlayer(1); startKnockdownPlayer(5); player.velY = -10; player.velX = 9 * player.dirX; } } if (ob.frameTimer <= 0) { ob.dirX = -ob.dirX; ob.lastDirX = ob.dirX; ob.clip.gotoAndStop('idle'); ob.clip._xscale = ob.dirX * 100; ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'idle'; ob.waitTimer = 12; } } else { if (ob.currAttack == 'initRollDown') { ob.clip.gotoAndStop('roll_start'); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'rollDownstart'; } else { if (ob.currAttack == 'rollDownstart') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { ob.clip.gotoAndStop('roll_loop'); ob.currAttack = 'rollDownloop'; } } else { if (ob.currAttack == 'rollDownloop') { if (!theWorld.backgroundNearLayer.currentLevel.deathgaps.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) { ob.posX += ob.dirX * 10; ob.clip._x = ob.posX; } else { ob.currAttack = 'downBoss'; levelFinished(); } ob.velY += 2; ob.posY += ob.velY; ob.clip._y = ob.posY; } else { if (ob.currAttack == 'downBoss') { ob.velY += 2; ob.posY += ob.velY; ob.clip._y = ob.posY; } } } } } } } } } } } } } } } function hedgehogTraceMissiles() { var v1 = 1; while (v1 <= 5) { if (myObject['molotov' + v1].inGame == true) { myObject['molotov' + v1].velY += 1; myObject['molotov' + v1].posY += myObject['molotov' + v1].velY; myObject['molotov' + v1].clip._y = myObject['molotov' + v1].posY; if (myObject['molotov' + v1].tracePlayer == true) { var v3 = player.posX - myObject['molotov' + v1].posX; var v5 = Math.sqrt(v3 * v3); if (v5 <= 30) { var v2 = player.posY - 25 - myObject['molotov' + v1].posY; var v4 = Math.sqrt(v2 * v2); if (v4 < 25) { player.knockdownTimer = 0; player.isKnockdowned = false; player.stunTimer = 0; player.isStunned = false; player.staggerTimer = 0; startStunPlayer(1); startKnockdownPlayer(500); player.velY = myObject['molotov' + v1].velY; player.velX = 0; myObject['molotov' + v1].tracePlayer = false; } } } if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(myObject['molotov' + v1].posX + camPos.difX, myObject['molotov' + v1].posY + camPos.difY, true)) { myObject['molotov' + v1].inGame = false; myObject['molotov' + v1].clip._y = theWorld.backgroundNearLayer.currentLevel.platform_l._y; theWorld.backgroundNearLayer.currentLevel['shadow_' + v1]._alpha = 0; myObject['molotov' + v1].clip.gotoAndPlay(2); } } ++v1; } } function hedgehogAddMissiles() { var v5 = 3; if (myObject['enemy' + game.fightingBoss].hitsTaken >= 3) { v5 = 5; } var v6 = Math.random() * 80 - 40; var v2 = 1; while (v2 <= v5) { myObject['enemy' + game.fightingBoss].missilesInAir += 1; if (myObject['enemy' + game.fightingBoss].missilesInAir > 5) { myObject['enemy' + game.fightingBoss].missilesInAir = 1; } var v3 = player.posX + 110 * (2 - v2); if (v5 == 5) { v3 = player.posX + 90 * (3 - v2); } v3 += v6; var v4 = player.posY - (450 + 30 * v2) - v2 * 50 * myObject['enemy' + game.fightingBoss].dirX; var v1 = myObject['enemy' + game.fightingBoss].missilesInAir; myObject['molotov' + v1] = new myObject.emptyMolotov(); theWorld.objectsLayerBarrels.attachMovie('arrow_hedgehog', ['missile' + v1], 100 + v1); myObject['molotov' + v1].clip = theWorld.objectsLayerBarrels['missile' + v1]; myObject['molotov' + v1].clip._x = v3; myObject['molotov' + v1].clip._y = v4; myObject['molotov' + v1].clip._rotation = 90; myObject['molotov' + v1].posX = v3; myObject['molotov' + v1].posY = v4; myObject['molotov' + v1].velX = 0; myObject['molotov' + v1].velY = 0; myObject['molotov' + v1].velRotation = 0; myObject['molotov' + v1].inGame = true; myObject['molotov' + v1].tracePlayer = true; theWorld.backgroundNearLayer.currentLevel['shadow_' + v1]._x = myObject['molotov' + v1].posX; theWorld.backgroundNearLayer.currentLevel['shadow_' + v1]._y = theWorld.backgroundNearLayer.currentLevel.platform_l._y; theWorld.backgroundNearLayer.currentLevel['shadow_' + v1]._alpha = 100; if (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(myObject['molotov' + v1].posX + camPos.difX, theWorld.backgroundNearLayer.currentLevel.platform_l._y + camPos.difY + 10, true)) { theWorld.backgroundNearLayer.currentLevel['shadow_' + v1]._alpha = 0; } ++v2; } } function aiBOSSDEMONOMG(ob) { if (ob.staggerTimer > 0 or ob.stunTimer > 0 or ob.knockdownTimer > 0) { ob.knockdownTimer = 0; ob.stunTimer = 0; ob.staggerTimer = 0; } if (ob.trackShield == true) { if (theWorld.backgroundNearLayer.currentLevel.shieldZone.hitTest(player.posX + camPos.difX, player.posY + camPos.difY, true)) { theWorld.backgroundNearLayer.currentLevel.boss_shield.gotoAndPlay('start'); player.movementDisabled = false; player.knockdownTimer = 0; player.isKnockdowned = false; player.stunTimer = 0; player.isStunned = false; player.staggerTimer = 0; startStunPlayer(1); startKnockdownPlayer(5); player.velY = -12; player.velX = -14; } } else { var v7 = theWorld.backgroundNearLayer.currentLevel.safezone._x - theWorld.backgroundNearLayer.currentLevel.safezone._width / 2; var v8 = theWorld.backgroundNearLayer.currentLevel.safezone._x + theWorld.backgroundNearLayer.currentLevel.safezone._width / 2; if (!player.isKnockdowned and player.posX > v7 - 20 and ob.fire == 0) { ob.fire = 1; } else { if (player.posX < v7 and ob.fire >= 2) { ob.fire = 0; } } } if (ob.currAttack == 'initContestLoss') { ob.clip.stun_stars._alpha = 100; ob.clip.gotoAndStop('parry'); ob.clip.mc.gotoAndStop(4); if (ob.hitsTaken == 1) { ob.frameTimer = 42; } else { if (ob.hitsTaken == 2) { ob.frameTimer = 36; } else { ob.frameTimer = 48; } } ob.currAttack = 'parry'; } else { if (ob.currAttack == 'initContest') { demonOMGHideObjects(); contest_sound.start(0.2); addSound('contest_begin.wav', 100, 0, 0); setCameraShake(4, 8); parring = true; setuncontrollable(); player.contestingTimer = 75; player.velX = 0; player.contestingPower = 0; if (ob.hitsTaken == 1) { player.contestingPower -= 21; } else { if (ob.hitsTaken == 2) { player.contestingPower -= 24; } else { player.contestingPower -= 18; } } player.contesting = game.fightingBoss; player.clip.gotoAndStop('contest'); player.immortal = true; ob.currAttack = 'BOSS_waitForContestToEnd'; ob.clip.gotoAndStop('parry'); addEffect_sparks(player); addEffect_sparks(ob); forceThunder(); var v6 = player.posX; player.posX = theWorld.backgroundNearLayer.currentLevel.mark_playerBossX._x; player.clip._x = player.posX; camPos.difX -= player.posX - v6; camPos.virDifX -= player.posX - v6; ob.attackPhase = 1; ob.canNowHitHead = true; } else { if (ob.currAttack == 'initInstaGib') { demonOMGHideObjects(); ob.instaGibba = true; ob.currAttack = 'attack_1'; ob.clip.gotoAndStop('attack_1'); getAttackFrame(ob); ob.frameTimer = ob.clip.mc._totalFrames; } else { if (ob.currAttack == 'initKick') { demonOMGHideObjects(); ob.frameTimer = 4; ob.attackTimer = -1; ob.clip.gotoAndStop('attack_2'); ob.currAttack = 'knockBackPlayerAfterHurt'; ob.clip.mc.gotoAndPlay('kick'); } else { if (ob.currAttack == 'hit') { ob.canContest = true; ob.clip.stun_stars._alpha = 0; ob.hitsTaken += 1; if (ob.hitsTaken == 2) { startRain(30, 1); } else { if (ob.hitsTaken == 3) { stopRain('nothing', 0); } } changeBossPlateHP(3 - ob.hitsTaken, 3); ob.clip.gotoAndStop('hurt'); ob.frameTimer = ob.clip.mc._totalFrames; ob.canNowHitHead = false; ob.currAttack = 'hurt'; ob.immortal = true; if (ob.hitsTaken >= 3) { theWorld.backgroundNearLayer.currentLevel.groundCollision.blockZone._y += 350; damageEnemy(ob, 8888, 'death_01'); } } else { if (ob.currAttack == 'hurt') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { ob.clip.gotoAndStop('attack_2'); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'knockBackPlayerAfterHurt'; getAttackFrame(ob); } } else { if (ob.currAttack == 'knockBackPlayerAfterHurt') { ob.frameTimer -= 1; ob.attackTimer -= 1; if (ob.attackTimer == 0) { var v6 = player.posX; player.posX = theWorld.backgroundNearLayer.currentLevel.mark_playerBossX._x; player.clip._x = player.posX; camPos.difX -= player.posX - v6; camPos.virDifX -= player.posX - v6; player.movementDisabled = false; player.knockdownTimer = 0; player.isKnockdowned = false; player.stunTimer = 0; player.isStunned = false; player.staggerTimer = 0; startStunPlayer(50); player.velX = 0; player.velY = 0; addSound('hitFlesh_0' + Math.floor(Math.random() * 2 + 1) + '.wav', 40, 0, 0); } if (ob.frameTimer == 3) { addSound('kick_0' + Math.round(Math.random() * 1 + 1) + '.wav', 70, 0, 0); ob.attackPhase = 0; player.movementDisabled = false; player.knockdownTimer = 0; player.isKnockdowned = false; player.stunTimer = 0; player.isStunned = false; player.staggerTimer = 0; startStunPlayer(1); startKnockdownPlayer(5); player.velY = -12; player.velX = -16; ob.immortal = false; } if (ob.frameTimer <= 0) { ob.fire = 4; ob.currAttack = 'raiseShield'; ob.clip.gotoAndStop('idle'); ob.waitTimer = 55; } } else { if (ob.currAttack == 'initParry') { ob.clip.gotoAndStop('parry'); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'parry'; ob.attackPhase = 1; ob.canNowHitHead = true; demonOMGHideObjects(); } else { if (ob.currAttack == 'parry') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { ob.clip.stun_stars._alpha = 0; ob.blocksPerformed = 0; ob.canNowHitHead = false; ob.attackPhase = 0; ob.currAttack = 'initInstaGib'; } } else { if (ob.currAttack == 'none') { ob.canContest = true; ob.hitsTaken = 0; ob.attackPhase = 0; ob.instaGibba = false; ob.canNowHitHead = false; ob.trackShield = false; ob.blocksPerformed = false; ob.canBlock = 1; ob.immortal = false; ob.waitTimer = 55; ob.isOMGBoss = true; ob.enemyType = 'BOSS'; ob.canDropHead = 0; ob.canDropArm = 0; ob.canBlock = 0; ob.canParry = 0; ob.fire = 0; game.fightingBoss = ob.ID; ob.magnifyShadow = false; ob.currAttack = 'initDone'; theWorld.backgroundNearLayer.currentLevel.groundCollision.blockZone._y -= 350; ob.clip.stun_stars._alpha = 0; } else { if (ob.currAttack == 'startFight') { var v2 = 1; while (v2 <= enemyCounter) { if (myObject['enemy' + v2].enemyType != 'BOSS' and myObject['enemy' + v2].inGame and myObject['enemy' + v2].enemyType != 'Crow') { myObject['enemy' + v2].staggerTimer = 0; myObject['enemy' + v2].stunTimer = 0; myObject['enemy' + v2].knockdownTimer = 0; damageEnemy(myObject['enemy' + v2], 8888, 'death_01'); } ++v2; } MapsCheckpointsReached[19] = true; ob.currAttack = 'raiseShield'; } else { if (ob.currAttack == 'raiseShield') { ob.waitTimer -= 1; if (ob.waitTimer <= 0) { ob.trackShield = true; ob.clip.gotoAndStop('summon'); } } else { if (ob.currAttack == 'lowerShield') { var v4 = false; var v2 = 1; while (v2 <= enemyCounter) { if (myObject['enemy' + v2].enemyType != 'BOSS' and myObject['enemy' + v2].inGame and myObject['enemy' + v2].enemyType != 'Crow') { v4 = true; } ++v2; } if (!v4) { ob.waitTimer -= 1; if (ob.waitTimer <= 0) { ob.currAttack = 'shieldBreak'; } } } else { if (ob.currAttack == 'shieldBreak') { ob.trackShield = false; ob.clip.gotoAndStop('summon'); theWorld.backgroundNearLayer.currentLevel.boss_shield.gotoAndPlay('end'); theWorld.backgroundNearLayer.currentLevel.cam1._y -= 300; theWorld.backgroundNearLayer.currentLevel.cam2._y -= 300; player.movementDisabled = false; player.knockdownTimer = 0; player.isKnockdowned = false; player.stunTimer = 0; player.isStunned = false; player.staggerTimer = 0; startStunPlayer(1); startKnockdownPlayer(5); player.velY = -11; player.velX = -14; var v3 = 1; while (v3 <= partCounter) { if (myObject['part' + v3].inGame) { myObject['part' + v3].inGame = false; } ++v3; } theWorld.createEmptyMovieClip('staticEffectsLayer', 3); theWorld.createEmptyMovieClip('staticEffectsLayerParts', 4); theWorld.createEmptyMovieClip('deadEnemiesLayer', 5); theWorld.createEmptyMovieClip('objectsLayerBarrels', 9); theWorld.createEmptyMovieClip('partFlyingLayer', 10); theWorld.createEmptyMovieClip('effectsLayer', 12); theWorld.createEmptyMovieClip('objectsLayerArrows', 16); activateCheat('Stun All Enemies'); setCameraShake(5, 8); ob.currAttack = 'waitForTheShield'; } else { if (ob.currAttack == 'waitForTheShield') { if (!player.isKnockdowned) { ob.waitTimer = 12; ob.currAttack = 'idle'; } } else { if (ob.currAttack == 'idle') { if (!player.deathInitiated) { if (ob.waitTimer <= 0 or ob.fire == 3) { if (ob.fire == 2) { if (theWorld.backgroundNearLayer.currentLevel.flailNoneReach.hitTest(player.clip)) { ob.fire = 3; } } if (ob.fire == 1) { ob.currAttack = 'breathe_fire'; ob.clip.gotoAndStop('breathe_fire'); ob.frameTimer = ob.clip.mc._totalFrames; ob.attackTimer = 3; } else { if (ob.fire == 3) { if (theWorld.backgroundNearLayer.currentLevel.attackZone.hitTest(player.clip)) { ob.currAttack = 'attack_1'; ob.clip.gotoAndStop('attack_1'); getAttackFrame(ob); ob.frameTimer = ob.clip.mc._totalFrames; } else { ob.currAttack = 'breathe_fire'; ob.clip.gotoAndStop('breathe_fire'); ob.frameTimer = ob.clip.mc._totalFrames; ob.attackTimer = 3; } } else { ob.currAttack = 'attack_flail'; ob.clip.gotoAndStop('attack_flail'); ob.frameTimer = ob.clip.mc._totalFrames; var v5 = player.posX; if (player.dirX == 1) { v5 += player.velX * (14 - ob.hitsTaken * 2) + 10; } if (v5 > theWorld.backgroundNearLayer.currentLevel.mark_flail_height._x) { v5 = theWorld.backgroundNearLayer.currentLevel.mark_flail_height._x; } theWorld.backgroundNearLayer.currentLevel.flail._x = v5; theWorld.backgroundNearLayer.currentLevel.flailShadow._x = v5; theWorld.backgroundNearLayer.currentLevel.flailShadow._y = theWorld.backgroundNearLayer.currentLevel.mark_flail_height._y; theWorld.backgroundNearLayer.currentLevel.flailShadow._alpha = 100; theWorld.backgroundNearLayer.currentLevel.flailShadow._xscale = 60; ob.magnifyShadow = true; if (ob.fire == 2) { ob.fire = 3; } } } } else { ob.waitTimer -= 1; } } } else { if (ob.currAttack == 'attack_1') { ob.attackTimer -= 1; ob.frameTimer -= 1; if (ob.attackTimer == 0) { if (theWorld.backgroundNearLayer.currentLevel.attackZone.hitTest(player.clip)) { var v6 = player.posX; player.posX = theWorld.backgroundNearLayer.currentLevel.mark_playerBossX._x; player.clip._x = player.posX; camPos.difX -= player.posX - v6; camPos.virDifX -= player.posX - v6; player.movementDisabled = false; player.knockdownTimer = 0; player.isKnockdowned = false; player.stunTimer = 0; player.isStunned = false; player.staggerTimer = 0; startStunPlayer(50); addSound('hitFlesh_0' + Math.floor(Math.random() * 2 + 1) + '.wav', 40, 0, 0); if (player.life > 25 and !ob.instaGibba) { addEffect_Blood(player.bloodType, player.posX, player.posY - 30); updateHPRage(-25, 0); } else { playerGibVelX = -10; gibPlayer(); playerGibVelX = 0; } } } if (ob.frameTimer <= 0) { ob.canContest = true; if (theWorld.backgroundNearLayer.currentLevel.attackZone.hitTest(player.clip) and !ob.instaGibba) { ob.currAttack = 'attack_2'; ob.clip.gotoAndStop('attack_2'); getAttackFrame(ob); ob.frameTimer = ob.clip.mc._totalFrames; } else { ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; } } } else { if (ob.currAttack == 'attack_2') { ob.attackTimer -= 1; ob.frameTimer -= 1; if (ob.attackTimer == 0) { var v6 = player.posX; player.posX = theWorld.backgroundNearLayer.currentLevel.mark_playerBossX._x; player.clip._x = player.posX; camPos.difX -= player.posX - v6; camPos.virDifX -= player.posX - v6; player.movementDisabled = false; startStunPlayer(50); if (player.life > 25) { addEffect_Blood(player.bloodType, player.posX, player.posY - 30); updateHPRage(-25, 0); } else { addEffect_Blood(player.bloodType, player.posX, player.posY - 30); updateHPRage(-(player.life - 1), 0); } addSound('hitFlesh_0' + Math.floor(Math.random() * 2 + 1) + '.wav', 40, 0, 0); } if (ob.frameTimer == 2) { addSound('kick_0' + Math.round(Math.random() * 1 + 1) + '.wav', 70, 0, 0); if (player.life > 1) { ob.attackPhase = 0; player.movementDisabled = false; player.knockdownTimer = 0; player.isKnockdowned = false; player.stunTimer = 0; player.isStunned = false; player.staggerTimer = 0; startStunPlayer(1); startKnockdownPlayer(5); player.velY = -12; player.velX = -16; } else { playerGibVelX = -10; gibPlayer(); playerGibVelX = 0; } } if (ob.frameTimer <= 0) { ob.fire = 4; ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); ob.waitTimer = 48; } } else { if (ob.currAttack == 'breathe_fire') { ob.frameTimer -= 1; ob.attackTimer -= 1; if (ob.attackTimer <= 0 and ob.frameTimer >= 4) { if (!theWorld.backgroundNearLayer.currentLevel.safezone.hitTest(player.posX + camPos.difX, player.posY + camPos.difY, true) and theWorld.backgroundNearLayer.currentLevel.fireZone.hitTest(player.clip)) { if (player.life > 5) { updateHPRage(-5, 0); addEffect('fire_0' + (Math.floor(Math.random() * 4) + 1), player.posX - 15 + Math.random() * 30, player.posY - 10 - Math.random() * 40, 0, 2, player.dirX); } else { gibPlayer(); } } } if (ob.frameTimer <= 0) { ob.fire = 2; ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; ob.waitTimer = 30; } } else { if (ob.currAttack == 'attack_flail') { ob.currAttack = 'attack_flail'; ob.frameTimer -= 1; if (ob.magnifyShadow) { theWorld.backgroundNearLayer.currentLevel.flailShadow._xscale += 6; } if (ob.frameTimer <= 0) { ob.currAttack = 'flail_back'; ob.clip.gotoAndStop('flail_back'); ob.frameTimer = ob.clip.mc._totalFrames; theWorld.backgroundNearLayer.currentLevel.flail._alpha = 0; theWorld.backgroundNearLayer.currentLevel.chain._alpha = 0; theWorld.backgroundNearLayer.currentLevel.flailShadow._alpha = 0; } } else { if (ob.currAttack == 'flail_back') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); if (ob.hitsTaken == 1) { ob.waitTimer = 11; } else { if (ob.hitsTake == 2) { ob.waitTimer = 4; } else { ob.waitTimer = 23; } } } } } } } } } } } } } } } } } } } } } } } } } function demonOMGChain() { theWorld.backgroundNearLayer.currentLevel.chain._alpha = 100; theWorld.backgroundNearLayer.currentLevel.flail._alpha = 100; theWorld.backgroundNearLayer.currentLevel.flail._y = theWorld.backgroundNearLayer.currentLevel.mark_flail_height._y; theWorld.backgroundNearLayer.currentLevel.chain._x = myObject['enemy' + game.fightingBoss].posX + myObject['enemy' + game.fightingBoss].clip.mc.chain._x; theWorld.backgroundNearLayer.currentLevel.chain._y = myObject['enemy' + game.fightingBoss].posY + myObject['enemy' + game.fightingBoss].clip.mc.chain._y; myObject['enemy' + game.fightingBoss].magnifyShadow = false; var v2 = theWorld.backgroundNearLayer.currentLevel.chain._x - theWorld.backgroundNearLayer.currentLevel.flail._x; var v1 = theWorld.backgroundNearLayer.currentLevel.chain._y - theWorld.backgroundNearLayer.currentLevel.flail._y; theWorld.backgroundNearLayer.currentLevel.chain._rotation = 90 - Math.atan(v2 / v1) * 57.29577951308232; theWorld.backgroundNearLayer.currentLevel.chain.masken._width = Math.sqrt(v2 * v2 + v1 * v1) * 2; setCameraShake(6, 10); if (theWorld.backgroundNearLayer.currentLevel.flail.hitTest(player.clip) and !theWorld.backgroundNearLayer.currentLevel.flailNoneReach.hitTest(player.clip)) { player.movementDisabled = false; player.knockdownTimer = 0; player.isKnockdowned = false; player.stunTimer = 0; player.isStunned = false; player.staggerTimer = 0; startStunPlayer(1); startKnockdownPlayer(5); player.velY = -1; player.velX = -3; if (player.life > 50) { addEffect_Blood(player.bloodType, player.posX, player.posY - 30); updateHPRage(-50, 0); } else { gibPlayer(); } } theWorld.backgroundNearLayer.currentLevel.flail.gotoAndPlay(2); } function demonOMGSummon() { if (myObject['enemy' + game.fightingBoss].trackShield) { setCameraShake(4, 5); theWorld.backgroundNearLayer.currentLevel.boss_shield.gotoAndPlay('start'); theWorld.backgroundNearLayer.currentLevel.cam1._y += 300; theWorld.backgroundNearLayer.currentLevel.cam2._y += 300; if (myObject['enemy' + game.fightingBoss].hitsTaken == 0) { spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'SPEARMAN_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy._x -= 30; spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'SWORDSMAN_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy._x -= 30; spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'SPEARMAN_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy._x -= 30; spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'SWORDSMAN_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy._x += 90; } else { if (myObject['enemy' + game.fightingBoss].hitsTaken == 1) { spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'SWORDSMAN_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'ARCHER_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy._x -= 30; spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'ARCHER_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'SKELETON_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy._x -= 30; spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'SPEARMAN_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'SKELETON_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy._x -= 30; spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'SPEARMAN_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'SKELETON_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy._x -= 30; spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'SKELETON_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy._x += 120; } else { if (myObject['enemy' + game.fightingBoss].hitsTaken == 2) { spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'CHAOSKNIGHT_MACE_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'ARCHER_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy._x -= 30; spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'ARCHER_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'SKELETON_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy._x -= 30; spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'CHAOSKNIGHT_MACE_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'SKELETON_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy._x -= 30; spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'SKELETON_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy._x -= 30; spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'SKELETON_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); spawnEnemy(theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy, 'CHAOSKNIGHT_SWORD_1', -1, '/waveID-bw1/onDeathRunScript-bossWaveDeath/'); theWorld.backgroundNearLayer.currentLevel.mark_boss_enemy._x += 120; } } } myObject['enemy' + game.fightingBoss].waitTimer = 24; myObject['enemy' + game.fightingBoss].currAttack = 'waitForThePlayerToKillEverything'; } } function demonOMGHideObjects() { theWorld.backgroundNearLayer.currentLevel.flail._alpha = 0; theWorld.backgroundNearLayer.currentLevel.chain._alpha = 0; theWorld.backgroundNearLayer.currentLevel.flailShadow._alpha = 0; } function aiBOSSTROLL(ob) { ob.dirX = 1; ob.clip._xscale = 100 * ob.dirX; if (ob.staggerTimer > 0 or ob.stunTimer > 0 or ob.knockdownTimer > 0) { ob.clubDown = false; ob.knockdownTimer = 0; ob.stunTimer = 0; ob.staggerTimer = 0; ob.clip._xscale = 100; ob.currAttack = 'stunned'; ob.clip.gotoAndStop('hurt'); ob.frameTimer = ob.clip.mc._totalFrames; ob.immortal = true; ob.hitsTaken += 1; ob.hitsLeft -= 1; changeBossPlateHP(ob.hitsLeft, ob.maxHits); if (ob.hitsTaken == 3) { ob.clip.filters = [myRageGlow]; } if (ob.hitsTaken == 4) { ob.clip.filters = [myRageGlowAttacking]; } } if (theWorld.backgroundNearLayer.currentLevel.landBox.hitTest(player.posX + camPos.difX, player.posY + camPos.difY, true)) { ob.immortal = true; } if (ob.currAttack == 'none') { MapsCheckpointsReached[6] = true; ob.immortal = true; ob.shadowScale = 170; ob.enemyType = 'BOSS'; ob.totalFrameTimer = 0; ob.canDropHead = 0; ob.canDropArm = 0; ob.canBlock = 0; ob.canParry = 0; ob.hitsTaken = 0; ob.hitsLeft = 5; ob.maxHits = 5; addShadow(ob); game.fightingBoss = ob.ID; ob.currAttack = 'initDone'; } else { if (ob.currAttack == 'initDone') { if (theWorld.backgroundNearLayer.currentLevel.BT_throwArea.hitTest(player.clip) or theWorld.backgroundNearLayer.currentLevel.BT_pickupArea.hitTest(player.clip) or theWorld.backgroundNearLayer.currentLevel.BT_attackArea.hitTest(player.clip)) { ob.waitTimer = 35; ob.currAttack = 'idle'; ob.clubDown = false; ob.clubCollHitDown = false; } } else { if (ob.currAttack == 'stunned') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; ob.waitTimer = 20; } } else { if (ob.currAttack == 'idle') { if (ob.hitsTaken == 3) { ob.waitTimer += 14; } else { if (ob.hitsTaken == 4) { ob.waitTimer += 8; } else { ob.waitTimer += 20; } } if (ob.hitsTaken >= 3 and theWorld.backgroundNearLayer.currentLevel.BT_throwArea.hitTest(player.clip)) { ob.waitTimer -= 12; } ob.currAttack = 'waiting'; } else { if (ob.currAttack == 'waiting') { ob.waitTimer -= 1; if (ob.waitTimer <= 0 and !player.deathInitiated) { ob.immortal = true; if (theWorld.backgroundNearLayer.currentLevel.BT_throwArea.hitTest(player.clip)) { ob.currAttack = 'throwArea'; } else { if (theWorld.backgroundNearLayer.currentLevel.BT_pickupArea.hitTest(player.clip)) { ob.currAttack = 'pickupArea'; } else { if (theWorld.backgroundNearLayer.currentLevel.BT_attackArea.hitTest(player.clip)) { ob.currAttack = 'attackArea'; } } } } } else { if (ob.currAttack == 'attackArea') { ob.waitTimer -= 1; if (ob.waitTimer <= 0) { startAttack(ob, 'att_1'); ob.totalFrameTimer = ob.frameTimer; } } else { if (ob.currAttack == 'att_1') { if (ob.hitsTaken == 3 and ob.totalFrameTimer - ob.frameTimer == 24) { ob.clip.mc.gotoAndPlay('prepare'); ob.frameTimer -= ob.attackTimer; ob.attackTimer = 4; } if (ob.hitsTaken == 4 and ob.totalFrameTimer - ob.frameTimer == 21) { ob.clip.mc.gotoAndPlay('prepare'); ob.frameTimer -= ob.attackTimer; ob.attackTimer = 4; } ob.frameTimer -= 1; ob.attackTimer -= 1; if (ob.attackTimer == 0) { if (!ob.clubDown) { ob.clubDown = true; setCameraShake(5, 6); if (theWorld.backgroundNearLayer.currentLevel.BT_attackArea.hitTest(player.clip) and !theWorld.backgroundNearLayer.currentLevel.BT_throwArea.hitTest(player.clip)) { addBloodstain(player.posX, player.posY); player.velY = 5; startKnockdownPlayer(10); ob.oldDepth = ob.clip.getDepth(); ob.clip.swapDepths(1001); if (player.life > 25) { updateHPRage(-25, 0); } else { gibPlayer(); } addSound('kick_01.wav', 50, 0, 0); } else { if (!ob.clubCollHitDown) { theWorld.backgroundNearLayer.currentLevel.groundCollision.BOSS_club._y += 500; ob.clubCollHitDown = true; } } var v2 = ob.clip.mc._currentFrame; ob.clip.mc.gotoAndStop('lift_club'); ob.attackTimer = ob.clip.mc._currentFrame - v2; ob.clip.mc.gotoAndPlay(v2); } else { if (ob.clubCollHitDown) { if (theWorld.backgroundNearLayer.currentLevel.BT_liftArea.hitTest(player.clip)) { if (!player.isJumping) { player.isPreparingJump = true; player.isJumping = true; player.velY = -12; player.velX = (player.velX / 3) * 2; if (Math.sqrt(player.velX * player.velX) < 1.5) { player.velX = player.dirX * 1.5; } player.clip.gotoAndStop('jump'); player.clip.mc.gotoAndPlay('leave_ground'); } ob.waitTimer = 12; ob.immortal = false; } theWorld.backgroundNearLayer.currentLevel.groundCollision.BOSS_club._y -= 500; ob.clubCollHitDown = false; } else { ob.clip.swapDepths(ob.oldDepth); } } } if (ob.frameTimer <= 0) { ob.clubDown = false; ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; } } else { if (ob.currAttack == 'throwArea') { ob.waitTimer -= 1; if (ob.waitTimer <= 0) { addEffect('boss_troll_stone_01', ob.posX, ob.posY, 0, 0, 1); ob.clip.gotoAndStop('throw_rock'); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'throwStone'; } } else { if (ob.currAttack == 'throwStone') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; } } else { if (ob.currAttack == 'pickupArea') { ob.clip.gotoAndStop('catch_player'); ob.clip.mc.gotoAndStop('throw_player'); ob.attackTimer = ob.clip.mc._currentFrame; ob.clip.mc.gotoAndPlay(1); ob.frameTimer = ob.clip.mc._totalFrames; ob.currAttack = 'playerThrow'; player.movementDisabled = true; } else { if (ob.currAttack == 'playerThrow') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { ob.waitTimer = 8; ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; } ob.attackTimer -= 1; if (ob.attackTimer == 0) { player.dirX = -player.dirX; player.clip._xscale = player.dirX * 100; player.movementDisabled = false; startKnockdownPlayer(10); player.velY = -6; player.velX = -8; } } } } } } } } } } } } } function BOSS_TROLL_pickup() { if (player.movementDisabled) { var v2 = player.posX; var v1 = player.posY; player.dirX = -1; player.clip._xscale = player.dirX * 100; player.posX = myObject['enemy' + game.fightingBoss].posX + myObject['enemy' + game.fightingBoss].clip.mc.grip._x; player.posY = myObject['enemy' + game.fightingBoss].posY + myObject['enemy' + game.fightingBoss].clip.mc.grip._y; setuncontrollable(); player.clip._x = player.posX; player.clip._y = player.posY; player.clip.gotoAndStop('eff_pickup'); if (game.stopCam == 0) { camPos.difX -= player.posX - v2; } camPos.virDifX -= player.posX - v2; if (Math.sqrt((player.posY - v1) * (player.posY - v1)) >= 1) { player.clip._y = player.posY; camPos.difY -= player.posY - v1; camPos.virDifY -= player.posY - v1; } else { player.posY = v1; } } } function BOSS_TROLL_stoneImpact() { if (theWorld.backgroundNearLayer.currentLevel.BT_throwArea.hitTest(player.clip)) { player.isPreparingJump = true; player.isJumping = true; player.posY -= 4; player.dirX = -1; player.clip._xscale = player.dirX * 100; startKnockdownPlayer(10); player.velX = 4; player.velY = -5; if (player.life > 20) { updateHPRage(-20, 0); } else { gibPlayer(); } } } function BOSS_TROLL_DEAD_HIT_MTDAM() { theWorld.backgroundNearLayer.currentLevel.bkdam.gotoAndStop('break'); theWorld.foregroundLayer.currentLevel_foreground.mtdam.gotoAndPlay('break'); _root.levelFinished(); } function aiBOSSDARKCOPY(ob) { changeBossPlateHP(ob.life, ob.maxLife); if (ob.isFalling) { enemyUncontrollable(ob); enemyFalling(ob); } else { if (ob.knockdownTimer > 0) { enemyUncontrollable(ob); enemyKnockdowned(ob); } else { if (ob.stunTimer > 0) { enemyUncontrollable(ob); enemyStun(ob); } else { if (ob.staggerTimer > 0) { enemyUncontrollable(ob); enemyStagger(ob); } else { if (ob.currAttack == 'contesting') { if (!player.immortal) { ob.grabPlayerAfterAttack = true; startAttack(ob, 'att_1'); } else { setEnemyPlayerPos(ob); } } else { if (ob.currAttack == 'none') { ob.grabPlayerAfterAttack = false; ob.runDistToPlayer = 45; ob.speed = 5; ob.jumpAttackPerformed = false; ob.enemyType = 'DARKCOPY'; ob.canDropHead = 0; ob.canDropArm = 0; ob.canBlock = 0; ob.canParry = 0; game.fightingBoss = ob.ID; ob.currAttack = 'initDone'; changeColour(ob.clip, 10, 10, 10, 0, 0, 0); ob.maxLife = ob.life; ob.UNI_stunR = 70; ob.UNI_staggerR = 70; ob.UNI_knockdownR = 100; ob.isUNI = true; ob.canParry = 1; ob.canBlock = 1; ob.waitStartTimer = 40; } else { if (ob.currAttack == 'startFight') { MapsCheckpointsReached[16] = true; ob.waitStartTimer -= 1; if (ob.waitStartTimer <= 0) { ob.currAttack = 'idle'; } } else { if (ob.currAttack == 'idle') { var v6 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); facePlayer(ob); if (player.isStunned or player.staggerTimer > 20) { ob.currAttack = 'runGrab'; ob.clip.gotoAndStop('run'); } else { if (v6 > ob.runDistToPlayer) { ob.currAttack = 'run'; ob.clip.gotoAndStop('run'); } else { if (Math.random() * 100 <= 15 and !player.immortal) { var v5 = Math.sqrt((ob.posY - player.posY) * (ob.posY - player.posY)); if (v5 < 50) { if (Math.random() * 100 <= 60) { if (Math.random() * 100 <= 20) { ob.jumpAttackPerformed = false; player.dirX = -ob.dirX; enemyJumps(ob, ob.dirX * 2, -10); startStaggerPlayer(24); } else { startAttack(ob, 'att_1'); } } else { startAttack(ob, 'att_s'); } } else { if (!player.isJumping) { ob.jumpAttackPerformed = false; if (player.posY - ob.posY > 0) { enemyJumps(ob, ob.dirX * 3, -7); } else { enemyJumps(ob, ob.dirX * 3, -10); } } } } } } } else { if (ob.currAttack == 'run') { facePlayer(ob); var v4 = ob.dirX * ob.speed; if (ob.velX < ob.dirX and ob.dirX == 1 or ob.velX > ob.dirX and ob.dirX == -1) { ob.velX = 0; } ob.velX = countToNumber(ob.velX, v4, 1); moveEnemyXAxis(ob); var v6 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); var v5 = Math.sqrt((ob.posY - player.posY) * (ob.posY - player.posY)); if (v5 > 5) { v6 -= 60; } if (v6 < ob.runDistToPlayer) { if (v5 > 5) { enemyJumps(ob, ob.dirX * 5, -8); } else { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); ob.velX = 0; } } else { if (v6 > ob.runDistToPlayer * 2 and v6 < ob.runDistToPlayer * 3 and Math.random() * 100 <= 10) { ob.jumpAttackPerformed = false; enemyJumps(ob, ob.dirX * 3, -10); } } } else { if (ob.currAttack == 'headKnock') { ob.frameTimer -= 1; ob.attackTimer -= 1; if (ob.attackTimer == 0) { addEffect_Blood(player.bloodType, player.posX, player.posY); setCameraShake(6, 4); if (player.life > 5) { updateHPRage(-4, 0); } else { ob.knocksDone = 3; } } if (ob.frameTimer <= 0) { ob.currAttack = 'grab'; ob.clip.gotoAndStop('grab'); ob.waitTimer = 12; } } else { if (ob.currAttack == 'throwPlayer') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } else { if (ob.currAttack == 'grab') { ob.waitTimer -= 1; if (ob.waitTimer <= 0) { ob.knocksDone += 1; if (ob.knocksDone >= 3) { rollCameraYAxis = -20; ob.currAttack = 'throwPlayer'; ob.clip.gotoAndStop('throw'); ob.frameTimer = ob.clip.mc._totalFrames; player.dirX = -player.dirX; player.clip._xscale = player.dirX * 100; player.movementDisabled = false; startKnockdownPlayer(10); player.velY = -5; player.velX = 6 * player.dirX; } else { ob.clip.gotoAndStop('knock'); ob.currAttack = 'headKnock'; ob.frameTimer = ob.clip.mc._totalFrames; ob.attackTimer = 5; } } } else { if (ob.currAttack == 'runGrab') { facePlayer(ob); var v4 = ob.dirX * (ob.speed + 1); if (ob.velX < ob.dirX and ob.dirX == 1 or ob.velX > ob.dirX and ob.dirX == -1) { ob.velX = 0; } ob.velX = countToNumber(ob.velX, v4, 1); moveEnemyXAxis(ob); if (!player.isStunned and player.staggerTimer <= 0) { ob.currAttack = 'run'; ob.clip.gotoAndStop('run'); } else { var v6 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); if (v6 < 30) { player.staggerTimer = 0; rollCameraYAxis = 20; ob.currAttack = 'grab'; ob.clip.gotoAndStop('grab'); ob.knocksDone = 0; ob.waitTimer = 12; ob.velX = 0; player.stunTimer = 0; player.isStunned = false; player.movementDisabled = true; var v3 = player.posX; var v2 = player.posY; player.dirX = -ob.dirX; player.clip._xscale = player.dirX * 100; player.posX = ob.posX + ob.clip.mc.grip._x * ob.dirX; player.posY = ob.posY + ob.clip.mc.grip._y; setuncontrollable(); player.clip._x = player.posX; player.clip._y = player.posY; player.clip.gotoAndStop('eff_pickup'); if (game.stopCam == 0) { camPos.difX -= player.posX - v3; } camPos.virDifX -= player.posX - v3; if (Math.sqrt((player.posY - v2) * (player.posY - v2)) >= 1) { player.clip._y = player.posY; camPos.difY -= player.posY - v2; camPos.virDifY -= player.posY - v2; } else { player.posY = v2; } moveShadow(player); } } } else { if (ob.currAttack == 'jump') { enemyJumping(ob); if (ob.velY > 0) { ob.clip.mc.gotoAndPlay('fall'); if (!ob.jumpAttackPerformed) { var v6 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); var v5 = Math.sqrt((ob.posY - player.posY) * (ob.posY - player.posY)); if (v6 < 65 and v5 < 50 and facingOb(ob, player)) { cleavePlayer(ob, 60, 8, false); player.dirX = -ob.dirX; ob.clip.gotoAndStop('att_jump'); ob.jumpAttackPerformed = true; if (ob.attackTimer == 0) { if (Math.random() * 100 <= 20) { startStunPlayer(24); } } } } } } else { if (ob.currAttack == 'att_1') { ob.frameTimer -= 1; checkAttack(ob, 50, 3, true); if (ob.frameTimer <= 0) { if (ob.grabPlayerAfterAttack) { ob.grabPlayerAfterAttack = false; ob.currAttack = 'runGrab'; ob.clip.gotoAndStop('run'); } else { facePlayer(ob); var v6 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); if (v6 < 50) { if (Math.random() * 100 < 90) { startAttack(ob, 'att_2'); } else { startAttack(ob, 'att_s'); } } else { ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; } } } } else { if (ob.currAttack == 'att_2') { ob.frameTimer -= 1; checkAttack(ob, 50, 4, true); if (ob.frameTimer <= 0) { facePlayer(ob); var v6 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX)); if (v6 < 63) { if (Math.random() * 100 < 80) { startAttack(ob, 'att_3'); } else { startAttack(ob, 'att_s'); } } else { ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; } } } else { if (ob.currAttack == 'att_3') { ob.frameTimer -= 1; checkAttack(ob, 63, 5, true); if (ob.frameTimer <= 0) { facePlayer(ob); ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; } } else { if (ob.currAttack == 'blocking') { ob.frameTimer -= 1; if (ob.frameTimer <= 0) { if (ob.blocksPerformed >= 3) { ob.blocksPerformed = 0; if (Math.random() * 100 <= 50) { ob.jumpAttackPerformed = false; player.dirX = -ob.dirX; enemyJumps(ob, ob.dirX * 2, -10); startStaggerPlayer(35); } else { startAttack(ob, 'att_1'); } } else { ob.frameTimer = 0; ob.currAttack = 'idle'; ob.clip.gotoAndStop('idle'); } } } else { if (ob.currAttack == 'att_s') { ob.frameTimer -= 1; checkAttack(ob, 65, 7, false); if (ob.attackTimer == 0) { if (Math.random() * 100 <= 20) { startStunPlayer(24); } } if (ob.frameTimer <= 0) { facePlayer(ob); ob.clip.gotoAndStop('idle'); ob.currAttack = 'idle'; } } } } } } } } } } } } } } } } } } } } } function clearBOSoSData() { deleteOldSaved(); saveBOSoS(); } function deleteOldSaved() { delete localData.data.maxLevelCleared; delete localData.data.MapsCleared; delete localData.data.lastVerRun; delete localData.data.lastLevelPlayed; delete localData.data.BSRecord; delete localData.data.TutorialGuide; oldSavedGameExist = false; BSRecord = 0; player.levelsCompletedTotal = 1; game.maxLevelCleared = 0; game.currentLevel = 0; WorldMapPlayerMoving = false; MapsCheckpointsReached = new Array(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); MapsCleared = new Array(true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); TutorialGuide = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } function saveBOSoS() { oldSavedGameExist = true; localData.data.levelsCompletedTotal = player.levelsCompletedTotal; localData.data.MapsCheckpointsReached = MapsCheckpointsReached; localData.data.MapsCleared = MapsCleared; localData.data.maxLevelCleared = game.maxLevelCleared; localData.data.lastVerRun = BOSoS_ver; localData.data.lastLevelPlayed = game.currentLevel; localData.data.BSRecord = BSRecord; localData.data.TutorialGuide = TutorialGuide; localData.flush(500); } function loadBOSoS() { if (localData.data.TutorialGuide != undefined) { oldSavedGameExist = true; player.levelsCompletedTotal = localData.data.levelsCompletedTotal; MapsCleared = localData.data.MapsCleared; game.currentLevel = localData.data.lastLevelPlayed; if (MapsCleared[game.currentLevel + 1]) { game.currentLevel += 1; } game.maxLevelCleared = localData.data.maxLevelCleared; MapsCheckpointsReached = localData.data.MapsCheckpointsReached; BSRecord = localData.data.BSRecord; TutorialGuide = localData.data.TutorialGuide; var v1 = localData.data.lastVerRun; if (v1 != BOSoS_ver) { if (v1 == '01.00.00') { TutorialGuide[15] = 0; TutorialGuide[16] = 0; TutorialGuide[17] = 0; TutorialGuide[18] = 0; v1 = '01.00.01'; } saveBOSoS(); } } } var BOSoS_ver = '01.00.01'; var BOSoS_CHEATS = true; var cheatingActivated = false; var cheatMenuPos = ''; var showEncyclopedia = false; var timerEncyclopedia = 0; var timersEncy = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0); Number = _root._xmouse; Number = _root._ymouse; Number = 0; Boolean = false; Boolean = false; Boolean = false; Boolean = false; Boolean = false; Boolean = true; Boolean = true; Boolean = true; Boolean = false; var MD = {'mPosX': Number, 'mPosY': Number, 'moveX': 0, 'dragging': Boolean, 'moved': Boolean, 'showMouse': Boolean, 'inWorldMap': Boolean, 'forcePointer': Boolean, 'canDrag': Boolean, 'ableToDrag': Boolean, 'fadeInMaps': Boolean, 'showSign': Boolean}; var oldSavedGameExist = false; Number = 0; Number = 0; Number = 0; Boolean = false; Boolean = false; var thunderValues = {'thunderChance': 0, 'thunderCD': 0, 'nextCheck': 0, 'firstSoundDone': Boolean, 'backgroundThunder': Boolean}; var camFollow = 'none'; Number = 0; Number = 0; Number = 0; Number = 0; Number = -9999; Number = 9999; var camPos = {'difX': 0, 'difY': 0, 'virDifX': 0, 'virDifY': 0, 'minX': -9999, 'maxX': 9999}; Boolean = false; Number = 0; Number = 1; Number = 0; Number = 0; Boolean = false; Boolean = false; Boolean = false; Number = 100; Number = 0; Boolean = false; Boolean = false; Number = 0; Boolean = false; Boolean = false; Number = 0; Boolean = false; Number = 0; Boolean = false; Number = 0; Number = 0; Number = 36; Boolean = false; Number = 0; Boolean = false; Number = 0; Number = 0; Boolean = false; Number = 0; Boolean = false; Number = 0; Boolean = false; Number = 0; Number = 0; Number = 0; Number = 0; Boolean = false; Number = 0; String = 'blood_s_'; Boolean = false; Number = 100; Number = 0; Number = 0; Number = 1; Boolean = false; Boolean = false; Boolean = false; Boolean = false; Boolean = true; Boolean = false; Number = 0; var player = {'deathInitiated': Boolean, 'posX': 0, 'posY': 0, 'dirX': 1, 'velX': 0, 'velY': 0, 'isPreparingJump': Boolean, 'isJumping': Boolean, 'isFalling': Boolean, 'shadowScale': 100, 'isCarringBarrel': 0, 'isHoldingBarrel': Boolean, 'isThrowingBarrel': Boolean, 'currentAttack': 0, 'performNextAttack': Boolean, 'jumpAttackPerformed': Boolean, 'staggerTimer': 0, 'uncontrollable': Boolean, 'arrowCounter': 0, 'isKnockdowned': Boolean, 'knockdownTimer': 0, 'blurTimer': 0, 'normalWidth': 36, 'barrelThrowed': Boolean, 'attackPause': 0, 'isStunned': Boolean, 'stunTimer': 0, 'parryTimer': 0, 'nextAttackPossible': Boolean, 'holdingEnemy': 0, 'isThrowingEnemy': Boolean, 'headKnocksDone': 0, 'doingHeadKnock': Boolean, 'holdingEnemyTimer': 0, 'contesting': 0, 'contestingTimer': 0, 'contestingPower': 0, 'immortal': Boolean, 'finishingEnemy': 0, 'bloodType': 'blood_s_', 'movementDisabled': false, 'skipNextStagger': false, 'resetDone': Boolean, 'life': 100, 'rage': 0, 'rageTimer': 0, 'levelsCompletedTotal': 1, 'gibbed': Boolean, 'fallDeath': Boolean, 'startFromCheckpoint': Boolean, 'movingInXAxis': Boolean, 'canPerformStrongRun': Boolean, 'rageInit': Boolean, 'nrOfKills': 0}; var BSRecord = 0; Number = 0.6; Number = 8; Number = 0; Number = 100; Number = 0; Number = 0; Boolean = true; Boolean = false; Boolean = true; Number = 0; Number = 0; Number = 0; Number = 0; Boolean = false; Boolean = false; Number = 0; String = 'nothing'; Number = 0; Boolean = false; var game = {'gravity': 0.6, 'physicAccuracy': 8, 'rootRotation': 0, 'rootZoom': 100, 'shadows': 0, 'stopCam': 0, 'inMenu': Boolean, 'inWorldmap': Boolean, 'isPaused': Boolean, 'camShakeTime': 0, 'camShakePower': 0, 'currentLevel': 0, 'fightingBoss': 0, 'lockCam': Boolean, 'levelFinished': Boolean, 'maxLevelCleared': 0, 'weatherType': 'nothing', 'initSat': 0, 'allSoundsStopped': Boolean}; var rollCameraYAxis = 0; var demoOver = false; Number = 140; Number = 55; Number = 14; var options = {'blurEffects': true, 'zoomEffects': true, 'rotationEffects': true, 'bloodParticles': 140, 'partParticles': 55, 'bodies': 14}; var oldRotationEffectValue = options.rotationEffects; String = 'none_0'; Number = 0; String = 'none'; Number = 0; var gameEvent = {'waveID': 'none_0', 'nrLeftInWave': 0, 'onDeathRunScript': 'none', 'nextWaveTimer': 0}; Number = 0; Number = 0; var bgFar = {'posX': 0, 'posY': 0}; var localData = SharedObject.getLocal('BOSoS_01'); var canToggleFullscreen = true; var globalSound = new Sound(this); var globalSoundVolume = 80; var globalMusicVolume = 80; globalSound.setVolume(globalSoundVolume); not0.visible = true; not1.visible = true; not2.visible = true; not3.visible = true; not4.visible = true; not0.enabled = true; not1.enabled = true; not2.enabled = true; var myObject = {}; myObject.emptyCircle = function () {}; myObject.emptyCircle.prototype.ID = 0; myObject.emptyCircle.prototype.posX = 0; myObject.emptyCircle.prototype.posY = 0; myObject.emptyCircle.prototype.velX = 0; myObject.emptyCircle.prototype.velY = 0; myObject.emptyCircle.prototype.life = 100; myObject.emptyCircle.prototype.radius = 16; myObject.emptyCircle.prototype.inMove = true; myObject.emptyCircle.prototype.inGame = true; myObject.emptyCircle.prototype.tiltDiff = 0; myObject.emptyCircle.prototype.canSpawnSkeleton = true; myObject.emptyCircle.prototype.arrowCounter = 0; myObject.emptyCircle.prototype.frictionForce = 0.35; myObject.emptyCircle.prototype.bounceForce = 0.3; myObject.emptyCircle.prototype.shadowScale = 75; myObject.emptyMolotov = function () {}; myObject.emptyMolotov.prototype.posX = 0; myObject.emptyMolotov.prototype.posY = 0; myObject.emptyMolotov.prototype.velX = 0; myObject.emptyMolotov.prototype.velY = 0; myObject.emptyMolotov.prototype.inGame = true; myObject.emptyMolotov.prototype.velRotation = 0; myObject.emptyMolotov.prototype.traceTimer = 0; myObject.emptyShockwave = function () {}; myObject.emptyShockwave.prototype.posX = 0; myObject.emptyShockwave.prototype.posY = 0; myObject.emptyShockwave.prototype.velX = 0; myObject.emptyShockwave.prototype.playerHits = 0; myObject.emptyShockwave.prototype.playerHitCD = 0; myObject.emptyShockwave.prototype.dirX = 1; myObject.emptyShockwave.prototype.inGame = true; myObject.emptyShockwave.prototype.traceTimer = 0; myObject.emptyArrow = function () {}; myObject.emptyArrow.prototype.posX = 0; myObject.emptyArrow.prototype.posY = 0; myObject.emptyArrow.prototype.velX = 0; myObject.emptyArrow.prototype.damage = 0; myObject.emptyArrow.prototype.spec = 'none'; myObject.emptyArrow.prototype.traceTimer = 0; myObject.emptyArrow.prototype.velY = 0; myObject.emptyArrow.prototype.shadowScale = 60; myObject.emptyArrow.prototype.inGame = true; myObject.emptyBlood = function () {}; myObject.emptyBlood.prototype.posX = 0; myObject.emptyBlood.prototype.posY = 0; myObject.emptyBlood.prototype.velX = 0; myObject.emptyBlood.prototype.velY = 0; myObject.emptyBlood.prototype.inGame = true; myObject.emptyPart = function () {}; myObject.emptyPart.prototype.posX = 0; myObject.emptyPart.prototype.posY = 0; myObject.emptyPart.prototype.velX = 0; myObject.emptyPart.prototype.velY = 0; myObject.emptyPart.prototype.blurTimer = 0; myObject.emptyPart.prototype.bloodstain = false; myObject.emptyPart.prototype.airTrail = false; myObject.emptyPart.prototype.airTrailTimer = 0; myObject.emptyPart.prototype.inGame = true; myObject.emptyEnemy = function () {}; myObject.emptyEnemy.prototype.inGame = true; myObject.emptyEnemy.prototype.posX = 0; myObject.emptyEnemy.prototype.posY = 0; myObject.emptyEnemy.prototype.velX = 0; myObject.emptyEnemy.prototype.velY = 0; myObject.emptyEnemy.prototype.dirX = 1; myObject.emptyEnemy.prototype.AIType = 'blank'; myObject.emptyEnemy.prototype.currAttack = 'none'; myObject.emptyEnemy.prototype.frameTimer = 0; myObject.emptyEnemy.prototype.attackTimer = 0; myObject.emptyEnemy.prototype.attackRangeY = 50; myObject.emptyEnemy.prototype.life = 100; myObject.emptyEnemy.prototype.rotationSpeed = 0; myObject.emptyEnemy.prototype.enemyValues = '/blank-NaN/'; myObject.emptyEnemy.prototype.bloodType = 'blood_s_'; myObject.emptyEnemy.prototype.bloodStain = 0; myObject.emptyEnemy.prototype.shadowScale = 100; myObject.emptyEnemy.prototype.deathBody = true; myObject.emptyEnemy.prototype.canDropHead = 0; myObject.emptyEnemy.prototype.canDropArm = 0; myObject.emptyEnemy.prototype.armDropType = 'none'; myObject.emptyEnemy.prototype.headDropType = 'none'; myObject.emptyEnemy.prototype.armDropped = false; myObject.emptyEnemy.prototype.staggerTimer = 0; myObject.emptyEnemy.prototype.maxLife = 0; myObject.emptyEnemy.prototype.stunTimer = 0; myObject.emptyEnemy.prototype.blurTimer = 0; myObject.emptyEnemy.prototype.knockdownTimer = 0; myObject.emptyEnemy.prototype.finishingDone = false; myObject.emptyEnemy.prototype.pickedup = false; myObject.emptyEnemy.prototype.blocksPerformed = 0; myObject.emptyEnemy.prototype.attacksPlayerParried = 0; myObject.emptyEnemy.prototype.attacksMissedInRow = 0; myObject.emptyEnemy.prototype.ID = 0; myObject.emptyEnemy.prototype.waveID = '0'; myObject.emptyEnemy.prototype.isJumping = false; myObject.emptyEnemy.prototype.isEnemy = true; myObject.emptyEnemy.prototype.isFalling = false; myObject.emptyEnemy.prototype.seenPlayer = false; myObject.emptyEnemy.prototype.immortal = false; myObject.emptyEnemy.prototype.deathScriptRun = false; myObject.emptyEnemy.prototype.enemyType = 'default'; myObject.emptyEnemy.prototype.barrelImmune = 0; myObject.emptyEnemy.prototype.barrelsKnocked = 0; myObject.emptyEnemy.prototype.forceDownALedge = false; myObject.emptyFoodCrate = function () {}; myObject.emptyFoodCrate.prototype.inGame = true; myObject.emptyFoodCrate.prototype.posX = 0; myObject.emptyFoodCrate.prototype.posY = 0; myObject.emptyFood = function () {}; myObject.emptyFood.prototype.inGame = true; myObject.emptyFood.prototype.posX = 0; myObject.emptyFood.prototype.posY = 0; var foodCounter = 0; var foodCrateCounter = 0; var circleCounter = 0; var arrowCounter = 0; var enemyCounter = 0; var minArrowCounter = 0; var effectCounter = 0; var partCounter = 0; var staticEffectsCounter = 0; var staticEffectsCounterParts = 0; var bloodstainCounter = 0; var deathObjects = 0; var spawnMapTimer = 0; var TutorialArray = new Array(50); var MapsCleared = new Array(true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); var MapsCheckpointsReached = new Array(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); var TutorialGuide = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); _root.createEmptyMovieClip('interfaceLayer', 29); interfaceLayer.attachMovie('ratioFix', 'ratioFix', 10); interfaceLayer.ratioFix.gotoAndStop('empty'); interfaceLayer.attachMovie('Encyclopedia', 'Encyclopedia', 25); Number = 0; Number = 0; Boolean = true; Boolean = true; Number = 0; String = 'none'; Number = 0; Number = 0; var TG = {'forceFadeTimer': 0, 'fadeTimer': 0, 'checkForKick': Boolean, 'checkForFin': Boolean, 'stopTimer': 0, 'traceAction': 'none', 'traceAimID': 0, 'prio': 0}; interfaceLayer.attachMovie('screenSize', 'screenSize', 11); timerEncyclopedia = setInterval(initTimering, 100); _root.createEmptyMovieClip('sound_ambience_1', 12300); var sound_ambience = new Sound(_root.sound_ambience_1); _root.createEmptyMovieClip('sound_ambience_2', 12301); var sound_ambience2 = new Sound(_root.sound_ambience_2); _root.createEmptyMovieClip('sound_ambience_3', 12302); var sound_ambience3 = new Sound(_root.sound_ambience_3); var fadingMusicing2 = 0; var fadingMusicing3 = 0; var fadingMusicing2Step = 0; var fadingMusicing3Step = 0; var currMusicTrack = 2; var musicTrack2Transition = 0; var musicTrack3Transition = 0; var musicTrack2Steps = 0; var musicTrack3Steps = 0; var musicTrack2Target = 0; var musicTrack3Target = 0; var musicTrack2BTarget = 0; var musicTrack3BTarget = 0; var globalMusicStartEnabled = false; var i = 1; while (i <= 100) { _root.createEmptyMovieClip('mySound_' + i, 1001 + i); ++i; } var MapScriptForThisLevelAble = false; _root.createEmptyMovieClip('contest_sound_bla', 13523); var contest_sound = new Sound(_root.contest_sound_bla); contest_sound.attachSound('contest.wav'); contest_sound.stop(); interfaceLayer.attachMovie('gameCursor', 'gameCursor', 40); var MapsConnected = new Array([1], [2], [1, 3, 20], [2, 4, 7], [3, 5], [4, 6], [5], [3, 8], [7, 9], [8, 10], [9, 11, 13], [10, 12], [11], [10, 14], [13, 15], [14, 16], [15, 17], [16, 18], [17, 19], [18], [2, 21], [20]); var MapsName = new Array('NAMELESS', 'THE FOOTHILLS', 'THE DARK PLAINS', 'THE NAMELESS WOODS', 'THE DEAD MINES', 'GOBLIN HEAD PASS', 'MT. DAM', 'LAKEBRIDGE', 'A BLOODY SWAMP', 'THE BLOODY HILLS', 'GRANNY\'S GLEN', 'THE HIGHLANDS', 'DRAGONSNOUT MOUNTAIN', 'THE PASS', 'THE TUNDRA', 'THE FIELDS OF KHELVIN', 'THE MAW OF CHAOS', 'THE MOUNTAINS OF MADNESS', 'THE GORGE OF DEATH', 'THE PLATEAU OF ENTROPY', 'BARBARIAN STRONGHOLD', 'BARBARIAN LABORATORY', 'NAMELESS'); var MapsBoss = new Array(6, 8, 10, 12, 16, 18, 19); var MapsToFadeIn = new Array(); var hideMapsFromScript = false; var showingAllMaps = true; var WorldMapPlayerMoving = false; var WorldMapPlayerPath = new Array(); var tiltDifForce = 10; Number = 100; Number = 100; Number = 100; Number = 100; var scaleOb = {'R1': 100, 'G1': 100, 'B1': 100, 'uni_scale': 100}; var step = 1; var soundCounter = 0; this.onMouseDown = function () { if (MD.showMouse) { Mouse.hide(); } if (BOSoS_CHEATS) { if (traceKeysPressed.ctrlPressed) { var v1 = 1; while (v1 <= 10) { if (Key.isDown(48 + v1)) { switch (v1) { case 1: activateCheat('Spawn Swordsman'); break; case 2: activateCheat('Spawn Archer'); break; case 3: activateCheat('Spawn Spearman'); break; case 4: activateCheat('Spawn Skeleton'); break; case 5: activateCheat('Spawn Chaos Knight (Sword)'); break; case 6: activateCheat('Spawn Chaos Knight (Mace)'); break; case 7: activateCheat('Spawn Unique (Random)'); break; case 8: activateCheat('Spawn Crow'); } } ++v1; } } else { if (Key.isDown(18)) { var v1 = 1; while (v1 <= 10) { if (Key.isDown(48 + v1)) { switch (v1) { case 1: activateCheat('Spawn Barrel'); break; case 2: activateCheat('Spawn Explosive Barrel'); break; case 3: activateCheat('Spawn Barrel Random'); } } ++v1; } } } } }; Boolean = false; Boolean = false; Boolean = false; Boolean = false; Boolean = false; Boolean = false; Boolean = false; var traceKeysPressed = {'ctrlPressed': Boolean, 'shiftPressed': Boolean, 'rightPressed': Boolean, 'leftPressed': Boolean, 'rightSecondPressed': Boolean, 'leftSecondPressed': Boolean, 'spacePressed': Boolean}; Boolean = false; Boolean = false; Boolean = false; Boolean = false; Number = 0; Boolean = false; Boolean = false; var key = {'rightPressed': Boolean, 'leftPressed': Boolean, 'spacePressed': Boolean, 'spaceTabbed': Boolean, 'spacePower': 0, 'upPressed': Boolean, 'bPressed': Boolean}; var keyListener = new Object(); keyListener.onKeyDown = function () { var v4 = Key.getCode(); switch (v4) { case 17: traceKeysPressed.ctrlPressed = true; break; case 16: traceKeysPressed.shiftPressed = true; break; case 32: traceKeysPressed.spacePressed = true; break; case 37: traceKeysPressed.leftPressed = true; break; case 65: traceKeysPressed.leftSecondPressed = true; break; case 39: traceKeysPressed.rightPressed = true; break; case 68: traceKeysPressed.rightSecondPressed = true; } if (TG.traceAction == 'move') { if (traceKeysPressed.rightPressed or traceKeysPressed.leftPressed or traceKeysPressed.rightSecondPressed or traceKeysPressed.leftSecondPressed) { fadeTutorialGuide(); } } if (cheatingActivated) { var v5 = new TextFormat(); v5.letterSpacing = -0.5; v5.size = 11; v5.bold = true; v5.font = 'Tahoma'; if (v4 == 82) { interfaceLayer.ratioFix.cheat_txt.htmlText = '<b>Cheat List</b><br>1 - Spawn Objects<br>2 - Commands<br>3 - Music'; cheatMenuPos = 'root_0'; } else { var v2 = 1; while (v2 <= 10) { if (v4 == 48 + v2) { if (cheatMenuPos == 'root_0') { switch (v2) { case 1: interfaceLayer.ratioFix.cheat_txt.htmlText = '<b>Spawn Objects</b><br>1 - Spawn Enemies<br>2 - Spawn Barrels<br>R - Return<br>'; cheatMenuPos = 'SpawnObjectsList'; break; case 2: interfaceLayer.ratioFix.cheat_txt.htmlText = '<b>Commands</b><br>1 - Full Health<br>2 - Full Rage<br>3 - Destory All Barrels and Arrows<br>4 - Stun All Enemies<br>5 - Kill All Enemies<br>9 - Finish Level<br>R - Return<br><br>You can also press 1-9'; cheatMenuPos = 'CheatCommands'; break; case 3: interfaceLayer.ratioFix.cheat_txt.htmlText = '<b>Music, composed by hzlancer</b><br>1 - Dayspring<br>2 - Noontide<br>3 - Evenfall<br>4 - The Path of Iron<br>5 - The Secret of Steel<br>6 - Haven<br>7 - Iron Will<br>R - Return<br>'; cheatMenuPos = 'MusicList'; } } else { if (cheatMenuPos == 'SpawnObjectsList') { switch (v2) { case 1: interfaceLayer.ratioFix.cheat_txt.htmlText = '<b>Spawn Enemies (at cursor)</b><br>1 - Spawn Swordsman<br>2 - Spawn Archer<br>3 - Spawn Spearman<br>4 - Spawn Skeleton<br>5 - Spawn Chaos Knight (Sword)<br>6 - Spawn Chaos Knight (Mace)<br>7 - Spawn Unique (Random)<br>8 - Spawn Crow<br>R - Return<br><br>You can also press Ctrl + 1-9 + Mouse1'; cheatMenuPos = 'ChooseEnemyToSpawn'; break; case 2: interfaceLayer.ratioFix.cheat_txt.htmlText = '<b>Spawn Barrels (at cursor)</b><br>1 - Spawn Barrel<br>2 - Spawn Explosive Barrel<br>3 - Spawn Random Barrel<br>R - Return<br><br>You can also press Alt + 1-9 + Mouse1'; cheatMenuPos = 'ChooseBarrelToSpawn'; } } else { if (cheatMenuPos == 'ChooseEnemyToSpawn') { switch (v2) { case 1: activateCheat('Spawn Swordsman'); break; case 2: activateCheat('Spawn Archer'); break; case 3: activateCheat('Spawn Spearman'); break; case 4: activateCheat('Spawn Skeleton'); break; case 5: activateCheat('Spawn Chaos Knight (Sword)'); break; case 6: activateCheat('Spawn Chaos Knight (Mace)'); break; case 7: activateCheat('Spawn Unique (Random)'); break; case 8: activateCheat('Spawn Crow'); } } else { if (cheatMenuPos == 'ChooseBarrelToSpawn') { switch (v2) { case 1: activateCheat('Spawn Barrel'); break; case 2: activateCheat('Spawn Explosive Barrel'); break; case 3: activateCheat('Spawn Barrel Random'); } } else { if (cheatMenuPos == 'CheatCommands') { switch (v2) { case 1: activateCheat('Full Health'); break; case 2: activateCheat('Full Rage'); break; case 3: activateCheat('Destroy All Barrels and Arrows'); break; case 4: activateCheat('Stun All Enemies'); break; case 5: activateCheat('Kill All Enemies'); break; case 9: activateCheat('Finish Level'); } } else { if (cheatMenuPos == 'MusicList') { switch (v2) { case 1: activateCheat('Track1'); break; case 2: activateCheat('Track2'); break; case 3: activateCheat('Track3'); break; case 4: activateCheat('TrackBoss'); break; case 5: activateCheat('TrackBossFinal'); break; case 6: activateCheat('TrackWorldmap'); break; case 7: activateCheat('TrackMenu'); } } } } } } } } ++v2; } } interfaceLayer.ratioFix.cheat_txt.setTextFormat(v5); } else { if (spawnMapTimer <= 0 and !player.deathInitiated) { if (showEncyclopedia) { if (v4 == 69) { closeEncyclopediaNow(); } else { if (v4 == 39 or v4 == 68 or v4 == 40 or v4 == 83) { interfaceLayer.Encyclopedia.keyEncyclopediaRIGHT(); } else { if (v4 == 37 or v4 == 65 or v4 == 38 or v4 == 87) { interfaceLayer.Encyclopedia.keyEncyclopediaLEFT(); } } } } else { if (v4 == 69) { if (interfaceLayer.Encyclopedia.EncyclopediaCanShow and !game.levelFinished and !player.fallDeath) { MD.forcePointer = true; if (!game.inWorldmap) { unpauseGame(); MD.forcePointer = true; showCursor(); game.isPaused = true; key.spacePressed = false; key.spaceTabbed = false; key.rightPressed = false; key.leftPressed = false; key.upPressed = false; key.spacePower = 0; } showEncyclopedia = true; interfaceLayer.Encyclopedia.showEncyclopedia(); not3.enabled = false; not4.enabled = false; if (TG.traceAction == 'worldmapE') { TutorialGuide[15] += 1; menuLayer.worldMap_fixed.t_all.gotoAndStop(1); } else { if (TG.traceAction == 'level2E') { TutorialGuide[16] += 1; fadeTutorialGuide(); } } } } else { if (!game.isPaused) { if (!key.spacePressed and !player.uncontrollable) { if (v4 == 39 or v4 == 68) { if (!player.isPreparingJump or player.isJumping) { if (player.isCarringBarrel == 0) { key.rightPressed = true; } else { if (player.isHoldingBarrel and !player.isThrowingBarrel and !player.isThrowingEnemy) { player.dirX = 1; player.clip._xscale = 100 * player.dirX; pickupBarrel(); } } } } if (v4 == 37 or v4 == 65) { if (!player.isPreparingJump or player.isJumping) { if (player.isCarringBarrel == 0) { key.leftPressed = true; } else { if (player.isHoldingBarrel and !player.isThrowingBarrel and !player.isThrowingEnemy) { player.dirX = -1; player.clip._xscale = 100 * player.dirX; pickupBarrel(); } } } } if (v4 == 38 or v4 == 87) { if (player.holdingEnemy == 0 and !key.upPressed and player.currentAttack == 0 and !player.isPreparingJump and player.isCarringBarrel == 0) { if (TG.traceAction == 'jump') { fadeTutorialGuide(); } player.isPreparingJump = true; player.velY = -11; player.clip.gotoAndStop('jump'); addEffect_jumpSmoke(player); } key.upPressed = true; } } if (!player.uncontrollable) { if (v4 == 32) { if (!key.spaceTabbed) { key.spacePressed = true; key.spaceTabbed = true; if (player.isFalling and !player.jumpAttackPerformed) { key.spacePower = 5; addSound('swing_s_0' + Math.floor(Math.random() * 2 + 1) + '.WAV', 45, 0, 0); player.jumpAttackPerformed = true; player.clip.gotoAndStop('attack_jump'); if (player.velY >= 23) { player.attackLevel = 3; } else { if (player.velY >= 17) { player.attackLevel = 2; } else { player.attackLevel = 1; } } if (player.velY > 0) { player.velY = 0; } } } } } if (BOSoS_CHEATS) { if (v4 == 16) { game.isPaused = true; cheatingActivated = true; var v5 = new TextFormat(); v5.letterSpacing = -0.5; v5.size = 11; v5.bold = true; v5.font = 'Tahoma'; interfaceLayer.ratioFix.cheat_txt.htmlText = '<b>Cheat List</b><br>1 - Spawn Objects<br>2 - Commands<br>3 - Music'; interfaceLayer.ratioFix.cheat_txt.setTextFormat(v5); cheatMenuPos = 'root_0'; } else { if (!traceKeysPressed.ctrlPressed and !Key.isDown(18)) { var v3 = 1; while (v3 <= 10) { if (v4 == 48 + v3) { switch (v3) { case 1: activateCheat('Full Health'); break; case 2: activateCheat('Full Rage'); break; case 3: activateCheat('Destroy All Barrels and Arrows'); break; case 4: activateCheat('Stun All Enemies'); break; case 5: activateCheat('Kill All Enemies'); break; case 7: forceThunderOverride(); break; case 9: activateCheat('Finish Level'); } } ++v3; } } } } } } } if (v4 == 81) { if (_root._quality == 'HIGH') { _root._quality = 'LOW'; } else { if (_root._quality == 'LOW') { _root._quality = 'MEDIUM'; } else { if (_root._quality == 'MEDIUM') { _root._quality = 'HIGH'; } } } } } } }; keyListener.onKeyUp = function () { var v1 = Key.getCode(); switch (v1) { case 17: traceKeysPressed.ctrlPressed = false; break; case 16: traceKeysPressed.shiftPressed = false; break; case 32: traceKeysPressed.spacePressed = false; break; case 37: traceKeysPressed.leftPressed = false; break; case 65: traceKeysPressed.leftSecondPressed = false; break; case 39: traceKeysPressed.rightPressed = false; break; case 68: traceKeysPressed.rightSecondPressed = false; } if (v1 == 16 and cheatingActivated) { game.isPaused = false; cheatingActivated = false; interfaceLayer.ratioFix.cheat_txt.htmlText = ''; } if (spawnMapTimer <= 0 and !player.deathInitiated and !player.fallDeath and !showEncyclopedia) { if (v1 == 39 or v1 == 68) { key.rightPressed = false; } if (v1 == 38 or v1 == 87) { key.upPressed = false; } if (v1 == 37 or v1 == 65) { key.leftPressed = false; } if (!game.isPaused) { if (!player.uncontrollable) { if (v1 == 32) { if (key.spacePressed) { if (key.spacePower <= 5 and !player.isThrowingBarrel and !player.isThrowingEnemy) { if (TG.traceAction == 'fastatt') { fadeTutorialGuide(); } if (player.holdingEnemy > 0) { if (!player.doingHeadKnock) { player.uncontrollable = true; player.clip.gotoAndStop('attack_pickup'); player.doingHeadKnock = true; } } else { if (canKick()) { player.velX = 0; setuncontrollable(); player.clip.gotoAndStop('kick'); player.parryTimer = player.clip.mc._totalFrames; } else { if (player.currentAttack == 0) { if (player.isHoldingBarrel) { dropBarrel(); } else { if (checkBarrelPickup(player) and !player.isPreparingJump) { key.rightPressed = false; key.leftPressed = false; player.clip.gotoAndStop('pickup_barrel'); } else { if (!player.isPreparingJump) { player.currentAttack = 1; player.performNextAttack = false; player.velX = 0; player.clip.gotoAndStop('att_f_1'); } } } } else { if (player.nextAttackPossible) { player.nextAttackPossible = false; player.performNextAttack = true; } } } } } key.spacePressed = false; key.spaceTabbed = false; key.spacePower = 0; } } } else { if (player.contestingTimer > 0 and player.contesting > 0 and v1 == 32) { addEffect_sparks(player); addSound('contest_press_0' + Math.floor(Math.random() * 3 + 1), 45, 0, 0); player.contestingPower += 1; } } } if (v1 == 27) { } if (v1 == 80 or v1 == 27) { if (!game.levelFinished) { if (!game.inMenu) { if (game.isPaused) { unpauseGame(); } else { pauseGame(); } } else { if (!game.inMenu or game.inWorldmap) { openMenu(); } } } } } }; Key.addListener(keyListener); var playerKickTarget = 0; var finishingXRange = 60; var rageUniDamage = 100; this.onEnterFrame = function () { updateCursor(); if (spawnMapTimer <= 0) { if (!game.isPaused) { if (!player.resetDone) { player.knockdownTimer = 0; player.isKnockdowned = false; player.stunTimer = 0; player.isStunned = false; player.staggerTimer = 0; startStunPlayer(1); player.resetDone = true; } checkThunder(); barrelPhysic(); arrowPhysic(); enemyAI(); traceKeys(); checkTimerEffects(); trackBloodstain(); trackParts(); cameraStatic(); updateRage(); if (TG.checkForKick) { checkForKickTutorial(); } if (TG.checkForFin) { checkForFinTutorial(); } if (!player.movementDisabled and !player.gibbed) { if (player.velX != 0 and !player.deathInitiated) { player.movingInXAxis = true; movePlayerXAxis(); } else { player.movingInXAxis = false; } if (player.isJumping) { moveShadow(player); movePlayerYAxis(); } else { movePlayerYAxis(); if (player.velX != 0) { fixShadow(player); } } } if (player.velX != 0) { checkPickupEnemies(); } cameraMovement(game.rootZoom); checkStrongSpace(); if (player.attackPause > 0) { player.attackPause -= 1; if (player.attackPause <= 0) { player.clip.mc.play(); } } checkNextWaveIDTimer(); } else { mapDrag(); } } else { spawnMapTimer -= 1; if (spawnMapTimer == 3) { startLevel(game.currentLevel); } if (spawnMapTimer == 0) { cameraStatic(); movePlayerYAxis(); cameraMovement(game.rootZoom); interfaceLayer.ratioFix.gotoAndStop('running'); interfaceLayer.ratioFix.weather.gotoAndStop(game.weatherType); updateHPRage(100, -100); if (thunderValues.thunderChance > 0) { addSound('crow_01.wav', 60, 0, 0); } if (game.currentLevel == 1) { showTutorialGuide(1); } else { showTutorialGuide(16); } showHelpTopic(); not3.enabled = true; not4.enabled = true; } } }; var myRageGlow = new flash.filters.GlowFilter(10166304, 0.4, 7, 7, 3, 1, false, false); var myRageGlowAttacking = new flash.filters.GlowFilter(10166304, 0.7, 9, 9, 3, 1, false, false); var yCheckAxis = 15; var playerGibVelX = 0; var gibVelXAxis = 0; stop(); }




http://swfchan.com/11/54316/info.shtml
Created: 21/4 -2019 19:58:32 Last modified: 21/4 -2019 19:58:32 Server time: 22/12 -2024 21:03:17