Frame 2
if (_framesloaded <= 2) {
gotoAndPlay (1);
}
Frame 3
stop();
Instance of Symbol 326 MovieClip [health] in Frame 4
//component parameters
onClipEvent (construct) {
amount = 10;
}
Instance of Symbol 327 MovieClip [stealth] in Frame 4
//component parameters
onClipEvent (construct) {
amount = 10;
}
Instance of Symbol 979 MovieClip [enemy1] in Frame 8
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "none";
xDir = -100;
}
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 1793 MovieClip [player_wink] in Frame 8
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 1835 MovieClip in Frame 8
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 2073 MovieClip [boss] in Frame 8
onClipEvent (load) {
this._visible = false;
}
Frame 131
function player1(mc) {
this.mc = mc;
this.score = 0;
this.state = "normal";
this.actor = "player";
this.xVel = 0;
this.xMax = 8;
this.xWalkMax = 2.6;
this.xAirMax = 5;
this.xGrabMax = 1;
this.xCrouchMax = 2;
this.xShadowMax = 1.3;
this.xStuckMax = 0.9;
this.yVel = 0;
this.yMax = 20;
this.xAcc = 0.4;
this.xAirAcc = 0.5;
this.dashVel = 7;
this.xSpec = 0;
this.ySpec = 0;
this.jumping = false;
this.head = 40;
this.crouched = false;
this.crouchMoved = false;
this.crouchTime = 0;
this.upTime = 0;
this.fallTime = 0;
this.grabCount = 0;
this.holdName = null;
this.windup = 0;
this.animHoldIdle = 0;
this.animHoldWalk = 0;
this.animHoldAir = 0;
this.animHoldCrouch = 0;
this.animHoldWallSlide = 0;
this.trans = null;
this.attackHold = 0;
this.hp = 100;
this.bp = 0;
this.sp = 100;
this.hitHold = 0;
this.finalHit = false;
this.xForce = 0;
this.yForce = 0;
this.bounced = false;
this.dashCount = 0;
this.dashHold = 0;
this.plane = "ground";
this.downCount = 0;
this.deflecting = 0;
this.headbouncing = 0;
this.whacking = 0;
this.stuckAttackPoll = 0;
this.doorwaypoll = 0;
this.updateHealth = false;
this.updateStealth = false;
this.keyLeft = 37;
this.keyRight = 39;
this.keyUp1 = 38;
this.keyDown1 = 40;
this.keyPause = 13;
this.keyJump = 83;
this.keyAttack = 68;
this.keyGrab = 65;
this.keyHide = 32;
this.keyFast = 16;
this.keyUp1 = _root.keys.keyUp1;
this.keyDown1 = _root.keys.keyDown1;
this.keyLeft = _root.keys.keyLeft;
this.keyRight = _root.keys.keyRight;
this.keyJump = _root.keys.keyJump;
this.keyAttack = _root.keys.keyAttack;
this.keyGrab = _root.keys.keyGrab;
this.keyHide = _root.keys.keyHide;
this.keyFast = _root.keys.keyFast;
this.keyPause = _root.keys.keyPause;
this.jumpPressed = false;
this.doubleJumped = false;
this.grabPressed = false;
this.dJumpOK = false;
this.pausePressed = false;
this.attackPressed = false;
this.hidePressed = false;
this.rightPressed = false;
this.leftPressed = false;
this.fastPressed = false;
this.aura1 = null;
this.aura2 = null;
this.doorway = 1;
this.held = null;
this.heldInfo = null;
this.currScale = 100;
}
function torch(mc, depth) {
this.mc = mc;
this.depth = depth;
this.state = "normal";
this.actor = "torch";
this.xScale0 = mc._xscale;
this.yScale0 = mc._yscale;
this.xVel = 0;
this.xMax = 3;
this.yVel = 0;
this.yMax = 28;
this.xAcc = 1;
this.xSpec = 0;
this.ySpec = 0;
this.jumping = false;
this.head = 28;
this.fallTime = 0;
this.grabbedName = null;
this.hp = null;
this.aura = null;
this.energy = 10;
if (mc._rotation == 180) {
mc._rotation = 0;
mc._xscale = -mc._xscale;
}
this.mc.swapDepths(depth);
}
function staff(mc, depth, element) {
this.mc = mc;
this.selfName = "";
this.depth = depth;
this.state = "grabbed";
this.actor = "staff";
this.lastState = "normal";
this.xScale0 = p1.mc.mcMC.mcHand._xscale;
this.yScale0 = p1.mc.mcMC.mcHand._yscale;
this.mc._xscale = this.xScale0;
this.mc._yscale = this.yScale0;
this.xVel = 0;
this.xMax = 3;
this.yVel = 0;
this.yMax = 28;
this.xAcc = 1;
this.xSpec = 0;
this.ySpec = 0;
this.jumping = false;
this.head = 28;
this.fallTime = 0;
this.grabbedName = null;
this.element = element;
}
function enemy1(mc) {
this.mc = mc;
this.state = "normal";
this.depth0 = mc.getDepth();
this.actor = "hoodley";
this.xVel = 0;
this.xMax = 1;
this.yVel = 0;
this.yMax = 26;
this.xHuntMax = 4;
this.xFireMax = 6;
this.xAcc = 0.8;
this.xAirAcc = 0.4;
this.xSpec = 0;
this.ySpec = 0;
this.jumping = false;
this.head = 50;
this.stopCount = 0;
this.grabbedName = null;
this.holdName = null;
this.grabCount = 0;
this.hitCount = 0;
this.phase = 1;
this.phaseCount = 0;
this.alertTime = 0;
this.animHoldIdle = 0;
this.animHoldWalk = 0;
this.attackHold = 0;
this.bp = 0;
this.hitHold = 0;
this.finalHit = false;
this.xForce = 0;
this.yForce = 0;
this.hp = 20;
this.energy = 10;
this.jumpPressed = false;
this.dJumpOK = false;
this.pausePressed = false;
if (this.mc._xscale > 0) {
this.xDest = mc._x + 10;
} else {
this.xDest = mc._x - 10;
}
this.yDest = mc._y;
this.xPatrol = mc._x;
this.stopCount = 50;
}
function projectile(mc, projectileType, ht) {
this.mc = mc;
this.state = "thrown";
this.actor = "projectile";
this.projType = projectileType;
this.hitTarget = ht;
this.xVel = 0;
this.xMax = 18;
this.yVel = 0;
this.yMax = 14;
this.xAcc = 3;
this.xSpec = 0;
this.ySpec = 0;
this.jumping = false;
this.head = 10;
this.grabbedName = null;
this.phaseCount = 0;
this.life = 40;
this.bp = 2;
}
function boss1(mc) {
trace("creating boss...");
this.mc = mc;
this.state = "ground";
this.actor = "boss";
this.xVel = 0;
this.xMax = 5.5;
this.yVel = 0;
this.yMax = 6;
this.xAcc = 0.4;
this.yAcc = 0.4;
this.xAirAcc = 0.4;
this.xSpec = 0;
this.ySpec = 0;
this.jumping = false;
this.head = 50;
this.grabbedName = null;
this.holdName = null;
this.grabCount = 0;
this.hitCount = 0;
this.phaseCount = 0;
this.updateHealth = false;
this.animHoldIdle = 0;
this.animHoldWalk = 0;
this.animHoldAir = 0;
this.attackHold = 0;
this.bp = 0;
this.hitHold = 0;
this.finalHit = false;
this.xForce = 0;
this.yForce = 0;
this.hp = 100;
this.jumpPressed = false;
this.dJumpOK = false;
this.xDest = mc._x + 1;
this.yDest = mc._y;
this.xPatrol = mc._x;
this.stopCount = 50;
this.lastStomp = 0;
}
function torchControl(torchName1) {
var _local2 = this[torchName1];
var _local4 = _local2.mc._x;
var _local3 = _local2.mc._y;
if (_local2.state == "inactive") {
if ((Math.abs(_local4 - p1.mc._x) <= xCutoff) && (Math.abs(_local3 - p1.mc._y) <= yCutoff)) {
_local2.state = "normal";
_local2.mc._visible = true;
}
} else {
if ((_local2.state == "normal") || (_local2.state == "thrown")) {
if (((p1.holdName == null) && (p1.grabCount > 0)) && (p1.mc.mcMC.mcGrab._x != undefined)) {
if (p1.mc._xscale > 0) {
temp = p1.mc.mcMC.mcGrab._x;
} else {
temp = -p1.mc.mcMC.mcGrab._x;
}
if (_local2.mc.mcHit.hitTest(p1.mc._x + temp, p1.mc._y + p1.mc.mcMC.mcGrab._y, true)) {
_local2.state = "grabbed";
_local2.grabbedName = p1;
_local2.mc.swapDepths(grabbedDepth);
_local2.depth = grabbedDepth;
p1.holdName = _local2;
p1.windup = 0;
}
}
}
if (p1.attackHold > 0) {
if (p1.mc._xscale > 0) {
temp = p1.mc.mcMC.mcAttack._x;
} else {
temp = -p1.mc.mcMC.mcAttack._x;
}
if ((p1.mc.mcMC.mcAttack._x != undefined) && (_local2.mc.mcHit.hitTest(p1.mc._x + temp, p1.mc._y + p1.mc.mcMC.mcAttack._y, true))) {
if (p1.mc._xscale > 0) {
_local2.xVel = p1.xForce * 4;
} else {
_local2.xVel = (-p1.xForce) * 4;
}
if (p1.mc.mcMC.mcAttack._y < -10) {
_local2.yVel = p1.yForce * 4;
}
_local2.state = "thrown";
_local2.mc.mcMC.mcHand.gotoAndStop("none");
}
}
if (_local2.state == "normal") {
_local2.mc.mcMC.mcHand.gotoAndStop("none");
_local2._xscale = _local2.xScale0;
_local2._yscale = _local2.yScale0;
if (_local2.stopCount > 0) {
_local2.stopCount++;
if (_local2.stopCount > ((Math.random() * 45) + 15)) {
_local2.stopCount = 0;
_local2.mc._xscale = -_local2.mc._xscale;
}
}
if (_local2.xSpec > 0) {
_local2.xSpec--;
}
if (_local2.xSpec <= 0) {
if (_local2.xVel > _local2.xMax) {
_local2.xVel = _local2.xMax + ((_local2.xMax - _local2.xVel) / 8);
} else if (_local2.xVel < (-_local2.xMax)) {
_local2.xVel = (-_local2.xMax) + ((_local2.xVel + _local2.xMax) / 8);
}
}
if (_local2.xVel != 0) {
if (_local2.stopCount > 0) {
if (mapHit.hitTest(_local4 + _local2.xVel, _local3 - gravity, true)) {
_local2.xVel = 0;
}
}
}
_local2.mc._x = _local2.mc._x + _local2.xVel;
if (((_local2.xVel != 0) && (!Key.isDown(_local2.keyLeft))) && (!Key.isDown(_local2.keyRight))) {
if ((!mapHit.hitTest(_local4, _local3, true)) && (mapHit.hitTest(_local4, _local3 + (gravity * 8), true))) {
temp = 0;
while ((temp < (gravity * 8)) && (!mapHit.hitTest(_local4, _local3 + temp, true))) {
temp = temp + gravity;
}
_local2.mc._y = _local2.mc._y + temp;
}
}
if (_local2.ySpec > 0) {
_local2.ySpec--;
}
if (_local2.ySpec <= 0) {
if (_local2.yVel > _local2.yMax) {
_local2.yVel = _local2.yMax;
} else if (_local2.yVel < (-_local2.yMax)) {
_local2.yVel = -_local2.yMax;
}
}
_local2.mc._y = _local2.mc._y + _local2.yVel;
if ((Math.abs(_local4 - p1.mc._x) > xCutoff) || (Math.abs(_local3 - p1.mc._y) > yCutoff)) {
_local2.state = "inactive";
_local2.mc._visible = false;
}
if (_local2.mc._xscale > 0) {
makeFire(_local2, _local2.mc.mcMC.mcMC._rotation);
} else {
makeFire(_local2, -_local2.mc.mcMC.mcMC._rotation);
}
} else if (_local2.state == "grabbed") {
_local2.mc.gotoAndStop("grabbed");
_local2.mc.mcMC.mcHand.gotoAndStop("Wink");
if (_local2.grabbedName.mc._xscale > 0) {
_local2.mc._x = _local2.grabbedName.mc._x + _local2.grabbedName.mc.mcMC.mcHand._x;
_local2.mc._xscale = _local2.grabbedName.mc.mcMC.mcHand._xscale;
_local2.mc._rotation = _local2.grabbedName.mc.mcMC.mcHand._rotation;
} else {
_local2.mc._x = _local2.grabbedName.mc._x - _local2.grabbedName.mc.mcMC.mcHand._x;
_local2.mc._xscale = -_local2.grabbedName.mc.mcMC.mcHand._xscale;
_local2.mc._rotation = -_local2.grabbedName.mc.mcMC.mcHand._rotation;
}
_local2.mc._y = _local2.grabbedName.mc._y + _local2.grabbedName.mc.mcMC.mcHand._y;
_local2.mc._yscale = _local2.grabbedName.mc.mcMC.mcHand._yscale;
makeFire(_local2, _local2.mc._rotation);
} else if (_local2.state == "thrown") {
_local2.mc.mcMC.mcHand.gotoAndStop("none");
_local2._xscale = _local2.xScale0;
_local2._yscale = _local2.yScale0;
if (_local2.xVel > 0) {
if (_local2.yVel != 0) {
_local2.xVel = _local2.xVel / frictionAir;
} else {
_local2.xVel = _local2.xVel / friction;
}
if (_local2.xVel <= 0.3) {
_local2.xVel = 0;
}
} else if (_local2.xVel < 0) {
if (_local2.yVel != 0) {
_local2.xVel = _local2.xVel / frictionAir;
} else {
_local2.xVel = _local2.xVel / friction;
}
if (_local2.xVel >= -0.3) {
_local2.xVel = 0;
}
}
if (_local2.xVel != 0) {
if (mapHit.hitTest(_local4 + _local2.xVel, _local3 - (gravity * 2), true)) {
if (_local2.xVel > 0) {
temp = _local2.xVel - _local2.xAcc;
enemyBounceRight(_local2, temp);
} else {
temp = _local2.xVel + _local2.xAcc;
enemyBounceLeft(_local2, temp);
}
if (Math.abs(_local2.xVel) <= 0.3) {
_local2.xVel = 0;
}
} else if (_local2.xVel > _local2.xMax) {
if (mapHit.hitTest(_local4 + (_local2.xVel / 2), _local3 - (gravity * 2), true)) {
temp = (_local2.xVel / 2) - _local2.xAcc;
enemyBounceRight(_local2, temp);
} else if (mapHit.hitTest(_local4, _local3 - (gravity * 2), true)) {
temp = -_local2.xAcc;
enemyBounceRight(_local2, temp);
}
} else if (_local2.xVel < (-_local2.xMax)) {
if (mapHit.hitTest(_local4 + (_local2.xVel / 2), _local3 - (gravity * 2), true)) {
temp = (_local2.xVel / 2) + _local2.xAcc;
enemyBounceLeft(_local2, temp);
} else if (mapHit.hitTest(_local4, _local3 - (gravity * 2), true)) {
temp = _local2.xAcc;
enemyBounceLeft(_local2, temp);
}
}
}
_local2.mc._x = _local2.mc._x + _local2.xVel;
if (((_local2.xVel != 0) && (!Key.isDown(_local2.keyLeft))) && (!Key.isDown(_local2.keyRight))) {
if ((!mapHit.hitTest(_local4, _local3, true)) && (mapHit.hitTest(_local4, _local3 + (gravity * 8), true))) {
temp = 0;
while ((temp < (gravity * 8)) && (!mapHit.hitTest(_local4, _local3 + temp, true))) {
temp = temp + gravity;
}
_local2.mc._y = _local2.mc._y + temp;
}
}
if (_local2.yVel > _local2.yMax) {
_local2.yVel = _local2.yMax;
}
if (!mapHit.hitTest(_local2.mc._x, (_local2.mc._y + gravity) + _local2.yVel, true)) {
if ((Math.abs(_local2.xVel) > 20) || (Math.abs(_local2.yVel) > 12)) {
_local2.mc.gotoAndStop("thrownBlur");
} else {
_local2.mc.gotoAndStop("thrown");
}
if (_local2.yVel > 20) {
if (!mapHit.hitTest(_local2.mc._x, (_local2.mc._y + gravity) + (_local2.yVel / 2), true)) {
_local2.yVel = _local2.yVel + gravity;
if (_local2.yVel > gravity) {
_local2.jumping = false;
}
if (!_local2.jumping) {
_local2.mc.gotoAndStop("fall");
}
} else {
enemy0HitGround(_local2);
_local2._y = _local2._y + (-gravity);
}
} else {
_local2.yVel = _local2.yVel + gravity;
if (_local2.yVel > gravity) {
_local2.jumping = false;
}
if (!_local2.jumping) {
_local2.mc.gotoAndStop("fall");
}
}
} else {
enemy0HitGround(_local2);
_local2.mc.gotoAndStop("bouncing");
if (_local2.xVel == 0) {
if (!mapHit.hitTest(_local2.mc._x - 10, _local2.mc._y + 3, true)) {
_local2.xVel = _local2.yVel * 2;
} else if (!mapHit.hitTest(_local2.mc._x - 20, _local2.mc._y + 3, true)) {
_local2.xVel = _local2.yVel;
} else if (!mapHit.hitTest(_local2.mc._x - 40, _local2.mc._y + 3, true)) {
_local2.xVel = _local2.yVel / 2;
} else if (!mapHit.hitTest(_local2.mc._x + 10, _local2.mc._y + 3, true)) {
_local2.xVel = (-_local2.yVel) * 2;
} else if (!mapHit.hitTest(_local2.mc._x + 20, _local2.mc._y + 3, true)) {
_local2.xVel = -_local2.yVel;
} else if (!mapHit.hitTest(_local2.mc._x + 40, _local2.mc._y + 3, true)) {
_local2.xVel = (-_local2.yVel) / 2;
}
}
}
if (_local2.yVel < 0) {
if (mapHit.hitTest(_local2.mc._x, (_local2.mc._y - _local2.head) + _local2.yVel, true)) {
temp = _local2.yVel + gravity;
_local2.mc._y = _local2.mc._y + temp;
_local2.yVel = 0.001;
while (mapHit.hitTest(_local2.mc._x, (_local2.mc._y - _local2.head) + temp, true)) {
_local2.mc._y = _local2.mc._y + gravity;
temp = temp + gravity;
}
}
}
_local2.mc._y = _local2.mc._y + _local2.yVel;
if ((_local2.xVel == 0) && (_local2.yVel == 0)) {
_local2.state = "normal";
_local2.mc.gotoAndStop("down");
if (thrownName == _local2) {
thrownName = null;
}
}
if (_local2.mc._xscale > 0) {
makeFire(_local2, _local2.mc.mcMC.mcMC._rotation);
makeFire(_local2, _local2.mc.mcMC.mcMC._rotation);
} else {
makeFire(_local2, -_local2.mc.mcMC.mcMC._rotation);
makeFire(_local2, _local2.mc.mcMC.mcMC._rotation);
}
}
}
}
function playerControl(playerNum) {
with (p1) {
animHoldIdle--;
animHoldWalk--;
animHoldAir--;
animHoldCrouch--;
animHoldWallSlide--;
attackHold--;
grabCount--;
xSpec--;
ySpec--;
dashCount--;
dashHold--;
deflecting--;
}
if (Key.isDown(p1.keyHide)) {
if (!p1.hidePressed) {
p1.hidePressed = true;
p1Hide();
}
} else {
p1.hidePressed = false;
}
soundWink.onSoundComplete = function () {
soundWinkDone = true;
};
if (p1.plane == "shadow") {
if (p1.state == "normal") {
shadow_Normal();
}
} else if (p1.plane == "ground") {
if (p1.state == "normal") {
ground_Normal();
} else if (p1.state == "grabbing") {
ground_Grabbing();
} else if (p1.state == "stuck") {
ground_Stuck();
} else if (p1.state == "thrown") {
ground_Thrown();
} else if (p1.state == "down") {
ground_Down();
} else if (p1.state == "ledge") {
ground_Ledge();
} else if (p1.state == "grabbingBoss") {
grabbingBoss();
}
}
}
function actorHitGround(actorName) {
actorName.yVel = actorName.yVel + (-gravity);
var _local2 = actorName.yMax;
do {
if (!mapHit.hitTest(actorName.mc._x, (actorName.mc._y + gravity) + actorName.yVel, true)) {
break;
}
actorName.yVel = actorName.yVel + (-gravity);
_local2 = _local2 + (-gravity);
} while (_local2 >= gravity);
actorName.yVel = actorName.yVel + gravity;
actorName.mc._y = actorName.mc._y + actorName.yVel;
if (actorName.yVel != 0) {
actorName.mc.gotoAndStop("bouncing");
actorName.landCount = 6;
}
if (actorName.yVel > gravity) {
actorName.yVel = (-actorName.yVel) / 1.7;
actorName.mc._y = actorName.mc._y + ((-actorName.yVel) - gravity);
actorName.xVel = actorName.xVel / 2;
} else {
actorName.yVel = 0;
}
actorName.jumping = false;
}
function enemy0HitGround(actorName2) {
actorName2.yVel = actorName2.yVel + (-gravity);
var _local2 = actorName2.yMax;
do {
if (!mapHit.hitTest(actorName2.mc._x, (actorName2.mc._y + gravity) + actorName2.yVel, true)) {
break;
}
actorName2.yVel = actorName2.yVel + (-gravity);
_local2 = _local2 + (-gravity);
} while (_local2 >= gravity);
actorName2.yVel = actorName2.yVel + gravity;
actorName2.mc._y = actorName2.mc._y + actorName2.yVel;
if (actorName2.yVel != 0) {
actorName2.mc.gotoAndStop("land");
actorName2.landCount = 6;
}
if (actorName2.yVel > gravity) {
actorName2.yVel = (-actorName2.yVel) / 1.7;
actorName2.mc._y = actorName2.mc._y + ((-actorName2.yVel) - gravity);
actorName2.xVel = actorName2.xVel / 2;
} else {
actorName2.yVel = 0;
}
actorName2.jumping = false;
}
function enemyBounceRight(actorName3, tempAcc) {
while (mapHit.hitTest(actorName3.mc._x + tempAcc, actorName3.mc._y - (gravity * 2), true)) {
tempAcc = tempAcc + (-actorName3.xAcc);
if (tempAcc < 0) {
if (!mapHit.hitTest(actorName3.mc._x - 10, actorName3.mc._y - 10, true)) {
actorName3.mc._x = actorName3.mc._x + -10;
actorName3.mc._y = actorName3.mc._y + -10;
} else if (!mapHit.hitTest(actorName3.mc._x - 20, actorName3.mc._y - 20, true)) {
actorName3.mc._x = actorName3.mc._x + -20;
actorName3.mc._y = actorName3.mc._y + -20;
} else if (!mapHit.hitTest(actorName3.mc._x - 30, actorName3.mc._y - 30, true)) {
actorName3.mc._x = actorName3.mc._x + -30;
actorName3.mc._y = actorName3.mc._y + -30;
}
}
}
actorName3.mc._x = actorName3.mc._x + tempAcc;
tempAcc = actorName3.xVel;
actorName3.xVel = 0;
if (!mapHit.hitTest(actorName3.mc._x + 20, actorName3.mc._y - 10, true)) {
actorName3.xVel = tempAcc / 2;
} else if (!mapHit.hitTest(actorName3.mc._x + 20, actorName3.mc._y - 20, true)) {
actorName3.xVel = 0;
} else if (!mapHit.hitTest(actorName3.mc._x + 20, actorName3.mc._y - 40, true)) {
actorName3.xVel = (-tempAcc) / 2;
} else {
actorName3.xVel = -tempAcc;
}
}
function enemyBounceLeft(actorName4, tempAcc) {
while (mapHit.hitTest(actorName4.mc._x + tempAcc, actorName4.mc._y - (gravity * 2), true)) {
tempAcc = tempAcc + actorName4.xAcc;
if (tempAcc < 0) {
if (!mapHit.hitTest(actorName4.mc._x + 10, actorName4.mc._y - 10, true)) {
actorName4.mc._x = actorName4.mc._x + 10;
actorName4.mc._y = actorName4.mc._y + -10;
} else if (!mapHit.hitTest(actorName4.mc._x + 20, actorName4.mc._y - 20, true)) {
actorName4.mc._x = actorName4.mc._x + 20;
actorName4.mc._y = actorName4.mc._y + -20;
} else if (!mapHit.hitTest(actorName4.mc._x + 30, actorName4.mc._y - 30, true)) {
actorName4.mc._x = actorName4.mc._x + 30;
actorName4.mc._y = actorName4.mc._y + -30;
}
}
}
actorName4.mc._x = actorName4.mc._x + tempAcc;
tempAcc = actorName4.xVel;
actorName4.xVel = 0;
if (!mapHit.hitTest(actorName4.mc._x - 20, actorName4.mc._y - 10, true)) {
actorName4.xVel = tempAcc / 2;
} else if (!mapHit.hitTest(actorName4.mc._x - 20, actorName4.mc._y - 20, true)) {
actorName4.xVel = 0;
} else if (!mapHit.hitTest(actorName4.mc._x - 20, actorName4.mc._y - 40, true)) {
actorName4.xVel = (-tempAcc) / 2;
} else {
actorName4.xVel = -tempAcc;
}
}
function enemy1Control(enemyName1) {
var _local2 = this[enemyName1];
if (_local2.state == "inactive") {
_local2.phaseCount--;
if ((Math.abs(_local2.mc._x - p1.mc._x) <= xCutoff) && (Math.abs(_local2.mc._y - p1.mc._y) <= yCutoff)) {
_local2.state = "normal";
_local2.mc._visible = true;
}
} else if (_local2.state != "dead") {
_local2.animHoldIdle--;
_local2.animHoldWalk--;
_local2.phaseCount--;
_local2.grabCount--;
if ((_local2.state == "normal") || (_local2.state == "thrown")) {
enemy1_grabCheck(_local2);
}
if (((((p1.whacking == 1) && (_local2.state != "clothes")) && (_local2.state != "down")) && (_local2.state != "getup")) && (_local2.state != "whacked")) {
if ((Math.abs(_local2.mc._x - p1.mc._x) < 45) && (Math.abs(_local2.mc._y - p1.mc._y) < 50)) {
p1.whacking = 2;
}
}
if (((((p1.attackHold > 0) && (_local2.state != "grabbed")) && (_local2.state != "clothes")) && (_local2.state != "whacked")) && (p1.mc.mcMC.mcAttack._x != undefined)) {
if (p1.mc._xscale > 0) {
temp = p1.mc.mcMC.mcAttack._x;
} else {
temp = -p1.mc.mcMC.mcAttack._x;
}
if (_local2.mc.mcHit.hitTest(p1.mc._x + temp, p1.mc._y + p1.mc.mcMC.mcAttack._y, true)) {
enemy1_getHit(_local2);
}
}
if ((_local2.phase == 1) || (_local2.phase == 2)) {
if (_local2.state == "normal") {
enemy1_Normal(_local2);
} else if (_local2.state == "grabbed") {
enemy1_Grabbed(_local2);
} else if (_local2.state == "thrown") {
enemy1_Thrown(_local2);
} else if (_local2.state == "hit") {
enemy1_Hit(_local2);
} else if (_local2.state == "falldown") {
enemy1_Falldown(_local2);
} else if (_local2.state == "getup") {
enemy1_Getup(_local2);
} else if (_local2.state == "choking") {
enemy1_Choking(_local2);
} else if (_local2.state == "down") {
enemy1_Down(_local2);
} else if (_local2.state == "onfire") {
enemy1_Onfire(_local2);
} else if (_local2.state == "whacked") {
enemy1_Whacked(_local2);
} else if (_local2.state == "clothes") {
}
}
} else if (_local2.state == "dead") {
}
}
function staffControl(staffName1) {
var _local2 = this[staffName1];
var _local4 = _local2.mc._x;
var _local3 = _local2.mc._y;
if (_local2.state == "inactive") {
if ((Math.abs(_local4 - p1.mc._x) <= xCutoff) && (Math.abs(_local3 - p1.mc._y) <= yCutoff)) {
_local2.state = _local2.lastState;
_local2.mc._visible = true;
}
} else {
if ((_local2.state == "normal") || (_local2.state == "thrown")) {
if (((p1.holdName == null) && (p1.grabCount > 0)) && (p1.mc.mcMC.mcGrab._x != undefined)) {
if (p1.mc._xscale > 0) {
temp = p1.mc.mcMC.mcGrab._x;
} else {
temp = -p1.mc.mcMC.mcGrab._x;
}
if (_local2.mc.mcHit.hitTest(p1.mc._x + temp, p1.mc._y + p1.mc.mcMC.mcGrab._y, true)) {
_local2.state = "grabbed";
_local2.grabbedName = p1;
_local2.mc.swapDepths(grabbedDepth);
_local2.depth = grabbedDepth;
p1.holdName = _local2;
p1.windup = 0;
}
}
}
if (p1.attackHold > 0) {
if (p1.mc._xscale > 0) {
temp = p1.mc.mcMC.mcAttack._x;
} else {
temp = -p1.mc.mcMC.mcAttack._x;
}
if ((p1.mc.mcMC.mcAttack._x != undefined) && (_local2.mc.mcHit.hitTest(p1.mc._x + temp, p1.mc._y + p1.mc.mcMC.mcAttack._y, true))) {
if (p1.mc._xscale > 0) {
_local2.xVel = p1.xForce * 4;
} else {
_local2.xVel = (-p1.xForce) * 4;
}
if (p1.mc.mcMC.mcAttack._y < -10) {
_local2.yVel = p1.yForce * 4;
}
_local2.state = "thrown";
}
}
if (_local2.state == "normal") {
_local2.mc.gotoAndStop("down");
_local2.mc.mcMC.mcHand.gotoAndStop("none");
_local2._xscale = _local2.xScale0;
_local2._yscale = _local2.yScale0;
if (_local2.stopCount > 0) {
_local2.stopCount++;
if (_local2.stopCount > ((Math.random() * 45) + 15)) {
_local2.stopCount = 0;
_local2.mc._xscale = -_local2.mc._xscale;
}
}
if (_local2.xSpec > 0) {
_local2.xSpec--;
}
if (_local2.xSpec <= 0) {
if (_local2.xVel > _local2.xMax) {
_local2.xVel = _local2.xMax + ((_local2.xMax - _local2.xVel) / 8);
} else if (_local2.xVel < (-_local2.xMax)) {
_local2.xVel = (-_local2.xMax) + ((_local2.xVel + _local2.xMax) / 8);
}
}
if (_local2.xVel != 0) {
if (_local2.stopCount > 0) {
if (mapHit.hitTest(_local4 + _local2.xVel, _local3 - gravity, true)) {
_local2.xVel = 0;
}
}
}
_local2.mc._x = _local2.mc._x + _local2.xVel;
if (((_local2.xVel != 0) && (!Key.isDown(_local2.keyLeft))) && (!Key.isDown(_local2.keyRight))) {
if ((!mapHit.hitTest(_local4, _local3, true)) && (mapHit.hitTest(_local4, _local3 + (gravity * 8), true))) {
temp = 0;
while ((temp < (gravity * 8)) && (!mapHit.hitTest(_local4, _local3 + temp, true))) {
temp = temp + gravity;
}
_local2.mc._y = _local2.mc._y + temp;
}
}
if (_local2.ySpec > 0) {
_local2.ySpec--;
}
if (_local2.ySpec <= 0) {
if (_local2.yVel > _local2.yMax) {
_local2.yVel = _local2.yMax;
} else if (_local2.yVel < (-_local2.yMax)) {
_local2.yVel = -_local2.yMax;
}
}
_local2.mc._y = _local2.mc._y + _local2.yVel;
if ((Math.abs(_local4 - p1.mc._x) > xCutoff) || (Math.abs(_local3 - p1.mc._y) > yCutoff)) {
if (mapHit.hitTest(_local4, _local3, true)) {
_local2.lastState = _local2.state;
_local2.state = "inactive";
_local2.mc._visible = false;
}
}
if ((((thrownName != null) && (thrownName != _local2)) && (thrownName.actor != "hoodley")) && (thrownName.actor != "staff")) {
if (_local2.mc.mcHit.hitTest(thrownName.mc.mcHit)) {
_local2.xVel = thrownName.xVel;
_local2.yVel = thrownName.yVel;
thrownName.xVel = (-thrownName.xVel) * 0.8;
thrownName.yVel = (-thrownName.yVel) * 0.8;
_local2.state = "thrown";
_local2.mc.gotoAndStop("thrown");
_local2.mc.mcMC.mcHand.gotoAndStop("none");
}
}
} else if (_local2.state == "grabbed") {
_local2.mc.gotoAndStop("grabbed");
if (_local2.grabbedName.mc._name == "mcP1") {
_local2.mc.mcMC.mcHand.gotoAndStop("Wink");
} else {
_local2.mc.mcMC.mcHand.gotoAndStop("none");
}
if (_local2.grabbedName.mc._xscale > 0) {
_local2.mc._x = _local2.grabbedName.mc._x + _local2.grabbedName.mc.mcMC.mcHand._x;
_local2.mc._xscale = _local2.grabbedName.mc.mcMC.mcHand._xscale;
_local2.mc._rotation = _local2.grabbedName.mc.mcMC.mcHand._rotation;
} else {
_local2.mc._x = _local2.grabbedName.mc._x - _local2.grabbedName.mc.mcMC.mcHand._x;
_local2.mc._xscale = -_local2.grabbedName.mc.mcMC.mcHand._xscale;
_local2.mc._rotation = -_local2.grabbedName.mc.mcMC.mcHand._rotation;
}
_local2.mc._y = _local2.grabbedName.mc._y + _local2.grabbedName.mc.mcMC.mcHand._y;
_local2.mc._yscale = _local2.grabbedName.mc.mcMC.mcHand._yscale;
if ((Math.abs(_local4 - p1.mc._x) > xCutoff) || (Math.abs(_local3 - p1.mc._y) > yCutoff)) {
_local2.lastState = _local2.state;
_local2.state = "inactive";
_local2.mc._visible = false;
}
} else if (_local2.state == "thrown") {
_local2.mc.mcMC.mcHand.gotoAndStop("none");
_local2.mc._xscale = _local2.xScale0;
_local2.mc._yscale = _local2.yScale0;
if ((Math.abs(_local4 - p1.mc._x) > xCutoff) || (Math.abs(_local3 - p1.mc._y) > yCutoff)) {
if (mapHit.hitTest(_local4, _local3, true)) {
_local2.lastState = _local2.state;
_local2.state = "inactive";
_local2.mc._visible = false;
}
}
if (Math.abs(_local2.mc._rotation + 90) > 93) {
_local2.mc._rotation = (_local2.mc._rotation / 2) - 180;
}
if (_local2.xVel > 0) {
if (_local2.yVel != 0) {
_local2.xVel = _local2.xVel / frictionAir;
} else {
_local2.xVel = _local2.xVel / friction;
}
if (_local2.xVel <= 0.3) {
_local2.xVel = 0;
}
} else if (_local2.xVel < 0) {
if (_local2.yVel != 0) {
_local2.xVel = _local2.xVel / frictionAir;
} else {
_local2.xVel = _local2.xVel / friction;
}
if (_local2.xVel >= -0.3) {
_local2.xVel = 0;
}
}
if (_local2.xVel != 0) {
if (mapHit.hitTest(_local4 + _local2.xVel, _local3 - (gravity * 2), true)) {
if (_local2.xVel > 0) {
temp = _local2.xVel - _local2.xAcc;
enemyBounceRight(_local2, temp);
} else {
temp = _local2.xVel + _local2.xAcc;
enemyBounceLeft(_local2, temp);
}
if (Math.abs(_local2.xVel) <= 0.3) {
_local2.xVel = 0;
}
} else if (_local2.xVel > _local2.xMax) {
if (mapHit.hitTest(_local4 + (_local2.xVel / 2), _local3 - (gravity * 2), true)) {
temp = (_local2.xVel / 2) - _local2.xAcc;
enemyBounceRight(_local2, temp);
} else if (mapHit.hitTest(_local4, _local3 - (gravity * 2), true)) {
temp = -_local2.xAcc;
enemyBounceRight(_local2, temp);
}
} else if (_local2.xVel < (-_local2.xMax)) {
if (mapHit.hitTest(_local4 + (_local2.xVel / 2), _local3 - (gravity * 2), true)) {
temp = (_local2.xVel / 2) + _local2.xAcc;
enemyBounceLeft(_local2, temp);
} else if (mapHit.hitTest(_local4, _local3 - (gravity * 2), true)) {
temp = _local2.xAcc;
enemyBounceLeft(_local2, temp);
}
}
}
_local2.mc._x = _local2.mc._x + _local2.xVel;
if (((_local2.xVel != 0) && (!Key.isDown(_local2.keyLeft))) && (!Key.isDown(_local2.keyRight))) {
if ((!mapHit.hitTest(_local4, _local3, true)) && (mapHit.hitTest(_local4, _local3 + (gravity * 8), true))) {
temp = 0;
while ((temp < (gravity * 8)) && (!mapHit.hitTest(_local4, _local3 + temp, true))) {
temp = temp + gravity;
}
_local2.mc._y = _local2.mc._y + temp;
}
}
if (_local2.yVel > _local2.yMax) {
_local2.yVel = _local2.yMax;
}
if (!mapHit.hitTest(_local2.mc._x, (_local2.mc._y + gravity) + _local2.yVel, true)) {
if ((Math.abs(_local2.xVel) > 20) || (Math.abs(_local2.yVel) > 12)) {
_local2.mc.gotoAndStop("thrownBlur");
} else {
_local2.mc.gotoAndStop("thrown");
}
if (_local2.yVel > 20) {
if (!mapHit.hitTest(_local2.mc._x, (_local2.mc._y + gravity) + (_local2.yVel / 2), true)) {
_local2.yVel = _local2.yVel + gravity;
if (_local2.yVel > gravity) {
_local2.jumping = false;
}
if (!_local2.jumping) {
_local2.mc.gotoAndStop("fall");
}
} else {
enemy0HitGround(_local2);
_local2._y = _local2._y + (-gravity);
}
} else {
_local2.yVel = _local2.yVel + gravity;
if (_local2.yVel > gravity) {
_local2.jumping = false;
}
if (!_local2.jumping) {
_local2.mc.gotoAndStop("fall");
}
}
} else {
enemy0HitGround(_local2);
_local2.mc.gotoAndStop("bouncing");
if (_local2.xVel == 0) {
if (!mapHit.hitTest(_local2.mc._x - 10, _local2.mc._y + 3, true)) {
_local2.xVel = _local2.yVel * 2;
} else if (!mapHit.hitTest(_local2.mc._x - 20, _local2.mc._y + 3, true)) {
_local2.xVel = _local2.yVel;
} else if (!mapHit.hitTest(_local2.mc._x - 40, _local2.mc._y + 3, true)) {
_local2.xVel = _local2.yVel / 2;
} else if (!mapHit.hitTest(_local2.mc._x + 10, _local2.mc._y + 3, true)) {
_local2.xVel = (-_local2.yVel) * 2;
} else if (!mapHit.hitTest(_local2.mc._x + 20, _local2.mc._y + 3, true)) {
_local2.xVel = -_local2.yVel;
} else if (!mapHit.hitTest(_local2.mc._x + 40, _local2.mc._y + 3, true)) {
_local2.xVel = (-_local2.yVel) / 2;
}
}
}
if (_local2.yVel < 0) {
if (mapHit.hitTest(_local2.mc._x, (_local2.mc._y - _local2.head) + _local2.yVel, true)) {
temp = _local2.yVel + gravity;
_local2.mc._y = _local2.mc._y + temp;
_local2.yVel = 0.001;
while (mapHit.hitTest(_local2.mc._x, (_local2.mc._y - _local2.head) + temp, true)) {
_local2.mc._y = _local2.mc._y + gravity;
temp = temp + gravity;
}
}
}
_local2.mc._y = _local2.mc._y + _local2.yVel;
if ((_local2.xVel == 0) && (_local2.yVel == 0)) {
_local2.state = "normal";
if (thrownName == _local2) {
thrownName = null;
}
}
}
}
}
function vcam() {
if (bossCount == 2) {
var _local2 = 150;
} else {
var _local2 = 30;
}
if (shakeCam > 0) {
mcCam._x = mcCam._x + (((-shakeCam) / 2) + (Math.random() * shakeCam));
mcCam._y = mcCam._y + (((-shakeCam) / 2) + (Math.random() * shakeCam));
shakeCam = shakeCam + -0.5;
}
if (camlock <= 0) {
if (p1.dashHold > 0) {
if (p1.mc._xscale > 0) {
temp = p1.mc._x + 250;
} else {
temp = p1.mc._x - 250;
}
if ((temp < mcCam._x) || (temp > mcCam._x)) {
mcCam._x = mcCam._x + Math.round((temp - mcCam._x) / 16);
}
} else {
if (p1.mc._xscale > 0) {
temp = p1.mc._x + 80;
} else {
temp = p1.mc._x - 80;
}
if ((temp < mcCam._x) || (temp > mcCam._x)) {
mcCam._x = mcCam._x + Math.round((temp - mcCam._x) / 16);
}
}
if ((p1.state == "stuck") && ((((p1.mc._y + 90) - _local2) < mcCam._y) || (((p1.mc._y + 90) - _local2) > mcCam._y))) {
mcCam._y = mcCam._y + Math.round((((p1.mc._y + 90) - _local2) - mcCam._y) / 12);
} else if (((p1.mc._y - _local2) < mcCam._y) || ((p1.mc._y - _local2) > mcCam._y)) {
mcCam._y = mcCam._y + Math.round(((p1.mc._y - _local2) - mcCam._y) / 12);
}
if (Key.isDown(p1.keyDown1)) {
p1.upTime = 0;
if ((p1.xVel != 0) || (p1.yVel != 0)) {
p1.crouchTime = 0;
} else {
if ((p1.crouchTime > 30) && (p1.yVel == 0)) {
if (p1.state != "ledge") {
mcCam._y = mcCam._y + 6;
} else {
mcCam._y = mcCam._y + 11;
}
}
p1.crouchTime++;
}
} else {
p1.crouchTime = 0;
if (Key.isDown(p1.keyUp1)) {
if ((p1.xVel != 0) || (p1.yVel != 0)) {
p1.upTime = 0;
} else {
if ((p1.upTime > 30) && (p1.yVel == 0)) {
mcCam._y = mcCam._y + -6;
}
p1.upTime++;
}
} else {
p1.upTime = 0;
}
}
if (bossCount == 2) {
if (mcCam._y < mcAll.mcMain.mcBoundCamY1._y) {
mcCam._y = mcAll.mcMain.mcBoundCamY1._y;
}
}
} else {
camlock--;
if (p1.mc._xscale > 0) {
temp = p1.mc._x + 80;
} else {
temp = p1.mc._x - 80;
}
mcCam._x = temp;
mcCam._y = p1.mc._y - _local2;
}
_root._x = ((-(mcCam._x - (((mcCam.mcFrame._width * mcCam._xscale) / 100) / 2))) * Stage.width) / ((mcCam.mcFrame._width * mcCam._xscale) / 100);
_root._y = ((-(mcCam._y - (((mcCam.mcFrame._height * mcCam._xscale) / 100) / 2))) * Stage.height) / ((mcCam.mcFrame._height * mcCam._xscale) / 100);
_root._xscale = (Stage.width / ((mcCam.mcFrame._width * mcCam._xscale) / 100)) * 100;
_root._yscale = (Stage.height / ((mcCam.mcFrame._height * mcCam._xscale) / 100)) * 100;
mcAll.mcMain.mcSky._x = mcCam._x - (mcCam._x / 10);
mcAll.mcMain.mcSky._y = mcCam._y - (mcCam._y / 10);
}
function projControl(projName1) {
var _local2 = this[projName1];
switch (_local2.projType) {
case "fireball" :
if (_local2.state == "thrown") {
if (mapHit.hitTest(_local2.mc._x, _local2.mc._y, true)) {
_local2.mc.gotoAndStop("hit");
_local2.state = "hit";
_local2.phaseCount = -123;
makeFX("fire", (_local2.mc._x - 16) + (Math.random() * 32), (_local2.mc._y - 8) + (Math.random() * 16));
makeFX("fire", (_local2.mc._x - 16) + (Math.random() * 32), (_local2.mc._y - 8) + (Math.random() * 16));
}
if (_local2.state == "thrown") {
_local2.mc.gotoAndStop("idle");
if ((((Math.abs(_local2.mc._x - p1.mc._x) < xCutoff) && (Math.abs(_local2.mc._y - p1.mc._y) < yCutoff)) && ((count % 4) == 0)) && (Math.random() > 0.5)) {
makeFX("fire", _local2.mc._x, (_local2.mc._y - 7) + (Math.random() * 14));
}
if (_local2.xVel > _local2.xMax) {
_local2.xVel = _local2.xMax + ((_local2.xMax - _local2.xVel) / 8);
} else if (_local2.xVel < (-_local2.xMax)) {
_local2.xVel = (-_local2.xMax) + ((_local2.xVel + _local2.xMax) / 8);
}
_local2.mc._x = _local2.mc._x + _local2.xVel;
if (_local2.ySpec > 0) {
_local2.ySpec--;
}
if (_local2.ySpec <= 0) {
if (_local2.yVel > _local2.yMax) {
_local2.yVel = _local2.yMax;
} else if (_local2.yVel < (-_local2.yMax)) {
_local2.yVel = -_local2.yMax;
}
}
_local2.mc._y = _local2.mc._y + _local2.yVel;
if ((Math.abs(_local2.mc._x - p1.mc._x) > xCutoff) || (Math.abs(_local2.mc._y - p1.mc._y) > yCutoff)) {
_local2.state = "dead";
_local2.mc._visible = false;
}
}
} else if (_local2.state == "hit") {
if (_local2.phaseCount == -123) {
_local2.phaseCount = 13;
_local2.mc._rotation = -30 + (Math.random() * 60);
}
_local2.phaseCount--;
_local2.mc.gotoAndStop("hit");
if (_local2.phaseCount <= 0) {
_local2.state = "dead";
_local2.mc._visible = false;
}
}
break;
case "wind" :
if (_local2.state == "thrown") {
_local2.life--;
if (_local2.life <= 0) {
_local2.phaseCount = 8;
_local2.state = "hit";
_local2.mc.gotoAndStop("die");
}
if (mapHit.hitTest(_local2.mc._x, _local2.mc._y, true)) {
temp = false;
if ((_local2.yVel > 0) && (mapHit.hitTest(_local2.mc._x + _local2.xVel, _local2.mc._y - _local2.yMax, true))) {
_local2.xVel = -_local2.xVel;
_local2.mc._rotation = -_local2.mc._rotation;
temp = true;
} else if ((_local2.yVel < 0) && (mapHit.hitTest(_local2.mc._x + _local2.xVel, _local2.mc._y + _local2.yMax, true))) {
_local2.xVel = -_local2.xVel;
_local2.mc._rotation = -_local2.mc._rotation;
temp = true;
}
if ((_local2.xVel > 0) && (mapHit.hitTest(_local2.mc._x - _local2.xMax, _local2.mc._y + _local2.yVel, true))) {
_local2.yVel = -_local2.yVel;
_local2.mc._rotation = -_local2.mc._rotation;
temp = true;
} else if ((_local2.xVel < 0) && (mapHit.hitTest(_local2.mc._x + _local2.xMax, _local2.mc._y + _local2.yVel, true))) {
_local2.yVel = -_local2.yVel;
_local2.mc._rotation = -_local2.mc._rotation;
temp = true;
}
_local2.mc._x = _local2.mc._x + _local2.xVel;
_local2.mc._y = _local2.mc._y + _local2.yVel;
if (temp) {
soundFX.attachSound("s_windbounce");
soundFX.start(0, 0);
soundFX.setPan(Math.ceil(((_local2.mc._x - mcCam._x) / 400) * 100));
}
}
if (_local2.state == "thrown") {
_local2.mc.gotoAndStop("idle");
if (_local2.xVel > _local2.xMax) {
_local2.xVel = _local2.xMax + ((_local2.xMax - _local2.xVel) / 8);
} else if (_local2.xVel < (-_local2.xMax)) {
_local2.xVel = (-_local2.xMax) + ((_local2.xVel + _local2.xMax) / 8);
}
_local2.mc._x = _local2.mc._x + _local2.xVel;
if (((_local2.xVel != 0) && (!Key.isDown(_local2.keyLeft))) && (!Key.isDown(_local2.keyRight))) {
if ((!mapHit.hitTest(x1, y1, true)) && (mapHit.hitTest(x1, y1 + (gravity * 8), true))) {
temp = 0;
while ((temp < (gravity * 8)) && (!mapHit.hitTest(x1, y1 + temp, true))) {
temp = temp + gravity;
}
_local2.mc._y = _local2.mc._y + temp;
}
}
if (_local2.ySpec > 0) {
_local2.ySpec--;
}
if (_local2.ySpec <= 0) {
if (_local2.yVel > _local2.yMax) {
_local2.yVel = _local2.yMax;
} else if (_local2.yVel < (-_local2.yMax)) {
_local2.yVel = -_local2.yMax;
}
}
_local2.mc._y = _local2.mc._y + _local2.yVel;
if ((Math.abs(_local2.mc._x - p1.mc._x) > xCutoff) || (Math.abs(_local2.mc._y - p1.mc._y) > yCutoff)) {
_local2.state = "dead";
_local2.mc._visible = false;
}
}
} else if (_local2.state == "hit") {
if (_local2.phaseCount == -123) {
_local2.phaseCount = 10;
}
_local2.phaseCount--;
if (_local2.phaseCount <= 0) {
_local2.state = "dead";
_local2.mc._visible = false;
}
}
break;
case "lightning" :
if (_local2.state == "thrown") {
_local2.life--;
if (_local2.life <= 0) {
_local2.state = "hit";
}
if (mapHit.hitTest(_local2.mc._x, _local2.mc._y, true)) {
_local2.mc.gotoAndStop("die");
_local2.state = "hit";
_local2.phaseCount = 8;
}
if (_local2.state == "thrown") {
_local2.mc._x = _local2.mc._x + _local2.xVel;
if (_local2.ySpec <= 0) {
if (_local2.yVel > _local2.yMax) {
_local2.yVel = _local2.yMax;
} else if (_local2.yVel < (-_local2.yMax)) {
_local2.yVel = -_local2.yMax;
}
}
_local2.mc._y = _local2.mc._y + _local2.yVel;
if ((Math.abs(_local2.mc._x - p1.mc._x) > xCutoff) || (Math.abs(_local2.mc._y - p1.mc._y) > yCutoff)) {
_local2.state = "dead";
_local2.mc._visible = false;
}
}
} else {
if (_local2.state != "hit") {
break;
}
if (_local2.phaseCount == -123) {
_local2.phaseCount = 13;
_local2.mc._rotation = -30 + (Math.random() * 60);
}
_local2.phaseCount--;
if (_local2.phaseCount > 0) {
break;
}
_local2.state = "dead";
_local2.mc._visible = false;
}
}
}
function p1Hide() {
if (((p1.xVel == 0) && (p1.yVel == 0)) && (p1.attackHold <= 0)) {
if (p1.plane == "ground") {
if ((p1.attackHold < 10) && (!mapHitShadow.hitTest(p1.mc._x, p1.mc._y, true))) {
if (p1.state == "normal") {
p1.plane = "shadow";
p1.mc.gotoAndStop("shadowTransIn");
p1.animHoldIdle = 16;
p1.attackHold = 14;
}
}
} else {
p1.plane = "ground";
p1.mc.gotoAndStop("shadowTransOut");
p1.animHoldIdle = 16;
p1.attackHold = 14;
}
}
}
function shadow_Normal() {
if ((p1.attackHold <= 0) && (p1.xSpec <= 0)) {
if (Key.isDown(p1.keyLeft)) {
if (mapHit.hitTest(p1.mc._x, p1.mc._y + (gravity * 2), true)) {
if (((p1.grabCount <= 0) && (p1.windup <= 0)) && (p1.animHoldWalk <= 0)) {
if (p1.mc._xscale > 0) {
p1.mc.gotoAndStop("shadowTurn");
p1.animHoldIdle = 2;
p1.animHoldWalk = 2;
p1.trans = null;
} else {
p1.mc.gotoAndStop("shadowWalk");
p1.trans = "walk";
}
}
p1.mc._xscale = -100;
temp = p1.xVel - p1.xAcc;
if (temp < (-p1.xShadowMax)) {
temp = -p1.xShadowMax;
}
if (!mapHitShadow.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
if ((!mapHit.hitTest(p1.mc._x + temp, p1.mc._y, true)) && (mapHit.hitTest(p1.mc._x + temp, p1.mc._y + (gravity * 8), true))) {
p1.xVel = temp;
p1.mc._y = p1.mc._y + gravity;
temp = 0;
while ((temp < (gravity * 8)) && (!mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y + temp, true))) {
temp = temp + gravity;
}
p1.mc._y = p1.mc._y + temp;
} else if ((!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) && (mapHit.hitTest((p1.mc._x - p1.xAcc) + temp, p1.mc._y + gravity, true))) {
p1.xVel = temp;
} else if ((!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - 9, true)) && (mapHit.hitTest((p1.mc._x - p1.xAcc) + temp, p1.mc._y + gravity, true))) {
p1.xVel = temp;
temp = gravity * 2;
while (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - temp, true)) {
temp = temp + gravity;
}
if (p1.xVel > (-p1.xAcc)) {
p1.xVel = -p1.xAcc;
}
p1.mc._y = p1.mc._y + ((-temp) + gravity);
p1.yVel = 0;
} else {
if (p1.xVel > 0) {
if (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - gravity, true)) {
temp = p1.xVel - p1.xAcc;
do {
if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
break;
}
temp = temp + (-p1.xAcc);
} while (temp >= 0);
p1.mc._x = p1.mc._x + temp;
}
} else if (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - gravity, true)) {
temp = p1.xVel + p1.xAcc;
do {
if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
break;
}
temp = temp + p1.xAcc;
} while (temp <= 0);
p1.mc._x = p1.mc._x + temp;
}
p1.xVel = 0;
}
} else {
p1.xVel = 0;
}
} else {
temp = p1.xVel - p1.xAirAcc;
if (temp < (-p1.xShadowMax)) {
temp = -p1.xShadowMax;
}
if (((!mapHit.hitTest(p1.mc._x + temp, p1.mc._y, true)) && (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - (p1.head / 2), true))) && (!mapHit.hitTest(p1.mc._x + temp, (p1.mc._y - p1.head) + 6, true))) {
if (p1.xVel < (-p1.xShadowMax)) {
if (((!mapHit.hitTest(p1.mc._x + (temp / 2), p1.mc._y, true)) && (!mapHit.hitTest(p1.mc._x + (temp / 2), p1.mc._y - (p1.head / 2), true))) && (!mapHit.hitTest(p1.mc._x + (temp / 2), (p1.mc._y - p1.head) + 6, true))) {
p1.xVel = p1.xVel + (-p1.xAirAcc);
}
} else {
p1.xVel = p1.xVel + (-p1.xAirAcc);
}
} else {
p1.xVel = 0;
}
p1.mc._xscale = -100;
}
if (soundWinkDone) {
soundWink.attachSound("s_sneak");
soundWink.start(0, 0);
soundWink.setPan(Math.ceil(((p1.mc._x - mcCam._x) / 400) * 100));
soundWink.setVolume(70);
soundWinkDone = false;
}
} else if (Key.isDown(p1.keyRight)) {
if (mapHit.hitTest(p1.mc._x, p1.mc._y + (gravity * 2), true)) {
if (((p1.grabCount <= 0) && (p1.windup <= 0)) && (p1.animHoldWalk <= 0)) {
if (p1.mc._xscale < 0) {
p1.mc.gotoAndStop("shadowTurn");
p1.animHoldIdle = 2;
p1.animHoldWalk = 2;
p1.trans = null;
} else {
p1.mc.gotoAndStop("shadowWalk");
p1.trans = "walk";
}
}
p1.mc._xscale = 100;
temp = p1.xVel + p1.xAcc;
if (temp > p1.xShadowMax) {
temp = p1.xShadowMax;
}
if (!mapHitShadow.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
if ((!mapHit.hitTest(p1.mc._x + temp, p1.mc._y, true)) && (mapHit.hitTest(p1.mc._x + temp, p1.mc._y + (gravity * 8), true))) {
p1.xVel = temp;
p1.mc._y = p1.mc._y + gravity;
temp = 0;
while ((temp < (gravity * 8)) && (!mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y + temp, true))) {
temp = temp + gravity;
}
p1.mc._y = p1.mc._y + temp;
} else if ((!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) && (mapHit.hitTest((p1.mc._x + p1.xAcc) + temp, p1.mc._y + gravity, true))) {
p1.xVel = temp;
} else if ((!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - 9, true)) && (mapHit.hitTest((p1.mc._x + p1.xAcc) + temp, p1.mc._y + gravity, true))) {
p1.xVel = temp;
temp = gravity * 2;
while (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - temp, true)) {
temp = temp + gravity;
}
if (p1.xVel < p1.xAcc) {
p1.xVel = p1.xAcc;
}
p1.mc._y = p1.mc._y + ((-temp) + gravity);
p1.yVel = 0;
} else {
if (p1.xVel > 0) {
if (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - gravity, true)) {
temp = p1.xVel - p1.xAcc;
do {
if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
break;
}
temp = temp + (-p1.xAcc);
} while (temp >= 0);
p1.mc._x = p1.mc._x + temp;
}
} else if (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - gravity, true)) {
temp = p1.xVel + p1.xAcc;
do {
if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
break;
}
temp = temp + p1.xAcc;
} while (temp <= 0);
p1.mc._x = p1.mc._x + temp;
}
p1.xVel = 0;
}
} else {
p1.xVel = 0;
}
} else {
temp = p1.xVel + p1.xAirAcc;
if (temp > p1.xShadowMax) {
temp = p1.xShadowMax;
}
if (((!mapHit.hitTest(p1.mc._x + temp, p1.mc._y, true)) && (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - (p1.head / 2), true))) && (!mapHit.hitTest(p1.mc._x + temp, (p1.mc._y - p1.head) + 6, true))) {
if (p1.xVel > p1.xShadowMax) {
if (((!mapHit.hitTest(p1.mc._x + (temp / 2), p1.mc._y, true)) && (!mapHit.hitTest(p1.mc._x + (temp / 2), p1.mc._y - (p1.head / 2), true))) && (!mapHit.hitTest(p1.mc._x + (temp / 2), (p1.mc._y - p1.head) + 6, true))) {
p1.xVel = p1.xVel + p1.xAirAcc;
}
} else {
p1.xVel = p1.xVel + p1.xAirAcc;
}
} else {
p1.xVel = 0;
}
p1.mc._xscale = 100;
}
if (soundWinkDone) {
soundWink.attachSound("s_sneak");
soundWink.start(0, 0);
soundWink.setPan(Math.ceil(((p1.mc._x - mcCam._x) / 400) * 100));
soundWinkDone = false;
}
} else if (p1.xSpec <= 0) {
if (mapHit.hitTest(p1.mc._x, p1.mc._y + gravity, true)) {
if ((p1.animHoldIdle <= 0) && (p1.yVel == 0)) {
if ((p1.grabCount <= 0) && (p1.windup <= 0)) {
if (p1.trans != null) {
p1.trans = null;
p1.mc.gotoAndStop("shadowIdle1");
p1.animHoldIdle = 1;
} else {
p1.mc.gotoAndStop("shadowIdle");
}
}
}
if (p1.xVel > 0) {
p1.xVel = p1.xVel + ((-p1.xAcc) * 2);
if (p1.xVel <= 0.7) {
p1.xVel = 0;
soundWink.stop();
soundWinkDone = true;
}
} else if (p1.xVel < 0) {
p1.xVel = p1.xVel + (p1.xAcc * 2);
if (p1.xVel >= -0.7) {
p1.xVel = 0;
soundWink.stop();
soundWinkDone = true;
}
}
}
}
}
if (p1.xSpec <= 0) {
if (p1.xVel > p1.xMax) {
p1.xVel = p1.xMax + ((p1.xMax - p1.xVel) / 8);
} else if (p1.xVel < (-p1.xMax)) {
p1.xVel = (-p1.xMax) + ((p1.xVel + p1.xMax) / 8);
}
}
if (p1.xVel != 0) {
if (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - gravity, true)) {
if (p1.xVel > 0) {
temp = p1.xVel - p1.xAcc;
do {
if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
break;
}
temp = temp + (-p1.xAcc);
} while (temp >= 0);
p1.mc._x = p1.mc._x + temp;
} else {
temp = p1.xVel + p1.xAcc;
do {
if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
break;
}
temp = temp + p1.xAcc;
} while (temp <= 0);
p1.mc._x = p1.mc._x + temp;
}
p1.xVel = 0;
}
}
p1.mc._x = p1.mc._x + p1.xVel;
if ((p1.xVel != 0) && (((!Key.isDown(p1.keyLeft)) && (!Key.isDown(p1.keyRight))) || (p1.attackHold > 0))) {
if ((!mapHit.hitTest(p1.mc._x, p1.mc._y, true)) && (mapHit.hitTest(p1.mc._x, p1.mc._y + (gravity * 8), true))) {
p1_slideDownhill();
}
}
}
function ground_Normal() {
if (Key.isDown(p1.keyUp1)) {
if ((!Key.isDown(p1.keyRight)) && (!Key.isDown(p1.keyLeft))) {
if (((p1.attackCount <= 0) && (p1.xSpec <= 0)) && (p1.ySpec <= 0)) {
p1.doorwaypoll = 2;
}
}
} else {
p1.doorwaypoll--;
}
if (!Key.isDown(p1.keyDown1)) {
p1.crouchMoved = false;
p1.crouched = false;
p1.headbouncing = 0;
}
temp = 1;
while (temp <= projectiles) {
temp2 = "proj_" + temp;
temp2 = this[temp2];
if (((temp2.mc._x != undefined) && (temp2.state == "thrown")) && ((temp2.hitTarget == 1) || (temp2.hitTarget == 3))) {
if (Math.abs(temp2.mc._x - p1.mc._x) < 200) {
if (p1.deflecting > 0) {
if (p1.mc.mcMC.mcHit.hitTest(temp2.mc._x, temp2.mc._y, true)) {
p1_projectileDeflect();
}
} else if (p1.mc.mcHit.hitTest(temp2.mc._x, temp2.mc._y, true)) {
p1_projectileHit();
}
}
}
temp++;
}
if (p1.whacking == 2) {
p1_whack();
} else if (p1.whacking == 1) {
p1_staffAttack();
} else if ((p1.whacking == 3) && (p1.attackHold <= 0)) {
p1.whacking = 0;
}
if ((Key.isDown(p1.keyFast) && (p1.yVel == 0)) && (p1.attackHold <= 0)) {
p1.fastPressed = true;
p1.trans = null;
if (p1.mc._xscale > 0) {
if (Key.isDown(p1.keyRight)) {
if ((!p1.rightPressed) || (p1.xSpec <= 0)) {
p1_dashStartRight();
}
p1.rightPressed = true;
} else {
p1.rightPressed = false;
}
} else if (p1.mc._xscale < 0) {
if (Key.isDown(p1.keyLeft)) {
if ((!p1.leftPressed) || (p1.xSpec <= 0)) {
p1_dashStartLeft();
}
p1.leftPressed = true;
} else {
p1.leftPressed = false;
}
}
} else {
p1.fastPressed = false;
}
if (Key.isDown(p1.keyAttack)) {
if ((!p1.attackPressed) && (p1.attackHold <= 0)) {
p1.attackPressed = true;
p1_attacks();
}
} else {
p1.attackPressed = false;
}
if ((Key.isDown(p1.keyGrab) && (p1.attackHold <= 0)) && (p1.xSpec <= 0)) {
if ((!p1.grabPressed) && (p1.holdName != null)) {
if (p1.windup < xThrowMax) {
p1.windup++;
}
if (p1.yVel == 0) {
if (Key.isDown(p1.keyDown1)) {
} else if (Key.isDown(p1.keyRight) || (Key.isDown(p1.keyLeft))) {
if (p1.xVel == 0) {
p1.mc.gotoAndStop("throwWalkWindup");
}
} else if (p1.animHoldIdle <= 0) {
p1.mc.gotoAndStop("throwIdleWindup");
p1.mc.mcMC.gotoAndStop(p1.windup);
}
}
} else if ((!p1.grabPressed) && (p1.grabCount <= 0)) {
p1.grabPressed = true;
p1_grab();
}
} else if (((p1.windup > 0) && (p1.holdName != null)) && (p1.attackHold <= 0)) {
p1_throw();
} else {
p1.grabPressed = false;
}
if ((p1.attackHold <= 0) && (p1.xSpec <= 0)) {
if (Key.isDown(p1.keyLeft)) {
if (mapHit.hitTest(p1.mc._x, p1.mc._y + (gravity * 2), true)) {
if (Key.isDown(p1.keyDown1)) {
p1_crouchWalkLeft();
} else {
p1_walkLeft();
}
} else {
p1_hitWallLeft();
}
} else if (Key.isDown(p1.keyRight)) {
if (mapHit.hitTest(p1.mc._x, p1.mc._y + (gravity * 2), true)) {
if (Key.isDown(p1.keyDown1)) {
p1_crouchWalkRight();
} else {
p1_walkRight();
}
} else {
p1_hitWallRight();
}
} else if (p1.xSpec <= 0) {
p1_idle();
}
} else if (p1.xVel != 0) {
if ((p1.dashHold > 0) && (p1.dashHold < 4)) {
p1_dash();
} else if (p1.dashHold > 0) {
if ((!mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - 9, true)) && (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y, true))) {
playerUpHill();
}
}
}
if (p1.xSpec <= 0) {
if (p1.yVel != 0) {
if (p1.xVel > p1.xAirMax) {
p1.xVel = p1.xAirMax + ((p1.xAirMax - p1.xVel) / 8);
} else if (p1.xVel < (-p1.xAirMax)) {
p1.xVel = (-p1.xAirMax) + ((p1.xVel + p1.xAirMax) / 8);
}
} else if (Key.isDown(p1.keyDown1) && (p1.yVel == 0)) {
if (p1.xVel > p1.xCrouchMax) {
p1.xVel = p1.xCrouchMax + ((p1.xCrouchMax - p1.xVel) / 8);
} else if (p1.xVel < (-p1.xCrouchMax)) {
p1.xVel = (-p1.xCrouchMax) + ((p1.xVel + p1.xCrouchMax) / 8);
}
} else if (p1.xVel > p1.xMax) {
p1.xVel = p1.xMax + ((p1.xMax - p1.xVel) / 8);
} else if (p1.xVel < (-p1.xMax)) {
p1.xVel = (-p1.xMax) + ((p1.xVel + p1.xMax) / 8);
}
}
if (p1.xVel != 0) {
p1_xFinalCheck();
}
p1.mc._x = p1.mc._x + p1.xVel;
if ((p1.xVel != 0) && (((!Key.isDown(p1.keyLeft)) && (!Key.isDown(p1.keyRight))) || (p1.attackHold > 0))) {
if ((!mapHit.hitTest(p1.mc._x, p1.mc._y, true)) && (mapHit.hitTest(p1.mc._x, p1.mc._y + (gravity * 8), true))) {
p1_slideDownhill();
}
}
if (!mapHit.hitTest(p1.mc._x, (p1.mc._y + gravity) + p1.yVel, true)) {
if (p1.state != "ledge") {
p1_fall();
}
} else if (p1.yVel >= 0) {
p1_hitGround();
}
if ((Key.isDown(p1.keyJump) && (p1.state == "normal")) && (p1.attackHold <= 0)) {
p1_jump();
} else if (p1.yVel == 0) {
p1.jumpPressed = false;
p1.doubleJumped = false;
} else {
p1.dJumpOK = true;
}
if (p1.headbouncing == 2) {
p1_headbounce_Step2();
}
if ((p1.yVel < 0) && (p1.state != "ledge")) {
p1_ceilingCheck();
}
if (p1.ySpec <= 0) {
if (p1.yVel > p1.yMax) {
p1.yVel = p1.yMax;
} else if (p1.yVel < (-p1.yMax)) {
p1.yVel = -p1.yMax;
}
}
p1.mc._y = p1.mc._y + p1.yVel;
}
function ground_Grabbing() {
if (Key.isDown(p1.keyGrab)) {
if (!p1.grabPressed) {
p1.grabPressed = true;
if ((p1.holdName != null) && (p1.attackHold <= 0)) {
if (p1.yVel == 0) {
if (Key.isDown(p1.keyRight)) {
if (p1.mc._xscale > 0) {
p1_throwEnemyWalk(true);
} else {
p1_chokeEnemy();
}
} else if (Key.isDown(p1.keyLeft)) {
if (p1.mc._xscale < 0) {
p1_throwEnemyWalk(false);
} else {
p1_chokeEnemy();
}
} else {
p1_throwEnemyIdle();
}
}
if (p1.mc._xscale < 0) {
p1.holdName.xVel = -p1.holdName.xVel;
}
p1.grabPressed = true;
p1.grabCount = 0;
p1.windup = 0;
p1.state = "normal";
}
}
} else {
p1.grabPressed = false;
}
if (p1.state == "grabbing") {
if (p1.grabCount <= 0) {
if ((p1.attackHold <= 0) && (p1.xSpec <= 0)) {
if (Key.isDown(p1.keyLeft)) {
p1_grabbingWalkLeft();
} else if (Key.isDown(p1.keyRight)) {
p1_grabbingWalkRight();
} else if (p1.xSpec <= 0) {
p1_grabbingIdle();
}
}
}
if (p1.xVel != 0) {
p1_xFinalCheck();
}
p1.mc._x = p1.mc._x + p1.xVel;
if ((p1.xVel != 0) && (((!Key.isDown(p1.keyLeft)) && (!Key.isDown(p1.keyRight))) || (p1.attackHold > 0))) {
if ((!mapHit.hitTest(p1.mc._x, p1.mc._y, true)) && (mapHit.hitTest(p1.mc._x, p1.mc._y + (gravity * 8), true))) {
p1_slideDownhill();
}
}
if (!mapHit.hitTest(p1.mc._x, (p1.mc._y + gravity) + p1.yVel, true)) {
if (p1.ySpec <= 0) {
p1.yVel = p1.yVel + gravity;
if (p1.yVel > gravity) {
p1.jumping = false;
}
}
if ((p1.grabCount <= 0) && (p1.animHoldAir <= 0)) {
p1.mc.gotoAndStop("fall");
p1.jumpPressed = true;
p1.animHoldAir = 16;
}
if (p1.yVel > 0) {
p1.fallTime++;
}
} else {
p1_hitGround();
}
if (p1.ySpec <= 0) {
if (p1.yVel > p1.yMax) {
p1.yVel = p1.yMax;
} else if (p1.yVel < (-p1.yMax)) {
p1.yVel = -p1.yMax;
}
}
p1.mc._y = p1.mc._y + p1.yVel;
}
}
function ground_Stuck() {
if (p1.stuckAttackPoll == 1) {
p1.stuckAttackPoll = 0;
}
if ((p1.xSpec < 500) && (p1.stuckAttackPoll <= 0)) {
if (Key.isDown(p1.keyJump)) {
if (!p1.jumpPressed) {
p1.jumpPressed = true;
if (!mapHit.hitTest(p1.mc._x, p1.mc._y + 10, true)) {
p1.mc.gotoAndStop("stuckDrop");
p1.animHoldAir = 4;
p1.state = "normal";
soundWink.stop();
soundWink.attachSound("s_stickOFF");
soundWink.start(0, 0);
soundWink.setPan(Math.ceil(((p1.mc._x - mcCam._x) / 400) * 100));
}
}
} else {
p1.jumpPressed = false;
}
temp = gravity;
while (mapHit.hitTest(p1.mc._x, (p1.mc._y - 40) + temp, true)) {
p1.mc._y = p1.mc._y + gravity;
temp = temp + gravity;
}
if (mapHit.hitTest(p1.mc._x, p1.mc._y - 6, true)) {
p1.mc.gotoAndStop("thrown");
p1.state = "thrown";
if (p1.mc._xscale > 0) {
p1.xVel = 10;
} else {
p1.xVel = -10;
}
}
if (p1.state == "stuck") {
soundWink.setVolume(90);
if (Key.isDown(p1.keyLeft)) {
if (((p1.grabCount <= 0) && (p1.windup <= 0)) && (p1.animHoldWalk <= 0)) {
}
temp = p1.xVel - p1.xAcc;
if (temp < (-p1.xStuckMax)) {
temp = -p1.xStuckMax;
}
if ((!mapHit.hitTest((p1.mc._x - 10) + temp, (p1.mc._y - p1.head) + 10, true)) && (mapHit.hitTest((p1.mc._x - 10) + temp, (p1.mc._y - p1.head) - 10, true))) {
p1.xVel = temp;
if (p1.mc._xscale < 0) {
p1.mc.gotoAndStop("stuckWalkF");
} else {
p1.mc.gotoAndStop("stuckWalkB");
}
p1.trans = "walk";
if (soundWinkDone) {
if (Math.random() > 0.5) {
soundWink.attachSound("s_stickA");
} else {
soundWink.attachSound("s_stickB");
}
soundWink.start(0, 0);
soundWinkDone = false;
}
soundWink.setPan(Math.ceil(((p1.mc._x - mcCam._x) / 400) * 100));
} else {
p1.xVel = 0;
if (p1.trans == "walk") {
p1.trans = null;
p1.mc.gotoAndStop("stuck1");
p1.animHoldIdle = 4;
} else {
p1.mc.gotoAndStop("stuck");
}
}
} else if (Key.isDown(p1.keyRight)) {
if (((p1.grabCount <= 0) && (p1.windup <= 0)) && (p1.animHoldWalk <= 0)) {
}
temp = p1.xVel + p1.xAcc;
if (temp > p1.xStuckMax) {
temp = p1.xStuckMax;
}
if ((!mapHit.hitTest((p1.mc._x + 10) + temp, (p1.mc._y - p1.head) + 10, true)) && (mapHit.hitTest((p1.mc._x + 10) + temp, (p1.mc._y - p1.head) - 10, true))) {
p1.xVel = temp;
if (p1.mc._xscale > 0) {
p1.mc.gotoAndStop("stuckWalkF");
} else {
p1.mc.gotoAndStop("stuckWalkB");
}
p1.trans = "walk";
if (soundWinkDone) {
if (Math.random() > 0.5) {
soundWink.attachSound("s_stickA");
} else {
soundWink.attachSound("s_stickB");
}
soundWink.start(0, 0);
soundWinkDone = false;
}
soundWink.setPan(Math.ceil(((p1.mc._x - mcCam._x) / 400) * 100));
} else {
p1.xVel = 0;
if (p1.trans == "walk") {
p1.trans = null;
p1.mc.gotoAndStop("stuck1");
p1.animHoldIdle = 4;
} else {
p1.mc.gotoAndStop("stuck");
}
}
} else {
if (p1.animHoldIdle <= 0) {
if (p1.trans != null) {
p1.trans = null;
p1.mc.gotoAndStop("stuck1");
p1.animHoldIdle = 4;
} else {
p1.mc.gotoAndStop("stuck");
}
}
if (p1.xVel > 0) {
p1.xVel = p1.xVel + ((-p1.xAcc) * 2);
if (p1.xVel <= 0.7) {
p1.xVel = 0;
soundWink.stop();
soundWinkDone = true;
}
} else if (p1.xVel < 0) {
p1.xVel = p1.xVel + (p1.xAcc * 2);
if (p1.xVel >= -0.7) {
p1.xVel = 0;
soundWink.stop();
soundWinkDone = true;
}
}
}
p1.mc._x = p1.mc._x + p1.xVel;
if (!mapHit.hitTest((p1.mc._x + 10) + temp, (p1.mc._y - p1.head) + 15, true)) {
p1.mc._y = p1.mc._y + (-gravity);
}
}
if (p1.state == "stuck") {
if (p1.stuckAttackPoll <= 0) {
if (Key.isDown(p1.keyAttack)) {
if (!p1.attackPressed) {
p1.attackPressed = true;
p1.stuckAttackPoll = 1;
}
} else {
p1.attackPressed = false;
}
}
}
} else if (p1.stuckAttackPoll == 2) {
p1.stuckAttackPoll = 0;
p1.xSpec = 1000;
p1.mc.gotoAndStop("stuckAttack");
soundWink.attachSound("s_stickOFF");
soundWink.start(0, 0);
} else if (p1.xSpec >= 950) {
if (Math.floor(p1.xSpec) <= 997) {
p1.xSpec = 900;
p1.yVel = 10;
p1.xVel = (p1.holdName.mc._x - p1.mc._x) / 8;
p1.mc._x = p1.mc._x + p1.xVel;
p1.mc._y = p1.mc._y + p1.yVel;
}
} else if (p1.xSpec <= 900) {
p1.xVel = (p1.holdName.mc._x - p1.mc._x) / 8;
p1.mc._x = p1.mc._x + p1.xVel;
p1.yVel = p1.yVel + gravity;
p1.mc._y = p1.mc._y + p1.yVel;
if (Math.abs((p1.holdName.mc._y - p1.holdName.head) - p1.mc._y) < 22) {
p1.xVel = 0;
p1.yVel = 0;
p1.mc._x = p1.holdName.mc._x;
p1.mc._y = p1.holdName.mc._y;
p1.attackHold = 29;
p1.xSpec = 29;
p1.animHoldIdle = 35;
p1.animHoldWalk = 35;
p1.state = "normal";
p1.mc.gotoAndStop("stuckAttackFinish");
if (((p1.mc._xscale > 0) && (p1.holdName.mc._xscale > 0)) || ((p1.mc._xscale < 0) && (p1.holdName.mc._xscale < 0))) {
p1.holdName.mc.gotoAndStop("deathNeckRight");
} else {
p1.holdName.mc.gotoAndStop("deathNeckLeft");
}
if (p1.holdName.holdName != null) {
p1.holdName.holdName.state = "thrown";
p1.holdName.holdName.mc._rotation = 0;
p1.holdName.holdName.xVel = (Math.random() * 32) - 16;
p1.holdName.holdName.yVel = (Math.random() * -10) - 12;
p1.holdName.holdName.grabbedName = null;
p1.holdName.holdName = null;
p1.holdName.grabCount = 0;
}
p1.holdName.state = "dead";
p1.holdName.hp = 0;
p1.holdName = null;
soundWink.attachSound("s_stuckattack");
soundWink.start(0, 0);
}
}
}
function ground_Thrown() {
if (p1.xVel > 0) {
if (p1.yVel != 0) {
p1.xVel = p1.xVel / frictionAir;
} else {
p1.xVel = p1.xVel / friction;
}
if (p1.xVel <= 0.3) {
p1.xVel = 0;
}
} else if (p1.xVel < 0) {
if (p1.yVel != 0) {
p1.xVel = p1.xVel / frictionAir;
} else {
p1.xVel = p1.xVel / friction;
}
if (p1.xVel >= -0.3) {
p1.xVel = 0;
}
}
if (p1.xVel != 0) {
if (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - (gravity * 2), true)) {
if (p1.xVel > 0) {
temp = p1.xVel - p1.xAcc;
enemyBounceRight(p1, temp);
} else {
temp = p1.xVel + p1.xAcc;
enemyBounceLeft(p1, temp);
}
if (Math.abs(p1.xVel) <= 0.3) {
p1.xVel = 0;
}
} else if (p1.xVel > p1.xMax) {
if (mapHit.hitTest(p1.mc._x + (p1.xVel / 2), p1.mc._y - (gravity * 2), true)) {
temp = (p1.xVel / 2) - p1.xAcc;
enemyBounceRight(p1, temp);
} else if (mapHit.hitTest(p1.mc._x, p1.mc._y - (gravity * 2), true)) {
temp = -p1.xAcc;
enemyBounceRight(p1, temp);
}
} else if (p1.xVel < (-p1.xMax)) {
if (mapHit.hitTest(p1.mc._x + (p1.xVel / 2), p1.mc._y - (gravity * 2), true)) {
temp = (p1.xVel / 2) + p1.xAcc;
enemyBounceLeft(p1, temp);
} else if (mapHit.hitTest(p1.mc._x, p1.mc._y - (gravity * 2), true)) {
temp = p1.xAcc;
enemyBounceLeft(p1, temp);
}
}
}
p1.mc._x = p1.mc._x + p1.xVel;
if (p1.xVel != 0) {
if ((!mapHit.hitTest(p1.mc._x, p1.mc._y, true)) && (mapHit.hitTest(p1.mc._x, p1.mc._y + (gravity * 8), true))) {
p1_slideDownhill();
}
}
if (p1.yVel > p1.yMax) {
p1.yVel = p1.yMax;
}
if (!mapHit.hitTest(p1.mc._x, (p1.mc._y + gravity) + p1.yVel, true)) {
if ((Math.abs(p1.xVel) > 20) || (Math.abs(p1.yVel) > 12)) {
p1.mc.gotoAndStop("thrownBlur");
} else {
p1.mc.gotoAndStop("thrown");
}
if (p1.yVel > 20) {
if (!mapHit.hitTest(p1.mc._x, (p1.mc._y + gravity) + (p1.yVel / 2), true)) {
p1.yVel = p1.yVel + gravity;
if (p1.yVel > gravity) {
p1.jumping = false;
}
if (!p1.jumping) {
}
} else {
actorHitGround(p1);
p1._y = p1._y + (-gravity);
}
} else {
p1.yVel = p1.yVel + gravity;
if (p1.yVel > gravity) {
p1.jumping = false;
}
if (!p1.jumping) {
}
}
} else {
actorHitGround(p1);
p1.mc.gotoAndStop("bouncing");
if (random(10) < 7) {
if (p1.xVel > 1) {
makeDust(p1.mc._x + 14, p1.mc._y, true, 30);
} else if (p1.xVel < -1) {
makeDust(p1.mc._x - 14, p1.mc._y, false, 30);
}
}
if (p1.xVel == 0) {
if (!mapHit.hitTest(p1.mc._x - 10, p1.mc._y + 3, true)) {
p1.xVel = p1.yVel * 2;
} else if (!mapHit.hitTest(p1.mc._x - 20, p1.mc._y + 3, true)) {
p1.xVel = p1.yVel;
} else if (!mapHit.hitTest(p1.mc._x - 40, p1.mc._y + 3, true)) {
p1.xVel = p1.yVel / 2;
} else if (!mapHit.hitTest(p1.mc._x + 10, p1.mc._y + 3, true)) {
p1.xVel = (-p1.yVel) * 2;
} else if (!mapHit.hitTest(p1.mc._x + 20, p1.mc._y + 3, true)) {
p1.xVel = -p1.yVel;
} else if (!mapHit.hitTest(p1.mc._x + 40, p1.mc._y + 3, true)) {
p1.xVel = (-p1.yVel) / 2;
}
if (soundWinkDone) {
soundWink.attachSound("s_winkhit2");
soundWink.start(0, 0);
soundWink.setPan(Math.ceil(((p1.mc._x - mcCam._x) / 400) * 100));
soundWinkDone = false;
}
}
}
if (p1.yVel < 0) {
if (mapHit.hitTest(p1.mc._x, (p1.mc._y - p1.head) + p1.yVel, true)) {
temp = p1.yVel + gravity;
p1.mc._y = p1.mc._y + temp;
p1.yVel = 0.001;
while (mapHit.hitTest(p1.mc._x, (p1.mc._y - p1.head) + temp, true)) {
p1.mc._y = p1.mc._y + gravity;
temp = temp + gravity;
}
}
}
p1.mc._y = p1.mc._y + p1.yVel;
if ((p1.xVel == 0) && (p1.yVel == 0)) {
if (thrownName == p1) {
thrownName = null;
}
p1.state = "down";
} else {
p1.downCount = 5;
}
}
function ground_Down() {
p1.downTime--;
p1.mc.gotoAndStop("down");
if (p1.downTime <= 0) {
p1.state = "normal";
p1.trans = null;
p1.mc.gotoAndStop("getup");
p1.animHoldIdle = 11;
p1.attackHold = 10;
}
}
function ground_Ledge() {
if (p1.xSpec <= 0) {
if (Key.isDown(p1.keyJump)) {
p1.state = "normal";
p1.falling = true;
p1.mc.gotoAndStop("falling");
}
if (p1.state == "ledge") {
if (Key.isDown(p1.keyUp1)) {
p1.animHoldIdle = 23;
p1.animHoldAir = 23;
p1.xSpec = 1007;
p1.ySpec = 22;
p1.attackHold = 22;
p1.mc.gotoAndStop("ledgeClimb");
p1.trans = null;
}
if (Key.isDown(p1.keyDown1)) {
p1.crouchTime++;
}
}
} else if ((p1.xSpec <= 1000) && (p1.xSpec > 998)) {
p1.xSpec = 15;
p1.state = "normal";
p1.mc._y = p1.mc._y + -26.7;
if (p1.mc._xscale < 0) {
p1.mc._x = p1.mc._x + -10.5;
} else {
p1.mc._x = p1.mc._x + 10.5;
}
}
}
function grabbingBoss() {
if (Key.isDown(p1.keyGrab)) {
p1.mc.gotoAndStop("grabBossPull");
boss.mc.gotoAndStop("grabbed");
boss.state = "grabbed";
boss.stopCount = 60;
}
}
function playerUpHill() {
if (p1.xVel > 0) {
temp = gravity;
while (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - temp, true)) {
temp = temp + gravity;
}
if (p1.xVel < p1.xAcc) {
p1.xVel = p1.xAcc;
}
p1.mc._y = p1.mc._y + ((-temp) + gravity);
p1.yVel = 0;
} else {
temp = gravity;
while (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - temp, true)) {
temp = temp + gravity;
}
if (p1.xVel > (-p1.xAcc)) {
p1.xVel = -p1.xAcc;
}
p1.mc._y = p1.mc._y + ((-temp) + gravity);
p1.yVel = 0;
}
}
function p1_headbounce_Step2() {
with (p1) {
headbouncing = 0;
if (!bounced) {
bounced = true;
yVel = -11;
} else {
yVel = -17;
}
jumping = true;
jumpPressed = true;
mc.gotoAndStop("headbounceUp");
animHoldAir = 17;
if (sp < 100) {
sp = sp + 1;
updateStealth = true;
}
}
}
function p1_ceilingCheck() {
if (mapHit.hitTest(p1.mc._x, (p1.mc._y - p1.head) + p1.yVel, true)) {
temp = p1.yVel + gravity;
p1.mc._y = p1.mc._y + temp;
p1.yVel = 0.001;
while (mapHit.hitTest(p1.mc._x, (p1.mc._y - p1.head) + temp, true)) {
p1.mc._y = p1.mc._y + gravity;
temp = temp + gravity;
if (mapHit.hitTest(p1.mc._x, p1.mc._y + gravity, true)) {
if (mapHit.hitTest(p1.mc._x - 50, p1.mc._y, true)) {
p1.mc._x = p1.mc._x + 50;
} else {
p1.mc._x = p1.mc._x + -50;
}
}
}
if (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y + 20, true)) {
p1.mc._x = p1.mc._x + (-p1.xVel);
p1.xVel = 0;
}
}
}
function p1_projectileDeflect() {
if (temp2.projType == "fireball") {
temp2.xVel = (-temp2.xVel) * 2;
temp2.mc._xscale = -temp2.mc._xscale;
temp2.hitTarget = 2;
makeFX("fire", (temp2.mc._x - 16) + (Math.random() * 32), (temp2.mc._y - 8) + (Math.random() * 16));
makeFX("fire", (temp2.mc._x - 16) + (Math.random() * 32), (temp2.mc._y - 8) + (Math.random() * 16));
} else if (temp2.projType == "wind") {
temp2.xVel = (-temp2.xVel) * 2;
temp2.mc._xscale = -temp2.mc._xscale;
temp2.mc._rotation = -temp2.mc._rotation;
temp2.hitTarget = 2;
} else if (temp2.projType == "lightning") {
temp2.xVel = 0;
temp2.yVel = 0;
temp2.mc.gotoAndStop("deflected");
temp2.state = "hit";
temp2.phaseCount = 14;
temp2.mc._rotation = 0;
var _local2 = projectiles;
i = 1;
while (i <= projectiles) {
j = "proj_" + i;
if ((!this[j].mc._visible) || (this[j].mc == undefined)) {
_local2 = i;
break;
}
i++;
}
mcAll.mcMain.attachMovie("lightning", "proj_mc_" + _local2, projectileDepth + _local2, {_x:x, _y:y});
this["proj_" + _local2] = new projectile(mcAll.mcMain["proj_mc_" + _local2], "lightning", 2);
temp2 = this["proj_" + _local2];
temp2.life = 10;
temp2.xVel = 15;
temp2.mc._x = temp2.mc._x + 20;
temp2.mc._rotation = Math.random() * 180;
temp2.mc.gotoAndStop("idle2");
i = i + 1;
while (i <= projectiles) {
j = "proj_" + i;
if ((!this[j].mc._visible) || (this[j].mc == undefined)) {
_local2 = i;
break;
}
i++;
}
mcAll.mcMain.attachMovie("lightning", "proj_mc_" + _local2, projectileDepth + _local2, {_x:x, _y:y});
this["proj_" + _local2] = new projectile(mcAll.mcMain["proj_mc_" + _local2], "lightning", 2);
temp2 = this["proj_" + _local2];
temp2.life = 10;
temp2.xVel = -15;
temp2.mc._x = temp2.mc._x + -20;
temp2.mc._rotation = Math.random() * 180;
temp2.mc.gotoAndStop("idle2");
i = i + 1;
while (i <= projectiles) {
j = "proj_" + i;
if ((!this[j].mc._visible) || (this[j].mc == undefined)) {
_local2 = i;
break;
}
i++;
}
mcAll.mcMain.attachMovie("lightning", "proj_mc_" + _local2, projectileDepth + _local2, {_x:x, _y:y});
this["proj_" + _local2] = new projectile(mcAll.mcMain["proj_mc_" + _local2], "lightning", 2);
temp2 = this["proj_" + _local2];
temp2.life = 7;
if (p1.mc._xscale < 0) {
temp2.xVel = -15;
temp2.mc._x = temp2.mc._x + -165;
} else {
temp2.xVel = 15;
temp2.mc._x = temp2.mc._x + 165;
}
temp2.mc._rotation = Math.random() * 180;
temp2.mc.gotoAndStop("idle2");
}
if (p1.sp < 100) {
p1.sp = p1.sp + 1;
p1.updateStealth = true;
}
}
function p1_projectileHit() {
p1.xVel = temp2.xVel;
if (p1.xVel > 0) {
p1.xVel = p1.xVel + (Math.random() * 4);
} else {
p1.xVel = p1.xVel + (Math.random() * -4);
}
p1.yVel = (Math.random() * -6) - 8;
p1.state = "thrown";
p1.mc.gotoAndStop("thrown");
p1.trans = null;
p1.hp = p1.hp + (-temp2.bp);
p1.updateHealth = true;
if (p1.holdName != null) {
p1.holdName.state = "thrown";
p1.holdName.mc._rotation = 0;
p1.holdName.xVel = (Math.random() * 10) + p1.xVel;
p1.holdName.yVel = (Math.random() * -6) - 10;
p1.holdName.grabbedName = null;
p1.holdName = null;
p1.grabCount = 0;
}
if (temp2.projType == "fireball") {
temp2.state = "hit";
temp2.mc.gotoAndStop("hit");
temp2.phaseCount = -123;
makeFX("fire", (temp2.mc._x - 16) + (Math.random() * 32), (temp2.mc._y - 8) + (Math.random() * 16));
makeFX("fire", (temp2.mc._x - 16) + (Math.random() * 32), (temp2.mc._y - 8) + (Math.random() * 16));
soundWink.attachSound("s_winkhit2");
soundWink.start(0, 0);
soundWink.setPan(Math.ceil(((p1.mc._x - mcCam._x) / 400) * 100));
soundWinkDone = true;
} else if (temp2.projType == "wind") {
temp2.state = "hit";
temp2.mc.gotoAndStop("hit");
temp2.phaseCount = -123;
soundWink.attachSound("s_winkhit2");
soundWink.start(0, 0);
soundWink.setPan(Math.ceil(((p1.mc._x - mcCam._x) / 400) * 100));
soundWinkDone = true;
} else if (temp2.projType == "lightning") {
temp2.state = "hit";
temp2.mc.gotoAndStop("hit");
temp2.phaseCount = -123;
soundFX.attachSound("s_lightninghit");
soundFX.start(0, 0);
soundFX.setPan(Math.ceil(((p1.mc._x - mcCam._x) / 400) * 100));
}
}
function p1_whack() {
p1.whacking = 3;
p1.trans = null;
p1.mc.gotoAndStop("staffMelee");
p1.animholdIdle = 20;
p1.attackHold = 19;
}
function p1_staffAttack() {
p1.whacking = 0;
p1.trans = null;
p1.mc.gotoAndStop("staffAttack3");
p1.animholdIdle = 14;
p1.attackHold = 13;
staffAttack(p1.holdName, 3, 2, -123);
}
function p1_attacks() {
temp = p1.holdName.mc._name.substring(0, 5);
if (p1.yVel == 0) {
if (temp == "staff") {
if (p1.dashHold < 0) {
if (Key.isDown(p1.keyUp1)) {
p1.xVel = 0;
p1.trans = null;
if (Key.isDown(p1.keyLeft) || (Key.isDown(p1.keyRight))) {
p1.mc.gotoAndStop("staffAttack3");
p1.attackHold = 14;
staffAttack(p1.holdName, 2, 2, -123);
} else {
p1.mc.gotoAndStop("staffAttack1");
p1.attackHold = 14;
staffAttack(p1.holdName, 1, 2, -123);
}
} else if (Key.isDown(p1.keyDown1)) {
p1.xVel = 0;
p1.mc.gotoAndStop("staffDeflect");
p1.animHoldIdle = 13;
p1.attackHold = 12;
p1.deflecting = 12;
p1.trans = null;
soundWink.attachSound("s_deflect");
soundWink.start(0, 0);
soundWink.setPan(Math.ceil(((p1.mc._x - mcCam._x) / 400) * 100));
} else {
p1.xVel = 0;
p1.whacking = 1;
}
}
}
} else if (temp == "staff") {
if (Key.isDown(p1.keyDown1)) {
if (Key.isDown(p1.keyLeft) || (Key.isDown(p1.keyRight))) {
p1.mc.gotoAndStop("staffAttackAir3");
p1.attackHold = 14;
p1.animHoldAir = 14;
staffAttack(p1.holdName, 4, 2, -123);
} else {
p1.mc.gotoAndStop("staffAttackAir5");
p1.attackHold = 14;
p1.animHoldAir = 14;
staffAttack(p1.holdName, 5, 2, -123);
}
} else if (Key.isDown(p1.keyUp1)) {
if (Key.isDown(p1.keyLeft) || (Key.isDown(p1.keyRight))) {
p1.mc.gotoAndStop("staffAttackAir3");
p1.attackHold = 14;
p1.animHoldAir = 14;
staffAttack(p1.holdName, 2, 2, -123);
} else {
p1.mc.gotoAndStop("staffAttackAir1");
p1.attackHold = 14;
p1.animHoldAir = 14;
staffAttack(p1.holdName, 1, 2, -123);
}
} else {
p1.mc.gotoAndStop("staffAttackAir3");
p1.attackHold = 14;
p1.animHoldAir = 14;
staffAttack(p1.holdName, 3, 2, -123);
}
}
}
function p1_dashStartRight() {
with (p1) {
dashCount = 0;
dashHold = 9;
xVel = dashVel;
mc.gotoAndStop("dashStart");
xSpec = 9;
animHoldWalk = 9;
animHoldIdle = 9;
if (random(10) < 6) {
soundWink.attachSound("s_run");
soundWink.start(0, 0);
soundWink.setPan(Math.ceil(((p1.mc._x - mcCam._x) / 400) * 100));
soundWink.setVolume(80);
soundWinkDone = false;
}
}
}
function p1_dashStartLeft() {
with (p1) {
dashCount = 0;
dashHold = 9;
xVel = -dashVel;
mc.gotoAndStop("dashStart");
xSpec = 9;
animHoldWalk = 9;
animHoldIdle = 9;
soundWink.attachSound("s_run");
soundWink.start(0, 0);
soundWink.setPan(Math.ceil(((p1.mc._x - mcCam._x) / 400) * 100));
soundWink.setVolume(80);
soundWinkDone = false;
}
}
function p1_grab() {
p1.grabCount = 10;
if (p1.yVel != 0) {
p1.mc.gotoAndStop("grabAir");
} else if (Key.isDown(p1.keyDown1)) {
p1.xVel = 0;
p1.mc.gotoAndStop("grabCrouch");
} else if (Key.isDown(p1.keyRight) || (Key.isDown(p1.keyLeft))) {
p1.grabCount = 10;
p1.xVel = 0;
p1.mc.gotoAndStop("grabWalk");
p1.attackHold = 14;
p1.animHoldIdle = 24;
p1.trans = null;
} else {
p1.grabCount = 10;
p1.xVel = 0;
p1.mc.gotoAndStop("grabIdle");
p1.attackHold = 14;
p1.animHoldIdle = 24;
}
}
function p1_throw() {
if (p1.yVel == 0) {
if (Key.isDown(p1.keyUp1)) {
if (Key.isDown(p1.keyRight) || (Key.isDown(p1.keyLeft))) {
p1.holdName.xVel = p1.windup + 10;
p1.holdName.yVel = (-p1.windup) - 10;
if (p1.holdName.yVel < (-yThrowMax)) {
p1.holdName.yVel = -yThrowMax;
}
p1.mc.gotoAndStop("throwWalk2");
p1.animHoldWalk = 7;
} else {
p1.holdName.xVel = 0;
p1.holdName.yVel = (-p1.windup) - 15;
if (p1.holdName.yVel < (-yThrowMax)) {
p1.holdName.yVel = -yThrowMax;
}
p1.mc.gotoAndStop("throwIdle1");
p1.animHoldIdle = 7;
}
} else if (Key.isDown(p1.keyRight) || (Key.isDown(p1.keyLeft))) {
if (Key.isDown(p1.keyDown1)) {
p1.holdName.xVel = p1.windup + 10;
p1.holdName.yVel = p1.windup + 10;
if (p1.holdName.yVel > yThrowMax) {
p1.holdName.yVel = yThrowMax;
}
p1.mc.gotoAndStop("throwCrouch");
p1.animHoldCrouch = 11;
} else {
p1.xVel = 0;
p1.xSpec = 12;
p1.holdName.xVel = p1.windup + 20;
p1.holdName.yVel = (-p1.windup) / 4;
p1.mc.gotoAndStop("throwWalk3");
p1.animHoldWalk = 16;
}
} else if (Key.isDown(p1.keyDown1)) {
if (mapHit.hitTest(p1.holdName.mc._x, p1.holdName.mc._y - gravity, true)) {
p1.holdName.mc._x = p1.mc._x;
}
p1.holdName.xVel = 0;
p1.holdName.yVel = p1.windup;
p1.mc.gotoAndStop("throwCrouch");
p1.animHoldCrouch = 11;
} else {
p1.holdName.xVel = p1.windup + 8;
p1.holdName.yVel = (-p1.windup) / 4;
if (p1.windup > 4) {
p1.mc.gotoAndStop("throwIdle3");
p1.animHoldIdle = 16;
} else {
p1.mc.gotoAndStop("throwIdle3b");
p1.animHoldIdle = 10;
}
if (mapHit.hitTest(p1.holdName.mc._x, p1.holdName.mc._y - gravity, true)) {
p1.holdName.mc._x = p1.mc._x;
}
}
} else if (Key.isDown(p1.keyRight) || (Key.isDown(p1.keyLeft))) {
if (Key.isDown(p1.keyUp1)) {
p1.holdName.xVel = p1.windup + 10;
p1.holdName.yVel = (-p1.windup) - 10;
if (p1.holdName.yVel < (-yThrowMax)) {
p1.holdName.yVel = -yThrowMax;
p1.mc.gotoAndStop("throwAir2");
p1.animHoldAir = 12;
}
} else if (Key.isDown(p1.keyDown1)) {
p1.holdName.xVel = p1.windup + 10;
p1.holdName.yVel = p1.windup + 10;
p1.holdName.yVel = yThrowMax;
p1.mc.gotoAndStop("throwAir4");
p1.animHoldAir = 14;
} else {
p1.holdName.xVel = p1.windup + 10;
p1.holdName.yVel = (-p1.windup) / 4;
p1.mc.gotoAndStop("throwAir3");
p1.animHoldAir = 12;
}
} else if (Key.isDown(p1.keyUp1)) {
p1.holdName.xVel = 0;
p1.holdName.yVel = (-p1.windup) - 15;
if (p1.holdName.yVel < (-yThrowMax)) {
p1.holdName.yVel = -yThrowMax;
}
p1.mc.gotoAndStop("throwAir1");
p1.animHoldAir = 7;
} else if (Key.isDown(p1.keyDown1)) {
p1.holdName.xVel = 0;
p1.holdName.yVel = p1.windup + 10;
if (p1.holdName.yVel > yThrowMax) {
p1.holdName.yVel = yThrowMax;
}
p1.mc.gotoAndStop("throwAir5");
p1.animHoldAir = 15;
} else {
p1.holdName.xVel = p1.windup + 8;
p1.holdName.yVel = (-p1.windup) / 4;
p1.mc.gotoAndStop("throwAir3");
p1.animHoldAir = 7;
}
if (p1.mc._xscale < 0) {
p1.holdName.xVel = -p1.holdName.xVel;
}
p1.holdName.state = "thrown";
p1.holdName.mc._rotation = 0;
p1.grabPressed = false;
thrownName = p1.holdName;
p1.holdName.grabbedName = null;
p1.holdName = null;
p1.grabCount = 0;
p1.windup = 0;
}
function p1_crouchWalkLeft() {
p1.crouchMoved = true;
p1.crouched = false;
if (((p1.grabCount <= 0) && (p1.windup <= 0)) && (p1.animHoldCrouch <= 0)) {
p1.mc.gotoAndStop("crouchWalk");
p1.trans = "walk";
}
p1.mc._xscale = -100;
temp = p1.xVel - p1.xAcc;
if (temp < (-p1.xCrouchMax)) {
temp = -p1.xCrouchMax;
}
if ((!mapHit.hitTest(p1.mc._x + temp, p1.mc._y, true)) && (mapHit.hitTest(p1.mc._x + temp, p1.mc._y + (gravity * 8), true))) {
p1.xVel = temp;
p1.mc._y = p1.mc._y + gravity;
temp = 0;
while ((temp < (gravity * 8)) && (!mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y + temp, true))) {
temp = temp + gravity;
}
p1.mc._y = p1.mc._y + temp;
} else if ((!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) && (mapHit.hitTest((p1.mc._x - p1.xAcc) + temp, p1.mc._y + gravity, true))) {
p1.xVel = temp;
} else if ((!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - 9, true)) && (mapHit.hitTest((p1.mc._x - p1.xAcc) + temp, p1.mc._y + gravity, true))) {
p1.xVel = temp;
temp = gravity * 2;
while (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - temp, true)) {
temp = temp + gravity;
}
if (p1.xVel > (-p1.xAcc)) {
p1.xVel = -p1.xAcc;
}
p1.mc._y = p1.mc._y + ((-temp) + gravity);
p1.yVel = 0;
} else {
if (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - gravity, true)) {
temp = p1.xVel + p1.xAcc;
do {
if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
break;
}
temp = temp + p1.xAcc;
} while (temp <= 0);
p1.mc._x = p1.mc._x + temp;
} else if (!mapHit.hitTest(p1.mc._x - 10.5, p1.mc._y + 27, true)) {
p1.mc._x = p1.mc._x + -10.5;
p1.mc._y = p1.mc._y + 26.7;
p1.mc._xscale = -p1.mc._xscale;
p1.mc.gotoAndStop("ledgeClimbDown");
p1.xSpec = 19;
p1.state = "ledge";
}
p1.xVel = 0;
}
}
function p1_walkLeft() {
if (((p1.grabCount <= 0) && (p1.windup <= 0)) && (p1.animHoldWalk <= 0)) {
if (p1.mc._xscale > 0) {
p1.mc.gotoAndStop("turn");
p1.animHoldIdle = 2;
p1.animHoldWalk = 2;
p1.trans = null;
} else {
p1.mc.gotoAndStop("walk");
p1.trans = "walk";
}
}
p1.mc._xscale = -100;
temp = p1.xVel - p1.xAcc;
if (temp < (-p1.xWalkMax)) {
temp = -p1.xWalkMax;
}
if ((!mapHit.hitTest(p1.mc._x + temp, p1.mc._y, true)) && (mapHit.hitTest(p1.mc._x + temp, p1.mc._y + (gravity * 8), true))) {
p1.xVel = temp;
p1.mc._y = p1.mc._y + gravity;
temp = 0;
while ((temp < (gravity * 8)) && (!mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y + temp, true))) {
temp = temp + gravity;
}
p1.mc._y = p1.mc._y + temp;
} else if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
p1.xVel = temp;
} else if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - 9, true)) {
p1.xVel = temp;
temp = gravity * 2;
while (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - temp, true)) {
temp = temp + gravity;
}
if (p1.xVel > (-p1.xAcc)) {
p1.xVel = -p1.xAcc;
}
p1.mc._y = p1.mc._y + ((-temp) + gravity);
p1.yVel = 0;
} else {
if (p1.xVel > 0) {
if (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - gravity, true)) {
temp = p1.xVel - p1.xAcc;
do {
if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
break;
}
temp = temp + (-p1.xAcc);
} while (temp >= 0);
p1.mc._x = p1.mc._x + temp;
}
} else if (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - gravity, true)) {
temp = p1.xVel + p1.xAcc;
do {
if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
break;
}
temp = temp + p1.xAcc;
} while (temp <= 0);
p1.mc._x = p1.mc._x + temp;
}
p1.xVel = 0;
}
}
function p1_hitWallLeft() {
temp = p1.xVel - p1.xAirAcc;
if (temp < (-p1.xWalkMax)) {
temp = -p1.xWalkMax;
}
if (((!mapHit.hitTest(p1.mc._x + temp, p1.mc._y, true)) && (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - (p1.head / 2), true))) && (!mapHit.hitTest(p1.mc._x + temp, (p1.mc._y - p1.head) + 6, true))) {
if (p1.xVel < (-p1.xWalkMax)) {
if (((!mapHit.hitTest(p1.mc._x + (temp / 2), p1.mc._y, true)) && (!mapHit.hitTest(p1.mc._x + (temp / 2), p1.mc._y - (p1.head / 2), true))) && (!mapHit.hitTest(p1.mc._x + (temp / 2), (p1.mc._y - p1.head) + 6, true))) {
p1.xVel = p1.xVel + (-p1.xAirAcc);
}
} else {
p1.xVel = p1.xVel + (-p1.xAirAcc);
}
} else {
p1.xVel = 0;
}
p1.mc._xscale = -100;
}
function p1_crouchWalkRight() {
p1.crouchMoved = true;
p1.crouched = false;
if (((p1.grabCount <= 0) && (p1.windup <= 0)) && (p1.animHoldCrouch <= 0)) {
p1.mc.gotoAndStop("crouchWalk");
p1.trans = "walk";
}
p1.mc._xscale = 100;
temp = p1.xVel + p1.xAcc;
if (temp > p1.xCrouchMax) {
temp = p1.xCrouchMax;
}
if ((!mapHit.hitTest(p1.mc._x + temp, p1.mc._y, true)) && (mapHit.hitTest(p1.mc._x + temp, p1.mc._y + (gravity * 8), true))) {
p1.xVel = temp;
p1.mc._y = p1.mc._y + gravity;
temp = 0;
while ((temp < (gravity * 8)) && (!mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y + temp, true))) {
temp = temp + gravity;
}
p1.mc._y = p1.mc._y + temp;
} else if ((!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) && (mapHit.hitTest((p1.mc._x + p1.xAcc) + temp, p1.mc._y + gravity, true))) {
p1.xVel = temp;
} else if ((!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - 9, true)) && (mapHit.hitTest((p1.mc._x + p1.xAcc) + temp, p1.mc._y + gravity, true))) {
p1.xVel = temp;
temp = gravity * 2;
while (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - temp, true)) {
temp = temp + gravity;
}
if (p1.xVel < p1.xAcc) {
p1.xVel = p1.xAcc;
}
p1.mc._y = p1.mc._y + ((-temp) + gravity);
p1.yVel = 0;
} else {
if (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - gravity, true)) {
temp = p1.xVel - p1.xAcc;
do {
if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
break;
}
temp = temp + (-p1.xAcc);
} while (temp >= 0);
p1.mc._x = p1.mc._x + temp;
} else if (!mapHit.hitTest(p1.mc._x + 10.5, p1.mc._y + 27, true)) {
p1.mc._x = p1.mc._x + 10.5;
p1.mc._y = p1.mc._y + 26.7;
p1.mc._xscale = -p1.mc._xscale;
p1.mc.gotoAndStop("ledgeClimbDown");
p1.xSpec = 19;
p1.state = "ledge";
}
p1.xVel = 0;
}
}
function p1_walkRight() {
if (((p1.grabCount <= 0) && (p1.windup <= 0)) && (p1.animHoldWalk <= 0)) {
if (p1.mc._xscale < 0) {
p1.mc.gotoAndStop("turn");
p1.animHoldIdle = 2;
p1.animHoldWalk = 2;
p1.trans = null;
} else {
p1.mc.gotoAndStop("walk");
p1.trans = "walk";
}
}
p1.mc._xscale = 100;
temp = p1.xVel + p1.xAcc;
if (temp > p1.xWalkMax) {
temp = p1.xWalkMax;
}
if ((!mapHit.hitTest(p1.mc._x + temp, p1.mc._y, true)) && (mapHit.hitTest(p1.mc._x + temp, p1.mc._y + (gravity * 8), true))) {
p1.xVel = temp;
p1.mc._y = p1.mc._y + gravity;
temp = 0;
while ((temp < (gravity * 8)) && (!mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y + temp, true))) {
temp = temp + gravity;
}
p1.mc._y = p1.mc._y + temp;
} else if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
p1.xVel = temp;
} else if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - 9, true)) {
p1.xVel = temp;
temp = gravity * 2;
while (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - temp, true)) {
temp = temp + gravity;
}
if (p1.xVel < p1.xAcc) {
p1.xVel = p1.xAcc;
}
p1.mc._y = p1.mc._y + ((-temp) + gravity);
p1.yVel = 0;
} else {
if (p1.xVel > 0) {
if (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - gravity, true)) {
temp = p1.xVel - p1.xAcc;
do {
if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
break;
}
temp = temp + (-p1.xAcc);
} while (temp >= 0);
p1.mc._x = p1.mc._x + temp;
}
} else if (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - gravity, true)) {
temp = p1.xVel + p1.xAcc;
do {
if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
break;
}
temp = temp + p1.xAcc;
} while (temp <= 0);
p1.mc._x = p1.mc._x + temp;
}
p1.xVel = 0;
}
}
function p1_hitWallRight() {
temp = p1.xVel + p1.xAirAcc;
if (temp > p1.xWalkMax) {
temp = p1.xWalkMax;
}
if (((!mapHit.hitTest(p1.mc._x + temp, p1.mc._y, true)) && (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - (p1.head / 2), true))) && (!mapHit.hitTest(p1.mc._x + temp, (p1.mc._y - p1.head) + 6, true))) {
if (p1.xVel > p1.xWalkMax) {
if (((!mapHit.hitTest(p1.mc._x + (temp / 2), p1.mc._y, true)) && (!mapHit.hitTest(p1.mc._x + (temp / 2), p1.mc._y - (p1.head / 2), true))) && (!mapHit.hitTest(p1.mc._x + (temp / 2), (p1.mc._y - p1.head) + 6, true))) {
p1.xVel = p1.xVel + p1.xAirAcc;
}
} else {
p1.xVel = p1.xVel + p1.xAirAcc;
}
} else {
p1.xVel = 0;
}
p1.mc._xscale = 100;
}
function p1_idle() {
if (mapHit.hitTest(p1.mc._x, p1.mc._y + gravity, true)) {
if ((p1.animHoldIdle <= 0) && (p1.yVel == 0)) {
if (Key.isDown(p1.keyDown1)) {
if (p1.crouchMoved) {
if (!p1.crouched) {
p1.crouched = true;
p1.mc.gotoAndStop("crouch2");
p1.trans = "walk";
}
} else if (!p1.crouched) {
p1.crouched = true;
p1.mc.gotoAndStop("crouch");
p1.trans = "walk";
}
} else if ((p1.grabCount <= 0) && (p1.windup <= 0)) {
if (p1.trans != null) {
p1.trans = null;
p1.mc.gotoAndStop("idle1");
p1.animHoldIdle = 3;
} else {
p1.mc.gotoAndStop("idle");
}
}
}
if (p1.xVel > 0) {
p1.xVel = p1.xVel + ((-p1.xAcc) * 2);
if (p1.xVel <= 0.7) {
p1.xVel = 0;
}
} else if (p1.xVel < 0) {
p1.xVel = p1.xVel + (p1.xAcc * 2);
if (p1.xVel >= -0.7) {
p1.xVel = 0;
}
}
} else if (p1.xVel > 0) {
if ((p1.grabCount <= 0) && (p1.animHoldAir <= 0)) {
if (p1.windup <= 0) {
p1.mc.gotoAndStop("fall");
} else {
p1.mc.gotoAndStop("throwAirWindup");
p1.mc.mcMC.gotoAndStop(p1.windup);
}
p1.jumpPressed = true;
p1.animHoldAir = 16;
}
p1.xVel = p1.xVel + ((-p1.xAcc) / 2);
if (p1.xVel <= 0) {
p1.xVel = 0;
}
} else if (p1.xVel < 0) {
if ((p1.grabCount <= 0) && (p1.animHoldAir <= 0)) {
if (p1.windup <= 0) {
p1.mc.gotoAndStop("fall");
} else {
p1.mc.gotoAndStop("throwAirWindup");
p1.mc.mcMC.gotoAndStop(p1.windup);
}
p1.jumpPressed = true;
p1.animHoldAir = 16;
}
p1.xVel = p1.xVel + (p1.xAcc / 2);
if (p1.xVel >= 0) {
p1.xVel = 0;
}
}
}
function p1_dash() {
if ((p1.mc._xscale > 0) && (Key.isDown(p1.keyRight))) {
if (p1.yVel == 0) {
p1.mc.gotoAndStop("dashLoop");
}
p1.dashHold++;
p1.xVel = p1.dashVel;
p1.xSpec++;
if ((!mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - 9, true)) && (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y, true))) {
playerUpHill();
}
} else if ((p1.mc._xscale < 0) && (Key.isDown(p1.keyLeft))) {
if (p1.yVel == 0) {
p1.mc.gotoAndStop("dashLoop");
}
p1.dashHold++;
p1.xVel = -p1.dashVel;
p1.xSpec++;
if ((!mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - 9, true)) && (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y, true))) {
playerUpHill();
}
} else if (p1.yVel == 0) {
p1.mc.gotoAndStop("dashEnd");
p1.animHoldIdle = 6;
}
}
function p1_xFinalCheck() {
if (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - gravity, true)) {
if (p1.xVel > 0) {
temp = p1.xVel - p1.xAcc;
do {
if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
break;
}
temp = temp + (-p1.xAcc);
} while (temp >= 0);
p1.mc._x = p1.mc._x + temp;
} else {
temp = p1.xVel + p1.xAcc;
do {
if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
break;
}
temp = temp + p1.xAcc;
} while (temp <= 0);
p1.mc._x = p1.mc._x + temp;
}
p1.xVel = 0;
}
}
function p1_slideDownhill() {
temp = 0;
while ((temp < (gravity * 8)) && (!mapHit.hitTest(p1.mc._x, p1.mc._y + temp, true))) {
temp = temp + gravity;
}
p1.mc._y = p1.mc._y + temp;
}
function p1_fall() {
if (p1.ySpec <= 0) {
p1.yVel = p1.yVel + gravity;
if (p1.yVel > gravity) {
p1.jumping = false;
}
p1.trans = null;
if ((p1.yVel > -0.1) && (!Key.isDown(p1.keyDown1))) {
if (p1.mc._xscale < 0) {
if (mapHit.hitTest(p1.mc._x - 2, (p1.mc._y + p1.yVel) - p1.head, true)) {
if (!mapHit.hitTest(p1.mc._x - 2, ((p1.mc._y + p1.yVel) - p1.head) - p1.yMax, true)) {
temp = 0;
do {
if (!mapHit.hitTest(p1.mc._x - 2, (p1.mc._y + p1.yVel) - p1.head, true)) {
break;
}
p1.mc._x = p1.mc._x + p1.xAcc;
temp = temp + p1.xAcc;
} while (temp <= p1.xMax);
p1.mc._y = p1.mc._y + p1.yVel;
p1.yVel = 0;
temp = p1.yMax;
while (mapHit.hitTest(p1.mc._x - 4, (p1.mc._y + p1.yVel) - p1.head, true)) {
p1.yVel = p1.yVel + (-gravity);
temp = temp + (-gravity);
if (temp < (-p1.yMax)) {
p1.yVel = (-p1.yMax) - 0.001;
break;
}
}
p1.mc._y = p1.mc._y + p1.yVel;
p1.xVel = 0;
p1.yVel = 0;
p1.state = "ledge";
p1.mc.gotoAndStop("ledgeGrab");
}
}
} else if (mapHit.hitTest(p1.mc._x + 2, (p1.mc._y + p1.yVel) - p1.head, true)) {
if (!mapHit.hitTest(p1.mc._x + 2, ((p1.mc._y + p1.yVel) - p1.head) - p1.yMax, true)) {
temp = 0;
do {
if (!mapHit.hitTest(p1.mc._x + 2, (p1.mc._y + p1.yVel) - p1.head, true)) {
break;
}
p1.mc._x = p1.mc._x + (-p1.xAcc);
temp = temp + p1.xAcc;
} while (temp <= p1.xMax);
p1.mc._y = p1.mc._y + p1.yVel;
p1.yVel = 0;
temp = p1.yMax;
while (mapHit.hitTest(p1.mc._x + 4, (p1.mc._y + p1.yVel) - p1.head, true)) {
p1.yVel = p1.yVel + (-gravity);
temp = temp + (-gravity);
if (temp < (-p1.yMax)) {
p1.yVel = (-p1.yMax) - 0.001;
break;
}
}
p1.mc._y = p1.mc._y + p1.yVel;
p1.xVel = 0;
p1.yVel = 0;
p1.state = "ledge";
p1.mc.gotoAndStop("ledgeGrab");
}
}
}
}
if ((p1.grabCount <= 0) && (p1.animHoldAir <= 0)) {
if (!((p1.dashHold > 0) && (p1.yVel < 7))) {
if (p1.windup <= 0) {
p1.mc.gotoAndStop("fall");
} else {
p1.mc.gotoAndStop("throwAirWindup");
p1.mc.mcMC.gotoAndStop(p1.windup);
}
p1.jumpPressed = true;
p1.animHoldAir = 16;
}
}
if (p1.yVel > 0) {
p1.fallTime++;
}
}
function p1_hitGround() {
p1.yVel = p1.yVel + (-gravity);
temp = p1.yMax;
if (!mapHit.hitTest(p1.mc._x, p1.mc._y - p1.head, true)) {
while (mapHit.hitTest(p1.mc._x, p1.mc._y + p1.yVel, true)) {
p1.yVel = p1.yVel + (-gravity);
temp = temp + (-gravity);
if (temp < (-gravity)) {
if (mapHit.hitTest(p1.mc._x - 50, p1.mc._y + 10, true)) {
if (mapHit.hitTest(p1.mc._x - 20, p1.mc._y + 10, true)) {
p1.mc._x = p1.mc._x + 20;
} else {
p1.mc._x = p1.mc._x + 50;
}
} else if (mapHit.hitTest(p1.mc._x + 15, p1.mc._y + 10, true)) {
p1.mc._x = p1.mc._x + -15;
} else if (mapHit.hitTest(p1.mc._x + 30, p1.mc._y + 10, true)) {
p1.mc._x = p1.mc._x + -30;
} else {
p1.mc._x = p1.mc._x + -50;
}
p1.yVel = (-gravity) - 0.001;
break;
}
}
p1.yVel = p1.yVel + gravity;
p1.mc._y = p1.mc._y + p1.yVel;
} else if (!mapHit.hitTest(p1.mc._x - 50, p1.mc._y - gravity, true)) {
p1.mc._x = p1.mc._x + -5;
} else if (!mapHit.hitTest(p1.mc._x + 50, p1.mc._y - gravity, true)) {
p1.mc._x = p1.mc._x + 5;
}
if ((p1.fallTime > 2) && (p1.yVel != 0)) {
if (!Key.isDown(p1.keyDown1)) {
if ((!Key.isDown(p1.keyLeft)) && (!Key.isDown(p1.keyRight))) {
if ((p1.animHoldIdle <= 0) && (p1.animHoldWalk <= 0)) {
if (p1.windup <= 0) {
p1.mc.gotoAndStop("land");
} else {
p1.mc.gotoAndStop("throwLandWindup");
}
p1.animHoldIdle = 12;
if (p1.yVel > 4) {
soundWink.attachSound("s_winkland");
soundWink.start(0, 0);
soundWink.setPan(Math.ceil(((p1.mc._x - mcCam._x) / 400) * 100));
soundWink.setVolume(60);
}
}
}
} else {
p1.mc.gotoAndStop("crouched");
p1.trans = "walk";
p1.crouched = true;
}
p1.fallTime = 0;
}
with (p1) {
yVel = 0;
jumping = false;
headbouncing = 0;
bounced = false;
}
}
function p1_jump() {
if ((Key.isDown(p1.keyDown1) && (p1.dJumpOK)) && (p1.yVel > 0)) {
p1.headbouncing = 1;
p1.yVel = 14;
p1.mc.gotoAndStop("headBounceDown");
p1.bp = 2;
} else if (!p1.jumpPressed) {
if (!mapHit.hitTest(p1.mc._x, (p1.mc._y - p1.head) - 21, true)) {
with (p1) {
jumping = true;
crouched = false;
jumpPressed = true;
yVel = -16;
}
if (p1.windup <= 0) {
if (p1.dashHold > 0) {
p1.mc.gotoAndStop("dashJump");
p1.animHoldAir = 26;
} else {
p1.mc.gotoAndStop("jump");
p1.trans = null;
p1.animHoldAir = 10;
}
} else {
p1.mc.gotoAndStop("throwJumpWindup");
p1.animHoldAir = 10;
}
}
} else if (((p1.dJumpOK && (!p1.doubleJumped)) && (p1.yVel < 3)) && (!Key.isDown(p1.keyDown1))) {
if (mapHit.hitTest(p1.mc._x + 10.2, (p1.mc._y - p1.head) - 20, true) && (mapHit.hitTest(p1.mc._x - 10.2, (p1.mc._y - p1.head) - 20, true))) {
temp = -gravity;
while (!mapHit.hitTest(p1.mc._x, (p1.mc._y - p1.head) + temp, true)) {
p1.mc._y = p1.mc._y + temp;
temp = temp + (-gravity);
}
p1.jumping = true;
p1.mc.gotoAndStop("stick");
p1.xVel = 0;
p1.yVel = 0.001;
p1.animHoldIdle = 9;
p1.animHoldAir = 9;
p1.xSpec = 2;
p1.ySpec = 2;
p1.state = "stuck";
p1.bounced = false;
p1.holdName.xVel = (Math.random() * 8) - 4;
p1.holdName.yVel = -4;
p1.holdName.state = "thrown";
p1.holdName.mc._rotation = 0;
p1.holdName.grabbedName = null;
p1.holdName = null;
p1.grabCount = 0;
p1.windup = 0;
soundWink.attachSound("s_stickON");
soundWink.start(0, 0);
soundWink.setPan(Math.ceil(((p1.mc._x - mcCam._x) / 400) * 100));
}
}
p1.dJumpOK = false;
}
function p1_grabbingWalkLeft() {
if (mapHit.hitTest(p1.mc._x, p1.mc._y + (gravity * 2), true)) {
if (((p1.grabCount <= 0) && (p1.windup <= 0)) && (p1.animHoldWalk <= 0)) {
if (p1.mc._xscale < 0) {
p1.mc.gotoAndStop("grabbingWalkF");
} else {
p1.mc.gotoAndStop("grabbingWalkB");
}
}
temp = p1.xVel - p1.xAcc;
if (temp < (-p1.xGrabMax)) {
temp = -p1.xGrabMax;
}
if ((!mapHit.hitTest(p1.mc._x + temp, p1.mc._y, true)) && (mapHit.hitTest(p1.mc._x + temp, p1.mc._y + (gravity * 8), true))) {
p1.xVel = temp;
p1.mc._y = p1.mc._y + gravity;
temp = 0;
while ((temp < (gravity * 8)) && (!mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y + temp, true))) {
temp = temp + gravity;
}
p1.mc._y = p1.mc._y + temp;
} else if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
p1.xVel = temp;
} else if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - 9, true)) {
p1.xVel = temp;
temp = gravity * 2;
while (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - temp, true)) {
temp = temp + gravity;
}
if (p1.xVel > (-p1.xAcc)) {
p1.xVel = -p1.xAcc;
}
p1.mc._y = p1.mc._y + ((-temp) + gravity);
p1.yVel = 0;
} else {
if (p1.xVel > 0) {
if (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - gravity, true)) {
temp = p1.xVel - p1.xAcc;
do {
if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
break;
}
temp = temp + (-p1.xAcc);
} while (temp >= 0);
p1.mc._x = p1.mc._x + temp;
}
} else if (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - gravity, true)) {
temp = p1.xVel + p1.xAcc;
do {
if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
break;
}
temp = temp + p1.xAcc;
} while (temp <= 0);
p1.mc._x = p1.mc._x + temp;
}
p1.xVel = 0;
}
} else {
temp = p1.xVel - p1.xAirAcc;
if (temp < (-p1.xGrabMax)) {
temp = -p1.xGrabMax;
}
if (((!mapHit.hitTest(p1.mc._x + temp, p1.mc._y, true)) && (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - (p1.head / 2), true))) && (!mapHit.hitTest(p1.mc._x + temp, (p1.mc._y - p1.head) + 6, true))) {
if (p1.xVel < (-p1.xGrabMax)) {
if (((!mapHit.hitTest(p1.mc._x + (temp / 2), p1.mc._y, true)) && (!mapHit.hitTest(p1.mc._x + (temp / 2), p1.mc._y - (p1.head / 2), true))) && (!mapHit.hitTest(p1.mc._x + (temp / 2), (p1.mc._y - p1.head) + 6, true))) {
p1.xVel = p1.xVel + (-p1.xAirAcc);
}
} else {
p1.xVel = p1.xVel + (-p1.xAirAcc);
}
} else {
p1.xVel = 0;
}
}
}
function p1_grabbingWalkRight() {
if (mapHit.hitTest(p1.mc._x, p1.mc._y + (gravity * 2), true)) {
if (((p1.grabCount <= 0) && (p1.windup <= 0)) && (p1.animHoldWalk <= 0)) {
if (p1.mc._xscale < 0) {
p1.mc.gotoAndStop("grabbingWalkB");
} else {
p1.mc.gotoAndStop("grabbingWalkF");
}
}
temp = p1.xVel + p1.xAcc;
if (temp > p1.xGrabMax) {
temp = p1.xGrabMax;
}
if ((!mapHit.hitTest(p1.mc._x + temp, p1.mc._y, true)) && (mapHit.hitTest(p1.mc._x + temp, p1.mc._y + (gravity * 8), true))) {
p1.xVel = temp;
p1.mc._y = p1.mc._y + gravity;
temp = 0;
while ((temp < (gravity * 8)) && (!mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y + temp, true))) {
temp = temp + gravity;
}
p1.mc._y = p1.mc._y + temp;
} else if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
p1.xVel = temp;
} else if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - 9, true)) {
p1.xVel = temp;
temp = gravity * 2;
while (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - temp, true)) {
temp = temp + gravity;
}
if (p1.xVel < p1.xAcc) {
p1.xVel = p1.xAcc;
}
p1.mc._y = p1.mc._y + ((-temp) + gravity);
p1.yVel = 0;
} else {
if (p1.xVel > 0) {
if (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - gravity, true)) {
temp = p1.xVel - p1.xAcc;
do {
if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
break;
}
temp = temp + (-p1.xAcc);
} while (temp >= 0);
p1.mc._x = p1.mc._x + temp;
}
} else if (mapHit.hitTest(p1.mc._x + p1.xVel, p1.mc._y - gravity, true)) {
temp = p1.xVel + p1.xAcc;
do {
if (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - gravity, true)) {
break;
}
temp = temp + p1.xAcc;
} while (temp <= 0);
p1.mc._x = p1.mc._x + temp;
}
p1.xVel = 0;
}
} else {
temp = p1.xVel + p1.xAirAcc;
if (temp > p1.xGrabMax) {
temp = p1.xGrabMax;
}
if (((!mapHit.hitTest(p1.mc._x + temp, p1.mc._y, true)) && (!mapHit.hitTest(p1.mc._x + temp, p1.mc._y - (p1.head / 2), true))) && (!mapHit.hitTest(p1.mc._x + temp, (p1.mc._y - p1.head) + 6, true))) {
if (p1.xVel > p1.xGrabMax) {
if (((!mapHit.hitTest(p1.mc._x + (temp / 2), p1.mc._y, true)) && (!mapHit.hitTest(p1.mc._x + (temp / 2), p1.mc._y - (p1.head / 2), true))) && (!mapHit.hitTest(p1.mc._x + (temp / 2), (p1.mc._y - p1.head) + 6, true))) {
p1.xVel = p1.xVel + p1.xAirAcc;
}
} else {
p1.xVel = p1.xVel + p1.xAirAcc;
}
} else {
p1.xVel = 0;
}
}
}
function p1_grabbingIdle() {
if (mapHit.hitTest(p1.mc._x, p1.mc._y + gravity, true)) {
if ((p1.animHoldIdle <= 0) && (p1.yVel == 0)) {
if ((p1.grabCount <= 0) && (p1.windup <= 0)) {
p1.mc.gotoAndStop("grabbingIdle");
}
}
if (p1.xVel > 0) {
p1.xVel = p1.xVel + ((-p1.xAcc) * 2);
if (p1.xVel <= 0.7) {
p1.xVel = 0;
}
} else if (p1.xVel < 0) {
p1.xVel = p1.xVel + (p1.xAcc * 2);
if (p1.xVel >= -0.7) {
p1.xVel = 0;
}
}
}
}
function p1_throwEnemyWalk(moveRight) {
if (moveRight) {
p1.holdName.xVel = 20;
} else {
p1.holdName.xVel = -20;
}
p1.holdName.yVel = -15;
p1.mc.gotoAndStop("throwWalk3");
p1.animHoldWalk = 7;
p1.holdName.state = "thrown";
thrownName = p1.holdName;
p1.holdName.grabbedName = null;
p1.holdName = null;
}
function p1_chokeEnemy() {
p1.xVel = 0;
p1.mc.gotoAndStop("grabbingChoke");
p1.attackHold = 84;
p1.trans = null;
p1.holdName.mc.gotoAndStop("choke");
p1.holdName.state = "choking";
p1.holdName.phaseCount = 54;
p1.holdName.mc.swapDepths(p1.holdName.mc.getDepth() + enemyDeadOffset);
if (p1.sp < 100) {
p1.sp = p1.sp + 5;
p1.updateStealth = true;
}
soundFX.attachSound("s_choke");
soundFX.start(0, 0);
}
function p1_throwEnemyIdle() {
if (p1.mc._xscale < 0) {
p1.holdName.xVel = -12;
} else {
p1.holdName.xVel = 12;
}
p1.holdName.yVel = -10;
p1.mc.gotoAndStop("throwIdle3");
p1.animHoldIdle = 7;
p1.holdName.state = "thrown";
thrownName = p1.holdName;
p1.holdName.grabbedName = null;
p1.holdName = null;
}
function enemy1_Normal(enemyName) {
temp = 1;
while (temp <= projectiles) {
temp2 = "proj_" + temp;
temp2 = this[temp2];
if (((temp2.mc._x != undefined) && (temp2.state == "thrown")) && ((temp2.hitTarget == 2) || (temp2.hitTarget == 3))) {
if (Math.abs(temp2.mc._x - enemyName.mc._x) < 200) {
if (enemyName.mc.mcHit.hitTest(temp2.mc._x, temp2.mc._y, true)) {
enemy1_projectileHit(enemyName);
}
}
}
temp++;
}
if (enemyName.grabCount > 0) {
enemy1_grabStaff(enemyName);
}
if (p1.headbouncing == 1) {
if (enemyName.mc.mcHit.hitTest(p1.mc._x, p1.mc._y, true)) {
enemy1_headbounced(enemyName);
}
} else if (p1.stuckAttackPoll == 1) {
if (((Math.abs(p1.mc._x - enemyName.mc._x) < 40) && (p1.mc._y < (enemyName.mc._y - enemyName.head))) && (p1.mc._y > (enemyName.mc._y - 500))) {
p1.stuckAttackPoll = 2;
p1.holdName = enemyName;
}
}
if ((enemyName.phase == 1) && (enemyName.state == "normal")) {
enemy1_phase1(enemyName);
} else if ((enemyName.phase == 2) && (enemyName.state == "normal")) {
enemyName.attackHold--;
enemyName.alertTime++;
if (enemyName.alertTime > 400) {
}
if ((enemyName.attackHold > 0) && (p1.plane == "ground")) {
if (enemyName.mc._xscale > 0) {
temp = enemyName.mc.mcMC.mcAttack._x;
} else {
temp = -enemyName.mc.mcMC.mcAttack._x;
}
if (((enemyName.mc.mcMC.mcAttack._x != undefined) && (p1.mc.mcHit.hitTest(enemyName.mc._x + temp, enemyName.mc._y + enemyName.mc.mcMC.mcAttack._y, true))) && (p1.state != "thrown")) {
if (p1.deflecting <= 0) {
if (((p1.holdName != null) && (p1.state == "grabbing")) || ((p1.holdName.state == "choking") && (p1.state == "normal"))) {
if (p1.holdName.state == "choking") {
p1.holdName.mc.swapDepths(p1.holdName.depth0);
}
p1.holdName.state = "normal";
p1.holdName.phase = 2;
p1.holdName.mc.gotoAndStop("idle2");
p1.holdName.grabbedName = null;
p1.holdName = null;
} else if (p1.holdName != null) {
p1.holdName.state = "thrown";
if (enemyName.mc._x < p1.mc._x) {
p1.holdName.xVel = p1.holdName.xVel + ((Math.random() * 6) + 8);
} else {
p1.holdName.xVel = p1.holdName.xVel + ((Math.random() * -6) - 8);
}
p1.holdName.yVel = p1.holdName.yVel + ((Math.random() * -12) - 5);
p1.holdName.mc._rotation = 0;
p1.holdName = null;
p1.windup = 0;
}
p1.state = "thrown";
p1.mc.gotoAndStop("thrown");
p1.whacking = 0;
p1.hp = p1.hp + (-enemyName.bp);
p1.updateHealth = true;
p1.xVel = enemyName.xForce;
p1.yVel = enemyName.yForce;
p1.grabCount = 0;
p1.attackHold = 0;
if (enemyName.mc._x < p1.mc._x) {
p1.mc._xscale = -100;
} else {
p1.mc._xscale = 100;
}
soundWink.attachSound("s_winkhit1");
soundWink.start(0, 0);
soundWink.setPan(Math.ceil(((enemyName.mc._x - mcCam._x) / 400) * 100));
soundWinkDone = true;
} else if (((enemyName.mc._x > p1.mc._x) && (p1.mc._xscale > 0)) || ((enemyName.mc._x < p1.mc._x) && (p1.mc._xscale < 0))) {
if (p1.mc._xscale > 0) {
enemyName.xVel = (Math.random() * 8) + 15;
} else {
enemyName.xVel = (Math.random() * -8) - 15;
}
enemyName.yVel = (Math.random() * -8) - 11;
enemyName.state = "thrown";
soundFX.attachSound("s_hoodleyhit");
soundFX.start(0, 0);
soundFX.setPan(Math.ceil(((enemyName.mc._x - mcCam._x) / 400) * 100));
if (p1.sp < 100) {
p1.sp = p1.sp + 1;
p1.updateStealth = true;
}
}
}
}
if (enemyName.phaseCount <= 0) {
enemyName.phase = 1;
enemyName.mc.gotoAndStop("alertToIdle");
enemyName.animHoldIdle = 10;
enemyName.stopCount = 9 + (Math.random() * 15);
} else {
if ((((enemyName.xSpec <= 0) && (p1.plane == "ground")) && (p1.state != "stuck")) && (p1.state != "ledge")) {
if ((((p1.mc._x - enemyName.mc._x) < 150) && ((p1.mc._x - enemyName.mc._x) > 0)) && (enemyName.mc._xscale > 0)) {
if (Math.abs(p1.mc._y - enemyName.mc._y) < 40) {
if ((!mapHit.hitTest(enemyName.mc._x + 50, enemyName.mc._y - (enemyName.head / 2), true)) && (!mapHit.hitTest(enemyName.mc._x + 100, enemyName.mc._y - (enemyName.head / 2), true))) {
if (!mapHitFG.hitTest(p1.mc._x, p1.mc._y, true)) {
enemyName.phaseCount = 300;
soundHuntCount++;
} else if (!Key.isDown(p1.keyDown1)) {
enemyName.phaseCount = 300;
soundHuntCount++;
}
}
}
} else if ((((p1.mc._x - enemyName.mc._x) > -150) && ((p1.mc._x - enemyName.mc._x) < 0)) && (enemyName.mc._xscale < 0)) {
if (Math.abs(p1.mc._y - enemyName.mc._y) < 40) {
if ((!mapHit.hitTest(enemyName.mc._x - 50, enemyName.mc._y - (enemyName.head / 2), true)) && (!mapHit.hitTest(enemyName.mc._x - 100, enemyName.mc._y - (enemyName.head / 2), true))) {
if (!mapHitFG.hitTest(p1.mc._x, p1.mc._y, true)) {
enemyName.phaseCount = 300;
soundHuntCount++;
} else if (!Key.isDown(p1.keyDown1)) {
enemyName.phaseCount = 300;
soundHuntCount++;
}
}
}
}
}
if (enemyName.stopCount > 0) {
enemyName.stopCount--;
} else if (enemyName.stopCount == 0) {
temp = Math.random();
if (enemyName.mc._xscale < 0) {
if ((((p1.mc._x - enemyName.mc._x) > -200) && ((p1.mc._x - enemyName.mc._x) < 0)) && (enemyName.mc._xscale < 0)) {
if (Math.abs(p1.mc._y - enemyName.mc._y) < 80) {
if (p1.plane == "ground") {
enemyName.mc._xscale = -100;
enemyName.xDest = p1.mc._x;
enemyName.mc.gotoAndStop("walk2");
}
}
} else {
enemyName.mc._xscale = 100;
enemyName.xDest = enemyName.mc._x + 250;
enemyName.mc.gotoAndStop("turn2");
enemyName.animHoldIdle = 4;
enemyName.animHoldWalk = 4;
}
enemyName.stopCount--;
} else if (enemyName.mc._xscale > 0) {
if ((((p1.mc._x - enemyName.mc._x) < 200) && ((p1.mc._x - enemyName.mc._x) > 0)) && (enemyName.mc._xscale > 0)) {
if (Math.abs(p1.mc._y - enemyName.mc._y) < 80) {
if (p1.plane == "ground") {
enemyName.mc._xscale = 100;
enemyName.xDest = p1.mc._x;
enemyName.mc.gotoAndStop("walk2");
}
}
} else {
enemyName.mc._xscale = -100;
enemyName.xDest = enemyName.mc._x - 250;
enemyName.mc.gotoAndStop("turn2");
enemyName.animHoldIdle = 4;
enemyName.animHoldWalk = 4;
}
enemyName.stopCount--;
}
}
if (((enemyName.xSpec <= 0) && (enemyName.holdName == null)) && (enemyName.grabCount <= 0)) {
temp = 1;
while (temp <= staffs) {
temp2 = "staff_" + temp;
temp2 = this[temp2];
if ((temp2.grabbedName == null) && (temp2.state == "normal")) {
if ((Math.abs(enemyName.mc._x - temp2.mc._x) < 16) && (Math.abs(enemyName.mc._y - temp2.mc._y) < 12)) {
enemyName.grabCount = 15;
enemyName.mc.gotoAndStop("grabIdle2");
enemyName.animHoldIdle = 24;
enemyName.stopCount = 26;
enemyName.xVel = 0;
enemyName.xDest = enemyName.mc._x;
break;
}
}
temp++;
}
}
if (((enemyName.stopCount <= 0) && (enemyName.xSpec <= 0)) && (enemyName.attackHold <= 0)) {
temp = Math.random();
if ((((enemyName.xVel != 0) && (Math.abs(enemyName.xDest - enemyName.mc._x) < (enemyName.xAcc + 0.2))) || ((enemyName.xDest < enemyName.mc._x) && (enemyName.mc._xscale > 0))) || ((enemyName.xDest > enemyName.mc._x) && (enemyName.mc._xscale < 0))) {
enemyName.mc._x = enemyName.xDest;
enemyName.xVel = 0;
enemyName.stopCount = 40;
enemyName.mc.gotoAndStop("idle2");
} else if ((p1.plane == "ground") && (enemyName.animHoldWalk <= 0)) {
if ((p1.state == "normal") || (p1.state == "grabbing")) {
if (enemyName.mc._xscale < 0) {
if ((((temp > 0.7) && ((p1.mc._x - enemyName.mc._x) > -80)) && ((p1.mc._x - enemyName.mc._x) < 0)) && (Math.abs(p1.mc._y - enemyName.mc._y) < 50)) {
if ((!mapHit.hitTest(enemyName.mc._x + 50, enemyName.mc._y - (enemyName.head / 2), true)) && (!mapHit.hitTest(enemyName.mc._x + 100, enemyName.mc._y - (enemyName.head / 2), true))) {
if (!mapHitFG.hitTest(p1.mc._x, p1.mc._y, true)) {
with (enemyName) {
xVel = -11;
xForce = -11;
xSpec = 5;
mc.gotoAndStop("headbutt");
animHoldIdle = 23;
animHoldWalk = 10;
attackHold = 60;
bp = 8;
hitHold = 0;
finalHit = true;
yForce = -11;
stopCount = 30;
}
} else if (!Key.isDown(p1.keyDown1)) {
with (enemyName) {
xVel = -11;
xForce = -11;
xSpec = 5;
mc.gotoAndStop("headbutt");
animHoldIdle = 23;
animHoldWalk = 10;
attackHold = 60;
bp = 8;
hitHold = 0;
finalHit = true;
yForce = -11;
stopCount = 30;
}
}
}
} else if ((((((temp > 0.3) && ((p1.mc._x - enemyName.mc._x) > -200)) && ((p1.mc._x - enemyName.mc._x) < 0)) && (Math.abs(p1.mc._y - enemyName.mc._y) < 60)) && (enemyName.holdName.actor == "staff")) && (enemyName.attackHold <= 0)) {
if ((!mapHit.hitTest(enemyName.mc._x + 50, enemyName.mc._y - (enemyName.head / 2), true)) && (!mapHit.hitTest(enemyName.mc._x + 100, enemyName.mc._y - (enemyName.head / 2), true))) {
if (!mapHitFG.hitTest(p1.mc._x, p1.mc._y, true)) {
enemyName.mc.gotoAndStop("staffAttack");
enemyName.animHoldIdle = 17;
enemyName.attackHold = 47;
enemyName.stopCount = 15;
staffAttack(enemyName.holdName, 3, 1, 10);
} else if (!Key.isDown(p1.keyDown1)) {
enemyName.mc.gotoAndStop("staffAttack");
enemyName.animHoldIdle = 17;
enemyName.attackHold = 47;
enemyName.stopCount = 15;
staffAttack(enemyName.holdName, 3, 1, 10);
}
}
}
} else if (enemyName.mc._xscale > 0) {
if ((((temp > 0.7) && ((p1.mc._x - enemyName.mc._x) < 80)) && ((p1.mc._x - enemyName.mc._x) > 0)) && (Math.abs(p1.mc._y - enemyName.mc._y) < 50)) {
if ((!mapHit.hitTest(enemyName.mc._x + 50, enemyName.mc._y - (enemyName.head / 2), true)) && (!mapHit.hitTest(enemyName.mc._x + 100, enemyName.mc._y - (enemyName.head / 2), true))) {
if (!mapHitFG.hitTest(p1.mc._x, p1.mc._y, true)) {
with (enemyName) {
xVel = 11;
xForce = 11;
xSpec = 5;
mc.gotoAndStop("headbutt");
animHoldIdle = 23;
animHoldWalk = 10;
attackHold = 60;
bp = 8;
hitHold = 0;
finalHit = true;
yForce = -11;
stopCount = 30;
}
} else if (!Key.isDown(p1.keyDown1)) {
with (enemyName) {
xVel = 11;
xForce = 11;
xSpec = 5;
mc.gotoAndStop("headbutt");
animHoldIdle = 23;
animHoldWalk = 10;
attackHold = 60;
bp = 8;
hitHold = 0;
finalHit = true;
yForce = -11;
stopCount = 30;
}
}
}
} else if ((((((temp > 0.3) && ((p1.mc._x - enemyName.mc._x) < 200)) && ((p1.mc._x - enemyName.mc._x) > 0)) && (Math.abs(p1.mc._y - enemyName.mc._y) < 60)) && (enemyName.holdName.actor == "staff")) && (enemyName.attackHold <= 0)) {
if ((!mapHit.hitTest(enemyName.mc._x + 50, enemyName.mc._y - (enemyName.head / 2), true)) && (!mapHit.hitTest(enemyName.mc._x + 100, enemyName.mc._y - (enemyName.head / 2), true))) {
if (!mapHitFG.hitTest(p1.mc._x, p1.mc._y, true)) {
enemyName.mc.gotoAndStop("staffAttack");
enemyName.animHoldIdle = 17;
enemyName.attackHold = 47;
enemyName.stopCount = 15;
staffAttack(enemyName.holdName, 3, 1, 10);
} else if (!Key.isDown(p1.keyDown1)) {
enemyName.mc.gotoAndStop("staffAttack");
enemyName.animHoldIdle = 17;
enemyName.attackHold = 47;
enemyName.stopCount = 15;
staffAttack(enemyName.holdName, 3, 1, 10);
}
}
}
}
} else if (Math.random() > 0.9) {
enemyName.xDest = enemyName.mc._x;
}
}
}
if ((((enemyName.xSpec <= 0) && (enemyName.attackHold <= 0)) && (enemyName.stopCount < 0)) && (enemyName.mc._xscale < 0)) {
if (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + gravity, true)) {
if (enemyName.animHoldWalk <= 0) {
enemyName.mc.gotoAndStop("walk2");
}
temp = enemyName.xVel - enemyName.xAcc;
if (temp < (-enemyName.xHuntMax)) {
temp = -enemyName.xHuntMax;
}
enemy1Walk(enemyName, -100, temp, 4);
} else {
temp = enemyName.xVel - enemyName.xAirAcc;
if (temp < (-enemyName.xHuntMax)) {
temp = -enemyName.xHuntMax;
}
if (((!mapHit.hitTest(enemyName.mc._x + temp, enemyName.mc._y, true)) && (!mapHit.hitTest(enemyName.mc._x + temp, enemyName.mc._y - (enemyName.head / 2), true))) && (!mapHit.hitTest(enemyName.mc._x + temp, (enemyName.mc._y - enemyName.head) + 6, true))) {
if (enemyName.xVel < (-enemyName.xHuntMax)) {
if (((!mapHit.hitTest(enemyName.mc._x + (temp / 2), enemyName.mc._y, true)) && (!mapHit.hitTest(enemyName.mc._x + (temp / 2), enemyName.mc._y - (enemyName.head / 2), true))) && (!mapHit.hitTest(enemyName.mc._x + (temp / 2), (enemyName.mc._y - enemyName.head) + 6, true))) {
enemyName.xVel = enemyName.xVel + (-enemyName.xAirAcc);
}
} else {
enemyName.xVel = enemyName.xVel + (-enemyName.xAirAcc);
}
} else {
enemyName.xVel = 0;
}
}
} else if ((((enemyName.xSpec <= 0) && (enemyName.attackHold <= 0)) && (enemyName.stopCount < 0)) && (enemyName.mc._xscale > 0)) {
if (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + gravity, true)) {
if (enemyName.animHoldWalk <= 0) {
enemyName.mc.gotoAndStop("walk2");
}
temp = enemyName.xVel + enemyName.xAcc;
if (temp > enemyName.xHuntMax) {
temp = enemyName.xHuntMax;
}
enemy1Walk(enemyName, 100, temp, 4);
} else {
temp = enemyName.xVel + enemyName.xAirAcc;
if (temp > enemyName.xHuntMax) {
temp = enemyName.xHuntMax;
}
if (((!mapHit.hitTest(enemyName.mc._x + temp, enemyName.mc._y, true)) && (!mapHit.hitTest(enemyName.mc._x + temp, enemyName.mc._y - (enemyName.head / 2), true))) && (!mapHit.hitTest(enemyName.mc._x + temp, (enemyName.mc._y - enemyName.head) + 6, true))) {
if (enemyName.xVel > enemyName.xHuntMax) {
if (((!mapHit.hitTest(enemyName.mc._x + (temp / 2), enemyName.mc._y, true)) && (!mapHit.hitTest(enemyName.mc._x + (temp / 2), enemyName.mc._y - (enemyName.head / 2), true))) && (!mapHit.hitTest(enemyName.mc._x + (temp / 2), (enemyName.mc._y - enemyName.head) + 6, true))) {
enemyName.xVel = enemyName.xVel + enemyName.xAirAcc;
}
} else {
enemyName.xVel = enemyName.xVel + enemyName.xAirAcc;
}
} else {
enemyName.xVel = 0;
enemyName.xDest = enemyName.mc._x - 10;
enemyName.stopCount = -1;
}
}
} else if (enemyName.xSpec <= 0) {
if (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + gravity, true)) {
if ((enemyName.animHoldIdle <= 0) && (enemyName.yVel == 0)) {
if ((enemyName.grabCount <= 0) && (enemyName.windup <= 0)) {
enemyName.mc.gotoAndStop("idle2");
}
}
if (enemyName.xVel > 0) {
enemyName.xVel = enemyName.xVel + ((-enemyName.xAcc) * 2);
if (enemyName.xVel <= 0.7) {
enemyName.xVel = 0;
}
} else if (enemyName.xVel < 0) {
enemyName.xVel = enemyName.xVel + (enemyName.xAcc * 2);
if (enemyName.xVel >= -0.7) {
enemyName.xVel = 0;
}
}
} else if (enemyName.xVel > 0) {
if ((enemyName.grabCount <= 0) && (enemyName.animHoldAir <= 0)) {
if (enemyName.windup <= 0) {
enemyName.mc.gotoAndStop("fall");
}
enemyName.jumpPressed = true;
enemyName.animHoldAir = 16;
}
enemyName.mc._xscale = 100;
enemyName.xVel = enemyName.xVel + ((-enemyName.xAcc) / 2);
if (enemyName.xVel <= 0) {
enemyName.xVel = 0;
}
} else if (enemyName.xVel < 0) {
if ((enemyName.grabCount <= 0) && (enemyName.animHoldAir <= 0)) {
if (enemyName.windup <= 0) {
enemyName.mc.gotoAndStop("fall");
}
enemyName.jumpPressed = true;
enemyName.animHoldAir = 16;
}
enemyName.mc._xscale = -100;
enemyName.xVel = enemyName.xVel + (enemyName.xAcc / 2);
if (enemyName.xVel >= 0) {
enemyName.xVel = 0;
}
}
}
if (enemyName.xSpec > 0) {
enemyName.xSpec--;
}
if (enemyName.xSpec <= 0) {
if (enemyName.xVel > enemyName.xHuntMax) {
enemyName.xVel = enemyName.xHuntMax + ((enemyName.xHuntMax - enemyName.xVel) / 8);
} else if (enemyName.xVel < (-enemyName.xHuntMax)) {
enemyName.xVel = (-enemyName.xHuntMax) + ((enemyName.xVel + enemyName.xHuntMax) / 8);
}
}
}
}
if (enemyName.xVel != 0) {
if (enemyName.stopCount >= 0) {
if (mapHit.hitTest(enemyName.mc._x + enemyName.xVel, enemyName.mc._y - gravity, true) && (mapHit.hitTest(enemyName.mc._x + enemyName.xVel, enemyName.mc._y - 9, true))) {
enemyName.xVel = 0;
enemyName.xDest = enemyName.mc._x;
enemyName.stopCount = -1;
}
}
}
enemyName.mc._x = enemyName.mc._x + enemyName.xVel;
if ((enemyName.xVel != 0) && (enemyName.stopCount < 0)) {
if ((!mapHit.hitTest(enemyName.mc._x, enemyName.mc._y, true)) && (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + (gravity * 8), true))) {
temp = 0;
while ((temp < (gravity * 8)) && (!mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + temp, true))) {
temp = temp + gravity;
}
enemyName.mc._y = enemyName.mc._y + temp;
}
}
if (!mapHit.hitTest(enemyName.mc._x, (enemyName.mc._y + gravity) + enemyName.yVel, true)) {
enemyName.yVel = enemyName.yVel + gravity;
if (!enemyName.jumping) {
enemyName.mc.gotoAndStop("fall");
}
} else {
enemyName.yVel = enemyName.yVel + (-gravity);
temp = enemyName.yMax;
while (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + enemyName.yVel, true)) {
enemyName.yVel = enemyName.yVel + (-gravity);
temp = temp + (-gravity);
if (temp < gravity) {
if (!mapHit.hitTest(enemyName.mc._x - 50, enemyName.mc._y - gravity, true)) {
enemyName.mc._x = enemyName.mc._x + -5;
while ((!mapHit.hitTest(enemyName.mc._x - 50, enemyName.mc._y - gravity, true)) && (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y - gravity, true))) {
enemyName.mc._x = enemyName.mc._x + -5;
}
} else {
enemyName.mc._x = enemyName.mc._x + 5;
while ((!mapHit.hitTest(enemyName.mc._x + 50, enemyName.mc._y - gravity, true)) && (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y - gravity, true))) {
enemyName.mc._x = enemyName.mc._x + 5;
}
}
enemyName.xDest = enemyName.mc._x;
enemyName.yVel = -gravity;
break;
}
}
enemyName.yVel = enemyName.yVel + gravity;
enemyName.mc._y = enemyName.mc._y + enemyName.yVel;
if (enemyName.yVel != 0) {
enemyName.mc.gotoAndStop("land");
enemyName.landCount = 6;
}
enemyName.yVel = 0;
enemyName.jumping = false;
}
if (enemyName.yVel < 0) {
if (mapHit.hitTest(enemyName.mc._x, (enemyName.mc._y - enemyName.head) + enemyName.yVel, true)) {
temp = enemyName.yVel + gravity;
enemyName.mc._y = enemyName.mc._y + temp;
enemyName.yVel = 0.001;
while (mapHit.hitTest(enemyName.mc._x, (enemyName.mc._y - enemyName.head) + temp, true)) {
enemyName.mc._y = enemyName.mc._y + gravity;
temp = temp + gravity;
if (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + gravity, true)) {
if (!mapHit.hitTest(enemyName.mc._x - 50, enemyName.mc._y, true)) {
enemyName.mc._x = enemyName.mc._x + -50;
} else {
enemyName.mc._x = enemyName.mc._x + 50;
}
}
}
}
}
if (enemyName.ySpec > 0) {
enemyName.ySpec--;
}
if (enemyName.ySpec <= 0) {
if (enemyName.yVel > enemyName.yMax) {
enemyName.yVel = enemyName.yMax;
} else if (enemyName.yVel < (-enemyName.yMax)) {
enemyName.yVel = -enemyName.yMax;
}
}
enemyName.mc._y = enemyName.mc._y + enemyName.yVel;
if ((Math.abs(enemyName.mc._x - p1.mc._x) > xCutoff) || (Math.abs(enemyName.mc._y - p1.mc._y) > yCutoff)) {
if (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y, true)) {
enemyName.state = "inactive";
enemyName.mc._visible = false;
}
}
if ((thrownName != null) && (thrownName != enemyName)) {
if (thrownName.actor != "torch") {
if (enemyName.mc.mcHit.hitTest(thrownName.mc.mcHit)) {
enemyName.xVel = thrownName.xVel;
enemyName.yVel = thrownName.yVel;
if (thrownName.xVel != 0) {
thrownName.xVel = (-thrownName.xVel) * 0.8;
} else {
thrownName.xVel = (Math.random() * 16) - 8;
}
thrownName.yVel = (-thrownName.yVel) * 0.8;
if (Math.abs(thrownName.xVel) > 8) {
enemyName.state = "thrown";
enemyName.mc.gotoAndStop("thrown");
if (enemyName.holdName != null) {
enemyName.holdName.state = "thrown";
enemyName.holdName.mc._rotation = 0;
enemyName.holdName.xVel = (Math.random() * 32) - 16;
enemyName.holdName.yVel = (Math.random() * -10) - 12;
enemyName.holdName.grabbedName = null;
enemyName.holdName = null;
enemyName.grabCount = 0;
}
}
}
} else if ((thrownName.state == "thrown") && ((Math.abs(thrownName.xVel) > 6) || (Math.abs(thrownName.yVel) > 6))) {
if (enemyName.mc.mcHit.hitTest(thrownName.mc._x, thrownName.mc._y, true)) {
enemyName.state = "onfire";
enemyName.mc.gotoAndStop("onfire");
enemyName.phaseCount = 180;
thrownName.state = "hit";
thrownName.mc.gotoAndStop("hit");
thrownName.xVel = 0;
thrownName.yVel = 0;
thrownName = null;
if (enemyName.holdName != null) {
enemyName.holdName.state = "thrown";
enemyName.holdName.mc._rotation = 0;
enemyName.holdName.xVel = (Math.random() * 16) - 8;
enemyName.holdName.yVel = (Math.random() * -6) - 12;
enemyName.holdName.grabbedName = null;
enemyName.holdName = null;
enemyName.grabCount = 0;
}
soundFX.attachSound("s_torchhit");
soundFX.start(0, 0);
soundFX.setPan(Math.ceil(((enemyName.mc._x - mcCam._x) / 400) * 100));
soundHoodleyFire.attachSound("s_hoodleyfire");
soundHoodleyFire.start(0, 5);
}
}
}
}
function enemy1_Grabbed(enemyName) {
enemyName.mc._y = p1.mc._y;
if (p1.xVel != 0) {
if (((p1.mc._xscale < 0) && (p1.xVel > 0)) || ((p1.mc._xscale > 0) && (p1.xVel < 0))) {
enemyName.mc.gotoAndStop("grabbedB");
} else {
enemyName.mc.gotoAndStop("grabbedF");
}
} else if (enemyName.animHoldIdle <= 0) {
enemyName.mc.gotoAndStop("grabbed");
}
if (enemyName.grabbedName.mc._xscale > 0) {
enemyName.mc._x = enemyName.grabbedName.mc._x + enemyName.grabbedName.mc.mcMC.mcHand._x;
enemyName.mc._xscale = 100;
} else {
enemyName.mc._x = enemyName.grabbedName.mc._x - enemyName.grabbedName.mc.mcMC.mcHand._x;
enemyName.mc._xscale = -100;
}
}
function enemy1_Thrown(enemyName) {
if (enemyName.xVel > 0) {
if (enemyName.yVel != 0) {
enemyName.xVel = enemyName.xVel / frictionAir;
} else {
enemyName.xVel = enemyName.xVel / friction;
}
if (enemyName.xVel <= 0.3) {
enemyName.xVel = 0;
}
} else if (enemyName.xVel < 0) {
if (enemyName.yVel != 0) {
enemyName.xVel = enemyName.xVel / frictionAir;
} else {
enemyName.xVel = enemyName.xVel / friction;
}
if (enemyName.xVel >= -0.3) {
enemyName.xVel = 0;
}
}
if (enemyName.xVel != 0) {
if (mapHit.hitTest(enemyName.mc._x + enemyName.xVel, enemyName.mc._y - (gravity * 2), true)) {
if (enemyName.xVel > 0) {
temp = enemyName.xVel - enemyName.xAcc;
enemyBounceRight(enemyName, temp);
} else {
temp = enemyName.xVel + enemyName.xAcc;
enemyBounceLeft(enemyName, temp);
}
if (Math.abs(enemyName.xVel) <= 0.3) {
enemyName.xVel = 0;
enemyName.xDest = enemyName.mc._x + 10;
enemyName.stopCount = -1;
}
} else if (enemyName.xVel > enemyName.xMax) {
if (mapHit.hitTest(enemyName.mc._x + (enemyName.xVel / 2), enemyName.mc._y - (gravity * 2), true)) {
temp = (enemyName.xVel / 2) - enemyName.xAcc;
enemyBounceRight(enemyName, temp);
} else if (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y - (gravity * 2), true)) {
temp = -enemyName.xAcc;
enemyBounceRight(enemyName, temp);
}
} else if (enemyName.xVel < (-enemyName.xMax)) {
if (mapHit.hitTest(enemyName.mc._x + (enemyName.xVel / 2), enemyName.mc._y - (gravity * 2), true)) {
temp = (enemyName.xVel / 2) + enemyName.xAcc;
enemyBounceLeft(enemyName, temp);
} else if (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y - (gravity * 2), true)) {
temp = enemyName.xAcc;
enemyBounceLeft(enemyName, temp);
}
}
}
enemyName.mc._x = enemyName.mc._x + enemyName.xVel;
if (((enemyName.xVel != 0) && (!Key.isDown(enemyName.keyLeft))) && (!Key.isDown(enemyName.keyRight))) {
if ((!mapHit.hitTest(enemyName.mc._x, enemyName.mc._y, true)) && (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + (gravity * 8), true))) {
temp = 0;
while ((temp < (gravity * 8)) && (!mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + temp, true))) {
temp = temp + gravity;
}
enemyName.mc._y = enemyName.mc._y + temp;
}
}
if (enemyName.yVel > enemyName.yMax) {
enemyName.yVel = enemyName.yMax;
}
if (!mapHit.hitTest(enemyName.mc._x, (enemyName.mc._y + gravity) + enemyName.yVel, true)) {
enemyName.mc.gotoAndStop("thrown");
if (enemyName.yVel > 20) {
if (enemyName.yVel > 20) {
if (!mapHit.hitTest(enemyName.mc._x, (enemyName.mc._y + gravity) + (enemyName.yVel / 2), true)) {
enemyName.yVel = enemyName.yVel + gravity;
if (enemyName.yVel > gravity) {
enemyName.jumping = false;
}
if (!enemyName.jumping) {
}
} else {
enemy0HitGround(enemyName);
enemyName._y = enemyName._y + (-gravity);
}
}
} else {
enemyName.yVel = enemyName.yVel + gravity;
if (enemyName.yVel > gravity) {
enemyName.jumping = false;
}
if (!enemyName.jumping) {
}
}
} else {
enemy0HitGround(enemyName);
enemyName.mc.gotoAndStop("bouncing");
enemyName.animHoldIdle = 4;
if (enemyName.xVel == 0) {
if (!mapHit.hitTest(enemyName.mc._x - 10, enemyName.mc._y + 3, true)) {
enemyName.xVel = enemyName.yVel * 2;
} else if (!mapHit.hitTest(enemyName.mc._x - 20, enemyName.mc._y + 3, true)) {
enemyName.xVel = enemyName.yVel;
} else if (!mapHit.hitTest(enemyName.mc._x - 40, enemyName.mc._y + 3, true)) {
enemyName.xVel = enemyName.yVel / 2;
} else if (!mapHit.hitTest(enemyName.mc._x + 10, enemyName.mc._y + 3, true)) {
enemyName.xVel = (-enemyName.yVel) * 2;
} else if (!mapHit.hitTest(enemyName.mc._x + 20, enemyName.mc._y + 3, true)) {
enemyName.xVel = -enemyName.yVel;
} else if (!mapHit.hitTest(enemyName.mc._x + 40, enemyName.mc._y + 3, true)) {
enemyName.xVel = (-enemyName.yVel) / 2;
}
}
}
if (enemyName.yVel < 0) {
if (mapHit.hitTest(enemyName.mc._x, (enemyName.mc._y - enemyName.head) + enemyName.yVel, true)) {
temp = enemyName.yVel + gravity;
enemyName.mc._y = enemyName.mc._y + temp;
enemyName.yVel = 0.001;
while (mapHit.hitTest(enemyName.mc._x, (enemyName.mc._y - enemyName.head) + temp, true)) {
enemyName.mc._y = enemyName.mc._y + gravity;
temp = temp + gravity;
}
}
}
enemyName.mc._y = enemyName.mc._y + enemyName.yVel;
if ((enemyName.xVel == 0) && (enemyName.yVel == 0)) {
if (thrownName == enemyName) {
thrownName = null;
}
enemyName.state = "down";
} else {
enemyName.phaseCount = 30;
}
}
function enemy1_Hit(enemyName) {
enemyName.hitCount--;
if (enemyName.hitCount <= 0) {
if (enemyName.yVel != 0) {
enemyName.mc.gotoAndStop("fall");
} else {
enemyName.mc.gotoAndStop("idle");
}
enemyName.state = "normal";
} else {
enemyName.mc.gotoAndStop("hit2");
if (enemyName.xVel > 0) {
if (enemyName.yVel != 0) {
enemyName.xVel = enemyName.xVel / frictionAir;
} else {
enemyName.xVel = enemyName.xVel / friction;
}
if (enemyName.xVel <= 0.9) {
enemyName.xVel = 0;
}
} else if (enemyName.xVel < 0) {
if (enemyName.yVel != 0) {
enemyName.xVel = enemyName.xVel / frictionAir;
} else {
enemyName.xVel = enemyName.xVel / friction;
}
if (enemyName.xVel >= -0.9) {
enemyName.xVel = 0;
}
}
if (enemyName.xVel != 0) {
if (enemyName.stopCount >= 0) {
if (mapHit.hitTest(enemyName.mc._x + enemyName.xVel, enemyName.mc._y - gravity, true)) {
enemyName.xVel = 0;
enemyName.xDest = enemyName.mc._x - 10;
enemyName.stopCount = -1;
}
}
}
enemyName.mc._x = enemyName.mc._x + enemyName.xVel;
if ((enemyName.xVel != 0) && (enemyName.stopCount < 0)) {
if ((!mapHit.hitTest(enemyName.mc._x, enemyName.mc._y, true)) && (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + (gravity * 8), true))) {
temp = 0;
while ((temp < (gravity * 8)) && (!mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + temp, true))) {
temp = temp + gravity;
}
enemyName.mc._y = enemyName.mc._y + temp;
}
}
if (!mapHit.hitTest(enemyName.mc._x, (enemyName.mc._y + gravity) + enemyName.yVel, true)) {
enemyName.yVel = enemyName.yVel + gravity;
if (!enemyName.jumping) {
}
} else {
enemyName.yVel = enemyName.yVel + (-gravity);
temp = enemyName.yMax;
while (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + enemyName.yVel, true)) {
enemyName.yVel = enemyName.yVel + (-gravity);
temp = temp + (-gravity);
if (temp < gravity) {
if (!mapHit.hitTest(enemyName.mc._x - 50, enemyName.mc._y + enemyName.head, true)) {
enemyName.mc._x = enemyName.mc._x + -50;
} else if (!mapHit.hitTest(enemyName.mc._x + 50, enemyName.mc._y + enemyName.head, true)) {
enemyName.mc._x = enemyName.mc._x + 50;
}
enemyName.yVel = 0;
break;
}
}
enemyName.yVel = enemyName.yVel + gravity;
enemyName.mc._y = enemyName.mc._y + enemyName.yVel;
if (enemyName.yVel != 0) {
enemyName.landCount = 6;
}
enemyName.yVel = 0;
enemyName.jumping = false;
}
if (enemyName.ySpec <= 0) {
if (enemyName.yVel > enemyName.yMax) {
enemyName.yVel = enemyName.yMax;
} else if (enemyName.yVel < (-enemyName.yMax)) {
enemyName.yVel = -enemyName.yMax;
}
}
enemyName.mc._y = enemyName.mc._y + enemyName.yVel;
}
}
function enemy1_Falldown(enemyName) {
enemyName.hitCount--;
if ((enemyName.hitCount <= 0) && (enemyName.yVel == 0)) {
if (enemyName.hp > 0) {
trace(enemyName.hp);
enemyName.hitCount = 12;
enemyName.mc.gotoAndStop("getup");
enemyName.state = "getup";
} else {
enemyName.state = "dead";
enemyName.gotoAndStop("deathDown");
}
}
if (enemyName.xVel > 0) {
if (enemyName.yVel != 0) {
enemyName.xVel = enemyName.xVel / frictionAir;
} else {
enemyName.xVel = enemyName.xVel / friction;
}
if (enemyName.xVel <= 0.9) {
enemyName.xVel = 0;
}
} else if (enemyName.xVel < 0) {
if (enemyName.yVel != 0) {
enemyName.xVel = enemyName.xVel / frictionAir;
} else {
enemyName.xVel = enemyName.xVel / friction;
}
if (enemyName.xVel >= -0.9) {
enemyName.xVel = 0;
}
}
if (enemyName.xVel != 0) {
if (enemyName.stopCount >= 0) {
if (mapHit.hitTest(enemyName.mc._x + enemyName.xVel, enemyName.mc._y - gravity, true)) {
enemyName.xVel = 0;
enemyName.xDest = enemyName.mc._x;
enemyName.stopCount = -1;
}
}
}
enemyName.mc._x = enemyName.mc._x + enemyName.xVel;
if ((enemyName.xVel != 0) && (enemyName.stopCount < 0)) {
if ((!mapHit.hitTest(enemyName.mc._x, enemyName.mc._y, true)) && (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + (gravity * 8), true))) {
temp = 0;
while ((temp < (gravity * 8)) && (!mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + temp, true))) {
temp = temp + gravity;
}
enemyName.mc._y = enemyName.mc._y + temp;
}
}
if (!mapHit.hitTest(enemyName.mc._x, (enemyName.mc._y + gravity) + enemyName.yVel, true)) {
enemyName.yVel = enemyName.yVel + gravity;
if (!enemyName.jumping) {
}
if (enemyName.yVel > 0) {
enemyName.fallTime++;
}
} else {
enemyName.yVel = enemyName.yVel + (-gravity);
temp = enemyName.yMax;
while (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + enemyName.yVel, true)) {
enemyName.yVel = enemyName.yVel + (-gravity);
temp = temp + (-gravity);
if (temp < gravity) {
if (!mapHit.hitTest(enemyName.mc._x - 50, enemyName.mc._y + enemyName.head, true)) {
enemyName.mc._x = enemyName.mc._x + -50;
} else if (!mapHit.hitTest(enemyName.mc._x + 50, enemyName.mc._y + enemyName.head, true)) {
enemyName.mc._x = enemyName.mc._x + 50;
}
enemyName.yVel = 0;
break;
}
}
enemyName.yVel = enemyName.yVel + gravity;
enemyName.mc._y = enemyName.mc._y + enemyName.yVel;
if (enemyName.yVel != 0) {
}
enemyName.yVel = 0;
enemyName.jumping = false;
enemyName.fallTime = 0;
}
if (enemyName.ySpec <= 0) {
if (enemyName.yVel > enemyName.yMax) {
enemyName.yVel = enemyName.yMax;
} else if (enemyName.yVel < (-enemyName.yMax)) {
enemyName.yVel = -enemyName.yMax;
}
}
enemyName.mc._y = enemyName.mc._y + enemyName.yVel;
}
function enemy1_Getup(enemyName) {
enemyName.hitCount--;
if (enemyName.hitCount <= 0) {
enemyName.mc.gotoAndStop("idle");
enemyName.state = "normal";
}
}
function enemy1_Choking(enemyName) {
if (enemyName.mc._xscale < 0) {
enemyName.mc._x = p1.mc._x - p1.mc.mcMC.mcHand;
} else {
enemyName.mc._x = p1.mc._x + p1.mc.mcMC.mcHand;
}
if (enemyName.phaseCount <= 0) {
p1.holdName = null;
enemyName.state = "clothes";
soundFX.attachSound("s_choke2");
soundFX.start(0, 0);
}
}
function enemy1_Down(enemyName) {
if (enemyName.animHoldIdle <= 0) {
enemyName.mc.gotoAndStop("down");
}
if (enemyName.phaseCount <= 0) {
if (enemyName.hp > 0) {
enemyName.state = "normal";
enemyName.mc.gotoAndStop("getup");
enemyName.animHoldIdle = 23;
enemyName.animHoldWalk = 23;
enemyName.xSpec = 23;
enemyName.mc.swapDepths(enemyName.depth0);
enemyName.phase = 2;
enemyName.phaseCount = 300;
enemyName.xDest = enemyName.mc._x;
enemyName.stopCount = -1;
} else {
enemyName.state = "dead";
enemyName.mc.gotoAndStop("deathDown");
}
}
}
function enemy1_Onfire(enemyName) {
if (enemyName.phaseCount > 0) {
temp = 1;
while (temp <= projectiles) {
temp2 = "proj_" + temp;
temp2 = this[temp2];
if ((temp2.mc._x != undefined) && (temp2.state == "thrown")) {
if (Math.abs(temp2.mc._x - enemyName.mc._x) < 300) {
if (enemyName.mc.mcHit.hitTest(temp2.mc._x, temp2.mc._y, true)) {
enemyName.xVel = temp2.xVel;
enemyName.yVel = -6 - (Math.random() * 8);
enemyName.state = "thrown";
enemyName.mc.gotoAndStop("thrown");
enemyName.hp = enemyName.hp + (-temp2.bp);
temp2.state = "hit";
temp2.phaseCount = -123;
}
}
}
temp++;
}
if (p1.headbouncing == 1) {
if (enemyName.mc.mcHit.hitTest(p1.mc._x, p1.mc._y, true)) {
p1.headbouncing = 2;
p1.mc._y = enemyName.mc._y - enemyName.head;
enemyName.mc.gotoAndStop("drop");
enemyName.animHoldIdle = 19;
enemyName.xVel = 0;
enemyName.state = "down";
enemyName.phaseCount = 90;
enemyName.holdName.mc.swapDepths(enemyName.holdName.mc.getDepth() + enemyDeadOffset);
}
}
if (enemyName.state == "onfire") {
soundHoodleyFire.setPan(Math.ceil(((enemyName.mc._x - mcCam._x) / 400) * 100));
soundHoodleyFire.setVolume(Math.abs(100 - Math.abs(Math.ceil(((enemyName.mc._x - mcCam._x) / 400) * 100))) + 30);
if (Math.abs(enemyName.mc._x - enemyName.xDest) < 5) {
enemyName.mc._x = enemyName.xDest;
enemyName.xVel = 0;
if (Math.random() > 0.5) {
enemyName.xDest = (enemyName.mc._x + (Math.random() * 140)) + 80;
} else {
enemyName.xDest = (enemyName.mc._x - (Math.random() * 140)) - 80;
}
if ((enemyName.mc._xscale > 0) && (enemyName.xDest < enemyName.mc._x)) {
enemyName.mc._xscale = -100;
enemyName.mc.gotoAndStop("turnFire");
enemyName.animHoldWalk = 2;
} else if ((enemyName.mc._xscale < 0) && (enemyName.xDest > enemyName.mc._x)) {
enemyName.mc._xscale = 100;
enemyName.mc.gotoAndStop("turnFire");
enemyName.animHoldWalk = 2;
} else {
enemyName.gotoAndStop("onfire");
}
}
if (enemyName.mc._xscale < 0) {
if (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + gravity, true)) {
if (enemyName.animHoldWalk <= 0) {
enemyName.mc.gotoAndStop("onfire");
}
temp = enemyName.xVel - enemyName.xAcc;
if (temp < (-enemyName.xFireMax)) {
temp = -enemyName.xFireMax;
}
enemy1WalkFire(enemyName, -100, temp, 4);
} else {
temp = enemyName.xVel - enemyName.xAirAcc;
if (temp < (-enemyName.xFireMax)) {
temp = -enemyName.xFireMax;
}
if (((!mapHit.hitTest(enemyName.mc._x + temp, enemyName.mc._y, true)) && (!mapHit.hitTest(enemyName.mc._x + temp, enemyName.mc._y - (enemyName.head / 2), true))) && (!mapHit.hitTest(enemyName.mc._x + temp, (enemyName.mc._y - enemyName.head) + 6, true))) {
if (enemyName.xVel < (-enemyName.xFireMax)) {
if (((!mapHit.hitTest(enemyName.mc._x + (temp / 2), enemyName.mc._y, true)) && (!mapHit.hitTest(enemyName.mc._x + (temp / 2), enemyName.mc._y - (enemyName.head / 2), true))) && (!mapHit.hitTest(enemyName.mc._x + (temp / 2), (enemyName.mc._y - enemyName.head) + 6, true))) {
enemyName.xVel = enemyName.xVel + (-enemyName.xAirAcc);
}
} else {
enemyName.xVel = enemyName.xVel + (-enemyName.xAirAcc);
}
} else {
enemyName.xVel = 0;
}
}
} else if (enemyName.mc._xscale > 0) {
if (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + gravity, true)) {
if (enemyName.animHoldWalk <= 0) {
enemyName.mc.gotoAndStop("onfire");
}
temp = enemyName.xVel + enemyName.xAcc;
if (temp > enemyName.xFireMax) {
temp = enemyName.xFireMax;
}
enemy1WalkFire(enemyName, 100, temp, 4);
} else {
temp = enemyName.xVel + enemyName.xAirAcc;
if (temp > enemyName.xFireMax) {
temp = enemyName.xFireMax;
}
if (((!mapHit.hitTest(enemyName.mc._x + temp, enemyName.mc._y, true)) && (!mapHit.hitTest(enemyName.mc._x + temp, enemyName.mc._y - (enemyName.head / 2), true))) && (!mapHit.hitTest(enemyName.mc._x + temp, (enemyName.mc._y - enemyName.head) + 6, true))) {
if (enemyName.xVel > enemyName.xFireMax) {
if (((!mapHit.hitTest(enemyName.mc._x + (temp / 2), enemyName.mc._y, true)) && (!mapHit.hitTest(enemyName.mc._x + (temp / 2), enemyName.mc._y - (enemyName.head / 2), true))) && (!mapHit.hitTest(enemyName.mc._x + (temp / 2), (enemyName.mc._y - enemyName.head) + 6, true))) {
enemyName.xVel = enemyName.xVel + enemyName.xAirAcc;
}
} else {
enemyName.xVel = enemyName.xVel + enemyName.xAirAcc;
}
} else {
enemyName.xVel = 0;
}
}
}
if (enemyName.xSpec > 0) {
enemyName.xSpec--;
}
if (enemyName.xSpec <= 0) {
if (enemyName.xVel > enemyName.xFireMax) {
enemyName.xVel = enemyName.xFireMax + ((enemyName.xFireMax - enemyName.xVel) / 8);
} else if (enemyName.xVel < (-enemyName.xFireMax)) {
enemyName.xVel = (-enemyName.xFireMax) + ((enemyName.xVel + enemyName.xFireMax) / 8);
}
}
}
if (enemyName.xVel != 0) {
if (mapHit.hitTest(enemyName.mc._x + enemyName.xVel, enemyName.mc._y - gravity, true)) {
}
}
enemyName.mc._x = enemyName.mc._x + enemyName.xVel;
if (enemyName.xVel != 0) {
if ((!mapHit.hitTest(enemyName.mc._x, enemyName.mc._y, true)) && (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + (gravity * 8), true))) {
temp = 0;
while ((temp < (gravity * 8)) && (!mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + temp, true))) {
temp = temp + gravity;
}
enemyName.mc._y = enemyName.mc._y + temp;
}
}
if (!mapHit.hitTest(enemyName.mc._x, (enemyName.mc._y + gravity) + enemyName.yVel, true)) {
enemyName.yVel = enemyName.yVel + gravity;
} else {
enemyName.yVel = enemyName.yVel + (-gravity);
temp = enemyName.yMax;
while (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + enemyName.yVel, true)) {
enemyName.yVel = enemyName.yVel + (-gravity);
temp = temp + (-gravity);
if (temp < gravity) {
if (!mapHit.hitTest(enemyName.mc._x - 50, enemyName.mc._y + 10, true)) {
enemyName.mc._x = enemyName.mc._x + -50;
} else {
enemyName.mc._x = enemyName.mc._x + 50;
}
enemyName.yVel = 0;
break;
}
}
enemyName.yVel = enemyName.yVel + gravity;
enemyName.mc._y = enemyName.mc._y + enemyName.yVel;
enemyName.yVel = 0;
enemyName.jumping = false;
}
if (enemyName.yVel < 0) {
if (mapHit.hitTest(enemyName.mc._x, (enemyName.mc._y - enemyName.head) + enemyName.yVel, true)) {
temp = enemyName.yVel + gravity;
enemyName.mc._y = enemyName.mc._y + temp;
enemyName.yVel = 0.001;
while (mapHit.hitTest(enemyName.mc._x, (enemyName.mc._y - enemyName.head) + temp, true)) {
enemyName.mc._y = enemyName.mc._y + gravity;
temp = temp + gravity;
}
}
}
if (enemyName.ySpec > 0) {
enemyName.ySpec--;
}
if (enemyName.ySpec <= 0) {
if (enemyName.yVel > enemyName.yMax) {
enemyName.yVel = enemyName.yMax;
} else if (enemyName.yVel < (-enemyName.yMax)) {
enemyName.yVel = -enemyName.yMax;
}
}
enemyName.mc._y = enemyName.mc._y + enemyName.yVel;
if ((Math.abs(enemyName.mc._x - p1.mc._x) > xCutoff) || (Math.abs(enemyName.mc._y - p1.mc._y) > yCutoff)) {
enemyName.mc._visible = false;
} else if (Math.random() > 0.75) {
makeFX("fire", (enemyName.mc._x - 16) + (Math.random() * 32), (enemyName.mc._y - 6) - (Math.random() * 30));
}
if ((thrownName != null) && (thrownName != enemyName)) {
if (thrownName.actor != "torch") {
if (enemyName.mc.mcHit.hitTest(thrownName.mc.mcHit)) {
enemyName.xVel = thrownName.xVel;
enemyName.yVel = thrownName.yVel;
thrownName.xVel = (-thrownName.xVel) * 0.8;
thrownName.yVel = (-thrownName.yVel) * 0.8;
}
} else if ((thrownName.state == "thrown") && ((Math.abs(thrownName.xVel) > 6) || (Math.abs(thrownName.yVel) > 6))) {
if (enemyName.mc.mcHit.hitTest(thrownName.mc._x, thrownName.mc._y, true)) {
enemyName.state = "onfire";
enemyName.mc.gotoAndStop("onfire");
enemyName.phaseCount = 120;
thrownName.state = "hit";
thrownName.mc.gotoAndStop("hit");
thrownName.xVel = 0;
thrownName.yVel = 0;
thrownName = null;
}
}
}
} else {
enemyName.state = "deadFire";
enemyName.mc.gotoAndStop("deathFire");
soundHoodleyFire.stop();
soundFX.attachSound("s_torchhit");
soundFX.start(0, 0);
soundFX.setPan(Math.ceil(((enemyName.mc._x - mcCam._x) / 400) * 100));
}
}
function enemy1_Whacked(enemyName) {
if (enemyName.phaseCount == 25) {
shakeCam = 10;
} else if (enemyName.phaseCount <= 0) {
enemyName.mc._visible = false;
enemyName.mc._x = -50000;
enemyName.mc._y = -50000;
enemyName.state = "dead";
}
}
function enemy1Walk(enemyName, bDirection, velocity, xBuffer) {
if (bDirection < 0) {
if ((!mapHit.hitTest((enemyName.mc._x - xBuffer) + velocity, enemyName.mc._y, true)) && (mapHit.hitTest((enemyName.mc._x - xBuffer) + velocity, enemyName.mc._y + (gravity * 8), true))) {
enemyName.xVel = velocity;
enemyName.mc._y = enemyName.mc._y + gravity;
velocity = 0;
while ((velocity < (gravity * 8)) && (!mapHit.hitTest((enemyName.mc._x - xBuffer) + enemyName.xVel, enemyName.mc._y + velocity, true))) {
velocity = velocity + gravity;
}
enemyName.mc._y = enemyName.mc._y + velocity;
} else if ((!mapHit.hitTest((enemyName.mc._x - xBuffer) + velocity, enemyName.mc._y - gravity, true)) && (mapHit.hitTest(((enemyName.mc._x - xBuffer) - enemyName.xAcc) + velocity, enemyName.mc._y + gravity, true))) {
enemyName.xVel = velocity;
} else if ((!mapHit.hitTest((enemyName.mc._x - xBuffer) + velocity, enemyName.mc._y - 9, true)) && (mapHit.hitTest((enemyName.mc._x - xBuffer) + velocity, enemyName.mc._y, true))) {
enemyName.xVel = velocity;
velocity = gravity * 2;
while (mapHit.hitTest((enemyName.mc._x - xBuffer) + enemyName.xVel, enemyName.mc._y - velocity, true)) {
velocity = velocity + gravity;
}
if (enemyName.xVel > (-enemyName.xAcc)) {
enemyName.xVel = -enemyName.xAcc;
}
enemyName.mc._y = enemyName.mc._y + ((-velocity) + gravity);
enemyName.yVel = 0;
} else {
if (enemyName.xVel > 0) {
if (mapHit.hitTest((enemyName.mc._x + xBuffer) + enemyName.xVel, enemyName.mc._y - gravity, true)) {
velocity = enemyName.xVel - enemyName.xAcc;
do {
if (!mapHit.hitTest((enemyName.mc._x + xBuffer) + velocity, enemyName.mc._y - gravity, true)) {
break;
}
velocity = velocity + (-enemyName.xAcc);
} while (velocity >= 0);
enemyName.mc._x = enemyName.mc._x + velocity;
}
} else if (mapHit.hitTest((enemyName.mc._x - xBuffer) + enemyName.xVel, enemyName.mc._y - gravity, true)) {
velocity = enemyName.xVel + enemyName.xAcc;
do {
if (!mapHit.hitTest((enemyName.mc._x - xBuffer) + velocity, enemyName.mc._y - gravity, true)) {
break;
}
velocity = velocity + enemyName.xAcc;
} while (velocity <= 0);
enemyName.mc._x = enemyName.mc._x + velocity;
}
enemyName.xVel = 0;
enemyName.stopCount = 60 + Math.ceil(Math.random() * 30);
if ((enemyName.state == "normal") && (enemyName.phase == 1)) {
enemyName.mc.gotoAndStop("idle");
} else if ((enemyName.state == "normal") && (enemyName.phase == 2)) {
enemyName.mc.gotoAndStop("idle2");
}
}
} else if ((!mapHit.hitTest((enemyName.mc._x + xBuffer) + velocity, enemyName.mc._y, true)) && (mapHit.hitTest((enemyName.mc._x + xBuffer) + velocity, enemyName.mc._y + (gravity * 8), true))) {
enemyName.xVel = velocity;
enemyName.mc._y = enemyName.mc._y + gravity;
velocity = 0;
while ((velocity < (gravity * 8)) && (!mapHit.hitTest((enemyName.mc._x + xBuffer) + enemyName.xVel, enemyName.mc._y + velocity, true))) {
velocity = velocity + gravity;
}
enemyName.mc._y = enemyName.mc._y + velocity;
} else if ((!mapHit.hitTest((enemyName.mc._x + xBuffer) + velocity, enemyName.mc._y - gravity, true)) && (mapHit.hitTest(((enemyName.mc._x + xBuffer) + enemyName.xAcc) + velocity, enemyName.mc._y + gravity, true))) {
enemyName.xVel = velocity;
} else if ((!mapHit.hitTest((enemyName.mc._x + xBuffer) + velocity, enemyName.mc._y - 9, true)) && (mapHit.hitTest((enemyName.mc._x + xBuffer) + velocity, enemyName.mc._y, true))) {
enemyName.xVel = velocity;
velocity = gravity * 2;
while (mapHit.hitTest((enemyName.mc._x + xBuffer) + enemyName.xVel, enemyName.mc._y - velocity, true)) {
velocity = velocity + gravity;
}
if (enemyName.xVel < enemyName.xAcc) {
enemyName.xVel = enemyName.xAcc;
}
enemyName.mc._y = enemyName.mc._y + ((-velocity) + gravity);
enemyName.yVel = 0;
} else {
if (enemyName.xVel > 0) {
if (mapHit.hitTest((enemyName.mc._x + xBuffer) + enemyName.xVel, enemyName.mc._y - gravity, true)) {
velocity = enemyName.xVel - enemyName.xAcc;
do {
if (!mapHit.hitTest((enemyName.mc._x + xBuffer) + velocity, enemyName.mc._y - gravity, true)) {
break;
}
velocity = velocity + (-enemyName.xAcc);
} while (velocity >= 0);
enemyName.mc._x = enemyName.mc._x + velocity;
}
} else if (mapHit.hitTest((enemyName.mc._x - xBuffer) + enemyName.xVel, enemyName.mc._y - gravity, true)) {
velocity = enemyName.xVel + enemyName.xAcc;
do {
if (!mapHit.hitTest((enemyName.mc._x + xBuffer) + velocity, enemyName.mc._y - gravity, true)) {
break;
}
velocity = velocity + enemyName.xAcc;
} while (velocity <= 0);
enemyName.mc._x = enemyName.mc._x + velocity;
}
enemyName.xVel = 0;
enemyName.stopCount = 60 + Math.ceil(Math.random() * 30);
if ((enemyName.state == "normal") && (enemyName.phase == 1)) {
enemyName.mc.gotoAndStop("idle");
} else if ((enemyName.state == "normal") && (enemyName.phase == 2)) {
enemyName.mc.gotoAndStop("idle2");
}
}
}
function enemy1WalkFire(enemyName, bDirection, velocity, xBuffer) {
if (bDirection < 0) {
if ((!mapHit.hitTest((enemyName.mc._x - xBuffer) + velocity, enemyName.mc._y, true)) && (mapHit.hitTest((enemyName.mc._x - xBuffer) + velocity, enemyName.mc._y + (gravity * 16), true))) {
enemyName.xVel = velocity;
enemyName.mc._y = enemyName.mc._y + gravity;
velocity = 0;
while ((velocity < (gravity * 8)) && (!mapHit.hitTest((enemyName.mc._x - xBuffer) + enemyName.xVel, enemyName.mc._y + velocity, true))) {
velocity = velocity + gravity;
}
enemyName.mc._y = enemyName.mc._y + velocity;
} else if ((!mapHit.hitTest((enemyName.mc._x - xBuffer) + velocity, enemyName.mc._y - gravity, true)) && (mapHit.hitTest(((enemyName.mc._x - xBuffer) - enemyName.xAcc) + velocity, enemyName.mc._y + gravity, true))) {
enemyName.xVel = velocity;
} else if ((!mapHit.hitTest((enemyName.mc._x - xBuffer) + velocity, enemyName.mc._y - 9, true)) && (mapHit.hitTest((enemyName.mc._x - xBuffer) + velocity, enemyName.mc._y, true))) {
enemyName.xVel = velocity;
velocity = gravity * 2;
while (mapHit.hitTest((enemyName.mc._x - xBuffer) + enemyName.xVel, enemyName.mc._y - velocity, true)) {
velocity = velocity + gravity;
}
if (enemyName.xVel > (-enemyName.xAcc)) {
enemyName.xVel = -enemyName.xAcc;
}
enemyName.mc._y = enemyName.mc._y + ((-velocity) + gravity);
enemyName.yVel = 0;
} else {
if (enemyName.xVel > 0) {
if (mapHit.hitTest((enemyName.mc._x + xBuffer) + enemyName.xVel, enemyName.mc._y - gravity, true)) {
velocity = enemyName.xVel - enemyName.xAcc;
do {
if (!mapHit.hitTest((enemyName.mc._x + xBuffer) + velocity, enemyName.mc._y - gravity, true)) {
break;
}
velocity = velocity + (-enemyName.xAcc);
} while (velocity >= 0);
enemyName.mc._x = enemyName.mc._x + velocity;
}
} else if (mapHit.hitTest((enemyName.mc._x - xBuffer) + enemyName.xVel, enemyName.mc._y - gravity, true)) {
velocity = enemyName.xVel + enemyName.xAcc;
do {
if (!mapHit.hitTest((enemyName.mc._x - xBuffer) + velocity, enemyName.mc._y - gravity, true)) {
break;
}
velocity = velocity + enemyName.xAcc;
} while (velocity <= 0);
enemyName.mc._x = enemyName.mc._x + velocity;
}
enemyName.xVel = 0;
enemyName.stopCount = 60 + Math.ceil(Math.random() * 30);
if ((enemyName.state == "normal") && (enemyName.phase == 1)) {
enemyName.mc.gotoAndStop("idle");
} else if ((enemyName.state == "normal") && (enemyName.phase == 2)) {
enemyName.mc.gotoAndStop("idle2");
}
}
} else if ((!mapHit.hitTest((enemyName.mc._x + xBuffer) + velocity, enemyName.mc._y, true)) && (mapHit.hitTest((enemyName.mc._x + xBuffer) + velocity, enemyName.mc._y + (gravity * 16), true))) {
enemyName.xVel = velocity;
enemyName.mc._y = enemyName.mc._y + gravity;
velocity = 0;
while ((velocity < (gravity * 8)) && (!mapHit.hitTest((enemyName.mc._x + xBuffer) + enemyName.xVel, enemyName.mc._y + velocity, true))) {
velocity = velocity + gravity;
}
enemyName.mc._y = enemyName.mc._y + velocity;
} else if ((!mapHit.hitTest((enemyName.mc._x + xBuffer) + velocity, enemyName.mc._y - gravity, true)) && (mapHit.hitTest(((enemyName.mc._x + xBuffer) + enemyName.xAcc) + velocity, enemyName.mc._y + gravity, true))) {
enemyName.xVel = velocity;
} else if ((!mapHit.hitTest((enemyName.mc._x + xBuffer) + velocity, enemyName.mc._y - 9, true)) && (mapHit.hitTest((enemyName.mc._x + xBuffer) + velocity, enemyName.mc._y, true))) {
enemyName.xVel = velocity;
velocity = gravity * 2;
while (mapHit.hitTest((enemyName.mc._x + xBuffer) + enemyName.xVel, enemyName.mc._y - velocity, true)) {
velocity = velocity + gravity;
}
if (enemyName.xVel < enemyName.xAcc) {
enemyName.xVel = enemyName.xAcc;
}
enemyName.mc._y = enemyName.mc._y + ((-velocity) + gravity);
enemyName.yVel = 0;
} else {
if (enemyName.xVel > 0) {
if (mapHit.hitTest((enemyName.mc._x + xBuffer) + enemyName.xVel, enemyName.mc._y - gravity, true)) {
velocity = enemyName.xVel - enemyName.xAcc;
do {
if (!mapHit.hitTest((enemyName.mc._x + xBuffer) + velocity, enemyName.mc._y - gravity, true)) {
break;
}
velocity = velocity + (-enemyName.xAcc);
} while (velocity >= 0);
enemyName.mc._x = enemyName.mc._x + velocity;
}
} else if (mapHit.hitTest((enemyName.mc._x - xBuffer) + enemyName.xVel, enemyName.mc._y - gravity, true)) {
velocity = enemyName.xVel + enemyName.xAcc;
do {
if (!mapHit.hitTest((enemyName.mc._x + xBuffer) + velocity, enemyName.mc._y - gravity, true)) {
break;
}
velocity = velocity + enemyName.xAcc;
} while (velocity <= 0);
enemyName.mc._x = enemyName.mc._x + velocity;
}
enemyName.xVel = 0;
enemyName.stopCount = 60 + Math.ceil(Math.random() * 30);
if ((enemyName.state == "normal") && (enemyName.phase == 1)) {
enemyName.mc.gotoAndStop("idle");
} else if ((enemyName.state == "normal") && (enemyName.phase == 2)) {
enemyName.mc.gotoAndStop("idle2");
}
}
}
function enemy1Jump(enemyName) {
with (enemyName) {
jumping = true;
crouched = false;
jumpPressed = true;
yVel = -20;
animHoldAir = 10;
mc.gotoAndStop("jump");
}
}
function enemy1_grabCheck(enemyName) {
if ((((p1.holdName == null) && (p1.grabCount > 0)) && (p1.yVel == 0)) && (p1.mc.mcMC.mcGrab._x != undefined)) {
if ((((enemyName.mc._xscale > 0) && (p1.mc._xscale > 0)) && (p1.mc._x < enemyName.mc._x)) || (((enemyName.mc._xscale < 0) && (p1.mc._xscale < 0)) && (p1.mc._x > enemyName.mc._x))) {
if (p1.mc._xscale > 0) {
temp = p1.mc.mcMC.mcGrab._x;
} else {
temp = -p1.mc.mcMC.mcGrab._x;
}
if (enemyName.mc.mcHit.hitTest(p1.mc._x + temp, p1.mc._y + p1.mc.mcMC.mcGrab._y, true)) {
enemyName.state = "grabbed";
enemyName.xVel = 0;
enemyName.mc.gotoAndStop("grabbed0");
enemyName.animHoldIdle = 10;
enemyName.grabbedName = p1;
p1.holdName = enemyName;
p1.windup = 0;
p1.mc.gotoAndStop("grabIdleFinish");
p1.animHoldIdle = 10;
p1.state = "grabbing";
if (enemyName.holdName != null) {
enemyName.holdName.state = "thrown";
enemyName.holdName.mc._rotation = 0;
if (enemyName.mc._xscale > 0) {
enemyName.holdName.xVel = 6;
} else {
enemyName.holdName.xVel = -6;
}
enemyName.holdName.yVel = -8;
enemyName.holdName.grabbedName = null;
enemyName.holdName = null;
enemyName.grabCount = 0;
}
soundFX.attachSound("s_grabbed");
soundFX.start(0, 0);
}
}
}
}
function enemy1_getHit(enemyName) {
if (p1.whacking == 3) {
enemyName.state = "whacked";
enemyName.mc.gotoAndStop("whacked");
enemyName.mc.swapDepths(topDepth);
enemyName.phaseCount = 34;
if (enemyName.holdName != null) {
enemyName.holdName.state = "thrown";
enemyName.holdName.mc._rotation = 0;
if (enemyName.mc._xscale > 0) {
enemyName.holdName.xVel = (Math.random() * 4) + 4;
} else {
enemyName.holdName.xVel = (Math.random() * -4) - 4;
}
enemyName.holdName.yVel = (Math.random() * -6) - 8;
enemyName.holdName.grabbedName = null;
enemyName.holdName = null;
enemyName.grabCount = 0;
}
soundFX.attachSound("s_whacked");
soundFX.start(0, 0);
} else if (p1.finalHit) {
if (p1.mc._x <= enemyName.mc._x) {
enemyName.xVel = 10;
} else {
enemyName.xVel = -10;
}
enemyName.hitCount = 22;
enemyName.mc.gotoAndStop("falldown");
enemyName.state = "falldown";
} else {
if (p1.mc._x <= enemyName.mc._x) {
enemyName.xVel = p1.xForce;
} else {
enemyName.xVel = -p1.xForce;
}
enemyName.yVel = p1.yForce;
enemyName.hitCount = p1.hitHold;
enemyName.state = "hit";
}
}
function enemy1_projectileHit(enemyName) {
enemyName.xVel = temp2.xVel;
enemyName.yVel = -6 - (Math.random() * 8);
enemyName.state = "thrown";
enemyName.mc.gotoAndStop("thrown");
enemyName.hp = enemyName.hp + (-temp2.bp);
if (enemyName.holdName != null) {
enemyName.holdName.state = "thrown";
enemyName.holdName.mc._rotation = 0;
enemyName.holdName.xVel = (Math.random() * 10) + enemyName.xVel;
enemyName.holdName.yVel = (Math.random() * -6) - 10;
enemyName.holdName.grabbedName = null;
enemyName.holdName = null;
enemyName.grabCount = 0;
}
if (temp2.projType == "fireball") {
temp2.state = "hit";
temp2.mc.gotoAndStop("hit");
temp2.phaseCount = -123;
makeFX("fire", (temp2.mc._x - 16) + (Math.random() * 32), (temp2.mc._y - 8) + (Math.random() * 16));
makeFX("fire", (temp2.mc._x - 16) + (Math.random() * 32), (temp2.mc._y - 8) + (Math.random() * 16));
soundFX.attachSound("s_hoodleyhit");
soundFX.start(0, 0);
soundFX.setPan(Math.ceil(((enemyName.mc._x - mcCam._x) / 400) * 100));
} else if (temp2.projType == "wind") {
temp2.state = "hit";
temp2.mc.gotoAndStop("hit");
temp2.phaseCount = -123;
soundFX.attachSound("s_hoodleyhit");
soundFX.start(0, 0);
soundFX.setPan(Math.ceil(((enemyName.mc._x - mcCam._x) / 400) * 100));
} else if (temp2.projType == "lightning") {
temp2.state = "hit";
temp2.mc.gotoAndStop("hit");
temp2.phaseCount = -123;
soundFX.attachSound("s_lightninghit");
soundFX.start(0, 0);
soundFX.setPan(Math.ceil(((enemyName.mc._x - mcCam._x) / 400) * 100));
}
makeGemShard(enemyName.mc._x, enemyName.mc._y - enemyName.head, random(10) - 5, (-random(6)) - 8);
}
function enemy1_grabStaff(enemyName) {
var _local3 = false;
temp = 1;
while (temp <= staffs) {
temp2 = "staff_" + temp;
temp2 = this[temp2];
if (((temp2.grabbedName == null) && (temp2.state == "normal")) && (enemyName.mc.mcMC.mcGrab != undefined)) {
if (enemyName.mc._xscale > 0) {
temp = enemyName.mc.mcMC.mcGrab._x;
} else {
temp = -enemyName.mc.mcMC.mcGrab._x;
}
if (temp2.mc.mcHit.hitTest(enemyName.mc._x + temp, enemyName.mc._y + enemyName.mc.mcMC.mcGrab._y, true)) {
temp2.state = "grabbed";
temp2.grabbedName = enemyName;
temp2.mc.swapDepths(enemyName.depth0 + 1);
temp2.depth = enemyName.depth0 + 1;
enemyName.holdName = temp2;
enemyName.grabCount = 0;
_local3 = true;
break;
}
}
temp++;
}
if (!_local3) {
if (enemyName.mc._xscale < 0) {
enemyName.xDest = enemyName.xDest + -10;
} else {
enemyName.xDest = enemyName.xDest + 10;
}
}
}
function enemy1_headbounced(enemyName) {
p1.headbouncing = 2;
p1.mc._y = enemyName.mc._y - enemyName.head;
enemyName.mc.gotoAndStop("drop");
enemyName.animHoldIdle = 19;
enemyName.xVel = 0;
enemyName.state = "down";
enemyName.phaseCount = 90;
enemyName.holdName.mc.swapDepths(enemyName.holdName.mc.getDepth() + enemyDeadOffset);
enemyName.hp = enemyName.hp + (-p1.bp);
if (enemyName.holdName != null) {
enemyName.holdName.state = "thrown";
enemyName.holdName.mc._rotation = 0;
enemyName.holdName.yVel = (Math.random() * 4) + 6;
enemyName.holdName.grabbedName = null;
enemyName.holdName = null;
enemyName.grabCount = 0;
}
soundFX.attachSound("s_headbounce");
soundFX.start(0, 0);
}
function enemy1_alerted(enemyName) {
with (enemyName) {
alertTime = 0;
phase = 2;
xVel = 0;
stopCount = 15;
mc.gotoAndStop("alert");
animHoldIdle = 8;
phaseCount = 300;
xDest = p1.mc._x;
}
p1.sp = p1.sp + -5;
p1.updateStealth = true;
soundHuntCount++;
}
function enemy1_phase1(enemyName) {
if ((((enemyName.xSpec <= 0) && (p1.plane == "ground")) && (p1.state != "stuck")) && (p1.state != "ledge")) {
if ((((p1.mc._x - enemyName.mc._x) < 150) && ((p1.mc._x - enemyName.mc._x) > 0)) && (enemyName.mc._xscale > 0)) {
if (Math.abs(p1.mc._y - enemyName.mc._y) < 36) {
if ((!mapHit.hitTest(enemyName.mc._x + 50, enemyName.mc._y - (enemyName.head / 2), true)) && (!mapHit.hitTest(enemyName.mc._x + 100, enemyName.mc._y - (enemyName.head / 2), true))) {
if (!mapHitFG.hitTest(p1.mc._x, p1.mc._y, true)) {
enemyName.alertTime++;
if (Math.abs(p1.xVel) > 4) {
if (enemyName.alertTime > 2) {
enemy1_alerted(enemyName);
}
} else if (p1.crouching) {
if (enemyName.alertTime > 24) {
enemy1_alerted(enemyName);
}
} else if (enemyName.alertTime > 12) {
enemy1_alerted(enemyName);
}
} else if (!Key.isDown(p1.keyDown1)) {
enemyName.alertTime++;
if (Math.abs(p1.xVel) > 4) {
if (enemyName.alertTime > 2) {
enemy1_alerted(enemyName);
}
} else if (p1.crouching) {
if (enemyName.alertTime > 24) {
enemy1_alerted(enemyName);
}
} else if (enemyName.alertTime > 12) {
enemy1_alerted(enemyName);
}
}
}
}
} else if ((((p1.mc._x - enemyName.mc._x) > -150) && ((p1.mc._x - enemyName.mc._x) < 0)) && (enemyName.mc._xscale < 0)) {
if (Math.abs(p1.mc._y - enemyName.mc._y) < 36) {
if ((!mapHit.hitTest(enemyName.mc._x - 50, enemyName.mc._y - (enemyName.head / 2), true)) && (!mapHit.hitTest(enemyName.mc._x - 100, enemyName.mc._y - (enemyName.head / 2), true))) {
if (!mapHitFG.hitTest(p1.mc._x, p1.mc._y, true)) {
enemyName.alertTime++;
if (Math.abs(p1.xVel) > 4) {
if (enemyName.alertTime > 2) {
enemy1_alerted(enemyName);
}
} else if (p1.crouching) {
if (enemyName.alertTime > 24) {
enemy1_alerted(enemyName);
}
} else if (enemyName.alertTime > 12) {
enemy1_alerted(enemyName);
}
} else if (!Key.isDown(p1.keyDown1)) {
enemyName.alertTime++;
if (Math.abs(p1.xVel) > 4) {
if (enemyName.alertTime > 2) {
enemy1_alerted(enemyName);
}
} else if (p1.crouching) {
if (enemyName.alertTime > 24) {
enemy1_alerted(enemyName);
}
} else if (enemyName.alertTime > 12) {
enemy1_alerted(enemyName);
}
}
}
}
}
} else {
enemyName.alertTime = 0;
}
if (enemyName.stopCount > 0) {
enemyName.stopCount--;
} else if (enemyName.stopCount == 0) {
temp = Math.random();
if (temp < 0.2) {
enemyName.stopCount--;
if (enemyName.mc._x < enemyName.xPatrol) {
enemyName.xDest = enemyName.xPatrol + 150;
if (enemyName.mc._xscale < 0) {
enemyName.mc._xscale = 100;
enemyName.mc.gotoAndStop("turn");
}
enemyName.animHoldWalk = 9;
} else {
enemyName.xDest = enemyName.xPatrol - 150;
if (enemyName.mc._xscale > 0) {
enemyName.mc._xscale = -100;
enemyName.mc.gotoAndStop("turn");
}
enemyName.animHoldWalk = 9;
}
}
}
if ((enemyName.xVel != 0) && (Math.abs(enemyName.xDest - enemyName.mc._x) < (enemyName.xAcc + 0.2))) {
enemyName.mc._x = enemyName.xDest;
enemyName.xVel = 0;
enemyName.stopCount = 90;
enemyName.mc.gotoAndStop("idle");
} else if (((enemyName.xSpec <= 0) && (enemyName.holdName == null)) && (enemyName.grabCount <= 0)) {
temp = 1;
while (temp <= staffs) {
temp2 = "staff_" + temp;
temp2 = this[temp2];
if ((temp2.grabbedName == null) && (temp2.state == "normal")) {
if ((Math.abs(enemyName.mc._x - temp2.mc._x) < 16) && (Math.abs(enemyName.mc._y - temp2.mc._y) < 12)) {
enemyName.grabCount = 15;
enemyName.mc.gotoAndStop("grabIdle");
enemyName.animHoldIdle = 24;
enemyName.stopCount = 26;
enemyName.xVel = 0;
enemyName.xDest = enemyName.mc._x;
break;
}
}
temp++;
}
}
if ((enemyName.stopCount < 0) && (enemyName.mc._xscale < 0)) {
if (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + gravity, true)) {
if (enemyName.animHoldWalk <= 0) {
enemyName.mc.gotoAndStop("walk");
}
temp = enemyName.xVel - enemyName.xAcc;
if (temp < (-enemyName.xMax)) {
temp = -enemyName.xMax;
}
enemy1Walk(enemyName, -100, temp, 4);
} else {
temp = enemyName.xVel - enemyName.xAirAcc;
if (temp < (-enemyName.xMax)) {
temp = -enemyName.xMax;
}
if (((!mapHit.hitTest(enemyName.mc._x + temp, enemyName.mc._y, true)) && (!mapHit.hitTest(enemyName.mc._x + temp, enemyName.mc._y - (enemyName.head / 2), true))) && (!mapHit.hitTest(enemyName.mc._x + temp, (enemyName.mc._y - enemyName.head) + 6, true))) {
if (enemyName.xVel < (-enemyName.xMax)) {
if (((!mapHit.hitTest(enemyName.mc._x + (temp / 2), enemyName.mc._y, true)) && (!mapHit.hitTest(enemyName.mc._x + (temp / 2), enemyName.mc._y - (enemyName.head / 2), true))) && (!mapHit.hitTest(enemyName.mc._x + (temp / 2), (enemyName.mc._y - enemyName.head) + 6, true))) {
enemyName.xVel = enemyName.xVel + (-enemyName.xAirAcc);
}
} else {
enemyName.xVel = enemyName.xVel + (-enemyName.xAirAcc);
}
} else {
enemyName.xVel = 0;
enemyName.xDest = enemyName.mc._x + 10;
enemyName.stopCount = -1;
}
}
} else if ((enemyName.stopCount < 0) && (enemyName.mc._xscale > 0)) {
if (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + gravity, true)) {
if (enemyName.animHoldWalk <= 0) {
enemyName.mc.gotoAndStop("walk");
}
temp = enemyName.xVel + enemyName.xAcc;
if (temp > enemyName.xMax) {
temp = enemyName.xMax;
}
enemy1Walk(enemyName, 100, temp, 4);
} else {
temp = enemyName.xVel + enemyName.xAirAcc;
if (temp > enemyName.xMax) {
temp = enemyName.xMax;
}
if (((!mapHit.hitTest(enemyName.mc._x + temp, enemyName.mc._y, true)) && (!mapHit.hitTest(enemyName.mc._x + temp, enemyName.mc._y - (enemyName.head / 2), true))) && (!mapHit.hitTest(enemyName.mc._x + temp, (enemyName.mc._y - enemyName.head) + 6, true))) {
if (enemyName.xVel > enemyName.xMax) {
if (((!mapHit.hitTest(enemyName.mc._x + (temp / 2), enemyName.mc._y, true)) && (!mapHit.hitTest(enemyName.mc._x + (temp / 2), enemyName.mc._y - (enemyName.head / 2), true))) && (!mapHit.hitTest(enemyName.mc._x + (temp / 2), (enemyName.mc._y - enemyName.head) + 6, true))) {
enemyName.xVel = enemyName.xVel + enemyName.xAirAcc;
}
} else {
enemyName.xVel = enemyName.xVel + enemyName.xAirAcc;
}
} else {
enemyName.xVel = 0;
enemyName.xDest = enemyName.mc._x - 10;
enemyName.stopCount = -1;
}
}
} else if (enemyName.xSpec <= 0) {
if (mapHit.hitTest(enemyName.mc._x, enemyName.mc._y + gravity, true)) {
if ((enemyName.animHoldIdle <= 0) && (enemyName.yVel == 0)) {
if ((enemyName.grabCount <= 0) && (enemyName.windup <= 0)) {
enemyName.mc.gotoAndStop("idle");
}
}
if (enemyName.xVel > 0) {
enemyName.xVel = enemyName.xVel + ((-enemyName.xAcc) * 2);
if (enemyName.xVel <= 0.7) {
enemyName.xVel = 0;
}
} else if (enemyName.xVel < 0) {
enemyName.xVel = enemyName.xVel + (enemyName.xAcc * 2);
if (enemyName.xVel >= -0.7) {
enemyName.xVel = 0;
}
}
} else if (enemyName.xVel > 0) {
if ((enemyName.grabCount <= 0) && (enemyName.animHoldAir <= 0)) {
if (enemyName.windup <= 0) {
enemyName.mc.gotoAndStop("fall");
}
enemyName.jumpPressed = true;
enemyName.animHoldAir = 16;
}
enemyName.mc._xscale = 100;
enemyName.xVel = enemyName.xVel + ((-enemyName.xAcc) / 2);
if (enemyName.xVel <= 0) {
enemyName.xVel = 0;
}
} else if (enemyName.xVel < 0) {
if ((enemyName.grabCount <= 0) && (enemyName.animHoldAir <= 0)) {
if (enemyName.windup <= 0) {
enemyName.mc.gotoAndStop("fall");
}
enemyName.jumpPressed = true;
enemyName.animHoldAir = 16;
}
enemyName.mc._xscale = -100;
enemyName.xVel = enemyName.xVel + (enemyName.xAcc / 2);
if (enemyName.xVel >= 0) {
enemyName.xVel = 0;
}
}
}
if (enemyName.xSpec > 0) {
enemyName.xSpec--;
}
if (enemyName.xSpec <= 0) {
if (enemyName.xVel > enemyName.xMax) {
enemyName.xVel = enemyName.xMax + ((enemyName.xMax - enemyName.xVel) / 8);
} else if (enemyName.xVel < (-enemyName.xMax)) {
enemyName.xVel = (-enemyName.xMax) + ((enemyName.xVel + enemyName.xMax) / 8);
}
}
}
function bossControl() {
boss.animHoldIdle--;
boss.animHoldWalk--;
boss.animHoldAir--;
boss.stopCount--;
boss.lastStomp++;
switch (boss.state) {
case "ground" :
checkProjectiles();
checkTorches();
if (boss.stopCount <= 0) {
if (boss.stopCount > -3) {
boss.mc.gotoAndStop("fly");
if (boss.mc._xscale < 0) {
boss.xDest = mcAll.mcMain.mcBoundR._x;
boss.yDest = mcAll.mcMain.mcBoundT._y;
} else {
boss.xDest = mcAll.mcMain.mcBoundL._x;
boss.yDest = mcAll.mcMain.mcBoundT._y;
}
} else {
updateY();
if ((boss.mc._y - boss.yDest) < 0) {
boss.stopCount = -4;
if (boss.xDest < boss.mc._x) {
boss.mc._xscale = -100;
} else {
boss.mc._xscale = 100;
}
boss.mc.gotoAndStop("turn");
boss.state = "flying";
}
}
}
checkDead();
return;
case "flying" :
checkProjectiles();
checkTorches();
if (boss.mc._xscale < 0) {
if ((boss.mc._x - boss.xDest) > 0) {
boss.xVel = boss.xVel + (-boss.xAcc);
} else {
boss.mc._xscale = 100;
boss.mc.gotoAndStop("turn");
boss.animHoldAir = 18;
boss.xVel = 0;
boss.stopCount = 60;
boss.state = "fire";
if (p1.state == "grabbingBoss") {
p1.state = "normal";
p1.mc.gotoAndStop("fall");
}
}
} else if ((boss.mc._x - boss.xDest) < 0) {
boss.xVel = boss.xVel + boss.xAcc;
} else {
boss.mc._xscale = -100;
boss.mc.gotoAndStop("turn");
boss.animHoldAir = 18;
boss.xVel = boss.xVel + 0;
boss.stopCount = 60;
boss.state = "fire";
if (p1.state == "grabbingBoss") {
p1.state = "normal";
p1.mc.gotoAndStop("fall");
}
}
if (boss.xVel > boss.xMax) {
boss.xVel = boss.xMax;
} else if (boss.xVel < (-boss.xMax)) {
boss.xVel = -boss.xMax;
}
boss.mc._x = boss.mc._x + boss.xVel;
if (mcAll.mcMain.mcDuck.hitTest(boss.mc._x, boss.mc._y, true) && (((boss.mc._xscale < 0) && ((mcAll.mcMain.mcHeadHit._x - 10) < boss.mc._x)) || ((boss.mc._xscale > 0) && ((mcAll.mcMain.mcHeadHit._x + 10) > boss.mc._x)))) {
boss.yDest = mcAll.mcMain.mcBoundFloor._y;
} else {
boss.yDest = mcAll.mcMain.mcBoundT._y;
}
updateY();
temp = 300;
if (boss.hp < 20) {
temp = 100;
}
if ((Math.abs(boss.mc._x - p1.mc._x) < 50) && (boss.lastStomp > 300)) {
if (p1.mc._y > boss.mc._y) {
boss.yDest = mcAll.mcMain.mcBoundFloor._y;
boss.yVel = -12;
boss.state = "stomp";
boss.mc.gotoAndStop("charge");
boss.bp = 10;
boss.xForce = 16;
boss.yForce = -15;
}
}
if (boss.mc.mcMC.mcBackHit.hitTest(p1.mc._x, p1.mc._y, true)) {
p1.mc._xscale = boss.mc._xscale;
if (boss.mc._xscale < 0) {
p1.mc._x = boss.mc._x - boss.mc.mcRide._x;
} else {
p1.mc._x = boss.mc._x + boss.mc.mcRide._x;
}
p1.mc._y = boss.mc._y + boss.mc.mcRide._y;
p1.state = "grabbingBoss";
p1.mc.gotoAndStop("grabBoss");
boss.yDest = mcAll.mcMain.mcBoundT._y;
}
checkDead();
return;
case "fire" :
checkProjectiles();
checkTorches();
if (boss.stopCount == 30) {
boss.mc.gotoAndStop("fire");
fireAttack(4);
} else if (boss.stopCount == 29) {
} else if (boss.stopCount == 28) {
fireAttack(3);
}
if (boss.stopCount <= 0) {
if (boss.mc._xscale < 0) {
boss.xDest = mcAll.mcMain.mcBoundL._x;
boss.yDest = mcAll.mcMain.mcBoundT._y;
} else {
boss.xDest = mcAll.mcMain.mcBoundR._x;
boss.yDest = mcAll.mcMain.mcBoundT._y;
}
boss.state = "flying";
boss.mc.gotoAndStop("flyLoop");
}
updateY();
checkDead();
return;
case "stomp" :
checkProjectiles();
checkTorches();
if (boss.mc._y < boss.yDest) {
boss.yVel = boss.yVel + 1.8;
} else {
boss.lastStomp = 0;
boss.yVel = 0;
boss.mc.gotoAndStop("stomp");
boss.stopCount = 30;
boss.state = "ground";
shakeCam = shakeCam + 15;
}
boss.mc._y = boss.mc._y + boss.yVel;
if ((p1.plane == "ground") && (p1.state != "thrown")) {
if (boss.mc.mcMC.mcAttack.hitTest(p1.mc.mcHit)) {
bossHitWink();
}
}
checkDead();
return;
case "grabbed" :
if (boss.mc._xscale < 0) {
if ((boss.mc._x - boss.xDest) > 0) {
boss.xVel = boss.xVel + (-boss.xAcc);
} else {
boss.mc._xscale = 100;
boss.mc.gotoAndStop("turn");
boss.animHoldAir = 18;
boss.xVel = 0;
boss.stopCount = 60;
boss.state = "fire";
if (p1.state == "grabbingBoss") {
p1.state = "normal";
p1.mc.gotoAndStop("fall");
}
}
} else if ((boss.mc._x - boss.xDest) < 0) {
boss.xVel = boss.xVel + boss.xAcc;
} else {
boss.mc._xscale = -100;
boss.mc.gotoAndStop("turn");
boss.animHoldAir = 18;
boss.xVel = boss.xVel + 0;
boss.stopCount = 60;
boss.state = "fire";
if (p1.state == "grabbingBoss") {
p1.state = "normal";
p1.mc.gotoAndStop("fall");
}
}
if (boss.xVel > boss.xMax) {
boss.xVel = boss.xMax;
} else if (boss.xVel < (-boss.xMax)) {
boss.xVel = -boss.xMax;
}
boss.mc._x = boss.mc._x + boss.xVel;
boss.yVel = boss.yVel + (-boss.yAcc);
if (boss.yVel > boss.yMax) {
boss.yVel = boss.yMax;
} else if (boss.yVel < (-boss.yMax)) {
boss.yVel = -boss.yMax;
}
boss.mc._y = boss.mc._y + boss.yVel;
if (boss.mc._xscale < 0) {
p1.mc._x = boss.mc._x - boss.mc.mcRide._x;
} else {
p1.mc._x = boss.mc._x + boss.mc.mcRide._x;
}
p1.mc._y = boss.mc._y + boss.mc.mcRide._y;
if (boss.mc._xscale < 0) {
temp = (boss.mc._x - boss.mc.mcMC._x) - boss.mc.mcMC.mcHead._x;
} else {
temp = (boss.mc._x + boss.mc.mcMC._x) + boss.mc.mcMC.mcHead._x;
}
temp2 = (boss.mc._y + boss.mc.mcMC._y) + boss.mc.mcMC.mcHead._y;
if (mcAll.mcMain.mcHeadHit.hitTest(temp, temp2, true)) {
boss.mc.gotoAndStop("hit");
boss.state = "hit";
boss.yVel = 6;
boss.hp = boss.hp + -18;
shakeCam = 20;
p1.state = "normal";
p1.mc.gotoAndStop("fall");
}
if (boss.stopCount <= 0) {
p1.state = "thrown";
p1.mc.gotoAndStop("thrown");
if (boss.mc._xscale < 0) {
p1.xVel = 10;
} else {
p1.xVel = -10;
}
boss.state = "flying";
boss.mc.gotoAndStop("grabbedToFlying");
}
return;
case "hit" :
if (boss.mc._y < mcAll.mcMain.mcBoundFloor._y) {
boss.yVel = boss.yVel + 2.8;
} else {
boss.mc._y = mcAll.mcMain.mcBoundFloor._y;
boss.yVel = 0;
boss.stopCount = 120;
shakeCam = shakeCam + 10;
boss.state = "down";
}
boss.mc._y = boss.mc._y + boss.yVel;
checkDead();
return;
case "down" :
checkProjectiles();
checkTorches();
if (boss.stopCount <= 0) {
boss.state = "ground";
boss.mc.gotoAndStop("getup");
boss.stopCount = 30;
}
checkDead();
}
}
function updateY() {
if ((boss.mc._y - boss.yDest) > 0) {
boss.yVel = boss.yVel + (-boss.yAcc);
} else {
boss.yVel = boss.yVel + boss.yAcc;
}
if (boss.yVel > boss.yMax) {
boss.yVel = boss.yMax;
} else if (boss.yVel < (-boss.yMax)) {
boss.yVel = -boss.yMax;
}
boss.mc._y = boss.mc._y + boss.yVel;
}
function fireAttack(direction) {
var _local2 = projectiles;
temp = 1;
while (temp <= projectiles) {
temp2 = this["proj_" + temp];
if ((!temp2.mc._visible) || (temp2.mc == undefined)) {
_local2 = temp;
break;
}
temp++;
}
if (boss.mc._xscale < 0) {
x = (boss.mc._x - boss.mc.mcMC._x) - boss.mc.mcMC.mcAttack._x;
} else {
x = (boss.mc._x + boss.mc.mcMC._x) + boss.mc.mcMC.mcAttack._x;
}
y = (boss.mc._y + boss.mc.mcMC._y) + boss.mc.mcMC.mcAttack._y;
mcAll.mcMain.attachMovie("fireball", "proj_mc_" + _local2, projectileDepth + _local2, {_x:x, _y:y});
this["proj_" + _local2] = new projectile(mcAll.mcMain["proj_mc_" + _local2], "fireball", 3);
temp = this["proj_" + _local2];
temp.bp = 7;
switch (direction) {
case 1 :
temp.xVel = 0;
temp.yVel = -temp.yMax;
temp.mc._rotation = -90;
temp.mc._x = boss.mc._x;
break;
case 2 :
temp.xVel = (temp.xMax * 2) / 3;
temp.yVel = ((-temp.yMax) * 2) / 3;
temp.mc._rotation = -45;
break;
case 3 :
temp.xVel = temp.xMax;
temp.yVel = 0;
temp.mc._rotation = 0;
break;
case 4 :
temp.xVel = (temp.xMax * 2) / 3;
temp.yVel = (temp.yMax * 2) / 3;
temp.mc._rotation = 45;
}
if (boss.mc._xscale < 0) {
temp.xVel = -temp.xVel;
temp.mc._xscale = -100;
temp.mc._rotation = -temp.mc._rotation;
}
makeFX("fire", x, y);
makeFX("fire", x, y);
makeFX("fire", x, y);
soundFX.attachSound("s_fireball");
soundFX.start(0, 0);
}
function checkProjectiles() {
temp = 1;
while (temp <= projectiles) {
temp2 = "proj_" + temp;
temp2 = this[temp2];
if (((temp2.mc._x != undefined) && (temp2.state == "thrown")) && ((temp2.hitTarget == 2) || (temp2.hitTarget == 3))) {
if (Math.abs(temp2.mc._x - boss.mc._x) < 200) {
if (boss.mc.mcHit.hitTest(temp2.mc._x, temp2.mc._y, true)) {
boss_projectileHit();
}
}
}
temp++;
}
}
function boss_projectileHit() {
boss.hp = boss.hp + ((-temp2.bp) / 8);
if (temp2.projType == "fireball") {
temp2.state = "hit";
temp2.mc.gotoAndStop("hit");
temp2.phaseCount = -123;
makeFX("fire", (temp2.mc._x - 16) + (Math.random() * 32), (temp2.mc._y - 8) + (Math.random() * 16));
makeFX("fire", (temp2.mc._x - 16) + (Math.random() * 32), (temp2.mc._y - 8) + (Math.random() * 16));
soundFX.attachSound("s_hoodleyhit");
soundFX.start(0, 0);
soundFX.setPan(Math.ceil(((boss.mc._x - mcCam._x) / 400) * 100));
} else if (temp2.projType == "wind") {
temp2.state = "hit";
temp2.mc.gotoAndStop("hit");
temp2.phaseCount = -123;
soundFX.attachSound("s_hoodleyhit");
soundFX.start(0, 0);
soundFX.setPan(Math.ceil(((boss.mc._x - mcCam._x) / 400) * 100));
} else if (temp2.projType == "lightning") {
temp2.state = "hit";
temp2.mc.gotoAndStop("hit");
temp2.phaseCount = -123;
soundFX.attachSound("s_lightninghit");
soundFX.start(0, 0);
soundFX.setPan(Math.ceil(((boss.mc._x - mcCam._x) / 400) * 100));
}
makeGemShard(temp2.mc._x, temp2.mc._y, random(10) - 5, (-random(6)) - 8);
}
function bossHitWink() {
if (((p1.holdName != null) && (p1.state == "grabbing")) || ((p1.holdName.state == "choking") && (p1.state == "normal"))) {
if (p1.holdName.state == "choking") {
p1.holdName.mc.swapDepths(p1.holdName.depth0);
}
p1.holdName.state = "normal";
p1.holdName.phase = 2;
p1.holdName.mc.gotoAndStop("idle2");
p1.holdName.grabbedName = null;
p1.holdName = null;
} else if (p1.holdName != null) {
p1.holdName.state = "thrown";
if (boss.mc._x < p1.mc._x) {
p1.holdName.xVel = p1.holdName.xVel + ((Math.random() * 6) + 8);
} else {
p1.holdName.xVel = p1.holdName.xVel + ((Math.random() * -6) - 8);
}
p1.holdName.yVel = p1.holdName.yVel + ((Math.random() * -12) - 5);
p1.holdName.mc._rotation = 0;
p1.holdName = null;
p1.windup = 0;
}
p1.state = "thrown";
p1.mc.gotoAndStop("thrown");
p1.whacking = 0;
p1.hp = p1.hp + (-boss.bp);
p1.updateHealth = true;
p1.xVel = boss.xForce;
p1.yVel = boss.yForce;
p1.grabCount = 0;
p1.attackHold = 0;
if (boss.mc._x < p1.mc._x) {
p1.mc._xscale = -100;
} else {
p1.mc._xscale = 100;
}
soundWink.attachSound("s_winkhit1");
soundWink.start(0, 0);
soundWink.setPan(Math.ceil(((boss.mc._x - mcCam._x) / 400) * 100));
soundWinkDone = true;
}
function checkTorches() {
if ((thrownName != null) && (thrownName != boss)) {
if (thrownName.actor == "torch") {
if ((thrownName.state == "thrown") && ((Math.abs(thrownName.xVel) > 6) || (Math.abs(thrownName.yVel) > 6))) {
if (boss.mc.mcHit.hitTest(thrownName.mc._x, thrownName.mc._y, true)) {
thrownName.state = "hit";
thrownName.mc.gotoAndStop("hit");
thrownName.xVel = 0;
thrownName.yVel = 0;
thrownName = null;
boss.hp = boss.hp + -5;
soundFX.attachSound("s_torchhit");
soundFX.start(0, 0);
soundFX.setPan(Math.ceil(((boss.mc._x - mcCam._x) / 400) * 100));
}
}
}
}
}
function checkDead() {
if (boss.hp <= 0) {
paused = true;
boss.state = "dead";
stopAllSounds();
mcCam.mcEnding.play();
mcCam.mcEnding._visible = true;
}
}
function launchURL() {
getURL ("http://www.girlshavecooties.com", "_blank");
}
function resetKeys() {
keys.keyUp1 = 38;
keys.keyDown1 = 40;
keys.keyLeft = 37;
keys.keyRight = 39;
keys.keyJump = 83;
keys.keyAttack = 68;
keys.keyGrab = 65;
keys.keyHide = 32;
keys.keyFast = 16;
keys.keyPause = 13;
keys.keySave = 53;
keys.keyLoad = 57;
if (p1.mc._x != undefined) {
p1.keyUp1 = keys.keyUp1;
p1.keyDown1 = keys.keyDown1;
p1.keyLeft = keys.keyLeft;
p1.keyRight = keys.keyRight;
p1.keyJump = keys.keyJump;
p1.keyAttack = keys.keyAttack;
p1.keyGrab = keys.keyGrab;
p1.keyHide = keys.keyHide;
p1.keyFast = keys.keyFast;
}
}
function saveKeys() {
keyfile = SharedObject.getLocal("winkDataKeys");
keyfile.data.keyUp1 = keys.keyUp1;
keyfile.data.keyDown1 = keys.keyDown1;
keyfile.data.keyLeft = keys.keyLeft;
keyfile.data.keyRight = keys.keyRight;
keyfile.data.keyJump = keys.keyJump;
keyfile.data.keyAttack = keys.keyAttack;
keyfile.data.keyGrab = keys.keyGrab;
keyfile.data.keyHide = keys.keyHide;
keyfile.data.keyFast = keys.keyFast;
keyfile.data.keyPause = keys.keyPause;
keyfile.data.keySave = keys.keySave;
keyfile.data.keyLoad = keys.keyLoad;
}
function showMenuMain() {
paused = true;
mcCam.mcMenu._visible = true;
mcCam.mcMenu.mcItems._x = mcCam.mcMenu.mcItems.baseX;
mcCam.mcMenu.mcItemsFake._x = 270;
mcCam.mcMenu.mcLoad._visible = false;
mcCam.mcMenu.mcSave._visible = false;
mcCam.mcMenu.mcOptions._visible = false;
mcCam.mcMenu.mcControls._visible = false;
mcCam.mcMenu.mcHowto._visible = false;
mcCam.mcMenu.mcCredits._visible = false;
}
function hideMenuMain() {
mcCam.mcMenu.mcControls.currKey = "";
mcCam.mcMenu.mcControls._visible = false;
mcCam.mcMenu._visible = false;
paused = false;
}
function getHyp(x1, y1, rot, scale) {
var _local1 = {x:x1, y:y1};
var _local2 = (scale / 100) * Math.sqrt((x1 * x1) + (y1 * y1));
if (scale > 0) {
_local1.x = Math.cos((rot - 80) / 57.3) * _local2;
_local1.y = Math.sin((rot - 80) / 57.3) * _local2;
} else {
_local1.x = Math.cos((rot - 100) / 57.3) * _local2;
_local1.y = Math.sin((rot - 100) / 57.3) * _local2;
}
return(_local1);
}
function makeFire(baseName, rot) {
if (!_root.paused) {
x1 = baseName.mc._x;
y1 = baseName.mc._y;
var _local3 = 2;
if (_root.bossCount <= 0) {
if (settingParticles == 3) {
_local3 = 1;
} else if (settingParticles == 2) {
_local3 = 2;
} else if (settingParticles == 1) {
_local3 = 3;
} else {
_local3 = 5;
}
} else if (settingParticles == 3) {
_local3 = 2;
} else if (settingParticles == 2) {
_local3 = 4;
} else if (settingParticles == 1) {
_local3 = 6;
} else {
_local3 = 10;
}
if ((Math.abs(x1 - _root.mcCam._x) < xCutoff) && (Math.abs(y1 - _root.mcCam._y) < yCutoff)) {
if ((_root.count % _local3) == 0) {
fireNum++;
if (fireNum > fireMax) {
fireNum = 1;
}
var _local2 = getHyp(baseName.mc.mcMC.mcFire._x, baseName.mc.mcMC.mcFire._y, rot, baseName.mc._xscale);
if (baseName.mc._xscale > 0) {
_local2.x = x1 + _local2.x;
_local2.y = y1 + _local2.y;
} else {
_local2.x = x1 - _local2.x;
_local2.y = y1 - _local2.y;
}
rand = Math.random();
temp = (rand * 20) + 60;
var _local5 = baseName.depth;
_root.mcAll.mcMain.firePart.duplicateMovieClip("firePart" + fireNum, ((_local5 - 1000) + 100) + fireNum, {_x:_local2.x, _y:_local2.y, _xscale:temp, _yscale:temp});
temp = temp + 3;
_root.mcAll.mcMain.firePartBack.duplicateMovieClip("firePartBack" + fireNum, (_local5 - 1000) + fireNum, {_x:_local2.x, _y:_local2.y, _xscale:temp, _yscale:temp});
temp = (Math.random() * 15) + 50;
_root.mcAll.mcMain.firePartWhite.duplicateMovieClip("firePartWhite" + fireNum, ((_local5 - 1000) + 200) + fireNum, {_x:_local2.x, _y:_local2.y, _xscale:temp, _yscale:temp});
}
}
}
}
function makeFX(fxType, x, y) {
if (!_root.paused) {
rand = Math.random();
var _local2 = torchDepth;
if (!(fxType === "fire")) {
} else {
fireNum++;
if (fireNum > fireMax) {
fireNum = 1;
}
temp = (rand * 20) + 60;
_root.mcAll.mcMain.firePart.duplicateMovieClip("firePart" + fireNum, ((_local2 - 1000) + 100) + fireNum, {_x:x, _y:y, _xscale:temp, _yscale:temp});
temp = temp + 3;
_root.mcAll.mcMain.firePartBack.duplicateMovieClip("firePartBack" + fireNum, (_local2 - 1000) + fireNum, {_x:x, _y:y, _xscale:temp, _yscale:temp});
temp = (Math.random() * 15) + 50;
_root.mcAll.mcMain.firePartWhite.duplicateMovieClip("firePartWhite" + fireNum, ((_local2 - 1000) + 200) + fireNum, {_x:x, _y:y, _xscale:temp, _yscale:temp});
}
}
}
function makeDust(x, y, moveRight, spread) {
x = (x - (spread / 2)) + random(spread);
y = y + random(4);
if (moveRight) {
dustNum++;
if (dustNum > dustMax) {
dustNum = 1;
}
mcAll.mcMain.attachMovie("dust1", "dust_" + dustNum, dustDepth + dustNum, {_x:x, _y:y});
temp = (Math.random() * 100) + 100;
mcAll.mcMain["dust_" + dustNum]._xscale = -temp;
mcAll.mcMain["dust_" + dustNum]._yscale = temp;
dustNum++;
if (dustNum > dustMax) {
dustNum = 1;
}
mcAll.mcMain.attachMovie("dust1b", "dust_" + dustNum, (dustDepth + dustNum) - 100, {_x:x, _y:y});
temp = temp + 50;
mcAll.mcMain["dust_" + dustNum]._xscale = -temp;
mcAll.mcMain["dust_" + dustNum]._yscale = temp;
} else {
dustNum++;
if (dustNum > dustMax) {
dustNum = 1;
}
mcAll.mcMain.attachMovie("dust1", "dust_" + dustNum, dustDepth + dustNum, {_x:x, _y:y});
temp = (Math.random() * 100) + 100;
mcAll.mcMain["dust_" + dustNum]._xscale = temp;
mcAll.mcMain["dust_" + dustNum]._yscale = temp;
dustNum++;
if (dustNum > dustMax) {
dustNum = 1;
}
mcAll.mcMain.attachMovie("dust1b", "dust_" + dustNum, (dustDepth + dustNum) - 100, {_x:x, _y:y});
temp = temp + 50;
mcAll.mcMain["dust_" + dustNum]._xscale = temp;
mcAll.mcMain["dust_" + dustNum]._yscale = temp;
}
}
function makeGemShard(x, y, xVel, yVel) {
gemNum++;
if (gemNum > gemMax) {
gemNum = 1;
}
mcAll.mcMain.attachMovie("gemshard", "gem_" + gemNum, gemDepth + gemNum, {_x:x, _y:y});
mcAll.mcMain["gem_" + gemNum].xVel = xVel;
mcAll.mcMain["gem_" + gemNum].yVel = yVel;
}
function staffAttack(staffName1, direction, hitTarget, xSpeed) {
staffName1.mc.mcMC.mcFX.gotoAndStop(staffName1.element);
shakeCam = shakeCam + 3;
var _local2 = projectiles;
temp = 1;
while (temp <= projectiles) {
temp2 = this["proj_" + temp];
if ((!temp2.mc._visible) || (temp2.mc == undefined)) {
_local2 = temp;
break;
}
temp++;
}
if (staffName1.mc._xscale > 0) {
x = staffName1.mc._x + 35;
} else {
x = staffName1.mc._x - 35;
}
y = staffName1.mc._y - 10;
switch (staffName1.element) {
case "fire" :
mcAll.mcMain.attachMovie("fireball", "proj_mc_" + _local2, projectileDepth + _local2, {_x:x, _y:y});
this["proj_" + _local2] = new projectile(mcAll.mcMain["proj_mc_" + _local2], "fireball", hitTarget);
temp = this["proj_" + _local2];
temp.bp = 7;
switch (direction) {
case 1 :
temp.xVel = 0;
temp.yVel = -temp.yMax;
temp.mc._rotation = -90;
temp.mc._x = staffName1.mc._x;
break;
case 2 :
temp.xVel = (temp.xMax * 2) / 3;
temp.yVel = ((-temp.yMax) * 2) / 3;
temp.mc._rotation = -45;
break;
case 3 :
if (xSpeed == -123) {
temp.xVel = temp.xMax;
} else {
temp.xVel = xSpeed;
}
temp.yVel = 0;
temp.mc._rotation = 0;
break;
case 4 :
temp.xVel = (temp.xMax * 2) / 3;
temp.yVel = (temp.yMax * 2) / 3;
temp.mc._rotation = 45;
break;
case 5 :
temp.xVel = 0;
temp.yVel = temp.yMax;
temp.mc._rotation = 90;
temp.mc._x = staffName1.mc._x;
}
if (staffName1.mc._xscale < 0) {
temp.xVel = -temp.xVel;
temp.mc._xscale = -100;
temp.mc._rotation = -temp.mc._rotation;
}
makeFX("fire", x, y);
makeFX("fire", x, y);
makeFX("fire", x, y);
soundFX.attachSound("s_fireball");
soundFX.start(0, 0);
break;
case "wind" :
mcAll.mcMain.attachMovie("wind", "proj_mc_" + _local2, projectileDepth + _local2, {_x:x, _y:y});
this["proj_" + _local2] = new projectile(mcAll.mcMain["proj_mc_" + _local2], "wind", hitTarget);
temp = this["proj_" + _local2];
temp.mc.gotoAndPlay(Math.ceil(Math.random() * 3));
temp.bp = 5;
i = 1;
while (i <= projectiles) {
j = this["proj_" + i];
if ((!j.mc._visible) || (j.mc == undefined)) {
_local2 = i;
break;
}
i++;
}
mcAll.mcMain.attachMovie("wind", "proj_mc_" + _local2, projectileDepth + _local2, {_x:x, _y:y});
this["proj_" + _local2] = new projectile(mcAll.mcMain["proj_mc_" + _local2], "wind", hitTarget);
temp2 = this["proj_" + _local2];
temp2.mc.gotoAndPlay(Math.ceil(Math.random() * 3));
temp2.bp = 5;
switch (direction) {
case 1 :
temp.xVel = -3;
temp.yVel = -16;
temp.mc._rotation = -100;
temp2.xVel = 3;
temp2.yVel = -16;
temp2.mc._rotation = -80;
if (staffName1.mc._xscale < 0) {
temp.mc._x = temp.mc._x + 20;
temp2.mc._x = temp2.mc._x + 20;
} else {
temp.mc._x = temp.mc._x + -20;
temp2.mc._x = temp2.mc._x + -20;
}
break;
case 2 :
temp.xVel = 7;
temp.yVel = -10;
temp.mc._rotation = -55;
temp2.xVel = 10;
temp2.yVel = -7;
temp2.mc._rotation = -35;
break;
case 3 :
if (xSpeed == -123) {
temp.xVel = 16;
temp2.xVel = 16;
temp.yVel = -3;
temp2.yVel = 3;
} else {
temp.xVel = 12;
temp2.xVel = 12;
temp.yVel = -2;
temp2.yVel = 2;
}
temp.mc._rotation = -10;
temp2.mc._rotation = 10;
break;
case 4 :
temp.xVel = 7;
temp.yVel = 10;
temp.mc._rotation = 55;
temp2.xVel = 10;
temp2.yVel = 7;
temp2.mc._rotation = 35;
break;
case 5 :
temp.xVel = -3;
temp.yVel = 16;
temp.mc._rotation = 100;
temp2.xVel = 3;
temp2.yVel = 16;
temp2.mc._rotation = 80;
if (staffName1.mc._xscale < 0) {
temp.mc._x = temp.mc._x + 20;
temp2.mc._x = temp2.mc._x + 20;
} else {
temp.mc._x = temp.mc._x + -20;
temp2.mc._x = temp2.mc._x + -20;
}
}
if (((staffName1.mc._xscale < 0) && (direction != 1)) && (direction != 5)) {
temp.xVel = -temp.xVel;
temp.mc._xscale = -100;
temp.mc._rotation = -temp.mc._rotation;
temp2.xVel = -temp2.xVel;
temp2.mc._xscale = -100;
temp2.mc._rotation = -temp2.mc._rotation;
}
soundFX.attachSound("s_wind");
soundFX.start(0, 0);
break;
case "lightning" :
mcAll.mcMain.attachMovie("lightning", "proj_mc_" + _local2, projectileDepth + _local2, {_x:x, _y:y});
this["proj_" + _local2] = new projectile(mcAll.mcMain["proj_mc_" + _local2], "lightning", hitTarget);
temp = this["proj_" + _local2];
temp.life = 7;
temp.bp = 10;
i = 1;
while (i <= projectiles) {
j = this["proj_" + i];
if ((!j.mc._visible) || (j.mc == undefined)) {
_local2 = i;
break;
}
i++;
}
mcAll.mcMain.attachMovie("lightning", "proj_mc_" + _local2, projectileDepth + _local2, {_x:x, _y:y});
this["proj_" + _local2] = new projectile(mcAll.mcMain["proj_mc_" + _local2], "lightning", hitTarget);
temp2 = this["proj_" + _local2];
temp2.life = 7;
temp2.bp = 10;
if (Math.random() > 0.5) {
mcAll.mcMain.attachMovie("lightning_bolt1", "bolt_mc_" + (_local2 + 20), (projectileDepth + _local2) + 20, {_x:x, _y:y});
} else {
mcAll.mcMain.attachMovie("lightning_bolt2", "bolt_mc_" + (_local2 + 20), (projectileDepth + _local2) + 20, {_x:x, _y:y});
}
var _local4 = mcAll.mcMain["bolt_mc_" + (_local2 + 20)];
if (Math.random() > 0.5) {
_local4._yscale = -_local4._yscale;
}
switch (direction) {
case 1 :
temp.xVel = 0;
temp2.xVel = 0;
temp.yVel = -20;
temp2.yVel = -20;
temp2.mc._y = temp2.mc._y + -130;
_local4._rotation = -90;
if (staffName1.mc._xscale < 0) {
temp2.mc._x = temp2.mc._x + 20;
_local4._x = _local4._x + 20;
} else {
temp2.mc._x = temp2.mc._x + -20;
_local4._x = _local4._x + -20;
}
_local4._y = _local4._y + -10;
break;
case 2 :
temp.xVel = 10;
temp2.xVel = 10;
temp.yVel = -10;
temp2.yVel = -10;
if (staffName1.mc._xscale < 0) {
temp2.mc._x = temp2.mc._x + -65;
} else {
temp2.mc._x = temp2.mc._x + 65;
}
temp2.mc._y = temp2.mc._y + -65;
_local4._rotation = -45;
break;
case 3 :
if (xSpeed == -123) {
temp.xVel = 20;
temp2.xVel = 20;
temp.yVel = 0;
temp2.yVel = 0;
if (staffName1.mc._xscale < 0) {
temp2.mc._x = temp2.mc._x + -130;
} else {
temp2.mc._x = temp2.mc._x + 130;
}
} else {
temp.xVel = 15;
temp2.xVel = 15;
temp.yVel = 0;
temp2.yVel = 0;
if (staffName1.mc._xscale < 0) {
temp2.mc._x = temp2.mc._x + -110;
} else {
temp2.mc._x = temp2.mc._x + 110;
}
}
break;
case 4 :
temp.xVel = 10;
temp2.xVel = 10;
temp.yVel = 10;
temp2.yVel = 10;
if (staffName1.mc._xscale < 0) {
temp2.mc._x = temp2.mc._x + -65;
} else {
temp2.mc._x = temp2.mc._x + 65;
}
temp2.mc._y = temp2.mc._y + 65;
_local4._rotation = 45;
break;
case 5 :
temp.xVel = 0;
temp2.xVel = 0;
temp.yVel = 20;
temp2.yVel = 20;
temp2.mc._y = temp2.mc._y + 130;
_local4._rotation = 90;
if (staffName1.mc._xscale < 0) {
temp2.mc._x = temp2.mc._x + 20;
_local4._x = _local4._x + 20;
} else {
temp2.mc._x = temp2.mc._x + -20;
_local4._x = _local4._x + -20;
}
_local4._y = _local4._y + 10;
}
if (((staffName1.mc._xscale < 0) && (direction != 1)) && (direction != 5)) {
temp.xVel = -temp.xVel;
temp.mc._xscale = -100;
temp2.xVel = -temp2.xVel;
temp2.mc._xscale = -100;
_local4._xscale = -_local4._xscale;
_local4._rotation = -_local4._rotation;
}
soundFX.attachSound("s_lightning");
soundFX.start(0, 0);
}
}
function loadBoss() {
paused = true;
mcAll.mcMain.attachMovie("boss", "boss_mc_" + bossDepth, bossDepth, {_x:mcAll.mcMain.mcTrigger._x + 300, _y:mcAll.mcMain.mcTrigger._y + 150});
boss = new boss1(mcAll.mcMain["boss_mc_" + bossDepth]);
trace(mcAll.mcMain["boss_mc_" + bossDepth]._name);
boss.mc._xscale = -100;
mapHit.mcBossBlock._x = mapHit.mcBossBlock._x + 1000;
mcCam.mcBoss._visible = true;
mcCam.mcBoss.gotoAndPlay(2);
soundMusic.stop();
soundMusic.attachSound("boss_intro");
soundMusic.start(0, 0);
}
function saveGame() {
savefile = SharedObject.getLocal("winkData");
savefile.data.winkX = p1.mc._x;
savefile.data.winkY = p1.mc._y;
savefile.data.winkHP = p1.hp;
savefile.data.winkSP = p1.sp;
savefile.data.mapName = mapName;
savefile.data.doorway = p1.doorway;
if (p1.holdName.actor == "staff") {
savefile.data.winkHoldName = p1.holdName.selfName;
savefile.data.winkHoldInfo = p1.holdName.element;
} else {
savefile.data.winkHoldName = null;
}
temp = savefile.flush();
msgCount = 1;
if (temp == true) {
mcCam.textMsg.text = "Game SAVED successfully";
mcCam.mcMenu.mcSave.textMsg.text = "Game SAVED successfully";
return(true);
}
if (temp == false) {
mcCam.textMsg.text = "Game save failed, allocate more disk space to Flash";
mcCam.mcMenu.mcSave.textMsg.text = "Game save failed, allocate more disk space to Flash";
return(false);
}
}
function loadSavedGame() {
savefile = SharedObject.getLocal("winkData");
if (savefile.data.winkX != undefined) {
p1.mc._x = savefile.data.winkX;
p1.mc._y = savefile.data.winkY;
mcCam._x = p1.mc._x;
mcCam._y = p1.mc._y;
p1.hp = savefile.data.winkHP;
mcCam.mcHealth.mcBar2.lastHealth = p1.hp;
mcCam.mcHealth.mcBar2._xscale = p1.hp;
p1.sp = savefile.data.winkSP;
mcCam.mcStealth.mcBar2.lastStealth = p1.sp;
mcCam.mcStealth.mcBar2._xscale = p1.sp;
p1.state = "normal";
p1.plane = "ground";
p1.xVel = 0;
p1.yVel = 0;
if (savefile.data.winkHoldName == null) {
temp = null;
} else {
temp = this[savefile.data.winkHoldName];
p1.heldInfo = savefile.data.winkHoldInfo;
p1.held = "staff";
}
if ((temp != null) && (temp.grabbedName.actor == "hoodley")) {
temp.grabbedName.grabCount = 0;
temp.grabbedName.holdName = null;
p1.holdName.grabbedName = null;
p1.holdName.state = "thrown";
p1.holdName = temp;
p1.holdName.grabbedName = p1;
p1.holdName.state = "grabbed";
p1.holdName.mc.swapDepths(grabbedDepth);
p1.holdName.mc._visible = true;
} else if (temp == null) {
if (p1.holdName != null) {
p1.holdName.grabbedName = null;
p1.holdName.state = "thrown";
p1.holdName = null;
}
} else {
p1.holdName = temp;
p1.holdName.grabbedName = p1;
p1.holdName.state = "grabbed";
p1.holdName.mc.swapDepths(grabbedDepth);
}
mapLoad = 2;
p1.doorway = savefile.data.doorway;
mapName = savefile.data.mapName;
msgCount = 1;
mcCam.textMsg.text = "Saved game LOADED";
stopAllSounds();
soundArray[0] = "ambient_A";
soundMusic.attachSound("ambient_A");
soundMusic.start(0, 0);
bossCount = 0;
mcCam.mcBossHealth._visible = false;
mcCam._xscale = 100;
mcCam._yscale = 100;
xCutoff = 500;
yCutoff = 270;
if (boss.mc != undefined) {
boss.mc.removeMovieClip();
boss = null;
}
return(true);
}
msgCount = 1;
mcCam.textMsg.text = "No saved game to load";
mcCam.mcMenu.mcLoad.textMsg.text = "No saved game to load";
return(false);
}
function updateMusic() {
if (bossCount < 1) {
var _local1 = false;
if (soundHuntCount > 0) {
if ((soundArray[0] != "hunt_A") && (soundArray[0] != "hunt_B")) {
_local1 = true;
}
if ((Math.random() > 0.6) || (soundHuntA)) {
soundArray[1] = "hunt_A";
} else {
soundArray[1] = "hunt_B";
}
} else if (p1.plane == "shadow") {
if ((((((soundArray[0] == "ambient_A") || (soundArray[0] == "ambient_B")) || (soundArray[0] == "sneak_INTO_ambient")) || (soundArray[0] == "ambient_AA")) || (soundArray[0] == "ambient_BB")) || (soundArray[0] == "ambient_AAA")) {
soundArray[1] = "ambient_INTO_sneak";
} else if ((soundArray[0] == "hunt_A") || (soundArray[0] == "hunt_B")) {
soundArray[1] = "hunt_INTO_sneak";
} else if ((Math.random() > 0.6) || (soundSneakA)) {
soundArray[1] = "sneak_A";
} else {
soundArray[1] = "sneak_B";
}
} else if ((soundArray[0] == "hunt_A") || (soundArray[0] == "hunt_B")) {
soundArray[1] = "hunt_INTO_ambient";
} else if (((soundArray[0] == "sneak_A") || (soundArray[0] == "sneak_B")) || (soundArray[0] == "ambient_INTO_sneak")) {
soundArray[1] = "sneak_INTO_ambient";
} else {
temp = Math.random();
if ((temp > 0.8) || (soundAmbientA)) {
soundArray[1] = "ambient_A";
} else if (temp > 0.5) {
soundArray[1] = "ambient_B";
} else if (temp > 0.3) {
soundArray[1] = "ambient_AA";
} else if (temp > 0.15) {
soundArray[1] = "ambient_BB";
} else {
soundArray[1] = "ambient_AAA";
}
}
if (_local1) {
soundMusic.stop();
soundArray[0] = soundArray[1];
soundArray[1] = "ambient_A";
if (soundArray[0] == "hunt_A") {
soundMusic.attachSound("hunt_A");
soundHuntA = false;
} else if (soundArray[0] == "hunt_B") {
soundMusic.attachSound("hunt_B");
}
soundMusic.start(0, 0);
} else {
soundMusic.onSoundComplete = function () {
soundArray[0] = soundArray[1];
soundArray[1] = "ambient_A";
switch (soundArray[0]) {
case "hunt_A" :
soundMusic.attachSound("hunt_A");
soundHuntA = false;
break;
case "hunt_B" :
break;
case "sneak_A" :
soundMusic.attachSound("sneak_A");
soundHuntA = true;
soundSneakA = false;
break;
case "sneak_B" :
soundMusic.attachSound("sneak_B");
soundHuntA = true;
break;
case "ambient_A" :
soundMusic.attachSound("ambient_A");
soundHuntA = true;
soundAmbientA = false;
break;
case "ambient_B" :
soundMusic.attachSound("ambient_B");
soundHuntA = true;
break;
case "ambient_AA" :
soundMusic.attachSound("ambient_AA");
soundHuntA = true;
soundAmbientA = false;
break;
case "ambient_BB" :
soundMusic.attachSound("ambient_BB");
soundHuntA = true;
break;
case "ambient_AAA" :
soundMusic.attachSound("ambient_AAA");
soundHuntA = true;
soundAmbientA = false;
break;
case "ambient_INTO_sneak" :
soundMusic.attachSound("ambient_INTO_sneak");
soundSneakA = true;
break;
case "sneak_INTO_ambient" :
soundMusic.attachSound("sneak_INTO_ambient");
soundAmbientA = true;
break;
case "hunt_INTO_ambient" :
soundMusic.attachSound("hunt_INTO_ambient");
soundAmbientA = true;
break;
case "hunt_INTO_sneak" :
soundMusic.attachSound("hunt_INTO_sneak");
soundSneakA = true;
break;
default :
soundMusic.attachSound("ambient_A");
}
soundMusic.start(0, 0);
};
}
} else {
soundMusic.onSoundComplete = function () {
soundMusic.attachSound("boss_loop");
soundMusic.start(0, 1000);
};
}
}
function loadMap(mapName) {
if (mapLoad == 2) {
mapLoad--;
mcAll.mcMain.removeMovieClip();
mcAll.attachMovie(mapName, "mcMain", 2, {_x:mcAll.mcMain0._x, _y:mcAll.mcMain0._y});
} else if (mapLoad == 1) {
mapLoad--;
enemies = 0;
staffs = 0;
torches = 0;
mapHit = mcAll.mcMain.mcMap.mcHit;
mapHitShadow = mcAll.mcMain.mcMap.mcHitShadow;
mapHitFG = mcAll.mcMain.mcMap.mcHitFG;
mcAll.mcMain.mcFG.swapDepths(fgDepth);
temp = mcAll.mcMain.mcMap._x + mcAll.mcMain.mcMap["doorway" + p1.doorway]._x;
temp2 = mcAll.mcMain.mcMap._y + mcAll.mcMain.mcMap["doorway" + p1.doorway]._y;
mcAll.mcMain.attachMovie("player_wink", "mcP1", p1Depth, {_x:temp, _y:temp2});
p1.mc = mcAll.mcMain.mcP1;
p1.mc.gotoAndStop("doorout");
p1.animHoldIdle = 12;
p1.mc._xscale = p1.currScale;
if (p1.held != null) {
if (p1.held == "torch") {
torches++;
mcAll.mcMain.attachMovie("torch", "torch_mc_" + torches, torchDepth + torches, {_x:p1.mc._x, _y:p1.mc._y});
this["torch_" + torches] = new torch(mcAll.mcMain["torch_mc_" + torches], torchDepth + torches);
this["torch_" + torches].state = "grabbed";
this["torch_" + torches].grabbedName = p1;
this["torch_" + torches].mc.swapDepths(grabbedDepth);
this["torch_" + torches].depth = grabbedDepth;
p1.holdName = this["torch_" + torches];
} else if (p1.held == "staff") {
staffs++;
mcAll.mcMain.attachMovie("staff_" + p1.heldInfo, "staff_mc_" + staffs, staffDepth + staffs, {_x:p1.mc._x, _y:p1.mc._y});
this["staff_" + staffs] = new staff(mcAll.mcMain["staff_mc_" + staffs], staffDepth + staffs, p1.heldInfo);
this["staff_" + staffs].selfName = "staff_" + staffs;
this["staff_" + staffs].state = "grabbed";
this["staff_" + staffs].grabbedName = p1;
this["staff_" + staffs].mc.swapDepths(grabbedDepth);
this["staff_" + staffs].depth = grabbedDepth;
p1.holdName = this["staff_" + staffs];
}
}
temp3 = 0;
for (temp3 in mcAll.mcMain) {
if (typeof(mcAll.mcMain[temp3]) == "movieclip") {
if (mcAll.mcMain[temp3].enemyType == "hoodley") {
enemies++;
mcAll.mcMain[temp3].swapDepths(enemyDepth + (enemies * 10));
this["enemy1_" + enemies] = new enemy1(mcAll.mcMain[temp3]);
this["enemy1_" + enemies].mc._xscale = mcAll.mcMain[temp3].xDir;
if (mcAll.mcMain[temp3].staffType != "none") {
var _local3 = mcAll.mcMain[temp3]._x;
var _local2 = mcAll.mcMain[temp3]._y;
staffs++;
mcAll.mcMain.attachMovie("staff_" + mcAll.mcMain[temp3].staffType, "staff_mc_" + staffs, staffDepth + staffs, {_x:_local3, _y:_local2});
this["staff_" + staffs] = new staff(mcAll.mcMain["staff_mc_" + staffs], staffDepth + staffs, mcAll.mcMain[temp3].staffType);
this["staff_" + staffs].selfName = "staff_" + staffs;
this["staff_" + staffs].grabbedName = this["enemy1_" + enemies];
this["staff_" + staffs].state = "grabbed";
this["enemy1_" + enemies].holdName = this["staff_" + staffs];
this["staff_" + staffs].mc.swapDepths(this["enemy1_" + enemies].depth0 + 1);
}
} else if (mcAll.mcMain[temp3].objType == "torch") {
torches++;
this["torch_" + torches] = new torch(mcAll.mcMain[temp3], torchDepth + torches);
}
}
}
camlock = 2;
}
}
function loadGame(mapName) {
if (loadCount == 2) {
loadCount--;
mcAll.attachMovie(mapName, "mcMain", 2, {_x:mcAll.mcMain0._x, _y:mcAll.mcMain0._y});
} else if (loadCount == 1) {
loadCount--;
mapHit = mcAll.mcMain.mcMap.mcHit;
mapHitShadow = mcAll.mcMain.mcMap.mcHitShadow;
mapHitFG = mcAll.mcMain.mcMap.mcHitFG;
mcAll.mcMain.mcFG.swapDepths(fgDepth);
mcAll.mcMain.attachMovie("player_wink", "mcP1", p1Depth, {_x:mcAll.mcMain.mcStart._x, _y:mcAll.mcMain.mcStart._y});
p1 = new player1(mcAll.mcMain.mcP1);
temp3 = 0;
for (temp3 in mcAll.mcMain) {
if (typeof(mcAll.mcMain[temp3]) == "movieclip") {
if (mcAll.mcMain[temp3].enemyType == "hoodley") {
enemies++;
mcAll.mcMain[temp3].swapDepths(enemyDepth + (enemies * 10));
this["enemy1_" + enemies] = new enemy1(mcAll.mcMain[temp3]);
this["enemy1_" + enemies].mc._xscale = mcAll.mcMain[temp3].xDir;
if (mcAll.mcMain[temp3].staffType != "none") {
var _local3 = mcAll.mcMain[temp3]._x;
var _local2 = mcAll.mcMain[temp3]._y;
staffs++;
if (mcAll.mcMain[temp3].staffType == "fire") {
mcAll.mcMain.attachMovie("staff_fire", "staff_mc_" + staffs, staffDepth + staffs, {_x:_local3, _y:_local2});
} else if (mcAll.mcMain[temp3].staffType == "wind") {
mcAll.mcMain.attachMovie("staff_wind", "staff_mc_" + staffs, staffDepth + staffs, {_x:_local3, _y:_local2});
} else if (mcAll.mcMain[temp3].staffType == "lightning") {
mcAll.mcMain.attachMovie("staff_lightning", "staff_mc_" + staffs, staffDepth + staffs, {_x:_local3, _y:_local2});
}
this["staff_" + staffs] = new staff(mcAll.mcMain["staff_mc_" + staffs], staffDepth + staffs, mcAll.mcMain[temp3].staffType);
this["staff_" + staffs].selfName = "staff_" + staffs;
this["staff_" + staffs].grabbedName = this["enemy1_" + enemies];
this["staff_" + staffs].state = "grabbed";
this["enemy1_" + enemies].holdName = this["staff_" + staffs];
this["staff_" + staffs].mc.swapDepths(this["enemy1_" + enemies].depth0 + 1);
}
} else if (mcAll.mcMain[temp3].objType == "torch") {
torches++;
this["torch_" + torches] = new torch(mcAll.mcMain[temp3], torchDepth + torches);
}
}
}
soundArray[0] = "ambient_A";
soundMusic.stop();
soundMusic.attachSound("ambient_A");
soundMusic.start(0, 0);
camlock = 2;
mcCam._xscale = 100;
mcCam._yscale = 100;
xCutoff = 500;
yCutoff = 270;
voice1Triggered = false;
voice2Triggered = false;
bossCount = 0;
mcCam.mcBossHealth._visible = false;
if (boss.mc != undefined) {
boss.mc.removeMovieClip();
boss = null;
}
if (loadSave) {
loadSave = false;
if (loadSavedGame()) {
mcCam.mcIntro._visible = false;
paused = false;
gameover = false;
}
} else {
paused = false;
gameover = false;
}
}
}
stop();
mcHowto._visible = false;
mcCredits._visible = false;
newMenu = new ContextMenu();
newMenu.hideBuiltInItems();
urlItem = new ContextMenuItem("http://www.girlshavecooties.com", launchURL);
newMenu.customItems.push(urlItem);
_root.menu = newMenu;
gameover = true;
time0 = getTimer();
timeLast = time0;
timeNow = time0;
fps = 0;
gravity = 1.3;
friction = 1.2;
frictionAir = 1.07;
count = 0;
lastCount = 0;
msgCount = 0;
paused = false;
loadCount = 0;
mapLoad = 0;
mapName = "map2";
loadSave = false;
enemies = 0;
temp = 0;
temp2 = 0;
temp3 = 0;
temp4 = 0;
prop = "";
xThrowMax = 22;
yThrowMax = 22;
pulseCount = 0;
xCutoff = 500;
yCutoff = 270;
thrownName = null;
xZoom = 0;
yZoom = 0;
shakeCam = 0;
camlock = 0;
fireNum = 0;
fireMax = 100;
torches = 0;
staffs = 0;
projectiles = 12;
dustNum = 0;
dustMax = 8;
gemNum = 0;
gemMax = 10;
bossCount = 0;
keySaveGame = 53;
keyLoadGame = 57;
savePressed = false;
loadPressed = false;
settingParticles = 2;
mcCam.mcBoss._visible = false;
mcCam.mcEnding._visible = false;
mcCam.mcGameover._visible = false;
mcCam.mcBossHealth._visible = false;
soundFX = new Sound(mcSoundFX);
soundHoodleyFire = new Sound(mcSoundHoodleyFire);
soundWink = new Sound(mcSoundWink);
soundStuckDone = false;
soundArray = new Array(null, null);
soundHuntCount = 0;
soundMusic = new Sound(mcSoundMusic);
soundAmbientA = true;
soundSneakA = true;
soundHuntA = true;
p1Depth = 100000 /* 0x0186A0 */;
enemyDepth = 200000 /* 0x030D40 */;
bossDepth = 250000 /* 0x03D090 */;
torchDepth = 10000;
healthFireDepth = 700000 /* 0x0AAE60 */;
stealthFireDepth = 710000 /* 0x0AD570 */;
staffDepth = 300000 /* 0x0493E0 */;
grabbedDepth = p1Depth + 2000;
enemyDeadOffset = 300000 /* 0x0493E0 */;
projectileDepth = 900000 /* 0x0DBBA0 */;
dustDepth = p1Depth + 5000;
gemDepth = 600000 /* 0x0927C0 */;
fgDepth = 1100000 /* 0x10C8E0 */;
topDepth = 9999999 /* 0x98967F */;
healthFireNum = healthFireDepth;
healthFireMax = 100;
stealthFireNum = stealthFireDepth;
stealthFireMax = 100;
_root._x = ((-(mcCam._x - (((mcCam.mcFrame._width * mcCam._xscale) / 100) / 2))) * Stage.width) / ((mcCam.mcFrame._width * mcCam._xscale) / 100);
_root._y = ((-(mcCam._y - (((mcCam.mcFrame._height * mcCam._xscale) / 100) / 2))) * Stage.height) / ((mcCam.mcFrame._height * mcCam._xscale) / 100);
_root._xscale = (Stage.width / ((mcCam.mcFrame._width * mcCam._xscale) / 100)) * 100;
_root._yscale = (Stage.height / ((mcCam.mcFrame._height * mcCam._xscale) / 100)) * 100;
keys = new Object();
keyfile = SharedObject.getLocal("winkDataKeys");
if (keyfile.data.keyUp1 != undefined) {
keys.keyUp1 = keyfile.data.keyUp1;
keys.keyDown1 = keyfile.data.keyDown1;
keys.keyLeft = keyfile.data.keyLeft;
keys.keyRight = keyfile.data.keyRight;
keys.keyJump = keyfile.data.keyJump;
keys.keyAttack = keyfile.data.keyAttack;
keys.keyGrab = keyfile.data.keyGrab;
keys.keyHide = keyfile.data.keyHide;
keys.keyFast = keyfile.data.keyFast;
keys.keyPause = keyfile.data.keyPause;
} else {
resetKeys();
}
this.onEnterFrame = function () {
if (loadCount > 0) {
loadGame("map2");
}
if (mapLoad > 0) {
loadMap(mapName);
} else if (!gameover) {
if (!paused) {
if ((msgCount % 80) == 0) {
mcCam.textMsg.text = "";
mcCam.mcMenu.mcSave.textMsg.text = "";
mcCam.mcMenu.mcLoad.textMsg.text = "";
}
if (savePoll == 2) {
savePoll = 0;
msgCount = 1;
mcCam.textMsg.text = "You can only save at a doorway";
mcCam.mcMenu.mcSave.textMsg.text = "You can only save at a doorway";
}
playerControl(1);
temp3 = 1;
while (temp3 <= enemies) {
temp4 = "enemy1_" + temp3;
enemy1Control(temp4);
temp3++;
}
temp3 = 1;
while (temp3 <= torches) {
temp4 = "torch_" + temp3;
torchControl(temp4);
temp3++;
}
temp3 = 1;
while (temp3 <= staffs) {
temp4 = "staff_" + temp3;
staffControl(temp4);
temp3++;
}
temp3 = 1;
while (temp3 <= projectiles) {
temp4 = "proj_" + temp3;
if (this[temp4].mc._x != undefined) {
projControl(temp4);
}
temp3++;
}
vcam();
updateMusic();
soundHuntCount = 0;
if (Key.isDown(keySaveGame)) {
if (!savePressed) {
savePressed = true;
savePoll = 2;
}
} else {
savePressed = false;
}
if (savePoll == 1) {
savePoll = 0;
saveGame();
}
if (Key.isDown(keyLoadGame)) {
if (!loadPressed) {
loadPressed = true;
loadSavedGame();
}
} else {
loadPressed = false;
}
}
if (Key.isDown(p1.keyPause)) {
if (!p1.pausePressed) {
if (!mcCam.mcMenu.mcControls._visible) {
paused = !paused;
p1.pausePressed = true;
if (paused) {
mcCam.mcMenu._visible = true;
showMenuMain();
} else if (!mcCam.mcMenu.mcControls._visible) {
mcCam.mcMenu._visible = false;
hideMenuMain();
}
}
}
} else {
p1.pausePressed = false;
}
if ((p1.hp <= 0) && (!paused)) {
paused = true;
stopAllSounds();
mcCam.mcGameover._visible = true;
mcCam.mcGameover.gotoAndPlay(2);
mcCam.mcGameover.textMsg.text = "Wink is too weak to go on...";
}
if ((p1.sp <= 0) && (!paused)) {
paused = true;
stopAllSounds();
mcCam.mcGameover._visible = true;
mcCam.mcGameover.gotoAndPlay(2);
mcCam.mcGameover.textMsg.text = "The dragon has been alerted. He has eaten the princess!";
}
}
count++;
msgCount++;
timeNow = getTimer();
if ((count - lastCount) == 5) {
lastCount = count;
fps = Math.round(5 / ((timeNow - timeLast) / 1000));
mcCam.mcHUD0.textFPS.text = "fps: " + fps;
mcCam.mcMenu.mcOptions.textFPS.text = fps;
timeLast = timeNow;
}
mcCam.mcHUD0.textDebug1.text = "Wink: the Game v2.1";
mcCam.mcHUD0.textDebug2.text = "\u00A9 2005 Andr\u00E9 Nguyen";
};
_quality = "MEDIUM";
Instance of Symbol 2917 MovieClip "mcCam" in Frame 131
/* no clip actions */
Symbol 47 MovieClip Frame 10
_parent.gotoAndStop("thrown");
Symbol 53 MovieClip [enemy0] Frame 1
stop();
Symbol 53 MovieClip [enemy0] Frame 5
stop();
Symbol 53 MovieClip [enemy0] Frame 10
stop();
Symbol 53 MovieClip [enemy0] Frame 20
stop();
Symbol 53 MovieClip [enemy0] Frame 30
stop();
Symbol 53 MovieClip [enemy0] Frame 40
stop();
Symbol 53 MovieClip [enemy0] Frame 50
stop();
Symbol 61 MovieClip Frame 13
_parent.gotoAndStop("idle");
Symbol 62 MovieClip Frame 1
stop();
Symbol 67 MovieClip Frame 1
stop();
Symbol 67 MovieClip Frame 10
stop();
Symbol 71 MovieClip Frame 16
stop();
Symbol 72 MovieClip Frame 1
stop();
Symbol 78 MovieClip Frame 16
stop();
Symbol 79 MovieClip Frame 1
stop();
Symbol 85 MovieClip Frame 16
stop();
Symbol 86 MovieClip Frame 1
stop();
Symbol 89 MovieClip Frame 2
stop();
Symbol 98 MovieClip Frame 1
this.blendMode = "add";
Symbol 98 MovieClip Frame 7
stop();
Symbol 110 MovieClip Frame 14
stop();
Symbol 116 MovieClip Frame 11
stop();
Symbol 117 MovieClip [lightning] Frame 1
stop();
Symbol 128 MovieClip Frame 12
stop();
Symbol 133 MovieClip Frame 8
stop();
Symbol 134 MovieClip [wind] Frame 1
stop();
Symbol 155 MovieClip Frame 13
stop();
Symbol 156 MovieClip [fireball] Frame 1
stop();
Symbol 161 MovieClip [lightning_bolt2] Frame 1
this.blendMode = "add";
Symbol 161 MovieClip [lightning_bolt2] Frame 20
stop();
this.removeMovieClip();
Symbol 168 MovieClip [lightning_bolt1] Frame 1
this.blendMode = "add";
Symbol 168 MovieClip [lightning_bolt1] Frame 20
stop();
this.removeMovieClip();
Symbol 173 MovieClip [dust1b] Frame 9
this.removeMovieClip();
Symbol 178 MovieClip [dust1] Frame 9
this.removeMovieClip();
Symbol 193 MovieClip Frame 9
gotoAndPlay ("idle");
Symbol 193 MovieClip Frame 14
gotoAndPlay ("move");
Symbol 215 MovieClip Frame 9
gotoAndPlay ("idle");
Symbol 215 MovieClip Frame 22
_root.mcTank.state = 2.5;
Symbol 217 MovieClip Frame 9
gotoAndPlay ("idle");
Symbol 217 MovieClip Frame 14
gotoAndPlay ("move");
Symbol 218 MovieClip Frame 4
if (_root.mcTank.state != 1) {
gotoAndPlay ("idle");
}
Instance of Symbol 193 MovieClip in Symbol 218 MovieClip Frame 10
onClipEvent (load) {
gotoAndPlay ("move");
}
Instance of Symbol 217 MovieClip in Symbol 218 MovieClip Frame 10
onClipEvent (load) {
gotoAndPlay ("move");
}
Symbol 218 MovieClip Frame 19
if (_root.mcTank.state == 1) {
gotoAndPlay ("move");
}
Symbol 224 MovieClip Frame 11
stop();
Symbol 239 MovieClip Frame 1
this.blendMode = "add";
Symbol 241 MovieClip Frame 1
this.blendMode = "add";
Symbol 248 MovieClip Frame 1
function makeFire(xOffset, yOffset) {
this.fireNum++;
if (this.fireNum > (fireDepth + _root.stealthFireMax)) {
this.fireNum = fireDepth + 1;
}
_parent.stealthFire.duplicateMovieClip("stealthFire" + this.fireNum, this.fireNum + 100);
_parent.stealthFireBack.duplicateMovieClip("stealthFireBack" + this.fireNum, this.fireNum);
var _local4 = _parent["stealthFire" + this.fireNum];
var _local5 = _parent["stealthFireBack" + this.fireNum];
_local4._x = this._x;
_local4._y = this._y;
rand = Math.random();
_local4._width = (rand * 9) + 12;
_local4._height = (rand * 9) + 12;
_local5._width = _local4._width + 4;
_local5._height = _local4._height + 4;
}
stop();
counter = 0;
fireNum = 0;
fireDepth = 1000;
this.onEnterFrame = function () {
this.counter++;
this._xscale = random(30) + 70;
this._yscale = this._xscale;
this._x = _root._xmouse - _parent._x;
this._y = _root._ymouse - _parent._y;
this.makeFire(0, 0);
if ((this.counter % 2) == 0) {
this.makeFire(0, 0);
}
};
Symbol 248 MovieClip Frame 14
gotoAndPlay ("loop");
Symbol 303 Button
on (release) {
_root.gotoAndStop("main");
}
Symbol 306 MovieClip Frame 1
percent = 0;
_root.stop();
Instance of Symbol 218 MovieClip "mcTank" in Symbol 306 MovieClip Frame 1
onClipEvent (load) {
tankSpeed = 3.5;
keyLeft = 37;
keyRight = 39;
keyShoot = 32;
lPressed = false;
rPressed = false;
sPressed = false;
state = 0;
}
onClipEvent (enterFrame) {
if (Key.isDown(keyLeft)) {
state = 1;
if (!lPressed) {
lPressed = true;
this.gotoAndPlay("move");
}
this._xscale = -32.1;
this._x = this._x - tankSpeed;
} else if (Key.isDown(keyRight)) {
state = 1;
if (!rPressed) {
rPressed = true;
this.gotoAndPlay("move");
}
this._xscale = 32.1;
this._x = this._x + tankSpeed;
} else {
if ((state == 1) || (state == 2.5)) {
state = 0;
this.gotoAndPlay("idle");
}
lPressed = false;
rPressed = false;
}
if (Key.isDown(keyShoot)) {
if (!sPressed) {
sPressed = true;
state = 2;
this.mcBody.gotoAndPlay("shoot");
rand = Math.ceil(Math.random() * 100);
_parent.mcBlast.duplicateMovieClip("blast" + rand, rand + 100);
_parent["blast" + rand]._y = this._y - 20;
if (this._xscale > 0) {
_parent["blast" + rand]._x = this._x + 32;
_parent["blast" + rand]._rotation = 110;
} else {
_parent["blast" + rand]._x = this._x - 32;
_parent["blast" + rand]._rotation = -25;
}
}
} else {
sPressed = false;
}
}
Instance of Symbol 229 MovieClip in Symbol 306 MovieClip Frame 1
on (release) {
getURL ("http://www.armorgames.com", "_blank");
}
Instance of Symbol 239 MovieClip "stealthFireBack" in Symbol 306 MovieClip Frame 1
onClipEvent (load) {
name1 = this._name.substring(15, this._name.length);
name1 = _parent["stealthFire" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "stealthFireBack") {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
Instance of Symbol 241 MovieClip "stealthFire" in Symbol 306 MovieClip Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 2)) - 0.7;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.5;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.18;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "stealthFire") {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._xscale = this._xscale * 0.8;
this._yscale = this._xscale;
this._alpha = 50;
}
}
}
Symbol 306 MovieClip Frame 3
percent = _root.getBytesLoaded() / _root.getBytesTotal();
percent = Math.ceil(percent * 100);
mcBar._xscale = percent;
textPercent.text = percent;
if (percent >= 100) {
gotoAndPlay ("done");
} else {
gotoAndPlay (2);
}
Instance of Symbol 218 MovieClip "mcTank" in Symbol 306 MovieClip Frame 12
onClipEvent (load) {
tankSpeed = 3.5;
keyLeft = 37;
keyRight = 39;
keyShoot = 32;
lPressed = false;
rPressed = false;
sPressed = false;
state = 0;
}
onClipEvent (enterFrame) {
if (Key.isDown(keyLeft)) {
state = 1;
if (!lPressed) {
lPressed = true;
_root.mcTank.gotoAndPlay("move");
}
this._xscale = -32.1;
_root.mcTank._x = _root.mcTank._x - tankSpeed;
} else if (Key.isDown(keyRight)) {
state = 1;
if (!rPressed) {
rPressed = true;
_root.mcTank.gotoAndPlay("move");
}
this._xscale = 32.1;
_root.mcTank._x = _root.mcTank._x + tankSpeed;
} else {
if ((state == 1) || (state == 2.5)) {
state = 0;
_root.mcTank.gotoAndPlay("idle");
}
lPressed = false;
rPressed = false;
}
if (Key.isDown(keyShoot)) {
if (!sPressed) {
sPressed = true;
state = 2;
_root.mcTank.mcBody.gotoAndPlay("shoot");
rand = Math.ceil(Math.random() * 100);
_root.mcBlast.duplicateMovieClip("blast" + rand, rand + 100);
_root["blast" + rand]._y = this._y - 20;
if (this._xscale == 32.1) {
_root["blast" + rand]._x = this._x + 32;
_root["blast" + rand]._rotation = 110;
} else {
_root["blast" + rand]._x = this._x - 32;
_root["blast" + rand]._rotation = -25;
}
}
} else {
sPressed = false;
}
}
Instance of Symbol 305 MovieClip "mcLogo" in Symbol 306 MovieClip Frame 180
onClipEvent (load) {
soundMenuMusic = new Sound(this);
soundMenuMusic.attachSound("menu_music");
soundMenuMusic.start(0, 1000);
}
Symbol 306 MovieClip Frame 186
_root.gotoAndStop("main");
Symbol 319 MovieClip [gemshard] Frame 1
mapHit = _root.mapHit;
gravity = _root.gravity;
yMax = 10;
this.onEnterFrame = function () {
if (!_root.paused) {
if (mapHit.hitTest(this._x, this._y, true)) {
this.xVel = 0;
this.yVel = 0;
} else {
this.yVel = this.yVel + gravity;
if (this.yVel > this.yMax) {
this.yVel = this.yMax;
}
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
}
};
Symbol 319 MovieClip [gemshard] Frame 20
this.removeMovieClip();
Symbol 326 MovieClip [health] Frame 1
#initclip 2
function HealthClass() {
}
HealthClass.prototype = new MovieClip();
HealthClass.prototype.onEnterFrame = function () {
this.counter++;
if (!_root.paused) {
this._xscale = random(30) + 70;
this._yscale = this._xscale;
if (!(this.state === "normal")) {
} else if (Math.abs(this._x - _root.p1.mc._x) < _root.xCutoff) {
if (Math.abs(this._y - _root.p1.mc._y) < _root.yCutoff) {
if (_root.settingParticles == 3) {
if (_root.bossCount <= 0) {
this.makeFire(0, 0);
if ((this.counter % 2) == 0) {
this.makeFire(0, 0);
}
} else if ((this.counter % 2) == 0) {
this.makeFire(0, 0);
}
} else if (_root.settingParticles == 2) {
if (_root.bossCount <= 0) {
this.makeFire(0, 0);
} else if ((this.counter % 4) == 0) {
this.makeFire(0, 0);
}
} else if (_root.settingParticles == 1) {
if (_root.bossCount <= 0) {
if ((this.counter % 2) == 0) {
this.makeFire(0, 0);
}
} else if ((this.counter % 6) == 0) {
this.makeFire(0, 0);
}
} else if (_root.bossCount <= 0) {
if ((this.counter % 4) == 0) {
this.makeFire(0, 0);
}
} else if ((this.counter % 10) == 0) {
this.makeFire(0, 0);
}
if (_root.p1.mc.mcHit.hitTest(this._x, this._y, true)) {
if (_root.p1.hp < 100) {
this.state = "dead";
this._visible = false;
_root.p1.hp = _root.p1.hp + this.amount;
_root.p1.updateHealth = true;
this.makeFire(random(10) - 5, -5);
this.makeFire(random(10) - 5, -7);
this.makeFire(random(10) - 5, -9);
this.makeFire(random(20) - 10, -random(30));
this.makeFire(random(20) - 10, -random(30));
if (_root.bossCount <= 0) {
this.makeFire(random(20) - 10, -random(30));
this.makeFire(random(20) - 10, -random(30));
this.makeFire(random(20) - 10, -random(30));
this.makeFire(random(20) - 10, -random(30));
}
if (_root.settingParticles == 3) {
this.makeFire(random(20) - 10, -random(30));
this.makeFire(random(20) - 10, -random(30));
this.makeFire(random(20) - 10, -random(30));
this.makeFire(random(20) - 10, -random(30));
this.makeFire(random(20) - 10, -random(30));
}
} else {
mcCam.textMsg.text = "You are already at full health.";
}
}
}
}
}
};
Object.registerClass("health", HealthClass);
#endinitclip
function makeFire(xOffset, yOffset) {
_root.healthFireNum++;
if (_root.healthFireNum > (_root.healthFireDepth + _root.htealthFireMax)) {
_root.healthFireNum = _root.healthFireDepth + 1;
}
if ((this.counter % 1) == 0) {
_parent.healthFire.duplicateMovieClip("healthFire" + _root.healthFireNum, _root.healthFireNum + 100);
_parent.healthFireBack.duplicateMovieClip("healthFireBack" + _root.healthFireNum, _root.healthFireNum);
var _local4 = _parent["healthFire" + _root.healthFireNum];
var _local5 = _parent["healthFireBack" + _root.healthFireNum];
_local4._x = this._x + xOffset;
_local4._y = (this._y + 2) + yOffset;
rand = Math.random();
_local4._width = (rand * 6) + 8;
_local4._height = (rand * 6) + 8;
_local5._width = _local4._width + 4;
_local5._height = _local4._height + 4;
}
}
stop();
counter = 0;
state = "normal";
Symbol 326 MovieClip [health] Frame 14
gotoAndPlay ("loop");
Symbol 327 MovieClip [stealth] Frame 1
#initclip 1
function StealthClass() {
}
StealthClass.prototype = new MovieClip();
StealthClass.prototype.onEnterFrame = function () {
this.counter++;
if (!_root.paused) {
this._xscale = random(30) + 70;
this._yscale = this._xscale;
if (!(this.state === "normal")) {
} else if (Math.abs(this._x - _root.p1.mc._x) < _root.xCutoff) {
if (Math.abs(this._y - _root.p1.mc._y) < _root.yCutoff) {
if (_root.settingParticles == 3) {
if (_root.bossCount <= 0) {
this.makeFire(0, 0);
if ((this.counter % 2) == 0) {
this.makeFire(0, 0);
}
} else if ((this.counter % 2) == 0) {
this.makeFire(0, 0);
}
} else if (_root.settingParticles == 2) {
if (_root.bossCount <= 0) {
this.makeFire(0, 0);
} else if ((this.counter % 4) == 0) {
this.makeFire(0, 0);
}
} else if (_root.settingParticles == 1) {
if (_root.bossCount <= 0) {
if ((this.counter % 2) == 0) {
this.makeFire(0, 0);
}
} else if ((this.counter % 6) == 0) {
this.makeFire(0, 0);
}
} else if (_root.bossCount <= 0) {
if ((this.counter % 4) == 0) {
this.makeFire(0, 0);
}
} else if ((this.counter % 10) == 0) {
this.makeFire(0, 0);
}
if (_root.p1.mc.mcHit.hitTest(this._x, this._y, true)) {
if (_root.p1.sp < 100) {
this.state = "dead";
this._visible = false;
_root.p1.sp = _root.p1.sp + this.amount;
this.makeFire(random(10) - 5, -5);
this.makeFire(random(10) - 5, -7);
this.makeFire(random(10) - 5, -9);
this.makeFire(random(20) - 10, -random(30));
this.makeFire(random(20) - 10, -random(30));
if (_root.bossCount <= 0) {
this.makeFire(random(20) - 10, -random(30));
this.makeFire(random(20) - 10, -random(30));
this.makeFire(random(20) - 10, -random(30));
this.makeFire(random(20) - 10, -random(30));
}
if (_root.settingParticles == 3) {
this.makeFire(random(20) - 10, -random(30));
this.makeFire(random(20) - 10, -random(30));
this.makeFire(random(20) - 10, -random(30));
this.makeFire(random(20) - 10, -random(30));
this.makeFire(random(20) - 10, -random(30));
}
} else {
mcCam.textMsg.text = "You are already at full stealth.";
}
}
}
}
}
};
Object.registerClass("stealth", StealthClass);
#endinitclip
function makeFire(xOffset, yOffset) {
_root.stealthFireNum++;
if (_root.stealthFireNum > (_root.stealthFireDepth + _root.stealthFireMax)) {
_root.stealthFireNum = _root.stealthFireDepth + 1;
}
_parent.stealthFire.duplicateMovieClip("stealthFire" + _root.stealthFireNum, _root.stealthFireNum + 100);
_parent.stealthFireBack.duplicateMovieClip("stealthFireBack" + _root.stealthFireNum, _root.stealthFireNum);
var _local4 = _parent["stealthFire" + _root.stealthFireNum];
var _local5 = _parent["stealthFireBack" + _root.stealthFireNum];
_local4._x = this._x + xOffset;
_local4._y = (this._y + 2) + yOffset;
rand = Math.random();
_local4._width = (rand * 6) + 8;
_local4._height = (rand * 6) + 8;
_local5._width = _local4._width + 4;
_local5._height = _local4._height + 4;
}
stop();
counter = 0;
state = "normal";
Symbol 327 MovieClip [stealth] Frame 14
gotoAndPlay ("loop");
Symbol 371 MovieClip Frame 12
gotoAndPlay ("loop");
Symbol 401 MovieClip Frame 9
_parent.gotoAndStop("idle2");
Symbol 414 MovieClip Frame 12
_parent.gotoAndStop("idle2");
Symbol 427 MovieClip Frame 8
_parent.gotoAndStop("headbuttFinish");
Symbol 448 MovieClip Frame 17
stop();
Symbol 469 MovieClip Frame 24
stop();
Symbol 487 MovieClip Frame 25
stop();
Symbol 526 MovieClip Frame 30
gotoAndPlay ("loop");
Symbol 540 MovieClip Frame 21
gotoAndPlay ("loop");
Symbol 602 MovieClip Frame 86
_parent.gotoAndStop("dead");
Symbol 614 MovieClip Frame 5
stop();
Symbol 632 MovieClip Frame 22
stop();
Symbol 653 MovieClip Frame 3
stop();
Instance of Symbol 652 MovieClip in Symbol 653 MovieClip Frame 3
onClipEvent (load) {
this.gotoAndPlay(9);
}
Symbol 665 MovieClip Frame 16
stop();
Symbol 669 MovieClip Frame 11
stop();
Symbol 685 MovieClip Frame 24
stop();
Instance of Symbol 693 MovieClip in Symbol 705 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(6);
}
Instance of Symbol 693 MovieClip in Symbol 705 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(1);
}
Instance of Symbol 693 MovieClip in Symbol 705 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(3);
}
Instance of Symbol 693 MovieClip in Symbol 705 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(8);
}
Instance of Symbol 693 MovieClip in Symbol 705 MovieClip Frame 3
onClipEvent (load) {
this.gotoAndPlay(8);
}
Instance of Symbol 693 MovieClip in Symbol 705 MovieClip Frame 3
onClipEvent (load) {
this.gotoAndPlay(3);
}
Instance of Symbol 693 MovieClip in Symbol 705 MovieClip Frame 3
onClipEvent (load) {
this.gotoAndPlay(5);
}
Instance of Symbol 693 MovieClip in Symbol 705 MovieClip Frame 3
onClipEvent (load) {
this.gotoAndPlay(10);
}
Symbol 705 MovieClip Frame 11
gotoAndPlay ("loop");
Symbol 734 MovieClip Frame 33
stop();
Symbol 751 MovieClip Frame 17
stop();
Symbol 790 MovieClip Frame 45
stop();
Instance of Symbol 652 MovieClip in Symbol 807 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(9);
}
Symbol 807 MovieClip Frame 50
stop();
Instance of Symbol 693 MovieClip in Symbol 833 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(8);
}
Instance of Symbol 693 MovieClip in Symbol 833 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(3);
}
Instance of Symbol 693 MovieClip in Symbol 833 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(5);
}
Instance of Symbol 693 MovieClip in Symbol 833 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(10);
}
Symbol 833 MovieClip Frame 29
stop();
Symbol 852 MovieClip Frame 11
_parent.gotoAndStop("deathNeckFinishRight");
Symbol 856 MovieClip Frame 6
_parent.gotoAndStop("deathNeckFinishLeft");
Symbol 907 MovieClip Frame 53
stop();
Symbol 924 MovieClip Frame 75
stop();
Symbol 959 MovieClip Frame 12
gotoAndPlay ("loop");
Symbol 978 MovieClip Frame 10
_parent.gotoAndStop("idle3");
Symbol 979 MovieClip [enemy1] Frame 1
#initclip 3
function Enemy1Class() {
}
Enemy1Class.prototype = new MovieClip();
Object.registerClass("enemy1", Enemy1Class);
#endinitclip
stop();
Symbol 979 MovieClip [enemy1] Frame 19
stop();
Symbol 979 MovieClip [enemy1] Frame 116
stop();
Symbol 979 MovieClip [enemy1] Frame 156
stop();
Symbol 979 MovieClip [enemy1] Frame 176
stop();
Symbol 979 MovieClip [enemy1] Frame 186
stop();
Symbol 979 MovieClip [enemy1] Frame 228
stop();
Symbol 979 MovieClip [enemy1] Frame 238
stop();
Symbol 979 MovieClip [enemy1] Frame 249
stop();
Symbol 979 MovieClip [enemy1] Frame 263
stop();
Symbol 980 MovieClip Frame 9
if (Math.random() > 0.8) {
gotoAndPlay ("blink");
} else {
gotoAndPlay ("idle");
}
Symbol 980 MovieClip Frame 19
gotoAndPlay ("idle");
Symbol 981 MovieClip Frame 9
Symbol 985 MovieClip Frame 3
_parent.gotoAndStop("walk");
Symbol 989 MovieClip Frame 3
Symbol 1019 MovieClip Frame 30
gotoAndPlay ("loop");
Symbol 1024 MovieClip Frame 19
if (Math.random() > 0.5) {
gotoAndPlay ("moveDown");
} else {
gotoAndPlay ("up");
}
Symbol 1024 MovieClip Frame 49
if (Math.random() > 0.5) {
gotoAndPlay ("moveUp");
} else {
gotoAndPlay ("down");
}
Symbol 1033 MovieClip Frame 8
_parent.gotoAndStop("crouched");
Symbol 1036 MovieClip Frame 5
_parent.gotoAndStop("crouched");
Symbol 1055 MovieClip Frame 37
gotoAndPlay ("loop");
Symbol 1065 MovieClip Frame 9
_parent.gotoAndStop("fall");
Symbol 1077 MovieClip Frame 17
_parent.gotoAndStop("fall");
Symbol 1099 MovieClip Frame 11
stop();
Symbol 1102 MovieClip Frame 22
_parent.gotoAndStop("ledgeIdle");
Symbol 1116 MovieClip Frame 23
_parent.gotoAndStop("idle");
Symbol 1117 MovieClip Frame 19
_parent.gotoAndStop("ledgeIdle");
Symbol 1129 MovieClip Frame 11
_parent.gotoAndStop("stuck");
Symbol 1155 MovieClip Frame 38
if (Math.random() > 0.6) {
gotoAndPlay ("move");
} else {
gotoAndPlay ("idle");
}
Symbol 1155 MovieClip Frame 64
if (Math.random() > 0.8) {
gotoAndPlay ("moveBack");
} else {
gotoAndPlay ("moved");
}
Symbol 1155 MovieClip Frame 78
gotoAndPlay ("idle");
Symbol 1159 MovieClip Frame 5
_parent.gotoAndStop("stuck");
Symbol 1172 MovieClip Frame 25
gotoAndPlay ("loop");
Symbol 1185 MovieClip Frame 25
gotoAndPlay ("loop");
Symbol 1186 MovieClip Frame 8
stop();
Symbol 1190 MovieClip Frame 35
_parent.gotoAndStop("idle");
Symbol 1207 MovieClip Frame 13
_root.mapLoad = 2;
Symbol 1218 MovieClip Frame 12
_parent.gotoAndStop("idle");
Symbol 1221 MovieClip Frame 5
_parent.gotoAndStop("fall");
Symbol 1236 MovieClip Frame 17
_parent.gotoAndStop("shadowIdle");
Symbol 1249 MovieClip Frame 17
_parent.gotoAndStop("shadowIdle");
Symbol 1251 MovieClip Frame 9
if (Math.random() > 0.8) {
gotoAndPlay ("blink");
} else {
gotoAndPlay ("idle");
}
Symbol 1251 MovieClip Frame 19
gotoAndPlay ("idle");
Symbol 1256 MovieClip Frame 2
_parent.gotoAndStop("shadowIdle");
Symbol 1260 MovieClip Frame 3
_parent.gotoAndStop("shadowIdle");
Symbol 1269 MovieClip Frame 10
gotoAndPlay ("loop");
Symbol 1276 MovieClip Frame 11
_parent.gotoAndStop("wallsliding");
Symbol 1287 MovieClip Frame 14
_parent.gotoAndStop("fall");
Symbol 1291 MovieClip Frame 4
_parent.gotoAndStop("dashLoop");
Symbol 1302 MovieClip Frame 10
stop();
Symbol 1318 MovieClip Frame 27
_parent.gotoAndStop("fall");
Symbol 1401 MovieClip Frame 21
gotoAndPlay ("loop");
Symbol 1426 MovieClip Frame 24
_parent.gotoAndStop("idle");
Symbol 1436 MovieClip Frame 11
_parent.gotoAndStop("grabbingIdle");
Symbol 1452 MovieClip Frame 24
_parent.gotoAndStop("idle");
Symbol 1467 MovieClip Frame 16
_parent.gotoAndStop("fall");
Symbol 1481 MovieClip Frame 15
_parent.gotoAndStop("crouched");
Symbol 1487 MovieClip Frame 11
gotoAndPlay ("loop");
Symbol 1493 MovieClip Frame 20
stop();
Symbol 1547 MovieClip Frame 17
_parent.gotoAndStop("walk");
Symbol 1557 MovieClip Frame 30
stop();
Symbol 1558 MovieClip Frame 30
stop();
Symbol 1559 MovieClip Frame 30
stop();
Symbol 1560 MovieClip Frame 30
stop();
Symbol 1567 MovieClip Frame 12
stop();
Symbol 1576 MovieClip Frame 14
stop();
Symbol 1584 MovieClip Frame 20
stop();
Symbol 1595 MovieClip Frame 11
_parent.gotoAndStop("crouched");
Symbol 1598 MovieClip Frame 30
stop();
Symbol 1602 MovieClip Frame 7
_parent.gotoAndStop("wallsliding");
Symbol 1622 MovieClip Frame 20
gotoAndStop ("loop");
Symbol 1633 MovieClip Frame 10
stop();
Symbol 1643 MovieClip Frame 12
_parent.gotoAndStop("idle");
Symbol 1649 MovieClip Frame 10
stop();
Symbol 1659 MovieClip Frame 16
_parent.gotoAndStop("fall");
Symbol 1687 MovieClip Frame 7
_parent.gotoAndStop("crouched");
Symbol 1695 MovieClip Frame 10
_parent.gotoAndStop("crouched");
Symbol 1712 MovieClip Frame 10
_parent.gotoAndStop("idle");
Symbol 1724 MovieClip Frame 11
_parent.gotoAndStop("idle");
Symbol 1736 MovieClip Frame 14
_parent.gotoAndStop("fall");
Symbol 1748 MovieClip Frame 14
_parent.gotoAndStop("fall");
Symbol 1758 MovieClip Frame 10
_parent.gotoAndStop("fall");
Symbol 1777 MovieClip Frame 17
stop();
Symbol 1792 MovieClip Frame 14
stop();
Symbol 1793 MovieClip [player_wink] Frame 1
stop();
Symbol 1793 MovieClip [player_wink] Frame 7
stop();
Symbol 1793 MovieClip [player_wink] Frame 19
stop();
Symbol 1793 MovieClip [player_wink] Frame 25
stop();
Symbol 1793 MovieClip [player_wink] Frame 34
stop();
Symbol 1793 MovieClip [player_wink] Frame 42
stop();
Symbol 1793 MovieClip [player_wink] Frame 50
stop();
Symbol 1793 MovieClip [player_wink] Frame 60
stop();
Symbol 1793 MovieClip [player_wink] Frame 68
stop();
Symbol 1793 MovieClip [player_wink] Frame 78
stop();
Symbol 1793 MovieClip [player_wink] Frame 84
stop();
Symbol 1793 MovieClip [player_wink] Frame 208
stop();
Symbol 1793 MovieClip [player_wink] Frame 235
stop();
Symbol 1793 MovieClip [player_wink] Frame 245
stop();
Symbol 1793 MovieClip [player_wink] Frame 267
stop();
Symbol 1793 MovieClip [player_wink] Frame 278
stop();
Symbol 1793 MovieClip [player_wink] Frame 288
stop();
Symbol 1793 MovieClip [player_wink] Frame 298
stop();
Symbol 1793 MovieClip [player_wink] Frame 308
stop();
Symbol 1793 MovieClip [player_wink] Frame 318
stop();
Symbol 1793 MovieClip [player_wink] Frame 328
stop();
Symbol 1793 MovieClip [player_wink] Frame 337
stop();
Symbol 1793 MovieClip [player_wink] Frame 346
stop();
Symbol 1793 MovieClip [player_wink] Frame 368
stop();
Symbol 1793 MovieClip [player_wink] Frame 380
stop();
Symbol 1793 MovieClip [player_wink] Frame 392
stop();
Symbol 1793 MovieClip [player_wink] Frame 400
stop();
Symbol 1793 MovieClip [player_wink] Frame 412
stop();
Symbol 1793 MovieClip [player_wink] Frame 421
stop();
Symbol 1793 MovieClip [player_wink] Frame 429
stop();
Symbol 1793 MovieClip [player_wink] Frame 460
stop();
Symbol 1793 MovieClip [player_wink] Frame 473
stop();
Symbol 1793 MovieClip [player_wink] Frame 483
stop();
Symbol 1793 MovieClip [player_wink] Frame 503
stop();
Symbol 1793 MovieClip [player_wink] Frame 517
stop();
Symbol 1793 MovieClip [player_wink] Frame 528
stop();
Symbol 1793 MovieClip [player_wink] Frame 539
stop();
Symbol 1793 MovieClip [player_wink] Frame 554
stop();
Symbol 1793 MovieClip [player_wink] Frame 567
stop();
Symbol 1793 MovieClip [player_wink] Frame 582
stop();
Symbol 1793 MovieClip [player_wink] Frame 597
stop();
Symbol 1793 MovieClip [player_wink] Frame 607
stop();
Symbol 1793 MovieClip [player_wink] Frame 617
stop();
Symbol 1793 MovieClip [player_wink] Frame 627
stop();
Symbol 1793 MovieClip [player_wink] Frame 637
stop();
Symbol 1793 MovieClip [player_wink] Frame 647
stop();
Symbol 1793 MovieClip [player_wink] Frame 663
stop();
Symbol 1793 MovieClip [player_wink] Frame 674
stop();
Symbol 1793 MovieClip [player_wink] Frame 691
stop();
Symbol 1793 MovieClip [player_wink] Frame 734
stop();
Symbol 1793 MovieClip [player_wink] Frame 765
stop();
Symbol 1793 MovieClip [player_wink] Frame 774
stop();
Symbol 1793 MovieClip [player_wink] Frame 780
stop();
Symbol 1793 MovieClip [player_wink] Frame 790
stop();
Symbol 1793 MovieClip [player_wink] Frame 796
stop();
Symbol 1835 MovieClip Frame 1
stop();
Symbol 1835 MovieClip Frame 2
stop();
Symbol 1876 MovieClip Frame 12
_parent.gotoAndStop("flyLoop");
Symbol 1931 MovieClip Frame 13
_parent.gotoAndStop("flyLoop");
Symbol 1949 MovieClip Frame 16
gotoAndPlay ("loop");
Symbol 1959 MovieClip Frame 6
_parent.gotoAndStop("flyLoop");
Symbol 1997 MovieClip Frame 20
_parent.gotoAndStop("down");
Instance of Symbol 652 MovieClip in Symbol 1999 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(5);
}
Instance of Symbol 652 MovieClip in Symbol 2008 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(5);
}
Symbol 2008 MovieClip Frame 8
_parent.gotoAndStop("idle");
Symbol 2020 MovieClip Frame 13
_parent.gotoAndStop("idle");
Symbol 2041 MovieClip Frame 19
_parent.gotoAndStop("flyLoop");
Symbol 2062 MovieClip Frame 9
_parent.gotoAndStop("flyLoop");
Symbol 2072 MovieClip Frame 6
gotoAndPlay ("loop");
Symbol 2073 MovieClip [boss] Frame 1
stop();
Symbol 2080 MovieClip [doorhit] Frame 1
#initclip 6
function DoorHitClass() {
}
DoorHitClass.prototype = new MovieClip();
DoorHitClass.prototype.onEnterFrame = function () {
var _local3 = null;
var _local4 = 1;
if (!_root.paused) {
_local4 = 1;
while (_local4 <= _root.staffs) {
_local3 = _root["staff_" + _local4];
if (_local3.element == this.element) {
if (this.bVertical) {
if ((Math.abs((_local3.mc._x + 1850) - this._x) < 100) && (Math.abs((_local3.mc._y + 610) - this._y) < 200)) {
this.nextFrame();
_root.mcAll.mcMain.mcMap["door" + this.doorNum].nextFrame();
break;
}
} else if ((Math.abs((_local3.mc._x + 1850) - this._x) < 150) && (Math.abs((_local3.mc._y + 700) - this._y) < 200)) {
this.nextFrame();
_root.mcAll.mcMain.mcMap["door" + this.doorNum].nextFrame();
break;
}
}
_local4++;
}
if (_local4 > _root.staffs) {
this.prevFrame();
_root.mcAll.mcMain.mcMap["door" + this.doorNum].prevFrame();
}
if ((Math.abs((p1.mc._x + 1850) - this._x) < 130) && (Math.abs((p1.mc._y + 610) - this._y) < 150)) {
if (p1.holdName.element != this.element) {
_root.msgCount = 1;
_root.mcCam.textMsg.text = ("You need a " + this.element) + " staff to open this door.";
}
}
}
};
Object.registerClass("doorhit", DoorHitClass);
#endinitclip
Instance of Symbol 2080 MovieClip [doorhit] in Symbol 2081 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
element = "fire";
doorNum = 1;
bVertical = true;
}
Symbol 2084 MovieClip [doorway] Frame 1
#initclip 4
function DoorwayClass() {
}
DoorwayClass.prototype = new MovieClip();
DoorwayClass.prototype.onLoad = function () {
this._visible = false;
};
DoorwayClass.prototype.onEnterFrame = function () {
if (_root.p1.doorwaypoll > 0) {
if (this.hitTest(_root.p1.mc._x, _root.p1.mc._y, true)) {
with (_root.p1) {
doorwaypoll = 0;
xSpec = 20;
ySpec = 20;
doorway = this.dest;
mc.gotoAndStop("doorin");
held = _root.p1.holdName.actor;
xVel = 0;
currScale = mc._xscale;
attackHold = 19;
}
if (_root.p1.holdName.actor == "staff") {
_root.p1.heldInfo = _root.p1.holdName.element;
}
_root.mapName = this.mapDest;
}
}
if (_root.savePoll == 2) {
if (this.hitTest(_root.p1.mc._x, _root.p1.mc._y, true)) {
p1.doorway = substring(this._name, 8, -1);
_root.savePoll = 1;
}
}
};
Object.registerClass("doorway", DoorwayClass);
#endinitclip
Instance of Symbol 2084 MovieClip [doorway] "doorway1" in Symbol 2085 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 1;
mapDest = "map1";
}
Instance of Symbol 2092 MovieClip in Symbol 2093 MovieClip Frame 1
onClipEvent (load) {
gotoAndPlay(Math.ceil(Math.random() * 20));
}
Symbol 2094 MovieClip Frame 16
stop();
Instance of Symbol 2092 MovieClip in Symbol 2095 MovieClip Frame 1
onClipEvent (load) {
gotoAndPlay(Math.ceil(Math.random() * 20));
}
Symbol 2097 MovieClip Frame 25
stop();
Symbol 2098 MovieClip [torch] Frame 1
#initclip 5
function TorchClass() {
}
TorchClass.prototype = new MovieClip();
Object.registerClass("torch", TorchClass);
#endinitclip
stop();
Instance of Symbol 2 MovieClip in Symbol 2099 MovieClip [map1a] Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.p1.mc._x, _root.p1.mc._y, true)) {
if (_root.bossCount == 0) {
_root.bossCount = 1;
_root.loadBoss();
}
}
}
Instance of Symbol 2088 MovieClip "mcStart" in Symbol 2099 MovieClip [map1a] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 184 MovieClip [fire back] "firePartBack" in Symbol 2099 MovieClip [map1a] Frame 1
onClipEvent (load) {
name1 = this._name.substring(12, this._name.length);
name1 = _parent["firePart" + name1];
this.blendMode = "add";
}
onClipEvent (enterFrame) {
if (this._name != "firePartBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 182 MovieClip [fire] "firePart" in Symbol 2099 MovieClip [map1a] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 4)) - 0.3;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "firePart") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._alpha = 50;
}
}
}
}
Instance of Symbol 180 MovieClip [fire white] "firePartWhite" in Symbol 2099 MovieClip [map1a] Frame 1
onClipEvent (load) {
_alpha = 100;
yVel = (-(Math.random() / 4)) - 0.2;
if (Math.random() > 0.5) {
xVel = Math.random() / 6;
xAccel = Math.random() * -0.025;
} else {
xVel = (-Math.random()) / 6;
xAccel = Math.random() * 0.025;
}
life = Math.random() + 1.2;
}
onClipEvent (enterFrame) {
if (this._name != "firePartWhite") {
if (!_root.paused) {
if (life > 0) {
xVel = xVel + xAccel;
}
_x = (_x + xVel);
_y = (_y + yVel);
life = life - 0.2;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._alpha = 50;
}
}
}
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2099 MovieClip [map1a] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "fire";
xDir = -100;
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2099 MovieClip [map1a] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2080 MovieClip [doorhit] in Symbol 2108 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
element = "fire";
doorNum = 1;
bVertical = true;
}
Instance of Symbol 2084 MovieClip [doorway] "doorway1" in Symbol 2120 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 1;
mapDest = "map3";
}
Instance of Symbol 2084 MovieClip [doorway] "doorway2" in Symbol 2120 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 2;
mapDest = "map3";
}
Symbol 2123 MovieClip Frame 1
stop();
Symbol 2123 MovieClip Frame 26
stop();
Symbol 2125 MovieClip Frame 1
stop();
Symbol 2125 MovieClip Frame 26
stop();
Symbol 2134 MovieClip Frame 1
this.blendMode = "add";
Symbol 2136 MovieClip Frame 1
this.blendMode = "add";
Instance of Symbol 2101 MovieClip "mcSky" in Symbol 2137 MovieClip [map2] Frame 1
/* no clip actions */
Instance of Symbol 2088 MovieClip "mcStart" in Symbol 2137 MovieClip [map2] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 2123 MovieClip in Symbol 2137 MovieClip [map2] Frame 1
onClipEvent (load) {
this._visible = false;
triggered = false;
}
onClipEvent (enterFrame) {
if (!this.triggered) {
if (this.hitTest(_root.p1.mc._x, _root.p1.mc._y, false)) {
this.triggered = true;
this.gotoAndPlay("triggered");
}
}
}
Instance of Symbol 2125 MovieClip in Symbol 2137 MovieClip [map2] Frame 1
onClipEvent (load) {
this._visible = false;
triggered = false;
}
onClipEvent (enterFrame) {
if (!this.triggered) {
if (this.hitTest(_root.p1.mc._x, _root.p1.mc._y, false)) {
this.triggered = true;
this.gotoAndPlay("triggered");
}
}
}
Instance of Symbol 184 MovieClip [fire back] "firePartBack" in Symbol 2137 MovieClip [map2] Frame 1
onClipEvent (load) {
name1 = this._name.substring(12, this._name.length);
name1 = _parent["firePart" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "firePartBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 182 MovieClip [fire] "firePart" in Symbol 2137 MovieClip [map2] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 4)) - 0.3;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "firePart") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._alpha = 50;
}
}
}
}
Instance of Symbol 180 MovieClip [fire white] "firePartWhite" in Symbol 2137 MovieClip [map2] Frame 1
onClipEvent (load) {
_alpha = 100;
yVel = (-(Math.random() / 4)) - 0.2;
if (Math.random() > 0.5) {
xVel = Math.random() / 6;
xAccel = Math.random() * -0.025;
} else {
xVel = (-Math.random()) / 6;
xAccel = Math.random() * 0.025;
}
life = Math.random() + 1.2;
}
onClipEvent (enterFrame) {
if (this._name != "firePartWhite") {
if (!_root.paused) {
if (life > 0) {
xVel = xVel + xAccel;
}
_x = (_x + xVel);
_y = (_y + yVel);
life = life - 0.2;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._alpha = 50;
}
}
}
}
Instance of Symbol 2134 MovieClip "healthFireBack" in Symbol 2137 MovieClip [map2] Frame 1
onClipEvent (load) {
name1 = this._name.substring(14, this._name.length);
name1 = _parent["healthFire" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "healthFireBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 2136 MovieClip "healthFire" in Symbol 2137 MovieClip [map2] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 3)) - 0.5;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "healthFire") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._xscale = this._xscale * 0.8;
this._yscale = this._xscale;
this._alpha = 50;
}
}
}
}
Instance of Symbol 239 MovieClip "stealthFireBack" in Symbol 2137 MovieClip [map2] Frame 1
onClipEvent (load) {
name1 = this._name.substring(15, this._name.length);
name1 = _parent["stealthFire" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "stealthFireBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 241 MovieClip "stealthFire" in Symbol 2137 MovieClip [map2] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 3)) - 0.5;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "stealthFire") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._xscale = this._xscale * 0.8;
this._yscale = this._xscale;
this._alpha = 50;
}
}
}
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2137 MovieClip [map2] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "fire";
xDir = -100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2137 MovieClip [map2] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "none";
xDir = -100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2137 MovieClip [map2] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "none";
xDir = -100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2137 MovieClip [map2] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "fire";
xDir = -100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2137 MovieClip [map2] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "none";
xDir = 100;
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2137 MovieClip [map2] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2137 MovieClip [map2] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2137 MovieClip [map2] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2137 MovieClip [map2] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 326 MovieClip [health] in Symbol 2137 MovieClip [map2] Frame 1
//component parameters
onClipEvent (construct) {
amount = 10;
}
Instance of Symbol 327 MovieClip [stealth] in Symbol 2137 MovieClip [map2] Frame 1
//component parameters
onClipEvent (construct) {
amount = 5;
}
Instance of Symbol 326 MovieClip [health] in Symbol 2137 MovieClip [map2] Frame 1
//component parameters
onClipEvent (construct) {
amount = 10;
}
Instance of Symbol 2080 MovieClip [doorhit] in Symbol 2143 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
element = "wind";
doorNum = 1;
bVertical = true;
}
Instance of Symbol 2084 MovieClip [doorway] "doorway1" in Symbol 2146 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 1;
mapDest = "map2";
}
Instance of Symbol 2084 MovieClip [doorway] "doorway2" in Symbol 2146 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 2;
mapDest = "map2";
}
Instance of Symbol 2084 MovieClip [doorway] "doorway3" in Symbol 2146 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 1;
mapDest = "map5";
}
Instance of Symbol 2088 MovieClip "mcStart" in Symbol 2149 MovieClip [map3] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 184 MovieClip [fire back] "firePartBack" in Symbol 2149 MovieClip [map3] Frame 1
onClipEvent (load) {
name1 = this._name.substring(12, this._name.length);
name1 = _parent["firePart" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "firePartBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 182 MovieClip [fire] "firePart" in Symbol 2149 MovieClip [map3] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 4)) - 0.3;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "firePart") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._alpha = 50;
}
}
}
}
Instance of Symbol 180 MovieClip [fire white] "firePartWhite" in Symbol 2149 MovieClip [map3] Frame 1
onClipEvent (load) {
_alpha = 100;
yVel = (-(Math.random() / 4)) - 0.2;
if (Math.random() > 0.5) {
xVel = Math.random() / 6;
xAccel = Math.random() * -0.025;
} else {
xVel = (-Math.random()) / 6;
xAccel = Math.random() * 0.025;
}
life = Math.random() + 1.2;
}
onClipEvent (enterFrame) {
if (this._name != "firePartWhite") {
if (!_root.paused) {
if (life > 0) {
xVel = xVel + xAccel;
}
_x = (_x + xVel);
_y = (_y + yVel);
life = life - 0.2;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._alpha = 50;
}
}
}
}
Instance of Symbol 2134 MovieClip "healthFireBack" in Symbol 2149 MovieClip [map3] Frame 1
onClipEvent (load) {
name1 = this._name.substring(14, this._name.length);
name1 = _parent["healthFire" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "healthFireBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 2136 MovieClip "healthFire" in Symbol 2149 MovieClip [map3] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 3)) - 0.5;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "healthFire") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._xscale = this._xscale * 0.8;
this._yscale = this._xscale;
this._alpha = 50;
}
}
}
}
Instance of Symbol 239 MovieClip "stealthFireBack" in Symbol 2149 MovieClip [map3] Frame 1
onClipEvent (load) {
name1 = this._name.substring(15, this._name.length);
name1 = _parent["stealthFire" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "stealthFireBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 241 MovieClip "stealthFire" in Symbol 2149 MovieClip [map3] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 3)) - 0.5;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "stealthFire") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._xscale = this._xscale * 0.8;
this._yscale = this._xscale;
this._alpha = 50;
}
}
}
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2149 MovieClip [map3] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "wind";
xDir = -100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2149 MovieClip [map3] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "fire";
xDir = -100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2149 MovieClip [map3] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "none";
xDir = -100;
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2149 MovieClip [map3] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2149 MovieClip [map3] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2149 MovieClip [map3] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2149 MovieClip [map3] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2149 MovieClip [map3] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 326 MovieClip [health] in Symbol 2149 MovieClip [map3] Frame 1
//component parameters
onClipEvent (construct) {
amount = 10;
}
Instance of Symbol 327 MovieClip [stealth] in Symbol 2149 MovieClip [map3] Frame 1
//component parameters
onClipEvent (construct) {
amount = 5;
}
Instance of Symbol 2080 MovieClip [doorhit] in Symbol 2156 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
element = "fire";
doorNum = 1;
bVertical = true;
}
Instance of Symbol 2084 MovieClip [doorway] "doorway1" in Symbol 2159 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 3;
mapDest = "map3";
}
Instance of Symbol 2084 MovieClip [doorway] "doorway2" in Symbol 2159 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 1;
mapDest = "map6";
}
Instance of Symbol 2 MovieClip in Symbol 2162 MovieClip [map5] Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.p1.mc._x, _root.p1.mc._y, true)) {
if (_root.bossCount == 0) {
_root.bossCount = 1;
_root.loadBoss();
}
}
}
Instance of Symbol 2088 MovieClip "mcStart" in Symbol 2162 MovieClip [map5] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 184 MovieClip [fire back] "firePartBack" in Symbol 2162 MovieClip [map5] Frame 1
onClipEvent (load) {
name1 = this._name.substring(12, this._name.length);
name1 = _parent["firePart" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "firePartBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 182 MovieClip [fire] "firePart" in Symbol 2162 MovieClip [map5] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 4)) - 0.3;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "firePart") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._alpha = 50;
}
}
}
}
Instance of Symbol 180 MovieClip [fire white] "firePartWhite" in Symbol 2162 MovieClip [map5] Frame 1
onClipEvent (load) {
_alpha = 100;
yVel = (-(Math.random() / 4)) - 0.2;
if (Math.random() > 0.5) {
xVel = Math.random() / 6;
xAccel = Math.random() * -0.025;
} else {
xVel = (-Math.random()) / 6;
xAccel = Math.random() * 0.025;
}
life = Math.random() + 1.2;
}
onClipEvent (enterFrame) {
if (this._name != "firePartWhite") {
if (!_root.paused) {
if (life > 0) {
xVel = xVel + xAccel;
}
_x = (_x + xVel);
_y = (_y + yVel);
life = life - 0.2;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._alpha = 50;
}
}
}
}
Instance of Symbol 2134 MovieClip "healthFireBack" in Symbol 2162 MovieClip [map5] Frame 1
onClipEvent (load) {
name1 = this._name.substring(14, this._name.length);
name1 = _parent["healthFire" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "healthFireBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 2136 MovieClip "healthFire" in Symbol 2162 MovieClip [map5] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 3)) - 0.5;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "healthFire") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._xscale = this._xscale * 0.8;
this._yscale = this._xscale;
this._alpha = 50;
}
}
}
}
Instance of Symbol 239 MovieClip "stealthFireBack" in Symbol 2162 MovieClip [map5] Frame 1
onClipEvent (load) {
name1 = this._name.substring(15, this._name.length);
name1 = _parent["stealthFire" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "stealthFireBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 241 MovieClip "stealthFire" in Symbol 2162 MovieClip [map5] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 3)) - 0.5;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "stealthFire") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._xscale = this._xscale * 0.8;
this._yscale = this._xscale;
this._alpha = 50;
}
}
}
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2162 MovieClip [map5] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "none";
xDir = 100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2162 MovieClip [map5] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "none";
xDir = 100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2162 MovieClip [map5] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "fire";
xDir = -100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2162 MovieClip [map5] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "none";
xDir = -100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2162 MovieClip [map5] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "none";
xDir = 100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2162 MovieClip [map5] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "wind";
xDir = -100;
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2162 MovieClip [map5] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2162 MovieClip [map5] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2162 MovieClip [map5] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2162 MovieClip [map5] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 326 MovieClip [health] in Symbol 2162 MovieClip [map5] Frame 1
//component parameters
onClipEvent (construct) {
amount = 10;
}
Instance of Symbol 327 MovieClip [stealth] in Symbol 2162 MovieClip [map5] Frame 1
//component parameters
onClipEvent (construct) {
amount = 5;
}
Instance of Symbol 326 MovieClip [health] in Symbol 2162 MovieClip [map5] Frame 1
//component parameters
onClipEvent (construct) {
amount = 10;
}
Instance of Symbol 2084 MovieClip [doorway] "doorway1" in Symbol 2180 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 2;
mapDest = "map5";
}
Instance of Symbol 2084 MovieClip [doorway] "doorway2" in Symbol 2180 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 1;
mapDest = "map7";
}
Instance of Symbol 2084 MovieClip [doorway] "doorway3" in Symbol 2180 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 2;
mapDest = "map7";
}
Instance of Symbol 2084 MovieClip [doorway] "doorway4" in Symbol 2180 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 3;
mapDest = "map7";
}
Instance of Symbol 2084 MovieClip [doorway] "doorway5" in Symbol 2180 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 4;
mapDest = "map7";
}
Instance of Symbol 2084 MovieClip [doorway] "doorway6" in Symbol 2180 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 3;
mapDest = "map8";
}
Instance of Symbol 2101 MovieClip "mcSky" in Symbol 2189 MovieClip [map6] Frame 1
/* no clip actions */
Instance of Symbol 2 MovieClip in Symbol 2189 MovieClip [map6] Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.p1.mc._x, _root.p1.mc._y, true)) {
if (_root.bossCount == 0) {
_root.bossCount = 1;
_root.loadBoss();
}
}
}
Instance of Symbol 2088 MovieClip "mcStart" in Symbol 2189 MovieClip [map6] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 184 MovieClip [fire back] "firePartBack" in Symbol 2189 MovieClip [map6] Frame 1
onClipEvent (load) {
name1 = this._name.substring(12, this._name.length);
name1 = _parent["firePart" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "firePartBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 182 MovieClip [fire] "firePart" in Symbol 2189 MovieClip [map6] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 4)) - 0.3;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "firePart") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._alpha = 50;
}
}
}
}
Instance of Symbol 180 MovieClip [fire white] "firePartWhite" in Symbol 2189 MovieClip [map6] Frame 1
onClipEvent (load) {
_alpha = 100;
yVel = (-(Math.random() / 4)) - 0.2;
if (Math.random() > 0.5) {
xVel = Math.random() / 6;
xAccel = Math.random() * -0.025;
} else {
xVel = (-Math.random()) / 6;
xAccel = Math.random() * 0.025;
}
life = Math.random() + 1.2;
}
onClipEvent (enterFrame) {
if (this._name != "firePartWhite") {
if (!_root.paused) {
if (life > 0) {
xVel = xVel + xAccel;
}
_x = (_x + xVel);
_y = (_y + yVel);
life = life - 0.2;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._alpha = 50;
}
}
}
}
Instance of Symbol 2134 MovieClip "healthFireBack" in Symbol 2189 MovieClip [map6] Frame 1
onClipEvent (load) {
name1 = this._name.substring(14, this._name.length);
name1 = _parent["healthFire" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "healthFireBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 2136 MovieClip "healthFire" in Symbol 2189 MovieClip [map6] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 3)) - 0.5;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "healthFire") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._xscale = this._xscale * 0.8;
this._yscale = this._xscale;
this._alpha = 50;
}
}
}
}
Instance of Symbol 239 MovieClip "stealthFireBack" in Symbol 2189 MovieClip [map6] Frame 1
onClipEvent (load) {
name1 = this._name.substring(15, this._name.length);
name1 = _parent["stealthFire" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "stealthFireBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 241 MovieClip "stealthFire" in Symbol 2189 MovieClip [map6] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 3)) - 0.5;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "stealthFire") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._xscale = this._xscale * 0.8;
this._yscale = this._xscale;
this._alpha = 50;
}
}
}
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2189 MovieClip [map6] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "lightning";
xDir = 100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2189 MovieClip [map6] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "fire";
xDir = -100;
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2189 MovieClip [map6] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2189 MovieClip [map6] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 326 MovieClip [health] in Symbol 2189 MovieClip [map6] Frame 1
//component parameters
onClipEvent (construct) {
amount = 10;
}
Instance of Symbol 2080 MovieClip [doorhit] in Symbol 2197 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
element = "lightning";
doorNum = 1;
bVertical = true;
}
Instance of Symbol 2084 MovieClip [doorway] "doorway1" in Symbol 2200 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 2;
mapDest = "map6";
}
Instance of Symbol 2084 MovieClip [doorway] "doorway2" in Symbol 2200 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 3;
mapDest = "map6";
}
Instance of Symbol 2084 MovieClip [doorway] "doorway3" in Symbol 2200 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 4;
mapDest = "map6";
}
Instance of Symbol 2084 MovieClip [doorway] "doorway4" in Symbol 2200 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 5;
mapDest = "map6";
}
Instance of Symbol 2084 MovieClip [doorway] "doorway5" in Symbol 2200 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 1;
mapDest = "map8";
}
Instance of Symbol 2101 MovieClip "mcSky" in Symbol 2203 MovieClip [map7] Frame 1
/* no clip actions */
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2203 MovieClip [map7] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "wind";
xDir = -100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2203 MovieClip [map7] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "fire";
xDir = 100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2203 MovieClip [map7] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "wind";
xDir = 100;
}
Instance of Symbol 2088 MovieClip "mcStart" in Symbol 2203 MovieClip [map7] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 184 MovieClip [fire back] "firePartBack" in Symbol 2203 MovieClip [map7] Frame 1
onClipEvent (load) {
name1 = this._name.substring(12, this._name.length);
name1 = _parent["firePart" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "firePartBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 182 MovieClip [fire] "firePart" in Symbol 2203 MovieClip [map7] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 4)) - 0.3;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "firePart") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._alpha = 50;
}
}
}
}
Instance of Symbol 180 MovieClip [fire white] "firePartWhite" in Symbol 2203 MovieClip [map7] Frame 1
onClipEvent (load) {
_alpha = 100;
yVel = (-(Math.random() / 4)) - 0.2;
if (Math.random() > 0.5) {
xVel = Math.random() / 6;
xAccel = Math.random() * -0.025;
} else {
xVel = (-Math.random()) / 6;
xAccel = Math.random() * 0.025;
}
life = Math.random() + 1.2;
}
onClipEvent (enterFrame) {
if (this._name != "firePartWhite") {
if (!_root.paused) {
if (life > 0) {
xVel = xVel + xAccel;
}
_x = (_x + xVel);
_y = (_y + yVel);
life = life - 0.2;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._alpha = 50;
}
}
}
}
Instance of Symbol 2134 MovieClip "healthFireBack" in Symbol 2203 MovieClip [map7] Frame 1
onClipEvent (load) {
name1 = this._name.substring(14, this._name.length);
name1 = _parent["healthFire" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "healthFireBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 2136 MovieClip "healthFire" in Symbol 2203 MovieClip [map7] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 3)) - 0.5;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "healthFire") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._xscale = this._xscale * 0.8;
this._yscale = this._xscale;
this._alpha = 50;
}
}
}
}
Instance of Symbol 239 MovieClip "stealthFireBack" in Symbol 2203 MovieClip [map7] Frame 1
onClipEvent (load) {
name1 = this._name.substring(15, this._name.length);
name1 = _parent["stealthFire" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "stealthFireBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 241 MovieClip "stealthFire" in Symbol 2203 MovieClip [map7] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 3)) - 0.5;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "stealthFire") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._xscale = this._xscale * 0.8;
this._yscale = this._xscale;
this._alpha = 50;
}
}
}
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2203 MovieClip [map7] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "lightning";
xDir = -100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2203 MovieClip [map7] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "none";
xDir = 100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2203 MovieClip [map7] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "none";
xDir = 100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2203 MovieClip [map7] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "none";
xDir = -100;
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2203 MovieClip [map7] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2203 MovieClip [map7] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2203 MovieClip [map7] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2203 MovieClip [map7] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2203 MovieClip [map7] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2203 MovieClip [map7] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2203 MovieClip [map7] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2203 MovieClip [map7] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 326 MovieClip [health] in Symbol 2203 MovieClip [map7] Frame 1
//component parameters
onClipEvent (construct) {
amount = 10;
}
Instance of Symbol 327 MovieClip [stealth] in Symbol 2203 MovieClip [map7] Frame 1
//component parameters
onClipEvent (construct) {
amount = 5;
}
Instance of Symbol 327 MovieClip [stealth] in Symbol 2203 MovieClip [map7] Frame 1
//component parameters
onClipEvent (construct) {
amount = 5;
}
Instance of Symbol 327 MovieClip [stealth] in Symbol 2203 MovieClip [map7] Frame 1
//component parameters
onClipEvent (construct) {
amount = 5;
}
Instance of Symbol 2080 MovieClip [doorhit] in Symbol 2210 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
element = "fire";
doorNum = 1;
bVertical = true;
}
Symbol 2244 MovieClip Frame 30
stop();
this.done = true;
Instance of Symbol 2244 MovieClip in Symbol 2245 MovieClip Frame 1
onClipEvent (load) {
this.done = false;
}
onClipEvent (enterFrame) {
if (this.done && (Math.random() > 0.6)) {
this.done = false;
this.play();
this._x = (Math.random() * 80) - 40;
this._y = (Math.random() * 100) - 50;
}
}
Instance of Symbol 2244 MovieClip in Symbol 2245 MovieClip Frame 1
onClipEvent (load) {
this.done = false;
}
onClipEvent (enterFrame) {
if (this.done && (Math.random() > 0.6)) {
this.done = false;
this.play();
this._x = (Math.random() * 80) - 40;
this._y = (Math.random() * 100) - 50;
}
}
Instance of Symbol 2245 MovieClip in Symbol 2248 MovieClip Frame 1
onClipEvent (enterFrame) {
if ((Math.abs((this._x - 1835) - _root.p1.mc._x) <= (_root.xCutoff - 30)) && (Math.abs((this._y - 50) - _root.p1.mc._y) <= (_root.yCutoff + 80))) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 2084 MovieClip [doorway] "doorway1" in Symbol 2248 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 5;
mapDest = "map7";
}
Instance of Symbol 2084 MovieClip [doorway] "doorway2" in Symbol 2248 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 1;
mapDest = "map9";
}
Instance of Symbol 2084 MovieClip [doorway] "doorway3" in Symbol 2248 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 6;
mapDest = "map6";
}
Instance of Symbol 2101 MovieClip "mcSky" in Symbol 2251 MovieClip [map8] Frame 1
/* no clip actions */
Instance of Symbol 2 MovieClip in Symbol 2251 MovieClip [map8] Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.p1.mc._x, _root.p1.mc._y, true)) {
if (_root.bossCount == 0) {
_root.bossCount = 1;
_root.loadBoss();
}
}
}
Instance of Symbol 2088 MovieClip "mcStart" in Symbol 2251 MovieClip [map8] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 460 MovieClip in Symbol 2251 MovieClip [map8] Frame 1
onClipEvent (enterFrame) {
if ((_root.count % 60) == 0) {
if (this.hitTest(_root.p1.mc._x, _root.p1.mc._y, true)) {
_root.p1.hp++;
_root.p1.updateHealth = true;
}
}
}
Instance of Symbol 184 MovieClip [fire back] "firePartBack" in Symbol 2251 MovieClip [map8] Frame 1
onClipEvent (load) {
name1 = this._name.substring(12, this._name.length);
name1 = _parent["firePart" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "firePartBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 182 MovieClip [fire] "firePart" in Symbol 2251 MovieClip [map8] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 4)) - 0.3;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "firePart") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._alpha = 50;
}
}
}
}
Instance of Symbol 180 MovieClip [fire white] "firePartWhite" in Symbol 2251 MovieClip [map8] Frame 1
onClipEvent (load) {
_alpha = 100;
yVel = (-(Math.random() / 4)) - 0.2;
if (Math.random() > 0.5) {
xVel = Math.random() / 6;
xAccel = Math.random() * -0.025;
} else {
xVel = (-Math.random()) / 6;
xAccel = Math.random() * 0.025;
}
life = Math.random() + 1.2;
}
onClipEvent (enterFrame) {
if (this._name != "firePartWhite") {
if (!_root.paused) {
if (life > 0) {
xVel = xVel + xAccel;
}
_x = (_x + xVel);
_y = (_y + yVel);
life = life - 0.2;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._alpha = 50;
}
}
}
}
Instance of Symbol 2134 MovieClip "healthFireBack" in Symbol 2251 MovieClip [map8] Frame 1
onClipEvent (load) {
name1 = this._name.substring(14, this._name.length);
name1 = _parent["healthFire" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "healthFireBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 2136 MovieClip "healthFire" in Symbol 2251 MovieClip [map8] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 3)) - 0.5;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "healthFire") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._xscale = this._xscale * 0.8;
this._yscale = this._xscale;
this._alpha = 50;
}
}
}
}
Instance of Symbol 239 MovieClip "stealthFireBack" in Symbol 2251 MovieClip [map8] Frame 1
onClipEvent (load) {
name1 = this._name.substring(15, this._name.length);
name1 = _parent["stealthFire" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "stealthFireBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 241 MovieClip "stealthFire" in Symbol 2251 MovieClip [map8] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 3)) - 0.5;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "stealthFire") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._xscale = this._xscale * 0.8;
this._yscale = this._xscale;
this._alpha = 50;
}
}
}
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2251 MovieClip [map8] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "none";
xDir = 100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2251 MovieClip [map8] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "none";
xDir = 100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2251 MovieClip [map8] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "none";
xDir = -100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2251 MovieClip [map8] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "none";
xDir = 100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2251 MovieClip [map8] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "lightning";
xDir = -100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2251 MovieClip [map8] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "none";
xDir = 100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2251 MovieClip [map8] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "wind";
xDir = -100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2251 MovieClip [map8] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "none";
xDir = 100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2251 MovieClip [map8] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "none";
xDir = -100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2251 MovieClip [map8] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "none";
xDir = -100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2251 MovieClip [map8] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "fire";
xDir = 100;
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2251 MovieClip [map8] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2251 MovieClip [map8] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 326 MovieClip [health] in Symbol 2251 MovieClip [map8] Frame 1
//component parameters
onClipEvent (construct) {
amount = 10;
}
Instance of Symbol 327 MovieClip [stealth] in Symbol 2251 MovieClip [map8] Frame 1
//component parameters
onClipEvent (construct) {
amount = 5;
}
Instance of Symbol 327 MovieClip [stealth] in Symbol 2251 MovieClip [map8] Frame 1
//component parameters
onClipEvent (construct) {
amount = 5;
}
Instance of Symbol 327 MovieClip [stealth] in Symbol 2251 MovieClip [map8] Frame 1
//component parameters
onClipEvent (construct) {
amount = 5;
}
Instance of Symbol 326 MovieClip [health] in Symbol 2251 MovieClip [map8] Frame 1
//component parameters
onClipEvent (construct) {
amount = 10;
}
Instance of Symbol 326 MovieClip [health] in Symbol 2251 MovieClip [map8] Frame 1
//component parameters
onClipEvent (construct) {
amount = 10;
}
Instance of Symbol 327 MovieClip [stealth] in Symbol 2251 MovieClip [map8] Frame 1
//component parameters
onClipEvent (construct) {
amount = 5;
}
Instance of Symbol 2080 MovieClip [doorhit] in Symbol 2256 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
element = "fire";
doorNum = 1;
bVertical = true;
}
Instance of Symbol 2084 MovieClip [doorway] "doorway1" in Symbol 2259 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 2;
mapDest = "map8";
}
Instance of Symbol 2084 MovieClip [doorway] "doorway2" in Symbol 2259 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 1;
mapDest = "map10";
}
Instance of Symbol 2101 MovieClip "mcSky" in Symbol 2260 MovieClip [map9] Frame 1
/* no clip actions */
Instance of Symbol 2 MovieClip in Symbol 2260 MovieClip [map9] Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.p1.mc._x, _root.p1.mc._y, true)) {
if (_root.bossCount == 0) {
_root.bossCount = 1;
_root.loadBoss();
}
}
}
Instance of Symbol 2088 MovieClip "mcStart" in Symbol 2260 MovieClip [map9] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 184 MovieClip [fire back] "firePartBack" in Symbol 2260 MovieClip [map9] Frame 1
onClipEvent (load) {
name1 = this._name.substring(12, this._name.length);
name1 = _parent["firePart" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "firePartBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 182 MovieClip [fire] "firePart" in Symbol 2260 MovieClip [map9] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 4)) - 0.3;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "firePart") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._alpha = 50;
}
}
}
}
Instance of Symbol 180 MovieClip [fire white] "firePartWhite" in Symbol 2260 MovieClip [map9] Frame 1
onClipEvent (load) {
_alpha = 100;
yVel = (-(Math.random() / 4)) - 0.2;
if (Math.random() > 0.5) {
xVel = Math.random() / 6;
xAccel = Math.random() * -0.025;
} else {
xVel = (-Math.random()) / 6;
xAccel = Math.random() * 0.025;
}
life = Math.random() + 1.2;
}
onClipEvent (enterFrame) {
if (this._name != "firePartWhite") {
if (!_root.paused) {
if (life > 0) {
xVel = xVel + xAccel;
}
_x = (_x + xVel);
_y = (_y + yVel);
life = life - 0.2;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._alpha = 50;
}
}
}
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2260 MovieClip [map9] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "lightning";
xDir = 100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2260 MovieClip [map9] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "wind";
xDir = -100;
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2260 MovieClip [map9] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2260 MovieClip [map9] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2260 MovieClip [map9] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2260 MovieClip [map9] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Symbol 2276 MovieClip Frame 9
if (Math.random() > 0.8) {
gotoAndPlay ("blink");
} else {
gotoAndPlay ("idle");
}
Symbol 2276 MovieClip Frame 19
gotoAndPlay ("idle");
Symbol 2376 MovieClip Frame 10
if (random(10) < 8) {
gotoAndPlay ("idle");
}
Symbol 2380 MovieClip Frame 1
stop();
Symbol 2380 MovieClip Frame 32
_root.shakeCam = 13;
Symbol 2380 MovieClip Frame 38
stop();
Instance of Symbol 2084 MovieClip [doorway] "doorway1" in Symbol 2382 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
dest = 2;
mapDest = "map9";
}
Instance of Symbol 2101 MovieClip "mcSky" in Symbol 2387 MovieClip [map10] Frame 1
/* no clip actions */
Instance of Symbol 2 MovieClip "mcTrigger" in Symbol 2387 MovieClip [map10] Frame 1
onClipEvent (load) {
active = true;
}
onClipEvent (enterFrame) {
if (_root.bossCount == 0) {
if (this.hitTest(_root.p1.mc._x, _root.p1.mc._y, true)) {
_root.xCutoff = _root.xCutoff * 2;
_root.yCutoff = _root.yCutoff * 2;
_root.bossCount = 1;
_root.mcCam.mcBossHealth._visible = true;
_root.loadBoss();
}
} else if (_root.bossCount == 2) {
if (_root.mcCam._xscale < 190) {
_root.mcCam._xscale = _root.mcCam._xscale + ((190 - _root.mcCam._xscale) / 8);
if (_root.mcCam._xscale > 189) {
_root.mcCam._xscale = 190;
}
_root.mcCam._yscale = _root.mcCam._xscale;
}
if (!_root.paused) {
_root.bossControl();
}
}
}
Instance of Symbol 2088 MovieClip "mcStart" in Symbol 2387 MovieClip [map10] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 184 MovieClip [fire back] "firePartBack" in Symbol 2387 MovieClip [map10] Frame 1
onClipEvent (load) {
name1 = this._name.substring(12, this._name.length);
name1 = _parent["firePart" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "firePartBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 182 MovieClip [fire] "firePart" in Symbol 2387 MovieClip [map10] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 4)) - 0.3;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "firePart") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._alpha = 50;
}
}
}
}
Instance of Symbol 180 MovieClip [fire white] "firePartWhite" in Symbol 2387 MovieClip [map10] Frame 1
onClipEvent (load) {
_alpha = 100;
yVel = (-(Math.random() / 4)) - 0.2;
if (Math.random() > 0.5) {
xVel = Math.random() / 6;
xAccel = Math.random() * -0.025;
} else {
xVel = (-Math.random()) / 6;
xAccel = Math.random() * 0.025;
}
life = Math.random() + 1.2;
}
onClipEvent (enterFrame) {
if (this._name != "firePartWhite") {
if (!_root.paused) {
if (life > 0) {
xVel = xVel + xAccel;
}
_x = (_x + xVel);
_y = (_y + yVel);
life = life - 0.2;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._alpha = 50;
}
}
}
}
Instance of Symbol 2134 MovieClip "healthFireBack" in Symbol 2387 MovieClip [map10] Frame 1
onClipEvent (load) {
name1 = this._name.substring(14, this._name.length);
name1 = _parent["healthFire" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "healthFireBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 2136 MovieClip "healthFire" in Symbol 2387 MovieClip [map10] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 3)) - 0.5;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "healthFire") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._xscale = this._xscale * 0.8;
this._yscale = this._xscale;
this._alpha = 50;
}
}
}
}
Instance of Symbol 239 MovieClip "stealthFireBack" in Symbol 2387 MovieClip [map10] Frame 1
onClipEvent (load) {
name1 = this._name.substring(15, this._name.length);
name1 = _parent["stealthFire" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "stealthFireBack") {
if (!_root.paused) {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 241 MovieClip "stealthFire" in Symbol 2387 MovieClip [map10] Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 3)) - 0.5;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "stealthFire") {
if (!_root.paused) {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._xscale = this._xscale * 0.8;
this._yscale = this._xscale;
this._alpha = 50;
}
}
}
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2387 MovieClip [map10] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "fire";
xDir = -100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2387 MovieClip [map10] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "wind";
xDir = -100;
}
Instance of Symbol 979 MovieClip [enemy1] in Symbol 2387 MovieClip [map10] Frame 1
//component parameters
onClipEvent (construct) {
enemyType = "hoodley";
staffType = "lightning";
xDir = 100;
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2387 MovieClip [map10] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2387 MovieClip [map10] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2387 MovieClip [map10] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2387 MovieClip [map10] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2387 MovieClip [map10] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 2098 MovieClip [torch] in Symbol 2387 MovieClip [map10] Frame 1
//component parameters
onClipEvent (construct) {
objType = "torch";
}
Instance of Symbol 326 MovieClip [health] in Symbol 2387 MovieClip [map10] Frame 1
//component parameters
onClipEvent (construct) {
amount = 10;
}
Instance of Symbol 327 MovieClip [stealth] in Symbol 2387 MovieClip [map10] Frame 1
//component parameters
onClipEvent (construct) {
amount = 5;
}
Instance of Symbol 326 MovieClip [health] in Symbol 2387 MovieClip [map10] Frame 1
//component parameters
onClipEvent (construct) {
amount = 10;
}
Instance of Symbol 326 MovieClip [health] in Symbol 2387 MovieClip [map10] Frame 1
//component parameters
onClipEvent (construct) {
amount = 10;
}
Instance of Symbol 326 MovieClip [health] in Symbol 2387 MovieClip [map10] Frame 1
//component parameters
onClipEvent (construct) {
amount = 10;
}
Instance of Symbol 326 MovieClip [health] in Symbol 2387 MovieClip [map10] Frame 1
//component parameters
onClipEvent (construct) {
amount = 10;
}
Symbol 2392 MovieClip Frame 1
this._visible = false;
Symbol 2437 Button
on (release) {
if (_quality == "LOW") {
_quality = "MEDIUM";
} else if (_quality == "MEDIUM") {
_quality = "HIGH";
} else if (_quality == "HIGH") {
_quality = "LOW";
}
}
Symbol 2446 MovieClip Frame 18
_parent.gotoAndStop("idle");
Symbol 2447 MovieClip Frame 1
stop();
Instance of Symbol 2447 MovieClip "mcBar2" in Symbol 2449 MovieClip Frame 1
onClipEvent (load) {
speed = -0.1;
lastHealth = 100;
}
onClipEvent (enterFrame) {
if (lastHealth > _root.p1.hp) {
this._xscale = lastHealth;
lastHealth = _root.p1.hp;
}
if (this._xscale > _root.p1.hp) {
this._xscale = this._xscale + speed;
} else {
this._xscale = _root.p1.hp;
}
}
Instance of Symbol 2447 MovieClip in Symbol 2449 MovieClip Frame 1
onClipEvent (enterFrame) {
this._xscale = _root.p1.hp;
if (_root.p1.updateHealth) {
_root.p1.updateHealth = false;
this.gotoAndStop("update");
}
}
Symbol 2452 MovieClip Frame 18
_parent.gotoAndStop("idle");
Symbol 2453 MovieClip Frame 1
stop();
Instance of Symbol 2447 MovieClip in Symbol 2455 MovieClip Frame 1
onClipEvent (load) {
speed = -0.1;
lastStealth = 100;
}
onClipEvent (enterFrame) {
if (lastStealth > _root.p1.hp) {
this._xscale = lastStealth;
lastStealth = _root.p1.sp;
}
if (this._xscale > _root.p1.sp) {
this._xscale = this._xscale + speed;
} else {
this._xscale = _root.p1.sp;
}
}
Instance of Symbol 2453 MovieClip in Symbol 2455 MovieClip Frame 1
onClipEvent (enterFrame) {
this._xscale = _root.p1.sp;
if (_root.p1.updateStealth) {
_root.p1.updateStealth = false;
this.gotoAndStop("update");
}
}
Symbol 2458 MovieClip Frame 18
_parent.gotoAndStop("idle");
Symbol 2459 MovieClip Frame 1
stop();
Instance of Symbol 2459 MovieClip "mcBar2" in Symbol 2461 MovieClip Frame 1
onClipEvent (load) {
speed = -0.2;
lastHealth = 100;
}
onClipEvent (enterFrame) {
if (lastHealth > _root.boss.hp) {
this._xscale = lastHealth;
lastHealth = _root.boss.hp;
}
if (this._xscale > _root.boss.hp) {
this._xscale = this._xscale + speed;
} else {
this._xscale = _root.boss.hp;
}
}
Instance of Symbol 2459 MovieClip in Symbol 2461 MovieClip Frame 1
onClipEvent (enterFrame) {
this._xscale = _root.boss.hp;
if (_root.boss.updateHealth) {
_root.boss.updateHealth = false;
this.gotoAndStop("update");
}
}
Symbol 2470 MovieClip Frame 1
stop();
Symbol 2473 MovieClip Frame 1
stop();
Symbol 2476 MovieClip Frame 1
stop();
Instance of Symbol 2470 MovieClip in Symbol 2476 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndPlay("hover");
}
}
on (release) {
if (_root.loadSavedGame()) {
_root.paused = false;
_parent._visible = false;
} else {
_parent.textMsg.text = "No saved game to load";
}
}
Instance of Symbol 2473 MovieClip in Symbol 2476 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndPlay("hover");
}
}
on (release) {
_root.gameover = true;
stopAllSounds();
_root.mcAll.mcMain.removeMovieClip();
_root.mcCam.mcGameover.gotoAndStop(1);
_root.mcCam.mcGameover._visible = false;
_root.mcCam.mcMenu._visible = true;
_root.mcCam.mcMenu.mcLogo.soundMenuMusic.start(0, 1000);
_root.paused = true;
_parent._visible = false;
}
Symbol 2476 MovieClip Frame 37
stop();
Symbol 2526 MovieClip Frame 1
stop();
Symbol 2535 MovieClip Frame 1
function makeFire(xOffset, yOffset) {
this.fireNum++;
if (this.fireNum > (fireDepth + _root.stealthFireMax)) {
this.fireNum = fireDepth + 1;
}
_parent.stealthFire.duplicateMovieClip("stealthFire" + this.fireNum, this.fireNum + 100);
_parent.stealthFireBack.duplicateMovieClip("stealthFireBack" + this.fireNum, this.fireNum);
var _local4 = _parent["stealthFire" + this.fireNum];
var _local5 = _parent["stealthFireBack" + this.fireNum];
_local4._x = this._x + xOffset;
_local4._y = (this._y + 2) + yOffset;
rand = Math.random();
_local4._width = (rand * 12) + 16;
_local4._height = (rand * 12) + 16;
_local5._width = _local4._width + 4;
_local5._height = _local4._height + 4;
}
stop();
counter = 0;
fireNum = 0;
fireDepth = 1000;
this.onEnterFrame = function () {
this.counter++;
this._xscale = random(30) + 70;
this._yscale = this._xscale;
if (_root.mcCam.mcEnding._visible) {
if (_root.settingParticles == 3) {
if (_root.bossCount <= 0) {
this.makeFire(0, 0);
if ((this.counter % 2) == 0) {
this.makeFire(0, 0);
}
} else if ((this.counter % 2) == 0) {
this.makeFire(0, 0);
}
} else if (_root.settingParticles == 2) {
if (_root.bossCount <= 0) {
this.makeFire(0, 0);
} else if ((this.counter % 4) == 0) {
this.makeFire(0, 0);
}
} else if (_root.settingParticles == 1) {
if (_root.bossCount <= 0) {
if ((this.counter % 2) == 0) {
this.makeFire(0, 0);
}
} else if ((this.counter % 6) == 0) {
this.makeFire(0, 0);
}
} else if (_root.bossCount <= 0) {
if ((this.counter % 4) == 0) {
this.makeFire(0, 0);
}
} else if ((this.counter % 10) == 0) {
this.makeFire(0, 0);
}
}
};
Symbol 2535 MovieClip Frame 14
gotoAndPlay ("loop");
Symbol 2536 MovieClip Frame 1
function makeFire(xOffset, yOffset) {
this.fireNum++;
if (this.fireNum > (fireDepth + _root.healthFireMax)) {
this.fireNum = fireDepth + 1;
}
_parent.healthFire.duplicateMovieClip("healthFire" + this.fireNum, this.fireNum + 100);
_parent.healthFireBack.duplicateMovieClip("healthFireBack" + this.fireNum, this.fireNum);
var _local4 = _parent["healthFire" + this.fireNum];
var _local5 = _parent["healthFireBack" + this.fireNum];
_local4._x = this._x + xOffset;
_local4._y = (this._y + 2) + yOffset;
rand = Math.random();
_local4._width = (rand * 6) + 8;
_local4._height = (rand * 6) + 8;
_local5._width = _local4._width + 4;
_local5._height = _local4._height + 4;
}
stop();
counter = 0;
fireNum = 0;
fireDepth = 2000;
this.onEnterFrame = function () {
this.counter++;
this._xscale = random(30) + 70;
this._yscale = this._xscale;
if (_root.mcCam.mcEnding._visible) {
if (_root.settingParticles == 3) {
if (_root.bossCount <= 0) {
this.makeFire(0, 0);
if ((this.counter % 2) == 0) {
this.makeFire(0, 0);
}
} else if ((this.counter % 2) == 0) {
this.makeFire(0, 0);
}
} else if (_root.settingParticles == 2) {
if (_root.bossCount <= 0) {
this.makeFire(0, 0);
} else if ((this.counter % 4) == 0) {
this.makeFire(0, 0);
}
} else if (_root.settingParticles == 1) {
if (_root.bossCount <= 0) {
if ((this.counter % 2) == 0) {
this.makeFire(0, 0);
}
} else if ((this.counter % 6) == 0) {
this.makeFire(0, 0);
}
} else if (_root.bossCount <= 0) {
if ((this.counter % 4) == 0) {
this.makeFire(0, 0);
}
} else if ((this.counter % 10) == 0) {
this.makeFire(0, 0);
}
}
};
Symbol 2536 MovieClip Frame 14
gotoAndPlay ("loop");
Symbol 2538 MovieClip Frame 1
if (_root.p1.sp >= 100) {
textMsg.text = "Perfect. You are true to your ways even in the face of a dragon.";
} else if (_root.p1.sp >= 98) {
textMsg.text = "So close to being perfectly stealthy! Wink is still happy, even if Violet did crush the princess.";
} else if (_root.p1.sp >= 90) {
textMsg.text = "Great job! Not quite the quietest killer, but still, well done. Did you know you can gain stealth points by taking out Hoodleys in creative ways?";
} else if (_root.p1.sp >= 75) {
textMsg.text = "Good job! Beware of the Hoodleys in the dragon's lair, as they can still take your stealth rating down!";
} else if (_root.p1.sp >= 50) {
textMsg.text = "Getting a little sloppy with your stealth there. You're spotted quite often!";
} else if (_root.p1.sp >= 30) {
textMsg.text = "Amazing! Amazing that you're still alive after being spotted so many times! You can actually take out enemies with stealthy moves and gain stealth points!";
} else if (_root.p1.sp >= 10) {
textMsg.text = "You're no ninja at all. Wink is sad.";
} else if (_root.p1.sp >= 0) {
textMsg.text = "At least you beat the game right? Even if you weren't super stealthy! Try some of the more stealthy moves though, you'll gain stealth points that way!";
}
Symbol 2543 MovieClip Frame 2
_parent.gotoAndStop("hoverOut");
Symbol 2544 MovieClip Frame 15
stop();
Symbol 2546 MovieClip Frame 1
stop();
Instance of Symbol 2520 MovieClip in Symbol 2546 MovieClip Frame 848
onClipEvent (load) {
num = 0;
count = 0;
}
onClipEvent (enterFrame) {
count++;
if ((count % 2) == 0) {
num++;
_parent.mcSparkle.duplicateMovieClip("sparkle" + num, num + 100);
_parent["sparkle" + num]._x = (Math.random() * 700) - 350;
_parent["sparkle" + num]._y = (Math.random() * 400) - 200;
rand = (Math.random() * 60) + 30;
_parent["sparkle" + num]._xscale = rand;
_parent["sparkle" + num]._yscale = rand;
}
if (count > 1000) {
count = 1;
}
if (num > 100) {
num = 0;
}
}
Instance of Symbol 2244 MovieClip "mcSparkle2" in Symbol 2546 MovieClip Frame 848
onClipEvent (load) {
if (_name != "mcSparkle2") {
xVel = ((Math.ceil(Math.random() * 2) * 2) - 3) * ((Math.random() * 7) + 0.2);
yVel = ((Math.ceil(Math.random() * 2) * 2) - 3) * ((Math.random() * 7) + 0.2);
}
}
onClipEvent (enterFrame) {
_x = (_x + xVel);
_y = (_y + yVel);
}
Instance of Symbol 2244 MovieClip "mcSparkle2b" in Symbol 2546 MovieClip Frame 848
onClipEvent (load) {
if (_name != "mcSparkle2") {
xVel = ((Math.ceil(Math.random() * 2) * 2) - 3) * ((Math.random() * 7) + 0.2);
yVel = ((Math.ceil(Math.random() * 2) * 2) - 3) * ((Math.random() * 7) + 0.2);
}
}
onClipEvent (enterFrame) {
_x = (_x + xVel);
_y = (_y + yVel);
}
Instance of Symbol 2520 MovieClip in Symbol 2546 MovieClip Frame 851
onClipEvent (load) {
num = 0;
count = 0;
}
onClipEvent (enterFrame) {
count++;
if (count < 18) {
i = 0;
while (i < 4) {
num++;
if (Math.random() < 0.95) {
_parent.mcSparkle2.duplicateMovieClip("sparkle" + (num + 100), num + 200);
} else {
_parent.mcSparkle2b.duplicateMovieClip("sparkle" + (num + 100), num + 200);
}
_parent["sparkle" + (num + 100)]._x = (Math.random() * 200) - 100;
_parent["sparkle" + (num + 100)]._y = (Math.random() * 90) - 45;
rand = (Math.random() * 100) + 50;
_parent["sparkle" + (num + 100)]._xscale = rand;
_parent["sparkle" + (num + 100)]._yscale = rand;
i++;
}
}
if (count > 1000) {
count = 1;
}
if (num > 100) {
num = 0;
}
}
Instance of Symbol 2520 MovieClip in Symbol 2546 MovieClip Frame 929
onClipEvent (load) {
num = 0;
count = 0;
}
onClipEvent (enterFrame) {
count++;
if (count < 18) {
i = 0;
while (i < 4) {
num++;
if (Math.random() < 0.95) {
_parent.mcSparkle2.duplicateMovieClip("sparkle" + (num + 100), num + 200);
} else {
_parent.mcSparkle2b.duplicateMovieClip("sparkle" + (num + 100), num + 200);
}
_parent["sparkle" + (num + 100)]._x = (Math.random() * 200) - 100;
_parent["sparkle" + (num + 100)]._y = (Math.random() * 90) - 45;
rand = (Math.random() * 100) + 50;
_parent["sparkle" + (num + 100)]._xscale = rand;
_parent["sparkle" + (num + 100)]._yscale = rand;
i++;
}
}
if (count > 1000) {
count = 1;
}
if (num > 100) {
num = 0;
}
}
Instance of Symbol 2526 MovieClip in Symbol 2546 MovieClip Frame 948
onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndPlay("play");
}
}
Instance of Symbol 2520 MovieClip in Symbol 2546 MovieClip Frame 1006
onClipEvent (load) {
num = 0;
count = 0;
}
onClipEvent (enterFrame) {
count++;
if (count < 18) {
i = 0;
while (i < 4) {
num++;
if (Math.random() < 0.95) {
_parent.mcSparkle2.duplicateMovieClip("sparkle" + (num + 100), num + 200);
} else {
_parent.mcSparkle2b.duplicateMovieClip("sparkle" + (num + 100), num + 200);
}
_parent["sparkle" + (num + 100)]._x = (Math.random() * 200) - 100;
_parent["sparkle" + (num + 100)]._y = (Math.random() * 90) - 45;
rand = (Math.random() * 100) + 50;
_parent["sparkle" + (num + 100)]._xscale = rand;
_parent["sparkle" + (num + 100)]._yscale = rand;
i++;
}
}
if (count > 1000) {
count = 1;
}
if (num > 100) {
num = 0;
}
}
Instance of Symbol 2520 MovieClip in Symbol 2546 MovieClip Frame 1080
onClipEvent (load) {
num = 0;
count = 0;
}
onClipEvent (enterFrame) {
count++;
if (count < 18) {
i = 0;
while (i < 4) {
num++;
if (Math.random() < 0.95) {
_parent.mcSparkle2.duplicateMovieClip("sparkle" + (num + 100), num + 200);
} else {
_parent.mcSparkle2b.duplicateMovieClip("sparkle" + (num + 100), num + 200);
}
_parent["sparkle" + (num + 100)]._x = (Math.random() * 200) - 100;
_parent["sparkle" + (num + 100)]._y = (Math.random() * 90) - 45;
rand = (Math.random() * 100) + 50;
_parent["sparkle" + (num + 100)]._xscale = rand;
_parent["sparkle" + (num + 100)]._yscale = rand;
i++;
}
}
if (count > 1000) {
count = 1;
}
if (num > 100) {
num = 0;
}
}
Instance of Symbol 2520 MovieClip in Symbol 2546 MovieClip Frame 1167
onClipEvent (load) {
num = 0;
count = 0;
}
onClipEvent (enterFrame) {
count++;
if (count < 18) {
i = 0;
while (i < 4) {
num++;
if (Math.random() < 0.95) {
_parent.mcSparkle2.duplicateMovieClip("sparkle" + (num + 100), num + 200);
} else {
_parent.mcSparkle2b.duplicateMovieClip("sparkle" + (num + 100), num + 200);
}
_parent["sparkle" + (num + 100)]._x = (Math.random() * 200) - 100;
_parent["sparkle" + (num + 100)]._y = (Math.random() * 90) - 45;
rand = (Math.random() * 100) + 50;
_parent["sparkle" + (num + 100)]._xscale = rand;
_parent["sparkle" + (num + 100)]._yscale = rand;
i++;
}
}
if (count > 1000) {
count = 1;
}
if (num > 100) {
num = 0;
}
}
Instance of Symbol 2520 MovieClip in Symbol 2546 MovieClip Frame 1256
onClipEvent (load) {
num = 0;
count = 0;
}
onClipEvent (enterFrame) {
count++;
if (count < 18) {
i = 0;
while (i < 4) {
num++;
if (Math.random() < 0.95) {
_parent.mcSparkle2.duplicateMovieClip("sparkle" + (num + 100), num + 200);
} else {
_parent.mcSparkle2b.duplicateMovieClip("sparkle" + (num + 100), num + 200);
}
_parent["sparkle" + (num + 100)]._x = (Math.random() * 200) - 100;
_parent["sparkle" + (num + 100)]._y = (Math.random() * 90) - 45;
rand = (Math.random() * 100) + 50;
_parent["sparkle" + (num + 100)]._xscale = rand;
_parent["sparkle" + (num + 100)]._yscale = rand;
i++;
}
}
if (count > 1000) {
count = 1;
}
if (num > 100) {
num = 0;
}
}
Instance of Symbol 239 MovieClip "stealthFireBack" in Symbol 2546 MovieClip Frame 1291
onClipEvent (load) {
name1 = this._name.substring(15, this._name.length);
name1 = _parent["stealthFire" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "stealthFireBack") {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
Instance of Symbol 241 MovieClip "stealthFire" in Symbol 2546 MovieClip Frame 1291
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-((Math.random() * 2) / 3)) - 1;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.6;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.24;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "stealthFire") {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._xscale = this._xscale * 0.8;
this._yscale = this._xscale;
this._alpha = 50;
}
}
}
Instance of Symbol 2134 MovieClip "healthFireBack" in Symbol 2546 MovieClip Frame 1291
onClipEvent (load) {
name1 = this._name.substring(14, this._name.length);
name1 = _parent["healthFire" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "healthFireBack") {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
Instance of Symbol 2136 MovieClip "healthFire" in Symbol 2546 MovieClip Frame 1291
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 3)) - 0.5;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "healthFire") {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._xscale = this._xscale * 0.8;
this._yscale = this._xscale;
this._alpha = 50;
}
}
}
Symbol 2546 MovieClip Frame 1292
mcRating.textRating.text = Math.ceil(_root.p1.sp) + "%";
Instance of Symbol 2545 MovieClip in Symbol 2546 MovieClip Frame 1384
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndPlay("hover");
}
}
on (release) {
_root.gameover = true;
stopAllSounds();
_root.mcAll.mcMain.removeMovieClip();
_root.mcCam.mcGameover.gotoAndStop(1);
_root.mcCam.mcGameover._visible = false;
_root.mcCam.mcMenu._visible = true;
_root.paused = true;
_parent._visible = false;
}
Symbol 2546 MovieClip Frame 1410
stop();
Symbol 2549 MovieClip Frame 1
stop();
Symbol 2549 MovieClip Frame 106
stop();
_root.bossCount = 2;
this._visible = false;
_root.paused = false;
_root.mcAll.mcMain.mcMap.mcBlock.gotoAndPlay("down");
Symbol 2555 Button
on (release) {
gotoAndPlay ("end");
}
Symbol 2565 MovieClip Frame 1
stop();
Symbol 2565 MovieClip Frame 989
_root.loadCount = 2;
Symbol 2565 MovieClip Frame 1034
stop();
this._visible = false;
Symbol 2569 MovieClip Frame 2
_parent.gotoAndStop("hoverOut");
Symbol 2570 MovieClip Frame 15
stop();
Symbol 2571 MovieClip Frame 18
_parent.gotoAndStop("idle");
Symbol 2575 MovieClip Frame 2
_parent.gotoAndStop("hoverOut");
Symbol 2576 MovieClip Frame 15
stop();
Symbol 2577 MovieClip Frame 18
_parent.gotoAndStop("idle");
Symbol 2581 MovieClip Frame 2
_parent.gotoAndStop("hoverOut");
Symbol 2582 MovieClip Frame 15
stop();
Symbol 2583 MovieClip Frame 18
_parent.gotoAndStop("idle");
Symbol 2587 MovieClip Frame 2
_parent.gotoAndStop("hoverOut");
Symbol 2588 MovieClip Frame 15
stop();
Symbol 2589 MovieClip Frame 18
_parent.gotoAndStop("idle");
Symbol 2593 MovieClip Frame 2
_parent.gotoAndStop("hoverOut");
Symbol 2594 MovieClip Frame 15
stop();
Symbol 2595 MovieClip Frame 18
_parent.gotoAndStop("idle");
Symbol 2599 MovieClip Frame 2
_parent.gotoAndStop("hoverOut");
Symbol 2600 MovieClip Frame 15
stop();
Symbol 2601 MovieClip Frame 18
_parent.gotoAndStop("idle");
Symbol 2605 MovieClip Frame 2
_parent.gotoAndStop("hoverOut");
Symbol 2606 MovieClip Frame 15
stop();
Symbol 2607 MovieClip Frame 18
_parent.gotoAndStop("idle");
Symbol 2611 MovieClip Frame 2
_parent.gotoAndStop("hoverOut");
Symbol 2612 MovieClip Frame 15
stop();
Symbol 2613 MovieClip Frame 18
_parent.gotoAndStop("idle");
Instance of Symbol 2572 MovieClip in Symbol 2615 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
getURL ("http://www.armorgames.com", "_blank");
}
Instance of Symbol 2578 MovieClip in Symbol 2615 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.mcHit.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
if (_root.gameover) {
this.enabled = true;
this._alpha = 100;
} else {
this.enabled = false;
this._alpha = 50;
}
}
on (release) {
this.gotoAndStop("click");
_root.mcCam.mcMenu.mcLogo.soundMenuMusic.stop();
_root.mcCam.mcMenu._visible = false;
_root.mcCam.mcIntro._visible = true;
_root.mcCam.mcIntro.gotoAndPlay(2);
_root.mcCam.mcIntro.play();
}
Instance of Symbol 2584 MovieClip in Symbol 2615 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.mcHit.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_root.mcCam.mcMenu.mcLoad.textMsg.text = "";
_root.mcCam.mcMenu.mcLoad._visible = true;
_root.mcCam.mcMenu.mcLoad.gotoAndPlay("in");
_root.mcCam.mcMenu.mcItems._x = 270;
_root.mcCam.mcMenu.mcItemsFake._x = _root.mcCam.mcMenu.mcItems.baseX;
}
Instance of Symbol 2590 MovieClip in Symbol 2615 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.mcHit.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
if (_root.gameover) {
this._alpha = 50;
this.enabled = false;
} else {
this._alpha = 100;
this.enabled = true;
}
}
on (release) {
_root.mcCam.mcMenu.mcItems._x = 270;
_root.mcCam.mcMenu.mcItemsFake._x = _root.mcCam.mcMenu.mcItems.baseX;
_root.mcCam.mcMenu.mcSave.textMsg.text = "";
_root.mcCam.mcMenu.mcSave._visible = true;
_root.mcCam.mcMenu.mcSave.gotoAndPlay("in");
}
Instance of Symbol 2596 MovieClip in Symbol 2615 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_root.mcCam.mcMenu.mcItems._x = 270;
_root.mcCam.mcMenu.mcItemsFake._x = _root.mcCam.mcMenu.mcItems.baseX;
_root.mcCam.mcMenu.mcOptions.textMsg.text = "";
_root.mcCam.mcMenu.mcOptions._visible = true;
_root.mcCam.mcMenu.mcOptions.gotoAndPlay("in");
}
Instance of Symbol 2602 MovieClip in Symbol 2615 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_root.mcCam.mcMenu.mcItems._x = 270;
_root.mcCam.mcMenu.mcItemsFake._x = _root.mcCam.mcMenu.mcItems.baseX;
_root.mcCam.mcMenu.mcControls._visible = true;
_root.mcCam.mcMenu.mcControls.gotoAndPlay("in");
_root.mcCam.mcMenu.mcControls.mcChange._visible = false;
}
Instance of Symbol 2608 MovieClip in Symbol 2615 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.mcHit.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_root.mcCam.mcMenu.mcItems._x = 270;
_root.mcCam.mcMenu.mcItemsFake._x = _root.mcCam.mcMenu.mcItems.baseX;
_root.mcCam.mcMenu.mcCredits.textMsg.text = "";
_root.mcCam.mcMenu.mcCredits._visible = true;
_root.mcCam.mcMenu.mcCredits.gotoAndPlay("in");
}
Instance of Symbol 2614 MovieClip in Symbol 2615 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_root.mcCam.mcMenu.mcItems._x = 270;
_root.mcCam.mcMenu.mcItemsFake._x = _root.mcCam.mcMenu.mcItems.baseX;
_root.mcCam.mcMenu.mcHowto.textMsg.text = "";
_root.mcCam.mcMenu.mcHowto._visible = true;
_root.mcCam.mcMenu.mcHowto.gotoAndPlay("in");
}
Instance of Symbol 2574 MovieClip in Symbol 2616 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.gameover) {
this._alpha = 100;
} else {
this._alpha = 50;
}
}
Instance of Symbol 2586 MovieClip in Symbol 2616 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.gameover) {
this._alpha = 50;
} else {
this._alpha = 100;
}
}
Symbol 2641 MovieClip Frame 3
stop();
Instance of Symbol 2545 MovieClip in Symbol 2641 MovieClip Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_root.mcCam.mcMenu.mcItems._x = _root.mcCam.mcMenu.mcItems.baseX;
_root.mcCam.mcMenu.mcItemsFake._x = 270;
_parent.gotoAndPlay("out");
}
Symbol 2641 MovieClip Frame 11
this._visible = false;
Instance of Symbol 2545 MovieClip in Symbol 2652 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_root.savePoll = 2;
_root.mcCam.mcMenu.mcItems._x = _root.mcCam.mcMenu.mcItems.baseX;
_root.mcCam.mcMenu.mcItemsFake._x = 270;
_root.mcCam.mcMenu._visible = false;
_root.paused = false;
_parent._visible = false;
}
Symbol 2652 MovieClip Frame 3
stop();
Instance of Symbol 2545 MovieClip in Symbol 2652 MovieClip Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_parent._parent.currKey != "";
_parent.gotoAndPlay("out");
}
Instance of Symbol 2545 MovieClip in Symbol 2652 MovieClip Frame 9
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_root.savePoll = 2;
_root.mcCam.mcMenu.mcItems._x = _root.mcCam.mcMenu.mcItems.baseX;
_root.mcCam.mcMenu.mcItemsFake._x = 270;
_root.mcCam.mcMenu._visible = false;
_root.paused = false;
_parent._visible = false;
}
Symbol 2652 MovieClip Frame 11
this._visible = false;
Symbol 2676 MovieClip Frame 2
_parent.gotoAndStop("hoverOut");
Symbol 2677 MovieClip Frame 15
stop();
Symbol 2685 MovieClip Frame 2
_parent.gotoAndStop("hoverOut");
Symbol 2686 MovieClip Frame 15
stop();
Symbol 2691 MovieClip Frame 2
_parent.gotoAndStop("hoverOut");
Symbol 2692 MovieClip Frame 15
stop();
Instance of Symbol 2652 MovieClip "mcChange" in Symbol 2696 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
onClipEvent (keyDown) {
if ((_parent.currKey != "") && (!Key.isDown(27))) {
_root.p1[_parent.currKey] = Key.getCode();
_root.keys[_parent.currKey] = Key.getCode();
_parent.currKey = "";
gotoAndPlay ("out");
} else if (Key.isDown(27)) {
_parent.currKey = "";
gotoAndPlay ("out");
}
}
Symbol 2696 MovieClip Frame 3
stop();
currKey = "";
var K = new Array();
K[8] = "Backspace";
K[9] = "Tab";
K[13] = "Enter";
K[16] = "Shift";
K[17] = "Ctrl";
K[18] = "Alt";
K[20] = "Caps";
K[27] = "Esc";
K[32] = "Space";
K[33] = "Page Up";
K[34] = "Page Down";
K[35] = "End";
K[36] = "Home";
K[37] = "Left";
K[38] = "Up";
K[39] = "Right";
K[40] = "Down";
K[44] = ",";
K[45] = "Insert";
K[46] = "Del";
K[47] = "Help";
K[48] = "0";
K[49] = "1";
K[50] = "2";
K[51] = "3";
K[52] = "4";
K[53] = "5";
K[54] = "6";
K[55] = "7";
K[56] = "8";
K[57] = "9";
K[65] = "A";
K[66] = "B";
K[67] = "C";
K[68] = "D";
K[69] = "E";
K[70] = "F";
K[71] = "G";
K[72] = "H";
K[73] = "I";
K[74] = "J";
K[75] = "K";
K[76] = "L";
K[77] = "M";
K[78] = "N";
K[79] = "O";
K[80] = "P";
K[81] = "Q";
K[82] = "R";
K[83] = "S";
K[84] = "T";
K[85] = "U";
K[86] = "V";
K[87] = "W";
K[88] = "X";
K[89] = "Y";
K[90] = "Z";
K[96] = "`";
K[97] = "a";
K[98] = "b";
K[99] = "c";
K[100] = "d";
K[101] = "e";
K[102] = "f";
K[103] = "g";
K[104] = "h";
K[105] = "i";
K[106] = "j";
K[107] = "k";
K[108] = "l";
K[109] = "m";
K[110] = "n";
K[111] = "o";
K[112] = "p";
K[113] = "q";
K[114] = "r";
K[115] = "s";
K[116] = "t";
K[117] = "u";
K[118] = "v";
K[119] = "w";
K[120] = "x";
K[121] = "y";
K[122] = "z";
this.onEnterFrame = function () {
if (_root.mcCam.mcMenu._visible) {
textUp.text = K[_root.keys.keyUp1];
textDown.text = K[_root.keys.keyDown1];
textLeft.text = K[_root.keys.keyLeft];
textRight.text = K[_root.keys.keyRight];
textJump.text = K[_root.keys.keyJump];
textAttack.text = K[_root.keys.keyAttack];
textGrab.text = K[_root.keys.keyGrab];
textRun.text = K[_root.keys.keyFast];
textHide.text = K[_root.keys.keyHide];
textPause.text = K[_root.keys.keyPause];
}
};
Instance of Symbol 2678 MovieClip in Symbol 2696 MovieClip Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_root.resetKeys();
}
Instance of Symbol 2545 MovieClip in Symbol 2696 MovieClip Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_root.mcCam.mcMenu.mcItems._x = _root.mcCam.mcMenu.mcItems.baseX;
_root.mcCam.mcMenu.mcItemsFake._x = 270;
_parent.gotoAndPlay("out");
}
Instance of Symbol 2687 MovieClip in Symbol 2696 MovieClip Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_parent.currKey = "keyUp1";
_parent.mcChange._visible = true;
_parent.mcChange.gotoAndPlay("in");
}
Instance of Symbol 2687 MovieClip in Symbol 2696 MovieClip Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_parent.currKey = "keyDown1";
_parent.mcChange._visible = true;
_parent.mcChange.gotoAndPlay("in");
}
Instance of Symbol 2687 MovieClip in Symbol 2696 MovieClip Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_parent.currKey = "keyLeft";
_parent.mcChange._visible = true;
_parent.mcChange.gotoAndPlay("in");
}
Instance of Symbol 2687 MovieClip in Symbol 2696 MovieClip Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_parent.currKey = "keyRight";
_parent.mcChange._visible = true;
_parent.mcChange.gotoAndPlay("in");
}
Instance of Symbol 2687 MovieClip in Symbol 2696 MovieClip Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_parent.currKey = "keyAttack";
_parent.mcChange._visible = true;
_parent.mcChange.gotoAndPlay("in");
}
Instance of Symbol 2687 MovieClip in Symbol 2696 MovieClip Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_parent.currKey = "keyGrab";
_parent.mcChange._visible = true;
_parent.mcChange.gotoAndPlay("in");
}
Instance of Symbol 2687 MovieClip in Symbol 2696 MovieClip Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_parent.currKey = "keyFast";
_parent.mcChange._visible = true;
_parent.mcChange.gotoAndPlay("in");
}
Instance of Symbol 2687 MovieClip in Symbol 2696 MovieClip Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_parent.currKey = "keyHide";
_parent.mcChange._visible = true;
_parent.mcChange.gotoAndPlay("in");
}
Instance of Symbol 2687 MovieClip in Symbol 2696 MovieClip Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_parent.currKey = "keyPause";
_parent.mcChange._visible = true;
_parent.mcChange.gotoAndPlay("in");
}
Instance of Symbol 2693 MovieClip in Symbol 2696 MovieClip Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_root.saveKeys();
}
Instance of Symbol 2687 MovieClip in Symbol 2696 MovieClip Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_parent.currKey = "keyJump";
_parent.mcChange._visible = true;
_parent.mcChange.gotoAndPlay("in");
}
Symbol 2696 MovieClip Frame 11
this._visible = false;
Symbol 2717 MovieClip Frame 2
_parent.gotoAndStop("hoverOut");
Symbol 2718 MovieClip Frame 15
stop();
Symbol 2812 MovieClip Frame 1
stop();
var K = new Array();
K[8] = "Backspace";
K[9] = "Tab";
K[13] = "Enter";
K[16] = "Shift";
K[17] = "Ctrl";
K[18] = "Alt";
K[20] = "Caps";
K[27] = "Esc";
K[32] = "Space";
K[33] = "Page Up";
K[34] = "Page Down";
K[35] = "End";
K[36] = "Home";
K[37] = "Left";
K[38] = "Up";
K[39] = "Right";
K[40] = "Down";
K[44] = ",";
K[45] = "Insert";
K[46] = "Del";
K[47] = "Help";
K[48] = "0";
K[49] = "1";
K[50] = "2";
K[51] = "3";
K[52] = "4";
K[53] = "5";
K[54] = "6";
K[55] = "7";
K[56] = "8";
K[57] = "9";
K[65] = "A";
K[66] = "B";
K[67] = "C";
K[68] = "D";
K[69] = "E";
K[70] = "F";
K[71] = "G";
K[72] = "H";
K[73] = "I";
K[74] = "J";
K[75] = "K";
K[76] = "L";
K[77] = "M";
K[78] = "N";
K[79] = "O";
K[80] = "P";
K[81] = "Q";
K[82] = "R";
K[83] = "S";
K[84] = "T";
K[85] = "U";
K[86] = "V";
K[87] = "W";
K[88] = "X";
K[89] = "Y";
K[90] = "Z";
K[96] = "`";
K[97] = "a";
K[98] = "b";
K[99] = "c";
K[100] = "d";
K[101] = "e";
K[102] = "f";
K[103] = "g";
K[104] = "h";
K[105] = "i";
K[106] = "j";
K[107] = "k";
K[108] = "l";
K[109] = "m";
K[110] = "n";
K[111] = "o";
K[112] = "p";
K[113] = "q";
K[114] = "r";
K[115] = "s";
K[116] = "t";
K[117] = "u";
K[118] = "v";
K[119] = "w";
K[120] = "x";
K[121] = "y";
K[122] = "z";
this.onEnterFrame = function () {
if (_root.paused || (_root.gameover)) {
textAttack.text = K[_root.keys.keyAttack];
textJump.text = K[_root.keys.keyJump];
textGrab.text = K[_root.keys.keyGrab];
textRun.text = K[_root.keys.keyFast];
textHide.text = K[_root.keys.keyHide];
}
};
Instance of Symbol 2719 MovieClip in Symbol 2812 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_parent.nextFrame();
}
Instance of Symbol 2719 MovieClip in Symbol 2812 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_parent.prevFrame();
}
Instance of Symbol 2 MovieClip in Symbol 2812 MovieClip Frame 1
on (release) {
_parent.gotoAndStop("general");
}
Instance of Symbol 2 MovieClip in Symbol 2812 MovieClip Frame 1
on (release) {
_parent.gotoAndStop("attacks");
}
Instance of Symbol 2 MovieClip in Symbol 2812 MovieClip Frame 1
on (release) {
_parent.gotoAndStop("grabbing");
}
Instance of Symbol 2 MovieClip in Symbol 2812 MovieClip Frame 1
on (release) {
_parent.gotoAndStop("ledges");
}
Instance of Symbol 2 MovieClip in Symbol 2812 MovieClip Frame 1
on (release) {
_parent.gotoAndStop("looking");
}
Instance of Symbol 2 MovieClip in Symbol 2812 MovieClip Frame 1
on (release) {
_parent.gotoAndStop("staffs");
}
Instance of Symbol 2 MovieClip in Symbol 2812 MovieClip Frame 1
on (release) {
_parent.gotoAndStop("health");
}
Instance of Symbol 2 MovieClip in Symbol 2812 MovieClip Frame 1
on (release) {
_parent.gotoAndStop("stealth");
}
Symbol 2827 MovieClip Frame 3
stop();
Instance of Symbol 2545 MovieClip in Symbol 2827 MovieClip Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_root.mcCam.mcMenu.mcItems._x = _root.mcCam.mcMenu.mcItems.baseX;
_root.mcCam.mcMenu.mcItemsFake._x = 270;
_parent.gotoAndPlay("out");
}
Symbol 2827 MovieClip Frame 11
this._visible = false;
Symbol 2834 MovieClip Frame 2
_parent.gotoAndStop("hoverOut");
Symbol 2835 MovieClip Frame 15
stop();
Symbol 2839 MovieClip Frame 2
_parent.gotoAndStop("hoverOut");
Symbol 2840 MovieClip Frame 15
stop();
Symbol 2844 MovieClip Frame 2
_parent.gotoAndStop("hoverOut");
Symbol 2845 MovieClip Frame 15
stop();
Symbol 2849 MovieClip Frame 2
_parent.gotoAndStop("hoverOut");
Symbol 2850 MovieClip Frame 15
stop();
Symbol 2852 MovieClip Frame 1
function makeFire(xOffset, yOffset) {
this.fireNum++;
if (this.fireNum > (fireDepth + _root.stealthFireMax)) {
this.fireNum = fireDepth + 1;
}
_parent.stealthFire.duplicateMovieClip("stealthFire" + this.fireNum, this.fireNum + 100);
_parent.stealthFireBack.duplicateMovieClip("stealthFireBack" + this.fireNum, this.fireNum);
var _local4 = _parent["stealthFire" + this.fireNum];
var _local5 = _parent["stealthFireBack" + this.fireNum];
_local4._x = this._x + xOffset;
_local4._y = (this._y + 2) + yOffset;
rand = Math.random();
_local4._width = (rand * 6) + 8;
_local4._height = (rand * 6) + 8;
_local5._width = _local4._width + 4;
_local5._height = _local4._height + 4;
}
stop();
counter = 0;
fireNum = 0;
fireDepth = 1000;
this.onEnterFrame = function () {
this.counter++;
this._xscale = random(30) + 70;
this._yscale = this._xscale;
if (_root.mcCam.mcMenu._visible && (_root.mcCam.mcMenu.mcOptions._visible)) {
if (_root.settingParticles == 3) {
if (_root.bossCount <= 0) {
this.makeFire(0, 0);
if ((this.counter % 2) == 0) {
this.makeFire(0, 0);
}
} else if ((this.counter % 2) == 0) {
this.makeFire(0, 0);
}
} else if (_root.settingParticles == 2) {
if (_root.bossCount <= 0) {
this.makeFire(0, 0);
} else if ((this.counter % 4) == 0) {
this.makeFire(0, 0);
}
} else if (_root.settingParticles == 1) {
if (_root.bossCount <= 0) {
if ((this.counter % 2) == 0) {
this.makeFire(0, 0);
}
} else if ((this.counter % 6) == 0) {
this.makeFire(0, 0);
}
} else if (_root.bossCount <= 0) {
if ((this.counter % 4) == 0) {
this.makeFire(0, 0);
}
} else if ((this.counter % 10) == 0) {
this.makeFire(0, 0);
}
}
};
Symbol 2852 MovieClip Frame 14
gotoAndPlay ("loop");
Instance of Symbol 2678 MovieClip in Symbol 2871 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_root.settingParticles = 2;
_quality = "MEDIUM";
}
Instance of Symbol 2545 MovieClip in Symbol 2871 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_parent.gotoAndPlay("out");
}
Instance of Symbol 2836 MovieClip in Symbol 2871 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_quality = "HIGH";
}
Instance of Symbol 2841 MovieClip in Symbol 2871 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_quality = "MEDIUM";
}
Instance of Symbol 2846 MovieClip in Symbol 2871 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_quality = "LOW";
}
Instance of Symbol 2851 MovieClip in Symbol 2871 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_root.settingParticles = 3;
}
Instance of Symbol 2836 MovieClip in Symbol 2871 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_root.settingParticles = 2;
}
Instance of Symbol 2841 MovieClip in Symbol 2871 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_root.settingParticles = 1;
}
Instance of Symbol 2846 MovieClip in Symbol 2871 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_root.settingParticles = 0;
}
Instance of Symbol 239 MovieClip "stealthFireBack" in Symbol 2871 MovieClip Frame 1
onClipEvent (load) {
name1 = this._name.substring(15, this._name.length);
name1 = _parent["stealthFire" + name1];
}
onClipEvent (enterFrame) {
if (this._name != "stealthFireBack") {
this._x = name1._x + name1.xVel;
this._y = name1._y + name1.yVel;
this._rotation = name1._rotation;
if (name1._alpha != undefined) {
this._alpha = name1._alpha;
} else {
this._alpha = 0;
this.removeMovieClip();
}
}
}
Instance of Symbol 241 MovieClip "stealthFire" in Symbol 2871 MovieClip Frame 1
onClipEvent (load) {
this._alpha = 100;
this.yVel = (-(Math.random() / 3)) - 0.5;
if (Math.random() > 0.5) {
this.xVel = Math.random() * 0.3;
this.xAccel = Math.random() * -0.01;
} else {
this.xVel = (-Math.random()) * 0.12;
this.xAccel = Math.random() * 0.01;
}
if (Math.random() > 0.5) {
this.rotVel = (Math.random() * 10) + 5;
} else {
this.rotVel = ((-Math.random()) * 10) - 5;
}
this.life = Math.random() + 1.5;
}
onClipEvent (enterFrame) {
if (this._name != "stealthFire") {
if (this.life > 0) {
this.xVel = this.xVel + this.xAccel;
}
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
this.life = this.life - 0.1;
if (this.life < 0) {
this._alpha = 0;
this.removeMovieClip();
} else if (this.life < 0.25) {
this._xscale = this._xscale * 0.8;
this._yscale = this._xscale;
this._alpha = 50;
}
}
}
Symbol 2871 MovieClip Frame 3
stop();
Instance of Symbol 2545 MovieClip in Symbol 2871 MovieClip Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_root.mcCam.mcMenu.mcItems._x = _root.mcCam.mcMenu.mcItems.baseX;
_root.mcCam.mcMenu.mcItemsFake._x = 270;
_parent.gotoAndPlay("out");
}
Instance of Symbol 2545 MovieClip in Symbol 2871 MovieClip Frame 9
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_parent.gotoAndPlay("out");
}
Symbol 2871 MovieClip Frame 11
this._visible = false;
Symbol 2875 MovieClip Frame 2
_parent.gotoAndStop("hoverOut");
Symbol 2876 MovieClip Frame 15
stop();
Symbol 2880 MovieClip Frame 2
_parent.gotoAndStop("hoverOut");
Symbol 2881 MovieClip Frame 15
stop();
Symbol 2895 MovieClip Frame 3
stop();
Instance of Symbol 2877 MovieClip in Symbol 2895 MovieClip Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_root.savePoll = 2;
_root.mcCam.mcMenu.mcItems._x = _root.mcCam.mcMenu.mcItems.baseX;
_root.mcCam.mcMenu.mcItemsFake._x = 270;
_root.mcCam.mcMenu._visible = false;
_root.paused = false;
_parent._visible = false;
}
Instance of Symbol 2882 MovieClip in Symbol 2895 MovieClip Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_root.mcCam.mcMenu.mcItems._x = _root.mcCam.mcMenu.mcItems.baseX;
_root.mcCam.mcMenu.mcItemsFake._x = 270;
_parent.gotoAndPlay("out");
}
Symbol 2895 MovieClip Frame 11
this._visible = false;
Symbol 2906 MovieClip Frame 3
stop();
Instance of Symbol 2877 MovieClip in Symbol 2906 MovieClip Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
if (_root.gameover) {
if (_root.loadSavedGame()) {
_root.mcCam.mcMenu.mcItems._x = _root.mcCam.mcMenu.mcItems.baseX;
_root.mcCam.mcMenu.mcItemsFake._x = 270;
}
_root.loadCount = 2;
_root.loadSave = true;
}
if (_root.loadSavedGame()) {
_root.mcCam.mcMenu.mcItems._x = _root.mcCam.mcMenu.mcItems.baseX;
_root.mcCam.mcMenu.mcItemsFake._x = 270;
_root.mcCam.mcMenu._visible = false;
_root.paused = false;
_parent._visible = false;
}
}
Instance of Symbol 2882 MovieClip in Symbol 2906 MovieClip Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("hover");
}
}
on (release) {
_root.mcCam.mcMenu.mcItems._x = _root.mcCam.mcMenu.mcItems.baseX;
_root.mcCam.mcMenu.mcItemsFake._x = 270;
_parent.gotoAndPlay("out");
}
Symbol 2906 MovieClip Frame 11
this._visible = false;
Instance of Symbol 2615 MovieClip "mcItems" in Symbol 2907 MovieClip Frame 1
onClipEvent (load) {
baseX = this._x;
}
Instance of Symbol 305 MovieClip "mcLogo" in Symbol 2907 MovieClip Frame 1
onClipEvent (load) {
soundMenuMusic = new Sound(this);
soundMenuMusic.attachSound("menu_music");
soundMenuMusic.start(0, 1000);
}
Instance of Symbol 2641 MovieClip "mcCredits" in Symbol 2907 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 2696 MovieClip "mcControls" in Symbol 2907 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 2827 MovieClip "mcHowto" in Symbol 2907 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 2871 MovieClip "mcOptions" in Symbol 2907 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 2895 MovieClip "mcSave" in Symbol 2907 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 2906 MovieClip "mcLoad" in Symbol 2907 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 2911 Button
on (release) {
if (!_root.gameover) {
_root.paused = !_root.paused;
if (_root.paused) {
_root.showMenuMain();
} else {
_root.hideMenuMain();
}
}
}
Symbol 2917 MovieClip Frame 1
mcFrame._visible = false;
baseX = this._x;
baseY = this._y;
Instance of Symbol 2432 MovieClip "mcPaused" in Symbol 2917 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 2916 MovieClip "mcHUD0" in Symbol 2917 MovieClip Frame 1
onClipEvent (load) {
keyPressed = false;
this._visible = false;
}
onClipEvent (enterFrame) {
if (Key.isDown(8)) {
if (!keyPressed) {
keyPressed = true;
this._visible = !this._visible;
}
} else {
keyPressed = false;
}
}