Frame 1
function dead_click() {
}
function TB() {
if (options.blurEffects) {
options.blurEffects = false;
} else {
options.blurEffects = true;
}
}
function TZ() {
if (options.zoomEffects) {
options.zoomEffects = false;
} else {
options.zoomEffects = true;
}
}
function TR() {
if (options.rotationEffects) {
options.rotationEffects = false;
} else {
options.rotationEffects = true;
}
}
NewgroundsAPI.connectMovie(6012);
fscommand ("allowscale", "false");
Stage.scaleMode = "noScale";
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 not0 = new ContextMenuItem("Toggle Blur", TB);
not0.enabled = true;
my_customized_menu.customItems.push(not0);
var not1 = new ContextMenuItem("Toggle Zoom", TZ);
not1.enabled = true;
my_customized_menu.customItems.push(not1);
var not2 = new ContextMenuItem("Toggle Rotation", TR);
not2.enabled = true;
my_customized_menu.customItems.push(not2);
_root.menu = my_customized_menu;
play();
Frame 2
this.onEnterFrame = function () {
loadMeter.text = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100) + " %";
if (_root.getBytesLoaded() >= _root.getBytesTotal()) {
gotoAndStop (3);
}
};
stop();
Frame 3
cnt_btn.onRelease = function () {
gotoAndStop (5);
};
Frame 4
gotoAndStop (3);
Frame 5
function getAttack(attackID) {
switch (attackID) {
case "att_f_1" :
return("/dmg-9/blockable-1/parryable-0/deathAnimationType-death_01/minStaggerTime-8/maxStaggerTime-12/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-9/maxStaggerTime-14/showBashEffect-0/pushbackEffect-0/stunEffect-2/cutArmChance-20/cutHeadChance-15/");
case "att_f_3" :
return("/dmg-14/blockable-1/parryable-0/deathAnimationType-death_01/minStaggerTime-10/maxStaggerTime-15/showBashEffect-0/pushbackEffect-7/stunEffect-7/cutArmChance-30/cutHeadChance-20/");
case "att_s" :
return("/dmg-20/blockable-0/parryable-1/deathAnimationType-death_01/minStaggerTime-12/maxStaggerTime-24/showBashEffect-1/pushbackEffect-7/stunEffect-12/cutArmChance-30/cutHeadChance-10/");
case "att_s_run" :
return("/dmg-15/blockable-0/parryable-1/deathAnimationType-death_01/minStaggerTime-15/maxStaggerTime-20/showBashEffect-1/pushbackEffect-12/stunEffect-7/cutArmChance-15/cutHeadChance-30/");
case "attack_jump" :
return("/dmg-25/blockable-0/parryable-0/deathAnimationType-death_01/minStaggerTime-12/maxStaggerTime-30/showBashEffect-1/pushbackEffect-25/stunEffect-23/cutArmChance-50/cutHeadChance-10/");
}
trace(("Error:Initializing:getAttack:invalid ID:(" + attackID) + ")");
return("/dmg-1/blockable-0/minStaggerTime-1/maxStaggerTime-1/showBashEffect-0/pushbackEffect-0/stunEffect-0/cutArmChance-0/cutHeadChance-0/");
}
function getAI(enemyAI) {
switch (enemyAI) {
case "SWORDSMAN_1" :
return("/type-Actor_OrcSwordsman/AI-SWORDSMAN/HP-70/CanDropHead-1/CanDropArm-1/speed-3/runDist-45/canBlock-1/canParry-1/attRange1-55/attRange2-70/attDmg1-2/attDmg2-4/att_strongDmg-6/attChance-12/contestPushbacks-9/reactDist-800/bloodType-blood_s_/bloodStain-1/groundSpawn-1/gibPart-gib_part_human_/barrelImmune-0/");
case "SWORDSMAN_1_TUTORIAL" :
return("/type-Actor_OrcSwordsman/AI-SWORDSMAN/HP-70/CanDropHead-1/CanDropArm-1/speed-3/runDist-45/canBlock-1/canParry-1/attRange1-55/attRange2-70/attDmg1-2/attDmg2-4/att_strongDmg-6/attChance-6/contestPushbacks-9/reactDist-250/bloodType-blood_s_/bloodStain-1/groundSpawn-1/gibPart-gib_part_human_/barrelImmune-0/");
case "ARCHER_1" :
return("/type-Actor_OrcArcher/AI-ARCHER/HP-40/CanDropHead-1/CanDropArm-0/speed-2/attRange-640/canBlock-0/canParry-0/bloodType-blood_s_/bloodStain-1/groundSpawn-1/gibPart-gib_part_human_/barrelImmune-0/");
case "SPEARMAN_1" :
return("/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-4/attChance-20/reactDist-800/groundSpawn-1/gibPart-gib_part_human_/barrelImmune-0/");
case "SKELETON_1" :
return("/type-Actor_SkeletonSwordsman/AI-SKELETON/HP-100/CanDropHead-0/CanDropArm-0/speed-2/runDist-45/canBlock-1/canParry-1/attRange1-65/attDmg1-3/attRange2-60/attDmg2-5/att_strongDmg-8/attChance-12/contestPushbacks-9/reactDist-800/bloodType-skel_blood/bloodStain-2/groundSpawn-1/gibPart-gib_part_skel_/barrelImmune-1/");
case "CHAOSKNIGHT_SWORD_1" :
return("/type-Actor_ChaosKnight_Sword/AI-CHAOSKNIGHTSWORD/HP-120/CanDropHead-0/CanDropArm-1/speed-3/runDist-50/canBlock-1/canParry-1/attRange1-65/attDmg1-4/attRange2-65/att_strongDmg-8/attDmg2-6/attChance-25/contestPushbacks-14/reactDist-800/bloodType-blood_fire_/bloodStain-3/groundSpawn-1/gibPart-gib_part_chaosknight_/barrelImmune-0/");
case "CHAOSKNIGHT_MACE_1" :
return("/type-Actor_ChaosKnight_Mace/AI-CHAOSKNIGHTMACE/HP-175/CanDropHead-0/CanDropArm-1/speed-3/runDist-50/canBlock-1/canParry-1/attRange1-65/attDmg1-5/attChance-25/att_strongDmg-10/contestPushbacks-12/reactDist-800/bloodType-blood_fire_/bloodStain-3/groundSpawn-1/gibPart-gib_part_chaosknight_/barrelImmune-0/");
case "BOSS_TROLL" :
return("/type-Actor_Boss_Troll/AI-BOSSTROLL/HP-120/bloodType-blood_s_/bloodStain-1/canBlock-0/groundSpawn-1/canParry-0/barrelImmune-1/");
case "BOSS_SWAMPMONSTER" :
return("/type-Actor_Boss_SwampMonster/AI-BOSSSWAMPMONSTER/HP-70/bloodType-blood_slime_/bloodStain-3/canBlock-0/groundSpawn-1/canParry-0/barrelImmune-1/");
case "SWAMPMONSTER_ARM" :
return("/type-Actor_SwampMonster_Arm/AI-SWAMPMONSTERARM/HP-888/bloodType-blood_slime_/bloodStain-3/canBlock-0/groundSpawn-1/canParry-0/barrelImmune-1/");
case "BOSS_WITCH" :
return("/type-Actor_Boss_Witch/AI-BOSSWITCH/HP-70/bloodType-blood_s_/bloodStain-1/canBlock-0/groundSpawn-0/canParry-0/barrelImmune-1/");
case "BOSS_PRINCESS" :
return("/type-Actor_Boss_Princess/AI-BOSSPRINCESS/HP-70/bloodType-blood_s_/bloodStain-1/canBlock-0/groundSpawn-0/canParry-0/barrelImmune-1/");
case "BOSS_HEDGEHOG" :
return("/type-Actor_Boss_Hedgehog/AI-BOSSHEDGEHOG/HP-70/bloodType-blood_s_/bloodStain-1/canBlock-0/groundSpawn-0/canParry-0/barrelImmune-1/");
case "BOSS_DEMONOMG" :
return("/type-Actor_Boss_DemonOMG/AI-BOSSDEMONOMG/HP-70/bloodType-blood_s_/bloodStain-1/canBlock-0/groundSpawn-0/canParry-0/barrelImmune-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/");
}
trace(("Error:Initializing:getAI:invalid ID:(" + enemyAI) + ")");
return("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;
}
function exitGame() {
resetRoot();
_root.stopAllSounds();
game.currentLevel = game.currentLevel + 1;
openMenu();
}
function openMenu() {
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 reset() {
stopAllSounds();
_root.stopAllSounds();
removeMovieClip(menuLayer);
_root.stopAllSounds();
resetRoot();
game.levelFinished = false;
camPos.difX = 0;
camPos.difY = 0;
camPos.virDifX = 0;
camPos.virDifY = 0;
camPos.minX = -9999;
camPos.maxX = 9999;
player.deathInitiated = 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;
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);
theWorld.createEmptyMovieClip("backgroundNearLayer", 2);
theWorld.createEmptyMovieClip("staticEffectsLayer", 3);
theWorld.createEmptyMovieClip("staticEffectsLayerParts", 4);
theWorld.createEmptyMovieClip("shadowLayer", 6);
theWorld.createEmptyMovieClip("actorsLayer", 7);
theWorld.createEmptyMovieClip("objectsLayerBarrels", 8);
theWorld.createEmptyMovieClip("effectsLayer", 12);
theWorld.createEmptyMovieClip("deadEnemiesLayer", 14);
theWorld.createEmptyMovieClip("crowLayer", 15);
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 _local2 = 1;
while (_local2 <= 100) {
_root.createEmptyMovieClip("mySound_" + _local2, 1001 + _local2);
_local2++;
}
spawnMapTimer = 3;
hideCursor();
}
function setBossSound(soundID, volumeID) {
_root.createEmptyMovieClip("sound_ambience_2", 12301);
var sound_ambience2 = new Sound(_root.sound_ambience_2);
sound_ambience2.attachSound(soundID);
sound_ambience2.start();
sound_ambience2.setVolume(volumeID);
sound_ambience2.onSoundComplete = function () {
sound_ambience2.start();
};
}
function setAmbientSound(soundID, volumeID) {
_root.createEmptyMovieClip("sound_ambience_1", 12300);
var sound_ambience = new Sound(_root.sound_ambience_1);
sound_ambience.attachSound(soundID);
sound_ambience.start();
sound_ambience.setVolume(volumeID);
sound_ambience.onSoundComplete = function () {
sound_ambience.start();
};
}
function gameOver() {
resetRoot();
saveBOSoS();
openMenu();
game.currentLevel = game.currentLevel + 1;
showMap();
}
function levelFinished() {
game.levelFinished = true;
interfaceLayer.ratioFix.gotoAndStop("stage_cleared");
}
function stageCleared() {
if (!MapsCleared[game.currentLevel]) {
MapScriptForThisLevelAble = true;
}
MapsCleared[game.currentLevel] = true;
game.maxLevelCleared = game.maxLevelCleared + 1;
game.currentLevel = game.currentLevel + 1;
saveBOSoS();
openMenu();
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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 _local3 = false;
var _local2 = 1;
while (_local2 <= 19) {
if (mapPointClose(_local2)) {
_local3 = true;
interfaceLayer.gameCursor.gotoAndStop("idle");
menuLayer.worldMap_fixed.world_sign.name_txt.text = MapsName[_local2];
menuLayer.worldMap_fixed.world_sign.name_txt._alpha = 100;
}
_local2++;
}
if (!_local3) {
if (menuLayer.worldMap_fixed.world_sign.name_txt._alpha > 0) {
menuLayer.worldMap_fixed.world_sign.name_txt._alpha = 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");
}
} else {
interfaceLayer.gameCursor.gotoAndStop("idle");
}
}
}
}
}
function updateMousePos() {
MD.mPosX = _root._xmouse;
MD.mPosY = _root._ymouse;
}
function GetRandom(MinValue, MaxValue, Rounded) {
if (MinValue > MaxValue) {
trace(((("Wrong Value(s), GetRandom, MinValue is greater than MaxValue. (" + MinValue) + " > ") + MaxValue) + ")");
}
if (Rounded) {
return(Math.round(Math.random() * (MaxValue - MinValue)) + MinValue);
}
return((Math.random() * (MaxValue - MinValue)) + MinValue);
}
function findNumberTakenInArray(Arry, Nr) {
if (Nr == undefined) {
return(true);
}
var _local1 = 0;
while (_local1 < Arry.length) {
if (Arry[_local1] == Nr) {
return(true);
}
_local1++;
}
return(false);
}
function findPathTo(currentLevel, targetLevel) {
var _local4 = 0;
var _local2 = 0;
var _local1 = new Array();
trace("");
trace("Starting pathsearch to target: " + targetLevel);
var _local5 = 1;
while (_local5 <= 80) {
trace("Generating path nr: " + _local5);
_local1 = new Array();
_local1.push(currentLevel);
var _local3 = 1;
while (_local3 <= 80) {
_local2 = _local1.length - 1;
_local4 = GetRandom(0, MapsConnected[_local1[_local2]].length - 1, true);
if (!findNumberTakenInArray(_local1, MapsConnected[_local1[_local2]][_local4])) {
_local1.push(MapsConnected[_local1[_local2]][_local4]);
if (_local1[_local2 + 1] == targetLevel) {
trace("Path found! Returning path: " + _local1);
trace("");
return(_local1);
}
}
_local3++;
}
trace(("Failed to find a path to target: " + targetLevel) + ". Retrying...");
_local5++;
}
trace(((("Couldn't find a path from " + currentLevel) + " to ") + targetLevel) + ". Retry!");
var _local8 = new Array();
return(_local8);
}
function prepareMap(nr) {
if (!WorldMapPlayerMoving) {
if ((game.currentLevel - 1) != nr) {
WorldMapPlayerPath = findPathTo(game.currentLevel - 1, nr);
if (WorldMapPlayerPath.length > 0) {
StartMovePlayer();
} else {
trace("Path not found - Reseting player");
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 {
game.currentLevel = nr;
MD.dagging = false;
reset();
}
}
}
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;
}
menuLayer.worldMap_fixed.worldMap.dragons.gotoAndStop("end");
if (game.currentLevel <= 1) {
game.currentLevel = 2;
}
trace("Current game.currentLevel = " + game.currentLevel);
trace("Real game.currentLevel = " + (game.currentLevel - 1));
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) {
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 > 14) {
menuLayer.worldMap_fixed.worldMap._x = -menuLayer.worldMap_fixed.worldMap.mapPos3._x;
menuLayer.worldMap_fixed.worldMap._y = -menuLayer.worldMap_fixed.worldMap.mapPos3._y;
} else {
menuLayer.worldMap_fixed.worldMap._x = -(menuLayer.worldMap_fixed.worldMap.playerWorldmap._x - 320);
menuLayer.worldMap_fixed.worldMap._y = -(menuLayer.worldMap_fixed.worldMap.playerWorldmap._y - 240);
}
updateWorldmap();
}
var _local2 = 1;
while (_local2 <= 19) {
menuLayer.worldMap_fixed.worldMap["L" + _local2]._alpha = 0;
_local2++;
}
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 _local4 = 0;
_local2 = 0;
while (_local2 <= 19) {
if (MapsCleared[_local2]) {
menuLayer.worldMap_fixed.worldMap["L" + _local2]._alpha = 100;
var _local1 = 0;
while (_local1 < MapsConnected[_local2].length) {
if (MapsCleared[MapsConnected[_local2][_local1]]) {
menuLayer.worldMap_fixed.worldMap["L" + MapsConnected[_local2][_local1]]._alpha = 100;
} else {
trace(("Fade in map nr: " + MapsConnected[_local2][_local1]) + " if not clear");
MapsToFadeIn[MapsConnected[_local2][_local1]] = true;
}
_local1++;
}
}
_local2++;
}
if (!MapsCleared[6]) {
MapsToFadeIn[8] = false;
}
if (!MapsCleared[12]) {
MapsToFadeIn[14] = false;
}
var _local3 = 1;
while (_local3 <= 19) {
if (MapsToFadeIn[_local3]) {
_local4 = _local4 + 1;
menuLayer.worldMap_fixed.worldMap["marker" + _local4]._x = menuLayer.worldMap_fixed.worldMap["L" + _local3]._x;
menuLayer.worldMap_fixed.worldMap["marker" + _local4]._y = menuLayer.worldMap_fixed.worldMap["L" + _local3]._y;
trace((("LevelMarker" + _local4) + " used on map ") + _local3);
}
_local3++;
}
if (MapScriptForThisLevelAble) {
trace(("Run Script_" + (game.currentLevel - 1)) + " if it exists");
player.levelsCompletedTotal = player.levelsCompletedTotal + 1;
menuLayer.worldMap_fixed.worldMap.playerWorldmap["crow" + player.levelsCompletedTotal]._alpha = 100;
if (menuLayer.worldMap_fixed.worldMap["script_" + (game.currentLevel - 1)]._x == undefined) {
trace("ShowSign 3");
MD.showSign = true;
} else {
menuLayer.worldMap_fixed.worldMap["script_" + (game.currentLevel - 1)].gotoAndPlay(2);
}
MapScriptForThisLevelAble = false;
} else {
trace("ShowSign 1");
MD.showSign = true;
}
trace("");
}
function hideMaps() {
if (showingAllMaps) {
trace("Hiding maps");
MD.fadeInMaps = false;
var _local1 = 1;
while (_local1 <= 19) {
menuLayer.worldMap_fixed.worldMap["L" + _local1]._x = menuLayer.worldMap_fixed.worldMap["L" + _local1]._x + 1000;
menuLayer.worldMap_fixed.worldMap["L" + _local1]._y = menuLayer.worldMap_fixed.worldMap["L" + _local1]._y + 1000;
_local1++;
}
menuLayer.worldMap_fixed.worldMap.marker1._x = menuLayer.worldMap_fixed.worldMap.marker1._x + 1000;
menuLayer.worldMap_fixed.worldMap.marker1._y = menuLayer.worldMap_fixed.worldMap.marker1._y + 1000;
menuLayer.worldMap_fixed.worldMap.marker2._x = menuLayer.worldMap_fixed.worldMap.marker2._x + 1000;
menuLayer.worldMap_fixed.worldMap.marker2._y = menuLayer.worldMap_fixed.worldMap.marker2._y + 1000;
MD.ableToDrag = false;
hideMapsFromScript = true;
showingAllMaps = false;
}
}
function showMaps() {
if (!showingAllMaps) {
MD.fadeInMaps = true;
trace("ShowSign 2");
MD.showSign = true;
trace("Showing maps");
var _local1 = 1;
while (_local1 <= 19) {
menuLayer.worldMap_fixed.worldMap["L" + _local1]._x = menuLayer.worldMap_fixed.worldMap["L" + _local1]._x - 1000;
menuLayer.worldMap_fixed.worldMap["L" + _local1]._y = menuLayer.worldMap_fixed.worldMap["L" + _local1]._y - 1000;
_local1++;
}
menuLayer.worldMap_fixed.worldMap.marker1._x = menuLayer.worldMap_fixed.worldMap.marker1._x - 1000;
menuLayer.worldMap_fixed.worldMap.marker1._y = menuLayer.worldMap_fixed.worldMap.marker1._y - 1000;
menuLayer.worldMap_fixed.worldMap.marker2._x = menuLayer.worldMap_fixed.worldMap.marker2._x - 1000;
menuLayer.worldMap_fixed.worldMap.marker2._y = menuLayer.worldMap_fixed.worldMap.marker2._y - 1000;
MD.ableToDrag = true;
if (!MapsCleared[8]) {
MD.ableToDrag = false;
}
showingAllMaps = true;
}
}
function mapPointClose(point) {
var _local4 = 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 _local3 = 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 (_local4 < (menuLayer.worldMap_fixed.worldMap["L" + point]._width / 2))) and (_local3 < (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() {
game.inWorldmap = true;
MD.showSign = false;
MD.dragging = false;
MD.moved = false;
MD.canDrag = true;
MD.ableToDrag = true;
MD.fadeInMaps = true;
WorldMapPlayerMoving = false;
trace("");
trace("Showing map, currentLevel: " + game.currentLevel);
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 _local1 = 1;
while (_local1 <= 19) {
if (mapPointClose(_local1)) {
prepareMap(_local1);
}
_local1++;
}
}
};
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;
}
function StartMovePlayer() {
trace("Start moving player");
if (MD.ableToDrag) {
if (game.currentLevel > 6) {
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 > 14) {
menuLayer.worldMap_fixed.worldMap._x = -menuLayer.worldMap_fixed.worldMap.mapPos3._x;
menuLayer.worldMap_fixed.worldMap._y = -menuLayer.worldMap_fixed.worldMap.mapPos3._y;
} else {
menuLayer.worldMap_fixed.worldMap._x = -(menuLayer.worldMap_fixed.worldMap.playerWorldmap._x - 320);
menuLayer.worldMap_fixed.worldMap._y = -(menuLayer.worldMap_fixed.worldMap.playerWorldmap._y - 240);
}
} 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 = menuLayer.worldMap_fixed.world_sign._y + 1;
}
if (menuLayer.worldMap_fixed.world_sign._y < -10) {
menuLayer.worldMap_fixed.world_sign._y = 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 = menuLayer.worldMap_fixed.world_sign._y + 1;
}
}
if (WorldMapPlayerMoving) {
var _local4 = menuLayer.worldMap_fixed.worldMap["L" + WorldMapPlayerPath[0]]._x - menuLayer.worldMap_fixed.worldMap.playerWorldmap._x;
var _local3 = menuLayer.worldMap_fixed.worldMap["L" + WorldMapPlayerPath[0]]._y - menuLayer.worldMap_fixed.worldMap.playerWorldmap._y;
var _local6 = (_local4 / Math.sqrt((_local4 * _local4) + (_local3 * _local3))) * 5;
var _local5 = (_local3 / Math.sqrt((_local4 * _local4) + (_local3 * _local3))) * 5;
menuLayer.worldMap_fixed.worldMap.playerWorldmap._x = menuLayer.worldMap_fixed.worldMap.playerWorldmap._x + _local6;
menuLayer.worldMap_fixed.worldMap.playerWorldmap._y = menuLayer.worldMap_fixed.worldMap.playerWorldmap._y + _local5;
if (MD.ableToDrag) {
var _local11 = menuLayer.worldMap_fixed.worldMap._x + (menuLayer.worldMap_fixed.worldMap.playerWorldmap._x - 320);
var _local12 = menuLayer.worldMap_fixed.worldMap._y + (menuLayer.worldMap_fixed.worldMap.playerWorldmap._y - 240);
var _local8 = Math.sqrt(_local11 * _local11);
var _local7 = Math.sqrt(_local12 * _local12);
if (Math.sqrt(_local8 * _local8) <= 50) {
menuLayer.worldMap_fixed.worldMap._x = menuLayer.worldMap_fixed.worldMap._x - _local6;
} else if (((_local8 > 50) and (_local6 > 0)) or ((_local4 < -50) and (_local6 < 0))) {
menuLayer.worldMap_fixed.worldMap._x = menuLayer.worldMap_fixed.worldMap._x - (_local6 * 0.4);
} else if (((_local8 > 50) and (_local6 < 0)) or ((_local4 < -50) and (_local6 > 0))) {
menuLayer.worldMap_fixed.worldMap._x = menuLayer.worldMap_fixed.worldMap._x - (_local6 * 2);
}
if (Math.sqrt(_local7 * _local7) <= 50) {
menuLayer.worldMap_fixed.worldMap._y = menuLayer.worldMap_fixed.worldMap._y - _local5;
} else if (((_local7 > 50) and (_local5 > 0)) or ((_local3 < -50) and (_local5 < 0))) {
menuLayer.worldMap_fixed.worldMap._y = menuLayer.worldMap_fixed.worldMap._y - (_local5 * 0.4);
} else if (((_local7 > 50) and (_local5 < 0)) or ((_local3 < -50) and (_local5 > 0))) {
menuLayer.worldMap_fixed.worldMap._y = menuLayer.worldMap_fixed.worldMap._y - (_local5 * 2);
}
}
if (Math.sqrt((_local4 * _local4) + (_local3 * _local3)) < 5) {
trace("Reached point " + WorldMapPlayerPath[0]);
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 {
trace("Destination reached! Click again to play.");
trace("");
WorldMapPlayerMoving = false;
}
}
} else {
if (MD.fadeInMaps) {
var _local2 = 0;
while (_local2 <= 20) {
if (MapsToFadeIn[_local2]) {
if (menuLayer.worldMap_fixed.worldMap["L" + _local2]._alpha < 100) {
menuLayer.worldMap_fixed.worldMap["L" + _local2]._alpha = menuLayer.worldMap_fixed.worldMap["L" + _local2]._alpha + 4;
}
}
_local2++;
}
}
if (MD.dragging and MD.ableToDrag) {
var _local10 = (_root._xmouse - MD.mPosX) * -1;
var _local9 = (_root._ymouse - MD.mPosY) * -1;
if ((_local10 != 0) or (_local9 != 0)) {
MD.moved = true;
hideMaps();
hideMapsFromScript = false;
MD.ableToDrag = true;
}
if (!difMapDrag(_local10, _local9)) {
updateMousePos();
MD.moveX = _local10;
MD.moveY = _local9;
while (((checkCorner(0, 0) or checkCorner(640, 0)) or checkCorner(0, 480)) or checkCorner(640, 480)) {
if (checkCorner(-10, 0)) {
MD.moveX = MD.moveX + 1;
}
if (checkCorner(-10, 480)) {
MD.moveX = MD.moveX + 1;
}
if (checkCorner(650, 0)) {
MD.moveX = MD.moveX - 1;
}
if (checkCorner(650, 480)) {
MD.moveX = MD.moveX - 1;
}
if (checkCorner(0, -10)) {
MD.moveY = MD.moveY + 1;
}
if (checkCorner(640, -10)) {
MD.moveY = MD.moveY + 1;
}
if (checkCorner(0, 490)) {
MD.moveY = MD.moveY - 1;
}
if (checkCorner(640, 490)) {
MD.moveY = MD.moveY - 1;
}
}
menuLayer.worldMap_fixed.worldMap._y = menuLayer.worldMap_fixed.worldMap._y - MD.moveY;
menuLayer.worldMap_fixed.worldMap._x = 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 = MD.moveX + 1;
}
if (checkCorner(-10, 480)) {
MD.moveX = MD.moveX + 1;
}
if (checkCorner(650, 0)) {
MD.moveX = MD.moveX - 1;
}
if (checkCorner(650, 480)) {
MD.moveX = MD.moveX - 1;
}
if (checkCorner(0, -10)) {
MD.moveY = MD.moveY + 1;
}
if (checkCorner(640, -10)) {
MD.moveY = MD.moveY + 1;
}
if (checkCorner(0, 490)) {
MD.moveY = MD.moveY - 1;
}
if (checkCorner(640, 490)) {
MD.moveY = MD.moveY - 1;
}
}
menuLayer.worldMap_fixed.worldMap._y = menuLayer.worldMap_fixed.worldMap._y - MD.moveY;
menuLayer.worldMap_fixed.worldMap._x = menuLayer.worldMap_fixed.worldMap._x - MD.moveX;
}
function arrowPhysic() {
if (arrowCounter > 0) {
var _local1 = 1;
while (_local1 <= arrowCounter) {
if (myObject["arrow" + _local1].inGame) {
arrowMovement(myObject["arrow" + _local1]);
if (myObject["arrow" + _local1].velY > 100) {
checkObInGame(myObject["arrow" + _local1]);
}
} else if (_local1 == arrowCounter) {
arrowCounter = arrowCounter - 1;
}
_local1++;
}
}
}
function barrelPhysic() {
if (circleCounter > 0) {
var _local1 = 1;
while (_local1 <= circleCounter) {
if (myObject["circle" + _local1].inGame) {
if (myObject["circle" + _local1].inGame and myObject["circle" + _local1].inMove) {
circleMovement(myObject["circle" + _local1]);
moveShadow(myObject["circle" + _local1]);
}
if (myObject["circle" + _local1].inMove) {
if (Math.sqrt((myObject["circle" + _local1].velY * myObject["circle" + _local1].velY) + (myObject["circle" + _local1].velX * myObject["circle" + _local1].velX)) > 4) {
barrelImpact(myObject["circle" + _local1]);
}
}
if (((!player.isHoldingBarrel) and (!myObject["circle" + _local1].inMove)) and (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(myObject["circle" + _local1].posX + camPos.difX, (myObject["circle" + _local1].posY + camPos.difY) + (myObject["circle" + _local1].radius * 1.3), true))) {
trace("Force the barrel to drop!");
myObject["circle" + _local1].velY = 0;
myObject["circle" + _local1].velX = 0;
myObject["circle" + _local1].inMove = true;
}
checkObInGame(myObject["circle" + _local1]);
checkBarrelDeathPit(myObject["circle" + _local1]);
} else if (_local1 == circleCounter) {
myObject["circle" + _local1].posX = -9999;
myObject["circle" + _local1].posY = -9999;
myObject["circle" + _local1].inGame = false;
myObject["circle" + _local1].inMove = false;
myObject["circle" + _local1].clip.removeMovieClip();
myObject["circle" + _local1].shadowClip.removeMovieClip();
circleCounter = circleCounter - 1;
} else {
myObject["circle" + _local1].posX = -9999;
myObject["circle" + _local1].posY = -9999;
myObject["circle" + _local1].inMove = false;
}
_local1++;
}
}
}
function checkBarrelDeathPit(ob) {
if (theWorld.backgroundNearLayer.currentLevel.deathpits.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) {
damageOb(ob, 888);
}
}
function checkObInGame(ob) {
if (ob.velY > 40) {
checkGameEventOnDeath(ob);
ob.posX = -9999;
ob.posY = -9999;
ob.inGame = false;
removeMovieClip(ob.clip);
removeMovieClip(ob.shadowClip);
}
}
function damageOb(ob, damage) {
ob.life = ob.life - damage;
if ((ob.life <= 0) and ob.inGame) {
addSound("bustwood.wav", 25, 0, 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 _local4 = false;
var _local3 = ob.posX;
var _local2 = ob.posY;
if (ob.explosive == 1) {
trace(ob.explosive);
trace("addExplosion = true");
_local4 = true;
}
if ((!myObject["circle" + player.isCarringBarrel].inGame) and (player.isCarringBarrel > 0)) {
dropBarrel();
}
ob.inGame = false;
if (_local4) {
trace((("Adding explosion at " + _local3) + ",") + _local2);
explosionAt(_local3, _local2);
}
ob.posX = -9999;
ob.posY = -9999;
ob.clip._x = ob.posX;
ob.clip._y = ob.posY;
removeMovieClip(ob.shadowClip);
removeMovieClip(ob.clip);
}
}
function arrowMovement(ob) {
var _local7 = ob.posX;
var _local6 = ob.posY;
ob.velY = ob.velY + game.gravity;
var _local4 = Math.sqrt((ob.velX * ob.velX) + (ob.velY * ob.velY));
var _local9 = false;
var _local3 = 0;
while (_local3 <= _local4) {
ob.posX = ob.posX + ((ob.velX / _local4) * game.physicAccuracy);
ob.posY = ob.posY + ((ob.velY / _local4) * game.physicAccuracy);
if (theWorld.objectsLayerBarrels.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) {
ob.clip._rotation = (Math.atan2(ob.posY - _local6, ob.posX - _local7) * 180) / Math.PI;
_local3 = _local4;
ob.inGame = false;
var _local2 = 1;
while (_local2 <= circleCounter) {
if (myObject["circle" + _local2].clip.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) {
if (player.isCarringBarrel != _local2) {
myObject["circle" + _local2].inMove = true;
}
myObject["circle" + _local2].velX = myObject["circle" + _local2].velX + (ob.velX * 0.05);
myObject["circle" + _local2].velY = myObject["circle" + _local2].velY + (ob.velY * 0.05);
myObject["circle" + _local2].arrowCounter = myObject["circle" + _local2].arrowCounter + 1;
myObject["circle" + _local2].clip.attachMovie("arrow", "myArrow" + myObject["circle" + _local2].arrowCounter, myObject["circle" + _local2].arrowCounter);
myObject["circle" + _local2].clip["myArrow" + myObject["circle" + _local2].arrowCounter]._rotation = ob.clip._rotation - myObject["circle" + _local2].clip._rotation;
myObject["circle" + _local2].clip["myArrow" + myObject["circle" + _local2].arrowCounter]._x = myObject["circle" + _local2].clip["myArrow" + myObject["circle" + _local2].arrowCounter]._x - (Math.sin((myObject["circle" + _local2].clip["myArrow" + myObject["circle" + _local2].arrowCounter]._rotation + 90) * (Math.PI/180)) * 15);
myObject["circle" + _local2].clip["myArrow" + myObject["circle" + _local2].arrowCounter]._y = myObject["circle" + _local2].clip["myArrow" + myObject["circle" + _local2].arrowCounter]._y - (Math.cos((myObject["circle" + _local2].clip["myArrow" + myObject["circle" + _local2].arrowCounter]._rotation + 90) * (Math.PI/180)) * -15);
myObject["circle" + _local2].clip["myArrow" + myObject["circle" + _local2].arrowCounter].gotoAndPlay(2);
addEffect("matchwood", myObject["circle" + _local2].posX, myObject["circle" + _local2].posY - 20, 0, 1, 1);
damageOb(myObject["circle" + _local2], Math.sqrt((ob.velX * ob.velX) + (ob.velY * ob.velY)) / 2);
}
_local2++;
}
ob.inGame = false;
_local3 = _local4;
removeMovieClip(ob.clip);
} else if (((!player.isThrowingEnemy) and (player.holdingEnemy > 0)) and myObject["enemy" + player.holdingEnemy].clip.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) {
addSound(("hitFlesh_0" + Math.floor((Math.random() * 2) + 1)) + ".wav", 40, 0, 0);
myObject["enemy" + player.holdingEnemy].life = myObject["enemy" + player.holdingEnemy].life - (Math.sqrt((ob.velX * ob.velX) + (ob.velY * ob.velY)) / 2);
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;
_local3 = _local4;
removeMovieClip(ob.clip);
} else if (((((!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 _local5 = false;
myObject["circle" + player.isCarringBarrel].inMove = true;
showTutorial(9);
addSound(("hitFlesh_0" + Math.floor((Math.random() * 2) + 1)) + ".wav", 40, 0, 0);
if (player.isJumping and ((Math.random() * 100) < 50)) {
startStaggerPlayer(Math.floor((Math.random() * 3) + 3));
_local5 = true;
} else if (!player.isJumping) {
startStaggerPlayer(Math.floor((Math.random() * 3) + 3));
_local5 = true;
}
updateHPRage(-2, 0);
player.arrowCounter = player.arrowCounter + 1;
if (player.arrowCounter > 5) {
player.arrowCounter = 1;
}
if (_local5) {
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 = player.velX + (ob.velX / 20);
player.velY = player.velY + (ob.velY / 20);
}
player.clip._xscale = 100 * player.dirX;
}
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 = player.clip["myArrow" + player.arrowCounter]._x + 3;
if (!player.isKnockdowned) {
player.clip["myArrow" + player.arrowCounter]._y = player.clip["myArrow" + player.arrowCounter]._y - 30;
} else if (((player.knockdownTimer > 0) and player.isKnockdowned) and (!player.isFalling)) {
player.clip["myArrow" + player.arrowCounter]._y = player.clip["myArrow" + player.arrowCounter]._y - 16;
player.clip["myArrow" + player.arrowCounter]._x = 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;
_local3 = _local4;
removeMovieClip(ob.clip);
}
if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) {
ob.clip._rotation = (Math.atan2(ob.posY - _local6, ob.posX - _local7) * 180) / Math.PI;
_local3 = _local4;
ob.inGame = false;
ob.clip.gotoAndPlay(2);
_local9 = true;
}
_local3 = _local3 + (1 * game.physicAccuracy);
}
ob.clip._x = ob.posX;
ob.clip._y = ob.posY;
ob.clip._rotation = (Math.atan2(ob.posY - _local6, ob.posX - _local7) * 180) / Math.PI;
if (_local9) {
var _local8 = 0;
while ((_local8 <= 200) and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) {
ob.posX = ob.posX - (ob.velX / Math.sqrt(ob.velX * ob.velX));
ob.posY = ob.posY - (ob.velY / Math.sqrt(ob.velY * ob.velY));
_local8 = _local8 + 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 _local2 = Math.sqrt((ob.velX * ob.velX) + (ob.velY * ob.velY));
return(_local2);
}
function barrelImpact(ob) {
var _local3 = -23;
if (player.isKnockdowned) {
_local3 = -5;
}
if (Math.sqrt(((ob.posX - player.posX) * (ob.posX - player.posX)) + ((ob.posY - (player.posY + _local3)) * (ob.posY - (player.posY + _local3)))) < 25) {
var _local4 = getVel(ob) * 8;
ob.life = ob.life - _local4;
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 - (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.posX - (ob.velX * 0.5);
ob.velX = -0.5;
addEffect_impactSmoke(ob, player, -30);
if (ob.life <= 0) {
damageOb(ob, 10);
} else {
ob.velX = ob.velX * -1;
ob.velX = ob.velX + player.dirX;
}
}
var _local2 = 1;
while (_local2 <= enemyCounter) {
if (((((!myObject["enemy" + _local2].immortal) and (myObject["enemy" + _local2].barrelImmune != 1)) and (myObject["enemy" + _local2].life > 0)) and myObject["enemy" + _local2].inGame) and (myObject["enemy" + _local2].currAttack != "finishing")) {
if ((myObject["enemy" + _local2].knockdownTimer > 0) or myObject["enemy" + _local2].pickedup) {
_local3 = -5;
} else {
_local3 = myObject["enemy" + _local2].HB_posY;
}
if (Math.sqrt(((ob.posX - myObject["enemy" + _local2].posX) * (ob.posX - myObject["enemy" + _local2].posX)) + ((ob.posY - (myObject["enemy" + _local2].posY + _local3)) * (ob.posY - (myObject["enemy" + _local2].posY + _local3)))) < 35) {
checkEnemiesEffectedByBarrelImpact(ob, myObject["enemy" + _local2]);
ob.posX = ob.posX - (ob.velX * 0.5);
ob.velX = ob.velX * 0.5;
ob.velY = -2;
addEffect_impactSmoke(ob, myObject["enemy" + _local2], -30);
var _local4 = getVel(ob) * 5;
ob.life = ob.life - _local4;
if (ob.life <= 0) {
damageOb(ob, 10);
} else {
ob.velX = ob.velX * -1;
ob.velX = ob.velX + myObject["enemy" + _local2].dirX;
}
if (myObject["enemy" + _local2].pickedup) {
dropEnemy(0, 0);
}
}
}
_local2++;
}
}
function checkEnemiesEffectedByBarrelImpact(ob, enemy) {
var _local1 = 1;
while (_local1 <= enemyCounter) {
if (myObject["enemy" + _local1].inGame and (myObject["enemy" + _local1].barrelImmune != 1)) {
if (Math.sqrt(((myObject["enemy" + _local1].posX - enemy.posX) * (myObject["enemy" + _local1].posX - enemy.posX)) + ((myObject["enemy" + _local1].posY - enemy.posY) * (myObject["enemy" + _local1].posY - enemy.posY))) < 30) {
if ((ob.velX < 0) and (ob.posX > myObject["enemy" + _local1].posX)) {
myObject["enemy" + _local1].dirX = 1;
} else if ((ob.velX > 0) and (ob.posX < myObject["enemy" + _local1].posX)) {
myObject["enemy" + _local1].dirX = -1;
}
myObject["enemy" + _local1].life = myObject["enemy" + _local1].life - (getVel(ob) * 2);
myObject["enemy" + _local1].attackTimer = 0;
if (myObject["enemy" + _local1].life <= 0) {
ob.life = 1;
}
if (myObject["enemy" + _local1].currAttack == "jump") {
startFlyingEnemy(myObject["enemy" + _local1], ob.velX / 10, 0);
ob.life = 1;
} else if (((getVel(ob) > 5) and ((Math.random() * 100) < 75)) and (myObject["enemy" + _local1].life > 0)) {
if (myObject["enemy" + _local1].stunTimer <= 0) {
myObject["enemy" + _local1].stunTimer = myObject["enemy" + _local1].stunTimer + (40 + (getVel(ob) * 4));
myObject["enemy" + _local1].velX = 0;
ob.life = 1;
} else {
myObject["enemy" + _local1].velY = 0;
myObject["enemy" + _local1].velX = 0;
startFlyingEnemy(myObject["enemy" + _local1], ob.velX / 5, -4);
ob.life = 1;
}
} else if ((getVel(ob) > 12) or (myObject["enemy" + _local1].life <= 0)) {
if (myObject["enemy" + _local1].isFalling) {
startFlyingEnemy(myObject["enemy" + _local1], ob.velX / 5, 0);
} else {
myObject["enemy" + _local1].velY = 0;
myObject["enemy" + _local1].velX = 0;
startFlyingEnemy(myObject["enemy" + _local1], ob.velX / 5, -4);
}
addEffect_Blood(myObject["enemy" + _local1].bloodType, myObject["enemy" + _local1].posX, myObject["enemy" + _local1].posY);
ob.life = 1;
} else {
myObject["enemy" + _local1].staggerTimer = myObject["enemy" + _local1].staggerTimer + (getVel(ob) * 2);
}
myObject["enemy" + _local1].clip._xscale = 100 * myObject["enemy" + _local1].dirX;
}
}
_local1++;
}
}
function circleMovement(ob) {
ob.oldX = ob.posX;
ob.oldY = ob.posY;
ob.velY = ob.velY + game.gravity;
var _local8 = 0;
if (ob.velY > 0) {
_local8 = 0.1;
} else if (ob.velY < 0) {
_local8 = -0.1;
}
ob.clip.filters = null;
var _local3 = game.physicAccuracy;
var _local12 = Math.sqrt(ob.velY * ob.velY);
var _local9 = 0;
while (_local9 <= _local12) {
ob.posY = ob.posY + (_local8 * _local3);
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 = ob.velY * -1;
_local8 = _local8 * -1;
ob.posY = ob.posY - (_local8 * _local3);
}
if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) {
var _local2 = {rSide:0, lSide:0};
var _local4 = 0;
while ((_local4 <= 500) and (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((ob.posX + camPos.difX) + 4, (ob.posY + camPos.difY) + _local2.rSide, true))) {
_local2.rSide = _local2.rSide + (0.1 * _local3);
_local4 = _local4 + 1;
}
_local4 = 0;
while ((_local4 <= 500) and (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((ob.posX + camPos.difX) - 4, (ob.posY + camPos.difY) + _local2.lSide, true))) {
_local2.lSide = _local2.lSide + (0.1 * _local3);
_local4 = _local4 + 1;
}
_local4 = 0;
while ((_local4 <= 500) and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((ob.posX + 4) + camPos.difX, (ob.posY + camPos.difY) + _local2.rSide, true)) {
_local2.rSide = _local2.rSide - (0.1 * _local3);
_local4 = _local4 + 1;
}
_local4 = 0;
while ((_local4 <= 500) and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((ob.posX - 4) + camPos.difX, (ob.posY + camPos.difY) + _local2.lSide, true)) {
_local2.lSide = _local2.lSide - (0.1 * _local3);
_local4 = _local4 + 1;
}
_local8 = _local8 * -1;
if (Math.sqrt(ob.velY * ob.velY) >= 4) {
ob.velX = 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.velY * (-ob.bounceForce);
ob.tiltDiff = _local2.rSide - _local2.lSide;
var _local11 = Math.sqrt((_local2.rSide - _local2.lSide) * (_local2.rSide - _local2.lSide));
if (Math.sqrt(ob.velY * ob.velY) <= game.gravity) {
ob.velY = 0;
var _local6 = (_local2.rSide - _local2.lSide) * 0.1;
if (_local11 < tiltDifForce) {
ob.velX = ob.velX + (_local6 * (1.6 - (ob.frictionForce / 4)));
if (((_local6 < 0) and (ob.velX < 0)) or ((_local6 > 0) and (ob.velX > 0))) {
ob.velX = ob.velX + (_local6 * (0.3 + (ob.frictionForce / 3)));
}
}
} else if (_local11 < tiltDifForce) {
ob.velX = ob.velX + ((_local2.rSide - _local2.lSide) * 0.5);
}
ob.posY = ob.posY + ob.velY;
while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) {
ob.posY = ob.posY - 0.1;
}
}
_local9 = _local9 + (0.1 * _local3);
}
var _local10 = 0;
if (ob.velX > 0) {
_local10 = 0.1;
} else if (ob.velX < 0) {
_local10 = -0.1;
}
ob.clip._rotation = ob.clip._rotation + (ob.velX * 4);
_local12 = Math.sqrt(ob.velX * ob.velX);
_local9 = 0;
while (_local9 <= _local12) {
ob.posX = ob.posX + (_local10 * _local3);
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 = 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 = ob.posX + 1;
}
addEffect("impact_smoke", ob.posX + (_local10 * ob.radius), ob.posY - ob.radius, 0, 2, 1);
_local10 = _local10 * -1;
ob.velX = 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) {
var _local2 = {rSide:0, lSide:0};
var _local4 = 0;
while ((_local4 <= 500) and (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((ob.posX + camPos.difX) + 4, (ob.posY + camPos.difY) + _local2.rSide, true))) {
_local2.rSide = _local2.rSide + (0.1 * _local3);
_local4 = _local4 + 1;
}
_local4 = 0;
while ((_local4 <= 500) and (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((ob.posX + camPos.difX) - 4, (ob.posY + camPos.difY) + _local2.lSide, true))) {
_local2.lSide = _local2.lSide + (0.1 * _local3);
_local4 = _local4 + 1;
}
_local4 = 0;
while ((_local4 <= 500) and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((ob.posX + camPos.difX) + 4, (ob.posY + camPos.difY) + _local2.rSide, true)) {
_local2.rSide = _local2.rSide - (0.1 * _local3);
_local4 = _local4 + 1;
}
_local4 = 0;
while ((_local4 <= 500) and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((ob.posX + camPos.difX) - 4, (ob.posY + camPos.difY) + _local2.lSide, true)) {
_local2.lSide = _local2.lSide - (0.1 * _local3);
_local4 = _local4 + 1;
}
ob.tiltDiff = _local2.rSide - _local2.lSide;
var _local11 = Math.sqrt((_local2.rSide - _local2.lSide) * (_local2.rSide - _local2.lSide));
if (_local11 < tiltDifForce) {
var _local7 = ob.posY;
while (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) {
ob.posY = ob.posY + 0.1;
}
while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) {
ob.posY = ob.posY - 0.1;
}
if (Math.sqrt((ob.posY - _local7) * (ob.posY - _local7)) > 20) {
ob.posY = _local7;
} else if (((_local2.rSide == _local2.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 = ob.velY - 1;
}
}
_local9 = _local9 + (0.1 * _local3);
}
if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, (ob.posY + camPos.difY) + 0.2, true)) {
if (ob.velX > 0) {
ob.velX = ob.velX - ob.frictionForce;
} else if (ob.velX < 0) {
ob.velX = 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 = 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 = ob.posX + 1;
if (ob.velX < 0) {
ob.velX = 0;
}
}
groundCollision(ob);
var _local5 = 1;
while (_local5 <= circleCounter) {
if ((Math.sqrt(((myObject["circle" + _local5].posX - ob.posX) * (myObject["circle" + _local5].posX - ob.posX)) + ((myObject["circle" + _local5].posY - ob.posY) * (myObject["circle" + _local5].posY - ob.posY))) < (ob.radius + myObject["circle" + _local5].radius)) and (myObject["circle" + _local5].ID != ob.ID)) {
if (_local5 == player.isCarringBarrel) {
if (!player.barrelThrowed) {
dropBarrel();
} else {
barrelThrowFinished();
}
}
circleCollision(ob, myObject["circle" + _local5]);
}
_local5++;
}
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 _local7 = Math.sqrt((ob.velX * ob.velX) + (ob.velY * ob.velY)) + Math.sqrt((obCol.velX * obCol.velX) + (obCol.velY * obCol.velY));
var _local14 = (Math.atan2(ob.posY - obCol.posY, ob.posX - obCol.posX) * 180) / Math.PI;
var _local6 = Math.cos((_local14 * Math.PI) / 180);
var _local5 = Math.sin((_local14 * 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 = ob.posX + _local6;
ob.posY = ob.posY + _local5;
}
ob.posX = ob.posX + _local6;
ob.posY = ob.posY + _local5;
var _local10 = ob.posX - obCol.posX;
var _local9 = ob.posY - obCol.posY;
var _local13 = Math.sqrt((_local10 * _local10) + (_local9 * _local9));
var _local4 = _local10 / _local13;
var _local3 = _local9 / _local13;
var _local12 = (ob.velX * _local4) + (ob.velY * _local3);
var _local16 = ((-ob.velX) * _local3) + (ob.velY * _local4);
var _local11 = (obCol.velX * _local4) + (obCol.velY * _local3);
var _local15 = ((-obCol.velX) * _local3) + (obCol.velY * _local4);
var _local8 = 1;
var _local19 = 1;
var _local18 = _local12 + (((1 + _local19) * (_local11 - _local12)) / (1 + (_local8 / _local8)));
var _local17 = _local11 + (((1 + _local19) * (_local12 - _local11)) / (1 + (_local8 / _local8)));
ob.velX = (_local18 * _local4) - (_local16 * _local3);
ob.velY = ((_local18 * _local3) + (_local16 * _local4)) - game.gravity;
obCol.velX = (_local17 * _local4) - (_local15 * _local3);
obCol.velY = ((_local17 * _local3) + (_local15 * _local4)) - game.gravity;
ob.inMove = true;
obCol.inMove = true;
obCol.clip._rotation = obCol.clip._rotation + (obCol.velX * 4);
ob.clip._rotation = ob.clip._rotation + (ob.velX * 4);
while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) {
ob.posY = ob.posY - 1;
if (ob.velY > 0) {
ob.velY = 0;
}
}
if (_local7 > 5) {
addEffect_impactSmoke(ob, obCol, -20);
}
if (_local7 > 0) {
damageOb(ob, _local7 / 2);
damageOb(obCol, _local7 / 2);
}
}
function groundCollision(ob) {
var _local5 = 0;
var _local4 = 0;
var _local3 = 0;
var _local2 = 0;
var _local7 = 0;
while (_local7 <= 360) {
_local3 = Math.sin(_local7 * (Math.PI/180));
_local2 = Math.cos(_local7 * (Math.PI/180)) * -1;
_local5 = ob.posX;
_local4 = ob.posY;
_local5 = _local5 + ((_local3 * ob.radius) * 0.8);
_local4 = _local4 + (((_local2 * ob.radius) * 0.8) - ob.radius);
if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(_local5 + camPos.difX, _local4 + camPos.difY, true)) {
var _local6 = 0;
while ((_local6 <= 30) and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(_local5 + camPos.difX, _local4 + camPos.difY, true)) {
_local5 = _local5 - _local3;
_local4 = _local4 - _local2;
ob.clip._rotation = ob.clip._rotation + (ob.velX * 4);
ob.velX = ob.velX - _local3;
ob.velY = ob.velY - _local2;
ob.posX = ob.posX - _local3;
ob.posY = ob.posY - _local2;
_local6 = _local6 + 1;
}
if (_local6 >= 30) {
textMessage("Error:Physics:groundCollision failed");
}
}
_local7 = _local7 + (game.physicAccuracy * 4);
}
}
function addEffect_knockdownSmoke(ob) {
var _local2 = getGroundType(ob.posX, ob.posY);
if (_local2 == "water") {
var _local3 = "knockdown_water";
} else if (_local2 == "snow") {
var _local3 = "knockdown_snow";
addSound("snow_01.wav", 250, 0, 0);
} else {
var _local3 = "knockdown_dirt";
}
addEffect(_local3, ob.posX, ob.posY, 0, 2, 1);
}
function addEffect_landSmoke(ob) {
var _local2 = getGroundType(ob.posX, ob.posY);
if (_local2 == "water") {
var _local3 = "land_water";
} else if (_local2 == "snow") {
var _local3 = "land_snow";
} else {
var _local3 = "land_dirt";
}
addEffect(_local3, ob.posX, ob.posY, 0, 2, 1);
}
function addEffect_jumpSmoke(ob) {
var _local2 = getGroundType(ob.posX, ob.posY);
if (_local2 == "water") {
var _local3 = "jump_water";
} else if (_local2 == "snow") {
var _local3 = "jump_snow";
} else {
var _local3 = "jump_dirt";
}
addEffect(_local3, 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, 0, 1);
if (effectType == "blood_s_") {
addBloodstain(posX, posY);
}
}
function addEffect_impactSmoke(ob1, ob2, diffY) {
var _local3 = ob2.posX + ((ob1.posX - ob2.posX) / 2);
var _local2 = (ob2.posY + diffY) + ((ob1.posY - ob2.posY) / 2);
addEffect("impact_smoke", _local3, _local2, 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);
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);
addPart(ob.armDropType, 1, ob.posX, ob.posY - 28, player.dirX * 3, -5.5, true, false, 1, 2);
}
function addPart(type, counts, posX, posY, xForce, yForce, bloodstain, airTrail, power, blurTimer) {
var _local2 = 1;
while (_local2 <= counts) {
var _local1 = findEmptyObject("part", "partCounter");
myObject["part" + _local1] = new myObject.emptyPart();
if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(posX, posY, true)) {
posY = posY - 5;
}
myObject["part" + _local1].posX = posX;
myObject["part" + _local1].posY = posY;
var _local3 = (Math.random() * (power - 1)) + 1;
var _local4 = Math.random() * 360;
myObject["part" + _local1].velX = (Math.sin(_local4 * (Math.PI/180)) * _local3) + xForce;
myObject["part" + _local1].velY = ((Math.cos(_local4 * (Math.PI/180)) * _local3) * -1) + yForce;
staticEffectsCounterParts = staticEffectsCounterParts + 1;
if ((staticEffectsCounterParts > options.partParticles) and (options.partParticles > 0)) {
staticEffectsCounterParts = 1;
}
trace("staticEffectsCounterParts: " + staticEffectsCounterParts);
theWorld.staticEffectsLayerParts.attachMovie((type + "0") + _local2, "part_" + staticEffectsCounterParts, staticEffectsCounterParts);
myObject["part" + _local1].clip = theWorld.staticEffectsLayerParts["part_" + staticEffectsCounterParts];
myObject["part" + _local1].clip._x = myObject["part" + _local1].posX;
myObject["part" + _local1].clip._y = myObject["part" + _local1].posY;
myObject["part" + _local1].clip._alpha = 100;
myObject["part" + _local1].bloodstain = bloodstain;
myObject["part" + _local1].airTrail = airTrail;
myObject["part" + _local1].blurTimer = blurTimer;
myObject["part" + _local1].clip._rotation = Math.random() * 360;
if (myObject["part" + _local1].blurTimer > 0) {
addBlur(myObject["part" + _local1].clip, 5, 5);
}
_local2++;
}
}
function trackParts() {
if (partCounter > 0) {
var _local1 = 1;
while (_local1 <= partCounter) {
if (myObject["part" + _local1].inGame) {
if (myObject["part" + _local1].airTrail) {
myObject["part" + _local1].airTrailTimer = myObject["part" + _local1].airTrailTimer - 1;
if (myObject["part" + _local1].airTrailTimer <= 0) {
addEffect(["barrel_part_trail_0" + Math.floor((Math.random() * 3) + 1)], myObject["part" + _local1].posX, myObject["part" + _local1].posY, Math.random() * 360, 2, 1);
myObject["part" + _local1].airTrailTimer = 8;
}
}
if (myObject["part" + _local1].blurTimer > 0) {
myObject["part" + _local1].blurTimer = myObject["part" + _local1].blurTimer - 1;
if (myObject["part" + _local1].blurTimer <= 0) {
myObject["part" + _local1].clip.filters = null;
}
}
myObject["part" + _local1].velY = myObject["part" + _local1].velY + game.gravity;
myObject["part" + _local1].posX = myObject["part" + _local1].posX + myObject["part" + _local1].velX;
myObject["part" + _local1].clip._rotation = myObject["part" + _local1].clip._rotation + (myObject["part" + _local1].velX * 4);
if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(myObject["part" + _local1].posX + camPos.difX, myObject["part" + _local1].posY + camPos.difY, true)) {
myObject["part" + _local1].posX = myObject["part" + _local1].posX - (myObject["part" + _local1].velX * 1.1);
myObject["part" + _local1].velX = myObject["part" + _local1].velX * -0.8;
}
if ((myObject["part" + _local1].velY < 0) and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(myObject["part" + _local1].posX + camPos.difX, (myObject["part" + _local1].posY + camPos.difY) + myObject["part" + _local1].velY, true)) {
myObject["part" + _local1].velY = 0;
} else {
myObject["part" + _local1].posY = myObject["part" + _local1].posY + myObject["part" + _local1].velY;
if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(myObject["part" + _local1].posX + camPos.difX, myObject["part" + _local1].posY + camPos.difY, true)) {
while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(myObject["part" + _local1].posX + camPos.difX, myObject["part" + _local1].posY + camPos.difY, true)) {
myObject["part" + _local1].posY = myObject["part" + _local1].posY - 2;
}
myObject["part" + _local1].velY = myObject["part" + _local1].velY * -0.4;
myObject["part" + _local1].velX = myObject["part" + _local1].velX * 0.5;
myObject["part" + _local1].clip._rotation = myObject["part" + _local1].clip._rotation + (myObject["part" + _local1].velX * 3);
if ((Math.sqrt(myObject["part" + _local1].velY * myObject["part" + _local1].velY) + Math.sqrt(myObject["part" + _local1].velX * myObject["part" + _local1].velX)) < 2) {
myObject["part" + _local1].inGame = false;
myObject["part" + _local1].clip.filters = null;
} else if (myObject["part" + _local1].bloodstain and (myObject["part" + _local1].velY < 0)) {
addBloodstain(myObject["part" + _local1].posX, myObject["part" + _local1].posY - 6);
}
}
myObject["part" + _local1].clip._x = myObject["part" + _local1].posX;
myObject["part" + _local1].clip._y = myObject["part" + _local1].posY;
}
checkObInGame(myObject["part" + _local1]);
} else if (_local1 == partCounter) {
partCounter = partCounter - 1;
}
_local1++;
}
}
}
function addBloodstain(posX, posY) {
var _local3 = Math.floor((Math.random() * 3) + 4);
var _local2 = 1;
while (_local2 <= _local3) {
var _local1 = findEmptyObject("blood", "bloodstainCounter");
myObject["blood" + _local1] = new myObject.emptyBlood();
myObject["blood" + _local1].posX = posX;
myObject["blood" + _local1].posY = posY;
myObject["blood" + _local1].velX = Math.sin((Math.random() * 360) * (Math.PI/180)) * 2;
myObject["blood" + _local1].velY = (Math.cos((Math.random() * 360) * (Math.PI/180)) * 2) * -1;
myObject["blood" + _local1].velY = myObject["blood" + _local1].velY + 1;
_local2++;
}
}
function trackBloodstain() {
var _local1 = 1;
while (_local1 <= bloodstainCounter) {
if (myObject["blood" + _local1].inGame) {
if (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((myObject["blood" + _local1].posX + myObject["blood" + _local1].velX) + camPos.difX, myObject["blood" + _local1].posY + camPos.difY, true)) {
myObject["blood" + _local1].posX = myObject["blood" + _local1].posX + myObject["blood" + _local1].velX;
} else {
myObject["blood" + _local1].velX = myObject["blood" + _local1].velX * -1;
myObject["blood" + _local1].posX = myObject["blood" + _local1].posX + myObject["blood" + _local1].velX;
}
myObject["blood" + _local1].velY = myObject["blood" + _local1].velY + game.gravity;
if (myObject["blood" + _local1].velY < 0) {
if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(myObject["blood" + _local1].posX + camPos.difX, (myObject["blood" + _local1].posY + myObject["blood" + _local1].velY) + camPos.difY, true)) {
myObject["blood" + _local1].velY = myObject["blood" + _local1].velY * -1;
}
} else {
myObject["blood" + _local1].posY = myObject["blood" + _local1].posY + myObject["blood" + _local1].velY;
if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(myObject["blood" + _local1].posX + camPos.difX, myObject["blood" + _local1].posY + camPos.difY, true)) {
while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(myObject["blood" + _local1].posX + camPos.difX, myObject["blood" + _local1].posY + camPos.difY, true)) {
myObject["blood" + _local1].posY = myObject["blood" + _local1].posY - 3;
}
myObject["blood" + _local1].posY = myObject["blood" + _local1].posY + (Math.random() * 6);
myObject["blood" + _local1].inGame = false;
staticEffectsCounter = staticEffectsCounter + 1;
if ((staticEffectsCounter > options.bloodParticles) and (options.bloodParticles > 0)) {
staticEffectsCounter = 1;
}
var _local2 = getGroundType(myObject["blood" + _local1].posX, myObject["blood" + _local1].posY);
if (_local2 == "water") {
var _local3 = "bloodstain_water_0";
} else {
var _local3 = "bloodstain_0";
}
theWorld.staticEffectsLayer.attachMovie((_local3 + "") + Math.floor((Math.random() * 3) + 1), ["bloodstain_" + staticEffectsCounter], staticEffectsCounter);
theWorld.staticEffectsLayer["bloodstain_" + staticEffectsCounter]._x = myObject["blood" + _local1].posX;
theWorld.staticEffectsLayer["bloodstain_" + staticEffectsCounter]._y = myObject["blood" + _local1].posY;
}
}
checkObInGame(myObject["blood" + _local1]);
} else if (_local1 == bloodstainCounter) {
bloodstainCounter = bloodstainCounter - 1;
}
_local1++;
}
}
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 = effectCounter + 1;
if (effectCounter > 100) {
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 _local2 = 0;
ob.shadowClip._y = ob.posY - 4;
while ((_local2 <= 150) and (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.shadowClip._y + camPos.difY, true))) {
ob.shadowClip._y = ob.shadowClip._y + 10;
_local2 = _local2 + 10;
}
_local2 = 0;
while ((_local2 <= 20) and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.shadowClip._y + camPos.difY, true)) {
ob.shadowClip._y = ob.shadowClip._y - 1;
_local2 = _local2 + 1;
}
_local2 = 0;
while ((_local2 <= 10) and (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.shadowClip._y + camPos.difY, true))) {
ob.shadowClip._y = ob.shadowClip._y + 0.1;
_local2 = _local2 + 1;
}
scaleShadow(ob);
}
function addShadow(ob) {
game.shadows = 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 = step + 1;
if (step > 2) {
step = 1;
}
var _local1 = getGroundType(player.posX, player.posY);
if (_local1 == "water") {
var _local2 = ("mud_0" + step) + ".wav";
var _local3 = 175;
} else if (_local1 == "snow") {
var _local2 = ("snow_0" + step) + ".wav";
var _local3 = 60;
} else {
var _local2 = ("dirt_0" + step) + ".wav";
var _local3 = 15;
}
addSound(_local2, _local3, 0, 0);
}
function addSound(soundID, volumeID, panID, offsetID) {
soundCounter = soundCounter + 1;
if (soundCounter > 100) {
soundCounter = 1;
}
var _local1 = new Sound("mySound_" + soundCounter);
_local1.setVolume(volumeID);
_local1.setPan(panID);
_local1.attachSound(soundID);
_local1.start(offsetID);
}
function addBlur(ob, xValue, yValue) {
if (options.blurEffects) {
var _local2 = new flash.filters.BlurFilter(xValue, yValue, 1);
var _local1 = ob.filters;
_local1.push(_local2);
ob.filters = _local1;
}
}
function changeColour(ob, rm, gm, bm, ro, go, bo) {
var _local2 = new flash.geom.Transform(ob);
var _local1 = _local2.colorTransform;
_local1.redMultiplier = rm / 100;
_local1.greenMultiplier = gm / 100;
_local1.blueMultiplier = bm / 100;
_local1.redOffset = ro;
_local1.greenOffset = go;
_local1.blueOffset = bo;
_local2.colorTransform = _local1;
}
function setSaturation(object, amount) {
var _local2 = 0.2225;
var _local1 = 0.7169;
var _local3 = 0.0606;
var _local4 = [_local2, _local1, _local3, 0, 0, _local2, _local1, _local3, 0, 0, _local2, _local1, _local3, 0, 0, 0, 0, 0, 1, 0];
var _local5 = new flash.filters.ColorMatrixFilter(_local4);
object.filters = [_local5];
}
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 _local1 = camPos.virDifX - camPos.difX;
var _local2 = camPos.virDifY - camPos.difY;
if (Math.sqrt(_local1 * _local1) > 10) {
camPos.difX = camPos.difX + ((_local1 / Math.sqrt(_local1 * _local1)) * 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 _local4 = 1 / (zoom / 100);
interfaceLayer._xscale = _local4 * 100;
interfaceLayer._yscale = _local4 * 100;
var _local10 = 0 + (320 - (320 * (zoom / 100)));
var _local9 = 0 + (240 - (240 * (zoom / 100)));
_root._x = _local10;
_root._y = _local9;
interfaceLayer._x = (-_local10) * _local4;
interfaceLayer._y = (-_local9) * _local4;
game.rootRotation = countToNumber(game.rootRotation, 0, 0.1);
cameraShake();
if ((game.rootRotation != 0) and options.rotationEffects) {
var _local8 = -143.130102354156;
var _local5 = (_local8 + game.rootRotation) + 90;
var _local2 = 400 * (zoom / 100);
var _local7 = Math.sin(_local5 * (Math.PI/180)) * _local2;
var _local6 = (Math.cos(_local5 * (Math.PI/180)) * _local2) * -1;
_root._x = 320 + _local7;
_root._y = 240 + _local6;
_root._rotation = game.rootRotation;
_local5 = (_local8 - game.rootRotation) - 90;
_local2 = 400 * _local4;
_local7 = Math.sin(_local5 * (Math.PI/180)) * _local2;
_local6 = (Math.cos(_local5 * (Math.PI/180)) * _local2) * -1;
interfaceLayer._x = 320 - _local7;
interfaceLayer._y = 240 - _local6;
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 _local1 = (1 / (game.rootZoom / 100)) * 640;
var _local3 = 640 - _local1;
if (game.stopCam < 0) {
var _local2 = (player.posX * -1) - camPos.difX;
} else {
var _local2 = (camPos.difX - (player.posX * -1)) - 640;
}
camPos.difX = camPos.difX - ((_local3 / 2) * game.stopCam);
if ((game.stopCam < 0) and ((_local1 / 2) < (_local2 * -1))) {
camPos.difX = camPos.difX + (((_local2 * -1) - (_local1 / 2)) * -1);
} else if ((_local1 / 2) < (_local2 * -1)) {
camPos.difX = camPos.difX + ((_local2 * -1) - (_local1 / 2));
}
}
}
function traceKeys() {
if ((((player.holdingEnemy == 0) and (!player.isPreparingJump)) and (player.currentAttack == 0)) and (!player.uncontrollable)) {
if (key.rightPressed) {
if (player.velX < 0) {
player.velX = 0;
}
player.velX = countToNumber(player.velX, 5, 2);
} else if (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 = key.spacePower + 1;
}
if (checkIdlePlayer()) {
if ((Key.isDown(39) or Key.isDown(68)) and (player.dirX == 1)) {
key.rightPressed = true;
} else if ((Key.isDown(37) or Key.isDown(65)) and (player.dirX == -1)) {
key.leftPressed = true;
}
} else if ((player.isHoldingBarrel and (!player.isThrowingBarrel)) and (!player.isThrowingEnemy)) {
if (Key.isDown(39) or Key.isDown(68)) {
player.dirX = 1;
player.clip._xscale = 100 * player.dirX;
pickupBarrel();
} else if (Key.isDown(37) or Key.isDown(65)) {
player.dirX = -1;
player.clip._xscale = 100 * player.dirX;
pickupBarrel();
}
} else if ((!player.nextAttackPossible) and player.performNextAttack) {
if (Key.isDown(39) or Key.isDown(68)) {
player.dirX = 1;
} else if (Key.isDown(37) or Key.isDown(65)) {
player.dirX = -1;
}
player.clip._xscale = 100 * player.dirX;
}
}
function startPlayerJump() {
if ((Key.isDown(39) or Key.isDown(68)) and (player.dirX == 1)) {
player.velX = 3.66666666666667;
} else if ((Key.isDown(37) or Key.isDown(65)) and (player.dirX == -1)) {
player.velX = -3.66666666666667;
} else {
player.velX = player.dirX * 1.5;
}
player.isJumping = true;
}
function unpauseGame() {
MD.forcePointer = false;
hideCursor();
game.isPaused = false;
interfaceLayer.ratioFix.gotoAndStop("running");
}
function kick() {
if (player.finishingEnemy <= 0) {
var _local4 = 0;
var _local1 = 1;
while (_local1 <= enemyCounter) {
if ((myObject["enemy" + _local1].inGame and facingOb(player, myObject["enemy" + _local1])) and (_local4 == 0)) {
var _local3 = Math.sqrt((player.posX - myObject["enemy" + _local1].posX) * (player.posX - myObject["enemy" + _local1].posX));
var _local2 = Math.sqrt((player.posY - myObject["enemy" + _local1].posY) * (player.posY - myObject["enemy" + _local1].posY));
if ((_local3 <= 50) and (_local2 <= 50)) {
myObject["enemy" + _local1].dirX = -player.dirX;
myObject["enemy" + _local1].clip._xscale = myObject["enemy" + _local1].dirX * 100;
myObject["enemy" + _local1].velX = 0;
myObject["enemy" + _local1].velY = 0;
startFlyingEnemy(myObject["enemy" + _local1], player.dirX * 5, -2);
myObject["enemy" + _local1].knockdownTimer = 0;
myObject["enemy" + _local1].staggerTimer = 0;
myObject["enemy" + _local1].stunTimer = 0;
_local4 = _local1;
}
}
_local1++;
}
if (_local4 > 0) {
addEffect_Blood(myObject["enemy" + _local4].bloodType, player.posX + (player.dirX * 35), player.posY);
setCameraShake(2, 2);
}
}
}
function canKick() {
var _local4 = 0;
var _local1 = 1;
while (_local1 <= enemyCounter) {
if (((!myObject["enemy" + _local1].finishingDone) and myObject["enemy" + _local1].inGame) and facingOb(player, myObject["enemy" + _local1])) {
var _local3 = Math.sqrt((player.posX - myObject["enemy" + _local1].posX) * (player.posX - myObject["enemy" + _local1].posX));
var _local2 = Math.sqrt((player.posY - myObject["enemy" + _local1].posY) * (player.posY - myObject["enemy" + _local1].posY));
if ((((myObject["enemy" + _local1].posY + 2) > player.posY) and ((((_local4 == 0) and checkIdlePlayer()) and (_local3 <= 50)) and (_local2 <= 50))) and (((((myObject["enemy" + _local1].staggerTimer > 0) and (myObject["enemy" + _local1].life <= 0)) or (myObject["enemy" + _local1].stunTimer > 0)) or (myObject["enemy" + _local1].knockdownTimer > 0)) or ((myObject["enemy" + _local1].posY - 8) > player.posY))) {
_local4 = 1;
} else if ((_local3 <= 50) and (_local2 <= 15)) {
_local4 = 2;
}
}
_local1++;
}
if (_local4 == 1) {
return(true);
}
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 _local1 = 1;
while (_local1 <= enemyCounter) {
if (((((((((myObject["enemy" + _local1].currAttack != "jump") and (!myObject["enemy" + _local1].finishingDone)) and (!myObject["enemy" + _local1].isFalling)) and (myObject["enemy" + _local1].enemyType != "BOSS")) and (myObject["enemy" + _local1].enemyType != "Crow")) and (myObject["enemy" + _local1].life > 0)) and facingOb(player, myObject["enemy" + _local1])) and myObject["enemy" + _local1].inGame) and (((myObject["enemy" + _local1].stunTimer > 1) or (myObject["enemy" + _local1].knockdownTimer > 1)) or (player.rage >= 100))) {
var _local4 = Math.sqrt((myObject["enemy" + _local1].posX - player.posX) * (myObject["enemy" + _local1].posX - player.posX));
if (_local4 <= (finishingXRange - 4)) {
var _local3 = Math.sqrt((myObject["enemy" + _local1].posY - player.posY) * (myObject["enemy" + _local1].posY - player.posY));
if (_local3 < 30) {
var _local2 = false;
if (!((myObject["enemy" + _local1].stunTimer > 0) or (myObject["enemy" + _local1].knockdownTimer > 0))) {
_local2 = true;
}
if (_local2) {
player.clip.filters = [myRageGlowAttacking];
if ((Math.random() * 100) < 33) {
finishHim(_local1, "finishing_1", true, 6);
} else if ((Math.random() * 100) < 33) {
finishHim(_local1, "finishing_2", false, 10);
} else {
finishHim(_local1, "finishing_0_rage", false, 30);
}
updateHPRage(0, -100);
return(true);
}
player.clip.filters = [myRageGlow];
if (myObject["enemy" + _local1].stunTimer > 0) {
if ((Math.random() * 100) <= 50) {
finishHim(_local1, "finishing_1", true, 6);
} else {
finishHim(_local1, "finishing_2", false, 10);
}
return(true);
}
if (myObject["enemy" + _local1].knockdownTimer > 0) {
if ((Math.random() * 100) <= 10) {
finishHim(_local1, "finishing_kd_2", false, 10);
} else {
finishHim(_local1, "finishing_kd_1", false, 10);
}
return(true);
}
}
}
}
_local1++;
}
}
return(false);
}
function finishHim(nr, type, facePC, maxDistY) {
var _local3 = false;
if ((type == "finishing_2") and checkForLedge(myObject["enemy" + nr], 50)) {
_local3 = 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].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 {
myObject["enemy" + nr].clip.gotoAndStop(type);
myObject["enemy" + nr].clip.swapDepths(1000);
myObject["enemy" + nr].frameTimer = myObject["enemy" + nr].clip.mc._totalFrames;
}
myObject["enemy" + nr].finishingDone = true;
myObject["enemy" + nr].finishingType = type;
if (type == "finishing_kd_1") {
myObject["enemy" + nr].knockdownTimer = myObject["enemy" + nr].knockdownTimer + 10;
}
myObject["enemy" + nr].clip.filters = [myRageGlow];
player.finishingEnemy = nr;
setuncontrollable();
player.immortal = true;
player.clip.gotoAndStop(type);
if (type != "finishing_2") {
setEnemyPlayerPos(myObject["enemy" + nr]);
}
myObject["enemy" + nr].velX = 0;
myObject["enemy" + nr].velY = 0;
var _local4 = Math.sqrt((myObject["enemy" + nr].posY - player.posY) * (myObject["enemy" + nr].posY - player.posY));
if (_local3 or (_local4 >= maxDistY)) {
myObject["enemy" + nr].currAttack = "finishing_locked";
myObject["enemy" + nr].life = 0.1;
myObject["enemy" + nr].clip.gotoAndStop("idle");
player.clip.gotoAndStop("finishing_0");
}
updateHPRage(0, 10);
}
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].canDropArm) {
cutArmEnemy(myObject["enemy" + player.finishingEnemy]);
} else {
damageEnemy(myObject["enemy" + player.finishingEnemy], 9999, "death_01");
}
}
function finishingJumpyRage() {
myObject["enemy" + player.finishingEnemy].posY = myObject["enemy" + player.finishingEnemy].posY - 20;
gibEnemyYey(myObject["enemy" + player.finishingEnemy]);
}
function checkStrongSpace() {
if (key.spacePower == 5) {
if (player.holdingEnemy > 0) {
if (!player.doingHeadKnock) {
if (Key.isDown(39) or Key.isDown(68)) {
turnGrip(1);
} else if (Key.isDown(37) or Key.isDown(65)) {
turnGrip(-1);
}
player.isThrowingEnemy = true;
player.clip.gotoAndStop("throw");
}
} else if (player.isHoldingBarrel) {
if (Key.isDown(39) or Key.isDown(68)) {
player.dirX = 1;
player.clip._xscale = 100 * player.dirX;
pickupBarrel();
} else if (Key.isDown(37) or Key.isDown(65)) {
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) {
player.clip.gotoAndStop("att_s_run");
} else {
player.clip.gotoAndStop("att_s");
player.velX = 0;
}
}
}
}
function endOfDemo() {
_root.stopAllSounds();
stopAllSounds();
addSound("168072_2008.08.25_Epic_Conan_Orch.mp3", 75, 0, 0);
demoOver = true;
interfaceLayer.ratioFix.gotoAndStop("demoOver");
}
function tutorialRage() {
if ((TutorialArray[10] != true) and (TutorialArray[0] != true)) {
updateHPRage(0, 100);
}
}
function showTutorial(TutorialID) {
if (!game.levelFinished) {
if ((TutorialArray[TutorialID] != true) and (TutorialArray[0] != true)) {
TutorialArray[TutorialID] = true;
MD.forcePointer = true;
showCursor();
game.isPaused = true;
key.spacePressed = false;
key.spaceTabbed = false;
key.spacePower = 0;
interfaceLayer.ratioFix.gotoAndStop("tutorial");
interfaceLayer.ratioFix.tutorial_text_field.gotoAndStop(TutorialID);
}
}
}
function continueTutorial() {
interfaceLayer.ratioFix.gotoAndStop("running");
hideCursor();
key.rightPressed = false;
key.leftPressed = false;
game.isPaused = false;
}
function disableTutorial() {
TutorialArray[0] = true;
continueTutorial();
saveBOSoS();
}
function showBossPlate(str) {
interfaceLayer.ratioFix.boss_plate._alpha = 100;
interfaceLayer.ratioFix.boss_plate._y = interfaceLayer.ratioFix.boss_plate._y + 100;
interfaceLayer.ratioFix.boss_plate.boss_txt.gotoAndStop(str);
}
function changeBossPlateHP(curr_hits_left, max_hit) {
var _local1 = (curr_hits_left / max_hit) * 100;
interfaceLayer.ratioFix.boss_plate.hp_bar._xscale = _local1;
}
function exitLevelNow() {
unpauseGame();
gameOver();
}
function updateRage() {
if (player.rageTimer > 0) {
player.rageTimer = player.rageTimer - 1;
} else if (player.rage > 0) {
player.rage = player.rage - 0.05;
interfaceLayer.ratioFix.hp_rage.rageBar._yscale = player.rage;
interfaceLayer.ratioFix.hp_rage.rage_indicator.gotoAndStop(1);
player.clip.filters = null;
if (player.rage < 0) {
player.rage = 0;
}
}
}
function updateHPRage(HPChange, RageChange) {
player.rage = player.rage + RageChange;
player.life = player.life + HPChange;
if (player.rage > 100) {
player.rage = 100;
}
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 <= 90) {
showTutorial(12);
}
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)) {
showTutorial(10);
player.rageTimer = 288;
player.clip.filters = [myRageGlow];
interfaceLayer.ratioFix.hp_rage.rage_indicator.play();
} else if ((player.rageTimer > 0) and (player.rage < 100)) {
player.rageTimer = 0;
interfaceLayer.ratioFix.hp_rage.rage_indicator.gotoAndStop(1);
player.clip.filters = null;
}
if (player.life <= 0) {
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 (!demoOver) {
interfaceLayer.ratioFix.gotoAndStop("game_over");
}
player.deathInitiated = true;
var _local1 = 1;
while (_local1 <= 20) {
xmarker._x = (player.posX + (Math.random() * 300)) - 150;
xmarker._y = (player.posY - 245) - (Math.random() * 200);
spawnEnemy(xmarker, "CROW_1", 1, "nothing");
_local1++;
}
addSound("crow_01.wav", 100, 0, 0);
}
}
}
function cleaveArrows() {
if (arrowCounter > 0) {
var _local6 = Math.sqrt(player.clip.mc.attackRange._x * player.clip.mc.attackRange._x);
var _local4 = player.clip.mc.minY_attackRange._y + 35;
var _local5 = player.clip.mc.maxY_attackRange._y;
var _local1 = minArrowCounter;
while (_local1 <= arrowCounter) {
if (myObject["arrow" + _local1].inGame and facingOb(player, myObject["arrow" + _local1])) {
var _local3 = Math.sqrt((myObject["arrow" + _local1].posX - player.posX) * (myObject["arrow" + _local1].posX - player.posX));
var _local2 = myObject["arrow" + _local1].posY - player.posY;
if (((_local2 >= _local5) and (_local2 <= _local4)) and (_local3 <= _local6)) {
addEffect("matchwood", myObject["arrow" + _local1].posX, myObject["arrow" + _local1].posY, 0, 0, 1);
addPart("arrow_part_", 1, myObject["arrow" + _local1].posX, myObject["arrow" + _local1].posY, player.dirX * 6, -2, false, false, 5, 5);
addPart("arrow_head_", 1, myObject["arrow" + _local1].posX, myObject["arrow" + _local1].posY, myObject["arrow" + _local1].velX, -2, false, false, 2, 5);
myObject["arrow" + _local1].inGame = false;
removeMovieClip(myObject["arrow" + _local1].shadowClip);
removeMovieClip(myObject["arrow" + _local1].clip);
}
}
_local1++;
}
}
}
function cleaveBarrels(damage) {
if (circleCounter > 0) {
var _local7 = Math.sqrt(player.clip.mc.attackRange._x * player.clip.mc.attackRange._x);
var _local5 = player.clip.mc.minY_attackRange._y + 35;
var _local6 = player.clip.mc.maxY_attackRange._y;
var _local1 = 1;
while (_local1 <= circleCounter) {
if (myObject["circle" + _local1].inGame and facingOb(player, myObject["circle" + _local1])) {
var _local3 = Math.sqrt((myObject["circle" + _local1].posX - player.posX) * (myObject["circle" + _local1].posX - player.posX));
var _local2 = myObject["circle" + _local1].posY - player.posY;
if (((_local2 >= _local6) and (_local2 <= _local5)) and (_local3 <= _local7)) {
myObject["circle" + _local1].inMove = true;
myObject["circle" + _local1].velX = myObject["circle" + _local1].velX + ((player.dirX * damage) / 6);
addSound("wood_crate_impact_hard2.wav", 25, 0, 0);
addEffect("matchwood", myObject["circle" + _local1].posX, myObject["circle" + _local1].posY - 20, 0, 0, 1);
damageOb(myObject["circle" + _local1], damage);
}
}
_local1++;
}
}
}
function cleaveEnemies(damage, attackValues) {
var _local7 = player.posX + (Math.sqrt(player.clip.mc.attackRange._x * player.clip.mc.attackRange._x) * player.dirX);
var _local18 = player.posY + player.clip.mc.maxY_attackRange._y;
var _local17 = player.posY + player.clip.mc.minY_attackRange._y;
var _local22 = false;
var _local1 = 1;
while (_local1 <= enemyCounter) {
if (((myObject["enemy" + _local1].inGame and facingOb(player, myObject["enemy" + _local1])) and facingOb(myObject["enemy" + _local1], player)) and (!myObject["enemy" + _local1].immortal)) {
var _local15 = (myObject["enemy" + _local1].posY + myObject["enemy" + _local1].HB_posY) - myObject["enemy" + _local1].HB_height;
var _local11 = (myObject["enemy" + _local1].posY + myObject["enemy" + _local1].HB_posY) + myObject["enemy" + _local1].HB_height;
var _local9 = myObject["enemy" + _local1].posX + (myObject["enemy" + _local1].HB_width * (-player.dirX));
var _local12 = Math.sqrt((myObject["enemy" + _local1].posY - player.posY) * (myObject["enemy" + _local1].posY - player.posY));
if ((_local12 <= 8) and (((_local18 < _local11) and (_local17 > _local15)) and (((_local7 > _local9) and (player.dirX == 1)) or ((_local7 < _local9) and (player.dirX == -1))))) {
var _local10 = parseInt(findString("/parryable-", attackValues, "/"));
if (((((((_local10 == 1) and (myObject["enemy" + _local1].canParry == 1)) and (player.contesting == 0)) and (myObject["enemy" + _local1].attackTimer > 0)) and (myObject["enemy" + _local1].attackTimer <= 3)) and (myObject["enemy" + _local1].currAttack != "throw_barrel")) and (myObject["enemy" + _local1].currAttack != "uncontrollable")) {
contest_sound.start(0.2);
addSound("contest_begin.wav", 100, 0, 0);
setCameraShake(3, 5);
_local22 = true;
setuncontrollable();
player.contestingTimer = 75;
player.velX = 0;
player.contestingPower = 0;
player.contestingPower = player.contestingPower - parseInt(findString("/contestPushbacks-", myObject["enemy" + _local1].enemyValues, "/"));
player.contesting = _local1;
player.clip.gotoAndStop("contest");
player.immortal = true;
myObject["enemy" + _local1].currAttack = "contesting";
myObject["enemy" + _local1].clip.gotoAndStop("contest");
myObject["enemy" + _local1].attackTimer = 0;
myObject["enemy" + _local1].oldDepth = myObject["enemy" + _local1].clip.getDepth();
myObject["enemy" + _local1].clip.swapDepths(1000);
addEffect_sparks(player);
addEffect_sparks(myObject["enemy" + _local1]);
}
}
}
_local1++;
}
var _local23 = false;
var _local20 = false;
var _local21 = false;
var _local16 = parseInt(findString("/stunEffect-", attackValues, "/"));
var _local19 = parseInt(findString("/pushbackEffect-", attackValues, "/"));
if (!_local22) {
_local1 = 1;
while (_local1 <= enemyCounter) {
if (((((!((myObject["enemy" + _local1].staggerTimer > 0) and (myObject["enemy" + _local1].life <= 0))) and (myObject["enemy" + _local1].currAttack != "finishing")) and myObject["enemy" + _local1].inGame) and facingOb(player, myObject["enemy" + _local1])) and (!myObject["enemy" + _local1].immortal)) {
var _local15 = (myObject["enemy" + _local1].posY + myObject["enemy" + _local1].HB_posY) - myObject["enemy" + _local1].HB_height;
var _local11 = (myObject["enemy" + _local1].posY + myObject["enemy" + _local1].HB_posY) + myObject["enemy" + _local1].HB_height;
var _local9 = myObject["enemy" + _local1].posX + (myObject["enemy" + _local1].HB_width * (-player.dirX));
if (((_local18 < _local11) and (_local17 > _local15)) and (((_local7 > _local9) and (player.dirX == 1)) or ((_local7 < _local9) and (player.dirX == -1)))) {
myObject["enemy" + _local1].dirX = player.dirX * -1;
myObject["enemy" + _local1].clip._xscale = 100 * myObject["enemy" + _local1].dirX;
var _local13 = parseInt(findString("/blockable-", attackValues, "/"));
var _local8 = false;
if (((myObject["enemy" + _local1].enemyType == "orc_sword") and (myObject["enemy" + _local1].blocksPerformed == 2)) and ((Math.random() * 100) < 25)) {
myObject["enemy" + _local1].blocksPerformed = 0;
_local8 = true;
}
if ((((!_local8) and (_local13 == 1)) and ((myObject["enemy" + _local1].currAttack == "idle") or (myObject["enemy" + _local1].currAttack == "run"))) and (myObject["enemy" + _local1].canBlock == 1)) {
startBlocking(myObject["enemy" + _local1]);
_local20 = true;
if (myObject["enemy" + _local1].enemyType == "ChaosKnight") {
_local21 = true;
}
} else {
updateHPRage(0, damage / 3);
var _local4 = parseInt(findString("/cutArmChance-", attackValues, "/"));
var _local6 = parseInt(findString("/cutHeadChance-", attackValues, "/"));
_local23 = true;
if (myObject["enemy" + _local1].knockdownTimer > 0) {
var _local3 = -10;
} else {
var _local3 = myObject["enemy" + _local1].HB_posY;
}
var _local14 = parseInt(findString("/showBashEffect-", attackValues, "/"));
if (_local14 == 1) {
addEffect("bash_effect", myObject["enemy" + _local1].posX, myObject["enemy" + _local1].posY + _local3, 0, 4, 1);
}
if (myObject["enemy" + _local1].bloodStain == 1) {
addEffect_Blood(myObject["enemy" + _local1].bloodType, myObject["enemy" + _local1].posX, myObject["enemy" + _local1].posY + _local3);
} else if (myObject["enemy" + _local1].bloodStain == 2) {
addEffect(myObject["enemy" + _local1].bloodType, myObject["enemy" + _local1].posX, myObject["enemy" + _local1].posY + _local3, 0, 3, 1);
} else if (myObject["enemy" + _local1].bloodStain == 3) {
addEffect((myObject["enemy" + _local1].bloodType + "0") + Math.round((Math.random() * 1) + 1), myObject["enemy" + _local1].posX, myObject["enemy" + _local1].posY + _local3, 0, 3, 1);
}
if (Key.isDown(16) and BOSoS_CHEATS) {
if (Key.isDown(51)) {
_local6 = 100;
} else if (Key.isDown(50)) {
_local4 = 100;
}
}
if (myObject["enemy" + _local1].enemyType == "BOSS") {
_local6 = -1;
_local4 = -1;
_local16 = -1;
_local19 = -1;
}
if ((damage >= myObject["enemy" + _local1].life) and checkForLedge(myObject["enemy" + _local1], 50)) {
myObject["enemy" + _local1].forceDownALedge = true;
myObject["enemy" + _local1].staggerTimer = myObject["enemy" + _local1].staggerTimer + 2;
myObject["enemy" + _local1].stunTimer = 0;
} else {
myObject["enemy" + _local1].forceDownALedge = false;
}
if (((((((!myObject["enemy" + _local1].forceDownALedge) and (damage > myObject["enemy" + _local1].life)) and ((Math.random() * 100) <= _local6)) and (myObject["enemy" + _local1].knockdownTimer <= 0)) and myObject["enemy" + _local1].canDropHead) and (!myObject["enemy" + _local1].isFalling)) and (myObject["enemy" + _local1].currAttack != "jump")) {
myObject["enemy" + _local1].staggerTimer = 0;
decapitateEnemy(myObject["enemy" + _local1], 1);
} else if (((((!myObject["enemy" + _local1].forceDownALedge) and (damage > myObject["enemy" + _local1].life)) and ((Math.random() * 100) <= _local4)) and (myObject["enemy" + _local1].knockdownTimer <= 0)) and myObject["enemy" + _local1].canDropArm) {
cutArmEnemy(myObject["enemy" + _local1]);
} else {
if (myObject["enemy" + _local1].knockdownTimer <= 0) {
myObject["enemy" + _local1].clip.gotoAndStop("idle");
myObject["enemy" + _local1].clip.gotoAndStop("eff_stagger");
if (myObject["enemy" + _local1].staggerTimer > 0) {
myObject["enemy" + _local1].stunTimer = 0;
}
myObject["enemy" + _local1].staggerTimer = myObject["enemy" + _local1].staggerTimer + (parseInt(findString("/minStaggerTime-", attackValues, "/")) + (Math.random() * (parseInt(findString("/maxStaggerTime-", attackValues, "/")) - parseInt(findString("/minStaggerTime-", attackValues, "/")))));
} else {
myObject["enemy" + _local1].knockdownTimer = myObject["enemy" + _local1].knockdownTimer + parseInt(findString("/minStaggerTime-", attackValues, "/"));
}
damageEnemy(myObject["enemy" + _local1], damage, findString("/deathAnimationType-", attackValues, "/"));
player.clip.mc.stop();
if (player.attackPause < 1) {
player.attackPause = 1;
}
player.attackPause = player.attackPause + 1;
if (((Math.random() * 100) <= _local16) and (myObject["enemy" + _local1].life > 0)) {
myObject["enemy" + _local1].stunTimer = (Math.random() * 35) + 35;
myObject["enemy" + _local1].staggerTimer = 0;
myObject["enemy" + _local1].blurTimer = 4;
addBlur(myObject["enemy" + _local1].clip, 5, 5);
setCameraShake(5, 5);
} else if (((Math.random() * 100) <= _local19) and (myObject["enemy" + _local1].life > 0)) {
myObject["enemy" + _local1].velX = 0;
myObject["enemy" + _local1].velY = 0;
startFlyingEnemy(myObject["enemy" + _local1], player.dirX * 2, -3);
}
}
}
}
}
_local1++;
}
}
if (_local23) {
addSound(("hitFlesh_0" + Math.floor((Math.random() * 2) + 1)) + ".wav", 40, 0, 0);
}
if (_local20) {
if (_local21) {
addSound("parry_01.wav", 90, 0, 0);
} else {
addSound("shield.wav", 55, 0, 0);
}
}
}
function cutArmEnemy(ob) {
ob.dirX = -player.dirX;
ob.clip._xscale = ob.dirX * 100;
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 _local2 = 1;
while (_local2 <= dist) {
if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((ob.posX + camPos.difX) - (ob.dirX * _local2), (ob.posY + camPos.difY) + 4, true) and (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((ob.posX + camPos.difX) - (ob.dirX * (_local2 + 4)), (ob.posY + camPos.difY) + (yCheckAxis - 4), true))) {
return(true);
}
if ((!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((ob.posX + camPos.difX) - (ob.dirX * _local2), (ob.posY + camPos.difY) + 4, true)) and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((ob.posX + camPos.difX) - (ob.dirX * (_local2 + 4)), (ob.posY + camPos.difY) + (yCheckAxis - 4), true)) {
return(false);
}
_local2 = _local2 + 2;
}
return(false);
}
function damageEnemy(ob, damage, deathAnimationType) {
ob.life = ob.life - damage;
ob.attackTimer = 0;
if ((ob.currAttack == "jump") or ob.isFalling) {
startFlyingEnemy(ob, 0, 0);
} else if (ob.life <= 0) {
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)) {
ob.bloodTimer_stagger_death = 4;
ob.staggerTimer = 999;
ob.currAttack = "stagger_down_a_cliff";
} else if (ob.armDropped) {
ob.bloodTimer_stagger_death = 4;
ob.staggerTimer = 40;
ob.currAttack = "death_stagger";
} else {
addDeadEnemy(ob, deathAnimationType);
}
}
}
function attack_pickup() {
player.headKnocksDone = player.headKnocksDone + 1;
player.holdingEnemyTimer = 0;
myObject["enemy" + player.holdingEnemy].clip.mc.play();
myObject["enemy" + player.holdingEnemy].life = myObject["enemy" + player.holdingEnemy].life - (8 + (player.headKnocksDone * 3));
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) {
var _local1 = getAttack(attackID);
var _local2 = parseInt(findString("/dmg-", _local1, "/"));
var _local3 = parseInt(findString("/pushbackEffect-", _local1, "/"));
cleaveArrows();
cleaveBarrels(_local2);
cleaveEnemies(_local2, _local1);
cleaveFoodCrates();
}
function cleaveFoodCrates() {
if (foodCrateCounter > 0) {
var _local1 = 1;
while (_local1 <= foodCrateCounter) {
if (myObject["foodCrate" + _local1].inGame and facingOb(player, myObject["foodCrate" + _local1])) {
var _local2 = Math.sqrt(((myObject["foodCrate" + _local1].posX - player.posX) * (myObject["foodCrate" + _local1].posX - player.posX)) + ((myObject["foodCrate" + _local1].posY - player.posY) * (myObject["foodCrate" + _local1].posY - player.posY)));
if (_local2 < 80) {
showTutorial(11);
spawnFood(myObject["foodCrate" + _local1].posX, myObject["foodCrate" + _local1].posY, myObject["foodCrate" + _local1].FoodType);
myObject["foodCrate" + _local1].clip.play();
myObject["foodCrate" + _local1].inGame = false;
}
}
_local1++;
}
}
}
function dropEnemy(velX, velY) {
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 checkPickupEnemies() {
if (!player.uncontrollable) {
var _local1 = 1;
while (_local1 <= enemyCounter) {
if ((myObject["enemy" + _local1].inGame and (player.holdingEnemy <= 0)) and facingOb(player, myObject["enemy" + _local1])) {
var _local3 = Math.sqrt((myObject["enemy" + _local1].posX - player.posX) * (myObject["enemy" + _local1].posX - player.posX));
var _local2 = Math.sqrt((myObject["enemy" + _local1].posY - player.posY) * (myObject["enemy" + _local1].posY - player.posY));
if (((((((myObject["enemy" + _local1].life > 0) and (!myObject["enemy" + _local1].isFalling)) and (myObject["enemy" + _local1].knockdownTimer <= 0)) and checkIdlePlayer()) and (myObject["enemy" + _local1].currAttack == "uncontrollable")) and (_local2 <= 40)) and (_local3 <= 20)) {
myObject["enemy" + _local1].oldDepth = myObject["enemy" + _local1].clip.getDepth();
myObject["enemy" + _local1].clip.swapDepths(1000);
myObject["enemy" + _local1].currAttack = "uncontrollable";
myObject["enemy" + _local1].staggerTimer = 0;
myObject["enemy" + _local1].stunTimer = 0;
myObject["enemy" + _local1].knockdownTimer = 0;
myObject["enemy" + _local1].pickedup = true;
myObject["enemy" + _local1].isFalling = false;
player.holdingEnemy = _local1;
player.headKnocksDone = 0;
player.holdingEnemyTimer = 0;
player.velX = 0;
player.clip.gotoAndStop("pickup");
myObject["enemy" + _local1].clip.gotoAndStop("eff_pickup");
myObject["enemy" + _local1].posX = player.posX + (player.clip.mc.grip._x * player.dirX);
myObject["enemy" + _local1].posY = player.posY + player.clip.mc.grip._y;
myObject["enemy" + _local1].dirX = -player.dirX;
myObject["enemy" + _local1].clip._xscale = myObject["enemy" + _local1].dirX * 100;
myObject["enemy" + _local1].clip._x = myObject["enemy" + _local1].posX;
myObject["enemy" + _local1].clip._y = myObject["enemy" + _local1].posY;
moveShadow(myObject["enemy" + _local1]);
}
}
_local1++;
}
}
}
function checkBarrelPush(ob) {
var _local1 = 1;
while (_local1 <= circleCounter) {
if (myObject["circle" + _local1].inGame) {
if (Math.sqrt(((myObject["circle" + _local1].posX - ob.posX) * (myObject["circle" + _local1].posX - ob.posX)) + ((myObject["circle" + _local1].posY - ob.posY) * (myObject["circle" + _local1].posY - ob.posY))) < 30) {
if (((ob.posX < myObject["circle" + _local1].posX) and (ob.velX > 0)) or ((ob.posX > myObject["circle" + _local1].posX) and (ob.velX < 0))) {
var _local3 = (ob.velX / Math.sqrt(ob.velX * ob.velX)) * 2.5;
if (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((myObject["circle" + _local1].posX + camPos.difX) + _local3, (myObject["circle" + _local1].posY + camPos.difY) - myObject["circle" + _local1].radius, true)) {
myObject["circle" + _local1].posX = myObject["circle" + _local1].posX + _local3;
}
myObject["circle" + _local1].velX = 0;
if (myObject["circle" + _local1].clip._currentFrame == 2) {
myObject["circle" + _local1].clip._rotation = myObject["circle" + _local1].clip._rotation + ((ob.velX / Math.sqrt(ob.velX * ob.velX)) * 2);
if (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((myObject["circle" + _local1].posX + camPos.difX) - ob.dirX, (myObject["circle" + _local1].posY + camPos.difY) - myObject["circle" + _local1].radius, true)) {
myObject["circle" + _local1].posX = myObject["circle" + _local1].posX - ob.dirX;
}
myObject["circle" + _local1].velX = ob.dirX;
}
myObject["circle" + _local1].inMove = true;
return(true);
}
} else if (Math.sqrt(((myObject["circle" + _local1].posX - player.posX) * (myObject["circle" + _local1].posX - player.posX)) + ((myObject["circle" + _local1].posY - player.posY) * (myObject["circle" + _local1].posY - player.posY))) < 60) {
showTutorial(5);
}
}
_local1++;
}
return(false);
}
function dropBarrel() {
var _local1 = player.isCarringBarrel;
myObject["circle" + _local1].posX = player.posX + (player.dirX * 30);
myObject["circle" + _local1].posY = player.posY - 25;
myObject["circle" + _local1].velY = -1;
myObject["circle" + _local1].velX = 0;
myObject["circle" + _local1].inMove = true;
player.isHoldingBarrel = false;
player.isThrowingBarrel = false;
player.clip.gotoAndStop("idle");
myObject["circle" + _local1].clip.gotoAndStop(1);
myObject["circle" + _local1].clip._rotation = 0;
myObject["circle" + _local1].clip._x = myObject["circle" + _local1].posX;
myObject["circle" + _local1].clip._y = myObject["circle" + _local1].posY - myObject["circle" + _local1].radius;
player.isCarringBarrel = 0;
}
function barrelAway() {
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 = myObject["enemy" + player.holdingEnemy].posY + 15;
startFlyingEnemy(myObject["enemy" + player.holdingEnemy], player.dirX * 9, -3);
player.isThrowingEnemy = true;
} 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() {
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 ((myObject["circle" + player.isCarringBarrel].inGame and (player.stunTimer <= 0)) and (player.staggerTimer <= 0)) {
if (Key.isDown(39) or Key.isDown(68)) {
player.dirX = 1;
player.clip._xscale = 100 * player.dirX;
} else if (Key.isDown(37) or Key.isDown(65)) {
player.dirX = -1;
player.clip._xscale = 100 * player.dirX;
}
showTutorial(8);
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].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 {
trace("-------------Abort pickupBarrel-----------");
player.isHoldingBarrel = false;
player.isCarringBarrel = 0;
}
}
function checkBarrelPickup(ob) {
if (theWorld.actorsLayer.hitTest((ob.posX + camPos.difX) + (ob.dirX * 30), (ob.posY + camPos.difY) - 20, true) or theWorld.actorsLayer.hitTest((ob.posX + camPos.difX) + (ob.dirX * 55), (ob.posY + camPos.difY) - 20, true)) {
return(false);
}
var _local1 = 1;
while (_local1 <= circleCounter) {
if (Math.sqrt(((myObject["circle" + _local1].posX - ob.posX) * (myObject["circle" + _local1].posX - ob.posX)) + ((myObject["circle" + _local1].posY - ob.posY) * (myObject["circle" + _local1].posY - ob.posY))) <= 40) {
if (((myObject["circle" + _local1].clip._x != undefined) and ((ob.posX < myObject["circle" + _local1].posX) and (ob.dirX > 0))) or ((ob.posX > myObject["circle" + _local1].posX) and (ob.dirX < 0))) {
player.isCarringBarrel = _local1;
return(true);
}
}
_local1++;
}
return(false);
}
function movePlayerXAxis() {
var _local4 = player.posX;
var _local1 = 0;
var _local3 = false;
_local1 = player.velX / Math.sqrt(player.velX * player.velX);
if (_local1 == 0) {
textMessage(("Error:GameFlow:xMovement:invalid for player (" + _local1) + ")");
_local1 = player.dirX;
if (_local1 == 0) {
textMessage(("Error:GameFlow:xMovement_secondLayer:invalid for player (" + _local1) + ")");
_local1 = 1;
player.dirX = 1;
}
}
if ((player.staggerTimer <= 0) and (!player.isKnockdowned)) {
player.dirX = _local1;
}
if (checkBarrelPush(player)) {
player.velX = player.velX / Math.sqrt(player.velX * player.velX);
}
var _local2 = 0;
while (_local2 <= Math.sqrt(player.velX * player.velX)) {
if ((((((player.posX + (_local1 * 15)) < camPos.minX) or ((player.posX + (_local1 * 15)) > camPos.maxX)) or theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((player.posX + camPos.difX) + (_local1 * 15), (player.posY + camPos.difY) - yCheckAxis, true)) or (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((player.posX + camPos.difX) + (_local1 * 15), player.posY + camPos.difY, true) and player.isJumping)) or theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((player.posX + camPos.difX) + (_local1 * 15), (player.posY + camPos.difY) - 50, true)) {
while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((player.posX + camPos.difX) + (_local1 * 15), (player.posY + camPos.difY) - yCheckAxis, true) or theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((player.posX + camPos.difX) + (_local1 * 15), (player.posY + camPos.difY) - 50, true)) {
player.posX = player.posX - _local1;
}
_local3 = true;
} else if ((!player.isJumping) and player.isPreparingJump) {
} else {
player.posX = player.posX + _local1;
}
_local2++;
}
if ((!_local3) or player.isJumping) {
if (player.isJumping) {
game.rootRotation = countToNumber(game.rootRotation, 1.5 * _local1, 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 * _local1, 1);
}
}
}
if (((!player.uncontrollable) and (!player.isPreparingJump)) and (player.currentAttack == 0)) {
if (!_local3) {
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 = camPos.difX - (player.posX - _local4);
}
camPos.virDifX = camPos.virDifX - (player.posX - _local4);
}
eatFood();
}
function eatFood() {
if ((foodCounter > 0) and (player.life < 100)) {
var _local1 = 1;
while (_local1 <= foodCounter) {
if (myObject["food" + _local1].inGame) {
var _local3 = Math.sqrt((myObject["food" + _local1].posX - player.posX) * (myObject["food" + _local1].posX - player.posX));
var _local2 = Math.sqrt((myObject["food" + _local1].posY - player.posY) * (myObject["food" + _local1].posY - player.posY));
if ((_local3 <= 10) and (_local2 <= 20)) {
myObject["food" + _local1].clip.removeMovieClip();
myObject["food" + _local1].inGame = false;
updateHPRage(myObject["food" + _local1].Healing, 0);
}
}
_local1++;
}
}
}
function movePlayerYAxis() {
var _local2 = player.posY;
if (!player.isJumping) {
game.rootZoom = countToNumber(game.rootZoom, 100, 0.4);
}
if (player.isJumping) {
player.velY = player.velY + game.gravity;
player.posY = 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 = player.posY + 0.1;
}
player.velY = 0;
}
}
if (player.velY >= 0) {
player.velY = 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(10);
player.velX = player.velX * -1;
} else {
player.clip.mc.gotoAndPlay("fall");
}
}
if (player.isKnockdowned) {
checkBarrelsToDestroy(player);
}
if (theWorld.backgroundNearLayer.currentLevel.deathpits.hitTest(player.posX + camPos.difX, player.posY + camPos.difY, true)) {
updateHPRage(-999, -999);
player.velY = 1;
player.velX = 0;
player.uncontrollable = true;
if (!demoOver) {
interfaceLayer.ratioFix.gotoAndStop("game_over");
}
if (player.clip._alpha != 0) {
player.clip._alpha = 0;
addSound(("gib_0" + Math.round((Math.random() * 1) + 1)) + ".wav", 100, 0, 0);
addBloodstain(player.posX, player.posY);
addEffect("blood_gib_01", player.posX, player.posY, 0, 3, 1);
addPart("gib_part_human_", 3, player.posX, player.posY, 0, 0, true, false, 8, 5);
}
} else if (theWorld.backgroundNearLayer.currentLevel.deathgaps.hitTest(player.posX + camPos.difX, player.posY + camPos.difY, true)) {
game.lockCam = true;
player.velX = 0;
if (!demoOver) {
interfaceLayer.ratioFix.gotoAndStop("game_over");
}
} else if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX, player.posY + camPos.difY, true)) {
player.isJumping = false;
player.isPreparingJump = false;
player.isFalling = false;
player.jumpAttackPerformed = false;
setCameraShake(5, Math.sqrt(player.velY * player.velY) / 10);
while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX, player.posY + camPos.difY, true)) {
player.posY = player.posY - 1;
}
player.posY = player.posY + 1;
while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX, player.posY + camPos.difY, true)) {
player.posY = player.posY - 0.1;
}
if (player.isKnockdowned) {
addEffect_knockdownSmoke(player);
player.knockdownTimer = player.knockdownTimer + (player.velY / 4);
if (player.knockdownTimer <= 0) {
player.knockdownTimer = 1;
}
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 _local1 = 0;
while ((_local1 <= (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 = player.posY + 0.1;
_local1 = _local1 + 1;
}
if (_local1 >= (yCheckAxis * 10)) {
player.posY = player.posY - yCheckAxis;
player.clip.gotoAndStop("jump");
player.clip.mc.gotoAndPlay("fall");
player.velY = 0;
player.isPreparingJump = true;
player.isJumping = true;
player.velX = player.velX / 2;
}
_local1 = 0;
while ((_local1 <= (yCheckAxis * 10)) and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX, player.posY + camPos.difY, true)) {
player.posY = player.posY - 0.1;
_local1 = _local1 + 1;
}
if (_local1 >= (yCheckAxis * 10)) {
player.posY = player.posY + yCheckAxis;
}
}
if (!game.lockCam) {
if (Math.sqrt((player.posY - _local2) * (player.posY - _local2)) >= 1) {
player.clip._y = player.posY;
camPos.difY = camPos.difY - (player.posY - _local2);
camPos.virDifY = camPos.virDifY - (player.posY - _local2);
} else {
player.posY = _local2;
}
}
}
function checkBarrelsToDestroy(ob) {
if (ob.velY > 0) {
var _local1 = 1;
while (_local1 <= circleCounter) {
if (Math.sqrt(((myObject["circle" + _local1].posX - ob.posX) * (myObject["circle" + _local1].posX - ob.posX)) + (((myObject["circle" + _local1].posY - myObject["circle" + _local1].radius) - (ob.posY + 15)) * ((myObject["circle" + _local1].posY - myObject["circle" + _local1].radius) - (ob.posY + 15)))) < 30) {
myObject["circle" + _local1].life = myObject["circle" + _local1].life - myObject["circle" + _local1].life;
damageOb(myObject["circle" + _local1], 10);
}
_local1++;
}
}
}
function endAttack() {
if (player.performNextAttack) {
player.currentAttack = player.currentAttack + 1;
if (player.currentAttack > 3) {
player.currentAttack = 0;
} else {
if (Key.isDown(39) or Key.isDown(68)) {
player.dirX = 1;
} else if (Key.isDown(37) or Key.isDown(65)) {
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();
}
}
}
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 = player.stunTimer + time;
if (player.stunTimer <= 0) {
player.stunTimer = 1;
}
}
}
}
function startStaggerPlayer(time) {
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 = player.staggerTimer + Math.floor(time / 2);
}
player.stunTimer = 0;
player.parryTimer = 0;
player.isStunned = false;
player.velX = player.dirX * -1;
setuncontrollable();
if (player.isJumping) {
startKnockdownPlayer(8);
} else {
player.clip.gotoAndStop("eff_stagger");
player.isPreparingJump = false;
}
} else {
player.knockdownTimer = player.knockdownTimer + 2;
if (player.knockdownTimer <= 0) {
player.knockdownTimer = 1;
}
}
}
}
function startKnockdownPlayer(time) {
dropDaBarrelNow();
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 = player.knockdownTimer + Math.floor(time / 2);
if (player.knockdownTimer <= 0) {
player.knockdownTimer = 1;
}
}
}
}
function checkTimerEffects() {
if (player.holdingEnemy > 0) {
game.rootZoom = countToNumber(game.rootZoom, 135, 2);
player.holdingEnemyTimer = 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.finishingEnemy > 0) {
game.rootZoom = countToNumber(game.rootZoom, 108, 1.2);
}
if (player.contesting > 0) {
showTutorial(7);
game.rootZoom = countToNumber(game.rootZoom, 140, 1.4);
setCameraShake(2, 2);
player.contestingTimer = 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)) {
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 = 48;
} else if (player.contestingPower < 0) {
setCameraShake(5, 10);
game.rootZoom = game.rootZoom + 10;
startStunPlayer(40);
setuncontrollable();
} else {
myObject["enemy" + player.contesting].currAttack = "eff_stagger";
myObject["enemy" + player.contesting].staggerTimer = 24;
startStaggerPlayer(24);
setuncontrollable();
}
player.contesting = 0;
}
}
if (player.parryTimer > 0) {
player.parryTimer = 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 = 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 = 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 = player.staggerTimer - 1;
game.rootZoom = countToNumber(game.rootZoom, 103, 1.5);
if (player.staggerTimer <= 0) {
player.uncontrollable = false;
player.velX = 0;
}
}
}
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 _local2 = player.posX;
var _local3 = player.posY;
player.posX = myPoint._x;
player.posY = myPoint._y;
var _local1 = 0;
while ((_local1 <= 5000) and (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(player.posX + camPos.difX, player.posY + camPos.difY, true))) {
player.posY = player.posY + 0.1;
_local1 = _local1 + 1;
}
if (_local1 >= 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 = camPos.difX - (player.posX - _local2);
camPos.difY = camPos.difY - (player.posY - _local3);
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 _local3 = 0;
var _local2 = 1;
while (_local2 <= _root[myCounter]) {
if ((!myObject[(type + "") + _local2].inGame) and (_local3 == 0)) {
_local3 = _local2;
}
_local2++;
}
var _local6 = 0;
if (_local3 == 0) {
_root[myCounter] = _root[myCounter] + 1;
_local6 = _root[myCounter];
} else {
_local6 = _local3;
delete myObject[(type + "") + _local6];
}
return(_local6);
}
function findString(startString, inString, endString) {
var _local1 = inString.indexOf(startString, 0);
var _local4 = inString.indexOf(endString, _local1 + startString.length);
var _local3 = "0";
if ((_local1 >= 0) and (_local4 >= 0)) {
_local3 = inString.substr(_local1 + startString.length, (_local4 - _local1) - startString.length);
} else if (startString != "/waveID-") {
}
return(_local3);
}
function spawnEnemy(myPoint, enemyAI, dirX, scriptEvent) {
var _local2 = getAI(enemyAI);
var _local1 = findEmptyObject("enemy", "enemyCounter");
myObject["enemy" + _local1] = new myObject.emptyEnemy();
if (enemyAI == "CROW_1") {
theWorld.crowLayer.attachMovie(findString("/type-", _local2, "/"), ["enemy" + _local1], _local1);
myObject["enemy" + _local1].clip = theWorld.crowLayer["enemy" + _local1];
} else {
theWorld.actorsLayer.attachMovie(findString("/type-", _local2, "/"), ["enemy" + _local1], _local1);
myObject["enemy" + _local1].clip = theWorld.actorsLayer["enemy" + _local1];
}
myObject["enemy" + _local1].clip._x = myPoint._x;
myObject["enemy" + _local1].clip._y = myPoint._y;
myObject["enemy" + _local1].dirX = dirX;
myObject["enemy" + _local1].posX = myPoint._x;
myObject["enemy" + _local1].posY = myPoint._y;
myObject["enemy" + _local1].clip._xscale = 100 * myObject["enemy" + _local1].dirX;
myObject["enemy" + _local1].clip.gotoAndStop(1);
myObject["enemy" + _local1].AIType = findString("/AI-", _local2, "/");
myObject["enemy" + _local1].life = parseInt(findString("/HP-", _local2, "/"));
myObject["enemy" + _local1].barrelImmune = parseInt(findString("/barrelImmune-", _local2, "/"));
myObject["enemy" + _local1].bloodType = findString("/bloodType-", _local2, "/");
myObject["enemy" + _local1].bloodStain = parseInt(findString("/bloodStain-", _local2, "/"));
myObject["enemy" + _local1].enemyValues = _local2;
myObject["enemy" + _local1].ID = _local1;
addShadow(myObject["enemy" + _local1]);
moveShadow(myObject["enemy" + _local1]);
if (parseInt(findString("/groundSpawn-", _local2, "/")) == 1) {
myObject["enemy" + _local1].posY = myObject["enemy" + _local1].shadowClip._y;
} else {
myObject["enemy" + _local1].posY = myPoint._y;
}
myObject["enemy" + _local1].clip._y = myObject["enemy" + _local1].posY;
myObject["enemy" + _local1].HB_width = myObject["enemy" + _local1].clip.hitBox._width / 2;
myObject["enemy" + _local1].HB_height = myObject["enemy" + _local1].clip.hitBox._height / 2;
myObject["enemy" + _local1].HB_posY = myObject["enemy" + _local1].clip.hitBox._y;
var _local3 = findString("/waveID-", scriptEvent, "/");
myObject["enemy" + _local1].waveID = _local3;
if ((_local3 != "0") and (_local3 != gameEvent.waveID)) {
gameEvent.waveID = _local3;
gameEvent.nrLeftInWave = 1;
gameEvent.onDeathRunScript = findString("/onDeathRunScript-", scriptEvent, "/");
} else if (_local3 == gameEvent.waveID) {
gameEvent.nrLeftInWave = gameEvent.nrLeftInWave + 1;
}
textMessage(" ");
}
function spawnFoodCrate(PosX, PosY, FoodType) {
foodCrateCounter = 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 = 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 _local1 = 1;
while (_local1 <= enemyCounter) {
if ((myObject["enemy" + _local1].inGame and (myObject["enemy" + _local1].life > 0)) and (myObject["enemy" + _local1].barrelImmune != 1)) {
var _local5 = Math.sqrt((myObject["enemy" + _local1].posX - PosX) * (myObject["enemy" + _local1].posX - PosX));
var _local8 = Math.sqrt((myObject["enemy" + _local1].posY - PosY) * (myObject["enemy" + _local1].posY - PosY));
if (_local8 <= 80) {
if ((_local5 <= 110) and (player.holdingEnemy == _local1)) {
myObject["enemy" + player.holdingEnemy].knockdownTimer = 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 (_local5 <= 50) {
gibEnemyYey(myObject["enemy" + _local1]);
} else if (((_local5 <= 80) and (myObject["enemy" + _local1].knockdownTimer <= 0)) and (myObject["enemy" + _local1].canDropHead or myObject["enemy" + _local1].canDropArm)) {
if (myObject["enemy" + _local1].canDropHead) {
myObject["enemy" + _local1].staggerTimer = 0;
decapitateEnemy(myObject["enemy" + _local1], 1);
} else {
cutArmEnemy(myObject["enemy" + i]);
}
} else if (_local5 <= 110) {
myObject["enemy" + _local1].velX = 0;
myObject["enemy" + _local1].velY = 0;
var _local9 = ((myObject["enemy" + _local1].posX - PosX) / Math.sqrt((myObject["enemy" + _local1].posX - PosX) * (myObject["enemy" + _local1].posX - PosX))) * 8;
startFlyingEnemy(myObject["enemy" + _local1], _local9, -6);
}
}
}
_local1++;
}
var i = 1;
while (i <= arrowCounter) {
if (myObject["arrow" + i].inGame) {
var _local6 = Math.sqrt(((myObject["arrow" + i].posX - PosX) * (myObject["arrow" + i].posX - PosX)) + ((myObject["arrow" + i].posY - PosY) * (myObject["arrow" + i].posY - PosY)));
if (_local6 <= 100) {
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) {
var _local6 = Math.sqrt(((myObject["circle" + i].posX - PosX) * (myObject["circle" + i].posX - PosX)) + ((myObject["circle" + i].posY - (PosY + 20)) * (myObject["circle" + i].posY - (PosY + 20))));
if ((_local6 <= 80) and (i == player.isCarringBarrel)) {
player.isHoldingBarrel = false;
player.isThrowingBarrel = false;
player.isCarringBarrel = 0;
player.clip.gotoAndStop("idle");
}
if (_local6 <= 40) {
damageOb(myObject["circle" + i], 9999);
} else if (_local6 <= 80) {
myObject["circle" + i].velX = 0;
myObject["circle" + i].velY = 0;
var _local9 = (myObject["circle" + i].posX - PosX) * 0.14;
myObject["circle" + i].inMove = true;
myObject["circle" + i].velY = -8;
myObject["circle" + i].velX = _local9;
}
}
i++;
}
var _local3 = 1;
while (_local3 <= partCounter) {
if (myObject["part" + _local3].inGame) {
var _local6 = Math.sqrt(((myObject["part" + _local3].posX - PosX) * (myObject["part" + _local3].posX - PosX)) + ((myObject["part" + _local3].posY - (PosY + 20)) * (myObject["part" + _local3].posY - (PosY + 20))));
if (_local6 <= 100) {
var _local9 = (myObject["part" + _local3].posX - PosX) * 0.1;
var _local7 = 1 - (_local6 / 100);
myObject["part" + _local3].velX = myObject["part" + _local3].velX + _local9;
myObject["part" + _local3].velY = myObject["part" + _local3].velY - ((6 * _local7) - 5);
}
}
_local3++;
}
var _local10 = Math.sqrt(((player.posX - PosX) * (player.posX - PosX)) + ((player.posY - PosY) * (player.posY - PosY)));
if (_local10 <= 100) {
player.dirX = (-(player.posX - PosX)) / Math.sqrt((player.posX - PosX) * (player.posX - PosX));
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(10);
player.posY = player.posY - 4;
camPos.difY = camPos.difY + 4;
camPos.virDifY = camPos.virDifY + 4;
player.clip._y = player.posY;
player.velY = -6 - (6 * ((101 - _local10) / 100));
player.velX = ((-player.dirX) * 6) * ((101 - _local10) / 100);
updateHPRage(-35 * ((101 - _local10) / 100), 0);
}
}
function checkGameEventOnDeath(ob) {
if (ob.waveID == gameEvent.waveID) {
gameEvent.nrLeftInWave = gameEvent.nrLeftInWave - 1;
if (gameEvent.nrLeftInWave <= 0) {
gameEvent.waveID = "none_0";
theWorld.backgroundNearLayer.currentLevel[gameEvent.onDeathRunScript]();
}
}
}
function addDeadEnemy(ob, deathType) {
if (ob.deathBody) {
deathObjects = deathObjects + 1;
theWorld.deadEnemiesLayer.attachMovie([findString("/type-", ob.enemyValues, "/") + "_Death"], ["deathObject_" + deathObjects], 9999 - deathObjects);
if (theWorld.deadEnemiesLayer["deathObject_" + deathObjects] == undefined) {
textMessage(("Error:GameFlow:deadEnemy:Clip '" + findString("/type-", ob.enemyValues, "/")) + "_Death' does not exist");
} else {
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;
}
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) {
var _local1 = findEmptyObject("circle", "circleCounter");
myObject["circle" + _local1] = new myObject.emptyCircle();
theWorld.objectsLayerBarrels.attachMovie("barrel", ["barrel" + _local1], _local1);
myObject["circle" + _local1].clip = theWorld.objectsLayerBarrels["barrel" + _local1];
myObject["circle" + _local1].clip._x = myPoint._x;
myObject["circle" + _local1].clip._y = myPoint._y - myObject["circle" + _local1].radius;
myObject["circle" + _local1].posX = myPoint._x;
myObject["circle" + _local1].posY = myPoint._y;
myObject["circle" + _local1].ID = _local1;
myObject["circle" + _local1].life = parseInt(findString("/HP-", barrelValues, "/"));
if (myObject["circle" + _local1].life > 50) {
myObject["circle" + _local1].life = 50;
}
myObject["circle" + _local1].explosive = parseInt(findString("/explosive-", barrelValues, "/"));
addShadow(myObject["circle" + _local1]);
moveShadow(myObject["circle" + _local1]);
myObject["circle" + _local1].clip._y = myObject["circle" + _local1].posY - myObject["circle" + _local1].radius;
myPoint._y = -9999;
myPoint._x = -9999;
}
function countToNumber(myNumber, toNumber, countNumber) {
if (myNumber > toNumber) {
myNumber = myNumber - countNumber;
if (myNumber < toNumber) {
myNumber = toNumber;
}
}
if (myNumber < toNumber) {
myNumber = myNumber + countNumber;
if (myNumber > toNumber) {
myNumber = toNumber;
}
}
return(myNumber);
}
function textMessage(myMessage) {
if ((myMessage != " ") or (myMessage != "")) {
}
}
function groundAI(ob) {
if (ob.currAttack == "finishing") {
ob.frameTimer = ob.frameTimer - 1;
if (ob.frameTimer <= 0) {
ob.clip.swapDepths(ob.oldDepth);
ob.life = -1;
if (ob.finishingType == "finishing_1") {
if (checkForLedge(ob, 130)) {
ob.staggerTimer = 999;
} else {
ob.staggerTimer = 40;
}
ob.velX = player.dirX * 3;
moveEnemyXAxis(ob);
enemyUncontrollable(ob);
} else if (ob.finishingType == "finishing_kd_1") {
enemyUncontrollable(ob);
damageEnemy(ob, 2, "finishing_kd_1");
ob.inGame = false;
}
}
return(true);
}
if (ob.isFalling) {
enemyUncontrollable(ob);
enemyFalling(ob);
return(true);
}
if (ob.knockdownTimer > 0) {
showTutorial(6);
enemyUncontrollable(ob);
enemyKnockdowned(ob);
return(true);
}
if (ob.stunTimer > 0) {
showTutorial(6);
enemyUncontrollable(ob);
enemyStun(ob);
return(true);
}
if (ob.staggerTimer > 0) {
enemyUncontrollable(ob);
enemyStagger(ob);
return(true);
}
return(false);
}
function aiSPEARMAN(ob) {
if (groundAI(ob)) {
} else if (ob.currAttack == "none") {
ob.headDropType = "head_spearorc";
ob.SpearDmg = parseInt(findString("/SpearDmg-", ob.enemyValues, "/"));
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 == "throw_barrel") {
ob.frameTimer = ob.frameTimer - 1;
ob.attackTimer = 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 _local3 = ob.dirX * parseInt(findString("/chargeSpeed-", ob.enemyValues, "/"));
ob.velX = countToNumber(ob.velX, _local3, 1);
moveEnemyXAxis(ob);
var _local5 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX));
var _local4 = Math.sqrt((ob.posY - player.posY) * (ob.posY - player.posY));
if (((((!ob.hurtPlayer) and (_local5 < 50)) and facingOb(ob, player)) and (_local4 < 30)) and (!player.immortal)) {
ob.hurtPlayer = true;
player.dirX = -ob.dirX;
startStaggerPlayer(Math.floor((Math.random() * 5) + 4));
updateHPRage(-ob.SpearDmg, ob.SpearDmg / 3);
addEffect_Blood(player.bloodType, player.posX, ob.posY - 30);
addSound(("hitFlesh_0" + Math.floor((Math.random() * 2) + 1)) + ".wav", 40, 0, 0);
}
if ((!facingOb(ob, player)) and (_local5 > 150)) {
ob.currAttack = "idle";
ob.clip.gotoAndStop("idle");
}
} else if (ob.currAttack == "charge_start") {
ob.hurtPlayer = false;
ob.frameTimer = 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);
if (player.isKnockdowned) {
ob.dirX = -ob.dirX;
ob.clip._xscale = ob.dirX * 100;
}
var _local3 = 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, _local3, 1);
moveEnemyXAxis(ob);
if (!player.isKnockdowned) {
var _local2 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX));
if (_local2 < parseInt(findString("/runDist-", ob.enemyValues, "/"))) {
ob.currAttack = "idle";
ob.clip.gotoAndStop("idle");
ob.velX = 0;
} else if (((((Math.random() * 100) <= 8) and (_local2 < 270)) and (_local2 > 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 = ob.frameTimer - 1;
ob.attackTimer = ob.attackTimer - 1;
if (ob.attackTimer == 0) {
if (facingOb(ob, player) and (!player.immorta)) {
var _local5 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX));
var _local4 = Math.sqrt((ob.posY - player.posY) * (ob.posY - player.posY));
if (((_local5 - 2) <= parseInt(findString("/runDist-", ob.enemyValues, "/"))) and (_local4 <= 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 _local2 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX));
if (ob.seenPlayer or (_local2 <= parseInt(findString("/reactDist-", ob.enemyValues, "/")))) {
ob.seenPlayer = true;
facePlayer(ob);
if (_local2 > 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 _local4 = Math.sqrt((ob.posY - player.posY) * (ob.posY - player.posY));
if (_local4 < 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.currAttack != "spawning") {
ob.immortal = false;
ob.barrelImmune = false;
}
if (ob.isFalling) {
enemyUncontrollable(ob);
enemyFalling(ob);
} else if (ob.life <= 0) {
ob.delayFinishingTimer = ob.delayFinishingTimer - 1;
if (ob.delayFinishingTimer <= 0) {
addDeadEnemy(ob, "death_01");
addSound(("skeleton_break_apart_0" + Math.round((Math.random() * 1) + 1)) + ".wav", 70, 0, 0);
addPart("gib_part_skel_", 3, ob.posX, ob.posY + ob.HB_posY, player.dirX * 4, -3, false, false, 12, 5);
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 = ob.frameTimer - 1;
ob.attackTimer = 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.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.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);
} else if (ob.currAttack == "spawning") {
ob.frameTimer = ob.frameTimer - 1;
if (ob.frameTimer <= 0) {
ob.immortal = false;
ob.barrelImmune = false;
ob.clip.gotoAndStop("idle");
ob.currAttack = "idle";
}
} else if (ob.currAttack == "idle") {
var _local4 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX));
if (ob.seenPlayer or (_local4 <= parseInt(findString("/reactDist-", ob.enemyValues, "/")))) {
ob.seenPlayer = true;
facePlayer(ob);
if (_local4 > 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 _local3 = Math.sqrt((ob.posY - player.posY) * (ob.posY - player.posY));
if (_local3 < 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 _local2 = 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, _local2, 1);
moveEnemyXAxis(ob);
var _local4 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX));
if (_local4 < parseInt(findString("/runDist-", ob.enemyValues, "/"))) {
ob.currAttack = "idle";
ob.clip.gotoAndStop("idle");
ob.velX = 0;
}
} else if (ob.currAttack == "attack_1") {
ob.frameTimer = 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 = 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 = 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 = 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 == "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 = 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 = ob.posY - 20;
ob.clip._y = ob.posY;
ob.currAttack = "WaitForFalling";
} else if (ob.currAttack == "start_falling") {
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") {
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 = 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 = 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 = ob.delayFinishingTimer - 1;
if (ob.delayFinishingTimer <= 0) {
if (ob.finishingType == "finishing_1") {
ob.currAttack = "death_stagger";
} else {
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 = 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 _local4 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX));
if (ob.seenPlayer or (_local4 <= parseInt(findString("/reactDist-", ob.enemyValues, "/")))) {
ob.seenPlayer = true;
facePlayer(ob);
if (_local4 > 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 _local3 = Math.sqrt((ob.posY - player.posY) * (ob.posY - player.posY));
if (_local3 < 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 _local2 = 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, _local2, 1);
moveEnemyXAxis(ob);
var _local4 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX));
if (_local4 < 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 = ob.frameTimer - 1;
ob.attackTimer = 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 = 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 = 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 = 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.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 = 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 = ob.posY - 20;
ob.clip._y = ob.posY;
ob.currAttack = "WaitForFalling";
} else if (ob.currAttack == "start_falling") {
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") {
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 = 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 = 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 = ob.delayFinishingTimer - 1;
if (ob.delayFinishingTimer <= 0) {
if (ob.finishingType == "finishing_1") {
ob.currAttack = "death_stagger";
} else {
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 = 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 _local4 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX));
if (ob.seenPlayer or (_local4 <= parseInt(findString("/reactDist-", ob.enemyValues, "/")))) {
ob.seenPlayer = true;
facePlayer(ob);
if (_local4 > 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 _local3 = Math.sqrt((ob.posY - player.posY) * (ob.posY - player.posY));
if (_local3 < 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 _local2 = 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, _local2, 1);
moveEnemyXAxis(ob);
var _local4 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX));
if (_local4 < 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 = ob.frameTimer - 1;
ob.attackTimer = 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 = 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 = 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 = ob.frameTimer - 1;
ob.attackTimer = 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 = 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 _local3 = 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, _local3, 1);
moveEnemyXAxis(ob);
var _local2 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX));
if (_local2 < parseInt(findString("/runDist-", ob.enemyValues, "/"))) {
ob.currAttack = "idle";
ob.clip.gotoAndStop("idle");
ob.velX = 0;
}
} else if (ob.currAttack == "attack_1") {
ob.frameTimer = 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 = 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 = 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") {
var _local2 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX));
if (ob.seenPlayer or (_local2 <= parseInt(findString("/reactDist-", ob.enemyValues, "/")))) {
ob.seenPlayer = true;
facePlayer(ob);
if (_local2 > 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 _local4 = Math.sqrt((ob.posY - player.posY) * (ob.posY - player.posY));
if (_local4 < 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 == "none") {
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.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 > camPos.maxX) or (ob.posX < camPos.minX)) {
ob.currAttack = "moveInsideScreen";
} else {
if (player.posX < ob.posX) {
ob.dirX = -1;
} else {
ob.dirX = 1;
}
ob.clip._xscale = 100 * ob.dirX;
var _local4 = Math.sqrt((player.posX - ob.posX) * (player.posX - ob.posX));
if (_local4 < parseInt(findString("/attRange-", ob.enemyValues, "/"))) {
if (((Math.random() * 100) <= 6) or (_local4 < 80)) {
_local4 = Math.sqrt((player.posX - ob.posX) * (player.posX - ob.posX));
var _local5 = 700 - _local4;
var _local8 = ((ob.posX - player.posX) / 700) * 100;
addSound("bow_drawBack.wav", (_local5 / 700) * 80, _local8, 0);
ob.clip.gotoAndStop("attack");
ob.frameTimer = ob.clip.mc._totalFrames;
ob.currAttack = "att_1";
}
}
}
} else if (ob.currAttack == "throw_barrel") {
knockbackBarrels(ob);
ob.currAttack = "idle";
ob.clip.gotoAndStop("idle");
} else if (ob.currAttack == "att_1") {
ob.frameTimer = ob.frameTimer - 1;
if (ob.frameTimer <= 0) {
var _local7 = Math.sqrt((player.posY - ob.posY) * (player.posY - ob.posY));
var _local4 = Math.sqrt((player.posX - ob.posX) * (player.posX - ob.posX));
var _local9 = _local4 - _local7;
var _local3 = (ob.posX - player.posX) / Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX));
var _local2 = (_local9 - ((_local3 * player.velX) * 5)) / 31;
if (_local9 < 150) {
_local2 = ((_local9 - ((_local3 * player.velX) * 10)) + 10) / 19;
} else if (_local9 < 250) {
_local2 = (((_local9 - ((_local3 * player.velX) * 10)) + 10) / 21) * 0.9;
} else if (_local9 < 400) {
_local2 = ((_local9 - ((_local3 * player.velX) * 10)) - 50) / 20;
}
_local2 = _local2 + (((Math.random() * _local2) - (_local2 / 2)) * 0.4);
if (_local2 < 4) {
_local2 = 4;
}
var _local5 = 800 - _local4;
releaseArrow(ob.posX, ob.posY - 30, 55 * ob.dirX, _local2);
ob.clip.gotoAndStop("attack_release");
var _local8 = ((ob.posX - player.posX) / 700) * 100;
addSound("swing_s_03.wav", (_local5 / 800) * 50, _local8, 0);
ob.frameTimer = ob.clip.mc._totalFrames;
ob.currAttack = "att_2";
}
} else if (ob.currAttack == "att_2") {
ob.frameTimer = 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 _local6 = parseInt(findString("/speed-", ob.enemyValues, "/"));
ob.velX = ob.dirX * _local6;
moveEnemyXAxis(ob);
var _local9 = Math.sqrt((ob.posX - player.posX) * (ob.posX - player.posX));
if (((ob.posX + 30) < camPos.maxX) and ((ob.posX - 30) > camPos.minX)) {
ob.currAttack = "idle";
ob.clip.gotoAndStop("idle");
ob.velX = 0;
}
} else if (ob.currAttack == "jump") {
enemyJumping(ob);
}
}
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 - 300;
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.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 _local7 = 1;
while (theWorld.backgroundNearLayer.currentLevel["CS_" + _local7]._x != undefined) {
_local7 = _local7 + 1;
}
ob.CS_max = _local7 - 1;
ob.clip.gotoAndStop("soar");
ob.currAttack = "followPlayer_init";
} else if (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 = 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 _local9 = ob.dirX * ob.speed;
if (ob.velX < _local9) {
ob.velX = ob.velX + 0.5;
} else if (ob.velX > _local9) {
ob.velX = ob.velX - 0.5;
}
var _local11 = ob.dirY * ob.speed;
if (ob.velY < _local11) {
ob.velY = ob.velY + 0.2;
} else if (ob.velY > _local11) {
ob.velY = ob.velY - 0.5;
}
ob.posX = ob.posX + ob.velX;
ob.posY = ob.posY + ob.velY;
while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) {
ob.posY = ob.posY - 1;
}
ob.clip._x = ob.posX;
ob.clip._y = ob.posY;
ob.flyTimer = 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 _local6 = false;
var _local3 = 0;
var _local4 = 0;
if (deathObjects > 0) {
var _local5 = 1;
while (_local5 <= 50) {
if (!_local6) {
ob.CS = Math.round((Math.random() * (deathObjects - 1)) + 1);
_local3 = theWorld.deadEnemiesLayer["deathObject_" + ob.CS]._x;
_local4 = Math.sqrt((player.posX - _local3) * (player.posX - _local3));
if ((_local4 <= 400) and (_local4 > 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;
_local6 = true;
_local5 = 50;
}
}
_local5++;
}
}
if (!_local6) {
var _local5 = 1;
while (_local5 <= 30) {
if (!_local6) {
ob.CS = Math.round((Math.random() * (ob.CS_max - 1)) + 1);
_local3 = theWorld.backgroundNearLayer.currentLevel["CS_" + ob.CS]._x;
_local4 = Math.sqrt((player.posX - _local3) * (player.posX - _local3));
if ((_local4 <= 340) and (_local4 > 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;
_local6 = true;
_local5 = 30;
}
}
_local5++;
}
}
}
}
}
} 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 _local9 = ob.dirX * ob.speed;
if (ob.velX < _local9) {
ob.velX = ob.velX + 0.2;
} else if (ob.velX > _local9) {
ob.velX = ob.velX - 0.2;
}
var _local11 = ob.dirY * ob.speed;
if (ob.velY < _local11) {
ob.velY = ob.velY + 0.2;
} else if (ob.velY > _local11) {
ob.velY = 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.posX + ob.velX;
ob.posY = ob.posY + ob.velY;
ob.clip._x = ob.posX;
ob.clip._y = ob.posY;
var _local12 = Math.sqrt((ob.CS_posX - ob.posX) * (ob.CS_posX - ob.posX));
var _local8 = Math.sqrt((ob.CS_posY - ob.posY) * (ob.CS_posY - ob.posY));
if (Math.sqrt((_local12 * _local12) + (_local8 * _local8)) <= 100) {
ob.speed = Math.sqrt((_local12 * _local12) + (_local8 * _local8)) / 20;
if (ob.speed < 1) {
ob.speed = 1;
}
}
ob.flyTimer = ob.flyTimer - 1;
if (ob.flyTimer <= 0) {
ob.currAttack = "flyToCS_init";
}
if ((_local12 <= (7 + ((Math.random() * 30) / 10))) and (_local8 <= 3)) {
ob.velY = -3;
ob.clip._rotation = 0;
ob.clip.gotoAndStop("flap");
ob.currAttack = "landing";
}
_local12 = Math.sqrt((player.posX - ob.posX) * (player.posX - ob.posX));
if (_local12 > 340) {
ob.currAttack = "followPlayer_init";
}
} else if (ob.currAttack == "landing") {
ob.velY = ob.velY + game.gravity;
ob.posY = 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 = ob.flyTimer + 1;
var _local10 = Math.sqrt(((player.posX - ob.posX) * (player.posX - ob.posX)) + ((player.posY - ob.posY) * (player.posY - ob.posY)));
if (((ob.flyTimer > 24) and (_local10 <= 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 (_local10 > 450) {
ob.currAttack = "followPlayer_init";
}
} else if (ob.currAttack == "liftoff") {
if (ob.velY > -6) {
ob.velY = ob.velY - 0.3;
}
ob.posX = ob.posX + ob.velX;
ob.posY = ob.posY + ob.velY;
ob.clip._x = ob.posX;
ob.clip._y = ob.posY;
ob.clip._rotation = ob.dirX * 14;
ob.flyTimer = 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 _local2 = 1;
while (_local2 <= enemyCounter) {
if (myObject["enemy" + _local2].inGame) {
if (myObject["enemy" + _local2].blurTimer > 0) {
myObject["enemy" + _local2].blurTimer = myObject["enemy" + _local2].blurTimer - 1;
if (myObject["enemy" + _local2].blurTimer <= 0) {
myObject["enemy" + _local2].clip.filters = null;
}
}
_root["ai" + myObject["enemy" + _local2].AIType](myObject["enemy" + _local2]);
checkObInGame(myObject["enemy" + _local2]);
} else if (_local2 == enemyCounter) {
enemyCounter = enemyCounter - 1;
}
_local2++;
}
}
if (player.hitSound) {
addSound(("hitFlesh_0" + Math.floor((Math.random() * 2) + 1)) + ".wav", 40, 0, 0);
}
}
function setEnemyPlayerPos(ob) {
var _local2 = (player.posX + (player.clip.enemy._x * player.dirX)) - ob.posX;
ob.velX = _local2;
if (_local2 != 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));
ob.clip._xscale = 100 * ob.dirX;
}
function aiCleaveBarrels(ob, range, damage) {
if (circleCounter > 0) {
var _local1 = 1;
while (_local1 <= circleCounter) {
if (myObject["circle" + _local1].inGame) {
var _local4 = Math.sqrt((myObject["circle" + _local1].posX - ob.posX) * (myObject["circle" + _local1].posX - ob.posX));
var _local3 = Math.sqrt((myObject["circle" + _local1].posY - (ob.posY - (ob.attackRangeY / 2))) * (myObject["circle" + _local1].posY - (ob.posY - (ob.attackRangeY / 2))));
if (((_local3 <= 15) and (_local4 <= 60)) and (ob.dirX == ((myObject["circle" + _local1].posX - ob.posX) / Math.sqrt((myObject["circle" + _local1].posX - ob.posX) * (myObject["circle" + _local1].posX - ob.posX))))) {
myObject["circle" + _local1].inMove = true;
myObject["circle" + _local1].velX = myObject["circle" + _local1].velX + ((ob.dirX * damage) / 10);
addEffect("matchwood", myObject["circle" + _local1].posX, myObject["circle" + _local1].posY - 20, 0, 0, 1);
damageOb(myObject["circle" + _local1], damage);
}
}
_local1++;
}
}
}
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);
}
return(true);
}
function knockbackBarrels(ob) {
var _local1 = 1;
while (_local1 <= circleCounter) {
if (Math.sqrt(((myObject["circle" + _local1].posX - ob.posX) * (myObject["circle" + _local1].posX - ob.posX)) + ((myObject["circle" + _local1].posY - ob.posY) * (myObject["circle" + _local1].posY - ob.posY))) < 50) {
if (((ob.posX < myObject["circle" + _local1].posX) and (ob.velX > 0)) or ((ob.posX > myObject["circle" + _local1].posX) and (ob.velX < 0))) {
myObject["circle" + _local1].velY = -6;
myObject["circle" + _local1].velX = ob.dirX * 7;
myObject["circle" + _local1].inMove = true;
addSound("wood_crate_impact_hard2.wav", 25, 0, 0);
}
}
_local1++;
}
}
function cleavePlayer(ob, range, damage, blockable) {
if (!player.immortal) {
var _local4 = Math.sqrt((player.posX - ob.posX) * (player.posX - ob.posX));
var _local2 = Math.sqrt((player.posY - ob.posY) * (player.posY - ob.posY));
if (((_local2 <= ob.attackRangeY) and (_local4 <= range)) and facingOb(ob, player)) {
if (((blockable and (player.velX == 0)) and checkIdlePlayer()) and facingOb(player, ob)) {
if (player.holdingEnemy > 0) {
myObject["enemy" + player.holdingEnemy].life = myObject["enemy" + player.holdingEnemy].life - damage;
addEffect_Blood(myObject["enemy" + player.holdingEnemy].bloodType, myObject["enemy" + player.holdingEnemy].posX, myObject["enemy" + player.holdingEnemy].posY);
dropEnemy(0, 0);
} else if (_local2 < 10) {
startParryPlayer();
ob.attacksPlayerParried = ob.attacksPlayerParried + 1;
} else {
cleavingPlayer(ob, damage);
}
} else {
cleavingPlayer(ob, damage);
}
}
}
}
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, ob.posY - 30);
startStaggerPlayer(damage);
updateHPRage(-damage, damage);
}
}
function startFlyingEnemy(ob, velX, velY) {
trace("Start Falling");
if ((!ob.isFalling) and (ob.currAttack != "finishing")) {
ob.velX = ob.velX + velX;
ob.velY = 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 = ob.posY - 20;
ob.clip._y = ob.posY;
if ((ob.enemyType == "ChaosKnight2") or (ob.enemyType == "ChaosKnight")) {
trace("CK Start Falling");
ob.currAttack = "start_falling";
}
}
}
function checkAttack(ob, range, damage, blockable) {
ob.attackTimer = 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 = ob.blocksPerformed + 1;
addEffect_sparks(ob);
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 = ob.stunTimer - 1;
if (ob.velX > 2) {
ob.velX = ob.velX - 2;
moveEnemyXAxis(ob);
} else if (ob.velX < -2) {
ob.velX = ob.velX + 2;
moveEnemyXAxis(ob);
} else {
ob.velX = 0;
}
if (ob.stunTimer <= 0) {
ob.currAttack = "idle";
ob.clip.gotoAndStop("idle");
}
}
function enemyStagger(ob) {
ob.staggerTimer = 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 = 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 = 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 = ob.knockdownTimer - 1;
if (ob.knockdownTimer <= 0) {
ob.currAttack = "idle";
ob.clip.gotoAndStop("idle");
}
}
function enemyUncontrollable(ob) {
ob.attackTimer = 0;
ob.currAttack = "uncontrollable";
}
function enemyJumping(ob) {
ob.velY = ob.velY + game.gravity;
ob.posX = 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.posX - ob.dirX;
}
}
ob.posY = 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 = 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 = 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) {
addEffect_jumpSmoke(ob);
ob.currAttack = "jump";
ob.clip.gotoAndStop("jump");
ob.velX = xPow;
ob.velY = yPow;
}
function checkJump(ob) {
if (ob.currAttack != "uncontrollable") {
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 _local1 = 1;
while (_local1 <= enemyCounter) {
if (((((!myObject["enemy" + _local1].finishingDone) and (myObject["enemy" + _local1].knockdownTimer <= 0)) and (!myObject["enemy" + _local1].isFalling)) and myObject["enemy" + _local1].inGame) and (ob.ID != _local1)) {
var _local3 = -30;
if (Math.sqrt(((myObject["enemy" + _local1].posX - ob.posX) * (myObject["enemy" + _local1].posX - ob.posX)) + (((myObject["enemy" + _local1].posY + _local3) - ob.posY) * ((myObject["enemy" + _local1].posY + _local3) - ob.posY))) < 30) {
myObject["enemy" + _local1].velY = 0;
myObject["enemy" + _local1].velX = 0;
startFlyingEnemy(myObject["enemy" + _local1], 0, 0);
}
}
_local1++;
}
}
}
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 = 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.velX - ob.dirX;
}
ob.bloodTimer_stagger_death = 7;
}
} else {
ob.clip.gotoAndStop("death_knockdown");
ob.bloodTimer_stagger_death = 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.velX - ob.dirX;
}
ob.bloodTimer_stagger_death = 7;
}
}
ob.clip._rotation = ob.clip._rotation - (ob.dirX * 20);
ob.velY = ob.velY + game.gravity;
if (ob.velY >= 0) {
ob.velY = ob.velY + ((100 - ob.velY) / 100);
}
checkBarrelsToDestroy(ob);
checkEnemiesToKnockdown(ob);
ob.posY = ob.posY + ob.velY;
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 = ob.posY - 0.1;
}
ob.isFalling = false;
ob.clip._rotation = 0;
ob.knockdownTimer = ob.knockdownTimer + 24;
ob.knockdownTimer = ob.knockdownTimer + (ob.staggerTimer + ob.stunTimer);
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 <= 2)) {
ob.currAttack = "death_landed";
ob.life = 0;
} else {
ob.life = ob.life - 2;
if (ob.life <= 0) {
if (ob.armDropped) {
addDeadEnemy(ob, "death_land_armless");
} else {
addDeadEnemy(ob, "death_land");
}
}
}
} else {
ob.posX = ob.posX + ob.velX;
var _local2 = ob.velX / Math.sqrt(ob.velX * ob.velX);
if (_local2 == 0) {
textMessage(("Error:GameFlow:xMovement:invalid for enemy (" + _local2) + ")");
_local2 = ob.dirX;
if (_local2 == 0) {
textMessage(("Error:GameFlow:xMovement_secondLayer:invalid for enemy (" + _local2) + ")");
_local2 = 1;
ob.dirX = 1;
}
}
if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((ob.posX + camPos.difX) + (_local2 * 10), (ob.posY - 5) + camPos.difY, true)) {
ob.posX = ob.posX - ob.velX;
ob.velX = ob.velX * -0.2;
}
}
ob.clip._y = ob.posY;
ob.clip._x = ob.posX;
moveShadow(ob);
checkDeathPit(ob);
}
function gibEnemyYey(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, 0, -5, false, false, 6, 5);
addEffect("skel_blood", ob.posX, ob.posY, 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, 0, -5, true, false, 6, 5);
addEffect("chaos_deathblood", ob.posX, ob.posY, 0, 3, 1);
} else {
addSound(("gib_0" + Math.round((Math.random() * 1) + 1)) + ".wav", 100, 0, 0);
addPart(findString("/gibPart-", ob.enemyValues, "/"), 3, ob.posX, ob.posY, 0, -5, true, false, 6, 5);
addBloodstain(ob.posX, ob.posY);
addEffect("blood_gib_01", ob.posX, ob.posY, 0, 3, 1);
}
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 _local2 = 0;
var _local3 = ob.posY;
if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) {
while ((_local2 <= yCheckAxis) and theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) {
_local2 = _local2 + 1;
ob.posY = ob.posY - 1;
}
} else {
while ((_local2 <= yCheckAxis) and (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true))) {
_local2 = _local2 + 1;
ob.posY = ob.posY + 1;
}
ob.posY = ob.posY - 1;
}
if (_local2 <= yCheckAxis) {
ob.posY = ob.posY - 0.5;
while (!theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest(ob.posX + camPos.difX, ob.posY + camPos.difY, true)) {
ob.posY = ob.posY + 0.1;
}
} else if (ob.currAttack != "finishing") {
ob.posY = _local3;
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")) {
ob.velX = 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.posX + ob.velX;
var _local2 = ob.velX / Math.sqrt(ob.velX * ob.velX);
if (_local2 == 0) {
textMessage(("Error:GameFlow:xMovement:invalid for enemy (" + _local2) + ")");
_local2 = ob.dirX;
ob.velX = 1;
if (_local2 == 0) {
textMessage(("Error:GameFlow:xMovement_secondLayer:invalid for enemy (" + _local2) + ")");
_local2 = 1;
ob.dirX = 1;
}
}
if (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((ob.posX + camPos.difX) + (_local2 * 15), (ob.posY + camPos.difY) - 30, true)) {
while (theWorld.backgroundNearLayer.currentLevel.groundCollision.hitTest((ob.posX + camPos.difX) + (_local2 * 15), (ob.posY + camPos.difY) - 30, true)) {
ob.posX = ob.posX - _local2;
}
}
ob.clip._x = ob.posX;
moveEnemyYAxis(ob);
}
checkJump(ob);
}
function releaseArrow(posX, posY, angle, power) {
var _local1 = findEmptyObject("arrow", "arrowCounter");
myObject["arrow" + _local1] = new myObject.emptyArrow();
theWorld.objectsLayerArrows.attachMovie("arrow", "arrow" + _local1, _local1);
myObject["arrow" + _local1].clip = theWorld.objectsLayerArrows["arrow" + _local1];
myObject["arrow" + _local1].posX = posX;
myObject["arrow" + _local1].posY = posY;
myObject["arrow" + _local1].speed = power;
myObject["arrow" + _local1].velX = Math.sin(angle * (Math.PI/180)) * power;
myObject["arrow" + _local1].velY = (Math.cos(angle * (Math.PI/180)) * power) * -1;
addShadow(myObject["arrow" + _local1]);
myObject["arrow" + _local1].posX = myObject["arrow" + _local1].posX + (myObject["arrow" + _local1].velX * 3);
myObject["arrow" + _local1].posY = myObject["arrow" + _local1].posY + (myObject["arrow" + _local1].velY * 3);
myObject["arrow" + _local1].clip._rotation = (Math.atan2((myObject["arrow" + _local1].posY + myObject["arrow" + _local1].velY) - myObject["arrow" + _local1].posY, (myObject["arrow" + _local1].posX + myObject["arrow" + _local1].velX) - myObject["arrow" + _local1].posX) * 180) / Math.PI;
myObject["arrow" + _local1].clip._x = myObject["arrow" + _local1].posX;
myObject["arrow" + _local1].clip._y = myObject["arrow" + _local1].posY;
}
function aiBOSSSWAMPMONSTER(ob) {
if (ob.clip.hitTest(player.clip) and (ob.armsInFight > 0)) {
var _local3 = 1;
while (_local3 <= enemyCounter) {
if (myObject["enemy" + _local3].inGame and (myObject["enemy" + _local3].enemyType == "monster_arm")) {
facePlayer(myObject["enemy" + _local3]);
myObject["enemy" + _local3].currAttack = "grab";
myObject["enemy" + _local3].clip.gotoAndStop("grab");
myObject["enemy" + _local3].currAttack = "grab";
myObject["enemy" + _local3].frameTimer = myObject["enemy" + _local3].clip.mc._totalFrames;
}
_local3++;
}
}
if (((ob.staggerTimer > 0) or (ob.stunTimer > 0)) or (ob.knockdownTimer > 0)) {
trace("Boss immortal!");
ob.immortal = true;
if (ob.armsInFight <= 0) {
ob.currWave = 0;
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 = ob.hitsLeft - 1;
changeBossPlateHP(ob.hitsLeft, ob.maxHits);
ob.currRun = ob.currRun + 1;
ob.bossInitDone = false;
ob.nextDespawnTimer = 0;
ob.spawnNextArmTimer = 0;
if (ob.hitsLeft <= 0) {
var _local3 = 1;
while (_local3 <= enemyCounter) {
if (myObject["enemy" + _local3].inGame) {
myObject["enemy" + _local3].staggerTimer = 0;
myObject["enemy" + _local3].stunTimer = 0;
myObject["enemy" + _local3].knockdownTimer = 0;
damageEnemy(myObject["enemy" + _local3], 8888, "death_01");
}
_local3++;
}
_root.levelFinished();
} else {
var _local3 = 1;
while (_local3 <= enemyCounter) {
if (myObject["enemy" + _local3].inGame and (myObject["enemy" + _local3].enemyType == "monster_arm")) {
myObject["enemy" + _local3].currAttack = "despawn_init";
}
_local3++;
}
xmarker._x = player.posX - 220;
xmarker._y = ob.posY - 10;
spawnEnemy(xmarker, "SWAMPMONSTER_ARM", 1, "nothing");
}
} else {
trace("Boss hit for unknown reason, no damage should be done!");
ob.knockdownTimer = 0;
ob.stunTimer = 0;
ob.staggerTimer = 0;
ob.clip.gotoAndStop("idle");
ob.currAttack = "idle";
ob.waitTimer = 1;
var _local3 = 1;
while (_local3 <= enemyCounter) {
if (myObject["enemy" + _local3].inGame and (myObject["enemy" + _local3].enemyType == "monster_arm")) {
facePlayer(myObject["enemy" + _local3]);
myObject["enemy" + _local3].currAttack = "grab";
myObject["enemy" + _local3].clip.gotoAndStop("grab");
myObject["enemy" + _local3].currAttack = "grab";
myObject["enemy" + _local3].frameTimer = myObject["enemy" + _local3].clip.mc._totalFrames;
}
_local3++;
}
}
}
if (ob.despawnArm and (ob.nextDespawnTimer <= 0)) {
trace("Despawning arms");
var _local3 = 1;
while (_local3 <= enemyCounter) {
if (myObject["enemy" + _local3].inGame and (myObject["enemy" + _local3].enemyType == "monster_arm")) {
myObject["enemy" + _local3].currAttack = "despawn_init";
}
_local3++;
}
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 = ob.nextDespawnTimer - 1;
}
if ((ob.spawnNextArmTimer <= 0) and (ob.armsInFight <= 0)) {
if (ob.bossInitDone and (ob.currArm < ob.armsInEachWave[ob.currRun][ob.currWave])) {
trace("spawn the next arm(s)!");
ob.spawnNextArmTimer = 1;
ob.hurrySpawnTimer = 0;
} else {
trace("init next arm wave in > 2 seconds!");
if (ob.currWave == 2) {
ob.immortal = false;
trace(" ------------------ Boss mortal! ---------------------");
}
ob.currArm = 0;
ob.hurrySpawnTimer = 0;
ob.lastSpawnDir = 1;
ob.spawnNextArmTimer = 55;
}
}
if (ob.hurrySpawnTimer > 0) {
ob.hurrySpawnTimer = 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)) {
trace("increase to wave 3");
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)) {
trace("increase to wave 2");
ob.spawnNextArmTimer = 1;
ob.currWave = 1;
ob.currArm = 0;
ob.hurrySpawnTimer = 0;
}
}
if ((ob.spawnNextArmTimer > 0) and (!player.isFalling)) {
ob.spawnNextArmTimer = ob.spawnNextArmTimer - 1;
if (ob.spawnNextArmTimer <= 0) {
ob.immortal = true;
trace("Boss immortal!");
var _local5 = "";
trace(ob.armsInEachWave[ob.currRun][ob.currWave]);
xmarker._y = ob.posY - 10;
var _local6 = 0;
var _local4 = ob.currArm;
while (_local4 <= (ob.armsInEachWave[ob.currRun][ob.currWave] - 1)) {
if (_local6 < 2) {
if (ob.lastSpawnDir == 1) {
_local5 = ("s_" + (ob.currWave + 1)) + "_r";
} else {
_local5 = ("s_" + (ob.currWave + 1)) + "_l";
}
ob.lastSpawnDir = ob.lastSpawnDir * -1;
ob.armsInFight = ob.armsInFight + 1;
_local6 = _local6 + 1;
ob.currArm = ob.currArm + 1;
xmarker._x = (theWorld.backgroundNearLayer.currentLevel[_local5]._x + (Math.random() * 16)) - 8;
spawnEnemy(xmarker, "SWAMPMONSTER_ARM", ob.lastSpawnDir, "nothing");
ob.hurrySpawnTimer = 96;
}
_local4++;
}
}
}
if (ob.currAttack == "none") {
trace("Boss SwampMonster spawned");
endOfDemo();
ob.hitsLeft = 3;
ob.maxHits = 3;
ob.canDropHead = 0;
ob.canDropArm = 0;
ob.canBlock = 0;
ob.canParry = 0;
ob.armsInEachWave = [[1, 3, 4], [5, 6, 7], [8, 9, 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();
var _local3 = 1;
while (_local3 <= enemyCounter) {
if ((myObject["enemy" + _local3].inGame and (myObject["enemy" + _local3].enemyType != "monster_arm")) and (myObject["enemy" + _local3].enemyType != "BOSS")) {
deleteEnemy(myObject["enemy" + _local3]);
}
_local3++;
}
xmarker._x = player.posX - 180;
xmarker._y = ob.posY - 10;
spawnEnemy(xmarker, "SWAMPMONSTER_ARM", 1, "nothing");
} else if (ob.currAttack == "hurt") {
ob.frameTimer = ob.frameTimer - 1;
if (ob.frameTimer <= 0) {
ob.clip.gotoAndStop("idle");
ob.currAttack = "idle";
ob.waitTimer = 1;
}
} else if (ob.currAttack == "idle") {
ob.waitTimer = ob.waitTimer - 1;
if (ob.waitTimer <= 0) {
ob.currAttack = "waiting";
}
}
}
function aiSWAMPMONSTERARM(ob) {
if (((ob.staggerTimer > 0) or (ob.stunTimer > 0)) or (ob.knockdownTimer > 0)) {
ob.hitsTaken = ob.hitsTaken + 1;
facePlayer(ob);
ob.clip._xscale = 100 * ob.dirX;
ob.knockdownTimer = 0;
ob.stunTimer = 0;
ob.staggerTimer = 0;
ob.clip.gotoAndStop("idle");
ob.waitTimer = ob.waitTimer + (12 + (Math.random() * 4));
if (ob.isFalling) {
ob.posY = ob.posY + 20;
ob.clip._y = ob.posY;
ob.isFalling = false;
}
if (ob.hitsTaken > 2) {
myObject["enemy" + game.fightingBoss].armsInFight = 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 = 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 = 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.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 = ob.frameTimer - 1;
if (ob.frameTimer <= 0) {
ob.clip.gotoAndStop("idle");
ob.currAttack = "idle";
ob.waitTimer = 22 + (Math.random() * 4);
if ((player.posX - 130) > ob.posX) {
facePlayer(ob);
ob.currAttack = "grab";
ob.clip.gotoAndStop("grab");
ob.currAttack = "grab";
ob.frameTimer = ob.clip.mc._totalFrames;
}
}
} else if (ob.currAttack == "idle") {
ob.waitTimer = ob.waitTimer - 1;
if (ob.waitTimer <= 0) {
var _local3 = Math.sqrt((player.posX - ob.posX) * (player.posX - ob.posX));
if (_local3 <= 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 _local2 = Math.sqrt((player.posY - ob.posY) * (player.posY - ob.posY));
if (_local2 < 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 = ob.attackTimer - 1;
ob.frameTimer = 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 _local2 = Math.sqrt((player.posY - ob.posY) * (player.posY - ob.posY));
if (_local2 < 55) {
if ((((ob.parriesDone < 2) and (player.velX == 0)) and checkIdlePlayer()) and facingOb(player, ob)) {
ob.parriesDone = 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(-2, 0);
} else {
ob.parriesDone = 0;
setCameraShake(5, 5);
updateHPRage(-6, 0);
}
}
}
}
if (ob.frameTimer <= 0) {
ob.currAttack = "idle";
ob.clip.gotoAndStop("idle");
ob.waitTimer = 24;
}
} else if (ob.currAttack == "grab") {
ob.frameTimer = 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 = player.posY - 5;
camPos.difY = camPos.difY + 5;
camPos.virDifY = 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 = ob.frameTimer - 1;
if (ob.frameTimer <= 0) {
myObject["enemy" + game.fightingBoss].despawnArm = true;
ob.clip.gotoAndStop("idle");
ob.currAttack = "idle";
ob.waitTimer = 12;
}
}
}
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.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 = ob.hitsTaken + 1;
ob.hitsLeft = 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 (ob.currAttack == "none") {
trace("Boss Troll spawned");
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 = 0;
ob.currAttack = "idle";
ob.clubDown = false;
ob.clubCollHitDown = false;
}
} else if (ob.currAttack == "stunned") {
ob.frameTimer = 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 = ob.waitTimer + 14;
} else if (ob.hitsTaken == 4) {
ob.waitTimer = ob.waitTimer + 8;
} else {
ob.waitTimer = ob.waitTimer + 24;
}
if ((ob.hitsTaken >= 3) and theWorld.backgroundNearLayer.currentLevel.BT_throwArea.hitTest(player.clip)) {
ob.waitTimer = ob.waitTimer - 12;
}
ob.currAttack = "waiting";
} else if (ob.currAttack == "waiting") {
ob.waitTimer = ob.waitTimer - 1;
if (ob.waitTimer <= 0) {
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 = 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.frameTimer - ob.attackTimer;
ob.attackTimer = 4;
}
if ((ob.hitsTaken == 4) and ((ob.totalFrameTimer - ob.frameTimer) == 21)) {
ob.clip.mc.gotoAndPlay("prepare");
ob.frameTimer = ob.frameTimer - ob.attackTimer;
ob.attackTimer = 4;
}
ob.frameTimer = ob.frameTimer - 1;
ob.attackTimer = 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))) {
player.velY = 5;
startKnockdownPlayer(10);
ob.oldDepth = ob.clip.getDepth();
ob.clip.swapDepths(1001);
updateHPRage(-8, 0);
addSound("kick_01.wav", 50, 0, 0);
} else if (!ob.clubCollHitDown) {
theWorld.backgroundNearLayer.currentLevel.groundCollision.BOSS_club._y = theWorld.backgroundNearLayer.currentLevel.groundCollision.BOSS_club._y + 500;
ob.clubCollHitDown = true;
}
var _local2 = ob.clip.mc._currentFrame;
ob.clip.mc.gotoAndStop("lift_club");
ob.attackTimer = ob.clip.mc._currentFrame - _local2;
ob.clip.mc.gotoAndPlay(_local2);
} 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.immortal = false;
ob.waitTimer = 12;
}
}
theWorld.backgroundNearLayer.currentLevel.groundCollision.BOSS_club._y = 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 = 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 = 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 = ob.frameTimer - 1;
if (ob.frameTimer <= 0) {
if (ob.hitsTaken == 3) {
ob.waitTimer = 42;
} else if (ob.hitsTaken == 4) {
ob.waitTimer = 30;
} else {
ob.waitTimer = 55;
}
ob.clip.gotoAndStop("idle");
ob.currAttack = "idle";
}
ob.attackTimer = 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 _local2 = player.posX;
var _local1 = 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 = camPos.difX - (player.posX - _local2);
}
camPos.virDifX = camPos.virDifX - (player.posX - _local2);
if (Math.sqrt((player.posY - _local1) * (player.posY - _local1)) >= 1) {
player.clip._y = player.posY;
camPos.difY = camPos.difY - (player.posY - _local1);
camPos.virDifY = camPos.virDifY - (player.posY - _local1);
} else {
player.posY = _local1;
}
}
}
function BOSS_TROLL_stoneImpact() {
if (theWorld.backgroundNearLayer.currentLevel.BT_throwArea.hitTest(player.clip)) {
player.isPreparingJump = true;
player.isJumping = true;
player.posY = player.posY - 4;
player.dirX = -1;
player.clip._xscale = player.dirX * 100;
startKnockdownPlayer(10);
player.velX = 4;
player.velY = -5;
updateHPRage(-7.5, 0);
}
}
function BOSS_TROLL_DEAD_HIT_MTDAM() {
theWorld.backgroundNearLayer.currentLevel.bkdam.gotoAndStop("break");
theWorld.foregroundLayer.currentLevel_foreground.mtdam.gotoAndPlay("break");
_root.levelFinished();
}
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.TutorialArray;
var _local1 = 0;
while (_local1 <= 50) {
TutorialArray[_local1] = false;
_local1++;
}
oldSavedGameExist = false;
player.levelsCompletedTotal = 1;
game.maxLevelCleared = 0;
game.currentLevel = 0;
WorldMapPlayerMoving = 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);
}
function saveBOSoS() {
oldSavedGameExist = true;
localData.data.levelsCompletedTotal = player.levelsCompletedTotal;
localData.data.MapsCleared = MapsCleared;
localData.data.maxLevelCleared = game.maxLevelCleared;
localData.data.lastVerRun = BOSoS_ver;
localData.data.lastLevelPlayed = game.currentLevel;
localData.data.TutorialArray = TutorialArray;
localData.flush(100);
}
function loadBOSoS() {
if (localData.data.levelsCompletedTotal != undefined) {
oldSavedGameExist = true;
player.levelsCompletedTotal = localData.data.levelsCompletedTotal;
MapsCleared = localData.data.MapsCleared;
game.currentLevel = localData.data.lastLevelPlayed;
game.maxLevelCleared = localData.data.maxLevelCleared;
TutorialArray = localData.data.TutorialArray;
}
}
var BOSoS_ver = "01.01.00";
var BOSoS_CHEATS = false;
var MD = {mPosX:(Number = _root._xmouse), mPosY:(Number = _root._ymouse), moveX:(Number = 0), dragging:(Boolean = false), moved:(Boolean = false), showMouse:(Boolean = false), inWorldMap:(Boolean = false), forcePointer:(Boolean = false), canDrag:(Boolean = true), ableToDrag:(Boolean = true), fadeInMaps:(Boolean = true), showSign:(Boolean = false)};
var oldSavedGameExist = false;
var camFollow = "none";
var camPos = {difX:(Number = 0), difY:(Number = 0), virDifX:(Number = 0), virDifY:(Number = 0), minX:(Number = -9999), maxX:(Number = 9999)};
var player = {deathInitiated:(Boolean = false), posX:(Number = 0), posY:0, dirX:(Number = 1), velX:(Number = 0), velY:(Number = 0), isPreparingJump:(Boolean = false), isJumping:(Boolean = false), isFalling:(Boolean = false), shadowScale:(Number = 100), isCarringBarrel:(Number = 0), isHoldingBarrel:(Boolean = false), isThrowingBarrel:(Boolean = false), currentAttack:(Number = 0), performNextAttack:(Boolean = false), jumpAttackPerformed:(Boolean = false), staggerTimer:(Number = 0), uncontrollable:(Boolean = false), arrowCounter:(Number = 0), isKnockdowned:(Boolean = false), knockdownTimer:(Number = 0), blurTimer:(Number = 0), normalWidth:(Number = 36), barrelThrowed:(Boolean = false), attackPause:(Number = 0), isStunned:(Boolean = false), stunTimer:(Number = 0), parryTimer:(Number = 0), nextAttackPossible:(Boolean = false), holdingEnemy:(Number = 0), isThrowingEnemy:(Boolean = false), headKnocksDone:(Number = 0), doingHeadKnock:(Boolean = false), holdingEnemyTimer:(Number = 0), contesting:(Number = 0), contestingTimer:(Number = 0), contestingPower:(Number = 0), immortal:(Boolean = false), finishingEnemy:(Number = 0), bloodType:(String = "blood_s_"), movementDisabled:false, life:(Number = 100), rage:(Number = 0), rageTimer:(Number = 0), levelsCompletedTotal:(Number = 1)};
var game = {gravity:(Number = 0.6), physicAccuracy:(Number = 8), rootRotation:(Number = 0), rootZoom:(Number = 100), shadows:(Number = 0), stopCam:(Number = 0), inMenu:(Boolean = true), inWorldmap:(Boolean = false), isPaused:(Boolean = true), camShakeTime:(Number = 0), camShakePower:(Number = 0), currentLevel:(Number = 0), fightingBoss:(Number = 0), lockCam:(Boolean = false), levelFinished:(Boolean = false), maxLevelCleared:(Number = 0), weatherType:(String = "nothing")};
var demoOver = false;
var options = {blurEffects:true, zoomEffects:true, rotationEffects:true, bloodParticles:(Number = 170), partParticles:(Number = 75)};
var gameEvent = {waveID:(String = "none_0"), nrLeftInWave:(Number = 0), onDeathRunScript:(String = "none")};
var bgFar = {posX:(Number = 0), posY:(Number = 0)};
var localData = SharedObject.getLocal("BOSoS_01");
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.arrowCounter = 0;
myObject.emptyCircle.prototype.frictionForce = 0.35;
myObject.emptyCircle.prototype.bounceForce = 0.3;
myObject.emptyCircle.prototype.shadowScale = 75;
myObject.emptyArrow = function () {
};
myObject.emptyArrow.prototype.posX = 0;
myObject.emptyArrow.prototype.posY = 0;
myObject.emptyArrow.prototype.velX = 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.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.ID = 0;
myObject.emptyEnemy.prototype.waveID = "0";
myObject.emptyEnemy.prototype.isJumping = false;
myObject.emptyEnemy.prototype.isFalling = false;
myObject.emptyEnemy.prototype.seenPlayer = false;
myObject.emptyEnemy.prototype.immortal = false;
myObject.emptyEnemy.prototype.enemyType = "default";
myObject.emptyEnemy.prototype.barrelImmune = 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);
_root.createEmptyMovieClip("interfaceLayer", 29);
interfaceLayer.attachMovie("ratioFix", "ratioFix", 10);
interfaceLayer.ratioFix.gotoAndStop("empty");
interfaceLayer.attachMovie("screenSize", "screenSize", 11);
loadBOSoS();
openMenu();
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", 30);
var MapsConnected = new Array([1], [2], [1, 3], [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], [19]);
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", "LEVEL 9", "LEVEL 10", "LEVEL 11", "LEVEL 12", "LEVEL 13", "LEVEL 14", "LEVEL 15", "LEVEL 16", "LEVEL 17", "LEVEL 18", "LEVEL 19", "NAMELESS");
var MapsToFadeIn = new Array();
var hideMapsFromScript = false;
var showingAllMaps = true;
var WorldMapPlayerMoving = false;
var WorldMapPlayerPath = new Array();
var tiltDifForce = 10;
var step = 1;
var soundCounter = 0;
var key = {rightPressed:false, leftPressed:false, spacePressed:false, spaceTabbed:false, spacePower:0, upPressed:false};
var keyListener = new Object();
keyListener.onKeyDown = function () {
if ((spawnMapTimer <= 0) and (!player.deathInitiated)) {
if (!game.isPaused) {
if ((!key.spacePressed) and (!player.uncontrollable)) {
if ((Key.getCode() == 39) or (Key.getCode() == 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 ((Key.getCode() == 37) or (Key.getCode() == 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 ((Key.getCode() == 38) or (Key.getCode() == 87)) {
if (((((player.holdingEnemy == 0) and (!key.upPressed)) and (player.currentAttack == 0)) and (!player.isPreparingJump)) and (player.isCarringBarrel == 0)) {
player.isPreparingJump = true;
player.velY = -11;
player.clip.gotoAndStop("jump");
addEffect_jumpSmoke(player);
}
key.upPressed = true;
}
}
if (!player.uncontrollable) {
if (Key.getCode() == 32) {
if (!key.spaceTabbed) {
key.spacePressed = true;
key.spaceTabbed = true;
if (player.isFalling and (!player.jumpAttackPerformed)) {
key.spacePower = 6;
addSound(("swing_s_0" + Math.floor((Math.random() * 2) + 1)) + ".WAV", 45, 0, 0);
player.clip.gotoAndStop("attack_jump");
if (player.velY > 0) {
player.velY = 0;
}
player.jumpAttackPerformed = true;
}
}
}
}
if (BOSoS_CHEATS) {
if (Key.getCode() == 49) {
if (!Key.isDown(17)) {
var _local2 = 1;
while (_local2 <= enemyCounter) {
if (myObject["enemy" + _local2].inGame and (myObject["enemy" + _local2].life > 0)) {
myObject["enemy" + _local2].attackTimer = 0;
myObject["enemy" + _local2].stunTimer = 99;
}
_local2++;
}
}
}
if (Key.getCode() == 50) {
}
if (Key.getCode() == 51) {
}
if (Key.getCode() == 52) {
}
if (Key.getCode() == 53) {
if (Key.isDown(17)) {
updateHPRage(100, 100);
}
player.knockdownTimer = 0;
player.isKnockdowned = false;
player.stunTimer = 0;
player.isStunned = false;
player.staggerTimer = 0;
startStunPlayer(1);
}
if (Key.getCode() == 54) {
if (!Key.isDown(16)) {
var _local2 = 1;
while (_local2 <= circleCounter) {
if (myObject["circle" + _local2].inGame) {
myObject["circle" + _local2].life = myObject["circle" + _local2].life - myObject["circle" + _local2].life;
damageOb(myObject["circle" + _local2], 40);
}
_local2++;
}
}
}
if (Key.getCode() == 55) {
if (!Key.isDown(16)) {
var _local2 = 1;
while (_local2 <= arrowCounter) {
if (myObject["arrow" + _local2].inGame) {
addEffect("matchwood", myObject["arrow" + _local2].posX, myObject["arrow" + _local2].posY, 0, 0, 1);
addPart("arrow_part_", 1, myObject["arrow" + _local2].posX, myObject["arrow" + _local2].posY, player.dirX * 6, -2, false, false, 5, 5);
addPart("arrow_head_", 1, myObject["arrow" + _local2].posX, myObject["arrow" + _local2].posY, myObject["arrow" + _local2].velX, -2, false, false, 2, 5);
myObject["arrow" + _local2].inGame = false;
removeMovieClip(myObject["arrow" + _local2].shadowClip);
removeMovieClip(myObject["arrow" + _local2].clip);
}
_local2++;
}
}
}
if (Key.getCode() == 56) {
if (!Key.isDown(16)) {
var _local2 = 1;
while (_local2 <= enemyCounter) {
if (myObject["enemy" + _local2].inGame) {
myObject["enemy" + _local2].staggerTimer = 1;
myObject["enemy" + _local2].stunTimer = 0;
myObject["enemy" + _local2].knockdownTimer = 0;
damageEnemy(myObject["enemy" + _local2], 1000, "death_01");
}
_local2++;
}
}
}
}
}
if (Key.getCode() == 81) {
if (_root._quality == "HIGH") {
_root._quality = "LOW";
} else if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
} else if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
}
if (Key.getCode() == 57) {
if (BOSoS_CHEATS) {
if (Key.isDown(16)) {
endOfDemo();
} else if (Key.isDown(17)) {
stageCleared();
} else {
game.levelFinished = true;
interfaceLayer.ratioFix.gotoAndStop("stage_cleared");
}
}
}
}
};
keyListener.onKeyUp = function () {
if ((spawnMapTimer <= 0) and (!player.deathInitiated)) {
if ((Key.getCode() == 39) or (Key.getCode() == 68)) {
key.rightPressed = false;
}
if ((Key.getCode() == 38) or (Key.getCode() == 87)) {
key.upPressed = false;
}
if ((Key.getCode() == 37) or (Key.getCode() == 65)) {
key.leftPressed = false;
}
if (!game.isPaused) {
if (!player.uncontrollable) {
if (Key.getCode() == 32) {
if (key.spacePressed) {
if (((key.spacePower <= 5) and (!player.isThrowingBarrel)) and (!player.isThrowingEnemy)) {
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 (Key.getCode() == 32)) {
addEffect_sparks(player);
addSound("contest_press_0" + Math.floor((Math.random() * 3) + 1), 45, 0, 0);
player.contestingPower = player.contestingPower + 1;
}
}
if (Key.getCode() == 27) {
if (demoOver) {
demoOver = false;
openMenu();
} else if (!game.levelFinished) {
if (!game.inMenu) {
if (game.isPaused) {
unpauseGame();
} else {
MD.forcePointer = true;
showCursor();
game.isPaused = true;
key.spacePressed = false;
key.spaceTabbed = false;
key.spacePower = 0;
interfaceLayer.ratioFix.gotoAndStop("paused");
}
} else if ((!game.inMenu) or game.inWorldmap) {
openMenu();
}
}
}
}
};
Key.addListener(keyListener);
var finishingXRange = 60;
this.onMouseMove = function () {
};
var mousePoint = {startX:0, startY:0};
this.onMouseDown = function () {
mousePoint.startX = _root._xmouse;
mousePoint.startY = _root._ymouse;
};
this.onMouseUp = function () {
if (BOSoS_CHEATS) {
if (Math.sqrt(((mousePoint.startX - _root._xmouse) * (mousePoint.startX - _root._xmouse)) + ((mousePoint.startY - _root._ymouse) * (mousePoint.startY - _root._ymouse))) <= 10) {
if (Key.isDown(16)) {
xmarker._x = _root._xmouse - theWorld._x;
xmarker._y = _root._ymouse - theWorld._y;
if (Key.isDown(50)) {
spawnEnemy(xmarker, "SWORDSMAN_1", 1, "nothing");
} else if (Key.isDown(51)) {
spawnEnemy(xmarker, "ARCHER_1", 1, "nothing");
} else if (Key.isDown(52)) {
spawnEnemy(xmarker, "SPEARMAN_1", 1, "nothing");
} else if (Key.isDown(53)) {
spawnEnemy(xmarker, "SKELETON_1", 1, "nothing");
} else if (Key.isDown(54)) {
spawnEnemy(xmarker, "CHAOSKNIGHT_SWORD_1", 1, "nothing");
} else if (Key.isDown(55)) {
spawnEnemy(xmarker, "CHAOSKNIGHT_MACE_1", 1, "nothing");
}
} else if (Key.isDown(17)) {
xmarker._x = _root._xmouse - theWorld._x;
xmarker._y = _root._ymouse - theWorld._y;
if (Key.isDown(50)) {
spawnBarrel(xmarker, "/HP-50/explosive-0/");
} else if (Key.isDown(51)) {
spawnBarrel(xmarker, "/HP-50/explosive-1/");
} else if (Key.isDown(52)) {
spawnEnemy(xmarker, "CROW_1", 1, "nothing");
} else if (Key.isDown(54)) {
spawnFoodCrate(xmarker._x, xmarker._y, 1);
} else if (Key.isDown(55)) {
spawnFoodCrate(xmarker._x, xmarker._y, 2);
}
}
} else if (Key.isDown(17) and Key.isDown(49)) {
var _local2 = findEmptyObject("arrow", "arrowCounter");
myObject["arrow" + _local2] = new myObject.emptyArrow();
theWorld.objectsLayerArrows.attachMovie("arrow", "arrow" + _local2, _local2);
myObject["arrow" + _local2].clip = theWorld.objectsLayerArrows["arrow" + _local2];
myObject["arrow" + _local2].clip._x = _root._xmouse - theWorld._x;
myObject["arrow" + _local2].clip._y = _root._ymouse - theWorld._y;
myObject["arrow" + _local2].posX = _root._xmouse - theWorld._x;
myObject["arrow" + _local2].posY = _root._ymouse - theWorld._y;
myObject["arrow" + _local2].speed = Math.sqrt(((mousePoint.startX - _root._xmouse) * (mousePoint.startX - _root._xmouse)) + ((mousePoint.startY - _root._ymouse) * (mousePoint.startY - _root._ymouse)));
myObject["arrow" + _local2].velX = (mousePoint.startX - _root._xmouse) * 0.2;
myObject["arrow" + _local2].velY = (mousePoint.startY - _root._ymouse) * 0.2;
addShadow(myObject["arrow" + _local2]);
}
}
};
this.onEnterFrame = function () {
updateCursor();
if (spawnMapTimer <= 0) {
if (!game.isPaused) {
barrelPhysic();
arrowPhysic();
enemyAI();
traceKeys();
checkTimerEffects();
trackBloodstain();
trackParts();
cameraStatic();
updateRage();
if (!player.movementDisabled) {
if ((player.velX != 0) and (!player.deathInitiated)) {
movePlayerXAxis();
}
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 = player.attackPause - 1;
if (player.attackPause <= 0) {
player.clip.mc.play();
}
}
} else {
mapDrag();
}
} else {
spawnMapTimer = spawnMapTimer - 1;
if (spawnMapTimer == 2) {
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 (game.currentLevel == 1) {
showTutorial(1);
}
}
}
};
var myRageGlow = (new flash.filters.GlowFilter(10166304, 0.4, 7, 7, 3, 1, false, false));
var myRageGlowAttacking = (new flash.filters.GlowFilter(10166304, 1, 10, 10, 3, 1, false, false));
var yCheckAxis = 15;
trace("Enemy AI Loaded");
trace("Boss Swampmonster AI Loaded");
trace("Boss Troll AI Loaded");
stop();
Symbol 32 MovieClip [death_01] Frame 29
stop();
Symbol 2300 MovieClip [__Packages.NewgroundsAPI] Frame 0
class NewgroundsAPI
{
static var tracker_id, host, version, debug, error_format, header_format, normal_format, link_format;
function NewgroundsAPI () {
}
static function connectMovie(id) {
if (!id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.connectMovie(id:Number)");
} else if (!tracker_id) {
SendMessage("Connecting to API gateway...");
tracker_id = id;
host = _url.split("/")[2].toLowerCase();
if (host.length < 1) {
host = "localhost";
}
var _local2 = new Object();
SendEvent(MOVIE_VIEWS);
}
}
static function setMovieVersion(movie_version) {
if (!movie_version) {
SendError("Missing required 'version' in NewgroundsAPI.setMovieVersion(version:String)");
} else {
version = movie_version;
}
}
static function debugMode() {
debug = true;
}
static function addCustomEvent(stat_id, stat_name) {
if (!stat_id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else if (!stat_name) {
SendError("Missing required 'event_name' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
custom_events[stat_name] = CUSTOM_STATS + stat_id;
SendMessage("Created custom event: " + stat_name);
}
}
static function addCustomLink(stat_id, stat_name) {
if (!stat_id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else if (!stat_name) {
SendError("Missing required 'link_name' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
custom_links[stat_name] = CUSTOM_STATS + stat_id;
SendMessage((("Created custom link " + stat_id) + ": ") + stat_name);
}
}
static function loadMySite() {
SendLink(AUTHOR_SITE);
}
static function loadNewgrounds(special) {
if (special) {
var _local1 = {page:special};
}
SendLink(NEWGROUNDS, _local1);
}
static function logCustomEvent(event_name) {
if (!event_name) {
SendError("Missing required 'event_name' parameter in NewgroundsAPI.logCustomEvent(event_name:String)");
} else if (!custom_events[event_name]) {
SendError("Attempted to log undefined custom event: " + event_name);
} else {
SendEvent(custom_events[event_name]);
}
}
static function loadCustomLink(link_name) {
if (!link_name) {
SendError("Missing required 'link_name' parameter in NewgroundsAPI.loadCustomLink(link_name:String)");
} else if (!custom_links[link_name]) {
SendError("Attempted to open undefined custom link: " + link_name);
} else {
SendLink(custom_links[link_name]);
}
}
static function getAdURL() {
return(movie_options.ad_url);
}
static function getMovieURL() {
if (movie_options.movie_url) {
return(movie_options.movie_url);
}
return("Newgrounds.com");
}
static function getNewVersionURL() {
return((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + NEW_VERSION);
}
static function SendEvent(id) {
SendStat(id, false);
}
static function SendLink(id, extra) {
SendStat(id, true, extra);
}
static function ReadGatewayData(params) {
for (var _local2 in params) {
params[_local2] = unescape(params[_local2]);
movie_options[_local2] = params[_local2];
}
if (params.settings_loaded) {
SendMessage("You have successfully connected to the Newgrounds API gateway!");
SendMessage(("Movie Identified as '" + movie_options.movie_name) + "'");
if (movie_options.message) {
SendMessage(movie_options.message);
}
if (movie_options.ad_url) {
SendMessage("Your movie has been approved to run Flash Ads");
onAdsApproved(movie_options.ad_url);
}
if (movie_options.movie_version and (movie_options.movie_version.toString() != version.toString())) {
SendMessage("WARNING: The movie version configured in your API settings does not match this movie's version!");
onNewVersionAvailable(movie_options.movie_version, getMovieURL(), getNewVersionURL());
}
if (movie_options.deny_host) {
SendMessage("You have blocked 'localHost' in your API settings.");
SendMessage("If you wish to test your movie you will need to remove this block.");
onDenyHost(host, getMovieURL(), getNewVersionURL());
}
if (movie_options.request_portal_url == 1) {
var _local4 = (((GATEWAY_URL + "?&id=") + tracker_id) + "&portal_url=") + escape(_url);
var _local3 = new XML();
_local3.ignoreWhite = true;
_local3.load(_local4);
}
} else if (!movie_options.settings_loaded) {
SendError("Could not establish connection to the API gateway.");
}
}
static function SendStat(stat_id, open_in_browser, extra) {
if (!tracker_id) {
SendError("API calls cannot be made without a valid movie id.");
SendError("Did you remember to add the \"NewgroundsAPI.connectMovie()\" code?");
} else {
var _local7 = (((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + stat_id;
for (var _local9 in extra) {
_local7 = _local7 + ((("&" + escape(_local9)) + "=") + escape(extra[_local9]));
}
trace(_local7);
if (debug) {
_local7 = _local7 + "&debug=1";
}
if (open_in_browser) {
getURL (_local7, "_blank");
} else {
var _local10 = new XML();
_local10.ignoreWhite = true;
_local10.onLoad = function (success) {
var _local6 = new Object();
var _local3 = 0;
while (_local3 < this.firstChild.childNodes.length) {
var _local4 = this.firstChild.childNodes[_local3];
var _local5 = _local4.nodeName;
var _local2 = _local4.attributes.value;
if (_local2 == Number(_local2)) {
_local2 = Number(_local2);
}
_local6[_local5] = _local2;
_local3++;
}
NewgroundsAPI.ReadGatewayData(_local6);
};
_local10.load(_local7);
}
}
}
static function SendError(msg) {
trace("[NEWGROUNDS API ERROR] :: " + msg);
}
static function SendMessage(msg) {
trace("[NEWGROUNDS API] :: " + msg);
}
static function InitTextFormats() {
if (!error_format) {
error_format = new TextFormat();
error_format.font = "Arial Black";
error_format.size = 48;
error_format.color = 16711680 /* 0xFF0000 */;
}
if (!header_format) {
header_format = new TextFormat();
header_format.font = "Arial Black";
header_format.size = 24;
header_format.color = 16777215 /* 0xFFFFFF */;
}
if (!normal_format) {
normal_format = new TextFormat();
normal_format.font = "Arial";
normal_format.bold = true;
normal_format.size = 12;
normal_format.color = 16777215 /* 0xFFFFFF */;
}
if (!link_format) {
link_format = new TextFormat();
link_format.color = 16776960 /* 0xFFFF00 */;
link_format.underline = true;
}
}
static function onNewVersionAvailable(version, movie_url, redirect_url) {
InitTextFormats();
var _local2 = new Object();
_local2.x = Stage.width / 2;
_local2.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(_local2.x - 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y + 80);
_root.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y + 80);
_root.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.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(_local2.x + 210, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.endFill();
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 214, _local2.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 226, _local2.y - 94);
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 226, _local2.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 214, _local2.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 _local3 = (("Version " + version) + " is now available at:") + newline;
var _local5 = _local3.length;
_local3 = _local3 + movie_url;
var _local4 = _local3.length;
_root.NGAPI_new_version_overlay.createTextField("mouseblocker", 99, -10, -10, 1000, 1000);
_root.NGAPI_new_version_overlay.createTextField("newversion", 100, _local2.x - 210, _local2.y - 90, 400, 80);
_root.NGAPI_new_version_overlay.newversion.text = "New Version Available!";
_root.NGAPI_new_version_overlay.newversion.setTextFormat(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 = _local3;
_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(normal_format);
link_format.url = redirect_url;
_root.NGAPI_new_version_overlay.message.setTextFormat(_local5, _local4, link_format);
}
static function onDenyHost(hostname, movie_url, redirect_url) {
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 _local2 = ("This movie has not been approved for use on " + hostname) + ".";
_local2 = _local2 + "\r\rFor an aproved copy, please visit:\r";
var _local4 = _local2.length;
_local2 = _local2 + movie_url;
var _local3 = _local2.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(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 = _local2;
_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(normal_format);
link_format.url = redirect_url;
_root.NGAPI_deny_host_overlay.message.setTextFormat(_local4, _local3, link_format);
}
static function isInstalled() {
return(true);
}
static function onAdsApproved(ad_url) {
}
static var movie_options = new Object();
static var custom_events = new Object();
static var custom_links = new Object();
static var MOVIE_VIEWS = 1;
static var AUTHOR_SITE = 2;
static var NEWGROUNDS = 3;
static var NEW_VERSION = 4;
static var CUSTOM_STATS = 50;
static var GATEWAY_URL = "http://www.ngads.com/gateway.php";
}
Symbol 41 Button
on (release) {
NewgroundsAPI.loadNewgrounds();
}
Symbol 46 Button
on (release) {
NewgroundsAPI.loadNewgrounds();
}
Symbol 48 MovieClip 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");
}
};
ngads_redirect.load(ngad_url);
}
if (NewgroundsAPI.getAdURL()) {
startAd(NewgroundsAPI.getAdURL());
}
NewgroundsAPI.onAdsApproved = function (ad_url) {
startAd(ad_url);
};
stop();
Symbol 85 MovieClip [weather] Frame 1
stop();
Symbol 96 MovieClip Frame 1
stop();
Symbol 96 MovieClip Frame 13
gotoAndPlay (2);
Symbol 98 MovieClip Frame 1
stop();
Symbol 98 MovieClip Frame 11
gotoAndPlay (2);
Symbol 107 MovieClip Frame 1
stop();
Symbol 130 MovieClip Frame 91
_root.stageCleared();
Symbol 159 MovieClip Frame 1
gotoAndStop (2);
Symbol 159 MovieClip Frame 2
stop();
Symbol 169 MovieClip [xmarker] Frame 1
gotoAndStop (2);
Symbol 169 MovieClip [xmarker] Frame 2
stop();
Symbol 176 MovieClip Frame 2
function playBlood() {
_root.addSound("finishing_06.wav", 70, 0, 0);
}
function setQuality() {
var _local3 = (slider_end._x - slider._x) / 2;
if (_root._quality == "LOW") {
head._x = slider._x;
} else if (_root._quality == "MEDIUM") {
head._x = slider._x + _local3;
} else {
head._x = slider_end._x;
}
this.LMH.gotoAndStop(_root._quality);
qualitySet = true;
}
function changeQuality() {
if (qualitySet) {
var _local4 = (slider_end._x - slider._x) / 3;
var _local3 = head._x - slider._x;
if (Math.sqrt((oldHeadXPos - _local3) * (oldHeadXPos - _local3)) >= 20) {
_root.addSound("finishing_06.wav", 70, 0, 0);
}
if (_local4 > _local3) {
if (_root._quality != "LOW") {
playBlood();
}
_root._quality = "LOW";
} else if ((_local4 * 2) > _local3) {
if (_root._quality != "MEDIUM") {
playBlood();
}
_root._quality = "MEDIUM";
} else {
if (_root._quality != "HIGH") {
playBlood();
}
_root._quality = "HIGH";
}
this.LMH.gotoAndStop(_root._quality);
oldHeadXPos = _local3;
}
}
function playBloood(blody) {
}
this.blood_q._alpha = 0;
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 == 2) {
head._y = slider._y;
if (head._x > slider_end._x) {
head._x = slider_end._x;
} else if (head._x < slider._x) {
head._x = slider._x;
}
changeQuality();
}
};
var oldHeadXPos = (head._x - slider._x);
head.onPress = function () {
draggingHead = true;
head.startDrag();
};
head.onRelease = function () {
draggingHead = false;
head.stopDrag();
};
head.onReleaseOutside = function () {
draggingHead = false;
head.stopDrag();
};
back_btn.onRelease = function () {
_parent.optShow = false;
gotoAndStop (1);
};
this.blood_1._alpha = 0;
this.blood_2._alpha = 0;
this.blood_3._alpha = 0;
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 () {
playBloood(1);
if (!_root.options.blurEffects) {
_root.options.blurEffects = true;
indicator_be.gotoAndStop("ON");
} else {
_root.options.blurEffects = false;
indicator_be.gotoAndStop("OFF");
}
};
btn_be.onRollOver = function () {
};
btn_be.onRollOut = function () {
opt_msg.gotoAndStop(1);
};
btn_cr.onRelease = function () {
playBloood(2);
if (!_root.options.rotationEffects) {
_root.options.rotationEffects = true;
indicator_cr.gotoAndStop("ON");
} else {
_root.options.rotationEffects = false;
indicator_cr.gotoAndStop("OFF");
}
};
btn_cr.onRollOver = function () {
};
btn_cr.onRollOut = function () {
opt_msg.gotoAndStop(1);
};
btn_ze.onRelease = function () {
playBloood(3);
if (!_root.options.zoomEffects) {
_root.options.zoomEffects = true;
indicator_ze.gotoAndStop("ON");
} else {
_root.options.zoomEffects = false;
indicator_ze.gotoAndStop("OFF");
}
};
btn_ze.onRollOver = function () {
};
btn_ze.onRollOut = function () {
opt_msg.gotoAndStop(1);
};
Symbol 190 MovieClip Frame 132
_root.gameOver();
Symbol 193 MovieClip Frame 1
stop();
Symbol 223 MovieClip [RatioFix] Frame 2
this.onEnterFrame = function () {
if (this.masky._alpha < 100) {
this.masky._alpha = this.masky._alpha + 1;
} else if (this.barb_demo._alpha < 100) {
_root.game.isPaused = true;
this.barb_demo._alpha = this.barb_demo._alpha + 1;
}
};
Symbol 223 MovieClip [RatioFix] Frame 4
btn_exit.onRelease = function () {
_root.exitLevelNow();
};
btn_resumeGame.onRelease = function () {
_root.MD.forcePointer = false;
_root.hideCursor();
_root.game.isPaused = false;
_root.interfaceLayer.ratioFix.gotoAndStop("running");
};
var optShow = false;
this.opt.gotoAndStop("hide");
btn_options.onRelease = function () {
if (optShow) {
optShow = false;
opt.gotoAndStop("hide");
} else {
optShow = true;
opt.gotoAndStop("show");
}
};
Symbol 223 MovieClip [RatioFix] Frame 6
var DisableTut = false;
continue_btn.onRelease = function () {
if (DisableTut) {
_root.disableTutorial();
} else {
_root.continueTutorial();
}
};
disable_tutorial_btn.onRelease = function () {
if (DisableTut) {
chkBox.gotoAndStop(1);
DisableTut = false;
} else {
chkBox.gotoAndStop(2);
DisableTut = true;
}
gotoAndStop ("tutorial_disable");
};
Symbol 223 MovieClip [RatioFix] Frame 7
disable_tutorial_btn.onRelease = function () {
if (DisableTut) {
chkBox.gotoAndStop(1);
DisableTut = false;
} else {
chkBox.gotoAndStop(2);
DisableTut = true;
}
_root.disableTutorial();
};
no_btn.onRelease = function () {
_root.unpauseGame();
};
Symbol 229 MovieClip [arrow] Frame 1
stop();
Symbol 229 MovieClip [arrow] Frame 2
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
play();
Symbol 229 MovieClip [arrow] Frame 10
stop();
Symbol 229 MovieClip [arrow] Frame 11
gotoAndStop (10);
Symbol 237 MovieClip [barrel] Frame 1
stop();
Symbol 261 MovieClip [food_crate] Frame 1
stop();
Symbol 261 MovieClip [food_crate] Frame 10
stop();
Symbol 264 MovieClip [gib_part_chaosknight_01] Frame 1
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 264 MovieClip [gib_part_chaosknight_01] Frame 6
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 264 MovieClip [gib_part_chaosknight_01] Frame 10
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 264 MovieClip [gib_part_chaosknight_01] Frame 15
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 264 MovieClip [gib_part_chaosknight_01] Frame 19
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 264 MovieClip [gib_part_chaosknight_01] Frame 24
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 264 MovieClip [gib_part_chaosknight_01] Frame 28
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 264 MovieClip [gib_part_chaosknight_01] Frame 33
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 264 MovieClip [gib_part_chaosknight_01] Frame 37
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 264 MovieClip [gib_part_chaosknight_01] Frame 42
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 264 MovieClip [gib_part_chaosknight_01] Frame 46
stop();
Symbol 267 MovieClip [gib_part_chaosknight_02] Frame 1
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 267 MovieClip [gib_part_chaosknight_02] Frame 6
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 267 MovieClip [gib_part_chaosknight_02] Frame 10
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 267 MovieClip [gib_part_chaosknight_02] Frame 15
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 267 MovieClip [gib_part_chaosknight_02] Frame 19
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 267 MovieClip [gib_part_chaosknight_02] Frame 24
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 267 MovieClip [gib_part_chaosknight_02] Frame 28
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 267 MovieClip [gib_part_chaosknight_02] Frame 33
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 267 MovieClip [gib_part_chaosknight_02] Frame 37
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 267 MovieClip [gib_part_chaosknight_02] Frame 42
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 267 MovieClip [gib_part_chaosknight_02] Frame 46
stop();
Symbol 284 MovieClip [gib_part_chaosknight_03] Frame 1
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 284 MovieClip [gib_part_chaosknight_03] Frame 6
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 284 MovieClip [gib_part_chaosknight_03] Frame 10
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 284 MovieClip [gib_part_chaosknight_03] Frame 15
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 284 MovieClip [gib_part_chaosknight_03] Frame 19
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 284 MovieClip [gib_part_chaosknight_03] Frame 24
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 284 MovieClip [gib_part_chaosknight_03] Frame 28
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 284 MovieClip [gib_part_chaosknight_03] Frame 33
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 284 MovieClip [gib_part_chaosknight_03] Frame 37
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 284 MovieClip [gib_part_chaosknight_03] Frame 42
_root.addEffect("blood_fire_0" + Math.round((Math.random() * 1) + 1), this._x, this._y, 0, 2, 1);
Symbol 284 MovieClip [gib_part_chaosknight_03] Frame 46
stop();
Symbol 301 MovieClip Frame 1
stop();
Symbol 302 MovieClip [gameCursor] Frame 1
stop();
Symbol 346 MovieClip Frame 1
stop();
Symbol 346 MovieClip Frame 45
stop();
Symbol 390 MovieClip Frame 1
stop();
Symbol 390 MovieClip Frame 74
stop();
Symbol 418 MovieClip Frame 138
stop();
Symbol 425 MovieClip Frame 1
stop();
Symbol 425 MovieClip Frame 29
stop();
Symbol 448 MovieClip [fire_01] Frame 9
stop();
Symbol 457 MovieClip [fire_02] Frame 9
stop();
Symbol 464 MovieClip [fire_03] Frame 9
stop();
Symbol 472 MovieClip [fire_04] Frame 8
stop();
Symbol 479 MovieClip Frame 1
stop();
Symbol 479 MovieClip Frame 88
stop();
Symbol 485 MovieClip Frame 1
stop();
Symbol 489 MovieClip Frame 44
gotoAndPlay (1);
Symbol 497 MovieClip 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++;
}
Symbol 500 MovieClip Frame 1
stop();
Symbol 502 MovieClip Frame 1
stop();
Symbol 502 MovieClip Frame 2
_root.hideMaps();
_parent.bridge.gotoAndStop(1);
this.play();
Symbol 502 MovieClip Frame 24
_parent.bridge.gotoAndPlay(2);
Symbol 502 MovieClip Frame 138
_root.showMaps();
Symbol 504 MovieClip Frame 1
stop();
Symbol 504 MovieClip Frame 2
_root.hideMaps();
_parent.mtDam.gotoAndStop(1);
_parent.sunbeams.gotoAndStop(1);
this.play();
Symbol 504 MovieClip Frame 12
_parent.mtDam.gotoAndPlay(2);
Symbol 504 MovieClip Frame 36
_parent.sunbeams.gotoAndPlay(2);
Symbol 504 MovieClip Frame 94
_root.showMaps();
Symbol 506 MovieClip Frame 1
var moffing = false;
this.onEnterFrame = function () {
if (moffing) {
_parent._x = _parent._x + 3;
}
};
stop();
Symbol 506 MovieClip Frame 2
moffing = true;
_root.hideMaps();
_parent.pass.gotoAndStop(1);
_parent.dragons.play();
this.play();
Symbol 506 MovieClip Frame 31
_parent.pass.gotoAndPlay(2);
Symbol 506 MovieClip Frame 139
moffing = false;
_root.showMaps();
Symbol 550 MovieClip Frame 1
stop();
Symbol 550 MovieClip Frame 2
back_btn.onRelease = function () {
gotoAndStop ("hide");
};
hzlancer_btn.onRelease = function () {
getURL ("http://hzlancer.newgrounds.com/", "_blank");
};
Chrispington_btn.onRelease = function () {
getURL ("http://Chrispington.newgrounds.com/", "_blank");
};
Symbol 553 MovieClip Frame 1
function hideThisMSG() {
this._x = this._x - 1000;
}
btnBack.onRelease = function () {
_parent.showingWarning = false;
hideThisMSG();
};
newGame.onRelease = function () {
_root.clearBOSoSData();
_root.showMap();
};
Symbol 554 MovieClip Frame 1
function changeWarningMSG() {
warningMsg._x = warningMsg._x + 1000;
}
function hideWarningMSG() {
warningMsg._x = warningMsg._x - 1000;
}
var showingWarning = false;
var optShow = false;
this.warningMsg._x = this.warningMsg._x - 1000;
this.opt.gotoAndStop("hide");
btn_credits.onRelease = function () {
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 () {
cred.gotoAndStop("hide");
if (optShow) {
optShow = false;
opt.gotoAndStop("hide");
} else {
optShow = true;
opt.gotoAndStop("show");
if (showingWarning) {
hideWarningMSG();
showingWarning = false;
}
}
};
btn_continue.onRelease = function () {
_root.showMap();
};
btn_newGame.onRelease = function () {
cred.gotoAndStop("hide");
optShow = false;
opt.gotoAndStop("hide");
if (!_root.oldSavedGameExist) {
_root.clearBOSoSData();
_root.showMap();
} else if (!showingWarning) {
changeWarningMSG();
showingWarning = true;
} else if (showingWarning) {
hideWarningMSG();
showingWarning = false;
}
};
if (!_root.oldSavedGameExist) {
continue_fade._x = continue_fade._x + 200;
btn_continue._x = btn_continue._x - 200;
}
Symbol 559 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 563 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 563 MovieClip Frame 4
_root.addStepSound();
Symbol 572 MovieClip Frame 4
_root.startPlayerJump();
Symbol 572 MovieClip Frame 6
stop();
Symbol 572 MovieClip Frame 9
stop();
Symbol 577 MovieClip Frame 5
_root.pickupBarrel();
Symbol 577 MovieClip Frame 6
stop();
Symbol 581 MovieClip Frame 1
_root.pickupBarrel();
Symbol 581 MovieClip Frame 3
_root.pickupBarrel();
_root.barrelAway();
Symbol 581 MovieClip Frame 12
_root.barrelThrowFinished();
Symbol 587 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
_root.addSound("swing_f_01.wav", 70, 0, 0);
Symbol 587 MovieClip Frame 2
_root.player.velX = _root.player.dirX;
_root.playerAttack("att_f_1");
Symbol 587 MovieClip Frame 3
_root.player.velX = 0;
_root.player.nextAttackPossible = true;
Symbol 587 MovieClip Frame 9
_root.endAttack();
Symbol 594 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
_root.addSound("swing_f_02.wav", 140, 0, 0);
Symbol 594 MovieClip Frame 3
_root.player.velX = _root.player.dirX;
_root.playerAttack("att_f_2");
Symbol 594 MovieClip Frame 4
_root.player.velX = 0;
_root.player.nextAttackPossible = true;
Symbol 594 MovieClip Frame 9
_root.endAttack();
Symbol 601 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
_root.addSound("swing_f_03.wav", 120, 0, 0);
Symbol 601 MovieClip Frame 3
_root.player.velX = _root.player.dirX;
_root.playerAttack("att_f_3");
Symbol 601 MovieClip Frame 5
_root.player.velX = 0;
Symbol 601 MovieClip Frame 9
_root.endAttack();
Symbol 605 MovieClip Frame 1
_root.playerAttack("attack_jump");
Symbol 605 MovieClip Frame 4
stop();
Symbol 610 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 610 MovieClip Frame 5
_root.addSound("swing_s_01.wav", 90, 0, 0);
Symbol 610 MovieClip Frame 7
_root.player.velX = _root.player.dirX * 4;
_root.playerAttack("att_s");
Symbol 610 MovieClip Frame 8
_root.player.velX = 0;
Symbol 610 MovieClip Frame 13
_root.endAttack();
Symbol 618 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 618 MovieClip Frame 3
_root.addSound("swing_s_02.wav", 80, 0, 0);
Symbol 618 MovieClip Frame 5
_root.player.velX = _root.player.dirX * 4;
_root.playerAttack("att_s_run");
Symbol 618 MovieClip Frame 6
_root.player.velX = 0;
Symbol 618 MovieClip Frame 13
_root.endAttack();
Symbol 626 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 626 MovieClip Frame 5
_root.addStepSound();
Symbol 626 MovieClip Frame 8
_root.addStepSound();
Symbol 632 MovieClip Frame 1
stop();
Symbol 632 MovieClip Frame 5
stop();
Symbol 636 MovieClip Frame 3
stop();
Symbol 647 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 647 MovieClip Frame 6
stop();
Symbol 651 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 651 MovieClip Frame 5
stop();
Symbol 661 MovieClip Frame 5
_root.addSound(("kick_0" + Math.round((Math.random() * 1) + 1)) + ".wav", 70, 0, 0);
Symbol 661 MovieClip Frame 6
_root.attack_pickup();
Symbol 661 MovieClip Frame 12
_root.attack_pickup_done();
Symbol 667 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 667 MovieClip Frame 2
_root.addSound(("kick_0" + Math.round((Math.random() * 1) + 1)) + ".wav", 70, 0, 0);
Symbol 667 MovieClip Frame 4
_root.kick();
Symbol 671 MovieClip Frame 5
_root.addEffect_sparks(_root.player);
gotoAndPlay ("loop");
Symbol 676 MovieClip Frame 10
_root.contest_win();
Symbol 687 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 687 MovieClip Frame 5
_root.addSound("finishing_01.wav", 75, 0, 0);
_root.setCameraShake(5, 4);
Symbol 687 MovieClip Frame 18
_root.addSound("hitFlesh_01.wav", 100, 0, 0);
Symbol 687 MovieClip Frame 42
_root.finishing_end();
Symbol 698 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 698 MovieClip Frame 8
_root.addSound("finishing_04.wav", 100, 0, 0);
Symbol 698 MovieClip Frame 9
_root.setCameraShake(5, 4);
Symbol 698 MovieClip Frame 23
_root.finishing_end();
Symbol 710 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 710 MovieClip Frame 8
_root.finishingJumpyRage();
Symbol 710 MovieClip Frame 15
_root.finishing_end();
Symbol 717 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 717 MovieClip Frame 5
_root.addSound("swing_s_03.wav", 65, 0, 0);
Symbol 717 MovieClip Frame 6
_root.setCameraShake(5, 4);
Symbol 717 MovieClip Frame 7
_root.finishingJumpy();
Symbol 717 MovieClip Frame 13
_root.finishing_end();
Symbol 724 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 724 MovieClip Frame 5
_root.addSound("swing_s_03.wav", 65, 0, 0);
Symbol 724 MovieClip Frame 6
_root.setCameraShake(5, 4);
Symbol 724 MovieClip Frame 7
_root.finishingJumpyRage();
Symbol 724 MovieClip Frame 13
_root.finishing_end();
Symbol 734 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 734 MovieClip Frame 7
_root.setCameraShake(5, 5);
_root.decap();
Symbol 734 MovieClip Frame 13
_root.finishing_end();
Symbol 762 MovieClip Frame 62
stop();
Symbol 786 MovieClip Frame 34
stop();
Symbol 802 MovieClip Frame 9
stop();
Symbol 814 MovieClip Frame 1
stop();
Symbol 814 MovieClip Frame 5
stop();
Symbol 832 MovieClip Frame 17
stop();
Symbol 838 MovieClip Frame 3
gotoAndPlay (2);
Symbol 849 MovieClip Frame 7
stop();
Symbol 850 MovieClip [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();
}
};
Symbol 855 MovieClip [skel_blood] Frame 8
stop();
Symbol 859 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 868 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 868 MovieClip Frame 5
_root.addSound("swing_02.wav", 100, 0, 0);
Symbol 879 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 885 MovieClip Frame 6
gotoAndPlay (1);
Symbol 885 MovieClip Frame 9
stop();
Symbol 894 MovieClip Frame 6
gotoAndPlay (1);
Symbol 905 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 919 MovieClip [blood_squirt] Frame 1
_root.addSound("blood_squirt_01.wav", 80, 0, 0);
Symbol 919 MovieClip [blood_squirt] Frame 13
stop();
Symbol 934 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 934 MovieClip Frame 10
_root.addBloodstain(_root.player.posX + 30, _root.player.posY - 10);
_root.addBloodstain(_root.player.posX - 30, _root.player.posY - 10);
Symbol 948 MovieClip [blood_s_02] Frame 8
stop();
Symbol 956 MovieClip [blood_s_01] Frame 9
stop();
Symbol 968 MovieClip [blood_s_03] Frame 9
stop();
Symbol 976 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 976 MovieClip 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);
Symbol 989 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 994 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 999 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 1030 MovieClip Frame 29
stop();
Symbol 1049 MovieClip Frame 15
stop();
Symbol 1074 MovieClip Frame 34
stop();
Symbol 1078 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 1083 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 1087 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 1087 MovieClip Frame 3
_root.addSound("swing_02.wav", 100, 0, 0);
Symbol 1094 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 1094 MovieClip Frame 4
_root.addSound("swing_01.wav", 100, 0, 0);
Symbol 1103 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 1109 MovieClip Frame 4
gotoAndPlay (1);
Symbol 1109 MovieClip Frame 7
stop();
Symbol 1114 MovieClip Frame 4
stop();
Symbol 1118 MovieClip Frame 3
stop();
Symbol 1124 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 1124 MovieClip Frame 3
_root.addSound("swing_02.wav", 100, 0, 0);
Symbol 1129 MovieClip Frame 1
stop();
Symbol 1137 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 1137 MovieClip Frame 7
_root.addSound("swing_s_03.wav", 70, 0, 0);
Symbol 1141 MovieClip Frame 5
gotoAndPlay ("loop");
Symbol 1153 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 1153 MovieClip 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);
Symbol 1156 MovieClip Frame 4
gotoAndPlay (1);
Symbol 1165 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 1184 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 1184 MovieClip Frame 10
_root.addBloodstain(_root.player.posX + 30, _root.player.posY - 10);
_root.addBloodstain(_root.player.posX - 30, _root.player.posY - 10);
Symbol 1184 MovieClip Frame 34
stop();
Symbol 1187 MovieClip Frame 4
gotoAndPlay (1);
Symbol 1196 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 1208 MovieClip Frame 12
stop();
Symbol 1238 MovieClip Frame 48
stop();
Symbol 1247 MovieClip Frame 12
stop();
Symbol 1278 MovieClip Frame 20
_parent.gotoAndStop("idle");
Symbol 1284 MovieClip [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();
}
};
Symbol 1294 MovieClip Frame 17
stop();
Symbol 1298 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 1303 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 1314 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 1323 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 1330 MovieClip Frame 4
gotoAndPlay (1);
Symbol 1330 MovieClip Frame 7
stop();
Symbol 1337 MovieClip Frame 1
stop();
Symbol 1343 MovieClip Frame 4
gotoAndPlay (1);
Symbol 1352 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 1375 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 1375 MovieClip Frame 11
_root.addBloodstain(_root.player.posX + 30, _root.player.posY - 10);
_root.addBloodstain(_root.player.posX - 30, _root.player.posY - 10);
Symbol 1375 MovieClip Frame 34
stop();
Symbol 1385 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 1385 MovieClip 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);
Symbol 1392 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.game.isPaused) {
stop();
} else {
play();
}
};
Symbol 1393 MovieClip [Actor_OrcArcher] Frame 1
var _paused = false;
this.onEnterFrame = function () {
if (_root.game.isPaused) {
mc.stop();
_paused = true;
} else if (_paused) {
_paused = false;
mc.play();
}
};
Symbol 1416 MovieClip Frame 20
stop();
Symbol 1430 MovieClip Frame 11
stop();
Symbol 1449 MovieClip Frame 45
stop();
Symbol 1463 MovieClip Frame 14
stop();
Symbol 1503 MovieClip Frame 13
stop();
Symbol 1504 MovieClip [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();
}
};
Symbol 1510 MovieClip [land_water] Frame 7
stop();
Symbol 1523 MovieClip Frame 19
stop();
Symbol 1543 MovieClip [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();
}
};
Symbol 1591 MovieClip Frame 1
_root.changeBossPlateHP(0, 1);
Symbol 1591 MovieClip 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);
Symbol 1591 MovieClip Frame 39
gotoAndPlay ("loop");
Symbol 1611 MovieClip [land_dirt] Frame 10
stop();
Symbol 1617 MovieClip [jump_dirt] Frame 10
stop();
Symbol 1625 MovieClip Frame 30
_root.setCameraShake(6, 6);
Symbol 1637 MovieClip Frame 2
_root.BOSS_TROLL_pickup();
Symbol 1637 MovieClip Frame 3
_root.BOSS_TROLL_pickup();
Symbol 1637 MovieClip Frame 4
_root.BOSS_TROLL_pickup();
Symbol 1637 MovieClip Frame 15
_root.BOSS_TROLL_pickup();
Symbol 1637 MovieClip Frame 16
_root.BOSS_TROLL_pickup();
Symbol 1637 MovieClip Frame 27
stop();
Symbol 1697 MovieClip Frame 1
_root.changeBossPlateHP(0, 1);
Symbol 1697 MovieClip Frame 49
_root.BOSS_TROLL_DEAD_HIT_MTDAM();
Symbol 1697 MovieClip Frame 66
stop();
Symbol 1726 MovieClip Frame 5
stop();
Symbol 1728 MovieClip Frame 1
_root.setCameraShake(6, 6);
Symbol 1728 MovieClip Frame 27
_root.setCameraShake(6, 6);
Symbol 1728 MovieClip Frame 34
stop();
Symbol 1729 MovieClip [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();
}
};
Symbol 1733 MovieClip [boss_troll_stone_01] Frame 26
_root.BOSS_TROLL_stoneImpact();
Symbol 1733 MovieClip [boss_troll_stone_01] Frame 27
stop();
Symbol 1746 MovieClip [barrel_explosion] Frame 26
stop();
Symbol 1752 MovieClip [barrel_part_trail_01] Frame 11
stop();
Symbol 1758 MovieClip [barrel_part_trail_02] Frame 11
stop();
Symbol 1764 MovieClip [barrel_part_trail_03] Frame 11
stop();
Symbol 1769 MovieClip [bash_effect] Frame 8
stop();
Symbol 1778 MovieClip [blood_fire_01] Frame 13
stop();
Symbol 1787 MovieClip [blood_fire_02] Frame 14
stop();
Symbol 1794 MovieClip [blood_gib_01] Frame 8
stop();
Symbol 1797 MovieClip [bloodstain_01] Frame 2
stop();
Symbol 1800 MovieClip [bloodstain_02] Frame 2
stop();
Symbol 1803 MovieClip [bloodstain_03] Frame 2
stop();
Symbol 1823 MovieClip [bloodstain_water_01] Frame 31
stop();
Symbol 1839 MovieClip [bloodstain_water_02] Frame 28
stop();
Symbol 1856 MovieClip [bloodstain_water_03] Frame 28
stop();
Symbol 1868 MovieClip Frame 13
stop();
Symbol 1874 MovieClip [impact_smoke] Frame 10
stop();
Symbol 1881 MovieClip [jump_snow] Frame 10
stop();
Symbol 1885 MovieClip [jump_water] Frame 10
stop();
Symbol 1893 MovieClip [knockdown_dirt] Frame 11
stop();
Symbol 1898 MovieClip [knockdown_water] Frame 7
stop();
Symbol 1904 MovieClip [land_snow] Frame 7
stop();
Symbol 1910 MovieClip [matchwood] Frame 10
stop();
Symbol 1916 MovieClip [matchwood_l] Frame 10
stop();
Symbol 1924 MovieClip [sparks_01] Frame 9
stop();
Symbol 1932 MovieClip [sparks_02] Frame 9
stop();
Symbol 1940 MovieClip [sparks_03] Frame 9
stop();
Symbol 1945 MovieClip [knockdown_snow] Frame 6
stop();
Symbol 1954 MovieClip [blood_slime_01] Frame 9
stop();
Symbol 1962 MovieClip [blood_slime_02] Frame 8
stop();
Symbol 1970 MovieClip [blood_slime_03] Frame 9
stop();
Symbol 2032 MovieClip Frame 2
stop();
Symbol 2034 MovieClip Frame 2
stop();
Symbol 2036 MovieClip Frame 2
stop();
Symbol 2038 MovieClip Frame 2
stop();
Symbol 2040 MovieClip Frame 2
stop();
Symbol 2041 MovieClip [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", -1, "nothing");
}
function lvl01_zoneEnd_wave01dead() {
_root.levelFinished();
}
function lvl01_enemy01dead() {
_root.setMaxCamPos(this.region_border_max_1);
this.jumpTutorial._x = this.jumpTutorial._x - 200;
}
_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.setAmbientSound("windAmbient.wav", 100);
Instance of Symbol 2034 MovieClip in Symbol 2041 MovieClip [level_01] Frame 1
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 Symbol 2034 MovieClip in Symbol 2041 MovieClip [level_01] Frame 1
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 Symbol 2036 MovieClip in Symbol 2041 MovieClip [level_01] Frame 1
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 Symbol 2034 MovieClip in Symbol 2041 MovieClip [level_01] Frame 1
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 Symbol 1259 MovieClip in Symbol 2041 MovieClip [level_01] Frame 1
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 Symbol 1259 MovieClip in Symbol 2041 MovieClip [level_01] Frame 1
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 Symbol 1259 MovieClip in Symbol 2041 MovieClip [level_01] Frame 1
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 Symbol 159 MovieClip in Symbol 2041 MovieClip [level_01] Frame 1
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 = this._x - 5000;
}
}
Instance of Symbol 2040 MovieClip "first_skeleton" in Symbol 2041 MovieClip [level_01] Frame 1
/* no clip actions */
Instance of Symbol 159 MovieClip in Symbol 2041 MovieClip [level_01] Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) {
this._x = 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 Symbol 159 MovieClip in Symbol 2041 MovieClip [level_01] Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) {
_root.showTutorial(2);
this._x = this._x - 5000;
}
}
Instance of Symbol 159 MovieClip in Symbol 2041 MovieClip [level_01] Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) {
_root.showTutorial(3);
this._x = this._x - 5000;
}
}
Instance of Symbol 159 MovieClip "jumpTutorial" in Symbol 2041 MovieClip [level_01] Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) {
_root.showTutorial(4);
this._x = this._x - 5000;
}
}
Instance of Symbol 1259 MovieClip in Symbol 2041 MovieClip [level_01] Frame 1
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 Symbol 1259 MovieClip in Symbol 2041 MovieClip [level_01] Frame 1
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 Symbol 159 MovieClip in Symbol 2041 MovieClip [level_01] Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) {
_root.addSound("crow_01.wav", 50, 0, 0);
this._x = this._x - 5000;
}
}
Instance of Symbol 261 MovieClip [food_crate] in Symbol 2041 MovieClip [level_01] Frame 1
onClipEvent (enterFrame) {
if (this._alpha == 100) {
_root.spawnFoodCrate(this._x, this._y, 1);
this._alpha = 0;
}
}
Instance of Symbol 237 MovieClip [barrel] in Symbol 2041 MovieClip [level_01] Frame 1
onClipEvent (enterFrame) {
if ((_root.player.clip._x > (this._x - 640)) and (this._alpha == 100)) {
_root.spawnBarrel(this, "/HP-70/explosive-0/");
this._y = this._y - 5000;
this._alpha = 0;
}
}
Symbol 2117 MovieClip [Level_02] Frame 1
function lvl02_zoneWaterEnd_wave01dead() {
_root.spawnEnemy(this.marker_right, "ARCHER_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, "ARCHER_1", 1, "/waveID-lvl02_zoneEnd_wave01/onDeathRunScript-lvl02_zoneEnd_wave01dead/");
_root.spawnEnemy(this.marker_last_enemies, "ARCHER_1", 1, "/waveID-lvl02_zoneEnd_wave01/onDeathRunScript-lvl02_zoneEnd_wave01dead/");
_root.spawnEnemy(this.marker_last_enemies, "SPEARMAN_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/");
_root.spawnEnemy(this.burning_house_right, "ARCHER_1", 1, "/waveID-lvl02_zoneBurningHouse_wave02/onDeathRunScript-lvl02_zoneBurningHouse_wave02dead/");
}
function lvl02_zoneBurningHouse_wave02dead() {
_root.spawnEnemy(this.burning_house_right, "SWORDSMAN_1", 1, "/waveID-lvl02_zoneBurningHouse_wave03/onDeathRunScript-lvl02_zoneBurningHouse_wave03dead/");
_root.spawnEnemy(this.burning_house_right, "ARCHER_1", 1, "/waveID-lvl02_zoneBurningHouse_wave03/onDeathRunScript-lvl02_zoneBurningHouse_wave03dead/");
}
function lvl02_zoneBurningHouse_wave03dead() {
_root.setMaxCamPos(this.region_border_max_1);
}
function changeSound(point, maxDist, maxVol) {
var _local2 = _root.player.posX - point;
if (Math.sqrt(_local2 * _local2) < maxDist) {
sound_fire_1.setVolume(((maxDist - Math.sqrt(_local2 * _local2)) / maxDist) * maxVol);
sound_fire_1.setPan(-(_local2 / (maxDist / 100)));
}
}
_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.setAmbientSound("windAmbient.wav", 100);
_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);
changeSound(this.fire_2._x, 250, 75);
};
Instance of Symbol 159 MovieClip in Symbol 2117 MovieClip [Level_02] Frame 1
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 = this._x - 5000;
}
}
Instance of Symbol 2034 MovieClip in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 2034 MovieClip in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 2036 MovieClip in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 2036 MovieClip in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 2034 MovieClip in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 2034 MovieClip in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 2034 MovieClip in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 2034 MovieClip in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 2034 MovieClip in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 2036 MovieClip in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 1259 MovieClip in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 1259 MovieClip in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 1259 MovieClip in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 1259 MovieClip in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 1259 MovieClip in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 1283 MovieClip in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 159 MovieClip in Symbol 2117 MovieClip [Level_02] Frame 1
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 = this._x - 5000;
}
}
Instance of Symbol 237 MovieClip [barrel] in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 261 MovieClip [food_crate] in Symbol 2117 MovieClip [Level_02] Frame 1
onClipEvent (enterFrame) {
if (this._alpha == 100) {
_root.spawnFoodCrate(this._x, this._y, 1);
this._alpha = 0;
}
}
Instance of Symbol 237 MovieClip [barrel] in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 2034 MovieClip in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 1283 MovieClip in Symbol 2117 MovieClip [Level_02] Frame 1
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 Symbol 1259 MovieClip in Symbol 2117 MovieClip [Level_02] Frame 1
onClipEvent (enterFrame) {
if ((_root.player.clip._x > (this._x - 140)) and (this._alpha == 100)) {
_root.spawnEnemy(this, "CROW_1", 1, "nothing");
this._alpha = 0;
}
}
Symbol 2131 MovieClip [Level_03] Frame 1
function lvl03_zoneBurningHouse_wave01dead() {
_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, "SPEARMAN_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 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/");
}
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, "SPEARMAN_1", -1, "/waveID-lvl03_zoneEnd_wave03/onDeathRunScript-lvl03_zoneEnd_wave03dead/");
}
function lvl03_zoneEnd_wave03dead() {
_root.levelFinished();
}
function changeSound(point, maxDist, maxVol) {
var _local2 = _root.player.posX - point;
if (Math.sqrt(_local2 * _local2) < maxDist) {
sound_fire_1.setVolume(((maxDist - Math.sqrt(_local2 * _local2)) / maxDist) * maxVol);
sound_fire_1.setPan(-(_local2 / (maxDist / 100)));
}
}
_root.spawnPlayer(this.playerSpawnPoint);
_root.setMinCamPos(this.region_border_min_1);
_root.setMaxCamPos(this.region_border_max_1);
this.groundCollision._alpha = 0;
_root.setAmbientSound("windAmbient.wav", 100);
_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 Symbol 2034 MovieClip in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 2034 MovieClip in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 2034 MovieClip in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 2034 MovieClip in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 2034 MovieClip in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 1259 MovieClip in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 1259 MovieClip in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 1259 MovieClip in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 1259 MovieClip in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 1259 MovieClip in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 159 MovieClip in Symbol 2131 MovieClip [Level_03] Frame 1
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/");
this._x = this._x - 5000;
}
}
Instance of Symbol 2034 MovieClip in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 2036 MovieClip in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 159 MovieClip in Symbol 2131 MovieClip [Level_03] Frame 1
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/");
this._x = this._x - 5000;
}
}
Instance of Symbol 2034 MovieClip in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 2036 MovieClip in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 2040 MovieClip in Symbol 2131 MovieClip [Level_03] Frame 1
onClipEvent (enterFrame) {
if ((_root.player.clip._x > (this._x - 100)) and (this._alpha == 100)) {
_root.spawnEnemy(this, "SKELETON_1", -1, "/waveID-lvl01_zoneCave_wave01/onDeathRunScript-lvl01_zoneCave_wave01dead/");
this._alpha = 0;
}
}
Instance of Symbol 159 MovieClip in Symbol 2131 MovieClip [Level_03] Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.posX + _root.camPos.difX, _root.player.posY + _root.camPos.difY, true)) {
_root.showTutorial(13);
this._x = this._x - 5000;
}
}
Instance of Symbol 237 MovieClip [barrel] in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 261 MovieClip [food_crate] in Symbol 2131 MovieClip [Level_03] Frame 1
onClipEvent (enterFrame) {
if (this._alpha == 100) {
_root.spawnFoodCrate(this._x, this._y, 1);
this._alpha = 0;
}
}
Instance of Symbol 237 MovieClip [barrel] in Symbol 2131 MovieClip [Level_03] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2131 MovieClip [Level_03] Frame 1
onClipEvent (enterFrame) {
if ((_root.player.clip._x > (this._x - 640)) and (this._alpha == 100)) {
_root.spawnBarrel(this, "/HP-100/explosive-0/");
this._alpha = 0;
}
}
Symbol 2161 MovieClip Frame 2
stop();
Symbol 2162 MovieClip [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, "SPEARMAN_1", -1, "/waveID-lvl04_zoneFirst_wave02/onDeathRunScript-lvl04_zoneFirst_wave02dead/");
}
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, "ARCHER_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 = this.archer_end_trigger._y + 500;
}
function lvl04_zoneLast_wave02dead() {
_root.spawnEnemy(this.archer_2, "SKELETON_1", 1, "/waveID-lvl04_zoneLast_wave03/onDeathRunScript-lvl04_zoneLast_wave03dead/");
_root.spawnEnemy(this.marker_left_2_0, "SKELETON_1", 1, "/waveID-lvl04_zoneLast_wave03/onDeathRunScript-lvl04_zoneLast_wave03dead/");
}
function lvl04_zoneLast_wave03dead() {
_root.levelFinished();
}
function changeSound(point, maxDist, maxVol) {
var _local2 = _root.player.posX - point;
if (Math.sqrt(_local2 * _local2) < maxDist) {
sound_fire_1.setVolume(((maxDist - Math.sqrt(_local2 * _local2)) / maxDist) * maxVol);
sound_fire_1.setPan(-(_local2 / (maxDist / 100)));
}
}
_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.setAmbientSound("caveWindAmbience.wav", 45);
_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 Symbol 2040 MovieClip in Symbol 2162 MovieClip [Level_04] Frame 1
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 Symbol 2034 MovieClip in Symbol 2162 MovieClip [Level_04] Frame 1
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 Symbol 2034 MovieClip in Symbol 2162 MovieClip [Level_04] Frame 1
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 Symbol 159 MovieClip in Symbol 2162 MovieClip [Level_04] Frame 1
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/");
this._x = this._x - 5000;
}
}
Instance of Symbol 2034 MovieClip in Symbol 2162 MovieClip [Level_04] Frame 1
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 Symbol 2161 MovieClip in Symbol 2162 MovieClip [Level_04] Frame 1
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 Symbol 2161 MovieClip in Symbol 2162 MovieClip [Level_04] Frame 1
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 Symbol 2036 MovieClip in Symbol 2162 MovieClip [Level_04] Frame 1
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 Symbol 2034 MovieClip in Symbol 2162 MovieClip [Level_04] Frame 1
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 Symbol 159 MovieClip in Symbol 2162 MovieClip [Level_04] Frame 1
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", -1, "/waveID-lvl04_zoneLast_wave01/onDeathRunScript-lvl04_zoneLast_wave01dead/");
_root.spawnEnemy(_parent.archer_3, "ARCHER_1", -1, "/waveID-lvl04_zoneLast_wave01/onDeathRunScript-lvl04_zoneLast_wave01dead/");
this._x = this._x - 5000;
}
}
Instance of Symbol 2036 MovieClip in Symbol 2162 MovieClip [Level_04] Frame 1
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 Symbol 2036 MovieClip in Symbol 2162 MovieClip [Level_04] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2162 MovieClip [Level_04] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2162 MovieClip [Level_04] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2162 MovieClip [Level_04] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2162 MovieClip [Level_04] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2162 MovieClip [Level_04] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2162 MovieClip [Level_04] Frame 1
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 Symbol 159 MovieClip "archer_end_trigger" in Symbol 2162 MovieClip [Level_04] Frame 1
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 = this._x - 5000;
}
}
Instance of Symbol 237 MovieClip [barrel] in Symbol 2162 MovieClip [Level_04] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2162 MovieClip [Level_04] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2162 MovieClip [Level_04] Frame 1
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 Symbol 261 MovieClip [food_crate] in Symbol 2162 MovieClip [Level_04] Frame 1
onClipEvent (enterFrame) {
if (this._alpha == 100) {
_root.spawnFoodCrate(this._x, this._y, 1);
this._alpha = 0;
}
}
Instance of Symbol 261 MovieClip [food_crate] in Symbol 2162 MovieClip [Level_04] Frame 1
onClipEvent (enterFrame) {
if (this._alpha == 100) {
_root.spawnFoodCrate(this._x, this._y, 1);
this._alpha = 0;
}
}
Instance of Symbol 2036 MovieClip in Symbol 2162 MovieClip [Level_04] Frame 1
onClipEvent (enterFrame) {
if ((_root.player.clip._x > (this._x - 640)) and (this._alpha == 100)) {
_root.spawnEnemy(this, "ARCHER_1", -1, "nothing");
this._alpha = 0;
}
}
Symbol 2183 MovieClip [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_left, "SWORDSMAN_1", -1, "/waveID-lvl05_wave2/onDeathRunScript-lvl05_wave2dead/");
}
function lvl05_wave2dead() {
_root.spawnEnemy(this.mark_1_right, "SKELETON_1", -1, "/waveID-lvl05_wave3/onDeathRunScript-lvl05_wave3dead/");
_root.spawnEnemy(this.mark_1_left, "SKELETON_1", 1, "/waveID-lvl05_wave3/onDeathRunScript-lvl05_wave3dead/");
}
function lvl05_wave3dead() {
_root.spawnEnemy(this.mark_1_right, "ARCHER_1", -1, "/waveID-lvl05_wave4/onDeathRunScript-lvl05_wave4dead/");
_root.spawnEnemy(this.mark_1_left, "SPEARMAN_1", 1, "/waveID-lvl05_wave4/onDeathRunScript-lvl05_wave4dead/");
_root.spawnEnemy(this.mark_1_left, "SWORDSMAN_1", 1, "/waveID-lvl05_wave4/onDeathRunScript-lvl05_wave4dead/");
}
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() {
_root.setMaxCamPos(this.region_border_max_1);
}
function lvl05_wave10dead() {
_root.spawnEnemy(this.skel_1, "SKELETON_1", 1, "/waveID-lvl05_wave11/onDeathRunScript-lvl05_wave11dead/");
}
function lvl05_wave11dead() {
_root.spawnEnemy(this.mark_2_right, "SWORDSMAN_1", 1, "/waveID-lvl05_wave12/onDeathRunScript-lvl05_wave12dead/");
_root.spawnEnemy(this.mark_2_left, "SWORDSMAN_1", -1, "/waveID-lvl05_wave12/onDeathRunScript-lvl05_wave12dead/");
}
function lvl05_wave12dead() {
_root.spawnEnemy(this.skel_1, "SKELETON_1", 1, "/waveID-lvl05_wave13/onDeathRunScript-lvl05_wave13dead/");
_root.spawnEnemy(this.mark_2_right, "SKELETON_1", 1, "/waveID-lvl05_wave13/onDeathRunScript-lvl05_wave13dead/");
_root.spawnEnemy(this.mark_2_left, "SKELETON_1", -1, "/waveID-lvl05_wave13/onDeathRunScript-lvl05_wave13dead/");
}
function lvl05_wave13dead() {
_root.levelFinished();
}
function changeSound(point, maxDist, maxVol) {
var _local2 = _root.player.posX - point;
if (Math.sqrt(_local2 * _local2) < maxDist) {
sound_fire_1.setVolume(((maxDist - Math.sqrt(_local2 * _local2)) / maxDist) * maxVol);
sound_fire_1.setPan(-(_local2 / (maxDist / 100)));
}
}
_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.setAmbientSound("caveWindAmbience.wav", 45);
_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, 250, 75);
};
Instance of Symbol 159 MovieClip in Symbol 2183 MovieClip [Level_05] Frame 1
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/");
this._x = this._x - 5000;
}
}
Instance of Symbol 159 MovieClip in Symbol 2183 MovieClip [Level_05] Frame 1
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 = this._x - 5000;
}
}
Instance of Symbol 2036 MovieClip in Symbol 2183 MovieClip [Level_05] Frame 1
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 Symbol 2161 MovieClip in Symbol 2183 MovieClip [Level_05] Frame 1
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 Symbol 2034 MovieClip in Symbol 2183 MovieClip [Level_05] Frame 1
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 Symbol 2161 MovieClip in Symbol 2183 MovieClip [Level_05] Frame 1
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 Symbol 2034 MovieClip in Symbol 2183 MovieClip [Level_05] Frame 1
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 Symbol 2040 MovieClip in Symbol 2183 MovieClip [Level_05] Frame 1
onClipEvent (enterFrame) {
if ((_root.player.clip._x > (this._x - 60)) and (this._alpha == 100)) {
_root.spawnEnemy(this, "SKELETON_1", -1, "");
this._alpha = 0;
}
}
Instance of Symbol 2040 MovieClip in Symbol 2183 MovieClip [Level_05] Frame 1
onClipEvent (enterFrame) {
if ((_root.player.clip._x > (this._x - 100)) and (this._alpha == 100)) {
_root.spawnEnemy(this, "SKELETON_1", -1, "");
this._alpha = 0;
}
}
Instance of Symbol 159 MovieClip in Symbol 2183 MovieClip [Level_05] Frame 1
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 = this._x - 5000;
}
}
Instance of Symbol 2034 MovieClip in Symbol 2183 MovieClip [Level_05] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2183 MovieClip [Level_05] Frame 1
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 Symbol 2034 MovieClip in Symbol 2183 MovieClip [Level_05] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2183 MovieClip [Level_05] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2183 MovieClip [Level_05] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2183 MovieClip [Level_05] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2183 MovieClip [Level_05] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2183 MovieClip [Level_05] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2183 MovieClip [Level_05] Frame 1
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 Symbol 159 MovieClip in Symbol 2183 MovieClip [Level_05] Frame 1
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, "ARCHER_1", 1, "/waveID-lvl05_wave10/onDeathRunScript-lvl05_wave10dead/");
_root.spawnEnemy(_parent.mark_2_left, "SPEARMAN_1", -1, "/waveID-lvl05_wave10/onDeathRunScript-lvl05_wave10dead/");
this._x = this._x - 5000;
}
}
Instance of Symbol 2036 MovieClip in Symbol 2183 MovieClip [Level_05] Frame 1
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 Symbol 2034 MovieClip in Symbol 2183 MovieClip [Level_05] Frame 1
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 Symbol 2034 MovieClip in Symbol 2183 MovieClip [Level_05] Frame 1
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 Symbol 2034 MovieClip in Symbol 2183 MovieClip [Level_05] Frame 1
onClipEvent (enterFrame) {
if ((_root.player.clip._x > (this._x - 450)) and (this._alpha == 100)) {
_root.spawnEnemy(this, "SWORDSMAN_1", 1, "nothing");
this._alpha = 0;
}
}
Instance of Symbol 261 MovieClip [food_crate] in Symbol 2183 MovieClip [Level_05] Frame 1
onClipEvent (enterFrame) {
if (this._alpha == 100) {
_root.spawnFoodCrate(this._x, this._y, 1);
this._alpha = 0;
}
}
Instance of Symbol 237 MovieClip [barrel] in Symbol 2183 MovieClip [Level_05] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2183 MovieClip [Level_05] Frame 1
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 Symbol 261 MovieClip [food_crate] in Symbol 2183 MovieClip [Level_05] Frame 1
onClipEvent (enterFrame) {
if (this._alpha == 100) {
_root.spawnFoodCrate(this._x, this._y, 1);
this._alpha = 0;
}
}
Instance of Symbol 237 MovieClip [barrel] in Symbol 2183 MovieClip [Level_05] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2183 MovieClip [Level_05] Frame 1
onClipEvent (enterFrame) {
if ((_root.player.clip._x > (this._x - 640)) and (this._alpha == 100)) {
_root.spawnBarrel(this, "/HP-50/explosive-0/");
this._alpha = 0;
}
}
Symbol 2227 MovieClip Frame 1
stop();
Symbol 2227 MovieClip Frame 2
_root.setCameraShake(100, 8);
Symbol 2227 MovieClip Frame 23
stop();
Symbol 2235 MovieClip Frame 10
gotoAndPlay (1);
Symbol 2242 MovieClip [Level_06] Frame 1
function w1Death() {
_root.spawnEnemy(this.mark_1_0, "SWORDSMAN_1", 1, "/waveID-w2/onDeathRunScript-w2Death/");
_root.spawnEnemy(this.mark_1_1, "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, "SPEARMAN_1", 1, "/waveID-w2/onDeathRunScript-w2Death/");
}
function w2Death() {
_root.spawnEnemy(this.mark_2_1, "SKELETON_1", -1, "/waveID-w3/onDeathRunScript-w3Death/");
_root.spawnEnemy(this.mark_S_1, "SKELETON_1", -1, "/waveID-w3/onDeathRunScript-w3Death/");
_root.spawnEnemy(this.mark_S_0, "SKELETON_1", 1, "/waveID-w3/onDeathRunScript-w3Death/");
}
function w3Death() {
_root.spawnEnemy(this.mark_1_1, "SWORDSMAN_1", -1, "/waveID-w4/onDeathRunScript-w4Death/");
_root.spawnEnemy(this.mark_up_2, "SWORDSMAN_1", -1, "/waveID-w4/onDeathRunScript-w4Death/");
_root.spawnEnemy(this.mark_up_2, "SWORDSMAN_1", -1, "/waveID-w4/onDeathRunScript-w4Death/");
_root.spawnEnemy(this.mark_2_1, "ARCHER_1", -1, "/waveID-w4/onDeathRunScript-w4Death/");
_root.spawnEnemy(this.mark_2_0, "SWORDSMAN_1", -1, "/waveID-w4/onDeathRunScript-w4Death/");
}
function w4Death() {
_root.setMaxCamPos(this.region_border_max_1);
}
_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.setAmbientSound("caveWindAmbience.wav", 45);
Instance of Symbol 159 MovieClip in Symbol 2242 MovieClip [Level_06] Frame 1
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.setBossSound("boss_loop_1", 80);
_root.showBossPlate("troll");
this._x = this._x - 5000;
}
}
Instance of Symbol 1595 MovieClip in Symbol 2242 MovieClip [Level_06] Frame 1
onClipEvent (enterFrame) {
if ((_root.player.clip._x > (this._x - 640)) and (this._alpha == 100)) {
_root.spawnEnemy(this, "BOSS_TROLL", 1, "nothing");
this._y = this._y - 1000;
this._alpha = 0;
}
}
Instance of Symbol 2034 MovieClip in Symbol 2242 MovieClip [Level_06] Frame 1
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 Symbol 2034 MovieClip in Symbol 2242 MovieClip [Level_06] Frame 1
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 Symbol 2034 MovieClip in Symbol 2242 MovieClip [Level_06] Frame 1
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 Symbol 159 MovieClip in Symbol 2242 MovieClip [Level_06] Frame 1
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 = this._x - 5000;
}
}
Instance of Symbol 159 MovieClip in Symbol 2242 MovieClip [Level_06] Frame 1
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 = this._x - 5000;
}
}
Instance of Symbol 2036 MovieClip in Symbol 2242 MovieClip [Level_06] Frame 1
onClipEvent (enterFrame) {
if ((_root.player.clip._x > (this._x - 370)) and (this._alpha == 100)) {
_root.spawnEnemy(this, "ARCHER_1", -1, "nothing");
this._alpha = 0;
}
}
Instance of Symbol 2036 MovieClip in Symbol 2242 MovieClip [Level_06] Frame 1
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 Symbol 2034 MovieClip in Symbol 2242 MovieClip [Level_06] Frame 1
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 Symbol 2161 MovieClip in Symbol 2242 MovieClip [Level_06] Frame 1
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 Symbol 2161 MovieClip in Symbol 2242 MovieClip [Level_06] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2242 MovieClip [Level_06] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2242 MovieClip [Level_06] Frame 1
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 Symbol 2034 MovieClip in Symbol 2242 MovieClip [Level_06] Frame 1
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 Symbol 2034 MovieClip in Symbol 2242 MovieClip [Level_06] Frame 1
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 Symbol 261 MovieClip [food_crate] in Symbol 2242 MovieClip [Level_06] Frame 1
onClipEvent (enterFrame) {
if (this._alpha == 100) {
_root.spawnFoodCrate(this._x, this._y, 1);
this._alpha = 0;
}
}
Instance of Symbol 261 MovieClip [food_crate] in Symbol 2242 MovieClip [Level_06] Frame 1
onClipEvent (enterFrame) {
if (this._alpha == 100) {
_root.spawnFoodCrate(this._x, this._y, 2);
this._alpha = 0;
}
}
Instance of Symbol 159 MovieClip in Symbol 2242 MovieClip [Level_06] Frame 1
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_0, "SPEARMAN_1", 1, "/waveID-w1/onDeathRunScript-w1Death/");
_root.spawnEnemy(_parent.mark_1_1, "SPEARMAN_1", 1, "/waveID-w1/onDeathRunScript-w1Death/");
_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 = this._x - 5000;
}
}
Instance of Symbol 237 MovieClip [barrel] in Symbol 2242 MovieClip [Level_06] Frame 1
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 Symbol 2034 MovieClip in Symbol 2242 MovieClip [Level_06] Frame 1
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 Symbol 261 MovieClip [food_crate] in Symbol 2242 MovieClip [Level_06] Frame 1
onClipEvent (enterFrame) {
if (this._alpha == 100) {
_root.spawnFoodCrate(this._x, this._y, 1);
this._alpha = 0;
}
}
Instance of Symbol 237 MovieClip [barrel] in Symbol 2242 MovieClip [Level_06] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2242 MovieClip [Level_06] Frame 1
onClipEvent (enterFrame) {
if ((_root.player.clip._x > (this._x - 640)) and (this._alpha == 100)) {
_root.spawnBarrel(this, "/HP-50/explosive-1/");
this._alpha = 0;
}
}
Symbol 2256 MovieClip [Level_07] Frame 1
function wave01Dead() {
_root.spawnEnemy(this.mark_1_0, "ARCHER_1", -1, "/waveID-w2/onDeathRunScript-wave02Dead/");
_root.spawnEnemy(this.mark_2_1, "SPEARMAN_1", 1, "/waveID-w2/onDeathRunScript-wave02Dead/");
_root.spawnEnemy(this.mark_2_0, "SPEARMAN_1", 1, "/waveID-w2/onDeathRunScript-wave02Dead/");
}
function wave02Dead() {
_root.spawnEnemy(this.mark_1_0, "ARCHER_1", -1, "/waveID-w3/onDeathRunScript-wave03Dead/");
_root.spawnEnemy(this.mark_1_1, "SPEARMAN_1", -1, "/waveID-w3/onDeathRunScript-wave03Dead/");
_root.spawnEnemy(this.mark_2_0, "SWORDSMAN_1", 1, "/waveID-w3/onDeathRunScript-wave03Dead/");
}
function wave03Dead() {
_root.setMaxCamPos(this.region_border_max_2);
_root.spawnEnemy(this.mark_1_0, "SPEARMAN_1", -1, "nothing");
_root.spawnEnemy(this.mark_1_1, "SPEARMAN_1", -1, "nothing");
}
function wave04Dead() {
_root.spawnEnemy(this.mark_4_0, "SPEARMAN_1", 1, "/waveID-w5/onDeathRunScript-wave05Dead/");
_root.spawnEnemy(this.mark_3_0, "SPEARMAN_1", -1, "/waveID-w5/onDeathRunScript-wave05Dead/");
}
function wave05Dead() {
_root.spawnEnemy(this.mark_4_0, "SPEARMAN_1", 1, "/waveID-w6/onDeathRunScript-wave06Dead/");
_root.spawnEnemy(this.mark_4_1, "SPEARMAN_1", 1, "/waveID-w6/onDeathRunScript-wave06Dead/");
}
function wave06Dead() {
_root.spawnEnemy(this.mark_3_1, "ARCHER_1", -1, "nothing");
_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_fl_0, "ARCHER_1", 1, "/waveID-wf1/onDeathRunScript-wave01finaleDead/");
_root.spawnEnemy(this.mark_fl_1, "SWORDSMAN_1", 1, "/waveID-wf1/onDeathRunScript-wave01finaleDead/");
}
function wave01finaleDead() {
_root.spawnEnemy(this.mark_fl_0, "SWORDSMAN_1", 1, "/waveID-wf2/onDeathRunScript-wave02finaleDead/");
_root.spawnEnemy(this.mark_fr_0, "ARCHER_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, "ARCHER_1", 1, "/waveID-wf2/onDeathRunScript-wave02finaleDead/");
}
function wave02finaleDead() {
_root.spawnEnemy(this.mark_fr_0, "SWORDSMAN_1", -1, "/waveID-wf3/onDeathRunScript-wave03finaleDead/");
_root.spawnEnemy(this.mark_fl_0, "SPEARMAN_1", 1, "/waveID-wf3/onDeathRunScript-wave03finaleDead/");
_root.spawnEnemy(this.mark_fl_1, "ARCHER_1", 1, "/waveID-wf3/onDeathRunScript-wave03finaleDead/");
}
function wave03finaleDead() {
_root.spawnEnemy(this.mark_fr_1, "SPEARMAN_1", -1, "/waveID-wf4/onDeathRunScript-wave04finaleDead/");
_root.spawnEnemy(this.mark_fl_1, "SPEARMAN_1", 1, "/waveID-wf4/onDeathRunScript-wave04finaleDead/");
}
function wave04finaleDead() {
wave05finaleDead();
}
function wave05finaleDead() {
_root.levelFinished();
}
function changeSound(point, maxDist, maxVol) {
var _local2 = _root.player.posX - point;
if (Math.sqrt(_local2 * _local2) < maxDist) {
sound_fire_1.setVolume(((maxDist - Math.sqrt(_local2 * _local2)) / maxDist) * maxVol);
sound_fire_1.setPan(-(_local2 / (maxDist / 100)));
}
}
_root.spawnPlayer(this.playerSpawnPoint);
_root.setMinCamPos(this.region_border_min_1);
_root.setMaxCamPos(this.region_border_max_1);
this.groundCollision._alpha = 0;
_root.setAmbientSound("al_wt_rainhard1.wav", 90);
_root.game.weatherType = "rain";
var counter123 = 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 () {
changeSound(this.fire_1._x, 200, 100);
changeSound(this.fire_2._x, 200, 100);
changeSound(this.fire_3._x, 200, 100);
};
Instance of Symbol 159 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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 = this._x - 5000;
}
}
Instance of Symbol 159 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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/");
this._x = this._x - 5000;
}
}
Instance of Symbol 2161 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 1259 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 1259 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 1259 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 1259 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 1259 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 1259 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 1259 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 261 MovieClip [food_crate] in Symbol 2256 MovieClip [Level_07] Frame 1
onClipEvent (enterFrame) {
if (this._alpha == 100) {
_root.spawnFoodCrate(this._x, this._y, 1);
this._alpha = 0;
}
}
Instance of Symbol 261 MovieClip [food_crate] in Symbol 2256 MovieClip [Level_07] Frame 1
onClipEvent (enterFrame) {
if (this._alpha == 100) {
_root.spawnFoodCrate(this._x, this._y, 1);
this._alpha = 0;
}
}
Instance of Symbol 237 MovieClip [barrel] in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 2161 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 2034 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 159 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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_0, "SPEARMAN_1", 1, "/waveID-w1/onDeathRunScript-wave01Dead/");
_root.spawnEnemy(_parent.mark_1_1, "SWORDSMAN_1", 1, "/waveID-w1/onDeathRunScript-wave01Dead/");
_root.spawnEnemy(_parent.mark_2_1, "SPEARMAN_1", 1, "/waveID-w1/onDeathRunScript-wave01Dead/");
_root.spawnEnemy(_parent.mark_2_0, "SWORDSMAN_1", 1, "/waveID-w1/onDeathRunScript-wave01Dead/");
this._x = this._x - 5000;
}
}
Instance of Symbol 237 MovieClip [barrel] in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 2161 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 2161 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 2034 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 2161 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 2161 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 2161 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 2161 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
onClipEvent (enterFrame) {
if ((_root.player.clip._x > (this._x - 200)) and (this._alpha == 100)) {
_root.spawnEnemy(this, "SPEARMAN_1", 1, "/waveID-wStartFinale/onDeathRunScript-waveStartFinale/");
this._alpha = 0;
}
}
Instance of Symbol 2036 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 2036 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
onClipEvent (enterFrame) {
if ((_root.player.clip._x > (this._x - 550)) and (this._alpha == 100)) {
_root.spawnEnemy(this, "ARCHER_1", -1, "nothing");
this._alpha = 0;
}
}
Instance of Symbol 2036 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 2036 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 2034 MovieClip in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2256 MovieClip [Level_07] Frame 1
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 Symbol 261 MovieClip [food_crate] in Symbol 2256 MovieClip [Level_07] Frame 1
onClipEvent (enterFrame) {
if (this._alpha == 100) {
_root.spawnFoodCrate(this._x, this._y, 1);
this._alpha = 0;
}
}
Symbol 2268 MovieClip Frame 2
stop();
Symbol 2269 MovieClip [Level_08] Frame 1
function wave01Dead() {
_root.spawnEnemy(this.mark_1_r0, "SWORDSMAN_1", -1, "/waveID-w2/onDeathRunScript-w2Death/");
_root.spawnEnemy(this.mark_1_r1, "SWORDSMAN_1", -1, "/waveID-w2/onDeathRunScript-w2Death/");
_root.spawnEnemy(this.mark_1_l0, "SWORDSMAN_1", 1, "/waveID-w2/onDeathRunScript-w2Death/");
}
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, "SPEARMAN_1", -1, "/waveID-w6/onDeathRunScript-w6Death/");
_root.spawnEnemy(this.mark_1_r0, "SPEARMAN_1", 1, "/waveID-w6/onDeathRunScript-w6Death/");
_root.spawnEnemy(this.mark_1_r1, "SPEARMAN_1", 1, "/waveID-w6/onDeathRunScript-w6Death/");
}
function w6Death() {
_root.spawnEnemy(this.mark_2_r0, "ARCHER_1", -1, "/waveID-w7/onDeathRunScript-w7Death/");
_root.spawnEnemy(this.mark_1_r1, "SWORDSMAN_1", 1, "/waveID-w7/onDeathRunScript-w7Death/");
_root.spawnEnemy(this.mark_1_r0, "SPEARMAN_1", 1, "/waveID-w7/onDeathRunScript-w7Death/");
}
function w7Death() {
_root.spawnEnemy(this.mark_skel1, "SKELETON_1", 1, "/waveID-w8/onDeathRunScript-w8Death/");
}
function w8Death() {
_root.spawnBarrel(this.b1, "/HP-100/explosive-1/");
_root.spawnBarrel(this.b2, "/HP-5/explosive-1/");
_root.spawnBarrel(this.b3, "/HP-5/explosive-1/");
_root.spawnBarrel(this.b4, "/HP-5/explosive-1/");
_root.spawnEnemy(this.mark_a1, "ARCHER_1", -1, "/waveID-warch/onDeathRunScript-warchDeath/");
_root.spawnEnemy(this.mark_a2, "ARCHER_1", -1, "/waveID-warch/onDeathRunScript-warchDeath/");
_root.spawnEnemy(this.mark_a3, "ARCHER_1", -1, "/waveID-warch/onDeathRunScript-warchDeath/");
_root.spawnEnemy(this.mark_a4, "ARCHER_1", -1, "/waveID-warch/onDeathRunScript-warchDeath/");
_root.setMaxCamPos(this.region_border_max_4);
}
function warchDeath() {
_root.setMaxCamPos(this.region_border_max_boss);
}
_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;
_root.setAmbientSound("al_wt_rainhard1.wav", 90);
_root.game.weatherType = "rain";
Instance of Symbol 159 MovieClip in Symbol 2269 MovieClip [Level_08] Frame 1
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_r0, "SPEARMAN_1", 1, "/waveID-w5/onDeathRunScript-wave05Dead/");
_root.spawnEnemy(_parent.mark_1_r0, "SWORDSMAN_1", 1, "/waveID-w5/onDeathRunScript-wave05Dead/");
_root.spawnEnemy(_parent.mark_1_r1, "SPEARMAN_1", 1, "/waveID-w5/onDeathRunScript-wave05Dead/");
_root.spawnEnemy(_parent.mark_1_r1, "SWORDSMAN_1", 1, "/waveID-w5/onDeathRunScript-wave05Dead/");
this._x = this._x - 5000;
}
}
Instance of Symbol 2161 MovieClip in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 2036 MovieClip in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 1528 MovieClip in Symbol 2269 MovieClip [Level_08] Frame 1
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.setBossSound("boss_loop_1", 80);
_root.showBossPlate("zoggot");
this._x = this._x + 1000;
this._alpha = 0;
}
}
Instance of Symbol 159 MovieClip in Symbol 2269 MovieClip [Level_08] Frame 1
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/");
this._x = this._x - 5000;
}
}
Instance of Symbol 2036 MovieClip in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 2161 MovieClip in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 2036 MovieClip in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 2034 MovieClip in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 1259 MovieClip in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 1283 MovieClip in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 1283 MovieClip in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 1283 MovieClip in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 1283 MovieClip in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 1283 MovieClip in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 2034 MovieClip in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 261 MovieClip [food_crate] in Symbol 2269 MovieClip [Level_08] Frame 1
onClipEvent (enterFrame) {
if (this._alpha == 100) {
_root.spawnFoodCrate(this._x, this._y, 2);
this._alpha = 0;
}
}
Instance of Symbol 261 MovieClip [food_crate] in Symbol 2269 MovieClip [Level_08] Frame 1
onClipEvent (enterFrame) {
if (this._alpha == 100) {
_root.spawnFoodCrate(this._x, this._y, 1);
this._alpha = 0;
}
}
Instance of Symbol 2034 MovieClip in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 237 MovieClip [barrel] in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 2036 MovieClip in Symbol 2269 MovieClip [Level_08] Frame 1
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 Symbol 261 MovieClip [food_crate] in Symbol 2269 MovieClip [Level_08] Frame 1
onClipEvent (enterFrame) {
if (this._alpha == 100) {
_root.spawnFoodCrate(this._x, this._y, 1);
this._alpha = 0;
}
}
Symbol 2299 MovieClip Frame 1
stop();